diff options
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | build/build.xml | 30 | ||||
-rw-r--r-- | phpBB/adm/index.php | 4 | ||||
-rw-r--r-- | phpBB/adm/style/acp_attachments.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/acp_ban.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/acp_bbcodes.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/acp_board.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/acp_bots.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/acp_captcha.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/acp_database.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/acp_disallow.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/acp_email.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/acp_forums.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/acp_groups.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/acp_groups_position.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/acp_icons.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/acp_inactive.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/acp_jabber.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/acp_language.html | 4 | ||||
-rw-r--r-- | phpBB/adm/style/acp_logs.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/acp_main.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/acp_modules.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/acp_permission_roles.html | 6 | ||||
-rw-r--r-- | phpBB/adm/style/acp_permissions.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/acp_php_info.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/acp_profile.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/acp_prune_forums.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/acp_prune_users.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/acp_ranks.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/acp_reasons.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/acp_search.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/acp_send_statistics.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/acp_styles.html | 143 | ||||
-rw-r--r-- | phpBB/adm/style/acp_update.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/acp_users.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/acp_words.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/admin.css | 8 | ||||
-rw-r--r-- | phpBB/adm/style/captcha_gd_acp.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/captcha_qa_acp.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/captcha_recaptcha_acp.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/install_footer.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/overall_footer.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/permission_forum_copy.html | 2 | ||||
-rw-r--r-- | phpBB/adm/style/simple_footer.html | 2 | ||||
-rw-r--r-- | phpBB/assets/javascript/jquery.js | 18 | ||||
-rw-r--r-- | phpBB/common.php | 5 | ||||
-rw-r--r-- | phpBB/develop/compile_template.php | 24 | ||||
-rw-r--r-- | phpBB/develop/create_schema_files.php | 18 | ||||
-rw-r--r-- | phpBB/develop/imageset_to_css.php | 274 | ||||
-rw-r--r-- | phpBB/develop/mysql_upgrader.php | 31 | ||||
-rw-r--r-- | phpBB/docs/AUTHORS | 1 | ||||
-rw-r--r-- | phpBB/docs/README.html | 2 | ||||
-rw-r--r-- | phpBB/docs/coding-guidelines.html | 53 | ||||
-rw-r--r-- | phpBB/docs/hook_system.html | 5 | ||||
-rw-r--r-- | phpBB/download/file.php | 6 | ||||
-rw-r--r-- | phpBB/feed.php | 33 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_bbcodes.php | 2 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_captcha.php | 10 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_database.php | 14 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_forums.php | 2 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_language.php | 65 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_send_statistics.php | 6 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_styles.php | 1611 | ||||
-rw-r--r-- | phpBB/includes/acp/info/acp_styles.php | 1 | ||||
-rw-r--r-- | phpBB/includes/auth/auth_apache.php | 27 | ||||
-rw-r--r-- | phpBB/includes/auth/auth_db.php | 2 | ||||
-rw-r--r-- | phpBB/includes/bbcode.php | 31 | ||||
-rw-r--r-- | phpBB/includes/captcha/captcha_factory.php | 2 | ||||
-rw-r--r-- | phpBB/includes/captcha/plugins/phpbb_captcha_gd_plugin.php | 4 | ||||
-rw-r--r-- | phpBB/includes/captcha/plugins/phpbb_captcha_nogd_plugin.php | 4 | ||||
-rw-r--r-- | phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php | 4 | ||||
-rw-r--r-- | phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php | 7 | ||||
-rw-r--r-- | phpBB/includes/db/db_tools.php | 20 | ||||
-rw-r--r-- | phpBB/includes/db/mssqlnative.php | 2 | ||||
-rw-r--r-- | phpBB/includes/db/mysqli.php | 8 | ||||
-rw-r--r-- | phpBB/includes/error_collector.php | 12 | ||||
-rw-r--r-- | phpBB/includes/functions.php | 154 | ||||
-rw-r--r-- | phpBB/includes/functions_content.php | 2 | ||||
-rw-r--r-- | phpBB/includes/functions_display.php | 51 | ||||
-rw-r--r-- | phpBB/includes/functions_download.php | 39 | ||||
-rw-r--r-- | phpBB/includes/functions_messenger.php | 35 | ||||
-rw-r--r-- | phpBB/includes/functions_posting.php | 2 | ||||
-rw-r--r-- | phpBB/includes/functions_privmsgs.php | 111 | ||||
-rw-r--r-- | phpBB/includes/functions_template.php | 812 | ||||
-rw-r--r-- | phpBB/includes/functions_transfer.php | 55 | ||||
-rw-r--r-- | phpBB/includes/functions_user.php | 4 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_forum.php | 1 | ||||
-rw-r--r-- | phpBB/includes/questionnaire/questionnaire.php | 22 | ||||
-rw-r--r-- | phpBB/includes/request/interface.php | 35 | ||||
-rw-r--r-- | phpBB/includes/request/request.php | 64 | ||||
-rw-r--r-- | phpBB/includes/request/type_cast_helper.php | 13 | ||||
-rw-r--r-- | phpBB/includes/search/fulltext_mysql.php | 2 | ||||
-rw-r--r-- | phpBB/includes/session.php | 296 | ||||
-rw-r--r-- | phpBB/includes/template.php | 690 | ||||
-rw-r--r-- | phpBB/includes/template/compile.php | 122 | ||||
-rw-r--r-- | phpBB/includes/template/context.php | 342 | ||||
-rw-r--r-- | phpBB/includes/template/filter.php | 971 | ||||
-rw-r--r-- | phpBB/includes/template/locator.php | 211 | ||||
-rw-r--r-- | phpBB/includes/template/renderer.php | 35 | ||||
-rw-r--r-- | phpBB/includes/template/renderer_eval.php | 60 | ||||
-rw-r--r-- | phpBB/includes/template/renderer_include.php | 60 | ||||
-rw-r--r-- | phpBB/includes/template/template.php | 486 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_main.php | 3 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_pm_viewfolder.php | 1 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_pm_viewmessage.php | 2 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_register.php | 7 | ||||
-rw-r--r-- | phpBB/index.php | 19 | ||||
-rw-r--r-- | phpBB/install/database_update.php | 112 | ||||
-rw-r--r-- | phpBB/install/index.php | 24 | ||||
-rw-r--r-- | phpBB/install/install_install.php | 89 | ||||
-rw-r--r-- | phpBB/install/install_update.php | 3 | ||||
-rw-r--r-- | phpBB/install/schemas/firebird_schema.sql | 71 | ||||
-rw-r--r-- | phpBB/install/schemas/mssql_schema.sql | 80 | ||||
-rw-r--r-- | phpBB/install/schemas/mysql_40_schema.sql | 45 | ||||
-rw-r--r-- | phpBB/install/schemas/mysql_41_schema.sql | 45 | ||||
-rw-r--r-- | phpBB/install/schemas/oracle_schema.sql | 88 | ||||
-rw-r--r-- | phpBB/install/schemas/postgres_schema.sql | 53 | ||||
-rw-r--r-- | phpBB/install/schemas/schema_data.sql | 79 | ||||
-rw-r--r-- | phpBB/install/schemas/sqlite_schema.sql | 45 | ||||
-rw-r--r-- | phpBB/language/en/acp/common.php | 17 | ||||
-rw-r--r-- | phpBB/language/en/acp/forums.php | 2 | ||||
-rw-r--r-- | phpBB/language/en/acp/styles.php | 81 | ||||
-rw-r--r-- | phpBB/language/en/help_faq.php | 2 | ||||
-rw-r--r-- | phpBB/language/en/install.php | 2 | ||||
-rw-r--r-- | phpBB/memberlist.php | 4 | ||||
-rw-r--r-- | phpBB/posting.php | 2 | ||||
-rw-r--r-- | phpBB/search.php | 3 | ||||
-rw-r--r-- | phpBB/style.php | 303 | ||||
-rw-r--r-- | phpBB/styles/prosilver/imageset/en/imageset.cfg | 35 | ||||
-rw-r--r-- | phpBB/styles/prosilver/imageset/en/index.htm | 0 | ||||
-rw-r--r-- | phpBB/styles/prosilver/imageset/imageset.cfg | 116 | ||||
-rw-r--r-- | phpBB/styles/prosilver/imageset/index.htm | 0 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/editor.js | 11 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/forum_fn.js | 2 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/forumlist_body.html | 10 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/mcp_front.html | 1 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/mcp_move.html | 2 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/mcp_notes_user.html | 2 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/mcp_viewlogs.html | 53 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/memberlist_view.html | 6 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/overall_footer.html | 4 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/overall_header.html | 9 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/search_results.html | 10 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/simple_footer.html | 2 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/simple_header.html | 3 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/ucp_attachments.html | 4 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/viewforum_body.html | 10 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/viewtopic_print.html | 2 | ||||
-rw-r--r-- | phpBB/styles/prosilver/theme/buttons.css | 40 | ||||
-rw-r--r-- | phpBB/styles/prosilver/theme/colours.css | 240 | ||||
-rw-r--r-- | phpBB/styles/prosilver/theme/content.css | 14 | ||||
-rw-r--r-- | phpBB/styles/prosilver/theme/en/button_pm_forward.gif (renamed from phpBB/styles/prosilver/imageset/en/button_pm_forward.gif) | bin | 2168 -> 2168 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/en/button_pm_new.gif (renamed from phpBB/styles/prosilver/imageset/en/button_pm_new.gif) | bin | 2005 -> 2005 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/en/button_pm_reply.gif (renamed from phpBB/styles/prosilver/imageset/en/button_pm_reply.gif) | bin | 2126 -> 2126 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/en/button_topic_locked.gif (renamed from phpBB/styles/prosilver/imageset/en/button_topic_locked.gif) | bin | 1923 -> 1923 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/en/button_topic_new.gif (renamed from phpBB/styles/prosilver/imageset/en/button_topic_new.gif) | bin | 2737 -> 2737 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/en/button_topic_reply.gif (renamed from phpBB/styles/prosilver/imageset/en/button_topic_reply.gif) | bin | 2135 -> 2135 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/en/icon_contact_pm.gif (renamed from phpBB/styles/prosilver/imageset/en/icon_contact_pm.gif) | bin | 677 -> 677 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/en/icon_post_edit.gif (renamed from phpBB/styles/prosilver/imageset/en/icon_post_edit.gif) | bin | 853 -> 853 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/en/icon_post_quote.gif (renamed from phpBB/styles/prosilver/imageset/en/icon_post_quote.gif) | bin | 1109 -> 1109 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/en/icon_user_online.gif (renamed from phpBB/styles/prosilver/imageset/en/icon_user_online.gif) | bin | 423 -> 423 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/en/stylesheet.css | 64 | ||||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/announce_read.gif (renamed from phpBB/styles/prosilver/imageset/announce_read.gif) | bin | 754 -> 754 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/announce_read_locked.gif (renamed from phpBB/styles/prosilver/imageset/announce_read_locked.gif) | bin | 738 -> 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) | bin | 753 -> 753 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/announce_read_mine.gif (renamed from phpBB/styles/prosilver/imageset/announce_read_mine.gif) | bin | 750 -> 750 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/announce_unread.gif (renamed from phpBB/styles/prosilver/imageset/announce_unread.gif) | bin | 756 -> 756 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/announce_unread_locked.gif (renamed from phpBB/styles/prosilver/imageset/announce_unread_locked.gif) | bin | 745 -> 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) | bin | 755 -> 755 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/announce_unread_mine.gif (renamed from phpBB/styles/prosilver/imageset/announce_unread_mine.gif) | bin | 791 -> 791 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/forum_link.gif (renamed from phpBB/styles/prosilver/imageset/forum_link.gif) | bin | 734 -> 734 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/forum_read.gif (renamed from phpBB/styles/prosilver/imageset/forum_read.gif) | bin | 688 -> 688 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/forum_read_locked.gif (renamed from phpBB/styles/prosilver/imageset/forum_read_locked.gif) | bin | 707 -> 707 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/forum_read_subforum.gif (renamed from phpBB/styles/prosilver/imageset/forum_read_subforum.gif) | bin | 751 -> 751 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/forum_unread.gif (renamed from phpBB/styles/prosilver/imageset/forum_unread.gif) | bin | 693 -> 693 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/forum_unread_locked.gif (renamed from phpBB/styles/prosilver/imageset/forum_unread_locked.gif) | bin | 677 -> 677 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/forum_unread_subforum.gif (renamed from phpBB/styles/prosilver/imageset/forum_unread_subforum.gif) | bin | 751 -> 751 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/icon_back_top.gif (renamed from phpBB/styles/prosilver/imageset/icon_back_top.gif) | bin | 204 -> 204 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/icon_contact_aim.gif (renamed from phpBB/styles/prosilver/imageset/icon_contact_aim.gif) | bin | 546 -> 546 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/icon_contact_email.gif (renamed from phpBB/styles/prosilver/imageset/icon_contact_email.gif) | bin | 523 -> 523 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/icon_contact_icq.gif (renamed from phpBB/styles/prosilver/imageset/icon_contact_icq.gif) | bin | 562 -> 562 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/icon_contact_jabber.gif (renamed from phpBB/styles/prosilver/imageset/icon_contact_jabber.gif) | bin | 1014 -> 1014 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/icon_contact_msnm.gif (renamed from phpBB/styles/prosilver/imageset/icon_contact_msnm.gif) | bin | 1466 -> 1466 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/icon_contact_www.gif (renamed from phpBB/styles/prosilver/imageset/icon_contact_www.gif) | bin | 590 -> 590 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/icon_contact_yahoo.gif (renamed from phpBB/styles/prosilver/imageset/icon_contact_yahoo.gif) | bin | 541 -> 541 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/icon_offline.gif (renamed from phpBB/styles/prosilver/imageset/icon_offline.gif) | bin | 384 -> 384 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/icon_online.gif (renamed from phpBB/styles/prosilver/imageset/icon_online.gif) | bin | 393 -> 393 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/icon_post_delete.gif (renamed from phpBB/styles/prosilver/imageset/icon_post_delete.gif) | bin | 528 -> 528 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/icon_post_info.gif (renamed from phpBB/styles/prosilver/imageset/icon_post_info.gif) | bin | 501 -> 501 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/icon_post_report.gif (renamed from phpBB/styles/prosilver/imageset/icon_post_report.gif) | bin | 474 -> 474 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/icon_post_target.gif (renamed from phpBB/styles/prosilver/imageset/icon_post_target.gif) | bin | 186 -> 186 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/icon_post_target_unread.gif (renamed from phpBB/styles/prosilver/imageset/icon_post_target_unread.gif) | bin | 151 -> 151 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/icon_rate_bad.gif (renamed from phpBB/styles/prosilver/imageset/icon_rate_bad.gif) | bin | 465 -> 465 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/icon_rate_good.gif (renamed from phpBB/styles/prosilver/imageset/icon_rate_good.gif) | bin | 462 -> 462 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/icon_topic_attach.gif (renamed from phpBB/styles/prosilver/imageset/icon_topic_attach.gif) | bin | 144 -> 144 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/icon_topic_latest.gif (renamed from phpBB/styles/prosilver/imageset/icon_topic_latest.gif) | bin | 186 -> 186 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/icon_topic_newest.gif (renamed from phpBB/styles/prosilver/imageset/icon_topic_newest.gif) | bin | 155 -> 155 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/icon_topic_reported.gif (renamed from phpBB/styles/prosilver/imageset/icon_topic_reported.gif) | bin | 246 -> 246 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/icon_topic_unapproved.gif (renamed from phpBB/styles/prosilver/imageset/icon_topic_unapproved.gif) | bin | 253 -> 253 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/icon_user_warn.gif (renamed from phpBB/styles/prosilver/imageset/icon_user_warn.gif) | bin | 481 -> 481 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/site_logo.gif (renamed from phpBB/styles/prosilver/imageset/site_logo.gif) | bin | 5070 -> 5070 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/sticky_read.gif (renamed from phpBB/styles/prosilver/imageset/sticky_read.gif) | bin | 651 -> 651 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/sticky_read_locked.gif (renamed from phpBB/styles/prosilver/imageset/sticky_read_locked.gif) | bin | 646 -> 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) | bin | 662 -> 662 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/sticky_read_mine.gif (renamed from phpBB/styles/prosilver/imageset/sticky_read_mine.gif) | bin | 659 -> 659 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/sticky_unread.gif (renamed from phpBB/styles/prosilver/imageset/sticky_unread.gif) | bin | 648 -> 648 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/sticky_unread_locked.gif (renamed from phpBB/styles/prosilver/imageset/sticky_unread_locked.gif) | bin | 626 -> 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) | bin | 682 -> 682 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/sticky_unread_mine.gif (renamed from phpBB/styles/prosilver/imageset/sticky_unread_mine.gif) | bin | 669 -> 669 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/subforum_read.gif (renamed from phpBB/styles/prosilver/imageset/subforum_read.gif) | bin | 124 -> 124 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/subforum_unread.gif (renamed from phpBB/styles/prosilver/imageset/subforum_unread.gif) | bin | 124 -> 124 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/topic_moved.gif (renamed from phpBB/styles/prosilver/imageset/topic_moved.gif) | bin | 693 -> 693 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/topic_read.gif (renamed from phpBB/styles/prosilver/imageset/topic_read.gif) | bin | 679 -> 679 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/topic_read_hot.gif (renamed from phpBB/styles/prosilver/imageset/topic_read_hot.gif) | bin | 1469 -> 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) | bin | 1519 -> 1519 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/topic_read_locked.gif (renamed from phpBB/styles/prosilver/imageset/topic_read_locked.gif) | bin | 748 -> 748 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/topic_read_locked_mine.gif (renamed from phpBB/styles/prosilver/imageset/topic_read_locked_mine.gif) | bin | 749 -> 749 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/topic_read_mine.gif (renamed from phpBB/styles/prosilver/imageset/topic_read_mine.gif) | bin | 695 -> 695 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/topic_unread.gif (renamed from phpBB/styles/prosilver/imageset/topic_unread.gif) | bin | 678 -> 678 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/topic_unread_hot.gif (renamed from phpBB/styles/prosilver/imageset/topic_unread_hot.gif) | bin | 1431 -> 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) | bin | 1364 -> 1364 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/topic_unread_locked.gif (renamed from phpBB/styles/prosilver/imageset/topic_unread_locked.gif) | bin | 745 -> 745 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/topic_unread_locked_mine.gif (renamed from phpBB/styles/prosilver/imageset/topic_unread_locked_mine.gif) | bin | 764 -> 764 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/images/topic_unread_mine.gif (renamed from phpBB/styles/prosilver/imageset/topic_unread_mine.gif) | bin | 704 -> 704 bytes | |||
-rw-r--r-- | phpBB/styles/prosilver/theme/imageset.css | 406 | ||||
-rw-r--r-- | phpBB/styles/prosilver/theme/links.css | 4 | ||||
-rw-r--r-- | phpBB/styles/prosilver/theme/stylesheet.css | 1 | ||||
-rw-r--r-- | phpBB/styles/prosilver/theme/theme.cfg | 14 | ||||
-rw-r--r-- | phpBB/styles/prosilver/theme/tweaks.css | 4 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/imageset/en/imageset.cfg | 47 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/imageset/imageset.cfg | 100 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/attachment.html | 2 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/editor.js | 11 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/forumlist_body.html | 4 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/mcp_forum.html | 4 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/mcp_move.html | 4 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/mcp_post.html | 4 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/mcp_topic.html | 2 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/mcp_viewlogs.html | 52 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/memberlist_body.html | 6 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/memberlist_group.html | 2 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/memberlist_leaders.html | 2 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/memberlist_view.html | 22 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/overall_footer.html | 2 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/overall_header.html | 3 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/posting_review.html | 2 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/posting_topic_review.html | 4 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/search_results.html | 8 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/simple_footer.html | 2 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/simple_header.html | 1 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/ucp_main_subscribed.html | 6 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/ucp_pm_history.html | 2 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/ucp_pm_viewfolder.html | 2 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/ucp_pm_viewmessage.html | 4 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/viewforum_body.html | 20 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/viewtopic_body.html | 22 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/theme/en/button_pm_new.gif (renamed from phpBB/styles/subsilver2/imageset/en/button_pm_new.gif) | bin | 1135 -> 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) | bin | 1667 -> 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) | bin | 1101 -> 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) | bin | 1164 -> 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) | bin | 1234 -> 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) | bin | 580 -> 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) | bin | 659 -> 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) | bin | 574 -> 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) | bin | 674 -> 674 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/en/icon_contact_msnm.gif (renamed from phpBB/styles/subsilver2/imageset/en/icon_contact_msnm.gif) | bin | 1503 -> 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) | bin | 706 -> 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) | bin | 604 -> 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) | bin | 663 -> 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) | bin | 314 -> 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) | bin | 662 -> 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) | bin | 305 -> 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) | bin | 666 -> 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) | bin | 308 -> 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) | bin | 547 -> 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) | bin | 520 -> 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) | bin | 667 -> 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) | bin | 608 -> 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) | bin | 673 -> 673 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/en/stylesheet.css | 116 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/announce_read.gif (renamed from phpBB/styles/subsilver2/imageset/announce_read.gif) | bin | 307 -> 307 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/announce_read_locked.gif (renamed from phpBB/styles/subsilver2/imageset/announce_read_locked.gif) | bin | 304 -> 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) | bin | 324 -> 324 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/announce_read_mine.gif (renamed from phpBB/styles/subsilver2/imageset/announce_read_mine.gif) | bin | 328 -> 328 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/announce_unread.gif (renamed from phpBB/styles/subsilver2/imageset/announce_unread.gif) | bin | 289 -> 289 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/announce_unread_locked.gif (renamed from phpBB/styles/subsilver2/imageset/announce_unread_locked.gif) | bin | 292 -> 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) | bin | 308 -> 308 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/announce_unread_mine.gif (renamed from phpBB/styles/subsilver2/imageset/announce_unread_mine.gif) | bin | 305 -> 305 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/forum_link.gif (renamed from phpBB/styles/subsilver2/imageset/forum_link.gif) | bin | 714 -> 714 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/forum_read.gif (renamed from phpBB/styles/subsilver2/imageset/forum_read.gif) | bin | 677 -> 677 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/forum_read_locked.gif (renamed from phpBB/styles/subsilver2/imageset/forum_read_locked.gif) | bin | 673 -> 673 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/forum_read_subforum.gif (renamed from phpBB/styles/subsilver2/imageset/forum_read_subforum.gif) | bin | 705 -> 705 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/forum_unread.gif (renamed from phpBB/styles/subsilver2/imageset/forum_unread.gif) | bin | 663 -> 663 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/forum_unread_locked.gif (renamed from phpBB/styles/subsilver2/imageset/forum_unread_locked.gif) | bin | 660 -> 660 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/forum_unread_subforum.gif (renamed from phpBB/styles/subsilver2/imageset/forum_unread_subforum.gif) | bin | 688 -> 688 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/icon_post_target.gif (renamed from phpBB/styles/subsilver2/imageset/icon_post_target.gif) | bin | 122 -> 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) | bin | 122 -> 122 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/icon_topic_attach.gif (renamed from phpBB/styles/subsilver2/imageset/icon_topic_attach.gif) | bin | 217 -> 217 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/icon_topic_latest.gif (renamed from phpBB/styles/subsilver2/imageset/icon_topic_latest.gif) | bin | 135 -> 135 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/icon_topic_newest.gif (renamed from phpBB/styles/subsilver2/imageset/icon_topic_newest.gif) | bin | 133 -> 133 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/icon_topic_reported.gif (renamed from phpBB/styles/subsilver2/imageset/icon_topic_reported.gif) | bin | 462 -> 462 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/icon_topic_unapproved.gif (renamed from phpBB/styles/subsilver2/imageset/icon_topic_unapproved.gif) | bin | 334 -> 334 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/poll_center.gif (renamed from phpBB/styles/subsilver2/imageset/poll_center.gif) | bin | 92 -> 92 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/poll_left.gif (renamed from phpBB/styles/subsilver2/imageset/poll_left.gif) | bin | 113 -> 113 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/poll_right.gif (renamed from phpBB/styles/subsilver2/imageset/poll_right.gif) | bin | 113 -> 113 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/site_logo.gif (renamed from phpBB/styles/subsilver2/imageset/site_logo.gif) | bin | 7151 -> 7151 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/sticky_read.gif (renamed from phpBB/styles/subsilver2/imageset/sticky_read.gif) | bin | 344 -> 344 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/sticky_read_locked.gif (renamed from phpBB/styles/subsilver2/imageset/sticky_read_locked.gif) | bin | 338 -> 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) | bin | 336 -> 336 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/sticky_read_mine.gif (renamed from phpBB/styles/subsilver2/imageset/sticky_read_mine.gif) | bin | 352 -> 352 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/sticky_unread.gif (renamed from phpBB/styles/subsilver2/imageset/sticky_unread.gif) | bin | 325 -> 325 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/sticky_unread_locked.gif (renamed from phpBB/styles/subsilver2/imageset/sticky_unread_locked.gif) | bin | 324 -> 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) | bin | 336 -> 336 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/sticky_unread_mine.gif (renamed from phpBB/styles/subsilver2/imageset/sticky_unread_mine.gif) | bin | 339 -> 339 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/topic_moved.gif (renamed from phpBB/styles/subsilver2/imageset/topic_moved.gif) | bin | 660 -> 660 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/topic_read.gif (renamed from phpBB/styles/subsilver2/imageset/topic_read.gif) | bin | 344 -> 344 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/topic_read_hot.gif (renamed from phpBB/styles/subsilver2/imageset/topic_read_hot.gif) | bin | 1902 -> 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) | bin | 1903 -> 1903 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/topic_read_locked.gif (renamed from phpBB/styles/subsilver2/imageset/topic_read_locked.gif) | bin | 333 -> 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) | bin | 337 -> 337 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/topic_read_mine.gif (renamed from phpBB/styles/subsilver2/imageset/topic_read_mine.gif) | bin | 350 -> 350 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/topic_unread.gif (renamed from phpBB/styles/subsilver2/imageset/topic_unread.gif) | bin | 336 -> 336 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/topic_unread_hot.gif (renamed from phpBB/styles/subsilver2/imageset/topic_unread_hot.gif) | bin | 1888 -> 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) | bin | 1895 -> 1895 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/topic_unread_locked.gif (renamed from phpBB/styles/subsilver2/imageset/topic_unread_locked.gif) | bin | 459 -> 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) | bin | 334 -> 334 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/topic_unread_mine.gif (renamed from phpBB/styles/subsilver2/imageset/topic_unread_mine.gif) | bin | 350 -> 350 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/images/upload_bar.gif (renamed from phpBB/styles/subsilver2/imageset/upload_bar.gif) | bin | 12892 -> 12892 bytes | |||
-rw-r--r-- | phpBB/styles/subsilver2/theme/stylesheet.css | 425 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/theme/theme.cfg | 14 | ||||
-rw-r--r-- | phpBB/viewforum.php | 3 | ||||
-rw-r--r-- | phpBB/viewonline.php | 2 | ||||
-rw-r--r-- | phpBB/viewtopic.php | 18 | ||||
-rw-r--r-- | phpunit.xml.all | 17 | ||||
-rw-r--r-- | phpunit.xml.dist | 17 | ||||
-rw-r--r-- | tests/bbcode/url_bbcode_test.php | 4 | ||||
-rw-r--r-- | tests/dbal/db_tools_test.php | 60 | ||||
-rw-r--r-- | tests/dbal/select_test.php | 18 | ||||
-rw-r--r-- | tests/download/http_byte_range_test.php | 12 | ||||
-rw-r--r-- | tests/error_collector_test.php | 35 | ||||
-rw-r--r-- | tests/mock/cache.php | 22 | ||||
-rw-r--r-- | tests/mock/request.php | 38 | ||||
-rw-r--r-- | tests/mock_user.php | 16 | ||||
-rw-r--r-- | tests/network/ftp_fsock_pasv_epsv_test.php | 63 | ||||
-rw-r--r-- | tests/profile/custom_test.php | 2 | ||||
-rw-r--r-- | tests/request/request_test.php | 68 | ||||
-rw-r--r-- | tests/security/base.php | 36 | ||||
-rw-r--r-- | tests/security/extract_current_page_test.php | 16 | ||||
-rw-r--r-- | tests/session/append_sid_test.php | 51 | ||||
-rw-r--r-- | tests/session/testable_factory.php | 5 | ||||
-rw-r--r-- | tests/template/includephp_test.php | 47 | ||||
-rw-r--r-- | tests/template/parent_templates/parent_and_child.html | 1 | ||||
-rw-r--r-- | tests/template/parent_templates/parent_only.html | 1 | ||||
-rw-r--r-- | tests/template/renderer_eval_test.php | 31 | ||||
-rw-r--r-- | tests/template/subdir/includephp_from_subdir_test.php | 29 | ||||
-rw-r--r-- | tests/template/template_compile_test.php | 31 | ||||
-rw-r--r-- | tests/template/template_inheritance_test.php | 75 | ||||
-rw-r--r-- | tests/template/template_test.php | 243 | ||||
-rw-r--r-- | tests/template/template_test_case.php | 133 | ||||
-rw-r--r-- | tests/template/templates/basic.html | 3 | ||||
-rw-r--r-- | tests/template/templates/child_only.html | 1 | ||||
-rw-r--r-- | tests/template/templates/define.html | 3 | ||||
-rw-r--r-- | tests/template/templates/define_include.html | 3 | ||||
-rw-r--r-- | tests/template/templates/expressions.html | 29 | ||||
-rw-r--r-- | tests/template/templates/if.html | 6 | ||||
-rw-r--r-- | tests/template/templates/include_define.html | 2 | ||||
-rw-r--r-- | tests/template/templates/include_loop.html | 4 | ||||
-rw-r--r-- | tests/template/templates/include_loop1.html | 1 | ||||
-rw-r--r-- | tests/template/templates/include_loop2.html | 1 | ||||
-rw-r--r-- | tests/template/templates/include_loop3.html | 1 | ||||
-rw-r--r-- | tests/template/templates/include_variable.html | 1 | ||||
-rw-r--r-- | tests/template/templates/includephp_relative.html (renamed from tests/template/templates/includephp.html) | 1 | ||||
-rw-r--r-- | tests/template/templates/lang.html | 2 | ||||
-rw-r--r-- | tests/template/templates/loop_nested.html | 2 | ||||
-rw-r--r-- | tests/template/templates/loop_nested_deep_multilevel_ref.html | 13 | ||||
-rw-r--r-- | tests/template/templates/loop_nested_multilevel_ref.html | 10 | ||||
-rw-r--r-- | tests/template/templates/loop_reuse.html | 6 | ||||
-rw-r--r-- | tests/template/templates/loop_size.html | 39 | ||||
-rw-r--r-- | tests/template/templates/loop_underscore.html | 21 | ||||
-rw-r--r-- | tests/template/templates/loop_vars.html | 13 | ||||
-rw-r--r-- | tests/template/templates/parent_and_child.html | 1 | ||||
-rw-r--r-- | tests/template/templates/trivial.html | 1 | ||||
-rw-r--r-- | tests/text_processing/censor_text_test.php | 85 | ||||
-rw-r--r-- | tests/tmp/.gitkeep (renamed from tests/utf/data/.gitkeep) | 0 | ||||
-rw-r--r-- | tests/utf/normalizer_test.php | 15 |
385 files changed, 5941 insertions, 5815 deletions
diff --git a/.gitignore b/.gitignore index 145a050aaa..1ac01d9b2d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *~ /phpunit.xml +/phpBB/cache/*.html /phpBB/cache/*.php /phpBB/cache/queue.php.lock /phpBB/config.php @@ -9,5 +10,4 @@ /phpBB/store/* /tests/phpbb_unit_tests.sqlite2 /tests/test_config.php -/tests/tmp -/tests/utf/data/*.txt +/tests/tmp/* diff --git a/build/build.xml b/build/build.xml index 78dbdd379c..eb63bde034 100644 --- a/build/build.xml +++ b/build/build.xml @@ -49,19 +49,16 @@ --coverage-clover build/logs/clover.xml --coverage-html build/coverage" passthru="true" /> + </target> - - <!-- Does not allow changing the working directory to tests/ - so this approach does not work for us unfortunately - <phpunit codecoverage="true" haltonfailure="true"> - <formatter todir="build/logs" type="xml"/> - <batchtest> - <fileset dir="tests"> - <include name="all_tests.php"/> - </fileset> - </batchtest> - </phpunit> - --> + <target name="test-slow" depends="clean,prepare"> + <exec dir="." + command="phpunit --log-junit build/logs/phpunit.xml + --configuration phpunit.xml.all + --group slow + --coverage-clover build/logs/clover-slow.xml + --coverage-html build/coverage-slow" + passthru="true" /> </target> <target name="docs"> @@ -122,6 +119,15 @@ <target name="create-package" depends="prepare-new-version,old-version-diffs"> <exec dir="build" command="php -f package.php '${versions}' > logs/package.log" escape="false" /> <exec dir="build" command="php -f build_diff.php '${prevversion}' '${newversion}' > logs/build_diff.log" escape="false" /> + <exec dir="build" escape="false" + command="diff -crNEBwd old_versions/release-${prevversion}/language new_version/phpBB3/language > + save/save_${prevversion}_to_${newversion}/language/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 > + save/save_${prevversion}_to_${newversion}/prosilver/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 > + save/save_${prevversion}_to_${newversion}/subsilver2/phpbb-${prevversion}_to_${newversion}_subsilver2.patch" /> </target> <!-- diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php index 726cb1644c..4f4d9ccedd 100644 --- a/phpBB/adm/index.php +++ b/phpBB/adm/index.php @@ -53,11 +53,9 @@ $mode = request_var('mode', ''); // Set custom template for admin area $template->set_custom_template($phpbb_admin_path . 'style', 'admin'); +$template->assign_var('T_ASSETS_PATH', $phpbb_root_path . 'assets'); $template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style'); -// the acp template is never stored in the database -$user->theme['template_storedb'] = false; - // Instantiate new module $module = new p_master(); diff --git a/phpBB/adm/style/acp_attachments.html b/phpBB/adm/style/acp_attachments.html index d938135440..33ef8062a6 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};">« {L_BACK}</a> diff --git a/phpBB/adm/style/acp_ban.html b/phpBB/adm/style/acp_ban.html index 2eeb748e4b..d564e89312 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> diff --git a/phpBB/adm/style/acp_bbcodes.html b/phpBB/adm/style/acp_bbcodes.html index c81c198fd5..b85e8eca81 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 --> diff --git a/phpBB/adm/style/acp_board.html b/phpBB/adm/style/acp_board.html index bb16204801..781f5c6bce 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> diff --git a/phpBB/adm/style/acp_bots.html b/phpBB/adm/style/acp_bots.html index 7783356574..886005caa3 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 --> diff --git a/phpBB/adm/style/acp_captcha.html b/phpBB/adm/style/acp_captcha.html index 8eee370284..83314ab633 100644 --- a/phpBB/adm/style/acp_captcha.html +++ b/phpBB/adm/style/acp_captcha.html @@ -1,6 +1,6 @@ <!-- INCLUDE overall_header.html --> -<a name="maincontent"></a> +<a id="maincontent"></a> <h1>{L_ACP_VC_SETTINGS}</h1> diff --git a/phpBB/adm/style/acp_database.html b/phpBB/adm/style/acp_database.html index de02ac6dbe..28ac2db1b9 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> diff --git a/phpBB/adm/style/acp_disallow.html b/phpBB/adm/style/acp_disallow.html index b68d3ab3c0..776f54d66c 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> diff --git a/phpBB/adm/style/acp_email.html b/phpBB/adm/style/acp_email.html index ff52500dca..1339ac6529 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> diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html index 8577c08860..447c0ce466 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 --> diff --git a/phpBB/adm/style/acp_groups.html b/phpBB/adm/style/acp_groups.html index 2f812c443d..158751623a 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 --> diff --git a/phpBB/adm/style/acp_groups_position.html b/phpBB/adm/style/acp_groups_position.html index 49212a4408..54c1cee769 100644 --- a/phpBB/adm/style/acp_groups_position.html +++ b/phpBB/adm/style/acp_groups_position.html @@ -1,6 +1,6 @@ <!-- INCLUDE overall_header.html --> -<a name="maincontent"></a> +<a id="maincontent"></a> <h1>{L_MANAGE_LEGEND}</h1> diff --git a/phpBB/adm/style/acp_icons.html b/phpBB/adm/style/acp_icons.html index eedf39b440..9ec7111848 100644 --- a/phpBB/adm/style/acp_icons.html +++ b/phpBB/adm/style/acp_icons.html @@ -1,6 +1,6 @@ <!-- INCLUDE overall_header.html --> -<a name="maincontent"></a> +<a id="maincontent"></a> <!-- IF S_EDIT --> diff --git a/phpBB/adm/style/acp_inactive.html b/phpBB/adm/style/acp_inactive.html index d7bf99f853..0889eaf400 100644 --- a/phpBB/adm/style/acp_inactive.html +++ b/phpBB/adm/style/acp_inactive.html @@ -1,6 +1,6 @@ <!-- INCLUDE overall_header.html --> -<a name="maincontent"></a> +<a id="maincontent"></a> <h2>{L_INACTIVE_USERS}</h2> diff --git a/phpBB/adm/style/acp_jabber.html b/phpBB/adm/style/acp_jabber.html index 0c4512ba98..2ba1424bda 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> diff --git a/phpBB/adm/style/acp_language.html b/phpBB/adm/style/acp_language.html index 95ac1d5852..81276287c1 100644 --- a/phpBB/adm/style/acp_language.html +++ b/phpBB/adm/style/acp_language.html @@ -1,6 +1,6 @@ <!-- INCLUDE overall_header.html --> -<a name="maincontent"></a> +<a id="maincontent"></a> <!-- IF S_SELECT_METHOD --> @@ -98,7 +98,7 @@ <br /><br /> <!-- ENDIF --> - <a name="entries"></a> + <a id="entries"></a> <h1>{L_LANGUAGE_ENTRIES}</h1> diff --git a/phpBB/adm/style/acp_logs.html b/phpBB/adm/style/acp_logs.html index f2fa5dbc26..f1c770d33b 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> diff --git a/phpBB/adm/style/acp_main.html b/phpBB/adm/style/acp_main.html index f3a26305ef..8946903e28 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 --> diff --git a/phpBB/adm/style/acp_modules.html b/phpBB/adm/style/acp_modules.html index 5396e78557..3f1c0bf50b 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 --> diff --git a/phpBB/adm/style/acp_permission_roles.html b/phpBB/adm/style/acp_permission_roles.html index 54bee54c77..658d8dd0c8 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 --> @@ -60,7 +60,7 @@ <p> - <a name="acl"></a> + <a id="acl"></a> <a href="#maincontent">» {L_BACK_TO_TOP}</a><br /> <br /><br /> @@ -189,7 +189,7 @@ <!-- IF S_DISPLAY_ROLE_MASK --> - <a name="assigned_to"></a> + <a id="assigned_to"></a> <h1>{L_ROLE_ASSIGNED_TO}</h1> diff --git a/phpBB/adm/style/acp_permissions.html b/phpBB/adm/style/acp_permissions.html index 6a6db11659..b44cca782e 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 --> diff --git a/phpBB/adm/style/acp_php_info.html b/phpBB/adm/style/acp_php_info.html index 24648f0816..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> diff --git a/phpBB/adm/style/acp_profile.html b/phpBB/adm/style/acp_profile.html index c1143e9ba4..0ac0d78a64 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 --> diff --git a/phpBB/adm/style/acp_prune_forums.html b/phpBB/adm/style/acp_prune_forums.html index 069d2c91c3..dfc5827117 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 --> diff --git a/phpBB/adm/style/acp_prune_users.html b/phpBB/adm/style/acp_prune_users.html index 0f2b23dcef..968d307832 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> diff --git a/phpBB/adm/style/acp_ranks.html b/phpBB/adm/style/acp_ranks.html index 1f45109517..2f77a256b1 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 --> diff --git a/phpBB/adm/style/acp_reasons.html b/phpBB/adm/style/acp_reasons.html index 23fcfbdeb8..522aec5930 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 --> diff --git a/phpBB/adm/style/acp_search.html b/phpBB/adm/style/acp_search.html index baadb70855..ff83f6b792 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> diff --git a/phpBB/adm/style/acp_send_statistics.html b/phpBB/adm/style/acp_send_statistics.html index 15eae8be6f..2d6c4837fd 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> diff --git a/phpBB/adm/style/acp_styles.html b/phpBB/adm/style/acp_styles.html index 098cc723d9..fdab2ecf88 100644 --- a/phpBB/adm/style/acp_styles.html +++ b/phpBB/adm/style/acp_styles.html @@ -1,6 +1,6 @@ <!-- INCLUDE overall_header.html --> -<a name="maincontent"></a> +<a id="maincontent"></a> <!-- IF S_DELETE --> @@ -32,10 +32,6 @@ <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> <!-- ENDIF --> <p class="quick"> @@ -45,127 +41,6 @@ </fieldset> </form> -<!-- ELSEIF S_EDIT_IMAGESET --> - - <a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">« {L_BACK}</a> - - <h1>{L_TITLE}</h1> - - <p>{L_EXPLAIN}</p> - - <!-- IF SUCCESS --> - <div class="successbox"> - <p>{L_IMAGESET_UPDATED}</p> - </div> - <!-- ENDIF --> - - <!-- IF ERROR --> - <div class="errorbox"> - <p>{L_NO_IMAGE}</p> - </div> - <!-- ENDIF --> - - <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); - } - } - - /** - * 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> - - <form method="post" action="{U_ACTION}"> - - <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 -->> {category.images.TEXT}</option> - <!-- END images --> - <!-- END category --> - </select> <input class="button1" type="submit" value="{L_SELECT}" tabindex="100" /> - </fieldset> - - <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> - </dl> - <dl> - <dt><label>{L_SELECTED_IMAGE}:</label></dt> - <dd><img src="{IMG_SRC}" id="newimg" alt="" /></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> - </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> - </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}" /> <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};">« {L_BACK}</a> @@ -354,11 +229,6 @@ <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> - </dl> <!-- ENDIF --> <dl> <dt><label for="store">{L_DOWNLOAD_STORE}:</label><br /><span>{L_DOWNLOAD_STORE_EXPLAIN}</span></dt> @@ -491,17 +361,6 @@ <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> diff --git a/phpBB/adm/style/acp_update.html b/phpBB/adm/style/acp_update.html index 1e499a16b5..00d37515b3 100644 --- a/phpBB/adm/style/acp_update.html +++ b/phpBB/adm/style/acp_update.html @@ -1,6 +1,6 @@ <!-- INCLUDE overall_header.html --> -<a name="maincontent"></a> +<a id="maincontent"></a> <!-- IF S_VERSION_CHECK --> diff --git a/phpBB/adm/style/acp_users.html b/phpBB/adm/style/acp_users.html index e266654649..87bd9ac882 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 --> diff --git a/phpBB/adm/style/acp_words.html b/phpBB/adm/style/acp_words.html index 3fa4cfc91c..113f58ef92 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 --> diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css index 4c3fa51af3..666f4921ba 100644 --- a/phpBB/adm/style/admin.css +++ b/phpBB/adm/style/admin.css @@ -899,12 +899,15 @@ html>body dd label input { vertical-align: text-bottom;} /* Tweak for Moz to ali dd input { font-size: 1.00em; max-width: 100%; + margin: 2px 0; } dd select { font-size: 100%; + font-size: 1em; width: auto; max-width: 100%; + margin: 2px 0; } dd textarea { @@ -912,11 +915,6 @@ dd textarea { width: 90%; } -dd select { - width: auto; - font-size: 1.00em; -} - fieldset dl { margin-bottom: 10px; font-size: 0.85em; diff --git a/phpBB/adm/style/captcha_gd_acp.html b/phpBB/adm/style/captcha_gd_acp.html index d0bb758cfe..e2804bbc7d 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};">« {L_BACK}</a> <h1>{L_ACP_VC_SETTINGS}</h1> diff --git a/phpBB/adm/style/captcha_qa_acp.html b/phpBB/adm/style/captcha_qa_acp.html index e0fc6fc67e..4eb46d2d3c 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};">« {L_BACK}</a> diff --git a/phpBB/adm/style/captcha_recaptcha_acp.html b/phpBB/adm/style/captcha_recaptcha_acp.html index 5b97cff984..34912c7955 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> diff --git a/phpBB/adm/style/install_footer.html b/phpBB/adm/style/install_footer.html index fabbee1911..1b3134b5e1 100644 --- a/phpBB/adm/style/install_footer.html +++ b/phpBB/adm/style/install_footer.html @@ -12,5 +12,7 @@ </div> </div> +<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/jquery.js"></script> + </body> </html> diff --git a/phpBB/adm/style/overall_footer.html b/phpBB/adm/style/overall_footer.html index 689452c268..dc03d2cfb5 100644 --- a/phpBB/adm/style/overall_footer.html +++ b/phpBB/adm/style/overall_footer.html @@ -20,5 +20,7 @@ </div> </div> +<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/jquery.js"></script> + </body> </html> diff --git a/phpBB/adm/style/permission_forum_copy.html b/phpBB/adm/style/permission_forum_copy.html index c919310035..a4c00c12ae 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> diff --git a/phpBB/adm/style/simple_footer.html b/phpBB/adm/style/simple_footer.html index ac9c26a690..272fd5e3fb 100644 --- a/phpBB/adm/style/simple_footer.html +++ b/phpBB/adm/style/simple_footer.html @@ -16,5 +16,7 @@ </div> +<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/jquery.js"></script> + </body> </html> diff --git a/phpBB/assets/javascript/jquery.js b/phpBB/assets/javascript/jquery.js new file mode 100644 index 0000000000..48590ecb96 --- /dev/null +++ b/phpBB/assets/javascript/jquery.js @@ -0,0 +1,18 @@ +/*! + * jQuery JavaScript Library v1.6.2 + * http://jquery.com/ + * + * Copyright 2011, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Thu Jun 30 14:16:56 2011 -0400 + */ +(function(a,b){function cv(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cs(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cr(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cq(){cn=b}function cp(){setTimeout(cq,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function bZ(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function bY(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bC.test(a)?d(a,e):bY(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)bY(a+"["+e+"]",b[e],c,d);else d(a,b)}function bX(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bR,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bX(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bX(a,c,d,e,"*",g));return l}function bW(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bN),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bA(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bv:bw;if(d>0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bx(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bm(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(be,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bl(a){f.nodeName(a,"input")?bk(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bk)}function bk(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bj(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bi(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bh(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i<j;i++)f.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}function bg(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function W(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(R.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function V(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function N(a,b){return(a&&a!=="*"?a+".":"")+b.replace(z,"`").replace(A,"&")}function M(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;i<s.length;i++)g=s[i],g.origType.replace(x,"")===a.type?q.push(g.selector):s.splice(i--,1);e=f(a.target).closest(q,a.currentTarget);for(j=0,k=e.length;j<k;j++){m=e[j];for(i=0;i<s.length;i++){g=s[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,d=null;if(g.preType==="mouseenter"||g.preType==="mouseleave")a.type=g.preType,d=f(a.relatedTarget).closest(g.selector)[0],d&&f.contains(h,d)&&(d=h);(!d||d!==h)&&p.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=p.length;j<k;j++){e=p[j];if(c&&e.level>c)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function K(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function E(){return!0}function D(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z])/ig,x=function(a,b){return b.toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!A){A=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||D.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b){if(H)return H.call(b,a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=s.exec(a)||t.exec(a)||u.exec(a)||a.indexOf("compatible")<0&&v.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g="done fail isResolved isRejected promise then always pipe".split(" "),h=[].slice;f.extend({_Deferred:function(){var a=[],b,c,d,e={done:function(){if(!d){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=f.type(i),j==="array"?e.done.apply(e,i):j==="function"&&a.push(i);k&&e.resolveWith(k[0],k[1])}return this},resolveWith:function(e,f){if(!d&&!b&&!c){f=f||[],c=1;try{while(a[0])a.shift().apply(e,f)}finally{b=[e,f],c=0}}return this},resolve:function(){e.resolveWith(this,arguments);return this},isResolved:function(){return!!c||!!b},cancel:function(){d=1,a=[];return this}};return e},Deferred:function(a){var b=f._Deferred(),c=f._Deferred(),d;f.extend(b,{then:function(a,c){b.done(a).fail(c);return this},always:function(){return b.done.apply(b,arguments).fail.apply(this,arguments)},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,pipe:function(a,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[c,"reject"]},function(a,c){var e=c[0],g=c[1],h;f.isFunction(e)?b[a](function(){h=e.apply(this,arguments),h&&f.isFunction(h.promise)?h.promise().then(d.resolve,d.reject):d[g](h)}):b[a](d[g])})}).promise()},promise:function(a){if(a==null){if(d)return d;d=a={}}var c=g.length;while(c--)a[g[c]]=b[g[c]];return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){function i(a){return function(c){b[a]=arguments.length>1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c<d;c++)b[c]&&f.isFunction(b[c].promise)?b[c].promise().then(i(c),g.reject):--e;e||g.resolveWith(g,b)}else g!==a&&g.resolveWith(g,d?[a]:[]);return g.promise()}}),f.support=function(){var a=c.createElement("div"),b=c.documentElement,d,e,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;a.setAttribute("className","t"),a.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0},m&&f.extend(p,{position:"absolute",left:-1e3,top:-1e3});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[f.camelCase(c)]||i[c]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h<i;h++)g=e[h].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),k(this[0],g,d[g]))}}return d}if(typeof a=="object")return this.each(function(){f.data(this,a)});var j=a.split(".");j[1]=j[1]?"."+j[1]:"";if(c===b){d=this.triggerHandler("getData"+j[1]+"!",[j[0]]),d===b&&this.length&&(d=f.data(this[0],a),d=k(this[0],a,d));return d===b&&j[1]?this.data(j[0]):d}return this.each(function(){var b=f(this),d=[j[0],c];b.triggerHandler("setData"+j[1]+"!",d),f.data(this,a,c),b.triggerHandler("changeData"+j[1]+"!",d)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,c){a&&(c=(c||"fx")+"mark",f.data(a,c,(f.data(a,c,b,!0)||0)+1,!0))},_unmark:function(a,c,d){a!==!0&&(d=c,c=a,a=!1);if(c){d=d||"fx";var e=d+"mark",g=a?0:(f.data(c,e,b,!0)||1)-1;g?f.data(c,e,g,!0):(f.removeData(c,e,!0),m(c,d,"mark"))}},queue:function(a,c,d){if(a){c=(c||"fx")+"queue";var e=f.data(a,c,b,!0);d&&(!e||f.isArray(d)?e=f.data(a,c,f.makeArray(d),!0):e.push(d));return e||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e;d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),d.call(a,function(){f.dequeue(a,b)})),c.length||(f.removeData(a,b+"queue",!0),m(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){f.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f._Deferred(),!0))h++,l.done(m);m();return d.promise()}});var n=/[\n\t\r]/g,o=/\s+/,p=/\r/g,q=/^(?:button|input)$/i,r=/^(?:button|input|object|select|textarea)$/i,s=/^a(?:rea)?$/i,t=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,u=/\:|^on/,v,w;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(o);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(o);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(n," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(o);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++)if((" "+this[c].className+" ").replace(n," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h<i;h++){var j=e[h];if(j.selected&&(f.support.optDisabled?!j.disabled:j.getAttribute("disabled")===null)&&(!j.parentNode.disabled||!f.nodeName(j.parentNode,"optgroup"))){b=f(j).val();if(g)return b;d.push(b)}}if(g&&!d.length&&e.length)return f(e[c]).val();return d},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=w:v&&c!=="className"&&(f.nodeName(a,"form")||u.test(c))&&(i=v)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j&&(h=i.get(a,c))!==null)return h;h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}},value:{get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return f.prop(a,c)?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.attrHooks.title=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var x=/\.(.*)$/,y=/^(?:textarea|input|select)$/i,z=/\./g,A=/ /g,B=/[^\w\s.|`]/g,C=function(a){return a.replace(B,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=D;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=D);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),C).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace))f.event.remove(a,r,q.handler,j),p.splice(j--,1)}continue}o=f.event.special[h]||{};for(j=e||0;j<p.length;j++){q=p[j];if(d.guid===q.guid){if(l||n.test(q.namespace))e==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q);if(e!=null)break}}if(p.length===0||e!=null&&p.length===1)(!o.teardown||o.teardown.call(a,m)===!1)&&f.removeEvent(a,h,s.handle),g=null,delete t[h]}if(f.isEmptyObject(t)){var u=s.handle;u&&(u.elem=null),delete s.events,delete s.handle,f.isEmptyObject(s)&&f.removeData(a,b,!0)}}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){var h=c.type||c,i=[],j;h.indexOf("!")>=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i. +shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h<i;h++){var j=d[h];if(e||c.namespace_re.test(j.namespace)){c.handler=j.handler,c.data=j.data,c.handleObj=j;var k=j.handler.apply(this,g);k!==b&&(c.result=k,k===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[f.expando])return a;var d=a;a=f.Event(d);for(var e=this.props.length,g;e;)g=this.props[--e],a[g]=d[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=a.target.ownerDocument||c,i=h.documentElement,j=h.body;a.pageX=a.clientX+(i&&i.scrollLeft||j&&j.scrollLeft||0)-(i&&i.clientLeft||j&&j.clientLeft||0),a.pageY=a.clientY+(i&&i.scrollTop||j&&j.scrollTop||0)-(i&&i.clientTop||j&&j.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:f.proxy,special:{ready:{setup:f.bindReady,teardown:f.noop},live:{add:function(a){f.event.add(this,N(a.origType,a.selector),f.extend({},a,{handler:M,guid:a.handler.guid}))},remove:function(a){f.event.remove(this,N(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!this.preventDefault)return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?E:D):this.type=a,b&&f.extend(this,b),this.timeStamp=f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=E;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=E;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=E,this.stopPropagation()},isDefaultPrevented:D,isPropagationStopped:D,isImmediatePropagationStopped:D};var F=function(a){var b=a.relatedTarget,c=!1,d=a.type;a.type=a.data,b!==this&&(b&&(c=f.contains(this,b)),c||(f.event.handle.apply(this,arguments),a.type=d))},G=function(a){a.type=a.data,f.event.handle.apply(this,arguments)};f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={setup:function(c){f.event.add(this,b,c&&c.selector?G:F,a)},teardown:function(a){f.event.remove(this,b,a&&a.selector?G:F)}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(a,b){if(!f.nodeName(this,"form"))f.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=b.type;(c==="submit"||c==="image")&&f(b).closest("form").length&&K("submit",this,arguments)}),f.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=b.type;(c==="text"||c==="password")&&f(b).closest("form").length&&a.keyCode===13&&K("submit",this,arguments)});else return!1},teardown:function(a){f.event.remove(this,".specialSubmit")}});if(!f.support.changeBubbles){var H,I=function(a){var b=a.type,c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},J=function(c){var d=c.target,e,g;if(!!y.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=I(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:J,beforedeactivate:J,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&J.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&J.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",I(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in H)f.event.add(this,c+".specialChange",H[c]);return y.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return y.test(this.nodeName)}},H=f.event.special.change.filters,H.focus=H.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i<j;i++)f.event.add(this[i],a,g,d);return this}}),f.fn.extend({unbind:function(a,b){if(typeof a=="object"&&!a.preventDefault)for(var c in a)this.unbind(c,a[c]);else for(var d=0,e=this.length;d<e;d++)f.event.remove(this[d],a,b);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f.data(this,"lastToggle"+a.guid)||0)%d;f.data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var L={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};f.each(["live","die"],function(a,c){f.fn[c]=function(a,d,e,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:f(this.context);if(typeof a=="object"&&!a.preventDefault){for(var o in a)n[c](o,d,a[o],m);return this}if(c==="die"&&!a&&g&&g.charAt(0)==="."){n.unbind(g);return this}if(d===!1||f.isFunction(d))e=d||D,d=b;a=(a||"").split(" ");while((h=a[i++])!=null){j=x.exec(h),k="",j&&(k=j[0],h=h.replace(x,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,L[h]?(a.push(L[h]+k),h=h+k):h=(L[h]||h)+k;if(c==="live")for(var p=0,q=n.length;p<q;p++)f.event.add(n[p],"live."+N(h,m),{data:d,selector:m,handler:e,origType:h,origHandler:e,preType:l});else n.unbind("live."+N(h,m),e)}return this}}),f.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".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!="string"){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter)if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(!f)g=o=!0;else if(f===!0)continue}if(f)for(var s=0;(p=j[s])!=null;s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)k.error(a);else break;h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&k.filter(b,a,!0)}},"":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("parentNode",b,f,a,e,c)},"~":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("previousSibling",b,f,a,e,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c<f;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){if(a===b){g=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(h===i)return s(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)k(a,f[g],d);return k.filter(e,d)};f.find=k,f.expr=k.selectors,f.expr[":"]=f.expr.filters,f.unique=k.uniqueSort,f.text=k.getText,f.isXMLDoc=k.isXML,f.contains=k.contains}();var O=/Until$/,P=/^(?:parents|prevUntil|prevAll)/,Q=/,/,R=/^.[^:#\[\.,]*$/,S=Array.prototype.slice,T=f.expr.match.POS,U={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(W(this,a,!1),"not",a)},filter:function(a){return this.pushStack(W(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d<e;d++)i=a[d],j[i]||(j[i]=T.test(i)?f(i,b||this.context):i);while(g&&g.ownerDocument&&g!==b){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=T.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(l?l.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string")return f.inArray(this[0],a?f(a):this.parent().children());return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(V(c[0])||V(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=S.call(arguments);O.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!U[a]?f.unique(e):e,(this.length>1||Q.test(d))&&P.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var X=/ jQuery\d+="(?:\d+|null)"/g,Y=/^\s+/,Z=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,$=/<([\w:]+)/,_=/<tbody/i,ba=/<|&#?\w+;/,bb=/<(?:script|object|embed|option|style)/i,bc=/checked\s*(?:[^=]|=\s*.checked.)/i,bd=/\/(java|ecma)script/i,be=/^\s*<!(?:\[CDATA\[|\-\-)/,bf={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};bf.optgroup=bf.option,bf.tbody=bf.tfoot=bf.colgroup=bf.caption=bf.thead,bf.th=bf.td,f.support.htmlSerialize||(bf._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(X,""):null;if(typeof a=="string"&&!bb.test(a)&&(f.support.leadingWhitespace||!Y.test(a))&&!bf[($.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Z,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bc.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bg(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bm)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i;b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof a[0]=="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!bb.test(a[0])&&(f.support.checkClone||!bc.test(a[0]))&&(g=!0,h=f.fragments[a[0]],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[a[0]]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j +)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bi(a,d),e=bj(a),g=bj(d);for(h=0;e[h];++h)bi(e[h],g[h])}if(b){bh(a,d);if(c){e=bj(a),g=bj(d);for(h=0;e[h];++h)bh(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!ba.test(k))k=b.createTextNode(k);else{k=k.replace(Z,"<$1></$2>");var l=($.exec(k)||["",""])[1].toLowerCase(),m=bf[l]||bf._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=_.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Y.test(k)&&o.insertBefore(b.createTextNode(Y.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bl(k[i]);else bl(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||bd.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.expando,g=f.event.special,h=f.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&f.noData[j.nodeName.toLowerCase()])continue;c=j[f.expando];if(c){b=d[c]&&d[c][e];if(b&&b.events){for(var k in b.events)g[k]?f.event.remove(j,k):f.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[f.expando]:j.removeAttribute&&j.removeAttribute(f.expando),delete d[c]}}}});var bn=/alpha\([^)]*\)/i,bo=/opacity=([^)]*)/,bp=/([A-Z]|^ms)/g,bq=/^-?\d+(?:px)?$/i,br=/^-?\d/,bs=/^[+\-]=/,bt=/[^+\-\.\de]+/g,bu={position:"absolute",visibility:"hidden",display:"block"},bv=["Left","Right"],bw=["Top","Bottom"],bx,by,bz;f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bx(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d;if(h==="number"&&isNaN(d)||d==null)return;h==="string"&&bs.test(d)&&(d=+d.replace(bt,"")+parseFloat(f.css(a,c)),h="number"),h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bx)return bx(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return bA(a,b,d);f.swap(a,bu,function(){e=bA(a,b,d)});return e}},set:function(a,b){if(!bq.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bo.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bn.test(g)?g.replace(bn,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bx(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(by=function(a,c){var d,e,g;c=c.replace(bp,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bz=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bq.test(d)&&br.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bx=by||bz,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bB=/%20/g,bC=/\[\]$/,bD=/\r?\n/g,bE=/#.*$/,bF=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bG=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bH=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bI=/^(?:GET|HEAD)$/,bJ=/^\/\//,bK=/\?/,bL=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bM=/^(?:select|textarea)/i,bN=/\s+/,bO=/([?&])_=[^&]*/,bP=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bQ=f.fn.load,bR={},bS={},bT,bU;try{bT=e.href}catch(bV){bT=c.createElement("a"),bT.href="",bT=bT.href}bU=bP.exec(bT.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bQ)return bQ.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bL,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bM.test(this.nodeName)||bG.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bD,"\r\n")}}):{name:b.name,value:c.replace(bD,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bT,isLocal:bH.test(bU[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}},ajaxPrefilter:bW(bR),ajaxTransport:bW(bS),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a?4:0;var o,r,u,w=l?bZ(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=b$(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bF.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bE,"").replace(bJ,bU[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bN),d.crossDomain==null&&(r=bP.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bU[1]&&r[2]==bU[2]&&(r[3]||(r[1]==="http:"?80:443))==(bU[3]||(bU[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bX(bR,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bI.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bK.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bO,"$1_="+x);d.url=y+(y===d.url?(bK.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", */*; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bX(bS,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){status<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)bY(g,a[g],c,e);return d.join("&").replace(bB,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn,co=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cr("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cs(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cr("hide",3),a,b,c);for(var d=0,e=this.length;d<e;d++)if(this[d].style){var g=f.css(this[d],"display");g!=="none"&&!f._data(this[d],"olddisplay")&&f._data(this[d],"olddisplay",g)}for(d=0;d<e;d++)this[d].style&&(this[d].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cr("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return this[e.queue===!1?"each":"queue"](function(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(f.support.inlineBlockNeedsLayout?(j=cs(this.nodeName),j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)):this.style.display="inline-block"))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)k=new f.fx(this,b,i),h=a[i],cj.test(h)?k[h==="toggle"?d?"show":"hide":h]():(l=ck.exec(h),m=k.cur(),l?(n=parseFloat(l[2]),o=l[3]||(f.cssNumber[i]?"":"px"),o!=="px"&&(f.style(this,i,(n||1)+o),m=(n||1)/k.cur()*m,f.style(this,i,m+o)),l[1]&&(n=(l[1]==="-="?-1:1)*n+m),k.custom(m,n,o)):k.custom(m,h,""));return!0})},stop:function(a,b){a&&this.queue([]),this.each(function(){var a=f.timers,c=a.length;b||f._unmark(!0,this);while(c--)a[c].elem===this&&(b&&a[c](!0),a.splice(c,1))}),b||this.dequeue();return this}}),f.each({slideDown:cr("show",1),slideUp:cr("hide",1),slideToggle:cr("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default,d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue!==!1?f.dequeue(this):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function h(a){return d.step(a)}var d=this,e=f.fx,g;this.startTime=cn||cp(),this.start=a,this.end=b,this.unit=c||this.unit||(f.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,h.elem=this.elem,h()&&f.timers.push(h)&&!cl&&(co?(cl=!0,g=function(){cl&&(co(g),e.tick())},co(g)):cl=setInterval(e.tick,e.interval))},show:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=cn||cp(),c=!0,d=this.elem,e=this.options,g,h;if(a||b>=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b<a.length;++b)a[b]()||a.splice(b--,1);a.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cl),cl=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var ct=/^t(?:able|d|h)$/i,cu=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cv(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);f.offset.initialize();var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.offset.supportsFixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.offset.doesNotAddBorder&&(!f.offset.doesAddBorderForTableAndCells||!ct.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={initialize:function(){var a=c.body,b=c.createElement("div"),d,e,g,h,i=parseFloat(f.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cu.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cu.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cv(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cv(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window);
\ No newline at end of file diff --git a/phpBB/common.php b/phpBB/common.php index 54e7093c76..524c05ae70 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -82,7 +82,6 @@ if (!empty($load_extensions) && function_exists('dl')) // Include files require($phpbb_root_path . 'includes/class_loader.' . $phpEx); -require($phpbb_root_path . 'includes/template.' . $phpEx); require($phpbb_root_path . 'includes/session.' . $phpEx); require($phpbb_root_path . 'includes/auth.' . $phpEx); @@ -109,7 +108,6 @@ $class_loader->set_cache($cache->get_driver()); $request = new phpbb_request(); $user = new user(); $auth = new auth(); -$template = new template(); $db = new $sql_db(); // make sure request_var uses this request instance @@ -126,6 +124,9 @@ $config = new phpbb_config_db($db, $cache->get_driver(), CONFIG_TABLE); set_config(null, null, null, $config); set_config_count(null, null, null, $config); +$template_locator = new phpbb_template_locator(); +$template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $template_locator); + // 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'))); diff --git a/phpBB/develop/compile_template.php b/phpBB/develop/compile_template.php new file mode 100644 index 0000000000..e741e909d8 --- /dev/null +++ b/phpBB/develop/compile_template.php @@ -0,0 +1,24 @@ +<?php +// ------------------------------------------------------------- +// +// $Id$ +// +// FILENAME : compile_template.php +// STARTED : Sun Apr 24, 2011 +// COPYRIGHT : 2011 phpBB Group +// WWW : http://www.phpbb.com/ +// LICENCE : GPL vs2.0 [ see /docs/COPYING ] +// +// ------------------------------------------------------------- + +define('IN_PHPBB', 1); +define('ANONYMOUS', 1); +$phpEx = substr(strrchr(__FILE__, '.'), 1); +$phpbb_root_path = './../'; + +include($phpbb_root_path . 'includes/template_compile.'.$phpEx); + +$file = $argv[1]; + +$compile = new phpbb_template_compile(); +echo $compile->compile_file($file); diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 213354fcb9..2057d292b7 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1657,7 +1657,6 @@ function get_schema_struct() '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', ''), ), @@ -1667,29 +1666,12 @@ function get_schema_struct() ), ); - $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( diff --git a/phpBB/develop/imageset_to_css.php b/phpBB/develop/imageset_to_css.php new file mode 100644 index 0000000000..3d55808319 --- /dev/null +++ b/phpBB/develop/imageset_to_css.php @@ -0,0 +1,274 @@ +<?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 . '/theme2'; + +// 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)); + +// 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 />'; + } + } + 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/'); +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 = './') +{ + $code = ''; + foreach($list as $key => $row) + { + if(!strlen($row['file'])) continue; + $code .= '.imageset.' . substr($key, 4) . ' { + background-image: url("' . $path . $row['file'] . '"); + padding-left: ' . $row['width'] . 'px; + padding-top: ' . $row['height'] . 'px; +} +'; + } + return $code; +} + diff --git a/phpBB/develop/mysql_upgrader.php b/phpBB/develop/mysql_upgrader.php index ca3e87dcc6..c54a7155c2 100644 --- a/phpBB/develop/mysql_upgrader.php +++ b/phpBB/develop/mysql_upgrader.php @@ -1094,14 +1094,12 @@ function get_schema_struct() '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'), ), ); @@ -1152,35 +1150,6 @@ function get_schema_struct() ), ); - $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'), diff --git a/phpBB/docs/AUTHORS b/phpBB/docs/AUTHORS index 81bc9f52e6..723981b6b7 100644 --- a/phpBB/docs/AUTHORS +++ b/phpBB/docs/AUTHORS @@ -72,6 +72,7 @@ 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/ PHP License, version 3.0: Pear (c) 2001-2004 PHP Group, http://pear.php.net diff --git a/phpBB/docs/README.html b/phpBB/docs/README.html index e1d9e80f37..266475edca 100644 --- a/phpBB/docs/README.html +++ b/phpBB/docs/README.html @@ -256,7 +256,7 @@ <p>The relevant database type/version is listed within the administration control panel</p> - <p>Please also be as detailed as you can in your report, if possible list the steps required to duplicate the problem. If you have a fix which you are <strong>VERY SURE</strong> works (and is consistent with our <a href="coding-guidelines.html">coding guidelines</a>) and does not introduce further problems or incompatibilities please let us know. However only include it in the bug report if you really must, if we need it we'll ask you for it.</p> + <p>Please also be as detailed as you can in your report, 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 <a href="https://github.com/phpbb/phpbb3">on GitHub</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> diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html index 6f952368ee..054694ccf0 100644 --- a/phpBB/docs/coding-guidelines.html +++ b/phpBB/docs/coding-guidelines.html @@ -81,12 +81,6 @@ <li><a href="#writingstyle">Writing Style</a></li> </ol> </li> - <li><a href="#vcs">VCS Guidelines</a> - <ol style="list-style-type: lower-roman;"> - <li><a href="#repostruct">Repository structure</a></li> - <li><a href="#commitmessage">Commit Messages and Repository Rules</a></li> - </ol> - </li> <li><a href="#disclaimer">Copyright and disclaimer</a></li> </ol> @@ -262,6 +256,7 @@ PHPBB_QA (Set board to QA-Mode, which means the updater also c <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> @@ -2411,51 +2406,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) <hr /> -<a name="vcs"></a><h2>7. VCS Guidelines</h2> - - <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> - - <div class="content"> - - <p>The version control system for phpBB3 is git. The repository is available at <a href="http://github.com/phpbb/phpbb3" title="repository">http://github.com/phpbb/phpbb3</a>.</p> - - <a name="repostruct"></a><h3>7.i. Repository Structure</h3> - - <ul> - <li><strong>develop</strong><br />The latest unstable development version with new features etc.</li> - <li><strong>develop-*</strong><br />Development branches of stable phpBB releases. Branched off of <code>develop</code> at the time of feature freeze. - <ul> - <li><strong>phpBB3.0</strong><code>develop-olympus</code><br />Development branch of the stable 3.0 line. Bug fixes are applied here.</li> - <li><strong>phpBB3.1</strong><code>develop-ascraeus</code><br />Development branch of the stable 3.1 line. Bug fixes are applied here.</li> - </ul> - </li> - <li><strong>master</strong><br />A branch containing all stable phpBB3 release points</li> - <li><strong>tags</strong><br />Released versions. Stable ones get merged into the master branch. - <ul> - <li><code>release-3.Y-BX</code><br />Beta release X of the 3.Y line.</li> - <li><code>release-3.Y-RCX</code><br />Release candidate X of the 3.Y line.</li> - <li><code>release-3.Y.Z-RCX</code><br />Release candidate X of the stable 3.Y.Z release.</li> - <li><code>release-3.0.X</code><br />Stable <strong>3.0.X</strong> release.</li> - <li><code>release-2.0.X</code><br />Old stable 2.0.X release.</li> - </ul> - </li> - </ul> - - <a name="commitmessage"></a><h3>7.ii. Commit Messages and Repository Rules</h3> - - <p>Information on repository rules, such as commit messages can be found at <a href="http://wiki.phpbb.com/display/DEV/Git" title="phpBB Git Information">http://wiki.phpbb.com/display/DEV/Git</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> - - <hr /> - -<a name="disclaimer"></a><h2>9. Copyright and disclaimer</h2> +<a name="disclaimer"></a><h2>8. Copyright and disclaimer</h2> <div class="paragraph"> <div class="inner"><span class="corners-top"><span></span></span> diff --git a/phpBB/docs/hook_system.html b/phpBB/docs/hook_system.html index 82dc44a082..20ebe995c5 100644 --- a/phpBB/docs/hook_system.html +++ b/phpBB/docs/hook_system.html @@ -370,10 +370,10 @@ a:active { color: #368AD2; } <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->display($handle, $include_once = true);</code> which is called directly before outputting the (not-yet-compiled) template.<br /> +<code>$template->display($handle, $template);</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->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>Please note: The <code>$template->display</code> hook takes a <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> @@ -395,6 +395,7 @@ PHPBB_USE_BOARD_URL_PATH (use generate_board_url() for image paths instead of $p <p>Path locations for the following template variables are affected by this too:</p> <ul> + <li>{T_ASSETS_PATH} - assets</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> diff --git a/phpBB/download/file.php b/phpBB/download/file.php index 735db70dfc..ec15d36e08 100644 --- a/phpBB/download/file.php +++ b/phpBB/download/file.php @@ -44,6 +44,7 @@ if (isset($_GET['avatar'])) 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); $class_loader = new phpbb_class_loader($phpbb_root_path, '.' . $phpEx); $class_loader->register(); @@ -53,6 +54,7 @@ if (isset($_GET['avatar'])) $cache = $cache_factory->get_service(); $class_loader->set_cache($cache->get_driver()); + $request = new phpbb_request(); $db = new $sql_db(); // Connect to DB @@ -62,8 +64,10 @@ if (isset($_GET['avatar'])) } unset($dbpasswd); + request_var('', 0, false, false, $request); + // 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')); $config = new phpbb_config_db($db, $cache->get_driver(), CONFIG_TABLE); set_config(null, null, null, $config); diff --git a/phpBB/feed.php b/phpBB/feed.php index 1a09e4da23..b8c0c370f9 100644 --- a/phpBB/feed.php +++ b/phpBB/feed.php @@ -127,7 +127,7 @@ 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)) : '', + 'FEED_IMAGE' => '', 'SELF_LINK' => feed_append_sid('/feed.' . $phpEx, $params), 'FEED_LINK' => $board_url . '/index.' . $phpEx, 'FEED_TITLE' => $config['sitename'], @@ -173,6 +173,12 @@ if (defined('DEBUG_EXTRA') && request_var('explain', 0) && $auth->acl_get('a_')) header("Content-Type: application/atom+xml; charset=UTF-8"); header("Last-Modified: " . gmdate('D, d M Y H:i:s', $feed_updated_time) . ' GMT'); +if (!empty($user->data['is_bot'])) +{ + // Let reverse proxies know we detected a bot. + header('X-PHPBB-IS-BOT: yes'); +} + echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n"; echo '<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="' . $global_vars['FEED_LANG'] . '">' . "\n"; echo '<link rel="self" type="application/atom+xml" href="' . $global_vars['SELF_LINK'] . '" />' . "\n\n"; @@ -604,30 +610,9 @@ class phpbb_feed_base function get_passworded_forums() { - global $db, $user; - - // Exclude passworded forums - $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($user->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'] != $user->data['user_id']) - { - $forum_ids[$forum_id] = $forum_id; - } - } - $db->sql_freeresult($result); + global $user; - return $forum_ids; + return $user->get_passworded_forums(); } function get_item() diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index ecbaff6274..a9574628e1 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -317,7 +317,7 @@ class acp_bbcodes $bbcode_tpl = trim($bbcode_tpl); $utf8 = strpos($bbcode_match, 'INTTEXT') !== false; - $utf8_pcre_properties = pcre_utf8_support(); + $utf8_pcre_properties = phpbb_pcre_utf8_support(); $fp_match = preg_quote($bbcode_match, '!'); $fp_replace = preg_replace('#^\[(.*?)\]#', '[$1:$uid]', $bbcode_match); diff --git a/phpBB/includes/acp/acp_captcha.php b/phpBB/includes/acp/acp_captcha.php index 8116fce6f0..bef8ae0ea9 100644 --- a/phpBB/includes/acp/acp_captcha.php +++ b/phpBB/includes/acp/acp_captcha.php @@ -46,7 +46,7 @@ class acp_captcha // Delegate if ($configure) { - $config_captcha =& phpbb_captcha_factory::get_instance($selected); + $config_captcha = phpbb_captcha_factory::get_instance($selected); $config_captcha->acp_page($id, $this); } else @@ -78,11 +78,11 @@ class acp_captcha // sanity check if (isset($captchas['available'][$selected])) { - $old_captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']); + $old_captcha = phpbb_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 = phpbb_captcha_factory::get_instance($config['captcha_plugin']); $new_captcha->install(); add_log('admin', 'LOG_CONFIG_VISUAL'); @@ -113,7 +113,7 @@ class acp_captcha $captcha_select .= '<option value="' . $value . '"' . $current . ' class="disabled-option">' . $user->lang[$title] . '</option>'; } - $demo_captcha =& phpbb_captcha_factory::get_instance($selected); + $demo_captcha = phpbb_captcha_factory::get_instance($selected); foreach ($config_vars as $config_var => $options) { @@ -136,7 +136,7 @@ class acp_captcha { global $db, $user, $config; - $captcha =& phpbb_captcha_factory::get_instance($selected); + $captcha = phpbb_captcha_factory::get_instance($selected); $captcha->init(CONFIRM_REG); $captcha->execute_demo(); diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index 96542986d3..632578ef2d 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -486,6 +486,8 @@ class base_extractor function base_extractor($download = false, $store = false, $format, $filename, $time) { + global $request; + $this->download = $download; $this->store = $store; $this->time = $time; @@ -530,7 +532,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'); } @@ -1580,7 +1582,7 @@ class mssql_extractor extends base_extractor } $this->flush($sql_data); } - + function write_data_mssqlnative($table_name) { global $db; @@ -1606,7 +1608,7 @@ class mssql_extractor extends base_extractor $row = new result_mssqlnative($result_fields); $i_num_fields = $row->num_fields(); - + for ($i = 0; $i < $i_num_fields; $i++) { $ary_type[$i] = $row->field_type($i); @@ -1619,7 +1621,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"; @@ -1683,8 +1685,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; diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 4d605e1b82..854f262a0b 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -875,7 +875,7 @@ class acp_forums $errors = array(); - if (!$forum_data['forum_name']) + if ($forum_data['forum_name'] == '') { $errors[] = $user->lang['FORUM_NAME_EMPTY']; } diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php index 8df8e5c8e5..ffa8df1848 100644 --- a/phpBB/includes/acp/acp_language.php +++ b/phpBB/includes/acp/acp_language.php @@ -797,11 +797,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)); @@ -866,66 +861,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 . " diff --git a/phpBB/includes/acp/acp_send_statistics.php b/phpBB/includes/acp/acp_send_statistics.php index aef67a8b1a..eb7154d114 100644 --- a/phpBB/includes/acp/acp_send_statistics.php +++ b/phpBB/includes/acp/acp_send_statistics.php @@ -16,8 +16,6 @@ if (!defined('IN_PHPBB')) exit; } -include($phpbb_root_path . 'includes/questionnaire/questionnaire.' . $phpEx); - /** * @package acp */ @@ -27,7 +25,9 @@ class acp_send_statistics function main($id, $mode) { - global $config, $template, $phpbb_admin_path, $phpEx; + global $config, $template, $phpbb_admin_path, $phpbb_root_path, $phpEx; + + include($phpbb_root_path . 'includes/questionnaire/questionnaire.' . $phpEx); $collect_url = "http://www.phpbb.com/stats/receive_stats.php"; diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 18a90fb8e8..fc9acbbcb8 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -26,8 +26,6 @@ class acp_styles var $style_cfg; var $template_cfg; var $theme_cfg; - var $imageset_cfg; - var $imageset_keys; function main($id, $mode) { @@ -58,7 +56,7 @@ class acp_styles $style_id = request_var('id', 0); // Fill the configuration variables - $this->style_cfg = $this->template_cfg = $this->theme_cfg = $this->imageset_cfg = ' + $this->style_cfg = $this->template_cfg = $this->theme_cfg = ' # # phpBB {MODE} configuration file # @@ -83,19 +81,6 @@ 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 @@ -105,33 +90,6 @@ parse_css_file = {PARSE_CSS_FILE} # Templates cannot inherit from inheriting templates. #'; - $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', - ), - ); - // Execute overall actions switch ($action) { @@ -174,8 +132,6 @@ parse_css_file = {PARSE_CSS_FILE} { switch ($mode) { - case 'imageset': - return $this->edit_imageset($style_id); case 'template': return $this->edit_template($style_id); case 'theme': @@ -251,7 +207,7 @@ parse_css_file = {PARSE_CSS_FILE} switch ($action) { - // Refresh template data stored in db and clear cache + // Clear cache case 'refresh': $sql = 'SELECT * @@ -268,49 +224,13 @@ parse_css_file = {PARSE_CSS_FILE} 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)); + trigger_error($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( + confirm_box(false, $user->lang['CONFIRM_TEMPLATE_CLEAR_CACHE'], build_hidden_fields(array( 'i' => $id, 'mode' => $mode, 'action' => $action, @@ -325,209 +245,7 @@ parse_css_file = {PARSE_CSS_FILE} 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')); + $this->frontend('theme', array('edit', 'details'), array('export', 'delete')); break; } } @@ -567,10 +285,6 @@ parse_css_file = {PARSE_CSS_FILE} case 'theme': $sql_from = STYLES_THEME_TABLE; break; - - case 'imageset': - $sql_from = STYLES_IMAGESET_TABLE; - break; } $l_prefix = strtoupper($mode); @@ -720,7 +434,7 @@ parse_css_file = {PARSE_CSS_FILE} $template_file = preg_replace('#\.{2,}#', '.', $template_file); // Retrieve some information about the template - $sql = 'SELECT template_storedb, template_path, template_name + $sql = 'SELECT template_path, template_name FROM ' . STYLES_TEMPLATE_TABLE . " WHERE template_id = $template_id"; $result = $db->sql_query($sql); @@ -732,6 +446,32 @@ parse_css_file = {PARSE_CSS_FILE} trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING); } + // Get the filesystem location of the current file + $template_path = "{$phpbb_root_path}styles/{$template_info['template_path']}/template"; + $file = "$template_path/$template_file"; + + if ($template_file) + { + $l_not_writable = sprintf($user->lang['TEMPLATE_FILE_NOT_WRITABLE'], htmlspecialchars($template_file)) . adm_back_link($this->u_action); + + if ($safe_mode) + { + trigger_error($l_not_writable, E_USER_WARNING); + } + + if (file_exists($file) && is_file($file) && is_readable($file)) + { + if (!phpbb_is_writable($file)) + { + trigger_error($l_not_writable, E_USER_WARNING); + } + } + else + { + trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + } + if ($save_changes && !check_form_key('acp_styles')) { trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); @@ -744,50 +484,14 @@ parse_css_file = {PARSE_CSS_FILE} // save changes to the template if the user submitted any if ($save_changes && $template_file) { - // 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)) + // Try to write the file + if (!($fp = @fopen($file, 'wb'))) { - 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'); + // File exists and is writeable, but still not able to be written to + trigger_error($l_not_writable, E_USER_WARNING); } + fwrite($fp, $template_data); + fclose($fp); // destroy the cached version of the template (filename without extension) $this->clear_template_cache($template_info, array(substr($template_file, 0, -5))); @@ -795,56 +499,22 @@ parse_css_file = {PARSE_CSS_FILE} $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 . "&action=edit&id=$template_id&text_rows=$text_rows&template_file=$template_file")); + trigger_error($user->lang['TEMPLATE_FILE_UPDATED'] . adm_back_link($this->u_action . "&action=edit&id=$template_id&text_rows=$text_rows&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')); + $filelist = filelist($template_path, '', 'html'); + $filelist[''] = array_diff($filelist[''], array('bbcode.html')); - if ($template_file) - { - if (!file_exists($template_path . "/$template_file") || !($template_data = file_get_contents($template_path . "/$template_file"))) - { - trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING); - } - } - } - else + if ($template_file) { - $sql = 'SELECT * - FROM ' . STYLES_TEMPLATE_DATA_TABLE . " - WHERE template_id = $template_id"; - $result = $db->sql_query($sql); + $template_data = file_get_contents($file); - $filelist = array('' => array()); - while ($row = $db->sql_fetchrow($result)) + if (!$template_data) { - $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']; - } + trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING); } - $db->sql_freeresult($result); - unset($file_info); } if (empty($filelist[''])) @@ -1015,35 +685,6 @@ parse_css_file = {PARSE_CSS_FILE} adm_page_footer(); } - $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); - } - } - // Get a list of cached template files and then retrieve additional information about them $file_ary = $this->template_cache_filelist($template_row['template_path']); @@ -1066,30 +707,10 @@ parse_css_file = {PARSE_CSS_FILE} $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']) - { - 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']) + if (isset($template_row['template_inherits_id']) && $template_row['template_inherits_id'] && !file_exists($file_tpl)) { - $file = str_replace('.', '/', $file); + $file_tpl = "{$phpbb_root_path}styles/{$template_row['template_inherit_path']}/template/$tpl_file.html"; + $inherited = true; } $template->assign_block_vars('file', array( @@ -1099,10 +720,9 @@ parse_css_file = {PARSE_CSS_FILE} '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'])) - ); + 'MODIFIED' => $user->format_date(filemtime($file_tpl)), + )); } - unset($filemtime); $template->assign_vars(array( 'S_CACHE' => true, @@ -1136,7 +756,7 @@ parse_css_file = {PARSE_CSS_FILE} $theme_file = str_replace('..', '.', $theme_file); // Retrieve some information about the theme - $sql = 'SELECT theme_storedb, theme_path, theme_name, theme_data + $sql = 'SELECT theme_path, theme_name FROM ' . STYLES_THEME_TABLE . " WHERE theme_id = $theme_id"; $result = $db->sql_query($sql); @@ -1147,71 +767,62 @@ parse_css_file = {PARSE_CSS_FILE} } $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 + $theme_path = "{$phpbb_root_path}styles/{$theme_info['theme_path']}/theme"; + $file = "$theme_path/$theme_file"; + + if ($theme_file) { - // 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']; + $l_not_writable = sprintf($user->lang['THEME_FILE_NOT_WRITABLE'], htmlspecialchars($theme_file)) . adm_back_link($this->u_action); - // 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 ($safe_mode) { - if (!($fp = @fopen($file, 'wb'))) + trigger_error($l_not_writable, E_USER_WARNING); + } + + if (file_exists($file) && is_file($file) && is_readable($file)) + { + if (!phpbb_is_writable($file)) { - trigger_error($user->lang['NO_THEME'] . adm_back_link($this->u_action), E_USER_WARNING); + trigger_error($l_not_writable, 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); + trigger_error($user->lang['NO_THEME'] . adm_back_link($this->u_action), E_USER_WARNING); + } + } - $cache->destroy('sql', STYLES_THEME_TABLE); + // save changes to the theme if the user submitted any + if ($save_changes && $theme_file) + { + $message = $user->lang['THEME_UPDATED']; - // 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']; - } + if (!($fp = @fopen($file, 'wb'))) + { + trigger_error($l_not_writable, E_USER_WARNING); } + fwrite($fp, $theme_data); + fclose($fp); + $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 : ''); + add_log('admin', 'LOG_THEME_EDIT_FILE', $theme_info['theme_name'], $theme_file); trigger_error($message . adm_back_link($this->u_action . "&action=edit&id=$theme_id&template_file=$theme_file&text_rows=$text_rows")); } // Generate a category array containing theme filenames - if (!$theme_info['theme_storedb']) - { - $theme_path = "{$phpbb_root_path}styles/{$theme_info['theme_path']}/theme"; + $filelist = filelist($theme_path, '', 'css'); - $filelist = filelist($theme_path, '', 'css'); + if ($theme_file) + { + $theme_data = file_get_contents($file); - if ($theme_file) + if (!$theme_data) { - 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); - } + trigger_error($user->lang['NO_THEME'] . adm_back_link($this->u_action), E_USER_WARNING); } } - else - { - $theme_data = &$theme_info['theme_data']; - } // Now create the categories $filelist_cats[''] = array(); @@ -1274,7 +885,6 @@ parse_css_file = {PARSE_CSS_FILE} $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 . "&action=edit&id=$theme_id&text_rows=$text_rows", @@ -1292,289 +902,12 @@ parse_css_file = {PARSE_CSS_FILE} 'SELECTED_TEMPLATE' => $theme_info['theme_name'], 'TEMPLATE_FILE' => $theme_file, 'TEMPLATE_DATA' => utf8_htmlspecialchars($theme_data), - 'TEXT_ROWS' => $text_rows) - ); - } - - /** - * Edit imagesets - * - * @param int $imageset_id specifies which imageset is being edited - */ - function edit_imageset($imageset_id) - { - global $db, $user, $phpbb_root_path, $cache, $template; - - $this->page_title = 'EDIT_IMAGESET'; - - if (!$imageset_id) - { - trigger_error($user->lang['NO_IMAGESET'] . 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); - - if (!$imageset_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)) - { - $valid_name = true; - break; - } - } - - if ($update && isset($_POST['imgpath']) && $valid_name) - { - // 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; - } - - $imglang = ''; - - 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); - } - - // 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; - } - - if (strpos($imgpath, '/') !== false) - { - list($imglang, $imgfilename) = explode('/', $imgpath); - } - else - { - $imgfilename = $imgpath; - } - - $sql_ary = array( - 'image_filename' => (string) $imgfilename, - 'image_width' => (int) $imgwidth, - 'image_height' => (int) $imgheight, - 'image_lang' => (string) $imglang, - ); - - // 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) - { - $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)) - { - $langs[] = $file; - } - else if (preg_match('#\.(?:gif|jpg|png)$#', $file)) - { - $imagesetlist['nolang'][] = $file; - } - } - - if ($sql_extra) - { - $dp2 = @opendir("$dir/$imgnamelang"); - - if ($dp2) - { - while (($file2 = readdir($dp2)) !== false) - { - if (preg_match('#\.(?:gif|jpg|png)$#', $file2)) - { - $imagesetlist['lang'][] = "$imgnamelang/$file2"; - } - } - 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) - { - $template->assign_block_vars('category.images', array( - 'SELECTED' => ($img == $imgname && $language == $imgnamelang), - 'VALUE' => $img . '-' . $language, - 'TEXT' => $user->lang['IMG_' . strtoupper($img)] . ' [ ' . $language . ' ]' - )); - } - } - else - { - $template->assign_block_vars('category.images', array( - 'SELECTED' => ($img == $imgname), - 'VALUE' => $img, - 'TEXT' => (($category == 'custom') ? $img : $user->lang['IMG_' . strtoupper($img)]) - )); - } - } - } - - // 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) - { - $template->assign_block_vars('imagesetlist', array( - 'TYPE' => ($type == 'lang') - )); - } - - foreach ($img_ary as $img) - { - $imgtext = preg_replace('/^([^\/]+\/)/', '', $img); - $selected = (!empty($imgname) && strpos($image_filename, $imgtext) !== false); - if ($selected) - { - $image_found = true; - $img_val = htmlspecialchars($img); - } - $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 . "&action=edit&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 + 'TEXT_ROWS' => $text_rows, )); } /** - * Remove style/template/theme/imageset + * Remove style/template/theme */ function remove($mode, $style_id) { @@ -1588,23 +921,18 @@ parse_css_file = {PARSE_CSS_FILE} { case 'style': $sql_from = STYLES_TABLE; - $sql_select = 'style_id, style_name, template_id, theme_id, imageset_id'; + $sql_select = 'style_id, style_name, template_id, theme_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'; + $sql_select = 'template_id, template_name, template_path'; 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'; + $sql_select = 'theme_id, theme_name, theme_path'; break; } @@ -1658,7 +986,7 @@ parse_css_file = {PARSE_CSS_FILE} } // Remove the components - $components = array('template', 'theme', 'imageset'); + $components = array('template', 'theme'); foreach ($components as $component) { $new_id = request_var('new_' . $component . '_id', 0); @@ -1707,7 +1035,7 @@ parse_css_file = {PARSE_CSS_FILE} } /** - * Remove template/theme/imageset entry from the database + * Remove template/theme entry from the database */ function remove_component($component, $component_id, $new_id, $style_id = false) { @@ -1731,13 +1059,6 @@ parse_css_file = {PARSE_CSS_FILE} return; } - if ($component == 'imageset') - { - $sql = 'DELETE FROM ' . STYLES_IMAGESET_DATA_TABLE . " - WHERE imageset_id = $component_id"; - $db->sql_query($sql); - } - switch ($component) { case 'template': @@ -1747,10 +1068,6 @@ parse_css_file = {PARSE_CSS_FILE} case 'theme': $sql_from = STYLES_THEME_TABLE; break; - - case 'imageset': - $sql_from = STYLES_IMAGESET_TABLE;; - break; } $sql = "DELETE FROM $sql_from @@ -1764,7 +1081,7 @@ parse_css_file = {PARSE_CSS_FILE} } /** - * Display the options which can be used to replace a style/template/theme/imageset + * Display the options which can be used to replace a style/template/theme */ function display_component_options($component, $component_id, $style_row = false, $style_id = false) { @@ -1792,10 +1109,6 @@ parse_css_file = {PARSE_CSS_FILE} case 'theme': $sql_from = STYLES_THEME_TABLE; break; - - case 'imageset': - $sql_from = STYLES_IMAGESET_TABLE; - break; } $s_options = ''; @@ -1844,7 +1157,7 @@ parse_css_file = {PARSE_CSS_FILE} $template->assign_var('S_REPLACE_OPTIONS', $s_options); if ($component == 'style') { - $components = array('template', 'theme', 'imageset'); + $components = array('template', 'theme'); foreach ($components as $component) { $this->display_component_options($component, $style_row[$component . '_id'], false, $component_id, true); @@ -1906,7 +1219,6 @@ parse_css_file = {PARSE_CSS_FILE} $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', ''); @@ -1932,7 +1244,7 @@ parse_css_file = {PARSE_CSS_FILE} switch ($mode) { case 'style': - if ($update && ($inc_template + $inc_theme + $inc_imageset) < 1) + if ($update && ($inc_template + $inc_theme) < 1) { $error[] = $user->lang['STYLE_ERR_MORE_ELEMENTS']; } @@ -1942,9 +1254,8 @@ parse_css_file = {PARSE_CSS_FILE} $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"; + $sql_from = STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . ' c'; + $sql_where = "s.style_id = $style_id AND t.template_id = s.template_id AND c.theme_id = s.theme_id"; $l_prefix = 'STYLE'; break; @@ -1968,16 +1279,6 @@ parse_css_file = {PARSE_CSS_FILE} $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; } if ($update && !sizeof($error)) @@ -1994,7 +1295,7 @@ parse_css_file = {PARSE_CSS_FILE} 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'); + $var_ary = array('style_id', 'style_name', 'style_copyright', 'template_id', 'template_name', 'template_path', 'template_copyright', 'template_inherits_id', 'bbcode_bitfield', 'theme_id', 'theme_name', 'theme_path', 'theme_copyright'); foreach ($var_ary as $var) { @@ -2012,7 +1313,6 @@ parse_css_file = {PARSE_CSS_FILE} $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, @@ -2050,31 +1350,12 @@ parse_css_file = {PARSE_CSS_FILE} ); // 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); - } + $files[] = array( + 'src' => "styles/{$style_row['template_path']}/template/", + 'prefix-' => "styles/{$style_row['template_path']}/", + 'prefix+' => false, + 'exclude' => 'template.cfg' + ); unset($template_cfg); } @@ -2087,130 +1368,21 @@ parse_css_file = {PARSE_CSS_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' + 'exclude' => 'theme.cfg', ); $data[] = array( 'src' => $theme_cfg, - 'prefix' => 'theme/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) - { - $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) - { - $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) - { - 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]); - } - } - } - - $data[] = array( - 'src' => trim($imageset_cfg), - 'prefix' => 'imageset/' . $lang . '/imageset.cfg' - ); - } - - unset($imageset_cfg); - } - switch ($format) { case 'tar': @@ -2335,7 +1507,7 @@ parse_css_file = {PARSE_CSS_FILE} $l_type = strtoupper($mode); $error = array(); - $element_ary = array('template' => STYLES_TEMPLATE_TABLE, 'theme' => STYLES_THEME_TABLE, 'imageset' => STYLES_IMAGESET_TABLE); + $element_ary = array('template' => STYLES_TEMPLATE_TABLE, 'theme' => STYLES_THEME_TABLE); switch ($mode) { @@ -2350,10 +1522,6 @@ parse_css_file = {PARSE_CSS_FILE} case 'theme': $sql_from = STYLES_THEME_TABLE; break; - - case 'imageset': - $sql_from = STYLES_IMAGESET_TABLE; - break; } $sql = "SELECT * @@ -2377,11 +1545,9 @@ parse_css_file = {PARSE_CSS_FILE} $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) @@ -2397,7 +1563,7 @@ parse_css_file = {PARSE_CSS_FILE} $conflict = $db->sql_fetchrow($result); $db->sql_freeresult($result); - if ($mode == 'style' && (!$template_id || !$theme_id || !$imageset_id)) + if ($mode == 'style' && (!$template_id || !$theme_id)) { $error[] = $user->lang['STYLE_ERR_NO_IDS']; } @@ -2412,29 +1578,6 @@ parse_css_file = {PARSE_CSS_FILE} $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; - } - } - } - if (!sizeof($error)) { // Check length settings @@ -2455,9 +1598,7 @@ parse_css_file = {PARSE_CSS_FILE} $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) ); @@ -2478,81 +1619,14 @@ parse_css_file = {PARSE_CSS_FILE} $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; } @@ -2619,16 +1693,12 @@ parse_css_file = {PARSE_CSS_FILE} '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 . '&action=details&id=' . $style_id, 'U_BACK' => $this->u_action, @@ -2636,8 +1706,6 @@ parse_css_file = {PARSE_CSS_FILE} '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'], @@ -2724,84 +1792,6 @@ parse_css_file = {PARSE_CSS_FILE} } /** - * Store template files into db - */ - function store_templates($mode, $style_id, $template_path, $filelist) - { - global $phpbb_root_path, $phpEx, $db; - - $template_path = $template_path . '/template/'; - $includes = array(); - foreach ($filelist as $pathfile => $file_ary) - { - foreach ($file_ary as $file) - { - if (!($fp = @fopen("{$phpbb_root_path}styles/$template_path$pathfile$file", 'r'))) - { - 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; - } - } - } - } - - foreach ($filelist as $pathfile => $file_ary) - { - 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); - } - } - } - - /** * Returns an array containing all template filenames for one template that are currently cached. * * @param string $template_path contains the name of the template's folder in /styles/ @@ -2876,7 +1866,7 @@ parse_css_file = {PARSE_CSS_FILE} } /** - * Install Style/Template/Theme/Imageset + * Install Style/Template/Theme */ function install($mode) { @@ -2886,7 +1876,7 @@ parse_css_file = {PARSE_CSS_FILE} $error = $installcfg = $style_row = array(); $root_path = $cfg_file = ''; - $element_ary = array('template' => STYLES_TEMPLATE_TABLE, 'theme' => STYLES_THEME_TABLE, 'imageset' => STYLES_IMAGESET_TABLE); + $element_ary = array('template' => STYLES_TEMPLATE_TABLE, 'theme' => STYLES_THEME_TABLE); $install_path = request_var('path', ''); $update = (isset($_POST['update'])) ? true : false; @@ -2932,7 +1922,6 @@ parse_css_file = {PARSE_CSS_FILE} $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) @@ -2958,7 +1947,7 @@ parse_css_file = {PARSE_CSS_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) + foreach (array('inherit_from') as $key) { if (!empty($cfg_contents[$key]) && !isset($installcfg[$key])) { @@ -2977,10 +1966,6 @@ parse_css_file = {PARSE_CSS_FILE} case 'theme': $this->test_installed('theme', $error, $root_path, false, $style_row['theme_id'], $style_row['theme_name'], $style_row['theme_copyright']); break; - - case 'imageset': - $this->test_installed('imageset', $error, $root_path, false, $style_row['imageset_id'], $style_row['imageset_name'], $style_row['imageset_copyright']); - break; } } else @@ -2988,7 +1973,6 @@ parse_css_file = {PARSE_CSS_FILE} 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); @@ -3002,19 +1986,18 @@ parse_css_file = {PARSE_CSS_FILE} ${$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); + $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); } 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']); + $this->install_element($mode, $error, 'install', $root_path, $style_row[$mode . '_id'], $style_row[$mode . '_name'], $install_path, $style_row[$mode . '_copyright']); } 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)); + trigger_error($user->lang[$l_type . '_ADDED'] . adm_back_link($this->u_action)); } } @@ -3030,7 +2013,6 @@ parse_css_file = {PARSE_CSS_FILE} '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, @@ -3040,15 +2022,12 @@ parse_css_file = {PARSE_CSS_FILE} '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'] : '') + 'THEME_NAME' => ($mode == 'style') ? $style_row['theme_name'] : '') ); } @@ -3060,7 +2039,7 @@ parse_css_file = {PARSE_CSS_FILE} 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); + $element_ary = array('template' => STYLES_TEMPLATE_TABLE, 'theme' => STYLES_THEME_TABLE); $error = array(); $style_row = array( @@ -3068,8 +2047,6 @@ parse_css_file = {PARSE_CSS_FILE} $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), ); @@ -3082,7 +2059,7 @@ parse_css_file = {PARSE_CSS_FILE} switch ($mode) { case 'style': - $sql_select = 'template_id, theme_id, imageset_id'; + $sql_select = 'template_id, theme_id'; $sql_from = STYLES_TABLE; break; @@ -3095,11 +2072,6 @@ parse_css_file = {PARSE_CSS_FILE} $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 @@ -3118,7 +2090,6 @@ parse_css_file = {PARSE_CSS_FILE} { $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']; } } @@ -3126,9 +2097,8 @@ parse_css_file = {PARSE_CSS_FILE} { $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'])) + if ($mode == 'style' && (!$style_row['template_id'] || !$style_row['theme_id'])) { $error[] = $user->lang['STYLE_ERR_NO_IDS']; } @@ -3148,8 +2118,7 @@ parse_css_file = {PARSE_CSS_FILE} { $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)); + trigger_error($user->lang[$l_type . '_ADDED'] . adm_back_link($this->u_action)); } } @@ -3183,12 +2152,10 @@ parse_css_file = {PARSE_CSS_FILE} '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 . '&action=add&basis=' . $basis, 'U_BACK' => $this->u_action, @@ -3196,8 +2163,6 @@ parse_css_file = {PARSE_CSS_FILE} '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'], @@ -3210,7 +2175,6 @@ parse_css_file = {PARSE_CSS_FILE} $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) @@ -3237,10 +2201,6 @@ parse_css_file = {PARSE_CSS_FILE} case 'theme': $sql_from = STYLES_THEME_TABLE; break; - - case 'imageset': - $sql_from = STYLES_IMAGESET_TABLE; - break; } $l_element = strtoupper($element); @@ -3279,11 +2239,11 @@ parse_css_file = {PARSE_CSS_FILE} /** * Install/Add style */ - 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) + 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) { global $config, $db, $user; - $element_ary = array('template', 'theme', 'imageset'); + $element_ary = array('template', 'theme'); if (!$name) { @@ -3329,7 +2289,7 @@ parse_css_file = {PARSE_CSS_FILE} } } - if (!$style_row['template_id'] || !$style_row['theme_id'] || !$style_row['imageset_id']) + if (!$style_row['template_id'] || !$style_row['theme_id']) { $error[] = $user->lang['STYLE_ERR_NO_IDS']; } @@ -3347,7 +2307,6 @@ parse_css_file = {PARSE_CSS_FILE} '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 . ' @@ -3374,7 +2333,7 @@ parse_css_file = {PARSE_CSS_FILE} /** * Install/add an element, doing various checks as we go */ - function install_element($mode, &$error, $action, $root_path, &$id, $name, $path, $copyright, $store_db = 0) + function install_element($mode, &$error, $action, $root_path, &$id, $name, $path, $copyright) { global $phpbb_root_path, $db, $user; @@ -3390,10 +2349,6 @@ parse_css_file = {PARSE_CSS_FILE} case 'theme': $sql_from = STYLES_THEME_TABLE; break; - - case 'imageset': - $sql_from = STYLES_IMAGESET_TABLE; - break; } $l_type = strtoupper($mode); @@ -3445,7 +2400,7 @@ parse_css_file = {PARSE_CSS_FILE} $select_bf = ''; } - $sql = "SELECT {$mode}_id, {$mode}_name, {$mode}_path, {$mode}_storedb $select_bf + $sql = "SELECT {$mode}_id, {$mode}_name, {$mode}_path, $select_bf FROM $sql_from WHERE {$mode}_name = '" . $db->sql_escape($cfg_data['inherit_from']) . "' AND {$mode}_inherits_id = 0"; @@ -3461,8 +2416,6 @@ parse_css_file = {PARSE_CSS_FILE} $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 @@ -3500,10 +2453,6 @@ parse_css_file = {PARSE_CSS_FILE} $sql_ary['bbcode_bitfield'] = $this->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( @@ -3514,22 +2463,6 @@ parse_css_file = {PARSE_CSS_FILE} 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; } @@ -3541,119 +2474,9 @@ parse_css_file = {PARSE_CSS_FILE} $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 = 'SELECT lang_dir - FROM ' . LANG_TABLE; - $result = $db->sql_query($sql); - - 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; - } - - 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); - } - $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; + add_log('admin', 'LOG_' . $l_type . '_ADD_FS', $name); } /** @@ -3679,10 +2502,6 @@ parse_css_file = {PARSE_CSS_FILE} case 'theme': $sql_from = STYLES_THEME_TABLE; break; - - case 'imageset': - $sql_from = STYLES_IMAGESET_TABLE; - break; } $sql = "SELECT {$mode}_id, {$mode}_name, {$mode}_path @@ -3735,10 +2554,6 @@ parse_css_file = {PARSE_CSS_FILE} case 'theme': $sql_from = STYLES_THEME_TABLE; break; - - case 'imageset': - $sql_from = STYLES_IMAGESET_TABLE; - break; } $sql = "SELECT {$mode}_inherits_id @@ -3770,180 +2585,4 @@ parse_css_file = {PARSE_CSS_FILE} return false; } - - /** - * Moves a template set and its subtemplates to the database - * - * @access public - * @param string $mode The component to move - only template is supported - * @param int $id The template id - */ - function store_in_db($mode, $id) - { - global $db, $user; - - $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; - } - - $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)) - { - $db->sql_freeresult($result); - $subs = $this->check_inheritance($mode, $id); - - $this->_store_in_db($mode, $id, $row["{$mode}_path"]); - if ($subs && sizeof($subs)) - { - foreach ($subs as $sub_id => $sub) - { - if ($err = $this->_store_in_db($mode, $sub["{$mode}_id"], $sub["{$mode}_path"])) - { - $error[] = $err; - } - } - } - } - if (sizeof($error)) - { - return $error; - } - - 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); - } - - /** - * Moves a template set and its subtemplates to the filesystem - * - * @access public - * @param string $mode The component to move - only template is supported - * @param int $id The template id - */ - function store_in_fs($mode, $id) - { - global $db, $user; - - $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); - } - - $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)) - { - $db->sql_freeresult($result); - if (!sizeof($error)) - { - $subs = $this->check_inheritance($mode, $id); - - $this->_store_in_fs($mode, $id, $row["{$mode}_path"]); - - 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; - } - } - return false; - } - - /** - * Moves a template set to the filesystem - * - * @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 - */ - function _store_in_fs($mode, $id, $path) - { - 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")) - { - $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); - } - } - if (sizeof($error)) - { - return $error; - } - $sql = 'UPDATE ' . STYLES_TEMPLATE_TABLE . ' - SET template_storedb = 0 - WHERE template_id = ' . $id; - $db->sql_query($sql); - - return false; - } - } diff --git a/phpBB/includes/acp/info/acp_styles.php b/phpBB/includes/acp/info/acp_styles.php index d6afd53cef..bdcceb1b7d 100644 --- a/phpBB/includes/acp/info/acp_styles.php +++ b/phpBB/includes/acp/info/acp_styles.php @@ -23,7 +23,6 @@ class acp_styles_info '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')), ), ); } diff --git a/phpBB/includes/auth/auth_apache.php b/phpBB/includes/auth/auth_apache.php index a148403c6f..9089703035 100644 --- a/phpBB/includes/auth/auth_apache.php +++ b/phpBB/includes/auth/auth_apache.php @@ -28,9 +28,9 @@ if (!defined('IN_PHPBB')) */ function init_apache() { - global $user; + global $user, $request; - if (!isset($_SERVER['PHP_AUTH_USER']) || $user->data['username'] !== $_SERVER['PHP_AUTH_USER']) + if (!$request->is_set('PHP_AUTH_USER', phpbb_request_interface::SERVER) || $user->data['username'] !== htmlspecialchars_decode($request->server('PHP_AUTH_USER'))) { return $user->lang['APACHE_SETUP_BEFORE_USE']; } @@ -42,7 +42,7 @@ function init_apache() */ function login_apache(&$username, &$password) { - global $db; + global $db, $request; // do not allow empty password if (!$password) @@ -63,7 +63,7 @@ function login_apache(&$username, &$password) ); } - if (!isset($_SERVER['PHP_AUTH_USER'])) + if (!$request->is_set('PHP_AUTH_USER', phpbb_request_interface::SERVER)) { return array( 'status' => LOGIN_ERROR_EXTERNAL_AUTH, @@ -72,8 +72,8 @@ function login_apache(&$username, &$password) ); } - $php_auth_user = $_SERVER['PHP_AUTH_USER']; - $php_auth_pw = $_SERVER['PHP_AUTH_PW']; + $php_auth_user = htmlspecialchars_decode($request->server('PHP_AUTH_USER')); + $php_auth_pw = htmlspecialchars_decode($request->server('PHP_AUTH_PW')); if (!empty($php_auth_user) && !empty($php_auth_pw)) { @@ -136,15 +136,15 @@ function login_apache(&$username, &$password) */ function autologin_apache() { - global $db; + global $db, $request; - if (!isset($_SERVER['PHP_AUTH_USER'])) + if (!$request->is_set('PHP_AUTH_USER', phpbb_request_interface::SERVER)) { return array(); } - $php_auth_user = $_SERVER['PHP_AUTH_USER']; - $php_auth_pw = $_SERVER['PHP_AUTH_PW']; + $php_auth_user = htmlspecialchars_decode($request->server('PHP_AUTH_USER')); + $php_auth_pw = htmlspecialchars_decode($request->server('PHP_AUTH_PW')); if (!empty($php_auth_user) && !empty($php_auth_pw)) { @@ -228,11 +228,12 @@ function user_row_apache($username, $password) */ function validate_session_apache(&$user) { + global $request; + // Check if PHP_AUTH_USER is set and handle this case - if (isset($_SERVER['PHP_AUTH_USER'])) + if ($request->is_set('PHP_AUTH_USER', phpbb_request_interface::SERVER)) { - $php_auth_user = ''; - set_var($php_auth_user, $_SERVER['PHP_AUTH_USER'], 'string', true); + $php_auth_user = $request->server('PHP_AUTH_USER'); return ($php_auth_user === $user['username']) ? true : false; } diff --git a/phpBB/includes/auth/auth_db.php b/phpBB/includes/auth/auth_db.php index b4ae1911cf..a2ff9b4047 100644 --- a/phpBB/includes/auth/auth_db.php +++ b/phpBB/includes/auth/auth_db.php @@ -129,7 +129,7 @@ function login_db($username, $password, $ip = '', $browser = '', $forwarded_for include ($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx); } - $captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']); + $captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']); $captcha->init(CONFIRM_LOGIN); $vc_response = $captcha->validate($row); if ($vc_response) diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index a360bcd5d1..c3367fbd46 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -30,7 +30,6 @@ class bbcode var $bbcodes = array(); var $template_bitfield; - var $template_filename = ''; /** * Constructor @@ -128,28 +127,17 @@ class bbcode */ function bbcode_cache_init() { - global $phpbb_root_path, $template, $user; + global $phpbb_root_path, $phpEx, $config, $user; 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 (!@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_locator = new phpbb_template_locator(); + $template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $template_locator); + $template->set_template(); + $template_locator->set_filenames(array('bbcode.html' => 'bbcode.html')); + $this->template_filename = $template_locator->get_source_file_for_handle('bbcode.html'); } $bbcode_ids = $rowset = $sql = array(); @@ -584,6 +572,13 @@ class bbcode $code = str_replace("\t", ' ', $code); $code = str_replace(' ', ' ', $code); $code = str_replace(' ', ' ', $code); + $code = str_replace("\n ", "\n ", $code); + + // keep space at the beginning + if (!empty($code) && $code[0] == ' ') + { + $code = ' ' . substr($code, 1); + } // remove newline at the beginning if (!empty($code) && $code[0] == "\n") diff --git a/phpBB/includes/captcha/captcha_factory.php b/phpBB/includes/captcha/captcha_factory.php index a3766f4054..c2ec8c5bda 100644 --- a/phpBB/includes/captcha/captcha_factory.php +++ b/phpBB/includes/captcha/captcha_factory.php @@ -26,7 +26,7 @@ class phpbb_captcha_factory /** * return an instance of class $name in file $name_plugin.php */ - function &get_instance($name) + function get_instance($name) { global $phpbb_root_path, $phpEx; diff --git a/phpBB/includes/captcha/plugins/phpbb_captcha_gd_plugin.php b/phpBB/includes/captcha/plugins/phpbb_captcha_gd_plugin.php index add8c3959f..bb76a06371 100644 --- a/phpBB/includes/captcha/plugins/phpbb_captcha_gd_plugin.php +++ b/phpBB/includes/captcha/plugins/phpbb_captcha_gd_plugin.php @@ -50,9 +50,9 @@ class phpbb_captcha_gd extends phpbb_default_captcha } } - function &get_instance() + function get_instance() { - $instance =& new phpbb_captcha_gd(); + $instance = new phpbb_captcha_gd(); return $instance; } diff --git a/phpBB/includes/captcha/plugins/phpbb_captcha_nogd_plugin.php b/phpBB/includes/captcha/plugins/phpbb_captcha_nogd_plugin.php index 490a0d62ab..3e98c45d2c 100644 --- a/phpBB/includes/captcha/plugins/phpbb_captcha_nogd_plugin.php +++ b/phpBB/includes/captcha/plugins/phpbb_captcha_nogd_plugin.php @@ -40,9 +40,9 @@ class phpbb_captcha_nogd extends phpbb_default_captcha } } - function &get_instance() + function get_instance() { - $instance =& new phpbb_captcha_nogd(); + $instance = new phpbb_captcha_nogd(); return $instance; } diff --git a/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php b/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php index 3bc727da41..272c0cd4d2 100644 --- a/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php +++ b/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php @@ -99,9 +99,9 @@ class phpbb_captcha_qa /** * API function */ - function &get_instance() + function get_instance() { - $instance =& new phpbb_captcha_qa(); + $instance = new phpbb_captcha_qa(); return $instance; } diff --git a/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php b/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php index c0db41d5a5..5cfb5df8fc 100644 --- a/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php +++ b/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php @@ -41,7 +41,8 @@ class phpbb_recaptcha extends phpbb_default_captcha // PHP4 Constructor function phpbb_recaptcha() { - $this->recaptcha_server = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? $this->recaptcha_server_secure : $this->recaptcha_server; + global $request; + $this->recaptcha_server = $request->is_secure() ? $this->recaptcha_server_secure : $this->recaptcha_server; } function init($type) @@ -54,9 +55,9 @@ class phpbb_recaptcha extends phpbb_default_captcha $this->response = request_var('recaptcha_response_field', ''); } - function &get_instance() + function get_instance() { - $instance =& new phpbb_recaptcha(); + $instance = new phpbb_recaptcha(); return $instance; } diff --git a/phpBB/includes/db/db_tools.php b/phpBB/includes/db/db_tools.php index 7c96965a9b..7715d2e854 100644 --- a/phpBB/includes/db/db_tools.php +++ b/phpBB/includes/db/db_tools.php @@ -649,6 +649,23 @@ class phpbb_db_tools $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'])) { @@ -1788,7 +1805,7 @@ class phpbb_db_tools break; case 'oracle': - $statements[] = 'ALTER TABLE ' . $table_name . ' DROP ' . $column_name; + $statements[] = 'ALTER TABLE ' . $table_name . ' DROP COLUMN ' . $column_name; break; case 'postgres': @@ -1939,6 +1956,7 @@ class phpbb_db_tools $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... diff --git a/phpBB/includes/db/mssqlnative.php b/phpBB/includes/db/mssqlnative.php index 2287bc716e..96b4c8a8c8 100644 --- a/phpBB/includes/db/mssqlnative.php +++ b/phpBB/includes/db/mssqlnative.php @@ -396,7 +396,7 @@ class dbal_mssqlnative extends dbal */ function sql_affectedrows() { - return ($this->db_connect_id) ? @sqlsrv_rows_affected($this->db_connect_id) : false; + return (!empty($this->query_result)) ? @sqlsrv_rows_affected($this->query_result) : false; } /** diff --git a/phpBB/includes/db/mysqli.php b/phpBB/includes/db/mysqli.php index db3846e7f7..d2781e96dd 100644 --- a/phpBB/includes/db/mysqli.php +++ b/phpBB/includes/db/mysqli.php @@ -249,7 +249,13 @@ class dbal_mysqli extends dbal return $cache->sql_fetchrow($query_id); } - return ($query_id !== false) ? @mysqli_fetch_assoc($query_id) : false; + if ($query_id !== false) + { + $result = @mysqli_fetch_assoc($query_id); + return $result !== null ? $result : false; + } + + return false; } /** diff --git a/phpBB/includes/error_collector.php b/phpBB/includes/error_collector.php index 55834f354c..3c0a89a1f3 100644 --- a/phpBB/includes/error_collector.php +++ b/phpBB/includes/error_collector.php @@ -49,13 +49,15 @@ class phpbb_error_collector { $text .= "<br />\n"; } + list($errno, $msg_text, $errfile, $errline) = $error; - $text .= "Errno $errno: $msg_text"; - if (defined('DEBUG_EXTRA') || defined('IN_INSTALL')) - { - $text .= " at $errfile line $errline"; - } + + // 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 fb7aafe636..8f41e18db6 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -817,7 +817,7 @@ function phpbb_is_writable($file) * @param string $path Path to check absoluteness of * @return boolean */ -function is_absolute($path) +function phpbb_is_absolute($path) { return ($path[0] == '/' || (DIRECTORY_SEPARATOR == '\\' && preg_match('#^[a-z]:[/\\\]#i', $path))) ? true : false; } @@ -830,6 +830,8 @@ function is_absolute($path) */ function phpbb_own_realpath($path) { + global $request; + // Now to perform funky shizzle // Switch to use UNIX slashes @@ -837,7 +839,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; @@ -873,11 +875,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 = ''; } @@ -1898,7 +1901,7 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add $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) ? ' ... ' : $separator; + $page_string .= ($start_cnt > 1) ? '<span class="page-dots"> ... </span>' : $separator; for ($i = $start_cnt + 1; $i < $end_cnt; $i++) { @@ -1909,7 +1912,7 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add } } - $page_string .= ($end_cnt < $total_pages) ? ' ... ' : $separator; + $page_string .= ($end_cnt < $total_pages) ? '<span class="page-dots"> ... </span>' : $separator; } else { @@ -1948,6 +1951,7 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add $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, + $tpl_prefix . 'CURRENT_PAGE' => $on_page, )); return $page_string; @@ -1996,6 +2000,12 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false) { global $_SID, $_EXTRA_URL, $phpbb_hook; + if ($params === '' || (is_array($params) && empty($params))) + { + // Do not append the ? if the param-list is empty anyway. + $params = false; + } + // 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)) @@ -2097,10 +2107,10 @@ 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'); + $server_port = $request->server('SERVER_PORT', 0); // Forcing server vars is the only way to specify/override the protocol if ($config['force_server_vars'] || !$server_name) @@ -2116,7 +2126,7 @@ function generate_board_url($without_script_path = false) else { // 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']; @@ -2468,6 +2478,8 @@ function meta_refresh($time, $url, $disable_cd_check = false) */ function send_status_line($code, $message) { + global $request; + if (substr(strtolower(@php_sapi_name()), 0, 3) === 'cgi') { // in theory, we shouldn't need that due to php doing it. Reality offers a differing opinion, though @@ -2475,15 +2487,9 @@ function send_status_line($code, $message) } else { - if (!empty($_SERVER['SERVER_PROTOCOL'])) - { - $version = $_SERVER['SERVER_PROTOCOL']; - } - else if (!empty($_SERVER['HTTP_VERSION'])) + if ($request->server('SERVER_PROTOCOL')) { - // I cannot remember where I got this from. - // This code path may never be reachable in reality. - $version = $_SERVER['HTTP_VERSION']; + $version = $request->server('SERVER_PROTOCOL'); } else { @@ -3151,61 +3157,44 @@ function add_log() } /** -* Return a nicely formatted backtrace (parts from the php manual by diz at ysagoon dot com) +* Return a nicely formatted backtrace. +* +* Turns the array returned by debug_backtrace() into HTML markup. +* Also filters out absolute paths to phpBB root. +* +* @return string HTML markup */ function get_backtrace() { - global $phpbb_root_path; - $output = '<div style="font-family: monospace;">'; $backtrace = debug_backtrace(); - $path = phpbb_realpath($phpbb_root_path); - foreach ($backtrace as $number => $trace) - { - // We skip the first one, because it only shows this file/function - if ($number == 0) - { - continue; - } + // We skip the first one, because it only shows this file/function + unset($backtrace[0]); + foreach ($backtrace as $trace) + { // Strip the current directory from path - if (empty($trace['file'])) - { - $trace['file'] = ''; - } - else - { - $trace['file'] = str_replace(array($path, '\\'), array('', '/'), $trace['file']); - $trace['file'] = substr($trace['file'], 1); - } - $args = array(); + $trace['file'] = (empty($trace['file'])) ? '(not given by php)' : htmlspecialchars(phpbb_filter_root_path($trace['file'])); + $trace['line'] = (empty($trace['line'])) ? '(not given by php)' : $trace['line']; - // If include/require/include_once is not called, do not show arguments - they may contain sensible information - if (!in_array($trace['function'], array('include', 'require', 'include_once'))) + // Only show function arguments for include etc. + // Other parameters may contain sensible information + $argument = ''; + if (!empty($trace['args'][0]) && in_array($trace['function'], array('include', 'require', 'include_once', 'require_once'))) { - unset($trace['args']); - } - else - { - // Path... - if (!empty($trace['args'][0])) - { - $argument = htmlspecialchars($trace['args'][0]); - $argument = str_replace(array($path, '\\'), array('', '/'), $argument); - $argument = substr($argument, 1); - $args[] = "'{$argument}'"; - } + $argument = htmlspecialchars(phpbb_filter_root_path($trace['args'][0])); } $trace['class'] = (!isset($trace['class'])) ? '' : $trace['class']; $trace['type'] = (!isset($trace['type'])) ? '' : $trace['type']; $output .= '<br />'; - $output .= '<b>FILE:</b> ' . htmlspecialchars($trace['file']) . '<br />'; + $output .= '<b>FILE:</b> ' . $trace['file'] . '<br />'; $output .= '<b>LINE:</b> ' . ((!empty($trace['line'])) ? $trace['line'] : '') . '<br />'; - $output .= '<b>CALL:</b> ' . htmlspecialchars($trace['class'] . $trace['type'] . $trace['function']) . '(' . ((sizeof($args)) ? implode(', ', $args) : '') . ')<br />'; + $output .= '<b>CALL:</b> ' . htmlspecialchars($trace['class'] . $trace['type'] . $trace['function']); + $output .= '(' . (($argument !== '') ? "'$argument'" : '') . ')<br />'; } $output .= '</div>'; return $output; @@ -3286,7 +3275,7 @@ function get_censor_preg_expression($word, $use_unicode = true) // Unescape the asterisk to simplify further conversions $word = str_replace('\*', '*', preg_quote($word, '#')); - if ($use_unicode && pcre_utf8_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); @@ -3754,9 +3743,8 @@ function msg_handler($errno, $msg_text, $errfile, $errline) if (strpos($errfile, 'cache') === false && strpos($errfile, 'template.') === false) { - // remove complete path to installation, with the risk of changing backslashes meant to be there - $errfile = str_replace(array(phpbb_realpath($phpbb_root_path), '\\'), array('', '/'), $errfile); - $msg_text = str_replace(array(phpbb_realpath($phpbb_root_path), '\\'), array('', '/'), $msg_text); + $errfile = phpbb_filter_root_path($errfile); + $msg_text = phpbb_filter_root_path($msg_text); $error_name = ($errno === E_WARNING) ? 'PHP Warning' : 'PHP Notice'; echo '<b>[phpBB Debug] ' . $error_name . '</b>: in file <b>' . $errfile . '</b> on line <b>' . $errline . '</b>: <b>' . $msg_text . '</b><br />' . "\n"; @@ -3935,6 +3923,29 @@ function msg_handler($errno, $msg_text, $errfile, $errline) } /** +* Removes absolute path to phpBB root directory from error messages +* and converts backslashes to forward slashes. +* +* @param string $errfile Absolute file path +* (e.g. /var/www/phpbb3/phpBB/includes/functions.php) +* Please note that if $errfile is outside of the phpBB root, +* the root path will not be found and can not be filtered. +* @return string Relative file path +* (e.g. /includes/functions.php) +*/ +function phpbb_filter_root_path($errfile) +{ + static $root_path; + + if (empty($root_path)) + { + $root_path = phpbb_realpath(dirname(__FILE__) . '/../'); + } + + return str_replace(array($root_path, '\\'), array('[ROOT]', '/'), $errfile); +} + +/** * Queries the session table to get information about online guests * @param int $item_id Limits the search to the item with this id * @param string $item The name of the item which is stored in the session table as session_{$item}_id @@ -4202,7 +4213,7 @@ function phpbb_optionset($bit, $set, $data) */ function phpbb_http_login($param) { - global $auth, $user; + global $auth, $user, $request; global $config; $param_defaults = array( @@ -4242,9 +4253,9 @@ function phpbb_http_login($param) $username = null; foreach ($username_keys as $k) { - if (isset($_SERVER[$k])) + if ($request->is_set($k, phpbb_request_interface::SERVER)) { - $username = $_SERVER[$k]; + $username = htmlspecialchars_decode($request->server($k)); break; } } @@ -4252,9 +4263,9 @@ function phpbb_http_login($param) $password = null; foreach ($password_keys as $k) { - if (isset($_SERVER[$k])) + if ($request->is_set($k, phpbb_request_interface::SERVER)) { - $password = $_SERVER[$k]; + $password = htmlspecialchars_decode($request->server($k)); break; } } @@ -4545,11 +4556,10 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0 'S_SEARCH_HIDDEN_FIELDS' => build_hidden_fields($s_search_hidden_fields), + 'T_ASSETS_PATH' => "{$web_path}assets", 'T_THEME_PATH' => "{$web_path}styles/" . $user->theme['theme_path'] . '/theme', 'T_TEMPLATE_PATH' => "{$web_path}styles/" . $user->theme['template_path'] . '/template', 'T_SUPER_TEMPLATE_PATH' => (isset($user->theme['template_inherit_path']) && $user->theme['template_inherit_path']) ? "{$web_path}styles/" . $user->theme['template_inherit_path'] . '/template' : "{$web_path}styles/" . $user->theme['template_path'] . '/template', - 'T_IMAGESET_PATH' => "{$web_path}styles/" . $user->theme['imageset_path'] . '/imageset', - 'T_IMAGESET_LANG_PATH' => "{$web_path}styles/" . $user->theme['imageset_path'] . '/imageset/' . $user->lang_name, 'T_IMAGES_PATH' => "{$web_path}images/", 'T_SMILIES_PATH' => "{$web_path}{$config['smilies_path']}/", 'T_AVATAR_PATH' => "{$web_path}{$config['avatar_path']}/", @@ -4557,14 +4567,14 @@ 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/" . $user->theme['theme_path'] . '/theme/stylesheet.css' : append_sid("{$phpbb_root_path}style.$phpEx", 'id=' . $user->theme['style_id'] . '&lang=' . $user->lang_name), + 'T_STYLESHEET_LINK' => "{$web_path}styles/" . $user->theme['theme_path'] . '/theme/stylesheet.css', + 'T_STYLESHEET_LANG_LINK' => "{$web_path}styles/" . $user->theme['theme_path'] . '/theme/' . $user->lang_name . '/stylesheet.css', 'T_STYLESHEET_NAME' => $user->theme['theme_name'], 'T_THEME_NAME' => $user->theme['theme_path'], + 'T_THEME_LANG_NAME' => $user->data['user_lang'], 'T_TEMPLATE_NAME' => $user->theme['template_path'], 'T_SUPER_TEMPLATE_NAME' => (isset($user->theme['template_inherit_path']) && $user->theme['template_inherit_path']) ? $user->theme['template_inherit_path'] : $user->theme['template_path'], - 'T_IMAGESET_NAME' => $user->theme['imageset_path'], - 'T_IMAGESET_LANG_NAME' => $user->data['user_lang'], 'T_IMAGES' => 'images', 'T_SMILIES' => $config['smilies_path'], 'T_AVATAR' => $config['avatar_path'], @@ -4585,6 +4595,12 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0 header('Expires: 0'); header('Pragma: no-cache'); + if (!empty($user->data['is_bot'])) + { + // Let reverse proxies know we detected a bot. + header('X-PHPBB-IS-BOT: yes'); + } + return; } @@ -4743,7 +4759,7 @@ function phpbb_user_session_handler() * * @return bool Returns true if PCRE (the regular expressions library) supports UTF-8 encoding */ -function pcre_utf8_support() +function phpbb_pcre_utf8_support() { static $utf8_pcre_properties = null; if (is_null($utf8_pcre_properties)) diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 179fd3c2f8..b1294a2f14 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -1107,7 +1107,7 @@ function extension_allowed($forum_id, $extension, &$extensions) * @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_legnth) and is deprecated. +* 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 = '') diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 26a4e965a7..4e8d8f7d34 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -52,6 +52,27 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod $sql_where = 'left_id > ' . $root_data['left_id'] . ' AND left_id < ' . $root_data['right_id']; } + // Handle marking everything read + if ($mark_read == 'all') + { + $redirect = build_url(array('mark', 'hash')); + meta_refresh(3, $redirect); + + if (check_link_hash(request_var('hash', ''), 'global')) + { + markread('all'); + + trigger_error( + $user->lang['FORUMS_MARKED'] . '<br /><br />' . + sprintf($user->lang['RETURN_INDEX'], '<a href="' . $redirect . '">', '</a>') + ); + } + else + { + trigger_error(sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>')); + } + } + // Display list of active topics for this category? $show_active = (isset($root_data['forum_flags']) && ($root_data['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS)) ? true : false; @@ -109,13 +130,14 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod $forum_id = $row['forum_id']; // Mark forums read? - if ($mark_read == 'forums' || $mark_read == 'all') + if ($mark_read == 'forums') { if ($auth->acl_get('f_list', $forum_id)) { $forum_ids[] = $forum_id; - continue; } + + continue; } // Category with no members @@ -141,8 +163,6 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod continue; } - $forum_ids[] = $forum_id; - if ($config['load_db_lastread'] && $user->data['is_registered']) { $forum_tracking_info[$forum_id] = (!empty($row['mark_time'])) ? $row['mark_time'] : $user->data['user_lastmark']; @@ -244,22 +264,14 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod $db->sql_freeresult($result); // Handle marking posts - if ($mark_read == 'forums' || $mark_read == 'all') + if ($mark_read == 'forums') { $redirect = build_url(array('mark', 'hash')); $token = request_var('hash', ''); if (check_link_hash($token, 'global')) { - if ($mark_read == 'all') - { - markread('all'); - $message = sprintf($user->lang['RETURN_INDEX'], '<a href="' . $redirect . '">', '</a>'); - } - else - { - markread('topics', $forum_ids); - $message = sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect . '">', '</a>'); - } + markread('topics', $forum_ids); + $message = sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect . '">', '</a>'); meta_refresh(3, $redirect); trigger_error($user->lang['FORUMS_MARKED'] . '<br /><br />' . $message); } @@ -446,7 +458,6 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod $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'] : '', @@ -644,7 +655,7 @@ function topic_generate_pagination($replies, $url) $pagination .= '<a href="' . $url . ($j == 0 ? '' : '&start=' . $j) . '">' . $times . '</a>'; if ($times == 1 && $total_pages > 5) { - $pagination .= ' ... '; + $pagination .= '<span class="page-dots"> ... </span>'; // Display the last three pages $times = $total_pages - 3; @@ -978,13 +989,17 @@ function display_user_activity(&$userdata) } // 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 + $forum_sql_topic GROUP BY topic_id ORDER BY num_posts DESC"; $result = $db->sql_query_limit($sql, 1); diff --git a/phpBB/includes/functions_download.php b/phpBB/includes/functions_download.php index 91a09608c7..b4664d74cb 100644 --- a/phpBB/includes/functions_download.php +++ b/phpBB/includes/functions_download.php @@ -274,7 +274,9 @@ function send_file_to_browser($attachment, $upload_dir, $category) */ function header_filename($file) { - $user_agent = (!empty($_SERVER['HTTP_USER_AGENT'])) ? htmlspecialchars((string) $_SERVER['HTTP_USER_AGENT']) : ''; + global $request; + + $user_agent = $request->header('User-Agent'); // There be dragons here. // Not many follows the RFC... @@ -292,14 +294,14 @@ function header_filename($file) */ function download_allowed() { - global $config, $user, $db; + global $config, $user, $db, $request; if (!$config['secure_downloads']) { return true; } - $url = (!empty($_SERVER['HTTP_REFERER'])) ? trim($_SERVER['HTTP_REFERER']) : trim(getenv('HTTP_REFERER')); + $url = htmlspecialchars_decode($request->header('Referer')); if (!$url) { @@ -404,8 +406,10 @@ function download_allowed() */ function set_modified_headers($stamp, $browser) { + global $request; + // 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; + $last_load = $request->header('Modified-Since') ? strtotime(trim($request->header('Modified-Since'))) : false; if ((strpos(strtolower($browser), 'msie 6.0') === false) && (strpos(strtolower($browser), 'msie 8.0') === false)) { if ($last_load !== false && $last_load >= $stamp) @@ -473,12 +477,12 @@ function phpbb_http_byte_range($filesize) { $request_array = phpbb_find_range_request(); } - + return (empty($request_array)) ? false : phpbb_parse_range_request($request_array, $filesize); } /** -* Searches for HTTP range request in super globals. +* Searches for HTTP range request in request headers. * * @return mixed false if no request found * array of strings containing the requested ranges otherwise @@ -486,23 +490,16 @@ function phpbb_http_byte_range($filesize) */ function phpbb_find_range_request() { - $globals = array( - array('_SERVER', 'HTTP_RANGE'), - array('_ENV', 'HTTP_RANGE'), - ); + global $request; - foreach ($globals as $array) - { - $global = $array[0]; - $key = $array[1]; + $value = $request->header('Range'); - // Make sure range request starts with "bytes=" - if (isset($GLOBALS[$global][$key]) && strpos($GLOBALS[$global][$key], 'bytes=') === 0) - { - // Strip leading 'bytes=' - // Multiple ranges can be separated by a comma - return explode(',', substr($GLOBALS[$global][$key], 6)); - } + // 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; diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index f5d102b1da..b94957a85f 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -175,7 +175,7 @@ class messenger */ function template($template_file, $template_lang = '', $template_path = '') { - global $config, $phpbb_root_path, $user; + global $config, $phpbb_root_path, $phpEx, $user; if (!trim($template_file)) { @@ -193,7 +193,8 @@ class messenger // tpl_msg now holds a template object we can use to parse the template file if (!isset($this->tpl_msg[$template_lang . $template_file])) { - $this->tpl_msg[$template_lang . $template_file] = new template(); + $template_locator = new phpbb_template_locator(); + $this->tpl_msg[$template_lang . $template_file] = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $template_locator); $tpl = &$this->tpl_msg[$template_lang . $template_file]; $fallback_template_path = false; @@ -333,7 +334,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 === '') @@ -341,7 +342,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) @@ -975,9 +976,16 @@ 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. - ob_start(); + 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->install(); $smtp->socket = fsockopen($config['smtp_host'], $config['smtp_port'], $errno, $errstr, 20); - $error_contents = ob_get_clean(); + $collector->uninstall(); + $error_contents = $collector->format_errors(); if (!$smtp->socket) { @@ -1608,18 +1616,27 @@ function mail_encode($str, $eol = "\r\n") */ function phpbb_mail($to, $subject, $msg, $headers, $eol, &$err_msg) { - global $config; + global $config, $phpbb_root_path, $phpEx; // We use the EOL character for the OS here because the PHP mail function does not correctly transform line endings. On Windows SMTP is used (SMTP is \r\n), on UNIX a command is used... // Reference: http://bugs.php.net/bug.php?id=15841 $headers = implode($eol, $headers); - ob_start(); + if (!class_exists('phpbb_error_collector')) + { + include($phpbb_root_path . 'includes/error_collector.' . $phpEx); + } + + $collector = new phpbb_error_collector; + $collector->install(); + // On some PHP Versions mail() *may* fail if there are newlines within the subject. // Newlines are used as a delimiter for lines in mail_encode() according to RFC 2045 section 6.8. // Because PHP can't decide what is wanted we revert back to the non-RFC-compliant way of separating by one space (Use '' as parameter to mail_encode() results in SPACE used) $result = $config['email_function_name']($to, mail_encode($subject, ''), wordwrap(utf8_wordwrap($msg), 997, "\n", true), $headers); - $err_msg = ob_get_clean(); + + $collector->uninstall(); + $err_msg = $collector->format_errors(); return $result; } diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 9e81533cea..4ca76344de 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1078,7 +1078,7 @@ 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']; diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 9787bdfbc4..32b57a9f2e 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -19,7 +19,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 +58,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 +261,60 @@ 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']]; + + 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; + } - // Evil Statement - $result = false; - eval('$result = (' . $evaluate . ') ? true : false;'); if (!$result) { diff --git a/phpBB/includes/functions_template.php b/phpBB/includes/functions_template.php deleted file mode 100644 index 8c58c33b0d..0000000000 --- a/phpBB/includes/functions_template.php +++ /dev/null @@ -1,812 +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; - } -} diff --git a/phpBB/includes/functions_transfer.php b/phpBB/includes/functions_transfer.php index fca092a4de..2b7919a8d2 100644 --- a/phpBB/includes/functions_transfer.php +++ b/phpBB/includes/functions_transfer.php @@ -808,23 +808,56 @@ class ftp_fsock extends transfer */ function _open_data_connection() { - $this->_send_command('PASV', '', false); - - if (!$ip_port = $this->_check_command(true)) + // Try to find out whether we have a IPv4 or IPv6 (control) connection + if (function_exists('stream_socket_get_name')) { - return false; + $socket_name = stream_socket_get_name($this->connection, true); + $server_ip = substr($socket_name, 0, strrpos($socket_name, ':')); } - // open the connection to start sending the file - if (!preg_match('#[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+#', $ip_port, $temp)) + if (!isset($server_ip) || preg_match(get_preg_expression('ipv4'), $server_ip)) { - // bad ip and port - return false; + // Passive mode + $this->_send_command('PASV', '', false); + + if (!$ip_port = $this->_check_command(true)) + { + return false; + } + + // open the connection to start sending the file + if (!preg_match('#[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+#', $ip_port, $temp)) + { + // bad ip and port + return false; + } + + $temp = explode(',', $temp[0]); + $server_ip = $temp[0] . '.' . $temp[1] . '.' . $temp[2] . '.' . $temp[3]; + $server_port = $temp[4] * 256 + $temp[5]; + } + else + { + // Extended Passive Mode - RFC2428 + $this->_send_command('EPSV', '', false); + + if (!$epsv_response = $this->_check_command(true)) + { + return false; + } + + // Response looks like "229 Entering Extended Passive Mode (|||12345|)" + // where 12345 is the tcp port for the data connection + if (!preg_match('#\(\|\|\|([0-9]+)\|\)#', $epsv_response, $match)) + { + return false; + } + $server_port = (int) $match[1]; + + // fsockopen expects IPv6 address in square brackets + $server_ip = "[$server_ip]"; } - $temp = explode(',', $temp[0]); - $server_ip = $temp[0] . '.' . $temp[1] . '.' . $temp[2] . '.' . $temp[3]; - $server_port = $temp[4] * 256 + $temp[5]; $errno = 0; $errstr = ''; diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 124aac18be..930cd4625f 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -1477,7 +1477,7 @@ function validate_username($username, $allowed_username = false) $mbstring = $pcre = false; // generic UTF-8 character types supported? - if (pcre_utf8_support()) + if (phpbb_pcre_utf8_support()) { $pcre = true; } @@ -1614,7 +1614,7 @@ function validate_password($password) $pcre = $mbstring = false; // generic UTF-8 character types supported? - if (pcre_utf8_support()) + if (phpbb_pcre_utf8_support()) { $upp = '\p{Lu}'; $low = '\p{Ll}'; diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index f170dd68eb..8206a183f3 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -227,7 +227,6 @@ function mcp_forum_view($id, $mode, $action, $forum_info) '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'] : '', diff --git a/phpBB/includes/questionnaire/questionnaire.php b/phpBB/includes/questionnaire/questionnaire.php index b9231547cd..fa12d570df 100644 --- a/phpBB/includes/questionnaire/questionnaire.php +++ b/phpBB/includes/questionnaire/questionnaire.php @@ -148,23 +148,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), @@ -482,7 +474,7 @@ class phpbb_questionnaire_phpbb_data_provider } } - global $db; + global $db, $request; $result['dbms'] = $dbms; $result['acm_type'] = $acm_type; @@ -492,7 +484,7 @@ class phpbb_questionnaire_phpbb_data_provider // 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/) diff --git a/phpBB/includes/request/interface.php b/phpBB/includes/request/interface.php index 7b5b600100..181bcb467a 100644 --- a/phpBB/includes/request/interface.php +++ b/phpBB/includes/request/interface.php @@ -29,6 +29,7 @@ interface phpbb_request_interface const GET = 1; const REQUEST = 2; const COOKIE = 3; + const SERVER = 4; /**#@-*/ /** @@ -67,6 +68,26 @@ interface phpbb_request_interface public function variable($var_name, $default, $multibyte = false, $super_global = phpbb_request_interface::REQUEST); /** + * Shortcut method to retrieve SERVER variables. + * + * @param string|array $var_name See phpbb_request_interface::variable + * @param mixed $default See phpbb_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_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. @@ -91,6 +112,20 @@ interface phpbb_request_interface public function is_set($var, $super_global = phpbb_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_interface::POST|GET|REQUEST|COOKIE $super_global diff --git a/phpBB/includes/request/request.php b/phpBB/includes/request/request.php index 7d284a9bf7..9386088a07 100644 --- a/phpBB/includes/request/request.php +++ b/phpBB/includes/request/request.php @@ -32,7 +32,8 @@ class phpbb_request implements phpbb_request_interface phpbb_request_interface::POST => '_POST', phpbb_request_interface::GET => '_GET', phpbb_request_interface::REQUEST => '_REQUEST', - phpbb_request_interface::COOKIE => '_COOKIE' + phpbb_request_interface::COOKIE => '_COOKIE', + phpbb_request_interface::SERVER => '_SERVER', ); /** @@ -242,6 +243,47 @@ class phpbb_request implements phpbb_request_interface } /** + * 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_interface::variable + * @param mixed $Default See phpbb_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_interface::SERVER)) + { + return $this->variable($var_name, $default, $multibyte, phpbb_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_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); + } + + /** * 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. @@ -272,6 +314,26 @@ class phpbb_request implements phpbb_request_interface } /** + * 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() + { + return $this->server('HTTPS') == 'on'; + } + + /** * Returns all variable names for a given super global * * @param phpbb_request_interface::POST|GET|REQUEST|COOKIE $super_global diff --git a/phpBB/includes/request/type_cast_helper.php b/phpBB/includes/request/type_cast_helper.php index 29855a9804..96ceb0df1d 100644 --- a/phpBB/includes/request/type_cast_helper.php +++ b/phpBB/includes/request/type_cast_helper.php @@ -88,11 +88,11 @@ class phpbb_request_type_cast_helper implements phpbb_request_type_cast_helper_i /** * 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 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) { @@ -101,7 +101,8 @@ class phpbb_request_type_cast_helper implements phpbb_request_type_cast_helper_i if ($type == 'string') { - $result = trim(htmlspecialchars(str_replace(array("\r\n", "\r", "\0"), array("\n", "\n", ''), $result), ENT_COMPAT, 'UTF-8')); + $result = trim(str_replace(array("\r\n", "\r", "\0"), array("\n", "\n", ''), $result)); + $result = htmlspecialchars($result, ENT_COMPAT, 'UTF-8'); if ($multibyte) { diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 9660fd6986..827205f20d 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -43,7 +43,7 @@ class fulltext_mysql extends search_backend $this->word_length = array('min' => $config['fulltext_mysql_min_word_len'], 'max' => $config['fulltext_mysql_max_word_len']); // PHP may not be linked with the bundled PCRE lib and instead with an older version - if (pcre_utf8_support()) + if (phpbb_pcre_utf8_support()) { $this->pcre_properties = true; } diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index e36f44ddfa..bd2257c139 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -41,16 +41,18 @@ class session */ static function extract_current_page($root_path) { + global $request; + $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')); + $script_name = htmlspecialchars_decode($request->server('PHP_SELF')); + $args = explode('&', htmlspecialchars_decode($request->server('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 = htmlspecialchars_decode($request->server('REQUEST_URI')); $script_name = (($pos = strpos($script_name, '?')) !== false) ? substr($script_name, 0, $pos) : $script_name; $page_array['failover'] = 1; } @@ -141,10 +143,10 @@ class session */ function extract_current_hostname() { - global $config; + global $config, $request; // Get hostname - $host = (!empty($_SERVER['HTTP_HOST'])) ? $_SERVER['HTTP_HOST'] : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME')); + $host = htmlspecialchars_decode($request->header('Host', $request->server('SERVER_NAME'))); // Should be a string and lowered $host = (string) strtolower($host); @@ -212,9 +214,9 @@ class session $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->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); @@ -268,7 +270,7 @@ class session // 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 = htmlspecialchars_decode($request->server('REMOTE_ADDR')); $this->ip = preg_replace('# {2,}#', ' ', str_replace(',', ' ', $this->ip)); // split the list of IPs @@ -382,7 +384,7 @@ class session $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') + if (@$config['referer_validation'] && strtolower($request->server('REQUEST_METHOD')) !== 'get') { $referer_valid = $this->validate_referer($check_referer_path); } @@ -1449,7 +1451,7 @@ class session */ function validate_referer($check_script_path = false) { - global $config; + 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)) @@ -1467,7 +1469,7 @@ class session 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'); + $server_port = $request->server('SERVER_PORT', 0); if ($server_port !== 80 && $server_port !== 443 && stripos($ref, ":$server_port") === 0) { @@ -1592,9 +1594,9 @@ class user extends session * 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'])) + if ($request->header('Accept-Language')) { - $accept_lang_ary = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); + $accept_lang_ary = explode(',', $request->header('Accept-Language')); foreach ($accept_lang_ary as $accept_lang) { @@ -1653,12 +1655,11 @@ class user extends session $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 + $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_name, c.theme_id + FROM ' . STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . " c 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"; + AND c.theme_id = s.theme_id"; $result = $db->sql_query($sql, 3600); $this->theme = $db->sql_fetchrow($result); $db->sql_freeresult($result); @@ -1673,12 +1674,11 @@ class user extends session 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 + $sql = 'SELECT s.style_id, t.template_path, t.template_id, t.bbcode_bitfield, c.theme_path, c.theme_name, c.theme_id + FROM ' . STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . " c 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"; + AND c.theme_id = s.theme_id"; $result = $db->sql_query($sql, 3600); $this->theme = $db->sql_fetchrow($result); $db->sql_freeresult($result); @@ -1696,7 +1696,6 @@ class user extends session $parsed_items = $parsed_items['theme']; $check_for = array( - 'parse_css_file' => (int) 0, 'pagination_sep' => (string) ', ' ); @@ -1711,143 +1710,9 @@ class user extends session } } - // 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); - } - } + $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... @@ -2282,89 +2147,11 @@ class user extends session /** * 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') + function img($img, $alt = '') { - 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; - } + return '<span class="imageset ' . $img . '">' . $alt . '</span>'; } /** @@ -2441,4 +2228,37 @@ class user extends session 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/includes/template.php b/phpBB/includes/template.php deleted file mode 100644 index 5192c334d8..0000000000 --- a/phpBB/includes/template.php +++ /dev/null @@ -1,690 +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); - } -} diff --git a/phpBB/includes/template/compile.php b/phpBB/includes/template/compile.php new file mode 100644 index 0000000000..8d8560ded5 --- /dev/null +++ b/phpBB/includes/template/compile.php @@ -0,0 +1,122 @@ +<?php +/** +* +* @package phpBB3 +* @copyright (c) 2005 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +stream_filter_register('phpbb_template', 'phpbb_template_filter'); + +/** +* Extension of template class - Functions needed for compiling templates only. +* +* @package phpBB3 +* @uses template_filter As a PHP stream filter to perform compilation of templates +*/ +class phpbb_template_compile +{ + /** + * Whether <!-- PHP --> tags are allowed + * + * @var bool + */ + private $allow_php; + + /** + * Constructor. + * + * @param bool @allow_php Whether PHP code will be allowed in templates (inline PHP code, PHP tag and INCLUDEPHP tag) + */ + public function __construct($allow_php) + { + $this->allow_php = $allow_php; + } + + /** + * Compiles template in $source_file and writes compiled template to + * cache directory + * + * @param string $handle Template handle to compile + * @param string $source_file Source template file + * @return bool Return true on success otherwise false + */ + public function compile_file_to_file($source_file, $compiled_file) + { + $source_handle = @fopen($source_file, 'rb'); + $destination_handle = @fopen($compiled_file, 'wb'); + + if (!$source_handle || !$destination_handle) + { + return false; + } + + @flock($destination_handle, LOCK_EX); + + $this->compile_stream_to_stream($source_handle, $destination_handle); + + @fclose($source_handle); + @flock($destination_handle, LOCK_UN); + @fclose($destination_handle); + + phpbb_chmod($compiled_file, CHMOD_READ | CHMOD_WRITE); + + clearstatcache(); + + return true; + } + + /** + * Compiles a template located at $source_file. + * + * Returns PHP source suitable for eval(). + * + * @param string $source_file Source template file + * @return string|bool Return compiled code on successful compilation otherwise false + */ + public function compile_file($source_file) + { + $source_handle = @fopen($source_file, 'rb'); + $destination_handle = @fopen('php://temp' ,'r+b'); + + if (!$source_handle || !$destination_handle) + { + return false; + } + + $this->compile_stream_to_stream($source_handle, $destination_handle); + + @fclose($source_handle); + + rewind($destination_handle); + $contents = stream_get_contents($destination_handle); + @fclose($dest_handle); + + return $contents; + } + + /** + * Compiles contents of $source_stream into $dest_stream. + * + * A stream filter is appended to $source_stream as part of the + * process. + * + * @param resource $source_stream Source stream + * @param resource $dest_stream Destination stream + * @return void + */ + private function compile_stream_to_stream($source_stream, $dest_stream) + { + stream_filter_append($source_stream, 'phpbb_template', null, array('allow_php' => $this->allow_php)); + stream_copy_to_stream($source_stream, $dest_stream); + } +} diff --git a/phpBB/includes/template/context.php b/phpBB/includes/template/context.php new file mode 100644 index 0000000000..f85f86a0ec --- /dev/null +++ b/phpBB/includes/template/context.php @@ -0,0 +1,342 @@ +<?php +/** +* +* @package phpBB3 +* @copyright (c) 2011 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** +* Stores variables assigned to template. +* +* @package phpBB3 +*/ +class phpbb_template_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; + + public function __construct() + { + $this->clear(); + } + + /** + * Clears template data set. + */ + public function clear() + { + $this->tpldata = array('.' => array(0 => array())); + $this->rootref = &$this->tpldata['.'][0]; + } + + /** + * Assign a single variable to a single key + * + * @param string $varname Variable name + * @param string $varval Value to assign to variable + */ + public function assign_var($varname, $varval) + { + $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. + * + * 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; + return $ref; + } + + /** + * 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 + */ + public function assign_block_vars($blockname, array $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 + */ + public function alter_block_array($blockname, array $vararray, $key = false, $mode = 'insert') + { + if (strpos($blockname, '.') !== false) + { + // Nested block. + $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]; + } + + $block = &$block[$blocks[$i]]; // Traverse the last block + } + else + { + // Top-level block. + $block = &$this->tpldata[$blockname]; + } + + // 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($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($block); $i > $key; $i--) + { + $block[$i] = $block[$i-1]; + } + + // Insert vararray at given position + $block[$key] = $vararray; + + return true; + } + + // Which block to change? + if ($mode == 'change') + { + 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 + */ + 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; + } +} diff --git a/phpBB/includes/template/filter.php b/phpBB/includes/template/filter.php new file mode 100644 index 0000000000..115fe21e35 --- /dev/null +++ b/phpBB/includes/template/filter.php @@ -0,0 +1,971 @@ +<?php +/** +* +* @package phpBB3 +* @copyright (c) 2011 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; +} + +/** +* The template filter that does the actual compilation +* +* 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 +* +* @see template_compile +* @package phpBB3 +*/ +class phpbb_template_filter extends php_user_filter +{ + const REGEX_NS = '[a-z_][a-z_0-9]+'; + + const REGEX_VAR = '[A-Z_][A-Z_0-9]+'; + const REGEX_VAR_SUFFIX = '[A-Z_0-9]+'; + + const REGEX_TAG = '<!-- ([A-Z][A-Z_0-9]+)(?: (.*?) ?)?-->'; + + const REGEX_TOKENS = '~<!-- ([A-Z][A-Z_0-9]+)(?: (.*?) ?)?-->|{((?:[a-z_][a-z_0-9]+\.)*\\$?[A-Z][A-Z_0-9]+)}~'; + + /** + * @var array + */ + private $block_names = array(); + + /** + * @var array + */ + private $block_else_level = array(); + + /** + * @var string + */ + private $chunk; + + /** + * @var bool + */ + private $in_php; + + /** + * Whether inline PHP code, <!-- PHP --> and <!-- INCLUDEPHP --> tags + * are allowed. If this is false all PHP code will be silently + * removed from the template during compilation. + * + * @var bool + */ + private $allow_php; + + /** + * Stream filter + * + * Is invoked for evey chunk of the stream, allowing us + * to work on a chunk at a time, which saves memory. + */ + public function filter($in, $out, &$consumed, $closing) + { + $written = false; + $first = false; + + while ($bucket = stream_bucket_make_writeable($in)) + { + $consumed += $bucket->datalen; + + $data = $this->chunk . $bucket->data; + $last_nl = strrpos($data, "\n"); + $this->chunk = substr($data, $last_nl); + $data = substr($data, 0, $last_nl); + + if (!strlen($data)) + { + continue; + } + + $written = true; + + $data = $this->compile($data); + if (!$first) + { + $data = $this->prepend_preamble($data); + $first = false; + } + $bucket->data = $data; + $bucket->datalen = strlen($bucket->data); + stream_bucket_append($out, $bucket); + } + + if ($closing && strlen($this->chunk)) + { + $written = true; + $bucket = stream_bucket_new($this->stream, $this->compile($this->chunk)); + stream_bucket_append($out, $bucket); + } + + return $written ? PSFS_PASS_ON : PSFS_FEED_ME; + } + + /** + * Initializer, called on creation. + * + * Get the allow_php option from params, which is passed + * to stream_filter_append. + */ + public function onCreate() + { + $this->chunk = ''; + $this->in_php = false; + $this->allow_php = $this->params['allow_php']; + return true; + } + + /** + * Compiles a chunk of template. + * + * The chunk must comprise of one or more complete lines from the source + * template. + * + * @param string $data Chunk of source template to compile + * @return string Compiled PHP/HTML code + */ + private function compile($data) + { + $block_start_in_php = $this->in_php; + + $data = preg_replace('#<(?:[\\?%]|script)#s', '<?php echo\'\\0\';?>', $data); + $data = preg_replace_callback(self::REGEX_TOKENS, array($this, 'replace'), $data); + + // Remove php + if (!$this->allow_php) + { + if ($block_start_in_php + && $this->in_php + && strpos($data, '<!-- PHP -->') === false + && strpos($data, '<!-- ENDPHP -->') === false) + { + // This is just php code + return ''; + } + $data = preg_replace('~^.*?<!-- ENDPHP -->~', '', $data); + $data = preg_replace('~<!-- PHP -->.*?<!-- ENDPHP -->~', '', $data); + $data = preg_replace('~<!-- ENDPHP -->.*?$~', '', $data); + } + + /* + Preserve whitespace. + PHP removes a newline after the closing tag (if it's there). This is by design. + + + Consider the following template: + + <!-- IF condition --> + some content + <!-- ENDIF --> + + If we were to simply preserve all whitespace, we could simply replace all "?>" tags + with "?>\n". + Doing that, would add additional newlines to the compiled tempalte in place of the + IF and ENDIF statements. These newlines are unwanted (and one is conditional). + The IF and ENDIF are usually on their own line for ease of reading. + + This replacement preserves newlines only for statements that aren't the only statement on a line. + It will NOT preserve newlines at the end of statements in the above examle. + It will preserve newlines in situations like: + + <!-- IF condition -->inline content<!-- ENDIF --> + + + */ + + $data = preg_replace('~(?<!^)(<\?php(?:(?<!\?>).)+(?<!/\*\*/)\?>)$~m', "$1\n", $data); + $data = str_replace('/**/?>', "?>\n", $data); + $data = str_replace('?><?php', '', $data); + return $data; + } + + /** + * Prepends a preamble to compiled template. + * Currently preamble checks if IN_PHPBB is defined and calls exit() if it is not. + * + * @param string $data Compiled template chunk + * @return string Compiled template chunk with preamble prepended + */ + private function prepend_preamble($data) + { + $data = "<?php if (!defined('IN_PHPBB')) exit;" . ((strncmp($data, '<?php', 5) === 0) ? substr($data, 5) : ' ?>' . $data); + return $data; + } + + /** + * Callback for replacing matched tokens with PHP code + * + * @param array $matches Regular expression matches + * @return string compiled template code + */ + private function replace($matches) + { + if ($this->in_php && $matches[1] != 'ENDPHP') + { + return ''; + } + + if (isset($matches[3])) + { + return $this->compile_var_tags($matches[0]); + } + + switch ($matches[1]) + { + case 'BEGIN': + $this->block_else_level[] = false; + return '<?php ' . $this->compile_tag_block($matches[2]) . ' ?>'; + break; + + case 'BEGINELSE': + $this->block_else_level[sizeof($this->block_else_level) - 1] = true; + return '<?php }} else { ?>'; + break; + + case 'END': + array_pop($this->block_names); + return '<?php ' . ((array_pop($this->block_else_level)) ? '}' : '}}') . ' ?>'; + break; + + case 'IF': + return '<?php ' . $this->compile_tag_if($matches[2], false) . ' ?>'; + break; + + case 'ELSE': + return '<?php } else { ?>'; + break; + + case 'ELSEIF': + return '<?php ' . $this->compile_tag_if($matches[2], true) . ' ?>'; + break; + + case 'ENDIF': + return '<?php } ?>'; + break; + + case 'DEFINE': + return '<?php ' . $this->compile_tag_define($matches[2], true) . ' ?>'; + break; + + case 'UNDEFINE': + return '<?php ' . $this->compile_tag_define($matches[2], false) . ' ?>'; + break; + + case 'INCLUDE': + return '<?php ' . $this->compile_tag_include($matches[2]) . ' ?>'; + break; + + case 'INCLUDEPHP': + return ($this->allow_php) ? '<?php ' . $this->compile_tag_include_php($matches[2]) . ' ?>' : ''; + break; + + case 'PHP': + if ($this->allow_php) + { + $this->in_php = true; + return '<?php '; + } + return '<!-- PHP -->'; + break; + + case 'ENDPHP': + if ($this->allow_php) + { + $this->in_php = false; + return ' ?>'; + } + return '<!-- ENDPHP -->'; + break; + + default: + return $matches[0]; + break; + + } + return ''; + } + + /** + * Convert template variables into PHP varrefs + * + * @param string $text_blocks Variable reference in source template + * @param bool $is_expr Returns whether the source was an expression type variable (i.e. S_FIRST_ROW) + * @return string PHP variable name + */ + private function get_varref($text_blocks, &$is_expr) + { + // change template varrefs into PHP varrefs + $varrefs = array(); + + // This one will handle varrefs WITH namespaces + preg_match_all('#\{((?:' . self::REGEX_NS . '\.)+)(\$)?(' . self::REGEX_VAR . ')\}#', $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, $is_expr, $var_val[2]); + + $text_blocks = str_replace($var_val[0], $new, $text_blocks); + } + + // Language variables cannot be reduced to a single varref, so they must be skipped + // These two replacements would break language variables, so we can only run them on non-language types + if (strpos($text_blocks, '{L_') === false && strpos($text_blocks, '{LA_') === false) + { + // This will handle the remaining root-level varrefs + $text_blocks = preg_replace('#\{(' . self::REGEX_VAR . ')\}#', "\$_rootref['\\1']", $text_blocks); + $text_blocks = preg_replace('#\{\$(' . self::REGEX_VAR . ')\}#', "\$_tpldata['DEFINE']['.']['\\1']", $text_blocks); + } + + return $text_blocks; + } + + /** + * Compile variables + * + * @param string $text_blocks Variable reference in source template + * @return string compiled template code + */ + private function compile_var_tags(&$text_blocks) + { + $text_blocks = $this->get_varref($text_blocks, $is_expr); + $lang_replaced = $this->compile_language_tags($text_blocks); + + if(!$lang_replaced) + { + $text_blocks = '<?php echo ' . ($is_expr ? "$text_blocks" : "(isset($text_blocks)) ? $text_blocks : ''") . '; /**/?>'; + } + + return $text_blocks; + } + + /** + * Handles special language tags L_ and LA_ + * + * @param string $text_blocks Variable reference in source template + * @return bool Whether a replacement occurred or not + */ + private function compile_language_tags(&$text_blocks) + { + $replacements = 0; + + // 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_(' . self::REGEX_VAR_SUFFIX . ')\}#', "<?php echo ((isset(\$_rootref['L_\\1'])) ? \$_rootref['L_\\1'] : ((isset(\$_lang['\\1'])) ? \$_lang['\\1'] : '{ \\1 }')); /**/?>", $text_blocks, -1, $replacements); + return (bool) $replacements; + } + + // 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_(' . self::REGEX_VAR_SUFFIX . '+)\}#', "<?php echo ((isset(\$_rootref['LA_\\1'])) ? \$_rootref['LA_\\1'] : ((isset(\$_rootref['L_\\1'])) ? addslashes(\$_rootref['L_\\1']) : ((isset(\$_lang['\\1'])) ? addslashes(\$_lang['\\1']) : '{ \\1 }'))); /**/?>", $text_blocks, -1, $replacements); + return (bool) $replacements; + } + + return false; + } + + /** + * Compile blocks + * + * @param string $tag_args Block contents in source template + * @return string compiled template code + */ + private function compile_tag_block($tag_args) + { + $no_nesting = false; + + // 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($tag_args, '!') === 0) + { + // Count the number if ! 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 + $match = array(); + + 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 (!isset($match[3]) || 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(\$_tpldata['$tag_args'])) ? sizeof(\$_tpldata['$tag_args']) : 0;"; + $varref = "\$_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 a general expression - much of this is from Smarty with + * some adaptions for our block level methods + * + * @param string $tag_args Expression (tag arguments) in source template + * @return string compiled template code + */ + private function compile_expression($tag_args) + { + $match = array(); + 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: + $varrefs = array(); + if (preg_match('#^((?:' . self::REGEX_NS . '\.)+)?(\$)?(?=[A-Z])([A-Z0-9\-_]+)#s', $token, $varrefs)) + { + if (!empty($varrefs[1])) + { + $namespace = substr($varrefs[1], 0, -1); + $dot_pos = strrchr($namespace, '.'); + if ($dot_pos !== false) + { + $namespace = substr($dot_pos, 1); + } + + // S_ROW_COUNT is deceptive, it returns the current row number not the number of rows + // hence S_ROW_COUNT is deprecated in favour of S_ROW_NUM + switch ($varrefs[3]) + { + case 'S_ROW_NUM': + case 'S_ROW_COUNT': + $token = "\$_${namespace}_i"; + break; + + case 'S_NUM_ROWS': + $token = "\$_${namespace}_count"; + break; + + case 'S_FIRST_ROW': + $token = "(\$_${namespace}_i == 0)"; + break; + + case 'S_LAST_ROW': + $token = "(\$_${namespace}_i == \$_${namespace}_count - 1)"; + break; + + case 'S_BLOCK_NAME': + $token = "'$namespace'"; + break; + + default: + $token = $this->generate_block_data_ref(substr($varrefs[1], 0, -1), true, $varrefs[2]) . '[\'' . $varrefs[3] . '\']'; + $token = '(isset(' . $token . ') ? ' . $token . ' : null)'; + break; + } + } + else + { + $token = ($varrefs[2]) ? '$_tpldata[\'DEFINE\'][\'.\'][\'' . $varrefs[3] . '\']' : '$_rootref[\'' . $varrefs[3] . '\']'; + $token = '(isset(' . $token . ') ? ' . $token . ' : null)'; + } + + } + else if (preg_match('#^\.((?:' . self::REGEX_NS . '\.?)+)$#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 = '$_tpldata'; + + // Add the block reference for the last child. + $varref .= "['" . $blocks[0] . "']"; + } + $token = "(isset($varref) ? sizeof($varref) : 0)"; + } + + break; + } + } + + return $tokens; + } + + /** + * Compile IF tags + * + * @param string $tag_args Expression given with IF in source template + * @param bool $elseif True if compiling an IF tag, false if compiling an ELSEIF tag + * @return string compiled template code + */ + private function compile_tag_if($tag_args, $elseif) + { + $tokens = $this->compile_expression($tag_args); + + $tpl = ($elseif) ? '} else if (' : 'if ('; + + $tpl .= implode(' ', $tokens); + $tpl .= ') { '; + + return $tpl; + } + + /** + * Compile DEFINE tags + * + * @param string $tag_args Expression given with DEFINE in source template + * @param bool $op True if compiling a DEFINE tag, false if compiling an UNDEFINE tag + * @return string compiled template code + */ + private function compile_tag_define($tag_args, $op) + { + $match = array(); + preg_match('#^((?:' . self::REGEX_NS . '\.)+)?\$(?=[A-Z])([A-Z0-9_\-]*)(?: = (.*?))?$#', $tag_args, $match); + + if (empty($match[2]) || (!isset($match[3]) && $op)) + { + return ''; + } + + if (!$op) + { + return 'unset(' . (($match[1]) ? $this->generate_block_data_ref(substr($match[1], 0, -1), true, true) . '[\'' . $match[2] . '\']' : '$_tpldata[\'DEFINE\'][\'.\'][\'' . $match[2] . '\']') . ');'; + } + + $parsed_statement = implode(' ', $this->compile_expression($match[3])); + + return (($match[1]) ? $this->generate_block_data_ref(substr($match[1], 0, -1), true, true) . '[\'' . $match[2] . '\']' : '$_tpldata[\'DEFINE\'][\'.\'][\'' . $match[2] . '\']') . ' = ' . $parsed_statement . ';'; + } + + /** + * Compile INCLUDE tag + * + * @param string $tag_args Expression given with INCLUDE in source template + * @return string compiled template code + */ + private function compile_tag_include($tag_args) + { + // Process dynamic includes + if ($tag_args[0] == '{') + { + $var = $this->get_varref($tag_args, $is_expr); + + // Make sure someone didn't try to include S_FIRST_ROW or similar + if (!$is_expr) + { + return "if (isset($var)) { \$_template->_tpl_include($var); }"; + } + } + + return "\$_template->_tpl_include('$tag_args');"; + } + + /** + * Compile INCLUDE_PHP tag + * + * @param string $tag_args Expression given with INCLUDEPHP in source template + * @return string compiled template code + */ + private function compile_tag_include_php($tag_args) + { + return "\$_template->_php_include('$tag_args');"; + } + + /** + * parse expression + * This is from Smarty + */ + 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 (isset($tokens[$expr_end]) && $tokens[$expr_end] == 'by') + { + $expr_end++; + $expr_arg = $tokens[$expr_end++]; + $expr = "!(($is_arg / $expr_arg) & 1)"; + } + else + { + $expr = "!($is_arg & 1)"; + } + break; + + case 'odd': + if (isset($tokens[$expr_end]) && $tokens[$expr_end] == 'by') + { + $expr_end++; + $expr_arg = $tokens[$expr_end++]; + $expr = "(($is_arg / $expr_arg) & 1)"; + } + else + { + $expr = "($is_arg & 1)"; + } + break; + + case 'div': + if (isset($tokens[$expr_end]) && $tokens[$expr_end] == 'by') + { + $expr_end++; + $expr_arg = $tokens[$expr_end++]; + $expr = "!($is_arg % $expr_arg)"; + } + break; + } + + if ($negate_expr) + { + if ($expr[0] == '!') + { + // Negated expression, de-negate it. + $expr = substr($expr, 1); + } + else + { + $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: + * ' . $_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. + * + * @param string $namespace Namespace to access (expects a trailing "." on the namespace) + * @param string $varname Variable name to use + * @param bool $expr Returns whether the source was an expression type + * @param bool $defop If true this is a variable created with the DEFINE construct, otherwise template variable + * @return string Code to access variable or echo it if $echo is true + */ + private function generate_block_varref($namespace, $varname, &$expr, $defop = false) + { + // Strip the trailing period. + $namespace = substr($namespace, 0, -1); + + if (($pos = strrpos($namespace, '.')) !== false) + { + $local_namespace = substr($namespace, $pos + 1); + } + else + { + $local_namespace = $namespace; + } + + $expr = true; + + // S_ROW_COUNT is deceptive, it returns the current row number now the number of rows + // hence S_ROW_COUNT is deprecated in favour of S_ROW_NUM + switch ($varname) + { + case 'S_ROW_NUM': + case 'S_ROW_COUNT': + $varref = "\$_${local_namespace}_i"; + break; + + case 'S_NUM_ROWS': + $varref = "\$_${local_namespace}_count"; + break; + + case 'S_FIRST_ROW': + $varref = "(\$_${local_namespace}_i == 0)"; + break; + + case 'S_LAST_ROW': + $varref = "(\$_${local_namespace}_i == \$_${local_namespace}_count - 1)"; + break; + + case 'S_BLOCK_NAME': + $varref = "'$local_namespace'"; + break; + + default: + // 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']"; + + $expr = false; + break; + } + // @todo Test the !$expr more + + 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: + * $_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['$childN'] + * + * @param string $blockname Block to access (does not expect a trailing "." on the blockname) + * @param bool $include_last_iterator If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above. + * @param bool $defop If true this is a variable created with the DEFINE construct, otherwise template variable + * @return string Code to access variable + */ + 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 = '$_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]. '\']'; + } + } +} diff --git a/phpBB/includes/template/locator.php b/phpBB/includes/template/locator.php new file mode 100644 index 0000000000..35e33bb9e6 --- /dev/null +++ b/phpBB/includes/template/locator.php @@ -0,0 +1,211 @@ +<?php +/** +* +* @package phpBB3 +* @copyright (c) 2011 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + + +/** +* Template locator. Maintains mapping from template handles to source paths. +* +* Template locator is aware of template inheritance, and can return actual +* filesystem paths (i.e., the "primary" template or the "parent" template) +* depending on what files exist. +* +* @package phpBB3 +*/ +class phpbb_template_locator +{ + /** + * @var string Path to directory that templates are stored in. + */ + private $root = ''; + + /** + * @var string Path to parent/fallback template directory. + */ + private $inherit_root = ''; + + /** + * @var array Map from handles to source template file paths. + * Normally it only contains paths for handles that are used + * (or are likely to be used) by the page being rendered and not + * all templates that exist on the filesystem. + */ + private $files = array(); + + /** + * @var array Map from handles to source template file names. + * Covers the same data as $files property but maps to basenames + * instead of paths. + */ + private $filenames = array(); + + /** + * @var array Map from handles to parent/fallback source template + * file paths. Covers the same data as $files. + */ + private $files_inherit = array(); + + /** + * Set custom template location (able to use directory outside of phpBB). + * + * Note: Templates are still compiled to phpBB's cache directory. + * + * @param string $template_path Path to template directory + * @param string|bool $fallback_template_path Path to fallback template, or false to disable fallback + */ + public function set_custom_template($template_path, $fallback_template_path = false) + { + // Make sure $template_path has no ending slash + if (substr($template_path, -1) == '/') + { + $template_path = substr($template_path, 0, -1); + } + + $this->root = $template_path; + + 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; + } + } + + /** + * Sets the template filenames for handles. $filename_array + * should be a hash of handle => filename pairs. + * + * @param array $filname_array Should be a hash of handle => filename pairs. + */ + public function set_filenames(array $filename_array) + { + foreach ($filename_array as $handle => $filename) + { + if (empty($filename)) + { + trigger_error("template locator: 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; + } + } + } + + /** + * Determines the filename for a template handle. + * + * The filename comes from array used in a set_filenames call, + * which should have been performed prior to invoking this function. + * Return value is a file basename (without path). + * + * @param $handle string Template handle + * @return string Filename corresponding to the template handle + */ + public function get_filename_for_handle($handle) + { + if (!isset($this->filename[$handle])) + { + trigger_error("template locator: get_filename_for_handle: No file specified for handle $handle", E_USER_ERROR); + } + return $this->filename[$handle]; + } + + /** + * Determines the source file path for a template handle without + * regard for template inheritance. + * + * This function returns the path in "primary" template directory + * corresponding to the given template handle. That path may or + * may not actually exist on the filesystem. Because this function + * does not perform stat calls to determine whether the path it + * returns actually exists, it is faster than get_source_file_for_handle. + * + * Use get_source_file_for_handle to obtain the actual path that is + * guaranteed to exist (which might come from the parent/fallback + * template directory if template inheritance is used). + * + * This function will trigger an error if the handle was never + * associated with a template file via set_filenames. + * + * @param $handle string Template handle + * @return string Path to source file path in primary template directory + */ + public function get_virtual_source_file_for_handle($handle) + { + // If we don't have a file assigned to this handle, die. + if (!isset($this->files[$handle])) + { + trigger_error("template locator: No file specified for handle $handle", E_USER_ERROR); + } + + $source_file = $this->files[$handle]; + return $source_file; + } + + /** + * Determines the source file path for a template handle, accounting + * for template inheritance and verifying that the path exists. + * + * This function returns the actual path that may be compiled for + * the specified template handle. It will trigger an error if + * the template handle was never associated with a template path + * via set_filenames or if the template file does not exist on the + * filesystem. + * + * Use get_virtual_source_file_for_handle to just resolve a template + * handle to a path without any filesystem or inheritance checks. + * + * @param string $handle Template handle (i.e. "friendly" template name) + * @return string Source file path + */ + public function get_source_file_for_handle($handle) + { + // If we don't have a file assigned to this handle, die. + if (!isset($this->files[$handle])) + { + trigger_error("template locator: No file specified for handle $handle", E_USER_ERROR); + } + + $source_file = $this->files[$handle]; + + // Try and open template for reading + if (!file_exists($source_file)) + { + if (isset($this->files_inherit[$handle]) && $this->files_inherit[$handle]) + { + $parent_source_file = $this->files_inherit[$handle]; + if (!file_exists($parent_source_file)) + { + trigger_error("template locator: Neither $source_file nor $parent_source_file exist", E_USER_ERROR); + } + $source_file = $parent_source_file; + } + else + { + trigger_error("template locator: File $source_file does not exist", E_USER_ERROR); + } + } + return $source_file; + } +} diff --git a/phpBB/includes/template/renderer.php b/phpBB/includes/template/renderer.php new file mode 100644 index 0000000000..59c85df443 --- /dev/null +++ b/phpBB/includes/template/renderer.php @@ -0,0 +1,35 @@ +<?php +/** +* +* @package phpBB3 +* @copyright (c) 2011 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** +* Template renderer interface. +* +* Objects implementing this interface encapsulate a means of displaying +* a template. +* +* @package phpBB3 +*/ +interface phpbb_template_renderer +{ + /** + * Displays the template managed by this renderer. + * + * @param phpbb_template_context $context Template context to use + * @param array $lang Language entries to use + */ + public function render($context, $lang); +} diff --git a/phpBB/includes/template/renderer_eval.php b/phpBB/includes/template/renderer_eval.php new file mode 100644 index 0000000000..2c05a1c1df --- /dev/null +++ b/phpBB/includes/template/renderer_eval.php @@ -0,0 +1,60 @@ +<?php +/** +* +* @package phpBB3 +* @copyright (c) 2011 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** +* Template renderer that stores compiled template's php code and +* displays it via eval. +* +* @package phpBB3 +*/ +class phpbb_template_renderer_eval implements phpbb_template_renderer +{ + /** + * Template code to be eval'ed. + */ + private $code; + + /** + * Constructor. Stores provided code for future evaluation. + * Template includes are delegated to template object $template. + * + * @param string $code php code of the template + * @param phpbb_template $template template object + */ + public function __construct($code, $template) + { + $this->code = $code; + $this->template = $template; + } + + /** + * Displays the template managed by this renderer by eval'ing php code + * of the template. + * + * @param phpbb_template_context $context Template context to use + * @param array $lang Language entries to use + */ + public function render($context, $lang) + { + $_template = $this->template; + $_tpldata = &$context->get_data_ref(); + $_rootref = &$context->get_root_ref(); + $_lang = $lang; + + eval(' ?>' . $this->code . '<?php '); + } +} diff --git a/phpBB/includes/template/renderer_include.php b/phpBB/includes/template/renderer_include.php new file mode 100644 index 0000000000..40e7a3376c --- /dev/null +++ b/phpBB/includes/template/renderer_include.php @@ -0,0 +1,60 @@ +<?php +/** +* +* @package phpBB3 +* @copyright (c) 2011 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + + +/** +* Template renderer that stores path to php file with template code +* and displays it by including the file. +* +* @package phpBB3 +*/ +class phpbb_template_renderer_include implements phpbb_template_renderer +{ + /** + * Template path to be included. + */ + private $path; + + /** + * Constructor. Stores path to the template for future inclusion. + * Template includes are delegated to template object $template. + * + * @param string $path path to the template + */ + public function __construct($path, $template) + { + $this->path = $path; + $this->template = $template; + } + + /** + * Displays the template managed by this renderer by including + * the php file containing the template. + * + * @param phpbb_template_context $context Template context to use + * @param array $lang Language entries to use + */ + public function render($context, $lang) + { + $_template = $this->template; + $_tpldata = &$context->get_data_ref(); + $_rootref = &$context->get_root_ref(); + $_lang = $lang; + + include($this->path); + } +} diff --git a/phpBB/includes/template/template.php b/phpBB/includes/template/template.php new file mode 100644 index 0000000000..ec5fbe2829 --- /dev/null +++ b/phpBB/includes/template/template.php @@ -0,0 +1,486 @@ +<?php +/** +* +* @package phpBB3 +* @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; +} + +/** +* @todo +* IMG_ for image substitution? +* {IMG_[key]:[alt]:[type]} +* {IMG_ICON_CONTACT:CONTACT:full} -> $user->img('icon_contact', 'CONTACT', 'full'); +* +* More in-depth... +* yadayada +*/ + +/** +* Base Template class. +* @package phpBB3 +*/ +class phpbb_template +{ + /** + * @var phpbb_template_context Template context. + * Stores template data used during template rendering. + */ + private $context; + + /** + * @var string Path of the cache directory for the template + */ + public $cachepath = ''; + + /** + * @var string phpBB root path + */ + private $phpbb_root_path; + + /** + * @var phpEx PHP file extension + */ + private $phpEx; + + /** + * @var phpbb_config phpBB config instance + */ + private $config; + + /** + * @var user current user + */ + private $user; + + /** + * @var locator template locator + */ + private $locator; + + /** + * Constructor. + * + * @param string $phpbb_root_path phpBB root path + * @param user $user current user + * @param phpbb_template_locator $locator template locator + */ + public function __construct($phpbb_root_path, $phpEx, $config, $user, phpbb_template_locator $locator) + { + $this->phpbb_root_path = $phpbb_root_path; + $this->phpEx = $phpEx; + $this->config = $config; + $this->user = $user; + $this->locator = $locator; + } + + /** + * Set template location based on (current) user's chosen style. + */ + public function set_template() + { + $style_name = $this->user->theme['template_path']; + + $relative_template_root = $this->relative_template_root_for_style($style_name); + $template_root = $this->phpbb_root_path . $relative_template_root; + if (!file_exists($template_root)) + { + trigger_error('template locator: Template path could not be found: ' . $relative_template_root, E_USER_ERROR); + } + + if ($this->user->theme['template_inherits_id']) + { + $fallback_template_path = $this->phpbb_root_path . $this->relative_template_root_for_style($this->user->theme['template_inherit_path']); + } + else + { + $fallback_template_path = null; + } + + return $this->set_custom_template($template_root, $style_name, $fallback_template_path); + } + + /** + * Set custom template location (able to use directory outside of phpBB). + * + * Note: Templates are still compiled to phpBB's cache directory. + * + * @param string $template_path Path to template directory + * @param string $template_name Name of template + * @param string $fallback_template_path Path to fallback template + */ + public function set_custom_template($template_path, $style_name, $fallback_template_path = false) + { + $this->locator->set_custom_template($template_path, $fallback_template_path); + + $this->cachepath = $this->phpbb_root_path . 'cache/tpl_' . str_replace('_', '-', $style_name) . '_'; + + $this->context = new phpbb_template_context(); + + return true; + } + + /** + * Converts a style name to relative (to board root) path to + * the style's template files. + * + * @param $style_name string Style name + * @return string Path to style template files + */ + private function relative_template_root_for_style($style_name) + { + return 'styles/' . $style_name . '/template'; + } + + /** + * Sets the template filenames for handles. + * + * @param array $filname_array Should be a hash of handle => filename pairs. + */ + public function set_filenames(array $filename_array) + { + $this->locator->set_filenames($filename_array); + + return true; + } + + /** + * Clears all variables and blocks assigned to this template. + */ + public function destroy() + { + $this->context->clear(); + } + + /** + * Reset/empty complete block + * + * @param string $blockname Name of block to destroy + */ + public function destroy_block_vars($blockname) + { + $this->context->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 bool True on success, false on failure + */ + public function display($handle) + { + $result = $this->call_hook($handle); + if ($result !== false) + { + return $result[0]; + } + + return $this->load_and_render($handle); + } + + /** + * Loads a template for $handle, compiling it if necessary, and + * renders the template. + * + * @param string $handle Template handle to render + * @return bool True on success, false on failure + */ + private function load_and_render($handle) + { + $renderer = $this->_tpl_load($handle); + + if ($renderer) + { + $renderer->render($this->context, $this->get_lang()); + return true; + } + else + { + return false; + } + } + + /** + * Calls hook if any is defined. + * + * @param string $handle Template handle being displayed. + */ + private function call_hook($handle) + { + global $phpbb_hook; + + if (!empty($phpbb_hook) && $phpbb_hook->call_hook(array(__CLASS__, __FUNCTION__), $handle, $this)) + { + if ($phpbb_hook->hook_return(array(__CLASS__, __FUNCTION__))) + { + $result = $phpbb_hook->hook_return_result(array(__CLASS__, __FUNCTION__)); + return array($result); + } + } + + return false; + } + + /** + * Obtains language array. + * This is either lang property of $user property, or if + * it is not set an empty array. + * @return array language entries + */ + public function get_lang() + { + if (isset($this->user->lang)) + { + $lang = $this->user->lang; + } + else + { + $lang = array(); + } + return $lang; + } + + /** + * 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 bool|string false on failure, otherwise if $return_content is true return string of the compiled handle, otherwise return true + */ + public function assign_display($handle, $template_var = '', $return_content = true) + { + ob_start(); + $result = $this->display($handle); + $contents = ob_get_clean(); + if ($result === false) + { + return false; + } + + if ($return_content) + { + return $contents; + } + + $this->assign_var($template_var, $contents); + + return true; + } + + /** + * Obtains a template renderer for a template identified by specified + * handle. The template renderer can display the template later. + * + * Template source will first be compiled into php code. + * If template cache is writable the compiled php code will be stored + * on filesystem and template will not be subsequently recompiled. + * If template cache is not writable template source will be recompiled + * every time it is needed. DEBUG_EXTRA define and load_tplcompile + * configuration setting may be used to force templates to be always + * recompiled. + * + * Returns an object implementing phpbb_template_renderer, or null + * if template loading or compilation failed. Call render() on the + * renderer to display the template. This will result in template + * contents sent to the output stream (unless, of course, output + * buffering is in effect). + * + * @param string $handle Handle of the template to load + * @return phpbb_template_renderer Template renderer object, or null on failure + * @uses template_compile is used to compile template source + */ + private function _tpl_load($handle) + { + $output_file = $this->_compiled_file_for_handle($handle); + + $recompile = defined('DEBUG_EXTRA') || + !file_exists($output_file) || + @filesize($output_file) === 0; + + if ($recompile || $this->config['load_tplcompile']) + { + // Set only if a recompile or an mtime check are required. + $source_file = $this->locator->get_source_file_for_handle($handle); + + if (!$recompile && @filemtime($output_file) < @filemtime($source_file)) + { + $recompile = true; + } + } + + // Recompile page if the original template is newer, otherwise load the compiled version + if (!$recompile) + { + return new phpbb_template_renderer_include($output_file, $this); + } + + $compile = new phpbb_template_compile($this->config['tpl_allow_php']); + + if ($compile->compile_file_to_file($source_file, $output_file) !== false) + { + $renderer = new phpbb_template_renderer_include($output_file, $this); + } + else if (($code = $compile->compile_file($source_file)) !== false) + { + $renderer = new phpbb_template_renderer_eval($code, $this); + } + else + { + $renderer = null; + } + + return $renderer; + } + + /** + * Determines compiled file path for handle $handle. + * + * @param string $handle Template handle (i.e. "friendly" template name) + * @return string Compiled file path + */ + private function _compiled_file_for_handle($handle) + { + $source_file = $this->locator->get_filename_for_handle($handle); + $compiled_file = $this->cachepath . str_replace('/', '.', $source_file) . '.' . $this->phpEx; + return $compiled_file; + } + + /** + * Assign key variable pairs from an array + * + * @param array $vararray A hash of variable name => value pairs + */ + public function assign_vars(array $vararray) + { + foreach ($vararray as $key => $val) + { + $this->assign_var($key, $val); + } + } + + /** + * Assign a single variable to a single key + * + * @param string $varname Variable name + * @param string $varval Value to assign to variable + */ + public function assign_var($varname, $varval) + { + $this->context->assign_var($varname, $varval); + } + + // Docstring is copied from phpbb_template_context method with the same name. + /** + * 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 + */ + public function assign_block_vars($blockname, array $vararray) + { + return $this->context->assign_block_vars($blockname, $vararray); + } + + // Docstring is copied from phpbb_template_context method with the same name. + /** + * 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') + { + return $this->context->alter_block_array($blockname, $vararray, $key, $mode); + } + + /** + * Include a separate template. + * + * This function is marked public due to the way the template + * implementation uses it. It is actually an implementation function + * and should not be considered part of template class's public API. + * + * @param string $filename Template filename to include + * @param bool $include True to include the file, false to just load it + * @uses template_compile is used to compile uncached templates + */ + public function _tpl_include($filename, $include = true) + { + $this->locator->set_filenames(array($filename => $filename)); + + if (!$this->load_and_render($filename)) + { + // trigger_error cannot be used here, as the output already started + echo 'template->_tpl_include(): Failed including ' . htmlspecialchars($handle) . "\n"; + } + } + + /** + * Include a PHP file. + * + * If a relative path is passed in $filename, it is considered to be + * relative to board root ($phpbb_root_path). Absolute paths are + * also allowed. + * + * This function is marked public due to the way the template + * implementation uses it. It is actually an implementation function + * and should not be considered part of template class's public API. + * + * @param string $filename Path to PHP file to include + */ + public function _php_include($filename) + { + if (phpbb_is_absolute($filename)) + { + $file = $filename; + } + else + { + $file = $this->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\n"; + return; + } + include($file); + } +} diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index f4fdb50ecd..738da62158 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -161,7 +161,6 @@ class ucp_main '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, @@ -348,7 +347,6 @@ class ucp_main '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'], @@ -825,7 +823,6 @@ class ucp_main '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'] : '', diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php index 1758bb5eb1..c74574f361 100644 --- a/phpBB/includes/ucp/ucp_pm_viewfolder.php +++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php @@ -166,7 +166,6 @@ function view_folder($id, $mode, $folder_id, $folder) '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_STYLE' => $folder_img, - 'FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'), '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']) : '', diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index 8b288f5de1..c9451bd202 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -239,7 +239,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) '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&mode=compose&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_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&action=aim&u=' . $author_id) : '', 'U_YIM' => ($user_info['user_yim']) ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($user_info['user_yim']) . '&.src=pg' : '', 'U_MSN' => ($user_info['user_msnm'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&action=msnm&u=' . $author_id) : '', diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 71374a9381..3781fc6b1c 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -156,13 +156,12 @@ class ucp_register $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_captcha_factory::get_instance($config['captcha_plugin']); $captcha->init(CONFIRM_REG); } diff --git a/phpBB/index.php b/phpBB/index.php index 419b66cfdb..182efbc7e0 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -82,15 +82,23 @@ $legend = implode(', ', $legend); // Generate birthday list if required ... $birthday_list = array(); -if ($config['load_birthdays'] && $config['allow_birthdays']) +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); + + // 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')) + { + $leap_year_birthdays = " OR 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) - AND u.user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%' + 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 . ')'; $result = $db->sql_query($sql); @@ -98,7 +106,7 @@ if ($config['load_birthdays'] && $config['allow_birthdays']) { $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) ? $now['year'] - $birthday_year : ''; + $birthday_age = ($birthday_year) ? max(0, $now['year'] - $birthday_year) : ''; $template->assign_block_vars('birthdays', array( 'USERNAME' => $birthday_username, @@ -106,7 +114,10 @@ if ($config['load_birthdays'] && $config['allow_birthdays']) )); // For 3.0 compatibility - $birthday_list[] = $birthday_username . (($birthday_year) ? ' (' . $birthday_age . ')' : ''); + if ($age = (int) substr($row['user_birthday'], -4)) + { + $birthday_list[] = $birthday_username . (($birthday_year) ? ' (' . $birthday_age . ')' : ''); + } } $db->sql_freeresult($result); } diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 79aa57aea0..4507e5c371 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -84,7 +84,6 @@ if (!empty($load_extensions) && function_exists('dl')) // Include files require($phpbb_root_path . 'includes/class_loader.' . $phpEx); -require($phpbb_root_path . 'includes/template.' . $phpEx); require($phpbb_root_path . 'includes/session.' . $phpEx); require($phpbb_root_path . 'includes/auth.' . $phpEx); @@ -144,9 +143,9 @@ $db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, false); unset($dbpasswd); $user->ip = ''; -if (!empty($_SERVER['REMOTE_ADDR'])) +if ($request->server('REMOTE_ADDR')) { - $user->ip = (function_exists('phpbb_ip_normalise')) ? phpbb_ip_normalise($_SERVER['REMOTE_ADDR']) : htmlspecialchars($_SERVER['REMOTE_ADDR']); + $user->ip = (function_exists('phpbb_ip_normalise')) ? phpbb_ip_normalise($request->server('REMOTE_ADDR')) : $request->server('REMOTE_ADDR'); } $sql = "SELECT config_value @@ -1062,6 +1061,24 @@ function database_update_info() 'group_legend' => array('UINT', 0), ), ), + 'drop_columns' => array( + STYLES_TABLE => array( + 'imageset_id', + ), + STYLES_TEMPLATE_TABLE => array( + 'template_storedb', + ), + STYLES_THEME_TABLE => array( + 'theme_storedb', + 'theme_mtime', + 'theme_data', + ), + ), + 'drop_tables' => array( + STYLES_IMAGESET_TABLE, + STYLES_IMAGESET_DATA_TABLE, + STYLES_TEMPLATE_DATA_TABLE, + ), ), ); } @@ -2073,42 +2090,68 @@ function change_database_data(&$no_updates, $version) // Changes from 3.1.0-dev to 3.1.0-A1 case '3.1.0-dev': - set_config('use_system_cron', 0); - - $sql = 'UPDATE ' . GROUPS_TABLE . ' - SET group_teampage = 1 - WHERE group_type = ' . GROUP_SPECIAL . " - AND group_name = 'ADMINISTRATORS'"; - _sql($sql, $errored, $error_ary); - - $sql = 'UPDATE ' . GROUPS_TABLE . ' - SET group_teampage = 2 - WHERE group_type = ' . GROUP_SPECIAL . " - AND group_name = 'GLOBAL_MODERATORS'"; - _sql($sql, $errored, $error_ary); - - set_config('legend_sort_groupname', '0'); - set_config('teampage_multiple', '1'); - set_config('teampage_forums', '1'); + if (!isset($config['use_system_cron'])) + { + set_config('use_system_cron', 0); + } - $sql = 'SELECT group_id + $sql = 'SELECT group_teampage FROM ' . GROUPS_TABLE . ' - WHERE group_legend = 1 - ORDER BY group_name ASC'; - $result = $db->sql_query($sql); + WHERE group_teampage > 0'; + $result = $db->sql_query_limit($sql, 1); + $added_groups_teampage = (bool) $db->sql_fetchfield('group_teampage'); + $db->sql_freeresult($result); - $next_legend = 1; - while ($row = $db->sql_fetchrow($result)) + if (!$added_groups_teampage) { $sql = 'UPDATE ' . GROUPS_TABLE . ' - SET group_legend = ' . $next_legend . ' - WHERE group_id = ' . (int) $row['group_id']; + SET group_teampage = 1 + WHERE group_type = ' . GROUP_SPECIAL . " + AND group_name = 'ADMINISTRATORS'"; _sql($sql, $errored, $error_ary); - $next_legend++; + $sql = 'UPDATE ' . GROUPS_TABLE . ' + SET group_teampage = 2 + WHERE group_type = ' . GROUP_SPECIAL . " + AND group_name = 'GLOBAL_MODERATORS'"; + _sql($sql, $errored, $error_ary); + } + + if (!isset($config['use_system_cron'])) + { + set_config('legend_sort_groupname', '0'); + set_config('teampage_multiple', '1'); + set_config('teampage_forums', '1'); } + + $sql = 'SELECT group_legend + FROM ' . GROUPS_TABLE . ' + WHERE group_teampage > 1'; + $result = $db->sql_query_limit($sql, 1); + $updated_group_legend = (bool) $db->sql_fetchfield('group_teampage'); $db->sql_freeresult($result); - unset($next_legend); + + if (!$updated_group_legend) + { + $sql = 'SELECT group_id + FROM ' . GROUPS_TABLE . ' + WHERE group_legend = 1 + ORDER BY group_name ASC'; + $result = $db->sql_query($sql); + + $next_legend = 1; + while ($row = $db->sql_fetchrow($result)) + { + $sql = 'UPDATE ' . GROUPS_TABLE . ' + SET group_legend = ' . $next_legend . ' + WHERE group_id = ' . (int) $row['group_id']; + _sql($sql, $errored, $error_ary); + + $next_legend++; + } + $db->sql_freeresult($result); + unset($next_legend); + } // Install modules $modules_to_install = array( @@ -2129,6 +2172,10 @@ function change_database_data(&$no_updates, $version) ); _add_modules($modules_to_install); + + $sql = 'DELETE FROM ' . MODULES_TABLE . " + WHERE module_basename = 'styles' AND module_mode = 'imageset'"; + _sql($sql, $errored, $error_ary); // 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 @@ -2208,7 +2255,10 @@ function change_database_data(&$no_updates, $version) } // Allow custom profile fields in pm templates - set_config('load_cpf_pm', '0'); + if (!isset($config['load_cpf_pm'])) + { + set_config('load_cpf_pm', '0'); + } $no_updates = false; break; diff --git a/phpBB/install/index.php b/phpBB/install/index.php index f4815c3108..a4ff93e701 100644 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -78,7 +78,6 @@ 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/functions_admin.' . $phpEx); include($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); require($phpbb_root_path . 'includes/functions_install.' . $phpEx); @@ -99,9 +98,9 @@ request_var('', 0, false, false, $request); // "dependency injection" for a func // Try and load an appropriate language if required $language = basename(request_var('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 @@ -178,7 +177,6 @@ set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handle $user = new user(); $auth = new auth(); -$template = new template(); // Add own hook handler, if present. :o if (file_exists($phpbb_root_path . 'includes/hooks/index.' . $phpEx)) @@ -201,12 +199,12 @@ $config = new phpbb_config(array( 'load_tplcompile' => '1' )); +$template_locator = new phpbb_template_locator(); +$template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $template_locator); $template->set_custom_template('../adm/style', 'admin'); +$template->assign_var('T_ASSETS_PATH', '../assets'); $template->assign_var('T_TEMPLATE_PATH', '../adm/style'); -// the acp template is never stored in the database -$user->theme['template_storedb'] = false; - $install = new module(); $install->create('install', "index.$phpEx", $mode, $sub); @@ -427,15 +425,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) diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index e36fc1c618..f8c54678bf 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -903,7 +903,6 @@ class install_install extends module $config_data .= "\n@define('PHPBB_INSTALLED', true);\n"; $config_data .= "// @define('DEBUG', true);\n"; $config_data .= "// @define('DEBUG_EXTRA', true);\n"; - $config_data .= '?' . '>'; // Done this to prevent highlighting editors getting confused! // 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)) @@ -999,7 +998,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']; @@ -1017,7 +1016,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) @@ -1027,16 +1026,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) @@ -1101,7 +1100,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 = ''; @@ -1117,8 +1116,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) @@ -1235,7 +1234,7 @@ class install_install extends module $current_time = time(); - $user_ip = (!empty($_SERVER['REMOTE_ADDR'])) ? phpbb_ip_normalise($_SERVER['REMOTE_ADDR']) : ''; + $user_ip = $request->server('REMOTE_ADDR') ? phpbb_ip_normalise($request->server('REMOTE_ADDR')) : ''; if ($data['script_path'] !== '/') { @@ -1742,72 +1741,6 @@ class install_install extends module $error = $db->sql_error($db->sql_error_sql); $this->p_master->db_error($error['message'], $db->sql_error_sql, __LINE__, __FILE__); } - - $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); - - 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__); - } - } } } closedir($dir); diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index 5c3a38d237..926b7cad46 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -134,9 +134,6 @@ 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; - $template->assign_vars(array( 'S_USER_LANG' => $user->lang['USER_LANG'], 'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'], diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index b19ece2b7c..67e5547bb6 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -1077,8 +1077,7 @@ CREATE TABLE phpbb_styles ( 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 + theme_id INTEGER DEFAULT 0 NOT NULL );; ALTER TABLE phpbb_styles ADD PRIMARY KEY (style_id);; @@ -1086,7 +1085,6 @@ 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;; @@ -1106,7 +1104,6 @@ CREATE TABLE phpbb_styles_template ( 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 );; @@ -1126,27 +1123,12 @@ BEGIN 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 + theme_path VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL );; ALTER TABLE phpbb_styles_theme ADD PRIMARY KEY (theme_id);; @@ -1164,55 +1146,6 @@ BEGIN 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, diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index f823667252..fe69670ded 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -1307,8 +1307,7 @@ CREATE TABLE [phpbb_styles] ( [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 + [theme_id] [int] DEFAULT (0) NOT NULL ) ON [PRIMARY] GO @@ -1328,9 +1327,6 @@ GO CREATE INDEX [theme_id] ON [phpbb_styles]([theme_id]) ON [PRIMARY] GO -CREATE INDEX [imageset_id] ON [phpbb_styles]([imageset_id]) ON [PRIMARY] -GO - /* Table: 'phpbb_styles_template' @@ -1341,7 +1337,6 @@ CREATE TABLE [phpbb_styles_template] ( [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 ) ON [PRIMARY] @@ -1359,36 +1354,14 @@ 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 -) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] -GO - -CREATE INDEX [tid] ON [phpbb_styles_template_data]([template_id]) ON [PRIMARY] -GO - -CREATE INDEX [tfn] ON [phpbb_styles_template_data]([template_filename]) ON [PRIMARY] -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 -) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] + [theme_path] [varchar] (100) DEFAULT ('') NOT NULL +) ON [PRIMARY] GO ALTER TABLE [phpbb_styles_theme] WITH NOCHECK ADD @@ -1403,53 +1376,6 @@ 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 -) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_styles_imageset] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_styles_imageset] PRIMARY KEY CLUSTERED - ( - [imageset_id] - ) ON [PRIMARY] -GO - -CREATE UNIQUE INDEX [imgset_nm] ON [phpbb_styles_imageset]([imageset_name]) ON [PRIMARY] -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 -) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_styles_imageset_data] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_styles_imageset_data] PRIMARY KEY CLUSTERED - ( - [image_id] - ) ON [PRIMARY] -GO - -CREATE INDEX [i_d] ON [phpbb_styles_imageset_data]([imageset_id]) ON [PRIMARY] -GO - - -/* Table: 'phpbb_topics' */ CREATE TABLE [phpbb_topics] ( diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql index 8b603f9572..da6ce35be3 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -752,12 +752,10 @@ CREATE TABLE phpbb_styles ( 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) + KEY theme_id (theme_id) ); @@ -768,7 +766,6 @@ CREATE TABLE phpbb_styles_template ( 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), @@ -776,57 +773,17 @@ CREATE TABLE phpbb_styles_template ( ); -# 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, diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index f418e1d2a5..cdbe377178 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -752,12 +752,10 @@ CREATE TABLE phpbb_styles ( 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) + KEY theme_id (theme_id) ) CHARACTER SET `utf8` COLLATE `utf8_bin`; @@ -768,7 +766,6 @@ CREATE TABLE phpbb_styles_template ( 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), @@ -776,57 +773,17 @@ CREATE TABLE phpbb_styles_template ( ) 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, diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index fcd7f9e5d0..8797457e87 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -1432,7 +1432,6 @@ CREATE TABLE phpbb_styles ( 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) ) @@ -1442,8 +1441,6 @@ 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 / @@ -1470,7 +1467,6 @@ CREATE TABLE phpbb_styles_template ( 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), @@ -1496,23 +1492,6 @@ 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 ( @@ -1520,9 +1499,6 @@ CREATE TABLE phpbb_styles_theme ( 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) ) @@ -1546,70 +1522,6 @@ 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 ( diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index 1aa47b4d61..3c79aacd6b 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -983,14 +983,12 @@ CREATE TABLE phpbb_styles ( 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' @@ -1003,7 +1001,6 @@ CREATE TABLE phpbb_styles_template ( 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) @@ -1012,20 +1009,6 @@ CREATE TABLE phpbb_styles_template ( 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; @@ -1035,48 +1018,12 @@ CREATE TABLE phpbb_styles_theme ( 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; diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index db66916b98..5506922e17 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -434,86 +434,13 @@ 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', '© phpBB Group', 1, 1, 1, 1); - -# -- phpbb_styles_imageset -INSERT INTO phpbb_styles_imageset (imageset_name, imageset_copyright, imageset_path) VALUES ('prosilver', '© 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); +INSERT INTO phpbb_styles (style_name, style_copyright, style_active, template_id, theme_id) VALUES ('prosilver', '© phpBB Group', 1, 1, 1); # -- phpbb_styles_template -INSERT INTO phpbb_styles_template (template_name, template_copyright, template_path, bbcode_bitfield, template_storedb) VALUES ('prosilver', '© phpBB Group', 'prosilver', 'lNg=', 0); +INSERT INTO phpbb_styles_template (template_name, template_copyright, template_path, bbcode_bitfield) VALUES ('prosilver', '© phpBB Group', 'prosilver', 'lNg='); # -- phpbb_styles_theme -INSERT INTO phpbb_styles_theme (theme_name, theme_copyright, theme_path, theme_storedb, theme_data) VALUES ('prosilver', '© phpBB Group', 'prosilver', 1, ''); +INSERT INTO phpbb_styles_theme (theme_name, theme_copyright, theme_path) VALUES ('prosilver', '© phpBB Group', 'prosilver'); # -- 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, ''); diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index 382e835767..e0631160fd 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -727,14 +727,12 @@ CREATE TABLE phpbb_styles ( 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' + theme_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 ( @@ -743,61 +741,22 @@ CREATE TABLE phpbb_styles_template ( 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 '' + theme_path varchar(100) 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 , diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index 2a8ed86175..0bc27b780d 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -104,7 +104,6 @@ $lang = array_merge($lang, array( 'ACP_ICONS' => 'Topic icons', 'ACP_ICONS_SMILIES' => 'Topic icons/smilies', - 'ACP_IMAGESETS' => 'Imagesets', 'ACP_INACTIVE_USERS' => 'Inactive users', 'ACP_INDEX' => 'ACP index', @@ -593,16 +592,6 @@ $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', @@ -686,22 +675,28 @@ $lang = array_merge($lang, array( '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>', diff --git a/phpBB/language/en/acp/forums.php b/phpBB/language/en/acp/forums.php index 80e958afa5..bb5b361086 100644 --- a/phpBB/language/en/acp/forums.php +++ b/phpBB/language/en/acp/forums.php @@ -72,7 +72,7 @@ $lang = array_merge($lang, array( 'ENABLE_TOPIC_ICONS' => 'Enable topic icons', 'FORUM_ADMIN' => 'Forum administration', - 'FORUM_ADMIN_EXPLAIN' => 'In phpBB3 there are no categories, everything is forum based. Each forum can have an unlimited number of sub-forums and you can determine whether each may be posted to or not (i.e. whether it acts like an old category). Here you can add, edit, delete, lock, unlock individual forums as well as set certain additional controls. If your posts and topics have got out of sync you can also resynchronise a forum. <strong>You need to copy or set appropriate permissions for newly created forums to have them displayed.</strong>', + 'FORUM_ADMIN_EXPLAIN' => 'In phpBB3 everything is forum based. A category is just a special type of forum. Each forum can have an unlimited number of sub-forums and you can determine whether each may be posted to or not (i.e. whether it acts like an old category). Here you can add, edit, delete, lock, unlock individual forums as well as set certain additional controls. If your posts and topics have got out of sync you can also resynchronise a forum. <strong>You need to copy or set appropriate permissions for newly created forums to have them displayed.</strong>', 'FORUM_AUTO_PRUNE' => 'Enable auto-pruning', 'FORUM_AUTO_PRUNE_EXPLAIN' => 'Prunes the forum of topics, set the frequency/age parameters below.', 'FORUM_CREATED' => 'Forum created successfully.', diff --git a/phpBB/language/en/acp/styles.php b/phpBB/language/en/acp/styles.php index 2037a2455d..16b499e7f0 100644 --- a/phpBB/language/en/acp/styles.php +++ b/phpBB/language/en/acp/styles.php @@ -36,12 +36,9 @@ 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_STYLES_EXPLAIN' => 'Here you can manage the available styles on your board. A style consists of a template and theme. 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', @@ -62,12 +59,8 @@ $lang = array_merge($lang, array( '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.', 'COPYRIGHT' => 'Copyright', - 'CREATE_IMAGESET' => 'Create new imageset', 'CREATE_STYLE' => 'Create new style', 'CREATE_TEMPLATE' => 'Create new template set', 'CREATE_THEME' => 'Create new theme', @@ -75,8 +68,6 @@ $lang = array_merge($lang, array( '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', @@ -87,23 +78,16 @@ $lang = array_merge($lang, array( '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_STYLE_EXPLAIN' => 'Using the form below you can modify this existing style. You may alter the combination of template and theme 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_TEMPLATE_EXPLAIN' => 'Here you can edit certain template details such as its name.', '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_DETAILS_THEME_EXPLAIN' => 'Here you can edit certain theme details such as its name.', '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_TEMPLATE_EXPLAIN' => 'Here you can edit your template set directly. Please remember that these edits are permanent and cannot be undone once submitted. Please take care when editing your template set, remember to close all replacement variable terms {XXXX} and conditional statements.', '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', @@ -123,24 +107,7 @@ $lang = array_merge($lang, array( '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', @@ -268,45 +235,36 @@ $lang = array_merge($lang, array( 'IMG_USER_ICON10' => 'User defined image 10', '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.', '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_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.', @@ -317,8 +275,6 @@ $lang = array_merge($lang, array( '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', @@ -326,7 +282,6 @@ $lang = array_merge($lang, array( '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.', @@ -334,12 +289,10 @@ $lang = array_merge($lang, array( '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', @@ -354,27 +307,25 @@ $lang = array_merge($lang, array( 'STYLE_ERR_NAME_CHARS' => 'The style name can only contain alphanumeric characters, -, +, _ and space.', '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_NO_IDS' => 'You must select a template and theme 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_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 for a commonly used template you could simply export the theme 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_NAME' => 'Style name', 'STYLE_TEMPLATE' => 'Template', 'STYLE_THEME' => 'Theme', 'STYLE_USED_BY' => 'Used by (including robots)', - 'TEMPLATE_ADDED' => 'Template set added and stored on filesystem.', - 'TEMPLATE_ADDED_DB' => 'Template set added and stored in database.', + 'TEMPLATE_ADDED' => 'Template set added.', '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_DELETED_FS' => 'Template set removed from database but files remain on the filesystem.', 'TEMPLATE_DETAILS_UPDATED' => 'Template details successfully updated.', 'TEMPLATE_EDITOR' => 'Raw HTML template editor', 'TEMPLATE_EDITOR_HEIGHT' => 'Template editor height', @@ -393,14 +344,10 @@ $lang = array_merge($lang, array( '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_ADDED' => 'New theme added.', '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.', @@ -414,20 +361,16 @@ $lang = array_merge($lang, array( '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_FILE_NOT_WRITABLE' => 'Unable to write to theme file %s. Please check the permissions for the directory and the files.', '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', diff --git a/phpBB/language/en/help_faq.php b/phpBB/language/en/help_faq.php index 9e00c290f8..6ca9589913 100644 --- a/phpBB/language/en/help_faq.php +++ b/phpBB/language/en/help_faq.php @@ -60,7 +60,7 @@ $help = array( ), array( 0 => 'I registered in the past but cannot login any more?!', - 1 => 'Attempt to locate the e-mail sent to you when you first registered, check your username and password and try again. 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.' + 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?', diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index 96970dcb23..2b5d1cad6b 100644 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -344,7 +344,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="http://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="http://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="http://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="http://www.phpbb.com/community/viewtopic.php?f=14&t=571070">The phpBB Welcome Package</a><br /><a href="http://www.phpbb.com/support/">Support Section</a><br /><a href="http://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="http://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="http://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="http://www.phpbb.com/community/viewforum.php?f=81">Modifications Forum</a>.<br />For issues relating to styles, templates and themes, please post in the appropriate <a href="http://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="http://www.phpbb.com/community/viewtopic.php?f=14&t=571070">The phpBB Welcome Package</a><br /><a href="http://www.phpbb.com/support/">Support Section</a><br /><a href="http://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="http://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.', diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 418c1a4417..1b6cb5ef94 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -1547,7 +1547,7 @@ switch ($mode) 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); @@ -1699,7 +1699,7 @@ function show_profile($data, $user_notes_enabled = false, $warn_user_enabled = f $diff = ($diff < 0) ? 1 : 0; } - $age = (int) ($now['year'] - $bday_year - $diff); + $age = max(0, (int) ($now['year'] - $bday_year - $diff)); } } diff --git a/phpBB/posting.php b/phpBB/posting.php index 0809b5a685..74a8ebecb5 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -180,7 +180,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_captcha_factory::get_instance($config['captcha_plugin']); $captcha->init(CONFIRM_POST); } diff --git a/phpBB/search.php b/phpBB/search.php index 4b1527b7e7..1d35dfb062 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -872,10 +872,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) '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'] : '', diff --git a/phpBB/style.php b/phpBB/style.php deleted file mode 100644 index 62be0dde2b..0000000000 --- a/phpBB/style.php +++ /dev/null @@ -1,303 +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)); - } -} - -// no $request here because it is not loaded yet -$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/class_loader.' . $phpEx); - require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx); - require($phpbb_root_path . 'includes/constants.' . $phpEx); - require($phpbb_root_path . 'includes/functions.' . $phpEx); - - $class_loader = new phpbb_class_loader($phpbb_root_path, '.' . $phpEx); - $class_loader->register(); - - // set up caching - $cache_factory = new phpbb_cache_factory($acm_type); - $cache = $cache_factory->get_service(); - $class_loader->set_cache($cache->get_driver()); - - $request = new phpbb_request(); - $db = new $sql_db(); - - // make sure request_var uses this request instance - request_var('', 0, false, false, $request); // "dependency injection" for a function - - // Connect to DB - if (!@$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, false)) - { - exit; - } - unset($dbpasswd); - - $config = new phpbb_config_db($db, $cache->get_driver(), CONFIG_TABLE); - set_config(null, null, null, $config); - set_config_count(null, null, null, $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/" . $theme['theme_path'] . '/theme', - '{T_TEMPLATE_PATH}' => "{$phpbb_root_path}styles/" . $theme['template_path'] . '/template', - '{T_IMAGESET_PATH}' => "{$phpbb_root_path}styles/" . $theme['imageset_path'] . '/imageset', - '{T_IMAGESET_LANG_PATH}' => "{$phpbb_root_path}styles/" . $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/' . $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(); -} 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/en/index.htm b/phpBB/styles/prosilver/imageset/en/index.htm deleted file mode 100644 index e69de29bb2..0000000000 --- a/phpBB/styles/prosilver/imageset/en/index.htm +++ /dev/null diff --git a/phpBB/styles/prosilver/imageset/imageset.cfg b/phpBB/styles/prosilver/imageset/imageset.cfg deleted file mode 100644 index f1185bd4f0..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 = © phpBB Group, 2007 -version = 3.1.0-dev - -# 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/index.htm b/phpBB/styles/prosilver/imageset/index.htm deleted file mode 100644 index e69de29bb2..0000000000 --- a/phpBB/styles/prosilver/imageset/index.htm +++ /dev/null diff --git a/phpBB/styles/prosilver/template/editor.js b/phpBB/styles/prosilver/template/editor.js index dc380cef3d..2c41b543b5 100644 --- a/phpBB/styles/prosilver/template/editor.js +++ b/phpBB/styles/prosilver/template/editor.js @@ -151,8 +151,10 @@ function insert_text(text, spaces, popup) { text = ' ' + text + ' '; } - - if (!isNaN(textarea.selectionStart)) + + // 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; @@ -216,11 +218,12 @@ function addquote(post_id, username, l_wrote) } // Get text selection - not only the post content :( - if (window.getSelection) + // IE9 must use the document.selection method but has the *.getSelection so we just force no IE + if (window.getSelection && !is_ie) { theSelection = window.getSelection().toString(); } - else if (document.getSelection) + else if (document.getSelection && !is_ie) { theSelection = document.getSelection(); } diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js index 4a85858df5..240fe7e51d 100644 --- a/phpBB/styles/prosilver/template/forum_fn.js +++ b/phpBB/styles/prosilver/template/forum_fn.js @@ -200,7 +200,7 @@ function selectCode(a) // Get ID of code block var e = a.parentNode.parentNode.getElementsByTagName('CODE')[0]; - // Not IE + // Not IE and IE9+ if (window.getSelection) { var s = window.getSelection(); diff --git a/phpBB/styles/prosilver/template/forumlist_body.html b/phpBB/styles/prosilver/template/forumlist_body.html index 3227050179..7ac3a8d9e6 100644 --- a/phpBB/styles/prosilver/template/forumlist_body.html +++ b/phpBB/styles/prosilver/template/forumlist_body.html @@ -11,9 +11,9 @@ <div class="forabg"> <div class="inner"><span class="corners-top"><span></span></span> <ul class="topiclist"> - <li class="header"> + <li class="header widescreen-optimised"> <dl class="icon"> - <dt><div class="wrap-content"><!-- IF forumrow.S_IS_CAT --><a href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a><!-- ELSE -->{L_FORUM}<!-- ENDIF --></div></dt> + <dt><span class="wrap-content"><!-- IF forumrow.S_IS_CAT --><a href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a><!-- ELSE -->{L_FORUM}<!-- ENDIF --></span></dt> <dd class="topics">{L_TOPICS}</dd> <dd class="posts">{L_POSTS}</dd> <dd class="lastpost"><span>{L_LAST_POST}</span></dd> @@ -25,8 +25,8 @@ <!-- IF not forumrow.S_IS_CAT --> <li class="row"> - <dl class="icon {forumrow.FORUM_IMG_STYLE}"> - <dt title="{forumrow.FORUM_FOLDER_IMG_ALT}"><div class="wrap-content"> + <dl class="icon {forumrow.FORUM_IMG_STYLE} widescreen-optimised"> + <dt title="{forumrow.FORUM_FOLDER_IMG_ALT}"><span class="wrap-content"> <!-- 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 --> @@ -37,7 +37,7 @@ <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 --> - </div></dt> + </span></dt> <!-- IF forumrow.CLICKS --> <dd class="redirect"><span>{L_REDIRECTS}: {forumrow.CLICKS}</span></dd> <!-- ELSEIF not forumrow.S_IS_LINK --> diff --git a/phpBB/styles/prosilver/template/mcp_front.html b/phpBB/styles/prosilver/template/mcp_front.html index ff98efc9fd..21431b4bc1 100644 --- a/phpBB/styles/prosilver/template/mcp_front.html +++ b/phpBB/styles/prosilver/template/mcp_front.html @@ -28,7 +28,6 @@ <dl> <dt> <a href="{unapproved.U_POST_DETAILS}" class="topictitle">{unapproved.SUBJECT}</a> {unapproved.ATTACH_ICON_IMG}<br /> - <!-- IF report.PAGINATION --><strong class="pagination"><span>{report.PAGINATION}</span></strong><!-- ENDIF --> {L_POSTED} {L_POST_BY_AUTHOR} {unapproved.AUTHOR_FULL} » {unapproved.POST_TIME} </dt> <dd class="moderation"><span> diff --git a/phpBB/styles/prosilver/template/mcp_move.html b/phpBB/styles/prosilver/template/mcp_move.html index 5c8dcf9165..03a5c475db 100644 --- a/phpBB/styles/prosilver/template/mcp_move.html +++ b/phpBB/styles/prosilver/template/mcp_move.html @@ -13,7 +13,7 @@ <dl class="fields2"> <dt><label>{L_SELECT_DESTINATION_FORUM}:</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"> diff --git a/phpBB/styles/prosilver/template/mcp_notes_user.html b/phpBB/styles/prosilver/template/mcp_notes_user.html index 86d05a9ed4..129f2ca839 100644 --- a/phpBB/styles/prosilver/template/mcp_notes_user.html +++ b/phpBB/styles/prosilver/template/mcp_notes_user.html @@ -78,7 +78,7 @@ <td style="text-align: center">{usernotes.REPORT_AT}</td> <td>{usernotes.ACTION}</td> - <!-- IF S_CLEAR_ALLOWED --><td width="5%" align="center"><input type="checkbox" name="marknote[]" id="note-{usernotes.ID}" value="{usernotes.ID}" /></td><!-- ENDIF --> + <!-- 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 --> </tr> <!-- BEGINELSE --> <tr> diff --git a/phpBB/styles/prosilver/template/mcp_viewlogs.html b/phpBB/styles/prosilver/template/mcp_viewlogs.html deleted file mode 100644 index 5c60369eac..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} <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></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> <!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE --> <a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --></strong><!-- ENDIF --></td> -</tr> -</table> - -<!-- INCLUDE mcp_footer.html --> diff --git a/phpBB/styles/prosilver/template/memberlist_view.html b/phpBB/styles/prosilver/template/memberlist_view.html index 74f563f17d..4b41693ded 100644 --- a/phpBB/styles/prosilver/template/memberlist_view.html +++ b/phpBB/styles/prosilver/template/memberlist_view.html @@ -28,7 +28,7 @@ <!-- 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 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 --> @@ -89,8 +89,8 @@ <!-- 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}:</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> <!-- ENDIF --> </dl> </div> diff --git a/phpBB/styles/prosilver/template/overall_footer.html b/phpBB/styles/prosilver/template/overall_footer.html index 5075c661f3..275e018f43 100644 --- a/phpBB/styles/prosilver/template/overall_footer.html +++ b/phpBB/styles/prosilver/template/overall_footer.html @@ -29,9 +29,11 @@ </div> <div> - <a id="bottom" name="bottom" accesskey="z"></a> + <a id="bottom" accesskey="z"></a> <!-- IF not S_IS_BOT -->{RUN_CRON_TASK}<!-- ENDIF --> </div> +<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/jquery.js"></script> + </body> </html> diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html index 9f022e215d..364373f439 100644 --- a/phpBB/styles/prosilver/template/overall_header.html +++ b/phpBB/styles/prosilver/template/overall_header.html @@ -62,7 +62,7 @@ { eval(onload_functions[i]); } - } + }; window.onunload = function() { @@ -70,7 +70,7 @@ { eval(onunload_functions[i]); } - } + }; // ]]> </script> @@ -78,6 +78,7 @@ <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_STYLESHEET_LANG_LINK}" rel="stylesheet" type="text/css" media="screen, projection" /> <!-- IF S_CONTENT_DIRECTION eq 'rtl' --> <link href="{T_THEME_PATH}/bidi.css" rel="stylesheet" type="text/css" media="screen, projection" /> @@ -88,7 +89,7 @@ <body id="phpbb" class="section-{SCRIPT_NAME} {S_CONTENT_DIRECTION}"> <div id="wrap"> - <a id="top" name="top" accesskey="t"></a> + <a id="top" accesskey="t"></a> <div id="page-header"> <div class="headerbar"> <div class="inner"><span class="corners-top"><span></span></span> @@ -156,7 +157,7 @@ </div> - <a name="start_here"></a> + <a id="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"> diff --git a/phpBB/styles/prosilver/template/search_results.html b/phpBB/styles/prosilver/template/search_results.html index 942d154d44..c61057d830 100644 --- a/phpBB/styles/prosilver/template/search_results.html +++ b/phpBB/styles/prosilver/template/search_results.html @@ -39,8 +39,8 @@ <div class="inner"><span class="corners-top"><span></span></span> <ul class="topiclist"> <li class="header"> - <dl class="icon"> - <dt>{L_TOPICS}</dt> + <dl class="icon widescreen-optimised"> + <dt><span class="wrap-content">{L_TOPICS}</span></dt> <dd class="posts">{L_REPLIES}</dd> <dd class="views">{L_VIEWS}</dd> <dd class="lastpost"><span>{L_LAST_POST}</span></dd> @@ -51,15 +51,15 @@ <!-- BEGIN searchresults --> <li class="row<!-- IF searchresults.S_ROW_COUNT is even --> bg1<!-- ELSE --> bg2<!-- 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 -->> + <dl class="icon {searchresults.TOPIC_IMG_STYLE} widescreen-optimised"> + <dt <!-- IF searchresults.TOPIC_ICON_IMG -->style="background-image: url({T_ICONS_PATH}{searchresults.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF -->><span class="wrap-content"> <!-- 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} » {searchresults.FIRST_POST_TIME} » {L_IN} <a href="{searchresults.U_VIEW_FORUM}">{searchresults.FORUM_TITLE}</a> - </dt> + </span></dt> <dd class="posts">{searchresults.TOPIC_REPLIES}</dd> <dd class="views">{searchresults.TOPIC_VIEWS}</dd> <dd class="lastpost"><span> diff --git a/phpBB/styles/prosilver/template/simple_footer.html b/phpBB/styles/prosilver/template/simple_footer.html index 2511db675f..5899da0b7a 100644 --- a/phpBB/styles/prosilver/template/simple_footer.html +++ b/phpBB/styles/prosilver/template/simple_footer.html @@ -6,5 +6,7 @@ </div> </div> +<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/jquery.js"></script> + </body> </html> diff --git a/phpBB/styles/prosilver/template/simple_header.html b/phpBB/styles/prosilver/template/simple_header.html index 9a196ab7c6..f71dd8d85c 100644 --- a/phpBB/styles/prosilver/template/simple_header.html +++ b/phpBB/styles/prosilver/template/simple_header.html @@ -44,6 +44,7 @@ <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_STYLESHEET_LANG_LINK}" rel="stylesheet" type="text/css" media="screen, projection" /> <!-- IF S_CONTENT_DIRECTION eq 'rtl' --> <link href="{T_THEME_PATH}/bidi.css" rel="stylesheet" type="text/css" media="screen, projection" /> @@ -56,5 +57,5 @@ <body id="phpbb" class="{S_CONTENT_DIRECTION}"> <div id="simple-wrap"> - <a id="top" name="top" accesskey="t"></a> + <a id="top" accesskey="t"></a> <div id="page-body"> diff --git a/phpBB/styles/prosilver/template/ucp_attachments.html b/phpBB/styles/prosilver/template/ucp_attachments.html index 5a15339b8a..310695e640 100644 --- a/phpBB/styles/prosilver/template/ucp_attachments.html +++ b/phpBB/styles/prosilver/template/ucp_attachments.html @@ -20,7 +20,7 @@ <ul class="topiclist"> <li class="header"> <dl> - <dt style="width: 40%"><a href="{U_SORT_FILENAME}">{L_FILENAME}</a></dt> + <dt><a href="{U_SORT_FILENAME}">{L_FILENAME}</a></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> @@ -32,7 +32,7 @@ <!-- 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 /> + <dt><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> <dd class="extra">{attachrow.DOWNLOAD_COUNT}</dd> <dd class="time"><span>{attachrow.POST_TIME}</span></dd> diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html index a6fdaf246d..23b7322ab1 100644 --- a/phpBB/styles/prosilver/template/viewforum_body.html +++ b/phpBB/styles/prosilver/template/viewforum_body.html @@ -126,8 +126,8 @@ <div class="inner"><span class="corners-top"><span></span></span> <ul class="topiclist"> <li class="header"> - <dl class="icon"> - <dt><div class="wrap-content"><!-- 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> + <dl class="icon widescreen-optimised"> + <dt><span class="wrap-content"><!-- 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 --></span></dt> <dd class="posts">{L_REPLIES}</dd> <dd class="views">{L_VIEWS}</dd> <dd class="lastpost"><span>{L_LAST_POST}</span></dd> @@ -138,14 +138,14 @@ <!-- ENDIF --> <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 {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}"><div class="wrap-content"><!-- 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> + <dl class="icon {topicrow.TOPIC_IMG_STYLE} widescreen-optimised"> + <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}"><span class="wrap-content"><!-- 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} » {topicrow.FIRST_POST_TIME} <!-- IF topicrow.S_POST_GLOBAL and FORUM_ID != topicrow.FORUM_ID --> » {L_IN} <a href="{topicrow.U_VIEW_FORUM}">{topicrow.FORUM_NAME}</a><!-- ENDIF --> - </div></dt> + </span></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} diff --git a/phpBB/styles/prosilver/template/viewtopic_print.html b/phpBB/styles/prosilver/template/viewtopic_print.html index 8a8ea87f00..b28608d6f1 100644 --- a/phpBB/styles/prosilver/template/viewtopic_print.html +++ b/phpBB/styles/prosilver/template/viewtopic_print.html @@ -13,7 +13,7 @@ <body id="phpbb"> <div id="wrap"> - <a id="top" name="top" accesskey="t"></a> + <a id="top" accesskey="t"></a> <div id="page-header"> <h1>{SITENAME}</h1> diff --git a/phpBB/styles/prosilver/theme/buttons.css b/phpBB/styles/prosilver/theme/buttons.css index f73c79ff73..afd65454b1 100644 --- a/phpBB/styles/prosilver/theme/buttons.css +++ b/phpBB/styles/prosilver/theme/buttons.css @@ -42,12 +42,12 @@ .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; } +.buttons div.reply-icon { width: 96px; height: 25px; } +.buttons div.post-icon { width: 96px; height: 25px; } +.buttons div.locked-icon { width: 88px; height: 25px; } +.buttons div.pmreply-icon { width: 96px; height: 25px; } +.buttons div.newpm-icon { width: 84px; height: 25px; } +.buttons div.forwardpm-icon { width: 96px; height: 25px; } /* Sub-header (navigation bar) --------------------------------------------- */ @@ -136,20 +136,20 @@ ul.profile-icons li a:hover { background: none; } .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; } +ul.profile-icons li.email-icon { width: 20px; height: 20px; } +ul.profile-icons li.aim-icon { width: 20px; height: 20px; } +ul.profile-icons li.yahoo-icon { width: 20px; height: 20px; } +ul.profile-icons li.web-icon { width: 20px; height: 20px; } +ul.profile-icons li.msnm-icon { width: 20px; height: 20px; } +ul.profile-icons li.icq-icon { width: 20px; height: 20px; } +ul.profile-icons li.jabber-icon { width: 20px; height: 20px; } +ul.profile-icons li.pm-icon { width: 28px; height: 20px; } +ul.profile-icons li.quote-icon { width: 54px; height: 20px; } +ul.profile-icons li.report-icon { width: 20px; height: 20px; } +ul.profile-icons li.edit-icon { width: 42px; height: 20px; } +ul.profile-icons li.delete-icon { width: 20px; height: 20px; } +ul.profile-icons li.info-icon { width: 20px; height: 20px; } +ul.profile-icons li.warn-icon { width: 20px; height: 20px; } /* Fix profile icon default margins */ ul.profile-icons li.edit-icon { margin: 0 0 0 3px; } diff --git a/phpBB/styles/prosilver/theme/colours.css b/phpBB/styles/prosilver/theme/colours.css index b1cccaab7a..7bc66f4e7d 100644 --- a/phpBB/styles/prosilver/theme/colours.css +++ b/phpBB/styles/prosilver/theme/colours.css @@ -49,7 +49,7 @@ hr.dashed { ---------------------------------------- */ .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 { @@ -93,19 +93,19 @@ hr.dashed { } span.corners-top { - background-image: url("{T_THEME_PATH}/images/corners_left.png"); + background-image: url("./images/corners_left.png"); } span.corners-top span { - background-image: url("{T_THEME_PATH}/images/corners_right.png"); + background-image: url("./images/corners_right.png"); } span.corners-bottom { - background-image: url("{T_THEME_PATH}/images/corners_left.png"); + background-image: url("./images/corners_left.png"); } span.corners-bottom span { - background-image: url("{T_THEME_PATH}/images/corners_right.png"); + background-image: url("./images/corners_right.png"); } /* Horizontal lists @@ -191,7 +191,7 @@ dl.details dd { /* Pagination in viewforum for multipage topics */ .row .pagination { - background-image: url("{T_THEME_PATH}/images/icon_pages.gif"); + background-image: url("./images/icon_pages.gif"); } .row .pagination span a, li.pagination span a { @@ -338,18 +338,18 @@ a.topictitle:active { /* 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.up { background-image: url("./images/arrow_up.gif") } +a.down { background-image: url("./images/arrow_down.gif") } +a.left { background-image: url("./images/arrow_left.gif") } +a.right { background-image: url("./images/arrow_right.gif") } a.up:hover { background-color: transparent; @@ -371,7 +371,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 +388,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 { @@ -467,12 +467,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 { @@ -652,7 +652,7 @@ fieldset.polls dd div { } .online { - background-image: url("{IMG_ICON_USER_ONLINE_SRC}"); + background-image: url("./en/icon_user_online.gif"); } /* @@ -661,107 +661,107 @@ Colours and backgrounds for buttons.css -------------------------------------------------------------- */ /* 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}") ;} +.reply-icon span { background-image: url("./en/button_topic_reply.gif"); } +.post-icon span { background-image: url("./en/button_topic_new.gif"); } +.locked-icon span { background-image: url("./en/button_topic_locked.gif"); } +.pmreply-icon span { background-image: url("./en/button_pm_reply.gif") ;} +.newpm-icon span { background-image: url("./en/button_pm_new.gif") ;} +.forwardpm-icon span { background-image: url("./en/button_pm_forward.gif") ;} a.print { - background-image: url("{T_THEME_PATH}/images/icon_print.gif"); + background-image: url("./images/icon_print.gif"); } a.sendemail { - background-image: url("{T_THEME_PATH}/images/icon_sendemail.gif"); + background-image: url("./images/icon_sendemail.gif"); } /* 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"); } +.sitehome { background-image: url("./images/icon_home.gif"); } +.icon-faq { background-image: url("./images/icon_faq.gif"); } +.icon-members { background-image: url("./images/icon_members.gif"); } +.icon-home { background-image: url("./images/icon_home.gif"); } +.icon-ucp { background-image: url("./images/icon_ucp.gif"); } +.icon-register { background-image: url("./images/icon_register.gif"); } +.icon-logout { background-image: url("./images/icon_logout.gif"); } +.icon-bookmark { background-image: url("./images/icon_bookmark.gif"); } +.icon-bump { background-image: url("./images/icon_bump.gif"); } +.icon-subscribe { background-image: url("./images/icon_subscribe.gif"); } +.icon-unsubscribe { background-image: url("./images/icon_unsubscribe.gif"); } +.icon-pages { background-image: url("./images/icon_pages.gif"); } +.icon-search { background-image: url("./images/icon_search.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}"); } +.email-icon, .email-icon a { background-image: url("./images/icon_contact_email.gif"); } +.aim-icon, .aim-icon a { background-image: url("./images/icon_contact_aim.gif"); } +.yahoo-icon, .yahoo-icon a { background-image: url("./images/icon_contact_yahoo.gif"); } +.web-icon, .web-icon a { background-image: url("./images/icon_contact_www.gif"); } +.msnm-icon, .msnm-icon a { background-image: url("./images/icon_contact_msnm.gif"); } +.icq-icon, .icq-icon a { background-image: url("./images/icon_contact_icq.gif"); } +.jabber-icon, .jabber-icon a { background-image: url("./images/icon_contact_jabber.gif"); } +.pm-icon, .pm-icon a { background-image: url("./en/icon_contact_pm.gif"); } +.quote-icon, .quote-icon a { background-image: url("./en/icon_post_quote.gif"); } /* 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 */ +.report-icon, .report-icon a { background-image: url("./images/icon_post_report.gif"); } +.edit-icon, .edit-icon a { background-image: url("./en/icon_post_edit.gif"); } +.delete-icon, .delete-icon a { background-image: url("./images/icon_post_delete.gif"); } +.info-icon, .info-icon a { background-image: url("./images/icon_post_info.gif"); } +.warn-icon, .warn-icon a { background-image: url("./images/icon_user_warn.gif"); } /* Need updated warn icon */ /* Forum icons & Topic icons */ -.global_read { background-image: url("{IMG_GLOBAL_READ_SRC}"); } -.global_read_mine { background-image: url("{IMG_GLOBAL_READ_MINE_SRC}"); } -.global_read_locked { background-image: url("{IMG_GLOBAL_READ_LOCKED_SRC}"); } -.global_read_locked_mine { background-image: url("{IMG_GLOBAL_READ_LOCKED_MINE_SRC}"); } -.global_unread { background-image: url("{IMG_GLOBAL_UNREAD_SRC}"); } -.global_unread_mine { background-image: url("{IMG_GLOBAL_UNREAD_MINE_SRC}"); } -.global_unread_locked { background-image: url("{IMG_GLOBAL_UNREAD_LOCKED_SRC}"); } -.global_unread_locked_mine { background-image: url("{IMG_GLOBAL_UNREAD_LOCKED_MINE_SRC}"); } - -.announce_read { background-image: url("{IMG_ANNOUNCE_READ_SRC}"); } -.announce_read_mine { background-image: url("{IMG_ANNOUNCE_READ_MINE_SRC}"); } -.announce_read_locked { background-image: url("{IMG_ANNOUNCE_READ_LOCKED_SRC}"); } -.announce_read_locked_mine { background-image: url("{IMG_ANNOUNCE_READ_LOCKED_MINE_SRC}"); } -.announce_unread { background-image: url("{IMG_ANNOUNCE_UNREAD_SRC}"); } -.announce_unread_mine { background-image: url("{IMG_ANNOUNCE_UNREAD_MINE_SRC}"); } -.announce_unread_locked { background-image: url("{IMG_ANNOUNCE_UNREAD_LOCKED_SRC}"); } -.announce_unread_locked_mine { background-image: url("{IMG_ANNOUNCE_UNREAD_LOCKED_MINE_SRC}"); } - -.forum_link { background-image: url("{IMG_FORUM_LINK_SRC}"); } -.forum_read { background-image: url("{IMG_FORUM_READ_SRC}"); } -.forum_read_locked { background-image: url("{IMG_FORUM_READ_LOCKED_SRC}"); } -.forum_read_subforum { background-image: url("{IMG_FORUM_READ_SUBFORUM_SRC}"); } -.forum_unread { background-image: url("{IMG_FORUM_UNREAD_SRC}"); } -.forum_unread_locked { background-image: url("{IMG_FORUM_UNREAD_LOCKED_SRC}"); } -.forum_unread_subforum { background-image: url("{IMG_FORUM_UNREAD_SUBFORUM_SRC}"); } - -.sticky_read { background-image: url("{IMG_STICKY_READ_SRC}"); } -.sticky_read_mine { background-image: url("{IMG_STICKY_READ_MINE_SRC}"); } -.sticky_read_locked { background-image: url("{IMG_STICKY_READ_LOCKED_SRC}"); } -.sticky_read_locked_mine { background-image: url("{IMG_STICKY_READ_LOCKED_MINE_SRC}"); } -.sticky_unread { background-image: url("{IMG_STICKY_UNREAD_SRC}"); } -.sticky_unread_mine { background-image: url("{IMG_STICKY_UNREAD_MINE_SRC}"); } -.sticky_unread_locked { background-image: url("{IMG_STICKY_UNREAD_LOCKED_SRC}"); } -.sticky_unread_locked_mine { background-image: url("{IMG_STICKY_UNREAD_LOCKED_MINE_SRC}"); } - -.topic_moved { background-image: url("{IMG_TOPIC_MOVED_SRC}"); } -.topic_read { background-image: url("{IMG_TOPIC_READ_SRC}"); } -.topic_read_mine { background-image: url("{IMG_TOPIC_READ_MINE_SRC}"); } -.topic_read_hot { background-image: url("{IMG_TOPIC_READ_HOT_SRC}"); } -.topic_read_hot_mine { background-image: url("{IMG_TOPIC_READ_HOT_MINE_SRC}"); } -.topic_read_locked { background-image: url("{IMG_TOPIC_READ_LOCKED_SRC}"); } -.topic_read_locked_mine { background-image: url("{IMG_TOPIC_READ_LOCKED_MINE_SRC}"); } -.topic_unread { background-image: url("{IMG_TOPIC_UNREAD_SRC}"); } -.topic_unread_mine { background-image: url("{IMG_TOPIC_UNREAD_MINE_SRC}"); } -.topic_unread_hot { background-image: url("{IMG_TOPIC_UNREAD_HOT_SRC}"); } -.topic_unread_hot_mine { background-image: url("{IMG_TOPIC_UNREAD_HOT_MINE_SRC}"); } -.topic_unread_locked { background-image: url("{IMG_TOPIC_UNREAD_LOCKED_SRC}"); } -.topic_unread_locked_mine { background-image: url("{IMG_TOPIC_UNREAD_LOCKED_MINE_SRC}"); } - -.pm_read { background-image: url("{IMG_TOPIC_READ_SRC}"); } -.pm_unread { background-image: url("{IMG_TOPIC_UNREAD_SRC}"); } +.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"); } /* -------------------------------------------------------------- @@ -801,11 +801,11 @@ ul.cplist { /* CP tabbed menu ----------------------------------------*/ #tabs a { - background-image: url("{T_THEME_PATH}/images/bg_tabs1.gif"); + background-image: url("./images/bg_tabs1.gif"); } #tabs a span { - background-image: url("{T_THEME_PATH}/images/bg_tabs2.gif"); + background-image: url("./images/bg_tabs2.gif"); color: #536482; } @@ -846,11 +846,11 @@ ul.cplist { #navigation a { color: #333; background-color: #B2C2CF; - background-image: url("{T_THEME_PATH}/images/bg_menu.gif"); + background-image: url("./images/bg_menu.gif"); } .rtl #navigation a { - background-image: url("{T_THEME_PATH}/images/bg_menu_rtl.gif"); + background-image: url("./images/bg_menu_rtl.gif"); background-position: 0 100%; } @@ -885,36 +885,36 @@ ul.cplist { } #cp-main span.corners-top, #cp-menu span.corners-top { - background-image: url("{T_THEME_PATH}/images/corners_left2.gif"); + background-image: url("./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"); + background-image: url("./images/corners_right2.gif"); } #cp-main span.corners-bottom, #cp-menu span.corners-bottom { - background-image: url("{T_THEME_PATH}/images/corners_left2.gif"); + background-image: url("./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"); + background-image: url("./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"); + background-image: url("./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"); + background-image: url("./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"); + background-image: url("./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"); + background-image: url("./images/corners_right.gif"); } /* Friends list */ @@ -1042,7 +1042,7 @@ fieldset.quick-login input.inputbox { 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 { @@ -1070,7 +1070,7 @@ a.button1:hover, input.button1:hover, a.button2:hover, input.button2:hover, inpu } input.search { - background-image: url("{T_THEME_PATH}/images/icon_textbox_search.gif"); + background-image: url("./images/icon_textbox_search.gif"); } input.disabled { diff --git a/phpBB/styles/prosilver/theme/content.css b/phpBB/styles/prosilver/theme/content.css index c7ff57efb5..17ee56c4a2 100644 --- a/phpBB/styles/prosilver/theme/content.css +++ b/phpBB/styles/prosilver/theme/content.css @@ -29,14 +29,19 @@ ul.topiclist li.row dl { ul.topiclist dt { display: block; float: left; - width: 100%; + width: 50%; font-size: 1.1em; padding-left: 5px; padding-right: 5px; +} + +ul.topiclist .widescreen-optimised dt { + width: 100%; margin-right: -465px; } -ul.topiclist dt .wrap-content { +ul.topiclist .widescreen-optimised dt .wrap-content { + display: block; padding-right: 465px; } @@ -101,6 +106,9 @@ li.header dt, li.header dd { li.header dt { font-weight: bold; +} + +li.header .widescreen-optimised dt { margin-right: -465px; } @@ -184,7 +192,7 @@ dd.extra { dd.mark { float: right !important; - width: 9%; + width: 90px; text-align: center; line-height: 200%; font-size: 1.2em; diff --git a/phpBB/styles/prosilver/imageset/en/button_pm_forward.gif b/phpBB/styles/prosilver/theme/en/button_pm_forward.gif Binary files differindex 3384df34be..3384df34be 100644 --- a/phpBB/styles/prosilver/imageset/en/button_pm_forward.gif +++ b/phpBB/styles/prosilver/theme/en/button_pm_forward.gif diff --git a/phpBB/styles/prosilver/imageset/en/button_pm_new.gif b/phpBB/styles/prosilver/theme/en/button_pm_new.gif Binary files differindex cc0381c6b2..cc0381c6b2 100644 --- a/phpBB/styles/prosilver/imageset/en/button_pm_new.gif +++ b/phpBB/styles/prosilver/theme/en/button_pm_new.gif diff --git a/phpBB/styles/prosilver/imageset/en/button_pm_reply.gif b/phpBB/styles/prosilver/theme/en/button_pm_reply.gif Binary files differindex 3275b06d52..3275b06d52 100644 --- a/phpBB/styles/prosilver/imageset/en/button_pm_reply.gif +++ b/phpBB/styles/prosilver/theme/en/button_pm_reply.gif diff --git a/phpBB/styles/prosilver/imageset/en/button_topic_locked.gif b/phpBB/styles/prosilver/theme/en/button_topic_locked.gif Binary files differindex b08918a24f..b08918a24f 100644 --- a/phpBB/styles/prosilver/imageset/en/button_topic_locked.gif +++ b/phpBB/styles/prosilver/theme/en/button_topic_locked.gif diff --git a/phpBB/styles/prosilver/imageset/en/button_topic_new.gif b/phpBB/styles/prosilver/theme/en/button_topic_new.gif Binary files differindex 5b7b1e0e60..5b7b1e0e60 100644 --- a/phpBB/styles/prosilver/imageset/en/button_topic_new.gif +++ b/phpBB/styles/prosilver/theme/en/button_topic_new.gif diff --git a/phpBB/styles/prosilver/imageset/en/button_topic_reply.gif b/phpBB/styles/prosilver/theme/en/button_topic_reply.gif Binary files differindex e900c80c70..e900c80c70 100644 --- a/phpBB/styles/prosilver/imageset/en/button_topic_reply.gif +++ b/phpBB/styles/prosilver/theme/en/button_topic_reply.gif diff --git a/phpBB/styles/prosilver/imageset/en/icon_contact_pm.gif b/phpBB/styles/prosilver/theme/en/icon_contact_pm.gif Binary files differindex ec190118fe..ec190118fe 100644 --- a/phpBB/styles/prosilver/imageset/en/icon_contact_pm.gif +++ b/phpBB/styles/prosilver/theme/en/icon_contact_pm.gif diff --git a/phpBB/styles/prosilver/imageset/en/icon_post_edit.gif b/phpBB/styles/prosilver/theme/en/icon_post_edit.gif Binary files differindex 19006f95a7..19006f95a7 100644 --- a/phpBB/styles/prosilver/imageset/en/icon_post_edit.gif +++ b/phpBB/styles/prosilver/theme/en/icon_post_edit.gif diff --git a/phpBB/styles/prosilver/imageset/en/icon_post_quote.gif b/phpBB/styles/prosilver/theme/en/icon_post_quote.gif Binary files differindex c3708a1477..c3708a1477 100644 --- a/phpBB/styles/prosilver/imageset/en/icon_post_quote.gif +++ b/phpBB/styles/prosilver/theme/en/icon_post_quote.gif diff --git a/phpBB/styles/prosilver/imageset/en/icon_user_online.gif b/phpBB/styles/prosilver/theme/en/icon_user_online.gif Binary files differindex 6b571ffce0..6b571ffce0 100644 --- a/phpBB/styles/prosilver/imageset/en/icon_user_online.gif +++ b/phpBB/styles/prosilver/theme/en/icon_user_online.gif diff --git a/phpBB/styles/prosilver/theme/en/stylesheet.css b/phpBB/styles/prosilver/theme/en/stylesheet.css new file mode 100644 index 0000000000..62d6b86726 --- /dev/null +++ b/phpBB/styles/prosilver/theme/en/stylesheet.css @@ -0,0 +1,64 @@ +/* Set big button dimensions */ +.buttons div.reply-icon { width: 96px; height: 25px; } +.buttons div.post-icon { width: 96px; height: 25px; } +.buttons div.locked-icon { width: 88px; height: 25px; } +.buttons div.pmreply-icon { width: 96px; height: 25px; } +.buttons div.newpm-icon { width: 84px; height: 25px; } +.buttons div.forwardpm-icon { width: 96px; height: 25px; } + +/* Set profile icon dimensions */ +ul.profile-icons li.pm-icon { width: 28px; height: 20px; } +ul.profile-icons li.quote-icon { width: 54px; height: 20px; } +ul.profile-icons li.edit-icon { width: 42px; height: 20px; } + +/* EN Language Pack */ +.imageset.icon_contact_pm { + background-image: url("./icon_contact_pm.gif"); + padding-left: 28px; + padding-top: 20px; +} +.imageset.icon_post_edit { + background-image: url("./icon_post_edit.gif"); + padding-left: 42px; + padding-top: 20px; +} +.imageset.icon_post_quote { + background-image: url("./icon_post_quote.gif"); + padding-left: 54px; + padding-top: 20px; +} +.imageset.icon_user_online { + background-image: url("./icon_user_online.gif"); + padding-left: 58px; + padding-top: 58px; +} +.imageset.button_pm_forward { + background-image: url("./button_pm_forward.gif"); + padding-left: 96px; + padding-top: 25px; +} +.imageset.button_pm_new { + background-image: url("./button_pm_new.gif"); + padding-left: 84px; + padding-top: 25px; +} +.imageset.button_pm_reply { + background-image: url("./button_pm_reply.gif"); + padding-left: 96px; + padding-top: 25px; +} +.imageset.button_topic_locked { + background-image: url("./button_topic_locked.gif"); + padding-left: 88px; + padding-top: 25px; +} +.imageset.button_topic_new { + background-image: url("./button_topic_new.gif"); + padding-left: 96px; + padding-top: 25px; +} +.imageset.button_topic_reply { + background-image: url("./button_topic_reply.gif"); + padding-left: 96px; + padding-top: 25px; +} diff --git a/phpBB/styles/prosilver/imageset/announce_read.gif b/phpBB/styles/prosilver/theme/images/announce_read.gif Binary files differindex 33e4a5e852..33e4a5e852 100644 --- a/phpBB/styles/prosilver/imageset/announce_read.gif +++ b/phpBB/styles/prosilver/theme/images/announce_read.gif diff --git a/phpBB/styles/prosilver/imageset/announce_read_locked.gif b/phpBB/styles/prosilver/theme/images/announce_read_locked.gif Binary files differindex 76ead8a02c..76ead8a02c 100644 --- a/phpBB/styles/prosilver/imageset/announce_read_locked.gif +++ b/phpBB/styles/prosilver/theme/images/announce_read_locked.gif diff --git a/phpBB/styles/prosilver/imageset/announce_read_locked_mine.gif b/phpBB/styles/prosilver/theme/images/announce_read_locked_mine.gif Binary files differindex 2105d21f10..2105d21f10 100644 --- a/phpBB/styles/prosilver/imageset/announce_read_locked_mine.gif +++ b/phpBB/styles/prosilver/theme/images/announce_read_locked_mine.gif diff --git a/phpBB/styles/prosilver/imageset/announce_read_mine.gif b/phpBB/styles/prosilver/theme/images/announce_read_mine.gif Binary files differindex ad928330e6..ad928330e6 100644 --- a/phpBB/styles/prosilver/imageset/announce_read_mine.gif +++ b/phpBB/styles/prosilver/theme/images/announce_read_mine.gif diff --git a/phpBB/styles/prosilver/imageset/announce_unread.gif b/phpBB/styles/prosilver/theme/images/announce_unread.gif Binary files differindex 4a789f70f0..4a789f70f0 100644 --- a/phpBB/styles/prosilver/imageset/announce_unread.gif +++ b/phpBB/styles/prosilver/theme/images/announce_unread.gif diff --git a/phpBB/styles/prosilver/imageset/announce_unread_locked.gif b/phpBB/styles/prosilver/theme/images/announce_unread_locked.gif Binary files differindex 76dcc6ca71..76dcc6ca71 100644 --- a/phpBB/styles/prosilver/imageset/announce_unread_locked.gif +++ b/phpBB/styles/prosilver/theme/images/announce_unread_locked.gif diff --git a/phpBB/styles/prosilver/imageset/announce_unread_locked_mine.gif b/phpBB/styles/prosilver/theme/images/announce_unread_locked_mine.gif Binary files differindex 53782fc3dc..53782fc3dc 100644 --- a/phpBB/styles/prosilver/imageset/announce_unread_locked_mine.gif +++ b/phpBB/styles/prosilver/theme/images/announce_unread_locked_mine.gif diff --git a/phpBB/styles/prosilver/imageset/announce_unread_mine.gif b/phpBB/styles/prosilver/theme/images/announce_unread_mine.gif Binary files differindex e01e920b59..e01e920b59 100644 --- a/phpBB/styles/prosilver/imageset/announce_unread_mine.gif +++ b/phpBB/styles/prosilver/theme/images/announce_unread_mine.gif diff --git a/phpBB/styles/prosilver/imageset/forum_link.gif b/phpBB/styles/prosilver/theme/images/forum_link.gif Binary files differindex 01fb1c4e1e..01fb1c4e1e 100644 --- a/phpBB/styles/prosilver/imageset/forum_link.gif +++ b/phpBB/styles/prosilver/theme/images/forum_link.gif diff --git a/phpBB/styles/prosilver/imageset/forum_read.gif b/phpBB/styles/prosilver/theme/images/forum_read.gif Binary files differindex 82ceee0784..82ceee0784 100644 --- a/phpBB/styles/prosilver/imageset/forum_read.gif +++ b/phpBB/styles/prosilver/theme/images/forum_read.gif diff --git a/phpBB/styles/prosilver/imageset/forum_read_locked.gif b/phpBB/styles/prosilver/theme/images/forum_read_locked.gif Binary files differindex 450bf28c3c..450bf28c3c 100644 --- a/phpBB/styles/prosilver/imageset/forum_read_locked.gif +++ b/phpBB/styles/prosilver/theme/images/forum_read_locked.gif diff --git a/phpBB/styles/prosilver/imageset/forum_read_subforum.gif b/phpBB/styles/prosilver/theme/images/forum_read_subforum.gif Binary files differindex 5e97bc94ce..5e97bc94ce 100644 --- a/phpBB/styles/prosilver/imageset/forum_read_subforum.gif +++ b/phpBB/styles/prosilver/theme/images/forum_read_subforum.gif diff --git a/phpBB/styles/prosilver/imageset/forum_unread.gif b/phpBB/styles/prosilver/theme/images/forum_unread.gif Binary files differindex 5a305d2470..5a305d2470 100644 --- a/phpBB/styles/prosilver/imageset/forum_unread.gif +++ b/phpBB/styles/prosilver/theme/images/forum_unread.gif diff --git a/phpBB/styles/prosilver/imageset/forum_unread_locked.gif b/phpBB/styles/prosilver/theme/images/forum_unread_locked.gif Binary files differindex 34f1d46ad7..34f1d46ad7 100644 --- a/phpBB/styles/prosilver/imageset/forum_unread_locked.gif +++ b/phpBB/styles/prosilver/theme/images/forum_unread_locked.gif diff --git a/phpBB/styles/prosilver/imageset/forum_unread_subforum.gif b/phpBB/styles/prosilver/theme/images/forum_unread_subforum.gif Binary files differindex 5ddd1b2cba..5ddd1b2cba 100644 --- a/phpBB/styles/prosilver/imageset/forum_unread_subforum.gif +++ b/phpBB/styles/prosilver/theme/images/forum_unread_subforum.gif diff --git a/phpBB/styles/prosilver/imageset/icon_back_top.gif b/phpBB/styles/prosilver/theme/images/icon_back_top.gif Binary files differindex 4d2b8f3822..4d2b8f3822 100644 --- a/phpBB/styles/prosilver/imageset/icon_back_top.gif +++ b/phpBB/styles/prosilver/theme/images/icon_back_top.gif diff --git a/phpBB/styles/prosilver/imageset/icon_contact_aim.gif b/phpBB/styles/prosilver/theme/images/icon_contact_aim.gif Binary files differindex be039fcde2..be039fcde2 100644 --- a/phpBB/styles/prosilver/imageset/icon_contact_aim.gif +++ b/phpBB/styles/prosilver/theme/images/icon_contact_aim.gif diff --git a/phpBB/styles/prosilver/imageset/icon_contact_email.gif b/phpBB/styles/prosilver/theme/images/icon_contact_email.gif Binary files differindex caa3683005..caa3683005 100644 --- a/phpBB/styles/prosilver/imageset/icon_contact_email.gif +++ b/phpBB/styles/prosilver/theme/images/icon_contact_email.gif diff --git a/phpBB/styles/prosilver/imageset/icon_contact_icq.gif b/phpBB/styles/prosilver/theme/images/icon_contact_icq.gif Binary files differindex 48a09373eb..48a09373eb 100644 --- a/phpBB/styles/prosilver/imageset/icon_contact_icq.gif +++ b/phpBB/styles/prosilver/theme/images/icon_contact_icq.gif diff --git a/phpBB/styles/prosilver/imageset/icon_contact_jabber.gif b/phpBB/styles/prosilver/theme/images/icon_contact_jabber.gif Binary files differindex e335433e97..e335433e97 100644 --- a/phpBB/styles/prosilver/imageset/icon_contact_jabber.gif +++ b/phpBB/styles/prosilver/theme/images/icon_contact_jabber.gif diff --git a/phpBB/styles/prosilver/imageset/icon_contact_msnm.gif b/phpBB/styles/prosilver/theme/images/icon_contact_msnm.gif Binary files differindex e25469c3a5..e25469c3a5 100644 --- a/phpBB/styles/prosilver/imageset/icon_contact_msnm.gif +++ b/phpBB/styles/prosilver/theme/images/icon_contact_msnm.gif diff --git a/phpBB/styles/prosilver/imageset/icon_contact_www.gif b/phpBB/styles/prosilver/theme/images/icon_contact_www.gif Binary files differindex 83cee9728d..83cee9728d 100644 --- a/phpBB/styles/prosilver/imageset/icon_contact_www.gif +++ b/phpBB/styles/prosilver/theme/images/icon_contact_www.gif diff --git a/phpBB/styles/prosilver/imageset/icon_contact_yahoo.gif b/phpBB/styles/prosilver/theme/images/icon_contact_yahoo.gif Binary files differindex 305f297fdb..305f297fdb 100644 --- a/phpBB/styles/prosilver/imageset/icon_contact_yahoo.gif +++ b/phpBB/styles/prosilver/theme/images/icon_contact_yahoo.gif diff --git a/phpBB/styles/prosilver/imageset/icon_offline.gif b/phpBB/styles/prosilver/theme/images/icon_offline.gif Binary files differindex c5e41a41db..c5e41a41db 100644 --- a/phpBB/styles/prosilver/imageset/icon_offline.gif +++ b/phpBB/styles/prosilver/theme/images/icon_offline.gif diff --git a/phpBB/styles/prosilver/imageset/icon_online.gif b/phpBB/styles/prosilver/theme/images/icon_online.gif Binary files differindex 18e43cd0c6..18e43cd0c6 100644 --- a/phpBB/styles/prosilver/imageset/icon_online.gif +++ b/phpBB/styles/prosilver/theme/images/icon_online.gif diff --git a/phpBB/styles/prosilver/imageset/icon_post_delete.gif b/phpBB/styles/prosilver/theme/images/icon_post_delete.gif Binary files differindex f51ffc24a6..f51ffc24a6 100644 --- a/phpBB/styles/prosilver/imageset/icon_post_delete.gif +++ b/phpBB/styles/prosilver/theme/images/icon_post_delete.gif diff --git a/phpBB/styles/prosilver/imageset/icon_post_info.gif b/phpBB/styles/prosilver/theme/images/icon_post_info.gif Binary files differindex af089d8656..af089d8656 100644 --- a/phpBB/styles/prosilver/imageset/icon_post_info.gif +++ b/phpBB/styles/prosilver/theme/images/icon_post_info.gif diff --git a/phpBB/styles/prosilver/imageset/icon_post_report.gif b/phpBB/styles/prosilver/theme/images/icon_post_report.gif Binary files differindex 72c6ae89d0..72c6ae89d0 100644 --- a/phpBB/styles/prosilver/imageset/icon_post_report.gif +++ b/phpBB/styles/prosilver/theme/images/icon_post_report.gif diff --git a/phpBB/styles/prosilver/imageset/icon_post_target.gif b/phpBB/styles/prosilver/theme/images/icon_post_target.gif Binary files differindex a29dbffa35..a29dbffa35 100644 --- a/phpBB/styles/prosilver/imageset/icon_post_target.gif +++ b/phpBB/styles/prosilver/theme/images/icon_post_target.gif diff --git a/phpBB/styles/prosilver/imageset/icon_post_target_unread.gif b/phpBB/styles/prosilver/theme/images/icon_post_target_unread.gif Binary files differindex e97eeb2b2e..e97eeb2b2e 100644 --- a/phpBB/styles/prosilver/imageset/icon_post_target_unread.gif +++ b/phpBB/styles/prosilver/theme/images/icon_post_target_unread.gif diff --git a/phpBB/styles/prosilver/imageset/icon_rate_bad.gif b/phpBB/styles/prosilver/theme/images/icon_rate_bad.gif Binary files differindex 7901889408..7901889408 100644 --- a/phpBB/styles/prosilver/imageset/icon_rate_bad.gif +++ b/phpBB/styles/prosilver/theme/images/icon_rate_bad.gif diff --git a/phpBB/styles/prosilver/imageset/icon_rate_good.gif b/phpBB/styles/prosilver/theme/images/icon_rate_good.gif Binary files differindex 6d23034d71..6d23034d71 100644 --- a/phpBB/styles/prosilver/imageset/icon_rate_good.gif +++ b/phpBB/styles/prosilver/theme/images/icon_rate_good.gif diff --git a/phpBB/styles/prosilver/imageset/icon_topic_attach.gif b/phpBB/styles/prosilver/theme/images/icon_topic_attach.gif Binary files differindex 9a70638650..9a70638650 100644 --- a/phpBB/styles/prosilver/imageset/icon_topic_attach.gif +++ b/phpBB/styles/prosilver/theme/images/icon_topic_attach.gif diff --git a/phpBB/styles/prosilver/imageset/icon_topic_latest.gif b/phpBB/styles/prosilver/theme/images/icon_topic_latest.gif Binary files differindex d79d31ac43..d79d31ac43 100644 --- a/phpBB/styles/prosilver/imageset/icon_topic_latest.gif +++ b/phpBB/styles/prosilver/theme/images/icon_topic_latest.gif diff --git a/phpBB/styles/prosilver/imageset/icon_topic_newest.gif b/phpBB/styles/prosilver/theme/images/icon_topic_newest.gif Binary files differindex 0aa19884b5..0aa19884b5 100644 --- a/phpBB/styles/prosilver/imageset/icon_topic_newest.gif +++ b/phpBB/styles/prosilver/theme/images/icon_topic_newest.gif diff --git a/phpBB/styles/prosilver/imageset/icon_topic_reported.gif b/phpBB/styles/prosilver/theme/images/icon_topic_reported.gif Binary files differindex 006b1e2291..006b1e2291 100644 --- a/phpBB/styles/prosilver/imageset/icon_topic_reported.gif +++ b/phpBB/styles/prosilver/theme/images/icon_topic_reported.gif diff --git a/phpBB/styles/prosilver/imageset/icon_topic_unapproved.gif b/phpBB/styles/prosilver/theme/images/icon_topic_unapproved.gif Binary files differindex 09d8f387a7..09d8f387a7 100644 --- a/phpBB/styles/prosilver/imageset/icon_topic_unapproved.gif +++ b/phpBB/styles/prosilver/theme/images/icon_topic_unapproved.gif diff --git a/phpBB/styles/prosilver/imageset/icon_user_warn.gif b/phpBB/styles/prosilver/theme/images/icon_user_warn.gif Binary files differindex 9c4ad98e5c..9c4ad98e5c 100644 --- a/phpBB/styles/prosilver/imageset/icon_user_warn.gif +++ b/phpBB/styles/prosilver/theme/images/icon_user_warn.gif diff --git a/phpBB/styles/prosilver/imageset/site_logo.gif b/phpBB/styles/prosilver/theme/images/site_logo.gif Binary files differindex 2517fbedd6..2517fbedd6 100644 --- a/phpBB/styles/prosilver/imageset/site_logo.gif +++ b/phpBB/styles/prosilver/theme/images/site_logo.gif diff --git a/phpBB/styles/prosilver/imageset/sticky_read.gif b/phpBB/styles/prosilver/theme/images/sticky_read.gif Binary files differindex 59e42833db..59e42833db 100644 --- a/phpBB/styles/prosilver/imageset/sticky_read.gif +++ b/phpBB/styles/prosilver/theme/images/sticky_read.gif diff --git a/phpBB/styles/prosilver/imageset/sticky_read_locked.gif b/phpBB/styles/prosilver/theme/images/sticky_read_locked.gif Binary files differindex 79f581be79..79f581be79 100644 --- a/phpBB/styles/prosilver/imageset/sticky_read_locked.gif +++ b/phpBB/styles/prosilver/theme/images/sticky_read_locked.gif diff --git a/phpBB/styles/prosilver/imageset/sticky_read_locked_mine.gif b/phpBB/styles/prosilver/theme/images/sticky_read_locked_mine.gif Binary files differindex ad056086e5..ad056086e5 100644 --- a/phpBB/styles/prosilver/imageset/sticky_read_locked_mine.gif +++ b/phpBB/styles/prosilver/theme/images/sticky_read_locked_mine.gif diff --git a/phpBB/styles/prosilver/imageset/sticky_read_mine.gif b/phpBB/styles/prosilver/theme/images/sticky_read_mine.gif Binary files differindex 49e8b3f01c..49e8b3f01c 100644 --- a/phpBB/styles/prosilver/imageset/sticky_read_mine.gif +++ b/phpBB/styles/prosilver/theme/images/sticky_read_mine.gif diff --git a/phpBB/styles/prosilver/imageset/sticky_unread.gif b/phpBB/styles/prosilver/theme/images/sticky_unread.gif Binary files differindex ae6d5954b1..ae6d5954b1 100644 --- a/phpBB/styles/prosilver/imageset/sticky_unread.gif +++ b/phpBB/styles/prosilver/theme/images/sticky_unread.gif diff --git a/phpBB/styles/prosilver/imageset/sticky_unread_locked.gif b/phpBB/styles/prosilver/theme/images/sticky_unread_locked.gif Binary files differindex 5792b8649a..5792b8649a 100644 --- a/phpBB/styles/prosilver/imageset/sticky_unread_locked.gif +++ b/phpBB/styles/prosilver/theme/images/sticky_unread_locked.gif diff --git a/phpBB/styles/prosilver/imageset/sticky_unread_locked_mine.gif b/phpBB/styles/prosilver/theme/images/sticky_unread_locked_mine.gif Binary files differindex 93495770c8..93495770c8 100644 --- a/phpBB/styles/prosilver/imageset/sticky_unread_locked_mine.gif +++ b/phpBB/styles/prosilver/theme/images/sticky_unread_locked_mine.gif diff --git a/phpBB/styles/prosilver/imageset/sticky_unread_mine.gif b/phpBB/styles/prosilver/theme/images/sticky_unread_mine.gif Binary files differindex 2580ca0518..2580ca0518 100644 --- a/phpBB/styles/prosilver/imageset/sticky_unread_mine.gif +++ b/phpBB/styles/prosilver/theme/images/sticky_unread_mine.gif diff --git a/phpBB/styles/prosilver/imageset/subforum_read.gif b/phpBB/styles/prosilver/theme/images/subforum_read.gif Binary files differindex 595595c296..595595c296 100644 --- a/phpBB/styles/prosilver/imageset/subforum_read.gif +++ b/phpBB/styles/prosilver/theme/images/subforum_read.gif diff --git a/phpBB/styles/prosilver/imageset/subforum_unread.gif b/phpBB/styles/prosilver/theme/images/subforum_unread.gif Binary files differindex b2b661dc78..b2b661dc78 100644 --- a/phpBB/styles/prosilver/imageset/subforum_unread.gif +++ b/phpBB/styles/prosilver/theme/images/subforum_unread.gif diff --git a/phpBB/styles/prosilver/imageset/topic_moved.gif b/phpBB/styles/prosilver/theme/images/topic_moved.gif Binary files differindex 3275cd6ef9..3275cd6ef9 100644 --- a/phpBB/styles/prosilver/imageset/topic_moved.gif +++ b/phpBB/styles/prosilver/theme/images/topic_moved.gif diff --git a/phpBB/styles/prosilver/imageset/topic_read.gif b/phpBB/styles/prosilver/theme/images/topic_read.gif Binary files differindex 0347ffc1e9..0347ffc1e9 100644 --- a/phpBB/styles/prosilver/imageset/topic_read.gif +++ b/phpBB/styles/prosilver/theme/images/topic_read.gif diff --git a/phpBB/styles/prosilver/imageset/topic_read_hot.gif b/phpBB/styles/prosilver/theme/images/topic_read_hot.gif Binary files differindex dcb6f3bd60..dcb6f3bd60 100644 --- a/phpBB/styles/prosilver/imageset/topic_read_hot.gif +++ b/phpBB/styles/prosilver/theme/images/topic_read_hot.gif diff --git a/phpBB/styles/prosilver/imageset/topic_read_hot_mine.gif b/phpBB/styles/prosilver/theme/images/topic_read_hot_mine.gif Binary files differindex 1e5498a9be..1e5498a9be 100644 --- a/phpBB/styles/prosilver/imageset/topic_read_hot_mine.gif +++ b/phpBB/styles/prosilver/theme/images/topic_read_hot_mine.gif diff --git a/phpBB/styles/prosilver/imageset/topic_read_locked.gif b/phpBB/styles/prosilver/theme/images/topic_read_locked.gif Binary files differindex 83bc8bd02f..83bc8bd02f 100644 --- a/phpBB/styles/prosilver/imageset/topic_read_locked.gif +++ b/phpBB/styles/prosilver/theme/images/topic_read_locked.gif diff --git a/phpBB/styles/prosilver/imageset/topic_read_locked_mine.gif b/phpBB/styles/prosilver/theme/images/topic_read_locked_mine.gif Binary files differindex 360f9d989a..360f9d989a 100644 --- a/phpBB/styles/prosilver/imageset/topic_read_locked_mine.gif +++ b/phpBB/styles/prosilver/theme/images/topic_read_locked_mine.gif diff --git a/phpBB/styles/prosilver/imageset/topic_read_mine.gif b/phpBB/styles/prosilver/theme/images/topic_read_mine.gif Binary files differindex 4972a4e0a5..4972a4e0a5 100644 --- a/phpBB/styles/prosilver/imageset/topic_read_mine.gif +++ b/phpBB/styles/prosilver/theme/images/topic_read_mine.gif diff --git a/phpBB/styles/prosilver/imageset/topic_unread.gif b/phpBB/styles/prosilver/theme/images/topic_unread.gif Binary files differindex 542a998258..542a998258 100644 --- a/phpBB/styles/prosilver/imageset/topic_unread.gif +++ b/phpBB/styles/prosilver/theme/images/topic_unread.gif diff --git a/phpBB/styles/prosilver/imageset/topic_unread_hot.gif b/phpBB/styles/prosilver/theme/images/topic_unread_hot.gif Binary files differindex e712f6e827..e712f6e827 100644 --- a/phpBB/styles/prosilver/imageset/topic_unread_hot.gif +++ b/phpBB/styles/prosilver/theme/images/topic_unread_hot.gif diff --git a/phpBB/styles/prosilver/imageset/topic_unread_hot_mine.gif b/phpBB/styles/prosilver/theme/images/topic_unread_hot_mine.gif Binary files differindex fa8b167c64..fa8b167c64 100644 --- a/phpBB/styles/prosilver/imageset/topic_unread_hot_mine.gif +++ b/phpBB/styles/prosilver/theme/images/topic_unread_hot_mine.gif diff --git a/phpBB/styles/prosilver/imageset/topic_unread_locked.gif b/phpBB/styles/prosilver/theme/images/topic_unread_locked.gif Binary files differindex 4fb8fa9517..4fb8fa9517 100644 --- a/phpBB/styles/prosilver/imageset/topic_unread_locked.gif +++ b/phpBB/styles/prosilver/theme/images/topic_unread_locked.gif diff --git a/phpBB/styles/prosilver/imageset/topic_unread_locked_mine.gif b/phpBB/styles/prosilver/theme/images/topic_unread_locked_mine.gif Binary files differindex 4ee6cfe423..4ee6cfe423 100644 --- a/phpBB/styles/prosilver/imageset/topic_unread_locked_mine.gif +++ b/phpBB/styles/prosilver/theme/images/topic_unread_locked_mine.gif diff --git a/phpBB/styles/prosilver/imageset/topic_unread_mine.gif b/phpBB/styles/prosilver/theme/images/topic_unread_mine.gif Binary files differindex e73da38df7..e73da38df7 100644 --- a/phpBB/styles/prosilver/imageset/topic_unread_mine.gif +++ b/phpBB/styles/prosilver/theme/images/topic_unread_mine.gif diff --git a/phpBB/styles/prosilver/theme/imageset.css b/phpBB/styles/prosilver/theme/imageset.css new file mode 100644 index 0000000000..cebab7845d --- /dev/null +++ b/phpBB/styles/prosilver/theme/imageset.css @@ -0,0 +1,406 @@ +/* Former imageset */ +span.imageset { + display: inline-block !important; + background: transparent none 0 0 no-repeat; + margin: 0; + padding: 0; + padding-right: 0 !important; + 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.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 { + 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.icon_contact_msnm { + background-image: url("./images/icon_contact_msnm.gif"); + padding-left: 20px; + padding-top: 20px; +} +.imageset.icon_contact_www { + background-image: url("./images/icon_contact_www.gif"); + padding-left: 20px; + padding-top: 20px; +} +.imageset.icon_contact_yahoo { + 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_unapproved { + background-image: url("./images/icon_topic_unapproved.gif"); + padding-left: 16px; + padding-top: 14px; +} +.imageset.icon_user_warn { + background-image: url("./images/icon_user_warn.gif"); + padding-left: 20px; + padding-top: 20px; +} + + +/* English images for fallback */ +.imageset.icon_contact_pm { + background-image: url("./en/icon_contact_pm.gif"); + padding-left: 28px; + padding-top: 20px; +} +.imageset.icon_post_edit { + background-image: url("./en/icon_post_edit.gif"); + padding-left: 42px; + padding-top: 20px; +} +.imageset.icon_post_quote { + background-image: url("./en/icon_post_quote.gif"); + padding-left: 54px; + padding-top: 20px; +} +.imageset.icon_user_online { + background-image: url("./en/icon_user_online.gif"); + padding-left: 58px; + padding-top: 58px; +} +.imageset.button_pm_forward { + background-image: url("./en/button_pm_forward.gif"); + padding-left: 96px; + padding-top: 25px; +} +.imageset.button_pm_new { + background-image: url("./en/button_pm_new.gif"); + padding-left: 84px; + padding-top: 25px; +} +.imageset.button_pm_reply { + background-image: url("./en/button_pm_reply.gif"); + padding-left: 96px; + padding-top: 25px; +} +.imageset.button_topic_locked { + background-image: url("./en/button_topic_locked.gif"); + padding-left: 88px; + padding-top: 25px; +} +.imageset.button_topic_new { + background-image: url("./en/button_topic_new.gif"); + padding-left: 96px; + padding-top: 25px; +} +.imageset.button_topic_reply { + background-image: url("./en/button_topic_reply.gif"); + padding-left: 96px; + padding-top: 25px; +} diff --git a/phpBB/styles/prosilver/theme/links.css b/phpBB/styles/prosilver/theme/links.css index 1f6c2af550..f3b718da61 100644 --- a/phpBB/styles/prosilver/theme/links.css +++ b/phpBB/styles/prosilver/theme/links.css @@ -148,8 +148,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; diff --git a/phpBB/styles/prosilver/theme/stylesheet.css b/phpBB/styles/prosilver/theme/stylesheet.css index c7db605bbb..3c0223507a 100644 --- a/phpBB/styles/prosilver/theme/stylesheet.css +++ b/phpBB/styles/prosilver/theme/stylesheet.css @@ -17,3 +17,4 @@ @import url("forms.css"); @import url("tweaks.css"); @import url("colours.css"); +@import url("imageset.css");
\ No newline at end of file diff --git a/phpBB/styles/prosilver/theme/theme.cfg b/phpBB/styles/prosilver/theme/theme.cfg index 4f23159d8c..e27ba1c3a6 100644 --- a/phpBB/styles/prosilver/theme/theme.cfg +++ b/phpBB/styles/prosilver/theme/theme.cfg @@ -14,22 +14,8 @@ # 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 = © phpBB Group, 2007 version = 3.1.0-dev - -# 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 30fe5fb986..351d4808ba 100644 --- a/phpBB/styles/prosilver/theme/tweaks.css +++ b/phpBB/styles/prosilver/theme/tweaks.css @@ -6,8 +6,8 @@ tweaks required due to its poor CSS support. * 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"); } +* 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"); } table.table1 { width: 99%; /* IE < 6 browsers */ diff --git a/phpBB/styles/subsilver2/imageset/en/imageset.cfg b/phpBB/styles/subsilver2/imageset/en/imageset.cfg deleted file mode 100644 index c0cc699737..0000000000 --- a/phpBB/styles/subsilver2/imageset/en/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 99c34d098f..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 = © phpBB Group, 2003 -version = 3.1.0-dev - -# 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/template/attachment.html b/phpBB/styles/subsilver2/template/attachment.html index b5b547b2e6..fca620b481 100644 --- a/phpBB/styles/subsilver2/template/attachment.html +++ b/phpBB/styles/subsilver2/template/attachment.html @@ -72,7 +72,7 @@ <param name="controller" value="true"> <param name="autoplay" value="false" /> <param name="type" value="video/quicktime"> - <embed name="qtstream_{_file.ATTACH_ID}" src="{_file.U_DOWNLOAD_LINK}" pluginspage="http://www.apple.com/quicktime/download/" enablejavascript="true" controller="true" width="320" height="285" type="video/quicktime" autoplay="false"> + <embed name="qtstream_{_file.ATTACH_ID}" src="{_file.U_DOWNLOAD_LINK}" pluginspage="http://www.apple.com/quicktime/download/" enablejavascript="true" controller="true" width="320" height="285" type="video/quicktime" autoplay="false"></embed> </object> <!-- ELSEIF _file.S_RM_FILE --> <object id="rmstream_{_file.ATTACH_ID}" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="200" height="50"> diff --git a/phpBB/styles/subsilver2/template/editor.js b/phpBB/styles/subsilver2/template/editor.js index 1f0c81fb69..b47583ec75 100644 --- a/phpBB/styles/subsilver2/template/editor.js +++ b/phpBB/styles/subsilver2/template/editor.js @@ -151,8 +151,10 @@ function insert_text(text, spaces, popup) { text = ' ' + text + ' '; } - - if (!isNaN(textarea.selectionStart)) + + // 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; @@ -218,11 +220,12 @@ function addquote(post_id, username, l_wrote) } // Get text selection - not only the post content :( - if (window.getSelection) + // IE9 must use the document.selection method but has the *.getSelection so we just force no IE + if (window.getSelection && !is_ie) { theSelection = window.getSelection().toString(); } - else if (document.getSelection) + else if (document.getSelection && !is_ie) { theSelection = document.getSelection(); } diff --git a/phpBB/styles/subsilver2/template/forumlist_body.html b/phpBB/styles/subsilver2/template/forumlist_body.html index 55ae288854..334fd7a968 100644 --- a/phpBB/styles/subsilver2/template/forumlist_body.html +++ b/phpBB/styles/subsilver2/template/forumlist_body.html @@ -56,9 +56,9 @@ <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> <!-- ENDIF -->{forumrow.LAST_POST_TIME}</p> + <p class="topicdetails"><!-- IF forumrow.U_UNAPPROVED_TOPICS --><a href="{forumrow.U_UNAPPROVED_TOPICS}" class="imageset">{UNAPPROVED_IMG}</a> <!-- 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> diff --git a/phpBB/styles/subsilver2/template/mcp_forum.html b/phpBB/styles/subsilver2/template/mcp_forum.html index 10c124b0e1..5d69e85391 100644 --- a/phpBB/styles/subsilver2/template/mcp_forum.html +++ b/phpBB/styles/subsilver2/template/mcp_forum.html @@ -31,10 +31,10 @@ <!-- ENDIF --> <p class="topictitle">{NEWEST_POST_IMG} {topicrow.ATTACH_ICON_IMG} <a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a> <!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED --> - <a href="{topicrow.U_MCP_QUEUE}">{topicrow.UNAPPROVED_IMG}</a> + <a href="{topicrow.U_MCP_QUEUE}" class="imageset">{topicrow.UNAPPROVED_IMG}</a> <!-- ENDIF --> <!-- IF topicrow.S_TOPIC_REPORTED and topicrow.U_MCP_REPORT --> - <a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a> + <a href="{topicrow.U_MCP_REPORT}" class="imageset">{REPORTED_IMG}</a> <!-- ENDIF --> <!-- IF topicrow.S_MOVED_TOPIC and S_CAN_DELETE --> [ <a href="{topicrow.U_DELETE_TOPIC}">{L_DELETE_SHADOW_TOPIC}</a> ] diff --git a/phpBB/styles/subsilver2/template/mcp_move.html b/phpBB/styles/subsilver2/template/mcp_move.html index c1027cdbf3..b8958187e6 100644 --- a/phpBB/styles/subsilver2/template/mcp_move.html +++ b/phpBB/styles/subsilver2/template/mcp_move.html @@ -17,10 +17,10 @@ <span class="gen"><br />{L_SELECT_DESTINATION_FORUM} </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" checked="checked" /><span class="gen">{L_LOCK_TOPIC}</span><br /> + <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" /> <input type="submit" name="cancel" value="{L_NO}" class="btnlite" /> diff --git a/phpBB/styles/subsilver2/template/mcp_post.html b/phpBB/styles/subsilver2/template/mcp_post.html index 771b1bc9e1..24d8682876 100644 --- a/phpBB/styles/subsilver2/template/mcp_post.html +++ b/phpBB/styles/subsilver2/template/mcp_post.html @@ -98,7 +98,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> @@ -173,7 +173,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"> diff --git a/phpBB/styles/subsilver2/template/mcp_topic.html b/phpBB/styles/subsilver2/template/mcp_topic.html index 13865d26ee..83c95c4ff9 100644 --- a/phpBB/styles/subsilver2/template/mcp_topic.html +++ b/phpBB/styles/subsilver2/template/mcp_topic.html @@ -79,7 +79,7 @@ </tr> </table> </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 --> diff --git a/phpBB/styles/subsilver2/template/mcp_viewlogs.html b/phpBB/styles/subsilver2/template/mcp_viewlogs.html deleted file mode 100644 index 64e51ba498..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} <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></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 --> diff --git a/phpBB/styles/subsilver2/template/memberlist_body.html b/phpBB/styles/subsilver2/template/memberlist_body.html index 78ffe49111..4c7af75ae5 100644 --- a/phpBB/styles/subsilver2/template/memberlist_body.html +++ b/phpBB/styles/subsilver2/template/memberlist_body.html @@ -70,9 +70,9 @@ <td class="genmed" align="center" nowrap="nowrap"> {memberrow.JOINED} </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"> <!-- IF memberrow.U_PM --><a href="{memberrow.U_PM}">{PM_IMG}</a><!-- ENDIF --> </td> - <td class="gen" align="center"> <!-- IF memberrow.U_EMAIL --><a href="{memberrow.U_EMAIL}">{EMAIL_IMG}</a><!-- ENDIF --> </td> - <td class="gen" align="center"> <!-- IF memberrow.U_WWW --><a href="{memberrow.U_WWW}">{WWW_IMG}</a><!-- ENDIF --> </td> + <td class="gen" align="center"> <!-- IF memberrow.U_PM --><a href="{memberrow.U_PM}" class="imageset">{PM_IMG}</a><!-- ENDIF --> </td> + <td class="gen" align="center"> <!-- IF memberrow.U_EMAIL --><a href="{memberrow.U_EMAIL}" class="imageset">{EMAIL_IMG}</a><!-- ENDIF --> </td> + <td class="gen" align="center"> <!-- IF memberrow.U_WWW --><a href="{memberrow.U_WWW}" class="imageset">{WWW_IMG}</a><!-- ENDIF --> </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"> {memberrow.PROFILE_FIELD1_VALUE}</td> diff --git a/phpBB/styles/subsilver2/template/memberlist_group.html b/phpBB/styles/subsilver2/template/memberlist_group.html index 650868f810..f48b9811f0 100644 --- a/phpBB/styles/subsilver2/template/memberlist_group.html +++ b/phpBB/styles/subsilver2/template/memberlist_group.html @@ -7,7 +7,7 @@ <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> <!-- 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> diff --git a/phpBB/styles/subsilver2/template/memberlist_leaders.html b/phpBB/styles/subsilver2/template/memberlist_leaders.html index 75fff9f98a..a4f38aafc4 100644 --- a/phpBB/styles/subsilver2/template/memberlist_leaders.html +++ b/phpBB/styles/subsilver2/template/memberlist_leaders.html @@ -27,7 +27,7 @@ <!-- ENDIF --> </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"> <!-- IF group.user.U_PM --><a href="{group.user.U_PM}">{PM_IMG}</a><!-- ENDIF --> </td> + <td class="gen" align="center"> <!-- IF group.user.U_PM --><a href="{group.user.U_PM}" class="imageset">{PM_IMG}</a><!-- ENDIF --> </td> </tr> <!-- BEGINELSE --> <tr> diff --git a/phpBB/styles/subsilver2/template/memberlist_view.html b/phpBB/styles/subsilver2/template/memberlist_view.html index c24c93a8fa..5d866214ce 100644 --- a/phpBB/styles/subsilver2/template/memberlist_view.html +++ b/phpBB/styles/subsilver2/template/memberlist_view.html @@ -89,11 +89,11 @@ <!-- IF S_SHOW_ACTIVITY --> <tr> <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_ACTIVE_IN_FORUM}: </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> + <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><!-- 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> + <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 --> </table> @@ -108,33 +108,33 @@ <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 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><a href="{U_PM}" class="imageset">{PM_IMG}</a></td> </tr> <!-- ENDIF --> <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> + <td><!-- IF U_MSN --><a href="{U_MSN}" onclick="popup(this.href, 550, 320); return false" class="imageset">{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> + <td><!-- IF U_YIM --><a href="{U_YIM}" onclick="popup(this.href, 780, 550); return false" class="imageset">{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> + <td><!-- IF U_AIM --><a href="{U_AIM}" onclick="popup(this.href, 550, 320); return false" class="imageset">{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> + <td><!-- IF U_ICQ --><a href="{U_ICQ}" onclick="popup(this.href, 550, 320); return false" class="imageset">{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><!-- 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> </table> </td> @@ -148,10 +148,10 @@ <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 --> + <!-- IF AGE !== '' --> <tr> <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_AGE}: </td> - <td><b class="genmed"><!-- IF AGE -->{AGE}<!-- ELSE --> - <!-- ENDIF --></b></td> + <td><b class="genmed">{AGE}</b></td> </tr> <!-- ENDIF --> <tr> diff --git a/phpBB/styles/subsilver2/template/overall_footer.html b/phpBB/styles/subsilver2/template/overall_footer.html index 4494ed83bf..3cdd071211 100644 --- a/phpBB/styles/subsilver2/template/overall_footer.html +++ b/phpBB/styles/subsilver2/template/overall_footer.html @@ -8,5 +8,7 @@ <!-- IF DEBUG_OUTPUT --><br /><bdo dir="ltr">[ {DEBUG_OUTPUT} ]</bdo><!-- ENDIF --></span> </div> +<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/jquery.js"></script> + </body> </html> diff --git a/phpBB/styles/subsilver2/template/overall_header.html b/phpBB/styles/subsilver2/template/overall_header.html index 4fca1b6c09..5d5489338a 100644 --- a/phpBB/styles/subsilver2/template/overall_header.html +++ b/phpBB/styles/subsilver2/template/overall_header.html @@ -18,6 +18,7 @@ <!-- 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[ @@ -142,7 +143,7 @@ function marklist(id, name, state) <div id="logodesc"> <table width="100%" cellspacing="0"> <tr> - <td><a href="{U_INDEX}">{SITE_LOGO_IMG}</a></td> + <td><a href="{U_INDEX}" class="imageset">{SITE_LOGO_IMG}</a></td> <td width="100%" align="center"><h1>{SITENAME}</h1><span class="gen">{SITE_DESCRIPTION}</span></td> </tr> </table> diff --git a/phpBB/styles/subsilver2/template/posting_review.html b/phpBB/styles/subsilver2/template/posting_review.html index 1647ef595e..87266da44c 100644 --- a/phpBB/styles/subsilver2/template/posting_review.html +++ b/phpBB/styles/subsilver2/template/posting_review.html @@ -77,7 +77,7 @@ <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr valign="middle"> <td width="100%"> </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 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}:</b> {post_review_row.POST_DATE}</td> </tr> </table> diff --git a/phpBB/styles/subsilver2/template/posting_topic_review.html b/phpBB/styles/subsilver2/template/posting_topic_review.html index a4365532d4..2bfa95f3d4 100644 --- a/phpBB/styles/subsilver2/template/posting_topic_review.html +++ b/phpBB/styles/subsilver2/template/posting_topic_review.html @@ -36,7 +36,7 @@ <td> </td> <td class="gensmall" valign="middle" nowrap="nowrap"><b>{L_POST_SUBJECT}:</b> </td> <td class="gensmall" width="100%" valign="middle">{topic_review_row.POST_SUBJECT}</td> - <td valign="top" nowrap="nowrap"> <!-- 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"> <!-- 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> @@ -81,7 +81,7 @@ <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 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}:</b> {topic_review_row.POST_DATE}</td> </tr> </table> diff --git a/phpBB/styles/subsilver2/template/search_results.html b/phpBB/styles/subsilver2/template/search_results.html index 282b0f864b..d8a1879ca7 100644 --- a/phpBB/styles/subsilver2/template/search_results.html +++ b/phpBB/styles/subsilver2/template/search_results.html @@ -34,13 +34,13 @@ <!-- ENDIF --> </td> <td class="row1"> - <!-- IF searchresults.S_UNREAD_TOPIC --><a href="{searchresults.U_NEWEST_POST}">{NEWEST_POST_IMG}</a><!-- ENDIF --> + <!-- 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> + <a href="{searchresults.U_MCP_QUEUE}" class="imageset">{searchresults.UNAPPROVED_IMG}</a> <!-- ENDIF --> <!-- IF searchresults.S_TOPIC_REPORTED --> - <a href="{searchresults.U_MCP_REPORT}">{REPORTED_IMG}</a> + <a href="{searchresults.U_MCP_REPORT}" class="imageset">{REPORTED_IMG}</a> <!-- ENDIF --> <!-- IF searchresults.PAGINATION --> <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}: {searchresults.PAGINATION} ] </p> @@ -53,7 +53,7 @@ <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> diff --git a/phpBB/styles/subsilver2/template/simple_footer.html b/phpBB/styles/subsilver2/template/simple_footer.html index e2469c4ed4..f03d1094f2 100644 --- a/phpBB/styles/subsilver2/template/simple_footer.html +++ b/phpBB/styles/subsilver2/template/simple_footer.html @@ -5,5 +5,7 @@ <span class="copyright">Powered by <a href="http://www.phpbb.com/">phpBB</a>® Forum Software © phpBB Group</span> </div> +<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/jquery.js"></script> + </body> </html> diff --git a/phpBB/styles/subsilver2/template/simple_header.html b/phpBB/styles/subsilver2/template/simple_header.html index 79236434f2..43ca16ed87 100644 --- a/phpBB/styles/subsilver2/template/simple_header.html +++ b/phpBB/styles/subsilver2/template/simple_header.html @@ -8,6 +8,7 @@ <title>{SITENAME} • <!-- IF S_IN_MCP -->{L_MCP} • <!-- ELSEIF S_IN_UCP -->{L_UCP} • <!-- 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" /> </head> <body class="{S_CONTENT_DIRECTION}"> diff --git a/phpBB/styles/subsilver2/template/ucp_main_subscribed.html b/phpBB/styles/subsilver2/template/ucp_main_subscribed.html index 43f98a4334..42a452549b 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,7 +50,7 @@ <!-- 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> + <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}: </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> @@ -59,7 +59,7 @@ <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> diff --git a/phpBB/styles/subsilver2/template/ucp_pm_history.html b/phpBB/styles/subsilver2/template/ucp_pm_history.html index 8754acaaa2..f24474e85c 100644 --- a/phpBB/styles/subsilver2/template/ucp_pm_history.html +++ b/phpBB/styles/subsilver2/template/ucp_pm_history.html @@ -59,7 +59,7 @@ <!-- 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};"> <!-- 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 --> </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 --> </div></td> + <td><div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};"> <!-- 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 --> </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 --> 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 --> </div></td> </tr> <tr> <td class="spacer" colspan="2"><img src="images/spacer.gif" alt="" width="1" height="1" /></td> diff --git a/phpBB/styles/subsilver2/template/ucp_pm_viewfolder.html b/phpBB/styles/subsilver2/template/ucp_pm_viewfolder.html index f0b076edb2..64c923e72c 100644 --- a/phpBB/styles/subsilver2/template/ucp_pm_viewfolder.html +++ b/phpBB/styles/subsilver2/template/ucp_pm_viewfolder.html @@ -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> + <a href="{messagerow.U_MCP_REPORT}" class="imageset">{REPORTED_IMG}</a> <!-- 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..faaa3f9593 100644 --- a/phpBB/styles/subsilver2/template/ucp_pm_viewmessage.html +++ b/phpBB/styles/subsilver2/template/ucp_pm_viewmessage.html @@ -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,7 @@ </tr> <tr class="row1"> - <td><div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};"> <!-- IF U_MESSAGE_AUTHOR --><a href="{U_MESSAGE_AUTHOR}">{PROFILE_IMG}</a> <!-- ENDIF --> <!-- IF U_EMAIL --><a href="{U_EMAIL}">{EMAIL_IMG}</a> <!-- ENDIF --> </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 --> </div></td> + <td><div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};"> <!-- 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 --> </div> <div class="gensmall" style="float: {S_CONTENT_FLOW_END};"><!-- 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 --> </div></td> </tr> <tr> diff --git a/phpBB/styles/subsilver2/template/viewforum_body.html b/phpBB/styles/subsilver2/template/viewforum_body.html index 5c20b84541..f132185716 100644 --- a/phpBB/styles/subsilver2/template/viewforum_body.html +++ b/phpBB/styles/subsilver2/template/viewforum_body.html @@ -40,13 +40,13 @@ <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 --> + <!-- 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}: {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> + <a href="{topicrow.U_MCP_QUEUE}" class="imageset">{UNAPPROVED_IMG}</a> <!-- ENDIF --> <!-- IF topicrow.S_TOPIC_REPORTED --> - <a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a> + <a href="{topicrow.U_MCP_REPORT}" class="imageset">{REPORTED_IMG}</a> <!-- ENDIF --> <!-- IF topicrow.PAGINATION --> <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}: {topicrow.PAGINATION} ] </p> @@ -58,7 +58,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> @@ -137,7 +137,7 @@ <table width="100%" cellspacing="1"> <tr> <!-- 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> + <td align="{S_CONTENT_FLOW_BEGIN}" valign="middle"><a href="{U_POST_NEW_TOPIC}" class="imageset">{POST_IMG}</a></td> <!-- ENDIF --> <!-- IF TOTAL_TOPICS --> <td class="nav" valign="middle" nowrap="nowrap"> {PAGE_NUMBER}<br /></td> @@ -191,13 +191,13 @@ <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 --> + <!-- 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}: {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> + <a href="{topicrow.U_MCP_QUEUE}" class="imageset">{topicrow.UNAPPROVED_IMG}</a> <!-- ENDIF --> <!-- IF topicrow.S_TOPIC_REPORTED --> - <a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a> + <a href="{topicrow.U_MCP_REPORT}" class="imageset">{REPORTED_IMG}</a> <!-- ENDIF --> <!-- IF topicrow.PAGINATION --> <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}: {topicrow.PAGINATION} ] </p> @@ -210,7 +210,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> @@ -245,7 +245,7 @@ <table width="100%" cellspacing="1"> <tr> <!-- 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> + <td align="{S_CONTENT_FLOW_BEGIN}" valign="middle"><a href="{U_POST_NEW_TOPIC}" class="imageset">{POST_IMG}</a></td> <!-- ENDIF --> <!-- IF TOTAL_TOPICS --> <td class="nav" valign="middle" nowrap="nowrap"> {PAGE_NUMBER}<br /></td> diff --git a/phpBB/styles/subsilver2/template/viewtopic_body.html b/phpBB/styles/subsilver2/template/viewtopic_body.html index 56e03e344c..b8387482bf 100644 --- a/phpBB/styles/subsilver2/template/viewtopic_body.html +++ b/phpBB/styles/subsilver2/template/viewtopic_body.html @@ -33,8 +33,8 @@ <tr> <td align="{S_CONTENT_FLOW_BEGIN}" valign="middle" nowrap="nowrap"> <!-- IF not S_IS_BOT --> - <!-- IF S_DISPLAY_POST_INFO --><a href="{U_POST_NEW_TOPIC}">{POST_IMG}</a> <!-- 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> <!-- ENDIF --> + <!-- IF S_DISPLAY_REPLY_INFO --><a href="{U_POST_REPLY_TOPIC}" class="imageset">{REPLY_IMG}</a><!-- ENDIF --> <!-- ENDIF --> </td> <!-- IF TOTAL_POSTS --> @@ -90,7 +90,7 @@ <!-- 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> {poll_option.POLL_OPTION_PERCENT} </b></td> <td class="gen" align="center">[ {poll_option.POLL_OPTION_RESULT} ]</td> <!-- IF poll_option.POLL_OPTION_VOTED --> @@ -150,7 +150,7 @@ <!-- 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};"> <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} </div></td> + <td class="gensmall" width="100%"><div style="float: {S_CONTENT_FLOW_BEGIN};"> <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}" class="imageset">{postrow.MINI_POST_IMG}</a><!-- ENDIF --><b>{L_POSTED}:</b> {postrow.POST_DATE} </div></td> </tr> </table> </td> @@ -268,10 +268,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> @@ -285,7 +285,7 @@ <!-- 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};"> <!-- 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 --> </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 --> </div></td> + <td><div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};"> <!-- 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 --> </div> <div class="gensmall" style="float: {S_CONTENT_FLOW_END};"><!-- 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 --> </div></td> <!-- ENDIF --> </tr> @@ -307,8 +307,8 @@ <tr> <td align="{S_CONTENT_FLOW_BEGIN}" valign="middle" nowrap="nowrap"> <!-- IF not S_IS_BOT --> - <!-- IF S_DISPLAY_POST_INFO --><a href="{U_POST_NEW_TOPIC}">{POST_IMG}</a> <!-- 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> <!-- ENDIF --> + <!-- IF S_DISPLAY_REPLY_INFO --><a href="{U_POST_REPLY_TOPIC}" class="imageset">{REPLY_IMG}</a><!-- ENDIF --> <!-- ENDIF --> </td> <!-- IF TOTAL_POSTS --> diff --git a/phpBB/styles/subsilver2/imageset/en/button_pm_new.gif b/phpBB/styles/subsilver2/theme/en/button_pm_new.gif Binary files differindex 07df748d3a..07df748d3a 100644 --- a/phpBB/styles/subsilver2/imageset/en/button_pm_new.gif +++ b/phpBB/styles/subsilver2/theme/en/button_pm_new.gif diff --git a/phpBB/styles/subsilver2/imageset/en/button_pm_reply.gif b/phpBB/styles/subsilver2/theme/en/button_pm_reply.gif Binary files differindex c476f06a44..c476f06a44 100644 --- a/phpBB/styles/subsilver2/imageset/en/button_pm_reply.gif +++ b/phpBB/styles/subsilver2/theme/en/button_pm_reply.gif diff --git a/phpBB/styles/subsilver2/imageset/en/button_topic_locked.gif b/phpBB/styles/subsilver2/theme/en/button_topic_locked.gif Binary files differindex 124a2d4a7d..124a2d4a7d 100644 --- a/phpBB/styles/subsilver2/imageset/en/button_topic_locked.gif +++ b/phpBB/styles/subsilver2/theme/en/button_topic_locked.gif diff --git a/phpBB/styles/subsilver2/imageset/en/button_topic_new.gif b/phpBB/styles/subsilver2/theme/en/button_topic_new.gif Binary files differindex 66e1007129..66e1007129 100644 --- a/phpBB/styles/subsilver2/imageset/en/button_topic_new.gif +++ b/phpBB/styles/subsilver2/theme/en/button_topic_new.gif diff --git a/phpBB/styles/subsilver2/imageset/en/button_topic_reply.gif b/phpBB/styles/subsilver2/theme/en/button_topic_reply.gif Binary files differindex e8fe5115a0..e8fe5115a0 100644 --- a/phpBB/styles/subsilver2/imageset/en/button_topic_reply.gif +++ b/phpBB/styles/subsilver2/theme/en/button_topic_reply.gif diff --git a/phpBB/styles/subsilver2/imageset/en/icon_contact_aim.gif b/phpBB/styles/subsilver2/theme/en/icon_contact_aim.gif Binary files differindex c6533e2817..c6533e2817 100644 --- a/phpBB/styles/subsilver2/imageset/en/icon_contact_aim.gif +++ b/phpBB/styles/subsilver2/theme/en/icon_contact_aim.gif diff --git a/phpBB/styles/subsilver2/imageset/en/icon_contact_email.gif b/phpBB/styles/subsilver2/theme/en/icon_contact_email.gif Binary files differindex f126a1960d..f126a1960d 100644 --- a/phpBB/styles/subsilver2/imageset/en/icon_contact_email.gif +++ b/phpBB/styles/subsilver2/theme/en/icon_contact_email.gif diff --git a/phpBB/styles/subsilver2/imageset/en/icon_contact_icq.gif b/phpBB/styles/subsilver2/theme/en/icon_contact_icq.gif Binary files differindex ba3fa12436..ba3fa12436 100644 --- a/phpBB/styles/subsilver2/imageset/en/icon_contact_icq.gif +++ b/phpBB/styles/subsilver2/theme/en/icon_contact_icq.gif diff --git a/phpBB/styles/subsilver2/imageset/en/icon_contact_jabber.gif b/phpBB/styles/subsilver2/theme/en/icon_contact_jabber.gif Binary files differindex be2e53f9c2..be2e53f9c2 100644 --- a/phpBB/styles/subsilver2/imageset/en/icon_contact_jabber.gif +++ b/phpBB/styles/subsilver2/theme/en/icon_contact_jabber.gif diff --git a/phpBB/styles/subsilver2/imageset/en/icon_contact_msnm.gif b/phpBB/styles/subsilver2/theme/en/icon_contact_msnm.gif Binary files differindex 1bf681e9a2..1bf681e9a2 100644 --- a/phpBB/styles/subsilver2/imageset/en/icon_contact_msnm.gif +++ b/phpBB/styles/subsilver2/theme/en/icon_contact_msnm.gif diff --git a/phpBB/styles/subsilver2/imageset/en/icon_contact_pm.gif b/phpBB/styles/subsilver2/theme/en/icon_contact_pm.gif Binary files differindex 26ac558c2f..26ac558c2f 100644 --- a/phpBB/styles/subsilver2/imageset/en/icon_contact_pm.gif +++ b/phpBB/styles/subsilver2/theme/en/icon_contact_pm.gif diff --git a/phpBB/styles/subsilver2/imageset/en/icon_contact_www.gif b/phpBB/styles/subsilver2/theme/en/icon_contact_www.gif Binary files differindex 14a33b36a5..14a33b36a5 100644 --- a/phpBB/styles/subsilver2/imageset/en/icon_contact_www.gif +++ b/phpBB/styles/subsilver2/theme/en/icon_contact_www.gif diff --git a/phpBB/styles/subsilver2/imageset/en/icon_contact_yahoo.gif b/phpBB/styles/subsilver2/theme/en/icon_contact_yahoo.gif Binary files differindex d11711789f..d11711789f 100644 --- a/phpBB/styles/subsilver2/imageset/en/icon_contact_yahoo.gif +++ b/phpBB/styles/subsilver2/theme/en/icon_contact_yahoo.gif diff --git a/phpBB/styles/subsilver2/imageset/en/icon_post_delete.gif b/phpBB/styles/subsilver2/theme/en/icon_post_delete.gif Binary files differindex e008e5ff9f..e008e5ff9f 100644 --- a/phpBB/styles/subsilver2/imageset/en/icon_post_delete.gif +++ b/phpBB/styles/subsilver2/theme/en/icon_post_delete.gif diff --git a/phpBB/styles/subsilver2/imageset/en/icon_post_edit.gif b/phpBB/styles/subsilver2/theme/en/icon_post_edit.gif Binary files differindex 1511ee34d3..1511ee34d3 100644 --- a/phpBB/styles/subsilver2/imageset/en/icon_post_edit.gif +++ b/phpBB/styles/subsilver2/theme/en/icon_post_edit.gif diff --git a/phpBB/styles/subsilver2/imageset/en/icon_post_info.gif b/phpBB/styles/subsilver2/theme/en/icon_post_info.gif Binary files differindex 166de2724f..166de2724f 100644 --- a/phpBB/styles/subsilver2/imageset/en/icon_post_info.gif +++ b/phpBB/styles/subsilver2/theme/en/icon_post_info.gif diff --git a/phpBB/styles/subsilver2/imageset/en/icon_post_quote.gif b/phpBB/styles/subsilver2/theme/en/icon_post_quote.gif Binary files differindex 4cf103280c..4cf103280c 100644 --- a/phpBB/styles/subsilver2/imageset/en/icon_post_quote.gif +++ b/phpBB/styles/subsilver2/theme/en/icon_post_quote.gif diff --git a/phpBB/styles/subsilver2/imageset/en/icon_post_report.gif b/phpBB/styles/subsilver2/theme/en/icon_post_report.gif Binary files differindex 9a3f65b1e3..9a3f65b1e3 100644 --- a/phpBB/styles/subsilver2/imageset/en/icon_post_report.gif +++ b/phpBB/styles/subsilver2/theme/en/icon_post_report.gif diff --git a/phpBB/styles/subsilver2/imageset/en/icon_user_offline.gif b/phpBB/styles/subsilver2/theme/en/icon_user_offline.gif Binary files differindex 3065f4d7fe..3065f4d7fe 100644 --- a/phpBB/styles/subsilver2/imageset/en/icon_user_offline.gif +++ b/phpBB/styles/subsilver2/theme/en/icon_user_offline.gif diff --git a/phpBB/styles/subsilver2/imageset/en/icon_user_online.gif b/phpBB/styles/subsilver2/theme/en/icon_user_online.gif Binary files differindex b950612c57..b950612c57 100644 --- a/phpBB/styles/subsilver2/imageset/en/icon_user_online.gif +++ b/phpBB/styles/subsilver2/theme/en/icon_user_online.gif diff --git a/phpBB/styles/subsilver2/imageset/en/icon_user_profile.gif b/phpBB/styles/subsilver2/theme/en/icon_user_profile.gif Binary files differindex d9cf7f4c4a..d9cf7f4c4a 100644 --- a/phpBB/styles/subsilver2/imageset/en/icon_user_profile.gif +++ b/phpBB/styles/subsilver2/theme/en/icon_user_profile.gif diff --git a/phpBB/styles/subsilver2/imageset/en/icon_user_search.gif b/phpBB/styles/subsilver2/theme/en/icon_user_search.gif Binary files differindex 46475fbf4c..46475fbf4c 100644 --- a/phpBB/styles/subsilver2/imageset/en/icon_user_search.gif +++ b/phpBB/styles/subsilver2/theme/en/icon_user_search.gif diff --git a/phpBB/styles/subsilver2/imageset/en/icon_user_warn.gif b/phpBB/styles/subsilver2/theme/en/icon_user_warn.gif Binary files differindex 44cbcc953a..44cbcc953a 100644 --- a/phpBB/styles/subsilver2/imageset/en/icon_user_warn.gif +++ b/phpBB/styles/subsilver2/theme/en/icon_user_warn.gif diff --git a/phpBB/styles/subsilver2/theme/en/stylesheet.css b/phpBB/styles/subsilver2/theme/en/stylesheet.css new file mode 100644 index 0000000000..563492d4fc --- /dev/null +++ b/phpBB/styles/subsilver2/theme/en/stylesheet.css @@ -0,0 +1,116 @@ +/* EN Language Pack */ +.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.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.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.icon_contact_yahoo { + background-image: url("./icon_contact_yahoo.gif"); + padding-left: 72px; + padding-top: 20px; +} +.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 Binary files differindex 0589feb14f..0589feb14f 100644 --- a/phpBB/styles/subsilver2/imageset/announce_read.gif +++ b/phpBB/styles/subsilver2/theme/images/announce_read.gif diff --git a/phpBB/styles/subsilver2/imageset/announce_read_locked.gif b/phpBB/styles/subsilver2/theme/images/announce_read_locked.gif Binary files differindex a738616e06..a738616e06 100644 --- a/phpBB/styles/subsilver2/imageset/announce_read_locked.gif +++ b/phpBB/styles/subsilver2/theme/images/announce_read_locked.gif diff --git a/phpBB/styles/subsilver2/imageset/announce_read_locked_mine.gif b/phpBB/styles/subsilver2/theme/images/announce_read_locked_mine.gif Binary files differindex f7ffe7f8dd..f7ffe7f8dd 100644 --- a/phpBB/styles/subsilver2/imageset/announce_read_locked_mine.gif +++ b/phpBB/styles/subsilver2/theme/images/announce_read_locked_mine.gif diff --git a/phpBB/styles/subsilver2/imageset/announce_read_mine.gif b/phpBB/styles/subsilver2/theme/images/announce_read_mine.gif Binary files differindex 636d353867..636d353867 100644 --- a/phpBB/styles/subsilver2/imageset/announce_read_mine.gif +++ b/phpBB/styles/subsilver2/theme/images/announce_read_mine.gif diff --git a/phpBB/styles/subsilver2/imageset/announce_unread.gif b/phpBB/styles/subsilver2/theme/images/announce_unread.gif Binary files differindex 56b2702b17..56b2702b17 100644 --- a/phpBB/styles/subsilver2/imageset/announce_unread.gif +++ b/phpBB/styles/subsilver2/theme/images/announce_unread.gif diff --git a/phpBB/styles/subsilver2/imageset/announce_unread_locked.gif b/phpBB/styles/subsilver2/theme/images/announce_unread_locked.gif Binary files differindex 37033da653..37033da653 100644 --- a/phpBB/styles/subsilver2/imageset/announce_unread_locked.gif +++ b/phpBB/styles/subsilver2/theme/images/announce_unread_locked.gif diff --git a/phpBB/styles/subsilver2/imageset/announce_unread_locked_mine.gif b/phpBB/styles/subsilver2/theme/images/announce_unread_locked_mine.gif Binary files differindex d91f2520ca..d91f2520ca 100644 --- a/phpBB/styles/subsilver2/imageset/announce_unread_locked_mine.gif +++ b/phpBB/styles/subsilver2/theme/images/announce_unread_locked_mine.gif diff --git a/phpBB/styles/subsilver2/imageset/announce_unread_mine.gif b/phpBB/styles/subsilver2/theme/images/announce_unread_mine.gif Binary files differindex e1dd23a0bf..e1dd23a0bf 100644 --- a/phpBB/styles/subsilver2/imageset/announce_unread_mine.gif +++ b/phpBB/styles/subsilver2/theme/images/announce_unread_mine.gif diff --git a/phpBB/styles/subsilver2/imageset/forum_link.gif b/phpBB/styles/subsilver2/theme/images/forum_link.gif Binary files differindex d5e86d47d7..d5e86d47d7 100644 --- a/phpBB/styles/subsilver2/imageset/forum_link.gif +++ b/phpBB/styles/subsilver2/theme/images/forum_link.gif diff --git a/phpBB/styles/subsilver2/imageset/forum_read.gif b/phpBB/styles/subsilver2/theme/images/forum_read.gif Binary files differindex 9b2bc47c67..9b2bc47c67 100644 --- a/phpBB/styles/subsilver2/imageset/forum_read.gif +++ b/phpBB/styles/subsilver2/theme/images/forum_read.gif diff --git a/phpBB/styles/subsilver2/imageset/forum_read_locked.gif b/phpBB/styles/subsilver2/theme/images/forum_read_locked.gif Binary files differindex 436f3d21c8..436f3d21c8 100644 --- a/phpBB/styles/subsilver2/imageset/forum_read_locked.gif +++ b/phpBB/styles/subsilver2/theme/images/forum_read_locked.gif diff --git a/phpBB/styles/subsilver2/imageset/forum_read_subforum.gif b/phpBB/styles/subsilver2/theme/images/forum_read_subforum.gif Binary files differindex 9179303e7f..9179303e7f 100644 --- a/phpBB/styles/subsilver2/imageset/forum_read_subforum.gif +++ b/phpBB/styles/subsilver2/theme/images/forum_read_subforum.gif diff --git a/phpBB/styles/subsilver2/imageset/forum_unread.gif b/phpBB/styles/subsilver2/theme/images/forum_unread.gif Binary files differindex 5eec565b38..5eec565b38 100644 --- a/phpBB/styles/subsilver2/imageset/forum_unread.gif +++ b/phpBB/styles/subsilver2/theme/images/forum_unread.gif diff --git a/phpBB/styles/subsilver2/imageset/forum_unread_locked.gif b/phpBB/styles/subsilver2/theme/images/forum_unread_locked.gif Binary files differindex 58a79c376c..58a79c376c 100644 --- a/phpBB/styles/subsilver2/imageset/forum_unread_locked.gif +++ b/phpBB/styles/subsilver2/theme/images/forum_unread_locked.gif diff --git a/phpBB/styles/subsilver2/imageset/forum_unread_subforum.gif b/phpBB/styles/subsilver2/theme/images/forum_unread_subforum.gif Binary files differindex af3c93b1a1..af3c93b1a1 100644 --- a/phpBB/styles/subsilver2/imageset/forum_unread_subforum.gif +++ b/phpBB/styles/subsilver2/theme/images/forum_unread_subforum.gif diff --git a/phpBB/styles/subsilver2/imageset/icon_post_target.gif b/phpBB/styles/subsilver2/theme/images/icon_post_target.gif Binary files differindex d172abb060..d172abb060 100644 --- a/phpBB/styles/subsilver2/imageset/icon_post_target.gif +++ b/phpBB/styles/subsilver2/theme/images/icon_post_target.gif diff --git a/phpBB/styles/subsilver2/imageset/icon_post_target_unread.gif b/phpBB/styles/subsilver2/theme/images/icon_post_target_unread.gif Binary files differindex 8ec44a1787..8ec44a1787 100644 --- a/phpBB/styles/subsilver2/imageset/icon_post_target_unread.gif +++ b/phpBB/styles/subsilver2/theme/images/icon_post_target_unread.gif diff --git a/phpBB/styles/subsilver2/imageset/icon_topic_attach.gif b/phpBB/styles/subsilver2/theme/images/icon_topic_attach.gif Binary files differindex 1c9c89bc70..1c9c89bc70 100644 --- a/phpBB/styles/subsilver2/imageset/icon_topic_attach.gif +++ b/phpBB/styles/subsilver2/theme/images/icon_topic_attach.gif diff --git a/phpBB/styles/subsilver2/imageset/icon_topic_latest.gif b/phpBB/styles/subsilver2/theme/images/icon_topic_latest.gif Binary files differindex b45e57aedb..b45e57aedb 100644 --- a/phpBB/styles/subsilver2/imageset/icon_topic_latest.gif +++ b/phpBB/styles/subsilver2/theme/images/icon_topic_latest.gif diff --git a/phpBB/styles/subsilver2/imageset/icon_topic_newest.gif b/phpBB/styles/subsilver2/theme/images/icon_topic_newest.gif Binary files differindex eca2861836..eca2861836 100644 --- a/phpBB/styles/subsilver2/imageset/icon_topic_newest.gif +++ b/phpBB/styles/subsilver2/theme/images/icon_topic_newest.gif diff --git a/phpBB/styles/subsilver2/imageset/icon_topic_reported.gif b/phpBB/styles/subsilver2/theme/images/icon_topic_reported.gif Binary files differindex 026092854a..026092854a 100644 --- a/phpBB/styles/subsilver2/imageset/icon_topic_reported.gif +++ b/phpBB/styles/subsilver2/theme/images/icon_topic_reported.gif diff --git a/phpBB/styles/subsilver2/imageset/icon_topic_unapproved.gif b/phpBB/styles/subsilver2/theme/images/icon_topic_unapproved.gif Binary files differindex 2ccaf19c23..2ccaf19c23 100644 --- a/phpBB/styles/subsilver2/imageset/icon_topic_unapproved.gif +++ b/phpBB/styles/subsilver2/theme/images/icon_topic_unapproved.gif diff --git a/phpBB/styles/subsilver2/imageset/poll_center.gif b/phpBB/styles/subsilver2/theme/images/poll_center.gif Binary files differindex 99473151ec..99473151ec 100644 --- a/phpBB/styles/subsilver2/imageset/poll_center.gif +++ b/phpBB/styles/subsilver2/theme/images/poll_center.gif diff --git a/phpBB/styles/subsilver2/imageset/poll_left.gif b/phpBB/styles/subsilver2/theme/images/poll_left.gif Binary files differindex 269088b81d..269088b81d 100644 --- a/phpBB/styles/subsilver2/imageset/poll_left.gif +++ b/phpBB/styles/subsilver2/theme/images/poll_left.gif diff --git a/phpBB/styles/subsilver2/imageset/poll_right.gif b/phpBB/styles/subsilver2/theme/images/poll_right.gif Binary files differindex f9584e23a1..f9584e23a1 100644 --- a/phpBB/styles/subsilver2/imageset/poll_right.gif +++ b/phpBB/styles/subsilver2/theme/images/poll_right.gif diff --git a/phpBB/styles/subsilver2/imageset/site_logo.gif b/phpBB/styles/subsilver2/theme/images/site_logo.gif Binary files differindex abce3cd51d..abce3cd51d 100644 --- a/phpBB/styles/subsilver2/imageset/site_logo.gif +++ b/phpBB/styles/subsilver2/theme/images/site_logo.gif diff --git a/phpBB/styles/subsilver2/imageset/sticky_read.gif b/phpBB/styles/subsilver2/theme/images/sticky_read.gif Binary files differindex 09861a996c..09861a996c 100644 --- a/phpBB/styles/subsilver2/imageset/sticky_read.gif +++ b/phpBB/styles/subsilver2/theme/images/sticky_read.gif diff --git a/phpBB/styles/subsilver2/imageset/sticky_read_locked.gif b/phpBB/styles/subsilver2/theme/images/sticky_read_locked.gif Binary files differindex 24bca303d6..24bca303d6 100644 --- a/phpBB/styles/subsilver2/imageset/sticky_read_locked.gif +++ b/phpBB/styles/subsilver2/theme/images/sticky_read_locked.gif diff --git a/phpBB/styles/subsilver2/imageset/sticky_read_locked_mine.gif b/phpBB/styles/subsilver2/theme/images/sticky_read_locked_mine.gif Binary files differindex 3fd04ec3a9..3fd04ec3a9 100644 --- a/phpBB/styles/subsilver2/imageset/sticky_read_locked_mine.gif +++ b/phpBB/styles/subsilver2/theme/images/sticky_read_locked_mine.gif diff --git a/phpBB/styles/subsilver2/imageset/sticky_read_mine.gif b/phpBB/styles/subsilver2/theme/images/sticky_read_mine.gif Binary files differindex 381634c364..381634c364 100644 --- a/phpBB/styles/subsilver2/imageset/sticky_read_mine.gif +++ b/phpBB/styles/subsilver2/theme/images/sticky_read_mine.gif diff --git a/phpBB/styles/subsilver2/imageset/sticky_unread.gif b/phpBB/styles/subsilver2/theme/images/sticky_unread.gif Binary files differindex dd2e366543..dd2e366543 100644 --- a/phpBB/styles/subsilver2/imageset/sticky_unread.gif +++ b/phpBB/styles/subsilver2/theme/images/sticky_unread.gif diff --git a/phpBB/styles/subsilver2/imageset/sticky_unread_locked.gif b/phpBB/styles/subsilver2/theme/images/sticky_unread_locked.gif Binary files differindex 608f4822e3..608f4822e3 100644 --- a/phpBB/styles/subsilver2/imageset/sticky_unread_locked.gif +++ b/phpBB/styles/subsilver2/theme/images/sticky_unread_locked.gif diff --git a/phpBB/styles/subsilver2/imageset/sticky_unread_locked_mine.gif b/phpBB/styles/subsilver2/theme/images/sticky_unread_locked_mine.gif Binary files differindex fe5e115312..fe5e115312 100644 --- a/phpBB/styles/subsilver2/imageset/sticky_unread_locked_mine.gif +++ b/phpBB/styles/subsilver2/theme/images/sticky_unread_locked_mine.gif diff --git a/phpBB/styles/subsilver2/imageset/sticky_unread_mine.gif b/phpBB/styles/subsilver2/theme/images/sticky_unread_mine.gif Binary files differindex b5fc3b3627..b5fc3b3627 100644 --- a/phpBB/styles/subsilver2/imageset/sticky_unread_mine.gif +++ b/phpBB/styles/subsilver2/theme/images/sticky_unread_mine.gif diff --git a/phpBB/styles/subsilver2/imageset/topic_moved.gif b/phpBB/styles/subsilver2/theme/images/topic_moved.gif Binary files differindex fe758f02ca..fe758f02ca 100644 --- a/phpBB/styles/subsilver2/imageset/topic_moved.gif +++ b/phpBB/styles/subsilver2/theme/images/topic_moved.gif diff --git a/phpBB/styles/subsilver2/imageset/topic_read.gif b/phpBB/styles/subsilver2/theme/images/topic_read.gif Binary files differindex c16bfa75d5..c16bfa75d5 100644 --- a/phpBB/styles/subsilver2/imageset/topic_read.gif +++ b/phpBB/styles/subsilver2/theme/images/topic_read.gif diff --git a/phpBB/styles/subsilver2/imageset/topic_read_hot.gif b/phpBB/styles/subsilver2/theme/images/topic_read_hot.gif Binary files differindex a7a7e8fc78..a7a7e8fc78 100644 --- a/phpBB/styles/subsilver2/imageset/topic_read_hot.gif +++ b/phpBB/styles/subsilver2/theme/images/topic_read_hot.gif diff --git a/phpBB/styles/subsilver2/imageset/topic_read_hot_mine.gif b/phpBB/styles/subsilver2/theme/images/topic_read_hot_mine.gif Binary files differindex 853452a74b..853452a74b 100644 --- a/phpBB/styles/subsilver2/imageset/topic_read_hot_mine.gif +++ b/phpBB/styles/subsilver2/theme/images/topic_read_hot_mine.gif diff --git a/phpBB/styles/subsilver2/imageset/topic_read_locked.gif b/phpBB/styles/subsilver2/theme/images/topic_read_locked.gif Binary files differindex 10eb776972..10eb776972 100644 --- a/phpBB/styles/subsilver2/imageset/topic_read_locked.gif +++ b/phpBB/styles/subsilver2/theme/images/topic_read_locked.gif diff --git a/phpBB/styles/subsilver2/imageset/topic_read_locked_mine.gif b/phpBB/styles/subsilver2/theme/images/topic_read_locked_mine.gif Binary files differindex 3f24928b48..3f24928b48 100644 --- a/phpBB/styles/subsilver2/imageset/topic_read_locked_mine.gif +++ b/phpBB/styles/subsilver2/theme/images/topic_read_locked_mine.gif diff --git a/phpBB/styles/subsilver2/imageset/topic_read_mine.gif b/phpBB/styles/subsilver2/theme/images/topic_read_mine.gif Binary files differindex 560927aa06..560927aa06 100644 --- a/phpBB/styles/subsilver2/imageset/topic_read_mine.gif +++ b/phpBB/styles/subsilver2/theme/images/topic_read_mine.gif diff --git a/phpBB/styles/subsilver2/imageset/topic_unread.gif b/phpBB/styles/subsilver2/theme/images/topic_unread.gif Binary files differindex 4e56157dce..4e56157dce 100644 --- a/phpBB/styles/subsilver2/imageset/topic_unread.gif +++ b/phpBB/styles/subsilver2/theme/images/topic_unread.gif diff --git a/phpBB/styles/subsilver2/imageset/topic_unread_hot.gif b/phpBB/styles/subsilver2/theme/images/topic_unread_hot.gif Binary files differindex ceef4919d5..ceef4919d5 100644 --- a/phpBB/styles/subsilver2/imageset/topic_unread_hot.gif +++ b/phpBB/styles/subsilver2/theme/images/topic_unread_hot.gif diff --git a/phpBB/styles/subsilver2/imageset/topic_unread_hot_mine.gif b/phpBB/styles/subsilver2/theme/images/topic_unread_hot_mine.gif Binary files differindex 1c748f708a..1c748f708a 100644 --- a/phpBB/styles/subsilver2/imageset/topic_unread_hot_mine.gif +++ b/phpBB/styles/subsilver2/theme/images/topic_unread_hot_mine.gif diff --git a/phpBB/styles/subsilver2/imageset/topic_unread_locked.gif b/phpBB/styles/subsilver2/theme/images/topic_unread_locked.gif Binary files differindex 720e210289..720e210289 100644 --- a/phpBB/styles/subsilver2/imageset/topic_unread_locked.gif +++ b/phpBB/styles/subsilver2/theme/images/topic_unread_locked.gif diff --git a/phpBB/styles/subsilver2/imageset/topic_unread_locked_mine.gif b/phpBB/styles/subsilver2/theme/images/topic_unread_locked_mine.gif Binary files differindex 90873431ef..90873431ef 100644 --- a/phpBB/styles/subsilver2/imageset/topic_unread_locked_mine.gif +++ b/phpBB/styles/subsilver2/theme/images/topic_unread_locked_mine.gif diff --git a/phpBB/styles/subsilver2/imageset/topic_unread_mine.gif b/phpBB/styles/subsilver2/theme/images/topic_unread_mine.gif Binary files differindex 34fd2ec179..34fd2ec179 100644 --- a/phpBB/styles/subsilver2/imageset/topic_unread_mine.gif +++ b/phpBB/styles/subsilver2/theme/images/topic_unread_mine.gif diff --git a/phpBB/styles/subsilver2/imageset/upload_bar.gif b/phpBB/styles/subsilver2/theme/images/upload_bar.gif Binary files differindex 75cf61c59e..75cf61c59e 100644 --- a/phpBB/styles/subsilver2/imageset/upload_bar.gif +++ b/phpBB/styles/subsilver2/theme/images/upload_bar.gif diff --git a/phpBB/styles/subsilver2/theme/stylesheet.css b/phpBB/styles/subsilver2/theme/stylesheet.css index c2b6718d87..a753c914ba 100644 --- a/phpBB/styles/subsilver2/theme/stylesheet.css +++ b/phpBB/styles/subsilver2/theme/stylesheet.css @@ -674,3 +674,428 @@ 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; +} + + +/* English images for fallback */ +.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.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.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.icon_contact_yahoo { + background-image: url("./en/icon_contact_yahoo.gif"); + padding-left: 72px; + padding-top: 20px; +} +.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; +} diff --git a/phpBB/styles/subsilver2/theme/theme.cfg b/phpBB/styles/subsilver2/theme/theme.cfg index 9e39133bd9..c560dabae2 100644 --- a/phpBB/styles/subsilver2/theme/theme.cfg +++ b/phpBB/styles/subsilver2/theme/theme.cfg @@ -14,22 +14,8 @@ # 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 = © phpBB Group, 2003 version = 3.1.0-dev - -# 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/viewforum.php b/phpBB/viewforum.php index fa1ecf841e..62cf939545 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -688,10 +688,7 @@ if (sizeof($topic_list)) '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'] : '', diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php index 74ad7eba0d..27038a975e 100644 --- a/phpBB/viewonline.php +++ b/phpBB/viewonline.php @@ -377,7 +377,7 @@ if ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) { $sql = 'SELECT group_id, group_name, group_colour, group_type, group_legend FROM ' . GROUPS_TABLE . ' - WHERE group_legend = > 0 + WHERE group_legend > 0 ORDER BY ' . $order_legend . ' ASC'; } else diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 3b383210c9..a1976e169d 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -175,7 +175,7 @@ $sql_array = array( // 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'; + $sql_array['SELECT'] .= ', p.post_approved, p.post_time, p.post_id'; $sql_array['FROM'][POSTS_TABLE] = 'p'; } @@ -278,8 +278,16 @@ 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 ' . (($sort_dir == 'd') ? "p.post_time >= {$topic_data['post_time']}" : "p.post_time <= {$topic_data['post_time']}"); + " . ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND p.post_approved = 1' : ''); + + if ($sort_dir == 'd') + { + $sql .= " AND (p.post_time > {$topic_data['post_time']} OR (p.post_time = {$topic_data['post_time']} AND p.post_id >= {$topic_data['post_id']}))"; + } + else + { + $sql .= " AND (p.post_time < {$topic_data['post_time']} OR (p.post_time = {$topic_data['post_time']} AND p.post_id <= {$topic_data['post_id']}))"; + } $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); @@ -832,7 +840,7 @@ if (!empty($topic_data['poll_start'])) '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_WIDTH' => round($option_pct * 250), 'POLL_OPTION_VOTED' => (in_array($poll_option['poll_option_id'], $cur_voted_id)) ? true : false) ); } @@ -1302,7 +1310,7 @@ 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 diff --git a/phpunit.xml.all b/phpunit.xml.all index 1be2830729..fde3bbb1a7 100644 --- a/phpunit.xml.all +++ b/phpunit.xml.all @@ -21,5 +21,22 @@ <blacklist> <directory>./tests/</directory> </blacklist> + <whitelist> + <directory suffix=".php">./phpBB/includes/</directory> + <exclude> + <file>./phpBB/includes/db/firebird.php</file> + <file>./phpBB/includes/db/mysql.php</file> + <file>./phpBB/includes/db/mysqli.php</file> + <file>./phpBB/includes/db/mssql.php</file> + <file>./phpBB/includes/db/mssql_odbc.php</file> + <file>./phpBB/includes/db/mssqlnative.php</file> + <file>./phpBB/includes/db/oracle.php</file> + <file>./phpBB/includes/db/postgres.php</file> + <file>./phpBB/includes/db/sqlite.php</file> + <file>./phpBB/includes/search/fulltext_native.php</file> + <file>./phpBB/includes/search/fulltext_mysql.php</file> + <directory suffix=".php">./phpBB/includes/captcha/</directory> + </exclude> + </whitelist> </filter> </phpunit> diff --git a/phpunit.xml.dist b/phpunit.xml.dist index de8134da8e..a2bf2288cc 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -27,5 +27,22 @@ <blacklist> <directory>./tests/</directory> </blacklist> + <whitelist> + <directory suffix=".php">./phpBB/includes/</directory> + <exclude> + <file>./phpBB/includes/db/firebird.php</file> + <file>./phpBB/includes/db/mysql.php</file> + <file>./phpBB/includes/db/mysqli.php</file> + <file>./phpBB/includes/db/mssql.php</file> + <file>./phpBB/includes/db/mssql_odbc.php</file> + <file>./phpBB/includes/db/mssqlnative.php</file> + <file>./phpBB/includes/db/oracle.php</file> + <file>./phpBB/includes/db/postgres.php</file> + <file>./phpBB/includes/db/sqlite.php</file> + <file>./phpBB/includes/search/fulltext_native.php</file> + <file>./phpBB/includes/search/fulltext_mysql.php</file> + <directory suffix=".php">./phpBB/includes/captcha/</directory> + </exclude> + </whitelist> </filter> </phpunit> diff --git a/tests/bbcode/url_bbcode_test.php b/tests/bbcode/url_bbcode_test.php index cd85dbd0d9..68c97ede50 100644 --- a/tests/bbcode/url_bbcode_test.php +++ b/tests/bbcode/url_bbcode_test.php @@ -12,6 +12,7 @@ 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'; +require_once dirname(__FILE__) . '/../mock/request.php'; class phpbb_url_bbcode_test extends phpbb_test_case { @@ -51,8 +52,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/dbal/db_tools_test.php b/tests/dbal/db_tools_test.php index ddea500f83..753cc08fc5 100644 --- a/tests/dbal/db_tools_test.php +++ b/tests/dbal/db_tools_test.php @@ -271,6 +271,66 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case 'foo' => array('UINT', 42))) ); + $this->assertTrue($this->tools->sql_table_exists('prefix_test_table')); + $this->tools->sql_table_drop('prefix_test_table'); + + $this->assertFalse($this->tools->sql_table_exists('prefix_test_table')); + } + + public function test_peform_schema_changes_drop_tables() + { + $db_tools = $this->getMock('phpbb_db_tools', array( + 'sql_table_exists', + 'sql_table_drop', + ), array(&$this->db)); + + // pretend all tables exist + $db_tools->expects($this->any())->method('sql_table_exists') + ->will($this->returnValue(true)); + + // drop tables + $db_tools->expects($this->exactly(2))->method('sql_table_drop'); + $db_tools->expects($this->at(1))->method('sql_table_drop') + ->with($this->equalTo('dropped_table_1')); + $db_tools->expects($this->at(3))->method('sql_table_drop') + ->with($this->equalTo('dropped_table_2')); + + $db_tools->perform_schema_changes(array( + 'drop_tables' => array( + 'dropped_table_1', + 'dropped_table_2', + ), + )); + } + + public function test_peform_schema_changes_drop_columns() + { + $db_tools = $this->getMock('phpbb_db_tools', array( + 'sql_column_exists', + 'sql_column_remove', + ), array(&$this->db)); + + // pretend all columns exist + $db_tools->expects($this->any())->method('sql_column_exists') + ->will($this->returnValue(true)); + $db_tools->expects($this->any())->method('sql_column_exists') + ->will($this->returnValue(true)); + + // drop columns + $db_tools->expects($this->exactly(2))->method('sql_column_remove'); + $db_tools->expects($this->at(1))->method('sql_column_remove') + ->with($this->equalTo('existing_table'), $this->equalTo('dropped_column_1')); + $db_tools->expects($this->at(3))->method('sql_column_remove') + ->with($this->equalTo('existing_table'), $this->equalTo('dropped_column_2')); + + $db_tools->perform_schema_changes(array( + 'drop_columns' => array( + 'existing_table' => array( + 'dropped_column_1', + 'dropped_column_2', + ), + ), + )); } } diff --git a/tests/dbal/select_test.php b/tests/dbal/select_test.php index e0d08d9306..8ddd27465d 100644 --- a/tests/dbal/select_test.php +++ b/tests/dbal/select_test.php @@ -319,7 +319,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case $db->sql_freeresult($result); } - function test_nested_transactions() + public function test_nested_transactions() { $db = $this->new_dbal(); @@ -341,4 +341,20 @@ class phpbb_dbal_select_test extends phpbb_database_test_case $this->assertEquals('1', $row['user_id']); } + + /** + * fix for PHPBB3-10307 + */ + public function test_sql_fetchrow_returns_false_when_empty() + { + $db = $this->new_dbal(); + + $sql = 'SELECT * FROM (SELECT 1) AS TBL WHERE 1 = 0'; + $result = $db->sql_query($sql); + + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $this->assertSame(false, $row); + } } diff --git a/tests/download/http_byte_range_test.php b/tests/download/http_byte_range_test.php index ba2caee192..36cbcab0b0 100644 --- a/tests/download/http_byte_range_test.php +++ b/tests/download/http_byte_range_test.php @@ -8,23 +8,27 @@ */ require_once dirname(__FILE__) . '/../../phpBB/includes/functions_download.php'; +require_once dirname(__FILE__) . '/../mock/request.php'; class phpbb_download_http_byte_range_test extends phpbb_test_case { public function test_find_range_request() { // Missing 'bytes=' prefix - $_SERVER['HTTP_RANGE'] = 'bztes='; + $GLOBALS['request'] = new phpbb_mock_request(); + $GLOBALS['request']->set_header('Range', 'bztes='); $this->assertEquals(false, phpbb_find_range_request()); - unset($_SERVER['HTTP_RANGE']); + unset($GLOBALS['request']); + $GLOBALS['request'] = new phpbb_mock_request(); $_ENV['HTTP_RANGE'] = 'bztes='; $this->assertEquals(false, phpbb_find_range_request()); unset($_ENV['HTTP_RANGE']); - $_SERVER['HTTP_RANGE'] = 'bytes=0-0,123-125'; + $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($_SERVER['HTTP_RANGE']); + unset($GLOBALS['request']); } /** diff --git a/tests/error_collector_test.php b/tests/error_collector_test.php new file mode 100644 index 0000000000..e1ac32f5ac --- /dev/null +++ b/tests/error_collector_test.php @@ -0,0 +1,35 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2011 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +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->install(); + + // Cause a warning + 1/0; $line = __LINE__; + + $collector->uninstall(); + + 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/mock/cache.php b/tests/mock/cache.php index d3f9b8ad5a..989180c256 100644 --- a/tests/mock/cache.php +++ b/tests/mock/cache.php @@ -31,6 +31,28 @@ class phpbb_mock_cache implements phpbb_cache_driver_interface $this->data[$var_name] = $var; } + /** + * Obtain list of word censors. We don't need to parse them here, + * that is tested elsewhere. + */ + public function obtain_word_list() + { + return array( + 'match' => array( + '#(?<![\\p{Nd}\\p{L}_-])([\\p{Nd}\\p{L}_-]*?badword1[\\p{Nd}\\p{L}_-]*?)(?![\\p{Nd}\\p{L}_-])#iu', + '#(?<![\\p{Nd}\\p{L}_-])([\\p{Nd}\\p{L}_-]*?badword2)(?![\\p{Nd}\\p{L}_-])#iu', + '#(?<![\\p{Nd}\\p{L}_-])(badword3[\\p{Nd}\\p{L}_-]*?)(?![\\p{Nd}\\p{L}_-])#iu', + '#(?<![\\p{Nd}\\p{L}_-])(badword4)(?![\\p{Nd}\\p{L}_-])#iu', + ), + 'replace' => array( + 'replacement1', + 'replacement2', + 'replacement3', + 'replacement4', + ), + ); + } + public function checkVar(PHPUnit_Framework_Assert $test, $var_name, $data) { $test->assertTrue(isset($this->data[$var_name])); diff --git a/tests/mock/request.php b/tests/mock/request.php index da4015e78b..8b2708304c 100644 --- a/tests/mock/request.php +++ b/tests/mock/request.php @@ -11,12 +11,13 @@ class phpbb_mock_request implements phpbb_request_interface { protected $data; - public function __construct($get = array(), $post = array(), $cookie = array(), $request = false) + public function __construct($get = array(), $post = array(), $cookie = array(), $server = array(), $request = false) { $this->data[phpbb_request_interface::GET] = $get; $this->data[phpbb_request_interface::POST] = $post; $this->data[phpbb_request_interface::COOKIE] = $cookie; $this->data[phpbb_request_interface::REQUEST] = ($request === false) ? $post + $get : $request; + $this->data[phpbb_request_interface::SERVER] = $server; } public function overwrite($var_name, $value, $super_global = phpbb_request_interface::REQUEST) @@ -29,6 +30,18 @@ class phpbb_mock_request implements phpbb_request_interface 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_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 is_set_post($name) { return $this->is_set($name, phpbb_request_interface::POST); @@ -39,8 +52,31 @@ class phpbb_mock_request implements phpbb_request_interface 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_interface::REQUEST) { return array_keys($this->data[$super_global]); } + + /* custom methods */ + + public function set_header($header_name, $value) + { + $var_name = 'HTTP_' . str_replace('-', '_', strtoupper($header_name)); + $this->data[phpbb_request_interface::SERVER][$var_name] = $value; + } + + public function merge($super_global = phpbb_request_interface::REQUEST, $values) + { + $this->data[$super_global] = array_merge($this->data[$super_global], $values); + } } diff --git a/tests/mock_user.php b/tests/mock_user.php index 74d31c4c4a..5b89ea3e19 100644 --- a/tests/mock_user.php +++ b/tests/mock_user.php @@ -17,4 +17,20 @@ class phpbb_mock_user { public $host = "testhost"; public $page = array('root_script_path' => '/'); + + private $options = array(); + public function optionget($item) + { + if (!isset($this->options[$item])) + { + throw new Exception(sprintf("You didn't set the option '%s' on the mock user using optionset.", $item)); + } + + return $this->options[$item]; + } + + public function optionset($item, $value) + { + $this->options[$item] = $value; + } } diff --git a/tests/network/ftp_fsock_pasv_epsv_test.php b/tests/network/ftp_fsock_pasv_epsv_test.php new file mode 100644 index 0000000000..6ad811e3ca --- /dev/null +++ b/tests/network/ftp_fsock_pasv_epsv_test.php @@ -0,0 +1,63 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2011 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; +require_once dirname(__FILE__) . '/../../phpBB/includes/functions_transfer.php'; + +/** +* @group slow +*/ +class phpbb_network_ftp_fsock_pasv_epsv_test extends phpbb_test_case +{ + static protected $ipv4; + + static public function setUpBeforeClass() + { + $hostname = 'ftp.debian.org.'; + self::$ipv4 = gethostbyname($hostname); + + if (self::$ipv4 == $hostname) + { + self::markTestSkipped("Got no A record back from DNS query for $hostname"); + } + } + + public function test_pasv() + { + // PASV + $this->assert_ls_contains_debian(self::$ipv4); + } + + public function test_epsv() + { + $ipv4 = self::$ipv4; + // EPSV + $this->assert_ls_contains_debian("[::ffff:$ipv4]"); + } + + protected function assert_ls_contains_debian($hostname) + { + $o = $this->get_object($hostname); + $result = $o->_init(); + // This test may fail on IPv6 addresses if IPv6 support is + // not available. PHP must be compiled with IPv6 support enabled, + // and your operating system must be configured for IPv6 as well. + if ($result !== true) + { + $this->markTestSkipped("Failed to connect to $hostname: $result"); + } + $this->assertContains('debian', $o->_ls()); + $o->_close(); + } + + protected function get_object($hostname) + { + return new ftp_fsock($hostname, 'anonymous', 'anonymous@localhost.tld', '/'); + } +} diff --git a/tests/profile/custom_test.php b/tests/profile/custom_test.php index 0e0a851243..585182e583 100644 --- a/tests/profile/custom_test.php +++ b/tests/profile/custom_test.php @@ -48,7 +48,7 @@ class phpbb_profile_custom_test extends phpbb_database_test_case ); $cp = new custom_profile; - $result = $cp->validate_profile_field(FIELD_DROPDOWN, &$field_value, $field_data); + $result = $cp->validate_profile_field(FIELD_DROPDOWN, $field_value, $field_data); $this->assertEquals($expected, $result, $description); } diff --git a/tests/request/request_test.php b/tests/request/request_test.php index 203c9fd880..e492fa5cf1 100644 --- a/tests/request/request_test.php +++ b/tests/request/request_test.php @@ -22,8 +22,11 @@ class phpbb_request_test extends phpbb_test_case $_REQUEST['test'] = 3; $_GET['unset'] = ''; - $this->type_cast_helper = $this->getMock('phpbb_request_type_cast_helper_interface'); + $_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($this->type_cast_helper); } @@ -44,6 +47,44 @@ class phpbb_request_test extends phpbb_test_case $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'); + } + /** * Checks that directly accessing $_POST will trigger * an error. @@ -60,6 +101,31 @@ class phpbb_request_test extends phpbb_test_case $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($this->type_cast_helper); + + $this->assertTrue($this->request->is_ajax()); + } + + public function test_is_secure() + { + $this->assertFalse($this->request->is_secure()); + + $this->request->enable_super_globals(); + $_SERVER['HTTPS'] = 'on'; + $this->request = new phpbb_request($this->type_cast_helper); + + $this->assertTrue($this->request->is_secure()); + } + public function test_variable_names() { $expected = array('test', 'unset'); diff --git a/tests/security/base.php b/tests/security/base.php index db9c884cf4..4b259a2aac 100644 --- a/tests/security/base.php +++ b/tests/security/base.php @@ -7,6 +7,8 @@ * */ +require_once dirname(__FILE__) . '/../mock/request.php'; + abstract class phpbb_security_test_base extends phpbb_test_case { /** @@ -14,20 +16,20 @@ abstract class phpbb_security_test_base extends phpbb_test_case */ protected function setUp() { - global $user, $phpbb_root_path; + global $user, $phpbb_root_path, $request; // 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'; + $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'; /* [HTTP_ACCEPT_ENCODING] => gzip,deflate @@ -36,13 +38,15 @@ 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(), $server); + // Set no user and trick a bit to circumvent errors $user = new user(); $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->browser = $server['HTTP_USER_AGENT']; + $user->referer = ''; + $user->forwarded_for = ''; + $user->host = $server['HTTP_HOST']; $user->page = session::extract_current_page($phpbb_root_path); } diff --git a/tests/security/extract_current_page_test.php b/tests/security/extract_current_page_test.php index 71c7a3a397..34c7b52f49 100644 --- a/tests/security/extract_current_page_test.php +++ b/tests/security/extract_current_page_test.php @@ -27,8 +27,12 @@ class phpbb_security_extract_current_page_test extends phpbb_security_test_base */ public function test_query_string_php_self($url, $query_string, $expected) { - $_SERVER['PHP_SELF'] = $url; - $_SERVER['QUERY_STRING'] = $query_string; + global $request; + + $request->merge(phpbb_request_interface::SERVER, array( + 'PHP_SELF' => $url, + 'QUERY_STRING' => $query_string, + )); $result = session::extract_current_page('./'); @@ -41,8 +45,12 @@ class phpbb_security_extract_current_page_test extends phpbb_security_test_base */ public function test_query_string_request_uri($url, $query_string, $expected) { - $_SERVER['REQUEST_URI'] = $url . '?' . $query_string; - $_SERVER['QUERY_STRING'] = $query_string; + global $request; + + $request->merge(phpbb_request_interface::SERVER, array( + 'PHP_SELF' => $url, + 'QUERY_STRING' => $query_string, + )); $result = session::extract_current_page('./'); diff --git a/tests/session/append_sid_test.php b/tests/session/append_sid_test.php new file mode 100644 index 0000000000..1a3ad633e3 --- /dev/null +++ b/tests/session/append_sid_test.php @@ -0,0 +1,51 @@ +<?php
+/**
+*
+* @package testing
+* @copyright (c) 2011 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_session_append_sid_test extends phpbb_test_case
+{
+
+ public function append_sid_data()
+ {
+ return array(
+ array('viewtopic.php?t=1&f=2', false, true, false, 'viewtopic.php?t=1&f=2', 'parameters in url-argument'),
+ array('viewtopic.php', 't=1&f=2', true, false, 'viewtopic.php?t=1&f=2', 'parameters in params-argument using amp'),
+ array('viewtopic.php', 't=1&f=2', false, false, 'viewtopic.php?t=1&f=2', 'parameters in params-argument using &'),
+ array('viewtopic.php', array('t' => 1, 'f' => 2), true, false, 'viewtopic.php?t=1&f=2', 'parameters in params-argument as array'),
+
+ // Custom sid parameter
+ array('viewtopic.php', 't=1&f=2', true, 'custom-sid', 'viewtopic.php?t=1&f=2&sid=custom-sid', 'using session_id'),
+
+ // Testing anchors
+ array('viewtopic.php?t=1&f=2#anchor', false, true, false, 'viewtopic.php?t=1&f=2#anchor', 'anchor in url-argument'),
+ array('viewtopic.php', 't=1&f=2#anchor', true, false, 'viewtopic.php?t=1&f=2#anchor', 'anchor in params-argument'),
+ array('viewtopic.php', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'viewtopic.php?t=1&f=2#anchor', 'anchor in params-argument (array)'),
+
+ // Anchors and custom sid
+ array('viewtopic.php?t=1&f=2#anchor', false, true, 'custom-sid', 'viewtopic.php?t=1&f=2&sid=custom-sid#anchor', 'anchor in url-argument using session_id'),
+ array('viewtopic.php', 't=1&f=2#anchor', true, 'custom-sid', 'viewtopic.php?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument using session_id'),
+ array('viewtopic.php', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'viewtopic.php?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+
+ // Empty parameters should not append the ?
+ array('viewtopic.php', false, true, false, 'viewtopic.php', 'no params using bool false'),
+ array('viewtopic.php', '', true, false, 'viewtopic.php', 'no params using empty string'),
+ array('viewtopic.php', array(), true, false, 'viewtopic.php', 'no params using empty array'),
+ );
+ }
+
+ /**
+ * @dataProvider append_sid_data
+ */
+ public function test_append_sid($url, $params, $is_amp, $session_id, $expected, $description)
+ {
+ $this->assertEquals($expected, append_sid($url, $params, $is_amp, $session_id));
+ }
+}
+
diff --git a/tests/session/testable_factory.php b/tests/session/testable_factory.php index 2b6a1683d3..3d4fbcc7cb 100644 --- a/tests/session/testable_factory.php +++ b/tests/session/testable_factory.php @@ -73,7 +73,8 @@ class phpbb_session_testable_factory $request = $this->request = new phpbb_mock_request( array(), array(), - $this->cookies + $this->cookies, + $this->server_data ); request_var(null, null, null, null, $request); @@ -85,8 +86,6 @@ class phpbb_session_testable_factory $cache = $this->cache = new phpbb_mock_cache($this->get_cache_data()); $SID = $_SID = null; - $_SERVER = $this->server_data; - $session = new phpbb_mock_session_testable; return $session; } diff --git a/tests/template/includephp_test.php b/tests/template/includephp_test.php new file mode 100644 index 0000000000..aac9cccc8a --- /dev/null +++ b/tests/template/includephp_test.php @@ -0,0 +1,47 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2011 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +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)); + + $cache_file = $this->template->cachepath . 'includephp_relative.html.php'; + + $this->run_template('includephp_relative.html', array(), array(), array(), "Path is relative to board root.\ntesting included php", $cache_file); + + $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_absolute() + { + $path_to_php = 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 = dirname($this->template->cachepath) . '/'; + $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_template($cache_dir, 'tests'); + $cache_file = $this->template->cachepath . 'includephp_absolute.html.php'; + + $this->run_template('includephp_absolute.html', array(), array(), array(), "Path is absolute.\ntesting included php", $cache_file); + + $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_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/renderer_eval_test.php b/tests/template/renderer_eval_test.php new file mode 100644 index 0000000000..c30516ba97 --- /dev/null +++ b/tests/template/renderer_eval_test.php @@ -0,0 +1,31 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2011 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +class phpbb_template_renderer_eval_test extends phpbb_test_case +{ + public function test_eval() + { + $compiled_code = '<a href="<?php echo \'Test\'; ?>">'; + $valid_code = '<a href="Test">'; + $context = new phpbb_template_context(); + $template = new phpbb_template_renderer_eval($compiled_code, NULL); + ob_start(); + try + { + $template->render($context, array()); + } + catch (Exception $exception) + { + ob_end_clean(); + throw $exception; + } + $output = ob_get_clean(); + $this->assertEquals($valid_code, $output); + } +} 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..3cc632485d --- /dev/null +++ b/tests/template/subdir/includephp_from_subdir_test.php @@ -0,0 +1,29 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2011 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +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)); + + $cache_file = $this->template->cachepath . 'includephp_relative.html.php'; + + $this->run_template('includephp_relative.html', array(), array(), array(), "Path is relative to board root.\ntesting included php", $cache_file); + + $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_compile_test.php b/tests/template/template_compile_test.php new file mode 100644 index 0000000000..8c136c9985 --- /dev/null +++ b/tests/template/template_compile_test.php @@ -0,0 +1,31 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2011 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; + +class phpbb_template_template_compile_test extends phpbb_test_case +{ + private $template_compile; + private $template_path; + + protected function setUp() + { + $this->template_compile = new phpbb_template_compile(false); + $this->template_path = dirname(__FILE__) . '/templates'; + } + + public function test_in_phpbb() + { + $output = $this->template_compile->compile_file($this->template_path . '/trivial.html'); + $this->assertTrue(strlen($output) > 0); + $statements = explode(';', $output); + $first_statement = $statements[0]; + $this->assertTrue(!!preg_match('#if.*defined.*IN_PHPBB.*exit#', $first_statement)); + } +} diff --git a/tests/template/template_inheritance_test.php b/tests/template/template_inheritance_test.php new file mode 100644 index 0000000000..d62562ff0d --- /dev/null +++ b/tests/template/template_inheritance_test.php @@ -0,0 +1,75 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2011 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +require_once dirname(__FILE__) . '/template_test_case.php'; + +class phpbb_template_template_inheritance_test extends phpbb_template_template_test_case +{ + /** + * @todo put test data into templates/xyz.test + */ + public static 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) + { + $cache_file = $this->template->cachepath . str_replace('/', '.', $file) . '.php'; + + $this->assertFileNotExists($cache_file); + + $this->run_template($file, $vars, $block_vars, $destroy, $expected, $cache_file); + + // Reset the engine state + $this->setup_engine(); + + $this->run_template($file, $vars, $block_vars, $destroy, $expected, $cache_file); + } + + protected function setup_engine() + { + global $phpbb_root_path, $phpEx, $config, $user; + + $this->template_path = dirname(__FILE__) . '/templates'; + $this->parent_template_path = dirname(__FILE__) . '/parent_templates'; + $this->template_locator = new phpbb_template_locator(); + $this->template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $this->template_locator); + $this->template->set_custom_template($this->template_path, 'tests', $this->parent_template_path); + } +} diff --git a/tests/template/template_test.php b/tests/template/template_test.php index 62f94f7d32..86ff2e9ec6 100644 --- a/tests/template/template_test.php +++ b/tests/template/template_test.php @@ -8,69 +8,10 @@ */ 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 = false; - - private function display($handle) - { - ob_start(); - $this->assertTrue($this->template->display($handle, false)); - return self::trim_template_result(ob_get_clean()); - } - - 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() - { - $this->markTestIncomplete("template::display raises notices."); - - // Test the engine can be used - $this->setup_engine(); - - if (!is_writable(dirname($this->template->cachepath))) - { - $this->markTestSkipped("Template cache directory is not writable."); - } - - foreach (glob($this->template->cachepath . '*') as $file) - { - unlink($file); - } - - $GLOBALS['config'] = array( - 'load_tplcompile' => true, - 'tpl_allow_php' => false, - ); - } - - protected function tearDown() - { - if (is_object($this->template)) - { - foreach (glob($this->template->cachepath . '*') as $file) - { - unlink($file); - } - } - } - /** * @todo put test data into templates/xyz.test */ @@ -91,7 +32,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', @@ -105,14 +46,14 @@ class phpbb_template_template_test extends phpbb_test_case array(), array(), array(), - '0', + '03', ), array( 'if.html', array('S_VALUE' => true), array(), array(), - "1\n0", + '1', ), array( 'if.html', @@ -161,22 +102,22 @@ class phpbb_template_template_test extends phpbb_test_case array(), array('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(), - "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(), - "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\ninner loop", + ), array( 'loop_advanced.html', array(), @@ -189,14 +130,23 @@ class phpbb_template_template_test extends phpbb_test_case array(), array('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\nabc\nbar\nbar\nabc", ), 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', @@ -213,6 +163,27 @@ class phpbb_template_template_test extends phpbb_test_case 'value', ), array( + 'include_define.html', + array('VARIABLE' => 'value'), + array(), + array(), + 'value', + ), + array( + 'include_loop.html', + array(), + array('loop' => array(array('NESTED_FILE' => 'include_loop1.html')), '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( 'loop_vars.html', array(), array('loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'loop.inner' => array(array(), array())), @@ -227,26 +198,75 @@ class phpbb_template_template_test extends phpbb_test_case "first\n0\n0\n2\nx\nset\n1\n1\n2\ny\nset\nlast", ),*/ array( + // Just like a regular loop but the name begins + // with an underscore + 'loop_underscore.html', + array(), + array(), + array(), + "noloop\nnoloop", + ), + array( 'lang.html', array(), array(), array(), - "{ VARIABLE }\n{ VARIABLE }", + "{ VARIABLE }\n{ 1_VARIABLE }\n{ VARIABLE }\n{ 1_VARIABLE }", ), array( 'lang.html', - array('L_VARIABLE' => "Value'"), + array('L_VARIABLE' => "Value'", 'L_1_VARIABLE' => "1 O'Clock"), array(), array(), - "Value'\nValue\'", + "Value'\n1 O'Clock\nValue\'\n1 O\'Clock", ), array( 'lang.html', - array('LA_VARIABLE' => "Value'"), + array('LA_VARIABLE' => "Value'", 'LA_1_VARIABLE' => "1 O'Clock"), array(), array(), - "{ VARIABLE }\nValue'", + "{ VARIABLE }\n{ 1_VARIABLE }\nValue'\n1 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(), + // I don't completely understand this output, hopefully it's correct + "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(), + // I don't completely understand this output, hopefully it's correct + "top-level content\nouter\nmiddle\ninner z\nfirst row of 2 in inner\n\ninner zz", + ), + array( + 'loop_size.html', + array(), + array('loop' => array(array()), 'empty_loop' => array()), + array(), + "nonexistent = 0\n! nonexistent\n\nempty = 0\n! empty\nloop\n\nin loop", + ), + /* 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", + ), + */ ); } @@ -257,7 +277,7 @@ 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); + $expecting = sprintf('template locator: File %s does not exist', realpath($this->template_path . '/../') . '/templates/' . $filename); $this->setExpectedTriggerError(E_USER_ERROR, $expecting); $this->display('test'); @@ -265,7 +285,7 @@ class phpbb_template_template_test extends phpbb_test_case public function test_empty_file() { - $expecting = 'template->set_filenames: Empty filename specified for test'; + $expecting = 'template locator: set_filenames: Empty filename specified for test'; $this->setExpectedTriggerError(E_USER_ERROR, $expecting); $this->template->set_filenames(array('test' => '')); @@ -273,52 +293,12 @@ class phpbb_template_template_test extends phpbb_test_case public function test_invalid_handle() { - $expecting = 'template->_tpl_load(): No file specified for handle test'; + $expecting = 'No file specified for handle test'; $this->setExpectedTriggerError(E_USER_ERROR, $expecting); $this->display('test'); } - private function run_template($file, array $vars, array $block_vars, array $destroy, $expected, $cache_file) - { - $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); - } - - 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)); - } - } - /** * @dataProvider template_data */ @@ -360,43 +340,22 @@ class phpbb_template_template_test extends phpbb_test_case $this->template->destroy_block_vars($block); } - $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)"); } public function test_php() { - $GLOBALS['config']['tpl_allow_php'] = true; + $this->setup_engine(array('tpl_allow_php' => true)); $cache_file = $this->template->cachepath . 'php.html.php'; $this->assertFileNotExists($cache_file); $this->run_template('php.html', array(), array(), array(), 'test', $cache_file); - - $GLOBALS['config']['tpl_allow_php'] = false; - } - - public function test_includephp() - { - $GLOBALS['config']['tpl_allow_php'] = true; - - $cache_file = $this->template->cachepath . 'includephp.html.php'; - - $this->run_template('includephp.html', array(), array(), array(), 'testing included php', $cache_file); - - $this->template->set_filenames(array('test' => 'includephp.html')); - $this->assertEquals('testing included php', $this->display('test'), "Testing INCLUDEPHP"); - - $GLOBALS['config']['tpl_allow_php'] = false; } public static function alter_block_array_data() @@ -507,5 +466,5 @@ EOT $this->template->alter_block_array($alter_block, $vararray, $key, $mode); $this->assertEquals($expect, $this->display('test'), $description); } -} +} diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php new file mode 100644 index 0000000000..0e1f960f61 --- /dev/null +++ b/tests/template/template_test_case.php @@ -0,0 +1,133 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2011 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; + +class phpbb_template_template_test_case extends phpbb_test_case +{ + protected $template; + protected $template_path; + protected $template_locator; + + // Keep the contents of the cache for debugging? + const PRESERVE_CACHE = true; + + protected function display($handle) + { + ob_start(); + + try + { + $this->assertTrue($this->template->display($handle, false)); + } + catch (Exception $exception) + { + // reset output buffering even when an error occured + // 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 setup_engine(array $new_config = array()) + { + global $phpbb_root_path, $phpEx, $user; + + $defaults = array( + 'load_tplcompile' => true, + 'tpl_allow_php' => false, + ); + + $config = new phpbb_config(array_merge($defaults, $new_config)); + + $this->template_path = dirname(__FILE__) . '/templates'; + $this->template_locator = new phpbb_template_locator(); + $this->template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $this->template_locator); + $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."); + } + + foreach (glob($this->template->cachepath . '*') as $file) + { + unlink($file); + } + + $this->setup_engine(); + } + + protected function tearDown() + { + if (is_object($this->template)) + { + foreach (glob($this->template->cachepath . '*') as $file) + { + unlink($file); + } + } + } + + protected function run_template($file, array $vars, array $block_vars, array $destroy, $expected, $cache_file) + { + $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); + } + + 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. + // When testing eval path the cache file may not exist. + if (self::PRESERVE_CACHE && file_exists($cache_file)) + { + copy($cache_file, str_replace('ctpl_', 'tests_ctpl_', $cache_file)); + } + } +} 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.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/define.html b/tests/template/templates/define.html index 82237d21a3..4459fffbe0 100644 --- a/tests/template/templates/define.html +++ b/tests/template/templates/define.html @@ -2,6 +2,9 @@ {$VALUE} <!-- DEFINE $VALUE = 'abc' --> {$VALUE} +<!-- INCLUDE define_include.html --> +{$INCLUDED_VALUE} +{$VALUE} <!-- UNDEFINE $VALUE --> {$VALUE} <!-- DEFINE $VALUE --> 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/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..eed431019e 100644 --- a/tests/template/templates/if.html +++ b/tests/template/templates/if.html @@ -3,9 +3,9 @@ <!-- ELSEIF S_OTHER_VALUE --> 2 <!-- 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 --> diff --git a/tests/template/templates/include_define.html b/tests/template/templates/include_define.html new file mode 100644 index 0000000000..2419c8cba1 --- /dev/null +++ b/tests/template/templates/include_define.html @@ -0,0 +1,2 @@ +<!-- DEFINE $DEF = 'variable.html' --> +<!-- INCLUDE {$DEF} --> diff --git a/tests/template/templates/include_loop.html b/tests/template/templates/include_loop.html new file mode 100644 index 0000000000..d5c3d9bc82 --- /dev/null +++ b/tests/template/templates/include_loop.html @@ -0,0 +1,4 @@ +<!-- BEGIN loop --> +<!-- INCLUDE {loop.NESTED_FILE} --> +<!-- BEGIN inner -->_<!-- INCLUDE {inner.NESTED_FILE} --><!-- END inner --> +<!-- END 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_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/includephp.html b/tests/template/templates/includephp_relative.html index 70ebdac0d0..297c9efcb0 100644 --- a/tests/template/templates/includephp.html +++ b/tests/template/templates/includephp_relative.html @@ -1 +1,2 @@ +Path is relative to board root. <!-- INCLUDEPHP ../tests/template/templates/_dummy_include.php.inc --> 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_nested.html b/tests/template/templates/loop_nested.html index 9b251cd453..45b1ef85d4 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 --> <!-- 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_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..f1938441df --- /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 .loop --> + loop +<!-- ENDIF --> + +<!-- IF .loop == 0 --> + loop = 0 +<!-- ENDIF --> + +<!-- IF ! .loop --> + ! loop +<!-- ENDIF --> + +<!-- BEGIN loop --> + in loop +<!-- END --> diff --git a/tests/template/templates/loop_underscore.html b/tests/template/templates/loop_underscore.html new file mode 100644 index 0000000000..dafce5dea6 --- /dev/null +++ b/tests/template/templates/loop_underscore.html @@ -0,0 +1,21 @@ +<!-- BEGIN _underscore_loop --> +loop +<!-- BEGINELSE --> +noloop +<!-- END 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..d94a0ae0f7 100644 --- a/tests/template/templates/loop_vars.html +++ b/tests/template/templates/loop_vars.html @@ -1,21 +1,14 @@ <!-- BEGIN loop --> <!-- IF loop.S_FIRST_ROW -->first<!-- ENDIF --> - -{loop.S_ROW_COUNT} - -{loop.VARIABLE} - +{loop.S_ROW_NUM} - a +{loop.VARIABLE} - b <!-- IF loop.VARIABLE -->set<!-- ENDIF --> - <!-- IF loop.S_LAST_ROW --> last <!-- ENDIF --> <!-- BEGIN inner --> - -{inner.S_ROW_COUNT} - +{inner.S_ROW_NUM} - c <!-- IF inner.S_LAST_ROW and inner.S_ROW_COUNT and inner.S_NUM_ROWS -->last inner<!-- ENDIF --> - <!-- END inner --> <!-- END loop --> <!-- IF .loop.inner -->inner loop<!-- ENDIF --> 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/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/text_processing/censor_text_test.php b/tests/text_processing/censor_text_test.php new file mode 100644 index 0000000000..2843f0b20b --- /dev/null +++ b/tests/text_processing/censor_text_test.php @@ -0,0 +1,85 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2011 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +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 +{ + public function censor_text_data() + { + global $cache, $user; + $cache = new phpbb_mock_cache; + $user = new phpbb_mock_user; + + $user->optionset('viewcensors', false); + + return array( + array('', ''), + + array('badword1', 'replacement1'), + array(' badword1', ' replacement1'), + array('badword1 ', 'replacement1 '), + array(' badword1 ', ' replacement1 '), + array('abadword1', 'replacement1'), + array('badword1w', 'replacement1'), + array('abadword1w', 'replacement1'), + array('anotherbadword1test', 'replacement1'), + array('this badword1', 'this replacement1'), + array('this badword1 word', 'this replacement1 word'), + + array('badword2', 'replacement2'), + array('bbadword2', 'replacement2'), + array('bbbadword2', 'replacement2'), + array('badword2d', 'badword2d'), + array('bbadword2d', 'bbadword2d'), + array('test badword2', 'test replacement2'), + array('test badword2 word', 'test replacement2 word'), + + array('badword3', 'replacement3'), + array('bbadword3', 'bbadword3'), + array('badword3d', 'replacement3'), + array('badword3ddd', 'replacement3'), + array('bbadword3d', 'bbadword3d'), + array(' badword3 ', ' replacement3 '), + array(' badword3', ' replacement3'), + + array('badword4', 'replacement4'), + array('this badword4 word', 'this replacement4 word'), + array('abadword4', 'abadword4'), + array('badword4d', 'badword4d'), + array('abadword4d', 'abadword4d'), + + 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('öäü', 'öäü'), + array('badw' . chr(1) . 'ord1', 'badw' . chr(1) . 'ord1'), + array('badw' . chr(2) . 'ord1', 'badw' . chr(2) . 'ord1'), + array('badw' . chr(3) . 'ord1', 'badw' . chr(3) . 'ord1'), + array('badw' . chr(4) . 'ord1', 'badw' . chr(4) . 'ord1'), + array('badw' . chr(5) . 'ord1', 'badw' . chr(5) . 'ord1'), + array('badw' . chr(6) . 'ord1', 'badw' . chr(6) . 'ord1'), + ); + } + + /** + * @dataProvider censor_text_data + */ + public function test_censor_text($input, $expected) + { + $label = 'Testing word censor: ' . $input; + $this->assertEquals($expected, censor_text($input), $label); + } +} diff --git a/tests/utf/data/.gitkeep b/tests/tmp/.gitkeep index e69de29bb2..e69de29bb2 100644 --- a/tests/utf/data/.gitkeep +++ b/tests/tmp/.gitkeep diff --git a/tests/utf/normalizer_test.php b/tests/utf/normalizer_test.php index f78dba8004..1dc69e283e 100644 --- a/tests/utf/normalizer_test.php +++ b/tests/utf/normalizer_test.php @@ -14,10 +14,13 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_normalizer.php'; */ class phpbb_utf_normalizer_test extends phpbb_test_case { + static private $data_dir; + static public function setUpBeforeClass() { - self::download('http://www.unicode.org/Public/UNIDATA/NormalizationTest.txt', dirname(__FILE__).'/data'); - self::download('http://www.unicode.org/Public/UNIDATA/UnicodeData.txt', dirname(__FILE__).'/data'); + self::$data_dir = dirname(__file__) . '/../tmp'; + self::download('http://www.unicode.org/Public/UNIDATA/NormalizationTest.txt', self::$data_dir); + self::download('http://www.unicode.org/Public/UNIDATA/UnicodeData.txt', self::$data_dir); } public function test_normalizer() @@ -62,7 +65,7 @@ class phpbb_utf_normalizer_test extends phpbb_test_case $tested_chars = array(); - $fp = fopen(dirname(__FILE__).'/data/NormalizationTest.txt', 'rb'); + $fp = fopen(self::$data_dir . '/NormalizationTest.txt', 'rb'); while (!feof($fp)) { $line = fgets($fp); @@ -99,7 +102,7 @@ class phpbb_utf_normalizer_test extends phpbb_test_case foreach ($tests as $test) { $utf_result = $utf_expected; - call_user_func(array('utf_normalizer', $form), &$utf_result); + call_user_func_array(array('utf_normalizer', $form), array(&$utf_result)); $hex_result = $this->utf_to_hexseq($utf_result); $this->assertEquals($utf_expected, $utf_result, "$expected == $form($test) ($hex_expected != $hex_result)"); @@ -117,7 +120,7 @@ class phpbb_utf_normalizer_test extends phpbb_test_case */ public function test_invariants(array $tested_chars) { - $fp = fopen(dirname(__FILE__).'/data/UnicodeData.txt', 'rb'); + $fp = fopen(self::$data_dir . '/UnicodeData.txt', 'rb'); while (!feof($fp)) { @@ -151,7 +154,7 @@ class phpbb_utf_normalizer_test extends phpbb_test_case foreach (array('nfc', 'nfkc', 'nfd', 'nfkd') as $form) { $utf_result = $utf_expected; - call_user_func(array('utf_normalizer', $form), &$utf_result); + call_user_func_array(array('utf_normalizer', $form), array(&$utf_result)); $hex_result = $this->utf_to_hexseq($utf_result); $this->assertEquals($utf_expected, $utf_result, "$hex_expected == $form($hex_tested) ($hex_expected != $hex_result)"); |