From b45ea0dffb90fd68b8c3856770ad5e0420c929d2 Mon Sep 17 00:00:00 2001 From: Neo <321592+Neo-Desktop@users.noreply.github.com> Date: Fri, 19 Dec 2025 00:40:53 -0800 Subject: [PATCH] Version 3.4.6 --- Documentation/START_HERE.html | 6 +- Documentation/data/images/index.html | 2 +- Documentation/data/index.html | 2 +- Tools/331_archive_update_php.php | 2 +- Tools/333_archive_update_php.php | 2 +- Tools/34x_fix_posts_php.php | 2 +- Tools/_postUpdateRebuild.php | 2 +- Tools/build4release.php | 2 +- Tools/buildInDev.php | 2 +- Tools/check_requirements.php | 561 +- Tools/groupBitwiseEdit_php.php | 2 +- Tools/readme.txt | 56 + Tools/rebuildFromXml.php | 2 +- Tools/rebuildGallery4.php | 2 +- Tools/rebuildGalleryImages.php | 2 +- Tools/rebuildPms.php | 2 +- Tools/rebuildPosts.php | 2 +- Tools/seoFiles.php | 2 +- Tools/seoGalleryAlbums.php | 2 +- Tools/seoMemberNames.php | 2 +- Tools/seoTopicTitles.php | 2 +- Tools/skinchange.php | 2 +- Tools/ssi_templates/index.html | 2 +- Tools/upgradeFinish/index.php | 2 +- upload/admin/api/api_core.php | 2 +- upload/admin/api/forums/api_topic_view.php | 2 +- upload/admin/api/forums/index.html | 2 +- upload/admin/api/index.html | 2 +- .../core/extensions/admin/group_form.php | 2 +- .../core/extensions/admin/index.html | 2 +- .../core/extensions/admin/member_form.php | 2 +- .../core/extensions/comments/index.html | 2 +- .../core/extensions/coreExtensions.php | 4 +- .../core/extensions/coreVariables.php | 2 +- .../extensions/dashboardNotifications.php | 570 +- .../core/extensions/editorSections.php | 2 +- .../core/extensions/enhancements/facebook.php | 4 +- .../enhancements/googleanalytics.php | 2 +- .../extensions/enhancements/ipsbackup.php | 2 +- .../core/extensions/enhancements/ipscdn.php | 6 +- .../core/extensions/enhancements/twitter.php | 4 +- .../core/extensions/enhancements/viglink.php | 6 +- .../extensions/enhancements/windowslive.php | 2 +- .../core/extensions/furlTemplates.php | 16 +- .../core/extensions/furlTemplatesID.php | 106 - .../applications/core/extensions/index.html | 2 +- .../core/extensions/like/default.php | 2 +- .../core/extensions/navigation/generate.php | 18 +- .../core/extensions/navigation/index.html | 2 +- .../core/extensions/notifications.php | 2 +- .../core/extensions/reportPlugins/default.php | 2 +- .../core/extensions/reportPlugins/index.html | 2 +- .../core/extensions/rssOutput.php | 2 +- .../core/extensions/search/config.php | 2 +- .../core/extensions/search/engines/index.html | 2 +- .../core/extensions/search/engines/sql.php | 2 +- .../core/extensions/search/form.php | 2 +- .../core/extensions/search/format.php | 2 +- .../core/extensions/search/index.html | 2 +- .../core/extensions/sharedmedia/index.html | 2 +- .../sharedmedia/plugin_attachments.php | 2 +- .../core/extensions/sitemapPlugins/index.html | 2 +- .../core/extensions/sphinxTemplate.php | 4 +- .../core/extensions/usercpForms.php | 6557 ++-- .../applications/core/extensions/warnings.php | 2 +- upload/admin/applications/core/index.html | 2 +- .../applications/core/js/acp.homepage.js | 2 +- upload/admin/applications/core/js/index.html | 2 +- upload/admin/applications/core/js/ipb3CSS.js | 16 +- .../applications/core/js/ipb3TemplateDiff.js | 6 +- .../applications/core/js/ipb3TemplateSandR.js | 2 +- .../applications/core/js/ipb3Templates.js | 16 +- .../core/modules_admin/ajax/bookmarks.php | 2 +- .../core/modules_admin/ajax/compare.php | 2 +- .../core/modules_admin/ajax/css.php | 2 +- .../core/modules_admin/ajax/editor.php | 2 +- .../core/modules_admin/ajax/findnames.php | 228 +- .../core/modules_admin/ajax/hooks.php | 2 +- .../core/modules_admin/ajax/index.html | 2 +- .../core/modules_admin/ajax/livesearch.php | 1130 +- .../core/modules_admin/ajax/replacements.php | 2 +- .../core/modules_admin/ajax/skinsets.php | 2 +- .../core/modules_admin/ajax/tabs.php | 2 +- .../core/modules_admin/ajax/templatediff.php | 2 +- .../core/modules_admin/ajax/templates.php | 2 +- .../core/modules_admin/ajax/templatesandr.php | 2 +- .../core/modules_admin/ajax/uagents.php | 2 +- .../applications/applications.php | 2 +- .../core/modules_admin/applications/blog.php | 4 +- .../core/modules_admin/applications/ccs.php | 4 +- .../modules_admin/applications/copyright.php | 2 +- .../applications/defaultSection.php | 2 +- .../modules_admin/applications/downloads.php | 4 +- .../applications/enhancements.php | 2 +- .../modules_admin/applications/gallery.php | 4 +- .../core/modules_admin/applications/hooks.php | 7083 ++-- .../modules_admin/applications/index.html | 2 +- .../core/modules_admin/applications/nexus.php | 4 +- .../core/modules_admin/applications/setup.php | 2335 +- .../modules_admin/applications/xml/index.html | 2 +- .../modules_admin/applications/xml/menu.xml | 12 +- .../applications/xml/permissions.xml | 30 +- .../core/modules_admin/attach/attach.php | 2 +- .../core/modules_admin/attach/index.html | 2 +- .../diagnostics/defaultSection.php | 2 +- .../modules_admin/diagnostics/diagnostics.php | 1645 +- .../core/modules_admin/diagnostics/index.html | 2 +- .../modules_admin/diagnostics/xml/index.html | 2 +- .../modules_admin/diagnostics/xml/menu.xml | 28 +- .../diagnostics/xml/permissions.xml | 14 +- .../modules_admin/help/defaultSection.php | 2 +- .../core/modules_admin/help/index.html | 2 +- .../core/modules_admin/help/quickhelp.php | 14 +- .../core/modules_admin/help/xml/index.html | 2 +- .../core/modules_admin/help/xml/menu.xml | 152 +- .../core/modules_admin/index.html | 2 +- .../languages/defaultSection.php | 2 +- .../core/modules_admin/languages/index.html | 2 +- .../languages/manage_languages.php | 6114 ++- .../modules_admin/languages/xml/index.html | 2 +- .../core/modules_admin/languages/xml/menu.xml | 4 +- .../languages/xml/permissions.xml | 8 +- .../core/modules_admin/login/index.html | 2 +- .../modules_admin/login/manualResolver.php | 902 +- .../core/modules_admin/logs/adminlogs.php | 2 +- .../modules_admin/logs/defaultSection.php | 2 +- .../modules_admin/logs/emailerrorlogs.php | 2 +- .../core/modules_admin/logs/errorlogs.php | 2 +- .../core/modules_admin/logs/index.html | 2 +- .../core/modules_admin/logs/loginlog.php | 2 +- .../core/modules_admin/logs/logsSplash.php | 2 +- .../core/modules_admin/logs/mobilelogs.php | 2 +- .../core/modules_admin/logs/modlogs.php | 2 +- .../core/modules_admin/logs/spamlogs.php | 2 +- .../core/modules_admin/logs/spiderlogs.php | 560 +- .../core/modules_admin/logs/sqlerror.php | 2 +- .../core/modules_admin/logs/tasklogs.php | 20 +- .../core/modules_admin/logs/warnlogs.php | 2 +- .../core/modules_admin/logs/xml/index.html | 2 +- .../core/modules_admin/logs/xml/menu.xml | 4 +- .../modules_admin/logs/xml/permissions.xml | 46 +- .../core/modules_admin/logs/xmlrpclogs.php | 2 +- .../mobileapp/defaultSection.php | 2 +- .../core/modules_admin/mobileapp/images.php | 2 +- .../core/modules_admin/mobileapp/index.html | 2 +- .../modules_admin/mobileapp/xml/index.html | 2 +- .../core/modules_admin/mobileapp/xml/menu.xml | 4 +- .../mobileapp/xml/permissions.xml | 4 +- .../core/modules_admin/mycp/dashboard.php | 22 +- .../modules_admin/mycp/defaultSection.php | 2 +- .../core/modules_admin/mycp/details.php | 2 +- .../core/modules_admin/mycp/index.html | 2 +- .../core/modules_admin/mycp/tabs.php | 2 +- .../core/modules_admin/mycp/xml/index.html | 2 +- .../core/modules_admin/mycp/xml/menu.xml | 8 +- .../modules_admin/mycp/xml/permissions.xml | 4 +- .../core/modules_admin/posts/badwords.php | 2 +- .../core/modules_admin/posts/bbcode.php | 2 +- .../modules_admin/posts/defaultSection.php | 2 +- .../core/modules_admin/posts/emoticons.php | 2760 +- .../core/modules_admin/posts/index.html | 2 +- .../core/modules_admin/posts/media.php | 2 +- .../core/modules_admin/posts/xml/index.html | 2 +- .../core/modules_admin/posts/xml/menu.xml | 20 +- .../modules_admin/posts/xml/permissions.xml | 32 +- .../modules_admin/report/defaultSection.php | 2 +- .../core/modules_admin/report/index.html | 2 +- .../core/modules_admin/report/reports.php | 2 +- .../core/modules_admin/report/xml/index.html | 2 +- .../core/modules_admin/report/xml/menu.xml | 8 +- .../modules_admin/report/xml/permissions.xml | 12 +- .../core/modules_admin/seo/xml/menu.xml | 8 +- .../modules_admin/seo/xml/permissions.xml | 4 +- .../modules_admin/settings/defaultSection.php | 2 +- .../core/modules_admin/settings/index.html | 2 +- .../core/modules_admin/settings/settings.php | 4210 +-- .../modules_admin/settings/xml/index.html | 2 +- .../core/modules_admin/settings/xml/menu.xml | 4 +- .../settings/xml/permissions.xml | 6 +- .../core/modules_admin/sql/defaultSection.php | 2 +- .../core/modules_admin/sql/index.html | 2 +- .../core/modules_admin/sql/mysql.php | 12 +- .../core/modules_admin/sql/toolbox.php | 2 +- .../core/modules_admin/sql/xml/index.html | 2 +- .../core/modules_admin/sql/xml/menu.xml | 16 +- .../core/modules_admin/system/charts.php | 2 +- .../modules_admin/system/defaultSection.php | 2 +- .../core/modules_admin/system/index.html | 2 +- .../core/modules_admin/system/security.php | 10 +- .../core/modules_admin/system/taskmanager.php | 2 +- .../core/modules_admin/system/xml/index.html | 2 +- .../core/modules_admin/system/xml/menu.xml | 12 +- .../modules_admin/system/xml/permissions.xml | 32 +- .../templates/defaultSection.php | 2 +- .../core/modules_admin/templates/easylogo.php | 17 +- .../core/modules_admin/templates/external.php | 2 +- .../modules_admin/templates/importexport.php | 2 +- .../core/modules_admin/templates/index.html | 2 +- .../modules_admin/templates/replacements.php | 2 +- .../templates/searchandreplace.php | 2 +- .../core/modules_admin/templates/skindiff.php | 2 +- .../core/modules_admin/templates/skinsets.php | 11 +- .../templates/systemTemplates.php | 2 +- .../modules_admin/templates/templates.php | 2 +- .../core/modules_admin/templates/tools.php | 2 +- .../core/modules_admin/templates/urlmap.php | 2 +- .../modules_admin/templates/useragents.php | 2 +- .../modules_admin/templates/xml/index.html | 2 +- .../core/modules_admin/templates/xml/menu.xml | 36 +- .../templates/xml/permissions.xml | 40 +- .../core/modules_admin/tools/api.php | 2 +- .../core/modules_admin/tools/cache.php | 2 +- .../modules_admin/tools/defaultSection.php | 2 +- .../core/modules_admin/tools/help.php | 2 +- .../modules_admin/tools/incomingEmails.php | 2 +- .../core/modules_admin/tools/index.html | 2 +- .../core/modules_admin/tools/licensekey.php | 37 +- .../core/modules_admin/tools/login.php | 2 +- .../core/modules_admin/tools/logsSplash.php | 2 +- .../core/modules_admin/tools/performance.php | 2 +- .../core/modules_admin/tools/qanda.php | 2 +- .../core/modules_admin/tools/rebuild.php | 6111 ++- .../core/modules_admin/tools/sharelinks.php | 2 +- .../core/modules_admin/tools/uagents.php | 2 +- .../core/modules_admin/tools/xml/index.html | 2 +- .../core/modules_admin/tools/xml/menu.xml | 57 +- .../modules_admin/tools/xml/permissions.xml | 76 +- .../core/modules_public/ajax/attach.php | 2 +- .../core/modules_public/ajax/captcha.php | 2 +- .../core/modules_public/ajax/comments.php | 2 +- .../modules_public/ajax/defaultSection.php | 2 +- .../core/modules_public/ajax/editor.php | 2 +- .../core/modules_public/ajax/facebook.php | 2 +- .../core/modules_public/ajax/findnames.php | 218 +- .../core/modules_public/ajax/index.html | 2 +- .../core/modules_public/ajax/like.php | 2 +- .../core/modules_public/ajax/login.php | 2 +- .../core/modules_public/ajax/media.php | 2 +- .../core/modules_public/ajax/modcp.php | 348 +- .../core/modules_public/ajax/navigation.php | 2 +- .../modules_public/ajax/notifications.php | 2 +- .../core/modules_public/ajax/register.php | 2 +- .../core/modules_public/ajax/reports.php | 2 +- .../core/modules_public/ajax/reputation.php | 15 +- .../core/modules_public/ajax/search.php | 2 +- .../core/modules_public/ajax/sharelinks.php | 2 +- .../core/modules_public/ajax/skin.php | 2 +- .../core/modules_public/ajax/skingen.php | 2 +- .../core/modules_public/ajax/tags.php | 2 +- .../core/modules_public/ajax/templates.php | 2 +- .../core/modules_public/ajax/usercp.php | 220 +- .../core/modules_public/attach/attach.php | 2 +- .../modules_public/attach/defaultSection.php | 2 +- .../core/modules_public/attach/index.html | 2 +- .../core/modules_public/global/captcha.php | 2 +- .../core/modules_public/global/comments.php | 2 +- .../modules_public/global/defaultSection.php | 2 +- .../core/modules_public/global/index.html | 2 +- .../core/modules_public/global/like.php | 2 +- .../core/modules_public/global/login.php | 1111 +- .../core/modules_public/global/lostpass.php | 966 +- .../core/modules_public/global/navigation.php | 2 +- .../core/modules_public/global/privacy.php | 2 +- .../core/modules_public/global/register.php | 228 +- .../core/modules_public/global/reputation.php | 2 +- .../core/modules_public/global/rss.php | 10 +- .../core/modules_public/global/share.php | 2 +- .../core/modules_public/global/sitemap.php | 2 +- .../core/modules_public/global/skin.php | 2 +- .../modules_public/global/unsubscribe.php | 2 +- .../modules_public/help/defaultSection.php | 2 +- .../core/modules_public/help/help.php | 2 +- .../core/modules_public/help/index.html | 2 +- .../core/modules_public/index.html | 2 +- .../modules_public/modcp/defaultSection.php | 2 +- .../core/modules_public/modcp/index.html | 2 +- .../core/modules_public/modcp/modcp.php | 2 +- .../modules_public/reports/defaultSection.php | 2 +- .../core/modules_public/reports/index.html | 2 +- .../core/modules_public/reports/reports.php | 2 +- .../modules_public/search/defaultSection.php | 2 +- .../core/modules_public/search/index.html | 2 +- .../core/modules_public/search/search.php | 2594 +- .../core/modules_public/task/index.html | 2 +- .../modules_public/task/manualResolver.php | 2 +- .../core/modules_public/usercp/index.html | 2 +- .../modules_public/usercp/manualResolver.php | 2 +- .../admin/applications/core/setup/index.html | 2 +- .../applications/core/setup/upgradeCheck.php | 2 +- .../core/setup/versions/index.html | 2 +- .../core/setup/versions/install/index.html | 2 +- .../install/sql/core_mysql_inserts.php | 71 +- .../install/sql/core_mysql_tables.php | 23 +- .../setup/versions/install/sql/index.html | 2 +- .../core/setup/versions/upg_10002/index.html | 2 +- .../upg_10002/version_upgrade_mysql.php | 8 +- .../core/setup/versions/upg_10004/index.html | 2 +- .../upg_10004/version_upgrade_mysql.php | 6 +- .../core/setup/versions/upg_20004/index.html | 2 +- .../versions/upg_20004/mysql_updates.php | 2 +- .../core/setup/versions/upg_20005/index.html | 2 +- .../versions/upg_20005/mysql_updates.php | 2 +- .../core/setup/versions/upg_20007/index.html | 2 +- .../versions/upg_20007/mysql_updates.php | 2 +- .../core/setup/versions/upg_20009/index.html | 2 +- .../versions/upg_20009/mysql_updates.php | 2 +- .../core/setup/versions/upg_20010/index.html | 2 +- .../versions/upg_20010/mysql_updates.php | 2 +- .../core/setup/versions/upg_20012/index.html | 2 +- .../versions/upg_20012/mysql_updates.php | 2 +- .../core/setup/versions/upg_21003/index.html | 2 +- .../versions/upg_21003/mysql_updates.php | 2 +- .../versions/upg_21003/mysql_updates_1.php | 2 +- .../versions/upg_21003/mysql_updates_2.php | 2 +- .../versions/upg_21003/mysql_updates_3.php | 2 +- .../versions/upg_21003/mysql_updates_4.php | 10 +- .../versions/upg_21003/version_upgrade.php | 928 +- .../core/setup/versions/upg_21005/index.html | 2 +- .../versions/upg_21005/mysql_updates.php | 2 +- .../core/setup/versions/upg_21007/index.html | 2 +- .../versions/upg_21007/mysql_updates.php | 2 +- .../versions/upg_21007/version_upgrade.php | 184 +- .../core/setup/versions/upg_21008/index.html | 2 +- .../versions/upg_21008/mysql_updates.php | 4 +- .../core/setup/versions/upg_21009/index.html | 2 +- .../versions/upg_21009/mysql_updates.php | 4 +- .../core/setup/versions/upg_21010/index.html | 2 +- .../versions/upg_21010/mysql_updates.php | 2 +- .../core/setup/versions/upg_21011/index.html | 2 +- .../versions/upg_21011/mysql_updates.php | 2 +- .../versions/upg_22005/mysql_updates.php | 2 +- .../versions/upg_22005/mysql_updates_1.php | 2 +- .../versions/upg_22005/mysql_updates_2.php | 2 +- .../versions/upg_22005/mysql_updates_3.php | 2 +- .../versions/upg_22005/version_upgrade.php | 770 +- .../versions/upg_22006/mysql_updates.php | 2 +- .../core/setup/versions/upg_22007/index.html | 2 +- .../versions/upg_22007/mysql_updates.php | 2 +- .../core/setup/versions/upg_22009/index.html | 2 +- .../versions/upg_22009/mysql_updates.php | 2 +- .../core/setup/versions/upg_22010/index.html | 2 +- .../versions/upg_22010/mysql_updates.php | 2 +- .../core/setup/versions/upg_22011/index.html | 2 +- .../versions/upg_22011/mysql_updates.php | 2 +- .../core/setup/versions/upg_23000/index.html | 2 +- .../versions/upg_23000/mysql_updates.php | 2 +- .../core/setup/versions/upg_23002/index.html | 2 +- .../versions/upg_23002/mysql_updates.php | 2 +- .../core/setup/versions/upg_23003/index.html | 2 +- .../versions/upg_23003/mysql_updates.php | 2 +- .../core/setup/versions/upg_23005/index.html | 2 +- .../versions/upg_23005/mysql_updates.php | 2 +- .../core/setup/versions/upg_23008/index.html | 2 +- .../versions/upg_23008/mysql_updates.php | 2 +- .../core/setup/versions/upg_23010/index.html | 2 +- .../versions/upg_23010/mysql_updates.php | 2 +- .../versions/upg_30001/mysql_updates.php | 2 +- .../versions/upg_30001/mysql_updates_1.php | 2 +- .../versions/upg_30001/mysql_updates_2.php | 2 +- .../versions/upg_30001/mysql_updates_3.php | 2 +- .../versions/upg_30001/mysql_updates_4.php | 2 +- .../versions/upg_30001/mysql_updates_5.php | 42 +- .../versions/upg_30001/mysql_updates_6.php | 2 +- .../upg_30001/mysql_version_upgrade.php | 2 +- .../versions/upg_30001/version_class.php | 322 +- .../versions/upg_30001/version_upgrade.php | 3437 +- .../core/setup/versions/upg_30003/index.html | 2 +- .../versions/upg_30003/mysql_updates.php | 2 +- .../core/setup/versions/upg_30004/index.html | 2 +- .../versions/upg_30004/mysql_updates.php | 2 +- .../core/setup/versions/upg_30005/index.html | 2 +- .../versions/upg_30005/mysql_updates.php | 2 +- .../core/setup/versions/upg_30006/index.html | 2 +- .../versions/upg_30006/mysql_updates.php | 2 +- .../core/setup/versions/upg_30007/index.html | 2 +- .../versions/upg_30007/mysql_updates.php | 2 +- .../core/setup/versions/upg_30008/index.html | 2 +- .../versions/upg_30008/mysql_updates.php | 2 +- .../versions/upg_30008/version_upgrade.php | 166 +- .../core/setup/versions/upg_30009/index.html | 2 +- .../versions/upg_30009/mysql_updates.php | 2 +- .../core/setup/versions/upg_30010/index.html | 2 +- .../versions/upg_30010/mysql_updates.php | 2 +- .../core/setup/versions/upg_30011/index.html | 2 +- .../versions/upg_30011/mysql_updates.php | 2 +- .../core/setup/versions/upg_30012/index.html | 2 +- .../versions/upg_30012/mysql_updates.php | 2 +- .../core/setup/versions/upg_31000/index.html | 2 +- .../versions/upg_31000/mysql_updates.php | 17 +- .../core/setup/versions/upg_31003/index.html | 2 +- .../versions/upg_31003/mysql_updates.php | 11 +- .../core/setup/versions/upg_31004/index.html | 2 +- .../versions/upg_31004/mysql_updates.php | 2 +- .../core/setup/versions/upg_31005/index.html | 2 +- .../versions/upg_31005/mysql_updates.php | 2 +- .../core/setup/versions/upg_31006/index.html | 2 +- .../versions/upg_31006/mysql_updates.php | 2 +- .../core/setup/versions/upg_31007/index.html | 2 +- .../versions/upg_31007/mysql_updates.php | 2 +- .../core/setup/versions/upg_32000/index.html | 2 +- .../versions/upg_32000/mysql_updates.php | 2 +- .../versions/upg_32000/mysql_updates_1.php | 2 +- .../versions/upg_32000/mysql_updates_2.php | 2 +- .../versions/upg_32000/mysql_updates_3.php | 2 +- .../versions/upg_32000/mysql_updates_4.php | 2 +- .../versions/upg_32000/mysql_updates_5.php | 2 +- .../versions/upg_32000/mysql_updates_6.php | 2 +- .../upg_32000/mysql_updates_logs_1.php | 2 +- .../upg_32000/mysql_updates_logs_10.php | 2 +- .../upg_32000/mysql_updates_logs_2.php | 2 +- .../upg_32000/mysql_updates_logs_3.php | 2 +- .../upg_32000/mysql_updates_logs_4.php | 2 +- .../upg_32000/mysql_updates_logs_5.php | 2 +- .../upg_32000/mysql_updates_logs_6.php | 2 +- .../upg_32000/mysql_updates_logs_7.php | 2 +- .../upg_32000/mysql_updates_logs_8.php | 2 +- .../upg_32000/mysql_updates_logs_9.php | 2 +- .../versions/upg_32000/version_class.php | 226 +- .../versions/upg_32000/version_upgrade.php | 1883 +- .../core/setup/versions/upg_32001/index.html | 2 +- .../versions/upg_32001/mysql_updates.php | 7 +- .../versions/upg_32001/version_upgrade.php | 232 +- .../core/setup/versions/upg_32002/index.html | 2 +- .../versions/upg_32002/mysql_updates.php | 2 +- .../core/setup/versions/upg_32003/index.html | 2 +- .../versions/upg_32003/mysql_updates.php | 2 +- .../core/setup/versions/upg_32004/index.html | 2 +- .../versions/upg_32004/mysql_updates.php | 2 +- .../core/setup/versions/upg_32005/index.html | 2 +- .../versions/upg_32005/mysql_updates.php | 2 +- .../core/setup/versions/upg_32006/index.html | 2 +- .../versions/upg_32006/mysql_updates.php | 2 +- .../core/setup/versions/upg_32007/index.html | 2 +- .../versions/upg_32007/mysql_updates.php | 2 +- .../core/setup/versions/upg_33000/index.html | 2 +- .../versions/upg_33000/mysql_updates.php | 10 +- .../versions/upg_33000/mysql_updates_1.php | 4 +- .../versions/upg_33000/mysql_updates_2.php | 2 +- .../versions/upg_33000/version_class.php | 237 +- .../versions/upg_33000/version_upgrade.php | 2 +- .../core/setup/versions/upg_33007/index.html | 2 +- .../versions/upg_33007/version_upgrade.php | 2 +- .../core/setup/versions/upg_33009/index.html | 2 +- .../core/setup/versions/upg_33010/index.html | 2 +- .../versions/upg_33010/version_class.php | 162 +- .../core/setup/versions/upg_33012/index.html | 2 +- .../core/setup/versions/upg_33013/index.html | 2 +- .../core/setup/versions/upg_33014/index.html | 2 +- .../core/setup/versions/upg_33015/index.html | 2 +- .../core/setup/versions/upg_33016/index.html | 2 +- .../versions/upg_34000/version_class.php | 2 +- .../versions/upg_34000/version_upgrade.php | 6 +- .../versions/upg_34008/mysql_updates.php | 3 - .../versions/upg_34012/mysql_updates.php | 7 + .../core/skin_cp/cp_skin_adminlogs.php | 2 +- .../applications/core/skin_cp/cp_skin_api.php | 12 +- .../core/skin_cp/cp_skin_applications.php | 6536 ++-- .../core/skin_cp/cp_skin_badwords.php | 2 +- .../core/skin_cp/cp_skin_bbcode.php | 2 +- .../core/skin_cp/cp_skin_diagnostics.php | 1564 +- .../core/skin_cp/cp_skin_emailerrorlogs.php | 2 +- .../core/skin_cp/cp_skin_emoticons.php | 2 +- .../core/skin_cp/cp_skin_errorlogs.php | 2 +- .../core/skin_cp/cp_skin_group_core.php | 2 +- .../core/skin_cp/cp_skin_help_files.php | 2 +- .../core/skin_cp/cp_skin_hooks_export.php | 2 +- .../core/skin_cp/cp_skin_mobileapp.php | 2 +- .../core/skin_cp/cp_skin_mobilelogs.php | 2 +- .../core/skin_cp/cp_skin_modlogs.php | 2 +- .../core/skin_cp/cp_skin_mycp.php | 6 +- .../core/skin_cp/cp_skin_performance.php | 2 +- .../core/skin_cp/cp_skin_qanda.php | 2 +- .../core/skin_cp/cp_skin_rebuild.php | 2 +- .../core/skin_cp/cp_skin_reports.php | 2 +- .../core/skin_cp/cp_skin_security.php | 2 +- .../core/skin_cp/cp_skin_settings.php | 1300 +- .../core/skin_cp/cp_skin_setup.php | 2 +- .../core/skin_cp/cp_skin_spamlogs.php | 2 +- .../core/skin_cp/cp_skin_spiderlogs.php | 2 +- .../applications/core/skin_cp/cp_skin_sql.php | 2 +- .../core/skin_cp/cp_skin_system.php | 2 +- .../core/skin_cp/cp_skin_templates.php | 27 +- .../core/skin_cp/cp_skin_tools.php | 2 +- .../core/skin_cp/cp_skin_warnlogs.php | 2 +- .../core/skin_cp/images/index.html | 2 +- .../applications/core/skin_cp/index.html | 2 +- .../sources/classes/attach/class_attach.php | 3398 +- .../sources/classes/attach/controller.php | 2 +- .../core/sources/classes/attach/index.html | 2 +- .../core/sources/classes/hooks/gateway.php | 2 +- .../core/sources/classes/hooks/index.html | 2 +- .../core/sources/classes/hooksFunctions.php | 2 +- .../core/sources/classes/index.html | 2 +- .../core/sources/classes/reportLibrary.php | 2 +- .../sources/classes/reportNotifications.php | 2 +- .../applications/core/sources/index.html | 2 +- upload/admin/applications/core/sql/index.html | 2 +- .../core/sql/mysql_report_queries.php | 2 +- .../core/sql/mysql_seo_queries.php | 2 +- .../core/sql/mysql_tag_queries.php | 2 +- .../admin/applications/core/tasks/archive.php | 230 +- .../admin/applications/core/tasks/backup.php | 214 +- .../applications/core/tasks/cleanout.php | 2 +- .../applications/core/tasks/contentcache.php | 2 +- .../admin/applications/core/tasks/index.html | 2 +- .../applications/core/tasks/itemmarkers.php | 2 +- .../applications/core/tasks/logprune.php | 13 +- .../applications/core/tasks/minifycleanup.php | 2 +- .../applications/core/tasks/mysqlcleanup.php | 2 +- .../applications/core/tasks/optimize.php | 2 +- .../applications/core/tasks/pop3email.php | 2 +- .../applications/core/tasks/rebuildstats.php | 2 +- .../core/tasks/sitemapgenerator.php | 2 +- .../core/xml/admin_core_language_pack.xml | 31316 ++++++++-------- .../applications/core/xml/core_bbcode.xml | 222 +- .../admin/applications/core/xml/core_help.xml | 210 +- .../applications/core/xml/core_mediatag.xml | 28 +- .../applications/core/xml/core_mobile_css.xml | 18 +- .../core/xml/core_mobile_templates.xml | 52 +- .../applications/core/xml/core_modules.xml | 76 +- .../applications/core/xml/core_root_css.xml | 36 +- .../core/xml/core_root_templates.xml | 215 +- .../applications/core/xml/core_settings.xml | 3278 +- .../applications/core/xml/core_tasks.xml | 48 +- .../core/xml/core_xmlskin_css.xml | 22 +- upload/admin/applications/core/xml/hooks.xml | 4 - .../core/xml/hooks/adcodesidebar.xml | 6 +- .../applications/core/xml/hooks/index.html | 2 +- .../applications/core/xml/hooks/vkontakte.xml | 206 - upload/admin/applications/core/xml/index.html | 2 +- .../applications/core/xml/information.xml | 10 +- .../core/xml/public_core_language_pack.xml | 20204 +++++----- .../admin/applications/core/xml/versions.xml | 4 + .../applications/forums/app_class_forums.php | 8 +- .../forums/extensions/admin/group_form.php | 2 +- .../forums/extensions/admin/index.html | 2 +- .../forums/extensions/admin/member_form.php | 2 +- .../forums/extensions/attachments/index.html | 2 +- .../extensions/attachments/plugin_post.php | 2 +- .../extensions/content/feed_blocks/forums.php | 4 +- .../extensions/content/feed_blocks/index.html | 2 +- .../forums/extensions/content/index.html | 2 +- .../content/plugin_blocks/index.html | 2 +- .../plugin_blocks/site_poll/index.html | 2 +- .../forums/extensions/coreExtensions.php | 8 +- .../forums/extensions/coreVariables.php | 2 +- .../forums/extensions/dataHookLocations.php | 2 +- .../forums/extensions/editorSections.php | 2 +- .../forums/extensions/furlRedirect.php | 412 +- .../forums/extensions/furlTemplates.php | 8 +- .../forums/extensions/furlTemplatesID.php | 82 - .../applications/forums/extensions/index.html | 2 +- .../forums/extensions/like/forums.php | 2 +- .../forums/extensions/like/index.html | 2 +- .../forums/extensions/like/topics.php | 2 +- .../forums/extensions/memberSync.rename.php | 2 +- .../forums/extensions/modcp/index.html | 2 +- .../extensions/modcp/plugin_announcements.php | 2 +- .../extensions/modcp/plugin_deletedposts.php | 2 +- .../extensions/modcp/plugin_deletedtopics.php | 2 +- .../modcp/plugin_unapprovedposts.php | 2 +- .../modcp/plugin_unapprovedtopics.php | 2 +- .../forums/extensions/navigation/generate.php | 2 +- .../forums/extensions/navigation/index.html | 2 +- .../forums/extensions/notifications.php | 2 +- .../forums/extensions/profileTabs/index.html | 2 +- .../extensions/profileTabs/posts.conf.php | 2 +- .../forums/extensions/profileTabs/posts.php | 2 +- .../extensions/profileTabs/topics.conf.php | 2 +- .../forums/extensions/profileTabs/topics.php | 2 +- .../extensions/reportPlugins/index.html | 2 +- .../forums/extensions/reportPlugins/post.php | 2 +- .../forums/extensions/reputation.php | 10 +- .../forums/extensions/rssOutput.php | 2 +- .../forums/extensions/search/config.php | 2 +- .../extensions/search/engines/index.html | 2 +- .../extensions/search/engines/sphinx.php | 2 +- .../forums/extensions/search/engines/sql.php | 2 +- .../forums/extensions/search/form.php | 2 +- .../forums/extensions/search/format.php | 8 +- .../forums/extensions/search/index.html | 2 +- .../forums/extensions/sphinxTemplate.php | 4 +- .../forums/extensions/tags/index.html | 2 +- .../forums/extensions/tags/topics.php | 2 +- .../forums/extensions/warnings.php | 2 +- upload/admin/applications/forums/index.html | 2 +- .../admin/applications/forums/js/index.html | 2 +- .../forums/modules_admin/ajax/archive.php | 2 +- .../forums/modules_admin/ajax/index.html | 2 +- .../modules_admin/ajax/member_editform.php | 2 +- .../forums/modules_admin/archive/archive.php | 788 +- .../modules_admin/archive/defaultSection.php | 2 +- .../forums/modules_admin/archive/index.html | 2 +- .../modules_admin/archive/xml/index.html | 2 +- .../forums/modules_admin/archive/xml/menu.xml | 8 +- .../modules_admin/archive/xml/permissions.xml | 6 +- .../attachments/defaultSection.php | 2 +- .../modules_admin/attachments/index.html | 2 +- .../modules_admin/attachments/search.php | 708 +- .../modules_admin/attachments/stats.php | 2 +- .../modules_admin/attachments/types.php | 2 +- .../modules_admin/attachments/xml/index.html | 2 +- .../modules_admin/attachments/xml/menu.xml | 12 +- .../attachments/xml/permissions.xml | 22 +- .../modules_admin/forums/defaultSection.php | 2 +- .../forums/modules_admin/forums/forums.php | 8 +- .../forums/modules_admin/forums/index.html | 2 +- .../forums/modules_admin/forums/moderator.php | 2 +- .../forums/modules_admin/forums/multimods.php | 2 +- .../modules_admin/forums/xml/index.html | 2 +- .../forums/modules_admin/forums/xml/menu.xml | 8 +- .../modules_admin/forums/xml/permissions.xml | 38 +- .../forums/modules_admin/index.html | 2 +- .../modules_admin/rss/defaultSection.php | 2 +- .../forums/modules_admin/rss/export.php | 2 +- .../forums/modules_admin/rss/import.php | 2572 +- .../forums/modules_admin/rss/index.html | 2 +- .../forums/modules_admin/rss/xml/index.html | 2 +- .../forums/modules_admin/rss/xml/menu.xml | 8 +- .../modules_admin/rss/xml/permissions.xml | 12 +- .../statistics/defaultSection.php | 2 +- .../modules_admin/statistics/index.html | 2 +- .../forums/modules_admin/statistics/stats.php | 2 +- .../modules_admin/statistics/xml/index.html | 2 +- .../modules_admin/statistics/xml/menu.xml | 24 +- .../statistics/xml/permissions.xml | 56 +- .../modules_admin/tools/defaultSection.php | 2 +- .../forums/modules_admin/tools/index.html | 2 +- .../forums/modules_admin/tools/tools.php | 2 +- .../forums/modules_admin/tools/xml/index.html | 2 +- .../modules_admin/tools/xml/permissions.xml | 8 +- .../modules_public/ajax/attachments.php | 2 +- .../modules_public/ajax/defaultSection.php | 2 +- .../forums/modules_public/ajax/emoticons.php | 2 +- .../forums/modules_public/ajax/forums.php | 2 +- .../forums/modules_public/ajax/index.html | 2 +- .../forums/modules_public/ajax/markasread.php | 2 +- .../forums/modules_public/ajax/stats.php | 2 +- .../forums/modules_public/ajax/topics.php | 96 +- .../forums/modules_public/extras/answer.php | 2 +- .../modules_public/extras/boardrules.php | 2 +- .../modules_public/extras/defaultSection.php | 2 +- .../forums/modules_public/extras/forward.php | 2 +- .../forums/modules_public/extras/index.html | 2 +- .../forums/modules_public/extras/legends.php | 2 +- .../forums/modules_public/extras/rating.php | 2 +- .../forums/modules_public/extras/stats.php | 2 +- .../forums/modules_public/extras/toggle.php | 2 +- .../forums/modules_public/extras/vote.php | 2 +- .../modules_public/forums/announcements.php | 2 +- .../forums/modules_public/forums/attach.php | 2 +- .../forums/modules_public/forums/boards.php | 2 +- .../modules_public/forums/defaultSection.php | 2 +- .../forums/modules_public/forums/findpost.php | 8 +- .../forums/modules_public/forums/forums.php | 2 +- .../forums/modules_public/forums/index.html | 2 +- .../modules_public/forums/markasread.php | 2 +- .../forums/modules_public/forums/rules.php | 2 +- .../forums/modules_public/forums/topics.php | 157 +- .../forums/modules_public/index.html | 2 +- .../moderate/defaultSection.php | 2 +- .../forums/modules_public/moderate/index.html | 2 +- .../modules_public/moderate/moderate.php | 4 +- .../modules_public/moderate/multimod.php | 2 +- .../modules_public/post/defaultSection.php | 2 +- .../forums/modules_public/post/index.html | 2 +- .../forums/modules_public/post/post.php | 2 +- .../applications/forums/setup/index.html | 2 +- .../forums/setup/versions/index.html | 2 +- .../forums/setup/versions/install/index.html | 2 +- .../install/sql/forums_mysql_inserts.php | 20 +- .../setup/versions/install/sql/index.html | 2 +- .../forums/skin_cp/cp_skin_archive.php | 995 +- .../forums/skin_cp/cp_skin_attachments.php | 2 +- .../forums/skin_cp/cp_skin_forums.php | 2 +- .../forums/skin_cp/cp_skin_group_form.php | 2 +- .../forums/skin_cp/cp_skin_member_form.php | 2 +- .../forums/skin_cp/cp_skin_multimods.php | 2 +- .../forums/skin_cp/cp_skin_rss.php | 2 +- .../forums/skin_cp/cp_skin_stats.php | 2 +- .../applications/forums/skin_cp/index.html | 2 +- .../classes/forums/admin_forum_functions.php | 2 +- .../sources/classes/forums/class_forums.php | 2 +- .../forums/sources/classes/forums/index.html | 2 +- .../forums/sources/classes/hooks/gateway.php | 2 +- .../forums/sources/classes/hooks/index.html | 2 +- .../forums/sources/classes/index.html | 2 +- .../forums/sources/classes/moderate.php | 2 +- .../forums/sources/classes/post/classPost.php | 7540 ++-- .../sources/classes/post/classPostForms.php | 2 +- .../forums/sources/classes/post/index.html | 2 +- .../forums/sources/classes/topics.php | 16 +- .../applications/forums/sources/index.html | 2 +- .../admin/applications/forums/sql/index.html | 2 +- .../forums/sql/mysql_topics_queries.php | 2 +- .../forums/tasks/announcements.php | 2 +- .../forums/tasks/dailycleanout.php | 2 +- .../applications/forums/tasks/dailydigest.php | 2 +- .../applications/forums/tasks/index.html | 2 +- .../applications/forums/tasks/permadelete.php | 2 +- .../applications/forums/tasks/rssimport.php | 2 +- .../applications/forums/tasks/updateviews.php | 2 +- .../forums/tasks/weeklydigest.php | 2 +- .../forums/xml/admin_forums_language_pack.xml | 5265 ++- .../applications/forums/xml/forums_help.xml | 212 +- .../forums/xml/forums_mobile_templates.xml | 2 +- .../forums/xml/forums_modules.xml | 32 +- .../forums/xml/forums_root_templates.xml | 51 +- .../forums/xml/forums_settings.xml | 510 +- .../applications/forums/xml/forums_tasks.xml | 28 +- .../forums/xml/hooks/facebook_activity.xml | 6 +- .../applications/forums/xml/hooks/index.html | 2 +- .../forums/xml/hooks/recent_topics.xml | 106 +- .../applications/forums/xml/hooks/tags.xml | 40 +- .../admin/applications/forums/xml/index.html | 2 +- .../applications/forums/xml/information.xml | 10 +- .../xml/public_forums_language_pack.xml | 5884 +-- .../applications/forums/xml/versions.xml | 4 + upload/admin/applications/index.html | 2 +- .../members/extensions/admin/index.html | 2 +- .../members/extensions/admin/member_form.php | 2 +- .../members/extensions/attachments/index.html | 2 +- .../extensions/attachments/plugin_msg.php | 2 +- .../extensions/content/feed_blocks/index.html | 2 +- .../members/extensions/content/index.html | 2 +- .../content/plugin_blocks/index.html | 2 +- .../plugin_blocks/online_friends/index.html | 2 +- .../plugin_blocks/status_updates/index.html | 2 +- .../members/extensions/coreExtensions.php | 4 +- .../members/extensions/coreVariables.php | 2 +- .../extensions/dashboardNotifications.php | 2 +- .../members/extensions/dataHookLocations.php | 2 +- .../members/extensions/editorSections.php | 2 +- .../extensions/enhancements/mandrill.php | 4 +- .../enhancements/spammonitoring.php | 4 +- .../members/extensions/furlRedirect.php | 2 +- .../members/extensions/furlTemplates.php | 248 +- .../members/extensions/furlTemplatesID.php | 124 - .../members/extensions/index.html | 2 +- .../members/extensions/memberSync.php | 2 +- .../members/extensions/modcp/index.html | 2 +- .../extensions/modcp/plugin_banned.php | 2 +- .../extensions/modcp/plugin_iplookup.php | 2 +- .../extensions/modcp/plugin_modposts.php | 2 +- .../extensions/modcp/plugin_restrictposts.php | 2 +- .../extensions/modcp/plugin_suspended.php | 2 +- .../members/extensions/modcp/plugin_warn.php | 2 +- .../extensions/notifications/config.php | 2 +- .../extensions/notifications/index.html | 2 +- .../members/extensions/notifications/pm.php | 2 +- .../extensions/profileTabs/friends.conf.php | 2 +- .../extensions/profileTabs/friends.php | 2 +- .../members/extensions/profileTabs/index.html | 2 +- .../profileTabs/reputation.conf.php | 2 +- .../extensions/profileTabs/reputation.php | 2 +- .../extensions/profileTabs/status.conf.php | 2 +- .../members/extensions/profileTabs/status.php | 2 +- .../extensions/reportPlugins/index.html | 2 +- .../extensions/reportPlugins/messages.php | 2 +- .../extensions/reportPlugins/profiles.php | 2 +- .../members/extensions/search/config.php | 2 +- .../extensions/search/engines/index.html | 2 +- .../members/extensions/search/engines/sql.php | 1062 +- .../members/extensions/search/form.php | 2 +- .../members/extensions/search/format.php | 2 +- .../members/extensions/search/index.html | 2 +- .../members/extensions/sphinxTemplate.php | 2 +- .../members/extensions/warnings.php | 2 +- upload/admin/applications/members/index.html | 2 +- .../admin/applications/members/js/index.html | 2 +- .../members/modules_admin/ajax/bulkmail.php | 2 +- .../modules_admin/ajax/defaultSection.php | 2 +- .../members/modules_admin/ajax/editform.php | 2 +- .../members/modules_admin/ajax/index.html | 2 +- .../members/modules_admin/ajax/members.php | 2 +- .../modules_admin/bulkmail/bulkmail.php | 32 +- .../modules_admin/bulkmail/defaultSection.php | 2 +- .../members/modules_admin/bulkmail/index.html | 2 +- .../modules_admin/bulkmail/xml/index.html | 2 +- .../modules_admin/bulkmail/xml/menu.xml | 4 +- .../bulkmail/xml/permissions.xml | 16 +- .../modules_admin/cfields/customfields.php | 2 +- .../modules_admin/cfields/defaultSection.php | 2 +- .../members/modules_admin/cfields/index.html | 2 +- .../modules_admin/cfields/xml/index.html | 2 +- .../modules_admin/cfields/xml/menu.xml | 4 +- .../modules_admin/cfields/xml/permissions.xml | 20 +- .../modules_admin/groups/defaultSection.php | 2 +- .../members/modules_admin/groups/groups.php | 2 +- .../members/modules_admin/groups/index.html | 2 +- .../modules_admin/groups/permissions.php | 2 +- .../modules_admin/groups/xml/index.html | 2 +- .../members/modules_admin/groups/xml/menu.xml | 8 +- .../modules_admin/groups/xml/permissions.xml | 20 +- .../members/modules_admin/index.html | 2 +- .../modules_admin/members/banfilters.php | 2 +- .../modules_admin/members/defaultSection.php | 2 +- .../modules_admin/members/editform.php | 2 +- .../members/modules_admin/members/index.html | 2 +- .../members/modules_admin/members/members.php | 19 +- .../modules_admin/members/notifications.php | 2 +- .../members/modules_admin/members/ranks.php | 2 +- .../modules_admin/members/reputation.php | 2 +- .../members/modules_admin/members/tools.php | 2802 +- .../modules_admin/members/xml/index.html | 2 +- .../modules_admin/members/xml/menu.xml | 28 +- .../modules_admin/members/xml/permissions.xml | 78 +- .../restrictions/defaultSection.php | 2 +- .../modules_admin/restrictions/index.html | 2 +- .../restrictions/restrictions.php | 1726 +- .../modules_admin/restrictions/xml/index.html | 2 +- .../modules_admin/restrictions/xml/menu.xml | 4 +- .../restrictions/xml/permissions.xml | 14 +- .../modules_admin/warnings/actions.php | 2 +- .../modules_admin/warnings/defaultSection.php | 2 +- .../members/modules_admin/warnings/index.html | 2 +- .../modules_admin/warnings/reasons.php | 2 +- .../modules_admin/warnings/xml/index.html | 2 +- .../modules_admin/warnings/xml/menu.xml | 8 +- .../warnings/xml/permissions.xml | 20 +- .../members/modules_public/ajax/card.php | 2 +- .../members/modules_public/ajax/dname.php | 2 +- .../members/modules_public/ajax/dst.php | 2 +- .../members/modules_public/ajax/friends.php | 2 +- .../members/modules_public/ajax/ignore.php | 2 +- .../members/modules_public/ajax/index.html | 2 +- .../members/modules_public/ajax/load.php | 2 +- .../members/modules_public/ajax/messenger.php | 2 +- .../members/modules_public/ajax/photo.php | 2 +- .../members/modules_public/ajax/rate.php | 2 +- .../members/modules_public/ajax/status.php | 2 +- .../members/modules_public/ajax/warnings.php | 2 +- .../members/modules_public/index.html | 2 +- .../modules_public/list/defaultSection.php | 2 +- .../members/modules_public/list/index.html | 2 +- .../members/modules_public/list/view.php | 1158 +- .../messaging/defaultSection.php | 2 +- .../modules_public/messaging/index.html | 2 +- .../modules_public/messaging/markasread.php | 2 +- .../modules_public/messaging/search.php | 2 +- .../members/modules_public/messaging/send.php | 2 +- .../members/modules_public/messaging/view.php | 1672 +- .../modules_public/online/defaultSection.php | 2 +- .../members/modules_public/online/index.html | 2 +- .../members/modules_public/online/online.php | 2 +- .../modules_public/profile/defaultSection.php | 2 +- .../members/modules_public/profile/dname.php | 2 +- .../modules_public/profile/friends.php | 2 +- .../members/modules_public/profile/ignore.php | 2 +- .../members/modules_public/profile/index.html | 2 +- .../members/modules_public/profile/photo.php | 2 +- .../members/modules_public/profile/status.php | 2 +- .../members/modules_public/profile/view.php | 1538 +- .../modules_public/profile/warnings.php | 2 +- .../modules_public/reputation/index.html | 2 +- .../modules_public/reputation/most.php | 16 +- .../applications/members/setup/index.html | 2 +- .../members/setup/versions/index.html | 2 +- .../members/setup/versions/install/index.html | 2 +- .../setup/versions/install/sql/index.html | 2 +- .../members/skin_cp/cp_skin_banfilters.php | 2 +- .../members/skin_cp/cp_skin_bulkmail.php | 8 +- .../members/skin_cp/cp_skin_groups.php | 2 +- .../members/skin_cp/cp_skin_member.php | 4565 ++- .../members/skin_cp/cp_skin_member_form.php | 2 +- .../members/skin_cp/cp_skin_notifications.php | 2 +- .../members/skin_cp/cp_skin_permissions.php | 2 +- .../members/skin_cp/cp_skin_profilefields.php | 2 +- .../members/skin_cp/cp_skin_ranks.php | 2 +- .../members/skin_cp/cp_skin_reputation.php | 2 +- .../members/skin_cp/cp_skin_restrictions.php | 1010 +- .../members/skin_cp/cp_skin_tools.php | 2 +- .../skin_cp/cp_skin_warnings_actions.php | 2 +- .../skin_cp/cp_skin_warnings_reasons.php | 2 +- .../applications/members/skin_cp/index.html | 2 +- .../members/sources/adminManage.php | 1724 +- .../members/sources/adminSearch.php | 1924 +- .../members/sources/classes/hooks/gateway.php | 2 +- .../members/sources/classes/hooks/index.html | 2 +- .../members/sources/classes/index.html | 2 +- .../members/sources/classes/mandrill.php | 2 +- .../sources/classes/messaging/index.html | 2 +- .../classes/messaging/messengerFunctions.php | 7957 ++-- .../applications/members/sources/friends.php | 69 +- .../applications/members/sources/index.html | 2 +- .../members/sources/tabs/index.html | 2 +- .../sources/tabs/pluginParentClass.php | 2 +- .../admin/applications/members/sql/index.html | 2 +- .../members/sql/messengerSearch_mysql.php | 2 +- .../applications/members/tasks/bulkmail.php | 2 +- .../applications/members/tasks/index.html | 2 +- .../members/tasks/mobile_notifications.php | 84 +- .../members/tasks/prunenotifications.php | 2 +- .../members/tasks/removelocked.php | 2 +- .../members/tasks/removevalidating.php | 2 +- .../members/tasks/twitfacesync.php | 10 +- .../members/tasks/update_profile_views.php | 2 +- .../applications/members/tasks/warnings.php | 6 +- .../xml/admin_members_language_pack.xml | 9174 +++-- .../admin/applications/members/xml/hooks.xml | 4 - .../applications/members/xml/hooks/index.html | 2 +- .../members/xml/hooks/mlist_alpharu.xml | 134 - .../members/xml/hooks/status_updates.xml | 6 +- .../admin/applications/members/xml/index.html | 2 +- .../applications/members/xml/information.xml | 10 +- .../applications/members/xml/members_help.xml | 125 +- .../members/xml/members_modules.xml | 40 +- .../members/xml/members_root_css.xml | 8 +- .../members/xml/members_root_templates.xml | 46 +- .../members/xml/members_settings.xml | 743 +- .../members/xml/members_tasks.xml | 28 +- .../members/xml/members_xmlskin_css.xml | 8 +- .../xml/public_members_language_pack.xml | 3553 +- .../applications/members/xml/versions.xml | 4 + upload/admin/applications_addon/index.html | 2 +- .../admin/applications_addon/ips/index.html | 2 +- .../admin/applications_addon/other/index.html | 2 +- upload/admin/extensions/coreVariables.php | 3 +- upload/admin/extensions/index.html | 2 +- upload/admin/extensions/sphinxTemplate.php | 2 +- upload/admin/extensions/userAgents.php | 77 +- upload/admin/index.php | 3 +- upload/admin/install/index.php | 3 +- upload/admin/install/readme.txt | 56 + upload/admin/js/3rd_party/index.html | 2 +- upload/admin/js/acp.hooks.js | 2 +- upload/admin/js/acp.inlineforms.js | 10 +- upload/admin/js/acp.js | 6 +- upload/admin/js/acp.languages.js | 2 +- upload/admin/js/acp.permissions.js | 2 +- upload/admin/js/acp.permissions2.js | 2 +- upload/admin/js/acp.replacements.js | 24 +- upload/admin/js/acp.templates.js | 12 +- upload/admin/js/acp.upgrade.js | 14 +- upload/admin/js/index.html | 2 +- upload/admin/setup/applications/index.html | 2 +- .../setup/applications/install/index.html | 2 +- .../applications/install/sections/address.php | 182 +- .../applications/install/sections/admin.php | 174 +- .../applications/install/sections/apps.php | 308 +- .../applications/install/sections/db.php | 560 +- .../applications/install/sections/done.php | 94 +- .../applications/install/sections/eula.php | 70 +- .../applications/install/sections/index.html | 2 +- .../applications/install/sections/index.php | 316 +- .../applications/install/sections/install.php | 4030 +- .../applications/install/sections/license.php | 70 +- .../setup/applications/upgrade/index.html | 2 +- .../applications/upgrade/sections/apps.php | 756 +- .../applications/upgrade/sections/convert.php | 101 - .../applications/upgrade/sections/done.php | 188 +- .../applications/upgrade/sections/index.html | 2 +- .../applications/upgrade/sections/index.php | 152 +- .../applications/upgrade/sections/license.php | 69 +- .../upgrade/sections/overview.php | 353 +- .../applications/upgrade/sections/upgrade.php | 3318 +- upload/admin/setup/cli/index.html | 2 +- upload/admin/setup/cli/install.php | 3 +- upload/admin/setup/cli/output.php | 2 +- upload/admin/setup/index.html | 2 +- upload/admin/setup/public/images/index.html | 2 +- upload/admin/setup/public/index.html | 2 +- upload/admin/setup/sources/base/index.html | 2 +- upload/admin/setup/sources/base/install.php | 444 +- .../sources/base/ipsController_setup.php | 600 +- .../setup/sources/base/ipsRegistry_setup.php | 5286 +-- upload/admin/setup/sources/base/setup.php | 2 +- upload/admin/setup/sources/classes/index.html | 2 +- .../setup/sources/classes/output/index.html | 2 +- .../setup/sources/classes/output/output.php | 1668 +- .../setup/sources/classes/session/index.html | 2 +- .../sources/classes/session/sessions.php | 528 +- upload/admin/setup/sources/index.html | 2 +- upload/admin/setup/sources/legacy/1xx.php | 442 +- upload/admin/setup/sources/legacy/2xx.php | 528 +- upload/admin/setup/sources/legacy/3xx.php | 510 +- upload/admin/setup/sources/legacy/index.html | 2 +- upload/admin/setup/sql/index.html | 2 +- upload/admin/setup/sql/ipb3_mysql.php | 2 +- upload/admin/setup/sql/mysql_install.php | 568 +- upload/admin/setup/templates/index.html | 2 +- upload/admin/setup/templates/skin_setup.php | 3673 +- upload/admin/setup/xml/groups.xml | 12 +- upload/admin/setup/xml/index.html | 2 +- upload/admin/setup/xml/loginauth.xml | 14 +- upload/admin/setup/xml/requiredextensions.php | 6 +- upload/admin/setup/xml/sequence.xml | 89 +- upload/admin/setup/xml/skins/index.html | 2 +- .../setup/xml/skins/replacements_root.xml | 6 - upload/admin/setup/xml/skins/setsData.xml | 6 +- upload/admin/setup/xml/upgrade_sequence.xml | 64 +- upload/admin/skin_cp/cp_skin_global.php | 53 +- .../skin_cp/images/applications/index.html | 2 +- upload/admin/skin_cp/images/ccs/index.html | 2 +- .../folder_components/applications/index.html | 2 +- .../images/folder_components/cache/index.html | 2 +- .../images/folder_components/index.html | 2 +- .../images/folder_components/index/index.html | 2 +- .../folder_components/security/index.html | 2 +- .../folder_components/skinremap/index.html | 2 +- .../images/folder_components/tasks/index.html | 2 +- .../templates/diff/index.html | 2 +- .../folder_components/templates/index.html | 2 +- .../templates/templates/index.html | 2 +- .../folder_components/uagents/index.html | 2 +- .../folder_components/xmlrpc/index.html | 2 +- .../icon_components/generic_trees/index.html | 2 +- .../skin_cp/images/icon_components/index.html | 2 +- upload/admin/skin_cp/images/icons/index.html | 2 +- upload/admin/skin_cp/images/index.html | 2 +- .../admin/skin_cp/images/members/index.html | 2 +- .../skin_cp/images/members/vkontakte.png | Bin 853 -> 0 bytes .../skin_cp/images/options_menu/index.html | 2 +- .../admin/skin_cp/images/reports/index.html | 2 +- upload/admin/skin_cp/images/skins/index.html | 2 +- upload/admin/skin_cp/images/stems/index.html | 2 +- upload/admin/skin_cp/index.html | 2 +- upload/admin/skin_cp/readme.txt | 56 + upload/admin/sources/base/core.php | 140 +- upload/admin/sources/base/darkLAE.php | 172 - upload/admin/sources/base/index.html | 2 +- upload/admin/sources/base/ipsController.php | 956 +- upload/admin/sources/base/ipsMember.php | 8874 +++-- upload/admin/sources/base/ipsMobileApp.php | 2 +- upload/admin/sources/base/ipsRegistry.php | 9581 +++-- .../admin/sources/classes/admin/bookmarks.php | 2 +- upload/admin/sources/classes/ads.php | 2 +- .../admin/sources/classes/archive/index.html | 2 +- .../admin/sources/classes/archive/reader.php | 2 +- .../sources/classes/archive/reader/index.html | 2 +- .../sources/classes/archive/reader/sql.php | 2 +- .../admin/sources/classes/archive/restore.php | 883 +- .../classes/archive/restore/index.html | 2 +- .../sources/classes/archive/restore/sql.php | 350 +- .../admin/sources/classes/archive/writer.php | 1380 +- .../sources/classes/archive/writer/index.html | 2 +- .../sources/classes/archive/writer/sql.php | 2 +- upload/admin/sources/classes/backup.php | 6 +- upload/admin/sources/classes/backup/db.php | 2 +- upload/admin/sources/classes/bbcode/core.php | 5666 +-- .../sources/classes/bbcode/custom/ccs.php | 2 +- .../classes/bbcode/custom/defaults.php | 6105 ++- .../sources/classes/bbcode/custom/index.html | 2 +- .../admin/sources/classes/bbcode/index.html | 2 +- .../admin/sources/classes/bbcode/legacy.php | 1370 +- upload/admin/sources/classes/cache/index.html | 2 +- upload/admin/sources/classes/cache/simple.php | 2 +- .../sources/classes/class_admin_functions.php | 2 +- .../sources/classes/class_localization.php | 1880 +- .../sources/classes/class_permissions.php | 2 +- .../classes/class_public_permissions.php | 2 +- .../classes/class_reputation_cache.php | 2 +- .../sources/classes/class_taskmanager.php | 2 +- .../sources/classes/comments/bootstrap.php | 30 +- .../admin/sources/classes/comments/index.html | 2 +- .../sources/classes/customfields/index.html | 2 +- .../sources/classes/editor/class_editor.php | 2 +- .../classes/editor/class_editor_rte.php | 4 +- .../classes/editor/class_editor_std.php | 2 +- .../sources/classes/editor/composite.php | 61 +- .../admin/sources/classes/editor/index.html | 2 +- .../sources/classes/facebook/connect.php | 2075 +- .../admin/sources/classes/facebook/index.html | 2 +- .../classes/incomingEmail/incomingEmail.php | 2 +- upload/admin/sources/classes/index.html | 2 +- .../classes/itemmarking/classItemMarking.php | 2 +- .../sources/classes/itemmarking/index.html | 2 +- .../admin/sources/classes/like/composite.php | 69 +- upload/admin/sources/classes/like/index.html | 2 +- .../sources/classes/mapping/bootstrap.php | 2 +- .../sources/classes/mapping/engines/bing.php | 2 +- .../classes/mapping/engines/google.php | 2 +- .../classes/mapping/engines/index.html | 2 +- .../admin/sources/classes/mapping/index.html | 2 +- .../admin/sources/classes/member/index.html | 2 +- .../classes/member/memberFunctions.php | 1959 +- .../sources/classes/member/notifications.php | 16 +- upload/admin/sources/classes/member/photo.php | 2257 +- .../admin/sources/classes/member/status.php | 80 +- .../admin/sources/classes/mobile/index.html | 2 +- .../sources/classes/mobile/iosImages.php | 2 +- .../sources/classes/navigation/build.php | 2 +- .../sources/classes/navigation/index.html | 2 +- .../sources/classes/output/adminOutput.php | 28 +- .../classes/output/formats/coreOutput.php | 2 +- .../classes/output/formats/html/conf.php | 2 +- .../output/formats/html/htmlOutput.php | 2060 +- .../classes/output/formats/html/index.html | 2 +- .../sources/classes/output/formats/index.html | 2 +- .../classes/output/formats/xml/conf.php | 2 +- .../classes/output/formats/xml/index.html | 2 +- .../classes/output/formats/xml/xmlOutput.php | 6 +- .../admin/sources/classes/output/index.html | 2 +- .../sources/classes/output/publicOutput.php | 5 +- .../classes/output/systemTemplates.php | 2 +- upload/admin/sources/classes/rss/import.php | 46 +- upload/admin/sources/classes/rss/index.html | 2 +- .../classes/sabre/directory/groups.php | 2 +- .../classes/sabre/directory/index.html | 2 +- .../classes/sabre/directory/templates.php | 2 +- .../sources/classes/sabre/files/index.html | 2 +- .../sources/classes/sabre/files/templates.php | 2 +- upload/admin/sources/classes/sabre/index.html | 2 +- .../sources/classes/sabre/lock/index.html | 2 +- .../sources/classes/sabre/lock/nolocks.php | 2 +- .../sources/classes/sabre/root/index.html | 2 +- .../sources/classes/sabre/root/skins.php | 2 +- .../sources/classes/search/controller.php | 2 +- .../sources/classes/search/engines/index.html | 2 +- .../sources/classes/search/engines/sphinx.php | 2 +- .../sources/classes/search/engines/sql.php | 2 +- .../admin/sources/classes/search/format.php | 2 +- .../admin/sources/classes/search/index.html | 2 +- .../sources/classes/session/adminSessions.php | 2 +- upload/admin/sources/classes/session/api.php | 2 +- .../admin/sources/classes/session/index.html | 2 +- .../classes/session/publicSessions.php | 3450 +- .../sources/classes/session/sso.rename.php | 2 +- .../session/ssoMobileAppLogIn.rename.php | 2 +- upload/admin/sources/classes/share/index.html | 2 +- upload/admin/sources/classes/share/links.php | 2 +- .../classes/share/plugins/blogthis.php | 13 +- .../classes/share/plugins/bobrdobr.php | 91 - .../sources/classes/share/plugins/buzz.php | 2 +- .../classes/share/plugins/delicious.php | 2 +- .../sources/classes/share/plugins/digg.php | 2 +- .../classes/share/plugins/download.php | 2 +- .../sources/classes/share/plugins/email.php | 2 +- .../classes/share/plugins/facebook.php | 2 +- .../classes/share/plugins/googleplusone.php | 4 +- .../sources/classes/share/plugins/index.html | 2 +- .../sources/classes/share/plugins/memori.php | 91 - .../sources/classes/share/plugins/print.php | 2 +- .../sources/classes/share/plugins/reddit.php | 2 +- .../sources/classes/share/plugins/stumble.php | 2 +- .../sources/classes/share/plugins/twitter.php | 12 +- .../classes/share/plugins/vkontakte.php | 91 - upload/admin/sources/classes/skins/index.html | 2 +- .../sources/classes/skins/skinCaching.php | 2 +- .../sources/classes/skins/skinDifferences.php | 2 +- .../sources/classes/skins/skinFunctions.php | 6 +- .../sources/classes/skins/skinGenerator.php | 246 +- .../classes/skins/skinImportExport.php | 6 +- .../admin/sources/classes/tags/abstract.php | 2 +- .../admin/sources/classes/tags/bootstrap.php | 2 +- upload/admin/sources/classes/tags/cloud.php | 2 +- .../classes/tags/extensions/default.php | 2 +- .../classes/tags/extensions/index.html | 2 +- upload/admin/sources/classes/tags/index.html | 2 +- .../sources/classes/tags/search/bootstrap.php | 2 +- .../sources/classes/tags/search/index.html | 2 +- .../sources/classes/tags/search/sphinx.php | 2 +- .../admin/sources/classes/tags/search/sql.php | 2 +- upload/admin/sources/classes/text/parser.php | 93 +- .../sources/classes/text/parser/bbcode.php | 28 +- .../classes/text/parser/bbcode/ccs.php | 2 +- .../classes/text/parser/bbcode/defaults.php | 58 +- .../sources/classes/text/parser/html.php | 2 +- .../sources/classes/text/parser/legacy.php | 2 +- upload/admin/sources/classes/tiers/index.html | 2 +- .../sources/classes/tiers/recursiveTiers.php | 1318 +- .../admin/sources/classes/twitter/connect.php | 1528 +- .../admin/sources/classes/twitter/index.html | 2 +- .../sources/classes/url/apis/bitly/api.php | 2 +- .../sources/classes/url/apis/bitly/conf.php | 2 +- .../sources/classes/url/apis/bitly/index.html | 2 +- .../admin/sources/classes/url/apis/index.html | 2 +- .../sources/classes/url/apis/topic/api.php | 74 - .../sources/classes/url/apis/topic/conf.php | 28 - .../sources/classes/url/apis/topic/index.html | 10 - upload/admin/sources/classes/url/index.html | 2 +- upload/admin/sources/classes/url/shorten.php | 4 +- .../sources/classes/useragents/index.html | 2 +- .../classes/useragents/userAgentFunctions.php | 2 +- .../sources/classes/virusChecker/index.html | 2 +- .../classes/virusChecker/lib_known_names.php | 4 +- .../virusChecker/lib_writeable_dirs.php | 9 +- .../classes/virusChecker/plugins/example.php | 2 +- .../classes/virusChecker/plugins/index.html | 2 +- .../classes/virusChecker/virusChecker.php | 2 +- .../sources/classes/vkontakte/connect.php | 733 - upload/admin/sources/handlers/han_email.php | 26 +- upload/admin/sources/handlers/han_login.php | 30 +- .../sources/handlers/han_parse_bbcode.php | 2 +- upload/admin/sources/handlers/index.html | 2 +- upload/admin/sources/index.html | 2 +- .../admin/download_category_form.php | 2 +- .../sources/interfaces/admin/forum_form.php | 2 +- .../sources/interfaces/admin/group_form.php | 2 +- .../admin/sources/interfaces/admin/index.html | 2 +- .../sources/interfaces/admin/member_form.php | 2 +- upload/admin/sources/interfaces/index.html | 2 +- .../sources/interfaces/interface_bbcode.php | 2 +- .../sources/interfaces/interface_output.php | 2 +- .../sources/interfaces/interface_usercp.php | 2 +- .../admin/sources/loginauth/convert/auth.php | 1790 +- .../sources/loginauth/convert/auth_sha256.php | 2 +- .../sources/loginauth/convert/index.html | 2 +- .../loginauth/convert/loginauth_install.xml | 6 +- .../sources/loginauth/convert/newauth.php | 2809 +- .../admin/sources/loginauth/external/acp.php | 188 +- .../admin/sources/loginauth/external/auth.php | 490 +- .../sources/loginauth/external/index.html | 2 +- .../loginauth/external/loginauth_install.xml | 6 +- upload/admin/sources/loginauth/index.html | 2 +- .../admin/sources/loginauth/internal/auth.php | 232 +- .../sources/loginauth/internal/index.html | 2 +- .../loginauth/internal/loginauth_install.xml | 6 +- .../sources/loginauth/ipsconnect/acp.php | 6 +- .../sources/loginauth/ipsconnect/index.html | 2 +- upload/admin/sources/loginauth/ldap/acp.php | 248 +- upload/admin/sources/loginauth/ldap/auth.php | 776 +- .../admin/sources/loginauth/ldap/index.html | 2 +- .../loginauth/ldap/loginauth_install.xml | 6 +- upload/admin/sources/loginauth/live/acp.php | 60 +- upload/admin/sources/loginauth/live/auth.php | 566 +- .../admin/sources/loginauth/live/index.html | 2 +- .../sources/loginauth/live/lib/index.html | 2 +- .../loginauth/live/loginauth_install.xml | 4 +- upload/admin/sources/loginauth/login_core.php | 2 +- .../sources/loginauth/login_interface.php | 2 +- .../admin/sources/template_plugins/index.html | 2 +- .../sources/template_plugins/tp_addtohead.php | 2 +- .../sources/template_plugins/tp_currency.php | 2 +- .../sources/template_plugins/tp_date.php | 2 +- .../sources/template_plugins/tp_editor.php | 2 +- .../template_plugins/tp_expression.php | 2 +- .../template_plugins/tp_format_number.php | 2 +- .../sources/template_plugins/tp_include.php | 2 +- .../sources/template_plugins/tp_ipcmedia.php | 2 +- .../sources/template_plugins/tp_js_module.php | 2 +- .../sources/template_plugins/tp_lang.php | 2 +- .../template_plugins/tp_replacement.php | 2 +- .../template_plugins/tp_resize_image.php | 2 +- .../sources/template_plugins/tp_striping.php | 2 +- .../sources/template_plugins/tp_template.php | 2 +- .../admin/sources/template_plugins/tp_url.php | 2 +- .../sources/template_plugins/tp_variable.php | 2 +- upload/admin/upgrade/index.php | 3 +- upload/cache/index.html | 2 +- upload/cache/lang_cache/index.html | 2 +- upload/cache/skin_cache/index.html | 2 +- upload/cache/skin_cache/masterMap.php | 2 +- upload/cache/skin_cache/settingsEmpty.html | 2 +- upload/cache/tmp/index.html | 2 +- upload/dav.php | 2 +- upload/index.php | 3 +- upload/initdata.php | 12 +- upload/interface/board/index.php | 2 +- upload/interface/board/live.php | 2 +- upload/interface/board/modules/index.html | 2 +- upload/interface/board/modules/ipb/api.php | 2 +- upload/interface/board/modules/ipb/config.php | 2 +- upload/interface/board/modules/ipb/index.html | 2 +- .../interface/board/modules/ipb/methods.php | 2 +- upload/interface/board/readme.txt | 56 + upload/interface/email/index.html | 2 +- upload/interface/facebook/channel.php | 2 +- upload/interface/facebook/images/index.html | 2 +- upload/interface/facebook/index.php | 2 +- upload/interface/facebook/xd_receiver.php | 2 +- upload/interface/facebook/xd_receiver_ssl.php | 2 +- upload/interface/index.html | 2 +- upload/interface/ipsconnect/index.html | 2 +- upload/interface/mobile/index.php | 2 +- upload/interface/task.php | 2 +- upload/interface/twitter/index.php | 4 +- upload/interface/vkontakte/index.php | 76 - upload/ips_kernel/FirePHPCore/index.html | 2 +- .../HTMLPurifier/AttrDef/URI/Host.php | 203 +- .../HTMLPurifier/HTMLPurifier/Encoder.php | 6 +- .../HTMLPurifier/Injector/Linkify.php | 221 +- upload/ips_kernel/HTMLPurifier/index.html | 2 +- upload/ips_kernel/PEAR/JSON/index.html | 2 +- upload/ips_kernel/PEAR/Mail/index.html | 2 +- .../PEAR/Text/Diff/Engine/index.html | 2 +- .../PEAR/Text/Diff/Renderer/index.html | 2 +- upload/ips_kernel/PEAR/Text/Diff/index.html | 2 +- upload/ips_kernel/PEAR/Text/index.html | 2 +- upload/ips_kernel/PEAR/index.html | 2 +- upload/ips_kernel/classAjax.php | 852 +- upload/ips_kernel/classApiServer.php | 2 +- upload/ips_kernel/classCacheApc.php | 2 +- upload/ips_kernel/classCacheDiskcache.php | 2 +- upload/ips_kernel/classCacheEaccelerator.php | 2 +- upload/ips_kernel/classCacheMemcache.php | 2 +- upload/ips_kernel/classCacheWincache.php | 2 +- upload/ips_kernel/classCacheXcache.php | 2 +- upload/ips_kernel/classCaptcha.php | 202 +- .../ips_kernel/classCaptchaPlugin/default.php | 2 +- .../ips_kernel/classCaptchaPlugin/index.html | 2 +- .../classCaptchaPlugin/recaptcha.php | 22 +- upload/ips_kernel/classConvertCharset.php | 2 +- upload/ips_kernel/classCustomFields.php | 1810 +- upload/ips_kernel/classDb.php | 4070 +- upload/ips_kernel/classDbMysql.php | 2 +- upload/ips_kernel/classDbMysqlClient.php | 1216 +- upload/ips_kernel/classDbMysqliClient.php | 1334 +- upload/ips_kernel/classDifference.php | 870 +- upload/ips_kernel/classEmail.php | 6 +- upload/ips_kernel/classFileManagement.php | 1898 +- upload/ips_kernel/classFtp.php | 2 +- upload/ips_kernel/classGraph.php | 6164 +-- upload/ips_kernel/classImage.php | 2 +- upload/ips_kernel/classImageGd.php | 2 +- upload/ips_kernel/classImageImagemagick.php | 24 +- upload/ips_kernel/classMerge.php | 2 +- upload/ips_kernel/classRss.php | 2388 +- upload/ips_kernel/classTemplateEngine.php | 2 +- upload/ips_kernel/classUpload.php | 2 +- upload/ips_kernel/classXML.php | 2 +- upload/ips_kernel/classXMLArchive.php | 2 +- upload/ips_kernel/classXmlRpc.php | 2108 +- upload/ips_kernel/class_xml.php | 2962 +- upload/ips_kernel/db_lib/index.html | 2 +- upload/ips_kernel/db_lib/mysql_tools.php | 2 +- upload/ips_kernel/facebook-client/index.html | 2 +- .../jsonwrapper/JSON/index.html | 2 +- .../facebook-client/jsonwrapper/index.html | 2 +- upload/ips_kernel/facebook/index.html | 2 +- .../ips_kernel/i18n/ConvertTables/index.html | 2 +- upload/ips_kernel/i18n/index.html | 2 +- upload/ips_kernel/index.html | 2 +- upload/ips_kernel/interfaces/index.html | 2 +- .../ips_kernel/interfaces/interfaceCache.php | 2 +- upload/ips_kernel/pop3class/index.html | 2 +- .../sabre/Sabre/CalDAV/Backend/index.html | 2 +- .../sabre/Sabre/CalDAV/Exception/index.html | 2 +- .../sabre/Sabre/CalDAV/Property/index.html | 2 +- .../ips_kernel/sabre/Sabre/CalDAV/index.html | 2 +- .../sabre/Sabre/DAV/Auth/Backend/index.html | 2 +- .../sabre/Sabre/DAV/Auth/index.html | 2 +- .../sabre/Sabre/DAV/Browser/index.html | 2 +- .../sabre/Sabre/DAV/Exception/index.html | 2 +- .../ips_kernel/sabre/Sabre/DAV/FS/index.html | 2 +- .../sabre/Sabre/DAV/FSExt/index.html | 2 +- .../sabre/Sabre/DAV/Locks/Backend/index.html | 2 +- .../sabre/Sabre/DAV/Locks/index.html | 2 +- .../sabre/Sabre/DAV/Mount/index.html | 2 +- .../sabre/Sabre/DAV/Property/index.html | 2 +- .../sabre/Sabre/DAV/Tree/index.html | 2 +- upload/ips_kernel/sabre/Sabre/DAV/index.html | 2 +- upload/ips_kernel/sabre/Sabre/HTTP/index.html | 2 +- upload/ips_kernel/sabre/Sabre/index.html | 2 +- upload/ips_kernel/sabre/index.html | 2 +- upload/ips_kernel/twitter/index.html | 2 +- upload/ips_kernel/vkontakte/OAuth2Client.php | 799 - .../vkontakte/OAuth2ClientNOSSL.php | 802 - upload/ips_kernel/vkontakte/oauth2.php | 105 - upload/lofiversion/index.php | 2 +- upload/public/404.php | 2 +- upload/public/flowplayer/LICENSE.txt | 721 - upload/public/flowplayer/README.txt | 459 - upload/public/flowplayer/REMOVEBRANDING.txt | 2 - .../example/flowplayer-3.2.6.min.js | 24 - upload/public/flowplayer/example/index.html | 74 - upload/public/flowplayer/example/style.css | 41 - .../flowplayer/flowplayer-3.2.11.min.js | 24 - .../public/flowplayer/flowplayer-3.2.15.swf | Bin 126738 -> 0 bytes .../flowplayer/flowplayer.controls-3.2.14.swf | Bin 38345 -> 0 bytes upload/public/flowplayer/index.html | 10 - upload/public/index.html | 2 +- upload/public/ipc_blocks/index.html | 2 +- .../3rd_party/calendar_date_select/index.html | 2 +- .../calendar_date_select/locale/index.html | 2 +- .../public/js/3rd_party/ckeditor/ckeditor.js | 6 +- .../public/js/3rd_party/ckeditor/contents.css | 241 +- .../js/3rd_party/ckeditor/images/index.html | 2 +- .../public/js/3rd_party/ckeditor/index.html | 2 +- .../js/3rd_party/ckeditor/lang/index.html | 2 +- .../plugins/a11yhelp/dialogs/index.html | 2 +- .../ckeditor/plugins/a11yhelp/index.html | 2 +- .../ckeditor/plugins/a11yhelp/lang/index.html | 2 +- .../ckeditor/plugins/about/dialogs/index.html | 2 +- .../ckeditor/plugins/about/index.html | 2 +- .../ckeditor/plugins/adobeair/index.html | 2 +- .../ckeditor/plugins/ajax/index.html | 2 +- .../ckeditor/plugins/autogrow/index.html | 2 +- .../ckeditor/plugins/bbcode/index.html | 2 +- .../plugins/clipboard/dialogs/index.html | 2 +- .../ckeditor/plugins/clipboard/index.html | 2 +- .../plugins/colordialog/dialogs/index.html | 2 +- .../ckeditor/plugins/colordialog/index.html | 2 +- .../ckeditor/plugins/devtools/index.html | 2 +- .../ckeditor/plugins/devtools/lang/index.html | 2 +- .../ckeditor/plugins/dialog/index.html | 2 +- .../ckeditor/plugins/div/dialogs/index.html | 2 +- .../3rd_party/ckeditor/plugins/div/index.html | 2 +- .../plugins/docprops/dialogs/index.html | 2 +- .../ckeditor/plugins/docprops/index.html | 2 +- .../ckeditor/plugins/find/dialogs/index.html | 2 +- .../ckeditor/plugins/find/index.html | 2 +- .../ckeditor/plugins/flash/dialogs/index.html | 2 +- .../ckeditor/plugins/flash/images/index.html | 2 +- .../ckeditor/plugins/flash/index.html | 2 +- .../ckeditor/plugins/forms/dialogs/index.html | 2 +- .../ckeditor/plugins/forms/images/index.html | 2 +- .../ckeditor/plugins/forms/index.html | 2 +- .../plugins/iframe/dialogs/index.html | 2 +- .../ckeditor/plugins/iframe/images/index.html | 2 +- .../ckeditor/plugins/iframe/index.html | 2 +- .../ckeditor/plugins/iframedialog/index.html | 2 +- .../ckeditor/plugins/image/dialogs/index.html | 2 +- .../ckeditor/plugins/image/index.html | 2 +- .../js/3rd_party/ckeditor/plugins/index.html | 2 +- .../plugins/ipsbbcode/dialogs/index.html | 2 +- .../plugins/ipsbbcode/images/index.html | 2 +- .../ckeditor/plugins/ipsbbcode/index.html | 2 +- .../plugins/ipscode/dialogs/index.html | 2 +- .../plugins/ipscode/images/index.html | 2 +- .../ckeditor/plugins/ipscode/index.html | 2 +- .../plugins/ipsemoticon/images/index.html | 2 +- .../ckeditor/plugins/ipsemoticon/index.html | 2 +- .../plugins/ipsmedia/images/index.html | 2 +- .../ckeditor/plugins/ipsmedia/index.html | 2 +- .../plugins/ipsoptions/images/index.html | 2 +- .../ckeditor/plugins/ipsoptions/index.html | 2 +- .../plugins/ipsquote/images/index.html | 2 +- .../ckeditor/plugins/ipsquote/index.html | 2 +- .../plugins/ipsswitch/images/index.html | 2 +- .../ckeditor/plugins/ipsswitch/index.html | 2 +- .../ckeditor/plugins/link/dialogs/index.html | 2 +- .../ckeditor/plugins/link/images/index.html | 2 +- .../ckeditor/plugins/link/index.html | 2 +- .../plugins/liststyle/dialogs/index.html | 2 +- .../ckeditor/plugins/liststyle/index.html | 2 +- .../plugins/pagebreak/images/index.html | 2 +- .../ckeditor/plugins/pagebreak/index.html | 2 +- .../plugins/pastefromword/filter/index.html | 2 +- .../ckeditor/plugins/pastefromword/index.html | 2 +- .../plugins/pastetext/dialogs/index.html | 2 +- .../ckeditor/plugins/pastetext/index.html | 2 +- .../plugins/placeholder/dialogs/index.html | 2 +- .../ckeditor/plugins/placeholder/index.html | 2 +- .../plugins/placeholder/lang/index.html | 2 +- .../ckeditor/plugins/scayt/dialogs/index.html | 2 +- .../ckeditor/plugins/scayt/index.html | 2 +- .../plugins/showblocks/images/index.html | 2 +- .../ckeditor/plugins/showblocks/index.html | 2 +- .../plugins/smiley/dialogs/index.html | 2 +- .../ckeditor/plugins/smiley/images/index.html | 2 +- .../ckeditor/plugins/smiley/index.html | 2 +- .../plugins/specialchar/dialogs/index.html | 2 +- .../ckeditor/plugins/specialchar/index.html | 2 +- .../plugins/specialchar/lang/index.html | 2 +- .../ckeditor/plugins/styles/index.html | 2 +- .../ckeditor/plugins/styles/styles/index.html | 2 +- .../plugins/stylesheetparser/index.html | 2 +- .../ckeditor/plugins/table/dialogs/index.html | 2 +- .../ckeditor/plugins/table/index.html | 2 +- .../ckeditor/plugins/tableresize/index.html | 2 +- .../plugins/tabletools/dialogs/index.html | 2 +- .../ckeditor/plugins/tabletools/index.html | 2 +- .../plugins/templates/dialogs/index.html | 2 +- .../ckeditor/plugins/templates/index.html | 2 +- .../templates/templates/images/index.html | 2 +- .../plugins/templates/templates/index.html | 2 +- .../plugins/uicolor/dialogs/index.html | 2 +- .../ckeditor/plugins/uicolor/index.html | 2 +- .../ckeditor/plugins/uicolor/lang/index.html | 2 +- .../plugins/uicolor/yui/assets/index.html | 2 +- .../ckeditor/plugins/uicolor/yui/index.html | 2 +- .../ckeditor/plugins/wsc/dialogs/index.html | 2 +- .../3rd_party/ckeditor/plugins/wsc/index.html | 2 +- .../3rd_party/ckeditor/plugins/xml/index.html | 2 +- .../js/3rd_party/ckeditor/skins/index.html | 2 +- .../ckeditor/skins/ips/images/index.html | 2 +- .../3rd_party/ckeditor/skins/ips/index.html | 2 +- .../ckeditor/themes/default/index.html | 2 +- .../js/3rd_party/ckeditor/themes/index.html | 2 +- .../js/3rd_party/colorpicker/index.html | 2 +- upload/public/js/3rd_party/cropper/index.html | 2 +- upload/public/js/3rd_party/index.html | 2 +- upload/public/js/3rd_party/iscroll/index.html | 2 +- .../public/js/3rd_party/prettify/index.html | 2 +- .../js/3rd_party/progressbar/index.html | 2 +- .../prototype/colorpicker/css/index.html | 2 +- .../prototype/colorpicker/images/index.html | 2 +- .../prototype/colorpicker/js/index.html | 2 +- .../public/js/3rd_party/prototype/index.html | 2 +- .../js/3rd_party/scriptaculous/index.html | 2 +- .../public/js/3rd_party/swfupload/index.html | 2 +- .../js/3rd_party/swfupload/plugins/index.html | 2 +- .../js/3rd_party/swfupload/swfupload.js | 2 +- .../js/3rd_party/swfupload/swfupload.swf | Bin 12547 -> 12767 bytes upload/public/js/index.html | 2 +- upload/public/js/ipb.js | 9 +- upload/public/js/ips.comments.js | 4 +- upload/public/js/ips.editor.js | 6 +- upload/public/js/ips.misc.js | 2 +- upload/public/js/ips.register.js | 2 +- upload/public/js/ips.skin_gen.js | 84 +- upload/public/js/ips.tags.js | 6 +- upload/public/min/config.php | 9 + upload/public/min/lib/HTTP/index.html | 2 +- upload/public/min/lib/Minify/CSS/index.html | 2 +- upload/public/min/lib/Minify/Cache/index.html | 2 +- .../min/lib/Minify/Controller/MinApp.php | 10 +- .../min/lib/Minify/Controller/index.html | 2 +- upload/public/min/lib/Minify/index.html | 2 +- upload/public/min/lib/Solar/index.html | 2 +- upload/public/min/lib/index.html | 2 +- .../captcha_backgrounds/index.html | 2 +- .../style_captcha/captcha_fonts/index.html | 2 +- upload/public/style_captcha/index.html | 2 +- upload/public/style_css/index.html | 2 +- upload/public/style_css/ipb_rtl.css | 4294 +-- .../public/style_emoticons/default/index.html | 2 +- upload/public/style_emoticons/index.html | 2 +- .../public/style_extra/app_icons/index.html | 2 +- .../style_extra/bbcode_icons/index.html | 2 +- .../style_extra/cprofile_icons/index.html | 2 +- .../style_extra/cprofile_icons/profile_vk.gif | Bin 953 -> 0 bytes .../style_extra/cprofile_icons/profile_vk.png | Bin 625 -> 0 bytes .../style_extra/default_mobile_app/index.html | 2 +- .../downloads_traffic_images/index.html | 2 +- .../gallery_media_types/index.html | 2 +- upload/public/style_extra/index.html | 2 +- .../public/style_extra/mime_types/index.html | 2 +- .../public/style_extra/post_icons/index.html | 2 +- .../style_extra/report_icons/index.html | 2 +- .../style_extra/reputation_icons/index.html | 2 +- .../style_extra/sharelinks/bobrdobr.png | Bin 884 -> 0 bytes .../public/style_extra/sharelinks/index.html | 2 +- .../public/style_extra/sharelinks/memori.png | Bin 474 -> 0 bytes .../style_extra/sharelinks/vkontakte.png | Bin 1487 -> 0 bytes .../public/style_extra/sharelinks/yandex.png | Bin 802 -> 0 bytes upload/public/style_extra/signin/index.html | 2 +- .../style_extra/skin_creator/index.html | 2 +- .../public/style_extra/team_icons/index.html | 2 +- upload/public/style_images/index.html | 2 +- upload/public/style_images/master/back.png | Bin 379 -> 0 bytes .../style_images/master/chat/index.html | 2 +- .../style_images/master/editor/index.html | 2 +- .../style_images/master/icons/index.html | 2 +- upload/public/style_images/master/index.html | 2 +- .../style_images/master/lightbox/index.html | 2 +- .../style_images/master/likes/index.html | 2 +- .../master/loginmethods/index.html | 2 +- .../master/loginmethods/vkontakte.png | Bin 853 -> 0 bytes .../master/nexus/cards/index.html | 2 +- .../master/nexus/gateways/index.html | 2 +- .../style_images/master/nexus/index.html | 2 +- .../master/nexus/support_pips/index.html | 2 +- .../master/notifications/index.html | 2 +- .../style_images/master/profile/index.html | 2 +- .../style_images/master/reports/index.html | 2 +- .../style_images/master/rte_icons/index.html | 2 +- .../master/sharedmedia/index.html | 2 +- .../style_images/master/stems/index.html | 2 +- .../style_images/master/vkontakte_login.png | Bin 4624 -> 0 bytes .../style_images/mobile/chat/index.html | 2 +- .../style_images/mobile/gallery/index.html | 2 +- upload/public/style_images/mobile/index.html | 2 +- .../mobile/nexus/cards/index.html | 2 +- .../style_images/mobile/nexus/index.html | 2 +- .../style_images/mobile/profile/index.html | 2 +- .../public/style_images/mobile_app/index.html | 2 +- upload/public/style_status/index.html | 2 +- upload/public/style_status/vkontakte.png | Bin 601 -> 0 bytes upload/public/videojs/font/vjs.eot | Bin 0 -> 2900 bytes upload/public/videojs/font/vjs.svg | 40 + upload/public/videojs/font/vjs.ttf | Bin 0 -> 2736 bytes upload/public/videojs/font/vjs.woff | Bin 0 -> 2676 bytes upload/public/videojs/video-js.min.css | 5 + upload/public/videojs/video-js.swf | Bin 0 -> 14329 bytes upload/public/videojs/video.js | 127 + upload/robotstxt.txt | 21 +- 1568 files changed, 155104 insertions(+), 161665 deletions(-) create mode 100644 Tools/readme.txt delete mode 100644 upload/admin/applications/core/extensions/furlTemplatesID.php create mode 100644 upload/admin/applications/core/setup/versions/upg_34012/mysql_updates.php delete mode 100644 upload/admin/applications/core/xml/hooks/vkontakte.xml delete mode 100644 upload/admin/applications/forums/extensions/furlTemplatesID.php delete mode 100644 upload/admin/applications/members/extensions/furlTemplatesID.php delete mode 100644 upload/admin/applications/members/xml/hooks/mlist_alpharu.xml create mode 100644 upload/admin/install/readme.txt delete mode 100644 upload/admin/setup/applications/upgrade/sections/convert.php delete mode 100644 upload/admin/skin_cp/images/members/vkontakte.png create mode 100644 upload/admin/skin_cp/readme.txt delete mode 100644 upload/admin/sources/base/darkLAE.php delete mode 100644 upload/admin/sources/classes/share/plugins/bobrdobr.php delete mode 100644 upload/admin/sources/classes/share/plugins/memori.php delete mode 100644 upload/admin/sources/classes/share/plugins/vkontakte.php delete mode 100644 upload/admin/sources/classes/url/apis/topic/api.php delete mode 100644 upload/admin/sources/classes/url/apis/topic/conf.php delete mode 100644 upload/admin/sources/classes/url/apis/topic/index.html delete mode 100644 upload/admin/sources/classes/vkontakte/connect.php create mode 100644 upload/interface/board/readme.txt delete mode 100644 upload/interface/vkontakte/index.php delete mode 100644 upload/ips_kernel/vkontakte/OAuth2Client.php delete mode 100644 upload/ips_kernel/vkontakte/OAuth2ClientNOSSL.php delete mode 100644 upload/ips_kernel/vkontakte/oauth2.php delete mode 100644 upload/public/flowplayer/LICENSE.txt delete mode 100644 upload/public/flowplayer/README.txt delete mode 100644 upload/public/flowplayer/REMOVEBRANDING.txt delete mode 100644 upload/public/flowplayer/example/flowplayer-3.2.6.min.js delete mode 100644 upload/public/flowplayer/example/index.html delete mode 100644 upload/public/flowplayer/example/style.css delete mode 100644 upload/public/flowplayer/flowplayer-3.2.11.min.js delete mode 100644 upload/public/flowplayer/flowplayer-3.2.15.swf delete mode 100644 upload/public/flowplayer/flowplayer.controls-3.2.14.swf delete mode 100644 upload/public/flowplayer/index.html delete mode 100644 upload/public/style_extra/cprofile_icons/profile_vk.gif delete mode 100644 upload/public/style_extra/cprofile_icons/profile_vk.png delete mode 100644 upload/public/style_extra/sharelinks/bobrdobr.png delete mode 100644 upload/public/style_extra/sharelinks/memori.png delete mode 100644 upload/public/style_extra/sharelinks/vkontakte.png delete mode 100644 upload/public/style_extra/sharelinks/yandex.png delete mode 100644 upload/public/style_images/master/back.png delete mode 100644 upload/public/style_images/master/loginmethods/vkontakte.png delete mode 100644 upload/public/style_images/master/vkontakte_login.png delete mode 100644 upload/public/style_status/vkontakte.png create mode 100644 upload/public/videojs/font/vjs.eot create mode 100644 upload/public/videojs/font/vjs.svg create mode 100644 upload/public/videojs/font/vjs.ttf create mode 100644 upload/public/videojs/font/vjs.woff create mode 100644 upload/public/videojs/video-js.min.css create mode 100644 upload/public/videojs/video-js.swf create mode 100644 upload/public/videojs/video.js diff --git a/Documentation/START_HERE.html b/Documentation/START_HERE.html index 74712411..11f35b25 100644 --- a/Documentation/START_HERE.html +++ b/Documentation/START_HERE.html @@ -17,17 +17,17 @@
- Installing → + Installing →

- Upgrading → + Upgrading →

- Converting → + Converting →

diff --git a/Documentation/data/images/index.html b/Documentation/data/images/index.html index 7a344989..63a4a1e4 100644 --- a/Documentation/data/images/index.html +++ b/Documentation/data/images/index.html @@ -1 +1 @@ - Invision Power Board - Bulletin Board System

403: Invision Power Board -> Forbidden


You have reached this Page in error, please use your back button to return to Invision Board.
Invision Power Board \ No newline at end of file + Invision Power Board - Bulletin Board System

403: Invision Power Board -> Forbidden


You have reached this Page in error, please use your back button to return to Invision Board.
Invision Power Board \ No newline at end of file diff --git a/Documentation/data/index.html b/Documentation/data/index.html index e075b8d6..823f28af 100644 --- a/Documentation/data/index.html +++ b/Documentation/data/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/Tools/331_archive_update_php.php b/Tools/331_archive_update_php.php index 6a62fa07..15f3c92d 100644 --- a/Tools/331_archive_update_php.php +++ b/Tools/331_archive_update_php.php @@ -2,7 +2,7 @@ /* +--------------------------------------------------------------------------- -| IP.Board v3.4.5 +| IP.Board v3.4.6 | ======================================== | by Matthew Mecham | (c) 2008 Invision Power Services diff --git a/Tools/333_archive_update_php.php b/Tools/333_archive_update_php.php index 3c756a2f..61992d6d 100644 --- a/Tools/333_archive_update_php.php +++ b/Tools/333_archive_update_php.php @@ -2,7 +2,7 @@ /* +--------------------------------------------------------------------------- -| IP.Board v3.4.5 +| IP.Board v3.4.6 | ======================================== | by Matthew Mecham | (c) 2008 Invision Power Services diff --git a/Tools/34x_fix_posts_php.php b/Tools/34x_fix_posts_php.php index 3dcf2407..053851de 100644 --- a/Tools/34x_fix_posts_php.php +++ b/Tools/34x_fix_posts_php.php @@ -2,7 +2,7 @@ /* +--------------------------------------------------------------------------- -| IP.Board v3.4.5 +| IP.Board v3.4.6 | ======================================== | by Matthew Mecham | (c) 2008 Invision Power Services diff --git a/Tools/_postUpdateRebuild.php b/Tools/_postUpdateRebuild.php index eedbffa9..130b78d4 100644 --- a/Tools/_postUpdateRebuild.php +++ b/Tools/_postUpdateRebuild.php @@ -3,7 +3,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Main public executable wrapper.
  * Set-up and load module to run
  * Last Updated: $Date: 2011-03-31 11:17:44 +0100 (Thu, 31 Mar 2011) $
diff --git a/Tools/build4release.php b/Tools/build4release.php
index 61a62ec8..e6d41e31 100644
--- a/Tools/build4release.php
+++ b/Tools/build4release.php
@@ -4,7 +4,7 @@
 /**
  * 
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Main public executable wrapper.
  * Set-up and load module to run
  * Last Updated: $Date: 2012-06-06 15:26:34 -0400 (Wed, 06 Jun 2012) $
diff --git a/Tools/buildInDev.php b/Tools/buildInDev.php
index 27b55080..809fce16 100644
--- a/Tools/buildInDev.php
+++ b/Tools/buildInDev.php
@@ -4,7 +4,7 @@
 /**
  * 
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Rebuilds stuff from XML
  * Last Updated: $Date: 2012-06-06 15:26:34 -0400 (Wed, 06 Jun 2012) $
  * 
diff --git a/Tools/check_requirements.php b/Tools/check_requirements.php index 753c937f..27241a6c 100644 --- a/Tools/check_requirements.php +++ b/Tools/check_requirements.php @@ -1,280 +1,283 @@ - - - - - - IP.Board <?php print IPB_VERSION; ?> - Requirements Checker - - - - - -

IP.Board Requirements Checker

- -You are running PHP {$version}

"; - -//----------------------------------------- -// Check for zend guard -//----------------------------------------- - -$hasZend = false; - -if ( function_exists( 'zend_loader_enabled' ) ) -{ - if ( @zend_loader_enabled() === true ) - { - $hasZend = true; - } -} - -flushOutput( "Только для IP.Nexus: Проверка обработки скриптов, закодированных Zend Guard...", $hasZend, "Ваш сервер не может обрабатывать закодированные скрипты IP.Nexus. Это не влияет на IP.Board, IP.Downloads. IP.Blog, IP.Gallery, IP.Content, IP.Chat" ); - -//----------------------------------------- -// Memory limit -//----------------------------------------- - -$_memLimit = null; -$_recLimit = 128; - -if( @ini_get('memory_limit') ) -{ - $_memLimit = @ini_get('memory_limit'); -} - -if( $_memLimit ) -{ - $_intLimit = $_memLimit; - $_intRec = $_recLimit * 1024 * 1024; - - preg_match( "#^(\d+)(\w+)$#", strtolower($_intLimit), $match ); - - if( $match[2] == 'g' ) - { - $_intLimit = intval( $_intLimit ) * 1024 * 1024 * 1024; - } - else if ( $match[2] == 'm' ) - { - $_intLimit = intval( $_intLimit ) * 1024 * 1024; - } - else if ( $match[2] == 'k' ) - { - $_intLimit = intval( $_intLimit ) * 1024; - } - else - { - $_intLimit = intval( $_intLimit ); - } - - if( $_intLimit >= $_intRec ) - { - flushOutput( "Проверка выделения памяти ({$_recLimit}M или больше рекомендуется)...", true, "Ваш сервер ограничивает объем выделяемой памяти(memory_limit): {$_memLimit}" ); - } - else - { - flushOutput( "Проверка выделения памяти ({$_recLimit}M или больше рекомендуется)...", 2, "Ваш сервер ограничивает объем выделяемой памяти(memory_limit): {$_memLimit}. Вы можете использовать IP.Board, но свяжитесь с вашим хостинг-провайдером и попросите его увеличить memory_limit до {$_recLimit}M, чтобы избежать ошибок в будущем. Возможно прекращение работы скриптов при обработке больших объемов данных" ); - } -} -else -{ - flushOutput( "Проверка выделения памяти ({$_recLimit}M или больше рекомендуется)...", 2, "Не удалось получить значение переменной memory_limit" ); -} - -//----------------------------------------- -// Checking for SPL -//----------------------------------------- - -$splExists = in_array( 'SPL', $extensions ); -flushOutput( "Проверка SPL...", $splExists, "IP.Board " . IPB_VERSION . " требуется расширение PHP SPL. Пожалуйста, свяжитесь с вашим хостинг-провайдером для установки библиотеки SPL." ); - -//----------------------------------------- -// Checking for DOM XML -//----------------------------------------- - -$domXML = in_array( 'dom', $extensions ); -flushOutput( "Проверка обработки DOM XML...", $domXML, "IP.Board " . IPB_VERSION . " требуется расширение обработчика DOM XML. Пожалуйста, свяжитесь с вашим хостинг-провайдером для установки библиотеки libxml2." ); - -//----------------------------------------- -// Check for GD2 -//----------------------------------------- - -$gd2 = in_array( 'gd', $extensions ); -flushOutput( "Проверка библиотеки GD...", $gd2, "IP.Board " . IPB_VERSION . " требуется библиотека GD2. Пожалуйста, свяжитесь с вашим хостинг-провайдером для установки библиотеки libgd." ); - -if( function_exists( 'gd_info' ) ) -{ - $gdInfo = gd_info(); - $fail = true; - - if( $gdInfo["GD Version"] ) - { - preg_match( "/.*?([\d\.]+).*?/", $gdInfo["GD Version"], $matches ); - - if( $matches[1] ) - { - $compareVersions = version_compare( '2.0', $matches[1], '<=' ); - - if( !$compareVersions ) - { - $fail = 2; - } - } - } - - flushOutput( "Проверка GD2...", $fail, "Библиотека GD установлена, но IP.Board " . IPB_VERSION . " требуется библиотека GD версии 2. Версия переданная вашим сервером '{$gdInfo['GD Version']}'. Пожалуйста убедитесь, что используете GD версии 2, и обновите библиотеку libgd при необходимости." ); -} - -//----------------------------------------- -// Checking for mysql extension -//----------------------------------------- - -$mysql = in_array( 'mysql', $extensions ); -$mysqli = in_array( 'mysqli', $extensions ); -flushOutput( "Проверка mysql...", ( $mysql OR $mysqli ), "Ваш сервер не имеет библиотеки mysql, попросите хостера установить поддержку mysqli." ); - -if( $mysql AND !$mysqli ) -{ - flushOutput( "Проверка поддержки mysqli...", false, "Расширение mysqli рекомендуется вместо стандартного интерфейса mysql. Форум может обойтись и без него, но, если возможно, установите его для улучшения скорости и безопасности работы." ); -} - - -//----------------------------------------- -// Checking for JSON -//----------------------------------------- - -$json = in_array( 'json', $extensions ); -flushOutput( "Проверка JSON...", $json, "Расширение PHP JSON необходимо для функционирования форума. Узнайте как установить расширение json." ); - -//----------------------------------------- -// Checking for openSSL -//----------------------------------------- - -$openssl = in_array( 'openssl', $extensions ) ? true : 2; -flushOutput( "Проверка openSSL...", $openssl, "OpenSSL необходим для модулей связи с Facebook, Twitter, и модуля Subscription Manager. Если вы не используете ни один из этих модулей, то можно обойтись без этого расширения, иначе вам необходимо установить расширение openssl." ); - -//----------------------------------------- -// Suhosin -//----------------------------------------- - -if( extension_loaded( 'suhosin' ) ) -{ - $_postMaxVars = @ini_get('suhosin.post.max_vars'); - $_reqMaxVars = @ini_get('suhosin.request.max_vars'); - $_getMaxLen = @ini_get('suhosin.get.max_value_length'); - $_postMaxLen = @ini_get('suhosin.post.max_value_length'); - $_reqMaxLen = @ini_get('suhosin.request.max_value_length'); - $_reqMaxVar = @ini_get('suhosin.request.max_varname_length'); - - $_indPMV = $_postMaxVars < 4096 ? 2 : true; - $_indRMV = $_reqMaxVars < 4096 ? 2 : true; - $_indGML = $_getMaxLen < 2000 ? 2 : true; - $_indPML = $_postMaxLen < 1000000 ? 2 : true; - $_indRML = $_reqMaxLen < 1000000 ? 2 : true; - $_indRMVL = $_reqMaxVar < 350 ? 2 : true; - - flushOutput( "suhosin.post.max_vars (4096 or better recommended)...", $_indPMV, "Your value: {$_postMaxVars}. Can prevent some forms (especially in the ACP) from saving properly." ); - flushOutput( "suhosin.request.max_vars (4096 or better recommended)...", $_indRMV, "Your value: {$_reqMaxVars}. Can prevent some forms (especially in the ACP) from saving properly." ); - flushOutput( "suhosin.get.max_value_length (2000 or better recommended)...", $_indGML, "Your value: {$_postMaxLen}. Can prevent very long URLs from loading correctly." ); - flushOutput( "suhosin.post.max_value_length (1000000 or better recommended)...", $_indPML, "Your value: {$_postMaxLen}. Can prevent very large posts or other form submissions from saving properly." ); - flushOutput( "suhosin.request.max_value_length (1000000 or better recommended)...", $_indRML, "Your value: {$_reqMaxLen}. Can prevent very large posts or other form submissions from saving properly." ); - flushOutput( "suhosin.request.max_varname_length (350 or better recommended)...", $_indRMVL, "Your value: {$_reqMaxVar}. Can prevent long friendly URLs from loading correctly." ); -} - -$testtext="тестовый текст в кодировке utf-8"; -$pcre=($testtext == preg_replace( '/(^|\W)дир(\W|$)/iu', "\\1замена\\2", $testtext ))?true:false; -flushOutput( "Проверка расширения PCRE на правильную работу со строками в формате UTF-8...", $pcre, "Библиотека PCRE неправильно обрабатывает регулярные выражения в кодировке UTF-8, обратитесь к хостинг-провайдеру для исправления этой ошибки. Неправильная работа этой функции может привести к ошикам при работе с русскими именами пользователей, ошибкам фильтра нецензурных слов и т.д." ); - - -flushOutput( 'Проверка функции filter_var()...', function_exists ( 'filter_var' ), 'Функция отсутствует, это может привести к фатальным ошибкам php и остановке выполнения скриптов' ); -//----------------------------------------- -// Flush output function -//----------------------------------------- - -function flushOutput( $checking, $result, $errorText ) -{ - print "

" . $checking; - - if( $result === 2 ) - { - print "ВНИМАНИЕ
{$errorText}"; - } - else if( !$result ) - { - print "ОШИБКА
{$errorText}"; - } - else - { - print "ОК"; - } - - print "

"; - - flush(); - @ob_flush(); - - return true; -} - -?> - -

Имейте в виду, что MySQL версии 4.1 или выше (MySQL 5.0 рекомендуется) необходим IP.Board . Попросите администратора вашего сервера проверить версию MySQL если не уверены.

- + + + + + + IP.Board <?php print IPB_VERSION; ?> - Requirements Checker + + + + + +

IP.Board Requirements Checker

+ +You are running PHP {$version}

"; + +//----------------------------------------- +// Check for zend guard +//----------------------------------------- + +$hasZend = false; +$hasIoncube = false; + +if ( function_exists( 'zend_loader_enabled' ) ) +{ + if ( @zend_loader_enabled() === true ) + { + $hasZend = true; + } +} + +if ( extension_loaded( 'ionCube Loader' ) ) +{ + $hasIoncube = true; +} + +flushOutput( "IP.Nexus Only: Checking for ability to load Zend Guard encoded files...", $hasZend, "Not able to run the Zend encoded files for IP.Nexus." ); + +flushOutput( "IP.Nexus Only: Checking for ability to load Ioncube encoded files...", $hasIoncube, "Not able to run the Ioncube encoded files for IP.Nexus." ); + +flushOutput( "IP.Nexus Only: Can run IP.Nexus...", $hasZend or $hasIoncube, "Not able to run either Ioncube or Zend Encoded IP.Nexus files. You can still use IP.Board, IP.Downloads. IP.Blog, IP.Gallery, IP.Content, IP.Chat" ); + +//----------------------------------------- +// Memory limit +//----------------------------------------- + +$_memLimit = null; +$_recLimit = 128; + +if( @ini_get('memory_limit') ) +{ + $_memLimit = @ini_get('memory_limit'); +} + +if( $_memLimit ) +{ + $_intLimit = $_memLimit; + $_intRec = $_recLimit * 1024 * 1024; + + preg_match( "#^(\d+)(\w+)$#", strtolower($_intLimit), $match ); + + if( $match[2] == 'g' ) + { + $_intLimit = intval( $_intLimit ) * 1024 * 1024 * 1024; + } + else if ( $match[2] == 'm' ) + { + $_intLimit = intval( $_intLimit ) * 1024 * 1024; + } + else if ( $match[2] == 'k' ) + { + $_intLimit = intval( $_intLimit ) * 1024; + } + else + { + $_intLimit = intval( $_intLimit ); + } + + if( $_intLimit >= $_intRec ) + { + flushOutput( "Checking memory limit ({$_recLimit}M or better recommended)...", true, "Your memory limit: {$_memLimit}" ); + } + else + { + flushOutput( "Checking memory limit ({$_recLimit}M or better recommended)...", 2, "Your memory limit: {$_memLimit}. You can still proceed but we recommend you contact your host and request the memory limit be raised to {$_recLimit}M to prevent possible issues." ); + } +} +else +{ + flushOutput( "Checking memory limit ({$_recLimit}M or better recommended)...", 2, "Could not determine your memory limit" ); +} + +//----------------------------------------- +// Checking for SPL +//----------------------------------------- + +$splExists = in_array( 'SPL', $extensions ); +flushOutput( "Checking for SPL...", $splExists, "The PHP SPL extension is required for IP.Board " . IPB_VERSION . ". Please ask your host to install the SPL library." ); + +//----------------------------------------- +// Checking for DOM XML +//----------------------------------------- + +$domXML = in_array( 'dom', $extensions ); +flushOutput( "Checking for DOM XML Handling...", $domXML, "The DOM XML Handling extension is required for IP.Board " . IPB_VERSION . ". Please ask your host to install the libxml2 library." ); + +//----------------------------------------- +// Check for GD2 +//----------------------------------------- + +$gd2 = in_array( 'gd', $extensions ); +flushOutput( "Checking for GD library...", $gd2, "The GD2 library is required for IP.Board " . IPB_VERSION . ". Please ask your host to install the libgd library." ); + +if( function_exists( 'gd_info' ) ) +{ + $gdInfo = gd_info(); + $fail = true; + + if( $gdInfo["GD Version"] ) + { + preg_match( "/.*?([\d\.]+).*?/", $gdInfo["GD Version"], $matches ); + + if( $matches[1] ) + { + $compareVersions = version_compare( '2.0', $matches[1], '<=' ); + + if( !$compareVersions ) + { + $fail = 2; + } + } + } + + flushOutput( "Checking for GD2...", $fail, "While the GD library is installed, GD library version 2 is required for IP.Board " . IPB_VERSION . ". The version reported (if at all) by your server is '{$gdInfo['GD Version']}'. Please verify you are running GD version 2, and upgrade the libgd library if necessary." ); +} + +//----------------------------------------- +// Checking for mysql extension +//----------------------------------------- + +$mysql = in_array( 'mysql', $extensions ); +$mysqli = in_array( 'mysqli', $extensions ); +flushOutput( "Checking for mysql support...", ( $mysql OR $mysqli ), "Your server does not appear to have a mysql library available, please ask your host to install the mysqli extension." ); + +if( $mysql AND !$mysqli ) +{ + flushOutput( "Checking for mysqli support...", false, "The mysqli extension is preferred over the original mysql extension. This is not a requirement, but if possible we recommend you to install the mysqli extension for better performance." ); +} + + +//----------------------------------------- +// Checking for JSON +//----------------------------------------- + +$json = in_array( 'json', $extensions ); +flushOutput( "Checking for JSON...", $json, "While not required, the PHP JSON extension is recommended. The JSON extensions provides for improved efficiency in handling some functionality in IP.Board. If possible, we recommend you to install the json extension." ); + +//----------------------------------------- +// Checking for openSSL +//----------------------------------------- + +$openssl = in_array( 'openssl', $extensions ) ? true : 2; +flushOutput( "Checking for openSSL...", $openssl, "OpenSSL is required for some Facebook, Twitter, and Subscription Manager functionality. If you do not use any of these modules, you do not need this module, otherwise we recommend you to install the openssl extension." ); + +//----------------------------------------- +// Suhosin +//----------------------------------------- + +if( extension_loaded( 'suhosin' ) ) +{ + $_postMaxVars = @ini_get('suhosin.post.max_vars'); + $_reqMaxVars = @ini_get('suhosin.request.max_vars'); + $_getMaxLen = @ini_get('suhosin.get.max_value_length'); + $_postMaxLen = @ini_get('suhosin.post.max_value_length'); + $_reqMaxLen = @ini_get('suhosin.request.max_value_length'); + $_reqMaxVar = @ini_get('suhosin.request.max_varname_length'); + + $_indPMV = $_postMaxVars < 4096 ? 2 : true; + $_indRMV = $_reqMaxVars < 4096 ? 2 : true; + $_indGML = $_getMaxLen < 2000 ? 2 : true; + $_indPML = $_postMaxLen < 1000000 ? 2 : true; + $_indRML = $_reqMaxLen < 1000000 ? 2 : true; + $_indRMVL = $_reqMaxVar < 350 ? 2 : true; + + flushOutput( "suhosin.post.max_vars (4096 or better recommended)...", $_indPMV, "Your value: {$_postMaxVars}. Can prevent some forms (especially in the ACP) from saving properly." ); + flushOutput( "suhosin.request.max_vars (4096 or better recommended)...", $_indRMV, "Your value: {$_reqMaxVars}. Can prevent some forms (especially in the ACP) from saving properly." ); + flushOutput( "suhosin.get.max_value_length (2000 or better recommended)...", $_indGML, "Your value: {$_postMaxLen}. Can prevent very long URLs from loading correctly." ); + flushOutput( "suhosin.post.max_value_length (1000000 or better recommended)...", $_indPML, "Your value: {$_postMaxLen}. Can prevent very large posts or other form submissions from saving properly." ); + flushOutput( "suhosin.request.max_value_length (1000000 or better recommended)...", $_indRML, "Your value: {$_reqMaxLen}. Can prevent very large posts or other form submissions from saving properly." ); + flushOutput( "suhosin.request.max_varname_length (350 or better recommended)...", $_indRMVL, "Your value: {$_reqMaxVar}. Can prevent long friendly URLs from loading correctly." ); +} + +//----------------------------------------- +// Flush output function +//----------------------------------------- + +function flushOutput( $checking, $result, $errorText ) +{ + print "

" . $checking; + + if( $result === 2 ) + { + print "WARNING
{$errorText}"; + } + else if( !$result ) + { + print "FAIL
{$errorText}"; + } + else + { + print "Pass"; + } + + print "

"; + + flush(); + ob_flush(); + + return true; +} + +?> + +

Please also remember that MySQL 4.1 or higher (MySQL 5.0 or higher preferred) is required for IP.Board . Ask your server administrator to check the version of MySQL on your server if you are unsure.

+ \ No newline at end of file diff --git a/Tools/groupBitwiseEdit_php.php b/Tools/groupBitwiseEdit_php.php index ce3564a7..a666b220 100644 --- a/Tools/groupBitwiseEdit_php.php +++ b/Tools/groupBitwiseEdit_php.php @@ -2,7 +2,7 @@ /* +--------------------------------------------------------------------------- -| IP.Board v3.4.5 +| IP.Board v3.4.6 | ======================================== | by Matthew Mecham | (c) 2008 Invision Power Services diff --git a/Tools/readme.txt b/Tools/readme.txt new file mode 100644 index 00000000..5a1bb021 --- /dev/null +++ b/Tools/readme.txt @@ -0,0 +1,56 @@ + +=============================================================== + +Ñêà÷àíî ñ ñàéòà www.Skripter.info + +=============================================================== + +Ó íàñ íà ñàéòå Âû íàéäåòå: + +Datalife Engine +Wordpress +Joomla +phpBB +IPB +vBulletin +Èãðîâûå CMS .....è ò.ä. + +Âñå îò ìîäóëåé è øàáëîíîâ äî óðîêîâ ïî èíòåðåñóþùèì âàñ âîïðîñàì. + +---------------------------------------------------------------- + +Äîáðî ïîæàëîâàòü íà íàø ñàéò !!! + +---------------------------------------------------------------- + +Àäìèíèñòðàöèÿ ñàéòà Skripter.info + +============================================== +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +=============================================================== + +Download from www.Skripter.info + +=============================================================== + +At our site you will find: + +Datalife Engine +Wordpress +Joomla +phpBB +IPB +vBulletin +Gaming CMS ..... etc. + +All of the modules and templates to lessons on your questions. + +---------------------------------------------------------------- + +Welcome to our site! + +---------------------------------------------------------------- + +The website administration Skripter.info + +============================================== \ No newline at end of file diff --git a/Tools/rebuildFromXml.php b/Tools/rebuildFromXml.php index 1a1413e8..bfe258ab 100644 --- a/Tools/rebuildFromXml.php +++ b/Tools/rebuildFromXml.php @@ -4,7 +4,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Rebuilds stuff from XML
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
diff --git a/Tools/rebuildGallery4.php b/Tools/rebuildGallery4.php index c40333dd..60c903b4 100644 --- a/Tools/rebuildGallery4.php +++ b/Tools/rebuildGallery4.php @@ -4,7 +4,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Main public executable wrapper.
  * Set-up and load module to run
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
diff --git a/Tools/rebuildGalleryImages.php b/Tools/rebuildGalleryImages.php
index 01b508f5..484d0b2c 100644
--- a/Tools/rebuildGalleryImages.php
+++ b/Tools/rebuildGalleryImages.php
@@ -4,7 +4,7 @@
 /**
  * 
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Main public executable wrapper.
  * Set-up and load module to run
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
diff --git a/Tools/rebuildPms.php b/Tools/rebuildPms.php
index 8c4c3a42..a52067f5 100644
--- a/Tools/rebuildPms.php
+++ b/Tools/rebuildPms.php
@@ -4,7 +4,7 @@
 /**
  * 
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Main public executable wrapper.
  * Set-up and load module to run
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
diff --git a/Tools/rebuildPosts.php b/Tools/rebuildPosts.php
index f7ee9fb7..8a383628 100644
--- a/Tools/rebuildPosts.php
+++ b/Tools/rebuildPosts.php
@@ -4,7 +4,7 @@
 /**
  * 
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Main public executable wrapper.
  * Set-up and load module to run
  * Last Updated: $Date: 2013-02-05 06:22:45 -0500 (Tue, 05 Feb 2013) $
diff --git a/Tools/seoFiles.php b/Tools/seoFiles.php
index fd2ac44f..9bae8fba 100644
--- a/Tools/seoFiles.php
+++ b/Tools/seoFiles.php
@@ -4,7 +4,7 @@
 /**
  * 
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Main public executable wrapper.
  * Set-up and load module to run
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
diff --git a/Tools/seoGalleryAlbums.php b/Tools/seoGalleryAlbums.php
index 3ee8e984..c46b82b4 100644
--- a/Tools/seoGalleryAlbums.php
+++ b/Tools/seoGalleryAlbums.php
@@ -4,7 +4,7 @@
 /**
  * 
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Main public executable wrapper.
  * Set-up and load module to run
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
diff --git a/Tools/seoMemberNames.php b/Tools/seoMemberNames.php
index 9cd27d0a..372d926d 100644
--- a/Tools/seoMemberNames.php
+++ b/Tools/seoMemberNames.php
@@ -4,7 +4,7 @@
 /**
  * 
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Main public executable wrapper.
  * Set-up and load module to run
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
diff --git a/Tools/seoTopicTitles.php b/Tools/seoTopicTitles.php
index 837a760e..b37bb69c 100644
--- a/Tools/seoTopicTitles.php
+++ b/Tools/seoTopicTitles.php
@@ -4,7 +4,7 @@
 /**
  * 
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Main public executable wrapper.
  * Set-up and load module to run
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
diff --git a/Tools/skinchange.php b/Tools/skinchange.php
index 33503c4c..fe765cde 100644
--- a/Tools/skinchange.php
+++ b/Tools/skinchange.php
@@ -2,7 +2,7 @@
 /**
  * 
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Simple skin change script
  * Place in your site root directory to send a user to a specified skin
  * Last Updated: $Date: 2012-05-16 10:43:54 -0400 (Wed, 16 May 2012) $
diff --git a/Tools/ssi_templates/index.html b/Tools/ssi_templates/index.html
index 7a344989..63a4a1e4 100644
--- a/Tools/ssi_templates/index.html
+++ b/Tools/ssi_templates/index.html
@@ -1 +1 @@
-
Invision Power Board - Bulletin Board System

403: Invision Power Board -> Forbidden


You have reached this Page in error, please use your back button to return to Invision Board.
Invision Power Board \ No newline at end of file + Invision Power Board - Bulletin Board System

403: Invision Power Board -> Forbidden


You have reached this Page in error, please use your back button to return to Invision Board.
Invision Power Board \ No newline at end of file diff --git a/Tools/upgradeFinish/index.php b/Tools/upgradeFinish/index.php index 36dad00d..15500cad 100644 --- a/Tools/upgradeFinish/index.php +++ b/Tools/upgradeFinish/index.php @@ -2,7 +2,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Installer: Upgrader core file
  * Last Updated: $LastChangedDate: 2013-01-29 14:15:42 -0500 (Tue, 29 Jan 2013) $
  * 
diff --git a/upload/admin/api/api_core.php b/upload/admin/api/api_core.php index 5dc88912..ea83a17d 100644 --- a/upload/admin/api/api_core.php +++ b/upload/admin/api/api_core.php @@ -7,7 +7,7 @@ * $Author: ips_terabyte $ * @since - * $LastChangedDate: 2011-03-18 17:34:15 -0400 (Fri, 18 Mar 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 8129 $ */ diff --git a/upload/admin/api/forums/api_topic_view.php b/upload/admin/api/forums/api_topic_view.php index c1a272bd..4cb24a6d 100644 --- a/upload/admin/api/forums/api_topic_view.php +++ b/upload/admin/api/forums/api_topic_view.php @@ -7,7 +7,7 @@ * $Author: AndyMillne $ * @since 2.2.0 * $LastChangedDate: 2013-03-21 17:38:09 -0400 (Thu, 21 Mar 2013) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 12109 $ */ diff --git a/upload/admin/api/forums/index.html b/upload/admin/api/forums/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/api/forums/index.html +++ b/upload/admin/api/forums/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/api/index.html b/upload/admin/api/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/api/index.html +++ b/upload/admin/api/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/extensions/admin/group_form.php b/upload/admin/applications/core/extensions/admin/group_form.php index ec87ff8b..bdb1c2c6 100644 --- a/upload/admin/applications/core/extensions/admin/group_form.php +++ b/upload/admin/applications/core/extensions/admin/group_form.php @@ -7,7 +7,7 @@ * $Author: bfarber $ * @since - * $LastChangedDate: 2011-07-20 20:19:22 -0400 (Wed, 20 Jul 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 9296 $ */ diff --git a/upload/admin/applications/core/extensions/admin/index.html b/upload/admin/applications/core/extensions/admin/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/extensions/admin/index.html +++ b/upload/admin/applications/core/extensions/admin/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/extensions/admin/member_form.php b/upload/admin/applications/core/extensions/admin/member_form.php index dd6b9e4e..eb65bd67 100644 --- a/upload/admin/applications/core/extensions/admin/member_form.php +++ b/upload/admin/applications/core/extensions/admin/member_form.php @@ -3,7 +3,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Member property updater (AJAX)
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
diff --git a/upload/admin/applications/core/extensions/comments/index.html b/upload/admin/applications/core/extensions/comments/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/extensions/comments/index.html +++ b/upload/admin/applications/core/extensions/comments/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/extensions/coreExtensions.php b/upload/admin/applications/core/extensions/coreExtensions.php index f135e53c..9e421520 100644 --- a/upload/admin/applications/core/extensions/coreExtensions.php +++ b/upload/admin/applications/core/extensions/coreExtensions.php @@ -3,7 +3,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Core Sessions
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
@@ -28,7 +28,7 @@ if ( ! defined( 'IN_IPB' ) ) /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Item Marking
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
diff --git a/upload/admin/applications/core/extensions/coreVariables.php b/upload/admin/applications/core/extensions/coreVariables.php index 000ad488..56eadc6b 100644 --- a/upload/admin/applications/core/extensions/coreVariables.php +++ b/upload/admin/applications/core/extensions/coreVariables.php @@ -2,7 +2,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Core registered caches, redirect resets and bitwise settings
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
diff --git a/upload/admin/applications/core/extensions/dashboardNotifications.php b/upload/admin/applications/core/extensions/dashboardNotifications.php index 9c4715e4..8fa2dea2 100644 --- a/upload/admin/applications/core/extensions/dashboardNotifications.php +++ b/upload/admin/applications/core/extensions/dashboardNotifications.php @@ -1,335 +1,237 @@ - - * Invision Power Services - * IP.Board v3.4.5 - * Dashboard Notifications - * Last Updated: $Date - * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/company/standards.php#license - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 12238 $ - */ - -if ( ! defined( 'IN_IPB' ) ) -{ - print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -/** -* Main loader class -*/ -class dashboardNotifications__core -{ - /** - * Registry Object Shortcuts - * - * @var object - */ - public $settings; - public $lang; - public $cache; - public $caches; - public $DB; - - public function __construct() - { - $this->settings = ipsRegistry::fetchSettings(); - $this->lang = ipsRegistry::getClass('class_localization'); - $this->caches =& ipsRegistry::cache()->fetchCaches(); - $this->cache = ipsRegistry::cache(); - $this->DB = ipsRegistry::DB(); - } - - public function get() - { - /* INIT */ - $entries = array(); - - if( ! $this->settings['ipb_reg_number'] ) - { - $entries[] = array( $this->lang->words['lc_title_nokey'], sprintf( $this->lang->words['lc_msg_nokey'], "{$this->settings['base_url']}module=tools&section=licensekey" ) ); - } - else - { - /* Is the Spam Service Working? */ - if ( $this->settings['spam_service_enabled'] ) - { - $GOT_SPAM_ERROR = false; - - /* Are we entitled to it? */ - $licenseData = $this->cache->getCache( 'licenseData' ); - - if ( is_array( $licenseData['ipbMain'] ) && count( $licenseData['ipbMain'] ) ) - { - foreach ( $licenseData['ipbMain'] as $data ) - { - if ( $data['name'] == 'Spam Monitoring Service' && $data['status'] != 'Ok' ) - { - $disableLink = $this->settings['base_url'] . "app=core&module=settings&section=settings&do=findsetting&key=spamservice"; - - if ( is_numeric( $data['_expires'] ) && time() > $data['_expires'] ) - { - $entries[] = array( $this->lang->words['spam_service_error'], sprintf( $this->lang->words['spam_service_expired'], $disableLink ) ); - } - else - { - $entries[] = array( $this->lang->words['spam_service_error'], sprintf( $this->lang->words['spam_service_unavailable'], $disableLink ) ); - } - - $GOT_SPAM_ERROR = true; - - break; - } - } - } - - if ( ! $GOT_SPAM_ERROR ) - { - /* Get last 5 logs, and if all 5 are errors, show message */ - $_errors = 0; - $_entries = 0; - $_lastError = ''; - - $this->DB->build( array( 'select' => 'log_code, log_msg', 'from' => 'spam_service_log', 'order' => 'id DESC', 'limit' => 5 ) ); - $this->DB->execute(); - - while( $_r = $this->DB->fetch() ) - { - $_entries++; - - if( $_r['log_code'] === '0' ) - { - $_errors++; - - if( !$_lastError ) - { - $_lastError = $_r['log_msg']; - } - } - } - - if( $_entries > 0 && $_errors == $_entries ) - { - $entries[] = array( $this->lang->words['spam_service_error'], sprintf( $this->lang->words['spam_service_error_msg'], $_lastError ) ); - } - } - } - /* If it's disabled, are we entitiled to it? */ - else - { - $licenseData = $this->cache->getCache( 'licenseData' ); - - if ( is_array( $licenseData['ipbMain'] ) && count( $licenseData['ipbMain'] ) ) - { - foreach ( $licenseData['ipbMain'] as $data ) - { - if ( $data['name'] == 'Spam Monitoring Service' && $data['status'] == 'Ok' ) - { - $entries[] = array( $this->lang->words['spam_service_disabled'], $this->lang->words['spam_service_disabled_msg'] ); - break; - } - } - } - } - } - - /* FURL cache OOD? */ - if ( is_file( FURL_CACHE_PATH ) ) - { - $mtime = intval( @filemtime( FURL_CACHE_PATH ) ); - - /* Check mtimes on extensions.. */ - foreach( ipsRegistry::$applications as $app_dir => $application ) - { - $furltemplatesfile = IPSLib::getAppDir( $app_dir ); - if(IPB_USE_ONLY_ID_FURL && is_file( $furltemplatesfile.'/extensions/furlTemplatesID.php')) - { - $furltemplatesfile.='/extensions/furlTemplatesID.php'; - } - else - { - $furltemplatesfile.='/extensions/furlTemplates.php'; - } - - if ( is_file( $furltemplatesfile ) ) - { - $_mtime = intval( @filemtime( $furltemplatesfile ) ); - - if ( $_mtime > $mtime ) - { - $entries[] = array( $this->lang->words['furlcache_outofdate'], sprintf( $this->lang->words['furlcache_outofdate_desc'], $application['app_title'] ) . "{$this->lang->words['rebuild_furl_cache']}" ); - break; - } - } - } - } - - /* Sphinx cache OOD? */ - if ( $this->settings['search_method'] == 'sphinx' ) - { - $mtime = intval( $this->cache->getCache('sphinx_config') ); - - /* Check mtimes on extensions.. */ - foreach( ipsRegistry::$applications as $app_dir => $application ) - { - if ( is_file( IPSLib::getAppDir( $app_dir ) . '/extensions/sphinxTemplate.php' ) ) - { - $_mtime = intval( @filemtime( IPSLib::getAppDir( $app_dir ) . '/extensions/sphinxTemplate.php' ) ); - - if ( !$mtime OR $_mtime > $mtime ) - { - $entries[] = array( $this->lang->words['sphinxconfig_outofdate'], $this->lang->words['sphinxconfig_outofdate_desc'] . ' ' . "{$this->lang->words['rebuild_sphinx_config']}" ); - break; - } - } - } - } - - /* Minify on but /cache/tmp not writeable? */ - if ( !empty( $this->settings['_use_minify'] ) ) - { - $entries[] = array( $this->lang->words['minifywrite_head'], $this->lang->words['minifynot_writeable'] ); - } - - /* Installer Check */ - if( @is_file( IPS_ROOT_PATH . 'install/index.php' ) ) - { - if ( ! @is_file( DOC_IPS_ROOT_PATH . 'cache/installer_lock.php' ) ) - { - $this->lang->words['cp_unlocked_warning'] = sprintf( $this->lang->words['cp_unlocked_warning'], CP_DIRECTORY ); - $entries[] = array( $this->lang->words['cp_unlockedinstaller'], $this->lang->words['cp_unlocked_warning'] ); - } - } - - /* Unfinished Upgrade */ - require_once( IPS_ROOT_PATH . '/setup/sources/base/setup.php' );/*noLibHook*/ - $versions = IPSSetUp::fetchAppVersionNumbers( 'core' ); - - if( $versions['current'][0] != $versions['latest'][0] ) - { - $this->lang->words['cp_upgrade_warning'] = sprintf( $this->lang->words['cp_upgrade_warning'], $versions['current'][1], $versions['latest'][1], $this->settings['base_acp_url'] ); - - $entries[] = array( $this->lang->words['cp_unfinishedupgrade'], $this->lang->words['cp_upgrade_warning'] ); - } - - /** - * PHP Version Check - * - * @todo Remove this for 4.0? Installer/upgrader already do check for this anyway... - */ - if( PHP_VERSION < '5.2.0' ) - { - $entries[] = array( sprintf( $this->lang->words['cp_yourphpversion'], PHP_VERSION ), $this->lang->words['cp_php_warning'] ); - } - - /* Outgoing email address specified */ - if ( !$this->settings['email_out'] OR !$this->settings['email_in'] ) - { - $entries[] = array( $this->lang->words['cp_missingemail'], "{$this->lang->words['cp_missingemail1']}

{$this->lang->words['_raquo']} {$this->lang->words['cp_missingemail2']}" ); - } - - /* Board Offline Check */ - if ( $this->settings['board_offline'] ) - { - $entries[] = array( $this->lang->words['cp_boardoffline'], "{$this->lang->words['cp_boardoffline1']}

{$this->lang->words['_raquo']} {$this->lang->words['cp_boardoffline2']}" ); - } - - /* Fulltext Check */ - if( $this->settings['search_method'] == 'traditional' AND !$this->settings['use_fulltext'] AND !$this->settings['hide_ftext_note'] ) - { - $entries[] = array( $this->lang->words['fulltext_off'], "{$this->lang->words['fulltext_turnon']}

{$this->lang->words['_raquo']} {$this->lang->words['fulltext_find']}" ); - } - - /* Make sure the profile directory is writable */ - if( ! is_dir( $this->settings['upload_dir'] . '/profile/' ) || ! is_writable( $this->settings['upload_dir'] . '/profile/' ) ) - { - $entries[] = array( $this->lang->words['cp_profilephotoerr_title'], sprintf( $this->lang->words['cp_profilephotoerr_msg'], $this->settings['upload_dir'] . '/profile/' ) ); - } - - /* Check for upgrade finish folder */ - if( is_dir( IPS_ROOT_PATH . 'upgradeFinish/' ) ) - { - $entries[] = array( $this->lang->words['cp_upgradefinishfolder'], sprintf( $this->lang->words['cp_upgradefinishfolder_msg'], IPS_ROOT_PATH . 'upgradeFinish/' ) ); - } - - /* Check to see if GD is intalled */ - if(! extension_loaded( 'gd' ) || ! function_exists( 'gd_info' ) ) - { - $entries[] = array( $this->lang->words['cp_gdnotinstalled_title'], $this->lang->words['cp_gdnotinstalled_msg'] ); - } - - /* Performance mode check */ - $perfMode = $this->cache->getCache('performanceCache'); - - if( is_array( $perfMode ) && count( $perfMode ) ) - { - $entries[] = array( $this->lang->words['cp_perfmodeon_title'], $this->lang->words['cp_perfmodeon_msg'] ); - } - - /* Suhosin check */ - if( extension_loaded( 'suhosin' ) ) - { - $_postMaxVars = @ini_get('suhosin.post.max_vars'); - $_reqMaxVars = @ini_get('suhosin.request.max_vars'); - $_getMaxLen = @ini_get('suhosin.get.max_value_length'); - $_postMaxLen = @ini_get('suhosin.post.max_value_length'); - $_reqMaxLen = @ini_get('suhosin.request.max_value_length'); - $_reqMaxVar = @ini_get('suhosin.request.max_varname_length'); - - if( $_postMaxVars < 4096 ) - { - $entries[] = array( $this->lang->words['suhosin_notification'], sprintf( $this->lang->words['suhosin_badvalue1'], $_postMaxVars ) ); - } - - if( $_reqMaxVars < 4096 ) - { - $entries[] = array( $this->lang->words['suhosin_notification'], sprintf( $this->lang->words['suhosin_badvalue2'], $_reqMaxVars ) ); - } - - if( $_getMaxLen < 2000 ) - { - $entries[] = array( $this->lang->words['suhosin_notification'], sprintf( $this->lang->words['suhosin_badvalue6'], $_getMaxLen ) ); - } - - if( $_postMaxLen < 1000000 ) - { - $entries[] = array( $this->lang->words['suhosin_notification'], sprintf( $this->lang->words['suhosin_badvalue3'], $_postMaxLen ) ); - } - - if( $_reqMaxLen < 1000000 ) - { - $entries[] = array( $this->lang->words['suhosin_notification'], sprintf( $this->lang->words['suhosin_badvalue4'], $_reqMaxLen ) ); - } - - if( $_reqMaxVar < 350 ) - { - $entries[] = array( $this->lang->words['suhosin_notification'], sprintf( $this->lang->words['suhosin_badvalue5'], $_reqMaxVar ) ); - } - } - - /* SQL error check */ - /*if ( is_file( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' ) ) - { - $unix = @filemtime( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' ); - - if ( $unix ) - { - $mtime = gmdate( 'd-j-Y', $unix ); - $now = gmdate( 'd-j-Y', time() ); - - if ( $mtime == $now ) - { - // Display a message - } - } - }*/ - - return $entries; - } + + * Invision Power Services + * IP.Board v3.4.6 + * Dashboard Notifications + * Last Updated: $Date + * + * @author $Author: bfarber $ + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license http://www.invisionpower.com/company/standards.php#license + * @package IP.Board + * @subpackage Core + * @link http://www.invisionpower.com + * @version $Rev: 12238 $ + */ + +if ( ! defined( 'IN_IPB' ) ) +{ + print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +/** +* Main loader class +*/ +class dashboardNotifications__core +{ + /** + * Registry Object Shortcuts + * + * @var object + */ + public $settings; + public $lang; + public $cache; + public $caches; + public $DB; + + public function __construct() + { + $this->settings = ipsRegistry::fetchSettings(); + $this->lang = ipsRegistry::getClass('class_localization'); + $this->caches =& ipsRegistry::cache()->fetchCaches(); + $this->cache = ipsRegistry::cache(); + $this->DB = ipsRegistry::DB(); + } + + public function get() + { + /* INIT */ + $entries = array(); + + /* FURL cache OOD? */ + if ( is_file( FURL_CACHE_PATH ) ) + { + $mtime = intval( @filemtime( FURL_CACHE_PATH ) ); + + /* Check mtimes on extensions.. */ + foreach( ipsRegistry::$applications as $app_dir => $application ) + { + if ( is_file( IPSLib::getAppDir( $app_dir ) . '/extensions/furlTemplates.php' ) ) + { + $_mtime = intval( @filemtime( IPSLib::getAppDir( $app_dir ) . '/extensions/furlTemplates.php' ) ); + + if ( $_mtime > $mtime ) + { + $entries[] = array( $this->lang->words['furlcache_outofdate'], sprintf( $this->lang->words['furlcache_outofdate_desc'], $application['app_title'] ) . "{$this->lang->words['rebuild_furl_cache']}" ); + break; + } + } + } + } + + /* Sphinx cache OOD? */ + if ( $this->settings['search_method'] == 'sphinx' ) + { + $mtime = intval( $this->cache->getCache('sphinx_config') ); + + /* Check mtimes on extensions.. */ + foreach( ipsRegistry::$applications as $app_dir => $application ) + { + if ( is_file( IPSLib::getAppDir( $app_dir ) . '/extensions/sphinxTemplate.php' ) ) + { + $_mtime = intval( @filemtime( IPSLib::getAppDir( $app_dir ) . '/extensions/sphinxTemplate.php' ) ); + + if ( !$mtime OR $_mtime > $mtime ) + { + $entries[] = array( $this->lang->words['sphinxconfig_outofdate'], $this->lang->words['sphinxconfig_outofdate_desc'] . ' ' . "{$this->lang->words['rebuild_sphinx_config']}" ); + break; + } + } + } + } + + /* Minify on but /cache/tmp not writeable? */ + if ( !empty( $this->settings['_use_minify'] ) ) + { + $entries[] = array( $this->lang->words['minifywrite_head'], $this->lang->words['minifynot_writeable'] ); + } + + /* Installer Check */ + if( @is_file( IPS_ROOT_PATH . 'install/index.php' ) ) + { + if ( ! @is_file( DOC_IPS_ROOT_PATH . 'cache/installer_lock.php' ) ) + { + $this->lang->words['cp_unlocked_warning'] = sprintf( $this->lang->words['cp_unlocked_warning'], CP_DIRECTORY ); + $entries[] = array( $this->lang->words['cp_unlockedinstaller'], $this->lang->words['cp_unlocked_warning'] ); + } + } + + /* Unfinished Upgrade */ + require_once( IPS_ROOT_PATH . '/setup/sources/base/setup.php' );/*noLibHook*/ + $versions = IPSSetUp::fetchAppVersionNumbers( 'core' ); + + if( $versions['current'][0] != $versions['latest'][0] ) + { + $this->lang->words['cp_upgrade_warning'] = sprintf( $this->lang->words['cp_upgrade_warning'], $versions['current'][1], $versions['latest'][1], $this->settings['base_acp_url'] ); + + $entries[] = array( $this->lang->words['cp_unfinishedupgrade'], $this->lang->words['cp_upgrade_warning'] ); + } + + /** + * PHP Version Check + * + * @todo Remove this for 4.0? Installer/upgrader already do check for this anyway... + */ + if( PHP_VERSION < '5.2.0' ) + { + $entries[] = array( sprintf( $this->lang->words['cp_yourphpversion'], PHP_VERSION ), $this->lang->words['cp_php_warning'] ); + } + + /* Outgoing email address specified */ + if ( !$this->settings['email_out'] OR !$this->settings['email_in'] ) + { + $entries[] = array( $this->lang->words['cp_missingemail'], "{$this->lang->words['cp_missingemail1']}

{$this->lang->words['_raquo']} {$this->lang->words['cp_missingemail2']}" ); + } + + /* Board Offline Check */ + if ( $this->settings['board_offline'] ) + { + $entries[] = array( $this->lang->words['cp_boardoffline'], "{$this->lang->words['cp_boardoffline1']}

{$this->lang->words['_raquo']} {$this->lang->words['cp_boardoffline2']}" ); + } + + /* Fulltext Check */ + if( $this->settings['search_method'] == 'traditional' AND !$this->settings['use_fulltext'] AND !$this->settings['hide_ftext_note'] ) + { + $entries[] = array( $this->lang->words['fulltext_off'], "{$this->lang->words['fulltext_turnon']}

{$this->lang->words['_raquo']} {$this->lang->words['fulltext_find']}" ); + } + + /* Make sure the profile directory is writable */ + if( ! is_dir( $this->settings['upload_dir'] . '/profile/' ) || ! is_writable( $this->settings['upload_dir'] . '/profile/' ) ) + { + $entries[] = array( $this->lang->words['cp_profilephotoerr_title'], sprintf( $this->lang->words['cp_profilephotoerr_msg'], $this->settings['upload_dir'] . '/profile/' ) ); + } + + /* Check for upgrade finish folder */ + if( is_dir( IPS_ROOT_PATH . 'upgradeFinish/' ) ) + { + $entries[] = array( $this->lang->words['cp_upgradefinishfolder'], sprintf( $this->lang->words['cp_upgradefinishfolder_msg'], IPS_ROOT_PATH . 'upgradeFinish/' ) ); + } + + /* Check to see if GD is intalled */ + if(! extension_loaded( 'gd' ) || ! function_exists( 'gd_info' ) ) + { + $entries[] = array( $this->lang->words['cp_gdnotinstalled_title'], $this->lang->words['cp_gdnotinstalled_msg'] ); + } + + /* Performance mode check */ + $perfMode = $this->cache->getCache('performanceCache'); + + if( is_array( $perfMode ) && count( $perfMode ) ) + { + $entries[] = array( $this->lang->words['cp_perfmodeon_title'], $this->lang->words['cp_perfmodeon_msg'] ); + } + + /* Suhosin check */ + if( extension_loaded( 'suhosin' ) ) + { + $_postMaxVars = @ini_get('suhosin.post.max_vars'); + $_reqMaxVars = @ini_get('suhosin.request.max_vars'); + $_getMaxLen = @ini_get('suhosin.get.max_value_length'); + $_postMaxLen = @ini_get('suhosin.post.max_value_length'); + $_reqMaxLen = @ini_get('suhosin.request.max_value_length'); + $_reqMaxVar = @ini_get('suhosin.request.max_varname_length'); + + if( $_postMaxVars < 4096 ) + { + $entries[] = array( $this->lang->words['suhosin_notification'], sprintf( $this->lang->words['suhosin_badvalue1'], $_postMaxVars ) ); + } + + if( $_reqMaxVars < 4096 ) + { + $entries[] = array( $this->lang->words['suhosin_notification'], sprintf( $this->lang->words['suhosin_badvalue2'], $_reqMaxVars ) ); + } + + if( $_getMaxLen < 2000 ) + { + $entries[] = array( $this->lang->words['suhosin_notification'], sprintf( $this->lang->words['suhosin_badvalue6'], $_getMaxLen ) ); + } + + if( $_postMaxLen < 1000000 ) + { + $entries[] = array( $this->lang->words['suhosin_notification'], sprintf( $this->lang->words['suhosin_badvalue3'], $_postMaxLen ) ); + } + + if( $_reqMaxLen < 1000000 ) + { + $entries[] = array( $this->lang->words['suhosin_notification'], sprintf( $this->lang->words['suhosin_badvalue4'], $_reqMaxLen ) ); + } + + if( $_reqMaxVar < 350 ) + { + $entries[] = array( $this->lang->words['suhosin_notification'], sprintf( $this->lang->words['suhosin_badvalue5'], $_reqMaxVar ) ); + } + } + + /* SQL error check */ + /*if ( is_file( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' ) ) + { + $unix = @filemtime( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' ); + + if ( $unix ) + { + $mtime = gmdate( 'd-j-Y', $unix ); + $now = gmdate( 'd-j-Y', time() ); + + if ( $mtime == $now ) + { + // Display a message + } + } + }*/ + + return $entries; + } } \ No newline at end of file diff --git a/upload/admin/applications/core/extensions/editorSections.php b/upload/admin/applications/core/extensions/editorSections.php index 1991e71d..c0e47448 100644 --- a/upload/admin/applications/core/extensions/editorSections.php +++ b/upload/admin/applications/core/extensions/editorSections.php @@ -3,7 +3,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * BBCode Management : Determines if bbcode can be used in this section
  * Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
diff --git a/upload/admin/applications/core/extensions/enhancements/facebook.php b/upload/admin/applications/core/extensions/enhancements/facebook.php index cb767213..9b09a40e 100644 --- a/upload/admin/applications/core/extensions/enhancements/facebook.php +++ b/upload/admin/applications/core/extensions/enhancements/facebook.php @@ -7,7 +7,7 @@ * $Author: mark $ * @since 24 July 2012 * $LastChangedDate: 2012-06-20 10:50:23 +0100 (Wed, 20 Jun 2012) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 10952 $ */ @@ -33,6 +33,6 @@ class enhancements_core_facebook $this->title = $registry->getClass('class_localization')->words['enhancements_facebook']; $this->description = $registry->getClass('class_localization')->words['enhancements_facebook_desc']; $this->enabled = ipsRegistry::$settings['fbc_enable']; - $this->message = '' . ipsRegistry::getClass('class_localization')->words['enhancements_facebook_help'] . ''; + $this->message = '' . ipsRegistry::getClass('class_localization')->words['enhancements_facebook_help'] . ''; } } \ No newline at end of file diff --git a/upload/admin/applications/core/extensions/enhancements/googleanalytics.php b/upload/admin/applications/core/extensions/enhancements/googleanalytics.php index 98d453c4..c064ecf9 100644 --- a/upload/admin/applications/core/extensions/enhancements/googleanalytics.php +++ b/upload/admin/applications/core/extensions/enhancements/googleanalytics.php @@ -7,7 +7,7 @@ * $Author: mark $ * @since 24 July 2012 * $LastChangedDate: 2012-06-20 10:50:23 +0100 (Wed, 20 Jun 2012) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 10952 $ */ diff --git a/upload/admin/applications/core/extensions/enhancements/ipsbackup.php b/upload/admin/applications/core/extensions/enhancements/ipsbackup.php index b1630a26..2baccc75 100644 --- a/upload/admin/applications/core/extensions/enhancements/ipsbackup.php +++ b/upload/admin/applications/core/extensions/enhancements/ipsbackup.php @@ -7,7 +7,7 @@ * $Author: mark $ * @since 24 July 2012 * $LastChangedDate: 2012-06-20 10:50:23 +0100 (Wed, 20 Jun 2012) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 10952 $ */ diff --git a/upload/admin/applications/core/extensions/enhancements/ipscdn.php b/upload/admin/applications/core/extensions/enhancements/ipscdn.php index b7adfa61..a3f06151 100644 --- a/upload/admin/applications/core/extensions/enhancements/ipscdn.php +++ b/upload/admin/applications/core/extensions/enhancements/ipscdn.php @@ -7,7 +7,7 @@ * $Author: mark $ * @since 24 July 2012 * $LastChangedDate: 2012-06-20 10:50:23 +0100 (Wed, 20 Jun 2012) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 10952 $ */ @@ -90,9 +90,9 @@ class enhancements_core_ipscdn ipsRegistry::getClass('output')->showError( sprintf( ipsRegistry::getClass('class_localization')->words['enhancements_ipscdn_error_nokey'], ipsRegistry::getClass('output')->buildUrl('app=core&module=tools§ion=licensekey', 'admin') ) ); } - $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' ); + /* $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' ); $file = new $classToLoad(); - $return = NULL; + $ping = $file->getFileContents( "http://license.invisionpower.com/?a=cdn&key=" . ipsRegistry::$settings['ipb_reg_number'] ); */ if ( $json = @json_decode( $ping, TRUE ) ) { diff --git a/upload/admin/applications/core/extensions/enhancements/twitter.php b/upload/admin/applications/core/extensions/enhancements/twitter.php index 4087ca69..fad2faf4 100644 --- a/upload/admin/applications/core/extensions/enhancements/twitter.php +++ b/upload/admin/applications/core/extensions/enhancements/twitter.php @@ -7,7 +7,7 @@ * $Author: mark $ * @since 24 July 2012 * $LastChangedDate: 2012-06-20 10:50:23 +0100 (Wed, 20 Jun 2012) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 10952 $ */ @@ -33,6 +33,6 @@ class enhancements_core_twitter $this->title = $registry->getClass('class_localization')->words['enhancements_twitter']; $this->description = $registry->getClass('class_localization')->words['enhancements_twitter_desc']; $this->enabled = ipsRegistry::$settings['tc_enabled']; - $this->message = '' . ipsRegistry::getClass('class_localization')->words['enhancements_twitter_help'] . ''; + $this->message = '' . ipsRegistry::getClass('class_localization')->words['enhancements_twitter_help'] . ''; } } \ No newline at end of file diff --git a/upload/admin/applications/core/extensions/enhancements/viglink.php b/upload/admin/applications/core/extensions/enhancements/viglink.php index 6a1c5a48..34ed12bc 100644 --- a/upload/admin/applications/core/extensions/enhancements/viglink.php +++ b/upload/admin/applications/core/extensions/enhancements/viglink.php @@ -7,7 +7,7 @@ * $Author: mark $ * @since 24 July 2012 * $LastChangedDate: 2012-06-20 10:50:23 +0100 (Wed, 20 Jun 2012) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 10952 $ */ @@ -99,9 +99,9 @@ class enhancements_core_viglink } } - require_once IPS_KERNEL_PATH . 'classFileManagement.php'; + /* require_once IPS_KERNEL_PATH . 'classFileManagement.php'; $cfm = new classFileManagement(); - $return = NULL; + $return = $cfm->getFileContents( "http://license.invisionpower.com/viglink/?subId=" . urlencode( $subId ) ); */ if ( $return and $json = @json_decode( $return, TRUE ) and $json['SUCCESS'] == TRUE ) { return $json; diff --git a/upload/admin/applications/core/extensions/enhancements/windowslive.php b/upload/admin/applications/core/extensions/enhancements/windowslive.php index c8410aff..25b22775 100644 --- a/upload/admin/applications/core/extensions/enhancements/windowslive.php +++ b/upload/admin/applications/core/extensions/enhancements/windowslive.php @@ -7,7 +7,7 @@ * $Author: mark $ * @since 24 July 2012 * $LastChangedDate: 2012-06-20 10:50:23 +0100 (Wed, 20 Jun 2012) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 10952 $ */ diff --git a/upload/admin/applications/core/extensions/furlTemplates.php b/upload/admin/applications/core/extensions/furlTemplates.php index 71575fdb..36ab8072 100644 --- a/upload/admin/applications/core/extensions/furlTemplates.php +++ b/upload/admin/applications/core/extensions/furlTemplates.php @@ -2,7 +2,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Sets up SEO templates
  * Last Updated: $Date: 2013-03-12 09:54:04 -0400 (Tue, 12 Mar 2013) $
  * 
@@ -52,18 +52,6 @@ $_SEOTEMPLATES = array( 'in' => array( 'regex' => "#/register(/|$|\?)#i", 'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'register' ) ) ) ), -'section=lostpass' => array( 'app' => 'core', - 'allowRedirect' => 0, - 'out' => array( '#app=core(&|&)module=global(&|&)section=lostpass(&|&|$)#i', 'lostpass/$3' ), - 'in' => array( 'regex' => "#/lostpass(/|$|\?)#i", - 'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'lostpass' ) ) ) ), - -'section=login' => array( 'app' => 'core', - 'allowRedirect' => 0, - 'out' => array( '#app=core(&|&)module=global(&|&)section=login(&|&|$)#i', 'login/$3' ), - 'in' => array( 'regex' => "#/login(/|$|\?)#i", - 'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'login' ) ) ) ), - 'tags' => array( 'app' => 'core', 'isPagesMode' => true, 'allowRedirect' => 0, @@ -96,7 +84,7 @@ $_SEOTEMPLATES = array( 'section=rss2' => array( 'app' => 'core', 'allowRedirect' => 0, 'out' => array( '#app=core(&|&)module=global(&|&)section=rss(&|&)type=(\w+?)(&|&)id=(\w+?)$#i', 'rss/$4/$6-#{__title__}/' ), - 'in' => array( 'regex' => "#/rss/(\w+?)/(\w+?)(?:-|/|$)#i", + 'in' => array( 'regex' => "#/rss/(\w+?)/(\w+?)-#i", 'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'rss' ), array( 'type', '$1' ), array( 'id', '$2' ) ) ) ), # Changed section=rss2 id matching to use \w for more flexibility diff --git a/upload/admin/applications/core/extensions/furlTemplatesID.php b/upload/admin/applications/core/extensions/furlTemplatesID.php deleted file mode 100644 index d07a3289..00000000 --- a/upload/admin/applications/core/extensions/furlTemplatesID.php +++ /dev/null @@ -1,106 +0,0 @@ - - * Invision Power Services - * IP.Board v3.4.5 - * Sets up SEO templates - * Last Updated: $Date: 2013-03-12 09:54:04 -0400 (Tue, 12 Mar 2013) $ - *
- * - * @author $Author: mmecham $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/company/standards.php#license - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com - * @since 20th February 2002 - * @version $Rev: 12072 $ - * - */ - -if ( ! defined( 'IN_IPB' ) ) -{ - print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -/** - * SEO templates - * - * 'allowRedirect' is a flag to tell IP.Board whether to check the incoming link and if not formatted correctly, redirect the correct one - * - * OUT FORMAT REGEX: - * First array element is a regex to run to see if we've a match for the URL - * The second array element is the template to use the results of the parenthesis capture - * - * Special variable #{__title__} is replaced with the $title data passed to output->formatUrl( $url, $title) - * - * IMPORTANT: Remember that when these regex are used, the output has not been fully parsed so you will get: - * showuser={$data['member_id']} NOT showuser=1 so do not try and match numerics only! - * - * IN FORMAT REGEX - * - * This allows the registry to piece back together a URL based on the template regex - * So, for example: "/user/(\d+?)/", 'matches' => array( array( 'showuser' => '$1' ) )tells IP.Board to populate 'showuser' with the result - * of the parenthesis capture #1 - */ -$_SEOTEMPLATES = array( - -'section=register' => array( 'app' => 'core', - 'allowRedirect' => 0, - 'out' => array( '#app=core(&|&)module=global(&|&)section=register(&|&|$)#i', 'register/$3' ), - 'in' => array( 'regex' => "#/register(/|$|\?)#i", - 'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'register' ) ) ) ), - -'section=lostpass' => array( 'app' => 'core', - 'allowRedirect' => 0, - 'out' => array( '#app=core(&|&)module=global(&|&)section=lostpass(&|&|$)#i', 'lostpass/$3' ), - 'in' => array( 'regex' => "#/lostpass(/|$|\?)#i", - 'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'lostpass' ) ) ) ), - -'section=login' => array( 'app' => 'core', - 'allowRedirect' => 0, - 'out' => array( '#app=core(&|&)module=global(&|&)section=login(&|&|$)#i', 'login/$3' ), - 'in' => array( 'regex' => "#/login(/|$|\?)#i", - 'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'login' ) ) ) ), - -'tags' => array( 'app' => 'core', - 'isPagesMode' => true, - 'allowRedirect' => 0, - 'out' => array( '#app=core(&|&)module=search(&|&)do=search(&|&)search_tags=(\S+?)(&|&)search_app=(\S+?)(&|&|$)#i', 'tags/$6/$4/$7' ), - 'in' => array( 'regex' => "#/tags/(\S+?)/(\S+?)/#i", - 'matches' => array( array( 'app', 'core' ), array( 'module', 'search' ), array( 'do', 'search' ), array( 'search_tags', '$2' ), array( 'search_app', '$1' ) ) ) ), - -'privacy' => array( 'app' => 'core', - 'allowRedirect' => 0, - 'out' => array( '#app=core(&|&)module=global(&|&)section=privacy(&|&|$)#i', 'privacypolicy/$4/' ), - 'in' => array( 'regex' => "#/privacypolicy/#i", - 'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'privacy' ) ) ) ), - -'likeunsubscribe' => array( 'app' => 'core', - 'allowRedirect' => 0, - 'out' => array( '#app=core(&|&)module=global(&|&)section=like(&|&)do=unsubscribe(&|&)key=(\S+?)(&|&|$)#i', 'unsubscribe/$5/' ), - 'in' => array( 'regex' => "#/unsubscribe/(\S+?)/$#i", - 'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'like' ), array( 'do', 'unsubscribe' ), array( 'key', '$1' ) ) ) ), -'findcomment' => array( 'app' => 'core', - 'allowRedirect' => 0, - 'out' => array( '#app=core(&|&)module=global(&|&)section=comments(&|&)do=findComment(&|&)fromApp=(\S+?)(&|&)parentId=(\d+?)(&|&)commentId=(\d+?)(&|&|$)#i', 'findComment/$5/$7-$9' ), - 'in' => array( 'regex' => "#/findComment/(\S+?-\S+?)/(\d+?)-(\d+?)$#i", - 'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'comments' ), array( 'do', 'findComment' ), array( 'fromApp', '$1' ), array( 'parentId', '$2' ), array( 'commentId', '$3' ) ) ) ), -'section=rss' => array( 'app' => 'core', - 'allowRedirect' => 0, - 'out' => array( '#app=core(&|&)module=global(&|&)section=rss(&|&)type=(\w+?)$#i', 'rss/$4/' ), - 'in' => array( 'regex' => "#/rss/(\w+?)/$#i", - 'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'rss' ), array( 'type', '$1' ) ) ) ), - -'section=rss2' => array( 'app' => 'core', - 'allowRedirect' => 0, - 'out' => array( '#app=core(&|&)module=global(&|&)section=rss(&|&)type=(\w+?)(&|&)id=(\w+?)$#i', 'rss/$4/$6/' ), - 'in' => array( 'regex' => "#/rss/(\w+?)/(\w+?)(?:-|/|$)#i", - 'matches' => array( array( 'app', 'core' ), array( 'module', 'global' ), array( 'section', 'rss' ), array( 'type', '$1' ), array( 'id', '$2' ) ) ) ), - - -# Changed section=rss2 id matching to use \w for more flexibility - -); - \ No newline at end of file diff --git a/upload/admin/applications/core/extensions/index.html b/upload/admin/applications/core/extensions/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/extensions/index.html +++ b/upload/admin/applications/core/extensions/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/extensions/like/default.php b/upload/admin/applications/core/extensions/like/default.php index 9588a7e3..a4154f58 100644 --- a/upload/admin/applications/core/extensions/like/default.php +++ b/upload/admin/applications/core/extensions/like/default.php @@ -6,7 +6,7 @@ * $License: http://www.invisionpower.com/company/standards.php#license$ * $Author: mark $ * $LastChangedDate: 2011-12-08 16:43:34 +0000 (Thu, 08 Dec 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 9971 $ */ diff --git a/upload/admin/applications/core/extensions/navigation/generate.php b/upload/admin/applications/core/extensions/navigation/generate.php index ba7e9d0c..66a2159b 100644 --- a/upload/admin/applications/core/extensions/navigation/generate.php +++ b/upload/admin/applications/core/extensions/navigation/generate.php @@ -6,9 +6,9 @@ * $License: http://www.invisionpower.com/company/standards.php#license$ * $Author: AndyMillne $ * @since 3/8/2011 - * $LastChangedDate: 2013-03-12 15:04:05 -0400 (Tue, 12 Mar 2013) $ - * @version v3.4.5 - * $Revision: 12074 $ + * $LastChangedDate: 2013-10-14 15:30:19 -0400 (Mon, 14 Oct 2013) $ + * @version v3.4.6 + * $Revision: 12376 $ */ if ( ! defined( 'IN_IPB' ) ) @@ -52,7 +52,7 @@ class navigation_core * * @return @e void */ - public function __construct() + public function __construct() { $this->registry = ipsRegistry::instance(); $this->DB = $this->registry->DB(); @@ -71,13 +71,13 @@ class navigation_core * @return @e string */ public function getTabName() - { + { return $this->lang->words['quicknav_comm_link']; } /** * Returns navigation data - * + * * @return @e array array( array( 0 => array( 'title' => 'x', 'url' => 'x' ) ) ); */ public function getNavigationData() @@ -93,7 +93,11 @@ class navigation_core } $links[] = array( 'title' => $this->lang->words['registered_users_link'], 'url' => $this->registry->output->buildSEOUrl( 'app=members&module=list', 'public', 'false', 'members_list' ) ); - $links[] = array( 'title' => $this->lang->words['status_updates_link'] , 'url' => $this->registry->output->buildSEOUrl( 'app=members&module=profile&section=status', 'public', 'false', 'members_status_all' ) ); + + if( $this->settings['su_enabled'] ) + { + $links[] = array( 'title' => $this->lang->words['status_updates_link'] , 'url' => $this->registry->output->buildSEOUrl( 'app=members&module=profile&section=status', 'public', 'false', 'members_status_all' ) ); + } /* Add to blocks */ $blocks[] = array( 'title' => '', 'links' => $links ); diff --git a/upload/admin/applications/core/extensions/navigation/index.html b/upload/admin/applications/core/extensions/navigation/index.html index 5e5606e3..823f28af 100644 --- a/upload/admin/applications/core/extensions/navigation/index.html +++ b/upload/admin/applications/core/extensions/navigation/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/extensions/notifications.php b/upload/admin/applications/core/extensions/notifications.php index 43d8cd68..8e50838d 100644 --- a/upload/admin/applications/core/extensions/notifications.php +++ b/upload/admin/applications/core/extensions/notifications.php @@ -3,7 +3,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Define the core notification types
  * Last Updated: $Date: 2013-05-21 20:51:17 -0400 (Tue, 21 May 2013) $
  * 
diff --git a/upload/admin/applications/core/extensions/reportPlugins/default.php b/upload/admin/applications/core/extensions/reportPlugins/default.php index f1b304bb..d4d8f045 100644 --- a/upload/admin/applications/core/extensions/reportPlugins/default.php +++ b/upload/admin/applications/core/extensions/reportPlugins/default.php @@ -2,7 +2,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Report Center :: Default plugin
  * Last Updated: $LastChangedDate: 2012-12-10 11:06:25 -0500 (Mon, 10 Dec 2012) $
  * 
diff --git a/upload/admin/applications/core/extensions/reportPlugins/index.html b/upload/admin/applications/core/extensions/reportPlugins/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/extensions/reportPlugins/index.html +++ b/upload/admin/applications/core/extensions/reportPlugins/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/extensions/rssOutput.php b/upload/admin/applications/core/extensions/rssOutput.php index f8af3f13..e5a15afb 100644 --- a/upload/admin/applications/core/extensions/rssOutput.php +++ b/upload/admin/applications/core/extensions/rssOutput.php @@ -2,7 +2,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * RSS output plugin :: report center
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
diff --git a/upload/admin/applications/core/extensions/search/config.php b/upload/admin/applications/core/extensions/search/config.php index a6d467c1..5eb75973 100644 --- a/upload/admin/applications/core/extensions/search/config.php +++ b/upload/admin/applications/core/extensions/search/config.php @@ -3,7 +3,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Config file
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
diff --git a/upload/admin/applications/core/extensions/search/engines/index.html b/upload/admin/applications/core/extensions/search/engines/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/extensions/search/engines/index.html +++ b/upload/admin/applications/core/extensions/search/engines/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/extensions/search/engines/sql.php b/upload/admin/applications/core/extensions/search/engines/sql.php index 869738ea..3dd0d73e 100644 --- a/upload/admin/applications/core/extensions/search/engines/sql.php +++ b/upload/admin/applications/core/extensions/search/engines/sql.php @@ -2,7 +2,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Basic Forum Search
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
diff --git a/upload/admin/applications/core/extensions/search/form.php b/upload/admin/applications/core/extensions/search/form.php index b1b183ab..90fac7e6 100644 --- a/upload/admin/applications/core/extensions/search/form.php +++ b/upload/admin/applications/core/extensions/search/form.php @@ -3,7 +3,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Returns HTML for the form (optional class, not required)
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
diff --git a/upload/admin/applications/core/extensions/search/format.php b/upload/admin/applications/core/extensions/search/format.php index 7d938507..c86ca296 100644 --- a/upload/admin/applications/core/extensions/search/format.php +++ b/upload/admin/applications/core/extensions/search/format.php @@ -3,7 +3,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Formats forum search results
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
diff --git a/upload/admin/applications/core/extensions/search/index.html b/upload/admin/applications/core/extensions/search/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/extensions/search/index.html +++ b/upload/admin/applications/core/extensions/search/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/extensions/sharedmedia/index.html b/upload/admin/applications/core/extensions/sharedmedia/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/extensions/sharedmedia/index.html +++ b/upload/admin/applications/core/extensions/sharedmedia/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/extensions/sharedmedia/plugin_attachments.php b/upload/admin/applications/core/extensions/sharedmedia/plugin_attachments.php index ea67a277..db242e18 100644 --- a/upload/admin/applications/core/extensions/sharedmedia/plugin_attachments.php +++ b/upload/admin/applications/core/extensions/sharedmedia/plugin_attachments.php @@ -6,7 +6,7 @@ * $Author: mmecham $ * @since 3/8/2011 * $LastChangedDate: 2013-04-03 08:07:11 -0400 (Wed, 03 Apr 2013) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 12145 $ */ diff --git a/upload/admin/applications/core/extensions/sitemapPlugins/index.html b/upload/admin/applications/core/extensions/sitemapPlugins/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/extensions/sitemapPlugins/index.html +++ b/upload/admin/applications/core/extensions/sitemapPlugins/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/extensions/sphinxTemplate.php b/upload/admin/applications/core/extensions/sphinxTemplate.php index 3470877b..33e2952c 100644 --- a/upload/admin/applications/core/extensions/sphinxTemplate.php +++ b/upload/admin/applications/core/extensions/sphinxTemplate.php @@ -3,7 +3,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Sphinx template file
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
@@ -74,7 +74,7 @@ index core_tags_search_main mlock = 0 morphology = none min_word_len = 2 - charset_type = utf-8 + charset_type = sbcs html_strip = 0 #infix_fields = tag_text #min_infix_len = 3 diff --git a/upload/admin/applications/core/extensions/usercpForms.php b/upload/admin/applications/core/extensions/usercpForms.php index 9f36c9cf..8fbaae69 100644 --- a/upload/admin/applications/core/extensions/usercpForms.php +++ b/upload/admin/applications/core/extensions/usercpForms.php @@ -1,3332 +1,3227 @@ - - * Invision Power Services - * IP.Board v3.4.5 - * Core user control panel plugin - * Last Updated: $Date: 2013-05-02 17:05:35 -0400 (Thu, 02 May 2013) $ - *
- * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/company/standards.php#license - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com - * @since 20th February 2002 - * @version $Rev: 12216 $ - * - */ - -if ( ! defined( 'IN_IPB' ) ) -{ - print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -class usercpForms_core extends public_core_usercp_manualResolver implements interface_usercp -{ - /** - * Tab name - * This can be left blank and the application title will - * be used - * - * @var string - */ - public $tab_name = "Настройки"; - - /** - * Default area code - * - * @var string - */ - public $defaultAreaCode = 'profileinfo'; - - /** - * OK Message - * This is an optional message to return back to the framework - * to replace the standard 'Settings saved' message - * - * @var string - */ - public $ok_message = ''; - - /** - * Hide 'save' button and form elements - * Useful if you have custom output that doesn't - * need to use it - * - * @var bool - */ - public $hide_form_and_save_button = false; - - /** - * If you wish to allow uploads, set a value for this - * - * @var integer - */ - public $uploadFormMax = 0; - - /** - * Flag to indicate that the user is a facebook logged in user doozer - * - * @var boolean - */ - protected $_isFBUser = false; - - /** - * Flag to indicate compatibility - * - * @var int - */ - public $version = 32; - - /** - * Initiate this module - * - * @return @e void - */ - public function init( ) - { - $this->tab_name = ipsRegistry::getClass('class_localization')->words['tab__core']; - - /* Facebook? */ - if ( IPSLib::fbc_enabled() === TRUE AND $this->memberData['fb_uid'] ) - { - $this->_isFBUser = true; - } - - if( !$this->memberData['g_edit_profile'] ) - { - $this->defaultAreaCode = 'email'; - } - } - - /** - * Return links for this tab - * You may return an empty array or FALSE to not have - * any links show in the tab. - * - * The links must have 'area=xxxxx'. The rest of the URL - * is added automatically. - * 'area' can only be a-z A-Z 0-9 - _ - * - * @author Matt Mecham - * @return array Links - */ - public function getLinks() - { - ipsRegistry::instance()->getClass('class_localization')->loadLanguageFile( array( 'public_usercp' ), 'core' ); - - $array = array(); - - if( $this->memberData['g_edit_profile'] ) - { - $array[] = array( 'url' => 'area=profileinfo', - 'title' => ipsRegistry::instance()->getClass('class_localization')->words['change_settings'], - 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'profileinfo' ? 1 : 0, - 'area' => 'profileinfo' - ); - } - - if ( $this->memberData['gbw_allow_customization'] AND ! $this->memberData['bw_disable_customization'] ) - { - $array[] = array( 'url' => 'area=customize', - 'title' => ipsRegistry::instance()->getClass('class_localization')->words['m_customize'], - 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'customize' ? 1 : 0, - 'area' => 'customize' - ); - } - - $array[] = array( 'url' => 'area=email', - 'title' => ipsRegistry::instance()->getClass('class_localization')->words['m_email_pass_change'], - 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'email' ? 1 : 0, - 'area' => 'email' - ); - - if ( $this->settings['auth_allow_dnames'] == 1 AND $this->memberData['g_dname_changes'] != 0 ) - { - $array[] = array( 'url' => 'area=displayname', - 'title' => ipsRegistry::instance()->getClass('class_localization')->words['ucp_change_name'], - 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'displayname' ? 1 : 0, - 'area' => 'displayname' - ); - } - - $sig_restrictions = explode( ':', $this->memberData['g_signature_limits'] ); - - if ( ( ! $sig_restrictions[0] OR ( $sig_restrictions[0] AND $this->memberData['g_sig_unit'] ) ) AND $this->memberData['g_edit_profile'] ) - { - $array[] = array( 'url' => 'area=signature', - 'title' => ipsRegistry::instance()->getClass('class_localization')->words['m_sig_info'], - 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'signature' ? 1 : 0, - 'area' => 'signature' - ); - } - - $array[] = array( 'url' => 'area=ignoredusers', - 'title' => ipsRegistry::instance()->getClass('class_localization')->words['m_ignore_users'], - 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'ignoredusers' ? 1 : 0, - 'area' => 'ignoredusers' - ); - - if ( IPSLib::fbc_enabled() === TRUE ) - { - $array[] = array( 'url' => 'area=facebook', - 'title' => ipsRegistry::instance()->getClass('class_localization')->words['m_facebook'], - 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'facebook' ? 1 : 0, - 'area' => 'facebook' - ); - } - - if ( IPSLib::twitter_enabled() === TRUE ) - { - $array[] = array( 'url' => 'area=twitter', - 'title' => ipsRegistry::instance()->getClass('class_localization')->words['m_twitter'], - 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'twitter' ? 1 : 0, - 'area' => 'twitter' - ); - } - - if ( IPSLib::vkontakte_enabled() === TRUE ) - { - $array[] = array( 'url' => 'area=vkontakte', - 'title' => ipsRegistry::instance()->getClass('class_localization')->words['m_vkontakte'], - 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'vkontakte' ? 1 : 0, - 'area' => 'vkontakte' - ); - } - - if ( $this->memberData['g_attach_max'] != -1 ) - { - $array[] = array( - 'url' => 'area=attachments', - 'title' => ipsRegistry::instance()->getClass('class_localization')->words['m_attach'], - 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'attachments' ? 1 : 0, - 'area' => 'attachments' - ); - } - - $array[] = array( 'url' => 'area=notifications', - 'title' => ipsRegistry::instance()->getClass('class_localization')->words['m_notifications'], - 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'notifications' ? 1 : 0, - 'area' => 'notifications' - ); - - $array[] = array( 'url' => 'area=notificationlog', - 'title' => ipsRegistry::instance()->getClass('class_localization')->words['m_arch_notify'], - 'active' => ( in_array( $this->request['area'], array( 'notificationlog', 'viewNotification', 'removeNotifications' ) ) ) ? 1 : 0, - 'area' => 'notificationlog' - ); - - return $array; - } - - - /** - * Run custom event - * - * If you pass a 'do' in the URL / post form that is not either: - * save / save_form or show / show_form then this function is loaded - * instead. You can return a HTML chunk to be used in the UserCP (the - * tabs and footer are auto loaded) or redirect to a link. - * - * If you are returning HTML, you can use $this->hide_form_and_save_button = 1; - * to remove the form and save button that is automatically placed there. - * - * @author Matt Mecham - * @param string Current area - * @return mixed html or void - */ - public function runCustomEvent( $currentArea ) - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $html = ''; - - //----------------------------------------- - // What to do? - //----------------------------------------- - - switch( $currentArea ) - { - case 'removeIgnoredUser': - return $this->customEvent_removeIgnoredUser(); - break; - case 'toggleIgnoredUser': - return $this->customEvent_toggleIgnoredUser(); - break; - case 'facebookSync': - $html = $this->customEvent_facebookSync(); - break; - case 'facebookRemove': - $html = $this->customEvent_facebookRemove(); - break; - case 'vkontakteRemove': - $html = $this->customEvent_vkontakteRemove(); - break; - case 'twitterRemove': - $html = $this->customEvent_twitterRemove(); - break; - case 'facebookLink': - $html = $this->customEvent_facebookLink(); - break; - case 'updateAttachments': - return $this->customEvent_updateAttachments(); - break; - - case 'viewNotification': - $html = $this->customEvent_viewNotification(); - break; - - case 'markNotification': - return $this->customEvent_markNotification(); - break; - - case 'removeNotifications': - return $this->customEvent_removeNotifications(); - break; - } - - //----------------------------------------- - // Turn off save button - //----------------------------------------- - - $this->hide_form_and_save_button = 1; - - //----------------------------------------- - // Return - //----------------------------------------- - - return $html; - } - - /** - * Delete attachments - * - * @author Matt Mecham - * @return string Processed HTML - */ - public function customEvent_updateAttachments() - { - //----------------------------------------- - // Get the ID's to delete - //----------------------------------------- - - $finalIDs = array(); - - //----------------------------------------- - // Grab post IDs - //----------------------------------------- - - if ( is_array( $_POST['attach'] ) and count( $_POST['attach'] ) ) - { - foreach( $_POST['attach'] as $id => $value ) - { - $finalIDs[ $id ] = intval( $id ); - } - } - - if ( count($finalIDs) > 0 ) - { - $this->DB->build( array( 'select' => 'a.*', - 'from' => array( 'attachments' => 'a' ), - 'where' => "a.attach_id IN (" . implode( ",", $finalIDs ) .") AND a.attach_rel_module IN( 'post', 'msg' ) AND attach_member_id=" . $this->memberData['member_id'], - 'add_join' => array( - array( 'select' => 'p.topic_id, p.pid', - 'from' => array( 'posts' => 'p' ), - 'where' => "p.pid=a.attach_rel_id AND a.attach_rel_module='post'", - 'type' => 'left' - ), - array( 'select' => 'mt.msg_id, mt.msg_topic_id', - 'from' => array( 'message_posts' => 'mt' ), - 'where' => "mt.msg_id=a.attach_rel_id AND a.attach_rel_module='msg'", - 'type' => 'left' - ), - ) - ) ); - - $o = $this->DB->execute(); - - while ( $killmeh = $this->DB->fetch( $o ) ) - { - if ( $killmeh['attach_location'] ) - { - @unlink( $this->settings['upload_dir']."/".$killmeh['attach_location'] ); - } - if ( $killmeh['attach_thumb_location'] ) - { - @unlink( $this->settings['upload_dir']."/".$killmeh['attach_thumb_location'] ); - } - - if ( $killmeh['topic_id'] ) - { - $this->DB->update( 'topics', 'topic_hasattach=topic_hasattach-1', 'tid='.$killmeh['topic_id'], true, true ); - } - else if( $killmeh['msg_id'] ) - { - $this->DB->update( 'message_topics', 'mt_hasattach=mt_hasattach-1', 'mt_id='.$killmeh['msg_topic_id'], true, true ); - } - } - - $this->DB->delete( 'attachments', 'attach_id IN ('.implode(",",$finalIDs).') and attach_member_id='.$this->memberData['member_id'] ); - } - - $this->registry->getClass('output')->silentRedirect( $this->settings['base_url']."app=core&module=usercp&tab=core&area=attachments&do=show" ); - } - - /** - * UserCP handle our notifications - * - * @return boolean Successful - */ - public function customEvent_removeNotifications() - { - //----------------------------------------- - // Check form hash - //----------------------------------------- - - $this->request['secure_key'] = $this->request['secure_key'] ? $this->request['secure_key'] : $this->request['md5check']; - - if( $this->request['secure_key'] != $this->member->form_hash ) - { - $this->registry->output->showError( 'usercp_forums_bad_key', 1021523 ); - } - - //----------------------------------------- - // Notifications library - //----------------------------------------- - - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' ); - $notifyLibrary = new $classToLoad( $this->registry ); - $notifyLibrary->setMember( $this->memberData ); - - //----------------------------------------- - // Delete the notifications - //----------------------------------------- - - $_toDelete = IPSLib::cleanIntArray( $this->request['notifications'] ); - - if( !count($_toDelete) ) - { - return $this->showInlineNotifications( $this->lang->words['no_notify_del'] ); - } - - $this->DB->delete( 'inline_notifications', "notify_id IN(" . implode( ',', $_toDelete ) . ") AND notify_to_id=" . $this->memberData['member_id'] ); - - //----------------------------------------- - // If member has 'unread' count, rebuild count - //----------------------------------------- - - if( $this->memberData['notification_cnt'] ) - { - $notifyLibrary->rebuildUnreadCount(); - } - - //----------------------------------------- - // Redirect - //----------------------------------------- - - $this->registry->getClass('output')->silentRedirect( $this->settings['base_url']."app=core&module=usercp&tab=core&area=notificationlog&confirm=1" ); - } - - /** - * Mark a notification - * - * @return string HTML - */ - public function customEvent_markNotification() - { - //----------------------------------------- - // Notifications library - //----------------------------------------- - - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' ); - $notifyLibrary = new $classToLoad( $this->registry ); - $notifyLibrary->setMember( $this->memberData ); - - //----------------------------------------- - // Get notification - //----------------------------------------- - - /* Marking them all as read? */ - if ( $this->request['mark'] == 'all' ) - { - $this->DB->update( 'inline_notifications', array( 'notify_read' => time() ), 'notify_to_id=' . $this->memberData['member_id'] ); - } - else - { - $id = intval($this->request['mark']); - $notification = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'inline_notifications', 'where' => 'notify_id=' . $id ) ); - - //----------------------------------------- - // Error checking - //----------------------------------------- - - if( !$notification['notify_id'] ) - { - if( $this->request['ajax'] ) - { - print 'ok'; - exit; - } - else - { - $this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] . "app=core&module=usercp&tab=core&area=notificationlog" ); - } - } - - if( $notification['notify_to_id'] != $this->memberData['member_id'] ) - { - if( $this->request['ajax'] ) - { - print 'ok'; - exit; - } - else - { - $this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] . "app=core&module=usercp&tab=core&area=notificationlog" ); - } - } - - //----------------------------------------- - // Update read timestamp - //----------------------------------------- - - $this->DB->update( 'inline_notifications', array( 'notify_read' => time() ), 'notify_id=' . $id ); - } - - //----------------------------------------- - // If member has 'unread' count, rebuild count - //----------------------------------------- - - if( $this->memberData['notification_cnt'] ) - { - $notifyLibrary->rebuildUnreadCount(); - } - - if( $this->request['ajax'] ) - { - print 'ok'; - exit; - } - else - { - $this->registry->output->silentRedirect( $this->settings['base_url'] . "app=core&module=usercp&tab=core&area=notificationlog" ); - } - } - - /** - * View a notification - * - * @return string HTML - */ - public function customEvent_viewNotification() - { - //----------------------------------------- - // Notifications library - //----------------------------------------- - - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' ); - $notifyLibrary = new $classToLoad( $this->registry ); - $notifyLibrary->setMember( $this->memberData ); - - //----------------------------------------- - // Get notification - //----------------------------------------- - - $id = intval($this->request['view']); - $notification = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'inline_notifications', 'where' => 'notify_id=' . $id ) ); - - //----------------------------------------- - // Error checking - //----------------------------------------- - - if( !$notification['notify_id'] ) - { - $this->registry->output->showError( 'bad_notify_id', 10191 ); - } - - if( $notification['notify_to_id'] != $this->memberData['member_id'] ) - { - $this->registry->output->showError( 'bad_notify_id', 10192 ); - } - - //----------------------------------------- - // Update read timestamp - //----------------------------------------- - - $this->DB->update( 'inline_notifications', array( 'notify_read' => time() ), 'notify_id=' . $id ); - - //----------------------------------------- - // If member has 'unread' count, rebuild count - //----------------------------------------- - - if( $this->memberData['notification_cnt'] ) - { - $notifyLibrary->rebuildUnreadCount(); - } - - //----------------------------------------- - // Parse for display - //----------------------------------------- - - /* As the email template parser makes an attempt to reparse 'safe' HTML, we need to make it safe here */ - $notification['notify_text'] = IPSText::htmlspecialchars( $notification['notify_text'] ); - - IPSText::getTextClass('bbcode')->parse_smilies = 1; - IPSText::getTextClass('bbcode')->parse_nl2br = 1; - IPSText::getTextClass('bbcode')->parse_html = 0; - IPSText::getTextClass('bbcode')->parse_bbcode = 1; - IPSText::getTextClass('bbcode')->parsing_section = 'global'; - - $notification['notify_text'] = IPSText::getTextClass('bbcode')->preDisplayParse( nl2br( $notification['notify_text'] ) ); - - //----------------------------------------- - // Show notification - //----------------------------------------- - - $this->_nav[] = array( $this->lang->words['m_arch_notify'], 'app=core&module=usercp&tab=core&area=notificationlog' ); - return $this->registry->getClass('output')->getTemplate('ucp')->showNotification( $notification ); - } - - /** - * Custom Event: Remove Twitter link - * - * @return @e void - */ - public function customEvent_twitterRemove() - { - //----------------------------------------- - // Check secure hash... - //----------------------------------------- - - if ( $this->request['secure_key'] != $this->member->form_hash ) - { - $this->registry->output->showError( 'authorization_error', 100, true, null, 403 ); - } - - //----------------------------------------- - // Okay... - //----------------------------------------- - - if ( $this->memberData['twitter_id'] ) - { - /* Remove the link */ - IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'twitter_id' => 0, 'twitter_token' => '', 'twitter_secret' => '' ) ) ); - } - - /* Log the user out */ - $this->registry->getClass('output')->silentRedirect( $this->settings['base_url']."app=core&module=global§ion=login&do=logout&k=" . $this->member->form_hash ); - } - - /** - * Custom Event: Remove vk link - * - * @return @e void - */ - public function customEvent_vkontakteRemove() - { - //----------------------------------------- - // Check secure hash... - //----------------------------------------- - - if ( $this->request['secure_key'] != $this->member->form_hash ) - { - $this->registry->output->showError( 'authorization_error', 100, true, null, 403 ); - } - - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/vkontakte/connect.php', 'vkontakte_connect' ); - $vkontakte = new $classToLoad( $this->registry ); - - //----------------------------------------- - // Okay... - //----------------------------------------- - - if ( $this->memberData['vk_uid'] ) - { - /* Remove the link */ - IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'vk_uid' => 0, 'vk_token' => '' ) ) ); - } - - /* Log the user out */ - $this->registry->getClass('output')->silentRedirect( $this->settings['base_url']."app=core&module=global§ion=login&do=logout&k=" . $this->member->form_hash ); - } - - /** - * Custom Event: Create facebook link - * - * @return @e void - */ - public function customEvent_facebookLink() - { - //----------------------------------------- - // Check secure hash... - //----------------------------------------- - - if ( $this->request['secure_key'] != $this->member->form_hash ) - { - $this->registry->output->showError( 'authorization_error', 100, true, null, 403 ); - } - - /* Load application */ - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php', 'facebook_connect' ); - $facebook = new $classToLoad( $this->registry ); - - try - { - $facebook->linkMember( $this->memberData['member_id'] ); - } - catch( Exception $error ) - { - $msg = $error->getMessage(); - - switch( $msg ) - { - default: - case 'NO_FACEBOOK_USER_LOGGED_IN': - case 'ALREADY_LINKED': - $this->registry->getClass('output')->showError( 'fbc_authorization_screwup', 1005.99, null, null, 403 ); - break; - } - } - - //----------------------------------------- - // Return - //----------------------------------------- - - $this->registry->getClass('output')->silentRedirect( $this->settings['base_url']."app=core&module=usercp&tab=core&area=facebook&do=show" ); - } - - /** - * Custom Event: Remove facebook link - * - * @return @e void - */ - public function customEvent_facebookRemove() - { - //----------------------------------------- - // Check secure hash... - //----------------------------------------- - - if ( $this->request['secure_key'] != $this->member->form_hash ) - { - $this->registry->output->showError( 'authorization_error', 100, true, null, 403 ); - } - - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php', 'facebook_connect' ); - $facebook = new $classToLoad( $this->registry ); - - //----------------------------------------- - // Okay... - //----------------------------------------- - - if ( $this->memberData['fb_uid'] ) - { - /* Unauthorize application */ - $facebook->revokeAuthorization(); - - /* Remove the link */ - IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'fb_uid' => 0, 'fb_emailhash' => '', 'fb_token' => '', 'fb_lastsync' => 0 ) ) ); - } - - /* Log the user out */ - $this->registry->getClass('output')->silentRedirect( $this->settings['base_url']."app=core&module=global§ion=login&do=logout&k=" . $this->member->form_hash ); - } - - /** - * Custom Event: Sync up facebook - * NO LONGER USED. LEFT FOR FIX CONFIRMATION - * - * @return @e void - */ - public function customEvent_facebookSync() - { - if ( IPSLib::fbc_enabled() === TRUE ) - { - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php', 'facebook_connect' ); - $facebook = new $classToLoad( $this->registry ); - - try - { - $facebook->syncMember( $this->memberData ); - } - catch( Exception $error ) - { - $msg = $error->getMessage(); - - switch( $msg ) - { - case 'NOT_LINKED': - case 'NO_MEMBER': - default: - $this->registry->getClass('output')->showError( 'fbc_authorization_screwup', 1005, null, null, 403 ); - break; - } - } - - //----------------------------------------- - // Return - //----------------------------------------- - - $this->registry->getClass('output')->silentRedirect( $this->settings['base_url']."app=core&module=usercp&tab=core&area=facebook&do=show" ); - } - } - - /** - * Custom Event: Run the find user tool - * - * @return @e void - */ - public function customEvent_toggleIgnoredUser() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $member_id = intval( $this->request['id'] ); - $field = $this->request['field']; - $update = array(); - - //----------------------------------------- - // Grab user - //----------------------------------------- - - $ignoredUser = $this->DB->buildAndFetch( array( 'select' => '*', - 'from' => 'ignored_users', - 'where' => 'ignore_ignore_id=' . $member_id . ' AND ignore_owner_id=' . $this->memberData['member_id'] ) ); - - if ( $ignoredUser['ignore_id'] ) - { - switch( $field ) - { - default: - case 'topics': - $update = array( 'ignore_topics' => ( $ignoredUser['ignore_topics'] == 1 ) ? 0 : 1 ); - break; - case 'messages': - $update = array( 'ignore_messages' => ( $ignoredUser['ignore_messages'] == 1 ) ? 0 : 1 ); - break; - case 'signatures': - $update = array( 'ignore_signatures' => ( $ignoredUser['ignore_signatures'] == 1 ) ? 0 : 1 ); - break; - case 'chats': - $update = array( 'ignore_chats' => ( $ignoredUser['ignore_chats'] == 1 ) ? 0 : 1 ); - break; - } - - //----------------------------------------- - // Update - //----------------------------------------- - - $this->DB->update( 'ignored_users', $update, 'ignore_id=' . $ignoredUser['ignore_id'] ); - - /* Rebuild cache */ - IPSMember::rebuildIgnoredUsersCache( $this->memberData ); - } - - //----------------------------------------- - // Return - //----------------------------------------- - - $this->registry->getClass('output')->silentRedirect( $this->settings['base_url']."app=core&module=usercp&tab=core&area=ignoredusers&do=show&st={$this->request['st']}" ); - } - - /** - * Custom event: Remove ignored user - * - * @author Matt Mecham - * @return string Processed HTML - */ - public function customEvent_removeIgnoredUser() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $removeID = intval( $this->request['id'] ); - - $this->DB->delete( 'ignored_users', 'ignore_owner_id=' . $this->memberData['member_id'] . ' AND ignore_ignore_id=' . $removeID ); - - /* Rebuild cache */ - IPSMember::rebuildIgnoredUsersCache( $this->memberData ); - - $this->registry->getClass('output')->silentRedirect( $this->settings['base_url']."app=core&module=usercp&tab=core&area=ignoredusers&do=show" ); - } - - /** - * UserCP Form Show - * - * @author Matt Mecham - * @param string Current area as defined by 'get_links' - * @param array Array of errors - * @return string Processed HTML - */ - public function showForm( $current_area, $errors=array() ) - { - //----------------------------------------- - // Where to go, what to see? - //----------------------------------------- - - if( !$current_area AND !$this->memberData['g_edit_profile'] ) - { - $current_area = 'email'; - } - - switch( $current_area ) - { - default: - case 'profileinfo': - return $this->formProfileInfo(); - break; - case 'signature': - return $this->formSignature(); - break; - case 'photo': - return $this->formPhoto(); - break; - case 'ignoredusers': - return $this->formIgnoredUsers(); - break; - case 'facebook': - return $this->formFacebook(); - break; - case 'twitter': - return $this->formTwitter(); - break; - case 'vkontakte': - return $this->formVkontakte(); - break; - case 'customize': - return $this->formCustomize(); - break; - case 'email': - return $this->showFormEmailPassword(); - break; - case 'displayname': - return $this->showFormDisplayname(); - break; - case 'attachments': - return $this->showFormAttachments(); - break; - case 'notifications': - return $this->showFormNotifications(); - break; - case 'notificationlog': - return $this->showInlineNotifications(); - break; - } - } - - /** - * Show the customization form - * - * @author Matt Mecham - * @param string Any inline message to show - * @return string Processed HTML - */ - public function formCustomize( $inlineMsg='' ) - { - /* Allow uploads */ - $this->uploadFormMax = 10000 * 1024; - - if ( ! $this->memberData['gbw_allow_customization'] OR $this->memberData['bw_disable_customization'] ) - { - $this->registry->getClass('output')->showError( 'no_permission', 1005.5 ); - } - - /* Grab current options */ - $options = IPSLib::safeUnserialize( $this->memberData['pp_customization'] ); - $options = is_array( $options ) ? $options : array(); - - /* Build input */ - foreach( $options as $k => $v ) - { - $input[ $k ] = ( $this->request[ $k ] ) ? $this->request[ $k ] : $v; - } - - /* Figure out preview URL */ - if ( $options['type'] == 'url' AND $options['bg_url'] ) - { - $input['_preview'] = $options['bg_url']; - } - else if ( $options['type'] == 'upload' AND $options['bg_url'] ) - { - $input['_preview'] = $this->settings['upload_url'] . '/' . $options['bg_url']; - $input['bg_url'] = ''; - } - - /* Show form */ - return $this->registry->getClass('output')->getTemplate('ucp')->membersProfileCustomize( $options, $input, $inlineMsg ); - } - - /** - * Show the vkontakte form - * - * @author Matt Mecham - * @param string Any inline message to show - * @return string Processed HTML - */ - public function formVkontakte( $inlineMsg='' ) - { - //----------------------------------------- - // INIT - //----------------------------------------- - - if( !IPSLib::vkontakte_enabled() ) - { - $this->registry->getClass('output')->showError( 'twitter_disabled', 1005.1 ); - } - - //----------------------------------------- - // Twitter user logged in? - //----------------------------------------- - - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/vkontakte/connect.php', 'vkontakte_connect' ); - $vkontakte = new $classToLoad( $this->registry, $this->memberData['vk_token'], $this->memberData['vk_uid'] ); - - //----------------------------------------- - // Thaw bitfield options - //----------------------------------------- - - $bwOptions = IPSBWOptions::thaw( $this->memberData['vk_bwoptions'], 'vkontakte' ); - - //----------------------------------------- - // Merge.. - //----------------------------------------- - - if ( is_array( $bwOptions ) ) - { - foreach( $bwOptions as $k => $v ) - { - $this->memberData[ $k ] = $v; - } - } - - $this->hide_form_and_save_button = 1; - - $userData = $vkontakte->fetchUserData(); - - if ( isset( $userData['status']['text'] ) ) - { - if ( IPS_DOC_CHAR_SET != 'UTF-8' ) - { - $userData['status']['text'] = IPSText::utf8ToEntities( $userData['status']['text'] ); - } - } - - return $this->registry->getClass('output')->getTemplate('vkontakte')->membersVkontakteConnect( $this->memberData['vk_uid'], $userData ); - } - - /** - * Show the twitter form - * - * @author Matt Mecham - * @param string Any inline message to show - * @return string Processed HTML - */ - public function formTwitter( $inlineMsg='' ) - { - //----------------------------------------- - // INIT - //----------------------------------------- - - if( !IPSLib::twitter_enabled() ) - { - $this->registry->getClass('output')->showError( 'twitter_disabled', 1005.1 ); - } - - //----------------------------------------- - // Twitter user logged in? - //----------------------------------------- - - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/twitter/connect.php', 'twitter_connect' ); - $twitter = new $classToLoad( $this->registry, $this->memberData['twitter_token'], $this->memberData['twitter_secret'] ); - - //----------------------------------------- - // Thaw bitfield options - //----------------------------------------- - - $bwOptions = IPSBWOptions::thaw( $this->memberData['tc_bwoptions'], 'twitter' ); - - //----------------------------------------- - // Merge.. - //----------------------------------------- - - if ( is_array( $bwOptions ) ) - { - foreach( $bwOptions as $k => $v ) - { - $this->memberData[ $k ] = $v; - } - } - - if( ! $twitter->isConnected() ) - { - $this->hide_form_and_save_button = 1; - } - - $userData = $twitter->fetchUserData(); - - if ( isset( $userData['status']['text'] ) ) - { - if ( IPS_DOC_CHAR_SET != 'UTF-8' ) - { - $userData['status']['text'] = IPSText::utf8ToEntities( $userData['status']['text'] ); - } - - /* Make safe */ - $userData['status']['text'] = str_replace( array( '<', '>' ), array( '<', '>' ), $userData['status']['text'] ); - } - - return $this->registry->getClass('output')->getTemplate('ucp')->membersTwitterConnect( $twitter->isConnected(), $userData ); - } - - - /** - * Show the member form - * - * @author Matt Mecham - * @param string Any inline message to show - * @return string Processed HTML - */ - public function formFacebook( $inlineMsg='' ) - { - //----------------------------------------- - // INIT - //----------------------------------------- - - if( !IPSLib::fbc_enabled() ) - { - $this->registry->getClass('output')->showError( 'fbc_disabled', 1005.2 ); - } - - //----------------------------------------- - // Shut off save button if not associated yet - //----------------------------------------- - - if( !$this->memberData['fb_uid'] ) - { - $this->hide_form_and_save_button = true; - $userData = array(); - $linkedMemberData = array(); - $perms = array(); - } - else - { - //----------------------------------------- - // FB user logged in? - //----------------------------------------- - - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php', 'facebook_connect' ); - $facebook = new $classToLoad( $this->registry ); - - /* Now get the linked user */ - $linkedMemberData = IPSMember::load( intval($this->memberData['fb_uid']), 'all', 'fb_uid' ); - - $userData = $facebook->fetchUserData(); - - /* Email */ - $perms['email'] = $facebook->fetchHasAppPermission( 'email' ); - - /* Publish Stream */ - $perms['publish_stream'] = $facebook->fetchHasAppPermission( 'publish_stream' ); - - /* Read stream */ - $perms['read_stream'] = $facebook->fetchHasAppPermission( 'read_stream' ); - - /* Offline access */ - $perms['offline_access'] = $facebook->fetchHasAppPermission( 'offline_access' ); - - - //----------------------------------------- - // Thaw bitfield options - //----------------------------------------- - - $bwOptions = IPSBWOptions::thaw( $this->memberData['fb_bwoptions'], 'facebook' ); - - //----------------------------------------- - // Merge.. - //----------------------------------------- - - if ( is_array( $bwOptions ) ) - { - foreach( $bwOptions as $k => $v ) - { - $this->memberData[ $k ] = $v; - } - } - - //----------------------------------------- - // Able to update status? - //----------------------------------------- - - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/member/status.php', 'memberStatus' ); - $this->registry->setClass( 'memberStatus', new $classToLoad( $this->registry ) ); - - $this->registry->memberStatus->setAuthor( $this->memberData ); - $this->memberData['can_updated_status'] = $this->registry->memberStatus->canCreate(); - - $_updates = $facebook->fetchUserTimeline( $userData['id'], 0, true ); - - /* Got any? */ - if ( count( $_updates ) ) - { - $update = array_shift( $_updates ); - - if ( count( $update ) AND is_array( $update ) ) - { - $userData['status'] = $update; - } - } - - if ( is_array( $userData ) AND $userData['status']['message'] AND IPS_DOC_CHAR_SET != 'UTF-8' ) - { - $userData['status']['message'] = IPSText::utf8ToEntities( $userData['status']['message'] ); - } - - /* Make safe */ - $userData['status']['message'] = str_replace( array( '<', '>' ), array( '<', '>' ), $userData['status']['message'] ); - } - - return $this->registry->getClass('output')->getTemplate('ucp')->membersFacebookConnect( trim($this->memberData['fb_uid']), $userData, $linkedMemberData, $perms ); - } - - /** - * Show the ignored users - * - * @author Matt Mecham - * @return string Processed HTML - */ - public function formIgnoredUsers() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $final_users = array(); - $temp_users = array(); - $uid = intval( $this->request['uid'] ); - $ignoredUsers = array(); - - //----------------------------------------- - // Do we have incoming? - //----------------------------------------- - - if ( $uid ) - { - $newmem = IPSMember::load( $uid ); - - $this->request['newbox_1'] = $newmem['members_display_name']; - } - - //----------------------------------------- - // Get ignored users - //----------------------------------------- - - $perPage = 25; - - /* Count */ - $count = $this->DB->buildAndFetch( array( 'select' => 'count(*) as dracula', 'from' => 'ignored_users', 'where' => 'ignore_owner_id=' . $this->memberData['member_id'] ) ); - - /* Sort out pagination */ - $st = intval($this->request['st']) >=0 ? intval($this->request['st']) : 0; - $pagination = $this->registry->output->generatePagination( array( - 'totalItems' => $count['dracula'], - 'itemsPerPage' => $perPage, - 'currentStartValue' => $st, - 'baseUrl' => 'app=core&module=usercp&tab=core&area=ignoredusers', - ) ); - - /* Get em */ - $this->DB->build( array( 'select' => '*', 'from' => 'ignored_users', 'where' => 'ignore_owner_id=' . $this->memberData['member_id'], 'limit' => array( $st, $perPage ) ) ); - $this->DB->execute(); - - while( $row = $this->DB->fetch() ) - { - $ignoredUsers[ $row['ignore_ignore_id'] ] = $row; - } - - //----------------------------------------- - // Get members and check to see if they've - // since been moved into a group that cannot - // be ignored - //----------------------------------------- - - foreach( $ignoredUsers as $_id => $data ) - { - if ( intval($_id) ) - { - $temp_users[] = $_id; - } - } - - if ( count($temp_users) ) - { - $members = IPSMember::load( $temp_users, 'all' ); - - foreach( $members as $m ) - { - $m['g_title'] = IPSMember::makeNameFormatted( $this->caches['group_cache'][ $m['member_group_id'] ]['g_title'], $m['member_group_id'] ); - - $final_users[ $m['member_id'] ] = IPSMember::buildDisplayData( $m ); - $final_users[ $m['member_id'] ]['ignoreData'] = $ignoredUsers[ $m['member_id'] ]; - } - } - - $this->request['newbox_1'] = $this->request['newbox_1'] ? $this->request['newbox_1'] : ''; - - return $this->registry->getClass('output')->getTemplate('ucp')->membersIgnoredUsersForm( $final_users, $pagination ); - } - - - /** - * Show the signature page - * - * @author Matt Mecham - * @return string Processed HTML - */ - public function formSignature() - { - /* Load editor stuff */ - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' ); - $this->editor = new $classToLoad(); - - /* HTML checkbox language strings */ - $this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_post' ), 'forums' ); - - //----------------------------------------- - // Check to make sure that we can edit profiles.. - //----------------------------------------- - - $sig_restrictions = explode( ':', $this->memberData['g_signature_limits'] ); - - if ( ! $this->memberData['g_edit_profile'] OR ( $sig_restrictions[0] AND ! $this->memberData['g_sig_unit'] ) ) - { - $this->registry->getClass('output')->showError( 'members_profile_disabled', 1024, null, null, 403 ); - } - - /* Signature Limits */ - if ( $sig_restrictions[0] AND $this->memberData['g_sig_unit'] ) - { - if ( $this->memberData['gbw_sig_unit_type'] ) - { - /* days */ - if ( $this->memberData['joined'] > ( time() - ( 86400 * $this->memberData['g_sig_unit'] ) ) ) - { - $this->hide_form_and_save_button = 1; - $form['_noPerm'] = sprintf( $this->lang->words['sig_group_restrict_date'], $this->lang->getDate( $this->memberData['joined'] + ( 86400 * $this->memberData['g_sig_unit'] ), 'long' ) ); - } - } - else - { - /* Posts */ - if ( $this->memberData['posts'] < $this->memberData['g_sig_unit'] ) - { - $this->hide_form_and_save_button = 1; - $form['_noPerm'] = sprintf( $this->lang->words['sig_group_restrict_posts'], $this->memberData['g_sig_unit'] - $this->memberData['posts'] ); - } - } - - if( $form['_noPerm'] ) - { - return $this->registry->getClass('output')->getTemplate('ucp')->membersSignatureFormError( $form ); - } - } - - //----------------------------------------- - // Set max length - //----------------------------------------- - - $current_sig = ''; - $t_sig = ''; - - /* Set content in editor */ - $this->editor->setLegacyMode(false); - $this->editor->setAllowBbcode( true ); - $this->editor->setAllowSmilies( true ); - $this->editor->setAllowHtml( $this->memberData['g_dohtml'] ); - $this->editor->setIsHtml( $this->memberData['bw_html_sig'] ); - $this->editor->setBbcodeSection('signatures'); - $this->editor->setContent( $this->memberData['signature'] ); - - /* Load parser */ - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/text/parser.php', 'classes_text_parser' ); - $parser = new $classToLoad(); - - $parser->set( array( 'memberData' => $this->memberData, - 'parseBBCode' => 1, - 'parseHtml' => ( $this->memberData['g_dohtml'] && $this->memberData['bw_html_sig'] ), - 'parseArea' => 'signatures', - 'parseEmoticons' => 1 ) ); - - $signature = $parser->display( $this->memberData['signature'] ); - - return $this->registry->getClass('output')->getTemplate('ucp')->membersSignatureForm( $this->editor->show( 'Post', array( 'noSmilies' => false ) ), $sig_restrictions, $signature ); - } - - - /** - * Show the profile information - * - * @author Matt Mecham - * @return string Processed HTML - */ - public function formProfileInfo() - { - /* Load Lang File */ - $this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' ); - - /* Load editor stuff */ - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' ); - $this->editor = new $classToLoad(); - - /* INIT */ - $required_output = ""; - $optional_output = ""; - - /* Permission Check */ - if( ! $this->memberData['g_edit_profile'] ) - { - $this->registry->getClass('output')->showError( 'members_profile_disabled', 1026, null, null, 403 ); - } - - /* Format the birthday drop boxes.. */ - $date = getdate(); - - $day = array(); - $mon = array(); - $year = array(); - $times = array(); - - /* Build the day options */ - $day[] = array( '0', '--' ); - for ( $i = 1 ; $i < 32 ; $i++ ) - { - $day[] = array( $i, $i ); - } - - /* Build the month options */ - $mon[] = array( '0', '--' ); - for( $i = 1 ; $i < 13 ; $i++ ) - { - $mon[] = array( $i, $this->lang->words['M_' . $i ] ); - } - - /* Build the years options */ - $i = $date['year'] - 1; - $j = $date['year'] - 100; - - $year[] = array( '0', '--' ); - for( $i ; $j < $i ; $i-- ) - { - $year[] = array( $i, $i ); - } - - /* Custom Fields */ - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/customfields/profileFields.php', 'customProfileFields' ); - $fields = new $classToLoad(); - - $fields->member_data = $this->member->fetchMemberData(); - $fields->initData( 'edit' ); - $fields->parseToEdit(); - - $field_output = array(); - - if ( count( $fields->out_fields ) ) - { - foreach( $fields->out_fields as $id => $element ) - { - $data = $fields->cache_data[ $id ]; - $field_output[ $data['pf_group_key'] ][ $id ] = array( - 'field' => $this->registry->getClass('output')->getTemplate('ucp')->field_entry( $fields->field_names[ $id ], $fields->field_desc[ $id ], $fields->out_fields[ $id ], $id ), - 'required' => $data['pf_not_null'] - ); - } - - /*foreach( $fields->out_fields as $id => $data ) - { - if ( $fields->cache_data[ $id ]['pf_not_null'] == 1 ) - { - $ftype = 'required_output'; - } - else - { - $ftype = 'optional_output'; - } - - ${$ftype} .= $this->registry->getClass('output')->getTemplate('ucp')->field_entry( $fields->field_names[ $id ], $fields->field_desc[ $id ], $data, $id ); - }*/ - } - - /* About me */ - $this->editor->setContent( $this->memberData['pp_about_me'] ); - - $amEditor = $this->editor->show( 'Post', array( 'delayInit' => 1 ) ); - - /* Times */ - foreach ( $this->lang->words as $k => $v ) - { - if ( strpos( $k, "time_" ) === 0 ) - { - $k = str_replace( "time_", '', $k ); - - if( preg_match( '/^[\-\d\.]+$/', $k ) ) - { - $times[ $k ] = $v; - } - } - } - - ksort( $times ); - - /* Build and return the form */ - $template = $this->registry->getClass('output')->getTemplate('ucp')->membersProfileForm( $field_output, $fields->fetchGroupTitles(), $day, $mon, $year, $amEditor, $times ); - - return $template; - } - - /** - * Show the logged inline notifications - * - * @author Brandon Farber - * @param string Error message - * @return string Processed HTML - */ - public function showInlineNotifications( $error='' ) - { - /* Init */ - $start = intval( $this->request['st'] ); - $perPage = 50; - - //----------------------------------------- - // Get class - //----------------------------------------- - - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' ); - $notifyLibrary = new $classToLoad( $this->registry ); - $notifyLibrary->setMember( $this->memberData ); - - /* Clear them? - used in mobile skin */ - if ( isset($this->request['clear']) && trim($this->request['clear']) == 'true' ) - { - $this->DB->update( 'inline_notifications', array( 'notify_read' => 1 ), 'notify_to_id=' . $this->memberData['member_id'] ); - - $notifyLibrary->rebuildUnreadCount(); - } - - //----------------------------------------- - // Turn off normal form - //----------------------------------------- - - $this->hide_form_and_save_button = 1; - - //----------------------------------------- - // Get notifications - //----------------------------------------- - - $_notifications = array(); - $mids = array(); - - $count = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as er', - 'from' => 'inline_notifications', - 'where' => 'notify_to_id=' . $this->memberData['member_id'] ) ); - - if ( $count['er'] ) - { - $this->DB->build( array( 'select' => '*', - 'from' => 'inline_notifications', - 'where' => 'notify_to_id=' . $this->memberData['member_id'], - 'limit' => array( $start, $perPage ), - 'order' => 'notify_sent DESC' ) ); - $outer = $this->DB->execute(); - - while( $r = $this->DB->fetch($outer) ) - { - $r['notify_icon'] = $notifyLibrary->getNotificationIcon( $r['notify_type_key'] ); - - $_notifications[] = $r; - - $mids[ $r['notify_from_id'] ] = $r['notify_from_id']; - } - - /* Get members */ - if ( count( $mids ) ) - { - $members = IPSMember::load( array_keys( $mids ), 'all' ); - - if ( count( $members ) ) - { - foreach( $_notifications as $key => $data ) - { - if ( isset($members[ $data['notify_from_id'] ]) ) - { - $_notifications[ $key ]['member'] = IPSMember::buildProfilePhoto( $members[ $data['notify_from_id'] ] ); - } - } - } - } - } - - $pages = $this->registry->getClass('output')->generatePagination( array( 'totalItems' => $count['er'], - 'itemsPerPage' => $perPage, - 'currentStartValue' => $start, - 'baseUrl' => "app=core&module=usercp&tab=core&area=notificationlog" - ) ); - - //----------------------------------------- - // Send to template - //----------------------------------------- - - return $this->registry->getClass('output')->getTemplate('ucp')->notificationsLog( $_notifications, $error, $pages ); - } - - /** - * Show notification configuration form - * - * @author Brandon Farber - * @return string Processed HTML - * - * @note Updating this function update also mobileApiRequest::_handleNotificationTypes() - */ - public function showFormNotifications() - { - //----------------------------------------- - // Notifications library - //----------------------------------------- - - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' ); - $notifyLibrary = new $classToLoad( $this->registry ); - $notifyLibrary->setMember( $this->memberData ); - - //----------------------------------------- - // Show the form - //----------------------------------------- - - $_basicOptions = array( array( 'email', $this->lang->words['notopt__email'] ), array( 'inline', $this->lang->words['notopt__inline'] ), array( 'mobile', $this->lang->words['notopt__mobile'] ) ); - $_configOptions = $notifyLibrary->getNotificationData( TRUE ); - $_notifyConfig = $notifyLibrary->getMemberNotificationConfig( $this->memberData ); - $_defaultConfig = $notifyLibrary->getDefaultNotificationConfig(); - $_formOptions = array(); - - foreach( $_configOptions as $option ) - { - $_thisConfig = isset($_notifyConfig[ $option['key'] ]) ? $_notifyConfig[ $option['key'] ] : $_defaultConfig[ $option['key'] ]; - - //----------------------------------------- - // Determine available options - //----------------------------------------- - - $_available = array(); - - foreach( $_basicOptions as $_bo ) // ewwww :P - { - if( !is_array($_defaultConfig[ $option['key'] ]['disabled']) OR !in_array( $_bo[0], $_defaultConfig[ $option['key'] ]['disabled'] ) ) - { - $_available[] = $_bo; - } - } - - //----------------------------------------- - // If none available, at least give inline - //----------------------------------------- - - if( !count($_available) ) - { - $_available[] = array( 'inline', $this->lang->words['notify__inline'] ); - } - - //----------------------------------------- - // Start setting data to pass to form - //----------------------------------------- - - $_formOptions[ $option['key'] ] = array(); - $_formOptions[ $option['key'] ]['key'] = $option['key']; - $_formOptions[ $option['key'] ]['app'] = $option['app']; - - //----------------------------------------- - // Rikki asked for this... - //----------------------------------------- - - foreach( $_available as $_availOption ) - { - $_formOptions[ $option['key'] ]['options'][ $_availOption[0] ] = $_availOption; - } - - //$_formOptions[ $option['key'] ]['options'] = $_available; - - $_formOptions[ $option['key'] ]['defaults'] = is_array($_thisConfig['selected']) ? $_thisConfig['selected'] : array(); - $_formOptions[ $option['key'] ]['disabled'] = 0; - - //----------------------------------------- - // Don't allow member to configure - // Still show, but disable on form - //----------------------------------------- - - if( $_defaultConfig[ $option['key'] ]['disable_override'] ) - { - $_formOptions[ $option['key'] ]['disabled'] = 1; - $_formOptions[ $option['key'] ]['defaults'] = is_array($_defaultConfig[ $option['key'] ]['selected']) ? $_defaultConfig[ $option['key'] ]['selected'] : array(); - } - } - - //----------------------------------------- - // Other settings - //----------------------------------------- - - $_emailData = array(); - - //----------------------------------------- - // Email settings... - //----------------------------------------- - - $_emailData['auto_track'] = $this->memberData['auto_track'] ? 'checked="checked"' : ''; - - foreach( array( 'none', 'immediate', 'offline', 'daily', 'weekly' ) as $_opt ) - { - $_emailData['trackOption'][ $_opt ] = ( $this->memberData['auto_track'] == $_opt ) ? 'selected="selected"' : ''; - } - - return $this->registry->getClass('output')->getTemplate('ucp')->notificationsForm( $_formOptions, $_emailData ); - } - - /** - * Show the attachments form - * - * @author Matt Mecham - * @return string Processed HTML - */ - public function showFormAttachments() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $info = array(); - $start = intval( $this->request['st'] ); - $perpage = 15; - $sort_key = ""; - $attachments = array(); - - $this->hide_form_and_save_button = 1; - - //----------------------------------------- - // Sort it - //----------------------------------------- - - switch ( $this->request['sort'] ) - { - case 'date': - $sort_key = 'a.attach_date ASC'; - $info['date_order'] = 'rdate'; - $info['size_order'] = 'size'; - break; - case 'rdate': - $sort_key = 'a.attach_date DESC'; - $info['date_order'] = 'date'; - $info['size_order'] = 'size'; - break; - case 'size': - $sort_key = 'a.attach_filesize DESC'; - $info['date_order'] = 'date'; - $info['size_order'] = 'rsize'; - break; - case 'rsize': - $sort_key = 'a.attach_filesize ASC'; - $info['date_order'] = 'date'; - $info['size_order'] = 'size'; - break; - default: - $sort_key = 'a.attach_date DESC'; - $info['date_order'] = 'date'; - $info['size_order'] = 'size'; - break; - } - - //----------------------------------------- - // Get some stats... - //----------------------------------------- - - $maxspace = intval($this->memberData['g_attach_max']); - - if ( $this->memberData['g_attach_max'] == -1 ) - { - $this->registry->getClass('output')->showError( 'no_permission_to_attach', 1010 ); - } - - //----------------------------------------- - // Limit by forums - //----------------------------------------- - - $stats = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count, ' . $this->DB->buildCoalesce( array( 'sum(attach_filesize)', 0 ) ) . ' as sum', - 'from' => 'attachments', - 'where' => 'attach_member_id=' . $this->memberData['member_id'] . " AND attach_rel_module IN( 'post', 'msg' )" ) ); - - - if ( $maxspace > 0 ) - { - //----------------------------------------- - // Figure out percentage used - //----------------------------------------- - - $info['has_limit'] = 1; - $info['full_percent'] = $stats['sum'] ? sprintf( "%.0f", ( ( $stats['sum'] / ($maxspace * 1024) ) * 100) ) : 0; - - if ( $info['full_percent'] > 100 ) - { - $info['full_percent'] = 100; - } - else if ( $info['full_percent'] < 1 AND $stats['count'] > 0 ) - { - $info['full_percent'] = 1; - } - - $info['attach_space_count'] = sprintf( $this->lang->words['attach_space_count'], intval($stats['count']), intval($info['full_percent']) ); - $info['attach_space_used'] = sprintf( $this->lang->words['attach_space_used'] , IPSLib::sizeFormat($stats['sum']), IPSLib::sizeFormat($maxspace * 1024) ); - } - else - { - $info['has_limit'] = 0; - $info['attach_space_used'] = sprintf( $this->lang->words['attach_space_unl'] , IPSLib::sizeFormat($stats['sum']) ); - } - - //----------------------------------------- - // Pages - //----------------------------------------- - - $pages = $this->registry->getClass('output')->generatePagination( array( 'totalItems' => $stats['count'], - 'itemsPerPage' => $perpage, - 'currentStartValue' => $start, - 'baseUrl' => "app=core&module=usercp&tab=core&area=attachments&sort=" . $this->request['sort'] . "", - ) ); - - //----------------------------------------- - // Get attachments... - //----------------------------------------- - - if( $stats['count'] ) - { - $this->DB->build( array( 'select' => 'a.*', - 'from' => array( 'attachments' => 'a' ), - 'where' => "a.attach_member_id=" . $this->memberData['member_id'] . " AND a.attach_rel_module IN( 'post', 'msg' )", - 'order' => $sort_key, - 'limit' => array( $start, $perpage ), - 'add_join' => array( - array( 'select' => 'p.topic_id', - 'from' => array( 'posts' => 'p' ), - 'where' => 'p.pid=a.attach_rel_id', - 'type' => 'left' - ), - array( 'select' => 't.*', - 'from' => array( 'topics' => 't' ), - 'where' => 't.tid=p.topic_id', - 'type' => 'left' - ) ) - ) ); - $outer = $this->DB->execute(); - - $this->registry->getClass( 'class_localization')->loadLanguageFile( array( 'public_topic' ), 'forums' ); - - $cache = $this->cache->getCache('attachtypes'); - - /* Load topic class */ - if ( ! $this->registry->isClassLoaded('topics') ) - { - $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/topics.php", 'app_forums_classes_topics', 'forums' ); - $this->registry->setClass( 'topics', new $classToLoad( $this->registry ) ); - } - - while ( $row = $this->DB->fetch( $outer ) ) - { - $row['_link'] = true; - - if ( ! $this->registry->topics->canView( $row ) ) - { - $row['title'] = $this->lang->words['attach_topicmoved']; - $row['_link'] = false; - } - - //----------------------------------------- - // Full attachment thingy - //----------------------------------------- - - if ( $row['attach_rel_module'] == 'post' ) - { - $row['_type'] = 'post'; - } - else if ( $row['attach_rel_module'] == 'msg' ) - { - $row['_type'] = 'msg'; - $row['title'] = $this->lang->words['attach_inpm']; - } - - /* IPB 2.x conversion */ - $row['image'] = str_replace( 'folder_mime_types', 'mime_types', $cache[ $row['attach_ext'] ]['atype_img'] ); - $row['short_name'] = IPSText::truncate( $row['attach_file'], 30 ); - $row['attach_date'] = $this->registry->getClass( 'class_localization')->getDate( $row['attach_date'], 'SHORT' ); - $row['real_size'] = IPSLib::sizeFormat( $row['attach_filesize'] ); - - $attachments[] = $row; - } - } - - return $this->registry->getClass('output')->getTemplate('ucp')->coreAttachments( $info, $pages, $attachments ); - } - - /** - * Show the Email & Password form - * - * @author Matt Mecham - * @param string Returned error message (if any) - * @return string Processed HTML - */ - public function showFormEmailPassword( $_message='' ) - { - //----------------------------------------- - // Do not allow validating members to change - // email when admin validation is on - // @see http://community.invisionpower.com/tracker/issue-19964-loophole-in-registration-procedure/ - //----------------------------------------- - - if( $this->memberData['member_group_id'] == $this->settings['auth_group'] AND in_array( $this->settings['reg_auth_type'], array( 'admin', 'admin_user' ) ) ) - { - $this->registry->output->showError( $this->lang->words['admin_val_no_email_chg'], 10189 ); - } - - //----------------------------------------- - // Do we have another URL for email resets? - //----------------------------------------- - - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' ); - $this->han_login = new $classToLoad( $this->registry ); - $this->han_login->init(); - $this->han_login->checkMaintenanceRedirect(); - - //$txt = $this->lang->words['ce_current'] . $this->memberData['email']; - - if ( $this->settings['reg_auth_type']) - { - $txt .= $this->lang->words['ce_auth']; - } - - $_message = $_message ? $this->lang->words[$_message] : ''; - - if( $this->memberData['g_access_cp'] ) - { - $this->hide_form_and_save_button = true; - } - - return $this->registry->getClass('output')->getTemplate('ucp')->emailPasswordChangeForm( $txt, $_message, $this->_isFBUser ); - } - - /** - * Show the display name form - * - * @author Matt Mecham - * @param string Error message (if any) - * @return string Processed HTML - */ - public function showFormDisplayname( $error="" ) - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $form = array(); - - //----------------------------------------- - // CHECK (please) - //----------------------------------------- - - if ( ! $this->settings['auth_allow_dnames'] OR $this->memberData['g_dname_changes'] == 0 OR $this->memberData['g_dname_date'] == 0 ) - { - $this->registry->getClass('output')->showError( 'no_permission_for_display_names', 1011 ); - } - - $this->request['display_name'] = $this->request['display_name'] ? $this->request['display_name'] : ''; - - $this->settings['username_errormsg'] = str_replace( '{chars}', $this->settings['username_characters'], $this->settings['username_errormsg'] ); - - //----------------------------------------- - // Grab # changes > 24 hours - //----------------------------------------- - - $time_check = time() - 86400 * $this->memberData['g_dname_date']; - - if( $time_check < $this->memberData['joined'] ) - { - $time_check = $this->memberData['joined']; - } - - $name_count = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as count, MIN(dname_date) as min_date', 'from' => 'dnames_change', 'where' => "dname_member_id=" . $this->memberData['member_id'] . " AND dname_date > $time_check AND dname_discount=0" ) ); - - $name_count['count'] = intval( $name_count['count'] ); - $name_count['min_date'] = intval( $name_count['min_date'] ) ? intval( $name_count['min_date'] ) : $time_check; - - //----------------------------------------- - // Calculate # left - //----------------------------------------- - - /* Check new permissions */ - $_g = $this->caches['group_cache'][ $this->memberData['member_group_id'] ]; - - if ( $_g['g_displayname_unit'] ) - { - if ( $_g['gbw_displayname_unit_type'] ) - { - /* days */ - if ( $this->memberData['joined'] > ( time() - ( 86400 * $_g['g_displayname_unit'] ) ) ) - { - $this->hide_form_and_save_button = 1; - $form['_noPerm'] = sprintf( $this->lang->words['dname_group_restrict_date'], $this->lang->getDate( $this->memberData['joined'] + ( 86400 * $_g['g_displayname_unit'] ), 'long' ) ); - } - } - else - { - /* Posts */ - if ( $this->memberData['posts'] < $_g['g_displayname_unit'] ) - { - $this->hide_form_and_save_button = 1; - $form['_noPerm'] = sprintf( $this->lang->words['dname_group_restrict_posts'], $_g['g_displayname_unit'] - $this->memberData['posts'] ); - } - } - } - - if( !$form['_noPerm'] ) - { - if ( $this->memberData['g_dname_changes'] == -1 ) - { - $form['_lang_string'] = $this->lang->words['dname_string2']; - } - else - { - $form['_changes_left'] = $this->memberData['g_dname_changes'] - $name_count['count']; - $form['_changes_done'] = $name_count['count']; - - # Make sure changes done isn't larger than allowed - # This happens when changing via ACP - - if ( $form['_changes_done'] > $this->memberData['g_dname_changes'] ) - { - $form['_changes_done'] = $this->memberData['g_dname_changes']; - } - - $form['_first_change'] = $this->registry->getClass( 'class_localization')->getDate( $name_count['min_date'], 'date', 1 ); - $form['_lang_string'] = sprintf( $this->lang->words['dname_string'], - $form['_changes_done'], $this->memberData['g_dname_changes'], - $form['_first_change'], $this->memberData['g_dname_changes'], - $this->memberData['g_dname_date'] ) . $this->lang->words['dname_string2']; - } - } - - //----------------------------------------- - // Print - //----------------------------------------- - - $this->_pageTitle = $this->lang->words['m_dname_change']; - - return $this->registry->getClass('output')->getTemplate('ucp')->displayNameForm( $form, $error, '', $this->_isFBUser ); - } - - /** - * UserCP Form Check - * - * @author Matt Mecham - * @param string Current area as defined by 'get_links' - * @return string Processed HTML - */ - public function saveForm( $current_area ) - { - //----------------------------------------- - // Where to go, what to see? - //----------------------------------------- - - switch( $current_area ) - { - default: - case 'profileinfo': - return $this->saveProfileInfo(); - break; - case 'signature': - return $this->saveSignature(); - break; - case 'photo': - return $this->savePhoto(); - break; - case 'ignoredusers': - return $this->saveIgnoredUsers(); - break; - case 'facebook': - return $this->saveFacebook(); - break; - case 'twitter': - return $this->saveTwitter(); - break; - case 'customize': - return $this->saveCustomize(); - break; - case 'email': - return $this->saveFormEmailPassword(); - break; - case 'password': - return $this->saveFormPassword(); - break; - case 'displayname': - return $this->saveFormDisplayname(); - break; - case 'notifications': - return $this->saveFormNotifications(); - break; - } - } - - /** - * UserCP Save Form: Customize - * - * @return array Errors - */ - public function saveCustomize() - { - /* Init */ - $errors = array(); - $custom = array(); - $bg_nix = trim( $this->request['bg_nix'] ); - $bg_url = trim( $this->request['bg_url'] ); - $bg_tile = intval( $this->request['bg_tile'] ); - $bg_color = trim( str_replace( '#', '', $this->request['bg_color'] ) ); - - /* reset custom */ - $custom = IPSLib::safeUnserialize( $this->memberData['pp_customization'] ); - - /* Bug #21578 */ - if( ! $bg_color && $custom['bg_color'] ) - { - $bg_color = $custom['bg_color']; - } - - /* Delete all? */ - if ( $bg_nix ) - { - /* reset array */ - $custom = array( 'bg_url' => '', 'type' => '', 'bg_color' => '', 'bg_tile' => '' ); - - /* remove bg images */ - IPSMember::getFunction()->removeUploadedBackgroundImages( $this->memberData['member_id'] ); - } - else - { - if ( $bg_url AND $this->memberData['gbw_allow_url_bgimage'] ) - { - /* Check */ - if ( ! stristr( $bg_url, 'http://' ) OR preg_match( '#\(\*#', $bg_url ) ) - { - return array( 0 => $this->lang->words['pp_bgimg_url_bad'] ); - } - - $image_extension = strtolower( pathinfo( $bg_url, PATHINFO_EXTENSION ) ); - - if( ! in_array( $image_extension, array( 'png', 'jpg', 'gif', 'jpeg' ) ) ) - { - return array( 0 => $this->lang->words['pp_bgimg_ext_bad'] ); - } - - $custom['bg_url'] = $bg_url; - $custom['type'] = 'url'; - } - else if ( $this->memberData['gbw_allow_upload_bgimage'] ) - { - /* Load more lang strings */ - $this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' ); - - /* Upload img */ - $img = IPSMember::getFunction()->uploadBackgroundImage(); - - if ( $img['status'] == 'fail' ) - { - return array( 0 => sprintf( $this->lang->words[ 'pp_' . $img['error'] ], $img['maxSize'] ) ); - } - else if ( $img['final_location'] ) - { - $custom['bg_url'] = $img['final_location']; - $custom['type'] = 'upload'; - } - } - } - - /* BG color */ - $custom['bg_color'] = $bg_nix ? '' : IPSText::alphanumericalClean( $bg_color ); - - /* Tile */ - $custom['bg_tile'] = $bg_nix ? '' : $bg_tile; - - /* Save it */ - if ( ! $this->memberData['bw_disable_customization'] AND $this->memberData['gbw_allow_customization'] ) - { - IPSMember::save( $this->memberData['member_id'], array( 'extendedProfile' => array( 'pp_profile_update' => IPS_UNIX_TIME_NOW, 'pp_customization' => serialize( $custom ) ) ) ); - } - - return TRUE; - } - - /** - * UserCP Save Form: Twitter - * - * @return array Errors - */ - public function saveTwitter() - { - if( !IPSLib::twitter_enabled() ) - { - $this->registry->getClass('output')->showError( 'twitter_disabled', 1005.2 ); - } - - //----------------------------------------- - // Data - //----------------------------------------- - - $toSave = IPSBWOptions::thaw( $this->memberData['tc_bwoptions'], 'twitter' ); - - //----------------------------------------- - // Loop and save... simple - //----------------------------------------- - - foreach( array( 'tc_s_pic', 'tc_s_status', 'tc_s_aboutme', 'tc_s_bgimg', 'tc_si_status' ) as $field ) - { - $toSave[ $field ] = intval( $this->request[ $field ] ); - } - - $this->memberData['tc_bwoptions'] = IPSBWOptions::freeze( $toSave, 'twitter' ); - $return = IPSMember::save( $this->memberData['member_id'], array( 'extendedProfile' => array( 'tc_bwoptions' => $this->memberData['tc_bwoptions'] ) ) ); - - //----------------------------------------- - // Now sync - //----------------------------------------- - - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/twitter/connect.php', 'twitter_connect' ); - $twitter = new $classToLoad( $this->registry, $this->memberData['twitter_token'], $this->memberData['twitter_secret'] ); - - try - { - $twitter->syncMember( $this->memberData ); - } - catch( Exception $error ) - { - $msg = $error->getMessage(); - - switch( $msg ) - { - case 'NOT_LINKED': - case 'NO_MEMBER': - break; - } - } - - return TRUE; - } - - /** - * UserCP Save Form: Facebook - * - * @return array Errors - */ - public function saveFacebook() - { - if( !IPSLib::fbc_enabled() ) - { - $this->registry->getClass('output')->showError( 'fbc_disabled', 1005 ); - } - - //----------------------------------------- - // Data - //----------------------------------------- - - $toSave = IPSBWOptions::thaw( $this->memberData['members_bitoptions'], 'members' ); - - //----------------------------------------- - // Loop and save... simple - //----------------------------------------- - - foreach( array( 'fbc_s_pic', 'fbc_s_status', 'fbc_s_aboutme', 'fbc_si_status' ) as $field ) - { - $toSave[ $field ] = intval( $this->request[ $field ] ); - } - - $this->memberData['fb_bwoptions'] = IPSBWOptions::freeze( $toSave, 'facebook' ); - IPSMember::save( $this->memberData['member_id'], array( 'extendedProfile' => array( 'fb_bwoptions' => $this->memberData['fb_bwoptions'] ) ) ); - - //----------------------------------------- - // Now sync - //----------------------------------------- - - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php', 'facebook_connect' ); - $facebook = new $classToLoad( $this->registry ); - - try - { - $facebook->syncMember( $this->memberData ); - } - catch( Exception $error ) - { - $msg = $error->getMessage(); - - switch( $msg ) - { - case 'NOT_LINKED': - case 'NO_MEMBER': - break; - } - } - - return TRUE; - } - - /** - * UserCP Save Form: Ignore Users - * - * @return array Errors - */ - public function saveIgnoredUsers() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $newName = $this->request['newbox_1']; - $dnvs = intval( $this->request['donot_view_sigs'] ); - - IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'view_sigs' => ( $dnvs ) ? 0 : 1 ) ) ); - - if ( trim( $newName ) && $_POST['newbox_1'] != $this->lang->words['ucp_members_name'] ) - { - //----------------------------------------- - // Load - //----------------------------------------- - - $member = IPSMember::load( $newName, 'core', 'displayname' ); - - if ( ! $member['member_id'] ) - { - return array( 0 => $this->lang->words['ignoreuser_nomem'] ); - } - - if ( $member['member_id'] == $this->memberData['member_id'] ) - { - return array( 0 => $this->lang->words['ignoreuser_cannot'] ); - } - - //----------------------------------------- - // Already ignoring? - //----------------------------------------- - - $ignoreMe = $this->DB->buildAndFetch( array( - 'select' => '*', - 'from' => 'ignored_users', - 'where' => 'ignore_owner_id=' . $this->memberData['member_id'] . ' AND ignore_ignore_id=' . $member['member_id'] - ) ); - - if ( $ignoreMe['ignore_id'] ) - { - return array( 0 => $this->lang->words['ignoreuser_already'] ); - } - - //----------------------------------------- - // Can we ignore them? - //----------------------------------------- - - if ( $member['_canBeIgnored'] !== TRUE ) - { - return array( 0 => $this->lang->words['ignoreuser_cannot'] ); - } - - //----------------------------------------- - // Add it - //----------------------------------------- - - $this->DB->insert( 'ignored_users', array( - 'ignore_owner_id' => $this->memberData['member_id'], - 'ignore_ignore_id' => $member['member_id'], - 'ignore_messages' => !empty( $this->request['ignore_messages'] ) ? 1 : 0, - 'ignore_topics' => !empty( $this->request['ignore_topics'] ) ? 1 : 0, - 'ignore_signatures' => !empty( $this->request['ignore_signatures'] ) ? 1 : 0, - 'ignore_chats' => !empty( $this->request['ignore_chats'] ) ? 1 : 0, - ) - ); - - /* Rebuild cache */ - IPSMember::rebuildIgnoredUsersCache( $this->memberData ); - } - - return TRUE; - } - - - /** - * UserCP Save Form: Signature - * - * @return array Errors - */ - public function saveSignature() - { - /* Load editor stuff */ - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' ); - $this->editor = new $classToLoad(); - $this->editor->setLegacyMode(false); - - $isHtml = intval( $this->request['sig_htmlstatus'] ); - - //----------------------------------------- - // Check to make sure that we can edit profiles.. - //----------------------------------------- - - $sig_restrictions = explode( ':', $this->memberData['g_signature_limits'] ); - - if ( ! $this->memberData['g_edit_profile'] OR ( $sig_restrictions[0] AND ! $this->memberData['g_sig_unit'] ) ) - { - $this->registry->getClass('output')->showError( 'members_profile_disabled', 1028, null, null, 403 ); - } - - //----------------------------------------- - // Post process the editor - // Now we have safe HTML and bbcode - //----------------------------------------- - - /* Set content in editor */ - $this->editor->setAllowBbcode( true ); - $this->editor->setAllowSmilies( true ); - $this->editor->setIsHtml( $this->memberData['g_dohtml'] && $isHtml ); - $this->editor->setBbcodeSection('signatures'); - $this->editor->setContent( $this->memberData['signature'] ); - - $signature = $this->editor->process( $_POST['Post'] ); - - //----------------------------------------- - // Parse post - //----------------------------------------- - - /* Load parser */ - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/text/parser.php', 'classes_text_parser' ); - $parser = new $classToLoad(); - - $parser->testForParsingLimits( $signature, array( 'quote', 'emoticons', 'urls' ) ); - - if ( is_array( $parser->getErrors() ) && count( $parser->getErrors() ) ) - { - $this->lang->loadLanguageFile( array( 'public_post' ), 'forums' ); - - $_error = array_pop( $parser->getErrors() ); - $this->registry->getClass('output')->showError( $_error, 10210 ); - } - - //----------------------------------------- - // Signature restrictions... - //----------------------------------------- - - $sig_errors = array(); - - //----------------------------------------- - // Max number of images... - //----------------------------------------- - - if( isset($sig_restrictions[1]) and $sig_restrictions[1] !== '' ) - { - if( $parser->getImageCount( $signature ) > $sig_restrictions[1] ) - { - $sig_errors[] = sprintf( $this->lang->words['sig_toomanyimages'], $sig_restrictions[1] ); - } - } - - //----------------------------------------- - // Max number of urls... - //----------------------------------------- - - if( isset($sig_restrictions[4]) and $sig_restrictions[4] !== '' ) - { - if( $parser->getUrlCount( $signature ) > $sig_restrictions[4] ) - { - $sig_errors[] = sprintf( $this->lang->words['sig_toomanyurls'], $sig_restrictions[4] ); - } - else - { - preg_match_all( '#(^|\s|>)((http|https|news|ftp)://\w+[^\s\[\]\<]+)#is', $signature, $matches ); - - if( count($matches[1]) > $sig_restrictions[4] ) - { - $sig_errors[] = sprintf( $this->lang->words['sig_toomanyurls'], $sig_restrictions[4] ); - } - } - } - - $this->settings['signature_line_length'] = $this->settings['signature_line_length'] > 0 ? $this->settings['signature_line_length'] : 200; - - /* You can't wordwrap on HTML http://community.invisionpower.com/resources/bugs.html/_/ip-board/signature-url-bbcode-r41254 */ - //$signature = wordwrap( $signature, $this->settings['signature_line_length'], '

', true ); - - // http://community.invisionpower.com/tracker/issue-35105-signature-restriction-minor-bug - $signature = preg_replace( '#^\s*(

)+#i', '', $signature ); - $signature = preg_replace( '#(

)+?\s*$#i', '', $signature ); - - //----------------------------------------- - // Max number of lines of text... - //----------------------------------------- - - if( isset($sig_restrictions[5]) and $sig_restrictions[5] !== '' ) - { - $lineCount = substr_count( $signature, "

" ) + substr_count( $signature, "br>" ); - - if( $lineCount >= $sig_restrictions[5] ) - { - $sig_errors[] = sprintf( $this->lang->words['sig_toomanylines'], $sig_restrictions[5] ); - } - } - - //----------------------------------------- - // Now the crappy part.. - //----------------------------------------- - - if( isset($sig_restrictions[2]) and $sig_restrictions[2] !== '' AND isset($sig_restrictions[3]) and $sig_restrictions[3] !== '' ) - { - preg_match_all( '/\]+?)>/i', $signature, $allImages ); - - if( count($allImages[1]) ) - { - foreach( $allImages[1] as $foundImage ) - { - preg_match( '#src=[\'"]([^\'"]+?)[\'"]#i', $foundImage, $url ); - $imageProperties = @getimagesize( $url[1] ); - - if( is_array($imageProperties) AND count($imageProperties) ) - { - if( $imageProperties[0] > $sig_restrictions[2] OR $imageProperties[1] > $sig_restrictions[3] ) - { - $sig_errors[] = sprintf( $this->lang->words['sig_imagetoobig'], $url[1], $sig_restrictions[2], $sig_restrictions[3] ); - } - } - else - { - $sig_errors[] = $this->lang->words['sig_imagenotretrievable']; - } - } - } - } - - if( count($sig_errors) ) - { - $this->registry->getClass('output')->showError( implode( '
', $sig_errors ), 10211 ); - } - - /* Save HTML status */ - $members_bitoptions = IPSBWOptions::thaw( $this->memberData['members_bitoptions'], 'members', 'global' ); - $members_bitoptions['bw_html_sig'] = $isHtml; - - //----------------------------------------- - // Write it to the DB. - //----------------------------------------- - - IPSMember::save( $this->memberData['member_id'], array( 'members' => $members_bitoptions, 'extendedProfile' => array( 'signature' => $signature ) ) ); - - /* Update cache */ - IPSContentCache::update( $this->memberData['member_id'], 'sig', $parser->display( $signature ) ); - - return TRUE; - } - - - /** - * UserCP Save Form: Profile Info - * - * @return array Errors - */ - public function saveProfileInfo() - { - /* Load editor stuff */ - if( $this->request['updateAboutMe'] ) - { - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' ); - $this->editor = new $classToLoad(); - $this->editor->setLegacyMode(false); - } - - //----------------------------------------- - // INIT - //----------------------------------------- - - $pp_setting_moderate_comments = intval( $this->request['pp_setting_moderate_comments'] ); - $pp_setting_moderate_friends = intval( $this->request['pp_setting_moderate_friends'] ); - $pp_setting_count_visitors = intval( $this->request['pp_setting_count_visitors'] ); - $pp_setting_count_comments = intval( $this->request['pp_setting_count_comments'] ); - $pp_setting_count_friends = intval( $this->request['pp_setting_count_friends'] ); - - //----------------------------------------- - // Check to make sure that we can edit profiles.. - //----------------------------------------- - - if ( ! $this->memberData['g_edit_profile'] ) - { - $this->registry->getClass('output')->showError( 'members_profile_disabled', 10214, null, null, 403 ); - } - - //----------------------------------------- - // make sure that either we entered - // all calendar fields, or we left them - // all blank - //----------------------------------------- - - $c_cnt = 0; - - foreach ( array('day','month','year') as $v ) - { - if ( $this->request[ $v ] ) - { - $c_cnt++; - } - } - - if( $c_cnt > 0 && $c_cnt < 2 ) - { - $this->registry->getClass('output')->showError( 'member_bad_birthday', 10215 ); - } - else if( $c_cnt > 0 ) - { - //----------------------------------------- - // Make sure it's a legal date - //----------------------------------------- - - $_year = $this->request['year'] ? $this->request['year'] : 2000; - - if ( ! checkdate( $this->request['month'], $this->request['day'], $_year ) ) - { - $this->registry->getClass('output')->showError( 'member_bad_birthday', 10216 ); - } - } - - //----------------------------------------- - // Start off our array - //----------------------------------------- - - $core = array( 'bday_day' => $this->request['day'], - 'bday_month' => $this->request['month'], - 'bday_year' => $this->request['year'], - ); - - $extendedProfile = array( 'pp_setting_moderate_comments' => $pp_setting_moderate_comments, - 'pp_setting_moderate_friends' => $pp_setting_moderate_friends, - 'pp_setting_count_visitors' => $pp_setting_count_visitors, - 'pp_setting_count_comments' => $pp_setting_count_comments, - 'pp_setting_count_friends' => $pp_setting_count_friends ); - - //----------------------------------------- - // check to see if we can enter a member title - // and if one is entered, update it. - //----------------------------------------- - - if( isset( $this->request['member_title'] ) and ( $this->settings['post_titlechange'] == -1 or ( $this->settings['post_titlechange'] and $this->memberData['posts'] >= $this->settings['post_titlechange'] ) ) ) - { - $core['title'] = IPSText::getTextClass('bbcode')->stripBadWords( $this->request['member_title'] ); - } - - //----------------------------------------- - // Custom profile field stuff - //----------------------------------------- - - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/customfields/profileFields.php', 'customProfileFields' ); - $fields = new $classToLoad(); - - $fields->member_data = $this->member->fetchMemberData(); - $fields->initData( 'edit' ); - /* Use $_POST and not ipsRegistry::$request as the custom profile field kernel class has its own cleaning routines for saving and showing - which means we end up with double & -> & conversion (&lt;, etc) */ - $fields->parseToSave( $_POST ); - - if( $fields->error_messages ) - { - return $fields->error_messages; - } - - /* Check the website url field */ - $website_field = $fields->getFieldIDByKey( 'website' ); - - if( $website_field && $fields->out_fields[ 'field_' . $website_field ] ) - { - if( stristr( $fields->out_fields[ 'field_' . $website_field ], 'http://' ) === FALSE && stristr( $fields->out_fields[ 'field_' . $website_field ], 'https://' ) === FALSE ) - { - $fields->out_fields[ 'field_' . $website_field ] = 'http://' . $fields->out_fields[ 'field_' . $website_field ]; - } - } - - //----------------------------------------- - // Check... - //----------------------------------------- - - if ( count( $fields->error_fields['empty'] ) ) - { - $this->registry->getClass('output')->showError( array( 'customfields_empty', $fields->error_fields['empty'][0]['pf_title'] ), 10217 ); - } - - if ( count( $fields->error_fields['invalid'] ) ) - { - $this->registry->getClass('output')->showError( array( 'customfields_invalid', $fields->error_fields['invalid'][0]['pf_title'] ), 10218 ); - } - - if ( count( $fields->error_fields['toobig'] ) ) - { - $this->registry->getClass('output')->showError( array( 'customfields_toobig', $fields->error_fields['toobig'][0]['pf_title'] ), 10219 ); - } - - /* About me */ - if( $this->request['updateAboutMe'] ) - { - $extendedProfile['pp_about_me'] = $this->editor->process( $_POST['Post'] ); - } - - /* Open ID & times*/ - $timeZone = IPSText::alphanumericalClean( $this->request['timeZone'], '+.' ); - $dst_correct = intval( $this->request['dst_correct'] ); - - /* Add into array */ - $core['time_offset'] = $timeZone; - - /* http://community.invisionpower.com/resources/bugs.html/_/ip-board/cannot-uncheck-my-timezone-is-currently-in-dst-checkbox-in-profile-r41510 */ - //$core['dst_in_use'] = $this->settings['time_dst_auto_correction'] ? ( ( $this->request['dstOption'] AND intval($this->request['dstCheck']) == 0 ) ? intval($this->request['dstOption']) : 0 ) : $this->memberData['dst_in_use']; - $core['dst_in_use'] = $this->settings['time_dst_auto_correction'] ? ( ( $this->request['dstOption'] AND intval($this->request['dstCheck']) == 0 ) ? intval($this->request['dstOption']) : 0 ) : intval($this->request['dstOption']); - - $core['members_auto_dst'] = $this->settings['time_dst_auto_correction'] ? intval($this->request['dstCheck']) : $this->memberData['members_auto_dst']; - - //----------------------------------------- - // Update the DB - //----------------------------------------- - - IPSMember::save( $this->memberData['member_id'], array( 'core' => $core, - 'customFields' => $fields->out_fields, - 'extendedProfile' => $extendedProfile ) ); - - //----------------------------------------- - // Update birthdays cache if user set to today - // or if birthday was today but isn't now - //----------------------------------------- - - if( $core['bday_month'] == date('m') AND $core['bday_day'] == date('d') ) - { - $this->cache->rebuildCache( 'birthdays', 'calendar' ); - } - else if( $this->memberData['bday_month'] == date('m') AND $this->memberData['bday_day'] == date('d') AND ( $core['bday_month'] != date('m') OR $core['bday_day'] != date('d') ) ) - { - $this->cache->rebuildCache( 'birthdays', 'calendar' ); - } - - return TRUE; - } - - /** - * UserCP Save Form: Notifications config - * - * @return boolean Successful - */ - public function saveFormNotifications() - { - //----------------------------------------- - // Notifications library - //----------------------------------------- - - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' ); - $notifyLibrary = new $classToLoad( $this->registry ); - $notifyLibrary->setMember( $this->memberData ); - - //----------------------------------------- - // Show the form - //----------------------------------------- - - $_basicOptions = array( array( 'email', $this->lang->words['notopt__email'] ), array( 'inline', $this->lang->words['notopt__inline'] ), array( 'mobile' => $this->lang->words['notopt__mobile'] ) ); - $_configOptions = $notifyLibrary->getNotificationData(); - $_notifyConfig = $notifyLibrary->getMemberNotificationConfig( $this->memberData ); - $_defaultConfig = $notifyLibrary->getDefaultNotificationConfig(); - $_saveConfig = array(); - - foreach( $_configOptions as $option ) - { - $_saveConfig[ $option['key'] ] = array(); - $_saveConfig[ $option['key'] ]['selected'] = array(); - - //----------------------------------------- - // Loop through and mark what we selected. - // Do not allow changing of stuff from disable_override - // and disabled, however - //----------------------------------------- - - if( is_array($this->request['config_' . $option['key'] ]) AND count($this->request['config_' . $option['key'] ]) ) - { - foreach( $this->request['config_' . $option['key'] ] as $_selected ) - { - if( !is_array($_defaultConfig[ $option['key'] ]['disabled']) OR !in_array( $_selected, $_defaultConfig[ $option['key'] ]['disabled'] ) ) - { - $_saveConfig[ $option['key'] ]['selected'][] = $_selected; - } - } - } - - if( $_defaultConfig[ $option['key'] ]['disable_override'] ) - { - $_saveConfig[ $option['key'] ]['selected'] = $_defaultConfig[ $option['key'] ]['selected']; - } - } - - //----------------------------------------- - // Save - //----------------------------------------- - - IPSMember::packMemberCache( $this->memberData['member_id'], array( 'notifications' => $_saveConfig, 'show_notification_popup' => intval($this->request['show_notification_popup']) ), $this->memberData['members_cache'] ); - - //----------------------------------------- - // Topic preferences - //----------------------------------------- - - $_trackChoice = ''; - - if ( $this->request['auto_track'] ) - { - if ( in_array( $this->request['trackchoice'], array( 'none', 'immediate', 'offline', 'daily', 'weekly' ) ) ) - { - $_trackChoice = $this->request['trackchoice']; - } - } - - //----------------------------------------- - // Profile preferences - //----------------------------------------- - - IPSMember::save( $this->memberData['member_id'], array( 'core' => array( - 'allow_admin_mails' => intval( $this->request['admin_send'] ), - 'auto_track' => $_trackChoice - ) ) ); - - return TRUE; - } - /** - * UserCP Save Form: Password - * - * @param array Array of member / core_sys_login information (if we're editing) - * @return mixed Array of errors / boolean true - */ - public function saveFormPassword( $member=array() ) - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $cur_pass = trim($this->request['current_pass']); - $new_pass = trim($this->request['new_pass_1']); - $chk_pass = trim($this->request['new_pass_2']); - $isRemote = ( ! $this->memberData['bw_local_password_set'] AND $this->memberData['members_created_remote'] ) ? true : false; - - //----------------------------------------- - // Checks... - //----------------------------------------- - - if( $this->memberData['g_access_cp'] ) - { - return array( 0 => $this->lang->words['admin_emailpassword'] ); - } - - if ( $isRemote === false AND ( ! $_POST['current_pass'] OR ( empty($new_pass) ) or ( empty($chk_pass) ) ) ) - { - return array( 0 => $this->lang->words['complete_entire_form'] ); - } - - //----------------------------------------- - // Do the passwords actually match? - //----------------------------------------- - - if ( $new_pass != $chk_pass ) - { - return array( 0 => $this->lang->words['passwords_not_matchy'] ); - } - - //----------------------------------------- - // Check password... - //----------------------------------------- - - if ( $isRemote === false ) - { - if ( $this->_checkPassword( $cur_pass ) !== TRUE ) - { - return array( 0 => $this->lang->words['current_pw_bad'] ); - } - } - else - { - /* This is INIT in _checkPassword */ - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' ); - $this->han_login = new $classToLoad( $this->registry ); - $this->han_login->init(); - } - - //----------------------------------------- - // Create new password... - //----------------------------------------- - - $md5_pass = md5($new_pass); - - //----------------------------------------- - // han_login was loaded during check_password - //----------------------------------------- - - $this->han_login->changePass( $this->memberData['email'], $md5_pass, $new_pass, $this->memberData ); - - if ( $this->han_login->return_code AND $this->han_login->return_code != 'METHOD_NOT_DEFINED' AND $this->han_login->return_code != 'SUCCESS' ) - { - return array( 0 => $this->lang->words['hanlogin_pw_failed'] ); - } - - //----------------------------------------- - // Update the DB - //----------------------------------------- - - IPSMember::updatePassword( $this->memberData['member_id'], $md5_pass ); - - IPSLib::runMemberSync( 'onPassChange', $this->memberData['member_id'], $new_pass ); - - //----------------------------------------- - // Update members log in key... - //----------------------------------------- - - $key = IPSMember::generateAutoLoginKey(); - - IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'member_login_key' => $key, 'bw_local_password_set' => 1 ) ) ); - - $this->ok_message = $this->lang->words['pw_change_successful']; - - return TRUE; - } - - /** - * UserCP Save Form: Display Name - * - * @return mixed Array of errors / boolean true - */ - public function saveFormDisplayname() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $members_display_name = trim($this->request['displayName']); - $password_check = trim( $this->request['displayPassword'] ); - - //----------------------------------------- - // Check for blanks... - //----------------------------------------- - - if ( ! $members_display_name OR ( ! $this->_isFBUser AND ! $password_check ) ) - { - return array( 0 => $this->lang->words['complete_entire_form'] ); - } - - //----------------------------------------- - // Check password - //----------------------------------------- - - if ( ! $this->_isFBUser ) - { - if ( $this->_checkPassword( $password_check ) === FALSE ) - { - return array( 0 => $this->lang->words['current_pw_bad'] ); - } - } - - try - { - if ( IPSMember::getFunction()->updateName( $this->memberData['member_id'], $members_display_name, 'members_display_name' ) === TRUE ) - { - $this->cache->rebuildCache( 'stats', 'global' ); - - return $this->showFormDisplayname( '', $this->lang->words['dname_change_ok'] ); - } - else - { - # We should absolutely never get here. So this is a fail-safe, really to - # prevent a "false" positive outcome for the end-user - return array( 0 => $this->lang->words['name_taken_change'] ); - } - } - catch( Exception $error ) - { - switch( $error->getMessage() ) - { - case 'NO_MORE_CHANGES': - return array( 0 => $this->lang->words['name_change_no_more'] ); - break; - case 'NO_USER': - return array( 0 => $this->lang->words['name_change_noload'] ); - break; - case 'NO_PERMISSION': - return array( 0 => $this->lang->words['name_change_noperm'] ); - case 'NO_NAME': - return array( 0 => sprintf( $this->lang->words['name_change_tooshort'], $this->settings['max_user_name_length'] ) ); - break; - case 'TOO_LONG': - return array( 0 => sprintf( $this->lang->words['name_change_tooshort'], $this->settings['max_user_name_length'] ) ); - break; - case 'ILLEGAL_CHARS': - return array( 0 => $this->lang->words['name_change_illegal'] ); - break; - case 'USER_NAME_EXISTS': - return array( 0 => $this->lang->words['name_change_taken'] ); - break; - default: - return array( 0 => $error->getMessage() ); - break; - } - } - - return TRUE; - } - - /** - * UserCP Save Form: Email Address - * - * @return mixed Array of errors / boolean true - */ - public function saveFormEmailPassword() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $_emailOne = strtolower( trim($this->request['in_email_1']) ); - $_emailTwo = strtolower( trim($this->request['in_email_2']) ); - $cur_pass = trim($this->request['current_pass']); - $new_pass = trim($this->request['new_pass_1']); - $chk_pass = trim($this->request['new_pass_2']); - $isRemote = ( ! $this->memberData['bw_local_password_set'] AND $this->memberData['members_created_remote'] ) ? true : false; - - if ( $cur_pass OR $new_pass ) - { - if( $this->memberData['g_access_cp'] ) - { - return array( 0 => $this->lang->words['admin_emailpassword'] ); - } - - if ( $isRemote === false AND ( ! $_POST['current_pass'] OR ( empty($new_pass) ) or ( empty($chk_pass) ) ) ) - { - return array( 0 => $this->lang->words['complete_entire_form'] ); - } - - //----------------------------------------- - // Do the passwords actually match? - //----------------------------------------- - - if ( $new_pass != $chk_pass ) - { - return array( 0 => $this->lang->words['passwords_not_matchy'] ); - } - - //----------------------------------------- - // Check password... - //----------------------------------------- - - if ( $isRemote === false ) - { - if ( $this->_checkPassword( $cur_pass ) !== TRUE ) - { - return array( 0 => $this->lang->words['current_pw_bad'] ); - } - } - else - { - /* This is INIT in _checkPassword */ - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' ); - $this->han_login = new $classToLoad( $this->registry ); - $this->han_login->init(); - } - - //----------------------------------------- - // Create new password... - //----------------------------------------- - - $md5_pass = md5($new_pass); - - //----------------------------------------- - // han_login was loaded during check_password - //----------------------------------------- - - $this->han_login->changePass( $this->memberData['email'], $md5_pass, $new_pass, $this->memberData ); - - if ( $this->han_login->return_code AND $this->han_login->return_code != 'METHOD_NOT_DEFINED' AND $this->han_login->return_code != 'SUCCESS' ) - { - return array( 0 => $this->lang->words['hanlogin_pw_failed'] ); - } - - //----------------------------------------- - // Update the DB - //----------------------------------------- - - IPSMember::updatePassword( $this->memberData['email'], $md5_pass ); - - IPSLib::runMemberSync( 'onPassChange', $this->memberData['member_id'], $new_pass ); - - //----------------------------------------- - // Update members log in key... - //----------------------------------------- - - $key = IPSMember::generateAutoLoginKey(); - - IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'member_login_key' => $key, 'bw_local_password_set' => 1 ) ) ); - - $this->ok_message = $this->lang->words['pw_change_successful']; - } - - if ( $_emailOne or $_emailTwo ) - { - //----------------------------------------- - // Do not allow validating members to change - // email when admin validation is on - // @see http://community.invisionpower.com/tracker/issue-19964-loophole-in-registration-procedure/ - //----------------------------------------- - - if( $this->memberData['member_group_id'] == $this->settings['auth_group'] AND in_array( $this->settings['reg_auth_type'], array( 'admin', 'admin_user' ) ) ) - { - $this->registry->output->showError( $this->lang->words['admin_val_no_email_chg'], 10190 ); - } - - //----------------------------------------- - // Check input - //----------------------------------------- - - if( $this->memberData['g_access_cp'] ) - { - return array( 0 => $this->lang->words['admin_emailpassword'] ); - } - - if ( ! $_POST['in_email_1'] OR ! $_POST['in_email_2'] ) - { - return array( 0 => $this->lang->words['complete_entire_form'] ); - } - - //----------------------------------------- - // Check password... - //----------------------------------------- - - if ( ! $this->_isFBUser ) - { - if ( $this->_checkPassword( $this->request['password'] ) === FALSE ) - { - return array( 0 => $this->lang->words['current_pw_bad'] ); - } - } - - //----------------------------------------- - // Test email addresses - //----------------------------------------- - - if ( $_emailOne != $_emailTwo ) - { - return array( 0 => $this->lang->words['emails_no_matchy'] ); - } - - if ( IPSText::checkEmailAddress( $_emailOne ) !== TRUE ) - { - return array( 0 => $this->lang->words['email_not_valid'] ); - } - - //----------------------------------------- - // Is this email addy taken? - //----------------------------------------- - - if ( IPSMember::checkByEmail( $_emailOne ) == TRUE ) - { - return array( 0 => $this->lang->words['email_is_taken'] ); - } - - //----------------------------------------- - // Load ban filters - //----------------------------------------- - $banfilters = array(); - $this->DB->build( array( 'select' => '*', 'from' => 'banfilters' ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $banfilters[ $r['ban_type'] ][] = $r['ban_content']; - } - - //----------------------------------------- - // Check in banned list - //----------------------------------------- - - if ( isset($banfilters['email']) AND is_array( $banfilters['email'] ) and count( $banfilters['email'] ) ) - { - foreach ( $banfilters['email'] as $email ) - { - $email = str_replace( '\*', '.*' , preg_quote($email, "/") ); - - if ( preg_match( "/^{$email}$/i", $_emailOne ) ) - { - return array( 0 => $this->lang->words['email_is_taken'] ); - } - } - } - - //----------------------------------------- - // Load handler... - //----------------------------------------- - - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' ); - $this->han_login = new $classToLoad( $this->registry ); - $this->han_login->init(); - - if ( $this->han_login->emailExistsCheck( $_emailOne ) !== FALSE ) - { - return array( 0 => $this->lang->words['email_is_taken'] ); - } - - $this->han_login->changeEmail( $this->memberData['email'], $_emailOne, $this->memberData ); - - if ( $this->han_login->return_code AND $this->han_login->return_code != 'METHOD_NOT_DEFINED' AND $this->han_login->return_code != 'SUCCESS' ) - { - return array( 0 => $this->lang->words['email_is_taken'] ); - } - - //----------------------------------------- - // Want a new validation? NON ADMINS ONLY - //----------------------------------------- - - if ( $this->settings['reg_auth_type'] AND !$this->memberData['g_access_cp'] ) - { - //----------------------------------------- - // Remove any existing entries - //----------------------------------------- - - $_previous = $this->DB->buildAndFetch( array( 'select' => 'prev_email, real_group', 'from' => 'validating', 'where' => "member_id={$this->memberData['member_id']} AND email_chg=1" ) ); - - if( $_previous['prev_email'] ) - { - $this->DB->delete( 'validating', "member_id={$this->memberData['member_id']} AND email_chg=1" ); - - $this->memberData['email'] = $_previous['prev_email']; - $this->memberData['member_group_id'] = $_previous['real_group']; - } - - $validate_key = md5( IPSMember::makePassword() . time() ); - - //----------------------------------------- - // Update the new email, but enter a validation key - // and put the member in "awaiting authorisation" - // and send an email.. - //----------------------------------------- - - $db_str = array( - 'vid' => $validate_key, - 'member_id' => $this->memberData['member_id'], - 'temp_group' => $this->settings['auth_group'], - 'entry_date' => time(), - 'coppa_user' => 0, - 'email_chg' => 1, - 'ip_address' => $this->member->ip_address, - 'prev_email' => $this->memberData['email'], - ); - - if ( $this->memberData['member_group_id'] != $this->settings['auth_group'] ) - { - $db_str['real_group'] = $this->memberData['member_group_id']; - } - - $this->DB->insert( 'validating', $db_str ); - - IPSLib::runMemberSync( 'onEmailChange', $this->memberData['member_id'], strtolower( $_emailOne ), $this->memberData['email'] ); - - IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'member_group_id' => $this->settings['auth_group'], - 'email' => $_emailOne ) ) ); - - //----------------------------------------- - // Update their session with the new member group - //----------------------------------------- - - if ( $this->member->session_id ) - { - $this->member->sessionClass()->convertMemberToGuest(); - } - - //----------------------------------------- - // Kill the cookies to stop auto log in - //----------------------------------------- - - IPSCookie::set( 'pass_hash' , '-1', 0 ); - IPSCookie::set( 'member_id' , '-1', 0 ); - IPSCookie::set( 'session_id' , '-1', 0 ); - - //----------------------------------------- - // Dispatch the mail, and return to the activate form. - //----------------------------------------- - - IPSText::getTextClass( 'email' )->getTemplate("newemail"); - - IPSText::getTextClass( 'email' )->buildMessage( array( - 'NAME' => $this->memberData['members_display_name'], - 'THE_LINK' => $this->registry->getClass('output')->buildSEOUrl("app=core&module=global§ion=register&do=auto_validate&type=newemail&uid=".$this->memberData['member_id']."&aid=".$validate_key, 'publicNoSession', 'false' ), - 'ID' => $this->memberData['member_id'], - 'MAN_LINK' => $this->registry->getClass('output')->buildSEOUrl("app=core&module=global§ion=register&do=07", 'publicNoSession', 'false'), - 'CODE' => $validate_key, - ) ); - - IPSText::getTextClass( 'email' )->subject = $this->lang->words['lp_subject'].' '.$this->settings['board_name']; - IPSText::getTextClass( 'email' )->to = $_emailOne; - - IPSText::getTextClass( 'email' )->sendMail(); - - $this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] . 'app=core&module=global&section=register&do=07' ); - } - else - { - //----------------------------------------- - // No authorisation needed, change email addy and return - //----------------------------------------- - - IPSLib::runMemberSync( 'onEmailChange', $this->memberData['member_id'], strtolower( $_emailOne ), $this->memberData['email'] ); - - IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'email' => $_emailOne ) ) ); - - //----------------------------------------- - // Add to OK message - //----------------------------------------- - - $this->ok_message = $this->lang->words['ok_email_changed']; - } - } - - return TRUE; - } - - /** - * Password check - * - * @param string Plain Text Password - * @return boolean Password matched or not - */ - protected function _checkPassword( $password_check ) - { - //----------------------------------------- - // Ok, check password first - //----------------------------------------- - - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' ); - $this->han_login = new $classToLoad( $this->registry ); - $this->han_login->init(); - - //----------------------------------------- - // Is this a username or email address? - //----------------------------------------- - - $this->han_login->loginPasswordCheck( $this->memberData['name'], $this->memberData['email'], $password_check ); - - if ( $this->han_login->return_code == 'SUCCESS' ) - { - return TRUE; - } - else - { - return FALSE; - } - } + + * Invision Power Services + * IP.Board v3.4.6 + * Core user control panel plugin + * Last Updated: $Date: 2013-10-24 08:12:23 -0400 (Thu, 24 Oct 2013) $ + *
+ * + * @author $Author: AndyMillne $ + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license http://www.invisionpower.com/company/standards.php#license + * @package IP.Board + * @subpackage Core + * @link http://www.invisionpower.com + * @since 20th February 2002 + * @version $Rev: 12391 $ + * + */ + +if ( ! defined( 'IN_IPB' ) ) +{ + print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +class usercpForms_core extends public_core_usercp_manualResolver implements interface_usercp +{ + /** + * Tab name + * This can be left blank and the application title will + * be used + * + * @var string + */ + public $tab_name = "Settings"; + + /** + * Default area code + * + * @var string + */ + public $defaultAreaCode = 'profileinfo'; + + /** + * OK Message + * This is an optional message to return back to the framework + * to replace the standard 'Settings saved' message + * + * @var string + */ + public $ok_message = ''; + + /** + * Hide 'save' button and form elements + * Useful if you have custom output that doesn't + * need to use it + * + * @var bool + */ + public $hide_form_and_save_button = false; + + /** + * If you wish to allow uploads, set a value for this + * + * @var integer + */ + public $uploadFormMax = 0; + + /** + * Flag to indicate that the user is a facebook logged in user doozer + * + * @var boolean + */ + protected $_isFBUser = false; + + /** + * Flag to indicate compatibility + * + * @var int + */ + public $version = 32; + + /** + * Initiate this module + * + * @return @e void + */ + public function init( ) + { + $this->tab_name = ipsRegistry::getClass('class_localization')->words['tab__core']; + + /* Facebook? */ + if ( IPSLib::fbc_enabled() === TRUE AND $this->memberData['fb_uid'] ) + { + $this->_isFBUser = true; + } + + if( !$this->memberData['g_edit_profile'] ) + { + $this->defaultAreaCode = 'email'; + } + } + + /** + * Return links for this tab + * You may return an empty array or FALSE to not have + * any links show in the tab. + * + * The links must have 'area=xxxxx'. The rest of the URL + * is added automatically. + * 'area' can only be a-z A-Z 0-9 - _ + * + * @author Matt Mecham + * @return array Links + */ + public function getLinks() + { + ipsRegistry::instance()->getClass('class_localization')->loadLanguageFile( array( 'public_usercp' ), 'core' ); + + $array = array(); + + if( $this->memberData['g_edit_profile'] ) + { + $array[] = array( 'url' => 'area=profileinfo', + 'title' => ipsRegistry::instance()->getClass('class_localization')->words['change_settings'], + 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'profileinfo' ? 1 : 0, + 'area' => 'profileinfo' + ); + } + + if ( $this->memberData['gbw_allow_customization'] AND ! $this->memberData['bw_disable_customization'] ) + { + $array[] = array( 'url' => 'area=customize', + 'title' => ipsRegistry::instance()->getClass('class_localization')->words['m_customize'], + 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'customize' ? 1 : 0, + 'area' => 'customize' + ); + } + + $array[] = array( 'url' => 'area=email', + 'title' => ipsRegistry::instance()->getClass('class_localization')->words['m_email_pass_change'], + 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'email' ? 1 : 0, + 'area' => 'email' + ); + + if ( $this->settings['auth_allow_dnames'] == 1 AND $this->memberData['g_dname_changes'] != 0 ) + { + $array[] = array( 'url' => 'area=displayname', + 'title' => ipsRegistry::instance()->getClass('class_localization')->words['ucp_change_name'], + 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'displayname' ? 1 : 0, + 'area' => 'displayname' + ); + } + + $sig_restrictions = explode( ':', $this->memberData['g_signature_limits'] ); + + if ( ( ! $sig_restrictions[0] OR ( $sig_restrictions[0] AND $this->memberData['g_sig_unit'] ) ) AND $this->memberData['g_edit_profile'] ) + { + $array[] = array( 'url' => 'area=signature', + 'title' => ipsRegistry::instance()->getClass('class_localization')->words['m_sig_info'], + 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'signature' ? 1 : 0, + 'area' => 'signature' + ); + } + + $array[] = array( 'url' => 'area=ignoredusers', + 'title' => ipsRegistry::instance()->getClass('class_localization')->words['m_ignore_users'], + 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'ignoredusers' ? 1 : 0, + 'area' => 'ignoredusers' + ); + + if ( IPSLib::fbc_enabled() === TRUE ) + { + $array[] = array( 'url' => 'area=facebook', + 'title' => ipsRegistry::instance()->getClass('class_localization')->words['m_facebook'], + 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'facebook' ? 1 : 0, + 'area' => 'facebook' + ); + } + + if ( IPSLib::twitter_enabled() === TRUE ) + { + $array[] = array( 'url' => 'area=twitter', + 'title' => ipsRegistry::instance()->getClass('class_localization')->words['m_twitter'], + 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'twitter' ? 1 : 0, + 'area' => 'twitter' + ); + } + + if ( $this->memberData['g_attach_max'] != -1 ) + { + $array[] = array( + 'url' => 'area=attachments', + 'title' => ipsRegistry::instance()->getClass('class_localization')->words['m_attach'], + 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'attachments' ? 1 : 0, + 'area' => 'attachments' + ); + } + + $array[] = array( 'url' => 'area=notifications', + 'title' => ipsRegistry::instance()->getClass('class_localization')->words['m_notifications'], + 'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'notifications' ? 1 : 0, + 'area' => 'notifications' + ); + + $array[] = array( 'url' => 'area=notificationlog', + 'title' => ipsRegistry::instance()->getClass('class_localization')->words['m_arch_notify'], + 'active' => ( in_array( $this->request['area'], array( 'notificationlog', 'viewNotification', 'removeNotifications' ) ) ) ? 1 : 0, + 'area' => 'notificationlog' + ); + + return $array; + } + + + /** + * Run custom event + * + * If you pass a 'do' in the URL / post form that is not either: + * save / save_form or show / show_form then this function is loaded + * instead. You can return a HTML chunk to be used in the UserCP (the + * tabs and footer are auto loaded) or redirect to a link. + * + * If you are returning HTML, you can use $this->hide_form_and_save_button = 1; + * to remove the form and save button that is automatically placed there. + * + * @author Matt Mecham + * @param string Current area + * @return mixed html or void + */ + public function runCustomEvent( $currentArea ) + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $html = ''; + + //----------------------------------------- + // What to do? + //----------------------------------------- + + switch( $currentArea ) + { + case 'removeIgnoredUser': + return $this->customEvent_removeIgnoredUser(); + break; + case 'toggleIgnoredUser': + return $this->customEvent_toggleIgnoredUser(); + break; + case 'facebookSync': + $html = $this->customEvent_facebookSync(); + break; + case 'facebookRemove': + $html = $this->customEvent_facebookRemove(); + break; + case 'twitterRemove': + $html = $this->customEvent_twitterRemove(); + break; + case 'facebookLink': + $html = $this->customEvent_facebookLink(); + break; + case 'updateAttachments': + return $this->customEvent_updateAttachments(); + break; + + case 'viewNotification': + $html = $this->customEvent_viewNotification(); + break; + + case 'markNotification': + return $this->customEvent_markNotification(); + break; + + case 'removeNotifications': + return $this->customEvent_removeNotifications(); + break; + } + + //----------------------------------------- + // Turn off save button + //----------------------------------------- + + $this->hide_form_and_save_button = 1; + + //----------------------------------------- + // Return + //----------------------------------------- + + return $html; + } + + /** + * Delete attachments + * + * @author Matt Mecham + * @return string Processed HTML + */ + public function customEvent_updateAttachments() + { + //----------------------------------------- + // Get the ID's to delete + //----------------------------------------- + + $finalIDs = array(); + + //----------------------------------------- + // Grab post IDs + //----------------------------------------- + + if ( is_array( $_POST['attach'] ) and count( $_POST['attach'] ) ) + { + foreach( $_POST['attach'] as $id => $value ) + { + $finalIDs[ $id ] = intval( $id ); + } + } + + if ( count($finalIDs) > 0 ) + { + $this->DB->build( array( 'select' => 'a.*', + 'from' => array( 'attachments' => 'a' ), + 'where' => "a.attach_id IN (" . implode( ",", $finalIDs ) .") AND a.attach_rel_module IN( 'post', 'msg' ) AND attach_member_id=" . $this->memberData['member_id'], + 'add_join' => array( + array( 'select' => 'p.topic_id, p.pid', + 'from' => array( 'posts' => 'p' ), + 'where' => "p.pid=a.attach_rel_id AND a.attach_rel_module='post'", + 'type' => 'left' + ), + array( 'select' => 'mt.msg_id, mt.msg_topic_id', + 'from' => array( 'message_posts' => 'mt' ), + 'where' => "mt.msg_id=a.attach_rel_id AND a.attach_rel_module='msg'", + 'type' => 'left' + ), + ) + ) ); + + $o = $this->DB->execute(); + + while ( $killmeh = $this->DB->fetch( $o ) ) + { + if ( $killmeh['attach_location'] ) + { + @unlink( $this->settings['upload_dir']."/".$killmeh['attach_location'] ); + } + if ( $killmeh['attach_thumb_location'] ) + { + @unlink( $this->settings['upload_dir']."/".$killmeh['attach_thumb_location'] ); + } + + if ( $killmeh['topic_id'] ) + { + $this->DB->update( 'topics', 'topic_hasattach=topic_hasattach-1', 'tid='.$killmeh['topic_id'], true, true ); + } + else if( $killmeh['msg_id'] ) + { + $this->DB->update( 'message_topics', 'mt_hasattach=mt_hasattach-1', 'mt_id='.$killmeh['msg_topic_id'], true, true ); + } + } + + $this->DB->delete( 'attachments', 'attach_id IN ('.implode(",",$finalIDs).') and attach_member_id='.$this->memberData['member_id'] ); + } + + $this->registry->getClass('output')->silentRedirect( $this->settings['base_url']."app=core&module=usercp&tab=core&area=attachments&do=show" ); + } + + /** + * UserCP handle our notifications + * + * @return boolean Successful + */ + public function customEvent_removeNotifications() + { + //----------------------------------------- + // Check form hash + //----------------------------------------- + + $this->request['secure_key'] = $this->request['secure_key'] ? $this->request['secure_key'] : $this->request['md5check']; + + if( $this->request['secure_key'] != $this->member->form_hash ) + { + $this->registry->output->showError( 'usercp_forums_bad_key', 1021523 ); + } + + //----------------------------------------- + // Notifications library + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' ); + $notifyLibrary = new $classToLoad( $this->registry ); + $notifyLibrary->setMember( $this->memberData ); + + //----------------------------------------- + // Delete the notifications + //----------------------------------------- + + $_toDelete = IPSLib::cleanIntArray( $this->request['notifications'] ); + + if( !count($_toDelete) ) + { + return $this->showInlineNotifications( $this->lang->words['no_notify_del'] ); + } + + $this->DB->delete( 'inline_notifications', "notify_id IN(" . implode( ',', $_toDelete ) . ") AND notify_to_id=" . $this->memberData['member_id'] ); + + //----------------------------------------- + // If member has 'unread' count, rebuild count + //----------------------------------------- + + if( $this->memberData['notification_cnt'] ) + { + $notifyLibrary->rebuildUnreadCount(); + } + + //----------------------------------------- + // Redirect + //----------------------------------------- + + $this->registry->getClass('output')->silentRedirect( $this->settings['base_url']."app=core&module=usercp&tab=core&area=notificationlog&confirm=1" ); + } + + /** + * Mark a notification + * + * @return string HTML + */ + public function customEvent_markNotification() + { + //----------------------------------------- + // Notifications library + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' ); + $notifyLibrary = new $classToLoad( $this->registry ); + $notifyLibrary->setMember( $this->memberData ); + + //----------------------------------------- + // Get notification + //----------------------------------------- + + /* Marking them all as read? */ + if ( $this->request['mark'] == 'all' ) + { + $this->DB->update( 'inline_notifications', array( 'notify_read' => time() ), 'notify_to_id=' . $this->memberData['member_id'] ); + } + else + { + $id = intval($this->request['mark']); + $notification = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'inline_notifications', 'where' => 'notify_id=' . $id ) ); + + //----------------------------------------- + // Error checking + //----------------------------------------- + + if( !$notification['notify_id'] ) + { + if( $this->request['ajax'] ) + { + print 'ok'; + exit; + } + else + { + $this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] . "app=core&module=usercp&tab=core&area=notificationlog" ); + } + } + + if( $notification['notify_to_id'] != $this->memberData['member_id'] ) + { + if( $this->request['ajax'] ) + { + print 'ok'; + exit; + } + else + { + $this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] . "app=core&module=usercp&tab=core&area=notificationlog" ); + } + } + + //----------------------------------------- + // Update read timestamp + //----------------------------------------- + + $this->DB->update( 'inline_notifications', array( 'notify_read' => time() ), 'notify_id=' . $id ); + } + + //----------------------------------------- + // If member has 'unread' count, rebuild count + //----------------------------------------- + + if( $this->memberData['notification_cnt'] ) + { + $notifyLibrary->rebuildUnreadCount(); + } + + if( $this->request['ajax'] ) + { + print 'ok'; + exit; + } + else + { + $this->registry->output->silentRedirect( $this->settings['base_url'] . "app=core&module=usercp&tab=core&area=notificationlog" ); + } + } + + /** + * View a notification + * + * @return string HTML + */ + public function customEvent_viewNotification() + { + //----------------------------------------- + // Notifications library + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' ); + $notifyLibrary = new $classToLoad( $this->registry ); + $notifyLibrary->setMember( $this->memberData ); + + //----------------------------------------- + // Get notification + //----------------------------------------- + + $id = intval($this->request['view']); + $notification = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'inline_notifications', 'where' => 'notify_id=' . $id ) ); + + //----------------------------------------- + // Error checking + //----------------------------------------- + + if( !$notification['notify_id'] ) + { + $this->registry->output->showError( 'bad_notify_id', 10191 ); + } + + if( $notification['notify_to_id'] != $this->memberData['member_id'] ) + { + $this->registry->output->showError( 'bad_notify_id', 10192 ); + } + + //----------------------------------------- + // Update read timestamp + //----------------------------------------- + + $this->DB->update( 'inline_notifications', array( 'notify_read' => time() ), 'notify_id=' . $id ); + + //----------------------------------------- + // If member has 'unread' count, rebuild count + //----------------------------------------- + + if( $this->memberData['notification_cnt'] ) + { + $notifyLibrary->rebuildUnreadCount(); + } + + //----------------------------------------- + // Parse for display + //----------------------------------------- + + /* As the email template parser makes an attempt to reparse 'safe' HTML, we need to make it safe here */ + $notification['notify_text'] = IPSText::htmlspecialchars( $notification['notify_text'] ); + + IPSText::getTextClass('bbcode')->parse_smilies = 1; + IPSText::getTextClass('bbcode')->parse_nl2br = 1; + IPSText::getTextClass('bbcode')->parse_html = 0; + IPSText::getTextClass('bbcode')->parse_bbcode = 1; + IPSText::getTextClass('bbcode')->parsing_section = 'global'; + + $notification['notify_text'] = IPSText::getTextClass('bbcode')->preDisplayParse( nl2br( $notification['notify_text'] ) ); + + //----------------------------------------- + // Show notification + //----------------------------------------- + + $this->_nav[] = array( $this->lang->words['m_arch_notify'], 'app=core&module=usercp&tab=core&area=notificationlog' ); + return $this->registry->getClass('output')->getTemplate('ucp')->showNotification( $notification ); + } + + /** + * Custom Event: Remove Twitter link + * + * @return @e void + */ + public function customEvent_twitterRemove() + { + //----------------------------------------- + // Check secure hash... + //----------------------------------------- + + if ( $this->request['secure_key'] != $this->member->form_hash ) + { + $this->registry->output->showError( 'authorization_error', 100, true, null, 403 ); + } + + //----------------------------------------- + // Okay... + //----------------------------------------- + + if ( $this->memberData['twitter_id'] ) + { + /* Remove the link */ + IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'twitter_id' => 0, 'twitter_token' => '', 'twitter_secret' => '' ) ) ); + } + + /* Log the user out */ + $this->registry->getClass('output')->silentRedirect( $this->settings['base_url']."app=core&module=global§ion=login&do=logout&k=" . $this->member->form_hash ); + } + + /** + * Custom Event: Create facebook link + * + * @return @e void + */ + public function customEvent_facebookLink() + { + //----------------------------------------- + // Check secure hash... + //----------------------------------------- + + if ( $this->request['secure_key'] != $this->member->form_hash ) + { + $this->registry->output->showError( 'authorization_error', 100, true, null, 403 ); + } + + /* Load application */ + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php', 'facebook_connect' ); + $facebook = new $classToLoad( $this->registry ); + + try + { + $facebook->linkMember( $this->memberData['member_id'] ); + } + catch( Exception $error ) + { + $msg = $error->getMessage(); + + switch( $msg ) + { + default: + case 'NO_FACEBOOK_USER_LOGGED_IN': + case 'ALREADY_LINKED': + $this->registry->getClass('output')->showError( 'fbc_authorization_screwup', 1005.99, null, null, 403 ); + break; + } + } + + //----------------------------------------- + // Return + //----------------------------------------- + + $this->registry->getClass('output')->silentRedirect( $this->settings['base_url']."app=core&module=usercp&tab=core&area=facebook&do=show" ); + } + + /** + * Custom Event: Remove facebook link + * + * @return @e void + */ + public function customEvent_facebookRemove() + { + //----------------------------------------- + // Check secure hash... + //----------------------------------------- + + if ( $this->request['secure_key'] != $this->member->form_hash ) + { + $this->registry->output->showError( 'authorization_error', 100, true, null, 403 ); + } + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php', 'facebook_connect' ); + $facebook = new $classToLoad( $this->registry ); + + //----------------------------------------- + // Okay... + //----------------------------------------- + + if ( $this->memberData['fb_uid'] ) + { + /* Unauthorize application */ + $facebook->revokeAuthorization(); + + /* Remove the link */ + IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'fb_uid' => 0, 'fb_emailhash' => '', 'fb_token' => '', 'fb_lastsync' => 0 ) ) ); + } + + /* Log the user out */ + $this->registry->getClass('output')->silentRedirect( $this->settings['base_url']."app=core&module=global§ion=login&do=logout&k=" . $this->member->form_hash ); + } + + /** + * Custom Event: Sync up facebook + * NO LONGER USED. LEFT FOR FIX CONFIRMATION + * + * @return @e void + */ + public function customEvent_facebookSync() + { + if ( IPSLib::fbc_enabled() === TRUE ) + { + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php', 'facebook_connect' ); + $facebook = new $classToLoad( $this->registry ); + + try + { + $facebook->syncMember( $this->memberData ); + } + catch( Exception $error ) + { + $msg = $error->getMessage(); + + switch( $msg ) + { + case 'NOT_LINKED': + case 'NO_MEMBER': + default: + $this->registry->getClass('output')->showError( 'fbc_authorization_screwup', 1005, null, null, 403 ); + break; + } + } + + //----------------------------------------- + // Return + //----------------------------------------- + + $this->registry->getClass('output')->silentRedirect( $this->settings['base_url']."app=core&module=usercp&tab=core&area=facebook&do=show" ); + } + } + + /** + * Custom Event: Run the find user tool + * + * @return @e void + */ + public function customEvent_toggleIgnoredUser() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $member_id = intval( $this->request['id'] ); + $field = $this->request['field']; + $update = array(); + + //----------------------------------------- + // Grab user + //----------------------------------------- + + $ignoredUser = $this->DB->buildAndFetch( array( 'select' => '*', + 'from' => 'ignored_users', + 'where' => 'ignore_ignore_id=' . $member_id . ' AND ignore_owner_id=' . $this->memberData['member_id'] ) ); + + if ( $ignoredUser['ignore_id'] ) + { + switch( $field ) + { + default: + case 'topics': + $update = array( 'ignore_topics' => ( $ignoredUser['ignore_topics'] == 1 ) ? 0 : 1 ); + break; + case 'messages': + $update = array( 'ignore_messages' => ( $ignoredUser['ignore_messages'] == 1 ) ? 0 : 1 ); + break; + case 'signatures': + $update = array( 'ignore_signatures' => ( $ignoredUser['ignore_signatures'] == 1 ) ? 0 : 1 ); + break; + case 'chats': + $update = array( 'ignore_chats' => ( $ignoredUser['ignore_chats'] == 1 ) ? 0 : 1 ); + break; + } + + //----------------------------------------- + // Update + //----------------------------------------- + + $this->DB->update( 'ignored_users', $update, 'ignore_id=' . $ignoredUser['ignore_id'] ); + + /* Rebuild cache */ + IPSMember::rebuildIgnoredUsersCache( $this->memberData ); + } + + //----------------------------------------- + // Return + //----------------------------------------- + + $this->registry->getClass('output')->silentRedirect( $this->settings['base_url']."app=core&module=usercp&tab=core&area=ignoredusers&do=show&st={$this->request['st']}" ); + } + + /** + * Custom event: Remove ignored user + * + * @author Matt Mecham + * @return string Processed HTML + */ + public function customEvent_removeIgnoredUser() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $removeID = intval( $this->request['id'] ); + + $this->DB->delete( 'ignored_users', 'ignore_owner_id=' . $this->memberData['member_id'] . ' AND ignore_ignore_id=' . $removeID ); + + /* Rebuild cache */ + IPSMember::rebuildIgnoredUsersCache( $this->memberData ); + + $this->registry->getClass('output')->silentRedirect( $this->settings['base_url']."app=core&module=usercp&tab=core&area=ignoredusers&do=show" ); + } + + /** + * UserCP Form Show + * + * @author Matt Mecham + * @param string Current area as defined by 'get_links' + * @param array Array of errors + * @return string Processed HTML + */ + public function showForm( $current_area, $errors=array() ) + { + //----------------------------------------- + // Where to go, what to see? + //----------------------------------------- + + if( !$current_area AND !$this->memberData['g_edit_profile'] ) + { + $current_area = 'email'; + } + + switch( $current_area ) + { + default: + case 'profileinfo': + return $this->formProfileInfo(); + break; + case 'signature': + return $this->formSignature(); + break; + case 'photo': + return $this->formPhoto(); + break; + case 'ignoredusers': + return $this->formIgnoredUsers(); + break; + case 'facebook': + return $this->formFacebook(); + break; + case 'twitter': + return $this->formTwitter(); + break; + case 'customize': + return $this->formCustomize(); + break; + case 'email': + return $this->showFormEmailPassword(); + break; + case 'displayname': + return $this->showFormDisplayname(); + break; + case 'attachments': + return $this->showFormAttachments(); + break; + case 'notifications': + return $this->showFormNotifications(); + break; + case 'notificationlog': + return $this->showInlineNotifications(); + break; + } + } + + /** + * Show the customization form + * + * @author Matt Mecham + * @param string Any inline message to show + * @return string Processed HTML + */ + public function formCustomize( $inlineMsg='' ) + { + /* Allow uploads */ + $this->uploadFormMax = 10000 * 1024; + + if ( ! $this->memberData['gbw_allow_customization'] OR $this->memberData['bw_disable_customization'] ) + { + $this->registry->getClass('output')->showError( 'no_permission', 1005.5 ); + } + + /* Grab current options */ + $options = IPSLib::safeUnserialize( $this->memberData['pp_customization'] ); + $options = is_array( $options ) ? $options : array(); + + /* Build input */ + foreach( $options as $k => $v ) + { + $input[ $k ] = ( $this->request[ $k ] ) ? $this->request[ $k ] : $v; + } + + /* Figure out preview URL */ + if ( $options['type'] == 'url' AND $options['bg_url'] ) + { + $input['_preview'] = $options['bg_url']; + } + else if ( $options['type'] == 'upload' AND $options['bg_url'] ) + { + $input['_preview'] = $this->settings['upload_url'] . '/' . $options['bg_url']; + $input['bg_url'] = ''; + } + + /* Show form */ + return $this->registry->getClass('output')->getTemplate('ucp')->membersProfileCustomize( $options, $input, $inlineMsg ); + } + + /** + * Show the twitter form + * + * @author Matt Mecham + * @param string Any inline message to show + * @return string Processed HTML + */ + public function formTwitter( $inlineMsg='' ) + { + //----------------------------------------- + // INIT + //----------------------------------------- + + if( !IPSLib::twitter_enabled() ) + { + $this->registry->getClass('output')->showError( 'twitter_disabled', 1005.1 ); + } + + //----------------------------------------- + // Twitter user logged in? + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/twitter/connect.php', 'twitter_connect' ); + $twitter = new $classToLoad( $this->registry, $this->memberData['twitter_token'], $this->memberData['twitter_secret'] ); + + //----------------------------------------- + // Thaw bitfield options + //----------------------------------------- + + $bwOptions = IPSBWOptions::thaw( $this->memberData['tc_bwoptions'], 'twitter' ); + + //----------------------------------------- + // Merge.. + //----------------------------------------- + + if ( is_array( $bwOptions ) ) + { + foreach( $bwOptions as $k => $v ) + { + $this->memberData[ $k ] = $v; + } + } + + if( ! $twitter->isConnected() ) + { + $this->hide_form_and_save_button = 1; + } + + $userData = $twitter->fetchUserData(); + + if ( isset( $userData['status']['text'] ) ) + { + if ( IPS_DOC_CHAR_SET != 'UTF-8' ) + { + $userData['status']['text'] = IPSText::utf8ToEntities( $userData['status']['text'] ); + } + + /* Make safe */ + $userData['status']['text'] = str_replace( array( '<', '>' ), array( '<', '>' ), $userData['status']['text'] ); + } + + return $this->registry->getClass('output')->getTemplate('ucp')->membersTwitterConnect( $twitter->isConnected(), $userData ); + } + + + /** + * Show the member form + * + * @author Matt Mecham + * @param string Any inline message to show + * @return string Processed HTML + */ + public function formFacebook( $inlineMsg='' ) + { + //----------------------------------------- + // INIT + //----------------------------------------- + + if( !IPSLib::fbc_enabled() ) + { + $this->registry->getClass('output')->showError( 'fbc_disabled', 1005.2 ); + } + + //----------------------------------------- + // Shut off save button if not associated yet + //----------------------------------------- + + if( !$this->memberData['fb_uid'] ) + { + $this->hide_form_and_save_button = true; + $userData = array(); + $linkedMemberData = array(); + $perms = array(); + } + else + { + //----------------------------------------- + // FB user logged in? + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php', 'facebook_connect' ); + $facebook = new $classToLoad( $this->registry ); + + /* Now get the linked user */ + $linkedMemberData = IPSMember::load( intval($this->memberData['fb_uid']), 'all', 'fb_uid' ); + + $userData = $facebook->fetchUserData(); + + /* Email */ + $perms['email'] = $facebook->fetchHasAppPermission( 'email' ); + + /* Publish Stream */ + $perms['publish_stream'] = $facebook->fetchHasAppPermission( 'publish_stream' ); + + /* Read stream */ + $perms['read_stream'] = $facebook->fetchHasAppPermission( 'read_stream' ); + + /* Offline access */ + $perms['offline_access'] = $facebook->fetchHasAppPermission( 'offline_access' ); + + + //----------------------------------------- + // Thaw bitfield options + //----------------------------------------- + + $bwOptions = IPSBWOptions::thaw( $this->memberData['fb_bwoptions'], 'facebook' ); + + //----------------------------------------- + // Merge.. + //----------------------------------------- + + if ( is_array( $bwOptions ) ) + { + foreach( $bwOptions as $k => $v ) + { + $this->memberData[ $k ] = $v; + } + } + + //----------------------------------------- + // Able to update status? + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/member/status.php', 'memberStatus' ); + $this->registry->setClass( 'memberStatus', new $classToLoad( $this->registry ) ); + + $this->registry->memberStatus->setAuthor( $this->memberData ); + $this->memberData['can_updated_status'] = $this->registry->memberStatus->canCreate(); + + $_updates = $facebook->fetchUserTimeline( $userData['id'], 0, true ); + + /* Got any? */ + if ( count( $_updates ) ) + { + $update = array_shift( $_updates ); + + if ( count( $update ) AND is_array( $update ) ) + { + $userData['status'] = $update; + } + } + + if ( is_array( $userData ) AND $userData['status']['message'] AND IPS_DOC_CHAR_SET != 'UTF-8' ) + { + $userData['status']['message'] = IPSText::utf8ToEntities( $userData['status']['message'] ); + } + + /* Make safe */ + $userData['status']['message'] = str_replace( array( '<', '>' ), array( '<', '>' ), $userData['status']['message'] ); + } + + return $this->registry->getClass('output')->getTemplate('ucp')->membersFacebookConnect( trim($this->memberData['fb_uid']), $userData, $linkedMemberData, $perms ); + } + + /** + * Show the ignored users + * + * @author Matt Mecham + * @return string Processed HTML + */ + public function formIgnoredUsers() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $final_users = array(); + $temp_users = array(); + $uid = intval( $this->request['uid'] ); + $ignoredUsers = array(); + + //----------------------------------------- + // Do we have incoming? + //----------------------------------------- + + if ( $uid ) + { + $newmem = IPSMember::load( $uid ); + + $this->request['newbox_1'] = $newmem['members_display_name']; + } + + //----------------------------------------- + // Get ignored users + //----------------------------------------- + + $perPage = 25; + + /* Count */ + $count = $this->DB->buildAndFetch( array( 'select' => 'count(*) as dracula', 'from' => 'ignored_users', 'where' => 'ignore_owner_id=' . $this->memberData['member_id'] ) ); + + /* Sort out pagination */ + $st = intval($this->request['st']) >=0 ? intval($this->request['st']) : 0; + $pagination = $this->registry->output->generatePagination( array( + 'totalItems' => $count['dracula'], + 'itemsPerPage' => $perPage, + 'currentStartValue' => $st, + 'baseUrl' => 'app=core&module=usercp&tab=core&area=ignoredusers', + ) ); + + /* Get em */ + $this->DB->build( array( 'select' => '*', 'from' => 'ignored_users', 'where' => 'ignore_owner_id=' . $this->memberData['member_id'], 'limit' => array( $st, $perPage ) ) ); + $this->DB->execute(); + + while( $row = $this->DB->fetch() ) + { + $ignoredUsers[ $row['ignore_ignore_id'] ] = $row; + } + + //----------------------------------------- + // Get members and check to see if they've + // since been moved into a group that cannot + // be ignored + //----------------------------------------- + + foreach( $ignoredUsers as $_id => $data ) + { + if ( intval($_id) ) + { + $temp_users[] = $_id; + } + } + + if ( count($temp_users) ) + { + $members = IPSMember::load( $temp_users, 'all' ); + + foreach( $members as $m ) + { + $m['g_title'] = IPSMember::makeNameFormatted( $this->caches['group_cache'][ $m['member_group_id'] ]['g_title'], $m['member_group_id'] ); + + $final_users[ $m['member_id'] ] = IPSMember::buildDisplayData( $m ); + $final_users[ $m['member_id'] ]['ignoreData'] = $ignoredUsers[ $m['member_id'] ]; + } + } + + $this->request['newbox_1'] = $this->request['newbox_1'] ? $this->request['newbox_1'] : ''; + + return $this->registry->getClass('output')->getTemplate('ucp')->membersIgnoredUsersForm( $final_users, $pagination ); + } + + + /** + * Show the signature page + * + * @author Matt Mecham + * @return string Processed HTML + */ + public function formSignature() + { + /* Load editor stuff */ + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' ); + $this->editor = new $classToLoad(); + + /* HTML checkbox language strings */ + $this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_post' ), 'forums' ); + + //----------------------------------------- + // Check to make sure that we can edit profiles.. + //----------------------------------------- + + $sig_restrictions = explode( ':', $this->memberData['g_signature_limits'] ); + + if ( ! $this->memberData['g_edit_profile'] OR ( $sig_restrictions[0] AND ! $this->memberData['g_sig_unit'] ) ) + { + $this->registry->getClass('output')->showError( 'members_profile_disabled', 1024, null, null, 403 ); + } + + /* Signature Limits */ + if ( $sig_restrictions[0] AND $this->memberData['g_sig_unit'] ) + { + if ( $this->memberData['gbw_sig_unit_type'] ) + { + /* days */ + if ( $this->memberData['joined'] > ( time() - ( 86400 * $this->memberData['g_sig_unit'] ) ) ) + { + $this->hide_form_and_save_button = 1; + $form['_noPerm'] = sprintf( $this->lang->words['sig_group_restrict_date'], $this->lang->getDate( $this->memberData['joined'] + ( 86400 * $this->memberData['g_sig_unit'] ), 'long' ) ); + } + } + else + { + /* Posts */ + if ( $this->memberData['posts'] < $this->memberData['g_sig_unit'] ) + { + $this->hide_form_and_save_button = 1; + $form['_noPerm'] = sprintf( $this->lang->words['sig_group_restrict_posts'], $this->memberData['g_sig_unit'] - $this->memberData['posts'] ); + } + } + + if( $form['_noPerm'] ) + { + return $this->registry->getClass('output')->getTemplate('ucp')->membersSignatureFormError( $form ); + } + } + + //----------------------------------------- + // Set max length + //----------------------------------------- + + $current_sig = ''; + $t_sig = ''; + + /* Set content in editor */ + $this->editor->setLegacyMode(false); + $this->editor->setAllowBbcode( true ); + $this->editor->setAllowSmilies( true ); + $this->editor->setAllowHtml( $this->memberData['g_dohtml'] ); + $this->editor->setIsHtml( $this->memberData['bw_html_sig'] ); + $this->editor->setBbcodeSection('signatures'); + $this->editor->setContent( $this->memberData['signature'] ); + + /* Load parser */ + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/text/parser.php', 'classes_text_parser' ); + $parser = new $classToLoad(); + + $parser->set( array( 'memberData' => $this->memberData, + 'parseBBCode' => 1, + 'parseHtml' => ( $this->memberData['g_dohtml'] && $this->memberData['bw_html_sig'] ), + 'parseArea' => 'signatures', + 'parseEmoticons' => 1 ) ); + + $signature = $parser->display( $this->memberData['signature'] ); + + return $this->registry->getClass('output')->getTemplate('ucp')->membersSignatureForm( $this->editor->show( 'Post', array( 'noSmilies' => false ) ), $sig_restrictions, $signature ); + } + + + /** + * Show the profile information + * + * @author Matt Mecham + * @return string Processed HTML + */ + public function formProfileInfo() + { + /* Load Lang File */ + $this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' ); + + /* Load editor stuff */ + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' ); + $this->editor = new $classToLoad(); + + /* INIT */ + $required_output = ""; + $optional_output = ""; + + /* Permission Check */ + if( ! $this->memberData['g_edit_profile'] ) + { + $this->registry->getClass('output')->showError( 'members_profile_disabled', 1026, null, null, 403 ); + } + + /* Format the birthday drop boxes.. */ + $date = getdate(); + + $day = array(); + $mon = array(); + $year = array(); + $times = array(); + + /* Build the day options */ + $day[] = array( '0', '--' ); + for ( $i = 1 ; $i < 32 ; $i++ ) + { + $day[] = array( $i, $i ); + } + + /* Build the month options */ + $mon[] = array( '0', '--' ); + for( $i = 1 ; $i < 13 ; $i++ ) + { + $mon[] = array( $i, $this->lang->words['M_' . $i ] ); + } + + /* Build the years options */ + $i = $date['year'] - 1; + $j = $date['year'] - 100; + + $year[] = array( '0', '--' ); + for( $i ; $j < $i ; $i-- ) + { + $year[] = array( $i, $i ); + } + + /* Custom Fields */ + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/customfields/profileFields.php', 'customProfileFields' ); + $fields = new $classToLoad(); + + $fields->member_data = $this->member->fetchMemberData(); + $fields->initData( 'edit' ); + $fields->parseToEdit(); + + $field_output = array(); + + if ( count( $fields->out_fields ) ) + { + foreach( $fields->out_fields as $id => $element ) + { + $data = $fields->cache_data[ $id ]; + $field_output[ $data['pf_group_key'] ][ $id ] = array( + 'field' => $this->registry->getClass('output')->getTemplate('ucp')->field_entry( $fields->field_names[ $id ], $fields->field_desc[ $id ], $fields->out_fields[ $id ], $id ), + 'required' => $data['pf_not_null'] + ); + } + + /*foreach( $fields->out_fields as $id => $data ) + { + if ( $fields->cache_data[ $id ]['pf_not_null'] == 1 ) + { + $ftype = 'required_output'; + } + else + { + $ftype = 'optional_output'; + } + + ${$ftype} .= $this->registry->getClass('output')->getTemplate('ucp')->field_entry( $fields->field_names[ $id ], $fields->field_desc[ $id ], $data, $id ); + }*/ + } + + /* About me */ + $this->editor->setContent( $this->memberData['pp_about_me'] ); + + $amEditor = $this->editor->show( 'Post', array( 'delayInit' => 1 ) ); + + /* Times */ + foreach ( $this->lang->words as $k => $v ) + { + if ( strpos( $k, "time_" ) === 0 ) + { + $k = str_replace( "time_", '', $k ); + + if( preg_match( '/^[\-\d\.]+$/', $k ) ) + { + $times[ $k ] = $v; + } + } + } + + ksort( $times ); + + /* Build and return the form */ + $template = $this->registry->getClass('output')->getTemplate('ucp')->membersProfileForm( $field_output, $fields->fetchGroupTitles(), $day, $mon, $year, $amEditor, $times ); + + return $template; + } + + /** + * Show the logged inline notifications + * + * @author Brandon Farber + * @param string Error message + * @return string Processed HTML + */ + public function showInlineNotifications( $error='' ) + { + /* Init */ + $start = intval( $this->request['st'] ); + $perPage = 50; + + //----------------------------------------- + // Get class + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' ); + $notifyLibrary = new $classToLoad( $this->registry ); + $notifyLibrary->setMember( $this->memberData ); + + /* Clear them? - used in mobile skin */ + if ( isset($this->request['clear']) && trim($this->request['clear']) == 'true' ) + { + $this->DB->update( 'inline_notifications', array( 'notify_read' => 1 ), 'notify_to_id=' . $this->memberData['member_id'] ); + + $notifyLibrary->rebuildUnreadCount(); + } + + //----------------------------------------- + // Turn off normal form + //----------------------------------------- + + $this->hide_form_and_save_button = 1; + + //----------------------------------------- + // Get notifications + //----------------------------------------- + + $_notifications = array(); + $mids = array(); + + $count = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as er', + 'from' => 'inline_notifications', + 'where' => 'notify_to_id=' . $this->memberData['member_id'] ) ); + + if ( $count['er'] ) + { + $this->DB->build( array( 'select' => '*', + 'from' => 'inline_notifications', + 'where' => 'notify_to_id=' . $this->memberData['member_id'], + 'limit' => array( $start, $perPage ), + 'order' => 'notify_sent DESC' ) ); + $outer = $this->DB->execute(); + + while( $r = $this->DB->fetch($outer) ) + { + $r['notify_icon'] = $notifyLibrary->getNotificationIcon( $r['notify_type_key'] ); + + $_notifications[] = $r; + + $mids[ $r['notify_from_id'] ] = $r['notify_from_id']; + } + + /* Get members */ + if ( count( $mids ) ) + { + $members = IPSMember::load( array_keys( $mids ), 'all' ); + + if ( count( $members ) ) + { + foreach( $_notifications as $key => $data ) + { + if ( isset($members[ $data['notify_from_id'] ]) ) + { + $_notifications[ $key ]['member'] = IPSMember::buildProfilePhoto( $members[ $data['notify_from_id'] ] ); + } + } + } + } + } + + $pages = $this->registry->getClass('output')->generatePagination( array( 'totalItems' => $count['er'], + 'itemsPerPage' => $perPage, + 'currentStartValue' => $start, + 'baseUrl' => "app=core&module=usercp&tab=core&area=notificationlog" + ) ); + + //----------------------------------------- + // Send to template + //----------------------------------------- + + return $this->registry->getClass('output')->getTemplate('ucp')->notificationsLog( $_notifications, $error, $pages ); + } + + /** + * Show notification configuration form + * + * @author Brandon Farber + * @return string Processed HTML + * + * @note Updating this function update also mobileApiRequest::_handleNotificationTypes() + */ + public function showFormNotifications() + { + //----------------------------------------- + // Notifications library + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' ); + $notifyLibrary = new $classToLoad( $this->registry ); + $notifyLibrary->setMember( $this->memberData ); + + //----------------------------------------- + // Show the form + //----------------------------------------- + + $_basicOptions = array( array( 'email', $this->lang->words['notopt__email'] ), array( 'inline', $this->lang->words['notopt__inline'] ), array( 'mobile', $this->lang->words['notopt__mobile'] ) ); + $_configOptions = $notifyLibrary->getNotificationData( TRUE ); + $_notifyConfig = $notifyLibrary->getMemberNotificationConfig( $this->memberData ); + $_defaultConfig = $notifyLibrary->getDefaultNotificationConfig(); + $_formOptions = array(); + + foreach( $_configOptions as $option ) + { + $_thisConfig = isset($_notifyConfig[ $option['key'] ]) ? $_notifyConfig[ $option['key'] ] : $_defaultConfig[ $option['key'] ]; + + //----------------------------------------- + // Determine available options + //----------------------------------------- + + $_available = array(); + + foreach( $_basicOptions as $_bo ) // ewwww :P + { + if( !is_array($_defaultConfig[ $option['key'] ]['disabled']) OR !in_array( $_bo[0], $_defaultConfig[ $option['key'] ]['disabled'] ) ) + { + $_available[] = $_bo; + } + } + + //----------------------------------------- + // If none available, at least give inline + //----------------------------------------- + + if( !count($_available) ) + { + $_available[] = array( 'inline', $this->lang->words['notify__inline'] ); + } + + //----------------------------------------- + // Start setting data to pass to form + //----------------------------------------- + + $_formOptions[ $option['key'] ] = array(); + $_formOptions[ $option['key'] ]['key'] = $option['key']; + $_formOptions[ $option['key'] ]['app'] = $option['app']; + + //----------------------------------------- + // Rikki asked for this... + //----------------------------------------- + + foreach( $_available as $_availOption ) + { + $_formOptions[ $option['key'] ]['options'][ $_availOption[0] ] = $_availOption; + } + + //$_formOptions[ $option['key'] ]['options'] = $_available; + + $_formOptions[ $option['key'] ]['defaults'] = is_array($_thisConfig['selected']) ? $_thisConfig['selected'] : array(); + $_formOptions[ $option['key'] ]['disabled'] = 0; + + //----------------------------------------- + // Don't allow member to configure + // Still show, but disable on form + //----------------------------------------- + + if( $_defaultConfig[ $option['key'] ]['disable_override'] ) + { + $_formOptions[ $option['key'] ]['disabled'] = 1; + $_formOptions[ $option['key'] ]['defaults'] = is_array($_defaultConfig[ $option['key'] ]['selected']) ? $_defaultConfig[ $option['key'] ]['selected'] : array(); + } + } + + //----------------------------------------- + // Other settings + //----------------------------------------- + + $_emailData = array(); + + //----------------------------------------- + // Email settings... + //----------------------------------------- + + $_emailData['auto_track'] = $this->memberData['auto_track'] ? 'checked="checked"' : ''; + + foreach( array( 'none', 'immediate', 'offline', 'daily', 'weekly' ) as $_opt ) + { + $_emailData['trackOption'][ $_opt ] = ( $this->memberData['auto_track'] == $_opt ) ? 'selected="selected"' : ''; + } + + return $this->registry->getClass('output')->getTemplate('ucp')->notificationsForm( $_formOptions, $_emailData ); + } + + /** + * Show the attachments form + * + * @author Matt Mecham + * @return string Processed HTML + */ + public function showFormAttachments() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $info = array(); + $start = intval( $this->request['st'] ); + $perpage = 15; + $sort_key = ""; + $attachments = array(); + + $this->hide_form_and_save_button = 1; + + //----------------------------------------- + // Sort it + //----------------------------------------- + + switch ( $this->request['sort'] ) + { + case 'date': + $sort_key = 'a.attach_date ASC'; + $info['date_order'] = 'rdate'; + $info['size_order'] = 'size'; + break; + case 'rdate': + $sort_key = 'a.attach_date DESC'; + $info['date_order'] = 'date'; + $info['size_order'] = 'size'; + break; + case 'size': + $sort_key = 'a.attach_filesize DESC'; + $info['date_order'] = 'date'; + $info['size_order'] = 'rsize'; + break; + case 'rsize': + $sort_key = 'a.attach_filesize ASC'; + $info['date_order'] = 'date'; + $info['size_order'] = 'size'; + break; + default: + $sort_key = 'a.attach_date DESC'; + $info['date_order'] = 'date'; + $info['size_order'] = 'size'; + break; + } + + //----------------------------------------- + // Get some stats... + //----------------------------------------- + + $maxspace = intval($this->memberData['g_attach_max']); + + if ( $this->memberData['g_attach_max'] == -1 ) + { + $this->registry->getClass('output')->showError( 'no_permission_to_attach', 1010 ); + } + + //----------------------------------------- + // Limit by forums + //----------------------------------------- + + $stats = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count, ' . $this->DB->buildCoalesce( array( 'sum(attach_filesize)', 0 ) ) . ' as sum', + 'from' => 'attachments', + 'where' => 'attach_member_id=' . $this->memberData['member_id'] . " AND attach_rel_module IN( 'post', 'msg' )" ) ); + + + if ( $maxspace > 0 ) + { + //----------------------------------------- + // Figure out percentage used + //----------------------------------------- + + $info['has_limit'] = 1; + $info['full_percent'] = $stats['sum'] ? sprintf( "%.0f", ( ( $stats['sum'] / ($maxspace * 1024) ) * 100) ) : 0; + + if ( $info['full_percent'] > 100 ) + { + $info['full_percent'] = 100; + } + else if ( $info['full_percent'] < 1 AND $stats['count'] > 0 ) + { + $info['full_percent'] = 1; + } + + $info['attach_space_count'] = sprintf( $this->lang->words['attach_space_count'], intval($stats['count']), intval($info['full_percent']) ); + $info['attach_space_used'] = sprintf( $this->lang->words['attach_space_used'] , IPSLib::sizeFormat($stats['sum']), IPSLib::sizeFormat($maxspace * 1024) ); + } + else + { + $info['has_limit'] = 0; + $info['attach_space_used'] = sprintf( $this->lang->words['attach_space_unl'] , IPSLib::sizeFormat($stats['sum']) ); + } + + //----------------------------------------- + // Pages + //----------------------------------------- + + $pages = $this->registry->getClass('output')->generatePagination( array( 'totalItems' => $stats['count'], + 'itemsPerPage' => $perpage, + 'currentStartValue' => $start, + 'baseUrl' => "app=core&module=usercp&tab=core&area=attachments&sort=" . $this->request['sort'] . "", + ) ); + + //----------------------------------------- + // Get attachments... + //----------------------------------------- + + if( $stats['count'] ) + { + $this->DB->build( array( 'select' => 'a.*', + 'from' => array( 'attachments' => 'a' ), + 'where' => "a.attach_member_id=" . $this->memberData['member_id'] . " AND a.attach_rel_module IN( 'post', 'msg' )", + 'order' => $sort_key, + 'limit' => array( $start, $perpage ), + 'add_join' => array( + array( 'select' => 'p.topic_id', + 'from' => array( 'posts' => 'p' ), + 'where' => 'p.pid=a.attach_rel_id', + 'type' => 'left' + ), + array( 'select' => 't.*', + 'from' => array( 'topics' => 't' ), + 'where' => 't.tid=p.topic_id', + 'type' => 'left' + ) ) + ) ); + $outer = $this->DB->execute(); + + $this->registry->getClass( 'class_localization')->loadLanguageFile( array( 'public_topic' ), 'forums' ); + + $cache = $this->cache->getCache('attachtypes'); + + /* Load topic class */ + if ( ! $this->registry->isClassLoaded('topics') ) + { + $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/topics.php", 'app_forums_classes_topics', 'forums' ); + $this->registry->setClass( 'topics', new $classToLoad( $this->registry ) ); + } + + while ( $row = $this->DB->fetch( $outer ) ) + { + $row['_link'] = true; + + if ( ! $this->registry->topics->canView( $row ) ) + { + $row['title'] = $this->lang->words['attach_topicmoved']; + $row['_link'] = false; + } + + //----------------------------------------- + // Full attachment thingy + //----------------------------------------- + + if ( $row['attach_rel_module'] == 'post' ) + { + $row['_type'] = 'post'; + } + else if ( $row['attach_rel_module'] == 'msg' ) + { + $row['_type'] = 'msg'; + $row['title'] = $this->lang->words['attach_inpm']; + } + + /* IPB 2.x conversion */ + $row['image'] = str_replace( 'folder_mime_types', 'mime_types', $cache[ $row['attach_ext'] ]['atype_img'] ); + $row['short_name'] = IPSText::truncate( $row['attach_file'], 30 ); + $row['attach_date'] = $this->registry->getClass( 'class_localization')->getDate( $row['attach_date'], 'SHORT' ); + $row['real_size'] = IPSLib::sizeFormat( $row['attach_filesize'] ); + + $attachments[] = $row; + } + } + + return $this->registry->getClass('output')->getTemplate('ucp')->coreAttachments( $info, $pages, $attachments ); + } + + /** + * Show the Email & Password form + * + * @author Matt Mecham + * @param string Returned error message (if any) + * @return string Processed HTML + */ + public function showFormEmailPassword( $_message='' ) + { + //----------------------------------------- + // Do not allow validating members to change + // email when admin validation is on + // @see http://community.invisionpower.com/tracker/issue-19964-loophole-in-registration-procedure/ + //----------------------------------------- + + if( $this->memberData['member_group_id'] == $this->settings['auth_group'] AND in_array( $this->settings['reg_auth_type'], array( 'admin', 'admin_user' ) ) ) + { + $this->registry->output->showError( $this->lang->words['admin_val_no_email_chg'], 10189 ); + } + + //----------------------------------------- + // Do we have another URL for email resets? + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' ); + $this->han_login = new $classToLoad( $this->registry ); + $this->han_login->init(); + $this->han_login->checkMaintenanceRedirect(); + + //$txt = $this->lang->words['ce_current'] . $this->memberData['email']; + + if ( $this->settings['reg_auth_type']) + { + $txt .= $this->lang->words['ce_auth']; + } + + $_message = $_message ? $this->lang->words[$_message] : ''; + + if( $this->memberData['g_access_cp'] ) + { + $this->hide_form_and_save_button = true; + } + + return $this->registry->getClass('output')->getTemplate('ucp')->emailPasswordChangeForm( $txt, $_message, $this->_isFBUser ); + } + + /** + * Show the display name form + * + * @author Matt Mecham + * @param string Error message (if any) + * @return string Processed HTML + */ + public function showFormDisplayname( $error="" ) + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $form = array(); + + //----------------------------------------- + // CHECK (please) + //----------------------------------------- + + if ( ! $this->settings['auth_allow_dnames'] OR $this->memberData['g_dname_changes'] == 0 OR $this->memberData['g_dname_date'] == 0 ) + { + $this->registry->getClass('output')->showError( 'no_permission_for_display_names', 1011 ); + } + + $this->request['display_name'] = $this->request['display_name'] ? $this->request['display_name'] : ''; + + $this->settings['username_errormsg'] = str_replace( '{chars}', $this->settings['username_characters'], $this->settings['username_errormsg'] ); + + //----------------------------------------- + // Grab # changes > 24 hours + //----------------------------------------- + + $time_check = time() - 86400 * $this->memberData['g_dname_date']; + + if( $time_check < $this->memberData['joined'] ) + { + $time_check = $this->memberData['joined']; + } + + $name_count = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as count, MIN(dname_date) as min_date', 'from' => 'dnames_change', 'where' => "dname_member_id=" . $this->memberData['member_id'] . " AND dname_date > $time_check AND dname_discount=0" ) ); + + $name_count['count'] = intval( $name_count['count'] ); + $name_count['min_date'] = intval( $name_count['min_date'] ) ? intval( $name_count['min_date'] ) : $time_check; + + //----------------------------------------- + // Calculate # left + //----------------------------------------- + + /* Check new permissions */ + $_g = $this->caches['group_cache'][ $this->memberData['member_group_id'] ]; + + if ( $_g['g_displayname_unit'] ) + { + if ( $_g['gbw_displayname_unit_type'] ) + { + /* days */ + if ( $this->memberData['joined'] > ( time() - ( 86400 * $_g['g_displayname_unit'] ) ) ) + { + $this->hide_form_and_save_button = 1; + $form['_noPerm'] = sprintf( $this->lang->words['dname_group_restrict_date'], $this->lang->getDate( $this->memberData['joined'] + ( 86400 * $_g['g_displayname_unit'] ), 'long' ) ); + } + } + else + { + /* Posts */ + if ( $this->memberData['posts'] < $_g['g_displayname_unit'] ) + { + $this->hide_form_and_save_button = 1; + $form['_noPerm'] = sprintf( $this->lang->words['dname_group_restrict_posts'], $_g['g_displayname_unit'] - $this->memberData['posts'] ); + } + } + } + + if( !$form['_noPerm'] ) + { + if ( $this->memberData['g_dname_changes'] == -1 ) + { + $form['_lang_string'] = $this->lang->words['dname_string2']; + } + else + { + $form['_changes_left'] = $this->memberData['g_dname_changes'] - $name_count['count']; + $form['_changes_done'] = $name_count['count']; + + # Make sure changes done isn't larger than allowed + # This happens when changing via ACP + + if ( $form['_changes_done'] > $this->memberData['g_dname_changes'] ) + { + $form['_changes_done'] = $this->memberData['g_dname_changes']; + } + + $form['_first_change'] = $this->registry->getClass( 'class_localization')->getDate( $name_count['min_date'], 'date', 1 ); + $form['_lang_string'] = sprintf( $this->lang->words['dname_string'], + $form['_changes_done'], $this->memberData['g_dname_changes'], + $form['_first_change'], $this->memberData['g_dname_changes'], + $this->memberData['g_dname_date'] ) . $this->lang->words['dname_string2']; + } + } + + //----------------------------------------- + // Print + //----------------------------------------- + + $this->_pageTitle = $this->lang->words['m_dname_change']; + + return $this->registry->getClass('output')->getTemplate('ucp')->displayNameForm( $form, $error, '', $this->_isFBUser ); + } + + /** + * UserCP Form Check + * + * @author Matt Mecham + * @param string Current area as defined by 'get_links' + * @return string Processed HTML + */ + public function saveForm( $current_area ) + { + //----------------------------------------- + // Where to go, what to see? + //----------------------------------------- + + switch( $current_area ) + { + default: + case 'profileinfo': + return $this->saveProfileInfo(); + break; + case 'signature': + return $this->saveSignature(); + break; + case 'photo': + return $this->savePhoto(); + break; + case 'ignoredusers': + return $this->saveIgnoredUsers(); + break; + case 'facebook': + return $this->saveFacebook(); + break; + case 'twitter': + return $this->saveTwitter(); + break; + case 'customize': + return $this->saveCustomize(); + break; + case 'email': + return $this->saveFormEmailPassword(); + break; + case 'password': + return $this->saveFormPassword(); + break; + case 'displayname': + return $this->saveFormDisplayname(); + break; + case 'notifications': + return $this->saveFormNotifications(); + break; + } + } + + /** + * UserCP Save Form: Customize + * + * @return array Errors + */ + public function saveCustomize() + { + /* Init */ + $errors = array(); + $custom = array(); + $bg_nix = trim( $this->request['bg_nix'] ); + $bg_url = trim( $this->request['bg_url'] ); + $bg_tile = intval( $this->request['bg_tile'] ); + $bg_color = trim( str_replace( '#', '', $this->request['bg_color'] ) ); + + /* reset custom */ + $custom = IPSLib::safeUnserialize( $this->memberData['pp_customization'] ); + + /* Bug #21578 */ + if( ! $bg_color && $custom['bg_color'] ) + { + $bg_color = $custom['bg_color']; + } + + /* Delete all? */ + if ( $bg_nix ) + { + /* reset array */ + $custom = array( 'bg_url' => '', 'type' => '', 'bg_color' => '', 'bg_tile' => '' ); + + /* remove bg images */ + IPSMember::getFunction()->removeUploadedBackgroundImages( $this->memberData['member_id'] ); + } + else + { + if ( $bg_url AND $this->memberData['gbw_allow_url_bgimage'] ) + { + /* Check */ + if ( ! stristr( $bg_url, 'http://' ) OR preg_match( '#\(\*#', $bg_url ) ) + { + return array( 0 => $this->lang->words['pp_bgimg_url_bad'] ); + } + + $image_extension = strtolower( pathinfo( $bg_url, PATHINFO_EXTENSION ) ); + + if( ! in_array( $image_extension, array( 'png', 'jpg', 'gif', 'jpeg' ) ) ) + { + return array( 0 => $this->lang->words['pp_bgimg_ext_bad'] ); + } + + $custom['bg_url'] = $bg_url; + $custom['type'] = 'url'; + } + else if ( $this->memberData['gbw_allow_upload_bgimage'] ) + { + /* Load more lang strings */ + $this->registry->class_localization->loadLanguageFile( array( 'public_profile' ), 'members' ); + + /* Upload img */ + $img = IPSMember::getFunction()->uploadBackgroundImage(); + + if ( $img['status'] == 'fail' ) + { + return array( 0 => sprintf( $this->lang->words[ 'pp_' . $img['error'] ], $img['maxSize'] ) ); + } + else if ( $img['final_location'] ) + { + $custom['bg_url'] = $img['final_location']; + $custom['type'] = 'upload'; + } + } + } + + /* BG color */ + $custom['bg_color'] = $bg_nix ? '' : IPSText::alphanumericalClean( $bg_color ); + + /* Tile */ + $custom['bg_tile'] = $bg_nix ? '' : $bg_tile; + + /* Save it */ + if ( ! $this->memberData['bw_disable_customization'] AND $this->memberData['gbw_allow_customization'] ) + { + IPSMember::save( $this->memberData['member_id'], array( 'extendedProfile' => array( 'pp_profile_update' => IPS_UNIX_TIME_NOW, 'pp_customization' => serialize( $custom ) ) ) ); + } + + return TRUE; + } + + /** + * UserCP Save Form: Twitter + * + * @return array Errors + */ + public function saveTwitter() + { + if( !IPSLib::twitter_enabled() ) + { + $this->registry->getClass('output')->showError( 'twitter_disabled', 1005.2 ); + } + + //----------------------------------------- + // Data + //----------------------------------------- + + $toSave = IPSBWOptions::thaw( $this->memberData['tc_bwoptions'], 'twitter' ); + + //----------------------------------------- + // Loop and save... simple + //----------------------------------------- + + foreach( array( 'tc_s_pic', 'tc_s_status', 'tc_s_aboutme', 'tc_s_bgimg', 'tc_si_status' ) as $field ) + { + $toSave[ $field ] = intval( $this->request[ $field ] ); + } + + $this->memberData['tc_bwoptions'] = IPSBWOptions::freeze( $toSave, 'twitter' ); + $return = IPSMember::save( $this->memberData['member_id'], array( 'extendedProfile' => array( 'tc_bwoptions' => $this->memberData['tc_bwoptions'] ) ) ); + + //----------------------------------------- + // Now sync + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/twitter/connect.php', 'twitter_connect' ); + $twitter = new $classToLoad( $this->registry, $this->memberData['twitter_token'], $this->memberData['twitter_secret'] ); + + try + { + $twitter->syncMember( $this->memberData ); + } + catch( Exception $error ) + { + $msg = $error->getMessage(); + + switch( $msg ) + { + case 'NOT_LINKED': + case 'NO_MEMBER': + break; + } + } + + return TRUE; + } + + /** + * UserCP Save Form: Facebook + * + * @return array Errors + */ + public function saveFacebook() + { + if( !IPSLib::fbc_enabled() ) + { + $this->registry->getClass('output')->showError( 'fbc_disabled', 1005 ); + } + + //----------------------------------------- + // Data + //----------------------------------------- + + $toSave = IPSBWOptions::thaw( $this->memberData['members_bitoptions'], 'members' ); + + //----------------------------------------- + // Loop and save... simple + //----------------------------------------- + + foreach( array( 'fbc_s_pic', 'fbc_s_status', 'fbc_s_aboutme', 'fbc_si_status' ) as $field ) + { + $toSave[ $field ] = intval( $this->request[ $field ] ); + } + + $this->memberData['fb_bwoptions'] = IPSBWOptions::freeze( $toSave, 'facebook' ); + IPSMember::save( $this->memberData['member_id'], array( 'extendedProfile' => array( 'fb_bwoptions' => $this->memberData['fb_bwoptions'] ) ) ); + + //----------------------------------------- + // Now sync + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/facebook/connect.php', 'facebook_connect' ); + $facebook = new $classToLoad( $this->registry ); + + try + { + $facebook->syncMember( $this->memberData ); + } + catch( Exception $error ) + { + $msg = $error->getMessage(); + + switch( $msg ) + { + case 'NOT_LINKED': + case 'NO_MEMBER': + break; + } + } + + return TRUE; + } + + /** + * UserCP Save Form: Ignore Users + * + * @return array Errors + */ + public function saveIgnoredUsers() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $newName = $this->request['newbox_1']; + $dnvs = intval( $this->request['donot_view_sigs'] ); + + IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'view_sigs' => ( $dnvs ) ? 0 : 1 ) ) ); + + if ( trim( $newName ) && $_POST['newbox_1'] != $this->lang->words['ucp_members_name'] ) + { + //----------------------------------------- + // Load + //----------------------------------------- + + $member = IPSMember::load( $newName, 'core', 'displayname' ); + + if ( ! $member['member_id'] ) + { + return array( 0 => $this->lang->words['ignoreuser_nomem'] ); + } + + if ( $member['member_id'] == $this->memberData['member_id'] ) + { + return array( 0 => $this->lang->words['ignoreuser_cannot'] ); + } + + //----------------------------------------- + // Already ignoring? + //----------------------------------------- + + $ignoreMe = $this->DB->buildAndFetch( array( + 'select' => '*', + 'from' => 'ignored_users', + 'where' => 'ignore_owner_id=' . $this->memberData['member_id'] . ' AND ignore_ignore_id=' . $member['member_id'] + ) ); + + if ( $ignoreMe['ignore_id'] ) + { + return array( 0 => $this->lang->words['ignoreuser_already'] ); + } + + //----------------------------------------- + // Can we ignore them? + //----------------------------------------- + + if ( $member['_canBeIgnored'] !== TRUE ) + { + return array( 0 => $this->lang->words['ignoreuser_cannot'] ); + } + + //----------------------------------------- + // Add it + //----------------------------------------- + + $this->DB->insert( 'ignored_users', array( + 'ignore_owner_id' => $this->memberData['member_id'], + 'ignore_ignore_id' => $member['member_id'], + 'ignore_messages' => !empty( $this->request['ignore_messages'] ) ? 1 : 0, + 'ignore_topics' => !empty( $this->request['ignore_topics'] ) ? 1 : 0, + 'ignore_signatures' => !empty( $this->request['ignore_signatures'] ) ? 1 : 0, + 'ignore_chats' => !empty( $this->request['ignore_chats'] ) ? 1 : 0, + ) + ); + + /* Rebuild cache */ + IPSMember::rebuildIgnoredUsersCache( $this->memberData ); + } + + return TRUE; + } + + + /** + * UserCP Save Form: Signature + * + * @return array Errors + */ + public function saveSignature() + { + /* Load editor stuff */ + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' ); + $this->editor = new $classToLoad(); + $this->editor->setLegacyMode(false); + + $isHtml = intval( $this->request['sig_htmlstatus'] ); + + //----------------------------------------- + // Check to make sure that we can edit profiles.. + //----------------------------------------- + + $sig_restrictions = explode( ':', $this->memberData['g_signature_limits'] ); + + if ( ! $this->memberData['g_edit_profile'] OR ( $sig_restrictions[0] AND ! $this->memberData['g_sig_unit'] ) ) + { + $this->registry->getClass('output')->showError( 'members_profile_disabled', 1028, null, null, 403 ); + } + + //----------------------------------------- + // Post process the editor + // Now we have safe HTML and bbcode + //----------------------------------------- + + /* Set content in editor */ + $this->editor->setAllowBbcode( true ); + $this->editor->setAllowSmilies( true ); + $this->editor->setIsHtml( $this->memberData['g_dohtml'] && $isHtml ); + $this->editor->setBbcodeSection('signatures'); + $this->editor->setContent( $this->memberData['signature'] ); + + $signature = $this->editor->process( $_POST['Post'] ); + + //----------------------------------------- + // Parse post + //----------------------------------------- + + /* Load parser */ + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/text/parser.php', 'classes_text_parser' ); + $parser = new $classToLoad(); + + $parser->testForParsingLimits( $signature, array( 'quote', 'emoticons', 'urls' ) ); + + if ( is_array( $parser->getErrors() ) && count( $parser->getErrors() ) ) + { + $this->lang->loadLanguageFile( array( 'public_post' ), 'forums' ); + + $_errors = $parser->getErrors(); + $_error = array_pop( $_errors ); + $this->registry->getClass('output')->showError( $_error, 10210 ); + } + + //----------------------------------------- + // Signature restrictions... + //----------------------------------------- + + $sig_errors = array(); + + //----------------------------------------- + // Max number of images... + //----------------------------------------- + + if( isset($sig_restrictions[1]) and $sig_restrictions[1] !== '' ) + { + if( $parser->getImageCount( $signature ) > $sig_restrictions[1] ) + { + $sig_errors[] = sprintf( $this->lang->words['sig_toomanyimages'], $sig_restrictions[1] ); + } + } + + //----------------------------------------- + // Max number of urls... + //----------------------------------------- + + if( isset($sig_restrictions[4]) and $sig_restrictions[4] !== '' ) + { + if( $parser->getUrlCount( $signature ) > $sig_restrictions[4] ) + { + $sig_errors[] = sprintf( $this->lang->words['sig_toomanyurls'], $sig_restrictions[4] ); + } + else + { + preg_match_all( '#(^|\s|>)((http|https|news|ftp)://\w+[^\s\[\]\<]+)#is', $signature, $matches ); + + if( count($matches[1]) > $sig_restrictions[4] ) + { + $sig_errors[] = sprintf( $this->lang->words['sig_toomanyurls'], $sig_restrictions[4] ); + } + } + } + + $this->settings['signature_line_length'] = $this->settings['signature_line_length'] > 0 ? $this->settings['signature_line_length'] : 200; + + /* You can't wordwrap on HTML http://community.invisionpower.com/resources/bugs.html/_/ip-board/signature-url-bbcode-r41254 */ + //$signature = wordwrap( $signature, $this->settings['signature_line_length'], '

', true ); + + // http://community.invisionpower.com/tracker/issue-35105-signature-restriction-minor-bug + $signature = preg_replace( '#^\s*(

)+#i', '', $signature ); + $signature = preg_replace( '#(

)+?\s*$#i', '', $signature ); + + //----------------------------------------- + // Max number of lines of text... + //----------------------------------------- + + if( isset($sig_restrictions[5]) and $sig_restrictions[5] !== '' ) + { + $lineCount = substr_count( $signature, "

" ) + substr_count( $signature, "br>" ); + + if( $lineCount >= $sig_restrictions[5] ) + { + $sig_errors[] = sprintf( $this->lang->words['sig_toomanylines'], $sig_restrictions[5] ); + } + } + + //----------------------------------------- + // Now the crappy part.. + //----------------------------------------- + + if( isset($sig_restrictions[2]) and $sig_restrictions[2] !== '' AND isset($sig_restrictions[3]) and $sig_restrictions[3] !== '' ) + { + preg_match_all( '/\]+?)>/i', $signature, $allImages ); + + if( count($allImages[1]) ) + { + foreach( $allImages[1] as $foundImage ) + { + preg_match( '#src=[\'"]([^\'"]+?)[\'"]#i', $foundImage, $url ); + $imageProperties = @getimagesize( $url[1] ); + + if( is_array($imageProperties) AND count($imageProperties) ) + { + if( $imageProperties[0] > $sig_restrictions[2] OR $imageProperties[1] > $sig_restrictions[3] ) + { + $sig_errors[] = sprintf( $this->lang->words['sig_imagetoobig'], $url[1], $sig_restrictions[2], $sig_restrictions[3] ); + } + } + else + { + $sig_errors[] = $this->lang->words['sig_imagenotretrievable']; + } + } + } + } + + if( count($sig_errors) ) + { + $this->registry->getClass('output')->showError( implode( '
', $sig_errors ), 10211 ); + } + + /* Save HTML status */ + $members_bitoptions = IPSBWOptions::thaw( $this->memberData['members_bitoptions'], 'members', 'global' ); + $members_bitoptions['bw_html_sig'] = $isHtml; + + //----------------------------------------- + // Write it to the DB. + //----------------------------------------- + + IPSMember::save( $this->memberData['member_id'], array( 'members' => $members_bitoptions, 'extendedProfile' => array( 'signature' => $signature ) ) ); + + /* Update cache */ + IPSContentCache::update( $this->memberData['member_id'], 'sig', $parser->display( $signature ) ); + + return TRUE; + } + + + /** + * UserCP Save Form: Profile Info + * + * @return array Errors + */ + public function saveProfileInfo() + { + /* Load editor stuff */ + if( $this->request['updateAboutMe'] ) + { + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' ); + $this->editor = new $classToLoad(); + $this->editor->setLegacyMode(false); + } + + //----------------------------------------- + // INIT + //----------------------------------------- + + $pp_setting_moderate_comments = intval( $this->request['pp_setting_moderate_comments'] ); + $pp_setting_moderate_friends = intval( $this->request['pp_setting_moderate_friends'] ); + $pp_setting_count_visitors = intval( $this->request['pp_setting_count_visitors'] ); + $pp_setting_count_comments = intval( $this->request['pp_setting_count_comments'] ); + $pp_setting_count_friends = intval( $this->request['pp_setting_count_friends'] ); + + //----------------------------------------- + // Check to make sure that we can edit profiles.. + //----------------------------------------- + + if ( ! $this->memberData['g_edit_profile'] ) + { + $this->registry->getClass('output')->showError( 'members_profile_disabled', 10214, null, null, 403 ); + } + + //----------------------------------------- + // make sure that either we entered + // all calendar fields, or we left them + // all blank + //----------------------------------------- + + $c_cnt = 0; + + foreach ( array('day','month','year') as $v ) + { + if ( $this->request[ $v ] ) + { + $c_cnt++; + } + } + + if( $c_cnt > 0 && $c_cnt < 2 ) + { + $this->registry->getClass('output')->showError( 'member_bad_birthday', 10215 ); + } + else if( $c_cnt > 0 ) + { + //----------------------------------------- + // Make sure it's a legal date + //----------------------------------------- + + $_year = $this->request['year'] ? $this->request['year'] : 2000; + + if ( ! checkdate( $this->request['month'], $this->request['day'], $_year ) ) + { + $this->registry->getClass('output')->showError( 'member_bad_birthday', 10216 ); + } + } + + //----------------------------------------- + // Start off our array + //----------------------------------------- + + $core = array( 'bday_day' => $this->request['day'], + 'bday_month' => $this->request['month'], + 'bday_year' => $this->request['year'], + ); + + $extendedProfile = array( 'pp_setting_moderate_comments' => $pp_setting_moderate_comments, + 'pp_setting_moderate_friends' => $pp_setting_moderate_friends, + 'pp_setting_count_visitors' => $pp_setting_count_visitors, + 'pp_setting_count_comments' => $pp_setting_count_comments, + 'pp_setting_count_friends' => $pp_setting_count_friends ); + + //----------------------------------------- + // check to see if we can enter a member title + // and if one is entered, update it. + //----------------------------------------- + + if( isset( $this->request['member_title'] ) and ( $this->settings['post_titlechange'] == -1 or ( $this->settings['post_titlechange'] and $this->memberData['posts'] >= $this->settings['post_titlechange'] ) ) ) + { + $core['title'] = IPSText::getTextClass('bbcode')->stripBadWords( $this->request['member_title'] ); + } + + //----------------------------------------- + // Custom profile field stuff + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/customfields/profileFields.php', 'customProfileFields' ); + $fields = new $classToLoad(); + + $fields->member_data = $this->member->fetchMemberData(); + $fields->initData( 'edit' ); + /* Use $_POST and not ipsRegistry::$request as the custom profile field kernel class has its own cleaning routines for saving and showing + which means we end up with double & -> & conversion (&lt;, etc) */ + $fields->parseToSave( $_POST ); + + if( $fields->error_messages ) + { + return $fields->error_messages; + } + + /* Check the website url field */ + $website_field = $fields->getFieldIDByKey( 'website' ); + + if( $website_field && $fields->out_fields[ 'field_' . $website_field ] ) + { + if( stristr( $fields->out_fields[ 'field_' . $website_field ], 'http://' ) === FALSE && stristr( $fields->out_fields[ 'field_' . $website_field ], 'https://' ) === FALSE ) + { + $fields->out_fields[ 'field_' . $website_field ] = 'http://' . $fields->out_fields[ 'field_' . $website_field ]; + } + } + + //----------------------------------------- + // Check... + //----------------------------------------- + + if ( count( $fields->error_fields['empty'] ) ) + { + $this->registry->getClass('output')->showError( array( 'customfields_empty', $fields->error_fields['empty'][0]['pf_title'] ), 10217 ); + } + + if ( count( $fields->error_fields['invalid'] ) ) + { + $this->registry->getClass('output')->showError( array( 'customfields_invalid', $fields->error_fields['invalid'][0]['pf_title'] ), 10218 ); + } + + if ( count( $fields->error_fields['toobig'] ) ) + { + $this->registry->getClass('output')->showError( array( 'customfields_toobig', $fields->error_fields['toobig'][0]['pf_title'] ), 10219 ); + } + + /* About me */ + if( $this->request['updateAboutMe'] ) + { + $extendedProfile['pp_about_me'] = $this->editor->process( $_POST['Post'] ); + } + + /* Open ID & times*/ + $timeZone = IPSText::alphanumericalClean( $this->request['timeZone'], '+.' ); + $dst_correct = intval( $this->request['dst_correct'] ); + + /* Add into array */ + $core['time_offset'] = $timeZone; + + /* http://community.invisionpower.com/resources/bugs.html/_/ip-board/cannot-uncheck-my-timezone-is-currently-in-dst-checkbox-in-profile-r41510 */ + //$core['dst_in_use'] = $this->settings['time_dst_auto_correction'] ? ( ( $this->request['dstOption'] AND intval($this->request['dstCheck']) == 0 ) ? intval($this->request['dstOption']) : 0 ) : $this->memberData['dst_in_use']; + $core['dst_in_use'] = $this->settings['time_dst_auto_correction'] ? ( ( $this->request['dstOption'] AND intval($this->request['dstCheck']) == 0 ) ? intval($this->request['dstOption']) : 0 ) : intval($this->request['dstOption']); + + $core['members_auto_dst'] = $this->settings['time_dst_auto_correction'] ? intval($this->request['dstCheck']) : $this->memberData['members_auto_dst']; + + //----------------------------------------- + // Update the DB + //----------------------------------------- + + IPSMember::save( $this->memberData['member_id'], array( 'core' => $core, + 'customFields' => $fields->out_fields, + 'extendedProfile' => $extendedProfile ) ); + + //----------------------------------------- + // Update birthdays cache if user set to today + // or if birthday was today but isn't now + //----------------------------------------- + + if( $core['bday_month'] == date('m') AND $core['bday_day'] == date('d') ) + { + $this->cache->rebuildCache( 'birthdays', 'calendar' ); + } + else if( $this->memberData['bday_month'] == date('m') AND $this->memberData['bday_day'] == date('d') AND ( $core['bday_month'] != date('m') OR $core['bday_day'] != date('d') ) ) + { + $this->cache->rebuildCache( 'birthdays', 'calendar' ); + } + + return TRUE; + } + + /** + * UserCP Save Form: Notifications config + * + * @return boolean Successful + */ + public function saveFormNotifications() + { + //----------------------------------------- + // Notifications library + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' ); + $notifyLibrary = new $classToLoad( $this->registry ); + $notifyLibrary->setMember( $this->memberData ); + + //----------------------------------------- + // Show the form + //----------------------------------------- + + $_basicOptions = array( array( 'email', $this->lang->words['notopt__email'] ), array( 'inline', $this->lang->words['notopt__inline'] ), array( 'mobile' => $this->lang->words['notopt__mobile'] ) ); + $_configOptions = $notifyLibrary->getNotificationData(); + $_notifyConfig = $notifyLibrary->getMemberNotificationConfig( $this->memberData ); + $_defaultConfig = $notifyLibrary->getDefaultNotificationConfig(); + $_saveConfig = array(); + + foreach( $_configOptions as $option ) + { + $_saveConfig[ $option['key'] ] = array(); + $_saveConfig[ $option['key'] ]['selected'] = array(); + + //----------------------------------------- + // Loop through and mark what we selected. + // Do not allow changing of stuff from disable_override + // and disabled, however + //----------------------------------------- + + if( is_array($this->request['config_' . $option['key'] ]) AND count($this->request['config_' . $option['key'] ]) ) + { + foreach( $this->request['config_' . $option['key'] ] as $_selected ) + { + if( !is_array($_defaultConfig[ $option['key'] ]['disabled']) OR !in_array( $_selected, $_defaultConfig[ $option['key'] ]['disabled'] ) ) + { + $_saveConfig[ $option['key'] ]['selected'][] = $_selected; + } + } + } + + if( $_defaultConfig[ $option['key'] ]['disable_override'] ) + { + $_saveConfig[ $option['key'] ]['selected'] = $_defaultConfig[ $option['key'] ]['selected']; + } + } + + //----------------------------------------- + // Save + //----------------------------------------- + + IPSMember::packMemberCache( $this->memberData['member_id'], array( 'notifications' => $_saveConfig, 'show_notification_popup' => intval($this->request['show_notification_popup']) ), $this->memberData['members_cache'] ); + + //----------------------------------------- + // Topic preferences + //----------------------------------------- + + $_trackChoice = ''; + + if ( $this->request['auto_track'] ) + { + if ( in_array( $this->request['trackchoice'], array( 'none', 'immediate', 'offline', 'daily', 'weekly' ) ) ) + { + $_trackChoice = $this->request['trackchoice']; + } + } + + //----------------------------------------- + // Profile preferences + //----------------------------------------- + + IPSMember::save( $this->memberData['member_id'], array( 'core' => array( + 'allow_admin_mails' => intval( $this->request['admin_send'] ), + 'auto_track' => $_trackChoice + ) ) ); + + return TRUE; + } + /** + * UserCP Save Form: Password + * + * @param array Array of member / core_sys_login information (if we're editing) + * @return mixed Array of errors / boolean true + */ + public function saveFormPassword( $member=array() ) + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $cur_pass = trim($this->request['current_pass']); + $new_pass = trim($this->request['new_pass_1']); + $chk_pass = trim($this->request['new_pass_2']); + $isRemote = ( ! $this->memberData['bw_local_password_set'] AND $this->memberData['members_created_remote'] ) ? true : false; + + //----------------------------------------- + // Checks... + //----------------------------------------- + + if( $this->memberData['g_access_cp'] ) + { + return array( 0 => $this->lang->words['admin_emailpassword'] ); + } + + if ( $isRemote === false AND ( ! $_POST['current_pass'] OR ( empty($new_pass) ) or ( empty($chk_pass) ) ) ) + { + return array( 0 => $this->lang->words['complete_entire_form'] ); + } + + //----------------------------------------- + // Do the passwords actually match? + //----------------------------------------- + + if ( $new_pass != $chk_pass ) + { + return array( 0 => $this->lang->words['passwords_not_matchy'] ); + } + + //----------------------------------------- + // Check password... + //----------------------------------------- + + if ( $isRemote === false ) + { + if ( $this->_checkPassword( $cur_pass ) !== TRUE ) + { + return array( 0 => $this->lang->words['current_pw_bad'] ); + } + } + else + { + /* This is INIT in _checkPassword */ + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' ); + $this->han_login = new $classToLoad( $this->registry ); + $this->han_login->init(); + } + + //----------------------------------------- + // Create new password... + //----------------------------------------- + + $md5_pass = md5($new_pass); + + //----------------------------------------- + // han_login was loaded during check_password + //----------------------------------------- + + $this->han_login->changePass( $this->memberData['email'], $md5_pass, $new_pass, $this->memberData ); + + if ( $this->han_login->return_code AND $this->han_login->return_code != 'METHOD_NOT_DEFINED' AND $this->han_login->return_code != 'SUCCESS' ) + { + return array( 0 => $this->lang->words['hanlogin_pw_failed'] ); + } + + //----------------------------------------- + // Update the DB + //----------------------------------------- + + IPSMember::updatePassword( $this->memberData['member_id'], $md5_pass ); + + IPSLib::runMemberSync( 'onPassChange', $this->memberData['member_id'], $new_pass ); + + //----------------------------------------- + // Update members log in key... + //----------------------------------------- + + $key = IPSMember::generateAutoLoginKey(); + + IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'member_login_key' => $key, 'bw_local_password_set' => 1 ) ) ); + + $this->ok_message = $this->lang->words['pw_change_successful']; + + return TRUE; + } + + /** + * UserCP Save Form: Display Name + * + * @return mixed Array of errors / boolean true + */ + public function saveFormDisplayname() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $members_display_name = trim($this->request['displayName']); + $password_check = trim( $this->request['displayPassword'] ); + + //----------------------------------------- + // Check for blanks... + //----------------------------------------- + + if ( ! $members_display_name OR ( ! $this->_isFBUser AND ! $password_check ) ) + { + return array( 0 => $this->lang->words['complete_entire_form'] ); + } + + //----------------------------------------- + // Check password + //----------------------------------------- + + if ( ! $this->_isFBUser ) + { + if ( $this->_checkPassword( $password_check ) === FALSE ) + { + return array( 0 => $this->lang->words['current_pw_bad'] ); + } + } + + try + { + if ( IPSMember::getFunction()->updateName( $this->memberData['member_id'], $members_display_name, 'members_display_name' ) === TRUE ) + { + $this->cache->rebuildCache( 'stats', 'global' ); + + return $this->showFormDisplayname( '', $this->lang->words['dname_change_ok'] ); + } + else + { + # We should absolutely never get here. So this is a fail-safe, really to + # prevent a "false" positive outcome for the end-user + return array( 0 => $this->lang->words['name_taken_change'] ); + } + } + catch( Exception $error ) + { + switch( $error->getMessage() ) + { + case 'NO_MORE_CHANGES': + return array( 0 => $this->lang->words['name_change_no_more'] ); + break; + case 'NO_USER': + return array( 0 => $this->lang->words['name_change_noload'] ); + break; + case 'NO_PERMISSION': + return array( 0 => $this->lang->words['name_change_noperm'] ); + case 'NO_NAME': + return array( 0 => sprintf( $this->lang->words['name_change_tooshort'], $this->settings['max_user_name_length'] ) ); + break; + case 'TOO_LONG': + return array( 0 => sprintf( $this->lang->words['name_change_tooshort'], $this->settings['max_user_name_length'] ) ); + break; + case 'ILLEGAL_CHARS': + return array( 0 => $this->lang->words['name_change_illegal'] ); + break; + case 'USER_NAME_EXISTS': + return array( 0 => $this->lang->words['name_change_taken'] ); + break; + default: + return array( 0 => $error->getMessage() ); + break; + } + } + + return TRUE; + } + + /** + * UserCP Save Form: Email Address + * + * @return mixed Array of errors / boolean true + */ + public function saveFormEmailPassword() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $_emailOne = strtolower( trim($this->request['in_email_1']) ); + $_emailTwo = strtolower( trim($this->request['in_email_2']) ); + $cur_pass = trim($this->request['current_pass']); + $new_pass = trim($this->request['new_pass_1']); + $chk_pass = trim($this->request['new_pass_2']); + $isRemote = ( ! $this->memberData['bw_local_password_set'] AND $this->memberData['members_created_remote'] ) ? true : false; + + if ( $cur_pass OR $new_pass ) + { + if( $this->memberData['g_access_cp'] ) + { + return array( 0 => $this->lang->words['admin_emailpassword'] ); + } + + if ( $isRemote === false AND ( ! $_POST['current_pass'] OR ( empty($new_pass) ) or ( empty($chk_pass) ) ) ) + { + return array( 0 => $this->lang->words['complete_entire_form'] ); + } + + //----------------------------------------- + // Do the passwords actually match? + //----------------------------------------- + + if ( $new_pass != $chk_pass ) + { + return array( 0 => $this->lang->words['passwords_not_matchy'] ); + } + + //----------------------------------------- + // Check password... + //----------------------------------------- + + if ( $isRemote === false ) + { + if ( $this->_checkPassword( $cur_pass ) !== TRUE ) + { + return array( 0 => $this->lang->words['current_pw_bad'] ); + } + } + else + { + /* This is INIT in _checkPassword */ + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' ); + $this->han_login = new $classToLoad( $this->registry ); + $this->han_login->init(); + } + + //----------------------------------------- + // Create new password... + //----------------------------------------- + + $md5_pass = md5($new_pass); + + //----------------------------------------- + // han_login was loaded during check_password + //----------------------------------------- + + $this->han_login->changePass( $this->memberData['email'], $md5_pass, $new_pass, $this->memberData ); + + if ( $this->han_login->return_code AND $this->han_login->return_code != 'METHOD_NOT_DEFINED' AND $this->han_login->return_code != 'SUCCESS' ) + { + return array( 0 => $this->lang->words['hanlogin_pw_failed'] ); + } + + //----------------------------------------- + // Update the DB + //----------------------------------------- + + IPSMember::updatePassword( $this->memberData['email'], $md5_pass ); + + IPSLib::runMemberSync( 'onPassChange', $this->memberData['member_id'], $new_pass ); + + //----------------------------------------- + // Update members log in key... + //----------------------------------------- + + $key = IPSMember::generateAutoLoginKey(); + + IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'member_login_key' => $key, 'bw_local_password_set' => 1 ) ) ); + + $this->ok_message = $this->lang->words['pw_change_successful']; + } + + if ( $_emailOne or $_emailTwo ) + { + //----------------------------------------- + // Do not allow validating members to change + // email when admin validation is on + // @see http://community.invisionpower.com/tracker/issue-19964-loophole-in-registration-procedure/ + //----------------------------------------- + + if( $this->memberData['member_group_id'] == $this->settings['auth_group'] AND in_array( $this->settings['reg_auth_type'], array( 'admin', 'admin_user' ) ) ) + { + $this->registry->output->showError( $this->lang->words['admin_val_no_email_chg'], 10190 ); + } + + //----------------------------------------- + // Check input + //----------------------------------------- + + if( $this->memberData['g_access_cp'] ) + { + return array( 0 => $this->lang->words['admin_emailpassword'] ); + } + + if ( ! $_POST['in_email_1'] OR ! $_POST['in_email_2'] ) + { + return array( 0 => $this->lang->words['complete_entire_form'] ); + } + + //----------------------------------------- + // Check password... + //----------------------------------------- + + if ( ! $this->_isFBUser ) + { + if ( $this->_checkPassword( $this->request['password'] ) === FALSE ) + { + return array( 0 => $this->lang->words['current_pw_bad'] ); + } + } + + //----------------------------------------- + // Test email addresses + //----------------------------------------- + + if ( $_emailOne != $_emailTwo ) + { + return array( 0 => $this->lang->words['emails_no_matchy'] ); + } + + if ( IPSText::checkEmailAddress( $_emailOne ) !== TRUE ) + { + return array( 0 => $this->lang->words['email_not_valid'] ); + } + + //----------------------------------------- + // Is this email addy taken? + //----------------------------------------- + + if ( IPSMember::checkByEmail( $_emailOne ) == TRUE ) + { + return array( 0 => $this->lang->words['email_is_taken'] ); + } + + //----------------------------------------- + // Load ban filters + //----------------------------------------- + $banfilters = array(); + $this->DB->build( array( 'select' => '*', 'from' => 'banfilters' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $banfilters[ $r['ban_type'] ][] = $r['ban_content']; + } + + //----------------------------------------- + // Check in banned list + //----------------------------------------- + + if ( isset($banfilters['email']) AND is_array( $banfilters['email'] ) and count( $banfilters['email'] ) ) + { + foreach ( $banfilters['email'] as $email ) + { + $email = str_replace( '\*', '.*' , preg_quote($email, "/") ); + + if ( preg_match( "/^{$email}$/i", $_emailOne ) ) + { + return array( 0 => $this->lang->words['email_is_taken'] ); + } + } + } + + //----------------------------------------- + // Load handler... + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' ); + $this->han_login = new $classToLoad( $this->registry ); + $this->han_login->init(); + + if ( $this->han_login->emailExistsCheck( $_emailOne ) !== FALSE ) + { + return array( 0 => $this->lang->words['email_is_taken'] ); + } + + $this->han_login->changeEmail( $this->memberData['email'], $_emailOne, $this->memberData ); + + if ( $this->han_login->return_code AND $this->han_login->return_code != 'METHOD_NOT_DEFINED' AND $this->han_login->return_code != 'SUCCESS' ) + { + return array( 0 => $this->lang->words['email_is_taken'] ); + } + + //----------------------------------------- + // Want a new validation? NON ADMINS ONLY + //----------------------------------------- + + if ( $this->settings['reg_auth_type'] AND !$this->memberData['g_access_cp'] ) + { + //----------------------------------------- + // Remove any existing entries + //----------------------------------------- + + $_previous = $this->DB->buildAndFetch( array( 'select' => 'prev_email, real_group', 'from' => 'validating', 'where' => "member_id={$this->memberData['member_id']} AND email_chg=1" ) ); + + if( $_previous['prev_email'] ) + { + $this->DB->delete( 'validating', "member_id={$this->memberData['member_id']} AND email_chg=1" ); + + $this->memberData['email'] = $_previous['prev_email']; + $this->memberData['member_group_id'] = $_previous['real_group']; + } + + $validate_key = md5( IPSMember::makePassword() . time() ); + + //----------------------------------------- + // Update the new email, but enter a validation key + // and put the member in "awaiting authorisation" + // and send an email.. + //----------------------------------------- + + $db_str = array( + 'vid' => $validate_key, + 'member_id' => $this->memberData['member_id'], + 'temp_group' => $this->settings['auth_group'], + 'entry_date' => time(), + 'coppa_user' => 0, + 'email_chg' => 1, + 'ip_address' => $this->member->ip_address, + 'prev_email' => $this->memberData['email'], + ); + + if ( $this->memberData['member_group_id'] != $this->settings['auth_group'] ) + { + $db_str['real_group'] = $this->memberData['member_group_id']; + } + + $this->DB->insert( 'validating', $db_str ); + + IPSLib::runMemberSync( 'onEmailChange', $this->memberData['member_id'], strtolower( $_emailOne ), $this->memberData['email'] ); + + IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'member_group_id' => $this->settings['auth_group'], + 'email' => $_emailOne ) ) ); + + //----------------------------------------- + // Update their session with the new member group + //----------------------------------------- + + if ( $this->member->session_id ) + { + $this->member->sessionClass()->convertMemberToGuest(); + } + + //----------------------------------------- + // Kill the cookies to stop auto log in + //----------------------------------------- + + IPSCookie::set( 'pass_hash' , '-1', 0 ); + IPSCookie::set( 'member_id' , '-1', 0 ); + IPSCookie::set( 'session_id' , '-1', 0 ); + + //----------------------------------------- + // Dispatch the mail, and return to the activate form. + //----------------------------------------- + + IPSText::getTextClass( 'email' )->getTemplate("newemail"); + + IPSText::getTextClass( 'email' )->buildMessage( array( + 'NAME' => $this->memberData['members_display_name'], + 'THE_LINK' => $this->settings['base_url']."app=core&module=global§ion=register&do=auto_validate&type=newemail&uid=".$this->memberData['member_id']."&aid=".$validate_key, + 'ID' => $this->memberData['member_id'], + 'MAN_LINK' => $this->settings['base_url']."app=core&module=global§ion=register&do=07", + 'CODE' => $validate_key, + ) ); + + IPSText::getTextClass( 'email' )->subject = $this->lang->words['lp_subject'].' '.$this->settings['board_name']; + IPSText::getTextClass( 'email' )->to = $_emailOne; + + IPSText::getTextClass( 'email' )->sendMail(); + + $this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] . 'app=core&module=global&section=register&do=07' ); + } + else + { + //----------------------------------------- + // No authorisation needed, change email addy and return + //----------------------------------------- + + IPSLib::runMemberSync( 'onEmailChange', $this->memberData['member_id'], strtolower( $_emailOne ), $this->memberData['email'] ); + + IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'email' => $_emailOne ) ) ); + + //----------------------------------------- + // Add to OK message + //----------------------------------------- + + $this->ok_message = $this->lang->words['ok_email_changed']; + } + } + + return TRUE; + } + + /** + * Password check + * + * @param string Plain Text Password + * @return boolean Password matched or not + */ + protected function _checkPassword( $password_check ) + { + //----------------------------------------- + // Ok, check password first + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' ); + $this->han_login = new $classToLoad( $this->registry ); + $this->han_login->init(); + + //----------------------------------------- + // Is this a username or email address? + //----------------------------------------- + + $this->han_login->loginPasswordCheck( $this->memberData['name'], $this->memberData['email'], $password_check ); + + if ( $this->han_login->return_code == 'SUCCESS' ) + { + return TRUE; + } + else + { + return FALSE; + } + } } \ No newline at end of file diff --git a/upload/admin/applications/core/extensions/warnings.php b/upload/admin/applications/core/extensions/warnings.php index 0d2a016d..3df112c5 100644 --- a/upload/admin/applications/core/extensions/warnings.php +++ b/upload/admin/applications/core/extensions/warnings.php @@ -7,7 +7,7 @@ * $Author: bfarber $ (Original: Mark) * @since - * $LastChangedDate: 2013-05-01 17:35:09 -0400 (Wed, 01 May 2013) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 12211 $ */ diff --git a/upload/admin/applications/core/index.html b/upload/admin/applications/core/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/index.html +++ b/upload/admin/applications/core/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/js/acp.homepage.js b/upload/admin/applications/core/js/acp.homepage.js index 137bab32..5dec5455 100644 --- a/upload/admin/applications/core/js/acp.homepage.js +++ b/upload/admin/applications/core/js/acp.homepage.js @@ -20,7 +20,7 @@ ACPHomepage = { { if ( $('members_display_name').value == "" ) { - alert("Нужно ввести имя пользователя!"); + alert("You must enter a username!"); return false; } diff --git a/upload/admin/applications/core/js/index.html b/upload/admin/applications/core/js/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/js/index.html +++ b/upload/admin/applications/core/js/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/js/ipb3CSS.js b/upload/admin/applications/core/js/ipb3CSS.js index 1ed6490f..3a495205 100644 --- a/upload/admin/applications/core/js/ipb3CSS.js +++ b/upload/admin/applications/core/js/ipb3CSS.js @@ -85,11 +85,11 @@ function IPBCSS() } else { - alert( "Похоже у нас проблемы: " + t.responseText ); + alert( "Ooops. Something went wrong. Does this help?: " + t.responseText ); } }, - onException: function( f,e ){ alert( "Исключение: " + e ); }, - onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); } + onException: function( f,e ){ alert( "Exception: " + e ); }, + onFailure: function( t ){ alert( "Failure: " + t.responseText ); } } ); }; @@ -143,7 +143,7 @@ function IPBCSS() } else { - alert( "Похоже у нас проблемы: " + t.responseText ); + alert( "Ooops. Something went wrong. Does this help?: " + t.responseText ); } }, onException: function( f,e ){ alert( "Exception: " + e ); }, @@ -159,14 +159,14 @@ function IPBCSS() /* Make sure we're mean it... */ if ( $('tplate_cssRow_' + css_id ).hasClassName( 'tplateRow_new') ) { - if ( ! confirm( "Удалить CSS файл ?\nФайл будет удален из ВСЕХ стилей!" ) ) + if ( ! confirm( "REMOVE CSS file?\n This will remove this template bit in ALL skins!" ) ) { return false; } } else { - if ( ! confirm( "Отменить изменения в CSS файле ?\nВсе изменения будут утеряны!" ) ) + if ( ! confirm( "Revert CSS file?\n All changes WILL be lost!" ) ) { return false; } @@ -202,7 +202,7 @@ function IPBCSS() } else { - alert( "Похоже у нас проблемы: " + t.responseText ); + alert( "Ooops. Something went wrong. Does this help?: " + t.responseText ); } }, onException: function( f,e ){ alert( "Exception: " + e ); }, @@ -239,7 +239,7 @@ function IPBCSS() } else { - alert( "Похоже у нас проблемы: " + t.responseText ); + alert( "Ooops. Something went wrong. Does this help?: " + t.responseText ); } }, onException: function( f,e ){ alert( "Exception: " + e ); }, diff --git a/upload/admin/applications/core/js/ipb3TemplateDiff.js b/upload/admin/applications/core/js/ipb3TemplateDiff.js index a075ddbe..763895f8 100644 --- a/upload/admin/applications/core/js/ipb3TemplateDiff.js +++ b/upload/admin/applications/core/js/ipb3TemplateDiff.js @@ -217,14 +217,14 @@ function IPBTemplateDiff() */ this.timeOutAjax = function( t ) { - if ( confirm( "Нет ответа от сервера.\nХотите подождать?" ) ) + if ( confirm( "No response from the webserver.\nDo you wish to continue waiting?" ) ) { return true; } else { t.transport.abort(); - alert( "Запрос отменен" ); + alert( "Request Cancelled" ); } }; @@ -265,7 +265,7 @@ function IPBTemplateDiff() if ( json['error'] ) { - alert( "Ошибка: " . json['error'] ); + alert( "An error occurred: " . json['error'] ); return false; } diff --git a/upload/admin/applications/core/js/ipb3TemplateSandR.js b/upload/admin/applications/core/js/ipb3TemplateSandR.js index 734ad4a4..db5fd81b 100644 --- a/upload/admin/applications/core/js/ipb3TemplateSandR.js +++ b/upload/admin/applications/core/js/ipb3TemplateSandR.js @@ -166,7 +166,7 @@ function IPBTemplateSandR() else { $('replaceButton').disabled = false; - $('replaceButton').value = "Заменить выбранные"; + $('replaceButton').value = "Replace Selected"; } } } diff --git a/upload/admin/applications/core/js/ipb3Templates.js b/upload/admin/applications/core/js/ipb3Templates.js index 1ae5c716..0ebda002 100644 --- a/upload/admin/applications/core/js/ipb3Templates.js +++ b/upload/admin/applications/core/js/ipb3Templates.js @@ -103,7 +103,7 @@ function IPBTemplates() } else { - alert( "Ошибка: " + t.responseText ); + alert( "Ooops. Something went wrong. Does this help?: " + t.responseText ); } }, onException: function( f,e ){ alert( "Exception: " + e ); }, @@ -169,7 +169,7 @@ function IPBTemplates() } else { - alert( "Ошибка: " + t.responseText ); + alert( "Ooops. Something went wrong. Does this help?: " + t.responseText ); } }, onException: function( f,e ){ alert( "Exception: " + e ); }, @@ -222,7 +222,7 @@ function IPBTemplates() if ( json['errors'] ) { /* Something inline would be very nice here.. rather than this ugly alert */ - alert("Ошибка: " + json['errors'] ); + alert("Error:: " + json['errors'] ); } else { @@ -232,7 +232,7 @@ function IPBTemplates() } else { - alert( "Ошибка: " + t.responseText ); + alert( "Ooops. Something went wrong. Does this help?: " + t.responseText ); } }, onException: function( f,e ){ alert( "Exception: " + e ); }, @@ -248,14 +248,14 @@ function IPBTemplates() /* Make sure we're mean it... */ if ( $('tplate_templaterow_' + template_id ).hasClassName( 'tplateRow_new') ) { - if ( ! confirm( "Удалить шаблон?\n Произойдет удаление шаблона из ВСЕХ стилей!" ) ) + if ( ! confirm( "REMOVE template bit?\n This will remove this template bit in ALL skins!" ) ) { return false; } } else { - if ( ! confirm( "Откатить изменения?\n Все изменения БУДУТ УТРАЧЕНЫ!" ) ) + if ( ! confirm( "Revert template bit?\n All changes WILL be lost!" ) ) { return false; } @@ -301,7 +301,7 @@ function IPBTemplates() } else { - alert( "Ошибка: " + t.responseText ); + alert( "Ooops. Something went wrong. Does this help?: " + t.responseText ); } }, onException: function( f,e ){ alert( "Exception: " + e ); }, @@ -338,7 +338,7 @@ function IPBTemplates() } else { - alert( "Ошибка: " + t.responseText ); + alert( "Ooops. Something went wrong. Does this help?: " + t.responseText ); } }, onException: function( f,e ){ alert( "Exception: " + e ); }, diff --git a/upload/admin/applications/core/modules_admin/ajax/bookmarks.php b/upload/admin/applications/core/modules_admin/ajax/bookmarks.php index c545e7e4..48c2377c 100644 --- a/upload/admin/applications/core/modules_admin/ajax/bookmarks.php +++ b/upload/admin/applications/core/modules_admin/ajax/bookmarks.php @@ -7,7 +7,7 @@ * $Author: bfarber $ * @since 7th August 2012 * $LastChangedDate: 2011-03-10 21:00:38 +0000 (Thu, 10 Mar 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 8021 $ */ diff --git a/upload/admin/applications/core/modules_admin/ajax/compare.php b/upload/admin/applications/core/modules_admin/ajax/compare.php index b4635ffc..09580102 100644 --- a/upload/admin/applications/core/modules_admin/ajax/compare.php +++ b/upload/admin/applications/core/modules_admin/ajax/compare.php @@ -2,7 +2,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Template comparison
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
diff --git a/upload/admin/applications/core/modules_admin/ajax/css.php b/upload/admin/applications/core/modules_admin/ajax/css.php index 078e7399..f59c1d28 100644 --- a/upload/admin/applications/core/modules_admin/ajax/css.php +++ b/upload/admin/applications/core/modules_admin/ajax/css.php @@ -3,7 +3,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * AJAX Functions For applications/core/js/ipb3CSS.js file
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
diff --git a/upload/admin/applications/core/modules_admin/ajax/editor.php b/upload/admin/applications/core/modules_admin/ajax/editor.php index 9b3bbbd2..2c1465d5 100644 --- a/upload/admin/applications/core/modules_admin/ajax/editor.php +++ b/upload/admin/applications/core/modules_admin/ajax/editor.php @@ -2,7 +2,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Handles Admin ajax functions for IP.Board Text Editor
  * Author: Matt "Matt Mecham" Mecham
  * Last Updated: $LastChangedDate: 2012-05-29 14:05:10 +0100 (Tue, 29 May 2012) $
diff --git a/upload/admin/applications/core/modules_admin/ajax/findnames.php b/upload/admin/applications/core/modules_admin/ajax/findnames.php
index 93d59988..13784332 100644
--- a/upload/admin/applications/core/modules_admin/ajax/findnames.php
+++ b/upload/admin/applications/core/modules_admin/ajax/findnames.php
@@ -1,115 +1,115 @@
-
- * Invision Power Services
- * IP.Board v3.4.5
- * Login handler abstraction : AJAX Find Names functions
- * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
- * 
- * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/company/standards.php#license - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com - * @since Tuesday 1st March 2005 (11:52) - * @version $Revision: 10721 $ - * @see public_core_ajax_findnames - * - */ - -if ( ! defined( 'IN_ACP' ) ) -{ - print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -class admin_core_ajax_findnames extends ipsAjaxCommand -{ - /** - * Class entry point - * - * @param object Registry reference - * @return @e void [Outputs to screen] - */ - public function doExecute( ipsRegistry $registry ) - { - switch( $this->request['do'] ) - { - case 'get-member-names': - $this->_getMemberNames(); - break; - } - } - - /** - * Returns possible matches for the string input - * - * @return @e void Outputs to screen - */ - protected function _getMemberNames() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $name = IPSText::convertUnicode( $this->convertAndMakeSafe( $this->request['name'], 0 ), true ); - $name = IPSText::convertCharsets( $name, 'utf-8', IPS_DOC_CHAR_SET ); - - //----------------------------------------- - // Check length - //----------------------------------------- - - if ( IPSText::mbstrlen( $name ) < 3 ) - { - $this->returnJsonError( 'requestTooShort' ); - } - - //----------------------------------------- - // Try query... - //----------------------------------------- - - $this->DB->build( array( 'select' => 'm.members_display_name, m.name, m.member_id, m.member_group_id', - 'from' => array( 'members' => 'm' ), - 'where' => "m.members_l_display_name LIKE '" . $this->DB->addSlashes( mb_strtolower( $name ) ) . "%'", - 'order' => $this->DB->buildLength( 'm.members_display_name' ) . ' ASC', - 'limit' => array( 0, 15 ), - 'add_join' => array( array( 'select' => 'p.*', - 'from' => array( 'profile_portal' => 'p' ), - 'where' => 'p.pp_member_id=m.member_id', - 'type' => 'left' ) ) ) ); - $this->DB->execute(); - - //----------------------------------------- - // Got any results? - //----------------------------------------- - - if ( ! $this->DB->getTotalRows() ) - { - $this->returnJsonArray( array( ) ); - } - - $return = array(); - - while( $r = $this->DB->fetch() ) - { - if( !$r['members_display_name'] ) - { - continue; - } - - $photo = IPSMember::buildProfilePhoto( $r ); - $group = IPSMember::makeNameFormatted( '' , $r['member_group_id'] ); - $return[ $r['member_id'] ] = array( 'name' => $r['members_display_name'], - 'showas'=> '' . $r['members_display_name'] . ' (' . $group . ')', - 'img' => $photo['pp_mini_photo'], - 'img_w' => $photo['pp_mini_width'], - 'img_h' => $photo['pp_mini_height'] - ); - } - - $this->returnJsonArray( $return ); - } + + * Invision Power Services + * IP.Board v3.4.6 + * Login handler abstraction : AJAX Find Names functions + * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $ + *
+ * + * @author $Author: bfarber $ + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license http://www.invisionpower.com/company/standards.php#license + * @package IP.Board + * @subpackage Core + * @link http://www.invisionpower.com + * @since Tuesday 1st March 2005 (11:52) + * @version $Revision: 10721 $ + * @see public_core_ajax_findnames + * + */ + +if ( ! defined( 'IN_ACP' ) ) +{ + print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +class admin_core_ajax_findnames extends ipsAjaxCommand +{ + /** + * Class entry point + * + * @param object Registry reference + * @return @e void [Outputs to screen] + */ + public function doExecute( ipsRegistry $registry ) + { + switch( $this->request['do'] ) + { + case 'get-member-names': + $this->_getMemberNames(); + break; + } + } + + /** + * Returns possible matches for the string input + * + * @return @e void Outputs to screen + */ + protected function _getMemberNames() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $name = IPSText::convertUnicode( $this->convertAndMakeSafe( $this->request['name'], 0 ), true ); + $name = IPSText::convertCharsets( $name, 'utf-8', IPS_DOC_CHAR_SET ); + + //----------------------------------------- + // Check length + //----------------------------------------- + + if ( IPSText::mbstrlen( $name ) < 3 ) + { + $this->returnJsonError( 'requestTooShort' ); + } + + //----------------------------------------- + // Try query... + //----------------------------------------- + + $this->DB->build( array( 'select' => 'm.members_display_name, m.name, m.member_id, m.member_group_id', + 'from' => array( 'members' => 'm' ), + 'where' => "m.members_l_display_name LIKE '" . $this->DB->addSlashes( strtolower( $name ) ) . "%'", + 'order' => $this->DB->buildLength( 'm.members_display_name' ) . ' ASC', + 'limit' => array( 0, 15 ), + 'add_join' => array( array( 'select' => 'p.*', + 'from' => array( 'profile_portal' => 'p' ), + 'where' => 'p.pp_member_id=m.member_id', + 'type' => 'left' ) ) ) ); + $this->DB->execute(); + + //----------------------------------------- + // Got any results? + //----------------------------------------- + + if ( ! $this->DB->getTotalRows() ) + { + $this->returnJsonArray( array( ) ); + } + + $return = array(); + + while( $r = $this->DB->fetch() ) + { + if( !$r['members_display_name'] ) + { + continue; + } + + $photo = IPSMember::buildProfilePhoto( $r ); + $group = IPSMember::makeNameFormatted( '' , $r['member_group_id'] ); + $return[ $r['member_id'] ] = array( 'name' => $r['members_display_name'], + 'showas'=> '' . $r['members_display_name'] . ' (' . $group . ')', + 'img' => $photo['pp_mini_photo'], + 'img_w' => $photo['pp_mini_width'], + 'img_h' => $photo['pp_mini_height'] + ); + } + + $this->returnJsonArray( $return ); + } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/ajax/hooks.php b/upload/admin/applications/core/modules_admin/ajax/hooks.php index e84e48b2..92c87e18 100644 --- a/upload/admin/applications/core/modules_admin/ajax/hooks.php +++ b/upload/admin/applications/core/modules_admin/ajax/hooks.php @@ -2,7 +2,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Hooks (AJAX)
  * Last Updated: $Date: 2013-02-15 17:36:04 -0500 (Fri, 15 Feb 2013) $
  * 
diff --git a/upload/admin/applications/core/modules_admin/ajax/index.html b/upload/admin/applications/core/modules_admin/ajax/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/ajax/index.html +++ b/upload/admin/applications/core/modules_admin/ajax/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/ajax/livesearch.php b/upload/admin/applications/core/modules_admin/ajax/livesearch.php index 205186a8..26ed51e1 100644 --- a/upload/admin/applications/core/modules_admin/ajax/livesearch.php +++ b/upload/admin/applications/core/modules_admin/ajax/livesearch.php @@ -1,566 +1,566 @@ - - * Invision Power Services - * IP.Board v3.4.5 - * Live Search - * Last Updated: $Date: 2012-12-06 10:19:49 -0500 (Thu, 06 Dec 2012) $ - *
- * - * @author $Author: mark $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/company/standards.php#license - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 11685 $ - * - */ - -if ( ! defined( 'IN_IPB' ) ) -{ - print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -class admin_core_ajax_livesearch extends ipsAjaxCommand -{ - /** - * Class entry point - * - * @param object Registry reference - * @return @e void [Outputs to screen] - */ - public function doExecute( ipsRegistry $registry ) - { - //----------------------------------------- - // Load skin - //----------------------------------------- - $this->registry->class_localization->loadLanguageFile( array( 'admin_ajax' ) ); - - /* What to do */ - switch( $this->request['do'] ) - { - default: - case 'search': - $this->doSearchRequest(); - break; - } - } - - /** - * Handles the live search - * - * @return @e void - */ - public function doSearchRequest() - { - //----------------------------------------- - // Init - //----------------------------------------- - - $search_term = IPSText::convertCharsets( $this->request['search_term'], 'utf-8', IPS_DOC_CHAR_SET ); - $results = array(); - $results = array( 'members' => array(), 'groups' => array(), 'groupLangs' => false, 'settings' => array(), 'forums' => array(), 'location' => array() ); - - if ( IPSLib::appIsInstalled('nexus') ) - { - $results['nexus'] = array(); - } - - //----------------------------------------- - // Search - //----------------------------------------- - - $results = $this->_getSettings( $search_term, $results ); - $results = $this->_getFromXML( $search_term, $results ); - $results = $this->_getMembers( $search_term, $results ); - $results = $this->_checkGroups( $search_term, $results ); - $results = $this->_checkForums( $search_term, $results ); - - if ( IPSLib::appIsInstalled('nexus') ) - { - $results = $this->_checkNexus( $search_term, $results ); - } - - //----------------------------------------- - // Output - //----------------------------------------- - - $this->returnJsonArray( $results ); - } - - /** - * Searches for matching members - * - * @param string Search term - * @param array Existing search results - * @return array New search results - */ - protected function _getMembers( $term, $results ) - { - if ( !$this->registry->getClass('class_permissions')->checkPermission( 'member_edit', 'members', 'members' ) ) - { - $results['members'] = array(); - return $results; - } - - $term = mb_strtolower($term); - - $this->DB->build( array('select' => 'm.*, pp.*, g.g_title', - 'from' => array('members' => 'm'), - 'where' => "members_l_username LIKE '%{$term}%' OR members_l_display_name LIKE '%{$term}%' OR " . $this->DB->buildLower('email') . " LIKE '%{$term}%'", - 'limit' => array(0, 250 ), - 'add_join' => array( array( 'from' => array( 'groups' => 'g' ), - 'where' => 'g.g_id=m.member_group_id', - 'type' => 'left' ), - array( 'from' => array( 'profile_portal' => 'pp' ), - 'where' => 'pp.pp_member_id=m.member_id', - 'type' => 'left' ) ) - ) ); - - $this->DB->execute(); - - while( $member = $this->DB->fetch() ) - { - $_matched = ''; - $member = $r = IPSMember::buildProfilePhoto( $member ); - $r = array(); - - if( $member['members_l_display_name'] AND mb_strpos( $term, $member['members_l_display_name'] ) !== false ) - { - $r['_matched'] = 'members_display_name'; - } - else if( $member['members_l_username'] AND mb_strpos( $term, $member['members_l_username'] ) !== false ) - { - $r['_matched'] = 'name'; - } - else - { - $r['_matched'] = 'email'; - } - - $r['name'] = $member['members_display_name']; - $r['extra'] = $member['g_title']; - $r['img'] = $member['pp_mini_photo']; - $r['url'] = $this->settings['_base_url']."&app=members&module=members&section=members&do=viewmember&member_id=".$member['member_id']; - - /* Trim out what we don't need */ - - $results['members'][] = $r; - } - - return $results; - } - - /** - * Check if search term is found in groups language file or in the group_cache.g_title - * - * @param string Search term - * @param array Existing search results - * @return array New search results - */ - protected function _checkGroups( $term, $results ) - { - if ( !$this->registry->getClass('class_permissions')->checkPermission( 'groups_edit', 'members', 'groups' ) ) - { - $results['groups'] = array(); - return $results; - } - - $term = mb_strtolower($term); - - $this->registry->class_localization->loadLanguageFile( array( 'admin_groups' ), 'members' ); - $this->registry->class_localization->loadLanguageFile( array( 'admin_forums' ), 'forums' ); - $this->registry->class_localization->loadLanguageFile( array( 'admin_gallery' ), 'gallery' ); - $this->registry->class_localization->loadLanguageFile( array( 'admin_blog' ), 'blog' ); - $this->registry->class_localization->loadLanguageFile( array( 'admin_downloads' ), 'downloads' ); - - foreach( $this->lang->words as $k => $v ) - { - if( strpos( $k, 'gf_' ) !== false AND mb_strpos( $v, $term ) !== false ) - { - IPSDebug::fireBug( 'info', array( 'Group key found: ' . $k . ': ' . $v ) ); - - $results['groupLangs'] = true; - break; - } - } - - /* Now check group names */ - $groups = $this->cache->getCache('group_cache'); - - if ( is_array( $groups ) AND count( $groups ) ) - { - foreach( $groups as $id => $data ) - { - $_term = preg_quote( $term, '#' ); - - if ( preg_match( "#" . $_term . "#iu", $data['g_title'] ) ) - { - $results['groups'][] = array( - 'name' => IPSMember::makeNameFormatted( $data['g_title'], $data['g_id'] ), - 'url' => $this->settings['_base_url'] . "&app=members&module=groups&section=groups&do=edit&id=" . $data['g_id'], - ); - } - } - } - - return $results; - } - - /** - * Check if search term is found in groups language file - * - * @param string Search term - * @param array Existing search results - * @return array New search results - */ - protected function _checkForums( $term, $results ) - { - if ( !$this->registry->getClass('class_permissions')->checkPermission( 'forums_edit', 'forums', 'forums' ) ) - { - $results['forums'] = array(); - return $results; - } - - $term = mb_strtolower($term); - $results['forums'] = false; - - /* Fetch forums lib */ - $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums' ); - $forums = new $classToLoad( $this->registry ); - $forums->strip_invisible = 1; - $forums->forumsInit(); - - /* Now check forum titles names */ - foreach( $forums->forum_by_id as $id => $data ) - { - $_term = preg_quote( $term, '#' ); - - if ( preg_match( "#" . $_term . "#iu", $data['name'] ) ) - { - $data['extra'] = ( ( $data['posts'] == null ) ? 0 : $data['posts'] ) . " сообщений"; - $data['url'] = $this->settings['_base_url']."&app=forums&module=forums&section=forums&do=edit&f=".$data['id']; - $results['forums'][] = $data; - } - } - - return $results; - } - - /** - * Searches the settings table - * - * @param string Search term - * @param array Existing search results - * @return array New search results - */ - protected function _getSettings( $term, $results ) - { - if ( !$this->registry->getClass('class_permissions')->checkPermission( 'settings_manage', 'core', 'settings' ) ) - { - $results['settings'] = array(); - return $results; - } - - $term = mb_strtolower($term); - - if( !IN_DEV ) - { - $this->DB->build( array( 'select' => 'c.conf_group, c.conf_title, c.conf_description, c.conf_keywords', - 'from' => array( 'core_sys_conf_settings' => 'c' ), - 'where' => 't.conf_title_noshow=0 AND (' . $this->DB->buildLower('c.conf_title') . " LIKE '%{$term}%' OR ". $this->DB->buildLower('c.conf_description') . " LIKE '%{$term}%' OR " . $this->DB->buildLower('c.conf_keywords') . " LIKE '%{$term}%')", - 'add_join' => array( array( 'from' => array( 'core_sys_settings_titles' => 't' ), - 'where' => 't.conf_title_id=c.conf_group', - 'type' => 'left' ) ) - ) ); - } - else - { - $this->DB->build( array( 'select' => 'conf_group, conf_title, conf_description, conf_keywords', - 'from' => 'core_sys_conf_settings', - 'where' => $this->DB->buildLower('conf_title') . " LIKE '%{$term}%' OR ". $this->DB->buildLower('conf_description') . " LIKE '%{$term}%' OR " . $this->DB->buildLower('conf_keywords') . " LIKE '%{$term}%'", - ) ); - } - - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $r['name'] = $r['conf_title']; - $r['url'] = $this->settings['_base_url']."&app=core&module=settings&section=settings&do=setting_view&conf_group=" . $r['conf_group'] . "&search=" . $this->request['search_term']; - - $results['settings'][] = $r; - } - - return $results; - } - - /** - * Searches Nexus - * - * @param string Search term - * @param array Existing search results - * @return array New search results - */ - protected function _checkNexus( $term, $results ) - { - if ( !$this->registry->getClass('class_permissions')->checkForAppAccess('nexus') ) - { - $results['nexus'] = array(); - return $results; - } - - $textTerm = $this->DB->addSlashes( mb_strtolower( $term ) ); - $intTerm = intval( $term ); - $encodedTerm = urlencode( $encodedTerm ); - - $tempResults = array(); - - require_once( IPSLib::getAppDir('nexus') . '/sources/customer.php' );/*noLibHook*/ - - //----------------------------------------- - // Is it a number? - //----------------------------------------- - - if ( (string) $term == (string) $intTerm ) - { - /* Invoice? */ - if ( $this->registry->getClass('class_permissions')->checkPermission( 'invoices_manage', 'nexus', 'payments' ) ) - { - $invoice = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'nexus_invoices', 'where' => "i_id={$intTerm}" ) ); - if ( $invoice['i_id'] ) - { - $tempResults['invoice'] = array( 'name' => $invoice['i_title'], 'url' => $this->settings['_base_url']."&app=nexus&module=payments&section=invoices&do=view_invoice&id={$invoice['i_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/invoice.png' ); - } - } - - /* Purchase? */ - if ( $this->registry->getClass('class_permissions')->checkPermission( 'purchases_view', 'nexus', 'payments' ) ) - { - $purchase = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'nexus_purchases', 'where' => "ps_id={$intTerm}" ) ); - if ( $purchase['ps_id'] ) - { - $tempResults['purchase'] = array( 'name' => $purchase['ps_name'], 'url' => $this->settings['_base_url']."&app=nexus&module=payments&section=purchases&id={$purchase['ps_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/purchase.png' ); - } - } - - /* Support */ - if ( $this->registry->getClass('class_permissions')->checkPermission( 'sr_view', 'nexus', 'tickets' ) ) - { - $support = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'nexus_support_requests', 'where' => "r_id={$intTerm}" ) ); - if ( $support['r_id'] ) - { - $tempResults['support'] = array( 'name' => $support['r_title'], 'url' => $this->settings['_base_url']."&app=nexus&module=tickets&section=view&id={$support['r_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/support.png' ); - } - } - - /* Customer */ - if ( $this->registry->getClass('class_permissions')->checkForModuleAccess( 'nexus', 'customers' ) ) - { - $customer = $this->DB->buildAndFetch( array( 'select' => 'member_id, members_display_name', 'from' => 'members', 'where' => "member_id={$intTerm}" ) ); - if ( $customer['member_id'] ) - { - if ( !preg_replace( '/\s/', '', $customer['members_display_name'] ) ) - { - $customer['members_display_name'] = '?????'; - } - - $tempResults['member'] = array( 'name' => $customer['members_display_name'], 'url' => $this->settings['_base_url']."&app=nexus&module=customers&section=view&id={$customer['member_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/info.png' ); - } - } - - /* Transaction? */ - if ( $this->registry->getClass('class_permissions')->checkPermission( 'transactions_manage', 'nexus', 'payments' ) ) - { - $transaction = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'nexus_transactions', 'where' => "t_id={$intTerm}" ) ); - if ( $transaction['t_id'] ) - { - $tempResults['transactions'] = array( 'name' => $transaction['t_id'], 'url' => $this->settings['_base_url']."&app=nexus&module=payments&section=transactions&do=view&id={$transaction['t_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/transaction.png' ); - } - } - - } - - //----------------------------------------- - // Nope - text - //----------------------------------------- - - else - { - /* License Key */ - if ( $this->registry->getClass('class_permissions')->checkPermission( 'purchases_view', 'nexus', 'payments' ) ) - { - $lkey = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'nexus_licensekeys', 'where' => $this->DB->buildLower('lkey_key') ."='{$textTerm}'" ) ); - if ( $lkey['lkey_key'] ) - { - $tempResults['lkey'] = array( 'name' => $lkey['lkey_key'], 'url' => $this->settings['_base_url']."&app=nexus&module=payments&section=purchases&id={$lkey['lkey_purchase']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/lkey.png' ); - } - } - - /* Customers */ - if ( $this->registry->getClass('class_permissions')->checkForModuleAccess( 'nexus', 'customers' ) ) - { - $customer = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'members', 'where' => $this->DB->buildLower('email') ." LIKE '%{$textTerm}%'" ) ); - if ( $customer['count'] ) - { - if ( $customer['count'] > 50 ) - { - $tempResults['member'] = array( 'name' => sprintf( $this->lang->words['livesearch_more'], $customer['count'] ), 'url' => "{$this->settings['base_url']}app=nexus&module=customers&section=search&searchpag=1&option=email&criteria=contains&value={$encodedTerm}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/info.png' ); - - } - else - { - $this->DB->build( array( 'select' => 'member_id, email', 'from' => 'members', 'where' => $this->DB->buildLower('email') ." LIKE '%{$textTerm}%'" ) ); - $this->DB->execute(); - while ( $row = $this->DB->fetch() ) - { - $tempResults['member'][] = array( 'name' => $row['email'], 'url' => $this->settings['_base_url']."&app=nexus&module=customers&section=view&id={$row['member_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/info.png' ); - } - } - } - - $customer = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'members', 'where' => "members_l_display_name LIKE '%{$textTerm}%'" ) ); - if ( $customer['count'] ) - { - if ( $customer['count'] > 50 ) - { - $tempResults['member'] = array( 'name' => sprintf( $this->lang->words['livesearch_more'], $customer['count'] ), 'url' => "{$this->settings['base_url']}app=nexus&module=customers&section=search&searchpag=1&option=email&criteria=contains&value={$encodedTerm}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/info.png' ); - - } - else - { - $this->DB->build( array( 'select' => 'member_id, members_display_name', 'from' => 'members', 'where' => "members_l_display_name LIKE '%{$textTerm}%'" ) ); - $this->DB->execute(); - while ( $row = $this->DB->fetch() ) - { - $tempResults['member'][] = array( 'name' => $row['members_display_name'], 'url' => $this->settings['_base_url']."&app=nexus&module=customers&section=view&id={$row['member_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/info.png' ); - } - } - } - } - - /* Hosting Accounts */ - if ( $this->registry->getClass('class_permissions')->checkPermission( 'purchases_view', 'nexus', 'payments' ) ) - { - if ( strpos( $textTerm, '.' ) === FALSE ) - { - $hosting = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'nexus_hosting_accounts', 'where' => $this->DB->buildLower('account_username') . " LIKE '%{$textTerm}%'" ) ); - if ( $hosting['count'] ) - { - if ( $hosting['count'] > 50 ) - { - $tempResults['hosting'] = array( 'name' => sprintf( $this->lang->words['livesearch_more'], $customer['count'] ), 'url' => "&app=nexus&module=search&section=search&nexus_search={$encodedTerm}&nexus_searchby=username", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/nexus_icons/hosting.png' ); - - } - else - { - $this->DB->build( array( 'select' => 'ps_id, account_username', 'from' => 'nexus_hosting_accounts', 'where' => $this->DB->buildLower('account_username') . " LIKE '%{$textTerm}%'" ) ); - $this->DB->execute(); - while ( $row = $this->DB->fetch() ) - { - $tempResults['hosting'][] = array( 'name' => $row['account_username'], 'url' => $this->settings['_base_url']."&app=nexus&module=payments&section=purchases&id={$row['ps_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/nexus_icons/hosting.png' ); - } - } - } - } - if ( empty( $tempResults['hosting'] ) ) - { - $hosting = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'nexus_hosting_accounts', 'where' => $this->DB->buildLower('account_domain') . " LIKE '%{$textTerm}%'" ) ); - if ( $hosting['count'] ) - { - if ( $hosting['count'] > 50 ) - { - $tempResults['hosting'] = array( 'name' => sprintf( $this->lang->words['livesearch_more'], $customer['count'] ), 'url' => "&app=nexus&module=search&section=search&nexus_search={$encodedTerm}&nexus_searchby=domain", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/info.png' ); - - } - else - { - $this->DB->build( array( 'select' => 'ps_id, account_domain', 'from' => 'nexus_hosting_accounts', 'where' => $this->DB->buildLower('account_domain') . " LIKE '%{$textTerm}%'" ) ); - $this->DB->execute(); - while ( $row = $this->DB->fetch() ) - { - $tempResults['hosting'][] = array( 'name' => $row['account_domain'], 'url' => $this->settings['_base_url']."&app=nexus&module=payments&section=purchases&id={$row['ps_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/nexus_icons/hosting.png' ); - } - } - } - } - } - } - - //----------------------------------------- - // Return results - //----------------------------------------- - - - foreach ( array( 'invoice', 'purchase', 'transactions', 'lkey', 'support', 'member', 'hosting' ) as $k ) - { - if ( isset( $tempResults[ $k ] ) ) - { - if ( isset( $tempResults[ $k ][0] ) ) - { - foreach ( $tempResults[ $k ] as $l ) - { - $results['nexus'][] = $l; - } - } - else - { - $results['nexus'][] = $tempResults[ $k ]; - } - } - } - - return $results; - } - - /** - * Searches the XML Files - * - * @param string Search term - * @param array Existing search results - * @return array New search results - */ - protected function _getFromXML( $term, $results ) - { - foreach( $this->cache->getCache('app_menu_cache') as $app => $cache ) - { - if( IPSLib::appIsInstalled( $app ) and $this->registry->getClass('class_permissions')->checkForAppAccess( $app ) ) - { - foreach( $cache as $entry ) - { - if( count($entry['items']) ) - { - foreach( $entry['items'] as $item ) - { - if ( $this->registry->getClass('class_permissions')->checkForModuleAccess( $app, $item['module'] ) and ( !$item['rolekey'] or $this->registry->getClass('class_permissions')->checkPermission( $item['rolekey'], $app, $item['module'] ) ) ) - { - if( $item['section'] ) - { - $item['url'] = "section={$item['section']}&" . $item['url']; - } - - if( isset($item['keywords']) AND mb_stripos( $item['keywords'], $term ) !== false ) - { - $item['name'] = $item['title']; - $item['url'] = $this->settings['_base_url']."&app={$app}&module={$item['module']}&{$item['url']}"; - $results['location'][] = $item; - } - else if( mb_stripos( $item['title'], $term ) !== false ) - { - $item['name'] = $item['title']; - $item['url'] = $this->settings['_base_url']."&app={$app}&module={$item['module']}&{$item['url']}"; - $results['location'][] = $item; - } - } - } - } - } - } - } - - return $results; - } + + * Invision Power Services + * IP.Board v3.4.6 + * Live Search + * Last Updated: $Date: 2012-12-06 10:19:49 -0500 (Thu, 06 Dec 2012) $ + *
+ * + * @author $Author: mark $ + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license http://www.invisionpower.com/company/standards.php#license + * @package IP.Board + * @subpackage Core + * @link http://www.invisionpower.com + * @version $Rev: 11685 $ + * + */ + +if ( ! defined( 'IN_IPB' ) ) +{ + print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +class admin_core_ajax_livesearch extends ipsAjaxCommand +{ + /** + * Class entry point + * + * @param object Registry reference + * @return @e void [Outputs to screen] + */ + public function doExecute( ipsRegistry $registry ) + { + //----------------------------------------- + // Load skin + //----------------------------------------- + $this->registry->class_localization->loadLanguageFile( array( 'admin_ajax' ) ); + + /* What to do */ + switch( $this->request['do'] ) + { + default: + case 'search': + $this->doSearchRequest(); + break; + } + } + + /** + * Handles the live search + * + * @return @e void + */ + public function doSearchRequest() + { + //----------------------------------------- + // Init + //----------------------------------------- + + $search_term = IPSText::convertCharsets( $this->request['search_term'], 'utf-8', IPS_DOC_CHAR_SET ); + $results = array(); + $results = array( 'members' => array(), 'groups' => array(), 'groupLangs' => false, 'settings' => array(), 'forums' => array(), 'location' => array() ); + + if ( IPSLib::appIsInstalled('nexus') ) + { + $results['nexus'] = array(); + } + + //----------------------------------------- + // Search + //----------------------------------------- + + $results = $this->_getSettings( $search_term, $results ); + $results = $this->_getFromXML( $search_term, $results ); + $results = $this->_getMembers( $search_term, $results ); + $results = $this->_checkGroups( $search_term, $results ); + $results = $this->_checkForums( $search_term, $results ); + + if ( IPSLib::appIsInstalled('nexus') ) + { + $results = $this->_checkNexus( $search_term, $results ); + } + + //----------------------------------------- + // Output + //----------------------------------------- + + $this->returnJsonArray( $results ); + } + + /** + * Searches for matching members + * + * @param string Search term + * @param array Existing search results + * @return array New search results + */ + protected function _getMembers( $term, $results ) + { + if ( !$this->registry->getClass('class_permissions')->checkPermission( 'member_edit', 'members', 'members' ) ) + { + $results['members'] = array(); + return $results; + } + + $term = strtolower($term); + + $this->DB->build( array('select' => 'm.*, pp.*, g.g_title', + 'from' => array('members' => 'm'), + 'where' => "members_l_username LIKE '%{$term}%' OR members_l_display_name LIKE '%{$term}%' OR " . $this->DB->buildLower('email') . " LIKE '%{$term}%'", + 'limit' => array(0, 250 ), + 'add_join' => array( array( 'from' => array( 'groups' => 'g' ), + 'where' => 'g.g_id=m.member_group_id', + 'type' => 'left' ), + array( 'from' => array( 'profile_portal' => 'pp' ), + 'where' => 'pp.pp_member_id=m.member_id', + 'type' => 'left' ) ) + ) ); + + $this->DB->execute(); + + while( $member = $this->DB->fetch() ) + { + $_matched = ''; + $member = $r = IPSMember::buildProfilePhoto( $member ); + $r = array(); + + if( $member['members_l_display_name'] AND strpos( $term, $member['members_l_display_name'] ) !== false ) + { + $r['_matched'] = 'members_display_name'; + } + else if( $member['members_l_username'] AND strpos( $term, $member['members_l_username'] ) !== false ) + { + $r['_matched'] = 'name'; + } + else + { + $r['_matched'] = 'email'; + } + + $r['name'] = $member['members_display_name']; + $r['extra'] = $member['g_title']; + $r['img'] = $member['pp_mini_photo']; + $r['url'] = $this->settings['_base_url']."&app=members&module=members&section=members&do=viewmember&member_id=".$member['member_id']; + + /* Trim out what we don't need */ + + $results['members'][] = $r; + } + + return $results; + } + + /** + * Check if search term is found in groups language file or in the group_cache.g_title + * + * @param string Search term + * @param array Existing search results + * @return array New search results + */ + protected function _checkGroups( $term, $results ) + { + if ( !$this->registry->getClass('class_permissions')->checkPermission( 'groups_edit', 'members', 'groups' ) ) + { + $results['groups'] = array(); + return $results; + } + + $term = strtolower($term); + + $this->registry->class_localization->loadLanguageFile( array( 'admin_groups' ), 'members' ); + $this->registry->class_localization->loadLanguageFile( array( 'admin_forums' ), 'forums' ); + $this->registry->class_localization->loadLanguageFile( array( 'admin_gallery' ), 'gallery' ); + $this->registry->class_localization->loadLanguageFile( array( 'admin_blog' ), 'blog' ); + $this->registry->class_localization->loadLanguageFile( array( 'admin_downloads' ), 'downloads' ); + + foreach( $this->lang->words as $k => $v ) + { + if( strpos( $k, 'gf_' ) !== false AND strpos( $v, $term ) !== false ) + { + IPSDebug::fireBug( 'info', array( 'Group key found: ' . $k . ': ' . $v ) ); + + $results['groupLangs'] = true; + break; + } + } + + /* Now check group names */ + $groups = $this->cache->getCache('group_cache'); + + if ( is_array( $groups ) AND count( $groups ) ) + { + foreach( $groups as $id => $data ) + { + $_term = preg_quote( $term, '#' ); + + if ( preg_match( "#" . $_term . "#i", $data['g_title'] ) ) + { + $results['groups'][] = array( + 'name' => IPSMember::makeNameFormatted( $data['g_title'], $data['g_id'] ), + 'url' => $this->settings['_base_url'] . "&app=members&module=groups&section=groups&do=edit&id=" . $data['g_id'], + ); + } + } + } + + return $results; + } + + /** + * Check if search term is found in groups language file + * + * @param string Search term + * @param array Existing search results + * @return array New search results + */ + protected function _checkForums( $term, $results ) + { + if ( !$this->registry->getClass('class_permissions')->checkPermission( 'forums_edit', 'forums', 'forums' ) ) + { + $results['forums'] = array(); + return $results; + } + + $term = strtolower($term); + $results['forums'] = false; + + /* Fetch forums lib */ + $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums' ); + $forums = new $classToLoad( $this->registry ); + $forums->strip_invisible = 1; + $forums->forumsInit(); + + /* Now check forum titles names */ + foreach( $forums->forum_by_id as $id => $data ) + { + $_term = preg_quote( $term, '#' ); + + if ( preg_match( "#" . $_term . "#i", $data['name'] ) ) + { + $data['extra'] = ( ( $data['posts'] == null ) ? 0 : $data['posts'] ) . " posts"; + $data['url'] = $this->settings['_base_url']."&app=forums&module=forums&section=forums&do=edit&f=".$data['id']; + $results['forums'][] = $data; + } + } + + return $results; + } + + /** + * Searches the settings table + * + * @param string Search term + * @param array Existing search results + * @return array New search results + */ + protected function _getSettings( $term, $results ) + { + if ( !$this->registry->getClass('class_permissions')->checkPermission( 'settings_manage', 'core', 'settings' ) ) + { + $results['settings'] = array(); + return $results; + } + + $term = strtolower($term); + + if( !IN_DEV ) + { + $this->DB->build( array( 'select' => 'c.conf_group, c.conf_title, c.conf_description, c.conf_keywords', + 'from' => array( 'core_sys_conf_settings' => 'c' ), + 'where' => 't.conf_title_noshow=0 AND (' . $this->DB->buildLower('c.conf_title') . " LIKE '%{$term}%' OR ". $this->DB->buildLower('c.conf_description') . " LIKE '%{$term}%' OR " . $this->DB->buildLower('c.conf_keywords') . " LIKE '%{$term}%')", + 'add_join' => array( array( 'from' => array( 'core_sys_settings_titles' => 't' ), + 'where' => 't.conf_title_id=c.conf_group', + 'type' => 'left' ) ) + ) ); + } + else + { + $this->DB->build( array( 'select' => 'conf_group, conf_title, conf_description, conf_keywords', + 'from' => 'core_sys_conf_settings', + 'where' => $this->DB->buildLower('conf_title') . " LIKE '%{$term}%' OR ". $this->DB->buildLower('conf_description') . " LIKE '%{$term}%' OR " . $this->DB->buildLower('conf_keywords') . " LIKE '%{$term}%'", + ) ); + } + + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $r['name'] = $r['conf_title']; + $r['url'] = $this->settings['_base_url']."&app=core&module=settings&section=settings&do=setting_view&conf_group=" . $r['conf_group'] . "&search=" . $this->request['search_term']; + + $results['settings'][] = $r; + } + + return $results; + } + + /** + * Searches Nexus + * + * @param string Search term + * @param array Existing search results + * @return array New search results + */ + protected function _checkNexus( $term, $results ) + { + if ( !$this->registry->getClass('class_permissions')->checkForAppAccess('nexus') ) + { + $results['nexus'] = array(); + return $results; + } + + $textTerm = $this->DB->addSlashes( strtolower( $term ) ); + $intTerm = intval( $term ); + $encodedTerm = urlencode( $encodedTerm ); + + $tempResults = array(); + + require_once( IPSLib::getAppDir('nexus') . '/sources/customer.php' );/*noLibHook*/ + + //----------------------------------------- + // Is it a number? + //----------------------------------------- + + if ( (string) $term == (string) $intTerm ) + { + /* Invoice? */ + if ( $this->registry->getClass('class_permissions')->checkPermission( 'invoices_manage', 'nexus', 'payments' ) ) + { + $invoice = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'nexus_invoices', 'where' => "i_id={$intTerm}" ) ); + if ( $invoice['i_id'] ) + { + $tempResults['invoice'] = array( 'name' => $invoice['i_title'], 'url' => $this->settings['_base_url']."&app=nexus&module=payments&section=invoices&do=view_invoice&id={$invoice['i_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/invoice.png' ); + } + } + + /* Purchase? */ + if ( $this->registry->getClass('class_permissions')->checkPermission( 'purchases_view', 'nexus', 'payments' ) ) + { + $purchase = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'nexus_purchases', 'where' => "ps_id={$intTerm}" ) ); + if ( $purchase['ps_id'] ) + { + $tempResults['purchase'] = array( 'name' => $purchase['ps_name'], 'url' => $this->settings['_base_url']."&app=nexus&module=payments&section=purchases&id={$purchase['ps_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/purchase.png' ); + } + } + + /* Support */ + if ( $this->registry->getClass('class_permissions')->checkPermission( 'sr_view', 'nexus', 'tickets' ) ) + { + $support = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'nexus_support_requests', 'where' => "r_id={$intTerm}" ) ); + if ( $support['r_id'] ) + { + $tempResults['support'] = array( 'name' => $support['r_title'], 'url' => $this->settings['_base_url']."&app=nexus&module=tickets&section=view&id={$support['r_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/support.png' ); + } + } + + /* Customer */ + if ( $this->registry->getClass('class_permissions')->checkForModuleAccess( 'nexus', 'customers' ) ) + { + $customer = $this->DB->buildAndFetch( array( 'select' => 'member_id, members_display_name', 'from' => 'members', 'where' => "member_id={$intTerm}" ) ); + if ( $customer['member_id'] ) + { + if ( !preg_replace( '/\s/', '', $customer['members_display_name'] ) ) + { + $customer['members_display_name'] = '?????'; + } + + $tempResults['member'] = array( 'name' => $customer['members_display_name'], 'url' => $this->settings['_base_url']."&app=nexus&module=customers&section=view&id={$customer['member_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/info.png' ); + } + } + + /* Transaction? */ + if ( $this->registry->getClass('class_permissions')->checkPermission( 'transactions_manage', 'nexus', 'payments' ) ) + { + $transaction = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'nexus_transactions', 'where' => "t_id={$intTerm}" ) ); + if ( $transaction['t_id'] ) + { + $tempResults['transactions'] = array( 'name' => $transaction['t_id'], 'url' => $this->settings['_base_url']."&app=nexus&module=payments&section=transactions&do=view&id={$transaction['t_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/transaction.png' ); + } + } + + } + + //----------------------------------------- + // Nope - text + //----------------------------------------- + + else + { + /* License Key */ + if ( $this->registry->getClass('class_permissions')->checkPermission( 'purchases_view', 'nexus', 'payments' ) ) + { + $lkey = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'nexus_licensekeys', 'where' => $this->DB->buildLower('lkey_key') ."='{$textTerm}'" ) ); + if ( $lkey['lkey_key'] ) + { + $tempResults['lkey'] = array( 'name' => $lkey['lkey_key'], 'url' => $this->settings['_base_url']."&app=nexus&module=payments&section=purchases&id={$lkey['lkey_purchase']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/lkey.png' ); + } + } + + /* Customers */ + if ( $this->registry->getClass('class_permissions')->checkForModuleAccess( 'nexus', 'customers' ) ) + { + $customer = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'members', 'where' => $this->DB->buildLower('email') ." LIKE '%{$textTerm}%'" ) ); + if ( $customer['count'] ) + { + if ( $customer['count'] > 50 ) + { + $tempResults['member'] = array( 'name' => sprintf( $this->lang->words['livesearch_more'], $customer['count'] ), 'url' => "{$this->settings['base_url']}app=nexus&module=customers&section=search&searchpag=1&option=email&criteria=contains&value={$encodedTerm}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/info.png' ); + + } + else + { + $this->DB->build( array( 'select' => 'member_id, email', 'from' => 'members', 'where' => $this->DB->buildLower('email') ." LIKE '%{$textTerm}%'" ) ); + $this->DB->execute(); + while ( $row = $this->DB->fetch() ) + { + $tempResults['member'][] = array( 'name' => $row['email'], 'url' => $this->settings['_base_url']."&app=nexus&module=customers&section=view&id={$row['member_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/info.png' ); + } + } + } + + $customer = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'members', 'where' => "members_l_display_name LIKE '%{$textTerm}%'" ) ); + if ( $customer['count'] ) + { + if ( $customer['count'] > 50 ) + { + $tempResults['member'] = array( 'name' => sprintf( $this->lang->words['livesearch_more'], $customer['count'] ), 'url' => "{$this->settings['base_url']}app=nexus&module=customers&section=search&searchpag=1&option=email&criteria=contains&value={$encodedTerm}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/info.png' ); + + } + else + { + $this->DB->build( array( 'select' => 'member_id, members_display_name', 'from' => 'members', 'where' => "members_l_display_name LIKE '%{$textTerm}%'" ) ); + $this->DB->execute(); + while ( $row = $this->DB->fetch() ) + { + $tempResults['member'][] = array( 'name' => $row['members_display_name'], 'url' => $this->settings['_base_url']."&app=nexus&module=customers&section=view&id={$row['member_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/info.png' ); + } + } + } + } + + /* Hosting Accounts */ + if ( $this->registry->getClass('class_permissions')->checkPermission( 'purchases_view', 'nexus', 'payments' ) ) + { + if ( strpos( $textTerm, '.' ) === FALSE ) + { + $hosting = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'nexus_hosting_accounts', 'where' => $this->DB->buildLower('account_username') . " LIKE '%{$textTerm}%'" ) ); + if ( $hosting['count'] ) + { + if ( $hosting['count'] > 50 ) + { + $tempResults['hosting'] = array( 'name' => sprintf( $this->lang->words['livesearch_more'], $customer['count'] ), 'url' => "&app=nexus&module=search&section=search&nexus_search={$encodedTerm}&nexus_searchby=username", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/nexus_icons/hosting.png' ); + + } + else + { + $this->DB->build( array( 'select' => 'ps_id, account_username', 'from' => 'nexus_hosting_accounts', 'where' => $this->DB->buildLower('account_username') . " LIKE '%{$textTerm}%'" ) ); + $this->DB->execute(); + while ( $row = $this->DB->fetch() ) + { + $tempResults['hosting'][] = array( 'name' => $row['account_username'], 'url' => $this->settings['_base_url']."&app=nexus&module=payments&section=purchases&id={$row['ps_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/nexus_icons/hosting.png' ); + } + } + } + } + if ( empty( $tempResults['hosting'] ) ) + { + $hosting = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'nexus_hosting_accounts', 'where' => $this->DB->buildLower('account_domain') . " LIKE '%{$textTerm}%'" ) ); + if ( $hosting['count'] ) + { + if ( $hosting['count'] > 50 ) + { + $tempResults['hosting'] = array( 'name' => sprintf( $this->lang->words['livesearch_more'], $customer['count'] ), 'url' => "&app=nexus&module=search&section=search&nexus_search={$encodedTerm}&nexus_searchby=domain", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/customers/info.png' ); + + } + else + { + $this->DB->build( array( 'select' => 'ps_id, account_domain', 'from' => 'nexus_hosting_accounts', 'where' => $this->DB->buildLower('account_domain') . " LIKE '%{$textTerm}%'" ) ); + $this->DB->execute(); + while ( $row = $this->DB->fetch() ) + { + $tempResults['hosting'][] = array( 'name' => $row['account_domain'], 'url' => $this->settings['_base_url']."&app=nexus&module=payments&section=purchases&id={$row['ps_id']}", 'img' => $this->settings['base_acp_url'] . '/applications_addon/ips/nexus/skin_cp/images/nexus_icons/hosting.png' ); + } + } + } + } + } + } + + //----------------------------------------- + // Return results + //----------------------------------------- + + + foreach ( array( 'invoice', 'purchase', 'transactions', 'lkey', 'support', 'member', 'hosting' ) as $k ) + { + if ( isset( $tempResults[ $k ] ) ) + { + if ( isset( $tempResults[ $k ][0] ) ) + { + foreach ( $tempResults[ $k ] as $l ) + { + $results['nexus'][] = $l; + } + } + else + { + $results['nexus'][] = $tempResults[ $k ]; + } + } + } + + return $results; + } + + /** + * Searches the XML Files + * + * @param string Search term + * @param array Existing search results + * @return array New search results + */ + protected function _getFromXML( $term, $results ) + { + foreach( $this->cache->getCache('app_menu_cache') as $app => $cache ) + { + if( IPSLib::appIsInstalled( $app ) and $this->registry->getClass('class_permissions')->checkForAppAccess( $app ) ) + { + foreach( $cache as $entry ) + { + if( count($entry['items']) ) + { + foreach( $entry['items'] as $item ) + { + if ( $this->registry->getClass('class_permissions')->checkForModuleAccess( $app, $item['module'] ) and ( !$item['rolekey'] or $this->registry->getClass('class_permissions')->checkPermission( $item['rolekey'], $app, $item['module'] ) ) ) + { + if( $item['section'] ) + { + $item['url'] = "section={$item['section']}&" . $item['url']; + } + + if( isset($item['keywords']) AND stripos( $item['keywords'], $term ) !== false ) + { + $item['name'] = $item['title']; + $item['url'] = $this->settings['_base_url']."&app={$app}&module={$item['module']}&{$item['url']}"; + $results['location'][] = $item; + } + else if( stripos( $item['title'], $term ) !== false ) + { + $item['name'] = $item['title']; + $item['url'] = $this->settings['_base_url']."&app={$app}&module={$item['module']}&{$item['url']}"; + $results['location'][] = $item; + } + } + } + } + } + } + } + + return $results; + } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/ajax/replacements.php b/upload/admin/applications/core/modules_admin/ajax/replacements.php index f8ca67ae..86068ba9 100644 --- a/upload/admin/applications/core/modules_admin/ajax/replacements.php +++ b/upload/admin/applications/core/modules_admin/ajax/replacements.php @@ -3,7 +3,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * AJAX Functions For applications/core/js/ipb3CSS.js file
  * Last Updated: $Date: 2012-05-24 16:20:59 -0400 (Thu, 24 May 2012) $
  * 
diff --git a/upload/admin/applications/core/modules_admin/ajax/skinsets.php b/upload/admin/applications/core/modules_admin/ajax/skinsets.php index 668d3a62..d73941cc 100644 --- a/upload/admin/applications/core/modules_admin/ajax/skinsets.php +++ b/upload/admin/applications/core/modules_admin/ajax/skinsets.php @@ -3,7 +3,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * AJAX Functions For applications/core/js/ipb3CSS.js file
  * Last Updated: $Date: 2011-05-05 12:03:47 +0100 (Thu, 05 May 2011) $
  * 
diff --git a/upload/admin/applications/core/modules_admin/ajax/tabs.php b/upload/admin/applications/core/modules_admin/ajax/tabs.php index 1b4f1fe4..29f044bd 100644 --- a/upload/admin/applications/core/modules_admin/ajax/tabs.php +++ b/upload/admin/applications/core/modules_admin/ajax/tabs.php @@ -7,7 +7,7 @@ * $Author: bfarber $ * @since 8th Feb 2011 * $LastChangedDate: 2011-03-10 16:00:38 -0500 (Thu, 10 Mar 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 8021 $ */ diff --git a/upload/admin/applications/core/modules_admin/ajax/templatediff.php b/upload/admin/applications/core/modules_admin/ajax/templatediff.php index c59f7048..223613d3 100644 --- a/upload/admin/applications/core/modules_admin/ajax/templatediff.php +++ b/upload/admin/applications/core/modules_admin/ajax/templatediff.php @@ -3,7 +3,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * AJAX Functions For applications/core/js/ipb3Templates.js file
  * Last Updated: $Date: 2012-11-30 10:02:12 -0500 (Fri, 30 Nov 2012) $
  * 
diff --git a/upload/admin/applications/core/modules_admin/ajax/templates.php b/upload/admin/applications/core/modules_admin/ajax/templates.php index bf3f9083..b0ef57f5 100644 --- a/upload/admin/applications/core/modules_admin/ajax/templates.php +++ b/upload/admin/applications/core/modules_admin/ajax/templates.php @@ -3,7 +3,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * AJAX Functions For applications/core/js/ipb3Templates.js file
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
diff --git a/upload/admin/applications/core/modules_admin/ajax/templatesandr.php b/upload/admin/applications/core/modules_admin/ajax/templatesandr.php index e75a4125..bf3e726b 100644 --- a/upload/admin/applications/core/modules_admin/ajax/templatesandr.php +++ b/upload/admin/applications/core/modules_admin/ajax/templatesandr.php @@ -3,7 +3,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * AJAX Functions For applications/core/js/ipb3Templates.js file
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
diff --git a/upload/admin/applications/core/modules_admin/ajax/uagents.php b/upload/admin/applications/core/modules_admin/ajax/uagents.php index e484a782..b793371f 100644 --- a/upload/admin/applications/core/modules_admin/ajax/uagents.php +++ b/upload/admin/applications/core/modules_admin/ajax/uagents.php @@ -3,7 +3,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * AJAX Functions For applications/core/js/ipb3CSS.js file
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
diff --git a/upload/admin/applications/core/modules_admin/applications/applications.php b/upload/admin/applications/core/modules_admin/applications/applications.php index c33a4bcc..79b0ef8d 100644 --- a/upload/admin/applications/core/modules_admin/applications/applications.php +++ b/upload/admin/applications/core/modules_admin/applications/applications.php @@ -7,7 +7,7 @@ * $Author: bfarber $ * @since 15 January 2007 * $LastChangedDate: 2013-05-07 22:02:49 -0400 (Tue, 07 May 2013) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 12236 $ */ diff --git a/upload/admin/applications/core/modules_admin/applications/blog.php b/upload/admin/applications/core/modules_admin/applications/blog.php index e5e71283..9ba2b1f3 100644 --- a/upload/admin/applications/core/modules_admin/applications/blog.php +++ b/upload/admin/applications/core/modules_admin/applications/blog.php @@ -3,7 +3,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Blog Application
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
@@ -37,6 +37,6 @@ class admin_core_applications_blog extends ipsCommand { $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' ); - $this->registry->output->showInsideIframe("http://external.ipslink.com/ipboard30/landing/?p=blog"); + $this->registry->output->showInsideIframe("http://anonym.to/?http://external.ipslink.com/ipboard30/landing/?p=blog"); } } diff --git a/upload/admin/applications/core/modules_admin/applications/ccs.php b/upload/admin/applications/core/modules_admin/applications/ccs.php index 49bced6d..721c5a3d 100644 --- a/upload/admin/applications/core/modules_admin/applications/ccs.php +++ b/upload/admin/applications/core/modules_admin/applications/ccs.php @@ -2,7 +2,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Blog Application
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
@@ -34,6 +34,6 @@ class admin_core_applications_ccs extends ipsCommand { $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' ); - $this->registry->output->showInsideIframe("http://www.invisionpower.com/products/content/"); + $this->registry->output->showInsideIframe("http://anonym.to/?http://www.invisionpower.com/products/content/"); } } diff --git a/upload/admin/applications/core/modules_admin/applications/copyright.php b/upload/admin/applications/core/modules_admin/applications/copyright.php index 2466ae7e..abe13fa3 100644 --- a/upload/admin/applications/core/modules_admin/applications/copyright.php +++ b/upload/admin/applications/core/modules_admin/applications/copyright.php @@ -3,7 +3,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Download Manager Application
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
diff --git a/upload/admin/applications/core/modules_admin/applications/defaultSection.php b/upload/admin/applications/core/modules_admin/applications/defaultSection.php index 456754a1..c086b035 100644 --- a/upload/admin/applications/core/modules_admin/applications/defaultSection.php +++ b/upload/admin/applications/core/modules_admin/applications/defaultSection.php @@ -7,7 +7,7 @@ * $Author: ips_terabyte $ * @since 20th February 2002 * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 8655 $ */ diff --git a/upload/admin/applications/core/modules_admin/applications/downloads.php b/upload/admin/applications/core/modules_admin/applications/downloads.php index dccb1261..2b299201 100644 --- a/upload/admin/applications/core/modules_admin/applications/downloads.php +++ b/upload/admin/applications/core/modules_admin/applications/downloads.php @@ -3,7 +3,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Download Manager Application
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
@@ -37,6 +37,6 @@ class admin_core_applications_downloads extends ipsCommand { $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' ); - $this->registry->output->showInsideIframe("http://www.invisionpower.com/products/downloads/"); + $this->registry->output->showInsideIframe("http://anonym.to/?http://www.invisionpower.com/products/downloads/"); } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/applications/enhancements.php b/upload/admin/applications/core/modules_admin/applications/enhancements.php index f3154c6d..5d317b55 100644 --- a/upload/admin/applications/core/modules_admin/applications/enhancements.php +++ b/upload/admin/applications/core/modules_admin/applications/enhancements.php @@ -7,7 +7,7 @@ * $Author: mark $ * @since 24 July 2012 * $LastChangedDate: 2012-06-20 10:50:23 +0100 (Wed, 20 Jun 2012) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 10952 $ */ diff --git a/upload/admin/applications/core/modules_admin/applications/gallery.php b/upload/admin/applications/core/modules_admin/applications/gallery.php index c31dd9f0..5302780b 100644 --- a/upload/admin/applications/core/modules_admin/applications/gallery.php +++ b/upload/admin/applications/core/modules_admin/applications/gallery.php @@ -3,7 +3,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Gallery Application
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
@@ -37,6 +37,6 @@ class admin_core_applications_gallery extends ipsCommand { $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' ); - $this->registry->output->showInsideIframe("http://www.invisionpower.com/products/gallery/"); + $this->registry->output->showInsideIframe("http://anonym.to/?http://www.invisionpower.com/products/gallery/"); } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/applications/hooks.php b/upload/admin/applications/core/modules_admin/applications/hooks.php index 7f2237e8..06d54437 100644 --- a/upload/admin/applications/core/modules_admin/applications/hooks.php +++ b/upload/admin/applications/core/modules_admin/applications/hooks.php @@ -1,3543 +1,3542 @@ - - * Invision Power Services - * IP.Board v3.4.5 - * Hooks Management - * Last Updated: $Date: 2013-05-20 16:38:23 -0400 (Mon, 20 May 2013) $ - *
- * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/company/standards.php#license - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com - * @since 3.0.0 - * @version $Revision: 12261 $ - */ - -if ( ! defined( 'IN_ACP' ) ) -{ - print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; - exit(); -} - -class admin_core_applications_hooks extends ipsCommand -{ - /** - * Skin object - * - * @var object Skin templates - */ - protected $html; - - /** - * Hooks library - * - * @var object Hooks library - */ - protected $hooksFunctions; - - /** - * Existing hooks - * - * @var array Existing hooks - */ - protected $hooks; - - /** - * Array of all the cache versions - * for the required applications - * - * @var $cachedVersions - */ - protected $cachedVersions = array(); - - /** - * Main class entry point - * - * @param object ipsRegistry reference - * @return @e void [Outputs to screen] - */ - public function doExecute( ipsRegistry $registry ) - { - //----------------------------------------- - // Load skin - //----------------------------------------- - - $this->html = $this->registry->output->loadTemplate('cp_skin_applications'); - - //----------------------------------------- - // Load hooks library - //----------------------------------------- - - $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('core') . '/sources/classes/hooksFunctions.php', 'hooksFunctions' ); - $this->hooksFunctions = new $classToLoad( $registry ); - - // lang already loaded by hookFunctions - //$this->registry->class_localization->loadLanguageFile( array( 'admin_applications' ), 'core' ); - - if( defined('NO_WRITE_HOOKS') ) - { - $this->registry->output->showError( $this->lang->words['no_write_hooks'] ); - } - - //----------------------------------------- - // Set up stuff - //----------------------------------------- - - $this->form_code = $this->html->form_code = 'module=applications&section=hooks&'; - $this->form_code_js = $this->html->form_code_js = 'module=applications§ion=hooks&'; - - //----------------------------------------- - // What to do... - //----------------------------------------- - - switch( $this->request['do'] ) - { - case 'reenable_all_hooks': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); - $this->_reenableAllHooks(); - break; - case 'disable_all_hooks': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); - $this->_disableAllHooks(); - break; - - break; - case 'disable_hook': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); - $this->_disableHook(); - break; - case 'enable_hook': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); - $this->_enableHook(); - break; - - case 'uninstall_hook': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_delete' ); - $this->_uninstallHook(); - break; - case 'install_hook': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); - $this->_installHook(); - break; - - case 'reorder': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); - $this->_reorder(); - break; - - case 'view_details': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); - $this->_viewDetails(); - break; - - case 'check_requirements': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); - $this->_checkRequirements(); - break; - - case 'export_hook': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); - $this->_exportHook(); - break; - - case 'do_export_hook': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); - $this->_doExportHook(); - break; - - case 'create_hook': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); - $this->_hookForm( 'add' ); - break; - - case 'edit_hook': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); - $this->_hookForm( 'edit' ); - break; - - case 'do_create_hook': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); - $this->_hookSave( 'add' ); - break; - - case 'do_edit_hook': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); - $this->_hookSave( 'edit' ); - break; - - case 'removeDeadCaches': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); - $this->removeDeadCaches(); - break; - - case 'reimport_apps': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); - $this->reimportAppHooks(); - break; - - case 'hooks_overview': - default: - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); - $this->request['do'] = 'hooks_overview'; - $this->_hooksOverview(); - break; - } - - //----------------------------------------- - // Pass to CP output hander - //----------------------------------------- - - $this->registry->getClass('output')->html_main .= $this->registry->getClass('output')->global_template->global_frame_wrapper(); - $this->registry->getClass('output')->sendOutput(); - } - - /** - * Reimport all hooks for all installed applications - * - * @return @e void - */ - protected function reimportAppHooks() - { - $stats = array( 'inserted' => 0, 'updated' => 0, 'skipped' => 0 ); - - foreach( ipsRegistry::$applications as $app ) - { - $_stats = $this->installAppHooks( $app['app_directory'] ); - - $stats['inserted'] = $stats['inserted'] + $_stats['inserted']; - $stats['updated'] = $stats['updated'] + $_stats['updated']; - $stats['skipped'] = $stats['skipped'] + $_stats['skipped']; - } - - /* Rebuild cache */ - $this->rebuildHooksCache(); - - /* Rebuild global caches */ - try - { - IPSLib::cacheGlobalCaches(); - } - catch( Exception $e ){} - - /* Flag skins for recache */ - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ - $skinCaching = new skinCaching( $this->registry ); - $skinCaching->flagSetForRecache(); - - /* Redirect */ - $this->registry->output->global_message = sprintf( $this->lang->words['app_hooks_rebuilt'], $stats['inserted'], $stats['updated'], $stats['skipped'] ); - $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=hooks_overview' ); - } - - /** - * Rebuild skins following hook import that included a template - * - * @return @e void - */ - protected function removeDeadCaches() - { - $messages = array(); - $keep = array(); - $unlink = array(); - - /* Grab all current hooks caches */ - $this->DB->build( array( 'select' => '*', - 'from' => 'core_hooks_files' ) ); - - $this->DB->execute(); - - while( $row = $this->DB->fetch() ) - { - $keep[] = $row['hook_file_stored']; - } - - try - { - foreach( new DirectoryIterator( IPS_HOOKS_PATH ) as $file ) - { - if ( ! $file->isDot() ) - { - $_name = $file->getFileName(); - - if ( preg_match( "#_[a-z0-9]{32}\.php$#", $_name ) ) - { - if ( ! in_array( $_name, $keep ) ) - { - $unlink[] = $_name; - } - } - } - } - } catch ( Exception $e ) { print $e->getMessage(); } - - /* Anything to unlink? */ - if ( count( $unlink ) ) - { - foreach( $unlink as $file ) - { - @unlink( IPS_HOOKS_PATH . $file ); - } - } - - /* Print message */ - $this->registry->output->global_message = sprintf( $this->lang->words['hook_removed_files'], count( $unlink ) ) . '
' . implode( '
', $unlink ); - $this->_hooksOverview(); - } - - /** - * Reorder hooks - * - * @return @e void [Outputs to screen] - */ - protected function _reorder() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classAjax.php', 'classAjax' ); - $ajax = new $classToLoad(); - - //----------------------------------------- - // Checks... - //----------------------------------------- - - if( $this->registry->adminFunctions->checkSecurityKey( $this->request['md5check'], true ) === false ) - { - $ajax->returnString( $this->lang->words['postform_badmd5'] ); - } - - //----------------------------------------- - // Save new position - //----------------------------------------- - - $position = 1; - - if( is_array($this->request['hooks']) AND count($this->request['hooks']) ) - { - /* Reset all hooks to 0 temporarily */ - $this->DB->update( 'core_hooks', array( 'hook_position' => 0 ) ); - - foreach( $this->request['hooks'] as $this_id ) - { - $this->DB->update( 'core_hooks', array( 'hook_position' => $position ), 'hook_id=' . $this_id ); - - $position++; - } - } - - $this->rebuildHooksCache(); - - $ajax->returnString('OK'); - } - - /** - * Install a new hook - * - * @return void - */ - protected function _installHook() - { - //----------------------------------------- - // Get uploaded schtuff - //----------------------------------------- - - $tmp_name = $_FILES['FILE_UPLOAD']['name']; - $tmp_name = preg_replace( "#\.gz$#", "", $tmp_name ); - - $content = ipsRegistry::getClass('adminFunctions')->importXml( $tmp_name ); - - if( ! $content ) - { - $this->registry->output->showError( $this->lang->words['h_noxml'], 1110 ); - } - - $this->installHook( $content, TRUE, FALSE ); - - /* Rebuild cache */ - $this->rebuildHooksCache(); - - /* Rebuild global caches */ - try - { - IPSLib::cacheGlobalCaches(); - } - catch( Exception $e ){} - - /* Flag skins for recache */ - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ - $skinCaching = new skinCaching( $this->registry ); - $skinCaching->flagSetForRecache(); - - /* Redirect */ - $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=hooks_overview' ); - } - - /** - * Function mostly used in installer/upgrader - * Inserts new hooks - * - * @param string Application to install hooks for - */ - public function installAppHooks( $app ) - { - static $hooks = array(); - - $msgs = array( 'inserted' => 0, 'updated' => 0, 'skipped' => 0 ); - $xmlData = array(); - $path = IPSLib::getAppDir( $app ) . '/xml'; - - if ( is_file( $path . '/hooks.xml' ) AND is_dir( $path . '/hooks' ) ) - { - if( !count($hooks) ) - { - /* Fetch current hooks */ - $this->DB->build( array( 'select' => '*', - 'from' => 'core_hooks' ) ); - $this->DB->execute(); - - while( $row = $this->DB->fetch() ) - { - if ( $row['hook_key'] ) - { - $hooks[ $row['hook_key'] ] = $row; - } - } - } - - /* Alright. We're in. Read the XML file */ - require_once( IPS_KERNEL_PATH . 'classXML.php' );/*noLibHook*/ - $xml = new classXML( IPS_DOC_CHAR_SET ); - - /* Grab wrapper file */ - $xml->load( $path . '/hooks.xml' ); - - foreach( $xml->fetchElements('hook') as $data ) - { - $xmlData[] = $xml->fetchElementsFromRecord( $data ); - } - - /* Examine XML */ - if ( is_array( $xmlData ) AND count( $xmlData ) ) - { - foreach( $xmlData as $x ) - { - if ( is_file( $path . '/hooks/' . $x['file'] ) ) - { - $xml->load( $path . '/hooks/' . $x['file'] ); - - foreach( $xml->fetchElements('config') as $data ) - { - $config = $xml->fetchElementsFromRecord( $data ); - } - - if ( ! isset( $hooks[ $config['hook_key'] ] ) ) - { - /* Add it */ - $msgs['inserted']++; - $this->installHook( file_get_contents( $path . '/hooks/' . $x['file'] ), FALSE, FALSE, $x['enabled'] ); - } - else - { - $this->installHook( file_get_contents( $path . '/hooks/' . $x['file'] ), FALSE, FALSE, $x['enabled'] ); - $msgs['updated']++; - } - } - } - } - } - - return $msgs; - } - - /** - * Public install hook so we can use it in the installer and elsewhere - * - * @param string XML data - * @param boolean Add message to output->global_message - * @param boolean Allow skins to recache - * @param int Install enabled - * @return @e void - */ - public function installHook( $content, $addMessage=FALSE, $allowSkinRecache=TRUE, $enabled=1 ) - { - //----------------------------------------- - // Hooks directory writable? - //----------------------------------------- - - if( !is_writable( IPS_HOOKS_PATH ) ) - { - if( !$addMessage ) - { - return false; - } - - $this->registry->output->showError( $this->lang->words['h_dir_notwritable'], 111159 ); - } - - //----------------------------------------- - // Got our hooks? - //----------------------------------------- - - if( !is_array($this->hooks) OR !count($this->hooks) ) - { - $this->DB->build( array( 'select' => '*', 'from' => 'core_hooks' ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $this->hooks[ $r['hook_key'] ] = $r; - } - } - - //----------------------------------------- - // Get xml mah-do-dah - //----------------------------------------- - - require_once( IPS_KERNEL_PATH . 'classXML.php' );/*noLibHook*/ - $xml = new classXML( IPS_DOC_CHAR_SET ); - - //----------------------------------------- - // Unpack the datafile - //----------------------------------------- - - $xml->loadXML( $content ); - - foreach( $xml->fetchElements('config') as $data ) - { - $config = $xml->fetchElementsFromRecord( $data ); - - if( !count($config) ) - { - $this->registry->output->showError( $this->lang->words['h_xmlwrong'], 1111 ); - } - } - - //----------------------------------------- - // Temp - //----------------------------------------- - - $tempExtraData = unserialize( $config['hook_extra_data'] ); - - //----------------------------------------- - // Set config - //----------------------------------------- - - $config = array('hook_name' => $config['hook_name'], - 'hook_desc' => $config['hook_desc'], - 'hook_author' => $config['hook_author'], - 'hook_email' => $config['hook_email'], - 'hook_website' => $config['hook_website'], - 'hook_update_check' => $config['hook_update_check'], - 'hook_requirements' => $config['hook_requirements'], - 'hook_version_human' => $config['hook_version_human'], - 'hook_version_long' => $config['hook_version_long'], - 'hook_key' => $config['hook_key'], - 'hook_global_caches' => $config['hook_global_caches'], - 'hook_enabled' => $enabled, - 'hook_updated' => IPS_UNIX_TIME_NOW, - ); - - $extra_data = array(); - - //----------------------------------------- - // Set files - //----------------------------------------- - - $files = array(); - - foreach( $xml->fetchElements('hookfiles') as $node ) - { - foreach( $xml->fetchElements('file', $node) as $_file ) - { - $file = $xml->fetchElementsFromRecord( $_file ); - - if( $file['hook_type'] ) - { - $files[] = array( - 'hook_file_real' => $file['hook_file_real'], - 'hook_type' => $file['hook_type'], - 'hook_classname' => $file['hook_classname'], - 'hook_data' => $file['hook_data'], - 'hooks_source' => $file['hooks_source'], - ); - } - } - } - - //----------------------------------------- - // Set the custom script - //----------------------------------------- - - $custom = array(); - $customClass = null; - - foreach( $xml->fetchElements('hookextras_custom') as $node ) - { - foreach( $xml->fetchElements('file', $node) as $_file ) - { - $file = $xml->fetchElementsFromRecord( $_file ); - - if( count($file) ) - { - $custom = array( 'filename' => $file['filename'], - 'source' => $file['source'], - ); - } - } - } - - /* Got any custom file to initialize? */ - if ( $custom['filename'] && $custom['source'] ) - { - # Our dirty trick to avoid saving the file on disk just yet... - $_custom = preg_replace( '#^(\s*)<\?(php)+#i', '', $custom['source'] ); - eval($_custom); - - $classname = str_replace( '.php', '', $custom['filename'] ); - - if( class_exists( $classname ) ) - { - $customClass = new $classname( $this->registry ); - - if( method_exists( $customClass, 'pre_install' ) ) - { - $customClass->pre_install(); - } - } - } - - //----------------------------------------- - // Set the settings - //----------------------------------------- - - $settings = array(); - $settingGroups = array(); - - foreach( $xml->fetchElements('hookextras_settings') as $node ) - { - foreach( $xml->fetchElements('setting', $node) as $_setting ) - { - $setting = $xml->fetchElementsFromRecord( $_setting ); - - if( $setting['conf_is_title'] == 1) - { - $settingGroups[] = array( - 'conf_title_title' => $setting['conf_title_title'], - 'conf_title_desc' => $setting['conf_title_desc'], - 'conf_title_noshow' => $setting['conf_title_noshow'], - 'conf_title_keyword' => $setting['conf_title_keyword'], - 'conf_title_app' => $setting['conf_title_app'], - 'conf_title_tab' => $setting['conf_title_tab'], - ); - } - else - { - $settings[] = array( - 'conf_title' => $setting['conf_title'], - 'conf_description' => $setting['conf_description'], - 'conf_group' => $setting['conf_group'], - 'conf_type' => $setting['conf_type'], - 'conf_key' => $setting['conf_key'], - 'conf_default' => $setting['conf_default'], - 'conf_extra' => $setting['conf_extra'], - 'conf_evalphp' => $setting['conf_evalphp'], - 'conf_protected' => $setting['conf_protected'], - 'conf_position' => $setting['conf_position'], - 'conf_start_group' => $setting['conf_start_group'], - 'conf_add_cache' => $setting['conf_add_cache'], - 'conf_title_keyword' => $setting['conf_title_keyword'], - ); - } - } - } - - //----------------------------------------- - // Set the lang bits - //----------------------------------------- - - $language = array(); - - foreach( $xml->fetchElements('hookextras_language') as $node ) - { - foreach( $xml->fetchElements('language', $node) as $_langbit ) - { - $langbit = $xml->fetchElementsFromRecord( $_langbit ); - - $language[] = array( - 'word_app' => $langbit['word_app'], - 'word_pack' => $langbit['word_pack'], - 'word_key' => $langbit['word_key'], - 'word_default' => $langbit['word_default'], - 'word_custom' => $langbit['word_custom'], - 'word_js' => intval($langbit['word_js']), - ); - } - } - - //----------------------------------------- - // Set the modules - //----------------------------------------- - - $modules = array(); - - foreach( $xml->fetchElements('hookextras_modules') as $node ) - { - foreach( $xml->fetchElements('module', $node) as $_module ) - { - $module = $xml->fetchElementsFromRecord( $_module ); - $modules[] = array( - 'sys_module_title' => $module['sys_module_title'], - 'sys_module_application' => $module['sys_module_application'], - 'sys_module_key' => $module['sys_module_key'], - 'sys_module_description' => $module['sys_module_description'], - 'sys_module_version' => $module['sys_module_version'], - 'sys_module_protected' => $module['sys_module_protected'], - 'sys_module_visible' => $module['sys_module_visible'], - 'sys_module_position' => $module['sys_module_position'], - 'sys_module_admin' => $module['sys_module_admin'], - ); - } - } - - //----------------------------------------- - // Set the help files - //----------------------------------------- - - $help = array(); - - foreach( $xml->fetchElements('hookextras_help') as $node ) - { - foreach( $xml->fetchElements('help', $node) as $_helpfile ) - { - $helpfile = $xml->fetchElementsFromRecord( $_helpfile ); - $help[] = array( - 'title' => $helpfile['title'], - 'text' => $helpfile['text'], - 'description' => $helpfile['description'], - 'position' => $helpfile['position'], - ); - } - } - - //----------------------------------------- - // Set the templates - //----------------------------------------- - - $templates = array(); - - foreach( $xml->fetchElements('hookextras_templates') as $node ) - { - foreach( $xml->fetchElements('templates', $node) as $_template ) - { - $template = $xml->fetchElementsFromRecord( $_template ); - $templates[] = array( - 'template_set_id' => 0, - 'template_group' => $template['template_group'], - 'template_content' => $template['template_content'], - 'template_name' => $template['template_name'], - 'template_data' => $template['template_data'], - 'template_updated' => $template['template_updated'], - 'template_removable' => $template['template_removable'], - 'template_added_to' => intval($template['template_added_to']), - 'template_user_added' => 1, - 'template_user_edited' => 0, - 'template_master_key' => $template['template_master_key'] ? $template['template_master_key'] : 'root', - ); - } - } - - //----------------------------------------- - // Set the CSS - //----------------------------------------- - - $css = array(); - - foreach( $xml->fetchElements('hookextras_css') as $node ) - { - foreach( $xml->fetchElements('css', $node) as $_css ) - { - $_css = $xml->fetchElementsFromRecord( $_css ); - $css[] = array( - 'css_set_id' => 0, - 'css_group' => $_css['css_group'], - 'css_content' => $_css['css_content'], - 'css_position' => $_css['css_position'], - 'css_added_to' => 1, - 'css_app' => $_css['css_app'], - 'css_app_hide' => $_css['css_app_hide'], - 'css_attributes' => $_css['css_attributes'], - 'css_removed' => $_css['css_removed'], - 'css_modules' => $_css['css_modules'], - 'css_master_key' => $_css['css_master_key'], - ); - } - } - - //----------------------------------------- - // Set the Replacements - //----------------------------------------- - - $replacements = array(); - - foreach( $xml->fetchElements('hookextras_replacements') as $node ) - { - foreach( $xml->fetchElements('replacements', $node) as $_r ) - { - $_r = $xml->fetchElementsFromRecord( $_r ); - $replacements[] = array( - 'replacement_key' => $_r['replacement_key'], - 'replacement_content' => $_r['replacement_content'], - 'replacement_master_key' => $_r['replacement_master_key'], - ); - } - } - - //----------------------------------------- - // Set the tasks - //----------------------------------------- - - $tasks = array(); - - foreach( $xml->fetchElements('hookextras_tasks') as $node ) - { - foreach( $xml->fetchElements('tasks', $node) as $_task ) - { - $task = $xml->fetchElementsFromRecord( $_task ); - $tasks[] = array( - 'task_title' => $task['task_title'], - 'task_file' => $task['task_file'], - 'task_week_day' => $task['task_week_day'], - 'task_month_day' => $task['task_month_day'], - 'task_hour' => $task['task_hour'], - 'task_minute' => $task['task_minute'], - 'task_cronkey' => $task['task_cronkey'], - 'task_log' => $task['task_log'], - 'task_description' => $task['task_description'], - 'task_enabled' => $task['task_enabled'], - 'task_key' => $task['task_key'], - 'task_safemode' => $task['task_safemode'], - 'task_locked' => $task['task_locked'], - 'task_application' => $task['task_application'], - ); - } - } - - //----------------------------------------- - // Set the database changes - //----------------------------------------- - - $database = array( - 'create' => array(), - 'alter' => array(), - 'update' => array(), - 'insert' => array(), - ); - - foreach( $xml->fetchElements('hookextras_database_create') as $node ) - { - foreach( $xml->fetchElements('create', $node) as $_table ) - { - $table = $xml->fetchElementsFromRecord( $_table ); - $database['create'][] = array( - 'name' => $table['name'], - 'fields' => $table['fields'], - 'tabletype' => $table['tabletype'], - ); - } - } - - foreach( $xml->fetchElements('hookextras_database_alter') as $node ) - { - foreach( $xml->fetchElements('alter', $node) as $_table ) - { - $table = $xml->fetchElementsFromRecord( $_table ); - $database['alter'][] = array( - 'altertype' => $table['altertype'], - 'table' => $table['table'], - 'field' => $table['field'], - 'newfield' => $table['newfield'], - 'fieldtype' => $table['fieldtype'], - 'default' => $table['default'], - ); - } - } - - foreach( $xml->fetchElements('hookextras_database_update') as $node ) - { - foreach( $xml->fetchElements('update', $node) as $_table ) - { - $table = $xml->fetchElementsFromRecord( $_table ); - $database['update'][] = array( - 'table' => $table['table'], - 'field' => $table['field'], - 'newvalue' => $table['newvalue'], - 'oldvalue' => $table['oldvalue'], - 'where' => $table['where'], - ); - } - } - - foreach( $xml->fetchElements('hookextras_database_insert') as $node ) - { - foreach( $xml->fetchElements('insert', $node) as $_table ) - { - $table = $xml->fetchElementsFromRecord( $_table ); - $database['insert'][] = array( - 'table' => $table['table'], - 'updates' => $table['updates'], - 'fordelete' => $table['fordelete'], - ); - } - } - - //----------------------------------------- - // Set some vars for display tallies - //----------------------------------------- - - $filesInserted = 0; - $settingGroupsInserted = 0; - $settingsInserted = 0; - $settingsUpdated = 0; - $languageInserted = 0; - $languageUpdated = 0; - $modulesInserted = 0; - $modulesUpdated = 0; - $helpInserted = 0; - $helpUpdated = 0; - $templatesInserted = 0; - $templatesUpdated = 0; - $templateHooks = false; - $tasksInserted = 0; - $tasksUpdated = 0; - $createQueries = 0; - $alterQueries = 0; - $updateQueries = 0; - $insertQueries = 0; - $cssInserted = 0; - $cssUpdated = 0; - $replacementsInserted = 0; - $replacementsUpdated = 0; - - //----------------------------------------- - // Insert/update DB records - //----------------------------------------- - - if( $this->hooks[ $config['hook_key'] ]['hook_id'] ) - { - //----------------------------------------- - // Don't change enabled/disabled status - //----------------------------------------- - - unset( $config['hook_enabled'] ); - - $this->DB->update( 'core_hooks', $config, 'hook_id=' . $this->hooks[ $config['hook_key'] ]['hook_id'] ); - - $hook_id = $this->hooks[ $config['hook_key'] ]['hook_id']; - - $extra_data = unserialize( $this->hooks[ $config['hook_key'] ]['hook_extra_data'] ); - - /* Reset DB */ - $extra_data['database'] = array(); - } - else - { - $config['hook_installed'] = IPS_UNIX_TIME_NOW; - $this->hook[ $config['hook_key'] ] = $config; - - $this->DB->insert( 'core_hooks', $config ); - - $hook_id = $this->DB->getInsertId(); - - $this->hook[ $config['hook_key'] ]['hook_id'] = $hook_id; - - $extra_data['display'] = $tempExtraData['display']; - } - - if( count($files) ) - { - //----------------------------------------- - // If we are updating, remove old files - //----------------------------------------- - - if( $this->hooks[ $config['hook_key'] ]['hook_id'] ) - { - $this->DB->build( array( 'select' => 'hook_file_id, hook_file_stored', 'from' => 'core_hooks_files', 'where' => 'hook_hook_id=' . $this->hooks[ $config['hook_key'] ]['hook_id'] ) ); - $outer = $this->DB->execute(); - - while( $r = $this->DB->fetch($outer) ) - { - @unlink( IPS_HOOKS_PATH . $r['hook_file_stored'] ); - $this->DB->delete( 'core_hooks_files', 'hook_file_id=' . $r['hook_file_id'] ); - } - } - - foreach( $files as $file ) - { - //----------------------------------------- - // Store new files - //----------------------------------------- - - $filename = $file['hook_classname'] . '_' . md5( uniqid( microtime(), true ) ) . '.php'; - - file_put_contents( IPS_HOOKS_PATH . $filename, $file['hooks_source'] ); - chmod( IPS_HOOKS_PATH . $filename, IPS_FILE_PERMISSION ); - - $file['hook_file_stored'] = $filename; - $file['hook_hook_id'] = $hook_id; - - $this->DB->insert( 'core_hooks_files', $file ); - $filesInserted++; - - /* Need to recache skins? */ - if ( $file['hook_type'] == 'templateHooks' ) - { - $templateHooks = true; - } - } - } - - //----------------------------------------- - // Put custom install/uninstall file - //----------------------------------------- - - if( is_object($customClass) ) - { - $extra_data['display']['custom'] = $custom['filename']; - - file_put_contents( IPS_HOOKS_PATH . 'install_' . $custom['filename'], $custom['source'] ); - chmod( IPS_HOOKS_PATH . 'install_' . $custom['filename'], IPS_FILE_PERMISSION ); - } - - //----------------------------------------- - // (1) Settings - //----------------------------------------- - - if( count($settingGroups) OR count($settings) ) - { - $setting_groups = array(); - - $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_settings_titles' ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $setting_groups[ $r['conf_title_id'] ] = $r; - $setting_groups_by_key[ $r['conf_title_keyword'] ] = $r; - } - - //----------------------------------------- - // Get current settings. - //----------------------------------------- - - $this->DB->build( array( 'select' => 'conf_id, conf_key', 'from' => 'core_sys_conf_settings' ) ); - $this->DB->execute(); - - while ( $r = $this->DB->fetch() ) - { - $cur_settings[ $r['conf_key'] ] = $r['conf_id']; - } - } - - if( count($settingGroups) ) - { - $need_to_update = array(); - - foreach( $settingGroups as $data ) - { - if ( $data['conf_title_title'] AND $data['conf_title_keyword'] ) - { - //----------------------------------------- - // Get ID based on key - //----------------------------------------- - - $conf_id = $setting_groups_by_key[ $data['conf_title_keyword'] ]['conf_title_id']; - - $save = array( 'conf_title_title' => $data['conf_title_title'], - 'conf_title_desc' => $data['conf_title_desc'], - 'conf_title_keyword' => $data['conf_title_keyword'], - 'conf_title_app' => $data['conf_title_app'], - 'conf_title_tab' => $data['conf_title_tab'], - 'conf_title_noshow' => $data['conf_title_noshow'] ); - - //----------------------------------------- - // Not got a row, insert first! - //----------------------------------------- - - if ( ! $conf_id ) - { - $this->DB->insert( 'core_sys_settings_titles', $save ); - $conf_id = $this->DB->getInsertId(); - $settingGroupsInserted++; - $extra_data['settingGroups'][] = $save['conf_title_keyword']; - } - else - { - //----------------------------------------- - // Update... - //----------------------------------------- - - $this->DB->update( 'core_sys_settings_titles', $save, 'conf_title_id='.$conf_id ); - } - - //----------------------------------------- - // Update settings cache - //----------------------------------------- - - $save['conf_title_id'] = $conf_id; - $setting_groups_by_key[ $save['conf_title_keyword'] ] = $save; - $setting_groups[ $save['conf_title_id'] ] = $save; - - //----------------------------------------- - // Set need update... - //----------------------------------------- - - $need_update[] = $conf_id; - } - } - } - - if( count($settings) ) - { - foreach( $settings as $idx => $data ) - { - $data['conf_group'] = $setting_groups_by_key[ $data['conf_title_keyword'] ]['conf_title_id']; - - //----------------------------------------- - // Remove from array - //----------------------------------------- - - unset( $data['conf_title_keyword'] ); - - if ( $cur_settings[ $data['conf_key'] ] ) - { - $this->DB->update( 'core_sys_conf_settings', $data, 'conf_id='.$cur_settings[ $data['conf_key'] ] ); - $settingsUpdated++; - } - else - { - $this->DB->insert( 'core_sys_conf_settings', $data ); - $settingsInserted++; - $extra_data['settings'][] = $data['conf_key']; - } - } - } - - //----------------------------------------- - // Update group counts... - //----------------------------------------- - - if ( count( $need_update ) ) - { - foreach( $need_update as $i => $idx ) - { - $conf = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'core_sys_conf_settings', 'where' => 'conf_group=' . $idx ) ); - - $count = intval($conf['count']); - - $this->DB->update( 'core_sys_settings_titles', array( 'conf_title_count' => $count ), 'conf_title_id='.$idx ); - } - } - - if( count($settingGroups) OR count($settings) ) - { - $this->cache->rebuildCache( 'settings', 'global' ); - } - - //----------------------------------------- - // (2) Languages - //----------------------------------------- - - if( count($language) ) - { - $langPacks = array(); - - $this->DB->build( array( 'select' => 'lang_id', 'from' => 'core_sys_lang' ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $langPacks[] = $r['lang_id']; - } - - foreach( $language as $langbit ) - { - foreach( $langPacks as $lang_id ) - { - - $langbit['lang_id'] = $lang_id; - - // See if it exists - $cnt = $this->DB->buildAndFetch( array( 'select' => 'word_id', 'from' => 'core_sys_lang_words', 'where' => "lang_id={$lang_id} AND word_app='{$langbit['word_app']}' AND word_key='{$langbit['word_key']}' AND word_pack='{$langbit['word_pack']}'" ) ); - - if( $cnt['word_id'] ) - { - $this->DB->update( 'core_sys_lang_words', $langbit, 'word_id=' . $cnt['word_id'] ); - $languageUpdated++; - } - else - { - $this->DB->insert( 'core_sys_lang_words', $langbit ); - $languageInserted++; - $word_id = $this->DB->getInsertId(); - } - - $extra_data['language'][ $langbit['word_app'] . "_" . $langbit['word_pack'] ][] = $langbit['word_key']; - } - - } - - $classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir('core') . '/modules_admin/languages/manage_languages.php', 'admin_core_languages_manage_languages' ); - $langLib = new $classToLoad(); - $langLib->makeRegistryShortcuts( $this->registry ); - - foreach( $langPacks as $langId ) - { - $langLib->cacheToDisk( $langId ); - } - - } - - //----------------------------------------- - // (3) Modules - //----------------------------------------- - - if( count($modules) ) - { - //----------------------------------------- - // Get current modules - //----------------------------------------- - $cur_modules = array(); - $this->DB->build( array( 'select' => '*', - 'from' => 'core_sys_module', - 'order' => 'sys_module_id' ) ); - - $this->DB->execute(); - - while ( $r = $this->DB->fetch() ) - { - $cur_modules[ $r['sys_module_application'] ][ $r['sys_module_key'] ] = $r['sys_module_id']; - } - - foreach( $modules as $module ) - { - //----------------------------------------- - // Insert or update? - //----------------------------------------- - - if ( $cur_modules[ $module['sys_module_application'] ][ $module['sys_module_key'] ] ) - { - $this->DB->update( 'core_sys_module', $module, "sys_module_id=" . $cur_modules[ $module['sys_module_application'] ][ $module['sys_module_key'] ] ); - $modulesUpdated++; - } - else - { - $this->DB->insert( 'core_sys_module', $module ); - $modulesInserted++; - - $extra_data['modules'][] = ( $module['sys_module_admin'] ? 'admin' : 'public' ) . '-' . $module['sys_module_application'] . '-' . $module['sys_module_key']; - } - } - - $classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir('core') . '/modules_admin/applications/applications.php', 'admin_core_applications_applications' ); - $moduleLib = new $classToLoad(); - $moduleLib->makeRegistryShortcuts( $this->registry ); - $moduleLib->moduleRecache(); - $moduleLib->applicationsMenuDataRecache(); - } - - //----------------------------------------- - // (4) Help Files - //----------------------------------------- - - if( count($help) ) - { - $keys = array(); - - $this->DB->build( array( 'select' => 'title', 'from' => 'faq' ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $keys[] = $r['title']; - } - - foreach( $help as $entry ) - { - if( in_array( $entry['title'], $keys ) ) - { - $this->DB->update( 'faq', $entry, "title='{$entry['title']}'" ); - $helpUpdated++; - } - else - { - $this->DB->insert( 'faq', $entry ); - $helpInserted++; - $help_id = $this->DB->getInsertId(); - $extra_data['help'][] = $entry['title']; - } - } - } - - //----------------------------------------- - // (6) Templates - //----------------------------------------- - - if( count($templates) ) - { - $bits = array(); - - /* Root will always be updated */ - $this->DB->build( array( 'select' => 'template_name,template_group,template_master_key', 'from' => 'skin_templates' ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $bits[ $r['template_master_key'] ][ $r['template_group'] ][] = $r['template_name']; - } - - foreach( $templates as $template ) - { - //----------------------------------------- - // If template is not in root set, add it to - // prevent fatal error selecting other skins - //----------------------------------------- - - if ( $template['template_master_key'] != 'root' && ( !isset($bits['root'][ $template['template_group'] ]) OR !in_array( $template['template_name'], $bits['root'][ $template['template_group'] ] ) ) ) - { - $this->DB->insert( 'skin_templates', array_merge( $template, array( 'template_set_id' => 0, 'template_master_key' => 'root', 'template_content' => '' ) ) ); - - $extra_data['templates'][ $template['template_group'] ][ $template['template_name'] ] = $template['template_name']; - $bits['root'][ $template['template_group'] ][] = $template['template_name']; - } - - //----------------------------------------- - // Ignore unknown skin sets - //----------------------------------------- - - if ( !isset($bits[ $template['template_master_key'] ]) ) - { - continue; - } - - if( isset($bits[ $template['template_master_key'] ][ $template['template_group'] ]) AND in_array( $template['template_name'], $bits[ $template['template_master_key'] ][ $template['template_group'] ] ) ) - { - $template['template_updated'] = IPS_UNIX_TIME_NOW; - - $this->DB->update( 'skin_templates', $template, "template_master_key='{$template['template_master_key']}' AND template_group='{$template['template_group']}' AND template_name='{$template['template_name']}'" ); - $templatesUpdated++; - } - else - { - $this->DB->insert( 'skin_templates', $template ); - $templatesInserted++; - - $extra_data['templates'][ $template['template_group'] ][ $template['template_name'] ] = $template['template_name']; - $bits[ $template['template_master_key'] ][ $template['template_group'] ][] = $template['template_name']; - } - } - } - - //----------------------------------------- - // CSS - //----------------------------------------- - - if( count( $css ) ) - { - $bits = array(); - - $this->DB->build( array( 'select' => 'css_master_key, css_group', 'from' => 'skin_css' ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $bits[ $r['css_master_key'] ][ $r['css_group'] ] = $r['css_group']; - } - - foreach( $css as $entry ) - { - //----------------------------------------- - // Ignore unknown skin sets - //----------------------------------------- - - if ( !isset( $bits[ $entry['css_master_key'] ] ) ) - { - continue; - } - - if( in_array( $entry['css_group'], $bits[ $entry['css_master_key'] ] ) ) - { - $entry['css_updated'] = IPS_UNIX_TIME_NOW; - - $this->DB->update( 'skin_css', $entry, "css_master_key='{$entry['css_master_key']}' AND css_group='{$entry['css_group']}'" ); - $cssUpdated++; - } - else - { - $this->DB->insert( 'skin_css', $entry ); - $cssInserted++; - - $extra_data['css'][ $entry['css_group'] ] = $entry['css_group']; - $bits[ $entry['css_master_key'] ][ $entry['css_group'] ] = $entry['css_group']; - } - } - } - - //----------------------------------------- - // Skin Replacements - //----------------------------------------- - - if( count( $replacements ) ) - { - $bits = array(); - - $this->DB->build( array( 'select' => 'replacement_master_key, replacement_key', 'from' => 'skin_replacements' ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $bits[ $r['replacement_master_key'] ][ $r['replacement_key'] ] = $r['replacement_key']; - } - - foreach( $replacements as $entry ) - { - if ( !isset( $entry['replacement_master_key'] ) or !isset( $bits[ $entry['replacement_master_key'] ] ) ) - { - $entry['replacement_master_key'] = 'root'; - } - - if( in_array( $entry['replacement_key'], $bits[ $entry['replacement_master_key'] ] ) ) - { - $this->DB->update( 'skin_replacements', $entry, "replacement_master_key='{$entry['replacement_master_key']}' AND replacement_key='{$entry['replacement_key']}'" ); - $replacementsUpdated++; - } - else - { - $this->DB->insert( 'skin_replacements', $entry ); - $replacementsInserted++; - - $extra_data['replacements'][ $entry['replacement_key'] ] = $entry['replacement_key']; - } - } - } - - //----------------------------------------- - // (7) Tasks - //----------------------------------------- - - if( count($tasks) ) - { - $keys = array(); - - $this->DB->build( array( 'select' => 'task_key', 'from' => 'task_manager' ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $keys[] = $r['task_key']; - } - - foreach( $tasks as $entry ) - { - if( in_array( $entry['task_key'], $keys ) ) - { - $this->DB->update( 'task_manager', $entry, "task_key='{$entry['task_key']}'" ); - $tasksUpdated++; - } - else - { - $this->DB->insert( 'task_manager', $entry ); - $tasksInserted++; - $task_id = $this->DB->getInsertId(); - $extra_data['tasks'][] = $entry['task_key']; - } - } - } - - //----------------------------------------- - // (8) Create new tables - //----------------------------------------- - - if( count($database['create']) ) - { - foreach($database['create'] as $create ) - { - $query = "CREATE TABLE {$this->settings['sql_tbl_prefix']}{$create['name']} ( - {$create['fields']} - )"; - - if( $create['tabletype'] ) - { - $query .= " ENGINE=" . $create['tabletype']; - } - else if( $this->settings['sql_driver'] == 'mysql' AND $this->settings['mysql_tbl_type'] ) - { - $query .= " ENGINE=" . $this->settings['mysql_tbl_type']; - } - - //----------------------------------------- - // Fix prefix - //----------------------------------------- - - $this->DB->return_die = true; - $this->DB->query( $query ); - $this->DB->return_die = false; - $createQueries++; - - $extra_data['database']['create'][] = $create; - } - } - - //----------------------------------------- - // (9) Alter tables - //----------------------------------------- - - if( count($database['alter']) ) - { - foreach( $database['alter'] as $alter ) - { - $this->DB->return_die = true; - - $alter['default'] = ( !isset($alter['default']) || $alter['default'] === "" ) ? NULL : $alter['default']; - - switch( $alter['altertype'] ) - { - case 'remove': - $this->DB->dropField( $alter['table'], $alter['field'] ); - break; - - case 'add': - $this->DB->addField( $alter['table'], $alter['field'], $alter['fieldtype'], $alter['default'] ); - break; - - case 'change': - $this->DB->changeField( $alter['table'], $alter['field'], $alter['newfield'], $alter['fieldtype'], $alter['default'] ); - break; - } - - $this->DB->return_die = false; - $alterQueries++; - $extra_data['database']['alter'][] = $alter; - } - } - - //----------------------------------------- - // (10) Run update queries - //----------------------------------------- - - if( count($database['update']) ) - { - foreach( $database['update'] as $update ) - { - $this->DB->return_die = true; - $this->DB->update( $update['table'], array( $update['field'] => $update['newvalue'] ), html_entity_decode( $update['where'], ENT_QUOTES ) ); - $this->DB->return_die = false; - $updateQueries++; - $extra_data['database']['update'][] = $update; - } - } - - //----------------------------------------- - // (11) Run insert queries - //----------------------------------------- - - // if( !$this->hooks[ $config['hook_key'] ]['hook_id'] ) - // { - if( count($database['insert']) ) - { - foreach( $database['insert'] as $insert ) - { - $fields = array(); - $content = explode( ',', $insert['updates'] ); - - foreach( $content as $value ) - { - list( $field, $toInsert ) = explode( '=', $value ); - - $fields[ trim($field) ] = str_replace( '~C~', ',', $toInsert ); - } - - $this->DB->return_die = true; - $this->DB->insert( $insert['table'], $fields ); - $this->DB->return_die = false; - $insertQueries++; - $extra_data['database']['insert'][] = $insert; - } - } - // } - - /* Got an install function to run too? */ - if( is_object($customClass) ) - { - if( method_exists( $customClass, 'install' ) ) - { - $customClass->install(); - } - } - - if( count($extra_data) ) - { - $this->DB->update( 'core_hooks', array( 'hook_extra_data' => serialize( $extra_data ) ), 'hook_id=' . $hook_id ); - } - - //print_r($config); - //print_r($files); - //print_r($custom); - //print_r($settingGroups); - //print_r($settings); - //print_r($language); - //print_r($modules); - //print_r($templates); - //print_r($tasks); - //print_r($help); - //print_r($database); - - if ( $addMessage ) - { - $_tempMsg = <<{$this->lang->words['h_newhookin']} -
    -
  • {$filesInserted} {$this->lang->words['h_filesin']}
  • -
  • {$settingGroupsInserted} {$this->lang->words['h_settinggin']}
  • -
  • {$settingsInserted} {$this->lang->words['h_settingin']}
  • -
  • {$settingsUpdated} {$this->lang->words['h_settingup']}
  • -
  • {$languageInserted} {$this->lang->words['h_langbitin']}
  • -
  • {$languageUpdated} {$this->lang->words['h_langbitup']}
  • -
  • {$modulesInserted} {$this->lang->words['h_modin']}
  • -
  • {$modulesUpdated} {$this->lang->words['h_modup']}
  • -
  • {$helpInserted} {$this->lang->words['h_helpin']}
  • -
  • {$helpUpdated} {$this->lang->words['h_helpup']}
  • -
  • {$templatesInserted} {$this->lang->words['h_tempin']}
  • -
  • {$templatesUpdated} {$this->lang->words['h_tempup']}
  • -
  • {$cssInserted} {$this->lang->words['h_cssin']}
  • -
  • {$cssUpdated} {$this->lang->words['h_cssup']}
  • -
  • {$replacementsInserted} {$this->lang->words['h_replacementsin']}
  • -
  • {$replacementsUpdated} {$this->lang->words['h_replacementsup']}
  • -
  • {$tasksInserted} {$this->lang->words['h_taskin']}
  • -
  • {$tasksUpdated} {$this->lang->words['h_taskup']}
  • -
  • {$createQueries} {$this->lang->words['h_dbcreated']}
  • -
  • {$alterQueries} {$this->lang->words['h_dbaltered']}
  • -
  • {$updateQueries} {$this->lang->words['h_updateran']}
  • -
  • {$insertQueries} {$this->lang->words['h_insertran']}
  • -
-EOF; - - $this->registry->output->setMessage( $_tempMsg, 1 ); - } - - //----------------------------------------- - // Got some skin recaching to do... - //----------------------------------------- - - if( $allowSkinRecache === TRUE AND ( $templatesInserted OR $templatesUpdated OR $templateHooks OR $cssUpdated OR $cssInserted ) ) - { - /* Rebuild cache */ - $this->rebuildHooksCache(); - - /* Flag skins for recache */ - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ - $skinCaching = new skinCaching( $this->registry ); - $skinCaching->flagSetForRecache(); - } - } - - /** - * Show the form to export a hook - * - * @return void - */ - protected function _exportHook() - { - /* Get the hook */ - $id = intval($this->request['id']); - - if( !$id ) - { - $this->registry->output->showError( $this->lang->words['h_noexport'], 1112 ); - } - - $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $id ) ); - - if( !$hookData['hook_id'] ) - { - $this->registry->output->showError( $this->lang->words['h_noexport'], 1113 ); - } - - /* Set defaults */ - $hookData['hook_extra_data'] = unserialize( $hookData['hook_extra_data'] ); - - /* Output */ - $this->registry->output->extra_nav[] = array( $this->settings['base_url'] . $this->form_code . 'do=hooks_overview', $this->lang->words['menu__manage_hooks'] ); - $this->registry->output->html .= $this->html->hooksExport( $hookData ); - } - - /** - * Actually export the damn hook already - * Sorry, it has been a long day... - * - * @return @e void - */ - protected function _doExportHook() - { - //----------------------------------------- - // Get hook - //----------------------------------------- - - $id = intval($this->request['id']); - - if( !$id ) - { - $this->registry->output->showError( $this->lang->words['h_noexport'], 1114 ); - } - - $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $id ) ); - - if( !$hookData['hook_id'] ) - { - $this->registry->output->showError( $this->lang->words['h_noexport'], 1115 ); - } - - $extra_data = unserialize( $hookData['hook_extra_data'] ); - - //----------------------------------------- - // Get hook files - //----------------------------------------- - - $files = array(); - $index = 1; - - $this->DB->build( array( 'select' => '*', 'from' => 'core_hooks_files', 'where' => 'hook_hook_id=' . $id, 'order' => 'hook_file_id ASC' ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $files[ $index ] = $r; - $index++; - } - - //----------------------------------------- - // Get XML class - //----------------------------------------- - - require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ - - $xml = new classXML( IPS_DOC_CHAR_SET ); - - $xml->newXMLDocument(); - $xml->addElement( 'hookexport' ); - - //----------------------------------------- - // Put hook data in export - //----------------------------------------- - - $xml->addElement( 'hookdata', 'hookexport' ); - $content = array(); - - foreach( $hookData as $k => $v ) - { - if( in_array( $k, array( 'hook_id', 'hook_enabled', 'hook_installed', 'hook_updated', 'hook_position' ) ) ) - { - continue; - } - - $content[ $k ] = $v; - } - - $xml->addElementAsRecord( 'hookdata', 'config', $content ); - - //----------------------------------------- - // Put hook files in export - //----------------------------------------- - - $xml->addElement( 'hookfiles', 'hookexport' ); - - foreach( $files as $index => $r ) - { - $content = array(); - - foreach( $r as $k => $v ) - { - if( in_array( $k, array( 'hook_file_id', 'hook_hook_id', 'hook_file_stored', 'hooks_source' ) ) ) - { - continue; - } - - $content[ $k ] = $v; - } - - $source = is_file( IPS_HOOKS_PATH . $r['hook_file_stored'] ) ? file_get_contents( IPS_HOOKS_PATH . $r['hook_file_stored'] ) : ''; - - if ( !empty($source) && in_array( $r['hook_type'], array( 'skinHooks', 'commandHooks', 'libraryHooks' ) ) ) - { - $source = $this->_cleanSource( $source ); - } - - $content['hooks_source'] = $source; - - $xml->addElementAsRecord( 'hookfiles', 'file', $content ); - } - - //----------------------------------------- - // Custom install/uninstall script? - //----------------------------------------- - - if( $extra_data['custom'] ) - { - $content = array(); - $xml->addElement( 'hookextras_custom', 'hookexport' ); - - $content['filename'] = $extra_data['custom']; - $content['source'] = is_file( IPS_HOOKS_PATH . 'install_' . $extra_data['custom'] ) ? file_get_contents( IPS_HOOKS_PATH . 'install_' . $extra_data['custom'] ) : ''; - - $xml->addElementAsRecord( 'hookextras_custom', 'file', $content ); - } - - //----------------------------------------- - // Settings or setting groups? - //----------------------------------------- - - $entry = array(); - $_groups = array(); - $_settings = array(); - $titles = array(); - $content = array(); - - $xml->addElement( 'hookextras_settings', 'hookexport' ); - - # Store group ids and setting ids for entire setting groups - if( is_array($extra_data['settingGroups']) AND count($extra_data['settingGroups']) ) - { - $_groups = $extra_data['settingGroups']; - $_groupIds = array(); - - $this->DB->build( array( 'select' => 'conf_title_id', 'from' => 'core_sys_settings_titles', 'where' => "conf_title_keyword IN('" . implode( "','", $_groups ) . "')" ) ); - $this->DB->execute(); - - while( $rr = $this->DB->fetch() ) - { - $_groupIds[] = $rr['conf_title_id']; - } - - if( count($_groupIds) ) - { - $this->DB->build( array( 'select' => 'conf_key', 'from' => 'core_sys_conf_settings', 'where' => 'conf_group IN(' . implode( ',', $_groupIds ) . ')' ) ); - $this->DB->execute(); - - while( $setting = $this->DB->fetch() ) - { - $_settings[] = $setting['conf_key']; - } - } - } - - # Store group ids and setting ids for indvidual settings - if( is_array($extra_data['settings']) AND count($extra_data['settings']) ) - { - foreach( $extra_data['settings'] as $_aSetting ) - { - $_settings[] = $_aSetting; - } - - $this->DB->build( array( 'select' => 't.conf_title_keyword', - 'from' => array( 'core_sys_settings_titles' => 't' ), - 'where' => "c.conf_key IN('" . implode( "','", $extra_data['settings'] ) . "')", - 'add_join' => array( - array( - 'from' => array( 'core_sys_conf_settings' => 'c' ), - 'where' => 'c.conf_group=t.conf_title_id', - 'type' => 'left', - ) - ) - ) ); - $this->DB->execute(); - - while( $group = $this->DB->fetch() ) - { - $_groups[] = $group['conf_title_keyword']; - } - } - - if( count($_groups) ) - { - # Now get the group data for the XML file - $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_settings_titles', 'where' => "conf_title_keyword IN('" . implode( "','", $_groups ) . "')" ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $content = array(); - - $titles[ $r['conf_title_id'] ] = $r['conf_title_keyword']; - - $content['conf_is_title'] = 1; - - foreach( $r as $k => $v ) - { - if( in_array( $k, array( 'conf_title_tab', 'conf_title_keyword', 'conf_title_title', 'conf_title_desc', 'conf_title_app', 'conf_title_noshow' ) ) ) - { - $content[ $k ] = $v; - } - } - - $xml->addElementAsRecord( 'hookextras_settings', 'setting', $content ); - } - } - - if( count($_settings) ) - { - # Now get the group data for the XML file - $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_conf_settings', 'where' => "conf_key IN('" . implode( "','", $_settings ) . "')" ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $r['conf_value'] = ''; - $r['conf_title_keyword'] = $titles[ $r['conf_group'] ]; - $r['conf_is_title'] = 0; - - $xml->addElementAsRecord( 'hookextras_settings', 'setting', $r ); - } - } - - //----------------------------------------- - // Language strings/files - //----------------------------------------- - - $entry = array(); - - $xml->addElement( 'hookextras_language', 'hookexport' ); - - if( is_array($extra_data['language']) AND count($extra_data['language']) ) - { - foreach( $extra_data['language'] as $file => $strings ) - { - $bits = explode( '_', $file ); - $app = $bits[0]; - $pack = str_replace( $app.'_', '', $file ); - - $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_lang_words', 'where' => "word_app='{$app}' AND word_pack='{$pack}' AND word_key IN('" . implode( "','", $strings ) . "')" ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $content = array(); - - foreach( $r as $k => $v ) - { - if( !in_array( $k, array( 'word_app', 'word_pack', 'word_key', 'word_default' ) ) ) - { - continue; - } - - $content[ $k ] = $v; - } - - $xml->addElementAsRecord( 'hookextras_language', 'language', $content ); - } - } - } - - //----------------------------------------- - // Modules - //----------------------------------------- - - $xml->addElement( 'hookextras_modules', 'hookexport' ); - - if( is_array($extra_data['modules']) AND count($extra_data['modules']) ) - { - foreach ( $extra_data['modules'] as $module ) - { - list( $_side, $_app, $_module ) = explode( '-', $module ); - $_is_admin = ( $_side == 'admin' ) ? 1 : 0; - - $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_module', 'where' => "sys_module_application='{$_app}' AND sys_module_key='{$_module}' AND sys_module_admin={$_is_admin}" ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - unset($r['sys_module_id']); - - $xml->addElementAsRecord( 'hookextras_modules', 'module', $r ); - } - } - } - - //----------------------------------------- - // Help files - //----------------------------------------- - - $xml->addElement( 'hookextras_help', 'hookexport' ); - - if( is_array($extra_data['help']) AND count($extra_data['help']) ) - { - $this->DB->build( array( 'select' => '*', 'from' => 'faq', 'where' => "title IN('" . implode( "','", $extra_data['help'] ) . "')" ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - unset($r['id']); - - $xml->addElementAsRecord( 'hookextras_help', 'help', $r ); - } - } - - //----------------------------------------- - // Skin templates - //----------------------------------------- - - $remapData = $this->registry->output->buildRemapData( true ); - - $xml->addElement( 'hookextras_templates', 'hookexport' ); - - if( is_array($extra_data['templates']) AND count($extra_data['templates']) ) - { - foreach( $extra_data['templates'] as $file => $templates ) - { - $this->DB->build( array( 'select' => '*', 'from' => 'skin_templates', 'where' => "template_set_id IN ('" . implode( "','", $remapData['export'] ) . "') AND template_master_key != '' AND template_group='{$file}' AND template_name IN('" . implode( "','", $templates ) . "')" ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - unset($r['template_id']); - unset($r['template_set_id']); - - $xml->addElementAsRecord( 'hookextras_templates', 'templates', $r ); - } - } - } - - //----------------------------------------- - // CSS - //----------------------------------------- - - $xml->addElement( 'hookextras_css', 'hookexport' ); - - if( is_array( $extra_data['css'] ) AND count ( $extra_data['css'] ) ) - { - $this->DB->build( array( 'select' => '*', 'from' => 'skin_css', 'where' => "css_set_id IN ('" . implode( "','", $remapData['export'] ) . "') AND css_master_key != '' AND css_group IN('" . implode( "','", $extra_data['css'] ) . "')" ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - unset($r['css_id']); - unset($r['css_set_id']); - - $xml->addElementAsRecord( 'hookextras_css', 'css', $r ); - } - } - - //----------------------------------------- - // Replacements - //----------------------------------------- - - $xml->addElement( 'hookextras_replacements', 'hookexport' ); - - if( is_array( $extra_data['replacements'] ) AND count ( $extra_data['replacements'] ) ) - { - $this->DB->build( array( 'select' => '*', 'from' => 'skin_replacements', 'where' => "replacement_key IN('" . implode( "','", $extra_data['replacements'] ) . "')", 'group' => 'replacement_key' ) ); - - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - unset($r['replacement_id']); - unset($r['replacement_set_id']); - - $xml->addElementAsRecord( 'hookextras_replacements', 'replacements', $r ); - } - } - - //----------------------------------------- - // Tasks - //----------------------------------------- - - $xml->addElement( 'hookextras_tasks', 'hookexport' ); - - if( is_array($extra_data['tasks']) AND count($extra_data['tasks']) ) - { - $this->DB->build( array( 'select' => '*', 'from' => 'task_manager', 'where' => "task_key IN('" . implode( "','", $extra_data['tasks'] ) . "')" ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - unset($r['task_id']); - unset($r['task_next_run']); - - $xml->addElementAsRecord( 'hookextras_tasks', 'tasks', $r ); - } - } - - //----------------------------------------- - // Database changes - //----------------------------------------- - - $xml->addElement( 'hookextras_database_create', 'hookexport' ); - - if( is_array($extra_data['database']['create']) AND count($extra_data['database']['create']) ) - { - foreach( $extra_data['database']['create'] as $create_query ) - { - $xml->addElementAsRecord( 'hookextras_database_create', 'create', $create_query ); - } - } - - $xml->addElement( 'hookextras_database_alter', 'hookexport' ); - - if( is_array($extra_data['database']['alter']) AND count($extra_data['database']['alter']) ) - { - foreach( $extra_data['database']['alter'] as $alter_query ) - { - $xml->addElementAsRecord( 'hookextras_database_alter', 'alter', $alter_query ); - } - } - - $xml->addElement( 'hookextras_database_update', 'hookexport' ); - - if( is_array($extra_data['database']['update']) AND count($extra_data['database']['update']) ) - { - foreach( $extra_data['database']['update'] as $update_query ) - { - $xml->addElementAsRecord( 'hookextras_database_update', 'update', $update_query ); - } - } - - $xml->addElement( 'hookextras_database_insert', 'hookexport' ); - - if( is_array($extra_data['database']['insert']) AND count($extra_data['database']['insert']) ) - { - foreach( $extra_data['database']['insert'] as $insert_query ) - { - $xml->addElementAsRecord( 'hookextras_database_insert', 'insert', $insert_query ); - } - } - - //----------------------------------------- - // Print to browser - //----------------------------------------- - - $this->registry->output->showDownload( $xml->fetchDocument(), $hookData['hook_key'] . '.xml', '', 0 ); - } - - /** - * Clean source code for export.. - * - * @param string Hook source code - * @return string "Cleaned" source code - */ - protected function _cleanSource( $source ) - { - $source = preg_replace( "/class\s+(\S+)\s+extends\s+(\S+)/i", "class \\1 extends (~extends~)", $source ); - - return $source; - } - - /** - * Fix hook positions - * - * @return @e void - */ - protected function _fixPositions() - { - /* Init vars */ - $new_order = 0; - $usedActions = array(); - - $this->DB->build( array( 'select' => 'hook_id, hook_position', 'from' => 'core_hooks', 'where' => 'hook_enabled=1', 'order' => 'hook_position ASC' ) ); - $qid = $this->DB->execute(); - - while ( $hook = $this->DB->fetch( $qid ) ) - { - $new_order++; - $this->DB->update( 'core_hooks', array ( 'hook_position' => $new_order ), "hook_id={$hook['hook_id']}" ); - - $this->DB->build( array( 'select' => '*', 'from' => 'core_hooks_files', 'where' => "hook_type IN ('commandHooks', 'skinHooks', 'libraryHooks' ) AND hook_hook_id=" . $hook['hook_id'] ) ); - $this->DB->execute(); - - while( $file = $this->DB->fetch() ) - { - if( $file['hooks_source'] ) - { - $source = $this->_cleanSource( $file['hooks_source'] ); - } - else - { - $source = is_file( IPS_HOOKS_PATH . $file['hook_file_stored'] ) ? file_get_contents( IPS_HOOKS_PATH . $file['hook_file_stored'] ) : ''; - - if( $source ) - { - $source = $this->_cleanSource( $source ); - } - } - - if( $source ) - { - $hook_data = unserialize( $file['hook_data'] ); - $overload = $hook_data['classToOverload']; - $newClass = $overload; - - $app = ( $file['hook_type'] == 'libraryHooks' ) ? trim($hook_data['libApplication']) : '~_NO_APP_~'; - - if( isset( $usedActions[ $app ][ $overload ] ) ) - { - $newClass = $usedActions[ $app ][ $overload ]; - } - else if( $file['hook_type'] == 'skinHooks' ) - { - $newClass .= "(~id~)"; - } - - $source = str_replace( "(~extends~)", $newClass, $source ); - - file_put_contents( IPS_HOOKS_PATH . $file['hook_file_stored'], $source ); - - $usedActions[ $app ][ $hook_data['classToOverload'] ] = $file['hook_classname']; - } - } - } - } - - /** - * Check if there is an update for a hook - * - * @param string URL to check - * @param string Long version number - * @return bool - */ - public function _updateAvailable( $url, $version ) - { - if( empty($url) || $version === '' ) - { - return false; - } - - $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . '/classFileManagement.php', 'classFileManagement' ); - $checker = new $classToLoad(); - - /* Timeout to prevent page from taking too long */ - $checker->timeout = 5; - - /* Setup url and check */ - $url = str_replace( 'php&', 'php?', $url ); - $url .= '&boardVersion=' . IPB_LONG_VERSION . '&version=' . $version; - - $return = $checker->getFileContents( $url ); - - /* Return the content (if valid) or return 'no update' */ - $return = ( strpos( $return, '0' ) === 0 || strpos( $return, '1' ) === 0 ) ? explode( '|', $return ) : array( 0 ); - - /* Replace {IPSID} id necessary */ - if ( strpos( $return[1], '{IPSID}' ) ) - { - if ( ipsRegistry::$settings['ipb_reg_number'] ) - { - $exploded = explode( '-', ipsRegistry::$settings['ipb_reg_number'] ); - $return[1] = str_replace( '{IPSID}', $exploded[3], $return[1] ); - } - else - { - $return[1] = "https://www.invisionpower.com/clients"; - } - } - - return $return; - } - - /** - * Sorts hooks by their position - * (this is used to avoid a mysql filesort) - * - * @param array $a First hook data - * @param array $b Second hook data - * @return @e integer - */ - protected function sortHooksByPosition( $a, $b ) - { - if ( $a['hook_position'] == $b['hook_position'] ) - { - return 0; - } - - return ( $a['hook_position'] < $b['hook_position'] ) ? -1 : 1; - } - - /** - * Hooks overview - * - * @return @e void [Outputs to screen] - */ - public function _hooksOverview() - { - /* INI */ - $hooksFound = array( 'installed' => array(), 'uninstalled' => array() ); - $hookwarnings = 0; - $hookUpdates = 0; - $checkUpdates = !empty( $this->request['checkUpdates'] ) ? true : false; - $message = ''; - $confGroupIdsToLoad = array(); - $confGroupKeysToLoad= array(); - - /* Get current hooks */ - $this->DB->build( array( 'select' => '*', 'from' => 'core_hooks' ) ); - $outer = $this->DB->execute(); - - while( $r = $this->DB->fetch($outer) ) - { - /* Format some dates */ - $r['_updated'] = $this->registry->getClass('class_localization')->formatTime( $r['hook_updated'] ); - $r['_installed'] = $this->registry->getClass('class_localization')->formatTime( $r['hook_installed'] ); - - /* Got updates? */ - if ( $r['hook_update_check'] && $checkUpdates === true ) - { - $r['hook_update_available'] = $this->_updateAvailable( $r['hook_update_check'], $r['hook_version_long'] ); - - if ( $r['hook_update_available'][0] ) - { - $hookUpdates++; - } - } - else - { - $r['hook_update_available'] = array( 0 ); - } - - /* Got some setting groups to take care of? */ - $r['_has_setting_links'] = null; - $r['_hook_extra_data'] = IPSLib::isSerialized($r['hook_extra_data']) ? unserialize($r['hook_extra_data']) : array(); - - if ( is_array($r['_hook_extra_data']['settingGroups']) && count($r['_hook_extra_data']['settingGroups']) ) - { - $r['_has_setting_links'] = array(); - - foreach( $r['_hook_extra_data']['settingGroups'] as $_group ) - { - $confGroupKeysToLoad[ $_group ] = $_group; - } - } - - if ( is_array($r['_hook_extra_data']['settings']) && count($r['_hook_extra_data']['settings']) ) - { - $r['_has_setting_links'] = array(); - - $this->DB->build( array( 'select' => 'conf_group, conf_key', 'from' => 'core_sys_conf_settings', 'where' => "conf_key IN ('" . implode( "','", $r['_hook_extra_data']['settings'] ) . "')" ) ); - $this->DB->execute(); - - while( $hsg = $this->DB->fetch() ) - { - $confGroupIdsToLoad[ $hsg['conf_key'] ] = $hsg['conf_group']; - } - } - - /* Check requirements */ - $r['_require_errors'] = $this->checkHookRequirements( $r ); - - /* Store */ - if( $r['hook_enabled'] ) - { - if ( count($r['_require_errors']) ) - { - $hookwarnings++; - } - - $hooksFound['installed'][ $r['hook_id'] ] = $r; - } - else - { - $hooksFound['uninstalled'][ $r['hook_id'] ] = $r; - } - } - - /* Got groups to load? */ - $where = array(); - - if ( count($confGroupKeysToLoad) ) - { - $where[] = "conf_title_keyword IN ('" . implode( "','", $confGroupKeysToLoad ) . "')"; - } - - if ( count($confGroupIdsToLoad) ) - { - $where[] = "conf_title_id IN (" . implode( ",", $confGroupIdsToLoad ) . ")"; - } - - if ( count($where) ) - { - $confGroupsLoaded = array(); - - $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_settings_titles', 'where' => implode( ' OR ', $where ) ) ); - $this->DB->execute(); - - while( $gr = $this->DB->fetch() ) - { - if ( empty($gr['conf_title_noshow']) ) - { - $confGroupsLoaded['ids'][ $gr['conf_title_id'] ] = $gr; - $confGroupsLoaded['keys'][ $gr['conf_title_keyword'] ] = & $confGroupsLoaded['ids'][ $gr['conf_title_id'] ]; - } - } - - /* Merge back the data */ - foreach( $hooksFound as $rk => $rt ) - { - foreach( $rt as $sk => $st ) - { - if ( is_array($st['_has_setting_links']) ) - { - if ( is_array($st['_hook_extra_data']['settingGroups']) && count($st['_hook_extra_data']['settingGroups']) ) - { - foreach( $st['_hook_extra_data']['settingGroups'] as $_group ) - { - if ( isset($confGroupsLoaded['keys'][ $_group ]) ) - { - $hooksFound[ $rk ][ $sk ]['_has_setting_links'][ $confGroupsLoaded['keys'][ $_group ]['conf_title_id'] ] = $confGroupsLoaded['keys'][ $_group ]['conf_title_title']; - } - } - } - - if ( is_array($st['_hook_extra_data']['settings']) && count($st['_hook_extra_data']['settings']) ) - { - foreach( $st['_hook_extra_data']['settings'] as $_id ) - { - if ( isset($confGroupsLoaded['ids'][ $confGroupIdsToLoad[ $_id ] ]) ) - { - $hooksFound[ $rk ][ $sk ]['_has_setting_links'][ $confGroupIdsToLoad[ $_id ] ] = $confGroupsLoaded['ids'][ $confGroupIdsToLoad[ $_id ] ]['conf_title_title']; - } - } - } - } - } - } - } - - /* Got updates to show? */ - if ( $checkUpdates === true ) - { - $message = ( $hookUpdates == 1 ) ? $this->lang->words['updates_string_single'] : sprintf( $this->lang->words['updates_string_more'], $hookUpdates ); - } - - if ( count($hooksFound['installed']) ) - { - uasort( $hooksFound['installed'], array( $this, 'sortHooksByPosition' ) ); - } - - /* Output */ - $this->registry->output->html .= $this->html->hooksOverview( $hooksFound, $hookwarnings, $message ); - } - - /** - * Disables all hook - * - * @return @e void [Outputs to screen] - */ - protected function _disableAllHooks() - { - /* INIT */ - $activeHookIds = array(); - - /* Query Enabled Hooks */ - $this->DB->build( array( 'select' => 'hook_id', 'from' => 'core_hooks', 'where' => "hook_enabled=1" ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $activeHookIds[] = $r['hook_id']; - } - - /* Make sure there were active hooks */ - if( ! count( $activeHookIds ) ) - { - $this->registry->output->global_message = $this->lang->words['hook_disable_all_none']; - $this->_hooksOverview(); - return; - } - - /* Disable hooks */ - $this->DB->update( 'core_hooks', array( 'hook_enabled' => 0 ), 'hook_id IN( ' . implode( ',', $activeHookIds ) . ' ) ' ); - - /* Save to cache */ - $this->cache->setCache( 'disabledHooksCache', $activeHookIds, array( 'array' => 1 ) ); - - /* Rebuild cache */ - $this->rebuildHooksCache(); - - /* All Done */ - $this->registry->output->global_message = $this->lang->words['hook_disabled_all']; - $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=hooks_overview' ); - } - - /** - * Re-enable all hook - * - * @return @e void [Outputs to screen] - */ - protected function _reenableAllHooks() - { - /* INIT */ - $activeHookIds = $this->cache->getCache( 'disabledHooksCache' ); - - /* Make sure there were active hooks */ - if( ! count( $activeHookIds ) ) - { - $this->registry->output->global_message = $this->lang->words['hook_enable_all_none']; - $this->_hooksOverview(); - return; - } - - /* Disable hooks */ - $this->DB->update( 'core_hooks', array( 'hook_enabled' => 1 ), 'hook_id IN( ' . implode( ',', $activeHookIds ) . ' ) ' ); - - /* Save to cache */ - $this->cache->setCache( 'disabledHooksCache', array(), array( 'array' => 1 ) ); - - /* Rebuild cache */ - $this->rebuildHooksCache(); - - /* Flag skins for recache */ - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ - $skinCaching = new skinCaching( $this->registry ); - - /* Flag all for recache */ - $skinCaching->flagSetForRecache(); - - /* All Done */ - $this->registry->output->global_message = $this->lang->words['hook_reenable_all']; - $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=hooks_overview' ); - } - - /** - * Disables a hook - * - * @return @e void [Outputs to screen] - */ - protected function _disableHook() - { - /* INI */ - $hook_id = intval( $this->request['id'] ); - - if( !$hook_id ) - { - $this->registry->output->showError( $this->lang->words['h_noedit'], '1118.D' ); - } - - $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $hook_id ) ); - - if( !$hookData['hook_id'] ) - { - $this->registry->output->showError( $this->lang->words['h_noedit'], '1119.D' ); - } - - /* Do update */ - $this->DB->update( 'core_hooks', array( 'hook_enabled' => 0, 'hook_position' => 0 ), "hook_id={$hookData['hook_id']}" ); - - /* Rebuild cache */ - $this->rebuildHooksCache(); - - /* Rebuild global caches */ - try - { - IPSLib::cacheGlobalCaches(); - } - catch( Exception $e ){} - - /* Flag skins for recache */ - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ - $skinCaching = new skinCaching( $this->registry ); - $skinCaching->flagSetForRecache(); - - /* Redirect */ - $this->registry->output->setMessage( $this->lang->words['h_hasbeendisabled'] ); - $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=hooks_overview' ); - } - - /** - * Enables a hook - * - * @return @e void [Outputs to screen] - */ - protected function _enableHook() - { - /* INI */ - $hook_id = intval($this->request['id']); - - if( !$hook_id ) - { - $this->registry->output->showError( $this->lang->words['h_noedit'], '1118.E' ); - } - - $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $hook_id ) ); - - if( !$hookData['hook_id'] ) - { - $this->registry->output->showError( $this->lang->words['h_noedit'], '1119.E' ); - } - - /* Check for requirements */ - if ( empty($this->request['skipRequirements']) ) - { - $errors = $this->checkHookRequirements( $hookData ); - - if ( count($errors) ) - { - $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=check_requirements&fromInstall=1&id='.$hook_id ); - } - } - - /* Do update */ - $this->DB->update( 'core_hooks', array( 'hook_enabled' => 1 ), "hook_id={$hookData['hook_id']}" ); - - /* Rebuild cache */ - $this->rebuildHooksCache(); - - /* Rebuild global caches */ - try - { - IPSLib::cacheGlobalCaches(); - } - catch( Exception $e ){} - - /* Flag skins for recache */ - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ - $skinCaching = new skinCaching( $this->registry ); - $skinCaching->flagSetForRecache(); - - /* Redirect */ - $this->registry->output->global_message = $this->lang->words['h_hasbeenenabled']; - $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=hooks_overview' ); - } - - /** - * Uninstall a hook - * - * @return @e void [Outputs to screen] - */ - protected function _uninstallHook() - { - /* Init vars */ - $hook_id = intval( $this->request['id'] ); - - $hook = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $hook_id ) ); - $extra_data = unserialize( $hook['hook_extra_data'] ); - - if ( ! $hook['hook_id'] ) - { - $this->registry->output->global_message = $this->lang->words['h_hasbeenun']; - $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=hooks_overview' ); - } - - /* Got any custom file to initialize? */ - $_customFile = ''; - $customClass = null; - - if ( $extra_data['display']['custom'] ) - { - $_customFile = IPS_HOOKS_PATH . 'install_' . $extra_data['display']['custom']; - - if( is_file( $_customFile ) ) - { - require_once( $_customFile );/*noLibHook*/ - - $classname = str_replace( '.php', '', $extra_data['display']['custom'] ); - - if( class_exists( $classname ) ) - { - $customClass = new $classname( $this->registry ); - - if( method_exists( $customClass, 'pre_uninstall' ) ) - { - $customClass->pre_uninstall(); - } - } - } - } - - /* Get associated files */ - $this->DB->build( array( 'select' => 'hook_file_stored', 'from' => 'core_hooks_files', 'where' => 'hook_hook_id=' . $hook_id ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - @unlink( IPS_HOOKS_PATH . $r['hook_file_stored'] ); - } - - /* Delete hook file entries */ - $this->DB->delete( 'core_hooks_files', "hook_hook_id={$hook_id}" ); - - //----------------------------------------- - // Settings or setting groups? - //----------------------------------------- - - if( count($extra_data['settingGroups']) ) - { - $this->DB->delete( 'core_sys_settings_titles', "conf_title_keyword IN('" . implode( "','", $extra_data['settingGroups'] ) . "')" ); - } - - if( count($extra_data['settings']) ) - { - $this->DB->delete( 'core_sys_conf_settings', "conf_key IN('" . implode( "','", $extra_data['settings'] ) . "')" ); - } - - $this->cache->rebuildCache( 'settings', 'global' ); - - //----------------------------------------- - // Language strings/files - //----------------------------------------- - - if( count($extra_data['language']) ) - { - foreach( $extra_data['language'] as $file => $bit ) - { - $this->DB->delete( 'core_sys_lang_words', "word_pack='{$file}' AND word_key IN('" . implode( "','", $bit ) . "')" ); - } - - $langPacks = array(); - - $this->DB->build( array( 'select' => 'lang_id', 'from' => 'core_sys_lang' ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $langPacks[] = $r['lang_id']; - } - - $classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir('core') . '/modules_admin/languages/manage_languages.php', 'admin_core_languages_manage_languages' ); - $langLib = new $classToLoad(); - $langLib->makeRegistryShortcuts( $this->registry ); - - foreach( $langPacks as $langId ) - { - $langLib->cacheToDisk( $langId ); - } - } - - //----------------------------------------- - // Modules - //----------------------------------------- - - if( count($extra_data['modules']) ) - { - foreach( $extra_data['modules'] as $module ) - { - list( $_side, $_app, $_module ) = explode( '-', $module ); - $_is_admin = ( $_side == 'admin' ) ? 1 : 0; - - $this->DB->delete( 'core_sys_module', "sys_module_application='{$_app}' AND sys_module_key='{$_module}' AND sys_module_admin={$_is_admin}" ); - } - - $this->cache->rebuildCache( 'module_cache', 'global' ); - $this->cache->rebuildCache( 'app_menu_cache', 'global' ); - } - - //----------------------------------------- - // Help files - //----------------------------------------- - - if( count($extra_data['help']) ) - { - $this->DB->delete( 'faq', "title IN('" . implode( "','", $extra_data['help'] ) . "')" ); - } - - //----------------------------------------- - // Skin templates - //----------------------------------------- - - if( count($extra_data['templates']) ) - { - foreach( $extra_data['templates'] as $group => $bits ) - { - $this->DB->delete( 'skin_templates', "template_group='{$group}' AND template_name IN('" . implode( "','", $bits ) . "')" ); - } - - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ - $skinCaching = new skinCaching( $this->registry ); - $skinCaching->rebuildPHPTemplates( 0 ); - } - - //----------------------------------------- - // CSS - //----------------------------------------- - - if( count( $extra_data['css'] ) ) - { - $this->DB->delete( 'skin_css', "css_group IN('" . implode( "','", $extra_data['css'] ) . "')" ); - - if( ! $skinCaching ) - { - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ - $skinCaching = new skinCaching( $this->registry ); - } - - $skinCaching->rebuildCSSCache( 0 ); - } - - //----------------------------------------- - // Tasks - //----------------------------------------- - - if( count($extra_data['tasks']) ) - { - $this->DB->delete( 'task_manager', "task_key IN('" . implode( "','", $extra_data['tasks'] ) . "')" ); - } - - //----------------------------------------- - // Database changes - //----------------------------------------- - - if( is_array($extra_data['database']['create']) AND count($extra_data['database']['create']) ) - { - foreach( $extra_data['database']['create'] as $create_query ) - { - $this->DB->return_die = true; - $this->DB->dropTable( $create_query['name'] ); - $this->DB->return_die = false; - } - } - - if( is_array($extra_data['database']['alter']) AND count($extra_data['database']['alter']) ) - { - foreach( $extra_data['database']['alter'] as $alter_query ) - { - $this->DB->return_die = true; - - if( $alter_query['altertype'] == 'add' ) - { - if( $this->DB->checkForField( $alter_query['field'], $alter_query['table'] ) ) - { - $this->DB->dropField( $alter_query['table'], $alter_query['field'] ); - } - } - else if( $alter_query['altertype'] == 'change' ) - { - if( $this->DB->checkForField( $alter_query['newfield'], $alter_query['table'] ) ) - { - $this->DB->changeField( $alter_query['table'] , $alter_query['newfield'], $alter_query['field'], $alter_query['fieldtype'], $alter_query['default'] ); - } - } - - $this->DB->return_die = false; - } - } - - if( is_array($extra_data['database']['update']) AND count($extra_data['database']['update']) ) - { - foreach( $extra_data['database']['update'] as $update_query ) - { - $this->DB->return_die = true; - $this->DB->update( $update_query['table'], array( $update_query['field'] => $update_query['oldvalue'] ), $update_query['where'] ); - $this->DB->return_die = false; - } - } - - if( is_array($extra_data['database']['insert']) AND count($extra_data['database']['insert']) ) - { - foreach( $extra_data['database']['insert'] as $insert_query ) - { - if( $insert_query['fordelete'] ) - { - $this->DB->return_die = true; - $this->DB->delete( $insert_query['table'], $insert_query['fordelete'] ); - $this->DB->return_die = false; - } - } - } - - //----------------------------------------- - // Custom install/uninstall script? - //----------------------------------------- - - if ( $_customFile ) - { - if( is_object($customClass) && method_exists( $customClass, 'uninstall' ) ) - { - $customClass->uninstall(); - } - - @unlink( $_customFile ); - } - - /* Delete main hook entry */ - $this->DB->delete( 'core_hooks', "hook_id={$hook_id}" ); - - $this->rebuildHooksCache(); - - /* Done */ - $this->registry->output->global_message = $this->lang->words['h_hasbeenun']; - $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=hooks_overview' ); - } - - /** - * Hook add/edit form - * This dynamic form allows users to associate multiple files with a single hook. - * - * @param string [add|edit] - * @return @e void [Outputs to screen] - */ - protected function _hookForm( $type='add' ) - { - /* Init vars */ - $form = array(); - $files = array(); - $hookData = array(); - $requirements = array(); - $entryPoints = array( 'foreach' => array( array( 'outer.pre', $this->lang->words['h_outerpre'] ), - array( 'inner.pre', $this->lang->words['h_innerpre'] ), - array( 'inner.post', $this->lang->words['h_innerpost'] ), - array( 'outer.post', $this->lang->words['h_outerpost'] ) - ), - 'if' => array( array( 'pre.startif', $this->lang->words['h_prestartif'] ), - array( 'post.startif', $this->lang->words['h_poststartif'] ), - array( 'pre.else', $this->lang->words['h_preelse']), - array( 'post.else', $this->lang->words['h_postelse'] ), - array( 'pre.endif', $this->lang->words['h_preendif'] ), - array( 'post.endif', $this->lang->words['h_postendif'] ) - ) - ); - - /* Edit time? */ - if( $type == 'edit' ) - { - $id = intval($this->request['id']); - - if( !$id ) - { - $this->registry->output->showError( $this->lang->words['h_noedit'], 1116 ); - } - - $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $id ) ); - - if( !$hookData['hook_id'] ) - { - $this->registry->output->showError( $this->lang->words['h_noedit'], 1117 ); - } - - /* Sort out extra stuff and requirements */ - $hookData['hook_extra_data'] = unserialize( $hookData['hook_extra_data'] ); - $hookData['hook_requirements'] = unserialize( $hookData['hook_requirements'] ); - - /* Old data? - @todo: we should remove that around 3.3(4?) */ - if ( ! isset($hookData['hook_requirements']['required_applications']['core']) && isset($hookData['hook_requirements']['hook_ipb_version_min']) && ( $hookData['hook_requirements']['hook_ipb_version_min'] > 0 || $hookData['hook_requirements']['hook_ipb_version_max'] > 0 ) ) - { - $requirements['core'] = array( 'min_version' => intval($hookData['hook_requirements']['hook_ipb_version_min']), 'max_version' => intval($hookData['hook_requirements']['hook_ipb_version_max']) ); - } - - if ( is_array($hookData['hook_requirements']['required_applications']) && count($hookData['hook_requirements']['required_applications']) ) - { - /* Get the setup class */ - require_once( IPS_ROOT_PATH . 'setup/sources/base/setup.php' );/*noLibHook*/ - - foreach( $hookData['hook_requirements']['required_applications'] as $appKey => $versionData ) - { - /* Fetch and check versions */ - if ( !isset($this->cachedVersions[ $appKey ]) ) - { - $this->cachedVersions[ $appKey ] = IPSSetUp::fetchXmlAppVersions( $appKey ); - } - - $_versions = $this->cachedVersions[ $appKey ]; - - krsort($_versions); - - /* Setup our default 'no version' value */ - $versions = array( array( 0, $this->lang->words['h_any_version'] ) ); - - foreach( $_versions as $long => $human ) - { - if ( $long < 30000 && in_array( $appKey, array( 'core', 'forums', 'members' ) ) ) - { - continue; - } - - $versions[] = array( $long, $human ); - } - - $versionData['_versions'] = $versions; - $requirements[ $appKey ] = $versionData; - } - } - - /* Sort out hook files */ - $index = 1; - $skinGroups = $this->hooksFunctions->getSkinGroups(); - - $this->DB->build( array( 'select' => '*', 'from' => 'core_hooks_files', 'where' => 'hook_hook_id=' . $id ) ); - $outer = $this->DB->execute(); - - /* Get them outside the while cycle to prevent warnings */ - $_dataHooks = IPSLib::getDataHookLocations(); - - while( $r = $this->DB->fetch($outer) ) - { - $r['hook_data'] = unserialize( $r['hook_data'] ); - - if( $r['hook_type'] == 'templateHooks' ) - { - $templates = $this->hooksFunctions->getSkinMethods( $r['hook_data']['skinGroup'] ); - $hookIds = $this->hooksFunctions->getHookIds( $r['hook_data']['skinFunction'], $r['hook_data']['type'] ); - - $r['_skinDropdown'] = $this->registry->output->formDropdown( "skinGroup[{$index}]", $skinGroups, $r['hook_data']['skinGroup'], "skinGroup[{$index}]", "onchange='getTemplatesForAdd({$index});'" ); - $r['_templateDropdown'] = $this->registry->output->formDropdown( "skinFunction[{$index}]", $templates, $r['hook_data']['skinFunction'], "skinFunction[{$index}]", "onchange='getTypeOfHook({$index});'" ); - $r['_hookTypeDropdown'] = $this->registry->output->formDropdown( "type[{$index}]", array( array( 0, $this->lang->words['a_selectone'] ), array( 'foreach', $this->lang->words['hook_foreach_loop'] ), array( 'if', $this->lang->words['hook_if_statement'] ) ), $r['hook_data']['type'], "type[{$index}]", "onchange='getHookIds({$index});'" ); - $r['_hookIdsDropdown'] = $this->registry->output->formDropdown( "id[{$index}]", $hookIds, $r['hook_data']['id'], "id[{$index}]", "onchange='getHookEntryPoints({$index});'" ); - $r['_hookEPDropdown'] = $this->registry->output->formDropdown( "position[{$index}]", $r['hook_data']['type'] == 'foreach' ? $entryPoints['foreach'] : $entryPoints['if'], $r['hook_data']['position'] ); - } - - if( $r['hook_type'] == 'dataHooks' ) - { - $r['_dataLocationDropdown'] = $this->registry->output->formDropdown( "dataLocation[{$index}]", $_dataHooks, $r['hook_data']['dataLocation'] ); - } - - $files[ $index ] = $r; - $index++; - } - - $action = 'do_edit_hook'; - } - else - { - $action = 'do_create_hook'; - } - - /* Info */ - foreach( array( 'hook_name', 'hook_desc', 'hook_key', 'hook_version_human', 'hook_version_long', 'hook_author', 'hook_email', 'hook_website', 'hook_update_check' ) as $_hook_key ) - { - $form[ $_hook_key ] = $this->registry->output->formSimpleInput( $_hook_key , isset($this->request[ $_hook_key ]) ? $this->request[ $_hook_key ] : $hookData[ $_hook_key ], 60 ); - } - - /* Requirements */ - foreach( array( 'hook_php_version_min', 'hook_php_version_max' ) as $_version_key ) - { - $form[ $_version_key ] = $this->registry->output->formSimpleInput( $_version_key , isset($this->request[ $_version_key ]) ? $this->request[ $_version_key ] : $hookData['hook_requirements'][ $_version_key ], 20 ); - } - - /* Setup the global caches DD */ - $_caches = array(); - - $this->DB->build( array( 'select' => 'cs_key', - 'from' => 'cache_store', - 'order' => 'cs_key ASC' - ) ); - $this->DB->execute(); - - while( $gc = $this->DB->fetch() ) - { - $_caches[] = array( $gc['cs_key'], $gc['cs_key'] ); - } - - sort( $_caches ); - - $form['hook_global_caches'] = $this->registry->output->formMultiDropdown( 'hook_global_caches[]', $_caches, isset($_POST['hook_global_caches']) ? $_POST['hook_global_caches'] : explode(',',$hookData['hook_global_caches']), 15 ); - - /* Get some data for the javascript */ - $form['jsDataTypes'] = IPSText::br2nl( $this->registry->output->formDropdown( "type[#{index}]", array( array( 0, $this->lang->words['a_selectone'] ), array( 'foreach', $this->lang->words['hook_foreach_loop'] ), array( 'if', $this->lang->words['hook_if_statement'] ) ), '', "type[#{index}]", "onchange='getHookIds(#{index});'" ) ); - $form['jsDataPoints'] = IPSText::br2nl( $this->registry->output->formDropdown( "position[#{index}]", $r['hook_data']['type'] == 'foreach' ? $entryPoints['foreach'] : $entryPoints['if'] ) ); - - /* Output */ - $this->registry->output->extra_nav[] = array( $this->settings['base_url'] . $this->form_code . 'do=hooks_overview', $this->lang->words['menu__manage_hooks'] ); - $this->registry->output->html .= $this->html->hookForm( $form, $action, $hookData, $files, $requirements ); - } - - /** - * Hook add/edit save - * Save the new (or updated) hook record - * - * @param string [add|edit] - * @return @e void [Outputs to screen] - */ - protected function _hookSave( $type='add' ) - { - /* Init vars */ - $hookData = array(); - $newFiles = array(); - $requireApp = array(); - $_hookFiles = array(); - $extraKey = ''; - - /* Get data if we are editing */ - if( $type == 'edit' ) - { - $id = intval($this->request['hook_id']); - - if( !$id ) - { - $this->registry->output->showError( $this->lang->words['h_noedit'], 1118 ); - } - - $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $id ) ); - - if( !$hookData['hook_id'] ) - { - $this->registry->output->showError( $this->lang->words['h_noedit'], 1119 ); - } - - $extraKey = ' AND hook_id != ' . $hookData['hook_id']; - } - - /* Error Checking */ - if( ! $this->request['hook_name'] ) - { - $errors[] = $this->lang->words['hook_form_no_title']; - } - - if( empty( $this->request['hook_key'] ) ) - { - $errors[] = $this->lang->words['hook_form_no_key']; - } - else - { - $keyCheck = $this->DB->buildAndFetch( array( 'select' => 'count(*) as found', 'from' => 'core_hooks', 'where' => "hook_key='" . $this->DB->addSlashes( $this->request['hook_key'] ) . "'" . $extraKey ) ); - - if ( $keyCheck['found'] > 0 ) - { - $errors[] = $this->lang->words['hook_form_dupe_key']; - } - } - - /* Got any errors? */ - if ( is_array( $errors ) && count( $errors ) ) - { - $this->registry->output->global_error = implode( '
', $errors ); - $this->_hookForm(); - return; - } - - /* Not IN_DEV? */ - if ( ! IN_DEV ) - { - $this->DB->build( array( 'select' => '*', 'from' => 'core_hooks_files', 'where' => 'hook_hook_id=' . intval($this->request['hook_id']) ) ); - $this->DB->execute(); - - while( $_r = $this->DB->fetch() ) - { - $_hookFiles[ $_r['hook_classname'] ] = $_r['hook_file_stored']; - } - } - - /* Check for requirements */ - if ( is_array( $this->request['requireApp'] ) AND count( $this->request['requireApp'] ) ) - { - foreach( $this->request['requireApp'] as $_index => $app_key ) - { - if ( $app_key ) - { - $minVersion = intval($this->request['minVersion'][ $_index ]); - $maxVersion = intval($this->request['maxVersion'][ $_index ]); - - $requireApp[ $app_key ] = array( 'app_name' => ipsRegistry::$applications[ $app_key ]['app_title'], - 'min_version' => $minVersion, - 'max_version' => $maxVersion - ); - } - } - } - - /* Check for files */ - if ( is_array( $this->request['file'] ) AND count( $this->request['file'] ) ) - { - foreach( $this->request['file'] as $index => $file ) - { - if ( $file ) - { - $newFiles[ $index ] = array('hook_file_real' => $file, - 'hook_type' => $this->request['hook_type'][ $index ], - 'hook_classname' => $this->request['hook_classname'][ $index ], - 'hook_data' => serialize( array('dataLocation' => trim( $this->request['dataLocation'][ $index ] ), - 'libApplication' => trim( $this->request['libApplication'][ $index ] ), - 'classToOverload' => trim($this->request['classToOverload'][ $index ]), - 'skinGroup' => $this->request['skinGroup'][ $index ], - 'skinFunction' => $this->request['skinFunction'][ $index ], - 'type' => $this->request['type'][ $index ], - 'id' => $this->request['id'][ $index ], - 'position' => $this->request['position'][ $index ], - ) - ) - ); - - /** - * @link http://community.invisionpower.com/tracker/issue-22084-hook-edit-does-not-preserve-correct-name/ - * We don't want to reset the stored name if you are not in developer mode - */ - if ( IN_DEV ) - { - $newFiles[ $index ]['hook_file_stored'] = $file; // During import this is a random name, but for devs it's actual file - } - else - { - $newFiles[ $index ]['hook_file_stored'] = $_hookFiles[ $this->request['hook_classname'][ $index ] ] ? $_hookFiles[ $this->request['hook_classname'][ $index ] ] : $file; - } - } - } - } - - /* Get position */ - if ( $type == 'add' ) - { - $position = $this->DB->buildAndFetch( array( 'select' => 'MAX(hook_position) as newPos', 'from' => 'core_hooks' ) ); - - $position['newPos'] = intval($position['newPos']) + 1; - } - else - { - $position['newPos'] = $hookData['hook_position']; - } - - $mainHookRecord = array('hook_name' => trim($this->request['hook_name']), - 'hook_key' => substr( trim($this->request['hook_key']), 0, 32 ), - 'hook_global_caches' => ( is_array($this->request['hook_global_caches']) && count($this->request['hook_global_caches']) ) ? implode(',', $this->request['hook_global_caches']) : '', - 'hook_desc' => trim($this->request['hook_desc']), - 'hook_version_human' => trim($this->request['hook_version_human']), - 'hook_version_long' => trim($this->request['hook_version_long']), - 'hook_author' => trim($this->request['hook_author']), - 'hook_email' => trim($this->request['hook_email']), - 'hook_website' => trim($this->request['hook_website']), - 'hook_update_check' => trim($this->request['hook_update_check']), - 'hook_enabled' => $type == 'add' ? 1 : $hookData['hook_enabled'], - 'hook_installed' => $type == 'add' ? IPS_UNIX_TIME_NOW : $hookData['hook_installed'], - 'hook_updated' => $type == 'add' ? 0 : IPS_UNIX_TIME_NOW, - 'hook_position' => $position['newPos'], - 'hook_requirements' => serialize( array('required_applications' => $requireApp, - 'hook_php_version_min' => trim($this->request['hook_php_version_min']), - 'hook_php_version_max' => trim($this->request['hook_php_version_max']) - ) - ) - ); - - if( $type == 'edit' ) - { - $this->DB->update( 'core_hooks', $mainHookRecord, 'hook_id=' . $hookData['hook_id'] ); - - $this->DB->delete( 'core_hooks_files', 'hook_hook_id=' . $hookData['hook_id'] ); - } - else - { - $this->DB->insert( 'core_hooks', $mainHookRecord ); - - $hookData['hook_id'] = $this->DB->getInsertId(); - } - - foreach( $newFiles as $index => $toInsert ) - { - $toInsert['hook_hook_id'] = $hookData['hook_id']; - - $this->DB->insert( 'core_hooks_files', $toInsert ); - } - - /* Rebuild cache */ - $this->rebuildHooksCache(); - - /* Rebuild global caches */ - try - { - IPSLib::cacheGlobalCaches(); - } - catch( Exception $e ){} - - /* Flag skins for recache */ - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ - $skinCaching = new skinCaching( $this->registry ); - $skinCaching->flagSetForRecache(); - - /* Redirect */ - $this->registry->output->setMessage( $this->lang->words['h_saved'] ); - $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=hooks_overview' ); - } - - /** - * View details about a hook - * - * @return @e void [Outputs to screen] - */ - protected function _viewDetails() - { - $id = intval($this->request['id']); - - if( !$id ) - { - $this->registry->output->showError( $this->lang->words['h_nodetails'], 11110 ); - } - - $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $id ) ); - - if( !$hookData['hook_id'] ) - { - $this->registry->output->showError( $this->lang->words['h_nodetails'], 11111 ); - } - - /* Extra data */ - $hookData['_updated'] = $this->registry->getClass('class_localization')->formatTime( $hookData['hook_updated'] ); - $hookData['hook_extra_data'] = unserialize( $hookData['hook_extra_data'] ); - - /* Meets requirements? */ - $hookData['_require_errors'] = $this->checkHookRequirements( $hookData ); - - /* Got updates? */ - if ( $hookData['hook_update_check'] ) - { - $hookData['hook_update_available'] = $this->_updateAvailable( $hookData['hook_update_check'], $hookData['hook_version_long'] ); - } - else - { - $hookData['hook_update_available'] = array( 0 ); - } - - /* Get files */ - $files = array(); - $index = 1; - - $this->DB->build( array( 'select' => '*', 'from' => 'core_hooks_files', 'where' => 'hook_hook_id=' . $id ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $r['hook_data'] = unserialize( $r['hook_data'] ); - $files[ $index ] = $r; - $index++; - } - - /* Output */ - $this->registry->output->extra_nav[] = array( $this->settings['base_url'] . $this->form_code . 'do=hooks_overview', $this->lang->words['menu__manage_hooks'] ); - $this->registry->output->html .= $this->html->hookDetails( $hookData, $files ); - } - - /** - * Check if the hook meets all the requirements - * - * @param mixed $hook Can be an hook ID or an array of the hook data - * @return @e array Errors found - */ - public function checkHookRequirements( $hook ) - { - /* Init vars */ - $hookData = array(); - $reqsData = array(); - $errors = array(); - - /* We already have some data? */ - if ( is_array($hook) && count($hook) ) - { - $hookData = $hook; - } - elseif ( is_int($hook) ) - { - $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $hook ) ); - } - - /* Requirements are still serialized? */ - if ( IPSLib::isSerialized($hookData['hook_requirements']) ) - { - $hookData['hook_requirements'] = unserialize($hookData['hook_requirements']); - } - - /* Make our var shorter... */ - $reqsData = &$hookData['hook_requirements']; - - /* Old data? - @todo: remove this check around 3.3(4?) */ - if ( ! isset($reqsData['required_applications']['core']) && isset($reqsData['hook_ipb_version_min']) && ( $reqsData['hook_ipb_version_min'] > 0 || $reqsData['hook_ipb_version_max'] > 0 ) ) - { - $reqsData['hook_ipb_version_min'] = ( $reqsData['hook_ipb_version_min'] < 30000 ) ? 30000 : $reqsData['hook_ipb_version_min']; - - $reqsData['required_applications']['core'] = array( 'min_version' => intval($reqsData['hook_ipb_version_min']), 'max_version' => intval($reqsData['hook_ipb_version_max']) ); - } - - //----------------------------------------- - // Let's start checking requirements - //----------------------------------------- - - /* PHP */ - if( $reqsData['hook_php_version_min'] OR $reqsData['hook_php_version_max'] ) - { - if( $reqsData['hook_php_version_min'] AND version_compare( PHP_VERSION, $reqsData['hook_php_version_min'], '<' ) == true ) - { - $errors['php_min'] = sprintf( $this->lang->words['h_phpold'],$reqsData['hook_php_version_min'] ); - } - - if( $reqsData['hook_php_version_max'] AND version_compare( PHP_VERSION, $reqsData['hook_php_version_max'], '>' ) == true ) - { - $errors['php_max'] = sprintf( $this->lang->words['h_phpnew'], $reqsData['hook_php_version_max'] ); - } - } - - /* Additional applications */ - if ( is_array($reqsData['required_applications']) && count($reqsData['required_applications']) ) - { - /* Get the setup class */ - require_once( IPS_ROOT_PATH . 'setup/sources/base/setup.php' );/*noLibHook*/ - - /* Loop through all apps */ - foreach( $reqsData['required_applications'] as $appKey => $appData ) - { - /* Versions file doesn't exist? */ - if ( !is_file( IPSLib::getAppDir( $appKey ) . '/xml/versions.xml' ) ) - { - $errors[ $appKey.'_app' ] = sprintf( $this->lang->words['hook_require_appnotfound'], $appData['app_name'] ); - } - /* App not installed/enabled? */ - elseif ( !IPSLib::appIsInstalled( $appKey ) ) - { - $errors[ $appKey.'_app' ] = sprintf( $this->lang->words['hook_require_appdisabled'], ipsRegistry::$applications[ $appKey ]['app_title'] ); - } - elseif ( $appData['min_version'] OR $appData['max_version'] ) - { - /* Fetch and check versions */ - if ( !isset($this->cachedVersions[ $appKey ]) ) - { - $this->cachedVersions[ $appKey ] = IPSSetUp::fetchXmlAppVersions( $appKey ); - } - - $versions = $this->cachedVersions[ $appKey ]; - - if ( is_array($versions) && count($versions) ) - { - if ( !isset($this->cachedUpgradeInfo[ $appKey ]) ) - { - $_key = in_array( $appKey, array( 'forums', 'members' ) ) ? 'core' : $appKey; - $this->cachedUpgradeInfo[ $_key ] = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'upgrade_history', 'where' => "upgrade_app='{$_key}'", 'order' => 'upgrade_version_id DESC', 'limit' => array( 1 ) ) ); - - /* Extra caching for the three core apps */ - if( in_array( $appKey, array( 'core', 'forums', 'members' ) ) ) - { - $this->cachedUpgradeInfo['core'] = $this->cachedUpgradeInfo[ $_key ]; - $this->cachedUpgradeInfo['forums'] = $this->cachedUpgradeInfo[ $_key ]; - $this->cachedUpgradeInfo['members'] = $this->cachedUpgradeInfo[ $_key ]; - } - } - - /* Do we meet tha requirements? */ - if ( $appData['min_version'] AND $this->cachedUpgradeInfo[ $appKey ]['upgrade_version_id'] < $appData['min_version'] ) - { - $errors[ $appKey.'_min' ] = sprintf( $this->lang->words['hook_require_tooold'], isset($versions[ $appData['min_version'] ]) ? $versions[ $appData['min_version'] ] : $appData['min_version'] ); - } - - if ( $appData['max_version'] AND $this->cachedUpgradeInfo[ $appKey ]['upgrade_version_id'] > $appData['max_version'] ) - { - $errors[ $appKey.'_max' ] = sprintf( $this->lang->words['hook_require_toonew'], isset($versions[ $appData['max_version'] ]) ? $versions[ $appData['max_version'] ] : $appData['max_version'] ); - } - } - } - } - } - - return $errors; - } - - /** - * Check if you meet hook requirements - * - * @return @e void [Outputs to screen] - */ - protected function _checkRequirements() - { - $id = intval($this->request['id']); - - if( !$id ) - { - $this->registry->output->showError( $this->lang->words['h_norequirements'], 11112 ); - } - - $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $id ) ); - - if( !$hookData['hook_id'] ) - { - $this->registry->output->showError( $this->lang->words['h_norequirements'], 11113 ); - } - - /* Get requirements */ - $hookData['hook_requirements'] = unserialize($hookData['hook_requirements']); - - /* Check requirements */ - $errors = $this->checkHookRequirements( $hookData ); - - /* Output */ - $this->registry->output->extra_nav[] = array( $this->settings['base_url'] . $this->form_code . 'do=hooks_overview', $this->lang->words['menu__manage_hooks'] ); - $this->registry->output->html .= $this->html->hookRequirements( $hookData, $errors, $this->cachedVersions ); - } - - /** - * Rebuild hooks cache - * - * @return @e void - */ - public function rebuildHooksCache() - { - /* INI */ - $cache = array( 'commandHooks' => array(), 'skinHooks' => array(), 'templateHooks' => array(), 'dataHooks' => array(), 'libraryHooks' => array() ); - - /* First fix positions */ - $this->_fixPositions(); - - /* Get current hooks */ - $this->DB->build( array( 'select' => 'f.*', - 'from' => array( 'core_hooks_files' => 'f' ), - 'where' => 'c.hook_enabled=1', - 'order' => 'c.hook_position ASC', - 'add_join' => array( array( 'select' => 'c.hook_id', - 'from' => array( 'core_hooks' => 'c' ), - 'where' => 'c.hook_id=f.hook_hook_id', - 'type' => 'left' ) ) - ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - /* Got no main hook id? Weird but skip.. */ - if ( empty($r['hook_id']) ) - { - continue; - } - - /* INIT */ - $_cache = array(); - $data = unserialize( $r['hook_data'] ); - - /* General Stuff */ - $_cache = array( 'filename' => $r['hook_file_stored'], - 'className' => $r['hook_classname'] - ); - - /* Hook type specific stuff */ - if( $r['hook_type'] == 'templateHooks' ) - { - $_cache['type'] = $data['type']; - $_cache['skinFunction'] = $data['skinFunction']; - $_cache['id'] = $data['id']; - $_cache['position'] = $data['position']; - } - else if( /*$r['hook_type'] == 'dataHooks' OR*/ $r['hook_type'] == 'libraryHooks' ) - { - $_cache['classToOverload'] = $data['classToOverload']; - } - - /* Add to array */ - if( $r['hook_type'] == 'templateHooks' ) - { - $cache[ $r['hook_type'] ][ $data['skinGroup'] ][] = $_cache; - } - else if( $r['hook_type'] == 'dataHooks' ) - { - $cache[ $r['hook_type'] ][ $data['dataLocation'] ][] = $_cache; - } - else if( $r['hook_type'] == 'libraryHooks' ) - { - $cache[ $r['hook_type'] ][ $data['libApplication'] ][ $data['classToOverload'] ][] = $_cache; - } - else - { - $cache[ $r['hook_type'] ][ $data['classToOverload'] ][] = $_cache; - } - } - - /* Update the cache */ - $this->cache->setCache( 'hooks', $cache, array( 'array' => 1 ) ); - } + + * Invision Power Services + * IP.Board v3.4.6 + * Hooks Management + * Last Updated: $Date: 2013-05-20 16:38:23 -0400 (Mon, 20 May 2013) $ + *
+ * + * @author $Author: bfarber $ + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license http://www.invisionpower.com/company/standards.php#license + * @package IP.Board + * @subpackage Core + * @link http://www.invisionpower.com + * @since 3.0.0 + * @version $Revision: 12261 $ + */ + +if ( ! defined( 'IN_ACP' ) ) +{ + print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; + exit(); +} + +class admin_core_applications_hooks extends ipsCommand +{ + /** + * Skin object + * + * @var object Skin templates + */ + protected $html; + + /** + * Hooks library + * + * @var object Hooks library + */ + protected $hooksFunctions; + + /** + * Existing hooks + * + * @var array Existing hooks + */ + protected $hooks; + + /** + * Array of all the cache versions + * for the required applications + * + * @var $cachedVersions + */ + protected $cachedVersions = array(); + + /** + * Main class entry point + * + * @param object ipsRegistry reference + * @return @e void [Outputs to screen] + */ + public function doExecute( ipsRegistry $registry ) + { + //----------------------------------------- + // Load skin + //----------------------------------------- + + $this->html = $this->registry->output->loadTemplate('cp_skin_applications'); + + //----------------------------------------- + // Load hooks library + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('core') . '/sources/classes/hooksFunctions.php', 'hooksFunctions' ); + $this->hooksFunctions = new $classToLoad( $registry ); + + // lang already loaded by hookFunctions + //$this->registry->class_localization->loadLanguageFile( array( 'admin_applications' ), 'core' ); + + if( defined('NO_WRITE_HOOKS') ) + { + $this->registry->output->showError( $this->lang->words['no_write_hooks'] ); + } + + //----------------------------------------- + // Set up stuff + //----------------------------------------- + + $this->form_code = $this->html->form_code = 'module=applications&section=hooks&'; + $this->form_code_js = $this->html->form_code_js = 'module=applications§ion=hooks&'; + + //----------------------------------------- + // What to do... + //----------------------------------------- + + switch( $this->request['do'] ) + { + case 'reenable_all_hooks': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); + $this->_reenableAllHooks(); + break; + case 'disable_all_hooks': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); + $this->_disableAllHooks(); + break; + + break; + case 'disable_hook': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); + $this->_disableHook(); + break; + case 'enable_hook': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); + $this->_enableHook(); + break; + + case 'uninstall_hook': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_delete' ); + $this->_uninstallHook(); + break; + case 'install_hook': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); + $this->_installHook(); + break; + + case 'reorder': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); + $this->_reorder(); + break; + + case 'view_details': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); + $this->_viewDetails(); + break; + + case 'check_requirements': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); + $this->_checkRequirements(); + break; + + case 'export_hook': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); + $this->_exportHook(); + break; + + case 'do_export_hook': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); + $this->_doExportHook(); + break; + + case 'create_hook': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); + $this->_hookForm( 'add' ); + break; + + case 'edit_hook': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); + $this->_hookForm( 'edit' ); + break; + + case 'do_create_hook': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); + $this->_hookSave( 'add' ); + break; + + case 'do_edit_hook': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); + $this->_hookSave( 'edit' ); + break; + + case 'removeDeadCaches': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); + $this->removeDeadCaches(); + break; + + case 'reimport_apps': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); + $this->reimportAppHooks(); + break; + + case 'hooks_overview': + default: + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'hooks_manage' ); + $this->request['do'] = 'hooks_overview'; + $this->_hooksOverview(); + break; + } + + //----------------------------------------- + // Pass to CP output hander + //----------------------------------------- + + $this->registry->getClass('output')->html_main .= $this->registry->getClass('output')->global_template->global_frame_wrapper(); + $this->registry->getClass('output')->sendOutput(); + } + + /** + * Reimport all hooks for all installed applications + * + * @return @e void + */ + protected function reimportAppHooks() + { + $stats = array( 'inserted' => 0, 'updated' => 0, 'skipped' => 0 ); + + foreach( ipsRegistry::$applications as $app ) + { + $_stats = $this->installAppHooks( $app['app_directory'] ); + + $stats['inserted'] = $stats['inserted'] + $_stats['inserted']; + $stats['updated'] = $stats['updated'] + $_stats['updated']; + $stats['skipped'] = $stats['skipped'] + $_stats['skipped']; + } + + /* Rebuild cache */ + $this->rebuildHooksCache(); + + /* Rebuild global caches */ + try + { + IPSLib::cacheGlobalCaches(); + } + catch( Exception $e ){} + + /* Flag skins for recache */ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + $skinCaching = new skinCaching( $this->registry ); + $skinCaching->flagSetForRecache(); + + /* Redirect */ + $this->registry->output->global_message = sprintf( $this->lang->words['app_hooks_rebuilt'], $stats['inserted'], $stats['updated'], $stats['skipped'] ); + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=hooks_overview' ); + } + + /** + * Rebuild skins following hook import that included a template + * + * @return @e void + */ + protected function removeDeadCaches() + { + $messages = array(); + $keep = array(); + $unlink = array(); + + /* Grab all current hooks caches */ + $this->DB->build( array( 'select' => '*', + 'from' => 'core_hooks_files' ) ); + + $this->DB->execute(); + + while( $row = $this->DB->fetch() ) + { + $keep[] = $row['hook_file_stored']; + } + + try + { + foreach( new DirectoryIterator( IPS_HOOKS_PATH ) as $file ) + { + if ( ! $file->isDot() ) + { + $_name = $file->getFileName(); + + if ( preg_match( "#_[a-z0-9]{32}\.php$#", $_name ) ) + { + if ( ! in_array( $_name, $keep ) ) + { + $unlink[] = $_name; + } + } + } + } + } catch ( Exception $e ) { print $e->getMessage(); } + + /* Anything to unlink? */ + if ( count( $unlink ) ) + { + foreach( $unlink as $file ) + { + @unlink( IPS_HOOKS_PATH . $file ); + } + } + + /* Print message */ + $this->registry->output->global_message = sprintf( $this->lang->words['hook_removed_files'], count( $unlink ) ) . '
' . implode( '
', $unlink ); + $this->_hooksOverview(); + } + + /** + * Reorder hooks + * + * @return @e void [Outputs to screen] + */ + protected function _reorder() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classAjax.php', 'classAjax' ); + $ajax = new $classToLoad(); + + //----------------------------------------- + // Checks... + //----------------------------------------- + + if( $this->registry->adminFunctions->checkSecurityKey( $this->request['md5check'], true ) === false ) + { + $ajax->returnString( $this->lang->words['postform_badmd5'] ); + } + + //----------------------------------------- + // Save new position + //----------------------------------------- + + $position = 1; + + if( is_array($this->request['hooks']) AND count($this->request['hooks']) ) + { + /* Reset all hooks to 0 temporarily */ + $this->DB->update( 'core_hooks', array( 'hook_position' => 0 ) ); + + foreach( $this->request['hooks'] as $this_id ) + { + $this->DB->update( 'core_hooks', array( 'hook_position' => $position ), 'hook_id=' . $this_id ); + + $position++; + } + } + + $this->rebuildHooksCache(); + + $ajax->returnString('OK'); + } + + /** + * Install a new hook + * + * @return void + */ + protected function _installHook() + { + //----------------------------------------- + // Get uploaded schtuff + //----------------------------------------- + + $tmp_name = $_FILES['FILE_UPLOAD']['name']; + $tmp_name = preg_replace( "#\.gz$#", "", $tmp_name ); + + $content = ipsRegistry::getClass('adminFunctions')->importXml( $tmp_name ); + + if( ! $content ) + { + $this->registry->output->showError( $this->lang->words['h_noxml'], 1110 ); + } + + $this->installHook( $content, TRUE, FALSE ); + + /* Rebuild cache */ + $this->rebuildHooksCache(); + + /* Rebuild global caches */ + try + { + IPSLib::cacheGlobalCaches(); + } + catch( Exception $e ){} + + /* Flag skins for recache */ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + $skinCaching = new skinCaching( $this->registry ); + $skinCaching->flagSetForRecache(); + + /* Redirect */ + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=hooks_overview' ); + } + + /** + * Function mostly used in installer/upgrader + * Inserts new hooks + * + * @param string Application to install hooks for + */ + public function installAppHooks( $app ) + { + static $hooks = array(); + + $msgs = array( 'inserted' => 0, 'updated' => 0, 'skipped' => 0 ); + $xmlData = array(); + $path = IPSLib::getAppDir( $app ) . '/xml'; + + if ( is_file( $path . '/hooks.xml' ) AND is_dir( $path . '/hooks' ) ) + { + if( !count($hooks) ) + { + /* Fetch current hooks */ + $this->DB->build( array( 'select' => '*', + 'from' => 'core_hooks' ) ); + $this->DB->execute(); + + while( $row = $this->DB->fetch() ) + { + if ( $row['hook_key'] ) + { + $hooks[ $row['hook_key'] ] = $row; + } + } + } + + /* Alright. We're in. Read the XML file */ + require_once( IPS_KERNEL_PATH . 'classXML.php' );/*noLibHook*/ + $xml = new classXML( IPS_DOC_CHAR_SET ); + + /* Grab wrapper file */ + $xml->load( $path . '/hooks.xml' ); + + foreach( $xml->fetchElements('hook') as $data ) + { + $xmlData[] = $xml->fetchElementsFromRecord( $data ); + } + + /* Examine XML */ + if ( is_array( $xmlData ) AND count( $xmlData ) ) + { + foreach( $xmlData as $x ) + { + if ( is_file( $path . '/hooks/' . $x['file'] ) ) + { + $xml->load( $path . '/hooks/' . $x['file'] ); + + foreach( $xml->fetchElements('config') as $data ) + { + $config = $xml->fetchElementsFromRecord( $data ); + } + + if ( ! isset( $hooks[ $config['hook_key'] ] ) ) + { + /* Add it */ + $msgs['inserted']++; + $this->installHook( file_get_contents( $path . '/hooks/' . $x['file'] ), FALSE, FALSE, $x['enabled'] ); + } + else + { + $this->installHook( file_get_contents( $path . '/hooks/' . $x['file'] ), FALSE, FALSE, $x['enabled'] ); + $msgs['updated']++; + } + } + } + } + } + + return $msgs; + } + + /** + * Public install hook so we can use it in the installer and elsewhere + * + * @param string XML data + * @param boolean Add message to output->global_message + * @param boolean Allow skins to recache + * @param int Install enabled + * @return @e void + */ + public function installHook( $content, $addMessage=FALSE, $allowSkinRecache=TRUE, $enabled=1 ) + { + //----------------------------------------- + // Hooks directory writable? + //----------------------------------------- + + if( !is_writable( IPS_HOOKS_PATH ) ) + { + if( !$addMessage ) + { + return false; + } + + $this->registry->output->showError( $this->lang->words['h_dir_notwritable'], 111159 ); + } + + //----------------------------------------- + // Got our hooks? + //----------------------------------------- + + if( !is_array($this->hooks) OR !count($this->hooks) ) + { + $this->DB->build( array( 'select' => '*', 'from' => 'core_hooks' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $this->hooks[ $r['hook_key'] ] = $r; + } + } + + //----------------------------------------- + // Get xml mah-do-dah + //----------------------------------------- + + require_once( IPS_KERNEL_PATH . 'classXML.php' );/*noLibHook*/ + $xml = new classXML( IPS_DOC_CHAR_SET ); + + //----------------------------------------- + // Unpack the datafile + //----------------------------------------- + + $xml->loadXML( $content ); + + foreach( $xml->fetchElements('config') as $data ) + { + $config = $xml->fetchElementsFromRecord( $data ); + + if( !count($config) ) + { + $this->registry->output->showError( $this->lang->words['h_xmlwrong'], 1111 ); + } + } + + //----------------------------------------- + // Temp + //----------------------------------------- + + $tempExtraData = unserialize( $config['hook_extra_data'] ); + + //----------------------------------------- + // Set config + //----------------------------------------- + + $config = array('hook_name' => $config['hook_name'], + 'hook_desc' => $config['hook_desc'], + 'hook_author' => $config['hook_author'], + 'hook_email' => $config['hook_email'], + 'hook_website' => $config['hook_website'], + 'hook_update_check' => $config['hook_update_check'], + 'hook_requirements' => $config['hook_requirements'], + 'hook_version_human' => $config['hook_version_human'], + 'hook_version_long' => $config['hook_version_long'], + 'hook_key' => $config['hook_key'], + 'hook_global_caches' => $config['hook_global_caches'], + 'hook_enabled' => $enabled, + 'hook_updated' => IPS_UNIX_TIME_NOW, + ); + + $extra_data = array(); + + //----------------------------------------- + // Set files + //----------------------------------------- + + $files = array(); + + foreach( $xml->fetchElements('hookfiles') as $node ) + { + foreach( $xml->fetchElements('file', $node) as $_file ) + { + $file = $xml->fetchElementsFromRecord( $_file ); + + if( $file['hook_type'] ) + { + $files[] = array( + 'hook_file_real' => $file['hook_file_real'], + 'hook_type' => $file['hook_type'], + 'hook_classname' => $file['hook_classname'], + 'hook_data' => $file['hook_data'], + 'hooks_source' => $file['hooks_source'], + ); + } + } + } + + //----------------------------------------- + // Set the custom script + //----------------------------------------- + + $custom = array(); + $customClass = null; + + foreach( $xml->fetchElements('hookextras_custom') as $node ) + { + foreach( $xml->fetchElements('file', $node) as $_file ) + { + $file = $xml->fetchElementsFromRecord( $_file ); + + if( count($file) ) + { + $custom = array( 'filename' => $file['filename'], + 'source' => $file['source'], + ); + } + } + } + + /* Got any custom file to initialize? */ + if ( $custom['filename'] && $custom['source'] ) + { + # Our dirty trick to avoid saving the file on disk just yet... + $_custom = preg_replace( '#^(\s*)<\?(php)+#i', '', $custom['source'] ); + eval($_custom); + + $classname = str_replace( '.php', '', $custom['filename'] ); + + if( class_exists( $classname ) ) + { + $customClass = new $classname( $this->registry ); + + if( method_exists( $customClass, 'pre_install' ) ) + { + $customClass->pre_install(); + } + } + } + + //----------------------------------------- + // Set the settings + //----------------------------------------- + + $settings = array(); + $settingGroups = array(); + + foreach( $xml->fetchElements('hookextras_settings') as $node ) + { + foreach( $xml->fetchElements('setting', $node) as $_setting ) + { + $setting = $xml->fetchElementsFromRecord( $_setting ); + + if( $setting['conf_is_title'] == 1) + { + $settingGroups[] = array( + 'conf_title_title' => $setting['conf_title_title'], + 'conf_title_desc' => $setting['conf_title_desc'], + 'conf_title_noshow' => $setting['conf_title_noshow'], + 'conf_title_keyword' => $setting['conf_title_keyword'], + 'conf_title_app' => $setting['conf_title_app'], + 'conf_title_tab' => $setting['conf_title_tab'], + ); + } + else + { + $settings[] = array( + 'conf_title' => $setting['conf_title'], + 'conf_description' => $setting['conf_description'], + 'conf_group' => $setting['conf_group'], + 'conf_type' => $setting['conf_type'], + 'conf_key' => $setting['conf_key'], + 'conf_default' => $setting['conf_default'], + 'conf_extra' => $setting['conf_extra'], + 'conf_evalphp' => $setting['conf_evalphp'], + 'conf_protected' => $setting['conf_protected'], + 'conf_position' => $setting['conf_position'], + 'conf_start_group' => $setting['conf_start_group'], + 'conf_add_cache' => $setting['conf_add_cache'], + 'conf_title_keyword' => $setting['conf_title_keyword'], + ); + } + } + } + + //----------------------------------------- + // Set the lang bits + //----------------------------------------- + + $language = array(); + + foreach( $xml->fetchElements('hookextras_language') as $node ) + { + foreach( $xml->fetchElements('language', $node) as $_langbit ) + { + $langbit = $xml->fetchElementsFromRecord( $_langbit ); + + $language[] = array( + 'word_app' => $langbit['word_app'], + 'word_pack' => $langbit['word_pack'], + 'word_key' => $langbit['word_key'], + 'word_default' => $langbit['word_default'], + 'word_custom' => $langbit['word_custom'], + 'word_js' => intval($langbit['word_js']), + ); + } + } + + //----------------------------------------- + // Set the modules + //----------------------------------------- + + $modules = array(); + + foreach( $xml->fetchElements('hookextras_modules') as $node ) + { + foreach( $xml->fetchElements('module', $node) as $_module ) + { + $module = $xml->fetchElementsFromRecord( $_module ); + $modules[] = array( + 'sys_module_title' => $module['sys_module_title'], + 'sys_module_application' => $module['sys_module_application'], + 'sys_module_key' => $module['sys_module_key'], + 'sys_module_description' => $module['sys_module_description'], + 'sys_module_version' => $module['sys_module_version'], + 'sys_module_protected' => $module['sys_module_protected'], + 'sys_module_visible' => $module['sys_module_visible'], + 'sys_module_position' => $module['sys_module_position'], + 'sys_module_admin' => $module['sys_module_admin'], + ); + } + } + + //----------------------------------------- + // Set the help files + //----------------------------------------- + + $help = array(); + + foreach( $xml->fetchElements('hookextras_help') as $node ) + { + foreach( $xml->fetchElements('help', $node) as $_helpfile ) + { + $helpfile = $xml->fetchElementsFromRecord( $_helpfile ); + $help[] = array( + 'title' => $helpfile['title'], + 'text' => $helpfile['text'], + 'description' => $helpfile['description'], + 'position' => $helpfile['position'], + ); + } + } + + //----------------------------------------- + // Set the templates + //----------------------------------------- + + $templates = array(); + + foreach( $xml->fetchElements('hookextras_templates') as $node ) + { + foreach( $xml->fetchElements('templates', $node) as $_template ) + { + $template = $xml->fetchElementsFromRecord( $_template ); + $templates[] = array( + 'template_set_id' => 0, + 'template_group' => $template['template_group'], + 'template_content' => $template['template_content'], + 'template_name' => $template['template_name'], + 'template_data' => $template['template_data'], + 'template_updated' => $template['template_updated'], + 'template_removable' => $template['template_removable'], + 'template_added_to' => intval($template['template_added_to']), + 'template_user_added' => 1, + 'template_user_edited' => 0, + 'template_master_key' => $template['template_master_key'] ? $template['template_master_key'] : 'root', + ); + } + } + + //----------------------------------------- + // Set the CSS + //----------------------------------------- + + $css = array(); + + foreach( $xml->fetchElements('hookextras_css') as $node ) + { + foreach( $xml->fetchElements('css', $node) as $_css ) + { + $_css = $xml->fetchElementsFromRecord( $_css ); + $css[] = array( + 'css_set_id' => 0, + 'css_group' => $_css['css_group'], + 'css_content' => $_css['css_content'], + 'css_position' => $_css['css_position'], + 'css_added_to' => 1, + 'css_app' => $_css['css_app'], + 'css_app_hide' => $_css['css_app_hide'], + 'css_attributes' => $_css['css_attributes'], + 'css_removed' => $_css['css_removed'], + 'css_modules' => $_css['css_modules'], + 'css_master_key' => $_css['css_master_key'], + ); + } + } + + //----------------------------------------- + // Set the Replacements + //----------------------------------------- + + $replacements = array(); + + foreach( $xml->fetchElements('hookextras_replacements') as $node ) + { + foreach( $xml->fetchElements('replacements', $node) as $_r ) + { + $_r = $xml->fetchElementsFromRecord( $_r ); + $replacements[] = array( + 'replacement_key' => $_r['replacement_key'], + 'replacement_content' => $_r['replacement_content'], + ); + } + } + + //----------------------------------------- + // Set the tasks + //----------------------------------------- + + $tasks = array(); + + foreach( $xml->fetchElements('hookextras_tasks') as $node ) + { + foreach( $xml->fetchElements('tasks', $node) as $_task ) + { + $task = $xml->fetchElementsFromRecord( $_task ); + $tasks[] = array( + 'task_title' => $task['task_title'], + 'task_file' => $task['task_file'], + 'task_week_day' => $task['task_week_day'], + 'task_month_day' => $task['task_month_day'], + 'task_hour' => $task['task_hour'], + 'task_minute' => $task['task_minute'], + 'task_cronkey' => $task['task_cronkey'], + 'task_log' => $task['task_log'], + 'task_description' => $task['task_description'], + 'task_enabled' => $task['task_enabled'], + 'task_key' => $task['task_key'], + 'task_safemode' => $task['task_safemode'], + 'task_locked' => $task['task_locked'], + 'task_application' => $task['task_application'], + ); + } + } + + //----------------------------------------- + // Set the database changes + //----------------------------------------- + + $database = array( + 'create' => array(), + 'alter' => array(), + 'update' => array(), + 'insert' => array(), + ); + + foreach( $xml->fetchElements('hookextras_database_create') as $node ) + { + foreach( $xml->fetchElements('create', $node) as $_table ) + { + $table = $xml->fetchElementsFromRecord( $_table ); + $database['create'][] = array( + 'name' => $table['name'], + 'fields' => $table['fields'], + 'tabletype' => $table['tabletype'], + ); + } + } + + foreach( $xml->fetchElements('hookextras_database_alter') as $node ) + { + foreach( $xml->fetchElements('alter', $node) as $_table ) + { + $table = $xml->fetchElementsFromRecord( $_table ); + $database['alter'][] = array( + 'altertype' => $table['altertype'], + 'table' => $table['table'], + 'field' => $table['field'], + 'newfield' => $table['newfield'], + 'fieldtype' => $table['fieldtype'], + 'default' => $table['default'], + ); + } + } + + foreach( $xml->fetchElements('hookextras_database_update') as $node ) + { + foreach( $xml->fetchElements('update', $node) as $_table ) + { + $table = $xml->fetchElementsFromRecord( $_table ); + $database['update'][] = array( + 'table' => $table['table'], + 'field' => $table['field'], + 'newvalue' => $table['newvalue'], + 'oldvalue' => $table['oldvalue'], + 'where' => $table['where'], + ); + } + } + + foreach( $xml->fetchElements('hookextras_database_insert') as $node ) + { + foreach( $xml->fetchElements('insert', $node) as $_table ) + { + $table = $xml->fetchElementsFromRecord( $_table ); + $database['insert'][] = array( + 'table' => $table['table'], + 'updates' => $table['updates'], + 'fordelete' => $table['fordelete'], + ); + } + } + + //----------------------------------------- + // Set some vars for display tallies + //----------------------------------------- + + $filesInserted = 0; + $settingGroupsInserted = 0; + $settingsInserted = 0; + $settingsUpdated = 0; + $languageInserted = 0; + $languageUpdated = 0; + $modulesInserted = 0; + $modulesUpdated = 0; + $helpInserted = 0; + $helpUpdated = 0; + $templatesInserted = 0; + $templatesUpdated = 0; + $templateHooks = false; + $tasksInserted = 0; + $tasksUpdated = 0; + $createQueries = 0; + $alterQueries = 0; + $updateQueries = 0; + $insertQueries = 0; + $cssInserted = 0; + $cssUpdated = 0; + $replacementsInserted = 0; + $replacementsUpdated = 0; + + //----------------------------------------- + // Insert/update DB records + //----------------------------------------- + + if( $this->hooks[ $config['hook_key'] ]['hook_id'] ) + { + //----------------------------------------- + // Don't change enabled/disabled status + //----------------------------------------- + + unset( $config['hook_enabled'] ); + + $this->DB->update( 'core_hooks', $config, 'hook_id=' . $this->hooks[ $config['hook_key'] ]['hook_id'] ); + + $hook_id = $this->hooks[ $config['hook_key'] ]['hook_id']; + + $extra_data = unserialize( $this->hooks[ $config['hook_key'] ]['hook_extra_data'] ); + + /* Reset DB */ + $extra_data['database'] = array(); + } + else + { + $config['hook_installed'] = IPS_UNIX_TIME_NOW; + $this->hook[ $config['hook_key'] ] = $config; + + $this->DB->insert( 'core_hooks', $config ); + + $hook_id = $this->DB->getInsertId(); + + $this->hook[ $config['hook_key'] ]['hook_id'] = $hook_id; + + $extra_data['display'] = $tempExtraData['display']; + } + + if( count($files) ) + { + //----------------------------------------- + // If we are updating, remove old files + //----------------------------------------- + + if( $this->hooks[ $config['hook_key'] ]['hook_id'] ) + { + $this->DB->build( array( 'select' => 'hook_file_id, hook_file_stored', 'from' => 'core_hooks_files', 'where' => 'hook_hook_id=' . $this->hooks[ $config['hook_key'] ]['hook_id'] ) ); + $outer = $this->DB->execute(); + + while( $r = $this->DB->fetch($outer) ) + { + @unlink( IPS_HOOKS_PATH . $r['hook_file_stored'] ); + $this->DB->delete( 'core_hooks_files', 'hook_file_id=' . $r['hook_file_id'] ); + } + } + + foreach( $files as $file ) + { + //----------------------------------------- + // Store new files + //----------------------------------------- + + $filename = $file['hook_classname'] . '_' . md5( uniqid( microtime(), true ) ) . '.php'; + + file_put_contents( IPS_HOOKS_PATH . $filename, $file['hooks_source'] ); + chmod( IPS_HOOKS_PATH . $filename, IPS_FILE_PERMISSION ); + + $file['hook_file_stored'] = $filename; + $file['hook_hook_id'] = $hook_id; + + $this->DB->insert( 'core_hooks_files', $file ); + $filesInserted++; + + /* Need to recache skins? */ + if ( $file['hook_type'] == 'templateHooks' ) + { + $templateHooks = true; + } + } + } + + //----------------------------------------- + // Put custom install/uninstall file + //----------------------------------------- + + if( is_object($customClass) ) + { + $extra_data['display']['custom'] = $custom['filename']; + + file_put_contents( IPS_HOOKS_PATH . 'install_' . $custom['filename'], $custom['source'] ); + chmod( IPS_HOOKS_PATH . 'install_' . $custom['filename'], IPS_FILE_PERMISSION ); + } + + //----------------------------------------- + // (1) Settings + //----------------------------------------- + + if( count($settingGroups) OR count($settings) ) + { + $setting_groups = array(); + + $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_settings_titles' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $setting_groups[ $r['conf_title_id'] ] = $r; + $setting_groups_by_key[ $r['conf_title_keyword'] ] = $r; + } + + //----------------------------------------- + // Get current settings. + //----------------------------------------- + + $this->DB->build( array( 'select' => 'conf_id, conf_key', 'from' => 'core_sys_conf_settings' ) ); + $this->DB->execute(); + + while ( $r = $this->DB->fetch() ) + { + $cur_settings[ $r['conf_key'] ] = $r['conf_id']; + } + } + + if( count($settingGroups) ) + { + $need_to_update = array(); + + foreach( $settingGroups as $data ) + { + if ( $data['conf_title_title'] AND $data['conf_title_keyword'] ) + { + //----------------------------------------- + // Get ID based on key + //----------------------------------------- + + $conf_id = $setting_groups_by_key[ $data['conf_title_keyword'] ]['conf_title_id']; + + $save = array( 'conf_title_title' => $data['conf_title_title'], + 'conf_title_desc' => $data['conf_title_desc'], + 'conf_title_keyword' => $data['conf_title_keyword'], + 'conf_title_app' => $data['conf_title_app'], + 'conf_title_tab' => $data['conf_title_tab'], + 'conf_title_noshow' => $data['conf_title_noshow'] ); + + //----------------------------------------- + // Not got a row, insert first! + //----------------------------------------- + + if ( ! $conf_id ) + { + $this->DB->insert( 'core_sys_settings_titles', $save ); + $conf_id = $this->DB->getInsertId(); + $settingGroupsInserted++; + $extra_data['settingGroups'][] = $save['conf_title_keyword']; + } + else + { + //----------------------------------------- + // Update... + //----------------------------------------- + + $this->DB->update( 'core_sys_settings_titles', $save, 'conf_title_id='.$conf_id ); + } + + //----------------------------------------- + // Update settings cache + //----------------------------------------- + + $save['conf_title_id'] = $conf_id; + $setting_groups_by_key[ $save['conf_title_keyword'] ] = $save; + $setting_groups[ $save['conf_title_id'] ] = $save; + + //----------------------------------------- + // Set need update... + //----------------------------------------- + + $need_update[] = $conf_id; + } + } + } + + if( count($settings) ) + { + foreach( $settings as $idx => $data ) + { + $data['conf_group'] = $setting_groups_by_key[ $data['conf_title_keyword'] ]['conf_title_id']; + + //----------------------------------------- + // Remove from array + //----------------------------------------- + + unset( $data['conf_title_keyword'] ); + + if ( $cur_settings[ $data['conf_key'] ] ) + { + $this->DB->update( 'core_sys_conf_settings', $data, 'conf_id='.$cur_settings[ $data['conf_key'] ] ); + $settingsUpdated++; + } + else + { + $this->DB->insert( 'core_sys_conf_settings', $data ); + $settingsInserted++; + $extra_data['settings'][] = $data['conf_key']; + } + } + } + + //----------------------------------------- + // Update group counts... + //----------------------------------------- + + if ( count( $need_update ) ) + { + foreach( $need_update as $i => $idx ) + { + $conf = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'core_sys_conf_settings', 'where' => 'conf_group=' . $idx ) ); + + $count = intval($conf['count']); + + $this->DB->update( 'core_sys_settings_titles', array( 'conf_title_count' => $count ), 'conf_title_id='.$idx ); + } + } + + if( count($settingGroups) OR count($settings) ) + { + $this->cache->rebuildCache( 'settings', 'global' ); + } + + //----------------------------------------- + // (2) Languages + //----------------------------------------- + + if( count($language) ) + { + $langPacks = array(); + + $this->DB->build( array( 'select' => 'lang_id', 'from' => 'core_sys_lang' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $langPacks[] = $r['lang_id']; + } + + foreach( $language as $langbit ) + { + foreach( $langPacks as $lang_id ) + { + + $langbit['lang_id'] = $lang_id; + + // See if it exists + $cnt = $this->DB->buildAndFetch( array( 'select' => 'word_id', 'from' => 'core_sys_lang_words', 'where' => "lang_id={$lang_id} AND word_app='{$langbit['word_app']}' AND word_key='{$langbit['word_key']}' AND word_pack='{$langbit['word_pack']}'" ) ); + + if( $cnt['word_id'] ) + { + $this->DB->update( 'core_sys_lang_words', $langbit, 'word_id=' . $cnt['word_id'] ); + $languageUpdated++; + } + else + { + $this->DB->insert( 'core_sys_lang_words', $langbit ); + $languageInserted++; + $word_id = $this->DB->getInsertId(); + } + + $extra_data['language'][ $langbit['word_app'] . "_" . $langbit['word_pack'] ][] = $langbit['word_key']; + } + + } + + $classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir('core') . '/modules_admin/languages/manage_languages.php', 'admin_core_languages_manage_languages' ); + $langLib = new $classToLoad(); + $langLib->makeRegistryShortcuts( $this->registry ); + + foreach( $langPacks as $langId ) + { + $langLib->cacheToDisk( $langId ); + } + + } + + //----------------------------------------- + // (3) Modules + //----------------------------------------- + + if( count($modules) ) + { + //----------------------------------------- + // Get current modules + //----------------------------------------- + $cur_modules = array(); + $this->DB->build( array( 'select' => '*', + 'from' => 'core_sys_module', + 'order' => 'sys_module_id' ) ); + + $this->DB->execute(); + + while ( $r = $this->DB->fetch() ) + { + $cur_modules[ $r['sys_module_application'] ][ $r['sys_module_key'] ] = $r['sys_module_id']; + } + + foreach( $modules as $module ) + { + //----------------------------------------- + // Insert or update? + //----------------------------------------- + + if ( $cur_modules[ $module['sys_module_application'] ][ $module['sys_module_key'] ] ) + { + $this->DB->update( 'core_sys_module', $module, "sys_module_id=" . $cur_modules[ $module['sys_module_application'] ][ $module['sys_module_key'] ] ); + $modulesUpdated++; + } + else + { + $this->DB->insert( 'core_sys_module', $module ); + $modulesInserted++; + + $extra_data['modules'][] = ( $module['sys_module_admin'] ? 'admin' : 'public' ) . '-' . $module['sys_module_application'] . '-' . $module['sys_module_key']; + } + } + + $classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir('core') . '/modules_admin/applications/applications.php', 'admin_core_applications_applications' ); + $moduleLib = new $classToLoad(); + $moduleLib->makeRegistryShortcuts( $this->registry ); + $moduleLib->moduleRecache(); + $moduleLib->applicationsMenuDataRecache(); + } + + //----------------------------------------- + // (4) Help Files + //----------------------------------------- + + if( count($help) ) + { + $keys = array(); + + $this->DB->build( array( 'select' => 'title', 'from' => 'faq' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $keys[] = $r['title']; + } + + foreach( $help as $entry ) + { + if( in_array( $entry['title'], $keys ) ) + { + $this->DB->update( 'faq', $entry, "title='{$entry['title']}'" ); + $helpUpdated++; + } + else + { + $this->DB->insert( 'faq', $entry ); + $helpInserted++; + $help_id = $this->DB->getInsertId(); + $extra_data['help'][] = $entry['title']; + } + } + } + + //----------------------------------------- + // (6) Templates + //----------------------------------------- + + if( count($templates) ) + { + $bits = array(); + + /* Root will always be updated */ + $this->DB->build( array( 'select' => 'template_name,template_group,template_master_key', 'from' => 'skin_templates' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $bits[ $r['template_master_key'] ][ $r['template_group'] ][] = $r['template_name']; + } + + foreach( $templates as $template ) + { + //----------------------------------------- + // If template is not in root set, add it to + // prevent fatal error selecting other skins + //----------------------------------------- + + if ( $template['template_master_key'] != 'root' && ( !isset($bits['root'][ $template['template_group'] ]) OR !in_array( $template['template_name'], $bits['root'][ $template['template_group'] ] ) ) ) + { + $this->DB->insert( 'skin_templates', array_merge( $template, array( 'template_set_id' => 0, 'template_master_key' => 'root', 'template_content' => '' ) ) ); + + $extra_data['templates'][ $template['template_group'] ][ $template['template_name'] ] = $template['template_name']; + $bits['root'][ $template['template_group'] ][] = $template['template_name']; + } + + //----------------------------------------- + // Ignore unknown skin sets + //----------------------------------------- + + if ( !isset($bits[ $template['template_master_key'] ]) ) + { + continue; + } + + if( isset($bits[ $template['template_master_key'] ][ $template['template_group'] ]) AND in_array( $template['template_name'], $bits[ $template['template_master_key'] ][ $template['template_group'] ] ) ) + { + $template['template_updated'] = IPS_UNIX_TIME_NOW; + + $this->DB->update( 'skin_templates', $template, "template_master_key='{$template['template_master_key']}' AND template_group='{$template['template_group']}' AND template_name='{$template['template_name']}'" ); + $templatesUpdated++; + } + else + { + $this->DB->insert( 'skin_templates', $template ); + $templatesInserted++; + + $extra_data['templates'][ $template['template_group'] ][ $template['template_name'] ] = $template['template_name']; + $bits[ $template['template_master_key'] ][ $template['template_group'] ][] = $template['template_name']; + } + } + } + + //----------------------------------------- + // CSS + //----------------------------------------- + + if( count( $css ) ) + { + $bits = array(); + + $this->DB->build( array( 'select' => 'css_master_key, css_group', 'from' => 'skin_css' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $bits[ $r['css_master_key'] ][ $r['css_group'] ] = $r['css_group']; + } + + foreach( $css as $entry ) + { + //----------------------------------------- + // Ignore unknown skin sets + //----------------------------------------- + + if ( !isset( $bits[ $entry['css_master_key'] ] ) ) + { + continue; + } + + if( in_array( $entry['css_group'], $bits[ $entry['css_master_key'] ] ) ) + { + $entry['css_updated'] = IPS_UNIX_TIME_NOW; + + $this->DB->update( 'skin_css', $entry, "css_master_key='{$entry['css_master_key']}' AND css_group='{$entry['css_group']}'" ); + $cssUpdated++; + } + else + { + $this->DB->insert( 'skin_css', $entry ); + $cssInserted++; + + $extra_data['css'][ $entry['css_group'] ] = $entry['css_group']; + $bits[ $entry['css_master_key'] ][ $entry['css_group'] ] = $entry['css_group']; + } + } + } + + //----------------------------------------- + // Skin Replacements + //----------------------------------------- + + if( count( $replacements ) ) + { + $bits = array(); + + $this->DB->build( array( 'select' => 'replacement_master_key, replacement_key', 'from' => 'skin_replacements' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $bits[ $r['replacement_master_key'] ][ $r['replacement_key'] ] = $r['replacement_key']; + } + + foreach( $replacements as $entry ) + { + if ( !isset( $bits[ $entry['replacement_master_key'] ] ) ) + { + $entry['replacement_master_key'] = 'root'; + } + + if( in_array( $entry['replacement_key'], $bits[ $entry['replacement_master_key'] ] ) ) + { + $this->DB->update( 'skin_replacements', $entry, "replacement_master_key='{$entry['replacement_master_key']}' AND replacement_key='{$entry['replacement_key']}'" ); + $replacementsUpdated++; + } + else + { + $this->DB->insert( 'skin_replacements', $entry ); + $replacementsInserted++; + + $extra_data['replacements'][ $entry['replacement_key'] ] = $entry['replacement_key']; + } + } + } + + //----------------------------------------- + // (7) Tasks + //----------------------------------------- + + if( count($tasks) ) + { + $keys = array(); + + $this->DB->build( array( 'select' => 'task_key', 'from' => 'task_manager' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $keys[] = $r['task_key']; + } + + foreach( $tasks as $entry ) + { + if( in_array( $entry['task_key'], $keys ) ) + { + $this->DB->update( 'task_manager', $entry, "task_key='{$entry['task_key']}'" ); + $tasksUpdated++; + } + else + { + $this->DB->insert( 'task_manager', $entry ); + $tasksInserted++; + $task_id = $this->DB->getInsertId(); + $extra_data['tasks'][] = $entry['task_key']; + } + } + } + + //----------------------------------------- + // (8) Create new tables + //----------------------------------------- + + if( count($database['create']) ) + { + foreach($database['create'] as $create ) + { + $query = "CREATE TABLE {$this->settings['sql_tbl_prefix']}{$create['name']} ( + {$create['fields']} + )"; + + if( $create['tabletype'] ) + { + $query .= " ENGINE=" . $create['tabletype']; + } + else if( $this->settings['sql_driver'] == 'mysql' AND $this->settings['mysql_tbl_type'] ) + { + $query .= " ENGINE=" . $this->settings['mysql_tbl_type']; + } + + //----------------------------------------- + // Fix prefix + //----------------------------------------- + + $this->DB->return_die = true; + $this->DB->query( $query ); + $this->DB->return_die = false; + $createQueries++; + + $extra_data['database']['create'][] = $create; + } + } + + //----------------------------------------- + // (9) Alter tables + //----------------------------------------- + + if( count($database['alter']) ) + { + foreach( $database['alter'] as $alter ) + { + $this->DB->return_die = true; + + $alter['default'] = ( !isset($alter['default']) || $alter['default'] === "" ) ? NULL : $alter['default']; + + switch( $alter['altertype'] ) + { + case 'remove': + $this->DB->dropField( $alter['table'], $alter['field'] ); + break; + + case 'add': + $this->DB->addField( $alter['table'], $alter['field'], $alter['fieldtype'], $alter['default'] ); + break; + + case 'change': + $this->DB->changeField( $alter['table'], $alter['field'], $alter['newfield'], $alter['fieldtype'], $alter['default'] ); + break; + } + + $this->DB->return_die = false; + $alterQueries++; + $extra_data['database']['alter'][] = $alter; + } + } + + //----------------------------------------- + // (10) Run update queries + //----------------------------------------- + + if( count($database['update']) ) + { + foreach( $database['update'] as $update ) + { + $this->DB->return_die = true; + $this->DB->update( $update['table'], array( $update['field'] => $update['newvalue'] ), html_entity_decode( $update['where'], ENT_QUOTES ) ); + $this->DB->return_die = false; + $updateQueries++; + $extra_data['database']['update'][] = $update; + } + } + + //----------------------------------------- + // (11) Run insert queries + //----------------------------------------- + + // if( !$this->hooks[ $config['hook_key'] ]['hook_id'] ) + // { + if( count($database['insert']) ) + { + foreach( $database['insert'] as $insert ) + { + $fields = array(); + $content = explode( ',', $insert['updates'] ); + + foreach( $content as $value ) + { + list( $field, $toInsert ) = explode( '=', $value ); + + $fields[ trim($field) ] = str_replace( '~C~', ',', $toInsert ); + } + + $this->DB->return_die = true; + $this->DB->insert( $insert['table'], $fields ); + $this->DB->return_die = false; + $insertQueries++; + $extra_data['database']['insert'][] = $insert; + } + } + // } + + /* Got an install function to run too? */ + if( is_object($customClass) ) + { + if( method_exists( $customClass, 'install' ) ) + { + $customClass->install(); + } + } + + if( count($extra_data) ) + { + $this->DB->update( 'core_hooks', array( 'hook_extra_data' => serialize( $extra_data ) ), 'hook_id=' . $hook_id ); + } + + //print_r($config); + //print_r($files); + //print_r($custom); + //print_r($settingGroups); + //print_r($settings); + //print_r($language); + //print_r($modules); + //print_r($templates); + //print_r($tasks); + //print_r($help); + //print_r($database); + + if ( $addMessage ) + { + $_tempMsg = <<{$this->lang->words['h_newhookin']} +
    +
  • {$filesInserted} {$this->lang->words['h_filesin']}
  • +
  • {$settingGroupsInserted} {$this->lang->words['h_settinggin']}
  • +
  • {$settingsInserted} {$this->lang->words['h_settingin']}
  • +
  • {$settingsUpdated} {$this->lang->words['h_settingup']}
  • +
  • {$languageInserted} {$this->lang->words['h_langbitin']}
  • +
  • {$languageUpdated} {$this->lang->words['h_langbitup']}
  • +
  • {$modulesInserted} {$this->lang->words['h_modin']}
  • +
  • {$modulesUpdated} {$this->lang->words['h_modup']}
  • +
  • {$helpInserted} {$this->lang->words['h_helpin']}
  • +
  • {$helpUpdated} {$this->lang->words['h_helpup']}
  • +
  • {$templatesInserted} {$this->lang->words['h_tempin']}
  • +
  • {$templatesUpdated} {$this->lang->words['h_tempup']}
  • +
  • {$cssInserted} {$this->lang->words['h_cssin']}
  • +
  • {$cssUpdated} {$this->lang->words['h_cssup']}
  • +
  • {$replacementsInserted} {$this->lang->words['h_replacementsin']}
  • +
  • {$replacementsUpdated} {$this->lang->words['h_replacementsup']}
  • +
  • {$tasksInserted} {$this->lang->words['h_taskin']}
  • +
  • {$tasksUpdated} {$this->lang->words['h_taskup']}
  • +
  • {$createQueries} {$this->lang->words['h_dbcreated']}
  • +
  • {$alterQueries} {$this->lang->words['h_dbaltered']}
  • +
  • {$updateQueries} {$this->lang->words['h_updateran']}
  • +
  • {$insertQueries} {$this->lang->words['h_insertran']}
  • +
+EOF; + + $this->registry->output->setMessage( $_tempMsg, 1 ); + } + + //----------------------------------------- + // Got some skin recaching to do... + //----------------------------------------- + + if( $allowSkinRecache === TRUE AND ( $templatesInserted OR $templatesUpdated OR $templateHooks OR $cssUpdated OR $cssInserted ) ) + { + /* Rebuild cache */ + $this->rebuildHooksCache(); + + /* Flag skins for recache */ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + $skinCaching = new skinCaching( $this->registry ); + $skinCaching->flagSetForRecache(); + } + } + + /** + * Show the form to export a hook + * + * @return void + */ + protected function _exportHook() + { + /* Get the hook */ + $id = intval($this->request['id']); + + if( !$id ) + { + $this->registry->output->showError( $this->lang->words['h_noexport'], 1112 ); + } + + $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $id ) ); + + if( !$hookData['hook_id'] ) + { + $this->registry->output->showError( $this->lang->words['h_noexport'], 1113 ); + } + + /* Set defaults */ + $hookData['hook_extra_data'] = unserialize( $hookData['hook_extra_data'] ); + + /* Output */ + $this->registry->output->extra_nav[] = array( $this->settings['base_url'] . $this->form_code . 'do=hooks_overview', $this->lang->words['menu__manage_hooks'] ); + $this->registry->output->html .= $this->html->hooksExport( $hookData ); + } + + /** + * Actually export the damn hook already + * Sorry, it has been a long day... + * + * @return @e void + */ + protected function _doExportHook() + { + //----------------------------------------- + // Get hook + //----------------------------------------- + + $id = intval($this->request['id']); + + if( !$id ) + { + $this->registry->output->showError( $this->lang->words['h_noexport'], 1114 ); + } + + $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $id ) ); + + if( !$hookData['hook_id'] ) + { + $this->registry->output->showError( $this->lang->words['h_noexport'], 1115 ); + } + + $extra_data = unserialize( $hookData['hook_extra_data'] ); + + //----------------------------------------- + // Get hook files + //----------------------------------------- + + $files = array(); + $index = 1; + + $this->DB->build( array( 'select' => '*', 'from' => 'core_hooks_files', 'where' => 'hook_hook_id=' . $id, 'order' => 'hook_file_id ASC' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $files[ $index ] = $r; + $index++; + } + + //----------------------------------------- + // Get XML class + //----------------------------------------- + + require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ + + $xml = new classXML( IPS_DOC_CHAR_SET ); + + $xml->newXMLDocument(); + $xml->addElement( 'hookexport' ); + + //----------------------------------------- + // Put hook data in export + //----------------------------------------- + + $xml->addElement( 'hookdata', 'hookexport' ); + $content = array(); + + foreach( $hookData as $k => $v ) + { + if( in_array( $k, array( 'hook_id', 'hook_enabled', 'hook_installed', 'hook_updated', 'hook_position' ) ) ) + { + continue; + } + + $content[ $k ] = $v; + } + + $xml->addElementAsRecord( 'hookdata', 'config', $content ); + + //----------------------------------------- + // Put hook files in export + //----------------------------------------- + + $xml->addElement( 'hookfiles', 'hookexport' ); + + foreach( $files as $index => $r ) + { + $content = array(); + + foreach( $r as $k => $v ) + { + if( in_array( $k, array( 'hook_file_id', 'hook_hook_id', 'hook_file_stored', 'hooks_source' ) ) ) + { + continue; + } + + $content[ $k ] = $v; + } + + $source = is_file( IPS_HOOKS_PATH . $r['hook_file_stored'] ) ? file_get_contents( IPS_HOOKS_PATH . $r['hook_file_stored'] ) : ''; + + if ( !empty($source) && in_array( $r['hook_type'], array( 'skinHooks', 'commandHooks', 'libraryHooks' ) ) ) + { + $source = $this->_cleanSource( $source ); + } + + $content['hooks_source'] = $source; + + $xml->addElementAsRecord( 'hookfiles', 'file', $content ); + } + + //----------------------------------------- + // Custom install/uninstall script? + //----------------------------------------- + + if( $extra_data['custom'] ) + { + $content = array(); + $xml->addElement( 'hookextras_custom', 'hookexport' ); + + $content['filename'] = $extra_data['custom']; + $content['source'] = is_file( IPS_HOOKS_PATH . 'install_' . $extra_data['custom'] ) ? file_get_contents( IPS_HOOKS_PATH . 'install_' . $extra_data['custom'] ) : ''; + + $xml->addElementAsRecord( 'hookextras_custom', 'file', $content ); + } + + //----------------------------------------- + // Settings or setting groups? + //----------------------------------------- + + $entry = array(); + $_groups = array(); + $_settings = array(); + $titles = array(); + $content = array(); + + $xml->addElement( 'hookextras_settings', 'hookexport' ); + + # Store group ids and setting ids for entire setting groups + if( is_array($extra_data['settingGroups']) AND count($extra_data['settingGroups']) ) + { + $_groups = $extra_data['settingGroups']; + $_groupIds = array(); + + $this->DB->build( array( 'select' => 'conf_title_id', 'from' => 'core_sys_settings_titles', 'where' => "conf_title_keyword IN('" . implode( "','", $_groups ) . "')" ) ); + $this->DB->execute(); + + while( $rr = $this->DB->fetch() ) + { + $_groupIds[] = $rr['conf_title_id']; + } + + if( count($_groupIds) ) + { + $this->DB->build( array( 'select' => 'conf_key', 'from' => 'core_sys_conf_settings', 'where' => 'conf_group IN(' . implode( ',', $_groupIds ) . ')' ) ); + $this->DB->execute(); + + while( $setting = $this->DB->fetch() ) + { + $_settings[] = $setting['conf_key']; + } + } + } + + # Store group ids and setting ids for indvidual settings + if( is_array($extra_data['settings']) AND count($extra_data['settings']) ) + { + foreach( $extra_data['settings'] as $_aSetting ) + { + $_settings[] = $_aSetting; + } + + $this->DB->build( array( 'select' => 't.conf_title_keyword', + 'from' => array( 'core_sys_settings_titles' => 't' ), + 'where' => "c.conf_key IN('" . implode( "','", $extra_data['settings'] ) . "')", + 'add_join' => array( + array( + 'from' => array( 'core_sys_conf_settings' => 'c' ), + 'where' => 'c.conf_group=t.conf_title_id', + 'type' => 'left', + ) + ) + ) ); + $this->DB->execute(); + + while( $group = $this->DB->fetch() ) + { + $_groups[] = $group['conf_title_keyword']; + } + } + + if( count($_groups) ) + { + # Now get the group data for the XML file + $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_settings_titles', 'where' => "conf_title_keyword IN('" . implode( "','", $_groups ) . "')" ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $content = array(); + + $titles[ $r['conf_title_id'] ] = $r['conf_title_keyword']; + + $content['conf_is_title'] = 1; + + foreach( $r as $k => $v ) + { + if( in_array( $k, array( 'conf_title_tab', 'conf_title_keyword', 'conf_title_title', 'conf_title_desc', 'conf_title_app', 'conf_title_noshow' ) ) ) + { + $content[ $k ] = $v; + } + } + + $xml->addElementAsRecord( 'hookextras_settings', 'setting', $content ); + } + } + + if( count($_settings) ) + { + # Now get the group data for the XML file + $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_conf_settings', 'where' => "conf_key IN('" . implode( "','", $_settings ) . "')" ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $r['conf_value'] = ''; + $r['conf_title_keyword'] = $titles[ $r['conf_group'] ]; + $r['conf_is_title'] = 0; + + $xml->addElementAsRecord( 'hookextras_settings', 'setting', $r ); + } + } + + //----------------------------------------- + // Language strings/files + //----------------------------------------- + + $entry = array(); + + $xml->addElement( 'hookextras_language', 'hookexport' ); + + if( is_array($extra_data['language']) AND count($extra_data['language']) ) + { + foreach( $extra_data['language'] as $file => $strings ) + { + $bits = explode( '_', $file ); + $app = $bits[0]; + $pack = str_replace( $app.'_', '', $file ); + + $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_lang_words', 'where' => "word_app='{$app}' AND word_pack='{$pack}' AND word_key IN('" . implode( "','", $strings ) . "')" ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $content = array(); + + foreach( $r as $k => $v ) + { + if( !in_array( $k, array( 'word_app', 'word_pack', 'word_key', 'word_default' ) ) ) + { + continue; + } + + $content[ $k ] = $v; + } + + $xml->addElementAsRecord( 'hookextras_language', 'language', $content ); + } + } + } + + //----------------------------------------- + // Modules + //----------------------------------------- + + $xml->addElement( 'hookextras_modules', 'hookexport' ); + + if( is_array($extra_data['modules']) AND count($extra_data['modules']) ) + { + foreach ( $extra_data['modules'] as $module ) + { + list( $_side, $_app, $_module ) = explode( '-', $module ); + $_is_admin = ( $_side == 'admin' ) ? 1 : 0; + + $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_module', 'where' => "sys_module_application='{$_app}' AND sys_module_key='{$_module}' AND sys_module_admin={$_is_admin}" ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + unset($r['sys_module_id']); + + $xml->addElementAsRecord( 'hookextras_modules', 'module', $r ); + } + } + } + + //----------------------------------------- + // Help files + //----------------------------------------- + + $xml->addElement( 'hookextras_help', 'hookexport' ); + + if( is_array($extra_data['help']) AND count($extra_data['help']) ) + { + $this->DB->build( array( 'select' => '*', 'from' => 'faq', 'where' => "title IN('" . implode( "','", $extra_data['help'] ) . "')" ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + unset($r['id']); + + $xml->addElementAsRecord( 'hookextras_help', 'help', $r ); + } + } + + //----------------------------------------- + // Skin templates + //----------------------------------------- + + $remapData = $this->registry->output->buildRemapData( true ); + + $xml->addElement( 'hookextras_templates', 'hookexport' ); + + if( is_array($extra_data['templates']) AND count($extra_data['templates']) ) + { + foreach( $extra_data['templates'] as $file => $templates ) + { + $this->DB->build( array( 'select' => '*', 'from' => 'skin_templates', 'where' => "template_set_id IN ('" . implode( "','", $remapData['export'] ) . "') AND template_master_key != '' AND template_group='{$file}' AND template_name IN('" . implode( "','", $templates ) . "')" ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + unset($r['template_id']); + unset($r['template_set_id']); + + $xml->addElementAsRecord( 'hookextras_templates', 'templates', $r ); + } + } + } + + //----------------------------------------- + // CSS + //----------------------------------------- + + $xml->addElement( 'hookextras_css', 'hookexport' ); + + if( is_array( $extra_data['css'] ) AND count ( $extra_data['css'] ) ) + { + $this->DB->build( array( 'select' => '*', 'from' => 'skin_css', 'where' => "css_set_id IN ('" . implode( "','", $remapData['export'] ) . "') AND css_master_key != '' AND css_group IN('" . implode( "','", $extra_data['css'] ) . "')" ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + unset($r['css_id']); + unset($r['css_set_id']); + + $xml->addElementAsRecord( 'hookextras_css', 'css', $r ); + } + } + + //----------------------------------------- + // Replacements + //----------------------------------------- + + $xml->addElement( 'hookextras_replacements', 'hookexport' ); + + if( is_array( $extra_data['replacements'] ) AND count ( $extra_data['replacements'] ) ) + { + $this->DB->build( array( 'select' => '*', 'from' => 'skin_replacements', 'where' => "replacement_key IN('" . implode( "','", $extra_data['replacements'] ) . "')", 'group' => 'replacement_key' ) ); + + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + unset($r['replacement_id']); + unset($r['replacement_set_id']); + + $xml->addElementAsRecord( 'hookextras_replacements', 'replacements', $r ); + } + } + + //----------------------------------------- + // Tasks + //----------------------------------------- + + $xml->addElement( 'hookextras_tasks', 'hookexport' ); + + if( is_array($extra_data['tasks']) AND count($extra_data['tasks']) ) + { + $this->DB->build( array( 'select' => '*', 'from' => 'task_manager', 'where' => "task_key IN('" . implode( "','", $extra_data['tasks'] ) . "')" ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + unset($r['task_id']); + unset($r['task_next_run']); + + $xml->addElementAsRecord( 'hookextras_tasks', 'tasks', $r ); + } + } + + //----------------------------------------- + // Database changes + //----------------------------------------- + + $xml->addElement( 'hookextras_database_create', 'hookexport' ); + + if( is_array($extra_data['database']['create']) AND count($extra_data['database']['create']) ) + { + foreach( $extra_data['database']['create'] as $create_query ) + { + $xml->addElementAsRecord( 'hookextras_database_create', 'create', $create_query ); + } + } + + $xml->addElement( 'hookextras_database_alter', 'hookexport' ); + + if( is_array($extra_data['database']['alter']) AND count($extra_data['database']['alter']) ) + { + foreach( $extra_data['database']['alter'] as $alter_query ) + { + $xml->addElementAsRecord( 'hookextras_database_alter', 'alter', $alter_query ); + } + } + + $xml->addElement( 'hookextras_database_update', 'hookexport' ); + + if( is_array($extra_data['database']['update']) AND count($extra_data['database']['update']) ) + { + foreach( $extra_data['database']['update'] as $update_query ) + { + $xml->addElementAsRecord( 'hookextras_database_update', 'update', $update_query ); + } + } + + $xml->addElement( 'hookextras_database_insert', 'hookexport' ); + + if( is_array($extra_data['database']['insert']) AND count($extra_data['database']['insert']) ) + { + foreach( $extra_data['database']['insert'] as $insert_query ) + { + $xml->addElementAsRecord( 'hookextras_database_insert', 'insert', $insert_query ); + } + } + + //----------------------------------------- + // Print to browser + //----------------------------------------- + + $this->registry->output->showDownload( $xml->fetchDocument(), $hookData['hook_key'] . '.xml', '', 0 ); + } + + /** + * Clean source code for export.. + * + * @param string Hook source code + * @return string "Cleaned" source code + */ + protected function _cleanSource( $source ) + { + $source = preg_replace( "/class\s+(\S+)\s+extends\s+(\S+)/i", "class \\1 extends (~extends~)", $source ); + + return $source; + } + + /** + * Fix hook positions + * + * @return @e void + */ + protected function _fixPositions() + { + /* Init vars */ + $new_order = 0; + $usedActions = array(); + + $this->DB->build( array( 'select' => 'hook_id, hook_position', 'from' => 'core_hooks', 'where' => 'hook_enabled=1', 'order' => 'hook_position ASC' ) ); + $qid = $this->DB->execute(); + + while ( $hook = $this->DB->fetch( $qid ) ) + { + $new_order++; + $this->DB->update( 'core_hooks', array ( 'hook_position' => $new_order ), "hook_id={$hook['hook_id']}" ); + + $this->DB->build( array( 'select' => '*', 'from' => 'core_hooks_files', 'where' => "hook_type IN ('commandHooks', 'skinHooks', 'libraryHooks' ) AND hook_hook_id=" . $hook['hook_id'] ) ); + $this->DB->execute(); + + while( $file = $this->DB->fetch() ) + { + if( $file['hooks_source'] ) + { + $source = $this->_cleanSource( $file['hooks_source'] ); + } + else + { + $source = is_file( IPS_HOOKS_PATH . $file['hook_file_stored'] ) ? file_get_contents( IPS_HOOKS_PATH . $file['hook_file_stored'] ) : ''; + + if( $source ) + { + $source = $this->_cleanSource( $source ); + } + } + + if( $source ) + { + $hook_data = unserialize( $file['hook_data'] ); + $overload = $hook_data['classToOverload']; + $newClass = $overload; + + $app = ( $file['hook_type'] == 'libraryHooks' ) ? trim($hook_data['libApplication']) : '~_NO_APP_~'; + + if( isset( $usedActions[ $app ][ $overload ] ) ) + { + $newClass = $usedActions[ $app ][ $overload ]; + } + else if( $file['hook_type'] == 'skinHooks' ) + { + $newClass .= "(~id~)"; + } + + $source = str_replace( "(~extends~)", $newClass, $source ); + + file_put_contents( IPS_HOOKS_PATH . $file['hook_file_stored'], $source ); + + $usedActions[ $app ][ $hook_data['classToOverload'] ] = $file['hook_classname']; + } + } + } + } + + /** + * Check if there is an update for a hook + * + * @param string URL to check + * @param string Long version number + * @return bool + */ + public function _updateAvailable( $url, $version ) + { + if( empty($url) || $version === '' ) + { + return false; + } + + $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . '/classFileManagement.php', 'classFileManagement' ); + $checker = new $classToLoad(); + + /* Timeout to prevent page from taking too long */ + $checker->timeout = 5; + + /* Setup url and check */ + $url = str_replace( 'php&', 'php?', $url ); + $url .= '&boardVersion=' . IPB_LONG_VERSION . '&version=' . $version; + + $return = $checker->getFileContents( $url ); + + /* Return the content (if valid) or return 'no update' */ + $return = ( strpos( $return, '0' ) === 0 || strpos( $return, '1' ) === 0 ) ? explode( '|', $return ) : array( 0 ); + + /* Replace {IPSID} id necessary */ + if ( strpos( $return[1], '{IPSID}' ) ) + { + if ( ipsRegistry::$settings['ipb_reg_number'] ) + { + $exploded = explode( '-', ipsRegistry::$settings['ipb_reg_number'] ); + $return[1] = str_replace( '{IPSID}', $exploded[3], $return[1] ); + } + else + { + $return[1] = "https://www.invisionpower.com/clients"; + } + } + + return $return; + } + + /** + * Sorts hooks by their position + * (this is used to avoid a mysql filesort) + * + * @param array $a First hook data + * @param array $b Second hook data + * @return @e integer + */ + protected function sortHooksByPosition( $a, $b ) + { + if ( $a['hook_position'] == $b['hook_position'] ) + { + return 0; + } + + return ( $a['hook_position'] < $b['hook_position'] ) ? -1 : 1; + } + + /** + * Hooks overview + * + * @return @e void [Outputs to screen] + */ + public function _hooksOverview() + { + /* INI */ + $hooksFound = array( 'installed' => array(), 'uninstalled' => array() ); + $hookwarnings = 0; + $hookUpdates = 0; + $checkUpdates = !empty( $this->request['checkUpdates'] ) ? true : false; + $message = ''; + $confGroupIdsToLoad = array(); + $confGroupKeysToLoad= array(); + + /* Get current hooks */ + $this->DB->build( array( 'select' => '*', 'from' => 'core_hooks' ) ); + $outer = $this->DB->execute(); + + while( $r = $this->DB->fetch($outer) ) + { + /* Format some dates */ + $r['_updated'] = $this->registry->getClass('class_localization')->formatTime( $r['hook_updated'] ); + $r['_installed'] = $this->registry->getClass('class_localization')->formatTime( $r['hook_installed'] ); + + /* Got updates? */ + if ( $r['hook_update_check'] && $checkUpdates === true ) + { + $r['hook_update_available'] = $this->_updateAvailable( $r['hook_update_check'], $r['hook_version_long'] ); + + if ( $r['hook_update_available'][0] ) + { + $hookUpdates++; + } + } + else + { + $r['hook_update_available'] = array( 0 ); + } + + /* Got some setting groups to take care of? */ + $r['_has_setting_links'] = null; + $r['_hook_extra_data'] = IPSLib::isSerialized($r['hook_extra_data']) ? unserialize($r['hook_extra_data']) : array(); + + if ( is_array($r['_hook_extra_data']['settingGroups']) && count($r['_hook_extra_data']['settingGroups']) ) + { + $r['_has_setting_links'] = array(); + + foreach( $r['_hook_extra_data']['settingGroups'] as $_group ) + { + $confGroupKeysToLoad[ $_group ] = $_group; + } + } + + if ( is_array($r['_hook_extra_data']['settings']) && count($r['_hook_extra_data']['settings']) ) + { + $r['_has_setting_links'] = array(); + + $this->DB->build( array( 'select' => 'conf_group, conf_key', 'from' => 'core_sys_conf_settings', 'where' => "conf_key IN ('" . implode( "','", $r['_hook_extra_data']['settings'] ) . "')" ) ); + $this->DB->execute(); + + while( $hsg = $this->DB->fetch() ) + { + $confGroupIdsToLoad[ $hsg['conf_key'] ] = $hsg['conf_group']; + } + } + + /* Check requirements */ + $r['_require_errors'] = $this->checkHookRequirements( $r ); + + /* Store */ + if( $r['hook_enabled'] ) + { + if ( count($r['_require_errors']) ) + { + $hookwarnings++; + } + + $hooksFound['installed'][ $r['hook_id'] ] = $r; + } + else + { + $hooksFound['uninstalled'][ $r['hook_id'] ] = $r; + } + } + + /* Got groups to load? */ + $where = array(); + + if ( count($confGroupKeysToLoad) ) + { + $where[] = "conf_title_keyword IN ('" . implode( "','", $confGroupKeysToLoad ) . "')"; + } + + if ( count($confGroupIdsToLoad) ) + { + $where[] = "conf_title_id IN (" . implode( ",", $confGroupIdsToLoad ) . ")"; + } + + if ( count($where) ) + { + $confGroupsLoaded = array(); + + $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_settings_titles', 'where' => implode( ' OR ', $where ) ) ); + $this->DB->execute(); + + while( $gr = $this->DB->fetch() ) + { + if ( empty($gr['conf_title_noshow']) ) + { + $confGroupsLoaded['ids'][ $gr['conf_title_id'] ] = $gr; + $confGroupsLoaded['keys'][ $gr['conf_title_keyword'] ] = & $confGroupsLoaded['ids'][ $gr['conf_title_id'] ]; + } + } + + /* Merge back the data */ + foreach( $hooksFound as $rk => $rt ) + { + foreach( $rt as $sk => $st ) + { + if ( is_array($st['_has_setting_links']) ) + { + if ( is_array($st['_hook_extra_data']['settingGroups']) && count($st['_hook_extra_data']['settingGroups']) ) + { + foreach( $st['_hook_extra_data']['settingGroups'] as $_group ) + { + if ( isset($confGroupsLoaded['keys'][ $_group ]) ) + { + $hooksFound[ $rk ][ $sk ]['_has_setting_links'][ $confGroupsLoaded['keys'][ $_group ]['conf_title_id'] ] = $confGroupsLoaded['keys'][ $_group ]['conf_title_title']; + } + } + } + + if ( is_array($st['_hook_extra_data']['settings']) && count($st['_hook_extra_data']['settings']) ) + { + foreach( $st['_hook_extra_data']['settings'] as $_id ) + { + if ( isset($confGroupsLoaded['ids'][ $confGroupIdsToLoad[ $_id ] ]) ) + { + $hooksFound[ $rk ][ $sk ]['_has_setting_links'][ $confGroupIdsToLoad[ $_id ] ] = $confGroupsLoaded['ids'][ $confGroupIdsToLoad[ $_id ] ]['conf_title_title']; + } + } + } + } + } + } + } + + /* Got updates to show? */ + if ( $checkUpdates === true ) + { + $message = ( $hookUpdates == 1 ) ? $this->lang->words['updates_string_single'] : sprintf( $this->lang->words['updates_string_more'], $hookUpdates ); + } + + if ( count($hooksFound['installed']) ) + { + uasort( $hooksFound['installed'], array( $this, 'sortHooksByPosition' ) ); + } + + /* Output */ + $this->registry->output->html .= $this->html->hooksOverview( $hooksFound, $hookwarnings, $message ); + } + + /** + * Disables all hook + * + * @return @e void [Outputs to screen] + */ + protected function _disableAllHooks() + { + /* INIT */ + $activeHookIds = array(); + + /* Query Enabled Hooks */ + $this->DB->build( array( 'select' => 'hook_id', 'from' => 'core_hooks', 'where' => "hook_enabled=1" ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $activeHookIds[] = $r['hook_id']; + } + + /* Make sure there were active hooks */ + if( ! count( $activeHookIds ) ) + { + $this->registry->output->global_message = $this->lang->words['hook_disable_all_none']; + $this->_hooksOverview(); + return; + } + + /* Disable hooks */ + $this->DB->update( 'core_hooks', array( 'hook_enabled' => 0 ), 'hook_id IN( ' . implode( ',', $activeHookIds ) . ' ) ' ); + + /* Save to cache */ + $this->cache->setCache( 'disabledHooksCache', $activeHookIds, array( 'array' => 1 ) ); + + /* Rebuild cache */ + $this->rebuildHooksCache(); + + /* All Done */ + $this->registry->output->global_message = $this->lang->words['hook_disabled_all']; + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=hooks_overview' ); + } + + /** + * Re-enable all hook + * + * @return @e void [Outputs to screen] + */ + protected function _reenableAllHooks() + { + /* INIT */ + $activeHookIds = $this->cache->getCache( 'disabledHooksCache' ); + + /* Make sure there were active hooks */ + if( ! count( $activeHookIds ) ) + { + $this->registry->output->global_message = $this->lang->words['hook_enable_all_none']; + $this->_hooksOverview(); + return; + } + + /* Disable hooks */ + $this->DB->update( 'core_hooks', array( 'hook_enabled' => 1 ), 'hook_id IN( ' . implode( ',', $activeHookIds ) . ' ) ' ); + + /* Save to cache */ + $this->cache->setCache( 'disabledHooksCache', array(), array( 'array' => 1 ) ); + + /* Rebuild cache */ + $this->rebuildHooksCache(); + + /* Flag skins for recache */ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + $skinCaching = new skinCaching( $this->registry ); + + /* Flag all for recache */ + $skinCaching->flagSetForRecache(); + + /* All Done */ + $this->registry->output->global_message = $this->lang->words['hook_reenable_all']; + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=hooks_overview' ); + } + + /** + * Disables a hook + * + * @return @e void [Outputs to screen] + */ + protected function _disableHook() + { + /* INI */ + $hook_id = intval( $this->request['id'] ); + + if( !$hook_id ) + { + $this->registry->output->showError( $this->lang->words['h_noedit'], '1118.D' ); + } + + $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $hook_id ) ); + + if( !$hookData['hook_id'] ) + { + $this->registry->output->showError( $this->lang->words['h_noedit'], '1119.D' ); + } + + /* Do update */ + $this->DB->update( 'core_hooks', array( 'hook_enabled' => 0, 'hook_position' => 0 ), "hook_id={$hookData['hook_id']}" ); + + /* Rebuild cache */ + $this->rebuildHooksCache(); + + /* Rebuild global caches */ + try + { + IPSLib::cacheGlobalCaches(); + } + catch( Exception $e ){} + + /* Flag skins for recache */ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + $skinCaching = new skinCaching( $this->registry ); + $skinCaching->flagSetForRecache(); + + /* Redirect */ + $this->registry->output->setMessage( $this->lang->words['h_hasbeendisabled'] ); + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=hooks_overview' ); + } + + /** + * Enables a hook + * + * @return @e void [Outputs to screen] + */ + protected function _enableHook() + { + /* INI */ + $hook_id = intval($this->request['id']); + + if( !$hook_id ) + { + $this->registry->output->showError( $this->lang->words['h_noedit'], '1118.E' ); + } + + $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $hook_id ) ); + + if( !$hookData['hook_id'] ) + { + $this->registry->output->showError( $this->lang->words['h_noedit'], '1119.E' ); + } + + /* Check for requirements */ + if ( empty($this->request['skipRequirements']) ) + { + $errors = $this->checkHookRequirements( $hookData ); + + if ( count($errors) ) + { + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=check_requirements&fromInstall=1&id='.$hook_id ); + } + } + + /* Do update */ + $this->DB->update( 'core_hooks', array( 'hook_enabled' => 1 ), "hook_id={$hookData['hook_id']}" ); + + /* Rebuild cache */ + $this->rebuildHooksCache(); + + /* Rebuild global caches */ + try + { + IPSLib::cacheGlobalCaches(); + } + catch( Exception $e ){} + + /* Flag skins for recache */ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + $skinCaching = new skinCaching( $this->registry ); + $skinCaching->flagSetForRecache(); + + /* Redirect */ + $this->registry->output->global_message = $this->lang->words['h_hasbeenenabled']; + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=hooks_overview' ); + } + + /** + * Uninstall a hook + * + * @return @e void [Outputs to screen] + */ + protected function _uninstallHook() + { + /* Init vars */ + $hook_id = intval( $this->request['id'] ); + + $hook = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $hook_id ) ); + $extra_data = unserialize( $hook['hook_extra_data'] ); + + if ( ! $hook['hook_id'] ) + { + $this->registry->output->global_message = $this->lang->words['h_hasbeenun']; + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=hooks_overview' ); + } + + /* Got any custom file to initialize? */ + $_customFile = ''; + $customClass = null; + + if ( $extra_data['display']['custom'] ) + { + $_customFile = IPS_HOOKS_PATH . 'install_' . $extra_data['display']['custom']; + + if( is_file( $_customFile ) ) + { + require_once( $_customFile );/*noLibHook*/ + + $classname = str_replace( '.php', '', $extra_data['display']['custom'] ); + + if( class_exists( $classname ) ) + { + $customClass = new $classname( $this->registry ); + + if( method_exists( $customClass, 'pre_uninstall' ) ) + { + $customClass->pre_uninstall(); + } + } + } + } + + /* Get associated files */ + $this->DB->build( array( 'select' => 'hook_file_stored', 'from' => 'core_hooks_files', 'where' => 'hook_hook_id=' . $hook_id ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + @unlink( IPS_HOOKS_PATH . $r['hook_file_stored'] ); + } + + /* Delete hook file entries */ + $this->DB->delete( 'core_hooks_files', "hook_hook_id={$hook_id}" ); + + //----------------------------------------- + // Settings or setting groups? + //----------------------------------------- + + if( count($extra_data['settingGroups']) ) + { + $this->DB->delete( 'core_sys_settings_titles', "conf_title_keyword IN('" . implode( "','", $extra_data['settingGroups'] ) . "')" ); + } + + if( count($extra_data['settings']) ) + { + $this->DB->delete( 'core_sys_conf_settings', "conf_key IN('" . implode( "','", $extra_data['settings'] ) . "')" ); + } + + $this->cache->rebuildCache( 'settings', 'global' ); + + //----------------------------------------- + // Language strings/files + //----------------------------------------- + + if( count($extra_data['language']) ) + { + foreach( $extra_data['language'] as $file => $bit ) + { + $this->DB->delete( 'core_sys_lang_words', "word_pack='{$file}' AND word_key IN('" . implode( "','", $bit ) . "')" ); + } + + $langPacks = array(); + + $this->DB->build( array( 'select' => 'lang_id', 'from' => 'core_sys_lang' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $langPacks[] = $r['lang_id']; + } + + $classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir('core') . '/modules_admin/languages/manage_languages.php', 'admin_core_languages_manage_languages' ); + $langLib = new $classToLoad(); + $langLib->makeRegistryShortcuts( $this->registry ); + + foreach( $langPacks as $langId ) + { + $langLib->cacheToDisk( $langId ); + } + } + + //----------------------------------------- + // Modules + //----------------------------------------- + + if( count($extra_data['modules']) ) + { + foreach( $extra_data['modules'] as $module ) + { + list( $_side, $_app, $_module ) = explode( '-', $module ); + $_is_admin = ( $_side == 'admin' ) ? 1 : 0; + + $this->DB->delete( 'core_sys_module', "sys_module_application='{$_app}' AND sys_module_key='{$_module}' AND sys_module_admin={$_is_admin}" ); + } + + $this->cache->rebuildCache( 'module_cache', 'global' ); + $this->cache->rebuildCache( 'app_menu_cache', 'global' ); + } + + //----------------------------------------- + // Help files + //----------------------------------------- + + if( count($extra_data['help']) ) + { + $this->DB->delete( 'faq', "title IN('" . implode( "','", $extra_data['help'] ) . "')" ); + } + + //----------------------------------------- + // Skin templates + //----------------------------------------- + + if( count($extra_data['templates']) ) + { + foreach( $extra_data['templates'] as $group => $bits ) + { + $this->DB->delete( 'skin_templates', "template_group='{$group}' AND template_name IN('" . implode( "','", $bits ) . "')" ); + } + + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + $skinCaching = new skinCaching( $this->registry ); + $skinCaching->rebuildPHPTemplates( 0 ); + } + + //----------------------------------------- + // CSS + //----------------------------------------- + + if( count( $extra_data['css'] ) ) + { + $this->DB->delete( 'skin_css', "css_group IN('" . implode( "','", $extra_data['css'] ) . "')" ); + + if( ! $skinCaching ) + { + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + $skinCaching = new skinCaching( $this->registry ); + } + + $skinCaching->rebuildCSSCache( 0 ); + } + + //----------------------------------------- + // Tasks + //----------------------------------------- + + if( count($extra_data['tasks']) ) + { + $this->DB->delete( 'task_manager', "task_key IN('" . implode( "','", $extra_data['tasks'] ) . "')" ); + } + + //----------------------------------------- + // Database changes + //----------------------------------------- + + if( is_array($extra_data['database']['create']) AND count($extra_data['database']['create']) ) + { + foreach( $extra_data['database']['create'] as $create_query ) + { + $this->DB->return_die = true; + $this->DB->dropTable( $create_query['name'] ); + $this->DB->return_die = false; + } + } + + if( is_array($extra_data['database']['alter']) AND count($extra_data['database']['alter']) ) + { + foreach( $extra_data['database']['alter'] as $alter_query ) + { + $this->DB->return_die = true; + + if( $alter_query['altertype'] == 'add' ) + { + if( $this->DB->checkForField( $alter_query['field'], $alter_query['table'] ) ) + { + $this->DB->dropField( $alter_query['table'], $alter_query['field'] ); + } + } + else if( $alter_query['altertype'] == 'change' ) + { + if( $this->DB->checkForField( $alter_query['newfield'], $alter_query['table'] ) ) + { + $this->DB->changeField( $alter_query['table'] , $alter_query['newfield'], $alter_query['field'], $alter_query['fieldtype'], $alter_query['default'] ); + } + } + + $this->DB->return_die = false; + } + } + + if( is_array($extra_data['database']['update']) AND count($extra_data['database']['update']) ) + { + foreach( $extra_data['database']['update'] as $update_query ) + { + $this->DB->return_die = true; + $this->DB->update( $update_query['table'], array( $update_query['field'] => $update_query['oldvalue'] ), $update_query['where'] ); + $this->DB->return_die = false; + } + } + + if( is_array($extra_data['database']['insert']) AND count($extra_data['database']['insert']) ) + { + foreach( $extra_data['database']['insert'] as $insert_query ) + { + if( $insert_query['fordelete'] ) + { + $this->DB->return_die = true; + $this->DB->delete( $insert_query['table'], $insert_query['fordelete'] ); + $this->DB->return_die = false; + } + } + } + + //----------------------------------------- + // Custom install/uninstall script? + //----------------------------------------- + + if ( $_customFile ) + { + if( is_object($customClass) && method_exists( $customClass, 'uninstall' ) ) + { + $customClass->uninstall(); + } + + @unlink( $_customFile ); + } + + /* Delete main hook entry */ + $this->DB->delete( 'core_hooks', "hook_id={$hook_id}" ); + + $this->rebuildHooksCache(); + + /* Done */ + $this->registry->output->global_message = $this->lang->words['h_hasbeenun']; + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=hooks_overview' ); + } + + /** + * Hook add/edit form + * This dynamic form allows users to associate multiple files with a single hook. + * + * @param string [add|edit] + * @return @e void [Outputs to screen] + */ + protected function _hookForm( $type='add' ) + { + /* Init vars */ + $form = array(); + $files = array(); + $hookData = array(); + $requirements = array(); + $entryPoints = array( 'foreach' => array( array( 'outer.pre', $this->lang->words['h_outerpre'] ), + array( 'inner.pre', $this->lang->words['h_innerpre'] ), + array( 'inner.post', $this->lang->words['h_innerpost'] ), + array( 'outer.post', $this->lang->words['h_outerpost'] ) + ), + 'if' => array( array( 'pre.startif', $this->lang->words['h_prestartif'] ), + array( 'post.startif', $this->lang->words['h_poststartif'] ), + array( 'pre.else', $this->lang->words['h_preelse']), + array( 'post.else', $this->lang->words['h_postelse'] ), + array( 'pre.endif', $this->lang->words['h_preendif'] ), + array( 'post.endif', $this->lang->words['h_postendif'] ) + ) + ); + + /* Edit time? */ + if( $type == 'edit' ) + { + $id = intval($this->request['id']); + + if( !$id ) + { + $this->registry->output->showError( $this->lang->words['h_noedit'], 1116 ); + } + + $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $id ) ); + + if( !$hookData['hook_id'] ) + { + $this->registry->output->showError( $this->lang->words['h_noedit'], 1117 ); + } + + /* Sort out extra stuff and requirements */ + $hookData['hook_extra_data'] = unserialize( $hookData['hook_extra_data'] ); + $hookData['hook_requirements'] = unserialize( $hookData['hook_requirements'] ); + + /* Old data? - @todo: we should remove that around 3.3(4?) */ + if ( ! isset($hookData['hook_requirements']['required_applications']['core']) && isset($hookData['hook_requirements']['hook_ipb_version_min']) && ( $hookData['hook_requirements']['hook_ipb_version_min'] > 0 || $hookData['hook_requirements']['hook_ipb_version_max'] > 0 ) ) + { + $requirements['core'] = array( 'min_version' => intval($hookData['hook_requirements']['hook_ipb_version_min']), 'max_version' => intval($hookData['hook_requirements']['hook_ipb_version_max']) ); + } + + if ( is_array($hookData['hook_requirements']['required_applications']) && count($hookData['hook_requirements']['required_applications']) ) + { + /* Get the setup class */ + require_once( IPS_ROOT_PATH . 'setup/sources/base/setup.php' );/*noLibHook*/ + + foreach( $hookData['hook_requirements']['required_applications'] as $appKey => $versionData ) + { + /* Fetch and check versions */ + if ( !isset($this->cachedVersions[ $appKey ]) ) + { + $this->cachedVersions[ $appKey ] = IPSSetUp::fetchXmlAppVersions( $appKey ); + } + + $_versions = $this->cachedVersions[ $appKey ]; + + krsort($_versions); + + /* Setup our default 'no version' value */ + $versions = array( array( 0, $this->lang->words['h_any_version'] ) ); + + foreach( $_versions as $long => $human ) + { + if ( $long < 30000 && in_array( $appKey, array( 'core', 'forums', 'members' ) ) ) + { + continue; + } + + $versions[] = array( $long, $human ); + } + + $versionData['_versions'] = $versions; + $requirements[ $appKey ] = $versionData; + } + } + + /* Sort out hook files */ + $index = 1; + $skinGroups = $this->hooksFunctions->getSkinGroups(); + + $this->DB->build( array( 'select' => '*', 'from' => 'core_hooks_files', 'where' => 'hook_hook_id=' . $id ) ); + $outer = $this->DB->execute(); + + /* Get them outside the while cycle to prevent warnings */ + $_dataHooks = IPSLib::getDataHookLocations(); + + while( $r = $this->DB->fetch($outer) ) + { + $r['hook_data'] = unserialize( $r['hook_data'] ); + + if( $r['hook_type'] == 'templateHooks' ) + { + $templates = $this->hooksFunctions->getSkinMethods( $r['hook_data']['skinGroup'] ); + $hookIds = $this->hooksFunctions->getHookIds( $r['hook_data']['skinFunction'], $r['hook_data']['type'] ); + + $r['_skinDropdown'] = $this->registry->output->formDropdown( "skinGroup[{$index}]", $skinGroups, $r['hook_data']['skinGroup'], "skinGroup[{$index}]", "onchange='getTemplatesForAdd({$index});'" ); + $r['_templateDropdown'] = $this->registry->output->formDropdown( "skinFunction[{$index}]", $templates, $r['hook_data']['skinFunction'], "skinFunction[{$index}]", "onchange='getTypeOfHook({$index});'" ); + $r['_hookTypeDropdown'] = $this->registry->output->formDropdown( "type[{$index}]", array( array( 0, $this->lang->words['a_selectone'] ), array( 'foreach', $this->lang->words['hook_foreach_loop'] ), array( 'if', $this->lang->words['hook_if_statement'] ) ), $r['hook_data']['type'], "type[{$index}]", "onchange='getHookIds({$index});'" ); + $r['_hookIdsDropdown'] = $this->registry->output->formDropdown( "id[{$index}]", $hookIds, $r['hook_data']['id'], "id[{$index}]", "onchange='getHookEntryPoints({$index});'" ); + $r['_hookEPDropdown'] = $this->registry->output->formDropdown( "position[{$index}]", $r['hook_data']['type'] == 'foreach' ? $entryPoints['foreach'] : $entryPoints['if'], $r['hook_data']['position'] ); + } + + if( $r['hook_type'] == 'dataHooks' ) + { + $r['_dataLocationDropdown'] = $this->registry->output->formDropdown( "dataLocation[{$index}]", $_dataHooks, $r['hook_data']['dataLocation'] ); + } + + $files[ $index ] = $r; + $index++; + } + + $action = 'do_edit_hook'; + } + else + { + $action = 'do_create_hook'; + } + + /* Info */ + foreach( array( 'hook_name', 'hook_desc', 'hook_key', 'hook_version_human', 'hook_version_long', 'hook_author', 'hook_email', 'hook_website', 'hook_update_check' ) as $_hook_key ) + { + $form[ $_hook_key ] = $this->registry->output->formSimpleInput( $_hook_key , isset($this->request[ $_hook_key ]) ? $this->request[ $_hook_key ] : $hookData[ $_hook_key ], 60 ); + } + + /* Requirements */ + foreach( array( 'hook_php_version_min', 'hook_php_version_max' ) as $_version_key ) + { + $form[ $_version_key ] = $this->registry->output->formSimpleInput( $_version_key , isset($this->request[ $_version_key ]) ? $this->request[ $_version_key ] : $hookData['hook_requirements'][ $_version_key ], 20 ); + } + + /* Setup the global caches DD */ + $_caches = array(); + + $this->DB->build( array( 'select' => 'cs_key', + 'from' => 'cache_store', + 'order' => 'cs_key ASC' + ) ); + $this->DB->execute(); + + while( $gc = $this->DB->fetch() ) + { + $_caches[] = array( $gc['cs_key'], $gc['cs_key'] ); + } + + sort( $_caches ); + + $form['hook_global_caches'] = $this->registry->output->formMultiDropdown( 'hook_global_caches[]', $_caches, isset($_POST['hook_global_caches']) ? $_POST['hook_global_caches'] : explode(',',$hookData['hook_global_caches']), 15 ); + + /* Get some data for the javascript */ + $form['jsDataTypes'] = IPSText::br2nl( $this->registry->output->formDropdown( "type[#{index}]", array( array( 0, $this->lang->words['a_selectone'] ), array( 'foreach', $this->lang->words['hook_foreach_loop'] ), array( 'if', $this->lang->words['hook_if_statement'] ) ), '', "type[#{index}]", "onchange='getHookIds(#{index});'" ) ); + $form['jsDataPoints'] = IPSText::br2nl( $this->registry->output->formDropdown( "position[#{index}]", $r['hook_data']['type'] == 'foreach' ? $entryPoints['foreach'] : $entryPoints['if'] ) ); + + /* Output */ + $this->registry->output->extra_nav[] = array( $this->settings['base_url'] . $this->form_code . 'do=hooks_overview', $this->lang->words['menu__manage_hooks'] ); + $this->registry->output->html .= $this->html->hookForm( $form, $action, $hookData, $files, $requirements ); + } + + /** + * Hook add/edit save + * Save the new (or updated) hook record + * + * @param string [add|edit] + * @return @e void [Outputs to screen] + */ + protected function _hookSave( $type='add' ) + { + /* Init vars */ + $hookData = array(); + $newFiles = array(); + $requireApp = array(); + $_hookFiles = array(); + $extraKey = ''; + + /* Get data if we are editing */ + if( $type == 'edit' ) + { + $id = intval($this->request['hook_id']); + + if( !$id ) + { + $this->registry->output->showError( $this->lang->words['h_noedit'], 1118 ); + } + + $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $id ) ); + + if( !$hookData['hook_id'] ) + { + $this->registry->output->showError( $this->lang->words['h_noedit'], 1119 ); + } + + $extraKey = ' AND hook_id != ' . $hookData['hook_id']; + } + + /* Error Checking */ + if( ! $this->request['hook_name'] ) + { + $errors[] = $this->lang->words['hook_form_no_title']; + } + + if( empty( $this->request['hook_key'] ) ) + { + $errors[] = $this->lang->words['hook_form_no_key']; + } + else + { + $keyCheck = $this->DB->buildAndFetch( array( 'select' => 'count(*) as found', 'from' => 'core_hooks', 'where' => "hook_key='" . $this->DB->addSlashes( $this->request['hook_key'] ) . "'" . $extraKey ) ); + + if ( $keyCheck['found'] > 0 ) + { + $errors[] = $this->lang->words['hook_form_dupe_key']; + } + } + + /* Got any errors? */ + if ( is_array( $errors ) && count( $errors ) ) + { + $this->registry->output->global_error = implode( '
', $errors ); + $this->_hookForm(); + return; + } + + /* Not IN_DEV? */ + if ( ! IN_DEV ) + { + $this->DB->build( array( 'select' => '*', 'from' => 'core_hooks_files', 'where' => 'hook_hook_id=' . intval($this->request['hook_id']) ) ); + $this->DB->execute(); + + while( $_r = $this->DB->fetch() ) + { + $_hookFiles[ $_r['hook_classname'] ] = $_r['hook_file_stored']; + } + } + + /* Check for requirements */ + if ( is_array( $this->request['requireApp'] ) AND count( $this->request['requireApp'] ) ) + { + foreach( $this->request['requireApp'] as $_index => $app_key ) + { + if ( $app_key ) + { + $minVersion = intval($this->request['minVersion'][ $_index ]); + $maxVersion = intval($this->request['maxVersion'][ $_index ]); + + $requireApp[ $app_key ] = array( 'app_name' => ipsRegistry::$applications[ $app_key ]['app_title'], + 'min_version' => $minVersion, + 'max_version' => $maxVersion + ); + } + } + } + + /* Check for files */ + if ( is_array( $this->request['file'] ) AND count( $this->request['file'] ) ) + { + foreach( $this->request['file'] as $index => $file ) + { + if ( $file ) + { + $newFiles[ $index ] = array('hook_file_real' => $file, + 'hook_type' => $this->request['hook_type'][ $index ], + 'hook_classname' => $this->request['hook_classname'][ $index ], + 'hook_data' => serialize( array('dataLocation' => trim( $this->request['dataLocation'][ $index ] ), + 'libApplication' => trim( $this->request['libApplication'][ $index ] ), + 'classToOverload' => trim($this->request['classToOverload'][ $index ]), + 'skinGroup' => $this->request['skinGroup'][ $index ], + 'skinFunction' => $this->request['skinFunction'][ $index ], + 'type' => $this->request['type'][ $index ], + 'id' => $this->request['id'][ $index ], + 'position' => $this->request['position'][ $index ], + ) + ) + ); + + /** + * @link http://community.invisionpower.com/tracker/issue-22084-hook-edit-does-not-preserve-correct-name/ + * We don't want to reset the stored name if you are not in developer mode + */ + if ( IN_DEV ) + { + $newFiles[ $index ]['hook_file_stored'] = $file; // During import this is a random name, but for devs it's actual file + } + else + { + $newFiles[ $index ]['hook_file_stored'] = $_hookFiles[ $this->request['hook_classname'][ $index ] ] ? $_hookFiles[ $this->request['hook_classname'][ $index ] ] : $file; + } + } + } + } + + /* Get position */ + if ( $type == 'add' ) + { + $position = $this->DB->buildAndFetch( array( 'select' => 'MAX(hook_position) as newPos', 'from' => 'core_hooks' ) ); + + $position['newPos'] = intval($position['newPos']) + 1; + } + else + { + $position['newPos'] = $hookData['hook_position']; + } + + $mainHookRecord = array('hook_name' => trim($this->request['hook_name']), + 'hook_key' => substr( trim($this->request['hook_key']), 0, 32 ), + 'hook_global_caches' => ( is_array($this->request['hook_global_caches']) && count($this->request['hook_global_caches']) ) ? implode(',', $this->request['hook_global_caches']) : '', + 'hook_desc' => trim($this->request['hook_desc']), + 'hook_version_human' => trim($this->request['hook_version_human']), + 'hook_version_long' => trim($this->request['hook_version_long']), + 'hook_author' => trim($this->request['hook_author']), + 'hook_email' => trim($this->request['hook_email']), + 'hook_website' => trim($this->request['hook_website']), + 'hook_update_check' => trim($this->request['hook_update_check']), + 'hook_enabled' => $type == 'add' ? 1 : $hookData['hook_enabled'], + 'hook_installed' => $type == 'add' ? IPS_UNIX_TIME_NOW : $hookData['hook_installed'], + 'hook_updated' => $type == 'add' ? 0 : IPS_UNIX_TIME_NOW, + 'hook_position' => $position['newPos'], + 'hook_requirements' => serialize( array('required_applications' => $requireApp, + 'hook_php_version_min' => trim($this->request['hook_php_version_min']), + 'hook_php_version_max' => trim($this->request['hook_php_version_max']) + ) + ) + ); + + if( $type == 'edit' ) + { + $this->DB->update( 'core_hooks', $mainHookRecord, 'hook_id=' . $hookData['hook_id'] ); + + $this->DB->delete( 'core_hooks_files', 'hook_hook_id=' . $hookData['hook_id'] ); + } + else + { + $this->DB->insert( 'core_hooks', $mainHookRecord ); + + $hookData['hook_id'] = $this->DB->getInsertId(); + } + + foreach( $newFiles as $index => $toInsert ) + { + $toInsert['hook_hook_id'] = $hookData['hook_id']; + + $this->DB->insert( 'core_hooks_files', $toInsert ); + } + + /* Rebuild cache */ + $this->rebuildHooksCache(); + + /* Rebuild global caches */ + try + { + IPSLib::cacheGlobalCaches(); + } + catch( Exception $e ){} + + /* Flag skins for recache */ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + $skinCaching = new skinCaching( $this->registry ); + $skinCaching->flagSetForRecache(); + + /* Redirect */ + $this->registry->output->setMessage( $this->lang->words['h_saved'] ); + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&do=hooks_overview' ); + } + + /** + * View details about a hook + * + * @return @e void [Outputs to screen] + */ + protected function _viewDetails() + { + $id = intval($this->request['id']); + + if( !$id ) + { + $this->registry->output->showError( $this->lang->words['h_nodetails'], 11110 ); + } + + $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $id ) ); + + if( !$hookData['hook_id'] ) + { + $this->registry->output->showError( $this->lang->words['h_nodetails'], 11111 ); + } + + /* Extra data */ + $hookData['_updated'] = $this->registry->getClass('class_localization')->formatTime( $hookData['hook_updated'] ); + $hookData['hook_extra_data'] = unserialize( $hookData['hook_extra_data'] ); + + /* Meets requirements? */ + $hookData['_require_errors'] = $this->checkHookRequirements( $hookData ); + + /* Got updates? */ + if ( $hookData['hook_update_check'] ) + { + $hookData['hook_update_available'] = $this->_updateAvailable( $hookData['hook_update_check'], $hookData['hook_version_long'] ); + } + else + { + $hookData['hook_update_available'] = array( 0 ); + } + + /* Get files */ + $files = array(); + $index = 1; + + $this->DB->build( array( 'select' => '*', 'from' => 'core_hooks_files', 'where' => 'hook_hook_id=' . $id ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $r['hook_data'] = unserialize( $r['hook_data'] ); + $files[ $index ] = $r; + $index++; + } + + /* Output */ + $this->registry->output->extra_nav[] = array( $this->settings['base_url'] . $this->form_code . 'do=hooks_overview', $this->lang->words['menu__manage_hooks'] ); + $this->registry->output->html .= $this->html->hookDetails( $hookData, $files ); + } + + /** + * Check if the hook meets all the requirements + * + * @param mixed $hook Can be an hook ID or an array of the hook data + * @return @e array Errors found + */ + public function checkHookRequirements( $hook ) + { + /* Init vars */ + $hookData = array(); + $reqsData = array(); + $errors = array(); + + /* We already have some data? */ + if ( is_array($hook) && count($hook) ) + { + $hookData = $hook; + } + elseif ( is_int($hook) ) + { + $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $hook ) ); + } + + /* Requirements are still serialized? */ + if ( IPSLib::isSerialized($hookData['hook_requirements']) ) + { + $hookData['hook_requirements'] = unserialize($hookData['hook_requirements']); + } + + /* Make our var shorter... */ + $reqsData = &$hookData['hook_requirements']; + + /* Old data? - @todo: remove this check around 3.3(4?) */ + if ( ! isset($reqsData['required_applications']['core']) && isset($reqsData['hook_ipb_version_min']) && ( $reqsData['hook_ipb_version_min'] > 0 || $reqsData['hook_ipb_version_max'] > 0 ) ) + { + $reqsData['hook_ipb_version_min'] = ( $reqsData['hook_ipb_version_min'] < 30000 ) ? 30000 : $reqsData['hook_ipb_version_min']; + + $reqsData['required_applications']['core'] = array( 'min_version' => intval($reqsData['hook_ipb_version_min']), 'max_version' => intval($reqsData['hook_ipb_version_max']) ); + } + + //----------------------------------------- + // Let's start checking requirements + //----------------------------------------- + + /* PHP */ + if( $reqsData['hook_php_version_min'] OR $reqsData['hook_php_version_max'] ) + { + if( $reqsData['hook_php_version_min'] AND version_compare( PHP_VERSION, $reqsData['hook_php_version_min'], '<' ) == true ) + { + $errors['php_min'] = sprintf( $this->lang->words['h_phpold'],$reqsData['hook_php_version_min'] ); + } + + if( $reqsData['hook_php_version_max'] AND version_compare( PHP_VERSION, $reqsData['hook_php_version_max'], '>' ) == true ) + { + $errors['php_max'] = sprintf( $this->lang->words['h_phpnew'], $reqsData['hook_php_version_max'] ); + } + } + + /* Additional applications */ + if ( is_array($reqsData['required_applications']) && count($reqsData['required_applications']) ) + { + /* Get the setup class */ + require_once( IPS_ROOT_PATH . 'setup/sources/base/setup.php' );/*noLibHook*/ + + /* Loop through all apps */ + foreach( $reqsData['required_applications'] as $appKey => $appData ) + { + /* Versions file doesn't exist? */ + if ( !is_file( IPSLib::getAppDir( $appKey ) . '/xml/versions.xml' ) ) + { + $errors[ $appKey.'_app' ] = sprintf( $this->lang->words['hook_require_appnotfound'], $appData['app_name'] ); + } + /* App not installed/enabled? */ + elseif ( !IPSLib::appIsInstalled( $appKey ) ) + { + $errors[ $appKey.'_app' ] = sprintf( $this->lang->words['hook_require_appdisabled'], ipsRegistry::$applications[ $appKey ]['app_title'] ); + } + elseif ( $appData['min_version'] OR $appData['max_version'] ) + { + /* Fetch and check versions */ + if ( !isset($this->cachedVersions[ $appKey ]) ) + { + $this->cachedVersions[ $appKey ] = IPSSetUp::fetchXmlAppVersions( $appKey ); + } + + $versions = $this->cachedVersions[ $appKey ]; + + if ( is_array($versions) && count($versions) ) + { + if ( !isset($this->cachedUpgradeInfo[ $appKey ]) ) + { + $_key = in_array( $appKey, array( 'forums', 'members' ) ) ? 'core' : $appKey; + $this->cachedUpgradeInfo[ $_key ] = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'upgrade_history', 'where' => "upgrade_app='{$_key}'", 'order' => 'upgrade_version_id DESC', 'limit' => array( 1 ) ) ); + + /* Extra caching for the three core apps */ + if( in_array( $appKey, array( 'core', 'forums', 'members' ) ) ) + { + $this->cachedUpgradeInfo['core'] = $this->cachedUpgradeInfo[ $_key ]; + $this->cachedUpgradeInfo['forums'] = $this->cachedUpgradeInfo[ $_key ]; + $this->cachedUpgradeInfo['members'] = $this->cachedUpgradeInfo[ $_key ]; + } + } + + /* Do we meet tha requirements? */ + if ( $appData['min_version'] AND $this->cachedUpgradeInfo[ $appKey ]['upgrade_version_id'] < $appData['min_version'] ) + { + $errors[ $appKey.'_min' ] = sprintf( $this->lang->words['hook_require_tooold'], isset($versions[ $appData['min_version'] ]) ? $versions[ $appData['min_version'] ] : $appData['min_version'] ); + } + + if ( $appData['max_version'] AND $this->cachedUpgradeInfo[ $appKey ]['upgrade_version_id'] > $appData['max_version'] ) + { + $errors[ $appKey.'_max' ] = sprintf( $this->lang->words['hook_require_toonew'], isset($versions[ $appData['max_version'] ]) ? $versions[ $appData['max_version'] ] : $appData['max_version'] ); + } + } + } + } + } + + return $errors; + } + + /** + * Check if you meet hook requirements + * + * @return @e void [Outputs to screen] + */ + protected function _checkRequirements() + { + $id = intval($this->request['id']); + + if( !$id ) + { + $this->registry->output->showError( $this->lang->words['h_norequirements'], 11112 ); + } + + $hookData = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $id ) ); + + if( !$hookData['hook_id'] ) + { + $this->registry->output->showError( $this->lang->words['h_norequirements'], 11113 ); + } + + /* Get requirements */ + $hookData['hook_requirements'] = unserialize($hookData['hook_requirements']); + + /* Check requirements */ + $errors = $this->checkHookRequirements( $hookData ); + + /* Output */ + $this->registry->output->extra_nav[] = array( $this->settings['base_url'] . $this->form_code . 'do=hooks_overview', $this->lang->words['menu__manage_hooks'] ); + $this->registry->output->html .= $this->html->hookRequirements( $hookData, $errors, $this->cachedVersions ); + } + + /** + * Rebuild hooks cache + * + * @return @e void + */ + public function rebuildHooksCache() + { + /* INI */ + $cache = array( 'commandHooks' => array(), 'skinHooks' => array(), 'templateHooks' => array(), 'dataHooks' => array(), 'libraryHooks' => array() ); + + /* First fix positions */ + $this->_fixPositions(); + + /* Get current hooks */ + $this->DB->build( array( 'select' => 'f.*', + 'from' => array( 'core_hooks_files' => 'f' ), + 'where' => 'c.hook_enabled=1', + 'order' => 'c.hook_position ASC', + 'add_join' => array( array( 'select' => 'c.hook_id', + 'from' => array( 'core_hooks' => 'c' ), + 'where' => 'c.hook_id=f.hook_hook_id', + 'type' => 'left' ) ) + ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + /* Got no main hook id? Weird but skip.. */ + if ( empty($r['hook_id']) ) + { + continue; + } + + /* INIT */ + $_cache = array(); + $data = unserialize( $r['hook_data'] ); + + /* General Stuff */ + $_cache = array( 'filename' => $r['hook_file_stored'], + 'className' => $r['hook_classname'] + ); + + /* Hook type specific stuff */ + if( $r['hook_type'] == 'templateHooks' ) + { + $_cache['type'] = $data['type']; + $_cache['skinFunction'] = $data['skinFunction']; + $_cache['id'] = $data['id']; + $_cache['position'] = $data['position']; + } + else if( /*$r['hook_type'] == 'dataHooks' OR*/ $r['hook_type'] == 'libraryHooks' ) + { + $_cache['classToOverload'] = $data['classToOverload']; + } + + /* Add to array */ + if( $r['hook_type'] == 'templateHooks' ) + { + $cache[ $r['hook_type'] ][ $data['skinGroup'] ][] = $_cache; + } + else if( $r['hook_type'] == 'dataHooks' ) + { + $cache[ $r['hook_type'] ][ $data['dataLocation'] ][] = $_cache; + } + else if( $r['hook_type'] == 'libraryHooks' ) + { + $cache[ $r['hook_type'] ][ $data['libApplication'] ][ $data['classToOverload'] ][] = $_cache; + } + else + { + $cache[ $r['hook_type'] ][ $data['classToOverload'] ][] = $_cache; + } + } + + /* Update the cache */ + $this->cache->setCache( 'hooks', $cache, array( 'array' => 1 ) ); + } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/applications/index.html b/upload/admin/applications/core/modules_admin/applications/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/applications/index.html +++ b/upload/admin/applications/core/modules_admin/applications/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/applications/nexus.php b/upload/admin/applications/core/modules_admin/applications/nexus.php index 504353b2..549a8e08 100644 --- a/upload/admin/applications/core/modules_admin/applications/nexus.php +++ b/upload/admin/applications/core/modules_admin/applications/nexus.php @@ -2,7 +2,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Nexus Application
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
@@ -34,6 +34,6 @@ class admin_core_applications_nexus extends ipsCommand { $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'purchase_app' ); - $this->registry->output->showInsideIframe("http://www.invisionpower.com/products/nexus/"); + $this->registry->output->showInsideIframe("http://anonym.to/?http://www.invisionpower.com/products/nexus/"); } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/applications/setup.php b/upload/admin/applications/core/modules_admin/applications/setup.php index 639b2caf..c0d788eb 100644 --- a/upload/admin/applications/core/modules_admin/applications/setup.php +++ b/upload/admin/applications/core/modules_admin/applications/setup.php @@ -1,1173 +1,1164 @@ - - * Invision Power Services - * IP.Board v3.4.5 - * Application Installation - * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $ - *
- * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/company/standards.php#license - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 10721 $ - */ - -if ( ! defined( 'IN_ACP' ) ) -{ - print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; - exit(); -} - - -class admin_core_applications_setup extends ipsCommand -{ - /** - * Skin object - * - * @var object Skin templates - */ - protected $html; - - /** - * Shortcut for url - * - * @var string URL shortcut - */ - protected $form_code; - - /** - * Shortcut for url (javascript) - * - * @var string JS URL shortcut - */ - protected $form_code_js; - - /** - * Current app path - * - * @var object - */ - protected $app_full_path; - - /** - * Product information - * - * @var array - */ - protected $product_information; - - /** - * Main class entry point - * - * @param object ipsRegistry reference - * @return @e void [Outputs to screen] - */ - public function doExecute( ipsRegistry $registry ) - { - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'app_install' ); - - /* Get Template and Language */ - $this->html = $this->registry->output->loadTemplate( 'cp_skin_setup' ); - - $this->lang->loadLanguageFile( array( 'admin_setup', 'admin_system', 'admin_tools', 'admin_templates' ), 'core' ); - - /* URL Bits */ - $this->form_code = $this->html->form_code = 'module=applications&section=setup'; - $this->form_code_js = $this->html->form_code_js = 'module=applications§ion=setup'; - - /* Get the setup class */ - require( IPS_ROOT_PATH . "setup/sources/base/setup.php" );/*noLibHook*/ - - /* Set the path */ - $this->app_full_path = IPSLib::getAppDir( $this->request['app_directory'] ) . '/'; - - /* Set up product info from XML file */ - $this->product_information = IPSSetUp::fetchXmlAppInformation( $this->request['app_directory'], $this->settings['gb_char_set'] ); - - if( ! $this->app_full_path OR ! $this->product_information['title'] ) - { - $this->registry->output->global_message = $this->lang->words['error__cannot_init']; - $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] ); - return; - } - - /* Sequence of Events: - # SQL - # App Module - # Check for more modules - # Templates - # Languages - # Tasks - # Settings - # Template Cache - # Caches / Done - */ - switch( $this->request['do'] ) - { - default: - case 'start': - $this->start(); - break; - case 'sql': - $this->sqlBasics(); - break; - case 'sql_steps': - $this->sqlSteps(); - break; - case 'next_check': - $this->nextCheck(); - break; - - case 'templates': - $this->templates(); - break; - case 'languages': - $this->languages(); - break; - case 'tasks': - $this->tasks(); - break; - case 'bbcode': - $this->bbcode(); - break; - case 'help': - $this->help(); - break; - case 'settings': - $this->settings(); - break; - case 'hooks': - $this->hooks(); - break; - case 'tplcache': - $this->recacheTemplates(); - break; - case 'finish': - $this->finish(); - break; - } - - $this->registry->getClass('output')->html_main .= $this->registry->getClass('output')->global_template->global_frame_wrapper(); - $this->registry->getClass('output')->sendOutput(); - } - - /** - * Rebuild PHP Templates Cache - * - * @return @e void - */ - public function recacheTemplates() - { - /* Flag skins for recache */ - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ - $skinCaching = new skinCaching( $this->registry ); - - /* Flag all for recache */ - $skinCaching->flagSetForRecache(); - - $data = $this->getVars(); - - $this->showRedirectScreen( $data['app_directory'], array( $this->lang->words['install_skins_flag_recache'] ), '', $this->getNextURL( 'finish', $data ) ); - } - - /** - * Finalizes installation and rebuilds caches - * - * @return @e void - */ - public function finish() - { - /* INIT */ - $vars = $this->getVars(); - $output = array(); - $errors = array(); - - /* Init Data */ - $data = IPSSetUp::fetchXmlAppInformation( $vars['app_directory'], $this->settings['gb_char_set'] ); - $_numbers = IPSSetUp::fetchAppVersionNumbers( $vars['app_directory'] ); - - /* Grab Data */ - $data['app_directory'] = $vars['app_directory']; - $data['current_version'] = ( $_numbers['current'][0] ) ? $_numbers['current'][0] : $this->lang->words['cur_version_none']; - $data['latest_version'] = $_numbers['latest'][1]; - $data['next_version'] = $_numbers['next'][0]; - - /* Rebuild applications and modules cache */ - $this->cache->rebuildCache( 'app_cache', 'global' ); - $this->cache->rebuildCache( 'module_cache', 'global' ); - $this->cache->rebuildCache( 'app_menu_cache', 'global' ); - $this->cache->rebuildCache( 'group_cache', 'global' ); - $this->cache->rebuildCache( 'notifications', 'global' ); - $this->cache->rebuildCache( 'report_plugins', 'global' ); - - /* Rebuild application specific caches */ - $_file = $this->app_full_path . 'extensions/coreVariables.php'; - - if( is_file( $_file ) ) - { - $CACHE = array(); - require( $_file );/*noLibHook*/ - - if( is_array( $CACHE ) AND count( $CACHE ) ) - { - foreach( $CACHE as $key => $cdata ) - { - $this->cache->rebuildCache( $key, $vars['app_directory'] ); - } - } - } - - /* Rebuild GLOBAL CACHES! */ - try - { - IPSLib::cacheGlobalCaches(); - } - catch( Exception $e ) - { - // Show an error? - } - - /* Rebuild FURLs */ - $furltemplatesfile = $this->app_full_path; - if(IPB_USE_ONLY_ID_FURL && is_file( $furltemplatesfile.'/extensions/furlTemplatesID.php')) - { - $furltemplatesfile.='/extensions/furlTemplatesID.php'; - } - else - { - $furltemplatesfile.='/extensions/furlTemplates.php'; - } - if( is_file( $furltemplatesfile ) ) - { - try - { - IPSLib::cacheFurlTemplates(); - } - catch( Exception $e ) - { - // Show an error? - } - } - - /* Show completed screen... */ - $this->registry->output->html .= $this->html->setup_completed_screen( $data, $vars['type'] ); - } - - /** - * Next Check - * - * @return @e void - */ - public function nextCheck() - { - /* INIT */ - $vars = $this->getVars(); - $output = array(); - $errors = array(); - - /* Init Data */ - $data = IPSSetUp::fetchXmlAppInformation( $vars['app_directory'], $this->settings['gb_char_set'] ); - $_numbers = IPSSetUp::fetchAppVersionNumbers( $vars['app_directory'] ); - $modules = IPSSetUp::fetchXmlAppModules( $vars['app_directory'], $this->settings['gb_char_set'] ); - - /* Grab Data */ - $data['app_directory'] = $vars['app_directory']; - $data['current_version'] = ( $_numbers['current'][0] ) ? $_numbers['current'][0] : $this->lang->words['cur_version_none']; - $data['latest_version'] = $_numbers['latest'][1]; - $data['next_version'] = $_numbers['next'][0]; - - /* Update the app DB */ - if( $vars['type'] == 'install' ) - { - /* Get current max position */ - $pos = $this->DB->buildAndFetch( array( 'select' => 'MAX(app_position) as pos', 'from' => 'core_applications' ) ); - $new_pos = intval( $pos['pos'] ) + 1; - - /* Insert details into the DB */ - $this->DB->insert( 'core_applications', array( 'app_title' => $this->product_information['name'], - 'app_public_title' => $this->product_information['public_name'], - 'app_author' => $this->product_information['author'], - 'app_description' => $this->product_information['description'], - 'app_hide_tab' => intval($this->product_information['hide_tab']), - 'app_version' => $_numbers['latest'][1], - 'app_long_version' => $_numbers['latest'][0], - 'app_directory' => $vars['app_directory'], - 'app_location' => $vars['app_location'], - 'app_added' => time(), - 'app_position' => $new_pos, - 'app_protected' => 0, - 'app_enabled' => $this->product_information['disabledatinstall'] ? 0 : 1, - 'app_website' => trim($this->product_information['website']), - 'app_update_check' => trim($this->product_information['update_check']), - 'app_global_caches' => trim($this->product_information['global_caches']), - ) - ); - - $this->DB->insert( 'upgrade_history', array( - 'upgrade_version_id' => $_numbers['latest'][0], - 'upgrade_version_human' => $_numbers['latest'][1], - 'upgrade_date' => time(), - 'upgrade_notes' => '', - 'upgrade_mid' => $this->memberData['member_id'], - 'upgrade_app' => $vars['app_directory'], - ) ); - - /* Insert the modules */ - foreach( $modules as $key => $module ) - { - $this->DB->insert( 'core_sys_module', $module ); - } - } - else - { - $this->DB->update( 'core_applications', array( 'app_title' => $this->product_information['name'], - 'app_public_title' => $this->product_information['public_name'], - 'app_author' => $this->product_information['author'], - 'app_description' => $this->product_information['description'], - 'app_hide_tab' => intval($this->product_information['hide_tab']), - 'app_version' => $_numbers['current'][1], - 'app_long_version' => $_numbers['current'][0], - 'app_website' => trim($this->product_information['website']), - 'app_update_check' => trim($this->product_information['update_check']), - 'app_global_caches' => trim($this->product_information['global_caches']), - ), "app_directory='" . $vars['app_directory'] . "'" ); - - /* Update the modules */ - foreach( $modules as $key => $module ) - { - $this->DB->update( 'core_sys_module', $module, "sys_module_application='{$module['sys_module_application']}' AND sys_module_key='{$module['sys_module_key']}'" ); - } - } - - /* Finish? */ - if( $vars['type'] == 'install' OR $vars['version'] == $_numbers['latest'][0] ) - { - /* Go back and start over with the new version */ - $output[] = $this->lang->words['redir__nomore_modules']; - - $this->showRedirectScreen( $vars['app_directory'], $output, $errors, $this->getNextURL( 'templates', $vars ) ); - } - else - { - /* Go back and start over with the new version */ - $output[] = sprintf( $this->lang->words['redir__upgraded_to'], $_numbers['current'][1] ); - - /* Work out the next step */ - $vars['version'] = $_numbers['next'][0]; - - $this->showRedirectScreen( $vars['app_directory'], $output, $errors, $this->getNextURL( 'sql', $vars ) ); - } - } - - /** - * Import Hooks - * - * @return @e void - */ - public function hooks() - { - /* INIT */ - $vars = $this->getVars(); - $output = array(); - $errors = array(); - $knownSettings = array(); - - $this->registry->class_localization->loadLanguageFile( array( 'admin_tools' ) ); - - if( is_file( $this->app_full_path . 'xml/hooks.xml' ) ) - { - /* Get the hooks class */ - $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/applications/hooks.php', 'admin_core_applications_hooks' ); - $hooks = new $classToLoad(); - $hooks->makeRegistryShortcuts( $this->registry ); - - $return = $hooks->installAppHooks( $vars['app_directory'] ); - $this->cache->rebuildCache( 'hooks', 'global' ); - - $output[] = sprintf( $this->lang->words['redir__hooks'], $return['inserted'], $return['updated'] ); - } - else - { - $this->registry->output->global_message = $this->lang->words['hooks_nofile']; - - $output[] = $this->registry->output->global_message; - } - - /* Clear main messaage */ - $this->registry->output->global_message = ''; - - /* Show redirect... */ - $this->showRedirectScreen( $vars['app_directory'], $output, $errors, $this->getNextURL( 'tplcache', $vars ) ); - } - - /** - * Import Settings - * - * @return @e void - */ - public function settings() - { - /* INIT */ - $vars = $this->getVars(); - $output = array(); - $errors = array(); - $knownSettings = array(); - - $this->registry->class_localization->loadLanguageFile( array( 'admin_tools' ), 'core' ); - - if( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_settings.xml' ) ) - { - /* Get the settings class */ - $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/settings/settings.php', 'admin_core_settings_settings' ); - $settings = new $classToLoad(); - $settings->makeRegistryShortcuts( $this->registry ); - - $this->request['app_dir'] = $vars['app_directory']; - - //----------------------------------------- - // Known settings - //----------------------------------------- - - if ( substr( $this->settings['_original_base_url'], -1 ) == '/' ) - { - IPSSetUp::setSavedData('install_url', substr( $this->settings['_original_base_url'], 0, -1 ) ); - } - - if ( substr( $this->settings['base_dir'], -1 ) == '/' ) - { - IPSSetUp::setSavedData('install_dir', substr( $this->settings['base_dir'], 0, -1 ) ); - } - - /* Fetch known settings */ - if ( is_file( IPSLib::getAppDir( $vars['app_directory'] ) . '/setup/versions/install/knownSettings.php' ) ) - { - require( IPSLib::getAppDir( $vars['app_directory'] ) . '/setup/versions/install/knownSettings.php' );/*noLibHook*/ - } - - $settings->importAllSettings( 1, 1, $knownSettings ); - $settings->settingsRebuildCache(); - } - else - { - $this->registry->output->global_message = $this->lang->words['settings_nofile']; - } - - $output[] = $this->registry->output->global_message; - - /* Clear main messaage */ - $this->registry->output->global_message = ''; - - /* Show redirect... */ - $this->showRedirectScreen( $vars['app_directory'], $output, $errors, $this->getNextURL( 'hooks', $vars ) ); - } - - /** - * Import tasks - * - * @return @e void - */ - public function tasks() - { - /* INIT */ - $vars = $this->getVars(); - $output = array(); - $errors = array(); - - if( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_tasks.xml' ) ) - { - /* Get the language class */ - $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/system/taskmanager.php', 'admin_core_system_taskmanager' ); - $task_obj = new $classToLoad(); - $task_obj->makeRegistryShortcuts( $this->registry ); - - $task_obj->tasksImportFromXML( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_tasks.xml', true ); - } - - $output[] = $this->registry->output->global_message ? $this->registry->output->global_message : $this->lang->words['no_tasks_for_import']; - - /* Clear main msg */ - $this->registry->output->global_message = ''; - - /* Show redirect... */ - $this->showRedirectScreen( $vars['app_directory'], $output, $errors, $this->getNextURL( 'bbcode', $vars ) ); - } - - /** - * Import bbcode - * - * @return @e void - */ - public function bbcode() - { - /* INIT */ - $vars = $this->getVars(); - $output = array(); - $errors = array(); - - if( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_bbcode.xml' ) ) - { - /* Get the language class */ - $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/posts/bbcode.php', 'admin_core_posts_bbcode' ); - $bbcode = new $classToLoad(); - $bbcode->makeRegistryShortcuts( $this->registry ); - - $bbcode->bbcodeImportDo( file_get_contents( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_bbcode.xml' ) ); - - $output[] = $this->lang->words['bbcode_and_media']; - } - - if( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_mediatag.xml' ) ) - { - /* Get the language class */ - $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/posts/media.php', 'admin_core_posts_media' ); - $bbcode = new $classToLoad(); - $bbcode->makeRegistryShortcuts( $this->registry ); - - $bbcode->doMediaImport( file_get_contents( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_mediatag.xml' ) ); - - if( !count($output) ) - { - $output[] = $this->lang->words['bbcode_and_media']; - } - } - - if( !count($output) ) - { - $output[] = $this->lang->words['no_bbcode_media']; - } - - /* Show redirect... */ - $this->showRedirectScreen( $vars['app_directory'], $output, $errors, $this->getNextURL( 'help', $vars ) ); - } - - /** - * Import help - * - * @return @e void - */ - public function help() - { - /* INIT */ - $vars = $this->getVars(); - $output = array(); - $errors = array(); - - if( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_help.xml' ) ) - { - $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/tools/help.php', 'admin_core_tools_help' ); - $help = new $classToLoad(); - $help->makeRegistryShortcuts( $this->registry ); - - $done = $help->helpFilesXMLImport_app( $vars['app_directory'] ); - - $output[] = sprintf( $this->lang->words['imported_x_help'], ($done['added'] + $done['updated']) ); - } - else - { - $output[] = $this->lang->words['imported_no_help']; - } - - - /* Show redirect... */ - $this->showRedirectScreen( $vars['app_directory'], $output, $errors, $this->getNextURL( 'settings', $vars ) ); - } - - /** - * Language Import - * - * @return @e void - */ - public function languages() - { - /* INIT */ - $vars = $this->getVars(); - $output = array(); - $errors = array(); - - /* Load the language file */ - $this->registry->class_localization->loadLanguageFile( array( 'admin_system' ) ); - - /* Get the language stuff */ - $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/languages/manage_languages.php', 'admin_core_languages_manage_languages' ); - $lang = new $classToLoad(); - $lang->makeRegistryShortcuts( $this->registry ); - - /* Loop through the xml directory and look for lang packs */ - $_PATH = $this->app_full_path . '/xml/'; - - try - { - foreach( new DirectoryIterator( $_PATH ) as $f ) - { - if( preg_match( "#(.+?)_language_pack.xml#", $f->getFileName() ) ) - { - $this->request['file_location'] = $_PATH . $f->getFileName(); - $lang->imprtFromXML( true, true, true, $vars['app_directory'], false, 1 ); - } - } - } catch ( Exception $e ) {} - - $output[] = $this->registry->output->global_message ? $this->registry->output->global_message : $this->lang->words['redir__nolanguages']; - - /* Clear main msg */ - $this->registry->output->global_message = ''; - - /* Show redirect... */ - $this->showRedirectScreen( $vars['app_directory'], $output, $errors, $this->getNextURL( 'tasks', $vars ) ); - } - - /** - * Install templates - * - * @return @e void - */ - public function templates() - { - /* INIT */ - $vars = $this->getVars(); - $output = array(); - $errors = array(); - - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinImportExport.php' );/*noLibHook*/ - $skinFunctions = new skinImportExport( $this->registry ); - $skinCaching = new skinCaching( $this->registry ); - - /* Grab skin data */ - $this->DB->build( array( 'select' => '*', - 'from' => 'skin_collections' ) ); - - $this->DB->execute(); - - while( $row = $this->DB->fetch() ) - { - /* Bit of jiggery pokery... */ - if ( $row['set_key'] == 'default' ) - { - $row['set_key'] = 'root'; - $row['set_id'] = 0; - } - - $skinSets[ $row['set_key'] ] = $row; - } - - foreach( $skinSets as $skinKey => $skinData ) - { - /* Skin files first */ - if( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_' . $skinKey . '_templates.xml' ) ) - { - $return = $skinFunctions->importTemplateAppXML( $vars['app_directory'], $skinKey, $skinData['set_id'], TRUE ); - - $output[] = sprintf( $this->lang->words['redir__templates'], $return['insertCount'], $return['updateCount'], $skinData['set_name'] ); - } - - /* Then CSS files */ - if ( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_' . $skinKey . '_css.xml' ) ) - { - //----------------------------------------- - // Install - //----------------------------------------- - - $return = $skinFunctions->importCSSAppXML( $vars['app_directory'], $skinKey, $skinData['set_id'] ); - - $output[] = sprintf( $this->lang->words['redir__cssfiles'], $return['insertCount'], $return['updateCount'], $skinData['set_name'] ); - } - - /* And we can support replacements for good measure */ - if ( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_replacements.xml' ) ) - { - //----------------------------------------- - // Install - //----------------------------------------- - - $return = $skinFunctions->importReplacementsXMLArchive( file_get_contents( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_replacements.xml' ), $skinKey ); - - $output[] = $this->lang->words['redir__replacements']; - } - } - - /* Recache */ - //$skinCaching->rebuildPHPTemplates( 0 ); - //$skinCaching->rebuildCSS( 0 ); - //$skinCaching->rebuildReplacementsCache( 0 ); - - /* No templates? Give some sort of feedback */ - if ( !count( $output ) ) - { - $output[] = $this->lang->words['redir__no_templates']; - } - - /* Show redirect... */ - $this->showRedirectScreen( $vars['app_directory'], $output, $errors, $this->getNextURL( 'languages', $vars ) ); - } - - /** - * Runs any additional sql files - * - * @return @e void - */ - public function sqlSteps() - { - /* INIT */ - $vars = $this->getVars(); - $output = array(); - $errors = array(); - $id = intval( $this->request['id'] ); - $id = ( $id < 1 ) ? 1 : $id; - $sql_files = array(); - - /* Any "extra" configs required for this driver? */ - if( is_file( IPS_ROOT_PATH . 'setup/sql/' . strtolower( $this->settings['sql_driver'] ) . '_install.php' ) ) - { - require_once( IPS_ROOT_PATH . 'setup/sql/' . strtolower( $this->settings['sql_driver'] ) . '_install.php' );/*noLibHook*/ - - $extra_install = new install_extra( $this->registry ); - } - - - /* Run any sql files we found */ - if( is_file( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ips_DBRegistry::getDriverType() ) . '_sql_' . $id .'.php' ) ) - { - /* INIT */ - $new_id = $id + 1; - $count = 0; - $SQL = array(); - - /* Get the sql file */ - require_once( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ips_DBRegistry::getDriverType() ) . '_sql_' . $id .'.php' );/*noLibHook*/ - - $this->DB->return_die = 1; - - /* Run the queries */ - foreach( $SQL as $query ) - { - $this->DB->allow_sub_select = 1; - $this->DB->error = ''; - - $query = str_replace( "<%time%>", time(), $query ); - - if( $extra_install AND method_exists( $extra_install, 'process_query_insert' ) ) - { - $query = $extra_install->process_query_insert( $query ); - } - - $this->DB->query( $query ); - - if ( $this->DB->error ) - { - $errors[] = $query."

".$this->DB->error; - } - else - { - $count++; - } - } - - $output[] = sprintf( $this->lang->words['redir__sql_run'], $count ); - - /* Show redirect... */ - $this->showRedirectScreen( $vars['app_directory'], $output, $errors, $this->getNextURL( 'sql_steps', $vars ) . '&id=' . $new_id ); - } - else - { - $output[] = $this->lang->words['redir__nomore_sql']; - - /* Show redirect... */ - $this->showRedirectScreen( $vars['app_directory'], $output, $errors, $this->getNextURL( 'next_check', $vars ) ); - } - } - - /** - * Creates Tables, Runs Inserts, and Indexes - * - * @return @e void - */ - public function sqlBasics() - { - /* INIT */ - $vars = $this->getVars(); - $output = array(); - $errors = array(); - $skipped = 0; - $count = 0; - - /* Any "extra" configs required for this driver? */ - if( is_file( IPS_ROOT_PATH . 'setup/sql/' . strtolower( $this->settings['sql_driver'] ) . '_install.php' ) ) - { - require_once( IPS_ROOT_PATH . 'setup/sql/' . strtolower( $this->settings['sql_driver'] ) . '_install.php' );/*noLibHook*/ - - $extra_install = new install_extra( $this->registry ); - } - - //----------------------------------------- - // Tables - //----------------------------------------- - - $this->DB->return_die = 1; - - if ( is_file( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_tables.php' ) ) - { - $TABLE = array(); - include( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_tables.php' );/*noLibHook*/ - - if ( is_array( $TABLE ) and count( $TABLE ) ) - { - foreach( $TABLE as $q ) - { - //----------------------------------------- - // Is this a create? - //----------------------------------------- - - preg_match("/CREATE TABLE\s+(\S+)(\s)?\(/", str_ireplace( 'if not exists', '', $q ), $match); - - if( $match[1] AND $vars['dupe_tables'] == 'drop' ) - { - $this->DB->dropTable( str_replace( $this->settings['sql_tbl_prefix'], '', $match[1] ) ); - } - else if( $match[1] ) - { - if( $this->DB->getTableSchematic( $match[1] ) ) - { - $skipped++; - continue; - } - } - - //----------------------------------------- - // Is this an alter? - //----------------------------------------- - - preg_match("/ALTER\s+TABLE\s+(\S+)\s+ADD\s+(\S+)\s+/i", $q, $match); - - if( $match[1] AND $match[2] AND $vars['dupe_tables'] == 'drop' ) - { - $this->DB->dropField( str_replace( $this->settings['sql_tbl_prefix'], '', $match[1] ), $match[2] ); - } - else if( $match[1] AND $match[2] ) - { - if( $this->DB->checkForField( $match[2], $match[1] ) ) - { - $skipped++; - continue; - } - } - - if ( $extra_install AND method_exists( $extra_install, 'process_query_create' ) ) - { - $q = $extra_install->process_query_create( $q ); - } - $this->DB->error = ''; - - $this->DB->query( $q ); - - if ( $this->DB->error ) - { - $errors[] = $q."

".$this->DB->error; - } - else - { - $count++; - } - } - } - - $output[] = sprintf( $this->lang->words['redir__sql_tables'], $count, $skipped ); - } - - //--------------------------------------------- - // Create the fulltext index... - //--------------------------------------------- - - if ( $this->DB->checkFulltextSupport() ) - { - if ( is_file( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_fulltext.php' ) ) - { - $INDEX = array(); - include( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_fulltext.php' );/*noLibHook*/ - - $count = 0; - - foreach( $INDEX as $q ) - { - //--------------------------------------------- - // Pass to handler - //--------------------------------------------- - - if ( $extra_install AND method_exists( $extra_install, 'process_query_index' ) ) - { - $q = $extra_install->process_query_index( $q ); - } - - //--------------------------------------------- - // Pass query - //--------------------------------------------- - $this->DB->error = ''; - $this->DB->query( $q ); - - if ( $this->DB->error ) - { - $errors[] = $q."

".$this->DB->error; - } - else - { - $count++; - } - } - - $output[] = sprintf( $this->lang->words['redir__sql_indexes'], $count ); - } - } - - /* INSERTS */ - if ( is_file( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_inserts.php' ) ) - { - $INSERT = array(); - $count = 0; - - /* Get the SQL File */ - include( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_inserts.php' );/*noLibHook*/ - - foreach( $INSERT as $q ) - { - /* Extra Handler */ - if( $extra_install AND method_exists( $extra_install, 'process_query_insert' ) ) - { - $q = $extra_install->process_query_insert( $q ); - } - - $q = str_replace( "<%time%>", time(), $q ); - $this->DB->error = ''; - $this->DB->query( $q ); - - if ( $this->DB->error ) - { - $errors[] = $q."

".$this->DB->error; - } - else - { - $count++; - } - } - - $output[] = sprintf( $this->lang->words['redir__sql_inserts'], $count ); - } - - /* If we did no queries, show something here */ - if ( !count( $output ) ) - { - $output[] = sprintf( $this->lang->words['redir__sql_run'], 0 ); - } - - /* Show Redirect... */ - $this->showRedirectScreen( $vars['app_directory'], $output, $errors, $this->getNextURL( 'sql_steps', $vars ) ); - } - - /** - * Begin installation - * - * @return @e void - */ - public function start() - { - /* INIT */ - $app_directory = IPSText::alphanumericalClean( $this->request['app_directory'] ); - $type = 'upgrade'; - $data = array(); - $ok = 1; - $errors = array(); - $localfiles = array( DOC_IPS_ROOT_PATH . 'cache/skin_cache' ); - $info = array(); - - /* Init Data */ - $data = IPSSetUp::fetchXmlAppInformation( $app_directory, $this->settings['gb_char_set'] ); - $_numbers = IPSSetUp::fetchAppVersionNumbers( $app_directory ); - $_files = IPSSetUp::fetchXmlAppWriteableFiles( $app_directory ); - - /* Grab Data */ - $data['app_directory'] = $app_directory; - $data['current_version'] = ( $_numbers['current'][0] ) ? $_numbers['current'][0] : $this->lang->words['cur_version_none']; - $data['latest_version'] = $_numbers['latest'][1]; - $data['next_version'] = $_numbers['next'][0]; - - /* Install, or upgrade? */ - if ( ! $_numbers['current'][0] ) - { - $type = 'install'; - } - - //----------------------------------------- - // For upgrade, redirect - //----------------------------------------- - - else - { - @header( "Location: {$this->settings['board_url']}/" . CP_DIRECTORY . "/upgrade/" ); - exit; - } - - /* Version Check */ - if( $data['current_version'] > 0 AND $data['current_version'] == $data['latest_version'] ) - { - $this->registry->output->global_message = $this->lang->words['error__up_to_date']; - $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] ); - return; - } - - /* Check local files */ - foreach( $localfiles as $_path ) - { - if ( ! file_exists( $_path ) ) - { - if ( $data['dir'] ) - { - if ( ! @mkdir( $_path, IPS_FOLDER_PERMISSION, TRUE ) ) - { - $info['notexist'][] = $_path; - } - } - else - { - $info['notexist'][] = $_path; - } - } - else if ( ! is_writeable( $_path ) ) - { - if ( ! @chmod( $_path, is_dir( $_path ) ? IPS_FOLDER_PERMISSION : IPS_FILE_PERMISSION ) ) - { - $info['notwrite'][] = $_path; - } - } - } - - /* Check files... */ - if( is_array( $_files ) AND count( $_files ) ) - { - $info = array_merge( $info, $_files ); - } - - if ( count( $info['notexist'] ) ) - { - foreach( $info['notexist'] as $path ) - { - $errors[] = sprintf( $this->lang->words['error__file_missing'], $path ); - } - } - - if ( count( $info['notwrite'] ) ) - { - foreach( $info['notwrite'] as $path ) - { - $errors[] = sprintf( $this->lang->words['error__file_chmod'], $path ); - } - } - - /** - * Custom errors - */ - if ( count( $info['other'] ) ) - { - foreach( $info['other'] as $error ) - { - $errors[] = $error; - } - } - - /* Check for xml files */ - $required_xml = array( - "information", - //"{$app_directory}_modules", - //"{$app_directory}_settings", - //"{$app_directory}_tasks", - //"{$app_directory}_templates", - ); - - foreach( $required_xml as $r ) - { - if( ! is_file( $this->app_full_path . "xml/{$r}.xml" ) ) - { - $errors[] = sprintf( $this->lang->words['error__file_needed'], $this->app_full_path . "xml/{$r}.xml" ); - } - } - - /* Show splash */ - $this->registry->output->html .= $this->html->setup_splash_screen( $data, $errors, $type ); - } - - /** - * Get environment vars - * - * @return array - */ - protected function getVars() - { - /* INIT */ - $env = array(); - - /* Get the infos */ - $env['type'] = strtolower( $this->request['type'] ); - $env['version'] = $this->request['version']; - $env['dupe_tables'] = $this->request['dupe_tables']; - $env['app_directory'] = $this->request['app_directory']; - - $env['app_location'] = 'other'; - - if( $this->product_information['ipskey'] ) - { - if ( strstr( $this->app_full_path, 'applications_addon/ips' ) or strstr( $this->app_full_path, 'applications/' ) ) - { - if ( md5( 'ips_' . basename($this->app_full_path) ) == $this->product_information['ipskey'] ) - { - $env['app_location'] = 'ips'; - } - } - } - - $env['path'] = ( $env['type'] == 'install' ) ? $this->app_full_path . 'setup/versions/install' - : $this->app_full_path . 'setup/versions/' . $env['version']; - - return $env; - } - - /** - * Get next action URL - * - * @param string $next_action - * @param array $env - * @return string - */ - protected function getNextURL( $next_action, $env ) - { - return $this->settings['base_url'] . $this->form_code . '&do=' . $next_action . '&app_directory=' . $env['app_directory'] . '&type=' . $env['type'] . '&version=' . $env['version']; - } - - /** - * Show the redirect screen - * - * @param string $app_directory - * @param string $output - * @param string $errors - * @param string $next_url - * @return @e void - */ - protected function showRedirectScreen( $app_directory, $output, $errors, $next_url ) - { - /* Init Data */ - $data = IPSSetUp::fetchXmlAppInformation( $app_directory, $this->settings['gb_char_set'] ); - $_numbers = IPSSetUp::fetchAppVersionNumbers( $app_directory ); - - /* Grab Data */ - $data['app_directory'] = $app_directory; - $data['current_version'] = ( $_numbers['current'][0] ) ? $_numbers['current'][0] : $this->lang->words['cur_version_none']; - $data['latest_version'] = $_numbers['latest'][1]; - $data['next_version'] = $_numbers['next'][0]; - - /* Setup Redirect */ - $this->registry->output->html .= $this->html->setup_redirectScreen( $output, $errors, $next_url ); - } + + * Invision Power Services + * IP.Board v3.4.6 + * Application Installation + * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $ + *
+ * + * @author $Author: bfarber $ + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license http://www.invisionpower.com/company/standards.php#license + * @package IP.Board + * @subpackage Core + * @link http://www.invisionpower.com + * @version $Rev: 10721 $ + */ + +if ( ! defined( 'IN_ACP' ) ) +{ + print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; + exit(); +} + + +class admin_core_applications_setup extends ipsCommand +{ + /** + * Skin object + * + * @var object Skin templates + */ + protected $html; + + /** + * Shortcut for url + * + * @var string URL shortcut + */ + protected $form_code; + + /** + * Shortcut for url (javascript) + * + * @var string JS URL shortcut + */ + protected $form_code_js; + + /** + * Current app path + * + * @var object + */ + protected $app_full_path; + + /** + * Product information + * + * @var array + */ + protected $product_information; + + /** + * Main class entry point + * + * @param object ipsRegistry reference + * @return @e void [Outputs to screen] + */ + public function doExecute( ipsRegistry $registry ) + { + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'app_install' ); + + /* Get Template and Language */ + $this->html = $this->registry->output->loadTemplate( 'cp_skin_setup' ); + + $this->lang->loadLanguageFile( array( 'admin_setup', 'admin_system', 'admin_tools', 'admin_templates' ), 'core' ); + + /* URL Bits */ + $this->form_code = $this->html->form_code = 'module=applications&section=setup'; + $this->form_code_js = $this->html->form_code_js = 'module=applications§ion=setup'; + + /* Get the setup class */ + require( IPS_ROOT_PATH . "setup/sources/base/setup.php" );/*noLibHook*/ + + /* Set the path */ + $this->app_full_path = IPSLib::getAppDir( $this->request['app_directory'] ) . '/'; + + /* Set up product info from XML file */ + $this->product_information = IPSSetUp::fetchXmlAppInformation( $this->request['app_directory'], $this->settings['gb_char_set'] ); + + if( ! $this->app_full_path OR ! $this->product_information['title'] ) + { + $this->registry->output->global_message = $this->lang->words['error__cannot_init']; + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] ); + return; + } + + /* Sequence of Events: + # SQL + # App Module + # Check for more modules + # Templates + # Languages + # Tasks + # Settings + # Template Cache + # Caches / Done + */ + switch( $this->request['do'] ) + { + default: + case 'start': + $this->start(); + break; + case 'sql': + $this->sqlBasics(); + break; + case 'sql_steps': + $this->sqlSteps(); + break; + case 'next_check': + $this->nextCheck(); + break; + + case 'templates': + $this->templates(); + break; + case 'languages': + $this->languages(); + break; + case 'tasks': + $this->tasks(); + break; + case 'bbcode': + $this->bbcode(); + break; + case 'help': + $this->help(); + break; + case 'settings': + $this->settings(); + break; + case 'hooks': + $this->hooks(); + break; + case 'tplcache': + $this->recacheTemplates(); + break; + case 'finish': + $this->finish(); + break; + } + + $this->registry->getClass('output')->html_main .= $this->registry->getClass('output')->global_template->global_frame_wrapper(); + $this->registry->getClass('output')->sendOutput(); + } + + /** + * Rebuild PHP Templates Cache + * + * @return @e void + */ + public function recacheTemplates() + { + /* Flag skins for recache */ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + $skinCaching = new skinCaching( $this->registry ); + + /* Flag all for recache */ + $skinCaching->flagSetForRecache(); + + $data = $this->getVars(); + + $this->showRedirectScreen( $data['app_directory'], array( $this->lang->words['install_skins_flag_recache'] ), '', $this->getNextURL( 'finish', $data ) ); + } + + /** + * Finalizes installation and rebuilds caches + * + * @return @e void + */ + public function finish() + { + /* INIT */ + $vars = $this->getVars(); + $output = array(); + $errors = array(); + + /* Init Data */ + $data = IPSSetUp::fetchXmlAppInformation( $vars['app_directory'], $this->settings['gb_char_set'] ); + $_numbers = IPSSetUp::fetchAppVersionNumbers( $vars['app_directory'] ); + + /* Grab Data */ + $data['app_directory'] = $vars['app_directory']; + $data['current_version'] = ( $_numbers['current'][0] ) ? $_numbers['current'][0] : $this->lang->words['cur_version_none']; + $data['latest_version'] = $_numbers['latest'][1]; + $data['next_version'] = $_numbers['next'][0]; + + /* Rebuild applications and modules cache */ + $this->cache->rebuildCache( 'app_cache', 'global' ); + $this->cache->rebuildCache( 'module_cache', 'global' ); + $this->cache->rebuildCache( 'app_menu_cache', 'global' ); + $this->cache->rebuildCache( 'group_cache', 'global' ); + $this->cache->rebuildCache( 'notifications', 'global' ); + $this->cache->rebuildCache( 'report_plugins', 'global' ); + + /* Rebuild application specific caches */ + $_file = $this->app_full_path . 'extensions/coreVariables.php'; + + if( is_file( $_file ) ) + { + $CACHE = array(); + require( $_file );/*noLibHook*/ + + if( is_array( $CACHE ) AND count( $CACHE ) ) + { + foreach( $CACHE as $key => $cdata ) + { + $this->cache->rebuildCache( $key, $vars['app_directory'] ); + } + } + } + + /* Rebuild GLOBAL CACHES! */ + try + { + IPSLib::cacheGlobalCaches(); + } + catch( Exception $e ) + { + // Show an error? + } + + /* Rebuild FURLs */ + if( is_file( $this->app_full_path . 'extensions/furlTemplates.php' ) ) + { + try + { + IPSLib::cacheFurlTemplates(); + } + catch( Exception $e ) + { + // Show an error? + } + } + + /* Show completed screen... */ + $this->registry->output->html .= $this->html->setup_completed_screen( $data, $vars['type'] ); + } + + /** + * Next Check + * + * @return @e void + */ + public function nextCheck() + { + /* INIT */ + $vars = $this->getVars(); + $output = array(); + $errors = array(); + + /* Init Data */ + $data = IPSSetUp::fetchXmlAppInformation( $vars['app_directory'], $this->settings['gb_char_set'] ); + $_numbers = IPSSetUp::fetchAppVersionNumbers( $vars['app_directory'] ); + $modules = IPSSetUp::fetchXmlAppModules( $vars['app_directory'], $this->settings['gb_char_set'] ); + + /* Grab Data */ + $data['app_directory'] = $vars['app_directory']; + $data['current_version'] = ( $_numbers['current'][0] ) ? $_numbers['current'][0] : $this->lang->words['cur_version_none']; + $data['latest_version'] = $_numbers['latest'][1]; + $data['next_version'] = $_numbers['next'][0]; + + /* Update the app DB */ + if( $vars['type'] == 'install' ) + { + /* Get current max position */ + $pos = $this->DB->buildAndFetch( array( 'select' => 'MAX(app_position) as pos', 'from' => 'core_applications' ) ); + $new_pos = intval( $pos['pos'] ) + 1; + + /* Insert details into the DB */ + $this->DB->insert( 'core_applications', array( 'app_title' => $this->product_information['name'], + 'app_public_title' => $this->product_information['public_name'], + 'app_author' => $this->product_information['author'], + 'app_description' => $this->product_information['description'], + 'app_hide_tab' => intval($this->product_information['hide_tab']), + 'app_version' => $_numbers['latest'][1], + 'app_long_version' => $_numbers['latest'][0], + 'app_directory' => $vars['app_directory'], + 'app_location' => $vars['app_location'], + 'app_added' => time(), + 'app_position' => $new_pos, + 'app_protected' => 0, + 'app_enabled' => $this->product_information['disabledatinstall'] ? 0 : 1, + 'app_website' => trim($this->product_information['website']), + 'app_update_check' => trim($this->product_information['update_check']), + 'app_global_caches' => trim($this->product_information['global_caches']), + ) + ); + + $this->DB->insert( 'upgrade_history', array( + 'upgrade_version_id' => $_numbers['latest'][0], + 'upgrade_version_human' => $_numbers['latest'][1], + 'upgrade_date' => time(), + 'upgrade_notes' => '', + 'upgrade_mid' => $this->memberData['member_id'], + 'upgrade_app' => $vars['app_directory'], + ) ); + + /* Insert the modules */ + foreach( $modules as $key => $module ) + { + $this->DB->insert( 'core_sys_module', $module ); + } + } + else + { + $this->DB->update( 'core_applications', array( 'app_title' => $this->product_information['name'], + 'app_public_title' => $this->product_information['public_name'], + 'app_author' => $this->product_information['author'], + 'app_description' => $this->product_information['description'], + 'app_hide_tab' => intval($this->product_information['hide_tab']), + 'app_version' => $_numbers['current'][1], + 'app_long_version' => $_numbers['current'][0], + 'app_website' => trim($this->product_information['website']), + 'app_update_check' => trim($this->product_information['update_check']), + 'app_global_caches' => trim($this->product_information['global_caches']), + ), "app_directory='" . $vars['app_directory'] . "'" ); + + /* Update the modules */ + foreach( $modules as $key => $module ) + { + $this->DB->update( 'core_sys_module', $module, "sys_module_application='{$module['sys_module_application']}' AND sys_module_key='{$module['sys_module_key']}'" ); + } + } + + /* Finish? */ + if( $vars['type'] == 'install' OR $vars['version'] == $_numbers['latest'][0] ) + { + /* Go back and start over with the new version */ + $output[] = $this->lang->words['redir__nomore_modules']; + + $this->showRedirectScreen( $vars['app_directory'], $output, $errors, $this->getNextURL( 'templates', $vars ) ); + } + else + { + /* Go back and start over with the new version */ + $output[] = sprintf( $this->lang->words['redir__upgraded_to'], $_numbers['current'][1] ); + + /* Work out the next step */ + $vars['version'] = $_numbers['next'][0]; + + $this->showRedirectScreen( $vars['app_directory'], $output, $errors, $this->getNextURL( 'sql', $vars ) ); + } + } + + /** + * Import Hooks + * + * @return @e void + */ + public function hooks() + { + /* INIT */ + $vars = $this->getVars(); + $output = array(); + $errors = array(); + $knownSettings = array(); + + $this->registry->class_localization->loadLanguageFile( array( 'admin_tools' ) ); + + if( is_file( $this->app_full_path . 'xml/hooks.xml' ) ) + { + /* Get the hooks class */ + $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/applications/hooks.php', 'admin_core_applications_hooks' ); + $hooks = new $classToLoad(); + $hooks->makeRegistryShortcuts( $this->registry ); + + $return = $hooks->installAppHooks( $vars['app_directory'] ); + $this->cache->rebuildCache( 'hooks', 'global' ); + + $output[] = sprintf( $this->lang->words['redir__hooks'], $return['inserted'], $return['updated'] ); + } + else + { + $this->registry->output->global_message = $this->lang->words['hooks_nofile']; + + $output[] = $this->registry->output->global_message; + } + + /* Clear main messaage */ + $this->registry->output->global_message = ''; + + /* Show redirect... */ + $this->showRedirectScreen( $vars['app_directory'], $output, $errors, $this->getNextURL( 'tplcache', $vars ) ); + } + + /** + * Import Settings + * + * @return @e void + */ + public function settings() + { + /* INIT */ + $vars = $this->getVars(); + $output = array(); + $errors = array(); + $knownSettings = array(); + + $this->registry->class_localization->loadLanguageFile( array( 'admin_tools' ), 'core' ); + + if( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_settings.xml' ) ) + { + /* Get the settings class */ + $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/settings/settings.php', 'admin_core_settings_settings' ); + $settings = new $classToLoad(); + $settings->makeRegistryShortcuts( $this->registry ); + + $this->request['app_dir'] = $vars['app_directory']; + + //----------------------------------------- + // Known settings + //----------------------------------------- + + if ( substr( $this->settings['_original_base_url'], -1 ) == '/' ) + { + IPSSetUp::setSavedData('install_url', substr( $this->settings['_original_base_url'], 0, -1 ) ); + } + + if ( substr( $this->settings['base_dir'], -1 ) == '/' ) + { + IPSSetUp::setSavedData('install_dir', substr( $this->settings['base_dir'], 0, -1 ) ); + } + + /* Fetch known settings */ + if ( is_file( IPSLib::getAppDir( $vars['app_directory'] ) . '/setup/versions/install/knownSettings.php' ) ) + { + require( IPSLib::getAppDir( $vars['app_directory'] ) . '/setup/versions/install/knownSettings.php' );/*noLibHook*/ + } + + $settings->importAllSettings( 1, 1, $knownSettings ); + $settings->settingsRebuildCache(); + } + else + { + $this->registry->output->global_message = $this->lang->words['settings_nofile']; + } + + $output[] = $this->registry->output->global_message; + + /* Clear main messaage */ + $this->registry->output->global_message = ''; + + /* Show redirect... */ + $this->showRedirectScreen( $vars['app_directory'], $output, $errors, $this->getNextURL( 'hooks', $vars ) ); + } + + /** + * Import tasks + * + * @return @e void + */ + public function tasks() + { + /* INIT */ + $vars = $this->getVars(); + $output = array(); + $errors = array(); + + if( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_tasks.xml' ) ) + { + /* Get the language class */ + $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/system/taskmanager.php', 'admin_core_system_taskmanager' ); + $task_obj = new $classToLoad(); + $task_obj->makeRegistryShortcuts( $this->registry ); + + $task_obj->tasksImportFromXML( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_tasks.xml', true ); + } + + $output[] = $this->registry->output->global_message ? $this->registry->output->global_message : $this->lang->words['no_tasks_for_import']; + + /* Clear main msg */ + $this->registry->output->global_message = ''; + + /* Show redirect... */ + $this->showRedirectScreen( $vars['app_directory'], $output, $errors, $this->getNextURL( 'bbcode', $vars ) ); + } + + /** + * Import bbcode + * + * @return @e void + */ + public function bbcode() + { + /* INIT */ + $vars = $this->getVars(); + $output = array(); + $errors = array(); + + if( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_bbcode.xml' ) ) + { + /* Get the language class */ + $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/posts/bbcode.php', 'admin_core_posts_bbcode' ); + $bbcode = new $classToLoad(); + $bbcode->makeRegistryShortcuts( $this->registry ); + + $bbcode->bbcodeImportDo( file_get_contents( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_bbcode.xml' ) ); + + $output[] = $this->lang->words['bbcode_and_media']; + } + + if( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_mediatag.xml' ) ) + { + /* Get the language class */ + $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/posts/media.php', 'admin_core_posts_media' ); + $bbcode = new $classToLoad(); + $bbcode->makeRegistryShortcuts( $this->registry ); + + $bbcode->doMediaImport( file_get_contents( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_mediatag.xml' ) ); + + if( !count($output) ) + { + $output[] = $this->lang->words['bbcode_and_media']; + } + } + + if( !count($output) ) + { + $output[] = $this->lang->words['no_bbcode_media']; + } + + /* Show redirect... */ + $this->showRedirectScreen( $vars['app_directory'], $output, $errors, $this->getNextURL( 'help', $vars ) ); + } + + /** + * Import help + * + * @return @e void + */ + public function help() + { + /* INIT */ + $vars = $this->getVars(); + $output = array(); + $errors = array(); + + if( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_help.xml' ) ) + { + $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/tools/help.php', 'admin_core_tools_help' ); + $help = new $classToLoad(); + $help->makeRegistryShortcuts( $this->registry ); + + $done = $help->helpFilesXMLImport_app( $vars['app_directory'] ); + + $output[] = sprintf( $this->lang->words['imported_x_help'], ($done['added'] + $done['updated']) ); + } + else + { + $output[] = $this->lang->words['imported_no_help']; + } + + + /* Show redirect... */ + $this->showRedirectScreen( $vars['app_directory'], $output, $errors, $this->getNextURL( 'settings', $vars ) ); + } + + /** + * Language Import + * + * @return @e void + */ + public function languages() + { + /* INIT */ + $vars = $this->getVars(); + $output = array(); + $errors = array(); + + /* Load the language file */ + $this->registry->class_localization->loadLanguageFile( array( 'admin_system' ) ); + + /* Get the language stuff */ + $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/languages/manage_languages.php', 'admin_core_languages_manage_languages' ); + $lang = new $classToLoad(); + $lang->makeRegistryShortcuts( $this->registry ); + + /* Loop through the xml directory and look for lang packs */ + $_PATH = $this->app_full_path . '/xml/'; + + try + { + foreach( new DirectoryIterator( $_PATH ) as $f ) + { + if( preg_match( "#(.+?)_language_pack.xml#", $f->getFileName() ) ) + { + $this->request['file_location'] = $_PATH . $f->getFileName(); + $lang->imprtFromXML( true, true, true, $vars['app_directory'] ); + } + } + } catch ( Exception $e ) {} + + $output[] = $this->registry->output->global_message ? $this->registry->output->global_message : $this->lang->words['redir__nolanguages']; + + /* Clear main msg */ + $this->registry->output->global_message = ''; + + /* Show redirect... */ + $this->showRedirectScreen( $vars['app_directory'], $output, $errors, $this->getNextURL( 'tasks', $vars ) ); + } + + /** + * Install templates + * + * @return @e void + */ + public function templates() + { + /* INIT */ + $vars = $this->getVars(); + $output = array(); + $errors = array(); + + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinImportExport.php' );/*noLibHook*/ + $skinFunctions = new skinImportExport( $this->registry ); + $skinCaching = new skinCaching( $this->registry ); + + /* Grab skin data */ + $this->DB->build( array( 'select' => '*', + 'from' => 'skin_collections' ) ); + + $this->DB->execute(); + + while( $row = $this->DB->fetch() ) + { + /* Bit of jiggery pokery... */ + if ( $row['set_key'] == 'default' ) + { + $row['set_key'] = 'root'; + $row['set_id'] = 0; + } + + $skinSets[ $row['set_key'] ] = $row; + } + + foreach( $skinSets as $skinKey => $skinData ) + { + /* Skin files first */ + if( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_' . $skinKey . '_templates.xml' ) ) + { + $return = $skinFunctions->importTemplateAppXML( $vars['app_directory'], $skinKey, $skinData['set_id'], TRUE ); + + $output[] = sprintf( $this->lang->words['redir__templates'], $return['insertCount'], $return['updateCount'], $skinData['set_name'] ); + } + + /* Then CSS files */ + if ( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_' . $skinKey . '_css.xml' ) ) + { + //----------------------------------------- + // Install + //----------------------------------------- + + $return = $skinFunctions->importCSSAppXML( $vars['app_directory'], $skinKey, $skinData['set_id'] ); + + $output[] = sprintf( $this->lang->words['redir__cssfiles'], $return['insertCount'], $return['updateCount'], $skinData['set_name'] ); + } + + /* And we can support replacements for good measure */ + if ( is_file( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_replacements.xml' ) ) + { + //----------------------------------------- + // Install + //----------------------------------------- + + $return = $skinFunctions->importReplacementsXMLArchive( file_get_contents( $this->app_full_path . 'xml/' . $vars['app_directory'] . '_replacements.xml' ), $skinKey ); + + $output[] = $this->lang->words['redir__replacements']; + } + } + + /* Recache */ + //$skinCaching->rebuildPHPTemplates( 0 ); + //$skinCaching->rebuildCSS( 0 ); + //$skinCaching->rebuildReplacementsCache( 0 ); + + /* No templates? Give some sort of feedback */ + if ( !count( $output ) ) + { + $output[] = $this->lang->words['redir__no_templates']; + } + + /* Show redirect... */ + $this->showRedirectScreen( $vars['app_directory'], $output, $errors, $this->getNextURL( 'languages', $vars ) ); + } + + /** + * Runs any additional sql files + * + * @return @e void + */ + public function sqlSteps() + { + /* INIT */ + $vars = $this->getVars(); + $output = array(); + $errors = array(); + $id = intval( $this->request['id'] ); + $id = ( $id < 1 ) ? 1 : $id; + $sql_files = array(); + + /* Any "extra" configs required for this driver? */ + if( is_file( IPS_ROOT_PATH . 'setup/sql/' . strtolower( $this->settings['sql_driver'] ) . '_install.php' ) ) + { + require_once( IPS_ROOT_PATH . 'setup/sql/' . strtolower( $this->settings['sql_driver'] ) . '_install.php' );/*noLibHook*/ + + $extra_install = new install_extra( $this->registry ); + } + + + /* Run any sql files we found */ + if( is_file( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ips_DBRegistry::getDriverType() ) . '_sql_' . $id .'.php' ) ) + { + /* INIT */ + $new_id = $id + 1; + $count = 0; + $SQL = array(); + + /* Get the sql file */ + require_once( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ips_DBRegistry::getDriverType() ) . '_sql_' . $id .'.php' );/*noLibHook*/ + + $this->DB->return_die = 1; + + /* Run the queries */ + foreach( $SQL as $query ) + { + $this->DB->allow_sub_select = 1; + $this->DB->error = ''; + + $query = str_replace( "<%time%>", time(), $query ); + + if( $extra_install AND method_exists( $extra_install, 'process_query_insert' ) ) + { + $query = $extra_install->process_query_insert( $query ); + } + + $this->DB->query( $query ); + + if ( $this->DB->error ) + { + $errors[] = $query."

".$this->DB->error; + } + else + { + $count++; + } + } + + $output[] = sprintf( $this->lang->words['redir__sql_run'], $count ); + + /* Show redirect... */ + $this->showRedirectScreen( $vars['app_directory'], $output, $errors, $this->getNextURL( 'sql_steps', $vars ) . '&id=' . $new_id ); + } + else + { + $output[] = $this->lang->words['redir__nomore_sql']; + + /* Show redirect... */ + $this->showRedirectScreen( $vars['app_directory'], $output, $errors, $this->getNextURL( 'next_check', $vars ) ); + } + } + + /** + * Creates Tables, Runs Inserts, and Indexes + * + * @return @e void + */ + public function sqlBasics() + { + /* INIT */ + $vars = $this->getVars(); + $output = array(); + $errors = array(); + $skipped = 0; + $count = 0; + + /* Any "extra" configs required for this driver? */ + if( is_file( IPS_ROOT_PATH . 'setup/sql/' . strtolower( $this->settings['sql_driver'] ) . '_install.php' ) ) + { + require_once( IPS_ROOT_PATH . 'setup/sql/' . strtolower( $this->settings['sql_driver'] ) . '_install.php' );/*noLibHook*/ + + $extra_install = new install_extra( $this->registry ); + } + + //----------------------------------------- + // Tables + //----------------------------------------- + + $this->DB->return_die = 1; + + if ( is_file( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_tables.php' ) ) + { + $TABLE = array(); + include( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_tables.php' );/*noLibHook*/ + + if ( is_array( $TABLE ) and count( $TABLE ) ) + { + foreach( $TABLE as $q ) + { + //----------------------------------------- + // Is this a create? + //----------------------------------------- + + preg_match("/CREATE TABLE\s+(\S+)(\s)?\(/", str_ireplace( 'if not exists', '', $q ), $match); + + if( $match[1] AND $vars['dupe_tables'] == 'drop' ) + { + $this->DB->dropTable( str_replace( $this->settings['sql_tbl_prefix'], '', $match[1] ) ); + } + else if( $match[1] ) + { + if( $this->DB->getTableSchematic( $match[1] ) ) + { + $skipped++; + continue; + } + } + + //----------------------------------------- + // Is this an alter? + //----------------------------------------- + + preg_match("/ALTER\s+TABLE\s+(\S+)\s+ADD\s+(\S+)\s+/i", $q, $match); + + if( $match[1] AND $match[2] AND $vars['dupe_tables'] == 'drop' ) + { + $this->DB->dropField( str_replace( $this->settings['sql_tbl_prefix'], '', $match[1] ), $match[2] ); + } + else if( $match[1] AND $match[2] ) + { + if( $this->DB->checkForField( $match[2], $match[1] ) ) + { + $skipped++; + continue; + } + } + + if ( $extra_install AND method_exists( $extra_install, 'process_query_create' ) ) + { + $q = $extra_install->process_query_create( $q ); + } + $this->DB->error = ''; + + $this->DB->query( $q ); + + if ( $this->DB->error ) + { + $errors[] = $q."

".$this->DB->error; + } + else + { + $count++; + } + } + } + + $output[] = sprintf( $this->lang->words['redir__sql_tables'], $count, $skipped ); + } + + //--------------------------------------------- + // Create the fulltext index... + //--------------------------------------------- + + if ( $this->DB->checkFulltextSupport() ) + { + if ( is_file( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_fulltext.php' ) ) + { + $INDEX = array(); + include( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_fulltext.php' );/*noLibHook*/ + + $count = 0; + + foreach( $INDEX as $q ) + { + //--------------------------------------------- + // Pass to handler + //--------------------------------------------- + + if ( $extra_install AND method_exists( $extra_install, 'process_query_index' ) ) + { + $q = $extra_install->process_query_index( $q ); + } + + //--------------------------------------------- + // Pass query + //--------------------------------------------- + $this->DB->error = ''; + $this->DB->query( $q ); + + if ( $this->DB->error ) + { + $errors[] = $q."

".$this->DB->error; + } + else + { + $count++; + } + } + + $output[] = sprintf( $this->lang->words['redir__sql_indexes'], $count ); + } + } + + /* INSERTS */ + if ( is_file( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_inserts.php' ) ) + { + $INSERT = array(); + $count = 0; + + /* Get the SQL File */ + include( $this->app_full_path . 'setup/versions/install/sql/' . $vars['app_directory']. '_' . strtolower( ipsRegistry::dbFunctions()->getDriverType() ) . '_inserts.php' );/*noLibHook*/ + + foreach( $INSERT as $q ) + { + /* Extra Handler */ + if( $extra_install AND method_exists( $extra_install, 'process_query_insert' ) ) + { + $q = $extra_install->process_query_insert( $q ); + } + + $q = str_replace( "<%time%>", time(), $q ); + $this->DB->error = ''; + $this->DB->query( $q ); + + if ( $this->DB->error ) + { + $errors[] = $q."

".$this->DB->error; + } + else + { + $count++; + } + } + + $output[] = sprintf( $this->lang->words['redir__sql_inserts'], $count ); + } + + /* If we did no queries, show something here */ + if ( !count( $output ) ) + { + $output[] = sprintf( $this->lang->words['redir__sql_run'], 0 ); + } + + /* Show Redirect... */ + $this->showRedirectScreen( $vars['app_directory'], $output, $errors, $this->getNextURL( 'sql_steps', $vars ) ); + } + + /** + * Begin installation + * + * @return @e void + */ + public function start() + { + /* INIT */ + $app_directory = IPSText::alphanumericalClean( $this->request['app_directory'] ); + $type = 'upgrade'; + $data = array(); + $ok = 1; + $errors = array(); + $localfiles = array( DOC_IPS_ROOT_PATH . 'cache/skin_cache' ); + $info = array(); + + /* Init Data */ + $data = IPSSetUp::fetchXmlAppInformation( $app_directory, $this->settings['gb_char_set'] ); + $_numbers = IPSSetUp::fetchAppVersionNumbers( $app_directory ); + $_files = IPSSetUp::fetchXmlAppWriteableFiles( $app_directory ); + + /* Grab Data */ + $data['app_directory'] = $app_directory; + $data['current_version'] = ( $_numbers['current'][0] ) ? $_numbers['current'][0] : $this->lang->words['cur_version_none']; + $data['latest_version'] = $_numbers['latest'][1]; + $data['next_version'] = $_numbers['next'][0]; + + /* Install, or upgrade? */ + if ( ! $_numbers['current'][0] ) + { + $type = 'install'; + } + + //----------------------------------------- + // For upgrade, redirect + //----------------------------------------- + + else + { + @header( "Location: {$this->settings['board_url']}/" . CP_DIRECTORY . "/upgrade/" ); + exit; + } + + /* Version Check */ + if( $data['current_version'] > 0 AND $data['current_version'] == $data['latest_version'] ) + { + $this->registry->output->global_message = $this->lang->words['error__up_to_date']; + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] ); + return; + } + + /* Check local files */ + foreach( $localfiles as $_path ) + { + if ( ! file_exists( $_path ) ) + { + if ( $data['dir'] ) + { + if ( ! @mkdir( $_path, IPS_FOLDER_PERMISSION, TRUE ) ) + { + $info['notexist'][] = $_path; + } + } + else + { + $info['notexist'][] = $_path; + } + } + else if ( ! is_writeable( $_path ) ) + { + if ( ! @chmod( $_path, is_dir( $_path ) ? IPS_FOLDER_PERMISSION : IPS_FILE_PERMISSION ) ) + { + $info['notwrite'][] = $_path; + } + } + } + + /* Check files... */ + if( is_array( $_files ) AND count( $_files ) ) + { + $info = array_merge( $info, $_files ); + } + + if ( count( $info['notexist'] ) ) + { + foreach( $info['notexist'] as $path ) + { + $errors[] = sprintf( $this->lang->words['error__file_missing'], $path ); + } + } + + if ( count( $info['notwrite'] ) ) + { + foreach( $info['notwrite'] as $path ) + { + $errors[] = sprintf( $this->lang->words['error__file_chmod'], $path ); + } + } + + /** + * Custom errors + */ + if ( count( $info['other'] ) ) + { + foreach( $info['other'] as $error ) + { + $errors[] = $error; + } + } + + /* Check for xml files */ + $required_xml = array( + "information", + //"{$app_directory}_modules", + //"{$app_directory}_settings", + //"{$app_directory}_tasks", + //"{$app_directory}_templates", + ); + + foreach( $required_xml as $r ) + { + if( ! is_file( $this->app_full_path . "xml/{$r}.xml" ) ) + { + $errors[] = sprintf( $this->lang->words['error__file_needed'], $this->app_full_path . "xml/{$r}.xml" ); + } + } + + /* Show splash */ + $this->registry->output->html .= $this->html->setup_splash_screen( $data, $errors, $type ); + } + + /** + * Get environment vars + * + * @return array + */ + protected function getVars() + { + /* INIT */ + $env = array(); + + /* Get the infos */ + $env['type'] = strtolower( $this->request['type'] ); + $env['version'] = $this->request['version']; + $env['dupe_tables'] = $this->request['dupe_tables']; + $env['app_directory'] = $this->request['app_directory']; + + $env['app_location'] = 'other'; + + if( $this->product_information['ipskey'] ) + { + if ( strstr( $this->app_full_path, 'applications_addon/ips' ) or strstr( $this->app_full_path, 'applications/' ) ) + { + if ( md5( 'ips_' . basename($this->app_full_path) ) == $this->product_information['ipskey'] ) + { + $env['app_location'] = 'ips'; + } + } + } + + $env['path'] = ( $env['type'] == 'install' ) ? $this->app_full_path . 'setup/versions/install' + : $this->app_full_path . 'setup/versions/' . $env['version']; + + return $env; + } + + /** + * Get next action URL + * + * @param string $next_action + * @param array $env + * @return string + */ + protected function getNextURL( $next_action, $env ) + { + return $this->settings['base_url'] . $this->form_code . '&do=' . $next_action . '&app_directory=' . $env['app_directory'] . '&type=' . $env['type'] . '&version=' . $env['version']; + } + + /** + * Show the redirect screen + * + * @param string $app_directory + * @param string $output + * @param string $errors + * @param string $next_url + * @return @e void + */ + protected function showRedirectScreen( $app_directory, $output, $errors, $next_url ) + { + /* Init Data */ + $data = IPSSetUp::fetchXmlAppInformation( $app_directory, $this->settings['gb_char_set'] ); + $_numbers = IPSSetUp::fetchAppVersionNumbers( $app_directory ); + + /* Grab Data */ + $data['app_directory'] = $app_directory; + $data['current_version'] = ( $_numbers['current'][0] ) ? $_numbers['current'][0] : $this->lang->words['cur_version_none']; + $data['latest_version'] = $_numbers['latest'][1]; + $data['next_version'] = $_numbers['next'][0]; + + /* Setup Redirect */ + $this->registry->output->html .= $this->html->setup_redirectScreen( $output, $errors, $next_url ); + } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/applications/xml/index.html b/upload/admin/applications/core/modules_admin/applications/xml/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/applications/xml/index.html +++ b/upload/admin/applications/core/modules_admin/applications/xml/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/applications/xml/menu.xml b/upload/admin/applications/core/modules_admin/applications/xml/menu.xml index fe80ab4c..9289483c 100644 --- a/upload/admin/applications/core/modules_admin/applications/xml/menu.xml +++ b/upload/admin/applications/core/modules_admin/applications/xml/menu.xml @@ -2,10 +2,10 @@ - Управление Приложениями + Manage Applications & Modules - Управление Приложениями + Manage Applications & Modules manage_apps_modules applications do=applications_overview @@ -15,10 +15,10 @@ - Управление Хуками + Manage Hooks - Управление Хуками + Manage Hooks manage_hooks hooks do=hooks_overview @@ -28,10 +28,10 @@ - Расширения + Community Enhancements - Расширения + Community Enhancements community_enhancements enhancements diff --git a/upload/admin/applications/core/modules_admin/applications/xml/permissions.xml b/upload/admin/applications/core/modules_admin/applications/xml/permissions.xml index 4e775053..b8628764 100644 --- a/upload/admin/applications/core/modules_admin/applications/xml/permissions.xml +++ b/upload/admin/applications/core/modules_admin/applications/xml/permissions.xml @@ -1,72 +1,72 @@ - Управление приложениями + Manage Applications core_manage_apps app_manage - Может изменять/добавлять приложения? + Can manage applications? app_delete - Может удалять приложения? + Can delete applications? app_install - Может устанавливать новые приложения? + Can install new applications? build_sphinx - Может создавать sphinx.conf? ВНИМАНИЕ: будут доступны данные для соединения с базой данных + Can build sphinx.conf? WARNING: Exposes database login details - Управление модулями + Manage Modules core_manage_modules module_manage - Может изменять/добавлять модули? + Can edit/add application modules? module_delete - Может удалять модули приложений? + Can delete application modules? - Покупка приложений + Purchase Applications core_purchase_app purchase_app - Может просматривать страницу с платными приложениями? + Can view pages to purchase additional applications? - Управление хуками + Manage Hooks core_manage_hooks hooks_manage - Может добавлять/изменять хуки? + Can manage hooks? hooks_delete - Может удалять хуки? + Can remove hooks? - Расширения для Сообщества + Community Enhancements core_community_enhancements enhancements_manage - Может управлять расширениями? + Can manage community enhancements? diff --git a/upload/admin/applications/core/modules_admin/attach/attach.php b/upload/admin/applications/core/modules_admin/attach/attach.php index f226751a..9266788e 100644 --- a/upload/admin/applications/core/modules_admin/attach/attach.php +++ b/upload/admin/applications/core/modules_admin/attach/attach.php @@ -2,7 +2,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Attachment Poster
  * Last Updated: $Date: 2012-05-21 21:37:50 +0100 (Mon, 21 May 2012) $
  * 
diff --git a/upload/admin/applications/core/modules_admin/attach/index.html b/upload/admin/applications/core/modules_admin/attach/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/attach/index.html +++ b/upload/admin/applications/core/modules_admin/attach/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/diagnostics/defaultSection.php b/upload/admin/applications/core/modules_admin/diagnostics/defaultSection.php index e17551f1..724ed669 100644 --- a/upload/admin/applications/core/modules_admin/diagnostics/defaultSection.php +++ b/upload/admin/applications/core/modules_admin/diagnostics/defaultSection.php @@ -7,7 +7,7 @@ * $Author: ips_terabyte $ * @since 20th February 2002 * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 8655 $ */ diff --git a/upload/admin/applications/core/modules_admin/diagnostics/diagnostics.php b/upload/admin/applications/core/modules_admin/diagnostics/diagnostics.php index 14dc0650..4c00b98c 100644 --- a/upload/admin/applications/core/modules_admin/diagnostics/diagnostics.php +++ b/upload/admin/applications/core/modules_admin/diagnostics/diagnostics.php @@ -1,824 +1,823 @@ - - * Invision Power Services - * IP.Board v3.4.5 - * Diagnostic tools - * Last Updated: $Date: 2013-04-15 17:26:30 -0400 (Mon, 15 Apr 2013) $ - *
- * - * @author $Author: AndyMillne $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/company/standards.php#license - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com - * @since 1st march 2002 - * @version $Revision: 12179 $ - */ - -if ( ! defined( 'IN_ACP' ) ) -{ - print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; - exit(); -} - - -class admin_core_diagnostics_diagnostics extends ipsCommand -{ - /** - * Skin object - * - * @var object Skin templates - */ - public $html; - - /** - * Shortcut for url - * - * @var string URL shortcut - */ - public $form_code; - - /** - * Shortcut for url (javascript) - * - * @var string JS URL shortcut - */ - public $form_code_js; - - /** - * Db tools - * - * @var object - */ - protected $dbTools; - - /** - * Main class entry point - * - * @param object ipsRegistry reference - * @return @e void [Outputs to screen] - */ - public function doExecute( ipsRegistry $registry ) - { - /* Load skin and setup stuff */ - $this->html = $this->registry->output->loadTemplate('cp_skin_diagnostics'); - $this->form_code = $this->html->form_code = 'module=diagnostics&section=diagnostics'; - $this->form_code_js = $this->html->form_code_js = 'module=diagnostics§ion=diagnostics'; - - //----------------------------------------- - // Some of these functions can take a while.. - //----------------------------------------- - - @set_time_limit(0); - - //----------------------------------------- - // Load lang - //----------------------------------------- - - ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_system' ), 'core' ); - - ///---------------------------------------- - // What to do... - //----------------------------------------- - - switch( $this->request['do'] ) - { - case 'dbindex': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'index_checker' ); - $this->_indexCheck(); - break; - - case 'dbchecker': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'database_checker' ); - $this->_dbCheck(); - break; - - case 'whitespace': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'whitespace_checker' ); - $this->_whitespaceCheck(); - break; - - case 'connections': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'connection_checker' ); - $this->_checkConnections(); - break; - - case 'filepermissions': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'permission_checker' ); - $this->_permissionsCheck(); - break; - - case 'email': - $this->_emailCheckerForm(); - break; - case 'doemail': - $this->_emailCheckerGo(); - break; - - default: - $this->_listFunctions(); - break; - } - - //----------------------------------------- - // Pass to CP output hander - //----------------------------------------- - - $this->registry->getClass('output')->html_main .= $this->registry->getClass('output')->global_template->global_frame_wrapper(); - $this->registry->getClass('output')->sendOutput(); - } - - /** - * Test outbound connections - * - * @return @e void [Outputs to screen] - */ - public function _checkConnections() - { - //----------------------------------------- - // Turn errors on so we can view them - //----------------------------------------- - - @ini_set( 'display_errors', 1 ); - error_reporting( E_ALL ^ E_NOTICE ); - - $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' ); - $_files = new $classToLoad(); - - $_test = $_files->getFileContents( "http://www.invisionpower.com/connection-checker.html" ); - $_headers = $_files->raw_headers; - - $_test1 = $_files->getFileContents( "https://www.invisionpower.com/connection-checker.html" ); - $_headers1 = $_files->raw_headers; - - $this->registry->output->html .= $this->html->connectionCheckerResult( $_headers, $_test, $_headers1, $_test1 ); - } - - /** - * Check file permissions - * - * @return @e void [Outputs to screen] - */ - public function _permissionsCheck() - { - $checkdirs = array( IPS_PUBLIC_PATH . 'style_images', - IPS_PUBLIC_PATH . 'style_css', - IPS_PUBLIC_PATH . 'style_emoticons', - IPS_CACHE_PATH . 'cache', - IPS_CACHE_PATH . 'cache/skin_cache', - IPS_CACHE_PATH . 'cache/lang_cache', - IPS_CACHE_PATH . 'cache/tmp', - IPS_CACHE_PATH . 'cache/tmp/HTML', - IPS_CACHE_PATH . 'cache/tmp/URI', - IPS_CACHE_PATH . 'cache/tmp/CSS', - $this->settings['upload_dir'], - $this->settings['upload_dir'] . '/profile', - IPS_HOOKS_PATH, - ); - - //----------------------------------------- - // Get language directories - //----------------------------------------- - - if( is_array( $this->cache->getCache('lang_data') ) && count( $this->cache->getCache('lang_data') ) ) - { - foreach( $this->cache->getCache('lang_data') as $v ) - { - $this_lang = IPS_CACHE_PATH . 'cache/lang_cache/' . $v['lang_id']; - $checkdirs[] = $this_lang; - - try - { - foreach( new DirectoryIterator( $this_lang ) as $file ) - { - if( $file->isFile() ) - { - $checkdirs[] = $this_lang . '/' . $file->getFilename(); - } - } - } catch ( Exception $e ) {} - } - } - else - { - $this->DB->build( array( 'select' => 'lang_id', 'from' => 'core_sys_lang' ) ); - $this->DB->execute(); - - while( $v = $this->DB->fetch() ) - { - $this_lang = IPS_CACHE_PATH . 'cache/lang_cache/' . $v['lang_id']; - $checkdirs[] = $this_lang; - - try - { - foreach( new DirectoryIterator( $this_lang ) as $file ) - { - if( $file->isFile() ) - { - $checkdirs[] = $this_lang . '/' . $file->getFilename(); - } - } - } catch ( Exception $e ) {} - } - } - - //----------------------------------------- - // Get emoticon directories - //----------------------------------------- - - if( is_array( $this->cache->getCache('emoticons') ) && count( $this->cache->getCache('emoticons') ) ) - { - foreach( $this->cache->getCache('emoticons') as $v ) - { - $checkdirs[] = IPS_PUBLIC_PATH . 'style_emoticons/' . $v['emo_set']; - } - } - else - { - $this->DB->build( array( 'select' => 'emo_set', 'from' => 'emoticons' ) ); - $this->DB->execute(); - - while( $v = $this->DB->fetch() ) - { - $checkdirs[] = IPS_PUBLIC_PATH . 'style_emoticons/' . $v['emo_set']; - } - } - - //----------------------------------------- - // Get skin directories - //----------------------------------------- - - $skin_dirs = array(); - - if( is_array( $this->cache->getCache('skin_id_cache') ) && count( $this->cache->getCache('skin_id_cache') ) ) - { - foreach( $this->cache->getCache('skin_id_cache') as $k => $v ) - { - if( $k == 1 && !IN_DEV ) - { - continue; - } - - $checkdirs[] = IPS_CACHE_PATH . 'cache/skin_cache/cacheid_' . $v['set_id']; - $skin_dirs[] = $v['set_skin_set_id']; - } - } - else - { - $this->DB->build( array( 'select' => 'set_id', 'from' => 'skin_collections' ) ); - $this->DB->execute(); - - while( $v = $this->DB->fetch() ) - { - $checkdirs[] = IPS_CACHE_PATH . 'cache/skin_cache/cacheid_' . $v['set_id']; - $skin_dirs[] = $v['set_skin_set_id']; - } - } - - //----------------------------------------- - // Get skin files - //----------------------------------------- - - $this->DB->build( array( 'select' => $this->DB->buildDistinct( 'template_group' ), - 'from' => 'skin_templates', - 'group' => 'template_group', - ) ); - $this->DB->execute(); - - while( $v = $this->DB->fetch() ) - { - foreach( $skin_dirs as $dir ) - { - $checkdirs[] = 'cache/skin_cache/cacheid_' . $dir . '/' . $v['group_name'] . '.php'; - } - } - - $checkdirs = array_unique($checkdirs); - $output = array(); - - - - - foreach( $checkdirs as $dir_to_check ) - { - if( !file_exists( $dir_to_check ) ) - { - # Could be skin files from custom skins for components they don't own - # or they could be using safe_mode skins - # Make sure skin_cache still shows up though... - - /* tmp/ folders are created automatically. We don't need to make sure they exist but if they do they should still be writable */ - if( strpos( $dir_to_check, 'tmp/' ) ) - { - continue; - } - - if( !strpos( $dir_to_check, 'skin_' ) OR !strpos( $dir_to_check, '.php' ) ) - { - $output[] = "{$this->lang->words['d_p404']} {$dir_to_check}"; - } - } - else - { - $output[] = ( is_writable( $dir_to_check ) ) ? "{$dir_to_check} {$this->lang->words['d_pyes']}" : "{$this->lang->words['d_pno']} {$dir_to_check}"; - } - } - - $this->registry->output->html .= $this->html->permissionsResults( $output ); - } - - /** - * Whitespace checking - * - * @return @e void [Outputs to screen] - */ - public function _whitespaceCheck() - { - $files_with_junk = $this->_whitespaceDirRecurse( rtrim( DOC_IPS_ROOT_PATH, '/\\' ) ); - - $this->registry->output->html .= $this->html->whitespaceResults( $files_with_junk ); - } - - /** - * Recurse over a directory - * - * @param string Directory to check - * @return array Array of files with whitespace in them - */ - public function _whitespaceDirRecurse( $dir ) - { - $skip_dirs = array( 'uploads', - PUBLIC_DIRECTORY, - 'js', - 'images', - ); - - $files = array(); - - try - { - foreach( new DirectoryIterator( $dir ) as $directory ) - { - if( $directory->isDot() ) - { - continue; - } - - if ( strpos( $directory->getFilename(), '_' ) === 0 OR strpos( $directory->getFilename(), '.' ) === 0 ) - { - continue; - } - - $newpath = $dir . '/' . $directory->getFilename(); - $level = explode( '/', $newpath ); - - if ( is_dir($newpath) && !in_array( $directory->getFilename(), $skip_dirs ) ) - { - $files = array_merge( $files, $this->_whitespaceDirRecurse($newpath) ); - } - else - { - if ( strpos( $directory->getFilename(), ".php" ) !== false && !is_dir( $newpath ) ) - { - $file = file_get_contents($newpath); - $has_whitespace = false; - - if( substr( ltrim($file), 0, 3 ) == '' AND substr( $file, -2 ) != '?>' ) - { - //----------------------------------------- - // PHP explicitly allows one newline after closing tag - //----------------------------------------- - - if( substr( rtrim($file), -2 ) == '?>' AND substr( $file, -3 ) != "?>\n" ) - { - $has_whitespace = true; - } - } - - if( $has_whitespace ) - { - $files[] = $newpath; - } - } - } - } - } catch ( Exception $e ) {} - - return $files; - } - - /** - * Table and index checker basic stuff - * - * @param void - * @return array Table files - */ - public function _getDbTools() - { - //----------------------------------------- - // First we get the SQL definitions for each app - //----------------------------------------- - - $sql_table_files = array(); - - foreach( $this->registry->getApplications() as $app ) - { - $_file = IPSLib::getAppDir( $app['app_directory'] ) . '/setup/versions/install/sql/' . $app['app_directory'] . '_' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '_tables.php'; - - if( is_file( $_file ) ) - { - $sql_table_files[ $app['app_title'] ] = $_file; - } - } - - //----------------------------------------- - // Get the library to run the checks - //----------------------------------------- - - $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'db_lib/' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '_tools.php', 'db_tools' ); - $this->dbTools = new $classToLoad(); - - return $sql_table_files; - } - - /** - * Check the database for missing indexes - * - * @return @e void [Outputs to screen] - */ - public function _indexCheck() - { - //----------------------------------------- - // First we get the SQL definitions for each app - //----------------------------------------- - - $sql_table_files = $this->_getDbTools(); - - //----------------------------------------- - // Now let's loop - //----------------------------------------- - - $errors_array = array(); - $tables_array = array(); - $queriesRan = array(); - - foreach( $sql_table_files as $app_title => $sql_file ) - { - $TABLE = array(); - require_once( $sql_file );/*noLibHook*/ - - if ( is_array( $TABLE ) AND count( $TABLE ) ) - { - $output = $this->dbTools->dbIndexDiag( $TABLE, $this->request['fix'] ); - - if( !$output ) - { - continue; - } - - if ( isset( $output['results']['ran'] ) ) - { - $queriesRan = array_merge( $queriesRan, $output['results']['ran'] ); - unset( $output['results']['ran'] ); - } - - if( $output['error_count'] > 0 ) - { - $errors_array[] = $app_title; - } - - $tables_array[$app_title] = $output['results']; - } - } - - /* Output */ - $this->registry->output->html .= $this->html->indexChecker( $errors_array, $tables_array, $queriesRan ); - } - - /** - * Check the database for missing tables/columns - * - * @return @e void [Outputs to screen] - * @todo [Future] Functionality to show EXTRA columns/tables? - */ - public function _dbCheck() - { - //----------------------------------------- - // First we get the SQL definitions for each app - //----------------------------------------- - - $sql_table_files = $this->_getDbTools(); - - //----------------------------------------- - // Now let's loop - //----------------------------------------- - - $errors_array = array(); - $tables_array = array(); - $queriesRan = array(); - - foreach( $sql_table_files as $app_title => $sql_file ) - { - $TABLE = array(); - require_once( $sql_file );/*noLibHook*/ - - $output = $this->dbTools->dbTableDiag( $TABLE, $this->request['fix'] ); - - if( !$output ) - { - continue; - } - - if ( isset( $output['results']['ran'] ) ) - { - $queriesRan = array_merge( $queriesRan, $output['results']['ran'] ); - unset( $output['results']['ran'] ); - } - - if( $output['error_count'] > 0 ) - { - $errors_array[] = $app_title; - } - - $tables_array[$app_title] = $output['results']; - } - - //----------------------------------------- - // And output - //----------------------------------------- - - $this->registry->output->html .= $this->html->dbChecker( $errors_array, $tables_array, $queriesRan ); - } - - /** - * Show the overview page - * - * @return @e void [Outputs to screen] - */ - public function _listFunctions() - { - //----------------------------------------- - // PHP INFO? - //----------------------------------------- - - if ( $this->request['phpinfo'] AND $this->request['phpinfo'] ) - { - @ob_start(); - phpinfo(); - $parsed = @ob_get_contents(); - @ob_end_clean(); - - preg_match( "#(.*)#is" , $parsed, $match1 ); - - $php_body = $match1[1]; - - # PREVENT WRAP: Most cookies - $php_body = str_replace( "; " , ";
" , $php_body ); - # PREVENT WRAP: Very long string cookies - $php_body = str_replace( "%3B", "
" , $php_body ); - # PREVENT WRAP: Serialized array string cookies - $php_body = str_replace( ";i:", ";
i:" , $php_body ); - # PREVENT WRAP: LS_COLORS env - $php_body = str_replace( ":*.", "
:*." , $php_body ); - # PREVENT WRAP: PATH env - $php_body = str_replace( "bin:/", "bin
:/" , $php_body ); - # PREVENT WRAP: Cookie %2C split - $php_body = str_replace( "%2C", "%2C
" , $php_body ); - #PREVENT WRAP: Cookie , split - $php_body = preg_replace( "#,(\d+),#", ",
\\1," , $php_body ); - - $this->registry->output->html .= $this->html->phpInfo( $php_body ); - return; - } - - //----------------------------------------- - // Stats - //----------------------------------------- - - $reg = $this->DB->buildAndFetch( array( - 'select' => 'COUNT(*) as reg' , - 'from' => array( 'validating' => 'v' ), - 'where' => 'v.lost_pass <> 1 AND m.member_group_id=' . $this->settings['auth_group'], - 'add_join' => array( array( - 'from' => array( 'members' => 'm' ), - 'where' => 'm.member_id=v.member_id', - 'type' => 'left' - ) ) ) ); - - if( $this->settings['ipb_bruteforce_attempts'] ) - { - $lock = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as mems' , 'from' => 'members', 'where' => 'failed_login_count >= ' . $this->settings['ipb_bruteforce_attempts'] ) ); - } - - $my_timestamp = time() - $this->settings['au_cutoff'] * 60; - - $online = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as sessions', 'from' => 'sessions', 'where' => 'running_time>' . $my_timestamp ) ); - - $pending = $this->DB->buildAndFetch( array( 'select' => 'SUM(queued_topics) as topics, SUM(queued_posts) as posts', 'from' => 'forums' ) ); - - $spammers = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as count', - 'from' => 'members', - 'where' => "members_bitoptions = '1'" ) ); - - $statsbox = $this->html->acp_stats_wrapper( array( 'topics' => ipsRegistry::getClass('class_localization')->formatNumber($this->caches['stats']['total_topics']), - 'replies' => ipsRegistry::getClass('class_localization')->formatNumber($this->caches['stats']['total_replies']), - 'topics_mod' => ipsRegistry::getClass('class_localization')->formatNumber($pending['topics']), - 'posts_mod' => ipsRegistry::getClass('class_localization')->formatNumber($pending['posts']), - 'members' => ipsRegistry::getClass('class_localization')->formatNumber($this->caches['stats']['mem_count']), - 'validate' => ipsRegistry::getClass('class_localization')->formatNumber( $reg['reg'] ), - 'spammer' => ipsRegistry::getClass('class_localization')->formatNumber( $spammers['count'] ), - 'locked' => ipsRegistry::getClass('class_localization')->formatNumber( $lock['mems'] ), - 'sql_driver' => strtoupper(SQL_DRIVER), - 'sql_version' => $this->DB->true_version, - 'php_version' => phpversion(), - 'sessions' => ipsRegistry::getClass('class_localization')->formatNumber($online['sessions']), - 'php_sapi' => @php_sapi_name(), - 'ipb_version' => ipsRegistry::$version, - 'ipb_id' => ipsRegistry::$vn_full ) ); - - //----------------------------------------- - // Server stuff - //----------------------------------------- - - $this->DB->getSqlVersion(); - - $sql_version = strtoupper($this->settings['sql_driver']) . " " . $this->DB->true_version; - - $php_version = phpversion() . " (" . @php_sapi_name() . ") ( form_code}&phpinfo=1'>{$this->lang->words['d_aphpinfo']} )"; - $server_software = @php_uname(); - - $load_limit = IPSDebug::getServerLoad(); - $server_load_found = 0; - $total_memory = "--"; - $avail_memory = "--"; - $_disabled = @ini_get('disable_functions') ? explode( ',', @ini_get('disable_functions') ) : array(); - $_shellExecAvail = in_array( 'shell_exec', $_disabled ) ? false : true; - - //----------------------------------------- - // Check memory - //----------------------------------------- - - if( strpos( strtolower( PHP_OS ), 'win' ) === 0 ) - { - $mem = $_shellExecAvail ? @shell_exec('systeminfo') : null; - - if( $mem ) - { - $server_reply = explode( "\n", str_replace( "\r", "", $mem ) ); - - if( count($server_reply) ) - { - foreach( $server_reply as $info ) - { - if( strstr( $info, $this->lang->words['d_atotal'] ) ) - { - $total_memory = trim( str_replace( ":", "", strrchr( $info, ":" ) ) ); - } - - if( strstr( $info, $this->lang->words['d_aavail']) ) - { - $avail_memory = trim( str_replace( ":", "", strrchr( $info, ":" ) ) ); - } - } - } - } - } - else - { - $mem = $_shellExecAvail ? @shell_exec("free -m") : null; - - if( $mem ) - { - $server_reply = explode( "\n", str_replace( "\r", "", $mem ) ); - $mem = array_slice( $server_reply, 1, 1 ); - $mem = preg_split( "#\s+#", $mem[0] ); - - $total_memory = ( $mem[1] ) ? $mem[1] . ' MB' : '--'; - $avail_memory = ( $mem[3] ) ? $mem[3] . ' MB' : '--'; - } - else - { - $total_memory = '--'; - $avail_memory = '--'; - } - } - - $disabled_functions = ( is_array($_disabled) && count($_disabled) ) ? implode( ', ', $_disabled ) : $this->lang->words['d_anoinfo']; - $extensions = get_loaded_extensions(); - $extensions = array_combine( $extensions, $extensions ); - sort( $extensions, SORT_STRING ); - - //----------------------------------------- - // Set variables and pass to skin - //----------------------------------------- - - $data = array( - 'version' => 'v' . IPB_VERSION, - 'version_full' => IPB_LONG_VERSION, - 'version_sql' => $sql_version, - 'driver_type' => strtoupper($this->settings['sql_driver']), - 'version_php' => $php_version, - 'disabled' => $disabled_functions, - 'extensions' => str_replace( "suhosin", "suhosin", implode( ", ", $extensions ) ), - 'safe_mode' => SAFE_MODE_ON == 1 ? "{$this->lang->words['d_aon']}" : "{$this->lang->words['d_aoff']}", - 'server' => $server_software, - 'load' => $load_limit, - 'total_memory' => $total_memory, - 'avail_memory' => $avail_memory, - ); - - if( $_shellExecAvail ) - { - if( strpos( strtolower( PHP_OS ), 'win' ) === 0 ) - { - $tasks = @shell_exec( "tasklist" ); - $tasks = str_replace( " ", " ", $tasks ); - $tasks = mb_convert_encoding($tasks, IPS_DOC_CHAR_SET, 'CP866'); - } - else if( strtolower( PHP_OS ) == 'darwin' ) - { - $tasks = @shell_exec( "top -l 1" ); - $tasks = str_replace( " ", " ", $tasks ); - } - else - { - $tasks = @shell_exec( "top -b -n 1" ); - $tasks = str_replace( " ", " ", $tasks ); - } - } - else - { - $tasks = ''; - } - - if( !$tasks ) - { - $tasks = $this->lang->words['d_aunable']; - } - else - { - $tasks = "
".$tasks."
"; - } - - $data['tasks'] = $tasks; - - $this->registry->output->html .= $this->html->diagnosticsOverview( $data, $statsbox ); - } - - /** - * Show the email tester page - * - * @param sring Error message - * @return @e void [Outputs to screen] - */ - public function _emailCheckerForm( $error='' ) - { - $this->registry->output->html .= $this->html->emailChecker( $error ); - } - - /** - * Send a test email - * - * @return @e void [Outputs to screen] - */ - public function _emailCheckerGo() - { - //----------------------------------------- - // Send it - //----------------------------------------- - - IPSText::getTextClass('email')->to = $this->request['to']; - IPSText::getTextClass('email')->from = $this->request['from']; - IPSText::getTextClass('email')->subject = $this->request['subject']; - IPSText::getTextClass('email')->message = $this->request['message']; - IPSText::getTextClass('email')->sendMail(); - - //----------------------------------------- - // Check the error log - //----------------------------------------- - - $error = ''; - - $lastLog = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'mail_error_logs', 'order' => 'mlog_date DESC', 'limit' => 1 ) ); - if ( $lastLog['mlog_date'] >= ( time() - 2 ) and $lastLog['mlog_subject'] == $this->request['subject'] ) - { - $error = $lastLog['mlog_msg']; - } - else - { - $this->registry->output->global_message = $this->lang->words['email_tester_ok']; - } - - //----------------------------------------- - // Show - //----------------------------------------- - - $this->_emailCheckerForm( $error ); - } + + * Invision Power Services + * IP.Board v3.4.6 + * Diagnostic tools + * Last Updated: $Date: 2013-04-15 17:26:30 -0400 (Mon, 15 Apr 2013) $ + * + * + * @author $Author: AndyMillne $ + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license http://www.invisionpower.com/company/standards.php#license + * @package IP.Board + * @subpackage Core + * @link http://www.invisionpower.com + * @since 1st march 2002 + * @version $Revision: 12179 $ + */ + +if ( ! defined( 'IN_ACP' ) ) +{ + print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; + exit(); +} + + +class admin_core_diagnostics_diagnostics extends ipsCommand +{ + /** + * Skin object + * + * @var object Skin templates + */ + public $html; + + /** + * Shortcut for url + * + * @var string URL shortcut + */ + public $form_code; + + /** + * Shortcut for url (javascript) + * + * @var string JS URL shortcut + */ + public $form_code_js; + + /** + * Db tools + * + * @var object + */ + protected $dbTools; + + /** + * Main class entry point + * + * @param object ipsRegistry reference + * @return @e void [Outputs to screen] + */ + public function doExecute( ipsRegistry $registry ) + { + /* Load skin and setup stuff */ + $this->html = $this->registry->output->loadTemplate('cp_skin_diagnostics'); + $this->form_code = $this->html->form_code = 'module=diagnostics&section=diagnostics'; + $this->form_code_js = $this->html->form_code_js = 'module=diagnostics§ion=diagnostics'; + + //----------------------------------------- + // Some of these functions can take a while.. + //----------------------------------------- + + @set_time_limit(0); + + //----------------------------------------- + // Load lang + //----------------------------------------- + + ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_system' ), 'core' ); + + ///---------------------------------------- + // What to do... + //----------------------------------------- + + switch( $this->request['do'] ) + { + case 'dbindex': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'index_checker' ); + $this->_indexCheck(); + break; + + case 'dbchecker': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'database_checker' ); + $this->_dbCheck(); + break; + + case 'whitespace': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'whitespace_checker' ); + $this->_whitespaceCheck(); + break; + + case 'connections': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'connection_checker' ); + $this->_checkConnections(); + break; + + case 'filepermissions': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'permission_checker' ); + $this->_permissionsCheck(); + break; + + case 'email': + $this->_emailCheckerForm(); + break; + case 'doemail': + $this->_emailCheckerGo(); + break; + + default: + $this->_listFunctions(); + break; + } + + //----------------------------------------- + // Pass to CP output hander + //----------------------------------------- + + $this->registry->getClass('output')->html_main .= $this->registry->getClass('output')->global_template->global_frame_wrapper(); + $this->registry->getClass('output')->sendOutput(); + } + + /** + * Test outbound connections + * + * @return @e void [Outputs to screen] + */ + public function _checkConnections() + { + //----------------------------------------- + // Turn errors on so we can view them + //----------------------------------------- + + @ini_set( 'display_errors', 1 ); + error_reporting( E_ALL ^ E_NOTICE ); + + $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' ); + $_files = new $classToLoad(); + + $_test = $_files->getFileContents( "http://www.google.com/" ); + $_headers = $_files->raw_headers; + + $_test1 = $_files->getFileContents( "https://www.google.com/" ); + $_headers1 = $_files->raw_headers; + + $this->registry->output->html .= $this->html->connectionCheckerResult( $_headers, $_test, $_headers1, $_test1 ); + } + + /** + * Check file permissions + * + * @return @e void [Outputs to screen] + */ + public function _permissionsCheck() + { + $checkdirs = array( IPS_PUBLIC_PATH . 'style_images', + IPS_PUBLIC_PATH . 'style_css', + IPS_PUBLIC_PATH . 'style_emoticons', + IPS_CACHE_PATH . 'cache', + IPS_CACHE_PATH . 'cache/skin_cache', + IPS_CACHE_PATH . 'cache/lang_cache', + IPS_CACHE_PATH . 'cache/tmp', + IPS_CACHE_PATH . 'cache/tmp/HTML', + IPS_CACHE_PATH . 'cache/tmp/URI', + IPS_CACHE_PATH . 'cache/tmp/CSS', + $this->settings['upload_dir'], + $this->settings['upload_dir'] . '/profile', + IPS_HOOKS_PATH, + ); + + //----------------------------------------- + // Get language directories + //----------------------------------------- + + if( is_array( $this->cache->getCache('lang_data') ) && count( $this->cache->getCache('lang_data') ) ) + { + foreach( $this->cache->getCache('lang_data') as $v ) + { + $this_lang = IPS_CACHE_PATH . 'cache/lang_cache/' . $v['lang_id']; + $checkdirs[] = $this_lang; + + try + { + foreach( new DirectoryIterator( $this_lang ) as $file ) + { + if( $file->isFile() ) + { + $checkdirs[] = $this_lang . '/' . $file->getFilename(); + } + } + } catch ( Exception $e ) {} + } + } + else + { + $this->DB->build( array( 'select' => 'lang_id', 'from' => 'core_sys_lang' ) ); + $this->DB->execute(); + + while( $v = $this->DB->fetch() ) + { + $this_lang = IPS_CACHE_PATH . 'cache/lang_cache/' . $v['lang_id']; + $checkdirs[] = $this_lang; + + try + { + foreach( new DirectoryIterator( $this_lang ) as $file ) + { + if( $file->isFile() ) + { + $checkdirs[] = $this_lang . '/' . $file->getFilename(); + } + } + } catch ( Exception $e ) {} + } + } + + //----------------------------------------- + // Get emoticon directories + //----------------------------------------- + + if( is_array( $this->cache->getCache('emoticons') ) && count( $this->cache->getCache('emoticons') ) ) + { + foreach( $this->cache->getCache('emoticons') as $v ) + { + $checkdirs[] = IPS_PUBLIC_PATH . 'style_emoticons/' . $v['emo_set']; + } + } + else + { + $this->DB->build( array( 'select' => 'emo_set', 'from' => 'emoticons' ) ); + $this->DB->execute(); + + while( $v = $this->DB->fetch() ) + { + $checkdirs[] = IPS_PUBLIC_PATH . 'style_emoticons/' . $v['emo_set']; + } + } + + //----------------------------------------- + // Get skin directories + //----------------------------------------- + + $skin_dirs = array(); + + if( is_array( $this->cache->getCache('skin_id_cache') ) && count( $this->cache->getCache('skin_id_cache') ) ) + { + foreach( $this->cache->getCache('skin_id_cache') as $k => $v ) + { + if( $k == 1 && !IN_DEV ) + { + continue; + } + + $checkdirs[] = IPS_CACHE_PATH . 'cache/skin_cache/cacheid_' . $v['set_id']; + $skin_dirs[] = $v['set_skin_set_id']; + } + } + else + { + $this->DB->build( array( 'select' => 'set_id', 'from' => 'skin_collections' ) ); + $this->DB->execute(); + + while( $v = $this->DB->fetch() ) + { + $checkdirs[] = IPS_CACHE_PATH . 'cache/skin_cache/cacheid_' . $v['set_id']; + $skin_dirs[] = $v['set_skin_set_id']; + } + } + + //----------------------------------------- + // Get skin files + //----------------------------------------- + + $this->DB->build( array( 'select' => $this->DB->buildDistinct( 'template_group' ), + 'from' => 'skin_templates', + 'group' => 'template_group', + ) ); + $this->DB->execute(); + + while( $v = $this->DB->fetch() ) + { + foreach( $skin_dirs as $dir ) + { + $checkdirs[] = 'cache/skin_cache/cacheid_' . $dir . '/' . $v['group_name'] . '.php'; + } + } + + $checkdirs = array_unique($checkdirs); + $output = array(); + + + + + foreach( $checkdirs as $dir_to_check ) + { + if( !file_exists( $dir_to_check ) ) + { + # Could be skin files from custom skins for components they don't own + # or they could be using safe_mode skins + # Make sure skin_cache still shows up though... + + /* tmp/ folders are created automatically. We don't need to make sure they exist but if they do they should still be writable */ + if( strpos( $dir_to_check, 'tmp/' ) ) + { + continue; + } + + if( !strpos( $dir_to_check, 'skin_' ) OR !strpos( $dir_to_check, '.php' ) ) + { + $output[] = "{$this->lang->words['d_p404']} {$dir_to_check}"; + } + } + else + { + $output[] = ( is_writable( $dir_to_check ) ) ? "{$dir_to_check} {$this->lang->words['d_pyes']}" : "{$this->lang->words['d_pno']} {$dir_to_check}"; + } + } + + $this->registry->output->html .= $this->html->permissionsResults( $output ); + } + + /** + * Whitespace checking + * + * @return @e void [Outputs to screen] + */ + public function _whitespaceCheck() + { + $files_with_junk = $this->_whitespaceDirRecurse( rtrim( DOC_IPS_ROOT_PATH, '/\\' ) ); + + $this->registry->output->html .= $this->html->whitespaceResults( $files_with_junk ); + } + + /** + * Recurse over a directory + * + * @param string Directory to check + * @return array Array of files with whitespace in them + */ + public function _whitespaceDirRecurse( $dir ) + { + $skip_dirs = array( 'uploads', + PUBLIC_DIRECTORY, + 'js', + 'images', + ); + + $files = array(); + + try + { + foreach( new DirectoryIterator( $dir ) as $directory ) + { + if( $directory->isDot() ) + { + continue; + } + + if ( strpos( $directory->getFilename(), '_' ) === 0 OR strpos( $directory->getFilename(), '.' ) === 0 ) + { + continue; + } + + $newpath = $dir . '/' . $directory->getFilename(); + $level = explode( '/', $newpath ); + + if ( is_dir($newpath) && !in_array( $directory->getFilename(), $skip_dirs ) ) + { + $files = array_merge( $files, $this->_whitespaceDirRecurse($newpath) ); + } + else + { + if ( strpos( $directory->getFilename(), ".php" ) !== false && !is_dir( $newpath ) ) + { + $file = file_get_contents($newpath); + $has_whitespace = false; + + if( substr( ltrim($file), 0, 3 ) == '' AND substr( $file, -2 ) != '?>' ) + { + //----------------------------------------- + // PHP explicitly allows one newline after closing tag + //----------------------------------------- + + if( substr( rtrim($file), -2 ) == '?>' AND substr( $file, -3 ) != "?>\n" ) + { + $has_whitespace = true; + } + } + + if( $has_whitespace ) + { + $files[] = $newpath; + } + } + } + } + } catch ( Exception $e ) {} + + return $files; + } + + /** + * Table and index checker basic stuff + * + * @param void + * @return array Table files + */ + public function _getDbTools() + { + //----------------------------------------- + // First we get the SQL definitions for each app + //----------------------------------------- + + $sql_table_files = array(); + + foreach( $this->registry->getApplications() as $app ) + { + $_file = IPSLib::getAppDir( $app['app_directory'] ) . '/setup/versions/install/sql/' . $app['app_directory'] . '_' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '_tables.php'; + + if( is_file( $_file ) ) + { + $sql_table_files[ $app['app_title'] ] = $_file; + } + } + + //----------------------------------------- + // Get the library to run the checks + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'db_lib/' . strtolower( ipsRegistry::$settings['sql_driver'] ) . '_tools.php', 'db_tools' ); + $this->dbTools = new $classToLoad(); + + return $sql_table_files; + } + + /** + * Check the database for missing indexes + * + * @return @e void [Outputs to screen] + */ + public function _indexCheck() + { + //----------------------------------------- + // First we get the SQL definitions for each app + //----------------------------------------- + + $sql_table_files = $this->_getDbTools(); + + //----------------------------------------- + // Now let's loop + //----------------------------------------- + + $errors_array = array(); + $tables_array = array(); + $queriesRan = array(); + + foreach( $sql_table_files as $app_title => $sql_file ) + { + $TABLE = array(); + require_once( $sql_file );/*noLibHook*/ + + if ( is_array( $TABLE ) AND count( $TABLE ) ) + { + $output = $this->dbTools->dbIndexDiag( $TABLE, $this->request['fix'] ); + + if( !$output ) + { + continue; + } + + if ( isset( $output['results']['ran'] ) ) + { + $queriesRan = array_merge( $queriesRan, $output['results']['ran'] ); + unset( $output['results']['ran'] ); + } + + if( $output['error_count'] > 0 ) + { + $errors_array[] = $app_title; + } + + $tables_array[$app_title] = $output['results']; + } + } + + /* Output */ + $this->registry->output->html .= $this->html->indexChecker( $errors_array, $tables_array, $queriesRan ); + } + + /** + * Check the database for missing tables/columns + * + * @return @e void [Outputs to screen] + * @todo [Future] Functionality to show EXTRA columns/tables? + */ + public function _dbCheck() + { + //----------------------------------------- + // First we get the SQL definitions for each app + //----------------------------------------- + + $sql_table_files = $this->_getDbTools(); + + //----------------------------------------- + // Now let's loop + //----------------------------------------- + + $errors_array = array(); + $tables_array = array(); + $queriesRan = array(); + + foreach( $sql_table_files as $app_title => $sql_file ) + { + $TABLE = array(); + require_once( $sql_file );/*noLibHook*/ + + $output = $this->dbTools->dbTableDiag( $TABLE, $this->request['fix'] ); + + if( !$output ) + { + continue; + } + + if ( isset( $output['results']['ran'] ) ) + { + $queriesRan = array_merge( $queriesRan, $output['results']['ran'] ); + unset( $output['results']['ran'] ); + } + + if( $output['error_count'] > 0 ) + { + $errors_array[] = $app_title; + } + + $tables_array[$app_title] = $output['results']; + } + + //----------------------------------------- + // And output + //----------------------------------------- + + $this->registry->output->html .= $this->html->dbChecker( $errors_array, $tables_array, $queriesRan ); + } + + /** + * Show the overview page + * + * @return @e void [Outputs to screen] + */ + public function _listFunctions() + { + //----------------------------------------- + // PHP INFO? + //----------------------------------------- + + if ( $this->request['phpinfo'] AND $this->request['phpinfo'] ) + { + @ob_start(); + phpinfo(); + $parsed = @ob_get_contents(); + @ob_end_clean(); + + preg_match( "#(.*)#is" , $parsed, $match1 ); + + $php_body = $match1[1]; + + # PREVENT WRAP: Most cookies + $php_body = str_replace( "; " , ";
" , $php_body ); + # PREVENT WRAP: Very long string cookies + $php_body = str_replace( "%3B", "
" , $php_body ); + # PREVENT WRAP: Serialized array string cookies + $php_body = str_replace( ";i:", ";
i:" , $php_body ); + # PREVENT WRAP: LS_COLORS env + $php_body = str_replace( ":*.", "
:*." , $php_body ); + # PREVENT WRAP: PATH env + $php_body = str_replace( "bin:/", "bin
:/" , $php_body ); + # PREVENT WRAP: Cookie %2C split + $php_body = str_replace( "%2C", "%2C
" , $php_body ); + #PREVENT WRAP: Cookie , split + $php_body = preg_replace( "#,(\d+),#", ",
\\1," , $php_body ); + + $this->registry->output->html .= $this->html->phpInfo( $php_body ); + return; + } + + //----------------------------------------- + // Stats + //----------------------------------------- + + $reg = $this->DB->buildAndFetch( array( + 'select' => 'COUNT(*) as reg' , + 'from' => array( 'validating' => 'v' ), + 'where' => 'v.lost_pass <> 1 AND m.member_group_id=' . $this->settings['auth_group'], + 'add_join' => array( array( + 'from' => array( 'members' => 'm' ), + 'where' => 'm.member_id=v.member_id', + 'type' => 'left' + ) ) ) ); + + if( $this->settings['ipb_bruteforce_attempts'] ) + { + $lock = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as mems' , 'from' => 'members', 'where' => 'failed_login_count >= ' . $this->settings['ipb_bruteforce_attempts'] ) ); + } + + $my_timestamp = time() - $this->settings['au_cutoff'] * 60; + + $online = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as sessions', 'from' => 'sessions', 'where' => 'running_time>' . $my_timestamp ) ); + + $pending = $this->DB->buildAndFetch( array( 'select' => 'SUM(queued_topics) as topics, SUM(queued_posts) as posts', 'from' => 'forums' ) ); + + $spammers = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as count', + 'from' => 'members', + 'where' => "members_bitoptions = '1'" ) ); + + $statsbox = $this->html->acp_stats_wrapper( array( 'topics' => ipsRegistry::getClass('class_localization')->formatNumber($this->caches['stats']['total_topics']), + 'replies' => ipsRegistry::getClass('class_localization')->formatNumber($this->caches['stats']['total_replies']), + 'topics_mod' => ipsRegistry::getClass('class_localization')->formatNumber($pending['topics']), + 'posts_mod' => ipsRegistry::getClass('class_localization')->formatNumber($pending['posts']), + 'members' => ipsRegistry::getClass('class_localization')->formatNumber($this->caches['stats']['mem_count']), + 'validate' => ipsRegistry::getClass('class_localization')->formatNumber( $reg['reg'] ), + 'spammer' => ipsRegistry::getClass('class_localization')->formatNumber( $spammers['count'] ), + 'locked' => ipsRegistry::getClass('class_localization')->formatNumber( $lock['mems'] ), + 'sql_driver' => strtoupper(SQL_DRIVER), + 'sql_version' => $this->DB->true_version, + 'php_version' => phpversion(), + 'sessions' => ipsRegistry::getClass('class_localization')->formatNumber($online['sessions']), + 'php_sapi' => @php_sapi_name(), + 'ipb_version' => ipsRegistry::$version, + 'ipb_id' => ipsRegistry::$vn_full ) ); + + //----------------------------------------- + // Server stuff + //----------------------------------------- + + $this->DB->getSqlVersion(); + + $sql_version = strtoupper($this->settings['sql_driver']) . " " . $this->DB->true_version; + + $php_version = phpversion() . " (" . @php_sapi_name() . ") ( form_code}&phpinfo=1'>{$this->lang->words['d_aphpinfo']} )"; + $server_software = @php_uname(); + + $load_limit = IPSDebug::getServerLoad(); + $server_load_found = 0; + $total_memory = "--"; + $avail_memory = "--"; + $_disabled = @ini_get('disable_functions') ? explode( ',', @ini_get('disable_functions') ) : array(); + $_shellExecAvail = in_array( 'shell_exec', $_disabled ) ? false : true; + + //----------------------------------------- + // Check memory + //----------------------------------------- + + if( strpos( strtolower( PHP_OS ), 'win' ) === 0 ) + { + $mem = $_shellExecAvail ? @shell_exec('systeminfo') : null; + + if( $mem ) + { + $server_reply = explode( "\n", str_replace( "\r", "", $mem ) ); + + if( count($server_reply) ) + { + foreach( $server_reply as $info ) + { + if( strstr( $info, $this->lang->words['d_atotal'] ) ) + { + $total_memory = trim( str_replace( ":", "", strrchr( $info, ":" ) ) ); + } + + if( strstr( $info, $this->lang->words['d_aavail']) ) + { + $avail_memory = trim( str_replace( ":", "", strrchr( $info, ":" ) ) ); + } + } + } + } + } + else + { + $mem = $_shellExecAvail ? @shell_exec("free -m") : null; + + if( $mem ) + { + $server_reply = explode( "\n", str_replace( "\r", "", $mem ) ); + $mem = array_slice( $server_reply, 1, 1 ); + $mem = preg_split( "#\s+#", $mem[0] ); + + $total_memory = ( $mem[1] ) ? $mem[1] . ' MB' : '--'; + $avail_memory = ( $mem[3] ) ? $mem[3] . ' MB' : '--'; + } + else + { + $total_memory = '--'; + $avail_memory = '--'; + } + } + + $disabled_functions = ( is_array($_disabled) && count($_disabled) ) ? implode( ', ', $_disabled ) : $this->lang->words['d_anoinfo']; + $extensions = get_loaded_extensions(); + $extensions = array_combine( $extensions, $extensions ); + sort( $extensions, SORT_STRING ); + + //----------------------------------------- + // Set variables and pass to skin + //----------------------------------------- + + $data = array( + 'version' => 'v' . IPB_VERSION, + 'version_full' => IPB_LONG_VERSION, + 'version_sql' => $sql_version, + 'driver_type' => strtoupper($this->settings['sql_driver']), + 'version_php' => $php_version, + 'disabled' => $disabled_functions, + 'extensions' => str_replace( "suhosin", "suhosin", implode( ", ", $extensions ) ), + 'safe_mode' => SAFE_MODE_ON == 1 ? "{$this->lang->words['d_aon']}" : "{$this->lang->words['d_aoff']}", + 'server' => $server_software, + 'load' => $load_limit, + 'total_memory' => $total_memory, + 'avail_memory' => $avail_memory, + ); + + if( $_shellExecAvail ) + { + if( strpos( strtolower( PHP_OS ), 'win' ) === 0 ) + { + $tasks = @shell_exec( "tasklist" ); + $tasks = str_replace( " ", " ", $tasks ); + } + else if( strtolower( PHP_OS ) == 'darwin' ) + { + $tasks = @shell_exec( "top -l 1" ); + $tasks = str_replace( " ", " ", $tasks ); + } + else + { + $tasks = @shell_exec( "top -b -n 1" ); + $tasks = str_replace( " ", " ", $tasks ); + } + } + else + { + $tasks = ''; + } + + if( !$tasks ) + { + $tasks = $this->lang->words['d_aunable']; + } + else + { + $tasks = "
".$tasks."
"; + } + + $data['tasks'] = $tasks; + + $this->registry->output->html .= $this->html->diagnosticsOverview( $data, $statsbox ); + } + + /** + * Show the email tester page + * + * @param sring Error message + * @return @e void [Outputs to screen] + */ + public function _emailCheckerForm( $error='' ) + { + $this->registry->output->html .= $this->html->emailChecker( $error ); + } + + /** + * Send a test email + * + * @return @e void [Outputs to screen] + */ + public function _emailCheckerGo() + { + //----------------------------------------- + // Send it + //----------------------------------------- + + IPSText::getTextClass('email')->to = $this->request['to']; + IPSText::getTextClass('email')->from = $this->request['from']; + IPSText::getTextClass('email')->subject = $this->request['subject']; + IPSText::getTextClass('email')->message = $this->request['message']; + IPSText::getTextClass('email')->sendMail(); + + //----------------------------------------- + // Check the error log + //----------------------------------------- + + $error = ''; + + $lastLog = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'mail_error_logs', 'order' => 'mlog_date DESC', 'limit' => 1 ) ); + if ( $lastLog['mlog_date'] >= ( time() - 2 ) and $lastLog['mlog_subject'] == $this->request['subject'] ) + { + $error = $lastLog['mlog_msg']; + } + else + { + $this->registry->output->global_message = $this->lang->words['email_tester_ok']; + } + + //----------------------------------------- + // Show + //----------------------------------------- + + $this->_emailCheckerForm( $error ); + } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/diagnostics/index.html b/upload/admin/applications/core/modules_admin/diagnostics/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/diagnostics/index.html +++ b/upload/admin/applications/core/modules_admin/diagnostics/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/diagnostics/xml/index.html b/upload/admin/applications/core/modules_admin/diagnostics/xml/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/diagnostics/xml/index.html +++ b/upload/admin/applications/core/modules_admin/diagnostics/xml/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/diagnostics/xml/menu.xml b/upload/admin/applications/core/modules_admin/diagnostics/xml/menu.xml index 183fd43d..4a3ceb43 100644 --- a/upload/admin/applications/core/modules_admin/diagnostics/xml/menu.xml +++ b/upload/admin/applications/core/modules_admin/diagnostics/xml/menu.xml @@ -2,10 +2,10 @@ - Обзор Системы + Overview - Обзор Системы + Overview diag_overview diagnostics @@ -15,10 +15,10 @@ - Проверка Пробелов + Whitespace Checker - Проверка Пробелов + Whitespace Checker whitespace_checker diagnostics do=whitespace @@ -28,10 +28,10 @@ - Проверка Ограничений ФС + Permissions Checker - Проверка Ограничений ФС + Permissions Checker permissions_checker diagnostics do=filepermissions @@ -41,10 +41,10 @@ - Проверка Соединений + Connection Checker - Проверка Соединений + Connection Checker connection_checker diagnostics do=connections @@ -54,10 +54,10 @@ - Прверка БД + Database Checker - Проверка БД + Database Checker db_checker diagnostics do=dbchecker @@ -67,10 +67,10 @@ - Проверка Индексов БД + Database Index Checker - Проверка Индексов БД + Database Index Checker dbi_checker diagnostics do=dbindex @@ -80,10 +80,10 @@ - Тест Email + Email Tester - Тест Email + Email Tester email_checker diagnostics do=email diff --git a/upload/admin/applications/core/modules_admin/diagnostics/xml/permissions.xml b/upload/admin/applications/core/modules_admin/diagnostics/xml/permissions.xml index ebd700af..dc27ada0 100644 --- a/upload/admin/applications/core/modules_admin/diagnostics/xml/permissions.xml +++ b/upload/admin/applications/core/modules_admin/diagnostics/xml/permissions.xml @@ -1,32 +1,32 @@ - Инструменты диагностики + Diagnostic Tools core_diag_tools index_checker - Может проверять индексы таблиц базы? Внимание: позволяет выполнять запросы к базе. + Can use the database index checker? Warning: Allows ability to run database queries indirectly. database_checker - Может использовать проверку базы данных? Внимание: позволяет выполнять запросы к базе. + Can use the database checker? Warning: Allows ability to run database queries indirectly. whitespace_checker - Может проверять файлы на лишние пробелы? + Can use the whitespace checker? connection_checker - Может использовать проверку сетевых соединений? + Can use the connection checker? permission_checker - Может проверять файлы и директории на правильность расстановки прав доступа? + Can use the permissions checker? email_checker - Может проверять работу почты? + Can use the email tester? diff --git a/upload/admin/applications/core/modules_admin/help/defaultSection.php b/upload/admin/applications/core/modules_admin/help/defaultSection.php index d2249488..a65448b9 100644 --- a/upload/admin/applications/core/modules_admin/help/defaultSection.php +++ b/upload/admin/applications/core/modules_admin/help/defaultSection.php @@ -7,7 +7,7 @@ * $Author: ips_terabyte $ * @since 20th February 2002 * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 8655 $ */ diff --git a/upload/admin/applications/core/modules_admin/help/index.html b/upload/admin/applications/core/modules_admin/help/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/help/index.html +++ b/upload/admin/applications/core/modules_admin/help/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/help/quickhelp.php b/upload/admin/applications/core/modules_admin/help/quickhelp.php index b2e246f5..1bb8a23c 100644 --- a/upload/admin/applications/core/modules_admin/help/quickhelp.php +++ b/upload/admin/applications/core/modules_admin/help/quickhelp.php @@ -3,7 +3,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Quick help - shows popups with help information
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
@@ -115,28 +115,28 @@ class admin_core_help_quickhelp extends ipsCommand switch( $id ) { case 'docs': - $url = "http://external.ipslink.com/ipboard30/landing/?p=docs-ipb"; + $url = "http://anonym.to/?http://external.ipslink.com/ipboard30/landing/?p=docs-ipb"; break; case 'resources': - $url = "http://external.ipslink.com/ipboard30/landing/?p=resources"; + $url = "http://anonym.to/?http://external.ipslink.com/ipboard30/landing/?p=resources"; break; case 'contact': - $url = "http://external.ipslink.com/ipboard30/landing/?p=contact"; + $url = "http://anonym.to/?http://external.ipslink.com/ipboard30/landing/?p=contact"; break; case 'features': - $url = "http://external.ipslink.com/ipboard30/landing/?p=suggestfeatures"; + $url = "http://anonym.to/?http://external.ipslink.com/ipboard30/landing/?p=suggestfeatures"; break; case 'bugs': - $url = "http://external.ipslink.com/ipboard30/landing/?p=bugs"; + $url = "http://anonym.to/?http://external.ipslink.com/ipboard30/landing/?p=bugs"; break; default: case 'support': - $url = "http://external.ipslink.com/ipboard30/landing/?p=support"; + $url = "http://anonym.to/?http://external.ipslink.com/ipboard30/landing/?p=support"; break; } diff --git a/upload/admin/applications/core/modules_admin/help/xml/index.html b/upload/admin/applications/core/modules_admin/help/xml/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/help/xml/index.html +++ b/upload/admin/applications/core/modules_admin/help/xml/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/help/xml/menu.xml b/upload/admin/applications/core/modules_admin/help/xml/menu.xml index 0e620ef0..f17f3fa3 100644 --- a/upload/admin/applications/core/modules_admin/help/xml/menu.xml +++ b/upload/admin/applications/core/modules_admin/help/xml/menu.xml @@ -1,77 +1,77 @@ - - - - - Документация - - - Документация - help_documentation - quickhelp - do=redirect&id=docs - 1 - - - - - Техническая поддержка - - - Техническая поддержка - help_support - quickhelp - do=redirect&id=support - 1 - - - - - Дополнительные Ресурсы - - - Дополнительные Ресурсы - help_resources - quickhelp - do=redirect&id=resources - 1 - - - - - Контактная Информация - - - Контактная Информация - help_contact - quickhelp - do=redirect&id=contact - 1 - - - - - Запрос Функций - - - Запрос Функций - help_features - quickhelp - do=redirect&id=features - 1 - - - - - Сообщить об Ошибке - - - Сообщить об Ошибке - help_bugs - quickhelp - do=redirect&id=bugs - 1 - - - - + + + + + Documentation + + + Documentation + help_documentation + quickhelp + do=redirect&id=docs + 1 + + + + + Technical Support + + + Technical Support + help_support + quickhelp + do=redirect&id=support + 1 + + + + + Additional Resources + + + Additional Resources + help_resources + quickhelp + do=redirect&id=resources + 1 + + + + + IPS Contact Information + + + IPS Contact Information + help_contact + quickhelp + do=redirect&id=contact + 1 + + + + + Feature Requests + + + Feature Requests + help_features + quickhelp + do=redirect&id=features + 1 + + + + + Report a Bug + + + Report a Bug + help_bugs + quickhelp + do=redirect&id=bugs + 1 + + + + \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/index.html b/upload/admin/applications/core/modules_admin/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/index.html +++ b/upload/admin/applications/core/modules_admin/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/languages/defaultSection.php b/upload/admin/applications/core/modules_admin/languages/defaultSection.php index ef475502..79f51357 100644 --- a/upload/admin/applications/core/modules_admin/languages/defaultSection.php +++ b/upload/admin/applications/core/modules_admin/languages/defaultSection.php @@ -7,7 +7,7 @@ * $Author: ips_terabyte $ * @since 20th February 2002 * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 8655 $ */ diff --git a/upload/admin/applications/core/modules_admin/languages/index.html b/upload/admin/applications/core/modules_admin/languages/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/languages/index.html +++ b/upload/admin/applications/core/modules_admin/languages/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/languages/manage_languages.php b/upload/admin/applications/core/modules_admin/languages/manage_languages.php index 35b984ba..06d1f701 100644 --- a/upload/admin/applications/core/modules_admin/languages/manage_languages.php +++ b/upload/admin/applications/core/modules_admin/languages/manage_languages.php @@ -1,3061 +1,3055 @@ - - * Invision Power Services - * IP.Board v3.4.5 - * Language Pack Management - * Last Updated: $LastChangedDate: 2013-05-29 10:48:49 -0400 (Wed, 29 May 2013) $ - * - * - * @author $Author: AndyMillne $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/company/standards.php#license - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 12276 $ - */ - -if ( ! defined( 'IN_ACP' ) ) -{ - print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; - exit(); -} - -class admin_core_languages_manage_languages extends ipsCommand -{ - /** - * Daily flag - * - * @var bool - */ - private $__daily = false; - - /** - * Tab buttons - * - * @var array - */ - public $tab_buttons = array(); - - /** - * Tabs - * - * @var array - */ - public $tab_tabs = array(); - - /** - * Javascript action to execute on tab click - * - * @var string - */ - public $tab_js_action = ''; - - /** - * Default tab - * - * @var string - */ - public $default_tab = ''; - - /** - * Main class entry point - * - * @param object ipsRegistry reference - * @return @e void [Outputs to screen] - */ - public function doExecute( ipsRegistry $registry ) - { - //----------------------------------------- - // Get skin and language file - //----------------------------------------- - - $this->html = $this->registry->output->loadTemplate( 'cp_skin_system', 'core' ); - $this->registry->class_localization->loadLanguageFile( array( 'admin_system' ), 'core' ); - - //----------------------------------------- - // Set urls - //----------------------------------------- - - $this->form_code = $this->html->form_code = 'module=languages&section=manage_languages&'; - $this->form_code_js = $this->html->form_code_js = 'module=languages§ion=manage_languages&'; - - //----------------------------------------- - // Go - //----------------------------------------- - - switch( $this->request['do'] ) - { - case 'copy_lang_pack': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_words' ); - $this->languageCopy(); - break; - - case 'edit_word_entry': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_words' ); - $this->languageWordEntryForm( 'edit' ); - break; - - case 'do_edit_word_entry': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_words' ); - $this->handleWordEntryForm( 'edit' ); - break; - - case 'add_word_entry': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_words' ); - $this->languageWordEntryForm( 'add' ); - break; - - case 'do_add_word_entry': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_words' ); - $this->handleWordEntryForm( 'add' ); - break; - - case 'list_word_packs': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_words' ); - $this->languageListWordPacks(); - break; - - case 'edit_word_pack': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_words' ); - $this->languageEditWordPack(); - break; - - case 'do_edit_word_pack': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_packs' ); - $this->languageEditWordPackValues(); - break; - - case 'edit_lang_info': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_pack_info' ); - $this->languageInformationForm( 'edit' ); - break; - - case 'do_edit_lang_info': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_pack_info' ); - $this->handleLanguageInformationForm( 'edit' ); - break; - - case 'new_language': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_packs' ); - $this->languageInformationForm( 'new' ); - break; - - case 'do_new_language': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_packs' ); - $this->handleLanguageInformationForm( 'new' ); - break; - - case 'language_swap': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_pack_info' ); - $this->swapLanguages(); - break; - - case 'revert': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_words' ); - $this->languageDoRevertWord(); - break; - - case 'export': - $this->languageExportToXML( intval( $this->request['id'] ) ); - break; - - case 'language_do_import': - $this->imprtFromXML( intval( $this->request['id'] ) ); - break; - - case 'language_do_indev_export': - foreach( ipsRegistry::$applications as $app_dir => $app_data ) - { - $this->request['app_dir'] = $app_dir; - - $this->request['type'] = 'admin'; - $this->languageExportToXML( 1, 1 ); - - $this->request['type'] = 'public'; - $this->languageExportToXML( 1, 1 ); - } - - $this->registry->output->setMessage( $this->lang->words['indev_lang_export_done'], 1 ); - $this->languagesList(); - break; - - case 'language_do_indev_import': - $this->importFromCacheFiles(); - break; - - case 'remove_language': - $this->languageRemove(); - break; - - case 'remove_word_entry': - $this->removeWordEntry(); - break; - - case 'remove_word_pack': - $this->removeWordPack(); - break; - - case 'rebuildFromXml': - $this->rebuildFromXml(); - break; - - case 'recache_lang_pack': - $this->recacheLangPack(); - break; - - case 'translateExtSplash': - $this->translateExtSplash(); - break; - - case 'translateImport': - $this->translateImport(); - break; - - case 'translateKill': - $this->translateKill(); - break; - - default: - $this->languagesList(); - break; - } - - //----------------------------------------- - // Pass to CP output hander - //----------------------------------------- - - $this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper(); - $this->registry->output->sendOutput(); - } - - /** - * Swap member language choice globally - * - * @return @e void - */ - public function swapLanguages() - { - /* INIT */ - $langFrom = intval( $this->request['lang_from'] ); - $langTo = intval( $this->request['lang_to'] ); - - /* Run query... */ - if( !$langFrom ) - { - $this->DB->update( 'members', array( 'language' => $langTo > 0 ? $langTo : 0 ), "language=0 OR language " . $this->DB->buildIsNull( true ) ); - } - else - { - $this->DB->update( 'members', array( 'language' => $langTo > 0 ? $langTo : 0 ), "language=" . intval( $langFrom ) ); - } - - /* Done */ - $this->registry->output->global_message = $this->lang->words['mem_lang_choice_swapped']; - $this->languagesList(); - return; - } - - /** - * Finish a session and remove data - * - * @return @e void - */ - public function translateKill() - { - /* INIT */ - $langId = intval( $this->request['id'] ); - $mainDir = DOC_IPS_ROOT_PATH . 'translate'; - $words_by_file = array(); - $errors = array(); - $filesToImport = array(); - - /* Start top message */ - if ( ! is_dir( $mainDir ) ) - { - /* Just bounce back asking them to create translate */ - $this->registry->output->global_error = $this->lang->words['ext_no_translate_dir']; - $this->languagesList(); - return; - } - - if ( ! is_writeable( $mainDir ) ) - { - /* Just bounce back asking them to chmod translate */ - $this->registry->output->global_error = $this->lang->words['ext_chmod_translate_dir']; - $this->languagesList(); - return; - } - - /* Load kernel class for file management */ - $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' ); - $classFileManagement = new $classToLoad(); - - /* Remove files */ - $classFileManagement->emptyDirectory( $mainDir ); - - /* Delete session */ - $this->cache->deleteCache( 'translate_session' ); - - /* Done */ - $this->registry->output->global_message = $this->lang->words['ext_all_killed']; - $this->languagesList(); - return; - } - - /** - * Translate externally import changed files - * - * @return @e void - */ - public function translateImport() - { - /* INIT */ - $langId = intval( $this->request['id'] ); - $mainDir = DOC_IPS_ROOT_PATH . 'translate'; - $words_by_file = array(); - $errors = array(); - $filesToImport = array(); - $fileCount = 0; - - /* Start top message */ - if ( ! is_dir( $mainDir ) ) - { - /* Just bounce back asking them to create translate */ - $this->registry->output->global_error = $this->lang->words['ext_no_translate_dir']; - $this->languagesList(); - return; - } - - if ( ! is_writeable( $mainDir ) ) - { - /* Just bounce back asking them to chmod translate */ - $this->registry->output->global_error = $this->lang->words['ext_chmod_translate_dir']; - $this->languagesList(); - return; - } - - /* Get file count */ - try - { - foreach( new DirectoryIterator( $mainDir ) as $f ) - { - if ( !$f->isDir() ) - { - $fileCount++; - } - } - } - catch ( Exception $e ) - { - $fileCount = 0; - } - - /* Get lang */ - $lang = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_lang', 'where' => 'lang_id=' . $langId ) ); - - /* Get current session if one */ - $sessionData = $this->cache->getCache('translate_session'); - - /* Check */ - if ( empty( $sessionData['lang_id'] ) OR ! count( $sessionData['files'] ) OR !$fileCount ) - { - /* Just bounce back asking them to create translate */ - $this->registry->output->global_error = $this->lang->words['ext_no_translate_files']; - $this->languagesList(); - return; - } - - /* Still here? Okay */ - if ( is_array( $_POST['cb'] ) AND count( $_POST['cb'] ) ) - { - /* Gather a list of files to import */ - foreach( $_POST['cb'] as $file => $value ) - { - if ( $_POST['cb'][ $file ] ) - { - $filesToImport[ $file ] = $file; - } - } - - /* Assume nothing */ - if ( count( $filesToImport ) ) - { - $counts = $this->_importFromDisk( $mainDir, $sessionData['lang_id'], array_keys( $filesToImport ), true ); - - foreach( $counts as $file => $data ) - { - /* Update session data */ - $sessionData['files'][ $file ]['dbtime'] = time(); - - $this->registry->output->global_message = sprintf( $this->lang->words['ext_file_written'], $file, intval( $data['inserts'] ), intval( $data['updates'] ) ); - } - - $this->registry->output->global_message .= '
' . sprintf( $this->lang->words['ext_recache'], "{$this->settings['base_url']}&{$this->form_code}&do=recache_lang_pack&id={$sessionData['lang_id']}" ); - - /* Update session */ - $this->cache->setCache( 'translate_session', $sessionData, array( 'array' => 1, 'donow' => 1 ) ); - - $this->translateExtSplash(); - return; - } - } - else - { - /* Just bounce back asking them to create translate */ - $this->registry->output->global_error = $this->lang->words['ext_no_selected_files']; - $this->translateExtSplash(); - return; - } - } - - /** - * Translate externally splash - * - * @return @e void - */ - public function translateExtSplash() - { - /* INIT */ - $langId = intval( $this->request['id'] ); - $mainDir = DOC_IPS_ROOT_PATH . 'translate'; - $words_by_file = array(); - $errors = array(); - - /* Start top message */ - if ( ! is_dir( $mainDir ) ) - { - /* Just bounce back asking them to create translate */ - $this->registry->output->global_error = $this->lang->words['ext_no_translate_dir']; - $this->languagesList(); - return; - } - - if ( ! is_writeable( $mainDir ) ) - { - /* Just bounce back asking them to chmod translate */ - $this->registry->output->global_error = $this->lang->words['ext_chmod_translate_dir']; - $this->languagesList(); - return; - } - - /* Load kernel class for file management */ - $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' ); - $classFileManagement = new $classToLoad(); - - /* Get lang */ - $lang = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_lang', 'where' => 'lang_id=' . $langId ) ); - - /* Get current session if one */ - $sessionData = $this->cache->getCache('translate_session'); - - /* No current session? */ - if ( empty( $sessionData['lang_id'] ) OR ! count( $sessionData['files'] ) ) - { - /* Ensure directory is empty */ - $classFileManagement->emptyDirectory( $mainDir ); - - /* Ensure it's gone, gone */ - $this->cache->deleteCache( 'translate_session' ); - $sessionData = $lang; - $sessionData['files'] = array(); - $header = "/*******************************************************\nNOTE: This is a translatable file generated by IP.Board " . IPB_VERSION . " (" . IPB_LONG_VERSION . ") on " . date( "r" ) . " by " . $this->memberData['members_display_name'] . "\nPLEASE set your text editor to save this document as UTF-8 regardless of your board's character-set\n*******************************************************/\n\n"; - - /* Export all the languages into flat files */ - $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_lang_words', 'where' => 'lang_id=' . $langId, 'order' => 'word_custom_version DESC, word_default_version DESC' ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $_text = ( $r['word_custom'] ) ? $r['word_custom'] : $r['word_default']; - $_version = ( $r['word_custom_version'] ) ? $r['word_custom_version'] : $r['word_default_version']; - $words_by_file[$r['word_app']][$r['word_pack']][] = array( $r['word_key'], $_text ); - } - - //----------------------------------------- - // Now loop and write to file - //----------------------------------------- - - foreach( $words_by_file as $app => $word_packs ) - { - foreach( $word_packs as $pack => $words ) - { - if( $pack == 'public_js' ) - { - $to_write = ''; - $_file = 'ipb.lang.js'; - - foreach( $words as $word ) - { - $word[1] = str_replace( '"', '\\"', $word[1] ); - $to_write .= "ipb.lang['{$word[0]}'] = \"{$word[1]}\";\n"; - } - } - else if( $pack == 'admin_js' ) - { - $to_write = ''; - $_file = 'acp.lang.js'; - - foreach( $words as $word ) - { - $word[1] = str_replace( '"', '\\"', $word[1] ); - $to_write .= "ipb.lang['{$word[0]}'] = \"{$word[1]}\";\n"; - } - } - else - { - //----------------------------------------- - // Build cache file contents - //----------------------------------------- - - $to_write = " \"{$word[1]}\",\n"; - } - - $to_write .= " ); \n"; - } - - //----------------------------------------- - // Convert data - //----------------------------------------- - - $to_write = IPSText::convertCharsets( $to_write, IPS_DOC_CHAR_SET, 'UTF-8' ); - - //----------------------------------------- - // Write the file - //----------------------------------------- - - @unlink( $mainDir . '/' . $_file ); - - if ( $fh = @fopen( $mainDir . '/' . $_file, 'wb' ) ) - { - fwrite( $fh, $to_write, strlen( $to_write ) ); - fclose( $fh ); - @chmod( $mainDir . '/' . $_file, IPS_FILE_PERMISSION ); - - $mtime = @filemtime( $mainDir . '/' . $_file ); - - $sessionData['files'][ $_file ] = array( 'mtime' => $mtime, 'dbtime' => $mtime ); - } - else - { - $errors[] = $this->lang->words['l_nowrite'] . $mainDir . '/' . $_file; - } - } - } - - /* Sort files */ - ksort( $sessionData['files'] ); - - /* Save session */ - $this->cache->setCache( 'translate_session', $sessionData, array( 'array' => 1, 'donow' => 1 ) ); - } - else - { - /* Update mtime */ - foreach( $sessionData['files'] as $file => $data ) - { - $sessionData['files'][ $file ]['mtime'] = @filemtime( $mainDir . '/' . $file ); - } - } - - //----------------------------------------- - // Output - //----------------------------------------- - - $this->registry->output->extra_nav[] = array( "{$this->settings['base_url']}&{$this->form_code}&do=translateExtSplash&id={$sessionData['lang_id']}", "{$this->lang->words['ext_title_for']} {$sessionData['lang_title']}" ); - - $this->registry->output->html .= $this->html->languages_translateExt( $sessionData, $lang ); - } - - /** - * Import files from disk - * - * @param string Directory to look in - * @param int Language ID to import into - * @param array [Only import these files] - * @param boolean [Perform character set translation from UTF-8] - * @return array List of files successfully imported - */ - private function _importFromDisk( $mainDir, $langId, $onlyTheseFiles=array(), $convertCharSet=false ) - { - /* INIT */ - $imported = array(); - $lang_entries = array(); - $js_entries = array(); - $counts = array(); - - /* Start looping */ - if ( is_dir( $mainDir ) ) - { - $dh = opendir( $mainDir ); - - /* Ensure it has a trailing slash */ - if ( substr( $mainDir, -1 ) != '/' ) - { - $mainDir .= '/'; - } - - while( $f = readdir( $dh ) ) - { - if ( $f[0] == '.' || $f == 'index.html' ) - { - continue; - } - - /* Skipping? */ - if ( is_array( $onlyTheseFiles ) AND count( $onlyTheseFiles ) AND ! in_array( $f, $onlyTheseFiles ) ) - { - continue; - } - - if ( preg_match( '#^\S+?_\S+?\.php$#', $f ) ) - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $updated = 0; - $inserted = 0; - $app = preg_replace( '#^([^_]+?)_(\S+?)\.php$#', "\\1", $f ); - $word_pack = preg_replace( '#^([^_]+?)_(\S+?)\.php$#', "\\2", $f ); - $lang = array(); - $db_lang = array(); - - $counts[ $f ] = array(); - - if ( ! is_file( $mainDir . $f ) ) - { - continue; - } - - /* Require the file */ - require( $mainDir . $f );/*noLibHook*/ - - //----------------------------------------- - // Loop - //----------------------------------------- - - foreach( $lang as $k => $v ) - { - //----------------------------------------- - // Build db array - //----------------------------------------- - - $db_array = array( - 'lang_id' => $langId, - 'word_app' => $app, - 'word_pack' => $word_pack, - 'word_key' => $k, - 'word_custom' => IPSText::convertCharsets($v, 'UTF-8', IPS_DOC_CHAR_SET ), - 'word_js' => 0 - ); - - //----------------------------------------- - // If cached, get from cache - //----------------------------------------- - - if( $lang_entries[ $langId ][ $db_array['word_app'] ][ $db_array['word_pack'] ] ) - { - $lang_entry = $lang_entries[ $langId ][ $db_array['word_app'] ][ $db_array['word_pack'] ][ $db_array['word_key'] ]; - } - - //----------------------------------------- - // Otherwise get all langs from this entry and - // put in cache - //----------------------------------------- - - else - { - $this->DB->build( array( - 'select' => '*', - 'from' => 'core_sys_lang_words', - 'where' => "lang_id={$langId} AND word_app='{$db_array['word_app']}' AND word_pack='{$db_array['word_pack']}'" - ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $lang_entries[ $r['lang_id'] ][ $r['word_app'] ][ $r['word_pack'] ][ $r['word_key'] ] = $r; - } - - if( $lang_entries[ $langId ][ $db_array['word_app'] ][ $db_array['word_pack'] ][ $db_array['word_key'] ] ) - { - $lang_entry = $lang_entries[ $langId ][ $db_array['word_app'] ][ $db_array['word_pack'] ][ $db_array['word_key'] ]; - } - } - - /* Finish off */ - $db_array['word_default'] = $lang_entries[ $langId ][ $db_array['word_app'] ][ $db_array['word_pack'] ][ $db_array['word_key'] ]['word_default']; - $db_array['word_default_version'] = $lang_entries[ $langId ][ $db_array['word_app'] ][ $db_array['word_pack'] ][ $db_array['word_key'] ]['word_default_version']; - $db_array['word_custom_version'] = IPB_LONG_VERSION; - - //----------------------------------------- - // If there is no new custom lang bit to insert - // don't delete what is already there. - //----------------------------------------- - - if( ! $db_array['word_custom'] ) - { - unset($db_array['word_custom']); - } - - //----------------------------------------- - // Lang bit already exists, update - //----------------------------------------- - - if( $lang_entry['word_id'] ) - { - //----------------------------------------- - // Don't update default version - //----------------------------------------- - - unset( $db_array['word_default_version'] ); - - $counts[ $f ]['updates']++; - $this->DB->update( 'core_sys_lang_words', $db_array, "word_id={$lang_entry['word_id']}" ); - } - - //----------------------------------------- - // Lang bit doesn't exist, so insert - //----------------------------------------- - - else if( !$lang_entry['word_id'] ) - { - $counts[ $f ]['inserts']++; - $this->DB->insert( 'core_sys_lang_words', $db_array ); - } - } - } - else if( preg_match( '/(\.js)$/', $f ) ) - { - $_js_word_pack = ''; - - if( $f == 'ipb.lang.js' ) - { - $_js_word_pack = 'public_js'; - } - else if( $f == 'acp.lang.js' ) - { - $_js_word_pack = 'admin_js'; - } - - //----------------------------------------- - // If not cached, get it - //----------------------------------------- - - if( !$js_entries[ $langId ][ $_js_word_pack ] ) - { - $this->DB->build( array( - 'select' => '*', - 'from' => 'core_sys_lang_words', - 'where' => "lang_id={$langId} AND word_pack='{$_js_word_pack}'" - ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $js_entries[ $r['word_pack'] ][ $r['word_key'] ] = $r; - } - } - - //----------------------------------------- - // Delete current words for this app and word pack - //----------------------------------------- - - $this->DB->delete( 'core_sys_lang_words', 'lang_id=' . $langId . " AND word_app='core' AND word_pack='" . $_js_word_pack . "'" ); - - //----------------------------------------- - // Get each line - //----------------------------------------- - - $js_file = file( $mainDir . $f ); - - //----------------------------------------- - // Loop through lines and import - //----------------------------------------- - - foreach( $js_file as $r ) - { - //----------------------------------------- - // preg_match what we want - //----------------------------------------- - - preg_match( '#ipb\.lang\[\'(.+?)\'\](.+?)= ["\'](.+?)["\'];#', $r, $matches ); - - //----------------------------------------- - // Valid? - //----------------------------------------- - - if( $matches[1] && $matches[3] ) - { - $counts[ $f ]['inserts']++; - $insert = array( - 'lang_id' => $langId, - 'word_app' => 'core', - 'word_pack' => $_js_word_pack, - 'word_key' => $matches[1], - 'word_custom' => IPSText::convertCharsets($matches[3], 'UTF-8', IPS_DOC_CHAR_SET ), - 'word_js' => 1, - 'word_default' => $js_entries[ $_js_word_pack ][ $matches[1] ]['word_default'], - 'word_default_version' => $js_entries[ $_js_word_pack ][ $matches[1] ]['word_default_version'], - 'word_custom_version' => IPB_LONG_VERSION, - ); - - $this->DB->insert( 'core_sys_lang_words', $insert ); - } - } - } - } - - closedir( $dh ); - } - - return $counts; - } - - - /** - * Recaches a language pack - * - * @return @e void - */ - public function recacheLangPack() - { - //----------------------------------------- - // Init - //----------------------------------------- - - $this->cache_errors = array(); - - $lang_id = intval( $this->request['id'] ); - - $this->cacheToDisk( $lang_id ); - - $this->registry->output->global_message = $this->lang->words['language_recache_done'] . ( !empty( $this->cache_errors ) ? ( "
" . implode( "
", $this->cache_errors ) ) : '' ); - $this->languagesList(); - } - - /** - * Remove a word entry - * - * @return @e void - */ - public function removeWordEntry() - { - //----------------------------------------- - // Init - //----------------------------------------- - - $word_id = intval($this->request['word_id']); - $lang_id = intval( $this->request['id'] ); - - //----------------------------------------- - // Delete lang bit - //----------------------------------------- - - $this->DB->delete( 'core_sys_lang_words', 'word_id=' . $word_id ); - - //----------------------------------------- - // Recache to disk - //----------------------------------------- - - $this->cacheToDisk( $lang_id ); - - //----------------------------------------- - // Bounce to new URL - //----------------------------------------- - - $this->request['secure_key'] = $this->registry->adminFunctions->generated_acp_hash; - $this->registry->output->global_message = $this->lang->words['language_word_removed']; - $this->languageEditWordPack(); - } - - /** - * Remove a word pack - * - * @return @e void - */ - public function removeWordPack() - { - //----------------------------------------- - // Init - //----------------------------------------- - - $pack = explode( '/', $this->request['word_pack'] ); - $lang_id = intval( $this->request['id'] ); - - if( $lang_id ) - { - //----------------------------------------- - // Delete from DB - //----------------------------------------- - - $this->DB->delete( 'core_sys_lang_words', "lang_id='{$lang_id}' AND word_pack='" . $pack[1] . "' AND word_app='" . $pack[0] . "'" ); - - //----------------------------------------- - // Delete from disk - //----------------------------------------- - - $_file = IPS_CACHE_PATH . 'cache/lang_cache/' . $lang_id . '/' . $pack[0] . '_' . $pack[1] . '.php'; - - if( is_file( $_file ) ) - { - @unlink( $_file ); - } - - //----------------------------------------- - // And recache - //----------------------------------------- - - $this->cacheToDisk( $lang_id ); - } - - //----------------------------------------- - // Bounce back - //----------------------------------------- - - $this->request['secure_key'] = $this->registry->adminFunctions->generated_acp_hash; - $this->registry->output->global_message = $this->lang->words['language_wordpack_removed']; - $this->languageListWordPacks(); - } - - /** - * Rebuilds language from XML files - * - * @return @e void - */ - public function rebuildFromXml() - { - //----------------------------------------- - // Init - //----------------------------------------- - - $apps = array(); - $previous = trim( $this->request['previous'] ); - $type = trim( $this->request['type'] ); - $id = intval($this->request['id']); - $_word = ( $type == 'admin' ) ? 'admin' : 'public'; - - //----------------------------------------- - // Verify writable - //----------------------------------------- - - if ( ! is_writeable( IPS_CACHE_PATH . 'cache/lang_cache/' . $id ) ) - { - $this->registry->output->global_error = $this->lang->words['cannot_write_to_cache'] ? sprintf( $this->lang->words['cannot_write_to_cache'], $id ) : "Cannot write to cache/lang_cache/" . $id; - $this->languagesList(); - return; - } - - //----------------------------------------- - // Get setup class - //----------------------------------------- - - require_once( IPS_ROOT_PATH . "setup/sources/base/setup.php" );/*noLibHook*/ - - //----------------------------------------- - // Get apps - //----------------------------------------- - - foreach( ipsRegistry::$applications as $appDir => $appData ) - { - $apps[] = $appDir; - } - - //----------------------------------------- - // Klude for setup class - //----------------------------------------- - - IPSSetUp::setSavedData( 'install_apps', implode( ',', $apps ) ); - - //----------------------------------------- - // Get next app - //----------------------------------------- - - $next = IPSSetUp::fetchNextApplication( $previous, '', $this->settings['gb_char_set'] ); - - if ( $next['key'] ) - { - $msg = $next['title'] . sprintf( $this->lang->words['importing_x_langs'], $_word ); - $_PATH = IPSLib::getAppDir( $next['key'] ) . '/xml/'; - - //----------------------------------------- - // Try to import all the lang packs - //----------------------------------------- - - try - { - foreach( new DirectoryIterator( $_PATH ) as $f ) - { - if ( preg_match( "#" . $_word . "_(.+?)_language_pack.xml#", $f->getFileName() ) ) - { - $this->request['file_location'] = $_PATH . $f->getFileName(); - $this->imprtFromXML( 1, true, true, $next['key'], false, 1 ); - } - } - } catch ( Exception $e ) {} - - //----------------------------------------- - // Off to next setp - //----------------------------------------- - - $this->registry->output->html .= $this->registry->output->global_template->temporaryRedirect( $this->settings['base_url'] . $this->form_code . "do=rebuildFromXml&id={$id}&type={$type}&previous=" . $next['key'], $msg . '
' . $this->registry->output->global_message ); - $this->registry->output->global_message = ''; - return; - } - else - { - if ( $type == 'public' ) - { - //----------------------------------------- - // Onto admin languages - //----------------------------------------- - - $this->registry->output->html .= $this->registry->output->global_template->temporaryRedirect( $this->settings['base_url'] . $this->form_code . "do=rebuildFromXml&id={$id}&type=admin", $this->lang->words['starting_admin_import'] ); - return; - } - else - { - //----------------------------------------- - // And we're done - //----------------------------------------- - - $this->registry->output->redirect( $this->settings['base_url'] . $this->form_code, $this->lang->words['lang_reimport_done'] ); - } - } - } - - /** - * Copies a language pack - * - * @return void - */ - public function languageCopy() - { - //----------------------------------------- - // Init - //----------------------------------------- - - $id = intval( $this->request['id'] ); - - //----------------------------------------- - // Get lang pack - //----------------------------------------- - - $lang_info = $this->DB->buildAndFetch( array( 'select' => 'lang_short, lang_title, lang_isrtl', 'from' => 'core_sys_lang', 'where' => "lang_id={$id}" ) ); - - $lang_info['lang_title'] .= " (COPY)"; - - //----------------------------------------- - // Insert language pack - //----------------------------------------- - - $this->DB->insert( 'core_sys_lang', $lang_info ); - $new_id = $this->DB->getInsertID(); - - //----------------------------------------- - // Copy the language bits now - //----------------------------------------- - - $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_lang_words', 'where' => "lang_id={$id}" ) ); - $q = $this->DB->execute(); - - while( $r = $this->DB->fetch( $q ) ) - { - unset( $r['word_id'] ); - $r['lang_id'] = $new_id; - - $this->DB->insert( 'core_sys_lang_words', $r ); - } - - //----------------------------------------- - // Recache and redirect - //----------------------------------------- - - $this->cacheToDisk( $new_id ); - $this->registry->class_localization->rebuildLanguagesCache(); - - $this->registry->output->redirect( $this->settings['base_url'] . $this->form_code, $this->lang->words['l_copied'] ); - } - - /** - * Removes a language pack and cleans up files - * - * @return void - */ - public function languageRemove() - { - //----------------------------------------- - // Init - //----------------------------------------- - - $id = intval( $this->request['id'] ); - - //----------------------------------------- - // Make sure this isn't default pack - //----------------------------------------- - - $langCheck = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_lang', 'where' => 'lang_id=' . $id ) ); - - if( $langCheck['lang_default'] ) - { - $this->registry->output->showError( $this->lang->words['cannot_delete_default_lang'] ); - } - - if( $langCheck['lang_protected'] AND !IN_DEV ) - { - $this->registry->output->showError( $this->lang->words['cannot_delete_protected_lang'] ); - } - - //----------------------------------------- - // Delete from database - //----------------------------------------- - - $this->DB->delete( 'core_sys_lang' , "lang_id={$id}" ); - $this->DB->delete( 'core_sys_lang_words', "lang_id={$id}" ); - - //----------------------------------------- - // Delete from disk - //----------------------------------------- - - $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . '/classFileManagement.php', 'classFileManagement' ); - $fileManagement = new $classToLoad(); - $fileManagement->removeDirectory( IPS_CACHE_PATH . 'cache/lang_cache/' . $id . '/' ); - - //----------------------------------------- - // Update member default choice - //----------------------------------------- - $default = $this->DB->buildAndFetch( array( 'select' => 'lang_id', 'from' => 'core_sys_lang', 'where' => "lang_default=1" ) ); - $this->DB->update( 'members', array( 'language' => intval($default['lang_id']) ), "language={$id}" ); - - //----------------------------------------- - // Update cache and redirect - //----------------------------------------- - - $this->registry->class_localization->rebuildLanguagesCache(); - $this->registry->output->redirect( $this->settings['base_url'] . $this->form_code, $this->lang->words['l_removed'] ); - } - - /** - * Revert a word pack entry to the default value - * - * @return @e void - */ - public function languageDoRevertWord() - { - //----------------------------------------- - // Init - //----------------------------------------- - - $word_id = intval( $this->request['word_id'] ); - $lang_id = intval( $this->request['id'] ); - $pack = explode( '/', $this->request['word_pack'] ); - - //----------------------------------------- - // Revert - //----------------------------------------- - - $this->DB->update( 'core_sys_lang_words', array( 'word_custom' => '' ), "word_id={$word_id}" ); - - //----------------------------------------- - // Recache - //----------------------------------------- - - $this->cacheToDisk( $lang_id ); - - //----------------------------------------- - // Redirect - //----------------------------------------- - - $this->request['secure_key'] = $this->registry->adminFunctions->generated_acp_hash; - $this->registry->output->global_message = $this->lang->words['language_word_revert']; - $this->languageEditWordPack(); - } - - /** - * Saves new language edits - * - * @return @e void - */ - public function languageEditWordPackValues() - { - //----------------------------------------- - // Init - //----------------------------------------- - - $id = intval( $this->request['id'] ); - - $langCheck = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_lang', 'where' => 'lang_id=' . $id ) ); - - if( $langCheck['lang_protected'] AND !IN_DEV ) - { - $this->registry->output->showError( $this->lang->words['lang_pack_protected'] ); - } - - /* Got anything? */ - if ( ! count( array_keys( $_POST['lang'] ) ) ) - { - $this->registry->output->redirect( $this->settings['base_url'] . $this->form_code . "&do=edit_word_pack&word_pack={$this->request['pack']}&id={$this->request['id']}&search={$this->request['search']}&filter={$this->request['filter']}&st={$this->request['st']}", $this->lang->words['language_word_pack_edited'] ); - } - - //----------------------------------------- - // Get the words - //----------------------------------------- - - $lang = $this->DB->buildAndFetchAll( array( - 'select' => '*', - 'from' => 'core_sys_lang_words', - 'where' => "lang_id={$id} AND word_id IN(" . implode( ',', array_map( 'intval', array_keys( $_POST['lang'] ) ) ) . ')', - ), 'word_id' ); - - //----------------------------------------- - // Loop through language bits submitted - //----------------------------------------- - - if( is_array( $_POST['lang'] ) && count( $_POST['lang'] ) ) - { - foreach( $_POST['lang'] as $k => $v ) - { - if( $v != "" ) - { - $v = IPSText::safeSlashes($v); - $v = str_replace( '\', '\\', $v ); - - if( $lang[ $k ]['word_pack'] == 'admin_js' OR $lang[ $k ]['word_pack'] == 'public_js' ) - { - $v = str_replace( array( "\r\n", "\r" ), "", $v ); - } - - $this->DB->update( 'core_sys_lang_words', "word_custom='" . $this->DB->addSlashes( $v ) . "', word_custom_version=word_default_version", "word_id=" . intval($k), false, true ); - } - elseif ( isset( $lang[ $k ] ) and $lang[ $k ]['word_custom'] ) - { - $this->DB->update( 'core_sys_lang_words', array( 'word_custom' => '' ), "word_id=" . intval( $k ) ); - } - } - } - - //----------------------------------------- - // Recache and redirect - //----------------------------------------- - - $this->cacheToDisk( $id ); - - $this->registry->output->redirect( $this->settings['base_url'] . $this->form_code . "&do=edit_word_pack&word_pack={$this->request['pack']}&id={$this->request['id']}&search={$this->request['search']}&filter={$this->request['filter']}&st={$this->request['st']}", $this->lang->words['language_word_pack_edited'] ); - } - - /** - * Handles the word entry form - * - * @param string $mode Either add or edit - * @return @e void - */ - public function handleWordEntryForm( $mode='add' ) - { - //----------------------------------------- - // Init - //----------------------------------------- - - $lang_id = intval( $this->request['id'] ); - $word_id = intval( $this->request['word_id'] ); - $LATESTVERSION = IPSLib::fetchVersionNumber(); - - //----------------------------------------- - // Error checking - //----------------------------------------- - - if( ! $this->request['word_pack_db'] ) - { - $this->registry->output->global_error = $this->lang->words['l_packreq']; - $this->languageWordEntryForm( $mode ); - return; - } - - if( ! $this->request['word_key'] ) - { - $this->registry->output->global_error = $this->lang->words['l_keyreq']; - $this->languageWordEntryForm( $mode ); - return; - } - - if( ! $this->request['word_default'] ) - { - $this->registry->output->global_error = $this->lang->words['l_textreq']; - $this->languageWordEntryForm( $mode ); - return; - } - - $this->request['word_app'] = mb_strtolower($this->request['word_app']); - $this->request['word_pack_db'] = str_replace( '/', '_', mb_strtolower($this->request['word_pack_db']) ); - - if( $this->request['word_pack_db'] == 'admin_js' OR $this->request['word_pack_db'] == 'public_js' ) - { - $this->request['word_app'] = 'core'; - } - - //----------------------------------------- - // Build DB insert array - //----------------------------------------- - - $db_array = array( - 'lang_id' => $lang_id, - 'word_app' => $this->request['word_app'], - 'word_pack' => $this->request['word_pack_db'], - 'word_key' => $this->request['word_key'], - 'word_default' => IPSText::formToText( $_POST['word_default'] ), - ); - - //----------------------------------------- - // Add or update - //----------------------------------------- - - if( $mode == 'add' ) - { - /* Check for a duplicate */ - $_check = $this->DB->buildAndFetch( array( 'select' => 'word_id', 'from' => 'core_sys_lang_words', 'where' => "lang_id={$lang_id} AND word_app='{$db_array['word_app']}' AND word_pack='{$db_array['word_pack']}' AND word_key='{$db_array['word_key']}'" ) ); - - if( $_check['word_id'] ) - { - $this->registry->output->global_error = $this->lang->words['l_textexistsalready']; - $this->languageWordEntryForm( $mode ); - return; - } - - $this->DB->insert( 'core_sys_lang_words', $db_array ); - - $text = $this->lang->words['l_added']; - } - else - { - $this->DB->update( 'core_sys_lang_words', $db_array, "word_id={$word_id}" ); - - $text = $this->lang->words['l_updated']; - } - - //----------------------------------------- - // Recache and redirect - //----------------------------------------- - - $this->cacheToDisk( $lang_id ); - - $this->registry->output->redirect( "{$this->settings['base_url']}&module=languages§ion=manage_languages&do=list_word_packs&id={$lang_id}", $text ); - } - - /** - * Form for adding/editing a word entry - * - * @param string $mode Either add or edit - * @return @e void - */ - public function languageWordEntryForm( $mode='add' ) - { - //----------------------------------------- - // Init - //----------------------------------------- - - $word_id = intval( $this->request['word_id'] ); - $lang_id = intval( $this->request['id'] ); - $pack = explode( '/', $this->request['word_pack'] ); - - //----------------------------------------- - // Adding or editing - //----------------------------------------- - - if( $mode == 'add' ) - { - $op = 'do_add_word_entry'; - $title = $this->lang->words['l_addnew']; - $header = $this->lang->words['l_addnewfull']; - $button = $this->lang->words['l_addthis']; - $data = array( 'word_pack' => $pack[1], 'word_app' => $pack[0] ); - } - else - { - $op = 'do_edit_word_entry'; - $title = $this->lang->words['l_edit']; - $header = $this->lang->words['l_editentry']; - $button = $this->lang->words['l_savechanges']; - - //----------------------------------------- - // Get data - //----------------------------------------- - - $data = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_lang_words', 'where' => "word_id={$word_id}" ) ); - } - - //----------------------------------------- - // Set defaults - //----------------------------------------- - - $data['word_app'] = !empty( $this->request['word_app'] ) ? $this->request['word_app'] : $data['word_app']; - $data['word_pack'] = !empty( $this->request['word_pack_db'] ) ? $this->request['word_pack_db'] : $data['word_pack']; - $data['word_key'] = !empty( $this->request['word_key'] ) ? $this->request['word_key'] : $data['word_key']; - $data['word_default'] = !empty( $this->request['word_default'] ) ? $this->request['word_default'] : $data['word_default']; - - //----------------------------------------- - // Applications dropdown - //----------------------------------------- - - $_apps = array(); - - foreach( ipsRegistry::$applications as $app => $appdata ) - { - $_apps[] = array( $app, $appdata['app_title'] ); - } - - $data['word_app'] = $this->compileSelectOptions( $_apps, $data['word_app'] ); - - //----------------------------------------- - // Output form - //----------------------------------------- - - $this->registry->output->html .= $this->html->languageWordEntryForm( $op, $word_id, $lang_id, $title, $header, $data, $button ); - } - - /** - * Creates an option list for select tags - * - * @param array $options Array of values/text for dropdown - * @param mixed [$selected] Selected value or array of selected values - * @return string - */ - public function compileSelectOptions( $options, $selected='' ) - { - if( ! is_array( $selected ) ) - { - $selected = array( $selected ); - } - - $html = ''; - if( is_array( $options ) ) - { - foreach( $options as $option ) - { - $sel = ( $option[0] AND in_array( $option[0], $selected ) ) ? ' selected="selected"' : ''; - $val = ( $option[0] == 'disabled' ) ? 'disabled="disabled"' : "value='{$option[0]}'"; - - $html .= ""; - } - } - - return $html; - } - - /** - * Adds the button and content to the tab list for this object - * - * @param string $button - * @param string $content - * @param string [$js_action] - * @return @e void - */ - public function addTab( $button, $content, $js_action='', $default_tab=0 ) - { - $this->tab_buttons[] = $button; - $this->tab_tabs[] = $content; - $this->tab_js_action[] = $js_action; - - if( $default_tab ) - { - $this->default_tab = count( $this->tab_tabs ) - 1; - } - } - - /** - * Builds the html for the tabbed area - * - * @return string Tab HTML - */ - public function buildTabs() - { - /* Buttons */ - $i = 0; - $tabs = array(); - foreach( $this->tab_buttons as $i => $button ) - { - /* Tab Button */ - $js = ( $this->tab_js_action[$i] ) ? 'onmousedown="'.$this->tab_js_action[$i].'"' : ''; - $tabs[] = array( 'id' => $i, 'text' => $button, 'js' => $js ); - } - - /* Tab Contents */ - $i = 0; - $content = array(); - foreach( $this->tab_tabs as $tab ) - { - /* Create the pane */ - $content[] = array( 'id' => $i, 'content' => $tab ); - $i++; - } - - $default_tab = ( $this->default_tab ) ? $this->default_tab : ''; - - /* End of tab pane */ - $tabs = $this->html->ui_content_tabs( $tabs, $content, $default_tab ); - - return $tabs; - } - - /** - * Edit the entries in a word pack - * - * @return @e void - */ - public function languageEditWordPack() - { - //----------------------------------------- - // Init - //----------------------------------------- - - /* Fix up for search */ - $keywordForPageLinks = $this->request['search']; - $this->request['search'] = str_replace( "'", "\\'", $this->request['search'] ); - - $id = intval( $this->request['id'] ); - $pack = explode( '/', $this->request['word_pack'] ); - $per_page = 20; - $st = $this->request['st'] ? intval( $this->request['st'] ) : 0; - $search = $this->request['search'] ? " AND ( word_default LIKE '%" . $this->request['search'] . "%' OR word_custom LIKE '%" . $this->request['search'] . "%' OR word_key LIKE '%" . $this->request['search'] . "%' )" : ''; - $filter = $this->request['filter'] ? " AND word_custom_version < word_default_version AND word_custom " . $this->DB->buildIsNull(false) . ' ' : ''; - $wp_query = $pack[0] && $pack[1] ? " AND word_app='{$pack[0]}' AND word_pack='{$pack[1]}' " : ''; - - //----------------------------------------- - // Get language pack - //----------------------------------------- - - $data = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_lang', 'where' => "lang_id={$id}" ) ); - - //----------------------------------------- - // How many words? - //----------------------------------------- - - $count = $this->DB->buildAndFetch( array( - 'select' => 'COUNT(*) as count', - 'from' => 'core_sys_lang_words', - 'where' => "lang_id={$id} {$wp_query} {$search} {$filter}" - ) ); - - //----------------------------------------- - // Pagination - //----------------------------------------- - - $pages = $this->registry->output->generatePagination( array( - 'totalItems' => intval( $count['count'] ), - 'itemsPerPage' => $per_page, - 'currentStartValue' => $st, - 'baseUrl' => "{$this->settings['base_url']}{$this->form_code}&do=edit_word_pack&word_pack=".implode( '/', $pack )."&id={$id}&search={$keywordForPageLinks}&filter={$this->request['filter']}", - ) ); - - //----------------------------------------- - // Get the words - //----------------------------------------- - - $this->DB->build( array( - 'select' => '*', - 'from' => 'core_sys_lang_words', - 'where' => "lang_id={$id} {$wp_query} {$search} {$filter}", - 'limit' => array( $st, $per_page ), - 'order' => 'word_key ASC' - ) ); - $this->DB->execute(); - - $lang = array(); - - while( $r = $this->DB->fetch() ) - { - $lang[] = array( - 'id' => $r['word_id'], - 'default' => nl2br( htmlspecialchars( $r['word_default'], ENT_QUOTES ) ), - 'custom' => htmlspecialchars( $r['word_custom'], ENT_QUOTES ), - 'pack' => $r['word_app'] . '/' . $r['word_pack'], - 'key' => $r['word_key'] - ); - } - - //----------------------------------------- - // Output - //----------------------------------------- - - $this->registry->output->extra_nav[] = array( "{$this->settings['base_url']}{$this->form_code}&do=list_word_packs&id={$id}", $data['lang_title'] ); - $this->registry->output->extra_nav[] = array( '', $this->lang->words['language_word_pack_edit'] ); - $this->registry->output->html .= $this->html->languageWordPackEdit( $id, $lang, $pages ); - } - - /** - * List the word packs available for the selected language set - * - * @return @e void - * @author Josh - */ - public function languageListWordPacks() - { - //----------------------------------------- - // Init - //----------------------------------------- - - $id = intval( $this->request['id'] ); - - //----------------------------------------- - // Get language pack - //----------------------------------------- - - $data = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_lang', 'where' => "lang_id={$id}" ) ); - - $this->registry->output->extra_nav[] = array( "{$this->settings['base_url']}{$this->form_code}&do=list_word_packs&id={$data['lang_id']}", $data['lang_title'] ); - - //----------------------------------------- - // Get words - //----------------------------------------- - - $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_lang_words', 'where' => "lang_id={$id}" ) ); - $this->DB->execute(); - - //----------------------------------------- - // Some init before looping - //----------------------------------------- - - $_packs = array(); - $_missing = array(); - $_stats = array(); - - while( $r = $this->DB->fetch() ) - { - //----------------------------------------- - // Create our array - //----------------------------------------- - - $_stats[$r['word_app']] = isset( $_stats[$r['word_app']] ) ? $_stats[$r['word_app']] : array(); - $_stats[$r['word_app']][$r['word_pack']] = isset( $_stats[$r['word_app']][$r['word_pack']] ) ? $_stats[$r['word_app']][$r['word_pack']] : array(); - $_stats[$r['word_app']][$r['word_pack']]['total'] = isset( $_stats[$r['word_app']][$r['word_pack']]['total'] ) ? $_stats[$r['word_app']][$r['word_pack']]['total'] : 0; - - if( ! isset( $_packs[$r['word_app']] ) ) - { - $_packs[$r['word_app']] = array(); - } - - //----------------------------------------- - // Add this language pack to array - //----------------------------------------- - - if( ! in_array( $r['word_pack'], $_packs[$r['word_app']] ) ) - { - $_packs[$r['word_app']][] = $r['word_pack']; - } - - //----------------------------------------- - // Update stats - //----------------------------------------- - - $_stats[$r['word_app']][$r['word_pack']]['total']++; - - if( $r['word_custom'] ) - { - $_stats[$r['word_app']][$r['word_pack']]['custom']++; - - if( $r['word_custom_version'] < $r['word_default_version'] ) - { - $_stats[$r['word_app']][$r['word_pack']]['outofdate']++; - } - } - } - - //----------------------------------------- - // Loop through applications - //----------------------------------------- - - foreach( ipsRegistry::$applications as $app => $data ) - { - //----------------------------------------- - // Check if app has langs - //----------------------------------------- - - if( isset( $_packs[$app] ) && count( $_packs[$app] ) ) - { - $default_tab = ( $app == $this->request['app'] ) ? 1 : 0; - asort($_packs[$app]); - - $this->addTab( $data['app_title'], $this->html->languageAppPackList( $app, $_packs[$app], $_stats[$app] ), '', $default_tab ); - } - } - - //----------------------------------------- - // And output - //----------------------------------------- - - $this->registry->output->html .= $this->html->languageWordPackList( $id, $this->buildTabs(), $data['app_title'] ); - } - - /** - * Handles the language information form submit - * - * @param string $mode Either new or edit - * @return @e void - */ - public function handleLanguageInformationForm( $mode='new' ) - { - //----------------------------------------- - // Error checking - //----------------------------------------- - - $errors = array(); - - if( ! $this->request['lang_title'] ) - { - $errors[] = $this->lang->words['language_title_missing']; - } - - if( ! $this->request['lang_short'] ) - { - $errors[] = $this->lang->words['language_locale_missing']; - } - - if( count( $errors ) ) - { - $this->registry->output->global_message = implode( ', ', $errors ); - $this->languageInformationForm( $mode ); - return; - } - - //----------------------------------------- - // Build insert array - //----------------------------------------- - - $db_array = array( - 'lang_title' => $this->request['lang_title'], - 'lang_short' => $this->request['lang_short'], - 'lang_default' => $this->request['lang_default'], - 'lang_isrtl' => $this->request['lang_isrtl'], - ); - - //----------------------------------------- - // Adding or editing - //----------------------------------------- - - if( $mode == 'new' ) - { - //----------------------------------------- - // Default? - //----------------------------------------- - - if( $this->request['lang_default'] ) - { - $this->DB->update( 'core_sys_lang', array( 'lang_default' => 0 ) ); - - $db_array['lang_default'] = 1; - } - - //----------------------------------------- - // Insert and get id - //----------------------------------------- - - $this->DB->insert( 'core_sys_lang', $db_array ); - - $id = $this->DB->getInsertId(); - - //----------------------------------------- - // Create directory - //----------------------------------------- - - @mkdir( IPS_CACHE_PATH . 'cache/lang_cache/' . $id, IPS_FOLDER_PERMISSION ); - @file_put_contents( IPS_CACHE_PATH . 'cache/lang_cache/' . $id . '/index.html', '' ); - @chmod( IPS_CACHE_PATH . 'cache/lang_cache/' . $id, IPS_FOLDER_PERMISSION ); - - //----------------------------------------- - // Copy over language bits from default lang - //----------------------------------------- - - $default = $this->DB->buildAndFetch( array( 'select' => 'lang_id', 'from' => 'core_sys_lang', 'where' => "lang_default=1" ) ); - - $this->DB->build( array( 'select' => 'word_app,word_pack,word_key,word_default', 'from' => 'core_sys_lang_words', 'where' => "lang_id={$default['lang_id']}" ) ); - $q = $this->DB->execute(); - - while( $r = $this->DB->fetch( $q ) ) - { - $r['lang_id'] = $id; - $this->DB->insert( 'core_sys_lang_words', $r ); - } - - //----------------------------------------- - // Rebuild IPB and disk caches - //----------------------------------------- - - $this->registry->class_localization->rebuildLanguagesCache(); - $this->cacheToDisk($id); - - //----------------------------------------- - // Show listing - //----------------------------------------- - - $this->registry->output->global_message = $this->lang->words['language_pack_created']; - $this->languagesList(); - } - else - { - //----------------------------------------- - // Default? - //----------------------------------------- - - if( $this->request['lang_default'] ) - { - $this->DB->update( 'core_sys_lang', array( 'lang_default' => 0 ) ); - - $db_array['lang_default'] = 1; - } - - //----------------------------------------- - // Check ID and update - //----------------------------------------- - - $id = intval( $this->request['id'] ); - - $this->DB->update( 'core_sys_lang', $db_array, "lang_id={$id}" ); - - //----------------------------------------- - // Rebuild cache and show list - //----------------------------------------- - - $this->registry->class_localization->rebuildLanguagesCache(); - $this->registry->output->global_message = $this->lang->words['language_pack_updated']; - $this->languagesList(); - } - } - - /** - * Builds the language information form - * - * @param string $mode new or edit - * @return @e void - */ - public function languageInformationForm( $mode='new' ) - { - //----------------------------------------- - // Adding or editing - //----------------------------------------- - - if( $mode == 'new' ) - { - $title = $this->lang->words['language_form_new_title']; - $button = $this->lang->words['language_form_new_button']; - $op = 'do_new_language'; - $header = $this->lang->words['language_form_new_info']; - $data = array(0); - $id = 0; - } - else - { - $title = $this->lang->words['language_form_edit_title']; - $button = $this->lang->words['language_form_edit_button']; - $op = 'do_edit_lang_info'; - $header = $this->lang->words['language_form_edit_info']; - $id = intval( $this->request['id'] ); - - if( ! $id ) - { - $this->registry->output->showError( $this->lang->words['invalid_id'], 11147 ); - } - - //----------------------------------------- - // Get language pack info - //----------------------------------------- - - $data = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_lang', 'where' => "lang_id={$id}" ) ); - } - - //----------------------------------------- - // Set some defaults - //----------------------------------------- - - $data['lang_title'] = !empty( $this->request['lang_title'] ) ? $this->request['lang_title'] : $data['lang_title']; - $data['lang_short'] = !empty( $this->request['lang_short'] ) ? $this->request['lang_short'] : $data['lang_short']; - $data['lang_default'] = !empty( $this->request['lang_default'] ) ? $this->request['lang_default'] : $data['lang_default']; - $data['lang_isrtl'] = !empty( $this->request['lang_isrtl'] ) ? $this->request['lang_isrtl'] : $data['lang_isrtl']; - - $data['lang_default'] = $this->registry->output->formYesNo( 'lang_default', $data['lang_default'] ); - $data['lang_isrtl'] = $this->registry->output->formYesNo( 'lang_isrtl', $data['lang_isrtl'] ); - - //----------------------------------------- - // Show form - //----------------------------------------- - - $this->registry->output->extra_nav[] = array( '', $title ); - $this->registry->output->html .= $this->html->languageInformationForm( $op, $id, $title, $header, $data, $button ); - } - - /** - * Lists currently installed languages - * - * @return @e void - */ - public function languagesList() - { - /* Do we have a valid translation session? */ - $sessionData = $this->cache->getCache('translate_session'); - $hasTranslate = false; - - /* Check */ - if ( ! empty( $sessionData['lang_id'] ) AND count( $sessionData['files'] ) ) - { - $hasTranslate = true; - } - - /* Fallback for the recache all button */ - $forceEnglish = IPSCookie::get('forceEnglish'); - - if ( !$this->lang->words['language_list_recache'] || $forceEnglish ) - { - $this->lang->words['language_list_recache'] = 'Recache all...'; - } - - //----------------------------------------- - // Get languages - //----------------------------------------- - - $rows = array(); - - $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_lang' ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - /* Get Local Data */ - //setlocale( LC_ALL, $r['lang_short'] ); - IPSLib::setlocale( $r['lang_short'] ); - $this->registry->class_localization->local_data = localeconv(); - - $_menu = array(); - - if( $r['lang_protected'] && ! IN_DEV ) - { - $_menu[] = array( "", $this->lang->words['lang_pack_protected'], 'edit' ); - } - else - { - $_menu[] = array( "{$this->settings['base_url']}{$this->form_code}&do=list_word_packs&id={$r['lang_id']}", $this->lang->words['language_list_translate'], 'info' ); - - /* If we don't have a current session... */ - if ( ! $hasTranslate ) - { - $_menu[] = array( "{$this->settings['base_url']}{$this->form_code}&do=translateExtSplash&id={$r['lang_id']}", $this->lang->words['language_list_translate_ext'], 'info' ); - } - } - - $_menu[] = array( "{$this->settings['base_url']}{$this->form_code}&do=copy_lang_pack&id={$r['lang_id']}", $this->lang->words['language_list_copy'] ); - - $_menu[] = array( "{$this->settings['base_url']}{$this->form_code}&do=export&id={$r['lang_id']}", $this->lang->words['l_xmlexportfull'], 'export' ); - - if ( $r['lang_id'] ) - { - $_menu[] = array( "{$this->settings['base_url']}{$this->form_code}&do=rebuildFromXml&id={$r['lang_id']}&type=public", $this->lang->words['rebuild_lang_from_xml'] ); - } - - foreach( ipsRegistry::$applications as $app_dir => $app_data ) - { - $_menu[] = array( "{$this->settings['base_url']}{$this->form_code}&do=export&id={$r['lang_id']}&app_dir={$app_dir}", $this->lang->words['l_xmlexport'] . $app_data['app_title'], 'export' ); - } - - //----------------------------------------- - // Data for output - //----------------------------------------- - - $rows[] = array( 'title' => $r['lang_title'], - 'local' => $r['lang_short'], - 'date' => $this->registry->class_localization->getDate( time(), 'long', 1 ) . '
' . $this->registry->class_localization->getDate( time(), 'short', 1 ), - 'money' => $this->registry->class_localization->formatMoney( '12345231.12', 0 ), - 'default' => $r['lang_default'], - 'menu' => $_menu, - 'id' => $r['lang_id'], - 'protected'=> $r['lang_protected'], - ); - } - - //----------------------------------------- - // Reset locale - //----------------------------------------- - - IPSLib::setlocale( $this->registry->class_localization->local ); - //setlocale( LC_ALL, $this->registry->class_localization->local ); - $this->registry->class_localization->local_data = localeconv(); - - //----------------------------------------- - // Output - //----------------------------------------- - - $this->registry->output->html .= $this->html->languages_list( $rows, $hasTranslate ); - } - - /** - * Updates the cached language files from the database - * - * @param integer ID of the language pack to export - * @param string Just cache one app? - * @return @e void - */ - public function cacheToDisk( $lang_id, $app_override='' ) - { - /* Generate cached warning */ - $warnString = "/*******************************************************\nNOTE: This is a cache file generated by IP.Board on " . date( "r" ) . " by " . $this->memberData['members_display_name'] . "\nDo not translate this file as you will lose your translations next time you edit via the ACP\nPlease translate via the ACP\n*******************************************************/\n\n"; - - //----------------------------------------- - // Build where statement - //----------------------------------------- - - if ( $lang_id == 'master' ) - { - $lang_id = 'master_lang'; - $where = "lang_id=1"; - } - else if( $lang_id AND $lang_id != 1 ) - { - $where = "lang_id={$lang_id}"; - } - else - { - $lang_id = 1; - $where = "lang_id=1"; - } - - //----------------------------------------- - // If missing directory, create - //----------------------------------------- - - if( ! is_dir( IPS_CACHE_PATH . 'cache/lang_cache/' . $lang_id . '/' ) ) - { - mkdir( IPS_CACHE_PATH . 'cache/lang_cache/' . $lang_id . '/', IPS_FOLDER_PERMISSION ); - } - - /* Loop over apps */ - $this->DB->build( array( 'select' => 'DISTINCT(word_app) as word_app', - 'from' => 'core_sys_lang_words', - 'limit' => array(0, 100 ) ) ); # Because you never know. - - $o = $this->DB->execute(); - - while( $langApps = $this->DB->fetch( $o ) ) - { - - if ( $app_override ) - { - if ( $app_override != $langApps['word_app'] ) - { - continue; - } - } - - //----------------------------------------- - // Get the words - //----------------------------------------- - - $this->DB->build( array( 'select' => 'word_custom, word_default, word_app, word_pack, word_key', - 'from' => 'core_sys_lang_words', - 'where' => $where . " AND word_app='" . $langApps['word_app'] . "'", - 'order' => 'word_key ASC' ) ); - - $i = $this->DB->execute(); - - $words_by_file = array(); - - while( $r = $this->DB->fetch( $i ) ) - { - $_text = ( $r['word_custom'] ) ? $r['word_custom'] : $r['word_default']; - $words_by_file[$r['word_app']][$r['word_pack']][] = array( $r['word_key'], $_text ); - } - - //----------------------------------------- - // Now loop and write to file - //----------------------------------------- - - foreach( $words_by_file as $app => $word_packs ) - { - foreach( $word_packs as $pack => $words ) - { - if( $pack == 'public_js' ) - { - $to_write = ''; - $_file = 'ipb.lang.js'; - - foreach( $words as $word ) - { - $word[1] = str_replace( "\\", "\\\\", $word[1] ); - $word[1] = str_replace( '"', '\\"', $word[1] ); - $to_write .= "ipb.lang['{$word[0]}'] = \"{$word[1]}\";\n"; - } - } - else if( $pack == 'admin_js' ) - { - $to_write = ''; - $_file = 'acp.lang.js'; - - foreach( $words as $word ) - { - $word[1] = str_replace( "\\", "\\\\", $word[1] ); - $word[1] = str_replace( '"', '\\"', $word[1] ); - $to_write .= "ipb.lang['{$word[0]}'] = \"{$word[1]}\";\n"; - } - } - else - { - //----------------------------------------- - // Build cache file contents - //----------------------------------------- - - $to_write = " \"{$word[1]}\",\n"; - } - - $to_write .= " ); \n"; - } - - //----------------------------------------- - // Write the file - //----------------------------------------- - - $_dir = IPS_CACHE_PATH . 'cache/lang_cache/' . $lang_id . '/'; - - if( is_file($_dir . $_file) ) - { - @unlink( $_dir . $_file ); - } - - if ( $fh = @fopen( $_dir . $_file, 'wb' ) ) - { - fwrite( $fh, $to_write, strlen( $to_write ) ); - fclose( $fh ); - @chmod( $_dir . $_file, IPS_FILE_PERMISSION ); - } - else - { - $this->cache_errors[] = $this->lang->words['l_nowrite'] . $_dir . $_file; - } - } - } - } - } - - /** - * Imports language packs from an xml file and updates the database and recaches the languages - * - * @param integer $lang_id ID of the language pack to import - * @param bool $in_dev Set to 1 for developer language import - * @param bool $no_return If set to 1, this function will return a value, rather than outputting data - * @param string $app_override Overrides the application for which languages are being imported - * @param bool $skip_charset Skips charset conversion in the XML file (useful during upgrade routine as strings don't need to be converted) - * @return mixed - */ - public function imprtFromXML( $lang_id=0, $in_dev=0, $no_return=0, $app_override='', $skip_charset=false, $ru = '' ) - { - //----------------------------------------- - // Set version.. - //----------------------------------------- - - $LATESTVERSION = IPSLib::fetchVersionNumber(); - - //----------------------------------------- - // INDEV? - //----------------------------------------- - - if ( $in_dev ) - { - $_FILES['FILE_UPLOAD']['name'] = ''; - } - else if( $this->request['file_location'] ) - { - $this->request['file_location'] = IPS_ROOT_PATH . $this->request['file_location']; - } - - //----------------------------------------- - // Not an upload? - //----------------------------------------- - - if ( $_FILES['FILE_UPLOAD']['name'] == "" or ! $_FILES['FILE_UPLOAD']['name'] or ($_FILES['FILE_UPLOAD']['name'] == "none") ) - { - //----------------------------------------- - // Check and load from server - //----------------------------------------- - - if ( ! $this->request['file_location'] ) - { - $this->registry->output->global_message = $this->lang->words['l_nofile']; - $this->languagesList(); - return; - } - - if ( ! is_file( $this->request['file_location'] ) ) - { - $this->registry->output->global_message = $this->lang->words['l_noopen'] . $this->request['file_location']; - $this->languagesList(); - return; - } - - if ( preg_match( '#\.gz$#', $this->request['file_location'] ) ) - { - if ( $FH = @gzopen( $this->request['file_location'], 'rb' ) ) - { - while ( ! @gzeof( $FH ) ) - { - $content .= @gzread( $FH, 1024 ); - } - - @gzclose( $FH ); - } - } - else - { - $content = file_get_contents( $this->request['file_location'] ); - } - - $originalContent = $content; - - //----------------------------------------- - // Extract archive - //----------------------------------------- - - require_once( IPS_KERNEL_PATH.'classXMLArchive.php' );/*noLibHook*/ - $xmlarchive = new classXMLArchive(); - - //----------------------------------------- - // Read the archive - //----------------------------------------- - - $xmlarchive->readXML( $content ); - - //----------------------------------------- - // Get the data - //----------------------------------------- - - $content = ''; - - foreach( $xmlarchive->asArray() as $k => $f ) - { - if( $k == 'language_entries.xml' ) - { - $content = $f['content']; - break; - } - } - - //----------------------------------------- - // No content from de-archiving, must not - // be archive, but rather raw XML file - //----------------------------------------- - - if( $content == '' AND strpos( $originalContent, "registry->output->global_message = sprintf( $this->lang->words['lang_upload_too_large'], ini_get( 'upload_max_filesize' ) ); - $this->languagesList(); - return; - break; - - default: - $this->registry->output->global_message = $this->lang->words['lang_upload_other_error']; - $this->languagesList(); - return; - break; - } - } - - //----------------------------------------- - // Get content - //----------------------------------------- - - try - { - $uploadedContent = $this->registry->adminFunctions->importXml( $tmp_name ); - } - catch ( Exception $e ) - { - $this->registry->output->showError( $e->getMessage() ); - } - - //----------------------------------------- - // Extract archive - //----------------------------------------- - - require_once( IPS_KERNEL_PATH.'classXMLArchive.php' );/*noLibHook*/ - $xmlarchive = new classXMLArchive(); - - //----------------------------------------- - // Read the archive - //----------------------------------------- - - $xmlarchive->readXML( $uploadedContent ); - - //----------------------------------------- - // Get the data - //----------------------------------------- - - $content = ''; - - foreach( $xmlarchive->asArray() as $k => $f ) - { - if( $k == 'language_entries.xml' ) - { - $content = $f['content']; - break; - } - } - - //----------------------------------------- - // No content from de-archiving, must not - // be archive, but rather raw XML file - //----------------------------------------- - - if( $content == '' AND strpos( $uploadedContent, "registry->output->global_message = $this->lang->words['l_badfile']; - $this->languagesList(); - return; - } - - //----------------------------------------- - // Get xml class - //----------------------------------------- - - require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ - - $xml = new classXML( $skip_charset ? 'utf-8' : IPS_DOC_CHAR_SET ); - $xml->loadXML( $content ); - - //----------------------------------------- - // Is this full language pack?... - //----------------------------------------- - - foreach( $xml->fetchElements('langinfo') as $lang_data ) - { - $lang_info = $xml->fetchElementsFromRecord( $lang_data ); - - $lang_data = array( - 'lang_short' => $lang_info['lang_short'], - 'lang_title' => $lang_info['lang_title'], - ); - } - - $lang_ids = array(); - $insertId = 0; - - //----------------------------------------- - // Do we have language pack info? - //----------------------------------------- - - if( $lang_data['lang_short'] ) - { - //----------------------------------------- - // Does this pack already exist - //----------------------------------------- - - $update_lang = $this->DB->buildAndFetch( array( - 'select' => 'lang_id', - 'from' => 'core_sys_lang', - 'where' => "lang_short='{$lang_data['lang_short']}'", - ) ); - - //----------------------------------------- - // If doesn't exist, then create new pack - //----------------------------------------- - - if( !$update_lang['lang_id'] ) - { - $this->DB->insert( 'core_sys_lang', $lang_data ); - - $insertId = $this->DB->getInsertId(); - - if( @mkdir( IPS_CACHE_PATH . '/cache/lang_cache/' . $insertId ) ) - { - @file_put_contents( IPS_CACHE_PATH . 'cache/lang_cache/' . $insertId . '/index.html', '' ); - @chmod( IPS_CACHE_PATH . '/cache/lang_cache/' . $insertId, IPS_FOLDER_PERMISSION ); - } - - //----------------------------------------- - // Copy over language bits from default lang - //----------------------------------------- - - $default = $this->DB->buildAndFetch( array( 'select' => 'lang_id', 'from' => 'core_sys_lang', 'where' => "lang_default=1" ) ); - - $this->DB->build( array( 'select' => 'word_app,word_pack,word_key,word_default,word_js', 'from' => 'core_sys_lang_words', 'where' => "lang_id={$default['lang_id']}" ) ); - $q = $this->DB->execute(); - - while( $r = $this->DB->fetch( $q ) ) - { - $r['lang_id'] = $insertId; - $r['word_custom'] = ''; - - $this->DB->insert( 'core_sys_lang_words', $r ); - } - - //----------------------------------------- - // Rebuild IPB and disk caches - //----------------------------------------- - - $this->registry->class_localization->rebuildLanguagesCache(); - } - else - { - $insertId = $update_lang['lang_id']; - } - } - - //----------------------------------------- - // We need to add language bits to every pack.. - //----------------------------------------- - - $this->DB->build( array( 'select' => 'lang_id', 'from' => 'core_sys_lang' ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $lang_ids[] = $r['lang_id']; - } - - //----------------------------------------- - // Init counts array - //----------------------------------------- - - $counts = array( 'updates' => 0, 'inserts' => 0 ); - - //----------------------------------------- - // Init a cache array to save entries - //----------------------------------------- - - $lang_entries = array(); - - if( $app_override ) - { - $this->DB->build( array( 'select' => "MD5( CONCAT( lang_id, '-', word_app, '-', word_pack, '-', word_key ) ) as word_lookup, word_id, md5(word_default) as word_default, word_default_version", - 'from' => 'core_sys_lang_words', - 'where' => "word_app='{$app_override}' AND lang_id IN(" . implode( ",", $lang_ids ) . ")" ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $lang_entries[ $r['word_lookup'] ] = $r; - } - } - - //----------------------------------------- - // Start looping - //----------------------------------------- - - $_lastLookup = ''; - - foreach( $xml->fetchElements('lang') as $entry ) - { - $lang = $xml->fetchElementsFromRecord( $entry ); - - foreach( $lang_ids as $_lang_id ) - { - $lang_entry = array(); - - //----------------------------------------- - // Build db array - //----------------------------------------- - - $db_array = array( - 'lang_id' => $_lang_id, - 'word_app' => $app_override ? $app_override : $lang['word_app'], - 'word_pack' => $lang['word_pack'], - 'word_key' => $lang['word_key'], - 'word_default' => $lang['word_default'], - 'word_custom' => $in_dev && !$ru ? '' : $lang['word_custom'], - 'word_js' => intval($lang['word_js']), - 'word_default_version' => $lang['word_default_version'] ? $lang['word_default_version'] : $LATESTVERSION['long'], - 'word_custom_version' => $lang['word_custom_version'], - ); - - $dbKey = md5( $db_array['lang_id'] . '-' . $db_array['word_app'] . '-' . $db_array['word_pack'] . '-' . $db_array['word_key'] ); - $langIdKey = md5( $_lang_id . '-' . $db_array['word_app'] . '-' . $db_array['word_pack'] . '-' . $db_array['word_key'] ); - - // If the default value hasn't changed, we don't need to update the word_default_version (see bug report 19172) - if ( md5( $lang['word_default'] ) == $lang_entries[ $dbKey ]['word_default'] ) - { - $db_array['word_default_version'] = $lang_entries[ $dbKey ]['word_default_version']; - } - - //----------------------------------------- - // If cached, get from cache - //----------------------------------------- - - if ( $lang_entries[ $langIdKey ] ) - { - $lang_entry = $lang_entries[ $langIdKey ]; - } - - //----------------------------------------- - // Otherwise get all langs from this entry and - // put in cache - //----------------------------------------- - - else if( ! $app_override ) - { - if( $_lastLookup != md5( $db_array['word_app'] . '-' . $db_array['word_pack'] ) ) - { - unset( $lang_entries ); - } - - $_lastLookup = md5( $db_array['word_app'] . '-' . $db_array['word_pack'] ); - - $this->DB->build( array( - 'select' => '*', - 'from' => 'core_sys_lang_words', - 'where' => "lang_id={$_lang_id} AND word_app='{$db_array['word_app']}' AND word_pack='{$db_array['word_pack']}'" - ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $lang_entries[ md5( $r['lang_id'] . '-' . $r['word_app'] . '-' . $r['word_pack'] . '-' . $r['word_key'] ) ] = $r; - } - - if ( $lang_entries[ $langIdKey ] ) - { - $lang_entry = $lang_entries[ $langIdKey ]; - } - } - - //----------------------------------------- - // Didn't find any match? Must be importing - // a new language pack, huh? - //----------------------------------------- - - if ( !isset( $lang_entry['word_id'] ) ) - { - //continue 2; - } - - //----------------------------------------- - // If there is no new custom lang bit to insert - // don't delete what is already there. - //----------------------------------------- - - if( !$db_array['word_custom'] || ( $insertId > 0 && $insertId != $_lang_id ) ) - { - unset($db_array['word_custom']); - unset($db_array['word_custom_version']); - } - - //----------------------------------------- - // Lang bit already exists, update - //----------------------------------------- - - if ( $lang_entry['word_id'] AND ( ! $insertId OR ( $insertId == $_lang_id ) ) ) - { - //----------------------------------------- - // Don't update default version - //----------------------------------------- - - // This causes no languages to show "out of date" on upgrade - // @link http://community.invisionpower.com/tracker/issue-31637-no-out-of-date-entries-for-language-string-updates - // This WAS added to fix a previously reported bug, however, so need to watch out for this - // unset( $db_array['word_default_version'] ); - - $counts['updates']++; - $this->DB->update( 'core_sys_lang_words', $db_array, "word_id={$lang_entry['word_id']}" ); - } - - //----------------------------------------- - // Lang bit doesn't exist, so insert - //----------------------------------------- - - else if( ! $lang_entry['word_id'] ) - { - /* Ensure there is a value to avoid null */ - if ( ! $db_array['word_custom'] ) - { - $db_array['word_custom'] = ''; - } - - /* Ensure custom word but isn't added to other packs that simply had missing strings */ - if ( $insertId AND $insertId != $_lang_id ) - { - $db_array['word_custom'] = ''; - } - - $counts['inserts']++; - $this->DB->insert( 'core_sys_lang_words', $db_array ); - } - - unset( $lang_entry, $db_array ); - } - } - - /* Save some memory */ - unset( $lang_entries ); - - //----------------------------------------- - // Recache all our lang packs - //----------------------------------------- - - foreach( $lang_ids as $_lang_id ) - { - $this->cacheToDisk( $_lang_id, $app_override ); - } - - //----------------------------------------- - // Set output message - //----------------------------------------- - - $this->registry->output->global_message = sprintf( $this->lang->words['l_updatedcount'], $counts['updates'], $counts['inserts'] ); - - if ( is_array( $this->cache_errors ) AND count( $this->cache_errors ) ) - { - $this->registry->output->global_message .= "
" . implode( "
", $this->cache_errors ); - } - - //----------------------------------------- - // Free a little memory - //----------------------------------------- - - unset( $xml ); - - //----------------------------------------- - // Update IPB cache - //----------------------------------------- - - $this->registry->class_localization->rebuildLanguagesCache(); - - //----------------------------------------- - // Return! Now! - //----------------------------------------- - - if ( ! $no_return ) - { - $this->languagesList(); - return; - } - } - - /** - * Export language entries to xml file - * - * @param integer $lang_id Language pack to export - * @param bool $disk Save to disk instead - * @return void - */ - public function languageExportToXML( $lang_id, $disk=false ) - { - //----------------------------------------- - // Init - //----------------------------------------- - - $app_dir = trim( $this->request['app_dir'] ); - $type = trim( $this->request['type'] ); - $_where = ''; - $_name = 'language.xml'; - $LATESTVERSION = IPSLib::fetchVersionNumber(); - $doPack = true; - - //----------------------------------------- - // Filter - //----------------------------------------- - - if ( $app_dir ) - { - $_where = " AND word_app='" . $app_dir . "'"; - $_name = $app_dir . '_language_pack.xml'; - $doPack = false; - } - - if ( $type ) - { - if ( $type == 'admin' ) - { - $_where .= " AND word_pack LIKE 'admin_%'"; - $_name = 'admin_' . $_name; - } - else - { - $_where .= " AND word_pack LIKE 'public_%'"; - $_name = 'public_' . $_name; - } - - $doPack = false; - } - - //----------------------------------------- - // Create the XML library - //----------------------------------------- - - require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ - $xml = new classXML( IPS_DOC_CHAR_SET ); - $xml->newXMLDocument(); - $xml->addElement( 'languageexport' ); - $xml->addElement( 'languagegroup', 'languageexport' ); - - //----------------------------------------- - // Get language pack - //----------------------------------------- - - $data = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_lang', 'where' => "lang_id={$lang_id}" ) ); - - //----------------------------------------- - // Add pack if necessary - //----------------------------------------- - - if( $doPack ) - { - $xml->addElementAsRecord( 'languagegroup', 'langinfo', $data ); - } - - //----------------------------------------- - // Get the words - //----------------------------------------- - - $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_lang_words', 'where' => "lang_id={$lang_id}" . $_where ) ); - $this->DB->execute(); - - //----------------------------------------- - // Add words to export - //----------------------------------------- - - $word_packs = array(); - $_strings = 0; - - while( $r = $this->DB->fetch() ) - { - $content = array(); - $_strings++; - - if( $disk ) - { - $content = array( - 'word_app' => $r['word_app'], - 'word_pack' => $r['word_pack'], - 'word_key' => $r['word_key'], - 'word_default' => $r['word_default'], - //'word_default_version' => ( $r['word_default_version'] >= 30000 ) ? $r['word_default_version'] : $LATESTVERSION['long'], - //'word_js' => $r['word_js'] - ); - - if( $r['word_js'] ) - { - $content['word_js'] = $r['word_js']; - } - if( $r['word_custom'] ) - { - $content['word_custom']=$r['word_custom']; - $content['word_custom_version'] = ($r['word_custom_version'])?$r['word_custom_version']:( $r['word_default_version'] )?$r['word_default_version']:$LATESTVERSION['long']; - } - - } - else - { - $content = array( - 'word_app' => $r['word_app'], - 'word_pack' => $r['word_pack'], - 'word_key' => $r['word_key'], - 'word_default' => $r['word_default'], - 'word_custom' => $r['word_custom'], - 'word_default_version' => ( $r['word_default_version'] >= 30000 ) ? $r['word_default_version'] : $LATESTVERSION['long'], - 'word_custom_version' => $r['word_custom_version'], - 'word_js' => $r['word_js'] - ); - } - - $xml->addElementAsRecord( 'languagegroup', 'lang', $content ); - } - - //----------------------------------------- - // Got any strings? - //----------------------------------------- - - if( !$_strings ) - { - if( $disk ) - { - return false; - } - else - { - $this->registry->output->global_message = $this->lang->words['l_nolangbits']; - $this->languagesList(); - return; - } - } - - //----------------------------------------- - // Write to disk or output to browser - //----------------------------------------- - - if( $disk ) - { - @unlink( IPSLib::getAppDir($app_dir) . '/xml/' . $_name ); - @file_put_contents( IPSLib::getAppDir($app_dir) . '/xml/' . $_name, $xml->fetchDocument() ); - return true; - } - else - { - //----------------------------------------- - // Create xml archive - //----------------------------------------- - - require_once( IPS_KERNEL_PATH . 'classXMLArchive.php' );/*noLibHook*/ - $xmlArchive = new classXMLArchive(); - - //----------------------------------------- - // Add XML document - //----------------------------------------- - - $xmlArchive->add( $xml->fetchDocument(), 'language_entries.xml' ); - - //----------------------------------------- - // Print to browser - //----------------------------------------- - - $this->registry->output->showDownload( $xmlArchive->getArchiveContents(), $_name ); - exit(); - } - } - - /** - * Builds the language db entries from cache - * - * @param boolean return as normal - * @return @e void - * @author Josh - */ - public function importFromCacheFiles( $returnAsNormal=TRUE ) - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $msg = array(); - $lang_id = 1; - $LATESTVERSION = IPSLib::fetchVersionNumber(); - - //----------------------------------------- - // Check - //----------------------------------------- - - if ( ! is_array( $_POST['apps'] ) ) - { - $this->registry->output->global_message = $this->lang->words['l_noapp']; - $this->languagesList(); - return; - } - - //----------------------------------------- - // Loop through apps... - //----------------------------------------- - - foreach( ipsRegistry::$applications as $app => $app_data ) - { - if ( in_array( $app, $_POST['apps'] ) ) - { - //----------------------------------------- - // Get directory - //----------------------------------------- - - $_dir = IPS_CACHE_PATH . 'cache/lang_cache/master_lang/'; - - //----------------------------------------- - // Go through directories - //----------------------------------------- - - if ( is_dir( $_dir ) ) - { - $dh = opendir( $_dir ); - - while( $f = readdir( $dh ) ) - { - if ( $f[0] == '.' || $f == 'index.html' ) - { - continue; - } - - if ( preg_match( "#^" . $app . '_\S+?\.php$#', $f ) ) - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $updated = 0; - $inserted = 0; - $word_pack = preg_replace( "#^" . $app . '_(\S+?)\.php$#', "\\1", $f ); - $lang = array(); - $db_lang = array(); - - //----------------------------------------- - // Delete current language bits - //----------------------------------------- - - $this->DB->delete( 'core_sys_lang_words', "lang_id=1 AND word_app='" . $app . "' AND word_pack='" . $word_pack . "'" ); - - if ( IPS_IS_SHELL ) - { - $stdout = fopen('php://stdout', 'w'); - fwrite( $stdout, 'Processing: ' . $f . "\n" ); - fclose( $stdout ); - } - - require( $_dir . $f );/*noLibHook*/ - - //----------------------------------------- - // Loop - //----------------------------------------- - - foreach( $lang as $k => $v ) - { - $inserted++; - - $insert = array( - 'lang_id' => $lang_id, - 'word_app' => $app, - 'word_pack' => $word_pack, - 'word_key' => $k, - 'word_default' => IPSText::encodeForXml($v), - 'word_default_version' => $LATESTVERSION['long'], - 'word_js' => 0, - ); - - $this->DB->insert( 'core_sys_lang_words', $insert ); - } - - $msg[] = sprintf( $this->lang->words['indev_lang_import'], $f, $inserted, $updated ); - } - else if( preg_match( '/(\.js)$/', $f ) AND $app == 'core' ) - { - $_js_word_pack = ''; - - if( $f == 'ipb.lang.js' ) - { - $_js_word_pack = 'public_js'; - } - else if( $f == 'acp.lang.js' ) - { - $_js_word_pack = 'admin_js'; - } - - //----------------------------------------- - // Delete current words for this app and word pack - //----------------------------------------- - - $this->DB->delete( 'core_sys_lang_words', "lang_id=1 AND word_app='" . $app . "' AND word_pack='" . $_js_word_pack . "'" ); - - if ( IPS_IS_SHELL ) - { - $stdout = fopen('php://stdout', 'w'); - fwrite( $stdout, 'Processing: ' . $f . "\n" ); - fclose( $stdout ); - } - - //----------------------------------------- - // Get each line - //----------------------------------------- - - $js_file = file( $_dir . $f ); - - //----------------------------------------- - // Loop through lines and import - //----------------------------------------- - - foreach( $js_file as $r ) - { - //----------------------------------------- - // preg_match what we want - //----------------------------------------- - - preg_match( '#ipb\.lang\[\'(.+?)\'\](.+?)= ["\'](.+?)["\'];#', $r, $matches ); - - //----------------------------------------- - // Valid? - //----------------------------------------- - - if( $matches[1] && $matches[3] ) - { - $inserted++; - $insert = array( - 'lang_id' => $lang_id, - 'word_app' => 'core', - 'word_pack' => $_js_word_pack, - 'word_key' => $matches[1], - 'word_default' => IPSText::encodeForXml($matches[3]), - 'word_js' => 1, - ); - $this->DB->insert( 'core_sys_lang_words', $insert ); - } - } - } - } - - closedir( $dh ); - } - } - } - - //----------------------------------------- - // Done... - //----------------------------------------- - - if ( $returnAsNormal === TRUE ) - { - $this->registry->output->setMessage( implode( "
", $msg ), true ); - - if ( ! $this->__daily ) - { - $this->languagesList(); - } - } - else - { - return $msg; - } - } + + * Invision Power Services + * IP.Board v3.4.6 + * Language Pack Management + * Last Updated: $LastChangedDate: 2013-10-14 17:55:18 -0400 (Mon, 14 Oct 2013) $ + * + * + * @author $Author: rashbrook $ + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license http://www.invisionpower.com/company/standards.php#license + * @package IP.Board + * @subpackage Core + * @link http://www.invisionpower.com + * @version $Rev: 12377 $ + */ + +if ( ! defined( 'IN_ACP' ) ) +{ + print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; + exit(); +} + +class admin_core_languages_manage_languages extends ipsCommand +{ + /** + * Daily flag + * + * @var bool + */ + private $__daily = false; + + /** + * Tab buttons + * + * @var array + */ + public $tab_buttons = array(); + + /** + * Tabs + * + * @var array + */ + public $tab_tabs = array(); + + /** + * Javascript action to execute on tab click + * + * @var string + */ + public $tab_js_action = ''; + + /** + * Default tab + * + * @var string + */ + public $default_tab = ''; + + /** + * Main class entry point + * + * @param object ipsRegistry reference + * @return @e void [Outputs to screen] + */ + public function doExecute( ipsRegistry $registry ) + { + //----------------------------------------- + // Get skin and language file + //----------------------------------------- + + $this->html = $this->registry->output->loadTemplate( 'cp_skin_system', 'core' ); + $this->registry->class_localization->loadLanguageFile( array( 'admin_system' ), 'core' ); + + //----------------------------------------- + // Set urls + //----------------------------------------- + + $this->form_code = $this->html->form_code = 'module=languages&section=manage_languages&'; + $this->form_code_js = $this->html->form_code_js = 'module=languages§ion=manage_languages&'; + + //----------------------------------------- + // Go + //----------------------------------------- + + switch( $this->request['do'] ) + { + case 'copy_lang_pack': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_words' ); + $this->languageCopy(); + break; + + case 'edit_word_entry': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_words' ); + $this->languageWordEntryForm( 'edit' ); + break; + + case 'do_edit_word_entry': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_words' ); + $this->handleWordEntryForm( 'edit' ); + break; + + case 'add_word_entry': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_words' ); + $this->languageWordEntryForm( 'add' ); + break; + + case 'do_add_word_entry': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_words' ); + $this->handleWordEntryForm( 'add' ); + break; + + case 'list_word_packs': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_words' ); + $this->languageListWordPacks(); + break; + + case 'edit_word_pack': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_words' ); + $this->languageEditWordPack(); + break; + + case 'do_edit_word_pack': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_packs' ); + $this->languageEditWordPackValues(); + break; + + case 'edit_lang_info': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_pack_info' ); + $this->languageInformationForm( 'edit' ); + break; + + case 'do_edit_lang_info': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_pack_info' ); + $this->handleLanguageInformationForm( 'edit' ); + break; + + case 'new_language': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_packs' ); + $this->languageInformationForm( 'new' ); + break; + + case 'do_new_language': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_packs' ); + $this->handleLanguageInformationForm( 'new' ); + break; + + case 'language_swap': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_pack_info' ); + $this->swapLanguages(); + break; + + case 'revert': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'lang_words' ); + $this->languageDoRevertWord(); + break; + + case 'export': + $this->languageExportToXML( intval( $this->request['id'] ) ); + break; + + case 'language_do_import': + $this->imprtFromXML( intval( $this->request['id'] ) ); + break; + + case 'language_do_indev_export': + foreach( ipsRegistry::$applications as $app_dir => $app_data ) + { + $this->request['app_dir'] = $app_dir; + + $this->request['type'] = 'admin'; + $this->languageExportToXML( 1, 1 ); + + $this->request['type'] = 'public'; + $this->languageExportToXML( 1, 1 ); + } + + $this->registry->output->setMessage( $this->lang->words['indev_lang_export_done'], 1 ); + $this->languagesList(); + break; + + case 'language_do_indev_import': + $this->importFromCacheFiles(); + break; + + case 'remove_language': + $this->languageRemove(); + break; + + case 'remove_word_entry': + $this->removeWordEntry(); + break; + + case 'remove_word_pack': + $this->removeWordPack(); + break; + + case 'rebuildFromXml': + $this->rebuildFromXml(); + break; + + case 'recache_lang_pack': + $this->recacheLangPack(); + break; + + case 'translateExtSplash': + $this->translateExtSplash(); + break; + + case 'translateImport': + $this->translateImport(); + break; + + case 'translateKill': + $this->translateKill(); + break; + + default: + $this->languagesList(); + break; + } + + //----------------------------------------- + // Pass to CP output hander + //----------------------------------------- + + $this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper(); + $this->registry->output->sendOutput(); + } + + /** + * Swap member language choice globally + * + * @return @e void + */ + public function swapLanguages() + { + /* INIT */ + $langFrom = intval( $this->request['lang_from'] ); + $langTo = intval( $this->request['lang_to'] ); + + /* Run query... */ + if( !$langFrom ) + { + $this->DB->update( 'members', array( 'language' => $langTo > 0 ? $langTo : 0 ), "language=0 OR language " . $this->DB->buildIsNull( true ) ); + } + else + { + $this->DB->update( 'members', array( 'language' => $langTo > 0 ? $langTo : 0 ), "language=" . intval( $langFrom ) ); + } + + /* Done */ + $this->registry->output->global_message = $this->lang->words['mem_lang_choice_swapped']; + $this->languagesList(); + return; + } + + /** + * Finish a session and remove data + * + * @return @e void + */ + public function translateKill() + { + /* INIT */ + $langId = intval( $this->request['id'] ); + $mainDir = DOC_IPS_ROOT_PATH . 'translate'; + $words_by_file = array(); + $errors = array(); + $filesToImport = array(); + + /* Start top message */ + if ( ! is_dir( $mainDir ) ) + { + /* Just bounce back asking them to create translate */ + $this->registry->output->global_error = $this->lang->words['ext_no_translate_dir']; + $this->languagesList(); + return; + } + + if ( ! is_writeable( $mainDir ) ) + { + /* Just bounce back asking them to chmod translate */ + $this->registry->output->global_error = $this->lang->words['ext_chmod_translate_dir']; + $this->languagesList(); + return; + } + + /* Load kernel class for file management */ + $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' ); + $classFileManagement = new $classToLoad(); + + /* Remove files */ + $classFileManagement->emptyDirectory( $mainDir ); + + /* Delete session */ + $this->cache->deleteCache( 'translate_session' ); + + /* Done */ + $this->registry->output->global_message = $this->lang->words['ext_all_killed']; + $this->languagesList(); + return; + } + + /** + * Translate externally import changed files + * + * @return @e void + */ + public function translateImport() + { + /* INIT */ + $langId = intval( $this->request['id'] ); + $mainDir = DOC_IPS_ROOT_PATH . 'translate'; + $words_by_file = array(); + $errors = array(); + $filesToImport = array(); + $fileCount = 0; + + /* Start top message */ + if ( ! is_dir( $mainDir ) ) + { + /* Just bounce back asking them to create translate */ + $this->registry->output->global_error = $this->lang->words['ext_no_translate_dir']; + $this->languagesList(); + return; + } + + if ( ! is_writeable( $mainDir ) ) + { + /* Just bounce back asking them to chmod translate */ + $this->registry->output->global_error = $this->lang->words['ext_chmod_translate_dir']; + $this->languagesList(); + return; + } + + /* Get file count */ + try + { + foreach( new DirectoryIterator( $mainDir ) as $f ) + { + if ( !$f->isDir() ) + { + $fileCount++; + } + } + } + catch ( Exception $e ) + { + $fileCount = 0; + } + + /* Get lang */ + $lang = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_lang', 'where' => 'lang_id=' . $langId ) ); + + /* Get current session if one */ + $sessionData = $this->cache->getCache('translate_session'); + + /* Check */ + if ( empty( $sessionData['lang_id'] ) OR ! count( $sessionData['files'] ) OR !$fileCount ) + { + /* Just bounce back asking them to create translate */ + $this->registry->output->global_error = $this->lang->words['ext_no_translate_files']; + $this->languagesList(); + return; + } + + /* Still here? Okay */ + if ( is_array( $_POST['cb'] ) AND count( $_POST['cb'] ) ) + { + /* Gather a list of files to import */ + foreach( $_POST['cb'] as $file => $value ) + { + if ( $_POST['cb'][ $file ] ) + { + $filesToImport[ $file ] = $file; + } + } + + /* Assume nothing */ + if ( count( $filesToImport ) ) + { + $counts = $this->_importFromDisk( $mainDir, $sessionData['lang_id'], array_keys( $filesToImport ), true ); + + foreach( $counts as $file => $data ) + { + /* Update session data */ + $sessionData['files'][ $file ]['dbtime'] = time(); + + $this->registry->output->global_message = sprintf( $this->lang->words['ext_file_written'], $file, intval( $data['inserts'] ), intval( $data['updates'] ) ); + } + + $this->registry->output->global_message .= '
' . sprintf( $this->lang->words['ext_recache'], "{$this->settings['base_url']}&{$this->form_code}&do=recache_lang_pack&id={$sessionData['lang_id']}" ); + + /* Update session */ + $this->cache->setCache( 'translate_session', $sessionData, array( 'array' => 1, 'donow' => 1 ) ); + + $this->translateExtSplash(); + return; + } + } + else + { + /* Just bounce back asking them to create translate */ + $this->registry->output->global_error = $this->lang->words['ext_no_selected_files']; + $this->translateExtSplash(); + return; + } + } + + /** + * Translate externally splash + * + * @return @e void + */ + public function translateExtSplash() + { + /* INIT */ + $langId = intval( $this->request['id'] ); + $mainDir = DOC_IPS_ROOT_PATH . 'translate'; + $words_by_file = array(); + $errors = array(); + + /* Start top message */ + if ( ! is_dir( $mainDir ) ) + { + /* Just bounce back asking them to create translate */ + $this->registry->output->global_error = $this->lang->words['ext_no_translate_dir']; + $this->languagesList(); + return; + } + + if ( ! is_writeable( $mainDir ) ) + { + /* Just bounce back asking them to chmod translate */ + $this->registry->output->global_error = $this->lang->words['ext_chmod_translate_dir']; + $this->languagesList(); + return; + } + + /* Load kernel class for file management */ + $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' ); + $classFileManagement = new $classToLoad(); + + /* Get lang */ + $lang = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_lang', 'where' => 'lang_id=' . $langId ) ); + + /* Get current session if one */ + $sessionData = $this->cache->getCache('translate_session'); + + /* No current session? */ + if ( empty( $sessionData['lang_id'] ) OR ! count( $sessionData['files'] ) ) + { + /* Ensure directory is empty */ + $classFileManagement->emptyDirectory( $mainDir ); + + /* Ensure it's gone, gone */ + $this->cache->deleteCache( 'translate_session' ); + $sessionData = $lang; + $sessionData['files'] = array(); + $header = "/*******************************************************\nNOTE: This is a translatable file generated by IP.Board " . IPB_VERSION . " (" . IPB_LONG_VERSION . ") on " . date( "r" ) . " by " . $this->memberData['members_display_name'] . "\nPLEASE set your text editor to save this document as UTF-8 regardless of your board's character-set\n*******************************************************/\n\n"; + + /* Export all the languages into flat files */ + $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_lang_words', 'where' => 'lang_id=' . $langId, 'order' => 'word_custom_version DESC, word_default_version DESC' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $_text = ( $r['word_custom'] ) ? $r['word_custom'] : $r['word_default']; + $_version = ( $r['word_custom_version'] ) ? $r['word_custom_version'] : $r['word_default_version']; + $words_by_file[$r['word_app']][$r['word_pack']][] = array( $r['word_key'], $_text ); + } + + //----------------------------------------- + // Now loop and write to file + //----------------------------------------- + + foreach( $words_by_file as $app => $word_packs ) + { + foreach( $word_packs as $pack => $words ) + { + if( $pack == 'public_js' ) + { + $to_write = ''; + $_file = 'ipb.lang.js'; + + foreach( $words as $word ) + { + $word[1] = str_replace( '"', '\\"', $word[1] ); + $to_write .= "ipb.lang['{$word[0]}'] = \"{$word[1]}\";\n"; + } + } + else if( $pack == 'admin_js' ) + { + $to_write = ''; + $_file = 'acp.lang.js'; + + foreach( $words as $word ) + { + $word[1] = str_replace( '"', '\\"', $word[1] ); + $to_write .= "ipb.lang['{$word[0]}'] = \"{$word[1]}\";\n"; + } + } + else + { + //----------------------------------------- + // Build cache file contents + //----------------------------------------- + + $to_write = " \"{$word[1]}\",\n"; + } + + $to_write .= " ); \n"; + } + + //----------------------------------------- + // Convert data + //----------------------------------------- + + $to_write = IPSText::convertCharsets( $to_write, IPS_DOC_CHAR_SET, 'UTF-8' ); + + //----------------------------------------- + // Write the file + //----------------------------------------- + + @unlink( $mainDir . '/' . $_file ); + + if ( $fh = @fopen( $mainDir . '/' . $_file, 'wb' ) ) + { + fwrite( $fh, $to_write, strlen( $to_write ) ); + fclose( $fh ); + @chmod( $mainDir . '/' . $_file, IPS_FILE_PERMISSION ); + + $mtime = @filemtime( $mainDir . '/' . $_file ); + + $sessionData['files'][ $_file ] = array( 'mtime' => $mtime, 'dbtime' => $mtime ); + } + else + { + $errors[] = $this->lang->words['l_nowrite'] . $mainDir . '/' . $_file; + } + } + } + + /* Sort files */ + ksort( $sessionData['files'] ); + + /* Save session */ + $this->cache->setCache( 'translate_session', $sessionData, array( 'array' => 1, 'donow' => 1 ) ); + } + else + { + /* Update mtime */ + foreach( $sessionData['files'] as $file => $data ) + { + $sessionData['files'][ $file ]['mtime'] = @filemtime( $mainDir . '/' . $file ); + } + } + + //----------------------------------------- + // Output + //----------------------------------------- + + $this->registry->output->extra_nav[] = array( "{$this->settings['base_url']}&{$this->form_code}&do=translateExtSplash&id={$sessionData['lang_id']}", "{$this->lang->words['ext_title_for']} {$sessionData['lang_title']}" ); + + $this->registry->output->html .= $this->html->languages_translateExt( $sessionData, $lang ); + } + + /** + * Import files from disk + * + * @param string Directory to look in + * @param int Language ID to import into + * @param array [Only import these files] + * @param boolean [Perform character set translation from UTF-8] + * @return array List of files successfully imported + */ + private function _importFromDisk( $mainDir, $langId, $onlyTheseFiles=array(), $convertCharSet=false ) + { + /* INIT */ + $imported = array(); + $lang_entries = array(); + $js_entries = array(); + $counts = array(); + + /* Start looping */ + if ( is_dir( $mainDir ) ) + { + $dh = opendir( $mainDir ); + + /* Ensure it has a trailing slash */ + if ( substr( $mainDir, -1 ) != '/' ) + { + $mainDir .= '/'; + } + + while( $f = readdir( $dh ) ) + { + if ( $f[0] == '.' || $f == 'index.html' ) + { + continue; + } + + /* Skipping? */ + if ( is_array( $onlyTheseFiles ) AND count( $onlyTheseFiles ) AND ! in_array( $f, $onlyTheseFiles ) ) + { + continue; + } + + if ( preg_match( '#^\S+?_\S+?\.php$#', $f ) ) + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $updated = 0; + $inserted = 0; + $app = preg_replace( '#^([^_]+?)_(\S+?)\.php$#', "\\1", $f ); + $word_pack = preg_replace( '#^([^_]+?)_(\S+?)\.php$#', "\\2", $f ); + $lang = array(); + $db_lang = array(); + + $counts[ $f ] = array(); + + if ( ! is_file( $mainDir . $f ) ) + { + continue; + } + + /* Require the file */ + require( $mainDir . $f );/*noLibHook*/ + + //----------------------------------------- + // Loop + //----------------------------------------- + + foreach( $lang as $k => $v ) + { + //----------------------------------------- + // Build db array + //----------------------------------------- + + $db_array = array( + 'lang_id' => $langId, + 'word_app' => $app, + 'word_pack' => $word_pack, + 'word_key' => $k, + 'word_custom' => IPSText::convertCharsets($v, 'UTF-8', IPS_DOC_CHAR_SET ), + 'word_js' => 0 + ); + + //----------------------------------------- + // If cached, get from cache + //----------------------------------------- + + if( $lang_entries[ $langId ][ $db_array['word_app'] ][ $db_array['word_pack'] ] ) + { + $lang_entry = $lang_entries[ $langId ][ $db_array['word_app'] ][ $db_array['word_pack'] ][ $db_array['word_key'] ]; + } + + //----------------------------------------- + // Otherwise get all langs from this entry and + // put in cache + //----------------------------------------- + + else + { + $this->DB->build( array( + 'select' => '*', + 'from' => 'core_sys_lang_words', + 'where' => "lang_id={$langId} AND word_app='{$db_array['word_app']}' AND word_pack='{$db_array['word_pack']}'" + ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $lang_entries[ $r['lang_id'] ][ $r['word_app'] ][ $r['word_pack'] ][ $r['word_key'] ] = $r; + } + + if( $lang_entries[ $langId ][ $db_array['word_app'] ][ $db_array['word_pack'] ][ $db_array['word_key'] ] ) + { + $lang_entry = $lang_entries[ $langId ][ $db_array['word_app'] ][ $db_array['word_pack'] ][ $db_array['word_key'] ]; + } + } + + /* Finish off */ + $db_array['word_default'] = $lang_entries[ $langId ][ $db_array['word_app'] ][ $db_array['word_pack'] ][ $db_array['word_key'] ]['word_default']; + $db_array['word_default_version'] = $lang_entries[ $langId ][ $db_array['word_app'] ][ $db_array['word_pack'] ][ $db_array['word_key'] ]['word_default_version']; + $db_array['word_custom_version'] = IPB_LONG_VERSION; + + //----------------------------------------- + // If there is no new custom lang bit to insert + // don't delete what is already there. + //----------------------------------------- + + if( ! $db_array['word_custom'] ) + { + unset($db_array['word_custom']); + } + + //----------------------------------------- + // Lang bit already exists, update + //----------------------------------------- + + if( $lang_entry['word_id'] ) + { + //----------------------------------------- + // Don't update default version + //----------------------------------------- + + unset( $db_array['word_default_version'] ); + + $counts[ $f ]['updates']++; + $this->DB->update( 'core_sys_lang_words', $db_array, "word_id={$lang_entry['word_id']}" ); + } + + //----------------------------------------- + // Lang bit doesn't exist, so insert + //----------------------------------------- + + else if( !$lang_entry['word_id'] ) + { + $counts[ $f ]['inserts']++; + $this->DB->insert( 'core_sys_lang_words', $db_array ); + } + } + } + else if( preg_match( '/(\.js)$/', $f ) ) + { + $_js_word_pack = ''; + + if( $f == 'ipb.lang.js' ) + { + $_js_word_pack = 'public_js'; + } + else if( $f == 'acp.lang.js' ) + { + $_js_word_pack = 'admin_js'; + } + + //----------------------------------------- + // If not cached, get it + //----------------------------------------- + + if( !$js_entries[ $langId ][ $_js_word_pack ] ) + { + $this->DB->build( array( + 'select' => '*', + 'from' => 'core_sys_lang_words', + 'where' => "lang_id={$langId} AND word_pack='{$_js_word_pack}'" + ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $js_entries[ $r['word_pack'] ][ $r['word_key'] ] = $r; + } + } + + //----------------------------------------- + // Delete current words for this app and word pack + //----------------------------------------- + + $this->DB->delete( 'core_sys_lang_words', 'lang_id=' . $langId . " AND word_app='core' AND word_pack='" . $_js_word_pack . "'" ); + + //----------------------------------------- + // Get each line + //----------------------------------------- + + $js_file = file( $mainDir . $f ); + + //----------------------------------------- + // Loop through lines and import + //----------------------------------------- + + foreach( $js_file as $r ) + { + //----------------------------------------- + // preg_match what we want + //----------------------------------------- + + preg_match( '#ipb\.lang\[\'(.+?)\'\](.+?)= ["\'](.+?)["\'];#', $r, $matches ); + + //----------------------------------------- + // Valid? + //----------------------------------------- + + if( $matches[1] && $matches[3] ) + { + $counts[ $f ]['inserts']++; + $insert = array( + 'lang_id' => $langId, + 'word_app' => 'core', + 'word_pack' => $_js_word_pack, + 'word_key' => $matches[1], + 'word_custom' => IPSText::convertCharsets($matches[3], 'UTF-8', IPS_DOC_CHAR_SET ), + 'word_js' => 1, + 'word_default' => $js_entries[ $_js_word_pack ][ $matches[1] ]['word_default'], + 'word_default_version' => $js_entries[ $_js_word_pack ][ $matches[1] ]['word_default_version'], + 'word_custom_version' => IPB_LONG_VERSION, + ); + + $this->DB->insert( 'core_sys_lang_words', $insert ); + } + } + } + } + + closedir( $dh ); + } + + return $counts; + } + + + /** + * Recaches a language pack + * + * @return @e void + */ + public function recacheLangPack() + { + //----------------------------------------- + // Init + //----------------------------------------- + + $this->cache_errors = array(); + + $lang_id = intval( $this->request['id'] ); + + $this->cacheToDisk( $lang_id ); + + $this->registry->output->global_message = $this->lang->words['language_recache_done'] . ( !empty( $this->cache_errors ) ? ( "
" . implode( "
", $this->cache_errors ) ) : '' ); + $this->languagesList(); + } + + /** + * Remove a word entry + * + * @return @e void + */ + public function removeWordEntry() + { + //----------------------------------------- + // Init + //----------------------------------------- + + $word_id = intval($this->request['word_id']); + $lang_id = intval( $this->request['id'] ); + + //----------------------------------------- + // Delete lang bit + //----------------------------------------- + + $this->DB->delete( 'core_sys_lang_words', 'word_id=' . $word_id ); + + //----------------------------------------- + // Recache to disk + //----------------------------------------- + + $this->cacheToDisk( $lang_id ); + + //----------------------------------------- + // Bounce to new URL + //----------------------------------------- + + $this->request['secure_key'] = $this->registry->adminFunctions->generated_acp_hash; + $this->registry->output->global_message = $this->lang->words['language_word_removed']; + $this->languageEditWordPack(); + } + + /** + * Remove a word pack + * + * @return @e void + */ + public function removeWordPack() + { + //----------------------------------------- + // Init + //----------------------------------------- + + $pack = explode( '/', $this->request['word_pack'] ); + $lang_id = intval( $this->request['id'] ); + + if( $lang_id ) + { + //----------------------------------------- + // Delete from DB + //----------------------------------------- + + $this->DB->delete( 'core_sys_lang_words', "lang_id='{$lang_id}' AND word_pack='" . $pack[1] . "' AND word_app='" . $pack[0] . "'" ); + + //----------------------------------------- + // Delete from disk + //----------------------------------------- + + $_file = IPS_CACHE_PATH . 'cache/lang_cache/' . $lang_id . '/' . $pack[0] . '_' . $pack[1] . '.php'; + + if( is_file( $_file ) ) + { + @unlink( $_file ); + } + + //----------------------------------------- + // And recache + //----------------------------------------- + + $this->cacheToDisk( $lang_id ); + } + + //----------------------------------------- + // Bounce back + //----------------------------------------- + + $this->request['secure_key'] = $this->registry->adminFunctions->generated_acp_hash; + $this->registry->output->global_message = $this->lang->words['language_wordpack_removed']; + $this->languageListWordPacks(); + } + + /** + * Rebuilds language from XML files + * + * @return @e void + */ + public function rebuildFromXml() + { + //----------------------------------------- + // Init + //----------------------------------------- + + $apps = array(); + $previous = trim( $this->request['previous'] ); + $type = trim( $this->request['type'] ); + $id = intval($this->request['id']); + $_word = ( $type == 'admin' ) ? 'admin' : 'public'; + + //----------------------------------------- + // Verify writable + //----------------------------------------- + + if ( ! is_writeable( IPS_CACHE_PATH . 'cache/lang_cache/' . $id ) ) + { + $this->registry->output->global_error = $this->lang->words['cannot_write_to_cache'] ? sprintf( $this->lang->words['cannot_write_to_cache'], $id ) : "Cannot write to cache/lang_cache/" . $id; + $this->languagesList(); + return; + } + + //----------------------------------------- + // Get setup class + //----------------------------------------- + + require_once( IPS_ROOT_PATH . "setup/sources/base/setup.php" );/*noLibHook*/ + + //----------------------------------------- + // Get apps + //----------------------------------------- + + foreach( ipsRegistry::$applications as $appDir => $appData ) + { + $apps[] = $appDir; + } + + //----------------------------------------- + // Klude for setup class + //----------------------------------------- + + IPSSetUp::setSavedData( 'install_apps', implode( ',', $apps ) ); + + //----------------------------------------- + // Get next app + //----------------------------------------- + + $next = IPSSetUp::fetchNextApplication( $previous, '', $this->settings['gb_char_set'] ); + + if ( $next['key'] ) + { + $msg = $next['title'] . sprintf( $this->lang->words['importing_x_langs'], $_word ); + $_PATH = IPSLib::getAppDir( $next['key'] ) . '/xml/'; + + //----------------------------------------- + // Try to import all the lang packs + //----------------------------------------- + + try + { + foreach( new DirectoryIterator( $_PATH ) as $f ) + { + if ( preg_match( "#" . $_word . "_(.+?)_language_pack.xml#", $f->getFileName() ) ) + { + $this->request['file_location'] = $_PATH . $f->getFileName(); + $this->imprtFromXML( 1, true, true, $next['key'] ); + } + } + } catch ( Exception $e ) {} + + //----------------------------------------- + // Off to next setp + //----------------------------------------- + + $this->registry->output->html .= $this->registry->output->global_template->temporaryRedirect( $this->settings['base_url'] . $this->form_code . "do=rebuildFromXml&id={$id}&type={$type}&previous=" . $next['key'], $msg . '
' . $this->registry->output->global_message ); + $this->registry->output->global_message = ''; + return; + } + else + { + if ( $type == 'public' ) + { + //----------------------------------------- + // Onto admin languages + //----------------------------------------- + + $this->registry->output->html .= $this->registry->output->global_template->temporaryRedirect( $this->settings['base_url'] . $this->form_code . "do=rebuildFromXml&id={$id}&type=admin", $this->lang->words['starting_admin_import'] ); + return; + } + else + { + //----------------------------------------- + // And we're done + //----------------------------------------- + + $this->registry->output->redirect( $this->settings['base_url'] . $this->form_code, $this->lang->words['lang_reimport_done'] ); + } + } + } + + /** + * Copies a language pack + * + * @return void + */ + public function languageCopy() + { + //----------------------------------------- + // Init + //----------------------------------------- + + $id = intval( $this->request['id'] ); + + //----------------------------------------- + // Get lang pack + //----------------------------------------- + + $lang_info = $this->DB->buildAndFetch( array( 'select' => 'lang_short, lang_title, lang_isrtl', 'from' => 'core_sys_lang', 'where' => "lang_id={$id}" ) ); + + $lang_info['lang_title'] .= " (COPY)"; + + //----------------------------------------- + // Insert language pack + //----------------------------------------- + + $this->DB->insert( 'core_sys_lang', $lang_info ); + $new_id = $this->DB->getInsertID(); + + //----------------------------------------- + // Copy the language bits now + //----------------------------------------- + + $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_lang_words', 'where' => "lang_id={$id}" ) ); + $q = $this->DB->execute(); + + while( $r = $this->DB->fetch( $q ) ) + { + unset( $r['word_id'] ); + $r['lang_id'] = $new_id; + + $this->DB->insert( 'core_sys_lang_words', $r ); + } + + //----------------------------------------- + // Recache and redirect + //----------------------------------------- + + $this->cacheToDisk( $new_id ); + $this->registry->class_localization->rebuildLanguagesCache(); + + $this->registry->output->redirect( $this->settings['base_url'] . $this->form_code, $this->lang->words['l_copied'] ); + } + + /** + * Removes a language pack and cleans up files + * + * @return void + */ + public function languageRemove() + { + //----------------------------------------- + // Init + //----------------------------------------- + + $id = intval( $this->request['id'] ); + + //----------------------------------------- + // Make sure this isn't default pack + //----------------------------------------- + + $langCheck = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_lang', 'where' => 'lang_id=' . $id ) ); + + if( $langCheck['lang_default'] ) + { + $this->registry->output->showError( $this->lang->words['cannot_delete_default_lang'] ); + } + + if( $langCheck['lang_protected'] AND !IN_DEV ) + { + $this->registry->output->showError( $this->lang->words['cannot_delete_protected_lang'] ); + } + + //----------------------------------------- + // Delete from database + //----------------------------------------- + + $this->DB->delete( 'core_sys_lang' , "lang_id={$id}" ); + $this->DB->delete( 'core_sys_lang_words', "lang_id={$id}" ); + + //----------------------------------------- + // Delete from disk + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . '/classFileManagement.php', 'classFileManagement' ); + $fileManagement = new $classToLoad(); + $fileManagement->removeDirectory( IPS_CACHE_PATH . 'cache/lang_cache/' . $id . '/' ); + + //----------------------------------------- + // Update member default choice + //----------------------------------------- + $default = $this->DB->buildAndFetch( array( 'select' => 'lang_id', 'from' => 'core_sys_lang', 'where' => "lang_default=1" ) ); + $this->DB->update( 'members', array( 'language' => intval($default['lang_id']) ), "language={$id}" ); + + //----------------------------------------- + // Update cache and redirect + //----------------------------------------- + + $this->registry->class_localization->rebuildLanguagesCache(); + $this->registry->output->redirect( $this->settings['base_url'] . $this->form_code, $this->lang->words['l_removed'] ); + } + + /** + * Revert a word pack entry to the default value + * + * @return @e void + */ + public function languageDoRevertWord() + { + //----------------------------------------- + // Init + //----------------------------------------- + + $word_id = intval( $this->request['word_id'] ); + $lang_id = intval( $this->request['id'] ); + $pack = explode( '/', $this->request['word_pack'] ); + + //----------------------------------------- + // Revert + //----------------------------------------- + + $this->DB->update( 'core_sys_lang_words', array( 'word_custom' => '' ), "word_id={$word_id}" ); + + //----------------------------------------- + // Recache + //----------------------------------------- + + $this->cacheToDisk( $lang_id ); + + //----------------------------------------- + // Redirect + //----------------------------------------- + + $this->request['secure_key'] = $this->registry->adminFunctions->generated_acp_hash; + $this->registry->output->global_message = $this->lang->words['language_word_revert']; + $this->languageEditWordPack(); + } + + /** + * Saves new language edits + * + * @return @e void + */ + public function languageEditWordPackValues() + { + //----------------------------------------- + // Init + //----------------------------------------- + + $id = intval( $this->request['id'] ); + + $langCheck = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_lang', 'where' => 'lang_id=' . $id ) ); + + if( $langCheck['lang_protected'] AND !IN_DEV ) + { + $this->registry->output->showError( $this->lang->words['lang_pack_protected'] ); + } + + /* Got anything? */ + if ( ! count( array_keys( $_POST['lang'] ) ) ) + { + $this->registry->output->redirect( $this->settings['base_url'] . $this->form_code . "&do=edit_word_pack&word_pack={$this->request['pack']}&id={$this->request['id']}&search={$this->request['search']}&filter={$this->request['filter']}&st={$this->request['st']}", $this->lang->words['language_word_pack_edited'] ); + } + + //----------------------------------------- + // Get the words + //----------------------------------------- + + $lang = $this->DB->buildAndFetchAll( array( + 'select' => '*', + 'from' => 'core_sys_lang_words', + 'where' => "lang_id={$id} AND word_id IN(" . implode( ',', array_map( 'intval', array_keys( $_POST['lang'] ) ) ) . ')', + ), 'word_id' ); + + //----------------------------------------- + // Loop through language bits submitted + //----------------------------------------- + + if( is_array( $_POST['lang'] ) && count( $_POST['lang'] ) ) + { + foreach( $_POST['lang'] as $k => $v ) + { + if( $v != "" ) + { + $v = IPSText::safeSlashes($v); + $v = str_replace( '\', '\\', $v ); + + if( $lang[ $k ]['word_pack'] == 'admin_js' OR $lang[ $k ]['word_pack'] == 'public_js' ) + { + $v = str_replace( array( "\r\n", "\r" ), "", $v ); + } + + $this->DB->update( 'core_sys_lang_words', "word_custom='" . $this->DB->addSlashes( $v ) . "', word_custom_version=word_default_version", "word_id=" . intval($k), false, true ); + } + elseif ( isset( $lang[ $k ] ) and $lang[ $k ]['word_custom'] ) + { + $this->DB->update( 'core_sys_lang_words', array( 'word_custom' => '' ), "word_id=" . intval( $k ) ); + } + } + } + + //----------------------------------------- + // Recache and redirect + //----------------------------------------- + + $this->cacheToDisk( $id ); + + $this->registry->output->redirect( $this->settings['base_url'] . $this->form_code . "&do=edit_word_pack&word_pack={$this->request['pack']}&id={$this->request['id']}&search={$this->request['search']}&filter={$this->request['filter']}&st={$this->request['st']}", $this->lang->words['language_word_pack_edited'] ); + } + + /** + * Handles the word entry form + * + * @param string $mode Either add or edit + * @return @e void + */ + public function handleWordEntryForm( $mode='add' ) + { + //----------------------------------------- + // Init + //----------------------------------------- + + $lang_id = intval( $this->request['id'] ); + $word_id = intval( $this->request['word_id'] ); + $LATESTVERSION = IPSLib::fetchVersionNumber(); + + //----------------------------------------- + // Error checking + //----------------------------------------- + + if( ! $this->request['word_pack_db'] ) + { + $this->registry->output->global_error = $this->lang->words['l_packreq']; + $this->languageWordEntryForm( $mode ); + return; + } + + if( ! $this->request['word_key'] ) + { + $this->registry->output->global_error = $this->lang->words['l_keyreq']; + $this->languageWordEntryForm( $mode ); + return; + } + + if( ! $this->request['word_default'] ) + { + $this->registry->output->global_error = $this->lang->words['l_textreq']; + $this->languageWordEntryForm( $mode ); + return; + } + + $this->request['word_app'] = strtolower($this->request['word_app']); + $this->request['word_pack_db'] = str_replace( '/', '_', strtolower($this->request['word_pack_db']) ); + + if( $this->request['word_pack_db'] == 'admin_js' OR $this->request['word_pack_db'] == 'public_js' ) + { + $this->request['word_app'] = 'core'; + } + + //----------------------------------------- + // Build DB insert array + //----------------------------------------- + + $db_array = array( + 'lang_id' => $lang_id, + 'word_app' => $this->request['word_app'], + 'word_pack' => $this->request['word_pack_db'], + 'word_key' => $this->request['word_key'], + 'word_default' => IPSText::formToText( $_POST['word_default'] ), + ); + + //----------------------------------------- + // Add or update + //----------------------------------------- + + if( $mode == 'add' ) + { + /* Check for a duplicate */ + $_check = $this->DB->buildAndFetch( array( 'select' => 'word_id', 'from' => 'core_sys_lang_words', 'where' => "lang_id={$lang_id} AND word_app='{$db_array['word_app']}' AND word_pack='{$db_array['word_pack']}' AND word_key='{$db_array['word_key']}'" ) ); + + if( $_check['word_id'] ) + { + $this->registry->output->global_error = $this->lang->words['l_textexistsalready']; + $this->languageWordEntryForm( $mode ); + return; + } + + $this->DB->insert( 'core_sys_lang_words', $db_array ); + + $text = $this->lang->words['l_added']; + } + else + { + $this->DB->update( 'core_sys_lang_words', $db_array, "word_id={$word_id}" ); + + $text = $this->lang->words['l_updated']; + } + + //----------------------------------------- + // Recache and redirect + //----------------------------------------- + + $this->cacheToDisk( $lang_id ); + + $this->registry->output->redirect( "{$this->settings['base_url']}&module=languages§ion=manage_languages&do=list_word_packs&id={$lang_id}", $text ); + } + + /** + * Form for adding/editing a word entry + * + * @param string $mode Either add or edit + * @return @e void + */ + public function languageWordEntryForm( $mode='add' ) + { + //----------------------------------------- + // Init + //----------------------------------------- + + $word_id = intval( $this->request['word_id'] ); + $lang_id = intval( $this->request['id'] ); + $pack = explode( '/', $this->request['word_pack'] ); + + //----------------------------------------- + // Adding or editing + //----------------------------------------- + + if( $mode == 'add' ) + { + $op = 'do_add_word_entry'; + $title = $this->lang->words['l_addnew']; + $header = $this->lang->words['l_addnewfull']; + $button = $this->lang->words['l_addthis']; + $data = array( 'word_pack' => $pack[1], 'word_app' => $pack[0] ); + } + else + { + $op = 'do_edit_word_entry'; + $title = $this->lang->words['l_edit']; + $header = $this->lang->words['l_editentry']; + $button = $this->lang->words['l_savechanges']; + + //----------------------------------------- + // Get data + //----------------------------------------- + + $data = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_lang_words', 'where' => "word_id={$word_id}" ) ); + } + + //----------------------------------------- + // Set defaults + //----------------------------------------- + + $data['word_app'] = !empty( $this->request['word_app'] ) ? $this->request['word_app'] : $data['word_app']; + $data['word_pack'] = !empty( $this->request['word_pack_db'] ) ? $this->request['word_pack_db'] : $data['word_pack']; + $data['word_key'] = !empty( $this->request['word_key'] ) ? $this->request['word_key'] : $data['word_key']; + $data['word_default'] = !empty( $this->request['word_default'] ) ? $this->request['word_default'] : $data['word_default']; + + //----------------------------------------- + // Applications dropdown + //----------------------------------------- + + $_apps = array(); + + foreach( ipsRegistry::$applications as $app => $appdata ) + { + $_apps[] = array( $app, $appdata['app_title'] ); + } + + $data['word_app'] = $this->compileSelectOptions( $_apps, $data['word_app'] ); + + //----------------------------------------- + // Output form + //----------------------------------------- + + $this->registry->output->html .= $this->html->languageWordEntryForm( $op, $word_id, $lang_id, $title, $header, $data, $button ); + } + + /** + * Creates an option list for select tags + * + * @param array $options Array of values/text for dropdown + * @param mixed [$selected] Selected value or array of selected values + * @return string + */ + public function compileSelectOptions( $options, $selected='' ) + { + if( ! is_array( $selected ) ) + { + $selected = array( $selected ); + } + + $html = ''; + if( is_array( $options ) ) + { + foreach( $options as $option ) + { + $sel = ( $option[0] AND in_array( $option[0], $selected ) ) ? ' selected="selected"' : ''; + $val = ( $option[0] == 'disabled' ) ? 'disabled="disabled"' : "value='{$option[0]}'"; + + $html .= ""; + } + } + + return $html; + } + + /** + * Adds the button and content to the tab list for this object + * + * @param string $button + * @param string $content + * @param string [$js_action] + * @return @e void + */ + public function addTab( $button, $content, $js_action='', $default_tab=0 ) + { + $this->tab_buttons[] = $button; + $this->tab_tabs[] = $content; + $this->tab_js_action[] = $js_action; + + if( $default_tab ) + { + $this->default_tab = count( $this->tab_tabs ) - 1; + } + } + + /** + * Builds the html for the tabbed area + * + * @return string Tab HTML + */ + public function buildTabs() + { + /* Buttons */ + $i = 0; + $tabs = array(); + foreach( $this->tab_buttons as $i => $button ) + { + /* Tab Button */ + $js = ( $this->tab_js_action[$i] ) ? 'onmousedown="'.$this->tab_js_action[$i].'"' : ''; + $tabs[] = array( 'id' => $i, 'text' => $button, 'js' => $js ); + } + + /* Tab Contents */ + $i = 0; + $content = array(); + foreach( $this->tab_tabs as $tab ) + { + /* Create the pane */ + $content[] = array( 'id' => $i, 'content' => $tab ); + $i++; + } + + $default_tab = ( $this->default_tab ) ? $this->default_tab : ''; + + /* End of tab pane */ + $tabs = $this->html->ui_content_tabs( $tabs, $content, $default_tab ); + + return $tabs; + } + + /** + * Edit the entries in a word pack + * + * @return @e void + */ + public function languageEditWordPack() + { + //----------------------------------------- + // Init + //----------------------------------------- + + /* Fix up for search */ + $keywordForPageLinks = $this->request['search']; + $this->request['search'] = str_replace( "'", "\\'", $this->request['search'] ); + + $id = intval( $this->request['id'] ); + $pack = explode( '/', $this->request['word_pack'] ); + $per_page = 20; + $st = $this->request['st'] ? intval( $this->request['st'] ) : 0; + $search = $this->request['search'] ? " AND ( word_default LIKE '%" . $this->request['search'] . "%' OR word_custom LIKE '%" . $this->request['search'] . "%' OR word_key LIKE '%" . $this->request['search'] . "%' )" : ''; + $filter = $this->request['filter'] ? " AND word_custom_version < word_default_version AND word_custom " . $this->DB->buildIsNull(false) . ' ' : ''; + $wp_query = $pack[0] && $pack[1] ? " AND word_app='{$pack[0]}' AND word_pack='{$pack[1]}' " : ''; + + //----------------------------------------- + // Get language pack + //----------------------------------------- + + $data = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_lang', 'where' => "lang_id={$id}" ) ); + + //----------------------------------------- + // How many words? + //----------------------------------------- + + $count = $this->DB->buildAndFetch( array( + 'select' => 'COUNT(*) as count', + 'from' => 'core_sys_lang_words', + 'where' => "lang_id={$id} {$wp_query} {$search} {$filter}" + ) ); + + //----------------------------------------- + // Pagination + //----------------------------------------- + + $pages = $this->registry->output->generatePagination( array( + 'totalItems' => intval( $count['count'] ), + 'itemsPerPage' => $per_page, + 'currentStartValue' => $st, + 'baseUrl' => "{$this->settings['base_url']}{$this->form_code}&do=edit_word_pack&word_pack=".implode( '/', $pack )."&id={$id}&search={$keywordForPageLinks}&filter={$this->request['filter']}", + ) ); + + //----------------------------------------- + // Get the words + //----------------------------------------- + + $this->DB->build( array( + 'select' => '*', + 'from' => 'core_sys_lang_words', + 'where' => "lang_id={$id} {$wp_query} {$search} {$filter}", + 'limit' => array( $st, $per_page ), + 'order' => 'word_key ASC' + ) ); + $this->DB->execute(); + + $lang = array(); + + while( $r = $this->DB->fetch() ) + { + $lang[] = array( + 'id' => $r['word_id'], + 'default' => nl2br( IPSText::htmlspecialchars( $r['word_default'], ENT_QUOTES ) ), + 'custom' => IPSText::htmlspecialchars( $r['word_custom'], ENT_QUOTES ), + 'pack' => $r['word_app'] . '/' . $r['word_pack'], + 'key' => $r['word_key'] + ); + } + + //----------------------------------------- + // Output + //----------------------------------------- + + $this->registry->output->extra_nav[] = array( "{$this->settings['base_url']}{$this->form_code}&do=list_word_packs&id={$id}", $data['lang_title'] ); + $this->registry->output->extra_nav[] = array( '', $this->lang->words['language_word_pack_edit'] ); + $this->registry->output->html .= $this->html->languageWordPackEdit( $id, $lang, $pages ); + } + + /** + * List the word packs available for the selected language set + * + * @return @e void + * @author Josh + */ + public function languageListWordPacks() + { + //----------------------------------------- + // Init + //----------------------------------------- + + $id = intval( $this->request['id'] ); + + //----------------------------------------- + // Get language pack + //----------------------------------------- + + $data = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_lang', 'where' => "lang_id={$id}" ) ); + + $this->registry->output->extra_nav[] = array( "{$this->settings['base_url']}{$this->form_code}&do=list_word_packs&id={$data['lang_id']}", $data['lang_title'] ); + + //----------------------------------------- + // Get words + //----------------------------------------- + + $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_lang_words', 'where' => "lang_id={$id}" ) ); + $this->DB->execute(); + + //----------------------------------------- + // Some init before looping + //----------------------------------------- + + $_packs = array(); + $_missing = array(); + $_stats = array(); + + while( $r = $this->DB->fetch() ) + { + //----------------------------------------- + // Create our array + //----------------------------------------- + + $_stats[$r['word_app']] = isset( $_stats[$r['word_app']] ) ? $_stats[$r['word_app']] : array(); + $_stats[$r['word_app']][$r['word_pack']] = isset( $_stats[$r['word_app']][$r['word_pack']] ) ? $_stats[$r['word_app']][$r['word_pack']] : array(); + $_stats[$r['word_app']][$r['word_pack']]['total'] = isset( $_stats[$r['word_app']][$r['word_pack']]['total'] ) ? $_stats[$r['word_app']][$r['word_pack']]['total'] : 0; + + if( ! isset( $_packs[$r['word_app']] ) ) + { + $_packs[$r['word_app']] = array(); + } + + //----------------------------------------- + // Add this language pack to array + //----------------------------------------- + + if( ! in_array( $r['word_pack'], $_packs[$r['word_app']] ) ) + { + $_packs[$r['word_app']][] = $r['word_pack']; + } + + //----------------------------------------- + // Update stats + //----------------------------------------- + + $_stats[$r['word_app']][$r['word_pack']]['total']++; + + if( $r['word_custom'] ) + { + $_stats[$r['word_app']][$r['word_pack']]['custom']++; + + if( $r['word_custom_version'] < $r['word_default_version'] ) + { + $_stats[$r['word_app']][$r['word_pack']]['outofdate']++; + } + } + } + + //----------------------------------------- + // Loop through applications + //----------------------------------------- + + foreach( ipsRegistry::$applications as $app => $data ) + { + //----------------------------------------- + // Check if app has langs + //----------------------------------------- + + if( isset( $_packs[$app] ) && count( $_packs[$app] ) ) + { + $default_tab = ( $app == $this->request['app'] ) ? 1 : 0; + asort($_packs[$app]); + + $this->addTab( $data['app_title'], $this->html->languageAppPackList( $app, $_packs[$app], $_stats[$app] ), '', $default_tab ); + } + } + + //----------------------------------------- + // And output + //----------------------------------------- + + $this->registry->output->html .= $this->html->languageWordPackList( $id, $this->buildTabs(), $data['app_title'] ); + } + + /** + * Handles the language information form submit + * + * @param string $mode Either new or edit + * @return @e void + */ + public function handleLanguageInformationForm( $mode='new' ) + { + //----------------------------------------- + // Error checking + //----------------------------------------- + + $errors = array(); + + if( ! $this->request['lang_title'] ) + { + $errors[] = $this->lang->words['language_title_missing']; + } + + if( ! $this->request['lang_short'] ) + { + $errors[] = $this->lang->words['language_locale_missing']; + } + + if( count( $errors ) ) + { + $this->registry->output->global_message = implode( ', ', $errors ); + $this->languageInformationForm( $mode ); + return; + } + + //----------------------------------------- + // Build insert array + //----------------------------------------- + + $db_array = array( + 'lang_title' => $this->request['lang_title'], + 'lang_short' => $this->request['lang_short'], + 'lang_default' => $this->request['lang_default'], + 'lang_isrtl' => $this->request['lang_isrtl'], + ); + + //----------------------------------------- + // Adding or editing + //----------------------------------------- + + if( $mode == 'new' ) + { + //----------------------------------------- + // Default? + //----------------------------------------- + + if( $this->request['lang_default'] ) + { + $this->DB->update( 'core_sys_lang', array( 'lang_default' => 0 ) ); + + $db_array['lang_default'] = 1; + } + + //----------------------------------------- + // Insert and get id + //----------------------------------------- + + $this->DB->insert( 'core_sys_lang', $db_array ); + + $id = $this->DB->getInsertId(); + + //----------------------------------------- + // Create directory + //----------------------------------------- + + @mkdir( IPS_CACHE_PATH . 'cache/lang_cache/' . $id, IPS_FOLDER_PERMISSION ); + @file_put_contents( IPS_CACHE_PATH . 'cache/lang_cache/' . $id . '/index.html', '' ); + @chmod( IPS_CACHE_PATH . 'cache/lang_cache/' . $id, IPS_FOLDER_PERMISSION ); + + //----------------------------------------- + // Copy over language bits from default lang + //----------------------------------------- + + $default = $this->DB->buildAndFetch( array( 'select' => 'lang_id', 'from' => 'core_sys_lang', 'where' => "lang_default=1" ) ); + + $this->DB->build( array( 'select' => 'word_app,word_pack,word_key,word_default', 'from' => 'core_sys_lang_words', 'where' => "lang_id={$default['lang_id']}" ) ); + $q = $this->DB->execute(); + + while( $r = $this->DB->fetch( $q ) ) + { + $r['lang_id'] = $id; + $this->DB->insert( 'core_sys_lang_words', $r ); + } + + //----------------------------------------- + // Rebuild IPB and disk caches + //----------------------------------------- + + $this->registry->class_localization->rebuildLanguagesCache(); + $this->cacheToDisk($id); + + //----------------------------------------- + // Show listing + //----------------------------------------- + + $this->registry->output->global_message = $this->lang->words['language_pack_created']; + $this->languagesList(); + } + else + { + //----------------------------------------- + // Default? + //----------------------------------------- + + if( $this->request['lang_default'] ) + { + $this->DB->update( 'core_sys_lang', array( 'lang_default' => 0 ) ); + + $db_array['lang_default'] = 1; + } + + //----------------------------------------- + // Check ID and update + //----------------------------------------- + + $id = intval( $this->request['id'] ); + + $this->DB->update( 'core_sys_lang', $db_array, "lang_id={$id}" ); + + //----------------------------------------- + // Rebuild cache and show list + //----------------------------------------- + + $this->registry->class_localization->rebuildLanguagesCache(); + $this->registry->output->global_message = $this->lang->words['language_pack_updated']; + $this->languagesList(); + } + } + + /** + * Builds the language information form + * + * @param string $mode new or edit + * @return @e void + */ + public function languageInformationForm( $mode='new' ) + { + //----------------------------------------- + // Adding or editing + //----------------------------------------- + + if( $mode == 'new' ) + { + $title = $this->lang->words['language_form_new_title']; + $button = $this->lang->words['language_form_new_button']; + $op = 'do_new_language'; + $header = $this->lang->words['language_form_new_info']; + $data = array(0); + $id = 0; + } + else + { + $title = $this->lang->words['language_form_edit_title']; + $button = $this->lang->words['language_form_edit_button']; + $op = 'do_edit_lang_info'; + $header = $this->lang->words['language_form_edit_info']; + $id = intval( $this->request['id'] ); + + if( ! $id ) + { + $this->registry->output->showError( $this->lang->words['invalid_id'], 11147 ); + } + + //----------------------------------------- + // Get language pack info + //----------------------------------------- + + $data = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_lang', 'where' => "lang_id={$id}" ) ); + } + + //----------------------------------------- + // Set some defaults + //----------------------------------------- + + $data['lang_title'] = !empty( $this->request['lang_title'] ) ? $this->request['lang_title'] : $data['lang_title']; + $data['lang_short'] = !empty( $this->request['lang_short'] ) ? $this->request['lang_short'] : $data['lang_short']; + $data['lang_default'] = !empty( $this->request['lang_default'] ) ? $this->request['lang_default'] : $data['lang_default']; + $data['lang_isrtl'] = !empty( $this->request['lang_isrtl'] ) ? $this->request['lang_isrtl'] : $data['lang_isrtl']; + + $data['lang_default'] = $this->registry->output->formYesNo( 'lang_default', $data['lang_default'] ); + $data['lang_isrtl'] = $this->registry->output->formYesNo( 'lang_isrtl', $data['lang_isrtl'] ); + + //----------------------------------------- + // Show form + //----------------------------------------- + + $this->registry->output->extra_nav[] = array( '', $title ); + $this->registry->output->html .= $this->html->languageInformationForm( $op, $id, $title, $header, $data, $button ); + } + + /** + * Lists currently installed languages + * + * @return @e void + */ + public function languagesList() + { + /* Do we have a valid translation session? */ + $sessionData = $this->cache->getCache('translate_session'); + $hasTranslate = false; + + /* Check */ + if ( ! empty( $sessionData['lang_id'] ) AND count( $sessionData['files'] ) ) + { + $hasTranslate = true; + } + + /* Fallback for the recache all button */ + $forceEnglish = IPSCookie::get('forceEnglish'); + + if ( !$this->lang->words['language_list_recache'] || $forceEnglish ) + { + $this->lang->words['language_list_recache'] = 'Recache all...'; + } + + //----------------------------------------- + // Get languages + //----------------------------------------- + + $rows = array(); + + $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_lang' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + /* Get Local Data */ + //setlocale( LC_ALL, $r['lang_short'] ); + IPSLib::setlocale( $r['lang_short'] ); + $this->registry->class_localization->local_data = localeconv(); + + $_menu = array(); + + if( $r['lang_protected'] && ! IN_DEV ) + { + $_menu[] = array( "", $this->lang->words['lang_pack_protected'], 'edit' ); + } + else + { + $_menu[] = array( "{$this->settings['base_url']}{$this->form_code}&do=list_word_packs&id={$r['lang_id']}", $this->lang->words['language_list_translate'], 'info' ); + + /* If we don't have a current session... */ + if ( ! $hasTranslate ) + { + $_menu[] = array( "{$this->settings['base_url']}{$this->form_code}&do=translateExtSplash&id={$r['lang_id']}", $this->lang->words['language_list_translate_ext'], 'info' ); + } + } + + $_menu[] = array( "{$this->settings['base_url']}{$this->form_code}&do=copy_lang_pack&id={$r['lang_id']}", $this->lang->words['language_list_copy'] ); + + $_menu[] = array( "{$this->settings['base_url']}{$this->form_code}&do=export&id={$r['lang_id']}", $this->lang->words['l_xmlexportfull'], 'export' ); + + if ( $r['lang_id'] ) + { + $_menu[] = array( "{$this->settings['base_url']}{$this->form_code}&do=rebuildFromXml&id={$r['lang_id']}&type=public", $this->lang->words['rebuild_lang_from_xml'] ); + } + + foreach( ipsRegistry::$applications as $app_dir => $app_data ) + { + $_menu[] = array( "{$this->settings['base_url']}{$this->form_code}&do=export&id={$r['lang_id']}&app_dir={$app_dir}", $this->lang->words['l_xmlexport'] . $app_data['app_title'], 'export' ); + } + + //----------------------------------------- + // Data for output + //----------------------------------------- + + $rows[] = array( 'title' => $r['lang_title'], + 'local' => $r['lang_short'], + 'date' => $this->registry->class_localization->getDate( time(), 'long', 1 ) . '
' . $this->registry->class_localization->getDate( time(), 'short', 1 ), + 'money' => $this->registry->class_localization->formatMoney( '12345231.12', 0 ), + 'default' => $r['lang_default'], + 'menu' => $_menu, + 'id' => $r['lang_id'], + 'protected'=> $r['lang_protected'], + ); + } + + //----------------------------------------- + // Reset locale + //----------------------------------------- + + IPSLib::setlocale( $this->registry->class_localization->local ); + //setlocale( LC_ALL, $this->registry->class_localization->local ); + $this->registry->class_localization->local_data = localeconv(); + + //----------------------------------------- + // Output + //----------------------------------------- + + $this->registry->output->html .= $this->html->languages_list( $rows, $hasTranslate ); + } + + /** + * Updates the cached language files from the database + * + * @param integer ID of the language pack to export + * @param string Just cache one app? + * @return @e void + */ + public function cacheToDisk( $lang_id, $app_override='' ) + { + /* Generate cached warning */ + $warnString = "/*******************************************************\nNOTE: This is a cache file generated by IP.Board on " . date( "r" ) . " by " . $this->memberData['members_display_name'] . "\nDo not translate this file as you will lose your translations next time you edit via the ACP\nPlease translate via the ACP\n*******************************************************/\n\n"; + + //----------------------------------------- + // Build where statement + //----------------------------------------- + + if ( $lang_id == 'master' ) + { + $lang_id = 'master_lang'; + $where = "lang_id=1"; + } + else if( $lang_id AND $lang_id != 1 ) + { + $where = "lang_id={$lang_id}"; + } + else + { + $lang_id = 1; + $where = "lang_id=1"; + } + + //----------------------------------------- + // If missing directory, create + //----------------------------------------- + + if( ! is_dir( IPS_CACHE_PATH . 'cache/lang_cache/' . $lang_id . '/' ) ) + { + mkdir( IPS_CACHE_PATH . 'cache/lang_cache/' . $lang_id . '/', IPS_FOLDER_PERMISSION ); + } + + /* Loop over apps */ + $this->DB->build( array( 'select' => 'DISTINCT(word_app) as word_app', + 'from' => 'core_sys_lang_words', + 'limit' => array(0, 100 ) ) ); # Because you never know. + + $o = $this->DB->execute(); + + while( $langApps = $this->DB->fetch( $o ) ) + { + + if ( $app_override ) + { + if ( $app_override != $langApps['word_app'] ) + { + continue; + } + } + + //----------------------------------------- + // Get the words + //----------------------------------------- + + $this->DB->build( array( 'select' => 'word_custom, word_default, word_app, word_pack, word_key', + 'from' => 'core_sys_lang_words', + 'where' => $where . " AND word_app='" . $langApps['word_app'] . "'", + 'order' => 'word_key ASC' ) ); + + $i = $this->DB->execute(); + + $words_by_file = array(); + + while( $r = $this->DB->fetch( $i ) ) + { + $_text = ( $r['word_custom'] ) ? $r['word_custom'] : $r['word_default']; + $words_by_file[$r['word_app']][$r['word_pack']][] = array( $r['word_key'], $_text ); + } + + //----------------------------------------- + // Now loop and write to file + //----------------------------------------- + + foreach( $words_by_file as $app => $word_packs ) + { + foreach( $word_packs as $pack => $words ) + { + if( $pack == 'public_js' ) + { + $to_write = ''; + $_file = 'ipb.lang.js'; + + foreach( $words as $word ) + { + $word[1] = str_replace( "\\", "\\\\", $word[1] ); + $word[1] = str_replace( '"', '\\"', $word[1] ); + $to_write .= "ipb.lang['{$word[0]}'] = \"{$word[1]}\";\n"; + } + } + else if( $pack == 'admin_js' ) + { + $to_write = ''; + $_file = 'acp.lang.js'; + + foreach( $words as $word ) + { + $word[1] = str_replace( "\\", "\\\\", $word[1] ); + $word[1] = str_replace( '"', '\\"', $word[1] ); + $to_write .= "ipb.lang['{$word[0]}'] = \"{$word[1]}\";\n"; + } + } + else + { + //----------------------------------------- + // Build cache file contents + //----------------------------------------- + + $to_write = " \"{$word[1]}\",\n"; + } + + $to_write .= " ); \n"; + } + + //----------------------------------------- + // Write the file + //----------------------------------------- + + $_dir = IPS_CACHE_PATH . 'cache/lang_cache/' . $lang_id . '/'; + + if( is_file($_dir . $_file) ) + { + @unlink( $_dir . $_file ); + } + + if ( $fh = @fopen( $_dir . $_file, 'wb' ) ) + { + fwrite( $fh, $to_write, strlen( $to_write ) ); + fclose( $fh ); + @chmod( $_dir . $_file, IPS_FILE_PERMISSION ); + } + else + { + $this->cache_errors[] = $this->lang->words['l_nowrite'] . $_dir . $_file; + } + } + } + } + } + + /** + * Imports language packs from an xml file and updates the database and recaches the languages + * + * @param integer $lang_id ID of the language pack to import + * @param bool $in_dev Set to 1 for developer language import + * @param bool $no_return If set to 1, this function will return a value, rather than outputting data + * @param string $app_override Overrides the application for which languages are being imported + * @param bool $skip_charset Skips charset conversion in the XML file (useful during upgrade routine as strings don't need to be converted) + * @return mixed + */ + public function imprtFromXML( $lang_id=0, $in_dev=0, $no_return=0, $app_override='', $skip_charset=false ) + { + //----------------------------------------- + // Set version.. + //----------------------------------------- + + $LATESTVERSION = IPSLib::fetchVersionNumber(); + + //----------------------------------------- + // INDEV? + //----------------------------------------- + + if ( $in_dev ) + { + $_FILES['FILE_UPLOAD']['name'] = ''; + } + else if( $this->request['file_location'] ) + { + $this->request['file_location'] = IPS_ROOT_PATH . $this->request['file_location']; + } + + //----------------------------------------- + // Not an upload? + //----------------------------------------- + + if ( $_FILES['FILE_UPLOAD']['name'] == "" or ! $_FILES['FILE_UPLOAD']['name'] or ($_FILES['FILE_UPLOAD']['name'] == "none") ) + { + //----------------------------------------- + // Check and load from server + //----------------------------------------- + + if ( ! $this->request['file_location'] ) + { + $this->registry->output->global_message = $this->lang->words['l_nofile']; + $this->languagesList(); + return; + } + + if ( ! is_file( $this->request['file_location'] ) ) + { + $this->registry->output->global_message = $this->lang->words['l_noopen'] . $this->request['file_location']; + $this->languagesList(); + return; + } + + if ( preg_match( '#\.gz$#', $this->request['file_location'] ) ) + { + if ( $FH = @gzopen( $this->request['file_location'], 'rb' ) ) + { + while ( ! @gzeof( $FH ) ) + { + $content .= @gzread( $FH, 1024 ); + } + + @gzclose( $FH ); + } + } + else + { + $content = file_get_contents( $this->request['file_location'] ); + } + + $originalContent = $content; + + //----------------------------------------- + // Extract archive + //----------------------------------------- + + require_once( IPS_KERNEL_PATH.'classXMLArchive.php' );/*noLibHook*/ + $xmlarchive = new classXMLArchive(); + + //----------------------------------------- + // Read the archive + //----------------------------------------- + + $xmlarchive->readXML( $content ); + + //----------------------------------------- + // Get the data + //----------------------------------------- + + $content = ''; + + foreach( $xmlarchive->asArray() as $k => $f ) + { + if( $k == 'language_entries.xml' ) + { + $content = $f['content']; + break; + } + } + + //----------------------------------------- + // No content from de-archiving, must not + // be archive, but rather raw XML file + //----------------------------------------- + + if( $content == '' AND strpos( $originalContent, "registry->output->global_message = sprintf( $this->lang->words['lang_upload_too_large'], ini_get( 'upload_max_filesize' ) ); + $this->languagesList(); + return; + break; + + default: + $this->registry->output->global_message = $this->lang->words['lang_upload_other_error']; + $this->languagesList(); + return; + break; + } + } + + //----------------------------------------- + // Get content + //----------------------------------------- + + try + { + $uploadedContent = $this->registry->adminFunctions->importXml( $tmp_name ); + } + catch ( Exception $e ) + { + $this->registry->output->showError( $e->getMessage() ); + } + + //----------------------------------------- + // Extract archive + //----------------------------------------- + + require_once( IPS_KERNEL_PATH.'classXMLArchive.php' );/*noLibHook*/ + $xmlarchive = new classXMLArchive(); + + //----------------------------------------- + // Read the archive + //----------------------------------------- + + $xmlarchive->readXML( $uploadedContent ); + + //----------------------------------------- + // Get the data + //----------------------------------------- + + $content = ''; + + foreach( $xmlarchive->asArray() as $k => $f ) + { + if( $k == 'language_entries.xml' ) + { + $content = $f['content']; + break; + } + } + + //----------------------------------------- + // No content from de-archiving, must not + // be archive, but rather raw XML file + //----------------------------------------- + + if( $content == '' AND strpos( $uploadedContent, "registry->output->global_message = $this->lang->words['l_badfile']; + $this->languagesList(); + return; + } + + //----------------------------------------- + // Get xml class + //----------------------------------------- + + require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ + + $xml = new classXML( $skip_charset ? 'utf-8' : IPS_DOC_CHAR_SET ); + $xml->loadXML( $content ); + + //----------------------------------------- + // Is this full language pack?... + //----------------------------------------- + + foreach( $xml->fetchElements('langinfo') as $lang_data ) + { + $lang_info = $xml->fetchElementsFromRecord( $lang_data ); + + $lang_data = array( + 'lang_short' => $lang_info['lang_short'], + 'lang_title' => $lang_info['lang_title'], + ); + } + + $lang_ids = array(); + $insertId = 0; + + //----------------------------------------- + // Do we have language pack info? + //----------------------------------------- + + if( $lang_data['lang_short'] ) + { + //----------------------------------------- + // Does this pack already exist + //----------------------------------------- + + $update_lang = $this->DB->buildAndFetch( array( + 'select' => 'lang_id', + 'from' => 'core_sys_lang', + 'where' => "lang_short='{$lang_data['lang_short']}'", + ) ); + + //----------------------------------------- + // If doesn't exist, then create new pack + //----------------------------------------- + + if( !$update_lang['lang_id'] ) + { + $this->DB->insert( 'core_sys_lang', $lang_data ); + + $insertId = $this->DB->getInsertId(); + + if( @mkdir( IPS_CACHE_PATH . '/cache/lang_cache/' . $insertId ) ) + { + @file_put_contents( IPS_CACHE_PATH . 'cache/lang_cache/' . $insertId . '/index.html', '' ); + @chmod( IPS_CACHE_PATH . '/cache/lang_cache/' . $insertId, IPS_FOLDER_PERMISSION ); + } + + //----------------------------------------- + // Copy over language bits from default lang + //----------------------------------------- + + $default = $this->DB->buildAndFetch( array( 'select' => 'lang_id', 'from' => 'core_sys_lang', 'where' => "lang_default=1" ) ); + + $this->DB->build( array( 'select' => 'word_app,word_pack,word_key,word_default,word_js', 'from' => 'core_sys_lang_words', 'where' => "lang_id={$default['lang_id']}" ) ); + $q = $this->DB->execute(); + + while( $r = $this->DB->fetch( $q ) ) + { + $r['lang_id'] = $insertId; + $r['word_custom'] = ''; + + $this->DB->insert( 'core_sys_lang_words', $r ); + } + + //----------------------------------------- + // Rebuild IPB and disk caches + //----------------------------------------- + + $this->registry->class_localization->rebuildLanguagesCache(); + } + else + { + $insertId = $update_lang['lang_id']; + } + } + + //----------------------------------------- + // We need to add language bits to every pack.. + //----------------------------------------- + + $this->DB->build( array( 'select' => 'lang_id', 'from' => 'core_sys_lang' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $lang_ids[] = $r['lang_id']; + } + + //----------------------------------------- + // Init counts array + //----------------------------------------- + + $counts = array( 'updates' => 0, 'inserts' => 0 ); + + //----------------------------------------- + // Init a cache array to save entries + //----------------------------------------- + + $lang_entries = array(); + + if( $app_override ) + { + $this->DB->build( array( 'select' => "MD5( CONCAT( lang_id, '-', word_app, '-', word_pack, '-', word_key ) ) as word_lookup, word_id, md5(word_default) as word_default, word_default_version", + 'from' => 'core_sys_lang_words', + 'where' => "word_app='{$app_override}' AND lang_id IN(" . implode( ",", $lang_ids ) . ")" ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $lang_entries[ $r['word_lookup'] ] = $r; + } + } + + //----------------------------------------- + // Start looping + //----------------------------------------- + + $_lastLookup = ''; + + foreach( $xml->fetchElements('lang') as $entry ) + { + $lang = $xml->fetchElementsFromRecord( $entry ); + + foreach( $lang_ids as $_lang_id ) + { + $lang_entry = array(); + + //----------------------------------------- + // Build db array + //----------------------------------------- + + $db_array = array( + 'lang_id' => $_lang_id, + 'word_app' => $app_override ? $app_override : $lang['word_app'], + 'word_pack' => $lang['word_pack'], + 'word_key' => $lang['word_key'], + 'word_default' => $lang['word_default'], + 'word_custom' => $in_dev ? '' : $lang['word_custom'], + 'word_js' => intval($lang['word_js']), + 'word_default_version' => $lang['word_default_version'] ? $lang['word_default_version'] : $LATESTVERSION['long'], + 'word_custom_version' => $lang['word_custom_version'], + ); + + $dbKey = md5( $db_array['lang_id'] . '-' . $db_array['word_app'] . '-' . $db_array['word_pack'] . '-' . $db_array['word_key'] ); + $langIdKey = md5( $_lang_id . '-' . $db_array['word_app'] . '-' . $db_array['word_pack'] . '-' . $db_array['word_key'] ); + + // If the default value hasn't changed, we don't need to update the word_default_version (see bug report 19172) + if ( md5( $lang['word_default'] ) == $lang_entries[ $dbKey ]['word_default'] ) + { + $db_array['word_default_version'] = $lang_entries[ $dbKey ]['word_default_version']; + } + + //----------------------------------------- + // If cached, get from cache + //----------------------------------------- + + if ( $lang_entries[ $langIdKey ] ) + { + $lang_entry = $lang_entries[ $langIdKey ]; + } + + //----------------------------------------- + // Otherwise get all langs from this entry and + // put in cache + //----------------------------------------- + + else if( ! $app_override ) + { + if( $_lastLookup != md5( $db_array['word_app'] . '-' . $db_array['word_pack'] ) ) + { + unset( $lang_entries ); + } + + $_lastLookup = md5( $db_array['word_app'] . '-' . $db_array['word_pack'] ); + + $this->DB->build( array( + 'select' => '*', + 'from' => 'core_sys_lang_words', + 'where' => "lang_id={$_lang_id} AND word_app='{$db_array['word_app']}' AND word_pack='{$db_array['word_pack']}'" + ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $lang_entries[ md5( $r['lang_id'] . '-' . $r['word_app'] . '-' . $r['word_pack'] . '-' . $r['word_key'] ) ] = $r; + } + + if ( $lang_entries[ $langIdKey ] ) + { + $lang_entry = $lang_entries[ $langIdKey ]; + } + } + + //----------------------------------------- + // Didn't find any match? Must be importing + // a new language pack, huh? + //----------------------------------------- + + if ( !isset( $lang_entry['word_id'] ) ) + { + //continue 2; + } + + //----------------------------------------- + // If there is no new custom lang bit to insert + // don't delete what is already there. + //----------------------------------------- + + if( !$db_array['word_custom'] || ( $insertId > 0 && $insertId != $_lang_id ) ) + { + unset($db_array['word_custom']); + unset($db_array['word_custom_version']); + } + + //----------------------------------------- + // Lang bit already exists, update + //----------------------------------------- + + if ( $lang_entry['word_id'] AND ( ! $insertId OR ( $insertId == $_lang_id ) ) ) + { + //----------------------------------------- + // Don't update default version + //----------------------------------------- + + // This causes no languages to show "out of date" on upgrade + // @link http://community.invisionpower.com/tracker/issue-31637-no-out-of-date-entries-for-language-string-updates + // This WAS added to fix a previously reported bug, however, so need to watch out for this + // unset( $db_array['word_default_version'] ); + + $counts['updates']++; + $this->DB->update( 'core_sys_lang_words', $db_array, "word_id={$lang_entry['word_id']}" ); + } + + //----------------------------------------- + // Lang bit doesn't exist, so insert + //----------------------------------------- + + else if( ! $lang_entry['word_id'] ) + { + /* Ensure there is a value to avoid null */ + if ( ! $db_array['word_custom'] ) + { + $db_array['word_custom'] = ''; + } + + /* Ensure custom word but isn't added to other packs that simply had missing strings */ + if ( $insertId AND $insertId != $_lang_id ) + { + $db_array['word_custom'] = ''; + } + + $counts['inserts']++; + $this->DB->insert( 'core_sys_lang_words', $db_array ); + } + + unset( $lang_entry, $db_array ); + } + } + + /* Save some memory */ + unset( $lang_entries ); + + //----------------------------------------- + // Recache all our lang packs + //----------------------------------------- + + foreach( $lang_ids as $_lang_id ) + { + $this->cacheToDisk( $_lang_id, $app_override ); + } + + //----------------------------------------- + // Set output message + //----------------------------------------- + + $this->registry->output->global_message = sprintf( $this->lang->words['l_updatedcount'], $counts['updates'], $counts['inserts'] ); + + if ( is_array( $this->cache_errors ) AND count( $this->cache_errors ) ) + { + $this->registry->output->global_message .= "
" . implode( "
", $this->cache_errors ); + } + + //----------------------------------------- + // Free a little memory + //----------------------------------------- + + unset( $xml ); + + //----------------------------------------- + // Update IPB cache + //----------------------------------------- + + $this->registry->class_localization->rebuildLanguagesCache(); + + //----------------------------------------- + // Return! Now! + //----------------------------------------- + + if ( ! $no_return ) + { + $this->languagesList(); + return; + } + } + + /** + * Export language entries to xml file + * + * @param integer $lang_id Language pack to export + * @param bool $disk Save to disk instead + * @return void + */ + public function languageExportToXML( $lang_id, $disk=false ) + { + //----------------------------------------- + // Init + //----------------------------------------- + + $app_dir = trim( $this->request['app_dir'] ); + $type = trim( $this->request['type'] ); + $_where = ''; + $_name = 'language.xml'; + $LATESTVERSION = IPSLib::fetchVersionNumber(); + $doPack = true; + + //----------------------------------------- + // Filter + //----------------------------------------- + + if ( $app_dir ) + { + $_where = " AND word_app='" . $app_dir . "'"; + $_name = $app_dir . '_language_pack.xml'; + $doPack = false; + } + + if ( $type ) + { + if ( $type == 'admin' ) + { + $_where .= " AND word_pack LIKE 'admin_%'"; + $_name = 'admin_' . $_name; + } + else + { + $_where .= " AND word_pack LIKE 'public_%'"; + $_name = 'public_' . $_name; + } + + $doPack = false; + } + + //----------------------------------------- + // Create the XML library + //----------------------------------------- + + require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ + $xml = new classXML( IPS_DOC_CHAR_SET ); + $xml->newXMLDocument(); + $xml->addElement( 'languageexport' ); + $xml->addElement( 'languagegroup', 'languageexport' ); + + //----------------------------------------- + // Get language pack + //----------------------------------------- + + $data = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_lang', 'where' => "lang_id={$lang_id}" ) ); + + //----------------------------------------- + // Add pack if necessary + //----------------------------------------- + + if( $doPack ) + { + $xml->addElementAsRecord( 'languagegroup', 'langinfo', $data ); + } + + //----------------------------------------- + // Get the words + //----------------------------------------- + + $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_lang_words', 'where' => "lang_id={$lang_id}" . $_where ) ); + $this->DB->execute(); + + //----------------------------------------- + // Add words to export + //----------------------------------------- + + $word_packs = array(); + $_strings = 0; + + while( $r = $this->DB->fetch() ) + { + $content = array(); + $_strings++; + + if( $disk ) + { + $content = array( + 'word_app' => $r['word_app'], + 'word_pack' => $r['word_pack'], + 'word_key' => $r['word_key'], + 'word_default' => $r['word_default'], + //'word_default_version' => ( $r['word_default_version'] >= 30000 ) ? $r['word_default_version'] : $LATESTVERSION['long'], + //'word_js' => $r['word_js'] + ); + + if( $r['word_js'] ) + { + $content['word_js'] = $r['word_js']; + } + } + else + { + $content = array( + 'word_app' => $r['word_app'], + 'word_pack' => $r['word_pack'], + 'word_key' => $r['word_key'], + 'word_default' => $r['word_default'], + 'word_custom' => $r['word_custom'], + 'word_default_version' => ( $r['word_default_version'] >= 30000 ) ? $r['word_default_version'] : $LATESTVERSION['long'], + 'word_custom_version' => $r['word_custom_version'], + 'word_js' => $r['word_js'] + ); + } + + $xml->addElementAsRecord( 'languagegroup', 'lang', $content ); + } + + //----------------------------------------- + // Got any strings? + //----------------------------------------- + + if( !$_strings ) + { + if( $disk ) + { + return false; + } + else + { + $this->registry->output->global_message = $this->lang->words['l_nolangbits']; + $this->languagesList(); + return; + } + } + + //----------------------------------------- + // Write to disk or output to browser + //----------------------------------------- + + if( $disk ) + { + @unlink( IPSLib::getAppDir($app_dir) . '/xml/' . $_name ); + @file_put_contents( IPSLib::getAppDir($app_dir) . '/xml/' . $_name, $xml->fetchDocument() ); + return true; + } + else + { + //----------------------------------------- + // Create xml archive + //----------------------------------------- + + require_once( IPS_KERNEL_PATH . 'classXMLArchive.php' );/*noLibHook*/ + $xmlArchive = new classXMLArchive(); + + //----------------------------------------- + // Add XML document + //----------------------------------------- + + $xmlArchive->add( $xml->fetchDocument(), 'language_entries.xml' ); + + //----------------------------------------- + // Print to browser + //----------------------------------------- + + $this->registry->output->showDownload( $xmlArchive->getArchiveContents(), $_name ); + exit(); + } + } + + /** + * Builds the language db entries from cache + * + * @param boolean return as normal + * @return @e void + * @author Josh + */ + public function importFromCacheFiles( $returnAsNormal=TRUE ) + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $msg = array(); + $lang_id = 1; + $LATESTVERSION = IPSLib::fetchVersionNumber(); + + //----------------------------------------- + // Check + //----------------------------------------- + + if ( ! is_array( $_POST['apps'] ) ) + { + $this->registry->output->global_message = $this->lang->words['l_noapp']; + $this->languagesList(); + return; + } + + //----------------------------------------- + // Loop through apps... + //----------------------------------------- + + foreach( ipsRegistry::$applications as $app => $app_data ) + { + if ( in_array( $app, $_POST['apps'] ) ) + { + //----------------------------------------- + // Get directory + //----------------------------------------- + + $_dir = IPS_CACHE_PATH . 'cache/lang_cache/master_lang/'; + + //----------------------------------------- + // Go through directories + //----------------------------------------- + + if ( is_dir( $_dir ) ) + { + $dh = opendir( $_dir ); + + while( $f = readdir( $dh ) ) + { + if ( $f[0] == '.' || $f == 'index.html' ) + { + continue; + } + + if ( preg_match( "#^" . $app . '_\S+?\.php$#', $f ) ) + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $updated = 0; + $inserted = 0; + $word_pack = preg_replace( "#^" . $app . '_(\S+?)\.php$#', "\\1", $f ); + $lang = array(); + $db_lang = array(); + + //----------------------------------------- + // Delete current language bits + //----------------------------------------- + + $this->DB->delete( 'core_sys_lang_words', "lang_id=1 AND word_app='" . $app . "' AND word_pack='" . $word_pack . "'" ); + + if ( IPS_IS_SHELL ) + { + $stdout = fopen('php://stdout', 'w'); + fwrite( $stdout, 'Processing: ' . $f . "\n" ); + fclose( $stdout ); + } + + require( $_dir . $f );/*noLibHook*/ + + //----------------------------------------- + // Loop + //----------------------------------------- + + foreach( $lang as $k => $v ) + { + $inserted++; + + $insert = array( + 'lang_id' => $lang_id, + 'word_app' => $app, + 'word_pack' => $word_pack, + 'word_key' => $k, + 'word_default' => IPSText::encodeForXml($v), + 'word_default_version' => $LATESTVERSION['long'], + 'word_js' => 0, + ); + + $this->DB->insert( 'core_sys_lang_words', $insert ); + } + + $msg[] = sprintf( $this->lang->words['indev_lang_import'], $f, $inserted, $updated ); + } + else if( preg_match( '/(\.js)$/', $f ) AND $app == 'core' ) + { + $_js_word_pack = ''; + + if( $f == 'ipb.lang.js' ) + { + $_js_word_pack = 'public_js'; + } + else if( $f == 'acp.lang.js' ) + { + $_js_word_pack = 'admin_js'; + } + + //----------------------------------------- + // Delete current words for this app and word pack + //----------------------------------------- + + $this->DB->delete( 'core_sys_lang_words', "lang_id=1 AND word_app='" . $app . "' AND word_pack='" . $_js_word_pack . "'" ); + + if ( IPS_IS_SHELL ) + { + $stdout = fopen('php://stdout', 'w'); + fwrite( $stdout, 'Processing: ' . $f . "\n" ); + fclose( $stdout ); + } + + //----------------------------------------- + // Get each line + //----------------------------------------- + + $js_file = file( $_dir . $f ); + + //----------------------------------------- + // Loop through lines and import + //----------------------------------------- + + foreach( $js_file as $r ) + { + //----------------------------------------- + // preg_match what we want + //----------------------------------------- + + preg_match( '#ipb\.lang\[\'(.+?)\'\](.+?)= ["\'](.+?)["\'];#', $r, $matches ); + + //----------------------------------------- + // Valid? + //----------------------------------------- + + if( $matches[1] && $matches[3] ) + { + $inserted++; + $insert = array( + 'lang_id' => $lang_id, + 'word_app' => 'core', + 'word_pack' => $_js_word_pack, + 'word_key' => $matches[1], + 'word_default' => IPSText::encodeForXml($matches[3]), + 'word_js' => 1, + ); + $this->DB->insert( 'core_sys_lang_words', $insert ); + } + } + } + } + + closedir( $dh ); + } + } + } + + //----------------------------------------- + // Done... + //----------------------------------------- + + if ( $returnAsNormal === TRUE ) + { + $this->registry->output->setMessage( implode( "
", $msg ), true ); + + if ( ! $this->__daily ) + { + $this->languagesList(); + } + } + else + { + return $msg; + } + } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/languages/xml/index.html b/upload/admin/applications/core/modules_admin/languages/xml/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/languages/xml/index.html +++ b/upload/admin/applications/core/modules_admin/languages/xml/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/languages/xml/menu.xml b/upload/admin/applications/core/modules_admin/languages/xml/menu.xml index 8929d388..53ee3a8d 100644 --- a/upload/admin/applications/core/modules_admin/languages/xml/menu.xml +++ b/upload/admin/applications/core/modules_admin/languages/xml/menu.xml @@ -2,10 +2,10 @@ - Языки Системы + Manage Languages - Языки Системы + Manage Languages languages manage_languages diff --git a/upload/admin/applications/core/modules_admin/languages/xml/permissions.xml b/upload/admin/applications/core/modules_admin/languages/xml/permissions.xml index 8584058e..c37f84af 100644 --- a/upload/admin/applications/core/modules_admin/languages/xml/permissions.xml +++ b/upload/admin/applications/core/modules_admin/languages/xml/permissions.xml @@ -1,20 +1,20 @@ - Управление языками + Manage Languages core_languages lang_words - Может добавлять/изменять слова? + Can add/edit the language bit texts? lang_packs - Может добавлять/изменять языковые наборы? + Can add/edit language packs? lang_pack_info - Может изменять настройки и информацию языковых наборов? + Can alter the language pack properties and information? diff --git a/upload/admin/applications/core/modules_admin/login/index.html b/upload/admin/applications/core/modules_admin/login/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/login/index.html +++ b/upload/admin/applications/core/modules_admin/login/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/login/manualResolver.php b/upload/admin/applications/core/modules_admin/login/manualResolver.php index d88d939b..3bc79059 100644 --- a/upload/admin/applications/core/modules_admin/login/manualResolver.php +++ b/upload/admin/applications/core/modules_admin/login/manualResolver.php @@ -1,452 +1,452 @@ - - * Invision Power Services - * IP.Board v3.4.5 - * ACP Login/Logout Routines - * Last Updated: $Date: 2013-03-20 10:14:51 -0400 (Wed, 20 Mar 2013) $ - * - * - * @author $Author: mmecham $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/company/standards.php#license - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com - * @since Tuesday 17th August 2004 - * @version $Revision: 12094 $ - */ - -if ( ! defined( 'IN_ACP' ) ) -{ - print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; - exit(); -} - - -class admin_core_login_manualResolver extends ipsCommand -{ - /** - * HTML Skin object - * - * @var object - */ - protected $html; - - /**#@+ - * Registry objects - * - * @var object - */ - public $registry; - public $DB; - public $settings; - public $request; - public $lang; - public $member; - public $memberData; - /**#@-*/ - - /** - * Login handler object - * - * @var object - */ - protected $han_login; - - /** - * Initiate login handler - * - * @return @e void - */ - public function initHanLogin() - { - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' ); - $this->han_login = new $classToLoad( $this->registry ); - - $this->han_login->is_admin_auth = 1; - $this->han_login->init(); - } - - /** - * Class entry point - * - * @param object Registry reference - * @param string Validation message - * @return @e void [Outputs to screen/redirects] - */ - public function doExecute( ipsRegistry $registry, $validationMessage='' ) - { - /* Make object */ - $this->registry = $registry; - $this->DB = $this->registry->DB(); - $this->settings =& $this->registry->fetchSettings(); - $this->request =& $this->registry->fetchRequest(); - $this->member = $this->registry->member(); - $this->memberData =& $this->registry->member()->fetchMemberData(); - $this->lang = $this->registry->getClass('class_localization'); - - $this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_login' ), 'core' ); - - $this->initHanLogin(); - - //----------------------------------------- - // What to do? - //----------------------------------------- - - switch( $this->request['do'] ) - { - case 'login': - default: - $this->loginForm(); - break; - - case 'login-complete': - $this->loginComplete(); - break; - - case 'login-out': - $this->loginOut(); - break; - } - } - - /** - * Check and verify the login was successful - * - * @return @e void - */ - public function loginComplete() - { - /* Fetch sessions API */ - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/session/api.php', 'session_api' ); - $publicApi = new $classToLoad( $this->registry ); - - //----------------------------------------- - // Check form details. - //----------------------------------------- - - $username = ''; - $email = ''; - - //----------------------------------------- - // Is this a username or email address? - //----------------------------------------- - - $_type = $this->han_login->emailOrUsername(); - - switch( $_type ) - { - case 1: - $username = $this->request['username']; - break; - - case 2: - $email = $this->request['username']; - break; - - case 3: - $username = $this->request['username']; - $email = $this->request['username']; - break; - } - - //----------------------------------------- - // Check auth - //----------------------------------------- - - $this->han_login->loginAuthenticate( $username, $email, trim($this->request['password']) ); - - //----------------------------------------- - // Check return code... - //----------------------------------------- - - $mem = $this->han_login->member_data; - - if ( ( ! $mem['member_id'] ) or ( $this->han_login->return_code == 'NO_USER' ) ) - { - $this->_writeToLog( $this->request['username'], 'fail' ); - $this->loginForm( $this->lang->words['bad_email_password'] ); - } - - if ( $this->han_login->return_code == 'NO_ACCESS' ) - { - $this->_writeToLog( $this->request['username'], 'fail' ); - $this->loginForm( $this->lang->words['no_acp_access'] ); - } - else if ( $this->han_login->return_code != 'SUCCESS' ) - { - $this->_writeToLog( $this->request['username'], 'fail' ); - $this->loginForm( $this->lang->words['bad_email_password'] ); - } - - //----------------------------------------- - // And sort secondary groups... - //----------------------------------------- - - $mem = $this->member->setUpSecondaryGroups( $mem ); - - //----------------------------------------- - // Check access... - //----------------------------------------- - - if ( $mem['g_access_cp'] != 1 ) - { - $this->_writeToLog( $this->request['username'], 'fail' ); - $this->loginForm( $this->lang->words['no_acp_access'] ); - } - else - { - //----------------------------------------- - // Fix up query string... - //----------------------------------------- - - $extra_query = ""; - - if ( $_POST['qstring'] ) - { - $extra_query = stripslashes( htmlspecialchars( $_POST['qstring'] ) ); - $extra_query = str_replace( $this->settings['_original_base_url'] , "" , $extra_query ); - $extra_query = str_ireplace( "?index." . $this->settings['php_ext'] , "" , $extra_query ); - $extra_query = ltrim( $extra_query, '?' ); - $extra_query = preg_replace( '!adsess=(\w){32}!' , "" , $extra_query ); - $extra_query = str_replace( "adsess=x" , "" , $extra_query ); - $extra_query = str_replace( array( 'old_&', 'old_&' ) , "" , $extra_query ); - $extra_query = preg_replace( '!s=(\w){32}!' , "" , $extra_query ); - $extra_query = str_replace( "module=login" , "" , $extra_query ); - $extra_query = str_replace( "do=login-complete" , "" , $extra_query ); - $extra_query = str_replace( "/admin" , "" , $extra_query ); - $extra_query = str_replace( '&' , '&', $extra_query ); - $extra_query = preg_replace( "#&{1,}#" , "&", $extra_query ); - $extra_query = preg_replace( "#messageinabottleacp=(.*?)$#" , "" , $extra_query ); - } - - //----------------------------------------- - // Insert session - //----------------------------------------- - - $sess_id = md5( uniqid( microtime() ) ); - - $this->DB->delete( 'core_sys_cp_sessions', 'session_member_id=' . $mem['member_id'] ); - - /* Grab user agent */ - $uAgent = array(); - - $this->DB->insert( 'core_sys_cp_sessions', array( 'session_id' => $sess_id, - 'session_ip_address' => $this->member->ip_address, - 'session_member_name' => $mem['members_display_name'], - 'session_member_id' => $mem['member_id'], - 'session_member_login_key' => $mem['member_login_key'], - 'session_location' => 'index', - 'session_log_in_time' => time(), - 'session_running_time' => time(), - 'session_app_data' => serialize( $uAgent ), - 'session_url' => '' ) ); - - $this->request['adsess'] = $sess_id; - - /* Log them in public side if not already */ - $publicApi->logGuestInAsMember( $mem['member_id'] ); - - //----------------------------------------- - // Redirect... - //----------------------------------------- - - if ( $extra_query ) - { - $url = $this->settings['_original_base_url'] . '/' . CP_DIRECTORY . '/index.php?adsess=' . $sess_id . '&' . $extra_query; - } - else - { - /* Load main page? */ - require_once( IPS_ROOT_PATH . 'sources/classes/admin/bookmarks.php' ); - $bookmarks = new classes_admin_bookmarks(); - $bookmarks->setMember( $mem['member_id'] ); - - $home = $bookmarks->getHomeUrl(); - - if ( $home !== false ) - { - $url = $this->settings['_original_base_url'] . '/' . CP_DIRECTORY . '/index.php?adsess=' . $sess_id . '&' . $home; - } - else - { - $url = $this->settings['_original_base_url'] . '/' . CP_DIRECTORY . '/index.php?adsess=' . $sess_id; - } - } - - $this->_writeToLog( $this->request['username'], 'ok' ); - - ipsRegistry::getClass('output')->global_message = ''; - ipsRegistry::getClass('output')->silentRedirect( $url ); - } - } - - /** - * Log the user out - * - * @return @e void - */ - public function loginOut() - { - //----------------------------------------- - // Do it.. - //----------------------------------------- - - $this->DB->delete( 'core_sys_cp_sessions', "session_id='" . $this->request['adsess'] . "'" ); - - //----------------------------------------- - // Redirect... - //----------------------------------------- - - ipsRegistry::getClass('output')->silentRedirect( $this->settings['_admin_link'] ); - } - - /** - * Log the user out - * - * @param string Message to show on the form - * @return @e void - */ - public function loginForm( $message='' ) - { - //----------------------------------------- - // Hang on, do we need the upgrader? - //----------------------------------------- - - if ( !IN_DEV AND ( !defined('SKIP_UPGRADE_CHECK') OR !SKIP_UPGRADE_CHECK ) ) - { - require_once( IPS_ROOT_PATH . 'setup/sources/base/setup.php' );/*noLibHook*/ - foreach( ipsRegistry::$applications as $app_dir => $app ) - { - $_a = ( $app_dir == 'forums' or $app_dir == 'members' ) ? 'core' : $app_dir; - $numbers = IPSSetUp::fetchAppVersionNumbers( $_a ); - - if ( $numbers['latest'][0] and $numbers['latest'][0] > $numbers['current'][0] ) - { - $this->registry->output->silentRedirect( $this->settings['base_acp_url'] . '/upgrade/index.php?_acpRedirect=1' ); - return; - } - } - } - - //----------------------------------------- - // INIT - //----------------------------------------- - - $message = $message ? $message : $this->member->sessionClass()->getMessage(); - - //------------------------------------------------------- - // Remove all out of date sessions, like a good boy. Woof. - //------------------------------------------------------- - - $cut_off_stamp = time() - 60*60*2; - - $this->DB->delete( 'core_sys_cp_sessions', "session_running_time < {$cut_off_stamp}" ); - - //------------------------------------------------------ - // Start form - //------------------------------------------------------ - - $qs = str_replace( '&' , '&' , IPSText::parseCleanValue( urldecode( my_getenv( 'QUERY_STRING' ) ) ) ); - $qs = str_replace( 'adsess=' , 'old_adsess=' , $qs ); - $qs = str_replace( 'module=menu', '' , $qs ); - - $additional_data = $this->han_login->additionalFormHTML(); - $replace = false; - $data = array(); - - if( !is_null($additional_data) AND is_array($additional_data) AND count($additional_data) ) - { - $replace = $additional_data[0]; - $data = $additional_data[1]; - } - - $uses_name = false; - $uses_email = false; - - foreach( ipsRegistry::cache()->getCache('login_methods') as $method ) - { - $login_methods[ $method['login_folder_name'] ] = $method['login_folder_name']; - - if( $method['login_user_id'] == 'username' or $method['login_user_id'] == 'either' ) - { - $uses_name = true; - } - - if( $method['login_user_id'] == 'email' or $method['login_user_id'] == 'either' ) - { - $uses_email = true; - } - } - - if( $uses_name AND $uses_email ) - { - $this->lang->words['gl_signinname'] = $this->lang->words['enter_name_and_email']; - } - else if( $uses_email ) - { - $this->lang->words['gl_signinname'] = $this->lang->words['enter_useremail']; - } - else - { - $this->lang->words['gl_signinname'] = $this->lang->words['enter_username']; - } - - ipsRegistry::getClass('output')->html_title = $this->lang->words['ipb_login']; - ipsRegistry::getClass('output')->html_main = ipsRegistry::getClass('output')->global_template->log_in_form( $qs, $message, $replace == 'replace' ? true : false, $data ); - ipsRegistry::getClass('output')->html_main = str_replace( '<%TITLE%>' , ipsRegistry::getClass('output')->html_title, ipsRegistry::getClass('output')->html_main ); - - @header("Content-type: text/html;charset={$this->settings['gb_char_set']}"); - print ipsRegistry::getClass('output')->html_main; - exit(); - } - - /** - * Write to the admin log in loggy ma log - * - * @param string Username - * @param string ok/fail flag - * @return @e void - * @note This is private so that a hacker couldn't get into ACP, upload a new hook that lets them clear the log, and then clear the login log - */ - private function _writeToLog( $username='', $flag='fail' ) - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $username = $username ? $username : $this->request['username']; - $flag = ( $flag == 'ok' ) ? 1 : 0; - $admin_post_details = array(); - - //----------------------------------------- - // Generate POST / GET details - //----------------------------------------- - - foreach( $_GET as $k => $v ) - { - $admin_post_details['get'][ $k ] = $v; - } - - foreach( $_POST as $k => $v ) - { - if ( $k == 'password' AND IPSText::mbstrlen( $v ) > 1 ) - { - $v = $v ? ( (IPSText::mbstrlen( $v ) - 1) > 0 ? str_repeat( '*', IPSText::mbstrlen( $v ) - 1 ) : '' ) . substr( $v, -1, 1 ) : ''; - } - - $admin_post_details['post'][ $k ] = $v; - } - - //----------------------------------------- - // Write to disk... - //----------------------------------------- - - $this->DB->insert( 'admin_login_logs', array( 'admin_ip_address' => $this->member->ip_address, - 'admin_username' => $username, - 'admin_time' => time(), - 'admin_success' => $flag, - 'admin_post_details' => serialize( $admin_post_details ) ) ); - } + + * Invision Power Services + * IP.Board v3.4.6 + * ACP Login/Logout Routines + * Last Updated: $Date: 2013-03-20 10:14:51 -0400 (Wed, 20 Mar 2013) $ + * + * + * @author $Author: mmecham $ + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license http://www.invisionpower.com/company/standards.php#license + * @package IP.Board + * @subpackage Core + * @link http://www.invisionpower.com + * @since Tuesday 17th August 2004 + * @version $Revision: 12094 $ + */ + +if ( ! defined( 'IN_ACP' ) ) +{ + print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; + exit(); +} + + +class admin_core_login_manualResolver extends ipsCommand +{ + /** + * HTML Skin object + * + * @var object + */ + protected $html; + + /**#@+ + * Registry objects + * + * @var object + */ + public $registry; + public $DB; + public $settings; + public $request; + public $lang; + public $member; + public $memberData; + /**#@-*/ + + /** + * Login handler object + * + * @var object + */ + protected $han_login; + + /** + * Initiate login handler + * + * @return @e void + */ + public function initHanLogin() + { + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' ); + $this->han_login = new $classToLoad( $this->registry ); + + $this->han_login->is_admin_auth = 1; + $this->han_login->init(); + } + + /** + * Class entry point + * + * @param object Registry reference + * @param string Validation message + * @return @e void [Outputs to screen/redirects] + */ + public function doExecute( ipsRegistry $registry, $validationMessage='' ) + { + /* Make object */ + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->member = $this->registry->member(); + $this->memberData =& $this->registry->member()->fetchMemberData(); + $this->lang = $this->registry->getClass('class_localization'); + + $this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_login' ), 'core' ); + + $this->initHanLogin(); + + //----------------------------------------- + // What to do? + //----------------------------------------- + + switch( $this->request['do'] ) + { + case 'login': + default: + $this->loginForm(); + break; + + case 'login-complete': + $this->loginComplete(); + break; + + case 'login-out': + $this->loginOut(); + break; + } + } + + /** + * Check and verify the login was successful + * + * @return @e void + */ + public function loginComplete() + { + /* Fetch sessions API */ + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/session/api.php', 'session_api' ); + $publicApi = new $classToLoad( $this->registry ); + + //----------------------------------------- + // Check form details. + //----------------------------------------- + + $username = ''; + $email = ''; + + //----------------------------------------- + // Is this a username or email address? + //----------------------------------------- + + $_type = $this->han_login->emailOrUsername(); + + switch( $_type ) + { + case 1: + $username = $this->request['username']; + break; + + case 2: + $email = $this->request['username']; + break; + + case 3: + $username = $this->request['username']; + $email = $this->request['username']; + break; + } + + //----------------------------------------- + // Check auth + //----------------------------------------- + + $this->han_login->loginAuthenticate( $username, $email, trim($this->request['password']) ); + + //----------------------------------------- + // Check return code... + //----------------------------------------- + + $mem = $this->han_login->member_data; + + if ( ( ! $mem['member_id'] ) or ( $this->han_login->return_code == 'NO_USER' ) ) + { + $this->_writeToLog( $this->request['username'], 'fail' ); + $this->loginForm( $this->lang->words['bad_email_password'] ); + } + + if ( $this->han_login->return_code == 'NO_ACCESS' ) + { + $this->_writeToLog( $this->request['username'], 'fail' ); + $this->loginForm( $this->lang->words['no_acp_access'] ); + } + else if ( $this->han_login->return_code != 'SUCCESS' ) + { + $this->_writeToLog( $this->request['username'], 'fail' ); + $this->loginForm( $this->lang->words['bad_email_password'] ); + } + + //----------------------------------------- + // And sort secondary groups... + //----------------------------------------- + + $mem = $this->member->setUpSecondaryGroups( $mem ); + + //----------------------------------------- + // Check access... + //----------------------------------------- + + if ( $mem['g_access_cp'] != 1 ) + { + $this->_writeToLog( $this->request['username'], 'fail' ); + $this->loginForm( $this->lang->words['no_acp_access'] ); + } + else + { + //----------------------------------------- + // Fix up query string... + //----------------------------------------- + + $extra_query = ""; + + if ( $_POST['qstring'] ) + { + $extra_query = stripslashes( htmlspecialchars( $_POST['qstring'] ) ); + $extra_query = str_replace( $this->settings['_original_base_url'] , "" , $extra_query ); + $extra_query = str_ireplace( "?index." . $this->settings['php_ext'] , "" , $extra_query ); + $extra_query = ltrim( $extra_query, '?' ); + $extra_query = preg_replace( '!adsess=(\w){32}!' , "" , $extra_query ); + $extra_query = str_replace( "adsess=x" , "" , $extra_query ); + $extra_query = str_replace( array( 'old_&', 'old_&' ) , "" , $extra_query ); + $extra_query = preg_replace( '!s=(\w){32}!' , "" , $extra_query ); + $extra_query = str_replace( "module=login" , "" , $extra_query ); + $extra_query = str_replace( "do=login-complete" , "" , $extra_query ); + $extra_query = str_replace( "/admin" , "" , $extra_query ); + $extra_query = str_replace( '&' , '&', $extra_query ); + $extra_query = preg_replace( "#&{1,}#" , "&", $extra_query ); + $extra_query = preg_replace( "#messageinabottleacp=(.*?)$#" , "" , $extra_query ); + } + + //----------------------------------------- + // Insert session + //----------------------------------------- + + $sess_id = md5( uniqid( microtime() ) ); + + $this->DB->delete( 'core_sys_cp_sessions', 'session_member_id=' . $mem['member_id'] ); + + /* Grab user agent */ + $uAgent = array(); + + $this->DB->insert( 'core_sys_cp_sessions', array( 'session_id' => $sess_id, + 'session_ip_address' => $this->member->ip_address, + 'session_member_name' => $mem['members_display_name'], + 'session_member_id' => $mem['member_id'], + 'session_member_login_key' => $mem['member_login_key'], + 'session_location' => 'index', + 'session_log_in_time' => time(), + 'session_running_time' => time(), + 'session_app_data' => serialize( $uAgent ), + 'session_url' => '' ) ); + + $this->request['adsess'] = $sess_id; + + /* Log them in public side if not already */ + $publicApi->logGuestInAsMember( $mem['member_id'] ); + + //----------------------------------------- + // Redirect... + //----------------------------------------- + + if ( $extra_query ) + { + $url = $this->settings['_original_base_url'] . '/' . CP_DIRECTORY . '/index.php?adsess=' . $sess_id . '&' . $extra_query; + } + else + { + /* Load main page? */ + require_once( IPS_ROOT_PATH . 'sources/classes/admin/bookmarks.php' ); + $bookmarks = new classes_admin_bookmarks(); + $bookmarks->setMember( $mem['member_id'] ); + + $home = $bookmarks->getHomeUrl(); + + if ( $home !== false ) + { + $url = $this->settings['_original_base_url'] . '/' . CP_DIRECTORY . '/index.php?adsess=' . $sess_id . '&' . $home; + } + else + { + $url = $this->settings['_original_base_url'] . '/' . CP_DIRECTORY . '/index.php?adsess=' . $sess_id; + } + } + + $this->_writeToLog( $this->request['username'], 'ok' ); + + ipsRegistry::getClass('output')->global_message = ''; + ipsRegistry::getClass('output')->silentRedirect( $url ); + } + } + + /** + * Log the user out + * + * @return @e void + */ + public function loginOut() + { + //----------------------------------------- + // Do it.. + //----------------------------------------- + + $this->DB->delete( 'core_sys_cp_sessions', "session_id='" . $this->request['adsess'] . "'" ); + + //----------------------------------------- + // Redirect... + //----------------------------------------- + + ipsRegistry::getClass('output')->silentRedirect( $this->settings['_admin_link'] ); + } + + /** + * Log the user out + * + * @param string Message to show on the form + * @return @e void + */ + public function loginForm( $message='' ) + { + //----------------------------------------- + // Hang on, do we need the upgrader? + //----------------------------------------- + + if ( !IN_DEV AND ( !defined('SKIP_UPGRADE_CHECK') OR !SKIP_UPGRADE_CHECK ) ) + { + require_once( IPS_ROOT_PATH . 'setup/sources/base/setup.php' );/*noLibHook*/ + foreach( ipsRegistry::$applications as $app_dir => $app ) + { + $_a = ( $app_dir == 'forums' or $app_dir == 'members' ) ? 'core' : $app_dir; + $numbers = IPSSetUp::fetchAppVersionNumbers( $_a ); + + if ( $numbers['latest'][0] and $numbers['latest'][0] > $numbers['current'][0] ) + { + $this->registry->output->silentRedirect( $this->settings['base_acp_url'] . '/upgrade/index.php?_acpRedirect=1' ); + return; + } + } + } + + //----------------------------------------- + // INIT + //----------------------------------------- + + $message = $message ? $message : $this->member->sessionClass()->getMessage(); + + //------------------------------------------------------- + // Remove all out of date sessions, like a good boy. Woof. + //------------------------------------------------------- + + $cut_off_stamp = time() - 60*60*2; + + $this->DB->delete( 'core_sys_cp_sessions', "session_running_time < {$cut_off_stamp}" ); + + //------------------------------------------------------ + // Start form + //------------------------------------------------------ + + $qs = str_replace( '&' , '&' , IPSText::parseCleanValue( urldecode( my_getenv( 'QUERY_STRING' ) ) ) ); + $qs = str_replace( 'adsess=' , 'old_adsess=' , $qs ); + $qs = str_replace( 'module=menu', '' , $qs ); + + $additional_data = $this->han_login->additionalFormHTML(); + $replace = false; + $data = array(); + + if( !is_null($additional_data) AND is_array($additional_data) AND count($additional_data) ) + { + $replace = $additional_data[0]; + $data = $additional_data[1]; + } + + $uses_name = false; + $uses_email = false; + + foreach( ipsRegistry::cache()->getCache('login_methods') as $method ) + { + $login_methods[ $method['login_folder_name'] ] = $method['login_folder_name']; + + if( $method['login_user_id'] == 'username' or $method['login_user_id'] == 'either' ) + { + $uses_name = true; + } + + if( $method['login_user_id'] == 'email' or $method['login_user_id'] == 'either' ) + { + $uses_email = true; + } + } + + if( $uses_name AND $uses_email ) + { + $this->lang->words['gl_signinname'] = $this->lang->words['enter_name_and_email']; + } + else if( $uses_email ) + { + $this->lang->words['gl_signinname'] = $this->lang->words['enter_useremail']; + } + else + { + $this->lang->words['gl_signinname'] = $this->lang->words['enter_username']; + } + + ipsRegistry::getClass('output')->html_title = $this->lang->words['ipb_login']; + ipsRegistry::getClass('output')->html_main = ipsRegistry::getClass('output')->global_template->log_in_form( $qs, $message, $replace == 'replace' ? true : false, $data ); + ipsRegistry::getClass('output')->html_main = str_replace( '<%TITLE%>' , ipsRegistry::getClass('output')->html_title, ipsRegistry::getClass('output')->html_main ); + + @header("Content-type: text/html"); + print ipsRegistry::getClass('output')->html_main; + exit(); + } + + /** + * Write to the admin log in loggy ma log + * + * @param string Username + * @param string ok/fail flag + * @return @e void + * @note This is private so that a hacker couldn't get into ACP, upload a new hook that lets them clear the log, and then clear the login log + */ + private function _writeToLog( $username='', $flag='fail' ) + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $username = $username ? $username : $this->request['username']; + $flag = ( $flag == 'ok' ) ? 1 : 0; + $admin_post_details = array(); + + //----------------------------------------- + // Generate POST / GET details + //----------------------------------------- + + foreach( $_GET as $k => $v ) + { + $admin_post_details['get'][ $k ] = $v; + } + + foreach( $_POST as $k => $v ) + { + if ( $k == 'password' AND IPSText::mbstrlen( $v ) > 1 ) + { + $v = $v ? ( (IPSText::mbstrlen( $v ) - 1) > 0 ? str_repeat( '*', IPSText::mbstrlen( $v ) - 1 ) : '' ) . substr( $v, -1, 1 ) : ''; + } + + $admin_post_details['post'][ $k ] = $v; + } + + //----------------------------------------- + // Write to disk... + //----------------------------------------- + + $this->DB->insert( 'admin_login_logs', array( 'admin_ip_address' => $this->member->ip_address, + 'admin_username' => $username, + 'admin_time' => time(), + 'admin_success' => $flag, + 'admin_post_details' => serialize( $admin_post_details ) ) ); + } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/logs/adminlogs.php b/upload/admin/applications/core/modules_admin/logs/adminlogs.php index 84099dec..2816809f 100644 --- a/upload/admin/applications/core/modules_admin/logs/adminlogs.php +++ b/upload/admin/applications/core/modules_admin/logs/adminlogs.php @@ -3,7 +3,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Admin logs
  * Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
diff --git a/upload/admin/applications/core/modules_admin/logs/defaultSection.php b/upload/admin/applications/core/modules_admin/logs/defaultSection.php index 76fba66d..70cc108f 100644 --- a/upload/admin/applications/core/modules_admin/logs/defaultSection.php +++ b/upload/admin/applications/core/modules_admin/logs/defaultSection.php @@ -7,7 +7,7 @@ * $Author: mark $ * @since 20th February 2002 * $LastChangedDate: 2012-04-02 11:17:19 -0400 (Mon, 02 Apr 2012) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 10537 $ */ diff --git a/upload/admin/applications/core/modules_admin/logs/emailerrorlogs.php b/upload/admin/applications/core/modules_admin/logs/emailerrorlogs.php index 064946a5..272a3b4d 100644 --- a/upload/admin/applications/core/modules_admin/logs/emailerrorlogs.php +++ b/upload/admin/applications/core/modules_admin/logs/emailerrorlogs.php @@ -3,7 +3,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Email error logs
  * Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
diff --git a/upload/admin/applications/core/modules_admin/logs/errorlogs.php b/upload/admin/applications/core/modules_admin/logs/errorlogs.php index 92189a06..aeefe235 100644 --- a/upload/admin/applications/core/modules_admin/logs/errorlogs.php +++ b/upload/admin/applications/core/modules_admin/logs/errorlogs.php @@ -3,7 +3,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Error logs
  * Last Updated: $LastChangedDate: 2013-02-01 20:54:48 -0500 (Fri, 01 Feb 2013) $
  * 
diff --git a/upload/admin/applications/core/modules_admin/logs/index.html b/upload/admin/applications/core/modules_admin/logs/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/logs/index.html +++ b/upload/admin/applications/core/modules_admin/logs/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/logs/loginlog.php b/upload/admin/applications/core/modules_admin/logs/loginlog.php index 813b04da..cba305cc 100644 --- a/upload/admin/applications/core/modules_admin/logs/loginlog.php +++ b/upload/admin/applications/core/modules_admin/logs/loginlog.php @@ -2,7 +2,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Admin Login Logs
  * Last Updated: $LastChangedDate: 2013-03-19 11:50:13 -0400 (Tue, 19 Mar 2013) $
  * 
diff --git a/upload/admin/applications/core/modules_admin/logs/logsSplash.php b/upload/admin/applications/core/modules_admin/logs/logsSplash.php index 0b5ed2f3..f9aa166d 100644 --- a/upload/admin/applications/core/modules_admin/logs/logsSplash.php +++ b/upload/admin/applications/core/modules_admin/logs/logsSplash.php @@ -7,7 +7,7 @@ * $Author: bfarber $ * @since 8th Feb 2011 * $LastChangedDate: 2011-09-12 20:59:05 -0400 (Mon, 12 Sep 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 9483 $ */ diff --git a/upload/admin/applications/core/modules_admin/logs/mobilelogs.php b/upload/admin/applications/core/modules_admin/logs/mobilelogs.php index 0aba647c..aff7cd97 100644 --- a/upload/admin/applications/core/modules_admin/logs/mobilelogs.php +++ b/upload/admin/applications/core/modules_admin/logs/mobilelogs.php @@ -3,7 +3,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Mobile Notification logs
  * Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
diff --git a/upload/admin/applications/core/modules_admin/logs/modlogs.php b/upload/admin/applications/core/modules_admin/logs/modlogs.php index 017ef0a3..fddda84a 100644 --- a/upload/admin/applications/core/modules_admin/logs/modlogs.php +++ b/upload/admin/applications/core/modules_admin/logs/modlogs.php @@ -3,7 +3,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Moderator logs
  * Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
diff --git a/upload/admin/applications/core/modules_admin/logs/spamlogs.php b/upload/admin/applications/core/modules_admin/logs/spamlogs.php index 91f082fc..27a360e3 100644 --- a/upload/admin/applications/core/modules_admin/logs/spamlogs.php +++ b/upload/admin/applications/core/modules_admin/logs/spamlogs.php @@ -3,7 +3,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Admin logs
  * Last Updated: $LastChangedDate: 2013-05-01 17:35:09 -0400 (Wed, 01 May 2013) $
  * 
diff --git a/upload/admin/applications/core/modules_admin/logs/spiderlogs.php b/upload/admin/applications/core/modules_admin/logs/spiderlogs.php index 8d0949cc..963bde24 100644 --- a/upload/admin/applications/core/modules_admin/logs/spiderlogs.php +++ b/upload/admin/applications/core/modules_admin/logs/spiderlogs.php @@ -1,281 +1,281 @@ - - * Invision Power Services - * IP.Board v3.4.5 - * Search Engine Spider logs - * Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $ - * - * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/company/standards.php#license - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com - * @since 27th January 2004 - * @version $Rev: 10721 $ - */ - -if ( ! defined( 'IN_ACP' ) ) -{ - print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; - exit(); -} - -class admin_core_logs_spiderlogs extends ipsCommand -{ - /** - * Skin object - * - * @var object Skin templates - */ - protected $html; - - /** - * Spider map - * - * @var array Spider keys to values - */ - protected $bot_map = array(); - - /** - * Main class entry point - * - * @param object ipsRegistry reference - * @return @e void [Outputs to screen] - */ - public function doExecute( ipsRegistry $registry ) - { - /* Load bat names from the useragents cache */ - foreach( $this->cache->getCache( 'useragents' ) as $agent ) - { - if( $agent['uagent_type'] == 'search' ) - { - $this->bot_map[ $agent['uagent_key'] ] = $agent['uagent_name']; - } - } - - //----------------------------------------- - // Load skin - //----------------------------------------- - - $this->html = $this->registry->output->loadTemplate('cp_skin_spiderlogs'); - - //----------------------------------------- - // Set up stuff - //----------------------------------------- - - $this->form_code = $this->html->form_code = 'module=logs&section=spiderlogs'; - $this->form_code_js = $this->html->form_code_js = 'module=logs§ion=spiderlogs'; - - //----------------------------------------- - // Load lang - //----------------------------------------- - - $this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) ); - - $this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs§ion=spiderlogs', $this->lang->words['slog_spider_logs'] ); - - ///---------------------------------------- - // What to do... - //----------------------------------------- - - switch( $this->request['do'] ) - { - case 'view': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'spiderlogs_view' ); - $this->_view(); - break; - - case 'remove': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'spiderlogs_delete' ); - $this->_remove(); - break; - - default: - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'spiderlogs_view' ); - $this->_listCurrent(); - break; - } - - /* Output */ - $this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper(); - $this->registry->output->sendOutput(); - } - - /** - * View all logs for a given moderator - * - * @return @e void [Outputs to screen] - */ - protected function _view() - { - ///---------------------------------------- - // Basic init - //----------------------------------------- - - $start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0; - - $botty = IPSText::parseCleanValue( urldecode($this->request['bid'] ) ); - $botty = str_replace( "!", "!", $botty ); - - ///---------------------------------------- - // No bid or search string? - //----------------------------------------- - - if ( !$this->request['search_string'] AND !$this->request['bid'] ) - { - $this->registry->output->global_message = $this->lang->words['slog_nostring']; - $this->_listCurrent(); - return; - } - - ///---------------------------------------- - // mid? - //----------------------------------------- - - if ( !$this->request['search_string'] ) - { - $row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(sid) as count', 'from' => 'spider_logs', 'where' => "bot='{$botty}'" ) ); - - $row_count = $row['count']; - - $query = "&{$this->form_code}&bid=" . $this->request['bid'] . "&do=view"; - - $this->DB->build( array( 'select' => '*', - 'from' => 'spider_logs', - 'where' => "bot='{$botty}'", - 'order' => 'entry_date DESC', - 'limit' => array( $start, 20 ) ) ); - $this->DB->execute(); - } - else - { - $this->request['search_string'] = IPSText::parseCleanValue( urldecode($this->request['search_string'] ) ); - - $row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(sid) as count', 'from' => 'spider_logs', 'where' => "query_string LIKE '%" . $this->request['search_string'] . "%'" ) ); - - $row_count = $row['count']; - - $query = "&{$this->form_code}&do=view&search_string=" . urlencode($this->request['search_string']); - - $this->DB->build( array( 'select' => '*', - 'from' => 'spider_logs', - 'where' => "(query_string LIKE '%" . $this->request['search_string'] . "%') OR (request_addr LIKE '%" . $this->request['search_string'] . "%')", - 'order' => 'entry_date DESC', - 'limit' => array( $start, 20 ) ) ); - $this->DB->execute(); - } - - ///---------------------------------------- - // Page links - //----------------------------------------- - - $links = $this->registry->output->generatePagination( array( 'totalItems' => $row_count, - 'itemsPerPage' => 20, - 'currentStartValue' => $start, - 'baseUrl' => $this->settings['base_url'] . $query, - ) - ); - - ///---------------------------------------- - // Get db results - //----------------------------------------- - - while ( $row = $this->DB->fetch() ) - { - $extra = ""; - - if( $row['query_string'] ) - { - if ( stripos( '#lo-fi#i', $row['query_string'] ) !== false ) - { - $extra = $this->lang->words['slog_lofi']; - - $query_string_html = $extra . ' ' . $row['query_string']; - } - else - { - $query_string_html = "settings['php_ext'] . "?{$row['query_string']}' target='_blank'>" . IPSText::truncate($row['query_string']) . ""; - } - } - else - { - $query_string_html = "" . IPSText::truncate($row['request_addr']) . ""; - } - - $row['_bot_name'] = $this->bot_map[ mb_strtolower($row['bot']) ]; - $row['_query_string'] = $query_string_html; - $row['_time'] = $this->registry->getClass('class_localization')->getDate( $row['entry_date'], 'LONG' ); - - $rows[] = $row; - } - - ///---------------------------------------- - // And output - //----------------------------------------- - - $this->registry->output->html .= $this->html->spiderlogsView( $rows, $links ); - } - - /** - * Remove logs by a moderator - * - * @return @e void [Outputs to screen] - */ - protected function _remove() - { - if ( $this->request['bid'] == "" ) - { - $this->registry->output->showError( $this->lang->words['slog_nologs'], 11132 ); - } - - $botty = urldecode($this->request['bid']); - $botty = str_replace( "!", "!", $botty ); - - $this->DB->delete( 'spider_logs', "bot='{$botty}'" ); - - $this->registry->getClass('adminFunctions')->saveAdminLog($this->lang->words['slog_adminlog']); - - $this->registry->output->silentRedirect( $this->settings['base_url']."&{$this->form_code}" ); - } - - - /** - * List the current logs with links to view per-admin - * - * @return @e void [Outputs to screen] - */ - protected function _listCurrent() - { - $spiders = array(); - - //----------------------------------------- - // All bots - //----------------------------------------- - - $this->DB->build( array( 'select' => 'count(*) as cnt, bot, max(entry_date) as entry_date', - 'from' => 'spider_logs', - 'group' => 'bot', - 'order' => 'entry_date DESC', - ) ); - $this->DB->execute(); - - while ( $r = $this->DB->fetch() ) - { - $r['_bot_name'] = $this->bot_map[ strtolower($r['bot']) ]; - $r['_time'] = $this->registry->getClass('class_localization')->getDate( $r['entry_date'], 'SHORT' ); - $r['_bot_url'] = urlencode($r['bot']); - - $spiders[] = $r; - } - - //----------------------------------------- - // And output - //----------------------------------------- - - $this->registry->output->html .= $this->html->spiderlogsWrapper( $spiders ); - } + + * Invision Power Services + * IP.Board v3.4.6 + * Search Engine Spider logs + * Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $ + * + * + * @author $Author: bfarber $ + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license http://www.invisionpower.com/company/standards.php#license + * @package IP.Board + * @subpackage Core + * @link http://www.invisionpower.com + * @since 27th January 2004 + * @version $Rev: 10721 $ + */ + +if ( ! defined( 'IN_ACP' ) ) +{ + print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; + exit(); +} + +class admin_core_logs_spiderlogs extends ipsCommand +{ + /** + * Skin object + * + * @var object Skin templates + */ + protected $html; + + /** + * Spider map + * + * @var array Spider keys to values + */ + protected $bot_map = array(); + + /** + * Main class entry point + * + * @param object ipsRegistry reference + * @return @e void [Outputs to screen] + */ + public function doExecute( ipsRegistry $registry ) + { + /* Load bat names from the useragents cache */ + foreach( $this->cache->getCache( 'useragents' ) as $agent ) + { + if( $agent['uagent_type'] == 'search' ) + { + $this->bot_map[ $agent['uagent_key'] ] = $agent['uagent_name']; + } + } + + //----------------------------------------- + // Load skin + //----------------------------------------- + + $this->html = $this->registry->output->loadTemplate('cp_skin_spiderlogs'); + + //----------------------------------------- + // Set up stuff + //----------------------------------------- + + $this->form_code = $this->html->form_code = 'module=logs&section=spiderlogs'; + $this->form_code_js = $this->html->form_code_js = 'module=logs§ion=spiderlogs'; + + //----------------------------------------- + // Load lang + //----------------------------------------- + + $this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) ); + + $this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs§ion=spiderlogs', $this->lang->words['slog_spider_logs'] ); + + ///---------------------------------------- + // What to do... + //----------------------------------------- + + switch( $this->request['do'] ) + { + case 'view': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'spiderlogs_view' ); + $this->_view(); + break; + + case 'remove': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'spiderlogs_delete' ); + $this->_remove(); + break; + + default: + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'spiderlogs_view' ); + $this->_listCurrent(); + break; + } + + /* Output */ + $this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper(); + $this->registry->output->sendOutput(); + } + + /** + * View all logs for a given moderator + * + * @return @e void [Outputs to screen] + */ + protected function _view() + { + ///---------------------------------------- + // Basic init + //----------------------------------------- + + $start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0; + + $botty = IPSText::parseCleanValue( urldecode($this->request['bid'] ) ); + $botty = str_replace( "!", "!", $botty ); + + ///---------------------------------------- + // No bid or search string? + //----------------------------------------- + + if ( !$this->request['search_string'] AND !$this->request['bid'] ) + { + $this->registry->output->global_message = $this->lang->words['slog_nostring']; + $this->_listCurrent(); + return; + } + + ///---------------------------------------- + // mid? + //----------------------------------------- + + if ( !$this->request['search_string'] ) + { + $row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(sid) as count', 'from' => 'spider_logs', 'where' => "bot='{$botty}'" ) ); + + $row_count = $row['count']; + + $query = "&{$this->form_code}&bid=" . $this->request['bid'] . "&do=view"; + + $this->DB->build( array( 'select' => '*', + 'from' => 'spider_logs', + 'where' => "bot='{$botty}'", + 'order' => 'entry_date DESC', + 'limit' => array( $start, 20 ) ) ); + $this->DB->execute(); + } + else + { + $this->request['search_string'] = IPSText::parseCleanValue( urldecode($this->request['search_string'] ) ); + + $row = $this->DB->buildAndFetch( array( 'select' => 'COUNT(sid) as count', 'from' => 'spider_logs', 'where' => "query_string LIKE '%" . $this->request['search_string'] . "%'" ) ); + + $row_count = $row['count']; + + $query = "&{$this->form_code}&do=view&search_string=" . urlencode($this->request['search_string']); + + $this->DB->build( array( 'select' => '*', + 'from' => 'spider_logs', + 'where' => "(query_string LIKE '%" . $this->request['search_string'] . "%') OR (request_addr LIKE '%" . $this->request['search_string'] . "%')", + 'order' => 'entry_date DESC', + 'limit' => array( $start, 20 ) ) ); + $this->DB->execute(); + } + + ///---------------------------------------- + // Page links + //----------------------------------------- + + $links = $this->registry->output->generatePagination( array( 'totalItems' => $row_count, + 'itemsPerPage' => 20, + 'currentStartValue' => $start, + 'baseUrl' => $this->settings['base_url'] . $query, + ) + ); + + ///---------------------------------------- + // Get db results + //----------------------------------------- + + while ( $row = $this->DB->fetch() ) + { + $extra = ""; + + if( $row['query_string'] ) + { + if ( stripos( '#lo-fi#i', $row['query_string'] ) !== false ) + { + $extra = $this->lang->words['slog_lofi']; + + $query_string_html = $extra . ' ' . $row['query_string']; + } + else + { + $query_string_html = "settings['php_ext'] . "?{$row['query_string']}' target='_blank'>" . IPSText::truncate($row['query_string']) . ""; + } + } + else + { + $query_string_html = "" . IPSText::truncate($row['request_addr']) . ""; + } + + $row['_bot_name'] = $this->bot_map[ strtolower($row['bot']) ]; + $row['_query_string'] = $query_string_html; + $row['_time'] = $this->registry->getClass('class_localization')->getDate( $row['entry_date'], 'LONG' ); + + $rows[] = $row; + } + + ///---------------------------------------- + // And output + //----------------------------------------- + + $this->registry->output->html .= $this->html->spiderlogsView( $rows, $links ); + } + + /** + * Remove logs by a moderator + * + * @return @e void [Outputs to screen] + */ + protected function _remove() + { + if ( $this->request['bid'] == "" ) + { + $this->registry->output->showError( $this->lang->words['slog_nologs'], 11132 ); + } + + $botty = urldecode($this->request['bid']); + $botty = str_replace( "!", "!", $botty ); + + $this->DB->delete( 'spider_logs', "bot='{$botty}'" ); + + $this->registry->getClass('adminFunctions')->saveAdminLog($this->lang->words['slog_adminlog']); + + $this->registry->output->silentRedirect( $this->settings['base_url']."&{$this->form_code}" ); + } + + + /** + * List the current logs with links to view per-admin + * + * @return @e void [Outputs to screen] + */ + protected function _listCurrent() + { + $spiders = array(); + + //----------------------------------------- + // All bots + //----------------------------------------- + + $this->DB->build( array( 'select' => 'count(*) as cnt, bot, max(entry_date) as entry_date', + 'from' => 'spider_logs', + 'group' => 'bot', + 'order' => 'entry_date DESC', + ) ); + $this->DB->execute(); + + while ( $r = $this->DB->fetch() ) + { + $r['_bot_name'] = $this->bot_map[ strtolower($r['bot']) ]; + $r['_time'] = $this->registry->getClass('class_localization')->getDate( $r['entry_date'], 'SHORT' ); + $r['_bot_url'] = urlencode($r['bot']); + + $spiders[] = $r; + } + + //----------------------------------------- + // And output + //----------------------------------------- + + $this->registry->output->html .= $this->html->spiderlogsWrapper( $spiders ); + } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/logs/sqlerror.php b/upload/admin/applications/core/modules_admin/logs/sqlerror.php index 7ab90120..d9fb5d40 100644 --- a/upload/admin/applications/core/modules_admin/logs/sqlerror.php +++ b/upload/admin/applications/core/modules_admin/logs/sqlerror.php @@ -2,7 +2,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * SQL error logs
  * Last Updated: $LastChangedDate: 2013-04-15 17:26:30 -0400 (Mon, 15 Apr 2013) $
  * 
diff --git a/upload/admin/applications/core/modules_admin/logs/tasklogs.php b/upload/admin/applications/core/modules_admin/logs/tasklogs.php index 90a4a141..ccbe61d8 100644 --- a/upload/admin/applications/core/modules_admin/logs/tasklogs.php +++ b/upload/admin/applications/core/modules_admin/logs/tasklogs.php @@ -5,9 +5,9 @@ * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ * $License: http://www.invisionpower.com/company/standards.php#license$ * $Author: AndyMillne $ - * $LastChangedDate: 2012-11-28 09:38:19 -0500 (Wed, 28 Nov 2012) $ - * @version v3.4.5 - * $Revision: 11659 $ + * $LastChangedDate: 2013-10-16 12:57:41 -0400 (Wed, 16 Oct 2013) $ + * @version v3.4.6 + * $Revision: 12380 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -50,7 +50,7 @@ class admin_core_logs_tasklogs extends ipsCommand * @param object $registry Registry object * @return @e void */ - public function doExecute( ipsRegistry $registry ) + public function doExecute( ipsRegistry $registry ) { /* Load Class */ $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/class_taskmanager.php', 'class_taskmanager' ); @@ -68,7 +68,7 @@ class admin_core_logs_tasklogs extends ipsCommand $this->form_code_js = $this->html->form_code_js = 'module=logs§ion=tasklogs'; switch( $this->request['do'] ) - { + { default: case 'task_logs': $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tasklogs_view', '', 'system' ); @@ -117,7 +117,7 @@ class admin_core_logs_tasklogs extends ipsCommand /* Bounce */ $this->registry->output->global_message = $this->lang->words['t_removed']; $this->taskLogsOverview(); - } + } /** * Show task logs @@ -125,7 +125,7 @@ class admin_core_logs_tasklogs extends ipsCommand * @return @e void */ public function taskLogsShow() - { + { $this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_logs' ) ); /* INIT */ @@ -154,7 +154,7 @@ class admin_core_logs_tasklogs extends ipsCommand } $this->registry->output->html .= $this->html->taskManagerLogsShowWrapper( $rows ); - } + } /** * Builds the task log overview screen @@ -173,7 +173,7 @@ class admin_core_logs_tasklogs extends ipsCommand $this->registry->output->ignoreCoreNav = true; $this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools', $this->lang->words['nav_toolsmodule'] ); $this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=tools§ion=logsSplash', $this->lang->words['nav_logssplash'] ); - $this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=system§ion=taskmanager&do=task_logs', $this->lang->words['sched_error_logs'] ); + $this->registry->output->core_nav[] = array( $this->settings['base_url'] . 'module=logs§ion=tasklogs', $this->lang->words['sched_error_logs'] ); /* INIT */ $tasks = array( 0 => array( -1, 'All tasks' ) ); @@ -209,5 +209,5 @@ class admin_core_logs_tasklogs extends ipsCommand /* Output */ $this->registry->output->html .= $this->html->taskManagerLogsOverview( $last5, $form ); - } + } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/logs/warnlogs.php b/upload/admin/applications/core/modules_admin/logs/warnlogs.php index 384ff15b..692d8b48 100644 --- a/upload/admin/applications/core/modules_admin/logs/warnlogs.php +++ b/upload/admin/applications/core/modules_admin/logs/warnlogs.php @@ -7,7 +7,7 @@ * $Author: bfarber $ * @since 27th January 2004 * $LastChangedDate: 2013-05-02 23:43:16 -0400 (Thu, 02 May 2013) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 12217 $ */ diff --git a/upload/admin/applications/core/modules_admin/logs/xml/index.html b/upload/admin/applications/core/modules_admin/logs/xml/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/logs/xml/index.html +++ b/upload/admin/applications/core/modules_admin/logs/xml/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/logs/xml/menu.xml b/upload/admin/applications/core/modules_admin/logs/xml/menu.xml index 4c476fba..58fb1b0a 100644 --- a/upload/admin/applications/core/modules_admin/logs/xml/menu.xml +++ b/upload/admin/applications/core/modules_admin/logs/xml/menu.xml @@ -2,10 +2,10 @@ - Журналы + Logs - Журналы + Logs splashlogs logsSplash diff --git a/upload/admin/applications/core/modules_admin/logs/xml/permissions.xml b/upload/admin/applications/core/modules_admin/logs/xml/permissions.xml index 38e29d01..014c5f0f 100644 --- a/upload/admin/applications/core/modules_admin/logs/xml/permissions.xml +++ b/upload/admin/applications/core/modules_admin/logs/xml/permissions.xml @@ -1,110 +1,110 @@ - Журнал действий администраторов + Admin Logs core_adminlogs adminlogs_view - Может просматривать журнал? + Can view admin logs? adminlogs_delete - Может удалять записи? + Can delete admin logs? - Журнал входа администраторов + Admin Login Logs core_acp_loginlogs acplogin_log - Может просматривать журнал входа администраторов? + Can view admin login logs? - Журнал действий модераторов + Moderator Logs core_modlogs modlogs_view - Может просматривать журнал? + Can view moderator logs? modlogs_delete - Может удалять записи? + Can delete moderator logs? - Журнал ошибок Email + Email Error Logs core_eelogs emailerrorlogs_view - Может просматривать журнал? + Can view email error logs? emailerrorlogs_delete - Может удалять записи? + Can delete email error logs? - Журнал действий поисковых роботов + Spider Logs core_spiderlogs spiderlogs_view - Может просматривать журнал? + Can view spider logs? spiderlogs_delete - Может удалять записи? + Can delete spider logs? - Журнал предупреждений + Warn Logs core_warnlogs warnlogs_view - Может просматривать журнал? + Can view warn logs? warnlogs_delete - Может удалять записи? + Can delete warn logs? - Журнал ошибок системы + Error Logs core_errorlogs errorlogs_view - Может просматривать журнал? + Can view error logs? errorlogs_delete - Может удалять записи? + Can delete error logs? - Журнал SQL ошибок + SQL Error Logs core_selogs sqlerrorlogs_view - Может просматривать журнал? + Can view SQL error logs? sqlerrorlogs_delete - Может удалять записи? + Can delete SQL error logs? diff --git a/upload/admin/applications/core/modules_admin/logs/xmlrpclogs.php b/upload/admin/applications/core/modules_admin/logs/xmlrpclogs.php index 807a880b..0759157e 100644 --- a/upload/admin/applications/core/modules_admin/logs/xmlrpclogs.php +++ b/upload/admin/applications/core/modules_admin/logs/xmlrpclogs.php @@ -3,7 +3,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * API Users
  * Last Updated: $Date: 2012-11-28 09:38:19 -0500 (Wed, 28 Nov 2012) $
  * 
diff --git a/upload/admin/applications/core/modules_admin/mobileapp/defaultSection.php b/upload/admin/applications/core/modules_admin/mobileapp/defaultSection.php index 48c981ad..10976fa7 100644 --- a/upload/admin/applications/core/modules_admin/mobileapp/defaultSection.php +++ b/upload/admin/applications/core/modules_admin/mobileapp/defaultSection.php @@ -7,7 +7,7 @@ * $Author: ips_terabyte $ * @since 20th February 2002 * $LastChangedDate: 2010-10-14 13:11:17 -0400 (Thu, 14 Oct 2010) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 477 $ */ diff --git a/upload/admin/applications/core/modules_admin/mobileapp/images.php b/upload/admin/applications/core/modules_admin/mobileapp/images.php index 4d55a372..9b1ced03 100644 --- a/upload/admin/applications/core/modules_admin/mobileapp/images.php +++ b/upload/admin/applications/core/modules_admin/mobileapp/images.php @@ -3,7 +3,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Manage mobile app images
  * Last Updated: $Date: 2012-03-30 16:23:27 +0100 (Fri, 30 Mar 2012) $
  * 
diff --git a/upload/admin/applications/core/modules_admin/mobileapp/index.html b/upload/admin/applications/core/modules_admin/mobileapp/index.html index bae2d5ed..dc71892e 100644 --- a/upload/admin/applications/core/modules_admin/mobileapp/index.html +++ b/upload/admin/applications/core/modules_admin/mobileapp/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/mobileapp/xml/index.html b/upload/admin/applications/core/modules_admin/mobileapp/xml/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/mobileapp/xml/index.html +++ b/upload/admin/applications/core/modules_admin/mobileapp/xml/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/mobileapp/xml/menu.xml b/upload/admin/applications/core/modules_admin/mobileapp/xml/menu.xml index 9a5f9ac7..e8d4bb24 100644 --- a/upload/admin/applications/core/modules_admin/mobileapp/xml/menu.xml +++ b/upload/admin/applications/core/modules_admin/mobileapp/xml/menu.xml @@ -2,10 +2,10 @@ - Мобильное Приложение + Mobile App - Мобильное Приложение + Mobile App skins_manage_app_images images do=overview diff --git a/upload/admin/applications/core/modules_admin/mobileapp/xml/permissions.xml b/upload/admin/applications/core/modules_admin/mobileapp/xml/permissions.xml index 58897301..86629af2 100644 --- a/upload/admin/applications/core/modules_admin/mobileapp/xml/permissions.xml +++ b/upload/admin/applications/core/modules_admin/mobileapp/xml/permissions.xml @@ -1,12 +1,12 @@ - Изображения + Manage App Images core_templates app_images - Может управлять изображениями? + Can view and manage app images? diff --git a/upload/admin/applications/core/modules_admin/mycp/dashboard.php b/upload/admin/applications/core/modules_admin/mycp/dashboard.php index ea559e58..b6e2625c 100644 --- a/upload/admin/applications/core/modules_admin/mycp/dashboard.php +++ b/upload/admin/applications/core/modules_admin/mycp/dashboard.php @@ -2,9 +2,9 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Dashboard
- * Last Updated: $Date: 2012-10-23 15:11:59 -0400 (Tue, 23 Oct 2012) $
+ * Last Updated: $Date: 2013-09-06 16:39:06 -0400 (Fri, 06 Sep 2013) $
  * 
* * @author $Author: bfarber $ @@ -14,7 +14,7 @@ * @subpackage Core * @link http://www.invisionpower.com * @since 5th January 2005 - * @version $Revision: 11511 $ + * @version $Revision: 12348 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -151,20 +151,8 @@ class admin_core_mycp_dashboard extends ipsCommand $ipsNewsData = $this->cache->getCache( 'ipsNewsData' ); if ( !isset( $ipsNewsData['time'] ) or $ipsNewsData['time'] < ( time() - 43200 ) ) // 12 hour cache { - $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' ); - $classFileManagement = new $classToLoad(); - - if( strpos( $this->settings['base_url'], 'https://' ) !== false ) - { - $ipsNewsData['news'] = $classFileManagement->getFileContents( 'https://external.ipslink.com/ipboard33/dashboard/index.php?v=' . ipsRegistry::$vn_full ); - $ipsNewsData['vcheck'] = $classFileManagement->getFileContents( 'https://www.invisionpower.com/latestversioncheck/ipb30x.php?' . base64_encode( ipsRegistry::$vn_full.'|^|'.$this->settings['board_url'] ) ); - } - else - { - $ipsNewsData['news'] = $classFileManagement->getFileContents( 'http://external.ipslink.com/ipboard33/dashboard/index.php?v=' . ipsRegistry::$vn_full ); - $ipsNewsData['vcheck'] = $classFileManagement->getFileContents( 'http://www.invisionpower.com/latestversioncheck/ipb30x.php?' . base64_encode( ipsRegistry::$vn_full.'|^|'.$this->settings['board_url'] ) ); - } - + $ipsNewsData['news'] = ''; + $ipsNewsData['vcheck'] = ''; $ipsNewsData['time'] = time(); $this->cache->setCache( 'ipsNewsData', $ipsNewsData, array( 'array' => 1 ) ); diff --git a/upload/admin/applications/core/modules_admin/mycp/defaultSection.php b/upload/admin/applications/core/modules_admin/mycp/defaultSection.php index 4553a0ee..6a98d327 100644 --- a/upload/admin/applications/core/modules_admin/mycp/defaultSection.php +++ b/upload/admin/applications/core/modules_admin/mycp/defaultSection.php @@ -7,7 +7,7 @@ * $Author: ips_terabyte $ * @since 20th February 2002 * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 8655 $ */ diff --git a/upload/admin/applications/core/modules_admin/mycp/details.php b/upload/admin/applications/core/modules_admin/mycp/details.php index d5a2a64b..31872635 100644 --- a/upload/admin/applications/core/modules_admin/mycp/details.php +++ b/upload/admin/applications/core/modules_admin/mycp/details.php @@ -2,7 +2,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Admin change email/password
  * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
diff --git a/upload/admin/applications/core/modules_admin/mycp/index.html b/upload/admin/applications/core/modules_admin/mycp/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/mycp/index.html +++ b/upload/admin/applications/core/modules_admin/mycp/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/mycp/tabs.php b/upload/admin/applications/core/modules_admin/mycp/tabs.php index 594f314d..8ee4d5f1 100644 --- a/upload/admin/applications/core/modules_admin/mycp/tabs.php +++ b/upload/admin/applications/core/modules_admin/mycp/tabs.php @@ -2,7 +2,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Dashboard
  * Last Updated: $Date: 2012-07-12 18:15:50 +0100 (Thu, 12 Jul 2012) $
  * 
diff --git a/upload/admin/applications/core/modules_admin/mycp/xml/index.html b/upload/admin/applications/core/modules_admin/mycp/xml/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/mycp/xml/index.html +++ b/upload/admin/applications/core/modules_admin/mycp/xml/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/mycp/xml/menu.xml b/upload/admin/applications/core/modules_admin/mycp/xml/menu.xml index 5b81c7a1..49326433 100644 --- a/upload/admin/applications/core/modules_admin/mycp/xml/menu.xml +++ b/upload/admin/applications/core/modules_admin/mycp/xml/menu.xml @@ -2,10 +2,10 @@ - Панель Управления + My Dashboard - Панель Управления + My Dashboard dashboard dashboard @@ -15,10 +15,10 @@ - Изменить Мои Данные + Change My Details - Изменить Мои Данные + Change My Details mydetails details diff --git a/upload/admin/applications/core/modules_admin/mycp/xml/permissions.xml b/upload/admin/applications/core/modules_admin/mycp/xml/permissions.xml index 2fd6734f..8fef67e3 100644 --- a/upload/admin/applications/core/modules_admin/mycp/xml/permissions.xml +++ b/upload/admin/applications/core/modules_admin/mycp/xml/permissions.xml @@ -1,12 +1,12 @@ - Панель управления + My Control Panel core_mycp dashboard - Имеет доступ к панели? + Can access the dashboard? diff --git a/upload/admin/applications/core/modules_admin/posts/badwords.php b/upload/admin/applications/core/modules_admin/posts/badwords.php index 15482bc2..d202daea 100644 --- a/upload/admin/applications/core/modules_admin/posts/badwords.php +++ b/upload/admin/applications/core/modules_admin/posts/badwords.php @@ -2,7 +2,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * Bad Word Filters
  * Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
diff --git a/upload/admin/applications/core/modules_admin/posts/bbcode.php b/upload/admin/applications/core/modules_admin/posts/bbcode.php index 9008b306..f3aaf78d 100644 --- a/upload/admin/applications/core/modules_admin/posts/bbcode.php +++ b/upload/admin/applications/core/modules_admin/posts/bbcode.php @@ -2,7 +2,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * BBCode Management
  * Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
  * 
diff --git a/upload/admin/applications/core/modules_admin/posts/defaultSection.php b/upload/admin/applications/core/modules_admin/posts/defaultSection.php index 71430a4e..60a7fd89 100644 --- a/upload/admin/applications/core/modules_admin/posts/defaultSection.php +++ b/upload/admin/applications/core/modules_admin/posts/defaultSection.php @@ -7,7 +7,7 @@ * $Author: ips_terabyte $ * @since 20th February 2002 * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 8655 $ */ diff --git a/upload/admin/applications/core/modules_admin/posts/emoticons.php b/upload/admin/applications/core/modules_admin/posts/emoticons.php index 01191a69..15866c4b 100644 --- a/upload/admin/applications/core/modules_admin/posts/emoticons.php +++ b/upload/admin/applications/core/modules_admin/posts/emoticons.php @@ -1,1381 +1,1381 @@ - - * Invision Power Services - * IP.Board v3.4.5 - * Emoticon Management - * Last Updated: $LastChangedDate: 2012-05-24 16:20:59 -0400 (Thu, 24 May 2012) $ - * - * - * @author $Author: ips_terabyte $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/company/standards.php#license - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com - * @since 27th January 2004 - * @version $Rev: 10792 $ - */ - -if ( ! defined( 'IN_ACP' ) ) -{ - print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; - exit(); -} - -class admin_core_posts_emoticons extends ipsCommand -{ - /** - * Allowed file types - * - * @var array - */ - public $allowed_files = array( 'png', 'jpeg', 'jpg', 'gif' ); - - protected $setCache = array(); - - /** - * Main class entry point - * - * @param object ipsRegistry reference - * @return @e void [Outputs to screen] - */ - public function doExecute( ipsRegistry $registry ) - { - /* Load Skin and Lang */ - $this->html = $this->registry->output->loadTemplate( 'cp_skin_emoticons' ); - $this->html->form_code = '&module=posts&section=emoticons&'; - $this->html->form_code_js = '&module=posts§ion=emoticons&'; - - $this->lang->loadLanguageFile( array( 'admin_posts' ) ); - - //----------------------------------------- - // What to do... - //----------------------------------------- - - switch( $this->request['do'] ) - { - case 'emo_packsplash': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emoticons_manage' ); - $this->emoticonsPackSplash(); - break; - - case 'emo_packexport': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emoticons_manage' ); - $this->emoticonsPackExport(); - break; - - case 'emo_packimport': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emoticons_manage' ); - $this->emoticonsPackImport(); - break; - - case 'emo_manage': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emoticons_manage' ); - $this->emoticonsManageDirectory(); - break; - - case 'emo_doedit': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emoticons_edit' ); - $this->emoticonsEdit(); - break; - - case 'emo_doadd': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emoticons_add' ); - $this->emoticonsAdd(); - break; - - case 'emo_remove': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emoticons_delete' ); - $this->emoticonsRemove(); - break; - - case 'emo_setadd': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emoticons_add' ); - $this->emoticonsSetAlter( $type='add' ); - break; - - case 'emo_setedit': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emoticons_edit' ); - $this->emoticonsSetAlter( $type='edit' ); - break; - - case 'emo_setremove': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emoticons_delete' ); - $this->emoticonsSetRemove(); - break; - - case 'emo_upload': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emoticons_add' ); - $this->emoticonsUpload(); - break; - - case 'emo': - case 'overview': - default: - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emoticons_manage' ); - $this->emoticonsOverview(); - break; - case 'reorder': - $this->_reorder(); - break; - } - - /* Output */ - $this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper(); - $this->registry->output->sendOutput(); - } - - /** - * Reorder hooks - * - * @return @e void [Outputs to screen] - */ - protected function _reorder() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classAjax.php', 'classAjax' ); - $ajax = new $classToLoad(); - $set = trim( $this->request['id'] ); - - //----------------------------------------- - // Save new position - //----------------------------------------- - - $position = 1; - - if ( is_array( $this->request['emoticons'] ) AND count( $this->request['emoticons'] ) ) - { - /* Reset all emoticons to 0 temporarily */ - $this->DB->update( 'emoticons', array( 'emo_position' => 0 ), 'emo_set=\'' . $this->DB->addSlashes( $set ) . "'" ); - - foreach( $this->request['emoticons'] as $this_id ) - { - $this->DB->update( 'emoticons', array( 'emo_position' => $position ), 'id=' . intval($this_id) ); - - $position++; - } - } - - $this->emoticonsRebuildCache(); - - $ajax->returnString( 'OK' ); - } - - /** - * Import an emoticon pack - * - * @return @e void - */ - public function emoticonsPackImport() - { - /* Make sure all emoticon directories are writable */ - $this->DB->build( array( 'select' => $this->DB->buildDistinct('emo_set') . ' as folder', 'from' => 'emoticons' ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $_folders[] = $r['folder']; - } - - if( count($_folders) ) - { - foreach( $_folders as $folder ) - { - if( !IPSLib::isWritable( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $folder ) ) - { - $this->registry->output->global_error = sprintf( $this->lang->words['emodir_not_write'], PUBLIC_DIRECTORY . '/style_emoticons/' . $folder ); - return $this->emoticonsPackSplash(); - } - } - } - - /* Get the xml file */ - try - { - $content = $this->registry->adminFunctions->importXml( 'ipb_emoticons.xml' ); - } - catch ( Exception $e ) - { - $this->registry->output->showError( $e->getMessage() ); - } - - /* Check for content */ - if ( ! $content ) - { - $this->registry->output->global_error = $this->lang->words['emo_fail']; - return $this->emoticonsPackSplash(); - } - - /* Setup XML */ - require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ - $xml = new classXML( IPS_DOC_CHAR_SET ); - - require_once( IPS_KERNEL_PATH.'classXMLArchive.php' );/*noLibHook*/ - $xmlarchive = new classXMLArchive(); - - /* Read the archive */ - $xmlarchive->readXML( $content ); - - /* Get the data file */ - $emoticons = array(); - $emoticon_data = array(); - - foreach( $xmlarchive->asArray() as $k => $f ) - { - if ( $k == 'emoticon_data.xml' ) - { - $emoticon_data = $f; - } - else - { - $emoticons[ $f['filename'] ] = $f['content']; - } - } - - /* Parse the XML Document */ - $xml->loadXML( $emoticon_data['content'] ); - - /* Make sure we have a destination for these emoicons */ - if ( ! $this->request['emo_set'] and ! $this->request['new_emo_set'] ) - { - $this->registry->output->global_error = $this->lang->words['emo_specify']; - } - - /* Current emoticon set directory */ - $emo_set_dir = trim( $this->request['emo_set'] ); - - /* New emoticon set directory */ - $this->request['new_emo_set'] = preg_replace( '/[^a-zA-Z0-9\-_]/', "", $this->request['new_emo_set'] ); - - /* Create the new set */ - if ( $this->request['new_emo_set'] ) - { - $emo_set_dir = trim( $this->request['new_emo_set'] ); - - /* Check to see if the directory already exists */ - if ( file_exists( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $emo_set_dir ) ) - { - $this->registry->output->global_error = sprintf( $this->lang->words['emo_already'], $emo_set_dir ); - return $this->emoticonsPackSplash(); - } - - /* Create the directory */ - if ( @mkdir( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $emo_set_dir, IPS_FOLDER_PERMISSION ) ) - { - @chmod( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $emo_set_dir, IPS_FOLDER_PERMISSION ); - @file_put_contents( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $emo_set_dir . '/index.html', '' ); - } - else - { - $this->registry->output->global_error = $this->lang->words['emo_ftp']; - return $this->emoticonsPackSplash(); - } - } - - /* Get a list of current emoticons, if we are not overwriting */ - $emo_image = array(); - $emo_typed = array(); - - if ( $this->request['overwrite'] != 1 ) - { - $this->DB->build( array( 'select' => '*', 'from' => 'emoticons', 'where' => "emo_set='" . $emo_set_dir . "'" ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $emo_image[ $r['image'] ] = 1; - $emo_typed[ $r['typed'] ] = 1; - } - } - - /* Loop through the emoticons in the xml document */ - foreach( $xml->fetchElements('emoticon') as $emoticon ) - { - $entry = $xml->fetchElementsFromRecord( $emoticon ); - - /* Emoticon Data */ - $image = $entry['image']; - $typed = $entry['typed']; - $click = $entry['clickable']; - - /* Skip if we're not overwriting */ - if ( $emo_image[ $image ] or $emo_typed[ $typed ] ) - { - continue; - } - - /* Get the extension */ - $file_extension = preg_replace( '#^.*\.(.+?)$#si', "\\1", mb_strtolower( $image ) ); - - /* Make sure it's allowed */ - if ( ! in_array( $file_extension, $this->allowed_files ) ) - { - continue; - } - - /* Remove any existing emoticon */ - @unlink( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $emo_set_dir . '/' . $image ); - - $this->DB->delete( 'emoticons', "typed='$typed' and image='$image' and emo_set='$emo_set_dir'" ); - - /* Create the image in the file system */ - if( $FH = fopen( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' .$emo_set_dir . '/' . $image, 'wb' ) ) - { - if ( fwrite( $FH, $emoticons[ $image ] ) ) - { - fclose( $FH ); - - /* Insert the emoticon record */ - $this->DB->insert( 'emoticons', array( 'typed' => $typed, 'image' => $image, 'clickable' => $click, 'emo_set' => $emo_set_dir ) ); - } - } - - /* Add the emoticon to all the other directories */ - try - { - foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' ) as $file ) - { - if( ! $file->isDot() && $file->isDir() ) - { - if ( substr( $file->getFilename(), 0, 1 ) == '.' ) - { - continue; - } - - if ( ! is_file( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $file->getFilename() . '/' . $image ) ) - { - $this->DB->delete( 'emoticons', "typed='$typed' and image='$image' and emo_set='{$file->getFilename()}'" ); - - if ( $FH = @fopen( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $file->getFilename() . '/' . $image, 'wb' ) ) - { - if ( fwrite( $FH, $emoticons[ $image ] ) ) - { - fclose( $FH ); - - $this->DB->insert( 'emoticons', array( 'typed' => $typed, 'image' => $image, 'clickable' => $click, 'emo_set' => $file->getFilename() ) ); - } - } - } - } - } - } catch ( Exception $e ) {} - } - - /* Recache and bounce */ - $this->emoticonsRebuildCache(); - - $this->registry->output->global_message = $this->lang->words['emo_xml_good']; - $this->emoticonsOverview(); - - } - - /** - * Export the specified emoticon directory - * - * @return @e void - */ - public function emoticonsPackExport() - { - /* Setup XML */ - require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ - $xml = new classXML( IPS_DOC_CHAR_SET ); - - require_once( IPS_KERNEL_PATH . 'classXMLArchive.php' );/*noLibHook*/ - $xmlarchive = new classXMLArchive(); - - /* Check the emoticon set */ - if ( ! $this->request['emo_set'] ) - { - $this->registry->output->global_message = $this->lang->words['emo_specify_exS']; - $this->emoticonsOverview(); - return; - } - - /* Get emoticons from the database */ - $emo_db = array(); - - $this->DB->build( array( 'select' => '*', 'from' => 'emoticons', 'where' => "emo_set='{$this->request['emo_set']}'" ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $emo_db[ $r['image'] ] = $r; - } - - /* Get Emoticon Folders */ - $emodirs = array(); - $emodd = array(); - $files_to_add = array(); - - try - { - foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $this->request['emo_set'] ) as $file ) - { - if( ! $file->isDot() ) - { - if ( $emo_db[ $file->getFilename() ] != "" ) - { - $files_to_add[] = DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $this->request['emo_set'] . '/' . $file->getFilename(); - } - } - } - } catch ( Exception $e ) {} - - /* Add each file to the xml archive */ - foreach( $files_to_add as $f ) - { - $xmlarchive->add( $f ); - } - - $xml->newXMLDocument(); - $xml->addElement( 'emoticonexport' ); - $xml->addElement( 'emogroup', 'emoticonexport' ); - - foreach( $emo_db as $r ) - { - $content = array(); - - $content['typed'] = $r['typed']; - $content['image'] = $r['image']; - $content['clickable'] = $r['clickable']; - - $xml->addElementAsRecord( 'emogroup', 'emoticon', $content ); - } - - /* Create the XML Document */ - $xmlData = $xml->fetchDocument(); - - /* Add the xml document to the archive */ - $xmlarchive->add( $xmlData, 'emoticon_data.xml' ); - - /* Send the archive to the browser */ - $imagearchive = $xmlarchive->getArchiveContents(); - $this->registry->output->showDownload( $imagearchive, 'ipb_emoticons.xml' ); - } - - /** - * Builds the emoticon import/export pack splash screen - * - * @return @e void - */ - public function emoticonsPackSplash() - { - /* Check for the emoticon directory */ - if( ! is_dir( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons' ) ) - { - $this->registry->output->showError( $this->lang->words['emo_nolocate'], 2110 ); - - } - - /* Count the number of current emoticons */ - $this->DB->build( array( 'select' => 'id, count(id) as count, emo_set', - 'from' => 'emoticons', - 'group' => 'id, emo_set', - 'order' => 'emo_set' - ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $emo_db[ $r['emo_set'] ] = $r; - } - - /* Get the emoticon folders */ - $emodirs = array(); - $emodd = array(); - - try - { - foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons' ) as $file ) - { - if( $file->isDir() && ! $file->isDot() ) - { - $emodirs[] = $file->getFilename(); - $emodd[] = array( $file->getFilename(), $file->getFilename() ); - } - } - } catch ( Exception $e ) {} - - /* Build Form Elements */ - $form = array(); - $form['emo_set'] = $this->registry->output->formDropdown( 'emo_set', $emodd ); - $form['new_emo_set'] = $this->registry->output->formInput( 'new_emo_set' ); - $form['overwrite'] = $this->registry->output->formYesNo( 'overwrite' ); - - /* Output */ - $this->registry->output->html .= $this->html->emoticonsPackSplash( $form ); - } - - /** - * Remove the specified emoticon - * - * @return @e void - */ - public function emoticonsRemove() - { - /* Check the ID */ - if( $this->request['id'] == "" ) - { - $this->registry->output->global_message = $this->lang->words['emo_nogid']; - $this->emoticonsOverview(); - return; - } - - /* Can only remove the default set */ - if( $this->request['id'] != "default" ) - { - $this->registry->output->global_message = $this->lang->words['emo_onlydothis']; - $this->emoticonsOverview(); - return; - } - - /* Check for the emoticon ID */ - $this->request['eid'] = intval( $this->request['eid'] ); - - if( ! $this->request['eid'] ) - { - $this->registry->output->global_message = $this->lang->words['emo_noid']; - $this->emoticonsManageDirectory(); - return; - } - - /* Get the emoticon info */ - $emo_info = $this->DB->buildAndFetch( array( 'select' => 'typed', 'from' => 'emoticons', 'where' => "id=" . $this->request['eid']) ); - - /* Delete the emoticon */ - $this->DB->delete( 'emoticons', "typed='{$emo_info['typed']}'" ); - - /* Rebuild the cache and bounce */ - $this->emoticonsRebuildCache(); - - $this->registry->output->global_message = $this->lang->words['emo_removed']; - $this->emoticonsManageDirectory(); - } - - /** - * Add emoticons to the default directory - * - * @return @e void - */ - public function emoticonsAdd() - { - $image = str_replace( '---', '.', trim( $this->request['emo_image'] ) ); - $set = trim( $this->request['id'] ); - $typed = $this->_getNameFromImg( $image, $set ); - $position = $this->_getNextPosition( $set ); - - /* Check the id */ - if ( empty( $set ) ) - { - $this->registry->output->global_message = $this->lang->words['emo_nogid']; - $this->emoticonsOverview(); - return; - } - - /* Can only upload to the default directory */ - if( $this->request['id'] != "default" ) - { - $this->registry->output->global_message = $this->lang->words['emo_onlydothis']; - $this->emoticonsOverview(); - return; - } - - if ( ! $image OR ! $typed ) - { - $this->registry->output->global_message = $this->lang->words['emo_nogid']; - $this->emoticonsOverview(); - return; - } - - /* Insert the emo record */ - // as per http://community.invisionpower.com/tracker/issue-34269-emoticon-imports - add to all records rather than - // just the default. In future version, will hopefully rewrite emoticon management and make this process less mental - foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons' ) as $_emoticon ) - { - if ( $_emoticon->isDir() AND ! $_emoticon->isDot() AND $_emoticon->getFilename() != '.svn' ) - { - if ( is_dir( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $_emoticon ) ) - { - $this->DB->insert( 'emoticons', array( 'typed' => $typed, 'image' => $image, 'emo_set' => $_emoticon->getFilename(), 'emo_position' => $position ) ); - } - } - } - - /* Emoticon list */ - $emodirs = array( 0 => ''); - - /* Loop through all the emoticons */ - try - { - foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons' ) as $file ) - { - if ( ! $file->isDot() && $file->isDir() && strpos( $file->getFilename(), '.' ) != 0 ) - { - if( $file->getFilename() == 'default' ) - { - $emodirs[0] = $file->getFilename(); - } - else - { - $emodirs[] = $file->getFilename(); - } - } - } - } catch ( Exception $e ) {} - - /* Add this emoticon to the other sets */ - foreach( $emodirs as $directory ) - { - if ( $directory == $set ) - { - continue; - } - - if ( empty( $directory ) ) - { - continue; - } - - $this->DB->insert( 'emoticons', array( 'typed' => $typed, 'image' => $image, 'emo_set' => $directory, 'emo_position' => $position ) ); - } - - /* Rebuild the cache and bounce */ - $this->emoticonsRebuildCache(); - - $this->registry->output->global_message = $this->lang->words['emo_updated']; - $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->html->form_code . '&do=emo_manage&id=' . $this->request['id'] ); - } - - /** - * Handles the upload emoticon form - * - * @return @e void - */ - public function emoticonsUpload() - { - /* INI */ - $overwrite = 1; - $uploaded = 0; - - /* Check the request for uploads */ - $directories = array(); - $first_dir = ''; - - foreach( $this->request as $key => $value ) - { - if( preg_match( "/^dir_(.*)$/", $key, $match ) ) - { - if( $this->request[ $match[0] ] == 1 ) - { - $directories[] = $match[1]; - } - } - } - - /* Can't upload to default */ - if ( ! count( $directories ) ) - { - $this->registry->output->global_message = $this->lang->words['emo_pickanother']; - $this->emoticonsOverview(); - return; - } - - /* Remove default from the directories list */ - if ( ! in_array( 'default', $directories ) ) - { - array_push( $directories, 'default' ); - } - - /* Get the first directory */ - $first_dir = array_shift( $directories ); - - /* Loop through the dirs */ - $emodirs = array( 0 => '' ); - - try - { - foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons' ) as $file ) - { - if( ! $file->isDot() && $file->isDir() ) - { - /* Add to emoticon list */ - if( $file->getFilename() == 'default' ) - { - $emodirs[0] = $file->getFilename(); - } - else - { - $emodirs[] = $file->getFilename(); - } - } - } - } catch ( Exception $e ) {} - - /* Loop through each form upload field */ - foreach( array( 1,2,3,4 ) as $i ) - { - /* Upload Data */ - $field = 'upload_'.$i; - $FILE_NAME = $_FILES[$field]['name']; - $FILE_SIZE = $_FILES[$field]['size']; - $FILE_TYPE = $_FILES[$field]['type']; - - //----------------------------------------- - // Naughty Opera adds the filename on the end of the - // mime type - we don't want this. - //----------------------------------------- - - $FILE_TYPE = preg_replace( "/^(.+?);.*$/", "\\1", $FILE_TYPE ); - - //----------------------------------------- - // Naughty Mozilla likes to use "none" to indicate an empty upload field. - // I love universal languages that aren't universal. - //----------------------------------------- - - if ( $_FILES[$field]['name'] == "" or ! $_FILES[$field]['name'] or ($_FILES[$field]['name'] == "none") ) - { - continue; - } - - //----------------------------------------- - // Make sure it's not a NAUGHTY file - //----------------------------------------- - - $file_extension = preg_replace( '#^.*\.(.+?)$#si', "\\1", mb_strtolower( $_FILES[ $field ]['name'] ) ); - - if ( ! in_array( $file_extension, $this->allowed_files ) ) - { - $this->registry->output->global_message = $this->lang->words['emo_mimes']; // The screams of angst from Emo Mimes are silent... - $this->emoticonsOverview(); - return; - } - - //----------------------------------------- - // Copy the upload to the uploads directory - //----------------------------------------- - - if ( ! @move_uploaded_file( $_FILES[ $field ]['tmp_name'], DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $first_dir . "/" . $FILE_NAME) ) - { - $this->registry->output->global_message = "The upload failed, sorry!"; - $this->emoticonsOverview(); - return; - } - else - { - @chmod( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $first_dir . "/" . $FILE_NAME, IPS_FILE_PERMISSION ); - - //----------------------------------------- - // Copy to other folders - //----------------------------------------- - - if ( is_array( $directories ) and count( $directories ) ) - { - foreach ( $directories as $newdir ) - { - if ( is_file( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $newdir . "/" . $FILE_NAME ) ) - { - if ( $overwrite != 1 OR $newdir == 'default' ) - { - continue; - } - } - - if ( @copy( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $first_dir . "/" . $FILE_NAME, DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $newdir . "/" . $FILE_NAME ) ) - { - @chmod( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $newdir . "/" . $FILE_NAME, IPS_FILE_PERMISSION ); - } - } - } - - // Let's make sure this 'image' is available in all directories too - if ( is_array( $emodirs ) and count( $emodirs ) ) - { - foreach ( $emodirs as $newdir ) - { - if ( is_file( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $newdir . "/" . $FILE_NAME ) ) - { - continue; - } - - if( @copy( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $first_dir . "/" .$FILE_NAME, DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $newdir . "/" . $FILE_NAME ) ) - { - @chmod( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $newdir . "/" . $FILE_NAME, IPS_FILE_PERMISSION ); - } - } - } - - $uploaded++; - } - } - - if( !$uploaded ) - { - $this->registry->output->global_message = $this->lang->words['no_emo_selected']; - } - else - { - $this->registry->output->global_message = $this->lang->words['emo_complete']; - } - - $this->emoticonsOverview(); - } - - /** - * Removes an emoticon set - * - * @return @e void - */ - public function emoticonsSetRemove() - { - /* Check the ID */ - if ( ! $this->request['id'] ) - { - $this->registry->output->global_message = $this->lang->words['emo_noset']; - $this->emoticonsOverview(); - } - - /* Can't remove the default set */ - if( $this->request['id'] == 'default' ) - { - $this->registry->output->global_message = $this->lang->words['emo_norename']; - $this->emoticonsOverview(); - return; - } - - /* Remove the directory */ - $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . '/classFileManagement.php', 'classFileManagement' ); - $fileManagement = new $classToLoad(); - $fileManagement->removeDirectory( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $this->request['id'] ); - - /* Remove the database entry */ - $this->DB->delete( 'emoticons', "emo_set='{$this->request['id']}'" ); - - /* Rebuild cache */ - $this->emoticonsRebuildCache(); - - /* Bounce */ - $this->registry->output->global_message = $this->lang->words['emo_folder_rem']; - $this->emoticonsOverview(); - } - - /** - * Add/Edit an emoticon folder name - * - * @param string Type (add or edit) - * @return @e void - */ - public function emoticonsSetAlter( $type='add' ) - { - /* Get the name */ - $name = preg_replace( '/[^a-zA-Z0-9\-_]/', "", $this->request['emoset'] ); - - /* Check th ename */ - if( $name == "" ) - { - $this->registry->output->global_message = $this->lang->words['emo_a_to_z']; - return $this->emoticonsOverview(); - } - - /* Check Safe Mode */ - if( SAFE_MODE_ON ) - { - $this->registry->output->global_message = $this->lang->words['emo_safemode']; - return $this->emoticonsOverview(); - } - - /* Check to see if the directory already exists */ - if( file_exists( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $name ) ) - { - $this->registry->output->global_message = sprintf( $this->lang->words['emo_already'], $name ); - return $this->emoticonsOverview(); - } - - if( $type == 'add' ) - { - /* Create the directory */ - if( @mkdir( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $name, IPS_FOLDER_PERMISSION ) ) - { - @chmod( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $name, IPS_FOLDER_PERMISSION ); - @file_put_contents( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $name . '/index.html', '' ); - - /* Copy default emoticons */ - try - { - foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/default/' ) as $file ) - { - if( ! $file->isDot() ) - { - @copy( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/default/' . $file->getFilename(), DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $name . '/' . $file->getFilename() ); - @chmod( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $name . '/' . $file->getFilename(), IPS_FILE_PERMISSION ); - } - } - } catch ( Exception $e ) {} - - /* Query the default set */ - $this->DB->build( array( 'select' => '*', 'from' => 'emoticons', 'where' => "emo_set='default'" ) ); - $outer = $this->DB->execute(); - - /* Insert emoticons for the new set */ - while( $r = $this->DB->fetch($outer) ) - { - $this->DB->insert( "emoticons", array( 'clickable' => $r['clickable'], 'typed' => $r['typed'], 'emo_set' => $name, 'image' => $r['image'] ) ); - } - - /* Bounce */ - $this->registry->output->global_message = $this->lang->words['emo_folder_new']; - return $this->emoticonsOverview(); - } - else - { - /* Couldn't create the directory, Bounce */ - $this->registry->output->global_message = $this->lang->words['emo_ftp']; - return $this->emoticonsOverview(); - } - } - /* Edit Folder Name */ - else - { - /* Check the directory ID */ - if ( ! $this->request['id'] ) - { - $this->registry->output->global_message = $this->lang->words['emo_miss_dir']; - $this->emoticonsOverview(); - return; - } - - /* Can't rename the default directory */ - if( $this->request['id'] == 'default' ) - { - $this->registry->output->global_message = $this->lang->words['emo_norename']; - $this->emoticonsOverview(); - return; - } - - /* Rename the directory */ - if ( @rename( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $this->request['id'], DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $name ) ) - { - /* Check to see if the rename worked */ - if ( file_exists( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $name ) ) - { - /* Update all the emoticons */ - $this->DB->update( 'emoticons', array( 'emo_set' => $name ), "emo_set='{$this->request['id']}'" ); - } - - /* Rebuild the cache */ - $this->emoticonsRebuildCache(); - - /* Update skins that are using this set */ - $rebuild_sets = array(); - - /* Querh skin sets */ - $this->DB->build( array( 'select' => 'set_id', 'from' => 'skin_collections', 'where' => "set_emo_dir='{$this->request['id']}'" ) ); - $outer = $this->DB->execute(); - - /* Loop thorugh and update the emoticon folder */ - while( $r = $this->DB->fetch($outer) ) - { - $this->DB->update( 'skin_collections', array( 'set_emo_dir' => $name ), 'set_id=' . $r['set_id'] ); - $rebuild_sets[] = $r['set_id']; - } - - /* Bounce */ - $this->registry->output->global_message = $this->lang->words['emo_folder_name']; - return $this->emoticonsOverview(); - } - else - { - /* Error and bounce */ - $this->registry->output->global_message = $this->lang->words['emo_wecantdoit']; - return $this->emoticonsOverview(); - } - } - } - - /** - * Process edit emoticons forum - * - * @return @e void - */ - public function emoticonsEdit() - { - /* Check ID */ - if( $this->request['id'] == '' ) - { - $this->registry->output->global_error = $this->lang->words['emo_nogid']; - return $this->emoticonsOverview(); - } - - /* Loop through the request and pull out emoticons */ - foreach( $this->request as $key => $value ) - { - /* Check to see if its an emoticon */ - if ( preg_match( '/^emo_id_(\d+)$/', $key, $match ) ) - { - if ( $match[0] ) - { - /* INI */ - $typed = ''; - - /* Format type for default set */ - if( $this->request['id'] == 'default' ) - { - $typed = str_replace( '"', "", $this->request[ 'emo_type_' . $match[1] ] ); - $typed = str_replace( '\', "", $typed ); - } - - /* Check clickable */ - $click = $this->request[ 'emo_click_' . $match[1] ]; - - /* Update the emoticon */ - if ( $match[1] ) - { - if( $typed ) - { - /* Get the original name */ - $orig_typed = $this->DB->buildAndFetch( array( 'select' => 'typed', 'from' => 'emoticons', 'where' => 'id=' . intval( $match[1] ) ) ); - - /* Update to new name */ - $this->DB->update( 'emoticons', array( 'clickable' => intval( $click ), 'typed' => $typed ), 'id=' . intval( $match[1] ) ); - $this->DB->update( 'emoticons', array( 'typed' => $typed ), "typed='" . $this->DB->addSlashes($orig_typed['typed']) . "'" ); - } - else - { - /* Just update clickable */ - $this->DB->update( 'emoticons', array( 'clickable' => intval( $click ) ), 'id=' . intval( $match[1] ) ); - } - } - } - } - } - - /* Recache and bounce */ - $this->emoticonsRebuildCache(); - - $this->registry->output->global_message = $this->lang->words['emo_updated']; - $this->emoticonsManageDirectory(); - } - - /** - * Manage emoticons - * - * @return @e void - */ - public function emoticonsManageDirectory() - { - /* INI */ - $this->request['id'] = trim( $this->request['id'] ); - - /* Get emoticons for this group */ - $emo_db = $this->_getEmoSet( $this->request['id'] ); - $emo_file = array(); - - /* Get emoticons from the directory */ - $emo_file = array(); - $emo_rfile = $this->_emoticonGetGolderContents( $this->request['id'] ); - - foreach( $emo_rfile as $ef ) - { - $emo_file[ $ef ] = $ef; - } - - /* Loop through the database emoticons */ - $poss_names = array(); - $db_rows = array(); - - foreach( $emo_db as $image => $data ) - { - /* Remove this from the file list, it's already added */ - unset( $emo_file[ $data['image'] ] ); - - /* Add image to array */ - $data['image'] = $data['image']; - /* Addd array to output */ - $db_rows[] = $data; - - /* Possible names filter */ - $poss_names[$data['typed']] = $data['typed']; - } - - /* Check for unassigned images in the emoticon directory */ - $file_rows = array(); - - if ( count( $emo_file ) && $this->request['id'] == 'default' ) - { - /* Loop through the unassigned emoticons */ - foreach( $emo_file as $image ) - { - /* INI */ - $_fdata = array(); - - /* Suggest an emoticon name */ - $_fdata['poss_name'] = ':'.preg_replace( '/(.*)(\..+?)$/', "\\1", $image ).':'; - - if ( ! empty($poss_names[ $_fdata['poss_name'] ]) ) - { - $_fdata['poss_name'] = preg_replace( "/:$/", "2:", $_fdata['poss_name'] ); - } - - /* Add the image */ - $_fdata['image'] = $image; - - /* Add to output array */ - $file_rows[] = $_fdata; - } - } - - /* Output */ - - $this->registry->output->extra_nav[] = array( '', $this->lang->words['emo_manage_set'].$this->request['id'] ); - $this->registry->output->html .= $this->html->emoticonsDirectoryManagement( $db_rows, $file_rows); - } - - /** - * Builds the emoticons overview screen - * - * @return @e void - */ - public function emoticonsOverview() - { - /* Check for the emoticon directory */ - if ( ! is_dir( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons' ) ) - { - $this->registry->output->showError( $this->lang->words['emo_nolocate'], 2111 ); - - } - - /* Check the emoticon count */ - $this->DB->build( array( 'select' => 'id, count(id) as count, emo_set', - 'from' => 'emoticons', - 'group' => 'emo_set, id', - 'order' => 'emo_set' - ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $emo_db[ $r['emo_set'] ] = $r; - } - - /* Get emoticon folders */ - $emodirs = array( 0 => ''); - - try - { - foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons' ) as $_emoticon ) - { - if ( $_emoticon->isDir() AND ! $_emoticon->isDot() AND $_emoticon->getFilename() != '.svn' ) - { - if ( is_dir( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $_emoticon ) ) - { - if( $_emoticon->getFilename() == 'default' ) - { - $emodirs[0] = $_emoticon->getFilename(); - } - else - { - $emodirs[] = $_emoticon->getFilename(); - } - } - } - } - } catch ( Exception $e ) {} - - /* Loop through the emoticon directories */ - $rows = array(); - $i = 0; - $total = count($emodirs); - - foreach( $emodirs as $dir ) - { - $i++; - - $data = array(); - - $files = $this->_emoticonGetGolderContents( $dir ); - $data['count'] = intval( count($files) ); - - if( $dir == 'default' ) - { - $data['line_image'] = ''; - $data['link_text'] = $this->lang->words['emo_manageemos']; - } - else - { - $data['link_text'] = $this->lang->words['emo_setclickable']; - - if( $i == $total ) - { - $data['line_image'] = " "; - } - else - { - $data['line_image'] = " "; - } - } - - if ( is_writeable( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $dir ) ) - { - if( $dir == 'default' ) - { - $checked_def = "checked='checked' disabled='disabled' "; - } - else - { - $checked_def = ""; - } - - $data['icon'] = 'writable.png'; - $data['title'] = $this->lang->words['emo_writeable']; - $data['checkbox'] = ""; - } - else - { - $data['icon'] = 'unwritable.png'; - $data['title'] = $this->lang->words['emo_writeable_not']; - $data['checkbox'] = "-"; - } - - $data['dir'] = $dir; - $data['dir_count'] = intval( $emo_db[ $dir ]['count'] ); - - $rows[] = $data; - } - - $this->registry->output->html .= $this->html->emoticonsOverview( $rows ); - } - - /** - * Rebuilds the emoticon cache - * - * @return @e void - */ - public function emoticonsRebuildCache() - { - $cache = array(); - - $this->DB->build( array( 'select' => 'typed,image,clickable,emo_set', 'from' => 'emoticons', 'order' => 'emo_position asc' ) ); - $c = $this->DB->execute(); - - while ( $r = $this->DB->fetch( $c ) ) - { - $cache[] = $r; - } - - ipsRegistry::cache()->setCache( 'emoticons', $cache, array( 'array' => 1 ) ); - } - - /** - * Fetch next position - * @param string Emo set ID (default) - * - */ - protected function _getNextPosition( $set ) - { - $res = $this->DB->buildAndFetch( array( 'select' => 'MAX(emo_position) as max', - 'from' => 'emoticons', - 'where' => "emo_set='" . $this->DB->addSlashes( $set ) . "'" ) ); - - return intval( $res['max'] ) + 1; - } - - /** - * Fetch possible name - * @param string Image name (smile.gif) - * @param string Emo set ID (default) - * - */ - protected function _getNameFromImg( $img, $set ) - { - $emos = $this->_getEmoSet( $set ); - $name = ':' . preg_replace( '/(.*)(\..+?)$/', "\\1", $img ).':'; - - /* Ensure we're not doubling up */ - foreach( $emos as $im => $data ) - { - if ( $name == $data['typed'] ) - { - $name = preg_replace( "/:$/", "2:", $name ); - break; - } - } - - return $name; - } - - /** - * Get all emos in a set - * @param string Emo set ID (default) - */ - protected function _getEmoSet( $set ) - { - if ( ! is_array( $this->setCache[ $set ] ) OR ! count( $this->setCache[ $set ] ) ) - { - $this->setCache[ $set ] = array(); - - $this->DB->build( array( 'select' => '*', - 'from' => 'emoticons', - 'where' => "emo_set='" . $this->DB->addSlashes( $set ) . "'", - 'order' => 'emo_position ASC' ) ); - $this->DB->execute(); - - /* Loop through the emoticons */ - while( $r = $this->DB->fetch() ) - { - $this->setCache[ $set ][ $r['emo_position'] . '.' . rand(0, 10000 ) ] = $r; - } - - ksort( $this->setCache[ $set ] ); - } - - return $this->setCache[ $set ]; - } - - /** - * Custom sort operation - * - * @param string A - * @param string B - * @return integer - */ - protected static function _thisUsort($a, $b) - { - if ( strlen($a['typed']) == strlen($b['typed']) ) - { - return 0; - } - - return ( strlen($a['typed']) > strlen($b['typed']) ) ? -1 : 1; - } - - /** - * Gets all the emoticons from the specified directory - * - * @param string $folder Emoticon folder to pull emoticons from - * @return array - */ - protected function _emoticonGetGolderContents( $folder='default' ) - { - $files = array(); - - /* Loop through the emoticon directory */ - try - { - foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $folder ) as $_emo ) - { - if( $_emo->isFile() && ! $_emo->isDot() ) - { - if ( preg_match( '/\.(?:gif|jpg|jpeg|png|swf)$/i', $_emo->getFilename() ) ) - { - $files[] = $_emo->getFilename(); - } - } - } - } catch ( Exception $e ) {} - - return $files; - } + + * Invision Power Services + * IP.Board v3.4.6 + * Emoticon Management + * Last Updated: $LastChangedDate: 2012-05-24 16:20:59 -0400 (Thu, 24 May 2012) $ + * + * + * @author $Author: ips_terabyte $ + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license http://www.invisionpower.com/company/standards.php#license + * @package IP.Board + * @subpackage Core + * @link http://www.invisionpower.com + * @since 27th January 2004 + * @version $Rev: 10792 $ + */ + +if ( ! defined( 'IN_ACP' ) ) +{ + print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; + exit(); +} + +class admin_core_posts_emoticons extends ipsCommand +{ + /** + * Allowed file types + * + * @var array + */ + public $allowed_files = array( 'png', 'jpeg', 'jpg', 'gif' ); + + protected $setCache = array(); + + /** + * Main class entry point + * + * @param object ipsRegistry reference + * @return @e void [Outputs to screen] + */ + public function doExecute( ipsRegistry $registry ) + { + /* Load Skin and Lang */ + $this->html = $this->registry->output->loadTemplate( 'cp_skin_emoticons' ); + $this->html->form_code = '&module=posts&section=emoticons&'; + $this->html->form_code_js = '&module=posts§ion=emoticons&'; + + $this->lang->loadLanguageFile( array( 'admin_posts' ) ); + + //----------------------------------------- + // What to do... + //----------------------------------------- + + switch( $this->request['do'] ) + { + case 'emo_packsplash': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emoticons_manage' ); + $this->emoticonsPackSplash(); + break; + + case 'emo_packexport': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emoticons_manage' ); + $this->emoticonsPackExport(); + break; + + case 'emo_packimport': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emoticons_manage' ); + $this->emoticonsPackImport(); + break; + + case 'emo_manage': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emoticons_manage' ); + $this->emoticonsManageDirectory(); + break; + + case 'emo_doedit': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emoticons_edit' ); + $this->emoticonsEdit(); + break; + + case 'emo_doadd': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emoticons_add' ); + $this->emoticonsAdd(); + break; + + case 'emo_remove': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emoticons_delete' ); + $this->emoticonsRemove(); + break; + + case 'emo_setadd': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emoticons_add' ); + $this->emoticonsSetAlter( $type='add' ); + break; + + case 'emo_setedit': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emoticons_edit' ); + $this->emoticonsSetAlter( $type='edit' ); + break; + + case 'emo_setremove': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emoticons_delete' ); + $this->emoticonsSetRemove(); + break; + + case 'emo_upload': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emoticons_add' ); + $this->emoticonsUpload(); + break; + + case 'emo': + case 'overview': + default: + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'emoticons_manage' ); + $this->emoticonsOverview(); + break; + case 'reorder': + $this->_reorder(); + break; + } + + /* Output */ + $this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper(); + $this->registry->output->sendOutput(); + } + + /** + * Reorder hooks + * + * @return @e void [Outputs to screen] + */ + protected function _reorder() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classAjax.php', 'classAjax' ); + $ajax = new $classToLoad(); + $set = trim( $this->request['id'] ); + + //----------------------------------------- + // Save new position + //----------------------------------------- + + $position = 1; + + if ( is_array( $this->request['emoticons'] ) AND count( $this->request['emoticons'] ) ) + { + /* Reset all emoticons to 0 temporarily */ + $this->DB->update( 'emoticons', array( 'emo_position' => 0 ), 'emo_set=\'' . $this->DB->addSlashes( $set ) . "'" ); + + foreach( $this->request['emoticons'] as $this_id ) + { + $this->DB->update( 'emoticons', array( 'emo_position' => $position ), 'id=' . intval($this_id) ); + + $position++; + } + } + + $this->emoticonsRebuildCache(); + + $ajax->returnString( 'OK' ); + } + + /** + * Import an emoticon pack + * + * @return @e void + */ + public function emoticonsPackImport() + { + /* Make sure all emoticon directories are writable */ + $this->DB->build( array( 'select' => $this->DB->buildDistinct('emo_set') . ' as folder', 'from' => 'emoticons' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $_folders[] = $r['folder']; + } + + if( count($_folders) ) + { + foreach( $_folders as $folder ) + { + if( !IPSLib::isWritable( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $folder ) ) + { + $this->registry->output->global_error = sprintf( $this->lang->words['emodir_not_write'], PUBLIC_DIRECTORY . '/style_emoticons/' . $folder ); + return $this->emoticonsPackSplash(); + } + } + } + + /* Get the xml file */ + try + { + $content = $this->registry->adminFunctions->importXml( 'ipb_emoticons.xml' ); + } + catch ( Exception $e ) + { + $this->registry->output->showError( $e->getMessage() ); + } + + /* Check for content */ + if ( ! $content ) + { + $this->registry->output->global_error = $this->lang->words['emo_fail']; + return $this->emoticonsPackSplash(); + } + + /* Setup XML */ + require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ + $xml = new classXML( IPS_DOC_CHAR_SET ); + + require_once( IPS_KERNEL_PATH.'classXMLArchive.php' );/*noLibHook*/ + $xmlarchive = new classXMLArchive(); + + /* Read the archive */ + $xmlarchive->readXML( $content ); + + /* Get the data file */ + $emoticons = array(); + $emoticon_data = array(); + + foreach( $xmlarchive->asArray() as $k => $f ) + { + if ( $k == 'emoticon_data.xml' ) + { + $emoticon_data = $f; + } + else + { + $emoticons[ $f['filename'] ] = $f['content']; + } + } + + /* Parse the XML Document */ + $xml->loadXML( $emoticon_data['content'] ); + + /* Make sure we have a destination for these emoicons */ + if ( ! $this->request['emo_set'] and ! $this->request['new_emo_set'] ) + { + $this->registry->output->global_error = $this->lang->words['emo_specify']; + } + + /* Current emoticon set directory */ + $emo_set_dir = trim( $this->request['emo_set'] ); + + /* New emoticon set directory */ + $this->request['new_emo_set'] = preg_replace( '/[^a-zA-Z0-9\-_]/', "", $this->request['new_emo_set'] ); + + /* Create the new set */ + if ( $this->request['new_emo_set'] ) + { + $emo_set_dir = trim( $this->request['new_emo_set'] ); + + /* Check to see if the directory already exists */ + if ( file_exists( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $emo_set_dir ) ) + { + $this->registry->output->global_error = sprintf( $this->lang->words['emo_already'], $emo_set_dir ); + return $this->emoticonsPackSplash(); + } + + /* Create the directory */ + if ( @mkdir( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $emo_set_dir, IPS_FOLDER_PERMISSION ) ) + { + @chmod( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $emo_set_dir, IPS_FOLDER_PERMISSION ); + @file_put_contents( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $emo_set_dir . '/index.html', '' ); + } + else + { + $this->registry->output->global_error = $this->lang->words['emo_ftp']; + return $this->emoticonsPackSplash(); + } + } + + /* Get a list of current emoticons, if we are not overwriting */ + $emo_image = array(); + $emo_typed = array(); + + if ( $this->request['overwrite'] != 1 ) + { + $this->DB->build( array( 'select' => '*', 'from' => 'emoticons', 'where' => "emo_set='" . $emo_set_dir . "'" ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $emo_image[ $r['image'] ] = 1; + $emo_typed[ $r['typed'] ] = 1; + } + } + + /* Loop through the emoticons in the xml document */ + foreach( $xml->fetchElements('emoticon') as $emoticon ) + { + $entry = $xml->fetchElementsFromRecord( $emoticon ); + + /* Emoticon Data */ + $image = $entry['image']; + $typed = $entry['typed']; + $click = $entry['clickable']; + + /* Skip if we're not overwriting */ + if ( $emo_image[ $image ] or $emo_typed[ $typed ] ) + { + continue; + } + + /* Get the extension */ + $file_extension = preg_replace( '#^.*\.(.+?)$#si', "\\1", strtolower( $image ) ); + + /* Make sure it's allowed */ + if ( ! in_array( $file_extension, $this->allowed_files ) ) + { + continue; + } + + /* Remove any existing emoticon */ + @unlink( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $emo_set_dir . '/' . $image ); + + $this->DB->delete( 'emoticons', "typed='$typed' and image='$image' and emo_set='$emo_set_dir'" ); + + /* Create the image in the file system */ + if( $FH = fopen( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' .$emo_set_dir . '/' . $image, 'wb' ) ) + { + if ( fwrite( $FH, $emoticons[ $image ] ) ) + { + fclose( $FH ); + + /* Insert the emoticon record */ + $this->DB->insert( 'emoticons', array( 'typed' => $typed, 'image' => $image, 'clickable' => $click, 'emo_set' => $emo_set_dir ) ); + } + } + + /* Add the emoticon to all the other directories */ + try + { + foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' ) as $file ) + { + if( ! $file->isDot() && $file->isDir() ) + { + if ( substr( $file->getFilename(), 0, 1 ) == '.' ) + { + continue; + } + + if ( ! is_file( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $file->getFilename() . '/' . $image ) ) + { + $this->DB->delete( 'emoticons', "typed='$typed' and image='$image' and emo_set='{$file->getFilename()}'" ); + + if ( $FH = @fopen( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $file->getFilename() . '/' . $image, 'wb' ) ) + { + if ( fwrite( $FH, $emoticons[ $image ] ) ) + { + fclose( $FH ); + + $this->DB->insert( 'emoticons', array( 'typed' => $typed, 'image' => $image, 'clickable' => $click, 'emo_set' => $file->getFilename() ) ); + } + } + } + } + } + } catch ( Exception $e ) {} + } + + /* Recache and bounce */ + $this->emoticonsRebuildCache(); + + $this->registry->output->global_message = $this->lang->words['emo_xml_good']; + $this->emoticonsOverview(); + + } + + /** + * Export the specified emoticon directory + * + * @return @e void + */ + public function emoticonsPackExport() + { + /* Setup XML */ + require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ + $xml = new classXML( IPS_DOC_CHAR_SET ); + + require_once( IPS_KERNEL_PATH . 'classXMLArchive.php' );/*noLibHook*/ + $xmlarchive = new classXMLArchive(); + + /* Check the emoticon set */ + if ( ! $this->request['emo_set'] ) + { + $this->registry->output->global_message = $this->lang->words['emo_specify_exS']; + $this->emoticonsOverview(); + return; + } + + /* Get emoticons from the database */ + $emo_db = array(); + + $this->DB->build( array( 'select' => '*', 'from' => 'emoticons', 'where' => "emo_set='{$this->request['emo_set']}'" ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $emo_db[ $r['image'] ] = $r; + } + + /* Get Emoticon Folders */ + $emodirs = array(); + $emodd = array(); + $files_to_add = array(); + + try + { + foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $this->request['emo_set'] ) as $file ) + { + if( ! $file->isDot() ) + { + if ( $emo_db[ $file->getFilename() ] != "" ) + { + $files_to_add[] = DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $this->request['emo_set'] . '/' . $file->getFilename(); + } + } + } + } catch ( Exception $e ) {} + + /* Add each file to the xml archive */ + foreach( $files_to_add as $f ) + { + $xmlarchive->add( $f ); + } + + $xml->newXMLDocument(); + $xml->addElement( 'emoticonexport' ); + $xml->addElement( 'emogroup', 'emoticonexport' ); + + foreach( $emo_db as $r ) + { + $content = array(); + + $content['typed'] = $r['typed']; + $content['image'] = $r['image']; + $content['clickable'] = $r['clickable']; + + $xml->addElementAsRecord( 'emogroup', 'emoticon', $content ); + } + + /* Create the XML Document */ + $xmlData = $xml->fetchDocument(); + + /* Add the xml document to the archive */ + $xmlarchive->add( $xmlData, 'emoticon_data.xml' ); + + /* Send the archive to the browser */ + $imagearchive = $xmlarchive->getArchiveContents(); + $this->registry->output->showDownload( $imagearchive, 'ipb_emoticons.xml' ); + } + + /** + * Builds the emoticon import/export pack splash screen + * + * @return @e void + */ + public function emoticonsPackSplash() + { + /* Check for the emoticon directory */ + if( ! is_dir( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons' ) ) + { + $this->registry->output->showError( $this->lang->words['emo_nolocate'], 2110 ); + + } + + /* Count the number of current emoticons */ + $this->DB->build( array( 'select' => 'id, count(id) as count, emo_set', + 'from' => 'emoticons', + 'group' => 'id, emo_set', + 'order' => 'emo_set' + ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $emo_db[ $r['emo_set'] ] = $r; + } + + /* Get the emoticon folders */ + $emodirs = array(); + $emodd = array(); + + try + { + foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons' ) as $file ) + { + if( $file->isDir() && ! $file->isDot() ) + { + $emodirs[] = $file->getFilename(); + $emodd[] = array( $file->getFilename(), $file->getFilename() ); + } + } + } catch ( Exception $e ) {} + + /* Build Form Elements */ + $form = array(); + $form['emo_set'] = $this->registry->output->formDropdown( 'emo_set', $emodd ); + $form['new_emo_set'] = $this->registry->output->formInput( 'new_emo_set' ); + $form['overwrite'] = $this->registry->output->formYesNo( 'overwrite' ); + + /* Output */ + $this->registry->output->html .= $this->html->emoticonsPackSplash( $form ); + } + + /** + * Remove the specified emoticon + * + * @return @e void + */ + public function emoticonsRemove() + { + /* Check the ID */ + if( $this->request['id'] == "" ) + { + $this->registry->output->global_message = $this->lang->words['emo_nogid']; + $this->emoticonsOverview(); + return; + } + + /* Can only remove the default set */ + if( $this->request['id'] != "default" ) + { + $this->registry->output->global_message = $this->lang->words['emo_onlydothis']; + $this->emoticonsOverview(); + return; + } + + /* Check for the emoticon ID */ + $this->request['eid'] = intval( $this->request['eid'] ); + + if( ! $this->request['eid'] ) + { + $this->registry->output->global_message = $this->lang->words['emo_noid']; + $this->emoticonsManageDirectory(); + return; + } + + /* Get the emoticon info */ + $emo_info = $this->DB->buildAndFetch( array( 'select' => 'typed', 'from' => 'emoticons', 'where' => "id=" . $this->request['eid']) ); + + /* Delete the emoticon */ + $this->DB->delete( 'emoticons', "typed='{$emo_info['typed']}'" ); + + /* Rebuild the cache and bounce */ + $this->emoticonsRebuildCache(); + + $this->registry->output->global_message = $this->lang->words['emo_removed']; + $this->emoticonsManageDirectory(); + } + + /** + * Add emoticons to the default directory + * + * @return @e void + */ + public function emoticonsAdd() + { + $image = str_replace( '---', '.', trim( $this->request['emo_image'] ) ); + $set = trim( $this->request['id'] ); + $typed = $this->_getNameFromImg( $image, $set ); + $position = $this->_getNextPosition( $set ); + + /* Check the id */ + if ( empty( $set ) ) + { + $this->registry->output->global_message = $this->lang->words['emo_nogid']; + $this->emoticonsOverview(); + return; + } + + /* Can only upload to the default directory */ + if( $this->request['id'] != "default" ) + { + $this->registry->output->global_message = $this->lang->words['emo_onlydothis']; + $this->emoticonsOverview(); + return; + } + + if ( ! $image OR ! $typed ) + { + $this->registry->output->global_message = $this->lang->words['emo_nogid']; + $this->emoticonsOverview(); + return; + } + + /* Insert the emo record */ + // as per http://community.invisionpower.com/tracker/issue-34269-emoticon-imports - add to all records rather than + // just the default. In future version, will hopefully rewrite emoticon management and make this process less mental + foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons' ) as $_emoticon ) + { + if ( $_emoticon->isDir() AND ! $_emoticon->isDot() AND $_emoticon->getFilename() != '.svn' ) + { + if ( is_dir( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $_emoticon ) ) + { + $this->DB->insert( 'emoticons', array( 'typed' => $typed, 'image' => $image, 'emo_set' => $_emoticon->getFilename(), 'emo_position' => $position ) ); + } + } + } + + /* Emoticon list */ + $emodirs = array( 0 => ''); + + /* Loop through all the emoticons */ + try + { + foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons' ) as $file ) + { + if ( ! $file->isDot() && $file->isDir() && strpos( $file->getFilename(), '.' ) != 0 ) + { + if( $file->getFilename() == 'default' ) + { + $emodirs[0] = $file->getFilename(); + } + else + { + $emodirs[] = $file->getFilename(); + } + } + } + } catch ( Exception $e ) {} + + /* Add this emoticon to the other sets */ + foreach( $emodirs as $directory ) + { + if ( $directory == $set ) + { + continue; + } + + if ( empty( $directory ) ) + { + continue; + } + + $this->DB->insert( 'emoticons', array( 'typed' => $typed, 'image' => $image, 'emo_set' => $directory, 'emo_position' => $position ) ); + } + + /* Rebuild the cache and bounce */ + $this->emoticonsRebuildCache(); + + $this->registry->output->global_message = $this->lang->words['emo_updated']; + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->html->form_code . '&do=emo_manage&id=' . $this->request['id'] ); + } + + /** + * Handles the upload emoticon form + * + * @return @e void + */ + public function emoticonsUpload() + { + /* INI */ + $overwrite = 1; + $uploaded = 0; + + /* Check the request for uploads */ + $directories = array(); + $first_dir = ''; + + foreach( $this->request as $key => $value ) + { + if( preg_match( "/^dir_(.*)$/", $key, $match ) ) + { + if( $this->request[ $match[0] ] == 1 ) + { + $directories[] = $match[1]; + } + } + } + + /* Can't upload to default */ + if ( ! count( $directories ) ) + { + $this->registry->output->global_message = $this->lang->words['emo_pickanother']; + $this->emoticonsOverview(); + return; + } + + /* Remove default from the directories list */ + if ( ! in_array( 'default', $directories ) ) + { + array_push( $directories, 'default' ); + } + + /* Get the first directory */ + $first_dir = array_shift( $directories ); + + /* Loop through the dirs */ + $emodirs = array( 0 => '' ); + + try + { + foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons' ) as $file ) + { + if( ! $file->isDot() && $file->isDir() ) + { + /* Add to emoticon list */ + if( $file->getFilename() == 'default' ) + { + $emodirs[0] = $file->getFilename(); + } + else + { + $emodirs[] = $file->getFilename(); + } + } + } + } catch ( Exception $e ) {} + + /* Loop through each form upload field */ + foreach( array( 1,2,3,4 ) as $i ) + { + /* Upload Data */ + $field = 'upload_'.$i; + $FILE_NAME = $_FILES[$field]['name']; + $FILE_SIZE = $_FILES[$field]['size']; + $FILE_TYPE = $_FILES[$field]['type']; + + //----------------------------------------- + // Naughty Opera adds the filename on the end of the + // mime type - we don't want this. + //----------------------------------------- + + $FILE_TYPE = preg_replace( "/^(.+?);.*$/", "\\1", $FILE_TYPE ); + + //----------------------------------------- + // Naughty Mozilla likes to use "none" to indicate an empty upload field. + // I love universal languages that aren't universal. + //----------------------------------------- + + if ( $_FILES[$field]['name'] == "" or ! $_FILES[$field]['name'] or ($_FILES[$field]['name'] == "none") ) + { + continue; + } + + //----------------------------------------- + // Make sure it's not a NAUGHTY file + //----------------------------------------- + + $file_extension = preg_replace( '#^.*\.(.+?)$#si', "\\1", strtolower( $_FILES[ $field ]['name'] ) ); + + if ( ! in_array( $file_extension, $this->allowed_files ) ) + { + $this->registry->output->global_message = $this->lang->words['emo_mimes']; // The screams of angst from Emo Mimes are silent... + $this->emoticonsOverview(); + return; + } + + //----------------------------------------- + // Copy the upload to the uploads directory + //----------------------------------------- + + if ( ! @move_uploaded_file( $_FILES[ $field ]['tmp_name'], DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $first_dir . "/" . $FILE_NAME) ) + { + $this->registry->output->global_message = "The upload failed, sorry!"; + $this->emoticonsOverview(); + return; + } + else + { + @chmod( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $first_dir . "/" . $FILE_NAME, IPS_FILE_PERMISSION ); + + //----------------------------------------- + // Copy to other folders + //----------------------------------------- + + if ( is_array( $directories ) and count( $directories ) ) + { + foreach ( $directories as $newdir ) + { + if ( is_file( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $newdir . "/" . $FILE_NAME ) ) + { + if ( $overwrite != 1 OR $newdir == 'default' ) + { + continue; + } + } + + if ( @copy( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $first_dir . "/" . $FILE_NAME, DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $newdir . "/" . $FILE_NAME ) ) + { + @chmod( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $newdir . "/" . $FILE_NAME, IPS_FILE_PERMISSION ); + } + } + } + + // Let's make sure this 'image' is available in all directories too + if ( is_array( $emodirs ) and count( $emodirs ) ) + { + foreach ( $emodirs as $newdir ) + { + if ( is_file( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $newdir . "/" . $FILE_NAME ) ) + { + continue; + } + + if( @copy( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $first_dir . "/" .$FILE_NAME, DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $newdir . "/" . $FILE_NAME ) ) + { + @chmod( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $newdir . "/" . $FILE_NAME, IPS_FILE_PERMISSION ); + } + } + } + + $uploaded++; + } + } + + if( !$uploaded ) + { + $this->registry->output->global_message = $this->lang->words['no_emo_selected']; + } + else + { + $this->registry->output->global_message = $this->lang->words['emo_complete']; + } + + $this->emoticonsOverview(); + } + + /** + * Removes an emoticon set + * + * @return @e void + */ + public function emoticonsSetRemove() + { + /* Check the ID */ + if ( ! $this->request['id'] ) + { + $this->registry->output->global_message = $this->lang->words['emo_noset']; + $this->emoticonsOverview(); + } + + /* Can't remove the default set */ + if( $this->request['id'] == 'default' ) + { + $this->registry->output->global_message = $this->lang->words['emo_norename']; + $this->emoticonsOverview(); + return; + } + + /* Remove the directory */ + $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . '/classFileManagement.php', 'classFileManagement' ); + $fileManagement = new $classToLoad(); + $fileManagement->removeDirectory( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $this->request['id'] ); + + /* Remove the database entry */ + $this->DB->delete( 'emoticons', "emo_set='{$this->request['id']}'" ); + + /* Rebuild cache */ + $this->emoticonsRebuildCache(); + + /* Bounce */ + $this->registry->output->global_message = $this->lang->words['emo_folder_rem']; + $this->emoticonsOverview(); + } + + /** + * Add/Edit an emoticon folder name + * + * @param string Type (add or edit) + * @return @e void + */ + public function emoticonsSetAlter( $type='add' ) + { + /* Get the name */ + $name = preg_replace( '/[^a-zA-Z0-9\-_]/', "", $this->request['emoset'] ); + + /* Check th ename */ + if( $name == "" ) + { + $this->registry->output->global_message = $this->lang->words['emo_a_to_z']; + return $this->emoticonsOverview(); + } + + /* Check Safe Mode */ + if( SAFE_MODE_ON ) + { + $this->registry->output->global_message = $this->lang->words['emo_safemode']; + return $this->emoticonsOverview(); + } + + /* Check to see if the directory already exists */ + if( file_exists( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $name ) ) + { + $this->registry->output->global_message = sprintf( $this->lang->words['emo_already'], $name ); + return $this->emoticonsOverview(); + } + + if( $type == 'add' ) + { + /* Create the directory */ + if( @mkdir( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $name, IPS_FOLDER_PERMISSION ) ) + { + @chmod( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $name, IPS_FOLDER_PERMISSION ); + @file_put_contents( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $name . '/index.html', '' ); + + /* Copy default emoticons */ + try + { + foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/default/' ) as $file ) + { + if( ! $file->isDot() ) + { + @copy( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/default/' . $file->getFilename(), DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $name . '/' . $file->getFilename() ); + @chmod( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $name . '/' . $file->getFilename(), IPS_FILE_PERMISSION ); + } + } + } catch ( Exception $e ) {} + + /* Query the default set */ + $this->DB->build( array( 'select' => '*', 'from' => 'emoticons', 'where' => "emo_set='default'" ) ); + $outer = $this->DB->execute(); + + /* Insert emoticons for the new set */ + while( $r = $this->DB->fetch($outer) ) + { + $this->DB->insert( "emoticons", array( 'clickable' => $r['clickable'], 'typed' => $r['typed'], 'emo_set' => $name, 'image' => $r['image'] ) ); + } + + /* Bounce */ + $this->registry->output->global_message = $this->lang->words['emo_folder_new']; + return $this->emoticonsOverview(); + } + else + { + /* Couldn't create the directory, Bounce */ + $this->registry->output->global_message = $this->lang->words['emo_ftp']; + return $this->emoticonsOverview(); + } + } + /* Edit Folder Name */ + else + { + /* Check the directory ID */ + if ( ! $this->request['id'] ) + { + $this->registry->output->global_message = $this->lang->words['emo_miss_dir']; + $this->emoticonsOverview(); + return; + } + + /* Can't rename the default directory */ + if( $this->request['id'] == 'default' ) + { + $this->registry->output->global_message = $this->lang->words['emo_norename']; + $this->emoticonsOverview(); + return; + } + + /* Rename the directory */ + if ( @rename( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $this->request['id'], DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $name ) ) + { + /* Check to see if the rename worked */ + if ( file_exists( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $name ) ) + { + /* Update all the emoticons */ + $this->DB->update( 'emoticons', array( 'emo_set' => $name ), "emo_set='{$this->request['id']}'" ); + } + + /* Rebuild the cache */ + $this->emoticonsRebuildCache(); + + /* Update skins that are using this set */ + $rebuild_sets = array(); + + /* Querh skin sets */ + $this->DB->build( array( 'select' => 'set_id', 'from' => 'skin_collections', 'where' => "set_emo_dir='{$this->request['id']}'" ) ); + $outer = $this->DB->execute(); + + /* Loop thorugh and update the emoticon folder */ + while( $r = $this->DB->fetch($outer) ) + { + $this->DB->update( 'skin_collections', array( 'set_emo_dir' => $name ), 'set_id=' . $r['set_id'] ); + $rebuild_sets[] = $r['set_id']; + } + + /* Bounce */ + $this->registry->output->global_message = $this->lang->words['emo_folder_name']; + return $this->emoticonsOverview(); + } + else + { + /* Error and bounce */ + $this->registry->output->global_message = $this->lang->words['emo_wecantdoit']; + return $this->emoticonsOverview(); + } + } + } + + /** + * Process edit emoticons forum + * + * @return @e void + */ + public function emoticonsEdit() + { + /* Check ID */ + if( $this->request['id'] == '' ) + { + $this->registry->output->global_error = $this->lang->words['emo_nogid']; + return $this->emoticonsOverview(); + } + + /* Loop through the request and pull out emoticons */ + foreach( $this->request as $key => $value ) + { + /* Check to see if its an emoticon */ + if ( preg_match( '/^emo_id_(\d+)$/', $key, $match ) ) + { + if ( $match[0] ) + { + /* INI */ + $typed = ''; + + /* Format type for default set */ + if( $this->request['id'] == 'default' ) + { + $typed = str_replace( '"', "", $this->request[ 'emo_type_' . $match[1] ] ); + $typed = str_replace( '\', "", $typed ); + } + + /* Check clickable */ + $click = $this->request[ 'emo_click_' . $match[1] ]; + + /* Update the emoticon */ + if ( $match[1] ) + { + if( $typed ) + { + /* Get the original name */ + $orig_typed = $this->DB->buildAndFetch( array( 'select' => 'typed', 'from' => 'emoticons', 'where' => 'id=' . intval( $match[1] ) ) ); + + /* Update to new name */ + $this->DB->update( 'emoticons', array( 'clickable' => intval( $click ), 'typed' => $typed ), 'id=' . intval( $match[1] ) ); + $this->DB->update( 'emoticons', array( 'typed' => $typed ), "typed='" . $this->DB->addSlashes($orig_typed['typed']) . "'" ); + } + else + { + /* Just update clickable */ + $this->DB->update( 'emoticons', array( 'clickable' => intval( $click ) ), 'id=' . intval( $match[1] ) ); + } + } + } + } + } + + /* Recache and bounce */ + $this->emoticonsRebuildCache(); + + $this->registry->output->global_message = $this->lang->words['emo_updated']; + $this->emoticonsManageDirectory(); + } + + /** + * Manage emoticons + * + * @return @e void + */ + public function emoticonsManageDirectory() + { + /* INI */ + $this->request['id'] = trim( $this->request['id'] ); + + /* Get emoticons for this group */ + $emo_db = $this->_getEmoSet( $this->request['id'] ); + $emo_file = array(); + + /* Get emoticons from the directory */ + $emo_file = array(); + $emo_rfile = $this->_emoticonGetGolderContents( $this->request['id'] ); + + foreach( $emo_rfile as $ef ) + { + $emo_file[ $ef ] = $ef; + } + + /* Loop through the database emoticons */ + $poss_names = array(); + $db_rows = array(); + + foreach( $emo_db as $image => $data ) + { + /* Remove this from the file list, it's already added */ + unset( $emo_file[ $data['image'] ] ); + + /* Add image to array */ + $data['image'] = $data['image']; + /* Addd array to output */ + $db_rows[] = $data; + + /* Possible names filter */ + $poss_names[$data['typed']] = $data['typed']; + } + + /* Check for unassigned images in the emoticon directory */ + $file_rows = array(); + + if ( count( $emo_file ) && $this->request['id'] == 'default' ) + { + /* Loop through the unassigned emoticons */ + foreach( $emo_file as $image ) + { + /* INI */ + $_fdata = array(); + + /* Suggest an emoticon name */ + $_fdata['poss_name'] = ':'.preg_replace( '/(.*)(\..+?)$/', "\\1", $image ).':'; + + if ( ! empty($poss_names[ $_fdata['poss_name'] ]) ) + { + $_fdata['poss_name'] = preg_replace( "/:$/", "2:", $_fdata['poss_name'] ); + } + + /* Add the image */ + $_fdata['image'] = $image; + + /* Add to output array */ + $file_rows[] = $_fdata; + } + } + + /* Output */ + + $this->registry->output->extra_nav[] = array( '', $this->lang->words['emo_manage_set'].$this->request['id'] ); + $this->registry->output->html .= $this->html->emoticonsDirectoryManagement( $db_rows, $file_rows); + } + + /** + * Builds the emoticons overview screen + * + * @return @e void + */ + public function emoticonsOverview() + { + /* Check for the emoticon directory */ + if ( ! is_dir( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons' ) ) + { + $this->registry->output->showError( $this->lang->words['emo_nolocate'], 2111 ); + + } + + /* Check the emoticon count */ + $this->DB->build( array( 'select' => 'id, count(id) as count, emo_set', + 'from' => 'emoticons', + 'group' => 'emo_set, id', + 'order' => 'emo_set' + ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $emo_db[ $r['emo_set'] ] = $r; + } + + /* Get emoticon folders */ + $emodirs = array( 0 => ''); + + try + { + foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons' ) as $_emoticon ) + { + if ( $_emoticon->isDir() AND ! $_emoticon->isDot() AND $_emoticon->getFilename() != '.svn' ) + { + if ( is_dir( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $_emoticon ) ) + { + if( $_emoticon->getFilename() == 'default' ) + { + $emodirs[0] = $_emoticon->getFilename(); + } + else + { + $emodirs[] = $_emoticon->getFilename(); + } + } + } + } + } catch ( Exception $e ) {} + + /* Loop through the emoticon directories */ + $rows = array(); + $i = 0; + $total = count($emodirs); + + foreach( $emodirs as $dir ) + { + $i++; + + $data = array(); + + $files = $this->_emoticonGetGolderContents( $dir ); + $data['count'] = intval( count($files) ); + + if( $dir == 'default' ) + { + $data['line_image'] = ''; + $data['link_text'] = $this->lang->words['emo_manageemos']; + } + else + { + $data['link_text'] = $this->lang->words['emo_setclickable']; + + if( $i == $total ) + { + $data['line_image'] = " "; + } + else + { + $data['line_image'] = " "; + } + } + + if ( is_writeable( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $dir ) ) + { + if( $dir == 'default' ) + { + $checked_def = "checked='checked' disabled='disabled' "; + } + else + { + $checked_def = ""; + } + + $data['icon'] = 'writable.png'; + $data['title'] = $this->lang->words['emo_writeable']; + $data['checkbox'] = ""; + } + else + { + $data['icon'] = 'unwritable.png'; + $data['title'] = $this->lang->words['emo_writeable_not']; + $data['checkbox'] = "-"; + } + + $data['dir'] = $dir; + $data['dir_count'] = intval( $emo_db[ $dir ]['count'] ); + + $rows[] = $data; + } + + $this->registry->output->html .= $this->html->emoticonsOverview( $rows ); + } + + /** + * Rebuilds the emoticon cache + * + * @return @e void + */ + public function emoticonsRebuildCache() + { + $cache = array(); + + $this->DB->build( array( 'select' => 'typed,image,clickable,emo_set', 'from' => 'emoticons', 'order' => 'emo_position asc' ) ); + $c = $this->DB->execute(); + + while ( $r = $this->DB->fetch( $c ) ) + { + $cache[] = $r; + } + + ipsRegistry::cache()->setCache( 'emoticons', $cache, array( 'array' => 1 ) ); + } + + /** + * Fetch next position + * @param string Emo set ID (default) + * + */ + protected function _getNextPosition( $set ) + { + $res = $this->DB->buildAndFetch( array( 'select' => 'MAX(emo_position) as max', + 'from' => 'emoticons', + 'where' => "emo_set='" . $this->DB->addSlashes( $set ) . "'" ) ); + + return intval( $res['max'] ) + 1; + } + + /** + * Fetch possible name + * @param string Image name (smile.gif) + * @param string Emo set ID (default) + * + */ + protected function _getNameFromImg( $img, $set ) + { + $emos = $this->_getEmoSet( $set ); + $name = ':' . preg_replace( '/(.*)(\..+?)$/', "\\1", $img ).':'; + + /* Ensure we're not doubling up */ + foreach( $emos as $im => $data ) + { + if ( $name == $data['typed'] ) + { + $name = preg_replace( "/:$/", "2:", $name ); + break; + } + } + + return $name; + } + + /** + * Get all emos in a set + * @param string Emo set ID (default) + */ + protected function _getEmoSet( $set ) + { + if ( ! is_array( $this->setCache[ $set ] ) OR ! count( $this->setCache[ $set ] ) ) + { + $this->setCache[ $set ] = array(); + + $this->DB->build( array( 'select' => '*', + 'from' => 'emoticons', + 'where' => "emo_set='" . $this->DB->addSlashes( $set ) . "'", + 'order' => 'emo_position ASC' ) ); + $this->DB->execute(); + + /* Loop through the emoticons */ + while( $r = $this->DB->fetch() ) + { + $this->setCache[ $set ][ $r['emo_position'] . '.' . rand(0, 10000 ) ] = $r; + } + + ksort( $this->setCache[ $set ] ); + } + + return $this->setCache[ $set ]; + } + + /** + * Custom sort operation + * + * @param string A + * @param string B + * @return integer + */ + protected static function _thisUsort($a, $b) + { + if ( strlen($a['typed']) == strlen($b['typed']) ) + { + return 0; + } + + return ( strlen($a['typed']) > strlen($b['typed']) ) ? -1 : 1; + } + + /** + * Gets all the emoticons from the specified directory + * + * @param string $folder Emoticon folder to pull emoticons from + * @return array + */ + protected function _emoticonGetGolderContents( $folder='default' ) + { + $files = array(); + + /* Loop through the emoticon directory */ + try + { + foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_emoticons/' . $folder ) as $_emo ) + { + if( $_emo->isFile() && ! $_emo->isDot() ) + { + if ( preg_match( '/\.(?:gif|jpg|jpeg|png|swf)$/i', $_emo->getFilename() ) ) + { + $files[] = $_emo->getFilename(); + } + } + } + } catch ( Exception $e ) {} + + return $files; + } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/posts/index.html b/upload/admin/applications/core/modules_admin/posts/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/posts/index.html +++ b/upload/admin/applications/core/modules_admin/posts/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/posts/media.php b/upload/admin/applications/core/modules_admin/posts/media.php index f1dfc894..d4aa0c44 100644 --- a/upload/admin/applications/core/modules_admin/posts/media.php +++ b/upload/admin/applications/core/modules_admin/posts/media.php @@ -2,7 +2,7 @@ /** *
  * Invision Power Services
- * IP.Board v3.4.5
+ * IP.Board v3.4.6
  * BBCode Media Tag Management
  * Last Updated: $LastChangedDate: 2012-05-22 13:10:11 -0400 (Tue, 22 May 2012) $
  * 
diff --git a/upload/admin/applications/core/modules_admin/posts/xml/index.html b/upload/admin/applications/core/modules_admin/posts/xml/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/posts/xml/index.html +++ b/upload/admin/applications/core/modules_admin/posts/xml/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/posts/xml/menu.xml b/upload/admin/applications/core/modules_admin/posts/xml/menu.xml index 8be530ab..4a6b1e8e 100644 --- a/upload/admin/applications/core/modules_admin/posts/xml/menu.xml +++ b/upload/admin/applications/core/modules_admin/posts/xml/menu.xml @@ -2,10 +2,10 @@ - Управление Смайликами + Emoticon Management - Управление Смайликами + Emoticon Management emoticons emoticons do=overview @@ -15,10 +15,10 @@ - Управление BB-кодами + BBCode Management - Управление BB-кодами + BBCode Management bbcode bbcode do=overview @@ -28,10 +28,10 @@ - Управление Media-тагами + Manage Media Tag - Управление Media-тагами + Manage Media Tag mediatag media do=overview @@ -41,10 +41,10 @@ - Фильтр Нецензурных Слов + Bad Word Filters - Фильтр Нецензурных Слов + Bad Word Filters badwords badwords do=overview @@ -54,10 +54,10 @@ - Расшифровка Сокращений + Acronym Expansion - Расшифровка Сокращений + Acronym Expansion acronyms acronyms diff --git a/upload/admin/applications/core/modules_admin/posts/xml/permissions.xml b/upload/admin/applications/core/modules_admin/posts/xml/permissions.xml index fc2b3b84..5f1d63e8 100644 --- a/upload/admin/applications/core/modules_admin/posts/xml/permissions.xml +++ b/upload/admin/applications/core/modules_admin/posts/xml/permissions.xml @@ -1,76 +1,76 @@ - Управление нецензурными словами + Manage Badwords core_badwords badword_manage - Может добавлять/изменять? + Can manage badwords? badword_delete - Может удалять? + Can delete badwords? - Смайлики + Emoticons core_emoticons emoticons_manage - Имеет доступ к менеджеру смайликов? + Can access emoticon manager? emoticons_edit - Может изменять смайлики? + Can edit emoticons? emoticons_add - Может добавлять смайлики? + Can add new emoticons? emoticons_delete - Может удалять смайлики? + Can remove emoticons? - BB-коды + BBCode core_bbcode bbcode_manage - Может добавлять/изменять? + Can manage bbcode? bbcode_delete - Может удалять? + Can delete bbcode? - Расшифровка сокращений + Acronym Expansion acronyms acronyms_manage - Может управлять сокращениями? + Can manage acronyms? - Управление Media-тегами + Manage Media core_media media_manage - Может добавлять/изменять? + Can manage media bbcode supported sites? media_delete - Может удалять? + Can remove supported media bbcode sites? diff --git a/upload/admin/applications/core/modules_admin/report/defaultSection.php b/upload/admin/applications/core/modules_admin/report/defaultSection.php index 05122579..4f2394cb 100644 --- a/upload/admin/applications/core/modules_admin/report/defaultSection.php +++ b/upload/admin/applications/core/modules_admin/report/defaultSection.php @@ -7,7 +7,7 @@ * $Author: ips_terabyte $ * @since 20th February 2002 * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 8655 $ */ diff --git a/upload/admin/applications/core/modules_admin/report/index.html b/upload/admin/applications/core/modules_admin/report/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/report/index.html +++ b/upload/admin/applications/core/modules_admin/report/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/report/reports.php b/upload/admin/applications/core/modules_admin/report/reports.php index 444f60b4..568f6da6 100644 --- a/upload/admin/applications/core/modules_admin/report/reports.php +++ b/upload/admin/applications/core/modules_admin/report/reports.php @@ -8,7 +8,7 @@ * @author Based on original "Report Center" by Luke Scott * @since - * $LastChangedDate: 2013-02-14 19:17:38 -0500 (Thu, 14 Feb 2013) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 11992 $ */ diff --git a/upload/admin/applications/core/modules_admin/report/xml/index.html b/upload/admin/applications/core/modules_admin/report/xml/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/report/xml/index.html +++ b/upload/admin/applications/core/modules_admin/report/xml/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/report/xml/menu.xml b/upload/admin/applications/core/modules_admin/report/xml/menu.xml index d96e9d96..b87a4c7b 100644 --- a/upload/admin/applications/core/modules_admin/report/xml/menu.xml +++ b/upload/admin/applications/core/modules_admin/report/xml/menu.xml @@ -2,10 +2,10 @@ - Управление Плагинами + Plugin Manager - Управление Плагинами + Plugin Manager reports_plugin reports do=plugin @@ -15,10 +15,10 @@ - Статус и Приоритеты Жалоб + Status & Severity Levels - Статус и Приоритеты Жалоб + Status & Severity Levels reports_ssl reports do=status diff --git a/upload/admin/applications/core/modules_admin/report/xml/permissions.xml b/upload/admin/applications/core/modules_admin/report/xml/permissions.xml index 2cb2af5a..13c7f749 100644 --- a/upload/admin/applications/core/modules_admin/report/xml/permissions.xml +++ b/upload/admin/applications/core/modules_admin/report/xml/permissions.xml @@ -1,30 +1,30 @@ - Плагины системы жалоб + Report Center Plugins core_reports plugins_manage - Может добавлять/изменять плагины? + Can add/edit supported reported content plugins? plugins_remove - Может удалять плагины? + Can remove reported content plugins? - Управление статусами жалоб + Report Center Status and Severity Management core_statsev sands_manage - Может добавлять/изменять статусы жалоб? + Can add/edit report center status and severity levels? sands_remove - Может удалять статусы? + Can remove status and severity levels? diff --git a/upload/admin/applications/core/modules_admin/seo/xml/menu.xml b/upload/admin/applications/core/modules_admin/seo/xml/menu.xml index 895f8318..fa5fcf9b 100644 --- a/upload/admin/applications/core/modules_admin/seo/xml/menu.xml +++ b/upload/admin/applications/core/modules_admin/seo/xml/menu.xml @@ -2,10 +2,10 @@ - SEO-поддержка + SEO Advice - SEO-поддержка + SEO Advice seo_advice advice @@ -15,10 +15,10 @@ - Активность Поисковых Машин + Search Activity - Активность Поисковых Машин + Search Activity seo_dashboard activity diff --git a/upload/admin/applications/core/modules_admin/seo/xml/permissions.xml b/upload/admin/applications/core/modules_admin/seo/xml/permissions.xml index 353625a3..5b860df9 100644 --- a/upload/admin/applications/core/modules_admin/seo/xml/permissions.xml +++ b/upload/admin/applications/core/modules_admin/seo/xml/permissions.xml @@ -6,11 +6,11 @@ seo_advice - Может просматривать SEO-поддержку? + Can view SEO advice? seo_activity - Может просматривать SEO-активность? + Can view SEO activity? diff --git a/upload/admin/applications/core/modules_admin/settings/defaultSection.php b/upload/admin/applications/core/modules_admin/settings/defaultSection.php index bef69d2d..93d38e56 100644 --- a/upload/admin/applications/core/modules_admin/settings/defaultSection.php +++ b/upload/admin/applications/core/modules_admin/settings/defaultSection.php @@ -7,7 +7,7 @@ * $Author: ips_terabyte $ * @since 20th February 2002 * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 8655 $ */ diff --git a/upload/admin/applications/core/modules_admin/settings/index.html b/upload/admin/applications/core/modules_admin/settings/index.html index 5e5606e3..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/settings/index.html +++ b/upload/admin/applications/core/modules_admin/settings/index.html @@ -5,6 +5,6 @@
You have reached this page in error, please use your back button to return to the forum.
-IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/settings/settings.php b/upload/admin/applications/core/modules_admin/settings/settings.php index 22ac6753..7830db38 100644 --- a/upload/admin/applications/core/modules_admin/settings/settings.php +++ b/upload/admin/applications/core/modules_admin/settings/settings.php @@ -1,2106 +1,2106 @@ -Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; - exit(); -} - -class admin_core_settings_settings extends ipsCommand -{ - /** - * Key array - * - * @var array Array of keys - */ - protected $key_array = array(); - - /** - * Setting groups array - * - * @var array Array of setting groups - */ - protected $setting_groups = array(); - - /** - * Setting groups array mapping - * - * @var array Array of setting groups - */ - protected $setting_groups_by_key = array(); - - /** - * Skin object - * This is public so that the portal can access it - * - * @var object Skin templates - */ - public $html; - - /** - * Form code - * This is public so that the portal can access it - * - * @var string Form code - */ - public $form_code; - - /** - * Form code - * This is public so that the portal can access it - * - * @var string JS Form code - */ - public $form_code_js; - - /** - * Application to use - * - * @var string Application - */ - protected $_app; - - /** - * Where to return to after save - * - * @var string URL to go to - */ - public $return_after_save; - - /** - * Breadcrumb url to use in place of the default - * - * @var string - */ - public $base_nav_url; - - /** - * Object for the editor shortcut - * - * @var $editor - */ - public $editor = NULL; - - /** - * Class entry point - * - * @param object Registry reference - * @return @e void [Outputs to screen] - */ - public function doExecute( ipsRegistry $registry ) - { - //----------------------------------------- - // Load language - //----------------------------------------- - - $this->registry->class_localization->loadLanguageFile( array( 'admin_tools' ) ); - - $this->html = $this->registry->output->loadTemplate('cp_skin_settings'); - - $this->form_code = $this->html->form_code = 'module=settings&section=settings&'; - $this->form_code_js = $this->html->form_code_js = 'module=settings§ion=settings&'; - - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'settings_manage' ); - - /* What to do? */ - switch( $this->request['do'] ) - { - case 'settinggroup_resync': - $this->_resynchSettingGroup(); - break; - - case 'settinggroup_delete': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'settings_delete' ); - $this->_deleteSettingGroup(); - break; - - case 'settinggroup_new': - $this->_settingGroupForm('add'); - break; - - case 'settinggroup_showedit': - $this->_settingGroupForm('edit'); - break; - - case 'settinggroup_add': - $this->_settingGroupSave('add'); - break; - - case 'settinggroup_edit': - $this->_settingGroupSave('edit'); - break; - - case 'settingnew': - $this->_settingForm('add'); - break; - - case 'setting_showedit': - $this->_settingForm('edit'); - break; - - case 'setting_add': - $this->_settingSave('add'); - break; - - case 'setting_edit': - $this->_settingSave('edit'); - break; - - case 'reorder': - $this->reorder(); - break; - - case 'setting_view': - $this->_viewSettings(); - break; - - case 'setting_delete': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'settings_delete' ); - $this->_deleteSettings(); - break; - - case 'setting_revert': - $this->_revertSettings(); - break; - - case 'setting_update': - $this->_updateSettings(); - break; - - case 'findsetting': - $this->_findSettingGroup(); - break; - - case 'settings_do_import': - $this->importAllSettings(); - break; - case 'settings_do_import_indev': - $this->importAllSettings(1); - break; - - case 'MOD_export_setting': - $this->_exportSettingsGroup(); - break; - - case 'settingsExportApps': - $messages = $this->exportAllApps(); - - $this->registry->output->setMessage( implode( "
", $messages ), 1 ); - $this->_settingsOverview(); - break; - - case 'settingsImportApps': - $messages = $this->importAllApps(); - - $this->registry->output->setMessage( implode( "
", $messages ), 1 ); - $this->_settingsOverview(); - break; - default: - $this->request['do'] = 'settingsview'; - $this->_settingsOverview(); - break; - } - - //----------------------------------------- - // Pass to CP output hander - //----------------------------------------- - - $this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper(); - $this->registry->output->sendOutput(); - } - - /** - * Reorder the settings - * - * @return @e void - */ - public function reorder() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classAjax.php', 'classAjax' ); - $ajax = new $classToLoad(); - - //----------------------------------------- - // Checks... - //----------------------------------------- - - if( $this->registry->adminFunctions->checkSecurityKey( $this->request['md5check'], true ) === false ) - { - $ajax->returnString( $this->lang->words['postform_badmd5'] ); - exit(); - } - - //----------------------------------------- - // Save new position - //----------------------------------------- - - $position = 1; - - if( is_array($this->request['settings']) AND count($this->request['settings']) ) - { - foreach( $this->request['settings'] as $this_id ) - { - $this->DB->update( 'core_sys_conf_settings', array( 'conf_position' => $position ), 'conf_id=' . $this_id ); - - $position++; - } - } - - $ajax->returnString( 'OK' ); - exit(); - } - - /** - * Setting group export - * - * @return @e void - */ - protected function _exportSettingsGroup() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $this->request[ 'conf_group'] = intval($this->request['conf_group'] ); - - /* Got anything? */ - if ( ! $this->request['conf_group'] ) - { - return; - } - - //----------------------------------------- - // Get setting groups - //----------------------------------------- - - $this->_settingsGetGroups( true ); - - //----------------------------------------- - // Get xml class - //----------------------------------------- - - require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ - - $xml = new classXML( IPS_DOC_CHAR_SET ); - - $xml->newXMLDocument(); - $xml->addElement( 'settingexport' ); - $xml->addElement( 'settinggroup', 'settingexport' ); - - foreach( $this->setting_groups as $i => $roar ) - { - //----------------------------------------- - // App check? - //----------------------------------------- - - if ( $this->request['conf_group'] != $roar['conf_title_id'] ) - { - continue; - } - - //----------------------------------------- - // First, add in setting group title - //----------------------------------------- - - $thisconf = array( 'conf_is_title' => 1, - 'conf_title_keyword' => $roar['conf_title_keyword'], - 'conf_title_title' => $roar['conf_title_title'], - 'conf_title_desc' => $roar['conf_title_desc'], - 'conf_title_tab' => $roar['conf_title_tab'], - 'conf_title_app' => $roar['conf_title_app'] ? $roar['conf_title_app'] : 'core', - 'conf_title_noshow' => $roar['conf_title_noshow'] ); - - $xml->addElementAsRecord( 'settinggroup', 'setting', $thisconf ); - - //----------------------------------------- - // Get settings... - //----------------------------------------- - - $this->DB->build( array( 'select' => '*', - 'from' => 'core_sys_conf_settings', - 'where' => "conf_group='{$roar['conf_title_id']}'", - 'order' => 'conf_position, conf_title' ) ); - - $this->DB->execute(); - - while ( $r = $this->DB->fetch() ) - { - //----------------------------------------- - // Clean up... - //----------------------------------------- - - unset( $r['conf_value'], $r['conf_id'] ); - - $r['conf_title_keyword'] = $roar['conf_title_keyword']; - $r['conf_is_title'] = 0; - - $xml->addElementAsRecord( 'settinggroup', 'setting', $r ); - } - } - - //----------------------------------------- - // Grab the XML document - //----------------------------------------- - - $xmlData = $xml->fetchDocument(); - - $this->registry->output->showDownload( $xmlData, 'settingGroup_' . IPSText::makeSeoTitle( $thisconf['conf_title_title'] ) . '.xml', '', 0 ); - } - - /** - * Find setting group (don't rely on IDs) - * - * @return @e void - */ - public function _findSettingGroup() - { - if ( ! $this->request['key'] ) - { - $this->_settingsOverview(); - } - - $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_settings_titles' ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - if( ( $r['conf_title_keyword'] == $this->request['key'] ) OR mb_strtolower( str_replace( " ", "", trim( $r['conf_title_title'] ) ) ) == urldecode( trim( $this->request['key'] ) ) ) - { - $this->registry->output->silentRedirect( $this->settings['base_url'] . '&' . $this->form_code . '&do=setting_view&conf_group=' . $r['conf_title_id'] ); - break; - } - } - - $this->_settingsOverview(); - } - - /** - * Import all settings - * - * @param boolean In development mode? - * @param boolean Return (ignore the var name) - * @param array Array of known setting values - * @return @e void - */ - public function importAllSettings( $in_dev=0, $no_return=0, $known=array() ) - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $updated = 0; - $inserted = 0; - $need_update = array(); - - //----------------------------------------- - // Make sure we have titles - //----------------------------------------- - - $this->_settingsTitlesCheck(); - - //----------------------------------------- - // INDEV? - //----------------------------------------- - - if ( $in_dev ) - { - $_FILES['FILE_UPLOAD']['name'] = ''; - $this->request['file_location'] = IPSLib::getAppDir( $this->request['app_dir'] ) . '/xml/' . $this->request['app_dir'] . '_settings.xml'; - } - else - { - $this->request['file_location'] = IPS_ROOT_PATH . $this->request['file_location'] ; - } - - //----------------------------------------- - // Go for it - //----------------------------------------- - - if ( $_FILES['FILE_UPLOAD']['name'] == "" or ! $_FILES['FILE_UPLOAD']['name'] or ($_FILES['FILE_UPLOAD']['name'] == "none") ) - { - //----------------------------------------- - // check and load from server - //----------------------------------------- - - if ( ! $this->request['file_location'] ) - { - $this->registry->output->global_message = $this->lang->words['s_nofile']; - $this->_settingsOverview(); - return; - } - - if ( ! is_file( $this->request['file_location'] ) ) - { - $this->registry->output->global_message = sprintf( $this->lang->words['s_noopen'], $this->request['file_location'] ); - $this->_settingsOverview(); - return; - } - - if ( preg_match( '#\.gz$#', $this->request['file_location'] ) ) - { - if ( $FH = @gzopen( $this->request['file_location'], 'rb' ) ) - { - while ( ! @gzeof( $FH ) ) - { - $content .= @gzread( $FH, 1024 ); - } - - @gzclose( $FH ); - } - } - else - { - if ( $FH = @fopen( $this->request['file_location'], 'rb' ) ) - { - $content = @fread( $FH, filesize($this->request['file_location']) ); - @fclose( $FH ); - } - } - } - else - { - //----------------------------------------- - // Get uploaded schtuff - //----------------------------------------- - - $tmp_name = $_FILES['FILE_UPLOAD']['name']; - $tmp_name = preg_replace( '#\.gz$#', "", $tmp_name ); - - try - { - $content = ipsRegistry::getClass('adminFunctions')->importXml( $tmp_name ); - } - catch ( Exception $e ) - { - $this->registry->output->showError( $e->getMessage() ); - } - } - - if ( ! $content ) - { - $this->registry->output->global_message = $this->lang->words['s_nofile']; - $this->_settingsOverview(); - return; - } - - $return = $this->_importXML( $content, $this->request['app_dir'], $known ); - - if ( $no_return ) - { - $this->registry->output->global_message = sprintf( $this->lang->words['s_upandin'], $return['updatedCount'], $return['insertedCount'] ); - return TRUE; - } - else - { - $this->registry->output->global_message = sprintf( $this->lang->words['s_upandin'], $return['updatedCount'], $return['insertedCount'] ); - $this->_settingsOverview(); - return; - } - } - - /** - * Delete a setting group - * - * @return @e void - */ - protected function _deleteSettingGroup() - { - if ( $this->request['id'] ) - { - $conf = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'core_sys_conf_settings', 'where' => 'conf_group=' . $this->request['id'] ) ); - - $count = intval($conf['count']); - - if ( $count > 0 ) - { - $this->registry->output->global_message = $this->lang->words['s_cantremove']; - } - else - { - $this->DB->delete( 'core_sys_settings_titles', 'conf_title_id=' . $this->request['id'] ); - - $this->registry->output->global_message = $this->lang->words['s_removed']; - } - - } - - $this->settingsRebuildCache(); - - $this->_settingsOverview(); - } - - /** - * Resynchronize settings in a group - * - * @return @e void - */ - protected function _resynchSettingGroup() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $this->request['id'] = intval( $this->request['id'] ); - - //----------------------------------------- - // Doit... - //----------------------------------------- - - $this->_resynchGroup( $this->request['id'] ); - - $this->registry->output->global_message = $this->lang->words['s_recounted']; - - //----------------------------------------- - // Get conf title details - //----------------------------------------- - - $conf_group = $this->DB->buildAndFetch( array( 'select' => 'conf_title_tab', - 'from' => 'core_sys_settings_titles', - 'where' => 'conf_title_id='.$this->request['id'] ) ); - - $this->_settingsOverview( $conf_group['conf_title_tab'] ); - } - - /** - * Does the resync - * - * @param integer Group id - * @return @e void - */ - protected function _resynchGroup( $id ) - { - if ( $id ) - { - $conf = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'core_sys_conf_settings', 'where' => 'conf_group='.$id ) ); - - $count = intval($conf['count']); - - $this->DB->update( 'core_sys_settings_titles', array( 'conf_title_count' => $count ), 'conf_title_id=' . $id ); - } - } - - /** - * Form to add/edit a setting group - * - * @param string [add|edit] - * @return @e void - */ - protected function _settingGroupForm( $type='add' ) - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $conf_title_id = intval( $this->request['id'] ); - $form = array(); - $apps = array( 0 => array( 'core', $this->lang->words['s_global_dd'] ) ); - - //----------------------------------------- - // Build applications drop down - //----------------------------------------- - - foreach( ipsRegistry::$applications as $app_dir => $app_data ) - { - $apps[] = array( $app_dir, $app_data['app_title'] ); - } - - //----------------------------------------- - // Type - //----------------------------------------- - - if ( $type == 'add' ) - { - $formcode = 'settinggroup_add'; - $title = $this->lang->words['s_createnew']; - $button = $this->lang->words['s_createnew']; - } - else - { - $conf = $this->DB->buildAndFetch( array( 'select' => '*', - 'from' => 'core_sys_settings_titles', - 'where' => 'conf_title_id='.$conf_title_id ) ); - - if ( ! $conf['conf_title_id'] ) - { - $this->registry->output->global_message = $this->lang->words['s_noid']; - $this->_settingsOverview(); - } - - $formcode = 'settinggroup_edit'; - $title = sprintf($this->lang->words['s_editsetting'], $conf['conf_title'] ); - $button = $this->lang->words['s_savechanges']; - } - - //----------------------------------------- - // Form elements - //----------------------------------------- - - $form['conf_title_title'] = $this->registry->output->formInput( 'conf_title_title', $_POST['conf_title_title'] ? $_POST['conf_title_title'] : $conf['conf_title_title'] ); - $form['conf_title_desc'] = $this->registry->output->formTextarea( 'conf_title_desc', $_POST['conf_title_desc'] ? $_POST['conf_title_desc'] : $conf['conf_title_desc'] ); - $form['conf_title_app'] = $this->registry->output->formDropdown( 'conf_title_app', $apps, $_POST['conf_title_app'] ? $_POST['conf_title_app'] : $conf['conf_title_app'] ); - $form['conf_title_tab'] = $this->registry->output->formInput( 'conf_title_tab', $_POST['conf_title_tab'] ? $_POST['conf_title_tab'] : $conf['conf_title_tab'] ); - - //if ( IN_DEV ) - //{ - $form['conf_title_keyword'] = $this->registry->output->formInput( 'conf_title_keyword', $_POST['conf_title_keyword'] ? $_POST['conf_title_keyword'] : $conf['conf_title_keyword'] ); - $form['conf_title_noshow'] = $this->registry->output->formYesNo( 'conf_title_noshow', $_POST['conf_title_noshow'] ? $_POST['conf_title_noshow'] : $conf['conf_title_noshow'] ); - //} - - $this->registry->output->html .= $this->html->settings_title_form( $form, $title, $formcode, $button ); - } - - /** - * Save a setting group - * - * @param string [add|edit] - * @return @e void - */ - protected function _settingGroupSave($type='add') - { - //----------------------------------------- - // INIT - //----------------------------------------- - - if ( $type == 'edit' ) - { - if ( ! $this->request['id'] ) - { - $this->registry->output->global_message = $this->lang->words['s_noid']; - $this->_settingForm(); - return; - } - } - - if( ! $this->request['conf_title_title'] ) - { - $this->registry->output->global_message = $this->lang->words['s_notitle']; - $this->_settingGroupForm( $type ); - return; - } - - if( ! $this->request['conf_title_keyword'] ) - { - $this->registry->output->global_message = $this->lang->words['s_nokeyword']; - $this->_settingGroupForm( $type ); - return; - } - - //-------------------------------------------- - // Check... - //-------------------------------------------- - - $array = array( 'conf_title_title' => $this->request['conf_title_title'], - 'conf_title_desc' => IPSText::safeslashes( $_POST['conf_title_desc'] ), - 'conf_title_keyword' => IPSText::safeslashes( $_POST['conf_title_keyword'] ), - 'conf_title_noshow' => $this->request['conf_title_noshow'], - 'conf_title_app' => trim( $this->request['conf_title_app'] ), - 'conf_title_tab' => trim( $this->request['conf_title_tab'] ) - ); - - - if ( $type == 'add' ) - { - $this->DB->insert( 'core_sys_settings_titles', $array ); - $this->registry->output->global_message = $this->lang->words['s_added']; - } - else - { - $this->DB->update( 'core_sys_settings_titles', $array, 'conf_title_id=' . $this->request['id'] ); - $this->registry->output->global_message = $this->lang->words['s_edited']; - } - - $this->settingsRebuildCache(); - - $this->_settingsOverview(); - } - - /** - * Form to add/edit a setting - * - * @param string [add|edit] - * @return @e void - */ - protected function _settingForm( $type='add' ) - { - if ( $type == 'add' ) - { - $formcode = 'setting_add'; - $title = $this->lang->words['s_createnewtitle']; - $button = $this->lang->words['s_createnewtitle']; - $conf = array( 'conf_group' => $this->request['conf_group'], 'conf_add_cache' => 1 ); - - if ( IN_DEV ) - { - $conf['conf_protected'] = 1; - } - - if ( $this->request['conf_group'] ) - { - $max = $this->DB->buildAndFetch( array( 'select' => 'max(conf_position) as max', 'from' => 'core_sys_conf_settings', 'where' => 'conf_group=' . $this->request['conf_group'] ) ); - } - else - { - $max = $this->DB->buildAndFetch( array( 'select' => 'max(conf_position) as max', 'from' => 'core_sys_conf_settings' ) ); - } - - $conf['conf_position'] = $max['max'] + 1; - } - else - { - $conf = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_conf_settings', 'where' => 'conf_id=' . $this->request['id'] ) ); - - if ( ! $conf['conf_id'] ) - { - $this->registry->output->global_message = $this->lang->words['s_noid']; - $this->_settingsOverview(); - } - - $formcode = 'setting_edit'; - $title = sprintf($this->lang->words['s_editsetting'], $conf['conf_title'] ); - $button = $this->lang->words['s_savechanges']; - } - - //----------------------------------------- - // Get groups - //----------------------------------------- - - $this->_settingsGetGroups(); - - $groups = array(); - - foreach( $this->setting_groups as $i => $r ) - { - $groups[] = array( $r['conf_title_id'], $r['conf_title_title'] ); - } - - //----------------------------------------- - // Type - //----------------------------------------- - - $types = array( - array( 'input' , $this->lang->words['s_input'] ), - array( 'dropdown' , $this->lang->words['s_dropdown'] ), - array( 'yes_no' , $this->lang->words['s_yes_no'] ), - array( 'textarea' , $this->lang->words['s_textarea'] ), - array( 'editor' , $this->lang->words['s_editor'] ), - array( 'multi' , $this->lang->words['s_multi'] ), - array( 'name_autocomplete' , $this->lang->words['s_name_autocomplete'] ), - ); - - - - $form['conf_title'] = $this->registry->output->formInput( 'conf_title' , $_POST['conf_title'] ? $_POST['conf_title'] : $conf['conf_title'] ); - $form['conf_position'] = $this->registry->output->formInput( 'conf_position' , $_POST['conf_position'] ? $_POST['conf_position'] : $conf['conf_position'] ); - $form['conf_description'] = $this->registry->output->formTextarea( 'conf_description', $_POST['conf_description'] ? $_POST['conf_description'] : $conf['conf_description'] ); - $form['conf_group'] = $this->registry->output->formDropdown( 'conf_group' , $groups, $_POST['conf_group'] ? $_POST['conf_group'] : $conf['conf_group'] ); - $form['conf_type'] = $this->registry->output->formDropdown( 'conf_type' , $types, $_POST['conf_type'] ? $_POST['conf_type'] : $conf['conf_type'] ); - $form['conf_key'] = $this->registry->output->formInput( 'conf_key' , $_POST['conf_key'] ? $_POST['conf_key'] : $conf['conf_key'] ); - $form['conf_value'] = $this->registry->output->formTextarea( 'conf_value' , $_POST['conf_value'] ? $_POST['conf_value'] : $conf['conf_value'] ); - $form['conf_default'] = $this->registry->output->formTextarea( 'conf_default' , $_POST['conf_default'] ? $_POST['conf_default'] : $conf['conf_default'] ); - $form['conf_extra'] = $this->registry->output->formTextarea( 'conf_extra' , $_POST['conf_extra'] ? $_POST['conf_extra'] : $conf['conf_extra'] ); - $form['conf_evalphp'] = $this->registry->output->formTextarea( 'conf_evalphp' , $_POST['conf_evalphp'] ? $_POST['conf_evalphp'] : $conf['conf_evalphp'] ); - $form['conf_keywords'] = $this->registry->output->formTextarea( 'conf_keywords' , $_POST['conf_keywords'] ? $_POST['conf_keywords'] : $conf['conf_keywords'] ); - $form['conf_start_group'] = $this->registry->output->formInput( 'conf_start_group', $_POST['conf_start_group'] ? $_POST['conf_start_group'] : $conf['conf_start_group'] ); - $form['conf_add_cache'] = $this->registry->output->formYesNo( 'conf_add_cache', $_POST['conf_add_cache'] ? $_POST['conf_add_cache'] : $conf['conf_add_cache'] ); - - if ( IN_DEV ) - { - $form['conf_protected'] = $this->registry->output->formYesNo( 'conf_protected', $_POST['conf_protected'] ? $_POST['conf_protected'] : $conf['conf_protected'] ); - } - - - - //----------------------------------------- - // start form - //----------------------------------------- - - $this->registry->output->html .= $this->html->settings_form( $form, $title, $formcode, $button ); - } - - /** - * View all settings (form) in a group - * This is public so that portal can access it - * - * @return @e void - */ - public function _viewSettings() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $search_key = trim( $this->request['search'] ); - $conf_group = trim( $this->request['conf_group'] ); - $conf_titles = array(); - $last_conf_id = -1; - $start = intval( $this->request['st'] ); - $end = 150; - $get_by_key = isset( $this->request['conf_title_keyword'] ) ? $this->request['conf_title_keyword'] : ''; - - //----------------------------------------- - // Get settings in group - //----------------------------------------- - - $this->_settingsGetGroups( ( $get_by_key ) ? TRUE : FALSE ); - - //----------------------------------------- - // Grabbing by key? - //----------------------------------------- - - if( $get_by_key ) - { - $data = $this->DB->buildAndFetch( array( - 'select' => 'conf_title_id, conf_title_keyword, conf_title_title', - 'from' => 'core_sys_settings_titles', - 'where' => "conf_title_keyword='{$get_by_key}'" - ) ); - - $this->request['conf_group'] = $data['conf_title_id'] ; - $conf_group = $data['conf_title_id']; - $this->request['groupHelpKey'] = $data['conf_title_keyword']; - } - - //----------------------------------------- - // check... - //----------------------------------------- - - if( !$conf_group and !$search_key ) - { - $this->registry->output->global_message = $this->lang->words['s_nogroup']; - $this->_settingsOverview(); - return; - } - - //-------------------------------------- - // Redirect to Nexus for ads - //-------------------------------------- - - if ( $this->setting_groups[ $conf_group ]['conf_title_keyword'] == 'adcodeintegration' and IPSLib::appIsInstalled('nexus') ) - { - $this->registry->output->silentRedirect( $this->settings['base_url'] . 'app=nexus&module=promotion§ion=advertisements' ); - } - - //----------------------------------------- - // Pagination - //----------------------------------------- - - $pages = $this->registry->output->generatePagination( array( - 'totalItems' => $this->setting_groups[$conf_group]['conf_title_count'], - 'itemsPerPage' => $end, - 'currentStartValue' => $start, - 'baseUrl' => $this->settings['base_url'] . "&{$this->form_code}&&search={$search_key}", - ) ); - - - //----------------------------------------- - // Did we search? - //----------------------------------------- - - if( $search_key ) - { - $keywords = mb_strtolower($search_key); - $whereExtra = $conf_group ? " AND c.conf_group={$conf_group}" : ''; - - $this->DB->build( array( - 'select' => 'c.*', - 'from' => array( 'core_sys_conf_settings' => 'c' ), - 'where' => '(' . $this->DB->buildLower('c.conf_title') . " LIKE '%{$keywords}%' OR " . $this->DB->buildLower('c.conf_description') . " LIKE '%{$keywords}%' OR " . $this->DB->buildLower('c.conf_keywords') . " LIKE '%{$keywords}%')" . $whereExtra, - 'order' => 'c.conf_title', - 'limit' => array( $start, $end ), - 'add_join' => array( - array( - 'select' => 'ct.conf_title_id, ct.conf_title_noshow, ct.conf_title_title, ct.conf_title_tab', - 'from' => array( 'core_sys_settings_titles' => 'ct' ), - 'where' => 'ct.conf_title_id=c.conf_group', - 'type' => 'left' - ) - ) - ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $r['conf_start_group'] = ""; - $r['conf_description'] .= '
' . $this->lang->words['conf_desc_search'] . "" . $r['conf_title_title'] . ""; - $conf_entry[ $r['conf_id'] ] = $r; - } - - if( ! count( $conf_entry ) ) - { - $this->registry->output->global_message = sprintf( $this->lang->words['s_nomatches'], $keywords ); - $this->_settingsOverview(); - return; - } - - $title = sprintf( $this->lang->words['s_searchedfor'], $keywords ); - $tab = ''; - } - - //----------------------------------------- - // Or not... - //----------------------------------------- - - else - { - $this->DB->build( array( - 'select' => '*', - 'from' => 'core_sys_conf_settings', - 'where' => "conf_group='{$conf_group}'", - 'order' => 'conf_position, conf_title', - 'limit' => array( $start,$end ) - ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $conf_entry[ $r['conf_id'] ] = $r; - } - - $title = $this->setting_groups[$conf_group]['conf_title_title']; - $tab = IPSText::md5Clean( $this->setting_groups[$conf_group]['conf_title_tab'] ); - $this->request['groupHelpKey'] = $this->setting_groups[ $conf_group ]['conf_title_keyword']; - } - - //----------------------------------------- - // Start output - //----------------------------------------- - - $content = ""; - - if( is_array( $conf_entry ) and count( $conf_entry ) ) - { - foreach( $conf_entry as $id => $r ) - { - $content .= $this->_processSettingEntry( $r ); - } - } - - if( ! $search_key AND ! $get_by_key ) - { - $searchbutton = 1; - } - - if ( ! $this->registry->output->ignoreCoreNav ) // Bug #39467 - { - /* Navigation */ - if( $this->base_nav_url ) - { - $this->registry->output->extra_nav[] = array( $this->base_nav_url, ipsRegistry::$applications[ $this->setting_groups[$conf_group]['conf_title_app'] ]['app_title'] ); - $this->registry->output->extra_nav[] = array( "", $title ); - - } - else if( $tab ) - { - $this->registry->output->extra_nav[] = array( "{$this->settings['base_url']}{$this->form_code}&_dtab={$tab}", $this->setting_groups[$conf_group]['conf_title_tab'] ? $this->setting_groups[$conf_group]['conf_title_tab'] : ipsRegistry::$applications[ $this->setting_groups[$conf_group]['conf_title_app'] ]['app_title'] ); - $this->registry->output->extra_nav[] = array( "{$this->settings['base_url']}{$this->form_code}&do=setting_view&conf_group={$conf_group}", $title ); - } - else - { - $this->registry->output->extra_nav[] = array( "{$this->settings['base_url']}{$this->form_code}&_dtab=System", $this->setting_groups[$conf_group]['conf_title_tab'] ? $this->setting_groups[$conf_group]['conf_title_tab'] : ipsRegistry::$applications[ $this->setting_groups[$conf_group]['conf_title_app'] ]['app_title'] ); - $this->registry->output->extra_nav[] = array( "{$this->settings['base_url']}{$this->form_code}&do=setting_view&conf_group={$conf_group}", $title ); - } - } - - /* Output */ - $this->registry->output->html .= $this->html->settings_view_wrapper( $title, $content, $searchbutton, $this->return_after_save ); - $this->registry->output->html = str_replace( '', "", $this->registry->output->html ); - } - - /** - * Process an individual setting for display - * - * @param array Setting record - * @return @e void - */ - public function _processSettingEntry($r) - { - /* Init editor class */ - if ( !is_object($this->editor) ) - { - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' ); - $this->editor = new $classToLoad(); - } - - /* Init vars */ - $tempSkinUrl = $this->settings['skin_app_url']; - $this->settings['skin_app_url'] = $this->settings['_original_base_url'] . '/' . CP_DIRECTORY . '/applications/core/skin_cp/' ; - $form_element = ""; - $form_type = 'normal'; - $dropdown = array(); - $start = ""; - $revert_button = ""; - - $key = $r['conf_key']; - $value = $r['conf_value'] != "" ? $r['conf_value'] : $r['conf_default']; - $value = $value == "{blank}" ? '' : $value; - - $show = 1; - - //----------------------------------------------- - // Default? - //----------------------------------------------- - - $css = ""; - - if ( $r['conf_value'] != "" and ( $r['conf_value'] != $r['conf_default'] ) ) - { - $revert_button = "
  • form_code}&do=setting_revert&id={$r['conf_id']}&conf_group={$r['conf_group']}&search=" . $this->request['search'] . "' title='{$this->lang->words['s_revertback']}'>{$this->lang->words['revert']}
  • "; - } - - //----------------------------------------------- - // Evil eval - //----------------------------------------------- - - if ( $r['conf_evalphp'] ) - { - - $r['conf_evalphp'] = str_replace( '\', '\\', $r['conf_evalphp'] ); - $show = 1; - - eval( $r['conf_evalphp'] ); - } - - if( ! $show && ! IN_DEV ) - { - return ''; - } - - switch( $r['conf_type'] ) - { - case 'input': - $form_element = $this->registry->output->formInput( $key, str_replace( "'", "'", $value ) ); - break; - - case 'textarea': - $form_element = $this->registry->output->formTextarea( $key, str_replace( "&#092;", "\", IPSText::textToForm($value) ), 45 ); - break; - - case 'editor': - //$this->editor->setIsHtml( true ); - $this->editor->setContent( $value ); - - $form_element = $this->editor->show( $key, array( 'minimize' => 1 ) ); - $form_type = 'rte'; - - break; - - case 'yes_no': - $form_element = $this->registry->output->formYesNo( $key, $value ); - break; - - case 'name_autocomplete': - $form_element = $this->html->nameAutoCompleteField( $key, $value ); - break; - - default: - - if ( $r['conf_extra'] ) - { - if ( $r['conf_extra'] == '#show_forums#' ) - { - //----------------------------------------- - // Require the library - // (Not a building with books) - //----------------------------------------- - - require_once( IPSLib::getAppDir( 'forums' ) .'/sources/classes/forums/class_forums.php' );/*noLibHook*/ - $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) .'/sources/classes/forums/admin_forum_functions.php', 'admin_forum_functions', 'forums' ); - - $aff = new $classToLoad( $this->registry ); - $aff->forumsInit(); - $dropdown = $aff->adForumsForumList(1); - } - else if ( $r['conf_extra'] == '#show_groups#' ) - { - $this->DB->build( array( 'select' => '*', 'from' => 'groups', 'order' => 'g_title ASC' ) ); - $this->DB->execute(); - - while( $row = $this->DB->fetch() ) - { - if ( $row['g_access_cp'] ) - { - $row['g_title'] .= ' ' . $this->lang->words['setting_staff_tag'] . ' '; - } - - $dropdown[] = array( $row['g_id'], $row['g_title'] ); - } - } - else if ( $r['conf_extra'] == '#show_applications#' ) - { - foreach( ipsRegistry::$applications as $app ) - { - $dropdown[] = array( $app['app_directory'], $app['app_title'] ); - } - } - else if ( $r['conf_extra'] == '#show_skins#' ) - { - $dropdown = $this->registry->output->generateSkinDropdown(); - } - else - { - foreach( explode( "\n", $r['conf_extra'] ) as $l ) - { - list ($k, $v) = explode( "=", $l ); - if ( $k != "" and $v != "" ) - { - $dropdown[] = array( trim($k), trim($v) ); - } - } - } - } - - if ( $r['conf_type'] == 'dropdown' ) - { - $form_element = $this->registry->output->formDropdown( $key, $dropdown, $value ); - } - else - { - $form_element = $this->registry->output->formMultiDropdown( $key, $dropdown, explode( ",", $value ) ); - } - - break; - } - - $delete = "
  • form_code}&do=setting_delete&id={$r['conf_id']}\");' title='key: {$r['conf_key']}'>{$this->lang->words['delete']}
  • "; - $edit = "
  • form_code}&do=setting_showedit&id={$r['conf_id']}' title='id: {$r['conf_id']}'>{$this->lang->words['edit']}
  • "; - - if ( $r['conf_protected'] and ! IN_DEV ) - { - $delete = ""; - $edit = ""; - } - - if ( $r['conf_start_group'] ) - { - $start = $this->html->settings_row_start_group( $r ); - } - - $r['conf_description'] = str_replace( '{ACP_URL}', $this->settings['_base_url'], $r['conf_description'] ); - - //----------------------------------------------- - // Search hi-lite - //----------------------------------------------- - - if ( $this->request['search'] ) - { - $_replacements = array(); - - preg_match_all( "/(&([a-zA-Z0-9]+);)/i", $r['conf_title'], $matches ); - - if( count($matches[0]) ) - { - for( $i=0, $cnt=count($matches[0]); $i <= $cnt; $i++ ) - { - $r['conf_title'] = str_replace( $matches[0][$i], '{{{' . $i . '}}}', $r['conf_title'] ); - } - } - - $r['conf_title'] = preg_replace( "/(". str_replace( '/', '\\/', $this->request['search'] ) .")/i", "\\1", $r['conf_title'] ); - - if( count($matches[0]) ) - { - for( $i=0, $cnt=count($matches); $i <= $cnt; $i++ ) - { - $r['conf_title'] = str_replace( '{{{' . $i . '}}}', $matches[0][$i], $r['conf_title'] ); - } - } - - /** - * Ok this is just annoying.... - */ - $_did = 0; - preg_match_all( "/(href=['\"].*?[\"'])/i", $r['conf_description'], $matches ); - - if( count($matches[0]) ) - { - for( $i=$_did, $cnt=count($matches[0]); $i <= $cnt; $i++ ) - { - $r['conf_description'] = str_replace( $matches[0][$i], '{{{' . $i . '}}}', $r['conf_description'] ); - - $_replacements[ $i ] = $matches[0][$i]; - $_did++; - } - } - - preg_match_all( "/(&([a-zA-Z0-9]+);)/i", $r['conf_description'], $matches ); - - if( count($matches[0]) ) - { - for( $i=$_did, $cnt=count($matches[0]); $i <= $cnt; $i++ ) - { - $r['conf_description'] = str_replace( $matches[0][$i], '{{{' . $i . '}}}', $r['conf_description'] ); - - $_replacements[ $i ] = $matches[0][$i]; - $_did++; - } - } - - $r['conf_description'] = preg_replace( "/(". str_replace( '/', '\\/', $this->request['search'] ) .")/i", "\\1", $r['conf_description'] ); - - if( count($_replacements) ) - { - foreach( $_replacements as $index => $val ) - { - $r['conf_description'] = str_replace( '{{{' . $index . '}}}', $val, $r['conf_description'] ); - } - } - } - - $html .= $start . $this->html->settings_view_row( $r, $edit, $delete, $form_element, $revert_button, $form_type ); - - $this->key_array[] = preg_replace( '/\[\]$/', "", $key ); - - $this->settings[ 'skin_app_url'] = $tempSkinUrl ; - - return $html; - } - - /** - * View setting groups - * - * @param string Application to default to - * @return @e void - */ - protected function _settingsOverview( $start_app='' ) - { - $content = ""; - $title = ""; - $settings = array(); - $start_app = ( $start_app ) ? $start_app : trim( $this->request['start_app'] ); - - //----------------------------------------- - // Get the groups - //----------------------------------------- - - $this->_settingsGetGroups(); - - //----------------------------------------- - // Build settings.. - //----------------------------------------- - - foreach( $this->setting_groups as $i => $r ) - { - $r['conf_title_app'] = ( $r['conf_title_app'] ) ? $r['conf_title_app'] : 'core'; - $r['conf_title_tab'] = ( $r['conf_title_tab'] ) ? $r['conf_title_tab'] : 'System'; - $r['conf_title_title'] = ( $r['conf_title_noshow'] ) ? $r['conf_title_title'] . ' ' . $this->lang->words['s_ishidden'] : $r['conf_title_title']; - - $settings[ $r['conf_title_tab'] ][] = $r; - } - - $this->registry->output->html .= $this->html->settings_titles_wrapper( $settings, $start_app ); - } - - /** - * Update setting values/ordering - * - * @param boolean Return afterwards? - * @return @e void - */ - protected function _updateSettings( $donothing="" ) - { - /* Init vars */ - $bounceback = str_replace( '&', '&', $this->request['bounceback'] ); - - /* Check for something to save... */ - if ( ! $this->request['id'] and ! $this->request['search'] AND !$this->request['settings_save'] ) - { - $this->registry->output->global_message = $this->lang->words['s_noid']; - $this->_settingsOverview(); - return; - } - - /* ...and check for fields */ - $fields = explode( ",", trim($this->request['settings_save']) ); - - if ( ! count($fields ) ) - { - $this->registry->output->global_message = $this->lang->words['s_nofields']; - $this->_viewSettings(); - return; - } - - /* Init editor class */ - if ( !is_object($this->editor) ) - { - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' ); - $this->editor = new $classToLoad(); - } - - //-------------------------------------------- - // Update - //-------------------------------------------- - - $update = array(); - foreach ( $fields as $f ) - { - $update[ $f ] = $_POST[ $f ]; - } - - IPSLib::updateSettings( $update, TRUE ); - - $this->request['conf_group'] = $this->request['id']; - $this->registry->output->global_message = $this->lang->words['s_updated']; - - //----------------------------------------- - // We're bouncing back (Boing boing) - //----------------------------------------- - - if ( $bounceback ) - { - $this->registry->output->silentRedirectWithMessage( $bounceback ); - } - - //----------------------------------------- - // Still here? - //----------------------------------------- - - - if ( ! $donothing ) - { - $this->_viewSettings(); - } - } - - /** - * Save the settings form - * - * @param string [add|edit] - * @return @e void - */ - protected function _settingSave($type='add') - { - if ( $type == 'edit' ) - { - if ( ! $this->request['id'] ) - { - $this->registry->output->global_message = $this->lang->words['s_noid']; - $this->_settingForm(); - return; - } - } - - //-------------------------------------------- - // check... - //-------------------------------------------- - - $conf_group = $this->request['conf_newgroup'] ? $this->request['conf_newgroup'] : $this->request['conf_group']; - - $array = array( 'conf_title' => $this->request['conf_title'], - 'conf_description' => IPSText::stripslashes( $_POST['conf_description'] ), - 'conf_group' => $this->request['conf_group'], - 'conf_type' => $this->request['conf_type'], - 'conf_key' => str_replace( '-', '_', IPSText::alphanumericalClean( $this->request['conf_key'] ) ), - 'conf_value' => IPSText::stripslashes( $_POST['conf_value'] ), - 'conf_default' => IPSText::stripslashes( $_POST['conf_default'] ), - 'conf_extra' => IPSText::stripslashes( $_POST['conf_extra'] ), - 'conf_evalphp' => IPSText::stripslashes( $_POST['conf_evalphp'] ), - 'conf_protected' => intval( $this->request['conf_protected'] ), - 'conf_position' => intval( $this->request['conf_position'] ), - 'conf_start_group' => $this->request['conf_start_group'], - 'conf_add_cache' => intval( $this->request['conf_add_cache'] ), - 'conf_keywords' => IPSText::stripslashes( $_POST['conf_keywords'] ), - ); - - //----------------------------------------- - // Do we have a title and key? - //----------------------------------------- - - if( !$array['conf_title'] OR !$array['conf_key'] ) - { - $this->registry->output->global_message = $this->lang->words['s_missing_key_data']; - $this->_settingForm(); - return; - } - - if ( $type == 'add' ) - { - //----------------------------------------- - // Is the key already in use? - //----------------------------------------- - - if ( $this->settings[ $array['conf_key'] ] ) - { - $this->registry->output->global_message = $this->lang->words['s_keyinuse_already']; - $this->_settingForm(); - return; - } - - $this->DB->insert( 'core_sys_conf_settings', $array ); - $this->registry->output->global_message = $this->lang->words['s_added2']; - } - else - { - $conf = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_conf_settings', 'where' => 'conf_id=' . $this->request['id'] ) ); - - $this->DB->update( 'core_sys_conf_settings', $array, 'conf_id=' . $this->request['id'] ); - $this->registry->output->global_message = $this->lang->words['s_edited2']; - - // Recount old group - $this->_resynchGroup( $conf['conf_group'] ); - } - - //----------------------------------------- - // Recount new group - //----------------------------------------- - - if( $this->request['conf_group'] ) - { - $this->_resynchGroup( $this->request['conf_group'] ); - } - - $this->settingsRebuildCache(); - - $this->_viewSettings(); - } - - /** - * Revert a setting to the default value - * - * @return @e void - */ - protected function _revertSettings() - { - $this->request[ 'id'] = intval($this->request['id'] ); - - if ( ! $this->request['id'] ) - { - $this->registry->output->global_message = $this->lang->words['s_noid']; - $this->_settingForm(); - return; - } - - $conf = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_conf_settings', 'where' => 'conf_id=' . $this->request['id'] ) ); - - //-------------------------------------------- - // Revert... - //-------------------------------------------- - - IPSLib::updateSettings( array( $conf['conf_key'] => $conf['conf_default'] ) ); - - $this->registry->output->global_message = $this->lang->words['s_revertedback']; - - $this->settingsRebuildCache(); - - //----------------------------------------- - // Boink - //----------------------------------------- - - $referrer = my_getenv('HTTP_REFERER'); - - if ( strstr( $referrer, $this->settings['_admin_link'] ) and !strstr( $referrer, 'app=core&module=settings§ion=settings' ) ) - { - $this->registry->output->silentRedirect( $referrer ); - return; - } - else - { - $this->_viewSettings(); - } - - } - - /** - * Delete a setting - * - * @return @e void - */ - protected function _deleteSettings() - { - if ( ! $this->request['id'] ) - { - $this->registry->output->global_message = $this->lang->words['s_noid']; - $this->_settingsOverview(); - return; - } - - $conf = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_conf_settings', 'where' => 'conf_id=' . $this->request['id'] ) ); - - if ( ! $conf['conf_id'] ) - { - $this->registry->output->global_message = $this->lang->words['s_noid']; - $this->_settingsOverview(); - return; - } - - //-------------------------------------------- - // Delete... - //-------------------------------------------- - - $this->DB->delete( 'core_sys_conf_settings', 'conf_id=' . $this->request['id'] ); - - $this->DB->update( 'core_sys_settings_titles', 'conf_title_count=conf_title_count-1', 'conf_title_id=' . $conf['conf_group'], false, true ); - - $this->registry->output->global_message = $this->lang->words['s_deleted']; - - $this->settingsRebuildCache(); - - $this->_settingsOverview(); - } - - - /** - * Rebuild settings cache - * - * @return @e void - */ - public function settingsRebuildCache() - { - $settings = array(); - - $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_conf_settings', 'where' => 'conf_add_cache=1' ) ); - $info = $this->DB->execute(); - - while ( $r = $this->DB->fetch($info) ) - { - $value = $r['conf_value'] != "" ? $r['conf_value'] : $r['conf_default']; - - if ( $value == '{blank}' ) - { - $value = ''; - } - - $settings[ $r['conf_key'] ] = $value; - } - - $this->cache->setCache( 'settings', $settings, array( 'array' => 1 ) ); - } - - /** - * Grab all setting groups and store in an internal array - * - * @param boolean Pull all settings, not just visible ones - * @return @e void - */ - protected function _settingsGetGroups( $ignoreInDev=false ) - { - $this->setting_groups = array(); - - if ( IN_DEV OR $ignoreInDev ) - { - $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_settings_titles', 'order' => 'conf_title_title' ) ); - $this->DB->execute(); - } - else - { - $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_settings_titles', 'where' => 'conf_title_noshow=0', 'order' => 'conf_title_title' ) ); - $this->DB->execute(); - } - - while( $r = $this->DB->fetch() ) - { - $this->setting_groups[ $r['conf_title_id'] ] = $r; - $this->setting_groups_by_key[ $r['conf_title_keyword'] ] = $r; - } - } - - /** - * Make sure all titles have keywords set - * - * @return @e void - */ - protected function _settingsTitlesCheck() - { - //----------------------------------------- - // Get 'em - //----------------------------------------- - - $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_settings_titles' ) ); - $outer = $this->DB->execute(); - - while( $row = $this->DB->fetch( $outer ) ) - { - if ( ! $row['conf_title_keyword'] ) - { - $new_keyword = mb_strtolower( preg_replace( '#[^\d\w]#', "", $row['conf_title_title'] ) ); - $this->DB->update( 'core_sys_settings_titles', array( 'conf_title_keyword' => $new_keyword ), 'conf_title_id='.$row['conf_title_id'] ); - } - } - } - - /** - * Import XML Settings on an app by app basis - * - * @return array Array of messages - */ - public function importAllApps() - { - $message = array(); - - foreach( ipsRegistry::$applications as $app_dir => $app_data ) - { - $file = IPSLib::getAppDir( $app_dir ) . '/xml/' . $app_dir . '_settings.xml'; - - if ( is_file( $file ) ) - { - $contents = file_get_contents( $file ); - - $return = $this->_importXML( $contents, $app_dir ); - - $message[] = $app_data['app_title'] . " " . sprintf( $this->lang->words['s_upandin'], $return['updatedCount'], $return['insertedCount'] ); - - /* In dev time stamp? */ - if ( IN_DEV ) - { - $cache = $this->caches['indev']; - $cache['import']['settings'][ $app_dir ] = time(); - $this->cache->setCache( 'indev', $cache, array( 'donow' => 1, 'array' => 1 ) ); - } - } - } - - /* Check for settings not needed anymore */ - $this->_loadDeleteList(); - - return $message; - } - - /** - * Import XML Settings - * - * @param string XML Data - * @param string Application (should be set by XML file, however) - * @param array Array of any known settings and their values - * @return array array( 'insertedCount' => x, 'updatedCount' => x, 'updatedKeys' => array(..), 'insertedKeys' => array() ) - */ - protected function _importXML( $content, $app='core', $knownSettings=array() ) - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $cur_settings = array(); - $updated = 0; - $inserted = 0; - $updatedKeys = array(); - $insertedKeys = array(); - $known = array(); - - //----------------------------------------- - // Get current settings. - //----------------------------------------- - - $this->DB->build( array( 'select' => 'conf_id, conf_key', - 'from' => 'core_sys_conf_settings', - 'order' => 'conf_id' ) ); - - $this->DB->execute(); - - while ( $r = $this->DB->fetch() ) - { - $cur_settings[ $r['conf_key'] ] = $r['conf_id']; - } - - //----------------------------------------- - // Get current titles - //----------------------------------------- - - $this->_settingsGetGroups( true ); - - //----------------------------------------- - // Get xml class - //----------------------------------------- - - require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ - - $xml = new classXML( IPS_DOC_CHAR_SET ); - $xml->loadXML( $content ); - - //----------------------------------------- - // Loop through and sort out settings... - //----------------------------------------- - - foreach( $xml->fetchElements('setting') as $setting ) - { - $entry = $xml->fetchElementsFromRecord( $setting ); - - //----------------------------------------- - // Is setting? - //----------------------------------------- - - if ( ! $entry['conf_is_title'] ) - { - unset( $entry['conf_is_title'] ); - unset( $entry['conf_help_key'] ); - unset( $entry['conf_id'] ); - unset( $entry['conf_end_group'] ); - $new_settings[] = $entry; - } - - //----------------------------------------- - // Is title? - //----------------------------------------- - - else - { - $new_titles[] = $entry; - } - } - - //----------------------------------------- - // Sort out titles... - //----------------------------------------- - - if ( is_array( $new_titles ) and count( $new_titles ) ) - { - foreach( $new_titles as $idx => $data ) - { - if ( $data['conf_title_title'] AND $data['conf_title_keyword'] ) - { - //----------------------------------------- - // Get ID based on key - //----------------------------------------- - - $conf_id = $this->setting_groups_by_key[ $data['conf_title_keyword'] ]['conf_title_id']; - - $save = array( 'conf_title_title' => $data['conf_title_title'], - 'conf_title_desc' => $data['conf_title_desc'], - 'conf_title_keyword' => $data['conf_title_keyword'], - 'conf_title_tab' => $data['conf_title_tab'], - 'conf_title_app' => $data['conf_title_app'] ? $data['conf_title_app'] : $app, - 'conf_title_noshow' => $data['conf_title_noshow'] ); - - //----------------------------------------- - // Not got a row, insert first! - //----------------------------------------- - - if ( ! $conf_id ) - { - $this->DB->insert( 'core_sys_settings_titles', $save ); - $conf_id = $this->DB->getInsertId(); - - } - else - { - //----------------------------------------- - // Update... - //----------------------------------------- - - $this->DB->update( 'core_sys_settings_titles', $save, 'conf_title_id='.$conf_id ); - } - - //----------------------------------------- - // Update settings cache - //----------------------------------------- - - $save['conf_title_id'] = $conf_id; - $this->setting_groups_by_key[ $save['conf_title_keyword'] ] = $save; - $this->setting_groups[ $save['conf_title_id'] ] = $save; - - //----------------------------------------- - // Remove need update... - //----------------------------------------- - - $need_update[] = $conf_id; - } - } - } - - //----------------------------------------- - // Sort out settings - //----------------------------------------- - - if ( is_array( $new_settings ) and count( $new_settings ) ) - { - foreach( $new_settings as $idx => $data ) - { - //----------------------------------------- - // Insert known - //----------------------------------------- - - $data['conf_value'] = ''; - - if( is_array($knownSettings) AND count($knownSettings) ) - { - if ( ! $data['conf_value'] AND ( in_array( $data['conf_key'], array_keys( $knownSettings ) ) ) ) - { - $data['conf_value'] = $knownSettings[ $data['conf_key'] ]; - } - } - - $data['conf_group'] = $this->setting_groups_by_key[ $data['conf_title_keyword'] ]['conf_title_id']; - - //----------------------------------------- - // Remove from array - //----------------------------------------- - - unset( $data['conf_title_keyword'] ); - - if ( $cur_settings[ $data['conf_key'] ] ) - { - //----------------------------------------- - // Don't change the setting value - //----------------------------------------- - unset( $data['conf_value'] ); - - //----------------------------------------- - // Update - //----------------------------------------- - - $this->DB->update( 'core_sys_conf_settings', $data, 'conf_id='.$cur_settings[ $data['conf_key'] ] ); - $updatedKeys[] = $data['conf_key']; - $updated++; - } - else - { - //----------------------------------------- - // INSERT - //----------------------------------------- - - $this->DB->insert( 'core_sys_conf_settings', $data ); - $insertedKeys[] = $data['conf_key']; - $inserted++; - } - } - } - - //----------------------------------------- - // Update group counts... - //----------------------------------------- - - if ( count( $need_update ) ) - { - foreach( $need_update as $i => $idx ) - { - $conf = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'core_sys_conf_settings', 'where' => 'conf_group='.$idx ) ); - - $count = intval($conf['count']); - - $this->DB->update( 'core_sys_settings_titles', array( 'conf_title_count' => $count ), 'conf_title_id='.$idx ); - } - } - - //----------------------------------------- - // Resync - //----------------------------------------- - - $this->settingsRebuildCache(); - - //----------------------------------------- - // Return - //----------------------------------------- - - return array( 'insertedCount' => $inserted, - 'updatedCount' => $updated, - 'insertedKeys' => $insertedKeys, - 'updatedKeys' => $updatedKeys ); - } - - /** - * Export all apps: Wrapper function really. Yes. It is. - * - * @return array Array of messages or errors - */ - public function exportAllApps() - { - $messages = array(); - $errors = array(); - - /* Check for settings not needed anymore */ - $this->_loadDeleteList(); - - foreach( ipsRegistry::$applications as $app_dir => $app_data ) - { - @unlink( IPSLib::getAppDir( $app_dir ) . '/xml/' . $app_dir . '_settings.xml' ); - - if ( ! is_dir( IPSLib::getAppDir( $app_dir ) . '/xml' ) ) - { - $errors[] = "Error: " . IPSLib::getAppDir( $app_dir ) . "/xml/ does not exist"; - continue; - } - else if ( ! IPSLib::isWritable( IPSLib::getAppDir( $app_dir ) . '/xml' ) ) - { - if ( ! @chmod( IPSLib::isWritable( IPSLib::getAppDir( $app_dir ) . '/xml', 0755 ) ) ) - { - $errors[] = "Error: " . IPSLib::getAppDir( $app_dir ) . "/xml/ is not writeable"; - continue; - } - } - else if ( is_file( IPSLib::getAppDir( $app_dir ) . '/xml/' . $app_dir . '_settings.xml' ) AND ! IPSLib::isWritable( IPSLib::getAppDir( $app_dir ) . '/xml/' . $app_dir . '_settings.xml' ) ) - { - $errors[] = "Error: " . IPSLib::getAppDir( $app_dir ) . '/xml/' . $app_dir . "_settings.xml is not writeable"; - continue; - } - - $this->_exportXML( $app_dir ); - - $messages[] = $app_data['app_title'] . " Settings written into the application's XML directory"; - - /* In dev time stamp? */ - if ( IN_DEV ) - { - $cache = $this->caches['indev']; - $cache['import']['settings'][ $app_dir ] = time(); - $this->cache->setCache( 'indev', $cache, array( 'donow' => 1, 'array' => 1 ) ); - } - } - - return $errors ? $errors : $messages; - } - - - /** - * Export all settings to XML (IN_DEV mode) - * - * @param string Application directory - * @return boolean - */ - protected function _exportXML( $app_dir='core' ) - { - //----------------------------------------- - // Get setting groups - //----------------------------------------- - - $this->_settingsGetGroups( true ); - - //----------------------------------------- - // Get xml class - //----------------------------------------- - - require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ - - $xml = new classXML( IPS_DOC_CHAR_SET ); - - $xml->newXMLDocument(); - $xml->addElement( 'settingexport' ); - $xml->addElement( 'settinggroup', 'settingexport' ); - - foreach( $this->setting_groups as $i => $roar ) - { - //----------------------------------------- - // App check? - //----------------------------------------- - - if ( $app_dir != $roar['conf_title_app'] ) - { - continue; - } - - //----------------------------------------- - // First, add in setting group title - //----------------------------------------- - - $thisconf = array( 'conf_is_title' => 1, - 'conf_title_keyword' => $roar['conf_title_keyword'], - 'conf_title_title' => $roar['conf_title_title'], - 'conf_title_desc' => $roar['conf_title_desc'], - 'conf_title_tab' => $roar['conf_title_tab'], - 'conf_title_app' => $roar['conf_title_app'] ? $roar['conf_title_app'] : $app_dir, - 'conf_title_noshow' => $roar['conf_title_noshow'] ); - - $xml->addElementAsRecord( 'settinggroup', 'setting', $thisconf ); - - //----------------------------------------- - // Get settings... - //----------------------------------------- - - $this->DB->build( array( 'select' => '*', - 'from' => 'core_sys_conf_settings', - 'where' => "conf_group='{$roar['conf_title_id']}'", - 'order' => 'conf_position, conf_title' ) ); - - $this->DB->execute(); - - while ( $r = $this->DB->fetch() ) - { - //----------------------------------------- - // Clean up... - //----------------------------------------- - - unset( $r['conf_value'], $r['conf_group'], $r['conf_id'] ); - - $r['conf_title_keyword'] = $roar['conf_title_keyword']; - $r['conf_is_title'] = 0; - - $xml->addElementAsRecord( 'settinggroup', 'setting', $r ); - } - } - - //----------------------------------------- - // Grab the XML document - //----------------------------------------- - - $xmlData = $xml->fetchDocument(); - - //----------------------------------------- - // Attempt to write... - //----------------------------------------- - - $file = IPSLib::getAppDir( $app_dir ) . '/xml/' . $app_dir . '_settings.xml'; - - @unlink( $file ); - @file_put_contents( $file, $xmlData ); - @chmod( $file, IPS_FOLDER_PERMISSION ); - } - - /** - * Load and parse settings delete list (IN_DEV) - * - * @return @e void - */ - protected function _loadDeleteList() - { - if ( IN_DEV ) - { - /* Check for group settings */ - if ( is_file( DOC_IPS_ROOT_PATH . '_deleteGroupSettings.txt' ) ) - { - $notTheseGroups = file( DOC_IPS_ROOT_PATH . '_deleteGroupSettings.txt' ); - - if ( count($notTheseGroups) ) - { - $notTheseGroups = array_map('trim', $notTheseGroups); - - $this->DB->build( array( 'select' => 'conf_title_id', 'from' => 'core_sys_settings_titles', 'where' => "conf_title_keyword IN ('" . implode("','", $notTheseGroups) . "')" ) ); - $this->DB->execute(); - - if ( $this->DB->getTotalRows() ) - { - $_deleteTheseGroups = array(); - - while( $s = $this->DB->fetch() ) - { - $_deleteTheseGroups[] = $s['conf_title_id']; - } - - if ( count($_deleteTheseGroups) ) - { - $this->DB->delete( 'core_sys_conf_settings', 'conf_group IN (' . implode(',', $_deleteTheseGroups) . ')' ); - $this->DB->delete( 'core_sys_settings_titles', "conf_title_keyword IN ('" . implode("','", $notTheseGroups) . "')" ); - } - } - } - } - - /* Check for single settings */ - if ( is_file( DOC_IPS_ROOT_PATH . '_deleteSettings.txt' ) ) - { - $notTheseSettings = file( DOC_IPS_ROOT_PATH . '_deleteSettings.txt' ); - - if ( count($notTheseSettings) ) - { - $notTheseSettings = array_map('trim', $notTheseSettings); - - $this->DB->delete( 'core_sys_conf_settings', "conf_key IN('" . implode( "','", $notTheseSettings ) . "')" ); - } - } - } - } +Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; + exit(); +} + +class admin_core_settings_settings extends ipsCommand +{ + /** + * Key array + * + * @var array Array of keys + */ + protected $key_array = array(); + + /** + * Setting groups array + * + * @var array Array of setting groups + */ + protected $setting_groups = array(); + + /** + * Setting groups array mapping + * + * @var array Array of setting groups + */ + protected $setting_groups_by_key = array(); + + /** + * Skin object + * This is public so that the portal can access it + * + * @var object Skin templates + */ + public $html; + + /** + * Form code + * This is public so that the portal can access it + * + * @var string Form code + */ + public $form_code; + + /** + * Form code + * This is public so that the portal can access it + * + * @var string JS Form code + */ + public $form_code_js; + + /** + * Application to use + * + * @var string Application + */ + protected $_app; + + /** + * Where to return to after save + * + * @var string URL to go to + */ + public $return_after_save; + + /** + * Breadcrumb url to use in place of the default + * + * @var string + */ + public $base_nav_url; + + /** + * Object for the editor shortcut + * + * @var $editor + */ + public $editor = NULL; + + /** + * Class entry point + * + * @param object Registry reference + * @return @e void [Outputs to screen] + */ + public function doExecute( ipsRegistry $registry ) + { + //----------------------------------------- + // Load language + //----------------------------------------- + + $this->registry->class_localization->loadLanguageFile( array( 'admin_tools' ) ); + + $this->html = $this->registry->output->loadTemplate('cp_skin_settings'); + + $this->form_code = $this->html->form_code = 'module=settings&section=settings&'; + $this->form_code_js = $this->html->form_code_js = 'module=settings§ion=settings&'; + + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'settings_manage' ); + + /* What to do? */ + switch( $this->request['do'] ) + { + case 'settinggroup_resync': + $this->_resynchSettingGroup(); + break; + + case 'settinggroup_delete': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'settings_delete' ); + $this->_deleteSettingGroup(); + break; + + case 'settinggroup_new': + $this->_settingGroupForm('add'); + break; + + case 'settinggroup_showedit': + $this->_settingGroupForm('edit'); + break; + + case 'settinggroup_add': + $this->_settingGroupSave('add'); + break; + + case 'settinggroup_edit': + $this->_settingGroupSave('edit'); + break; + + case 'settingnew': + $this->_settingForm('add'); + break; + + case 'setting_showedit': + $this->_settingForm('edit'); + break; + + case 'setting_add': + $this->_settingSave('add'); + break; + + case 'setting_edit': + $this->_settingSave('edit'); + break; + + case 'reorder': + $this->reorder(); + break; + + case 'setting_view': + $this->_viewSettings(); + break; + + case 'setting_delete': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'settings_delete' ); + $this->_deleteSettings(); + break; + + case 'setting_revert': + $this->_revertSettings(); + break; + + case 'setting_update': + $this->_updateSettings(); + break; + + case 'findsetting': + $this->_findSettingGroup(); + break; + + case 'settings_do_import': + $this->importAllSettings(); + break; + case 'settings_do_import_indev': + $this->importAllSettings(1); + break; + + case 'MOD_export_setting': + $this->_exportSettingsGroup(); + break; + + case 'settingsExportApps': + $messages = $this->exportAllApps(); + + $this->registry->output->setMessage( implode( "
    ", $messages ), 1 ); + $this->_settingsOverview(); + break; + + case 'settingsImportApps': + $messages = $this->importAllApps(); + + $this->registry->output->setMessage( implode( "
    ", $messages ), 1 ); + $this->_settingsOverview(); + break; + default: + $this->request['do'] = 'settingsview'; + $this->_settingsOverview(); + break; + } + + //----------------------------------------- + // Pass to CP output hander + //----------------------------------------- + + $this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper(); + $this->registry->output->sendOutput(); + } + + /** + * Reorder the settings + * + * @return @e void + */ + public function reorder() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classAjax.php', 'classAjax' ); + $ajax = new $classToLoad(); + + //----------------------------------------- + // Checks... + //----------------------------------------- + + if( $this->registry->adminFunctions->checkSecurityKey( $this->request['md5check'], true ) === false ) + { + $ajax->returnString( $this->lang->words['postform_badmd5'] ); + exit(); + } + + //----------------------------------------- + // Save new position + //----------------------------------------- + + $position = 1; + + if( is_array($this->request['settings']) AND count($this->request['settings']) ) + { + foreach( $this->request['settings'] as $this_id ) + { + $this->DB->update( 'core_sys_conf_settings', array( 'conf_position' => $position ), 'conf_id=' . $this_id ); + + $position++; + } + } + + $ajax->returnString( 'OK' ); + exit(); + } + + /** + * Setting group export + * + * @return @e void + */ + protected function _exportSettingsGroup() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $this->request[ 'conf_group'] = intval($this->request['conf_group'] ); + + /* Got anything? */ + if ( ! $this->request['conf_group'] ) + { + return; + } + + //----------------------------------------- + // Get setting groups + //----------------------------------------- + + $this->_settingsGetGroups( true ); + + //----------------------------------------- + // Get xml class + //----------------------------------------- + + require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ + + $xml = new classXML( IPS_DOC_CHAR_SET ); + + $xml->newXMLDocument(); + $xml->addElement( 'settingexport' ); + $xml->addElement( 'settinggroup', 'settingexport' ); + + foreach( $this->setting_groups as $i => $roar ) + { + //----------------------------------------- + // App check? + //----------------------------------------- + + if ( $this->request['conf_group'] != $roar['conf_title_id'] ) + { + continue; + } + + //----------------------------------------- + // First, add in setting group title + //----------------------------------------- + + $thisconf = array( 'conf_is_title' => 1, + 'conf_title_keyword' => $roar['conf_title_keyword'], + 'conf_title_title' => $roar['conf_title_title'], + 'conf_title_desc' => $roar['conf_title_desc'], + 'conf_title_tab' => $roar['conf_title_tab'], + 'conf_title_app' => $roar['conf_title_app'] ? $roar['conf_title_app'] : 'core', + 'conf_title_noshow' => $roar['conf_title_noshow'] ); + + $xml->addElementAsRecord( 'settinggroup', 'setting', $thisconf ); + + //----------------------------------------- + // Get settings... + //----------------------------------------- + + $this->DB->build( array( 'select' => '*', + 'from' => 'core_sys_conf_settings', + 'where' => "conf_group='{$roar['conf_title_id']}'", + 'order' => 'conf_position, conf_title' ) ); + + $this->DB->execute(); + + while ( $r = $this->DB->fetch() ) + { + //----------------------------------------- + // Clean up... + //----------------------------------------- + + unset( $r['conf_value'], $r['conf_id'] ); + + $r['conf_title_keyword'] = $roar['conf_title_keyword']; + $r['conf_is_title'] = 0; + + $xml->addElementAsRecord( 'settinggroup', 'setting', $r ); + } + } + + //----------------------------------------- + // Grab the XML document + //----------------------------------------- + + $xmlData = $xml->fetchDocument(); + + $this->registry->output->showDownload( $xmlData, 'settingGroup_' . IPSText::makeSeoTitle( $thisconf['conf_title_title'] ) . '.xml', '', 0 ); + } + + /** + * Find setting group (don't rely on IDs) + * + * @return @e void + */ + public function _findSettingGroup() + { + if ( ! $this->request['key'] ) + { + $this->_settingsOverview(); + } + + $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_settings_titles' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + if( ( $r['conf_title_keyword'] == $this->request['key'] ) OR strtolower( str_replace( " ", "", trim( $r['conf_title_title'] ) ) ) == urldecode( trim( $this->request['key'] ) ) ) + { + $this->registry->output->silentRedirect( $this->settings['base_url'] . '&' . $this->form_code . '&do=setting_view&conf_group=' . $r['conf_title_id'] ); + break; + } + } + + $this->_settingsOverview(); + } + + /** + * Import all settings + * + * @param boolean In development mode? + * @param boolean Return (ignore the var name) + * @param array Array of known setting values + * @return @e void + */ + public function importAllSettings( $in_dev=0, $no_return=0, $known=array() ) + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $updated = 0; + $inserted = 0; + $need_update = array(); + + //----------------------------------------- + // Make sure we have titles + //----------------------------------------- + + $this->_settingsTitlesCheck(); + + //----------------------------------------- + // INDEV? + //----------------------------------------- + + if ( $in_dev ) + { + $_FILES['FILE_UPLOAD']['name'] = ''; + $this->request['file_location'] = IPSLib::getAppDir( $this->request['app_dir'] ) . '/xml/' . $this->request['app_dir'] . '_settings.xml'; + } + else + { + $this->request['file_location'] = IPS_ROOT_PATH . $this->request['file_location'] ; + } + + //----------------------------------------- + // Go for it + //----------------------------------------- + + if ( $_FILES['FILE_UPLOAD']['name'] == "" or ! $_FILES['FILE_UPLOAD']['name'] or ($_FILES['FILE_UPLOAD']['name'] == "none") ) + { + //----------------------------------------- + // check and load from server + //----------------------------------------- + + if ( ! $this->request['file_location'] ) + { + $this->registry->output->global_message = $this->lang->words['s_nofile']; + $this->_settingsOverview(); + return; + } + + if ( ! is_file( $this->request['file_location'] ) ) + { + $this->registry->output->global_message = sprintf( $this->lang->words['s_noopen'], $this->request['file_location'] ); + $this->_settingsOverview(); + return; + } + + if ( preg_match( '#\.gz$#', $this->request['file_location'] ) ) + { + if ( $FH = @gzopen( $this->request['file_location'], 'rb' ) ) + { + while ( ! @gzeof( $FH ) ) + { + $content .= @gzread( $FH, 1024 ); + } + + @gzclose( $FH ); + } + } + else + { + if ( $FH = @fopen( $this->request['file_location'], 'rb' ) ) + { + $content = @fread( $FH, filesize($this->request['file_location']) ); + @fclose( $FH ); + } + } + } + else + { + //----------------------------------------- + // Get uploaded schtuff + //----------------------------------------- + + $tmp_name = $_FILES['FILE_UPLOAD']['name']; + $tmp_name = preg_replace( '#\.gz$#', "", $tmp_name ); + + try + { + $content = ipsRegistry::getClass('adminFunctions')->importXml( $tmp_name ); + } + catch ( Exception $e ) + { + $this->registry->output->showError( $e->getMessage() ); + } + } + + if ( ! $content ) + { + $this->registry->output->global_message = $this->lang->words['s_nofile']; + $this->_settingsOverview(); + return; + } + + $return = $this->_importXML( $content, $this->request['app_dir'], $known ); + + if ( $no_return ) + { + $this->registry->output->global_message = sprintf( $this->lang->words['s_upandin'], $return['updatedCount'], $return['insertedCount'] ); + return TRUE; + } + else + { + $this->registry->output->global_message = sprintf( $this->lang->words['s_upandin'], $return['updatedCount'], $return['insertedCount'] ); + $this->_settingsOverview(); + return; + } + } + + /** + * Delete a setting group + * + * @return @e void + */ + protected function _deleteSettingGroup() + { + if ( $this->request['id'] ) + { + $conf = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'core_sys_conf_settings', 'where' => 'conf_group=' . $this->request['id'] ) ); + + $count = intval($conf['count']); + + if ( $count > 0 ) + { + $this->registry->output->global_message = $this->lang->words['s_cantremove']; + } + else + { + $this->DB->delete( 'core_sys_settings_titles', 'conf_title_id=' . $this->request['id'] ); + + $this->registry->output->global_message = $this->lang->words['s_removed']; + } + + } + + $this->settingsRebuildCache(); + + $this->_settingsOverview(); + } + + /** + * Resynchronize settings in a group + * + * @return @e void + */ + protected function _resynchSettingGroup() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $this->request['id'] = intval( $this->request['id'] ); + + //----------------------------------------- + // Doit... + //----------------------------------------- + + $this->_resynchGroup( $this->request['id'] ); + + $this->registry->output->global_message = $this->lang->words['s_recounted']; + + //----------------------------------------- + // Get conf title details + //----------------------------------------- + + $conf_group = $this->DB->buildAndFetch( array( 'select' => 'conf_title_tab', + 'from' => 'core_sys_settings_titles', + 'where' => 'conf_title_id='.$this->request['id'] ) ); + + $this->_settingsOverview( $conf_group['conf_title_tab'] ); + } + + /** + * Does the resync + * + * @param integer Group id + * @return @e void + */ + protected function _resynchGroup( $id ) + { + if ( $id ) + { + $conf = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'core_sys_conf_settings', 'where' => 'conf_group='.$id ) ); + + $count = intval($conf['count']); + + $this->DB->update( 'core_sys_settings_titles', array( 'conf_title_count' => $count ), 'conf_title_id=' . $id ); + } + } + + /** + * Form to add/edit a setting group + * + * @param string [add|edit] + * @return @e void + */ + protected function _settingGroupForm( $type='add' ) + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $conf_title_id = intval( $this->request['id'] ); + $form = array(); + $apps = array( 0 => array( 'core', $this->lang->words['s_global_dd'] ) ); + + //----------------------------------------- + // Build applications drop down + //----------------------------------------- + + foreach( ipsRegistry::$applications as $app_dir => $app_data ) + { + $apps[] = array( $app_dir, $app_data['app_title'] ); + } + + //----------------------------------------- + // Type + //----------------------------------------- + + if ( $type == 'add' ) + { + $formcode = 'settinggroup_add'; + $title = $this->lang->words['s_createnew']; + $button = $this->lang->words['s_createnew']; + } + else + { + $conf = $this->DB->buildAndFetch( array( 'select' => '*', + 'from' => 'core_sys_settings_titles', + 'where' => 'conf_title_id='.$conf_title_id ) ); + + if ( ! $conf['conf_title_id'] ) + { + $this->registry->output->global_message = $this->lang->words['s_noid']; + $this->_settingsOverview(); + } + + $formcode = 'settinggroup_edit'; + $title = sprintf($this->lang->words['s_editsetting'], $conf['conf_title'] ); + $button = $this->lang->words['s_savechanges']; + } + + //----------------------------------------- + // Form elements + //----------------------------------------- + + $form['conf_title_title'] = $this->registry->output->formInput( 'conf_title_title', $_POST['conf_title_title'] ? $_POST['conf_title_title'] : $conf['conf_title_title'] ); + $form['conf_title_desc'] = $this->registry->output->formTextarea( 'conf_title_desc', $_POST['conf_title_desc'] ? $_POST['conf_title_desc'] : $conf['conf_title_desc'] ); + $form['conf_title_app'] = $this->registry->output->formDropdown( 'conf_title_app', $apps, $_POST['conf_title_app'] ? $_POST['conf_title_app'] : $conf['conf_title_app'] ); + $form['conf_title_tab'] = $this->registry->output->formInput( 'conf_title_tab', $_POST['conf_title_tab'] ? $_POST['conf_title_tab'] : $conf['conf_title_tab'] ); + + //if ( IN_DEV ) + //{ + $form['conf_title_keyword'] = $this->registry->output->formInput( 'conf_title_keyword', $_POST['conf_title_keyword'] ? $_POST['conf_title_keyword'] : $conf['conf_title_keyword'] ); + $form['conf_title_noshow'] = $this->registry->output->formYesNo( 'conf_title_noshow', $_POST['conf_title_noshow'] ? $_POST['conf_title_noshow'] : $conf['conf_title_noshow'] ); + //} + + $this->registry->output->html .= $this->html->settings_title_form( $form, $title, $formcode, $button ); + } + + /** + * Save a setting group + * + * @param string [add|edit] + * @return @e void + */ + protected function _settingGroupSave($type='add') + { + //----------------------------------------- + // INIT + //----------------------------------------- + + if ( $type == 'edit' ) + { + if ( ! $this->request['id'] ) + { + $this->registry->output->global_message = $this->lang->words['s_noid']; + $this->_settingForm(); + return; + } + } + + if( ! $this->request['conf_title_title'] ) + { + $this->registry->output->global_message = $this->lang->words['s_notitle']; + $this->_settingGroupForm( $type ); + return; + } + + if( ! $this->request['conf_title_keyword'] ) + { + $this->registry->output->global_message = $this->lang->words['s_nokeyword']; + $this->_settingGroupForm( $type ); + return; + } + + //-------------------------------------------- + // Check... + //-------------------------------------------- + + $array = array( 'conf_title_title' => $this->request['conf_title_title'], + 'conf_title_desc' => IPSText::safeslashes( $_POST['conf_title_desc'] ), + 'conf_title_keyword' => IPSText::safeslashes( $_POST['conf_title_keyword'] ), + 'conf_title_noshow' => $this->request['conf_title_noshow'], + 'conf_title_app' => trim( $this->request['conf_title_app'] ), + 'conf_title_tab' => trim( $this->request['conf_title_tab'] ) + ); + + + if ( $type == 'add' ) + { + $this->DB->insert( 'core_sys_settings_titles', $array ); + $this->registry->output->global_message = $this->lang->words['s_added']; + } + else + { + $this->DB->update( 'core_sys_settings_titles', $array, 'conf_title_id=' . $this->request['id'] ); + $this->registry->output->global_message = $this->lang->words['s_edited']; + } + + $this->settingsRebuildCache(); + + $this->_settingsOverview(); + } + + /** + * Form to add/edit a setting + * + * @param string [add|edit] + * @return @e void + */ + protected function _settingForm( $type='add' ) + { + if ( $type == 'add' ) + { + $formcode = 'setting_add'; + $title = $this->lang->words['s_createnewtitle']; + $button = $this->lang->words['s_createnewtitle']; + $conf = array( 'conf_group' => $this->request['conf_group'], 'conf_add_cache' => 1 ); + + if ( IN_DEV ) + { + $conf['conf_protected'] = 1; + } + + if ( $this->request['conf_group'] ) + { + $max = $this->DB->buildAndFetch( array( 'select' => 'max(conf_position) as max', 'from' => 'core_sys_conf_settings', 'where' => 'conf_group=' . $this->request['conf_group'] ) ); + } + else + { + $max = $this->DB->buildAndFetch( array( 'select' => 'max(conf_position) as max', 'from' => 'core_sys_conf_settings' ) ); + } + + $conf['conf_position'] = $max['max'] + 1; + } + else + { + $conf = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_conf_settings', 'where' => 'conf_id=' . $this->request['id'] ) ); + + if ( ! $conf['conf_id'] ) + { + $this->registry->output->global_message = $this->lang->words['s_noid']; + $this->_settingsOverview(); + } + + $formcode = 'setting_edit'; + $title = sprintf($this->lang->words['s_editsetting'], $conf['conf_title'] ); + $button = $this->lang->words['s_savechanges']; + } + + //----------------------------------------- + // Get groups + //----------------------------------------- + + $this->_settingsGetGroups(); + + $groups = array(); + + foreach( $this->setting_groups as $i => $r ) + { + $groups[] = array( $r['conf_title_id'], $r['conf_title_title'] ); + } + + //----------------------------------------- + // Type + //----------------------------------------- + + $types = array( + array( 'input' , $this->lang->words['s_input'] ), + array( 'dropdown' , $this->lang->words['s_dropdown'] ), + array( 'yes_no' , $this->lang->words['s_yes_no'] ), + array( 'textarea' , $this->lang->words['s_textarea'] ), + array( 'editor' , $this->lang->words['s_editor'] ), + array( 'multi' , $this->lang->words['s_multi'] ), + array( 'name_autocomplete' , $this->lang->words['s_name_autocomplete'] ), + ); + + + + $form['conf_title'] = $this->registry->output->formInput( 'conf_title' , $_POST['conf_title'] ? $_POST['conf_title'] : $conf['conf_title'] ); + $form['conf_position'] = $this->registry->output->formInput( 'conf_position' , $_POST['conf_position'] ? $_POST['conf_position'] : $conf['conf_position'] ); + $form['conf_description'] = $this->registry->output->formTextarea( 'conf_description', $_POST['conf_description'] ? $_POST['conf_description'] : $conf['conf_description'] ); + $form['conf_group'] = $this->registry->output->formDropdown( 'conf_group' , $groups, $_POST['conf_group'] ? $_POST['conf_group'] : $conf['conf_group'] ); + $form['conf_type'] = $this->registry->output->formDropdown( 'conf_type' , $types, $_POST['conf_type'] ? $_POST['conf_type'] : $conf['conf_type'] ); + $form['conf_key'] = $this->registry->output->formInput( 'conf_key' , $_POST['conf_key'] ? $_POST['conf_key'] : $conf['conf_key'] ); + $form['conf_value'] = $this->registry->output->formTextarea( 'conf_value' , $_POST['conf_value'] ? $_POST['conf_value'] : $conf['conf_value'] ); + $form['conf_default'] = $this->registry->output->formTextarea( 'conf_default' , $_POST['conf_default'] ? $_POST['conf_default'] : $conf['conf_default'] ); + $form['conf_extra'] = $this->registry->output->formTextarea( 'conf_extra' , $_POST['conf_extra'] ? $_POST['conf_extra'] : $conf['conf_extra'] ); + $form['conf_evalphp'] = $this->registry->output->formTextarea( 'conf_evalphp' , $_POST['conf_evalphp'] ? $_POST['conf_evalphp'] : $conf['conf_evalphp'] ); + $form['conf_keywords'] = $this->registry->output->formTextarea( 'conf_keywords' , $_POST['conf_keywords'] ? $_POST['conf_keywords'] : $conf['conf_keywords'] ); + $form['conf_start_group'] = $this->registry->output->formInput( 'conf_start_group', $_POST['conf_start_group'] ? $_POST['conf_start_group'] : $conf['conf_start_group'] ); + $form['conf_add_cache'] = $this->registry->output->formYesNo( 'conf_add_cache', $_POST['conf_add_cache'] ? $_POST['conf_add_cache'] : $conf['conf_add_cache'] ); + + if ( IN_DEV ) + { + $form['conf_protected'] = $this->registry->output->formYesNo( 'conf_protected', $_POST['conf_protected'] ? $_POST['conf_protected'] : $conf['conf_protected'] ); + } + + + + //----------------------------------------- + // start form + //----------------------------------------- + + $this->registry->output->html .= $this->html->settings_form( $form, $title, $formcode, $button ); + } + + /** + * View all settings (form) in a group + * This is public so that portal can access it + * + * @return @e void + */ + public function _viewSettings() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $search_key = trim( $this->request['search'] ); + $conf_group = trim( $this->request['conf_group'] ); + $conf_titles = array(); + $last_conf_id = -1; + $start = intval( $this->request['st'] ); + $end = 150; + $get_by_key = isset( $this->request['conf_title_keyword'] ) ? $this->request['conf_title_keyword'] : ''; + + //----------------------------------------- + // Get settings in group + //----------------------------------------- + + $this->_settingsGetGroups( ( $get_by_key ) ? TRUE : FALSE ); + + //----------------------------------------- + // Grabbing by key? + //----------------------------------------- + + if( $get_by_key ) + { + $data = $this->DB->buildAndFetch( array( + 'select' => 'conf_title_id, conf_title_keyword, conf_title_title', + 'from' => 'core_sys_settings_titles', + 'where' => "conf_title_keyword='{$get_by_key}'" + ) ); + + $this->request['conf_group'] = $data['conf_title_id'] ; + $conf_group = $data['conf_title_id']; + $this->request['groupHelpKey'] = $data['conf_title_keyword']; + } + + //----------------------------------------- + // check... + //----------------------------------------- + + if( !$conf_group and !$search_key ) + { + $this->registry->output->global_message = $this->lang->words['s_nogroup']; + $this->_settingsOverview(); + return; + } + + //-------------------------------------- + // Redirect to Nexus for ads + //-------------------------------------- + + if ( $this->setting_groups[ $conf_group ]['conf_title_keyword'] == 'adcodeintegration' and IPSLib::appIsInstalled('nexus') ) + { + $this->registry->output->silentRedirect( $this->settings['base_url'] . 'app=nexus&module=promotion§ion=advertisements' ); + } + + //----------------------------------------- + // Pagination + //----------------------------------------- + + $pages = $this->registry->output->generatePagination( array( + 'totalItems' => $this->setting_groups[$conf_group]['conf_title_count'], + 'itemsPerPage' => $end, + 'currentStartValue' => $start, + 'baseUrl' => $this->settings['base_url'] . "&{$this->form_code}&&search={$search_key}", + ) ); + + + //----------------------------------------- + // Did we search? + //----------------------------------------- + + if( $search_key ) + { + $keywords = strtolower($search_key); + $whereExtra = $conf_group ? " AND c.conf_group={$conf_group}" : ''; + + $this->DB->build( array( + 'select' => 'c.*', + 'from' => array( 'core_sys_conf_settings' => 'c' ), + 'where' => '(' . $this->DB->buildLower('c.conf_title') . " LIKE '%{$keywords}%' OR " . $this->DB->buildLower('c.conf_description') . " LIKE '%{$keywords}%' OR " . $this->DB->buildLower('c.conf_keywords') . " LIKE '%{$keywords}%')" . $whereExtra, + 'order' => 'c.conf_title', + 'limit' => array( $start, $end ), + 'add_join' => array( + array( + 'select' => 'ct.conf_title_id, ct.conf_title_noshow, ct.conf_title_title, ct.conf_title_tab', + 'from' => array( 'core_sys_settings_titles' => 'ct' ), + 'where' => 'ct.conf_title_id=c.conf_group', + 'type' => 'left' + ) + ) + ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $r['conf_start_group'] = ""; + $r['conf_description'] .= '
    ' . $this->lang->words['conf_desc_search'] . "" . $r['conf_title_title'] . ""; + $conf_entry[ $r['conf_id'] ] = $r; + } + + if( ! count( $conf_entry ) ) + { + $this->registry->output->global_message = sprintf( $this->lang->words['s_nomatches'], $keywords ); + $this->_settingsOverview(); + return; + } + + $title = sprintf( $this->lang->words['s_searchedfor'], $keywords ); + $tab = ''; + } + + //----------------------------------------- + // Or not... + //----------------------------------------- + + else + { + $this->DB->build( array( + 'select' => '*', + 'from' => 'core_sys_conf_settings', + 'where' => "conf_group='{$conf_group}'", + 'order' => 'conf_position, conf_title', + 'limit' => array( $start,$end ) + ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $conf_entry[ $r['conf_id'] ] = $r; + } + + $title = $this->setting_groups[$conf_group]['conf_title_title']; + $tab = IPSText::md5Clean( $this->setting_groups[$conf_group]['conf_title_tab'] ); + $this->request['groupHelpKey'] = $this->setting_groups[ $conf_group ]['conf_title_keyword']; + } + + //----------------------------------------- + // Start output + //----------------------------------------- + + $content = ""; + + if( is_array( $conf_entry ) and count( $conf_entry ) ) + { + foreach( $conf_entry as $id => $r ) + { + $content .= $this->_processSettingEntry( $r ); + } + } + + if( ! $search_key AND ! $get_by_key ) + { + $searchbutton = 1; + } + + if ( ! $this->registry->output->ignoreCoreNav ) // Bug #39467 + { + /* Navigation */ + if( $this->base_nav_url ) + { + $this->registry->output->extra_nav[] = array( $this->base_nav_url, ipsRegistry::$applications[ $this->setting_groups[$conf_group]['conf_title_app'] ]['app_title'] ); + $this->registry->output->extra_nav[] = array( "", $title ); + + } + else if( $tab ) + { + $this->registry->output->extra_nav[] = array( "{$this->settings['base_url']}{$this->form_code}&_dtab={$tab}", $this->setting_groups[$conf_group]['conf_title_tab'] ? $this->setting_groups[$conf_group]['conf_title_tab'] : ipsRegistry::$applications[ $this->setting_groups[$conf_group]['conf_title_app'] ]['app_title'] ); + $this->registry->output->extra_nav[] = array( "{$this->settings['base_url']}{$this->form_code}&do=setting_view&conf_group={$conf_group}", $title ); + } + else + { + $this->registry->output->extra_nav[] = array( "{$this->settings['base_url']}{$this->form_code}&_dtab=System", $this->setting_groups[$conf_group]['conf_title_tab'] ? $this->setting_groups[$conf_group]['conf_title_tab'] : ipsRegistry::$applications[ $this->setting_groups[$conf_group]['conf_title_app'] ]['app_title'] ); + $this->registry->output->extra_nav[] = array( "{$this->settings['base_url']}{$this->form_code}&do=setting_view&conf_group={$conf_group}", $title ); + } + } + + /* Output */ + $this->registry->output->html .= $this->html->settings_view_wrapper( $title, $content, $searchbutton, $this->return_after_save ); + $this->registry->output->html = str_replace( '', "", $this->registry->output->html ); + } + + /** + * Process an individual setting for display + * + * @param array Setting record + * @return @e void + */ + public function _processSettingEntry($r) + { + /* Init editor class */ + if ( !is_object($this->editor) ) + { + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' ); + $this->editor = new $classToLoad(); + } + + /* Init vars */ + $tempSkinUrl = $this->settings['skin_app_url']; + $this->settings['skin_app_url'] = $this->settings['_original_base_url'] . '/' . CP_DIRECTORY . '/applications/core/skin_cp/' ; + $form_element = ""; + $form_type = 'normal'; + $dropdown = array(); + $start = ""; + $revert_button = ""; + + $key = $r['conf_key']; + $value = $r['conf_value'] != "" ? $r['conf_value'] : $r['conf_default']; + $value = $value == "{blank}" ? '' : $value; + + $show = 1; + + //----------------------------------------------- + // Default? + //----------------------------------------------- + + $css = ""; + + if ( $r['conf_value'] != "" and ( $r['conf_value'] != $r['conf_default'] ) ) + { + $revert_button = "
  • form_code}&do=setting_revert&id={$r['conf_id']}&conf_group={$r['conf_group']}&search=" . $this->request['search'] . "' title='{$this->lang->words['s_revertback']}'>{$this->lang->words['revert']}
  • "; + } + + //----------------------------------------------- + // Evil eval + //----------------------------------------------- + + if ( $r['conf_evalphp'] ) + { + + $r['conf_evalphp'] = str_replace( '\', '\\', $r['conf_evalphp'] ); + $show = 1; + + eval( $r['conf_evalphp'] ); + } + + if( ! $show && ! IN_DEV ) + { + return ''; + } + + switch( $r['conf_type'] ) + { + case 'input': + $form_element = $this->registry->output->formInput( $key, str_replace( "'", "'", $value ) ); + break; + + case 'textarea': + $form_element = $this->registry->output->formTextarea( $key, str_replace( "&#092;", "\", IPSText::textToForm($value) ), 45 ); + break; + + case 'editor': + //$this->editor->setIsHtml( true ); + $this->editor->setContent( $value ); + + $form_element = $this->editor->show( $key, array( 'minimize' => 1 ) ); + $form_type = 'rte'; + + break; + + case 'yes_no': + $form_element = $this->registry->output->formYesNo( $key, $value ); + break; + + case 'name_autocomplete': + $form_element = $this->html->nameAutoCompleteField( $key, $value ); + break; + + default: + + if ( $r['conf_extra'] ) + { + if ( $r['conf_extra'] == '#show_forums#' ) + { + //----------------------------------------- + // Require the library + // (Not a building with books) + //----------------------------------------- + + require_once( IPSLib::getAppDir( 'forums' ) .'/sources/classes/forums/class_forums.php' );/*noLibHook*/ + $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) .'/sources/classes/forums/admin_forum_functions.php', 'admin_forum_functions', 'forums' ); + + $aff = new $classToLoad( $this->registry ); + $aff->forumsInit(); + $dropdown = $aff->adForumsForumList(1); + } + else if ( $r['conf_extra'] == '#show_groups#' ) + { + $this->DB->build( array( 'select' => '*', 'from' => 'groups', 'order' => 'g_title ASC' ) ); + $this->DB->execute(); + + while( $row = $this->DB->fetch() ) + { + if ( $row['g_access_cp'] ) + { + $row['g_title'] .= ' ' . $this->lang->words['setting_staff_tag'] . ' '; + } + + $dropdown[] = array( $row['g_id'], $row['g_title'] ); + } + } + else if ( $r['conf_extra'] == '#show_applications#' ) + { + foreach( ipsRegistry::$applications as $app ) + { + $dropdown[] = array( $app['app_directory'], $app['app_title'] ); + } + } + else if ( $r['conf_extra'] == '#show_skins#' ) + { + $dropdown = $this->registry->output->generateSkinDropdown(); + } + else + { + foreach( explode( "\n", $r['conf_extra'] ) as $l ) + { + list ($k, $v) = explode( "=", $l ); + if ( $k != "" and $v != "" ) + { + $dropdown[] = array( trim($k), trim($v) ); + } + } + } + } + + if ( $r['conf_type'] == 'dropdown' ) + { + $form_element = $this->registry->output->formDropdown( $key, $dropdown, $value ); + } + else + { + $form_element = $this->registry->output->formMultiDropdown( $key, $dropdown, explode( ",", $value ) ); + } + + break; + } + + $delete = "
  • form_code}&do=setting_delete&id={$r['conf_id']}\");' title='key: {$r['conf_key']}'>{$this->lang->words['delete']}
  • "; + $edit = "
  • form_code}&do=setting_showedit&id={$r['conf_id']}' title='id: {$r['conf_id']}'>{$this->lang->words['edit']}
  • "; + + if ( $r['conf_protected'] and ! IN_DEV ) + { + $delete = ""; + $edit = ""; + } + + if ( $r['conf_start_group'] ) + { + $start = $this->html->settings_row_start_group( $r ); + } + + $r['conf_description'] = str_replace( '{ACP_URL}', $this->settings['_base_url'], $r['conf_description'] ); + + //----------------------------------------------- + // Search hi-lite + //----------------------------------------------- + + if ( $this->request['search'] ) + { + $_replacements = array(); + + preg_match_all( "/(&([a-zA-Z0-9]+);)/i", $r['conf_title'], $matches ); + + if( count($matches[0]) ) + { + for( $i=0, $cnt=count($matches[0]); $i <= $cnt; $i++ ) + { + $r['conf_title'] = str_replace( $matches[0][$i], '{{{' . $i . '}}}', $r['conf_title'] ); + } + } + + $r['conf_title'] = preg_replace( "/(". str_replace( '/', '\\/', $this->request['search'] ) .")/i", "\\1", $r['conf_title'] ); + + if( count($matches[0]) ) + { + for( $i=0, $cnt=count($matches); $i <= $cnt; $i++ ) + { + $r['conf_title'] = str_replace( '{{{' . $i . '}}}', $matches[0][$i], $r['conf_title'] ); + } + } + + /** + * Ok this is just annoying.... + */ + $_did = 0; + preg_match_all( "/(href=['\"].*?[\"'])/i", $r['conf_description'], $matches ); + + if( count($matches[0]) ) + { + for( $i=$_did, $cnt=count($matches[0]); $i <= $cnt; $i++ ) + { + $r['conf_description'] = str_replace( $matches[0][$i], '{{{' . $i . '}}}', $r['conf_description'] ); + + $_replacements[ $i ] = $matches[0][$i]; + $_did++; + } + } + + preg_match_all( "/(&([a-zA-Z0-9]+);)/i", $r['conf_description'], $matches ); + + if( count($matches[0]) ) + { + for( $i=$_did, $cnt=count($matches[0]); $i <= $cnt; $i++ ) + { + $r['conf_description'] = str_replace( $matches[0][$i], '{{{' . $i . '}}}', $r['conf_description'] ); + + $_replacements[ $i ] = $matches[0][$i]; + $_did++; + } + } + + $r['conf_description'] = preg_replace( "/(". str_replace( '/', '\\/', $this->request['search'] ) .")/i", "\\1", $r['conf_description'] ); + + if( count($_replacements) ) + { + foreach( $_replacements as $index => $val ) + { + $r['conf_description'] = str_replace( '{{{' . $index . '}}}', $val, $r['conf_description'] ); + } + } + } + + $html .= $start . $this->html->settings_view_row( $r, $edit, $delete, $form_element, $revert_button, $form_type ); + + $this->key_array[] = preg_replace( '/\[\]$/', "", $key ); + + $this->settings[ 'skin_app_url'] = $tempSkinUrl ; + + return $html; + } + + /** + * View setting groups + * + * @param string Application to default to + * @return @e void + */ + protected function _settingsOverview( $start_app='' ) + { + $content = ""; + $title = ""; + $settings = array(); + $start_app = ( $start_app ) ? $start_app : trim( $this->request['start_app'] ); + + //----------------------------------------- + // Get the groups + //----------------------------------------- + + $this->_settingsGetGroups(); + + //----------------------------------------- + // Build settings.. + //----------------------------------------- + + foreach( $this->setting_groups as $i => $r ) + { + $r['conf_title_app'] = ( $r['conf_title_app'] ) ? $r['conf_title_app'] : 'core'; + $r['conf_title_tab'] = ( $r['conf_title_tab'] ) ? $r['conf_title_tab'] : 'System'; + $r['conf_title_title'] = ( $r['conf_title_noshow'] ) ? $r['conf_title_title'] . ' ' . $this->lang->words['s_ishidden'] : $r['conf_title_title']; + + $settings[ $r['conf_title_tab'] ][] = $r; + } + + $this->registry->output->html .= $this->html->settings_titles_wrapper( $settings, $start_app ); + } + + /** + * Update setting values/ordering + * + * @param boolean Return afterwards? + * @return @e void + */ + protected function _updateSettings( $donothing="" ) + { + /* Init vars */ + $bounceback = str_replace( '&', '&', $this->request['bounceback'] ); + + /* Check for something to save... */ + if ( ! $this->request['id'] and ! $this->request['search'] AND !$this->request['settings_save'] ) + { + $this->registry->output->global_message = $this->lang->words['s_noid']; + $this->_settingsOverview(); + return; + } + + /* ...and check for fields */ + $fields = explode( ",", trim($this->request['settings_save']) ); + + if ( ! count($fields ) ) + { + $this->registry->output->global_message = $this->lang->words['s_nofields']; + $this->_viewSettings(); + return; + } + + /* Init editor class */ + if ( !is_object($this->editor) ) + { + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' ); + $this->editor = new $classToLoad(); + } + + //-------------------------------------------- + // Update + //-------------------------------------------- + + $update = array(); + foreach ( $fields as $f ) + { + $update[ $f ] = $_POST[ $f ]; + } + + IPSLib::updateSettings( $update, TRUE ); + + $this->request['conf_group'] = $this->request['id']; + $this->registry->output->global_message = $this->lang->words['s_updated']; + + //----------------------------------------- + // We're bouncing back (Boing boing) + //----------------------------------------- + + if ( $bounceback ) + { + $this->registry->output->silentRedirectWithMessage( $bounceback ); + } + + //----------------------------------------- + // Still here? + //----------------------------------------- + + + if ( ! $donothing ) + { + $this->_viewSettings(); + } + } + + /** + * Save the settings form + * + * @param string [add|edit] + * @return @e void + */ + protected function _settingSave($type='add') + { + if ( $type == 'edit' ) + { + if ( ! $this->request['id'] ) + { + $this->registry->output->global_message = $this->lang->words['s_noid']; + $this->_settingForm(); + return; + } + } + + //-------------------------------------------- + // check... + //-------------------------------------------- + + $conf_group = $this->request['conf_newgroup'] ? $this->request['conf_newgroup'] : $this->request['conf_group']; + + $array = array( 'conf_title' => $this->request['conf_title'], + 'conf_description' => IPSText::stripslashes( $_POST['conf_description'] ), + 'conf_group' => $this->request['conf_group'], + 'conf_type' => $this->request['conf_type'], + 'conf_key' => str_replace( '-', '_', IPSText::alphanumericalClean( $this->request['conf_key'] ) ), + 'conf_value' => IPSText::stripslashes( $_POST['conf_value'] ), + 'conf_default' => IPSText::stripslashes( $_POST['conf_default'] ), + 'conf_extra' => IPSText::stripslashes( $_POST['conf_extra'] ), + 'conf_evalphp' => IPSText::stripslashes( $_POST['conf_evalphp'] ), + 'conf_protected' => intval( $this->request['conf_protected'] ), + 'conf_position' => intval( $this->request['conf_position'] ), + 'conf_start_group' => $this->request['conf_start_group'], + 'conf_add_cache' => intval( $this->request['conf_add_cache'] ), + 'conf_keywords' => IPSText::stripslashes( $_POST['conf_keywords'] ), + ); + + //----------------------------------------- + // Do we have a title and key? + //----------------------------------------- + + if( !$array['conf_title'] OR !$array['conf_key'] ) + { + $this->registry->output->global_message = $this->lang->words['s_missing_key_data']; + $this->_settingForm(); + return; + } + + if ( $type == 'add' ) + { + //----------------------------------------- + // Is the key already in use? + //----------------------------------------- + + if ( $this->settings[ $array['conf_key'] ] ) + { + $this->registry->output->global_message = $this->lang->words['s_keyinuse_already']; + $this->_settingForm(); + return; + } + + $this->DB->insert( 'core_sys_conf_settings', $array ); + $this->registry->output->global_message = $this->lang->words['s_added2']; + } + else + { + $conf = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_conf_settings', 'where' => 'conf_id=' . $this->request['id'] ) ); + + $this->DB->update( 'core_sys_conf_settings', $array, 'conf_id=' . $this->request['id'] ); + $this->registry->output->global_message = $this->lang->words['s_edited2']; + + // Recount old group + $this->_resynchGroup( $conf['conf_group'] ); + } + + //----------------------------------------- + // Recount new group + //----------------------------------------- + + if( $this->request['conf_group'] ) + { + $this->_resynchGroup( $this->request['conf_group'] ); + } + + $this->settingsRebuildCache(); + + $this->_viewSettings(); + } + + /** + * Revert a setting to the default value + * + * @return @e void + */ + protected function _revertSettings() + { + $this->request[ 'id'] = intval($this->request['id'] ); + + if ( ! $this->request['id'] ) + { + $this->registry->output->global_message = $this->lang->words['s_noid']; + $this->_settingForm(); + return; + } + + $conf = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_conf_settings', 'where' => 'conf_id=' . $this->request['id'] ) ); + + //-------------------------------------------- + // Revert... + //-------------------------------------------- + + IPSLib::updateSettings( array( $conf['conf_key'] => $conf['conf_default'] ) ); + + $this->registry->output->global_message = $this->lang->words['s_revertedback']; + + $this->settingsRebuildCache(); + + //----------------------------------------- + // Boink + //----------------------------------------- + + $referrer = my_getenv('HTTP_REFERER'); + + if ( strstr( $referrer, $this->settings['_admin_link'] ) and !strstr( $referrer, 'app=core&module=settings§ion=settings' ) ) + { + $this->registry->output->silentRedirect( $referrer ); + return; + } + else + { + $this->_viewSettings(); + } + + } + + /** + * Delete a setting + * + * @return @e void + */ + protected function _deleteSettings() + { + if ( ! $this->request['id'] ) + { + $this->registry->output->global_message = $this->lang->words['s_noid']; + $this->_settingsOverview(); + return; + } + + $conf = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_conf_settings', 'where' => 'conf_id=' . $this->request['id'] ) ); + + if ( ! $conf['conf_id'] ) + { + $this->registry->output->global_message = $this->lang->words['s_noid']; + $this->_settingsOverview(); + return; + } + + //-------------------------------------------- + // Delete... + //-------------------------------------------- + + $this->DB->delete( 'core_sys_conf_settings', 'conf_id=' . $this->request['id'] ); + + $this->DB->update( 'core_sys_settings_titles', 'conf_title_count=conf_title_count-1', 'conf_title_id=' . $conf['conf_group'], false, true ); + + $this->registry->output->global_message = $this->lang->words['s_deleted']; + + $this->settingsRebuildCache(); + + $this->_settingsOverview(); + } + + + /** + * Rebuild settings cache + * + * @return @e void + */ + public function settingsRebuildCache() + { + $settings = array(); + + $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_conf_settings', 'where' => 'conf_add_cache=1' ) ); + $info = $this->DB->execute(); + + while ( $r = $this->DB->fetch($info) ) + { + $value = $r['conf_value'] != "" ? $r['conf_value'] : $r['conf_default']; + + if ( $value == '{blank}' ) + { + $value = ''; + } + + $settings[ $r['conf_key'] ] = $value; + } + + $this->cache->setCache( 'settings', $settings, array( 'array' => 1 ) ); + } + + /** + * Grab all setting groups and store in an internal array + * + * @param boolean Pull all settings, not just visible ones + * @return @e void + */ + protected function _settingsGetGroups( $ignoreInDev=false ) + { + $this->setting_groups = array(); + + if ( IN_DEV OR $ignoreInDev ) + { + $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_settings_titles', 'order' => 'conf_title_title' ) ); + $this->DB->execute(); + } + else + { + $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_settings_titles', 'where' => 'conf_title_noshow=0', 'order' => 'conf_title_title' ) ); + $this->DB->execute(); + } + + while( $r = $this->DB->fetch() ) + { + $this->setting_groups[ $r['conf_title_id'] ] = $r; + $this->setting_groups_by_key[ $r['conf_title_keyword'] ] = $r; + } + } + + /** + * Make sure all titles have keywords set + * + * @return @e void + */ + protected function _settingsTitlesCheck() + { + //----------------------------------------- + // Get 'em + //----------------------------------------- + + $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_settings_titles' ) ); + $outer = $this->DB->execute(); + + while( $row = $this->DB->fetch( $outer ) ) + { + if ( ! $row['conf_title_keyword'] ) + { + $new_keyword = strtolower( preg_replace( '#[^\d\w]#', "", $row['conf_title_title'] ) ); + $this->DB->update( 'core_sys_settings_titles', array( 'conf_title_keyword' => $new_keyword ), 'conf_title_id='.$row['conf_title_id'] ); + } + } + } + + /** + * Import XML Settings on an app by app basis + * + * @return array Array of messages + */ + public function importAllApps() + { + $message = array(); + + foreach( ipsRegistry::$applications as $app_dir => $app_data ) + { + $file = IPSLib::getAppDir( $app_dir ) . '/xml/' . $app_dir . '_settings.xml'; + + if ( is_file( $file ) ) + { + $contents = file_get_contents( $file ); + + $return = $this->_importXML( $contents, $app_dir ); + + $message[] = $app_data['app_title'] . " " . sprintf( $this->lang->words['s_upandin'], $return['updatedCount'], $return['insertedCount'] ); + + /* In dev time stamp? */ + if ( IN_DEV ) + { + $cache = $this->caches['indev']; + $cache['import']['settings'][ $app_dir ] = time(); + $this->cache->setCache( 'indev', $cache, array( 'donow' => 1, 'array' => 1 ) ); + } + } + } + + /* Check for settings not needed anymore */ + $this->_loadDeleteList(); + + return $message; + } + + /** + * Import XML Settings + * + * @param string XML Data + * @param string Application (should be set by XML file, however) + * @param array Array of any known settings and their values + * @return array array( 'insertedCount' => x, 'updatedCount' => x, 'updatedKeys' => array(..), 'insertedKeys' => array() ) + */ + protected function _importXML( $content, $app='core', $knownSettings=array() ) + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $cur_settings = array(); + $updated = 0; + $inserted = 0; + $updatedKeys = array(); + $insertedKeys = array(); + $known = array(); + + //----------------------------------------- + // Get current settings. + //----------------------------------------- + + $this->DB->build( array( 'select' => 'conf_id, conf_key', + 'from' => 'core_sys_conf_settings', + 'order' => 'conf_id' ) ); + + $this->DB->execute(); + + while ( $r = $this->DB->fetch() ) + { + $cur_settings[ $r['conf_key'] ] = $r['conf_id']; + } + + //----------------------------------------- + // Get current titles + //----------------------------------------- + + $this->_settingsGetGroups( true ); + + //----------------------------------------- + // Get xml class + //----------------------------------------- + + require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ + + $xml = new classXML( IPS_DOC_CHAR_SET ); + $xml->loadXML( $content ); + + //----------------------------------------- + // Loop through and sort out settings... + //----------------------------------------- + + foreach( $xml->fetchElements('setting') as $setting ) + { + $entry = $xml->fetchElementsFromRecord( $setting ); + + //----------------------------------------- + // Is setting? + //----------------------------------------- + + if ( ! $entry['conf_is_title'] ) + { + unset( $entry['conf_is_title'] ); + unset( $entry['conf_help_key'] ); + unset( $entry['conf_id'] ); + unset( $entry['conf_end_group'] ); + $new_settings[] = $entry; + } + + //----------------------------------------- + // Is title? + //----------------------------------------- + + else + { + $new_titles[] = $entry; + } + } + + //----------------------------------------- + // Sort out titles... + //----------------------------------------- + + if ( is_array( $new_titles ) and count( $new_titles ) ) + { + foreach( $new_titles as $idx => $data ) + { + if ( $data['conf_title_title'] AND $data['conf_title_keyword'] ) + { + //----------------------------------------- + // Get ID based on key + //----------------------------------------- + + $conf_id = $this->setting_groups_by_key[ $data['conf_title_keyword'] ]['conf_title_id']; + + $save = array( 'conf_title_title' => $data['conf_title_title'], + 'conf_title_desc' => $data['conf_title_desc'], + 'conf_title_keyword' => $data['conf_title_keyword'], + 'conf_title_tab' => $data['conf_title_tab'], + 'conf_title_app' => $data['conf_title_app'] ? $data['conf_title_app'] : $app, + 'conf_title_noshow' => $data['conf_title_noshow'] ); + + //----------------------------------------- + // Not got a row, insert first! + //----------------------------------------- + + if ( ! $conf_id ) + { + $this->DB->insert( 'core_sys_settings_titles', $save ); + $conf_id = $this->DB->getInsertId(); + + } + else + { + //----------------------------------------- + // Update... + //----------------------------------------- + + $this->DB->update( 'core_sys_settings_titles', $save, 'conf_title_id='.$conf_id ); + } + + //----------------------------------------- + // Update settings cache + //----------------------------------------- + + $save['conf_title_id'] = $conf_id; + $this->setting_groups_by_key[ $save['conf_title_keyword'] ] = $save; + $this->setting_groups[ $save['conf_title_id'] ] = $save; + + //----------------------------------------- + // Remove need update... + //----------------------------------------- + + $need_update[] = $conf_id; + } + } + } + + //----------------------------------------- + // Sort out settings + //----------------------------------------- + + if ( is_array( $new_settings ) and count( $new_settings ) ) + { + foreach( $new_settings as $idx => $data ) + { + //----------------------------------------- + // Insert known + //----------------------------------------- + + $data['conf_value'] = ''; + + if( is_array($knownSettings) AND count($knownSettings) ) + { + if ( ! $data['conf_value'] AND ( in_array( $data['conf_key'], array_keys( $knownSettings ) ) ) ) + { + $data['conf_value'] = $knownSettings[ $data['conf_key'] ]; + } + } + + $data['conf_group'] = $this->setting_groups_by_key[ $data['conf_title_keyword'] ]['conf_title_id']; + + //----------------------------------------- + // Remove from array + //----------------------------------------- + + unset( $data['conf_title_keyword'] ); + + if ( $cur_settings[ $data['conf_key'] ] ) + { + //----------------------------------------- + // Don't change the setting value + //----------------------------------------- + unset( $data['conf_value'] ); + + //----------------------------------------- + // Update + //----------------------------------------- + + $this->DB->update( 'core_sys_conf_settings', $data, 'conf_id='.$cur_settings[ $data['conf_key'] ] ); + $updatedKeys[] = $data['conf_key']; + $updated++; + } + else + { + //----------------------------------------- + // INSERT + //----------------------------------------- + + $this->DB->insert( 'core_sys_conf_settings', $data ); + $insertedKeys[] = $data['conf_key']; + $inserted++; + } + } + } + + //----------------------------------------- + // Update group counts... + //----------------------------------------- + + if ( count( $need_update ) ) + { + foreach( $need_update as $i => $idx ) + { + $conf = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'core_sys_conf_settings', 'where' => 'conf_group='.$idx ) ); + + $count = intval($conf['count']); + + $this->DB->update( 'core_sys_settings_titles', array( 'conf_title_count' => $count ), 'conf_title_id='.$idx ); + } + } + + //----------------------------------------- + // Resync + //----------------------------------------- + + $this->settingsRebuildCache(); + + //----------------------------------------- + // Return + //----------------------------------------- + + return array( 'insertedCount' => $inserted, + 'updatedCount' => $updated, + 'insertedKeys' => $insertedKeys, + 'updatedKeys' => $updatedKeys ); + } + + /** + * Export all apps: Wrapper function really. Yes. It is. + * + * @return array Array of messages or errors + */ + public function exportAllApps() + { + $messages = array(); + $errors = array(); + + /* Check for settings not needed anymore */ + $this->_loadDeleteList(); + + foreach( ipsRegistry::$applications as $app_dir => $app_data ) + { + @unlink( IPSLib::getAppDir( $app_dir ) . '/xml/' . $app_dir . '_settings.xml' ); + + if ( ! is_dir( IPSLib::getAppDir( $app_dir ) . '/xml' ) ) + { + $errors[] = "Error: " . IPSLib::getAppDir( $app_dir ) . "/xml/ does not exist"; + continue; + } + else if ( ! IPSLib::isWritable( IPSLib::getAppDir( $app_dir ) . '/xml' ) ) + { + if ( ! @chmod( IPSLib::isWritable( IPSLib::getAppDir( $app_dir ) . '/xml', 0755 ) ) ) + { + $errors[] = "Error: " . IPSLib::getAppDir( $app_dir ) . "/xml/ is not writeable"; + continue; + } + } + else if ( is_file( IPSLib::getAppDir( $app_dir ) . '/xml/' . $app_dir . '_settings.xml' ) AND ! IPSLib::isWritable( IPSLib::getAppDir( $app_dir ) . '/xml/' . $app_dir . '_settings.xml' ) ) + { + $errors[] = "Error: " . IPSLib::getAppDir( $app_dir ) . '/xml/' . $app_dir . "_settings.xml is not writeable"; + continue; + } + + $this->_exportXML( $app_dir ); + + $messages[] = $app_data['app_title'] . " Settings written into the application's XML directory"; + + /* In dev time stamp? */ + if ( IN_DEV ) + { + $cache = $this->caches['indev']; + $cache['import']['settings'][ $app_dir ] = time(); + $this->cache->setCache( 'indev', $cache, array( 'donow' => 1, 'array' => 1 ) ); + } + } + + return $errors ? $errors : $messages; + } + + + /** + * Export all settings to XML (IN_DEV mode) + * + * @param string Application directory + * @return boolean + */ + protected function _exportXML( $app_dir='core' ) + { + //----------------------------------------- + // Get setting groups + //----------------------------------------- + + $this->_settingsGetGroups( true ); + + //----------------------------------------- + // Get xml class + //----------------------------------------- + + require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/ + + $xml = new classXML( IPS_DOC_CHAR_SET ); + + $xml->newXMLDocument(); + $xml->addElement( 'settingexport' ); + $xml->addElement( 'settinggroup', 'settingexport' ); + + foreach( $this->setting_groups as $i => $roar ) + { + //----------------------------------------- + // App check? + //----------------------------------------- + + if ( $app_dir != $roar['conf_title_app'] ) + { + continue; + } + + //----------------------------------------- + // First, add in setting group title + //----------------------------------------- + + $thisconf = array( 'conf_is_title' => 1, + 'conf_title_keyword' => $roar['conf_title_keyword'], + 'conf_title_title' => $roar['conf_title_title'], + 'conf_title_desc' => $roar['conf_title_desc'], + 'conf_title_tab' => $roar['conf_title_tab'], + 'conf_title_app' => $roar['conf_title_app'] ? $roar['conf_title_app'] : $app_dir, + 'conf_title_noshow' => $roar['conf_title_noshow'] ); + + $xml->addElementAsRecord( 'settinggroup', 'setting', $thisconf ); + + //----------------------------------------- + // Get settings... + //----------------------------------------- + + $this->DB->build( array( 'select' => '*', + 'from' => 'core_sys_conf_settings', + 'where' => "conf_group='{$roar['conf_title_id']}'", + 'order' => 'conf_position, conf_title' ) ); + + $this->DB->execute(); + + while ( $r = $this->DB->fetch() ) + { + //----------------------------------------- + // Clean up... + //----------------------------------------- + + unset( $r['conf_value'], $r['conf_group'], $r['conf_id'] ); + + $r['conf_title_keyword'] = $roar['conf_title_keyword']; + $r['conf_is_title'] = 0; + + $xml->addElementAsRecord( 'settinggroup', 'setting', $r ); + } + } + + //----------------------------------------- + // Grab the XML document + //----------------------------------------- + + $xmlData = $xml->fetchDocument(); + + //----------------------------------------- + // Attempt to write... + //----------------------------------------- + + $file = IPSLib::getAppDir( $app_dir ) . '/xml/' . $app_dir . '_settings.xml'; + + @unlink( $file ); + @file_put_contents( $file, $xmlData ); + @chmod( $file, IPS_FOLDER_PERMISSION ); + } + + /** + * Load and parse settings delete list (IN_DEV) + * + * @return @e void + */ + protected function _loadDeleteList() + { + if ( IN_DEV ) + { + /* Check for group settings */ + if ( is_file( DOC_IPS_ROOT_PATH . '_deleteGroupSettings.txt' ) ) + { + $notTheseGroups = file( DOC_IPS_ROOT_PATH . '_deleteGroupSettings.txt' ); + + if ( count($notTheseGroups) ) + { + $notTheseGroups = array_map('trim', $notTheseGroups); + + $this->DB->build( array( 'select' => 'conf_title_id', 'from' => 'core_sys_settings_titles', 'where' => "conf_title_keyword IN ('" . implode("','", $notTheseGroups) . "')" ) ); + $this->DB->execute(); + + if ( $this->DB->getTotalRows() ) + { + $_deleteTheseGroups = array(); + + while( $s = $this->DB->fetch() ) + { + $_deleteTheseGroups[] = $s['conf_title_id']; + } + + if ( count($_deleteTheseGroups) ) + { + $this->DB->delete( 'core_sys_conf_settings', 'conf_group IN (' . implode(',', $_deleteTheseGroups) . ')' ); + $this->DB->delete( 'core_sys_settings_titles', "conf_title_keyword IN ('" . implode("','", $notTheseGroups) . "')" ); + } + } + } + } + + /* Check for single settings */ + if ( is_file( DOC_IPS_ROOT_PATH . '_deleteSettings.txt' ) ) + { + $notTheseSettings = file( DOC_IPS_ROOT_PATH . '_deleteSettings.txt' ); + + if ( count($notTheseSettings) ) + { + $notTheseSettings = array_map('trim', $notTheseSettings); + + $this->DB->delete( 'core_sys_conf_settings', "conf_key IN('" . implode( "','", $notTheseSettings ) . "')" ); + } + } + } + } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/settings/xml/index.html b/upload/admin/applications/core/modules_admin/settings/xml/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/settings/xml/index.html +++ b/upload/admin/applications/core/modules_admin/settings/xml/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/settings/xml/menu.xml b/upload/admin/applications/core/modules_admin/settings/xml/menu.xml index 48a60c75..9018c226 100644 --- a/upload/admin/applications/core/modules_admin/settings/xml/menu.xml +++ b/upload/admin/applications/core/modules_admin/settings/xml/menu.xml @@ -2,10 +2,10 @@ - Системные Настройки + System Settings - Системные Настройки + System Settings settings settings do=settingsview diff --git a/upload/admin/applications/core/modules_admin/settings/xml/permissions.xml b/upload/admin/applications/core/modules_admin/settings/xml/permissions.xml index 405a70de..ae15df60 100644 --- a/upload/admin/applications/core/modules_admin/settings/xml/permissions.xml +++ b/upload/admin/applications/core/modules_admin/settings/xml/permissions.xml @@ -1,16 +1,16 @@ - Настройки системы + Manage Settings core_settings settings_manage - Может изменять/добавлять группы настроек? + Can edit/add settings and setting groups? settings_delete - Может удалять группы настроек? + Can delete settings and setting groups? diff --git a/upload/admin/applications/core/modules_admin/sql/defaultSection.php b/upload/admin/applications/core/modules_admin/sql/defaultSection.php index 32c9d5e1..5c5d6e8c 100644 --- a/upload/admin/applications/core/modules_admin/sql/defaultSection.php +++ b/upload/admin/applications/core/modules_admin/sql/defaultSection.php @@ -7,7 +7,7 @@ * $Author: ips_terabyte $ * @since 20th February 2002 * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 8655 $ */ diff --git a/upload/admin/applications/core/modules_admin/sql/index.html b/upload/admin/applications/core/modules_admin/sql/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/sql/index.html +++ b/upload/admin/applications/core/modules_admin/sql/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/sql/mysql.php b/upload/admin/applications/core/modules_admin/sql/mysql.php index 7c75c3fe..d8ee1fee 100644 --- a/upload/admin/applications/core/modules_admin/sql/mysql.php +++ b/upload/admin/applications/core/modules_admin/sql/mysql.php @@ -3,18 +3,18 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * mySQL Admin
    - * Last Updated: $Date: 2013-01-23 21:10:55 -0500 (Wed, 23 Jan 2013) $
    + * Last Updated: $Date: 2013-10-14 17:55:18 -0400 (Mon, 14 Oct 2013) $
      * 
    * - * @author $Author: AndyMillne $ + * @author $Author: rashbrook $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @license http://www.invisionpower.com/company/standards.php#license * @package IP.Board * @subpackage Core * @link http://www.invisionpower.com - * @version $Rev: 11891 $ + * @version $Rev: 12377 $ */ if ( ! defined( 'IN_ACP' ) ) @@ -564,11 +564,11 @@ class admin_core_sql_toolbox_module extends ipsCommand { if( ! $this->request['notruncate'] OR strlen($r[ $fields[$i]->name ]) < 201 ) { - $row[] = nl2br( htmlspecialchars( wordwrap( $r[ $fields[$i]->name ] , 50, "\n", 1 ) ) ); + $row[] = nl2br( IPSText::htmlspecialchars( wordwrap( $r[ $fields[$i]->name ] , 50, "\n", 1 ) ) ); } else { - $row[] = htmlspecialchars( $r[ $fields[$i]->name ] ); + $row[] = IPSText::htmlspecialchars( $r[ $fields[$i]->name ] ); } } diff --git a/upload/admin/applications/core/modules_admin/sql/toolbox.php b/upload/admin/applications/core/modules_admin/sql/toolbox.php index aa556708..9206f0a5 100644 --- a/upload/admin/applications/core/modules_admin/sql/toolbox.php +++ b/upload/admin/applications/core/modules_admin/sql/toolbox.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * SQL Admin
      * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/modules_admin/sql/xml/index.html b/upload/admin/applications/core/modules_admin/sql/xml/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/sql/xml/index.html +++ b/upload/admin/applications/core/modules_admin/sql/xml/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/sql/xml/menu.xml b/upload/admin/applications/core/modules_admin/sql/xml/menu.xml index 2373455a..d2d84b6f 100644 --- a/upload/admin/applications/core/modules_admin/sql/xml/menu.xml +++ b/upload/admin/applications/core/modules_admin/sql/xml/menu.xml @@ -2,10 +2,10 @@ - Инструменты SQL + SQL Toolbox - Инструменты SQL + SQL Toolbox sql_toolbox toolbox do=overview @@ -15,10 +15,10 @@ - Резервное Копирование SQL + SQL Back Up - Резервное Копирование SQL + SQL Back Up sql_backup toolbox do=backup @@ -28,10 +28,10 @@ - Состояние SQL-сервера + SQL Runtime Info - Состояние SQL-сервера + SQL Runtime Info sql_ri toolbox do=runtime @@ -54,10 +54,10 @@ - SQL-процессы + SQL Processes - SQL-процессы + SQL Processes sql_processes toolbox do=processes diff --git a/upload/admin/applications/core/modules_admin/system/charts.php b/upload/admin/applications/core/modules_admin/system/charts.php index cd30b37d..4160f181 100644 --- a/upload/admin/applications/core/modules_admin/system/charts.php +++ b/upload/admin/applications/core/modules_admin/system/charts.php @@ -7,7 +7,7 @@ * $Author: bfarber $ * @since - * $LastChangedDate: 2011-11-23 14:13:15 -0500 (Wed, 23 Nov 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 9873 $ */ diff --git a/upload/admin/applications/core/modules_admin/system/defaultSection.php b/upload/admin/applications/core/modules_admin/system/defaultSection.php index a1a950c0..66673005 100644 --- a/upload/admin/applications/core/modules_admin/system/defaultSection.php +++ b/upload/admin/applications/core/modules_admin/system/defaultSection.php @@ -7,7 +7,7 @@ * $Author: ips_terabyte $ * @since 20th February 2002 * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 8655 $ */ diff --git a/upload/admin/applications/core/modules_admin/system/index.html b/upload/admin/applications/core/modules_admin/system/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/system/index.html +++ b/upload/admin/applications/core/modules_admin/system/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/system/security.php b/upload/admin/applications/core/modules_admin/system/security.php index aecc8414..e6f8de1f 100644 --- a/upload/admin/applications/core/modules_admin/system/security.php +++ b/upload/admin/applications/core/modules_admin/system/security.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Security center tools
      * Last Updated: $Date: 2012-11-29 16:02:25 -0500 (Thu, 29 Nov 2012) $
      * 
    @@ -317,7 +317,7 @@ class admin_core_system_security extends ipsCommand $content['bad'] .= $this->html->security_item_bad( $this->lang->words['s_functions'], sprintf( $this->lang->words['s_functions_bad'], implode( ', ', $functionsToDisable ) ), $this->lang->words['s_learnmore'], - 'http://external.ipslink.com/ipboard30/landing/?p=security', + 'http://anonym.to/?http://external.ipslink.com/ipboard30/landing/?p=security', 'functions' ); } else @@ -325,7 +325,7 @@ class admin_core_system_security extends ipsCommand $content['good'] .= $this->html->security_item_good($this->lang->words['s_functions'], $this->lang->words['s_functions_good'], $this->lang->words['s_learnmore'], - 'http://external.ipslink.com/ipboard30/landing/?p=security', + 'http://anonym.to/?http://external.ipslink.com/ipboard30/landing/?p=security', 'functions' ); } @@ -336,7 +336,7 @@ class admin_core_system_security extends ipsCommand $content['bad'] .= $this->html->security_item_bad( $this->lang->words['s_open_basedir'], $this->lang->words['s_open_basedir_bad'], $this->lang->words['s_learnmore'], - 'http://external.ipslink.com/ipboard30/landing/?p=security', + 'http://anonym.to/?http://external.ipslink.com/ipboard30/landing/?p=security', 'open_basedir' ); } else @@ -346,7 +346,7 @@ class admin_core_system_security extends ipsCommand $content['good'] .= $this->html->security_item_good( $this->lang->words['s_open_basedir'], $value ? sprintf( $this->lang->words['s_open_basedir_good'], $value ) : $this->lang->words['s_open_basedir_good_noval'], $this->lang->words['s_learnmore'], - 'http://external.ipslink.com/ipboard30/landing/?p=security', + 'http://anonym.to/?http://external.ipslink.com/ipboard30/landing/?p=security', 'open_basedir' ); } diff --git a/upload/admin/applications/core/modules_admin/system/taskmanager.php b/upload/admin/applications/core/modules_admin/system/taskmanager.php index 08a95076..e5627e3a 100644 --- a/upload/admin/applications/core/modules_admin/system/taskmanager.php +++ b/upload/admin/applications/core/modules_admin/system/taskmanager.php @@ -6,7 +6,7 @@ * $License: http://www.invisionpower.com/company/standards.php#license$ * $Author: ips_terabyte $ * $LastChangedDate: 2012-03-26 12:16:52 -0400 (Mon, 26 Mar 2012) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 10490 $ */ diff --git a/upload/admin/applications/core/modules_admin/system/xml/index.html b/upload/admin/applications/core/modules_admin/system/xml/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/system/xml/index.html +++ b/upload/admin/applications/core/modules_admin/system/xml/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/system/xml/menu.xml b/upload/admin/applications/core/modules_admin/system/xml/menu.xml index d73c8bf5..d5159cf8 100644 --- a/upload/admin/applications/core/modules_admin/system/xml/menu.xml +++ b/upload/admin/applications/core/modules_admin/system/xml/menu.xml @@ -2,10 +2,10 @@ - Планировщик Задач + System Scheduler - Планировщик Задач + System Scheduler taskmanager taskmanager do=overview @@ -15,10 +15,10 @@ - Центр Безопасности + Security Center - Центр Безопасности + Security Center security security @@ -28,10 +28,10 @@ - Список Администраторов + List Admins - Список Администраторов + List Admins listadmins security do=list_admins diff --git a/upload/admin/applications/core/modules_admin/system/xml/permissions.xml b/upload/admin/applications/core/modules_admin/system/xml/permissions.xml index 212e8de0..66dbb838 100644 --- a/upload/admin/applications/core/modules_admin/system/xml/permissions.xml +++ b/upload/admin/applications/core/modules_admin/system/xml/permissions.xml @@ -1,70 +1,70 @@ - Центр безопасности + Security Center core_security security_center - Может просматривать центр безопасности? + Can view the Security Center? acplink_remove - Может удалить ссылку на АЦ? + Remove the ACP Link? deepscan - Может запустить глубокое сканирование на подозрительные файлы? + Perform a deepscan for suspicious files? virus_checker - Может запустить обычное сканирование на подозрительные файлы? + Run the virus-checker scanner? list_admins - Может просматривать список пользователей, имеющих доступ в АЦ? + List members with administrative access? htaccess_protection - Может создать .htaccess для защиты директорий? + Create a .htaccess to protect writable directories? nowrite_conf_global - Может сделать conf_global.php незаписываемым? + Make conf_global.php not writable? acp_rename - Может переименовать директорию АЦ? + Rename the ACP directory? acp_htaccess - Может создать .htaccess для защиты АЦ? + Create a .htaccess to protect the ACP? - Управление задачами планировщика + Manage Scheduled Tasks core_tasks task_manage - Может добавлять/изменять задачи? + Can manage scheduled tasks? task_remove - Может удалять задачи? + Can remove scheduled tasks? task_run_lock - Может блокировать выполнение задач или запускать задачи вручную? + Can unlock and/or run scheduled tasks manually? tasklogs_view - Может просматривать журнал задач? + Can view task logs? tasklogs_delete - Может удалять записи из журнала? + Can remove task logs? diff --git a/upload/admin/applications/core/modules_admin/templates/defaultSection.php b/upload/admin/applications/core/modules_admin/templates/defaultSection.php index 3cd643b4..628594ae 100644 --- a/upload/admin/applications/core/modules_admin/templates/defaultSection.php +++ b/upload/admin/applications/core/modules_admin/templates/defaultSection.php @@ -7,7 +7,7 @@ * $Author: ips_terabyte $ * @since 20th February 2002 * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 8655 $ */ diff --git a/upload/admin/applications/core/modules_admin/templates/easylogo.php b/upload/admin/applications/core/modules_admin/templates/easylogo.php index b8f7359e..24d69d8e 100644 --- a/upload/admin/applications/core/modules_admin/templates/easylogo.php +++ b/upload/admin/applications/core/modules_admin/templates/easylogo.php @@ -3,19 +3,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Easy Logo Changer
    - * Last Updated: $Date: 2012-10-11 17:27:04 -0400 (Thu, 11 Oct 2012) $
    + * Last Updated: $Date: 2013-10-15 10:55:14 -0400 (Tue, 15 Oct 2013) $
      * 
    * - * @author $Author: bfarber $ + * @author $Author: rashbrook $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @license http://www.invisionpower.com/company/standards.php#license * @package IP.Board * @subpackage Core * @link http://www.invisionpower.com * @since Tuesday 17th August 2004 - * @version $Revision: 11446 $ + * @version $Revision: 12379 $ * */ @@ -181,11 +181,16 @@ class admin_core_templates_easylogo extends ipsCommand else { $this->registry->output->global_message = $this->lang->words['el_chmod']; - $this->start(); + $this->splash(); return; } - $newlogo = "{$this->settings['public_dir']}style_images/{$this->request['skin']}_" . urlencode($FILE_NAME); + /** + * @see http://community.invisionpower.com/resources/bugs.html/_/ip-board/https-and-easy-logo-changer-r37285 + */ + $publicDir = str_replace( array( 'http:', 'https:' ), '', $this->settings['public_dir'] ); + + $newlogo = "{$publicDir}style_images/{$this->request['skin']}_" . urlencode($FILE_NAME); } //----------------------------------------- diff --git a/upload/admin/applications/core/modules_admin/templates/external.php b/upload/admin/applications/core/modules_admin/templates/external.php index c08e339d..fbdb82dc 100644 --- a/upload/admin/applications/core/modules_admin/templates/external.php +++ b/upload/admin/applications/core/modules_admin/templates/external.php @@ -3,7 +3,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Externally edit templates and css
      * Last Updated: $Date: 2011-05-05 12:03:47 +0100 (Thu, 05 May 2011) $
      * 
    diff --git a/upload/admin/applications/core/modules_admin/templates/importexport.php b/upload/admin/applications/core/modules_admin/templates/importexport.php index 4bffe43c..05d656b6 100644 --- a/upload/admin/applications/core/modules_admin/templates/importexport.php +++ b/upload/admin/applications/core/modules_admin/templates/importexport.php @@ -3,7 +3,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Import and export skin sets
      * Last Updated: $Date: 2012-05-11 06:56:52 -0400 (Fri, 11 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/modules_admin/templates/index.html b/upload/admin/applications/core/modules_admin/templates/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/templates/index.html +++ b/upload/admin/applications/core/modules_admin/templates/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/templates/replacements.php b/upload/admin/applications/core/modules_admin/templates/replacements.php index dd3768f3..17be37a5 100644 --- a/upload/admin/applications/core/modules_admin/templates/replacements.php +++ b/upload/admin/applications/core/modules_admin/templates/replacements.php @@ -3,7 +3,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Macros/replacements
      * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/modules_admin/templates/searchandreplace.php b/upload/admin/applications/core/modules_admin/templates/searchandreplace.php index fdbcb20d..6abca9c0 100644 --- a/upload/admin/applications/core/modules_admin/templates/searchandreplace.php +++ b/upload/admin/applications/core/modules_admin/templates/searchandreplace.php @@ -3,7 +3,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Skin search and replace tool
      * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/modules_admin/templates/skindiff.php b/upload/admin/applications/core/modules_admin/templates/skindiff.php index 259a0deb..87649245 100644 --- a/upload/admin/applications/core/modules_admin/templates/skindiff.php +++ b/upload/admin/applications/core/modules_admin/templates/skindiff.php @@ -3,7 +3,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Skin diff report tools
      * Last Updated: $Date: 2012-08-15 10:33:53 -0400 (Wed, 15 Aug 2012) $
      * 
    diff --git a/upload/admin/applications/core/modules_admin/templates/skinsets.php b/upload/admin/applications/core/modules_admin/templates/skinsets.php index 81ea389b..14f26200 100644 --- a/upload/admin/applications/core/modules_admin/templates/skinsets.php +++ b/upload/admin/applications/core/modules_admin/templates/skinsets.php @@ -3,7 +3,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Skin set management
      * Last Updated: $Date: 2013-01-15 15:27:53 -0500 (Tue, 15 Jan 2013) $
      * 
    @@ -1056,18 +1056,11 @@ class admin_core_templates_skinsets extends ipsCommand } } - //----------------------------------------- - // Is the skin generator supported? - //----------------------------------------- - - $licenseData = $this->cache->getCache('licenseData'); - $skinGenIsSupported = (bool) $licenseData['skinGen']; - //----------------------------------------- // Print it... //----------------------------------------- - $this->registry->output->html .= $this->html->skinsets_listSkinSets( $sets, $cacheData, $hasData, $canMerge, $skinGenSessions, $html, $skinGenIsSupported ); + $this->registry->output->html .= $this->html->skinsets_listSkinSets( $sets, $cacheData, $hasData, $canMerge, $skinGenSessions, $html, true ); } /** diff --git a/upload/admin/applications/core/modules_admin/templates/systemTemplates.php b/upload/admin/applications/core/modules_admin/templates/systemTemplates.php index d4261772..aac20dc7 100644 --- a/upload/admin/applications/core/modules_admin/templates/systemTemplates.php +++ b/upload/admin/applications/core/modules_admin/templates/systemTemplates.php @@ -3,7 +3,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Manage System Templates
      * Last Updated: $Date: 2011-05-05 12:03:47 +0100 (Thu, 05 May 2011) $
      * 
    diff --git a/upload/admin/applications/core/modules_admin/templates/templates.php b/upload/admin/applications/core/modules_admin/templates/templates.php index 5cd63382..d269e7f6 100644 --- a/upload/admin/applications/core/modules_admin/templates/templates.php +++ b/upload/admin/applications/core/modules_admin/templates/templates.php @@ -3,7 +3,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Template editing
      * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/modules_admin/templates/tools.php b/upload/admin/applications/core/modules_admin/templates/tools.php index 341be1c5..171c5d51 100644 --- a/upload/admin/applications/core/modules_admin/templates/tools.php +++ b/upload/admin/applications/core/modules_admin/templates/tools.php @@ -3,7 +3,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Skin tools
      * Last Updated: $Date: 2012-08-15 10:33:53 -0400 (Wed, 15 Aug 2012) $
      * 
    diff --git a/upload/admin/applications/core/modules_admin/templates/urlmap.php b/upload/admin/applications/core/modules_admin/templates/urlmap.php index 71b8f2ef..988dff11 100644 --- a/upload/admin/applications/core/modules_admin/templates/urlmap.php +++ b/upload/admin/applications/core/modules_admin/templates/urlmap.php @@ -3,7 +3,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Skin URL mapping
      * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/modules_admin/templates/useragents.php b/upload/admin/applications/core/modules_admin/templates/useragents.php index b5e2d08e..7ed35648 100644 --- a/upload/admin/applications/core/modules_admin/templates/useragents.php +++ b/upload/admin/applications/core/modules_admin/templates/useragents.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Gallery Application
      * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/modules_admin/templates/xml/index.html b/upload/admin/applications/core/modules_admin/templates/xml/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/templates/xml/index.html +++ b/upload/admin/applications/core/modules_admin/templates/xml/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/templates/xml/menu.xml b/upload/admin/applications/core/modules_admin/templates/xml/menu.xml index 196d879e..8119028b 100644 --- a/upload/admin/applications/core/modules_admin/templates/xml/menu.xml +++ b/upload/admin/applications/core/modules_admin/templates/xml/menu.xml @@ -2,10 +2,10 @@ - Управление Стилями + Manage Skin Sets & Templates - Управление Стилями + Manage Skin Sets & Templates skins_manage skinsets do=overview @@ -15,10 +15,10 @@ - Управление Мета-тэгами + Manage Meta Tags - Управление Мета-тэгами + Manage Meta Tags skins_meta meta @@ -28,10 +28,10 @@ - Управление Системными Шаблонами + Manage System Templates - Управление Системными Шаблонами + Manage System Templates skins_systemtemplates systemTemplates @@ -41,10 +41,10 @@ - Инструменты Стилей + Template Tools - Инструменты Стилей + Template Tools skins_tools tools do=splash @@ -54,10 +54,10 @@ - Слияние Стилей + Template Merge Center - Слияние Стилей + Template Merge Center skins_merge skindiff do=overview @@ -67,10 +67,10 @@ - Поиск и Замена + Search and Replace - Поиск и Замена + Search and Replace skins_sar searchandreplace do=showform @@ -80,10 +80,10 @@ - Смена Логотипа + Easy Logo Changer - Смена Логотипа + Easy Logo Changer skins_logo easylogo @@ -93,10 +93,10 @@ - Импорт / Экспорт + Import / Export - Импорт / Экспорт + Import / Export skins_ie importexport do=overview @@ -106,10 +106,10 @@ - Внешнее Редактирование Шаблонов и CSS + Externally Edit Templates & CSS - Внешнее Редактирование Шаблонов и CSS + Externally Edit Templates & CSS skins_external external do=overview diff --git a/upload/admin/applications/core/modules_admin/templates/xml/permissions.xml b/upload/admin/applications/core/modules_admin/templates/xml/permissions.xml index 07be0f78..59a326e0 100644 --- a/upload/admin/applications/core/modules_admin/templates/xml/permissions.xml +++ b/upload/admin/applications/core/modules_admin/templates/xml/permissions.xml @@ -1,84 +1,84 @@ - Управление стилями + Manage Templates core_templates settemplates_manage - Может просматривать и управлять стилями? + Can view and manage skins? settemplates_delete - Может удалять стили? + Can remove skins? templates_manage - Может добавлять/изменять шаблоны? + Can manage templates? templates_delete - Может сбрасывать изменения или полностью удалять шаблоны? + Can remove and revert templates? css_manage - Может изменять/добавлять CSS? + Can edit/add CSS? css_delete - Может сбрасывать изменения или полностью удалять CSS? + Can remove and revert CSS? replacements_manage - Может добавлять/изменять макросы? + Can add/edit macro replacements? replacements_delete - Может сбрасывать изменения или полностью удалять макросы? + Can remove and revert macro replacements? settemplates_export - Может экспортировать стили? + Can export skins? settemplates_meta - Может управлять мета-тэгами? + Can manage meta tags? systemtemplates - Может управлять системными шаблонами? + Can view and manage system templates? template_tools - Может запускать инструменты стилей? + Can run the various skin system tools? skindiff_reports - Может запускать инструмент сравнения стилей? + Can use the Template Merge Center? url_map_manage - Может управлять URL-переназначениями стилей? + Can add/edit skin url mappings? url_map_delete - Может удалять URL-переназначения? + Can remove skin url mappings? useragent_skin_map - Может управлять переназначениями по useragent? + Can manage useragent skin mappings? easy_logo - Может воспользоваться инструментом смены логотипа? + Can use the easy logo changer? settemplates_external - Может включить/выключить внешнее редактирование стилей? + Can enable/disable external skin editing? settemplates_external_edit - Может использовать внешнее редактирование стилей? + Can edit skins externally? diff --git a/upload/admin/applications/core/modules_admin/tools/api.php b/upload/admin/applications/core/modules_admin/tools/api.php index b63d9148..b34012ee 100644 --- a/upload/admin/applications/core/modules_admin/tools/api.php +++ b/upload/admin/applications/core/modules_admin/tools/api.php @@ -3,7 +3,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * API Users
      * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/modules_admin/tools/cache.php b/upload/admin/applications/core/modules_admin/tools/cache.php index 78aaeb96..77be47b0 100644 --- a/upload/admin/applications/core/modules_admin/tools/cache.php +++ b/upload/admin/applications/core/modules_admin/tools/cache.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * ACP : Cache management
      * Last Updated: $Date: 2012-11-19 13:33:07 -0500 (Mon, 19 Nov 2012) $
      * 
    diff --git a/upload/admin/applications/core/modules_admin/tools/defaultSection.php b/upload/admin/applications/core/modules_admin/tools/defaultSection.php index db979bfd..fa5e24c9 100644 --- a/upload/admin/applications/core/modules_admin/tools/defaultSection.php +++ b/upload/admin/applications/core/modules_admin/tools/defaultSection.php @@ -7,7 +7,7 @@ * $Author: bfarber $ * @since 20th February 2002 * $LastChangedDate: 2011-08-05 20:51:01 -0400 (Fri, 05 Aug 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 9373 $ */ diff --git a/upload/admin/applications/core/modules_admin/tools/help.php b/upload/admin/applications/core/modules_admin/tools/help.php index 27f9b3f3..9db79d0f 100644 --- a/upload/admin/applications/core/modules_admin/tools/help.php +++ b/upload/admin/applications/core/modules_admin/tools/help.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Help Files
      * Last Updated: $LastChangedDate: 2012-12-17 12:34:52 -0500 (Mon, 17 Dec 2012) $
      * 
    diff --git a/upload/admin/applications/core/modules_admin/tools/incomingEmails.php b/upload/admin/applications/core/modules_admin/tools/incomingEmails.php index 5d654abd..fa09349d 100644 --- a/upload/admin/applications/core/modules_admin/tools/incomingEmails.php +++ b/upload/admin/applications/core/modules_admin/tools/incomingEmails.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Incoming Email Routing
      * Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/modules_admin/tools/index.html b/upload/admin/applications/core/modules_admin/tools/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/tools/index.html +++ b/upload/admin/applications/core/modules_admin/tools/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/tools/licensekey.php b/upload/admin/applications/core/modules_admin/tools/licensekey.php index 1ce430b0..aec09744 100644 --- a/upload/admin/applications/core/modules_admin/tools/licensekey.php +++ b/upload/admin/applications/core/modules_admin/tools/licensekey.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * License Manager
      * Last Updated: $LastChangedDate: 2013-05-28 10:00:25 -0400 (Tue, 28 May 2013) $
      * 
    @@ -86,31 +86,6 @@ class admin_core_tools_licensekey extends ipsCommand */ protected function activate() { - /* Fetch data */ - $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' ); - $classFileManagement = new $classToLoad(); - - $response = $classFileManagement->getFileContents( "http://license.invisionpower.com/?a=activate&key={$this->request['license_key']}&url={$this->settings['board_url']}" ); - - /* Is the key invalid? */ - if ( !$response ) - { - return $this->activateForm( $this->lang->words['license_key_server_error'] ); - } - if( $response == 'NO_KEY' ) - { - return $this->activateForm( $this->lang->words['license_key_notfound'] ); - } - elseif ( $response == 'TEST_INSTALL_ALREADY_ACTIVE' ) - { - return $this->activateForm( $this->lang->words['license_key_test_in_use'] ); - } - $response = @json_decode( $response, true ); - if( !isset( $response['result'] ) or $response['result'] != 'ok' ) - { - return $this->activateForm( $this->lang->words['license_key_bad'] ); - } - IPSLib::updateSettings( array( 'ipb_reg_number' => $this->request['license_key'] ) ); $this->settings['ipb_reg_number'] = $this->request['license_key']; $this->recache(); @@ -130,12 +105,8 @@ class admin_core_tools_licensekey extends ipsCommand * Recache License Data */ public function recache() - { - /* Save */ - $licenseData = darkLAE::getLicenseData(); - $licenseData['_cached_date'] = time(); - $licenseData['key']['_expires'] = $licenseData['key']['_expires'] ? $licenseData['key']['_expires'] : 9999999999; - $licenseData['key']['expires'] = $licenseData['key']['expires'] ? $licenseData['key']['expires'] : 9999999999; - $this->cache->setCache( 'licenseData', $licenseData, array( 'array' => 1 ) ); + { + $this->cache->setCache( 'licenseData', array(), array( 'array' => 1 ) ); + return; } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/tools/login.php b/upload/admin/applications/core/modules_admin/tools/login.php index 2b7d4d0d..52ff6d9b 100644 --- a/upload/admin/applications/core/modules_admin/tools/login.php +++ b/upload/admin/applications/core/modules_admin/tools/login.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Login Manager Administration
      * Last Updated: $Date: 2013-05-03 23:09:37 -0400 (Fri, 03 May 2013) $
      * 
    diff --git a/upload/admin/applications/core/modules_admin/tools/logsSplash.php b/upload/admin/applications/core/modules_admin/tools/logsSplash.php index eee2c5e7..2620aefb 100644 --- a/upload/admin/applications/core/modules_admin/tools/logsSplash.php +++ b/upload/admin/applications/core/modules_admin/tools/logsSplash.php @@ -3,7 +3,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Log Splash Screen
      * Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/modules_admin/tools/performance.php b/upload/admin/applications/core/modules_admin/tools/performance.php index 8d0843a5..deaf266c 100644 --- a/upload/admin/applications/core/modules_admin/tools/performance.php +++ b/upload/admin/applications/core/modules_admin/tools/performance.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Toggle performance mode on/off
      * Last Updated: $LastChangedDate: 2012-05-22 13:10:11 -0400 (Tue, 22 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/modules_admin/tools/qanda.php b/upload/admin/applications/core/modules_admin/tools/qanda.php index 7bf08644..1fe9583e 100644 --- a/upload/admin/applications/core/modules_admin/tools/qanda.php +++ b/upload/admin/applications/core/modules_admin/tools/qanda.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Registration question and answer challenges
      * Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/modules_admin/tools/rebuild.php b/upload/admin/applications/core/modules_admin/tools/rebuild.php index 0b26b880..90069e1a 100644 --- a/upload/admin/applications/core/modules_admin/tools/rebuild.php +++ b/upload/admin/applications/core/modules_admin/tools/rebuild.php @@ -1,3063 +1,3050 @@ - - * Invision Power Services - * IP.Board v3.4.5 - * Rebuild & Other Tools - * Last Updated: $LastChangedDate: 2013-05-06 17:14:06 -0400 (Mon, 06 May 2013) $ - * - * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/company/standards.php#license - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 12230 $ - */ - -if ( ! defined( 'IN_ACP' ) ) -{ - print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; - exit(); -} - -class admin_core_tools_rebuild extends ipsCommand -{ - /** - * Skin object - * - * @var object Skin templates - */ - protected $html; - - /**#@+ - * URL bits - * - * @var string - */ - public $form_code = ''; - public $form_code_js = ''; - /**#@-*/ - - /** - * Main class entry point - * - * @param object ipsRegistry reference - * @return @e void [Outputs to screen] - */ - public function doExecute( ipsRegistry $registry ) - { - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'applications/forums/sources/classes/forums/class_forums.php', 'class_forums', 'forums' ); - $this->registry->setClass( 'class_forums', new $classToLoad( $registry ) ); - $this->registry->class_forums->forumsInit(); - - /* Load lang and skin */ - $this->registry->class_localization->loadLanguageFile( array( 'admin_tools' ) ); - $this->html = $this->registry->output->loadTemplate( 'cp_skin_rebuild' ); - - /* URLs */ - $this->form_code = $this->html->form_code = 'module=tools&section=rebuild'; - $this->form_code_js = $this->html->form_code_js = 'module=tools§ion=rebuild'; - - /* What to do */ - switch( $this->request['do'] ) - { - case 'docount': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_recount' ); - $this->doCount(); - break; - - case 'doresyncforums': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_resynch' ); - $this->resyncForums(); - break; - - case 'doresynctopics': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_resyncht' ); - $this->resyncTopics(); - break; - - case 'doposts': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_rebuild' ); - $this->rebuildPosts(); - break; - - case 'dopostnames': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_postcounts' ); - $this->rebuildPostNames(); - break; - - case 'dopostcounts': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_postcounts' ); - $this->rebuildPostCount(); - break; - - case 'doreputationcount': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_postcounts' ); - $this->rebuildReputationCount(); - break; - - case 'dothumbnails': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_thumbs' ); - $this->rebuildThumbnails(); - break; - - case 'dophotos': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_thumbs' ); - $this->rebuildPhotos(); - break; - - case 'doattachdata': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_attach' ); - $this->rebuildAttachdata(); - break; - - case 'doseousernames': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_rebuild' ); - $this->rebuildSeoUserNames(); - break; - case 'cleanattachments': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_orphaned' ); - $this->cleanAttachments(); - break; - - case 'cleanphotos': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_orphanp' ); - $this->cleanPhotos(); - break; - - case 'domsgcounts': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_postcounts' ); - $this->rebuildMsgCounts(); - break; - - //----------------------------------------- - // Tools - //----------------------------------------- - - case '320photos': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'cleanup_manage' ); - $this->tools320Photos(); - break; - - case '300pms': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'cleanup_manage' ); - $this->tools300Pms(); - break; - - case '220tool_contacts': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'cleanup_manage' ); - $this->tools220Contacts(); - break; - - case '210polls': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'cleanup_manage' ); - $this->tools210Polls(); - break; - - case '210calevents': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'cleanup_manage' ); - $this->tools210Calevents(); - break; - - case '210tool_settings': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'cleanup_manage' ); - $this->tools210DupeSettings(); - break; - - case 'tool_settings': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'cleanup_manage' ); - $this->toolsDupeSettings(); - break; - - case 'tool_converge': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'cleanup_manage' ); - $this->toolsConverge(); - break; - - case 'tool_bansettings': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'cleanup_manage' ); - $this->toolBanSettings(); - break; - - case 'tools': - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'cleanup_manage' ); - $this->toolsSplashScreen(); - break; - - case 'rebuild_overview': - default: - $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'rebuild_manage' ); - $this->rebuildSplashScreen(); - break; - } - - /* Output */ - $this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper(); - $this->registry->output->sendOutput(); - } - - /** - * 3.2.x Tools: Convert photos - * - * @return @e void - */ - public function tools320photos() - { - /* INIT */ - $convertFrom = $this->request['from'] == 'avatars' ? 'avatars' : 'photos'; - $st = intval($this->request['st']); - $did = 0; - $each = 200; - - /* Photo library */ - require_once( IPS_ROOT_PATH . 'sources/classes/member/photo.php' );/*noLibHook*/ - $photo = new classes_member_photo( $this->registry ); - - /* Loop over members */ - $this->DB->build( array( 'select' => '*', 'from' => 'profile_portal', 'order' => 'pp_member_id ASC', 'limit' => array( $st, $each ) ) ); - $outer = $this->DB->execute(); - - while( $r = $this->DB->fetch($outer) ) - { - $did++; - - $update = array(); - - if( $r['fb_photo'] ) - { - $update['pp_photo_type'] = 'facebook'; - } - else if( $r['tc_photo'] ) - { - $update['pp_photo_type'] = 'twitter'; - } - else if( $r['vc_photo'] ) - { - $update['pp_photo_type'] = 'vkontakte'; - } - - else - { - if( $convertFrom == 'avatars' ) - { - if( $r['avatar_type'] == 'upload' AND $r['avatar_location'] ) - { - $update['pp_photo_type'] = 'custom'; - $update['pp_main_photo'] = $r['avatar_location']; - $_dims = @getimagesize( $this->settings['upload_dir'] . '/' . $r['avatar_location'] ); - $update['pp_main_width'] = $_dims[0]; - $update['pp_main_height'] = $_dims[1]; - } - else if( $r['avatar_type'] == 'gravatar' ) - { - $update['pp_photo_type'] = 'gravatar'; - $update['pp_gravatar'] = $r['avatar_location']; - - $md5Gravatar = md5( $update['pp_gravatar'] ); - - $_url = "http://www.gravatar.com"; - - if( $this->registry->output->isHTTPS ) - { - $_url = "https://secure.gravatar.com"; - } - - $update['pp_main_photo'] = $_url . "/avatar/" .$md5Gravatar . "?s=100"; - $update['pp_main_width'] = 100; - $update['pp_main_height'] = 100; - $update['pp_thumb_photo'] = $_url . "/avatar/" .$md5Gravatar . "?s=100"; - $update['pp_thumb_width'] = 100; - $update['pp_thumb_height'] = 100; - } - } - else - { - if( $r['pp_main_photo'] ) - { - $update['pp_photo_type'] = 'custom'; - $update['pp_main_photo'] = $r['pp_main_photo']; - } - } - } - - if( $update['pp_photo_type'] == 'custom' ) - { - $info = $photo->buildSizedPhotos( str_replace( 'upload:', '', $update['pp_main_photo'] ), $r['pp_member_id'], true ); - - $update['pp_main_width'] = intval( $info['final_width'] ); - $update['pp_main_height'] = intval( $info['final_height'] ); - $update['pp_thumb_photo'] = $info['t_final_location'] ? $info['t_final_location'] : $info['final_location']; - $update['pp_thumb_width'] = intval( $info['t_final_width'] ); - $update['pp_thumb_height'] = intval( $info['t_final_height'] ); - } - - if( count($update) ) - { - $this->DB->update( 'profile_portal', $update, 'pp_member_id=' . $r['pp_member_id'] ); - } - } - - /* Show message and redirect */ - if( $did > 0 ) - { - $this->request['st'] = ( $st + $did ); - - $url = "{$this->settings['base_url']}{$this->form_code}&do=" . $this->request['do'] . '&from=' . $this->request['from'] . '&st=' . $this->request['st']; - - $this->_specialRedirect( $url, sprintf( $this->lang->words['tools320photos'], $this->request['st'], $did ) ); - } - else - { - $this->registry->output->redirect( $this->settings['base_url'] . $this->form_code . '&do=tools', $this->lang->words['re_photosconverted'] ); - } - } - - /** - * 3.0.x Tools: PM Conversion - * - * @return @e void - */ - public function tools300pms() - { - /* INIT */ - $pergo = 100; - $start = intval( $this->request['st'] ); - $converted = 0; - $seen = 0; - - //----------------------------------------- - // Check to make sure table exists - //----------------------------------------- - - if ( ! $this->DB->checkForTable( 'message_text' ) ) - { - $this->registry->output->global_message = $this->lang->words['re_msgsconverted']; - $this->toolsSplashScreen(); - return; - } - - - /* Select max topic ID thus far */ - $_tmp = $this->DB->buildAndFetch( array( 'select' => 'MAX(mt_id) as max', - 'from' => 'message_topics' ) ); - - $topicID = intval( $_tmp['max'] ); - - $this->DB->build( array( 'select' => '*', - 'from' => 'message_text', - 'order' => 'msg_id ASC', - 'limit' => array( $start, $pergo ) ) ); - - $o = $this->DB->execute(); - - while( $post = $this->DB->fetch( $o ) ) - { - $seen++; - - /* Make sure all data is valid */ - if ( intval( $post['msg_sent_to_count'] ) < 1 ) - { - continue; - } - - /* a little set up */ - $oldTopics = array(); - - /* Now fetch all topics */ - $this->DB->build( array( 'select' => '*', - 'from' => 'message_topics_old', - 'where' => 'mt_msg_id=' . intval( $post['msg_id'] ) ) ); - - $t = $this->DB->execute(); - - while( $topic = $this->DB->fetch( $t ) ) - { - /* Got any data? */ - if ( ! $topic['mt_from_id'] OR ! $topic['mt_to_id'] ) - { - continue; - } - - $oldTopics[ $topic['mt_id'] ] = $topic; - } - - /* Fail safe */ - if ( ! count( $oldTopics ) ) - { - continue; - } - - /* Increment number */ - $topicID++; - - /* Add in the post */ - $this->DB->insert( 'message_posts', array( 'msg_topic_id' => $topicID, - 'msg_date' => $post['msg_date'], - 'msg_post' => $post['msg_post'], - 'msg_post_key' => $post['msg_post_key'], - 'msg_author_id' => $post['msg_author_id'], - 'msg_ip_address' => $post['msg_ip_address'], - 'msg_is_first_post' => 1 ) ); - $postID = $this->DB->getInsertId(); - - /* Update attachments */ - $this->DB->update( 'attachments', array( 'attach_rel_id' => $postID ), "attach_rel_module='msg' AND attach_rel_id=".$post['msg_id'] ); - - /* Define some stuff. "To" member is added last in IPB 2 */ - $_tmp = $oldTopics; - ksort( $_tmp ); - $topicData = array_pop( $_tmp ); - $_invited = array(); - $_seenOwner = array(); - $_isDeleted = 0; - - /* Add the member rows */ - foreach( $oldTopics as $mt_id => $data ) - { - /* Prevent SQL error with unique index: Seen the owner ID already? */ - if ( $_seenOwner[ $data['mt_owner_id'] ] ) - { - continue; - } - - $_seenOwner[ $data['mt_owner_id'] ] = $data['mt_owner_id']; - - /* Build invited - does not include 'to' person */ - if ( $data['mt_owner_id'] AND ( $post['msg_author_id'] != $data['mt_owner_id'] ) AND ( $topicData['mt_to_id'] != $data['mt_owner_id'] ) ) - { - $_invited[ $data['mt_owner_id'] ] = $data['mt_owner_id'];/*noLibHook*/ - } - - $_isSent = ( $data['mt_vid_folder'] == 'sent' ) ? 1 : 0; - $_isDraft = ( $data['mt_vid_folder'] == 'unsent' ) ? 1 : 0; - - $this->DB->insert( 'message_topic_user_map', array( 'map_user_id' => $data['mt_owner_id'], - 'map_topic_id' => $topicID, - 'map_folder_id' => ( $_isDraft ) ? 'drafts' : 'myconvo', - 'map_read_time' => ( $data['mt_user_read'] ) ? $data['mt_user_read'] : ( $data['mt_read'] ? time() : 0 ), - 'map_user_active' => 1, - 'map_user_banned' => 0, - 'map_has_unread' => 0, //( $data['mt_read'] ) ? 0 : 1, - 'map_is_system' => 0, - 'map_last_topic_reply' => $post['msg_date'], - 'map_is_starter' => ( $data['mt_owner_id'] == $post['msg_author_id'] ) ? 1 : 0 ) ); - - } - - /* Now, did we see the author? If not, add them too but as inactive */ - if ( ! $_seenOwner[ $post['msg_author_id'] ] ) - { - $_isDeleted = 1; - - /*$this->DB->insert( 'message_topic_user_map', array( 'map_user_id' => $post['msg_author_id'], - 'map_topic_id' => $topicID, - 'map_folder_id' => 'myconvo', - 'map_read_time' => 0, - 'map_user_active' => 0, - 'map_user_banned' => 0, - 'map_has_unread' => 0, - 'map_is_system' => 0, - 'map_is_starter' => 1 ) );*/ - } - - $_isSent = ( $topicData['mt_vid_folder'] == 'sent' ) ? 1 : 0; - $_isDraft = ( $topicData['mt_vid_folder'] == 'unsent' ) ? 1 : 0; - - /* This is for MSSQL. I need a quick fix. This is it. Enjoy. */ - if ( method_exists( $this->DB, 'setTableIdentityInsert' ) ) - { - $this->DB->setTableIdentityInsert( 'message_topics', 'ON' ); - } - - /* Add the topic */ - $this->DB->insert( 'message_topics', array( 'mt_id' => $topicID, - 'mt_date' => $topicData['mt_date'], - 'mt_title' => $topicData['mt_title'], - 'mt_starter_id' => $post['msg_author_id'], - 'mt_start_time' => $post['msg_date'], - 'mt_last_post_time' => $post['msg_date'], - 'mt_invited_members' => serialize( array_keys( $_invited ) ), - 'mt_to_count' => count( array_keys( $_invited ) ) + 1, - 'mt_to_member_id' => $topicData['mt_to_id'], - 'mt_replies' => 0, - 'mt_last_msg_id' => $postID, - 'mt_first_msg_id' => $postID, - 'mt_is_draft' => $_isDraft, - 'mt_is_deleted' => $_isDeleted, - 'mt_is_system' => 0 ) ); - - /* This is for MSSQL. I need a quick fix. This is it. Enjoy. */ - if ( method_exists( $this->DB, 'setTableIdentityInsert' ) ) - { - $this->DB->setTableIdentityInsert( 'message_topics', 'OFF' ); - } - - $converted++; - } - - /* What to do? */ - if ( $seen ) - { - $this->request['st'] = $start + $pergo; - - /* Re-do Page */ - $url = "{$this->settings['base_url']}{$this->form_code}&do=".$this->request['do'].'&st=' . $this->request['st']; - - $this->_specialRedirect( $url, sprintf( $this->lang->words['tools300pms'], $this->request['st'], $converted ) ); - } - else - { - /* Update all members */ - $this->DB->update( 'members', array( 'msg_count_reset' => 1 ) ); - - $this->registry->output->redirect( "{$this->settings['base_url']}{$this->form_code}&do=tools", $this->lang->words['re_pmsconverted'], 1 ); - } - } - - /** - * Tools: Ban Settings - * - * @return @e void - */ - public function toolBanSettings() - { - //----------------------------------------- - // Init - //----------------------------------------- - - $bomb = array(); - $ban = array(); - $ip_count = 0; - $email_count = 0; - $name_count = 0; - - //----------------------------------------- - // Get current entries - //----------------------------------------- - - $this->DB->build( array( 'select' => '*', 'from' => 'banfilters', 'order' => 'ban_date desc' ) ); - $this->DB->execute(); - - while ( $r = $this->DB->fetch() ) - { - $ban[ $r['ban_type'] ][ $r['ban_content'] ] = $r; - } - - //----------------------------------------- - // Get $INFO (again) ip email name - //----------------------------------------- - $INFO = array(); - require( DOC_IPS_ROOT_PATH . 'conf_global.php' );/*noLibHook*/ - - //----------------------------------------- - // IP - //----------------------------------------- - - if ( $INFO['ban_ip'] ) - { - $bomb = explode( '|', $INFO['ban_ip'] ); - - if ( is_array( $bomb ) and count( $bomb ) ) - { - foreach( $bomb as $bang ) - { - if ( ! is_array($ban['ip'][ $bang ]) ) - { - $this->DB->insert( 'banfilters', array( 'ban_type' => 'ip', 'ban_content' => $bang, 'ban_date' => time() ) ); - - $ip_count++; - } - } - } - } - - //----------------------------------------- - // EMAIL - //----------------------------------------- - - if ( $INFO['ban_email'] ) - { - $bomb = explode( '|', $INFO['ban_email'] ); - - if ( is_array( $bomb ) and count( $bomb ) ) - { - foreach( $bomb as $bang ) - { - if ( ! is_array($ban['email'][ $bang ]) ) - { - $this->DB->insert( 'banfilters', array( 'ban_type' => 'email', 'ban_content' => $bang, 'ban_date' => time() ) ); - - $email_count++; - } - } - } - } - - //----------------------------------------- - // EMAIL - //----------------------------------------- - - if ( $INFO['ban_names'] ) - { - $bomb = explode( '|', $INFO['ban_names'] ); - - if ( is_array( $bomb ) and count( $bomb ) ) - { - foreach( $bomb as $bang ) - { - if ( ! is_array($ban['name'][ $bang ]) ) - { - $this->DB->insert( 'banfilters', array( 'ban_type' => 'name', 'ban_content' => $bang, 'ban_date' => time() ) ); - - $name_count++; - } - } - } - } - - $this->registry->output->global_message = sprintf( $this->lang->words['re_bansimport'], $ip_count, $email_count, $name_count ); - - $this->cache->rebuildCache( 'banfilters', 'global' ); - - $this->toolsSplashScreen(); - } - - /** - * 2.0.0 Tools: Converge - * - * @return @e void - */ - public function toolsConverge() - { - //----------------------------------------- - // Get all validating members... - //----------------------------------------- - - $to_unconverge = array(); - $unconverge_count = 0; - - $this->DB->build( array( 'select' => 'member_id, email, member_group_id', 'from' => 'members', 'where' => 'member_group_id='.$this->settings['auth_group'] ) ); - $this->DB->execute(); - - while( $m = $this->DB->fetch() ) - { - if ( preg_match( "#^{$m['member_id']}\-#", $m['email'] ) ) - { - $to_unconverge[] = $m['member_id']; - } - } - - $unconverge_count = intval( count( $to_unconverge ) ); - - if ( $unconverge_count ) - { - foreach( $to_unconverge as $mid ) - { - $this->DB->update( 'members' , array( 'member_group_id' => $this->settings['member_group'] ), 'member_id='.$mid ); - } - } - - //----------------------------------------- - // Time to move on dude - //----------------------------------------- - - $this->registry->output->global_message = (sprintf( $this->lang->words['re_convergerest'], $unconverge_count ) ); - $this->toolsSplashScreen(); - } - - /** - * 2.0.0 Tools: Dupe Settings - * - * @return @e void - */ - public function toolsDupeSettings() - { - //----------------------------------------- - // Remove dupe categories - //----------------------------------------- - - $title_id_to_keep = array(); - $title_id_to_delete = array(); - $title_deleted_count = 0; - - $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_settings_titles', 'order' => 'conf_title_id' ) ); - $this->DB->execute(); - - while ( $r = $this->DB->fetch() ) - { - if ( $title_id_to_keep[ $r['conf_title_title'] ] ) - { - $title_id_to_delete[ $r['conf_title_id'] ] = $r['conf_title_id']; - } - else - { - $title_id_to_keep[ $r['conf_title_title'] ] = $r['conf_title_id']; - } - } - - if ( count( $title_id_to_delete ) ) - { - $this->DB->delete( 'conf_settings_titles', 'conf_title_id IN ('.implode( ',', $title_id_to_delete ).')' ); - } - - $title_deleted_count = intval( count($title_id_to_delete) ); - - //----------------------------------------- - // Remove dupe settings - //----------------------------------------- - - $setting_id_to_keep = array(); - $setting_id_to_delete = array(); - $setting_id_deleted_count = 0; - - $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_conf_settings', 'order' => 'conf_id' ) ); - $this->DB->execute(); - - while ( $r = $this->DB->fetch() ) - { - if ( $setting_id_to_keep[ $r['conf_title'].','.$r['conf_key'] ] ) - { - $setting_id_to_delete[ $r['conf_id'] ] = $r['conf_id']; - } - else - { - $setting_id_to_keep[ $r['conf_title'].','.$r['conf_key'] ] = $r['conf_id']; - } - } - - if ( count( $setting_id_to_delete ) ) - { - $this->DB->delete( 'conf_settings', 'conf_id IN ('.implode( ',', $setting_id_to_delete ).')' ); - } - - $setting_deleted_count = intval( count($setting_id_to_delete) ); - - //----------------------------------------- - // Time to move on dude - //----------------------------------------- - - $this->registry->output->global_message = sprintf( $this->lang->words['re_deletetitle'], $title_deleted_count, $setting_deleted_count ) ; - $this->toolsSplashScreen(); - } - - /** - * 2.1.0 Tools: Dupe Settings - * - * @return @e void - */ - public function tools210DupeSettings() - { - //----------------------------------------- - // Remove dupe categories - //----------------------------------------- - - $title_id_to_keep = array(); - $title_id_to_delete = array(); - $title_deleted_count = 0; - $msg = ''; - - $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_settings_titles', 'order' => 'conf_title_id DESC' ) ); - $this->DB->execute(); - - while ( $r = $this->DB->fetch() ) - { - if ( $title_id_to_keep[ $r['conf_title_title'] ] ) - { - $title_id_to_delete[ $r['conf_title_id'] ] = $r['conf_title_id']; - - $msg .= sprintf( $this->lang->words['re_deletingid'], $r['conf_title_title'], $r['conf_title_id'] ) . "
    "; - } - else - { - $title_id_to_keep[ $r['conf_title_title'] ] = $r['conf_title_id']; - $msg .= sprintf( $this->lang->words['re_keepingid'], $r['conf_title_title'], $r['conf_title_id'] ) . "
    "; - } - } - - if ( count( $title_id_to_delete ) ) - { - $this->DB->delete( 'core_sys_conf_settings', 'conf_title_id IN ('.implode( ',', $title_id_to_delete ).')' ); - } - - $title_deleted_count = intval( count($title_id_to_delete) ); - - //----------------------------------------- - // Time to move on dude - //----------------------------------------- - - $this->registry->output->global_message = sprintf( $this->lang->words['re_duplicatetitle'], $title_deleted_count, $msg ); - $this->toolsSplashScreen(); - } - - /** - * 2.1.0 Tools: Calendar Events - * - * @return @e void - */ - public function tools210Calevents() - { - $start = intval($_GET['st']); - $lend = 50; - $end = $start + $lend; - $max = intval($_GET['max']); - - //----------------------------------------- - // Check to make sure table exists - //----------------------------------------- - - if ( ! $this->DB->checkForTable( 'calendar_events' ) ) - { - $this->registry->output->global_message = $this->lang->words['re_calremoved']; - $this->toolsSplashScreen(); - return; - } - - //----------------------------------------- - // Do we need to run this tool? - //----------------------------------------- - - if ( ! $max ) - { - $original = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as max', 'from' => 'calendar_events' ) ); - $new = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as max', 'from' => 'cal_events' ) ); - - if ( $new['max'] >= $original['max'] OR ! $original['max'] ) - { - $this->registry->output->global_message = $this->lang->words['re_calalready']; - $this->toolsSplashScreen(); - } - } - - $max = intval( $original['max'] ); - - //----------------------------------------- - // In steps... - //----------------------------------------- - - $this->DB->build( array( 'select' => '*', 'from' => 'calendar_events', 'limit' => array( $start, $lend ) ) ); - $o = $this->DB->execute(); - - //----------------------------------------- - // Do it... - //----------------------------------------- - - if ( $this->DB->getTotalRows($o) ) - { - //----------------------------------------- - // Got some to convert! - //----------------------------------------- - - while ( $r = $this->DB->fetch($o) ) - { - $recur_remap = array( 'w' => 1, - 'm' => 2, - 'y' => 3 ); - - $begin_date = IPSTime::date_getgmdate( $r['unix_stamp'] ); - $end_date = IPSTime::date_getgmdate( $r['end_unix_stamp'] ); - - if ( ! $begin_date OR ! $end_date ) - { - continue; - } - - $day = $begin_date['mday']; - $month = $begin_date['mon']; - $year = $begin_date['year']; - - $end_day = $end_date['mday']; - $end_month = $end_date['mon']; - $end_year = $end_date['year']; - - $_final_unix_from = gmmktime(0, 0, 0, $month, $day, $year ); - - //----------------------------------------- - // Recur or ranged... - //----------------------------------------- - - if ( $r['event_repeat'] OR $r['event_ranged'] ) - { - $_final_unix_to = gmmktime(23, 59, 59, $end_month, $end_day, $end_year); - } - else - { - $_final_unix_to = 0; - } - - $new_event = array( 'event_calendar_id' => 1, - 'event_member_id' => $r['userid'], - 'event_content' => $r['event_text'], - 'event_title' => $r['title'], - 'event_smilies' => $r['show_emoticons'], - 'event_perms' => $r['read_perms'], - 'event_private' => $r['priv_event'], - 'event_approved' => 1, - 'event_unixstamp' => $r['unix_stamp'], - 'event_recurring' => ( $r['event_repeat'] && $recur_remap[ $r['repeat_unit'] ] ) ? $recur_remap[ $r['repeat_unit'] ] : 0, - 'event_tz' => 0, - 'event_unix_from' => $_final_unix_from, - 'event_unix_to' => $_final_unix_to ); - - //----------------------------------------- - // INSERT - //----------------------------------------- - - $this->DB->insert( 'cal_events', $new_event ); - } - - $this->registry->output->global_message = sprintf( $this->lang->words['re_calstartto'], $start, $end ); - - $url = "{$this->settings['base_url']}{$this->form_code}&do=".$this->request['do'].'&max='.$max.'&st='.$end; - } - else - { - $this->registry->output->global_message = $this->lang->words['re_calsconverted']; - - $url = "{$this->settings['base_url']}{$this->form_code}&do=tools"; - } - - //----------------------------------------- - // Bye.... - //----------------------------------------- - - $this->registry->output->redirect( $url, $this->registry->output->global_message ); - } - - /** - * 2.1.0 Tools: Polls - * - * @return @e void - */ - public function tools210Polls() - { - $start = intval( $this->request['st'] ); - $lend = 50; - $end = $start + $lend; - $max = intval( $this->request['max'] ); - $done = 0; - $converted = intval( $this->request['conv'] ); - - //----------------------------------------- - // First off.. grab number of polls to convert - //----------------------------------------- - - if ( ! $max ) - { - $total = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as max', - 'from' => 'topics', - 'where' => "poll_state IN ('open', 'close', 'closed')" ) ); - - $max = $total['max']; - } - - if ( $max < 1 ) - { - $done = 1; - } - - //----------------------------------------- - // In steps... - //----------------------------------------- - - $this->DB->build( array( 'select' => '*', - 'from' => 'topics', - 'where' => "poll_state IN ('open', 'close', 'closed' )", - 'limit' => array( $start, $lend ) ) ); - $o = $this->DB->execute(); - - //----------------------------------------- - // Do it... - //----------------------------------------- - - if ( $this->DB->getTotalRows($o) ) - { - //----------------------------------------- - // Got some to convert! - //----------------------------------------- - - while ( $r = $this->DB->fetch($o) ) - { - $converted++; - - $new_poll = array( 1 => array() ); - - $poll_data = $this->DB->buildAndFetch( array( 'select' => '*', - 'from' => 'polls', - 'where' => "tid=".$r['tid'] - ) ); - if ( ! $poll_data['pid'] ) - { - continue; - } - - if ( ! $poll_data['poll_question'] ) - { - $poll_data['poll_question'] = $r['title']; - } - - //----------------------------------------- - // Kick start new poll - //----------------------------------------- - - $new_poll[1]['question'] = $poll_data['poll_question']; - - //----------------------------------------- - // Get OLD polls - //----------------------------------------- - - $poll_answers = unserialize( stripslashes( $poll_data['choices'] ) ); - - reset($poll_answers); - - foreach ( $poll_answers as $entry ) - { - $id = $entry[0]; - $choice = $entry[1]; - $votes = $entry[2]; - - $total_votes += $votes; - - if ( strlen($choice) < 1 ) - { - continue; - } - - $new_poll[ 1 ]['choice'][ $id ] = $choice; - $new_poll[ 1 ]['votes'][ $id ] = $votes; - } - - //----------------------------------------- - // Got something? - //----------------------------------------- - - if ( count( $new_poll[1]['choice'] ) ) - { - $this->DB->update( 'polls' , array( 'choices' => serialize( $new_poll ) ), 'tid='.$r['tid'] ); - $this->DB->update( 'topics', array( 'poll_state' => 1 ), 'tid='.$r['tid'] ); - } - - //----------------------------------------- - // All done? - //----------------------------------------- - - if ( $converted >= $max ) - { - $done = 1; - continue; - } - } - } - else - { - $done = 1; - } - - - if ( ! $done ) - { - $this->registry->output->global_message = sprintf( $this->lang->words['re_pollstartto'], $start, $end, $max ); - - $url = "{$this->settings['base_url']}{$this->form_code}&do=".$this->request['do'].'&max='.$max.'&st='.$end.'&conv='.$converted; - } - else - { - $this->registry->output->global_message = $this->lang->words['re_pollconverted']; - - $url = "{$this->settings['base_url']}{$this->form_code}&do=tools"; - } - - //----------------------------------------- - // Bye.... - //----------------------------------------- - - $this->registry->output->redirect( $url, $this->registry->output->global_message ); - } - - /** - * 2.2.0 Tools: Contacts - * DEPRECATED - * - * @return @e void - */ - public function tools220Contacts() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $start = intval($_GET['st']); - $lend = 50; - $end = $start + $lend; - $done = 0; - $updated = 0; - - //----------------------------------------- - // Get lib - //----------------------------------------- - - $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('members') . '/sources/friends.php', 'profileFriendsLib', 'members' ); - $profile = new $classToLoad( $this->registry ); - - - //----------------------------------------- - // OK.. - //----------------------------------------- - - $this->DB->build( array( 'select' => '*', - 'from' => 'contacts', - 'where' => 'allow_msg=1', - 'limit' => array( $start, $lend ) ) ); - - $o = $this->DB->execute(); - - //----------------------------------------- - // Do it... - //----------------------------------------- - - if ( $this->DB->getTotalRows($o) ) - { - //----------------------------------------- - // Got some to convert! - //----------------------------------------- - - while( $row = $this->DB->fetch( $o ) ) - { - //----------------------------------------- - // Already a friend - //----------------------------------------- - - $friend = $this->DB->buildAndFetch( array( 'select' => '*', - 'from' => 'profile_friends', - 'where' => 'friends_member_id=' . intval( $row['member_id'] ) . ' AND friends_friend_id=' . intval( $row['contact_id'] ) ) ); - - if ( ! $friend['friends_id'] ) - { - //----------------------------------------- - // Add to DB - //----------------------------------------- - - $this->DB->insert( 'profile_friends', array( 'friends_member_id' => $row['member_id'], - 'friends_friend_id' => $row['contact_id'], - 'friends_approved' => 1, - 'friends_added' => time() ) ); - - //----------------------------------------- - // Rebuild... - //----------------------------------------- - - $profile->recacheFriends( array( 'member_id' => $row['member_id'] ) ); - - $updated++; - } - - $this->DB->delete( "contacts", "id={$row['id']}" ); - } - } - else - { - $done = 1; - } - - //----------------------------------------- - // Done? - //----------------------------------------- - - if ( ! $done ) - { - $this->registry->output->global_message = sprintf( $this->lang->words['re_contactsstartto'],$start, $end, $updated ); - - $url = "{$this->settings['base_url']}{$this->form_code}&do=".$this->request['do'].'&st='.$end; - } - else - { - $this->registry->output->global_message = $this->lang->words['re_contactsup']; - - $url = "{$this->settings['base_url']}{$this->form_code}&do=tools"; - } - - //----------------------------------------- - // Bye.... - //----------------------------------------- - - $this->registry->output->redirect( $url, $this->registry->output->global_message ); - } - - /** - * Cleanup Tools Splash Screen - * - * @return @e void - */ - public function toolsSplashScreen() - { - /* Output */ - $this->registry->output->html .= $this->html->toolsSplashScreen(); - } - - /** - * Count stats - * - * @return @e void - */ - public function doCount() - { - if ( empty($this->request['posts']) && empty($this->request['online']) && empty($this->request['members']) && empty($this->request['lastreg']) ) - { - $this->registry->output->showError( $this->lang->words['re_nothing'], 11154 ); - } - - $stats = $this->cache->getCache('stats'); - - if ( $this->request['posts'] ) - { - $topics = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as tcount', - 'from' => 'topics', - 'where' => $this->registry->getClass('class_forums')->fetchTopicHiddenQuery( array( 'visible' ), '' ) ) ); - - $posts = $this->DB->buildAndFetch( array( 'select' => 'SUM(posts) as replies', - 'from' => 'topics', - 'where' => $this->registry->getClass('class_forums')->fetchTopicHiddenQuery( array( 'visible' ), '' ) ) ); - - $stats['total_topics'] = $topics['tcount']; - $stats['total_replies'] = $posts['replies']; - } - - if ( $this->request['members'] ) - { - $r = $this->DB->buildAndFetch( array( 'select' => 'count(member_id) as members', 'from' => 'members', 'where' => "member_group_id <> '{$this->settings['auth_group']}'" ) ); - - $stats['mem_count'] = intval($r['members']); - } - - if ( $this->request['lastreg'] ) - { - $stats = array_merge( $stats, IPSMember::resetLastRegisteredMember( true ) ); - } - - if ( $this->request['online'] ) - { - $stats['most_date'] = time(); - $stats['most_count'] = 1; - } - - $this->cache->setCache( 'stats', $stats, array( 'array' => 1 ) ); - - $this->registry->output->global_message = $this->lang->words['re_statsrecount']; - $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code ); - } - - /** - * Clean out photos - * - * @return @e void - */ - public function cleanPhotos() - { - //----------------------------------------- - // Set up - //----------------------------------------- - - $done = 0; - $start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0; - $end = intval( $this->request['pergo'] ) ? intval( $this->request['pergo'] ) : 100; - $display = $end + $start; - $output = array(); - - //----------------------------------------- - // Pop open the directory and - // peek inside... - //----------------------------------------- - - $i = 0; - - try - { - foreach( new DirectoryIterator( $this->settings['upload_dir'] . '/profile' ) as $file ) - { - if ( strstr( $file->getFilename(), 'photo-' ) ) - { - $fullfile = $file->getPathname(); - $relativefile = str_replace( $this->settings['upload_dir'] . '/', '', $fullfile ); - - $i++; - - //----------------------------------------- - // Already started? - //----------------------------------------- - - if ( $start > $i ) - { - continue; - } - - //----------------------------------------- - // Done for this iteration? - //----------------------------------------- - - if ( $i > $display ) - { - break; - } - - //----------------------------------------- - // Try and get attach row - //----------------------------------------- - - $found = $this->DB->buildAndFetch( array( 'select' => 'pp_member_id', 'from' => 'profile_portal', 'where' => "pp_main_photo='{$relativefile}' OR pp_thumb_photo='{$relativefile}'" ) ); - - if ( ! $found['pp_member_id'] ) - { - @unlink( $fullfile ); - $output[] = "{$this->lang->words['re_removedorph']} {$file->getFilename()}"; - } - else - { - $output[] = "{$this->lang->words['re_attachedok']} {$file->getFilename()}"; - } - } - } - } catch ( Exception $e ) {} - - //----------------------------------------- - // Finish - or more?... - //----------------------------------------- - - if ( $i < $display) - { - //----------------------------------------- - // Done.. - //----------------------------------------- - - $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); - $url = "{$this->settings['base_url']}{$this->form_code}"; - } - else - { - //----------------------------------------- - // More.. - //----------------------------------------- - $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $display ); - $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); - $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$display}"; - } - - //----------------------------------------- - // Bye.... - //----------------------------------------- - - $this->_specialRedirect( $url, $text ); - } - - /** - * Clean out attachments - * - * @return @e void - */ - public function cleanAttachments() - { - /* Upload Class */ - require_once( IPS_KERNEL_PATH.'classUpload.php' );/*noLibHook*/ - $upload = new classUpload(); - - //----------------------------------------- - // Set up - //----------------------------------------- - - $done = 0; - $start = intval($this->request['st']) >=0 ? intval($this->request['st']) : 0; - $end = intval( $this->request['pergo'] ) ? intval( $this->request['pergo'] ) : 100; - $dis = $end + $start; - $output = array(); - - //----------------------------------------- - // Pop open the directory and - // peek inside... - //----------------------------------------- - - $i = 0; - - try - { - foreach( new DirectoryIterator( $this->settings['upload_dir'] ) as $file ) - { - if ( $file->getFilename() == '.' OR $file->getFilename() == '..' ) - { - continue; - } - - $fullfile = $this->settings['upload_dir'] . '/' . $file->getFilename(); - - if( is_dir( $fullfile ) ) - { - $ndh = opendir( $fullfile ); - - try - { - foreach( new DirectoryIterator( $fullfile ) as $nfile ) - { - if ( $nfile->getFilename() == '.' OR $nfile->getFilename() == '..' ) - { - continue; - } - - if ( strstr( $nfile->getFilename(), 'post-' ) ) - { - $i++; - - //----------------------------------------- - // Already started? - //----------------------------------------- - - if ( $start > $i ) - { - continue; - } - - //----------------------------------------- - // Done for this iteration? - //----------------------------------------- - - if ( $i > $dis ) - { - break; - } - - //----------------------------------------- - // Try and get attach row - //----------------------------------------- - - $found = $this->DB->buildAndFetch( array( 'select' => 'attach_id', 'from' => 'attachments', 'where' => "attach_location='{$file->getFilename()}/{$nfile->getFilename()}' OR attach_thumb_location='{$file->getFilename()}/{$nfile->getFilename()}'" ) ); - - if ( ! $found['attach_id'] ) - { - @unlink( $fullfile . '/' . $nfile ); - $output[] = "{$this->lang->words['re_removedorph']} {$nfile->getFilename()}"; - } - else - { - $output[] = "{$this->lang->words['re_attachedok']} {$nfile->getFilename()}"; - } - } - } - } catch ( Exception $e ) {} - - closedir( $ndh ); - } - else if ( strstr( $file, 'post-' ) ) - { - $i++; - - //----------------------------------------- - // Already started? - //----------------------------------------- - - if ( $start > $i ) - { - continue; - } - - //----------------------------------------- - // Done for this iteration? - //----------------------------------------- - - if ( $i > $dis ) - { - break; - } - - //----------------------------------------- - // Try and get attach row - //----------------------------------------- - - $found = $this->DB->buildAndFetch( array( 'select' => 'attach_id', 'from' => 'attachments', 'where' => "attach_location='{$file->getFilename()}' OR attach_thumb_location='{$file->getFilename()}'" ) ); - - if ( ! $found['attach_id'] ) - { - @unlink( $fullfile ); - $output[] = "{$this->lang->words['re_removedorph']} {$file->getFilename()}"; - } - else - { - $output[] = "{$this->lang->words['re_attachedok']} {$file->getFilename()}"; - } - } - } - } catch ( Exception $e ) {} - - //----------------------------------------- - // Finish - or more?... - //----------------------------------------- - - if ( $i < $dis) - { - //----------------------------------------- - // Done.. - //----------------------------------------- - - $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); - $url = "{$this->settings['base_url']}{$this->form_code}"; - } - else - { - //----------------------------------------- - // More.. - //----------------------------------------- - - $text = sprintf( $this->lang->words['re_thisgoeshere'], $dis ) . '
    ' . implode( "
    ", $output ); - $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; - } - - //----------------------------------------- - // Bye.... - //----------------------------------------- - - $this->_specialRedirect( $url, $text ); - } - - /** - * Rebuild Attachment Data - * - * @return @e void - */ - public function rebuildAttachdata() - { - /* Upload Class */ - require_once( IPS_KERNEL_PATH.'classUpload.php' );/*noLibHook*/ - $upload = new classUpload(); - - //----------------------------------------- - // Set up - //----------------------------------------- - - $done = 0; - $start = intval($this->request['st']) >=0 ? intval($this->request['st']) : 0; - $end = intval( $this->request['pergo'] ) ? intval( $this->request['pergo'] ) : 100; - $dis = $end + $start; - $output = array(); - - //----------------------------------------- - // Got any more? - //----------------------------------------- - - $tmp = $this->DB->buildAndFetch( array( 'select' => 'attach_id', 'from' => 'attachments', 'limit' => array($dis,1) ) ); - $max = intval( $tmp['attach_id'] ); - - //----------------------------------------- - // Avoid limit... - //----------------------------------------- - - $this->DB->build( array( 'select' => '*', 'from' => 'attachments', 'order' => 'attach_id ASC', 'limit' => array($start,$end) ) ); - $outer = $this->DB->execute(); - - //----------------------------------------- - // Process... - //----------------------------------------- - - while( $r = $this->DB->fetch( $outer ) ) - { - //----------------------------------------- - // Get ext - //----------------------------------------- - - $update = array(); - - $update['attach_ext'] = IPSText::getFileExtension( $r['attach_file'] ); - - if ( $r['attach_location'] ) - { - if ( is_file( $this->settings['upload_dir'].'/'.$r['attach_location'] ) ) - { - $update['attach_filesize'] = @filesize( $this->settings['upload_dir'].'/'.$r['attach_location'] ); - - if( $r['attach_is_image'] ) - { - $dims = @getimagesize( $this->settings['upload_dir'].'/'.$r['attach_location'] ); - - if( $dims[0] AND $dims[1] ) - { - $update['attach_img_width'] = $dims[0]; - $update['attach_img_height'] = $dims[1]; - } - } - } - } - - if ( count( $update ) ) - { - $this->DB->update( 'attachments', $update, 'attach_id='.$r['attach_id'] ); - } - - $done++; - } - - //----------------------------------------- - // Finish - or more?... - //----------------------------------------- - - if ( ! $done and ! $max ) - { - //----------------------------------------- - // Done.. - //----------------------------------------- - - $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); - $url = "{$this->settings['base_url']}{$this->form_code}"; - } - else - { - //----------------------------------------- - // More.. - //----------------------------------------- - $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); - $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); - $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; - } - - //----------------------------------------- - // Bye.... - //----------------------------------------- - - $this->_specialRedirect( $url, $text ); - } - - /** - * Rebuild Photos - * - * @return @e void - */ - public function rebuildPhotos() - { - /* Image Class */ - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/member/photo.php', 'classes_member_photo' ); - $photoClass = new $classToLoad( $this->registry ); - - //----------------------------------------- - // Set up - //----------------------------------------- - - $done = 0; - $start = intval($this->request['st']) >=0 ? intval($this->request['st']) : 0; - $end = intval( $this->request['pergo'] ) ? intval( $this->request['pergo'] ) : 100; - $dis = $end + $start; - $output = array(); - - //----------------------------------------- - // Got any more? - //----------------------------------------- - - $tmp = $this->DB->buildAndFetch( array( 'select' => 'pp_member_id', 'from' => 'profile_portal', 'where' => "pp_main_photo != ''", 'order' => 'pp_member_id ASC', 'limit' => array($dis,1) ) ); - $max = intval( $tmp['pp_member_id'] ); - - //----------------------------------------- - // Avoid limit... - //----------------------------------------- - - $this->DB->build( array( 'select' => '*', 'from' => 'profile_portal', 'order' => 'pp_member_id ASC', 'where' => "pp_main_photo != ''", 'limit' => array($start,$end) ) ); - $outer = $this->DB->execute(); - - //----------------------------------------- - // Process... - //----------------------------------------- - - while( $r = $this->DB->fetch( $outer ) ) - { - /* Preserve FB, Twitter and Gravatar photos */ - if( $r['pp_photo_type'] != 'custom' ) - { - continue; - } - - $update = array(); - - $info = $photoClass->buildSizedPhotos( str_replace( 'upload:', '', $r['pp_main_photo'] ), $r['pp_member_id'], true ); - - if( $info['status'] == 'missing_image' ) - { - $update['pp_main_photo'] = ''; - $update['pp_main_width'] = 0; - $update['pp_main_height'] = 0; - $update['pp_thumb_photo'] = ''; - $update['pp_thumb_width'] = 0; - $update['pp_thumb_height'] = 0; - } - else - { - $update['pp_main_width'] = intval( $info['final_width'] ); - $update['pp_main_height'] = intval( $info['final_height'] ); - $update['pp_thumb_photo'] = $info['t_final_location'] ? $info['t_final_location'] : $info['final_location']; - $update['pp_thumb_width'] = intval( $info['t_final_width'] ); - $update['pp_thumb_height'] = intval( $info['t_final_height'] ); - } - - $this->DB->update( 'profile_portal', $update, 'pp_member_id=' . $r['pp_member_id'] ); - - $done++; - } - - //----------------------------------------- - // Finish - or more?... - //----------------------------------------- - - if ( ! $done and ! $max ) - { - //----------------------------------------- - // Done.. - //----------------------------------------- - - $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); - $url = "{$this->settings['base_url']}{$this->form_code}"; - } - else - { - //----------------------------------------- - // More.. - //----------------------------------------- - $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); - $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); - $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; - } - - //----------------------------------------- - // Bye.... - //----------------------------------------- - - $this->_specialRedirect( $url, $text ); - } - - /** - * Rebuild Post Thumbnails - * - * @return @e void - */ - public function rebuildThumbnails() - { - require_once( IPS_KERNEL_PATH . 'classImage.php' );/*noLibHook*/ - require_once( IPS_KERNEL_PATH . 'classImageGd.php' );/*noLibHook*/ - - //----------------------------------------- - // Set up - //----------------------------------------- - - $done = 0; - $start = intval($this->request['st']) >=0 ? intval($this->request['st']) : 0; - $end = intval( $this->request['pergo'] ) ? intval( $this->request['pergo'] ) : 100; - $dis = $end + $start; - $output = array(); - - //----------------------------------------- - // Got any more? - //----------------------------------------- - - $tmp = $this->DB->buildAndFetch( array( 'select' => 'attach_id', 'from' => 'attachments', 'where' => "attach_rel_module IN('post','msg')", 'limit' => array($dis,1) ) ); - $max = intval( $tmp['attach_id'] ); - - //----------------------------------------- - // Avoid limit... - //----------------------------------------- - - $this->DB->build( array( 'select' => '*', 'from' => 'attachments', 'where' => "attach_rel_module IN('post','msg')", 'order' => 'attach_id ASC', 'limit' => array($start,$end) ) ); - $outer = $this->DB->execute(); - - //----------------------------------------- - // Process... - //----------------------------------------- - - while( $r = $this->DB->fetch( $outer ) ) - { - if ( $r['attach_is_image'] ) - { - if ( $r['attach_thumb_location'] and ( $r['attach_thumb_location'] != $r['attach_location'] ) ) - { - if ( is_file( $this->settings['upload_dir'] . '/' . $r['attach_thumb_location'] ) ) - { - if ( ! @unlink( $this->settings['upload_dir'] . '/' . $r['attach_thumb_location'] ) ) - { - $output[] = $this->lang->words['re_noremove'] . $r['attach_thumb_location']; - continue; - } - } - } - - $attach_data = array(); - $thumbnail = preg_replace( "/^(.*)\.(.+?)$/", "\\1_thumb.\\2", $r['attach_location'] ); - - $image = new classImageGd(); - - $image->init( array( - 'image_path' => $this->settings['upload_dir'], - 'image_file' => $r['attach_location'], - ) ); - - $image->force_resize = false; - - $return = $image->resizeImage( $this->settings['siu_width'], $this->settings['siu_height'] ); - - if( !$return['noResize'] ) - { - $image->writeImage( $this->settings['upload_dir'] . '/' . $thumbnail ); - - $attach_data['attach_thumb_location'] = $thumbnail; - } - else - { - $attach_data['attach_thumb_location'] = $r['attach_location']; - } - - $attach_data['attach_thumb_width'] = intval($return['newWidth'] ? $return['newWidth'] : $image->cur_dimensions['width']); - $attach_data['attach_thumb_height'] = intval($return['newHeight'] ? $return['newHeight'] : $image->cur_dimensions['height']); - - if ( count( $attach_data ) ) - { - $this->DB->update( 'attachments', $attach_data, 'attach_id='.$r['attach_id'] ); - - $output[] = $this->lang->words['re_resized'] . $r['attach_location']; - } - - unset($image); - } - - $done++; - } - - //----------------------------------------- - // Finish - or more?... - //----------------------------------------- - - if ( ! $done and ! $max ) - { - //----------------------------------------- - // Done.. - //----------------------------------------- - - $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); - $url = "{$this->settings['base_url']}{$this->form_code}"; - } - else - { - //----------------------------------------- - // More.. - //----------------------------------------- - $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); - $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); - $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; - } - - //----------------------------------------- - // Bye.... - //----------------------------------------- - - $this->_specialRedirect( $url, $text ); - } - - /** - * Rebuild Messenger Totals - * - * @return @e void - */ - public function rebuildMsgCounts() - { - //----------------------------------------- - // Grab messenger lib - //----------------------------------------- - - $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'members' ) . '/sources/classes/messaging/messengerFunctions.php', 'messengerFunctions', 'members' ); - $messengerFunctions = new $classToLoad( $this->registry ); - - //----------------------------------------- - // Set up - //----------------------------------------- - - $done = 0; - $start = intval($this->request['st']) >=0 ? intval($this->request['st']) : 0; - $end = intval( $this->request['pergo'] ) ? intval( $this->request['pergo'] ) : 100; - $dis = $end + $start; - $output = array(); - - //----------------------------------------- - // Got any more? - //----------------------------------------- - - $tmp = $this->DB->buildAndFetch( array( 'select' => 'member_id', 'from' => 'members', 'limit' => array($dis,1) ) ); - $max = intval( $tmp['member_id'] ); - - //----------------------------------------- - // Avoid limit... - //----------------------------------------- - - $this->DB->build( array( 'select' => 'member_id, members_display_name', 'from' => 'members', 'order' => 'member_id ASC', 'limit' => array($start,$end) ) ); - $outer = $this->DB->execute(); - - //----------------------------------------- - // Process... - //----------------------------------------- - - while( $r = $this->DB->fetch( $outer ) ) - { - $messengerFunctions->resetMembersFolderCounts( $r['member_id'] ); - $messengerFunctions->resetMembersTotalTopicCount( $r['member_id'] ); - $messengerFunctions->resetMembersNewTopicCount( $r['member_id'] ); - - $done++; - } - - //----------------------------------------- - // Finish - or more?... - //----------------------------------------- - - if ( ! $done and ! $max ) - { - //----------------------------------------- - // Done.. - //----------------------------------------- - - $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); - $url = "{$this->settings['base_url']}{$this->form_code}"; - } - else - { - //----------------------------------------- - // More.. - //----------------------------------------- - $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); - $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); - $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; - } - - //----------------------------------------- - // Bye.... - //----------------------------------------- - - $this->_specialRedirect( $url, $text ); - } - - /** - * Rebuild Post Count - * - * @return @e void - */ - public function rebuildPostCount() - { - //----------------------------------------- - // Forums not to count? - //----------------------------------------- - - $forums = array(); - - foreach( $this->registry->class_forums->forum_by_id as $data ) - { - if ( ! $data['inc_postcount'] ) - { - $forums[] = $data['id']; - } - } - - /* Init */ - if ( ! $this->registry->isClassLoaded('topics') ) - { - $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/topics.php", 'app_forums_classes_topics', 'forums' ); - $this->registry->setClass( 'topics', new $classToLoad( $this->registry ) ); - } - - //----------------------------------------- - // Set up - //----------------------------------------- - - $done = 0; - $start = intval($this->request['st']) >=0 ? intval($this->request['st']) : 0; - $end = intval( $this->request['pergo'] ) ? intval( $this->request['pergo'] ) : 100; - $dis = $end + $start; - $output = array(); - - //----------------------------------------- - // Got any more? - //----------------------------------------- - - $tmp = $this->DB->buildAndFetch( array( 'select' => 'member_id', 'from' => 'members', 'limit' => array($dis,1) ) ); - $max = intval( $tmp['member_id'] ); - - //----------------------------------------- - // Avoid limit... - //----------------------------------------- - - $this->DB->build( array( 'select' => 'member_id, name', 'from' => 'members', 'order' => 'member_id ASC', 'limit' => array($start,$end) ) ); - $outer = $this->DB->execute(); - - //----------------------------------------- - // Process... - //----------------------------------------- - - while( $r = $this->DB->fetch( $outer ) ) - { - if ( ! count( $forums ) ) - { - $count = $this->registry->topics->getPosts( array( 'onlyViewable' => false, - 'skipForumCheck' => true, - 'getCountOnly' => true, - 'authorId' => $r['member_id'] ) ); - } - else - { - $count = $this->registry->topics->getPosts( array( 'onlyViewable' => false, - 'skipForumCheck' => true, - 'getCountOnly' => true, - 'notForumId' => $forums, - 'authorId' => $r['member_id'] ) ); - } - - if ( $this->settings['archive_on'] ) - { - if ( ! count( $forums ) ) - { - $acount = $this->registry->topics->getPosts( array( 'onlyViewable' => false, - 'skipForumCheck' => true, - 'getCountOnly' => true, - 'isArchivedTopic' => true, - 'authorId' => $r['member_id'] ) ); - } - else - { - $acount = $this->registry->topics->getPosts( array( 'onlyViewable' => false, - 'skipForumCheck' => true, - 'getCountOnly' => true, - 'notForumId' => $forums, - 'isArchivedTopic' => true, - 'authorId' => $r['member_id'] ) ); - } - - $count += intval( $acount ); - } - - $this->DB->update( 'members', array( 'posts' => intval( $count ) ), 'member_id='.$r['member_id'] ); - - $done++; - } - - //----------------------------------------- - // Finish - or more?... - //----------------------------------------- - - if ( ! $done and ! $max ) - { - //----------------------------------------- - // Done.. - //----------------------------------------- - - $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); - $url = "{$this->settings['base_url']}{$this->form_code}"; - } - else - { - //----------------------------------------- - // More.. - //----------------------------------------- - $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); - $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); - $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; - } - - //----------------------------------------- - // Bye.... - //----------------------------------------- - - $this->_specialRedirect( $url, $text ); - } - - /** - * Rebuild Reputation Counts - * - * @return @e void - */ - public function rebuildReputationCount() - { - //----------------------------------------- - // Set up - //----------------------------------------- - - $done = 0; - $start = intval($this->request['st']) >=0 ? intval($this->request['st']) : 0; - $end = intval( $this->request['pergo'] ) ? intval( $this->request['pergo'] ) : 100; - $dis = $end + $start; - $output = array(); - - //----------------------------------------- - // Load reputation classes - //----------------------------------------- - - $_rep_author_config = array(); - $_rep_log_joins = array(); - foreach( ipsRegistry::$applications as $appKey => $data ) - { - $rep_author_config = array(); - $rep_log_joins = array(); - $file = IPSLib::getAppDir( $appKey ) . '/extensions/reputation.php'; - - if ( file_exists( $file ) ) - { - require( $file );/*noLibHook*/ - $_rep_author_config[ $appKey ] = $rep_author_config; - $_rep_log_joins[ $appKey ] = $rep_log_joins; - } - } - - //----------------------------------------- - // Got any more? - //----------------------------------------- - - $tmp = $this->DB->buildAndFetch( array( 'select' => 'member_id', 'from' => 'members', 'limit' => array($dis,1) ) ); - $max = intval( $tmp['member_id'] ); - - //----------------------------------------- - // Avoid limit... - //----------------------------------------- - - $this->DB->build( array( 'select' => 'member_id, name', 'from' => 'members', 'order' => 'member_id ASC', 'limit' => array($start,$end) ) ); - $outer = $this->DB->execute(); - - //----------------------------------------- - // Process... - //----------------------------------------- - - while( $r = $this->DB->fetch( $outer ) ) - { - $total = 0; - - foreach ( $_rep_author_config as $app => $types ) - { - foreach ( $types as $type => $data ) - { - $prefix = NULL; - foreach ( $_rep_log_joins[ $app ] as $j ) - { - if ( is_array( $j['from'] ) AND count( $j['from'] ) ) - { - foreach ( $j['from'] as $t => $p ) - { - if ( $t == $data['table'] ) - { - $prefix = $p; - break 2; - } - } - } - } - - if ( !is_null( $prefix ) ) - { - $_total = $this->DB->buildAndFetch( array( - 'select' => "sum(r.rep_rating) as total", - 'from' => array( 'reputation_index' => 'r' ), - 'add_join' => $_rep_log_joins[ $app ], - 'where' => "r.app='{$app}' AND r.type='{$type}' AND {$prefix}.{$data['column']}={$r['member_id']}", - 'group' => "{$prefix}.{$data['column']}", - ) ); - - $total += $_total['total']; - } - } - } - - $this->DB->update( 'profile_portal', array( 'pp_reputation_points' => $total ), 'pp_member_id='.$r['member_id'] ); - - $done++; - } - - //----------------------------------------- - // Finish - or more?... - //----------------------------------------- - - if ( ! $done and ! $max ) - { - //----------------------------------------- - // Done.. - //----------------------------------------- - - $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); - $url = "{$this->settings['base_url']}{$this->form_code}"; - } - else - { - //----------------------------------------- - // More.. - //----------------------------------------- - $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); - $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); - $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; - } - - //----------------------------------------- - // Bye.... - //----------------------------------------- - - $this->_specialRedirect( $url, $text ); - } - - /** - * Rebuild Seo User Names - * - * @return @e void - */ - public function rebuildSeoUserNames() - { - //----------------------------------------- - // Set up - //----------------------------------------- - - $done = 0; - $start = intval($this->request['st']) >=0 ? intval($this->request['st']) : 0; - $end = intval( $this->request['pergo'] ) ? intval( $this->request['pergo'] ) : 100; - $dis = $end + $start; - $output = array(); - - //----------------------------------------- - // Got any more? - //----------------------------------------- - - $tmp = $this->DB->buildAndFetch( array( 'select' => 'member_id', 'from' => 'members', 'limit' => array( $dis, 1 ) ) ); - $max = intval( $tmp['member_id'] ); - - //----------------------------------------- - // Avoid limit... - //----------------------------------------- - - $this->DB->build( array( 'select' => 'member_id, members_display_name', 'from' => 'members', 'order' => 'member_id ASC', 'limit' => array( $start, $end ) ) ); - $outer = $this->DB->execute(); - - //----------------------------------------- - // Process... - //----------------------------------------- - - while( $r = $this->DB->fetch( $outer ) ) - { - $this->DB->update( 'members', array( 'members_seo_name' => IPSText::makeSeoTitle( $r['members_display_name'] ) ), "member_id=" . $r['member_id'] ); - $done++; - } - - //----------------------------------------- - // Finish - or more?... - //----------------------------------------- - - if ( ! $done and ! $max ) - { - //----------------------------------------- - // Done.. - //----------------------------------------- - - $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); - $url = "{$this->settings['base_url']}{$this->form_code}"; - } - else - { - //----------------------------------------- - // More.. - //----------------------------------------- - $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); - $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); - $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; - } - - //----------------------------------------- - // Bye.... - //----------------------------------------- - - $this->_specialRedirect( $url, $text ); - } - - - /** - * Rebuild Post Names - * - * @return @e void - */ - public function rebuildPostNames() - { - //----------------------------------------- - // Set up - //----------------------------------------- - - $done = 0; - $start = intval($this->request['st']) >=0 ? intval($this->request['st']) : 0; - $end = intval( $this->request['pergo'] ) ? intval( $this->request['pergo'] ) : 100; - $dis = $end + $start; - $output = array(); - - //----------------------------------------- - // Got any more? - //----------------------------------------- - - $tmp = $this->DB->buildAndFetch( array( 'select' => 'member_id', 'from' => 'members', 'limit' => array( $dis, 1 ) ) ); - $max = intval( $tmp['member_id'] ); - - //----------------------------------------- - // Avoid limit... - //----------------------------------------- - - $this->DB->build( array( 'select' => 'member_id, members_display_name', 'from' => 'members', 'order' => 'member_id ASC', 'limit' => array( $start, $end ) ) ); - $outer = $this->DB->execute(); - - //----------------------------------------- - // Process... - //----------------------------------------- - - while( $r = $this->DB->fetch( $outer ) ) - { - $seoName = IPSText::makeSeoTitle( $r['members_display_name'] ); - $this->DB->update( 'topics', array( 'starter_name' => $r['members_display_name'], 'seo_first_name' => $seoName ), "starter_id=" . $r['member_id'] ); - $this->DB->update( 'topics', array( 'last_poster_name' => $r['members_display_name'], 'seo_last_name' => $seoName ), "last_poster_id=" . $r['member_id'] ); - - $done++; - } - - //----------------------------------------- - // Finish - or more?... - //----------------------------------------- - - if ( ! $done and ! $max ) - { - //----------------------------------------- - // Done.. - //----------------------------------------- - - $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); - $url = "{$this->settings['base_url']}{$this->form_code}"; - } - else - { - //----------------------------------------- - // More.. - //----------------------------------------- - $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); - $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); - $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; - } - - //----------------------------------------- - // Bye.... - //----------------------------------------- - - $this->_specialRedirect( $url, $text ); - } - - /** - * Rebuild posts - * - * @return @e void - */ - public function rebuildPosts() - { - //----------------------------------------- - // If it's "none", go back - //----------------------------------------- - - if( !$this->request['type'] OR $this->request['type'] == 'none' ) - { - $this->rebuildSplashScreen(); - return; - } - - //----------------------------------------- - // Only need to rebuild once - //----------------------------------------- - - $sections = array(); - $alreadyRebuilt = $this->DB->buildAndFetch( array( 'select' => 'cs_value', 'from' => 'cache_store', 'where' => "cs_key='isRebuilt'" ) ); - - if( $alreadyRebuilt['cs_value'] ) - { - $sections = explode( ',', $alreadyRebuilt['cs_value'] ); - } - - //----------------------------------------- - // Get new parser and old parser - //----------------------------------------- - - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/bbcode/core.php', 'class_bbcode_core' ); - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/bbcode/legacy.php', 'class_bbcode_legacy' ); - $parser = new $classToLoad( $this->registry ); - - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/text/parser.php', 'classes_text_parser' ); - $newParser = new $classToLoad(); - - //----------------------------------------- - // Set up - //----------------------------------------- - - $done = 0; - $last = 0; - $start = intval($this->request['st']) >=0 ? intval($this->request['st']) : 0; - $end = intval( $this->request['pergo'] ) ? intval( $this->request['pergo'] ) : 100; - $dis = intval($this->request['dis']) >=0 ? intval($this->request['dis']) : 0; - $output = array(); - $plugin = null; - - $types = array( 'posts', 'pms', 'announce', 'sigs', 'aboutme', 'rules' ); - - foreach( ipsRegistry::$applications as $app_dir => $app_data ) - { - //----------------------------------------- - // Retrieve the RSS links for the header - //----------------------------------------- - - if( is_file( IPSLib::getAppDir( $app_dir ) . '/extensions/upgradePostRebuild.php' ) ) - { - $className = IPSLib::loadLibrary( IPSLib::getAppDir( $app_dir ) . '/extensions/upgradePostRebuild.php', 'postRebuild_'.$app_dir, $app_dir ); - - if( class_exists( $className ) ) - { - $rebuild = new $className( $this->registry ); - - if( method_exists( $rebuild, "getDropdown" ) ) - { - $options = $rebuild->getDropdown(); - - if( count($options) ) - { - foreach( $options as $appOption ) - { - $types[] = $appOption[0]; - - if( $appOption[0] == $this->request['type'] ) - { - $plugin =& $rebuild; - break 2; - } - } - } - } - } - } - } - - $type = in_array( $this->request['type'], $types ) ? $this->request['type'] : 'posts'; - - //----------------------------------------- - // Got any more? - //----------------------------------------- - - switch( $type ) - { - case 'announce': - $tmp = $this->DB->buildAndFetch( array( 'select' => 'announce_id', 'from' => 'announcements', 'limit' => array($dis,1) ) ); - $max = intval( $tmp['announce_id'] ); - break; - - case 'pms': - $tmp = $this->DB->buildAndFetch( array( 'select' => 'msg_id', 'from' => 'message_posts', 'limit' => array($dis,1) ) ); - $max = intval( $tmp['msg_id'] ); - break; - - case 'sigs': - $tmp = $this->DB->buildAndFetch( array( 'select' => 'pp_member_id', 'from' => 'profile_portal', 'where' => "signature IS NOT NULL AND signature != ''", 'limit' => array($dis,1) ) ); - $max = intval( $tmp['pp_member_id'] ); - break; - - case 'aboutme': - $tmp = $this->DB->buildAndFetch( array( 'select' => 'pp_member_id', 'from' => 'profile_portal', 'where' => "pp_about_me IS NOT NULL AND pp_about_me != ''", 'limit' => array($dis,1) ) ); - $max = intval( $tmp['pp_member_id'] ); - break; - - case 'posts': - $tmp = $this->DB->buildAndFetch( array( 'select' => 'pid', 'from' => 'posts', 'limit' => array($dis,1) ) ); - $max = intval( $tmp['pid'] ); - break; - - case 'rules': - $tmp = $this->DB->buildAndFetch( array( 'select' => 'id', 'from' => 'forums', 'where' => "rules_text IS NOT NULL AND rules_text != ''", 'limit' => array($dis,1) ) ); - $max = intval( $tmp['id'] ); - break; - - default: - $max = $rebuild->getMax( $type, $dis ); - break; - - } - - //----------------------------------------- - // Avoid limit... - //----------------------------------------- - - switch( $type ) - { - case 'announce': - $this->DB->build( array( 'select' => 'a.*', - 'from' => array( 'announcements' => 'a' ), - 'order' => 'a.announce_id ASC', - 'where' => 'a.announce_id > ' . $start, - 'limit' => array($end), - 'add_join' => array( 1 => array( 'type' => 'left', - 'select' => 'm.member_group_id, m.mgroup_others', - 'from' => array( 'members' => 'm' ), - 'where' => "m.member_id=a.announce_member_id" - ) ) - ) ); - break; - - case 'pms': - $this->DB->build( array( 'select' => 'p.*', - 'from' => array( 'message_posts' => 'p' ), - 'order' => 'p.msg_id ASC', - 'where' => 'p.msg_id > ' . $start, - 'limit' => array($end), - 'add_join' => array( 1 => array( 'type' => 'left', - 'select' => 'm.member_group_id, m.mgroup_others', - 'from' => array( 'members' => 'm' ), - 'where' => "m.member_id=p.msg_author_id" - ) ) - ) ); - break; - - case 'sigs': - $this->DB->build( array( 'select' => 'me.signature, me.pp_member_id', - 'from' => array( 'profile_portal' => 'me' ), - 'order' => 'me.pp_member_id ASC', - 'where' => "me.signature IS NOT NULL AND me.signature != '' AND me.pp_member_id > " . $start, - 'limit' => array($end), - 'add_join' => array( 1 => array( 'type' => 'left', - 'select' => 'm.member_group_id, m.mgroup_others', - 'from' => array( 'members' => 'm' ), - 'where' => "m.member_id=me.pp_member_id" - ) ) - ) ); - break; - - case 'aboutme': - $this->DB->build( array( 'select' => 'pp.pp_about_me, pp.pp_member_id', - 'from' => array( 'profile_portal' => 'pp' ), - 'order' => 'pp.pp_member_id ASC', - 'where' => "pp.pp_about_me != '' AND pp.pp_about_me IS NOT NULL AND pp.pp_member_id > " . $start, - 'limit' => array($end), - 'add_join' => array( 1 => array( 'type' => 'left', - 'select' => 'm.member_group_id, m.mgroup_others', - 'from' => array( 'members' => 'm' ), - 'where' => "m.member_id=pp.pp_member_id" - ) ) - ) ); - break; - - case 'posts': - $this->DB->build( array( 'select' => 'p.*', - 'from' => array( 'posts' => 'p' ), - 'order' => 'p.pid ASC', - 'where' => 'p.pid > ' . $start, - 'limit' => array($end), - 'add_join' => array( 1 => array( 'type' => 'left', - 'select' => 't.forum_id', - 'from' => array( 'topics' => 't' ), - 'where' => "t.tid=p.topic_id" - ), - 2 => array( 'type' => 'left', - 'select' => 'm.member_group_id, m.mgroup_others', - 'from' => array( 'members' => 'm' ), - 'where' => "m.member_id=p.author_id" - ) ) - ) ); - break; - - case 'rules': - $this->DB->build( array( 'select' => '*', 'from' => 'forums', 'order' => 'id ASC', 'where' => "rules_text IS NOT NULL AND rules_text != '' AND id > " . $start, 'limit' => array($end) ) ); - break; - - default: - $plugin->executeQuery( $type, $start, $end ); - break; - } - - $outer = $this->DB->execute(); - - //----------------------------------------- - // Process... - //----------------------------------------- - - /* On mssql, the select query blocks all the updates. Doing this causes the engine not to lock */ - if ( method_exists( $this->DB, 'setQueryRowLocking' ) ) - { - $this->DB->setQueryRowLocking( 'OFF' ); - } - - while( $r = $this->DB->fetch( $outer ) ) - { - //----------------------------------------- - // Group - //----------------------------------------- - - if( $r['member_group_id'] ) - { - $r = array_merge( $r, $this->caches['group_cache'][ $r['member_group_id'] ] ); - } - - //----------------------------------------- - // Reset - //----------------------------------------- - - $parser->quote_open = 0; - $parser->quote_closed = 0; - $parser->quote_error = 0; - $parser->error = ''; - $parser->image_count = 0; - $parser->parsing_mgroup = $r['member_group_id']; - $parser->parsing_mgroup_others = $r['mgroup_others']; - - $this->memberData['g_bypass_badwords'] = $this->caches['group_cache'][ $r['member_group_id'] ]['g_bypass_badwords']; - - switch( $type ) - { - case 'announce': - $parser->parse_smilies = 1; - $parser->parse_html = $r['announce_html_enabled']; - $parser->parse_bbcode = 1; - $parser->parse_nl2br = ( $r['announce_html_enabled'] ? $r['announce_nlbr_enabled'] : 1 ); - $parser->parsing_section = 'announcement'; - - $rawpost = $parser->preEditParse( $r['announce_post'] ); - break; - - case 'pms': - $parser->parse_smilies = 1; - $parser->parse_html = $r['g_dohtml']; - $parser->parse_bbcode = 1; - $parser->parse_nl2br = 1; - $parser->parsing_section = 'pms'; - - $rawpost = $parser->preEditParse( $r['msg_post'] ); - break; - - case 'sigs': - $parser->parse_smilies = 0; - $parser->parse_html = $r['g_dohtml']; - $parser->parse_bbcode = 1; - $parser->parse_nl2br = 1; - $parser->parsing_section = 'signatures'; - - $rawpost = $parser->preEditParse( $r['signature'] ); - break; - - case 'aboutme': - $parser->parse_smilies = 1; - $parser->parse_html = $r['g_dohtml']; - $parser->parse_bbcode = 1; - $parser->parse_nl2br = 1; - $parser->parsing_section = 'aboutme'; - - $rawpost = $parser->preEditParse( $r['pp_about_me'] ); - break; - - case 'posts': - $parser->parse_smilies = $r['use_emo']; - $parser->parse_html = ( $r['post_htmlstate'] && $this->registry->class_forums->forum_by_id[ $r['forum_id'] ]['use_html'] && $r['g_dohtml'] ); - $parser->parse_bbcode = $this->registry->class_forums->forum_by_id[ $r['forum_id'] ]['use_ibc']; - $parser->parse_nl2br = 1; - $parser->parsing_section = 'topics'; - - $rawpost = $parser->preEditParse( $r['post'] ); - - $allowHtml = ( $r['post_htmlstate'] && $this->registry->class_forums->forum_by_id[ $r['forum_id'] ]['use_html'] && $r['g_dohtml'] ); - - $newParser->set( array( 'parseArea' => 'topics', - 'memberData' => $r, - 'parseBBCode' => $this->registry->class_forums->forum_by_id[ $r['forum_id'] ]['use_ibc'], - 'parseHtml' => $allowHtml, - 'parseEmoticons' => $r['use_emo'] ) ); - - $rawpost = $newParser->BBCodeToHtml( $rawpost ); - break; - - case 'rules': - $parser->parse_smilies = 1; - $parser->parse_html = 1; - $parser->parse_bbcode = 1; - $parser->parse_nl2br = 1; - $parser->parsing_section = 'rules'; - - $rawpost = $parser->preEditParse( $r['rules_text'] ); - break; - - default: - $plugin->parser =& $parser; - - $rawpost = $plugin->getRawPost( $type, $r ); - break; - } - - /* @link http://community.invisionpower.com/tracker/issue-36434-rebuild-post-content-remove-break-from-post-content/ New parser retains
    , legacy retains \n */ - if ( $type == 'posts' || $type == 'sigs' ) - { - /* Anything special here? */ - $newpost = $rawpost; - } - else - { - if ( strstr( $rawpost, "\n" ) ) - { - $rawpost = nl2br( $rawpost ); - } - - $newpost = $parser->preDbParse( $rawpost ); - } - - - //----------------------------------------- - // Remove old \' escaping - //----------------------------------------- - - $newpost = str_replace( "\\'", "'", $newpost ); - - //----------------------------------------- - // Convert old dohtml? - //----------------------------------------- - - $htmlstate = 0; - - if ( strstr( strtolower($newpost), '[dohtml]' ) ) - { - //----------------------------------------- - // Can we use HTML? - //----------------------------------------- - - if ( $type == 'posts' AND $this->registry->class_forums->forum_by_id[ $r['forum_id'] ]['use_html'] ) - { - $htmlstate = 2; - } - - $newpost = preg_replace( "#\[dohtml\]#i" , "", $newpost ); - $newpost = preg_replace( "#\[/dohtml\]#i", "", $newpost ); - } - else - { - $htmlstate = intval( $r['post_htmlstate'] ); - } - - //----------------------------------------- - // Convert old attachment tags - //----------------------------------------- - - $newpost = preg_replace( "#\[attachmentid=(\d+?)\]#is", "[attachment=\\1:attachment]", $newpost ); - - if ( $newpost OR $type == 'sigs' OR $type == 'aboutme' ) - { - switch( $type ) - { - case 'posts': - $this->DB->update( 'posts', array( 'post' => $newpost, 'post_htmlstate' => $htmlstate ), 'pid='.$r['pid'] ); - $last = $r['pid']; - break; - - case 'pms': - $this->DB->update( 'message_posts', array( 'msg_post' => $newpost ), 'msg_id='.$r['msg_id'] ); - $last = $r['msg_id']; - break; - - case 'sigs': - $this->DB->update( 'profile_portal', array( 'signature' => $newpost ), 'pp_member_id='.$r['pp_member_id'] ); - $last = $r['pp_member_id']; - break; - - case 'aboutme': - $this->DB->update( 'profile_portal', array( 'pp_about_me' => $newpost ), 'pp_member_id='.$r['pp_member_id'] ); - $last = $r['pp_member_id']; - break; - - case 'announce': - $this->DB->update( 'announcements', array( 'announce_post' => $newpost ), 'announce_id='.$r['announce_id'] ); - $last = $r['announce_id']; - break; - - case 'rules': - $this->DB->update( 'forums', array( 'rules_text' => $newpost ), 'id='.$r['id'] ); - $last = $r['id']; - break; - - default: - $last = $plugin->storeNewPost( $type, $r, $newpost ); - break; - } - } - - $done++; - } - - if ( method_exists( $this->DB, 'setQueryRowLocking' ) ) - { - $this->DB->setQueryRowLocking( 'ON' ); - } - - //----------------------------------------- - // Finish - or more?... - //----------------------------------------- - - if ( ! $last and ! $max ) - { - //----------------------------------------- - // Done.. - //----------------------------------------- - - $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); - $url = "{$this->settings['base_url']}{$this->form_code}"; - - $sections[] = $type; - $this->DB->replace( 'cache_store', array( 'cs_key' => 'isRebuilt', 'cs_value' => implode( ',', $sections ) ), array( "cs_key" ) ); - - if( $type == 'posts' ) - { - $this->DB->delete( 'content_cache_posts' ); - } - else if( $type == 'sigs' ) - { - $this->DB->delete( 'content_cache_sigs' ); - } - } - else - { - //----------------------------------------- - // More.. - //----------------------------------------- - - $dis = $dis + $done; - $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); - $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); - $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&type={$type}&pergo={$this->request['pergo']}&st={$last}&dis={$dis}"; - } - - //----------------------------------------- - // Bye.... - //----------------------------------------- - - $this->_specialRedirect( $url, $text ); - } - - /** - * Resyncronize Topics - * - * @return @e void - */ - public function resyncTopics() - { - $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/moderate.php', 'moderatorLibrary', 'forums' ); - $modfunc = new $classToLoad( $this->registry ); - - $this->registry->class_localization->loadLanguageFile( array( 'public_global' ) ); - - //----------------------------------------- - // Set up - //----------------------------------------- - - $done = 0; - $start = intval( $this->request['st'] ) >= 0 ? intval( $this->request['st'] ) : 0; - $end = intval( $this->request['pergo'] ) ? intval( $this->request['pergo'] ) : 100; - $last = $start + 1; - $output = array(); - - //----------------------------------------- - // Got any more? - //----------------------------------------- - - $tmp = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'topics', 'where' => "state != 'link' AND tid>{$start} AND topic_archive_status NOT IN (" . $this->registry->class_forums->fetchTopicArchiveFlag( 'working' ) . "," . $this->registry->class_forums->fetchTopicArchiveFlag( 'restore' ) . ")", 'limit' => array( 0, 1 ) ) ); - $max = intval( $tmp['count'] ); - - //----------------------------------------- - // Avoid limit... - //----------------------------------------- - - $this->DB->build( array( 'select' => '*', 'from' => 'topics', 'where' => "state != 'link' AND tid>{$start} AND topic_archive_status NOT IN (" . $this->registry->class_forums->fetchTopicArchiveFlag( 'working' ) . "," . $this->registry->class_forums->fetchTopicArchiveFlag( 'restore' ) . ")", 'order' => 'tid ASC', 'limit' => array( 0, $end ) ) ); - $outer = $this->DB->execute(); - - //----------------------------------------- - // Process... - //----------------------------------------- - - while( $r = $this->DB->fetch( $outer ) ) - { - $modfunc->rebuildTopic($r['tid'], 0); - - if ( $this->request['pergo'] <= 200 ) - { - $output[] = $this->lang->words['re_processed'].$r['title']; - } - - $done++; - $last = $r['tid']; - } - - //----------------------------------------- - // Finish - or more?... - //----------------------------------------- - - if ( ! $done and ! $max ) - { - //----------------------------------------- - // Done.. - //----------------------------------------- - - $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); - $url = "{$this->settings['base_url']}{$this->form_code}"; - } - else - { - //----------------------------------------- - // More.. - //----------------------------------------- - - $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $last ); - $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); - $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$last}"; - } - - //----------------------------------------- - // Bye.... - //----------------------------------------- - - $this->_specialRedirect( $url, $text ); - } - - /** - * Resyncronize forum data - * - * @return @e void - */ - public function resyncForums() - { - $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/moderate.php', 'moderatorLibrary', 'forums' ); - $modfunc = new $classToLoad( $this->registry ); - - //----------------------------------------- - // Set up - //----------------------------------------- - - $done = 0; - $start = intval( $this->request['st'] ) >= 0 ? intval( $this->request['st'] ) : 0; - $end = intval( $this->request['pergo'] ) ? intval( $this->request['pergo'] ) : 100; - $dis = $end + $start; - $output = array(); - - //----------------------------------------- - // Got any more? - //----------------------------------------- - - $tmp = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'forums', 'limit' => array( $dis, 1 ) ) ); - $max = intval( $tmp['count'] ); - - //----------------------------------------- - // Avoid limit... - //----------------------------------------- - - $this->DB->build( array( 'select' => '*', 'from' => 'forums', 'order' => 'id ASC', 'limit' => array( $start, $end ) ) ); - $outer = $this->DB->execute(); - - //----------------------------------------- - // Process... - //----------------------------------------- - - while( $r = $this->DB->fetch( $outer ) ) - { - $modfunc->forumRecount( $r['id'] ); - $output[] = sprintf( $this->lang->words['rebuild_process_f'], $r['name'] ); - $done++; - } - - //----------------------------------------- - // Finish - or more?... - //----------------------------------------- - - if ( ! $done and ! $max ) - { - //----------------------------------------- - // Done.. - //----------------------------------------- - - $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); - $url = "{$this->settings['base_url']}{$this->form_code}"; - } - else - { - //----------------------------------------- - // More.. - //----------------------------------------- - $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); - $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); - $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; - } - - //----------------------------------------- - // Bye.... - //----------------------------------------- - - $this->_specialRedirect( $url, $text ); - } - - /** - * Splash screen with rebuild options - * - * @return @e void - */ - public function rebuildSplashScreen() - { - /* Build Form Elements */ - $form = array(); - - $form['posts'] = $this->registry->output->formDropdown( 'posts' , array( 0 => array( 0, $this->lang->words['yesno_no'] ), 1 => array( 1, $this->lang->words['yesno_yes'] ) ) ); - $form['members'] = $this->registry->output->formDropdown( 'members', array( 0 => array( 0, $this->lang->words['yesno_no'] ), 1 => array( 1, $this->lang->words['yesno_yes'] ) ) ); - $form['lastreg'] = $this->registry->output->formDropdown( 'lastreg', array( 0 => array( 0, $this->lang->words['yesno_no'] ), 1 => array( 1, $this->lang->words['yesno_yes'] ) ) ); - $form['online'] = $this->registry->output->formDropdown( 'online' , array( 0 => array( 0, $this->lang->words['yesno_no'] ), 1 => array( 1, $this->lang->words['yesno_yes'] ) ) ); - - //----------------------------------------- - // Only need to rebuild once - //----------------------------------------- - - $todo = array( - array( 'posts' , $this->lang->words['remenu_posts'] ), - array( 'pms' , $this->lang->words['remenu_pms'] ), - array( 'announce', $this->lang->words['remenu_announce'] ), - array( 'sigs' , $this->lang->words['remenu_sigs'] ), - array( 'aboutme' , $this->lang->words['remenu_aboutme'] ), - array( 'rules' , $this->lang->words['remenu_rules'] ), - ); - - foreach( ipsRegistry::$applications as $app_dir => $app_data ) - { - //----------------------------------------- - // Retrieve the RSS links for the header - //----------------------------------------- - - if( is_file( IPSLib::getAppDir( $app_dir ) . '/extensions/upgradePostRebuild.php' ) ) - { - $className = IPSLib::loadLibrary( IPSLib::getAppDir( $app_dir ) . '/extensions/upgradePostRebuild.php', 'postRebuild_'.$app_dir, $app_dir ); - - if( class_exists( $className ) ) - { - $rebuild = new $className( $this->registry ); - - if( method_exists( $rebuild, "getDropdown" ) ) - { - $todo = array_merge( $todo, $rebuild->getDropdown() ); - } - } - } - } - - $final = array(); - $sections = array(); - - $alreadyRebuilt = $this->DB->buildAndFetch( array( 'select' => 'cs_value', 'from' => 'cache_store', 'where' => "cs_key='isRebuilt'" ) ); - - if( $alreadyRebuilt['cs_value'] ) - { - $sections = explode( ',', $alreadyRebuilt['cs_value'] ); - } - - $form['pergo'] = $this->registry->output->formSimpleInput( 'pergo', '50', 5 ); - - /* Output */ - $this->registry->output->html .= $this->html->rebuildSplashScreen( $form, $todo, $sections ); - } - - /** - * Redirect via a temporary page - * - * @param string $url URL to redirect to - * @param string $text Text to display - * @return @e void - */ - protected function _specialRedirect( $url, $text ) - { - $this->registry->output->html .= $this->registry->output->global_template->temporaryRedirect( $url, $text ); - } + + * Invision Power Services + * IP.Board v3.4.6 + * Rebuild & Other Tools + * Last Updated: $LastChangedDate: 2013-10-14 15:30:19 -0400 (Mon, 14 Oct 2013) $ + * + * + * @author $Author: AndyMillne $ + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license http://www.invisionpower.com/company/standards.php#license + * @package IP.Board + * @subpackage Core + * @link http://www.invisionpower.com + * @version $Rev: 12376 $ + */ + +if ( ! defined( 'IN_ACP' ) ) +{ + print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; + exit(); +} + +class admin_core_tools_rebuild extends ipsCommand +{ + /** + * Skin object + * + * @var object Skin templates + */ + protected $html; + + /**#@+ + * URL bits + * + * @var string + */ + public $form_code = ''; + public $form_code_js = ''; + /**#@-*/ + + /** + * Main class entry point + * + * @param object ipsRegistry reference + * @return @e void [Outputs to screen] + */ + public function doExecute( ipsRegistry $registry ) + { + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'applications/forums/sources/classes/forums/class_forums.php', 'class_forums', 'forums' ); + $this->registry->setClass( 'class_forums', new $classToLoad( $registry ) ); + $this->registry->class_forums->forumsInit(); + + /* Load lang and skin */ + $this->registry->class_localization->loadLanguageFile( array( 'admin_tools' ) ); + $this->html = $this->registry->output->loadTemplate( 'cp_skin_rebuild' ); + + /* URLs */ + $this->form_code = $this->html->form_code = 'module=tools&section=rebuild'; + $this->form_code_js = $this->html->form_code_js = 'module=tools§ion=rebuild'; + + /* What to do */ + switch( $this->request['do'] ) + { + case 'docount': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_recount' ); + $this->doCount(); + break; + + case 'doresyncforums': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_resynch' ); + $this->resyncForums(); + break; + + case 'doresynctopics': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_resyncht' ); + $this->resyncTopics(); + break; + + case 'doposts': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_rebuild' ); + $this->rebuildPosts(); + break; + + case 'dopostnames': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_postcounts' ); + $this->rebuildPostNames(); + break; + + case 'dopostcounts': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_postcounts' ); + $this->rebuildPostCount(); + break; + + case 'doreputationcount': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_postcounts' ); + $this->rebuildReputationCount(); + break; + + case 'dothumbnails': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_thumbs' ); + $this->rebuildThumbnails(); + break; + + case 'dophotos': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_thumbs' ); + $this->rebuildPhotos(); + break; + + case 'doattachdata': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_attach' ); + $this->rebuildAttachdata(); + break; + + case 'doseousernames': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_rebuild' ); + $this->rebuildSeoUserNames(); + break; + case 'cleanattachments': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_orphaned' ); + $this->cleanAttachments(); + break; + + case 'cleanphotos': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_orphanp' ); + $this->cleanPhotos(); + break; + + case 'domsgcounts': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'tools_postcounts' ); + $this->rebuildMsgCounts(); + break; + + //----------------------------------------- + // Tools + //----------------------------------------- + + case '320photos': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'cleanup_manage' ); + $this->tools320Photos(); + break; + + case '300pms': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'cleanup_manage' ); + $this->tools300Pms(); + break; + + case '220tool_contacts': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'cleanup_manage' ); + $this->tools220Contacts(); + break; + + case '210polls': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'cleanup_manage' ); + $this->tools210Polls(); + break; + + case '210calevents': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'cleanup_manage' ); + $this->tools210Calevents(); + break; + + case '210tool_settings': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'cleanup_manage' ); + $this->tools210DupeSettings(); + break; + + case 'tool_settings': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'cleanup_manage' ); + $this->toolsDupeSettings(); + break; + + case 'tool_converge': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'cleanup_manage' ); + $this->toolsConverge(); + break; + + case 'tool_bansettings': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'cleanup_manage' ); + $this->toolBanSettings(); + break; + + case 'tools': + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'cleanup_manage' ); + $this->toolsSplashScreen(); + break; + + case 'rebuild_overview': + default: + $this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'rebuild_manage' ); + $this->rebuildSplashScreen(); + break; + } + + /* Output */ + $this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper(); + $this->registry->output->sendOutput(); + } + + /** + * 3.2.x Tools: Convert photos + * + * @return @e void + */ + public function tools320photos() + { + /* INIT */ + $convertFrom = $this->request['from'] == 'avatars' ? 'avatars' : 'photos'; + $st = intval($this->request['st']); + $did = 0; + $each = 200; + + /* Photo library */ + require_once( IPS_ROOT_PATH . 'sources/classes/member/photo.php' );/*noLibHook*/ + $photo = new classes_member_photo( $this->registry ); + + /* Loop over members */ + $this->DB->build( array( 'select' => '*', 'from' => 'profile_portal', 'order' => 'pp_member_id ASC', 'limit' => array( $st, $each ) ) ); + $outer = $this->DB->execute(); + + while( $r = $this->DB->fetch($outer) ) + { + $did++; + + $update = array(); + + if( $r['fb_photo'] ) + { + $update['pp_photo_type'] = 'facebook'; + } + else if( $r['tc_photo'] ) + { + $update['pp_photo_type'] = 'twitter'; + } + else + { + if( $convertFrom == 'avatars' ) + { + if( $r['avatar_type'] == 'upload' AND $r['avatar_location'] ) + { + $update['pp_photo_type'] = 'custom'; + $update['pp_main_photo'] = $r['avatar_location']; + $_dims = @getimagesize( $this->settings['upload_dir'] . '/' . $r['avatar_location'] ); + $update['pp_main_width'] = $_dims[0]; + $update['pp_main_height'] = $_dims[1]; + } + else if( $r['avatar_type'] == 'gravatar' ) + { + $update['pp_photo_type'] = 'gravatar'; + $update['pp_gravatar'] = $r['avatar_location']; + + $md5Gravatar = md5( $update['pp_gravatar'] ); + + $_url = "http://www.gravatar.com"; + + if( $this->registry->output->isHTTPS ) + { + $_url = "https://secure.gravatar.com"; + } + + $update['pp_main_photo'] = $_url . "/avatar/" .$md5Gravatar . "?s=100"; + $update['pp_main_width'] = 100; + $update['pp_main_height'] = 100; + $update['pp_thumb_photo'] = $_url . "/avatar/" .$md5Gravatar . "?s=100"; + $update['pp_thumb_width'] = 100; + $update['pp_thumb_height'] = 100; + } + } + else + { + if( $r['pp_main_photo'] ) + { + $update['pp_photo_type'] = 'custom'; + $update['pp_main_photo'] = $r['pp_main_photo']; + } + } + } + + if( $update['pp_photo_type'] == 'custom' ) + { + $info = $photo->buildSizedPhotos( str_replace( 'upload:', '', $update['pp_main_photo'] ), $r['pp_member_id'], true ); + + $update['pp_main_width'] = intval( $info['final_width'] ); + $update['pp_main_height'] = intval( $info['final_height'] ); + $update['pp_thumb_photo'] = $info['t_final_location'] ? $info['t_final_location'] : $info['final_location']; + $update['pp_thumb_width'] = intval( $info['t_final_width'] ); + $update['pp_thumb_height'] = intval( $info['t_final_height'] ); + } + + if( count($update) ) + { + $this->DB->update( 'profile_portal', $update, 'pp_member_id=' . $r['pp_member_id'] ); + } + } + + /* Show message and redirect */ + if( $did > 0 ) + { + $this->request['st'] = ( $st + $did ); + + $url = "{$this->settings['base_url']}{$this->form_code}&do=" . $this->request['do'] . '&from=' . $this->request['from'] . '&st=' . $this->request['st']; + + $this->_specialRedirect( $url, sprintf( $this->lang->words['tools320photos'], $this->request['st'], $did ) ); + } + else + { + $this->registry->output->redirect( $this->settings['base_url'] . $this->form_code . '&do=tools', $this->lang->words['re_photosconverted'] ); + } + } + + /** + * 3.0.x Tools: PM Conversion + * + * @return @e void + */ + public function tools300pms() + { + /* INIT */ + $pergo = 100; + $start = intval( $this->request['st'] ); + $converted = 0; + $seen = 0; + + //----------------------------------------- + // Check to make sure table exists + //----------------------------------------- + + if ( ! $this->DB->checkForTable( 'message_text' ) ) + { + $this->registry->output->global_message = $this->lang->words['re_msgsconverted']; + $this->toolsSplashScreen(); + return; + } + + + /* Select max topic ID thus far */ + $_tmp = $this->DB->buildAndFetch( array( 'select' => 'MAX(mt_id) as max', + 'from' => 'message_topics' ) ); + + $topicID = intval( $_tmp['max'] ); + + $this->DB->build( array( 'select' => '*', + 'from' => 'message_text', + 'order' => 'msg_id ASC', + 'limit' => array( $start, $pergo ) ) ); + + $o = $this->DB->execute(); + + while( $post = $this->DB->fetch( $o ) ) + { + $seen++; + + /* Make sure all data is valid */ + if ( intval( $post['msg_sent_to_count'] ) < 1 ) + { + continue; + } + + /* a little set up */ + $oldTopics = array(); + + /* Now fetch all topics */ + $this->DB->build( array( 'select' => '*', + 'from' => 'message_topics_old', + 'where' => 'mt_msg_id=' . intval( $post['msg_id'] ) ) ); + + $t = $this->DB->execute(); + + while( $topic = $this->DB->fetch( $t ) ) + { + /* Got any data? */ + if ( ! $topic['mt_from_id'] OR ! $topic['mt_to_id'] ) + { + continue; + } + + $oldTopics[ $topic['mt_id'] ] = $topic; + } + + /* Fail safe */ + if ( ! count( $oldTopics ) ) + { + continue; + } + + /* Increment number */ + $topicID++; + + /* Add in the post */ + $this->DB->insert( 'message_posts', array( 'msg_topic_id' => $topicID, + 'msg_date' => $post['msg_date'], + 'msg_post' => $post['msg_post'], + 'msg_post_key' => $post['msg_post_key'], + 'msg_author_id' => $post['msg_author_id'], + 'msg_ip_address' => $post['msg_ip_address'], + 'msg_is_first_post' => 1 ) ); + $postID = $this->DB->getInsertId(); + + /* Update attachments */ + $this->DB->update( 'attachments', array( 'attach_rel_id' => $postID ), "attach_rel_module='msg' AND attach_rel_id=".$post['msg_id'] ); + + /* Define some stuff. "To" member is added last in IPB 2 */ + $_tmp = $oldTopics; + ksort( $_tmp ); + $topicData = array_pop( $_tmp ); + $_invited = array(); + $_seenOwner = array(); + $_isDeleted = 0; + + /* Add the member rows */ + foreach( $oldTopics as $mt_id => $data ) + { + /* Prevent SQL error with unique index: Seen the owner ID already? */ + if ( $_seenOwner[ $data['mt_owner_id'] ] ) + { + continue; + } + + $_seenOwner[ $data['mt_owner_id'] ] = $data['mt_owner_id']; + + /* Build invited - does not include 'to' person */ + if ( $data['mt_owner_id'] AND ( $post['msg_author_id'] != $data['mt_owner_id'] ) AND ( $topicData['mt_to_id'] != $data['mt_owner_id'] ) ) + { + $_invited[ $data['mt_owner_id'] ] = $data['mt_owner_id'];/*noLibHook*/ + } + + $_isSent = ( $data['mt_vid_folder'] == 'sent' ) ? 1 : 0; + $_isDraft = ( $data['mt_vid_folder'] == 'unsent' ) ? 1 : 0; + + $this->DB->insert( 'message_topic_user_map', array( 'map_user_id' => $data['mt_owner_id'], + 'map_topic_id' => $topicID, + 'map_folder_id' => ( $_isDraft ) ? 'drafts' : 'myconvo', + 'map_read_time' => ( $data['mt_user_read'] ) ? $data['mt_user_read'] : ( $data['mt_read'] ? time() : 0 ), + 'map_user_active' => 1, + 'map_user_banned' => 0, + 'map_has_unread' => 0, //( $data['mt_read'] ) ? 0 : 1, + 'map_is_system' => 0, + 'map_last_topic_reply' => $post['msg_date'], + 'map_is_starter' => ( $data['mt_owner_id'] == $post['msg_author_id'] ) ? 1 : 0 ) ); + + } + + /* Now, did we see the author? If not, add them too but as inactive */ + if ( ! $_seenOwner[ $post['msg_author_id'] ] ) + { + $_isDeleted = 1; + + /*$this->DB->insert( 'message_topic_user_map', array( 'map_user_id' => $post['msg_author_id'], + 'map_topic_id' => $topicID, + 'map_folder_id' => 'myconvo', + 'map_read_time' => 0, + 'map_user_active' => 0, + 'map_user_banned' => 0, + 'map_has_unread' => 0, + 'map_is_system' => 0, + 'map_is_starter' => 1 ) );*/ + } + + $_isSent = ( $topicData['mt_vid_folder'] == 'sent' ) ? 1 : 0; + $_isDraft = ( $topicData['mt_vid_folder'] == 'unsent' ) ? 1 : 0; + + /* This is for MSSQL. I need a quick fix. This is it. Enjoy. */ + if ( method_exists( $this->DB, 'setTableIdentityInsert' ) ) + { + $this->DB->setTableIdentityInsert( 'message_topics', 'ON' ); + } + + /* Add the topic */ + $this->DB->insert( 'message_topics', array( 'mt_id' => $topicID, + 'mt_date' => $topicData['mt_date'], + 'mt_title' => $topicData['mt_title'], + 'mt_starter_id' => $post['msg_author_id'], + 'mt_start_time' => $post['msg_date'], + 'mt_last_post_time' => $post['msg_date'], + 'mt_invited_members' => serialize( array_keys( $_invited ) ), + 'mt_to_count' => count( array_keys( $_invited ) ) + 1, + 'mt_to_member_id' => $topicData['mt_to_id'], + 'mt_replies' => 0, + 'mt_last_msg_id' => $postID, + 'mt_first_msg_id' => $postID, + 'mt_is_draft' => $_isDraft, + 'mt_is_deleted' => $_isDeleted, + 'mt_is_system' => 0 ) ); + + /* This is for MSSQL. I need a quick fix. This is it. Enjoy. */ + if ( method_exists( $this->DB, 'setTableIdentityInsert' ) ) + { + $this->DB->setTableIdentityInsert( 'message_topics', 'OFF' ); + } + + $converted++; + } + + /* What to do? */ + if ( $seen ) + { + $this->request['st'] = $start + $pergo; + + /* Re-do Page */ + $url = "{$this->settings['base_url']}{$this->form_code}&do=".$this->request['do'].'&st=' . $this->request['st']; + + $this->_specialRedirect( $url, sprintf( $this->lang->words['tools300pms'], $this->request['st'], $converted ) ); + } + else + { + /* Update all members */ + $this->DB->update( 'members', array( 'msg_count_reset' => 1 ) ); + + $this->registry->output->redirect( "{$this->settings['base_url']}{$this->form_code}&do=tools", $this->lang->words['re_pmsconverted'], 1 ); + } + } + + /** + * Tools: Ban Settings + * + * @return @e void + */ + public function toolBanSettings() + { + //----------------------------------------- + // Init + //----------------------------------------- + + $bomb = array(); + $ban = array(); + $ip_count = 0; + $email_count = 0; + $name_count = 0; + + //----------------------------------------- + // Get current entries + //----------------------------------------- + + $this->DB->build( array( 'select' => '*', 'from' => 'banfilters', 'order' => 'ban_date desc' ) ); + $this->DB->execute(); + + while ( $r = $this->DB->fetch() ) + { + $ban[ $r['ban_type'] ][ $r['ban_content'] ] = $r; + } + + //----------------------------------------- + // Get $INFO (again) ip email name + //----------------------------------------- + $INFO = array(); + require( DOC_IPS_ROOT_PATH . 'conf_global.php' );/*noLibHook*/ + + //----------------------------------------- + // IP + //----------------------------------------- + + if ( $INFO['ban_ip'] ) + { + $bomb = explode( '|', $INFO['ban_ip'] ); + + if ( is_array( $bomb ) and count( $bomb ) ) + { + foreach( $bomb as $bang ) + { + if ( ! is_array($ban['ip'][ $bang ]) ) + { + $this->DB->insert( 'banfilters', array( 'ban_type' => 'ip', 'ban_content' => $bang, 'ban_date' => time() ) ); + + $ip_count++; + } + } + } + } + + //----------------------------------------- + // EMAIL + //----------------------------------------- + + if ( $INFO['ban_email'] ) + { + $bomb = explode( '|', $INFO['ban_email'] ); + + if ( is_array( $bomb ) and count( $bomb ) ) + { + foreach( $bomb as $bang ) + { + if ( ! is_array($ban['email'][ $bang ]) ) + { + $this->DB->insert( 'banfilters', array( 'ban_type' => 'email', 'ban_content' => $bang, 'ban_date' => time() ) ); + + $email_count++; + } + } + } + } + + //----------------------------------------- + // EMAIL + //----------------------------------------- + + if ( $INFO['ban_names'] ) + { + $bomb = explode( '|', $INFO['ban_names'] ); + + if ( is_array( $bomb ) and count( $bomb ) ) + { + foreach( $bomb as $bang ) + { + if ( ! is_array($ban['name'][ $bang ]) ) + { + $this->DB->insert( 'banfilters', array( 'ban_type' => 'name', 'ban_content' => $bang, 'ban_date' => time() ) ); + + $name_count++; + } + } + } + } + + $this->registry->output->global_message = sprintf( $this->lang->words['re_bansimport'], $ip_count, $email_count, $name_count ); + + $this->cache->rebuildCache( 'banfilters', 'global' ); + + $this->toolsSplashScreen(); + } + + /** + * 2.0.0 Tools: Converge + * + * @return @e void + */ + public function toolsConverge() + { + //----------------------------------------- + // Get all validating members... + //----------------------------------------- + + $to_unconverge = array(); + $unconverge_count = 0; + + $this->DB->build( array( 'select' => 'member_id, email, member_group_id', 'from' => 'members', 'where' => 'member_group_id='.$this->settings['auth_group'] ) ); + $this->DB->execute(); + + while( $m = $this->DB->fetch() ) + { + if ( preg_match( "#^{$m['member_id']}\-#", $m['email'] ) ) + { + $to_unconverge[] = $m['member_id']; + } + } + + $unconverge_count = intval( count( $to_unconverge ) ); + + if ( $unconverge_count ) + { + foreach( $to_unconverge as $mid ) + { + $this->DB->update( 'members' , array( 'member_group_id' => $this->settings['member_group'] ), 'member_id='.$mid ); + } + } + + //----------------------------------------- + // Time to move on dude + //----------------------------------------- + + $this->registry->output->global_message = (sprintf( $this->lang->words['re_convergerest'], $unconverge_count ) ); + $this->toolsSplashScreen(); + } + + /** + * 2.0.0 Tools: Dupe Settings + * + * @return @e void + */ + public function toolsDupeSettings() + { + //----------------------------------------- + // Remove dupe categories + //----------------------------------------- + + $title_id_to_keep = array(); + $title_id_to_delete = array(); + $title_deleted_count = 0; + + $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_settings_titles', 'order' => 'conf_title_id' ) ); + $this->DB->execute(); + + while ( $r = $this->DB->fetch() ) + { + if ( $title_id_to_keep[ $r['conf_title_title'] ] ) + { + $title_id_to_delete[ $r['conf_title_id'] ] = $r['conf_title_id']; + } + else + { + $title_id_to_keep[ $r['conf_title_title'] ] = $r['conf_title_id']; + } + } + + if ( count( $title_id_to_delete ) ) + { + $this->DB->delete( 'conf_settings_titles', 'conf_title_id IN ('.implode( ',', $title_id_to_delete ).')' ); + } + + $title_deleted_count = intval( count($title_id_to_delete) ); + + //----------------------------------------- + // Remove dupe settings + //----------------------------------------- + + $setting_id_to_keep = array(); + $setting_id_to_delete = array(); + $setting_id_deleted_count = 0; + + $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_conf_settings', 'order' => 'conf_id' ) ); + $this->DB->execute(); + + while ( $r = $this->DB->fetch() ) + { + if ( $setting_id_to_keep[ $r['conf_title'].','.$r['conf_key'] ] ) + { + $setting_id_to_delete[ $r['conf_id'] ] = $r['conf_id']; + } + else + { + $setting_id_to_keep[ $r['conf_title'].','.$r['conf_key'] ] = $r['conf_id']; + } + } + + if ( count( $setting_id_to_delete ) ) + { + $this->DB->delete( 'conf_settings', 'conf_id IN ('.implode( ',', $setting_id_to_delete ).')' ); + } + + $setting_deleted_count = intval( count($setting_id_to_delete) ); + + //----------------------------------------- + // Time to move on dude + //----------------------------------------- + + $this->registry->output->global_message = sprintf( $this->lang->words['re_deletetitle'], $title_deleted_count, $setting_deleted_count ) ; + $this->toolsSplashScreen(); + } + + /** + * 2.1.0 Tools: Dupe Settings + * + * @return @e void + */ + public function tools210DupeSettings() + { + //----------------------------------------- + // Remove dupe categories + //----------------------------------------- + + $title_id_to_keep = array(); + $title_id_to_delete = array(); + $title_deleted_count = 0; + $msg = ''; + + $this->DB->build( array( 'select' => '*', 'from' => 'core_sys_settings_titles', 'order' => 'conf_title_id DESC' ) ); + $this->DB->execute(); + + while ( $r = $this->DB->fetch() ) + { + if ( $title_id_to_keep[ $r['conf_title_title'] ] ) + { + $title_id_to_delete[ $r['conf_title_id'] ] = $r['conf_title_id']; + + $msg .= sprintf( $this->lang->words['re_deletingid'], $r['conf_title_title'], $r['conf_title_id'] ) . "
    "; + } + else + { + $title_id_to_keep[ $r['conf_title_title'] ] = $r['conf_title_id']; + $msg .= sprintf( $this->lang->words['re_keepingid'], $r['conf_title_title'], $r['conf_title_id'] ) . "
    "; + } + } + + if ( count( $title_id_to_delete ) ) + { + $this->DB->delete( 'core_sys_conf_settings', 'conf_title_id IN ('.implode( ',', $title_id_to_delete ).')' ); + } + + $title_deleted_count = intval( count($title_id_to_delete) ); + + //----------------------------------------- + // Time to move on dude + //----------------------------------------- + + $this->registry->output->global_message = sprintf( $this->lang->words['re_duplicatetitle'], $title_deleted_count, $msg ); + $this->toolsSplashScreen(); + } + + /** + * 2.1.0 Tools: Calendar Events + * + * @return @e void + */ + public function tools210Calevents() + { + $start = intval($_GET['st']); + $lend = 50; + $end = $start + $lend; + $max = intval($_GET['max']); + + //----------------------------------------- + // Check to make sure table exists + //----------------------------------------- + + if ( ! $this->DB->checkForTable( 'calendar_events' ) ) + { + $this->registry->output->global_message = $this->lang->words['re_calremoved']; + $this->toolsSplashScreen(); + return; + } + + //----------------------------------------- + // Do we need to run this tool? + //----------------------------------------- + + if ( ! $max ) + { + $original = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as max', 'from' => 'calendar_events' ) ); + $new = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as max', 'from' => 'cal_events' ) ); + + if ( $new['max'] >= $original['max'] OR ! $original['max'] ) + { + $this->registry->output->global_message = $this->lang->words['re_calalready']; + $this->toolsSplashScreen(); + } + } + + $max = intval( $original['max'] ); + + //----------------------------------------- + // In steps... + //----------------------------------------- + + $this->DB->build( array( 'select' => '*', 'from' => 'calendar_events', 'limit' => array( $start, $lend ) ) ); + $o = $this->DB->execute(); + + //----------------------------------------- + // Do it... + //----------------------------------------- + + if ( $this->DB->getTotalRows($o) ) + { + //----------------------------------------- + // Got some to convert! + //----------------------------------------- + + while ( $r = $this->DB->fetch($o) ) + { + $recur_remap = array( 'w' => 1, + 'm' => 2, + 'y' => 3 ); + + $begin_date = IPSTime::date_getgmdate( $r['unix_stamp'] ); + $end_date = IPSTime::date_getgmdate( $r['end_unix_stamp'] ); + + if ( ! $begin_date OR ! $end_date ) + { + continue; + } + + $day = $begin_date['mday']; + $month = $begin_date['mon']; + $year = $begin_date['year']; + + $end_day = $end_date['mday']; + $end_month = $end_date['mon']; + $end_year = $end_date['year']; + + $_final_unix_from = gmmktime(0, 0, 0, $month, $day, $year ); + + //----------------------------------------- + // Recur or ranged... + //----------------------------------------- + + if ( $r['event_repeat'] OR $r['event_ranged'] ) + { + $_final_unix_to = gmmktime(23, 59, 59, $end_month, $end_day, $end_year); + } + else + { + $_final_unix_to = 0; + } + + $new_event = array( 'event_calendar_id' => 1, + 'event_member_id' => $r['userid'], + 'event_content' => $r['event_text'], + 'event_title' => $r['title'], + 'event_smilies' => $r['show_emoticons'], + 'event_perms' => $r['read_perms'], + 'event_private' => $r['priv_event'], + 'event_approved' => 1, + 'event_unixstamp' => $r['unix_stamp'], + 'event_recurring' => ( $r['event_repeat'] && $recur_remap[ $r['repeat_unit'] ] ) ? $recur_remap[ $r['repeat_unit'] ] : 0, + 'event_tz' => 0, + 'event_unix_from' => $_final_unix_from, + 'event_unix_to' => $_final_unix_to ); + + //----------------------------------------- + // INSERT + //----------------------------------------- + + $this->DB->insert( 'cal_events', $new_event ); + } + + $this->registry->output->global_message = sprintf( $this->lang->words['re_calstartto'], $start, $end ); + + $url = "{$this->settings['base_url']}{$this->form_code}&do=".$this->request['do'].'&max='.$max.'&st='.$end; + } + else + { + $this->registry->output->global_message = $this->lang->words['re_calsconverted']; + + $url = "{$this->settings['base_url']}{$this->form_code}&do=tools"; + } + + //----------------------------------------- + // Bye.... + //----------------------------------------- + + $this->registry->output->redirect( $url, $this->registry->output->global_message ); + } + + /** + * 2.1.0 Tools: Polls + * + * @return @e void + */ + public function tools210Polls() + { + $start = intval( $this->request['st'] ); + $lend = 50; + $end = $start + $lend; + $max = intval( $this->request['max'] ); + $done = 0; + $converted = intval( $this->request['conv'] ); + + //----------------------------------------- + // First off.. grab number of polls to convert + //----------------------------------------- + + if ( ! $max ) + { + $total = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as max', + 'from' => 'topics', + 'where' => "poll_state IN ('open', 'close', 'closed')" ) ); + + $max = $total['max']; + } + + if ( $max < 1 ) + { + $done = 1; + } + + //----------------------------------------- + // In steps... + //----------------------------------------- + + $this->DB->build( array( 'select' => '*', + 'from' => 'topics', + 'where' => "poll_state IN ('open', 'close', 'closed' )", + 'limit' => array( $start, $lend ) ) ); + $o = $this->DB->execute(); + + //----------------------------------------- + // Do it... + //----------------------------------------- + + if ( $this->DB->getTotalRows($o) ) + { + //----------------------------------------- + // Got some to convert! + //----------------------------------------- + + while ( $r = $this->DB->fetch($o) ) + { + $converted++; + + $new_poll = array( 1 => array() ); + + $poll_data = $this->DB->buildAndFetch( array( 'select' => '*', + 'from' => 'polls', + 'where' => "tid=".$r['tid'] + ) ); + if ( ! $poll_data['pid'] ) + { + continue; + } + + if ( ! $poll_data['poll_question'] ) + { + $poll_data['poll_question'] = $r['title']; + } + + //----------------------------------------- + // Kick start new poll + //----------------------------------------- + + $new_poll[1]['question'] = $poll_data['poll_question']; + + //----------------------------------------- + // Get OLD polls + //----------------------------------------- + + $poll_answers = unserialize( stripslashes( $poll_data['choices'] ) ); + + reset($poll_answers); + + foreach ( $poll_answers as $entry ) + { + $id = $entry[0]; + $choice = $entry[1]; + $votes = $entry[2]; + + $total_votes += $votes; + + if ( strlen($choice) < 1 ) + { + continue; + } + + $new_poll[ 1 ]['choice'][ $id ] = $choice; + $new_poll[ 1 ]['votes'][ $id ] = $votes; + } + + //----------------------------------------- + // Got something? + //----------------------------------------- + + if ( count( $new_poll[1]['choice'] ) ) + { + $this->DB->update( 'polls' , array( 'choices' => serialize( $new_poll ) ), 'tid='.$r['tid'] ); + $this->DB->update( 'topics', array( 'poll_state' => 1 ), 'tid='.$r['tid'] ); + } + + //----------------------------------------- + // All done? + //----------------------------------------- + + if ( $converted >= $max ) + { + $done = 1; + continue; + } + } + } + else + { + $done = 1; + } + + + if ( ! $done ) + { + $this->registry->output->global_message = sprintf( $this->lang->words['re_pollstartto'], $start, $end, $max ); + + $url = "{$this->settings['base_url']}{$this->form_code}&do=".$this->request['do'].'&max='.$max.'&st='.$end.'&conv='.$converted; + } + else + { + $this->registry->output->global_message = $this->lang->words['re_pollconverted']; + + $url = "{$this->settings['base_url']}{$this->form_code}&do=tools"; + } + + //----------------------------------------- + // Bye.... + //----------------------------------------- + + $this->registry->output->redirect( $url, $this->registry->output->global_message ); + } + + /** + * 2.2.0 Tools: Contacts + * DEPRECATED + * + * @return @e void + */ + public function tools220Contacts() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $start = intval($_GET['st']); + $lend = 50; + $end = $start + $lend; + $done = 0; + $updated = 0; + + //----------------------------------------- + // Get lib + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('members') . '/sources/friends.php', 'profileFriendsLib', 'members' ); + $profile = new $classToLoad( $this->registry ); + + + //----------------------------------------- + // OK.. + //----------------------------------------- + + $this->DB->build( array( 'select' => '*', + 'from' => 'contacts', + 'where' => 'allow_msg=1', + 'limit' => array( $start, $lend ) ) ); + + $o = $this->DB->execute(); + + //----------------------------------------- + // Do it... + //----------------------------------------- + + if ( $this->DB->getTotalRows($o) ) + { + //----------------------------------------- + // Got some to convert! + //----------------------------------------- + + while( $row = $this->DB->fetch( $o ) ) + { + //----------------------------------------- + // Already a friend + //----------------------------------------- + + $friend = $this->DB->buildAndFetch( array( 'select' => '*', + 'from' => 'profile_friends', + 'where' => 'friends_member_id=' . intval( $row['member_id'] ) . ' AND friends_friend_id=' . intval( $row['contact_id'] ) ) ); + + if ( ! $friend['friends_id'] ) + { + //----------------------------------------- + // Add to DB + //----------------------------------------- + + $this->DB->insert( 'profile_friends', array( 'friends_member_id' => $row['member_id'], + 'friends_friend_id' => $row['contact_id'], + 'friends_approved' => 1, + 'friends_added' => time() ) ); + + //----------------------------------------- + // Rebuild... + //----------------------------------------- + + $profile->recacheFriends( array( 'member_id' => $row['member_id'] ) ); + + $updated++; + } + + $this->DB->delete( "contacts", "id={$row['id']}" ); + } + } + else + { + $done = 1; + } + + //----------------------------------------- + // Done? + //----------------------------------------- + + if ( ! $done ) + { + $this->registry->output->global_message = sprintf( $this->lang->words['re_contactsstartto'],$start, $end, $updated ); + + $url = "{$this->settings['base_url']}{$this->form_code}&do=".$this->request['do'].'&st='.$end; + } + else + { + $this->registry->output->global_message = $this->lang->words['re_contactsup']; + + $url = "{$this->settings['base_url']}{$this->form_code}&do=tools"; + } + + //----------------------------------------- + // Bye.... + //----------------------------------------- + + $this->registry->output->redirect( $url, $this->registry->output->global_message ); + } + + /** + * Cleanup Tools Splash Screen + * + * @return @e void + */ + public function toolsSplashScreen() + { + /* Output */ + $this->registry->output->html .= $this->html->toolsSplashScreen(); + } + + /** + * Count stats + * + * @return @e void + */ + public function doCount() + { + if ( empty($this->request['posts']) && empty($this->request['online']) && empty($this->request['members']) && empty($this->request['lastreg']) ) + { + $this->registry->output->showError( $this->lang->words['re_nothing'], 11154 ); + } + + $stats = $this->cache->getCache('stats'); + + if ( $this->request['posts'] ) + { + $topics = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as tcount', + 'from' => 'topics', + 'where' => $this->registry->getClass('class_forums')->fetchTopicHiddenQuery( array( 'visible' ), '' ) ) ); + + $posts = $this->DB->buildAndFetch( array( 'select' => 'SUM(posts) as replies', + 'from' => 'topics', + 'where' => $this->registry->getClass('class_forums')->fetchTopicHiddenQuery( array( 'visible' ), '' ) ) ); + + $stats['total_topics'] = $topics['tcount']; + $stats['total_replies'] = $posts['replies']; + } + + if ( $this->request['members'] ) + { + $r = $this->DB->buildAndFetch( array( 'select' => 'count(member_id) as members', 'from' => 'members', 'where' => "member_group_id <> '{$this->settings['auth_group']}'" ) ); + + $stats['mem_count'] = intval($r['members']); + } + + if ( $this->request['lastreg'] ) + { + $stats = array_merge( $stats, IPSMember::resetLastRegisteredMember( true ) ); + } + + if ( $this->request['online'] ) + { + $stats['most_date'] = time(); + $stats['most_count'] = 1; + } + + $this->cache->setCache( 'stats', $stats, array( 'array' => 1 ) ); + + $this->registry->output->global_message = $this->lang->words['re_statsrecount']; + $this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code ); + } + + /** + * Clean out photos + * + * @return @e void + */ + public function cleanPhotos() + { + //----------------------------------------- + // Set up + //----------------------------------------- + + $done = 0; + $start = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0; + $end = intval( $this->request['pergo'] ) ? intval( $this->request['pergo'] ) : 100; + $display = $end + $start; + $output = array(); + + //----------------------------------------- + // Pop open the directory and + // peek inside... + //----------------------------------------- + + $i = 0; + + try + { + foreach( new DirectoryIterator( $this->settings['upload_dir'] . '/profile' ) as $file ) + { + if ( strstr( $file->getFilename(), 'photo-' ) ) + { + $fullfile = $file->getPathname(); + $relativefile = str_replace( $this->settings['upload_dir'] . '/', '', $fullfile ); + + $i++; + + //----------------------------------------- + // Already started? + //----------------------------------------- + + if ( $start > $i ) + { + continue; + } + + //----------------------------------------- + // Done for this iteration? + //----------------------------------------- + + if ( $i > $display ) + { + break; + } + + //----------------------------------------- + // Try and get attach row + //----------------------------------------- + + $found = $this->DB->buildAndFetch( array( 'select' => 'pp_member_id', 'from' => 'profile_portal', 'where' => "pp_main_photo='{$relativefile}' OR pp_thumb_photo='{$relativefile}'" ) ); + + if ( ! $found['pp_member_id'] ) + { + @unlink( $fullfile ); + $output[] = "{$this->lang->words['re_removedorph']} {$file->getFilename()}"; + } + else + { + $output[] = "{$this->lang->words['re_attachedok']} {$file->getFilename()}"; + } + } + } + } catch ( Exception $e ) {} + + //----------------------------------------- + // Finish - or more?... + //----------------------------------------- + + if ( $i < $display) + { + //----------------------------------------- + // Done.. + //----------------------------------------- + + $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); + $url = "{$this->settings['base_url']}{$this->form_code}"; + } + else + { + //----------------------------------------- + // More.. + //----------------------------------------- + $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $display ); + $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); + $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$display}"; + } + + //----------------------------------------- + // Bye.... + //----------------------------------------- + + $this->_specialRedirect( $url, $text ); + } + + /** + * Clean out attachments + * + * @return @e void + */ + public function cleanAttachments() + { + //----------------------------------------- + // Set up + //----------------------------------------- + + $done = 0; + $start = intval($this->request['st']) >=0 ? intval($this->request['st']) : 0; + $end = intval( $this->request['pergo'] ) ? intval( $this->request['pergo'] ) : 100; + $dis = $end + $start; + $output = array(); + + //----------------------------------------- + // Pop open the directory and + // peek inside... + //----------------------------------------- + + $i = 0; + + try + { + foreach( new DirectoryIterator( $this->settings['upload_dir'] ) as $file ) + { + if ( $file->getFilename() == '.' OR $file->getFilename() == '..' ) + { + continue; + } + + $fullfile = $this->settings['upload_dir'] . '/' . $file->getFilename(); + + if( is_dir( $fullfile ) ) + { + $ndh = opendir( $fullfile ); + + try + { + foreach( new DirectoryIterator( $fullfile ) as $nfile ) + { + if ( $nfile->getFilename() == '.' OR $nfile->getFilename() == '..' ) + { + continue; + } + + if ( strstr( $nfile->getFilename(), 'post-' ) ) + { + $i++; + + //----------------------------------------- + // Already started? + //----------------------------------------- + + if ( $start > $i ) + { + continue; + } + + //----------------------------------------- + // Done for this iteration? + //----------------------------------------- + + if ( $i > $dis ) + { + break; + } + + //----------------------------------------- + // Try and get attach row + //----------------------------------------- + + $found = $this->DB->buildAndFetch( array( 'select' => 'attach_id', 'from' => 'attachments', 'where' => "attach_location='{$file->getFilename()}/{$nfile->getFilename()}' OR attach_thumb_location='{$file->getFilename()}/{$nfile->getFilename()}'" ) ); + + if ( ! $found['attach_id'] ) + { + @unlink( $fullfile . '/' . $nfile->getFilename() ); + $output[] = "{$this->lang->words['re_removedorph']} {$nfile->getFilename()}"; + } + else + { + $output[] = "{$this->lang->words['re_attachedok']} {$nfile->getFilename()}"; + } + } + } + } catch ( Exception $e ) {} + + closedir( $ndh ); + } + else if ( strstr( $file->getFilename(), 'post-' ) ) + { + $i++; + + //----------------------------------------- + // Already started? + //----------------------------------------- + + if ( $start > $i ) + { + continue; + } + + //----------------------------------------- + // Done for this iteration? + //----------------------------------------- + + if ( $i > $dis ) + { + break; + } + + //----------------------------------------- + // Try and get attach row + //----------------------------------------- + + $found = $this->DB->buildAndFetch( array( 'select' => 'attach_id', 'from' => 'attachments', 'where' => "attach_location='{$file->getFilename()}' OR attach_thumb_location='{$file->getFilename()}'" ) ); + + if ( ! $found['attach_id'] ) + { + @unlink( $fullfile ); + $output[] = "{$this->lang->words['re_removedorph']} {$file->getFilename()}"; + } + else + { + $output[] = "{$this->lang->words['re_attachedok']} {$file->getFilename()}"; + } + } + } + } catch ( Exception $e ) {} + + //----------------------------------------- + // Finish - or more?... + //----------------------------------------- + + if ( $i < $dis) + { + //----------------------------------------- + // Done.. + //----------------------------------------- + + $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); + $url = "{$this->settings['base_url']}{$this->form_code}"; + } + else + { + //----------------------------------------- + // More.. + //----------------------------------------- + + $text = sprintf( $this->lang->words['re_thisgoeshere'], $dis ) . '
    ' . implode( "
    ", $output ); + $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; + } + + //----------------------------------------- + // Bye.... + //----------------------------------------- + + $this->_specialRedirect( $url, $text ); + } + + /** + * Rebuild Attachment Data + * + * @return @e void + */ + public function rebuildAttachdata() + { + //----------------------------------------- + // Set up + //----------------------------------------- + + $done = 0; + $start = intval($this->request['st']) >=0 ? intval($this->request['st']) : 0; + $end = intval( $this->request['pergo'] ) ? intval( $this->request['pergo'] ) : 100; + $dis = $end + $start; + $output = array(); + + //----------------------------------------- + // Got any more? + //----------------------------------------- + + $tmp = $this->DB->buildAndFetch( array( 'select' => 'attach_id', 'from' => 'attachments', 'limit' => array($dis,1) ) ); + $max = intval( $tmp['attach_id'] ); + + //----------------------------------------- + // Avoid limit... + //----------------------------------------- + + $this->DB->build( array( 'select' => '*', 'from' => 'attachments', 'order' => 'attach_id ASC', 'limit' => array($start,$end) ) ); + $outer = $this->DB->execute(); + + //----------------------------------------- + // Process... + //----------------------------------------- + + while( $r = $this->DB->fetch( $outer ) ) + { + //----------------------------------------- + // Get ext + //----------------------------------------- + + $update = array(); + + $update['attach_ext'] = IPSText::getFileExtension( $r['attach_file'] ); + + if ( $r['attach_location'] ) + { + if ( is_file( $this->settings['upload_dir'].'/'.$r['attach_location'] ) ) + { + $update['attach_filesize'] = @filesize( $this->settings['upload_dir'].'/'.$r['attach_location'] ); + + if( $r['attach_is_image'] ) + { + $dims = @getimagesize( $this->settings['upload_dir'].'/'.$r['attach_location'] ); + + if( $dims[0] AND $dims[1] ) + { + $update['attach_img_width'] = $dims[0]; + $update['attach_img_height'] = $dims[1]; + } + } + } + } + + if ( count( $update ) ) + { + $this->DB->update( 'attachments', $update, 'attach_id='.$r['attach_id'] ); + } + + $done++; + } + + //----------------------------------------- + // Finish - or more?... + //----------------------------------------- + + if ( ! $done and ! $max ) + { + //----------------------------------------- + // Done.. + //----------------------------------------- + + $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); + $url = "{$this->settings['base_url']}{$this->form_code}"; + } + else + { + //----------------------------------------- + // More.. + //----------------------------------------- + $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); + $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); + $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; + } + + //----------------------------------------- + // Bye.... + //----------------------------------------- + + $this->_specialRedirect( $url, $text ); + } + + /** + * Rebuild Photos + * + * @return @e void + */ + public function rebuildPhotos() + { + /* Image Class */ + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/member/photo.php', 'classes_member_photo' ); + $photoClass = new $classToLoad( $this->registry ); + + //----------------------------------------- + // Set up + //----------------------------------------- + + $done = 0; + $start = intval($this->request['st']) >=0 ? intval($this->request['st']) : 0; + $end = intval( $this->request['pergo'] ) ? intval( $this->request['pergo'] ) : 100; + $dis = $end + $start; + $output = array(); + + //----------------------------------------- + // Got any more? + //----------------------------------------- + + $tmp = $this->DB->buildAndFetch( array( 'select' => 'pp_member_id', 'from' => 'profile_portal', 'where' => "pp_main_photo != ''", 'order' => 'pp_member_id ASC', 'limit' => array($dis,1) ) ); + $max = intval( $tmp['pp_member_id'] ); + + //----------------------------------------- + // Avoid limit... + //----------------------------------------- + + $this->DB->build( array( 'select' => '*', 'from' => 'profile_portal', 'order' => 'pp_member_id ASC', 'where' => "pp_main_photo != ''", 'limit' => array($start,$end) ) ); + $outer = $this->DB->execute(); + + //----------------------------------------- + // Process... + //----------------------------------------- + + while( $r = $this->DB->fetch( $outer ) ) + { + /* Preserve FB, Twitter and Gravatar photos */ + if( $r['pp_photo_type'] != 'custom' ) + { + continue; + } + + $update = array(); + + $info = $photoClass->buildSizedPhotos( str_replace( 'upload:', '', $r['pp_main_photo'] ), $r['pp_member_id'], true ); + + if( $info['status'] == 'missing_image' ) + { + $update['pp_main_photo'] = ''; + $update['pp_main_width'] = 0; + $update['pp_main_height'] = 0; + $update['pp_thumb_photo'] = ''; + $update['pp_thumb_width'] = 0; + $update['pp_thumb_height'] = 0; + } + else + { + $update['pp_main_width'] = intval( $info['final_width'] ); + $update['pp_main_height'] = intval( $info['final_height'] ); + $update['pp_thumb_photo'] = $info['t_final_location'] ? $info['t_final_location'] : $info['final_location']; + $update['pp_thumb_width'] = intval( $info['t_final_width'] ); + $update['pp_thumb_height'] = intval( $info['t_final_height'] ); + } + + $this->DB->update( 'profile_portal', $update, 'pp_member_id=' . $r['pp_member_id'] ); + + $done++; + } + + //----------------------------------------- + // Finish - or more?... + //----------------------------------------- + + if ( ! $done and ! $max ) + { + //----------------------------------------- + // Done.. + //----------------------------------------- + + $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); + $url = "{$this->settings['base_url']}{$this->form_code}"; + } + else + { + //----------------------------------------- + // More.. + //----------------------------------------- + $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); + $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); + $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; + } + + //----------------------------------------- + // Bye.... + //----------------------------------------- + + $this->_specialRedirect( $url, $text ); + } + + /** + * Rebuild Post Thumbnails + * + * @return @e void + */ + public function rebuildThumbnails() + { + require_once( IPS_KERNEL_PATH . 'classImage.php' );/*noLibHook*/ + require_once( IPS_KERNEL_PATH . 'classImageGd.php' );/*noLibHook*/ + + //----------------------------------------- + // Set up + //----------------------------------------- + + $done = 0; + $start = intval($this->request['st']) >=0 ? intval($this->request['st']) : 0; + $end = intval( $this->request['pergo'] ) ? intval( $this->request['pergo'] ) : 100; + $dis = $end + $start; + $output = array(); + + //----------------------------------------- + // Got any more? + //----------------------------------------- + + $tmp = $this->DB->buildAndFetch( array( 'select' => 'attach_id', 'from' => 'attachments', 'where' => "attach_rel_module IN('post','msg')", 'limit' => array($dis,1) ) ); + $max = intval( $tmp['attach_id'] ); + + //----------------------------------------- + // Avoid limit... + //----------------------------------------- + + $this->DB->build( array( 'select' => '*', 'from' => 'attachments', 'where' => "attach_rel_module IN('post','msg')", 'order' => 'attach_id ASC', 'limit' => array($start,$end) ) ); + $outer = $this->DB->execute(); + + //----------------------------------------- + // Process... + //----------------------------------------- + + while( $r = $this->DB->fetch( $outer ) ) + { + if ( $r['attach_is_image'] ) + { + if ( $r['attach_thumb_location'] and ( $r['attach_thumb_location'] != $r['attach_location'] ) ) + { + if ( is_file( $this->settings['upload_dir'] . '/' . $r['attach_thumb_location'] ) ) + { + if ( ! @unlink( $this->settings['upload_dir'] . '/' . $r['attach_thumb_location'] ) ) + { + $output[] = $this->lang->words['re_noremove'] . $r['attach_thumb_location']; + continue; + } + } + } + + $attach_data = array(); + $thumbnail = preg_replace( "/^(.*)\.(.+?)$/", "\\1_thumb.\\2", $r['attach_location'] ); + + $image = new classImageGd(); + + $image->init( array( + 'image_path' => $this->settings['upload_dir'], + 'image_file' => $r['attach_location'], + ) ); + + $image->force_resize = false; + + $return = $image->resizeImage( $this->settings['siu_width'], $this->settings['siu_height'] ); + + if( !$return['noResize'] ) + { + $image->writeImage( $this->settings['upload_dir'] . '/' . $thumbnail ); + + $attach_data['attach_thumb_location'] = $thumbnail; + } + else + { + $attach_data['attach_thumb_location'] = $r['attach_location']; + } + + $attach_data['attach_thumb_width'] = intval($return['newWidth'] ? $return['newWidth'] : $image->cur_dimensions['width']); + $attach_data['attach_thumb_height'] = intval($return['newHeight'] ? $return['newHeight'] : $image->cur_dimensions['height']); + + if ( count( $attach_data ) ) + { + $this->DB->update( 'attachments', $attach_data, 'attach_id='.$r['attach_id'] ); + + $output[] = $this->lang->words['re_resized'] . $r['attach_location']; + } + + unset($image); + } + + $done++; + } + + //----------------------------------------- + // Finish - or more?... + //----------------------------------------- + + if ( ! $done and ! $max ) + { + //----------------------------------------- + // Done.. + //----------------------------------------- + + $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); + $url = "{$this->settings['base_url']}{$this->form_code}"; + } + else + { + //----------------------------------------- + // More.. + //----------------------------------------- + $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); + $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); + $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; + } + + //----------------------------------------- + // Bye.... + //----------------------------------------- + + $this->_specialRedirect( $url, $text ); + } + + /** + * Rebuild Messenger Totals + * + * @return @e void + */ + public function rebuildMsgCounts() + { + //----------------------------------------- + // Grab messenger lib + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'members' ) . '/sources/classes/messaging/messengerFunctions.php', 'messengerFunctions', 'members' ); + $messengerFunctions = new $classToLoad( $this->registry ); + + //----------------------------------------- + // Set up + //----------------------------------------- + + $done = 0; + $start = intval($this->request['st']) >=0 ? intval($this->request['st']) : 0; + $end = intval( $this->request['pergo'] ) ? intval( $this->request['pergo'] ) : 100; + $dis = $end + $start; + $output = array(); + + //----------------------------------------- + // Got any more? + //----------------------------------------- + + $tmp = $this->DB->buildAndFetch( array( 'select' => 'member_id', 'from' => 'members', 'limit' => array($dis,1) ) ); + $max = intval( $tmp['member_id'] ); + + //----------------------------------------- + // Avoid limit... + //----------------------------------------- + + $this->DB->build( array( 'select' => 'member_id, members_display_name', 'from' => 'members', 'order' => 'member_id ASC', 'limit' => array($start,$end) ) ); + $outer = $this->DB->execute(); + + //----------------------------------------- + // Process... + //----------------------------------------- + + while( $r = $this->DB->fetch( $outer ) ) + { + $messengerFunctions->resetMembersFolderCounts( $r['member_id'] ); + $messengerFunctions->resetMembersTotalTopicCount( $r['member_id'] ); + $messengerFunctions->resetMembersNewTopicCount( $r['member_id'] ); + + $done++; + } + + //----------------------------------------- + // Finish - or more?... + //----------------------------------------- + + if ( ! $done and ! $max ) + { + //----------------------------------------- + // Done.. + //----------------------------------------- + + $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); + $url = "{$this->settings['base_url']}{$this->form_code}"; + } + else + { + //----------------------------------------- + // More.. + //----------------------------------------- + $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); + $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); + $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; + } + + //----------------------------------------- + // Bye.... + //----------------------------------------- + + $this->_specialRedirect( $url, $text ); + } + + /** + * Rebuild Post Count + * + * @return @e void + */ + public function rebuildPostCount() + { + //----------------------------------------- + // Forums not to count? + //----------------------------------------- + + $forums = array(); + + foreach( $this->registry->class_forums->forum_by_id as $data ) + { + if ( ! $data['inc_postcount'] ) + { + $forums[] = $data['id']; + } + } + + /* Init */ + if ( ! $this->registry->isClassLoaded('topics') ) + { + $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/topics.php", 'app_forums_classes_topics', 'forums' ); + $this->registry->setClass( 'topics', new $classToLoad( $this->registry ) ); + } + + //----------------------------------------- + // Set up + //----------------------------------------- + + $done = 0; + $start = intval($this->request['st']) >=0 ? intval($this->request['st']) : 0; + $end = intval( $this->request['pergo'] ) ? intval( $this->request['pergo'] ) : 100; + $dis = $end + $start; + $output = array(); + + //----------------------------------------- + // Got any more? + //----------------------------------------- + + $tmp = $this->DB->buildAndFetch( array( 'select' => 'member_id', 'from' => 'members', 'limit' => array($dis,1) ) ); + $max = intval( $tmp['member_id'] ); + + //----------------------------------------- + // Avoid limit... + //----------------------------------------- + + $this->DB->build( array( 'select' => 'member_id, name', 'from' => 'members', 'order' => 'member_id ASC', 'limit' => array($start,$end) ) ); + $outer = $this->DB->execute(); + + //----------------------------------------- + // Process... + //----------------------------------------- + + while( $r = $this->DB->fetch( $outer ) ) + { + if ( ! count( $forums ) ) + { + $count = $this->registry->topics->getPosts( array( 'onlyViewable' => false, + 'skipForumCheck' => true, + 'getCountOnly' => true, + 'authorId' => $r['member_id'] ) ); + } + else + { + $count = $this->registry->topics->getPosts( array( 'onlyViewable' => false, + 'skipForumCheck' => true, + 'getCountOnly' => true, + 'notForumId' => $forums, + 'authorId' => $r['member_id'] ) ); + } + + if ( $this->settings['archive_on'] ) + { + if ( ! count( $forums ) ) + { + $acount = $this->registry->topics->getPosts( array( 'onlyViewable' => false, + 'skipForumCheck' => true, + 'getCountOnly' => true, + 'isArchivedTopic' => true, + 'authorId' => $r['member_id'] ) ); + } + else + { + $acount = $this->registry->topics->getPosts( array( 'onlyViewable' => false, + 'skipForumCheck' => true, + 'getCountOnly' => true, + 'notForumId' => $forums, + 'isArchivedTopic' => true, + 'authorId' => $r['member_id'] ) ); + } + + $count += intval( $acount ); + } + + $this->DB->update( 'members', array( 'posts' => intval( $count ) ), 'member_id='.$r['member_id'] ); + + $done++; + } + + //----------------------------------------- + // Finish - or more?... + //----------------------------------------- + + if ( ! $done and ! $max ) + { + //----------------------------------------- + // Done.. + //----------------------------------------- + + $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); + $url = "{$this->settings['base_url']}{$this->form_code}"; + } + else + { + //----------------------------------------- + // More.. + //----------------------------------------- + $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); + $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); + $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; + } + + //----------------------------------------- + // Bye.... + //----------------------------------------- + + $this->_specialRedirect( $url, $text ); + } + + /** + * Rebuild Reputation Counts + * + * @return @e void + */ + public function rebuildReputationCount() + { + //----------------------------------------- + // Set up + //----------------------------------------- + + $done = 0; + $start = intval($this->request['st']) >=0 ? intval($this->request['st']) : 0; + $end = intval( $this->request['pergo'] ) ? intval( $this->request['pergo'] ) : 100; + $dis = $end + $start; + $output = array(); + + //----------------------------------------- + // Load reputation classes + //----------------------------------------- + + $_rep_author_config = array(); + $_rep_log_joins = array(); + foreach( ipsRegistry::$applications as $appKey => $data ) + { + $rep_author_config = array(); + $rep_log_joins = array(); + $file = IPSLib::getAppDir( $appKey ) . '/extensions/reputation.php'; + + if ( file_exists( $file ) ) + { + require( $file );/*noLibHook*/ + $_rep_author_config[ $appKey ] = $rep_author_config; + $_rep_log_joins[ $appKey ] = $rep_log_joins; + } + } + + //----------------------------------------- + // Got any more? + //----------------------------------------- + + $tmp = $this->DB->buildAndFetch( array( 'select' => 'member_id', 'from' => 'members', 'limit' => array($dis,1) ) ); + $max = intval( $tmp['member_id'] ); + + //----------------------------------------- + // Avoid limit... + //----------------------------------------- + + $this->DB->build( array( 'select' => 'member_id, name', 'from' => 'members', 'order' => 'member_id ASC', 'limit' => array($start,$end) ) ); + $outer = $this->DB->execute(); + + //----------------------------------------- + // Process... + //----------------------------------------- + + while( $r = $this->DB->fetch( $outer ) ) + { + $total = 0; + + foreach ( $_rep_author_config as $app => $types ) + { + foreach ( $types as $type => $data ) + { + $prefix = NULL; + foreach ( $_rep_log_joins[ $app ] as $j ) + { + if ( is_array( $j['from'] ) AND count( $j['from'] ) ) + { + foreach ( $j['from'] as $t => $p ) + { + if ( $t == $data['table'] ) + { + $prefix = $p; + break 2; + } + } + } + } + + if ( !is_null( $prefix ) ) + { + $_total = $this->DB->buildAndFetch( array( + 'select' => "sum(r.rep_rating) as total", + 'from' => array( 'reputation_index' => 'r' ), + 'add_join' => $_rep_log_joins[ $app ], + 'where' => "r.app='{$app}' AND r.type='{$type}' AND {$prefix}.{$data['column']}={$r['member_id']}", + 'group' => "{$prefix}.{$data['column']}", + ) ); + + $total += $_total['total']; + } + } + } + + $this->DB->update( 'profile_portal', array( 'pp_reputation_points' => $total ), 'pp_member_id='.$r['member_id'] ); + + $done++; + } + + //----------------------------------------- + // Finish - or more?... + //----------------------------------------- + + if ( ! $done and ! $max ) + { + //----------------------------------------- + // Done.. + //----------------------------------------- + + $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); + $url = "{$this->settings['base_url']}{$this->form_code}"; + } + else + { + //----------------------------------------- + // More.. + //----------------------------------------- + $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); + $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); + $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; + } + + //----------------------------------------- + // Bye.... + //----------------------------------------- + + $this->_specialRedirect( $url, $text ); + } + + /** + * Rebuild Seo User Names + * + * @return @e void + */ + public function rebuildSeoUserNames() + { + //----------------------------------------- + // Set up + //----------------------------------------- + + $done = 0; + $start = intval($this->request['st']) >=0 ? intval($this->request['st']) : 0; + $end = intval( $this->request['pergo'] ) ? intval( $this->request['pergo'] ) : 100; + $dis = $end + $start; + $output = array(); + + //----------------------------------------- + // Got any more? + //----------------------------------------- + + $tmp = $this->DB->buildAndFetch( array( 'select' => 'member_id', 'from' => 'members', 'limit' => array( $dis, 1 ) ) ); + $max = intval( $tmp['member_id'] ); + + //----------------------------------------- + // Avoid limit... + //----------------------------------------- + + $this->DB->build( array( 'select' => 'member_id, members_display_name', 'from' => 'members', 'order' => 'member_id ASC', 'limit' => array( $start, $end ) ) ); + $outer = $this->DB->execute(); + + //----------------------------------------- + // Process... + //----------------------------------------- + + while( $r = $this->DB->fetch( $outer ) ) + { + $this->DB->update( 'members', array( 'members_seo_name' => IPSText::makeSeoTitle( $r['members_display_name'] ) ), "member_id=" . $r['member_id'] ); + $done++; + } + + //----------------------------------------- + // Finish - or more?... + //----------------------------------------- + + if ( ! $done and ! $max ) + { + //----------------------------------------- + // Done.. + //----------------------------------------- + + $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); + $url = "{$this->settings['base_url']}{$this->form_code}"; + } + else + { + //----------------------------------------- + // More.. + //----------------------------------------- + $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); + $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); + $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; + } + + //----------------------------------------- + // Bye.... + //----------------------------------------- + + $this->_specialRedirect( $url, $text ); + } + + + /** + * Rebuild Post Names + * + * @return @e void + */ + public function rebuildPostNames() + { + //----------------------------------------- + // Set up + //----------------------------------------- + + $done = 0; + $start = intval($this->request['st']) >=0 ? intval($this->request['st']) : 0; + $end = intval( $this->request['pergo'] ) ? intval( $this->request['pergo'] ) : 100; + $dis = $end + $start; + $output = array(); + + //----------------------------------------- + // Got any more? + //----------------------------------------- + + $tmp = $this->DB->buildAndFetch( array( 'select' => 'member_id', 'from' => 'members', 'limit' => array( $dis, 1 ) ) ); + $max = intval( $tmp['member_id'] ); + + //----------------------------------------- + // Avoid limit... + //----------------------------------------- + + $this->DB->build( array( 'select' => 'member_id, members_display_name', 'from' => 'members', 'order' => 'member_id ASC', 'limit' => array( $start, $end ) ) ); + $outer = $this->DB->execute(); + + //----------------------------------------- + // Process... + //----------------------------------------- + + while( $r = $this->DB->fetch( $outer ) ) + { + $seoName = IPSText::makeSeoTitle( $r['members_display_name'] ); + $this->DB->update( 'topics', array( 'starter_name' => $r['members_display_name'], 'seo_first_name' => $seoName ), "starter_id=" . $r['member_id'] ); + $this->DB->update( 'topics', array( 'last_poster_name' => $r['members_display_name'], 'seo_last_name' => $seoName ), "last_poster_id=" . $r['member_id'] ); + + $done++; + } + + //----------------------------------------- + // Finish - or more?... + //----------------------------------------- + + if ( ! $done and ! $max ) + { + //----------------------------------------- + // Done.. + //----------------------------------------- + + $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); + $url = "{$this->settings['base_url']}{$this->form_code}"; + } + else + { + //----------------------------------------- + // More.. + //----------------------------------------- + $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); + $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); + $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; + } + + //----------------------------------------- + // Bye.... + //----------------------------------------- + + $this->_specialRedirect( $url, $text ); + } + + /** + * Rebuild posts + * + * @return @e void + */ + public function rebuildPosts() + { + //----------------------------------------- + // If it's "none", go back + //----------------------------------------- + + if( !$this->request['type'] OR $this->request['type'] == 'none' ) + { + $this->rebuildSplashScreen(); + return; + } + + //----------------------------------------- + // Only need to rebuild once + //----------------------------------------- + + $sections = array(); + $alreadyRebuilt = $this->DB->buildAndFetch( array( 'select' => 'cs_value', 'from' => 'cache_store', 'where' => "cs_key='isRebuilt'" ) ); + + if( $alreadyRebuilt['cs_value'] ) + { + $sections = explode( ',', $alreadyRebuilt['cs_value'] ); + } + + //----------------------------------------- + // Get new parser and old parser + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/bbcode/core.php', 'class_bbcode_core' ); + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/bbcode/legacy.php', 'class_bbcode_legacy' ); + $parser = new $classToLoad( $this->registry ); + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/text/parser.php', 'classes_text_parser' ); + $newParser = new $classToLoad(); + + //----------------------------------------- + // Set up + //----------------------------------------- + + $done = 0; + $last = 0; + $start = intval($this->request['st']) >=0 ? intval($this->request['st']) : 0; + $end = intval( $this->request['pergo'] ) ? intval( $this->request['pergo'] ) : 100; + $dis = intval($this->request['dis']) >=0 ? intval($this->request['dis']) : 0; + $output = array(); + $plugin = null; + + $types = array( 'posts', 'pms', 'announce', 'sigs', 'aboutme', 'rules' ); + + foreach( ipsRegistry::$applications as $app_dir => $app_data ) + { + //----------------------------------------- + // Retrieve the RSS links for the header + //----------------------------------------- + + if( is_file( IPSLib::getAppDir( $app_dir ) . '/extensions/upgradePostRebuild.php' ) ) + { + $className = IPSLib::loadLibrary( IPSLib::getAppDir( $app_dir ) . '/extensions/upgradePostRebuild.php', 'postRebuild_'.$app_dir, $app_dir ); + + if( class_exists( $className ) ) + { + $rebuild = new $className( $this->registry ); + + if( method_exists( $rebuild, "getDropdown" ) ) + { + $options = $rebuild->getDropdown(); + + if( count($options) ) + { + foreach( $options as $appOption ) + { + $types[] = $appOption[0]; + + if( $appOption[0] == $this->request['type'] ) + { + $plugin =& $rebuild; + break 2; + } + } + } + } + } + } + } + + $type = in_array( $this->request['type'], $types ) ? $this->request['type'] : 'posts'; + + //----------------------------------------- + // Got any more? + //----------------------------------------- + + switch( $type ) + { + case 'announce': + $tmp = $this->DB->buildAndFetch( array( 'select' => 'announce_id', 'from' => 'announcements', 'limit' => array($dis,1) ) ); + $max = intval( $tmp['announce_id'] ); + break; + + case 'pms': + $tmp = $this->DB->buildAndFetch( array( 'select' => 'msg_id', 'from' => 'message_posts', 'limit' => array($dis,1) ) ); + $max = intval( $tmp['msg_id'] ); + break; + + case 'sigs': + $tmp = $this->DB->buildAndFetch( array( 'select' => 'pp_member_id', 'from' => 'profile_portal', 'where' => "signature IS NOT NULL AND signature != ''", 'limit' => array($dis,1) ) ); + $max = intval( $tmp['pp_member_id'] ); + break; + + case 'aboutme': + $tmp = $this->DB->buildAndFetch( array( 'select' => 'pp_member_id', 'from' => 'profile_portal', 'where' => "pp_about_me IS NOT NULL AND pp_about_me != ''", 'limit' => array($dis,1) ) ); + $max = intval( $tmp['pp_member_id'] ); + break; + + case 'posts': + $tmp = $this->DB->buildAndFetch( array( 'select' => 'pid', 'from' => 'posts', 'limit' => array($dis,1) ) ); + $max = intval( $tmp['pid'] ); + break; + + case 'rules': + $tmp = $this->DB->buildAndFetch( array( 'select' => 'id', 'from' => 'forums', 'where' => "rules_text IS NOT NULL AND rules_text != ''", 'limit' => array($dis,1) ) ); + $max = intval( $tmp['id'] ); + break; + + default: + $max = $rebuild->getMax( $type, $dis ); + break; + + } + + //----------------------------------------- + // Avoid limit... + //----------------------------------------- + + switch( $type ) + { + case 'announce': + $this->DB->build( array( 'select' => 'a.*', + 'from' => array( 'announcements' => 'a' ), + 'order' => 'a.announce_id ASC', + 'where' => 'a.announce_id > ' . $start, + 'limit' => array($end), + 'add_join' => array( 1 => array( 'type' => 'left', + 'select' => 'm.member_group_id, m.mgroup_others', + 'from' => array( 'members' => 'm' ), + 'where' => "m.member_id=a.announce_member_id" + ) ) + ) ); + break; + + case 'pms': + $this->DB->build( array( 'select' => 'p.*', + 'from' => array( 'message_posts' => 'p' ), + 'order' => 'p.msg_id ASC', + 'where' => 'p.msg_id > ' . $start, + 'limit' => array($end), + 'add_join' => array( 1 => array( 'type' => 'left', + 'select' => 'm.member_group_id, m.mgroup_others', + 'from' => array( 'members' => 'm' ), + 'where' => "m.member_id=p.msg_author_id" + ) ) + ) ); + break; + + case 'sigs': + $this->DB->build( array( 'select' => 'me.signature, me.pp_member_id', + 'from' => array( 'profile_portal' => 'me' ), + 'order' => 'me.pp_member_id ASC', + 'where' => "me.signature IS NOT NULL AND me.signature != '' AND me.pp_member_id > " . $start, + 'limit' => array($end), + 'add_join' => array( 1 => array( 'type' => 'left', + 'select' => 'm.member_group_id, m.mgroup_others', + 'from' => array( 'members' => 'm' ), + 'where' => "m.member_id=me.pp_member_id" + ) ) + ) ); + break; + + case 'aboutme': + $this->DB->build( array( 'select' => 'pp.pp_about_me, pp.pp_member_id', + 'from' => array( 'profile_portal' => 'pp' ), + 'order' => 'pp.pp_member_id ASC', + 'where' => "pp.pp_about_me != '' AND pp.pp_about_me IS NOT NULL AND pp.pp_member_id > " . $start, + 'limit' => array($end), + 'add_join' => array( 1 => array( 'type' => 'left', + 'select' => 'm.member_group_id, m.mgroup_others', + 'from' => array( 'members' => 'm' ), + 'where' => "m.member_id=pp.pp_member_id" + ) ) + ) ); + break; + + case 'posts': + $this->DB->build( array( 'select' => 'p.*', + 'from' => array( 'posts' => 'p' ), + 'order' => 'p.pid ASC', + 'where' => 'p.pid > ' . $start, + 'limit' => array($end), + 'add_join' => array( 1 => array( 'type' => 'left', + 'select' => 't.forum_id', + 'from' => array( 'topics' => 't' ), + 'where' => "t.tid=p.topic_id" + ), + 2 => array( 'type' => 'left', + 'select' => 'm.member_group_id, m.mgroup_others', + 'from' => array( 'members' => 'm' ), + 'where' => "m.member_id=p.author_id" + ) ) + ) ); + break; + + case 'rules': + $this->DB->build( array( 'select' => '*', 'from' => 'forums', 'order' => 'id ASC', 'where' => "rules_text IS NOT NULL AND rules_text != '' AND id > " . $start, 'limit' => array($end) ) ); + break; + + default: + $plugin->executeQuery( $type, $start, $end ); + break; + } + + $outer = $this->DB->execute(); + + //----------------------------------------- + // Process... + //----------------------------------------- + + /* On mssql, the select query blocks all the updates. Doing this causes the engine not to lock */ + if ( method_exists( $this->DB, 'setQueryRowLocking' ) ) + { + $this->DB->setQueryRowLocking( 'OFF' ); + } + + while( $r = $this->DB->fetch( $outer ) ) + { + //----------------------------------------- + // Group + //----------------------------------------- + + if( $r['member_group_id'] ) + { + $r = array_merge( $r, $this->caches['group_cache'][ $r['member_group_id'] ] ); + } + + //----------------------------------------- + // Reset + //----------------------------------------- + + $parser->quote_open = 0; + $parser->quote_closed = 0; + $parser->quote_error = 0; + $parser->error = ''; + $parser->image_count = 0; + $parser->parsing_mgroup = $r['member_group_id']; + $parser->parsing_mgroup_others = $r['mgroup_others']; + + $this->memberData['g_bypass_badwords'] = $this->caches['group_cache'][ $r['member_group_id'] ]['g_bypass_badwords']; + + switch( $type ) + { + case 'announce': + $parser->parse_smilies = 1; + $parser->parse_html = $r['announce_html_enabled']; + $parser->parse_bbcode = 1; + $parser->parse_nl2br = ( $r['announce_html_enabled'] ? $r['announce_nlbr_enabled'] : 1 ); + $parser->parsing_section = 'announcement'; + + $rawpost = $parser->preEditParse( $r['announce_post'] ); + break; + + case 'pms': + $parser->parse_smilies = 1; + $parser->parse_html = $r['g_dohtml']; + $parser->parse_bbcode = 1; + $parser->parse_nl2br = 1; + $parser->parsing_section = 'pms'; + + $rawpost = $parser->preEditParse( $r['msg_post'] ); + break; + + case 'sigs': + $parser->parse_smilies = 0; + $parser->parse_html = $r['g_dohtml']; + $parser->parse_bbcode = 1; + $parser->parse_nl2br = 1; + $parser->parsing_section = 'signatures'; + + $rawpost = $parser->preEditParse( $r['signature'] ); + break; + + case 'aboutme': + $parser->parse_smilies = 1; + $parser->parse_html = $r['g_dohtml']; + $parser->parse_bbcode = 1; + $parser->parse_nl2br = 1; + $parser->parsing_section = 'aboutme'; + + $rawpost = $parser->preEditParse( $r['pp_about_me'] ); + break; + + case 'posts': + $parser->parse_smilies = $r['use_emo']; + $parser->parse_html = ( $r['post_htmlstate'] && $this->registry->class_forums->forum_by_id[ $r['forum_id'] ]['use_html'] && $r['g_dohtml'] ); + $parser->parse_bbcode = $this->registry->class_forums->forum_by_id[ $r['forum_id'] ]['use_ibc']; + $parser->parse_nl2br = 1; + $parser->parsing_section = 'topics'; + + $rawpost = $parser->preEditParse( $r['post'] ); + + $allowHtml = ( $r['post_htmlstate'] && $this->registry->class_forums->forum_by_id[ $r['forum_id'] ]['use_html'] && $r['g_dohtml'] ); + + $newParser->set( array( 'parseArea' => 'topics', + 'memberData' => $r, + 'parseBBCode' => $this->registry->class_forums->forum_by_id[ $r['forum_id'] ]['use_ibc'], + 'parseHtml' => $allowHtml, + 'parseEmoticons' => $r['use_emo'] ) ); + + $rawpost = $newParser->BBCodeToHtml( $rawpost ); + break; + + case 'rules': + $parser->parse_smilies = 1; + $parser->parse_html = 1; + $parser->parse_bbcode = 1; + $parser->parse_nl2br = 1; + $parser->parsing_section = 'rules'; + + $rawpost = $parser->preEditParse( $r['rules_text'] ); + break; + + default: + $plugin->parser =& $parser; + + $rawpost = $plugin->getRawPost( $type, $r ); + break; + } + + /* @link http://community.invisionpower.com/tracker/issue-36434-rebuild-post-content-remove-break-from-post-content/ New parser retains
    , legacy retains \n */ + if ( $type == 'posts' || $type == 'sigs' ) + { + /* Anything special here? */ + $newpost = $rawpost; + } + else + { + if ( strstr( $rawpost, "\n" ) ) + { + $rawpost = nl2br( $rawpost ); + } + + $newpost = $parser->preDbParse( $rawpost ); + } + + + //----------------------------------------- + // Remove old \' escaping + //----------------------------------------- + + $newpost = str_replace( "\\'", "'", $newpost ); + + //----------------------------------------- + // Convert old dohtml? + //----------------------------------------- + + $htmlstate = 0; + + if ( strstr( strtolower($newpost), '[dohtml]' ) ) + { + //----------------------------------------- + // Can we use HTML? + //----------------------------------------- + + if ( $type == 'posts' AND $this->registry->class_forums->forum_by_id[ $r['forum_id'] ]['use_html'] ) + { + $htmlstate = 2; + } + + $newpost = preg_replace( "#\[dohtml\]#i" , "", $newpost ); + $newpost = preg_replace( "#\[/dohtml\]#i", "", $newpost ); + } + else + { + $htmlstate = intval( $r['post_htmlstate'] ); + } + + //----------------------------------------- + // Convert old attachment tags + //----------------------------------------- + + $newpost = preg_replace( "#\[attachmentid=(\d+?)\]#is", "[attachment=\\1:attachment]", $newpost ); + + if ( $newpost OR $type == 'sigs' OR $type == 'aboutme' ) + { + switch( $type ) + { + case 'posts': + $this->DB->update( 'posts', array( 'post' => $newpost, 'post_htmlstate' => $htmlstate ), 'pid='.$r['pid'] ); + $last = $r['pid']; + break; + + case 'pms': + $this->DB->update( 'message_posts', array( 'msg_post' => $newpost ), 'msg_id='.$r['msg_id'] ); + $last = $r['msg_id']; + break; + + case 'sigs': + $this->DB->update( 'profile_portal', array( 'signature' => $newpost ), 'pp_member_id='.$r['pp_member_id'] ); + $last = $r['pp_member_id']; + break; + + case 'aboutme': + $this->DB->update( 'profile_portal', array( 'pp_about_me' => $newpost ), 'pp_member_id='.$r['pp_member_id'] ); + $last = $r['pp_member_id']; + break; + + case 'announce': + $this->DB->update( 'announcements', array( 'announce_post' => $newpost ), 'announce_id='.$r['announce_id'] ); + $last = $r['announce_id']; + break; + + case 'rules': + $this->DB->update( 'forums', array( 'rules_text' => $newpost ), 'id='.$r['id'] ); + $last = $r['id']; + break; + + default: + $last = $plugin->storeNewPost( $type, $r, $newpost ); + break; + } + } + + $done++; + } + + if ( method_exists( $this->DB, 'setQueryRowLocking' ) ) + { + $this->DB->setQueryRowLocking( 'ON' ); + } + + //----------------------------------------- + // Finish - or more?... + //----------------------------------------- + + if ( ! $last and ! $max ) + { + //----------------------------------------- + // Done.. + //----------------------------------------- + + $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); + $url = "{$this->settings['base_url']}{$this->form_code}"; + + $sections[] = $type; + $this->DB->replace( 'cache_store', array( 'cs_key' => 'isRebuilt', 'cs_value' => implode( ',', $sections ) ), array( "cs_key" ) ); + + if( $type == 'posts' ) + { + $this->DB->delete( 'content_cache_posts' ); + } + else if( $type == 'sigs' ) + { + $this->DB->delete( 'content_cache_sigs' ); + } + } + else + { + //----------------------------------------- + // More.. + //----------------------------------------- + + $dis = $dis + $done; + $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); + $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); + $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&type={$type}&pergo={$this->request['pergo']}&st={$last}&dis={$dis}"; + } + + //----------------------------------------- + // Bye.... + //----------------------------------------- + + $this->_specialRedirect( $url, $text ); + } + + /** + * Resyncronize Topics + * + * @return @e void + */ + public function resyncTopics() + { + $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/moderate.php', 'moderatorLibrary', 'forums' ); + $modfunc = new $classToLoad( $this->registry ); + + $this->registry->class_localization->loadLanguageFile( array( 'public_global' ) ); + + //----------------------------------------- + // Set up + //----------------------------------------- + + $done = 0; + $start = intval( $this->request['st'] ) >= 0 ? intval( $this->request['st'] ) : 0; + $end = intval( $this->request['pergo'] ) ? intval( $this->request['pergo'] ) : 100; + $last = $start + 1; + $output = array(); + + //----------------------------------------- + // Got any more? + //----------------------------------------- + + $tmp = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'topics', 'where' => "state != 'link' AND tid>{$start} AND topic_archive_status NOT IN (" . $this->registry->class_forums->fetchTopicArchiveFlag( 'working' ) . "," . $this->registry->class_forums->fetchTopicArchiveFlag( 'restore' ) . ")", 'limit' => array( 0, 1 ) ) ); + $max = intval( $tmp['count'] ); + + //----------------------------------------- + // Avoid limit... + //----------------------------------------- + + $this->DB->build( array( 'select' => '*', 'from' => 'topics', 'where' => "state != 'link' AND tid>{$start} AND topic_archive_status NOT IN (" . $this->registry->class_forums->fetchTopicArchiveFlag( 'working' ) . "," . $this->registry->class_forums->fetchTopicArchiveFlag( 'restore' ) . ")", 'order' => 'tid ASC', 'limit' => array( 0, $end ) ) ); + $outer = $this->DB->execute(); + + //----------------------------------------- + // Process... + //----------------------------------------- + + while( $r = $this->DB->fetch( $outer ) ) + { + $modfunc->rebuildTopic($r['tid'], 0); + + if ( $this->request['pergo'] <= 200 ) + { + $output[] = $this->lang->words['re_processed'].$r['title']; + } + + $done++; + $last = $r['tid']; + } + + //----------------------------------------- + // Finish - or more?... + //----------------------------------------- + + if ( ! $done and ! $max ) + { + //----------------------------------------- + // Done.. + //----------------------------------------- + + $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); + $url = "{$this->settings['base_url']}{$this->form_code}"; + } + else + { + //----------------------------------------- + // More.. + //----------------------------------------- + + $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $last ); + $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); + $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$last}"; + } + + //----------------------------------------- + // Bye.... + //----------------------------------------- + + $this->_specialRedirect( $url, $text ); + } + + /** + * Resyncronize forum data + * + * @return @e void + */ + public function resyncForums() + { + $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/moderate.php', 'moderatorLibrary', 'forums' ); + $modfunc = new $classToLoad( $this->registry ); + + //----------------------------------------- + // Set up + //----------------------------------------- + + $done = 0; + $start = intval( $this->request['st'] ) >= 0 ? intval( $this->request['st'] ) : 0; + $end = intval( $this->request['pergo'] ) ? intval( $this->request['pergo'] ) : 100; + $dis = $end + $start; + $output = array(); + + //----------------------------------------- + // Got any more? + //----------------------------------------- + + $tmp = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'forums', 'limit' => array( $dis, 1 ) ) ); + $max = intval( $tmp['count'] ); + + //----------------------------------------- + // Avoid limit... + //----------------------------------------- + + $this->DB->build( array( 'select' => '*', 'from' => 'forums', 'order' => 'id ASC', 'limit' => array( $start, $end ) ) ); + $outer = $this->DB->execute(); + + //----------------------------------------- + // Process... + //----------------------------------------- + + while( $r = $this->DB->fetch( $outer ) ) + { + $modfunc->forumRecount( $r['id'] ); + $output[] = sprintf( $this->lang->words['rebuild_process_f'], $r['name'] ); + $done++; + } + + //----------------------------------------- + // Finish - or more?... + //----------------------------------------- + + if ( ! $done and ! $max ) + { + //----------------------------------------- + // Done.. + //----------------------------------------- + + $text = $this->lang->words['re_rebuildcomp'] . '
    ' . implode( "
    ", $output ); + $url = "{$this->settings['base_url']}{$this->form_code}"; + } + else + { + //----------------------------------------- + // More.. + //----------------------------------------- + $thisgoeshere = sprintf( $this->lang->words['re_thisgoeshere'], $dis ); + $text = $thisgoeshere . '
    ' . implode( "
    ", $output ); + $url = "{$this->settings['base_url']}{$this->form_code}&do={$this->request['do']}&pergo={$this->request['pergo']}&st={$dis}"; + } + + //----------------------------------------- + // Bye.... + //----------------------------------------- + + $this->_specialRedirect( $url, $text ); + } + + /** + * Splash screen with rebuild options + * + * @return @e void + */ + public function rebuildSplashScreen() + { + /* Build Form Elements */ + $form = array(); + + $form['posts'] = $this->registry->output->formDropdown( 'posts' , array( 0 => array( 0, $this->lang->words['yesno_no'] ), 1 => array( 1, $this->lang->words['yesno_yes'] ) ) ); + $form['members'] = $this->registry->output->formDropdown( 'members', array( 0 => array( 0, $this->lang->words['yesno_no'] ), 1 => array( 1, $this->lang->words['yesno_yes'] ) ) ); + $form['lastreg'] = $this->registry->output->formDropdown( 'lastreg', array( 0 => array( 0, $this->lang->words['yesno_no'] ), 1 => array( 1, $this->lang->words['yesno_yes'] ) ) ); + $form['online'] = $this->registry->output->formDropdown( 'online' , array( 0 => array( 0, $this->lang->words['yesno_no'] ), 1 => array( 1, $this->lang->words['yesno_yes'] ) ) ); + + //----------------------------------------- + // Only need to rebuild once + //----------------------------------------- + + $todo = array( + array( 'posts' , $this->lang->words['remenu_posts'] ), + array( 'pms' , $this->lang->words['remenu_pms'] ), + array( 'announce', $this->lang->words['remenu_announce'] ), + array( 'sigs' , $this->lang->words['remenu_sigs'] ), + array( 'aboutme' , $this->lang->words['remenu_aboutme'] ), + array( 'rules' , $this->lang->words['remenu_rules'] ), + ); + + foreach( ipsRegistry::$applications as $app_dir => $app_data ) + { + //----------------------------------------- + // Retrieve the RSS links for the header + //----------------------------------------- + + if( is_file( IPSLib::getAppDir( $app_dir ) . '/extensions/upgradePostRebuild.php' ) ) + { + $className = IPSLib::loadLibrary( IPSLib::getAppDir( $app_dir ) . '/extensions/upgradePostRebuild.php', 'postRebuild_'.$app_dir, $app_dir ); + + if( class_exists( $className ) ) + { + $rebuild = new $className( $this->registry ); + + if( method_exists( $rebuild, "getDropdown" ) ) + { + $todo = array_merge( $todo, $rebuild->getDropdown() ); + } + } + } + } + + $final = array(); + $sections = array(); + + $alreadyRebuilt = $this->DB->buildAndFetch( array( 'select' => 'cs_value', 'from' => 'cache_store', 'where' => "cs_key='isRebuilt'" ) ); + + if( $alreadyRebuilt['cs_value'] ) + { + $sections = explode( ',', $alreadyRebuilt['cs_value'] ); + } + + $form['pergo'] = $this->registry->output->formSimpleInput( 'pergo', '50', 5 ); + + /* Output */ + $this->registry->output->html .= $this->html->rebuildSplashScreen( $form, $todo, $sections ); + } + + /** + * Redirect via a temporary page + * + * @param string $url URL to redirect to + * @param string $text Text to display + * @return @e void + */ + protected function _specialRedirect( $url, $text ) + { + $this->registry->output->html .= $this->registry->output->global_template->temporaryRedirect( $url, $text ); + } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/tools/sharelinks.php b/upload/admin/applications/core/modules_admin/tools/sharelinks.php index cf107996..133b8c71 100644 --- a/upload/admin/applications/core/modules_admin/tools/sharelinks.php +++ b/upload/admin/applications/core/modules_admin/tools/sharelinks.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Bookmarks
      * Last Updated: $LastChangedDate: 2013-01-07 12:09:37 -0500 (Mon, 07 Jan 2013) $
      * 
    diff --git a/upload/admin/applications/core/modules_admin/tools/uagents.php b/upload/admin/applications/core/modules_admin/tools/uagents.php index e61d9df1..6cde5912 100644 --- a/upload/admin/applications/core/modules_admin/tools/uagents.php +++ b/upload/admin/applications/core/modules_admin/tools/uagents.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * User agent management
      * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/modules_admin/tools/xml/index.html b/upload/admin/applications/core/modules_admin/tools/xml/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_admin/tools/xml/index.html +++ b/upload/admin/applications/core/modules_admin/tools/xml/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_admin/tools/xml/menu.xml b/upload/admin/applications/core/modules_admin/tools/xml/menu.xml index 85b45c4c..20074b01 100644 --- a/upload/admin/applications/core/modules_admin/tools/xml/menu.xml +++ b/upload/admin/applications/core/modules_admin/tools/xml/menu.xml @@ -2,10 +2,10 @@ - Режим Повышенной Производительности + Performance Mode - Режим Повышенной Производительности + Performance Mode performance performance @@ -15,23 +15,10 @@ - Ключ лицензии + User Agent Management - Ключ лицензии - licensekey - licensekey - - licensekey_manage - 0 - - - - - Управление User Agent - - - Управление User Agent + User Agent Management uagents uagents do=list @@ -42,10 +29,10 @@ - Пересчет и Перестроение + Recount & Rebuild - Пересчет и Перестроение + Recount & Rebuild recount_rebuild rebuild do=rebuild_overview @@ -55,10 +42,10 @@ - Инструменты Очистки + Clean Up Tools - Инструменты Очистки + Clean Up Tools cleanup_tools rebuild do=tools @@ -68,10 +55,10 @@ - Управление Разделами Помощи + Manage Help Files - Управление Разделами Помощи + Manage Help Files manage_help help do=help_overview @@ -81,10 +68,10 @@ - Управление Кешем + Cache Management - Управление Кешем + Cache Management caches cache do=cache_overview @@ -94,10 +81,10 @@ - Система «Вопрос-ответ» + Question & Answer Challenge - Система «Вопрос-ответ» + Question & Answer Challenge qanda qanda @@ -107,10 +94,10 @@ - Пользователи API + API Users - Пользователи API + API Users api_users api @@ -120,10 +107,10 @@ - Управление Авторизацией + Log In Management - Управление Авторизацией + Log In Management login_modules login do=login_overview @@ -133,10 +120,10 @@ - Публикация Ссылок + Share Links - Публикация Ссылок + Share Links sharelinks sharelinks @@ -146,10 +133,10 @@ - Правила Входящей Почты + Incoming Email Rules - Правила Входящей Почты + Incoming Email Rules incoming_emails incomingEmails diff --git a/upload/admin/applications/core/modules_admin/tools/xml/permissions.xml b/upload/admin/applications/core/modules_admin/tools/xml/permissions.xml index cd205d25..5294089f 100644 --- a/upload/admin/applications/core/modules_admin/tools/xml/permissions.xml +++ b/upload/admin/applications/core/modules_admin/tools/xml/permissions.xml @@ -1,174 +1,174 @@ - Настройки Инструментов + Tools & Settings core_tands performance_toggle - Может включать режим производительности? + Can toggle performance mode? licensekey_manage - Может работать с информацией о лицензии? + Can manage license key? - Управление кешем + Manage Caches core_caches cache_manage - Может посматривать и обновлять кеш? + Can view and recache caches? - Управление модулями авторизации + Manage Log In Modules core_login_modules login_manage - Может управлять модулями авторизации? + Can manage log in modules? - Система вопросов при регистрации + Registration questions and answers core_qanda qanda_view - Может просматривать? + Can access questions and answers? qa_manage - Может изменять, добавлять и удалять? + Can add, edit and remove questions and answers? - Управление разделами помощи + Manage Help Files core_helpfiles helpfiles_manage - Может просматривать? + Can access help files? help_manage - Может изменять/добавлять? + Can edit/add help files? help_remove - Может удалять? + Can remove help files? - Пользователи API + API Users core_apiusers api_manage - Может изменять/добавлять? + Can edit/add API users? api_remove - Может удалять? + Can remove API users? api_logs - Может просматривать логи? + Can access API logs? - Сервисы публикации ссылок + Share Links core_sharelinks sharelinks_manage - Может изменять/добавлять/удалять? + Can edit/add/delete share links? - Управление User Agents + Manage User Agents core_uagents uagents - Может управлять? + Can manage user agents? ua_manage - Может изменять/добавлять группы и агенты? + Can edit/add user agents and user agent groups? ua_remove - Может удалять группы и агенты? + Can remove user agents and user agent groups? - Инструменты очистки и перестроения + Cleanup and Rebuild Tools core_cleanuprebuild rebuild_manage - Имеет доступ к инструментам перестроения? + Can access rebuild tools? cleanup_manage - Имеет доступ к инструментам пересчета? + Can access recount tools? tools_recount - Может производить пересчет статистики форума? + Can recount site statistics? tools_resynch - Может производить пересчет статистики форумов? + Can resynchronize forums? tools_resyncht - Может производить пересчет статистики тем? + Can resynchronize topics? tools_rebuild - Может производить перестроение содержимого сообщений? + Can rebuild bbcode in post and other content? tools_postcounts - Может производить пересчет сообщений пользователей? + Can reset post counts and usernames in posts? tools_thumbs - Может производить обновление изображений предпросмотра? + Can rebuild thumbnails and user photos? tools_attach - Может производить перестроение прикреплений? + Can rebuild attachment data? tools_orphaned - Может удалять потерянные файлы? + Can remove orphaned attachments? tools_orphanp - Может удалять потерянные фотографии? + Can remove orphaned photos? - Правила входящей почты + Incoming Email Rules core_emailrules incomingemail_manage - Может управлять правилами? + Can manage Incoming Email rules? diff --git a/upload/admin/applications/core/modules_public/ajax/attach.php b/upload/admin/applications/core/modules_public/ajax/attach.php index 0e1235cd..7a0ca57d 100644 --- a/upload/admin/applications/core/modules_public/ajax/attach.php +++ b/upload/admin/applications/core/modules_public/ajax/attach.php @@ -7,7 +7,7 @@ * $Author: mmecham $ * @since - * $LastChangedDate: 2013-03-19 09:02:31 -0400 (Tue, 19 Mar 2013) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 12085 $ */ diff --git a/upload/admin/applications/core/modules_public/ajax/captcha.php b/upload/admin/applications/core/modules_public/ajax/captcha.php index aa2340ce..8f94c7c4 100644 --- a/upload/admin/applications/core/modules_public/ajax/captcha.php +++ b/upload/admin/applications/core/modules_public/ajax/captcha.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Update captcha image
      * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/modules_public/ajax/comments.php b/upload/admin/applications/core/modules_public/ajax/comments.php index b272fdd2..cb43bae5 100644 --- a/upload/admin/applications/core/modules_public/ajax/comments.php +++ b/upload/admin/applications/core/modules_public/ajax/comments.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Image Ajax
      * Last Updated: $LastChangedDate: 2013-02-08 10:22:34 -0500 (Fri, 08 Feb 2013) $
      * 
    diff --git a/upload/admin/applications/core/modules_public/ajax/defaultSection.php b/upload/admin/applications/core/modules_public/ajax/defaultSection.php index f8801479..92576a2f 100644 --- a/upload/admin/applications/core/modules_public/ajax/defaultSection.php +++ b/upload/admin/applications/core/modules_public/ajax/defaultSection.php @@ -7,7 +7,7 @@ * $Author: ips_terabyte $ * @since 20th February 2002 * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 8655 $ */ diff --git a/upload/admin/applications/core/modules_public/ajax/editor.php b/upload/admin/applications/core/modules_public/ajax/editor.php index f917ee12..471a991d 100644 --- a/upload/admin/applications/core/modules_public/ajax/editor.php +++ b/upload/admin/applications/core/modules_public/ajax/editor.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Handles ajax functions for IP.Board Text Editor
      * Author: Matt "Matt Mecham" Mecham
      * Last Updated: $LastChangedDate: 2012-10-10 06:39:40 -0400 (Wed, 10 Oct 2012) $
    diff --git a/upload/admin/applications/core/modules_public/ajax/facebook.php b/upload/admin/applications/core/modules_public/ajax/facebook.php
    index c09d8c85..cdedf282 100644
    --- a/upload/admin/applications/core/modules_public/ajax/facebook.php
    +++ b/upload/admin/applications/core/modules_public/ajax/facebook.php
    @@ -3,7 +3,7 @@
     /**
      * 
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Login handler abstraction : AJAX login
      * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/modules_public/ajax/findnames.php b/upload/admin/applications/core/modules_public/ajax/findnames.php index 74915012..2b5c7216 100644 --- a/upload/admin/applications/core/modules_public/ajax/findnames.php +++ b/upload/admin/applications/core/modules_public/ajax/findnames.php @@ -1,110 +1,110 @@ - - * Invision Power Services - * IP.Board v3.4.5 - * Login handler abstraction : AJAX Find Names functions - * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $ - *
    - * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/company/standards.php#license - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com - * @since Tuesday 1st March 2005 (11:52) - * @version $Revision: 10721 $ - * @see admin_core_ajax_findnames - * - */ - -if ( ! defined( 'IN_IPB' ) ) -{ - print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -class public_core_ajax_findnames extends ipsAjaxCommand -{ - /** - * Class entry point - * - * @param object Registry reference - * @return @e void [Outputs to screen] - */ - public function doExecute( ipsRegistry $registry ) - { - switch( $this->request['do'] ) - { - case 'get-member-names': - $this->_getMemberNames(); - break; - } - } - - /** - * Returns possible matches for the string input - * - * @return @e void Outputs to screen - */ - protected function _getMemberNames() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $name = IPSText::convertUnicode( $this->convertAndMakeSafe( $this->request['name'], 0 ), true ); - $name = IPSText::convertCharsets( $name, 'utf-8', IPS_DOC_CHAR_SET ); - - //----------------------------------------- - // Check length - //----------------------------------------- - - if ( IPSText::mbstrlen( $name ) < 3 ) - { - $this->returnJsonError( 'requestTooShort' ); - } - - //----------------------------------------- - // Try query... - //----------------------------------------- - - $this->DB->build( array( 'select' => 'm.members_display_name, m.name, m.member_id, m.member_group_id', - 'from' => array( 'members' => 'm' ), - 'where' => "m.members_l_display_name LIKE '" . $this->DB->addSlashes( mb_strtolower( $name ) ) . "%'", - 'order' => $this->DB->buildLength( 'm.members_display_name' ) . ' ASC', - 'limit' => array( 0, 15 ), - 'add_join' => array( array( 'select' => 'p.*', - 'from' => array( 'profile_portal' => 'p' ), - 'where' => 'p.pp_member_id=m.member_id', - 'type' => 'left' ) ) ) ); - $this->DB->execute(); - - //----------------------------------------- - // Got any results? - //----------------------------------------- - - if ( ! $this->DB->getTotalRows() ) - { - $this->returnJsonArray( array( ) ); - } - - $return = array(); - - while( $r = $this->DB->fetch() ) - { - $photo = IPSMember::buildProfilePhoto( $r ); - $group = IPSMember::makeNameFormatted( '' , $r['member_group_id'] ); - $return[ $r['member_id'] ] = array( 'name' => $r['members_display_name'], - 'showas'=> '' . $r['members_display_name'] . ' (' . $group . ')', - 'img' => $photo['pp_mini_photo'], - 'img_w' => $photo['pp_mini_width'], - 'img_h' => $photo['pp_mini_height'] - ); - } - - $this->returnJsonArray( $return ); - } + + * Invision Power Services + * IP.Board v3.4.6 + * Login handler abstraction : AJAX Find Names functions + * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $ + * + * + * @author $Author: bfarber $ + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license http://www.invisionpower.com/company/standards.php#license + * @package IP.Board + * @subpackage Core + * @link http://www.invisionpower.com + * @since Tuesday 1st March 2005 (11:52) + * @version $Revision: 10721 $ + * @see admin_core_ajax_findnames + * + */ + +if ( ! defined( 'IN_IPB' ) ) +{ + print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +class public_core_ajax_findnames extends ipsAjaxCommand +{ + /** + * Class entry point + * + * @param object Registry reference + * @return @e void [Outputs to screen] + */ + public function doExecute( ipsRegistry $registry ) + { + switch( $this->request['do'] ) + { + case 'get-member-names': + $this->_getMemberNames(); + break; + } + } + + /** + * Returns possible matches for the string input + * + * @return @e void Outputs to screen + */ + protected function _getMemberNames() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $name = IPSText::convertUnicode( $this->convertAndMakeSafe( $this->request['name'], 0 ), true ); + $name = IPSText::convertCharsets( $name, 'utf-8', IPS_DOC_CHAR_SET ); + + //----------------------------------------- + // Check length + //----------------------------------------- + + if ( IPSText::mbstrlen( $name ) < 3 ) + { + $this->returnJsonError( 'requestTooShort' ); + } + + //----------------------------------------- + // Try query... + //----------------------------------------- + + $this->DB->build( array( 'select' => 'm.members_display_name, m.name, m.member_id, m.member_group_id', + 'from' => array( 'members' => 'm' ), + 'where' => "m.members_l_display_name LIKE '" . $this->DB->addSlashes( strtolower( $name ) ) . "%'", + 'order' => $this->DB->buildLength( 'm.members_display_name' ) . ' ASC', + 'limit' => array( 0, 15 ), + 'add_join' => array( array( 'select' => 'p.*', + 'from' => array( 'profile_portal' => 'p' ), + 'where' => 'p.pp_member_id=m.member_id', + 'type' => 'left' ) ) ) ); + $this->DB->execute(); + + //----------------------------------------- + // Got any results? + //----------------------------------------- + + if ( ! $this->DB->getTotalRows() ) + { + $this->returnJsonArray( array( ) ); + } + + $return = array(); + + while( $r = $this->DB->fetch() ) + { + $photo = IPSMember::buildProfilePhoto( $r ); + $group = IPSMember::makeNameFormatted( '' , $r['member_group_id'] ); + $return[ $r['member_id'] ] = array( 'name' => $r['members_display_name'], + 'showas'=> '' . $r['members_display_name'] . ' (' . $group . ')', + 'img' => $photo['pp_mini_photo'], + 'img_w' => $photo['pp_mini_width'], + 'img_h' => $photo['pp_mini_height'] + ); + } + + $this->returnJsonArray( $return ); + } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/ajax/index.html b/upload/admin/applications/core/modules_public/ajax/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_public/ajax/index.html +++ b/upload/admin/applications/core/modules_public/ajax/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/ajax/like.php b/upload/admin/applications/core/modules_public/ajax/like.php index 58732697..ddaa444d 100644 --- a/upload/admin/applications/core/modules_public/ajax/like.php +++ b/upload/admin/applications/core/modules_public/ajax/like.php @@ -7,7 +7,7 @@ * $Author: bfarber $ * @since - * $LastChangedDate: 2011-08-05 20:51:01 -0400 (Fri, 05 Aug 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 9373 $ */ diff --git a/upload/admin/applications/core/modules_public/ajax/login.php b/upload/admin/applications/core/modules_public/ajax/login.php index beef3bbc..54596fdd 100644 --- a/upload/admin/applications/core/modules_public/ajax/login.php +++ b/upload/admin/applications/core/modules_public/ajax/login.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Login handler abstraction : AJAX login
      * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/modules_public/ajax/media.php b/upload/admin/applications/core/modules_public/ajax/media.php index 16aaebde..63adad72 100644 --- a/upload/admin/applications/core/modules_public/ajax/media.php +++ b/upload/admin/applications/core/modules_public/ajax/media.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Handles ajax functions for IP.Board Text Editor
      * Author: Matt "Matt Mecham" Mecham
      * Last Updated: $LastChangedDate: 2012-06-07 06:21:09 -0400 (Thu, 07 Jun 2012) $
    diff --git a/upload/admin/applications/core/modules_public/ajax/modcp.php b/upload/admin/applications/core/modules_public/ajax/modcp.php
    index bd0cdf9a..2beb3440 100644
    --- a/upload/admin/applications/core/modules_public/ajax/modcp.php
    +++ b/upload/admin/applications/core/modules_public/ajax/modcp.php
    @@ -1,175 +1,175 @@
    -Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
    -	exit();
    -}
    -
    -/**
    - *
    - * @class		public_core_ajax_modcp
    - * @brief		Moderator control panel
    - * 
    - */
    -class public_core_ajax_modcp extends ipsAjaxCommand
    -{	
    -	/**
    -	 * Main function executed automatically by the controller
    -	 *
    -	 * @param	object		$registry		Registry object
    -	 * @return	@e void
    -	 */
    -	public function doExecute( ipsRegistry $registry ) 
    -	{
    -		//-----------------------------------------
    -		// Load basic things
    -		//-----------------------------------------
    -
    -		$this->registry->class_localization->loadLanguageFile( array( 'public_modcp' ) );
    -
    -		//-----------------------------------------
    -		// Which road are we going to take?
    -		//-----------------------------------------
    -		
    -		switch( $this->request['do'] )
    -		{
    -			default:
    -			case 'index':
    -				$this->_getTab();
    -			break;
    -			
    -			case 'getmembers':
    -				$this->_getMembers();
    -			break;
    -		}
    -
    -		//-----------------------------------------
    -		// Output
    -		//-----------------------------------------
    -
    -		$this->registry->getClass('output')->addContent( $this->output );
    -		$this->registry->output->sendOutput();
    -	}
    -	
    -	/**
    -	 * Returns possible matches for the string input
    -	 *
    -	 * @return	@e void		Outputs to screen
    -	 */
    -	protected function _getMembers()
    -	{
    -		//-----------------------------------------
    -		// INIT
    -		//-----------------------------------------
    -	
    -		$name = IPSText::convertUnicode( $this->convertAndMakeSafe( $this->request['name'], 0 ), true );
    -		$name = IPSText::convertCharsets( $name, 'utf-8', IPS_DOC_CHAR_SET );
    -	
    -		//-----------------------------------------
    -		// Check length
    -		//-----------------------------------------
    -	
    -		if ( IPSText::mbstrlen( $name ) < 3 )
    -		{
    -			$this->returnJsonError( 'requestTooShort' );
    -		}
    -	
    -		//-----------------------------------------
    -		// Try query...
    -		//-----------------------------------------
    -	
    -		$this->DB->build( array( 'select'	=> 'm.members_display_name, m.member_id, m.members_seo_name, m.member_group_id',
    -								 'from'	    => array( 'members' => 'm' ),
    -								 'where'	=> "m.members_l_display_name LIKE '" . $this->DB->addSlashes( mb_strtolower( $name ) ) . "%'",
    -								 'order'	=> $this->DB->buildLength( 'm.members_display_name' ) . ' ASC',
    -								 'limit'	=> array( 0, 15 ),
    -									 'add_join' => array( array( 'select' => 'p.*',
    -														     'from'   => array( 'profile_portal' => 'p' ),
    -														     'where'  => 'p.pp_member_id=m.member_id',
    -														     'type'   => 'left' ) ) ) );
    -		$this->DB->execute();
    -	
    -		//-----------------------------------------
    -		// Got any results?
    -		//-----------------------------------------
    -	
    -		if ( ! $this->DB->getTotalRows() )
    -		{
    -			$this->returnJsonArray( array( ) );
    -		}
    -	
    -		$return = array();
    -	
    -		while( $r = $this->DB->fetch() )
    -		{
    -			$url	= $this->registry->output->buildSEOUrl( "app=core&module=modcp&do=editmember&mid={$r['member_id']}", 'public' );
    -			$photo	= IPSMember::buildProfilePhoto( $r );
    -			$group	= IPSMember::makeNameFormatted( '' , $r['member_group_id'] );
    -	
    -			$return[ $r['member_id'] ] = array( 'name' 	=> $r['members_display_name'],
    -												'showas'=> '' . $r['members_display_name'] . ' (' . $group . ')',
    -												'img'	=> $photo['pp_thumb_photo'],
    -												'img_w'	=> $photo['pp_mini_width'],
    -												'img_h'	=> $photo['pp_mini_height'],
    -												'url'	=> $url,
    -											);
    -		}
    -	
    -		$this->returnJsonArray( $return );
    -	}
    -	
    -	/**
    -	 * Retrieve modcp tab based
    -	 *
    -	 * @return	@e void
    -	 */
    -	protected function _getTab()
    -	{
    -		//-----------------------------------------
    -		// Init
    -		//-----------------------------------------
    -		
    -		ipsRegistry::getAppClass( 'forums' );
    -		
    -		$app		= trim($this->request['fromapp']);
    -		$plugin		= trim($this->request['tab']);
    -		$moderator	= $this->registry->class_forums->getModerator();
    -		$_output	= '';
    -		
    -		//-----------------------------------------
    -		// Get plugin output
    -		//-----------------------------------------
    -
    -		if( is_file( IPSLib::getAppDir( $app ) . '/extensions/modcp/plugin_' . $app . '_' . $plugin . '.php' ) )
    -		{
    -			$classToLoad	= IPSLib::loadLibrary( IPSLib::getAppDir( $app ) . '/extensions/modcp/plugin_' . $app . '_' . $plugin . '.php', 'plugin_' . $app . '_' . $plugin, $app );
    -			$_thisPlugin	= new $classToLoad( $this->registry );
    -			
    -			$_output		= $_thisPlugin->executePlugin( $moderator );
    -		}
    -		
    -		//-----------------------------------------
    -		// Output
    -		//-----------------------------------------
    -		
    -		if( $_output )
    -		{
    -			$this->returnJsonArray( array( 'html' => $_output ) );
    -		}
    -		else
    -		{
    -			$this->returnJsonError( $this->lang->words['plugin_not_found'] );
    -		}
    -	}
    +Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
    +	exit();
    +}
    +
    +/**
    + *
    + * @class		public_core_ajax_modcp
    + * @brief		Moderator control panel
    + * 
    + */
    +class public_core_ajax_modcp extends ipsAjaxCommand
    +{	
    +	/**
    +	 * Main function executed automatically by the controller
    +	 *
    +	 * @param	object		$registry		Registry object
    +	 * @return	@e void
    +	 */
    +	public function doExecute( ipsRegistry $registry ) 
    +	{
    +		//-----------------------------------------
    +		// Load basic things
    +		//-----------------------------------------
    +
    +		$this->registry->class_localization->loadLanguageFile( array( 'public_modcp' ) );
    +
    +		//-----------------------------------------
    +		// Which road are we going to take?
    +		//-----------------------------------------
    +		
    +		switch( $this->request['do'] )
    +		{
    +			default:
    +			case 'index':
    +				$this->_getTab();
    +			break;
    +			
    +			case 'getmembers':
    +				$this->_getMembers();
    +			break;
    +		}
    +
    +		//-----------------------------------------
    +		// Output
    +		//-----------------------------------------
    +
    +		$this->registry->getClass('output')->addContent( $this->output );
    +		$this->registry->output->sendOutput();
    +	}
    +	
    +	/**
    +	 * Returns possible matches for the string input
    +	 *
    +	 * @return	@e void		Outputs to screen
    +	 */
    +	protected function _getMembers()
    +	{
    +		//-----------------------------------------
    +		// INIT
    +		//-----------------------------------------
    +	
    +		$name = IPSText::convertUnicode( $this->convertAndMakeSafe( $this->request['name'], 0 ), true );
    +		$name = IPSText::convertCharsets( $name, 'utf-8', IPS_DOC_CHAR_SET );
    +	
    +		//-----------------------------------------
    +		// Check length
    +		//-----------------------------------------
    +	
    +		if ( IPSText::mbstrlen( $name ) < 3 )
    +		{
    +			$this->returnJsonError( 'requestTooShort' );
    +		}
    +	
    +		//-----------------------------------------
    +		// Try query...
    +		//-----------------------------------------
    +	
    +		$this->DB->build( array( 'select'	=> 'm.members_display_name, m.member_id, m.members_seo_name, m.member_group_id',
    +								 'from'	    => array( 'members' => 'm' ),
    +								 'where'	=> "m.members_l_display_name LIKE '" . $this->DB->addSlashes( strtolower( $name ) ) . "%'",
    +								 'order'	=> $this->DB->buildLength( 'm.members_display_name' ) . ' ASC',
    +								 'limit'	=> array( 0, 15 ),
    +									 'add_join' => array( array( 'select' => 'p.*',
    +														     'from'   => array( 'profile_portal' => 'p' ),
    +														     'where'  => 'p.pp_member_id=m.member_id',
    +														     'type'   => 'left' ) ) ) );
    +		$this->DB->execute();
    +	
    +		//-----------------------------------------
    +		// Got any results?
    +		//-----------------------------------------
    +	
    +		if ( ! $this->DB->getTotalRows() )
    +		{
    +			$this->returnJsonArray( array( ) );
    +		}
    +	
    +		$return = array();
    +	
    +		while( $r = $this->DB->fetch() )
    +		{
    +			$url	= $this->registry->output->buildSEOUrl( "app=core&module=modcp&do=editmember&mid={$r['member_id']}", 'public' );
    +			$photo	= IPSMember::buildProfilePhoto( $r );
    +			$group	= IPSMember::makeNameFormatted( '' , $r['member_group_id'] );
    +	
    +			$return[ $r['member_id'] ] = array( 'name' 	=> $r['members_display_name'],
    +												'showas'=> '' . $r['members_display_name'] . ' (' . $group . ')',
    +												'img'	=> $photo['pp_thumb_photo'],
    +												'img_w'	=> $photo['pp_mini_width'],
    +												'img_h'	=> $photo['pp_mini_height'],
    +												'url'	=> $url,
    +											);
    +		}
    +	
    +		$this->returnJsonArray( $return );
    +	}
    +	
    +	/**
    +	 * Retrieve modcp tab based
    +	 *
    +	 * @return	@e void
    +	 */
    +	protected function _getTab()
    +	{
    +		//-----------------------------------------
    +		// Init
    +		//-----------------------------------------
    +		
    +		ipsRegistry::getAppClass( 'forums' );
    +		
    +		$app		= trim($this->request['fromapp']);
    +		$plugin		= trim($this->request['tab']);
    +		$moderator	= $this->registry->class_forums->getModerator();
    +		$_output	= '';
    +		
    +		//-----------------------------------------
    +		// Get plugin output
    +		//-----------------------------------------
    +
    +		if( is_file( IPSLib::getAppDir( $app ) . '/extensions/modcp/plugin_' . $app . '_' . $plugin . '.php' ) )
    +		{
    +			$classToLoad	= IPSLib::loadLibrary( IPSLib::getAppDir( $app ) . '/extensions/modcp/plugin_' . $app . '_' . $plugin . '.php', 'plugin_' . $app . '_' . $plugin, $app );
    +			$_thisPlugin	= new $classToLoad( $this->registry );
    +			
    +			$_output		= $_thisPlugin->executePlugin( $moderator );
    +		}
    +		
    +		//-----------------------------------------
    +		// Output
    +		//-----------------------------------------
    +		
    +		if( $_output )
    +		{
    +			$this->returnJsonArray( array( 'html' => $_output ) );
    +		}
    +		else
    +		{
    +			$this->returnJsonError( $this->lang->words['plugin_not_found'] );
    +		}
    +	}
     }
    \ No newline at end of file
    diff --git a/upload/admin/applications/core/modules_public/ajax/navigation.php b/upload/admin/applications/core/modules_public/ajax/navigation.php
    index c8254c8b..bda89121 100644
    --- a/upload/admin/applications/core/modules_public/ajax/navigation.php
    +++ b/upload/admin/applications/core/modules_public/ajax/navigation.php
    @@ -6,7 +6,7 @@
      * $Author: bfarber $
      * @since		2/14/2011
      * $LastChangedDate: 2011-04-27 19:56:50 -0400 (Wed, 27 Apr 2011) $
    - * @version		v3.4.5
    + * @version		v3.4.6
      * $Revision: 8514 $
      */
     
    diff --git a/upload/admin/applications/core/modules_public/ajax/notifications.php b/upload/admin/applications/core/modules_public/ajax/notifications.php
    index 73f49ec0..6f9e7177 100644
    --- a/upload/admin/applications/core/modules_public/ajax/notifications.php
    +++ b/upload/admin/applications/core/modules_public/ajax/notifications.php
    @@ -3,7 +3,7 @@
     /**
      * 
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Notification AJAX methods
      * Last Updated: $Date: 2012-08-28 17:56:22 -0400 (Tue, 28 Aug 2012) $
      * 
    diff --git a/upload/admin/applications/core/modules_public/ajax/register.php b/upload/admin/applications/core/modules_public/ajax/register.php index 55b1398a..f44825dc 100644 --- a/upload/admin/applications/core/modules_public/ajax/register.php +++ b/upload/admin/applications/core/modules_public/ajax/register.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Registration AJAX routines
      * Last Updated: $Date: 2012-07-19 11:49:35 -0400 (Thu, 19 Jul 2012) $
      * 
    diff --git a/upload/admin/applications/core/modules_public/ajax/reports.php b/upload/admin/applications/core/modules_public/ajax/reports.php index 623b6c82..3dbfc422 100644 --- a/upload/admin/applications/core/modules_public/ajax/reports.php +++ b/upload/admin/applications/core/modules_public/ajax/reports.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Reports AJAX options
      * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/modules_public/ajax/reputation.php b/upload/admin/applications/core/modules_public/ajax/reputation.php index b0564f13..0cd4d331 100644 --- a/upload/admin/applications/core/modules_public/ajax/reputation.php +++ b/upload/admin/applications/core/modules_public/ajax/reputation.php @@ -2,18 +2,18 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Reputation
    - * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
    + * Last Updated: $Date: 2013-10-16 19:11:24 -0400 (Wed, 16 Oct 2013) $
      * 
    * - * @author $Author: bfarber $ + * @author $Author: rashbrook $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @license http://www.invisionpower.com/company/standards.php#license * @package IP.Board * @subpackage Core * @link http://www.invisionpower.com - * @version $Rev: 10721 $ + * @version $Rev: 12381 $ */ if ( ! defined( 'IN_IPB' ) ) @@ -60,7 +60,7 @@ class public_core_ajax_reputation extends ipsAjaxCommand { $this->lang->loadLanguageFile( array( 'public_topic' ), 'forums' ); - if ( !$this->memberData['gbw_view_reps'] ) + if ( !$this->memberData['gbw_view_reps'] AND $this->settings['reputation_point_types'] != 'like' ) { $this->returnJsonError('no_permission'); } @@ -107,6 +107,11 @@ class public_core_ajax_reputation extends ipsAjaxCommand */ protected function _more() { + if ( ! $this->memberData['gbw_view_reps'] AND $this->settings['reputation_point_types'] != 'like' ) + { + $this->returnJsonError('no_permission'); + } + $app = trim( $this->request['f_app'] ); $type = trim( $this->request['f_type'] ); $id = intval( $this->request['f_id'] ); diff --git a/upload/admin/applications/core/modules_public/ajax/search.php b/upload/admin/applications/core/modules_public/ajax/search.php index 0fa1b7d2..4edf8eb4 100644 --- a/upload/admin/applications/core/modules_public/ajax/search.php +++ b/upload/admin/applications/core/modules_public/ajax/search.php @@ -6,7 +6,7 @@ * $Author: AndyMillne $ * @since 2/14/2011 * $LastChangedDate: 2013-03-22 17:35:37 -0400 (Fri, 22 Mar 2013) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 12112 $ */ diff --git a/upload/admin/applications/core/modules_public/ajax/sharelinks.php b/upload/admin/applications/core/modules_public/ajax/sharelinks.php index 3c26723a..725b4c52 100644 --- a/upload/admin/applications/core/modules_public/ajax/sharelinks.php +++ b/upload/admin/applications/core/modules_public/ajax/sharelinks.php @@ -6,7 +6,7 @@ * $License: http://www.invisionpower.com/company/standards.php#license$ * $Author: mmecham $ * $LastChangedDate: 2012-09-19 10:57:30 -0400 (Wed, 19 Sep 2012) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 11350 $ */ diff --git a/upload/admin/applications/core/modules_public/ajax/skin.php b/upload/admin/applications/core/modules_public/ajax/skin.php index 07f0de18..8e8173b9 100644 --- a/upload/admin/applications/core/modules_public/ajax/skin.php +++ b/upload/admin/applications/core/modules_public/ajax/skin.php @@ -7,7 +7,7 @@ * $Author: bfarber $ * @since - * $LastChangedDate: 2011-08-06 01:51:01 +0100 (Sat, 06 Aug 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 9373 $ */ diff --git a/upload/admin/applications/core/modules_public/ajax/skingen.php b/upload/admin/applications/core/modules_public/ajax/skingen.php index 88b93611..2624c7a5 100644 --- a/upload/admin/applications/core/modules_public/ajax/skingen.php +++ b/upload/admin/applications/core/modules_public/ajax/skingen.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Like Ajax
      * Last Updated: $LastChangedDate: 2011-05-05 12:03:47 +0100 (Thu, 05 May 2011) $
      * 
    diff --git a/upload/admin/applications/core/modules_public/ajax/tags.php b/upload/admin/applications/core/modules_public/ajax/tags.php index b27e0042..433828e2 100644 --- a/upload/admin/applications/core/modules_public/ajax/tags.php +++ b/upload/admin/applications/core/modules_public/ajax/tags.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Like Ajax
      * Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/modules_public/ajax/templates.php b/upload/admin/applications/core/modules_public/ajax/templates.php index 11bc142a..e6a6a067 100644 --- a/upload/admin/applications/core/modules_public/ajax/templates.php +++ b/upload/admin/applications/core/modules_public/ajax/templates.php @@ -7,7 +7,7 @@ * $Author: mmecham $ * @since Friday 19th May 2006 17:33 * $LastChangedDate: 2011-05-03 04:53:04 -0400 (Tue, 03 May 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 8588 $ */ diff --git a/upload/admin/applications/core/modules_public/ajax/usercp.php b/upload/admin/applications/core/modules_public/ajax/usercp.php index d52cbb2a..5e3a46d6 100644 --- a/upload/admin/applications/core/modules_public/ajax/usercp.php +++ b/upload/admin/applications/core/modules_public/ajax/usercp.php @@ -1,111 +1,111 @@ - - * Invision Power Services - * IP.Board v3.4.5 - * Login handler abstraction : AJAX UserCP functions - * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $ - *
    - * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/company/standards.php#license - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com - * @since Tuesday 1st March 2005 (11:52) - * @version $Revision: 10721 $ - * - */ - -if ( ! defined( 'IN_IPB' ) ) -{ - print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -class public_core_ajax_usercp extends ipsAjaxCommand -{ - /** - * Class entry point - * - * @param object Registry reference - * @return @e void [Outputs to screen] - */ - public function doExecute( ipsRegistry $registry ) - { - switch( $this->request['do'] ) - { - case 'displayNameCheck': - $this->displayNameCheck(); - break; - } - } - - /** - * Checks a display name - * - * @return @e void [Outputs JSON to browser AJAX call] - */ - protected function displayNameCheck() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $name = mb_strtolower( $this->convertAndMakeSafe( $this->request['name'], 0 ) ); - $name = str_replace("+", "+", $name ); - $member = array(); - $return = TRUE; - $id = intval( $this->request['member_id'] ); - - # Set member ID - $id = $this->memberData['member_id'] ? $this->memberData['member_id'] : $id; - - //----------------------------------------- - // Load member if required - //----------------------------------------- - - if ( $id != $this->memberData['member_id'] ) - { - $member = IPSMember::load( $id, 'all' ); - } - else - { - $member = $this->member->fetchMemberData(); - } - - //----------------------------------------- - // Test name - //----------------------------------------- - - try - { - $return = IPSMember::getFunction()->checkNameExists( $name, $member ); - } - catch( Exception $error ) - { - $_msg = $error->getMessage(); - - if ( $_msg == 'NO_MORE_CHANGES' ) - { - $this->returnString( 'nomorechanges' ); - return; - } - - # Really, we're not very interested why it didn't work at this point, so - # just return with a 'found' string which will make a nice red cross and - # force the user to choose another. - - $this->returnString('found'); - return; - } - - //----------------------------------------- - // So, what's it to be? - //----------------------------------------- - - $this->returnString( ( $return === TRUE ) ? 'found' : 'notfound' ); - } + + * Invision Power Services + * IP.Board v3.4.6 + * Login handler abstraction : AJAX UserCP functions + * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $ + * + * + * @author $Author: bfarber $ + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license http://www.invisionpower.com/company/standards.php#license + * @package IP.Board + * @subpackage Core + * @link http://www.invisionpower.com + * @since Tuesday 1st March 2005 (11:52) + * @version $Revision: 10721 $ + * + */ + +if ( ! defined( 'IN_IPB' ) ) +{ + print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +class public_core_ajax_usercp extends ipsAjaxCommand +{ + /** + * Class entry point + * + * @param object Registry reference + * @return @e void [Outputs to screen] + */ + public function doExecute( ipsRegistry $registry ) + { + switch( $this->request['do'] ) + { + case 'displayNameCheck': + $this->displayNameCheck(); + break; + } + } + + /** + * Checks a display name + * + * @return @e void [Outputs JSON to browser AJAX call] + */ + protected function displayNameCheck() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $name = strtolower( $this->convertAndMakeSafe( $this->request['name'], 0 ) ); + $name = str_replace("+", "+", $name ); + $member = array(); + $return = TRUE; + $id = intval( $this->request['member_id'] ); + + # Set member ID + $id = $this->memberData['member_id'] ? $this->memberData['member_id'] : $id; + + //----------------------------------------- + // Load member if required + //----------------------------------------- + + if ( $id != $this->memberData['member_id'] ) + { + $member = IPSMember::load( $id, 'all' ); + } + else + { + $member = $this->member->fetchMemberData(); + } + + //----------------------------------------- + // Test name + //----------------------------------------- + + try + { + $return = IPSMember::getFunction()->checkNameExists( $name, $member ); + } + catch( Exception $error ) + { + $_msg = $error->getMessage(); + + if ( $_msg == 'NO_MORE_CHANGES' ) + { + $this->returnString( 'nomorechanges' ); + return; + } + + # Really, we're not very interested why it didn't work at this point, so + # just return with a 'found' string which will make a nice red cross and + # force the user to choose another. + + $this->returnString('found'); + return; + } + + //----------------------------------------- + // So, what's it to be? + //----------------------------------------- + + $this->returnString( ( $return === TRUE ) ? 'found' : 'notfound' ); + } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/attach/attach.php b/upload/admin/applications/core/modules_public/attach/attach.php index b9b97c3a..b519c1c2 100644 --- a/upload/admin/applications/core/modules_public/attach/attach.php +++ b/upload/admin/applications/core/modules_public/attach/attach.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Attachment Poster
      * Last Updated: $Date: 2012-08-22 05:05:53 -0400 (Wed, 22 Aug 2012) $
      * 
    diff --git a/upload/admin/applications/core/modules_public/attach/defaultSection.php b/upload/admin/applications/core/modules_public/attach/defaultSection.php index 0c3b828d..29f3c8a6 100644 --- a/upload/admin/applications/core/modules_public/attach/defaultSection.php +++ b/upload/admin/applications/core/modules_public/attach/defaultSection.php @@ -7,7 +7,7 @@ * $Author: ips_terabyte $ * @since 20th February 2002 * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 8655 $ */ diff --git a/upload/admin/applications/core/modules_public/attach/index.html b/upload/admin/applications/core/modules_public/attach/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_public/attach/index.html +++ b/upload/admin/applications/core/modules_public/attach/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/global/captcha.php b/upload/admin/applications/core/modules_public/global/captcha.php index f0ae99a1..f573bb6d 100644 --- a/upload/admin/applications/core/modules_public/global/captcha.php +++ b/upload/admin/applications/core/modules_public/global/captcha.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Captcha
      * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/modules_public/global/comments.php b/upload/admin/applications/core/modules_public/global/comments.php index 7facec79..8654b30d 100644 --- a/upload/admin/applications/core/modules_public/global/comments.php +++ b/upload/admin/applications/core/modules_public/global/comments.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Image Ajax
      * Last Updated: $LastChangedDate: 2012-10-03 17:32:06 -0400 (Wed, 03 Oct 2012) $
      * 
    diff --git a/upload/admin/applications/core/modules_public/global/defaultSection.php b/upload/admin/applications/core/modules_public/global/defaultSection.php index 47e7c4c6..c53ea9bc 100644 --- a/upload/admin/applications/core/modules_public/global/defaultSection.php +++ b/upload/admin/applications/core/modules_public/global/defaultSection.php @@ -7,7 +7,7 @@ * $Author: ips_terabyte $ * @since 20th February 2002 * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 8655 $ */ diff --git a/upload/admin/applications/core/modules_public/global/index.html b/upload/admin/applications/core/modules_public/global/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_public/global/index.html +++ b/upload/admin/applications/core/modules_public/global/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/global/like.php b/upload/admin/applications/core/modules_public/global/like.php index 08740aee..2278e946 100644 --- a/upload/admin/applications/core/modules_public/global/like.php +++ b/upload/admin/applications/core/modules_public/global/like.php @@ -7,7 +7,7 @@ * $Author: AndyMillne $ * @since - * $LastChangedDate: 2013-02-06 16:33:34 -0500 (Wed, 06 Feb 2013) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 11947 $ */ diff --git a/upload/admin/applications/core/modules_public/global/login.php b/upload/admin/applications/core/modules_public/global/login.php index 420ba5e2..94e73dbb 100644 --- a/upload/admin/applications/core/modules_public/global/login.php +++ b/upload/admin/applications/core/modules_public/global/login.php @@ -1,558 +1,555 @@ - - * Invision Power Services - * IP.Board v3.4.5 - * Login handler abstraction - * Last Updated: $Date: 2013-05-23 12:11:14 -0400 (Thu, 23 May 2013) $ - * - * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/company/standards.php#license - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com - * @since Tuesday 1st March 2005 (11:52) - * @version $Revision: 12268 $ - * - */ - -if ( ! defined( 'IN_IPB' ) ) -{ - print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -class public_core_global_login extends ipsCommand -{ - /** - * Login handler object - * - * @var object - */ - protected $han_login; - - /** - * Facebook connect class - * - * @var object - */ - protected $_facebook; - - /** - * Initiate login handler - * - * @return @e void - */ - public function initHanLogin() - { - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' ); - $this->han_login = new $classToLoad( $this->registry ); - $this->han_login->init(); - } - - /** - * Class entry point - * - * @param object Registry reference - * @return @e void [Outputs to screen/redirects] - */ - public function doExecute( ipsRegistry $registry ) - { - /* Make object */ - $this->registry = $registry; - $this->DB = $this->registry->DB(); - $this->settings =& $this->registry->fetchSettings(); - $this->request =& $this->registry->fetchRequest(); - $this->lang = $this->registry->getClass('class_localization'); - $this->member = $this->registry->member(); - $this->memberData =& $this->registry->member()->fetchMemberData(); - $this->cache = $this->registry->cache(); - $this->caches =& $this->registry->cache()->fetchCaches(); - - $this->registry->getClass( 'class_localization' )->loadLanguageFile( array( 'public_login' ), 'core' ); - - //----------------------------------------- - // Load handler... - //----------------------------------------- - - $this->initHanLogin(); - - //----------------------------------------- - // Are we enforcing log ins? - //----------------------------------------- - - $msg = ""; - - if ( !$this->request['do'] == 'showForm' AND $this->settings['force_login'] == 1 ) - { - $msg = 'admin_force_log_in'; - } - - //----------------------------------------- - // Meta tags - //----------------------------------------- - - $this->registry->output->addMetaTag( 'robots', 'noindex' ); - - //----------------------------------------- - // What to do? - //----------------------------------------- - - switch( $this->request['do'] ) - { - case 'process': - $return = $this->doLogin(); - - if( $return[2] ) - { - //$this->registry->getClass('output')->showError( $return[2], 1014 ); - $this->loginForm( $return[2], $return[3] ); - } - else - { - $this->registry->getClass('output')->redirectScreen( $return[0], $return[1] ); - } - break; - - case 'logout': - $return = $this->doLogout(); - - /* URL */ - $return[2] = $return[2] ? $return[2] : ''; - - if( $return[0] == 'immediate' ) - { - $this->registry->getClass('output')->silentRedirect( $return[2] ); - } - else - { - $this->registry->getClass('output')->redirectScreen( $return[1], $return[2] ); - } - break; - - case 'deleteCookies': - $return = $this->deleteCookies(); - $this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] ); - break; - - case 'autologin': - $return = $this->autoLogin(); - break; - - case 'showForm': - default: - $return = $this->loginForm($msg); - break; - } - - //----------------------------------------- - // If we have any HTML to print, do so... - //----------------------------------------- - - $this->registry->getClass('output')->addContent( $this->output ); - $this->registry->getClass('output')->sendOutput(); - } - - /** - * Attempt to automatically log a user in - * - * @return array [0=Words to display,1=URL to send to] - */ - public function autoLogin() - { - /* Verify the login */ - $this->han_login->verifyLogin(); - - /* Lang Bits */ - $true_words = $this->lang->words['logged_in']; - $false_words = $this->lang->words['not_logged_in']; - $method = 'no_show'; - - /* Register Redirect */ - if ($this->request['fromreg'] == 1) - { - $true_words = $this->lang->words['reg_log_in']; - $false_words = $this->lang->words['reg_not_log_in']; - $method = 'show'; - } - /* Email Redirect */ - else if ($this->request['fromemail'] == 1) - { - $true_words = $this->lang->words['email_log_in']; - $false_words = $this->lang->words['email_not_log_in']; - $method = 'show'; - } - /* Password Redirect */ - else if ($this->request['frompass'] == 1) - { - $true_words = $this->lang->words['pass_log_in']; - $false_words = $this->lang->words['pass_not_log_in']; - $method = 'show'; - } - - if( $this->memberData['member_id'] ) - { - /* Member Sync */ - IPSLib::runMemberSync( 'onLogin', $this->memberData ); - - if ( ! $this->request['fromreg'] ) - { - IPSCookie::set('session_id', '0', -1 ); - } - - if( $method == 'show' ) - { - $this->registry->getClass('output')->redirectScreen( $true_words, $this->settings['base_url'] ); - } - else - { - $this->registry->getClass('output')->silentRedirect( $this->settings['board_url'] . '/index.php' ); - } - } - else - { - if( $method == 'show' ) - { - $this->registry->getClass('output')->redirectScreen( $false_words, $this->settings['base_url'] . 'app=core&module=global§ion=login' ); - } - else - { - $this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] . 'app=core&module=global§ion=login' ); - } - } - } - - /** - * Delete a user's cookies - * - * @param boolean Check the key - * @return mixed Output error page if key checking fails, else boolean true - */ - public function deleteCookies( $check_key=true ) - { - //----------------------------------------- - // Check the md5 key - //----------------------------------------- - - if( $check_key ) - { - $key = $this->request['k']; - - if ( $key != $this->member->form_hash ) - { - $this->registry->getClass('output')->showError( 'bad_delete_cookies_key', 2010 ); - } - } - - //----------------------------------------- - // Wipe out any forum password cookies - //----------------------------------------- - - if ( is_array($_COOKIE) ) - { - foreach( $_COOKIE as $cookie => $value ) - { - if ( stripos( $cookie, $this->settings['cookie_id']."ipbforum" ) !== false ) - { - IPSCookie::set( str_replace( $this->settings['cookie_id'], "", $cookie ), '-', -1 ); - } - - if ( stripos( $cookie, $this->settings['cookie_id']."itemMarking_" ) !== false ) - { - IPSCookie::set( str_replace( $this->settings['cookie_id'], "", $cookie ), '-', -1 ); - } - } - } - - //----------------------------------------- - // And the rest of the cookies - //----------------------------------------- - - IPSCookie::set('pass_hash' , '-1'); - IPSCookie::set('member_id' , '-1'); - IPSCookie::set('session_id', '-1'); - - return true; - } - - /** - * Show the login form - * - * @param string Message to show on login form - * @return string Login form HTML - */ - public function loginForm( $message="", $replacement='' ) - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $extra_form = ""; - $show_form = 1; - $template = ''; - $serviceClick = trim( $this->request['serviceClick'] ); - - //----------------------------------------- - // Are they banned? - //----------------------------------------- - - if ( IPSMember::isBanned( 'ip', $this->member->ip_address ) ) - { - $this->registry->getClass('output')->showError( 'you_are_banned', 2011, null, null, 403 ); - } - - if ( $message != "" ) - { - if( $replacement ) - { - $message = sprintf( $this->lang->words[ $message ], $replacement ); - } - else - { - $message = $this->lang->words[ $message ]; - } - $name = $this->request['UserName'] ? $this->request['UserName'] : $this->request['address']; - $message = str_replace( "<#NAME#>", "" . $name . "", $message ); - - $template .= $this->registry->getClass('output')->getTemplate('login')->errors($message); - } - - //----------------------------------------- - // Using an alternate log in form? - //----------------------------------------- - - $this->han_login->checkLoginUrlRedirect(); - - /* Did we click a service? */ - if ( $serviceClick ) - { - switch ($serviceClick) - { - case 'facebook': - $this->registry->getClass('output')->silentRedirect( $this->settings['_original_base_url'] . "/interface/facebook/index.php?_reg=1" ); - break; - case 'twitter': - $this->registry->getClass('output')->silentRedirect( $this->settings['_original_base_url'] . "/interface/twitter/index.php?_reg=1" ); - break; - case 'vkontakte': - $this->registry->getClass('output')->silentRedirect( $this->settings['_original_base_url'] . "/interface/vkontakte/index.php?reg=1" ); - break; - } - } - - //----------------------------------------- - // Extra HTML? - //----------------------------------------- - - $additionalForm = $this->han_login->additionalFormHTML(); - - if ( count($additionalForm[1]) ) - { - if ( $additionalForm[0] == 'add' ) - { - $extra_form = $additionalForm[1]; - $show_form = 1; - } - else - { - if( is_array($additionalForm[1]) ) - { - foreach( $additionalForm[1] as $_form ) - { - $template .= $_form; - } - } - else - { - $template .= $additionalForm[1]; - } - $show_form = 0; - } - } - - //----------------------------------------- - // Continue... - //----------------------------------------- - - if ( $show_form ) - { - if( $this->request['referer'] ) - { - $http_referrer = $this->request['referer']; - } - else - { - /* @link http://community.invisionpower.com/tracker/issue-32302-login-redirect-when-activating */ - $_urlPieces = @parse_url($this->settings['board_url']); - - if( strpos( my_getenv('HTTP_REFERER'), $_urlPieces['host'] ? $_urlPieces['host'] : $this->settings['board_url'] ) !== false ) - { - $http_referrer = my_getenv('HTTP_REFERER'); - } - else - { - $http_referrer = ''; - } - } - - $login_methods = false; - $uses_name = false; - $uses_email = false; - - foreach( $this->cache->getCache('login_methods') as $method ) - { - $login_methods[ $method['login_folder_name'] ] = $method['login_folder_name']; - - if( $method['login_user_id'] == 'username' or $method['login_user_id'] == 'either' ) - { - $uses_name = true; - } - - if( $method['login_user_id'] == 'email' or $method['login_user_id'] == 'either' ) - { - $uses_email = true; - } - } - - if( $uses_name AND $uses_email ) - { - $this->lang->words['enter_name'] = $this->lang->words['enter_name_and_email']; - } - else if( $uses_email ) - { - $this->lang->words['enter_name'] = $this->lang->words['enter_useremail']; - } - else - { - $this->lang->words['enter_name'] = $this->lang->words['enter_username']; - } - - $template .= $this->registry->getClass('output')->getTemplate('login')->showLogInForm( $this->lang->words['please_log_in'], htmlentities(urldecode($http_referrer)), $extra_form, $login_methods ); - } - - - $this->registry->getClass('output')->addNavigation( $this->lang->words['log_in'], '' ); - $this->registry->getClass('output')->setTitle( $this->lang->words['log_in'] . ' - ' . ipsRegistry::$settings['board_name'] ); - $this->registry->getClass('output')->addContent( $template ); - $this->registry->getClass('output')->sendOutput(); - } - - /** - * Verify login form submission and log user in - * - * @return mixed array [0=Words to show, 1=URL to send to, 2=error array] - */ - public function doLogin() - { - if( !defined('IGNORE_AUTH_KEY') OR !IGNORE_AUTH_KEY ) - { - if ( $this->request['auth_key'] != $this->member->form_hash ) - { - $this->registry->getClass('output')->showError( 'login_no_authkey', 10193, null, null, 403 ); - } - } - - return $this->han_login->verifyLogin(); - } - - /** - * Log a user out - * - * @param integer Flag to check md5 key - * @return mixed Error message or array [0=immediate|redirect, 1=words to show, 2=URL to send to] - */ - public function doLogout( $check_key=true ) - { - //----------------------------------------- - // INIT - //----------------------------------------- - - if ( $check_key ) - { - $key = $this->request['k']; - - # Check for funny business - if ( $key != $this->member->form_hash ) - { - $this->registry->getClass('output')->showError( 'bad_logout_key', 2012 ); - } - } - - //----------------------------------------- - // Set some cookies - //----------------------------------------- - - IPSCookie::set( "member_id" , "0", 1, 0, FALSE, TRUE ); - IPSCookie::set( "pass_hash" , "0", 1, 0, FALSE, TRUE ); - - if( IPSCookie::get( "ipsconnect_" . md5( $this->settings['board_url'] . '/interface/ipsconnect/ipsconnect.php' ) ) ) - { - IPSCookie::set( "ipsconnect_" . md5( $this->settings['board_url'] . '/interface/ipsconnect/ipsconnect.php' ), '0', 1, 0, FALSE, FALSE ); - } - - //----------------------------------------- - // IPS Connect - //----------------------------------------- - - foreach ( $this->caches['login_methods'] as $k => $data ) - { - if ( $data['login_folder_name'] == 'ipsconnect' and $data['login_enabled'] ) - { - $ipsConnectSettings = unserialize( $data['login_custom_config'] ); - - IPSCookie::set( "ipsconnect_" . md5( $ipsConnectSettings['master_url'] ), '0', 1, 0, FALSE, FALSE ); - } - } - - - if( is_array( $_COOKIE ) ) - { - foreach( $_COOKIE as $cookie => $value) - { - if ( stripos( $cookie, $this->settings['cookie_id'] . 'ipbforumpass' ) !== false AND ! strstr( $value, 'mobileApp' ) ) - { - IPSCookie::set( str_replace( $this->settings['cookie_id'], "", $cookie ), '-', -1 ); - } - } - } - - //----------------------------------------- - // Do it.. - //----------------------------------------- - - $this->member->sessionClass()->convertMemberToGuest(); - - $privacy = intval( IPSMember::isLoggedInAnon($this->memberData) ); - - IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'login_anonymous' => "{$privacy}&0", 'last_activity' => IPS_UNIX_TIME_NOW ) ) ); - - //----------------------------------------- - // Logout callbacks... - //----------------------------------------- - - IPSLib::runMemberSync( 'onLogOut', $this->memberData ); - - $this->han_login->logoutCallback( $this->memberData ); - - //----------------------------------------- - // Return.. - //----------------------------------------- - - $url = ""; - - if ( $this->request['return'] AND $this->request['return'] != "" ) - { - $return = urldecode($this->request['return']); - - if ( strpos( $return, "http://" ) === 0 ) - { - return array( 'immediate', '', $return ); - } - } - - return array( 'redirect', $this->lang->words['thanks_for_logout'], $this->settings['board_url'] ); - } + + * Invision Power Services + * IP.Board v3.4.6 + * Login handler abstraction + * Last Updated: $Date: 2013-09-26 22:37:28 -0400 (Thu, 26 Sep 2013) $ + * + * + * @author $Author: rashbrook $ + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license http://www.invisionpower.com/company/standards.php#license + * @package IP.Board + * @subpackage Core + * @link http://www.invisionpower.com + * @since Tuesday 1st March 2005 (11:52) + * @version $Revision: 12370 $ + * + */ + +if ( ! defined( 'IN_IPB' ) ) +{ + print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +class public_core_global_login extends ipsCommand +{ + /** + * Login handler object + * + * @var object + */ + protected $han_login; + + /** + * Facebook connect class + * + * @var object + */ + protected $_facebook; + + /** + * Initiate login handler + * + * @return @e void + */ + public function initHanLogin() + { + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' ); + $this->han_login = new $classToLoad( $this->registry ); + $this->han_login->init(); + } + + /** + * Class entry point + * + * @param object Registry reference + * @return @e void [Outputs to screen/redirects] + */ + public function doExecute( ipsRegistry $registry ) + { + /* Make object */ + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->lang = $this->registry->getClass('class_localization'); + $this->member = $this->registry->member(); + $this->memberData =& $this->registry->member()->fetchMemberData(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + + $this->registry->getClass( 'class_localization' )->loadLanguageFile( array( 'public_login' ), 'core' ); + + //----------------------------------------- + // Load handler... + //----------------------------------------- + + $this->initHanLogin(); + + //----------------------------------------- + // Are we enforcing log ins? + //----------------------------------------- + + $msg = ""; + + if ( !$this->request['do'] == 'showForm' AND $this->settings['force_login'] == 1 ) + { + $msg = 'admin_force_log_in'; + } + + //----------------------------------------- + // Meta tags + //----------------------------------------- + + $this->registry->output->addMetaTag( 'robots', 'noindex' ); + + //----------------------------------------- + // What to do? + //----------------------------------------- + + switch( $this->request['do'] ) + { + case 'process': + $return = $this->doLogin(); + + if( $return[2] ) + { + //$this->registry->getClass('output')->showError( $return[2], 1014 ); + $this->loginForm( $return[2], $return[3] ); + } + else + { + $this->registry->getClass('output')->redirectScreen( $return[0], $return[1] ); + } + break; + + case 'logout': + $return = $this->doLogout(); + + /* URL */ + $return[2] = $return[2] ? $return[2] : ''; + + if( $return[0] == 'immediate' ) + { + $this->registry->getClass('output')->silentRedirect( $return[2] ); + } + else + { + $this->registry->getClass('output')->redirectScreen( $return[1], $return[2] ); + } + break; + + case 'deleteCookies': + $return = $this->deleteCookies(); + $this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] ); + break; + + case 'autologin': + $return = $this->autoLogin(); + break; + + case 'showForm': + default: + $return = $this->loginForm($msg); + break; + } + + //----------------------------------------- + // If we have any HTML to print, do so... + //----------------------------------------- + + $this->registry->getClass('output')->addContent( $this->output ); + $this->registry->getClass('output')->sendOutput(); + } + + /** + * Attempt to automatically log a user in + * + * @return array [0=Words to display,1=URL to send to] + */ + public function autoLogin() + { + /* Verify the login */ + $this->han_login->verifyLogin(); + + /* Lang Bits */ + $true_words = $this->lang->words['logged_in']; + $false_words = $this->lang->words['not_logged_in']; + $method = 'no_show'; + + /* Register Redirect */ + if ($this->request['fromreg'] == 1) + { + $true_words = $this->lang->words['reg_log_in']; + $false_words = $this->lang->words['reg_not_log_in']; + $method = 'show'; + } + /* Email Redirect */ + else if ($this->request['fromemail'] == 1) + { + $true_words = $this->lang->words['email_log_in']; + $false_words = $this->lang->words['email_not_log_in']; + $method = 'show'; + } + /* Password Redirect */ + else if ($this->request['frompass'] == 1) + { + $true_words = $this->lang->words['pass_log_in']; + $false_words = $this->lang->words['pass_not_log_in']; + $method = 'show'; + } + + if( $this->memberData['member_id'] ) + { + /* Member Sync */ + IPSLib::runMemberSync( 'onLogin', $this->memberData ); + + if ( ! $this->request['fromreg'] ) + { + IPSCookie::set('session_id', '0', -1 ); + } + + if( $method == 'show' ) + { + $this->registry->getClass('output')->redirectScreen( $true_words, $this->settings['base_url'] ); + } + else + { + $this->registry->getClass('output')->silentRedirect( $this->settings['board_url'] . '/index.php' ); + } + } + else + { + if( $method == 'show' ) + { + $this->registry->getClass('output')->redirectScreen( $false_words, $this->settings['base_url'] . 'app=core&module=global§ion=login' ); + } + else + { + $this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] . 'app=core&module=global§ion=login' ); + } + } + } + + /** + * Delete a user's cookies + * + * @param boolean Check the key + * @return mixed Output error page if key checking fails, else boolean true + */ + public function deleteCookies( $check_key=true ) + { + //----------------------------------------- + // Check the md5 key + //----------------------------------------- + + if( $check_key ) + { + $key = $this->request['k']; + + if ( $key != $this->member->form_hash ) + { + $this->registry->getClass('output')->showError( 'bad_delete_cookies_key', 2010 ); + } + } + + //----------------------------------------- + // Wipe out any forum password cookies + //----------------------------------------- + + if ( is_array($_COOKIE) ) + { + foreach( $_COOKIE as $cookie => $value ) + { + if ( stripos( $cookie, $this->settings['cookie_id']."ipbforum" ) !== false ) + { + IPSCookie::set( str_replace( $this->settings['cookie_id'], "", $cookie ), '-', -1 ); + } + + if ( stripos( $cookie, $this->settings['cookie_id']."itemMarking_" ) !== false ) + { + IPSCookie::set( str_replace( $this->settings['cookie_id'], "", $cookie ), '-', -1 ); + } + } + } + + //----------------------------------------- + // And the rest of the cookies + //----------------------------------------- + + IPSCookie::set('pass_hash' , '-1'); + IPSCookie::set('member_id' , '-1'); + IPSCookie::set('session_id', '-1'); + + return true; + } + + /** + * Show the login form + * + * @param string Message to show on login form + * @return string Login form HTML + */ + public function loginForm( $message="", $replacement='' ) + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $extra_form = ""; + $show_form = 1; + $template = ''; + $serviceClick = trim( $this->request['serviceClick'] ); + + //----------------------------------------- + // Are they banned? + //----------------------------------------- + + if ( IPSMember::isBanned( 'ip', $this->member->ip_address ) ) + { + $this->registry->getClass('output')->showError( 'you_are_banned', 2011, null, null, 403 ); + } + + if ( $message != "" ) + { + if( $replacement ) + { + $message = sprintf( $this->lang->words[ $message ], $replacement ); + } + else + { + $message = $this->lang->words[ $message ]; + } + $name = $this->request['UserName'] ? $this->request['UserName'] : $this->request['address']; + $message = str_replace( "<#NAME#>", "" . $name . "", $message ); + + $template .= $this->registry->getClass('output')->getTemplate('login')->errors($message); + } + + //----------------------------------------- + // Using an alternate log in form? + //----------------------------------------- + + $this->han_login->checkLoginUrlRedirect(); + + /* Did we click a service? */ + if ( $serviceClick ) + { + switch ($serviceClick) + { + case 'facebook': + $this->registry->getClass('output')->silentRedirect( $this->settings['_original_base_url'] . "/interface/facebook/index.php?_reg=1" ); + break; + case 'twitter': + $this->registry->getClass('output')->silentRedirect( $this->settings['_original_base_url'] . "/interface/twitter/index.php?_reg=1" ); + break; + } + } + + //----------------------------------------- + // Extra HTML? + //----------------------------------------- + + $additionalForm = $this->han_login->additionalFormHTML(); + + if ( count($additionalForm[1]) ) + { + if ( $additionalForm[0] == 'add' ) + { + $extra_form = $additionalForm[1]; + $show_form = 1; + } + else + { + if( is_array($additionalForm[1]) ) + { + foreach( $additionalForm[1] as $_form ) + { + $template .= $_form; + } + } + else + { + $template .= $additionalForm[1]; + } + $show_form = 0; + } + } + + //----------------------------------------- + // Continue... + //----------------------------------------- + + if ( $show_form ) + { + if( $this->request['referer'] ) + { + $http_referrer = $this->request['referer']; + } + else + { + /* @link http://community.invisionpower.com/tracker/issue-32302-login-redirect-when-activating */ + $_urlPieces = @parse_url($this->settings['board_url']); + + if( strpos( my_getenv('HTTP_REFERER'), $_urlPieces['host'] ? $_urlPieces['host'] : $this->settings['board_url'] ) !== false ) + { + $http_referrer = my_getenv('HTTP_REFERER'); + } + else + { + $http_referrer = ''; + } + } + + $login_methods = false; + $uses_name = false; + $uses_email = false; + + foreach( $this->cache->getCache('login_methods') as $method ) + { + $login_methods[ $method['login_folder_name'] ] = $method['login_folder_name']; + + if( $method['login_user_id'] == 'username' or $method['login_user_id'] == 'either' ) + { + $uses_name = true; + } + + if( $method['login_user_id'] == 'email' or $method['login_user_id'] == 'either' ) + { + $uses_email = true; + } + } + + if( $uses_name AND $uses_email ) + { + $this->lang->words['enter_name'] = $this->lang->words['enter_name_and_email']; + } + else if( $uses_email ) + { + $this->lang->words['enter_name'] = $this->lang->words['enter_useremail']; + } + else + { + $this->lang->words['enter_name'] = $this->lang->words['enter_username']; + } + + $template .= $this->registry->getClass('output')->getTemplate('login')->showLogInForm( $this->lang->words['please_log_in'], htmlentities(urldecode($http_referrer)), $extra_form, $login_methods ); + } + + + $this->registry->getClass('output')->addNavigation( $this->lang->words['log_in'], '' ); + $this->registry->getClass('output')->setTitle( $this->lang->words['log_in'] . ' - ' . ipsRegistry::$settings['board_name'] ); + $this->registry->getClass('output')->addContent( $template ); + $this->registry->getClass('output')->sendOutput(); + } + + /** + * Verify login form submission and log user in + * + * @return mixed array [0=Words to show, 1=URL to send to, 2=error array] + */ + public function doLogin() + { + if( !defined('IGNORE_AUTH_KEY') OR !IGNORE_AUTH_KEY ) + { + if ( $this->request['auth_key'] != $this->member->form_hash ) + { + $this->registry->getClass('output')->showError( 'login_no_authkey', 10193, null, null, 403 ); + } + } + + return $this->han_login->verifyLogin(); + } + + /** + * Log a user out + * + * @param integer Flag to check md5 key + * @return mixed Error message or array [0=immediate|redirect, 1=words to show, 2=URL to send to] + */ + public function doLogout( $check_key=true ) + { + //----------------------------------------- + // INIT + //----------------------------------------- + + if ( $check_key ) + { + $key = $this->request['k']; + + # Check for funny business + if ( $key != $this->member->form_hash ) + { + $this->registry->getClass('output')->showError( 'bad_logout_key', 2012 ); + } + } + + //----------------------------------------- + // Set some cookies + //----------------------------------------- + + IPSCookie::set( "member_id" , "0", 1, 0, FALSE, TRUE ); + IPSCookie::set( "pass_hash" , "0", 1, 0, FALSE, TRUE ); + + if( IPSCookie::get( "ipsconnect_" . md5( $this->settings['board_url'] . '/interface/ipsconnect/ipsconnect.php' ), FALSE ) ) + { + IPSCookie::set( "ipsconnect_" . md5( $this->settings['board_url'] . '/interface/ipsconnect/ipsconnect.php' ), '0', 1, 0, FALSE, FALSE ); + } + + //----------------------------------------- + // IPS Connect + //----------------------------------------- + + foreach ( $this->caches['login_methods'] as $k => $data ) + { + if ( $data['login_folder_name'] == 'ipsconnect' and $data['login_enabled'] ) + { + $ipsConnectSettings = unserialize( $data['login_custom_config'] ); + + IPSCookie::set( "ipsconnect_" . md5( $ipsConnectSettings['master_url'] ), '0', 1, 0, FALSE, FALSE ); + } + } + + + if( is_array( $_COOKIE ) ) + { + foreach( $_COOKIE as $cookie => $value) + { + if ( stripos( $cookie, $this->settings['cookie_id'] . 'ipbforumpass' ) !== false AND ! strstr( $value, 'mobileApp' ) ) + { + IPSCookie::set( str_replace( $this->settings['cookie_id'], "", $cookie ), '-', -1 ); + } + } + } + + //----------------------------------------- + // Do it.. + //----------------------------------------- + + $this->member->sessionClass()->convertMemberToGuest(); + + $privacy = intval( IPSMember::isLoggedInAnon($this->memberData) ); + + IPSMember::save( $this->memberData['member_id'], array( 'core' => array( 'login_anonymous' => "{$privacy}&0", 'last_activity' => IPS_UNIX_TIME_NOW ) ) ); + + //----------------------------------------- + // Logout callbacks... + //----------------------------------------- + + IPSLib::runMemberSync( 'onLogOut', $this->memberData ); + + $this->han_login->logoutCallback( $this->memberData ); + + //----------------------------------------- + // Return.. + //----------------------------------------- + + $url = ""; + + if ( $this->request['return'] AND $this->request['return'] != "" ) + { + $return = urldecode($this->request['return']); + + if ( strpos( $return, "http://" ) === 0 ) + { + return array( 'immediate', '', $return ); + } + } + + return array( 'redirect', $this->lang->words['thanks_for_logout'], $this->settings['board_url'] ); + } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/global/lostpass.php b/upload/admin/applications/core/modules_public/global/lostpass.php index 478dea0b..af43da69 100644 --- a/upload/admin/applications/core/modules_public/global/lostpass.php +++ b/upload/admin/applications/core/modules_public/global/lostpass.php @@ -1,484 +1,484 @@ - - * Invision Power Services - * IP.Board v3.4.5 - * Recover Lost Password - * Last Updated: $Date: 2012-11-28 04:54:58 -0500 (Wed, 28 Nov 2012) $ - * - * - * @author $Author $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/company/standards.php#license - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com - * @since 20th February 2002 - * @version $Rev: 11651 $ - * - */ - -if ( ! defined( 'IN_IPB' ) ) -{ - print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -class public_core_global_lostpass extends ipsCommand -{ - /** - * Class entry point - * - * @param object Registry reference - * @return @e void [Outputs to screen/redirects] - */ - public function doExecute( ipsRegistry $registry ) - { - /* Load language */ - $this->registry->class_localization->loadLanguageFile( array( 'public_register' ), 'core' ); - - //----------------------------------------- - // Meta tags - //----------------------------------------- - - $this->registry->output->addMetaTag( 'robots', 'noindex' ); - - /* What to do */ - switch( $this->request['do'] ) - { - case 'sendform': - $this->lostPasswordValidateForm(); - break; - - case '11': - $this->lostPasswordEnd(); - break; - - case '03': - $this->lostPasswordValidate(); - break; - - default: - case '10': - $this->lostPasswordForm(); - break; - } - - /* Output */ - $this->registry->output->addContent( $this->output ); - $this->registry->output->sendOutput(); - } - - /** - * Validates a lost password request - * - * @return @e void - */ - public function lostPasswordValidate() - { - /* Check for input and it's in a valid format. */ - $in_user_id = intval( trim( urldecode( $this->request['uid'] ) ) ); - $in_validate_key = IPSText::md5Clean( trim( urldecode( $this->request['aid'] ) ) ); - - /* Check Input */ - if( ! $in_validate_key ) - { - $this->registry->output->showError( 'validation_key_incorrect', 1015 ); - } - - if( ! preg_match( '/^(?:\d){1,}$/', $in_user_id ) ) - { - $this->registry->output->showError( 'uid_key_incorrect', 1016 ); - } - - /* Attempt to get the profile of the requesting user */ - $member = IPSMember::load( $in_user_id ); - - if( ! $member['member_id'] ) - { - $this->registry->output->showError( 'lostpass_no_member', 1017 ); - } - - /* Get validating info.. */ - $validate = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'validating', 'where' => 'member_id=' . $in_user_id . ' and lost_pass=1' ) ); - - if( ! $validate['member_id'] ) - { - $this->registry->output->showError( 'lostpass_not_validating', 1018 ); - } - - if( ( $validate['new_reg'] == 1 ) && ( $this->settings['reg_auth_type'] == "admin" ) ) - { - $this->registry->output->showError( 'lostpass_new_reg', 4010, true ); - } - - if( $validate['vid'] != $in_validate_key ) - { - $this->registry->output->showError( 'lostpass_key_wrong', 1019 ); - } - else - { - /* On the same page? */ - if( $validate['lost_pass'] != 1 ) - { - $this->registry->output->showError( 'lostpass_not_lostpass', 4011, true ); - } - - /* Send a new random password? */ - if( $this->settings['lp_method'] == 'random' ) - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $save_array = array(); - - //----------------------------------------- - // Generate a new random password - //----------------------------------------- - - $new_pass = IPSMember::makePassword(); - - //----------------------------------------- - // Generate a new salt - //----------------------------------------- - - $salt = IPSMember::generatePasswordSalt(5); - $salt = str_replace( '\\', "\\\\", $salt ); - - //----------------------------------------- - // New log in key - //----------------------------------------- - - $key = IPSMember::generateAutoLoginKey(); - - //----------------------------------------- - // Update... - //----------------------------------------- - - $save_array['members_pass_salt'] = $salt; - $save_array['members_pass_hash'] = md5( md5($salt) . md5( $new_pass ) ); - $save_array['member_login_key'] = $key; - $save_array['member_login_key_expire'] = $this->settings['login_key_expire'] * 60 * 60 * 24; - $save_array['failed_logins'] = null; - $save_array['failed_login_count'] = 0; - - //----------------------------------------- - // Load handler... - //----------------------------------------- - - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' ); - $this->han_login = new $classToLoad( $this->registry ); - $this->han_login->init(); - $this->han_login->changePass( $member['email'], md5( $new_pass ), $new_pass, $member ); - - //if ( $this->han_login->return_code != 'METHOD_NOT_DEFINED' AND $this->han_login->return_code != 'SUCCESS' ) - //{ - // $this->registry->output->showError( $this->lang->words['lostpass_external_fail'], 2013 ); - //} - - IPSMember::save( $member['member_id'], array( 'members' => $save_array ) ); - - /* Password has been changed! */ - IPSLib::runMemberSync( 'onPassChange', $member['member_id'], $new_pass ); - - //----------------------------------------- - // Send out the email... - //----------------------------------------- - - $message = array( 'NAME' => $member['members_display_name'], - 'THE_LINK' => $this->registry->getClass('output')->buildSEOUrl( 'app=core&module=usercp&tab=core&area=email', 'publicNoSession', 'flase' ), - 'PASSWORD' => $new_pass, - 'LOGIN' => $this->registry->getClass('output')->buildSEOUrl( 'app=core&module=global§ion=login', 'publicNoSession', 'false' ), - 'USERNAME' => $member['name'], - 'EMAIL' => $member['email'], - 'ID' => $member['member_id'] ); - - IPSText::getTextClass('email')->setPlainTextTemplate( IPSText::getTextClass('email')->getTemplate( "lost_pass_email_pass", $member['language'] ) ); - IPSText::getTextClass('email')->buildPlainTextContent( $message ); - IPSText::getTextClass('email')->buildHtmlContent( $message ); - - IPSText::getTextClass('email')->subject = $this->lang->words['lp_random_pass_subject'] . ' ' . $this->settings['board_name']; - IPSText::getTextClass('email')->to = $member['email']; - - IPSText::getTextClass('email')->sendMail(); - - $this->registry->output->setTitle( $this->lang->words['activation_form'] . ' - ' . ipsRegistry::$settings['board_name'] ); - $this->output = $this->registry->getClass('output')->getTemplate('register')->showLostPassWaitRandom( $member ); - } - else - { - if( $_POST['pass1'] == "" ) - { - $this->registry->output->showError( 'pass_blank', 10184 ); - } - - if( $_POST['pass2'] == "" ) - { - $this->registry->output->showError( 'pass_blank', 10185 ); - } - - $pass_a = trim( $this->request['pass1'] ); - $pass_b = trim( $this->request['pass2'] ); - - /* - There's no reason for this - http://community.invisionpower.com/resources/bugs.html/_/ip-board/registrations-limit-passwords-to-32-characters-for-no-apparent-reason-r37770 - if( strlen( $pass_a ) < 3 ) - { - $this->registry->output->showError( 'pass_too_short', 10186 ); - } - */ - - if( $pass_a != $pass_b ) - { - $this->registry->output->showError( 'pass_no_match', 10187 ); - } - - $new_pass = md5( $pass_a ); - - /* Update Member Array */ - $save_array = array(); - - /* Generate a new salt */ - $salt = IPSMember::generatePasswordSalt(5); - $salt = str_replace( '\\', "\\\\", $salt ); - - /* New log in key */ - $key = IPSMember::generateAutoLoginKey(); - - /* Update Array */ - $save_array['members_pass_salt'] = $salt; - $save_array['members_pass_hash'] = md5( md5($salt) . $new_pass ); - $save_array['member_login_key'] = $key; - $save_array['member_login_key_expire'] = $this->settings['login_key_expire'] * 60 * 60 * 24; - $save_array['failed_logins'] = null; - $save_array['failed_login_count'] = 0; - - /* Change the password */ - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' ); - $this->han_login = new $classToLoad( $this->registry ); - $this->han_login->init(); - $this->han_login->changePass( $member['email'], $new_pass, $pass_a, $member ); - - //----------------------------------------- - // We'll ignore any remote errors - //----------------------------------------- - - /*if( $this->han_login->return_code != 'METHOD_NOT_DEFINED' AND $this->han_login->return_code != 'SUCCESS' ) - { - // Pass not changed remotely - }*/ - - /* Update the member */ - IPSMember::save( $member['member_id'], array( 'members' => $save_array ) ); - - /* Password has been changed! */ - IPSLib::runMemberSync( 'onPassChange', $member['member_id'], $pass_a ); - - /* Remove "dead" validation */ - $this->DB->delete( 'validating', "vid='{$validate['vid']}' OR (member_id={$member['member_id']} AND lost_pass=1)" ); - - $this->registry->output->silentRedirect( $this->registry->getClass('output')->buildSEOUrl( 'app=core&module=global§ion=login&do=autologin&frompass=1' ) ); - } - } - } - - /** - * Completes the lost password request form - * - * @return @e void - */ - public function lostPasswordEnd() - { - if( $this->settings['bot_antispam_type'] != 'none' ) - { - if( !$this->registry->getClass('class_captcha')->validate( $this->request['regid'], $this->request['reg_code'] ) ) - { - $this->lostPasswordForm( 'err_reg_code' ); - return; - } - } - - /* Back to the usual programming! :o */ - if( $this->request['member_name'] == "" AND $this->request['email_addy'] == "" ) - { - $this->registry->output->showError( 'lostpass_name_email', 10110 ); - } - - /* Check for input and it's in a valid format. */ - $member_name = trim( mb_strtolower( $this->request['member_name'] ) ); - $email_addy = trim( strtolower( $this->request['email_addy'] ) ); - - if( $member_name == "" AND $email_addy == "" ) - { - $this->registry->output->showError( 'lostpass_name_email', 10111 ); - } - - /* Attempt to get the user details from the DB */ - if( $member_name ) - { - $this->DB->build( array( 'select' => 'members_display_name, name, member_id, email, member_group_id', 'from' => 'members', 'where' => "members_l_username='{$member_name}'" ) ); - $this->DB->execute(); - } - else if( $email_addy ) - { - $this->DB->build( array( 'select' => 'members_display_name, name, member_id, email, member_group_id', 'from' => 'members', 'where' => "email='{$email_addy}'" ) ); - $this->DB->execute(); - } - - if ( ! $this->DB->getTotalRows() ) - { - $this->registry->output->showError( 'lostpass_no_user', 10112 ); - } - else - { - $member = $this->DB->fetch(); - - /* Is there a validation key? If so, we'd better not touch it */ - if( $member['member_id'] == "" ) - { - $this->registry->output->showError( 'lostpass_no_mid', 2014 ); - } - - $validate_key = md5( IPSMember::makePassword() . uniqid( mt_rand(), TRUE ) ); - - /* Get rid of old entries for this member */ - $this->DB->delete( 'validating', "member_id={$member['member_id']} AND lost_pass=1" ); - - /* Update the DB for this member. */ - $db_str = array('vid' => $validate_key, - 'member_id' => $member['member_id'], - 'temp_group' => $member['member_group_id'], - 'entry_date' => time(), - 'coppa_user' => 0, - 'lost_pass' => 1, - 'ip_address' => $this->member->ip_address, - ); - - /* Are they already in the validating group? */ - if( $member['member_group_id'] != $this->settings['auth_group'] ) - { - $db_str['real_group'] = $member['member_group_id']; - } - - $this->DB->insert( 'validating', $db_str ); - - /* Send out the email. */ - $message = array( 'USERNAME' => $member['name'], - 'NAME' => $member['members_display_name'], - 'THE_LINK' => $this->registry->getClass('output')->buildSEOUrl( "app=core&module=global§ion=lostpass&do=sendform&uid={$member['member_id']}&aid={$validate_key}", 'publicNoSession', 'false' ), - 'MAN_LINK' => $this->registry->getClass('output')->buildSEOUrl( 'app=core&module=global§ion=lostpass&do=sendform', 'publicNoSession', 'false' ), - 'EMAIL' => $member['email'], - 'ID' => $member['member_id'], - 'CODE' => $validate_key, - 'IP_ADDRESS' => $this->member->ip_address ); - - IPSText::getTextClass('email')->setPlainTextTemplate( IPSText::getTextClass('email')->getTemplate( "lost_pass", $member['language'] ) ); - IPSText::getTextClass('email')->buildPlainTextContent( $message ); - IPSText::getTextClass('email')->buildHtmlContent( $message ); - - IPSText::getTextClass('email')->subject = $this->lang->words['lp_subject'] . ' ' . $this->settings['board_name']; - IPSText::getTextClass('email')->to = $member['email']; - IPSText::getTextClass('email')->sendMail(); - - $this->output = $this->registry->getClass('output')->getTemplate('register')->lostPasswordWait( $member ); - } - - $this->registry->output->setTitle( $this->lang->words['lost_pass_form'] . ' - ' . ipsRegistry::$settings['board_name'] ); - } - - /** - * Displays the lost password form - * - * @param string $errors - * @return @e void - */ - public function lostPasswordForm( $errors="" ) - { - //----------------------------------------- - // Do we have another URL for password resets? - //----------------------------------------- - - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' ); - $han_login = new $classToLoad( $this->registry ); - $han_login->init(); - $han_login->checkMaintenanceRedirect(); - - /* CAPTCHA */ - if( $this->settings['bot_antispam_type'] != 'none' ) - { - $captchaHTML = $this->registry->getClass('class_captcha')->getTemplate(); - } - - $this->registry->output->setTitle( $this->lang->words['lost_pass_form'] . ' - ' . ipsRegistry::$settings['board_name'] ); - $this->registry->output->addNavigation( $this->lang->words['lost_pass_form'], '' ); - - $this->output .= $this->registry->output->getTemplate('register')->lostPasswordForm( $this->lang->words[ $errors ] ); - - if ( $this->settings['bot_antispam_type'] != 'none' ) - { - $this->output = str_replace( "", $captchaHTML, $this->output ); - } - } - - - /** - * Shows the form for validating a lost password request - * - * @param string $msg - * @return @e void - */ - public function lostPasswordValidateForm( $msg='' ) - { - $this->output .= $this->registry->getClass('output')->getTemplate('register')->showLostpassForm( $this->lang->words[$msg] ); - - /* Check for input and it's in a valid format. */ - if( $this->request['uid'] AND $this->request['aid'] ) - { - $in_user_id = intval( trim( urldecode( $this->request['uid'] ) ) ); - $in_validate_key = IPSText::md5Clean( trim( urldecode( $this->request['aid'] ) ) ); - $in_type = trim( $this->request['type'] ); - - if ($in_type == "") - { - $in_type = 'reg'; - } - - /* Check and test input */ - if ( ! $in_validate_key ) - { - $this->registry->output->showError( 'validation_key_incorrect', 10113 ); - } - - if (! preg_match( '/^(?:\d){1,}$/', $in_user_id ) ) - { - $this->registry->output->showError( 'uid_key_incorrect', 10114 ); - } - - /* Attempt to get the profile of the requesting user */ - $member = IPSMember::load( $in_user_id ); - - if( ! $member['member_id'] ) - { - $this->registry->output->showError( 'lostpass_no_member', 10115 ); - } - - /* Get validating info.. */ - $validate = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'validating', 'where' => "member_id={$in_user_id} and vid='{$in_validate_key}' and lost_pass=1" ) ); - - if( ! $validate['member_id'] ) - { - $this->registry->output->showError( 'validation_key_incorrect', 10116 ); - } - - $this->output = str_replace( "", $this->registry->output->getTemplate('register')->show_lostpass_form_auto( $in_validate_key, $in_user_id ), $this->output ); - } - else - { - $this->output = str_replace( "", $this->registry->output->getTemplate('register')->show_lostpass_form_manual(), $this->output ); - } - - $this->registry->output->setTitle( $this->lang->words['activation_form'] . ' - ' . ipsRegistry::$settings['board_name'] ); - $this->registry->output->addNavigation( $this->lang->words['activation_form'], '' ); - } + + * Invision Power Services + * IP.Board v3.4.6 + * Recover Lost Password + * Last Updated: $Date: 2012-11-28 04:54:58 -0500 (Wed, 28 Nov 2012) $ + * + * + * @author $Author $ + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license http://www.invisionpower.com/company/standards.php#license + * @package IP.Board + * @subpackage Core + * @link http://www.invisionpower.com + * @since 20th February 2002 + * @version $Rev: 11651 $ + * + */ + +if ( ! defined( 'IN_IPB' ) ) +{ + print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +class public_core_global_lostpass extends ipsCommand +{ + /** + * Class entry point + * + * @param object Registry reference + * @return @e void [Outputs to screen/redirects] + */ + public function doExecute( ipsRegistry $registry ) + { + /* Load language */ + $this->registry->class_localization->loadLanguageFile( array( 'public_register' ), 'core' ); + + //----------------------------------------- + // Meta tags + //----------------------------------------- + + $this->registry->output->addMetaTag( 'robots', 'noindex' ); + + /* What to do */ + switch( $this->request['do'] ) + { + case 'sendform': + $this->lostPasswordValidateForm(); + break; + + case '11': + $this->lostPasswordEnd(); + break; + + case '03': + $this->lostPasswordValidate(); + break; + + default: + case '10': + $this->lostPasswordForm(); + break; + } + + /* Output */ + $this->registry->output->addContent( $this->output ); + $this->registry->output->sendOutput(); + } + + /** + * Validates a lost password request + * + * @return @e void + */ + public function lostPasswordValidate() + { + /* Check for input and it's in a valid format. */ + $in_user_id = intval( trim( urldecode( $this->request['uid'] ) ) ); + $in_validate_key = IPSText::md5Clean( trim( urldecode( $this->request['aid'] ) ) ); + + /* Check Input */ + if( ! $in_validate_key ) + { + $this->registry->output->showError( 'validation_key_incorrect', 1015 ); + } + + if( ! preg_match( '/^(?:\d){1,}$/', $in_user_id ) ) + { + $this->registry->output->showError( 'uid_key_incorrect', 1016 ); + } + + /* Attempt to get the profile of the requesting user */ + $member = IPSMember::load( $in_user_id ); + + if( ! $member['member_id'] ) + { + $this->registry->output->showError( 'lostpass_no_member', 1017 ); + } + + /* Get validating info.. */ + $validate = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'validating', 'where' => 'member_id=' . $in_user_id . ' and lost_pass=1' ) ); + + if( ! $validate['member_id'] ) + { + $this->registry->output->showError( 'lostpass_not_validating', 1018 ); + } + + if( ( $validate['new_reg'] == 1 ) && ( $this->settings['reg_auth_type'] == "admin" ) ) + { + $this->registry->output->showError( 'lostpass_new_reg', 4010, true ); + } + + if( $validate['vid'] != $in_validate_key ) + { + $this->registry->output->showError( 'lostpass_key_wrong', 1019 ); + } + else + { + /* On the same page? */ + if( $validate['lost_pass'] != 1 ) + { + $this->registry->output->showError( 'lostpass_not_lostpass', 4011, true ); + } + + /* Send a new random password? */ + if( $this->settings['lp_method'] == 'random' ) + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $save_array = array(); + + //----------------------------------------- + // Generate a new random password + //----------------------------------------- + + $new_pass = IPSMember::makePassword(); + + //----------------------------------------- + // Generate a new salt + //----------------------------------------- + + $salt = IPSMember::generatePasswordSalt(5); + $salt = str_replace( '\\', "\\\\", $salt ); + + //----------------------------------------- + // New log in key + //----------------------------------------- + + $key = IPSMember::generateAutoLoginKey(); + + //----------------------------------------- + // Update... + //----------------------------------------- + + $save_array['members_pass_salt'] = $salt; + $save_array['members_pass_hash'] = md5( md5($salt) . md5( $new_pass ) ); + $save_array['member_login_key'] = $key; + $save_array['member_login_key_expire'] = $this->settings['login_key_expire'] * 60 * 60 * 24; + $save_array['failed_logins'] = null; + $save_array['failed_login_count'] = 0; + + //----------------------------------------- + // Load handler... + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' ); + $this->han_login = new $classToLoad( $this->registry ); + $this->han_login->init(); + $this->han_login->changePass( $member['email'], md5( $new_pass ), $new_pass, $member ); + + //if ( $this->han_login->return_code != 'METHOD_NOT_DEFINED' AND $this->han_login->return_code != 'SUCCESS' ) + //{ + // $this->registry->output->showError( $this->lang->words['lostpass_external_fail'], 2013 ); + //} + + IPSMember::save( $member['member_id'], array( 'members' => $save_array ) ); + + /* Password has been changed! */ + IPSLib::runMemberSync( 'onPassChange', $member['member_id'], $new_pass ); + + //----------------------------------------- + // Send out the email... + //----------------------------------------- + + $message = array( 'NAME' => $member['members_display_name'], + 'THE_LINK' => $this->registry->getClass('output')->buildUrl( 'app=core&module=usercp&tab=core&area=email', 'publicNoSession' ), + 'PASSWORD' => $new_pass, + 'LOGIN' => $this->registry->getClass('output')->buildUrl( 'app=core&module=global§ion=login', 'publicNoSession' ), + 'USERNAME' => $member['name'], + 'EMAIL' => $member['email'], + 'ID' => $member['member_id'] ); + + IPSText::getTextClass('email')->setPlainTextTemplate( IPSText::getTextClass('email')->getTemplate( "lost_pass_email_pass", $member['language'] ) ); + IPSText::getTextClass('email')->buildPlainTextContent( $message ); + IPSText::getTextClass('email')->buildHtmlContent( $message ); + + IPSText::getTextClass('email')->subject = $this->lang->words['lp_random_pass_subject'] . ' ' . $this->settings['board_name']; + IPSText::getTextClass('email')->to = $member['email']; + + IPSText::getTextClass('email')->sendMail(); + + $this->registry->output->setTitle( $this->lang->words['activation_form'] . ' - ' . ipsRegistry::$settings['board_name'] ); + $this->output = $this->registry->getClass('output')->getTemplate('register')->showLostPassWaitRandom( $member ); + } + else + { + if( $_POST['pass1'] == "" ) + { + $this->registry->output->showError( 'pass_blank', 10184 ); + } + + if( $_POST['pass2'] == "" ) + { + $this->registry->output->showError( 'pass_blank', 10185 ); + } + + $pass_a = trim( $this->request['pass1'] ); + $pass_b = trim( $this->request['pass2'] ); + + /* + There's no reason for this - http://community.invisionpower.com/resources/bugs.html/_/ip-board/registrations-limit-passwords-to-32-characters-for-no-apparent-reason-r37770 + if( strlen( $pass_a ) < 3 ) + { + $this->registry->output->showError( 'pass_too_short', 10186 ); + } + */ + + if( $pass_a != $pass_b ) + { + $this->registry->output->showError( 'pass_no_match', 10187 ); + } + + $new_pass = md5( $pass_a ); + + /* Update Member Array */ + $save_array = array(); + + /* Generate a new salt */ + $salt = IPSMember::generatePasswordSalt(5); + $salt = str_replace( '\\', "\\\\", $salt ); + + /* New log in key */ + $key = IPSMember::generateAutoLoginKey(); + + /* Update Array */ + $save_array['members_pass_salt'] = $salt; + $save_array['members_pass_hash'] = md5( md5($salt) . $new_pass ); + $save_array['member_login_key'] = $key; + $save_array['member_login_key_expire'] = $this->settings['login_key_expire'] * 60 * 60 * 24; + $save_array['failed_logins'] = null; + $save_array['failed_login_count'] = 0; + + /* Change the password */ + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' ); + $this->han_login = new $classToLoad( $this->registry ); + $this->han_login->init(); + $this->han_login->changePass( $member['email'], $new_pass, $pass_a, $member ); + + //----------------------------------------- + // We'll ignore any remote errors + //----------------------------------------- + + /*if( $this->han_login->return_code != 'METHOD_NOT_DEFINED' AND $this->han_login->return_code != 'SUCCESS' ) + { + // Pass not changed remotely + }*/ + + /* Update the member */ + IPSMember::save( $member['member_id'], array( 'members' => $save_array ) ); + + /* Password has been changed! */ + IPSLib::runMemberSync( 'onPassChange', $member['member_id'], $pass_a ); + + /* Remove "dead" validation */ + $this->DB->delete( 'validating', "vid='{$validate['vid']}' OR (member_id={$member['member_id']} AND lost_pass=1)" ); + + $this->registry->output->silentRedirect( $this->registry->getClass('output')->buildUrl( 'app=core&module=global§ion=login&do=autologin&frompass=1' ) ); + } + } + } + + /** + * Completes the lost password request form + * + * @return @e void + */ + public function lostPasswordEnd() + { + if( $this->settings['bot_antispam_type'] != 'none' ) + { + if( !$this->registry->getClass('class_captcha')->validate( $this->request['regid'], $this->request['reg_code'] ) ) + { + $this->lostPasswordForm( 'err_reg_code' ); + return; + } + } + + /* Back to the usual programming! :o */ + if( $this->request['member_name'] == "" AND $this->request['email_addy'] == "" ) + { + $this->registry->output->showError( 'lostpass_name_email', 10110 ); + } + + /* Check for input and it's in a valid format. */ + $member_name = trim( strtolower( $this->request['member_name'] ) ); + $email_addy = trim( strtolower( $this->request['email_addy'] ) ); + + if( $member_name == "" AND $email_addy == "" ) + { + $this->registry->output->showError( 'lostpass_name_email', 10111 ); + } + + /* Attempt to get the user details from the DB */ + if( $member_name ) + { + $this->DB->build( array( 'select' => 'members_display_name, name, member_id, email, member_group_id', 'from' => 'members', 'where' => "members_l_username='{$member_name}'" ) ); + $this->DB->execute(); + } + else if( $email_addy ) + { + $this->DB->build( array( 'select' => 'members_display_name, name, member_id, email, member_group_id', 'from' => 'members', 'where' => "email='{$email_addy}'" ) ); + $this->DB->execute(); + } + + if ( ! $this->DB->getTotalRows() ) + { + $this->registry->output->showError( 'lostpass_no_user', 10112 ); + } + else + { + $member = $this->DB->fetch(); + + /* Is there a validation key? If so, we'd better not touch it */ + if( $member['member_id'] == "" ) + { + $this->registry->output->showError( 'lostpass_no_mid', 2014 ); + } + + $validate_key = md5( IPSMember::makePassword() . uniqid( mt_rand(), TRUE ) ); + + /* Get rid of old entries for this member */ + $this->DB->delete( 'validating', "member_id={$member['member_id']} AND lost_pass=1" ); + + /* Update the DB for this member. */ + $db_str = array('vid' => $validate_key, + 'member_id' => $member['member_id'], + 'temp_group' => $member['member_group_id'], + 'entry_date' => time(), + 'coppa_user' => 0, + 'lost_pass' => 1, + 'ip_address' => $this->member->ip_address, + ); + + /* Are they already in the validating group? */ + if( $member['member_group_id'] != $this->settings['auth_group'] ) + { + $db_str['real_group'] = $member['member_group_id']; + } + + $this->DB->insert( 'validating', $db_str ); + + /* Send out the email. */ + $message = array( 'USERNAME' => $member['name'], + 'NAME' => $member['members_display_name'], + 'THE_LINK' => $this->registry->getClass('output')->buildUrl( "app=core&module=global§ion=lostpass&do=sendform&uid={$member['member_id']}&aid={$validate_key}", 'publicNoSession' ), + 'MAN_LINK' => $this->registry->getClass('output')->buildUrl( 'app=core&module=global§ion=lostpass&do=sendform', 'publicNoSession' ), + 'EMAIL' => $member['email'], + 'ID' => $member['member_id'], + 'CODE' => $validate_key, + 'IP_ADDRESS' => $this->member->ip_address ); + + IPSText::getTextClass('email')->setPlainTextTemplate( IPSText::getTextClass('email')->getTemplate( "lost_pass", $member['language'] ) ); + IPSText::getTextClass('email')->buildPlainTextContent( $message ); + IPSText::getTextClass('email')->buildHtmlContent( $message ); + + IPSText::getTextClass('email')->subject = $this->lang->words['lp_subject'] . ' ' . $this->settings['board_name']; + IPSText::getTextClass('email')->to = $member['email']; + IPSText::getTextClass('email')->sendMail(); + + $this->output = $this->registry->getClass('output')->getTemplate('register')->lostPasswordWait( $member ); + } + + $this->registry->output->setTitle( $this->lang->words['lost_pass_form'] . ' - ' . ipsRegistry::$settings['board_name'] ); + } + + /** + * Displays the lost password form + * + * @param string $errors + * @return @e void + */ + public function lostPasswordForm( $errors="" ) + { + //----------------------------------------- + // Do we have another URL for password resets? + //----------------------------------------- + + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' ); + $han_login = new $classToLoad( $this->registry ); + $han_login->init(); + $han_login->checkMaintenanceRedirect(); + + /* CAPTCHA */ + if( $this->settings['bot_antispam_type'] != 'none' ) + { + $captchaHTML = $this->registry->getClass('class_captcha')->getTemplate(); + } + + $this->registry->output->setTitle( $this->lang->words['lost_pass_form'] . ' - ' . ipsRegistry::$settings['board_name'] ); + $this->registry->output->addNavigation( $this->lang->words['lost_pass_form'], '' ); + + $this->output .= $this->registry->output->getTemplate('register')->lostPasswordForm( $this->lang->words[ $errors ] ); + + if ( $this->settings['bot_antispam_type'] != 'none' ) + { + $this->output = str_replace( "", $captchaHTML, $this->output ); + } + } + + + /** + * Shows the form for validating a lost password request + * + * @param string $msg + * @return @e void + */ + public function lostPasswordValidateForm( $msg='' ) + { + $this->output .= $this->registry->getClass('output')->getTemplate('register')->showLostpassForm( $this->lang->words[$msg] ); + + /* Check for input and it's in a valid format. */ + if( $this->request['uid'] AND $this->request['aid'] ) + { + $in_user_id = intval( trim( urldecode( $this->request['uid'] ) ) ); + $in_validate_key = IPSText::md5Clean( trim( urldecode( $this->request['aid'] ) ) ); + $in_type = trim( $this->request['type'] ); + + if ($in_type == "") + { + $in_type = 'reg'; + } + + /* Check and test input */ + if ( ! $in_validate_key ) + { + $this->registry->output->showError( 'validation_key_incorrect', 10113 ); + } + + if (! preg_match( '/^(?:\d){1,}$/', $in_user_id ) ) + { + $this->registry->output->showError( 'uid_key_incorrect', 10114 ); + } + + /* Attempt to get the profile of the requesting user */ + $member = IPSMember::load( $in_user_id ); + + if( ! $member['member_id'] ) + { + $this->registry->output->showError( 'lostpass_no_member', 10115 ); + } + + /* Get validating info.. */ + $validate = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'validating', 'where' => "member_id={$in_user_id} and vid='{$in_validate_key}' and lost_pass=1" ) ); + + if( ! $validate['member_id'] ) + { + $this->registry->output->showError( 'validation_key_incorrect', 10116 ); + } + + $this->output = str_replace( "", $this->registry->output->getTemplate('register')->show_lostpass_form_auto( $in_validate_key, $in_user_id ), $this->output ); + } + else + { + $this->output = str_replace( "", $this->registry->output->getTemplate('register')->show_lostpass_form_manual(), $this->output ); + } + + $this->registry->output->setTitle( $this->lang->words['activation_form'] . ' - ' . ipsRegistry::$settings['board_name'] ); + $this->registry->output->addNavigation( $this->lang->words['activation_form'], '' ); + } } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/global/navigation.php b/upload/admin/applications/core/modules_public/global/navigation.php index c1ccf77b..70be1f87 100644 --- a/upload/admin/applications/core/modules_public/global/navigation.php +++ b/upload/admin/applications/core/modules_public/global/navigation.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Captcha
      * Last Updated: $Date: 2013-04-16 15:13:53 -0400 (Tue, 16 Apr 2013) $
      * 
    diff --git a/upload/admin/applications/core/modules_public/global/privacy.php b/upload/admin/applications/core/modules_public/global/privacy.php index 845e8d81..1ec43e3a 100644 --- a/upload/admin/applications/core/modules_public/global/privacy.php +++ b/upload/admin/applications/core/modules_public/global/privacy.php @@ -3,7 +3,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Show forum rules
      * Last Updated: $Date: 2011-05-05 12:03:47 +0100 (Thu, 05 May 2011) $
      * 
    diff --git a/upload/admin/applications/core/modules_public/global/register.php b/upload/admin/applications/core/modules_public/global/register.php index bc1672a7..6f4a58f9 100644 --- a/upload/admin/applications/core/modules_public/global/register.php +++ b/upload/admin/applications/core/modules_public/global/register.php @@ -2,9 +2,9 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Register
    - * Last Updated: $Date: 2013-05-03 23:09:37 -0400 (Fri, 03 May 2013) $
    + * Last Updated: $Date: 2013-10-24 08:12:23 -0400 (Thu, 24 Oct 2013) $
      * 
    * * @author $Author $ @@ -14,7 +14,7 @@ * @subpackage Core * @link http://www.invisionpower.com * @since 20th February 2002 - * @version $Rev: 12226 $ + * @version $Rev: 12391 $ * */ @@ -111,7 +111,7 @@ class public_core_global_register extends ipsCommand /* Output */ $this->registry->output->addContent( $this->output ); - $this->registry->output->sendOutput(); + $this->registry->output->sendOutput(); } /** @@ -250,7 +250,7 @@ class public_core_global_register extends ipsCommand //----------------------------------------- if ( !$nexusError and $this->request['nexus_pass'] ) - { + { //----------------------------------------- // Did we buy a package? //----------------------------------------- @@ -408,10 +408,10 @@ class public_core_global_register extends ipsCommand $ftype = 'optional'; } - $custom_fields_out[$ftype][] = array( - 'name' => $custom_fields->field_names[ $id ], - 'desc' => $custom_fields->field_desc[ $id ], - 'field' => $form_element, + $custom_fields_out[$ftype][] = array( + 'name' => $custom_fields->field_names[ $id ], + 'desc' => $custom_fields->field_desc[ $id ], + 'field' => $form_element, 'id' => $id, 'error' => '', 'type' => $custom_fields->cache_data[ $id ]['pf_type'] @@ -495,14 +495,14 @@ class public_core_global_register extends ipsCommand $this->output .= $this->registry->output->getTemplate('register')->registerForm( $form_errors['general'], - array( - 'TEXT' => $this->lang->words['std_text'], + array( + 'TEXT' => $this->lang->words['std_text'], 'coppa_user' => $coppa, 'captchaHTML' => $captchaHTML, 'qandaHTML' => $qandaHTML, 'showCOPPA' => $this->settings['use_coppa'] AND !(IPSLib::appIsInstalled('nexus') AND $this->settings['nexus_reg_show'] AND $this->settings['nexus_store_online']), - ), - $final_errors, + ), + $final_errors, $time_select, $custom_fields_out, $nexusFields, @@ -534,6 +534,7 @@ class public_core_global_register extends ipsCommand $login_user = trim( $this->request['login_user'] ); $login_pass = trim( $this->request['login_pass'] ); $connectService = trim( strtolower( $this->request['connectService'] ) ); + $validate_key = md5( IPSMember::makePassword() . time() ); //----------------------------------------- // Get DB row @@ -651,24 +652,6 @@ class public_core_global_register extends ipsCommand $form_errors['serviceLogIn'][] = $this->lang->words['connect_unknown']; } } - else if ( $connectService == 'vkontakte' AND $member['vk_uid'] ) - { - /* Already VKd? */ - if ( $logInMember['vk_uid'] AND ( $member['vk_uid'] != $logInMember['vk_uid'] ) ) - { - /* User already has vkontakte link */ - $form_errors['serviceLogIn'][] = sprintf( $this->lang->words['connect_already_linked'], $login_user, ucfirst( $connectService ) ); - } - - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/vkontakte/connect.php', 'vkontakte_connect' ); - $vk = new $classToLoad( $this->registry, $key ); - - if ( $vk->finishNewConnection( $logInMember['member_id'], $member['member_id'] ) !== true ) - { - /* Unknown error */ - $form_errors['serviceLogIn'][] = $this->lang->words['connect_unknown']; - } - } /* Ok to proceed? */ if ( ! count( $form_errors['serviceLogIn'] ) ) @@ -783,18 +766,18 @@ class public_core_global_register extends ipsCommand 'name' => $tmp_member['name'] ? $tmp_member['name'] : $members_display_name, 'members_l_username' => $tmp_member['members_l_username'] ? $tmp_member['members_l_username'] : $members_display_name, 'member_group_id' => $member_group_id, - 'members_l_display_name' => strtolower( $members_display_name ) + 'members_l_display_name' => strtolower( $members_display_name ) ) ) ); } else { - IPSMember::save( $mid, array( 'members' => array( + IPSMember::save( $mid, array( 'members' => array( 'members_display_name' => $members_display_name, 'members_seo_name' => IPSText::makeSeoTitle( $members_display_name ), 'name' => $tmp_member['name'] ? $tmp_member['name'] : $members_display_name, 'members_l_username' => $tmp_member['members_l_username'] ? $tmp_member['members_l_username'] : $members_display_name, 'member_group_id' => $member_group_id, - 'members_l_display_name' => mb_strtolower( $members_display_name ) + 'members_l_display_name' => strtolower( $members_display_name ) ) ) ); } @@ -814,77 +797,6 @@ class public_core_global_register extends ipsCommand if ( is_array($custom_fields->out_fields) and count($custom_fields->out_fields) ) { $this->DB->update( 'pfields_content', $custom_fields->out_fields, 'member_id=' . $mid ); - } - - //----------------------------------------- - // Pass twitter/facebook via spam service - //----------------------------------------- - - if ( $connectService AND ! $login_user AND $this->settings['spam_service_enabled'] ) - { - /* Load all member data */ - $member = IPSMember::load( $mid, 'all' ); - - /* Spam Service */ - $spamCode = 0; - $_spamFlag = 0; - - /* Query the service */ - $spamCode = IPSMember::querySpamService( $member['email'] ); - - /* Action to perform */ - $action = $this->settings[ 'spam_service_action_' . $spamCode ]; - - /* Perform Action */ - switch( $action ) - { - /* Proceed with registration */ - case 1: - break; - - /* Flag for admin approval */ - case 2: - $member['member_group_id'] = $this->settings['auth_group']; - $this->settings['reg_auth_type'] = 'admin'; - $_spamFlag = 1; - break; - - /* Approve the account, but ban it */ - case 3: - $member['member_banned'] = 1; - $member['bw_is_spammer'] = 1; - $this->settings['reg_auth_type'] = ''; - break; - /* Deny registration */ - case 4: - $this->registry->output->showError( 'spam_denied_account', '100x001', FALSE, '', 200 ); - break; - } - - /* Update member */ - IPSMember::save( $member['member_id'], array( 'core' => array( 'member_group_id' => $member['member_group_id'], - 'member_banned' => intval( $member['member_banned'] ), - 'bw_is_spammer' => intval( $member['bw_is_spammer'] ) ) ) ); - - /* Did we put them in validating? */ - if ( $_spamFlag ) - { - $validate_key = md5( IPSMember::makePassword() . time() ); - $time = time(); - - $this->DB->insert( 'validating', array( 'vid' => $validate_key, - 'member_id' => $member['member_id'], - 'real_group' => $this->settings['member_group'], - 'temp_group' => $this->settings['auth_group'], - 'entry_date' => $time, - 'coppa_user' => 0, - 'new_reg' => 1, - 'ip_address' => $member['ip_address'], - 'spam_flag' => $_spamFlag ) ); - - $this->output = $this->registry->output->getTemplate('register')->showPreview( $member ); - return; #Goes back to doExecute which sends $this->output to output class - } } /* Send out notification */ @@ -946,6 +858,7 @@ class public_core_global_register extends ipsCommand 'entry_date' => time(), 'coppa_user' => 0, 'new_reg' => 1, + 'user_verified' => 1, 'ip_address' => $member['ip_address'], 'spam_flag' => $_spamFlag ) ); @@ -1043,7 +956,7 @@ class public_core_global_register extends ipsCommand /* Now, make sure we have a unique display name */ $max = $this->DB->buildAndFetch( array( 'select' => 'MAX(member_id) as max', 'from' => 'members', - 'where' => "members_l_display_name LIKE '" . $this->DB->addSlashes( mb_strtolower( $userData['_displayName'] ) ) . "%'" ) ); + 'where' => "members_l_display_name LIKE '" . $this->DB->addSlashes( strtolower( $userData['_displayName'] ) ) . "%'" ) ); if ( $max['max'] ) { @@ -1077,22 +990,6 @@ class public_core_global_register extends ipsCommand $userData['_sImage'] = $this->settings['public_dir'] . 'style_status/twitter.png'; } } - else if ( $member['vk_uid'] AND $member['vk_token'] ) - { - /* Attempt to fetch user details */ - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/vkontakte/connect.php', 'vkontakte_connect' ); - $vk = new $classToLoad( $this->registry, $member['vk_token'], $member['vk_uid'] ); - - $userData = $vk->fetchUserData(); - - if ( $userData['uid'] ) - { - $userData['service'] = 'vkontakte'; - $userData['_name'] = $userData['first_name'] . ' ' . $userData['last_name']; - $userData['_pic'] = $userData['photo']; - $userData['_sImage'] = $this->settings['public_dir'] . 'style_status/vkontakte.png'; - } - } else { /* Set defaults for any we have */ @@ -1145,10 +1042,10 @@ class public_core_global_register extends ipsCommand $ftype = 'optional'; } - $custom_fields_out[$ftype][] = array( - 'name' => $custom_fields->field_names[ $id ], - 'desc' => $custom_fields->field_desc[ $id ], - 'field' => $form_element, + $custom_fields_out[$ftype][] = array( + 'name' => $custom_fields->field_names[ $id ], + 'desc' => $custom_fields->field_desc[ $id ], + 'field' => $form_element, 'id' => $id, 'error' => '', 'type' => $custom_fields->cache_data[ $id ]['pf_type'] @@ -1290,8 +1187,8 @@ class public_core_global_register extends ipsCommand IPSText::getTextClass('email')->buildMessage( array( 'NAME' => $member['members_display_name'], - 'THE_LINK' => $this->registry->getClass('output')->buildSEOUrl("app=core&module=global§ion=lostpass&do=sendform&uid=" . $member['member_id'] . "&aid=" . $val['vid'], 'publicNoSession', 'false'), - 'MAN_LINK' => $this->registry->getClass('output')->buildSEOUrl("app=core&module=global§ion=lostpass&do=sendform", 'publicNoSession', 'false'), + 'THE_LINK' => $this->settings['base_url'] . "app=core&module=global§ion=lostpass&do=sendform&uid=" . $member['member_id'] . "&aid=" . $val['vid'], + 'MAN_LINK' => $this->settings['base_url'] . "app=core&module=global§ion=lostpass&do=sendform", 'EMAIL' => $member['email'], 'ID' => $member['member_id'], 'CODE' => $val['vid'], @@ -1309,9 +1206,9 @@ class public_core_global_register extends ipsCommand IPSText::getTextClass('email')->getTemplate( "reg_validate", $member['language'] ); IPSText::getTextClass('email')->buildMessage( array( - 'THE_LINK' => $this->registry->getClass('output')->buildSEOUrl( "app=core&module=global§ion=register&do=auto_validate&uid=" . $member['member_id'] . "&aid=" . $val['vid'], 'publicNoSession', 'false'), + 'THE_LINK' => $this->settings['base_url'] . "app=core&module=global§ion=register&do=auto_validate&uid=" . $member['member_id'] . "&aid=" . $val['vid'], 'NAME' => $member['members_display_name'], - 'MAN_LINK' => $this->registry->getClass('output')->buildSEOUrl("app=core&module=global§ion=register&do=05", 'publicNoSession', 'false'), + 'MAN_LINK' => $this->settings['base_url'] . "app=core&module=global§ion=register&do=05", 'EMAIL' => $member['email'], 'ID' => $member['member_id'], 'CODE' => $val['vid'], @@ -1329,9 +1226,9 @@ class public_core_global_register extends ipsCommand IPSText::getTextClass('email')->buildMessage( array( 'NAME' => $member['members_display_name'], - 'THE_LINK' => $this->registry->getClass('output')->buildSEOUrl("app=core&module=global§ion=register&do=auto_validate&type=newemail&uid=" . $member['member_id'] . "&aid=" . $val['vid'], 'publicNoSession', 'false'), + 'THE_LINK' => $this->settings['base_url'] . "app=core&module=global§ion=register&do=auto_validate&type=newemail&uid=" . $member['member_id'] . "&aid=" . $val['vid'], 'ID' => $member['member_id'], - 'MAN_LINK' => $this->registry->getClass('output')->buildSEOUrl("app=core&module=global§ion=register&do=07", 'publicNoSession', 'false'), + 'MAN_LINK' => $this->settings['base_url'] . "app=core&module=global§ion=register&do=07", 'CODE' => $val['vid'], ) ); @@ -1394,7 +1291,7 @@ class public_core_global_register extends ipsCommand echo( $this->registry->output->getTemplate('register')->registerCoppaForm() ); exit(); - } + } /** * This is the second page a COPPA submission hits. Really, user hits this page and if birthday is older than 13 @@ -1405,7 +1302,8 @@ class public_core_global_register extends ipsCommand */ protected function registerCoppaTwo() { - if( $this->request['coppa'] == 1 ) + $birthday = strtotime( $this->request['month'] ."-" . $this->request['day'] . "-" . $this->request['year']); + if( time() - ( $birthday + ( 60 * 60 * 24 * 365 * 13 ) ) > 0 ) { IPSCookie::set( 'coppa', 'no', 0, 1 ); $this->registerForm(); @@ -1420,7 +1318,7 @@ class public_core_global_register extends ipsCommand $this->registry->output->setTitle( $this->lang->words['coppa_title'] . ' - ' . ipsRegistry::$settings['board_name']); $this->registry->output->addNavigation( $this->lang->words['coppa_title'], '' ); - } + } /** * Validation completion. This is the action hit when a user clicks a validation link from their email for @@ -1482,10 +1380,10 @@ class public_core_global_register extends ipsCommand // account for a spam user too //----------------------------------------- - if ( ( $validate['new_reg'] == 1 ) && (($this->settings['reg_auth_type'] == "admin" ) || $validate['spam_flag']) ) - { + if ( ( $validate['new_reg'] == 1 ) && (($this->settings['reg_auth_type'] == "admin" ) || $validate['spam_flag']) ) + { $this->registry->output->showError( 'validate_admin_turn', 10121 ); - } + } if ( $validate['vid'] != $in_validate_key ) { @@ -1646,9 +1544,9 @@ class public_core_global_register extends ipsCommand IPSText::getTextClass('email')->buildMessage( array( 'NAME' => $member['members_display_name'], - 'THE_LINK' => $this->registry->getClass('output')->buildSEOUrl('app=core&module=usercp&tab=core&area=email', 'publicNoSession', 'false'), + 'THE_LINK' => $this->settings['base_url'] . 'app=core&module=usercp&tab=core&area=email', 'PASSWORD' => $new_pass, - 'LOGIN' => $this->registry->getClass('output')->buildSEOUrl('app=core&module=global§ion=login', 'publicNoSession', 'false'), + 'LOGIN' => $this->settings['base_url'] . 'app=core&module=global§ion=login', 'USERNAME' => $member['name'], 'EMAIL' => $member['email'], 'ID' => $member['member_id'], @@ -1726,7 +1624,7 @@ class public_core_global_register extends ipsCommand $custom_fields = new $classToLoad(); $custom_fields->initData( 'edit' ); - $custom_fields->parseToSave( $_POST, 'register' ); + $custom_fields->parseToSave( $_POST, 'register' ); /* Check */ if( $custom_fields->error_messages ) @@ -1734,7 +1632,7 @@ class public_core_global_register extends ipsCommand $form_errors['general'] = $custom_fields->error_messages; } - /* Check the email address */ + /* Check the email address */ if ( ! $in_email OR strlen( $in_email ) < 6 OR !IPSText::checkEmailAddress( $in_email ) ) { $form_errors['email'][$this->lang->words['err_invalid_email']] = $this->lang->words['err_invalid_email']; @@ -1829,7 +1727,7 @@ class public_core_global_register extends ipsCommand { $answer = trim($answer); - if( IPSText::mbstrlen($answer) AND mb_strtolower($answer) == mb_strtolower($this->request['qa_answer']) ) + if( strlen($answer) AND strtolower($answer) == strtolower($this->request['qa_answer']) ) { $pass = true; break; @@ -1857,7 +1755,7 @@ class public_core_global_register extends ipsCommand $form_errors['general'][$this->lang->words['err_q_and_a']] = $this->lang->words['err_q_and_a']; } - /* CHECK 2: Any errors ? */ + /* CHECK 2: Any errors ? */ if ( count( $form_errors ) ) { $this->registerForm( $form_errors ); @@ -1897,42 +1795,6 @@ class public_core_global_register extends ipsCommand $spamCode = 0; $_spamFlag = 0; - if( $this->settings['spam_service_enabled'] ) - { - /* Query the service */ - $spamCode = IPSMember::querySpamService( $in_email ); - - /* Action to perform */ - $action = $this->settings[ 'spam_service_action_' . $spamCode ]; - - /* Perform Action */ - switch( $action ) - { - /* Proceed with registration */ - case 1: - break; - - /* Flag for admin approval */ - case 2: - $member['member_group_id'] = $this->settings['auth_group']; - $this->settings['reg_auth_type'] = 'admin'; - $_spamFlag = 1; - break; - - /* Approve the account, but ban it */ - case 3: - $member['member_banned'] = 1; - $member['bw_is_spammer'] = 1; - $this->settings['reg_auth_type'] = ''; - break; - - /* Deny registration */ - case 4: - $this->registry->output->showError( 'spam_denied_account', '100x001', FALSE, '', 200 ); - break; - } - } - //----------------------------------------- // Create the account //----------------------------------------- @@ -1994,15 +1856,15 @@ class public_core_global_register extends ipsCommand if ( $this->settings['reg_auth_type'] == 'user' OR $this->settings['reg_auth_type'] == 'admin_user' ) { /* Send out the email. */ - $message = array( 'THE_LINK' => $this->registry->getClass('output')->buildSEOUrl("app=core&module=global§ion=register&do=auto_validate&uid=" . urlencode( $member['member_id'] ) . "&aid=" . urlencode( $validate_key ), 'publicNoSession', 'false'), + $message = array( 'THE_LINK' => $this->settings['base_url'] . "app=core&module=global§ion=register&do=auto_validate&uid=" . urlencode( $member['member_id'] ) . "&aid=" . urlencode( $validate_key ), 'NAME' => $member['members_display_name'], - 'MAN_LINK' => $this->registry->getClass('output')->buildSEOUrl("app=core&module=global§ion=register&do=05", 'publicNoSession', 'false'), + 'MAN_LINK' => $this->settings['base_url'] . "app=core&module=global§ion=register&do=05", 'EMAIL' => $member['email'], 'ID' => $member['member_id'], 'CODE' => $validate_key ); IPSText::getTextClass('email')->setPlainTextTemplate( IPSText::getTextClass('email')->getTemplate( "reg_validate", $this->member->language_id ) ); - IPSText::getTextClass('email')->buildPlainTextContent( $message ); + IPSText::getTextClass('email')->buildPlainTextContent( $message ); IPSText::getTextClass('email')->buildHtmlContent( $message ); IPSText::getTextClass('email')->subject = sprintf( $this->lang->words['new_registration_email'], $this->settings['board_name'] ); diff --git a/upload/admin/applications/core/modules_public/global/reputation.php b/upload/admin/applications/core/modules_public/global/reputation.php index 8a210c8e..8ed7703d 100644 --- a/upload/admin/applications/core/modules_public/global/reputation.php +++ b/upload/admin/applications/core/modules_public/global/reputation.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Reputation
      * Last Updated: $Date: 2013-04-16 15:13:53 -0400 (Tue, 16 Apr 2013) $
      * 
    diff --git a/upload/admin/applications/core/modules_public/global/rss.php b/upload/admin/applications/core/modules_public/global/rss.php index d9bb0ea7..16467804 100644 --- a/upload/admin/applications/core/modules_public/global/rss.php +++ b/upload/admin/applications/core/modules_public/global/rss.php @@ -2,19 +2,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * RSS output functionality
    - * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
    + * Last Updated: $Date: 2013-10-16 12:57:41 -0400 (Wed, 16 Oct 2013) $
      * 
    * - * @author $Author: bfarber $ + * @author $Author: AndyMillne $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @license http://www.invisionpower.com/company/standards.php#license * @package IP.Board * @subpackage Core * @link http://www.invisionpower.com * @since Friday 18th March 2005 - * @version $Revision: 10721 $ + * @version $Revision: 12380 $ */ if ( ! defined( 'IN_IPB' ) ) @@ -63,7 +63,7 @@ class public_core_global_rss extends ipsCommand { header("HTTP/1.1 503 Service Temporarily Unavailable"); } - + header('Content-Type: text/html; charset=' . IPS_DOC_CHAR_SET); print $this->lang->words['rss_board_offline']; exit(); } diff --git a/upload/admin/applications/core/modules_public/global/share.php b/upload/admin/applications/core/modules_public/global/share.php index 923f8f9f..af7bdc6567 100644 --- a/upload/admin/applications/core/modules_public/global/share.php +++ b/upload/admin/applications/core/modules_public/global/share.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Captcha
      * Last Updated: $Date: 2013-01-07 12:09:37 -0500 (Mon, 07 Jan 2013) $
      * 
    diff --git a/upload/admin/applications/core/modules_public/global/sitemap.php b/upload/admin/applications/core/modules_public/global/sitemap.php index d6a91adc..070f9296 100644 --- a/upload/admin/applications/core/modules_public/global/sitemap.php +++ b/upload/admin/applications/core/modules_public/global/sitemap.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Sitemap Forwarder
      * Last Updated: $Date: 2012-05-10 21:10:13 +0100 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/modules_public/global/skin.php b/upload/admin/applications/core/modules_public/global/skin.php index ea635632..42b63dee 100644 --- a/upload/admin/applications/core/modules_public/global/skin.php +++ b/upload/admin/applications/core/modules_public/global/skin.php @@ -7,7 +7,7 @@ * $Author: AndyMillne $ * @since 27 March 2012 * $LastChangedDate: 2012-09-17 12:07:56 -0400 (Mon, 17 Sep 2012) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 11342 $ */ diff --git a/upload/admin/applications/core/modules_public/global/unsubscribe.php b/upload/admin/applications/core/modules_public/global/unsubscribe.php index 3563de59..4a14d2d6 100644 --- a/upload/admin/applications/core/modules_public/global/unsubscribe.php +++ b/upload/admin/applications/core/modules_public/global/unsubscribe.php @@ -7,7 +7,7 @@ * $Author: ips_terabyte $ * @since 23 August 2012 * $LastChangedDate: 2012-04-05 17:35:31 +0100 (Thu, 05 Apr 2012) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 10571 $ */ diff --git a/upload/admin/applications/core/modules_public/help/defaultSection.php b/upload/admin/applications/core/modules_public/help/defaultSection.php index 452491bf..ac775d8b 100644 --- a/upload/admin/applications/core/modules_public/help/defaultSection.php +++ b/upload/admin/applications/core/modules_public/help/defaultSection.php @@ -7,7 +7,7 @@ * $Author: ips_terabyte $ * @since 20th February 2002 * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 8655 $ */ diff --git a/upload/admin/applications/core/modules_public/help/help.php b/upload/admin/applications/core/modules_public/help/help.php index 86f6db16..89d3cd71 100644 --- a/upload/admin/applications/core/modules_public/help/help.php +++ b/upload/admin/applications/core/modules_public/help/help.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Help File System
      * Last Updated: $Date: 2012-11-15 09:58:24 -0500 (Thu, 15 Nov 2012) $
      * 
    diff --git a/upload/admin/applications/core/modules_public/help/index.html b/upload/admin/applications/core/modules_public/help/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_public/help/index.html +++ b/upload/admin/applications/core/modules_public/help/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/index.html b/upload/admin/applications/core/modules_public/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_public/index.html +++ b/upload/admin/applications/core/modules_public/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/modcp/defaultSection.php b/upload/admin/applications/core/modules_public/modcp/defaultSection.php index a13b1eb5..3ef8cce4 100644 --- a/upload/admin/applications/core/modules_public/modcp/defaultSection.php +++ b/upload/admin/applications/core/modules_public/modcp/defaultSection.php @@ -7,7 +7,7 @@ * $Author: ips_terabyte $ * @since 2/14/2011 * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 8655 $ */ diff --git a/upload/admin/applications/core/modules_public/modcp/index.html b/upload/admin/applications/core/modules_public/modcp/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_public/modcp/index.html +++ b/upload/admin/applications/core/modules_public/modcp/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/modcp/modcp.php b/upload/admin/applications/core/modules_public/modcp/modcp.php index cc798635..f4f7355c 100644 --- a/upload/admin/applications/core/modules_public/modcp/modcp.php +++ b/upload/admin/applications/core/modules_public/modcp/modcp.php @@ -6,7 +6,7 @@ * $Author: AndyMillne $ * @since 2/14/2011 * $LastChangedDate: 2013-05-28 10:00:25 -0400 (Tue, 28 May 2013) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 12273 $ */ diff --git a/upload/admin/applications/core/modules_public/reports/defaultSection.php b/upload/admin/applications/core/modules_public/reports/defaultSection.php index c85f3d9d..63606f2b 100644 --- a/upload/admin/applications/core/modules_public/reports/defaultSection.php +++ b/upload/admin/applications/core/modules_public/reports/defaultSection.php @@ -7,7 +7,7 @@ * $Author: ips_terabyte $ * @since 20th February 2002 * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 8655 $ */ diff --git a/upload/admin/applications/core/modules_public/reports/index.html b/upload/admin/applications/core/modules_public/reports/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_public/reports/index.html +++ b/upload/admin/applications/core/modules_public/reports/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/reports/reports.php b/upload/admin/applications/core/modules_public/reports/reports.php index b5c8eb98..302added 100644 --- a/upload/admin/applications/core/modules_public/reports/reports.php +++ b/upload/admin/applications/core/modules_public/reports/reports.php @@ -8,7 +8,7 @@ * @author Based on original "Report Center" by Luke Scott * @since - * $LastChangedDate: 2012-12-13 08:29:08 -0500 (Thu, 13 Dec 2012) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 11713 $ */ diff --git a/upload/admin/applications/core/modules_public/search/defaultSection.php b/upload/admin/applications/core/modules_public/search/defaultSection.php index ccebd263..09461bef 100644 --- a/upload/admin/applications/core/modules_public/search/defaultSection.php +++ b/upload/admin/applications/core/modules_public/search/defaultSection.php @@ -7,7 +7,7 @@ * $Author: ips_terabyte $ * @since 20th February 2002 * $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 8655 $ */ diff --git a/upload/admin/applications/core/modules_public/search/index.html b/upload/admin/applications/core/modules_public/search/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_public/search/index.html +++ b/upload/admin/applications/core/modules_public/search/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/search/search.php b/upload/admin/applications/core/modules_public/search/search.php index 2871ed52..a2cb3584 100644 --- a/upload/admin/applications/core/modules_public/search/search.php +++ b/upload/admin/applications/core/modules_public/search/search.php @@ -1,1290 +1,1306 @@ - - * Invision Power Services - * IP.Board v3.4.5 - * Global Search - * Last Updated: $Date: 2013-03-20 10:14:51 -0400 (Wed, 20 Mar 2013) $ - * - * - * @author $Author: mmecham $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/company/standards.php#license - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 12094 $ - */ - -if ( ! defined( 'IN_IPB' ) ) -{ - print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -class public_core_search_search extends ipsCommand -{ - /** - * Generated output - * - * @var string - */ - protected $output = ''; - - /** - * Page Title - * - * @var string - */ - protected $title = ''; - - /** - * Object to handle searches - * - * @var string - */ - protected $search_plugin = ''; - - /** - * Topics array - * - * @var array - */ - protected $_topicArray = array(); - protected $_removedTerms = array(); - - /** - * Search controller - * - * @var obj - */ - protected $searchController; - protected $_session; - - /** - * Class entry point - * - * @param object Registry reference - * @return @e void [Outputs to screen/redirects] - */ - public function doExecute( ipsRegistry $registry ) - { - /* Load language */ - $this->registry->class_localization->loadLanguageFile( array( 'public_search' ), 'core' ); - $this->registry->class_localization->loadLanguageFile( array( 'public_forums', 'public_topic' ), 'forums' ); - - /* Reset engine type */ - $this->settings['search_method'] = ( $this->settings['search_method'] == 'traditional' ) ? 'sql' : $this->settings['search_method']; - - /* Force SQL for view new content? */ - if ( ! empty( $this->settings['force_sql_vnc'] ) && $this->request['do'] == 'viewNewContent' ) - { - $this->settings['search_method'] = 'sql'; - } - - $this->request['search_app_filters'] = $this->_cleanInputFilters( $this->request['search_app_filters'] ); - - /* Special consideration for contextual search */ - if ( isset( $this->request['search_app'] ) AND strstr( $this->request['search_app'], ':' ) ) - { - list( $app, $type, $id ) = explode( ':', $this->request['search_app'] ); - - $this->request['search_app'] = $app; - $this->request['cType'] = $type; - $this->request['cId'] = $id; - } - else - { - /* Force forums as default search */ - $this->request['search_in'] = ( $this->request['search_in'] AND IPSLib::appIsSearchable( $this->request['search_in'], 'search' ) ) ? $this->request['search_in'] : 'forums'; - $this->request['search_app'] = $this->request['search_app'] ? $this->request['search_app'] : $this->request['search_in']; - } - - /* Check Access */ - $this->_canSearch(); - - /* Start session - needs to be called before the controller is initiated */ - $this->_startSession(); - - /* Load the controller */ - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH. 'sources/classes/search/controller.php', 'IPSSearch' ); - - /* Sanitzie */ - if ( ! is_string( $this->request['search_app'] ) ) - { - $this->request['search_app'] = 'forums'; - } - - try - { - $this->searchController = new $classToLoad( $registry, $this->settings['search_method'], $this->request['search_app'] ); - } - catch( Exception $error ) - { - $msg = $error->getMessage(); - - /* Start session */ - $this->_endSession(); - - switch( $msg ) - { - case 'NO_SUCH_ENGINE': - case 'NO_SUCH_APP': - case 'NO_SUCH_APP_ENGINE': - $this->registry->output->showError( sprintf( $this->lang->words['no_search_app'], ipsRegistry::$applications[ $this->request['search_app'] ]['app_title'] ), 10145.1 ); - break; - } - } - - /* Log type */ - IPSDebug::addMessage( "Search type: " . $this->settings['search_method'] ); - - /* Set up some defaults */ - IPSSearchRegistry::set('opt.noPostPreview', false ); - IPSSearchRegistry::set('in.start', intval( $this->request['st'] ) ); - IPSSearchRegistry::set('opt.search_per_page', intval( $this->settings['search_per_page'] ) ? intval( $this->settings['search_per_page'] ) : 25 ); - - $this->settings['search_ucontent_days'] = ( $this->settings['search_ucontent_days'] ) ? $this->settings['search_ucontent_days'] : 365; - - /* Contextuals */ - if ( isset( $this->request['cType'] ) ) - { - IPSSearchRegistry::set('contextual.type', $this->request['cType'] ); - IPSSearchRegistry::set('contextual.id' , $this->request['cId'] ); - } - - - - /* What to do */ - switch( $this->request['do'] ) - { - case 'user_activity': - $this->viewUserContent(); - break; - - case 'new_posts': - case 'viewNewContent': - case 'active': - $this->viewNewContent(); - break; - - case 'search': - case 'quick_search': - $this->searchResults(); - break; - - case 'followed': - $this->viewFollowedContent(); - break; - - case 'manageFollowed': - $this->updateFollowedContent(); - break; - - default: - case 'search_form': - $this->searchAdvancedForm(); - break; - } - - /* Start session */ - $this->_endSession(); - - /* If we have any HTML to print, do so... */ - if ( $this->request['do'] == 'search' && ! empty( $this->request['search_tags'] ) ) - { - $this->registry->output->setTitle( IPSText::urldecode_furlSafe( $this->request['search_tags'] ) . ' - ' . $this->lang->words['st_tags'] . ' - ' . IPSLib::getAppTitle( $this->request['search_app'] ) . ' - ' . ipsRegistry::$settings['board_name'] ); - - /* Add canonical tag */ - $extra = ( $this->request['st'] ) ? '&st=' . $this->request['st'] : ''; - $this->registry->output->addCanonicalTag( 'app=core&module=search&do=search&search_tags=' . IPSText::urlencode_furlSafe( $this->request['search_tags'] ) . '&search_app=' . $this->request['search_app']. $extra, $this->request['search_tags'], 'tags' ); - } - else - { - $this->registry->output->setTitle( $this->title . ' - ' . ipsRegistry::$settings['board_name'] ); - } - - $this->registry->output->addContent( $this->output ); - $this->registry->output->sendOutput(); - } - - /** - * Moderate your list of liked content - * - * @author bfarber - * @return string HTML to display - */ - public function updateFollowedContent() - { - IPSSearchRegistry::set( 'in.search_app', $this->request['search_app'] ); - - //----------------------------------------- - // Get the likes we selected - //----------------------------------------- - - $_likes = array(); - - if( is_array($this->request['likes']) AND count($this->request['likes']) ) - { - foreach( $this->request['likes'] as $_like ) - { - $_thisLike = explode( '-', $_like ); - $_likes[] = array( - 'app' => $_thisLike[0], - 'area' => $_thisLike[1], - 'id' => $_thisLike[2], - ); - } - } - - //----------------------------------------- - // Got any? - //----------------------------------------- - - if( !count($_likes) OR !is_array($_likes) ) - { - return $this->viewFollowedContent( $this->lang->words['no_likes_for_del'] ); - } - - //----------------------------------------- - // Get like helper class - //----------------------------------------- - - $bootstraps = array(); - - require_once( IPS_ROOT_PATH . 'sources/classes/like/composite.php' );/*noLibHook*/ - - //----------------------------------------- - // Loop over and moderate - //----------------------------------------- - - foreach( $_likes as $_like ) - { - $_bootstrap = classes_like::bootstrap( $_like['app'], $_like['area'] ); - $_likeKey = classes_like_registry::getKey( $_like['id'], $this->memberData['member_id'] ); - $_frequencies = $_bootstrap->allowedFrequencies(); - - //----------------------------------------- - // What action to take? - //----------------------------------------- - - switch( $this->request['modaction'] ) - { - case 'delete': - $_bootstrap->remove( $_like['id'], $this->memberData['member_id'] ); - break; - - case 'change-donotify': - $this->DB->update( 'core_like', array( 'like_notify_do' => 1, 'like_notify_freq' => 'immediate' ), "like_id='" . addslashes($_likeKey) . "'" ); - break; - - case 'change-donotnotify': - $this->DB->update( 'core_like', array( 'like_notify_do' => 0 ), "like_id='" . addslashes($_likeKey) . "'" ); - break; - - case 'change-immediate': - if( in_array( 'immediate', $_frequencies ) ) - { - $this->DB->update( 'core_like', array( 'like_notify_do' => 1, 'like_notify_freq' => 'immediate' ), "like_id='" . addslashes($_likeKey) . "'" ); - } - break; - - case 'change-offline': - if( in_array( 'offline', $_frequencies ) ) - { - $this->DB->update( 'core_like', array( 'like_notify_do' => 1, 'like_notify_freq' => 'offline' ), "like_id='" . addslashes($_likeKey) . "'" ); - } - break; - - case 'change-daily': - if( in_array( 'daily', $_frequencies ) ) - { - $this->DB->update( 'core_like', array( 'like_notify_do' => 1, 'like_notify_freq' => 'daily' ), "like_id='" . addslashes($_likeKey) . "'" ); - } - break; - - case 'change-weekly': - if( in_array( 'weekly', $_frequencies ) ) - { - $this->DB->update( 'core_like', array( 'like_notify_do' => 1, 'like_notify_freq' => 'weekly' ), "like_id='" . addslashes($_likeKey) . "'" ); - } - break; - - case 'change-anon': - $this->DB->update( 'core_like', array( 'like_is_anon' => 1 ), "like_id='" . addslashes($_likeKey) . "'" ); - break; - - case 'change-noanon': - $this->DB->update( 'core_like', array( 'like_is_anon' => 0 ), "like_id='" . addslashes($_likeKey) . "'" ); - break; - default: - return $this->viewFollowedContent( $this->lang->words['likes_no_action'] ); - break; - } - } - - $this->registry->getClass('output')->silentRedirect( $this->settings['base_url']."app=core&module=search&do=followed&search_app={$this->request['search_app']}&contentType={$this->request['contentType']}&confirm=1" ); - } - - /** - * View content you are following - * - * @author Brandon Farber - * @param string $error Error message - * @return @e void - */ - public function viewFollowedContent( $error='' ) - { - IPSSearchRegistry::set( 'in.search_app', $this->request['search_app'] ); - IPSSearchRegistry::set( 'opt.searchType', 'titles' ); - IPSSearchRegistry::set( 'opt.noPostPreview', true ); - - $results = array(); - $formatted = array(); - $count = 0; - - //----------------------------------------- - // Determine content type - //----------------------------------------- - - $contentTypes = IPSSearchRegistry::get('config.followContentTypes'); - - //----------------------------------------- - // Verify likes are available - //----------------------------------------- - - if( count( IPSLib::getEnabledApplications('like') ) AND count( $contentTypes ) AND IPSLib::appIsInstalled( IPSSearchRegistry::get('in.search_app'), true ) ) - { - //----------------------------------------- - // What content type? - //----------------------------------------- - - $_type = ''; - - if( $this->request['contentType'] AND in_array( $this->request['contentType'], $contentTypes ) ) - { - $_type = $this->request['contentType']; - } - else - { - $_type = $contentTypes[0]; - } - - $this->request['contentType'] = $_type; - - IPSSearchRegistry::set( 'in.followContentType', $this->request['contentType'] ); - - /* Fetch like class */ - try - { - require_once( IPS_ROOT_PATH . 'sources/classes/like/composite.php' );/*noLibHook*/ - $this->_like = classes_like::bootstrap( IPSSearchRegistry::get('in.search_app'), $_type ); - } - catch ( Exception $e) - { - /* Fail safe... */ - $this->registry->output->addNavigation( $this->lang->words['followed_ct_title'], '' ); - $this->title = $this->lang->words['followed_ct_title']; - $this->output .= $this->registry->output->getTemplate( 'search' )->followedContentView( array(), '', 0, $error, $contentTypes ); - } - - /* Do we have some custom join and sort data? */ - if ( method_exists( $this->_like, 'getSearchJoinAndSortBy' ) ) - { - $custom = $this->_like->getSearchJoinAndSortBy(); - - $countQ = array( 'select' => 'COUNT(*) as er', - 'from' => array( 'core_like' => 'l' ), - 'where' => 'like_member_id=' . $this->memberData['member_id'] . " AND like_visible=1 AND like_app='" . IPSSearchRegistry::get('in.search_app') . "' AND like_area='" . $_type . "'" ); - if ( $custom['from'] ) - { - $countQ['add_join'][] = array( 'from' => $custom['from'], 'where' => $custom['where'] ); - } - if ( $custom['order'] ) - { - $countQ['order'] = $custom['order'] . ' DESC'; - } - if ( $custom['extraWhere'] ) - { - $countQ['where'] .= ' AND ' . $custom['extraWhere']; - } - $count = $this->DB->buildAndFetch( $countQ ); - $count = $count['er']; - - $q = array( 'select' => 'l.*', - 'from' => array('core_like' => 'l'), - 'where' => 'l.like_member_id=' . $this->memberData['member_id'] . " AND l.like_visible=1 AND l.like_app='" . IPSSearchRegistry::get('in.search_app') . "' AND l.like_area='" . $_type . "'", - 'limit' => array( IPSSearchRegistry::get('in.start'), IPSSearchRegistry::get('opt.search_per_page') ), - 'order' => 'like_added DESC' - ); - - if ( $custom['from'] ) - { - $q['add_join'][] = array( 'from' => $custom['from'], 'where' => $custom['where'] ); - } - if ( $custom['order'] ) - { - $q['order'] = $custom['order'] . ' DESC'; - } - if ( $custom['extraWhere'] ) - { - $q['where'] .= ' AND ' . $custom['extraWhere']; - } - - $this->DB->build( $q ); - } - else - { - $count = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as er', - 'from' => 'core_like', - 'where' => 'like_member_id=' . $this->memberData['member_id'] . " AND like_visible=1 AND like_app='" . IPSSearchRegistry::get('in.search_app') . "' AND like_area='" . $_type . "'" ) ); - $count = $count['er']; - - $this->DB->build( array( 'select' => '*', - 'from' => 'core_like', - 'where' => 'like_member_id=' . $this->memberData['member_id'] . " AND like_visible=1 AND like_app='" . IPSSearchRegistry::get('in.search_app') . "' AND like_area='" . $_type . "'", - 'limit' => array( IPSSearchRegistry::get('in.start'), IPSSearchRegistry::get('opt.search_per_page') ), - 'order' => 'like_added DESC' ) ); - } - - $outer = $this->DB->execute(); - - while( $r = $this->DB->fetch($outer) ) - { - $results[] = $r['like_rel_id']; - - $formatted[ $r['like_id'] ] = $r; - } - - /* Process */ - $results = $this->searchController->fetchFollowedContentOutput( $results, $formatted ); - - $pages = $this->registry->getClass('output')->generatePagination( array( 'totalItems' => $count, - 'itemsPerPage' => IPSSearchRegistry::get('opt.search_per_page'), - 'currentStartValue' => IPSSearchRegistry::get('in.start'), - 'baseUrl' => "app=core&module=search&do=followed&search_app=" . IPSSearchRegistry::get('in.search_app') . '&sid=' . $this->request['_sid'] . "&contentType=" . $this->request['contentType'] ) ); - } - else - { - $count = 0; - $results = array(); - } - - /* Output */ - $this->registry->output->addNavigation( $this->lang->words['followed_ct_title'], '' ); - $this->title = $this->lang->words['followed_ct_title']; - $this->output .= $this->registry->output->getTemplate( 'search' )->followedContentView( $results, $pages, $count, $error, $contentTypes ); - } - - /** - * Builds the advanced search form - * - * @param string Message - * @return @e void - */ - public function searchAdvancedForm( $msg='', $removed_search_terms=array() ) - { - /* Set up data */ - IPSSearchRegistry::set('view.search_form', true ); - - /* Get any application specific filters */ - $appHtml = $this->searchController->getHtml(); - $isBoolean = $this->searchController->isBoolean(); - $tagSupport = $this->searchController->getTagSupport(); - - /* Output */ - $this->title = $this->lang->words['search_form']; - $this->registry->output->addNavigation( $this->lang->words['search_form'], '' ); - $this->output .= $this->registry->output->getTemplate( 'search' )->searchAdvancedForm( $appHtml, $msg, $this->request['search_app'], $removed_search_terms, $isBoolean, $tagSupport ); - } - - /** - * Processes a search request - * - * @return @e void - */ - public function searchResults() - { - /* Search Term */ - if( isset( $this->request['search_term'] ) && !is_string( $this->request['search_term'] ) ) - { - $this->registry->getClass('output')->showError( 'invalid_search_term', 10312564 ); - } - - $_st = $this->searchController->formatSearchTerm( trim( $this->request['search_term'] ) ); - $search_term = $_st['search_term']; - $removedTerms = $_st['removed']; - - /* Set up some defaults */ - $this->settings['max_search_word'] = $this->settings['max_search_word'] ? $this->settings['max_search_word'] : 300; - - /* Did we come in off a post request? */ - if ( $this->request['request_method'] == 'post' ) - { - /* Set a no-expires header */ - $this->registry->getClass('output')->setCacheExpirationSeconds( 30 * 60 ); - } - - if ( is_array( $this->request['search_app_filters'] ) ) - { - array_walk_recursive( $this->request['search_app_filters'], create_function('&$item, $key', '$item = IPSText::htmlspecialchars($item);' ) ); - } - - /* App specific */ - if ( isset( $this->request['search_sort_by_' . $this->request['search_app'] ] ) ) - { - $this->request['search_sort_by'] = ( $_POST[ 'search_sort_by_' . $this->request['search_app'] ] ) ? htmlspecialchars( $_POST[ 'search_sort_by_' . $this->request['search_app'] ] ) : $this->request['search_sort_by_' . $this->request['search_app'] ]; - $this->request['search_sort_order'] = ( $_POST[ 'search_sort_order_' . $this->request['search_app'] ] ) ? htmlspecialchars( $_POST[ 'search_sort_order_' . $this->request['search_app'] ] ) : $this->request['search_sort_order_' . $this->request['search_app'] ]; - } - - /* Populate the registry */ - IPSSearchRegistry::set('in.search_app' , $this->request['search_app'] ); - IPSSearchRegistry::set('in.raw_search_term' , trim( $this->request['search_term'] ) ); - IPSSearchRegistry::set('in.clean_search_term', $search_term ); - IPSSearchRegistry::set('in.raw_search_tags' , str_replace( '&', '&', trim( IPSText::parseCleanValue( IPSText::urldecode_furlSafe( $_REQUEST['search_tags'] ) ) ) ) ); - IPSSearchRegistry::set('in.search_higlight' , str_replace( '.', '', $this->request['search_term'] ) ); - IPSSearchRegistry::set('in.search_date_end' , ( $this->request['search_date_start'] && $this->request['search_date_end'] ) ? $this->request['search_date_end'] : 'now' ); - IPSSearchRegistry::set('in.search_date_start', ( $this->request['search_date_start'] ) ? $this->request['search_date_start'] : '' ); - IPSSearchRegistry::set('in.search_author' , !empty( $this->request['search_author'] ) ? $this->request['search_author'] : '' ); - - /* Set sort filters */ - $this->_setSortFilters(); - - /* These can be overridden in the actual engine scripts */ - // IPSSearchRegistry::set('set.hardLimit' , 0 ); - IPSSearchRegistry::set('set.resultsCutToLimit', false ); - IPSSearchRegistry::set('set.resultsAsForum' , false ); - - /* Are we option to show titles only / search in titles only */ - IPSSearchRegistry::set('opt.searchType', ( !empty( $this->request['search_content'] ) AND in_array( $this->request['search_content'], array( 'both', 'titles', 'content' ) ) ) ? $this->request['search_content'] : 'both' ); - - /* Time check */ - if ( IPSSearchRegistry::get('in.search_date_start') AND strtotime( IPSText::monthNameRu2En(IPSSearchRegistry::get('in.search_date_start')) ) > time() ) - { - IPSSearchRegistry::set('in.search_date_start', 'now' ); - } - - if ( IPSSearchRegistry::get('in.search_date_end') AND strtotime( IPSText::monthNameRu2En(IPSSearchRegistry::get('in.search_date_end')) ) > time() ) - { - IPSSearchRegistry::set('in.search_date_end', 'now' ); - } - - /* Do some date checking */ - if( IPSSearchRegistry::get('in.search_date_end') AND IPSSearchRegistry::get('in.search_date_start') AND strtotime( IPSText::monthNameRu2En(IPSSearchRegistry::get('in.search_date_start')) ) > strtotime( IPSText::monthNameRu2En(IPSSearchRegistry::get('in.search_date_end')) ) ) - { - $this->searchAdvancedForm( $this->lang->words['search_invalid_date_range'] ); - return; - } - - /** - * Lower limit - */ - if ( $this->settings['min_search_word'] && ! IPSSearchRegistry::get('in.search_author') && ! IPSSearchRegistry::get('in.raw_search_tags') ) - { - if ( $this->settings['search_method'] == 'sphinx' && substr_count( $search_term, '"' ) >= 2 ) - { - $_ok = true; - } - else - { - $_words = explode( ' ', preg_replace( "#\"(.*?)\"#", '', $search_term ) ); - $_ok = $search_term ? true : false; - - foreach( $_words as $_word ) - { - $_word = preg_replace( '#^\+(.+?)$#', "\\1", $_word ); - - if ( ! $_word OR $_word == '|' ) - { - continue; - } - - if( strlen( $_word ) < $this->settings['min_search_word'] ) - { - $_ok = false; - break; - } - } - } - - if( ! $_ok ) - { - $this->searchAdvancedForm( sprintf( $this->lang->words['search_term_short'], $this->settings['min_search_word'] ), $removedTerms ); - return; - } - } - - /** - * Ok this is an upper limit. - * If you needed to change this, you could do so via conf_global.php by adding: - * $INFO['max_search_word'] = #####; - */ - if ( $this->settings['max_search_word'] && strlen( IPSSearchRegistry::get('in.raw_search_term') ) > $this->settings['max_search_word'] ) - { - $this->searchAdvancedForm( sprintf( $this->lang->words['search_term_long'], $this->settings['max_search_word'] ) ); - return; - } - - /* Search Flood Check */ - if( $this->memberData['g_search_flood'] ) - { - /* Check for a cookie */ - $last_search = IPSCookie::get( 'sfc' ); - $last_term = str_replace( """, '"', IPSCookie::get( 'sfct' ) ); - $last_term = str_replace( "&", '&', $last_term ); - - /* If we have a last search time, check it */ - if( $last_search && $last_term ) - { - if( ( time() - $last_search ) <= $this->memberData['g_search_flood'] && $last_term != IPSSearchRegistry::get('in.raw_search_term') ) - { - $this->searchAdvancedForm( sprintf( $this->lang->words['xml_flood'], $this->memberData['g_search_flood'] - ( time() - $last_search ) ) ); - return; - } - else - { - /* Reset the cookie */ - IPSCookie::set( 'sfc', time() ); - IPSCookie::set( 'sfct', urlencode( IPSSearchRegistry::get('in.raw_search_term') ) ); - } - } - /* Set the cookie */ - else - { - IPSCookie::set( 'sfc', time() ); - IPSCookie::set( 'sfct', urlencode( IPSSearchRegistry::get('in.raw_search_term') ) ); - } - } - - /* Clean search term for results view */ - $_search_term = trim( preg_replace( '#(^|\s)(\+|\-|\||\~)#', " ", $search_term ) ); - - /* Got tag search only but app doesn't support tags */ - if ( IPSSearchRegistry::get('in.raw_search_tags') && ! IPSSearchRegistry::get( 'config.can_searchTags' ) && ! IPSSearchRegistry::get('in.raw_search_term') ) - { - $count = 0; - $results = array(); - } - else if ( IPSLib::appIsSearchable( IPSSearchRegistry::get('in.search_app'), 'search' ) ) - { - /* Perform the search */ - $this->searchController->search(); - - /* Get count */ - $count = $this->searchController->getResultCount(); - - /* Get results which will be array of IDs */ - $results = $this->searchController->getResultSet(); - - /* Get templates to use */ - $template = $this->searchController->fetchTemplates(); - - /* Fetch sort details */ - $sortDropDown = $this->searchController->fetchSortDropDown(); - - /* Set default sort option */ - $_a = IPSSearchRegistry::get('in.search_app'); - $_k = IPSSearchRegistry::get( $_a . '.searchInKey') ? IPSSearchRegistry::get( $_a . '.searchInKey') : ''; - - if( $_k AND !$this->request['search_app_filters'][ $_a ][ $_k ]['sortKey'] AND is_array($sortDropDown) AND count($sortDropDown) ) - { - $this->request['search_app_filters'][ $_a ][ $_k ]['sortKey'] = key( $sortDropDown ); - } - else if( !$_k AND !$this->request['search_app_filters'][ $_a ]['sortKey'] AND is_array($sortDropDown) AND count($sortDropDown) ) - { - $this->request['search_app_filters'][ $_a ]['sortKey'] = key( $sortDropDown ); - } - - /* Fetch sort details */ - $sortIn = $this->searchController->fetchSortIn(); - - /* Build pagination */ - $links = $this->registry->output->generatePagination( array( 'totalItems' => $count, - 'itemsPerPage' => IPSSearchRegistry::get('opt.search_per_page'), - 'currentStartValue'=> IPSSearchRegistry::get('in.start'), - 'baseUrl' => $this->_buildURLString() . '&search_app=' . IPSSearchRegistry::get('in.search_app') ) ); - - /* Showing */ - $showing = array( 'start' => IPSSearchRegistry::get('in.start') + 1, 'end' => ( IPSSearchRegistry::get('in.start') + IPSSearchRegistry::get('opt.search_per_page') ) > $count ? $count : IPSSearchRegistry::get('in.start') + IPSSearchRegistry::get('opt.search_per_page') ); - - /* Parse result set */ - $results = $this->registry->output->getTemplate( $template['group'] )->$template['template']( $results, ( IPSSearchRegistry::get('opt.searchType') == 'titles' || IPSSearchRegistry::get('opt.noPostPreview') ) ? 1 : 0 ); - - /* Check for sortIn */ - if( count( $sortIn ) && !$this->request['search_app_filters'][ $this->request['search_app'] ]['searchInKey'] ) - { - $this->request['search_app_filters'][ $this->request['search_app'] ]['searchInKey'] = $sortIn[0][0]; - } - } - else - { - $count = 0; - $results = array(); - } - - /* Output */ - $this->title = $this->lang->words['search_results']; - $this->output .= $this->registry->output->getTemplate( 'search' )->searchResultsWrapper( $results, $sortDropDown, $sortIn, $links, $count, $showing, $_search_term, $this->_buildURLString(), $this->request['search_app'], $removedTerms, IPSSearchRegistry::get('set.hardLimit'), IPSSearchRegistry::get('set.resultsCutToLimit'), IPSSearchRegistry::get('in.raw_search_tags') ); - } - - /** - * Starts session - * Loads / creates a session based on activity - * - * @return - */ - protected function _startSession() - { - $session_id = IPSText::md5Clean( $this->request['sid'] ); - $requestType = ( $this->request['request_method'] == 'post' ) ? 'post' : 'get'; - - if ( $session_id ) - { - /* We check on member id 'cos we can. Obviously guests will have a member ID of zero, but meh */ - $this->_session = $this->DB->buildAndFetch( array( 'select' => '*', - 'from' => 'search_sessions', - 'where' => 'session_id=\'' . $session_id . '\' AND session_member_id=' . $this->memberData['member_id'] ) ); - } - - /* Deflate */ - if ( $this->_session['session_id'] ) - { - if ( $this->_session['session_data'] ) - { - $this->_session['_session_data'] = unserialize( $this->_session['session_data'] ); - - if ( isset( $this->_session['_session_data']['search_app_filters'] ) ) - { - $this->request['search_app_filters'] = is_array( $this->request['search_app_filters'] ) ? array_merge( $this->_session['_session_data']['search_app_filters'], $this->request['search_app_filters'] ) : $this->_session['_session_data']['search_app_filters']; - } - } - - IPSDebug::addMessage( "Loaded search session:
    " . var_export( $this->_session['_session_data'], true ) . "
    " ); - } - else - { - /* Create a session */ - $this->_session = array( 'session_id' => md5( uniqid( microtime(), true ) ), - 'session_created' => time(), - 'session_updated' => time(), - 'session_member_id' => $this->memberData['member_id'], - 'session_data' => serialize( array( 'search_app_filters' => $this->request['search_app_filters'] ) ) ); - - $this->DB->insert( 'search_sessions', $this->_session ); - - $this->_session['_session_data']['search_app_filters'] = $this->request['search_app_filters']; - - IPSDebug::addMessage( "Created search session:
    " . var_export( $this->_session['_session_data'], true ) . "
    " ); - } - - /* Do we have POST infos? */ - if ( isset( $_POST['search_app_filters'] ) ) - { - $this->_session['_session_data']['search_app_filters'] = ( is_array( $this->_session['_session_data']['search_app_filters'] ) ) ? IPSLib::arrayMergeRecursive( $this->_session['_session_data']['search_app_filters'], $_POST['search_app_filters'] ) : $_POST['search_app_filters']; - $this->request['search_app_filters'] = $this->_session['_session_data']['search_app_filters']; - - IPSDebug::addMessage( "Updated filters:
    " . var_export( $_POST['search_app_filters'], true ) . "
    " ); - } - - /* Globalize the session ID */ - $this->request['_sid'] = $this->_session['session_id']; - } - - /** - * End the session - * - */ - protected function _endSession() - { - if ( $this->_session['session_id'] ) - { - $sd = array( 'session_updated' => time(), - 'session_data' => serialize( $this->_session['_session_data'] ) ); - - $this->DB->update( 'search_sessions', $sd, 'session_id=\'' . $this->_session['session_id'] . '\'' ); - } - - /* Delete old sessions */ - $this->DB->delete( 'search_sessions', 'session_updated < ' . ( time() - 86400 ) ); - } - - /** - * Set the search order and key - * - * @return @e void - */ - protected function _setSortFilters() - { - $app = $this->request['search_app']; - $key = 'date'; - $dir = 'desc'; - $dun = false; - - /* multi search in options? */ - if ( isset( $this->request['search_app_filters'][ $app ]['searchInKey'] ) ) - { - $_k = $this->request['search_app_filters'][ $app ]['searchInKey']; - - if ( isset( $this->request['search_app_filters'][ $app ][ $_k ]['sortKey'] ) ) - { - $dun = true; - $key = $this->request['search_app_filters'][ $app ][ $_k ]['sortKey']; - $dir = $this->request['search_app_filters'][ $app ][ $_k ]['sortDir']; - } - } - - /* Normal options - although sometimes used even with multiple types */ - if ( ! $dun AND isset( $this->request['search_app_filters'][$app]['sortKey'] ) ) - { - $key = $this->request['search_app_filters'][$app]['sortKey']; - $dir = $this->request['search_app_filters'][$app]['sortDir']; - } - /* Global */ - else - { - if ( isset( $this->request['search_sort_by'] ) ) - { - $key = $this->request['search_sort_by']; - $dir = $this->request['search_sort_order']; - } - } - - /* Valid search key? */ - if( !is_string( $key ) ) - { - $this->registry->getClass('output')->showError( 'invalid_search_key', 10312565 ); - } - - /* Numeric? */ - if ( is_numeric( $dir ) ) - { - $dir = ( $dir == 0 ) ? 'desc' : 'asc'; - } - else - { - $dir = 'desc'; - } - - IPSSearchRegistry::set('in.search_sort_by' , trim( $key ) ); - IPSSearchRegistry::set('in.search_sort_order', ( $dir != 'desc' ) ? 'asc' : 'desc' ); - } - - /** - * Displays latest user content - * - * @return @e void - */ - public function viewUserContent() - { - - /* INIT */ - $id = $this->request['mid'] ? intval( trim( $this->request['mid'] ) ) : $this->memberData['member_id']; - - /* Save query if we are viewing our own content */ - if( $this->memberData['member_id'] AND $id == $this->memberData['member_id'] ) - { - $member = $this->memberData; - } - else - { - $member = IPSMember::load( $id, 'core' ); - } - - $beginStamp = 0; - - if ( ! $member['member_id'] ) - { - $this->registry->output->showError( 'search_invalid_id', 10147, null, null, 403 ); - } - - $this->request['userMode'] = !empty($this->request['userMode']) ? $this->request['userMode'] : 'all'; - - IPSSearchRegistry::set('in.search_app', $this->request['search_app'] ); - IPSSearchRegistry::set('in.userMode' , $this->request['userMode'] ); - - /* Set sort filters */ - $this->_setSortFilters(); - - /* Can we do this? */ - if ( IPSLib::appIsSearchable( IPSSearchRegistry::get('in.search_app'), 'usercontent' ) ) - { - /* Perform the search */ - $this->searchController->viewUserContent( $member ); - - /* Get count */ - $count = $this->searchController->getResultCount(); - - /* Get results which will be array of IDs */ - $results = $this->searchController->getResultSet(); - - /* Get templates to use */ - $template = $this->searchController->fetchTemplates(); - - /* Fetch sort details */ - $sortDropDown = $this->searchController->fetchSortDropDown(); - - /* Set default sort option */ - $_a = IPSSearchRegistry::get('in.search_app'); - $_k = IPSSearchRegistry::get( $_a . '.searchInKey') ? IPSSearchRegistry::get( $_a . '.searchInKey') : ''; - - if( $_k AND !$this->request['search_app_filters'][ $_a ][ $_k ]['sortKey'] AND is_array($sortDropDown) ) - { - $this->request['search_app_filters'][ $_a ][ $_k ]['sortKey'] = key( $sortDropDown ); - } - else if( !$_k AND !$this->request['search_app_filters'][ $_a ]['sortKey'] AND is_array($sortDropDown) ) - { - $this->request['search_app_filters'][ $_a ]['sortKey'] = key( $sortDropDown ); - } - - /* Fetch sort details */ - $sortIn = $this->searchController->fetchSortIn(); - - /* Reset for template */ - $this->_resetRequestParameters(); - - /* Parse result set */ - $results = $this->registry->output->getTemplate( $template['group'] )->$template['template']( $results, ( IPSSearchRegistry::get('opt.searchType') == 'titles' || IPSSearchRegistry::get('opt.noPostPreview') ) ? 1 : 0 ); - - /* Build pagination */ - $links = $this->registry->output->generatePagination( array( 'totalItems' => $count, - 'itemsPerPage' => IPSSearchRegistry::get('opt.search_per_page'), - 'currentStartValue' => IPSSearchRegistry::get('in.start'), - 'baseUrl' => 'app=core&module=search&do=user_activity&mid=' . $id . '&search_app=' . IPSSearchRegistry::get('in.search_app') . '&userMode=' . IPSSearchRegistry::get('in.userMode') . '&sid=' . $this->request['_sid'] . $this->_returnSearchAppFilters() ) ); - } - else - { - $count = 0; - $results = array(); - } - - $this->title = sprintf( $this->lang->words['s_participation_title'], $member['members_display_name'] ); - $this->registry->output->addNavigation( $this->title, '' ); - $this->output .= $this->registry->output->getTemplate( 'search' )->userPostsView( $results, $links, $count, $member, IPSSearchRegistry::get('set.hardLimit'), IPSSearchRegistry::get('set.resultsCutToLimit'), $beginStamp, $sortIn, $sortDropDown ); - } - - /** - * View new posts since your last visit - * - * @return @e void - */ - public function viewNewContent() - { - - IPSSearchRegistry::set('in.search_app', $this->request['search_app'] ); - - /* Fetch member cache to see if we have a value set */ - $vncPrefs = IPSMember::getFromMemberCache( $this->memberData, 'vncPrefs' ); - - /* Guests */ - if ( ! $this->memberData['member_id'] AND ( ! $this->request['period'] OR $this->request['period'] == 'unread' ) ) - { - $this->request['period'] = 'today'; - } - - /* In period */ - if ( $vncPrefs === null OR ! isset( $vncPrefs[ IPSSearchRegistry::get('in.search_app') ]['view'] ) OR ( ! empty( $this->request['period'] ) AND isset( $this->request['change'] ) ) ) - { - $vncPrefs[ IPSSearchRegistry::get('in.search_app') ]['view'] = ( ! empty( $this->request['period'] ) ) ? $this->request['period'] : $this->settings['default_vnc_method']; - } - - /* Follow filter enabled */ - if ( $vncPrefs === null OR ! isset( $vncPrefs[ IPSSearchRegistry::get('in.search_app') ]['view'] ) OR isset( $this->request['followedItemsOnly'] ) ) - { - $vncPrefs[ IPSSearchRegistry::get('in.search_app') ]['vncFollowFilter'] = ( ! empty( $this->request['followedItemsOnly'] ) ) ? 1 : 0; - } - - /* Filtering VNC by forum? */ - IPSSearchRegistry::set('forums.vncForumFilters', $vncPrefs['forums']['vnc_forum_filter'] ); - - /* Set period up */ - IPSSearchRegistry::set('in.period' , $vncPrefs[ IPSSearchRegistry::get('in.search_app') ]['view'] ); - IPSSearchRegistry::set('in.vncFollowFilterOn', $vncPrefs[ IPSSearchRegistry::get('in.search_app') ]['vncFollowFilter'] ); - - $this->request['userMode'] = !empty($this->request['userMode']) ? $this->request['userMode'] : ''; - IPSSearchRegistry::set('in.userMode' , $this->request['userMode'] ); - - /* Update member cache */ - if ( isset( $this->request['period'] ) AND isset( $this->request['change'] ) ) - { - IPSMember::setToMemberCache( $this->memberData, array( 'vncPrefs' => $vncPrefs ) ); - } - - IPSDebug::addMessage( var_export( $vncPrefs, true ) ); - IPSDebug::addMessage( 'Using: ' . IPSSearchRegistry::get('in.period') ); - - /* Can we do this? */ - if ( IPSLib::appIsSearchable( IPSSearchRegistry::get('in.search_app'), 'vnc' ) || IPSLib::appIsSearchable( IPSSearchRegistry::get('in.search_app'), 'active' ) ) - { - /* Can't do a specific unread search, so */ - if ( IPSSearchRegistry::get('in.period') == 'unread' && ! IPSLib::appIsSearchable( IPSSearchRegistry::get('in.search_app'), 'vncWithUnreadContent' ) ) - { - IPSSearchRegistry::set( 'in.period', 'lastvisit' ); - } - - /* Perform the search */ - $this->searchController->viewNewContent(); - - /* Get count */ - $count = $this->searchController->getResultCount(); - - /* Get results which will be array of IDs */ - $results = $this->searchController->getResultSet(); - - /* Get templates to use */ - $template = $this->searchController->fetchTemplates(); - - /* Fetch sort details */ - $sortDropDown = $this->searchController->fetchSortDropDown(); - - /* Fetch sort details */ - $sortIn = $this->searchController->fetchSortIn(); - - /* Reset for template */ - $this->_resetRequestParameters(); - - if( IPSSearchRegistry::get('in.start') > 0 AND !count($results) ) - { - $new_url = 'app=core&module=search&do=viewNewContent&period=' . IPSSearchRegistry::get('in.period') . '&userMode=' . IPSSearchRegistry::get('in.userMode') . '&search_app=' . IPSSearchRegistry::get('in.search_app') . '&sid=' . $this->request['_sid']; - $new_url .= '&st=' . ( IPSSearchRegistry::get('in.start') - IPSSearchRegistry::get('opt.search_per_page') ) . '&search_app_filters[' . IPSSearchRegistry::get('in.search_app') . '][searchInKey]=' . $this->request['search_app_filters'][ IPSSearchRegistry::get('in.search_app') ]['searchInKey']; - - $this->registry->output->silentRedirect( $this->settings['base_url'] . $new_url ); - } - - /* Parse result set */ - $results = $this->registry->output->getTemplate( $template['group'] )->$template['template']( $results, ( IPSSearchRegistry::get('opt.searchType') == 'titles' || IPSSearchRegistry::get('opt.noPostPreview') ) ? 1 : 0 ); - - /* Build pagination */ - $links = $this->registry->output->generatePagination( array( 'totalItems' => $count, - 'itemsPerPage' => IPSSearchRegistry::get('opt.search_per_page'), - 'currentStartValue' => IPSSearchRegistry::get('in.start'), - //'method' => 'nextPrevious', - 'baseUrl' => 'app=core&module=search&do=viewNewContent&period=' . IPSSearchRegistry::get('in.period') . '&userMode=' . IPSSearchRegistry::get('in.userMode') . '&search_app=' . IPSSearchRegistry::get('in.search_app') . '&sid=' . $this->request['_sid'] . $this->_returnSearchAppFilters() ) ); - - /* Showing */ - $showing = array( 'start' => IPSSearchRegistry::get('in.start') + 1, 'end' => ( IPSSearchRegistry::get('in.start') + IPSSearchRegistry::get('opt.search_per_page') ) > $count ? $count : IPSSearchRegistry::get('in.start') + IPSSearchRegistry::get('opt.search_per_page') ); - } - else - { - $count = 0; - $results = array(); - } - - /* Add Debug message */ - IPSDebug::addMessage( "View New Content Matches: " . $count ); - - /* Check for sortIn */ - if( count( $sortIn ) && !$this->request['search_app_filters'][ $this->request['search_app'] ]['searchInKey'] ) - { - $this->request['search_app_filters'][ $this->request['search_app'] ]['searchInKey'] = $sortIn[0][0]; - } - - /* Output */ - $this->title = $this->lang->words['new_posts_title']; - $this->registry->output->addNavigation( $this->lang->words['new_posts_title'], '' ); - $this->output .= $this->registry->output->getTemplate( 'search' )->newContentView( $results, $links, $count, $sortDropDown, $sortIn, IPSSearchRegistry::get('set.resultCutToDate') ); - } - - - /** - * Returns a url string that will maintain search results via links - * - * @return string - */ - protected function _buildURLString() - { - /* INI */ - $url_string = 'app=core&module=search&do=search&andor_type=' . $this->request['andor_type']; - $url_string .= '&sid=' . $this->request['_sid']; - - /* Add author name */ - if( !empty( $this->request['search_author'] ) ) - { - $url_string .= "&search_author=" . urlencode($this->request['search_author']); - } - - /* Search Range */ - if( !empty( $this->request['search_date_start'] ) ) - { - $url_string .= "&search_date_start={$this->request['search_date_start']}"; - } - - if( !empty( $this->request['search_date_end'] ) ) - { - $url_string .= "&search_date_end={$this->request['search_date_end']}"; - } - - if( !empty( $this->request['search_app_filters'][ $this->request['search_app'] ]['sortKey'] ) ) - { - $url_string .= "&search_app_filters[{$this->request['search_app']}][sortKey]=" . $this->request['search_app_filters'][ $this->request['search_app'] ]['sortKey']; - } - - if( !empty( $this->request['search_app_filters'][ $this->request['search_app'] ]['sortDir'] ) ) - { - $url_string .= "&search_app_filters[{$this->request['search_app']}][sortDir]=" . $this->request['search_app_filters'][ $this->request['search_app'] ]['sortDir']; - } - - /* Contextual Type */ - if ( IPSSearchRegistry::get('contextual.type') ) - { - $url_string .= "&cType=" . IPSSearchRegistry::get('contextual.type') . "&cId=" . IPSSearchRegistry::get('contextual.id'); - } - - /* Content Only */ - if( !empty( $this->request['search_content'] ) ) - { - $url_string .= "&search_content=" . $this->request['search_content']; - } - - if ( IPSSearchRegistry::get('in.raw_search_tags') ) - { - $url_string .= "&search_tags=" . urlencode( IPSSearchRegistry::get('in.raw_search_tags') ); - } - - /* Types */ - if( isset( $this->request['type'] ) && isset( $this->request['type_id'] ) ) - { - $url_string .= "&type={$this->request['type']}&type_id={$this->request['type_id']}"; - } - - if( isset( $this->request['type_2'] ) && isset( $this->request['type_id_2'] ) ) - { - $url_string .= "&type_2={$this->request['type_2']}&type_id_2={$this->request['type_id_2']}"; - } - - $url_string .= $this->_returnSearchAppFilters(); - - /* Fix up the search term a bit */ - $_search_term = str_replace( '&', '&', $this->request['search_term'] ); - $_search_term = str_replace( '"', '"', $_search_term ); - $_search_term = str_replace( '>', '>', $_search_term ); - $_search_term = str_replace( '<', '<', $_search_term ); - $_search_term = str_replace( '$', '$', $_search_term ); - - $url_string .= '&search_term=' . urlencode( $_search_term ); - - return $url_string; - } - - /** - * Return search app filters - * - * @return @e string - */ - protected function _returnSearchAppFilters() - { - $url_string = ''; - - if( isset($this->request['search_app_filters']) AND $this->request['search_app_filters'] ) - { - foreach( $this->request['search_app_filters'] as $app => $filters ) - { - if( $app == $this->request['search_app'] AND is_array( $filters ) AND count($filters) ) - { - foreach( $filters as $_filterKey => $_filterValue ) - { - if( is_array($_filterValue) ) - { - foreach( $_filterValue as $_filterValueKey => $_filterValueValue ) - { - $url_string .= "&search_app_filters[{$app}][{$_filterKey}][{$_filterValueKey}]={$_filterValueValue}"; - } - } - else - { - $url_string .= "&search_app_filters[{$app}][{$_filterKey}]={$_filterValue}"; - } - } - } - } - } - - return $url_string; - } - - /** - * Checks to see if the logged in user is allowed to use the search system - * - * @return @e void - */ - protected function _canSearch() - { - /* Check the search setting */ - if( ! $this->settings['allow_search'] ) - { - if( $this->xml_out ) - { - @header( "Content-type: text/html;charset={$this->settings['gb_char_set']}" ); - print $this->lang->words['search_off']; - exit(); - } - else - { - $this->registry->output->showError( 'search_off', 10145 ); - } - } - - /* Check the member authorization */ - if( ! isset( $this->memberData['g_use_search'] ) || ! $this->memberData['g_use_search'] ) - { - /* Is it a bot and we're looking for tags? */ - if ( $this->member->is_not_human && ( $this->request['do'] == 'search' && ! empty( $this->request['search_tags'] ) ) ) - { - return true; - } - else - { - if( $this->xml_out ) - { - @header( "Content-type: text/html;charset={$this->settings['gb_char_set']}" ); - print $this->lang->words['no_xml_permission']; - exit(); - } - else - { - $this->registry->output->showError( 'no_permission_to_search', 10146, null, null, 403 ); - } - } - } - } - - /** - * Clean search keys and values - */ - protected function _cleanInputFilters( $filters ) - { - if ( is_array( $filters ) ) - { - foreach( $filters as $k => $v ) - { - unset( $filters[ $k ] ); - - $k = IPSText::alphanumericalClean( $k ); - - if ( is_array( $v ) ) - { - $filters[ $k ] = $this->_cleanInputFilters( $v ); - } - else - { - $filters[ $k ] = IPSText::htmlspecialchars( $v ); - } - } - } - - return $filters; - } - - /** - * Resets params for template - */ - protected function _resetRequestParameters() - { - $this->request['period'] = IPSSearchRegistry::get('in.period'); - $this->request['real_period'] = IPSSearchRegistry::get('in.real_period'); - $this->request['search_app'] = IPSSearchRegistry::get('in.search_app'); - $this->request['vncFollowFilterOn'] = IPSSearchRegistry::get('in.vncFollowFilterOn'); - $this->request['followedItemsOnly'] = IPSSearchRegistry::get('in.vncFollowFilterOn'); - } - - + + * Invision Power Services + * IP.Board v3.4.6 + * Global Search + * Last Updated: $Date: 2013-10-28 09:05:10 -0400 (Mon, 28 Oct 2013) $ + * + * + * @author $Author: AndyMillne $ + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license http://www.invisionpower.com/company/standards.php#license + * @package IP.Board + * @subpackage Core + * @link http://www.invisionpower.com + * @version $Rev: 12394 $ + */ + +if ( ! defined( 'IN_IPB' ) ) +{ + print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +class public_core_search_search extends ipsCommand +{ + /** + * Generated output + * + * @var string + */ + protected $output = ''; + + /** + * Page Title + * + * @var string + */ + protected $title = ''; + + /** + * Object to handle searches + * + * @var string + */ + protected $search_plugin = ''; + + /** + * Topics array + * + * @var array + */ + protected $_topicArray = array(); + protected $_removedTerms = array(); + + /** + * Search controller + * + * @var obj + */ + protected $searchController; + protected $_session; + + /** + * Class entry point + * + * @param object Registry reference + * @return @e void [Outputs to screen/redirects] + */ + public function doExecute( ipsRegistry $registry ) + { + /* Load language */ + $this->registry->class_localization->loadLanguageFile( array( 'public_search' ), 'core' ); + $this->registry->class_localization->loadLanguageFile( array( 'public_forums', 'public_topic' ), 'forums' ); + + /* Reset engine type */ + $this->settings['search_method'] = ( $this->settings['search_method'] == 'traditional' ) ? 'sql' : $this->settings['search_method']; + + /* Force SQL for view new content? */ + if ( ! empty( $this->settings['force_sql_vnc'] ) && $this->request['do'] == 'viewNewContent' ) + { + $this->settings['search_method'] = 'sql'; + } + + $this->request['search_app_filters'] = $this->_cleanInputFilters( $this->request['search_app_filters'] ); + + /* Special consideration for contextual search */ + if ( ( isset( $this->request['search_app'] ) AND is_string( $this->request['search_app'] ) ) AND strstr( $this->request['search_app'], ':' ) ) + { + list( $app, $type, $id ) = explode( ':', $this->request['search_app'] ); + + $this->request['search_app'] = $app; + $this->request['cType'] = $type; + $this->request['cId'] = $id; + } + else + { + /* Force forums as default search */ + $this->request['search_in'] = ( $this->request['search_in'] AND IPSLib::appIsSearchable( $this->request['search_in'], 'search' ) ) ? $this->request['search_in'] : 'forums'; + $this->request['search_app'] = $this->request['search_app'] ? $this->request['search_app'] : $this->request['search_in']; + } + + /* Check Access */ + $this->_canSearch(); + + /* Start session - needs to be called before the controller is initiated */ + $this->_startSession(); + + /* Load the controller */ + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH. 'sources/classes/search/controller.php', 'IPSSearch' ); + + /* Sanitzie */ + if ( ! is_string( $this->request['search_app'] ) ) + { + $this->request['search_app'] = 'forums'; + } + + try + { + $this->searchController = new $classToLoad( $registry, $this->settings['search_method'], $this->request['search_app'] ); + } + catch( Exception $error ) + { + $msg = $error->getMessage(); + + /* Start session */ + $this->_endSession(); + + switch( $msg ) + { + case 'NO_SUCH_ENGINE': + case 'NO_SUCH_APP': + case 'NO_SUCH_APP_ENGINE': + $this->registry->output->showError( sprintf( $this->lang->words['no_search_app'], ipsRegistry::$applications[ $this->request['search_app'] ]['app_title'] ), 10145.1 ); + break; + } + } + + /* Log type */ + IPSDebug::addMessage( "Search type: " . $this->settings['search_method'] ); + + /* Set up some defaults */ + IPSSearchRegistry::set('opt.noPostPreview', false ); + IPSSearchRegistry::set('in.start', intval( $this->request['st'] ) ); + IPSSearchRegistry::set('opt.search_per_page', intval( $this->settings['search_per_page'] ) ? intval( $this->settings['search_per_page'] ) : 25 ); + + $this->settings['search_ucontent_days'] = ( $this->settings['search_ucontent_days'] ) ? $this->settings['search_ucontent_days'] : 365; + + /* Contextuals */ + if ( isset( $this->request['cType'] ) ) + { + IPSSearchRegistry::set('contextual.type', $this->request['cType'] ); + IPSSearchRegistry::set('contextual.id' , $this->request['cId'] ); + } + + + + /* What to do */ + switch( $this->request['do'] ) + { + case 'user_activity': + $this->viewUserContent(); + break; + + case 'new_posts': + case 'viewNewContent': + case 'active': + $this->viewNewContent(); + break; + + case 'search': + case 'quick_search': + $this->searchResults(); + break; + + case 'followed': + $this->viewFollowedContent(); + break; + + case 'manageFollowed': + $this->updateFollowedContent(); + break; + + default: + case 'search_form': + $this->searchAdvancedForm(); + break; + } + + /* Start session */ + $this->_endSession(); + + /* If we have any HTML to print, do so... */ + if ( $this->request['do'] == 'search' && ! empty( $this->request['search_tags'] ) ) + { + $this->registry->output->setTitle( IPSText::urldecode_furlSafe( $this->request['search_tags'] ) . ' - ' . $this->lang->words['st_tags'] . ' - ' . IPSLib::getAppTitle( $this->request['search_app'] ) . ' - ' . ipsRegistry::$settings['board_name'] ); + + /* Add canonical tag */ + $extra = ( $this->request['st'] ) ? '&st=' . $this->request['st'] : ''; + $this->registry->output->addCanonicalTag( 'app=core&module=search&do=search&search_tags=' . IPSText::urlencode_furlSafe( $this->request['search_tags'] ) . '&search_app=' . $this->request['search_app']. $extra, $this->request['search_tags'], 'tags' ); + } + else + { + $this->registry->output->setTitle( $this->title . ' - ' . ipsRegistry::$settings['board_name'] ); + } + + $this->registry->output->addContent( $this->output ); + $this->registry->output->sendOutput(); + } + + /** + * Moderate your list of liked content + * + * @author bfarber + * @return string HTML to display + */ + public function updateFollowedContent() + { + IPSSearchRegistry::set( 'in.search_app', $this->request['search_app'] ); + + //----------------------------------------- + // Get the likes we selected + //----------------------------------------- + + $_likes = array(); + + if( is_array($this->request['likes']) AND count($this->request['likes']) ) + { + foreach( $this->request['likes'] as $_like ) + { + $_thisLike = explode( '-', $_like ); + $_likes[] = array( + 'app' => $_thisLike[0], + 'area' => $_thisLike[1], + 'id' => $_thisLike[2], + ); + } + } + + //----------------------------------------- + // Got any? + //----------------------------------------- + + if( !count($_likes) OR !is_array($_likes) ) + { + return $this->viewFollowedContent( $this->lang->words['no_likes_for_del'] ); + } + + //----------------------------------------- + // Get like helper class + //----------------------------------------- + + $bootstraps = array(); + + require_once( IPS_ROOT_PATH . 'sources/classes/like/composite.php' );/*noLibHook*/ + + //----------------------------------------- + // Loop over and moderate + //----------------------------------------- + + foreach( $_likes as $_like ) + { + $_bootstrap = classes_like::bootstrap( $_like['app'], $_like['area'] ); + $_likeKey = classes_like_registry::getKey( $_like['id'], $this->memberData['member_id'] ); + $_frequencies = $_bootstrap->allowedFrequencies(); + + //----------------------------------------- + // What action to take? + //----------------------------------------- + + switch( $this->request['modaction'] ) + { + case 'delete': + $_bootstrap->remove( $_like['id'], $this->memberData['member_id'] ); + break; + + case 'change-donotify': + $this->DB->update( 'core_like', array( 'like_notify_do' => 1, 'like_notify_freq' => 'immediate' ), "like_id='" . addslashes($_likeKey) . "'" ); + break; + + case 'change-donotnotify': + $this->DB->update( 'core_like', array( 'like_notify_do' => 0 ), "like_id='" . addslashes($_likeKey) . "'" ); + break; + + case 'change-immediate': + if( in_array( 'immediate', $_frequencies ) ) + { + $this->DB->update( 'core_like', array( 'like_notify_do' => 1, 'like_notify_freq' => 'immediate' ), "like_id='" . addslashes($_likeKey) . "'" ); + } + break; + + case 'change-offline': + if( in_array( 'offline', $_frequencies ) ) + { + $this->DB->update( 'core_like', array( 'like_notify_do' => 1, 'like_notify_freq' => 'offline' ), "like_id='" . addslashes($_likeKey) . "'" ); + } + break; + + case 'change-daily': + if( in_array( 'daily', $_frequencies ) ) + { + $this->DB->update( 'core_like', array( 'like_notify_do' => 1, 'like_notify_freq' => 'daily' ), "like_id='" . addslashes($_likeKey) . "'" ); + } + break; + + case 'change-weekly': + if( in_array( 'weekly', $_frequencies ) ) + { + $this->DB->update( 'core_like', array( 'like_notify_do' => 1, 'like_notify_freq' => 'weekly' ), "like_id='" . addslashes($_likeKey) . "'" ); + } + break; + + case 'change-anon': + $this->DB->update( 'core_like', array( 'like_is_anon' => 1 ), "like_id='" . addslashes($_likeKey) . "'" ); + break; + + case 'change-noanon': + $this->DB->update( 'core_like', array( 'like_is_anon' => 0 ), "like_id='" . addslashes($_likeKey) . "'" ); + break; + default: + return $this->viewFollowedContent( $this->lang->words['likes_no_action'] ); + break; + } + } + + $this->registry->getClass('output')->silentRedirect( $this->settings['base_url']."app=core&module=search&do=followed&search_app={$this->request['search_app']}&contentType={$this->request['contentType']}&confirm=1" ); + } + + /** + * View content you are following + * + * @author Brandon Farber + * @param string $error Error message + * @return @e void + */ + public function viewFollowedContent( $error='' ) + { + IPSSearchRegistry::set( 'in.search_app', $this->request['search_app'] ); + IPSSearchRegistry::set( 'opt.searchType', 'titles' ); + IPSSearchRegistry::set( 'opt.noPostPreview', true ); + + $results = array(); + $formatted = array(); + $count = 0; + + //----------------------------------------- + // Determine content type + //----------------------------------------- + + $contentTypes = IPSSearchRegistry::get('config.followContentTypes'); + + //----------------------------------------- + // Verify likes are available + //----------------------------------------- + + if( count( IPSLib::getEnabledApplications('like') ) AND count( $contentTypes ) AND IPSLib::appIsInstalled( IPSSearchRegistry::get('in.search_app'), true ) ) + { + //----------------------------------------- + // What content type? + //----------------------------------------- + + $_type = ''; + + if( $this->request['contentType'] AND in_array( $this->request['contentType'], $contentTypes ) ) + { + $_type = $this->request['contentType']; + } + else + { + $_type = $contentTypes[0]; + } + + $this->request['contentType'] = $_type; + + IPSSearchRegistry::set( 'in.followContentType', $this->request['contentType'] ); + + /* Fetch like class */ + try + { + require_once( IPS_ROOT_PATH . 'sources/classes/like/composite.php' );/*noLibHook*/ + $this->_like = classes_like::bootstrap( IPSSearchRegistry::get('in.search_app'), $_type ); + } + catch ( Exception $e) + { + /* Fail safe... */ + $this->registry->output->addNavigation( $this->lang->words['followed_ct_title'], '' ); + $this->title = $this->lang->words['followed_ct_title']; + $this->output .= $this->registry->output->getTemplate( 'search' )->followedContentView( array(), '', 0, $error, $contentTypes ); + } + + /* Do we have some custom join and sort data? */ + if ( method_exists( $this->_like, 'getSearchJoinAndSortBy' ) ) + { + $custom = $this->_like->getSearchJoinAndSortBy(); + + $countQ = array( 'select' => 'COUNT(*) as er', + 'from' => array( 'core_like' => 'l' ), + 'where' => 'like_member_id=' . $this->memberData['member_id'] . " AND like_visible=1 AND like_app='" . IPSSearchRegistry::get('in.search_app') . "' AND like_area='" . $_type . "'" ); + if ( $custom['from'] ) + { + $countQ['add_join'][] = array( 'from' => $custom['from'], 'where' => $custom['where'] ); + } + if ( $custom['order'] ) + { + $countQ['order'] = $custom['order'] . ' DESC'; + } + if ( $custom['extraWhere'] ) + { + $countQ['where'] .= ' AND ' . $custom['extraWhere']; + } + $count = $this->DB->buildAndFetch( $countQ ); + $count = $count['er']; + + $q = array( 'select' => 'l.*', + 'from' => array('core_like' => 'l'), + 'where' => 'l.like_member_id=' . $this->memberData['member_id'] . " AND l.like_visible=1 AND l.like_app='" . IPSSearchRegistry::get('in.search_app') . "' AND l.like_area='" . $_type . "'", + 'limit' => array( IPSSearchRegistry::get('in.start'), IPSSearchRegistry::get('opt.search_per_page') ), + 'order' => 'like_added DESC' + ); + + if ( $custom['from'] ) + { + $q['add_join'][] = array( 'from' => $custom['from'], 'where' => $custom['where'] ); + } + if ( $custom['order'] ) + { + $q['order'] = $custom['order'] . ' DESC'; + } + if ( $custom['extraWhere'] ) + { + $q['where'] .= ' AND ' . $custom['extraWhere']; + } + + $this->DB->build( $q ); + } + else + { + $count = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as er', + 'from' => 'core_like', + 'where' => 'like_member_id=' . $this->memberData['member_id'] . " AND like_visible=1 AND like_app='" . IPSSearchRegistry::get('in.search_app') . "' AND like_area='" . $_type . "'" ) ); + $count = $count['er']; + + $this->DB->build( array( 'select' => '*', + 'from' => 'core_like', + 'where' => 'like_member_id=' . $this->memberData['member_id'] . " AND like_visible=1 AND like_app='" . IPSSearchRegistry::get('in.search_app') . "' AND like_area='" . $_type . "'", + 'limit' => array( IPSSearchRegistry::get('in.start'), IPSSearchRegistry::get('opt.search_per_page') ), + 'order' => 'like_added DESC' ) ); + } + + $outer = $this->DB->execute(); + + while( $r = $this->DB->fetch($outer) ) + { + $results[] = $r['like_rel_id']; + + $formatted[ $r['like_id'] ] = $r; + } + + /* Process */ + $results = $this->searchController->fetchFollowedContentOutput( $results, $formatted ); + + $pages = $this->registry->getClass('output')->generatePagination( array( 'totalItems' => $count, + 'itemsPerPage' => IPSSearchRegistry::get('opt.search_per_page'), + 'currentStartValue' => IPSSearchRegistry::get('in.start'), + 'baseUrl' => "app=core&module=search&do=followed&search_app=" . IPSSearchRegistry::get('in.search_app') . '&sid=' . $this->request['_sid'] . "&contentType=" . $this->request['contentType'] ) ); + } + else + { + $count = 0; + $results = array(); + } + + /* Output */ + $this->registry->output->addNavigation( $this->lang->words['followed_ct_title'], '' ); + $this->title = $this->lang->words['followed_ct_title']; + $this->output .= $this->registry->output->getTemplate( 'search' )->followedContentView( $results, $pages, $count, $error, $contentTypes ); + } + + /** + * Builds the advanced search form + * + * @param string Message + * @return @e void + */ + public function searchAdvancedForm( $msg='', $removed_search_terms=array() ) + { + /* Set up data */ + IPSSearchRegistry::set('view.search_form', true ); + + /* Get any application specific filters */ + $appHtml = $this->searchController->getHtml(); + $isBoolean = $this->searchController->isBoolean(); + $tagSupport = $this->searchController->getTagSupport(); + + /* Output */ + $this->title = $this->lang->words['search_form']; + $this->registry->output->addNavigation( $this->lang->words['search_form'], '' ); + $this->output .= $this->registry->output->getTemplate( 'search' )->searchAdvancedForm( $appHtml, $msg, $this->request['search_app'], $removed_search_terms, $isBoolean, $tagSupport ); + } + + /** + * Processes a search request + * + * @return @e void + */ + public function searchResults() + { + /* Search Term */ + if( isset( $this->request['search_term'] ) && !is_string( $this->request['search_term'] ) ) + { + $this->registry->getClass('output')->showError( 'invalid_search_term', 10312564 ); + } + + $_st = $this->searchController->formatSearchTerm( trim( $this->request['search_term'] ) ); + $search_term = $_st['search_term']; + $removedTerms = $_st['removed']; + + /* Set up some defaults */ + $this->settings['max_search_word'] = $this->settings['max_search_word'] ? $this->settings['max_search_word'] : 300; + + /* Did we come in off a post request? */ + if ( $this->request['request_method'] == 'post' ) + { + /* Set a no-expires header */ + $this->registry->getClass('output')->setCacheExpirationSeconds( 30 * 60 ); + } + + if ( is_array( $this->request['search_app_filters'] ) ) + { + array_walk_recursive( $this->request['search_app_filters'], create_function('&$item, $key', '$item = IPSText::htmlspecialchars($item);' ) ); + } + + /* App specific */ + if ( isset( $this->request['search_sort_by_' . $this->request['search_app'] ] ) ) + { + $this->request['search_sort_by'] = ( $_POST[ 'search_sort_by_' . $this->request['search_app'] ] ) ? htmlspecialchars( $_POST[ 'search_sort_by_' . $this->request['search_app'] ] ) : $this->request['search_sort_by_' . $this->request['search_app'] ]; + $this->request['search_sort_order'] = ( $_POST[ 'search_sort_order_' . $this->request['search_app'] ] ) ? htmlspecialchars( $_POST[ 'search_sort_order_' . $this->request['search_app'] ] ) : $this->request['search_sort_order_' . $this->request['search_app'] ]; + } + + /* Populate the registry */ + IPSSearchRegistry::set('in.search_app' , $this->request['search_app'] ); + IPSSearchRegistry::set('in.raw_search_term' , trim( $this->request['search_term'] ) ); + IPSSearchRegistry::set('in.clean_search_term', $search_term ); + IPSSearchRegistry::set('in.raw_search_tags' , str_replace( '&', '&', trim( IPSText::parseCleanValue( IPSText::urldecode_furlSafe( $_REQUEST['search_tags'] ) ) ) ) ); + IPSSearchRegistry::set('in.search_higlight' , str_replace( '.', '', $this->request['search_term'] ) ); + IPSSearchRegistry::set('in.search_date_end' , ( $this->request['search_date_start'] && $this->request['search_date_end'] AND ! is_array( $this->request['search_date_end'] ) ) ? $this->request['search_date_end'] : 'now' ); + IPSSearchRegistry::set('in.search_date_start', ( $this->request['search_date_start'] AND ! is_array( $this->request['search_date_start'] ) ) ? $this->request['search_date_start'] : '' ); + IPSSearchRegistry::set('in.search_author' , !empty( $this->request['search_author'] ) ? $this->request['search_author'] : '' ); + + /* Set sort filters */ + $this->_setSortFilters(); + + /* These can be overridden in the actual engine scripts */ + // IPSSearchRegistry::set('set.hardLimit' , 0 ); + IPSSearchRegistry::set('set.resultsCutToLimit', false ); + IPSSearchRegistry::set('set.resultsAsForum' , false ); + + /* Are we option to show titles only / search in titles only */ + IPSSearchRegistry::set('opt.searchType', ( !empty( $this->request['search_content'] ) AND in_array( $this->request['search_content'], array( 'both', 'titles', 'content' ) ) ) ? $this->request['search_content'] : 'both' ); + + /* Time check */ + if ( IPSSearchRegistry::get('in.search_date_start') AND strtotime( IPSSearchRegistry::get('in.search_date_start') ) > time() ) + { + IPSSearchRegistry::set('in.search_date_start', 'now' ); + } + + if ( IPSSearchRegistry::get('in.search_date_end') AND strtotime( IPSSearchRegistry::get('in.search_date_end') ) > time() ) + { + IPSSearchRegistry::set('in.search_date_end', 'now' ); + } + + /* Do some date checking */ + if( IPSSearchRegistry::get('in.search_date_end') AND IPSSearchRegistry::get('in.search_date_start') AND strtotime( IPSSearchRegistry::get('in.search_date_start') ) > strtotime( IPSSearchRegistry::get('in.search_date_end') ) ) + { + $this->searchAdvancedForm( $this->lang->words['search_invalid_date_range'] ); + return; + } + + /** + * Lower limit + */ + if ( $this->settings['min_search_word'] && ! IPSSearchRegistry::get('in.search_author') && ! IPSSearchRegistry::get('in.raw_search_tags') ) + { + if ( $this->settings['search_method'] == 'sphinx' && substr_count( $search_term, '"' ) >= 2 ) + { + $_ok = true; + } + else + { + $_words = explode( ' ', preg_replace( "#\"(.*?)\"#", '', $search_term ) ); + $_ok = $search_term ? true : false; + + foreach( $_words as $_word ) + { + $_word = preg_replace( '#^\+(.+?)$#', "\\1", $_word ); + + if ( ! $_word OR $_word == '|' ) + { + continue; + } + + if( strlen( $_word ) < $this->settings['min_search_word'] ) + { + $_ok = false; + break; + } + } + } + + if( ! $_ok ) + { + $this->searchAdvancedForm( sprintf( $this->lang->words['search_term_short'], $this->settings['min_search_word'] ), $removedTerms ); + return; + } + } + + /** + * Ok this is an upper limit. + * If you needed to change this, you could do so via conf_global.php by adding: + * $INFO['max_search_word'] = #####; + */ + if ( $this->settings['max_search_word'] && strlen( IPSSearchRegistry::get('in.raw_search_term') ) > $this->settings['max_search_word'] ) + { + $this->searchAdvancedForm( sprintf( $this->lang->words['search_term_long'], $this->settings['max_search_word'] ) ); + return; + } + + /* Search Flood Check */ + if( $this->memberData['g_search_flood'] ) + { + /* Check for a cookie */ + $last_search = IPSCookie::get( 'sfc' ); + $last_term = str_replace( """, '"', IPSCookie::get( 'sfct' ) ); + $last_term = str_replace( "&", '&', $last_term ); + + /* If we have a last search time, check it */ + if( $last_search && $last_term ) + { + if( ( time() - $last_search ) <= $this->memberData['g_search_flood'] && $last_term != IPSSearchRegistry::get('in.raw_search_term') ) + { + $this->searchAdvancedForm( sprintf( $this->lang->words['xml_flood'], $this->memberData['g_search_flood'] - ( time() - $last_search ) ) ); + return; + } + else + { + /* Reset the cookie */ + IPSCookie::set( 'sfc', time() ); + IPSCookie::set( 'sfct', urlencode( IPSSearchRegistry::get('in.raw_search_term') ) ); + } + } + /* Set the cookie */ + else + { + IPSCookie::set( 'sfc', time() ); + IPSCookie::set( 'sfct', urlencode( IPSSearchRegistry::get('in.raw_search_term') ) ); + } + } + + /* Clean search term for results view */ + $_search_term = trim( preg_replace( '#(^|\s)(\+|\-|\||\~)#', " ", $search_term ) ); + + /* Got tag search only but app doesn't support tags */ + if ( IPSSearchRegistry::get('in.raw_search_tags') && ! IPSSearchRegistry::get( 'config.can_searchTags' ) && ! IPSSearchRegistry::get('in.raw_search_term') ) + { + $count = 0; + $results = array(); + } + else if ( IPSLib::appIsSearchable( IPSSearchRegistry::get('in.search_app'), 'search' ) ) + { + /* Perform the search */ + $this->searchController->search(); + + /* Get count */ + $count = $this->searchController->getResultCount(); + + /* Get results which will be array of IDs */ + $results = $this->searchController->getResultSet(); + + /* Get templates to use */ + $template = $this->searchController->fetchTemplates(); + + /* Fetch sort details */ + $sortDropDown = $this->searchController->fetchSortDropDown(); + + /* Set default sort option */ + $_a = IPSSearchRegistry::get('in.search_app'); + $_k = IPSSearchRegistry::get( $_a . '.searchInKey') ? IPSSearchRegistry::get( $_a . '.searchInKey') : ''; + + if( $_k AND !$this->request['search_app_filters'][ $_a ][ $_k ]['sortKey'] AND is_array($sortDropDown) AND count($sortDropDown) ) + { + $this->request['search_app_filters'][ $_a ][ $_k ]['sortKey'] = key( $sortDropDown ); + } + else if( !$_k AND !$this->request['search_app_filters'][ $_a ]['sortKey'] AND is_array($sortDropDown) AND count($sortDropDown) ) + { + $this->request['search_app_filters'][ $_a ]['sortKey'] = key( $sortDropDown ); + } + + /* Fetch sort details */ + $sortIn = $this->searchController->fetchSortIn(); + + /* Build pagination */ + $links = $this->registry->output->generatePagination( array( 'totalItems' => $count, + 'itemsPerPage' => IPSSearchRegistry::get('opt.search_per_page'), + 'currentStartValue'=> IPSSearchRegistry::get('in.start'), + 'baseUrl' => $this->_buildURLString() . '&search_app=' . IPSSearchRegistry::get('in.search_app') ) ); + + /* Showing */ + $showing = array( 'start' => IPSSearchRegistry::get('in.start') + 1, 'end' => ( IPSSearchRegistry::get('in.start') + IPSSearchRegistry::get('opt.search_per_page') ) > $count ? $count : IPSSearchRegistry::get('in.start') + IPSSearchRegistry::get('opt.search_per_page') ); + + /* Parse result set */ + $results = $this->registry->output->getTemplate( $template['group'] )->$template['template']( $results, ( IPSSearchRegistry::get('opt.searchType') == 'titles' || IPSSearchRegistry::get('opt.noPostPreview') ) ? 1 : 0 ); + + /* Check for sortIn */ + if( count( $sortIn ) && !$this->request['search_app_filters'][ $this->request['search_app'] ]['searchInKey'] ) + { + $this->request['search_app_filters'][ $this->request['search_app'] ]['searchInKey'] = $sortIn[0][0]; + } + } + else + { + $count = 0; + $results = array(); + } + + if ( $count < 1 ) + { + $this->registry->output->setHeaderCode( 404 ); + } + + /* Output */ + $this->title = $this->lang->words['search_results']; + $this->output .= $this->registry->output->getTemplate( 'search' )->searchResultsWrapper( $results, $sortDropDown, $sortIn, $links, $count, $showing, $_search_term, $this->_buildURLString(), $this->request['search_app'], $removedTerms, IPSSearchRegistry::get('set.hardLimit'), IPSSearchRegistry::get('set.resultsCutToLimit'), IPSSearchRegistry::get('in.raw_search_tags') ); + } + + /** + * Starts session + * Loads / creates a session based on activity + * + * @return + */ + protected function _startSession() + { + if ( ! is_array( $this->request['sid'] ) ) + { + $session_id = IPSText::md5Clean( $this->request['sid'] ); + } + else + { + $session_id = ''; + } + + $requestType = ( $this->request['request_method'] == 'post' ) ? 'post' : 'get'; + + if ( $session_id ) + { + /* We check on member id 'cos we can. Obviously guests will have a member ID of zero, but meh */ + $this->_session = $this->DB->buildAndFetch( array( 'select' => '*', + 'from' => 'search_sessions', + 'where' => 'session_id=\'' . $session_id . '\' AND session_member_id=' . $this->memberData['member_id'] ) ); + } + + /* Deflate */ + if ( $this->_session['session_id'] ) + { + if ( $this->_session['session_data'] ) + { + $this->_session['_session_data'] = unserialize( $this->_session['session_data'] ); + + if ( isset( $this->_session['_session_data']['search_app_filters'] ) ) + { + $this->request['search_app_filters'] = is_array( $this->request['search_app_filters'] ) ? array_merge( $this->_session['_session_data']['search_app_filters'], $this->request['search_app_filters'] ) : $this->_session['_session_data']['search_app_filters']; + } + } + + IPSDebug::addMessage( "Loaded search session:
    " . var_export( $this->_session['_session_data'], true ) . "
    " ); + } + else + { + /* Create a session */ + $this->_session = array( 'session_id' => md5( uniqid( microtime(), true ) ), + 'session_created' => time(), + 'session_updated' => time(), + 'session_member_id' => $this->memberData['member_id'], + 'session_data' => serialize( array( 'search_app_filters' => $this->request['search_app_filters'] ) ) ); + + $this->DB->insert( 'search_sessions', $this->_session ); + + $this->_session['_session_data']['search_app_filters'] = $this->request['search_app_filters']; + + IPSDebug::addMessage( "Created search session:
    " . var_export( $this->_session['_session_data'], true ) . "
    " ); + } + + /* Do we have POST infos? */ + if ( isset( $_POST['search_app_filters'] ) ) + { + $this->_session['_session_data']['search_app_filters'] = ( is_array( $this->_session['_session_data']['search_app_filters'] ) ) ? IPSLib::arrayMergeRecursive( $this->_session['_session_data']['search_app_filters'], $_POST['search_app_filters'] ) : $_POST['search_app_filters']; + $this->request['search_app_filters'] = $this->_session['_session_data']['search_app_filters']; + + IPSDebug::addMessage( "Updated filters:
    " . var_export( $_POST['search_app_filters'], true ) . "
    " ); + } + + /* Globalize the session ID */ + $this->request['_sid'] = $this->_session['session_id']; + } + + /** + * End the session + * + */ + protected function _endSession() + { + if ( $this->_session['session_id'] ) + { + $sd = array( 'session_updated' => time(), + 'session_data' => serialize( $this->_session['_session_data'] ) ); + + $this->DB->update( 'search_sessions', $sd, 'session_id=\'' . $this->_session['session_id'] . '\'' ); + } + + /* Delete old sessions */ + $this->DB->delete( 'search_sessions', 'session_updated < ' . ( time() - 86400 ) ); + } + + /** + * Set the search order and key + * + * @return @e void + */ + protected function _setSortFilters() + { + $app = $this->request['search_app']; + $key = 'date'; + $dir = 'desc'; + $dun = false; + + /* multi search in options? */ + if ( isset( $this->request['search_app_filters'][ $app ]['searchInKey'] ) ) + { + $_k = $this->request['search_app_filters'][ $app ]['searchInKey']; + + if ( isset( $this->request['search_app_filters'][ $app ][ $_k ]['sortKey'] ) ) + { + $dun = true; + $key = $this->request['search_app_filters'][ $app ][ $_k ]['sortKey']; + $dir = $this->request['search_app_filters'][ $app ][ $_k ]['sortDir']; + } + } + + /* Normal options - although sometimes used even with multiple types */ + if ( ! $dun AND isset( $this->request['search_app_filters'][$app]['sortKey'] ) ) + { + $key = $this->request['search_app_filters'][$app]['sortKey']; + $dir = $this->request['search_app_filters'][$app]['sortDir']; + } + /* Global */ + else + { + if ( isset( $this->request['search_sort_by'] ) ) + { + $key = $this->request['search_sort_by']; + $dir = $this->request['search_sort_order']; + } + } + + /* Valid search key? */ + if( !is_string( $key ) ) + { + $this->registry->getClass('output')->showError( 'invalid_search_key', 10312565 ); + } + + /* Numeric? */ + if ( is_numeric( $dir ) ) + { + $dir = ( $dir == 0 ) ? 'desc' : 'asc'; + } + else + { + $dir = 'desc'; + } + + IPSSearchRegistry::set('in.search_sort_by' , trim( $key ) ); + IPSSearchRegistry::set('in.search_sort_order', ( $dir != 'desc' ) ? 'asc' : 'desc' ); + } + + /** + * Displays latest user content + * + * @return @e void + */ + public function viewUserContent() + { + + /* INIT */ + $id = $this->request['mid'] ? intval( trim( $this->request['mid'] ) ) : $this->memberData['member_id']; + + /* Save query if we are viewing our own content */ + if( $this->memberData['member_id'] AND $id == $this->memberData['member_id'] ) + { + $member = $this->memberData; + } + else + { + $member = IPSMember::load( $id, 'core' ); + } + + $beginStamp = 0; + + if ( ! $member['member_id'] ) + { + $this->registry->output->showError( 'search_invalid_id', 10147, null, null, 403 ); + } + + $this->request['userMode'] = !empty($this->request['userMode']) ? $this->request['userMode'] : 'all'; + + IPSSearchRegistry::set('in.search_app', $this->request['search_app'] ); + IPSSearchRegistry::set('in.userMode' , $this->request['userMode'] ); + + /* Set sort filters */ + $this->_setSortFilters(); + + /* Can we do this? */ + if ( IPSLib::appIsSearchable( IPSSearchRegistry::get('in.search_app'), 'usercontent' ) ) + { + /* Perform the search */ + $this->searchController->viewUserContent( $member ); + + /* Get count */ + $count = $this->searchController->getResultCount(); + + /* Get results which will be array of IDs */ + $results = $this->searchController->getResultSet(); + + /* Get templates to use */ + $template = $this->searchController->fetchTemplates(); + + /* Fetch sort details */ + $sortDropDown = $this->searchController->fetchSortDropDown(); + + /* Set default sort option */ + $_a = IPSSearchRegistry::get('in.search_app'); + $_k = IPSSearchRegistry::get( $_a . '.searchInKey') ? IPSSearchRegistry::get( $_a . '.searchInKey') : ''; + + if( $_k AND !$this->request['search_app_filters'][ $_a ][ $_k ]['sortKey'] AND is_array($sortDropDown) ) + { + $this->request['search_app_filters'][ $_a ][ $_k ]['sortKey'] = key( $sortDropDown ); + } + else if( !$_k AND !$this->request['search_app_filters'][ $_a ]['sortKey'] AND is_array($sortDropDown) ) + { + $this->request['search_app_filters'][ $_a ]['sortKey'] = key( $sortDropDown ); + } + + /* Fetch sort details */ + $sortIn = $this->searchController->fetchSortIn(); + + /* Reset for template */ + $this->_resetRequestParameters(); + + /* Parse result set */ + $results = $this->registry->output->getTemplate( $template['group'] )->$template['template']( $results, ( IPSSearchRegistry::get('opt.searchType') == 'titles' || IPSSearchRegistry::get('opt.noPostPreview') ) ? 1 : 0 ); + + /* Build pagination */ + $links = $this->registry->output->generatePagination( array( 'totalItems' => $count, + 'itemsPerPage' => IPSSearchRegistry::get('opt.search_per_page'), + 'currentStartValue' => IPSSearchRegistry::get('in.start'), + 'baseUrl' => 'app=core&module=search&do=user_activity&mid=' . $id . '&search_app=' . IPSSearchRegistry::get('in.search_app') . '&userMode=' . IPSSearchRegistry::get('in.userMode') . '&sid=' . $this->request['_sid'] . $this->_returnSearchAppFilters() ) ); + } + else + { + $count = 0; + $results = array(); + } + + $this->title = sprintf( $this->lang->words['s_participation_title'], $member['members_display_name'] ); + $this->registry->output->addNavigation( $this->title, '' ); + $this->output .= $this->registry->output->getTemplate( 'search' )->userPostsView( $results, $links, $count, $member, IPSSearchRegistry::get('set.hardLimit'), IPSSearchRegistry::get('set.resultsCutToLimit'), $beginStamp, $sortIn, $sortDropDown ); + } + + /** + * View new posts since your last visit + * + * @return @e void + */ + public function viewNewContent() + { + + IPSSearchRegistry::set('in.search_app', $this->request['search_app'] ); + + /* Fetch member cache to see if we have a value set */ + $vncPrefs = IPSMember::getFromMemberCache( $this->memberData, 'vncPrefs' ); + + /* Guests */ + if ( ! $this->memberData['member_id'] AND ( ! $this->request['period'] OR $this->request['period'] == 'unread' ) ) + { + $this->request['period'] = 'today'; + } + + /* In period */ + if ( $vncPrefs === null OR ! isset( $vncPrefs[ IPSSearchRegistry::get('in.search_app') ]['view'] ) OR ( ! empty( $this->request['period'] ) AND isset( $this->request['change'] ) ) ) + { + $vncPrefs[ IPSSearchRegistry::get('in.search_app') ]['view'] = ( ! empty( $this->request['period'] ) ) ? $this->request['period'] : $this->settings['default_vnc_method']; + } + + /* Follow filter enabled */ + if ( $vncPrefs === null OR ! isset( $vncPrefs[ IPSSearchRegistry::get('in.search_app') ]['view'] ) OR isset( $this->request['followedItemsOnly'] ) ) + { + $vncPrefs[ IPSSearchRegistry::get('in.search_app') ]['vncFollowFilter'] = ( ! empty( $this->request['followedItemsOnly'] ) ) ? 1 : 0; + } + + /* User mode */ + if ( $vncPrefs === null OR ! isset( $vncPrefs[ IPSSearchRegistry::get('in.search_app') ]['view'] ) OR isset( $this->request['userMode'] ) ) + { + $vncPrefs[ IPSSearchRegistry::get('in.search_app') ]['userMode'] = ( ! empty( $this->request['userMode'] ) ) ? $this->request['userMode'] : ''; + } + + /* Set filters up */ + IPSSearchRegistry::set('forums.vncForumFilters', $vncPrefs['forums']['vnc_forum_filter'] ); + IPSSearchRegistry::set('in.period' , $vncPrefs[ IPSSearchRegistry::get('in.search_app') ]['view'] ); + IPSSearchRegistry::set('in.vncFollowFilterOn', $vncPrefs[ IPSSearchRegistry::get('in.search_app') ]['vncFollowFilter'] ); + IPSSearchRegistry::set('in.userMode', $vncPrefs[ IPSSearchRegistry::get('in.search_app') ]['userMode'] ); + + /* Update member cache */ + if ( isset( $this->request['period'] ) AND isset( $this->request['change'] ) ) + { + IPSMember::setToMemberCache( $this->memberData, array( 'vncPrefs' => $vncPrefs ) ); + } + + IPSDebug::addMessage( var_export( $vncPrefs, true ) ); + IPSDebug::addMessage( 'Using: ' . IPSSearchRegistry::get('in.period') ); + + /* Can we do this? */ + if ( IPSLib::appIsSearchable( IPSSearchRegistry::get('in.search_app'), 'vnc' ) || IPSLib::appIsSearchable( IPSSearchRegistry::get('in.search_app'), 'active' ) ) + { + /* Can't do a specific unread search, so */ + if ( IPSSearchRegistry::get('in.period') == 'unread' && ! IPSLib::appIsSearchable( IPSSearchRegistry::get('in.search_app'), 'vncWithUnreadContent' ) ) + { + IPSSearchRegistry::set( 'in.period', 'lastvisit' ); + } + + /* Perform the search */ + $this->searchController->viewNewContent(); + + /* Get count */ + $count = $this->searchController->getResultCount(); + + /* Get results which will be array of IDs */ + $results = $this->searchController->getResultSet(); + + /* Get templates to use */ + $template = $this->searchController->fetchTemplates(); + + /* Fetch sort details */ + $sortDropDown = $this->searchController->fetchSortDropDown(); + + /* Fetch sort details */ + $sortIn = $this->searchController->fetchSortIn(); + + /* Reset for template */ + $this->_resetRequestParameters(); + + if( IPSSearchRegistry::get('in.start') > 0 AND !count($results) ) + { + $new_url = 'app=core&module=search&do=viewNewContent&period=' . IPSSearchRegistry::get('in.period') . '&userMode=' . IPSSearchRegistry::get('in.userMode') . '&search_app=' . IPSSearchRegistry::get('in.search_app') . '&sid=' . $this->request['_sid']; + $new_url .= '&st=' . ( IPSSearchRegistry::get('in.start') - IPSSearchRegistry::get('opt.search_per_page') ) . '&search_app_filters[' . IPSSearchRegistry::get('in.search_app') . '][searchInKey]=' . $this->request['search_app_filters'][ IPSSearchRegistry::get('in.search_app') ]['searchInKey']; + + $this->registry->output->silentRedirect( $this->settings['base_url'] . $new_url ); + } + + /* Parse result set */ + $results = $this->registry->output->getTemplate( $template['group'] )->$template['template']( $results, ( IPSSearchRegistry::get('opt.searchType') == 'titles' || IPSSearchRegistry::get('opt.noPostPreview') ) ? 1 : 0 ); + + /* Build pagination */ + $links = $this->registry->output->generatePagination( array( 'totalItems' => $count, + 'itemsPerPage' => IPSSearchRegistry::get('opt.search_per_page'), + 'currentStartValue' => IPSSearchRegistry::get('in.start'), + //'method' => 'nextPrevious', + 'baseUrl' => 'app=core&module=search&do=viewNewContent&period=' . IPSSearchRegistry::get('in.period') . '&userMode=' . IPSSearchRegistry::get('in.userMode') . '&search_app=' . IPSSearchRegistry::get('in.search_app') . '&sid=' . $this->request['_sid'] . $this->_returnSearchAppFilters() ) ); + + /* Showing */ + $showing = array( 'start' => IPSSearchRegistry::get('in.start') + 1, 'end' => ( IPSSearchRegistry::get('in.start') + IPSSearchRegistry::get('opt.search_per_page') ) > $count ? $count : IPSSearchRegistry::get('in.start') + IPSSearchRegistry::get('opt.search_per_page') ); + } + else + { + $count = 0; + $results = array(); + } + + /* Add Debug message */ + IPSDebug::addMessage( "View New Content Matches: " . $count ); + + /* Check for sortIn */ + if( count( $sortIn ) && !$this->request['search_app_filters'][ $this->request['search_app'] ]['searchInKey'] ) + { + $this->request['search_app_filters'][ $this->request['search_app'] ]['searchInKey'] = $sortIn[0][0]; + } + + /* Output */ + $this->title = $this->lang->words['new_posts_title']; + $this->registry->output->addNavigation( $this->lang->words['new_posts_title'], '' ); + $this->output .= $this->registry->output->getTemplate( 'search' )->newContentView( $results, $links, $count, $sortDropDown, $sortIn, IPSSearchRegistry::get('set.resultCutToDate') ); + } + + + /** + * Returns a url string that will maintain search results via links + * + * @return string + */ + protected function _buildURLString() + { + /* INI */ + $url_string = 'app=core&module=search&do=search&andor_type=' . $this->request['andor_type']; + $url_string .= '&sid=' . $this->request['_sid']; + + /* Add author name */ + if( !empty( $this->request['search_author'] ) ) + { + $url_string .= "&search_author=" . urlencode($this->request['search_author']); + } + + /* Search Range */ + if( !empty( $this->request['search_date_start'] ) ) + { + $url_string .= "&search_date_start={$this->request['search_date_start']}"; + } + + if( !empty( $this->request['search_date_end'] ) ) + { + $url_string .= "&search_date_end={$this->request['search_date_end']}"; + } + + if( !empty( $this->request['search_app_filters'][ $this->request['search_app'] ]['sortKey'] ) ) + { + $url_string .= "&search_app_filters[{$this->request['search_app']}][sortKey]=" . $this->request['search_app_filters'][ $this->request['search_app'] ]['sortKey']; + } + + if( !empty( $this->request['search_app_filters'][ $this->request['search_app'] ]['sortDir'] ) ) + { + $url_string .= "&search_app_filters[{$this->request['search_app']}][sortDir]=" . $this->request['search_app_filters'][ $this->request['search_app'] ]['sortDir']; + } + + /* Contextual Type */ + if ( IPSSearchRegistry::get('contextual.type') ) + { + $url_string .= "&cType=" . IPSSearchRegistry::get('contextual.type') . "&cId=" . IPSSearchRegistry::get('contextual.id'); + } + + /* Content Only */ + if( !empty( $this->request['search_content'] ) ) + { + $url_string .= "&search_content=" . $this->request['search_content']; + } + + if ( IPSSearchRegistry::get('in.raw_search_tags') ) + { + $url_string .= "&search_tags=" . urlencode( IPSSearchRegistry::get('in.raw_search_tags') ); + } + + /* Types */ + if( isset( $this->request['type'] ) && isset( $this->request['type_id'] ) ) + { + $url_string .= "&type={$this->request['type']}&type_id={$this->request['type_id']}"; + } + + if( isset( $this->request['type_2'] ) && isset( $this->request['type_id_2'] ) ) + { + $url_string .= "&type_2={$this->request['type_2']}&type_id_2={$this->request['type_id_2']}"; + } + + $url_string .= $this->_returnSearchAppFilters(); + + /* Fix up the search term a bit */ + $_search_term = str_replace( '&', '&', $this->request['search_term'] ); + $_search_term = str_replace( '"', '"', $_search_term ); + $_search_term = str_replace( '>', '>', $_search_term ); + $_search_term = str_replace( '<', '<', $_search_term ); + $_search_term = str_replace( '$', '$', $_search_term ); + + $url_string .= '&search_term=' . urlencode( $_search_term ); + + return $url_string; + } + + /** + * Return search app filters + * + * @return @e string + */ + protected function _returnSearchAppFilters() + { + $url_string = ''; + + if( isset($this->request['search_app_filters']) AND $this->request['search_app_filters'] ) + { + foreach( $this->request['search_app_filters'] as $app => $filters ) + { + if( $app == $this->request['search_app'] AND is_array( $filters ) AND count($filters) ) + { + foreach( $filters as $_filterKey => $_filterValue ) + { + if( is_array($_filterValue) ) + { + foreach( $_filterValue as $_filterValueKey => $_filterValueValue ) + { + $url_string .= "&search_app_filters[{$app}][{$_filterKey}][{$_filterValueKey}]={$_filterValueValue}"; + } + } + else + { + $url_string .= "&search_app_filters[{$app}][{$_filterKey}]={$_filterValue}"; + } + } + } + } + } + + return $url_string; + } + + /** + * Checks to see if the logged in user is allowed to use the search system + * + * @return @e void + */ + protected function _canSearch() + { + /* Check the search setting */ + if( ! $this->settings['allow_search'] ) + { + if( $this->xml_out ) + { + @header( "Content-type: text/html;charset={$this->settings['gb_char_set']}" ); + print $this->lang->words['search_off']; + exit(); + } + else + { + $this->registry->output->showError( 'search_off', 10145 ); + } + } + + /* Check the member authorization */ + if( ! isset( $this->memberData['g_use_search'] ) || ! $this->memberData['g_use_search'] ) + { + /* Is it a bot and we're looking for tags? */ + if ( $this->member->is_not_human && ( $this->request['do'] == 'search' && ! empty( $this->request['search_tags'] ) ) ) + { + return true; + } + else + { + if( $this->xml_out ) + { + @header( "Content-type: text/html;charset={$this->settings['gb_char_set']}" ); + print $this->lang->words['no_xml_permission']; + exit(); + } + else + { + $this->registry->output->showError( 'no_permission_to_search', 10146, null, null, 403 ); + } + } + } + } + + /** + * Clean search keys and values + */ + protected function _cleanInputFilters( $filters ) + { + if ( is_array( $filters ) ) + { + foreach( $filters as $k => $v ) + { + unset( $filters[ $k ] ); + + $k = IPSText::alphanumericalClean( $k ); + + if ( is_array( $v ) ) + { + $filters[ $k ] = $this->_cleanInputFilters( $v ); + } + else + { + $filters[ $k ] = IPSText::htmlspecialchars( $v ); + } + } + } + + return $filters; + } + + /** + * Resets params for template + */ + protected function _resetRequestParameters() + { + $this->request['period'] = IPSSearchRegistry::get('in.period'); + $this->request['real_period'] = IPSSearchRegistry::get('in.real_period'); + $this->request['search_app'] = IPSSearchRegistry::get('in.search_app'); + $this->request['vncFollowFilterOn'] = IPSSearchRegistry::get('in.vncFollowFilterOn'); + $this->request['followedItemsOnly'] = IPSSearchRegistry::get('in.vncFollowFilterOn'); + $this->request['userMode'] = IPSSearchRegistry::get('in.userMode'); + } + + } \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/task/index.html b/upload/admin/applications/core/modules_public/task/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_public/task/index.html +++ b/upload/admin/applications/core/modules_public/task/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/task/manualResolver.php b/upload/admin/applications/core/modules_public/task/manualResolver.php index 649c84ed..071bac01 100644 --- a/upload/admin/applications/core/modules_public/task/manualResolver.php +++ b/upload/admin/applications/core/modules_public/task/manualResolver.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Task Manager
      * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/modules_public/usercp/index.html b/upload/admin/applications/core/modules_public/usercp/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/modules_public/usercp/index.html +++ b/upload/admin/applications/core/modules_public/usercp/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/modules_public/usercp/manualResolver.php b/upload/admin/applications/core/modules_public/usercp/manualResolver.php index 28fd0d32..62b9ab01 100644 --- a/upload/admin/applications/core/modules_public/usercp/manualResolver.php +++ b/upload/admin/applications/core/modules_public/usercp/manualResolver.php @@ -3,7 +3,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * User control panel resolver
      * Last Updated: $Date: 2013-05-06 14:16:05 -0400 (Mon, 06 May 2013) $
      * 
    diff --git a/upload/admin/applications/core/setup/index.html b/upload/admin/applications/core/setup/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/setup/index.html +++ b/upload/admin/applications/core/setup/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/upgradeCheck.php b/upload/admin/applications/core/setup/upgradeCheck.php index bad82b82..70fbb6dc 100644 --- a/upload/admin/applications/core/setup/upgradeCheck.php +++ b/upload/admin/applications/core/setup/upgradeCheck.php @@ -61,7 +61,7 @@ class core_upgradeCheck $appName = ipsRegistry::$applications[ $k ]['app_title']; $allVersions = IPSSetUp::fetchXmlAppVersions( $k ); - return "Установленная версия {$appName} не будет работать с этой версией IP.Board. Вы должны обновить {$appName} версии {$allVersions[ $v ]} или выше, или отключить приложение в админцентре для продолжения."; + return "The version of {$appName} you have installed will not work with this version of IP.Board. You must upgrade {$appName} to {$allVersions[ $v ]} or higher, or disable it in the Admin CP in order continue."; } } } diff --git a/upload/admin/applications/core/setup/versions/index.html b/upload/admin/applications/core/setup/versions/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/setup/versions/index.html +++ b/upload/admin/applications/core/setup/versions/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/install/index.html b/upload/admin/applications/core/setup/versions/install/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/setup/versions/install/index.html +++ b/upload/admin/applications/core/setup/versions/install/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/install/sql/core_mysql_inserts.php b/upload/admin/applications/core/setup/versions/install/sql/core_mysql_inserts.php index 364475f4..684c7e4c 100644 --- a/upload/admin/applications/core/setup/versions/install/sql/core_mysql_inserts.php +++ b/upload/admin/applications/core/setup/versions/install/sql/core_mysql_inserts.php @@ -48,24 +48,24 @@ $INSERT[] = "INSERT INTO emoticons (id, typed, image, clickable, emo_set, emo_po $INSERT[] = "INSERT INTO pfields_data (pf_id, pf_title, pf_desc, pf_content, pf_type, pf_not_null, pf_member_hide, pf_max_input, pf_member_edit, pf_position, pf_show_on_reg, pf_input_format, pf_admin_only, pf_topic_format, pf_group_id, pf_icon, pf_key) VALUES (1, 'AIM', '', '', 'input', 0, 0, 0, 1, 0, 0, '', 0, '', 1, 'style_extra/cprofile_icons/profile_aim.gif', 'aim'), (2, 'MSN', '', '', 'input', 0, 0, 0, 1, 0, 0, '', 0, '', 1, 'style_extra/cprofile_icons/profile_msn.gif', 'msn'), -(3, 'Сайт', '', '', 'input', 0, 0, 0, 1, 0, 0, '', 0, '', 1, 'style_extra/cprofile_icons/profile_website.gif', 'website'), +(3, 'Website URL', '', '', 'input', 0, 0, 0, 1, 0, 0, '', 0, '', 1, 'style_extra/cprofile_icons/profile_website.gif', 'website'), (4, 'ICQ', '', '', 'input', 0, 0, 0, 1, 0, 0, '', 0, '', 1, 'style_extra/cprofile_icons/profile_icq.gif', 'icq'), -(5, 'Пол', '', 'u=Не определился|m=Мужчина|f=Женщина', 'drop', 0, 0, 0, 1, 0, 0, '', 0, '', 2, '', 'gender'), -(6, 'Город', '', '', 'input', 0, 0, 0, 1, 0, 0, '', 0, '{title}{content}', 2, '', 'location'), -(7, 'Интересы', '', '', 'textarea', 0, 0, 0, 1, 0, 0, '', 0, '', 2, '', 'interests'), +(5, 'Gender', '', 'u=Not Telling|m=Male|f=Female', 'drop', 0, 0, 0, 1, 0, 0, '', 0, '', 2, '', 'gender'), +(6, 'Location', '', '', 'input', 0, 0, 0, 1, 0, 0, '', 0, '{title}{content}', 2, '', 'location'), +(7, 'Interests', '', '', 'textarea', 0, 0, 0, 1, 0, 0, '', 0, '', 2, '', 'interests'), (8, 'Yahoo', '', '', 'input', 0, 0, 0, 1, 0, 0, '', 0, '', 1, 'style_extra/cprofile_icons/profile_yahoo.gif', 'yahoo'), (9, 'Jabber', '', '', 'input', 0, 0, 0, 1, 0, 0, '', 0, '', 1, 'style_extra/cprofile_icons/profile_jabber.gif', 'jabber'), (10, 'Skype', '', '', 'input', 0, 0, 0, 1, 0, 0, '', 0, '', 1, 'style_extra/cprofile_icons/profile_skype.gif', 'skype')"; $INSERT[] = "INSERT INTO pfields_groups (pf_group_id, pf_group_name, pf_group_key) VALUES -(1, 'Контакты', 'contact'), -(2, 'Информация', 'profile_info')"; +(1, 'Contact Methods', 'contact'), +(2, 'Profile Information', 'profile_info')"; -$INSERT[] = "INSERT INTO core_sys_lang VALUES(1, 'ru_RU.UTF-8', 'Русский (RU)', 1, 0, 1)"; +$INSERT[] = "INSERT INTO core_sys_lang VALUES(1, 'en_US', 'English (USA)', 1, 0, 1)"; -$INSERT[] = "INSERT INTO titles (id, posts, title, pips) VALUES (1, 0, 'Новичок', '1');"; -$INSERT[] = "INSERT INTO titles (id, posts, title, pips) VALUES (2, 10, 'Пользователь', '2');"; -$INSERT[] = "INSERT INTO titles (id, posts, title, pips) VALUES (4, 30, 'Продвинутый пользователь', '3');"; +$INSERT[] = "INSERT INTO titles (id, posts, title, pips) VALUES (1, 0, 'Newbie', '1');"; +$INSERT[] = "INSERT INTO titles (id, posts, title, pips) VALUES (2, 10, 'Member', '2');"; +$INSERT[] = "INSERT INTO titles (id, posts, title, pips) VALUES (4, 30, 'Advanced Member', '3');"; $INSERT[] ="INSERT INTO permission_index VALUES(1, 'members', 'profile_view', 1, '*', '', '', '', '', '', '', 0, 0, NULL)"; $INSERT[] ="INSERT INTO permission_index VALUES(2, 'core', 'help', 1, '*', '', '', '', '', '', '', 0, 0, NULL)"; @@ -74,25 +74,25 @@ $INSERT[] ="INSERT INTO permission_index VALUES(2, 'core', 'help', 1, '*', '', ' $INSERT[] = <<IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_10002/index.html b/upload/admin/applications/core/setup/versions/upg_10002/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/setup/versions/upg_10002/index.html +++ b/upload/admin/applications/core/setup/versions/upg_10002/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_10002/version_upgrade_mysql.php b/upload/admin/applications/core/setup/versions/upg_10002/version_upgrade_mysql.php index 7ef1d949..f560d3f2 100644 --- a/upload/admin/applications/core/setup/versions/upg_10002/version_upgrade_mysql.php +++ b/upload/admin/applications/core/setup/versions/upg_10002/version_upgrade_mysql.php @@ -2,7 +2,7 @@ /* +-------------------------------------------------------------------------- -| IP.Board v3.4.5 +| IP.Board v3.4.6 | ======================================== | by Matthew Mecham | (c) 2001 - 2004 Invision Power Services @@ -1918,8 +1918,8 @@ class version_upgrade $SQL[] = "INSERT INTO ".ipsRegistry::dbFunctions()->getPrefix()."cache_store (cs_key, cs_value, cs_extra, cs_array) VALUES ('calendar', 'a:0:{}', '', 1);"; $SQL[] = "INSERT INTO ".ipsRegistry::dbFunctions()->getPrefix()."skin_sets (set_skin_set_id, set_name, set_image_dir, set_hidden, set_default, set_css_method, set_skin_set_parent, set_author_email, set_author_name, set_author_url, set_css, set_cache_macro, set_wrapper, set_css_updated, set_cache_css, set_cache_wrapper, set_emoticon_folder) VALUES (1, 'IPB Master Skin Set', '1', 0, 0, '0', -1, '', '', '', '', '', '', 1079109298, '', '', 'default');"; - //$SQL[] = "INSERT INTO ".ipsRegistry::dbFunctions()->getPrefix()."skin_sets (set_skin_set_id, set_name, set_image_dir, set_hidden, set_default, set_css_method, set_skin_set_parent, set_author_email, set_author_name, set_author_url, set_css, set_cache_macro, set_wrapper, set_css_updated, set_cache_css, set_cache_wrapper, set_emoticon_folder) VALUES (2, 'IPB Default Skin', '1', 0, 1, '0', -1, 'ipbauto@invisionboard.com', 'Invision Power Services', 'www.invisionboard.com', '', '', '', 1074679074, '', '', 'default');"; - $SQL[] = "INSERT INTO ".ipsRegistry::dbFunctions()->getPrefix()."skin_sets (set_skin_set_id, set_name, set_image_dir, set_hidden, set_default, set_css_method, set_skin_set_parent, set_author_email, set_author_name, set_author_url, set_css, set_cache_macro, set_wrapper, set_css_updated, set_cache_css, set_cache_wrapper, set_emoticon_folder) VALUES (3, 'IPB Pre-2.0 Skins', '1', 0, 0, '0', -1, 'ipbauto@invisionboard.com', 'Invision Power Services', 'www.invisionboard.com', '', '', '', 1074679074, '', '', 'default');"; + //$SQL[] = "INSERT INTO ".ipsRegistry::dbFunctions()->getPrefix()."skin_sets (set_skin_set_id, set_name, set_image_dir, set_hidden, set_default, set_css_method, set_skin_set_parent, set_author_email, set_author_name, set_author_url, set_css, set_cache_macro, set_wrapper, set_css_updated, set_cache_css, set_cache_wrapper, set_emoticon_folder) VALUES (2, 'IPB Default Skin', '1', 0, 1, '0', -1, '', 'Invision Power Services', '', '', '', '', 1074679074, '', '', 'default');"; + $SQL[] = "INSERT INTO ".ipsRegistry::dbFunctions()->getPrefix()."skin_sets (set_skin_set_id, set_name, set_image_dir, set_hidden, set_default, set_css_method, set_skin_set_parent, set_author_email, set_author_name, set_author_url, set_css, set_cache_macro, set_wrapper, set_css_updated, set_cache_css, set_cache_wrapper, set_emoticon_folder) VALUES (3, 'IPB Pre-2.0 Skins', '1', 0, 0, '0', -1, '', 'Invision Power Services', '', '', '', '', 1074679074, '', '', 'default');"; $SQL[] = "INSERT INTO ".ipsRegistry::dbFunctions()->getPrefix()."conf_settings_titles (conf_title_id, conf_title_title, conf_title_desc, conf_title_count) VALUES (1, 'General Configuration', 'These settings control the basics of the board such as URLs and paths.', 17);"; @@ -1950,7 +1950,7 @@ class version_upgrade $SQL[] = "REPLACE INTO ".ipsRegistry::dbFunctions()->getPrefix()."faq VALUES (1, 'Registration benefits', 'To be able to use all the features on this board, the administrator will probably require that you register for a member account. Registration is free and only takes a moment to complete.\r
    \r
    During registration, the administrator requires that you supply a valid email address. This is important as the administrator may require that you validate your registration via an email. If this is the case, you will be notified when registering. If your e-mail does not arrive, then on the member bar at the top of the page, there will be a link that will allow you to re-send the validation e-mail. \r
    \r
    In some cases, the administrator will need to approve your registration before you can use your member account fully. If this is the case you will be notified during registration.\r
    \r
    Once you have registered and logged in, you will have access to your personal messenger and your control panel.\r
    \r
    For more information on these items, please see the relevant sections in this documentation.', 'How to register and the added benefits of being a registered member.');"; - $SQL[] = "REPLACE INTO ".ipsRegistry::dbFunctions()->getPrefix()."faq VALUES (2, 'Cookies and cookie usage', 'Using cookies is optional, but strongly recommended. Cookies are used to track topics, showing you which topics have new replies since your last visit and to automatically log you in when you return.\r
    \r
    If your computer is unable to use the cookie system to browse the board correctly, then the board will automatically add in a session ID to each link to track you around the board.\r
    \r
    Clearing Cookies\r
    \r
    You can clear the cookies at any time by clicking on the link found at the bottom of the main board page (the first page you see when returning to the board). If this does not work for you, you may need to remove the cookies manually.\r
    \r
    Removing Cookies in Internet Explorer for Windows\r
    \r
      \r
    • Close all open Internet Explorer Windows\r
    • Click on the \'start\' button\r
    • Move up to \'Find\' and click on \'Files and Folders\'\r
    • When the new window appears, type in the domain name of the board you are using into the \'containing text\' field. (If the boards address was \'http://www.invisionboard.com/forums/index.php\' you would enter \'invisionboard.com\' without the quotes)\r
    • In the \'look in\' box, type in C:WindowsCookies and press \'Find Now\'\r
    • After it has finished searching, highlight all files (click on a file then press CTRL+A) and delete them.\r
    \r
    \r
    Removing Cookies in Internet Explorer for Macintosh\r
    \r
      \r
    • With Internet Explorer active, choose \'Edit\' and then \'Preferences\' from the Macintosh menu bar at the top of the screen\r
    • When the preferences panel opens, choose \'Cookies\' found in the \'Receiving Files\' section.\r
    • When the cookie pane loads, look for the domain name of the board (If the boards address was \'http://www.invisionboard.com/forums/index.php\' look for \'invisionboard.com\' or \'www.invisionboard.com\'\r
    • For each cookie, click on the entry and press the delete button.\r
    \r
    \r
    Your cookies should now be removed. In some cases you may need to restart your computer for the changes to take effect.', 'The benefits of using cookies and how to remove cookies set by this board.');"; + $SQL[] = "REPLACE INTO ".ipsRegistry::dbFunctions()->getPrefix()."faq VALUES (2, 'Cookies and cookie usage', 'Using cookies is optional, but strongly recommended. Cookies are used to track topics, showing you which topics have new replies since your last visit and to automatically log you in when you return.\r
    \r
    If your computer is unable to use the cookie system to browse the board correctly, then the board will automatically add in a session ID to each link to track you around the board.\r
    \r
    Clearing Cookies\r
    \r
    You can clear the cookies at any time by clicking on the link found at the bottom of the main board page (the first page you see when returning to the board). If this does not work for you, you may need to remove the cookies manually.\r
    \r
    Removing Cookies in Internet Explorer for Windows\r
    \r
      \r
    • Close all open Internet Explorer Windows\r
    • Click on the \'start\' button\r
    • Move up to \'Find\' and click on \'Files and Folders\'\r
    • When the new window appears, type in the domain name of the board you are using into the \'containing text\' field. (If the boards address was \'http://www.example.com/forums/index.php\' you would enter \'example.com\' without the quotes)\r
    • In the \'look in\' box, type in C:WindowsCookies and press \'Find Now\'\r
    • After it has finished searching, highlight all files (click on a file then press CTRL+A) and delete them.\r
    \r
    \r
    Removing Cookies in Internet Explorer for Macintosh\r
    \r
      \r
    • With Internet Explorer active, choose \'Edit\' and then \'Preferences\' from the Macintosh menu bar at the top of the screen\r
    • When the preferences panel opens, choose \'Cookies\' found in the \'Receiving Files\' section.\r
    • When the cookie pane loads, look for the domain name of the board (If the boards address was \'http://www.example.com/forums/index.php\' look for \'example.com\' or \'www.example.com\'\r
    • For each cookie, click on the entry and press the delete button.\r
    \r
    \r
    Your cookies should now be removed. In some cases you may need to restart your computer for the changes to take effect.', 'The benefits of using cookies and how to remove cookies set by this board.');"; $SQL[] = "REPLACE INTO ".ipsRegistry::dbFunctions()->getPrefix()."faq VALUES (3, 'Recovering lost or forgotten passwords', 'Security is a big feature on this board, and to that end, all passwords are encrypted when you register.\r
    This means that we cannot email your password to you as we hold no record of your \'uncrypted\' password. You can however, apply to have your password reset.\r
    \r
    To do this, click on the Lost Password link found on the log in page.\r
    \r
    Further instruction is available from there.', 'How to reset your password if you\'ve forgotton it.');"; $SQL[] = "REPLACE INTO ".ipsRegistry::dbFunctions()->getPrefix()."faq VALUES (4, 'Your Control Panel (My Controls)', 'Your control panel is your own private board console. You can change how the board looks and feels as well as your own information from here.\r
    \r
    Subscriptions\r
    \r
    This is where you manage your topic and forums subscriptions. Please see the help file \'Email Notification of new messages\' for more information on how to subscribe to topics.\r
    \r
    Edit Profile Info\r
    \r
    This section allows you to add or edit your contact information and enter some personal information if you choose.\r
    \r
    Edit Signature\r
    \r
    A board \'signature\' is very similar to an email signature. This signature is attached to the foot of every message you post unless you choose to check the box that allows you to ommit the signature in the message you are posting. You may use BB Code if available and in some cases, pure HTML (if the board administrator allows it).\r
    \r
    Edit Avatar Settings\r
    \r
    An avatar is a little image that appears under your username when you view a topic or post you authored. If the administrator allows, you may either choose from the board gallery, enter a URL to an avatar stored on your server or upload an avatar to use. You may also set the width of the avatar to ensure that it\'s sized in proportion.\r
    \r
    Change Personal Photo\r
    \r
    This section will allow you to add a photograph to your profile. This will be displayed when a user clicks to view your profile, on the mini-profile screen and will also be linked to from the member list.\r
    \r
    Email Settings\r
    \r
    Hide my email address allows you to deny the ability for other users to send you an email from the board.\r
    Send me updates sent by the board administrator will allow the administrator to include your email address in any mailings they send out - this is used mostly for important updates and community information.\r
    Include a copy of the post when emailing me from a subscribed topic, this allows you to have the new post included in any reply to topic notifications.\r
    Send a confirmation email when I receive a new private message, this will send you an e-mail notification to your registered e-mail address each time you receive a private message on the board.\r
    Enable \'Email Notification\' by default?, this will automatically subscribe you to any topic that you make a reply to. You may unsubscribe from the \'Subscriptions\' section of My Controls if you wish.\r
    \r
    Board Settings\r
    \r
    From this section, you can set your time zone, choose to not see users signatures, avatars and posted images.\r
    You can choose to get a pop up window informing you when you have a new message and choose to show or hide the \'Fast Reply\' box where it is enabled.\r
    You are also able to choose display preferences for the number of topics/posts shown per page on the board.\r
    \r
    Skins and Languages\r
    \r
    If available, you can choose a skin style and language choice. This affects how the board is displayed so you may wish to preview the skin before submitting the form.\r
    \r
    Change Email Address\r
    \r
    At any time, you can change the email address that is registered to your account. In some cases, you will need to revalidate your account after changing your email address. If this is the case, you will be notified before your email address change is processed.\r
    \r
    Change Password\r
    \r
    You may change your password from this section. Please note that you will need to know your current password before you can change your password.', 'Editing contact information, personal information, avatars, signatures, board settings, languages and style choices.');"; $SQL[] = "REPLACE INTO ".ipsRegistry::dbFunctions()->getPrefix()."faq VALUES (5, 'Email Notification of new messages', 'This board can notify you when a new reply is added to a topic. Many users find this useful to keep up to date on topics without the need to view the board to check for new messages.\r
    \r
    There are three ways to subscribe to a topic:\r
    \r
  • Click the \'Track This Topic\' link at the top of the topic that you wish to track\r
  • On the posting screen when replying to or creating a topic, check the \'Enable email notification of replies?\' checkbox\r
  • From the E-Mail settings section of your User CP (My Controls) check the \'Enable Email Notification by default?\' option, this will automatically subscribe you to any topic that you make a reply to\r
    \r
    Please note that to avoid multiple emails being sent to your email address, you will only get one e-mail for each topic you are subscribed to until the next time you visit the board.\r
    \r
    You are also able to subscribe to each individual forum on the board, to be notified when a new topic is created in that particular forum. To enable this, click the \'Subscribe to this forum\' link at the bottom of the forum that you wish to subscribe to.\r
    \r
    To unsubscribe from any forums or topics that you are subscribed to - just go to the \'Subscriptions\' section of \'My Controls\' and you can do this from there.', 'How to get emailed when a new reply is added to a topic.');"; diff --git a/upload/admin/applications/core/setup/versions/upg_10004/index.html b/upload/admin/applications/core/setup/versions/upg_10004/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/setup/versions/upg_10004/index.html +++ b/upload/admin/applications/core/setup/versions/upg_10004/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_10004/version_upgrade_mysql.php b/upload/admin/applications/core/setup/versions/upg_10004/version_upgrade_mysql.php index d2559263..b0c31d2b 100644 --- a/upload/admin/applications/core/setup/versions/upg_10004/version_upgrade_mysql.php +++ b/upload/admin/applications/core/setup/versions/upg_10004/version_upgrade_mysql.php @@ -2,7 +2,7 @@ /* +-------------------------------------------------------------------------- -| IP.Board v3.4.5 +| IP.Board v3.4.6 | ======================================== | by Matthew Mecham | (c) 2001 - 2004 Invision Power Services @@ -1703,8 +1703,8 @@ class version_upgrade $SQL[] = "INSERT INTO ".ipsRegistry::dbFunctions()->getPrefix()."cache_store (cs_key, cs_value, cs_extra, cs_array) VALUES ('calendar', 'a:0:{}', '', 1);"; $SQL[] = "INSERT INTO ".ipsRegistry::dbFunctions()->getPrefix()."skin_sets (set_skin_set_id, set_name, set_image_dir, set_hidden, set_default, set_css_method, set_skin_set_parent, set_author_email, set_author_name, set_author_url, set_css, set_cache_macro, set_wrapper, set_css_updated, set_cache_css, set_cache_wrapper, set_emoticon_folder) VALUES (1, 'IPB Master Skin Set', '1', 0, 0, '0', -1, '', '', '', '', '', '', 1079109298, '', '', 'default');"; - //$SQL[] = "INSERT INTO ".ipsRegistry::dbFunctions()->getPrefix()."skin_sets (set_skin_set_id, set_name, set_image_dir, set_hidden, set_default, set_css_method, set_skin_set_parent, set_author_email, set_author_name, set_author_url, set_css, set_cache_macro, set_wrapper, set_css_updated, set_cache_css, set_cache_wrapper, set_emoticon_folder) VALUES (2, 'IPB Default Skin', '1', 0, 1, '0', -1, 'ipbauto@invisionboard.com', 'Invision Power Services', 'www.invisionboard.com', '', '', '', 1074679074, '', '', 'default');"; - $SQL[] = "INSERT INTO ".ipsRegistry::dbFunctions()->getPrefix()."skin_sets (set_skin_set_id, set_name, set_image_dir, set_hidden, set_default, set_css_method, set_skin_set_parent, set_author_email, set_author_name, set_author_url, set_css, set_cache_macro, set_wrapper, set_css_updated, set_cache_css, set_cache_wrapper, set_emoticon_folder) VALUES (3, 'IPB Pre-2.0 Skins', '1', 0, 0, '0', -1, 'ipbauto@invisionboard.com', 'Invision Power Services', 'www.invisionboard.com', '', '', '', 1074679074, '', '', 'default');"; + //$SQL[] = "INSERT INTO ".ipsRegistry::dbFunctions()->getPrefix()."skin_sets (set_skin_set_id, set_name, set_image_dir, set_hidden, set_default, set_css_method, set_skin_set_parent, set_author_email, set_author_name, set_author_url, set_css, set_cache_macro, set_wrapper, set_css_updated, set_cache_css, set_cache_wrapper, set_emoticon_folder) VALUES (2, 'IPB Default Skin', '1', 0, 1, '0', -1, '', 'Invision Power Services', '', '', '', '', 1074679074, '', '', 'default');"; + $SQL[] = "INSERT INTO ".ipsRegistry::dbFunctions()->getPrefix()."skin_sets (set_skin_set_id, set_name, set_image_dir, set_hidden, set_default, set_css_method, set_skin_set_parent, set_author_email, set_author_name, set_author_url, set_css, set_cache_macro, set_wrapper, set_css_updated, set_cache_css, set_cache_wrapper, set_emoticon_folder) VALUES (3, 'IPB Pre-2.0 Skins', '1', 0, 0, '0', -1, '', 'Invision Power Services', '', '', '', '', 1074679074, '', '', 'default');"; $SQL[] = "INSERT INTO ".ipsRegistry::dbFunctions()->getPrefix()."conf_settings_titles (conf_title_id, conf_title_title, conf_title_desc, conf_title_count) VALUES (1, 'General Configuration', 'These settings control the basics of the board such as URLs and paths.', 17);"; diff --git a/upload/admin/applications/core/setup/versions/upg_20004/index.html b/upload/admin/applications/core/setup/versions/upg_20004/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/setup/versions/upg_20004/index.html +++ b/upload/admin/applications/core/setup/versions/upg_20004/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_20004/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_20004/mysql_updates.php index 5e6ca57b..b1afcf00 100644 --- a/upload/admin/applications/core/setup/versions/upg_20004/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_20004/mysql_updates.php @@ -2,7 +2,7 @@ /* +-------------------------------------------------------------------------- -| IP.Board v3.4.5 +| IP.Board v3.4.6 | ======================================== | by Matthew Mecham | (c) 2001 - 2004 Invision Power Services diff --git a/upload/admin/applications/core/setup/versions/upg_20005/index.html b/upload/admin/applications/core/setup/versions/upg_20005/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/setup/versions/upg_20005/index.html +++ b/upload/admin/applications/core/setup/versions/upg_20005/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_20005/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_20005/mysql_updates.php index 992bbb0e..61b81f94 100644 --- a/upload/admin/applications/core/setup/versions/upg_20005/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_20005/mysql_updates.php @@ -2,7 +2,7 @@ /* +-------------------------------------------------------------------------- -| IP.Board v3.4.5 +| IP.Board v3.4.6 | ======================================== | by Matthew Mecham | (c) 2001 - 2004 Invision Power Services diff --git a/upload/admin/applications/core/setup/versions/upg_20007/index.html b/upload/admin/applications/core/setup/versions/upg_20007/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/setup/versions/upg_20007/index.html +++ b/upload/admin/applications/core/setup/versions/upg_20007/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_20007/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_20007/mysql_updates.php index 0ee24752..55e371a2 100644 --- a/upload/admin/applications/core/setup/versions/upg_20007/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_20007/mysql_updates.php @@ -2,7 +2,7 @@ /* +-------------------------------------------------------------------------- -| IP.Board v3.4.5 +| IP.Board v3.4.6 | ======================================== | by Matthew Mecham | (c) 2001 - 2004 Invision Power Services diff --git a/upload/admin/applications/core/setup/versions/upg_20009/index.html b/upload/admin/applications/core/setup/versions/upg_20009/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/setup/versions/upg_20009/index.html +++ b/upload/admin/applications/core/setup/versions/upg_20009/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_20009/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_20009/mysql_updates.php index f2981ed3..78f60005 100644 --- a/upload/admin/applications/core/setup/versions/upg_20009/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_20009/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_20010/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_20010/mysql_updates.php index b84aaea6..bbb89d44 100644 --- a/upload/admin/applications/core/setup/versions/upg_20010/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_20010/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_20012/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_20012/mysql_updates.php index 14c5b624..f9b0b6bb 100644 --- a/upload/admin/applications/core/setup/versions/upg_20012/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_20012/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_21003/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_21003/mysql_updates.php index 4b996313..f6e338f4 100644 --- a/upload/admin/applications/core/setup/versions/upg_21003/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_21003/mysql_updates.php @@ -1,7 +1,7 @@ IPB UPGRADE MODULE:: IPB 2.0.2 -> IPB 2.0.3 -| > Script written by Matt Mecham -| > Date started: 23rd April 2004 -| > "So what, pop is dead - it's no great loss. - So many facelifts, it's face flew off" -+-------------------------------------------------------------------------- -*/ - -if ( ! defined( 'IN_IPB' ) ) -{ - print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -class version_upgrade -{ - /** - * Custom HTML to show - * - * @var string - */ - protected $_output = ''; - - /** - * fetchs output - * - * @return string - */ - public function fetchOutput() - { - return $this->_output; - } - - /** - * Execute selected method - * - * @param object Registry object - * @return @e void - */ - public function doExecute( ipsRegistry $registry ) - { - /* Make object */ - $this->registry = $registry; - $this->DB = $this->registry->DB(); - $this->settings =& $this->registry->fetchSettings(); - $this->request =& $this->registry->fetchRequest(); - $this->cache = $this->registry->cache(); - $this->caches =& $this->registry->cache()->fetchCaches(); - - //-------------------------------- - // What are we doing? - //-------------------------------- - - switch( $this->request['workact'] ) - { - case 'sql': - $this->upgrade_sql(1); - break; - case 'sql1': - $this->upgrade_sql(1); - break; - case 'sql2': - $this->upgrade_sql(2); - break; - case 'sql3': - $this->upgrade_sql(3); - break; - case 'sql4': - $this->upgrade_sql(4); - break; - case 'polls': - $this->convert_polls(); - break; - case 'calevents': - $this->convert_calevents(); - break; - case 'skin': - $this->add_skin(); - break; - - default: - $this->upgrade_sql(1); - break; - } - - if ( $this->request['workact'] ) - { - return false; - } - else - { - return true; - } - } - - - /*-------------------------------------------------------------------------*/ - // SQL: 0 - /*-------------------------------------------------------------------------*/ - - function upgrade_sql( $id=1 ) - { - $man = 0; // Manual upgrade ? intval( $this->request['man'] ); - $cnt = 0; - $SQL = array(); - $file = '_updates_'.$id.'.php'; - $output = ""; - $path = IPSLib::getAppDir( 'core' ) . '/setup/versions/upg_21003/' . strtolower( $this->registry->dbFunctions()->getDriverType() ) . $file; - $prefix = $this->registry->dbFunctions()->getPrefix(); - - if ( is_file( $path ) ) - { - require( $path );/*noLibHook*/ - - $this->error = array(); - $this->sqlcount = 0; - $output = ""; - - $this->DB->return_die = 1; - - foreach( $SQL as $query ) - { - $this->DB->allow_sub_select = 1; - $this->DB->error = ''; - - $query = str_replace( "<%time%>", time(), $query ); - - /* Need to tack on a prefix? */ - if ( $prefix ) - { - $query = IPSSetUp::addPrefixToQuery( $query, $prefix ); - } - - if ( IPSSetUp::getSavedData('man') ) - { - $output .= preg_replace( "/\s{1,}/", " ", $query ) . "\n\n"; - } - else - { - if( ! $query ) - { - continue; - } - - $this->DB->query( $query ); - - if ( $this->DB->error ) - { - $this->registry->output->addError( $query."

    ".$this->DB->error ); - } - else - { - $this->sqlcount++; - } - } - } - - $this->registry->output->addMessage("{$this->sqlcount} запросов выполнено...."); - } - - //-------------------------------- - // Next page... - //-------------------------------- - - $this->request['st'] = 0; - - if ( $id != 4 ) - { - $nextid = $id + 1; - $this->request['workact'] = 'sql'.$nextid; - } - else - { - $this->request['workact'] = 'polls'; - } - - if ( IPSSetUp::getSavedData('man') AND $output ) - { - /* Create source file */ - if ( $this->registry->dbFunctions()->getDriverType() == 'mysql' ) - { - $sourceFile = IPSSetUp::createSqlSourceFile( $output, '21003', $id ); - } - - $this->_output = $this->registry->output->template()->upgrade_manual_queries( $output, $sourceFile ); - } - } - - - /*-------------------------------------------------------------------------*/ - // POLLS - /*-------------------------------------------------------------------------*/ - - function convert_polls() - { - $start = intval($this->request['st']) > 0 ? intval($this->request['st']) : 0; - $lend = 50; - $end = $start + $lend; - $max = intval(IPSSetUp::getSavedData('max')); - $converted = intval(IPSSetUp::getSavedData('conv')); - - //----------------------------------------- - // First off.. grab number of polls to convert - //----------------------------------------- - - if ( ! $max ) - { - $total = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as max', - 'from' => 'topics', - 'where' => "poll_state IN ('open', 'close', 'closed')" ) ); - - $max = $total['max']; - } - - //----------------------------------------- - // In steps... - //----------------------------------------- - - $this->DB->build( array( 'select' => '*', - 'from' => 'topics', - 'where' => "poll_state IN ('open', 'close', 'closed' )", - 'limit' => array( 0, $lend ) ) ); - $o = $this->DB->execute(); - - //----------------------------------------- - // Do it... - //----------------------------------------- - - if ( $this->DB->getTotalRows($o) ) - { - //----------------------------------------- - // Got some to convert! - //----------------------------------------- - - while ( $r = $this->DB->fetch($o) ) - { - $converted++; - - //----------------------------------------- - // All done? - //----------------------------------------- - - if ( $converted >= $max ) - { - $done = 1; - } - - $new_poll = array( 1 => array() ); - - $poll_data = $this->DB->buildAndFetch( array( 'select' => '*', - 'from' => 'polls', - 'where' => "tid=".$r['tid'] - ) ); - if ( ! $poll_data['pid'] ) - { - continue; - } - - if ( ! $poll_data['poll_question'] ) - { - $poll_data['poll_question'] = $r['title']; - } - - //----------------------------------------- - // Kick start new poll - //----------------------------------------- - - $new_poll[1]['question'] = $poll_data['poll_question']; - - //----------------------------------------- - // Get OLD polls - //----------------------------------------- - - $poll_answers = unserialize( stripslashes( $poll_data['choices'] ) ); - - reset($poll_answers); - - foreach ( $poll_answers as $entry ) - { - $id = $entry[0]; - $choice = $entry[1]; - $votes = $entry[2]; - - $total_votes += $votes; - - if ( strlen($choice) < 1 ) - { - continue; - } - - $new_poll[ 1 ]['choice'][ $id ] = $choice; - $new_poll[ 1 ]['votes'][ $id ] = $votes; - } - - //----------------------------------------- - // Got something? - //----------------------------------------- - - if ( count( $new_poll[1]['choice'] ) ) - { - $this->DB->update( 'polls' , array( 'choices' => serialize( $new_poll ) ), 'tid='.$r['tid'] ); - $this->DB->update( 'topics', array( 'poll_state' => 1 ), 'tid='.$r['tid'] ); - } - } - } - else - { - $done = 1; - } - - - if ( ! $done ) - { - $this->registry->output->addMessage("Polls: $start to $end completed...."); - $this->request['workact'] = 'polls'; - $this->request['st'] = $end; - IPSSetUp::setSavedData('max', $max); - IPSSetUp::setSavedData('conv', $converted); - return FALSE; - } - else - { - $this->registry->output->addMessage("Polls converted, proceeding to calendar events..."); - $this->request['workact'] = 'calevents'; - $this->request['st'] = '0'; - return FALSE; - } - } - - - /*-------------------------------------------------------------------------*/ - // CALENDAR EVENTS - /*-------------------------------------------------------------------------*/ - - function convert_calevents() - { - $start = intval($this->request['st']) > 0 ? intval($this->request['st']) : 0; - $lend = 50; - $end = $start + $lend; - - //----------------------------------------- - // In steps... - //----------------------------------------- - - if( !$this->DB->checkForTable('calendar_events') ) - { - $this->registry->output->addMessage("События календаря не найдены, Создается новый стиль внешнего вида IPB 2.1..."); - $this->request['workact'] = 'skin'; - return FALSE; - } - - $this->DB->build( array( 'select' => '*', - 'from' => 'calendar_events', - 'limit' => array( $start, $lend ) ) ); - $o = $this->DB->execute(); - - //----------------------------------------- - // Do it... - //----------------------------------------- - - if ( $this->DB->getTotalRows($o) ) - { - //----------------------------------------- - // Got some to convert! - //----------------------------------------- - - while ( $r = $this->DB->fetch($o) ) - { - $recur_remap = array( 'w' => 1, - 'm' => 2, - 'y' => 3 ); - - $begin_date = IPSTime::date_getgmdate( $r['unix_stamp'] ); - $end_date = IPSTime::date_getgmdate( $r['end_unix_stamp'] ); - - if ( ! $begin_date OR ! $end_date ) - { - continue; - } - - $day = $begin_date['mday']; - $month = $begin_date['mon']; - $year = $begin_date['year']; - - $end_day = $end_date['mday']; - $end_month = $end_date['mon']; - $end_year = $end_date['year']; - - $_final_unix_from = gmmktime(0, 0, 0, $month, $day, $year ); - - //----------------------------------------- - // Recur or ranged... - //----------------------------------------- - - if ( $r['event_repeat'] OR $r['event_ranged'] ) - { - $_final_unix_to = gmmktime(11, 59, 59, $end_month, $end_day, $end_year); - } - else - { - $_final_unix_to = 0; - } - - $new_event = array( 'event_calendar_id' => 1, - 'event_member_id' => $r['userid'], - 'event_content' => $r['event_text'], - 'event_title' => $r['title'], - 'event_smilies' => $r['show_emoticons'], - 'event_perms' => $r['read_perms'], - 'event_private' => $r['priv_event'], - 'event_approved' => 1, - 'event_unixstamp' => $r['unix_stamp'], - 'event_recurring' => ( $r['event_repeat'] && $recur_remap[ $r['repeat_unit'] ] ) ? $recur_remap[ $r['repeat_unit'] ] : 0, - 'event_tz' => 0, - 'event_unix_from' => $_final_unix_from, - 'event_unix_to' => $_final_unix_to ); - - //----------------------------------------- - // INSERT - //----------------------------------------- - - $this->DB->insert( 'cal_events', $new_event ); - } - - $this->registry->output->addMessage("Calendar events: $start to $end completed...."); - $this->request['workact'] = 'calevents'; - $this->request['st'] = $end; - return FALSE; - } - else - { - $this->registry->output->addMessage("Calendar events converted, Creating new IPB 2.1 skin..."); - $this->request['workact'] = 'skin'; - return FALSE; - } - } - - - - /*-------------------------------------------------------------------------*/ - // CALENDAR EVENTS - /*-------------------------------------------------------------------------*/ - - function add_skin() - { - $this->registry->output->addMessage("Skipping 2.1 skin creation (latest skin will be inserted later)..."); - unset($this->request['workact']); - return TRUE; - } + IPB UPGRADE MODULE:: IPB 2.0.2 -> IPB 2.0.3 +| > Script written by Matt Mecham +| > Date started: 23rd April 2004 +| > "So what, pop is dead - it's no great loss. + So many facelifts, it's face flew off" ++-------------------------------------------------------------------------- +*/ + +if ( ! defined( 'IN_IPB' ) ) +{ + print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +class version_upgrade +{ + /** + * Custom HTML to show + * + * @var string + */ + protected $_output = ''; + + /** + * fetchs output + * + * @return string + */ + public function fetchOutput() + { + return $this->_output; + } + + /** + * Execute selected method + * + * @param object Registry object + * @return @e void + */ + public function doExecute( ipsRegistry $registry ) + { + /* Make object */ + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + + //-------------------------------- + // What are we doing? + //-------------------------------- + + switch( $this->request['workact'] ) + { + case 'sql': + $this->upgrade_sql(1); + break; + case 'sql1': + $this->upgrade_sql(1); + break; + case 'sql2': + $this->upgrade_sql(2); + break; + case 'sql3': + $this->upgrade_sql(3); + break; + case 'sql4': + $this->upgrade_sql(4); + break; + case 'polls': + $this->convert_polls(); + break; + case 'calevents': + $this->convert_calevents(); + break; + case 'skin': + $this->add_skin(); + break; + + default: + $this->upgrade_sql(1); + break; + } + + if ( $this->request['workact'] ) + { + return false; + } + else + { + return true; + } + } + + + /*-------------------------------------------------------------------------*/ + // SQL: 0 + /*-------------------------------------------------------------------------*/ + + function upgrade_sql( $id=1 ) + { + $man = 0; // Manual upgrade ? intval( $this->request['man'] ); + $cnt = 0; + $SQL = array(); + $file = '_updates_'.$id.'.php'; + $output = ""; + $path = IPSLib::getAppDir( 'core' ) . '/setup/versions/upg_21003/' . strtolower( $this->registry->dbFunctions()->getDriverType() ) . $file; + $prefix = $this->registry->dbFunctions()->getPrefix(); + + if ( is_file( $path ) ) + { + require( $path );/*noLibHook*/ + + $this->error = array(); + $this->sqlcount = 0; + $output = ""; + + $this->DB->return_die = 1; + + foreach( $SQL as $query ) + { + $this->DB->allow_sub_select = 1; + $this->DB->error = ''; + + $query = str_replace( "<%time%>", time(), $query ); + + /* Need to tack on a prefix? */ + if ( $prefix ) + { + $query = IPSSetUp::addPrefixToQuery( $query, $prefix ); + } + + if ( IPSSetUp::getSavedData('man') ) + { + $output .= preg_replace( "/\s{1,}/", " ", $query ) . "\n\n"; + } + else + { + if( ! $query ) + { + continue; + } + + $this->DB->query( $query ); + + if ( $this->DB->error ) + { + $this->registry->output->addError( $query."

    ".$this->DB->error ); + } + else + { + $this->sqlcount++; + } + } + } + + $this->registry->output->addMessage("{$this->sqlcount} queries ran...."); + } + + //-------------------------------- + // Next page... + //-------------------------------- + + $this->request['st'] = 0; + + if ( $id != 4 ) + { + $nextid = $id + 1; + $this->request['workact'] = 'sql'.$nextid; + } + else + { + $this->request['workact'] = 'polls'; + } + + if ( IPSSetUp::getSavedData('man') AND $output ) + { + /* Create source file */ + if ( $this->registry->dbFunctions()->getDriverType() == 'mysql' ) + { + $sourceFile = IPSSetUp::createSqlSourceFile( $output, '21003', $id ); + } + + $this->_output = $this->registry->output->template()->upgrade_manual_queries( $output, $sourceFile ); + } + } + + + /*-------------------------------------------------------------------------*/ + // POLLS + /*-------------------------------------------------------------------------*/ + + function convert_polls() + { + $start = intval($this->request['st']) > 0 ? intval($this->request['st']) : 0; + $lend = 50; + $end = $start + $lend; + $max = intval(IPSSetUp::getSavedData('max')); + $converted = intval(IPSSetUp::getSavedData('conv')); + + //----------------------------------------- + // First off.. grab number of polls to convert + //----------------------------------------- + + if ( ! $max ) + { + $total = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as max', + 'from' => 'topics', + 'where' => "poll_state IN ('open', 'close', 'closed')" ) ); + + $max = $total['max']; + } + + //----------------------------------------- + // In steps... + //----------------------------------------- + + $this->DB->build( array( 'select' => '*', + 'from' => 'topics', + 'where' => "poll_state IN ('open', 'close', 'closed' )", + 'limit' => array( 0, $lend ) ) ); + $o = $this->DB->execute(); + + //----------------------------------------- + // Do it... + //----------------------------------------- + + if ( $this->DB->getTotalRows($o) ) + { + //----------------------------------------- + // Got some to convert! + //----------------------------------------- + + while ( $r = $this->DB->fetch($o) ) + { + $converted++; + + //----------------------------------------- + // All done? + //----------------------------------------- + + if ( $converted >= $max ) + { + $done = 1; + } + + $new_poll = array( 1 => array() ); + + $poll_data = $this->DB->buildAndFetch( array( 'select' => '*', + 'from' => 'polls', + 'where' => "tid=".$r['tid'] + ) ); + if ( ! $poll_data['pid'] ) + { + continue; + } + + if ( ! $poll_data['poll_question'] ) + { + $poll_data['poll_question'] = $r['title']; + } + + //----------------------------------------- + // Kick start new poll + //----------------------------------------- + + $new_poll[1]['question'] = $poll_data['poll_question']; + + //----------------------------------------- + // Get OLD polls + //----------------------------------------- + + $poll_answers = unserialize( stripslashes( $poll_data['choices'] ) ); + + reset($poll_answers); + + foreach ( $poll_answers as $entry ) + { + $id = $entry[0]; + $choice = $entry[1]; + $votes = $entry[2]; + + $total_votes += $votes; + + if ( strlen($choice) < 1 ) + { + continue; + } + + $new_poll[ 1 ]['choice'][ $id ] = $choice; + $new_poll[ 1 ]['votes'][ $id ] = $votes; + } + + //----------------------------------------- + // Got something? + //----------------------------------------- + + if ( count( $new_poll[1]['choice'] ) ) + { + $this->DB->update( 'polls' , array( 'choices' => serialize( $new_poll ) ), 'tid='.$r['tid'] ); + $this->DB->update( 'topics', array( 'poll_state' => 1 ), 'tid='.$r['tid'] ); + } + } + } + else + { + $done = 1; + } + + + if ( ! $done ) + { + $this->registry->output->addMessage("Polls: $start to $end completed...."); + $this->request['workact'] = 'polls'; + $this->request['st'] = $end; + IPSSetUp::setSavedData('max', $max); + IPSSetUp::setSavedData('conv', $converted); + return FALSE; + } + else + { + $this->registry->output->addMessage("Polls converted, proceeding to calendar events..."); + $this->request['workact'] = 'calevents'; + $this->request['st'] = '0'; + return FALSE; + } + } + + + /*-------------------------------------------------------------------------*/ + // CALENDAR EVENTS + /*-------------------------------------------------------------------------*/ + + function convert_calevents() + { + $start = intval($this->request['st']) > 0 ? intval($this->request['st']) : 0; + $lend = 50; + $end = $start + $lend; + + //----------------------------------------- + // In steps... + //----------------------------------------- + + if( !$this->DB->checkForTable('calendar_events') ) + { + $this->registry->output->addMessage("No calendar events found, Creating new IPB 2.1 skin..."); + $this->request['workact'] = 'skin'; + return FALSE; + } + + $this->DB->build( array( 'select' => '*', + 'from' => 'calendar_events', + 'limit' => array( $start, $lend ) ) ); + $o = $this->DB->execute(); + + //----------------------------------------- + // Do it... + //----------------------------------------- + + if ( $this->DB->getTotalRows($o) ) + { + //----------------------------------------- + // Got some to convert! + //----------------------------------------- + + while ( $r = $this->DB->fetch($o) ) + { + $recur_remap = array( 'w' => 1, + 'm' => 2, + 'y' => 3 ); + + $begin_date = IPSTime::date_getgmdate( $r['unix_stamp'] ); + $end_date = IPSTime::date_getgmdate( $r['end_unix_stamp'] ); + + if ( ! $begin_date OR ! $end_date ) + { + continue; + } + + $day = $begin_date['mday']; + $month = $begin_date['mon']; + $year = $begin_date['year']; + + $end_day = $end_date['mday']; + $end_month = $end_date['mon']; + $end_year = $end_date['year']; + + $_final_unix_from = gmmktime(0, 0, 0, $month, $day, $year ); + + //----------------------------------------- + // Recur or ranged... + //----------------------------------------- + + if ( $r['event_repeat'] OR $r['event_ranged'] ) + { + $_final_unix_to = gmmktime(11, 59, 59, $end_month, $end_day, $end_year); + } + else + { + $_final_unix_to = 0; + } + + $new_event = array( 'event_calendar_id' => 1, + 'event_member_id' => $r['userid'], + 'event_content' => $r['event_text'], + 'event_title' => $r['title'], + 'event_smilies' => $r['show_emoticons'], + 'event_perms' => $r['read_perms'], + 'event_private' => $r['priv_event'], + 'event_approved' => 1, + 'event_unixstamp' => $r['unix_stamp'], + 'event_recurring' => ( $r['event_repeat'] && $recur_remap[ $r['repeat_unit'] ] ) ? $recur_remap[ $r['repeat_unit'] ] : 0, + 'event_tz' => 0, + 'event_unix_from' => $_final_unix_from, + 'event_unix_to' => $_final_unix_to ); + + //----------------------------------------- + // INSERT + //----------------------------------------- + + $this->DB->insert( 'cal_events', $new_event ); + } + + $this->registry->output->addMessage("Calendar events: $start to $end completed...."); + $this->request['workact'] = 'calevents'; + $this->request['st'] = $end; + return FALSE; + } + else + { + $this->registry->output->addMessage("Calendar events converted, Creating new IPB 2.1 skin..."); + $this->request['workact'] = 'skin'; + return FALSE; + } + } + + + + /*-------------------------------------------------------------------------*/ + // CALENDAR EVENTS + /*-------------------------------------------------------------------------*/ + + function add_skin() + { + $this->registry->output->addMessage("Skipping 2.1 skin creation (latest skin will be inserted later)..."); + unset($this->request['workact']); + return TRUE; + } } \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_21005/index.html b/upload/admin/applications/core/setup/versions/upg_21005/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/setup/versions/upg_21005/index.html +++ b/upload/admin/applications/core/setup/versions/upg_21005/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_21005/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_21005/mysql_updates.php index 8b28c54c..3e047cb0 100644 --- a/upload/admin/applications/core/setup/versions/upg_21005/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_21005/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_21007/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_21007/mysql_updates.php index cd0798bb..861c2527 100644 --- a/upload/admin/applications/core/setup/versions/upg_21007/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_21007/mysql_updates.php @@ -1,7 +1,7 @@ Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -class version_upgrade -{ - /** - * Custom HTML to show - * - * @var string - */ - protected $_output = ''; - - /** - * fetchs output - * - * @return string - */ - public function fetchOutput() - { - return $this->_output; - } - - /** - * Execute selected method - * - * @param object Registry object - * @return @e void - */ - public function doExecute( ipsRegistry $registry ) - { - /* Make object */ - $this->registry = $registry; - $this->DB = $this->registry->DB(); - $this->settings =& $this->registry->fetchSettings(); - $this->request =& $this->registry->fetchRequest(); - $this->cache = $this->registry->cache(); - $this->caches =& $this->registry->cache()->fetchCaches(); - - //----------------------------------------- - // Remove dupe categories - //----------------------------------------- - - $title_id_to_keep = array(); - $title_id_to_delete = array(); - $title_deleted_count = 0; - $msg = ''; - - $this->DB->build( array( 'select' => '*', 'from' => 'conf_settings_titles', 'order' => 'conf_title_id DESC' ) ); - $this->DB->execute(); - - while ( $r = $this->DB->fetch() ) - { - if ( $title_id_to_keep[ $r['conf_title_title'] ] ) - { - $title_id_to_delete[ $r['conf_title_id'] ] = $r['conf_title_id']; - } - else - { - $title_id_to_keep[ $r['conf_title_title'] ] = $r['conf_title_id']; - } - } - - if ( count( $title_id_to_delete ) ) - { - $this->DB->delete( 'conf_settings_titles', 'conf_title_id IN ('.implode( ',', $title_id_to_delete ).')' ); - } - - $title_deleted_count = intval( count($title_id_to_delete) ); - - $this->registry->output->addMessage("$title_deleted_count дубликатов настроек удалено"); - - return true; - } +Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +class version_upgrade +{ + /** + * Custom HTML to show + * + * @var string + */ + protected $_output = ''; + + /** + * fetchs output + * + * @return string + */ + public function fetchOutput() + { + return $this->_output; + } + + /** + * Execute selected method + * + * @param object Registry object + * @return @e void + */ + public function doExecute( ipsRegistry $registry ) + { + /* Make object */ + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + + //----------------------------------------- + // Remove dupe categories + //----------------------------------------- + + $title_id_to_keep = array(); + $title_id_to_delete = array(); + $title_deleted_count = 0; + $msg = ''; + + $this->DB->build( array( 'select' => '*', 'from' => 'conf_settings_titles', 'order' => 'conf_title_id DESC' ) ); + $this->DB->execute(); + + while ( $r = $this->DB->fetch() ) + { + if ( $title_id_to_keep[ $r['conf_title_title'] ] ) + { + $title_id_to_delete[ $r['conf_title_id'] ] = $r['conf_title_id']; + } + else + { + $title_id_to_keep[ $r['conf_title_title'] ] = $r['conf_title_id']; + } + } + + if ( count( $title_id_to_delete ) ) + { + $this->DB->delete( 'conf_settings_titles', 'conf_title_id IN ('.implode( ',', $title_id_to_delete ).')' ); + } + + $title_deleted_count = intval( count($title_id_to_delete) ); + + $this->registry->output->addMessage("$title_deleted_count duplicate settings deleted"); + + return true; + } } \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_21008/index.html b/upload/admin/applications/core/setup/versions/upg_21008/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/setup/versions/upg_21008/index.html +++ b/upload/admin/applications/core/setup/versions/upg_21008/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_21008/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_21008/mysql_updates.php index 745f1b7d..b07bad10 100644 --- a/upload/admin/applications/core/setup/versions/upg_21008/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_21008/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_21009/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_21009/mysql_updates.php index a8886615..65b41893 100644 --- a/upload/admin/applications/core/setup/versions/upg_21009/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_21009/mysql_updates.php @@ -1,7 +1,7 @@ \r
    During registration, the administrator requires that you supply a valid email address. This is important as the administrator may require that you validate your registration via an email. If this is the case, you will be notified when registering. If your e-mail does not arrive, then on the member bar at the top of the page, there will be a link that will allow you to re-send the validation e-mail. \r
    \r
    In some cases, the administrator will need to approve your registration before you can use your member account fully. If this is the case you will be notified during registration.\r
    \r
    Once you have registered and logged in, you will have access to your personal messenger and your control panel.\r
    \r
    For more information on these items, please see the relevant sections in this documentation.', description='How to register and the added benefits of being a registered member.' WHERE id=1";/*noLibHook*/ -$UPDATES[] = "UPDATE faq SET title='Cookies and cookie usage', text='Using cookies is optional, but strongly recommended. Cookies are used to track topics, showing you which topics have new replies since your last visit and to automatically log you in when you return.\r
    \r
    If your computer is unable to use the cookie system to browse the board correctly, then the board will automatically add in a session ID to each link to track you around the board.\r
    \r
    Clearing Cookies\r
    \r
    You can clear the cookies at any time by clicking on the link found at the bottom of the main board page (the first page you see when returning to the board). If this does not work for you, you may need to remove the cookies manually.\r
    \r
    Removing Cookies in Internet Explorer for Windows\r
    \r
      \r
    • Close all open Internet Explorer Windows\r
    • Click on the \'start\' button\r
    • Move up to \'Find\' and click on \'Files and Folders\'\r
    • When the new window appears, type in the domain name of the board you are using into the \'containing text\' field. (If the boards address was \'http://www.invisionboard.com/forums/index.php\' you would enter \'invisionboard.com\' without the quotes)\r
    • In the \'look in\' box, type in C:WindowsCookies and press \'Find Now\'\r
    • After it has finished searching, highlight all files (click on a file then press CTRL+A) and delete them.\r
    \r
    \r
    Removing Cookies in Internet Explorer for Macintosh\r
    \r
      \r
    • With Internet Explorer active, choose \'Edit\' and then \'Preferences\' from the Macintosh menu bar at the top of the screen\r
    • When the preferences panel opens, choose \'Cookies\' found in the \'Receiving Files\' section.\r
    • When the cookie pane loads, look for the domain name of the board (If the boards address was \'http://www.invisionboard.com/forums/index.php\' look for \'invisionboard.com\' or \'www.invisionboard.com\'\r
    • For each cookie, click on the entry and press the delete button.\r
    \r
    \r
    Your cookies should now be removed. In some cases you may need to restart your computer for the changes to take effect.', description='The benefits of using cookies and how to remove cookies set by this board.' WHERE id=2"; +$UPDATES[] = "UPDATE faq SET title='Cookies and cookie usage', text='Using cookies is optional, but strongly recommended. Cookies are used to track topics, showing you which topics have new replies since your last visit and to automatically log you in when you return.\r
    \r
    If your computer is unable to use the cookie system to browse the board correctly, then the board will automatically add in a session ID to each link to track you around the board.\r
    \r
    Clearing Cookies\r
    \r
    You can clear the cookies at any time by clicking on the link found at the bottom of the main board page (the first page you see when returning to the board). If this does not work for you, you may need to remove the cookies manually.\r
    \r
    Removing Cookies in Internet Explorer for Windows\r
    \r
      \r
    • Close all open Internet Explorer Windows\r
    • Click on the \'start\' button\r
    • Move up to \'Find\' and click on \'Files and Folders\'\r
    • When the new window appears, type in the domain name of the board you are using into the \'containing text\' field. (If the boards address was \'http://www.example.com/forums/index.php\' you would enter \'example.com\' without the quotes)\r
    • In the \'look in\' box, type in C:WindowsCookies and press \'Find Now\'\r
    • After it has finished searching, highlight all files (click on a file then press CTRL+A) and delete them.\r
    \r
    \r
    Removing Cookies in Internet Explorer for Macintosh\r
    \r
      \r
    • With Internet Explorer active, choose \'Edit\' and then \'Preferences\' from the Macintosh menu bar at the top of the screen\r
    • When the preferences panel opens, choose \'Cookies\' found in the \'Receiving Files\' section.\r
    • When the cookie pane loads, look for the domain name of the board (If the boards address was \'http://www.example.com/forums/index.php\' look for \'example.com\' or \'www.example.com\'\r
    • For each cookie, click on the entry and press the delete button.\r
    \r
    \r
    Your cookies should now be removed. In some cases you may need to restart your computer for the changes to take effect.', description='The benefits of using cookies and how to remove cookies set by this board.' WHERE id=2"; $UPDATES[] = "UPDATE faq SET title='Recovering lost or forgotten passwords', text='Security is a big feature on this board, and to that end, all passwords are encrypted when you register.\r
    This means that we cannot email your password to you as we hold no record of your \'uncrypted\' password. You can however, apply to have your password reset.\r
    \r
    To do this, click on the Lost Password link found on the log in page.\r
    \r
    Further instruction is available from there.', description='How to reset your password if you\'ve forgotten it.' WHERE id=3"; $UPDATES[] = "UPDATE faq SET title='Your Control Panel (My Controls)', text='Your control panel is your own private board console. You can change how the board looks and feels as well as your own information from here.\r
    \r
    Subscriptions\r
    \r
    This is where you manage your topic and forums subscriptions. Please see the help file \'Email Notification of new messages\' for more information on how to subscribe to topics.\r
    \r
    Edit Profile Info\r
    \r
    This section allows you to add or edit your contact information and enter some personal information if you choose.\r
    \r
    Edit Signature\r
    \r
    A board \'signature\' is very similar to an email signature. This signature is attached to the foot of every message you post unless you choose to check the box that allows you to ommit the signature in the message you are posting. You may use BB Code if available and in some cases, pure HTML (if the board administrator allows it).\r
    \r
    Edit Avatar Settings\r
    \r
    An avatar is a little image that appears under your username when you view a topic or post you authored. If the administrator allows, you may either choose from the board gallery, enter a URL to an avatar stored on your server or upload an avatar to use. You may also set the width of the avatar to ensure that it\'s sized in proportion.\r
    \r
    Change Personal Photo\r
    \r
    This section will allow you to add a photograph to your profile. This will be displayed when a user clicks to view your profile, on the mini-profile screen and will also be linked to from the member list.\r
    \r
    Email Settings\r
    \r
    Hide my email address allows you to deny the ability for other users to send you an email from the board.\r
    Send me updates sent by the board administrator will allow the administrator to include your email address in any mailings they send out - this is used mostly for important updates and community information.\r
    Include a copy of the post when emailing me from a subscribed topic, this allows you to have the new post included in any reply to topic notifications.\r
    Send a confirmation email when I receive a new private message, this will send you an e-mail notification to your registered e-mail address each time you receive a private message on the board.\r
    Enable \'Email Notification\' by default?, this will automatically subscribe you to any topic that you make a reply to. You may unsubscribe from the \'Subscriptions\' section of My Controls if you wish.\r
    \r
    Board Settings\r
    \r
    From this section, you can set your time zone, choose to not see users signatures, avatars and posted images.\r
    You can choose to get a pop up window informing you when you have a new message and choose to show or hide the \'Fast Reply\' box where it is enabled.\r
    You are also able to choose display preferences for the number of topics/posts shown per page on the board.\r
    \r
    Change Email Address\r
    \r
    At any time, you can change the email address that is registered to your account. In some cases, you will need to revalidate your account after changing your email address. If this is the case, you will be notified before your email address change is processed.\r
    \r
    Change Password\r
    \r
    You may change your password from this section. Please note that you will need to know your current password before you can change your password.', description='Editing contact information, personal information, avatars, signatures, board settings, languages and style choices.' WHERE id=4";/*noLibHook*/ $UPDATES[] = "UPDATE faq SET title='Email Notification of new messages', text='This board can notify you when a new reply is added to a topic. Many users find this useful to keep up to date on topics without the need to view the board to check for new messages.\r
    \r
    There are three ways to subscribe to a topic:\r
      \r
    • Click the \'Track This Topic\' link at the top of the topic that you wish to track
    • \r
    • On the posting screen when replying to or creating a topic, check the \'Enable email notification of replies?\' checkbox
    • \r
    • From the E-Mail settings section of your User CP (My Controls) check the \'Enable Email Notification by default?\' option, this will automatically subscribe you to any topic that you make a reply to
    • \r
    Please note that to avoid multiple emails being sent to your email address, you will only get one e-mail for each topic you are subscribed to until the next time you visit the board.\r
    \r
    You are also able to subscribe to each individual forum on the board, to be notified when a new topic is created in that particular forum. To enable this, click the \'Subscribe to this forum\' link at the bottom of the forum that you wish to subscribe to.\r
    \r
    To unsubscribe from any forums or topics that you are subscribed to - just go to the \'Subscriptions\' section of \'My Controls\' and you can do thi from there.', description='How to get emailed when a new reply is added to a topic.' WHERE id=5"; diff --git a/upload/admin/applications/core/setup/versions/upg_21010/index.html b/upload/admin/applications/core/setup/versions/upg_21010/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/setup/versions/upg_21010/index.html +++ b/upload/admin/applications/core/setup/versions/upg_21010/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_21010/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_21010/mysql_updates.php index fb2af082..d607b56d 100644 --- a/upload/admin/applications/core/setup/versions/upg_21010/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_21010/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_21011/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_21011/mysql_updates.php index 8be9127e..25450c13 100644 --- a/upload/admin/applications/core/setup/versions/upg_21011/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_21011/mysql_updates.php @@ -1,7 +1,7 @@ Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -class version_upgrade -{ - /** - * Custom HTML to show - * - * @var string - */ - private $_output = ''; - - /** - * fetchs output - * - * @return string - */ - public function fetchOutput() - { - return $this->_output; - } - - /** - * Execute selected method - * - * @param object Registry object - * @return @e void - */ - public function doExecute( ipsRegistry $registry ) - { - /* Make object */ - $this->registry = $registry; - $this->DB = $this->registry->DB(); - $this->settings =& $this->registry->fetchSettings(); - $this->request =& $this->registry->fetchRequest(); - $this->cache = $this->registry->cache(); - $this->caches =& $this->registry->cache()->fetchCaches(); - - /* Set DB driver to return any errors */ - $this->DB->return_die = 1; - - //-------------------------------- - // What are we doing? - //-------------------------------- - - switch( $this->request['workact'] ) - { - case 'sql': - $this->upgrade_sql(1); - break; - case 'sql1': - $this->upgrade_sql(1); - break; - case 'sql2': - $this->upgrade_sql(2); - break; - case 'sql3': - $this->upgrade_sql(3); - break; - case 'sql4': - $this->upgrade_sql(4); - break; - case 'forums': - $this->update_forums(); - break; - case 'finish': - $this->finish_up(); - break; - case 'skin': - $this->add_skin(); - break; - case 'update_template_bits': - $this->update_template_bits(); - break; - - default: - $this->upgrade_sql(1); - break; - } - - if ( $this->request['workact'] ) - { - return false; - } - else - { - return true; - } - } - - - /*-------------------------------------------------------------------------*/ - // SQL: 0 - /*-------------------------------------------------------------------------*/ - - function upgrade_sql( $id=1 ) - { - $man = 0; // Manual upgrade ? intval( $this->request['man'] ); - $cnt = 0; - $SQL = array(); - $file = '_updates_'.$id.'.php'; - $output = ""; - $path = IPSLib::getAppDir( 'core' ) . '/setup/versions/upg_22005/' . strtolower( $this->registry->dbFunctions()->getDriverType() ) . $file; - $prefix = $this->registry->dbFunctions()->getPrefix(); - - if ( is_file( $path ) ) - { - require_once( $path );/*noLibHook*/ - - $this->sqlcount = 0; - $output = ""; - - $this->DB->return_die = 1; - - foreach( $SQL as $query ) - { - $this->DB->allow_sub_select = 1; - $this->DB->error = ''; - - $query = str_replace( "<%time%>", time(), $query ); - - if( $this->settings['mysql_tbl_type'] ) - { - if( preg_match( "/^create table(.+?)/i", $query ) ) - { - $query = preg_replace( "/^(.+?)\);$/is", "\\1) ENGINE={$this->settings['mysql_tbl_type']};", $query ); - } - } - - /* Need to tack on a prefix? */ - if ( $prefix ) - { - $query = IPSSetUp::addPrefixToQuery( $query, $prefix ); - } - - if ( IPSSetUp::getSavedData('man') ) - { - $output .= preg_replace( "/\s{1,}/", " ", $query ) ."\n\n"; - } - else - { - $this->DB->query( $query ); - - if ( $this->DB->error ) - { - $this->registry->output->addError( $query."

    ".$this->DB->error ); - } - else - { - $this->sqlcount++; - } - } - } - - $this->registry->output->addMessage("$this->sqlcount запросов выполнено...."); - } - - //-------------------------------- - // Next page... - //-------------------------------- - - $this->request['st'] = 0; - - if ( $id != 4 ) - { - $nextid = $id + 1; - $this->request['workact'] = 'sql'.$nextid; - } - else - { - $this->request['workact'] = 'forums'; - } - - if ( IPSSetUp::getSavedData('man') AND $output ) - { - /* Create source file */ - if ( $this->registry->dbFunctions()->getDriverType() == 'mysql' ) - { - $sourceFile = IPSSetUp::createSqlSourceFile( $output, '22005', $id ); - } - - $this->_output = $this->registry->output->template()->upgrade_manual_queries( $output, $sourceFile ); - } - } - - - /*-------------------------------------------------------------------------*/ - // Update forums - /*-------------------------------------------------------------------------*/ - - function update_forums() - { - //----------------------------------------- - // Update latest news... - //----------------------------------------- - - $this->DB->update( "forums", "newest_title=last_title, newest_id=last_id", 'last_title IS NOT NULL AND last_id IS NOT NULL', false, true ); - $this->DB->execute(); - - //----------------------------------------- - // INIT - //----------------------------------------- - - $ignore_me = array( 'redirect_url', 'redirect_loc', 'rules_text', 'permission_custom_error', 'notify_modq_emails' ); - - if ( !empty($this->settings['forum_cache_minimum']) ) - { - $ignore_me[] = 'description'; - $ignore_me[] = 'rules_title'; - } - - $this->caches['forum_cache'] = array(); - - $this->DB->build( array( 'select' => '*', - 'from' => 'forums', - 'order' => 'parent_id, position' - ) ); - $o = $this->DB->execute(); - - while( $f = $this->DB->fetch( $o ) ) - { - $fr = array(); - - $perms = unserialize(stripslashes($f['permission_array'])); - - //----------------------------------------- - // Stuff we don't need... - //----------------------------------------- - - if ( $f['parent_id'] == -1 ) - { - $fr['id'] = $f['id']; - $fr['sub_can_post'] = $f['sub_can_post']; - $fr['name'] = $f['name']; - $fr['parent_id'] = $f['parent_id']; - $fr['show_perms'] = $perms['show_perms']; - $fr['skin_id'] = $f['skin_id']; - $fr['permission_showtopic'] = $f['permission_showtopic']; - } - else - { - foreach( $f as $k => $v ) - { - if ( in_array( $k, $ignore_me ) ) - { - continue; - } - else - { - if ( $v != "" ) - { - $fr[ $k ] = $v; - } - } - } - - $fr['read_perms'] = isset($perms['read_perms']) ? $perms['read_perms'] : ''; - $fr['reply_perms'] = isset($perms['reply_perms']) ? $perms['reply_perms'] : ''; - $fr['start_perms'] = isset($perms['start_perms']) ? $perms['start_perms'] : ''; - $fr['upload_perms'] = isset($perms['upload_perms']) ? $perms['upload_perms'] : ''; - $fr['download_perms'] = $perms['upload_perms']; - $fr['show_perms'] = isset($perms['show_perms']) ? $perms['show_perms'] : ''; - - unset($fr['permission_array']); - } - - $this->caches['forum_cache'][ $fr['id'] ] = $fr; - - $perm_array = addslashes(serialize(array( - 'start_perms' => $fr['start_perms'], - 'reply_perms' => $fr['reply_perms'], - 'read_perms' => $fr['read_perms'], - 'upload_perms' => $fr['upload_perms'], - 'download_perms' => $fr['download_perms'], - 'show_perms' => $fr['show_perms'] - ) ) ); - - //----------------------------------------- - // Add to save array - //----------------------------------------- - - $this->DB->update( 'forums', array( 'permission_array' => $perm_array ), 'id='.$fr['id'] ); - - } - - $this->cache->setCache( 'forum_cache', $this->caches['forum_cache'], array( 'array' => 1 ) ); - - $this->registry->output->addMessage("Download permissions added, Converting template bit HTML logic..."); - $this->request['workact'] = 'update_template_bits'; - } - - /*-------------------------------------------------------------------------*/ - // Update template bits - /*-------------------------------------------------------------------------*/ - - function update_template_bits() - { - $this->registry->output->addMessage("Template bits skipped, finishing up..."); - $this->request['workact'] = 'finish'; - return FALSE; - } - - /*-------------------------------------------------------------------------*/ - // Update forums - /*-------------------------------------------------------------------------*/ - - function finish_up() - { - //----------------------------------------- - // Has gallery? - //----------------------------------------- - - $this->DB->return_die = 1; - $this->DB->error = ''; - - $table = 'members'; - - if ( ! $this->DB->checkForField( 'has_gallery', $table ) ) - { - $this->DB->addField( 'members', 'has_gallery', 'INT(1)', '0' ); - - if ( $this->DB->error ) - { - $this->registry->output->addError( "ALTER TABLE {$this->DB->obj['sql_tbl_prefix']}members ADD has_gallery INT(1) default 0

    ".$this->DB->error ); - } - } - - if( $this->settings['conv_configured'] != 1 OR $this->settings['conv_chosen'] == "" ) - { - if( $this->DB->checkForField( "legacy_password", "members" ) ) - { - $this->DB->dropField( 'members', 'legacy_password' ); - - if ( $this->DB->error ) - { - $this->registry->output->addError( "ALTER TABLE {$this->DB->obj['sql_tbl_prefix']}members DROP legacy_password

    ".$this->DB->error ); - } - } - } - - $test = $this->DB->buildAndFetch( array( 'select' => 'count(*) as numrows', - 'from' => 'cache_store', - 'where' => "cs_key='calendars'" - ) ); - - if ( ! $test['numrows'] ) - { - $this->DB->insert( 'cache_store', array( 'cs_key' => 'calendars' ) ); - } - - $this->registry->output->addMessage("Clean up performed, Creating new IPB 2.2.0 skin..."); - $this->request['workact'] = 'skin'; - } - - /*-------------------------------------------------------------------------*/ - // Add new skin - /*-------------------------------------------------------------------------*/ - - function add_skin() - { - $this->registry->output->addMessage("2.2.0 skin skipped..."); - unset($this->request['workact']); - - return TRUE; - } - +Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +class version_upgrade +{ + /** + * Custom HTML to show + * + * @var string + */ + private $_output = ''; + + /** + * fetchs output + * + * @return string + */ + public function fetchOutput() + { + return $this->_output; + } + + /** + * Execute selected method + * + * @param object Registry object + * @return @e void + */ + public function doExecute( ipsRegistry $registry ) + { + /* Make object */ + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + + /* Set DB driver to return any errors */ + $this->DB->return_die = 1; + + //-------------------------------- + // What are we doing? + //-------------------------------- + + switch( $this->request['workact'] ) + { + case 'sql': + $this->upgrade_sql(1); + break; + case 'sql1': + $this->upgrade_sql(1); + break; + case 'sql2': + $this->upgrade_sql(2); + break; + case 'sql3': + $this->upgrade_sql(3); + break; + case 'sql4': + $this->upgrade_sql(4); + break; + case 'forums': + $this->update_forums(); + break; + case 'finish': + $this->finish_up(); + break; + case 'skin': + $this->add_skin(); + break; + case 'update_template_bits': + $this->update_template_bits(); + break; + + default: + $this->upgrade_sql(1); + break; + } + + if ( $this->request['workact'] ) + { + return false; + } + else + { + return true; + } + } + + + /*-------------------------------------------------------------------------*/ + // SQL: 0 + /*-------------------------------------------------------------------------*/ + + function upgrade_sql( $id=1 ) + { + $man = 0; // Manual upgrade ? intval( $this->request['man'] ); + $cnt = 0; + $SQL = array(); + $file = '_updates_'.$id.'.php'; + $output = ""; + $path = IPSLib::getAppDir( 'core' ) . '/setup/versions/upg_22005/' . strtolower( $this->registry->dbFunctions()->getDriverType() ) . $file; + $prefix = $this->registry->dbFunctions()->getPrefix(); + + if ( is_file( $path ) ) + { + require_once( $path );/*noLibHook*/ + + $this->sqlcount = 0; + $output = ""; + + $this->DB->return_die = 1; + + foreach( $SQL as $query ) + { + $this->DB->allow_sub_select = 1; + $this->DB->error = ''; + + $query = str_replace( "<%time%>", time(), $query ); + + if( $this->settings['mysql_tbl_type'] ) + { + if( preg_match( "/^create table(.+?)/i", $query ) ) + { + $query = preg_replace( "/^(.+?)\);$/is", "\\1) ENGINE={$this->settings['mysql_tbl_type']};", $query ); + } + } + + /* Need to tack on a prefix? */ + if ( $prefix ) + { + $query = IPSSetUp::addPrefixToQuery( $query, $prefix ); + } + + if ( IPSSetUp::getSavedData('man') ) + { + $output .= preg_replace( "/\s{1,}/", " ", $query ) ."\n\n"; + } + else + { + $this->DB->query( $query ); + + if ( $this->DB->error ) + { + $this->registry->output->addError( $query."

    ".$this->DB->error ); + } + else + { + $this->sqlcount++; + } + } + } + + $this->registry->output->addMessage("$this->sqlcount queries ran...."); + } + + //-------------------------------- + // Next page... + //-------------------------------- + + $this->request['st'] = 0; + + if ( $id != 4 ) + { + $nextid = $id + 1; + $this->request['workact'] = 'sql'.$nextid; + } + else + { + $this->request['workact'] = 'forums'; + } + + if ( IPSSetUp::getSavedData('man') AND $output ) + { + /* Create source file */ + if ( $this->registry->dbFunctions()->getDriverType() == 'mysql' ) + { + $sourceFile = IPSSetUp::createSqlSourceFile( $output, '22005', $id ); + } + + $this->_output = $this->registry->output->template()->upgrade_manual_queries( $output, $sourceFile ); + } + } + + + /*-------------------------------------------------------------------------*/ + // Update forums + /*-------------------------------------------------------------------------*/ + + function update_forums() + { + //----------------------------------------- + // Update latest news... + //----------------------------------------- + + $this->DB->update( "forums", "newest_title=last_title, newest_id=last_id", 'last_title IS NOT NULL AND last_id IS NOT NULL', false, true ); + $this->DB->execute(); + + //----------------------------------------- + // INIT + //----------------------------------------- + + $ignore_me = array( 'redirect_url', 'redirect_loc', 'rules_text', 'permission_custom_error', 'notify_modq_emails' ); + + if ( !empty($this->settings['forum_cache_minimum']) ) + { + $ignore_me[] = 'description'; + $ignore_me[] = 'rules_title'; + } + + $this->caches['forum_cache'] = array(); + + $this->DB->build( array( 'select' => '*', + 'from' => 'forums', + 'order' => 'parent_id, position' + ) ); + $o = $this->DB->execute(); + + while( $f = $this->DB->fetch( $o ) ) + { + $fr = array(); + + $perms = unserialize(stripslashes($f['permission_array'])); + + //----------------------------------------- + // Stuff we don't need... + //----------------------------------------- + + if ( $f['parent_id'] == -1 ) + { + $fr['id'] = $f['id']; + $fr['sub_can_post'] = $f['sub_can_post']; + $fr['name'] = $f['name']; + $fr['parent_id'] = $f['parent_id']; + $fr['show_perms'] = $perms['show_perms']; + $fr['skin_id'] = $f['skin_id']; + $fr['permission_showtopic'] = $f['permission_showtopic']; + } + else + { + foreach( $f as $k => $v ) + { + if ( in_array( $k, $ignore_me ) ) + { + continue; + } + else + { + if ( $v != "" ) + { + $fr[ $k ] = $v; + } + } + } + + $fr['read_perms'] = isset($perms['read_perms']) ? $perms['read_perms'] : ''; + $fr['reply_perms'] = isset($perms['reply_perms']) ? $perms['reply_perms'] : ''; + $fr['start_perms'] = isset($perms['start_perms']) ? $perms['start_perms'] : ''; + $fr['upload_perms'] = isset($perms['upload_perms']) ? $perms['upload_perms'] : ''; + $fr['download_perms'] = $perms['upload_perms']; + $fr['show_perms'] = isset($perms['show_perms']) ? $perms['show_perms'] : ''; + + unset($fr['permission_array']); + } + + $this->caches['forum_cache'][ $fr['id'] ] = $fr; + + $perm_array = addslashes(serialize(array( + 'start_perms' => $fr['start_perms'], + 'reply_perms' => $fr['reply_perms'], + 'read_perms' => $fr['read_perms'], + 'upload_perms' => $fr['upload_perms'], + 'download_perms' => $fr['download_perms'], + 'show_perms' => $fr['show_perms'] + ) ) ); + + //----------------------------------------- + // Add to save array + //----------------------------------------- + + $this->DB->update( 'forums', array( 'permission_array' => $perm_array ), 'id='.$fr['id'] ); + + } + + $this->cache->setCache( 'forum_cache', $this->caches['forum_cache'], array( 'array' => 1 ) ); + + $this->registry->output->addMessage("Download permissions added, Converting template bit HTML logic..."); + $this->request['workact'] = 'update_template_bits'; + } + + /*-------------------------------------------------------------------------*/ + // Update template bits + /*-------------------------------------------------------------------------*/ + + function update_template_bits() + { + $this->registry->output->addMessage("Template bits skipped, finishing up..."); + $this->request['workact'] = 'finish'; + return FALSE; + } + + /*-------------------------------------------------------------------------*/ + // Update forums + /*-------------------------------------------------------------------------*/ + + function finish_up() + { + //----------------------------------------- + // Has gallery? + //----------------------------------------- + + $this->DB->return_die = 1; + $this->DB->error = ''; + + $table = 'members'; + + if ( ! $this->DB->checkForField( 'has_gallery', $table ) ) + { + $this->DB->addField( 'members', 'has_gallery', 'INT(1)', '0' ); + + if ( $this->DB->error ) + { + $this->registry->output->addError( "ALTER TABLE {$this->DB->obj['sql_tbl_prefix']}members ADD has_gallery INT(1) default 0

    ".$this->DB->error ); + } + } + + if( $this->settings['conv_configured'] != 1 OR $this->settings['conv_chosen'] == "" ) + { + if( $this->DB->checkForField( "legacy_password", "members" ) ) + { + $this->DB->dropField( 'members', 'legacy_password' ); + + if ( $this->DB->error ) + { + $this->registry->output->addError( "ALTER TABLE {$this->DB->obj['sql_tbl_prefix']}members DROP legacy_password

    ".$this->DB->error ); + } + } + } + + $test = $this->DB->buildAndFetch( array( 'select' => 'count(*) as numrows', + 'from' => 'cache_store', + 'where' => "cs_key='calendars'" + ) ); + + if ( ! $test['numrows'] ) + { + $this->DB->insert( 'cache_store', array( 'cs_key' => 'calendars' ) ); + } + + $this->registry->output->addMessage("Clean up performed, Creating new IPB 2.2.0 skin..."); + $this->request['workact'] = 'skin'; + } + + /*-------------------------------------------------------------------------*/ + // Add new skin + /*-------------------------------------------------------------------------*/ + + function add_skin() + { + $this->registry->output->addMessage("2.2.0 skin skipped..."); + unset($this->request['workact']); + + return TRUE; + } + } \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_22006/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_22006/mysql_updates.php index 5b7bf7b3..293c71f1 100644 --- a/upload/admin/applications/core/setup/versions/upg_22006/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_22006/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_22007/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_22007/mysql_updates.php index d10e128b..4428fc1f 100644 --- a/upload/admin/applications/core/setup/versions/upg_22007/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_22007/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_22009/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_22009/mysql_updates.php index 611f6317..b753c4e8 100644 --- a/upload/admin/applications/core/setup/versions/upg_22009/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_22009/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_22010/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_22010/mysql_updates.php index 21530fe1..7f77c03e 100644 --- a/upload/admin/applications/core/setup/versions/upg_22010/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_22010/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_22011/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_22011/mysql_updates.php index df755b81..02a61fef 100644 --- a/upload/admin/applications/core/setup/versions/upg_22011/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_22011/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_23000/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_23000/mysql_updates.php index 3ce9ba79..1e1431e0 100644 --- a/upload/admin/applications/core/setup/versions/upg_23000/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_23000/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_23002/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_23002/mysql_updates.php index 8cf7fe4a..3228aa81 100644 --- a/upload/admin/applications/core/setup/versions/upg_23002/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_23002/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_23003/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_23003/mysql_updates.php index 28753181..a19719f4 100644 --- a/upload/admin/applications/core/setup/versions/upg_23003/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_23003/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_23005/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_23005/mysql_updates.php index 15b56b69..961a91bd 100644 --- a/upload/admin/applications/core/setup/versions/upg_23005/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_23005/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_23008/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_23008/mysql_updates.php index 2cba4120..472e11df 100644 --- a/upload/admin/applications/core/setup/versions/upg_23008/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_23008/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_23010/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_23010/mysql_updates.php index d8f4ac83..1d12e6f6 100644 --- a/upload/admin/applications/core/setup/versions/upg_23010/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_23010/mysql_updates.php @@ -1,7 +1,7 @@ {title}:
    {content}
    ', 2, '', 'gender'), -(NULL, 'Город', '', '', 'input', 0, 0, 0, 1, 0, 0, '', 0, '
    {title}:
    {content}
    ', 2, '', 'location'), -(NULL, 'Интересы', '', '', 'textarea', 0, 0, 0, 1, 0, 0, '', 0, '
    {title}:
    {content}
    ', 2, '', 'interests'), +(NULL, 'Gender', '', 'm=Male|f=Female|u=Not Telling', 'drop', 0, 0, 0, 1, 0, 0, '', 0, '
    {title}:
    {content}
    ', 2, '', 'gender'), +(NULL, 'Location', '', '', 'input', 0, 0, 0, 1, 0, 0, '', 0, '
    {title}:
    {content}
    ', 2, '', 'location'), +(NULL, 'Interests', '', '', 'textarea', 0, 0, 0, 1, 0, 0, '', 0, '
    {title}:
    {content}
    ', 2, '', 'interests'), (NULL, 'Yahoo', '', '', 'input', 0, 0, 0, 1, 0, 0, '', 0, '', 1, 'style_extra/cprofile_icons/profile_yahoo.gif', 'yahoo'), (NULL, 'Jabber', '', '', 'input', 0, 0, 0, 1, 0, 0, '', 0, '', 1, 'style_extra/cprofile_icons/profile_jabber.gif', 'jabber'), (NULL, 'Skype', '', '', 'input', 0, 0, 0, 1, 0, 0, '', 0, '', 1, 'style_extra/cprofile_icons/profile_skype.gif', 'skype'); @@ -100,10 +100,10 @@ $SQL[] = "TRUNCATE TABLE task_manager;"; $SQL[] = "DELETE FROM cache_store WHERE cs_key='skin_id_cache';"; $SQL[] = "DELETE FROM cache_store WHERE cs_key='forum_cache';"; -$SQL[] = "INSERT INTO reputation_levels VALUES(1, -20, 'Очень плохой', '');"; -$SQL[] = "INSERT INTO reputation_levels VALUES(2, -10, 'Плохой', '');"; -$SQL[] = "INSERT INTO reputation_levels VALUES(3, 0, 'Обычный', '');"; -$SQL[] = "INSERT INTO reputation_levels VALUES(4, 10, 'Хороший', '');"; -$SQL[] = "INSERT INTO reputation_levels VALUES(5, 20, 'Очень хороший', '');"; +$SQL[] = "INSERT INTO reputation_levels VALUES(1, -20, 'Bad', '');"; +$SQL[] = "INSERT INTO reputation_levels VALUES(2, -10, 'Poor', '');"; +$SQL[] = "INSERT INTO reputation_levels VALUES(3, 0, 'Neutral', '');"; +$SQL[] = "INSERT INTO reputation_levels VALUES(4, 10, 'Good', '');"; +$SQL[] = "INSERT INTO reputation_levels VALUES(5, 20, 'Excellent', '');"; ?> \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_30001/mysql_updates_6.php b/upload/admin/applications/core/setup/versions/upg_30001/mysql_updates_6.php index 2f399600..cf306ac0 100644 --- a/upload/admin/applications/core/setup/versions/upg_30001/mysql_updates_6.php +++ b/upload/admin/applications/core/setup/versions/upg_30001/mysql_updates_6.php @@ -1,7 +1,7 @@ - * Invision Power Services - * IP.Board v3.4.5 - * Upgrade Class - * - * Class to add options and notices for IP.Board upgrade - * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $ - * - * - * @author Matt Mecham - * @version $Rev: 10721 $ - * @since 3.0 - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/company/standards.php#license - * @link http://www.invisionpower.com - * @package IP.Board - */ - -class version_class_core_30001 -{ - /** - * Constructor - * - * @param object $registry Registry object - * @return @e void - */ - public function __construct( ipsRegistry $registry ) - { - /* Make object */ - $this->registry = $registry; - $this->DB = $this->registry->DB(); - $this->settings =& $this->registry->fetchSettings(); - $this->request =& $this->registry->fetchRequest(); - $this->cache = $this->registry->cache(); - $this->caches =& $this->registry->cache()->fetchCaches(); - } - - /** - * Add pre-upgrade options: Form - * - * @return string HTML block - */ - public function preInstallOptionsForm() - { -return << -
  • - - Экспортировать текущие шаблоны и CSS? (Будут сохранены в директории /cache/previousSkinFiles) -
  • -
  • - - Скопировать старые директории языков в /cache/previousLangFiles ? -
  • -
  • - - Пропустить конвертацию личных сообщений? Старые сообщения будут оставлены, вы в любой момент сможете сконвертировать ЛС при помощи shell или утилиты в админцентре. -
  • -
  • - - Запретить доступ в АЦ для неглавных администраторов? В систему распеределния прав в IP.Board 3 внесены изменения, поэтому больше нет необходимости разделять администраторов и главных администраторов на разные группы. - Вы можете сохранить доступ в АЦ только для главных администраторов и вручную выставить права доступа. Если опция отключена, то - все администраторы получат доступ в АЦ независимо от типа. -
  • - -EOF; - - } - - /** - * Add pre-upgrade options: Save - * - * Data will be saved in saved data array as: appOptions[ app ][ versionLong ] = ( key => value ); - * - * @return array Key / value pairs to save - */ - public function preInstallOptionsSave() - { - /* Return */ - return array( 'exportSkins' => intval( $_REQUEST['exportSkins'] ), - 'exportLangs' => intval( $_REQUEST['exportLangs'] ), - 'skipPms' => intval( $_REQUEST['skipPms'] ) - ); - - } - - /** - * Return any post-installation notices - * - * @return array Array of notices - */ - public function postInstallNotices() - { - $options = IPSSetUp::getSavedData('custom_options'); - $_doSkin = $options['core'][30001]['exportSkins']; - $_doLang = $options['core'][30001]['exportLangs']; - $rootAdmins = $options['core'][30001]['rootAdmins']; - $skipPms = $options['core'][30001]['skipPms']; - - $notices = array(); - - if ( $_doSkin ) - { - $notices[] = "Все старые стили сохранены в 'cache/previousSkinFiles'"; - } - - if ( $_doLang ) - { - $notices[] = "Все старые языки сохранены в 'cache/previousLangFiles'"; - } - - if ( $skipPms ) - { - $notices[] = "Конвертация личных сообщений пропущена. Для конвертации личных сообщений в будущем воспользуйтесь shell-скриптом из директории 'tools' дистрибутива"; - } - - /* Notice about post content */ - $notices[] = "Теперь вам необходимо обновить содержимое всех сообщений через админцентр (Система > Пересчет и обновление).
    "; - - /* Notice about admin restrictions */ - $notices[] = "Из-за изменений в системе прав доступа. Все администраторы, имевшие ограничения, будут лишены доступа ко всем модулям, пока вы не измените права."; - - /* Notice about admin restrictions */ - if ( $rootAdmins ) - { - $notices[] = "Были сброшены все ограничения для доступа в админцентр Вы можете восстановить их через АЦ.
    "; - } - else - { - $notices[] = "Все администраторы получили полный доступ к админцентру. Вы можете ограничить их доступ через АЦ.
    "; - } - - /* Notice about custom time settings */ - $notices[] = "Формат показа времени изменен в настройках.
    "; - - /* Notice about FURLs */ - $notices[] = "Для использования Friendly URLs (ЧПУ), добавьте в ваш conf_global.php строчку: \$INFO['use_friendly_urls'] = '1';."; - - return $notices; - } - - - /** - * Return any pre-installation notices - * - * @return array Array of notices - */ - public function preInstallNotices() - { - $notices = array(); - - $notices[] = "Стили внешнего вида более ранних версий будут несовместимы с этой версией форума. Будет восстановлен стиль по-умолчанию."; - - return $notices; - - } -} - + + * Invision Power Services + * IP.Board v3.4.6 + * Upgrade Class + * + * Class to add options and notices for IP.Board upgrade + * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $ + * + * + * @author Matt Mecham + * @version $Rev: 10721 $ + * @since 3.0 + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license http://www.invisionpower.com/company/standards.php#license + * @link http://www.invisionpower.com + * @package IP.Board + */ + +class version_class_core_30001 +{ + /** + * Constructor + * + * @param object $registry Registry object + * @return @e void + */ + public function __construct( ipsRegistry $registry ) + { + /* Make object */ + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + } + + /** + * Add pre-upgrade options: Form + * + * @return string HTML block + */ + public function preInstallOptionsForm() + { +return << +
  • + + Export current skin's modified template bits and CSS? (This will be saved in /cache/previousSkinFiles) +
  • +
  • + + Copy language PHP files into /cache/previousLangFiles before upgrading? +
  • +
  • + + Skip PM Conversion? If so, old tables will not be removed and you can use the provided shell tool post-upgrade +
  • +
  • + + Remove all "non-root" admin ACP permissions? Due to the change in permission models, root admins and admins have the same default permissions. + You have the option to restrict all non-root admins and then manually set up their permissions after the upgrade. Not ticking this box will effectively give all + administrators full access regardless of administrator type. +
  • + +EOF; + + } + + /** + * Add pre-upgrade options: Save + * + * Data will be saved in saved data array as: appOptions[ app ][ versionLong ] = ( key => value ); + * + * @return array Key / value pairs to save + */ + public function preInstallOptionsSave() + { + /* Return */ + return array( 'exportSkins' => intval( $_REQUEST['exportSkins'] ), + 'exportLangs' => intval( $_REQUEST['exportLangs'] ), + 'skipPms' => intval( $_REQUEST['skipPms'] ) + ); + + } + + /** + * Return any post-installation notices + * + * @return array Array of notices + */ + public function postInstallNotices() + { + $options = IPSSetUp::getSavedData('custom_options'); + $_doSkin = $options['core'][30001]['exportSkins']; + $_doLang = $options['core'][30001]['exportLangs']; + $rootAdmins = $options['core'][30001]['rootAdmins']; + $skipPms = $options['core'][30001]['skipPms']; + + $notices = array(); + + if ( $_doSkin ) + { + $notices[] = "All previous skins have been exported into 'cache/previousSkinFiles'"; + } + + if ( $_doLang ) + { + $notices[] = "All previous language files have been exported into 'cache/previousLangFiles'"; + } + + if ( $skipPms ) + { + $notices[] = "PM Conversion was skipped. If you want to convert PMs, please use the provided shell tool found in your 'tools' directory of the download"; + } + + /* Notice about post content */ + $notices[] = "You should now log into your Admin CP and rebuild post content (System > Recount & Rebuild)"; + + /* Notice about admin restrictions */ + $notices[] = "Due to the change in permission systems, any admins that had restrictions have been updated to have no access to any module until you edit them."; + + /* Notice about admin restrictions */ + if ( $rootAdmins ) + { + $notices[] = "Due to the change in permission systems, 'Root Admins' and 'Administrators' both have full access to the ACP including SQL toolbox, etc. You chose to remove all ACP permissions on upgrade. You can restore selective permissions via the ACP."; + } + else + { + $notices[] = "Due to the change in permission systems, 'Root Admins' and 'Administrators' both have full access to the ACP including SQL toolbox, etc. You can restrict individual admins using the ACP permission system."; + } + + /* Notice about custom time settings */ + $notices[] = "Due to the change in how times are shown, all custom time/clock formats have been reset."; + + /* Notice about FURLs */ + $notices[] = "If you wish to use Friendly URLs, you will need to edit your conf_global.php file and add: \$INFO['use_friendly_urls'] = '1';. Once this is done run also the tool in \"ACP -> System TAB -> Recount & Rebuild -> Resynchronize Forums\"."; + + return $notices; + } + + + /** + * Return any pre-installation notices + * + * @return array Array of notices + */ + public function preInstallNotices() + { + $notices = array(); + + $notices[] = "Skins made for prior versions will not be compatible with this version. The default skin will be restored."; + + return $notices; + + } +} + diff --git a/upload/admin/applications/core/setup/versions/upg_30001/version_upgrade.php b/upload/admin/applications/core/setup/versions/upg_30001/version_upgrade.php index f5ba2057..35c68348 100644 --- a/upload/admin/applications/core/setup/versions/upg_30001/version_upgrade.php +++ b/upload/admin/applications/core/setup/versions/upg_30001/version_upgrade.php @@ -1,1731 +1,1708 @@ -Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -class version_upgrade -{ - /** - * Custom HTML to show - * - * @var string - */ - protected $_output = ''; - - /** - * fetchs output - * - * @return string - */ - public function fetchOutput() - { - return $this->_output; - } - - /** - * Execute selected method - * - * @param object Registry object - * @return @e void - */ - public function doExecute( ipsRegistry $registry ) - { - /* Make object */ - $this->registry = $registry; - $this->DB = $this->registry->DB(); - $this->settings =& $this->registry->fetchSettings(); - $this->request =& $this->registry->fetchRequest(); - $this->cache = $this->registry->cache(); - $this->caches =& $this->registry->cache()->fetchCaches(); - - //-------------------------------- - // What are we doing? - //-------------------------------- - - switch( $this->request['workact'] ) - { - case 'sql': - case 'sql1': - $this->upgradeSql(1); - break; - case 'sql2': - $this->upgradeSql(2); - break; - case 'sql3': - $this->upgradeSql(3); - break; - case 'sql4': - $this->upgradeSql(4); - break; - case 'sql5': - $this->upgradeSql(5); - break; - case 'sql6': - $this->upgradeSql(6); - break; - case 'applications': - $this->addApplications(); - break; - case 'settings': - $this->addSettings(); - break; - case 'profile': - $this->addProfile(); - break; - case 'permsAndBbcode': - $this->permsAndBbcode(); - break; - case 'skinlang': - $this->exportSkinLang(); - break; - case 'pms': - $this->convertPms(); - break; - case 'contacts': - $this->convertBlockLists(); - break; - case 'pmblock': - $this->convertPmBlockLists(); - break; - case 'polls': - $this->rebuildPolls(); - break; - case 'finish': - $this->finish(); - break; - - default: - $this->upgradeSql(1); - break; - } - - /* Workact is set in the function, so if it has not been set, then we're done. The last function should unset it. */ - if ( $this->request['workact'] ) - { - return false; - } - else - { - return true; - } - } - - /** - * Run SQL files - * - * @param int - * @return @e void - */ - public function upgradeSql( $id=1 ) - { - $cnt = 0; - $SQL = array(); - $file = '_updates_'.$id.'.php'; - $output = ""; - $path = IPSLib::getAppDir( 'core' ) . '/setup/versions/upg_30001/' . strtolower( $this->registry->dbFunctions()->getDriverType() ) . $file; - $prefix = $this->registry->dbFunctions()->getPrefix(); - $sourceFile = ''; - - if ( is_file( $path ) ) - { - require( $path );/*noLibHook*/ - - /* Set DB driver to return any errors */ - $this->DB->return_die = 1; - - foreach( $SQL as $query ) - { - $this->DB->allow_sub_select = 1; - $this->DB->error = ''; - - $query = str_replace( "<%time%>", time(), $query ); - - if ( $this->settings['mysql_tbl_type'] ) - { - if ( preg_match( "/^create table(.+?)/i", $query ) ) - { - $query = preg_replace( "/^(.+?)\);$/is", "\\1) ENGINE={$this->settings['mysql_tbl_type']};", $query ); - } - } - - /* Need to tack on a prefix? */ - if ( $prefix ) - { - $query = IPSSetUp::addPrefixToQuery( $query, $prefix ); - } - - if( IPSSetUp::getSavedData('man') ) - { - $query = trim( $query ); - - /* Ensure the last character is a semi-colon */ - if ( substr( $query, -1 ) != ';' ) - { - $query .= ';'; - } - - $output .= $query . "\n\n"; - } - else - { - $this->DB->query( $query ); - - if ( $this->DB->error ) - { - $this->registry->output->addError( "
    " . $query."
    ".$this->DB->error ); - } - else - { - $cnt++; - } - } - } - - $this->registry->output->addMessage("$cnt запросов выполнено...."); - } - - /* Next Page */ - $this->request['st'] = 0; - - if ( $id < 6 ) - { - $nextid = $id + 1; - $this->request['workact'] = 'sql'.$nextid; - } - else - { - $this->request['workact'] = 'applications'; - } - - if ( IPSSetUp::getSavedData('man') AND $output ) - { - /* Create source file */ - if ( $this->registry->dbFunctions()->getDriverType() == 'mysql' ) - { - $sourceFile = IPSSetUp::createSqlSourceFile( $output, '30001', $id ); - } - - $this->_output = $this->registry->output->template()->upgrade_manual_queries( $output, $sourceFile ); - } - } - - - /** - * Add Applications - * - * @return @e void - */ - public function addApplications() - { - /* Add applications.. */ - $apps = array( 'core' => array(), 'ips' => array(), 'other' => array() ); - $components = array(); - - foreach( array( 'applications', 'applications_addon/ips', 'applications_addon/other' ) as $_pBit ) - { - $path = IPS_ROOT_PATH . $_pBit; - $handle = opendir( $path ); - - while ( ( $file = readdir( $handle ) ) !== FALSE ) - { - if ( ! preg_match( "#^\.#", $file ) ) - { - if ( is_dir( $path . '/' . $file ) ) - { - //----------------------------------------- - // Get it! - //----------------------------------------- - - if ( ! is_file( IPS_ROOT_PATH . $_pBit . '/' . $file . '/xml/information.xml' ) ) - { - continue; - } - - $data = IPSSetUp::fetchXmlAppInformation( $file ); - - switch( $_pBit ) - { - case 'applications': - $apps['core'][ $file ] = $data; - break; - case 'applications_addon/ips': - $apps['ips'][ $file ] = $data; - break; - case 'applications_addon/other': - $apps['other'][ $file ] = $data; - break; - } - } - } - } - - closedir( $handle ); - } - - /* Reorder the array so that core is first */ - $new_array = array(); - $new_array['core'] = $apps['core']['core']; - - foreach( $apps['core'] as $app => $data ) - { - if( $app == 'core' ) - { - continue; - } - - $new_array[$app] = $data; - } - - $apps['core'] = $new_array; - - /* Fetch data for current 'components' */ - $this->DB->build( array( 'select' => '*', - 'from' => 'components' ) ); - - $this->DB->execute(); - - while( $row = $this->DB->fetch() ) - { - $components[ $row['com_section'] ] = $row; - } - - /* Got Gallery? */ - if ( $components['gallery']['com_enabled'] AND $this->DB->checkForTable( 'gallery_upgrade_history' ) ) - { - /* Fetch current version number */ - $version = $this->DB->buildAndFetch( array( 'select' => '*', - 'from' => 'gallery_upgrade_history', - 'order' => 'gallery_version_id DESC', - 'limit' => array( 0, 1 ) ) ); - - $apps['ips']['gallery']['_currentLong'] = $version['gallery_version_id']; - $apps['ips']['gallery']['_currentHuman'] = $version['gallery_version_human']; - } - - /* Got Blog? */ - if ( $components['blog']['com_enabled'] AND $this->DB->checkForTable( 'blog_upgrade_history' ) ) - { - /* Fetch current version number */ - $version = $this->DB->buildAndFetch( array( 'select' => '*', - 'from' => 'blog_upgrade_history', - 'order' => 'blog_version_id DESC', - 'limit' => array( 0, 1 ) ) ); - - $apps['ips']['blog']['_currentLong'] = $version['blog_version_id']; - $apps['ips']['blog']['_currentHuman'] = $version['blog_version_human']; - } - - /* Got Downloads? */ - if ( $components['downloads']['com_enabled'] AND $this->DB->checkForTable( 'downloads_upgrade_history' ) ) - { - /* Fetch current version number */ - $version = $this->DB->buildAndFetch( array( 'select' => '*', - 'from' => 'downloads_upgrade_history', - 'order' => 'idm_version_id DESC', - 'limit' => array( 0, 1 ) ) ); - - $apps['ips']['downloads']['_currentLong'] = $version['idm_version_id']; - $apps['ips']['downloads']['_currentHuman'] = $version['idm_version_human']; - } - - /* Others.. */ - $apps['core']['forums']['_currentLong'] = '30001'; - $apps['core']['forums']['_currentHuman'] = '3.0.0'; - - $apps['core']['core']['_currentLong'] = '30001'; - $apps['core']['core']['_currentHuman'] = '3.0.0'; - - $apps['core']['members']['_currentLong'] = '30001'; - $apps['core']['members']['_currentHuman'] = '3.0.0'; - - $apps['ips']['portal']['_currentLong'] = '30003'; - $apps['ips']['portal']['_currentHuman'] = '3.0.0'; - - //$apps['ips']['chat']['_currentLong'] = '30003'; - //$apps['ips']['chat']['_currentHuman'] = '3.0.0'; - - /* If we are upgrading from 2.3 and did not upload the calendar files, we still need to insert - the applications table entry, otherwise you won't be able to upgrade down the road. We will - insert it as disabled, however, as calendar won't function since files are not available - @link http://community.invisionpower.com/tracker/issue-33543-ipb2-upgrades */ - if( !isset($apps['ips']['calendar']['name']) ) - { - $apps['ips']['calendar'] = array( - 'name' => 'Calendar', - 'public_name' => 'Calendar', - 'description' => "", - 'author' => "Invision Power Services, Inc.", - 'hide_tab' => 0, - 'key' => 'calendar', - 'disabledatinstall' => 1, - 'ipskey' => "fa038db69fa627d8e8e034d65f554d1f", - '_locationkey' => 'ips', - ); - } - - $apps['ips']['calendar']['_currentLong'] = '30003'; - $apps['ips']['calendar']['_currentHuman'] = '3.0.0'; - - /* Now install them.. */ - $num = 0; - - foreach( $apps as $where => $data ) - { - foreach( $apps[ $where ] as $dir => $appData ) - { - //----------------------------------------- - // Had Gallery (e.g.) but didn't upload updated files - //----------------------------------------- - - if( !$appData['name'] ) - { - continue; - } - - $num++; - $_protected = ( in_array( $appData['key'], array( 'core', 'forums', 'members' ) ) ) ? 1 : 0; - $_enabled = ( $appData['disabledatinstall'] ) ? 0 : 1; - - if ( ! $appData['_currentLong'] ) - { - continue; - } - - $this->registry->output->addMessage("Добавление приложения: {$appData['name']}...."); - - $this->DB->insert( 'core_applications', array( 'app_title' => $appData['name'], - 'app_public_title' => ( $appData['public_name'] ) ? $appData['public_name'] : '', // Allow blank in case it's an admin-only app - 'app_description' => $appData['description'], - 'app_author' => $appData['author'], - 'app_hide_tab' => intval($appData['hide_tab']), - 'app_version' => $appData['_currentHuman'], - 'app_long_version' => $appData['_currentLong'], - 'app_directory' => $appData['key'], - 'app_added' => time(), - 'app_position' => $num, - 'app_protected' => $_protected, - 'app_location' => $appData['_locationkey'] ? $appData['_locationkey'] : IPSLib::extractAppLocationKey( $appData['key'] ), - 'app_enabled' => $_enabled, - 'app_website' => $appData['website'], - 'app_update_check' => $appData['update_check'], - 'app_global_caches' => $appData['global_caches'], - ) ); - } - } - - /* Next Page */ - $this->request['workact'] = 'settings'; - } - - /** - * Add Settings - * - * @return @e void - */ - public function addSettings() - { - /* INIT */ - $known = array(); - $apps = array(); - - /* Grab all known settings */ - $this->DB->build( array( 'select' => '*', 'from' => 'conf_settings' ) ); - $this->DB->execute(); - - while( $row = $this->DB->fetch() ) - { - if ( $row['conf_value'] != '' ) - { - $known[ $row['conf_key'] ] = $row['conf_value']; - } - } - - /* Brandon's bug report thingy #12516*/ - if ( ! $known['gb_char_set'] ) - { - /* No charset, set - so we need to now ensure that iso-8859-1 is set */ - $known['gb_char_set'] = 'utf-8'; - } - - /* Wipe out custom time/date settings */ - foreach( array( 'clock_short', 'clock_long', 'clock_tiny', 'clock_date', 'clock_joined', 'time_use_relative_format' ) as $setting ) - { - unset( $known[ $setting ] ); - } - - /* Now we need to fix moderator groups who have permission to RC */ - $groups = array(); - - $this->DB->build( array( 'select' => 'g_id', 'from' => 'groups', 'where' => 'g_access_cp=1 OR g_is_supmod=1' ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $groups[] = $r['g_id']; - } - - $known['report_mod_group_access'] = implode( ',', $groups ); - - /* Load apps */ - $this->DB->build( array( 'select' => '*', 'from' => 'core_applications' ) ); - $this->DB->execute(); - - while( $row = $this->DB->fetch() ) - { - $apps[ $row['app_directory'] ] = $row; - } - - /* Add 'em */ - foreach( $apps as $dir => $data ) - { - if ( is_file( IPSLib::getAppDir( $dir ) . '/xml/' . $dir . '_settings.xml' ) ) - { - $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/settings/settings.php', 'admin_core_settings_settings' ); - $settings = new $classToLoad(); - $settings->makeRegistryShortcuts( $this->registry ); - - $this->request['app_dir'] = $dir; - $settings->importAllSettings( 1, 1, $known ); - - $this->registry->output->addMessage("Добавление настроек для приложения {$data['app_title']}...."); - } - } - - /* Next Page */ - $this->request['workact'] = 'profile'; - } - - /** - * Sort out profile fields - * - * @return @e void - */ - public function addProfile() - { - /* INIT */ - $fields = array(); - $prefix = $this->registry->dbFunctions()->getPrefix(); - $sourceFile = ''; - - /* Get DB driver file */ - require_once( IPSLib::getAppDir( 'core' ) . '/setup/versions/upg_30001/' . strtolower( $this->registry->dbFunctions()->getDriverType() ) . '_version_upgrade.php' );/*noLibHook*/ - - /* First off, move all current profile fields to group ID 3 */ - $this->DB->update( 'pfields_data', array( 'pf_group_id' => 3 ), 'pf_group_id=0' ); - - /* Grab all custom fields */ - $this->DB->build( array( 'select' => '*', - 'from' => 'pfields_data' ) ); - - $this->DB->execute(); - - while( $row = $this->DB->fetch() ) - { - $fields[ $row['pf_id'] ] = $row; - } - - foreach( $fields as $id => $data ) - { - /* Now add any missing content fields */ - if ( ! $this->DB->checkForField( "field_$id", 'pfields_content' ) ) - { - $this->DB->addField( 'pfields_content', "field_$id", 'text' ); - } - } - - $this->DB->optimize( 'pfields_content' ); - - /* Now make add a key */ - $this->DB->build( array( 'select' => '*', - 'from' => 'pfields_data', - 'where' => 'pf_group_id=3' ) ); - - $o = $this->DB->execute(); - - while( $row = $this->DB->fetch( $o ) ) - { - /* Attempt basic conversion of data */ - if ( $row['pf_topic_format'] ) - { - if ( $row['pf_topic_format'] == '{title}: {content}
    ' ) - { - $row['pf_topic_format'] = '{title}:{content}'; - } - else if ( $row['pf_topic_format'] == '{title}: {key}
    ' ) - { - $row['pf_topic_format'] = '{title}:{key}'; - } - } - - /* 2.3.x used 'text', 3.0.0 uses 'input'... */ - $row['pf_type'] = ( $row['pf_type'] == 'text' ) ? 'input' : $row['pf_type']; - - $this->DB->update( 'pfields_data', array( 'pf_type' => $row['pf_type'], 'pf_topic_format' => $row['pf_topic_format'], 'pf_key' => IPSText::makeSeoTitle( $row['pf_title'] ) ), 'pf_id=' . $row['pf_id'] ); - } - - /* Now, move profile data into the correct fields */ - foreach( array( 'aim_name' => 'aim', - 'icq_number' => 'icq', - 'website' => 'website', - 'yahoo' => 'yahoo', - 'interests' => 'interests', - 'msnname' => 'msn', - 'location' => 'location' ) as $old => $new ) - { - $field = $this->DB->buildAndFetch( array( 'select' => '*', - 'from' => 'pfields_data', - 'where' => 'pf_key=\'' . $new . '\'' ) ); - - - - - $query = SQLVC::UpdateOne( $old, $field ); - - if( is_null($query) ) - { - continue; - } - - if ( IPSSetUp::getSavedData('man') ) - { - $query = trim( $query ); - - /* Ensure the last character is a semi-colon */ - if ( substr( $query, -1 ) != ';' ) - { - $query .= ';'; - } - - $output .= $query . "\n\n"; - } - else - { - $this->DB->query( $query ); - - if ( $this->DB->error ) - { - $this->registry->output->addError( $query."

    ".$this->DB->error ); - } - else - { - $this->registry->output->addMessage("Конвертирование поля: {$old}...."); - } - } - } - - /* Update gender */ - $gender = $this->DB->buildAndFetch( array( 'select' => '*', - 'from' => 'pfields_data', - 'where' => 'pf_key=\'gender\'' ) ); - - if ( $gender['pf_id'] ) - { - $queries = array( SQLVC::UpdateTwo( $gender ), - SQLVC::UpdateThree( $gender ) ); - - foreach( $queries as $query ) - { - if ( IPSSetUp::getSavedData('man') ) - { - $query = trim( $query ); - - /* Ensure the last character is a semi-colon */ - if ( substr( $query, -1 ) != ';' ) - { - $query .= ';'; - } - - $output .= $query . "\n\n"; - } - else - { - $this->DB->query( $query ); - - if ( $this->DB->error ) - { - $this->registry->output->addError( $query."

    ".$this->DB->error ); - } - else - { - $this->registry->output->addMessage("Конвертирование поля «Пол»...."); - } - } - } - } - - if ( IPSSetUp::getSavedData('man') AND $output ) - { - /* Create source file */ - if ( $this->registry->dbFunctions()->getDriverType() == 'mysql' ) - { - $sourceFile = IPSSetUp::createSqlSourceFile( $output, '30001', 'pf' ); - } - - $this->_output = $this->registry->output->template()->upgrade_manual_queries( $output, $sourceFile ); - } - - /* Next Page */ - $this->request['workact'] = 'permsAndBbcode'; - } - - /** - * Sort out bbcode and permissions - * - * @return @e void - */ - public function permsAndBbcode() - { - /* INIT */ - $options = IPSSetUp::getSavedData('custom_options'); - $rootAdmins = $options['core'][30001]['rootAdmins']; - - /* First off, import default BBCode */ - $apps = array(); - $bbcodeOld = array(); - $bbcodeNew = array(); - - /* Load apps */ - $this->DB->build( array( 'select' => '*', - 'from' => 'core_applications' ) ); - $this->DB->execute(); - - while( $row = $this->DB->fetch() ) - { - $apps[ $row['app_directory'] ] = $row; - } - - /* Load old codes */ - $this->DB->build( array( 'select' => '*', - 'from' => 'custom_bbcode_old' ) ); - $this->DB->execute(); - - while( $row = $this->DB->fetch() ) - { - $bbcodeOld[ $row['bbcode_tag'] ] = $row; - } - - /* Add 'em */ - foreach( $apps as $dir => $data ) - { - if ( is_file( IPSLib::getAppDir( $dir ) . '/xml/' . $dir . '_bbcode.xml' ) ) - { - //----------------------------------------- - // Continue - //----------------------------------------- - - $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/posts/bbcode.php', 'admin_core_posts_bbcode' ); - $bbcode = new $classToLoad(); - $bbcode->makeRegistryShortcuts( $this->registry ); - - $bbcode->bbcodeImportDo( file_get_contents( IPSLib::getAppDir( $dir ) . '/xml/' . $dir . '_bbcode.xml' ) ); - } - - if ( is_file( IPSLib::getAppDir( $dir ) . '/xml/' . $dir . '_mediatag.xml' ) ) - { - //----------------------------------------- - // Continue - //----------------------------------------- - - $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/posts/media.php', 'admin_core_posts_media' ); - $bbcode = new $classToLoad(); - $bbcode->makeRegistryShortcuts( $this->registry ); - - $bbcode->doMediaImport( file_get_contents( IPSLib::getAppDir( $dir ) . '/xml/' . $dir . '_mediatag.xml' ) ); - } - } - - /* Load current code */ - $this->DB->build( array( 'select' => '*', - 'from' => 'custom_bbcode' ) ); - $this->DB->execute(); - - while( $row = $this->DB->fetch() ) - { - $bbcodeCurrent[ $row['bbcode_tag'] ] = $row; - - //----------------------------------------- - // Need to take into account aliases too! - //----------------------------------------- - - if( $row['bbcode_aliases'] ) - { - $aliases = explode( ',', $row['bbcode_aliases'] ); - - if( count($aliases) ) - { - foreach( $aliases as $alias ) - { - $bbcodeCurrent[ $alias ] = $row; - } - } - } - } - - if ( count( $bbcodeOld ) ) - { - foreach( $bbcodeOld as $tag => $row ) - { - if ( ! $bbcodeCurrent[ $row['bbcode_tag'] ] ) - { - $bbcodeNew[ $row['bbcode_tag'] ] = $row; - } - } - } - - $this->registry->output->addMessage("BB-коды обновлены...."); - - /* Now see if there's anything we need to move back over */ - if ( count( $bbcodeNew ) ) - { - foreach( $bbcodeNew as $tag => $data ) - { - $bbarray = array( - 'bbcode_title' => $data['bbcode_title'], - 'bbcode_desc' => $data['bbcode_desc'], - 'bbcode_tag' => $data['bbcode_tag'], - 'bbcode_replace' => IPSText::safeslashes($data['bbcode_replace']), - 'bbcode_useoption' => $data['bbcode_useoption'], - 'bbcode_example' => $data['bbcode_example'], - 'bbcode_switch_option' => $data['bbcode_switch_option'], - 'bbcode_menu_option_text' => $data['bbcode_menu_option_text'], - 'bbcode_menu_content_text' => $data['bbcode_menu_content_text'], - 'bbcode_groups' => 'all', - 'bbcode_sections' => 'all', - 'bbcode_php_plugin' => '', - 'bbcode_parse' => 2, - 'bbcode_no_parsing' => 0, - 'bbcode_optional_option' => 0, - 'bbcode_aliases' => '', - 'bbcode_image' => '' - ); - - $this->DB->insert( 'custom_bbcode', $bbarray ); - } - } - - /* OK, now onto permissions... */ - /* Insert basic perms for profiles and help */ - $this->DB->insert( 'permission_index', array( 'app' => 'members', - 'perm_type' => 'profile_view', - 'perm_type_id' => 1, - 'perm_view' => '*', - 'perm_2' => '', - 'perm_3' => '', - 'perm_4' => '', - 'perm_5' => '', - 'perm_6' => '', - 'perm_7' => '' ) ); - - $this->DB->insert( 'permission_index', array( 'app' => 'core', - 'perm_type' => 'help', - 'perm_type_id' => 1, - 'perm_view' => '*', - 'perm_2' => '', - 'perm_3' => '', - 'perm_4' => '', - 'perm_5' => '', - 'perm_6' => '', - 'perm_7' => '' ) ); - - /* And now calendars */ - $this->DB->build( array( 'select' => '*', - 'from' => 'cal_calendars' ) ); - - $o = $this->DB->execute(); - - while( $row = $this->DB->fetch( $o ) ) - { - if ( strstr( $row['cal_permissions'], 'a:' ) ) - { - $_perms = unserialize( stripslashes( $row['cal_permissions'] ) ); - - if ( is_array( $_perms ) ) - { - $_view = ( $_perms['perm_read'] ) ? ',' . implode( ',', explode( ',', $_perms['perm_read'] ) ) . ',' : ''; - $_start = ( $_perms['perm_post'] ) ? ',' . implode( ',', explode( ',', $_perms['perm_post'] ) ) . ',' : ''; - $_nomod = ( $_perms['perm_nomod'] ) ? ',' . implode( ',', explode( ',', $_perms['perm_nomod'] ) ). ',' : ''; - - $this->DB->insert( 'permission_index', array( 'app' => 'calendar', - 'perm_type' => 'calendar', - 'perm_type_id' => $row['cal_id'], - 'perm_view' => str_replace( ',*,', '*', $_view ), - 'perm_2' => str_replace( ',*,', '*', $_start ), - 'perm_3' => str_replace( ',*,', '*', $_nomod ), - 'perm_4' => '', - 'perm_5' => '', - 'perm_6' => '', - 'perm_7' => '' ) ); - } - else - { - $this->DB->insert( 'permission_index', array( 'app' => 'calendar', - 'perm_type' => 'calendar', - 'perm_type_id' => $row['cal_id'], - 'perm_view' => '', - 'perm_2' => '', - 'perm_3' => '', - 'perm_4' => '', - 'perm_5' => '', - 'perm_6' => '', - 'perm_7' => '' ) ); - } - } - else - { - $this->DB->insert( 'permission_index', array( 'app' => 'calendar', - 'perm_type' => 'calendar', - 'perm_type_id' => $row['cal_id'], - 'perm_view' => '', - 'perm_2' => '', - 'perm_3' => '', - 'perm_4' => '', - 'perm_5' => '', - 'perm_6' => '', - 'perm_7' => '' ) ); - } - } - - /* And now forums */ - $this->DB->build( array( 'select' => '*', - 'from' => 'forums' ) ); - - $o = $this->DB->execute(); - - while( $row = $this->DB->fetch( $o ) ) - { - /* Do we need to tidy up the title? */ - if ( strstr( $row['name'], '&' ) ) - { - $row['name'] = preg_replace( "#& #", "& ", $row['name'] ); - - $this->DB->update( 'forums', array( 'name' => $row['name'] ), 'id=' . $row['id'] ); - } - - if ( strstr( $row['permission_array'], 'a:' ) ) - { - $_perms = unserialize( stripslashes( $row['permission_array'] ) ); - - if ( is_array( $_perms ) ) - { - $_view = ( $_perms['show_perms'] ) ? ',' . implode( ',', explode( ',', $_perms['show_perms'] ) ) . ',' : ''; - $_read = ( $_perms['read_perms'] ) ? ',' . implode( ',', explode( ',', $_perms['read_perms'] ) ) . ',' : ''; - $_reply = ( $_perms['reply_perms'] ) ? ',' . implode( ',', explode( ',', $_perms['reply_perms'] ) ) . ',' : ''; - $_start = ( $_perms['start_perms'] ) ? ',' . implode( ',', explode( ',', $_perms['start_perms'] ) ) . ',' : ''; - $_upload = ( $_perms['upload_perms'] ) ? ',' . implode( ',', explode( ',', $_perms['upload_perms'] ) ) . ',' : ''; - $_download = ( $_perms['download_perms'] ) ? ',' . implode( ',', explode( ',', $_perms['download_perms'] ) ) . ',' : ''; - - $this->DB->insert( 'permission_index', array( 'app' => 'forums', - 'perm_type' => 'forum', - 'perm_type_id' => $row['id'], - 'perm_view' => str_replace( ',*,', '*', $_view ), - 'perm_2' => str_replace( ',*,', '*', $_read ), - 'perm_3' => str_replace( ',*,', '*', $_reply ), - 'perm_4' => str_replace( ',*,', '*', $_start ), - 'perm_5' => str_replace( ',*,', '*', $_upload ), - 'perm_6' => str_replace( ',*,', '*', $_download ), - 'perm_7' => '' ) ); - } - else - { - $this->DB->insert( 'permission_index', array( 'app' => 'forums', - 'perm_type' => 'forum', - 'perm_type_id' => $row['id'], - 'perm_view' => '', - 'perm_2' => '', - 'perm_3' => '', - 'perm_4' => '', - 'perm_5' => '', - 'perm_6' => '', - 'perm_7' => '' ) ); - - IPSSetUp::addLogMessage( "Пропущены права доступа для форума ID: " . $row['id'], '30001', 'core' ); - } - } - else - { - $this->DB->insert( 'permission_index', array( 'app' => 'forums', - 'perm_type' => 'forum', - 'perm_type_id' => $row['id'], - 'perm_view' => '', - 'perm_2' => '', - 'perm_3' => '', - 'perm_4' => '', - 'perm_5' => '', - 'perm_6' => '', - 'perm_7' => '' ) ); - - IPSSetUp::addLogMessage( "Пропущены права доступа для форума ID: " . $row['id'], '30001', 'core' ); - } - } - - $this->registry->output->addMessage("Права доступа обновлены...."); - - /* Fix up forum moderators */ - $this->DB->build( array( 'select' => '*', - 'from' => 'moderators' ) ); - - $o = $this->DB->execute(); - - while( $r = $this->DB->fetch( $o ) ) - { - $this->DB->update( 'moderators', array( 'forum_id' => ',' . IPSText::cleanPermString( $r['forum_id'] ) . ',' ), 'mid=' . $r['mid'] ); - } - - $this->registry->output->addMessage("Модераторы форумов обновлены...."); - - /* Root admin reset? */ - if ( $rootAdmins ) - { - /* Find all admin groups */ - $this->DB->build( array( 'select' => '*', - 'from' => 'groups', - 'where' => 'g_id != ' . $this->settings['admin_group'] . ' AND g_access_cp=1' ) ); - - $o = $this->DB->execute(); - - while( $row = $this->DB->fetch( $o ) ) - { - /* Insert blank perm row */ - $this->DB->insert( 'admin_permission_rows', array( 'row_id' => $row['g_id'], - 'row_id_type' => 'group', - 'row_perm_cache' => serialize( array() ), - 'row_updated' => time() ) ); - } - - $this->registry->output->addMessage("Удалены вторичные группы администраторов...."); - } - - /* Report center reset */ - $canReport = array(); - $canView = array(); - - $this->DB->build( array( 'select' => 'g_id, g_view_board, g_access_cp, g_is_supmod', - 'from' => 'groups' ) ); - - $o = $this->DB->execute(); - - while( $r = $this->DB->fetch( $o ) ) - { - if( $r['g_access_cp'] OR $r['g_is_supmod'] ) - { - $canView[] = $r['g_id']; - } - - if( $r['g_view_board'] AND $r['g_id'] != $this->settings['guest_group'] ) - { - $canReport[] = $r['g_id']; - } - } - - $this->DB->update( 'rc_classes', array( 'group_can_report' => ',' . implode( ',', $canReport ) . ',', 'mod_group_perm' => ',' . implode( ',', $canView ) . ',' ) ); - - /* Next Page */ - $this->request['workact'] = 'skinlang'; - } - - /** - * Export skin and languages - * - * @return @e void - */ - public function exportSkinLang() - { - /* INIT */ - $start = intval( $this->request['st'] ); - $converted = 0; - $options = IPSSetUp::getSavedData('custom_options'); - $_doSkin = $options['core'][30001]['exportSkins']; - $_doLang = $options['core'][30001]['exportLangs']; - - /* Doing anything? */ - if ( ! $_doSkin AND ! $_doLang ) - { - $this->registry->output->addMessage( "Нечего экспортировать" ); - - /* Next Page */ - $this->request['workact'] = 'pms'; - return; - } - - /* Ok... */ - if ( ! $start ) - { - /* Do langs.. */ - if ( $_doLang ) - { - if ( ! is_dir( IPS_CACHE_PATH . 'cache/previousLangFiles' ) ) - { - if ( @mkdir( IPS_CACHE_PATH . 'cache/previousLangFiles', IPS_FOLDER_PERMISSION ) ) - { - @chmod( IPS_CACHE_PATH . 'cache/previousLangFiles', IPS_FOLDER_PERMISSION ); - } - } - - try - { - foreach( new DirectoryIterator( IPS_CACHE_PATH . 'cache/lang_cache' ) as $file ) - { - if ( ! $file->isDot() AND $file->isDir() ) - { - $name = $file->getFilename(); - - if ( substr( $name, 0, 1 ) != '.' ) - { - $this->registry->output->addMessage( "Перенесена директория языка: {$name}" ); - - @rename( IPS_CACHE_PATH . 'cache/lang_cache/' . $name, IPS_CACHE_PATH . 'cache/previousLangFiles/' . $name ); - } - } - } - } catch ( Exception $e ) {} - } - } - - /* Doing skins? */ - if ( $_doSkin ) - { - $this->DB->build( array( 'select' => '*', - 'from' => 'skin_sets', - 'where' => 'set_skin_set_id > ' . $start, - 'limit' => array( 0, 1 ), - 'order' => 'set_skin_set_id ASC' ) ); - - $this->DB->execute(); - - $set = $this->DB->fetch(); - - if ( ! $set ) - { - $this->request['st'] = 0; - - /* All done.. */ - $this->registry->output->addMessage( "Все стили обработаны" ); - - /* Next Page */ - $this->request['workact'] = 'pms'; - return; - } - else - { - if ( ! is_dir( IPS_CACHE_PATH . 'cache/previousSkinFiles' ) ) - { - if ( @mkdir( IPS_CACHE_PATH . 'cache/previousSkinFiles', IPS_FOLDER_PERMISSION ) ) - { - @chmod( IPS_CACHE_PATH . 'cache/previousSkinFiles', IPS_FOLDER_PERMISSION ); - } - } - - $safeName = IPSText::alphanumericalClean( $set['set_name'] ); - $dirPath = IPS_CACHE_PATH . 'cache/previousSkinFiles/' . $safeName; - - if ( @mkdir( $dirPath, IPS_FOLDER_PERMISSION ) ) - { - @chmod( $dirPath, IPS_FOLDER_PERMISSION ); - } - - if ( is_dir( $dirPath ) ) - { - /* Export CSS */ - if ( @mkdir( $dirPath . '/css', IPS_FOLDER_PERMISSION ) ) - { - @chmod( $dirPath . '/css', IPS_FOLDER_PERMISSION ); - } - - @file_put_contents( $dirPath . '/css/css.css', $set['set_cache_css'] ); - - /* Export Wrapper */ - if ( @mkdir( $dirPath . '/wrapper', IPS_FOLDER_PERMISSION ) ) - { - @chmod( $dirPath . '/wrapper', IPS_FOLDER_PERMISSION ); - } - - @file_put_contents( $dirPath . '/wrapper/wrapper.html', $set['set_wrapper'] ); - - /* Export Templates */ - if ( @mkdir( $dirPath . '/templates', IPS_FOLDER_PERMISSION ) ) - { - @chmod( $dirPath . '/templates', IPS_FOLDER_PERMISSION ); - } - - $this->DB->build( array( 'select' => '*', - 'from' => 'skin_templates_old', - 'where' => 'set_id=' . $set['set_skin_set_id'], - 'order' => 'func_name ASC' ) ); - - $this->DB->execute(); - - while( $row = $this->DB->fetch() ) - { - $_groupName = IPSText::alphanumericalClean( $row['group_name'] ); - $_bitName = IPSText::alphanumericalClean( $row['func_name'] ); - - /* Make section dir */ - if ( @mkdir( $dirPath . '/templates/' . $_groupName, IPS_FOLDER_PERMISSION ) ) - { - @chmod( $dirPath . '/templates/' . $_groupName, IPS_FOLDER_PERMISSION ); - } - - @file_put_contents( $dirPath . '/templates/' . $_groupName . '/' . $_bitName . '.html', $row['section_content'] ); - } - } - - /* Set ID */ - $this->request['st'] = $set['set_skin_set_id']; - - /* We did some, go check again.. */ - $this->registry->output->addMessage( $set['set_name'] . " Exported" ); - - /* Next Page */ - $this->request['workact'] = 'skinlang'; - return; - } - } - - /* We did some, go check again.. */ - $this->registry->output->addMessage( 'Нет языков или стилей для экспорта' ); - - /* Next Page */ - $this->request['workact'] = 'pms'; - return; - } - - /** - * Convert PMs - * - * @return @e void - */ - public function convertPms() - { - /* INIT */ - $pergo = 200; - $start = intval( $this->request['st'] ); - $converted = 0; - $seen = 0; - - $options = IPSSetUp::getSavedData('custom_options'); - $skipPms = $options['core'][30001]['skipPms']; - - /* Skipping? */ - if ( $skipPms ) - { - /* Update all members */ - $this->DB->update( 'members', array( 'msg_count_reset' => 1, 'msg_count_new' => 0 ) ); - - /* add a message */ - $this->registry->output->addMessage( "Пропускаем конвертирование ЛС" ); - - $this->request['workact'] = 'contacts'; - $this->request['st'] = 0; - return; - } - - /* Select max topic ID thus far */ - $_tmp = $this->DB->buildAndFetch( array( 'select' => 'MAX(mt_id) as max', - 'from' => 'message_topics' ) ); - - $topicID = intval( $_tmp['max'] ); - - $this->DB->build( array( 'select' => '*', - 'from' => 'message_text', - 'order' => 'msg_id ASC', - 'limit' => array( $start, $pergo ) ) ); - - $o = $this->DB->execute(); - - while( $post = $this->DB->fetch( $o ) ) - { - $seen++; - - /* Make sure all data is valid */ - if ( intval( $post['msg_sent_to_count'] ) < 1 ) - { - continue; - } - - /* a little set up */ - $oldTopics = array(); - - /* Now fetch all topics */ - $this->DB->build( array( 'select' => '*', - 'from' => 'message_topics_old', - 'where' => 'mt_msg_id=' . intval( $post['msg_id'] ) ) ); - - $t = $this->DB->execute(); - - while( $topic = $this->DB->fetch( $t ) ) - { - /* Got any data? */ - if ( ! $topic['mt_from_id'] OR ! $topic['mt_to_id'] ) - { - continue; - } - - $oldTopics[ $topic['mt_id'] ] = $topic; # Luke added that space. That's his first contribution to the code vaults at IPS. - } - - /* Fail safe */ - if ( ! count( $oldTopics ) ) - { - continue; - } - - /* Increment number */ - $topicID++; - - /* Add in the post */ - $this->DB->insert( 'message_posts', array( 'msg_topic_id' => $topicID, - 'msg_date' => $post['msg_date'], - 'msg_post' => $post['msg_post'], - 'msg_post_key' => $post['msg_post_key'], - 'msg_author_id' => $post['msg_author_id'], - 'msg_ip_address' => $post['msg_ip_address'], - 'msg_is_first_post' => 1 ) ); - $postID = $this->DB->getInsertId(); - - /* Update attachments */ - $this->DB->update( 'attachments', array( 'attach_rel_id' => $postID ), "attach_rel_module='msg' AND attach_rel_id=".$post['msg_id'] ); - - /* Define some stuff. "To" member is added last in IPB 2 */ - $_tmp = $oldTopics; - ksort( $_tmp ); - $topicData = array_pop( $_tmp ); - $_invited = array(); - $_seenOwner = array(); - $_isDeleted = 0; - - /* Add the member rows */ - foreach( $oldTopics as $mt_id => $data ) - { - /* Prevent SQL error with unique index: Seen the owner ID already? */ - if ( $_seenOwner[ $data['mt_owner_id'] ] ) - { - continue; - } - - $_seenOwner[ $data['mt_owner_id'] ] = $data['mt_owner_id']; - - /* Build invited - does not include 'to' person */ - if ( $data['mt_owner_id'] AND ( $post['msg_author_id'] != $data['mt_owner_id'] ) AND ( $topicData['mt_to_id'] != $data['mt_owner_id'] ) ) - { - $_invited[ $data['mt_owner_id'] ] = $data['mt_owner_id'];/*noLibHook*/ - } - - $_isSent = ( $data['mt_vid_folder'] == 'sent' ) ? 1 : 0; - $_isDraft = ( $data['mt_vid_folder'] == 'unsent' ) ? 1 : 0; - - $this->DB->insert( 'message_topic_user_map', array( 'map_user_id' => $data['mt_owner_id'], - 'map_topic_id' => $topicID, - 'map_folder_id' => ( $_isDraft ) ? 'drafts' : 'myconvo', - 'map_read_time' => ( $data['mt_user_read'] ) ? $data['mt_user_read'] : ( $data['mt_read'] ? time() : 0 ), - 'map_user_active' => 1, - 'map_user_banned' => 0, - 'map_has_unread' => 0, //( $data['mt_read'] ) ? 0 : 1, - 'map_is_system' => 0, - 'map_last_topic_reply' => $post['msg_date'], - 'map_is_starter' => ( $data['mt_owner_id'] == $post['msg_author_id'] ) ? 1 : 0 ) ); - - } - - /* Now, did we see the author? If not, add them too but as inactive */ - if ( ! $_seenOwner[ $post['msg_author_id'] ] ) - { - $_isDeleted = 1; - - /*$this->DB->insert( 'message_topic_user_map', array( 'map_user_id' => $post['msg_author_id'], - 'map_topic_id' => $topicID, - 'map_folder_id' => 'myconvo', - 'map_read_time' => 0, - 'map_user_active' => 0, - 'map_user_banned' => 0, - 'map_has_unread' => 0, - 'map_is_system' => 0, - 'map_is_starter' => 1 ) );*/ - } - - $_isSent = ( $topicData['mt_vid_folder'] == 'sent' ) ? 1 : 0; - $_isDraft = ( $topicData['mt_vid_folder'] == 'unsent' ) ? 1 : 0; - - /* This is for MSSQL. I need a quick fix. This is it. Enjoy. */ - if ( method_exists( $this->DB, 'setTableIdentityInsert' ) ) - { - $this->DB->setTableIdentityInsert( 'message_topics', 'ON' ); - } - - /* Add the topic */ - $this->DB->insert( 'message_topics', array( 'mt_id' => $topicID, - 'mt_date' => $topicData['mt_date'], - 'mt_title' => $topicData['mt_title'], - 'mt_starter_id' => $post['msg_author_id'], - 'mt_start_time' => $post['msg_date'], - 'mt_last_post_time' => $post['msg_date'], - 'mt_invited_members' => serialize( array_keys( $_invited ) ), - 'mt_to_count' => count( array_keys( $_invited ) ) + 1, - 'mt_to_member_id' => $topicData['mt_to_id'], - 'mt_replies' => 0, - 'mt_last_msg_id' => $postID, - 'mt_first_msg_id' => $postID, - 'mt_is_draft' => $_isDraft, - 'mt_is_deleted' => $_isDeleted, - 'mt_is_system' => 0 ) ); - - /* This is for MSSQL. I need a quick fix. This is it. Enjoy. */ - if ( method_exists( $this->DB, 'setTableIdentityInsert' ) ) - { - $this->DB->setTableIdentityInsert( 'message_topics', 'OFF' ); - } - - $converted++; - } - - /* What to do? */ - if ( $seen ) - { - $this->request['st'] = $start + $pergo; - - /* We did some, go check again.. */ - $this->registry->output->addMessage( "Проверено " . $this->request['st'] . " личных сообщений. Сконвертировано за этот проход $converted." ); - - /* Re-do Page */ - $this->request['workact'] = 'pms'; - } - else - { - /* Update all members */ - $this->DB->update( 'members', array( 'msg_count_reset' => 1 ) ); - - /* Nope, nothing to do - we're done! */ - /* Next Page */ - $this->request['workact'] = 'contacts'; - $this->request['st'] = 0; - } - } - - /** - * Convert Block lists - * - * @return @e void - */ - public function convertBlockLists() - { - /* INIT */ - $pergo = 200; - $start = intval( $this->request['st'] ); - $options = IPSSetUp::getSavedData('custom_options'); - $skipPms = $options['core'][30001]['skipPms']; - $converted = 0; - $seen = 0; - - /* Skipping? */ - if ( $skipPms ) - { - /* add a message */ - $this->registry->output->addMessage( "Skipping Block List Conversion" ); - - $this->request['workact'] = 'pmblock'; - $this->request['st'] = 0; - return; - } - - $this->DB->build( array( 'select' => '*', - 'from' => 'members', - 'where' => method_exists( $this->DB, 'setTableIdentityInsert' ) ? 'ignored_users NOT LIKE \'\'' : $this->DB->buildLength('ignored_users') . ' > 0', - 'order' => 'member_id ASC', - 'limit' => array( $start, $pergo ) ) ); - - $o = $this->DB->execute(); - - while( $member = $this->DB->fetch( $o ) ) - { - $seen++; - - /* Got anything? */ - if ( strstr( $member['ignored_users'], ',' ) ) - { - $ignored = explode( ',', $member['ignored_users'] ); - } - - if ( ! is_array( $ignored ) ) - { - continue; - } - - /* Add it to the table */ - foreach( $ignored as $iid ) - { - if ( ! $iid ) - { - continue; - } - - $this->DB->insert( 'ignored_users', array( 'ignore_owner_id' => $member['member_id'], - 'ignore_ignore_id' => $iid, - 'ignore_topics' => 1 ) ); - } - - $converted++; - } - - /* What to do? */ - if ( $seen ) - { - $this->request['st'] = $start + $pergo; - - /* We did some, go check again.. */ - $this->registry->output->addMessage( "$converted списков игнорирования сконвертировано." ); - - /* Re-do Page */ - $this->request['workact'] = 'contacts'; - } - else - { - /* Nope, nothing to do - we're done! */ - /* Next Page */ - $this->request['workact'] = 'pmblock'; - $this->request['st'] = 0; - } - } - - /** - * Convert Block lists - * - * @return @e void - */ - public function convertPmBlockLists() - { - /* INIT */ - $pergo = 200; - $start = intval( $this->request['st'] ); - $converted = 0; - $seen = 0; - $options = IPSSetUp::getSavedData('custom_options'); - $skipPms = $options['core'][30001]['skipPms']; - - /* Skipping? */ - if ( $skipPms ) - { - /* add a message */ - $this->registry->output->addMessage( "Skipping PM Block List Conversion" ); - - $this->request['workact'] = 'finish'; - $this->request['st'] = 0; - return; - } - - $this->DB->build( array( 'select' => '*', - 'from' => 'contacts', - 'where' => 'allow_msg=0', - 'order' => 'id ASC', - 'limit' => array( $start, $pergo ) ) ); - - $o = $this->DB->execute(); - - while( $contact = $this->DB->fetch( $o ) ) - { - $seen++; - - /* Already got an entry for this contact? */ - $test = $this->DB->buildAndFetch( array( 'select' => '*', - 'from' => 'ignored_users', - 'where' => 'ignore_owner_id=' . intval( $contact['member_id'] ) ) ); - - /* Got anything? */ - if ( $test['ignore_owner_id'] ) - { - $this->DB->update( 'ignored_users', array( 'ignore_messages' => 1 ), 'ignore_id=' . $test['ignore_id'] ); - } - else - { - $this->DB->insert( 'ignored_users', array( 'ignore_owner_id' => $contact['member_id'], - 'ignore_ignore_id' => $contact['contact_id'], - 'ignore_messages' => 1 ) ); - } - - $converted++; - } - - /* What to do? */ - if ( $seen ) - { - $this->request['st'] = $start + $pergo; - - /* We did some, go check again.. */ - $this->registry->output->addMessage( "$converted списков игнорирования личных сообщений сконвертировано." ); - - /* Re-do Page */ - $this->request['workact'] = 'pmblock'; - } - else - { - /* Nope, nothing to do - we're done! */ - /* Next Page */ - $this->request['workact'] = 'polls'; - } - } - - /** - * Rebuild polls - * Ensures that serialized polls are correctly converted to utf8 - */ - public function rebuildPolls() - { - $this->DB->build( array( 'select' => 'pid, choices', 'from' => 'polls' ) ); - $o = $this->DB->execute(); - - while( $row = $this->DB->fetch( $o ) ) - { - $row['choices'] = preg_replace('!s:(\d+):"(.*?)";!se', "'s:'.strlen('$2').':\"$2\";'", $row['choices'] ); - $this->DB->update( 'polls', array( 'choices' => $row['choices'] ), 'pid = ' . $row['pid'] ); - } - - $this->registry->output->addMessage( "Обновление опросов завершено." ); - $this->request['workact'] = 'finish'; - $this->request['st'] = 0; - } - - - /** - * Finish up conversion stuff - * - * @return @e void - */ - public function finish() - { - $options = IPSSetUp::getSavedData('custom_options'); - $skipPms = $options['core'][30001]['skipPms']; - $output = array(); - - /* Emoticons */ - if ( file_exists( DOC_IPS_ROOT_PATH . 'style_emoticons/default' ) ) - { - try - { - foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . 'style_emoticons/default' ) as $file ) - { - if ( ! $file->isDot() ) - { - $_name = $file->getFileName(); - - /* Annoyingly, isDot doesn't match .svn, etc */ - if ( substr( $_name, 0, 1 ) == '.' ) - { - continue; - } - - if ( @copy( DOC_IPS_ROOT_PATH . 'style_emoticons/default/' . $_name, IPS_PUBLIC_PATH . 'style_emoticons/default/' . $_name ) ) - { - $output[] = "Смайлики: скопирован $_name..."; - } - else - { - $output[] = "Не удалось скопировать $_name - после обновления перенесите его самостоятельно"; - } - } - } - } catch ( Exception $e ) {} - } - - /* LOG IN METHODS */ - $this->DB->build( array( 'select' => '*', - 'from' => 'login_methods' ) ); - - $this->DB->execute(); - - while( $row = $this->DB->fetch() ) - { - $loginMethods[ $row['login_folder_name'] ] = $row; - } - - $count = 6; - $recount = array( 'internal' => 1, - 'ipconverge' => 2, - 'ldap' => 3, - 'external' => 4 ); - - /* Fetch XML */ - require_once( IPS_KERNEL_PATH . 'classXML.php' );/*noLibHook*/ - $xml = new classXML( IPSSetUp::charSet ); - - $xml->load( IPS_ROOT_PATH . 'setup/xml/loginauth.xml' ); - - foreach( $xml->fetchElements( 'login_methods' ) as $xmlelement ) - { - $data = $xml->fetchElementsFromRecord( $xmlelement ); - - $data['login_order'] = ( isset( $recount[ $data['login_folder_name'] ] ) ) ? $recount[ $data['login_folder_name'] ] : ++$count; - - unset( $data['login_id'] ); - - if ( ! $loginMethods[ $data['login_folder_name'] ] ) - { - $this->DB->insert( 'login_methods', $data ); - } - else - { - $this->DB->update( 'login_methods', array( 'login_order' => $data['login_order'] ), 'login_folder_name=\'' . $data['login_folder_name'] . '\'' ); - } - } - - /* Reset member languages and skins */ - $this->DB->update( 'members', array( 'language' => IPSLib::getDefaultLanguage(), 'skin' => 0 ) ); - - /* Empty caches */ - $this->DB->delete( 'cache_store', "cs_key='forum_cache'"); - $this->DB->delete( 'cache_store', "cs_key='skin_id_cache'"); - - /* Empty other tables */ - $this->DB->delete( 'skin_cache' ); - $this->DB->delete( 'skin_templates_cache' ); - - /* Reset admin permissions */ - $this->DB->update( 'admin_permission_rows', array( 'row_perm_cache' => '' ) ); - - /* Drop Tables */ - $this->DB->dropTable( 'contacts' ); - $this->DB->dropTable( 'skin_macro' ); - $this->DB->dropTable( 'skin_template_links' ); - $this->DB->dropTable( 'skin_templates_old' ); - $this->DB->dropTable( 'skin_sets' ); - $this->DB->dropTable( 'languages' ); - $this->DB->dropTable( 'topics_read' ); - $this->DB->dropTable( 'topic_markers' ); - $this->DB->dropTable( 'acp_help' ); - $this->DB->dropTable( 'members_converge' ); - $this->DB->dropTable( 'member_extra' ); - $this->DB->dropTable( 'custom_bbcode_old' ); - $this->DB->dropTable( 'admin_sessions' ); - $this->DB->dropTable( 'components' ); - $this->DB->dropTable( 'admin_permission_keys' ); - $this->DB->dropTable( 'conf_settings' ); - $this->DB->dropTable( 'conf_settings_titles' ); - $this->DB->dropTable( 'reg_antispam' ); - - if ( ! $skipPms ) - { - $this->DB->dropTable( 'message_text' ); - $this->DB->dropTable( 'message_topics_old' ); - } - - $message = ( is_array( $output ) AND count($output) ) ? implode( "
    ", $output ) . '
    ' : ''; - - $this->registry->output->addMessage( $message . "очистка SQL завершена..."); - - /* Last function, so unset workact */ - $this->request['workact'] = ''; - } +Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +class version_upgrade +{ + /** + * Custom HTML to show + * + * @var string + */ + protected $_output = ''; + + /** + * fetchs output + * + * @return string + */ + public function fetchOutput() + { + return $this->_output; + } + + /** + * Execute selected method + * + * @param object Registry object + * @return @e void + */ + public function doExecute( ipsRegistry $registry ) + { + /* Make object */ + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + + //-------------------------------- + // What are we doing? + //-------------------------------- + + switch( $this->request['workact'] ) + { + case 'sql': + case 'sql1': + $this->upgradeSql(1); + break; + case 'sql2': + $this->upgradeSql(2); + break; + case 'sql3': + $this->upgradeSql(3); + break; + case 'sql4': + $this->upgradeSql(4); + break; + case 'sql5': + $this->upgradeSql(5); + break; + case 'sql6': + $this->upgradeSql(6); + break; + case 'applications': + $this->addApplications(); + break; + case 'settings': + $this->addSettings(); + break; + case 'profile': + $this->addProfile(); + break; + case 'permsAndBbcode': + $this->permsAndBbcode(); + break; + case 'skinlang': + $this->exportSkinLang(); + break; + case 'pms': + $this->convertPms(); + break; + case 'contacts': + $this->convertBlockLists(); + break; + case 'pmblock': + $this->convertPmBlockLists(); + break; + case 'finish': + $this->finish(); + break; + + default: + $this->upgradeSql(1); + break; + } + + /* Workact is set in the function, so if it has not been set, then we're done. The last function should unset it. */ + if ( $this->request['workact'] ) + { + return false; + } + else + { + return true; + } + } + + /** + * Run SQL files + * + * @param int + * @return @e void + */ + public function upgradeSql( $id=1 ) + { + $cnt = 0; + $SQL = array(); + $file = '_updates_'.$id.'.php'; + $output = ""; + $path = IPSLib::getAppDir( 'core' ) . '/setup/versions/upg_30001/' . strtolower( $this->registry->dbFunctions()->getDriverType() ) . $file; + $prefix = $this->registry->dbFunctions()->getPrefix(); + $sourceFile = ''; + + if ( is_file( $path ) ) + { + require( $path );/*noLibHook*/ + + /* Set DB driver to return any errors */ + $this->DB->return_die = 1; + + foreach( $SQL as $query ) + { + $this->DB->allow_sub_select = 1; + $this->DB->error = ''; + + $query = str_replace( "<%time%>", time(), $query ); + + if ( $this->settings['mysql_tbl_type'] ) + { + if ( preg_match( "/^create table(.+?)/i", $query ) ) + { + $query = preg_replace( "/^(.+?)\);$/is", "\\1) ENGINE={$this->settings['mysql_tbl_type']};", $query ); + } + } + + /* Need to tack on a prefix? */ + if ( $prefix ) + { + $query = IPSSetUp::addPrefixToQuery( $query, $prefix ); + } + + if( IPSSetUp::getSavedData('man') ) + { + $query = trim( $query ); + + /* Ensure the last character is a semi-colon */ + if ( substr( $query, -1 ) != ';' ) + { + $query .= ';'; + } + + $output .= $query . "\n\n"; + } + else + { + $this->DB->query( $query ); + + if ( $this->DB->error ) + { + $this->registry->output->addError( "
    " . $query."
    ".$this->DB->error ); + } + else + { + $cnt++; + } + } + } + + $this->registry->output->addMessage("$cnt queries ran...."); + } + + /* Next Page */ + $this->request['st'] = 0; + + if ( $id < 6 ) + { + $nextid = $id + 1; + $this->request['workact'] = 'sql'.$nextid; + } + else + { + $this->request['workact'] = 'applications'; + } + + if ( IPSSetUp::getSavedData('man') AND $output ) + { + /* Create source file */ + if ( $this->registry->dbFunctions()->getDriverType() == 'mysql' ) + { + $sourceFile = IPSSetUp::createSqlSourceFile( $output, '30001', $id ); + } + + $this->_output = $this->registry->output->template()->upgrade_manual_queries( $output, $sourceFile ); + } + } + + + /** + * Add Applications + * + * @return @e void + */ + public function addApplications() + { + /* Add applications.. */ + $apps = array( 'core' => array(), 'ips' => array(), 'other' => array() ); + $components = array(); + + foreach( array( 'applications', 'applications_addon/ips', 'applications_addon/other' ) as $_pBit ) + { + $path = IPS_ROOT_PATH . $_pBit; + $handle = opendir( $path ); + + while ( ( $file = readdir( $handle ) ) !== FALSE ) + { + if ( ! preg_match( "#^\.#", $file ) ) + { + if ( is_dir( $path . '/' . $file ) ) + { + //----------------------------------------- + // Get it! + //----------------------------------------- + + if ( ! is_file( IPS_ROOT_PATH . $_pBit . '/' . $file . '/xml/information.xml' ) ) + { + continue; + } + + $data = IPSSetUp::fetchXmlAppInformation( $file ); + + switch( $_pBit ) + { + case 'applications': + $apps['core'][ $file ] = $data; + break; + case 'applications_addon/ips': + $apps['ips'][ $file ] = $data; + break; + case 'applications_addon/other': + $apps['other'][ $file ] = $data; + break; + } + } + } + } + + closedir( $handle ); + } + + /* Reorder the array so that core is first */ + $new_array = array(); + $new_array['core'] = $apps['core']['core']; + + foreach( $apps['core'] as $app => $data ) + { + if( $app == 'core' ) + { + continue; + } + + $new_array[$app] = $data; + } + + $apps['core'] = $new_array; + + /* Fetch data for current 'components' */ + $this->DB->build( array( 'select' => '*', + 'from' => 'components' ) ); + + $this->DB->execute(); + + while( $row = $this->DB->fetch() ) + { + $components[ $row['com_section'] ] = $row; + } + + /* Got Gallery? */ + if ( $components['gallery']['com_enabled'] AND $this->DB->checkForTable( 'gallery_upgrade_history' ) ) + { + /* Fetch current version number */ + $version = $this->DB->buildAndFetch( array( 'select' => '*', + 'from' => 'gallery_upgrade_history', + 'order' => 'gallery_version_id DESC', + 'limit' => array( 0, 1 ) ) ); + + $apps['ips']['gallery']['_currentLong'] = $version['gallery_version_id']; + $apps['ips']['gallery']['_currentHuman'] = $version['gallery_version_human']; + } + + /* Got Blog? */ + if ( $components['blog']['com_enabled'] AND $this->DB->checkForTable( 'blog_upgrade_history' ) ) + { + /* Fetch current version number */ + $version = $this->DB->buildAndFetch( array( 'select' => '*', + 'from' => 'blog_upgrade_history', + 'order' => 'blog_version_id DESC', + 'limit' => array( 0, 1 ) ) ); + + $apps['ips']['blog']['_currentLong'] = $version['blog_version_id']; + $apps['ips']['blog']['_currentHuman'] = $version['blog_version_human']; + } + + /* Got Downloads? */ + if ( $components['downloads']['com_enabled'] AND $this->DB->checkForTable( 'downloads_upgrade_history' ) ) + { + /* Fetch current version number */ + $version = $this->DB->buildAndFetch( array( 'select' => '*', + 'from' => 'downloads_upgrade_history', + 'order' => 'idm_version_id DESC', + 'limit' => array( 0, 1 ) ) ); + + $apps['ips']['downloads']['_currentLong'] = $version['idm_version_id']; + $apps['ips']['downloads']['_currentHuman'] = $version['idm_version_human']; + } + + /* Others.. */ + $apps['core']['forums']['_currentLong'] = '30001'; + $apps['core']['forums']['_currentHuman'] = '3.0.0'; + + $apps['core']['core']['_currentLong'] = '30001'; + $apps['core']['core']['_currentHuman'] = '3.0.0'; + + $apps['core']['members']['_currentLong'] = '30001'; + $apps['core']['members']['_currentHuman'] = '3.0.0'; + + $apps['ips']['portal']['_currentLong'] = '30003'; + $apps['ips']['portal']['_currentHuman'] = '3.0.0'; + + //$apps['ips']['chat']['_currentLong'] = '30003'; + //$apps['ips']['chat']['_currentHuman'] = '3.0.0'; + + /* If we are upgrading from 2.3 and did not upload the calendar files, we still need to insert + the applications table entry, otherwise you won't be able to upgrade down the road. We will + insert it as disabled, however, as calendar won't function since files are not available + @link http://community.invisionpower.com/tracker/issue-33543-ipb2-upgrades */ + if( !isset($apps['ips']['calendar']['name']) ) + { + $apps['ips']['calendar'] = array( + 'name' => 'Calendar', + 'public_name' => 'Calendar', + 'description' => "", + 'author' => "Invision Power Services, Inc.", + 'hide_tab' => 0, + 'key' => 'calendar', + 'disabledatinstall' => 1, + 'ipskey' => "fa038db69fa627d8e8e034d65f554d1f", + '_locationkey' => 'ips', + ); + } + + $apps['ips']['calendar']['_currentLong'] = '30003'; + $apps['ips']['calendar']['_currentHuman'] = '3.0.0'; + + /* Now install them.. */ + $num = 0; + + foreach( $apps as $where => $data ) + { + foreach( $apps[ $where ] as $dir => $appData ) + { + //----------------------------------------- + // Had Gallery (e.g.) but didn't upload updated files + //----------------------------------------- + + if( !$appData['name'] ) + { + continue; + } + + $num++; + $_protected = ( in_array( $appData['key'], array( 'core', 'forums', 'members' ) ) ) ? 1 : 0; + $_enabled = ( $appData['disabledatinstall'] ) ? 0 : 1; + + if ( ! $appData['_currentLong'] ) + { + continue; + } + + $this->registry->output->addMessage("Adding application: {$appData['name']}...."); + + $this->DB->insert( 'core_applications', array( 'app_title' => $appData['name'], + 'app_public_title' => ( $appData['public_name'] ) ? $appData['public_name'] : '', // Allow blank in case it's an admin-only app + 'app_description' => $appData['description'], + 'app_author' => $appData['author'], + 'app_hide_tab' => intval($appData['hide_tab']), + 'app_version' => $appData['_currentHuman'], + 'app_long_version' => $appData['_currentLong'], + 'app_directory' => $appData['key'], + 'app_added' => time(), + 'app_position' => $num, + 'app_protected' => $_protected, + 'app_location' => $appData['_locationkey'] ? $appData['_locationkey'] : IPSLib::extractAppLocationKey( $appData['key'] ), + 'app_enabled' => $_enabled, + 'app_website' => $appData['website'], + 'app_update_check' => $appData['update_check'], + 'app_global_caches' => $appData['global_caches'], + ) ); + } + } + + /* Next Page */ + $this->request['workact'] = 'settings'; + } + + /** + * Add Settings + * + * @return @e void + */ + public function addSettings() + { + /* INIT */ + $known = array(); + $apps = array(); + + /* Grab all known settings */ + $this->DB->build( array( 'select' => '*', 'from' => 'conf_settings' ) ); + $this->DB->execute(); + + while( $row = $this->DB->fetch() ) + { + if ( $row['conf_value'] != '' ) + { + $known[ $row['conf_key'] ] = $row['conf_value']; + } + } + + /* Brandon's bug report thingy #12516*/ + if ( ! $known['gb_char_set'] ) + { + /* No charset, set - so we need to now ensure that iso-8859-1 is set */ + $known['gb_char_set'] = 'iso-8859-1'; + } + + /* Wipe out custom time/date settings */ + foreach( array( 'clock_short', 'clock_long', 'clock_tiny', 'clock_date', 'clock_joined', 'time_use_relative_format' ) as $setting ) + { + unset( $known[ $setting ] ); + } + + /* Now we need to fix moderator groups who have permission to RC */ + $groups = array(); + + $this->DB->build( array( 'select' => 'g_id', 'from' => 'groups', 'where' => 'g_access_cp=1 OR g_is_supmod=1' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $groups[] = $r['g_id']; + } + + $known['report_mod_group_access'] = implode( ',', $groups ); + + /* Load apps */ + $this->DB->build( array( 'select' => '*', 'from' => 'core_applications' ) ); + $this->DB->execute(); + + while( $row = $this->DB->fetch() ) + { + $apps[ $row['app_directory'] ] = $row; + } + + /* Add 'em */ + foreach( $apps as $dir => $data ) + { + if ( is_file( IPSLib::getAppDir( $dir ) . '/xml/' . $dir . '_settings.xml' ) ) + { + $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/settings/settings.php', 'admin_core_settings_settings' ); + $settings = new $classToLoad(); + $settings->makeRegistryShortcuts( $this->registry ); + + $this->request['app_dir'] = $dir; + $settings->importAllSettings( 1, 1, $known ); + + $this->registry->output->addMessage("Added settings for {$data['app_title']}...."); + } + } + + /* Next Page */ + $this->request['workact'] = 'profile'; + } + + /** + * Sort out profile fields + * + * @return @e void + */ + public function addProfile() + { + /* INIT */ + $fields = array(); + $prefix = $this->registry->dbFunctions()->getPrefix(); + $sourceFile = ''; + + /* Get DB driver file */ + require_once( IPSLib::getAppDir( 'core' ) . '/setup/versions/upg_30001/' . strtolower( $this->registry->dbFunctions()->getDriverType() ) . '_version_upgrade.php' );/*noLibHook*/ + + /* First off, move all current profile fields to group ID 3 */ + $this->DB->update( 'pfields_data', array( 'pf_group_id' => 3 ), 'pf_group_id=0' ); + + /* Grab all custom fields */ + $this->DB->build( array( 'select' => '*', + 'from' => 'pfields_data' ) ); + + $this->DB->execute(); + + while( $row = $this->DB->fetch() ) + { + $fields[ $row['pf_id'] ] = $row; + } + + foreach( $fields as $id => $data ) + { + /* Now add any missing content fields */ + if ( ! $this->DB->checkForField( "field_$id", 'pfields_content' ) ) + { + $this->DB->addField( 'pfields_content', "field_$id", 'text' ); + } + } + + $this->DB->optimize( 'pfields_content' ); + + /* Now make add a key */ + $this->DB->build( array( 'select' => '*', + 'from' => 'pfields_data', + 'where' => 'pf_group_id=3' ) ); + + $o = $this->DB->execute(); + + while( $row = $this->DB->fetch( $o ) ) + { + /* Attempt basic conversion of data */ + if ( $row['pf_topic_format'] ) + { + if ( $row['pf_topic_format'] == '{title}: {content}
    ' ) + { + $row['pf_topic_format'] = '{title}:{content}'; + } + else if ( $row['pf_topic_format'] == '{title}: {key}
    ' ) + { + $row['pf_topic_format'] = '{title}:{key}'; + } + } + + /* 2.3.x used 'text', 3.0.0 uses 'input'... */ + $row['pf_type'] = ( $row['pf_type'] == 'text' ) ? 'input' : $row['pf_type']; + + $this->DB->update( 'pfields_data', array( 'pf_type' => $row['pf_type'], 'pf_topic_format' => $row['pf_topic_format'], 'pf_key' => IPSText::makeSeoTitle( $row['pf_title'] ) ), 'pf_id=' . $row['pf_id'] ); + } + + /* Now, move profile data into the correct fields */ + foreach( array( 'aim_name' => 'aim', + 'icq_number' => 'icq', + 'website' => 'website', + 'yahoo' => 'yahoo', + 'interests' => 'interests', + 'msnname' => 'msn', + 'location' => 'location' ) as $old => $new ) + { + $field = $this->DB->buildAndFetch( array( 'select' => '*', + 'from' => 'pfields_data', + 'where' => 'pf_key=\'' . $new . '\'' ) ); + + + + + $query = SQLVC::UpdateOne( $old, $field ); + + if( is_null($query) ) + { + continue; + } + + if ( IPSSetUp::getSavedData('man') ) + { + $query = trim( $query ); + + /* Ensure the last character is a semi-colon */ + if ( substr( $query, -1 ) != ';' ) + { + $query .= ';'; + } + + $output .= $query . "\n\n"; + } + else + { + $this->DB->query( $query ); + + if ( $this->DB->error ) + { + $this->registry->output->addError( $query."

    ".$this->DB->error ); + } + else + { + $this->registry->output->addMessage("Converted field: {$old}...."); + } + } + } + + /* Update gender */ + $gender = $this->DB->buildAndFetch( array( 'select' => '*', + 'from' => 'pfields_data', + 'where' => 'pf_key=\'gender\'' ) ); + + if ( $gender['pf_id'] ) + { + $queries = array( SQLVC::UpdateTwo( $gender ), + SQLVC::UpdateThree( $gender ) ); + + foreach( $queries as $query ) + { + if ( IPSSetUp::getSavedData('man') ) + { + $query = trim( $query ); + + /* Ensure the last character is a semi-colon */ + if ( substr( $query, -1 ) != ';' ) + { + $query .= ';'; + } + + $output .= $query . "\n\n"; + } + else + { + $this->DB->query( $query ); + + if ( $this->DB->error ) + { + $this->registry->output->addError( $query."

    ".$this->DB->error ); + } + else + { + $this->registry->output->addMessage("Converted Gender Field...."); + } + } + } + } + + if ( IPSSetUp::getSavedData('man') AND $output ) + { + /* Create source file */ + if ( $this->registry->dbFunctions()->getDriverType() == 'mysql' ) + { + $sourceFile = IPSSetUp::createSqlSourceFile( $output, '30001', 'pf' ); + } + + $this->_output = $this->registry->output->template()->upgrade_manual_queries( $output, $sourceFile ); + } + + /* Next Page */ + $this->request['workact'] = 'permsAndBbcode'; + } + + /** + * Sort out bbcode and permissions + * + * @return @e void + */ + public function permsAndBbcode() + { + /* INIT */ + $options = IPSSetUp::getSavedData('custom_options'); + $rootAdmins = $options['core'][30001]['rootAdmins']; + + /* First off, import default BBCode */ + $apps = array(); + $bbcodeOld = array(); + $bbcodeNew = array(); + + /* Load apps */ + $this->DB->build( array( 'select' => '*', + 'from' => 'core_applications' ) ); + $this->DB->execute(); + + while( $row = $this->DB->fetch() ) + { + $apps[ $row['app_directory'] ] = $row; + } + + /* Load old codes */ + $this->DB->build( array( 'select' => '*', + 'from' => 'custom_bbcode_old' ) ); + $this->DB->execute(); + + while( $row = $this->DB->fetch() ) + { + $bbcodeOld[ $row['bbcode_tag'] ] = $row; + } + + /* Add 'em */ + foreach( $apps as $dir => $data ) + { + if ( is_file( IPSLib::getAppDir( $dir ) . '/xml/' . $dir . '_bbcode.xml' ) ) + { + //----------------------------------------- + // Continue + //----------------------------------------- + + $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/posts/bbcode.php', 'admin_core_posts_bbcode' ); + $bbcode = new $classToLoad(); + $bbcode->makeRegistryShortcuts( $this->registry ); + + $bbcode->bbcodeImportDo( file_get_contents( IPSLib::getAppDir( $dir ) . '/xml/' . $dir . '_bbcode.xml' ) ); + } + + if ( is_file( IPSLib::getAppDir( $dir ) . '/xml/' . $dir . '_mediatag.xml' ) ) + { + //----------------------------------------- + // Continue + //----------------------------------------- + + $classToLoad = IPSLib::loadActionOverloader( IPS_ROOT_PATH . 'applications/core/modules_admin/posts/media.php', 'admin_core_posts_media' ); + $bbcode = new $classToLoad(); + $bbcode->makeRegistryShortcuts( $this->registry ); + + $bbcode->doMediaImport( file_get_contents( IPSLib::getAppDir( $dir ) . '/xml/' . $dir . '_mediatag.xml' ) ); + } + } + + /* Load current code */ + $this->DB->build( array( 'select' => '*', + 'from' => 'custom_bbcode' ) ); + $this->DB->execute(); + + while( $row = $this->DB->fetch() ) + { + $bbcodeCurrent[ $row['bbcode_tag'] ] = $row; + + //----------------------------------------- + // Need to take into account aliases too! + //----------------------------------------- + + if( $row['bbcode_aliases'] ) + { + $aliases = explode( ',', $row['bbcode_aliases'] ); + + if( count($aliases) ) + { + foreach( $aliases as $alias ) + { + $bbcodeCurrent[ $alias ] = $row; + } + } + } + } + + if ( count( $bbcodeOld ) ) + { + foreach( $bbcodeOld as $tag => $row ) + { + if ( ! $bbcodeCurrent[ $row['bbcode_tag'] ] ) + { + $bbcodeNew[ $row['bbcode_tag'] ] = $row; + } + } + } + + $this->registry->output->addMessage("BBCode tags upgraded...."); + + /* Now see if there's anything we need to move back over */ + if ( count( $bbcodeNew ) ) + { + foreach( $bbcodeNew as $tag => $data ) + { + $bbarray = array( + 'bbcode_title' => $data['bbcode_title'], + 'bbcode_desc' => $data['bbcode_desc'], + 'bbcode_tag' => $data['bbcode_tag'], + 'bbcode_replace' => IPSText::safeslashes($data['bbcode_replace']), + 'bbcode_useoption' => $data['bbcode_useoption'], + 'bbcode_example' => $data['bbcode_example'], + 'bbcode_switch_option' => $data['bbcode_switch_option'], + 'bbcode_menu_option_text' => $data['bbcode_menu_option_text'], + 'bbcode_menu_content_text' => $data['bbcode_menu_content_text'], + 'bbcode_groups' => 'all', + 'bbcode_sections' => 'all', + 'bbcode_php_plugin' => '', + 'bbcode_parse' => 2, + 'bbcode_no_parsing' => 0, + 'bbcode_optional_option' => 0, + 'bbcode_aliases' => '', + 'bbcode_image' => '' + ); + + $this->DB->insert( 'custom_bbcode', $bbarray ); + } + } + + /* OK, now onto permissions... */ + /* Insert basic perms for profiles and help */ + $this->DB->insert( 'permission_index', array( 'app' => 'members', + 'perm_type' => 'profile_view', + 'perm_type_id' => 1, + 'perm_view' => '*', + 'perm_2' => '', + 'perm_3' => '', + 'perm_4' => '', + 'perm_5' => '', + 'perm_6' => '', + 'perm_7' => '' ) ); + + $this->DB->insert( 'permission_index', array( 'app' => 'core', + 'perm_type' => 'help', + 'perm_type_id' => 1, + 'perm_view' => '*', + 'perm_2' => '', + 'perm_3' => '', + 'perm_4' => '', + 'perm_5' => '', + 'perm_6' => '', + 'perm_7' => '' ) ); + + /* And now calendars */ + $this->DB->build( array( 'select' => '*', + 'from' => 'cal_calendars' ) ); + + $o = $this->DB->execute(); + + while( $row = $this->DB->fetch( $o ) ) + { + if ( strstr( $row['cal_permissions'], 'a:' ) ) + { + $_perms = unserialize( stripslashes( $row['cal_permissions'] ) ); + + if ( is_array( $_perms ) ) + { + $_view = ( $_perms['perm_read'] ) ? ',' . implode( ',', explode( ',', $_perms['perm_read'] ) ) . ',' : ''; + $_start = ( $_perms['perm_post'] ) ? ',' . implode( ',', explode( ',', $_perms['perm_post'] ) ) . ',' : ''; + $_nomod = ( $_perms['perm_nomod'] ) ? ',' . implode( ',', explode( ',', $_perms['perm_nomod'] ) ). ',' : ''; + + $this->DB->insert( 'permission_index', array( 'app' => 'calendar', + 'perm_type' => 'calendar', + 'perm_type_id' => $row['cal_id'], + 'perm_view' => str_replace( ',*,', '*', $_view ), + 'perm_2' => str_replace( ',*,', '*', $_start ), + 'perm_3' => str_replace( ',*,', '*', $_nomod ), + 'perm_4' => '', + 'perm_5' => '', + 'perm_6' => '', + 'perm_7' => '' ) ); + } + else + { + $this->DB->insert( 'permission_index', array( 'app' => 'calendar', + 'perm_type' => 'calendar', + 'perm_type_id' => $row['cal_id'], + 'perm_view' => '', + 'perm_2' => '', + 'perm_3' => '', + 'perm_4' => '', + 'perm_5' => '', + 'perm_6' => '', + 'perm_7' => '' ) ); + } + } + else + { + $this->DB->insert( 'permission_index', array( 'app' => 'calendar', + 'perm_type' => 'calendar', + 'perm_type_id' => $row['cal_id'], + 'perm_view' => '', + 'perm_2' => '', + 'perm_3' => '', + 'perm_4' => '', + 'perm_5' => '', + 'perm_6' => '', + 'perm_7' => '' ) ); + } + } + + /* And now forums */ + $this->DB->build( array( 'select' => '*', + 'from' => 'forums' ) ); + + $o = $this->DB->execute(); + + while( $row = $this->DB->fetch( $o ) ) + { + /* Do we need to tidy up the title? */ + if ( strstr( $row['name'], '&' ) ) + { + $row['name'] = preg_replace( "#& #", "& ", $row['name'] ); + + $this->DB->update( 'forums', array( 'name' => $row['name'] ), 'id=' . $row['id'] ); + } + + if ( strstr( $row['permission_array'], 'a:' ) ) + { + $_perms = unserialize( stripslashes( $row['permission_array'] ) ); + + if ( is_array( $_perms ) ) + { + $_view = ( $_perms['show_perms'] ) ? ',' . implode( ',', explode( ',', $_perms['show_perms'] ) ) . ',' : ''; + $_read = ( $_perms['read_perms'] ) ? ',' . implode( ',', explode( ',', $_perms['read_perms'] ) ) . ',' : ''; + $_reply = ( $_perms['reply_perms'] ) ? ',' . implode( ',', explode( ',', $_perms['reply_perms'] ) ) . ',' : ''; + $_start = ( $_perms['start_perms'] ) ? ',' . implode( ',', explode( ',', $_perms['start_perms'] ) ) . ',' : ''; + $_upload = ( $_perms['upload_perms'] ) ? ',' . implode( ',', explode( ',', $_perms['upload_perms'] ) ) . ',' : ''; + $_download = ( $_perms['download_perms'] ) ? ',' . implode( ',', explode( ',', $_perms['download_perms'] ) ) . ',' : ''; + + $this->DB->insert( 'permission_index', array( 'app' => 'forums', + 'perm_type' => 'forum', + 'perm_type_id' => $row['id'], + 'perm_view' => str_replace( ',*,', '*', $_view ), + 'perm_2' => str_replace( ',*,', '*', $_read ), + 'perm_3' => str_replace( ',*,', '*', $_reply ), + 'perm_4' => str_replace( ',*,', '*', $_start ), + 'perm_5' => str_replace( ',*,', '*', $_upload ), + 'perm_6' => str_replace( ',*,', '*', $_download ), + 'perm_7' => '' ) ); + } + else + { + $this->DB->insert( 'permission_index', array( 'app' => 'forums', + 'perm_type' => 'forum', + 'perm_type_id' => $row['id'], + 'perm_view' => '', + 'perm_2' => '', + 'perm_3' => '', + 'perm_4' => '', + 'perm_5' => '', + 'perm_6' => '', + 'perm_7' => '' ) ); + + IPSSetUp::addLogMessage( "Skipped perms (no array) for forum id: " . $row['id'], '30001', 'core' ); + } + } + else + { + $this->DB->insert( 'permission_index', array( 'app' => 'forums', + 'perm_type' => 'forum', + 'perm_type_id' => $row['id'], + 'perm_view' => '', + 'perm_2' => '', + 'perm_3' => '', + 'perm_4' => '', + 'perm_5' => '', + 'perm_6' => '', + 'perm_7' => '' ) ); + + IPSSetUp::addLogMessage( "Skipped perms (no array) for forum id: " . $row['id'], '30001', 'core' ); + } + } + + $this->registry->output->addMessage("Permission indexes built...."); + + /* Fix up forum moderators */ + $this->DB->build( array( 'select' => '*', + 'from' => 'moderators' ) ); + + $o = $this->DB->execute(); + + while( $r = $this->DB->fetch( $o ) ) + { + $this->DB->update( 'moderators', array( 'forum_id' => ',' . IPSText::cleanPermString( $r['forum_id'] ) . ',' ), 'mid=' . $r['mid'] ); + } + + $this->registry->output->addMessage("Forum moderators updated...."); + + /* Root admin reset? */ + if ( $rootAdmins ) + { + /* Find all admin groups */ + $this->DB->build( array( 'select' => '*', + 'from' => 'groups', + 'where' => 'g_id != ' . $this->settings['admin_group'] . ' AND g_access_cp=1' ) ); + + $o = $this->DB->execute(); + + while( $row = $this->DB->fetch( $o ) ) + { + /* Insert blank perm row */ + $this->DB->insert( 'admin_permission_rows', array( 'row_id' => $row['g_id'], + 'row_id_type' => 'group', + 'row_perm_cache' => serialize( array() ), + 'row_updated' => time() ) ); + } + + $this->registry->output->addMessage("Non Root Admin groups restricted...."); + } + + /* Report center reset */ + $canReport = array(); + $canView = array(); + + $this->DB->build( array( 'select' => 'g_id, g_view_board, g_access_cp, g_is_supmod', + 'from' => 'groups' ) ); + + $o = $this->DB->execute(); + + while( $r = $this->DB->fetch( $o ) ) + { + if( $r['g_access_cp'] OR $r['g_is_supmod'] ) + { + $canView[] = $r['g_id']; + } + + if( $r['g_view_board'] AND $r['g_id'] != $this->settings['guest_group'] ) + { + $canReport[] = $r['g_id']; + } + } + + $this->DB->update( 'rc_classes', array( 'group_can_report' => ',' . implode( ',', $canReport ) . ',', 'mod_group_perm' => ',' . implode( ',', $canView ) . ',' ) ); + + /* Next Page */ + $this->request['workact'] = 'skinlang'; + } + + /** + * Export skin and languages + * + * @return @e void + */ + public function exportSkinLang() + { + /* INIT */ + $start = intval( $this->request['st'] ); + $converted = 0; + $options = IPSSetUp::getSavedData('custom_options'); + $_doSkin = $options['core'][30001]['exportSkins']; + $_doLang = $options['core'][30001]['exportLangs']; + + /* Doing anything? */ + if ( ! $_doSkin AND ! $_doLang ) + { + $this->registry->output->addMessage( "Nothing to export" ); + + /* Next Page */ + $this->request['workact'] = 'pms'; + return; + } + + /* Ok... */ + if ( ! $start ) + { + /* Do langs.. */ + if ( $_doLang ) + { + if ( ! is_dir( IPS_CACHE_PATH . 'cache/previousLangFiles' ) ) + { + if ( @mkdir( IPS_CACHE_PATH . 'cache/previousLangFiles', IPS_FOLDER_PERMISSION ) ) + { + @chmod( IPS_CACHE_PATH . 'cache/previousLangFiles', IPS_FOLDER_PERMISSION ); + } + } + + try + { + foreach( new DirectoryIterator( IPS_CACHE_PATH . 'cache/lang_cache' ) as $file ) + { + if ( ! $file->isDot() AND $file->isDir() ) + { + $name = $file->getFilename(); + + if ( substr( $name, 0, 1 ) != '.' ) + { + $this->registry->output->addMessage( "Moved Language Directory: {$name}" ); + + @rename( IPS_CACHE_PATH . 'cache/lang_cache/' . $name, IPS_CACHE_PATH . 'cache/previousLangFiles/' . $name ); + } + } + } + } catch ( Exception $e ) {} + } + } + + /* Doing skins? */ + if ( $_doSkin ) + { + $this->DB->build( array( 'select' => '*', + 'from' => 'skin_sets', + 'where' => 'set_skin_set_id > ' . $start, + 'limit' => array( 0, 1 ), + 'order' => 'set_skin_set_id ASC' ) ); + + $this->DB->execute(); + + $set = $this->DB->fetch(); + + if ( ! $set ) + { + $this->request['st'] = 0; + + /* All done.. */ + $this->registry->output->addMessage( "No more skin sets to export" ); + + /* Next Page */ + $this->request['workact'] = 'pms'; + return; + } + else + { + if ( ! is_dir( IPS_CACHE_PATH . 'cache/previousSkinFiles' ) ) + { + if ( @mkdir( IPS_CACHE_PATH . 'cache/previousSkinFiles', IPS_FOLDER_PERMISSION ) ) + { + @chmod( IPS_CACHE_PATH . 'cache/previousSkinFiles', IPS_FOLDER_PERMISSION ); + } + } + + $safeName = IPSText::alphanumericalClean( $set['set_name'] ); + $dirPath = IPS_CACHE_PATH . 'cache/previousSkinFiles/' . $safeName; + + if ( @mkdir( $dirPath, IPS_FOLDER_PERMISSION ) ) + { + @chmod( $dirPath, IPS_FOLDER_PERMISSION ); + } + + if ( is_dir( $dirPath ) ) + { + /* Export CSS */ + if ( @mkdir( $dirPath . '/css', IPS_FOLDER_PERMISSION ) ) + { + @chmod( $dirPath . '/css', IPS_FOLDER_PERMISSION ); + } + + @file_put_contents( $dirPath . '/css/css.css', $set['set_cache_css'] ); + + /* Export Wrapper */ + if ( @mkdir( $dirPath . '/wrapper', IPS_FOLDER_PERMISSION ) ) + { + @chmod( $dirPath . '/wrapper', IPS_FOLDER_PERMISSION ); + } + + @file_put_contents( $dirPath . '/wrapper/wrapper.html', $set['set_wrapper'] ); + + /* Export Templates */ + if ( @mkdir( $dirPath . '/templates', IPS_FOLDER_PERMISSION ) ) + { + @chmod( $dirPath . '/templates', IPS_FOLDER_PERMISSION ); + } + + $this->DB->build( array( 'select' => '*', + 'from' => 'skin_templates_old', + 'where' => 'set_id=' . $set['set_skin_set_id'], + 'order' => 'func_name ASC' ) ); + + $this->DB->execute(); + + while( $row = $this->DB->fetch() ) + { + $_groupName = IPSText::alphanumericalClean( $row['group_name'] ); + $_bitName = IPSText::alphanumericalClean( $row['func_name'] ); + + /* Make section dir */ + if ( @mkdir( $dirPath . '/templates/' . $_groupName, IPS_FOLDER_PERMISSION ) ) + { + @chmod( $dirPath . '/templates/' . $_groupName, IPS_FOLDER_PERMISSION ); + } + + @file_put_contents( $dirPath . '/templates/' . $_groupName . '/' . $_bitName . '.html', $row['section_content'] ); + } + } + + /* Set ID */ + $this->request['st'] = $set['set_skin_set_id']; + + /* We did some, go check again.. */ + $this->registry->output->addMessage( $set['set_name'] . " Exported" ); + + /* Next Page */ + $this->request['workact'] = 'skinlang'; + return; + } + } + + /* We did some, go check again.. */ + $this->registry->output->addMessage( 'No skins or languages to export' ); + + /* Next Page */ + $this->request['workact'] = 'pms'; + return; + } + + /** + * Convert PMs + * + * @return @e void + */ + public function convertPms() + { + /* INIT */ + $pergo = 200; + $start = intval( $this->request['st'] ); + $converted = 0; + $seen = 0; + + $options = IPSSetUp::getSavedData('custom_options'); + $skipPms = $options['core'][30001]['skipPms']; + + /* Skipping? */ + if ( $skipPms ) + { + /* Update all members */ + $this->DB->update( 'members', array( 'msg_count_reset' => 1, 'msg_count_new' => 0 ) ); + + /* add a message */ + $this->registry->output->addMessage( "Skipping PM Conversion" ); + + $this->request['workact'] = 'contacts'; + $this->request['st'] = 0; + return; + } + + /* Select max topic ID thus far */ + $_tmp = $this->DB->buildAndFetch( array( 'select' => 'MAX(mt_id) as max', + 'from' => 'message_topics' ) ); + + $topicID = intval( $_tmp['max'] ); + + $this->DB->build( array( 'select' => '*', + 'from' => 'message_text', + 'order' => 'msg_id ASC', + 'limit' => array( $start, $pergo ) ) ); + + $o = $this->DB->execute(); + + while( $post = $this->DB->fetch( $o ) ) + { + $seen++; + + /* Make sure all data is valid */ + if ( intval( $post['msg_sent_to_count'] ) < 1 ) + { + continue; + } + + /* a little set up */ + $oldTopics = array(); + + /* Now fetch all topics */ + $this->DB->build( array( 'select' => '*', + 'from' => 'message_topics_old', + 'where' => 'mt_msg_id=' . intval( $post['msg_id'] ) ) ); + + $t = $this->DB->execute(); + + while( $topic = $this->DB->fetch( $t ) ) + { + /* Got any data? */ + if ( ! $topic['mt_from_id'] OR ! $topic['mt_to_id'] ) + { + continue; + } + + $oldTopics[ $topic['mt_id'] ] = $topic; # Luke added that space. That's his first contribution to the code vaults at IPS. + } + + /* Fail safe */ + if ( ! count( $oldTopics ) ) + { + continue; + } + + /* Increment number */ + $topicID++; + + /* Add in the post */ + $this->DB->insert( 'message_posts', array( 'msg_topic_id' => $topicID, + 'msg_date' => $post['msg_date'], + 'msg_post' => $post['msg_post'], + 'msg_post_key' => $post['msg_post_key'], + 'msg_author_id' => $post['msg_author_id'], + 'msg_ip_address' => $post['msg_ip_address'], + 'msg_is_first_post' => 1 ) ); + $postID = $this->DB->getInsertId(); + + /* Update attachments */ + $this->DB->update( 'attachments', array( 'attach_rel_id' => $postID ), "attach_rel_module='msg' AND attach_rel_id=".$post['msg_id'] ); + + /* Define some stuff. "To" member is added last in IPB 2 */ + $_tmp = $oldTopics; + ksort( $_tmp ); + $topicData = array_pop( $_tmp ); + $_invited = array(); + $_seenOwner = array(); + $_isDeleted = 0; + + /* Add the member rows */ + foreach( $oldTopics as $mt_id => $data ) + { + /* Prevent SQL error with unique index: Seen the owner ID already? */ + if ( $_seenOwner[ $data['mt_owner_id'] ] ) + { + continue; + } + + $_seenOwner[ $data['mt_owner_id'] ] = $data['mt_owner_id']; + + /* Build invited - does not include 'to' person */ + if ( $data['mt_owner_id'] AND ( $post['msg_author_id'] != $data['mt_owner_id'] ) AND ( $topicData['mt_to_id'] != $data['mt_owner_id'] ) ) + { + $_invited[ $data['mt_owner_id'] ] = $data['mt_owner_id'];/*noLibHook*/ + } + + $_isSent = ( $data['mt_vid_folder'] == 'sent' ) ? 1 : 0; + $_isDraft = ( $data['mt_vid_folder'] == 'unsent' ) ? 1 : 0; + + $this->DB->insert( 'message_topic_user_map', array( 'map_user_id' => $data['mt_owner_id'], + 'map_topic_id' => $topicID, + 'map_folder_id' => ( $_isDraft ) ? 'drafts' : 'myconvo', + 'map_read_time' => ( $data['mt_user_read'] ) ? $data['mt_user_read'] : ( $data['mt_read'] ? time() : 0 ), + 'map_user_active' => 1, + 'map_user_banned' => 0, + 'map_has_unread' => 0, //( $data['mt_read'] ) ? 0 : 1, + 'map_is_system' => 0, + 'map_last_topic_reply' => $post['msg_date'], + 'map_is_starter' => ( $data['mt_owner_id'] == $post['msg_author_id'] ) ? 1 : 0 ) ); + + } + + /* Now, did we see the author? If not, add them too but as inactive */ + if ( ! $_seenOwner[ $post['msg_author_id'] ] ) + { + $_isDeleted = 1; + + /*$this->DB->insert( 'message_topic_user_map', array( 'map_user_id' => $post['msg_author_id'], + 'map_topic_id' => $topicID, + 'map_folder_id' => 'myconvo', + 'map_read_time' => 0, + 'map_user_active' => 0, + 'map_user_banned' => 0, + 'map_has_unread' => 0, + 'map_is_system' => 0, + 'map_is_starter' => 1 ) );*/ + } + + $_isSent = ( $topicData['mt_vid_folder'] == 'sent' ) ? 1 : 0; + $_isDraft = ( $topicData['mt_vid_folder'] == 'unsent' ) ? 1 : 0; + + /* This is for MSSQL. I need a quick fix. This is it. Enjoy. */ + if ( method_exists( $this->DB, 'setTableIdentityInsert' ) ) + { + $this->DB->setTableIdentityInsert( 'message_topics', 'ON' ); + } + + /* Add the topic */ + $this->DB->insert( 'message_topics', array( 'mt_id' => $topicID, + 'mt_date' => $topicData['mt_date'], + 'mt_title' => $topicData['mt_title'], + 'mt_starter_id' => $post['msg_author_id'], + 'mt_start_time' => $post['msg_date'], + 'mt_last_post_time' => $post['msg_date'], + 'mt_invited_members' => serialize( array_keys( $_invited ) ), + 'mt_to_count' => count( array_keys( $_invited ) ) + 1, + 'mt_to_member_id' => $topicData['mt_to_id'], + 'mt_replies' => 0, + 'mt_last_msg_id' => $postID, + 'mt_first_msg_id' => $postID, + 'mt_is_draft' => $_isDraft, + 'mt_is_deleted' => $_isDeleted, + 'mt_is_system' => 0 ) ); + + /* This is for MSSQL. I need a quick fix. This is it. Enjoy. */ + if ( method_exists( $this->DB, 'setTableIdentityInsert' ) ) + { + $this->DB->setTableIdentityInsert( 'message_topics', 'OFF' ); + } + + $converted++; + } + + /* What to do? */ + if ( $seen ) + { + $this->request['st'] = $start + $pergo; + + /* We did some, go check again.. */ + $this->registry->output->addMessage( "Checked " . $this->request['st'] . " PMs so far. This cycle: $converted Private Messages converted into conversations.." ); + + /* Re-do Page */ + $this->request['workact'] = 'pms'; + } + else + { + /* Update all members */ + $this->DB->update( 'members', array( 'msg_count_reset' => 1 ) ); + + /* Nope, nothing to do - we're done! */ + /* Next Page */ + $this->request['workact'] = 'contacts'; + $this->request['st'] = 0; + } + } + + /** + * Convert Block lists + * + * @return @e void + */ + public function convertBlockLists() + { + /* INIT */ + $pergo = 200; + $start = intval( $this->request['st'] ); + $options = IPSSetUp::getSavedData('custom_options'); + $skipPms = $options['core'][30001]['skipPms']; + $converted = 0; + $seen = 0; + + /* Skipping? */ + if ( $skipPms ) + { + /* add a message */ + $this->registry->output->addMessage( "Skipping Block List Conversion" ); + + $this->request['workact'] = 'pmblock'; + $this->request['st'] = 0; + return; + } + + $this->DB->build( array( 'select' => '*', + 'from' => 'members', + 'where' => method_exists( $this->DB, 'setTableIdentityInsert' ) ? 'ignored_users NOT LIKE \'\'' : $this->DB->buildLength('ignored_users') . ' > 0', + 'order' => 'member_id ASC', + 'limit' => array( $start, $pergo ) ) ); + + $o = $this->DB->execute(); + + while( $member = $this->DB->fetch( $o ) ) + { + $seen++; + + /* Got anything? */ + if ( strstr( $member['ignored_users'], ',' ) ) + { + $ignored = explode( ',', $member['ignored_users'] ); + } + + if ( ! is_array( $ignored ) ) + { + continue; + } + + /* Add it to the table */ + foreach( $ignored as $iid ) + { + if ( ! $iid ) + { + continue; + } + + $this->DB->insert( 'ignored_users', array( 'ignore_owner_id' => $member['member_id'], + 'ignore_ignore_id' => $iid, + 'ignore_topics' => 1 ) ); + } + + $converted++; + } + + /* What to do? */ + if ( $seen ) + { + $this->request['st'] = $start + $pergo; + + /* We did some, go check again.. */ + $this->registry->output->addMessage( "$converted member's ignore list converted." ); + + /* Re-do Page */ + $this->request['workact'] = 'contacts'; + } + else + { + /* Nope, nothing to do - we're done! */ + /* Next Page */ + $this->request['workact'] = 'pmblock'; + $this->request['st'] = 0; + } + } + + /** + * Convert Block lists + * + * @return @e void + */ + public function convertPmBlockLists() + { + /* INIT */ + $pergo = 200; + $start = intval( $this->request['st'] ); + $converted = 0; + $seen = 0; + $options = IPSSetUp::getSavedData('custom_options'); + $skipPms = $options['core'][30001]['skipPms']; + + /* Skipping? */ + if ( $skipPms ) + { + /* add a message */ + $this->registry->output->addMessage( "Skipping PM Block List Conversion" ); + + $this->request['workact'] = 'finish'; + $this->request['st'] = 0; + return; + } + + $this->DB->build( array( 'select' => '*', + 'from' => 'contacts', + 'where' => 'allow_msg=0', + 'order' => 'id ASC', + 'limit' => array( $start, $pergo ) ) ); + + $o = $this->DB->execute(); + + while( $contact = $this->DB->fetch( $o ) ) + { + $seen++; + + /* Already got an entry for this contact? */ + $test = $this->DB->buildAndFetch( array( 'select' => '*', + 'from' => 'ignored_users', + 'where' => 'ignore_owner_id=' . intval( $contact['member_id'] ) ) ); + + /* Got anything? */ + if ( $test['ignore_owner_id'] ) + { + $this->DB->update( 'ignored_users', array( 'ignore_messages' => 1 ), 'ignore_id=' . $test['ignore_id'] ); + } + else + { + $this->DB->insert( 'ignored_users', array( 'ignore_owner_id' => $contact['member_id'], + 'ignore_ignore_id' => $contact['contact_id'], + 'ignore_messages' => 1 ) ); + } + + $converted++; + } + + /* What to do? */ + if ( $seen ) + { + $this->request['st'] = $start + $pergo; + + /* We did some, go check again.. */ + $this->registry->output->addMessage( "$converted member's PM block list converted." ); + + /* Re-do Page */ + $this->request['workact'] = 'pmblock'; + } + else + { + /* Nope, nothing to do - we're done! */ + /* Next Page */ + $this->request['workact'] = 'finish'; + $this->request['st'] = 0; + } + } + + /** + * Finish up conversion stuff + * + * @return @e void + */ + public function finish() + { + $options = IPSSetUp::getSavedData('custom_options'); + $skipPms = $options['core'][30001]['skipPms']; + $output = array(); + + /* Emoticons */ + if ( file_exists( DOC_IPS_ROOT_PATH . 'style_emoticons/default' ) ) + { + try + { + foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . 'style_emoticons/default' ) as $file ) + { + if ( ! $file->isDot() ) + { + $_name = $file->getFileName(); + + /* Annoyingly, isDot doesn't match .svn, etc */ + if ( substr( $_name, 0, 1 ) == '.' ) + { + continue; + } + + if ( @copy( DOC_IPS_ROOT_PATH . 'style_emoticons/default/' . $_name, IPS_PUBLIC_PATH . 'style_emoticons/default/' . $_name ) ) + { + $output[] = "Emoticon: Copying $_name..."; + } + else + { + $output[] = "Could not copy $_name - move it manually post-installation"; + } + } + } + } catch ( Exception $e ) {} + } + + /* LOG IN METHODS */ + $this->DB->build( array( 'select' => '*', + 'from' => 'login_methods' ) ); + + $this->DB->execute(); + + while( $row = $this->DB->fetch() ) + { + $loginMethods[ $row['login_folder_name'] ] = $row; + } + + $count = 6; + $recount = array( 'internal' => 1, + 'ipconverge' => 2, + 'ldap' => 3, + 'external' => 4 ); + + /* Fetch XML */ + require_once( IPS_KERNEL_PATH . 'classXML.php' );/*noLibHook*/ + $xml = new classXML( IPSSetUp::charSet ); + + $xml->load( IPS_ROOT_PATH . 'setup/xml/loginauth.xml' ); + + foreach( $xml->fetchElements( 'login_methods' ) as $xmlelement ) + { + $data = $xml->fetchElementsFromRecord( $xmlelement ); + + $data['login_order'] = ( isset( $recount[ $data['login_folder_name'] ] ) ) ? $recount[ $data['login_folder_name'] ] : ++$count; + + unset( $data['login_id'] ); + + if ( ! $loginMethods[ $data['login_folder_name'] ] ) + { + $this->DB->insert( 'login_methods', $data ); + } + else + { + $this->DB->update( 'login_methods', array( 'login_order' => $data['login_order'] ), 'login_folder_name=\'' . $data['login_folder_name'] . '\'' ); + } + } + + /* Reset member languages and skins */ + $this->DB->update( 'members', array( 'language' => IPSLib::getDefaultLanguage(), 'skin' => 0 ) ); + + /* Empty caches */ + $this->DB->delete( 'cache_store', "cs_key='forum_cache'"); + $this->DB->delete( 'cache_store', "cs_key='skin_id_cache'"); + + /* Empty other tables */ + $this->DB->delete( 'skin_cache' ); + $this->DB->delete( 'skin_templates_cache' ); + + /* Reset admin permissions */ + $this->DB->update( 'admin_permission_rows', array( 'row_perm_cache' => '' ) ); + + /* Drop Tables */ + $this->DB->dropTable( 'contacts' ); + $this->DB->dropTable( 'skin_macro' ); + $this->DB->dropTable( 'skin_template_links' ); + $this->DB->dropTable( 'skin_templates_old' ); + $this->DB->dropTable( 'skin_sets' ); + $this->DB->dropTable( 'languages' ); + $this->DB->dropTable( 'topics_read' ); + $this->DB->dropTable( 'topic_markers' ); + $this->DB->dropTable( 'acp_help' ); + $this->DB->dropTable( 'members_converge' ); + $this->DB->dropTable( 'member_extra' ); + $this->DB->dropTable( 'custom_bbcode_old' ); + $this->DB->dropTable( 'admin_sessions' ); + $this->DB->dropTable( 'components' ); + $this->DB->dropTable( 'admin_permission_keys' ); + $this->DB->dropTable( 'conf_settings' ); + $this->DB->dropTable( 'conf_settings_titles' ); + $this->DB->dropTable( 'reg_antispam' ); + + if ( ! $skipPms ) + { + $this->DB->dropTable( 'message_text' ); + $this->DB->dropTable( 'message_topics_old' ); + } + + $message = ( is_array( $output ) AND count($output) ) ? implode( "
    ", $output ) . '
    ' : ''; + + $this->registry->output->addMessage( $message . "SQL clean up finished...."); + + /* Last function, so unset workact */ + $this->request['workact'] = ''; + } } \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_30003/index.html b/upload/admin/applications/core/setup/versions/upg_30003/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/setup/versions/upg_30003/index.html +++ b/upload/admin/applications/core/setup/versions/upg_30003/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_30003/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_30003/mysql_updates.php index fb89bc52..25120f54 100644 --- a/upload/admin/applications/core/setup/versions/upg_30003/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_30003/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_30004/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_30004/mysql_updates.php index 61a25808..8d87ade4 100644 --- a/upload/admin/applications/core/setup/versions/upg_30004/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_30004/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_30005/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_30005/mysql_updates.php index fc5c35f5..bd37349f 100644 --- a/upload/admin/applications/core/setup/versions/upg_30005/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_30005/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_30006/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_30006/mysql_updates.php index 9240b9d5..a14ad789 100644 --- a/upload/admin/applications/core/setup/versions/upg_30006/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_30006/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_30007/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_30007/mysql_updates.php index 51723516..75b20820 100644 --- a/upload/admin/applications/core/setup/versions/upg_30007/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_30007/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_30008/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_30008/mysql_updates.php index 7f0b30c6..453c7576 100644 --- a/upload/admin/applications/core/setup/versions/upg_30008/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_30008/mysql_updates.php @@ -1,7 +1,7 @@ Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -class version_upgrade -{ - /** - * Custom HTML to show - * - * @var string - */ - protected $_output = ''; - - /** - * fetchs output - * - * @return string - */ - public function fetchOutput() - { - return $this->_output; - } - - /** - * Execute selected method - * - * @param object Registry object - * @return @e void - */ - public function doExecute( ipsRegistry $registry ) - { - /* Make object */ - $this->registry = $registry; - $this->DB = $this->registry->DB(); - $this->settings =& $this->registry->fetchSettings(); - $this->request =& $this->registry->fetchRequest(); - $this->cache = $this->registry->cache(); - $this->caches =& $this->registry->cache()->fetchCaches(); - - - /* Now make add a key */ - $this->DB->build( array( 'select' => '*', - 'from' => 'pfields_data' ) ); - - $o = $this->DB->execute(); - - while( $row = $this->DB->fetch( $o ) ) - { - /* Attempt conversion of dd / dt microformats */ - if ( stristr( $row['pf_topic_format'], '
    ' ) OR stristr( $row['pf_topic_format'], '
    ' ) ) - { - $row['pf_topic_format'] = str_replace( '
    ', "", $row['pf_topic_format'] ); - $row['pf_topic_format'] = str_replace( '
    ', "", $row['pf_topic_format'] ); - $row['pf_topic_format'] = str_replace( array( '', '
    ' ), "", $row['pf_topic_format'] ); - - $this->DB->update( 'pfields_data', array( 'pf_topic_format' => $row['pf_topic_format'] ), 'pf_id=' . $row['pf_id'] ); - } - } - - $this->registry->output->addMessage( "Обновление пользовательских полей профиля"); - - return true; - } -} - +Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +class version_upgrade +{ + /** + * Custom HTML to show + * + * @var string + */ + protected $_output = ''; + + /** + * fetchs output + * + * @return string + */ + public function fetchOutput() + { + return $this->_output; + } + + /** + * Execute selected method + * + * @param object Registry object + * @return @e void + */ + public function doExecute( ipsRegistry $registry ) + { + /* Make object */ + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + + + /* Now make add a key */ + $this->DB->build( array( 'select' => '*', + 'from' => 'pfields_data' ) ); + + $o = $this->DB->execute(); + + while( $row = $this->DB->fetch( $o ) ) + { + /* Attempt conversion of dd / dt microformats */ + if ( stristr( $row['pf_topic_format'], '
    ' ) OR stristr( $row['pf_topic_format'], '
    ' ) ) + { + $row['pf_topic_format'] = str_replace( '
    ', "", $row['pf_topic_format'] ); + $row['pf_topic_format'] = str_replace( '
    ', "", $row['pf_topic_format'] ); + $row['pf_topic_format'] = str_replace( array( '', '
    ' ), "", $row['pf_topic_format'] ); + + $this->DB->update( 'pfields_data', array( 'pf_topic_format' => $row['pf_topic_format'] ), 'pf_id=' . $row['pf_id'] ); + } + } + + $this->registry->output->addMessage( "Updated custom profile fields"); + + return true; + } +} + ?> \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_30009/index.html b/upload/admin/applications/core/setup/versions/upg_30009/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/setup/versions/upg_30009/index.html +++ b/upload/admin/applications/core/setup/versions/upg_30009/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_30009/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_30009/mysql_updates.php index 4737fa2f..e9e59264 100644 --- a/upload/admin/applications/core/setup/versions/upg_30009/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_30009/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_30010/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_30010/mysql_updates.php index 8f184a46..304e3d72 100644 --- a/upload/admin/applications/core/setup/versions/upg_30010/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_30010/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_30011/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_30011/mysql_updates.php index eb691ab0..616fd598 100644 --- a/upload/admin/applications/core/setup/versions/upg_30011/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_30011/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_30012/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_30012/mysql_updates.php index 502058bc..bfbec4b1 100644 --- a/upload/admin/applications/core/setup/versions/upg_30012/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_30012/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_31000/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_31000/mysql_updates.php index decab242..9a7c2c99 100644 --- a/upload/admin/applications/core/setup/versions/upg_31000/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_31000/mysql_updates.php @@ -1,7 +1,7 @@ build( array( 'select' => '*', @@ -398,7 +397,7 @@ if ( ! $skins['default'] ) 'set_permissions' => '*', 'set_is_default' => 0, 'set_author_name' => "Invision Power Services, Inc", - 'set_author_url' => 'http://www.invisionpower.com', + 'set_author_url' => '', 'set_image_dir' => 'master', 'set_emo_dir' => 'default', 'set_hide_from_list' => 1, @@ -418,7 +417,7 @@ if ( ! $skins['lofi'] ) 'set_permissions' => '*', 'set_is_default' => 0, 'set_author_name' => "Invision Power Services, Inc", - 'set_author_url' => 'http://www.invisionpower.com', + 'set_author_url' => '', 'set_image_dir' => 'master', 'set_emo_dir' => 'default', 'set_hide_from_list' => 1, diff --git a/upload/admin/applications/core/setup/versions/upg_31003/index.html b/upload/admin/applications/core/setup/versions/upg_31003/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/setup/versions/upg_31003/index.html +++ b/upload/admin/applications/core/setup/versions/upg_31003/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_31003/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_31003/mysql_updates.php index 4360a72f..e7ef8042 100644 --- a/upload/admin/applications/core/setup/versions/upg_31003/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_31003/mysql_updates.php @@ -1,7 +1,7 @@ checkForField( 'replacement_master_key', 'skin_replacements' ) ) $SQL[] = "UPDATE skin_replacements SET replacement_master_key='root' WHERE replacement_set_id=0;"; } -$SQL[] = "CREATE TABLE vkontakte_connect ( - v_key varchar(32) NOT NULL default '', - v_user varchar(255) NOT NULL default '', - v_data varchar(255) NOT NULL default '', - v_id bigint(20) NOT NULL -);"; - -$SQL[] = "ALTER TABLE members ADD vk_uid bigint(20) unsigned NOT NULL default '0';"; -$SQL[] = "ALTER TABLE members ADD INDEX vk_uid (vk_uid);"; diff --git a/upload/admin/applications/core/setup/versions/upg_31004/index.html b/upload/admin/applications/core/setup/versions/upg_31004/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/setup/versions/upg_31004/index.html +++ b/upload/admin/applications/core/setup/versions/upg_31004/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_31004/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_31004/mysql_updates.php index b97315d8..2d30cc6f 100644 --- a/upload/admin/applications/core/setup/versions/upg_31004/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_31004/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_31005/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_31005/mysql_updates.php index 216ef44c..e8c07637 100644 --- a/upload/admin/applications/core/setup/versions/upg_31005/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_31005/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_31006/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_31006/mysql_updates.php index c4b816e8..cf39af86 100644 --- a/upload/admin/applications/core/setup/versions/upg_31006/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_31006/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_31007/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_31007/mysql_updates.php index 8fe3c611..bcbfc4e8 100644 --- a/upload/admin/applications/core/setup/versions/upg_31007/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_31007/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates.php index a35f0ed2..f8ab74f8 100644 --- a/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_32000/mysql_updates.php @@ -1,7 +1,7 @@ - * Invision Power Services - * IP.Board v3.4.5 - * Upgrade Class - * - * Class to add options and notices for IP.Board upgrade - * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $ - * - * - * @author Matt Mecham - * @version $Rev: 10721 $ - * @since 3.0 - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/company/standards.php#license - * @link http://www.invisionpower.com - * @package IP.Board - */ - -class version_class_core_32000 -{ - /** - * Constructor - * - * @param object $registry Registry object - * @return @e void - */ - public function __construct( ipsRegistry $registry ) - { - /* Make object */ - $this->registry = $registry; - $this->DB = $this->registry->DB(); - $this->settings =& $this->registry->fetchSettings(); - $this->request =& $this->registry->fetchRequest(); - $this->cache = $this->registry->cache(); - $this->caches =& $this->registry->cache()->fetchCaches(); - } - - /** - * Add pre-upgrade options: Form - * - * @return string HTML block - */ - public function preInstallOptionsForm() - { - $_wrapper = "
      %s
    "; - $_html = ''; - $posts = $this->DB->buildAndFetch( array( 'select' => 'count(*) as total', 'from' => 'posts' ) ); - - /* Got more than 100K posts? */ - if( $posts['total'] > 100000 ) - { -$_html .= << - - Внести изменение в структуру таблицы сообщений вручную? Ваш форум содержит более 100,000 сообщений. Мы крайне рекомендуем чтобы вы включили эту опцию для предотвращения возможных проблем при обновлении мастером обновления. В процессе обновления мастер на необходимом шаге выведет запросы, которые вы должны будете выполнить напрямую в базе данных, после чего вам достаточно будет обновить страницу и процесс будет продолжен. - -EOF; - } - - if( $_html ) - { - return sprintf( $_wrapper, $_html ); - } - else - { - return ''; - } - } - - /** - * Add pre-upgrade options: Save - * - * Data will be saved in saved data array as: appOptions[ app ][ versionLong ] = ( key => value ); - * - * @return array Key / value pairs to save - */ - public function preInstallOptionsSave() - { - return array( 'manualPostsTableQuery' => intval( $_REQUEST['manualPostsTableQuery'] ) - ); - } - - /** - * Return any post-installation notices - * - * @return array Array of notices - */ - public function postInstallNotices() - { - return array(); - } - - - /** - * Return any pre-installation notices - * - * @return array Array of notices - */ - public function preInstallNotices() - { - $notices = array(); - - $notices[] = "При обновлении будут удалены все XML стили."; - - return $notices; - - } -} - + + * Invision Power Services + * IP.Board v3.4.6 + * Upgrade Class + * + * Class to add options and notices for IP.Board upgrade + * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $ + * + * + * @author Matt Mecham + * @version $Rev: 10721 $ + * @since 3.0 + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license http://www.invisionpower.com/company/standards.php#license + * @link http://www.invisionpower.com + * @package IP.Board + */ + +class version_class_core_32000 +{ + /** + * Constructor + * + * @param object $registry Registry object + * @return @e void + */ + public function __construct( ipsRegistry $registry ) + { + /* Make object */ + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + } + + /** + * Add pre-upgrade options: Form + * + * @return string HTML block + */ + public function preInstallOptionsForm() + { + $_wrapper = "
      %s
    "; + $_html = ''; + $posts = $this->DB->buildAndFetch( array( 'select' => 'count(*) as total', 'from' => 'posts' ) ); + + /* Got more than 100K posts? */ + if( $posts['total'] > 100000 ) + { +$_html .= << + + Manually apply changes to the posts table? Your site has more than 100,000 posts. We strongly recommend that you enable this option and manually run the provided + SQL query to alter your posts table in order to prevent timeouts in the web-based upgrader. If you uncheck this option, it is very possible the upgrader will timeout attempting to + update your posts table. + +EOF; + } + + if( $_html ) + { + return sprintf( $_wrapper, $_html ); + } + else + { + return ''; + } + } + + /** + * Add pre-upgrade options: Save + * + * Data will be saved in saved data array as: appOptions[ app ][ versionLong ] = ( key => value ); + * + * @return array Key / value pairs to save + */ + public function preInstallOptionsSave() + { + return array( 'manualPostsTableQuery' => intval( $_REQUEST['manualPostsTableQuery'] ) + ); + } + + /** + * Return any post-installation notices + * + * @return array Array of notices + */ + public function postInstallNotices() + { + return array(); + } + + + /** + * Return any pre-installation notices + * + * @return array Array of notices + */ + public function preInstallNotices() + { + $notices = array(); + + $notices[] = "All XML skins will be uninstalled during the upgrade."; + + return $notices; + + } +} + diff --git a/upload/admin/applications/core/setup/versions/upg_32000/version_upgrade.php b/upload/admin/applications/core/setup/versions/upg_32000/version_upgrade.php index e3c9202f..70f1e53e 100644 --- a/upload/admin/applications/core/setup/versions/upg_32000/version_upgrade.php +++ b/upload/admin/applications/core/setup/versions/upg_32000/version_upgrade.php @@ -1,945 +1,940 @@ -Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -class version_upgrade -{ - /** - * Custom HTML to show - * - * @var string - */ - protected $_output = ''; - - /** - * fetchs output - * - * @return string - */ - public function fetchOutput() - { - return $this->_output; - } - - /** - * Execute selected method - * - * @param object Registry object - * @return @e void - */ - public function doExecute( ipsRegistry $registry ) - { - /* Make object */ - $this->registry = $registry; - $this->DB = $this->registry->DB(); - $this->settings =& $this->registry->fetchSettings(); - $this->request =& $this->registry->fetchRequest(); - $this->cache = $this->registry->cache(); - $this->caches =& $this->registry->cache()->fetchCaches(); - - //-------------------------------- - // What are we doing? - //-------------------------------- - - switch( $this->request['workact'] ) - { - case 'sql': - case 'sql1': - default: - $this->upgradeSql(1); - break; - case 'sql2': - $this->upgradeSql(2); - break; - case 'sql3': - $this->upgradeSql(3); - break; - case 'sql4': - $this->upgradeSql(4); - break; - case 'sql5': - $this->upgradeSql(5); - break; - case 'sql6': - $this->upgradeSql(6); - break; - - case 'logs': - case 'logs1': - $this->upgradeLogs(1); - break; - case 'logs2': - $this->upgradeLogs(2); - break; - case 'logs3': - $this->upgradeLogs(3); - break; - case 'logs4': - $this->upgradeLogs(4); - break; - case 'logs5': - $this->upgradeLogs(5); - break; - case 'logs6': - $this->upgradeLogs(6); - break; - case 'logs7': - $this->upgradeLogs(7); - break; - case 'logs8': - $this->upgradeLogs(8); - break; - case 'logs9': - $this->upgradeLogs(9); - break; - case 'logs10': - $this->upgradeLogs(10); - break; - - case 'forums': - $this->fixArchiveForums(); - break; - - case 'loginmethods': - $this->fixLoginMethods(); - break; - - case 'oldhooks': - $this->removeOldHooks(); - break; - - case 'setdefaultskin': - $this->setDefaultSkin(); - break; - - case 'hooks': - $this->convertHooks(); - break; - - case 'photos': - $this->convertPhotos(); - break; - } - - /* Workact is set in the function, so if it has not been set, then we're done. The last function should unset it. */ - if ( $this->request['workact'] ) - { - return false; - } - else - { - return true; - } - } - - /** - * Run SQL files - * - * @param int - * @return @e void - */ - public function upgradeSql( $id=1 ) - { - $cnt = 0; - $file = '_updates_'.$id.'.php'; - $output = ""; - $path = IPSLib::getAppDir( 'core' ) . '/setup/versions/upg_32000/' . strtolower( $this->registry->dbFunctions()->getDriverType() ) . $file; - $prefix = $this->registry->dbFunctions()->getPrefix(); - $sourceFile = ''; - $options = IPSSetUp::getSavedData('custom_options'); - $postTable = $options['core'][32000]['manualPostsTableQuery']; - - if ( is_file( $path ) ) - { - $SQL = array(); - - require( $path );/*noLibHook*/ - - /* Set DB driver to return any errors */ - $this->DB->return_die = 1; - - foreach( $SQL as $query ) - { - $this->DB->allow_sub_select = 1; - $this->DB->error = ''; - - $query = str_replace( "<%time%>", time(), $query ); - - if ( $this->settings['mysql_tbl_type'] ) - { - if ( preg_match( "/^create table(.+?)/i", $query ) ) - { - $query = preg_replace( "/^(.+?)\);$/is", "\\1) ENGINE={$this->settings['mysql_tbl_type']};", $query ); - } - } - - /* Need to tack on a prefix? */ - if ( $prefix ) - { - $query = IPSSetUp::addPrefixToQuery( $query, $prefix ); - } - - if( IPSSetUp::getSavedData('man') OR ( $id == 6 AND $postTable ) ) - { - $query = trim( $query ); - - /* Ensure the last character is a semi-colon */ - if ( substr( $query, -1 ) != ';' ) - { - $query .= ';'; - } - - $output .= $query . "\n\n"; - } - else - { - $this->DB->query( $query ); - - if ( $this->DB->error ) - { - $this->registry->output->addError( "
    " . $query . "
    " . $this->DB->error ); - } - else - { - $cnt++; - } - } - } - - $this->registry->output->addMessage("{$cnt} запросов выполнено...."); - } - - /* Next Page */ - if ( $id < 6 ) - { - $nextid = $id + 1; - $this->request['workact'] = 'sql' . $nextid; - } - else - { - $this->request['workact'] = 'logs'; - } - - if ( $output ) - { - /* Create source file */ - if ( $this->registry->dbFunctions()->getDriverType() == 'mysql' ) - { - $sourceFile = IPSSetUp::createSqlSourceFile( $output, '32000', $id ); - } - - $this->_output = $this->registry->output->template()->upgrade_manual_queries( $output, $sourceFile ); - } - } - - /** - * Upgrade log file tables - * - * @param int - * @return @e void - */ - public function upgradeLogs( $id=1 ) - { - /* Verify posts alter table query has run */ - if( $id == 1 ) - { - if( !$this->DB->checkForField( 'post_bwoptions', 'posts' ) ) - { - $this->_output = ' '; - $this->registry->output->addError( "Вы должны выполнить запрос изменяющий таблицу posts. После того как вы выполните это, просто обновите данную страницу и обновление будет продолжено." ); - return; - } - } - - $cnt = 0; - $file = '_updates_logs_'.$id.'.php'; - $output = ""; - $path = IPSLib::getAppDir( 'core' ) . '/setup/versions/upg_32000/' . strtolower( $this->registry->dbFunctions()->getDriverType() ) . $file; - $prefix = $this->registry->dbFunctions()->getPrefix(); - - if ( is_file( $path ) ) - { - $SQL = array(); - $TABLE = ''; - - require( $path );/*noLibHook*/ - - /* Set DB driver to return any errors */ - $this->DB->return_die = 1; - - foreach( $SQL as $query ) - { - $this->DB->allow_sub_select = 1; - $this->DB->error = ''; - - /* Need to tack on a prefix? */ - if ( $prefix ) - { - $query = IPSSetUp::addPrefixToQuery( $query, $prefix ); - } - - /* Chose to prune and run? */ - if( $this->request['pruneAndRun'] ) - { - $this->DB->delete( $TABLE ); - - $man = false; - } - else - { - /* Show alter table / prune option? */ - $man = IPSSetUp::getSavedData('man'); - - if( $TABLE ) - { - $count = $this->DB->buildAndFetch( array( 'select' => 'count(*) as logs', 'from' => $TABLE ) ); - - if( $count['logs'] > 100000 ) - { - $man = true; - } - } - } - - /* Show option to run manually or prune ? */ - if( $man ) - { - $query = trim( $query ); - - /* Ensure the last character is a semi-colon */ - if ( substr( $query, -1 ) != ';' ) - { - $query .= ';'; - } - - $output .= $query . "\n\n"; - } - else - { - $this->DB->query( $query ); - - if ( $this->DB->error ) - { - $this->registry->output->addError( "
    " . $query . "
    " . $this->DB->error ); - } - else - { - $cnt++; - } - } - } - - $this->registry->output->addMessage("{$cnt} запросов выполнено...."); - } - - /* Next Page */ - if ( $id < 10 ) - { - $nextid = $id + 1; - $this->request['workact'] = 'logs' . $nextid; - } - else - { - $this->request['workact'] = 'forums'; - } - - if ( $output ) - { - $this->_output = $this->registry->output->template()->upgrade_manual_queries_logs( $output, $id, $TABLE ); - } - } - - /** - * Convert archive forums to read-only forums - * - * @return @e void - */ - public function fixArchiveForums() - { - /* Update array for archive forums */ - $_total = 0; - $_update = array( - 'perm_3' => '', - 'perm_4' => '', - 'perm_5' => '', - ); - - /* Get 'archive' forums */ - $this->DB->build( array( 'select' => '*', 'from' => 'forums', 'where' => 'status=0' ) ); - $outer = $this->DB->execute(); - - while( $r = $this->DB->fetch($outer) ) - { - $this->DB->update( 'permission_index', $_update, "app='forums' AND perm_type='forum' AND perm_type_id={$r['id']}" ); - - $_total++; - } - - /* Now drop the status field in forums table */ - $this->DB->dropField( 'forums', 'status' ); - - /* Message */ - $this->registry->output->addMessage("{$_total} форумов со статусом 'архивный' переведено в форумы только для чтения...."); - - /* Next Page */ - $this->request['workact'] = 'loginmethods'; - } - - /** - * Pull login method conf to DB - * - * @return @e void - */ - public function fixLoginMethods() - { - /* Init */ - $_total = 0; - - if( !defined('IPS_PATH_CUSTOM_LOGIN') ) - { - define( 'IPS_PATH_CUSTOM_LOGIN' , IPS_ROOT_PATH . 'sources/loginauth' ); - } - - /* Try to loop over all login methods to grab current configs */ - try - { - foreach( new DirectoryIterator( IPS_PATH_CUSTOM_LOGIN ) as $file ) - { - if ( $file->isDir() ) - { - if( is_file( $file->getPathname() . '/conf.php' ) ) - { - $LOGIN_CONF = array(); - - include( $file->getPathname() . '/conf.php' );/*noLibHook*/ - - if( is_array($LOGIN_CONF) AND count($LOGIN_CONF) ) - { - $this->DB->update( 'login_methods', array( 'login_custom_config' => @serialize($LOGIN_CONF) ), "login_folder_name='" . $this->DB->addSlashes( $file->getFilename() ) . "'" ); - - $_total++; - } - } - } - } - } - catch( Exception $e ) - { - } - - /* Message */ - $this->registry->output->addMessage("{$_total} login method configs imported...."); - - /* Next Page */ - $this->request['workact'] = 'oldhooks'; - } - - /** - * Remove old hooks - * - * @return @e void - */ - public function removeOldHooks() - { - /* Hooks to remove */ - $hooks = array( 'watched_content', 'todays_top_posters', 'unread_notifications' ); - $_hookIds = array(); - $_total = 0; - - /* Get hook records */ - $this->DB->build( array( 'select' => 'hook_id', 'from' => 'core_hooks', 'where' => "hook_key IN('" . implode( "','", $hooks ) . "')" ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $_hookIds[] = $r['hook_id']; - } - - /* Remove associated files */ - if( count($_hookIds) ) - { - $this->DB->build( array( 'select' => 'hook_file_stored', 'from' => 'core_hooks_files', 'where' => 'hook_hook_id IN(' . implode( ',', $_hookIds ) . ')' ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - @unlink( IPS_HOOKS_PATH . $r['hook_file_stored'] ); - } - - /* Remove hook records */ - $this->DB->delete( 'core_hooks_files', 'hook_hook_id IN(' . implode( ',', $_hookIds ) . ')' ); - $this->DB->delete( 'core_hooks', 'hook_id IN(' . implode( ',', $_hookIds ) . ')' ); - - $_total++; - } - - /* Message */ - $this->registry->output->addMessage("{$_total} устаревших хуков удалено...."); - - /* Next Page */ - $this->request['workact'] = 'setdefaultskin'; - } - - /** - * Restore IPB default skin as default - * - * @return @e void - */ - public function setDefaultSkin() - { - /* Get skin functions library */ - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ - require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ - - $skinFunctions = new skinCaching( $this->registry ); - - /* Update members to use default skin */ - $this->DB->update( 'members', array( 'skin' => 0 ) ); - - /* Update forums to use default skin */ - $this->DB->update( 'forums', array( 'skin_id' => 0 ) ); - - /* Reset any default skin(s) */ - $this->DB->update( 'skin_collections', array( 'set_is_default' => 0 ) ); - - /* Set IPB default skin as default */ - $this->DB->update( 'skin_collections', array( 'set_is_default' => 1 ), "set_key='default'" ); - - /* Verify we have a skin set as default */ - $_check = $this->DB->buildAndFetch( array( 'select' => 'count(*) as total', 'from' => 'skin_collections', 'where' => 'set_is_default=1' ) ); - - if( $_check['total'] < 1 ) - { - $this->DB->build( array( 'update' => 'skin_collections', 'set' => 'set_is_default=1', 'where' => "set_output_format='html'", 'limit' => array( 0, 1 ) ) ); - $this->DB->execute(); - } - - /* Check for any modifications in IPB default skin */ - $_master = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_collections', 'where' => "set_key='default'" ) ); - $_master['set_id'] = intval($_master['set_id']); - $_modifiedTemplates = $this->DB->buildAndFetch( array( 'select' => 'count(*) as total', 'from' => 'skin_templates', 'where' => "template_set_id={$_master['set_id']} AND template_removable=1 OR template_user_edited=1" ) ); - $_modifiedCSS = $this->DB->buildAndFetch( array( 'select' => 'count(*) as total', 'from' => 'skin_css', 'where' => "css_set_id={$_master['set_id']} AND css_master_key=''" ) ); - - if( $_modifiedTemplates['total'] OR $_modifiedCSS['total'] ) - { - /* Create a new skin with IPB default as parent */ - $curPos = $skinFunctions->fetchHighestSetPosition(); - - $_master['set_key'] = 'default_modified'; - $_master['set_parent_id'] = $_master['set_id']; - $_master['set_is_default'] = 0; - $_master['set_name'] = $_master['set_name'] . ' (Pre 3.2)'; - $_master['set_order'] = (int)$curPos++; - unset($_master['set_id']); - - $this->DB->insert( 'skin_collections', $_master ); - $set_id = $this->DB->getInsertId(); - - $this->DB->update( 'skin_templates', array( 'template_set_id' => $set_id ), "template_set_id={$_master['set_parent_id']} AND template_removable=1 OR template_user_edited=1" ); - $this->DB->update( 'skin_css', array( 'css_set_id' => $set_id ), "css_set_id={$_master['set_parent_id']} AND css_master_key=''" ); - - $skinFunctions->rebuildSkinSetsCache(); - $skinFunctions->rebuildTreeInformation( $set_id ); - //$skinFunctions->flushSkinData(); - - $skinFunctions->rebuildCSS( $set_id ); - $skinFunctions->rebuildPHPTemplates( $set_id ); - $skinFunctions->rebuildReplacementsCache( $set_id ); - } - - /* Message */ - $this->registry->output->addMessage("Восстановлен новый базовый стиль...."); - - /* Next Page */ - $this->request['workact'] = 'hooks'; - } - - /** - * Convert stored hook data - * - * @return @e void - */ - public function convertHooks() - { - $_total = 0; - - /* Grab all hooks */ - $this->DB->build( array( 'select' => '*', 'from' => 'core_hooks' ) ); - $outer = $this->DB->execute(); - - while( $hook = $this->DB->fetch($outer) ) - { - $_extraData = unserialize($hook['hook_extra_data']); - - /* Fix setting groups */ - if( is_array($_extraData['settingGroups']) AND count($_extraData['settingGroups']) ) - { - $_settingGroups = array(); - - foreach( $_extraData['settingGroups'] as $_group ) - { - if( intval($_group) == $_group ) - { - $_settingGroups[ $_group ] = intval($_group); - } - } - - if( count($_settingGroups) ) - { - $_extraData['settingGroups'] = array(); - - $this->DB->build( array( 'select' => 'conf_title_id, conf_title_keyword', 'from' => 'core_sys_settings_titles' ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - if( in_array( $r['conf_title_id'], $_settingGroups ) ) - { - $_extraData['settingGroups'][] = $r['conf_title_keyword']; - } - } - } - } - - /* Fix settings */ - if( is_array($_extraData['settings']) AND count($_extraData['settings']) ) - { - $_settings = array(); - - foreach( $_extraData['settings'] as $_id ) - { - if( intval($_id) == $_id ) - { - $_settings[ $_id ] = intval($_id); - } - } - - if( count($_settings) ) - { - $_extraData['settings'] = array(); - - $this->DB->build( array( 'select' => 'conf_id, conf_key', 'from' => 'core_sys_conf_settings' ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - if( in_array( $r['conf_id'], $_settings ) ) - { - $_extraData['settings'][] = $r['conf_key']; - } - } - } - } - - /* Fix tasks */ - if( is_array($_extraData['tasks']) AND count($_extraData['tasks']) ) - { - $_tasks = array(); - - foreach( $_extraData['tasks'] as $_id ) - { - if( intval($_id) == $_id ) - { - $_tasks[ $_id ] = intval($_id); - } - } - - if( count($_tasks) ) - { - $_extraData['tasks'] = array(); - - $this->DB->build( array( 'select' => 'task_id, task_key', 'from' => 'task_manager' ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - if( in_array( $r['task_id'], $_tasks ) ) - { - $_extraData['tasks'][] = $r['task_key']; - } - } - } - } - - /* Fix help files */ - if( is_array($_extraData['help']) AND count($_extraData['help']) ) - { - $_help = array(); - - foreach( $_extraData['help'] as $_id ) - { - if( intval($_id) == $_id ) - { - $_help[ $_id ] = intval($_id); - } - } - - if( count($_help) ) - { - $_extraData['help'] = array(); - - $this->DB->build( array( 'select' => 'id, title', 'from' => 'faq' ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - if( in_array( $r['id'], $_help ) ) - { - $_extraData['help'][] = $r['title']; - } - } - } - } - - /* Fix modules */ - if( is_array($_extraData['modules']) AND count($_extraData['modules']) ) - { - $_modules = array(); - - foreach( $_extraData['modules'] as $_id ) - { - if( intval($_id) == $_id ) - { - $_modules[ $_id ] = intval($_id); - } - } - - if( count($_modules) ) - { - $_extraData['modules'] = array(); - - $this->DB->build( array( 'select' => 'sys_module_id, sys_module_admin, sys_module_application, sys_module_key', 'from' => 'core_sys_module' ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - if( in_array( $r['sys_module_id'], $_modules ) ) - { - $_extraData['modules'][] = ( $r['sys_module_admin'] ? 'admin' : 'public' ) . '-' . $r['sys_module_application'] . '-' . $r['sys_module_key']; - } - } - } - } - - /* Fix templates */ - if( is_array($_extraData['templates']) AND count($_extraData['templates']) ) - { - $_newTemplates = array(); - - foreach( $_extraData['templates'] as $file => $templates ) - { - foreach( $templates as $template ) - { - $_newTemplates[ $file ][ $template ] = $template; - } - } - - $_extraData['templates'] = $_newTemplates; - } - - /* Fix CSS */ - if( is_array($_extraData['css']) AND count($_extraData['css']) ) - { - $_css = array(); - - foreach( $_extraData['css'] as $_id ) - { - if( intval($_id) == $_id ) - { - $_css[ $_id ] = intval($_id); - } - } - - if( count($_css) ) - { - $_extraData['css'] = array(); - - $this->DB->build( array( 'select' => 'css_group', 'from' => 'skin_css', 'where' => "css_id IN(" . implode( ',', $_css ) . ")" ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $_extraData['css'][ $r['css_group'] ] = $r['css_group']; - } - } - } - - $this->DB->update( 'core_hooks', array( 'hook_extra_data' => serialize( $_extraData ) ), 'hook_id=' . $hook['hook_id'] ); - - $_total++; - } - - /* Message */ - $this->registry->output->addMessage("{$_total} хуков обновлено...."); - - /* Next Page */ - $this->request['workact'] = 'photos'; - } - - /** - * Convert and rebuild photos - * - * @param int - * @return @e void - */ - public function convertPhotos() - { - /* Is this the first cycle? */ - if( !$this->request['from'] ) - { - $this->_output = <<Конвертация фотографий пользователей -
    - IP.Board 3.2 теперь использует только одно изображение для идентификации пользователя. Вы должны выбрать, что именно (аватар или фотография из профиля) будет сохранено и использовано новой версией. -
    - -
    - В процессе конвертации также будут изменены размеры существующих изображений и созданы новые превью. Вы можете отложить этот процесс, отметив чекбокс. Процесс перестроения изображений может быть запущен вами после обновления в админ-центре форума. -

    - Перестроить сейчас
    - Пропустить -EOF; - - return; - } - - /* Our options */ - $convertFrom = $this->request['from'] == 'avatars' ? 'avatars' : 'photos'; - $skipRebuild = intval($this->request['skip']); - - /* Init */ - $st = intval($this->request['st']); - $did = 0; - $each = 200; - - require_once( IPS_ROOT_PATH . 'sources/classes/member/photo.php' );/*noLibHook*/ - $photo = new classes_member_photo( $this->registry ); - - /* Loop over members */ - $this->DB->build( array( 'select' => '*', 'from' => 'profile_portal', 'order' => 'pp_member_id ASC', 'limit' => array( $st, $each ) ) ); - $outer = $this->DB->execute(); - - while( $r = $this->DB->fetch($outer) ) - { - $did++; - - $update = array(); - - if( $r['fb_photo'] ) - { - $update['pp_photo_type'] = 'facebook'; - } - else if( $r['tc_photo'] ) - { - $update['pp_photo_type'] = 'twitter'; - } - else if( $r['vc_photo'] ) - { - $update['pp_photo_type'] = 'vkontakte'; - } - - else - { - if( $convertFrom == 'avatars' ) - { - if( $r['avatar_type'] == 'upload' AND $r['avatar_location'] ) - { - $update['pp_photo_type'] = 'custom'; - $update['pp_main_photo'] = $r['avatar_location']; - $_dims = @getimagesize( $this->settings['upload_dir'] . '/' . $r['avatar_location'] ); - $update['pp_main_width'] = $_dims[0] ? $_dims[0] : 1; - $update['pp_main_height'] = $_dims[1] ? $_dims[1] : 1; - } - else if( $r['avatar_type'] == 'gravatar' ) - { - $update['pp_photo_type'] = 'gravatar'; - $update['pp_gravatar'] = $r['avatar_location']; - - $md5Gravatar = md5( $update['pp_gravatar'] ); - - $_url = "http://www.gravatar.com"; - - if( $this->registry->output->isHTTPS ) - { - $_url = "https://secure.gravatar.com"; - } - - $update['pp_main_photo'] = $_url . "/avatar/" .$md5Gravatar . "?s=100"; - $update['pp_main_width'] = 100; - $update['pp_main_height'] = 100; - $update['pp_thumb_photo'] = $_url . "/avatar/" .$md5Gravatar . "?s=100"; - $update['pp_thumb_width'] = 100; - $update['pp_thumb_height'] = 100; - } - } - else - { - if( $r['pp_main_photo'] ) - { - $update['pp_photo_type'] = 'custom'; - $update['pp_main_photo'] = $r['pp_main_photo']; - } - } - } - - if( !$skipRebuild AND $update['pp_photo_type'] == 'custom' ) - { - $info = $photo->buildSizedPhotos( str_replace( 'upload:', '', $update['pp_main_photo'] ), $r['pp_member_id'], true ); - - $update['pp_main_width'] = intval( $info['final_width'] ); - $update['pp_main_height'] = intval( $info['final_height'] ); - $update['pp_thumb_photo'] = $info['t_final_location'] ? $info['t_final_location'] : $info['final_location']; - $update['pp_thumb_width'] = intval( $info['t_final_width'] ); - $update['pp_thumb_height'] = intval( $info['t_final_height'] ); - } - - if( count($update) ) - { - $this->DB->update( 'profile_portal', $update, 'pp_member_id=' . $r['pp_member_id'] ); - } - } - - /* Show message and redirect */ - if( $did > 0 ) - { - $this->request['st'] = ( $st + $did ); - $this->request['workact'] = 'photos'; - - $message = $skipRebuild ? "{$this->request['st']} фотографий сконвертировано ..." : "{$this->request['st']} фотографий сконвертировано и перестроено..."; - $this->registry->output->addMessage( $message ); - - /* Yes, we are being sneaky here. Shhhhh */ - $this->request['st'] = $this->request['st'] . '&from=' . $this->request['from'] . '&skip=' . $skipRebuild; - } - else - { - $this->request['st'] = 0; - $this->request['workact'] = ''; - - $this->registry->output->addMessage( "Все фотографии сконвертированы..." ); - } - - /* Next Page */ - return; - } +Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +class version_upgrade +{ + /** + * Custom HTML to show + * + * @var string + */ + protected $_output = ''; + + /** + * fetchs output + * + * @return string + */ + public function fetchOutput() + { + return $this->_output; + } + + /** + * Execute selected method + * + * @param object Registry object + * @return @e void + */ + public function doExecute( ipsRegistry $registry ) + { + /* Make object */ + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + + //-------------------------------- + // What are we doing? + //-------------------------------- + + switch( $this->request['workact'] ) + { + case 'sql': + case 'sql1': + default: + $this->upgradeSql(1); + break; + case 'sql2': + $this->upgradeSql(2); + break; + case 'sql3': + $this->upgradeSql(3); + break; + case 'sql4': + $this->upgradeSql(4); + break; + case 'sql5': + $this->upgradeSql(5); + break; + case 'sql6': + $this->upgradeSql(6); + break; + + case 'logs': + case 'logs1': + $this->upgradeLogs(1); + break; + case 'logs2': + $this->upgradeLogs(2); + break; + case 'logs3': + $this->upgradeLogs(3); + break; + case 'logs4': + $this->upgradeLogs(4); + break; + case 'logs5': + $this->upgradeLogs(5); + break; + case 'logs6': + $this->upgradeLogs(6); + break; + case 'logs7': + $this->upgradeLogs(7); + break; + case 'logs8': + $this->upgradeLogs(8); + break; + case 'logs9': + $this->upgradeLogs(9); + break; + case 'logs10': + $this->upgradeLogs(10); + break; + + case 'forums': + $this->fixArchiveForums(); + break; + + case 'loginmethods': + $this->fixLoginMethods(); + break; + + case 'oldhooks': + $this->removeOldHooks(); + break; + + case 'setdefaultskin': + $this->setDefaultSkin(); + break; + + case 'hooks': + $this->convertHooks(); + break; + + case 'photos': + $this->convertPhotos(); + break; + } + + /* Workact is set in the function, so if it has not been set, then we're done. The last function should unset it. */ + if ( $this->request['workact'] ) + { + return false; + } + else + { + return true; + } + } + + /** + * Run SQL files + * + * @param int + * @return @e void + */ + public function upgradeSql( $id=1 ) + { + $cnt = 0; + $file = '_updates_'.$id.'.php'; + $output = ""; + $path = IPSLib::getAppDir( 'core' ) . '/setup/versions/upg_32000/' . strtolower( $this->registry->dbFunctions()->getDriverType() ) . $file; + $prefix = $this->registry->dbFunctions()->getPrefix(); + $sourceFile = ''; + $options = IPSSetUp::getSavedData('custom_options'); + $postTable = $options['core'][32000]['manualPostsTableQuery']; + + if ( is_file( $path ) ) + { + $SQL = array(); + + require( $path );/*noLibHook*/ + + /* Set DB driver to return any errors */ + $this->DB->return_die = 1; + + foreach( $SQL as $query ) + { + $this->DB->allow_sub_select = 1; + $this->DB->error = ''; + + $query = str_replace( "<%time%>", time(), $query ); + + if ( $this->settings['mysql_tbl_type'] ) + { + if ( preg_match( "/^create table(.+?)/i", $query ) ) + { + $query = preg_replace( "/^(.+?)\);$/is", "\\1) ENGINE={$this->settings['mysql_tbl_type']};", $query ); + } + } + + /* Need to tack on a prefix? */ + if ( $prefix ) + { + $query = IPSSetUp::addPrefixToQuery( $query, $prefix ); + } + + if( IPSSetUp::getSavedData('man') OR ( $id == 6 AND $postTable ) ) + { + $query = trim( $query ); + + /* Ensure the last character is a semi-colon */ + if ( substr( $query, -1 ) != ';' ) + { + $query .= ';'; + } + + $output .= $query . "\n\n"; + } + else + { + $this->DB->query( $query ); + + if ( $this->DB->error ) + { + $this->registry->output->addError( "
    " . $query . "
    " . $this->DB->error ); + } + else + { + $cnt++; + } + } + } + + $this->registry->output->addMessage("{$cnt} queries ran...."); + } + + /* Next Page */ + if ( $id < 6 ) + { + $nextid = $id + 1; + $this->request['workact'] = 'sql' . $nextid; + } + else + { + $this->request['workact'] = 'logs'; + } + + if ( $output ) + { + /* Create source file */ + if ( $this->registry->dbFunctions()->getDriverType() == 'mysql' ) + { + $sourceFile = IPSSetUp::createSqlSourceFile( $output, '32000', $id ); + } + + $this->_output = $this->registry->output->template()->upgrade_manual_queries( $output, $sourceFile ); + } + } + + /** + * Upgrade log file tables + * + * @param int + * @return @e void + */ + public function upgradeLogs( $id=1 ) + { + /* Verify posts alter table query has run */ + if( $id == 1 ) + { + if( !$this->DB->checkForField( 'post_bwoptions', 'posts' ) ) + { + $this->_output = ' '; + $this->registry->output->addError( "You must first run the query to alter the posts table before you can proceed. Once you have run this query, you can hit refresh to continue." ); + return; + } + } + + $cnt = 0; + $file = '_updates_logs_'.$id.'.php'; + $output = ""; + $path = IPSLib::getAppDir( 'core' ) . '/setup/versions/upg_32000/' . strtolower( $this->registry->dbFunctions()->getDriverType() ) . $file; + $prefix = $this->registry->dbFunctions()->getPrefix(); + + if ( is_file( $path ) ) + { + $SQL = array(); + $TABLE = ''; + + require( $path );/*noLibHook*/ + + /* Set DB driver to return any errors */ + $this->DB->return_die = 1; + + foreach( $SQL as $query ) + { + $this->DB->allow_sub_select = 1; + $this->DB->error = ''; + + /* Need to tack on a prefix? */ + if ( $prefix ) + { + $query = IPSSetUp::addPrefixToQuery( $query, $prefix ); + } + + /* Chose to prune and run? */ + if( $this->request['pruneAndRun'] ) + { + $this->DB->delete( $TABLE ); + + $man = false; + } + else + { + /* Show alter table / prune option? */ + $man = IPSSetUp::getSavedData('man'); + + if( $TABLE ) + { + $count = $this->DB->buildAndFetch( array( 'select' => 'count(*) as logs', 'from' => $TABLE ) ); + + if( $count['logs'] > 100000 ) + { + $man = true; + } + } + } + + /* Show option to run manually or prune ? */ + if( $man ) + { + $query = trim( $query ); + + /* Ensure the last character is a semi-colon */ + if ( substr( $query, -1 ) != ';' ) + { + $query .= ';'; + } + + $output .= $query . "\n\n"; + } + else + { + $this->DB->query( $query ); + + if ( $this->DB->error ) + { + $this->registry->output->addError( "
    " . $query . "
    " . $this->DB->error ); + } + else + { + $cnt++; + } + } + } + + $this->registry->output->addMessage("{$cnt} queries ran...."); + } + + /* Next Page */ + if ( $id < 10 ) + { + $nextid = $id + 1; + $this->request['workact'] = 'logs' . $nextid; + } + else + { + $this->request['workact'] = 'forums'; + } + + if ( $output ) + { + $this->_output = $this->registry->output->template()->upgrade_manual_queries_logs( $output, $id, $TABLE ); + } + } + + /** + * Convert archive forums to read-only forums + * + * @return @e void + */ + public function fixArchiveForums() + { + /* Update array for archive forums */ + $_total = 0; + $_update = array( + 'perm_3' => '', + 'perm_4' => '', + 'perm_5' => '', + ); + + /* Get 'archive' forums */ + $this->DB->build( array( 'select' => '*', 'from' => 'forums', 'where' => 'status=0' ) ); + $outer = $this->DB->execute(); + + while( $r = $this->DB->fetch($outer) ) + { + $this->DB->update( 'permission_index', $_update, "app='forums' AND perm_type='forum' AND perm_type_id={$r['id']}" ); + + $_total++; + } + + /* Now drop the status field in forums table */ + $this->DB->dropField( 'forums', 'status' ); + + /* Message */ + $this->registry->output->addMessage("{$_total} forums with 'archive' status converted to read-only forums...."); + + /* Next Page */ + $this->request['workact'] = 'loginmethods'; + } + + /** + * Pull login method conf to DB + * + * @return @e void + */ + public function fixLoginMethods() + { + /* Init */ + $_total = 0; + + if( !defined('IPS_PATH_CUSTOM_LOGIN') ) + { + define( 'IPS_PATH_CUSTOM_LOGIN' , IPS_ROOT_PATH . 'sources/loginauth' ); + } + + /* Try to loop over all login methods to grab current configs */ + try + { + foreach( new DirectoryIterator( IPS_PATH_CUSTOM_LOGIN ) as $file ) + { + if ( $file->isDir() ) + { + if( is_file( $file->getPathname() . '/conf.php' ) ) + { + $LOGIN_CONF = array(); + + include( $file->getPathname() . '/conf.php' );/*noLibHook*/ + + if( is_array($LOGIN_CONF) AND count($LOGIN_CONF) ) + { + $this->DB->update( 'login_methods', array( 'login_custom_config' => @serialize($LOGIN_CONF) ), "login_folder_name='" . $this->DB->addSlashes( $file->getFilename() ) . "'" ); + + $_total++; + } + } + } + } + } + catch( Exception $e ) + { + } + + /* Message */ + $this->registry->output->addMessage("{$_total} login method configs imported...."); + + /* Next Page */ + $this->request['workact'] = 'oldhooks'; + } + + /** + * Remove old hooks + * + * @return @e void + */ + public function removeOldHooks() + { + /* Hooks to remove */ + $hooks = array( 'watched_content', 'todays_top_posters', 'unread_notifications' ); + $_hookIds = array(); + $_total = 0; + + /* Get hook records */ + $this->DB->build( array( 'select' => 'hook_id', 'from' => 'core_hooks', 'where' => "hook_key IN('" . implode( "','", $hooks ) . "')" ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $_hookIds[] = $r['hook_id']; + } + + /* Remove associated files */ + if( count($_hookIds) ) + { + $this->DB->build( array( 'select' => 'hook_file_stored', 'from' => 'core_hooks_files', 'where' => 'hook_hook_id IN(' . implode( ',', $_hookIds ) . ')' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + @unlink( IPS_HOOKS_PATH . $r['hook_file_stored'] ); + } + + /* Remove hook records */ + $this->DB->delete( 'core_hooks_files', 'hook_hook_id IN(' . implode( ',', $_hookIds ) . ')' ); + $this->DB->delete( 'core_hooks', 'hook_id IN(' . implode( ',', $_hookIds ) . ')' ); + + $_total++; + } + + /* Message */ + $this->registry->output->addMessage("{$_total} outdated hook(s) uninstalled...."); + + /* Next Page */ + $this->request['workact'] = 'setdefaultskin'; + } + + /** + * Restore IPB default skin as default + * + * @return @e void + */ + public function setDefaultSkin() + { + /* Get skin functions library */ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/ + require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/ + + $skinFunctions = new skinCaching( $this->registry ); + + /* Update members to use default skin */ + $this->DB->update( 'members', array( 'skin' => 0 ) ); + + /* Update forums to use default skin */ + $this->DB->update( 'forums', array( 'skin_id' => 0 ) ); + + /* Reset any default skin(s) */ + $this->DB->update( 'skin_collections', array( 'set_is_default' => 0 ) ); + + /* Set IPB default skin as default */ + $this->DB->update( 'skin_collections', array( 'set_is_default' => 1 ), "set_key='default'" ); + + /* Verify we have a skin set as default */ + $_check = $this->DB->buildAndFetch( array( 'select' => 'count(*) as total', 'from' => 'skin_collections', 'where' => 'set_is_default=1' ) ); + + if( $_check['total'] < 1 ) + { + $this->DB->build( array( 'update' => 'skin_collections', 'set' => 'set_is_default=1', 'where' => "set_output_format='html'", 'limit' => array( 0, 1 ) ) ); + $this->DB->execute(); + } + + /* Check for any modifications in IPB default skin */ + $_master = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_collections', 'where' => "set_key='default'" ) ); + $_master['set_id'] = intval($_master['set_id']); + $_modifiedTemplates = $this->DB->buildAndFetch( array( 'select' => 'count(*) as total', 'from' => 'skin_templates', 'where' => "template_set_id={$_master['set_id']} AND template_removable=1 OR template_user_edited=1" ) ); + $_modifiedCSS = $this->DB->buildAndFetch( array( 'select' => 'count(*) as total', 'from' => 'skin_css', 'where' => "css_set_id={$_master['set_id']} AND css_master_key=''" ) ); + + if( $_modifiedTemplates['total'] OR $_modifiedCSS['total'] ) + { + /* Create a new skin with IPB default as parent */ + $curPos = $skinFunctions->fetchHighestSetPosition(); + + $_master['set_key'] = 'default_modified'; + $_master['set_parent_id'] = $_master['set_id']; + $_master['set_is_default'] = 0; + $_master['set_name'] = $_master['set_name'] . ' (Pre 3.2)'; + $_master['set_order'] = (int)$curPos++; + unset($_master['set_id']); + + $this->DB->insert( 'skin_collections', $_master ); + $set_id = $this->DB->getInsertId(); + + $this->DB->update( 'skin_templates', array( 'template_set_id' => $set_id ), "template_set_id={$_master['set_parent_id']} AND template_removable=1 OR template_user_edited=1" ); + $this->DB->update( 'skin_css', array( 'css_set_id' => $set_id ), "css_set_id={$_master['set_parent_id']} AND css_master_key=''" ); + + $skinFunctions->rebuildSkinSetsCache(); + $skinFunctions->rebuildTreeInformation( $set_id ); + //$skinFunctions->flushSkinData(); + + $skinFunctions->rebuildCSS( $set_id ); + $skinFunctions->rebuildPHPTemplates( $set_id ); + $skinFunctions->rebuildReplacementsCache( $set_id ); + } + + /* Message */ + $this->registry->output->addMessage("Default skin restored...."); + + /* Next Page */ + $this->request['workact'] = 'hooks'; + } + + /** + * Convert stored hook data + * + * @return @e void + */ + public function convertHooks() + { + $_total = 0; + + /* Grab all hooks */ + $this->DB->build( array( 'select' => '*', 'from' => 'core_hooks' ) ); + $outer = $this->DB->execute(); + + while( $hook = $this->DB->fetch($outer) ) + { + $_extraData = unserialize($hook['hook_extra_data']); + + /* Fix setting groups */ + if( is_array($_extraData['settingGroups']) AND count($_extraData['settingGroups']) ) + { + $_settingGroups = array(); + + foreach( $_extraData['settingGroups'] as $_group ) + { + if( intval($_group) == $_group ) + { + $_settingGroups[ $_group ] = intval($_group); + } + } + + if( count($_settingGroups) ) + { + $_extraData['settingGroups'] = array(); + + $this->DB->build( array( 'select' => 'conf_title_id, conf_title_keyword', 'from' => 'core_sys_settings_titles' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + if( in_array( $r['conf_title_id'], $_settingGroups ) ) + { + $_extraData['settingGroups'][] = $r['conf_title_keyword']; + } + } + } + } + + /* Fix settings */ + if( is_array($_extraData['settings']) AND count($_extraData['settings']) ) + { + $_settings = array(); + + foreach( $_extraData['settings'] as $_id ) + { + if( intval($_id) == $_id ) + { + $_settings[ $_id ] = intval($_id); + } + } + + if( count($_settings) ) + { + $_extraData['settings'] = array(); + + $this->DB->build( array( 'select' => 'conf_id, conf_key', 'from' => 'core_sys_conf_settings' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + if( in_array( $r['conf_id'], $_settings ) ) + { + $_extraData['settings'][] = $r['conf_key']; + } + } + } + } + + /* Fix tasks */ + if( is_array($_extraData['tasks']) AND count($_extraData['tasks']) ) + { + $_tasks = array(); + + foreach( $_extraData['tasks'] as $_id ) + { + if( intval($_id) == $_id ) + { + $_tasks[ $_id ] = intval($_id); + } + } + + if( count($_tasks) ) + { + $_extraData['tasks'] = array(); + + $this->DB->build( array( 'select' => 'task_id, task_key', 'from' => 'task_manager' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + if( in_array( $r['task_id'], $_tasks ) ) + { + $_extraData['tasks'][] = $r['task_key']; + } + } + } + } + + /* Fix help files */ + if( is_array($_extraData['help']) AND count($_extraData['help']) ) + { + $_help = array(); + + foreach( $_extraData['help'] as $_id ) + { + if( intval($_id) == $_id ) + { + $_help[ $_id ] = intval($_id); + } + } + + if( count($_help) ) + { + $_extraData['help'] = array(); + + $this->DB->build( array( 'select' => 'id, title', 'from' => 'faq' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + if( in_array( $r['id'], $_help ) ) + { + $_extraData['help'][] = $r['title']; + } + } + } + } + + /* Fix modules */ + if( is_array($_extraData['modules']) AND count($_extraData['modules']) ) + { + $_modules = array(); + + foreach( $_extraData['modules'] as $_id ) + { + if( intval($_id) == $_id ) + { + $_modules[ $_id ] = intval($_id); + } + } + + if( count($_modules) ) + { + $_extraData['modules'] = array(); + + $this->DB->build( array( 'select' => 'sys_module_id, sys_module_admin, sys_module_application, sys_module_key', 'from' => 'core_sys_module' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + if( in_array( $r['sys_module_id'], $_modules ) ) + { + $_extraData['modules'][] = ( $r['sys_module_admin'] ? 'admin' : 'public' ) . '-' . $r['sys_module_application'] . '-' . $r['sys_module_key']; + } + } + } + } + + /* Fix templates */ + if( is_array($_extraData['templates']) AND count($_extraData['templates']) ) + { + $_newTemplates = array(); + + foreach( $_extraData['templates'] as $file => $templates ) + { + foreach( $templates as $template ) + { + $_newTemplates[ $file ][ $template ] = $template; + } + } + + $_extraData['templates'] = $_newTemplates; + } + + /* Fix CSS */ + if( is_array($_extraData['css']) AND count($_extraData['css']) ) + { + $_css = array(); + + foreach( $_extraData['css'] as $_id ) + { + if( intval($_id) == $_id ) + { + $_css[ $_id ] = intval($_id); + } + } + + if( count($_css) ) + { + $_extraData['css'] = array(); + + $this->DB->build( array( 'select' => 'css_group', 'from' => 'skin_css', 'where' => "css_id IN(" . implode( ',', $_css ) . ")" ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $_extraData['css'][ $r['css_group'] ] = $r['css_group']; + } + } + } + + $this->DB->update( 'core_hooks', array( 'hook_extra_data' => serialize( $_extraData ) ), 'hook_id=' . $hook['hook_id'] ); + + $_total++; + } + + /* Message */ + $this->registry->output->addMessage("{$_total} hooks updated...."); + + /* Next Page */ + $this->request['workact'] = 'photos'; + } + + /** + * Convert and rebuild photos + * + * @param int + * @return @e void + */ + public function convertPhotos() + { + /* Is this the first cycle? */ + if( !$this->request['from'] ) + { + $this->_output = <<Profile Photo Conversion +
    + IP.Board 3.2 supports one image to identify each user. You can choose to retain your existing avatars or your existing profile photos for this image. +
    + +
    + The image you save will need to be rebuilt. You can let the upgrader handle this now, or you can skip this step and complete it later from the ACP. +

    + Rebuild thumbnails now
    + Skip this step and rebuild thumbnails from the ACP later +EOF; + + return; + } + + /* Our options */ + $convertFrom = $this->request['from'] == 'avatars' ? 'avatars' : 'photos'; + $skipRebuild = intval($this->request['skip']); + + /* Init */ + $st = intval($this->request['st']); + $did = 0; + $each = 200; + + require_once( IPS_ROOT_PATH . 'sources/classes/member/photo.php' );/*noLibHook*/ + $photo = new classes_member_photo( $this->registry ); + + /* Loop over members */ + $this->DB->build( array( 'select' => '*', 'from' => 'profile_portal', 'order' => 'pp_member_id ASC', 'limit' => array( $st, $each ) ) ); + $outer = $this->DB->execute(); + + while( $r = $this->DB->fetch($outer) ) + { + $did++; + + $update = array(); + + if( $r['fb_photo'] ) + { + $update['pp_photo_type'] = 'facebook'; + } + else if( $r['tc_photo'] ) + { + $update['pp_photo_type'] = 'twitter'; + } + else + { + if( $convertFrom == 'avatars' ) + { + if( $r['avatar_type'] == 'upload' AND $r['avatar_location'] ) + { + $update['pp_photo_type'] = 'custom'; + $update['pp_main_photo'] = $r['avatar_location']; + $_dims = @getimagesize( $this->settings['upload_dir'] . '/' . $r['avatar_location'] ); + $update['pp_main_width'] = $_dims[0] ? $_dims[0] : 1; + $update['pp_main_height'] = $_dims[1] ? $_dims[1] : 1; + } + else if( $r['avatar_type'] == 'gravatar' ) + { + $update['pp_photo_type'] = 'gravatar'; + $update['pp_gravatar'] = $r['avatar_location']; + + $md5Gravatar = md5( $update['pp_gravatar'] ); + + $_url = "http://www.gravatar.com"; + + if( $this->registry->output->isHTTPS ) + { + $_url = "https://secure.gravatar.com"; + } + + $update['pp_main_photo'] = $_url . "/avatar/" .$md5Gravatar . "?s=100"; + $update['pp_main_width'] = 100; + $update['pp_main_height'] = 100; + $update['pp_thumb_photo'] = $_url . "/avatar/" .$md5Gravatar . "?s=100"; + $update['pp_thumb_width'] = 100; + $update['pp_thumb_height'] = 100; + } + } + else + { + if( $r['pp_main_photo'] ) + { + $update['pp_photo_type'] = 'custom'; + $update['pp_main_photo'] = $r['pp_main_photo']; + } + } + } + + if( !$skipRebuild AND $update['pp_photo_type'] == 'custom' ) + { + $info = $photo->buildSizedPhotos( str_replace( 'upload:', '', $update['pp_main_photo'] ), $r['pp_member_id'], true ); + + $update['pp_main_width'] = intval( $info['final_width'] ); + $update['pp_main_height'] = intval( $info['final_height'] ); + $update['pp_thumb_photo'] = $info['t_final_location'] ? $info['t_final_location'] : $info['final_location']; + $update['pp_thumb_width'] = intval( $info['t_final_width'] ); + $update['pp_thumb_height'] = intval( $info['t_final_height'] ); + } + + if( count($update) ) + { + $this->DB->update( 'profile_portal', $update, 'pp_member_id=' . $r['pp_member_id'] ); + } + } + + /* Show message and redirect */ + if( $did > 0 ) + { + $this->request['st'] = ( $st + $did ); + $this->request['workact'] = 'photos'; + + $message = $skipRebuild ? "Up to {$this->request['st']} profile photos converted ..." : "Up to {$this->request['st']} profile photos converted and rebuilt..."; + $this->registry->output->addMessage( $message ); + + /* Yes, we are being sneaky here. Shhhhh */ + $this->request['st'] = $this->request['st'] . '&from=' . $this->request['from'] . '&skip=' . $skipRebuild; + } + else + { + $this->request['st'] = 0; + $this->request['workact'] = ''; + + $this->registry->output->addMessage( "All profile photos converted..." ); + } + + /* Next Page */ + return; + } } \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_32001/index.html b/upload/admin/applications/core/setup/versions/upg_32001/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/setup/versions/upg_32001/index.html +++ b/upload/admin/applications/core/setup/versions/upg_32001/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_32001/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_32001/mysql_updates.php index f5b2f928..95f2b984 100644 --- a/upload/admin/applications/core/setup/versions/upg_32001/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_32001/mysql_updates.php @@ -1,7 +1,7 @@ Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -class version_upgrade -{ - /** - * Custom HTML to show - * - * @var string - */ - protected $_output = ''; - - /** - * fetchs output - * - * @return string - */ - public function fetchOutput() - { - return $this->_output; - } - - /** - * Execute selected method - * - * @param object Registry object - * @return @e void - */ - public function doExecute( ipsRegistry $registry ) - { - /* Make object */ - $this->registry = $registry; - $this->DB = $this->registry->DB(); - $this->settings =& $this->registry->fetchSettings(); - $this->request =& $this->registry->fetchRequest(); - $this->cache = $this->registry->cache(); - $this->caches =& $this->registry->cache()->fetchCaches(); - - //-------------------------------- - // What are we doing? - //-------------------------------- - - switch( $this->request['workact'] ) - { - default: - case 'oldhooks': - $this->removeOldHooks(); - break; - } - - return true; - } - - /** - * Remove old hooks - * - * @return @e void - */ - public function removeOldHooks() - { - /* Hooks to remove */ - $hooks = array( 'sharelinks', 'fb_like' ); - $_hookIds = array(); - $_total = 0; - - /* Get hook records */ - $this->DB->build( array( 'select' => 'hook_id', 'from' => 'core_hooks', 'where' => "hook_key IN('" . implode( "','", $hooks ) . "')" ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $_hookIds[] = $r['hook_id']; - } - - /* Remove associated files */ - if( count($_hookIds) ) - { - $this->DB->build( array( 'select' => 'hook_file_stored', 'from' => 'core_hooks_files', 'where' => 'hook_hook_id IN(' . implode( ',', $_hookIds ) . ')' ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - @unlink( IPS_HOOKS_PATH . $r['hook_file_stored'] ); - } - - /* Remove hook records */ - $this->DB->delete( 'core_hooks_files', 'hook_hook_id IN(' . implode( ',', $_hookIds ) . ')' ); - $this->DB->delete( 'core_hooks', 'hook_id IN(' . implode( ',', $_hookIds ) . ')' ); - - $_total++; - } - - /* Message */ - $this->registry->output->addMessage("{$_total} устаревших хуков удалено...."); - - /* Next Page */ - $this->request['workact'] = ''; - } +Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +class version_upgrade +{ + /** + * Custom HTML to show + * + * @var string + */ + protected $_output = ''; + + /** + * fetchs output + * + * @return string + */ + public function fetchOutput() + { + return $this->_output; + } + + /** + * Execute selected method + * + * @param object Registry object + * @return @e void + */ + public function doExecute( ipsRegistry $registry ) + { + /* Make object */ + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + + //-------------------------------- + // What are we doing? + //-------------------------------- + + switch( $this->request['workact'] ) + { + default: + case 'oldhooks': + $this->removeOldHooks(); + break; + } + + return true; + } + + /** + * Remove old hooks + * + * @return @e void + */ + public function removeOldHooks() + { + /* Hooks to remove */ + $hooks = array( 'sharelinks', 'fb_like' ); + $_hookIds = array(); + $_total = 0; + + /* Get hook records */ + $this->DB->build( array( 'select' => 'hook_id', 'from' => 'core_hooks', 'where' => "hook_key IN('" . implode( "','", $hooks ) . "')" ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $_hookIds[] = $r['hook_id']; + } + + /* Remove associated files */ + if( count($_hookIds) ) + { + $this->DB->build( array( 'select' => 'hook_file_stored', 'from' => 'core_hooks_files', 'where' => 'hook_hook_id IN(' . implode( ',', $_hookIds ) . ')' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + @unlink( IPS_HOOKS_PATH . $r['hook_file_stored'] ); + } + + /* Remove hook records */ + $this->DB->delete( 'core_hooks_files', 'hook_hook_id IN(' . implode( ',', $_hookIds ) . ')' ); + $this->DB->delete( 'core_hooks', 'hook_id IN(' . implode( ',', $_hookIds ) . ')' ); + + $_total++; + } + + /* Message */ + $this->registry->output->addMessage("{$_total} outdated hook(s) uninstalled...."); + + /* Next Page */ + $this->request['workact'] = ''; + } } \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_32002/index.html b/upload/admin/applications/core/setup/versions/upg_32002/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/setup/versions/upg_32002/index.html +++ b/upload/admin/applications/core/setup/versions/upg_32002/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_32002/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_32002/mysql_updates.php index e5d975aa..bf965e5a 100644 --- a/upload/admin/applications/core/setup/versions/upg_32002/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_32002/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_32003/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_32003/mysql_updates.php index 9af7449f..541d8a34 100644 --- a/upload/admin/applications/core/setup/versions/upg_32003/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_32003/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_32004/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_32004/mysql_updates.php index d7727258..55411303 100644 --- a/upload/admin/applications/core/setup/versions/upg_32004/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_32004/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_32005/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_32005/mysql_updates.php index d0e517db..5b8d3cde 100644 --- a/upload/admin/applications/core/setup/versions/upg_32005/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_32005/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_32006/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_32006/mysql_updates.php index c9a14dde..722ce91d 100644 --- a/upload/admin/applications/core/setup/versions/upg_32006/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_32006/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_32007/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_32007/mysql_updates.php index 3e8291c4..bad4e37f 100644 --- a/upload/admin/applications/core/setup/versions/upg_32007/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_32007/mysql_updates.php @@ -1,7 +1,7 @@ You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_33000/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_33000/mysql_updates.php index f12f88e6..dd695e67 100644 --- a/upload/admin/applications/core/setup/versions/upg_33000/mysql_updates.php +++ b/upload/admin/applications/core/setup/versions/upg_33000/mysql_updates.php @@ -61,11 +61,11 @@ $SQL[] = "CREATE TABLE members_warn_reasons ( $SQL[] = "INSERT INTO members_warn_reasons (wr_id, wr_name, wr_points, wr_points_override, wr_remove, wr_remove_unit, wr_remove_override, wr_order) VALUES - (1, 'Спам', 1, 0, 0, 'h', 0, 1), - (2, 'Нецензурные выражения', 1, 0, 0, 'h', 0, 2), - (3, 'Злоупотребление подписью', 1, 0, 0, 'h', 0, 3), - (4, 'Асоциальное поведение', 1, 0, 0, 'h', 0, 4), - (5, 'Черезмерный подъем тем', 1, 0, 0, 'h', 0, 5);"; + (1, 'Spamming', 1, 0, 0, 'h', 0, 1), + (2, 'Inappropriate Language', 1, 0, 0, 'h', 0, 2), + (3, 'Signature Violation', 1, 0, 0, 'h', 0, 3), + (4, 'Abusive Behaviour', 1, 0, 0, 'h', 0, 4), + (5, 'Topic Bumping', 1, 0, 0, 'h', 0, 5);"; $SQL[] = "ALTER TABLE members ADD unacknowledged_warnings TINYINT(1) DEFAULT NULL;"; diff --git a/upload/admin/applications/core/setup/versions/upg_33000/mysql_updates_1.php b/upload/admin/applications/core/setup/versions/upg_33000/mysql_updates_1.php index 3d317d38..2abcdc86 100644 --- a/upload/admin/applications/core/setup/versions/upg_33000/mysql_updates_1.php +++ b/upload/admin/applications/core/setup/versions/upg_33000/mysql_updates_1.php @@ -1,7 +1,7 @@ - * Invision Power Services - * IP.Board v3.4.5 - * Upgrade Class - * - * Class to add options and notices for IP.Board upgrade - * Last Updated: $Date: 2011-05-25 19:58:10 +0100 (Wed, 25 May 2011) $ - * - * - * @author Matt Mecham - * @version $Rev: 8891 $ - * @since 3.0 - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/company/standards.php#license - * @link http://www.invisionpower.com - * @package IP.Board - */ - -class version_class_core_33000 -{ - /** - * Constructor - * - * @param object $registry Registry object - * @return @e void - */ - public function __construct( ipsRegistry $registry ) - { - /* Make object */ - $this->registry = $registry; - $this->DB = $this->registry->DB(); - $this->settings =& $this->registry->fetchSettings(); - $this->request =& $this->registry->fetchRequest(); - $this->cache = $this->registry->cache(); - $this->caches =& $this->registry->cache()->fetchCaches(); - } - - /** - * Add pre-upgrade options: Form - * - * @return string HTML block - */ - public function preInstallOptionsForm() - { - $_wrapper = "
      %s
    "; - $_html = ''; - $posts = $this->DB->buildAndFetch( array( 'select' => 'count(*) as total', 'from' => 'posts' ) ); - - // Is 3.1? - if ( IPSSetUp::is300plus() && ! IPSSetUp::is320plus() ) - { - // Got more than 100K posts? - if( $posts['total'] > 100000 && ! $this->DB->checkForField( 'post_field_int', 'posts' ) ) - { -$_html .= << - - Внести изменения в структуру таблицы Posts вручную? На вашем форуме более 100,000 сообщений. Мы настоятельно рекомендуем вам включить данную опцию и самостоятельно выполнить - SQL запросы для обновления таблицы сообщений. Если вы отключите данную опцию существует большая вероятность того, что мастер обновления не сможет обновить форум. - -EOF; - } - } - - $_html .= << - - Отметить всех пользователей из группы "Забаненные", как забаненных
    - В 3.3.0 удалена отдельная группа для заблокированных, теперь проверка осуществляется на основе метки для каждого пользователя. Возможно, что часть пользователей, отмеченных как - забаненные, в результате такого переноса, не будут находится поиском в админ-центре при применении фильтра поиска по заблокированным. -
    Мы рекомендуем воспользоваться этой опцией. - -EOF; - - if( $_html ) - { - return sprintf( $_wrapper, $_html ); - } - else - { - return ''; - } - } - - /** - * Add pre-upgrade options: Save - * - * Data will be saved in saved data array as: appOptions[ app ][ versionLong ] = ( key => value ); - * - * @return array Key / value pairs to save - */ - public function preInstallOptionsSave() - { - return array( 'flagBanned' => intval( $_REQUEST['flagBanned'] ), 'manualPostsTableQuery' => intval( $_REQUEST['manualPostsTableQuery'] ) ); - } - - /** - * Return any post-installation notices - * - * @return array Array of notices - */ - public function postInstallNotices() - { - return array(); - } - - /** - * Return any pre-installation notices - * - * @return array Array of notices - */ - public function preInstallNotices() - { - return array(); - } + + * Invision Power Services + * IP.Board v3.4.6 + * Upgrade Class + * + * Class to add options and notices for IP.Board upgrade + * Last Updated: $Date: 2011-05-25 19:58:10 +0100 (Wed, 25 May 2011) $ + * + * + * @author Matt Mecham + * @version $Rev: 8891 $ + * @since 3.0 + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license http://www.invisionpower.com/company/standards.php#license + * @link http://www.invisionpower.com + * @package IP.Board + */ + +class version_class_core_33000 +{ + /** + * Constructor + * + * @param object $registry Registry object + * @return @e void + */ + public function __construct( ipsRegistry $registry ) + { + /* Make object */ + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + } + + /** + * Add pre-upgrade options: Form + * + * @return string HTML block + */ + public function preInstallOptionsForm() + { + $_wrapper = "
      %s
    "; + $_html = ''; + $posts = $this->DB->buildAndFetch( array( 'select' => 'count(*) as total', 'from' => 'posts' ) ); + + // Is 3.1? + if ( IPSSetUp::is300plus() && ! IPSSetUp::is320plus() ) + { + // Got more than 100K posts? + if( $posts['total'] > 100000 && ! $this->DB->checkForField( 'post_field_int', 'posts' ) ) + { +$_html .= << + + Manually apply changes to the posts table? Your site has more than 100,000 posts. We strongly recommend that you enable this option and manually run the provided + SQL query to alter your posts table in order to prevent timeouts in the web-based upgrader. If you uncheck this option, it is very possible the upgrader will timeout attempting to + update your posts table. + +EOF; + } + } + + $_html .= << + + Flag all members in the Banned member group as banned
    + 3.3.0 removes the need for a specific Banned Group and uses the built in 'flag' on a per-member basis. However, unless you choose to update all + members in the current Banned Group as 'banned' they may not appear when searching for banned members in the ACP. +
    We recommend you keep this box ticked + +EOF; + + if( $_html ) + { + return sprintf( $_wrapper, $_html ); + } + else + { + return ''; + } + } + + /** + * Add pre-upgrade options: Save + * + * Data will be saved in saved data array as: appOptions[ app ][ versionLong ] = ( key => value ); + * + * @return array Key / value pairs to save + */ + public function preInstallOptionsSave() + { + return array( 'flagBanned' => intval( $_REQUEST['flagBanned'] ), 'manualPostsTableQuery' => intval( $_REQUEST['manualPostsTableQuery'] ) ); + } + + /** + * Return any post-installation notices + * + * @return array Array of notices + */ + public function postInstallNotices() + { + return array(); + } + + /** + * Return any pre-installation notices + * + * @return array Array of notices + */ + public function preInstallNotices() + { + return array(); + } } \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_33000/version_upgrade.php b/upload/admin/applications/core/setup/versions/upg_33000/version_upgrade.php index d57aa350..2791ca60 100644 --- a/upload/admin/applications/core/setup/versions/upg_33000/version_upgrade.php +++ b/upload/admin/applications/core/setup/versions/upg_33000/version_upgrade.php @@ -155,7 +155,7 @@ class version_upgrade } } - $this->registry->output->addMessage("{$cnt} запросов выполнено... "); + $this->registry->output->addMessage("{$cnt} queries ran... "); } /* Next Page */ diff --git a/upload/admin/applications/core/setup/versions/upg_33007/index.html b/upload/admin/applications/core/setup/versions/upg_33007/index.html index bae2d5ed..dc71892e 100644 --- a/upload/admin/applications/core/setup/versions/upg_33007/index.html +++ b/upload/admin/applications/core/setup/versions/upg_33007/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_33007/version_upgrade.php b/upload/admin/applications/core/setup/versions/upg_33007/version_upgrade.php index 83b1aa98..dc59ac2e 100644 --- a/upload/admin/applications/core/setup/versions/upg_33007/version_upgrade.php +++ b/upload/admin/applications/core/setup/versions/upg_33007/version_upgrade.php @@ -91,7 +91,7 @@ class version_upgrade } } - $this->registry->output->addMessage( "XML стиль восстановлен" ); + $this->registry->output->addMessage( "XML Skin restored" ); $this->request['workact'] = ''; } diff --git a/upload/admin/applications/core/setup/versions/upg_33009/index.html b/upload/admin/applications/core/setup/versions/upg_33009/index.html index bae2d5ed..dc71892e 100644 --- a/upload/admin/applications/core/setup/versions/upg_33009/index.html +++ b/upload/admin/applications/core/setup/versions/upg_33009/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_33010/index.html b/upload/admin/applications/core/setup/versions/upg_33010/index.html index bae2d5ed..dc71892e 100644 --- a/upload/admin/applications/core/setup/versions/upg_33010/index.html +++ b/upload/admin/applications/core/setup/versions/upg_33010/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_33010/version_class.php b/upload/admin/applications/core/setup/versions/upg_33010/version_class.php index a135f286..d1ef99c1 100644 --- a/upload/admin/applications/core/setup/versions/upg_33010/version_class.php +++ b/upload/admin/applications/core/setup/versions/upg_33010/version_class.php @@ -1,82 +1,82 @@ - - * Invision Power Services - * IP.Board v3.4.5 - * Upgrade Class - * - * Class to add options and notices for IP.Board upgrade - * Last Updated: $Date: 2011-05-25 19:58:10 +0100 (Wed, 25 May 2011) $ - * - * - * @author Matt Mecham - * @version $Rev: 8891 $ - * @since 3.0 - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/company/standards.php#license - * @link http://www.invisionpower.com - * @package IP.Board - */ - -class version_class_core_33010 -{ - /** - * Constructor - * - * @param object $registry Registry object - * @return @e void - */ - public function __construct( ipsRegistry $registry ) - { - /* Make object */ - $this->registry = $registry; - $this->DB = $this->registry->DB(); - $this->settings =& $this->registry->fetchSettings(); - $this->request =& $this->registry->fetchRequest(); - $this->cache = $this->registry->cache(); - $this->caches =& $this->registry->cache()->fetchCaches(); - } - - /** - * Add pre-upgrade options: Form - * - * @return string HTML block - */ - public function preInstallOptionsForm() - { - return ''; - } - - /** - * Add pre-upgrade options: Save - * - * Data will be saved in saved data array as: appOptions[ app ][ versionLong ] = ( key => value ); - * - * @return array Key / value pairs to save - */ - public function preInstallOptionsSave() - { - return array(); - } - - /** - * Return any post-installation notices - * - * @return array Array of notices - */ - public function postInstallNotices() - { - return array(); - } - - /** - * Return any pre-installation notices - * - * @return array Array of notices - */ - public function preInstallNotices() - { - return array( "Внимание поддержка входа по OpenID удалена в 3.3.0 версии. Это недолжно отразиться на работе вашего форума, если вы не включали данный метод входа." ); - } + + * Invision Power Services + * IP.Board v3.4.6 + * Upgrade Class + * + * Class to add options and notices for IP.Board upgrade + * Last Updated: $Date: 2011-05-25 19:58:10 +0100 (Wed, 25 May 2011) $ + * + * + * @author Matt Mecham + * @version $Rev: 8891 $ + * @since 3.0 + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license http://www.invisionpower.com/company/standards.php#license + * @link http://www.invisionpower.com + * @package IP.Board + */ + +class version_class_core_33010 +{ + /** + * Constructor + * + * @param object $registry Registry object + * @return @e void + */ + public function __construct( ipsRegistry $registry ) + { + /* Make object */ + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + } + + /** + * Add pre-upgrade options: Form + * + * @return string HTML block + */ + public function preInstallOptionsForm() + { + return ''; + } + + /** + * Add pre-upgrade options: Save + * + * Data will be saved in saved data array as: appOptions[ app ][ versionLong ] = ( key => value ); + * + * @return array Key / value pairs to save + */ + public function preInstallOptionsSave() + { + return array(); + } + + /** + * Return any post-installation notices + * + * @return array Array of notices + */ + public function postInstallNotices() + { + return array(); + } + + /** + * Return any pre-installation notices + * + * @return array Array of notices + */ + public function preInstallNotices() + { + return array( "Please note: The OpenID login method will be removed in the 3.3.0 Beta 4 upgrade and all associated OpenID data removed from the database. This will not affect your board unless you configured your board to use OpenID as a log in method." ); + } } \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_33012/index.html b/upload/admin/applications/core/setup/versions/upg_33012/index.html index bae2d5ed..dc71892e 100644 --- a/upload/admin/applications/core/setup/versions/upg_33012/index.html +++ b/upload/admin/applications/core/setup/versions/upg_33012/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_33013/index.html b/upload/admin/applications/core/setup/versions/upg_33013/index.html index bae2d5ed..dc71892e 100644 --- a/upload/admin/applications/core/setup/versions/upg_33013/index.html +++ b/upload/admin/applications/core/setup/versions/upg_33013/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_33014/index.html b/upload/admin/applications/core/setup/versions/upg_33014/index.html index bae2d5ed..dc71892e 100644 --- a/upload/admin/applications/core/setup/versions/upg_33014/index.html +++ b/upload/admin/applications/core/setup/versions/upg_33014/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_33015/index.html b/upload/admin/applications/core/setup/versions/upg_33015/index.html index bae2d5ed..dc71892e 100644 --- a/upload/admin/applications/core/setup/versions/upg_33015/index.html +++ b/upload/admin/applications/core/setup/versions/upg_33015/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_33016/index.html b/upload/admin/applications/core/setup/versions/upg_33016/index.html index bae2d5ed..dc71892e 100644 --- a/upload/admin/applications/core/setup/versions/upg_33016/index.html +++ b/upload/admin/applications/core/setup/versions/upg_33016/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/setup/versions/upg_34000/version_class.php b/upload/admin/applications/core/setup/versions/upg_34000/version_class.php index 60e6fe69..1ba60269 100644 --- a/upload/admin/applications/core/setup/versions/upg_34000/version_class.php +++ b/upload/admin/applications/core/setup/versions/upg_34000/version_class.php @@ -3,7 +3,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Upgrade Class
      *
      * Class to add options and notices for IP.Board upgrade
    diff --git a/upload/admin/applications/core/setup/versions/upg_34000/version_upgrade.php b/upload/admin/applications/core/setup/versions/upg_34000/version_upgrade.php
    index 728846b3..f5b39244 100644
    --- a/upload/admin/applications/core/setup/versions/upg_34000/version_upgrade.php
    +++ b/upload/admin/applications/core/setup/versions/upg_34000/version_upgrade.php
    @@ -78,7 +78,7 @@ class version_upgrade
     		$systemTemplates = new systemTemplates();
     		$systemTemplates->writeDefaults();
     		
    -		$this->registry->output->addMessage( "Запись шаблонов системы..." );
    +		$this->registry->output->addMessage( "Wrote system templates..." );
     		$this->request['workact'] = '';
     	}
     	
    @@ -115,7 +115,7 @@ class version_upgrade
     		$this->DB->delete( 'core_applications', "app_directory='ipseo'" );
     		$this->DB->delete( 'upgrade_history', "upgrade_app='ipseo'" );
     		
    -		$this->registry->output->addMessage( "Сконвертированы данные IP.SEO..." );
    +		$this->registry->output->addMessage( "Converted IP.SEO data..." );
     		$this->request['workact'] = 'oldhooks';
     	}
     	
    @@ -159,7 +159,7 @@ class version_upgrade
     		}
     	
     		/* Message */
    -		$this->registry->output->addMessage("{$_total} устаревших хуков удалено....");
    +		$this->registry->output->addMessage("{$_total} outdated hook(s) uninstalled....");
     	
     		/* Next Page */
     		$this->request['workact'] = 'system_templates';
    diff --git a/upload/admin/applications/core/setup/versions/upg_34008/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_34008/mysql_updates.php
    index 4064398e..a0de1ee4 100644
    --- a/upload/admin/applications/core/setup/versions/upg_34008/mysql_updates.php
    +++ b/upload/admin/applications/core/setup/versions/upg_34008/mysql_updates.php
    @@ -12,7 +12,4 @@ $SQL[] = "DELETE FROM task_manager WHERE task_key='mobile_notifications';";
     $SQL[] = "ALTER TABLE core_share_links ADD COLUMN share_groups TEXT NULL;";
     $SQL[] = "UPDATE core_share_links SET share_groups='*';";
     
    -$SQL[] = "ALTER TABLE profile_portal ADD vc_photo TEXT;";
    -
    -$SQL[] = "DELETE FROM core_sys_settings_titles WHERE conf_title_keyword='vk';";
     //
    \ No newline at end of file
    diff --git a/upload/admin/applications/core/setup/versions/upg_34012/mysql_updates.php b/upload/admin/applications/core/setup/versions/upg_34012/mysql_updates.php
    new file mode 100644
    index 00000000..2c8106ec
    --- /dev/null
    +++ b/upload/admin/applications/core/setup/versions/upg_34012/mysql_updates.php
    @@ -0,0 +1,7 @@
    +getPrefix());
    +$DB  = ipsRegistry::DB();
    +
    +$SQL[] = "DELETE FROM core_sys_conf_settings WHERE conf_key IN('sl_publicdata','ipb_prune_email');";
    +$SQL[] = "ALTER TABLE reputation_totals ADD INDEX ( rt_type_id );";
    \ No newline at end of file
    diff --git a/upload/admin/applications/core/skin_cp/cp_skin_adminlogs.php b/upload/admin/applications/core/skin_cp/cp_skin_adminlogs.php
    index 85d1f70b..20813117 100644
    --- a/upload/admin/applications/core/skin_cp/cp_skin_adminlogs.php
    +++ b/upload/admin/applications/core/skin_cp/cp_skin_adminlogs.php
    @@ -2,7 +2,7 @@
     /**
      * 
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Admin log skin file
      * Last Updated: $Date: 2013-01-03 15:22:09 -0500 (Thu, 03 Jan 2013) $
      * 
    diff --git a/upload/admin/applications/core/skin_cp/cp_skin_api.php b/upload/admin/applications/core/skin_cp/cp_skin_api.php index ddda5600..dd50b848 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_api.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_api.php @@ -2,19 +2,19 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * API users skin file
    - * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
    + * Last Updated: $Date: 2013-10-16 12:57:41 -0400 (Wed, 16 Oct 2013) $
      * 
    * - * @author $Author: bfarber $ + * @author $Author: AndyMillne $ * @copyright (c) 2001 - 2009 Invision Power Services, Inc. * @license http://www.invisionpower.com/company/standards.php#license * @package IP.Board * @subpackage Core * @link http://www.invisionpower.com * @since Friday 19th May 2006 17:33 - * @version $Revision: 10721 $ + * @version $Revision: 12380 $ */ class cp_skin_api @@ -77,7 +77,7 @@ $IPBHTML .= <<{$this->lang->words['a_detail']} - + @@ -96,7 +96,7 @@ $IPBHTML .= <<- - +
    {$this->lang->words['a_basics']}{$this->lang->words['a_basics']}
    {$this->lang->words['a_key']}
    {$this->lang->words['a_formdata']}{$this->lang->words['a_formdata']}
    diff --git a/upload/admin/applications/core/skin_cp/cp_skin_applications.php b/upload/admin/applications/core/skin_cp/cp_skin_applications.php index d5c73770..23193a75 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_applications.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_applications.php @@ -1,3269 +1,3269 @@ - - * Invision Power Services - * IP.Board v3.4.5 - * Applications skin file - * Last Updated: $Date: 2013-05-28 10:00:25 -0400 (Tue, 28 May 2013) $ - * - * - * @author $Author: AndyMillne $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/company/standards.php#license - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com - * @since Friday 19th May 2006 17:33 - * @version $Revision: 12273 $ - */ - -class cp_skin_applications -{ - /** - * Registry Object Shortcuts - * - * @var $registry - * @var $DB - * @var $settings - * @var $request - * @var $lang - * @var $member - * @var $memberData - * @var $cache - * @var $caches - */ - protected $registry; - protected $DB; - protected $settings; - protected $request; - protected $lang; - protected $member; - protected $memberData; - protected $cache; - protected $caches; - - /** - * Constructor - * - * @param object $registry Registry object - * @return @e void - */ - public function __construct( ipsRegistry $registry ) - { - $this->registry = $registry; - $this->DB = $this->registry->DB(); - $this->settings =& $this->registry->fetchSettings(); - $this->request =& $this->registry->fetchRequest(); - $this->member = $this->registry->member(); - $this->memberData =& $this->registry->member()->fetchMemberData(); - $this->cache = $this->registry->cache(); - $this->caches =& $this->registry->cache()->fetchCaches(); - $this->lang = $this->registry->class_localization; - } -/** - * Add/edit module form - * - * @param array Form elements - * @param string Form title - * @param string Action code - * @param string Button text - * @param array Module information - * @param array Application information - * @return string HTML - */ -public function module_form( $form, $title, $formcode, $button, $module, $application ) { - -$IPBHTML = ""; -//--starthtml--// - -$title = $formcode == 'module_edit_do' ? $this->lang->words['module_form_edit_title'] : $this->lang->words['module_form_add_title']; - -$IPBHTML .= << -

    {$title}

    - - -
    form_code}&do={$formcode}&app_id={$application['app_id']}&sys_module_id={$module['sys_module_id']}' method='POST'> -
    -

    {$this->lang->words['a_modules']}

    - - - - - - - - - - - - - - - - - - - - - - - - - - -EOF; -if ( IN_DEV ) -{ -$IPBHTML .= << - - - -EOF; -} -$IPBHTML .= << -
    - -
    - - -EOF; - -//--endhtml--// -return $IPBHTML; -} - -/** - * List the modules - * - * @param array Modules - * @param array Application - * @param boolean Is an admin module? - * @return string HTML - */ -public function modules_list( $modules, $application, $sys_module_admin=true ) { - -$IPBHTML = ""; -//--starthtml--// - -$_type = ( $sys_module_admin ) ? mb_strtolower( $this->lang->words['a_admin'] ) : mb_strtolower( $this->lang->words['a_public'] ); - -$IPBHTML .= << -

    {$_type} {$application['app_title']} {$this->lang->words['a_modules']}

    - - - - -
    -

    {$application['app_title']} > {$_type} {$this->lang->words['a_modules']}

    -
    - {$this->lang->words['a_modtype']} - - {$form['sys_module_admin']} -
    - {$this->lang->words['a_modtitle']} - - {$form['sys_module_title']} -
    - {$this->lang->words['a_moddesc']} - - {$form['sys_module_description']} -
    - {$this->lang->words['a_modkey']} - - {$form['sys_module_key']}
    - {$this->lang->words['a_modkey_info']} -
    - {$this->lang->words['a_modver']} - - {$form['sys_module_version']}
    - {$this->lang->words['a_modver_info']} -
    - {$this->lang->words['a_moden']} - - {$form['sys_module_visible']}
    - {$this->lang->words['a_moden_info']} -
    - {$this->lang->words['a_modprot']} - - {$form['sys_module_protected']}
    - {$this->lang->words['a_modprot_info']} -
    -EOF; - -if( count( $modules ) ) -{ - foreach( $modules as $module ) - { - $IPBHTML .= << - - - - - - -EOF; - } -} -else -{ - $IPBHTML .= << - - -EOF; -} - -$IPBHTML .= << - -
    - - -
    form_code}&do=module_import' enctype='multipart/form-data' method='post'> -
    -

    {$this->lang->words['a_importxml']}

    - -
    -
     
    -
    - - - form_code}&do=module_edit&sys_module_id={$module['sys_module_id']}&app_id={$application['app_id']}&sys_module_admin=$sys_module_admin'>{$module['sys_module_title']} -EOF; - if( $module['sys_module_description'] ) - { - $IPBHTML .= <<{$module['sys_module_description']} -EOF; - } - - $IPBHTML .= << - - {$module['sys_module_version']} - - - -EOF; - if ( $module['sys_module_protected'] != 1 OR IN_DEV ) - { - $IPBHTML .= << -
  • - form_code}&do=module_edit&sys_module_id={$module['sys_module_id']}&app_id={$application['app_id']}&sys_module_admin=$sys_module_admin' title='{$this->lang->words['a_editmod']}'>{$this->lang->words['a_editmod']} -
  • -
  • - form_code}&do=module_remove&sys_module_id={$module['sys_module_id']}&app_id={$application['app_id']}&sys_module_admin=$sys_module_admin");' title='{$this->lang->words['a_removemod']}'>{$this->lang->words['a_removemod']} -
  • - -EOF; - } - else - { - $IPBHTML .= <<{$this->lang->words['a_protectedmod']}--> -EOF; - } - - $IPBHTML .= << -
    - {$this->lang->words['a_nomods']} -
    - - - - - - - - -
    {$this->lang->words['a_uploadxml']}
    {$this->lang->words['a_uploadxml_info']}
    {$this->lang->words['a_filexml']}
    {$this->lang->words['a_filexml_info']}
    - -
    - -
    -
    - -EOF; - -//--endhtml--// -return $IPBHTML; -} - -/** - * Form to add/edit an application - * - * @param array Form elements - * @param string Form title - * @param string Action code - * @param string Button text - * @param array Application information - * @param string Default TAB to open on page load - * @return string HTML - */ -public function application_form( $form, $title, $formcode, $button, $application, $defaultTab='' ) { - -$IPBHTML = ""; -//--starthtml--// - -$defaultTab = $defaultTab ? $defaultTab : 'information'; - -$IPBHTML .= << -

    {$this->lang->words['a_apps']}

    - - -
    form_code}do={$formcode}&app_id={$application['app_id']}' method='POST'> -
    -

    {$title}

    - -
    -
      -
    • {$this->lang->words['app_tab_info']}
    • -
    • {$this->lang->words['app_tab_permissions']}
    • -
    • {$this->lang->words['app_tab_gcaches']}
    • -
    -
    - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -EOF; - if ( IN_DEV ) - { - $IPBHTML .= << - - - -EOF; - } - -$IPBHTML .= << - - - - - - - -
    - {$this->lang->words['a_apptitle']} - - {$form['app_title']} -
    - {$this->lang->words['a_appptitle']} - - {$form['app_public_title']}
    - {$this->lang->words['a_appptitle_info']} -
    - {$this->lang->words['a_appen']} - - {$form['app_enabled']} -
    - {$this->lang->words['a_appdesc']} - - {$form['app_description']} -
    - {$this->lang->words['a_appauthor']} - - {$form['app_author']} -
    - {$this->lang->words['a_appver']} - - {$form['app_version']} -
    - {$this->lang->words['a_appdir']} - - {$form['app_directory']}
    - {$this->lang->words['a_appdir_info']} -
    - {$this->lang->words['a_appprot']} - - {$form['app_protected']}
    - {$this->lang->words['a_appprot_info']} -
    - {$this->lang->words['a_hooksite']} - - {$form['app_website']}
    - {$this->lang->words['a_hooksite_info']} -
    - {$this->lang->words['a_hookurl']} - - {$form['app_update_check']}
    - {$this->lang->words['a_appurl_info']} -
    -
    - - -
    - - - - - - - - - -
    - {$this->lang->words['a_appphide']} - - {$form['app_hide_tab']}
    - {$this->lang->words['a_appphide_desc']} -
    - {$this->lang->words['app_form_tabgroups']} - - {$form['app_tab_groups']}
    - {$this->lang->words['app_form_tabgroups_desc']} -
    -
    - - -
    - - - - - -
    - {$this->lang->words['hook_form_caches']} - - {$form['app_global_caches']}
    - {$this->lang->words['hook_form_caches_desc']} -
    -
    - - -
    -
    - -
    -
    -
    -EOF; - -//--endhtml--// -return $IPBHTML; -} - - - -/** - * List the applications - * - * @param array Application - * @param array Uninstalled applications - * @return string HTML - */ -public function applications_list( $applications, $uninstalled=array(), $message=NULL ) { - -$IPBHTML = ""; -//--starthtml--// - -$canInstall = $this->registry->class_permissions->checkPermission( 'app_install' ); - -$IPBHTML .= << -

    {$this->lang->words['a_apps']}

    - -
    - -
    - - -EOF; - -if ( $message ) -{ - $IPBHTML .= "
    {$message}

    "; -} - -$IPBHTML .= << -
    -

    {$this->lang->words['a_installedapps']}

    - -
    - « - » -
      -
    • {$this->lang->words['a_apps_enabled']}
    • -
    • {$this->lang->words['a_apps_disabled']}
    • -
    -
    - -
    - -
    - - - - - - - - - -EOF; - - if ( count( $applications['enabled'] ) ) - { - foreach( $applications['enabled'] as $app ) - { - $img = is_file( IPSLib::getAppDir( $app['app_directory'] ) . '/skin_cp/appIcon.png' ) ? $this->settings['base_acp_url'] . '/' . IPSLib::getAppFolder( $app['app_directory'] ) . '/' . $app['app_directory'] . '/skin_cp/appIcon.png' : "{$this->settings['skin_acp_url']}/images/applications/{$app['app_directory']}.png"; - - # IPS app? - $app['titlePrefix'] = in_array( $app['app_location'], array( 'root', 'ips' ) ) ? "{$this->lang->words['gl_ipsapp']}  " : ''; - - # Sort title - $app['app_title'] = IN_DEV ? "form_code}do=application_edit&app_id={$app['app_id']}'>{$app['app_title']}" : $app['app_title']; - $app['app_description'] = $app['app_description'] ? "
    {$app['app_description']}" : ''; - - # Tab Restrictions - $app['_tab_restricted'] = ( $app['app_hide_tab'] || IPSText::cleanPermString($app['app_tab_groups']) ) ? "form_code}do=application_edit&app_id={$app['app_id']}&_tab=restrictions' title='{$this->lang->words['a_edit_restrictions']}'>" : ''; - - # Update available? - if( $app['app_update_available'][0] ) - { - $_update = "{$this->lang->words['hook_update_available']}"; - - if ( !empty($app['app_update_available'][1]) ) - { - $_update = "{$_update}"; - } - elseif( $app['app_website'] ) - { - $_update = "{$_update}"; - } - - $app['_updated'] = $_update; - } - elseif ( isset( $app['_long_version'] ) && $app['_long_version'] > $app['_long_current'] ) - { - $app['_updated'] = "{$this->lang->words['a_upgradeavail']}"; - } - else - { - $app['_updated'] = "{$this->lang->words['a_oh_kay']}"; - } - -if ( $app['app_directory'] == 'core' ) -{ - $IPBHTML .= << - -EOF; -} -else -{ - $IPBHTML .= << - -EOF; -} - -$IPBHTML .= << - - - - - - - -EOF; - } - } - else - { - $IPBHTML .= << - - -EOF; - } - -$IPBHTML .= << - - - -
    -
      {$this->lang->words['a_hookapp']}{$this->lang->words['app_tab_permissions']}{$this->lang->words['a_lastupdated']} 
      -   - - {$app['titlePrefix']}{$app['app_title']}  v{$app['_human_current']} - {$app['app_description']} - {$app['_tab_restricted']}{$app['_updated']} - - -
    {$this->lang->words['a_noapps_enabled']}
    - - - - - - - - -EOF; - - if ( count( $applications['disabled'] ) ) - { - foreach( $applications['disabled'] as $app ) - { - $img = is_file( IPSLib::getAppDir( $app['app_directory'] ) . '/skin_cp/appIcon.png' ) ? $this->settings['base_acp_url'] . '/' . IPSLib::getAppFolder( $app['app_directory'] ) . '/' . $app['app_directory'] . '/skin_cp/appIcon.png' : "{$this->settings['skin_acp_url']}/images/applications/{$app['app_directory']}.png"; - - # IPS app? - $app['titlePrefix'] = in_array( $app['app_location'], array( 'root', 'ips' ) ) ? "{$this->lang->words['gl_ipsapp']}  " : ''; - - # Sort title - $app['app_title'] = IN_DEV ? "form_code}do=application_edit&app_id={$app['app_id']}'>{$app['app_title']}" : $app['app_title']; - $app['app_description'] = $app['app_description'] ? "
    {$app['app_description']}" : ''; - - # Tab Restrictions - $app['_tab_restricted'] = ( $app['app_hide_tab'] || IPSText::cleanPermString($app['app_tab_groups']) ) ? "form_code}do=application_edit&app_id={$app['app_id']}&_tab=restrictions' title='{$this->lang->words['a_edit_restrictions']}'>" : ''; - - # Update available? - if( $app['app_update_available'][0] ) - { - $_update = "{$this->lang->words['hook_update_available']}"; - - if ( !empty($app['app_update_available'][1]) ) - { - $_update = "{$_update}"; - } - elseif( $app['app_website'] ) - { - $_update = "{$_update}"; - } - - $app['_updated'] = $_update; - } - elseif ( isset( $app['_long_version'] ) && $app['_long_version'] > $app['_long_current'] ) - { - $app['_updated'] = "{$this->lang->words['a_upgradeavail']}"; - } - else - { - $app['_updated'] = "{$this->lang->words['a_oh_kay']}"; - } - - $IPBHTML .= << - - - - - - - -EOF; - } - } - else - { - $IPBHTML .= << - - -EOF; - } - -$IPBHTML .= << - - - - - - - -
    -EOF; - -if ( is_array( $uninstalled ) AND count( $uninstalled ) ) -{ -$IPBHTML .= << -

    {$this->lang->words['a_unapps']}

    -
      {$this->lang->words['a_hookapp']}{$this->lang->words['app_tab_permissions']}{$this->lang->words['a_lastupdated']} 
      - - - {$app['titlePrefix']}{$app['app_title']}  v{$app['_human_current']} - {$app['app_description']} - {$app['_tab_restricted']}{$app['_updated']} - - -
    {$this->lang->words['a_noapps_disabled']}
    -EOF; - -foreach( $uninstalled as $app ) -{ - if ( strstr( $app['path'], 'applications_addon/ips' ) ) - { - $app['_location'] = 'ips'; - $img = ""; - } - else if ( strstr( $app['path'], 'applications_addon/other' ) ) - { - $app['_location'] = 'other'; - $img = ''; - } - else - { - $app['_location'] = 'root'; - $img = ""; - } - - if ( $app['okToGo'] ) - { - $warning = ''; - $install = <<{$this->lang->words['a_install']} -EOF; - } - else - { - $install = "{$this->lang->words['a_cannotinstall']}"; - $warning = <<{$this->lang->words['a_cantinstall_info']} -EOF; - } - -$install = $canInstall ? $install : ''; - -$IPBHTML .= << - - - - -EOF; -} - -$IPBHTML .= << - -EOF; -} - -if( - ( !IPSLib::appIsInstalled('nexus', false) AND !isset($uninstalled['nexus']) ) OR - ( !IPSLib::appIsInstalled('blog', false) AND !isset($uninstalled['blog']) ) OR - ( !IPSLib::appIsInstalled('gallery', false) AND !isset($uninstalled['gallery']) ) OR - ( !IPSLib::appIsInstalled('ccs', false) AND !isset($uninstalled['ccs']) ) OR - ( !IPSLib::appIsInstalled('downloads', false) AND !isset($uninstalled['downloads']) ) OR - !$this->settings['ips_cp_purchase'] ) -{ - $IPBHTML .= << -
    -
    - {$img} - - {$app['title']}
    - {$app['author']} - {$warning} -
    - {$install} -
    -EOF; - foreach( array('nexus','blog','gallery','ccs','downloads') as $__app ) - { - if( !IPSLib::appIsInstalled( $__app, false ) AND !isset($uninstalled[ $__app ]) ) - { - $_app_name = $__app == 'ccs' ? 'Content' : ucfirst($__app); - - $IPBHTML .= << - - - -EOF; - } - } - - if( !$this->settings['ips_cp_purchase'] ) - { - $IPBHTML .= << - - - -EOF; - } - - $IPBHTML .= << - -EOF; -} - -$IPBHTML .= << -EOF; - -//--endhtml--// -return $IPBHTML; -} -/** - * Show the application details - * - * @param array $appData Application data - * @param array $history Upgrade data - * @param array $hooks Hooks data - * @return @e string HTML - */ -public function application_details( $appData, $history, $hooks=array() ) -{ -$HTML = ''; - -$defaultTab = 'tab_appHistory'; #Default tab is history, if we have hooks later switch to them - -/* Menu */ -$HTML .= << -

    {$this->lang->words['a_app_details']}

    -EOF; - -if ( !in_array( $appData['app_directory'], array( 'core', 'forums', 'members' ) ) ) -{ - $HTML .= << -
    - - - IP.{$_app_name} -
    - - - Copyright Removal -
    -EOF; - - if( $appData['app_description'] ) - { - $HTML .= << - - -EOF; - } - - -$appData['app_public_title'] = $appData['app_public_title'] ? $appData['app_public_title'] : '--'; - -$HTML .= << - - - - - - - - - - - -EOF; - - if( $appData['app_website'] ) - { - $HTML .= << - - - -EOF; - } - - /* Update available? */ - if( $appData['app_update_available'][0] ) - { - $appData['_updated'] = "{$this->lang->words['hook_update_available']}"; - - if ( !empty($appData['app_update_available'][1]) ) - { - $appData['_updated'] = "{$appData['_updated']}"; - } - elseif( $appData['app_website'] ) - { - $appData['_updated'] = "{$appData['_updated']}"; - } - } - elseif ( isset( $appData['_long_version'] ) && $appData['_long_version'] > $appData['_long_current'] ) - { - $appData['_updated'] = "{$this->lang->words['a_upgradeavail']}"; - } - - $HTML .= << - - - - - - - -EOF; - - if ( $appData['app_global_caches'] ) - { - $cachesCount = count( explode(',', $appData['app_global_caches']) ); - - $HTML .= << - - - -EOF; - } - - $HTML .= << - -
    -
    -

    {$this->lang->words['a_other_details']}

    - -
    - « - » -
      -
    • {$this->lang->words['a_related_hooks']}
    • -
    • {$this->lang->words['a_upgrade_history']}
    • -
    -
    - -
    - -
    -
    {$appData['app_description']}
    - {$this->lang->words['a_appptitle']} - - {$appData['app_public_title']} -
    - {$this->lang->words['a_appver']} - - {$appData['app_version']} ({$appData['app_long_version']}) -
    - {$this->lang->words['a_appauthor']} - - {$appData['app_author']} -
    - {$this->lang->words['a_hooksite']} - - {$appData['app_website']} -
    - {$this->lang->words['a_installed_on']} - - {$appData['_installed']} -
    - {$this->lang->words['a_lastupdated']} - - {$appData['_updated']} -
    - {$this->lang->words['hook_globalcaches']} - - {$cachesCount}  ( {$appData['app_global_caches']} ) -
    -EOF; - - if( count( $hooks ) ) - { - $defaultTab = 'tab_appHooks'; - $warningBadge = "{$this->lang->words['hook_badge_warning']} "; - - foreach( $hooks as $r ) - { - $statusBadge = $r['hook_enabled'] ? "{$this->lang->words['a_apps_enabled']}" : "{$this->lang->words['a_apps_disabled']} "; - $_warning = count($r['_require_errors']) ? "{$warningBadge}" : ''; - - $HTML .= << - - - - - -EOF; - } - } - else - { - $HTML .= << - - -EOF; - } - - $HTML .= << - - -
    -
    - {$statusBadge} - - {$_warning}{$r['hook_name']}  v{$r['hook_version_human']} - {$r['hook_author']} - -
    {$this->lang->words['a_no_related_hooks']}
    -EOF; - -foreach( $history as $upgradeRow ) -{ - $upgradeRow['_date'] = $this->lang->getDate( $upgradeRow['upgrade_date'], 'SHORT' ); - - $HTML .= << - - - - -EOF; -} - -$HTML .= << - - - - - -EOF; - -return $HTML; -} - -/** - * Splash screen to remove an application - * - * @param array Application - * @return string HTML - */ -public function application_remove_splash( $data ) -{ -return << -

    {$this->lang->words['a_remove']} {$data['app_title']} {$this->lang->words['a_app']}

    -
    {$upgradeRow['_date']}{$upgradeRow['upgrade_version_human']} ({$upgradeRow['upgrade_version_id']}){$upgradeRow['upgrade_notes']}
    - - - - - - - - - - - - - - -
    {$this->lang->words['a_currentver']}{$data['app_version']}
    {$this->lang->words['a_author']}{$data['app_author']}
    {$this->lang->words['a_warning']}
    {$this->lang->words['a_warning_info']}
    - -
    -EOF; -} - -/** - * List the hooks - * - * @param array $hooksFound A list of the current enbled/disabled hooks - * @param integer $warnings Number of enabled hooks with warnings - * @param string $message Message to display - * @return @e string HTML - */ -public function hooksOverview( $hooksFound, $warnings, $message ) -{ -$HTML = ""; - -/* Sort out some data */ -$warningBadge= "{$this->lang->words['hook_badge_warning']} "; -$updateBadge = "{$this->lang->words['hook_update_available']}"; -$cache = $this->cache->getCache('disabledHooksCache'); - - -$HTML .= << - - - -EOF; - -if ( $message ) -{ - $HTML .= "
    {$message}

    "; -} - -/* Got warnings? */ -if( $warnings > 0 ) -{ - $_text = ( $warnings == 1 ) ? $this->lang->words['hook_overview_warning'] : sprintf( $this->lang->words['hook_overview_warnings'], $warnings ); - - $HTML .= '
    ' . $this->registry->output->global_template->warning_box( $_text ) . '
    '; -} - -$HTML .= << -

    {$this->lang->words['a_installedhooks']}

    - -
    - « - » -
      -
    • {$this->lang->words['a_apps_enabled']}
    • -
    • {$this->lang->words['a_apps_disabled']}
    • -
    -
    - -
    - -
    - - - - - - - - -EOF; - - if( count( $hooksFound['installed'] ) ) - { - foreach( $hooksFound['installed'] as $r ) - { - $HTML .= << - - - - - -EOF; - } - } - else - { - $HTML .= << - - -EOF; - } - - $HTML .= << - - - - -
    -
     {$this->lang->words['a_hook']}{$this->lang->words['a_author']}{$this->lang->words['a_lastupdated']} 
    -   - -EOF; - - $_warning = count($r['_require_errors']) ? "form_code}do=check_requirements&id={$r['hook_id']}'>{$warningBadge}" : ''; - - $r['hook_name'] = IN_DEV ? "form_code}do=edit_hook&id={$r['hook_id']}'>{$r['hook_name']}" : $r['hook_name']; - - $HTML .= "{$_warning}{$r['hook_name']}  v{$r['hook_version_human']}"; - - if( $r['hook_desc'] ) - { - $HTML .= "
    {$r['hook_desc']}"; - } - - /* Update available? */ - if( $r['hook_update_available'][0] ) - { - $r['_updated'] = $updateBadge; - - if ( !empty($r['hook_update_available'][1]) ) - { - $r['_updated'] = "{$r['_updated']}"; - } - elseif( $r['hook_website'] ) - { - $r['_updated'] = "{$r['_updated']}"; - } - } - - $HTML .= << -
    - {$r['hook_author']} - - {$r['_updated']} - - - - -
    {$this->lang->words['a_nohooks']}
    - - - - - - - -EOF; - - if( count( $hooksFound['uninstalled'] ) ) - { - foreach( $hooksFound['uninstalled'] as $r ) - { - $HTML .= << - - -EOF; - - /* Update available? */ - if( $r['hook_update_available'][0] ) - { - $r['_updated'] = $updateBadge; - - if ( !empty($r['hook_update_available'][1]) ) - { - $r['_updated'] = "{$r['_updated']}"; - } - elseif( $r['hook_website'] ) - { - $r['_updated'] = "{$r['_updated']}"; - } - } - - $HTML .= <<{$r['_updated']} - - -EOF; - } - } - else - { - $HTML .= << - - -EOF; - } - - $HTML .= << - - - - -EOF; - -return $HTML; -} - - -/** - * Form to add/edit a hook - * - * @param array Form elements - * @param string Action code - * @param array Hook data - * @param array Files in this hook - * @return string HTML - */ -public function hookForm( $form, $action, $hookData, $files=array(), $requirements=array() ) -{ - -/* Hook types */ -$hookTypes = array( array( 0, $this->lang->words['a_selectone'] ), - array( 'commandHooks', $this->lang->words['a_aoverloader'] ), - array( 'skinHooks', $this->lang->words['a_soverloader'] ), - array( 'templateHooks', $this->lang->words['a_templatehook'] ), - array( 'dataHooks', $this->lang->words['a_datahook'] ), - array( 'libraryHooks', $this->lang->words['a_libraryhook'] ) - ); - -/* Get apps to use for library hooks */ -$appsArray = array( array( 0, $this->lang->words['a_selectone'] ) ); - -foreach( ipsRegistry::$applications as $dir => $appdata ) -{ - $appsArray[] = array( $dir, $appdata['app_title'] ); -} - -$_removeInDev = IN_DEV ? '' : 'display: none;'; - -$HTML .= << -

    {$this->lang->words['a_setuphook']}

    - - - -
    form_code}' id='mainform'> - - - - -
    -

    {$this->lang->words['a_setuphook']}

    - -
    - « - » -
      -
    • {$this->lang->words['hook_form_info']}
    • -
    • {$this->lang->words['a_hookrequirements']}
    • -
    • {$this->lang->words['hook_globalcaches']}
    • -
    • {$this->lang->words['a_hookfiles']}
    • -
    -
    - -
    - - -
    -
     {$this->lang->words['a_hook']}{$this->lang->words['a_author']}{$this->lang->words['a_uptodate']} 
      -EOF; - - $_warning = count($r['_require_errors']) ? "form_code}do=check_requirements&id={$r['hook_id']}'>{$warningBadge}" : ''; - - $r['hook_name'] = IN_DEV ? "form_code}&do=edit_hook&id={$r['hook_id']}'>{$r['hook_name']}" : $r['hook_name']; - - $HTML .= "{$_warning}{$r['hook_name']}  v{$r['hook_version_human']}"; - - if( $r['hook_desc'] ) - { - $HTML .= <<{$r['hook_desc']} -EOF; - } - - $HTML .= << - {$r['hook_author']} - - - -
    {$this->lang->words['a_nodishooks']}
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     
    - {$this->lang->words['hook_form_title']} - - {$form['hook_name']}
    - {$this->lang->words['hook_form_title_help']} -
    - {$this->lang->words['hook_form_desc']} - - {$form['hook_desc']}
    - {$this->lang->words['hook_form_desc_help']} -
    - {$this->lang->words['hook_form_key']} - - {$form['hook_key']}
    - {$this->lang->words['hook_form_key_desc']} -
    - {$this->lang->words['hook_form_version']} - - {$form['hook_version_human']}
    - {$this->lang->words['hook_form_version_help']} -
    - {$this->lang->words['a_hookversion']} - - {$form['hook_version_long']}
    - {$this->lang->words['a_hookversion_info']} -
    - {$this->lang->words['a_hookauthor']} - - {$form['hook_author']}
    - {$this->lang->words['a_hookauthor_info']} -
    - {$this->lang->words['a_hookemail']} - - {$form['hook_email']}
    - {$this->lang->words['a_hookemail_info']} -
    - {$this->lang->words['a_hooksite']} - - {$form['hook_website']}
    - {$this->lang->words['a_hooksite_info']} -
    - {$this->lang->words['a_hookurl']} - - {$form['hook_update_check']}
    - {$this->lang->words['a_hookurl_info']} -
    -
    - - -
    - - - - - - - - -EOF; - - $latestReqIndex = 0; - - if( is_array( $requirements ) && count( $requirements ) ) - { - foreach( $requirements as $appKey => $require ) - { - if ( is_array( $require['_versions'] ) ) - { - $_requiredApp = $this->registry->output->formDropdown( "requireApp[{$latestReqIndex}]", $appsArray, $appKey, '', "onchange='getAppVersions({$latestReqIndex})'" );/*noLibHook*/ - $_minVersions = $this->registry->output->formDropdown( "minVersion[{$latestReqIndex}]", $require['_versions'], $require['min_version'] ); - $_maxVersions = $this->registry->output->formDropdown( "maxVersion[{$latestReqIndex}]", $require['_versions'], $require['max_version'] ); - - $HTML .= << - - - - - - -EOF; - - $latestReqIndex++; - } - } - } - - $HTML .= << - -
    - -
    - - - -
    -
    {$this->lang->words['a_phpver']}
    - {$this->lang->words['a_phpver']} - - {$this->lang->words['a_min']}: {$form['hook_php_version_min']}

    - {$this->lang->words['a_max']}: {$form['hook_php_version_max']}
    - {$this->lang->words['a_enterzero']} {$this->lang->words['a_phpminmax']} -
    {$this->lang->words['hook_require_apptitle']}{$this->lang->words['hook_remove_requirement']}
    - {$this->lang->words['hook_require_apptitle']} - - {$_requiredApp}

    - - {$this->lang->words['a_min']}: {$_minVersions}

    - {$this->lang->words['a_max']}: {$_maxVersions} -
    -
    - - - - - - - -
    {$this->lang->words['hook_globalcaches']}
    - {$this->lang->words['hook_form_caches']} - - {$form['hook_global_caches']}
    - {$this->lang->words['hook_form_caches_desc']} -
    -
    - - -
    - -EOF; - - $latestIndex = 0; - - if( count( $files ) ) - { - foreach( $files as $index => $file ) - { - $latestIndex = $index > $latestIndex ? $index : $latestIndex; - - $HTML .= << -
    - - - - -EOF; - -if( IN_DEV ) -{ -$HTML .= << - - - - - - - -EOF; -} -else -{ -$HTML .= << - - -EOF; -} - -$_hookTypes = $this->registry->output->formDropdown( "hook_type[{$index}]", $hookTypes, $file['hook_type'], "hook_type[{$index}]", "onchange='selectHookType({$index});'" ); - - $HTML .= << - - - -EOF; - if( $file['hook_type'] == 'dataHooks' ) - { - $HTML .= << - - - -EOF; - } - else if( $file['hook_type'] == 'libraryHooks' ) - { - $_applications = $this->registry->output->formDropdown( "libApplication[{$index}]", $appsArray, $file['hook_data']['libApplication'] ); - - $HTML .= << - - - - - - - -EOF; - } - else if( $file['hook_type'] != 'templateHooks' ) - { - $HTML .= << - - - -EOF; - } - else - { - $HTML .= << - - - - - - - - - - - - - - - - - - - -EOF; - } - - $HTML .= << - - -EOF; - } - } - $HTML .= << - -
    - -
    - - - - - -
    - -
    - - -EOF; - -return $HTML; -} - -/** - * Show the hook details - * - * @param array Hook data - * @param array Files in this hook - * @return string HTML - */ -public function hookDetails( $hookData, $files=array() ) -{ -$HTML = ''; - -/* Menu */ -$HTML .= << -

    {$this->lang->words['hook_view_details']}

    - - - -
    - -
    -

    {$hookData['hook_name']}

    -
    {$this->lang->words['a_hookfile']} #{$index}{$this->lang->words['hook_remove_file']}
    - {$this->lang->words['a_filenamedir']} - - -
    - {$this->lang->words['a_fileclassname']} - - -
    - - -
    - {$this->lang->words['a_filehooktype']} - - {$_hookTypes} -
    - {$this->lang->words['a_datalocation']} - - {$file['_dataLocationDropdown']} -
    - {$this->lang->words['a_classextend']} - - -
    - {$this->lang->words['a_hookapp']} - - {$_applications} -
    - {$this->lang->words['a_classextend']} - - -
    - {$this->lang->words['a_skingroup']} - - {$file['_skinDropdown']} -
    - {$this->lang->words['a_skinfunc']} - - {$file['_templateDropdown']} -
    - {$this->lang->words['a_typeoftemp']} - - {$file['_hookTypeDropdown']} -
    - {$this->lang->words['a_hookid']} - - {$file['_hookIdsDropdown']} -
    - {$this->lang->words['a_hookloc']} - - {$file['_hookEPDropdown']} -
    -EOF; - - if( $hookData['hook_desc'] ) - { - $HTML .= << - - -EOF; - } - -$HTML .= << - - - - - - - -EOF; - - if( $hookData['hook_email'] ) - { - $HTML .= << - - - -EOF; - } - - if( $hookData['hook_website'] ) - { - $HTML .= << - - - -EOF; - } - - /* Update available? */ - if( $hookData['hook_update_available'][0] ) - { - $hookData['_updated'] = "{$this->lang->words['hook_update_available']}"; - - if ( !empty($hookData['hook_update_available'][1]) ) - { - $hookData['_updated'] = "{$hookData['_updated']}"; - } - elseif( $hookData['hook_website'] ) - { - $hookData['_updated'] = "{$hookData['_updated']}"; - } - } - - $HTML .= << - - - - - - -EOF; - - if ( $hookData['hook_global_caches'] ) - { - $cachesCount = count( explode(',', $hookData['hook_global_caches']) ); - - $HTML .= << - - - -EOF; - } - - $HTML .= << - -
    -
    -

    {$this->lang->words['a_fileuses']}

    -
    {$hookData['hook_desc']}
    - {$this->lang->words['a_hookver']} - - {$hookData['hook_version_human']} -
    - {$this->lang->words['a_hookauthor']} - - {$hookData['hook_author']} -
    - {$this->lang->words['a_hookemail']} - - {$hookData['hook_email']} -
    - {$this->lang->words['a_authorsite']} - - {$hookData['hook_website']} -
    - {$this->lang->words['a_lastupdated']} - - {$hookData['_updated']} -
    - {$this->lang->words['a_hookrequirements']} - -EOF; - - $HTML .= ( is_array($hookData['_require_errors']) && count($hookData['_require_errors']) ) ? "form_code}do=check_requirements&id={$hookData['hook_id']}'>{$this->lang->words['hook_require_error']}" : "{$this->lang->words['hook_require_ok']}"; - - $HTML .= << -
    - {$this->lang->words['hook_globalcaches']} - - {$cachesCount}  ( {$hookData['hook_global_caches']} ) -
    - - - - - - -EOF; - - foreach( $files as $index => $data ) - { - $showsAt = ""; - - if( $data['hook_type'] == 'templateHooks' ) - { - $showsAt = $this->lang->words['a_showsin'] . $data['hook_data']['skinGroup'] . ' -> ' . $data['hook_data']['skinFunction'] . ' '; - - if( $data['hook_data']['type'] == 'if' ) - { - switch( $data['hook_data']['position'] ) - { - case 'pre.startif': - $showsAt .= $this->lang->words['a_prestartif']; - break; - - case 'post.startif': - $showsAt .= $this->lang->words['a_poststartif']; - break; - - case 'pre.else': - $showsAt .= $this->lang->words['a_preelse']; - break; - - case 'post.else': - $showsAt .= $this->lang->words['a_postelse']; - break; - - case 'pre.endif': - $showsAt .= $this->lang->words['a_preendif']; - break; - - case 'post.endif': - $showsAt .= $this->lang->words['a_postendif']; - break; - } - } - else - { - switch( $data['hook_data']['position'] ) - { - case 'outer.pre': - $showsAt .= $this->lang->words['a_outerpre']; - break; - - case 'inner.pre': - $showsAt .= $this->lang->words['a_innerpre']; - break; - - case 'inner.post': - $showsAt .= $this->lang->words['a_innerpost']; - break; - - case 'outer.post': - $showsAt .= $this->lang->words['a_outerpost']; - break; - } - } - - $showsAt .= $this->lang->words['a_labeled'] . $data['hook_data']['id']; - } - elseif ( $data['hook_type'] == 'libraryHooks' ) - { - $showsAt = sprintf( $this->lang->words['a_libraryhookfor'], $data['hook_data']['classToOverload'], $data['hook_data']['libApplication'] ); - } - elseif ( $data['hook_type'] == 'dataHooks' ) - { - $showsAt = $this->lang->words['a_datahookfor'] . $data['hook_data']['dataLocation']; - } - else - { - $showsAt = $this->lang->words['a_willoverload'] . $data['hook_data']['classToOverload']; - } - - switch( $data['hook_type'] ) - { - case 'templateHooks': - $hookType = $this->lang->words['a_templatehook']; - break; - case 'commandHooks': - $hookType = $this->lang->words['a_aoverloader']; - break; - case 'skinHooks': - $hookType = $this->lang->words['a_soverloader']; - break; - case 'libraryHooks': - $hookType = $this->lang->words['a_libraryhook']; - break; - case 'dataHooks': - $hookType = $this->lang->words['a_datahook']; - break; - } - - $HTML .= << - - - - - -EOF; - } - $HTML .= << - -EOF; - -return $HTML; -} - -/** - * Show the hook requirements - * - * @param array Hook data - * @param array Array of errors found - * @param array Array of the app versions - * @return string HTML - */ -public function hookRequirements( $hookData, $errors, $versions=array() ) -{ -$HTML = ''; - -/* Let's sort out the badges... */ -$forceEnable = empty($this->request['fromInstall']) ? '' : '&skipRequirements=1'; -$_goodBadge = "{$this->lang->words['hook_require_ok']}"; -$_errorBadge = "{$this->lang->words['hook_require_error']}"; - -/* Menu */ -$HTML .= << -

    {$this->lang->words['a_hookrequirements']}

    - - - -
    -EOF; - -/* Check if we got any requirements... */ -if ( !$hookData['hook_requirements']['hook_php_version_min'] && !$hookData['hook_requirements']['hook_php_version_min'] && ( ( !is_array($hookData['hook_requirements']['required_applications']) || !count($hookData['hook_requirements']['required_applications']) ) ) ) -{ -$HTML .= << - {$this->lang->words['hook_require_noreqs']} - -EOF; - -return $HTML; -} - - -/* Got errors? */ -if( count($errors) ) -{ - $HTML .= $this->registry->output->global_template->warning_box( $this->lang->words['a_noyoucant'], empty($this->request['fromInstall']) ? '' : '
    '.$this->lang->words['hook_require_skip_reqs'] ) . '
    '; - - /* Replacement time? */ - if ( isset($errors['php_min']) ) - { - $hookData['hook_requirements']['hook_php_version_min'] = $errors['php_min']; - } - if ( isset($errors['php_max']) ) - { - $hookData['hook_requirements']['hook_php_version_max'] = $errors['php_max']; - } -} - -/* Still here? We do have some requirements then! */ -$HTML .= << -

    {$hookData['hook_name']}

    -
    {$this->lang->words['a_realfile']}{$this->lang->words['a_storedfile']}{$this->lang->words['a_filehooktype']}{$this->lang->words['a_wherehook']}
    {$data['hook_file_real']}{$data['hook_file_stored']}{$hookType}{$showsAt}
    - - - - - - - - - -EOF; - -if ( $hookData['hook_requirements']['hook_php_version_min'] ) -{ - - $HTML .= << - - - -EOF; -} - -if ( $hookData['hook_requirements']['hook_php_version_max'] ) -{ - - $HTML .= << - - - -EOF; -} - - if ( is_array($hookData['hook_requirements']['required_applications']) && count($hookData['hook_requirements']['required_applications']) ) - { - foreach( $hookData['hook_requirements']['required_applications'] as $appKey => $appData ) - { - $_appName = ipsRegistry::$applications[ $appKey ]['app_title']; - - $HTML .= << - - - - - -EOF; - /* Got a min version? */ - if ( ! isset($errors[ $appKey.'_app' ]) && $appData['min_version'] ) - { - - $HTML .= << - - -EOF; -} - /* Got a max version? */ - if ( ! isset($errors[ $appKey.'_app' ]) && $appData['max_version'] ) - { - - $HTML .= << - - -EOF; - } - } - } - - $HTML .= << - - -EOF; - -return $HTML; -} - -/** - * Page to export a hook - * - * @param array Hook data - * @return string HTML - */ -public function hooksExport( $hookData ) -{ - -$hookData['hook_extra_data']['display']['settings'] = $hookData['hook_extra_data']['display']['settings'] ? $hookData['hook_extra_data']['display']['settings'] : $this->lang->words['a_nosettings']; -$hookData['hook_extra_data']['display']['modules'] = $hookData['hook_extra_data']['display']['modules'] ? $hookData['hook_extra_data']['display']['modules'] : $this->lang->words['a_nomodules']; -$hookData['hook_extra_data']['display']['help'] = $hookData['hook_extra_data']['display']['help'] ? $hookData['hook_extra_data']['display']['help'] : $this->lang->words['a_nohelp']; -$hookData['hook_extra_data']['display']['acphelp'] = $hookData['hook_extra_data']['display']['acphelp'] ? $hookData['hook_extra_data']['display']['acphelp'] : $this->lang->words['a_noacp']; -$hookData['hook_extra_data']['display']['tasks'] = $hookData['hook_extra_data']['display']['tasks'] ? $hookData['hook_extra_data']['display']['tasks'] : $this->lang->words['a_notasks']; -$hookData['hook_extra_data']['display']['database'] = $hookData['hook_extra_data']['display']['database'] ? $hookData['hook_extra_data']['display']['database'] : $this->lang->words['a_nodbchanges']; -$hookData['hook_extra_data']['display']['custom'] = $hookData['hook_extra_data']['display']['custom'] ? $hookData['hook_extra_data']['display']['custom'] : $this->lang->words['a_noinun']; - -$hookData['hook_extra_data']['display']['language'] = $hookData['hook_extra_data']['display']['language'] ? $hookData['hook_extra_data']['display']['language'] : $this->lang->words['a_nolang']; -$hookData['hook_extra_data']['display']['templates'] = $hookData['hook_extra_data']['display']['templates'] ? $hookData['hook_extra_data']['display']['templates'] : $this->lang->words['a_noskin']; -$hookData['hook_extra_data']['display']['css'] = $hookData['hook_extra_data']['display']['css'] ? $hookData['hook_extra_data']['display']['css'] : $this->lang->words['a_nocss']; -$hookData['hook_extra_data']['display']['replacements'] = $hookData['hook_extra_data']['display']['replacements'] ? $hookData['hook_extra_data']['display']['replacements'] : $this->lang->words['a_noreplacements']; - -$HTML .= << -

    {$this->lang->words['hook_h2_exporting']} {$hookData['hook_name']}

    - - - - - - - -
    form_code}' id='mainform'> - - - - -
    -

    {$this->lang->words['a_exportsettings']}

    - -
    {$this->lang->words['a_phpver']}  
    - {$this->lang->words['hook_require_current']} - -   - -EOF; - -$HTML .= PHP_VERSION; - -$HTML .= << -
    - {$this->lang->words['hook_require_min']} - -EOF; - - $HTML .= isset($errors['php_min']) ? $_errorBadge : $_goodBadge; - - $HTML .= << - - {$hookData['hook_requirements']['hook_php_version_min']} -
    - {$this->lang->words['hook_require_max']} - -EOF; - - $HTML .= isset($errors['php_max']) ? $_errorBadge : $_goodBadge; - - $HTML .= << - - {$hookData['hook_requirements']['hook_php_version_max']} -
    {$this->lang->words['hook_require_apptitle']}: {$_appName}
    - {$this->lang->words['hook_require_current']} - -EOF; - - $HTML .= isset($errors[ $appKey.'_app' ]) ? $_errorBadge : $_goodBadge; - - $HTML .= << - -EOF; - - $HTML .= isset($errors[ $appKey.'_app' ]) ? $errors[ $appKey.'_app' ] : ipsRegistry::$applications[ $appKey ]['app_version']; - - $HTML .= << -
    - {$this->lang->words['hook_require_min']} - -EOF; - - $appData['min_version'] = isset($errors[ $appKey.'_min' ]) ? $errors[ $appKey.'_min' ] : $appData['min_version']; - - $HTML .= isset($errors[ $appKey.'_min' ]) ? $_errorBadge : $_goodBadge; - - $HTML .= << - -EOF; - - $HTML .= isset($versions[ $appKey ][ $appData['min_version'] ]) ? $versions[ $appKey ][ $appData['min_version'] ] : $appData['min_version']; - - $HTML .= << -
    - {$this->lang->words['hook_require_max']} - -EOF; - - $appData['max_version'] = isset($errors[ $appKey.'_max' ]) ? $errors[ $appKey.'_max' ] : $appData['max_version']; - - $HTML .= isset($errors[ $appKey.'_max' ]) ? $_errorBadge : $_goodBadge; - - $HTML .= << - -EOF; - - $HTML .= isset($versions[ $appKey ][ $appData['max_version'] ]) ? $versions[ $appKey ][ $appData['max_version'] ] : $appData['max_version']; - - $HTML .= << -
    - - - - - - -
    {$this->lang->words['a_settings_info']}
    -

    {$hookData['hook_extra_data']['display']['settings']}

    -
    {$this->lang->words['a_addsettings']}
    -
    - - -
    - -
    -

    {$this->lang->words['a_exportlang']}

    - - - - - - - - -
    {$this->lang->words['a_lang_info']}
    -

    {$hookData['hook_extra_data']['display']['language']}

    -
    {$this->lang->words['a_addlang']}
    -
    - -
    -
    - -
    -

    {$this->lang->words['a_exportmod']}

    - - - - - - - - -
    {$this->lang->words['a_mod_info']}
    -

    {$hookData['hook_extra_data']['display']['modules']}

    -
    {$this->lang->words['a_addmod']}
    -
    - -
    -
    - -
    -

    {$this->lang->words['a_exporthelp']}

    - - - - - - - - -
    {$this->lang->words['a_help_info']}
    -

    {$hookData['hook_extra_data']['display']['help']}

    -
    {$this->lang->words['a_addhelp']}
    -
    - -
    -
    - - -
    -

    {$this->lang->words['a_exportskin']}

    - - - - - - - - -
    {$this->lang->words['a_skin_info']}
    -

    {$hookData['hook_extra_data']['display']['templates']}

    -
    {$this->lang->words['a_addskin']}
    -
    - -
    -
    - -
    -

    {$this->lang->words['a_exportcss']}

    - - - - - - - - -
    {$this->lang->words['a_css_info']}
    -

    {$hookData['hook_extra_data']['display']['css']}

    -
    {$this->lang->words['a_addcss']}
    -
    - -
    -
    - -
    -

    {$this->lang->words['a_addreplacements']}

    - - - - - - - - -
    {$this->lang->words['a_replacements_info']}
    -

    {$hookData['hook_extra_data']['display']['replacements']}

    -
    {$this->lang->words['a_addreplacements']}
    -
    - -
    -
    - -
    -

    {$this->lang->words['a_exporttasks']}

    - - - - - - - - -
    {$this->lang->words['a_tasks_info']}
    -

    {$hookData['hook_extra_data']['display']['tasks']}

    -
    {$this->lang->words['a_addtasks']}
    -
    - -
    -
    - -
    -

    {$this->lang->words['a_exportdb']}

    - - - - - - - - -
    {$this->lang->words['a_db_info']}
    -

    {$hookData['hook_extra_data']['display']['database']}

    -
    {$this->lang->words['a_adddb']}
    -
    - -
    -
    - -
    -

    {$this->lang->words['a_exportscript']}

    - - - - - - - - -
    {$this->lang->words['a_script_info']}
    -

    {$hookData['hook_extra_data']['display']['custom']}

    -
    {$this->lang->words['a_addscript']}
    -
    - -
    -
    -
    -
    - -
    -
    - -EOF; - -return $HTML; -} - -/** - * Show a form to create sphinx cronjobs strings - * - * @param array $sphinxData Sphinx data - * @return @e string HTML - */ -public function sphinxConfForm( $sphinxData=array() ) -{ -$HTML = ''; - -/* Form path */ -$sphinxPath = $this->registry->output->formInput( 'sphinx_conf_path', $this->request['sphinx_conf_path'] ); - -/* Init template */ -$HTML .= << -

    {$this->lang->words['sphinx_cronjob_title']}

    - -EOF; - - -/* Got a path? */ -if ( $this->request['sphinx_conf_path'] && count($sphinxData) ) -{ - /* Sort out some variables.. */ - $this->request['sphinx_conf_path'] = rtrim( $this->request['sphinx_conf_path'], '/' ); - $_file = $this->request['sphinx_conf_path'] . '/sphinx.conf'; - $cronJobs = "*/15 * * * * /usr/local/bin/indexer --config {$_file} " . implode( ' ', $sphinxData['deltas'] ) . " --rotate -0 4 * * * /usr/local/bin/indexer --config {$_file} --all --rotate"; - - /* Doesn't exist? */ - if( !@is_file( $_file ) ) - { - $HTML .= $this->registry->output->global_template->warning_box( $this->lang->words['sphinx_cronjob_nofile'], '
    ' . sprintf( $this->lang->words['sphinx_cronjob_nofiledesc'], $_file ) ) . '
    '; - } - -$HTML .= << - {$this->lang->words['sphinx_cronjob_details']} -

    - -

    - {$this->lang->words['sphinx_cronjob_note']} - -

    -EOF; -} - -$HTML .= <<form_code}do=sphinxBuildCron' method='post' enctype='multipart/form-data'> -
    -

    {$this->lang->words['sphinx_cronjob_title']}

    - - - - - -
    - {$this->lang->words['sphinx_cronjob_path']} - - {$sphinxPath}
    - {$this->lang->words['sphinx_cronjob_path_desc']} -
    - -
    - -
    -
    - -EOF; - -return $HTML; -} - -/** - * Community Enhancements - * - * @param array $enhancements Enhancements data - * @return @e string HTML - */ -public function communityEnhancements( $enhancements=array() ) -{ -$HTML = ''; - -$HTML .= << -

    {$this->lang->words['community_enhancements']}

    - - -
    -

    {$this->lang->words['community_enhancements']}

    - -EOF; - foreach ( $enhancements as $k => $e ) - { - $external = $e->external ? "target='_blank'" : ''; - $icon = $e->enabled ? 'tick.png' : 'cross.png'; - $HTML .= << - - - -EOF; - } -$HTML .= << - - -EOF; - -return $HTML; -} - -/** - * Community Enhancements - Generic Settings Management - * - * @param stdClass $class Enhancement class - * @param array $html HTML - * @return @e string HTML - */ -public function communityEnhancementsSettings( $class, $html ) -{ -$HTML = ''; - -$className = get_class( $class ); - -$HTML .= << -

    {$class->title}

    - - -EOF; - -if ( $class->message ) -{ - $HTML .= << - {$class->message} - -
    -EOF; -} - -$HTML .= << -
    -

    {$class->title}

    -
    - - - {$e->title}
    - {$e->description} -
    - {$html} -
    -
    - -
    -
    - - -EOF; - -return $HTML; -} - -/** - * VigLink Conversion - * - * @param string $url Convert URL - * @return @e string HTML - */ -public function viglinkConvert( $url ) -{ -$HTML = ''; - -$baseUrl = str_replace( '&', '&', $this->settings['base_url'] ); - -$HTML .= << -

    {$this->lang->words['enhancements_viglink']}

    - - -
    -

    {$this->lang->words['viglink_signup']}

    - - - - -
    {$this->lang->words['viglink_blurb']}
    - -
    -
    -
    - -
    - -
    -

    {$this->lang->words['viglink_existing']}

    - - - - - -
    {$this->lang->words['viglink_existing_title']}{$this->registry->output->formInput( 'viglink_api_key' )}
    -
    - -
    -
    -
    -
    - - - - -EOF; - -return $HTML; -} - -/** - * IPS CDN Not Enabled - * - * @param array $json Data from license server - * @return @e string HTML - */ -public function cdnNotEnabled( $json ) -{ -$HTML = ''; - -$HTML .= << -

    {$this->lang->words['enhancements_ipscdn']}

    - - -
    -

    {$this->lang->words['enhancements_ipscdn']}

    - - - - -
    {$this->lang->words['cdn_blurb']}
    - -
    - - - -EOF; - -return $HTML; -} - -/** - * IPS CDN Not Active - * - * @return @e string HTML - */ -public function cdnInactive() -{ -$HTML = ''; - -$HTML .= << -

    {$this->lang->words['enhancements_ipscdn']}

    - - -
    -

    {$this->lang->words['enhancements_ipscdn']}

    - - - - -
    {$this->lang->words['cdn_blurb']}
    - -
    -EOF; - -return $HTML; -} - - -/** - * IPS CDN Overview - * - * @param array $json Data from license server - * @return @e string HTML - */ -public function cdnOverview( $json ) -{ -$HTML = ''; - -if ( $json['BYTES'] >= 1099511627776 ) -{ - $credit = round( ( $json['BYTES'] / 1099511627776 ), 2 ) . 'TB'; -} -else -{ - $credit = round( ( $json['BYTES'] / 1073741824 ), 2 ) . 'GB'; -} - -$message = sprintf( $this->lang->words['cdn_active'], $credit ); - -$HTML .= << -

    {$this->lang->words['enhancements_ipscdn']}

    - - - -
    - {$message} -
    - -

    - -EOF; - -$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' ); -$file = new $classToLoad(); - -$HTML .= $file->getFileContents( "http://www.invisionpower.com/clients/interface/ipscdnstats.php?key={$this->settings['ipb_reg_number']}" ); - -return $HTML; -} - -/** - * Windows Live Setup - * - * @return @e string HTML - */ -public function windowsLiveSetup( $settings ) -{ - -$step1 = sprintf( $this->lang->words['wl_1'], "{$this->lang->words['wl_1b']}", "{$this->settings['board_url']}/interface/board/live.php" ); - -$form['client_id'] = $this->registry->output->formInput( 'client_id', $settings['client_id'] ); -$form['client_secret'] = $this->registry->output->formInput( 'client_secret', $settings['client_secret'] ); -$form['xml'] = $this->registry->output->formInput( 'xml', $settings['xml'], '', 80 ); - -$HTML = ''; - -$HTML .= << -

    {$this->lang->words['enhancements_windowslive']}

    - - -EOF; - -if ( $settings['enabled'] ) -{ - $HTML .= << - - -EOF; -} - -$HTML .= <<{$step1} -
    -
    -
    -

    {$this->lang->words['wl_2']}

    - - - - - - - - - -
    - {$this->lang->words['wl_2b']} - - {$form['client_id']} -
    - {$this->lang->words['wl_2c']} - - {$form['client_secret']} -
    -
    - -
    -
    -
    -
    - -
    {$this->lang->words['wl_3']}
    -
    -
    -
    -

    {$this->lang->words['wl_3b']}

    - - - - - -
    - {$this->lang->words['wl_3b']} - - {$form['xml']} -
    -
    - -
    -
    -
    - -EOF; - -return $HTML; -} - - + + * Invision Power Services + * IP.Board v3.4.6 + * Applications skin file + * Last Updated: $Date: 2013-05-28 10:00:25 -0400 (Tue, 28 May 2013) $ + * + * + * @author $Author: AndyMillne $ + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license http://www.invisionpower.com/company/standards.php#license + * @package IP.Board + * @subpackage Core + * @link http://www.invisionpower.com + * @since Friday 19th May 2006 17:33 + * @version $Revision: 12273 $ + */ + +class cp_skin_applications +{ + /** + * Registry Object Shortcuts + * + * @var $registry + * @var $DB + * @var $settings + * @var $request + * @var $lang + * @var $member + * @var $memberData + * @var $cache + * @var $caches + */ + protected $registry; + protected $DB; + protected $settings; + protected $request; + protected $lang; + protected $member; + protected $memberData; + protected $cache; + protected $caches; + + /** + * Constructor + * + * @param object $registry Registry object + * @return @e void + */ + public function __construct( ipsRegistry $registry ) + { + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->member = $this->registry->member(); + $this->memberData =& $this->registry->member()->fetchMemberData(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + $this->lang = $this->registry->class_localization; + } +/** + * Add/edit module form + * + * @param array Form elements + * @param string Form title + * @param string Action code + * @param string Button text + * @param array Module information + * @param array Application information + * @return string HTML + */ +public function module_form( $form, $title, $formcode, $button, $module, $application ) { + +$IPBHTML = ""; +//--starthtml--// + +$title = $formcode == 'module_edit_do' ? $this->lang->words['module_form_edit_title'] : $this->lang->words['module_form_add_title']; + +$IPBHTML .= << +

    {$title}

    + + +
    form_code}&do={$formcode}&app_id={$application['app_id']}&sys_module_id={$module['sys_module_id']}' method='POST'> +
    +

    {$this->lang->words['a_modules']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + +EOF; +if ( IN_DEV ) +{ +$IPBHTML .= << + + + +EOF; +} +$IPBHTML .= << +
    + +
    + + +EOF; + +//--endhtml--// +return $IPBHTML; +} + +/** + * List the modules + * + * @param array Modules + * @param array Application + * @param boolean Is an admin module? + * @return string HTML + */ +public function modules_list( $modules, $application, $sys_module_admin=true ) { + +$IPBHTML = ""; +//--starthtml--// + +$_type = ( $sys_module_admin ) ? strtolower( $this->lang->words['a_admin'] ) : strtolower( $this->lang->words['a_public'] ); + +$IPBHTML .= << +

    {$_type} {$application['app_title']} {$this->lang->words['a_modules']}

    + + + + +
    +

    {$application['app_title']} > {$_type} {$this->lang->words['a_modules']}

    +
    + {$this->lang->words['a_modtype']} + + {$form['sys_module_admin']} +
    + {$this->lang->words['a_modtitle']} + + {$form['sys_module_title']} +
    + {$this->lang->words['a_moddesc']} + + {$form['sys_module_description']} +
    + {$this->lang->words['a_modkey']} + + {$form['sys_module_key']}
    + {$this->lang->words['a_modkey_info']} +
    + {$this->lang->words['a_modver']} + + {$form['sys_module_version']}
    + {$this->lang->words['a_modver_info']} +
    + {$this->lang->words['a_moden']} + + {$form['sys_module_visible']}
    + {$this->lang->words['a_moden_info']} +
    + {$this->lang->words['a_modprot']} + + {$form['sys_module_protected']}
    + {$this->lang->words['a_modprot_info']} +
    +EOF; + +if( count( $modules ) ) +{ + foreach( $modules as $module ) + { + $IPBHTML .= << + + + + + + +EOF; + } +} +else +{ + $IPBHTML .= << + + +EOF; +} + +$IPBHTML .= << + +
    + + +
    form_code}&do=module_import' enctype='multipart/form-data' method='post'> +
    +

    {$this->lang->words['a_importxml']}

    + +
    +
     
    +
    + + + form_code}&do=module_edit&sys_module_id={$module['sys_module_id']}&app_id={$application['app_id']}&sys_module_admin=$sys_module_admin'>{$module['sys_module_title']} +EOF; + if( $module['sys_module_description'] ) + { + $IPBHTML .= <<{$module['sys_module_description']} +EOF; + } + + $IPBHTML .= << + + {$module['sys_module_version']} + + + +EOF; + if ( $module['sys_module_protected'] != 1 OR IN_DEV ) + { + $IPBHTML .= << +
  • + form_code}&do=module_edit&sys_module_id={$module['sys_module_id']}&app_id={$application['app_id']}&sys_module_admin=$sys_module_admin' title='{$this->lang->words['a_editmod']}'>{$this->lang->words['a_editmod']} +
  • +
  • + form_code}&do=module_remove&sys_module_id={$module['sys_module_id']}&app_id={$application['app_id']}&sys_module_admin=$sys_module_admin");' title='{$this->lang->words['a_removemod']}'>{$this->lang->words['a_removemod']} +
  • + +EOF; + } + else + { + $IPBHTML .= <<{$this->lang->words['a_protectedmod']}--> +EOF; + } + + $IPBHTML .= << +
    + {$this->lang->words['a_nomods']} +
    + + + + + + + + +
    {$this->lang->words['a_uploadxml']}
    {$this->lang->words['a_uploadxml_info']}
    {$this->lang->words['a_filexml']}
    {$this->lang->words['a_filexml_info']}
    + +
    + +
    +
    + +EOF; + +//--endhtml--// +return $IPBHTML; +} + +/** + * Form to add/edit an application + * + * @param array Form elements + * @param string Form title + * @param string Action code + * @param string Button text + * @param array Application information + * @param string Default TAB to open on page load + * @return string HTML + */ +public function application_form( $form, $title, $formcode, $button, $application, $defaultTab='' ) { + +$IPBHTML = ""; +//--starthtml--// + +$defaultTab = $defaultTab ? $defaultTab : 'information'; + +$IPBHTML .= << +

    {$this->lang->words['a_apps']}

    + + +
    form_code}do={$formcode}&app_id={$application['app_id']}' method='POST'> +
    +

    {$title}

    + +
    +
      +
    • {$this->lang->words['app_tab_info']}
    • +
    • {$this->lang->words['app_tab_permissions']}
    • +
    • {$this->lang->words['app_tab_gcaches']}
    • +
    +
    + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +EOF; + if ( IN_DEV ) + { + $IPBHTML .= << + + + +EOF; + } + +$IPBHTML .= << + + + + + + + +
    + {$this->lang->words['a_apptitle']} + + {$form['app_title']} +
    + {$this->lang->words['a_appptitle']} + + {$form['app_public_title']}
    + {$this->lang->words['a_appptitle_info']} +
    + {$this->lang->words['a_appen']} + + {$form['app_enabled']} +
    + {$this->lang->words['a_appdesc']} + + {$form['app_description']} +
    + {$this->lang->words['a_appauthor']} + + {$form['app_author']} +
    + {$this->lang->words['a_appver']} + + {$form['app_version']} +
    + {$this->lang->words['a_appdir']} + + {$form['app_directory']}
    + {$this->lang->words['a_appdir_info']} +
    + {$this->lang->words['a_appprot']} + + {$form['app_protected']}
    + {$this->lang->words['a_appprot_info']} +
    + {$this->lang->words['a_hooksite']} + + {$form['app_website']}
    + {$this->lang->words['a_hooksite_info']} +
    + {$this->lang->words['a_hookurl']} + + {$form['app_update_check']}
    + {$this->lang->words['a_appurl_info']} +
    +
    + + +
    + + + + + + + + + +
    + {$this->lang->words['a_appphide']} + + {$form['app_hide_tab']}
    + {$this->lang->words['a_appphide_desc']} +
    + {$this->lang->words['app_form_tabgroups']} + + {$form['app_tab_groups']}
    + {$this->lang->words['app_form_tabgroups_desc']} +
    +
    + + +
    + + + + + +
    + {$this->lang->words['hook_form_caches']} + + {$form['app_global_caches']}
    + {$this->lang->words['hook_form_caches_desc']} +
    +
    + + +
    +
    + +
    +
    +
    +EOF; + +//--endhtml--// +return $IPBHTML; +} + + + +/** + * List the applications + * + * @param array Application + * @param array Uninstalled applications + * @return string HTML + */ +public function applications_list( $applications, $uninstalled=array(), $message=NULL ) { + +$IPBHTML = ""; +//--starthtml--// + +$canInstall = $this->registry->class_permissions->checkPermission( 'app_install' ); + +$IPBHTML .= << +

    {$this->lang->words['a_apps']}

    + +
    + +
    + + +EOF; + +if ( $message ) +{ + $IPBHTML .= "
    {$message}

    "; +} + +$IPBHTML .= << +
    +

    {$this->lang->words['a_installedapps']}

    + +
    + « + » +
      +
    • {$this->lang->words['a_apps_enabled']}
    • +
    • {$this->lang->words['a_apps_disabled']}
    • +
    +
    + +
    + +
    + + + + + + + + + +EOF; + + if ( count( $applications['enabled'] ) ) + { + foreach( $applications['enabled'] as $app ) + { + $img = is_file( IPSLib::getAppDir( $app['app_directory'] ) . '/skin_cp/appIcon.png' ) ? $this->settings['base_acp_url'] . '/' . IPSLib::getAppFolder( $app['app_directory'] ) . '/' . $app['app_directory'] . '/skin_cp/appIcon.png' : "{$this->settings['skin_acp_url']}/images/applications/{$app['app_directory']}.png"; + + # IPS app? + $app['titlePrefix'] = in_array( $app['app_location'], array( 'root', 'ips' ) ) ? "{$this->lang->words['gl_ipsapp']}  " : ''; + + # Sort title + $app['app_title'] = IN_DEV ? "form_code}do=application_edit&app_id={$app['app_id']}'>{$app['app_title']}" : $app['app_title']; + $app['app_description'] = $app['app_description'] ? "
    {$app['app_description']}" : ''; + + # Tab Restrictions + $app['_tab_restricted'] = ( $app['app_hide_tab'] || IPSText::cleanPermString($app['app_tab_groups']) ) ? "form_code}do=application_edit&app_id={$app['app_id']}&_tab=restrictions' title='{$this->lang->words['a_edit_restrictions']}'>" : ''; + + # Update available? + if( $app['app_update_available'][0] ) + { + $_update = "{$this->lang->words['hook_update_available']}"; + + if ( !empty($app['app_update_available'][1]) ) + { + $_update = "{$_update}"; + } + elseif( $app['app_website'] ) + { + $_update = "{$_update}"; + } + + $app['_updated'] = $_update; + } + elseif ( isset( $app['_long_version'] ) && $app['_long_version'] > $app['_long_current'] ) + { + $app['_updated'] = "{$this->lang->words['a_upgradeavail']}"; + } + else + { + $app['_updated'] = "{$this->lang->words['a_oh_kay']}"; + } + +if ( $app['app_directory'] == 'core' ) +{ + $IPBHTML .= << + +EOF; +} +else +{ + $IPBHTML .= << + +EOF; +} + +$IPBHTML .= << + + + + + + + +EOF; + } + } + else + { + $IPBHTML .= << + + +EOF; + } + +$IPBHTML .= << + + + +
    +
      {$this->lang->words['a_hookapp']}{$this->lang->words['app_tab_permissions']}{$this->lang->words['a_lastupdated']} 
      +   + + {$app['titlePrefix']}{$app['app_title']}  v{$app['_human_current']} + {$app['app_description']} + {$app['_tab_restricted']}{$app['_updated']} + + +
    {$this->lang->words['a_noapps_enabled']}
    + + + + + + + + +EOF; + + if ( count( $applications['disabled'] ) ) + { + foreach( $applications['disabled'] as $app ) + { + $img = is_file( IPSLib::getAppDir( $app['app_directory'] ) . '/skin_cp/appIcon.png' ) ? $this->settings['base_acp_url'] . '/' . IPSLib::getAppFolder( $app['app_directory'] ) . '/' . $app['app_directory'] . '/skin_cp/appIcon.png' : "{$this->settings['skin_acp_url']}/images/applications/{$app['app_directory']}.png"; + + # IPS app? + $app['titlePrefix'] = in_array( $app['app_location'], array( 'root', 'ips' ) ) ? "{$this->lang->words['gl_ipsapp']}  " : ''; + + # Sort title + $app['app_title'] = IN_DEV ? "form_code}do=application_edit&app_id={$app['app_id']}'>{$app['app_title']}" : $app['app_title']; + $app['app_description'] = $app['app_description'] ? "
    {$app['app_description']}" : ''; + + # Tab Restrictions + $app['_tab_restricted'] = ( $app['app_hide_tab'] || IPSText::cleanPermString($app['app_tab_groups']) ) ? "form_code}do=application_edit&app_id={$app['app_id']}&_tab=restrictions' title='{$this->lang->words['a_edit_restrictions']}'>" : ''; + + # Update available? + if( $app['app_update_available'][0] ) + { + $_update = "{$this->lang->words['hook_update_available']}"; + + if ( !empty($app['app_update_available'][1]) ) + { + $_update = "{$_update}"; + } + elseif( $app['app_website'] ) + { + $_update = "{$_update}"; + } + + $app['_updated'] = $_update; + } + elseif ( isset( $app['_long_version'] ) && $app['_long_version'] > $app['_long_current'] ) + { + $app['_updated'] = "{$this->lang->words['a_upgradeavail']}"; + } + else + { + $app['_updated'] = "{$this->lang->words['a_oh_kay']}"; + } + + $IPBHTML .= << + + + + + + + +EOF; + } + } + else + { + $IPBHTML .= << + + +EOF; + } + +$IPBHTML .= << + + + + + + + +
    +EOF; + +if ( is_array( $uninstalled ) AND count( $uninstalled ) ) +{ +$IPBHTML .= << +

    {$this->lang->words['a_unapps']}

    +
      {$this->lang->words['a_hookapp']}{$this->lang->words['app_tab_permissions']}{$this->lang->words['a_lastupdated']} 
      + + + {$app['titlePrefix']}{$app['app_title']}  v{$app['_human_current']} + {$app['app_description']} + {$app['_tab_restricted']}{$app['_updated']} + + +
    {$this->lang->words['a_noapps_disabled']}
    +EOF; + +foreach( $uninstalled as $app ) +{ + if ( strstr( $app['path'], 'applications_addon/ips' ) ) + { + $app['_location'] = 'ips'; + $img = ""; + } + else if ( strstr( $app['path'], 'applications_addon/other' ) ) + { + $app['_location'] = 'other'; + $img = ''; + } + else + { + $app['_location'] = 'root'; + $img = ""; + } + + if ( $app['okToGo'] ) + { + $warning = ''; + $install = <<{$this->lang->words['a_install']} +EOF; + } + else + { + $install = "{$this->lang->words['a_cannotinstall']}"; + $warning = <<{$this->lang->words['a_cantinstall_info']} +EOF; + } + +$install = $canInstall ? $install : ''; + +$IPBHTML .= << + + + + +EOF; +} + +$IPBHTML .= << + +EOF; +} + +if( + ( !IPSLib::appIsInstalled('nexus', false) AND !isset($uninstalled['nexus']) ) OR + ( !IPSLib::appIsInstalled('blog', false) AND !isset($uninstalled['blog']) ) OR + ( !IPSLib::appIsInstalled('gallery', false) AND !isset($uninstalled['gallery']) ) OR + ( !IPSLib::appIsInstalled('ccs', false) AND !isset($uninstalled['ccs']) ) OR + ( !IPSLib::appIsInstalled('downloads', false) AND !isset($uninstalled['downloads']) ) OR + !$this->settings['ips_cp_purchase'] ) +{ + $IPBHTML .= << +
    +
    + {$img} + + {$app['title']}
    + {$app['author']} + {$warning} +
    + {$install} +
    +EOF; + foreach( array('nexus','blog','gallery','ccs','downloads') as $__app ) + { + if( !IPSLib::appIsInstalled( $__app, false ) AND !isset($uninstalled[ $__app ]) ) + { + $_app_name = $__app == 'ccs' ? 'Content' : ucfirst($__app); + + $IPBHTML .= << + + + +EOF; + } + } + + if( !$this->settings['ips_cp_purchase'] ) + { + $IPBHTML .= << + + + +EOF; + } + + $IPBHTML .= << + +EOF; +} + +$IPBHTML .= << +EOF; + +//--endhtml--// +return $IPBHTML; +} +/** + * Show the application details + * + * @param array $appData Application data + * @param array $history Upgrade data + * @param array $hooks Hooks data + * @return @e string HTML + */ +public function application_details( $appData, $history, $hooks=array() ) +{ +$HTML = ''; + +$defaultTab = 'tab_appHistory'; #Default tab is history, if we have hooks later switch to them + +/* Menu */ +$HTML .= << +

    {$this->lang->words['a_app_details']}

    +EOF; + +if ( !in_array( $appData['app_directory'], array( 'core', 'forums', 'members' ) ) ) +{ + $HTML .= << +
    + + + IP.{$_app_name} +
    + + + Copyright Removal +
    +EOF; + + if( $appData['app_description'] ) + { + $HTML .= << + + +EOF; + } + + +$appData['app_public_title'] = $appData['app_public_title'] ? $appData['app_public_title'] : '--'; + +$HTML .= << + + + + + + + + + + + +EOF; + + if( $appData['app_website'] ) + { + $HTML .= << + + + +EOF; + } + + /* Update available? */ + if( $appData['app_update_available'][0] ) + { + $appData['_updated'] = "{$this->lang->words['hook_update_available']}"; + + if ( !empty($appData['app_update_available'][1]) ) + { + $appData['_updated'] = "{$appData['_updated']}"; + } + elseif( $appData['app_website'] ) + { + $appData['_updated'] = "{$appData['_updated']}"; + } + } + elseif ( isset( $appData['_long_version'] ) && $appData['_long_version'] > $appData['_long_current'] ) + { + $appData['_updated'] = "{$this->lang->words['a_upgradeavail']}"; + } + + $HTML .= << + + + + + + + +EOF; + + if ( $appData['app_global_caches'] ) + { + $cachesCount = count( explode(',', $appData['app_global_caches']) ); + + $HTML .= << + + + +EOF; + } + + $HTML .= << + +
    +
    +

    {$this->lang->words['a_other_details']}

    + +
    + « + » +
      +
    • {$this->lang->words['a_related_hooks']}
    • +
    • {$this->lang->words['a_upgrade_history']}
    • +
    +
    + +
    + +
    +
    {$appData['app_description']}
    + {$this->lang->words['a_appptitle']} + + {$appData['app_public_title']} +
    + {$this->lang->words['a_appver']} + + {$appData['app_version']} ({$appData['app_long_version']}) +
    + {$this->lang->words['a_appauthor']} + + {$appData['app_author']} +
    + {$this->lang->words['a_hooksite']} + + {$appData['app_website']} +
    + {$this->lang->words['a_installed_on']} + + {$appData['_installed']} +
    + {$this->lang->words['a_lastupdated']} + + {$appData['_updated']} +
    + {$this->lang->words['hook_globalcaches']} + + {$cachesCount}  ( {$appData['app_global_caches']} ) +
    +EOF; + + if( count( $hooks ) ) + { + $defaultTab = 'tab_appHooks'; + $warningBadge = "{$this->lang->words['hook_badge_warning']} "; + + foreach( $hooks as $r ) + { + $statusBadge = $r['hook_enabled'] ? "{$this->lang->words['a_apps_enabled']}" : "{$this->lang->words['a_apps_disabled']} "; + $_warning = count($r['_require_errors']) ? "{$warningBadge}" : ''; + + $HTML .= << + + + + + +EOF; + } + } + else + { + $HTML .= << + + +EOF; + } + + $HTML .= << + + +
    +
    + {$statusBadge} + + {$_warning}{$r['hook_name']}  v{$r['hook_version_human']} + {$r['hook_author']} + +
    {$this->lang->words['a_no_related_hooks']}
    +EOF; + +foreach( $history as $upgradeRow ) +{ + $upgradeRow['_date'] = $this->lang->getDate( $upgradeRow['upgrade_date'], 'SHORT' ); + + $HTML .= << + + + + +EOF; +} + +$HTML .= << + + + + + +EOF; + +return $HTML; +} + +/** + * Splash screen to remove an application + * + * @param array Application + * @return string HTML + */ +public function application_remove_splash( $data ) +{ +return << +

    {$this->lang->words['a_remove']} {$data['app_title']} {$this->lang->words['a_app']}

    +
    {$upgradeRow['_date']}{$upgradeRow['upgrade_version_human']} ({$upgradeRow['upgrade_version_id']}){$upgradeRow['upgrade_notes']}
    + + + + + + + + + + + + + + +
    {$this->lang->words['a_currentver']}{$data['app_version']}
    {$this->lang->words['a_author']}{$data['app_author']}
    {$this->lang->words['a_warning']}
    {$this->lang->words['a_warning_info']}
    + +
    +EOF; +} + +/** + * List the hooks + * + * @param array $hooksFound A list of the current enbled/disabled hooks + * @param integer $warnings Number of enabled hooks with warnings + * @param string $message Message to display + * @return @e string HTML + */ +public function hooksOverview( $hooksFound, $warnings, $message ) +{ +$HTML = ""; + +/* Sort out some data */ +$warningBadge= "{$this->lang->words['hook_badge_warning']} "; +$updateBadge = "{$this->lang->words['hook_update_available']}"; +$cache = $this->cache->getCache('disabledHooksCache'); + + +$HTML .= << + + + +EOF; + +if ( $message ) +{ + $HTML .= "
    {$message}

    "; +} + +/* Got warnings? */ +if( $warnings > 0 ) +{ + $_text = ( $warnings == 1 ) ? $this->lang->words['hook_overview_warning'] : sprintf( $this->lang->words['hook_overview_warnings'], $warnings ); + + $HTML .= '
    ' . $this->registry->output->global_template->warning_box( $_text ) . '
    '; +} + +$HTML .= << +

    {$this->lang->words['a_installedhooks']}

    + +
    + « + » +
      +
    • {$this->lang->words['a_apps_enabled']}
    • +
    • {$this->lang->words['a_apps_disabled']}
    • +
    +
    + +
    + +
    + + + + + + + + +EOF; + + if( count( $hooksFound['installed'] ) ) + { + foreach( $hooksFound['installed'] as $r ) + { + $HTML .= << + + + + + +EOF; + } + } + else + { + $HTML .= << + + +EOF; + } + + $HTML .= << + + + + +
    +
     {$this->lang->words['a_hook']}{$this->lang->words['a_author']}{$this->lang->words['a_lastupdated']} 
    +   + +EOF; + + $_warning = count($r['_require_errors']) ? "form_code}do=check_requirements&id={$r['hook_id']}'>{$warningBadge}" : ''; + + $r['hook_name'] = IN_DEV ? "form_code}do=edit_hook&id={$r['hook_id']}'>{$r['hook_name']}" : $r['hook_name']; + + $HTML .= "{$_warning}{$r['hook_name']}  v{$r['hook_version_human']}"; + + if( $r['hook_desc'] ) + { + $HTML .= "
    {$r['hook_desc']}"; + } + + /* Update available? */ + if( $r['hook_update_available'][0] ) + { + $r['_updated'] = $updateBadge; + + if ( !empty($r['hook_update_available'][1]) ) + { + $r['_updated'] = "{$r['_updated']}"; + } + elseif( $r['hook_website'] ) + { + $r['_updated'] = "{$r['_updated']}"; + } + } + + $HTML .= << +
    + {$r['hook_author']} + + {$r['_updated']} + + + + +
    {$this->lang->words['a_nohooks']}
    + + + + + + + +EOF; + + if( count( $hooksFound['uninstalled'] ) ) + { + foreach( $hooksFound['uninstalled'] as $r ) + { + $HTML .= << + + +EOF; + + /* Update available? */ + if( $r['hook_update_available'][0] ) + { + $r['_updated'] = $updateBadge; + + if ( !empty($r['hook_update_available'][1]) ) + { + $r['_updated'] = "{$r['_updated']}"; + } + elseif( $r['hook_website'] ) + { + $r['_updated'] = "{$r['_updated']}"; + } + } + + $HTML .= <<{$r['_updated']} + + +EOF; + } + } + else + { + $HTML .= << + + +EOF; + } + + $HTML .= << + + + + +EOF; + +return $HTML; +} + + +/** + * Form to add/edit a hook + * + * @param array Form elements + * @param string Action code + * @param array Hook data + * @param array Files in this hook + * @return string HTML + */ +public function hookForm( $form, $action, $hookData, $files=array(), $requirements=array() ) +{ + +/* Hook types */ +$hookTypes = array( array( 0, $this->lang->words['a_selectone'] ), + array( 'commandHooks', $this->lang->words['a_aoverloader'] ), + array( 'skinHooks', $this->lang->words['a_soverloader'] ), + array( 'templateHooks', $this->lang->words['a_templatehook'] ), + array( 'dataHooks', $this->lang->words['a_datahook'] ), + array( 'libraryHooks', $this->lang->words['a_libraryhook'] ) + ); + +/* Get apps to use for library hooks */ +$appsArray = array( array( 0, $this->lang->words['a_selectone'] ) ); + +foreach( ipsRegistry::$applications as $dir => $appdata ) +{ + $appsArray[] = array( $dir, $appdata['app_title'] ); +} + +$_removeInDev = IN_DEV ? '' : 'display: none;'; + +$HTML .= << +

    {$this->lang->words['a_setuphook']}

    + + + +
    form_code}' id='mainform'> + + + + +
    +

    {$this->lang->words['a_setuphook']}

    + +
    + « + » +
      +
    • {$this->lang->words['hook_form_info']}
    • +
    • {$this->lang->words['a_hookrequirements']}
    • +
    • {$this->lang->words['hook_globalcaches']}
    • +
    • {$this->lang->words['a_hookfiles']}
    • +
    +
    + +
    + + +
    +
     {$this->lang->words['a_hook']}{$this->lang->words['a_author']}{$this->lang->words['a_uptodate']} 
      +EOF; + + $_warning = count($r['_require_errors']) ? "form_code}do=check_requirements&id={$r['hook_id']}'>{$warningBadge}" : ''; + + $r['hook_name'] = IN_DEV ? "form_code}&do=edit_hook&id={$r['hook_id']}'>{$r['hook_name']}" : $r['hook_name']; + + $HTML .= "{$_warning}{$r['hook_name']}  v{$r['hook_version_human']}"; + + if( $r['hook_desc'] ) + { + $HTML .= <<{$r['hook_desc']} +EOF; + } + + $HTML .= << + {$r['hook_author']} + + + +
    {$this->lang->words['a_nodishooks']}
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
     
    + {$this->lang->words['hook_form_title']} + + {$form['hook_name']}
    + {$this->lang->words['hook_form_title_help']} +
    + {$this->lang->words['hook_form_desc']} + + {$form['hook_desc']}
    + {$this->lang->words['hook_form_desc_help']} +
    + {$this->lang->words['hook_form_key']} + + {$form['hook_key']}
    + {$this->lang->words['hook_form_key_desc']} +
    + {$this->lang->words['hook_form_version']} + + {$form['hook_version_human']}
    + {$this->lang->words['hook_form_version_help']} +
    + {$this->lang->words['a_hookversion']} + + {$form['hook_version_long']}
    + {$this->lang->words['a_hookversion_info']} +
    + {$this->lang->words['a_hookauthor']} + + {$form['hook_author']}
    + {$this->lang->words['a_hookauthor_info']} +
    + {$this->lang->words['a_hookemail']} + + {$form['hook_email']}
    + {$this->lang->words['a_hookemail_info']} +
    + {$this->lang->words['a_hooksite']} + + {$form['hook_website']}
    + {$this->lang->words['a_hooksite_info']} +
    + {$this->lang->words['a_hookurl']} + + {$form['hook_update_check']}
    + {$this->lang->words['a_hookurl_info']} +
    +
    + + +
    + + + + + + + + +EOF; + + $latestReqIndex = 0; + + if( is_array( $requirements ) && count( $requirements ) ) + { + foreach( $requirements as $appKey => $require ) + { + if ( is_array( $require['_versions'] ) ) + { + $_requiredApp = $this->registry->output->formDropdown( "requireApp[{$latestReqIndex}]", $appsArray, $appKey, '', "onchange='getAppVersions({$latestReqIndex})'" );/*noLibHook*/ + $_minVersions = $this->registry->output->formDropdown( "minVersion[{$latestReqIndex}]", $require['_versions'], $require['min_version'] ); + $_maxVersions = $this->registry->output->formDropdown( "maxVersion[{$latestReqIndex}]", $require['_versions'], $require['max_version'] ); + + $HTML .= << + + + + + + +EOF; + + $latestReqIndex++; + } + } + } + + $HTML .= << + +
    + +
    + + + +
    +
    {$this->lang->words['a_phpver']}
    + {$this->lang->words['a_phpver']} + + {$this->lang->words['a_min']}: {$form['hook_php_version_min']}

    + {$this->lang->words['a_max']}: {$form['hook_php_version_max']}
    + {$this->lang->words['a_enterzero']} {$this->lang->words['a_phpminmax']} +
    {$this->lang->words['hook_require_apptitle']}{$this->lang->words['hook_remove_requirement']}
    + {$this->lang->words['hook_require_apptitle']} + + {$_requiredApp}

    + + {$this->lang->words['a_min']}: {$_minVersions}

    + {$this->lang->words['a_max']}: {$_maxVersions} +
    +
    + + + + + + + +
    {$this->lang->words['hook_globalcaches']}
    + {$this->lang->words['hook_form_caches']} + + {$form['hook_global_caches']}
    + {$this->lang->words['hook_form_caches_desc']} +
    +
    + + +
    + +EOF; + + $latestIndex = 0; + + if( count( $files ) ) + { + foreach( $files as $index => $file ) + { + $latestIndex = $index > $latestIndex ? $index : $latestIndex; + + $HTML .= << +
    + + + + +EOF; + +if( IN_DEV ) +{ +$HTML .= << + + + + + + + +EOF; +} +else +{ +$HTML .= << + + +EOF; +} + +$_hookTypes = $this->registry->output->formDropdown( "hook_type[{$index}]", $hookTypes, $file['hook_type'], "hook_type[{$index}]", "onchange='selectHookType({$index});'" ); + + $HTML .= << + + + +EOF; + if( $file['hook_type'] == 'dataHooks' ) + { + $HTML .= << + + + +EOF; + } + else if( $file['hook_type'] == 'libraryHooks' ) + { + $_applications = $this->registry->output->formDropdown( "libApplication[{$index}]", $appsArray, $file['hook_data']['libApplication'] ); + + $HTML .= << + + + + + + + +EOF; + } + else if( $file['hook_type'] != 'templateHooks' ) + { + $HTML .= << + + + +EOF; + } + else + { + $HTML .= << + + + + + + + + + + + + + + + + + + + +EOF; + } + + $HTML .= << + + +EOF; + } + } + $HTML .= << + +
    + +
    + + + + + +
    + +
    + + +EOF; + +return $HTML; +} + +/** + * Show the hook details + * + * @param array Hook data + * @param array Files in this hook + * @return string HTML + */ +public function hookDetails( $hookData, $files=array() ) +{ +$HTML = ''; + +/* Menu */ +$HTML .= << +

    {$this->lang->words['hook_view_details']}

    + + + +
    + +
    +

    {$hookData['hook_name']}

    +
    {$this->lang->words['a_hookfile']} #{$index}{$this->lang->words['hook_remove_file']}
    + {$this->lang->words['a_filenamedir']} + + +
    + {$this->lang->words['a_fileclassname']} + + +
    + + +
    + {$this->lang->words['a_filehooktype']} + + {$_hookTypes} +
    + {$this->lang->words['a_datalocation']} + + {$file['_dataLocationDropdown']} +
    + {$this->lang->words['a_classextend']} + + +
    + {$this->lang->words['a_hookapp']} + + {$_applications} +
    + {$this->lang->words['a_classextend']} + + +
    + {$this->lang->words['a_skingroup']} + + {$file['_skinDropdown']} +
    + {$this->lang->words['a_skinfunc']} + + {$file['_templateDropdown']} +
    + {$this->lang->words['a_typeoftemp']} + + {$file['_hookTypeDropdown']} +
    + {$this->lang->words['a_hookid']} + + {$file['_hookIdsDropdown']} +
    + {$this->lang->words['a_hookloc']} + + {$file['_hookEPDropdown']} +
    +EOF; + + if( $hookData['hook_desc'] ) + { + $HTML .= << + + +EOF; + } + +$HTML .= << + + + + + + + +EOF; + + if( $hookData['hook_email'] ) + { + $HTML .= << + + + +EOF; + } + + if( $hookData['hook_website'] ) + { + $HTML .= << + + + +EOF; + } + + /* Update available? */ + if( $hookData['hook_update_available'][0] ) + { + $hookData['_updated'] = "{$this->lang->words['hook_update_available']}"; + + if ( !empty($hookData['hook_update_available'][1]) ) + { + $hookData['_updated'] = "{$hookData['_updated']}"; + } + elseif( $hookData['hook_website'] ) + { + $hookData['_updated'] = "{$hookData['_updated']}"; + } + } + + $HTML .= << + + + + + + +EOF; + + if ( $hookData['hook_global_caches'] ) + { + $cachesCount = count( explode(',', $hookData['hook_global_caches']) ); + + $HTML .= << + + + +EOF; + } + + $HTML .= << + +
    +
    +

    {$this->lang->words['a_fileuses']}

    +
    {$hookData['hook_desc']}
    + {$this->lang->words['a_hookver']} + + {$hookData['hook_version_human']} +
    + {$this->lang->words['a_hookauthor']} + + {$hookData['hook_author']} +
    + {$this->lang->words['a_hookemail']} + + {$hookData['hook_email']} +
    + {$this->lang->words['a_authorsite']} + + {$hookData['hook_website']} +
    + {$this->lang->words['a_lastupdated']} + + {$hookData['_updated']} +
    + {$this->lang->words['a_hookrequirements']} + +EOF; + + $HTML .= ( is_array($hookData['_require_errors']) && count($hookData['_require_errors']) ) ? "form_code}do=check_requirements&id={$hookData['hook_id']}'>{$this->lang->words['hook_require_error']}" : "{$this->lang->words['hook_require_ok']}"; + + $HTML .= << +
    + {$this->lang->words['hook_globalcaches']} + + {$cachesCount}  ( {$hookData['hook_global_caches']} ) +
    + + + + + + +EOF; + + foreach( $files as $index => $data ) + { + $showsAt = ""; + + if( $data['hook_type'] == 'templateHooks' ) + { + $showsAt = $this->lang->words['a_showsin'] . $data['hook_data']['skinGroup'] . ' -> ' . $data['hook_data']['skinFunction'] . ' '; + + if( $data['hook_data']['type'] == 'if' ) + { + switch( $data['hook_data']['position'] ) + { + case 'pre.startif': + $showsAt .= $this->lang->words['a_prestartif']; + break; + + case 'post.startif': + $showsAt .= $this->lang->words['a_poststartif']; + break; + + case 'pre.else': + $showsAt .= $this->lang->words['a_preelse']; + break; + + case 'post.else': + $showsAt .= $this->lang->words['a_postelse']; + break; + + case 'pre.endif': + $showsAt .= $this->lang->words['a_preendif']; + break; + + case 'post.endif': + $showsAt .= $this->lang->words['a_postendif']; + break; + } + } + else + { + switch( $data['hook_data']['position'] ) + { + case 'outer.pre': + $showsAt .= $this->lang->words['a_outerpre']; + break; + + case 'inner.pre': + $showsAt .= $this->lang->words['a_innerpre']; + break; + + case 'inner.post': + $showsAt .= $this->lang->words['a_innerpost']; + break; + + case 'outer.post': + $showsAt .= $this->lang->words['a_outerpost']; + break; + } + } + + $showsAt .= $this->lang->words['a_labeled'] . $data['hook_data']['id']; + } + elseif ( $data['hook_type'] == 'libraryHooks' ) + { + $showsAt = sprintf( $this->lang->words['a_libraryhookfor'], $data['hook_data']['classToOverload'], $data['hook_data']['libApplication'] ); + } + elseif ( $data['hook_type'] == 'dataHooks' ) + { + $showsAt = $this->lang->words['a_datahookfor'] . $data['hook_data']['dataLocation']; + } + else + { + $showsAt = $this->lang->words['a_willoverload'] . $data['hook_data']['classToOverload']; + } + + switch( $data['hook_type'] ) + { + case 'templateHooks': + $hookType = $this->lang->words['a_templatehook']; + break; + case 'commandHooks': + $hookType = $this->lang->words['a_aoverloader']; + break; + case 'skinHooks': + $hookType = $this->lang->words['a_soverloader']; + break; + case 'libraryHooks': + $hookType = $this->lang->words['a_libraryhook']; + break; + case 'dataHooks': + $hookType = $this->lang->words['a_datahook']; + break; + } + + $HTML .= << + + + + + +EOF; + } + $HTML .= << + +EOF; + +return $HTML; +} + +/** + * Show the hook requirements + * + * @param array Hook data + * @param array Array of errors found + * @param array Array of the app versions + * @return string HTML + */ +public function hookRequirements( $hookData, $errors, $versions=array() ) +{ +$HTML = ''; + +/* Let's sort out the badges... */ +$forceEnable = empty($this->request['fromInstall']) ? '' : '&skipRequirements=1'; +$_goodBadge = "{$this->lang->words['hook_require_ok']}"; +$_errorBadge = "{$this->lang->words['hook_require_error']}"; + +/* Menu */ +$HTML .= << +

    {$this->lang->words['a_hookrequirements']}

    + + + +
    +EOF; + +/* Check if we got any requirements... */ +if ( !$hookData['hook_requirements']['hook_php_version_min'] && !$hookData['hook_requirements']['hook_php_version_min'] && ( ( !is_array($hookData['hook_requirements']['required_applications']) || !count($hookData['hook_requirements']['required_applications']) ) ) ) +{ +$HTML .= << + {$this->lang->words['hook_require_noreqs']} + +EOF; + +return $HTML; +} + + +/* Got errors? */ +if( count($errors) ) +{ + $HTML .= $this->registry->output->global_template->warning_box( $this->lang->words['a_noyoucant'], empty($this->request['fromInstall']) ? '' : '
    '.$this->lang->words['hook_require_skip_reqs'] ) . '
    '; + + /* Replacement time? */ + if ( isset($errors['php_min']) ) + { + $hookData['hook_requirements']['hook_php_version_min'] = $errors['php_min']; + } + if ( isset($errors['php_max']) ) + { + $hookData['hook_requirements']['hook_php_version_max'] = $errors['php_max']; + } +} + +/* Still here? We do have some requirements then! */ +$HTML .= << +

    {$hookData['hook_name']}

    +
    {$this->lang->words['a_realfile']}{$this->lang->words['a_storedfile']}{$this->lang->words['a_filehooktype']}{$this->lang->words['a_wherehook']}
    {$data['hook_file_real']}{$data['hook_file_stored']}{$hookType}{$showsAt}
    + + + + + + + + + +EOF; + +if ( $hookData['hook_requirements']['hook_php_version_min'] ) +{ + + $HTML .= << + + + +EOF; +} + +if ( $hookData['hook_requirements']['hook_php_version_max'] ) +{ + + $HTML .= << + + + +EOF; +} + + if ( is_array($hookData['hook_requirements']['required_applications']) && count($hookData['hook_requirements']['required_applications']) ) + { + foreach( $hookData['hook_requirements']['required_applications'] as $appKey => $appData ) + { + $_appName = ipsRegistry::$applications[ $appKey ]['app_title']; + + $HTML .= << + + + + + +EOF; + /* Got a min version? */ + if ( ! isset($errors[ $appKey.'_app' ]) && $appData['min_version'] ) + { + + $HTML .= << + + +EOF; +} + /* Got a max version? */ + if ( ! isset($errors[ $appKey.'_app' ]) && $appData['max_version'] ) + { + + $HTML .= << + + +EOF; + } + } + } + + $HTML .= << + + +EOF; + +return $HTML; +} + +/** + * Page to export a hook + * + * @param array Hook data + * @return string HTML + */ +public function hooksExport( $hookData ) +{ + +$hookData['hook_extra_data']['display']['settings'] = $hookData['hook_extra_data']['display']['settings'] ? $hookData['hook_extra_data']['display']['settings'] : $this->lang->words['a_nosettings']; +$hookData['hook_extra_data']['display']['modules'] = $hookData['hook_extra_data']['display']['modules'] ? $hookData['hook_extra_data']['display']['modules'] : $this->lang->words['a_nomodules']; +$hookData['hook_extra_data']['display']['help'] = $hookData['hook_extra_data']['display']['help'] ? $hookData['hook_extra_data']['display']['help'] : $this->lang->words['a_nohelp']; +$hookData['hook_extra_data']['display']['acphelp'] = $hookData['hook_extra_data']['display']['acphelp'] ? $hookData['hook_extra_data']['display']['acphelp'] : $this->lang->words['a_noacp']; +$hookData['hook_extra_data']['display']['tasks'] = $hookData['hook_extra_data']['display']['tasks'] ? $hookData['hook_extra_data']['display']['tasks'] : $this->lang->words['a_notasks']; +$hookData['hook_extra_data']['display']['database'] = $hookData['hook_extra_data']['display']['database'] ? $hookData['hook_extra_data']['display']['database'] : $this->lang->words['a_nodbchanges']; +$hookData['hook_extra_data']['display']['custom'] = $hookData['hook_extra_data']['display']['custom'] ? $hookData['hook_extra_data']['display']['custom'] : $this->lang->words['a_noinun']; + +$hookData['hook_extra_data']['display']['language'] = $hookData['hook_extra_data']['display']['language'] ? $hookData['hook_extra_data']['display']['language'] : $this->lang->words['a_nolang']; +$hookData['hook_extra_data']['display']['templates'] = $hookData['hook_extra_data']['display']['templates'] ? $hookData['hook_extra_data']['display']['templates'] : $this->lang->words['a_noskin']; +$hookData['hook_extra_data']['display']['css'] = $hookData['hook_extra_data']['display']['css'] ? $hookData['hook_extra_data']['display']['css'] : $this->lang->words['a_nocss']; +$hookData['hook_extra_data']['display']['replacements'] = $hookData['hook_extra_data']['display']['replacements'] ? $hookData['hook_extra_data']['display']['replacements'] : $this->lang->words['a_noreplacements']; + +$HTML .= << +

    {$this->lang->words['hook_h2_exporting']} {$hookData['hook_name']}

    + + + + + + + +
    form_code}' id='mainform'> + + + + +
    +

    {$this->lang->words['a_exportsettings']}

    + +
    {$this->lang->words['a_phpver']}  
    + {$this->lang->words['hook_require_current']} + +   + +EOF; + +$HTML .= PHP_VERSION; + +$HTML .= << +
    + {$this->lang->words['hook_require_min']} + +EOF; + + $HTML .= isset($errors['php_min']) ? $_errorBadge : $_goodBadge; + + $HTML .= << + + {$hookData['hook_requirements']['hook_php_version_min']} +
    + {$this->lang->words['hook_require_max']} + +EOF; + + $HTML .= isset($errors['php_max']) ? $_errorBadge : $_goodBadge; + + $HTML .= << + + {$hookData['hook_requirements']['hook_php_version_max']} +
    {$this->lang->words['hook_require_apptitle']}: {$_appName}
    + {$this->lang->words['hook_require_current']} + +EOF; + + $HTML .= isset($errors[ $appKey.'_app' ]) ? $_errorBadge : $_goodBadge; + + $HTML .= << + +EOF; + + $HTML .= isset($errors[ $appKey.'_app' ]) ? $errors[ $appKey.'_app' ] : ipsRegistry::$applications[ $appKey ]['app_version']; + + $HTML .= << +
    + {$this->lang->words['hook_require_min']} + +EOF; + + $appData['min_version'] = isset($errors[ $appKey.'_min' ]) ? $errors[ $appKey.'_min' ] : $appData['min_version']; + + $HTML .= isset($errors[ $appKey.'_min' ]) ? $_errorBadge : $_goodBadge; + + $HTML .= << + +EOF; + + $HTML .= isset($versions[ $appKey ][ $appData['min_version'] ]) ? $versions[ $appKey ][ $appData['min_version'] ] : $appData['min_version']; + + $HTML .= << +
    + {$this->lang->words['hook_require_max']} + +EOF; + + $appData['max_version'] = isset($errors[ $appKey.'_max' ]) ? $errors[ $appKey.'_max' ] : $appData['max_version']; + + $HTML .= isset($errors[ $appKey.'_max' ]) ? $_errorBadge : $_goodBadge; + + $HTML .= << + +EOF; + + $HTML .= isset($versions[ $appKey ][ $appData['max_version'] ]) ? $versions[ $appKey ][ $appData['max_version'] ] : $appData['max_version']; + + $HTML .= << +
    + + + + + + +
    {$this->lang->words['a_settings_info']}
    +

    {$hookData['hook_extra_data']['display']['settings']}

    +
    {$this->lang->words['a_addsettings']}
    +
    + + +
    + +
    +

    {$this->lang->words['a_exportlang']}

    + + + + + + + + +
    {$this->lang->words['a_lang_info']}
    +

    {$hookData['hook_extra_data']['display']['language']}

    +
    {$this->lang->words['a_addlang']}
    +
    + +
    +
    + +
    +

    {$this->lang->words['a_exportmod']}

    + + + + + + + + +
    {$this->lang->words['a_mod_info']}
    +

    {$hookData['hook_extra_data']['display']['modules']}

    +
    {$this->lang->words['a_addmod']}
    +
    + +
    +
    + +
    +

    {$this->lang->words['a_exporthelp']}

    + + + + + + + + +
    {$this->lang->words['a_help_info']}
    +

    {$hookData['hook_extra_data']['display']['help']}

    +
    {$this->lang->words['a_addhelp']}
    +
    + +
    +
    + + +
    +

    {$this->lang->words['a_exportskin']}

    + + + + + + + + +
    {$this->lang->words['a_skin_info']}
    +

    {$hookData['hook_extra_data']['display']['templates']}

    +
    {$this->lang->words['a_addskin']}
    +
    + +
    +
    + +
    +

    {$this->lang->words['a_exportcss']}

    + + + + + + + + +
    {$this->lang->words['a_css_info']}
    +

    {$hookData['hook_extra_data']['display']['css']}

    +
    {$this->lang->words['a_addcss']}
    +
    + +
    +
    + +
    +

    {$this->lang->words['a_addreplacements']}

    + + + + + + + + +
    {$this->lang->words['a_replacements_info']}
    +

    {$hookData['hook_extra_data']['display']['replacements']}

    +
    {$this->lang->words['a_addreplacements']}
    +
    + +
    +
    + +
    +

    {$this->lang->words['a_exporttasks']}

    + + + + + + + + +
    {$this->lang->words['a_tasks_info']}
    +

    {$hookData['hook_extra_data']['display']['tasks']}

    +
    {$this->lang->words['a_addtasks']}
    +
    + +
    +
    + +
    +

    {$this->lang->words['a_exportdb']}

    + + + + + + + + +
    {$this->lang->words['a_db_info']}
    +

    {$hookData['hook_extra_data']['display']['database']}

    +
    {$this->lang->words['a_adddb']}
    +
    + +
    +
    + +
    +

    {$this->lang->words['a_exportscript']}

    + + + + + + + + +
    {$this->lang->words['a_script_info']}
    +

    {$hookData['hook_extra_data']['display']['custom']}

    +
    {$this->lang->words['a_addscript']}
    +
    + +
    +
    +
    +
    + +
    +
    + +EOF; + +return $HTML; +} + +/** + * Show a form to create sphinx cronjobs strings + * + * @param array $sphinxData Sphinx data + * @return @e string HTML + */ +public function sphinxConfForm( $sphinxData=array() ) +{ +$HTML = ''; + +/* Form path */ +$sphinxPath = $this->registry->output->formInput( 'sphinx_conf_path', $this->request['sphinx_conf_path'] ); + +/* Init template */ +$HTML .= << +

    {$this->lang->words['sphinx_cronjob_title']}

    + +EOF; + + +/* Got a path? */ +if ( $this->request['sphinx_conf_path'] && count($sphinxData) ) +{ + /* Sort out some variables.. */ + $this->request['sphinx_conf_path'] = rtrim( $this->request['sphinx_conf_path'], '/' ); + $_file = $this->request['sphinx_conf_path'] . '/sphinx.conf'; + $cronJobs = "*/15 * * * * /usr/local/bin/indexer --config {$_file} " . implode( ' ', $sphinxData['deltas'] ) . " --rotate +0 4 * * * /usr/local/bin/indexer --config {$_file} --all --rotate"; + + /* Doesn't exist? */ + if( !@is_file( $_file ) ) + { + $HTML .= $this->registry->output->global_template->warning_box( $this->lang->words['sphinx_cronjob_nofile'], '
    ' . sprintf( $this->lang->words['sphinx_cronjob_nofiledesc'], $_file ) ) . '
    '; + } + +$HTML .= << + {$this->lang->words['sphinx_cronjob_details']} +

    + +

    + {$this->lang->words['sphinx_cronjob_note']} + +

    +EOF; +} + +$HTML .= <<form_code}do=sphinxBuildCron' method='post' enctype='multipart/form-data'> +
    +

    {$this->lang->words['sphinx_cronjob_title']}

    + + + + + +
    + {$this->lang->words['sphinx_cronjob_path']} + + {$sphinxPath}
    + {$this->lang->words['sphinx_cronjob_path_desc']} +
    + +
    + +
    +
    + +EOF; + +return $HTML; +} + +/** + * Community Enhancements + * + * @param array $enhancements Enhancements data + * @return @e string HTML + */ +public function communityEnhancements( $enhancements=array() ) +{ +$HTML = ''; + +$HTML .= << +

    {$this->lang->words['community_enhancements']}

    + + +
    +

    {$this->lang->words['community_enhancements']}

    + +EOF; + foreach ( $enhancements as $k => $e ) + { + $external = $e->external ? "target='_blank'" : ''; + $icon = $e->enabled ? 'tick.png' : 'cross.png'; + $HTML .= << + + + +EOF; + } +$HTML .= << + + +EOF; + +return $HTML; +} + +/** + * Community Enhancements - Generic Settings Management + * + * @param stdClass $class Enhancement class + * @param array $html HTML + * @return @e string HTML + */ +public function communityEnhancementsSettings( $class, $html ) +{ +$HTML = ''; + +$className = get_class( $class ); + +$HTML .= << +

    {$class->title}

    + + +EOF; + +if ( $class->message ) +{ + $HTML .= << + {$class->message} + +
    +EOF; +} + +$HTML .= << +
    +

    {$class->title}

    +
    + + + {$e->title}
    + {$e->description} +
    + {$html} +
    +
    + +
    +
    + + +EOF; + +return $HTML; +} + +/** + * VigLink Conversion + * + * @param string $url Convert URL + * @return @e string HTML + */ +public function viglinkConvert( $url ) +{ +$HTML = ''; + +$baseUrl = str_replace( '&', '&', $this->settings['base_url'] ); + +$HTML .= << +

    {$this->lang->words['enhancements_viglink']}

    + + +
    +

    {$this->lang->words['viglink_signup']}

    + + + + +
    {$this->lang->words['viglink_blurb']}
    + +
    +
    +
    + +
    + +
    +

    {$this->lang->words['viglink_existing']}

    + + + + + +
    {$this->lang->words['viglink_existing_title']}{$this->registry->output->formInput( 'viglink_api_key' )}
    +
    + +
    +
    +
    +
    + + + + +EOF; + +return $HTML; +} + +/** + * IPS CDN Not Enabled + * + * @param array $json Data from license server + * @return @e string HTML + */ +public function cdnNotEnabled( $json ) +{ +$HTML = ''; + +$HTML .= << +

    {$this->lang->words['enhancements_ipscdn']}

    + + +
    +

    {$this->lang->words['enhancements_ipscdn']}

    + + + + +
    {$this->lang->words['cdn_blurb']}
    + +
    + + + +EOF; + +return $HTML; +} + +/** + * IPS CDN Not Active + * + * @return @e string HTML + */ +public function cdnInactive() +{ +$HTML = ''; + +$HTML .= << +

    {$this->lang->words['enhancements_ipscdn']}

    + + +
    +

    {$this->lang->words['enhancements_ipscdn']}

    + + + + +
    {$this->lang->words['cdn_blurb']}
    + +
    +EOF; + +return $HTML; +} + + +/** + * IPS CDN Overview + * + * @param array $json Data from license server + * @return @e string HTML + */ +public function cdnOverview( $json ) +{ +$HTML = ''; + +if ( $json['BYTES'] >= 1099511627776 ) +{ + $credit = round( ( $json['BYTES'] / 1099511627776 ), 2 ) . 'TB'; +} +else +{ + $credit = round( ( $json['BYTES'] / 1073741824 ), 2 ) . 'GB'; +} + +$message = sprintf( $this->lang->words['cdn_active'], $credit ); + +$HTML .= << +

    {$this->lang->words['enhancements_ipscdn']}

    + + + +
    + {$message} +
    + +

    + +EOF; + +/* $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' ); +$file = new $classToLoad(); + +$HTML .= $file->getFileContents( "http://www.invisionpower.com/clients/interface/ipscdnstats.php?key={$this->settings['ipb_reg_number']}" ); */ + +return $HTML; +} + +/** + * Windows Live Setup + * + * @return @e string HTML + */ +public function windowsLiveSetup( $settings ) +{ + +$step1 = sprintf( $this->lang->words['wl_1'], "{$this->lang->words['wl_1b']}", "{$this->settings['board_url']}/interface/board/live.php" ); + +$form['client_id'] = $this->registry->output->formInput( 'client_id', $settings['client_id'] ); +$form['client_secret'] = $this->registry->output->formInput( 'client_secret', $settings['client_secret'] ); +$form['xml'] = $this->registry->output->formInput( 'xml', $settings['xml'], '', 80 ); + +$HTML = ''; + +$HTML .= << +

    {$this->lang->words['enhancements_windowslive']}

    + + +EOF; + +if ( $settings['enabled'] ) +{ + $HTML .= << + + +EOF; +} + +$HTML .= <<{$step1} +
    +
    +
    +

    {$this->lang->words['wl_2']}

    + + + + + + + + + +
    + {$this->lang->words['wl_2b']} + + {$form['client_id']} +
    + {$this->lang->words['wl_2c']} + + {$form['client_secret']} +
    +
    + +
    +
    +
    +
    + +
    {$this->lang->words['wl_3']}
    +
    +
    +
    +

    {$this->lang->words['wl_3b']}

    + + + + + +
    + {$this->lang->words['wl_3b']} + + {$form['xml']} +
    +
    + +
    +
    +
    + +EOF; + +return $HTML; +} + + } \ No newline at end of file diff --git a/upload/admin/applications/core/skin_cp/cp_skin_badwords.php b/upload/admin/applications/core/skin_cp/cp_skin_badwords.php index b4b4ea68..5ae3b2ca 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_badwords.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_badwords.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Badwords skin file
      * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/skin_cp/cp_skin_bbcode.php b/upload/admin/applications/core/skin_cp/cp_skin_bbcode.php index 273f5783..a1dfb1b7 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_bbcode.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_bbcode.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * BBcode skin file
      * Last Updated: $Date: 2013-04-01 22:35:19 -0400 (Mon, 01 Apr 2013) $
      * 
    diff --git a/upload/admin/applications/core/skin_cp/cp_skin_diagnostics.php b/upload/admin/applications/core/skin_cp/cp_skin_diagnostics.php index b05b6142..cdfe532b 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_diagnostics.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_diagnostics.php @@ -1,783 +1,783 @@ - - * Invision Power Services - * IP.Board v3.4.5 - * Diagnostics skin file - * Last Updated: $Date: 2013-02-22 18:01:02 -0500 (Fri, 22 Feb 2013) $ - * - * - * @author $Author: bfarber $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/company/standards.php#license - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com - * @since Friday 19th May 2006 17:33 - * @version $Revision: 12018 $ - */ - -class cp_skin_diagnostics -{ - /** - * Registry Object Shortcuts - * - * @var $registry - * @var $DB - * @var $settings - * @var $request - * @var $lang - * @var $member - * @var $memberData - * @var $cache - * @var $caches - */ - protected $registry; - protected $DB; - protected $settings; - protected $request; - protected $lang; - protected $member; - protected $memberData; - protected $cache; - protected $caches; - - /** - * Constructor - * - * @param object $registry Registry object - * @return @e void - */ - public function __construct( ipsRegistry $registry ) - { - $this->registry = $registry; - $this->DB = $this->registry->DB(); - $this->settings =& $this->registry->fetchSettings(); - $this->request =& $this->registry->fetchRequest(); - $this->member = $this->registry->member(); - $this->memberData =& $this->registry->member()->fetchMemberData(); - $this->cache = $this->registry->cache(); - $this->caches =& $this->registry->cache()->fetchCaches(); - $this->lang = $this->registry->class_localization; - } - -/** - * Connection checker - * - * @param string Raw HTTP headers - * @param string Request result - * @param string Raw HTTPS headers - * @param string Request result - * @return string HTML - */ -public function connectionCheckerResult( $headers='', $output='', $headers_ssl='', $output_ssl='' ) { - -$IPBHTML = ""; -//--starthtml--// - -$output = IPSText::mbsubstr( htmlspecialchars($output), 0, 2000 ); -$output_ssl = IPSText::mbsubstr( htmlspecialchars($output_ssl), 0, 2000 ); - -$IPBHTML .= << - {$this->lang->words['connections__message']} - -
    -
    -

    {$this->lang->words['connectionchecker']}

    -
    - -
    -

    {$this->lang->words['connections__headers']}

    -
    {$headers}
    -
    -
    -
    -

    {$this->lang->words['connections__output']}

    -
    {$output}
    -
    -
    -
    -

    {$this->lang->words['connections__headers1']}

    -
    {$headers_ssl}
    -
    -
    -
    -

    {$this->lang->words['connections__output1']}

    -
    {$output_ssl}
    -
    -EOF; - -//--endhtml--// -return $IPBHTML; -} - -/** - * DB Index checker - * - * @param array Errors - * @param array Tables - * @return string HTML - */ -public function indexChecker( $errors=array(), $tables=array(), $queriesRan=array() ) { -$IPBHTML = ""; -//--starthtml--// - -$IPBHTML .= << -

    {$this->lang->words['d_ititle']}

    - -HTML; - -if( count( $errors ) ) -{ -$IPBHTML .= << - {$this->lang->words['d_ifixall']} form_code}&section=diagnostics&do=dbindex&fix=all'>{$this->lang->words['d_ifixall_link']} - -
    -HTML; -} - -if ( !empty( $queriesRan ) ) -{ - foreach ( $queriesRan as $data ) - { - if ( $data['status'] === TRUE ) - { - $IPBHTML .= << - {$data['q']}
    - {$this->lang->words['q_ok']} - -
    -HTML; - } - else - { - $IPBHTML .= << - {$data['q']}
    - {$this->lang->words['q_fail']} - -
    -HTML; - } - } -} - -$IPBHTML .= << -

    {$this->lang->words['d_dnav']}

    - - - - - - - -HTML; - -if( is_array( $tables ) && count( $tables ) ) -{ - $i = 0; - foreach( $tables as $app_title => $_tables ) - { -$IPBHTML .= << - - -HTML; - foreach( $_tables as $r ) - { - if( $r['status'] == 'ok' ) - { -$IPBHTML .= << - - - - -HTML; - } - else - { -$IPBHTML .= << - - - - -HTML; - } - } - } -} - -$IPBHTML .= << - -HTML; - -//--endhtml--// -return $IPBHTML; -} - -/** - * DB checker - * - * @param array Errors - * @param array Tables - * @return string HTML - */ -public function dbChecker( $errors=array(), $tables=array(), $queriesRan=array() ) { -$IPBHTML = ""; -//--starthtml--// - -/* This may be called from upgrader before langs are imported, so we'll hardcode fallbacks for these strings */ -if( !$this->lang->words['d_dtitle'] ) -{ - $this->lang->words = array_merge( $this->lang->words, array( -'d_dtitle' => "IP.Board Diagnostics - Database Structure Checker", -'d_ifixall' => "We have found problems with your database, and have listed them below. ", -'d_ifixall_link' => "Would you like us to attempt to fix them for you?", -'d_dnav' => "Database Structure Results", -'d_dtbl' => "Table", -'d_dstatus' => "Status", -'d_dfix' => "Fix", -'q_ok' => "Query ran sucessfully", -'q_fail' => "Query failed", -'d_iauto' => "Click here to fix this table", -'d_iman' => ", or you can run the following queries manually:", - )); -} - -$IPBHTML .= << -

    {$this->lang->words['d_dtitle']}

    - -HTML; - -if( count( $errors ) ) -{ -$IPBHTML .= << - {$this->lang->words['d_ifixall']} form_code}&section=diagnostics&do=dbchecker&fix=all'>{$this->lang->words['d_ifixall_link']} - -
    -HTML; -} -else -{ - $IPBHTML .= ""; -} - -if ( !empty( $queriesRan ) ) -{ - foreach ( $queriesRan as $data ) - { - if ( $data['status'] === TRUE ) - { - $IPBHTML .= << - {$data['q']}
    - {$this->lang->words['q_ok']} - -
    -HTML; - } - else - { - $IPBHTML .= << - {$data['q']}
    - {$this->lang->words['q_fail']} - -
    -HTML; - } - } -} - -$IPBHTML .= << -

    {$this->lang->words['d_dnav']}

    - -
    {$this->lang->words['chckr_table']}{$this->lang->words['chckr_status']}{$this->lang->words['chckr_fix']}
    {$app_title}
    {$r['table']} - -
      -
    • -HTML; -if ( is_array( $r['index'] ) ) -{ -$IPBHTML .= implode( "
    • ", $r['index'] ); -} -$IPBHTML .= << -
    -
    -
     
    {$r['table']} -
      -HTML; - -foreach( $r['index'] as $index ) -{ - if( in_array( $index, $r['missing'] ) ) - { - $IPBHTML .= "
    • Отсутствует индекс: {$index}
    • "; - } - else - { - $IPBHTML .= "
    • {$index}
    • "; - } -} -$IPBHTML .= << -
    - form_code}&section=diagnostics&do=dbindex&fix={$r['table']}'>{$this->lang->words['d_inauto']}{$this->lang->words['d_iman']} -
    -
      -
    • -HTML; - -$IPBHTML .= implode( "
    • ", $r['fixsql'] ); -$IPBHTML .= << -
    -
    -
    - - - - - -HTML; - -if( count( $tables ) ) -{ - $i = 0; - foreach( $tables as $app_title => $_tables ) - { -$IPBHTML .= << - - -HTML; - if( !is_array($_tables) OR !count($_tables) ) - { - continue; - } - - foreach( $_tables as $r ) - { - $_column = ''; - - if( $r['column'] ) - { - $_column = ' (' . $r['column'] . ')'; - } - - if( $r['status'] == 'ok' ) - { -$IPBHTML .= << - - - - -HTML; - } - else - { -$IPBHTML .= << - - - - -HTML; - } - } - } -} - -$IPBHTML .= << - -HTML; - -//--endhtml--// -return $IPBHTML; -} - -/** - * Diagnostics overview - * - * @param array Data - * @return string HTML - */ -public function diagnosticsOverview( $data=array(), $statsbox ) { - -$IPBHTML = ""; -//--starthtml--// - -$IPBHTML .= << -

    {$this->lang->words['d_atitle']}

    - - -
    -

    {$this->lang->words['cp_systemstats']}

    -
    {$this->lang->words['d_dtbl']}{$this->lang->words['d_dstatus']}{$this->lang->words['d_dfix']}
    {$app_title}
    {$r['table']}{$_column}YN 
    {$r['table']}YN - form_code}&section=diagnostics&do=dbchecker&fix={$r['key']}'>{$this->lang->words['d_iauto']}{$this->lang->words['d_iman']} -
    -
      -
    • -HTML; - -$IPBHTML .= implode( "
    • ", $r['fixsql'] ); -$IPBHTML .= << -
    -
    -
    - {$statsbox} -
    - -
    - -
    -

    {$this->lang->words['sys_system_overview']}

    - - - - - - - - - - - - - - - - - - - - - - - - - -EOF; - if ( defined( 'IPS_TOPICMARKERS_DEBUG' ) and IPS_TOPICMARKERS_DEBUG === TRUE ) - { - $IPBHTML .= << - - - -EOF; - } - -$IPBHTML .= << - - - - - - - - - - - - - - - -
    {$this->lang->words['sys_ipboard_version']}{$data['version']} (ID:{$data['version_full']})
    {$data['driver_type']} {$this->lang->words['sys_version']}{$data['version_sql']}
    {$this->lang->words['sys_php_version']}{$data['version_php']}
    {$this->lang->words['sys_disabled_funcs']}{$data['disabled']}
    {$this->lang->words['sys_loaded_ext']}{$data['extensions']}
    {$this->lang->words['sys_safe_mod']}{$data['safe_mode']}
    {$this->lang->words['topicmarkingdebug']}{$this->lang->words['tmdebug_on']} ( form_code}&do=tm_index'>{$this->lang->words['tmdebug_logs']} )
    {$this->lang->words['sys_sys_software']}{$data['server']}
    {$this->lang->words['sys_current_load']}{$data['load']}
    {$this->lang->words['sys_total_mem']}{$data['total_memory']}
    {$this->lang->words['sys_avail_mem']}{$data['avail_memory']}
    -
    -
    -
    -

    {$this->lang->words['system_processes']}

    - - - - -
    {$data['tasks']}
    -
    -
    -EOF; - -//--endhtml--// -return $IPBHTML; -} - -/** - * Permission checker results - * - * @param array Results from permission checking - * @return string HTML - */ -public function permissionsResults( $results=array() ) { - -$IPBHTML = ""; -//--starthtml--// - -$IPBHTML .= << -

    {$this->lang->words['d_ptitle']}

    - - -
    -

    {$this->lang->words['perm_check_results']}

    - -EOF; - -if( count($results) AND is_array($results) ) -{ - foreach( $results as $result ) - { - $IPBHTML .= << - - -EOF; - } -} - -$IPBHTML .= << - -EOF; - -//--endhtml--// -return $IPBHTML; -} - -/** - * Whitespace checker - * - * @param array Results from checking for whitespace - * @return string HTML - */ -public function whitespaceResults( $results=array() ) { - -$IPBHTML = ""; -//--starthtml--// - -$IPBHTML .= << -

    {$this->lang->words['d_wtitle']}

    - - -
    -

    {$this->lang->words['d_wnav']}

    -
    {$result}
    -EOF; - -if( count($results) AND is_array($results) ) -{ - foreach( $results as $result ) - { - $IPBHTML .= << - - -EOF; - } -} -else -{ - $IPBHTML .= << - - -EOF; -} - -$IPBHTML .= << - -EOF; - -//--endhtml--// -return $IPBHTML; -} - -/** - * phpinfo() output - * - * @param string Content from running phpinfo() - * @return string HTML - */ -public function phpInfo( $content ) { - -$IPBHTML = ""; -//--starthtml--// - -$IPBHTML .= << -.center {text-align: center;} -.center table { margin-left: auto; margin-right: auto; text-align: left; } -.center th { text-align: center; } -h1 {font-size: 150%;} -h2 {font-size: 125%;} -.p {text-align: left;} -.e {background-color: #ccccff; font-weight: bold;} -.h {background-color: #9999cc; font-weight: bold;} -.v {background-color: #cccccc; white-space: normal;} - - -{$content} -EOF; - -//--endhtml--// -return $IPBHTML; -} - -/** - * ACP Statistics wrapper - * - * @param array Content - * @return string HTML - */ -public function acp_stats_wrapper($content) { - -$IPBHTML = ""; -//--starthtml--// - -$IPBHTML .= << - - - - - - - - - - - -EOF; - -//--endhtml--// -return $IPBHTML; -} - -/** - * Email tester - * - * @param sring Error message - * @return string HTML - */ -public function emailChecker( $error='' ) { - -$form = array(); -$form['to'] = $this->registry->output->formInput( 'to', $this->memberData['email'] ); -$form['from'] = $this->registry->output->formInput( 'from', $this->settings['email_out'] ); -$form['subject'] = $this->registry->output->formInput( 'subject', $this->lang->words['email_tester_subject_default'] ); -$form['message'] = $this->registry->output->formTextArea( 'message', $this->lang->words['email_tester_message_default'] ); - -$IPBHTML = ""; -//--starthtml--// - -$IPBHTML .= << -

    {$this->lang->words['email_tester']}

    - - -EOF; - -if ( $error ) -{ - $IPBHTML .= << - {$error} - -
    -EOF; -} - -$IPBHTML .= << - {$this->lang->words['email_tester_desc']} - -
    - -
    -
    -

    {$this->lang->words['email_tester']}

    -
    {$result} {$this->lang->words['d_wfound']}
    {$this->lang->words['d_wclear']}
    - {$this->lang->words['cp_totalmembers']} -
    - {$this->lang->words['cp_onlinenow']}
    - {$this->lang->words['cp_awaitingvalidation']}
    - {$this->lang->words['cp_lockedaccounts']}
    - {$this->lang->words['cp_spammeraccounts']} -
    -
    - {$content['members']} -
    - {$this->lang->words['cp_view']} ({$content['sessions']})
    - {$this->lang->words['cp_manage']} ({$content['validate']})
    - {$this->lang->words['cp_manage']} ({$content['locked']})
    - {$this->lang->words['cp_manage']} ({$content['spammer']}) -
    -
    - {$this->lang->words['cp_topics']} -
    - {$this->lang->words['cp_awaitingmoderation']} -
    -
    {$content['topics']}
    {$content['topics_mod']}
    - {$this->lang->words['cp_posts']} -
    - {$this->lang->words['cp_awaitingmoderation']} -
    -
    {$content['replies']}
    {$content['posts_mod']}
    - - - - - - - - - - - - - - - - -
    {$this->lang->words['email_tester_to']} - {$form['to']}
    - {$this->lang->words['email_tester_to_desc']} -
    {$this->lang->words['email_tester_from']} - {$form['from']} -
    {$this->lang->words['email_tester_subject']} - {$form['subject']} -
    {$this->lang->words['email_tester_message']} - {$form['message']} -
    -
    - -
    -
    - - -EOF; - -//--endhtml--// -return $IPBHTML; -} - + + * Invision Power Services + * IP.Board v3.4.6 + * Diagnostics skin file + * Last Updated: $Date: 2013-02-22 18:01:02 -0500 (Fri, 22 Feb 2013) $ + * + * + * @author $Author: bfarber $ + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license http://www.invisionpower.com/company/standards.php#license + * @package IP.Board + * @subpackage Core + * @link http://www.invisionpower.com + * @since Friday 19th May 2006 17:33 + * @version $Revision: 12018 $ + */ + +class cp_skin_diagnostics +{ + /** + * Registry Object Shortcuts + * + * @var $registry + * @var $DB + * @var $settings + * @var $request + * @var $lang + * @var $member + * @var $memberData + * @var $cache + * @var $caches + */ + protected $registry; + protected $DB; + protected $settings; + protected $request; + protected $lang; + protected $member; + protected $memberData; + protected $cache; + protected $caches; + + /** + * Constructor + * + * @param object $registry Registry object + * @return @e void + */ + public function __construct( ipsRegistry $registry ) + { + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->member = $this->registry->member(); + $this->memberData =& $this->registry->member()->fetchMemberData(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + $this->lang = $this->registry->class_localization; + } + +/** + * Connection checker + * + * @param string Raw HTTP headers + * @param string Request result + * @param string Raw HTTPS headers + * @param string Request result + * @return string HTML + */ +public function connectionCheckerResult( $headers='', $output='', $headers_ssl='', $output_ssl='' ) { + +$IPBHTML = ""; +//--starthtml--// + +$output = IPSText::mbsubstr( htmlspecialchars($output), 0, 2000 ); +$output_ssl = IPSText::mbsubstr( htmlspecialchars($output_ssl), 0, 2000 ); + +$IPBHTML .= << + {$this->lang->words['connections__message']} + +
    +
    +

    {$this->lang->words['connectionchecker']}

    +
    + +
    +

    {$this->lang->words['connections__headers']}

    +
    {$headers}
    +
    +
    +
    +

    {$this->lang->words['connections__output']}

    +
    {$output}
    +
    +
    +
    +

    {$this->lang->words['connections__headers1']}

    +
    {$headers_ssl}
    +
    +
    +
    +

    {$this->lang->words['connections__output1']}

    +
    {$output_ssl}
    +
    +EOF; + +//--endhtml--// +return $IPBHTML; +} + +/** + * DB Index checker + * + * @param array Errors + * @param array Tables + * @return string HTML + */ +public function indexChecker( $errors=array(), $tables=array(), $queriesRan=array() ) { +$IPBHTML = ""; +//--starthtml--// + +$IPBHTML .= << +

    {$this->lang->words['d_ititle']}

    + +HTML; + +if( count( $errors ) ) +{ +$IPBHTML .= << + {$this->lang->words['d_ifixall']} form_code}&section=diagnostics&do=dbindex&fix=all'>{$this->lang->words['d_ifixall_link']} + +
    +HTML; +} + +if ( !empty( $queriesRan ) ) +{ + foreach ( $queriesRan as $data ) + { + if ( $data['status'] === TRUE ) + { + $IPBHTML .= << + {$data['q']}
    + {$this->lang->words['q_ok']} + +
    +HTML; + } + else + { + $IPBHTML .= << + {$data['q']}
    + {$this->lang->words['q_fail']} + +
    +HTML; + } + } +} + +$IPBHTML .= << +

    {$this->lang->words['d_dnav']}

    + + + + + + + +HTML; + +if( is_array( $tables ) && count( $tables ) ) +{ + $i = 0; + foreach( $tables as $app_title => $_tables ) + { +$IPBHTML .= << + + +HTML; + foreach( $_tables as $r ) + { + if( $r['status'] == 'ok' ) + { +$IPBHTML .= << + + + + +HTML; + } + else + { +$IPBHTML .= << + + + + +HTML; + } + } + } +} + +$IPBHTML .= << + +HTML; + +//--endhtml--// +return $IPBHTML; +} + +/** + * DB checker + * + * @param array Errors + * @param array Tables + * @return string HTML + */ +public function dbChecker( $errors=array(), $tables=array(), $queriesRan=array() ) { +$IPBHTML = ""; +//--starthtml--// + +/* This may be called from upgrader before langs are imported, so we'll hardcode fallbacks for these strings */ +if( !$this->lang->words['d_dtitle'] ) +{ + $this->lang->words = array_merge( $this->lang->words, array( +'d_dtitle' => "IP.Board Diagnostics - Database Structure Checker", +'d_ifixall' => "We have found problems with your database, and have listed them below. ", +'d_ifixall_link' => "Would you like us to attempt to fix them for you?", +'d_dnav' => "Database Structure Results", +'d_dtbl' => "Table", +'d_dstatus' => "Status", +'d_dfix' => "Fix", +'q_ok' => "Query ran sucessfully", +'q_fail' => "Query failed", +'d_iauto' => "Click here to fix this table", +'d_iman' => ", or you can run the following queries manually:", + )); +} + +$IPBHTML .= << +

    {$this->lang->words['d_dtitle']}

    + +HTML; + +if( count( $errors ) ) +{ +$IPBHTML .= << + {$this->lang->words['d_ifixall']} form_code}&section=diagnostics&do=dbchecker&fix=all'>{$this->lang->words['d_ifixall_link']} + +
    +HTML; +} +else +{ + $IPBHTML .= ""; +} + +if ( !empty( $queriesRan ) ) +{ + foreach ( $queriesRan as $data ) + { + if ( $data['status'] === TRUE ) + { + $IPBHTML .= << + {$data['q']}
    + {$this->lang->words['q_ok']} + +
    +HTML; + } + else + { + $IPBHTML .= << + {$data['q']}
    + {$this->lang->words['q_fail']} + +
    +HTML; + } + } +} + +$IPBHTML .= << +

    {$this->lang->words['d_dnav']}

    + +
    {$this->lang->words['chckr_table']}{$this->lang->words['chckr_status']}{$this->lang->words['chckr_fix']}
    {$app_title}
    {$r['table']} + +
      +
    • +HTML; +if ( is_array( $r['index'] ) ) +{ +$IPBHTML .= implode( "
    • ", $r['index'] ); +} +$IPBHTML .= << +
    +
    +
     
    {$r['table']} +
      +HTML; + +foreach( $r['index'] as $index ) +{ + if( in_array( $index, $r['missing'] ) ) + { + $IPBHTML .= "
    • Missing index: {$index}
    • "; + } + else + { + $IPBHTML .= "
    • {$index}
    • "; + } +} +$IPBHTML .= << +
    + form_code}&section=diagnostics&do=dbindex&fix={$r['table']}'>{$this->lang->words['d_inauto']}{$this->lang->words['d_iman']} +
    +
      +
    • +HTML; + +$IPBHTML .= implode( "
    • ", $r['fixsql'] ); +$IPBHTML .= << +
    +
    +
    + + + + + +HTML; + +if( count( $tables ) ) +{ + $i = 0; + foreach( $tables as $app_title => $_tables ) + { +$IPBHTML .= << + + +HTML; + if( !is_array($_tables) OR !count($_tables) ) + { + continue; + } + + foreach( $_tables as $r ) + { + $_column = ''; + + if( $r['column'] ) + { + $_column = ' (' . $r['column'] . ')'; + } + + if( $r['status'] == 'ok' ) + { +$IPBHTML .= << + + + + +HTML; + } + else + { +$IPBHTML .= << + + + + +HTML; + } + } + } +} + +$IPBHTML .= << + +HTML; + +//--endhtml--// +return $IPBHTML; +} + +/** + * Diagnostics overview + * + * @param array Data + * @return string HTML + */ +public function diagnosticsOverview( $data=array(), $statsbox ) { + +$IPBHTML = ""; +//--starthtml--// + +$IPBHTML .= << +

    {$this->lang->words['d_atitle']}

    + + +
    +

    {$this->lang->words['cp_systemstats']}

    +
    {$this->lang->words['d_dtbl']}{$this->lang->words['d_dstatus']}{$this->lang->words['d_dfix']}
    {$app_title}
    {$r['table']}{$_column}YN 
    {$r['table']}YN + form_code}&section=diagnostics&do=dbchecker&fix={$r['key']}'>{$this->lang->words['d_iauto']}{$this->lang->words['d_iman']} +
    +
      +
    • +HTML; + +$IPBHTML .= implode( "
    • ", $r['fixsql'] ); +$IPBHTML .= << +
    +
    +
    + {$statsbox} +
    + +
    + +
    +

    {$this->lang->words['sys_system_overview']}

    + + + + + + + + + + + + + + + + + + + + + + + + + +EOF; + if ( defined( 'IPS_TOPICMARKERS_DEBUG' ) and IPS_TOPICMARKERS_DEBUG === TRUE ) + { + $IPBHTML .= << + + + +EOF; + } + +$IPBHTML .= << + + + + + + + + + + + + + + + +
    {$this->lang->words['sys_ipboard_version']}{$data['version']} (ID:{$data['version_full']})
    {$data['driver_type']} {$this->lang->words['sys_version']}{$data['version_sql']}
    {$this->lang->words['sys_php_version']}{$data['version_php']}
    {$this->lang->words['sys_disabled_funcs']}{$data['disabled']}
    {$this->lang->words['sys_loaded_ext']}{$data['extensions']}
    {$this->lang->words['sys_safe_mod']}{$data['safe_mode']}
    {$this->lang->words['topicmarkingdebug']}{$this->lang->words['tmdebug_on']} ( form_code}&do=tm_index'>{$this->lang->words['tmdebug_logs']} )
    {$this->lang->words['sys_sys_software']}{$data['server']}
    {$this->lang->words['sys_current_load']}{$data['load']}
    {$this->lang->words['sys_total_mem']}{$data['total_memory']}
    {$this->lang->words['sys_avail_mem']}{$data['avail_memory']}
    +
    +
    +
    +

    {$this->lang->words['system_processes']}

    + + + + +
    {$data['tasks']}
    +
    +
    +EOF; + +//--endhtml--// +return $IPBHTML; +} + +/** + * Permission checker results + * + * @param array Results from permission checking + * @return string HTML + */ +public function permissionsResults( $results=array() ) { + +$IPBHTML = ""; +//--starthtml--// + +$IPBHTML .= << +

    {$this->lang->words['d_ptitle']}

    + + +
    +

    {$this->lang->words['perm_check_results']}

    + +EOF; + +if( count($results) AND is_array($results) ) +{ + foreach( $results as $result ) + { + $IPBHTML .= << + + +EOF; + } +} + +$IPBHTML .= << + +EOF; + +//--endhtml--// +return $IPBHTML; +} + +/** + * Whitespace checker + * + * @param array Results from checking for whitespace + * @return string HTML + */ +public function whitespaceResults( $results=array() ) { + +$IPBHTML = ""; +//--starthtml--// + +$IPBHTML .= << +

    {$this->lang->words['d_wtitle']}

    + + +
    +

    {$this->lang->words['d_wnav']}

    +
    {$result}
    +EOF; + +if( count($results) AND is_array($results) ) +{ + foreach( $results as $result ) + { + $IPBHTML .= << + + +EOF; + } +} +else +{ + $IPBHTML .= << + + +EOF; +} + +$IPBHTML .= << + +EOF; + +//--endhtml--// +return $IPBHTML; +} + +/** + * phpinfo() output + * + * @param string Content from running phpinfo() + * @return string HTML + */ +public function phpInfo( $content ) { + +$IPBHTML = ""; +//--starthtml--// + +$IPBHTML .= << +.center {text-align: center;} +.center table { margin-left: auto; margin-right: auto; text-align: left; } +.center th { text-align: center; } +h1 {font-size: 150%;} +h2 {font-size: 125%;} +.p {text-align: left;} +.e {background-color: #ccccff; font-weight: bold;} +.h {background-color: #9999cc; font-weight: bold;} +.v {background-color: #cccccc; white-space: normal;} + + +{$content} +EOF; + +//--endhtml--// +return $IPBHTML; +} + +/** + * ACP Statistics wrapper + * + * @param array Content + * @return string HTML + */ +public function acp_stats_wrapper($content) { + +$IPBHTML = ""; +//--starthtml--// + +$IPBHTML .= << + + + + + + + + + + + +EOF; + +//--endhtml--// +return $IPBHTML; +} + +/** + * Email tester + * + * @param sring Error message + * @return string HTML + */ +public function emailChecker( $error='' ) { + +$form = array(); +$form['to'] = $this->registry->output->formInput( 'to', $this->memberData['email'] ); +$form['from'] = $this->registry->output->formInput( 'from', $this->settings['email_out'] ); +$form['subject'] = $this->registry->output->formInput( 'subject', $this->lang->words['email_tester_subject_default'] ); +$form['message'] = $this->registry->output->formTextArea( 'message', $this->lang->words['email_tester_message_default'] ); + +$IPBHTML = ""; +//--starthtml--// + +$IPBHTML .= << +

    {$this->lang->words['email_tester']}

    + + +EOF; + +if ( $error ) +{ + $IPBHTML .= << + {$error} + +
    +EOF; +} + +$IPBHTML .= << + {$this->lang->words['email_tester_desc']} + +
    + +
    +
    +

    {$this->lang->words['email_tester']}

    +
    {$result} {$this->lang->words['d_wfound']}
    {$this->lang->words['d_wclear']}
    + {$this->lang->words['cp_totalmembers']} +
    + {$this->lang->words['cp_onlinenow']}
    + {$this->lang->words['cp_awaitingvalidation']}
    + {$this->lang->words['cp_lockedaccounts']}
    + {$this->lang->words['cp_spammeraccounts']} +
    +
    + {$content['members']} +
    + {$this->lang->words['cp_view']} ({$content['sessions']})
    + {$this->lang->words['cp_manage']} ({$content['validate']})
    + {$this->lang->words['cp_manage']} ({$content['locked']})
    + {$this->lang->words['cp_manage']} ({$content['spammer']}) +
    +
    + {$this->lang->words['cp_topics']} +
    + {$this->lang->words['cp_awaitingmoderation']} +
    +
    {$content['topics']}
    {$content['topics_mod']}
    + {$this->lang->words['cp_posts']} +
    + {$this->lang->words['cp_awaitingmoderation']} +
    +
    {$content['replies']}
    {$content['posts_mod']}
    + + + + + + + + + + + + + + + + +
    {$this->lang->words['email_tester_to']} + {$form['to']}
    + {$this->lang->words['email_tester_to_desc']} +
    {$this->lang->words['email_tester_from']} + {$form['from']} +
    {$this->lang->words['email_tester_subject']} + {$form['subject']} +
    {$this->lang->words['email_tester_message']} + {$form['message']} +
    +
    + +
    +
    + + +EOF; + +//--endhtml--// +return $IPBHTML; +} + } \ No newline at end of file diff --git a/upload/admin/applications/core/skin_cp/cp_skin_emailerrorlogs.php b/upload/admin/applications/core/skin_cp/cp_skin_emailerrorlogs.php index 42a8a6a6..42bccb55 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_emailerrorlogs.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_emailerrorlogs.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Email error logs
      * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/skin_cp/cp_skin_emoticons.php b/upload/admin/applications/core/skin_cp/cp_skin_emoticons.php index 5def9a2f..b0184c1e 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_emoticons.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_emoticons.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Emoticon manager skin file
      * Last Updated: $Date: 2012-05-24 16:20:59 -0400 (Thu, 24 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/skin_cp/cp_skin_errorlogs.php b/upload/admin/applications/core/skin_cp/cp_skin_errorlogs.php index 014d22a8..a42c68c7 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_errorlogs.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_errorlogs.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Error log skin file
      * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/skin_cp/cp_skin_group_core.php b/upload/admin/applications/core/skin_cp/cp_skin_group_core.php index 1f147224..02a35492 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_group_core.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_group_core.php @@ -3,7 +3,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Group plugin skin functions
      * Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/skin_cp/cp_skin_help_files.php b/upload/admin/applications/core/skin_cp/cp_skin_help_files.php index affe068e..fc611e69 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_help_files.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_help_files.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Manage help files skin file
      * Last Updated: $Date: 2012-12-17 12:34:52 -0500 (Mon, 17 Dec 2012) $
      * 
    diff --git a/upload/admin/applications/core/skin_cp/cp_skin_hooks_export.php b/upload/admin/applications/core/skin_cp/cp_skin_hooks_export.php index 37b4d761..5a898108 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_hooks_export.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_hooks_export.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Hooks export skin file
      * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/skin_cp/cp_skin_mobileapp.php b/upload/admin/applications/core/skin_cp/cp_skin_mobileapp.php index b72e9995..5fcc6fd6 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_mobileapp.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_mobileapp.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Look and feel skin file
      * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/skin_cp/cp_skin_mobilelogs.php b/upload/admin/applications/core/skin_cp/cp_skin_mobilelogs.php index 4aa42018..04eb1f53 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_mobilelogs.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_mobilelogs.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Error log skin file
      * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/skin_cp/cp_skin_modlogs.php b/upload/admin/applications/core/skin_cp/cp_skin_modlogs.php index 392d685b..cd06871e 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_modlogs.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_modlogs.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Moderator log skin file
      * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/skin_cp/cp_skin_mycp.php b/upload/admin/applications/core/skin_cp/cp_skin_mycp.php index cc4e2dc5..171aaf59 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_mycp.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_mycp.php @@ -3,7 +3,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Dashboard skin file
      * Last Updated: $Date: 2013-01-30 20:50:13 -0500 (Wed, 30 Jan 2013) $
      * 
    @@ -215,10 +215,6 @@ $IPBHTML .= <<


    -
    -

    {$this->lang->words['cp_ipslatestnews']}

    -
    -
    diff --git a/upload/admin/applications/core/skin_cp/cp_skin_performance.php b/upload/admin/applications/core/skin_cp/cp_skin_performance.php index e2558302..2593edcf 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_performance.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_performance.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Performance mode skin file
      * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/skin_cp/cp_skin_qanda.php b/upload/admin/applications/core/skin_cp/cp_skin_qanda.php index 73119d51..bcc9c1f6 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_qanda.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_qanda.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Question and answer skin file
      * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/skin_cp/cp_skin_rebuild.php b/upload/admin/applications/core/skin_cp/cp_skin_rebuild.php index 2be65b53..7ab4abaf 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_rebuild.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_rebuild.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Cleanup and rebuild tools skin file
      * Last Updated: $Date: 2012-09-26 11:03:29 -0400 (Wed, 26 Sep 2012) $
      * 
    diff --git a/upload/admin/applications/core/skin_cp/cp_skin_reports.php b/upload/admin/applications/core/skin_cp/cp_skin_reports.php index 7f39cc72..ea2378ad 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_reports.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_reports.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Report center skin file
      * Last Updated: $Date: 2013-02-14 19:17:38 -0500 (Thu, 14 Feb 2013) $
      * 
    diff --git a/upload/admin/applications/core/skin_cp/cp_skin_security.php b/upload/admin/applications/core/skin_cp/cp_skin_security.php index 688be517..b84668a4 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_security.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_security.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Security skin file
      * Last Updated: $Date: 2013-04-02 20:05:02 -0400 (Tue, 02 Apr 2013) $
      * 
    diff --git a/upload/admin/applications/core/skin_cp/cp_skin_settings.php b/upload/admin/applications/core/skin_cp/cp_skin_settings.php index a30cb1fd..d3bba027 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_settings.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_settings.php @@ -1,653 +1,649 @@ -registry = $registry; - $this->DB = $this->registry->DB(); - $this->settings =& $this->registry->fetchSettings(); - $this->request =& $this->registry->fetchRequest(); - $this->member = $this->registry->member(); - $this->memberData =& $this->registry->member()->fetchMemberData(); - $this->cache = $this->registry->cache(); - $this->caches =& $this->registry->cache()->fetchCaches(); - $this->lang = $this->registry->class_localization; - } - -/** - * Setting titles wrapper - * - * @param array Setting groups - * @param string Application tab to start on - * @return string HTML - */ -public function settings_titles_wrapper($settings, $start_app='') { - -$IPBHTML = ""; -//--starthtml--// - -$_default_tab = !empty( $this->request['_dtab'] ) ? $this->request['_dtab'] : 'System'; - -$IPBHTML .= << -

    {$this->lang->words['tol_settings']}

    - - - -
    -

    {$this->lang->words['tol_settings_groups']}

    -
    - « - » -
      -EOF; - -$tab_names = array( 'System' => 'Система', 'Performance' => 'Производительность', 'IPS Apps' => 'Приложения', 'Members' => 'Пользователи', 'Advanced' => 'Дополнительно', 'Forums' => 'Форумы', 'Hooks' => 'Модификации'); - -foreach( $settings as $tab => $group ) -{ - $tab_name = ($tab_names[ $tab ]) ? $tab_names[ $tab ] : $tab; - - if ( ipsRegistry::$request['app'] AND $tab == ipsRegistry::$request['app'] ) - { - $_default_tab = $tab; - } - - $_tab = IPSText::md5Clean( $tab ); - -$IPBHTML .= <<{$tab_name} - -EOF; -} - -$IPBHTML .= << -
    - -
    -EOF; - - -foreach( $settings as $tab => $app_data ) -{ - $_tab = IPSText::md5Clean( $tab ); -$IPBHTML .= << - - -EOF; - foreach( $app_data as $r ) - { - - if(IN_DEV) - { - $export_settings_group = "
  • form_code}&do=MOD_export_setting&conf_group={$r['conf_title_id']}' title='{$this->lang->words['export_group']}'> {$this->lang->words['export_group']} -
  • "; - } - - $img = is_file( IPSLib::getAppDir( $r['conf_title_app'] ) . '/skin_cp/appIcon.png' ) ? $this->settings['base_acp_url'] . '/' . IPSLib::getAppFolder( $r['conf_title_app'] ) . '/' . $r['conf_title_app'] . '/skin_cp/appIcon.png' : "{$this->settings['skin_acp_url']}/images/applications/{$r['conf_title_app']}.png"; - -$IPBHTML .= << - - - -EOF; - } -$IPBHTML .= << - - -EOF; - -} - -$IPBHTML .= << - - - - -
    - -
    form_code}&do=settings_do_import' enctype='multipart/form-data' method='post'> -
    -

    {$this->lang->words['tol_import_xml_settings']}

    -
    {$this->lang->words[ - form_code}&do=setting_view&conf_group={$r['conf_title_id']}' class='larger_text'>{$r['conf_title_title']} - ({$r['conf_title_count']} {$this->lang->words['settings_suffix']}) -EOF; - -if( $r['conf_title_desc'] ) -{ - $IPBHTML .= <<{$r['conf_title_desc']} -EOF; -} - -$IPBHTML .= << - - - -
    - - - - - - - - -
    {$this->lang->words['tol_upload_xml_settings_file_from_']}
    {$this->lang->words['tol_duplicate_entries_will_not_be_']}
    {$this->lang->words['tol_or_enter_the_filename_of_the_x']}
    {$this->lang->words['tol_the_file_must_be_uploaded_into']}
    -
    - -
    -
    - - -EOF; - -//--endhtml--// -return $IPBHTML; -} - -/** - * Form to add/edit a setting group - * - * @param array Form elements - * @param string Form title - * @param string Action code - * @param string Button text - * @return string HTML - */ -public function settings_title_form($form, $title, $formcode, $button) { - -$IPBHTML = ""; -//--starthtml--// - -$IPBHTML .= << -

    {$this->lang->words['s_title']}

    -
    - -
    form_code}&do=$formcode&id={$this->request['id']}' method='post'> -
    -

    {$title}

    - - - - - - - - - - - - - - - - - -EOF; -//startif -if ( $form['conf_title_keyword'] != '' ) -{ -$IPBHTML .= << - - - - - - - -EOF; -}//endif -$IPBHTML .= << -
    - -
    - - -EOF; - -//--endhtml--// -return $IPBHTML; -} - -/** - * View settings wrapper - * - * @param string Page title - * @param string Content - * @param string Search button - * @param string Bounceback URL - * @return string HTML - */ -public function settings_view_wrapper( $title, $content, $searchbutton, $bounceback='' ) { - -$IPBHTML = ""; -//--starthtml--// - -$IPBHTML .= << -

    {$this->lang->words['settings_h_prefix']} {$title}

    -EOF; - - if ( ipsRegistry::$request['search'] == '' AND $bounceback == '' ) - { - if ( $searchbutton ) - { - $IPBHTML .= << - - -EOF; - } - }//endif - -$IPBHTML .= << -
    request['conf_group']}&search={$this->request['search']}' method='post'> - - -
    -

    {$title}

    -
    - {$this->lang->words['tol_setting_group_title']} - {$form['conf_title_title']}
    - {$this->lang->words['tol_setting_group_application']} - {$form['conf_title_app']}
    - {$this->lang->words['tol_setting_group_tab']} - {$form['conf_title_tab']}
    - {$this->lang->words['tol_setting_group_description']} - {$form['conf_title_desc']}
    - {$this->lang->words['tol_setting_group_keyword']} - - {$form['conf_title_keyword']}
    - {$this->lang->words['tol_used_to_pull_this_from_the_db_']} -
    - {$this->lang->words['tol_hide_from_main_settings_list']} - {$form['conf_title_noshow']}
    - {$content} -
    -
    - -
    -
    - - -EOF; - -//--endhtml--// -return $IPBHTML; -} - -/** - * Setting that starts a setting group - * - * @param array Setting - * @return string HTML - */ -public function settings_row_start_group($r) { - -$IPBHTML = ""; -//--starthtml--// - -$IPBHTML .= << -
    - - - - -EOF; - -//--endhtml--// -return $IPBHTML; -} - -/** - * View a setting row - * - * @param array Setting - * @param string Edit button - * @param string Delete button - * @param string Form element - * @param string Revert button - * @return string HTML - */ -public function settings_view_row($r, $edit, $delete, $form_element, $revert_button, $elem_type) { - -$IPBHTML = ""; -//--starthtml--// - -$this->row_class = $this->row_class == 'row1' ? 'row2' : 'row1'; - -$_isClass = !$r['conf_start_group'] ? "isDraggable" : ''; - -$IPBHTML .= << - - - - - -EOF; - -if( $r['conf_start_group'] ) -{ - $IPBHTML .= << - - -EOF; -} - -//--endhtml--// -return $IPBHTML; -} - -/** - * Automcplete field - * - * @return string HTML - */ -public function nameAutoCompleteField( $key, $val ) { - -$IPBHTML = ""; -//--starthtml--// - -$IPBHTML .= << - - -EOF; - -//--endhtml--// -return $IPBHTML; -} - -/** - * Form to add/edit a setting - * - * @param array Setting - * @param string Form title - * @param string Action code - * @param string Button text - * @return string HTML - */ -public function settings_form($form, $title, $formcode, $button) { - -$IPBHTML = ""; -//--starthtml--// - -$IPBHTML .= << -

    {$this->lang->words['add_setting_button']}

    - - -
    form_code}&do=$formcode&id={$this->request['id']}' method='post'> -
    -

    {$title}

    -
    {$r['conf_start_group']}
     
    - {$r['conf_title']} - - {$form_element}
    - {$r['conf_description']} -
    -EOF; - //startif - if ( $edit or $delete or $revert_button ) - { - $IPBHTML .= << - {$revert_button} - {$edit} - {$delete} - -EOF; - }//endif -$IPBHTML .= << -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -EOF; -//startif -if ( $form['conf_protected'] != '' ) -{ -$IPBHTML .= << - - - -EOF; -}//endif -$IPBHTML .= << - - - -
    - {$this->lang->words['tol_setting_title']} - - {$form['conf_title']} -
    - {$this->lang->words['tol_setting_position']} - - {$form['conf_position']} -
    - {$this->lang->words['tol_setting_description']} - - {$form['conf_description']} -
    - {$this->lang->words['tol_setting_group']} - - {$form['conf_group']} -
    - {$this->lang->words['tol_setting_type']} - - {$form['conf_type']} -
    - {$this->lang->words['tol_setting_key']} - - {$form['conf_key']} -
    - {$this->lang->words['tol_setting_current_value']} - - {$form['conf_value']} -
    - {$this->lang->words['tol_setting_default_value']} - - {$form['conf_default']} -
    - {$this->lang->words['tol_setting_extra']} - - {$form['conf_extra']}
    - {$this->lang->words['tol_use_for_creating_form_element_']} -
    - {$this->lang->words['tol_raw_php_code_to_eval_before_sh']} - - {$form['conf_evalphp']}
    - {$this->lang->words['tol_036show_1_is_set_when_showing_']} -
    - {$this->lang->words['setting_keywords']} - - {$form['conf_keywords']}
    - {$this->lang->words['setting_keywords_desc']} -
    - {$this->lang->words['tol_start_setting_group']} - - {$form['conf_start_group']}
    - {$this->lang->words['tol_enter_title_here_or_leave_blan']} -
    - {$this->lang->words['tol_make_a_default_setting_cannot_']} - - {$form['conf_protected']} -
    - {$this->lang->words['tol_add_this_option_into_the_setti']} - - {$form['conf_add_cache']} -
    -
    - -
    - - -EOF; - -//--endhtml--// -return $IPBHTML; -} +registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->member = $this->registry->member(); + $this->memberData =& $this->registry->member()->fetchMemberData(); + $this->cache = $this->registry->cache(); + $this->caches =& $this->registry->cache()->fetchCaches(); + $this->lang = $this->registry->class_localization; + } + +/** + * Setting titles wrapper + * + * @param array Setting groups + * @param string Application tab to start on + * @return string HTML + */ +public function settings_titles_wrapper($settings, $start_app='') { + +$IPBHTML = ""; +//--starthtml--// + +$_default_tab = !empty( $this->request['_dtab'] ) ? $this->request['_dtab'] : 'System'; + +$IPBHTML .= << +

    {$this->lang->words['tol_settings']}

    + + + +
    +

    {$this->lang->words['tol_settings_groups']}

    +
    + « + » +
      +EOF; + +foreach( $settings as $tab => $group ) +{ + if ( ipsRegistry::$request['app'] AND $tab == ipsRegistry::$request['app'] ) + { + $_default_tab = $tab; + } + + $_tab = IPSText::md5Clean( $tab ); + +$IPBHTML .= <<{$tab} + +EOF; +} + +$IPBHTML .= << +
    + +
    +EOF; + + +foreach( $settings as $tab => $app_data ) +{ + $_tab = IPSText::md5Clean( $tab ); +$IPBHTML .= << + + +EOF; + foreach( $app_data as $r ) + { + + if(IN_DEV) + { + $export_settings_group = "
  • form_code}&do=MOD_export_setting&conf_group={$r['conf_title_id']}' title='{$this->lang->words['export_group']}'> {$this->lang->words['export_group']} +
  • "; + } + + $img = is_file( IPSLib::getAppDir( $r['conf_title_app'] ) . '/skin_cp/appIcon.png' ) ? $this->settings['base_acp_url'] . '/' . IPSLib::getAppFolder( $r['conf_title_app'] ) . '/' . $r['conf_title_app'] . '/skin_cp/appIcon.png' : "{$this->settings['skin_acp_url']}/images/applications/{$r['conf_title_app']}.png"; + +$IPBHTML .= << + + + +EOF; + } +$IPBHTML .= << + + +EOF; + +} + +$IPBHTML .= << + + + + +
    + +
    form_code}&do=settings_do_import' enctype='multipart/form-data' method='post'> +
    +

    {$this->lang->words['tol_import_xml_settings']}

    +
    {$this->lang->words[ + form_code}&do=setting_view&conf_group={$r['conf_title_id']}' class='larger_text'>{$r['conf_title_title']} + ({$r['conf_title_count']} {$this->lang->words['settings_suffix']}) +EOF; + +if( $r['conf_title_desc'] ) +{ + $IPBHTML .= <<{$r['conf_title_desc']} +EOF; +} + +$IPBHTML .= << + + + +
    + + + + + + + + +
    {$this->lang->words['tol_upload_xml_settings_file_from_']}
    {$this->lang->words['tol_duplicate_entries_will_not_be_']}
    {$this->lang->words['tol_or_enter_the_filename_of_the_x']}
    {$this->lang->words['tol_the_file_must_be_uploaded_into']}
    +
    + +
    +
    + + +EOF; + +//--endhtml--// +return $IPBHTML; +} + +/** + * Form to add/edit a setting group + * + * @param array Form elements + * @param string Form title + * @param string Action code + * @param string Button text + * @return string HTML + */ +public function settings_title_form($form, $title, $formcode, $button) { + +$IPBHTML = ""; +//--starthtml--// + +$IPBHTML .= << +

    {$this->lang->words['s_title']}

    +
    + +
    form_code}&do=$formcode&id={$this->request['id']}' method='post'> +
    +

    {$title}

    + + + + + + + + + + + + + + + + + +EOF; +//startif +if ( $form['conf_title_keyword'] != '' ) +{ +$IPBHTML .= << + + + + + + + +EOF; +}//endif +$IPBHTML .= << +
    + +
    + + +EOF; + +//--endhtml--// +return $IPBHTML; +} + +/** + * View settings wrapper + * + * @param string Page title + * @param string Content + * @param string Search button + * @param string Bounceback URL + * @return string HTML + */ +public function settings_view_wrapper( $title, $content, $searchbutton, $bounceback='' ) { + +$IPBHTML = ""; +//--starthtml--// + +$IPBHTML .= << +

    {$this->lang->words['settings_h_prefix']} {$title}

    +EOF; + + if ( ipsRegistry::$request['search'] == '' AND $bounceback == '' ) + { + if ( $searchbutton ) + { + $IPBHTML .= << + + +EOF; + } + }//endif + +$IPBHTML .= << +
    request['conf_group']}&search={$this->request['search']}' method='post'> + + +
    +

    {$title}

    +
    + {$this->lang->words['tol_setting_group_title']} + {$form['conf_title_title']}
    + {$this->lang->words['tol_setting_group_application']} + {$form['conf_title_app']}
    + {$this->lang->words['tol_setting_group_tab']} + {$form['conf_title_tab']}
    + {$this->lang->words['tol_setting_group_description']} + {$form['conf_title_desc']}
    + {$this->lang->words['tol_setting_group_keyword']} + + {$form['conf_title_keyword']}
    + {$this->lang->words['tol_used_to_pull_this_from_the_db_']} +
    + {$this->lang->words['tol_hide_from_main_settings_list']} + {$form['conf_title_noshow']}
    + {$content} +
    +
    + +
    +
    + + +EOF; + +//--endhtml--// +return $IPBHTML; +} + +/** + * Setting that starts a setting group + * + * @param array Setting + * @return string HTML + */ +public function settings_row_start_group($r) { + +$IPBHTML = ""; +//--starthtml--// + +$IPBHTML .= << +
    + + + + +EOF; + +//--endhtml--// +return $IPBHTML; +} + +/** + * View a setting row + * + * @param array Setting + * @param string Edit button + * @param string Delete button + * @param string Form element + * @param string Revert button + * @return string HTML + */ +public function settings_view_row($r, $edit, $delete, $form_element, $revert_button, $elem_type) { + +$IPBHTML = ""; +//--starthtml--// + +$this->row_class = $this->row_class == 'row1' ? 'row2' : 'row1'; + +$_isClass = !$r['conf_start_group'] ? "isDraggable" : ''; + +$IPBHTML .= << + + + + + +EOF; + +if( $r['conf_start_group'] ) +{ + $IPBHTML .= << + + +EOF; +} + +//--endhtml--// +return $IPBHTML; +} + +/** + * Automcplete field + * + * @return string HTML + */ +public function nameAutoCompleteField( $key, $val ) { + +$IPBHTML = ""; +//--starthtml--// + +$IPBHTML .= << + + +EOF; + +//--endhtml--// +return $IPBHTML; +} + +/** + * Form to add/edit a setting + * + * @param array Setting + * @param string Form title + * @param string Action code + * @param string Button text + * @return string HTML + */ +public function settings_form($form, $title, $formcode, $button) { + +$IPBHTML = ""; +//--starthtml--// + +$IPBHTML .= << +

    {$this->lang->words['add_setting_button']}

    + + +
    form_code}&do=$formcode&id={$this->request['id']}' method='post'> +
    +

    {$title}

    +
    {$r['conf_start_group']}
     
    + {$r['conf_title']} + + {$form_element}
    + {$r['conf_description']} +
    +EOF; + //startif + if ( $edit or $delete or $revert_button ) + { + $IPBHTML .= << + {$revert_button} + {$edit} + {$delete} + +EOF; + }//endif +$IPBHTML .= << +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +EOF; +//startif +if ( $form['conf_protected'] != '' ) +{ +$IPBHTML .= << + + + +EOF; +}//endif +$IPBHTML .= << + + + +
    + {$this->lang->words['tol_setting_title']} + + {$form['conf_title']} +
    + {$this->lang->words['tol_setting_position']} + + {$form['conf_position']} +
    + {$this->lang->words['tol_setting_description']} + + {$form['conf_description']} +
    + {$this->lang->words['tol_setting_group']} + + {$form['conf_group']} +
    + {$this->lang->words['tol_setting_type']} + + {$form['conf_type']} +
    + {$this->lang->words['tol_setting_key']} + + {$form['conf_key']} +
    + {$this->lang->words['tol_setting_current_value']} + + {$form['conf_value']} +
    + {$this->lang->words['tol_setting_default_value']} + + {$form['conf_default']} +
    + {$this->lang->words['tol_setting_extra']} + + {$form['conf_extra']}
    + {$this->lang->words['tol_use_for_creating_form_element_']} +
    + {$this->lang->words['tol_raw_php_code_to_eval_before_sh']} + + {$form['conf_evalphp']}
    + {$this->lang->words['tol_036show_1_is_set_when_showing_']} +
    + {$this->lang->words['setting_keywords']} + + {$form['conf_keywords']}
    + {$this->lang->words['setting_keywords_desc']} +
    + {$this->lang->words['tol_start_setting_group']} + + {$form['conf_start_group']}
    + {$this->lang->words['tol_enter_title_here_or_leave_blan']} +
    + {$this->lang->words['tol_make_a_default_setting_cannot_']} + + {$form['conf_protected']} +
    + {$this->lang->words['tol_add_this_option_into_the_setti']} + + {$form['conf_add_cache']} +
    +
    + +
    + + +EOF; + +//--endhtml--// +return $IPBHTML; +} } \ No newline at end of file diff --git a/upload/admin/applications/core/skin_cp/cp_skin_setup.php b/upload/admin/applications/core/skin_cp/cp_skin_setup.php index e73ae50a..a0dba650 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_setup.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_setup.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Setup skin file
      * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/skin_cp/cp_skin_spamlogs.php b/upload/admin/applications/core/skin_cp/cp_skin_spamlogs.php index cbe42fb8..31c55f70 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_spamlogs.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_spamlogs.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Error log skin file
      * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/skin_cp/cp_skin_spiderlogs.php b/upload/admin/applications/core/skin_cp/cp_skin_spiderlogs.php index f32304c5..e9563cfd 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_spiderlogs.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_spiderlogs.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Spiderlogs skin file
      * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/skin_cp/cp_skin_sql.php b/upload/admin/applications/core/skin_cp/cp_skin_sql.php index b02f5022..79948fb3 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_sql.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_sql.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * SQL Toolbox skin file
      * Last Updated: $Date: 2013-01-17 15:51:17 -0500 (Thu, 17 Jan 2013) $
      * 
    diff --git a/upload/admin/applications/core/skin_cp/cp_skin_system.php b/upload/admin/applications/core/skin_cp/cp_skin_system.php index 7dea4c3d..a02947a2 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_system.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_system.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * System tools skin file
      * Last Updated: $Date: 2013-04-23 09:51:07 -0400 (Tue, 23 Apr 2013) $
      * 
    diff --git a/upload/admin/applications/core/skin_cp/cp_skin_templates.php b/upload/admin/applications/core/skin_cp/cp_skin_templates.php index 15782bac..0af5b27f 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_templates.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_templates.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Look and feel skin file
      * Last Updated: $Date: 2013-04-12 20:11:40 -0400 (Fri, 12 Apr 2013) $
      * 
    @@ -272,11 +272,6 @@ $IPBHTML .= <<{$this->lang->words['skin_gen_new_title']} -HTML; - - if ( $hasActiveLicense ) - { - $IPBHTML .= << -HTML; - } - else - { - $url = "{$this->settings['base_url']}&app=core&module=tools&section=licensekey"; - $lang = sprintf( $this->lang->words['vse_disabled_why'], $url ); - - $IPBHTML .= << - -HTML; - } - -$IPBHTML .= << diff --git a/upload/admin/applications/core/skin_cp/cp_skin_tools.php b/upload/admin/applications/core/skin_cp/cp_skin_tools.php index 7520949b..355449b6 100644 --- a/upload/admin/applications/core/skin_cp/cp_skin_tools.php +++ b/upload/admin/applications/core/skin_cp/cp_skin_tools.php @@ -1,7 +1,7 @@ * Invision Power Services - * IP.Board v3.4.5 + * IP.Board v3.4.6 * Warn log skin file * Last Updated: $Date: 2012-09-17 11:58:03 -0400 (Mon, 17 Sep 2012) $ * diff --git a/upload/admin/applications/core/skin_cp/images/index.html b/upload/admin/applications/core/skin_cp/images/index.html index bae2d5ed..dc71892e 100644 --- a/upload/admin/applications/core/skin_cp/images/index.html +++ b/upload/admin/applications/core/skin_cp/images/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/skin_cp/index.html b/upload/admin/applications/core/skin_cp/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/skin_cp/index.html +++ b/upload/admin/applications/core/skin_cp/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/sources/classes/attach/class_attach.php b/upload/admin/applications/core/sources/classes/attach/class_attach.php index bef76cc7..0634841d 100644 --- a/upload/admin/applications/core/sources/classes/attach/class_attach.php +++ b/upload/admin/applications/core/sources/classes/attach/class_attach.php @@ -1,1700 +1,1700 @@ - - * Invision Power Services - * IP.Board v3.4.5 - * Attachments - * Last Updated: $Date: 2013-05-28 10:00:25 -0400 (Tue, 28 May 2013) $ - * - * - * - * Possible Error strings: - * - upload_no_file (No file was selected to upload) - * - upload_failed (Upload failed for unspecified reason) - * - upload_too_big (Upload is bigger than space left) - * - invalid_mime_type (Upload is not allowed) - * - no_upload_dir (Upload dir is not installed) - * - no_upload_dir_perms (Upload dir is not writeable) - * - * - * @author $Author: AndyMillne $ - * @copyright (c) 2001 - 2009 Invision Power Services, Inc. - * @license http://www.invisionpower.com/company/standards.php#license - * @package IP.Board - * @subpackage Core - * @link http://www.invisionpower.com - * @version $Rev: 12273 $ - */ - -if ( ! defined( 'IN_IPB' ) ) -{ - print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -class class_attach -{ - /** - * Global html class - * - * @var object - */ - public $html; - - /** - * Type of attachment - * - * @var string - */ - public $type = ''; - - /** - * Plugin Class - * - * @var object - */ - public $plugin = ''; - - /** - * Post key - * - * @var string - */ - public $attach_post_key = ''; - - /** - * Relationship ID - * - * @var integer - */ - public $attach_rel_id = 0; - - /** - * Relationship parent ID - * - * @var int - */ - public $attach_parent_id = 0; - - /** - * Return variables - * - * @var array [ 'allow_uploads', 'space_allowed', 'space_allowed_human', 'space_used', 'space_used_human', 'space_left', 'space_left_human' ] - */ - public $attach_stats = array(); - - /** - * Lang array - * Internal language array - * - * @var array - */ - public $language = array( 'unlimited' => 'Неограничено', - 'not_allowed' => 'Загружать файлы запрещено' ); - - /** - * Error array - * - * @var string - */ - public $error = ""; - - /** - * Full upload path - * - * @var string - */ - public $upload_path = ''; - - /** - * Upload part part (from /uploads) - * - * @var string - */ - public $upload_dir = ''; - - /** - * Extra upload form url - * - * @var string - */ - public $extra_upload_form_url = ''; - - /** - * Custom settings - * - * @var array - */ - public $attach_settings = array( - 'siu_thumb' => 0, - 'siu_height' => 0, - 'siu_width' => 0, - 'allow_monthly_upload_dirs' => 0, - 'upload_dir' => '' - ); - - /**#@+ - * Registry Object Shortcuts - * - * @var object - */ - protected $registry; - protected $DB; - protected $settings; - protected $request; - protected $lang; - protected $member; - protected $memberData; - /**#@-*/ - - /** - * CONSTRUCTOR - * - * @param object ipsRegistry reference - * @return @e void - */ - public function __construct( ipsRegistry $registry ) - { - /* Make object */ - $this->registry = $registry; - $this->DB = $this->registry->DB(); - $this->settings =& $this->registry->fetchSettings(); - $this->request =& $this->registry->fetchRequest(); - $this->lang = $this->registry->getClass('class_localization'); - $this->member = $this->registry->member(); - $this->memberData =& $this->registry->member()->fetchMemberData(); - } - - /** - * Initiates class - * - * @return @e void - */ - public function init() - { - //----------------------------------------- - // Start the settings - //----------------------------------------- - - $this->attach_settings['siu_thumb'] = $this->settings['siu_thumb']; - $this->attach_settings['siu_height'] = $this->settings['siu_height']; - $this->attach_settings['siu_width'] = $this->settings['siu_width']; - $this->attach_settings['allow_monthly_upload_dirs'] = @ini_get("safe_mode") ? 0 : ( $this->settings['safe_mode_skins'] ? 0 : 1 ); - $this->attach_settings['upload_dir'] = $this->settings['upload_dir']; - - //----------------------------------------- - // Load plug in - //----------------------------------------- - - if ( $this->type ) - { - $this->loadAttachmentPlugin(); - } - - //----------------------------------------- - // Finalize the settings - //----------------------------------------- - - foreach( $this->attach_settings as $item => $value ) - { - $this->attach_settings[ $item ] = ( isset( $this->plugin->mysettings[ $item ] ) ) ? $this->plugin->mysettings[ $item ] : $value; - } - - //----------------------------------------- - // Fix up URL tokens - //----------------------------------------- - - foreach( $this->request as $k => $v ) - { - if ( preg_match( "#^--ff--#", $k ) ) - { - $this->request[ str_replace( '--ff--', '', $k ) ] = $v; - } - } - - //----------------------------------------- - // Sort out upload dir - //----------------------------------------- - - $this->upload_path = $this->attach_settings['upload_dir']; - - $this->_upload_path = $this->upload_path; - } - - /** - * Show the attachment (or force download) - * - * @param int Attachment ID (The main attach id) - * @return @e void - */ - public function showAttachment( $attach_id ) - { - /* INIT */ - $sql_data = array(); - - /* Get attach data... */ - $attachment = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'attachments', 'where' => 'attach_id='.intval( $attach_id ) ) ); - - if( ! $attachment['attach_id'] ) - { - $this->registry->getClass('output')->showError( 'attach_no_attachment', 10170, false, null, 404 ); - } - - /* Load correct plug in... */ - $this->type = $attachment['attach_rel_module']; - $this->loadAttachmentPlugin(); - - /* Get SQL data from plugin */ - $attach = $this->plugin->getAttachmentData( $attach_id ); - - /* Got a reply? */ - if( $attach === FALSE OR ! is_array( $attach ) ) - { - $this->registry->getClass('output')->showError( 'no_permission_to_download', 10171, null, null, 403 ); - } - - /* Got a rel id? */ - if( ! $attach['attach_rel_id'] AND $attach['attach_member_id'] != $this->memberData['member_id'] ) - { - $this->registry->getClass('output')->showError( 'err_attach_not_attached', 10172, null, null, 403 ); - } - - //----------------------------------------- - // Reset timeout for large attachments - //----------------------------------------- - - if ( @function_exists("set_time_limit") == 1 and SAFE_MODE_ON == 0 ) - { - @set_time_limit( 0 ); - } - - if( is_array( $attach ) AND count( $attach ) ) - { - /* Got attachment types? */ - if ( ! is_array( $this->registry->cache()->getCache('attachtypes') ) ) - { - $attachtypes = array(); - - $this->DB->build( array( 'select' => 'atype_extension,atype_mimetype', 'from' => 'attachments_type' ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $attachtypes[ $r['atype_extension'] ] = $r; - } - - $this->registry->cache()->updateCacheWithoutSaving( 'attachtypes', $attachtypes ); - } - - /* Show attachment */ - $attach_cache = $this->registry->cache()->getCache('attachtypes'); - $this->_upload_path = ( isset( $this->plugin->mysettings[ 'upload_dir' ] ) ) ? $this->plugin->mysettings[ 'upload_dir' ] : $this->attach_settings[ 'upload_dir' ]; - - $file = $this->_upload_path . "/" . $attach['attach_location']; - - if( is_file( $file ) and ( $attach_cache[ $attach['attach_ext'] ]['atype_mimetype'] != "" ) ) - { - /* Update the "hits".. */ - $this->DB->buildAndFetch( array( 'update' => 'attachments', 'set' => "attach_hits=attach_hits+1", 'where' => "attach_id={$attach_id}" ) ); - - /* Open and display the file.. */ - header( "Content-Type: {$attach_cache[ $attach['attach_ext'] ]['atype_mimetype']}" ); - - $disposition = $attach['attach_is_image'] ? "inline" : "attachment"; - - if( in_array( $this->memberData['userAgentKey'], array( 'firefox', 'opera' ) ) ) - { - @header( 'Content-Disposition: ' . $disposition . "; filename*={$this->settings['gb_char_set']}''" . rawurlencode( IPSText::UNhtmlspecialchars( $attach['attach_file'] ) ) ); - } - else if( in_array( $this->memberData['userAgentKey'], array( 'explorer' ) ) ) - { - @header( 'Content-Disposition: ' . $disposition . '; filename="' . rawurlencode( IPSText::UNhtmlspecialchars( $attach['attach_file'] ) ) . '"' ); - } - else - { - @header( 'Content-Disposition: ' . $disposition . '; filename="' . IPSText::UNhtmlspecialchars( $attach['attach_file'] ) . '"' ); - } - - if( ( !ini_get('zlib.output_compression') OR ini_get('zlib.output_compression') == 'off' ) AND ini_get('output_handler') != 'ob_gzhandler' ) - { - header( 'Content-Length: ' . (string) ( filesize( $file ) ) ); - } - - /** - * @link http://community.invisionpower.com/tracker/issue-22011-wrong-way-to-handle-attachments-transfer/ - */ - if ( function_exists('ob_end_clean') AND ini_get('output_handler') != 'ob_gzhandler' ) - { - @ob_end_clean(); - } - - if( function_exists('readfile') ) - { - readfile( $file ); - } - else - { - if( $fh = fopen( $file, 'rb' ) ) - { - while( ! feof( $fh ) ) - { - echo fread( $fh, 4096 ); - - if ( function_exists('ob_get_length') AND function_exists('ob_flush') AND @ob_get_length() ) - { - @ob_flush(); - } - else - { - @flush(); - } - } - - @fclose( $fh ); - } - } - - exit(); - } - else - { - /* File does not exist.. */ - $this->registry->getClass('output')->showError( 'attach_file_missing', 10173 ); - } - } - else - { - /* No permission? */ - $this->registry->getClass('output')->showError( 'no_permission_to_download', 10174, null, null, 403 ); - } - } - - /** - * Retrieve the HTML for a single attachment - * - * @param mixed Array of attachment data, or an attachment ID - * @param string Skin group to use - * @param bool Whether to wrap with the attachment block wrapper or not - * @return string Attachment HTML - */ - public function renderSingleAttachment( $attachment, $skin_name='topic', $use_wrapper=false ) - { - if( is_int($attachment) ) - { - $row = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'attachments', 'where' => 'attach_id=' . intval($attachment) ) ); - } - else - { - $row = $attachment; - } - - if( !$row['attach_id'] ) - { - return ''; - } - - $attachtypes = $this->getAttachTypes(); - $type = ''; - - //----------------------------------------- - // Is it an image, and are we viewing the image in the post? - //----------------------------------------- - - if ( $this->settings['show_img_upload'] and $row['attach_is_image'] ) - { - if ( $this->attach_settings['siu_thumb'] AND $row['attach_thumb_location'] AND $row['attach_thumb_width'] ) - { - //----------------------------------------- - // Make sure we've not seen this ID - //----------------------------------------- - - $row['_attach_id'] = $row['attach_id'] . '-' . str_replace( array( '.', ' ' ), "-", microtime() ); - - $type = 'thumb'; - $tmp = $this->registry->getClass('output')->getTemplate( $skin_name )->Show_attachments_img_thumb( array( - 't_location' => $row['attach_thumb_location'], - 't_width' => $row['attach_thumb_width'], - 't_height' => $row['attach_thumb_height'], - 'o_width' => $row['attach_img_width'], - 'o_height' => $row['attach_img_height'], - 'attach_id' => $row['attach_id'], - '_attach_id' => $row['_attach_id'], - 'file_size' => IPSLib::sizeFormat( $row['attach_filesize'] ), - 'attach_hits' => $row['attach_hits'], - 'location' => $row['attach_file'], - 'type' => $this->type, - 'notinline' => 1, - 'attach_rel_id' => $row['attach_rel_id'], - 'a_location' => $row['attach_location'] - ) ); - } - else - { - //----------------------------------------- - // Standard size.. - //----------------------------------------- - - $type = 'image'; - $tmp = $this->registry->getClass('output')->getTemplate( $skin_name )->Show_attachments_img( array( - 'o_location' => $row['attach_location'], - 'o_width' => $row['attach_img_width'], - 'o_height' => $row['attach_img_height'], - 'attach_id' => $row['attach_id'], - '_attach_id' => $row['_attach_id'], - 'file_size' => IPSLib::sizeFormat( $row['attach_filesize'] ), - 'attach_hits' => $row['attach_hits'], - 'location' => $row['attach_file'], - 'type' => $this->type, - 'notinline' => 1, - 'attach_rel_id' => $row['attach_rel_id'] - ) ); - } - } - else - { - //----------------------------------------- - // Full attachment thingy - //----------------------------------------- - - $type = 'attach'; - $tmp = $this->registry->getClass('output')->getTemplate( $skin_name )->Show_attachments( array ( - 'attach_hits' => $row['attach_hits'], - 'mime_image' => $attachtypes[ $row['attach_ext'] ]['atype_img'], - 'attach_file' => $row['attach_file'], - 'attach_id' => $row['attach_id'], - 'type' => $this->type, - 'file_size' => IPSLib::sizeFormat( $row['attach_filesize'] ), - ) ); - } - - //----------------------------------------- - // Wrap? - //----------------------------------------- - - if ( $use_wrapper ) - { - switch( $type ) - { - case 'thumb': - $tmp = $this->registry->getClass('output')->getTemplate( $skin_name )->show_attachment_title( $this->lang->words['attach_thumbs'], $tmp, 'thumb' ); - break; - - case 'image': - $tmp = $this->registry->getClass('output')->getTemplate( $skin_name )->show_attachment_title( $this->lang->words['attach_images'], $tmp, 'image' ); - break; - - default: - case 'attach': - $tmp = $this->registry->getClass('output')->getTemplate( $skin_name )->show_attachment_title( $this->lang->words['attach_normal'], $tmp, 'attach' ); - break; - } - } - - return $tmp; - } - - /** - * Retrieve attachment types from cache - * - * @return @e array - */ - protected function getAttachTypes() - { - //----------------------------------------- - // Got attachment types? - //----------------------------------------- - - if ( ! is_array( $this->registry->cache()->getCache('attachtypes') ) ) - { - $attachtypes = array(); - - $this->DB->build( array( 'select' => 'atype_extension,atype_mimetype,atype_img', 'from' => 'attachments_type' ) ); - $outer = $this->DB->execute(); - - while ( $r = $this->DB->fetch( $outer ) ) - { - $attachtypes[ $r['atype_extension'] ] = $r; - } - - $this->registry->cache()->updateCacheWithoutSaving( 'attachtypes', $attachtypes ); - } - else - { - $attachtypes = $this->registry->cache()->getCache('attachtypes'); - } - - return $attachtypes; - } - - /** - * Swaps the HTML for the nice attachments. - * - * @param array Array of HTML blocks to convert: [ rel_id => $html ] - * @param array Relationship ids - * @param string Skin group to use - * @return array Array of converted HTML blocks and attach code: [ id => $html ] - */ - public function renderAttachments( $htmlArray, $rel_ids=array(), $skin_name='topic', $parse_og=true ) - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $attach_ids = array(); - $map_attach_id_to_rel_id = array(); - $final_out = array(); - $final_blocks = array(); - $returnArray = array(); - $_seen = 0; - - //----------------------------------------- - // Check.. - //----------------------------------------- - - if ( ! is_array( $htmlArray ) ) - { - $htmlArray = array( 0 => $htmlArray ); - } - - //----------------------------------------- - // Rel ids - //----------------------------------------- - - if ( ! is_array( $rel_ids ) OR ! count( $rel_ids ) ) - { - $rel_ids = array_keys( $htmlArray ); - } - - //----------------------------------------- - // Parse HTML blocks for attach ids - // [attachment=32:attachFail.gif] - //----------------------------------------- - - foreach( $htmlArray as $id => $html ) - { - $returnArray[ $id ] = array( 'html' => $html, 'attachmentHtml' => '' ); - - preg_match_all( '#\[attachment=(\d+?)\:(?:[^\]]+?)\]#is', $html, $match ); - - if ( is_array( $match[0] ) and count( $match[0] ) ) - { - for ( $i = 0 ; $i < count( $match[0] ) ; $i++ ) - { - if ( intval($match[1][$i]) == $match[1][$i] ) - { - $attach_ids[ $match[1][$i] ] = $match[1][$i]; - $map_attach_id_to_rel_id[ $match[1][$i] ][] = $id; - } - } - } - } - - //----------------------------------------- - // Get data from the plug in - //----------------------------------------- - - $rows = $this->plugin->renderAttachment( $attach_ids, $rel_ids, $this->attach_post_key ); - - //----------------------------------------- - // Got anything? - //----------------------------------------- - - if ( is_array( $rows ) AND count( $rows ) ) - { - $attachtypes = $this->getAttachTypes(); - - foreach( $rows as $_attach_id => $row ) - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $row = $rows[ $_attach_id ]; - - /* Make older attachments safe */ - $row['attach_file'] = str_replace( '<', '<', $row['attach_file'] ); - $row['attach_file'] = str_replace( '>', '>', $row['attach_file'] ); - - /* this is now done at upload */ - //$row['attach_file'] = htmlspecialchars( $row['attach_file'] ); - - $this->attach_rel_id = $row['attach_rel_id']; - - if ( ! isset( $final_blocks[ $row['attach_rel_id'] ] ) ) - { - $final_blocks[ $row['attach_rel_id'] ] = array( 'attach' => '', 'thumb' => '', 'image' => '' ); - } - - //----------------------------------------- - // Is it an image, and are we viewing the image in the post? - //----------------------------------------- - - if ( $this->settings['show_img_upload'] and $row['attach_is_image'] ) - { - if ( $this->attach_settings['siu_thumb'] AND $row['attach_thumb_location'] AND $row['attach_thumb_width'] ) - { - //----------------------------------------- - // Make sure we've not seen this ID - //----------------------------------------- - - $row['_attach_id'] = $row['attach_id'] . '-' . str_replace( array( '.', ' ' ), "-", microtime() ); - - $tmp = $this->registry->getClass('output')->getTemplate( $skin_name )->Show_attachments_img_thumb( array( 't_location' => $row['attach_thumb_location'], - 't_width' => $row['attach_thumb_width'], - 't_height' => $row['attach_thumb_height'], - 'o_width' => $row['attach_img_width'], - 'o_height' => $row['attach_img_height'], - 'attach_id' => $row['attach_id'], - '_attach_id' => $row['_attach_id'], - 'file_size' => IPSLib::sizeFormat( $row['attach_filesize'] ), - 'attach_hits' => $row['attach_hits'], - 'location' => $row['attach_file'], - 'type' => $this->type, - 'a_location' => $row['attach_location'], - 'attach_rel_id' => $row['attach_rel_id'] ), - $parse_og ); - - //----------------------------------------- - // Convert HTML - //----------------------------------------- - - if ( isset($map_attach_id_to_rel_id[ $_attach_id ]) AND is_array( $map_attach_id_to_rel_id[ $_attach_id ] ) AND count( $map_attach_id_to_rel_id[ $_attach_id ] ) ) - { - foreach( $map_attach_id_to_rel_id[ $_attach_id ] as $idx => $_rel_id ) - { - $_count = substr_count( $htmlArray[ $_rel_id ], '[attachment='.$row['attach_id'].':' ); - - if ( $_count > 1 ) - { - # More than 1 of the same thumbnail to show? - $this->_current = array( 'type' => $this->type, - 'row' => $row, - 'skin_name' => $skin_name ); - - $returnArray[ $_rel_id ]['html'] = preg_replace_callback( '#\[attachment='.$row['attach_id'].'\:(?:[^\]]+?)[\n|\]]#is', array( &$this, '_parseThumbnailInline' ), $returnArray[ $_rel_id ]['html'] ); - } - else if ( $_count ) - { - # Just the one, then? - $returnArray[ $_rel_id ]['html'] = preg_replace( '#\[attachment='.$row['attach_id'].'\:(?:[^\]]+?)[\n|\]]#is', $tmp, $returnArray[ $_rel_id ]['html'] ); - } - else - { - $final_blocks[ $_rel_id ]['thumb'][] = $tmp; - } - } - } - else - { - $final_blocks[ $row['attach_rel_id'] ]['thumb'][] = $tmp; - } - } - else - { - //----------------------------------------- - // Standard size.. - //----------------------------------------- - - $tmp = $this->registry->getClass('output')->getTemplate( $skin_name )->Show_attachments_img( array( 'o_location' => $row['attach_location'], - 'o_width' => $row['attach_img_width'], - 'o_height' => $row['attach_img_height'], - 'attach_id' => $row['attach_id'], - '_attach_id' => $row['_attach_id'], - 'file_size' => IPSLib::sizeFormat( $row['attach_filesize'] ), - 'attach_hits' => $row['attach_hits'], - 'location' => $row['attach_file'], - 'type' => $this->type, - 'notinline' => 1, - 'a_location' => $row['attach_location'], - 'attach_rel_id' => $row['attach_rel_id'] ), - $parse_og ); - - if ( is_array( $map_attach_id_to_rel_id[ $_attach_id ] ) AND count( $map_attach_id_to_rel_id[ $_attach_id ] ) ) - { - foreach( $map_attach_id_to_rel_id[ $_attach_id ] as $idx => $_rel_id ) - { - if ( strstr( $htmlArray[ $_rel_id ], '[attachment='.$row['attach_id'].':' ) ) - { - $returnArray[ $_rel_id ]['html'] = preg_replace( '#\[attachment='.$row['attach_id'].'\:(?:[^\]]+?)[\n|\]]#is', $tmp, $returnArray[ $_rel_id ]['html'] ); - } - else - { - $final_blocks[ $_rel_id ]['image'][] = $tmp; - } - } - } - else - { - $final_blocks[ $row['attach_rel_id'] ]['image'][] = $tmp; - } - } - } - else - { - //----------------------------------------- - // Full attachment thingy - //----------------------------------------- - - $attach_cache = $this->registry->cache()->getCache('attachtypes'); - - $tmp = $this->registry->getClass('output')->getTemplate( $skin_name )->Show_attachments( array ( - 'attach_hits' => $row['attach_hits'], - 'mime_image' => $attach_cache[ $row['attach_ext'] ]['atype_img'], - 'attach_file' => $row['attach_file'], - 'attach_id' => $row['attach_id'], - 'type' => $this->type, - 'file_size' => IPSLib::sizeFormat( $row['attach_filesize'] ), - ) ); - if ( is_array( $map_attach_id_to_rel_id[ $_attach_id ] ) AND count( $map_attach_id_to_rel_id[ $_attach_id ] ) ) - { - foreach( $map_attach_id_to_rel_id[ $_attach_id ] as $idx => $_rel_id ) - { - if ( strstr( $htmlArray[ $_rel_id ], '[attachment='.$row['attach_id'].':' ) ) - { - $returnArray[ $_rel_id ]['html'] = preg_replace( '#\[attachment='.$row['attach_id'].'\:(?:[^\]]+?)[\n|\]]#is', $tmp, $returnArray[ $_rel_id ]['html'] ); - } - else - { - $final_blocks[ $_rel_id ]['attach'][] = $tmp; - } - } - } - else - { - $final_blocks[ $row['attach_rel_id'] ]['attach'][] = $tmp; - } - } - } - - //----------------------------------------- - // Anthing to add? - //----------------------------------------- - - if ( count( $final_blocks ) ) - { - foreach( $final_blocks as $rel_id => $type ) - { - $temp_out = ""; - - if ( $final_blocks[ $rel_id ]['thumb'] ) - { - $temp_out .= $this->registry->getClass('output')->getTemplate( $skin_name )->show_attachment_title( $this->lang->words['attach_thumbs'], $final_blocks[ $rel_id ]['thumb'], 'thumb' ); - } - - if ( $final_blocks[ $rel_id ]['image'] ) - { - $temp_out .= $this->registry->getClass('output')->getTemplate( $skin_name )->show_attachment_title( $this->lang->words['attach_images'], $final_blocks[ $rel_id ]['image'], 'image' ); - } - - if ( $final_blocks[ $rel_id ]['attach'] ) - { - $temp_out .= $this->registry->getClass('output')->getTemplate( $skin_name )->show_attachment_title( $this->lang->words['attach_normal'], $final_blocks[ $rel_id ]['attach'], 'attach' ); - } - - if ( $temp_out ) - { - $returnArray[ $rel_id ]['attachmentHtml'] = $temp_out; - } - } - } - } - - return $returnArray; - } - - /** - * Archive attachments - * Currently this just flags them as archived. It does not physically move the files as - * this seems a bit pointless as they have to stay in the file system anyway - * - * @param array $archiveIds - * @param string $idType - */ - public function bulkArchive( $archiveIds=array(), $idType='attach_rel_id' ) - { - /* Make sure we have some ids */ - if ( ! is_array( $archiveIds ) or ! count( $archiveIds ) ) - { - return FALSE; - } - - /* Update */ - $this->DB->update( 'attachments', array( 'attach_is_archived' => 1 ), $idType . ' IN (' . implode( ',', $archiveIds ) . ") AND attach_rel_module='" . $this->type . "'" ); - } - - /** - * Unarchive attachments - * Currently this just flags them as unarchived. It does not physically move the files as - * this seems a bit pointless as they have to stay in the file system anyway - * - * @param array $archiveIds - * @param string $idType - */ - public function bulkUnarchive( $archiveIds=array(), $idType='attach_rel_id' ) - { - /* Make sure we have some ids */ - if ( ! is_array( $archiveIds ) or ! count( $archiveIds ) ) - { - return FALSE; - } - - /* Update */ - $this->DB->update( 'attachments', array( 'attach_is_archived' => 0 ), $idType . ' IN (' . implode( ',', $archiveIds ) . ") AND attach_rel_module='" . $this->type . "'" ); - } - - /** - * Removes attachment(s) - * - * @param array $remove_ids Array of attachment ids to remove - * @param string $id_type Column to use when deleting, attach_rel_id by default - * @return bool - */ - public function bulkRemoveAttachment( $remove_ids=array(), $id_type='attach_rel_id' ) - { - /* INIT */ - $attachments = array(); - - /* Make sure we have some ids */ - if ( ! is_array( $remove_ids ) or ! count( $remove_ids ) ) - { - return FALSE; - } - - /* Check Permissions */ - if( $this->plugin->canBulkRemove( $remove_ids ) === TRUE ) - { - /* Grab the attachments */ - $this->DB->build( array( - 'select' => '*', - 'from' => 'attachments', - 'where' => $id_type . ' IN (' . implode( ',', $remove_ids ) . ") AND attach_rel_module='{$this->type}'" - ) ); - - $this->DB->execute(); - - while( $_row = $this->DB->fetch() ) - { - $attachments[ $_row['attach_id'] ] = $_row; - } - - /* Loop through and delete them from the filesystem */ - foreach( $attachments as $attach_id => $attachment ) - { - if ( $attachment['attach_location'] ) - { - @unlink( $this->_upload_path."/".$attachment['attach_location'] ); - } - if ( $attachment['attach_thumb_location'] ) - { - @unlink( $this->_upload_path."/".$attachment['attach_thumb_location'] ); - } - - /* Allow the module to clean up any items */ - $this->plugin->attachmentRemovalCleanup( $attachment ); - } - - /* Remove from the DB */ - $this->DB->delete( 'attachments', $id_type . ' IN (' . implode( ',', $remove_ids ) . ") AND attach_rel_module='{$this->type}'" ); - - return TRUE; - } - else - { - return FALSE; - } - } - - /** - * Removes an attachment. - * - * @return @e void - */ - public function removeAttachment() - { - //----------------------------------------- - // Got an ID? - //----------------------------------------- - - if ( ! $this->attach_id ) - { - return FALSE; - } - - //----------------------------------------- - // Get DB row - //----------------------------------------- - - $attachment = $this->DB->buildAndFetch( array( 'select' => '*', - 'from' => 'attachments', - 'where' => 'attach_id='.$this->attach_id." AND attach_rel_module='".$this->type."'" ) ); - - if ( ! $attachment['attach_id'] ) - { - return FALSE; - } - - //----------------------------------------- - // Make sure we've got permission - //----------------------------------------- - - if ( $this->plugin->canRemove( $attachment ) === TRUE ) - { - //----------------------------------------- - // Remove from the DB - //----------------------------------------- - - $this->DB->delete( 'attachments', 'attach_id='.$attachment['attach_id'] ); - - //----------------------------------------- - // Remove from the filesystem - //----------------------------------------- - - if ( $attachment['attach_location'] ) - { - @unlink( $this->_upload_path."/".$attachment['attach_location'] ); - } - if ( $attachment['attach_thumb_location'] ) - { - @unlink( $this->_upload_path."/".$attachment['attach_thumb_location'] ); - } - - //----------------------------------------- - // Allow the module to clean up any items - //----------------------------------------- - - $this->plugin->attachmentRemovalCleanup( $attachment ); - - return TRUE; - } - else - { - return FALSE; - } - } - - /** - * Converts post-key attachments into rel_id / rel_module attachments - * by adding in the correct ID, etc - * - * @param array $args - * @return array - */ - public function postProcessUpload( $args=array() ) - { - if( ! $this->attach_post_key or ! $this->attach_rel_id ) - { - return FALSE; - } - - //----------------------------------------- - // Got any to update? - //----------------------------------------- - - $this->DB->update( 'attachments', array( 'attach_rel_id' => $this->attach_rel_id, - 'attach_parent_id' => intval($this->attach_parent_id), - 'attach_rel_module' => $this->type ), "attach_post_key='{$this->attach_post_key}'" ); - - //----------------------------------------- - // Update module specific? - //----------------------------------------- - - return $this->plugin->postUploadProcess( $this->attach_post_key, $this->attach_rel_id, $args ); - } - - /** - * Uploads and saves file - * - * @return mixed void, or the new insert id - */ - public function processUpload() - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $this->error = ''; - - $this->getUploadFormSettings(); - - //----------------------------------------- - // Check upload dir - //----------------------------------------- - - if ( ! $this->checkUploadDirectory() ) - { - if ( $this->error ) - { - return; - } - } - - //----------------------------------------- - // Can upload? - //----------------------------------------- - - if ( ! $this->attach_stats['allow_uploads'] ) - { - $this->error = 'upload_failed'; - return; - } - - //----------------------------------------- - // Got attachment types? - //----------------------------------------- - - if ( ! ( $this->registry->cache()->getCache('attachtypes') ) OR ! is_array( $this->registry->cache()->getCache('attachtypes') ) ) - { - $attachtypes = array(); - - $this->DB->build( array( - 'select' => 'atype_extension,atype_mimetype,atype_post,atype_img', - 'from' => 'attachments_type', - 'where' => "atype_post=1" - ) ); - $this->DB->execute(); - - while ( $r = $this->DB->fetch() ) - { - $attachtypes[ $r['atype_extension'] ] = $r; - } - - $this->registry->cache()->updateCacheWithoutSaving( 'attachtypes', $attachtypes ); - } - - //----------------------------------------- - // Set up array - //----------------------------------------- - - $attach_data = array( - 'attach_ext' => "", - 'attach_file' => "", - 'attach_location' => "", - 'attach_thumb_location' => "", - 'attach_hits' => 0, - 'attach_date' => time(), - 'attach_post_key' => $this->attach_post_key, - 'attach_member_id' => $this->memberData['member_id'], - 'attach_rel_id' => $this->attach_rel_id, - 'attach_rel_module' => $this->type, - 'attach_filesize' => 0, - ); - - //----------------------------------------- - // Load the library - //----------------------------------------- - - require_once( IPS_KERNEL_PATH.'classUpload.php' );/*noLibHook*/ - $upload = new classUpload(); - - //----------------------------------------- - // Set up the variables - //----------------------------------------- - - $upload->out_file_name = $this->type . '-' . $this->memberData['member_id'] . '-' . str_replace( array( '.', ' ' ), '-', microtime() ); - $upload->out_file_dir = $this->upload_path; - $upload->max_file_size = $this->attach_stats['max_single_upload'] ? $this->attach_stats['max_single_upload'] : 1000000000; - $upload->make_script_safe = 1; - $upload->force_data_ext = 'ipb'; - - //----------------------------------------- - // Populate allowed extensions - //----------------------------------------- - - if ( is_array( $this->registry->cache()->getCache('attachtypes') ) and count( $this->registry->cache()->getCache('attachtypes') ) ) - { - /* SKINNOTE: I had to add [attachtypes] to this cache to make it work, may need fixing? */ - //$tmp = $this->registry->cache()->getCache('attachtypes'); - foreach( $this->registry->cache()->getCache('attachtypes') as $idx => $data ) - { - if ( $data['atype_post'] ) - { - $upload->allowed_file_ext[] = $data['atype_extension']; - } - } - } - - //----------------------------------------- - // Upload... - //----------------------------------------- - - $upload->process(); - - //----------------------------------------- - // Error? - //----------------------------------------- - - if ( $upload->error_no ) - { - switch( $upload->error_no ) - { - case 1: - // No upload - $this->error = 'upload_no_file'; - return $attach_data; - break; - case 2: - // Invalid file ext - $this->error = 'invalid_mime_type'; - return $attach_data; - break; - case 3: - // Too big... - $this->error = 'upload_too_big'; - return $attach_data; - break; - case 4: - // Cannot move uploaded file - $this->error = 'upload_failed'; - return $attach_data; - break; - case 5: - // Possible XSS attack (image isn't an image) - $this->error = 'upload_failed'; - return $attach_data; - break; - } - } - - //----------------------------------------- - // Still here? - //----------------------------------------- - - if ( $upload->saved_upload_name and @is_file( $upload->saved_upload_name ) ) - { - //----------------------------------------- - // Strip off { } and [ ] - //----------------------------------------- - - $upload->original_file_name = str_replace( array( '[', ']', '{', '}' ), "", $upload->original_file_name ); - - $attach_data['attach_filesize'] = @filesize( $upload->saved_upload_name ); - $attach_data['attach_location'] = $this->upload_dir . $upload->parsed_file_name; - - if( IPSText::isUTF8( $upload->original_file_name ) ) - { - $attach_data['attach_file'] = IPSText::convertCharsets( $upload->original_file_name, "UTF-8", IPS_DOC_CHAR_SET ); - } - else - { - $attach_data['attach_file'] = $upload->original_file_name; - } - - $attach_data['attach_is_image'] = $upload->is_image; - $attach_data['attach_ext'] = $upload->real_file_extension; - - if ( $attach_data['attach_is_image'] == 1 ) - { - require_once( IPS_KERNEL_PATH . 'classImage.php' );/*noLibHook*/ - require_once( IPS_KERNEL_PATH . 'classImageGd.php' );/*noLibHook*/ - - /* Main attachment */ - if ( ! empty( $this->settings['attach_img_max_w'] ) AND ! empty( $this->settings['attach_img_max_h'] ) ) - { - $image = new classImageGd(); - - $image->init( array( 'image_path' => $this->upload_path, - 'image_file' => $upload->parsed_file_name ) ); - - $image->force_resize = false; - - if ( $imgData = $image->resizeImage( $this->settings['attach_img_max_w'], $this->settings['attach_img_max_h'], false, true ) ) - { - if( !$imgData['noResize'] ) - { - $image->writeImage( $this->upload_path . '/' . $upload->parsed_file_name ); - } - - if ( is_array( $imgData ) ) - { - $attach_data['attach_img_width'] = $imgData['newWidth']; - $attach_data['attach_img_height'] = $imgData['newHeight']; - } - - $attach_data['attach_filesize'] = @filesize( $this->upload_path . '/' . $upload->parsed_file_name ); - } - } - - /* Thumb nail */ - $image = new classImageGd(); - $image->force_resize = true; - - $image->init( array( 'image_path' => $this->upload_path, - 'image_file' => $upload->parsed_file_name ) ); - - if ( TRUE ) // $this->attach_settings['siu_thumb'] ) # bug report 36511 - { - if( $this->attach_settings['siu_width'] < $attach_data['attach_img_width'] OR $this->attach_settings['siu_height'] < $attach_data['attach_img_height'] ) - { - $_thumbName = preg_replace( '#^(.*)\.(\w+?)$#', "\\1_thumb.\\2", $upload->parsed_file_name ); - - if( $thumb_data = $image->resizeImage( $this->attach_settings['siu_width'], $this->attach_settings['siu_height'] ) ) - { - $image->writeImage( $this->upload_path . '/' . $_thumbName ); - - if ( is_array( $thumb_data ) ) - { - $thumb_data['thumb_location'] = $_thumbName; - } - } - } - else - { - /* Instead of building a thumb the same size as the main image, just copy the details */ - $thumb_data = array( - 'thumb_location' => $upload->parsed_file_name, - 'newWidth' => $attach_data['attach_img_width'], - 'newHeight' => $attach_data['attach_img_height'], - ); - } - } - - if ( $thumb_data['thumb_location'] ) - { - $attach_data['attach_img_width'] = $thumb_data['originalWidth']; - $attach_data['attach_img_height'] = $thumb_data['originalHeight']; - $attach_data['attach_thumb_width'] = $thumb_data['newWidth']; - $attach_data['attach_thumb_height'] = $thumb_data['newHeight']; - $attach_data['attach_thumb_location'] = $this->upload_dir . $thumb_data['thumb_location']; - } - } - - //----------------------------------------- - // Make sure we send integers - // @link http://community.invisionpower.com/tracker/issue-32511-attachments-mysql-strict-mode - //----------------------------------------- - - $attach_data['attach_img_width'] = intval( $attach_data['attach_img_width'] ); - $attach_data['attach_img_height'] = intval( $attach_data['attach_img_height'] ); - $attach_data['attach_thumb_width'] = intval( $attach_data['attach_thumb_width'] ); - $attach_data['attach_thumb_height'] = intval( $attach_data['attach_thumb_height'] ); - - //----------------------------------------- - // Add into Database - //----------------------------------------- - - $this->DB->insert( 'attachments', $attach_data ); - - $newid = $this->DB->getInsertId(); - - return $newid; - } - } - - /** - * Uploads and saves file - * - * @return mixed void, or an array of new insert ids - */ - public function processMultipleUploads() - { - /* INIT */ - $this->error = ''; - - $this->getUploadFormSettings(); - - /* Check the upload directory */ - if( ! $this->checkUploadDirectory() ) - { - if( $this->error ) - { - return; - } - } - - /* Can Upload */ - if ( ! $this->attach_stats['allow_uploads'] ) - { - $this->error = 'upload_failed'; - return; - } - - /* Setup Attachment Types */ - if( ! ( $this->registry->cache()->getCache('attachtypes') ) OR ! is_array( $this->registry->cache()->getCache('attachtypes') ) ) - { - $attachtypes = array(); - - $this->DB->build( array('select' => 'atype_extension,atype_mimetype,atype_post,atype_img', - 'from' => 'attachments_type', - 'where' => "atype_post=1" - ) ); - $this->DB->execute(); - - while( $r = $this->DB->fetch() ) - { - $attachtypes[ $r['atype_extension'] ] = $r; - } - - $this->registry->cache()->updateCacheWithoutSaving( 'attachtypes', $attachtypes ); - } - - /* Attachment Library */ - $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classUpload.php', 'classUpload' ); - $upload = new $classToLoad(); - - /* Set up the library */ - $upload->out_file_dir = $this->upload_path; - $upload->max_file_size = $this->attach_stats['max_single_upload'] ? $this->attach_stats['max_single_upload'] : 1000000000; - $upload->make_script_safe = 1; - $upload->force_data_ext = 'ipb'; - - /* Populate allowed extensions */ - if( is_array( $this->registry->cache()->getCache('attachtypes') ) and count( $this->registry->cache()->getCache('attachtypes') ) ) - { - /* SKINNOTE: I had to add [attachtypes] to this cache to make it work, may need fixing? */ - //$tmp = $this->registry->cache()->getCache('attachtypes'); - foreach( $this->registry->cache()->getCache('attachtypes') as $idx => $data ) - { - if( $data['atype_post'] ) - { - $upload->allowed_file_ext[] = $data['atype_extension']; - } - } - } - - /* Attempt to upload everything int he $_FILES array */ - $upload_results = array(); - - if( isset( $_FILES ) && is_array( $_FILES ) && count( $_FILES ) ) - { - foreach( $_FILES as $_field_name => $data ) - { - if( ! $_FILES[ $_field_name ]['size'] ) - { - continue; - } - - /* Set File Name */ - $upload->out_file_name = $this->type . '-' . $this->memberData['member_id'] . '-' . time() % $_FILES[ $_field_name ]['size']; - - /* Set File Name */ - $upload->upload_form_field = $_field_name; - - /* Attachment Data Array */ - $attach_data = array( - 'attach_ext' => "", - 'attach_file' => "", - 'attach_location' => "", - 'attach_thumb_location' => "", - 'attach_hits' => 0, - 'attach_date' => time(), - 'attach_post_key' => $this->attach_post_key, - 'attach_member_id' => $this->memberData['member_id'], - 'attach_rel_id' => $this->attach_rel_id, - 'attach_rel_module' => $this->type, - 'attach_filesize' => 0, - ); - - /* Upload... */ - $upload->process(); - - /* Error Check */ - if( $upload->error_no ) - { - switch( $upload->error_no ) - { - case 1: - // No upload - $upload_results[ $_field_name ] = 'upload_no_file'; - break; - - case 2: - // Invalid file ext - $upload_results[ $_field_name ] = 'invalid_mime_type'; - break; - - case 3: - // Too big... - $upload_results[ $_field_name ] = 'upload_too_big'; - break; - - case 4: - // Cannot move uploaded file - $upload_results[ $_field_name ] = 'upload_failed'; - break; - - case 5: - // Possible XSS attack (image isn't an image) - $upload_results[ $_field_name ] = 'upload_failed'; - break; - } - } - - /* Still Here */ - if( $upload->saved_upload_name and @is_file( $upload->saved_upload_name ) ) - { - /* Strip off { } and [ ] */ - $upload->original_file_name = str_replace( array( '[', ']', '{', '}' ), "", $upload->original_file_name ); - - $attach_data['attach_filesize'] = @filesize( $upload->saved_upload_name ); - $attach_data['attach_location'] = $this->upload_dir . $upload->parsed_file_name; - $attach_data['attach_file'] = $upload->original_file_name; - $attach_data['attach_is_image'] = $upload->is_image; - $attach_data['attach_ext'] = $upload->real_file_extension; - - if ( $attach_data['attach_is_image'] == 1 ) - { - require_once( IPS_KERNEL_PATH . 'classImage.php' );/*noLibHook*/ - require_once( IPS_KERNEL_PATH . 'classImageGd.php' );/*noLibHook*/ - - /* Main attachment */ - if ( ! empty( $this->settings['attach_img_max_w'] ) AND ! empty( $this->settings['attach_img_max_h'] ) ) - { - $image = new classImageGd(); - - $image->init( array( 'image_path' => $this->upload_path, - 'image_file' => $upload->parsed_file_name ) ); - - if ( $imgData = $image->resizeImage( $this->settings['attach_img_max_w'], $this->settings['attach_img_max_h'] ) ) - { - $image->writeImage( $this->upload_path . '/' . $upload->parsed_file_name ); - - if ( is_array( $imgData ) ) - { - $attach_data['attach_img_width'] = $imgData['newWidth']; - $attach_data['attach_img_height'] = $imgData['newHeight']; - } - } - } - - /* Thumb nail */ - $image = new classImageGd(); - $image->force_resize = true; - - $image->init( array( 'image_path' => $this->upload_path, - 'image_file' => $upload->parsed_file_name ) ); - - if ( $this->attach_settings['siu_thumb'] ) - { - $_thumbName = preg_replace( '#^(.*)\.(\w+?)$#', "\\1_thumb.\\2", $upload->parsed_file_name ); - - if( $thumb_data = $image->resizeImage( $this->attach_settings['siu_width'], $this->attach_settings['siu_height'] ) ) - { - $image->writeImage( $this->upload_path . '/' . $_thumbName ); - - if ( is_array( $thumb_data ) ) - { - $thumb_data['thumb_location'] = $_thumbName; - } - } - } - - if ( $thumb_data['thumb_location'] ) - { - $attach_data['attach_img_width'] = $thumb_data['originalWidth']; - $attach_data['attach_img_height'] = $thumb_data['originalHeight']; - $attach_data['attach_thumb_width'] = $thumb_data['newWidth']; - $attach_data['attach_thumb_height'] = $thumb_data['newHeight']; - $attach_data['attach_thumb_location'] = $this->upload_dir . $thumb_data['thumb_location']; - } - } - - /* Add into Database */ - $this->DB->insert( 'attachments', $attach_data ); - - $upload_results[ $_field_name ] = $this->DB->getInsertId(); - } - } - } - - return $upload_results; - } - - /** - * Gets stuff required for the upload form - * - * @return @e void - */ - public function getUploadFormSettings() - { - /* Collect settings from the plug-in */ - $stats = $this->plugin->getSpaceAllowance( $this->attach_post_key ); - - /* Fix language strings */ - if( isset($this->lang->words['attach_unlimited']) ) - { - $this->language['unlimited'] = $this->lang->words['attach_unlimited']; - } - - if( isset($this->lang->words['attach_notallowed']) ) - { - $this->language['not_allowed'] = $this->lang->words['attach_notallowed']; - } - - /* Format and return... */ - $this->attach_stats['space_used'] = $stats['space_used']; - $this->attach_stats['space_used_human'] = IPSLib::sizeFormat( $stats['space_used'] ); - $this->attach_stats['total_space_allowed'] = $stats['total_space_allowed'] ? $stats['total_space_allowed'] : $stats['max_single_upload']; - $this->attach_stats['max_single_upload'] = $stats['max_single_upload']; - $this->attach_stats['max_single_upload_human'] = $this->attach_stats['max_single_upload'] ? IPSLib::sizeFormat( $stats['max_single_upload'] ) : $this->language[ 'unlimited' ]; - $this->attach_stats['total_space_allowed_human'] = $this->attach_stats['total_space_allowed'] ? IPSLib::sizeFormat( $this->attach_stats['total_space_allowed'] ) : $this->language[ 'unlimited' ]; - - if( $stats['space_allowed'] == 0 ) - { - /* Unlimited... */ - $this->attach_stats['allow_uploads'] = 1; - $this->attach_stats['space_allowed'] = 'unlimited'; - $this->attach_stats['space_allowed_human'] = $this->language['unlimited']; - $this->attach_stats['space_left'] = 'unlimited'; - $this->attach_stats['space_left_human'] = $this->language['unlimited']; - $this->attach_stats['total_space_allowed_human'] = $this->language['unlimited']; - } - else if ( $stats['space_allowed'] == -1 ) - { - /* None */ - $this->attach_stats['allow_uploads'] = 0; - $this->attach_stats['space_allowed'] = 'not_allowed'; - $this->attach_stats['space_allowed_human'] = $this->language['not_allowed']; - $this->attach_stats['space_left'] = 'not_allowed'; - $this->attach_stats['space_left_human'] = $this->language['not_allowed']; - } - else - { - /* Set figure */ - $this->attach_stats['allow_uploads'] = 1; - $this->attach_stats['space_left'] = $stats['space_left']; - $this->attach_stats['space_left_human'] = IPSLib::sizeFormat( $stats['space_left'] ); - } - } - - /** - * Checks the upload dir. See above. It's not rocket science - * - * @return bool - */ - public function checkUploadDirectory() - { - /* Check dir exists... */ - if( ! file_exists( $this->upload_path ) ) - { - if( @mkdir( $this->upload_path, IPS_FOLDER_PERMISSION ) ) - { - @file_put_contents( $this->upload_path . '/index.html', '' ); - @chmod( $this->upload_path, IPS_FOLDER_PERMISSION ); - } - else - { - $this->error = "no_upload_dir"; - return false; - } - } - else if( ! is_writeable( $this->upload_path ) ) - { - $this->error = "no_upload_dir_perms"; - return false; - } - - /* Try and create a new monthly dir */ - $this_month = "monthly_" . gmstrftime( "%m_%Y", time() ); - - /* Already a dir? */ - if( $this->attach_settings['allow_monthly_upload_dirs'] ) - { - $path = $this->upload_path . '/' . $this_month; - - if( ! file_exists( $path ) ) - { - if( @mkdir( $path, IPS_FOLDER_PERMISSION ) ) - { - @file_put_contents( $path . '/index.html', '' ); - @chmod( $path, IPS_FOLDER_PERMISSION ); - - # Set path and dir correct - $this->upload_path .= '/' . $this_month; - $this->upload_dir = $this_month . '/'; - } - - /* Was it really made or was it lying? */ - if( ! file_exists( $path ) ) - { - $this->upload_path = $this->_upload_path; - $this->upload_dir = '/'; - } - } - else - { - /* Set path and dir correct */ - $this->upload_path .= '/' . $this_month; - $this->upload_dir = $this_month . '/'; - } - } - - return true; - } - - /** - * Loads child extends class. - * - * @return @e void - */ - public function loadAttachmentPlugin() - { - /* INIT */ - $this->type = IPSText::alphanumericalClean( $this->type ); - - /* No plugin yet? Load it! */ - if( ! is_object( $this->plugin ) && $this->type ) - { - /* Load... */ - foreach( IPSLIb::getEnabledApplications() as $app ) - { - if( is_file( IPSLib::getAppDir( $app['app_directory'] ) . '/extensions/attachments/plugin_' . $this->type . '.php' ) ) - { - $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( $app['app_directory'] ) . '/extensions/attachments/plugin_' . $this->type . '.php', 'plugin_'.$this->type, $app['app_directory'] ); - $this->plugin = new $classToLoad( $this->registry ); - $this->plugin->getSettings(); - - /* Found it, stop */ - break; - } - } - - /* Still here? Error out then.. */ - if ( ! is_object( $this->plugin ) ) - { - print "Could not locate plugin {$this->type}"; - exit(); - } - } - } - - /** - * Swaps the HTML for the nice attachments. - * - * @param array Array of matches from preg_replace_callback - * @return string HTML - */ - protected function _parseThumbnailInline( $matches ) - { - //----------------------------------------- - // INIT - //----------------------------------------- - - $row = $this->_current['row']; - $skin_name = $this->_current['skin_name']; - - //----------------------------------------- - // Generate random ID - //----------------------------------------- - - $row['_attach_id'] = $row['attach_id'] . '-' . str_replace( array( '.', ' ' ), "-", microtime() ); - - //----------------------------------------- - // Build HTML - //----------------------------------------- - - $tmp = $this->registry->getClass('output')->getTemplate( $skin_name )->Show_attachments_img_thumb( array( 't_location' => $row['attach_thumb_location'], - 't_width' => $row['attach_thumb_width'], - 't_height' => $row['attach_thumb_height'], - 'o_width' => $row['attach_img_width'], - 'o_height' => $row['attach_img_height'], - 'attach_id' => $row['attach_id'], - '_attach_id' => $row['_attach_id'], - 'file_size' => IPSLib::sizeFormat( $row['attach_filesize'] ), - 'attach_hits' => $row['attach_hits'], - 'location' => $row['attach_file'], - 'type' => $this->_current['type'], - ) ); - - return $tmp; - } + + * Invision Power Services + * IP.Board v3.4.6 + * Attachments + * Last Updated: $Date: 2013-05-28 10:00:25 -0400 (Tue, 28 May 2013) $ + * + * + * + * Possible Error strings: + * - upload_no_file (No file was selected to upload) + * - upload_failed (Upload failed for unspecified reason) + * - upload_too_big (Upload is bigger than space left) + * - invalid_mime_type (Upload is not allowed) + * - no_upload_dir (Upload dir is not installed) + * - no_upload_dir_perms (Upload dir is not writeable) + * + * + * @author $Author: AndyMillne $ + * @copyright (c) 2001 - 2009 Invision Power Services, Inc. + * @license http://www.invisionpower.com/company/standards.php#license + * @package IP.Board + * @subpackage Core + * @link http://www.invisionpower.com + * @version $Rev: 12273 $ + */ + +if ( ! defined( 'IN_IPB' ) ) +{ + print "

    Incorrect access

    You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +class class_attach +{ + /** + * Global html class + * + * @var object + */ + public $html; + + /** + * Type of attachment + * + * @var string + */ + public $type = ''; + + /** + * Plugin Class + * + * @var object + */ + public $plugin = ''; + + /** + * Post key + * + * @var string + */ + public $attach_post_key = ''; + + /** + * Relationship ID + * + * @var integer + */ + public $attach_rel_id = 0; + + /** + * Relationship parent ID + * + * @var int + */ + public $attach_parent_id = 0; + + /** + * Return variables + * + * @var array [ 'allow_uploads', 'space_allowed', 'space_allowed_human', 'space_used', 'space_used_human', 'space_left', 'space_left_human' ] + */ + public $attach_stats = array(); + + /** + * Lang array + * Internal language array + * + * @var array + */ + public $language = array( 'unlimited' => 'Unlimited', + 'not_allowed' => 'Uploading is not allowed' ); + + /** + * Error array + * + * @var string + */ + public $error = ""; + + /** + * Full upload path + * + * @var string + */ + public $upload_path = ''; + + /** + * Upload part part (from /uploads) + * + * @var string + */ + public $upload_dir = ''; + + /** + * Extra upload form url + * + * @var string + */ + public $extra_upload_form_url = ''; + + /** + * Custom settings + * + * @var array + */ + public $attach_settings = array( + 'siu_thumb' => 0, + 'siu_height' => 0, + 'siu_width' => 0, + 'allow_monthly_upload_dirs' => 0, + 'upload_dir' => '' + ); + + /**#@+ + * Registry Object Shortcuts + * + * @var object + */ + protected $registry; + protected $DB; + protected $settings; + protected $request; + protected $lang; + protected $member; + protected $memberData; + /**#@-*/ + + /** + * CONSTRUCTOR + * + * @param object ipsRegistry reference + * @return @e void + */ + public function __construct( ipsRegistry $registry ) + { + /* Make object */ + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->request =& $this->registry->fetchRequest(); + $this->lang = $this->registry->getClass('class_localization'); + $this->member = $this->registry->member(); + $this->memberData =& $this->registry->member()->fetchMemberData(); + } + + /** + * Initiates class + * + * @return @e void + */ + public function init() + { + //----------------------------------------- + // Start the settings + //----------------------------------------- + + $this->attach_settings['siu_thumb'] = $this->settings['siu_thumb']; + $this->attach_settings['siu_height'] = $this->settings['siu_height']; + $this->attach_settings['siu_width'] = $this->settings['siu_width']; + $this->attach_settings['allow_monthly_upload_dirs'] = @ini_get("safe_mode") ? 0 : ( $this->settings['safe_mode_skins'] ? 0 : 1 ); + $this->attach_settings['upload_dir'] = $this->settings['upload_dir']; + + //----------------------------------------- + // Load plug in + //----------------------------------------- + + if ( $this->type ) + { + $this->loadAttachmentPlugin(); + } + + //----------------------------------------- + // Finalize the settings + //----------------------------------------- + + foreach( $this->attach_settings as $item => $value ) + { + $this->attach_settings[ $item ] = ( isset( $this->plugin->mysettings[ $item ] ) ) ? $this->plugin->mysettings[ $item ] : $value; + } + + //----------------------------------------- + // Fix up URL tokens + //----------------------------------------- + + foreach( $this->request as $k => $v ) + { + if ( preg_match( "#^--ff--#", $k ) ) + { + $this->request[ str_replace( '--ff--', '', $k ) ] = $v; + } + } + + //----------------------------------------- + // Sort out upload dir + //----------------------------------------- + + $this->upload_path = $this->attach_settings['upload_dir']; + + $this->_upload_path = $this->upload_path; + } + + /** + * Show the attachment (or force download) + * + * @param int Attachment ID (The main attach id) + * @return @e void + */ + public function showAttachment( $attach_id ) + { + /* INIT */ + $sql_data = array(); + + /* Get attach data... */ + $attachment = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'attachments', 'where' => 'attach_id='.intval( $attach_id ) ) ); + + if( ! $attachment['attach_id'] ) + { + $this->registry->getClass('output')->showError( 'attach_no_attachment', 10170, false, null, 404 ); + } + + /* Load correct plug in... */ + $this->type = $attachment['attach_rel_module']; + $this->loadAttachmentPlugin(); + + /* Get SQL data from plugin */ + $attach = $this->plugin->getAttachmentData( $attach_id ); + + /* Got a reply? */ + if( $attach === FALSE OR ! is_array( $attach ) ) + { + $this->registry->getClass('output')->showError( 'no_permission_to_download', 10171, null, null, 403 ); + } + + /* Got a rel id? */ + if( ! $attach['attach_rel_id'] AND $attach['attach_member_id'] != $this->memberData['member_id'] ) + { + $this->registry->getClass('output')->showError( 'err_attach_not_attached', 10172, null, null, 403 ); + } + + //----------------------------------------- + // Reset timeout for large attachments + //----------------------------------------- + + if ( @function_exists("set_time_limit") == 1 and SAFE_MODE_ON == 0 ) + { + @set_time_limit( 0 ); + } + + if( is_array( $attach ) AND count( $attach ) ) + { + /* Got attachment types? */ + if ( ! is_array( $this->registry->cache()->getCache('attachtypes') ) ) + { + $attachtypes = array(); + + $this->DB->build( array( 'select' => 'atype_extension,atype_mimetype', 'from' => 'attachments_type' ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $attachtypes[ $r['atype_extension'] ] = $r; + } + + $this->registry->cache()->updateCacheWithoutSaving( 'attachtypes', $attachtypes ); + } + + /* Show attachment */ + $attach_cache = $this->registry->cache()->getCache('attachtypes'); + $this->_upload_path = ( isset( $this->plugin->mysettings[ 'upload_dir' ] ) ) ? $this->plugin->mysettings[ 'upload_dir' ] : $this->attach_settings[ 'upload_dir' ]; + + $file = $this->_upload_path . "/" . $attach['attach_location']; + + if( is_file( $file ) and ( $attach_cache[ $attach['attach_ext'] ]['atype_mimetype'] != "" ) ) + { + /* Update the "hits".. */ + $this->DB->buildAndFetch( array( 'update' => 'attachments', 'set' => "attach_hits=attach_hits+1", 'where' => "attach_id={$attach_id}" ) ); + + /* Open and display the file.. */ + header( "Content-Type: {$attach_cache[ $attach['attach_ext'] ]['atype_mimetype']}" ); + + $disposition = $attach['attach_is_image'] ? "inline" : "attachment"; + + if( in_array( $this->memberData['userAgentKey'], array( 'firefox', 'opera' ) ) ) + { + @header( 'Content-Disposition: ' . $disposition . "; filename*={$this->settings['gb_char_set']}''" . rawurlencode( IPSText::UNhtmlspecialchars( $attach['attach_file'] ) ) ); + } + else if( in_array( $this->memberData['userAgentKey'], array( 'explorer' ) ) ) + { + @header( 'Content-Disposition: ' . $disposition . '; filename="' . rawurlencode( IPSText::UNhtmlspecialchars( $attach['attach_file'] ) ) . '"' ); + } + else + { + @header( 'Content-Disposition: ' . $disposition . '; filename="' . IPSText::UNhtmlspecialchars( $attach['attach_file'] ) . '"' ); + } + + if( ( !ini_get('zlib.output_compression') OR ini_get('zlib.output_compression') == 'off' ) AND ini_get('output_handler') != 'ob_gzhandler' ) + { + header( 'Content-Length: ' . (string) ( filesize( $file ) ) ); + } + + /** + * @link http://community.invisionpower.com/tracker/issue-22011-wrong-way-to-handle-attachments-transfer/ + */ + if ( function_exists('ob_end_clean') AND ini_get('output_handler') != 'ob_gzhandler' ) + { + @ob_end_clean(); + } + + if( function_exists('readfile') ) + { + readfile( $file ); + } + else + { + if( $fh = fopen( $file, 'rb' ) ) + { + while( ! feof( $fh ) ) + { + echo fread( $fh, 4096 ); + + if ( function_exists('ob_get_length') AND function_exists('ob_flush') AND @ob_get_length() ) + { + @ob_flush(); + } + else + { + @flush(); + } + } + + @fclose( $fh ); + } + } + + exit(); + } + else + { + /* File does not exist.. */ + $this->registry->getClass('output')->showError( 'attach_file_missing', 10173 ); + } + } + else + { + /* No permission? */ + $this->registry->getClass('output')->showError( 'no_permission_to_download', 10174, null, null, 403 ); + } + } + + /** + * Retrieve the HTML for a single attachment + * + * @param mixed Array of attachment data, or an attachment ID + * @param string Skin group to use + * @param bool Whether to wrap with the attachment block wrapper or not + * @return string Attachment HTML + */ + public function renderSingleAttachment( $attachment, $skin_name='topic', $use_wrapper=false ) + { + if( is_int($attachment) ) + { + $row = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'attachments', 'where' => 'attach_id=' . intval($attachment) ) ); + } + else + { + $row = $attachment; + } + + if( !$row['attach_id'] ) + { + return ''; + } + + $attachtypes = $this->getAttachTypes(); + $type = ''; + + //----------------------------------------- + // Is it an image, and are we viewing the image in the post? + //----------------------------------------- + + if ( $this->settings['show_img_upload'] and $row['attach_is_image'] ) + { + if ( $this->attach_settings['siu_thumb'] AND $row['attach_thumb_location'] AND $row['attach_thumb_width'] ) + { + //----------------------------------------- + // Make sure we've not seen this ID + //----------------------------------------- + + $row['_attach_id'] = $row['attach_id'] . '-' . str_replace( array( '.', ' ' ), "-", microtime() ); + + $type = 'thumb'; + $tmp = $this->registry->getClass('output')->getTemplate( $skin_name )->Show_attachments_img_thumb( array( + 't_location' => $row['attach_thumb_location'], + 't_width' => $row['attach_thumb_width'], + 't_height' => $row['attach_thumb_height'], + 'o_width' => $row['attach_img_width'], + 'o_height' => $row['attach_img_height'], + 'attach_id' => $row['attach_id'], + '_attach_id' => $row['_attach_id'], + 'file_size' => IPSLib::sizeFormat( $row['attach_filesize'] ), + 'attach_hits' => $row['attach_hits'], + 'location' => $row['attach_file'], + 'type' => $this->type, + 'notinline' => 1, + 'attach_rel_id' => $row['attach_rel_id'], + 'a_location' => $row['attach_location'] + ) ); + } + else + { + //----------------------------------------- + // Standard size.. + //----------------------------------------- + + $type = 'image'; + $tmp = $this->registry->getClass('output')->getTemplate( $skin_name )->Show_attachments_img( array( + 'o_location' => $row['attach_location'], + 'o_width' => $row['attach_img_width'], + 'o_height' => $row['attach_img_height'], + 'attach_id' => $row['attach_id'], + '_attach_id' => $row['_attach_id'], + 'file_size' => IPSLib::sizeFormat( $row['attach_filesize'] ), + 'attach_hits' => $row['attach_hits'], + 'location' => $row['attach_file'], + 'type' => $this->type, + 'notinline' => 1, + 'attach_rel_id' => $row['attach_rel_id'] + ) ); + } + } + else + { + //----------------------------------------- + // Full attachment thingy + //----------------------------------------- + + $type = 'attach'; + $tmp = $this->registry->getClass('output')->getTemplate( $skin_name )->Show_attachments( array ( + 'attach_hits' => $row['attach_hits'], + 'mime_image' => $attachtypes[ $row['attach_ext'] ]['atype_img'], + 'attach_file' => $row['attach_file'], + 'attach_id' => $row['attach_id'], + 'type' => $this->type, + 'file_size' => IPSLib::sizeFormat( $row['attach_filesize'] ), + ) ); + } + + //----------------------------------------- + // Wrap? + //----------------------------------------- + + if ( $use_wrapper ) + { + switch( $type ) + { + case 'thumb': + $tmp = $this->registry->getClass('output')->getTemplate( $skin_name )->show_attachment_title( $this->lang->words['attach_thumbs'], $tmp, 'thumb' ); + break; + + case 'image': + $tmp = $this->registry->getClass('output')->getTemplate( $skin_name )->show_attachment_title( $this->lang->words['attach_images'], $tmp, 'image' ); + break; + + default: + case 'attach': + $tmp = $this->registry->getClass('output')->getTemplate( $skin_name )->show_attachment_title( $this->lang->words['attach_normal'], $tmp, 'attach' ); + break; + } + } + + return $tmp; + } + + /** + * Retrieve attachment types from cache + * + * @return @e array + */ + protected function getAttachTypes() + { + //----------------------------------------- + // Got attachment types? + //----------------------------------------- + + if ( ! is_array( $this->registry->cache()->getCache('attachtypes') ) ) + { + $attachtypes = array(); + + $this->DB->build( array( 'select' => 'atype_extension,atype_mimetype,atype_img', 'from' => 'attachments_type' ) ); + $outer = $this->DB->execute(); + + while ( $r = $this->DB->fetch( $outer ) ) + { + $attachtypes[ $r['atype_extension'] ] = $r; + } + + $this->registry->cache()->updateCacheWithoutSaving( 'attachtypes', $attachtypes ); + } + else + { + $attachtypes = $this->registry->cache()->getCache('attachtypes'); + } + + return $attachtypes; + } + + /** + * Swaps the HTML for the nice attachments. + * + * @param array Array of HTML blocks to convert: [ rel_id => $html ] + * @param array Relationship ids + * @param string Skin group to use + * @return array Array of converted HTML blocks and attach code: [ id => $html ] + */ + public function renderAttachments( $htmlArray, $rel_ids=array(), $skin_name='topic', $parse_og=true ) + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $attach_ids = array(); + $map_attach_id_to_rel_id = array(); + $final_out = array(); + $final_blocks = array(); + $returnArray = array(); + $_seen = 0; + + //----------------------------------------- + // Check.. + //----------------------------------------- + + if ( ! is_array( $htmlArray ) ) + { + $htmlArray = array( 0 => $htmlArray ); + } + + //----------------------------------------- + // Rel ids + //----------------------------------------- + + if ( ! is_array( $rel_ids ) OR ! count( $rel_ids ) ) + { + $rel_ids = array_keys( $htmlArray ); + } + + //----------------------------------------- + // Parse HTML blocks for attach ids + // [attachment=32:attachFail.gif] + //----------------------------------------- + + foreach( $htmlArray as $id => $html ) + { + $returnArray[ $id ] = array( 'html' => $html, 'attachmentHtml' => '' ); + + preg_match_all( '#\[attachment=(\d+?)\:(?:[^\]]+?)\]#is', $html, $match ); + + if ( is_array( $match[0] ) and count( $match[0] ) ) + { + for ( $i = 0 ; $i < count( $match[0] ) ; $i++ ) + { + if ( intval($match[1][$i]) == $match[1][$i] ) + { + $attach_ids[ $match[1][$i] ] = $match[1][$i]; + $map_attach_id_to_rel_id[ $match[1][$i] ][] = $id; + } + } + } + } + + //----------------------------------------- + // Get data from the plug in + //----------------------------------------- + + $rows = $this->plugin->renderAttachment( $attach_ids, $rel_ids, $this->attach_post_key ); + + //----------------------------------------- + // Got anything? + //----------------------------------------- + + if ( is_array( $rows ) AND count( $rows ) ) + { + $attachtypes = $this->getAttachTypes(); + + foreach( $rows as $_attach_id => $row ) + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $row = $rows[ $_attach_id ]; + + /* Make older attachments safe */ + $row['attach_file'] = str_replace( '<', '<', $row['attach_file'] ); + $row['attach_file'] = str_replace( '>', '>', $row['attach_file'] ); + + /* this is now done at upload */ + //$row['attach_file'] = htmlspecialchars( $row['attach_file'] ); + + $this->attach_rel_id = $row['attach_rel_id']; + + if ( ! isset( $final_blocks[ $row['attach_rel_id'] ] ) ) + { + $final_blocks[ $row['attach_rel_id'] ] = array( 'attach' => '', 'thumb' => '', 'image' => '' ); + } + + //----------------------------------------- + // Is it an image, and are we viewing the image in the post? + //----------------------------------------- + + if ( $this->settings['show_img_upload'] and $row['attach_is_image'] ) + { + if ( $this->attach_settings['siu_thumb'] AND $row['attach_thumb_location'] AND $row['attach_thumb_width'] ) + { + //----------------------------------------- + // Make sure we've not seen this ID + //----------------------------------------- + + $row['_attach_id'] = $row['attach_id'] . '-' . str_replace( array( '.', ' ' ), "-", microtime() ); + + $tmp = $this->registry->getClass('output')->getTemplate( $skin_name )->Show_attachments_img_thumb( array( 't_location' => $row['attach_thumb_location'], + 't_width' => $row['attach_thumb_width'], + 't_height' => $row['attach_thumb_height'], + 'o_width' => $row['attach_img_width'], + 'o_height' => $row['attach_img_height'], + 'attach_id' => $row['attach_id'], + '_attach_id' => $row['_attach_id'], + 'file_size' => IPSLib::sizeFormat( $row['attach_filesize'] ), + 'attach_hits' => $row['attach_hits'], + 'location' => $row['attach_file'], + 'type' => $this->type, + 'a_location' => $row['attach_location'], + 'attach_rel_id' => $row['attach_rel_id'] ), + $parse_og ); + + //----------------------------------------- + // Convert HTML + //----------------------------------------- + + if ( isset($map_attach_id_to_rel_id[ $_attach_id ]) AND is_array( $map_attach_id_to_rel_id[ $_attach_id ] ) AND count( $map_attach_id_to_rel_id[ $_attach_id ] ) ) + { + foreach( $map_attach_id_to_rel_id[ $_attach_id ] as $idx => $_rel_id ) + { + $_count = substr_count( $htmlArray[ $_rel_id ], '[attachment='.$row['attach_id'].':' ); + + if ( $_count > 1 ) + { + # More than 1 of the same thumbnail to show? + $this->_current = array( 'type' => $this->type, + 'row' => $row, + 'skin_name' => $skin_name ); + + $returnArray[ $_rel_id ]['html'] = preg_replace_callback( '#\[attachment='.$row['attach_id'].'\:(?:[^\]]+?)[\n|\]]#is', array( &$this, '_parseThumbnailInline' ), $returnArray[ $_rel_id ]['html'] ); + } + else if ( $_count ) + { + # Just the one, then? + $returnArray[ $_rel_id ]['html'] = preg_replace( '#\[attachment='.$row['attach_id'].'\:(?:[^\]]+?)[\n|\]]#is', $tmp, $returnArray[ $_rel_id ]['html'] ); + } + else + { + $final_blocks[ $_rel_id ]['thumb'][] = $tmp; + } + } + } + else + { + $final_blocks[ $row['attach_rel_id'] ]['thumb'][] = $tmp; + } + } + else + { + //----------------------------------------- + // Standard size.. + //----------------------------------------- + + $tmp = $this->registry->getClass('output')->getTemplate( $skin_name )->Show_attachments_img( array( 'o_location' => $row['attach_location'], + 'o_width' => $row['attach_img_width'], + 'o_height' => $row['attach_img_height'], + 'attach_id' => $row['attach_id'], + '_attach_id' => $row['_attach_id'], + 'file_size' => IPSLib::sizeFormat( $row['attach_filesize'] ), + 'attach_hits' => $row['attach_hits'], + 'location' => $row['attach_file'], + 'type' => $this->type, + 'notinline' => 1, + 'a_location' => $row['attach_location'], + 'attach_rel_id' => $row['attach_rel_id'] ), + $parse_og ); + + if ( is_array( $map_attach_id_to_rel_id[ $_attach_id ] ) AND count( $map_attach_id_to_rel_id[ $_attach_id ] ) ) + { + foreach( $map_attach_id_to_rel_id[ $_attach_id ] as $idx => $_rel_id ) + { + if ( strstr( $htmlArray[ $_rel_id ], '[attachment='.$row['attach_id'].':' ) ) + { + $returnArray[ $_rel_id ]['html'] = preg_replace( '#\[attachment='.$row['attach_id'].'\:(?:[^\]]+?)[\n|\]]#is', $tmp, $returnArray[ $_rel_id ]['html'] ); + } + else + { + $final_blocks[ $_rel_id ]['image'][] = $tmp; + } + } + } + else + { + $final_blocks[ $row['attach_rel_id'] ]['image'][] = $tmp; + } + } + } + else + { + //----------------------------------------- + // Full attachment thingy + //----------------------------------------- + + $attach_cache = $this->registry->cache()->getCache('attachtypes'); + + $tmp = $this->registry->getClass('output')->getTemplate( $skin_name )->Show_attachments( array ( + 'attach_hits' => $row['attach_hits'], + 'mime_image' => $attach_cache[ $row['attach_ext'] ]['atype_img'], + 'attach_file' => $row['attach_file'], + 'attach_id' => $row['attach_id'], + 'type' => $this->type, + 'file_size' => IPSLib::sizeFormat( $row['attach_filesize'] ), + ) ); + if ( is_array( $map_attach_id_to_rel_id[ $_attach_id ] ) AND count( $map_attach_id_to_rel_id[ $_attach_id ] ) ) + { + foreach( $map_attach_id_to_rel_id[ $_attach_id ] as $idx => $_rel_id ) + { + if ( strstr( $htmlArray[ $_rel_id ], '[attachment='.$row['attach_id'].':' ) ) + { + $returnArray[ $_rel_id ]['html'] = preg_replace( '#\[attachment='.$row['attach_id'].'\:(?:[^\]]+?)[\n|\]]#is', $tmp, $returnArray[ $_rel_id ]['html'] ); + } + else + { + $final_blocks[ $_rel_id ]['attach'][] = $tmp; + } + } + } + else + { + $final_blocks[ $row['attach_rel_id'] ]['attach'][] = $tmp; + } + } + } + + //----------------------------------------- + // Anthing to add? + //----------------------------------------- + + if ( count( $final_blocks ) ) + { + foreach( $final_blocks as $rel_id => $type ) + { + $temp_out = ""; + + if ( $final_blocks[ $rel_id ]['thumb'] ) + { + $temp_out .= $this->registry->getClass('output')->getTemplate( $skin_name )->show_attachment_title( $this->lang->words['attach_thumbs'], $final_blocks[ $rel_id ]['thumb'], 'thumb' ); + } + + if ( $final_blocks[ $rel_id ]['image'] ) + { + $temp_out .= $this->registry->getClass('output')->getTemplate( $skin_name )->show_attachment_title( $this->lang->words['attach_images'], $final_blocks[ $rel_id ]['image'], 'image' ); + } + + if ( $final_blocks[ $rel_id ]['attach'] ) + { + $temp_out .= $this->registry->getClass('output')->getTemplate( $skin_name )->show_attachment_title( $this->lang->words['attach_normal'], $final_blocks[ $rel_id ]['attach'], 'attach' ); + } + + if ( $temp_out ) + { + $returnArray[ $rel_id ]['attachmentHtml'] = $temp_out; + } + } + } + } + + return $returnArray; + } + + /** + * Archive attachments + * Currently this just flags them as archived. It does not physically move the files as + * this seems a bit pointless as they have to stay in the file system anyway + * + * @param array $archiveIds + * @param string $idType + */ + public function bulkArchive( $archiveIds=array(), $idType='attach_rel_id' ) + { + /* Make sure we have some ids */ + if ( ! is_array( $archiveIds ) or ! count( $archiveIds ) ) + { + return FALSE; + } + + /* Update */ + $this->DB->update( 'attachments', array( 'attach_is_archived' => 1 ), $idType . ' IN (' . implode( ',', $archiveIds ) . ") AND attach_rel_module='" . $this->type . "'" ); + } + + /** + * Unarchive attachments + * Currently this just flags them as unarchived. It does not physically move the files as + * this seems a bit pointless as they have to stay in the file system anyway + * + * @param array $archiveIds + * @param string $idType + */ + public function bulkUnarchive( $archiveIds=array(), $idType='attach_rel_id' ) + { + /* Make sure we have some ids */ + if ( ! is_array( $archiveIds ) or ! count( $archiveIds ) ) + { + return FALSE; + } + + /* Update */ + $this->DB->update( 'attachments', array( 'attach_is_archived' => 0 ), $idType . ' IN (' . implode( ',', $archiveIds ) . ") AND attach_rel_module='" . $this->type . "'" ); + } + + /** + * Removes attachment(s) + * + * @param array $remove_ids Array of attachment ids to remove + * @param string $id_type Column to use when deleting, attach_rel_id by default + * @return bool + */ + public function bulkRemoveAttachment( $remove_ids=array(), $id_type='attach_rel_id' ) + { + /* INIT */ + $attachments = array(); + + /* Make sure we have some ids */ + if ( ! is_array( $remove_ids ) or ! count( $remove_ids ) ) + { + return FALSE; + } + + /* Check Permissions */ + if( $this->plugin->canBulkRemove( $remove_ids ) === TRUE ) + { + /* Grab the attachments */ + $this->DB->build( array( + 'select' => '*', + 'from' => 'attachments', + 'where' => $id_type . ' IN (' . implode( ',', $remove_ids ) . ") AND attach_rel_module='{$this->type}'" + ) ); + + $this->DB->execute(); + + while( $_row = $this->DB->fetch() ) + { + $attachments[ $_row['attach_id'] ] = $_row; + } + + /* Loop through and delete them from the filesystem */ + foreach( $attachments as $attach_id => $attachment ) + { + if ( $attachment['attach_location'] ) + { + @unlink( $this->_upload_path."/".$attachment['attach_location'] ); + } + if ( $attachment['attach_thumb_location'] ) + { + @unlink( $this->_upload_path."/".$attachment['attach_thumb_location'] ); + } + + /* Allow the module to clean up any items */ + $this->plugin->attachmentRemovalCleanup( $attachment ); + } + + /* Remove from the DB */ + $this->DB->delete( 'attachments', $id_type . ' IN (' . implode( ',', $remove_ids ) . ") AND attach_rel_module='{$this->type}'" ); + + return TRUE; + } + else + { + return FALSE; + } + } + + /** + * Removes an attachment. + * + * @return @e void + */ + public function removeAttachment() + { + //----------------------------------------- + // Got an ID? + //----------------------------------------- + + if ( ! $this->attach_id ) + { + return FALSE; + } + + //----------------------------------------- + // Get DB row + //----------------------------------------- + + $attachment = $this->DB->buildAndFetch( array( 'select' => '*', + 'from' => 'attachments', + 'where' => 'attach_id='.$this->attach_id." AND attach_rel_module='".$this->type."'" ) ); + + if ( ! $attachment['attach_id'] ) + { + return FALSE; + } + + //----------------------------------------- + // Make sure we've got permission + //----------------------------------------- + + if ( $this->plugin->canRemove( $attachment ) === TRUE ) + { + //----------------------------------------- + // Remove from the DB + //----------------------------------------- + + $this->DB->delete( 'attachments', 'attach_id='.$attachment['attach_id'] ); + + //----------------------------------------- + // Remove from the filesystem + //----------------------------------------- + + if ( $attachment['attach_location'] ) + { + @unlink( $this->_upload_path."/".$attachment['attach_location'] ); + } + if ( $attachment['attach_thumb_location'] ) + { + @unlink( $this->_upload_path."/".$attachment['attach_thumb_location'] ); + } + + //----------------------------------------- + // Allow the module to clean up any items + //----------------------------------------- + + $this->plugin->attachmentRemovalCleanup( $attachment ); + + return TRUE; + } + else + { + return FALSE; + } + } + + /** + * Converts post-key attachments into rel_id / rel_module attachments + * by adding in the correct ID, etc + * + * @param array $args + * @return array + */ + public function postProcessUpload( $args=array() ) + { + if( ! $this->attach_post_key or ! $this->attach_rel_id ) + { + return FALSE; + } + + //----------------------------------------- + // Got any to update? + //----------------------------------------- + + $this->DB->update( 'attachments', array( 'attach_rel_id' => $this->attach_rel_id, + 'attach_parent_id' => intval($this->attach_parent_id), + 'attach_rel_module' => $this->type ), "attach_post_key='{$this->attach_post_key}'" ); + + //----------------------------------------- + // Update module specific? + //----------------------------------------- + + return $this->plugin->postUploadProcess( $this->attach_post_key, $this->attach_rel_id, $args ); + } + + /** + * Uploads and saves file + * + * @return mixed void, or the new insert id + */ + public function processUpload() + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $this->error = ''; + + $this->getUploadFormSettings(); + + //----------------------------------------- + // Check upload dir + //----------------------------------------- + + if ( ! $this->checkUploadDirectory() ) + { + if ( $this->error ) + { + return; + } + } + + //----------------------------------------- + // Can upload? + //----------------------------------------- + + if ( ! $this->attach_stats['allow_uploads'] ) + { + $this->error = 'upload_failed'; + return; + } + + //----------------------------------------- + // Got attachment types? + //----------------------------------------- + + if ( ! ( $this->registry->cache()->getCache('attachtypes') ) OR ! is_array( $this->registry->cache()->getCache('attachtypes') ) ) + { + $attachtypes = array(); + + $this->DB->build( array( + 'select' => 'atype_extension,atype_mimetype,atype_post,atype_img', + 'from' => 'attachments_type', + 'where' => "atype_post=1" + ) ); + $this->DB->execute(); + + while ( $r = $this->DB->fetch() ) + { + $attachtypes[ $r['atype_extension'] ] = $r; + } + + $this->registry->cache()->updateCacheWithoutSaving( 'attachtypes', $attachtypes ); + } + + //----------------------------------------- + // Set up array + //----------------------------------------- + + $attach_data = array( + 'attach_ext' => "", + 'attach_file' => "", + 'attach_location' => "", + 'attach_thumb_location' => "", + 'attach_hits' => 0, + 'attach_date' => time(), + 'attach_post_key' => $this->attach_post_key, + 'attach_member_id' => $this->memberData['member_id'], + 'attach_rel_id' => $this->attach_rel_id, + 'attach_rel_module' => $this->type, + 'attach_filesize' => 0, + ); + + //----------------------------------------- + // Load the library + //----------------------------------------- + + require_once( IPS_KERNEL_PATH.'classUpload.php' );/*noLibHook*/ + $upload = new classUpload(); + + //----------------------------------------- + // Set up the variables + //----------------------------------------- + + $upload->out_file_name = $this->type . '-' . $this->memberData['member_id'] . '-' . str_replace( array( '.', ' ' ), '-', microtime() ); + $upload->out_file_dir = $this->upload_path; + $upload->max_file_size = $this->attach_stats['max_single_upload'] ? $this->attach_stats['max_single_upload'] : 1000000000; + $upload->make_script_safe = 1; + $upload->force_data_ext = 'ipb'; + + //----------------------------------------- + // Populate allowed extensions + //----------------------------------------- + + if ( is_array( $this->registry->cache()->getCache('attachtypes') ) and count( $this->registry->cache()->getCache('attachtypes') ) ) + { + /* SKINNOTE: I had to add [attachtypes] to this cache to make it work, may need fixing? */ + //$tmp = $this->registry->cache()->getCache('attachtypes'); + foreach( $this->registry->cache()->getCache('attachtypes') as $idx => $data ) + { + if ( $data['atype_post'] ) + { + $upload->allowed_file_ext[] = $data['atype_extension']; + } + } + } + + //----------------------------------------- + // Upload... + //----------------------------------------- + + $upload->process(); + + //----------------------------------------- + // Error? + //----------------------------------------- + + if ( $upload->error_no ) + { + switch( $upload->error_no ) + { + case 1: + // No upload + $this->error = 'upload_no_file'; + return $attach_data; + break; + case 2: + // Invalid file ext + $this->error = 'invalid_mime_type'; + return $attach_data; + break; + case 3: + // Too big... + $this->error = 'upload_too_big'; + return $attach_data; + break; + case 4: + // Cannot move uploaded file + $this->error = 'upload_failed'; + return $attach_data; + break; + case 5: + // Possible XSS attack (image isn't an image) + $this->error = 'upload_failed'; + return $attach_data; + break; + } + } + + //----------------------------------------- + // Still here? + //----------------------------------------- + + if ( $upload->saved_upload_name and @is_file( $upload->saved_upload_name ) ) + { + //----------------------------------------- + // Strip off { } and [ ] + //----------------------------------------- + + $upload->original_file_name = str_replace( array( '[', ']', '{', '}' ), "", $upload->original_file_name ); + + $attach_data['attach_filesize'] = @filesize( $upload->saved_upload_name ); + $attach_data['attach_location'] = $this->upload_dir . $upload->parsed_file_name; + + if( IPSText::isUTF8( $upload->original_file_name ) ) + { + $attach_data['attach_file'] = IPSText::convertCharsets( $upload->original_file_name, "UTF-8", IPS_DOC_CHAR_SET ); + } + else + { + $attach_data['attach_file'] = $upload->original_file_name; + } + + $attach_data['attach_is_image'] = $upload->is_image; + $attach_data['attach_ext'] = $upload->real_file_extension; + + if ( $attach_data['attach_is_image'] == 1 ) + { + require_once( IPS_KERNEL_PATH . 'classImage.php' );/*noLibHook*/ + require_once( IPS_KERNEL_PATH . 'classImageGd.php' );/*noLibHook*/ + + /* Main attachment */ + if ( ! empty( $this->settings['attach_img_max_w'] ) AND ! empty( $this->settings['attach_img_max_h'] ) ) + { + $image = new classImageGd(); + + $image->init( array( 'image_path' => $this->upload_path, + 'image_file' => $upload->parsed_file_name ) ); + + $image->force_resize = false; + + if ( $imgData = $image->resizeImage( $this->settings['attach_img_max_w'], $this->settings['attach_img_max_h'], false, true ) ) + { + if( !$imgData['noResize'] ) + { + $image->writeImage( $this->upload_path . '/' . $upload->parsed_file_name ); + } + + if ( is_array( $imgData ) ) + { + $attach_data['attach_img_width'] = $imgData['newWidth']; + $attach_data['attach_img_height'] = $imgData['newHeight']; + } + + $attach_data['attach_filesize'] = @filesize( $this->upload_path . '/' . $upload->parsed_file_name ); + } + } + + /* Thumb nail */ + $image = new classImageGd(); + $image->force_resize = true; + + $image->init( array( 'image_path' => $this->upload_path, + 'image_file' => $upload->parsed_file_name ) ); + + if ( TRUE ) // $this->attach_settings['siu_thumb'] ) # bug report 36511 + { + if( $this->attach_settings['siu_width'] < $attach_data['attach_img_width'] OR $this->attach_settings['siu_height'] < $attach_data['attach_img_height'] ) + { + $_thumbName = preg_replace( '#^(.*)\.(\w+?)$#', "\\1_thumb.\\2", $upload->parsed_file_name ); + + if( $thumb_data = $image->resizeImage( $this->attach_settings['siu_width'], $this->attach_settings['siu_height'] ) ) + { + $image->writeImage( $this->upload_path . '/' . $_thumbName ); + + if ( is_array( $thumb_data ) ) + { + $thumb_data['thumb_location'] = $_thumbName; + } + } + } + else + { + /* Instead of building a thumb the same size as the main image, just copy the details */ + $thumb_data = array( + 'thumb_location' => $upload->parsed_file_name, + 'newWidth' => $attach_data['attach_img_width'], + 'newHeight' => $attach_data['attach_img_height'], + ); + } + } + + if ( $thumb_data['thumb_location'] ) + { + $attach_data['attach_img_width'] = $thumb_data['originalWidth']; + $attach_data['attach_img_height'] = $thumb_data['originalHeight']; + $attach_data['attach_thumb_width'] = $thumb_data['newWidth']; + $attach_data['attach_thumb_height'] = $thumb_data['newHeight']; + $attach_data['attach_thumb_location'] = $this->upload_dir . $thumb_data['thumb_location']; + } + } + + //----------------------------------------- + // Make sure we send integers + // @link http://community.invisionpower.com/tracker/issue-32511-attachments-mysql-strict-mode + //----------------------------------------- + + $attach_data['attach_img_width'] = intval( $attach_data['attach_img_width'] ); + $attach_data['attach_img_height'] = intval( $attach_data['attach_img_height'] ); + $attach_data['attach_thumb_width'] = intval( $attach_data['attach_thumb_width'] ); + $attach_data['attach_thumb_height'] = intval( $attach_data['attach_thumb_height'] ); + + //----------------------------------------- + // Add into Database + //----------------------------------------- + + $this->DB->insert( 'attachments', $attach_data ); + + $newid = $this->DB->getInsertId(); + + return $newid; + } + } + + /** + * Uploads and saves file + * + * @return mixed void, or an array of new insert ids + */ + public function processMultipleUploads() + { + /* INIT */ + $this->error = ''; + + $this->getUploadFormSettings(); + + /* Check the upload directory */ + if( ! $this->checkUploadDirectory() ) + { + if( $this->error ) + { + return; + } + } + + /* Can Upload */ + if ( ! $this->attach_stats['allow_uploads'] ) + { + $this->error = 'upload_failed'; + return; + } + + /* Setup Attachment Types */ + if( ! ( $this->registry->cache()->getCache('attachtypes') ) OR ! is_array( $this->registry->cache()->getCache('attachtypes') ) ) + { + $attachtypes = array(); + + $this->DB->build( array('select' => 'atype_extension,atype_mimetype,atype_post,atype_img', + 'from' => 'attachments_type', + 'where' => "atype_post=1" + ) ); + $this->DB->execute(); + + while( $r = $this->DB->fetch() ) + { + $attachtypes[ $r['atype_extension'] ] = $r; + } + + $this->registry->cache()->updateCacheWithoutSaving( 'attachtypes', $attachtypes ); + } + + /* Attachment Library */ + $classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classUpload.php', 'classUpload' ); + $upload = new $classToLoad(); + + /* Set up the library */ + $upload->out_file_dir = $this->upload_path; + $upload->max_file_size = $this->attach_stats['max_single_upload'] ? $this->attach_stats['max_single_upload'] : 1000000000; + $upload->make_script_safe = 1; + $upload->force_data_ext = 'ipb'; + + /* Populate allowed extensions */ + if( is_array( $this->registry->cache()->getCache('attachtypes') ) and count( $this->registry->cache()->getCache('attachtypes') ) ) + { + /* SKINNOTE: I had to add [attachtypes] to this cache to make it work, may need fixing? */ + //$tmp = $this->registry->cache()->getCache('attachtypes'); + foreach( $this->registry->cache()->getCache('attachtypes') as $idx => $data ) + { + if( $data['atype_post'] ) + { + $upload->allowed_file_ext[] = $data['atype_extension']; + } + } + } + + /* Attempt to upload everything int he $_FILES array */ + $upload_results = array(); + + if( isset( $_FILES ) && is_array( $_FILES ) && count( $_FILES ) ) + { + foreach( $_FILES as $_field_name => $data ) + { + if( ! $_FILES[ $_field_name ]['size'] ) + { + continue; + } + + /* Set File Name */ + $upload->out_file_name = $this->type . '-' . $this->memberData['member_id'] . '-' . time() % $_FILES[ $_field_name ]['size']; + + /* Set File Name */ + $upload->upload_form_field = $_field_name; + + /* Attachment Data Array */ + $attach_data = array( + 'attach_ext' => "", + 'attach_file' => "", + 'attach_location' => "", + 'attach_thumb_location' => "", + 'attach_hits' => 0, + 'attach_date' => time(), + 'attach_post_key' => $this->attach_post_key, + 'attach_member_id' => $this->memberData['member_id'], + 'attach_rel_id' => $this->attach_rel_id, + 'attach_rel_module' => $this->type, + 'attach_filesize' => 0, + ); + + /* Upload... */ + $upload->process(); + + /* Error Check */ + if( $upload->error_no ) + { + switch( $upload->error_no ) + { + case 1: + // No upload + $upload_results[ $_field_name ] = 'upload_no_file'; + break; + + case 2: + // Invalid file ext + $upload_results[ $_field_name ] = 'invalid_mime_type'; + break; + + case 3: + // Too big... + $upload_results[ $_field_name ] = 'upload_too_big'; + break; + + case 4: + // Cannot move uploaded file + $upload_results[ $_field_name ] = 'upload_failed'; + break; + + case 5: + // Possible XSS attack (image isn't an image) + $upload_results[ $_field_name ] = 'upload_failed'; + break; + } + } + + /* Still Here */ + if( $upload->saved_upload_name and @is_file( $upload->saved_upload_name ) ) + { + /* Strip off { } and [ ] */ + $upload->original_file_name = str_replace( array( '[', ']', '{', '}' ), "", $upload->original_file_name ); + + $attach_data['attach_filesize'] = @filesize( $upload->saved_upload_name ); + $attach_data['attach_location'] = $this->upload_dir . $upload->parsed_file_name; + $attach_data['attach_file'] = $upload->original_file_name; + $attach_data['attach_is_image'] = $upload->is_image; + $attach_data['attach_ext'] = $upload->real_file_extension; + + if ( $attach_data['attach_is_image'] == 1 ) + { + require_once( IPS_KERNEL_PATH . 'classImage.php' );/*noLibHook*/ + require_once( IPS_KERNEL_PATH . 'classImageGd.php' );/*noLibHook*/ + + /* Main attachment */ + if ( ! empty( $this->settings['attach_img_max_w'] ) AND ! empty( $this->settings['attach_img_max_h'] ) ) + { + $image = new classImageGd(); + + $image->init( array( 'image_path' => $this->upload_path, + 'image_file' => $upload->parsed_file_name ) ); + + if ( $imgData = $image->resizeImage( $this->settings['attach_img_max_w'], $this->settings['attach_img_max_h'] ) ) + { + $image->writeImage( $this->upload_path . '/' . $upload->parsed_file_name ); + + if ( is_array( $imgData ) ) + { + $attach_data['attach_img_width'] = $imgData['newWidth']; + $attach_data['attach_img_height'] = $imgData['newHeight']; + } + } + } + + /* Thumb nail */ + $image = new classImageGd(); + $image->force_resize = true; + + $image->init( array( 'image_path' => $this->upload_path, + 'image_file' => $upload->parsed_file_name ) ); + + if ( $this->attach_settings['siu_thumb'] ) + { + $_thumbName = preg_replace( '#^(.*)\.(\w+?)$#', "\\1_thumb.\\2", $upload->parsed_file_name ); + + if( $thumb_data = $image->resizeImage( $this->attach_settings['siu_width'], $this->attach_settings['siu_height'] ) ) + { + $image->writeImage( $this->upload_path . '/' . $_thumbName ); + + if ( is_array( $thumb_data ) ) + { + $thumb_data['thumb_location'] = $_thumbName; + } + } + } + + if ( $thumb_data['thumb_location'] ) + { + $attach_data['attach_img_width'] = $thumb_data['originalWidth']; + $attach_data['attach_img_height'] = $thumb_data['originalHeight']; + $attach_data['attach_thumb_width'] = $thumb_data['newWidth']; + $attach_data['attach_thumb_height'] = $thumb_data['newHeight']; + $attach_data['attach_thumb_location'] = $this->upload_dir . $thumb_data['thumb_location']; + } + } + + /* Add into Database */ + $this->DB->insert( 'attachments', $attach_data ); + + $upload_results[ $_field_name ] = $this->DB->getInsertId(); + } + } + } + + return $upload_results; + } + + /** + * Gets stuff required for the upload form + * + * @return @e void + */ + public function getUploadFormSettings() + { + /* Collect settings from the plug-in */ + $stats = $this->plugin->getSpaceAllowance( $this->attach_post_key ); + + /* Fix language strings */ + if( isset($this->lang->words['attach_unlimited']) ) + { + $this->language['unlimited'] = $this->lang->words['attach_unlimited']; + } + + if( isset($this->lang->words['attach_notallowed']) ) + { + $this->language['not_allowed'] = $this->lang->words['attach_notallowed']; + } + + /* Format and return... */ + $this->attach_stats['space_used'] = $stats['space_used']; + $this->attach_stats['space_used_human'] = IPSLib::sizeFormat( $stats['space_used'] ); + $this->attach_stats['total_space_allowed'] = $stats['total_space_allowed'] ? $stats['total_space_allowed'] : $stats['max_single_upload']; + $this->attach_stats['max_single_upload'] = $stats['max_single_upload']; + $this->attach_stats['max_single_upload_human'] = $this->attach_stats['max_single_upload'] ? IPSLib::sizeFormat( $stats['max_single_upload'] ) : $this->language[ 'unlimited' ]; + $this->attach_stats['total_space_allowed_human'] = $this->attach_stats['total_space_allowed'] ? IPSLib::sizeFormat( $this->attach_stats['total_space_allowed'] ) : $this->language[ 'unlimited' ]; + + if( $stats['space_allowed'] == 0 ) + { + /* Unlimited... */ + $this->attach_stats['allow_uploads'] = 1; + $this->attach_stats['space_allowed'] = 'unlimited'; + $this->attach_stats['space_allowed_human'] = $this->language['unlimited']; + $this->attach_stats['space_left'] = 'unlimited'; + $this->attach_stats['space_left_human'] = $this->language['unlimited']; + $this->attach_stats['total_space_allowed_human'] = $this->language['unlimited']; + } + else if ( $stats['space_allowed'] == -1 ) + { + /* None */ + $this->attach_stats['allow_uploads'] = 0; + $this->attach_stats['space_allowed'] = 'not_allowed'; + $this->attach_stats['space_allowed_human'] = $this->language['not_allowed']; + $this->attach_stats['space_left'] = 'not_allowed'; + $this->attach_stats['space_left_human'] = $this->language['not_allowed']; + } + else + { + /* Set figure */ + $this->attach_stats['allow_uploads'] = 1; + $this->attach_stats['space_left'] = $stats['space_left']; + $this->attach_stats['space_left_human'] = IPSLib::sizeFormat( $stats['space_left'] ); + } + } + + /** + * Checks the upload dir. See above. It's not rocket science + * + * @return bool + */ + public function checkUploadDirectory() + { + /* Check dir exists... */ + if( ! file_exists( $this->upload_path ) ) + { + if( @mkdir( $this->upload_path, IPS_FOLDER_PERMISSION ) ) + { + @file_put_contents( $this->upload_path . '/index.html', '' ); + @chmod( $this->upload_path, IPS_FOLDER_PERMISSION ); + } + else + { + $this->error = "no_upload_dir"; + return false; + } + } + else if( ! is_writeable( $this->upload_path ) ) + { + $this->error = "no_upload_dir_perms"; + return false; + } + + /* Try and create a new monthly dir */ + $this_month = "monthly_" . gmstrftime( "%m_%Y", time() ); + + /* Already a dir? */ + if( $this->attach_settings['allow_monthly_upload_dirs'] ) + { + $path = $this->upload_path . '/' . $this_month; + + if( ! file_exists( $path ) ) + { + if( @mkdir( $path, IPS_FOLDER_PERMISSION ) ) + { + @file_put_contents( $path . '/index.html', '' ); + @chmod( $path, IPS_FOLDER_PERMISSION ); + + # Set path and dir correct + $this->upload_path .= '/' . $this_month; + $this->upload_dir = $this_month . '/'; + } + + /* Was it really made or was it lying? */ + if( ! file_exists( $path ) ) + { + $this->upload_path = $this->_upload_path; + $this->upload_dir = '/'; + } + } + else + { + /* Set path and dir correct */ + $this->upload_path .= '/' . $this_month; + $this->upload_dir = $this_month . '/'; + } + } + + return true; + } + + /** + * Loads child extends class. + * + * @return @e void + */ + public function loadAttachmentPlugin() + { + /* INIT */ + $this->type = IPSText::alphanumericalClean( $this->type ); + + /* No plugin yet? Load it! */ + if( ! is_object( $this->plugin ) && $this->type ) + { + /* Load... */ + foreach( IPSLIb::getEnabledApplications() as $app ) + { + if( is_file( IPSLib::getAppDir( $app['app_directory'] ) . '/extensions/attachments/plugin_' . $this->type . '.php' ) ) + { + $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( $app['app_directory'] ) . '/extensions/attachments/plugin_' . $this->type . '.php', 'plugin_'.$this->type, $app['app_directory'] ); + $this->plugin = new $classToLoad( $this->registry ); + $this->plugin->getSettings(); + + /* Found it, stop */ + break; + } + } + + /* Still here? Error out then.. */ + if ( ! is_object( $this->plugin ) ) + { + print "Could not locate plugin {$this->type}"; + exit(); + } + } + } + + /** + * Swaps the HTML for the nice attachments. + * + * @param array Array of matches from preg_replace_callback + * @return string HTML + */ + protected function _parseThumbnailInline( $matches ) + { + //----------------------------------------- + // INIT + //----------------------------------------- + + $row = $this->_current['row']; + $skin_name = $this->_current['skin_name']; + + //----------------------------------------- + // Generate random ID + //----------------------------------------- + + $row['_attach_id'] = $row['attach_id'] . '-' . str_replace( array( '.', ' ' ), "-", microtime() ); + + //----------------------------------------- + // Build HTML + //----------------------------------------- + + $tmp = $this->registry->getClass('output')->getTemplate( $skin_name )->Show_attachments_img_thumb( array( 't_location' => $row['attach_thumb_location'], + 't_width' => $row['attach_thumb_width'], + 't_height' => $row['attach_thumb_height'], + 'o_width' => $row['attach_img_width'], + 'o_height' => $row['attach_img_height'], + 'attach_id' => $row['attach_id'], + '_attach_id' => $row['_attach_id'], + 'file_size' => IPSLib::sizeFormat( $row['attach_filesize'] ), + 'attach_hits' => $row['attach_hits'], + 'location' => $row['attach_file'], + 'type' => $this->_current['type'], + ) ); + + return $tmp; + } } \ No newline at end of file diff --git a/upload/admin/applications/core/sources/classes/attach/controller.php b/upload/admin/applications/core/sources/classes/attach/controller.php index 22e40098..1040f96c 100644 --- a/upload/admin/applications/core/sources/classes/attach/controller.php +++ b/upload/admin/applications/core/sources/classes/attach/controller.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Attachments Controller
      * Last Updated: $Date: 2012-06-29 15:12:14 +0100 (Fri, 29 Jun 2012) $
      * By: Matt Mecham
    diff --git a/upload/admin/applications/core/sources/classes/attach/index.html b/upload/admin/applications/core/sources/classes/attach/index.html
    index e075b8d6..823f28af 100644
    --- a/upload/admin/applications/core/sources/classes/attach/index.html
    +++ b/upload/admin/applications/core/sources/classes/attach/index.html
    @@ -5,6 +5,6 @@
     
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/sources/classes/hooks/gateway.php b/upload/admin/applications/core/sources/classes/hooks/gateway.php index 20c13f33..967b917a 100644 --- a/upload/admin/applications/core/sources/classes/hooks/gateway.php +++ b/upload/admin/applications/core/sources/classes/hooks/gateway.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Subscriptions Hooks Gateway "Handler"
      * Owner: Matt "Oh Lord, why did I get assigned this?" Mecham
      * Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
    diff --git a/upload/admin/applications/core/sources/classes/hooks/index.html b/upload/admin/applications/core/sources/classes/hooks/index.html
    index e075b8d6..823f28af 100644
    --- a/upload/admin/applications/core/sources/classes/hooks/index.html
    +++ b/upload/admin/applications/core/sources/classes/hooks/index.html
    @@ -5,6 +5,6 @@
     
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/sources/classes/hooksFunctions.php b/upload/admin/applications/core/sources/classes/hooksFunctions.php index 87adf377..5499ee0e 100644 --- a/upload/admin/applications/core/sources/classes/hooksFunctions.php +++ b/upload/admin/applications/core/sources/classes/hooksFunctions.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Library of shared methods for hooks installation/configuration
      * Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
      * 
    diff --git a/upload/admin/applications/core/sources/classes/index.html b/upload/admin/applications/core/sources/classes/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/sources/classes/index.html +++ b/upload/admin/applications/core/sources/classes/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/sources/classes/reportLibrary.php b/upload/admin/applications/core/sources/classes/reportLibrary.php index 7617df66..1d0c5feb 100644 --- a/upload/admin/applications/core/sources/classes/reportLibrary.php +++ b/upload/admin/applications/core/sources/classes/reportLibrary.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Library for reported content
      * Last Updated: $LastChangedDate: 2012-11-14 18:17:25 -0500 (Wed, 14 Nov 2012) $
      * 
    diff --git a/upload/admin/applications/core/sources/classes/reportNotifications.php b/upload/admin/applications/core/sources/classes/reportNotifications.php index 67d8cb89..abd5497b 100644 --- a/upload/admin/applications/core/sources/classes/reportNotifications.php +++ b/upload/admin/applications/core/sources/classes/reportNotifications.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Notifications class for reported content
      * Last Updated: $LastChangedDate: 2013-02-19 15:55:32 -0500 (Tue, 19 Feb 2013) $
      * 
    diff --git a/upload/admin/applications/core/sources/index.html b/upload/admin/applications/core/sources/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/sources/index.html +++ b/upload/admin/applications/core/sources/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/sql/index.html b/upload/admin/applications/core/sql/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/sql/index.html +++ b/upload/admin/applications/core/sql/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/sql/mysql_report_queries.php b/upload/admin/applications/core/sql/mysql_report_queries.php index a83a1408..0632cf89 100644 --- a/upload/admin/applications/core/sql/mysql_report_queries.php +++ b/upload/admin/applications/core/sql/mysql_report_queries.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Reports content SQL query cache file
      * Last Updated: $LastChangedDate: 2012-10-18 11:56:36 -0400 (Thu, 18 Oct 2012) $
      * 
    diff --git a/upload/admin/applications/core/sql/mysql_seo_queries.php b/upload/admin/applications/core/sql/mysql_seo_queries.php index 053ac8a1..ea6870c9 100644 --- a/upload/admin/applications/core/sql/mysql_seo_queries.php +++ b/upload/admin/applications/core/sql/mysql_seo_queries.php @@ -3,7 +3,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Last Updated: $LastChangedDate: 2012-05-10 21:10:13 +0100 (Thu, 10 May 2012) $
      * 
    * diff --git a/upload/admin/applications/core/sql/mysql_tag_queries.php b/upload/admin/applications/core/sql/mysql_tag_queries.php index 12e9e839..c89dba0b 100644 --- a/upload/admin/applications/core/sql/mysql_tag_queries.php +++ b/upload/admin/applications/core/sql/mysql_tag_queries.php @@ -2,7 +2,7 @@ /** *
      * Invision Power Services
    - * IP.Board v3.4.5
    + * IP.Board v3.4.6
      * Tagging Queries
      * Last Updated: $LastChangedDate: 2013-02-18 19:33:52 -0500 (Mon, 18 Feb 2013) $
      * 
    diff --git a/upload/admin/applications/core/tasks/archive.php b/upload/admin/applications/core/tasks/archive.php index 4e2ef7b4..e6d91c24 100644 --- a/upload/admin/applications/core/tasks/archive.php +++ b/upload/admin/applications/core/tasks/archive.php @@ -1,116 +1,116 @@ -Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -/** - * - * @class task_item - * @brief Task to update the topic views from the temporary table - * - */ -class task_item -{ - /** - * Object that stores the parent task manager class - * - * @var $class - */ - protected $class; - - /** - * Array that stores the task data - * - * @var $task - */ - protected $task = array(); - - /** - * Registry Object Shortcuts - * - * @var $registry - * @var $DB - * @var $settings - * @var $lang - */ - protected $registry; - protected $DB; - protected $settings; - protected $lang; - - /** - * Constructor - * - * @param object $registry Registry object - * @param object $class Task manager class object - * @param array $task Array with the task data - * @return @e void - */ - public function __construct( ipsRegistry $registry, $class, $task ) - { - /* Make registry objects */ - $this->registry = $registry; - $this->DB = $this->registry->DB(); - $this->settings =& $this->registry->fetchSettings(); - $this->lang = $this->registry->getClass('class_localization'); - - $this->class = $class; - $this->task = $task; - } - - /** - * Run this task - * - * @return @e void - */ - public function runTask() - { - /* Language class */ - $this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' ); - - /* Load up archive class */ - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/archive/writer.php', 'classes_archive_writer' ); - $archiveWriter = new $classToLoad(); - - $archiveWriter->setApp('forums'); - - /* Do it! DO IT */ - $count = $archiveWriter->processBatch(array('process'=>500)); - - $this->class->appendTaskLog( $this->task, sprintf( $this->lang->words['task_archiveprocess'], intval($count) ) ); - - /* Load up restore class */ - $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/archive/restore.php', 'classes_archive_restore' ); - $archiveRestore = new $classToLoad(); - - $archiveRestore->setApp('forums'); - - /* Do it! DO IT */ - $count = $archiveRestore->processBatch(array('process'=>500)); - - if ( $count ) - { - $this->class->appendTaskLog( $this->task, sprintf( $this->lang->words['task_unarchiveprocess'], $count ) ); - } - - //----------------------------------------- - // Unlock Task: DO NOT MODIFY! - //----------------------------------------- - - $this->class->unlockTask( $this->task ); - } +Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +/** + * + * @class task_item + * @brief Task to update the topic views from the temporary table + * + */ +class task_item +{ + /** + * Object that stores the parent task manager class + * + * @var $class + */ + protected $class; + + /** + * Array that stores the task data + * + * @var $task + */ + protected $task = array(); + + /** + * Registry Object Shortcuts + * + * @var $registry + * @var $DB + * @var $settings + * @var $lang + */ + protected $registry; + protected $DB; + protected $settings; + protected $lang; + + /** + * Constructor + * + * @param object $registry Registry object + * @param object $class Task manager class object + * @param array $task Array with the task data + * @return @e void + */ + public function __construct( ipsRegistry $registry, $class, $task ) + { + /* Make registry objects */ + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->lang = $this->registry->getClass('class_localization'); + + $this->class = $class; + $this->task = $task; + } + + /** + * Run this task + * + * @return @e void + */ + public function runTask() + { + /* Language class */ + $this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' ); + + /* Load up archive class */ + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/archive/writer.php', 'classes_archive_writer' ); + $archiveWriter = new $classToLoad(); + + $archiveWriter->setApp('forums'); + + /* Do it! DO IT */ + $count = $archiveWriter->processBatch(); + + $this->class->appendTaskLog( $this->task, sprintf( $this->lang->words['task_archiveprocess'], intval($count) ) ); + + /* Load up restore class */ + $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/archive/restore.php', 'classes_archive_restore' ); + $archiveRestore = new $classToLoad(); + + $archiveRestore->setApp('forums'); + + /* Do it! DO IT */ + $count = $archiveRestore->processBatch(); + + if ( $count ) + { + $this->class->appendTaskLog( $this->task, sprintf( $this->lang->words['task_unarchiveprocess'], $count ) ); + } + + //----------------------------------------- + // Unlock Task: DO NOT MODIFY! + //----------------------------------------- + + $this->class->unlockTask( $this->task ); + } } \ No newline at end of file diff --git a/upload/admin/applications/core/tasks/backup.php b/upload/admin/applications/core/tasks/backup.php index 3e34199d..e45d764f 100644 --- a/upload/admin/applications/core/tasks/backup.php +++ b/upload/admin/applications/core/tasks/backup.php @@ -1,108 +1,108 @@ -Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; - exit(); -} - -/** - * - * @class task_item - * @brief Task to update the topic views from the temporary table - * - */ -class task_item -{ - /** - * Object that stores the parent task manager class - * - * @var $class - */ - protected $class; - - /** - * Array that stores the task data - * - * @var $task - */ - protected $task = array(); - - /** - * Registry Object Shortcuts - * - * @var $registry - * @var $DB - * @var $settings - * @var $lang - */ - protected $registry; - protected $DB; - protected $settings; - protected $lang; - - /** - * Constructor - * - * @param object $registry Registry object - * @param object $class Task manager class object - * @param array $task Array with the task data - * @return @e void - */ - public function __construct( ipsRegistry $registry, $class, $task ) - { - /* Make registry objects */ - $this->registry = $registry; - $this->DB = $this->registry->DB(); - $this->settings =& $this->registry->fetchSettings(); - $this->lang = $this->registry->getClass('class_localization'); - - $this->class = $class; - $this->task = $task; - } - - /** - * Run this task - * - * @return @e void - */ - public function runTask() - { - if ( defined( IPS_BACK_UP_ENABLED ) && IPS_BACK_UP_ENABLED ) - { - /* Language class */ - $this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' ); - - /* Load back up class */ - require_once( IPS_ROOT_PATH . 'sources/classes/backup.php' ); - $backup = new ipsBackup(); - - /* Set default limits for the batch pulling - will want to raise for production */ - $backup->setLimits( 'rows', 1500 ); - $backup->setLimits( 'bytes', 10 * 1024 * 1024 ); - - $backup->sendBatch(); - - if ( $count ) - { - $this->class->appendTaskLog( $this->task, "Скрипт резервного копирования отправлен" ); - } - } - //----------------------------------------- - // Unlock Task: DO NOT MODIFY! - //----------------------------------------- - - $this->class->unlockTask( $this->task ); - } +Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; + exit(); +} + +/** + * + * @class task_item + * @brief Task to update the topic views from the temporary table + * + */ +class task_item +{ + /** + * Object that stores the parent task manager class + * + * @var $class + */ + protected $class; + + /** + * Array that stores the task data + * + * @var $task + */ + protected $task = array(); + + /** + * Registry Object Shortcuts + * + * @var $registry + * @var $DB + * @var $settings + * @var $lang + */ + protected $registry; + protected $DB; + protected $settings; + protected $lang; + + /** + * Constructor + * + * @param object $registry Registry object + * @param object $class Task manager class object + * @param array $task Array with the task data + * @return @e void + */ + public function __construct( ipsRegistry $registry, $class, $task ) + { + /* Make registry objects */ + $this->registry = $registry; + $this->DB = $this->registry->DB(); + $this->settings =& $this->registry->fetchSettings(); + $this->lang = $this->registry->getClass('class_localization'); + + $this->class = $class; + $this->task = $task; + } + + /** + * Run this task + * + * @return @e void + */ + public function runTask() + { + if ( defined( IPS_BACK_UP_ENABLED ) && IPS_BACK_UP_ENABLED ) + { + /* Language class */ + $this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' ); + + /* Load back up class */ + require_once( IPS_ROOT_PATH . 'sources/classes/backup.php' ); + $backup = new ipsBackup(); + + /* Set default limits for the batch pulling - will want to raise for production */ + $backup->setLimits( 'rows', 1500 ); + $backup->setLimits( 'bytes', 10 * 1024 * 1024 ); + + $backup->sendBatch(); + + if ( $count ) + { + $this->class->appendTaskLog( $this->task, "Back up batch sent" ); + } + } + //----------------------------------------- + // Unlock Task: DO NOT MODIFY! + //----------------------------------------- + + $this->class->unlockTask( $this->task ); + } } \ No newline at end of file diff --git a/upload/admin/applications/core/tasks/cleanout.php b/upload/admin/applications/core/tasks/cleanout.php index dc295f55..4c1099eb 100644 --- a/upload/admin/applications/core/tasks/cleanout.php +++ b/upload/admin/applications/core/tasks/cleanout.php @@ -7,7 +7,7 @@ * $Author: mark $ * @since - * $LastChangedDate: 2012-06-28 06:20:34 -0400 (Thu, 28 Jun 2012) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 11000 $ */ diff --git a/upload/admin/applications/core/tasks/contentcache.php b/upload/admin/applications/core/tasks/contentcache.php index 4e4fd90a..7c0de27a 100644 --- a/upload/admin/applications/core/tasks/contentcache.php +++ b/upload/admin/applications/core/tasks/contentcache.php @@ -7,7 +7,7 @@ * $Author: bfarber $ * @since 27th January 2004 * $LastChangedDate: 2011-03-18 21:17:06 -0400 (Fri, 18 Mar 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 8131 $ */ diff --git a/upload/admin/applications/core/tasks/index.html b/upload/admin/applications/core/tasks/index.html index e075b8d6..823f28af 100644 --- a/upload/admin/applications/core/tasks/index.html +++ b/upload/admin/applications/core/tasks/index.html @@ -5,6 +5,6 @@
    You have reached this page in error, please use your back button to return to the forum.
    -IP.Board +IP.Board \ No newline at end of file diff --git a/upload/admin/applications/core/tasks/itemmarkers.php b/upload/admin/applications/core/tasks/itemmarkers.php index 85ac51d7..caa40ae9 100644 --- a/upload/admin/applications/core/tasks/itemmarkers.php +++ b/upload/admin/applications/core/tasks/itemmarkers.php @@ -7,7 +7,7 @@ * $Author: mmecham $ * @since 27th January 2004 * $LastChangedDate: 2011-12-16 06:13:08 -0500 (Fri, 16 Dec 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 10009 $ */ diff --git a/upload/admin/applications/core/tasks/logprune.php b/upload/admin/applications/core/tasks/logprune.php index 560ac5e3..c6bd5a52 100644 --- a/upload/admin/applications/core/tasks/logprune.php +++ b/upload/admin/applications/core/tasks/logprune.php @@ -4,11 +4,11 @@ *~TERABYTE_DOC_READY~ * $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$ * $License: http://www.invisionpower.com/company/standards.php#license$ - * $Author: AndyMillne $ + * $Author: rashbrook $ * @since - - * $LastChangedDate: 2012-11-28 09:38:19 -0500 (Wed, 28 Nov 2012) $ - * @version v3.4.5 - * $Revision: 11659 $ + * $LastChangedDate: 2013-10-16 19:11:24 -0400 (Wed, 16 Oct 2013) $ + * @version v3.4.6 + * $Revision: 12381 $ */ if ( ! defined( 'IN_IPB' ) ) @@ -170,6 +170,11 @@ class task_item $this->DB->delete( "error_logs", "log_date < " . (time() - $this->deleteTime) ); } + if ( $this->settings['prune_topic_archive_logs'] ) + { + $this->DB->delete( "core_archive_log", "archlog_date < " . ( time() - $this->deleteTime ) ); + } + //----------------------------------------- // SQL Logs //----------------------------------------- diff --git a/upload/admin/applications/core/tasks/minifycleanup.php b/upload/admin/applications/core/tasks/minifycleanup.php index 79bb5f95..5bf6de60 100644 --- a/upload/admin/applications/core/tasks/minifycleanup.php +++ b/upload/admin/applications/core/tasks/minifycleanup.php @@ -7,7 +7,7 @@ * $Author: ips_terabyte $ * @since - * $LastChangedDate: 2012-04-02 16:01:35 -0400 (Mon, 02 Apr 2012) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 10543 $ */ diff --git a/upload/admin/applications/core/tasks/mysqlcleanup.php b/upload/admin/applications/core/tasks/mysqlcleanup.php index d90ff985..61647978 100644 --- a/upload/admin/applications/core/tasks/mysqlcleanup.php +++ b/upload/admin/applications/core/tasks/mysqlcleanup.php @@ -7,7 +7,7 @@ * $Author: ips_terabyte $ * @since - * $LastChangedDate: 2011-02-08 17:20:18 -0500 (Tue, 08 Feb 2011) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 7750 $ */ diff --git a/upload/admin/applications/core/tasks/optimize.php b/upload/admin/applications/core/tasks/optimize.php index 58f99173..95e7df13 100644 --- a/upload/admin/applications/core/tasks/optimize.php +++ b/upload/admin/applications/core/tasks/optimize.php @@ -7,7 +7,7 @@ * $Author: AndyMillne $ * @since - * $LastChangedDate: 2013-03-12 15:04:05 -0400 (Tue, 12 Mar 2013) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 12074 $ */ diff --git a/upload/admin/applications/core/tasks/pop3email.php b/upload/admin/applications/core/tasks/pop3email.php index 253c014a..f78142ec 100644 --- a/upload/admin/applications/core/tasks/pop3email.php +++ b/upload/admin/applications/core/tasks/pop3email.php @@ -7,7 +7,7 @@ * $Author: mark $ * @since 25th June 2010 * $LastChangedDate: 2012-05-08 11:35:49 -0400 (Tue, 08 May 2012) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 10705 $ */ diff --git a/upload/admin/applications/core/tasks/rebuildstats.php b/upload/admin/applications/core/tasks/rebuildstats.php index 04b64dad..8b492e0f 100644 --- a/upload/admin/applications/core/tasks/rebuildstats.php +++ b/upload/admin/applications/core/tasks/rebuildstats.php @@ -7,7 +7,7 @@ * $Author: mark $ * @since - * $LastChangedDate: 2012-02-22 12:07:55 -0500 (Wed, 22 Feb 2012) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 10349 $ */ diff --git a/upload/admin/applications/core/tasks/sitemapgenerator.php b/upload/admin/applications/core/tasks/sitemapgenerator.php index 46cac460..86b915ac 100644 --- a/upload/admin/applications/core/tasks/sitemapgenerator.php +++ b/upload/admin/applications/core/tasks/sitemapgenerator.php @@ -6,7 +6,7 @@ * $Author: mark $ * @since - * $LastChangedDate: 2012-02-22 17:07:55 +0000 (Wed, 22 Feb 2012) $ - * @version v3.4.5 + * @version v3.4.6 * $Revision: 10349 $ */ diff --git a/upload/admin/applications/core/xml/admin_core_language_pack.xml b/upload/admin/applications/core/xml/admin_core_language_pack.xml index 25bfddc3..0e20a1d0 100644 --- a/upload/admin/applications/core/xml/admin_core_language_pack.xml +++ b/upload/admin/applications/core/xml/admin_core_language_pack.xml @@ -6,2317 +6,2503 @@ admin_ajax ls_view_more_forums View more forums - Показать все форумы + core admin_ajax ls_forums Forums - Форумы - - core - admin_ajax - ls_groupresults - - + core admin_ajax ls_groups Groups Form - Группы + + + core + admin_ajax + ls_groupresults + + core admin_ajax ls_view_more_groups View more groups - Показать все группы + core admin_ajax ls_grouptitles Groups - Группы + core admin_ajax ls_view_more_mem View more members - Показать всех пользователей + core admin_ajax lsnoresults No results - Нет результатов + core admin_ajax ls_members Members - Пользователи + core admin_ajax livesearchmemid ID: - ID: - - core - admin_ajax - ls_view_more_acp - View more ACP Pages - Показать все разделы АЦ - - core - admin_ajax - ls_acppages - ACP Pages - Разделы АЦ + core admin_ajax ls_help Help Files - Разделы помощи + core admin_ajax ls_settings Settings - Настройки + core admin_ajax ls_quick_search Quick Search - Быстрый поиск + + + core + admin_ajax + ls_view_more_acp + View more ACP Pages + + + core + admin_ajax + ls_acppages + ACP Pages + core admin_ajax ls_view_more_settings View more settings - Показать все настройки + core admin_ajax ls_view_more_help View more help files - Показать все разделы помощи + core admin_applications - h_dir_notwritable - Your hooks directory is not writable. - Директория hooks не имеет прав на запись + postform_badmd5 + Bad key supplied + core admin_applications h_norequirements We could not find the hook you were attempting to check the requirements for. - Хук, для которого вы хотели проверить требования, не найден. - - core - admin_applications - h_postendif - (post.endif) After the if statement ends - (post.endif) После завершения выражения if - - core - admin_applications - h_nodetails - We could not find the hook you were attempting to view details for. - Хук, детали которого вы хотите просмотреть, не найден. - - core - admin_applications - h_selecttemp - Select a Template - Выберите шаблон - - core - admin_applications - h_selectfile - Select a File - Выберите файл - - core - admin_applications - h_selectid - Select a Hook ID - Выберите ID хука - - core - admin_applications - h_preendif - (pre.endif) Before the if statement ends - (pre.endif) Перед завершением выражения if - - core - admin_applications - h_prestartif - (pre.startif) Before the if statement starts - (pre.startif) Перед началом выражения if - - core - admin_applications - h_postelse - (post.else) After the else statement starts - (post.else) После начала выражения else - - core - admin_applications - h_preelse - (pre.else) Before the else statement starts - (pre.else) Перед началом выражения else - - core - admin_applications - h_poststartif - (post.startif) After the if statement starts - (post.startif) После начала выражения if - - core - admin_applications - h_outerpost - (outer.post) After the foreach loop ends - (outer.post) После завершения цикла foreach - - core - admin_applications - h_innerpost - (inner.post) Before the foreach loop ends - (inner.post) Перед завершением цикла foreach - - core - admin_applications - enhancements_ipscdn - IPS CDN - Служба IPS CDN - - core - admin_applications - enhancements_ipscdn_desc - Provide your community resources through our Content Delivery Network. - Предоставляет содержимое вашего форума через сервера IPS. - - core - admin_applications - enhancements_ipscdn_error_nokey - enter your license key.]]> - лицензионный ключ.]]> - - core - admin_applications - h_innerpre - (inner.pre) After the foreach loop starts - (inner.pre) После начала цикла foreach - - core - admin_applications - h_outerpre - (outer.pre) Before the foreach loop starts - (outer.pre) Перед началом цикла foreach - - core - admin_applications - h_hasbeenun - The hook has been uninstalled. - Хук удален. - - core - admin_applications - h_noedit - We could not find the hook you were attempting to edit. - Хук, который вы хотите изменить, не найден. - - core - admin_applications - h_hasbeenenabled - The hook has been enabled. - Хук включен. - - core - admin_applications - h_hasbeendisabled - The hook has been disabled. - Хук успешно отключен - - core - admin_applications - h_updateran - update queries run - UPDATE запросов выполнено - - core - admin_applications - h_noexport - We could not find the hook you were attempting to export. - Хук, который вы пытаетесь экспортировать, не найден. - - core - admin_applications - h_insertran - insert queries run - INSERT запросов выполнено - - core - admin_applications - h_dbaltered - database tables altered - таблиц базы данных изменено - - core - admin_applications - h_dbcreated - database tables created - таблиц создано в базе данных - - core - admin_applications - h_taskup - tasks updated - задач обновлено - - core - admin_applications - h_cssup - CSS updated - CSS обновлен - - core - admin_applications - h_replacementsin - skin replacements inserted - замен в стилях вставлено - - core - admin_applications - h_replacementsup - skin replacements updated - замен в стилях обновлено - - core - admin_applications - h_taskin - tasks inserted - задач добавлено - - core - admin_applications - h_cssin - CSS inserted - CSS добавлен - - core - admin_applications - h_tempup - templates updated - шаблонов обновлено - - core - admin_applications - h_tempin - templates inserted - шаблонов добавлено - - core - admin_applications - h_acpup - ACP help files updated - файлов помощи Админцентра обновлено - - core - admin_applications - h_acpin - ACP help files inserted - файлов помощи Админцентра добавлено - - core - admin_applications - h_helpin - help files inserted - файлов помощи добавлено - - core - admin_applications - h_helpup - help files updated - файлов помощи обновлено - - core - admin_applications - h_modup - modules updated - модулей обновлено - - core - admin_applications - h_modin - modules inserted - модулей добавлено - - core - admin_applications - h_langbitup - language bits updated - языковых строк обновлено - - core - admin_applications - h_langbitin - language bits inserted - языковых строк добавлено - - core - admin_applications - h_settingup - settings updated - настроек обновлено - - core - admin_applications - h_filesin - files inserted - Файлы добавлены - - core - admin_applications - h_settingin - settings inserted - настроек добавлено - - core - admin_applications - h_settinggin - setting groups inserted - групп настроек добавлено - - core - admin_applications - h_followingacts - The following actions were done: - Выполнены следующие действия: - - core - admin_applications - h_newhookin - Hook installed - Новый хук добавлен. - - core - admin_applications - hook_removed_files - %s Cached Hook Files Removed - %s кеш-файлов хуков удалено - - core - admin_applications - h_xmlwrong - The uploaded XML file does not appear to be a valid hook installation file. - Загруженный XML-файл не является установочным файлом хука. - - core - admin_applications - h_noxml - There was no XML file uploaded. Please try again. - XML файл не загружен. Пожалуйста, попробуйте снова. - - core - admin_applications - hook_reenable_all - Reenable all hooks - Включить все хуки - - core - admin_applications - hook_disable_all - Disable all hooks - Отключить все хуки - - core - admin_applications - hook_form_noapp_dd - No Application - Нет приложения - - core - admin_applications - hook_form_key_desc - This is a unique key for your hook - Это уникальный ключ для хука - - core - admin_applications - hook_form_key - Hook Key - Ключ - - core - admin_applications - hook_form_button - Save Hook - Сохранить - - core - admin_applications - hook_form_no_title - The hook title field can not be blank - Название хука не может быть пустым - - core - admin_applications - hook_form_no_key - You must supply a hook key for your hook - Необходимо ввести ключ хука - - core - admin_applications - hook_form_dupe_key - An hook with the specified key already exists - Хук с указанным ключом уже существует - - core - admin_applications - hook_form_desc - Hook Description - Описание - - core - admin_applications - hook_form_desc_help - Brief description of what this hook does, this is for your reference only - Краткое описание того, что делает хук. (Для ссылки) - - core - admin_applications - hook_form_version - Hook Version (human-readable) - Версия хука - - core - admin_applications - hook_form_version_help - Current version of this hook - Текущая версия хука - - core - admin_applications - hook_form_page_title - Create Hook - Создать хук - - core - admin_applications - hook_form_page_info - - Используйте эту форму для создания заготовки хука. - - core - admin_applications - hook_form_title_help - Title of the hook, this is for your reference only. - Название хука (для справки). - - core - admin_applications - hook_form_info - Hook Information - Информация - - core - admin_applications - hook_form_title - Hook Title - Название - - core - admin_applications - hook_form_basic_info - Basic Hook Information - Основная информация - - core - admin_applications - a_export - Export - Экспорт - - core - admin_applications - a_addscript - Add Custom Script - Добавить скрипт - - core - admin_applications - a_script_info - You can include a custom script which will be executed upon installation and uninstallation - Вы можете добавить скрипт, который будет выполнен в ходе установки и удаления - - core - admin_applications - a_exportscript - Export Custom Script - Экспорт скрипта - - core - admin_applications - a_adddb - Add Database Changes - Добавить изменения базы данных - - core - admin_applications - a_addtasks - Add Tasks - Добавить задачи - - core - admin_applications - a_exportdb - Export Database Changes - Экспорт изменений базы данных - - core - admin_applications - a_db_info - You can include new database tables, changes to existing tables, insertions, and updates to be run - Вы можете добавить новые таблицы базы данных, изменения в существующих таблицах и обновления для запуска. - - core - admin_applications - a_exporttasks - Export Tasks - Экспорт задач - - core - admin_applications - a_tasks_info - You can include tasks to be exported with your hook - Вы можете добавить задачи для экспорта с хуком - - core - admin_applications - a_replacements_info - You can include skin replacements to be added with your hook - Вы можете вставить замены в стилях с ваших хуком - - core - admin_applications - a_noreplacements - There are no skin replacements being exported - Там нет замен в стилях для экспорта - - core - admin_applications - a_addreplacements - Add Skin Replacements - Добавить замены в стилях - - core - admin_applications - a_nocss - There are no css files being exported - Нет файлов css для экспорта - - core - admin_applications - a_addcss - Add CSS Files - Добавить файл CSS - - core - admin_applications - a_css_info - You can include css files to be added with your hook - Вы можете включить css файлы добавив вашу хук. - - core - admin_applications - a_exportcss - Export Skin CSS - Экспорт CSS стиля - - core - admin_applications - a_addskin - Add Skin Templates - Добавить шаблон стиля - - core - admin_applications - a_skin_info - You can include entire skin files or individual skin templates - Вы можете добавить как весь файл стиля так и отдельные шаблоны - - core - admin_applications - a_exportskin - Export Skin Templates - Экспорт шаблонов стиля - - core - admin_applications - a_addacp - Add ACP Help Files - Добавить файлы помощи Админцентра - - core - admin_applications - a_acp_info - You can include ACP help files to be exported with your hook - Вы можете добавить файлы помощи Админцентра для экспорта с хуком - - core - admin_applications - a_exportacp - Export ACP Help Files - Экспорт файлов помощи Админцентра - - core - admin_applications - a_help_info - You can include help files to be exported with your hook - Вы можете добавить файлы помощи для экспорта с хуков - - core - admin_applications - a_addhelp - Add Help Files - Добавить файлы помощи - - core - admin_applications - a_addmod - Add Modules - Добавить модули - - core - admin_applications - a_mod_info - You can include modules to be added to existing applications - Вы можете модули для добавления к существующим приложениям - - core - admin_applications - a_exportmod - Export Modules - Экспорт модулей + core admin_applications a_addlang Add Language Bits - Добавить языковые строки + core admin_applications - h_saved - Your hook has been successfully saved - Хук успешно сохранен - - core - admin_applications - a_lang_info - You can include entire language files, or language strings to add to existing files - Вы можете включить как отдельные языковые строки так и целые файлы - - core - admin_applications - a_addsettings - Add Settings - Добавить настройки - - core - admin_applications - a_exportlang - Export Language Strings - Эспорт языковых строк - - core - admin_applications - a_settings_info - You can include groups of settings and individual settings you wish to export with this hook - Вы можете выбрать как отдельные настройки так и их группы для экспорта с этим хуком - - core - admin_applications - a_exportsettings - Export Settings - Экспорт настроек - - core - admin_applications - a_noskin - There are no skin templates being exported - Нет шаблонов стилей для экпорта - - core - admin_applications - a_nolang - There are no language strings being exported - Нет языковых строк для экспорта - - core - admin_applications - a_noinun - There is no custom install/uninstall script configured - Нет настроенных скриптов установки/удаления - - core - admin_applications - a_nodbchanges - There are no database changes being exported - Нет изменений базы данных для экспорта - - core - admin_applications - a_notasks - There are no tasks being exported - Нет задач для экспорта - - core - admin_applications - a_noacp - There are no ACP help files being exported - Нет файлов Админцентра для экспорта - - core - admin_applications - a_nohelp - There are no help files being exported - Нет файлов помощи для экспорта - - core - admin_applications - a_nomodules - There are no modules being exported - Нет модулей для экспорта - - core - admin_applications - a_nosettings - There are no settings being exported - Нет настроек для экпорта - - core - admin_applications - a_checkrequirements - Checking system requirements... - Проверка системных требований... - - core - admin_applications - a_noyoucant - This hook is not supported on your system - Хук не поддерживается системой - - core - admin_applications - a_yesyoucan - You are able to use this hook - Вы можете использовать этот хук - - core - admin_applications - a_outerpost - after the end of the foreach statement - после завершения выражения foreach - - core - admin_applications - a_innerpost - before the end of the foreach statement - перед завершением выражения foreach - - core - admin_applications - a_innerpre - after the start of the foreach statement - после начала выражения foreach - - core - admin_applications - a_outerpre - before the start of the foreach statement - перед началом выражения foreach - - core - admin_applications - a_poststartif - after the start of the if statement - после начала выражения if - - core - admin_applications - a_preelse - before the start of the else statement - до начала выражения else - - core - admin_applications - a_postendif - after the end of the if statement - после завершения выражения if - - core - admin_applications - a_preendif - before the end of the if statement - перед завершением выражения if - - core - admin_applications - a_postelse - after the start of the else statement - после начала выражения else - - core - admin_applications - a_prestartif - before the start of the if statement - до начала выражения if - - core - admin_applications - a_labeled - labeled - с меткой - - core - admin_applications - a_datahookfor - This is a data hook for - Данные хука - - core - admin_applications - a_libraryhookfor - This is a library hook for %s in the %s application - Это хук библиотеки %s приложения %s - - core - admin_applications - a_willoverload - This hook will overload - Этот хук перегружает - - core - admin_applications - a_showsin - This hook shows in - Этот хук отображается в - - core - admin_applications - a_wherehook - Where this hook shows - Где отображается хук - - core - admin_applications - a_storedfile - Stored file name - Сохраненное имя файла - - core - admin_applications - a_realfile - Real file name - Имя файла - - core - admin_applications - a_fileuses - Files that this hook uses - Файлы используемые хуком - - core - admin_applications - a_authorsite - Author Website - Сайт автора - - core - admin_applications - a_hookver - Hook Version - Версия - - core - admin_applications - a_skingroup - The skin group this hook is in - Группа шаблонов, к которой принадлежит хук - - core - admin_applications - a_skinfunc - The skin function this hook is in - Шаблон, в котором находится хук - - core - admin_applications - a_addanother - Add Another File - Добавить файл - - core - admin_applications - a_hookid - - ID хука - - core - admin_applications - a_hookloc - Position of template hook - Расположение - - core - admin_applications - a_typeoftemp - Type of template hook - Тип хука для шаблона - - core - admin_applications - a_datalocation - Data Location - Расположение Данных - - core - admin_applications - a_templatehook - Template hook - Хук шаблона - - core - admin_applications - a_datahook - Data hook - Хук данных - - core - admin_applications - a_exporthelp - Export Help Files - Экспорт файлов помощи - - core - admin_applications - a_classextend - The class this file extends - Класс расширяемый этим файлом - - core - admin_applications - a_libraryhook - Library hook - Хук библиотеки классов - - core - admin_applications - a_selectone - Select one - Выберите - - core - admin_applications - a_aoverloader - Action overloader - Перегрузчик действия - - core - admin_applications - a_soverloader - Skin overloader - Перегрузчик стиля - - core - admin_applications - a_filehooktype - File hook type - Тип файла хука - - core - admin_applications - a_max - Max - Макс. - - core - admin_applications - a_phpver - PHP Version - Версия PHP - - core - admin_applications - a_phpminmax - Use the regular PHP version numbers to set the minimum or maximum versions. - Используйте стандартное написание версии PHP. - - core - admin_applications - a_hookfiles - Files - Файлы хука - - core - admin_applications - a_hookfile - File - Файл - - core - admin_applications - a_filenamedir - File name in hooks directory - Имя файла в директории хука - - core - admin_applications - a_fileclassname - - Имя класса - - core - admin_applications - a_enterzero - Enter 0 for no requirement limits. - Введите 0 для отмены ограничений. - - core - admin_applications - a_min - Min - Мин. - - core - admin_applications - a_hooksite - Website - Веб-сайт - - core - admin_applications - a_hooksite_info - (Optional) Enter your homepage so users can contact you - (Необязательно) Введите адрес вашего сайта - - core - admin_applications - a_hookurl - Update URL - URL для обновлений - - core - admin_applications - a_hookurl_info - "&boardVersion=(ipb-long-version-id)&version=(hook-long-version-id)" will be appended to the URL.]]> - - - core - admin_applications - a_hookrequirements - Requirements - Требования - - core - admin_applications - a_hookemail_info - (Optional) Enter your email address so the user can contact you - (Необязательно) Введите ваш e-mail - - core - admin_applications - a_hookauthor - Hook Author - Автор хука - - core - admin_applications - a_hookauthor_info - Enter the author name to display for the user - Введите имя автора - - core - admin_applications - a_hookemail - Author Email - E-mail автора - - core - admin_applications - a_hookversion_info - This is the version used to check for update available notifications - Эта версия используется для проверки обновлений - - core - admin_applications - a_hookversion - Hook Version (long-version) - Версия (длинный формат) - - core - admin_applications - a_installhook - Install Hook - Установить хук - - core - admin_applications - a_hookxml - Select a hook XML file - Выбрать XML-файл хука - - core - admin_applications - a_nodishooks - There are currently no disabled hooks - Отключенных хуков нет - - core - admin_applications - a_setuphook - Hook Setup - Настроить хук - - core - admin_applications - a_uninstallhook - Uninstall Hook - Удалить - - core - admin_applications - a_enablehook - Enable Hook - Включить - - core - admin_applications - a_checkhook - Check Requirements - Проверить требования - - core - admin_applications - a_disablehook - Disable Hook - Отключить - - core - admin_applications - a_deletehook - Delete Hook - Удалить - - core - admin_applications - a_currentver - Current Version - Текущая версия - - core - admin_applications - a_warning - WARNING, PLEASE READ - ПРЕДУПРЕЖДЕНИЕ, ПОЖАЛУЙСТА ПРОЧТИТЕ - - core - admin_applications - a_exporthook - Export Hook - Экспортировать - - core - admin_applications - a_viewhook - View Full Details - Полная информация - - core - admin_applications - a_edithook - Edit Hook - Редактировать - - core - admin_applications - a_uptodate - Up to Date - Нет обновлений + h_dir_notwritable + Your hooks directory is not writable. + core admin_applications a_move Move - Переместить + core admin_applications a_nohooks There are currently no hooks enabled - Нет включенных хуков + core admin_applications - a_lastupdated - Last Updated - Последнее обновление + h_postelse + (post.else) After the else statement starts + + + core + admin_applications + enhancements_twitter_help + Click here for instructions on how to set up your Twitter application. + + + core + admin_applications + h_selectfile + Select a File + + + core + admin_applications + h_selectid + Select a Hook ID + + + core + admin_applications + h_postendif + (post.endif) After the if statement ends + + + core + admin_applications + h_preendif + (pre.endif) Before the if statement ends + + + core + admin_applications + h_innerpost + (inner.post) Before the foreach loop ends + + + core + admin_applications + h_outerpost + (outer.post) After the foreach loop ends + + + core + admin_applications + h_prestartif + (pre.startif) Before the if statement starts + + + core + admin_applications + h_poststartif + (post.startif) After the if statement starts + + + core + admin_applications + h_preelse + (pre.else) Before the else statement starts + + + core + admin_applications + h_hasbeenun + The hook has been uninstalled. + + + core + admin_applications + h_noedit + We could not find the hook you were attempting to edit. + + + core + admin_applications + h_outerpre + (outer.pre) Before the foreach loop starts + + + core + admin_applications + h_innerpre + (inner.pre) After the foreach loop starts + + + core + admin_applications + h_hasbeenenabled + The hook has been enabled. + + + core + admin_applications + h_hasbeendisabled + The hook has been disabled. + + + core + admin_applications + h_updateran + update queries run + + + core + admin_applications + h_insertran + insert queries run + + + core + admin_applications + h_noexport + We could not find the hook you were attempting to export. + + + core + admin_applications + h_dbaltered + database tables altered + + + core + admin_applications + h_dbcreated + database tables created + + + core + admin_applications + h_taskup + tasks updated + + + core + admin_applications + h_taskin + tasks inserted + + + core + admin_applications + h_replacementsup + skin replacements updated + + + core + admin_applications + h_replacementsin + skin replacements inserted + + + core + admin_applications + h_cssup + CSS updated + + + core + admin_applications + h_tempup + templates updated + + + core + admin_applications + h_cssin + CSS inserted + + + core + admin_applications + h_helpup + help files updated + + + core + admin_applications + h_acpin + ACP help files inserted + + + core + admin_applications + h_tempin + templates inserted + + + core + admin_applications + h_acpup + ACP help files updated + + + core + admin_applications + h_helpin + help files inserted + + + core + admin_applications + h_filesin + files inserted + + + core + admin_applications + h_settinggin + setting groups inserted + + + core + admin_applications + h_settingin + settings inserted + + + core + admin_applications + h_settingup + settings updated + + + core + admin_applications + h_langbitin + language bits inserted + + + core + admin_applications + h_langbitup + language bits updated + + + core + admin_applications + h_modin + modules inserted + + + core + admin_applications + h_modup + modules updated + + + core + admin_applications + h_newhookin + Hook installed + + + core + admin_applications + h_followingacts + The following actions were done: + + + core + admin_applications + h_xmlwrong + The uploaded XML file does not appear to be a valid hook installation file. + + + core + admin_applications + hook_removed_files + %s Cached Hook Files Removed + + + core + admin_applications + h_noxml + There was no XML file uploaded. Please try again. + + + core + admin_applications + hook_reenable_all + Reenable all hooks + + + core + admin_applications + hook_disable_all + Disable all hooks + + + core + admin_applications + hook_form_noapp_dd + No Application + + + core + admin_applications + hook_form_key_desc + This is a unique key for your hook + + + core + admin_applications + hook_form_key + Hook Key + + + core + admin_applications + hook_form_desc + Hook Description + + + core + admin_applications + hook_form_desc_help + Brief description of what this hook does, this is for your reference only + + + core + admin_applications + hook_form_version + Hook Version (human-readable) + + + core + admin_applications + hook_form_version_help + Current version of this hook + + + core + admin_applications + hook_form_dupe_key + An hook with the specified key already exists + + + core + admin_applications + hook_form_no_title + The hook title field can not be blank + + + core + admin_applications + hook_form_no_key + You must supply a hook key for your hook + + + core + admin_applications + hook_form_button + Save Hook + + + core + admin_applications + hook_form_title_help + Title of the hook, this is for your reference only. + + + core + admin_applications + hook_form_info + Hook Information + + + core + admin_applications + hook_form_title + Hook Title + + + core + admin_applications + hook_form_basic_info + Basic Hook Information + + + core + admin_applications + a_addscript + Add Custom Script + + + core + admin_applications + a_export + Export + + + core + admin_applications + hook_form_page_title + Create Hook + + + core + admin_applications + hook_form_page_info + + + + core + admin_applications + a_script_info + You can include a custom script which will be executed upon installation and uninstallation + + + core + admin_applications + a_adddb + Add Database Changes + + + core + admin_applications + a_exportscript + Export Custom Script + + + core + admin_applications + a_db_info + You can include new database tables, changes to existing tables, insertions, and updates to be run + + + core + admin_applications + a_addtasks + Add Tasks + + + core + admin_applications + a_exportdb + Export Database Changes + + + core + admin_applications + a_exporttasks + Export Tasks + + + core + admin_applications + a_tasks_info + You can include tasks to be exported with your hook + + + core + admin_applications + a_addcss + Add CSS Files + + + core + admin_applications + a_nocss + There are no css files being exported + + + core + admin_applications + a_addreplacements + Add Skin Replacements + + + core + admin_applications + a_replacements_info + You can include skin replacements to be added with your hook + + + core + admin_applications + a_noreplacements + There are no skin replacements being exported + + + core + admin_applications + a_exportcss + Export Skin CSS + + + core + admin_applications + a_css_info + You can include css files to be added with your hook + + + core + admin_applications + a_addskin + Add Skin Templates + + + core + admin_applications + a_skin_info + You can include entire skin files or individual skin templates + + + core + admin_applications + a_exportskin + Export Skin Templates + + + core + admin_applications + a_addacp + Add ACP Help Files + + + core + admin_applications + a_acp_info + You can include ACP help files to be exported with your hook + + + core + admin_applications + a_exportacp + Export ACP Help Files + + + core + admin_applications + a_addhelp + Add Help Files + + + core + admin_applications + a_help_info + You can include help files to be exported with your hook + + + core + admin_applications + h_nodetails + We could not find the hook you were attempting to view details for. + + + core + admin_applications + a_exporthelp + Export Help Files + + + core + admin_applications + a_exportmod + Export Modules + + + core + admin_applications + a_mod_info + You can include modules to be added to existing applications + + + core + admin_applications + a_addmod + Add Modules + + + core + admin_applications + h_selecttemp + Select a Template + + + core + admin_applications + a_lang_info + You can include entire language files, or language strings to add to existing files + + + core + admin_applications + a_exportsettings + Export Settings + + + core + admin_applications + a_settings_info + You can include groups of settings and individual settings you wish to export with this hook + + + core + admin_applications + a_addsettings + Add Settings + + + core + admin_applications + a_exportlang + Export Language Strings + + + core + admin_applications + a_nolang + There are no language strings being exported + + + core + admin_applications + a_noskin + There are no skin templates being exported + + + core + admin_applications + a_noinun + There is no custom install/uninstall script configured + + + core + admin_applications + a_nodbchanges + There are no database changes being exported + + + core + admin_applications + a_notasks + There are no tasks being exported + + + core + admin_applications + a_noacp + There are no ACP help files being exported + + + core + admin_applications + a_nohelp + There are no help files being exported + + + core + admin_applications + a_nomodules + There are no modules being exported + + + core + admin_applications + a_nosettings + There are no settings being exported + + + core + admin_applications + a_checkrequirements + Checking system requirements... + + + core + admin_applications + a_yesyoucan + You are able to use this hook + + + core + admin_applications + a_noyoucant + This hook is not supported on your system + + + core + admin_applications + a_outerpost + after the end of the foreach statement + + + core + admin_applications + a_innerpost + before the end of the foreach statement + + + core + admin_applications + a_outerpre + before the start of the foreach statement + + + core + admin_applications + a_innerpre + after the start of the foreach statement + + + core + admin_applications + a_postendif + after the end of the if statement + + + core + admin_applications + a_preendif + before the end of the if statement + + + core + admin_applications + a_poststartif + after the start of the if statement + + + core + admin_applications + a_preelse + before the start of the else statement + + + core + admin_applications + a_postelse + after the start of the else statement + + + core + admin_applications + a_labeled + labeled + + + core + admin_applications + a_prestartif + before the start of the if statement + + + core + admin_applications + a_libraryhookfor + This is a library hook for %s in the %s application + + + core + admin_applications + a_datahookfor + This is a data hook for + + + core + admin_applications + a_willoverload + This hook will overload + + + core + admin_applications + a_showsin + This hook shows in + + + core + admin_applications + a_storedfile + Stored file name + + + core + admin_applications + a_wherehook + Where this hook shows + + + core + admin_applications + a_realfile + Real file name + + + core + admin_applications + a_authorsite + Author Website + + + core + admin_applications + a_hookver + Hook Version + + + core + admin_applications + a_datalocation + Data Location + + + core + admin_applications + a_skingroup + The skin group this hook is in + + + core + admin_applications + a_skinfunc + The skin function this hook is in + + + core + admin_applications + a_typeoftemp + Type of template hook + + + core + admin_applications + a_hookid + + + + core + admin_applications + a_hookloc + Position of template hook + + + core + admin_applications + a_addanother + Add Another File + + + core + admin_applications + a_fileuses + Files that this hook uses + + + core + admin_applications + a_datahook + Data hook + + + core + admin_applications + a_classextend + The class this file extends + + + core + admin_applications + a_libraryhook + Library hook + + + core + admin_applications + a_soverloader + Skin overloader + + + core + admin_applications + a_templatehook + Template hook + + + core + admin_applications + a_filehooktype + File hook type + + + core + admin_applications + a_aoverloader + Action overloader + + + core + admin_applications + a_selectone + Select one + + + core + admin_applications + a_fileclassname + + + + core + admin_applications + a_filenamedir + File name in hooks directory + + + core + admin_applications + a_hookfiles + Files + + + core + admin_applications + a_hookfile + File + + + core + admin_applications + a_phpminmax + Use the regular PHP version numbers to set the minimum or maximum versions. + + + core + admin_applications + a_phpver + PHP Version + + + core + admin_applications + a_max + Max + + + core + admin_applications + a_min + Min + + + core + admin_applications + a_enterzero + Enter 0 for no requirement limits. + + + core + admin_applications + a_hookrequirements + Requirements + + + core + admin_applications + a_hookemail + Author Email + + + core + admin_applications + a_hookemail_info + (Optional) Enter your email address so the user can contact you + + + core + admin_applications + a_hooksite + Website + + + core + admin_applications + a_hooksite_info + (Optional) Enter your homepage so users can contact you + + + core + admin_applications + a_hookurl + Update URL + + + core + admin_applications + a_hookurl_info + "&boardVersion=(ipb-long-version-id)&version=(hook-long-version-id)" will be appended to the URL.]]> + + + core + admin_applications + a_hookauthor_info + Enter the author name to display for the user + + + core + admin_applications + a_hookauthor + Hook Author + + + core + admin_applications + a_hookversion_info + This is the version used to check for update available notifications + + + core + admin_applications + a_installhook + Install Hook + + + core + admin_applications + a_hookxml + Select a hook XML file + + + core + admin_applications + a_hookversion + Hook Version (long-version) + + + core + admin_applications + a_nodishooks + There are currently no disabled hooks + + + core + admin_applications + a_setuphook + Hook Setup + + + core + admin_applications + a_uninstallhook + Uninstall Hook + + + core + admin_applications + a_checkhook + Check Requirements + + + core + admin_applications + a_enablehook + Enable Hook + + + core + admin_applications + a_exporthook + Export Hook + + + core + admin_applications + a_edithook + Edit Hook + + + core + admin_applications + a_deletehook + Delete Hook + + + core + admin_applications + a_disablehook + Disable Hook + + + core + admin_applications + a_viewhook + View Full Details + + + core + admin_applications + h_saved + Your hook has been successfully saved + + + core + admin_applications + a_uptodate + Up to Date + core admin_applications a_installed Installed - Установлено + + + core + admin_applications + a_lastupdated + Last Updated + core admin_applications a_hook Hook - Хук + core admin_applications a_installedhooks Installed Hooks - Установленные хуки - - core - admin_applications - a_hooks_info - Hooks can be used to modify your IP.Board installation to enhance or add new functionality. You should only install hooks from sources that you trust, as they have full PHP execution capabilities on your server. - Хуки (модификации) используются для изменения или добавления функциональности в форум. Вам следует устанавливать хуки только из тех источников, которым вы доверяете. + core admin_applications a_hooks Hooks - Хуки + core admin_applications - a_clickremove - Click here to remove this application - Нажмите для удаления приложения - - core - admin_applications - a_warning_info - CAN NOT be recovered. Only proceed if you are sure you do not need any of the data associated with the application. If you would like to keep this data but not use the application, you can disable the application instead of removing it.]]> - БЕЗ ВОЗМОЖНОСТИ ВОССТАНОВЛЕНИЯ. Продолжайте только в том случае, если уверены, что данные связанные с приложением вам не понадобятся. Если приложение более не нужно, но требуется сохранить данные, то вы можно просто отключить его.]]> - - core - admin_applications - a_cannotinstall - - Не может быть установлено ]]> - - core - admin_applications - a_cantinstall_info - This application cannot be installed. Is it in the correct directory? You cannot install third party applications into the IPS directory or vice-versa. - Это приложение не может быть установлено. Убедитесь что оно в правильной директории. Нельзя устанавливать сторонние приложения в директорию IPS и наоборот. + a_hooks_info + Hooks can be used to modify your IP.Board installation to enhance or add new functionality. You should only install hooks from sources that you trust, as they have full PHP execution capabilities on your server. + core admin_applications a_remove Remove - Удалить + core admin_applications - a_install - Install - Установить + a_currentver + Current Version + + + core + admin_applications + a_warning + WARNING, PLEASE READ + + + core + admin_applications + a_warning_info + CAN NOT be recovered. Only proceed if you are sure you do not need any of the data associated with the application. If you would like to keep this data but not use the application, you can disable the application instead of removing it.]]> + + + core + admin_applications + a_clickremove + Click here to remove this application + + + core + admin_applications + a_cantinstall_info + This application cannot be installed. Is it in the correct directory? You cannot install third party applications into the IPS directory or vice-versa. + core admin_applications a_author Author - Авторы + + + core + admin_applications + a_install + Install + + + core + admin_applications + a_cannotinstall + + core admin_applications a_unapps Applications Not Installed - Неустановленные приложения + core admin_applications a_managepublic Manage PUBLIC Modules - Публичные модули + core admin_applications a_manageadmin Manage ADMIN Modules - Администраторские модули - - core - admin_applications - a_editapp_details - Edit Application Details - Редактировать приложение - - core - admin_applications - a_appprot - Application Protected - Приложение защищено - - core - admin_applications - a_appprot_info - A protected application cannot be removed or edited by administrators - Защищенное приложение не может быть удалено или изменено обычным пользователем - - core - admin_applications - a_app - Application - Приложение - - core - admin_applications - a_installedapps - Installed Applications - Установленные приложения - - core - admin_applications - a_upgradeavail - Upgrade Available - Доступно обновление - - core - admin_applications - a_oh_kay - Up to date - Нет обновлений + core admin_applications a_removeapp Remove Application - Удалить + + + core + admin_applications + a_editapp_details + Edit Application Details + + + core + admin_applications + a_oh_kay + Up to date + + + core + admin_applications + a_upgradeavail + Upgrade Available + + + core + admin_applications + a_installedapps + Installed Applications + + + core + admin_applications + a_appprot + Application Protected + + + core + admin_applications + a_app + Application + + + core + admin_applications + a_appprot_info + A protected application cannot be removed or edited by administrators + core admin_applications a_appen Application Enabled - Приложение доступно - - core - admin_applications - a_appdir_info - This directory must exist in the /admin/applications_addon/other directory - Эта директория должна существовать в /admin/applications_addon/other - - core - admin_applications - a_appptitle - Public Title]]> - Публичное имя приложения ]]> + core admin_applications a_appdir Application Directory - Директория приложения + + + core + admin_applications + a_appdir_info + This directory must exist in the /admin/applications_addon/other directory + core admin_applications a_appver Application Version - Версия приложения + core admin_applications - a_appauthor - Application Author - Автор приложения - - core - admin_applications - a_appdesc - Application Description - Описание приложения - - core - admin_applications - a_appdesc_info - A short description - Краткое описание - - core - admin_applications - a_appphide_desc - Allows access to the application on the public side, but does not show a tab in the header - Разрешить доступ к приложению для пользователей, но скрыть вкладку в шапке форума - - core - admin_applications - a_appphide - Hide for all current and future groups? - Скрыть вкладку + a_appptitle + Public Title]]> + core admin_applications a_appptitle_info Leaving this field blank will cause the application to not be shown on the front end, making it an admin only application.]]> - Если это поле не заполнено, то приложение не будет показано, и будет доступно только в Админцентре.]]> + core admin_applications - a_filexml_info - - + a_appphide + Hide for all current and future groups? + + + core + admin_applications + a_appauthor + Application Author + + + core + admin_applications + a_appdesc_info + A short description + + + core + admin_applications + a_appdesc + Application Description + core admin_applications a_import Import - Импортировать + core admin_applications a_apptitle Application Title - Имя приложения - - core - admin_applications - a_uploadxml - Upload XML file from your computer - Загрузить XML-файл с компьютера - - core - admin_applications - a_uploadxml_info - Duplicate entries will not be overwritten but the default setting and other options will be updated. - Существующие настройки будут обновлены, другие — добавлены. + core admin_applications a_apptitle_info A short descriptive title - Краткий заголовок - - core - admin_applications - a_thedir - The directory - Директория - - core - admin_applications - a_filexml - OR enter the filename of the XML file]]> - ИЛИ введите имя XML-файла]]> + core admin_applications a_nomods This application does not yet have any modules. - Это приложение еще не имеет ни одного модуля. + core admin_applications - a_importxml - Import XML File - Импортировать XML-файл + a_appphide_desc + Allows access to the application on the public side, but does not show a tab in the header + + + core + admin_applications + a_filexml_info + + + + core + admin_applications + a_filexml + OR enter the filename of the XML file]]> + + + core + admin_applications + a_uploadxml_info + Duplicate entries will not be overwritten but the default setting and other options will be updated. + core admin_applications a_couldnotbefound could not be found. - не найдено. + core admin_applications a_removemod Remove Module... - Удалить + + + core + admin_applications + a_importxml + Import XML File + + + core + admin_applications + a_uploadxml + Upload XML file from your computer + core admin_applications a_protectedmod This is a protected module - Это защищенный модуль. - - core - admin_applications - a_position - Position - Позиция - - core - admin_applications - a_save - Save - Сохранить - - core - admin_applications - a_modprot_info - A protected application cannot be removed or edited by administrators. - Защищенное приложение не может быть удалено или изменено администратором. - - core - admin_applications - a_modprot - Module Protected - Защищенный модуль - - core - admin_applications - a_moden - Module Enabled - Модуль включен? - - core - admin_applications - a_modpar_info - If you choose a parent module, it will appear under that main menu link. If you choose no parent, it will become a main menu link. - Если вы выберите родительский модуль, то ссылка появится под ним. Если родительский модуль не выбран, то ссылка будет в главном меню. - - core - admin_applications - a_moden_info - If you disable the module, it will not appear in the menu. - Если вы отключите этот модуль, он не будет показан в меню. - - core - admin_applications - a_modver_info - The current version of this module. - Текущая версия модуля. + core admin_applications a_modpar Module Parent - Родительский модуль + + + core + admin_applications + a_modpar_info + If you choose a parent module, it will appear under that main menu link. If you choose no parent, it will become a main menu link. + + + core + admin_applications + a_thedir + The directory + + + core + admin_applications + a_position + Position + + + core + admin_applications + a_save + Save + + + core + admin_applications + a_modprot_info + A protected application cannot be removed or edited by administrators. + + + core + admin_applications + a_modprot + Module Protected + + + core + admin_applications + a_moden + Module Enabled + + + core + admin_applications + a_moden_info + If you disable the module, it will not appear in the menu. + core admin_applications a_modver Module Version - Версия модуля + core admin_applications - a_modkey_info - The name of the directory containing the module files. This should be alphanumeric only with no spaces or special characters. - Имя директории, содержащей файлы модуля. Могут использоваться только цифры и буквы без пробелов и специальных символов. - - core - admin_applications - a_modkey - Module Key - Ключ модуля - - core - admin_applications - a_modtitle_info - A short descriptive title. - Краткий заголовок. - - core - admin_applications - a_moddesc - Module Description - Описание модуля + a_modver_info + The current version of this module. + core admin_applications a_moddesc_info A short description for this module. - Краткое описание модуля. + + + core + admin_applications + a_modkey + Module Key + + + core + admin_applications + a_modkey_info + The name of the directory containing the module files. This should be alphanumeric only with no spaces or special characters. + core admin_applications a_modtitle Module Title - Имя модуля + + + core + admin_applications + a_modtitle_info + A short descriptive title. + + + core + admin_applications + a_moddesc + Module Description + core admin_applications a_modtype Module Type - Тип модуля + core admin_applications a_settings Settings - Настройки + core admin_applications a_apps Applications - Приложения + core admin_applications a_editmod Edit Module Details... - Редактировать - - core - admin_applications - a_editapp - Edit Application - Редактировать - - core - admin_applications - a_editappdone - Application edited - Приложение отредактировано + core admin_applications a_savechanges Save Changes - Сохранить + core admin_applications - a_newapp - New Application Added - Новое приложение добавлено + a_editappdone + Application edited + core admin_applications - a_appadded - Application Added - Приложение добавлено + a_editapp + Edit Application + core admin_applications a_addnewapp Add New Application - Добавить приложение + + + core + admin_applications + a_appadded + Application Added + + + core + admin_applications + a_newapp + New Application Added + core admin_applications a_titledirectory You must enter a title AND a directory name. - Вы должны ввести заголовок и имя директории. + core admin_applications a_appremoved Application Removed - Приложение удалено - - core - admin_applications - a_protectapp - This is a protected application. You cannot remove this module. - Невозможно удалить защищенное приложение. - - core - admin_applications - a_recachecomplete - Recache complete - Обновление кешей завершено - - core - admin_applications - purchase_additional - Purchase Additional Applications - Приобрести дополнительные приложения - - core - admin_applications - a_noid - No ID was passed. Please try again. - ID не задан. Попробуйте снова. - - core - admin_applications - a_protectmod - This is a protected module. You cannot remove it. - Невозможно удалить защищенный модуль. - - core - admin_applications - a_removed - Module Removed - Модуль удален. - - core - admin_applications - a_nofile - No upload file was found or no filename was specified. - Файл не загружен или имя файла не корректно. - - core - admin_applications - a_file404 - Could not find the file to open at: - Невозможно найти файл: - - core - admin_applications - a_insertupdated - %s items inserted, %s updated. - % объектов добавлено, % обновлено. - - core - admin_applications - a_already - A module already exists in this application with a key of %s. - В данном приложении модуль уже существует с ключом %. + core admin_applications a_mod_reposition Module position change completed - Позиция модуля изменена. + core admin_applications - a_modules - Modules - модули + a_protectapp + This is a protected application. You cannot remove this module. + core admin_applications - a_public - Public - Публичные + a_recachecomplete + Recache complete + core admin_applications a_admin Admin - Администраторские + core admin_applications - a_noparent - - + a_modules + Modules + core admin_applications - a_edited - Module Edited - Модуль отредактирован. - - core - admin_applications - a_added - New Module Added - Новый модуль добавлен. - - core - admin_applications - a_titlekey - You must enter a title AND a module key. - Вы должны ввести имя и ключ модуля. - - core - admin_applications - create_hook_link - Create Hook - Создать хук - - core - admin_applications - add_new_mod_public - Add New Public Module - Добавить публичный модуль - - core - admin_applications - add_new_mod_admin - Add New Admin Module - Добавить администраторский модуль - - core - admin_applications - export_mods_as_xml - Export All As XML - Экспортировать все в XML - - core - admin_applications - app_toggled_ok - The application status has been toggled - Статус приложения изменен - - core - admin_applications - module_form_edit_title - Edit module - Редактировать модуль - - core - admin_applications - module_form_add_title - Add module - Добавить модуль + a_public + Public + core admin_applications recache_link - Обновить кеш приложений + core admin_applications - seo_cannot_write - Could not write to the cache file, please check permissions on /cache and /cache/furlCache.php - Невозможна запись в файл кеша, пожалуйста, проверьте права доступа к /cache и /cache/furlCache.php + add_new_mod_admin + Add New Admin Module + core admin_applications - seo_no_data - An error occurred; could not locate any data to write - Произошла ошибка: не обнаружены данные для записи + a_noparent + + core admin_applications - furl_cache_rebuilt - FURL Cache Rebuilt - Обновление кеша ЧПУ + a_edited + Module Edited + core admin_applications - cannot_find_tog_app - We could not find the application you were attempting to enable or disable. - Мы не можем найти приложение, с которым вы хотите произвести действие. + a_added + New Module Added + core admin_applications - remove_dead_caches - Remove Dead Caches - Удалить старые кеши + a_titlekey + You must enter a title AND a module key. + + + core + admin_applications + a_already + A module already exists in this application with a key of %s. + + + core + admin_applications + a_insertupdated + %s items inserted, %s updated. + + + core + admin_applications + a_file404 + Could not find the file to open at: + + + core + admin_applications + a_removed + Module Removed + + + core + admin_applications + a_nofile + No upload file was found or no filename was specified. + + + core + admin_applications + a_protectmod + This is a protected module. You cannot remove it. + + + core + admin_applications + a_noid + No ID was passed. Please try again. + + + core + admin_applications + purchase_additional + Purchase Additional Applications + + + core + admin_applications + create_hook_link + Create Hook + + + core + admin_applications + add_new_mod_public + Add New Public Module + core admin_applications app_hooks_rebuilt %s hooks installed, %s hooks updated, and %s hooks skipped - %s хуков установлено, %s хуков обновлено, и %s хуков пропущено + core admin_applications - rebuild_app_hooks - Reimport Applications Hooks - Переимпортировать хуки + remove_dead_caches + Remove Dead Caches + core admin_applications - hook_update_available - Update Available - Доступно обновление + module_form_edit_title + Edit module + core admin_applications - hook_check_updates - Check For Updates - Проверить обновления + module_form_add_title + Add module + + + core + admin_applications + seo_no_data + An error occurred; could not locate any data to write + + + core + admin_applications + export_mods_as_xml + Export All As XML + + + core + admin_applications + seo_cannot_write + Could not write to the cache file, please check permissions on /cache and /cache/furlCache.php + + + core + admin_applications + app_toggled_ok + The application status has been toggled + + + core + admin_applications + furl_cache_rebuilt + FURL Cache Rebuilt + + + core + admin_applications + cannot_find_tog_app + We could not find the application you were attempting to enable or disable. + core admin_applications hook_h2_exporting Exporting - Экспорт + + + core + admin_applications + rebuild_app_hooks + Reimport Applications Hooks + + + core + admin_applications + hook_update_available + Update Available + + + core + admin_applications + hook_check_updates + Check For Updates + core admin_applications hook_no_hook_ids_found No hook IDs found for the chosen option - Не найдены ID хуков для выполнения операции - - core - admin_applications - hook_if_statement - if statement - условие if + core admin_applications hook_foreach_loop foreach loop - цикл foreach + + + core + admin_applications + hook_if_statement + if statement + core admin_applications addnewmodule_apps Add New Module - Добавить модуль - - core - admin_applications - a_hookapp - Application - Приложение - - core - admin_applications - cannot_toggle_defaults - You cannot disable the default System, Forum and Member applications. - Вы не можете отключить приложения Система, Форум и Пользователи. - - core - admin_applications - hook_remove_requirement - REMOVE REQUIREMENT - УДАЛИТЬ ТРЕБОВАНИЕ - - core - admin_applications - a_officialapp - Official IPS Application - Официальные приложения - - core - admin_applications - hook_remove_file - REMOVE FILE - УДАЛИТЬ ФАЙЛ - - core - admin_applications - hook_view_details - Hook Details - Данные - - core - admin_applications - hook_view_requirements - View Hook Requirements - Требования - - core - admin_applications - hook_globalcaches - Global Caches - Глобальные кеши + core admin_applications hook_form_caches Global Caches - Глобальные кеши + core admin_applications hook_form_caches_desc The caches selected here will be loaded on each page at startup without the need for additional queries - Кеши перечисленные здесь будут загружены при запросе любой страницы системы. + core admin_applications - hook_overview_warnings - There are %s warnings in the enabled hooks! - Найдено %s проблем для включенных хуков + a_hookapp + Application + core admin_applications - hook_overview_warning - There is 1 warning in the enabled hooks! - Найдена одна проблема для включенных хуков + cannot_toggle_defaults + You cannot disable the default System, Forum and Member applications. + core admin_applications - hook_require_appnotfound - %s Application not found, please install the application - Приложение %s не найдено в системе, пожалуйста установите его + hook_remove_requirement + REMOVE REQUIREMENT + core admin_applications - hook_require_tooold - Your version of the application is too old to support this hook. Minimum: %s - Версия установленного в вашей системе приложения не поддерживается данным хуком. Требуется: %s + a_officialapp + Official IPS Application + core admin_applications - hook_require_toonew - Your version of the application is too new to support this hook. Maximum: %s - Версия установленного в вашей системе приложения не поддерживается данным хуком. Требуется: %s + hook_remove_file + REMOVE FILE + core admin_applications - hook_require_current - Your version - Ваша версия + hook_globalcaches + Global Caches + core admin_applications - hook_require_min - Minimum version - Минимальная версия + hook_view_requirements + View Hook Requirements + core admin_applications - hook_require_max - Maximum version - Максимальная версия - - core - admin_applications - hook_require_ok - OK - ОК - - core - admin_applications - hook_require_error - ERROR - ОШИБКА + hook_view_details + Hook Details + core admin_applications hook_badge_warning WARNING - ВНИМАНИЕ + + + core + admin_applications + hook_overview_warning + There is 1 warning in the enabled hooks! + + + core + admin_applications + hook_overview_warnings + There are %s warnings in the enabled hooks! + + + core + admin_applications + hook_require_current + Your version + + + core + admin_applications + hook_require_min + Minimum version + + + core + admin_applications + hook_require_max + Maximum version + + + core + admin_applications + hook_require_ok + OK + + + core + admin_applications + hook_require_error + ERROR + + + core + admin_applications + hook_require_toonew + Your version of the application is too new to support this hook. Maximum: %s + + + core + admin_applications + hook_require_tooold + Your version of the application is too old to support this hook. Minimum: %s + core admin_applications hook_require_appdisabled %s application is disabled, please enable the application - Приложение %s отключено, пожалуйста включите его + core admin_applications - hook_require_skip_reqs - If you still want to go ahead and enable it press the 'Enable Hook' button above but BE CAREFUL as you might get errors!]]> - Вы вправе проигнорировать данное предупреждение и включит хук, нажав кнопку "Включить", но при этом могут возникнуть проблемы в работе всей системы.]]> + hook_require_appnotfound + %s Application not found, please install the application + core admin_applications import_modules_xml Import Modules XML - Импортировать XML модулей + core admin_applications a_appurl_info "&boardVersion=(ipb-long-version-id)&version=(app-long-version-id)" will be appended to the URL.]]> - "&boardVersion=(ipb-long-version-id)&version=(app-long-version-id)" будет добавлено к данному URL.]]> + + + core + admin_applications + hook_require_skip_reqs + If you still want to go ahead and enable it press the 'Enable Hook' button above but BE CAREFUL as you might get errors!]]> + core admin_applications hook_require_apptitle Additional Application - Дополнительное приложение + core admin_applications hook_require_addanother Add another application - Добавить другое приложение + core admin_applications hook_require_noreqs This hook has no requirements - Хук не имеет обязательных требований + core admin_applications - export_modules_xml - Export Modules XML - Экспортировать XML модулей + h_phpnew + Your PHP version is too new to support this hook. Maximum: %s + core admin_applications h_phpold Your PHP version is too old to support this hook. Minimum: %s - Используемая версия PHP не подходит для этого хука. - - core - admin_applications - enhancements_viglink - VigLink - - core - admin_applications - enhancements_viglink_desc - Get paid for clicks from your community. - Оплата за клики с вашего форума - - core - admin_applications - app_tab_gcaches - Global Caches - Глобальные кеши - - core - admin_applications - export_apps_xml - Export Applications XML - Экспортировать XML приложений core admin_applications app_tab_info Application Information - Информация + + + core + admin_applications + export_modules_xml + Export Modules XML + + + core + admin_applications + app_tab_gcaches + Global Caches + + + core + admin_applications + export_apps_xml + Export Applications XML + core admin_applications app_tab_permissions Tab Restrictions - Права доступа + core admin_applications app_form_tabgroups Hide for groups... - Скрыть от групп + core admin_applications app_form_tabgroups_desc - Укажите группы, которые ну будут видеть закладки в меню, но при этом будут иметь возможность работы с приложением. Параметр не имеет силы, если предедущая настройка выставлена в значение «Да» - - core - admin_applications - updates_string_single - There is 1 update available - Доступно одно обновление - - core - admin_applications - updates_string_more - There are %s updates available - Доступно %s обновлений - - core - admin_applications - app_already_added - The specified application directory already exists, please use a different directory - Указанная директория уже существует, пожалуйста выберите другую директорию + core admin_applications app_disable_hook_warnings enabled hooks !]]> - включенных хуков !]]> - - core - admin_applications - sphinx_cronjob_note - NOTE: these cronjobs should work with most servers, but if you experience issues with them please contat your hosting company for support. - ПРИМЕЧАНИЕ: данное описание задач подходит для большинства серверов, однако, если у вас возникли проблемы с добавлением задач, то воспользуйтесь помощью вашего хостинг-провайдера. - - core - admin_applications - sphinx_cronjob_details - If you have already added these cronjobs to your server previously, please be sure to edit the old ones instead of adding duplicates.]]> - Если вы уже добавляли задачи в cron, то убедитесь, что прежде чем добавить новые, вы удалили старые.]]> + core admin_applications sphinx_cronjob_nofiledesc - + core admin_applications - sphinx_cronjob_nofile - File not found - Файл не найден + sphinx_cronjob_details + If you have already added these cronjobs to your server previously, please be sure to edit the old ones instead of adding duplicates.]]> + core admin_applications - sphinx_cronjob_path - Path to sphinx.conf - Путь к sphinx.conf + sphinx_cronjob_note + NOTE: these cronjobs should work with most servers, but if you experience issues with them please contat your hosting company for support. + + + core + admin_applications + updates_string_single + There is 1 update available + + + core + admin_applications + updates_string_more + There are %s updates available + + + core + admin_applications + app_already_added + The specified application directory already exists, please use a different directory + core admin_applications sphinx_cronjob_path_desc Enter the path to your sphinx.conf file on the server (no trailing slash) - Введите путь до вашего файла sphinx.php (без слеша на конце) + core admin_applications - sphinx_cronjob_title - Build Sphinx Cronjobs - Создание cron-задач для Sphinx - - core - admin_applications - sphinx_build_conf - Build sphinx.conf - Создать sphinx.conf + sphinx_cronjob_nofile + File not found + core admin_applications sphinx_build_cronjob Build Cronjobs - Создать задачи для cron + core admin_applications - sphinx_menu_desc - View Sphinx related tasks - Просмотр задач, связанных со Sphinx + sphinx_build_conf + Build sphinx.conf + + + core + admin_applications + sphinx_cronjob_title + Build Sphinx Cronjobs + + + core + admin_applications + sphinx_cronjob_path + Path to sphinx.conf + core admin_applications sphinx_menu_title Sphinx - Sphinx + core admin_applications - a_no_related_hooks - This application is not specified in any current hook requirements. - Приложение не исползьуется в требованиях ни в одном из текущих хуков - - core - admin_applications - cdn_blurb - The IPS CDN allows you to provide your community resources through our Content Delivery Network. - IPS CDN позволяет кэшировать и передавать пользователям содержимое вашего форума через сервера IPS, что разгрузит ваш хостинг. - - core - admin_applications - h_any_version - Any Version - Любая версия + sphinx_menu_desc + View Sphinx related tasks + core admin_applications h_edit_settings Edit settings - Изменить настройки + + + core + admin_applications + h_any_version + Any Version + + + core + admin_applications + a_no_related_hooks + This application is not specified in any current hook requirements. + core admin_applications a_nodetails We could not find the application you were attempting to view details for. - Система не может найти приложение, детали которого вы пытаетесь посмотреть + + + core + admin_applications + a_related_hooks + Related Hooks + + + core + admin_applications + a_upgrade_history + Upgrade History + core admin_applications a_installed_on Installed on - Установлено в + core admin_applications - enhancements_ipscdn_error_key - check your license key is entered correctly.]]> - ваш лицензионный ключ введен правильно.]]> + a_other_details + Other Details + + + core + admin_applications + a_app_details + Application Details + + + core + admin_applications + a_edit_restrictions + Edit Restrictions + + + core + admin_applications + a_noapps_disabled + There are currently no applications disabled + + + core + admin_applications + a_apps_disabled + Disabled + + + core + admin_applications + a_noapps_enabled + There are currently no applications enabled + + + core + admin_applications + a_disable_app + Disable Application + + + core + admin_applications + a_enable_app + Enable Application + + + core + admin_applications + wl_3b + XML Location + + + core + admin_applications + wl_3c + Save + + + core + admin_applications + wl_disable + Disable Windows Live + + + core + admin_applications + wl_2c + Client Secret + + + core + admin_applications + wl_2d + Download XML + + + core + admin_applications + wl_3 + After you have downloaded the XML file, upload it to your server. It is recommended that you store it in a non-web-accessible location. Once this is done, enter the path to where you have stored the file below. + + + core + admin_applications + wl_2b + Client ID + + + core + admin_applications + wl_2 + Windows Live Application Details + + + core + admin_applications + wl_1b + Windows Live application management site + + + core + admin_applications + enhancements_ipscdn_error_nokey + enter your license key.]]> + + + core + admin_applications + wl_1 +
    1. Follow the onscreen instructions to add an application.

    2. Once your application is set up, click the 'Application Settings', then navigate to 'API Settings'. In the 'Redirect Domain' box, enter the following value and save:
    %s

    3. On that page you will see a 'Client ID' and a 'Client Secret' - enter them below and click the 'Download XML' button.

    Please note that Windows Live login integration requires the mhash and mcrypt_decrypt modules to be enabled on your server.]]>
    +
    + + core + admin_applications + cdn_manage + Buy More Credits + + + core + admin_applications + cdn_active + %s of credit remaining.]]> + + + core + admin_applications + cdn_disable + Disable CDN + + + core + admin_applications + cdn_disabed + CDN Disabled + + + core + admin_applications + cdn_recache + Purge CDN + + + core + admin_applications + cdn_recached + CDN Recached + + + core + admin_applications + cdn_blurb + The IPS CDN allows you to provide your community resources through our Content Delivery Network. + + + core + admin_applications + viglink_blurb + To start using VigLink, click the button below to sign up for VigLink, then revisit this page to configure your VigLink settings. + + + core + admin_applications + viglink_signup + Create VigLink Account + + + core + admin_applications + viglink_existing + Or use your existing VigLink API Key + + + core + admin_applications + viglink_existing_title + VigLink API Key + + + core + admin_applications + viglink_existing_save + Start Using VigLink + + + core + admin_applications + viglink_forums_notice + forum settings.]]> + + + core + admin_applications + enhancements_mandrill_desc + Send emails from your community via Mandrill. + core admin_applications @@ -2326,297 +2512,81 @@ core admin_applications - enhancements_mandrill_desc - Send emails from your community via Mandrill. - Отсылает email через Mandrill + cdn_activate + Activate IPS CDN + core admin_applications - viglink_forums_notice - forum settings.]]> - настройки форумов.]]> + enhancements_viglink_error + We could not connect with VigLink. Please try again later or contact technical support for assistance. + core admin_applications - a_app_details - Application Details - Детали приложения + enhancements_ipscdn + IPS CDN + core admin_applications - a_other_details - Other Details - Детали + enhancements_ipscdn_error_key + check your license key is entered correctly.]]> + core admin_applications - a_related_hooks - Related Hooks - Недавние хуки + enhancements_ipscdn_error_url + The URL that your community is using does not match the URL your license key is associated with. In order to use the CDN service, the URLs must match so that files can be located properly. You can change the URL associated with your license key from the client area, or contact technical support for assistance. + core admin_applications - a_upgrade_history - Upgrade History - История обновлений + enhancements_ipscdn_desc + Provide your community resources through our Content Delivery Network. + core admin_applications - a_edit_restrictions - Edit Restrictions - Изменить ограничения + enhancements_viglink_desc + Get paid for clicks from your community. + core admin_applications - wl_1b - Windows Live application management site - Управление приложениями Windows Live + enhancements_windowslive_error2 + The XML file could not be found at the path specified. Please check the path entered is correct. + core admin_applications - cdn_disabed - CDN Disabled - CDN Отключена + enhancements_viglink + VigLink + core admin_applications - cdn_recache - Purge CDN - Перекэшировать + a_apps_enabled + Enabled + core admin_applications - cdn_recached - CDN Recached - Кэш CDN обновлен + enhancements_windowslive_desc + Allows users to sign into your community with their Windows Live account. + core admin_applications - wl_1 -
    1. Follow the onscreen instructions to add an application.

    2. Once your application is set up, click the 'Application Settings', then navigate to 'API Settings'. In the 'Redirect Domain' box, enter the following value and save:
    %s

    3. On that page you will see a 'Client ID' and a 'Client Secret' - enter them below and click the 'Download XML' button.

    Please note that Windows Live login integration requires the mhash and mcrypt_decrypt modules to be enabled on your server.]]>
    -
    1. Следуйте инструкции на сайте, чтобы добавть новое приложение.

    2. Когда приложение будет настроено перейдите в пункт 'Application Settings', а затем в 'API Settings'. В поле 'Redirect Domain' введите следующие данные и сохраните настройки:
    %s

    3. На той же странице вы найдете 'Client ID' и 'Client Secret' - введите их ниже и нажмите кнопку 'Загрузить XML'.

    Учтите, что интеграция Windows Live требует модулей mhash и mcrypt_decrypt на вашем сервере.]]>
    - - core - admin_applications - viglink_blurb - To start using VigLink, click the button below to sign up for VigLink, then revisit this page to configure your VigLink settings. - Чтобы начать использовать VigLink, нажмите кнопку ниже и зарегистрируйтес/авторизуйтесь на VigLink. Затем вернитесь на эту страницу и введити настройки VigLink - - core - admin_applications - viglink_signup - Create VigLink Account - Войти в VigLink - - core - admin_applications - enhancements_twitter_desc - Allows users to sign into your community with their Twitter account. - Позволяет пользователям входить на форум используя аккаунт Twitter. - - core - admin_applications - enhancements_twitter_help - Click here for instructions on how to set up your Twitter application. - Нажмите здесь, чтобы получить инструкции по настройке приложения в Twitter. + enhancements_windowslive_error + enable it to continue.]]> + core admin_applications enhancements_windowslive Windows Live - - core - admin_applications - enhancements_windowslive_desc - Allows users to sign into your community with their Windows Live account. - Позволяет пользователям входить на форум используя аккаунт Windows Live. - - core - admin_applications - a_noapps_disabled - There are currently no applications disabled - Нет отключенных приложений - - core - admin_applications - a_noapps_enabled - There are currently no applications enabled - Нет включенных приложений - - core - admin_applications - a_apps_disabled - Disabled - Отключено - - core - admin_applications - a_apps_enabled - Enabled - Включено - - core - admin_applications - wl_disable - Disable Windows Live - Отключить Windows Live - - core - admin_applications - a_enable_app - Enable Application - Включить приложение - - core - admin_applications - a_disable_app - Disable Application - Отключить приложение - - core - admin_applications - wl_3 - After you have downloaded the XML file, upload it to your server. It is recommended that you store it in a non-web-accessible location. Once this is done, enter the path to where you have stored the file below. - После загрузки XML-файла, скопируйте его на ваш сервер. Рекомендуется хранить его в месте недоступном вэб-клиентам. Затем впишите путь к файлу ниже. - - core - admin_applications - wl_3c - Save - Сохранить - - core - admin_applications - wl_3b - XML Location - Расположение XML - - core - admin_applications - wl_2d - Download XML - Загрузить XML - - core - admin_applications - wl_2 - Windows Live Application Details - Настройки Приложения Windows Live - - core - admin_applications - wl_2b - Client ID - ID клиента - - core - admin_applications - enhancements_viglink_error - We could not connect with VigLink. Please try again later or contact technical support for assistance. - Не удалось связаться с VigLink. Пожалуйста попробуйте повторить попытку позже или свяжитесь с технической поддержкой. - - core - admin_applications - wl_2c - Client Secret - Секретный Код - - core - admin_applications - cdn_activate - Activate IPS CDN - Активировать IPS CDN - - core - admin_applications - cdn_manage - Buy More Credits - Пополнить Счет - - core - admin_applications - cdn_active - %s of credit remaining.]]> - %s кредитов.]]> - - core - admin_applications - viglink_existing - Or use your existing VigLink API Key - Или испульзуйте полученный ранее ключ VigLink - - core - admin_applications - viglink_existing_title - VigLink API Key - Ключ API VigLink - - core - admin_applications - viglink_existing_save - Start Using VigLink - Начать Использовать VigLink - - core - admin_applications - cdn_disable - Disable CDN - Отключить CDN - - core - admin_applications - enhancements_ipscdn_error_url - The URL that your community is using does not match the URL your license key is associated with. In order to use the CDN service, the URLs must match so that files can be located properly. You can change the URL associated with your license key from the client area, or contact technical support for assistance. - URL вашего форума не соответствует URL, указанному в вашей лицензии. Чтобы использовать службу CDN, URL совпадать, тогда файлы будут расположены правильно. Вы можете изменить URL связанный с вашим ключем в клиентцентре IPS или связавшись с тех.поддержкой IPS. - - core - admin_applications - enhancements_windowslive_error2 - The XML file could not be found at the path specified. Please check the path entered is correct. - XML-файл не найден по указанному пути. - - core - admin_applications - enhancements_windowslive_error - enable it to continue.]]> - включите его для продолжения.]]> - - core - admin_applications - enhancements_spammonitoring_help - Click here for more information about the IPS Spam Monitoring service. - Нажмите здесь, чтобы узнать больше о Сервисе Мониторинга Спама от IPS. - - core - admin_applications - enhancements_twitter - Twitter - - - core - admin_applications - enhancements_spammonitoring_desc - Protects your community from spam account registrations. - Защищает ваш форум от спама. - - core - admin_applications - enhancements_spammonitoring - Spam Monitoring Service - Сервисе Мониторинга Спама. - - core - admin_applications - enhancements_googleanalytics_desc - Traffic measurement and interactive reporting for your community. - Данные о трафике и интерактивные отчеты о вашем форуме. - - core - admin_applications - enhancements_googleanalytics_help - Click here to visit the Google Analytics site where you can find out more and register an account. - Нажмите здесь, чтобы посетить сайт Google Analytics, где вы найдете больше информации и сможете зарегистрироваться. core admin_applications @@ -2626,27 +2596,63 @@ core admin_applications - enhancements_facebook_help - Click here for instructions on how to set up your Facebook application. - Нажмите здесь, чтобы узнать о том как настроить приложение Facebook. + enhancements_googleanalytics_desc + Traffic measurement and interactive reporting for your community. + + + core + admin_applications + enhancements_googleanalytics_help + Click here to visit the Google Analytics site where you can find out more and register an account. + + + core + admin_applications + enhancements_spammonitoring + Spam Monitoring Service + + + core + admin_applications + enhancements_spammonitoring_desc + Protects your community from spam account registrations. + + + core + admin_applications + enhancements_spammonitoring_help + Click here for more information about the IPS Spam Monitoring service. + core admin_applications enhancements_spammonitoring_error Your IPS Community Suite license does not entitle you to the Spam Monitoring Service. Please contact account assistance for more information. - Ваша лицензия не позволяет вам использовать Сервис Мониторинга Спама. + core admin_applications - enhancements_save - Save - Сохранить + enhancements_facebook_help + Click here for instructions on how to set up your Facebook application. + core admin_applications - enhancements_saved - Service Updated - Служба Обновлена + no_write_hooks + Your system administrator has disabled the ability to import hooks. Please contact your system administrator for assistance. + + + core + admin_applications + enhancements_twitter_desc + Allows users to sign into your community with their Twitter account. + + + core + admin_applications + enhancements_twitter + Twitter + core admin_applications @@ -2658,9032 +2664,9009 @@ admin_applications enhancements_facebook_desc Allows users to sign into your community with their Facebook account. - Позволяет вашим пользователям авторизоваться используя учетную запись Facebook + core admin_applications - no_write_hooks - Your system administrator has disabled the ability to import hooks. Please contact your system administrator for assistance. - Администратор форума отключил возможность импорта хуков. + enhancements_saved + Service Updated + core admin_applications - h_phpnew - Your PHP version is too new to support this hook. Maximum: %s - Используемая версия PHP не подходит для этого хука. - - core - admin_applications - err_no_enhancement - Could not locate the service you are trying to configure. - Не найдена служба, которую вы пытаетесь настроить. - - core - admin_applications - postform_badmd5 - Bad key supplied - Указан не верный ключ + enhancements_save + Save + core admin_applications community_enhancements Community Enhancements - Расширения Сообщества. + core - admin_global - module__forums_archive - Archiving - Архивация + admin_applications + err_no_enhancement + Could not locate the service you are trying to configure. + core admin_global module__members_warnings Warnings - Предупреждения + core admin_global - license_missing_header - License Key Missing - Отсуствует ключ лицензии - - core - admin_global - module__forums_statistics - Statistics Center - Статистика - - core - admin_global - module__members_cfields - Custom Profile Fields - Дополнительные поля - - core - admin_global - module__members_bulkmail - Bulk Mail - Рассылки - - core - admin_global - module__members_members - Members - Пользователи - - core - admin_global - module__members_groups - Member Groups - Группы - - core - admin_global - module__forums_rss - RSS Management - Управление RSS + module__forums_archive + Archiving + core admin_global module__members_restrictions Manage Admin Restrictions - Ограничение доступа в АЦ + + + core + admin_global + module__members_cfields + Custom Profile Fields + + + core + admin_global + module__members_members + Members + + + core + admin_global + module__members_bulkmail + Bulk Mail + + + core + admin_global + module__members_groups + Member Groups + + + core + admin_global + module__forums_rss + RSS Management + core admin_global module__forums_tools Tools - Инструменты + + + core + admin_global + module__forums_statistics + Statistics Center + core admin_global module__forums_forums Forums - Форумы + core admin_global module__forums_attachments Post Attachments - Прикрепленные файлы + core admin_global module__core_help - Поддержка + core admin_global module__core_sql SQL Management - Управление SQL + core admin_global module__core_system System - Система - - core - admin_global - module__core_report - Report Center - Жалобы - - core - admin_global - module__core_applications - - Приложения + core admin_global module__core_tools - Инструменты - - core - admin_global - module__core_posts - Post Content - Сообщения - - core - admin_global - module__core_languages - Manage Languages - Языки - - core - admin_global - module__core_diagnostics - Diagnostics - Диагностика + core admin_global module__core_settings System Settings - Настройки + core admin_global - module__core_templates - - Внешний вид + module__core_report + Report Center + + + core + admin_global + module__core_applications + + + + core + admin_global + module__core_languages + Manage Languages + + + core + admin_global + module__core_posts + Post Content + + + core + admin_global + module__core_diagnostics + Diagnostics + core admin_global module__core_mycp My Control Panel - Моя панель + core admin_global module__core_logs Logs - Журналы + core admin_global - menu__customfields - Custom Profile Fields - Дополнительные поля профиля - - core - admin_global - menu__warn_actions - Actions - Действия + module__core_templates + + core admin_global menu__warn_reasons Reasons - Причины + + + core + admin_global + menu__warn_actions + Actions + + + core + admin_global + menu__customfields + Custom Profile Fields + core admin_global menu__restrictions Manage ACP Restrictions - Ограничение доступа к АЦ + core admin_global menu__notifications Notification Defaults - Настройки уведомлений + core admin_global menu__banfilters Ban Filters - Бан фильтр + core admin_global menu__mem_add Add New Member - Создание пользователя + core admin_global menu__mem_tools Member Management Tools - Дополнительные инструменты + core admin_global menu__mem_rep Member Reputation - Репутация + core admin_global menu__mem_ranks Member Ranks - Звания - - core - admin_global - menu__manage_members - Manage Members - Управление пользователями + core admin_global menu__manage_perms Manage Member Permissions - Управление Правами доступа - - core - admin_global - menu__skins_ie - Import / Export - Импорт / экспорт - - core - admin_global - menu__performance - Performance Mode - Режим производительности - - core - admin_global - menu__manage_groups - Manage Member Groups - Управление Группами + core admin_global menu__stats_spam Spam Service - Работы антиспам-сервиса + + + core + admin_global + menu__manage_members + Manage Members + + + core + admin_global + menu__manage_groups + Manage Member Groups + core admin_global menu__bulkmail Bulk Mail - Рассылки + core admin_global menu__stats_tviews Topic Views - Просмотров Тем + core admin_global menu__stats_pms Personal Message - Личных сообщений + core admin_global menu__stats_posts Post Stats - Сообщений + core admin_global menu__stats_topics New Topic Stats - Новых тем + core admin_global menu__stats_reg Registration Stats - Регистраций + core admin_global menu__archive_rules Archive Rules - Правила архива + core admin_global menu__archive_overview Archive Overview - Обзор архива + core admin_global menu__rssexports RSS Export - Экспорт + core admin_global menu__rssimports RSS Import - Импорт + core admin_global menu__multimod Topic Multi-Moderation - Мульти-модерация + core admin_global menu__forums Manage Forums - Управление форумами - - core - admin_global - menu__attachment_search - Attachment Search - Поиск + core admin_global menu__attachment_stats Attachment Stats - Статистика + core admin_global - menu__manage_help - Manage Help Files - Разделы помощи - - core - admin_global - menu__caches - Cache Management - Управление кешем + menu__attachment_search + Attachment Search + core admin_global menu__attachment_types Attachment Types - Типы прикрепляемых файлов - - core - admin_global - menu__incoming_emails - Incoming Email Rules - Правила входящий почты - - core - admin_global - menu__login_modules - Log In Management - Модули авторизации + core admin_global menu__sharelinks Share Links - Сервисы публикации ссылок + core admin_global - menu__api_users - API Users - Пользователи API + menu__login_modules + Log In Management + core admin_global menu__qanda - Система «Вопрос-ответ» + + + core + admin_global + menu__api_users + API Users + + + core + admin_global + menu__caches + Cache Management + + + core + admin_global + menu__manage_help + Manage Help Files + + + core + admin_global + menu__incoming_emails + Incoming Email Rules + core admin_global menu__cleanup_tools Clean Up Tools - Инструменты очистки - - core - admin_global - menu__recount_rebuild - - Пересчет и обновление - - core - admin_global - menu__uagents - User Agent Management - Управление User Agent + core admin_global menu__licensekey License Key - Ключ лицензии + + + core + admin_global + menu__uagents + User Agent Management + + + core + admin_global + menu__recount_rebuild + + + + core + admin_global + menu__performance + Performance Mode + + + core + admin_global + menu__skins_ie + Import / Export + core admin_global menu__skins_logo Easy Logo Changer - Смена логотипа - - core - admin_global - menu__skins_sar - Search and Replace - Поиск и замена + core admin_global menu__skins_merge Template Merge Center - Сравнение и слияние стилей + + + core + admin_global + menu__skins_sar + Search and Replace + core admin_global menu__skins_tools Template Tools - Инструменты + core admin_global menu__skins_systemtemplates Manage System Templates - Управление Шаблонами Системы + core admin_global menu__skins_manage - Управление стилями + core admin_global menu__listadmins List Admins - Список администраторов + core admin_global menu__security Security Center - Центр безопасности + core admin_global menu__taskmanager System Scheduler - Планировщик задач + core admin_global menu__sql_processes SQL Processes - Выполняющиеся процессы + core admin_global menu__sql_vars SQL System Vars - Значения системных настроек + core admin_global menu__sql_ri SQL Runtime Info - Информация о состоянии сервера + core admin_global menu__sql_backup SQL Back Up - Резервирование базы данных + core admin_global menu__sql_toolbox SQL Toolbox - Инструменты управления SQL + core admin_global menu__reports_ssl - Статусы + core admin_global menu__reports_plugin Plugin Manager - Плагины + core admin_global menu__settings System Settings - Настройки + core admin_global menu__acronyms Acronym Expansion - Расшифровка Сокращений. + core admin_global menu__badwords Bad Word Filters - Нецензурные слова + core admin_global menu__mediatag Manage Media Tag - Медиа-теги + core admin_global menu__bbcode BBCode Management - BB-коды + core admin_global menu__emoticons Emoticon Management - Смайлики + core admin_global menu__mydetails Change My Details - Изменение данных - - core - admin_global - menu__splashlogs - Logs - Журналы + core admin_global menu__dashboard My Dashboard - Панель управления + + + core + admin_global + menu__splashlogs + Logs + core admin_global menu__languages Manage Languages - Языки - - core - admin_global - menu__help_bugs - Report a Bug - Сообщить об ошибке + core admin_global menu__help_features Feature Requests - Предложения о развитии + + + core + admin_global + menu__help_bugs + Report a Bug + core admin_global menu__help_contact IPS Contact Information - Контактная информация + core admin_global menu__help_resources Additional Resources - Дополнительные ресурсы + core admin_global menu__help_support Technical Support - Техническая поддержка + core admin_global menu__help_kb IPS Knowledgebase - База знаний - - core - admin_global - menu__dbi_checker - Database Index Checker - Проверка индексов базы + core admin_global menu__help_documentation Documentation - Документация + + + core + admin_global + menu__dbi_checker + Database Index Checker + core admin_global menu__email_checker Email Tester - Проверка Email + core admin_global menu__db_checker Database Checker - Проверка базы + core admin_global menu__connection_checker Connection Checker - Проверка соединений + core admin_global menu__permissions_checker Permissions Checker - Проверка прав доступа - - core - admin_global - menu__manage_hooks - Manage Hooks - Управление хуками + core admin_global menu__whitespace_checker Whitespace Checker - Поиск файлов содержащих лишние пробелы + core admin_global menu__diag_overview Overview - Обзор + core admin_global menu__community_enhancements Community Enhancements - Дополнения Сообщества + + + core + admin_global + menu__manage_hooks + Manage Hooks + core admin_global menu__manage_apps_modules - Управление приложениями + core admin_global menu__skins_meta Manage Meta Tags - Управление Мета-тэгами + core admin_global menu__skins_external - Внешнее редактирование шаблонов и CSS + core admin_global menu__seo_keywords SEO Keywords - Ключевые слова для SEO + core admin_global menu__seo_visitors Search Engine Visitors - Визиты Поисковых Роботов + core admin_global menu__seo_dashboard Search Activity - Статистика Поисковиков + core admin_global menu__seo_advice SEO Advice - SEO - рекомендации + core admin_global show_all_emotes Show All - Все + core admin_global gl_pagejump Jump To Page - Перейти к + core admin_global gl_manageapps Manage Applications - Управление приложениями + core admin_global gl_signin Log In - Вход + core admin_global gl_password Password - Пароль - - core - admin_global - gl_signinname - Sign In Name - Логин + core admin_global gl_ipsapp IPS - Официальные приложения + core admin_global - gl_resources - Visit IPS Marketplace - Посетить форумы IBR - - core - admin_global - gl_resources_title - Our resource site provides free and premium skins, modifications, articles and languages for your IP.Board - На нашем сайте вы сможете найти бесплатные стили, модификации и дополнительные языковые пакеты для вашего форума. - - core - admin_global - gl_getsupport - Get Support - Поддержка - - core - admin_global - gl_getsupport_title - Get support by submitting a ticket to our technicians - Отправьте запрос в нашу службу поддержки - - core - admin_global - gl_blog - Blog - Блоги + gl_signinname + Sign In Name + core admin_global gl_subsmanager Subscriptions - Подписки + + + core + admin_global + gl_getsupport + Get Support + + + core + admin_global + gl_getsupport_title + Get support by submitting a ticket to our technicians + + + core + admin_global + gl_resources_title + Our resource site provides free and premium skins, modifications, articles and languages for your IP.Board + + + core + admin_global + gl_resources + Visit IPS Marketplace + + + core + admin_global + gl_blog + Blog + core admin_global gl_downloads Downloads - Файловый менеджер + core admin_global gl_gallery Gallery - Галерея + core admin_global gl_portal Portal - Портал + core admin_global gl_livesearch Live search ACP... - Поиск по АЦ + core admin_global gl_myapps My Apps - Приложения + core admin_global gl_support Support - Поддержка + core admin_global gl_lookandfeel - Внешний вид - - core - admin_global - gl_forums - Forums - Форумы + core admin_global gl_members Members - Пользователи + + + core + admin_global + gl_forums + Forums + core admin_global gl_system System - Система + core admin_global gl_icon Icon - Иконка + core admin_global gl_logo Logo - Логотип + core admin_global gl_ipbadminarea IPB3 Admin Area - Админцентр IPB3 + core admin_global gl_loggedinas Logged in as - Вы вошли под учетной записью + core admin_global gl_loading Loading... - Загрузка... + core admin_global gl_pleasewait Please Wait - Пожалуйста подождите + core admin_global gl_error Error - Ошибка + core admin_global gl_insertmedia Insert Media - Добавить ролик + core admin_global gl_insertemail Insert Email - Вставить e-mail + core admin_global gl_insertimage Insert Image - Вставить изображение + core admin_global gl_insertlink Insert Link - Вставить ссылку + core admin_global gl_mediaurl Media URL - Ссылка на ролик + core admin_global gl_cancel_edit Cancel Source Edit - Отменить редактирование + core admin_global gl_update Update - Обновить - - core - admin_global - gl_example - Example - Пример + core admin_global gl_add Add - Добавить + + + core + admin_global + gl_example + Example + core admin_global gl_emailme Email me - Отравить мне письмо + core admin_global gl_emailaddress Email Address - Е-mail адрес + core admin_global gl_imageurl Image URL - URL изображения + core admin_global gl_mylink My link - Моя ссылка + core admin_global gl_linktext Link text - Текст ссылки + core admin_global gl_url URL - Адрес (URL) + core admin_global gl_gotohome Go to: Administration Home - Перейти на главную админцентра + core admin_global M_12 December - Декабрь - - core - admin_global - M_10 - October - Октябрь + core admin_global M_11 November - Ноябрь + + + core + admin_global + M_10 + October + core admin_global M_9 September - Сентябрь + core admin_global M_8 August - Август + core admin_global M_7 July - Июль + core admin_global M_6 June - Июнь + core admin_global M_5 May - Май + core admin_global M_4 April - Апрель + core admin_global M_3 March - Март + core admin_global M_2 February - Февраль + core admin_global M_1 January - Январь + core admin_global tpl_prev Previous Page - Предыдущая страница + core admin_global tpl_next Next page - Следующая страница + core admin_global tpl_islast Last - Последняя + core admin_global tpl_isfirst First - Первая + core admin_global tpl_gotofirst Go to first page - Перейти на первую страницу - - core - admin_global - tpl_gotolast - Go to last page - Перейти к последней странице + core admin_global time_14 (GMT + 14:00 hours) Kiritimati - (GMT + 14:00) Киритимати (остров Рождества) + + + core + admin_global + tpl_gotolast + Go to last page + core admin_global time_13 (GMT + 13:00 hours) Enderbury Kiribati - (GMT + 13:00) Республика Кирибати - - core - admin_global - time_12.75 - (GMT + 12:45 hours) Chatham Islands - (GMT + 12:45) Острова Чатем + core admin_global time_12 (GMT + 12:00 hours) Auckland, Fiji, Marshall Islands - (GMT + 12:00) Камчатка, Магадан, Чукотка, Окленд, Фиджи, Веллингтон + + + core + admin_global + time_12.75 + (GMT + 12:45 hours) Chatham Islands + core admin_global time_11.5 (GMT + 11:30 hours) Burnt Pine, Kingston - (GMT + 11:30) Бернт Пайн, Кингстон + core admin_global time_11 (GMT + 11:00 hours) New Caledonia, Solomon Is. - (GMT + 11:00) Хабаровск, Новая Каледония, Соломоновы о-ва + core admin_global time_10.5 (GMT + 10:30 hours) Lord Howe Island - (GMT + 10:30) Остров Лорд-Хау + core admin_global time_10 (GMT + 10:00 hours) Melbourne, Papua New Guinea, Sydney - (GMT + 10:00) Амурская обл., Забайкальский край, Канберра, Мельбурн, Гуам, Сидней + core admin_global time_9.5 (GMT + 9:30 hours) Adelaide, Darwin - (GMT + 9:30) Аделаида, Дарвин + core admin_global time_9 (GMT + 9:00 hours) Osaka, Sapporo, Seoul, Tokyo - (GMT + 9:00) Иркутск, Осака, Саппоро, Сеул, Токио, Якутск + core admin_global time_8.75 (GMT + 8:45 hours) Caiguna, Eucla - (GMT + 8:45) Кейгуна, Юкла - - core - admin_global - time_7 - (GMT + 7:00 hours) Bangkok, Hanoi, Jakarta - (GMT + 7:00) Новосибирск, Омск, Томск, Бангкок, Ханой, Джакарта + core admin_global time_8 (GMT + 8:00 hours) Hong Kong, Perth, Singapore, Taipei - (GMT + 8:00) Красноярск, Тува, Пекин, Гонконг, Перт, Сингапур, Тайпей + core admin_global - time_6 - (GMT + 6:00 hours) Almaty, Bangladesh, Dhakra, Ekaterinburg - (GMT + 6:00) Екатеринбург, Челябинск, Оренбург, Коломбо, Дхака + time_7 + (GMT + 7:00 hours) Bangkok, Hanoi, Jakarta + core admin_global time_6.5 (GMT + 6:30 hours) Yangon, Naypyidaw, Bantam - GMT + 6:30) Янгон, Найпьидо, Бантам + core admin_global time_5.75 (GMT + 5:45 hours) Kathmandu - (GMT + 5:45) Катманду + core admin_global - time_5.5 - (GMT + 5:30 hours) Bombay, Calcutta, Madras, New Delhi - (GMT + 5:30) Бомбей, Калькутта, Мадрас, Нью-Дели - - core - admin_global - time_4.5 - (GMT + 4:30 hours) Kabul - (GMT + 4:30) Кабул - - core - admin_global - time_5 - (GMT + 5:00 hours) Karachi, Tashkent - (GMT + 5:00) Исламабад, Карачи, Ташкент - - core - admin_global - time_3.5 - (GMT + 3:30 hours) Tehran - (GMT + 3:30) Тегеран - - core - admin_global - time_4 - (GMT + 4:00 hours) Abu Dhabi, Baku, Moscow, Muscat, Tbilisi - (GMT + 4:00) Москва, Абу-Даби, Баку, Мускат, Тбилиси + time_6 + (GMT + 6:00 hours) Almaty, Bangladesh, Dhakra, Ekaterinburg + core admin_global time_3 (GMT + 3:00 hours) Baghdad, Riyadh, Kaliningrad, Nairobi - (GMT + 3:00) Калининград, Багдад, Эр-Рияд, Найроби + + + core + admin_global + time_3.5 + (GMT + 3:30 hours) Tehran + + + core + admin_global + time_4 + (GMT + 4:00 hours) Abu Dhabi, Baku, Moscow, Muscat, Tbilisi + + + core + admin_global + time_4.5 + (GMT + 4:30 hours) Kabul + + + core + admin_global + time_5 + (GMT + 5:00 hours) Karachi, Tashkent + + + core + admin_global + time_5.5 + (GMT + 5:30 hours) Bombay, Calcutta, Madras, New Delhi + core admin_global time_2 (GMT + 2:00 hours) South Africa - (GMT + 2:00) Каир, Хельсинки, Южная Африка, Варшава - - core - admin_global - time_1 - (GMT + 1:00 hours) Brussels, Copenhagen, Madrid, Paris, Rome - (GMT + 1:00) Амстердам, Берлин, Брюссель, Мадрид, Париж - - core - admin_global - time_0 - (GMT) Casablanca, Dublin, London, Lisbon, Monrovia - (GMT) Касабланка, Дублин, Эдинбург, Лиссабон, Лондон, Монровия - - core - admin_global - time_-2 - (GMT - 2:00 hours) Mid-Atlantic, Ascention Is., St Helena - (GMT - 2:00) Среднеатлантическое время + core admin_global time_-1 (GMT - 1:00 hours) Azores, Cape Verde Islands - (GMT - 1:00) Азорские о-ва, о-ва Зеленого мыса + core admin_global - time_-3 - (GMT - 3:00 hours) Brazil, Buenos Aires, Falkland Is. - (GMT - 3:00) Бразилия, Буэнос-Айрес, Джорджтаун, Гренландия + time_0 + (GMT) Casablanca, Dublin, London, Lisbon, Monrovia + core admin_global - time_-3.5 - (GMT - 3:30 hours) Newfoundland - (GMT - 3:30) Ньюфаундленд - - core - admin_global - time_-6 - - (GMT - 6:00) Центральное время (США и Канада), Мехико - - core - admin_global - time_-5 - - (GMT - 5:00) Восточное время (США и Канада), Богота, Лима, Кито - - core - admin_global - time_-4.5 - (GMT - 4:30 hours) Bolivarian Time - (GMT - 4:30) Боливарианское время + time_1 + (GMT + 1:00 hours) Brussels, Copenhagen, Madrid, Paris, Rome + core admin_global time_-4 (GMT - 4:00 hours) Atlantic Time (Canada), Caracas, La Paz - (GMT - 4:00) Атлантическое время (Канада), Каракас, Ла Пас, Сантьяго + core admin_global - time_-8 - - (GMT - 8:00) Тихоокеанское время (США и Канада), Тихуана + time_-2 + (GMT - 2:00 hours) Mid-Atlantic, Ascention Is., St Helena + core admin_global - time_-7 - - (GMT - 7:00) Горное время (США и Канада), Аризона + time_-3 + (GMT - 3:00 hours) Brazil, Buenos Aires, Falkland Is. + core admin_global - time_-10 - (GMT - 10:00 hours) Hawaii - (GMT - 10:00) Гавайи + time_-3.5 + (GMT - 3:30 hours) Newfoundland + core admin_global - time_-9.5 - (GMT - 9:30 hours) French Polynesia - (GMT - 9:30) Французская Полинезия - - core - admin_global - time_-9 - (GMT - 9:00 hours) Alaska - (GMT - 9:00) Аляска + time_-4.5 + (GMT - 4:30 hours) Bolivarian Time + core admin_global time_-11 (GMT - 11:00 hours) Midway Island, Samoa - (GMT - 11:00) о.Мидуэй, Самоа + + + core + admin_global + time_-5 + + + + core + admin_global + time_-6 + + + + core + admin_global + time_-7 + + + + core + admin_global + time_-8 + + + + core + admin_global + time_-9 + (GMT - 9:00 hours) Alaska + + + core + admin_global + time_-9.5 + (GMT - 9:30 hours) French Polynesia + + + core + admin_global + time_-10 + (GMT - 10:00 hours) Hawaii + core admin_global time_-12 (GMT - 12:00 hours) Enitwetok, Kwajalien - (GMT - 12:00) Эневеток, Кваджалейн + core admin_global no No - Нет - - core - admin_global - DESC - Descending - По убыванию + core admin_global yes Yes - Да + + + core + admin_global + DESC + Descending + core admin_global ASC Ascending - По возрастанию + core admin_global invalid_id Invalid ID - Неверный ID + core admin_global preview Preview - Предпросмотр + core admin_global revert Revert - Отменить + core admin_global delete Delete - Удалить + core admin_global edit Edit - Изменить + core admin_global gbl_go_to_module_home Go to Module Home - Перейти на страницу модулей + core admin_global gbl_go_to_dashboard Go to Dashboard - Перейти в панель управления - - core - admin_global - ipb_message - IP.Board Message - Сообщение IP.Board - - core - admin_global - gbl_system_error - System Error - Системная ошибка + core admin_global gbl_go_back Go Back - Назад + core admin_global - gbl_initializing - Initializing... - Инициализация... + gbl_system_error + System Error + + + core + admin_global + ipb_message + IP.Board Message + core admin_global redirecting_to Redirecting to: - Перемещение: + core admin_global - gbl_view_site - Community - Перейти к списку форумов - - core - admin_global - gbl_log_out - Sign Out - Выйти - - core - admin_global - gbl_dashboard - Dashboard - Панель управления - - core - admin_global - gbl_queries - Queries - запросов - - core - admin_global - gbl_page_redirecting - Please wait while this action executes - Подождите, сейчас Вы будете перенаправлены + gbl_initializing + Initializing... + core admin_global page_will_refresh The page will refresh automatically - Страница будет обновлена автоматически + core admin_global refresh_dont_wait ( Click here if you do not wish to wait ) - ( Нажмите здесь, если не хотите ждать ) + core admin_global - and - and - и + gbl_page_redirecting + Please wait while this action executes + core admin_global - in - in - в + gbl_dashboard + Dashboard + core admin_global - gbl_no_info - No Information - Нет данных + gbl_queries + Queries + core admin_global ajax_please_wait Loading Data. Please Wait... - Загрузка. Подождите... + core admin_global - or - or - или + gbl_view_site + Community + + + core + admin_global + gbl_log_out + Sign Out + + + core + admin_global + gbl_no_info + No Information + core admin_global func_security_mismatch Security Mismatch - please go back and reload the form before attempting to submit the form / press the button again - Проблема безопасности - пожалуйста вернитесь назад обновите форму и попытайтесь отправить ее снова. + core admin_global - a_options - Options - Опции + in + in + + + core + admin_global + or + or + + + core + admin_global + and + and + core admin_global my_checkall Check all rows - Отметить все - - core - admin_global - sort_desc - Sort in descending order - По убыванию - - core - admin_global - sort_asc - Sort in ascending order - По возрастанию - - core - admin_global - get_help_title - Toggles inline help, providing assistance with the features on this page. - Переключить режим отображения помощи. - - core - admin_global - help_new_window - Open this help topic in a new window - Открыть в новом окне + core admin_global close_help Close Help - Закрыть + core admin_global rebuild_sphinx
    You should now rebuild your sphinx.conf file and upload the new one to your server.]]>
    -
    Следующим шагом вы должны внести изменения в файл sphinx.conf и загрузить его на сервер. Так же, вероятно, вам нужно будет снова перестроить поисковый индекс, чтобы изменения вступили в силу. Пожалуйста ознакомьтесь с knowledgebase article для дополнительной информации.]]>
    + core admin_global - no_login_methods - Could not load any login handlers - Не удалось загрузить модули авторизации + a_options + Options + + + core + admin_global + sort_desc + Sort in descending order + + + core + admin_global + sort_asc + Sort in ascending order + + + core + admin_global + help_new_window + Open this help topic in a new window + + + core + admin_global + get_help_title + Toggles inline help, providing assistance with the features on this page. + core admin_global get_help Get Help With This Page - Помощь + core admin_global page_1_of_1 Page 1 of 1 - Страница 1 из 1 - - core - admin_global - no_permission - You do not have permission to access this page - У вас нет прав для доступа к этой странице - - core - admin_global - yesno_yes - Yes - Да - - core - admin_global - yesno_no - No - Нет - - core - admin_global - reset_failed_logins - Reset Failed Logins... - Сбросить неудачные попытки входа + core admin_global redirect_page_text Redirecting... - Перенаправление... + core admin_global acp_quick_help Quick Help - Быстрая помощь + + + core + admin_global + yesno_yes + Yes + + + core + admin_global + yesno_no + No + + + core + admin_global + no_permission + You do not have permission to access this page + + + core + admin_global + no_login_methods + Could not load any login handlers + + + core + admin_global + reset_failed_logins + Reset Failed Logins... + core admin_global redirect_repeat_step Repeat this step - Повторить шаг + core admin_global redirect_halt_continue Continue Anyway... - Все равно продолжить + core admin_global redirect_halt_title Redirect Halted Due To Errors - Перенаправление остановлено из-за ошибок - - core - admin_global - session_mismatchip - Your current IP address does not match the one in our records - IP адрес не соответствует адресу в сессии администратора - - core - admin_global - session_timeout - You have been inactive for too long and your session has timed out - Время сессии истекло из-за бездействия - - core - admin_global - session_noaccess - You do not have access to the administrative CP - Вы не имеете доступа к панеле администратора + core admin_global session_invalidmid Member ID invalid - ID пользователя неверное + core admin_global - _laquo - - + session_noaccess + You do not have access to the administrative CP + core admin_global - optgroup_other - Other - Другие - - core - admin_global - session_nomemberid - Could not retrieve a valid member id - Не удалось получить id пользователя - - core - admin_global - _raquo - - - - core - admin_global - _rarr - - - - core - admin_global - _larr - - - - core - admin_global - notemplatefiletoload - Could not locate template: %s - Не удалось загрузить шаблон: %s - - core - admin_global - tpl_pages_acp - Page %s of %s - Страница %s из %s - - core - admin_global - wiz_prev - - - - core - admin_global - wiz_next - - - - core - admin_global - gbl_inc_files - Included Files - Подключено файлов - - core - admin_global - gbl_memory - MEMORY USAGE - ИСПОЛЬЗОВАНИЕ ПАМЯТИ - - core - admin_global - ttlmemoryused - Total Memory Used: - Использовано памяти: + session_mismatchip + Your current IP address does not match the one in our records + core admin_global pg_prev Prev - Предыдущая + core admin_global - pg_next - Next - Следующая + tpl_pages_acp + Page %s of %s + core admin_global - livesearch_pages - Pages - Страницы + notemplatefiletoload + Could not locate template: %s + core admin_global - livesearch_nexus - Nexus - Нексус + session_timeout + You have been inactive for too long and your session has timed out + core admin_global - livesearch_more - %d results... - %d результатов... + session_nomemberid + Could not retrieve a valid member id + + + core + admin_global + _laquo + + + + core + admin_global + optgroup_other + Other + + + core + admin_global + _raquo + + + + core + admin_global + _larr + + + + core + admin_global + _rarr + + core admin_global peakmemoryused Peak: - Пик: + + + core + admin_global + pg_next + Next + + + core + admin_global + gbl_memory + MEMORY USAGE + + + core + admin_global + ttlmemoryused + Total Memory Used: + + + core + admin_global + gbl_inc_files + Included Files + + + core + admin_global + wiz_next + + + + core + admin_global + wiz_prev + + core admin_global admin_step Step - Шаг + core admin_global disabled Disabled - Отключено + core admin_global enabled Enabled - Включено + core admin_global gl_reportsmenu - Статистика + core admin_global livesearch_forums Forums - Форумы + core admin_global license_expired_info - visit your client center.]]> - клиент-центр.]]> + visit your client center.]]> + core admin_global license_expired_header License Key Expired - Истекло время активности лицензии + + + core + admin_global + livesearch_nexus + Nexus + + + core + admin_global + livesearch_more + %d results... + + + core + admin_global + license_missing_header + License Key Missing + core admin_global license_missing_info provide your license key]]> - странице по ссылке.]]> + + + core + admin_global + livesearch_pages + Pages + core admin_global livesearch_groups Groups - Группы - - core - admin_global - livesearch_members - Members - Пользователи - - core - admin_global - other_applications - Other Apps - Другие приложения + core admin_global livesearch_settings Settings - Настройки + + + core + admin_global + livesearch_members + Members + core admin_global gotomarketplace Go to IPS Marketplace - Перейти в IPS Marketplace + core admin_global - ipsmarketplace_is_best - The IPS Marketplace is the best place to find new skins, applications and hooks for your community. - IPS Marketplace - лучшее место для загрузки новых стилей, приложений и хуков для вашего сообщества. + other_applications + Other Apps + core admin_global search_marketplace_more Search the IPS Marketplace for applications, hooks, skins and more. - Поискать в IPS Marketplace дополнения, стили, хуки и т.д. + + + core + admin_global + ipsmarketplace_is_best + The IPS Marketplace is the best place to find new skins, applications and hooks for your community. + core admin_global reg_trends_chart Registration Trends - Тенденции регистраций + core admin_global search_ipsmarketplace Search IPS Marketplace - Поискать в IPS Marketplace + core admin_global items_requiring_action Items Requiring Attention - системных сообщений - - core - admin_global - version - Version: - Версия: - - core - admin_global - server_status - Server Status: - Состояние системы: - - core - admin_global - welcome - Welcome, - Здравствуйте, + core admin_global toggle_perf_mode Toggle performance mode - Переключить режим производительности + + + core + admin_global + server_status + Server Status: + + + core + admin_global + version + Version: + + + core + admin_global + welcome + Welcome, + core admin_global gbl_ok Ok - Ок - - core - admin_global - live_search_no_results - There were no results for your search - Ничего не найдено по вашему запросу + core admin_global gbl_on On - Вкл + core admin_global gbl_off Off - Выкл - - core - admin_global - gz_not_available - To resolve this issue, you can extract the file on your computer and then upload the .xml file, or contact your hosting provider and ask for the zlib extension to be installed.]]> - zlip библиотека недоступна на вашем сервере, что не дает возможность распаковывать архивы .xml.gz. Вы можете либо включить zlib на сервере, либо скачать к себе на компьютер, разархивировать и пробовать уже с .xml файлом. - - core - admin_global - bookmarks_title - Manage Bookmarks - Управление Закладками + core admin_global make_root_category Make Root (Category) - Создать Корневую Категорию + core admin_global - bookmarks_add_field_home - Make home page (first page loaded after logging in) - Сделать домашней страницей(будет отображаться после логина) + gz_not_available + To resolve this issue, you can extract the file on your computer and then upload the .xml file, or contact your hosting provider and ask for the zlib extension to be installed.]]> + + + core + admin_global + live_search_no_results + There were no results for your search + core admin_global bookmarks_add_field_title Bookmark Title: - Название Закладки: + core admin_global - bookmarks_add_title - Bookmark this page - Добавление страницы в закладки + bookmarks_add_field_home + Make home page (first page loaded after logging in) + core admin_global bookmarks_save Save - Сохранить + + + core + admin_global + bookmarks_add_title + Bookmark this page + + + core + admin_global + bookmarks_title + Manage Bookmarks + core admin_global bookmarks_make_home Make Home - Домашняя + core admin_global use_html Use HTML? - Использовать HTML? + core admin_global set_up_tabs Set up the app bar just the way you want - Настройте панель приложений так, как вам удобно + core admin_global edit_tabs Edit Tabs - Редактировать вкладки - - core - admin_hooks - desc_revert - - + core admin_hooks desc_data Specify data to insert in format of column=value, column=value - Укажите данные для добавления в формате столбец=значение, столбец=значение + core admin_hooks - desc_definition - Specify the field definition (e.g. varchar(255)) - Введите тип поля (например varchar(255)) + desc_revert + + core admin_hooks desc_newvalue Specify the new value - Укажите новое значение + core admin_hooks desc_oldvalue Specify the old value (useful to revert data during uninstall) - Укажите старое значение (удобно для восстановления состояния системы при удалении мода) - - core - admin_hooks - desc_defaultvalue - Specify the default value - Укажите значение по умолчанию - - core - admin_hooks - desc_changefield - (Only if this is a change alter) specify the new field name - (В случае если происходит изменение) укажите новое имя поля - - core - admin_hooks - desc_field - Specify the field name - Введите название поля - - core - admin_hooks - desc_altertype - Specify the type of alter statement - Введите тип изменяющего выражения - - core - admin_hooks - hook_enable_all_none - There were no disabled hooks to enable - Нет отключенных хуков для включения - - core - admin_hooks - desc_tabletype - Specify the table type (e.g. myisam or innodb) - Введите тип новой таблицы (напр-р, myisam, innodb) - - core - admin_hooks - desc_fieldnames - Specify the fields and indexes to add to the table, just as they appear in a SQL create table statement - Укажите какие поля и индексы необходимо добавить в таблицу, чтобы они появились в ее структуре - - core - admin_hooks - desc_existtable - Specify the table name (no prefix) - Введите название таблицы (без префикса) - - core - admin_hooks - desc_newtable - Specify the new table name (no prefix) - Введите название новой таблицы (без префикса) - - core - admin_hooks - hook_reenable_all - Reenabled all hooks - Включить все хуки - - core - admin_hooks - hook_disable_all_none - There were no enabled hooks to disable - Нет активных хуков для отключения - - core - admin_hooks - hook_disabled_all - Disabled all hooks - Отключены все хуки - - core - admin_hooks - hook_disabled - The hook has been disabled - Хук отключен - - core - admin_hooks - hook_public_module - (PUBLIC) - (ПОЛЬЗ) - - core - admin_hooks - hook_admin_module - (ADMIN) - (АДМИН) - - core - admin_hooks - hook_db_drop - Remove a Column - Удалить столбец - - core - admin_hooks - hook_no_db - There are no database changes being exported - Нет изменений в базе данных - - core - admin_hooks - hook_no_custom - There is no custom install/uninstall script configured - Нет специального скрипта установки/удаления - - core - admin_hooks - hook_db_change - Change a Column - Изменить столбец - - core - admin_hooks - hook_db_addnew - Add New Column - Добавить столбец - - core - admin_hooks - hook_db_insert - Insert Data - Вставить данные - - core - admin_hooks - hook_db_update - Update Data - Обновить данные - - core - admin_hooks - hook_db_alter - Alter Table - Изменить таблицу - - core - admin_hooks - hook_db_create - Create Table - Создать таблицу - - core - admin_hooks - hook_db_select - Select One - Выберите - - core - admin_hooks - hook_no_css - There are no CSS files being exported - Нет CSS файлов для экспорта - - core - admin_hooks - hook_no_tasks - There are no tasks being exported - Нет новых задач - - core - admin_hooks - hook_modules - Modules: - Модули: - - core - admin_hooks - hook_no_replacements - There are no skin replacements being exported - Нет замен в стилях для экспорта - - core - admin_hooks - hook_replacements - Skin Replacements: - Замены в стилях: - - core - admin_hooks - hook_no_skin - There are no skin templates being exported - Нет новых шаблонов стилей - - core - admin_hooks - hook_css - CSS Files: - CSS файлы: - - core - admin_hooks - hook_tasks - Tasks: - Задачи: - - core - admin_hooks - hook_no_modules - There are no modules being exported - Нет новых модулей - - core - admin_hooks - hook_help - Help Files: - Помощь: - - core - admin_hooks - hook_no_help - There are no help files being exported - Нет новых разделов помощи - - core - admin_hooks - hook_no_language - There are no language strings being exported - Нет новых языковых конструкций - - core - admin_hooks - hook_from - From - От - - core - admin_hooks - hook_setting_groups - Setting groups: - Группа настроек: - - core - admin_hooks - hook_no_settings - There are no settings being exported - Нет новых настроек - - core - admin_hooks - hook_settings - Settings: - Настройки: - - core - admin_hooks - hook_cannot_load - The hook could not be loaded - Хук не может быть загружен - - core - admin_hooks - addanotherchange - Add Another Change - Добавить другие изменения - - core - admin_hooks - nomodifyset - Now modify the settings - Сейчас измените настройки - - core - admin_hooks - adddbchanges - Add Database Changes - Добавить изменение базы - - core - admin_hooks - selectone - Select One - Выберите один - - core - admin_hooks - addanothertemplate - Add Another Template - Добавить другой шаблон - - core - admin_hooks - addtemplates - Add Templates - Добавить шаблоны - - core - admin_hooks - addanotherfile - Add Another File - Добавить другой файл - - core - admin_hooks - nowselectbits - Now select template bits to add - Сейчас выберите шаблоны для добавления - - core - admin_hooks - hookssavebutton - Save - Сохранить - - core - admin_hooks - nowselectstrings - Now select strings to add - Сейчас выберите строки для добавления - - core - admin_hooks - addlanguage - Add Language - Добавить язык - - core - admin_hooks - oneormtasks - Select one or more tasks to export (do not forget to include the task PHP file for the user to upload) - Выберите одну или несколько задач для экспорта (не забудьте включить задачу в PHP файл для загрузки пользователем) - - core - admin_hooks - addtasks - Add Tasks - Добавить задачи - - core - admin_hooks - indivsettingsex - Select one or more individual settings to export (any necessary group data will be included). If you need to export all settings in a group, use the previous option instead. - Выберете одну или несколько индивидуальных настроек для экспорта (все необходимые данные группы будут включены). Если необходимо экспортировать все настройки группы используйте предыдущую опцию. - - core - admin_hooks - addhelpfiles - Add Help Files - Добавить файлы помощи - - core - admin_hooks - selectoneormorehelp - Select one or more help files to export - Выберите один или несколько файлов помощи для экспорта - - core - admin_hooks - pathcustomscript - - - - core - admin_hooks - addmodules - Add Modules - Добавить модуль - - core - admin_hooks - exportmodules - Select one or more modules to export - Выберите один или несколько модулей для экспорта - - core - admin_hooks - addcustomscript - Add Custom Script - Добавить пользовательский скрипт - - core - admin_hooks - selectafile - Select a File - Выберите файл - - core - admin_hooks - addcss - Add CSS - Добавить CSS - - core - admin_hooks - addsettings - Add Settings - Добавить настройки - - core - admin_hooks - exportonesettings - Select one or more setting groups to export (all settings in the group will be exported) - Выберите одну или несколько настроек групп для экспорта (все настройки группы будут экспортированы) - - core - admin_hooks - selectoneomorecss - Select one or more css files to export - Выберите один или несколько css файлов для экспорта - - core - admin_hooks - addreplacements - Add Skin Replacements - Добавить замены в стилях + core admin_hooks desc_where Specify an optional where clause if needed - Укажите значение выражения WHERE если это необходимо + + + core + admin_hooks + desc_defaultvalue + Specify the default value + + + core + admin_hooks + desc_changefield + (Only if this is a change alter) specify the new field name + + + core + admin_hooks + desc_definition + Specify the field definition (e.g. varchar(255)) + + + core + admin_hooks + desc_altertype + Specify the type of alter statement + + + core + admin_hooks + desc_field + Specify the field name + + + core + admin_hooks + desc_tabletype + Specify the table type (e.g. myisam or innodb) + + + core + admin_hooks + desc_fieldnames + Specify the fields and indexes to add to the table, just as they appear in a SQL create table statement + + + core + admin_hooks + desc_newtable + Specify the new table name (no prefix) + + + core + admin_hooks + desc_existtable + Specify the table name (no prefix) + + + core + admin_hooks + hook_reenable_all + Reenabled all hooks + + + core + admin_hooks + hook_disable_all_none + There were no enabled hooks to disable + + + core + admin_hooks + hook_enable_all_none + There were no disabled hooks to enable + + + core + admin_hooks + hook_disabled_all + Disabled all hooks + + + core + admin_hooks + hook_disabled + The hook has been disabled + + + core + admin_hooks + hook_admin_module + (ADMIN) + + + core + admin_hooks + hook_public_module + (PUBLIC) + + + core + admin_hooks + hook_no_db + There are no database changes being exported + + + core + admin_hooks + hook_no_custom + There is no custom install/uninstall script configured + + + core + admin_hooks + hook_db_drop + Remove a Column + + + core + admin_hooks + hook_db_change + Change a Column + + + core + admin_hooks + hook_db_addnew + Add New Column + + + core + admin_hooks + hook_db_insert + Insert Data + + + core + admin_hooks + hook_db_update + Update Data + + + core + admin_hooks + hook_db_create + Create Table + + + core + admin_hooks + hook_db_alter + Alter Table + + + core + admin_hooks + hook_no_css + There are no CSS files being exported + + + core + admin_hooks + hook_db_select + Select One + + + core + admin_hooks + hook_tasks + Tasks: + + + core + admin_hooks + hook_css + CSS Files: + + + core + admin_hooks + hook_replacements + Skin Replacements: + + + core + admin_hooks + hook_no_replacements + There are no skin replacements being exported + + + core + admin_hooks + hook_no_tasks + There are no tasks being exported + + + core + admin_hooks + hook_no_skin + There are no skin templates being exported + + + core + admin_hooks + hook_no_help + There are no help files being exported + + + core + admin_hooks + hook_help + Help Files: + + + core + admin_hooks + hook_modules + Modules: + + + core + admin_hooks + hook_no_modules + There are no modules being exported + + + core + admin_hooks + hook_no_settings + There are no settings being exported + + + core + admin_hooks + hook_from + From + + + core + admin_hooks + hook_no_language + There are no language strings being exported + + + core + admin_hooks + hook_settings + Settings: + + + core + admin_hooks + hook_setting_groups + Setting groups: + + + core + admin_hooks + adddbchanges + Add Database Changes + + + core + admin_hooks + nomodifyset + Now modify the settings + + + core + admin_hooks + addanotherchange + Add Another Change + + + core + admin_hooks + hook_cannot_load + The hook could not be loaded + + + core + admin_hooks + selectone + Select One + + + core + admin_hooks + addanothertemplate + Add Another Template + + + core + admin_hooks + addtemplates + Add Templates + + + core + admin_hooks + nowselectbits + Now select template bits to add + + + core + admin_hooks + addhelpfiles + Add Help Files + + + core + admin_hooks + selectoneormorehelp + Select one or more help files to export + + + core + admin_hooks + addtasks + Add Tasks + + + core + admin_hooks + oneormtasks + Select one or more tasks to export (do not forget to include the task PHP file for the user to upload) + + + core + admin_hooks + nowselectstrings + Now select strings to add + + + core + admin_hooks + addlanguage + Add Language + + + core + admin_hooks + hookssavebutton + Save + + + core + admin_hooks + addreplacements + Add Skin Replacements + + + core + admin_hooks + selectafile + Select a File + + + core + admin_hooks + addcss + Add CSS + + + core + admin_hooks + addanotherfile + Add Another File + + + core + admin_hooks + addcustomscript + Add Custom Script + + + core + admin_hooks + pathcustomscript + + + + core + admin_hooks + addmodules + Add Modules + + + core + admin_hooks + exportmodules + Select one or more modules to export + + + core + admin_hooks + addsettings + Add Settings + + + core + admin_hooks + indivsettingsex + Select one or more individual settings to export (any necessary group data will be included). If you need to export all settings in a group, use the previous option instead. + + + core + admin_hooks + exportonesettings + Select one or more setting groups to export (all settings in the group will be exported) + + + core + admin_hooks + selectoneomorecss + Select one or more css files to export + core admin_js group_title Member Group Title: 1 - Название Группы: - - core - admin_js - is_supmod - Members in this group are super moderators. - 1 - Пользователи из этой группы супермодераторы. - - core - admin_js - no_ban_to_delete - You did not select any ban filters to delete. - 1 - Вы не выбрали ни одного правла бан-фильтра для удаления. - - core - admin_js - unlimited_text - Unlimited - 1 - Неограничено - - core - admin_js - can_access_cp - Members in this group can access the Admin Control Panel - 1 - Пользователи из этой группы имеют доступ в АдминЦентр + core admin_js security_check Security Check 1 - Проверка безопасности + core admin_js - editor_enter_list - Enter list item (or hit Cancel to finish list) + unlimited_text + Unlimited 1 - Введите объект списка (или нажмите Отмена для завершения списка) + core admin_js - ua_exists - User Agent Exists + is_supmod + Members in this group are super moderators. 1 - Такой User Agent уже существует + + + core + admin_js + can_access_cp + Members in this group can access the Admin Control Panel + 1 + + + core + admin_js + no_ban_to_delete + You did not select any ban filters to delete. + 1 + core admin_js forums_hidemod Hide Moderator Options 1 - Скрыть модераторские опции + + + core + admin_js + editor_enter_list + Enter list item (or hit Cancel to finish list) + 1 + core admin_js forums_showmod Show Moderator Options 1 - Показать модераторские опции - - core - admin_js - ua_error_save2 - An error occurred while saving this user agent: - 1 - Произошла ошибка при сохранении User Agent: - - core - admin_js - ua_add_string - Add User Agent - 1 - Добавить User Agent + core admin_js ua_edit_string Edit User Agent 1 - Изменить User Agent - - core - admin_js - ua_error_remove - There was an error deleting this user agent - 1 - Произошла ошибка при удалении User Agent - - core - admin_js - ua_form_incomplete - You must complete: User Agent Name, User Agent Key and Regex - 1 - Необходимо заполнить: Навзание User Agent, Ключ и Регулярное выражение + core admin_js ua_error_save An error occurred while saving this user agent 1 - Произошла ошибка при сохранении User Agent + + + core + admin_js + ua_exists + User Agent Exists + 1 + + + core + admin_js + ua_form_incomplete + You must complete: User Agent Name, User Agent Key and Regex + 1 + + + core + admin_js + ua_add_string + Add User Agent + 1 + core admin_js ua_error_remove2 There was an error deleting this user agent: 1 - Произошла ошибка при удалении User Agent: - - core - admin_js - mustfixfirst - You cannot save this item until you have remove all conflicts - 1 - Вы не можете удалить, пока не разрешите все конфликты + core admin_js sk_error Error: 1 - Ошибка: + core admin_js ua_perm_remove Are you sure you want to permanently remove this User Agent? 1 - Вы действительно хотите удалить этот User Agent? + core admin_js - merge_edititem - Edit Item + ua_error_remove + There was an error deleting this user agent 1 - Изменить + core admin_js - resolveall_button - Resolve All: Custom Wins + mustfixfirst + You cannot save this item until you have remove all conflicts 1 - Разрешить все в пользу пользовательских изменений - - core - admin_js - oops - Ooops. Something went wrong. Does this help?: - 1 - Возникла ошибка: + core admin_js save_button Save 1 - Сохранить + + + core + admin_js + oops + Ooops. Something went wrong. Does this help?: + 1 + core admin_js resolveall_newwin Resolve All: New Wins 1 - Разрешить все в пользу новых изменений + + + core + admin_js + resolveall_button + Resolve All: Custom Wins + 1 + + + core + admin_js + merge_edititem + Edit Item + 1 + core admin_js comparediff_merg Merge Preview 1 - Предпросмотр объединения + core admin_js comparediff_diff Difference 1 - Различия - - core - admin_js - comparediff_cust - Customized - 1 - Измененные - - core - admin_js - comparediff_oldd - Old default - 1 - Старые по умолчанию + core admin_js comparediff_newd New default 1 - Новые по умолчанию + core admin_js - missingurlforsave - Cannot save form; url missing + comparediff_cust + Customized 1 - Не возможно сохранить форму; отсутсвует URL + core admin_js - delete_template_bit - Are you sure you want to delete this template bit from this set and all child sets? THIS CANNOT BE UNDONE. + comparediff_oldd + Old default 1 - Вы действительно хотите удалить этот шаблон из стиля и всех его наследников? ДЕЙСТВИЕ НЕ МОЖЕТ БЫТЬ ОТМЕНЕНО. - - core - admin_js - delete_css_file - Are you sure that you want to delete this CSS file from this set and all child sets? - 1 - Вы действительно хотите удалить этот CSS файл из этого стиля и всех его наследников? - - core - admin_js - revert_template_bit - Are you sure you want to remove ALL customizations to this bit in this set? THIS CANNOT BE UNDONE. - 1 - Вы действительно хотите отменить все изменения в шаблонах для этого стиля? ОПЕРАЦИЯ НЕ МОЖЕТ БЫТЬ ОТМЕНЕНА - - core - admin_js - revert_css_file - Are you sure you want to remove ALL customizations to this CSS file in this set? THIS CANNOT BE UNDONE. - 1 - Вы действительно хотите отменить все изменения в CSS для этого стиля? ОПЕРАЦИЯ НЕ МОЖЕТ БЫТЬ ОТМЕНЕНА - - core - admin_js - revert_mesg - Reverting... - 1 - Отмена... - - core - admin_js - tpl_savingproperties - Saving properties... - 1 - Сохранение настроек... - - core - admin_js - tpl_savingvars - Saving variables... - 1 - Сохранение переменных... - - core - admin_js - tpl_savegeneric - Saving... - 1 - Сохранение... - - core - admin_js - templates_servererror - The server returned an error: - 1 - Сервер сообщил об ошибке: + core admin_js cannot_compare_css You do not have permission to compare CSS files. 1 - Вы не можете сравнивать CSS файлы. + core admin_js cannot_compare_templates You do not have permission to compare templates. 1 - Вы не можете сравнивать шаблоны. - - core - admin_js - unsaved_css_warn - This css file has unsaved changes! Are you sure you want to close it? - 1 - CSS файл имеет не сохраненные изменения! Вы действительно хотите закрыть его? + core admin_js unsaved_template_war This template bit has unsaved changes! Are you sure you want to close it? 1 - Шаблон имеет не сохраненные изменения! Вы действительно хотите закрыть его? + + + core + admin_js + unsaved_css_warn + This css file has unsaved changes! Are you sure you want to close it? + 1 + + + core + admin_js + tpl_savegeneric + Saving... + 1 + + + core + admin_js + tpl_savingproperties + Saving properties... + 1 + + + core + admin_js + tpl_savingvars + Saving variables... + 1 + + + core + admin_js + revert_template_bit + Are you sure you want to remove ALL customizations to this bit in this set? THIS CANNOT BE UNDONE. + 1 + + + core + admin_js + revert_mesg + Reverting... + 1 + + + core + admin_js + missingurlforsave + Cannot save form; url missing + 1 + + + core + admin_js + delete_template_bit + Are you sure you want to delete this template bit from this set and all child sets? THIS CANNOT BE UNDONE. + 1 + + + core + admin_js + delete_css_file + Are you sure that you want to delete this CSS file from this set and all child sets? + 1 + + + core + admin_js + templates_servererror + The server returned an error: + 1 + + + core + admin_js + revert_css_file + Are you sure you want to remove ALL customizations to this CSS file in this set? THIS CANNOT BE UNDONE. + 1 + core admin_js templates_error_add2 There was an error adding this template bit: 1 - Произошла ошибка при добавлении шаблона: + core admin_js templates_error_group An error occurred generating the template groups 1 - Произошла ошибка при создании групп шаблонов - - core - admin_js - templates_loading - Loading... - 1 - Загрузка... - - core - admin_js - templates_blankcss - The css name cannot be blank - 1 - Имя CSS не может быть пустым + core admin_js templates_noblank The template name cannot be blank 1 - Имя шаблона не может быть пустым + core admin_js templates_navigate 1 - Переход с данной страницы приведет к потере всех сделанных вами изменений. Продолжить? + + + core + admin_js + templates_loading + Loading... + 1 + + + core + admin_js + templates_blankcss + The css name cannot be blank + 1 + core admin_js templates_adding Adding... 1 - Добавление... + core admin_js templates_error_add There was an error adding this template bit 1 - Произошла ошибка при добавлении шаблона - - core - admin_js - page_multijump - Please enter a page number to jump to between 1 and - 1 - Введите номер страницы для перехода к ней + core admin_js removeuseragent Remove user agent? This will be removed permanently 1 - Удалить user agent? + core admin_js - bit_skin_gallery_user - (Gallery) View User + page_multijump + Please enter a page number to jump to between 1 and 1 - (Галерея) Просмотр пользователя - - core - admin_js - bit_skin_ipchat - (Chat) Global - 1 - (Чат) Глобальные - - core - admin_js - bit_skin_nexus_clients - (Nexus) Clients - 1 - (Нексус) Клиенты - - core - admin_js - bit_skin_nexus_emails - (Nexus) Emails - 1 - (Nexus) Email - - core - admin_js - bit_skin_nexus_payments - (Nexus) Payments - 1 - (Нексус) Платежи - - core - admin_js - bit_skin_nexus_support - (Nexus) Support - 1 - (Нексус) Поддержка + core admin_js generic_ajax_error There was an error processing this action. 1 - Произошла ошибка при выполнении действия. + core admin_js ok_to_delete PLEASE CONFIRM: Proceed with delete? 1 - Нажмите ОК, для подтверждения удаления. + + + core + admin_js + bit_skin_nexus_support + (Nexus) Support + 1 + + + core + admin_js + bit_skin_nexus_payments + (Nexus) Payments + 1 + + + core + admin_js + bit_skin_nexus_emails + (Nexus) Emails + 1 + + + core + admin_js + bit_skin_nexus_clients + (Nexus) Clients + 1 + + + core + admin_js + bit_skin_ipchat + (Chat) Global + 1 + + + core + admin_js + bit_skin_gallery_user + (Gallery) View User + 1 + core admin_js bit_skin_gallery_post (Gallery) Post Image 1 - (Галерея) Добавление изображения + core admin_js bit_skin_gallery_img (Gallery) Show Image 1 - (Галерея) Просмотр изображения + core admin_js bit_skin_gallery_imagelisting (Gallery) Image Listing 1 - (Галерея) Список изображений + core admin_js bit_skin_gallery_home (Gallery) Homepage 1 - (Галерея) Главная + core admin_js bit_skin_gallery_external (Gallery) Other Templates 1 - (Галерея) Прочие Шаблоны + core admin_js bit_skin_gallery_global (Gallery) Global 1 - (Галерея) Общие + core admin_js bit_skin_gallery_albums (Gallery) Albums 1 - (Галерея) Альбомы + core admin_js bit_skin_ccs_global (Content) Global Templates 1 - (Контент) Глобальные шаблоны - - core - admin_js - bit_skin_downloads_other - (Downloads) Other Templates - 1 - (Файлы) Прочие шаблоны + core admin_js bit_skin_downloads_submit (Downloads) Submit Download 1 - (Файлы) Загрузка файла - - core - admin_js - bit_skin_downloads_external - (Downloads) External Downloads - 1 - (Файлы) Внешние файлы - - core - admin_js - bit_skin_downloads - (Downloads) Download Manager - 1 - (Файлы) Файловый архив + core admin_js bit_skin_blog_trackback (Blog) Trackbacks 1 - (Блог) Трекбеки + + + core + admin_js + bit_skin_downloads + (Downloads) Download Manager + 1 + + + core + admin_js + bit_skin_downloads_other + (Downloads) Other Templates + 1 + + + core + admin_js + bit_skin_downloads_external + (Downloads) External Downloads + 1 + core admin_js bit_skin_blog_show (Blog) Blog View 1 - (Блог) Просмотр блога + core admin_js bit_skin_blog_post (Blog) Post Screen 1 - (Блог) Экран сообщения - - core - admin_js - bit_skin_blog_manage - (Blog) Manage - 1 - (Блог) Управление + core admin_js bit_skin_blog_portal (Blog) Portal Plugin 1 - (Блог) Дополнение портала + + + core + admin_js + bit_skin_blog_manage + (Blog) Manage + 1 + core admin_js bit_skin_blog_list (Blog) Listing 1 - (Блог) Список + core admin_js bit_skin_blog_hooks (Blog) Hooks 1 - (Блог) Хуки + core admin_js bit_skin_blog_global (Blog) Global 1 - (Блог) Общие + core admin_js bit_skin_blog_cblocks (Blog) Content Blocks 1 - (Блог) Дополнительные блоки - - core - admin_js - bit_skin_ucp - User Control Panel - 1 - Панель пользователя + core admin_js bit_skin_blog_actions (Blog) Actions 1 - (Блог) Действия + + + core + admin_js + bit_skin_ucp + User Control Panel + 1 + core admin_js bit_skin_topic Topic View 1 - Темы - - core - admin_js - bit_skin_stats - Statistics - 1 - Статистика + core admin_js bit_skin_subscriptions Subscription Manager 1 - Менеджер подписок + + + core + admin_js + ua_error_save2 + An error occurred while saving this user agent: + 1 + core admin_js bit_skin_search Search 1 - Поиск + core admin_js - bit_skin_profile - Profiles + bit_skin_stats + Statistics 1 - Профили пользователей + core admin_js bit_skin_reports Report Center 1 - Система жалоб + core admin_js bit_skin_register Registration Screen 1 - Регистрация + + + core + admin_js + bit_skin_profile + Profiles + 1 + core admin_js bit_skin_post Post Screen 1 - Страница отправки тем/сообщений + core admin_js bit_skin_portal Portal 1 - Портал + core admin_js bit_skin_poll Polls 1 - Опросы + core admin_js bit_skin_online Online List 1 - Кто в онлайн + core admin_js bit_skin_modcp Moderator CP 1 - Панель Модератора + core admin_js bit_skin_mod Moderation 1 - Система модерации + core admin_js bit_skin_mlist Member List 1 - Список пользователей + core admin_js bit_skin_messaging Messenger 1 - Личные сообщения - - core - admin_js - bit_skin_login - Login Screen - 1 - Страница входа - - core - admin_js - bit_skin_legends - Legends - 1 - Попапы BBкодов и смайликов - - core - admin_js - bit_skin_help - Help - 1 - Помощь + core admin_js bit_skin_global_comments Global Comments Templates 1 - Шаблоны комментариев + + + core + admin_js + bit_skin_help + Help + 1 + + + core + admin_js + bit_skin_legends + Legends + 1 + + + core + admin_js + bit_skin_login + Login Screen + 1 + core admin_js bit_skin_global_other Other Global Templates 1 - Прочие + core admin_js bit_skin_global Global Templates 1 - Глобальные + core admin_js bit_skin_forum Forum View 1 - Список тем форума - - core - admin_js - bit_skin_emails - Emails - 1 - Система e-mail + core admin_js bit_skin_boards Board Index 1 - Список форумов + + + core + admin_js + bit_skin_emails + Emails + 1 + core admin_js bit_skin_editors Editor 1 - Редактор сообщений - - core - admin_js - bit_skin_calendar - Calendar - 1 - Календарь - - core - admin_js - session_timed_out - Your Admin CP session has expired, please refresh the page and log back in - 1 - Ваша сессия истекла, пожалуйста обновите страницу и выполните вход повторно - - core - admin_js - group_settings_match - There are per-group settings that match your search]]> - 1 - Найдены настройки групп, удовлетворяющие критерию]]> + core admin_js livesearchnoresults No results 1 - Нет результатов + + + core + admin_js + group_settings_match + There are per-group settings that match your search]]> + 1 + + + core + admin_js + session_timed_out + Your Admin CP session has expired, please refresh the page and log back in + 1 + + + core + admin_js + bit_skin_calendar + Calendar + 1 + core admin_js adduagenttitle Adding User Agent 1 - Добавление User Agent - - core - admin_js - useragent_saved - The user agent has been saved - 1 - User Agent сохранен - - core - admin_js - useragent_removed - The user agent has been removed - 1 - User Agent удален - - core - admin_js - a_postendif - After the end of the if statement - 1 - после завершения выражения if + core admin_js confirm_delete_single_mem Are you sure you want to delete this member? 1 - Вы действительно хотите удалить этого пользователя? - - core - admin_js - members_validation_resent - Validation emails re-sent - 1 - Пересылка письма об активации + core admin_js confirm_delete_multiple_mem Are you sure you want to delete these members? 1 - Вы действительно хотите удалить этих пользователей? + + + core + admin_js + members_validation_resent + Validation emails re-sent + 1 + + + core + admin_js + useragent_removed + The user agent has been removed + 1 + + + core + admin_js + useragent_saved + The user agent has been saved + 1 + + + core + admin_js + a_postendif + After the end of the if statement + 1 + core admin_js a_preendif Before the end of the if statement 1 - перед завершением выражения if - - core - admin_js - a_postelse - After the start of the else statement - 1 - после начала выражения else - - core - admin_js - a_preelse - Before the start of the else statement - 1 - до начала выражения else - - core - admin_js - a_poststartif - After the start of the if statement - 1 - после начала выражения if - - core - admin_js - a_prestartif - Before the start of the if statement - 1 - до начала выражения if - - core - admin_js - a_innerpre - After the start of the foreach statement - 1 - после начала выражения foreach - - core - admin_js - a_innerpost - Before the end of the foreach statement - 1 - перед завершением выражения foreach + core admin_js a_outerpost After the end of the foreach statement 1 - после завершения выражения foreach + core admin_js - skin_revert_none - + a_poststartif + After the start of the if statement 1 - Вы ничего не выбрали для отмены всех изменений + core admin_js - a_outerpre - Before the start of the foreach statement + a_preelse + Before the start of the else statement 1 - перед началом выражения foreach + + + core + admin_js + a_innerpre + After the start of the foreach statement + 1 + + + core + admin_js + a_innerpost + Before the end of the foreach statement + 1 + + + core + admin_js + a_prestartif + Before the start of the if statement + 1 + + + core + admin_js + a_postelse + After the start of the else statement + 1 + core admin_js go_bookmark_warn Ok to navigate away from this page? 1 - Нажмите ОК чтобы уйти с этой страницы + core admin_js manage_bookmark Manage 1 - Настроить + + + core + admin_js + skin_revert_none + + 1 + + + core + admin_js + a_outerpre + Before the start of the foreach statement + 1 + core admin_js close_bookmark Close 1 - Закрыть - - core - admin_js - already_bookmark - You have already bookmarked this page - 1 - Вы уже добавили эту страницу в закладки + core admin_js add_bookmark Add bookmark 1 - Добавить + core admin_js cannot_bookmark Sorry, this page is not suitable for bookmarking 1 - Извините, эту страницу нельзя добавить в закладки + + + core + admin_js + already_bookmark + You have already bookmarked this page + 1 + core admin_js forum_not_root_and_standard You cannot have a standard forum as a Root forum parent. Please either selected the forum type as category or select a parent for this forum. 1 - Стандартный форум не может быть родительским для корневых форумов. Установите тип форума как категорию или выберите родительский форум/категорию для данного форума. + core admin_js date_pm PM 1 - ПП + core admin_js date_am AM 1 - ДП + core admin_login enter_username Username - Логин + core admin_login ipb_login IP.Board: Log in - Invision Power Board: Вход + core admin_login enter_name_and_email Username / Email - Логин или Email + core admin_login enter_useremail Email Address - Email + core admin_login logout_complete Log out complete - Вы вышли + core admin_login no_acp_access You do not have permission to access the ACP - У вас не достаточно прав для доступа в админцентр + core admin_login bad_email_password Your login credentials were not valid - Неверные данные для входа + core admin_logs mobilog_noresults No mobile notification log entries - Нет записей в журнале - - core - admin_logs - mlog_list_sent - Sent - Введенные данные неверны - - core - admin_logs - mlog_list_notification - Notification - Уведомление + core admin_logs mlog_list_member Sent To - Отправлено - - core - admin_logs - mlog_list_date - Date - Время + core admin_logs mlog_list_id ID - ID + + + core + admin_logs + mlog_list_date + Date + + + core + admin_logs + mlog_list_notification + Notification + + + core + admin_logs + mlog_list_sent + Sent + core admin_logs mlog_mobilelogs Mobile Notifications Log - Журнал уведомлений мобильных клиентов + core admin_logs slog_api_failed Test Spam API Connection Failed - Проверка соединения с Antispam неудачна - - core - admin_logs - slog_api_connected - Test Spam API Connection Successfull! - Проверка соединения с Antispam успешна - - core - admin_logs - slog_response_4 - Known spammer - Известный спамер - - core - admin_logs - slog_response_0 - Service Error - Ошибка сервиса - - core - admin_logs - slog_response_1 - Probably not spam - Не спамер - - core - admin_logs - slog_response_2 - Possibly spam - Вероятно спамер + core admin_logs slog_response_3 Likely spam - Возможно спамер + + + core + admin_logs + slog_response_4 + Known spammer + + + core + admin_logs + slog_api_connected + Test Spam API Connection Successfull! + + + core + admin_logs + slog_response_2 + Possibly spam + + + core + admin_logs + slog_response_1 + Probably not spam + + + core + admin_logs + slog_response_0 + Service Error + core admin_logs sslog_noresults No spam log entries - Записей не найдено + core admin_logs slog_list_ip IP Address - IP адрес - - core - admin_logs - slog_list_email - E-Mail Address - E-mail адрес - - core - admin_logs - slog_list_msg - Error Message - Ошибка - - core - admin_logs - slog_list_id - ID - ID + core admin_logs slog_list_code Response - Ответ + + + core + admin_logs + slog_list_msg + Error Message + + + core + admin_logs + slog_list_email + E-Mail Address + core admin_logs slog_list_date Date - Дата + core admin_logs - al_error_logs - Admin Login Logs - Журнал авторизации администраторов + slog_list_id + ID + core admin_logs slog_spamlogs Spam Service Logs - Журнал спам-сервиса + core admin_logs sched_error_logs Scheduler Logs - Журнал задач + + + core + admin_logs + al_error_logs + Admin Login Logs + core admin_logs api_error_logs XML-RPC API Logs - Журнал XML-RPC API + core admin_logs alog_adminlogs Admin Logs - Журнал администраторов - - core - admin_logs - alog_searchbutton - Search - Найти - - core - admin_logs - alog_searchin - Search in... - Искать в + core admin_logs alog_searchfor Search for... - Искать + + + core + admin_logs + alog_searchin + Search in... + + + core + admin_logs + alog_searchbutton + Search + core admin_logs alog_search Search Admin Logs - Поиск действий в журнале + core admin_logs alog_saved Saved Administration Logs - Журнал администрирования - - core - admin_logs - alog_viewall - View All By Member - Просмотр всех действий + core admin_logs alog_removeall Remove All By Member - Удаление всех действий + + + core + admin_logs + alog_viewall + View All By Member + core admin_logs alog_remove Remove - Удалить + core admin_logs alog_view View - Просмотреть + core admin_logs alog_noresults No Results - Нет результатов + core admin_logs alog_date Date - Дата + core admin_logs alog_member Member - Пользователь + core admin_logs alog_last5 Last 5 Admin Actions - Последние 5 действий + core admin_logs alog_do do= {URL parameter} - do= {URL параметр} + core admin_logs alog_sec Section - Раздел - - core - admin_logs - alog_mod - Module - Модуль + core admin_logs alog_app Application - Приложение + core admin_logs - alog_id - Member ID - ID администратора + alog_mod + Module + core admin_logs alog_ip IP Address - IP адрес + + + core + admin_logs + alog_id + Member ID + core admin_logs alog_performed Action(s) Performed - Действия + core admin_logs alog_whoselog We could not determine whose logs you were attempting to remove. Please try again. - Невозможно определить, чью запись в журнале вы пытаетесь удалить. Попробуйте еще раз. - - core - admin_logs - alog_whatfield - We could not determine what field you were attempting to search. - Невозможно определить поле для поиска. + core admin_logs erlog_smtperror SMTP Error Message: - SMTP сообщение ошибки: + core admin_logs alog_title Administration Logs Manager - Управление журналом действий администраторов + + + core + admin_logs + alog_whatfield + We could not determine what field you were attempting to search. + core admin_logs alog_nostring You must enter a search string. Please try again. - Вы должны ввести строку поиска. Попробуйте еще раз. + core admin_logs erlog_smtpcode SMTP Error Code: - SMTP код ошибки: - - core - admin_logs - erlog_log_sent - Sent:]]> - Дата: ]]> - - core - admin_logs - erlog_log_subject - Subject]]> - Тема]]> + core admin_logs erlog_ipberror IP.Board Error Message: - IP.Board сообщение ошибки: + core admin_logs - erlog_search - Search Email Error Logs - Поиск записей + erlog_log_subject + Subject]]> + core admin_logs erlog_log_to To:]]> - Кому: ]]> - - core - admin_logs - erlog_log_from - From:]]> - От:]]> + core admin_logs erlog_searchbutton Search - Найти + + + core + admin_logs + erlog_log_from + From:]]> + + + core + admin_logs + erlog_log_sent + Sent:]]> + core admin_logs erlog_searchwhere Search where...]]> - Поиск в ]]> + core admin_logs - erlog_reademail - Read Email - Читать письмо - - core - admin_logs - erlog_noresults - No Email Error Logs Found]]> - Ошибки не найдены ]]> - - core - admin_logs - erlog_removeall - Remove All? - Удалить все? + erlog_search + Search Email Error Logs + core admin_logs erlog_removechecked Remove Checked - Удалить отмеченные + + + core + admin_logs + erlog_removeall + Remove All? + + + core + admin_logs + erlog_noresults + No Email Error Logs Found]]> + + + core + admin_logs + erlog_reademail + Read Email + core admin_logs erlog_date Date - Дата + core admin_logs erlog_to To - Кому + core admin_logs erlog_thelogs Logged Email Errors - Список неотправленных писем - - core - admin_logs - erlog_toemail - To Email Address - Кому (E-mail) - - core - admin_logs - erlog_error - Error Message - Ошибка - - core - admin_logs - erlog_exact - is exactly - точно + core admin_logs erlog_loose contains - содержит + core admin_logs - erlog_fromemail - From Email Address - От (E-mail) + erlog_exact + is exactly + core admin_logs - elog_email_err_logs - Email Error Logs - Журнал ошибок e-mail + erlog_error + Error Message + core admin_logs - erlog_noneselected - You did not select any email error log entries to remove. Please try again. - Вы не выбрали записи в журнале для удаления. Попробуйте еще раз. + erlog_toemail + To Email Address + core admin_logs erlog_subject Email Subject - Тема письма + + + core + admin_logs + erlog_fromemail + From Email Address + core admin_logs erlog_noinfo No Info]]> - Нет информации ]]> - - core - admin_logs - erlog_404 - We could not find the email error log entry you requested. Please try again. - Невозможно найти записи в журнале. Попробуйте еще раз. - - core - admin_logs - erlog_results - (Search Results) - (Результаты поиска) + core admin_logs erlog_enter_sumthang_yo You must enter something to search by. Please try again. - Вы должны ввести что-либо для поиска. Попробуйте еще раз. - + + + core + admin_logs + erlog_404 + We could not find the email error log entry you requested. Please try again. + core admin_logs erlog_title Email Error Log Manager - Управление журналом ошибок e-mail сообщений + + + core + admin_logs + erlog_results + (Search Results) + + + core + admin_logs + elog_email_err_logs + Email Error Logs + core admin_logs erlog_removed Removed email error log entries. - Записи в журнале удалены + core admin_logs - mlog_searchbutton - Search - Искать + erlog_noneselected + You did not select any email error log entries to remove. Please try again. + core admin_logs mlog_modlogs Moderator Logs - Журнал модерирования + core admin_logs - mlog_searchin - Search in... - Искать в - - core - admin_logs - mlog_searchfor - Search for... - Искать - - core - admin_logs - mlog_search - Search Moderator Logs - Поиск действий в журнале + mlog_searchbutton + Search + core admin_logs mlog_remove Remove - Удалить + core admin_logs - mlog_view - View - Просмотреть + mlog_searchin + Search in... + + + core + admin_logs + mlog_searchfor + Search for... + + + core + admin_logs + mlog_search + Search Moderator Logs + core admin_logs mlog_viewall View All By Member - Просмотр всех действий + core admin_logs mlog_removeall Remove All By Member - Удаление всех действий + + + core + admin_logs + mlog_view + View + core admin_logs mlog_thelogs Saved Moderator Logs - Журнал модерирования - - core - admin_logs - mlog_date - Date - Дата + core admin_logs mlog_noresults No Moderator Logs Found]]> - Нет записей ]]> + + + core + admin_logs + mlog_date + Date + core admin_logs mlog_topictitle Topic Title - Тема - - core - admin_logs - mlog_forum - Forum - Форум + core admin_logs mlog_action Action Performed - Действия + + + core + admin_logs + mlog_forum + Forum + core admin_logs mlog_member Member - Модератор - - core - admin_logs - mlog_name - Member Name - Модератор - - core - admin_logs - mlog_tid - Topic ID - ID темы - - core - admin_logs - mlog_fid - Forum ID - ID форума + core admin_logs mlog_last5 Last 5 Moderator Actions - Последние 5 действий - - core - admin_logs - mlog_ip - IP Address - IP адрес + core admin_logs mlog_removed Removed Moderator Logs for member ID: - Удаленные действия модерирования для ID пользователя: + + + core + admin_logs + mlog_ip + IP Address + + + core + admin_logs + mlog_name + Member Name + + + core + admin_logs + mlog_tid + Topic ID + + + core + admin_logs + mlog_fid + Forum ID + core admin_logs mlog_topicid Topic ID: ]]> - ID темы: ]]> + core admin_logs mlog_noid You did not select a member ID to remove by. Please try again. - Вы не указали номер (ID) пользователя, которого хотите удалить. Пожалуйста, попробуйте еще раз. - - core - admin_logs - mlog_whatfield - We could not determine what field you were attempting to search. Please try again. - Невозможно определить поле для поиска. - - core - admin_logs - wlog_reason - Reason - Причина - - core - admin_logs - wlog_points - Points - Очков + core admin_logs mlog_title Moderator Logs Manager - Управление журналом модерирования + core admin_logs mlog_nostring You must enter a search string. Please try again. - Вы должны ввести строку поиска. + + + core + admin_logs + mlog_whatfield + We could not determine what field you were attempting to search. Please try again. + core admin_logs wlog_indef INDEF - INDEF + + + core + admin_logs + wlog_reason + Reason + + + core + admin_logs + wlog_points + Points + core admin_logs wlog_none None - Нет]]> - - core - admin_logs - wlog_warn_logs - Warn Logs - Журнал предупреждений + core admin_logs wlog_log_note_mods Note for moderators - Заметка для модераторов + + + core + admin_logs + wlog_warn_logs + Warn Logs + core admin_logs wlog_log_note_member Note for member - Заметка для пользователя - - core - admin_logs - wlog_log_sent - Date - Дата: ]]> - - core - admin_logs - wlog_warnnotes - Warn Notes - Заметка - - core - admin_logs - wlog_log_to - Member - Кому: ]]> + core admin_logs wlog_log_from Moderator - От: ]]> + + + core + admin_logs + wlog_log_sent + Date + + + core + admin_logs + wlog_log_to + Member + + + core + admin_logs + wlog_warnnotes + Warn Notes + core admin_logs wlog_viewnotes View Notes - Заметка + core admin_logs wlog_nopost Disabled Posting - Запрет отправки + core admin_logs wlog_susp Suspended - Блокировка + core admin_logs wlog_modq Mod Queue - Премодерация + core admin_logs wlog_searchbutton Search - Поиск - - core - admin_logs - wlog_removeall - Remove All By Member - Удаление записей + core admin_logs wlog_searchfor Search in... - Искать в - - core - admin_logs - wlog_searchin - Search for... - Искать - - core - admin_logs - wlog_search - Search Warn Logs - Поиск + core admin_logs wlog_remove Remove - Удалить + + + core + admin_logs + wlog_searchin + Search for... + + + core + admin_logs + wlog_search + Search Warn Logs + core admin_logs wlog_viewlog View - Посмотреть + + + core + admin_logs + wlog_removeall + Remove All By Member + core admin_logs wlog_viewall View All By Member - Просмотр записей + core admin_logs wlog_times Times Warned - Кол-во предупреждений + core admin_logs wlog_member Member - Пользователь + core admin_logs wlog_thelogs Saved Warn Logs - Журнал + core admin_logs wlog_noresults No Warn Logs Found]]> - Предупреждения не найдены ]]> - - core - admin_logs - wlog_date - Date - Дата + core admin_logs wlog_warnedby Warned By - Предупредил + + + core + admin_logs + wlog_date + Date + core admin_logs wlog_wascontacted Contacted? - Уведомлен? - - core - admin_logs - wlog_type - Type - Тип + core admin_logs wlog_warned Warned Member - Пользователь + core admin_logs - wlog_emailpm - Email/PM Sent - Отправлено e-mail/ЛС + wlog_type + Type + core admin_logs wlog_last10 Last 10 Warn Entries - Последние 10 предупреждений + + + core + admin_logs + wlog_emailpm + Email/PM Sent + core admin_logs wlog_notes Entry Notes - Заметки + core admin_logs wlog_email Email - E-mail + core admin_logs wlog_pm PM - ЛС + core admin_logs wlog_cantresolve We cannot resolve the warn log ID. Please try again. - Невозможно определить ID записи в журнале. Попробуйте еще раз. - - core - admin_logs - wlog_contacted - View email - Посмотреть e-mail + core admin_logs wlog_nologs We could not find the warn log entry. Please try again. - Невозможно найти записи в журнале. Попробуйте еще раз. - - core - admin_logs - wlog_showmessage - Show message - Посмотреть сообщение - - core - admin_logs - wlog_removelogs - Removed warn logs for member ID:(%s) - Удалены записи для пользователя №: %s - - core - admin_logs - wlog_log - Log - Журнал - - core - admin_logs - wlog_nofind - We could not find the member whose warn logs you were attempting to remove. Please try again. - Невозможно найти пользователя, записи которого вы пытаетесь удалить. Попробуйте еще раз. - - core - admin_logs - wlog_view - View - Просмотр + core admin_logs wlog_deleted Deleted Member (ID:%s) - Удаленный пользователь (ID:%s) + core admin_logs - wlog_hours - Hours - Часы + wlog_contacted + View email + core admin_logs - wlog_days - Days - Дни + wlog_showmessage + Show message + + + core + admin_logs + wlog_removelogs + Removed warn logs for member ID:(%s) + + + core + admin_logs + wlog_log + Log + + + core + admin_logs + wlog_nofind + We could not find the member whose warn logs you were attempting to remove. Please try again. + + + core + admin_logs + wlog_view + View + core admin_logs wlog_nostring You must enter a search string. Please try again. - Вы должны ввести строку поиска. + + + core + admin_logs + wlog_days + Days + + + core + admin_logs + wlog_hours + Hours + core admin_logs wlog_title Warn Logs Manager - Журнал предупреждений + core admin_logs slog_spider_logs Spider Logs - Журнал посещений поисковых ботов + core admin_logs slog_ip IP Address - IP-адрес + core admin_logs slog_time Time of Action - Время действия - - core - admin_logs - slog_searchbutton - Search - Найти - - core - admin_logs - slog_querystring - Query String - Строка запроса - - core - admin_logs - slog_searchquery - in query string - в строке запроса + core admin_logs slog_noresults No Spider Logs Found]]> - Действия не найдены ]]> + + + core + admin_logs + slog_querystring + Query String + + + core + admin_logs + slog_searchbutton + Search + + + core + admin_logs + slog_searchquery + in query string + core admin_logs slog_searchfor Search for... - Искать + core admin_logs slog_search Search Spider Logs - Поиск действий + core admin_logs slog_remove Remove - Удалить + core admin_logs slog_view View - Просмотреть + core admin_logs slog_removeall Remove All - Удалить все + core admin_logs slog_viewall View All - Все действия + core admin_logs slog_last Last Hit - Запущен + core admin_logs slog_hits Logged Hits - Хитов - - core - admin_logs - slog_adminlog - Removed Search Engine Logs - Удаленные действия - - core - admin_logs - slog_thelogs - Saved Search Engine Spider Logs - Список действий + core admin_logs slog_botname Bot Name - Поисковый робот + + + core + admin_logs + slog_thelogs + Saved Search Engine Spider Logs + + + core + admin_logs + slog_adminlog + Removed Search Engine Logs + core admin_logs slog_nologs We could not find the bot logs you wish to remove. Please try again. - Невозможно найти действия поискового робота. + core admin_logs error_log_noresults No Error Logs Found]]> - Ошибки не найдены ]]> - - core - admin_logs - slog_lofi - (Lo-Fi) - Текстовая версия - - core - admin_logs - slog_nostring - You must enter a search string. - Вы должны ввести строку поиска. + core admin_logs slog_title Search Engine Logs Manager - Управление журналом поисковых ботов + + + core + admin_logs + slog_nostring + You must enter a search string. + + + core + admin_logs + slog_lofi + (Lo-Fi) + core admin_logs error_log_removed Error Log(s) Removed - Журнал ошибок удален + core admin_logs error_log_search Search Error Logs - Поиск + core admin_logs error_log_thelogs Error Logs - Журнал ошибок + core admin_logs error_log_error Error Message - Сообщение - - core - admin_logs - error_log_member - Member Name - Имя пользователя - - core - admin_logs - error_log_ip - IP Address - IP-адрес + core admin_logs error_log_date Date - Дата + core admin_logs - choose_splash - Choose a log type to view - Выберите журнал для просмотра + error_log_ip + IP Address + + + core + admin_logs + error_log_member + Member Name + core admin_logs error_log_uri Error URI - URI + core admin_logs error_log_code Error Code - Код + core admin_logs nav_logssplash Logs - Журнал + + + core + admin_logs + choose_splash + Choose a log type to view + core admin_logs nav_toolsmodule - Инструменты и настройки - - core - admin_logs - sqllog_nofile - Could not locate a log to open - Не удалось найти файл журнала - - core - admin_logs - mlog_sqlerrors - SQL Error Logs - Журнал SQL ошибок - - core - admin_logs - sqllog_title - SQL Error Logs - Журнал ошибок SQL + core admin_logs sqllog_latest Latest SQL Error Today (%s)
    %s
    ]]>
    - Последняя SQL ошибка (%s)
    %s
    ]]>
    - - core - admin_logs - sqllog_size - File Size - Размер + core admin_logs sqllog_noresults - Хорошие новости - в журнале нет записей об ошибках в базе! + + + core + admin_logs + sqllog_nofile + Could not locate a log to open + + + core + admin_logs + sqllog_size + File Size + core admin_logs sqllog_date File Date - Дата + + + core + admin_logs + sqllog_title + SQL Error Logs + core admin_logs sqllog_name File Name - Имя + core admin_logs - sqllog_removed - %s SQL error log file(s) removed - Файл журнала ошибок удален + mlog_sqlerrors + SQL Error Logs + core admin_logs sqllog_more_file - + + + core + admin_logs + sqllog_removed + %s SQL error log file(s) removed + core admin_logs spamlog_sresults We found %s records that matched your search term - Найдено %s записей, удовлетворяющих вашему запросу + core admin_logs spamlog_searchbutton Search - Поиск + core admin_logs spamlog_searchh3 Search - Поиск + core admin_logs spamlog_searchlabel Search spam logs for: - Найти: + core admin_logs delete_all_sqllogs Delete All - Удалить все + core admin_logs deleted_member_warnlog Deleted Member (ID: %s) - Удален пользователь (ID: %s) - - core - admin_logs - subj_not_avail - Not available]]> - Недоступно]]> - - core - admin_logs - noname_availabl - Deleted admin]]> - Удаленный администратор]]> + core admin_logs noname_availablm Deleted moderator or task-initiated]]> - Удаленный модератор или задача]]> + core admin_logs stop_being_alarmed Certain tasks can perform moderator actions, which will result in a log being generated here. The task can be kicked off by any user, including search engine spiders and guests. Please do not be alarmed if you notice unrecognizable IP addresses or logs from guests. - Некоторые задачи могут выполнять модераторские действия. Задачи запускаются любым пользователей, в том числе и поисковыми роботами. Пожалуйста не паникуйте, если увидели в журнале неизвестные IP адреса у некоторых модераторских действий. + core admin_logs - archlog_archived - Archived %s items]]> - Архивировано %s штук]]> + subj_not_avail + Not available]]> + + + core + admin_logs + noname_availabl + Deleted admin]]> + core admin_logs mlog_showarchived Topic Archiver Logs - Журнал архива тем + + + core + admin_logs + archlog_archived + Archived %s items]]> + core admin_logs archlog_error Error: %s]]> - Ошибка: %s]]> + core admin_logs archlog_restored Restored %s items]]> - Восстановлено %s штук]]> + core admin_logs archiver_title Topic Archive Logs - Журнал архива тем - - core - admin_mobileapp - mi_current_title - Current Mobile App Images - Текущие изображения мобильного приложения - - core - admin_mobileapp - mi_upload - Upload - Загрузить - - core - admin_mobileapp - mi_recache - Recache - Обновить кеши - - core - admin_mobileapp - mi_tt_filename - Filename - Имя - - core - admin_mobileapp - mi_tt_modified - Modified - Изменено - - core - admin_mobileapp - mi_tt_size - Size - Размер - - core - admin_mobileapp - mi_import_failed - The import failed - Импортирование не прошло! - - core - admin_mobileapp - mi_error_images_writeable - - Некоторые изображения не могут быть записаны, детали ниже - - core - admin_mobileapp - mi_cant_import - Cannot import - Невозможно импортировать - - core - admin_mobileapp - mi_img_not_writable - Not writeable - Нет прав на запись - - core - admin_mobileapp - mi_img_not_dims - Incorrect size, should be %s - Некорретный размер, должно быть %s - - core - admin_mobileapp - mi_error_cannot_write - The directory %s is not writeable - Директория %s не имеет прав на запись - - core - admin_mobileapp - mi_error_doesnt_exist - - Директория %s не существует - - core - admin_mobileapp - mi_error_missing_img - The image %s is missing! - Изображение %s некорректное! - - core - admin_mobileapp - mi_error_no_export - The export failed - Экспорт не прошел! - - core - admin_mobileapp - mi_information - Import Images XMLArchive button to import an existing XML Archive or you can upload the images individually to the %s directory on your server. If you do choose to manually upload the images, please click the recache button when complete.]]> - Импорт изображений XML-архивом", или вы можете индивидуально загружать изображения в директорию %s на вашем сервере. Если вы загружаете вручную файлы, не забывайте обновлять кеши после этого.]]> - - core - admin_mobileapp - mi_exportxml - Export as XMLArchive - Экспортировать как XML-архив + core admin_mobileapp mi_select_xml Select XMLArchive - Выбрать XML-архив + core admin_mobileapp mi_error_refresh_failed Refresh Failed - Обновление не прошло! + + + core + admin_mobileapp + mi_cant_import + Cannot import + + + core + admin_mobileapp + mi_img_not_writable + Not writeable + + + core + admin_mobileapp + mi_img_not_dims + Incorrect size, should be %s + + + core + admin_mobileapp + mi_upload + Upload + + + core + admin_mobileapp + mi_error_images_writeable + + + + core + admin_mobileapp + mi_import_failed + The import failed + + + core + admin_mobileapp + mi_error_doesnt_exist + + + + core + admin_mobileapp + mi_error_cannot_write + The directory %s is not writeable + + + core + admin_mobileapp + mi_error_missing_img + The image %s is missing! + + + core + admin_mobileapp + mi_exportxml + Export as XMLArchive + + + core + admin_mobileapp + mi_error_no_export + The export failed + + + core + admin_mobileapp + mi_information + Import Images XMLArchive button to import an existing XML Archive or you can upload the images individually to the %s directory on your server. If you do choose to manually upload the images, please click the recache button when complete.]]> + core admin_mobileapp mi_import_title Import Images XMLArchive - Импорт изображений XML-архивом + + + core + admin_mobileapp + mi_tt_filename + Filename + + + core + admin_mobileapp + mi_tt_modified + Modified + + + core + admin_mobileapp + mi_tt_size + Size + + + core + admin_mobileapp + mi_current_title + Current Mobile App Images + + + core + admin_mobileapp + mi_recache + Recache + core admin_mobileapp mi_title Mobile App iOS Images - Изображения iOS App + core admin_mobileapp mi_recache_done Recache complete - Перестроение кеша завершено - - core - admin_mycp - cp_newversion_link - Click here for more information. - Подробнее - - core - admin_mycp - cp_newversion_info - A new version of IP.Board is available now. - Доступна новая версия IP.Board - - core - admin_mycp - cp_validations_info - There are %d accounts awaiting validation. - На данный момент %s учетных записей, ожидающих активации. - - core - admin_mycp - cp_validations - Pending Validations - Ожидающие активации - - core - admin_mycp - cp_noticeupdate - NOTICE: UPDATE INFORMATION - Информация по обновлению + core admin_mycp cp_update_info IPS Client Center and navigate to Your Downloads]]> - клиент-центр IBResource и перейдите на страницу Покупки]]> + core admin_mycp - cp_visitcc - VISIT IPS CLIENT AREA - ПОСЕТИТЬ КЛИЕНТ-ЦЕНТР + cp_validations + Pending Validations + core admin_mycp - cp_wannareset - Resetting the warning will NOT perform the upgrade for you!]]> - Продолжение удалит это предупреждение. Удаление этого предупреждения НЕ приведет к обновлению системы! + cp_validations_info + There are %d accounts awaiting validation. + core admin_mycp - cp_ipsblogs - IPS Latest Blogs - Последние блоги - - core - admin_mycp - cp_ipsbulletin - IP.Board Bulletin - Сообщения IP.Board - - core - admin_mycp - cp_updateavailable - Update Available Now - Обновление доступно - - core - admin_mycp - cp_activeadmins - Active Admins - Последние действия в АЦ - - core - admin_mycp - cp_availablenow - Available Now - Доступно - - core - admin_mycp - cp_newversion - New Version Available - Доступна новая версия - - core - admin_mycp - cp_version - Version - Версия - - core - admin_mycp - cp_resetwarning - Reset Warning - Сбросить предупреждения - - core - admin_mycp - cp_moreinformation - More Information - Подробнее - - core - admin_mycp - cp_securityupdate - Security Update Available - Доступно обновление безопасности - - core - admin_mycp - cp_warning_rebuild -
    >> REBUILD ALL SKIN CACHES & REMOVE THIS WARNING <<]]>
    -
    >> Обновить кеши всех стилей <<]]>
    - - core - admin_mycp - cp_lastacpactions - Last 5 ACP Actions - Последние 5 действий АЦ - - core - admin_mycp - cp_membername - Member Name - Пользователь - - core - admin_mycp - cp_timeofaction - Time of action - Время действия - - core - admin_mycp - cp_installer_warning - Simply remove admin/install/index.php from your installation to remove this message.]]> - Сделать это можно просто удалив admin/install/index.php с сервера.]]> - - core - admin_mycp - cp_unlocked_warning - %s/install/index.php from your server at once!
    Leaving it on your server WILL compromise the security of your system.]]>
    - admin/install/index.php c вашего сервера!
    Оставив этот файл вы рискуете безопасностью.]]>
    - - core - admin_mycp - cp_upgrade_warning - here to complete.]]> - here для завершения.]]> - - core - admin_mycp - cp_php_warning - Some sections of the ACP may not operate until you upgrade.]]> - Некоторые разделы АЦ могут не работать, пока вы не обновите вашу версию PHP.]]> - - core - admin_mycp - cp_error - Error - Ошибка - - core - admin_mycp - cp_from - from - из - - core - admin_mycp - cp_seeall_logins - See All Logins - Все - - core - admin_mycp - cp_seeall - See All - Все - - core - admin_mycp - cp_none_entered - None entered - Ничего не введено - - core - admin_mycp - cp_no_failed_logins - No failed logins to show - Нет неудачных попыток входа - - core - admin_mycp - cp_latestadminlogins - Failed Admin Logins - Ошибки Входа в АЦ - - core - admin_mycp - cp_view - View - Просмотр - - core - admin_mycp - cp_savenotes - Save Admin Notes - Сохранить - - core - admin_mycp - cp_warning_converter - Simply visit this page to lock the converter and remove this message.]]> - Просто удалите директорию admin/applications_addon/ips/convert с сервера и данное предупреждение пропадет.]]> - - core - admin_mycp - cp_yes - Yes - Да - - core - admin_mycp - cp_no - No - Нет - - core - admin_mycp - cp_ip - IP - IP адрес - - core - admin_mycp - cp_registered - Registered - Зарегистрирован - - core - admin_mycp - cp_more - MORE - БОЛЬШЕ - - core - admin_mycp - cp_adminvalidationqueue - Admin Validation Queue - Очередь на активацию администратором - - core - admin_mycp - cp_ipslatestnews - IPS Latest News - Последние новости - - core - admin_mycp - cp_adminnotes - Admin Notes - Заметки - - core - admin_mycp - cp_usergroup - user group - группу - - core - admin_mycp - cp_ipaddresses - IP addresses - IP адрес - - core - admin_mycp - cp_systemsettings - system settings - системные настройки - - core - admin_mycp - cp_members - members - пользователей - - core - admin_mycp - cp_go - Go - Ок - - core - admin_mycp - cp_find - Find - Найти - - core - admin_mycp - cp_edit - Edit - Редактировать - - core - admin_mycp - cp_quicksearch - Quick Search - Быстрый поиск - - core - admin_mycp - cp_emoticonmanager - Emoticon Manager - Смайлики - - core - admin_mycp - cp_bulkmailer - Bulk Mailer - Рассылки - - core - admin_mycp - cp_manageforums - Manage Forums - Форумы - - core - admin_mycp - cp_langmanager - Language Manager - Языки - - core - admin_mycp - cp_skinmanager - Skin Manager - Стили - - core - admin_mycp - cp_managevalidating - Manage Validation Queue - Ожидающие активации - - core - admin_mycp - cp_serverload - Server Load - загрузка сервера - - core - admin_mycp - cp_onlineusers - Online Users - пользователей в онлайн - - core - admin_mycp - cp_welcomeipb3 - Welcome to IP.Board %s - Панель управления IP.Board 3 - - core - admin_mycp - cp_managemembers - Manage Members - Пользователи - - core - admin_mycp - cp_editsettings - Edit System Settings - Настройки системы - - core - admin_mycp - cp_managegroups - Manage User Groups - Группы - - core - admin_mycp - cp_performance - Performance Mode - Режим производительности - - core - admin_mycp - cp_bbcodeneedup - BBCodes Need Updating - Необходимо обновление BB-кодов - - core - admin_mycp - cp_helpneedup - Help Files Need Updating - Необходимо обновление разделов помощи - - core - admin_mycp - cp_devnotes - Developer Notes - Заметки разработчика - - core - admin_mycp - cp_clickhere_info - to reimport all apps to make sure your settings are up-to-date - для импортирования последних настроек - - core - admin_mycp - cp_clickhere - Click Here - Нажмите здесь - - core - admin_mycp - cp_modulessneedup - Modules Need Updating - Необходимо обновление модулей - - core - admin_mycp - cp_taskssneedup - Tasks Need Updating - Необходимо обновление задач - - core - admin_mycp - cp_settingsneedup - Settings Need Updating - Необходимо обновление настроек - - core - admin_mycp - cp_lastxmlexport - Last XML export - Последнее экспортирование - - core - admin_mycp - cp_lastimportrun - Last import run - Последнее импортирование - - core - admin_mycp - cp_settingsupdated - settings.xml has been updated - - - core - admin_mycp - cp_boardoffline2 - Turn Community Online - Открыть форум - - core - admin_mycp - cp_boardoffline1 - Your community is currently offline - Форум в настоящее время закрыт - - core - admin_mycp - cp_boardoffline - Community Offline - Форум закрыт - - core - admin_mycp - cp_yourphpversion - Your PHP Version (%s) is insufficient - Несоответствующая версия PHP (%s) - - core - admin_mycp - cp_unlocked_converter - Unlocked Converter Present - Найден незаблокированный скрипт конвертации форума - - core - admin_mycp - cp_unfinishedupgrade - Unfinished Upgrade - Незаконченное обновление - - core - admin_mycp - cp_installerpresent - Installer Present - Найден установщик системы - - core - admin_mycp - cp_converterpresent - Converter Present - Найден скрипт конвертации - - core - admin_mycp - cp_unlockedinstaller - Unlocked Installer - Незаблокированный мастер установки - - core - admin_mycp - cp_index - Index - Главная - - core - admin_mycp - cp_minutesago - minutes ago - минут назад - - core - admin_mycp - cp_secondsago - seconds ago - секунд назад - - core - admin_mycp - cp_spammeraccounts - Spammers - Спамеры - - core - admin_mycp - cp_acpnotes - You can use this section to keep notes for all members who access the Admin CP. It is globally editable by all admins who have access to the dashboard. - Вы можете использовать этот раздел, чтобы оставлять заметки всем пользователям, имеющим доступ в АЦ. Эта функция доступна всем администраторам, имеющим доступ в АЦ. - - core - admin_mycp - fulltext_find - Enable Fulltext Searching... - Включить полнотекстовый поиск - - core - admin_mycp - ds_log_all_title - Log To File Enabled - Включено журналирование в файлы - - core - admin_mycp - ds_log_all_desc - - - - core - admin_mycp - rebuild_furl_cache - Rebuild FURL Cache - Обновить кеш ЧПУ - - core - admin_mycp - fulltext_off - Fulltext Search Disabled - Полнотекстовый поиск отключен - - core - admin_mycp - fulltext_turnon - You are using the traditional search method but have disabled fulltext searching. Fulltext searching provides for improved performance over traditional MySQL search lookups and should usually be enabled. - Сейчас форум использует обычный тип поиск, полнотекстовый отключен. - - core - admin_mycp - furlcache_outofdate_desc - The rule definitions for the %s application may be out of date. - Правила ЧПУ для %s приложения могут быть устаревшими. - - core - admin_mycp - minifywrite_head - Minify Disabled - Minify отключен - - core - admin_mycp - furlcache_outofdate - FURL Cache Out Of Date - Кеш ЧПУ устарел - - core - admin_mycp - minifynot_writeable - You have Minify switched on in your settings but IP.Board cannot write to /cache/tmp. Please check permissions on that directory. If this message persists, please turn off minify. - Minify включен в настройках вашего форума, но не может записывать данные в папку /cache/tmp. Пожалуйста, проверьте CHMOD права к ней. Если сообщение не уберется, выключите Minify. - - core - admin_mycp - changed_password - Administrator updated their password - Администратор изменил пароль - - core - admin_mycp - details_updated - Your details have been updated successfully - Ваши данные успешно обновлены - - core - admin_mycp - change_not_match_pw - The two passwords supplied did not match - Введенные пароли не соответствуют друг другу. - - core - admin_mycp - changed_email - Administrator updated their email address to %s - Администратор изменил e-mail адрес на %s - - core - admin_mycp - bad_email_supplied - You supplied an invalid email address - Вы ввели неверный e-mail адрес - - core - admin_mycp - already_using_email - You are already using that email address - Вы уже используете этот e-mail адрес - - core - admin_mycp - change_not_match - The email addresses supplied did not match - Введенные e-mail адреса не соответствуют друг другу. - - core - admin_mycp - change__pass - New Password - Новый пароль - - core - admin_mycp - change__pass_confirm - Confirm New Password - Подтверждение нового пароля - - core - admin_mycp - change_nothing_update - You did not specify to change your email or password - Вы не ввели ничего для изменения e-mail адреса или пароля - - core - admin_mycp - change_both_fields - You must fill in both fields - Вы должны заполнить оба поля - - core - admin_mycp - change_email_already_used - The email address you supplied is already in use - Введенный e-mail адрес уже используется - - core - admin_mycp - change__email - New Email Address - Новый е-mail адрес - - core - admin_mycp - change__email_confirm - Confirm New Email Address - Подтверждение нового е-mail адреса - - core - admin_mycp - change_pass_details - Only fill in the fields if you wish to change your password - Заполните поля, если вы хотите изменить пароль - - core - admin_mycp - change_email_details - Only fill in the fields if you wish to change your email address - Заполните поля, если вы хотите изменить е-mail адрес - - core - admin_mycp - mycp_change_details - Change Details - Изменение данных - - core - admin_mycp - change__confirm - Update - Обновить - - core - admin_mycp - lc_title_expired - Support License Expired - Лицензия не активна - - core - admin_mycp - lc_msg_expired - Your support license has expired, to continue receiving support and other services, please renew your license. - Срок активности вашей лицензии истек. Для возобновления сервиса поддержки и доступа к дистрибутивам необходимо продлить лицензию. - - core - admin_mycp - lc_title_notfound - URL License Missing - Отсутствует URL лицензии - - core - admin_mycp - lc_msg_notfound - %s' which is not found in our system, please remove your key and then readd it with the correct URL, you can do this via the License Key section of the ACP.]]> - %s' не зарегистрировано в нашей системе, пожалуйста, свяжитесь с нашими менеджерами.]]> - - core - admin_mycp - cp_profilephotoerr_title - Your profile photo directory is not writable - Директория фотографий для профиля не имеет прав на запись - - core - admin_mycp - cp_perfmodeon_msg - Some features, such as messenger, are disabled while performance mode is enabled. - Некоторый возможности, такие как личные сообщения, отключены в режиме производительности. - - core - admin_mycp - lc_msg_nokey - click here to enter it now and receive access to the services provided by your license!]]> - нажмите здесь, чтобы заполнить его сейчас.]]> - - core - admin_mycp - cp_profilephotoerr_msg - %s' and make sure that it is writable.]]> - %s' и убедитесь, что есть права на запись]]> - - core - admin_mycp - lc_title_nokey - License Key Missing - Отсутствует ключ лицензии - - core - admin_mycp - cp_gdnotinstalled_title - GD is not installed - GD не установлена - - core - admin_mycp - notificationcenter - Notification Center - Уведомления - - core - admin_mycp - ipboardlicenseerror - IP.Board License Message - Лицензия на IP.Board - - core - admin_mycp - licensenocomm - click here to test your connectivity.]]> - Возникла проблема при соединении с сервером проверки лицензии. - - core - admin_mycp - cp_perfmodeon_title - Performance Mode Enabled - Режим производительности включен - - core - admin_mycp - reg_chart_stats - Registrations over past %s days - Регистраций за последние %s дней - - core - admin_mycp - admins_online - Admins online: - Администраторы в онлайне: - - core - admin_mycp - more_detailslink - More Details - Подробнее - - core - admin_mycp - details__members - Members - Пользователей - - core - admin_mycp - details__posts - Posts - Сообщений - - core - admin_mycp - spam_service_error - Spam Monitoring Service Error - Ошибка при работе с анти-спам сервисом - - core - admin_mycp - spam_service_error_msg - The last call to the Spam Monitoring Service resulted in an error (%s). If the problem persists, you may wish to contact technical support for assistance. - Последнее обращение к сервису анти-спама было с ошибкой (%s). Если проблема повторится, пожалуйста, свяжитесь с технической поддержкой для проверки соединения и решения проблемы. - - core - admin_mycp - spam_service_disabled - Spam Monitoring Service Disabled - Анти-спам сервис отключен - - core - admin_mycp - spam_service_disabled_msg - More Information.]]> - Вам доступен сервис анти-спама для вашего сообщества, однако, он сейчас выключен. Сервис позволяет улучшить защиту от спамеров. - - core - admin_mycp - sphinxconfig_outofdate - Sphinx Config Out Of Date - Файл конфигурации поискового индексатора Sphinx устарел - - core - admin_mycp - rebuild_sphinx_config - Rebuild sphinx.conf file and cronjobs - Обновить конфигурационный файл sphinx.conf и задачи cron - - core - admin_mycp - sphinxconfig_outofdate_desc -
    You should update your sphinx configuration file and cronjobs following any update:]]>
    -
    Вы должны обновить sphinx конфигурационный файл и cronjobs:]]>
    - - core - admin_mycp - cp_gdnotinstalled_msg - It appears that GD is not installed on your server, in order to use certain functionality, such as thumbnail generation, you will need to have it installed. - Это значит, что GD не установлена на вашем сервере, для того чтобы использовать функционал создания иконок, необходимо установить GD. - - core - admin_mycp - suhosin_badvalue5 - Your host will need to change this in the php.ini file.]]> - Необходимо привести значение в соответствии с рекомендуемым, исправив его в php.ini файле. ]]> - - core - admin_mycp - suhosin_badvalue6 - Your host will need to change this in the php.ini file.]]> - Необходимо привести значение в соответствии с рекомендуемым, исправив его в php.ini файле. ]]> - - core - admin_mycp - cp_missingemail1 - Your community incoming or outgoing email address is currently not specified. - Адреса почтовых ящиков для входящей и исходящей почты с форума не указаны. - - core - admin_mycp - cp_missingemail2 - Configure Email Addresses - Настроить адреса - - core - admin_mycp - tp_tabs - Tabs - Вкладки - - core - admin_mycp - spam_service_unavailable - here.]]> - отключить его.]]> - - core - admin_mycp - suhosin_badvalue4 - Your host will need to change this in the php.ini file.]]> - Необходимо привести значение в соответствии с рекомендуемым, исправив его в php.ini файле. ]]> - - core - admin_mycp - suhosin_badvalue3 - Your host will need to change this in the php.ini file.]]> - Необходимо привести значение в соответствии с рекомендуемым, исправив его в php.ini файле. ]]> - - core - admin_mycp - suhosin_badvalue2 - Your host will need to change this in the php.ini file.]]> - Необходимо привести значение в соответствии с рекомендуемым, исправив его в php.ini файле. ]]> - - core - admin_mycp - suhosin_badvalue1 - Your host will need to change this in the php.ini file.]]> - Необходимо привести значение в соответствии с рекомендуемым, исправив его в php.ini файле. ]]> - - core - admin_mycp - suhosin_notification - Suhosin Enabled - Включен Suhosin патч для PHP - - core - admin_mycp - cp_upgradefinishfolder - upgradeFinish Folder Detected - Обнаружена директория upgradeFinish - - core - admin_mycp - cp_upgradefinishfolder_msg - We have detected that %s is present on your server. You should remove this folder to prevent potential abuse. - Обнаружено наличие директории %s на вашем сервере. Вам необходимо удалить эту директорию в целях безопасности. - - core - admin_mycp - failedlogin_viewdetails - View Details - Подробнее - - core - admin_mycp - spam_service_expired - here or renew your license here.]]> - отключите антиспам-сервис]]> - - core - admin_mycp - cp_missingemail - Email Address Missing - Не указаны email адреса - - core - admin_mycp - tp_button_reset - Reset Default Tabs - По Умолчанию - - core - admin_mycp - tp_button_save - Save Tabs - Сохранить - - core - admin_mycp - tp_title - Tab Preferences - Настройка вкладок + cp_newversion_link + Click here for more information. + core admin_mycp cp_validations_review Click here to review. - Перейти к списку. + + + core + admin_mycp + cp_newversion_info + A new version of IP.Board is available now. + + + core + admin_mycp + cp_wannareset + Resetting the warning will NOT perform the upgrade for you!]]> + + + core + admin_mycp + cp_visitcc + VISIT IPS CLIENT AREA + + + core + admin_mycp + cp_noticeupdate + NOTICE: UPDATE INFORMATION + + + core + admin_mycp + cp_activeadmins + Active Admins + + + core + admin_mycp + cp_ipsbulletin + IP.Board Bulletin + + + core + admin_mycp + cp_ipsblogs + IPS Latest Blogs + + + core + admin_mycp + cp_updateavailable + Update Available Now + + + core + admin_mycp + cp_newversion + New Version Available + + + core + admin_mycp + cp_installer_warning + Simply remove admin/install/index.php from your installation to remove this message.]]> + + + core + admin_mycp + cp_warning_rebuild +
    >> REBUILD ALL SKIN CACHES & REMOVE THIS WARNING <<]]>
    +
    + + core + admin_mycp + cp_resetwarning + Reset Warning + + + core + admin_mycp + cp_version + Version + + + core + admin_mycp + cp_availablenow + Available Now + + + core + admin_mycp + cp_securityupdate + Security Update Available + + + core + admin_mycp + cp_upgrade_warning + here to complete.]]> + + + core + admin_mycp + cp_moreinformation + More Information + + + core + admin_mycp + cp_membername + Member Name + + + core + admin_mycp + cp_timeofaction + Time of action + + + core + admin_mycp + cp_php_warning + Some sections of the ACP may not operate until you upgrade.]]> + + + core + admin_mycp + cp_lastacpactions + Last 5 ACP Actions + + + core + admin_mycp + cp_unlocked_warning + %s/install/index.php from your server at once!
    Leaving it on your server WILL compromise the security of your system.]]>
    +
    + + core + admin_mycp + cp_error + Error + + + core + admin_mycp + cp_from + from + + + core + admin_mycp + cp_seeall + See All + + + core + admin_mycp + cp_seeall_logins + See All Logins + + + core + admin_mycp + cp_none_entered + None entered + + + core + admin_mycp + cp_no_failed_logins + No failed logins to show + + + core + admin_mycp + cp_latestadminlogins + Failed Admin Logins + + + core + admin_mycp + cp_view + View + + + core + admin_mycp + cp_savenotes + Save Admin Notes + + + core + admin_mycp + cp_registered + Registered + + + core + admin_mycp + cp_warning_converter + Simply visit this page to lock the converter and remove this message.]]> + + + core + admin_mycp + cp_no + No + + + core + admin_mycp + cp_ip + IP + + + core + admin_mycp + cp_yes + Yes + + + core + admin_mycp + cp_more + MORE + + + core + admin_mycp + cp_ipslatestnews + IPS Latest News + + + core + admin_mycp + cp_adminvalidationqueue + Admin Validation Queue + + + core + admin_mycp + cp_adminnotes + Admin Notes + + + core + admin_mycp + cp_usergroup + user group + + + core + admin_mycp + cp_systemsettings + system settings + + + core + admin_mycp + cp_ipaddresses + IP addresses + + + core + admin_mycp + cp_find + Find + + + core + admin_mycp + cp_edit + Edit + + + core + admin_mycp + cp_go + Go + + + core + admin_mycp + cp_members + members + + + core + admin_mycp + cp_quicksearch + Quick Search + + + core + admin_mycp + cp_emoticonmanager + Emoticon Manager + + + core + admin_mycp + cp_bulkmailer + Bulk Mailer + + + core + admin_mycp + cp_manageforums + Manage Forums + + + core + admin_mycp + cp_langmanager + Language Manager + + + core + admin_mycp + cp_skinmanager + Skin Manager + + + core + admin_mycp + cp_managevalidating + Manage Validation Queue + + + core + admin_mycp + cp_managegroups + Manage User Groups + + + core + admin_mycp + cp_editsettings + Edit System Settings + + + core + admin_mycp + cp_managemembers + Manage Members + + + core + admin_mycp + cp_welcomeipb3 + Welcome to IP.Board %s + + + core + admin_mycp + cp_onlineusers + Online Users + + + core + admin_mycp + cp_serverload + Server Load + + + core + admin_mycp + cp_performance + Performance Mode + + + core + admin_mycp + cp_devnotes + Developer Notes + + + core + admin_mycp + cp_helpneedup + Help Files Need Updating + + + core + admin_mycp + cp_bbcodeneedup + BBCodes Need Updating + + + core + admin_mycp + cp_clickhere_info + to reimport all apps to make sure your settings are up-to-date + + + core + admin_mycp + cp_taskssneedup + Tasks Need Updating + + + core + admin_mycp + cp_clickhere + Click Here + + + core + admin_mycp + cp_modulessneedup + Modules Need Updating + + + core + admin_mycp + cp_settingsneedup + Settings Need Updating + + + core + admin_mycp + cp_lastxmlexport + Last XML export + + + core + admin_mycp + cp_lastimportrun + Last import run + + + core + admin_mycp + cp_settingsupdated + settings.xml has been updated + + + core + admin_mycp + cp_boardoffline2 + Turn Community Online + + + core + admin_mycp + cp_unlocked_converter + Unlocked Converter Present + + + core + admin_mycp + cp_unfinishedupgrade + Unfinished Upgrade + + + core + admin_mycp + cp_yourphpversion + Your PHP Version (%s) is insufficient + + + core + admin_mycp + cp_boardoffline1 + Your community is currently offline + + + core + admin_mycp + cp_boardoffline + Community Offline + + + core + admin_mycp + cp_converterpresent + Converter Present + + + core + admin_mycp + cp_installerpresent + Installer Present + + + core + admin_mycp + fulltext_find + Enable Fulltext Searching... + + + core + admin_mycp + ds_log_all_title + Log To File Enabled + + + core + admin_mycp + ds_log_all_desc + + + + core + admin_mycp + cp_spammeraccounts + Spammers + + + core + admin_mycp + cp_acpnotes + You can use this section to keep notes for all members who access the Admin CP. It is globally editable by all admins who have access to the dashboard. + + + core + admin_mycp + cp_unlockedinstaller + Unlocked Installer + + + core + admin_mycp + cp_index + Index + + + core + admin_mycp + cp_minutesago + minutes ago + + + core + admin_mycp + cp_secondsago + seconds ago + + + core + admin_mycp + fulltext_off + Fulltext Search Disabled + + + core + admin_mycp + fulltext_turnon + You are using the traditional search method but have disabled fulltext searching. Fulltext searching provides for improved performance over traditional MySQL search lookups and should usually be enabled. + + + core + admin_mycp + rebuild_furl_cache + Rebuild FURL Cache + + + core + admin_mycp + furlcache_outofdate + FURL Cache Out Of Date + + + core + admin_mycp + furlcache_outofdate_desc + The rule definitions for the %s application may be out of date. + + + core + admin_mycp + minifywrite_head + Minify Disabled + + + core + admin_mycp + minifynot_writeable + You have Minify switched on in your settings but IP.Board cannot write to /cache/tmp. Please check permissions on that directory. If this message persists, please turn off minify. + + + core + admin_mycp + details_updated + Your details have been updated successfully + + + core + admin_mycp + changed_password + Administrator updated their password + + + core + admin_mycp + change_not_match + The email addresses supplied did not match + + + core + admin_mycp + bad_email_supplied + You supplied an invalid email address + + + core + admin_mycp + change_not_match_pw + The two passwords supplied did not match + + + core + admin_mycp + changed_email + Administrator updated their email address to %s + + + core + admin_mycp + already_using_email + You are already using that email address + + + core + admin_mycp + change_both_fields + You must fill in both fields + + + core + admin_mycp + change_email_already_used + The email address you supplied is already in use + + + core + admin_mycp + change__pass_confirm + Confirm New Password + + + core + admin_mycp + change_nothing_update + You did not specify to change your email or password + + + core + admin_mycp + mycp_change_details + Change Details + + + core + admin_mycp + change__confirm + Update + + + core + admin_mycp + change_email_details + Only fill in the fields if you wish to change your email address + + + core + admin_mycp + change__email + New Email Address + + + core + admin_mycp + change__email_confirm + Confirm New Email Address + + + core + admin_mycp + change_pass_details + Only fill in the fields if you wish to change your password + + + core + admin_mycp + change__pass + New Password + + + core + admin_mycp + lc_msg_expired + Your support license has expired, to continue receiving support and other services, please renew your license. + + + core + admin_mycp + cp_profilephotoerr_title + Your profile photo directory is not writable + + + core + admin_mycp + cp_profilephotoerr_msg + %s' and make sure that it is writable.]]> + + + core + admin_mycp + lc_title_nokey + License Key Missing + + + core + admin_mycp + lc_msg_nokey + click here to enter it now and receive access to the services provided by your license!]]> + + + core + admin_mycp + lc_title_expired + Support License Expired + + + core + admin_mycp + lc_title_notfound + URL License Missing + + + core + admin_mycp + ipboardlicenseerror + IP.Board License Message + + + core + admin_mycp + licensenocomm + click here to test your connectivity.]]> + + + core + admin_mycp + cp_perfmodeon_title + Performance Mode Enabled + + + core + admin_mycp + cp_perfmodeon_msg + Some features, such as messenger, are disabled while performance mode is enabled. + + + core + admin_mycp + lc_msg_notfound + %s' which is not found in our system, please remove your key and then readd it with the correct URL, you can do this via the License Key section of the ACP.]]> + + + core + admin_mycp + cp_gdnotinstalled_title + GD is not installed + + + core + admin_mycp + cp_gdnotinstalled_msg + It appears that GD is not installed on your server, in order to use certain functionality, such as thumbnail generation, you will need to have it installed. + + + core + admin_mycp + notificationcenter + Notification Center + + + core + admin_mycp + suhosin_badvalue6 + Your host will need to change this in the php.ini file.]]> + + + core + admin_mycp + suhosin_badvalue5 + Your host will need to change this in the php.ini file.]]> + + + core + admin_mycp + suhosin_badvalue2 + Your host will need to change this in the php.ini file.]]> + + + core + admin_mycp + suhosin_badvalue3 + Your host will need to change this in the php.ini file.]]> + + + core + admin_mycp + details__members + Members + + + core + admin_mycp + details__posts + Posts + + + core + admin_mycp + spam_service_error + Spam Monitoring Service Error + + + core + admin_mycp + suhosin_badvalue4 + Your host will need to change this in the php.ini file.]]> + + + core + admin_mycp + suhosin_notification + Suhosin Enabled + + + core + admin_mycp + suhosin_badvalue1 + Your host will need to change this in the php.ini file.]]> + + + core + admin_mycp + tp_button_reset + Reset Default Tabs + + + core + admin_mycp + tp_button_save + Save Tabs + + + core + admin_mycp + tp_title + Tab Preferences + core admin_mycp tp_desc Note that the 'Other Apps' menu cannot be moved from the main tab bar.]]> - Само меню 'Другие Приложения' нельзя убрать с основной панели.]]> + + + core + admin_mycp + tp_tabs + Tabs + + + core + admin_mycp + spam_service_unavailable + here.]]> + + + core + admin_mycp + spam_service_expired + here or renew your license here.]]> + + + core + admin_mycp + failedlogin_viewdetails + View Details + + + core + admin_mycp + cp_missingemail + Email Address Missing + + + core + admin_mycp + cp_missingemail1 + Your community incoming or outgoing email address is currently not specified. + + + core + admin_mycp + cp_upgradefinishfolder_msg + We have detected that %s is present on your server. You should remove this folder to prevent potential abuse. + + + core + admin_mycp + cp_upgradefinishfolder + upgradeFinish Folder Detected + + + core + admin_mycp + sphinxconfig_outofdate + Sphinx Config Out Of Date + + + core + admin_mycp + rebuild_sphinx_config + Rebuild sphinx.conf file and cronjobs + + + core + admin_mycp + sphinxconfig_outofdate_desc +
    You should update your sphinx configuration file and cronjobs following any update:]]>
    +
    + + core + admin_mycp + spam_service_disabled_msg + More Information.]]> + + + core + admin_mycp + spam_service_disabled + Spam Monitoring Service Disabled + + + core + admin_mycp + spam_service_error_msg + The last call to the Spam Monitoring Service resulted in an error (%s). If the problem persists, you may wish to contact technical support for assistance. + + + core + admin_mycp + cp_missingemail2 + Configure Email Addresses + + + core + admin_mycp + reg_chart_stats + Registrations over past %s days + + + core + admin_mycp + more_detailslink + More Details + + + core + admin_mycp + admins_online + Admins online: + core admin_mycp tp_other_app_menu Other Apps Menu - Меню "Другие Приложение" + core admin_mycp tp_main_tab_bar Main Tab Bar - Основная Панель + core admin_palette pal_select_a_file Select a file - Выберите файл + core admin_palette pal_upload UPLOAD - ЗАГРУЗИТЬ + core admin_palette pal_attachment_space_used Attachment space used - Место под прикрепленные файлы использовано + core admin_palette pal_max_single_upload_size Max. single upload size: - Максимальный размер загружаемого файла: + core admin_palette pal_of of - из + core admin_palette pal_file_space_used File space used - Файловое пространство использовано + core admin_palette pal_max_single_upload_size_1 Max. single upload size - Максимальный размер загружаемого файла: + core admin_palette pal_item Item - Элемент + core admin_palette pal_insert_item Insert Item... - Вставить элемент + core admin_palette pal_legend Legend - Подпись + core admin_palette pal_insert Insert... - Вставить... + core admin_palette pal_pages Pages - Страницы + core admin_palette pal_back Back - Назад + core admin_palette pal_template template - шаблон + core admin_palette pal_red_removed_text Red: Removed Text - Красный: удаленный текст + core admin_palette pal_green_added_text Green: Added Text - Зеленый: добавленный текст + core admin_palette pal_show_item Show Item... - Показать элемент + core admin_palette pal_url URL - URL + core admin_palette pal_delete_item Delete Item... - Удалить элемент + core admin_palette pal_no_open_editors_to_extract_med No open editors to extract media from - Ни один редактор не открыт для загрузки видео из + core admin_palette pal_preview Preview - Предпросмотр + core admin_palette pal_images Images - Изображения + core admin_palette pal_urls URLs - URLs + core admin_palette pal_templates Templates - Шаблоны + core admin_palette pal_blocks Blocks - Блоки + core admin_palette pal_options Options - Настройки + core admin_palette pal_bgroups B.Groups - Группы + core admin_palette pal_close_library Close Library - Закрыть библиотеку + core admin_palette pal_extract_media Extract Media... - Извлечь + core admin_palette pal_view_wrapped_html View Wrapped HTML - Обработанный HTML + core admin_palette pal_view_raw_html View Raw HTML - Необработанный HTML + core admin_palette pal_attach_uploading_file Uploading File... - Загрузка файла + core admin_palette pal_attach_no_items There are no items currently - В настоящее время элементов нет + core admin_palette pal_attach_init_progress Initializing Attachments... - Инициализация прикрепленных файлов + core admin_palette pal_attach_upload_ok - Загрузка завершена успешно. Загруженные файлы доступны в «Управление текущими файлами» + core admin_palette pal_attach_upload_failed Upload failed. Please ask the administrator to check the settings and permissions - Загрузка неудачна. Попросите администратора проверить настройки и права доступа + core admin_palette pal_attach_upload_too_big Upload failed. The file was larger than the available space - Загрузка не удалась. Размер файла больше чем доступное пространство на диске + core admin_palette pal_attach_no_upload Upload failed. You did not select a file to upload - Загрузка не удалась. Не выбран файл для загрузки + core admin_palette pal_attach_invalid_mime_type Upload failed. You are not permitted to upload this type of file - Загрузка не удалась. Вам не разрешено загружать этот тип файлов + core admin_palette pal_attach_no_upload_dir_perms Upload failed. Please ask the administrator to ensure the uploads directory is writeable - Загрузка не удалась. Пожалуйста, сообщите администратору о неверных правах доступа к директории загружаемых файлов + core admin_palette pal_attach_no_upload_dir Upload failed. Please ask the administrator to ensure the uploads directory is available - Загрузка не удалась. Сообщите администратору о неверных правах доступа к директории загружаемых файлов + core admin_palette pal_attach_attach_remove Delete attachment - Удалить прикрепленный файл + core admin_palette pal_attach_ready Attachment system ready - Система загрузки файлов готова + core admin_palette pal_attach_remove_warn Proceed with attachment removal? - Удалить прикрепленный файл ? + core admin_palette pal_attach_attach_insert Insert attachment into text editor - Добавить прикрепленный файл в сообщение + core admin_palette pal_attach_attach_removed Attachment Removed - Прикрепленный файл удален + core admin_palette pal_attach_attach_removal Removing Attachment... - Удаление прикрепленного файла... - - core - admin_posts - r_statmanager - Status Manager - Управление статусами + core admin_posts ctype__support Support Requests in IP.Nexus - Запрос поддержки в IP.Commerce + core admin_posts ctype__idmfile Submitting Files in IP.Downloads - Добавление файлов в IP.Downloads - - core - admin_posts - ctype__blogblc - IP.Blog Custom Blocks - Пользовательские блоки IP.Blog - - core - admin_posts - ctype__blogent - Submitting entries in IP.Blog - Добавление записей в IP.Blog - - core - admin_posts - ctype__galimg - Submitting Images in IP.Gallery - Добавление изображений IP.Gallery - - core - admin_posts - ctype__pms - Private Messages - Личные сообщения + core admin_posts ctype__comments Submitting Comments - Добавление комментариев + core admin_posts - ctype__warn - Warn logs/notes - Журналы предупреждений/заметок + ctype__blogblc + IP.Blog Custom Blocks + + + core + admin_posts + ctype__blogent + Submitting entries in IP.Blog + + + core + admin_posts + ctype__galimg + Submitting Images in IP.Gallery + core admin_posts ctype__calendar Calendar - Календарь - - core - admin_posts - ctype__aboutme - About Me - Обо мне - - core - admin_posts - ctype__signatures - Signatures - Подписи - - core - admin_posts - ctype__topics - Topics and Replies - Темы и ответы - - core - admin_posts - ctype__announcement - Announcements - Объявления - - core - admin_posts - ctype__reports - Reported Content - Проблемный контент - - core - admin_posts - r_messages_enter - Groups that can add themselves to conversations - Группы пользователей, которые могут добавлять себе в обсуждения - - core - admin_posts - r_menter_desc - Specify which groups can add themselves to reported conversations - Выберите группы пользователей, которые смогут добавлять себя в обсуждения жалоб - - core - admin_posts - r_nostattitle - You must enter a status title - Вы должны ввести название статуса - - core - admin_posts - r_minutes - Minutes to one point - Минут на один балл - - core - admin_posts - r_minutes_info - How many minutes it takes to gain a single point. Points are used in displaying severity images. - Количество минут на один балл. Баллы используются для показа соответствующего изображения. - - core - admin_posts - r_pointsper_info - How many points a single report worth. Points are used in displaying severity images. - Количество баллов на жалобу. Баллы используются для показа соответствующего изображения. - - core - admin_posts - r_pointsper - Points per report - Баллов на жалобу - - core - admin_posts - r_name_info - What would you like to call this status? - Как бы вы назвали этот статус? - - core - admin_posts - r_edit_status - Edit Status - Изменение статуса - - core - admin_posts - r_create_status - Create Status - Создать статус - - core - admin_posts - r_points - Points - Баллы - - core - admin_posts - r_points_info - How many points are needed to display graphic. - Сколько необходимо баллов для показа изображения? - - core - admin_posts - r_height - Height - Высота - - core - admin_posts - r_width - Width - Ширина - - core - admin_posts - r_confimage - Configure Image - Настройка изображения - - core - admin_posts - r_image - Image - Изображение - - core - admin_posts - r_image_info - <#IMG_DIR#> to use a graphic from the user skin]]> - <#IMG_DIR#> для использования изображения из пользовательского стиля.]]> - - core - admin_posts - r_safemode - Enable Safemode? (Cannot be deleted or edited by user) - Включить безопасный режим ? (Не может быть изменен или удален пользователем) - - core - admin_posts - r_pluginenabled - Plugin Enabled - Включить плагин? - - core - admin_posts - r_groups_submit_info - Control which groups can submit reports in this plugin - Выберите группы пользователей, которые смогут отправлять жалобы этого плагина - - core - admin_posts - r_groups - Groups that can view reports - Группы пользователей, которые могут просматривать жалобы - - core - admin_posts - r_groups_info - Specify what groups can view and manage reports by this plugin. Specific permissions are handled by the plugin itself. - Выберите группы пользователей, которые смогут просматривать и управлять жалобами этого плагина. Специальные разрешения плагин обрабатывает сам. - - core - admin_posts - r_groups_submit - Groups that can submit reports - Группы пользователей, которые могут отправлять жалобы - - core - admin_posts - r_editplugin - Edit Report Plugin - Изменение плагина жалоб - - core - admin_posts - r_pluginfile - Plugin File - Файл плагина - - core - admin_posts - r_save - Save - Сохранить - - core - admin_posts - r_authorurl - Author URL - URL адрес страницы автора - - core - admin_posts - r_authorname - Author Name - Автор - - core - admin_posts - r_description - Brief Description - Краткое описание - - core - admin_posts - r_version - Version - Версия - - core - admin_posts - r_whatcall - If you categorized reports by plugin, what would you call this section? - Как бы вы назвали жалобы этого плагина? - - core - admin_posts - r_rcpluginstitle - Report Center Plugins - Дополнения центра уведомлений - - core - admin_posts - r_registernew - Register New Report Plugin - Регистрация нового плагина системы жалоб - - core - admin_posts - r_plugintitle - Plugin Title - Название плагина - - core - admin_posts - r_removeimg - Remove Image... - Удалить изображение - - core - admin_posts - r_editimg - Edit Image... - Изменить изображение - - core - admin_posts - r_removestatus - Remove Status... - Удалить статус - - core - admin_posts - r_editstatus - Edit Status... - Изменить статус - - core - admin_posts - r_addimg - Add Image... - Добавить изображение - - core - admin_posts - r_active_report - Active Report - Активная жалоба - - core - admin_posts - r_complete_report - Complete Report - Завершить жалобу - - core - admin_posts - r_new_report - New Report - Новая жалоба - - core - admin_posts - r_newstatus - Create New Status... - Добавить статус - - core - admin_posts - r_repstatsev - - Статусы жалоб - - core - admin_posts - r_images - Images - Изображения - - core - admin_posts - r_position - Position - Позиция - - core - admin_posts - r_name - Name - Название - - core - admin_posts - r_removeplugin - Remove Plugin... - Удалить плагин - - core - admin_posts - r_plugindetails - Change Plugin Details... - Изменить плагин - - core - admin_posts - r_editsettings - Edit Settings... - Изменить - - core - admin_posts - r_toggleendis - Toggle Enabled/Disabled - Переключить - - core - admin_posts - r_regnew - Register New Plugin... - Зарегистрировать новый плагин - - core - admin_posts - r_enabled - Enabled - Включен - - core - admin_posts - r_author - Author - Автор - - core - admin_posts - r_regplugins - Registered Report Plugins - Зарегистрированные плагины жалоб - - core - admin_posts - r_options - Options - Опции - - core - admin_posts - r_points_sufix - Points - Баллов - - core - admin_posts - postform_badmd5 - Key did not match - Указан не верный ключ - - core - admin_posts - r_app - Application - Приложение - - core - admin_posts - r_galmod - Respect Gallery moderator rights? - Включить права Gallery ? - - core - admin_posts - r_dlmod - Respect Download Manager moderator rights? - Включить права Download Manager ? - - core - admin_posts - r_supermod - Super moderators can view all the reports? - Супермодераторы могут просматривать все жалобы плагина? - - core - admin_posts - r_supermod_info - This plugin uses moderator assignments to determine what reports a moderator can see and manage. By default if a member is a super moderator he/she can see all the reports. Turning this off means moderator assignments are used exclusively. - Плагин использует ограничения модераторов для определения какие жалобы они могут видеть. По умолчанию, если пользователь является супермодератором, то он может видеть все жалобы. Отключение этого приведет использованию ограничений модераторов. - - core - admin_posts - r_top5 - Top Five Moderators - Топ 5 модераторов - - core - admin_posts - r_last24 - Reports in the last 24 hours - Жалобы за последние 24 часа - - core - admin_posts - r_movedno - Report Status cannot be repositioned. - Статус жалобы не может быть изменен. - - core - admin_posts - r_statsaved - Status Saved - Статус сохранен - - core - admin_posts - r_mtp - - - - core - admin_posts - r_ppr - - «Баллов на жалобу» должно быть целым числом. - - core - admin_posts - r_statcreated - Status Created - Статус создан - - core - admin_posts - r_createnew - Create new status - Добавить статус - - core - admin_posts - r_statdel - Status Deleted - Статус удален - - core - admin_posts - r_invpar - Invalid Parameter - Неверный параметр - - core - admin_posts - r_onenew - - - - core - admin_posts - r_onecomplete - - - - core - admin_posts - r_statsever - - Статусы - - core - admin_posts - r_imgdel - Image Deleted - Изображение удалено - - core - admin_posts - r_changepoints - There is an image under this status using the same number of points. Please change the number of points. - Другое изображение уже используется с этим количеством очков. Измените количество очков. - - core - admin_posts - r_imgsaved - Image Saved - Изображение сохранено - - core - admin_posts - r_404status - You must enter a title for the status. - Нужно ввести название для этого статуса. - - core - admin_posts - r_newcomplete - - Невозможно установить статус «Новая», когда установлен статус «Завершена» - - core - admin_posts - r_completenew - - Невозможно установить статус «Завершена», когда установлен статус «Новая» - - core - admin_posts - r_plugmanager - Plugin Manager - Управление плагинами - - core - admin_posts - r_plugin_title - You can setup and manage your report center plugins in this section. - В этом разделе вы можете управлять плагинами жалоб, а также установить новые. - - core - admin_posts - r_dellocked - This plugin is locked. It cannot be deleted. - Плагин заблокирован и не может быть удален. - - core - admin_posts - r_deleteplug - Plugin Deleted - Плагин удален - - core - admin_posts - r_plugin404 - We could not find that plugin ID. Please try again. - Невозможно найти ID плагина. - - core - admin_posts - r_deleteair - - Нельзя удалить то, чего и так нет! - - core - admin_posts - r_finishplugin - Finish Plugin Settings - Закончить настройку плагина - - core - admin_posts - r_pluglocked - This plugin is locked. You cannot change this file. - Плагин заблокирован. Вы не можете изменить этот файл. - - core - admin_posts - r_plugupdated - Plugin Updated - Плагин обновлен - - core - admin_posts - r_plugnoexist - - Плагин не существует. - - core - admin_posts - r_plugincreate - Plugin Created - Плагин создан - - core - admin_posts - r_404file - Plugin file does not exist. - Файл плагина не существует. - - core - admin_posts - r_incchar - - - - core - admin_posts - r_noid - No ID was passed. Please try again. - ID не найден. - - core - admin_posts - r_toggle - Plugin Toggled - Плагин переключен. - - core - admin_posts - r_missingfield - Missing required fields. - Незаполнены обязательные поля. - - core - admin_posts - r_missing_file - You must enter a plugin filename - Не введено имя файла плагина - - core - admin_posts - r_missing_desc - You must enter a description - Вы не ввели описание - - core - admin_posts - r_missing_title - You must enter a plugin title - Вы не ввели название плагина - - core - admin_posts - rbadge_inactive_desc - This status is considered to be inactive and reports with this status will be not included in the count which shows at the top of the community to moderators. Click to toggle. - Этот статус означает, что жалоба неактивна и не будет учтена в счетчике на панели модераторов. - - core - admin_posts - rbadge_inactive - Inactive - Неактивный - - core - admin_posts - rbadge_active_desc - This status is considered to be active and reports with this status will be included in the count which shows at the top of the community to moderators. Click to toggle. - Этот статус активен и жалобы с этим статусом будут включены в счетчик, отображаемый в верхней части панели модераторов - - core - admin_posts - rbadge_active - Active - Активный - - core - admin_posts - rbadge_not_complete_desc - Click to make this the status given to reports which are considered to be completed and resolved. - Нажмите, чтобы присвоить этот статус жалобам, по которым приняты меры и нарушение устранено. - - core - admin_posts - rbadge_not_complete - Not Complete - Не завершена - - core - admin_posts - rbadge_complete_desc - This is the status given to reports which are considered to be completed and resolved. - Этот статус устанавливается жалобам, по которым приняты меры и нарушение устранено. - - core - admin_posts - rbadge_complete - Complete - Завершена - - core - admin_posts - rbadge_not_default_desc - Click to make this the default status which will be given to reports filed by users. - Нажмите, чтобы сделать этот статус статусом по умолчанию для жалоб пользователей. - - core - admin_posts - rbadge_default_desc - This is the default status which will be given to reports filed by users. - Это статус по умолчанию, который выдается жалобам отправленным пользователями. - - core - admin_posts - rbadge_default - Default - По умолчанию - - core - admin_posts - rbadge_not_default - Not Default - Не по умолчанию - - core - admin_posts - bwl_filter_edit - Edit Badword Filter... - Изменить - - core - admin_posts - bwl_filter_remove - Remove Badword Filter... - Удалить - - core - admin_posts - bwl_filter_add - Add New Filter - Добавить фильтр - - core - admin_posts - bwl_export - Export Badword List - Экспортировать фильтры - - core - admin_posts - bwl_import - Import Badword List - Импортировать фильтры - - core - admin_posts - bwl_import_upload - Upload XML Badword List]]> - Загрузка XML-файла с фильтрами]]> - - core - admin_posts - bwl_import_info - - - - core - admin_posts - bwl_after - After - Замена + core admin_posts bwl_method Method - Метод + core admin_posts - bwl_current - Current Filters - Список фильтров + r_statmanager + Status Manager + core admin_posts - bwl_options - Options - Опции + r_last24 + Reports in the last 24 hours + + + core + admin_posts + ctype__aboutme + About Me + + + core + admin_posts + ctype__signatures + Signatures + + + core + admin_posts + ctype__announcement + Announcements + core admin_posts ctype__rules Forum Rules - Правила форума + core admin_posts - bwl_before - Before - Слово + ctype__topics + Topics and Replies + core admin_posts - bwl_edit_filter - Edit Filter - Изменить фильтр + ctype__reports + Reported Content + core admin_posts - bwl_upload_good - The badword list has been imported! - Список фильтров успешно импортирован! + r_messages_enter + Groups that can add themselves to conversations + core admin_posts - bwl_exact - Exact - Точный + r_menter_desc + Specify which groups can add themselves to reported conversations + core admin_posts - bwl_loose - Loose - Маска + r_nostattitle + You must enter a status title + core admin_posts - bwl_upload_failed - Upload failed. The XML file is either missing or empty. Please try again. - Загрузка не удалась. XML файл не найден либо пуст. Попробуйте ещё раз. + r_minutes_info + How many minutes it takes to gain a single point. Points are used in displaying severity images. + core admin_posts - bwl_upload_wrong - The import failed. The XML file is either empty or in the wrong format. Please try again. - Невозможно выполнить импортирование, поскольку в XML файле ошибка или он не имеет записей. + r_minutes + Minutes to one point + core admin_posts - emote_deletefolder - Delete Folder... - Удалить + r_pointsper_info + How many points a single report worth. Points are used in displaying severity images. + core admin_posts - emote_manageset - Manage this emoticon set - Управление смайликами этого набора + r_create_status + Create Status + core admin_posts - bwl_nofilter - No filter ID passed. Please try again. - ID фильтра не найден. + r_edit_status + Edit Status + core admin_posts - bwl_filter_removed - Filter Removed! - Фильтр удален! + r_name_info + What would you like to call this status? + core admin_posts - bwl_noword - You must enter a word to replace. Please try again. - Необходимо ввести слово для замены. + r_pointsper + Points per report + core admin_posts - bwl_filter_edited - Filter Edited! - Фильтр изменен! + r_points_info + How many points are needed to display graphic. + core admin_posts - bwl_filter_404 - We could not find that filter in the database. - Фильтр не найден в базе данных + r_points + Points + core admin_posts - bwl_title - Badword List - Список нецензурных слов + r_image + Image + core admin_posts - bwl_filter_new - New badword filter has been added. - Фильтр добавлен. + r_image_info + <#IMG_DIR#> to use a graphic from the user skin]]> + core admin_posts - bwl_msg_long - The badword filter allows you to globally replace words from a members post, signature and topic title.

    Loose matching: If you entered 'hell' as a bad word, it will replace 'hell' and 'hello' with either your replacement if entered or 6 hashes (case insensitive)

    Exact matching: If you entered 'hell' as a bad word, it will replace 'hell' only with either your replacement if entered or 6 hashes (case insensitive)]]>
    - -Эти фильтры позволяют глобально заменять слова в сообщениях, подписях и названиях тем.

    -Фильтр по маске: Если вы ввели слово 'ад' как нецензурное, то слова 'ад' и 'администратор' будут заменены либо словом заменой либо решетками.

    -Точное совпадение: Если вы ввели слово 'ад' как нецензурное, то только слово 'ад' будет заменено. -
    Регистр символов не важен.]]>
    + r_confimage + Configure Image + core admin_posts - emote_dontdeletedef - The default emoticon set cannot be deleted - Невозможно удалить набор по умолчанию]]> + r_width + Width + core admin_posts - emote_uploademos - Upload Emoticons - Загрузка смайликов + r_height + Height + core admin_posts - emote_uploadtofolders - Upload Emoticons into checked folders - Загрузить смайлики в выбранные директории + r_pluginenabled + Plugin Enabled + core admin_posts - emote_createnew - Create New Folder - Создать новую директорию + r_groups_info + Specify what groups can view and manage reports by this plugin. Specific permissions are handled by the plugin itself. + core admin_posts - emote_num_group - # in Emoticon Group - № группы смайликов + r_safemode + Enable Safemode? (Cannot be deleted or edited by user) + core admin_posts - emote_num_disk - # in Emoticon Folder - № директории + r_groups_submit + Groups that can submit reports + core admin_posts - emote_upload - Upload? - Загрузка + r_groups_submit_info + Control which groups can submit reports in this plugin + core admin_posts - emote_emofolder - Emoticon Folder - Название директории + r_editplugin + Edit Report Plugin + core admin_posts - emote_options + r_groups + Groups that can view reports + + + core + admin_posts + r_save + Save + + + core + admin_posts + r_authorname + Author Name + + + core + admin_posts + r_authorurl + Author URL + + + core + admin_posts + r_pluginfile + Plugin File + + + core + admin_posts + r_version + Version + + + core + admin_posts + r_description + Brief Description + + + core + admin_posts + r_plugintitle + Plugin Title + + + core + admin_posts + r_whatcall + If you categorized reports by plugin, what would you call this section? + + + core + admin_posts + r_registernew + Register New Report Plugin + + + core + admin_posts + r_rcpluginstitle + Report Center Plugins + + + core + admin_posts + r_removeimg + Remove Image... + + + core + admin_posts + r_editimg + Edit Image... + + + core + admin_posts + r_removestatus + Remove Status... + + + core + admin_posts + r_editstatus + Edit Status... + + + core + admin_posts + r_addimg + Add Image... + + + core + admin_posts + r_active_report + Active Report + + + core + admin_posts + r_complete_report + Complete Report + + + core + admin_posts + r_newstatus + Create New Status... + + + core + admin_posts + r_new_report + New Report + + + core + admin_posts + r_position + Position + + + core + admin_posts + r_images + Images + + + core + admin_posts + r_removeplugin + Remove Plugin... + + + core + admin_posts + r_repstatsev + + + + core + admin_posts + r_regnew + Register New Plugin... + + + core + admin_posts + r_toggleendis + Toggle Enabled/Disabled + + + core + admin_posts + r_editsettings + Edit Settings... + + + core + admin_posts + r_plugindetails + Change Plugin Details... + + + core + admin_posts + r_enabled + Enabled + + + core + admin_posts + r_author + Author + + + core + admin_posts + r_name + Name + + + core + admin_posts + r_regplugins + Registered Report Plugins + + + core + admin_posts + r_options Options - Опции + core admin_posts - emote_current - Current Emoticon Folders - Текущие директории со смайликами + r_app + Application + core admin_posts - emote_foldername - Folder name (alphanumerics only)]]> - Название директории (только буквы и цифры) ]]> + r_points_sufix + Points + core admin_posts - emote_addfolder - Add Folder - Создать + postform_badmd5 + Key did not match + core admin_posts - emote_close - Close - Закрыть + r_top5 + Top Five Moderators + core admin_posts - emote_editfolder - Edit Folder Name... - Переименовать + r_supermod + Super moderators can view all the reports? + core admin_posts - emote_addall_button - Add All Emoticons - Добавить все + r_supermod_info + This plugin uses moderator assignments to determine what reports a moderator can see and manage. By default if a member is a super moderator he/she can see all the reports. Turning this off means moderator assignments are used exclusively. + core admin_posts - emote_add_button - Add Checked Emoticons - Добавить выбранные + r_galmod + Respect Gallery moderator rights? + core admin_posts - emote_add - Add? ]]> - Добавить? ]]> + r_dlmod + Respect Download Manager moderator rights? + core admin_posts - emote_unassigned_none - No unassigned emoticons - Нет неустановленных смайликов - - core - admin_posts - emote_unassigned - Unassigned Emoticons in set: - Список неустановленных смайликов в - - core - admin_posts - emote_update_button - Update Emoticons - Обновить - - core - admin_posts - emote_clickable - Clickable? - Нажимаемый? - - core - admin_posts - emote_delete_title - Remove this emoticon... - Удалить этот смайлик - - core - admin_posts - emote_assigned - Assigned Emoticons in set: - Список установленных смайликов в - - core - admin_posts - emote_import_button - Import - Импортировать - - core - admin_posts - emote_import_upload - Upload XML Emoticon Archive - Загрузка XML списка смайликов ]]> - - core - admin_posts - emote_import_browse - - - - core - admin_posts - emote_import_replace - If yes, new images replace old images. - Если выбрано «Да», новые изображения заменят старые. - - core - admin_posts - emote_import_over - Overwrite existing images and activation words? - Перезаписать существующие изображение и маркеры вызова смайликов?]]> - - core - admin_posts - emote_import_newgroup - OR Import into a new group named:]]> - ИЛИ Импортировать в новую директорию: ]]> - - core - admin_posts - emote_import_name - Enter the name of the new emoticon group. - Введите название новой директории смайликов. - - core - admin_posts - emote_import_which - Import into which emoticon group? - В какую существующую директорию произвести импортирование? ]]> - - core - admin_posts - emote_import - Import an Emoticon Pack - Импортирование директории - - core - admin_posts - emote_export - Export an Emoticon Pack - Экспорт директории - - core - admin_posts - emote_xml_pack - An IP.Board Emoticon Pack is an XML archive file of the images and activation words (i.e. :smile:) - Содержимое директории будет упаковано в XML-архив с изображениями и маркерами вызова смайликов (например :smile:) - - core - admin_posts - emote_export_button - Export - Экспортировать - - core - admin_posts - emote_export_which - Export which emoticon group? - Какую директорию смайликов экспортировать?]]> - - core - admin_posts - emo_does_NOT_describe - Keith J. Kacin - Keith J. Kacin - - core - admin_posts - emo_setclickable - Set Clickable... - Нажимаемый - - core - admin_posts - emo_manageemos - Manage Emoticons... - Менеджер смайликов - - core - admin_posts - emo_writeable_not - This folder is NOT writeable and the CHMOD must be changed - Запись в эту директорию невозможна. Пожалуйста, измените права доступа. - - core - admin_posts - emo_wecantdoit - IP.Board cannot rename this folder for you. - IP.Board не может переименовать эту директорию - - core - admin_posts - emo_control - Emoticon Control - Менеджер смайликов - - core - admin_posts - emo_manage_set - Managing Set - Управление смайликами - - core - admin_posts - emo_writeable - This folder is writeable and new emoticons can be added - Возможно добавление смайликов в эту директорию - - core - admin_posts - emo_folder_rename - Folder renamed. - Директория переименована. - - core - admin_posts - emo_miss_dir - Missing directory name, please try again. - Не хватает названия директории. Попробуйте снова. - - core - admin_posts - emo_folder_new - New folder added. - Директория добавлена. - - core - admin_posts - emo_mimes - You can only upload image files (jpeg, jpg, gif and png) - Возможна загрузка только файлов изображений (jpeg, jpg, gif и png) - - core - admin_posts - emo_complete - Uploads Complete! - Загрузка завершена! - - core - admin_posts - no_emo_selected - You did not select any files to upload - Вы не выбрали ни одного файла для загрузки - - core - admin_posts - emo_noset - No emoticon set was passed. - Набор смайликов не найден - - core - admin_posts - emo_norename - You cannot rename the default folder. - - - core - admin_posts - emo_folder_rem - Emoticon folder removed. - Директория смайликов удалена. - - core - admin_posts - emo_a_to_z - No valid folder name was entered, please try again using only alphanumerics (A-Z, a-z, 0-9) - Введено неверное имя директории. Используйте только буквы и цифры (A-Z, a-z, 0-9) - - core - admin_posts - emo_safemode - - - - core - admin_posts - emo_updated - Emoticons Updated! - Смайлики обновлены! - - core - admin_posts - emo_pickanother - - - - core - admin_posts - emo_removed - Emoticon Removed! - Смайлики удалены! - - core - admin_posts - emo_onlydothis - You may only add, edit, and remove emoticons from the default set - В наборе по умолчанию возможно только добавление, изменение и удаление смайликов - - core - admin_posts - emo_nogid - No emoticon group ID was passed - ID группы смайликов не найден - - core - admin_posts - emo_noid - No emoticon ID was passed - ID смайлика не найден - - core - admin_posts - emo_nolocate - - Невозможно найти директорию смайликов. Убедитесь, что путь к директории смайликов корректен. - - core - admin_posts - emo_specify - You must specify which emoticon group you wish to import into. - Вы должны указать в какую группу смайликов вы хотите осуществить импорт. - - core - admin_posts - emo_already - - - - core - admin_posts - emo_ftp - - - - core - admin_posts - emo_xml_good - Emoticon XML archive import completed. - Импорт XML файла смайликов завершен. - - core - admin_posts - emo_specify_ex - You must specify which emoticon group you wish to export. - Вы должны указать какую группу смайликов вы хотите экспортировать. - - core - admin_posts - emo_title - Emoticon Management - Управление смайликами - - core - admin_posts - emo_fail - Upload failed, ipb_emoticons.xml was either missing or empty. - - - core - admin_posts - emoticon_folder_name - Folder name: - Имя директории: - - core - admin_posts - media_exports - Export Media Tags... - Экспортировать - - core - admin_posts - media_delete - Delete Media Tag... - Удалить - - core - admin_posts - emoticon_folder - Emoticon Folder - Директория смайликов - - core - admin_posts - media_tag_title - Media Tag - Медиа-теги - - core - admin_posts - media_export - Export Media Tag... - Экспортировать - - core - admin_posts - media_import_button - Import - Импортировать - - core - admin_posts - media_upload_desc - Duplicate entries will not be imported - Существующие записи импортированы не будут. - - core - admin_posts - media_upload - Upload XML Media Tags - Загрузка XML списка медиа-тегов]]> - - core - admin_posts - media_import - Import New Media Tags - Импортировать новые медиа-теги - - core - admin_posts - media_name - Media - Медиа - - core - admin_posts - media_current - Current Media Tag Replacements - Медиа-теги - - core - admin_posts - media_title_info - Used as a reference for the tag - Используется во всплывающей подсказке медиа-тега - - core - admin_posts - media_match - Media Replacement Match - Медиа-тег - - core - admin_posts - media_match_info -
    Ex: http://www.test.com/23423/
    Match: http://www.test.com/{1}/]]>
    -
    Пример: http://www.test.com/23423/
    Совпадение: http://www.test.com/{1}/]]>
    - - core - admin_posts - media_html - Media Replacement HTML - Шаблон замены медиа-тега - - core - admin_posts - media_html_info -
    Ex: <a href="http://www.testm.com/$1/">$1</a>
    Result: <a href="http://www.testm.com/23423/">23423</a>]]>
    -
    Пример: <a href="http://www.testm.com/$1/">$1</a>
    Совпадение: <a href="http://www.testm.com/23423/">23423</a>]]>
    - - core - admin_posts - media_error - Form Error]]> - Ошибка формы ]]> - - core - admin_posts - media_title - Media Replacement Title - Название - - core - admin_posts - media_edit_replace - Edit Media Tag replacement - Изменить медиа-тег - - core - admin_posts - media_edit - Edit Media Tag... - Изменить - - core - admin_posts - media_add - Add Media Tag... - Добавить - - core - admin_posts - media_add_replace - Add Media Tag replacement - Добавить замену медиа-тега - - core - admin_posts - bbcode_contdial - - - - core - admin_posts - bbcode_contdial_info - - - - core - admin_posts - bbcode_protected - BBCode protected? - Защищенный BB-код ? - - core - admin_posts - bbcode_protected_info - Prevents users from being able to delete this BBCode - Не позволять пользователям удалять этот BB-код - - core - admin_posts - bbcode_optdial_info - - - - core - admin_posts - bbcode_optdial - - - - core - admin_posts - bbcode_whereused - Where can the BBCode be used? - Где BB-код может использоваться ? - - core - admin_posts - bbcode_assoc_app - BBCode Application - Приложение BB-кодов - - core - admin_posts - bbcode_whereused_info - You can enable and disable this BBCode in different sections individually - Можно включать или отключать этот BB-код в разных разделах по отдельности - - core - admin_posts - bbcode_image - BBCode Image - Изображение BB-кода - - core - admin_posts - bbcode_image_info - Button is used if populated, else bbcode is placed into editor other styles menu. - Если изображение указано, то оно будет отображаться в виде кнопки - - core - admin_posts - bbcode_image_info_loc - Image should be in public/style_extra/bbcode_icons - Изображение должно находиться в директории public/style_extra/bbcode_icons - - core - admin_posts - bbcode_groups - Which groups can use this BBCode? - Каким группам разрешено использовать этот код ? - - core - admin_posts - bbcode_groups_info - If none selected, no groups can use the BBCode - Если ничего не выбрано, ни одна ггруппа не может использовать BB-код - - core - admin_posts - bbcode_description - Custom BBCode Description - Полное описание - - core - admin_posts - bbcode_example - Custom BBCode Example - Пример использования - - core - admin_posts - bbcode_example_info - - Тег для примера: [tag]Здесь ваш пример![/tag]]]> - - core - admin_posts - bbcode_tag_info - tag]]> - tag]]> - - core - admin_posts - bbcode_aliases - Custom BBCode Aliases (Optional) - Псевдонимы (опционально) - - core - admin_posts - bbcode_aliases_info - - Список псевдонимов для данного тега (разделитель запятая) - - core - admin_posts - bbcode_singletag - Single Tag Only - Одиночный тег? - - core - admin_posts - bbcode_singletag_info - Example: [hr] to create a <hr /> HTML tag]]> - Пример: [hr] для HTML тега <hr />]]> - - core - admin_posts - bbcode_php_info_loc - - - - core - admin_posts - bbcode_php - OR PHP file to execute - ИЛИ PHP файл для исполнения - - core - admin_posts - bbcode_php_info - Useful if you need to perform regular expressions or conditional parsing]]> - Используйте когда необходимо использовать регулярные выражения или условную обработку]]> - - core - admin_posts - bbcode_replace - Custom BBCode Replacement - Шаблон замены BB-кода - - core - admin_posts - bbcode_replace_info - <tag thing='{option}'>{content}</tag>]]> - <tag>{content}</tag>
    <tag thing='{option}'>{content}</tag>]]>
    - - core - admin_posts - bbcode_noparse - Prevent other codes parsing? - Предотвращать разбор вложенных кодов ? - - core - admin_posts - bbcode_noparse_info - Prevents parsing of other BBCodes within this BBCode - Предотвращает обработку других BB-кодов внутри этого BB-кода - - core - admin_posts - bbcode_switch - Switch option and content? - Поменять option и content местами? - - core - admin_posts - bbcode_switch_info - - - - core - admin_posts - bbcode_optional_info - - Значение option необязательно? - - core - admin_posts - bbcode_optional - Option is optional? - option обязательно ? - - core - admin_posts - bbcode_useoption_info - - - - core - admin_posts - bbcode_useoption - Use Option in tag? - Использовать опции в теге? - - core - admin_posts - bbcode_useinguide - Used on the BBCode help guides - Используется на страницах помощи по BB-кодам - - core - admin_posts - bbcode_title_title - Custom BBCode Title - BB-код - - core - admin_posts - all_groups - All current and future groups - Все текущие и будущие группы - - core - admin_posts - available_sections - Available in all sections - Доступен во всех разделах - - core - admin_posts - bbcache_action - Drop all %s cached items? - Удалить кеш всех %s объектов? - - core - admin_posts - bbcache_desc - The content cache is enabled which means that any changes to this BBCode will not be automatically applied to previous posts unless you remove all cached content. - Задействовано кеширование содержимого, это значит, что любые изменения этого BB-кода не будут автоматически применены к предыдущим сообщениям до тех пор пока не будет удалено кешированное содержимое. - - core - admin_posts - bbcache_title - Content Cache Enabled - Кеширование содержимого включено - - core - admin_posts - custom_bbcode_head - Custom BBCode - Пользовательский BB-код - - core - admin_posts - export_bbcode_all - Export (Apps) - Экспорт в приложения - - core - admin_posts - import_bbcode_all - Import (Apps) - Импорт из приложений - - core - admin_posts - bbcode_header - Custom BBCodes - Пользовательские BB-коды - - core - admin_posts - delete_bbcode - Delete BBCode... - Удалить - - core - admin_posts - edit_bbcode - Edit BBCode... - Изменить BB-код - - core - admin_posts - export_bbcode - Export (XML) - Экспортировать - - core - admin_posts - addnew_bbcode - Add BBCode - Добавить - - core - admin_posts - upload_bbcode_dupe - Duplicate entries will not be imported - Существующие записи импортированы не будут. - - core - admin_posts - upload_bbcode_xml - Upload XML BBCode List - Загрузка XML списка BB-кодов ]]> - - core - admin_posts - import_new_bbcode - Import New BBCodes - Импортировать новые BB-коды - - core - admin_posts - bbcode_import - Import - Импортировать - - core - admin_posts - enter_test_parse - Enter the post content to test parse here - Введите текст для проверки - - core - admin_posts - test_parse - Test BBCode Parsing - Проверка работы BB-кодов - - core - admin_posts - bbcode_tag - Custom BBCode Tag - Тег - - core - admin_posts - bbcode_options - Options - Параметры - - core - admin_posts - add_edit - Add/Edit BBCode - Добавить/Изменить BB-код - - core - admin_posts - your_bbcodes - Your Custom BBcodes - Пользовательские BB-коды - - core - admin_posts - bbcode_title - Custom BBCode - BB-код - - core - admin_posts - m_tag_added - - - - core - admin_posts - m_error_replace - You must specify Media Tag replacement HTML.]]> - Вы должны ввести шаблон замены медиа-тега.]]> - - core - admin_posts - m_tag_updated - - - - core - admin_posts - m_manager - Media Tag Manager - Управление медиа-тегами - - core - admin_posts - m_error_match - You must specify a Media Tag match string.]]> - Необходимо указать строку совпадения медиа-тега.]]> - - core - admin_posts - m_error_name - You must specify a Media Tag replacement title.]]> - Вы должны ввести название медиа-тега]]> - - core - admin_posts - m_replace_removed - Media Tag replacement removed. - Медиа-тег удален - - core - admin_posts - m_import_complete - Media Tag XML file import completed - Импорт XML файла медиа-тегов завершен. - - core - admin_posts - m_upload_failed - Upload failed. The Media Tag XML file was missing, empty, or corrupted. - Загрузка не удалась. XML файл не найден или поврежден. - - core - admin_posts - new_bbcode - New BBCode Added - Дополнительный BB-код добавлен. - - core - admin_posts - edited_bbcode - Custom BBCode Edited - Дополнительный BB-код изменен. - - core - admin_posts - bbcode_test - BBCode Test:

    ]]>
    - Тест BBCode:

    ]]>
    - - core - admin_posts - must_use_content - - Для не одиночных BB-кодов необходимо использовать тег {content} - - core - admin_posts - complete_form - You must complete the form fully. - Вы должны заполнить форму полностью. - - core - admin_posts - tag_already - The tag you entered is already in use. - Тег уже используется в системе. - - core - admin_posts - no_bbcode_found_edit - We could not determine which BBCode you were attempting to edit. - Не удалось определить какой код вы хотите отредактировать. - - core - admin_posts - must_use_option - - Для BB-кодов с опциями необходимо использовать тег {option} + r_movedno + Report Status cannot be repositioned. + core admin_posts r_movedyes Report Status Repositioned - Статус жалобы изменен + + + core + admin_posts + r_mtp + + + + core + admin_posts + r_statsaved + Status Saved + + + core + admin_posts + r_ppr + + + + core + admin_posts + r_statcreated + Status Created + + + core + admin_posts + r_createnew + Create new status + + + core + admin_posts + r_statdel + Status Deleted + + + core + admin_posts + r_statsever + + + + core + admin_posts + r_imgdel + Image Deleted + + + core + admin_posts + r_changepoints + There is an image under this status using the same number of points. Please change the number of points. + + + core + admin_posts + r_imgsaved + Image Saved + + + core + admin_posts + r_404status + You must enter a title for the status. + + + core + admin_posts + r_newcomplete + + + + core + admin_posts + r_completenew + + + + core + admin_posts + r_invpar + Invalid Parameter + + + core + admin_posts + r_onenew + + + + core + admin_posts + r_onecomplete + + + + core + admin_posts + r_dellocked + This plugin is locked. It cannot be deleted. + + + core + admin_posts + r_deleteplug + Plugin Deleted + + + core + admin_posts + r_plugmanager + Plugin Manager + + + core + admin_posts + r_plugin_title + You can setup and manage your report center plugins in this section. + + + core + admin_posts + r_pluglocked + This plugin is locked. You cannot change this file. + + + core + admin_posts + r_plugin404 + We could not find that plugin ID. Please try again. + + + core + admin_posts + r_deleteair + + + + core + admin_posts + r_plugupdated + Plugin Updated + + + core + admin_posts + r_plugincreate + Plugin Created + + + core + admin_posts + r_toggle + Plugin Toggled + + + core + admin_posts + r_missingfield + Missing required fields. + + + core + admin_posts + r_incchar + + + + core + admin_posts + r_plugnoexist + + + + core + admin_posts + r_finishplugin + Finish Plugin Settings + + + core + admin_posts + r_404file + Plugin file does not exist. + + + core + admin_posts + r_noid + No ID was passed. Please try again. + + + core + admin_posts + r_missing_file + You must enter a plugin filename + + + core + admin_posts + r_missing_title + You must enter a plugin title + + + core + admin_posts + r_missing_desc + You must enter a description + + + core + admin_posts + rbadge_inactive_desc + This status is considered to be inactive and reports with this status will be not included in the count which shows at the top of the community to moderators. Click to toggle. + + + core + admin_posts + rbadge_active_desc + This status is considered to be active and reports with this status will be included in the count which shows at the top of the community to moderators. Click to toggle. + + + core + admin_posts + rbadge_active + Active + + + core + admin_posts + rbadge_inactive + Inactive + + + core + admin_posts + rbadge_complete + Complete + + + core + admin_posts + rbadge_not_complete + Not Complete + + + core + admin_posts + rbadge_complete_desc + This is the status given to reports which are considered to be completed and resolved. + + + core + admin_posts + rbadge_not_complete_desc + Click to make this the status given to reports which are considered to be completed and resolved. + + + core + admin_posts + bwl_import + Import Badword List + + + core + admin_posts + bwl_import_upload + Upload XML Badword List]]> + + + core + admin_posts + bwl_import_info + + + + core + admin_posts + rbadge_not_default_desc + Click to make this the default status which will be given to reports filed by users. + + + core + admin_posts + rbadge_default + Default + + + core + admin_posts + rbadge_not_default + Not Default + + + core + admin_posts + rbadge_default_desc + This is the default status which will be given to reports filed by users. + + + core + admin_posts + bwl_export + Export Badword List + + + core + admin_posts + bwl_filter_remove + Remove Badword Filter... + + + core + admin_posts + bwl_filter_edit + Edit Badword Filter... + + + core + admin_posts + bwl_options + Options + + + core + admin_posts + bwl_current + Current Filters + + + core + admin_posts + bwl_filter_add + Add New Filter + + + core + admin_posts + ctype__warn + Warn logs/notes + + + core + admin_posts + bwl_after + After + + + core + admin_posts + bwl_msg_long + The badword filter allows you to globally replace words from a members post, signature and topic title.

    Loose matching: If you entered 'hell' as a bad word, it will replace 'hell' and 'hello' with either your replacement if entered or 6 hashes (case insensitive)

    Exact matching: If you entered 'hell' as a bad word, it will replace 'hell' only with either your replacement if entered or 6 hashes (case insensitive)]]>
    +
    + + core + admin_posts + bwl_before + Before + + + core + admin_posts + bwl_edit_filter + Edit Filter + + + core + admin_posts + bwl_upload_good + The badword list has been imported! + + + core + admin_posts + bwl_upload_wrong + The import failed. The XML file is either empty or in the wrong format. Please try again. + + + core + admin_posts + bwl_upload_failed + Upload failed. The XML file is either missing or empty. Please try again. + + + core + admin_posts + bwl_exact + Exact + + + core + admin_posts + bwl_loose + Loose + + + core + admin_posts + bwl_filter_new + New badword filter has been added. + + + core + admin_posts + bwl_nofilter + No filter ID passed. Please try again. + + + core + admin_posts + bwl_filter_removed + Filter Removed! + + + core + admin_posts + bwl_noword + You must enter a word to replace. Please try again. + + + core + admin_posts + bwl_filter_edited + Filter Edited! + + + core + admin_posts + bwl_filter_404 + We could not find that filter in the database. + + + core + admin_posts + bwl_title + Badword List + + + core + admin_posts + emote_manageset + Manage this emoticon set + + + core + admin_posts + emote_dontdeletedef + The default emoticon set cannot be deleted + + + core + admin_posts + emote_deletefolder + Delete Folder... + + + core + admin_posts + emote_uploadtofolders + Upload Emoticons into checked folders + + + core + admin_posts + emote_uploademos + Upload Emoticons + + + core + admin_posts + emote_createnew + Create New Folder + + + core + admin_posts + emote_num_group + # in Emoticon Group + + + core + admin_posts + emote_upload + Upload? + + + core + admin_posts + emote_num_disk + # in Emoticon Folder + + + core + admin_posts + emote_emofolder + Emoticon Folder + + + core + admin_posts + emote_current + Current Emoticon Folders + + + core + admin_posts + emote_options + Options + + + core + admin_posts + emote_foldername + Folder name (alphanumerics only)]]> + + + core + admin_posts + emote_close + Close + + + core + admin_posts + emote_editfolder + Edit Folder Name... + + + core + admin_posts + emote_addfolder + Add Folder + + + core + admin_posts + emote_addall_button + Add All Emoticons + + + core + admin_posts + emote_add_button + Add Checked Emoticons + + + core + admin_posts + emote_add + Add? ]]> + + + core + admin_posts + emote_unassigned_none + No unassigned emoticons + + + core + admin_posts + emote_unassigned + Unassigned Emoticons in set: + + + core + admin_posts + emote_clickable + Clickable? + + + core + admin_posts + emote_update_button + Update Emoticons + + + core + admin_posts + emote_delete_title + Remove this emoticon... + + + core + admin_posts + emote_import_button + Import + + + core + admin_posts + emote_assigned + Assigned Emoticons in set: + + + core + admin_posts + emote_import_upload + Upload XML Emoticon Archive + + + core + admin_posts + emote_import_browse + + + + core + admin_posts + emote_import_over + Overwrite existing images and activation words? + + + core + admin_posts + emote_import_replace + If yes, new images replace old images. + + + core + admin_posts + emote_import_name + Enter the name of the new emoticon group. + + + core + admin_posts + emote_export_button + Export + + + core + admin_posts + emote_xml_pack + An IP.Board Emoticon Pack is an XML archive file of the images and activation words (i.e. :smile:) + + + core + admin_posts + emote_import_newgroup + OR Import into a new group named:]]> + + + core + admin_posts + emote_import_which + Import into which emoticon group? + + + core + admin_posts + emote_import + Import an Emoticon Pack + + + core + admin_posts + emote_export_which + Export which emoticon group? + + + core + admin_posts + emote_export + Export an Emoticon Pack + + + core + admin_posts + emo_writeable_not + This folder is NOT writeable and the CHMOD must be changed + + + core + admin_posts + emo_manageemos + Manage Emoticons... + + + core + admin_posts + emo_setclickable + Set Clickable... + + + core + admin_posts + emo_does_NOT_describe + Keith J. Kacin + + + core + admin_posts + emo_writeable + This folder is writeable and new emoticons can be added + + + core + admin_posts + emo_control + Emoticon Control + + + core + admin_posts + emo_manage_set + Managing Set + + + core + admin_posts + emo_wecantdoit + IP.Board cannot rename this folder for you. + + + core + admin_posts + emo_miss_dir + Missing directory name, please try again. + + + core + admin_posts + emo_folder_rename + Folder renamed. + + + core + admin_posts + emo_safemode + + + + core + admin_posts + emo_folder_new + New folder added. + + + core + admin_posts + emo_a_to_z + No valid folder name was entered, please try again using only alphanumerics (A-Z, a-z, 0-9) + + + core + admin_posts + emo_folder_rem + Emoticon folder removed. + + + core + admin_posts + emo_norename + You cannot rename the default folder. + + + core + admin_posts + no_emo_selected + You did not select any files to upload + + + core + admin_posts + emo_noset + No emoticon set was passed. + + + core + admin_posts + emo_pickanother + + + + core + admin_posts + emo_mimes + You can only upload image files (jpeg, jpg, gif and png) + + + core + admin_posts + emo_complete + Uploads Complete! + + + core + admin_posts + emo_removed + Emoticon Removed! + + + core + admin_posts + emo_updated + Emoticons Updated! + + + core + admin_posts + emo_nogid + No emoticon group ID was passed + + + core + admin_posts + emo_noid + No emoticon ID was passed + + + core + admin_posts + emo_onlydothis + You may only add, edit, and remove emoticons from the default set + + + core + admin_posts + emo_specify_ex + You must specify which emoticon group you wish to export. + + + core + admin_posts + emo_title + Emoticon Management + + + core + admin_posts + emo_nolocate + + + + core + admin_posts + emo_xml_good + Emoticon XML archive import completed. + + + core + admin_posts + emo_already + + + + core + admin_posts + emo_ftp + + + + core + admin_posts + emo_specify + You must specify which emoticon group you wish to import into. + + + core + admin_posts + emo_fail + Upload failed, ipb_emoticons.xml was either missing or empty. + + + core + admin_posts + emoticon_folder_name + Folder name: + + + core + admin_posts + emoticon_folder + Emoticon Folder + + + core + admin_posts + media_delete + Delete Media Tag... + + + core + admin_posts + media_tag_title + Media Tag + + + core + admin_posts + media_exports + Export Media Tags... + + + core + admin_posts + media_import_button + Import + + + core + admin_posts + media_export + Export Media Tag... + + + core + admin_posts + media_upload + Upload XML Media Tags + + + core + admin_posts + media_upload_desc + Duplicate entries will not be imported + + + core + admin_posts + media_import + Import New Media Tags + + + core + admin_posts + media_current + Current Media Tag Replacements + + + core + admin_posts + media_name + Media + + + core + admin_posts + media_html + Media Replacement HTML + + + core + admin_posts + media_html_info +
    Ex: <a href="http://www.testm.com/$1/">$1</a>
    Result: <a href="http://www.testm.com/23423/">23423</a>]]>
    +
    + + core + admin_posts + media_title + Media Replacement Title + + + core + admin_posts + media_title_info + Used as a reference for the tag + + + core + admin_posts + media_match + Media Replacement Match + + + core + admin_posts + media_match_info +
    Ex: http://www.test.com/23423/
    Match: http://www.test.com/{1}/]]>
    +
    + + core + admin_posts + media_error + Form Error]]> + + + core + admin_posts + media_edit_replace + Edit Media Tag replacement + + + core + admin_posts + media_edit + Edit Media Tag... + + + core + admin_posts + media_add + Add Media Tag... + + + core + admin_posts + media_add_replace + Add Media Tag replacement + + + core + admin_posts + bbcode_contdial + + + + core + admin_posts + bbcode_protected_info + Prevents users from being able to delete this BBCode + + + core + admin_posts + ctype__pms + Private Messages + + + core + admin_posts + bbcode_contdial_info + + + + core + admin_posts + bbcode_assoc_app + BBCode Application + + + core + admin_posts + bbcode_whereused_info + You can enable and disable this BBCode in different sections individually + + + core + admin_posts + bbcode_protected + BBCode protected? + + + core + admin_posts + bbcode_optdial_info + + + + core + admin_posts + bbcode_optdial + + + + core + admin_posts + bbcode_image_info_loc + Image should be in public/style_extra/bbcode_icons + + + core + admin_posts + bbcode_image + BBCode Image + + + core + admin_posts + bbcode_image_info + Button is used if populated, else bbcode is placed into editor other styles menu. + + + core + admin_posts + bbcode_whereused + Where can the BBCode be used? + + + core + admin_posts + bbcode_groups + Which groups can use this BBCode? + + + core + admin_posts + bbcode_groups_info + If none selected, no groups can use the BBCode + + + core + admin_posts + bbcode_php_info + Useful if you need to perform regular expressions or conditional parsing]]> + + + core + admin_posts + bbcode_replace + Custom BBCode Replacement + + + core + admin_posts + bbcode_noparse_info + Prevents parsing of other BBCodes within this BBCode + + + core + admin_posts + bbcode_php_info_loc + + + + core + admin_posts + bbcode_php + OR PHP file to execute + + + core + admin_posts + bbcode_replace_info + <tag thing='{option}'>{content}</tag>]]> + + + core + admin_posts + bbcode_noparse + Prevent other codes parsing? + + + core + admin_posts + bbcode_useoption + Use Option in tag? + + + core + admin_posts + bbcode_useoption_info + + + + core + admin_posts + bbcode_optional + Option is optional? + + + core + admin_posts + bbcode_optional_info + + + + core + admin_posts + bbcode_switch + Switch option and content? + + + core + admin_posts + bbcode_switch_info + + + + core + admin_posts + bbcode_aliases_info + + + + core + admin_posts + bbcode_singletag + Single Tag Only + + + core + admin_posts + bbcode_singletag_info + Example: [hr] to create a <hr /> HTML tag]]> + + + core + admin_posts + bbcode_aliases + Custom BBCode Aliases (Optional) + + + core + admin_posts + bbcode_tag_info + tag]]> + + + core + admin_posts + bbcode_example_info + + + + core + admin_posts + bbcode_example + Custom BBCode Example + + + core + admin_posts + bbcode_description + Custom BBCode Description + + + core + admin_posts + bbcode_useinguide + Used on the BBCode help guides + + + core + admin_posts + available_sections + Available in all sections + + + core + admin_posts + bbcode_title_title + Custom BBCode Title + + + core + admin_posts + all_groups + All current and future groups + + + core + admin_posts + bbcache_action + Drop all %s cached items? + + + core + admin_posts + bbcache_desc + The content cache is enabled which means that any changes to this BBCode will not be automatically applied to previous posts unless you remove all cached content. + + + core + admin_posts + bbcache_title + Content Cache Enabled + + + core + admin_posts + custom_bbcode_head + Custom BBCode + + + core + admin_posts + export_bbcode_all + Export (Apps) + + + core + admin_posts + import_bbcode_all + Import (Apps) + + + core + admin_posts + bbcode_header + Custom BBCodes + + + core + admin_posts + delete_bbcode + Delete BBCode... + + + core + admin_posts + edit_bbcode + Edit BBCode... + + + core + admin_posts + addnew_bbcode + Add BBCode + + + core + admin_posts + export_bbcode + Export (XML) + + + core + admin_posts + import_new_bbcode + Import New BBCodes + + + core + admin_posts + upload_bbcode_xml + Upload XML BBCode List + + + core + admin_posts + upload_bbcode_dupe + Duplicate entries will not be imported + + + core + admin_posts + bbcode_import + Import + + + core + admin_posts + enter_test_parse + Enter the post content to test parse here + + + core + admin_posts + test_parse + Test BBCode Parsing + + + core + admin_posts + bbcode_tag + Custom BBCode Tag + + + core + admin_posts + bbcode_options + Options + + + core + admin_posts + add_edit + Add/Edit BBCode + + + core + admin_posts + your_bbcodes + Your Custom BBcodes + + + core + admin_posts + bbcode_title + Custom BBCode + + + core + admin_posts + m_tag_updated + + + + core + admin_posts + m_tag_added + + + + core + admin_posts + m_manager + Media Tag Manager + + + core + admin_posts + m_error_replace + You must specify Media Tag replacement HTML.]]> + + + core + admin_posts + m_error_match + You must specify a Media Tag match string.]]> + + + core + admin_posts + m_error_name + You must specify a Media Tag replacement title.]]> + + + core + admin_posts + m_replace_removed + Media Tag replacement removed. + + + core + admin_posts + m_import_complete + Media Tag XML file import completed + + + core + admin_posts + bbcode_test + BBCode Test:

    ]]>
    +
    + + core + admin_posts + no_bbcode_found_edit + We could not determine which BBCode you were attempting to edit. + + + core + admin_posts + tag_already + The tag you entered is already in use. + + + core + admin_posts + new_bbcode + New BBCode Added + + + core + admin_posts + m_upload_failed + Upload failed. The Media Tag XML file was missing, empty, or corrupted. + + + core + admin_posts + must_use_content + + + + core + admin_posts + must_use_option + + + + core + admin_posts + complete_form + You must complete the form fully. + + + core + admin_posts + edited_bbcode + Custom BBCode Edited + core admin_posts no_bbcode_found_delete We could not find the BBCode you were attempting to delete. - Не удалось определить какой код вы хотите удалить. + core admin_posts import_complete BBCode XML file import completed. - Импорт XML файла BB-кода завершен. - - core - admin_posts - bbcode_import_app - %s: %s BBcode inserted, %s updated - %s: %s BB-кодов добавлено, %s обновлено - - core - admin_posts - upload_failed - Upload failed. The BBCode XML file was missing, empty, or corrupted. - Загрузка не удалась. XML файл с BB-кодами либо пуст, либо содержит неверную структуру. - - core - admin_posts - bbcode_customregex - Option Regular Expression Filter - Фильтр с использованием регулярных выражений - - core - admin_posts - bbcode_customregex_info - Use this field to define a regular expression to filter the option content through before outputting to the page. If option value does not match expression, tag will not be parsed. - Используйте данное поле, чтобы указать регулярное выражение, при помощи которого будет осуществляться фильтрация содержимого, заключенного в теги бб-кода, при выводе. Если содержимое не удовлетворяет выражению, тег не будет обработан. + core admin_posts must_use_unique_btag You must supply a unique bbcode tag. - Необходимо использовать уникальное значение для bb-код тега. + + + core + admin_posts + bbcode_customregex + Option Regular Expression Filter + + + core + admin_posts + bbcode_customregex_info + Use this field to define a regular expression to filter the option content through before outputting to the page. If option value does not match expression, tag will not be parsed. + + + core + admin_posts + bbcode_import_app + %s: %s BBcode inserted, %s updated + + + core + admin_posts + upload_failed + Upload failed. The BBCode XML file was missing, empty, or corrupted. + core admin_posts tag_already_alias %s]]> - %s]]> + core admin_posts bbcode_alpha_num You may only use alpha-numeric characters in the bbcode tag and aliases - В теге bb-кода можно использовать только цифры и буквы - - core - admin_posts - pointssuffix - Points - баллов + core admin_posts emote_impexpo Import / Export - Импорт / Экспорт + core admin_posts emodir_not_write All of your emoticon directories must be writable in order to import an emoticon pack. The following folder is not writable: %s - Все директории для размещения смайликов должны иметь право на запись. Следующая директория таких прав не имеет: %s + core - admin_security - skin_th_name - Name - Пользователь - - core - admin_security - skin_th_filesize - - - - core - admin_security - skin_suspicious_files - Suspicious Files - Подозрительные файлы + admin_posts + pointssuffix + Points + core admin_security skin_header_virus Unauthorized File Checked Folders - Проверенные директории + + + core + admin_security + skin_th_filesize + + + + core + admin_security + skin_suspicious_files + Suspicious Files + core admin_security skin_edit_member Edit - Изменить + core admin_security skin_th_posts Posts - Сообщений + core admin_security skin_th_email Email Address - E-mail адрес - - core - admin_security - skin_th_ip - IP Address - IP адрес - - core - admin_security - skin_th_primary_group - Primary Group - Основная группа + core admin_security skin_th_secondary_group Secondary Groups - Второстепенная группа + + + core + admin_security + skin_th_name + Name + + + core + admin_security + skin_th_ip + IP Address + + + core + admin_security + skin_th_primary_group + Primary Group + core admin_security skin_header_admins Members With ACP Access - Пользователи, имеющие доступ в АЦ - - core - admin_security - sec_change_the_line_define_cp_dire - admin with your directory name.]]> - define( 'CP_DIRECTORY', 'admin' );
    на
    define( 'CP_DIRECTORY', 'admin_secret' );
    ]]> + core admin_security sec_your_cp_directory_has_now_been Your ACP directory has now been renamed. - Теперь директория вашего админцентра изменена. + core admin_security - sec_renaming_the_cp_sitecontrol_di - - Изменение директории АЦ + sec_change_the_line_define_cp_dire + admin with your directory name.]]> + core admin_security sec_ipboard_has_a_dedicated_direct IP.Board has a dedicated directory for the administration center. To further enhance security, you can rename this ACP directory. - Invision Power Board обнаружил директорию админцентра. В целях повышения безопасности, вы можете изменить эту директорию. - - core - admin_security - sec_step_2 - Step 2: - Шаг 2: - - core - admin_security - sec_first_youll_need_to_physically - - + core admin_security sec_locate_the_initdataphp_file_th - - - core - admin_security - sec_step_1 - Step 1: - Шаг 1: - - core - admin_security - sec_cp_htaccess_protection - ACP .htaccess protection - - - core - admin_security - sec_ipboard_is_unable_to_write_int - IP.Board is unable to write into your admin directory - IP.Board не может создать файл в директории администратора + core admin_security sec_locate_the_admin_directory_cho - + + + core + admin_security + sec_renaming_the_cp_sitecontrol_di + + + + core + admin_security + sec_step_1 + Step 1: + + + core + admin_security + sec_step_2 + Step 2: + + + core + admin_security + sec_first_youll_need_to_physically + + core admin_security sec_please_create_a_file_called_ht_1 - + + + core + admin_security + sec_cp_htaccess_protection + ACP .htaccess protection + + + core + admin_security + sec_ipboard_is_unable_to_write_int + IP.Board is unable to write into your admin directory + core admin_security sec_please_create_a_file_called_ht - + core admin_security sec_proceed Proceed - Создать файл - - core - admin_security - sec_username - Username - Имя пользователя + core admin_security sec_password Password - Пароль + core admin_security sec_using_this_tool_will_overwrite Using this tool will overwrite any current protection in your admin directory. You will also be required to enter the username and password immediately after saving. - Используя этот инструмент, вы перезапишите любой имеющийся файл защиты в директории админцентра. После сохранения данных, вам будет предложено ввести указанные имя пользователя и пароль. Хотим заметить, что если вы переименуете директорию админцентра, вам так же будет необходимо удалить этот файл при помощи FTP-клиента — в противном случае доступ в админцентр для вас будет заблокирован. + + + core + admin_security + sec_username + Username + core admin_security sec_please_note Please note - Помните - - core - admin_security - sec_the_security_center_is_a_centr - The Security Center is a centralized repository of security tools and settings. - Центр безопасности — это хранилище инструментов и настроек, отвечающих за безопасность форума. - - core - admin_security - sec_your_installation_is_checked_a - Your installation is checked and suggestions are made on how to improve the security of your community. - При помощи настроек и инструментов ниже вы сможете проверить и повысить безопасность вашего IPB. - - core - admin_security - sec_acp_htaccess_protection - ACP .htaccess protection - - - core - admin_security - sec_invision_power_board_can_write - IP.Board can write .htaccess protection into your admin directory. - + core admin_security sec_information information - информация + + + core + admin_security + sec_acp_htaccess_protection + ACP .htaccess protection + + + core + admin_security + sec_invision_power_board_can_write + IP.Board can write .htaccess protection into your admin directory. + + + core + admin_security + sec_the_security_center_is_a_centr + The Security Center is a centralized repository of security tools and settings. + + + core + admin_security + sec_your_installation_is_checked_a + Your installation is checked and suggestions are made on how to improve the security of your community. + core admin_security sec_ipboard_security_center IP.Board Security Center - Центр безопасности IP.Board - - core - admin_security - sec_modified_in_the_past_30_days - Modified in the past 30 days - измененные за последние 30 дней - - core - admin_security - sec_executable_files - Executable Files - Исполняемые файлы - - core - admin_security - sec_file_size - (File Size) - (размер файла) + core admin_security sec_last_modified Last Modified - Последнее изменение + + + core + admin_security + sec_file_size + (File Size) + + + core + admin_security + sec_executable_files + Executable Files + + + core + admin_security + sec_modified_in_the_past_30_days + Modified in the past 30 days + core admin_security sec_files_55k_or_larger Files 55k or larger - файлы размером свыше 55k + core admin_security sec_score_9_or_more Score 9 or more - с рейтингом 9 или выше + core admin_security sec_score_8_or_more Score 8 or more - с рейтингом 8 или выше + core admin_security sec_score_7_or_more Score 7 or more - с рейтингом 7 или выше + core admin_security sec_score_6_or_more Score 6 or more - с рейтингом 6 или выше + core admin_security sec_show_all Show All - все + core admin_security sec_score_5_or_more Score 5 or more - с рейтингом 5 или выше + core admin_security sec_show Show - Показать + core admin_security sec_filter Filter - Фильтр + core admin_security h3_title_security Security Tools Available - Доступные инструменты + core admin_seo sitemaplog_time Time - Время - - core - admin_seo - sitemaplog_action - Action - Действие + core admin_seo sitemaplog_lastran Last Run: %s - Посл. запуск: %s + core admin_seo - ipseo_upgrade_intro -
    If you did not previously set up a cron for generating your sitemap
    You can safely click the continue button below and the IPS Community Suite will continue to generate your sitemap.

    ]]>
    -
    Если вы не настраивали cron для запуска генератора sitemap
    Вы можете просто нажать Продолжить и IPS Community Suite создаст sitemap.

    ]]>
    - - core - admin_seo - ipseo_upgrade_title - Important information about IP.SEO - Важная информация об IP.SEO + sitemaplog_action + Action + core admin_seo sitemaplog_log Log - Журнал + core admin_seo - sitemaplog_title - Sitemap: Last Run - Sitemap: последний запуск + task_path_not_write + The sitemap generator task could not complete. You must create a sitemap.xml file in your board root directory (where conf_global.php is) and then ensure it is fully writable. + + + core + admin_seo + spiders_none + There are no results to display. + + + core + admin_seo + ipseo_upgrade_intro +
    If you did not previously set up a cron for generating your sitemap
    You can safely click the continue button below and the IPS Community Suite will continue to generate your sitemap.

    ]]>
    +
    + + core + admin_seo + spiders_spider + Spider + core admin_seo spiders_date Date - Дата - - core - admin_seo - spiders_page - Page - Страница - - core - admin_seo - visitors_page - Page Found - Страница Найдена - - core - admin_seo - visitors_none - There are no results to display. - Нет данных для отображения. + core admin_seo visitors_engine Search Engine - Движок + + + core + admin_seo + visitors_page + Page Found + core admin_seo visitors_keywords Search Keywords - Ключевые слова - - core - admin_seo - visitors_date - Date - Дата - - core - admin_seo - visitors_member - Member - Пользователь - - core - admin_seo - visitors_title - Search Visitors - Посетители + core admin_seo visitors_blurb This page shows you the users who found your community by a search engine - Эта страница отображает пользователей, нашедших ваш форум через поисковые машины + core admin_seo - keywords_blurb - This page shows you the most popular keywords that users search for to find your community. - На этой странице показаны самые популярные ключевые слова, по которым посетители находят ваш форум. + visitors_title + Search Visitors + core admin_seo keywords_count Hits - Попаданий + core admin_seo keywords_none There are no results to display. - Нет данных + core admin_seo keywords_keyword Keyword - Ключевое слово + core admin_seo keywords_title Search Keywords - Ключевые слова + core admin_seo - dashboard_graphs_month - Last 28 Days - За 28 дней - - core - admin_seo - dashboard_graphs_date - Graph Range - Временной Отрезок - - core - admin_seo - dashboard_graphs_day - Last 24 Hours - За 24 часа + keywords_blurb + This page shows you the most popular keywords that users search for to find your community. + core admin_seo dashboard_graphs_week Last 7 Days - За 7 дней + core admin_seo - dashboard_spiders - Latest Spider Hits - Последние попадания ботов + dashboard_graphs_month + Last 28 Days + core admin_seo - err_no_page - You did not specify a page URI - Вы не указали URI + dashboard_graphs_day + Last 24 Hours + + + core + admin_seo + dashboard_graphs_date + Graph Range + core admin_seo dashboard_all - + core admin_seo dashboard_keywords Top Search Keywords - Топ ключевых слов + core admin_seo - dashboard_visitors - Latest Search Visitors - Последние посетители + dashboard_spiders + Latest Spider Hits + core admin_seo dashboard_title Dashboard - Панель управления + + + core + admin_seo + dashboard_visitors + Latest Search Visitors + + + core + admin_seo + err_no_page + You did not specify a page URI + core admin_seo meta_magic Launch Live Meta Tag Editor - Запустить редактор мета-тэгов онлайн - - core - admin_seo - meta_save - Save - Сохранить - - core - admin_seo - meta_tag_add - Add Tag - Добавить + core admin_seo meta_tag_edit Edit Tag - Редактировать + core admin_seo - meta_tag_title_desc - - + meta_save + Save + + + core + admin_seo + meta_tag_add + Add Tag + core admin_seo meta_tag_content Content - Содержимое + + + core + admin_seo + meta_tag_title_desc + + core admin_seo meta_tag_title Title - Название + core admin_seo meta_tags Meta Tags - Мета-тэг - - core - admin_seo - meta_add - Add Meta Tags - Добавить - - core - admin_seo - meta_none - You do not have any meta tags set up yet. - Вы еще не настроили ни одного мета-тэга - - core - admin_seo - meta_none_add - Click here to set up meta tags. - Нажмите здесь, чтобы настроить мета-тэги. - - core - admin_seo - meta_page_desc -
    You may use * as a wildcard, for example entering '/user/*' will allow you to specify meta tags to show on all user profiles.]]>
    -
    Вы можете использовать * как символ подстановки, например, введите '/user/*' , и мета-тэги будут вставлены во все профили пользователей.]]>
    - - core - admin_seo - meta_page - Page URI - URI страницы - - core - admin_seo - meta_blurb - This page allows you to set up meta tags to display on certain areas of your community. - На этой странице можно настроить мета-тэги для включения в определенные страницы и разделы вашего сообщества. - - core - admin_seo - atn_seo_r_on_title - FURL Redirect Not Enabled - Перенаправление ЧПУ Отключено + core admin_seo atn_seo_r_on_desc You have not enabled redirects from old style URLs to new FURLs. - Вы не включили перенаправление старых URL на человекопонятные адреса. + core admin_seo - atn_htaccess_mod_rewrite_title - .htaccess mod_rewrite FURLs disabled - .htaccess mod_rewrite не используется + meta_page_desc +
    You may use * as a wildcard, for example entering '/user/*' will allow you to specify meta tags to show on all user profiles.]]>
    + core admin_seo - atn_htaccess_mod_rewrite_desc - You are currently not using .htaccess style FURLs. - Вы не используете .htaccess mod_rewrite для формирования ЧПУ + meta_page + Page URI + + + core + admin_seo + meta_none_add + Click here to set up meta tags. + + + core + admin_seo + meta_none + You do not have any meta tags set up yet. + core admin_seo meta_title Meta Tags - Мета Тэги + core admin_seo - atn_ipseo_no_meta_desc - You have not defined any custom meta tags. - Вы не задали ни одного мета-тэга + meta_blurb + This page allows you to set up meta tags to display on certain areas of your community. + core admin_seo - atn_sitemap_ping_title - Sitemap Ping Disabled - Поисковики не извещаются об обновлениях + meta_add + Add Meta Tags + core admin_seo - atn_sitemap_ping_desc - You have set the sitemap generator to not ping the search engines when updated, this is not advisable. - Вы не используетете генератор sitemap для извещение поисковиков об обновлениях. Это не рекомендуется. + atn_htaccess_mod_rewrite_desc + You are currently not using .htaccess style FURLs. + core admin_seo - atn_spider_visit_desc - We cannot generate spider visit charts and statistics without this enabled. - Невозможно создавать графики и статистические отчеты буз журналирования действий поисковиков. + atn_htaccess_mod_rewrite_title + .htaccess mod_rewrite FURLs disabled + core admin_seo - atn_ipseo_no_meta_title - No Meta Tags Defined - Не заданы мета-тэги - - core - admin_seo - atn_sitemap_not_run_desc - The sitemap generator has not yet been run. - Генератор файла sitemap еще не запускался. + atn_seo_r_on_title + FURL Redirect Not Enabled + core admin_seo atn_sitemap_not_run_title Sitemap Not Generated Yet - Не создана карта сайта(sitemap) + core admin_seo - atn_spider_group_desc - You are treating spiders as a member of a different group than your guest group - This will lead to search engines seeing the board differently than guests, also known as cloaking. - Вы разделяете поисковых ботов и гостей по разным группам, это приводит к тому, что поисковики и гости видят ваш форум по разному. Это называется клоакинг(cloaking) и может повлечь санкции со стороны поисковых машин. + atn_sitemap_not_run_desc + The sitemap generator has not yet been run. + + + core + admin_seo + atn_ipseo_no_meta_title + No Meta Tags Defined + + + core + admin_seo + atn_ipseo_no_meta_desc + You have not defined any custom meta tags. + + + core + admin_seo + atn_sitemap_ping_title + Sitemap Ping Disabled + + + core + admin_seo + atn_sitemap_ping_desc + You have set the sitemap generator to not ping the search engines when updated, this is not advisable. + core admin_seo atn_spider_group_title Spiders Not Treated as Guests - Поисковые роботы не входят в группу гостей + core admin_seo - atn_spider_visit_title - Not Logging Spider Visits - Не ведется журнал посещения поисковиков + atn_spider_group_desc + You are treating spiders as a member of a different group than your guest group - This will lead to search engines seeing the board differently than guests, also known as cloaking. + core admin_seo - atn_seo_index_md_desc - You have not defined a meta description for your Board Index. - Вы не задали мета-описание(description) главной странице форума. + atn_spider_visit_desc + We cannot generate spider visit charts and statistics without this enabled. + core admin_seo atn_seo_index_md_title No Board Index Description - Нет описания главной страницы + core admin_seo - atn_url_type_title - Query String FURLs - ЧПУ типа "запрос" + atn_seo_index_md_desc + You have not defined a meta description for your Board Index. + core admin_seo - atn_url_type_desc - You are currently using query string based FURLs. The advised setting is Path Info. - На вашем форуме используются ЧПУ типа "запрос". Рекомендуется использовать тип "путь" - - core - admin_seo - atn_seo_bad_url_title - Bad Links Not Redirected - Ошибочные ссылки не перенаправляются - - core - admin_seo - atn_seo_bad_url_desc - - - - core - admin_seo - atn_seo_index_title_title - No Board Index Title - Не задан заголовок главной страницы + atn_spider_visit_title + Not Logging Spider Visits + core admin_seo atn_seo_index_title_desc You have not defined a title tag for your Board Index. - Вы не задали Title главной странице. + + + core + admin_seo + atn_seo_index_title_title + No Board Index Title + + + core + admin_seo + atn_seo_bad_url_desc + + + + core + admin_seo + atn_url_type_desc + You are currently using query string based FURLs. The advised setting is Path Info. + + + core + admin_seo + atn_seo_bad_url_title + Bad Links Not Redirected + core admin_seo atn_sitemap_path_desc We were unable to locate a sitemap.xml file in your specified sitemap location. Click the fix button to download a blank sitemap.xml file and upload it to your forum root (or the custom path specified in the sitemap settings) and ensure it can be written to (CHMOD 0777). - Не удалось найти файл sitemap.xml по указанному в настройках пути. Нажмите на кнопку "исправить" и скачайте чистый файл sitemap.xml. Скопируйте его на сервер в корень форума или в указанную вами в настройках папку. Убедитесь, что файл может быть изменен вэб-сервером, установите соответствующие права(CHMOD 0777). + core admin_seo - attention_ignore - Ignore this problem - Скрыть это предупреждение - - core - admin_seo - atn_sitemap_path_title - Sitemap Not Writeable - Файл sitemap недоступен для записи - - core - admin_seo - attention_clear_warnings - Restore Ignored Warnings - Восстановить скрытые предупреждения + atn_url_type_title + Query String FURLs + core admin_seo attention_fix Fix this problem - Исправить + + + core + admin_seo + attention_ignore + Ignore this problem + + + core + admin_seo + attention_clear_warnings + Restore Ignored Warnings + + + core + admin_seo + atn_sitemap_path_title + Sitemap Not Writeable + core admin_seo attention_none There are no items to display. - Нет данных для отображения + core admin_seo attention_title SEO Advice - SEO-Поддержка - - core - admin_seo - sitemap_priority_ignore - Do not include - Не включать + core admin_seo sitemap_priority_inherit Use default - По умоляанию + core admin_seo - sitemap_forum_priority_desc - This will set the priority given in the site map for the forum itself. If you have set to calculate topic scores automatically, this will also influence the topic priority for topics inside this forum. - Установите приоритет форума в sitemap. Если у вас настроен автоматический приоритет для тем, это также повлияет на уровень приоритета тем внутри этого форума. + sitemap_priority_ignore + Do not include + + + core + admin_seo + acronym_saved + Acronym Saved + + + core + admin_seo + acronym_delete_confirm + Are you sure you want to delete this acronym? + core admin_seo acronym_deleted Acronym Deleted - Сокращение Удалено + core admin_seo @@ -11695,10175 +11678,10170 @@ admin_seo sitemap_forum_priority Sitemap Priority - Приоритеты Sitemap + core admin_seo - acronym_delete_confirm - Are you sure you want to delete this acronym? - Вы уверены, что хотите удалить это сокращение? - - core - admin_seo - acronyms_none_add - Click here to add an acronym - Нажмите здесь, чтобы добавить сокращение - - core - admin_seo - err_no_acronym - Could not find the acronym you are trying to edit. - Не найдено сокращение, которое вы пытаетесь редактировать - - core - admin_seo - acronym_saved - Acronym Saved - Сокращение Сохранено - - core - admin_seo - err_acronym_toolong - Both the acronym and the long version cannot be longer than 255 characters. - Длинна сокращеня и расшифровки не должна превышать 255 символов. + sitemap_forum_priority_desc + This will set the priority given in the site map for the forum itself. If you have set to calculate topic scores automatically, this will also influence the topic priority for topics inside this forum. + core admin_seo err_acronym_details You did not fill in the entire form. You must specify an acronym and the long version. - Вы должны указать сокращение и расшифровку. + core admin_seo - acronyms_none - No acronyms have been set up. - Сокращений не настроено. + err_acronym_toolong + Both the acronym and the long version cannot be longer than 255 characters. + core admin_seo - acronyms_long - Long Version - Расшифровка + acronyms_none_add + Click here to add an acronym + + + core + admin_seo + err_no_acronym + Could not find the acronym you are trying to edit. + core admin_seo acronyms_semantic_desc If yes, rather than replacing the acronym entirely, a HTML acronym tag will be used. - ']]> + + + core + admin_seo + acronyms_none + No acronyms have been set up. + core admin_seo acronyms_semantic Uses acronym tag? - Использовать тэг сокращения? + + + core + admin_seo + acronyms_long + Long Version + core admin_seo acronyms_short_desc When the user uses this acronym in a post, it will be replaced with the long version you enter below. - Когда пользователь использует сокращение в тексте сообщения, оно заменяется на указанную вами расшифровку. - - core - admin_seo - acronyms_short - Acronym - Сокращение - - core - admin_seo - acronyms_edit - Edit Acronym - Редактировать - - core - admin_seo - smt_ping_fail - - Failed to ping %s - - Не удалось известить %s - - core - admin_seo - smt_done - Finished. - Завершено. - - core - admin_seo - acronyms_casesensitive - Acronym is case sensitive? - Сокращение зависит от регистра? - - core - admin_seo - acronyms_casesensitive_desc - - + core admin_seo acronyms Acronym Expansion - Расшифровка Сокращений + core admin_seo acronyms_add Add Acronym - Добавить + core admin_seo - smt_pinging - Pinging search engines with updated sitemap. - Уведомление поисковиков об обновлении sitemap. + acronyms_short + Acronym + core admin_seo - smt_ping_ok - - Successfully pinged %s - - %s извещен об изменениях - - core - admin_seo - smt_written - Wrote sitemap file to: %s - Sitemap сохранен в файл: %s - - core - admin_seo - smt_file - - - - File %d, added %d URLs. - - - - Файл %d, добавлено %d URL. - - core - admin_seo - smt_no_plugins - No plugins to run for: %s - Нет дополнений для применения к: %s + acronyms_edit + Edit Acronym + core admin_seo smt_generated - - Generated %d sitemaps - - - Сгенерировано сайтмапов: %d + + + core + admin_seo + smt_file + - - - File %d, added %d URLs. + + + core + admin_seo + smt_no_plugins + No plugins to run for: %s + + + core + admin_seo + smt_written + Wrote sitemap file to: %s + + + core + admin_seo + smt_pinging + Pinging search engines with updated sitemap. + + + core + admin_seo + smt_ping_ok + - Successfully pinged %s + + + core + admin_seo + smt_ping_fail + - Failed to ping %s + + + core + admin_seo + smt_done + Finished. + + + core + admin_seo + acronyms_casesensitive + Acronym is case sensitive? + + + core + admin_seo + acronyms_casesensitive_desc + + core admin_seo smt_plugin - Running plugin: %s - - Запуск плагина: %s + core admin_seo smt_start Sitemap generation started. - Начата генерация Sitemap. + core admin_seo smt_app Running plugins for: %s - Применение плагинов к: %s - - core - admin_seo - smt_nowrite - Could not write to: - Не удалось записать в: - - core - admin_seo - smt_acp - You have run the task manually from the Admin CP, this prevents the sitemap from working properly. Please unlock the task in the system scheduler if necessary and leave it to run automatically. - Вы запустили задачу вручную через АЦ, при таком способе сайтмап не может быть построен правильно. Пожалуйста, разблокируйте задачу в планировщике и дайте ей запуститься автоматически. - - core - admin_seo - smt_finished - Sitemap generation finished. - Создание sitemap завершено. - - core - admin_seo - ipseo_upgrade_continue - Continue - Продолжить + core admin_seo ipseo_upgrade_finish Once you have done this, click the continue button below. - После выполнения нажмите Продолжить. + + + core + admin_seo + ipseo_upgrade_continue + Continue + + + core + admin_seo + smt_finished + Sitemap generation finished. + + + core + admin_seo + smt_nowrite + Could not write to: + + + core + admin_seo + smt_acp + You have run the task manually from the Admin CP, this prevents the sitemap from working properly. Please unlock the task in the system scheduler if necessary and leave it to run automatically. + core admin_seo ipseo_upgrade_2
    ]]>
    -
    ]]>
    + core admin_seo ipseo_upgrade_cronmode If you did previously set up a cron to generate your sitemap
    You need to delete it. In your server's lists of crons, you find the cron running the following script and delete it:

    ]]>
    - Если вы уже настроили cron для генерации sitemap
    Вы должны изменить скрипт, который он запускает. В списке задач cron вы найдете и удалите следующий скрипт:

    ]]>
    - - core - admin_seo - spiders_none - There are no results to display. - Нет данных + core admin_seo ipseo_upgrade_1 If you did previously set up a cron to generate your sitemap
    You need to change the script it is running. In your server's lists of crons, you find the cron running the following script:

    ]]>
    - Если вы уже настроили cron для генерации sitemap
    Вы должны изменить скрипт, который он запускает. В списке задач cron вы найдете следующий скрипт:

    ]]>
    + core admin_seo - spiders_spider - Spider - Бот + visitors_none + There are no results to display. + core admin_seo - task_path_not_write - The sitemap generator task could not complete. You must create a sitemap.xml file in your board root directory (where conf_global.php is) and then ensure it is fully writable. - Задача генерации sitemap не может создать файл. Вы должны создать файл sitemap.xml в корневой папке форума (там же, где conf_global.php) и убедиться,что он доступен для записи. + ipseo_upgrade_title + Important information about IP.SEO + core - admin_setup - imported_x_help - Imported %s help files - Добавлено %s разделов помощи + admin_seo + visitors_member + Member + core - admin_setup - imported_no_help - No help files to import - Нет разделов помощи для добавления + admin_seo + visitors_date + Date + core - admin_setup - redir__no_templates - No skin templates added... - Нет шаблонов для добавления + admin_seo + spiders_page + Page + + + core + admin_seo + sitemaplog_title + Sitemap: Last Run + core admin_setup bbcode_and_media BBCode and Media Tags imported - Добавлены теги bb-кода и медиа-теги + core admin_setup no_bbcode_media No bbcode or media tags to import - Нет bb-кодов и медиа-тегов для добавления + core admin_setup - continue_button - Continue - Продолжить + imported_no_help + No help files to import + core admin_setup redir__no_template_re No skin templates added for this application, skipping template rebuild... - Нет шаблонов для добавления. Пропускаем обновление стилей. + + + core + admin_setup + redir__no_templates + No skin templates added... + + + core + admin_setup + imported_x_help + Imported %s help files + core admin_setup dup__drop Drop original tables and overwrite - Удалить оригинальные и создать новые + + + core + admin_setup + continue_button + Continue + core admin_setup dup__skip - Пропустить + core admin_setup duplicate_tables Duplicate Tables: - Существующие таблицы: - - core - admin_setup - error__file_missing - File does not exist: %s - Файл %s не существует - - core - admin_setup - version_suffix - Version: - Версия: + core admin_setup author_suffix Author: - Автор: + core admin_setup - redir__continue - Click here to continue (if not automatically redirected) - Для продолжения нажмите сюда, если вас не переместило автоматически - - core - admin_setup - type__installation - installation - установка - - core - admin_setup - type__upgradet - upgrade - обновление - - core - admin_setup - type__text - This %s is in progress... - %s выполняется - - core - admin_setup - type__text_finished - This %s is now complete - Завершен этап: %s - - core - admin_setup - progress_report - Progress Report: - Прогресс: + version_suffix + Version: + core admin_setup current_version Current Version: - Текущая версия: - - core - admin_setup - applications_title - Application - Приложение - - core - admin_setup - install_latest - install the latest version - установка последней версии + core admin_setup upgrade_latest upgrade to the latest version - обновление до последней версии + core admin_setup please_correct_errors Please correct these errors before attempting to continue: - Прежде чем продолжить необходимо исправить следующие ошибки: + core admin_setup - return_to_overview - - Нажмите здесь для возвращения к списку приложений + applications_title + Application + core admin_setup - error__file_chmod - File is not writeable: %s - Нельзя записать в файл %s + install_latest + install the latest version + core admin_setup - ipboard_welcome_setup - Welcome to the IP.Board application set up utility. - Вас приветствует установщик IP.Board. + progress_report + Progress Report: + core admin_setup ipboard_setup_title IP.Board Set Up Utility - Инструмент установки + + + core + admin_setup + ipboard_welcome_setup + Welcome to the IP.Board application set up utility. + + + core + admin_setup + return_to_overview + + + + core + admin_setup + type__text_finished + This %s is now complete + + + core + admin_setup + type__text + This %s is in progress... + + + core + admin_setup + type__upgradet + upgrade + + + core + admin_setup + type__installation + installation + + + core + admin_setup + redir__continue + Click here to continue (if not automatically redirected) + core admin_setup error__continue Click here to continue regardless - Нажмите здесь, если все равно хотите продолжить + core admin_setup cur_version_none None - Нет + core admin_setup error__display The following errors have been found: - Возникли следующие ошибки: + core admin_setup type__upgrade Upgrade - Обновление + core admin_setup type__install Install - Установка - - core - admin_setup - redir__sql_inserts - %s inserts added - %s данных добавлено + core admin_setup redir__nolanguages There were no language bits to insert - Нет языковых фраз для добавления + + + core + admin_setup + redir__sql_inserts + %s inserts added + core admin_setup redir__sql_indexes %s indexes created - %s индексов добавлено - - core - admin_setup - redir__sql_tables - %s tables installed, %s skipped - %s таблиц добавлено, %s пропущено + core admin_setup redir__nomore_sql No more SQL queries to run - SQL запросов больше нет + + + core + admin_setup + redir__sql_tables + %s tables installed, %s skipped + core admin_setup redir__sql_run %s SQL queries run... - %s SQL запросов выполнено + core admin_setup redir__appmodule_run Application module run... - Запуск модуля + core admin_setup redir__replacements Replacements inserted - Макросов добавлено + core admin_setup redir__cssfiles %s css files added, %s updated in set %s - %s css добавлено, %s обновлено в стиле %s + core admin_setup redir__hooks %s hooks added, %s updated - %s ху��ов добавлено, %s обновлено + core admin_setup redir__templates %s templates added, %s updated in set %s - %s шаблонов добавлено, %s обновлено в стиле %s + core admin_setup redir__upgraded_to Upgraded to %s, running next module... - Обновлено до версии %s, запуск следующего модуля + core admin_setup redir__nomore_modules No more modules to run... - Больше нет модулей для запуска + core admin_setup hooks_nofile No hooks to install - Нет хуков для установки + core admin_setup error__cannot_init Cannot initiate the set up class - Не удалось инициировать установочный класс + core admin_setup error__up_to_date This application is already up-to-date - Приложение последней версии + core admin_setup error__file_needed File does not exist: %s - Файл %s не существует + core admin_setup - install_skins_flag_recache - All skins flagged for recaching - Все стили помечены для пересоздания кешей + error__file_chmod + File is not writeable: %s + + + core + admin_setup + error__file_missing + File does not exist: %s + core admin_setup no_tasks_for_import No tasks to import - Нет задач для добавления + + + core + admin_setup + install_skins_flag_recache + All skins flagged for recaching + core admin_sql my_go Go! - Выполнить + core admin_sql my_manadvanced Manual Query
    Advanced Users Only]]>
    - SQL-запрос
    + core admin_sql my_analyze Analyze Selected Tables - Анализировать выбранные таблицы + core admin_sql my_check Check Selected Tables - Проверить выбранные таблицы + core admin_sql my_repair Repair Selected Tables - Восстановить выбранные таблицы + core admin_sql my_optimize Optimize Selected Tables - Оптимизировать выбранные таблицы + core admin_sql my_checkall Check All - Отметить все + core admin_sql my_export Export - Экспорт - - core - admin_sql - my_table - Table - Таблица + core admin_sql my_rows Rows - Ряды + + + core + admin_sql + my_table + Table + core admin_sql my_tables IP.Board MySQL Tables - MySQL таблицы IP.Board + core admin_sql my_results Results: Manual Query - Результаты ручного запроса - - core - admin_sql - my_run - Run Query - Выполнить + core admin_sql my_runnew Run a New Query - Выполнить новый запрос + core admin_sql - my_gzipnotes - Compresses content if possible, but can timeout on larger databases - Сжимать содержимое при возможности. Для больших баз возможно прерывание процесса по таймауту. + my_run + Run Query + core admin_sql my_gzipcontent GZIP Content? - GZIP? + core admin_sql - my_start_backup - Start MySQL Backup - Начать резервирование - - core - admin_sql - my_createtable - - - - core - admin_sql - my_backticks - Add backticks around the table name? - Добавить backticks (`) вокруг имен таблиц? - - core - admin_sql - my_iferror - (If you get an SQL error, try checking this) - (Если возникает ошибка SQL, попробуйте это) - - core - admin_sql - my_skinnoness - Skip non essential data? - Пропустить служебную информацию? + my_gzipnotes + Compresses content if possible, but can timeout on larger databases + core admin_sql my_skinnoness_notes Will not produce insert rows for sessions, admin_sessions, captcha. - Не будет включать данные для таблиц сессий, администраторских сессий, captcha + core admin_sql - my_simple_backup - Simple Backup]]> - Простое резервирование]]> + my_skinnoness + Skip non essential data? + + + core + admin_sql + my_iferror + (If you get an SQL error, try checking this) + + + core + admin_sql + my_createtable + + + + core + admin_sql + my_start_backup + Start MySQL Backup + + + core + admin_sql + my_backticks + Add backticks around the table name? + core admin_sql my_simple_text Once you have clicked the link below, please wait until your browser prompts you with a dialogue box. This may take some time depending on the size of the database you are backing up. - После нажатия ссылки, дождитесь пока браузер не выведет вам диалоговое окно. Это может занять какое-то время в зависимости от размера базы данных, которую вы резервируете. + core admin_sql - my_si_clickrebuild - to rebuild this applications search index.]]> - для перестройки поискового индекса этих приложений]]> + my_simple_backup + Simple Backup]]> + core admin_sql my_si_entries Entries - Записей + + + core + admin_sql + my_si_clickrebuild + to rebuild this applications search index.]]> + core admin_sql my_si_searchable Searchable Applications - Приложения для поиска + core admin_sql my_si_indexsize MySQL Index Size]]> - Размер индекса]]> + core admin_sql my_si_rows Rows]]> - Ряды]]> + core admin_sql my_si_datasize Data Size]]> - Размер данных]]> - - core - admin_sql - my_si_data - Search Index Table Data - Поиск данных + core admin_sql manual_loginlogs - К сожалению, вы не можете удалять или обновлять данные в этой таблице + + + core + admin_sql + my_si_data + Search Index Table Data + core admin_sql manual_notallowed Sorry, those queries are not allowed for your safety - К сожалению, данные запросы запрещены для исполнения - - core - admin_sql - manual_error - Error - Ошибка + core admin_sql manual_invalid This query appears to be invalid: - Неверный запрос: + core admin_sql - my_automatically - Fix Automatically]]> - Исправить автоматически]]> + manual_error + Error + core admin_sql manual_noquery No queries were found to run - Не удалось найти запросы для выполнения + core admin_sql my_manually Fix Manually]]> - Исправить вручную]]> + core admin_sql - my_sqlerror - MySQL Error - Ошибка - - core - admin_sql - my_successfully - Executed Successfully
    ]]>
    - Выполнен
    ]]>
    + my_automatically + Fix Automatically]]> + core admin_sql my_manual Manual Query - Запрос + core admin_sql - my_sysvar - MySQL System Variables - Значения системных параметров + my_sqlerror + MySQL Error + + + core + admin_sql + my_successfully + Executed Successfully
    ]]>
    +
    core admin_sql my_runtime MySQL Runtime Information - Информация о MySQL процессе + core admin_sql - my_processes - MySQL Processes - Процессы - - core - admin_sql - my_backuptitle - MySQL %s Backup - Резервирование %s + my_sysvar + MySQL System Variables + core admin_sql my_tooold - К сожалению версия MySQL, установленная у вас ниже чем 3.23.21. Управление MySQL не доступно. Да и вообще система не должна работать. + + + core + admin_sql + my_processes + MySQL Processes + core admin_sql my_title MySQL %s Toolbox - MySQL %s + + + core + admin_sql + my_backuptitle + MySQL %s Backup + core admin_sql my_backupnav MySQL Database Backup - Бэкап базы MySQL - - core - admin_sql - my_noloc - - - - core - admin_sql - my_seltables - You must choose some tables to run this tool on! If not, that is just plain outright silly! - Необходимо выбрать таблицы, для которых будет запущен инструмент! + core admin_sql my_cantdo Sorry, we do not allow one or more of those queries. Please run them from a seperate database management tool outside of IP.Board. - К сожалению наша система не позволяет выполнять подобные запросы. Вы можете выполнить их, используя иные средства управления базой данных. - - core - admin_sql - not_supported - Unsupported - Не поддерживается - - core - admin_sql - not_supported_desc - This tool is not supported for your SQL engine - Эта утилита не поддерживается вашим SQL сервером. - - core - admin_sql - query_executed_successfully - Query executed successfully - Запрос выполнен - - core - admin_sql - my_noapp - The application you selected does not appear to be installed. - Приложение, которое вы выбрали, не установлено в системе - - core - admin_sql - my_noloc_class - - - - core - admin_sql - my_si_complete - search index rebuild complete - обновление поискового индекса завершено + core admin_sql my_processed processed - обработано + + + core + admin_sql + my_seltables + You must choose some tables to run this tool on! If not, that is just plain outright silly! + + + core + admin_sql + my_noloc + + + + core + admin_sql + my_noloc_class + + + + core + admin_sql + my_si_complete + search index rebuild complete + + + core + admin_sql + my_noapp + The application you selected does not appear to be installed. + core admin_sql my_si_progress search index rebuild in progress - обновление поискового индекса + + + core + admin_sql + query_executed_successfully + Query executed successfully + + + core + admin_sql + not_supported + Unsupported + + + core + admin_sql + not_supported_desc + This tool is not supported for your SQL engine + core admin_sql backup_tool_warning_title SQL Backup Warning - Предупреждение + core admin_sql backup_tool_warning_text If you have access to phpMyAdmin or a similar tool, we recommend that you use that instead of the ACP backup utility. - Если у вас есть доступ к phpMyAdmin или другим подобным инструментам, то мы рекомендуем для создания резервной копии воспользоваться ими. - - core - admin_sql - view_indexes - Indexes - Индексы - - core - admin_sql - view_structure - Fields - Поля - - core - admin_sql - view_schematic - Table: %s - Таблица: %s + core admin_sql resultprefix Result: - Результат: + + + core + admin_sql + view_structure + Fields + + + core + admin_sql + view_schematic + Table: %s + + + core + admin_sql + view_indexes + Indexes + core admin_sql crashed_table_ohnoes - - - core - admin_system - l_remove_pack - Delete... - Удалить - - core - admin_system - language_wordpack_removed - The word pack has been removed - Набор слов удален - - core - admin_system - language_word_removed - The word has been removed - Слово удалено - - core - admin_system - lang_search_results - Search Results - Результаты поиска - - core - admin_system - l_wordpack_prefix - In word pack: - В наборе слов: - - core - admin_system - language_list_copy - Copy language pack... - Скопировать язык - - core - admin_system - l_nowords - There were no language strings to import - Нет записей для импорта - - core - admin_system - language_is_rtl - Display right to left? - Отображать справа налево - - core - admin_system - l_copied - Language pack copied - Язык скопирован - - core - admin_system - l_noapp - You did not select any applications. - Вы не выбрали ни одного приложения - - core - admin_system - l_nofile - No upload file was found and no filename was specified. - Не найден загруженный файл и не указано имя файла. - - core - admin_system - l_nowrite - Could not write to - Невозможна запись в - - core - admin_system - l_updatedcount - Updated %s language bits, inserted %s language bits. - %s записей обновлено, %s добавлено. + core admin_system l_noopen Could not find the file to open at: - Не возможно найти файл для открытия: - - core - admin_system - l_xmlexportfull - Export Language Pack - Экспорт языка - - core - admin_system - l_xmlexport - Export Application: - Экспорт языка приложения - - core - admin_system - l_savechanges - Save Changes - Сохранить - - core - admin_system - l_edit - Edit entry - Редактировать запись - - core - admin_system - l_addnew - Add new entry - Добавить - - core - admin_system - l_editentry - Edit Entry


    You can change the information for a word pack entry here.

    ]]>
    - Редактирование записи


    Здесь вы можете изменить запись из набора слов .

    ]]>
    - - core - admin_system - l_addthis - Add this entry - Добавить эту запись - - core - admin_system - l_keyreq - Word Key is a required field - Ключевое слово - это обязательное поле - - core - admin_system - l_addnewfull - Add New Entry


    You can add a new entry to the word pack here.

    ]]>
    - Добавление новой записи


    Здесь вы можете добавить новую запись в список слов.

    ]]>
    - - core - admin_system - l_added - New language entry added - Новая запись языка добавлена - - core - admin_system - l_updated - Language entry update - Обновление записи языка - - core - admin_system - l_keydup - The word key you entered is already in this word pack, please use a different key. - Ключ уже существует в наборе. Пожалуйста, используйте другое слово. - - core - admin_system - l_textreq - Default Text is a required fields - Текст по умолчанию - это обязательное поле - - core - admin_system - l_removed - Language pack removed - Язык удален - - core - admin_system - l_packreq - Word Pack is a required field - Набор слов - это обязательное поле - - core - admin_system - l_nolangbits - There were no language bits for that language pack - В этом языковом пакете нет фраз. - - core - admin_system - t_simport_success - The task has been imported successfully - Задача успешно импортирована - - core - admin_system - tupload_failed - The task upload failed. - Загрузка задачи не удалась. - - core - admin_system - t_import_single - Import a task - Импортировать задачу - - core - admin_system - upload_task_xml - Upload a task.xml file - Загрузить tasks.xml файл - - core - admin_system - upload_task_dupe - If the task already exists it will be updated - Если задача уже существует, она будет обновлена - - core - admin_system - task_import_button - Upload - Загрузить - - core - admin_system - t_export_single - Export task - Экспортировать - - core - admin_system - t_exported - All tasks have been exported to the xml folder for their application - Все задачи были экспортированы в xml и размещены в директориях приложений - - core - admin_system - t_noupdate - No task information to update - Нет информации для обновления - - core - admin_system - t_inserted - %s tasks added, %s updated - %s заданий добавлено, %s обновлено - - core - admin_system - t_import404 - %s could not be found. Please check the file and try again. - %s не найден. Пожалуйста, проверьте файл и попробуйте снова. - - core - admin_system - t_lockedcaps - (LOCKED) - (ЗАБЛОКИРОВАНА) - - core - admin_system - t_disabledcaps - (DISABLED) - (ОТКЛЮЧЕНА) - - core - admin_system - t_editing - Editing Task: %s - Изменение задачи: %s - - core - admin_system - t_adding - Adding Task - Добавление задачи - - core - admin_system - t_saturday - Saturday - Суббота - - core - admin_system - t_friday - Friday - Пятница - - core - admin_system - t_thursday - Thursday - Четверг - - core - admin_system - t_wednesday - Wednesday - Среда - - core - admin_system - t_tuesday - Tuesday - Вторник - - core - admin_system - t_monday - Monday - Понедельник - - core - admin_system - t_sunday - Sunday - Воскресенье - - core - admin_system - t_pm - pm - pm - - core - admin_system - t_am - am - am - - core - admin_system - t_midday - Midday - Полдень - - core - admin_system - t_hour - Every Hour - Каждый час - - core - admin_system - t_dayweek - Every Week Day - Каждый день недели - - core - admin_system - t_daymonth - Every Day of the Month - Каждый день месяца - - core - admin_system - t_midnight - 0 - Midnight - 0 - Полночь - - core - admin_system - t_minute - Every Minute - Каждую минуту - - core - admin_system - edittask_button - Edit Task - Изменить - - core - admin_system - task_edit_title - Editing Task: %s - Редактирование задачи: %s - - core - admin_system - t_creating - Creating New Task - Создание новой задачи - - core - admin_system - t_locknomore - Task lock removed - Задача разблокирована - - core - admin_system - t_noid - No ID was passed. Please try again. - Не указан ID. Пожалуйста, попробуйте снова. - - core - admin_system - t_notask - No task to run. - Нет задачи для запуска - - core - admin_system - t_disabled - This task has been disabled. Please enable the task before running it. - Эта задача была отключена. Пожалуйста, включите задачу перед запуском. - - core - admin_system - t_create - Create New Task - Создать новую задачу - - core - admin_system - t_noedit - You are unable to edit this task. - Вам не позволено изменять эту задачу. - - core - admin_system - t_saved - Task Saved Successfully - Задача успешно сохранена - - core - admin_system - t_edited - Task Edited Successfully - Задача успешно изменена - - core - admin_system - t_enterfile - You must enter a filename for the task to run. - Вы должны ввести имя PHP файла запуска задачи - - core - admin_system - t_entertitle - You must enter a task title. - Вы должны ввести название задачи. - - core - admin_system - t_nolocate - Cannot locate: %s/tasks/%s - Не возможно найти: %s/tasks/%s - - core - admin_system - t_ran - Task ran successfully - Задача успешно запущена - - core - admin_system - t_locked - This task was locked at %s and cannot be ran until unlocked. - Эта задача была заблокирована в %s и не может быть запущена до разблокирования. - - core - admin_system - t_deleted - Task deleted - Задача удалена - - core - admin_system - s_virus_nolocated - Please scan regularly to ensure that your system is secure.]]> - Пожалуйста, выполняйте проверку как можно чаще, чтобы содержать систему в безопасности.]]> - - core - admin_system - s_functions - Disable Dangerous PHP Functions - Отключение Опасных PHP Функций - - core - admin_system - s_functions_good - All of the recommended functions to disable have been disabled on your server. - Все рекомендуемые к отключению функции отключены на вашем сервере. - - core - admin_system - s_functions_bad - %s]]> - %s]]> - - core - admin_system - s_open_basedir - Enable open_basedir - Включение open_basedir - - core - admin_system - s_open_basedir_good - %s]]> - %s]]> - - core - admin_system - s_open_basedir_good_noval - open_basedir is enabled. - опция open_basedir включена - - core - admin_system - s_open_basedir_bad - We recommend enabling the PHP configuration option open_basedir and setting it to your webroot and temporary directory. If you do not manage your server yourself, your hosting provider will be able to assist with this. - Рекомендуется настроить опцию open_basedir в конфигурации PHP и ограничить ее корневой директорией вашего сайта(document root) и папкой временных файлов. Если вы не имеете доступа к настройкам вашего сервера, обратитесь к вашему хостинг-провайдеру. - - core - admin_system - t_removed - Selected Task Logs Removed - Выбранное записи удалены - - core - admin_system - t_nodelete - You are unable to delete this task. - Вам не позволено удалять эту задачу. - - core - admin_system - s_virus_none - No Suspicious Files Detected - Подозрительных файлов не обнаружено. - - core - admin_system - s_virus_located - If you're unsure of their origin, please remove them immediately.]]> - Если вы не уверены в их происхождении, то немедленно удалите их.]]> - - core - admin_system - s_virus - IP.Board Unauthorized File Checker - Сканер подозрительных файлов - - core - admin_system - s_virus_found - Suspicious Files Detected - Обнаружены подозрительные файлы - - core - admin_system - s_virus_bad - The unauthorized file checker has not been run in over a week]]> - Сканер на подозрительные файлы не запускали более недели.]]> - - core - admin_system - s_phpcgi_bad - IP.Board cannot locate any .htaccess files.]]> - IPB не обнаружил какие-либо .htaccess файлы.]]> - - core - admin_system - s_conf - - - - core - admin_system - s_conf_good - "conf_global.php" is NOT writeable.]]> - "conf_global.php" не доступен для записи.]]> - - core - admin_system - s_conf_bad - "conf_global.php" is writeable.]]> - "conf_global.php" доступен для записи.]]> - - core - admin_system - s_virus_good - The unauthorized file checker was last run: ]]> - Сканер на подозрительные файлы последний раз запускали:]]> - - core - admin_system - s_skipped - Skipped %s, could not write into it... - Пропущен %s, запись в него невозможна... - - core - admin_system - s_deep_nav - Deep Scan - Глубокое сканирование - - core - admin_system - s_allex - All Executables - Все исполняемые - - core - admin_system - s_allex_good - If you're unsure of their origin, please investigate them immediately.]]> - Глубокое сканирование обнаружило %s файлов. Если вы не уверены в происхождении этих файлов, то немедленно просмотрите их. - - core - admin_system - s_allex_bad - %s of %s files are rating 7/10 or more.
    If you're unsure of their origin, please investigate them immediately.]]>
    - %s из %s файлов имеют рейтинг 7/10 или более. Если вы не уверены в происхождении этих файлов, то немедленно просмотрите их.]]>
    - - core - admin_system - s_completeform - You must complete the form. Please try again. - Вы должны полностью заполнить форму. - - core - admin_system - s_written - Authentication files written - Файл аутентификации записан - - core - admin_system - s_htaccess_nav - ACP .htaccess - .htaccess Админцентра - - core - admin_system - s_rename_nav - Rename the admin directory - Переименовать директорию Админцентра - - core - admin_system - s_chmod_good - CHMOD change completed. - Изменение прав доступа к файлам завершено. - - core - admin_system - s_chmod_bad - Could not complete the process.
    Please use your FTP client to change the CHMOD value of 'conf_global.php' to 0444.]]>
    - Невозможно выполнить операцию.
    Воспользуйтесь FTP клиентом и измените атрибуты доступа к файлу 'conf_global.php' на 0444.]]>
    - - core - admin_system - s_written_to - Written .htaccess to %s... - .htaccess записан в %s... - - core - admin_system - s_rename - - Название директории Админцентра - - core - admin_system - s_rename_good - The admin directory HAS been renamed.]]> - Директория админцентра ПЕРЕИМЕНОВАНА.]]> - - core - admin_system - s_phpcgi_good - IP.Board has located some .htaccess files.]]> - IPB обнаружил .htaccess файлы.]]> - - core - admin_system - s_htaccess_good - IP.Board has located an ACP .htaccess file.]]> - IPB обнаружил .htaccess файл в директории админцентра.]]> - - core - admin_system - s_htaccess_bad - IP.Board cannot locate an ACP .htaccess file.]]> - IPB не обнаружил .htaccess файл в директории админцентра.]]> - - core - admin_system - s_phpcgi - IP.Board PHP/CGI .htaccess Protection - Защита PHP/CGI файлом .htaccess - - core - admin_system - s_toggle - Toggle Now - Переключить - - core - admin_system - s_runtool - Run Tool Now - Мастер Слияния Стилей - - core - admin_system - s_deep_good - The scanner was last run: ]]> - Сканер последний раз запускали:]]> - - core - admin_system - s_htaccess - IP.Board ACP .htaccess Protection - Защита файлом .htaccess Админцентра - - core - admin_system - s_learnmore - Learn More - Подробнее - - core - admin_system - s_deep_bad - The scanner has not been run in over a month]]> - Сканер не запускали более месяца.]]> - - core - admin_system - q_nohelp - No help information is available for this function at present. - Нет дополнительно информации для этой функции в данное время. - - core - admin_system - s_deep - IP.Board Executables Deep Scan - Глубокое сканирование - - core - admin_system - q_upload - Upload Permissions - Права доступа загрузки файлов - - core - admin_system - q_upload_info -
  • You have entered a reasonable numerical figure in the groups 'Max upload file size' field.
  • You have edited the forum permissions for this group and checked the 'Upload' checkbox. This allows you to control in which forums this group can upload to.

    Warning!
    If, when posting, no post is made and you are returned back to the community index, disable this groups upload by entering 0 into this field. This will turn off the mutli-part form the uploads use.]]> -
  • Вы ввели достаточное значение в поле «Дисковая квота на хранение всех файлов (включая личные сообщения и сообщения в темах)»
  • Вы изменили права доступа к форумам и отметили поле "Загрузка"


  • Внимание!
    Если при добавлении сообщения вас перебрасывает на главную страницу, укажите значение 0 для этого поля. Это приведет к отключению формы загрузки.]]>
    - - core - admin_system - q_components - Components Menu System - Система меню компонентов - - core - admin_system - q_components_info - Menu text is the actual menu item text. IE: Tools and Settings.
    Menu URL is the final part of the URL. No need to add the full URL or the 'section=components&act=blog' part unless this is a redirect. IE: code={code}
    Menu Redirect if yes, complete the 'act={}§ion={}&do={}' part of the URL in the URL box or the redirect may not work.
    Perm Bit and Perm Lang is the ACP restriction perm bit. Entries: add, remove, edit, rebuild, recount, recache all have language entries. Any other bit names will require adding into the Perm Bit Language box. Eg: If the perm bit was 'tools', you may enter 'Allow TOOLS Access'.
    ]]>
    - Текст меню это текст которы будет отображаться с меню.Например, Настройки.
    -URL пункта - это последнаяя часть ссылки. Здесь не требуется задавать полную ссылку.IE: code={code}
    -Перенаправление. Заполните 'act={}§ion={}&do={}' в URL иначе перенаправление не сработает. -
    Ключ доступа и языка служат для доступа к меню в Админцентре. Например, если ключ 'tools', то текст может быть 'Разрешить доступ к TOOLS'.]]>
    - - core - admin_system - q_bulk - Bulk Emailing - Массовая рассылка - - core - admin_system - q_bulk_info - Overview
    Bulk emailing allows you to target a specific section of your community or email all your registered members.

    Settings
    You can choose which user groups will receive the email.
    Allowed Tags
    Although the email system sends the mail via BCC to preserve system resources, you can add in dynamic content with the following tags.
    {board_name} will return the name of your community
    {reg_total} will return the total number of registered members
    {total_posts} will return the total number of posts
    {busy_count} will return the most number of online users
    {busy_time} will return the date of the most online users
    {board_url} will return the URL to the community

    As the email is sent via BCC, it is not possible to include the members username, password or other user profile data.]]>
    - Обзор
    -Массовая рассылка позволяет отправлять всем пользователям форума или отдельным группам. -

    Настройки
    -Вы можете выбрать какие группы пользователей получат письма. Письма можно отправлять в обход опции "Получать письма от администрации", однако делать это не рекомендуется. -
    Разрешены теги
    -Хотя почтовая система рассылает письма через BCC для экономии системных ресурсов, вы можете добавлять динамическое содержимое с помощью некоторых тегов.
    -{board_name} - будет заменено на название вашего форума;
    {reg_total} - вернет число зарегистрированных пользователей;
    {total_posts} - общее число сообщений;
    {busy_count} - максимум пользователей онлайн;
    {busy_time} - время, когда был зарегистрирован максимум пользователей;
    {board_url} - ссылка на форум -

    -Так как письма рассылаются через BCC, нет возможности включить в письма имя пользователя, пароль или другие данные профиля.]]>
    - - core - admin_system - s_rename_bad - The admin directory has not been renamed.]]> - Директория админцентра не переименована.]]> - - core - admin_system - q_promote - Group Promotion - Продвижение группы - - core - admin_system - q_promote_info -
    Many administrators use this feature to set up a 'Senior Members' group with more functionality (such as a longer edit time, larger post uploads) and even allow access to otherwise hidden forums - when your members have made enough posts, they are promoted to this group allowing you to intice more posting and allow for a more restrictive set of permissions for newcomers.

    Warning!
    Use this feature carefully and always check the information before proceeding.
    It is possible to advance to an Admin group - you have been warned.]]>
    -
    -Многие администраторы используют эту опцию для выделения "опытных" пользователей с набором расширенных прав (таких как больший объем загружаемых файлов, более длинное время редактирования) и разрешения доступа к скрытым форумам. -

    Внимание!
    -Используйте эту функцию внимательно и проверьте настройки перед продолжением.
    Возможно продвижение в группу Администраторов!]]>
    - - core - admin_system - q_captcha - Registration CAPTCHA - CAPTCHA при регистрации - - core - admin_system - q_captcha_info -
    When enabled, a random 6 digit numerical string is generated and shown in a graphical format (to prevent advanced bots from reading the source page). The user must enter this string exactly when registering or the account will not be created.]]>
    -
    6 произвольных цифр показывается в виде картинки. Пользователь должен точно ввести показанные цифры для продолжения регистрации.

    Это поможет защитить форум от атак и рассылки нежелательных писем.]]>
    - - core - admin_system - q_multi - Moderators and Topic Multi-Moderation - Модерация и мультимодерация тем - - core - admin_system - q_multi_info - For example, if one of your multi-moderation actions allowed the topic to be moved and you do not allow move permissions the moderator will still be able to use the topic multi-moderation and move the topic.]]> - Например, если одно из Ваших правил мультимодерации, настроено на перемещение тем, но Вы запретили в настройках одного из модераторов перемещать темы, данный модератор всё равно сможет перемещать темы при помощи функции мультимодерации.]]> - - core - admin_system - q_bots - What are Search Engine Spiders? - Кто такие Поисковые роботы ? - - core - admin_system - q_bots_info - Invision Power can take advantage of separating the bots from the real users and you can then ensure that they are getting adequate information to help with search engine ranking.

    Warning!
    IP.Board recognises the search engine spiders and crawlers by their user_agent. Please keep in mind that it's not impossible to fake this and a malicious user could pose as a harmless search engine spider.
    This is not a problem as by default the spider will have guest permissions, but it's something that you should keep in mind when allowing permissions.

    Also keep in mind that most search engines do NOT search dynamically generated website for fear of crashing the server with the constant reading of topics.]]>
    - Форум может отделять роботов от реальных пользователей и предоставлять им только необходимую информацию, тем самым повышая форум в выдаче поисковика.

    Внимание!
    Invision Power Board распознает поисковых роботов по их user_agent. Так как его легко подделать, злоумышленник может выдать себя за поискового робота.
    Имейте это ввиду при изменении прав поисковых роботов.

    Так же имейте ввиду, что многие поисковые системы не индексируют динамический создаваемый сайт, чтобы не нарушать работу сервера постоянными запросами.]]>
    - - core - admin_system - q_html_info -
    Warning!
    Allowing a member to post HTML is a very dangerous thing, you should not enable this functionality on any group that will use it maliciously. Although IPB tries to filter some of the more harmful content, it is NOT foolproof and this tag CAN be used to steal session cookies, redirect members and destroy the topic view layout.
    IP.Board and Invision Power Services will not be held responsible for any misfortune that occurs from the usage of this tag.

    Use it wisely!]]>
    -
    Внимание!
    Разрешение пользователям использовать HTML очень опасно, не следует разрешать это делать группам, которые могут использовать это в плохих целях. Хотя IPB пытается удалить вредоносное содержимое, это НЕ является гарантией безопасности. Это может быть использовано для кражи сессионных куки, перенаправления на другую страницу или для нарушения вывода страницы темы.
    Invision Power Board и Invision Power Services не несут никакой ответственности за не правильное использование этой опции.

    Используйте с умом!]]>
    - - core - admin_system - w_nav - Welcome - Добро пожаловать - - core - admin_system - q_html - Posting HTML - Отправка HTML - - core - admin_system - ll_msg - The red cross indicates an error when logging in and a green tick indicates a successful log in.]]> - Красный крест показывает ошибку входа, а зеленая галочка показывает успешный вход.]]> - - core - admin_system - ll_title - ACP Log-in Attempts - Попытки входа в админцентр - - core - admin_system - ll_noid - No log for that ID found. - Не найдено записей для этого ID. - - core - admin_system - d_aunable - Unable to obtain process information]]> - Не возможно получить информацию о процессе ]]> - - core - admin_system - d_aon - ON - ВКЛЮЧЕН - - core - admin_system - d_aoff - OFF - ВЫКЛЮЧЕН - - core - admin_system - d_anoinfo - No Information]]> - Нет данных ]]> - - core - admin_system - d_aphpinfo - PHP INFO - PHP INFO - - core - admin_system - d_atotal - Total Physical Memory - Всего физической памяти - - core - admin_system - d_aavail - Available Physical Memory - Доступно физической памяти - - core - admin_system - d_atitle - IP.Board Diagnostics - Диагностика IP.Board - - core - admin_system - d_dfix - Fix - Исправить - - core - admin_system - d_dstatus - Status - Состояние - - core - admin_system - d_dtbl - Table - Таблица - - core - admin_system - d_dtitle - IP.Board Diagnostics - Database Structure Checker - Диагностика IP.Board - Проверка структуры базы данных - - core - admin_system - d_dnav - Database Structure Results - Результат проверки структуры базы данных - - core - admin_system - d_iman - , or you can run the following queries manually: - или вы можете выполнить следующие запросы вручную. - - core - admin_system - d_ifix - Fix - Исправить - - core - admin_system - d_iresults - Database Index Results - Результаты проверки индексов базы данных - - core - admin_system - d_iauto - Click here to fix this table]]> - Нажмите здесь для исправления таблицы ]]> - - core - admin_system - d_inauto - Click here to fix this table's indexes]]> - Нажмите здесь для исправления индексов этой таблицы ]]> - - core - admin_system - d_itable - Table - Таблица - - core - admin_system - d_iindex - Index Name - Название индекса - - core - admin_system - d_ifixall_link - Would you like us to attempt to fix them for you? - Хотите попытаться исправить все в автоматическом режиме ? - - core - admin_system - d_icongrats - There were no errors found with your database indexes. - Ошибок в индексах базы данных не найдено. - - core - admin_system - d_ifixall - We have found problems with your database, and have listed them below. - В базе данных обнаружены ошибки. - - core - admin_system - d_ierror - SQL Error: - Ошибка SQL: - - core - admin_system - d_iexecuted - Executed Successfully
    ]]>
    - Успешно выполнен
    ]]>
    - - core - admin_system - d_iupload - You must upload: /install/sql/%s_tables.php from the IP.Board installation package for your current version to run this tool. - Вы должны загрузить: /install/sql/%s_tables.php из дистрибутива IP.Board вашей текущей версии для запуска этого инструмента. - - core - admin_system - d_inoprocess - There was an error and we could not process your %s_tables.php file. Please reupload it. - Произошла ошибка и ваш файл %s_tables.php не был обработан. Пожалуйста, перезагрузите его. - - core - admin_system - d_inoerrors - No Errors Found - Ошибок не найдено - - core - admin_system - d_idomanual - - - - core - admin_system - d_ititle - IP.Board Diagnostics - Database Index Checker - Диагностика IP.Board - Проверка индексов базы данных - - core - admin_system - d_inav - Database Index Results - Результаты проверки индексов базы данных - - core - admin_system - d_isorry - Sorry, those queries are not allowed for your safety. - Извините, эти запросы запрещены в целях безопасности. - - core - admin_system - d_wclear - All files appear to be in good order - Похоже, что все файлы в порядке - - core - admin_system - d_wfound - has whitespace at the beginning or end of the file - имеет пробелы в начале или конце файла - - core - admin_system - d_wnav - Whitespace Check Results - Результаты проверки на пробелы - - core - admin_system - d_wtitle - IP.Board Diagnostics - Whitespace Checker - Диагностика IP.Board - Проверка на пробелы - - core - admin_system - d_pno - The following file or folder is not writable - Не возможна запись в следующую директорию или файл - - core - admin_system - d_pyes - is writable - имеет права на запись - - core - admin_system - d_pnav - Permission Check Results - Результаты проверки прав доступа - - core - admin_system - d_p404 - We could not find the file or folder - Файл или директория не найдены - - core - admin_system - d_ptitle - IP.Board Diagnostics - Permission Checker - Диагностика IP.Board - Проверка прав доступа - - core - admin_system - d_vinfo - Version Information - Информация о версии - - core - admin_system - d_vtitle - IP.Board Diagnostics - Version Checker - Диагностика IP.Board - Проверка версии - - core - admin_system - d_vnav - Version Check Results - Результаты проверки версии - - core - admin_system - chckr_fix - Fix - Исправить - - core - admin_system - chckr_status - Status - Состояние - - core - admin_system - chckr_table - Table - Таблица - - core - admin_system - last_5_version_history - Version History (Last 5) - История обновлений (последние 5) - - core - admin_system - system_processes - System Processes - Процессы системы - - core - admin_system - sy_devgroups - Groups - Группы - - core - admin_system - sy_devlogin - Log In Auth - Авторизация - - core - admin_system - sy_devtaks - Tasks - Задачи - - core - admin_system - sy_devcomponents - Components - Компоненты - - core - admin_system - sy_devpages - Pages - Страницы - - core - admin_system - sy_devskin - Skin Set - Стиль - - core - admin_system - sy_devfile - File Types - Типы файлов - - core - admin_system - sy_devcontent - Content Templates - Шаблоны содержания - - core - admin_system - sy_devtemplate - Template HTML - Шаблон HTML - - core - admin_system - sy_devemail - Email Templates - Шаблоны E-mail - - core - admin_system - sy_devexport - Export Installer XML - Экспортировать XML установщика - - core - admin_system - sy_go - Go - Отправить - - core - admin_system - language_word_pack_no_results - No results found - Нет данных для отображения - - core - admin_system - language_total_entries - Total Entries - Всего записей - - core - admin_system - language_out_of_date_entries - Out of Date Entries - Устаревшие записи - - core - admin_system - language_key - Key - Ключ - - core - admin_system - language_default - Default Text - Текст по умолчанию - - core - admin_system - language_customized_entries - Customized Entries - Измененные записи - - core - admin_system - language_pack_name - Pack Name - Набор слов - - core - admin_system - language_word_revert - Language customization has been reverted - Изменения в языке отменены - - core - admin_system - language_locale_missing - Language locale can not be blank - Локаль языка не может быть пустой - - core - admin_system - language_pack_updated - Language pack information updated - Настройки языка обновлены - - core - admin_system - language_title_missing - Language title can not be blank - Название языка не может быть пустым - - core - admin_system - language_form_default - Default Language? - Использовать по умолчанию - - core - admin_system - language_form_locale - Language Locale - Локаль языка - - core - admin_system - language_form_title - Language Title - Название языка - - core - admin_system - language_pack_created - Language pack created - Язык создан - - core - admin_system - language_form_new_info - Language Pack Information


    You can configure basic language pack settings here

    ]]>
    - Настройки языка


    Здесь вы можете настроить основные параметры языкового пакета

    ]]>
    - - core - admin_system - language_form_new_button - Add this language - Добавить этот язык - - core - admin_system - language_list_default - Default - По умолчанию - - core - admin_system - language_word_pack_go - Go - Отправить - - core - admin_system - language_word_pack_edit - Edit word pack - Редактирование слов - - core - admin_system - language_word_pack_current - Default Value - Значение по умолчанию - - core - admin_system - language_word_pack_new - New Value - Новое значение - - core - admin_system - language_word_pack_edited - Word pack updated - Слова обновлены - - core - admin_system - language_form_edit_title - Edit Language Pack Information - Редактирование языка - - core - admin_system - language_form_edit_button - Save Changes - Сохранить - - core - admin_system - language_form_edit_info - Language Pack Information


    You can configure basic language pack settings here

    ]]>
    - Настройки языка


    Здесь вы можете настроить основные параметры языкового пакета

    ]]>
    - - core - admin_system - language_form_new_title - Create a new language pack - Создать новый язык - - core - admin_system - language_list_translate_ext - Translate Externally... - Перевести через файлы - - core - admin_system - language_list_translate - Translate in Admin CP... - Перевести - - core - admin_system - language_list_money - Currency Example - Формат валюты - - core - admin_system - language_list_page_title - Localization Manager - Управление языками - - core - admin_system - language_list_title - Language - Название - - core - admin_system - language_list_local - Locale - Локаль - - core - admin_system - language_list_date - Date Example - Формат даты - - core - admin_system - sys_this_will_examine_the_corecach - This will examine the cache/lang_cache/master_lang/ directory for {app}_language.php files and import them into the database. - на наличие файлов {app}_language.php и импортирует их в базу данных.]]> - - core - admin_system - lang_upload_other_error - An error occurred while attempting to upload the language pack. - В ходе загрузки языка произошла ошибка. - - core - admin_system - lang_upload_too_large - %s.]]> - %s.]]> - - core - admin_system - indev_lang_export_done - All language files exported to application directories - Все языковые файлы экспортированы в директории приложения - - core - admin_system - sys_indev_export_go - Export - Экспорт - - core - admin_system - lang_sections_title - Language Sections - Разделы - - core - admin_system - sys_or_enter_the_filename_of_the_x - OR enter the filename of the xml.gz language pack]]> - ИЛИ введите название XML-архива]]> - - core - admin_system - sys_the_file_must_be_uploaded_into - - - - core - admin_system - l_badfile - There was no language pack information in the file you uploaded - Информация о языковом пакете в загруженном файле не найдена - - core - admin_system - sys_import - Import - Импорт - - core - admin_system - sys_developers_language_cache_impo - - Инструменты разработчика - - core - admin_system - sys_select_the_application_languag - Select the application language files to import - Выберите языковой файл приложения для импорта - - core - admin_system - sys_indev_export - Export language files to application directories - Экспортировать языковые файлы в директории приложения - - core - admin_system - sys_duplicate_entries_will_not_be_ - Duplicate entries will not be overwritten but the default setting and other options will be updated. - Существующие настройки будут обновлены, другие — добавлены. - - core - admin_system - sys_import_language_xml - Import Language XML - Импортирование XML-файла - - core - admin_system - sys_upload_xml_language_file_from_ - Upload language pack from your computer - Загрузка XML-архива с языковыми настройками - - core - admin_system - sys_version - Version - Версия - - core - admin_system - sys_sql_version - SQL Version - Версия SQL - - core - admin_system - tmdebug_on - ON - ВКЛ - - core - admin_system - tmdebug_logs - View Logs - Просмотр журнала - - core - admin_system - topicmarkingdebug - Topic Marking Debug - Отладка отметки тем - - core - admin_system - sys_total_mem - Total Server Memory - Общая память сервера - - core - admin_system - sys_avail_mem - Available Server Memory - Доступная память сервера - - core - admin_system - sys_current_load - Current Server Load - Текущая загрузка сервера - - core - admin_system - sys_sys_software - System Software - Программное обеспечение сервера - - core - admin_system - sys_safe_mod - Safe Mode - Безопасный режим - - core - admin_system - sys_php_version - PHP Version - Версия PHP - - core - admin_system - sys_disabled_funcs - Disabled PHP Functions - Отключенные PHP функции - - core - admin_system - sys_status - Status - Состояние - - core - admin_system - sys_log - Log - Журнал - - core - admin_system - sys_system_overview - System Overview - Обзор системы - - core - admin_system - sys_ipboard_version - IP.Board Version - Версия IP.Board - - core - admin_system - sys_name - Name - Имя - - core - admin_system - sys_last_5_acp_log_in_attempts - Latest ACP Log in Attempts - Последние 5 попыток входа в Админцентр - - core - admin_system - sys_view_details - View Details - Подробности - - core - admin_system - sys_date - Date - Дата - - core - admin_system - sys_all_times_gmt_gmt_time_now_is - All times GMT. GMT time now is: - Время по Гринвичу: - - core - admin_system - sys_delete_task - Delete Task... - Удалить - - core - admin_system - sys_unlock_task - Unlock Task... - Разблокировать - - core - admin_system - sys_run - Run - Запуск - - core - admin_system - sys_edit_task - Edit Task... - Изменить - - core - admin_system - sys_how_curl_to_use_in_a_cron - Show CURL to use in a cron - Показать строку CURL для запуска задачи - - core - admin_system - sys_min - Min - Минута - - core - admin_system - sys_hour - Hour - Час - - core - admin_system - sys_wday - WDay - День недели - - core - admin_system - sys_mday - MDay - День месяца - - core - admin_system - sys_if_set_to_yes_this_will_not_be - - - - core - admin_system - sys_next_run - Next Run - Следующий запуск - - core - admin_system - sys_this_is_used_to_call_a_task_wh - This is used to call a task where the ID of the task might change - Это слово используется для задания, у которого ID может измениться - - core - admin_system - sys_system_schedular - System Scheduler - Менеджер задач - - core - admin_system - sys_if_you_are_using_cron_you_migh - If you are using CRON, you might wish to disable this task from the internal manager. - Если вы используете CRON, вы должны отключить вызов этой задачи здесь. - - core - admin_system - sys_task_safe_mode - Task Safe Mode - Безопасный режим - - core - admin_system - sys_task_key - Task Key - Ключ задачи - - core - admin_system - sys_enable_task - Enable Task? - Включить задачу? - - core - admin_system - sys_will_write_to_the_task_log_eac - Will write to the task log each time the task is run, not recommended for regular tasks run every few minutes. - При включенной опции все выполнения задач будут записаны в базу данных, не рекомендуется для основных задач, выполняемых каждые 5-10 минут. - - core - admin_system - sys_task_time_month_day - Task Time: Month Day - Время задачи: день месяца - - core - admin_system - sys_choose_every_day_to_run_each_d_1 - - - - core - admin_system - sys_enable_task_logging - Enable Task Logging - Включить запись журнала действий - - core - admin_system - sys_task_time_week_day - Task Time: Week Day - Время задачи: день недели - - core - admin_system - sys_choose_every_day_to_run_each_d - - - - core - admin_system - sys_this_is_the_php_file_that_is_r - This is the PHP file that is run when the task is run. - Это PHP файл, который будет запускаться при запуске задачи. - - core - admin_system - sys_task_time_hours - Task Time: Hours - Время задачи: часы - - core - admin_system - sys_choose_every_hour_to_run_each_ - - - - core - admin_system - sys_choose_every_minute_to_run_eac - - - - core - admin_system - sys_task_time_minutes - Task Time: Minutes - Время задачи: минуты - - core - admin_system - sys_time_options - Time Options - Опции времени - - core - admin_system - sys_task_php_file_to_run - Task PHP File To Run - PHP файл задачи для запуска - - core - admin_system - sys_task_application - Task Application - Задача приложения - - core - admin_system - sys_task_short_description - Task Short Description - Краткое описание задачи - - core - admin_system - sys_task_title - Task Title - Название задачи - - core - admin_system - sys_hours - hours - часов - - core - admin_system - sys_minutes_past_the_first_availab - minutes past the first available hour - минут спустя первого доступного часа - - core - admin_system - sys_minutes - minutes - минут - - core - admin_system - sys_every - Every - Каждые - - core - admin_system - sys_at - At - В - - core - admin_system - sys_friday - Friday - Пятница - - core - admin_system - sys_every_minute - Every minute - Каждую минуту - - core - admin_system - sys_on_every_hour - On every hour - Каждый час - - core - admin_system - sys_on - On - В - - core - admin_system - sys_on_day - On day - День - - core - admin_system - sys_saturday - Saturday - Суббота - - core - admin_system - sys_thursday - Thursday - Четверг - - core - admin_system - sys_wednesday - Wednesday - Среда - - core - admin_system - sys_delete_logs - DELETE Logs - УДАЛИТЬ записи - - core - admin_system - sys_sunday - Sunday - Воскресенье - - core - admin_system - sys_monday - Monday - Понедельник - - core - admin_system - sys_tuesday - Tuesday - Вторник - - core - admin_system - sys_delete_logs_for_task - Delete logs for task - Удаление записей задачи - - core - admin_system - sys_delete_logs_older_than_n_days - n days]]> - n дней]]> - - core - admin_system - sys_view_logs - View Logs - Просмотр записей - - core - admin_system - sys_delete_task_manager_logs - Delete Task Manager Logs - Удалить записи менеджера задач - - core - admin_system - sys_show_n_log_entries - n log entries]]> - n записей ]]> - - core - admin_system - sys_view_task_manager_logs - View Task Manager Logs - Просмотр журнала менеджера задач - - core - admin_system - sys_view_logs_for_task - View logs for task - Просмотр журнала задачи - - core - admin_system - sys_log_info - Log Info - Результаты запуска - - core - admin_system - sys_last_5_run_tasks - Last 5 Run Tasks - Последние 5 запущенных задач - - core - admin_system - sys_date_run - Date Run - Дата запуска - - core - admin_system - sys_task_run - Task Run - Задача - - core - admin_system - sys_task_manager_logs - Task Manager Logs - Журнал менеджера задач - - core - admin_system - sys_loaded_ext - Loaded Extensions - Загруженные дополнения - - core - admin_system - logindetail_get - GET Data (URL Data) - Данные GET (данные из URL) - - core - admin_system - logindetail_post - POST Data (Form Data) - Данные POST (данные формы) - - core - admin_system - logindetail_success - Success - Успешно - - core - admin_system - logindetail_time - Log in Time - Время входа - - core - admin_system - logindetail_ip - IP Address - IP адрес - - core - admin_system - logindetail_username - Username - Имя пользователя - - core - admin_system - logindetail_basic - Basics - Основные - - core - admin_system - cannot_delete_default_lang - You cannot delete the default language pack - Вы не можете удалить языковой пакет, использующийся по умолчанию - - core - admin_system - lang_reimport_done - Language Re-Import Done - Повторное импортирование языка завершено - - core - admin_system - importing_x_langs - : Importing %s languages... - : Импортирование %s языков... - - core - admin_system - starting_admin_import - Starting Admin import... - Запуск импорта - - core - admin_system - rebuild_lang_from_xml - Rebuild From XML... - Обновить из XML - - core - admin_system - run_task_now - Run task now - Запусть задачу сейчас -- id: - - core - admin_system - sys_options - Options - Действия - - core - admin_system - sys_title - Title - Задача - - core - admin_system - sym_submit - Submit - Отправить - - core - admin_system - sym_find - Find - Найти - - core - admin_system - sym_add_new_language_entry - Add String - Добавить строку - - core - admin_system - sym_word_out_of_date_check - Outdated Strings - Устаревшие строки - - core - admin_system - sym_edit_language_pack_information - Edit Language Info - Настройки языка - - core - admin_system - sym_view_word_packs - View Word Packs - Просмотр слов - - core - admin_system - sym_manage_languages - Manage Languages - Управление языками - - core - admin_system - sym_export_tasksxml - Export tasks.xml - Экспортировать tasks.xml - - core - admin_system - sym_import_tasksxml - Import tasks.xml - Импортировать tasks.xml - - core - admin_system - language_list_recache - Recache all... - Перекешировать все... - - core - admin_system - sym_add_new_task - Add New Task - Добавить задачу - - core - admin_system - ext_all_killed - Translation Session Removed - Сессия перевода удалена - - core - admin_system - language_recache_done - Recache complete - Кеширование завершено - - core - admin_system - ext_button_smodified - Select Modified - Выбрать измененные - - core - admin_system - ext_tbl_file - File - Файл - - core - admin_system - ext_tbl_local - Last Local Edit - Последнее локальное изменение - - core - admin_system - ext_tbl_db - Last DB Update - Последнее изменение в базе - - core - admin_system - ext_tbl_submit - Import Selected Files - Импортировать выбранные файлы - - core - admin_system - ext_translation_detected - here to go there now.
    You will not be able to start a new session until you finish the current one.]]>
    - сюда чтобы вернуться к ней.
    Вы не можете начинать новый перевод, пока не завершите старый.]]>
    - - core - admin_system - ext_title_for - External Translation For - Перевод для - - core - admin_system - ext_recache - recache this set to view the changes throughout the community.]]> - перекешировать для того, чтобы увидеть изменения на форуме.]]> - - core - admin_system - ext_top_title - External File Translation - Перевод через файлы - - core - admin_system - ext_top_desc - Before editing, please set your text editor to save files as UTF-8 regardless of the character set your community uses.]]> - Перед редактированием настройте в вашем текстовом редакторе кодировку UTF-8, потому что форум использует ее.]]> - - core - admin_system - ext_button_finish - Finish And Remove - Завершить и удалить - - core - admin_system - ext_button_unselect - Unselect All - Снять все отметки - - core - admin_system - ext_button_selectall - Select All - Выбрать все - - core - admin_system - ext_file_written - Imported %s (%s added entries, %s updated) - Импортировано %s (%s добавленных записей, %s обновленных) - - core - admin_system - ext_chmod_translate_dir - - Сделайте, чтобы PHP могло записывать данные в директорию /translate/. CHMOD 777. - - core - admin_system - ext_no_translate_files - Could not locate a valid translate session. This could be because there are no files in the translate directory anymore - Невозможно найти корректную сессию перевода. Это могло пройзойти, потому что там нет файлов для перевода. - - core - admin_system - ext_no_selected_files - You did not select any files to import! - Вы не выбрали ни одного файла для импортирования! - - core - admin_system - ext_no_translate_dir - root forum directory (the same directory that contains your 'initdata.php' file and 'admin' folder). Please make sure PHP has write permissions into this directory. CHMOD 0777 if in doubt.]]> - Пожалуйста, создайте директорию /translate/ в корневой директории форума. И сделайте права CHMOD на нее 0777. - - core - admin_system - perm_check_results - Permissions Check Results - Результаты проверки прав - - core - admin_system - lang_pack_protected - Can not translate protected language pack - Невозможно перевести защищенный пакет языков - - core - admin_system - cannot_delete_protected_lang - Can not delete protected language pack - Невозможно удалить защищенный пакет языков - - core - admin_system - langpackaddapp - Application - Приложение - - core - admin_system - connections__headers1 - HTTPS Headers (https://www.invisionpower.com/) - HTTPS заголовки (https://www.invisionpower.com/) - - core - admin_system - connections__output1 - Output (first 2000 characters): - Ответ (первые 2000 символов) - - core - admin_system - taskthereforrun - Task will therefore run: - Задача будет запущена: - - core - admin_system - selectimeunitsabove - Select time units above - Выберите единицу времени - - core - admin_system - ipaddyprefix - IP: - IP: - - core - admin_system - logindetails - Log in Details - Данные авторизации - - core - admin_system - nolangpacksgroup - There are no word packs for this application - Нет языковых пакетов для данного приложения - - core - admin_system - connections__message - This tool is designed to verify that your server can make outbound connections to another server. Many features in IP.Board require outbound connection capability (such as IP.Chat, License verification, and Facebook Connect), and this tool verifies the underlying outbound connectivity is functioning correctly. - Данный инструмент позволяет проверить возможность создание внешних сетевых соединений на вашем системе. Большое количество функций в IP.Board требуют возможности устанавливать такие соединения. - - core - admin_system - connections__output - Output (first 2000 characters): - Ответ (первые 2000 символов) - - core - admin_system - cannot_write_to_cache - Cannot write to cache/lang_cache/%s - Нет доступа к записи в /cache/lang_cache/%s - - core - admin_system - indev_lang_import - Imported %s (%s added, %s updated)... - импортировано %s (%s добавлено, %s обновлено)... - - core - admin_system - no_reg_x_days - No registrations in the last %s days - Нет регистраций за последние %s дней - - core - admin_system - connections__headers - HTTP Headers (http://www.invisionpower.com/) - HTTP заголовки (http://www.invisionpower.com/) - - core - admin_system - connectionchecker - Connection Checker - Проверка сетевых соединений - - core - admin_system - cp_posts - Posts - Сообщений - - core - admin_system - cp_view - View - Просмотр - - core - admin_system - cp_onlinenow_info - (Includes Members and Guests) - (включая гостей и пользователей) - - core - admin_system - cp_manage - Manage - Управление - - core - admin_system - cp_topics - Topics - Тем - - core - admin_system - cp_awaitingmoderation - Awaiting Moderation - Ожидающих подтверждения - - core - admin_system - cp_spammeraccounts - Spammers - Спамеры - - core - admin_system - cp_lockedaccounts - Locked Accounts - Заблокированных - - core - admin_system - cp_coppaaccounts - COPPA Accounts - COPPA - - core - admin_system - sys_taskislocked - The task is currently locked - Задача заблокирована - - core - admin_system - cp_systemstats - System Statistics - Статистика - - core - admin_system - cp_totalmembers - Total Members - Пользователей - - core - admin_system - cp_onlinenow - Online Now - Онлайн - - core - admin_system - cp_awaitingvalidation - Awaiting Validation - Ожидающих подтверждения - - core - admin_system - update_lang_prefs - Swap Language Choice - Изменить - - core - admin_system - def_lang_sel - (Default Language) - (По-умолчанию) - - core - admin_system - mem_lang_choice_swapped - The member language choice has been swapped - Язык изменен - - core - admin_system - where_touser_lang_choice - Switch to... - Переключить на - - core - admin_system - where_touser_lang_choice_desc - Select the language you want to switch TO - Выберите языковой пакет, на который должно произойти переключение - - core - admin_system - where_user_lang_choice_desc - Select the language you want to switch FROM - Выберите языковой пакет с которого необходимо преключить пользователей - - core - admin_system - where_user_lang_choice - If using... - Используется - - core - admin_system - task_cronmode_desc_14 - If you ever want to stop using the cron and start using the System Scheduler again, use the button below to re-enable all tasks. - - - core - admin_system - sys_lang_choice_swap - Swap Member Language Choice - Изменение языка для пользователей - - core - admin_system - l_textexistsalready - The language string that you are attempting to add already exists. - Языковая строка, которую вы хотите добавить, уже существует. - - core - admin_system - q_fail - Query failed - Запрос не выполнился - - core - admin_system - q_ok - Query ran sucessfully - Запрос успешно выполнен - - core - admin_system - task_cronmode_enable - Enable cron Mode - Включить режим Cron - - core - admin_system - task_cronmode_desc_12 - - - - core - admin_system - task_cronmode_desc_13 - 4. Set up a cron to run the command below every minute: - - - core - admin_system - task_cronmode_desc_11 - 2. Make sure any tasks that you previously disabled to run by individual crons are re-enabled and those crons deleted on the server. - - - core - admin_system - task_cronmode_desc_9 - To set up a cron for all tasks - Для настройки Cron для всех задач - - core - admin_system - task_cronmode_desc_10 - If you want all tasks to run by cron rather than just a number of individual tasks, you can set up one cron to run every minute which will run tasks as they are needed. - - - core - admin_system - task_cronmode_desc_8 - not need to use the 'Enable cron mode' button below if you are only setting individual tasks to run by cron.]]> - не нужно использовать кнопку "Включить режим Cron", если вы хотите только настроить индивидуальные задачи для запуска через Cron.]]> - - core - admin_system - task_cronmode_desc_7 - If you ever want to stop using the cron and start using the System Scheduler again, simply disable the cron and re-enable the task. - Если вы захотите отказаться от использования Cron и начать работу с планировщиком IP.Board снова, просто отключить Cron и снова включить задачу. - - core - admin_system - task_cronmode_desc_6 - 3. A new option will appear in place of the button to run the task, when clicked, this will display the cron that is required. Set up a cron on your server with the same time settings the task already has to run that command. - - - core - admin_system - task_interface_warn - The file interface/task.php is not chmod to 0777. This is necessary in order for running tasks by cron to work. - Файл interface/task.php не имеет CHMOD прав 0777. Это необходимо для запуска задач через Cron. - - core - admin_system - task_cronmode_on - You have enabled cron mode for managing tasks. To revert back to using System Scheduler for handling tasks, click the button below. - Вы включили режим Cron. Для возврата к использованию системного планировщика IP.Board нажмите на кнопку ниже. - - core - admin_system - task_cronmode_disable - Disable cron Mode - Отключить режим Cron - - core - admin_system - task_cronmode_desc_1 - - Планировщик IP.Board работает при каждой загрузке любой страницы форума (и поисковиком тоже). При малопосещаемом форуме он может быть неэффективен, для таких целей используйте полноценный cron на сервере. - - core - admin_system - task_cronmode_desc_2 - This feature is provided for advanced users only. If you do not follow the instructions below correctly, tasks may not run properly which will introduce problems. - Эта функция предназначена только для продвинутых пользователей. Если вы не понимаете четко инструкции ниже, неправильный запуск задач может вызвать проблемы с форумом. - - core - admin_system - task_cronmode_desc_3 - To set up a cron for one task - Чтобы настроить cron на одну задачу - - core - admin_system - task_cronmode_desc_4 - 1. chmod the /interface/task.php file to 0777. - 1. Установить CHMOD права на файл /interface/task.php на 0777. - - core - admin_system - task_cronmode_desc_5 - 2. In the System Scheduler, disable the task. This can be done in the task settings. It is important that you disable the task to stop the System Scheduler running it as well as your cron. - 2. В планировщике IP.Board отключите задачу. Это можно сделать в настройках планировщика. Это важно! - - core - admin_system - task_cron_mode_toggled_0 - Cron mode disabled - Режим Cron отключен - - core - admin_system - email_tester_subject_default - IP.Board Email Test - IP.Board E-mail Тест - - core - admin_system - email_tester_message - Message - Сообщение - - core - admin_system - email_tester_message_default - This is an IP.Board Email Test message. If you received this, it works. - Это тестовое письмо от IP.Board. Если вы получили его, значит отправка писем из форума работает. + core admin_system email_tester_go Send Email - Отправить письмо + core admin_system email_tester_ok Email sent successfully - E-mail успешно отправлен + core admin_system - task_use_cron - Use Cron - Использовать Cron + l_remove_pack + Delete... + core admin_system - task_cron_single_desc - - Вы можете использовать следующую команду, чтобы создать команду в Cron на сервере для выполнения этой задачи, а не использовать планировщик IP.Board. Вы должны делать это только в том случае, если вы не настроили глобальной Cron. + language_wordpack_removed + The word pack has been removed + core admin_system - email_tester_subject - Subject - Тема + lang_search_results + Search Results + + + core + admin_system + l_wordpack_prefix + In word pack: + + + core + admin_system + language_word_removed + The word has been removed + + + core + admin_system + language_is_rtl + Display right to left? + + + core + admin_system + l_nowords + There were no language strings to import + + + core + admin_system + l_noapp + You did not select any applications. + + + core + admin_system + language_list_copy + Copy language pack... + + + core + admin_system + l_copied + Language pack copied + + + core + admin_system + l_nowrite + Could not write to + + + core + admin_system + l_updatedcount + Updated %s language bits, inserted %s language bits. + + + core + admin_system + l_nofile + No upload file was found and no filename was specified. + + + core + admin_system + l_xmlexportfull + Export Language Pack + + + core + admin_system + l_xmlexport + Export Application: + + + core + admin_system + l_addthis + Add this entry + + + core + admin_system + l_edit + Edit entry + + + core + admin_system + l_savechanges + Save Changes + + + core + admin_system + l_editentry + Edit Entry


    You can change the information for a word pack entry here.

    ]]>
    +
    + + core + admin_system + l_addnew + Add new entry + + + core + admin_system + l_addnewfull + Add New Entry


    You can add a new entry to the word pack here.

    ]]>
    +
    + + core + admin_system + l_added + New language entry added + + + core + admin_system + l_updated + Language entry update + + + core + admin_system + l_textreq + Default Text is a required fields + + + core + admin_system + l_keydup + The word key you entered is already in this word pack, please use a different key. + + + core + admin_system + l_keyreq + Word Key is a required field + + + core + admin_system + l_packreq + Word Pack is a required field + + + core + admin_system + l_nolangbits + There were no language bits for that language pack + + + core + admin_system + l_removed + Language pack removed + + + core + admin_system + t_simport_success + The task has been imported successfully + + + core + admin_system + task_import_button + Upload + + + core + admin_system + tupload_failed + The task upload failed. + + + core + admin_system + upload_task_xml + Upload a task.xml file + + + core + admin_system + upload_task_dupe + If the task already exists it will be updated + + + core + admin_system + t_export_single + Export task + + + core + admin_system + t_import_single + Import a task + + + core + admin_system + t_exported + All tasks have been exported to the xml folder for their application + + + core + admin_system + t_inserted + %s tasks added, %s updated + + + core + admin_system + t_noupdate + No task information to update + + + core + admin_system + t_import404 + %s could not be found. Please check the file and try again. + + + core + admin_system + t_lockedcaps + (LOCKED) + + + core + admin_system + t_disabledcaps + (DISABLED) + + + core + admin_system + t_editing + Editing Task: %s + + + core + admin_system + t_adding + Adding Task + + + core + admin_system + t_saturday + Saturday + + + core + admin_system + t_friday + Friday + + + core + admin_system + t_thursday + Thursday + + + core + admin_system + t_wednesday + Wednesday + + + core + admin_system + t_tuesday + Tuesday + + + core + admin_system + t_monday + Monday + + + core + admin_system + t_sunday + Sunday + + + core + admin_system + t_am + am + + + core + admin_system + t_pm + pm + + + core + admin_system + t_midday + Midday + + + core + admin_system + t_midnight + 0 - Midnight + + + core + admin_system + t_daymonth + Every Day of the Month + + + core + admin_system + t_dayweek + Every Week Day + + + core + admin_system + t_minute + Every Minute + + + core + admin_system + t_hour + Every Hour + + + core + admin_system + edittask_button + Edit Task + + + core + admin_system + t_creating + Creating New Task + + + core + admin_system + task_edit_title + Editing Task: %s + + + core + admin_system + t_create + Create New Task + + + core + admin_system + t_enterfile + You must enter a filename for the task to run. + + + core + admin_system + t_edited + Task Edited Successfully + + + core + admin_system + t_saved + Task Saved Successfully + + + core + admin_system + t_noedit + You are unable to edit this task. + + + core + admin_system + t_ran + Task ran successfully + + + core + admin_system + t_nolocate + Cannot locate: %s/tasks/%s + + + core + admin_system + t_entertitle + You must enter a task title. + + + core + admin_system + t_locked + This task was locked at %s and cannot be ran until unlocked. + + + core + admin_system + t_notask + No task to run. + + + core + admin_system + t_disabled + This task has been disabled. Please enable the task before running it. + + + core + admin_system + t_noid + No ID was passed. Please try again. + + + core + admin_system + t_locknomore + Task lock removed + + + core + admin_system + t_deleted + Task deleted + + + core + admin_system + t_removed + Selected Task Logs Removed + + + core + admin_system + t_nodelete + You are unable to delete this task. + + + core + admin_system + s_open_basedir_good_noval + open_basedir is enabled. + + + core + admin_system + s_open_basedir_bad + We recommend enabling the PHP configuration option open_basedir and setting it to your webroot and temporary directory. If you do not manage your server yourself, your hosting provider will be able to assist with this. + + + core + admin_system + s_open_basedir + Enable open_basedir + + + core + admin_system + s_open_basedir_good + %s]]> + + + core + admin_system + s_functions_good + All of the recommended functions to disable have been disabled on your server. + + + core + admin_system + s_functions_bad + %s]]> + + + core + admin_system + s_functions + Disable Dangerous PHP Functions + + + core + admin_system + s_virus_nolocated + Please scan regularly to ensure that your system is secure.]]> + + + core + admin_system + s_virus_found + Suspicious Files Detected + + + core + admin_system + s_virus_none + No Suspicious Files Detected + + + core + admin_system + s_virus_located + If you're unsure of their origin, please remove them immediately.]]> + + + core + admin_system + s_allex_good + If you're unsure of their origin, please investigate them immediately.]]> + + + core + admin_system + s_allex_bad + %s of %s files are rating 7/10 or more.
    If you're unsure of their origin, please investigate them immediately.]]>
    +
    + + core + admin_system + s_virus_good + The unauthorized file checker was last run: ]]> + + + core + admin_system + s_phpcgi + IP.Board PHP/CGI .htaccess Protection + + + core + admin_system + s_phpcgi_good + IP.Board has located some .htaccess files.]]> + + + core + admin_system + s_phpcgi_bad + IP.Board cannot locate any .htaccess files.]]> + + + core + admin_system + s_virus + IP.Board Unauthorized File Checker + + + core + admin_system + s_virus_bad + The unauthorized file checker has not been run in over a week]]> + + + core + admin_system + s_written_to + Written .htaccess to %s... + + + core + admin_system + s_skipped + Skipped %s, could not write into it... + + + core + admin_system + s_deep_nav + Deep Scan + + + core + admin_system + s_rename + + + + core + admin_system + s_rename_good + The admin directory HAS been renamed.]]> + + + core + admin_system + s_htaccess_nav + ACP .htaccess + + + core + admin_system + s_rename_nav + Rename the admin directory + + + core + admin_system + s_chmod_good + CHMOD change completed. + + + core + admin_system + s_chmod_bad + Could not complete the process.
    Please use your FTP client to change the CHMOD value of 'conf_global.php' to 0444.]]>
    +
    + + core + admin_system + s_rename_bad + The admin directory has not been renamed.]]> + + + core + admin_system + s_conf_bad + "conf_global.php" is writeable.]]> + + + core + admin_system + s_deep_good + The scanner was last run: ]]> + + + core + admin_system + s_learnmore + Learn More + + + core + admin_system + s_htaccess + IP.Board ACP .htaccess Protection + + + core + admin_system + s_deep_bad + The scanner has not been run in over a month]]> + + + core + admin_system + s_htaccess_bad + IP.Board cannot locate an ACP .htaccess file.]]> + + + core + admin_system + s_toggle + Toggle Now + + + core + admin_system + s_htaccess_good + IP.Board has located an ACP .htaccess file.]]> + + + core + admin_system + s_runtool + Run Tool Now + + + core + admin_system + q_components + Components Menu System + + + core + admin_system + q_components_info + Menu text is the actual menu item text. IE: Tools and Settings.
    Menu URL is the final part of the URL. No need to add the full URL or the 'section=components&act=blog' part unless this is a redirect. IE: code={code}
    Menu Redirect if yes, complete the 'act={}§ion={}&do={}' part of the URL in the URL box or the redirect may not work.
    Perm Bit and Perm Lang is the ACP restriction perm bit. Entries: add, remove, edit, rebuild, recount, recache all have language entries. Any other bit names will require adding into the Perm Bit Language box. Eg: If the perm bit was 'tools', you may enter 'Allow TOOLS Access'.
    ]]>
    +
    + + core + admin_system + s_deep + IP.Board Executables Deep Scan + + + core + admin_system + q_nohelp + No help information is available for this function at present. + + + core + admin_system + q_upload + Upload Permissions + + + core + admin_system + q_upload_info +
  • You have entered a reasonable numerical figure in the groups 'Max upload file size' field.
  • You have edited the forum permissions for this group and checked the 'Upload' checkbox. This allows you to control in which forums this group can upload to.

    Warning!
    If, when posting, no post is made and you are returned back to the community index, disable this groups upload by entering 0 into this field. This will turn off the mutli-part form the uploads use.]]> + + + core + admin_system + q_promote + Group Promotion + + + core + admin_system + q_promote_info +
    Many administrators use this feature to set up a 'Senior Members' group with more functionality (such as a longer edit time, larger post uploads) and even allow access to otherwise hidden forums - when your members have made enough posts, they are promoted to this group allowing you to intice more posting and allow for a more restrictive set of permissions for newcomers.

    Warning!
    Use this feature carefully and always check the information before proceeding.
    It is possible to advance to an Admin group - you have been warned.]]>
    +
    + + core + admin_system + q_captcha + Registration CAPTCHA + + + core + admin_system + q_captcha_info +
    When enabled, a random 6 digit numerical string is generated and shown in a graphical format (to prevent advanced bots from reading the source page). The user must enter this string exactly when registering or the account will not be created.]]>
    +
    + + core + admin_system + s_conf + + + + core + admin_system + s_allex + All Executables + + + core + admin_system + s_conf_good + "conf_global.php" is NOT writeable.]]> + + + core + admin_system + q_bulk + Bulk Emailing + + + core + admin_system + q_bulk_info + Overview
    Bulk emailing allows you to target a specific section of your community or email all your registered members.

    Settings
    You can choose which user groups will receive the email.
    Allowed Tags
    Although the email system sends the mail via BCC to preserve system resources, you can add in dynamic content with the following tags.
    {board_name} will return the name of your community
    {reg_total} will return the total number of registered members
    {total_posts} will return the total number of posts
    {busy_count} will return the most number of online users
    {busy_time} will return the date of the most online users
    {board_url} will return the URL to the community

    As the email is sent via BCC, it is not possible to include the members username, password or other user profile data.]]>
    +
    + + core + admin_system + s_completeform + You must complete the form. Please try again. + + + core + admin_system + s_written + Authentication files written + + + core + admin_system + q_bots + What are Search Engine Spiders? + + + core + admin_system + q_bots_info + Invision Power can take advantage of separating the bots from the real users and you can then ensure that they are getting adequate information to help with search engine ranking.

    Warning!
    IP.Board recognises the search engine spiders and crawlers by their user_agent. Please keep in mind that it's not impossible to fake this and a malicious user could pose as a harmless search engine spider.
    This is not a problem as by default the spider will have guest permissions, but it's something that you should keep in mind when allowing permissions.

    Also keep in mind that most search engines do NOT search dynamically generated website for fear of crashing the server with the constant reading of topics.]]>
    +
    + + core + admin_system + q_multi + Moderators and Topic Multi-Moderation + + + core + admin_system + q_multi_info + For example, if one of your multi-moderation actions allowed the topic to be moved and you do not allow move permissions the moderator will still be able to use the topic multi-moderation and move the topic.]]> + + + core + admin_system + w_nav + Welcome + + + core + admin_system + q_html + Posting HTML + + + core + admin_system + q_html_info +
    Warning!
    Allowing a member to post HTML is a very dangerous thing, you should not enable this functionality on any group that will use it maliciously. Although IPB tries to filter some of the more harmful content, it is NOT foolproof and this tag CAN be used to steal session cookies, redirect members and destroy the topic view layout.
    IP.Board and Invision Power Services will not be held responsible for any misfortune that occurs from the usage of this tag.

    Use it wisely!]]>
    +
    + + core + admin_system + ll_noid + No log for that ID found. + + + core + admin_system + ll_msg + The red cross indicates an error when logging in and a green tick indicates a successful log in.]]> + + + core + admin_system + ll_title + ACP Log-in Attempts + + + core + admin_system + d_aunable + Unable to obtain process information]]> + + + core + admin_system + d_aon + ON + + + core + admin_system + d_aoff + OFF + + + core + admin_system + d_anoinfo + No Information]]> + + + core + admin_system + d_aavail + Available Physical Memory + + + core + admin_system + d_atotal + Total Physical Memory + + + core + admin_system + d_aphpinfo + PHP INFO + + + core + admin_system + d_atitle + IP.Board Diagnostics + + + core + admin_system + d_dfix + Fix + + + core + admin_system + d_dstatus + Status + + + core + admin_system + d_dnav + Database Structure Results + + + core + admin_system + d_dtbl + Table + + + core + admin_system + d_dtitle + IP.Board Diagnostics - Database Structure Checker + + + core + admin_system + d_iman + , or you can run the following queries manually: + + + core + admin_system + d_iauto + Click here to fix this table]]> + + + core + admin_system + d_inauto + Click here to fix this table's indexes]]> + + + core + admin_system + d_ifix + Fix + + + core + admin_system + d_iresults + Database Index Results + + + core + admin_system + d_ifixall_link + Would you like us to attempt to fix them for you? + + + core + admin_system + d_itable + Table + + + core + admin_system + d_iindex + Index Name + + + core + admin_system + d_icongrats + There were no errors found with your database indexes. + + + core + admin_system + d_inav + Database Index Results + + + core + admin_system + d_isorry + Sorry, those queries are not allowed for your safety. + + + core + admin_system + d_ifixall + We have found problems with your database, and have listed them below. + + + core + admin_system + d_inoerrors + No Errors Found + + + core + admin_system + d_inoprocess + There was an error and we could not process your %s_tables.php file. Please reupload it. + + + core + admin_system + d_iupload + You must upload: /install/sql/%s_tables.php from the IP.Board installation package for your current version to run this tool. + + + core + admin_system + d_ierror + SQL Error: + + + core + admin_system + d_iexecuted + Executed Successfully
    ]]>
    +
    + + core + admin_system + d_idomanual + + + + core + admin_system + d_ititle + IP.Board Diagnostics - Database Index Checker + + + core + admin_system + d_wclear + All files appear to be in good order + + + core + admin_system + d_wfound + has whitespace at the beginning or end of the file + + + core + admin_system + d_wnav + Whitespace Check Results + + + core + admin_system + d_wtitle + IP.Board Diagnostics - Whitespace Checker + + + core + admin_system + d_pno + The following file or folder is not writable + + + core + admin_system + d_pyes + is writable + + + core + admin_system + d_p404 + We could not find the file or folder + + + core + admin_system + d_pnav + Permission Check Results + + + core + admin_system + d_ptitle + IP.Board Diagnostics - Permission Checker + + + core + admin_system + d_vnav + Version Check Results + + + core + admin_system + d_vinfo + Version Information + + + core + admin_system + d_vtitle + IP.Board Diagnostics - Version Checker + + + core + admin_system + chckr_fix + Fix + + + core + admin_system + chckr_status + Status + + + core + admin_system + chckr_table + Table + + + core + admin_system + last_5_version_history + Version History (Last 5) + + + core + admin_system + system_processes + System Processes + + + core + admin_system + sy_devcomponents + Components + + + core + admin_system + sy_devgroups + Groups + + + core + admin_system + sy_devlogin + Log In Auth + + + core + admin_system + sy_devtaks + Tasks + + + core + admin_system + sy_devpages + Pages + + + core + admin_system + sy_devskin + Skin Set + + + core + admin_system + sy_devfile + File Types + + + core + admin_system + sy_devcontent + Content Templates + + + core + admin_system + sy_devtemplate + Template HTML + + + core + admin_system + sy_devemail + Email Templates + + + core + admin_system + sy_go + Go + + + core + admin_system + sy_devexport + Export Installer XML + + + core + admin_system + language_word_pack_no_results + No results found + + + core + admin_system + language_total_entries + Total Entries + + + core + admin_system + language_customized_entries + Customized Entries + + + core + admin_system + language_out_of_date_entries + Out of Date Entries + + + core + admin_system + language_pack_name + Pack Name + + + core + admin_system + language_default + Default Text + + + core + admin_system + language_key + Key + + + core + admin_system + language_word_revert + Language customization has been reverted + + + core + admin_system + language_pack_updated + Language pack information updated + + + core + admin_system + language_locale_missing + Language locale can not be blank + + + core + admin_system + language_title_missing + Language title can not be blank + + + core + admin_system + language_form_default + Default Language? + + + core + admin_system + language_form_locale + Language Locale + + + core + admin_system + language_word_pack_current + Default Value + + + core + admin_system + language_word_pack_new + New Value + + + core + admin_system + language_word_pack_edited + Word pack updated + + + core + admin_system + language_form_edit_title + Edit Language Pack Information + + + core + admin_system + language_form_edit_button + Save Changes + + + core + admin_system + language_form_edit_info + Language Pack Information


    You can configure basic language pack settings here

    ]]>
    +
    + + core + admin_system + language_form_title + Language Title + + + core + admin_system + language_pack_created + Language pack created + + + core + admin_system + language_form_new_info + Language Pack Information


    You can configure basic language pack settings here

    ]]>
    +
    + + core + admin_system + language_form_new_button + Add this language + + + core + admin_system + language_form_new_title + Create a new language pack + + + core + admin_system + language_list_translate + Translate in Admin CP... + + + core + admin_system + language_list_translate_ext + Translate Externally... + + + core + admin_system + language_list_default + Default + + + core + admin_system + language_word_pack_go + Go + + + core + admin_system + language_word_pack_edit + Edit word pack + + + core + admin_system + language_list_page_title + Localization Manager + + + core + admin_system + language_list_title + Language + + + core + admin_system + language_list_date + Date Example + + + core + admin_system + language_list_money + Currency Example + + + core + admin_system + language_list_local + Locale + + + core + admin_system + sys_this_will_examine_the_corecach + This will examine the cache/lang_cache/master_lang/ directory for {app}_language.php files and import them into the database. + + + core + admin_system + sys_import + Import + + + core + admin_system + sys_developers_language_cache_impo + + + + core + admin_system + sys_select_the_application_languag + Select the application language files to import + + + core + admin_system + sys_indev_export + Export language files to application directories + + + core + admin_system + sys_indev_export_go + Export + + + core + admin_system + lang_sections_title + Language Sections + + + core + admin_system + indev_lang_export_done + All language files exported to application directories + + + core + admin_system + lang_upload_too_large + %s.]]> + + + core + admin_system + lang_upload_other_error + An error occurred while attempting to upload the language pack. + + + core + admin_system + l_badfile + There was no language pack information in the file you uploaded + + + core + admin_system + sys_or_enter_the_filename_of_the_x + OR enter the filename of the xml.gz language pack]]> + + + core + admin_system + sys_the_file_must_be_uploaded_into + + + + core + admin_system + sys_duplicate_entries_will_not_be_ + Duplicate entries will not be overwritten but the default setting and other options will be updated. + + + core + admin_system + sys_upload_xml_language_file_from_ + Upload language pack from your computer + + + core + admin_system + sys_import_language_xml + Import Language XML + + + core + admin_system + sys_version + Version + + + core + admin_system + sys_sql_version + SQL Version + + + core + admin_system + tmdebug_on + ON + + + core + admin_system + tmdebug_logs + View Logs + + + core + admin_system + topicmarkingdebug + Topic Marking Debug + + + core + admin_system + sys_avail_mem + Available Server Memory + + + core + admin_system + sys_total_mem + Total Server Memory + + + core + admin_system + sys_status + Status + + + core + admin_system + sys_log + Log + + + core + admin_system + sys_system_overview + System Overview + + + core + admin_system + sys_ipboard_version + IP.Board Version + + + core + admin_system + sys_php_version + PHP Version + + + core + admin_system + sys_disabled_funcs + Disabled PHP Functions + + + core + admin_system + sys_safe_mod + Safe Mode + + + core + admin_system + sys_sys_software + System Software + + + core + admin_system + sys_current_load + Current Server Load + + + core + admin_system + sys_last_5_acp_log_in_attempts + Latest ACP Log in Attempts + + + core + admin_system + sys_name + Name + + + core + admin_system + sys_view_details + View Details + + + core + admin_system + sys_date + Date + + + core + admin_system + sys_all_times_gmt_gmt_time_now_is + All times GMT. GMT time now is: + + + core + admin_system + sys_delete_task + Delete Task... + + + core + admin_system + sys_unlock_task + Unlock Task... + + + core + admin_system + sys_edit_task + Edit Task... + + + core + admin_system + sys_how_curl_to_use_in_a_cron + Show CURL to use in a cron + + + core + admin_system + sys_run + Run + + + core + admin_system + sys_mday + MDay + + + core + admin_system + sys_wday + WDay + + + core + admin_system + sys_min + Min + + + core + admin_system + sys_hour + Hour + + + core + admin_system + sys_next_run + Next Run + + + core + admin_system + sys_system_schedular + System Scheduler + + + core + admin_system + sys_task_safe_mode + Task Safe Mode + + + core + admin_system + sys_if_set_to_yes_this_will_not_be + + + + core + admin_system + sys_enable_task + Enable Task? + + + core + admin_system + sys_if_you_are_using_cron_you_migh + If you are using CRON, you might wish to disable this task from the internal manager. + + + core + admin_system + sys_task_key + Task Key + + + core + admin_system + sys_this_is_used_to_call_a_task_wh + This is used to call a task where the ID of the task might change + + + core + admin_system + sys_task_time_month_day + Task Time: Month Day + + + core + admin_system + sys_choose_every_day_to_run_each_d_1 + + + + core + admin_system + sys_enable_task_logging + Enable Task Logging + + + core + admin_system + sys_will_write_to_the_task_log_eac + Will write to the task log each time the task is run, not recommended for regular tasks run every few minutes. + + + core + admin_system + sys_task_time_hours + Task Time: Hours + + + core + admin_system + sys_choose_every_hour_to_run_each_ + + + + core + admin_system + sys_choose_every_day_to_run_each_d + + + + core + admin_system + sys_task_time_week_day + Task Time: Week Day + + + core + admin_system + sys_choose_every_minute_to_run_eac + + + + core + admin_system + sys_task_php_file_to_run + Task PHP File To Run + + + core + admin_system + sys_this_is_the_php_file_that_is_r + This is the PHP file that is run when the task is run. + + + core + admin_system + sys_task_time_minutes + Task Time: Minutes + + + core + admin_system + sys_time_options + Time Options + + + core + admin_system + sys_task_application + Task Application + + + core + admin_system + sys_task_short_description + Task Short Description + + + core + admin_system + sys_task_title + Task Title + + + core + admin_system + sys_minutes_past_the_first_availab + minutes past the first available hour + + + core + admin_system + sys_hours + hours + + + core + admin_system + sys_every_minute + Every minute + + + core + admin_system + sys_minutes + minutes + + + core + admin_system + sys_every + Every + + + core + admin_system + sys_on_every_hour + On every hour + + + core + admin_system + sys_on + On + + + core + admin_system + sys_at + At + + + core + admin_system + sys_on_day + On day + + + core + admin_system + sys_delete_logs + DELETE Logs + + + core + admin_system + sys_sunday + Sunday + + + core + admin_system + sys_monday + Monday + + + core + admin_system + sys_tuesday + Tuesday + + + core + admin_system + sys_wednesday + Wednesday + + + core + admin_system + sys_thursday + Thursday + + + core + admin_system + sys_friday + Friday + + + core + admin_system + sys_saturday + Saturday + + + core + admin_system + sys_delete_logs_older_than_n_days + n days]]> + + + core + admin_system + sys_delete_logs_for_task + Delete logs for task + + + core + admin_system + sys_delete_task_manager_logs + Delete Task Manager Logs + + + core + admin_system + sys_view_logs + View Logs + + + core + admin_system + sys_show_n_log_entries + n log entries]]> + + + core + admin_system + sys_view_logs_for_task + View logs for task + + + core + admin_system + sys_view_task_manager_logs + View Task Manager Logs + + + core + admin_system + sys_last_5_run_tasks + Last 5 Run Tasks + + + core + admin_system + sys_log_info + Log Info + + + core + admin_system + sys_date_run + Date Run + + + core + admin_system + sys_task_run + Task Run + + + core + admin_system + sys_task_manager_logs + Task Manager Logs + + + core + admin_system + sys_loaded_ext + Loaded Extensions + + + core + admin_system + logindetail_get + GET Data (URL Data) + + + core + admin_system + logindetail_success + Success + + + core + admin_system + logindetail_post + POST Data (Form Data) + + + core + admin_system + logindetail_username + Username + + + core + admin_system + logindetail_ip + IP Address + + + core + admin_system + logindetail_time + Log in Time + + + core + admin_system + lang_reimport_done + Language Re-Import Done + + + core + admin_system + cannot_delete_default_lang + You cannot delete the default language pack + + + core + admin_system + logindetail_basic + Basics + + + core + admin_system + starting_admin_import + Starting Admin import... + + + core + admin_system + importing_x_langs + : Importing %s languages... + + + core + admin_system + rebuild_lang_from_xml + Rebuild From XML... + + + core + admin_system + run_task_now + Run task now + + + core + admin_system + sys_options + Options + + + core + admin_system + sys_title + Title + + + core + admin_system + sym_add_new_language_entry + Add String + + + core + admin_system + sym_find + Find + + + core + admin_system + sym_submit + Submit + + + core + admin_system + sym_word_out_of_date_check + Outdated Strings + + + core + admin_system + sym_edit_language_pack_information + Edit Language Info + + + core + admin_system + sym_view_word_packs + View Word Packs + + + core + admin_system + language_recache_done + Recache complete + + + core + admin_system + language_list_recache + Recache all... + + + core + admin_system + sym_add_new_task + Add New Task + + + core + admin_system + sym_export_tasksxml + Export tasks.xml + + + core + admin_system + sym_import_tasksxml + Import tasks.xml + + + core + admin_system + sym_manage_languages + Manage Languages + + + core + admin_system + ext_all_killed + Translation Session Removed + + + core + admin_system + ext_tbl_local + Last Local Edit + + + core + admin_system + ext_tbl_db + Last DB Update + + + core + admin_system + ext_tbl_submit + Import Selected Files + + + core + admin_system + ext_translation_detected + here to go there now.
    You will not be able to start a new session until you finish the current one.]]>
    +
    + + core + admin_system + ext_tbl_file + File + + + core + admin_system + ext_button_finish + Finish And Remove + + + core + admin_system + ext_button_unselect + Unselect All + + + core + admin_system + ext_button_selectall + Select All + + + core + admin_system + ext_button_smodified + Select Modified + + + core + admin_system + ext_top_desc + Before editing, please set your text editor to save files as UTF-8 regardless of the character set your community uses.]]> + + + core + admin_system + ext_top_title + External File Translation + + + core + admin_system + ext_recache + recache this set to view the changes throughout the community.]]> + + + core + admin_system + ext_file_written + Imported %s (%s added entries, %s updated) + + + core + admin_system + ext_title_for + External Translation For + + + core + admin_system + ext_no_selected_files + You did not select any files to import! + + + core + admin_system + ext_no_translate_files + Could not locate a valid translate session. This could be because there are no files in the translate directory anymore + + + core + admin_system + ext_chmod_translate_dir + + + + core + admin_system + connections__headers1 + HTTPS Headers + + + core + admin_system + connections__output1 + Output (first 2000 characters): + + + core + admin_system + taskthereforrun + Task will therefore run: + + + core + admin_system + connections__message + This tool is designed to verify that your server can make outbound connections to another server. Many features in IP.Board require outbound connection capability (such as IP.Chat, License verification, and Facebook Connect), and this tool verifies the underlying outbound connectivity is functioning correctly. + + + core + admin_system + lang_pack_protected + Can not translate protected language pack + + + core + admin_system + perm_check_results + Permissions Check Results + + + core + admin_system + ext_no_translate_dir + root forum directory (the same directory that contains your 'initdata.php' file and 'admin' folder). Please make sure PHP has write permissions into this directory. CHMOD 0777 if in doubt.]]> + + + core + admin_system + langpackaddapp + Application + + + core + admin_system + cannot_delete_protected_lang + Can not delete protected language pack + + + core + admin_system + nolangpacksgroup + There are no word packs for this application + + + core + admin_system + logindetails + Log in Details + + + core + admin_system + ipaddyprefix + IP: + + + core + admin_system + selectimeunitsabove + Select time units above + + + core + admin_system + cp_topics + Topics + + + core + admin_system + cp_awaitingmoderation + Awaiting Moderation + + + core + admin_system + cp_posts + Posts + + + core + admin_system + cp_view + View + + + core + admin_system + connectionchecker + Connection Checker + + + core + admin_system + connections__headers + HTTP Headers + + + core + admin_system + connections__output + Output (first 2000 characters): + + + core + admin_system + cp_onlinenow_info + (Includes Members and Guests) + + + core + admin_system + cp_manage + Manage + + + core + admin_system + cp_lockedaccounts + Locked Accounts + + + core + admin_system + cp_spammeraccounts + Spammers + + + core + admin_system + cp_coppaaccounts + COPPA Accounts + + + core + admin_system + cp_awaitingvalidation + Awaiting Validation + + + core + admin_system + cp_totalmembers + Total Members + + + core + admin_system + cp_onlinenow + Online Now + + + core + admin_system + cp_systemstats + System Statistics + + + core + admin_system + sys_taskislocked + The task is currently locked + + + core + admin_system + where_user_lang_choice_desc + Select the language you want to switch FROM + + + core + admin_system + where_touser_lang_choice + Switch to... + + + core + admin_system + where_touser_lang_choice_desc + Select the language you want to switch TO + + + core + admin_system + update_lang_prefs + Swap Language Choice + + + core + admin_system + def_lang_sel + (Default Language) + + + core + admin_system + mem_lang_choice_swapped + The member language choice has been swapped + + + core + admin_system + indev_lang_import + Imported %s (%s added, %s updated)... + + + core + admin_system + where_user_lang_choice + If using... + + + core + admin_system + sys_lang_choice_swap + Swap Member Language Choice + + + core + admin_system + no_reg_x_days + No registrations in the last %s days + + + core + admin_system + cannot_write_to_cache + Cannot write to cache/lang_cache/%s + + + core + admin_system + q_ok + Query ran sucessfully + + + core + admin_system + q_fail + Query failed + + + core + admin_system + l_textexistsalready + The language string that you are attempting to add already exists. + + + core + admin_system + task_cronmode_enable + Enable cron Mode + + + core + admin_system + task_cronmode_desc_14 + If you ever want to stop using the cron and start using the System Scheduler again, use the button below to re-enable all tasks. + + + core + admin_system + task_cronmode_desc_11 + 2. Make sure any tasks that you previously disabled to run by individual crons are re-enabled and those crons deleted on the server. + + + core + admin_system + task_cronmode_desc_12 + + + + core + admin_system + task_cronmode_desc_13 + 4. Set up a cron to run the command below every minute: + + + core + admin_system + task_cronmode_desc_9 + To set up a cron for all tasks + + + core + admin_system + task_cronmode_desc_10 + If you want all tasks to run by cron rather than just a number of individual tasks, you can set up one cron to run every minute which will run tasks as they are needed. + + + core + admin_system + task_cronmode_desc_8 + not need to use the 'Enable cron mode' button below if you are only setting individual tasks to run by cron.]]> + + + core + admin_system + task_cronmode_on + You have enabled cron mode for managing tasks. To revert back to using System Scheduler for handling tasks, click the button below. + + + core + admin_system + task_cronmode_disable + Disable cron Mode + + + core + admin_system + task_cronmode_desc_1 + + + + core + admin_system + task_cronmode_desc_2 + This feature is provided for advanced users only. If you do not follow the instructions below correctly, tasks may not run properly which will introduce problems. + + + core + admin_system + task_cronmode_desc_3 + To set up a cron for one task + + + core + admin_system + task_cronmode_desc_4 + 1. chmod the /interface/task.php file to 0777. + + + core + admin_system + task_cronmode_desc_5 + 2. In the System Scheduler, disable the task. This can be done in the task settings. It is important that you disable the task to stop the System Scheduler running it as well as your cron. + + + core + admin_system + task_cronmode_desc_6 + 3. A new option will appear in place of the button to run the task, when clicked, this will display the cron that is required. Set up a cron on your server with the same time settings the task already has to run that command. + + + core + admin_system + task_cronmode_desc_7 + If you ever want to stop using the cron and start using the System Scheduler again, simply disable the cron and re-enable the task. + + + core + admin_system + task_interface_warn + The file interface/task.php is not chmod to 0777. This is necessary in order for running tasks by cron to work. + core admin_system task_cron_mode_toggled_1 Cron mode enabled - Режим Cron включен + + + core + admin_system + task_cron_mode_toggled_0 + Cron mode disabled + + + core + admin_system + task_cron_single_desc + + + + core + admin_system + task_use_cron + Use Cron + + + core + admin_system + email_tester_subject + Subject + + + core + admin_system + email_tester_subject_default + IP.Board Email Test + + + core + admin_system + email_tester_message_default + This is an IP.Board Email Test message. If you received this, it works. + + + core + admin_system + email_tester_message + Message + core admin_system email_tester_from From - От + core admin_system email_tester_to_desc Use an email that you have access to so you can verify it was received. - Используйте e-mail, к которому вы имеете доступ, чтобы удостовериться, что все работает. + core admin_system email_tester_desc This tool will send an email using the normal IP.Board email routines. You can use this tool to test that your server is able to send emails correctly. - Эта утилита необходима для проверки отправки писем из IP.Board на вашем сервере. + core admin_system email_tester_to To - Кому + core admin_system email_tester Email Tester - Тестер e-mail - - core - admin_templates - vse_cancel_vse - Cancel Visual Editor - Отменить Визуальный Редактор - - core - admin_templates - vse_launch_vse - Launch visual editor - Запустить визуальный редактор - - core - admin_templates - vse_basic_settings - Basic Settings - Основные Настройки - - core - admin_templates - sk_xr_info - Replacements are exported into XML format. This option may not work properly if your server has safemode enabled. - Если сервер работает в безопасном режиме - эта опция может работать некоректно.]]> - - core - admin_templates - sk_xs_info2 - Please choose how deep this export should look for customizations. - Опция позволяет установить глубину экспорта изменений стиля. + core admin_templates sk_xi_info Image sets are exported into the XML archive format. This is not suitable for safemode users and in such a case we recommend you manually download via FTP and ZIP the images. - Изображения экпортируются в формате XMLarchive. Этот метод не подходит, если используется безопасный режим PHP. Для таких случаев рекомендуется скачать изображения вручную через FTP. + core admin_templates - sk_exportreplaces - Export Replacements - Экспорт макросов - - core - admin_templates - sk_xs_info - Please select which skin set (HTML templates, CSS and Replacements) you wish to export. - Пожалуйста, выберите стиль для экспорта. - - core - admin_templates - sk_exportimages - Export Skin Images - Экспорт изображений - - core - admin_templates - sk_imageset - Image Set - Какие изображения экспортировать? - - core - admin_templates - sk_fromskinset - From Skin Set - Какие макросы экспортировать? + sk_xr_info + Replacements are exported into XML format. This option may not work properly if your server has safemode enabled. + core admin_templates sk_skinset Skin Set - Какой стиль экспортировать? + core admin_templates - sk_exporttemplates - Export Skin Templates - Экспорт стилей + sk_imageset + Image Set + + + core + admin_templates + sk_fromskinset + From Skin Set + + + core + admin_templates + sk_exportimages + Export Skin Images + + + core + admin_templates + sk_exportreplaces + Export Replacements + + + core + admin_templates + sk_xs_info + Please select which skin set (HTML templates, CSS and Replacements) you wish to export. + + + core + admin_templates + sk_xs_info2 + Please choose how deep this export should look for customizations. + core admin_templates sk_uploadxmlreplace Upload XML Replacements Set - Загрузка XML-архива с макросами + core admin_templates - sk_none - None - Никакой + sk_exporttemplates + Export Skin Templates + core admin_templates sk_importreplacements Import Replacements - Импорт макросов + + + core + admin_templates + sk_none + None + core admin_templates sk_applytoskin Apply To Skin Set - Какой стиль использовать с импортируемой директорией? + core admin_templates sk_applytoskin_info If you do not wish to assign to a skin set, leave on -None-. - Если вы не хотите сейчас выбрать это, выберите «Никакой». + core admin_templates sk_newimgsetname New Image Set Name - Название директории изображений: - - core - admin_templates - sk_uploadimgxml - Upload XML(Archive) Image Set - Загрузка XML-архива с изображениями + core admin_templates sk_importimgset Import Image Set - Импорт изображений + + + core + admin_templates + sk_uploadimgxml + Upload XML(Archive) Image Set + core admin_templates sk_useimageset_info If you have not yet uploaded the image set, leave on -None-. - Если вы не хотите сейчас выбрать это, выберите «Никакую». - - core - admin_templates - sk_doupgrade - Check this if you are uploading an upgrade for an existing skin - Проверьте это если вы загружаете или обновляете существующий стиль - - core - admin_templates - sk_useimageset - Use Image Set - Какую директорию с изображениями использовать в этом стиле? - - core - admin_templates - sk_xmlorxmlgz - - - - core - admin_templates - sk_ornamearchive - OR enter the filename of the XML Archive]]> - ИЛИ введите название файла-архива]]> - - core - admin_templates - sk_intoroot - - Этот файл должен быть загружен в корневую директорию вашего форума. - - core - admin_templates - sk_importskinset - Import Skin Set - Импорт шаблонов стиля - - core - admin_templates - sk_fail_cache - IP.Board cannot write to your /cache/skin_cache/ directory which means imports may fail! - Невозможна запись в директорию /cache/skin_cache/, импорт невозможен. - - core - admin_templates - sk_uploadxmlarchive - Upload XML(Archive) Skin Set - Загрузка XML-архива с шаблонами - - core - admin_templates - sk_upgrade - Upgrade existing skin? - Обновить существующий стиль? - - core - admin_templates - sk_newsetname - New Skin Set Name - Название стиля: - - core - admin_templates - sk_leaveblank - Leave blank to use the name in the XML Archive. - Оставьте поле пустым, если хотите, чтобы использовать название шаблонов из XML-архива + core admin_templates sk_fail_images IP.Board cannot write to your /public/style_images/ directory which means imports may fail! - Невозможна запись в директорию /public/style_images/, импорт невозможен. + core admin_templates - sk_export - Export - Экспорт + sk_uploadxmlarchive + Upload XML(Archive) Skin Set + core admin_templates - sk_cssapphide_desc - Will not include this CSS file if not in the application specified above - Этот CSS не будет включатся, если указанное приложение не активно + sk_doupgrade + Check this if you are uploading an upgrade for an existing skin + core admin_templates - sk_cssapphide - - Скрыть, если ключ приложения не совпадает с текущим ? + sk_newsetname + New Skin Set Name + core admin_templates - sk_cssattributes_desc - - + sk_leaveblank + Leave blank to use the name in the XML Archive. + core admin_templates - sk_cssmodules - Module Keys - Ключи модуля + sk_upgrade + Upgrade existing skin? + core admin_templates - sk_cssmodules_desc - Separate many with comma]]> - Разделяются запятыми.]]> - - core - admin_templates - sk_cssattributes - Attributes - Атрибуты - - core - admin_templates - sk_cssapp - Application Key - Ключ приложения - - core - admin_templates - sk_cssposition - Include Position - Включить позицию - - core - admin_templates - sk_cssposition_desc - Position this css file is inserted in the page - Позиция вставки этого файла - - core - admin_templates - sk_cssapp_desc - Used to tie this CSS file to a particular application - Используется для привязки CSS к определенному приложению - - core - admin_templates - sk_add - Add - Добавить - - core - admin_templates - sk_datavariables - Data Variables - Переменные данных - - core - admin_templates - sk_newgroup - or Create New Group]]> - или Создать новую группу]]> - - core - admin_templates - sk_group - Add to Group - Добавить в группу - - core - admin_templates - sk_alphanumericonly - Alphanumerics only, no spaces - Только цифры и буквы, без пробелов - - core - admin_templates - sk_cssname - CSS File Name - Имя CSS-файла - - core - admin_templates - sk_bitname - Template Bit Name - Название шаблона - - core - admin_templates - sk_addcssfile - Add CSS File - Добавить CSS-файл - - core - admin_templates - sk_editvariables - Edit Template Variables - Изменить переменные шаблона - - core - admin_templates - sk_addbit - Add New Bit - Добавить новый - - core - admin_templates - sk_cssprops - CSS Properties - СSS свойства - - core - admin_templates - sk_variables - Variables - Переменные - - core - admin_templates - sk_comparediff - Compare Differences - Сравнить различия - - core - admin_templates - sk_css - CSS - CSS - - core - admin_templates - sk_updateproperties - Update properties - Обновить свойства - - core - admin_templates - sk_templates - Templates - Шаблоны - - core - admin_templates - sk_editingset - Editing Set - Редактирование стиля - - core - admin_templates - sk_editreplacevar - Edit Replacement Variables - Редактировать макросы - - core - admin_templates - sk_editcssprops - Edit CSS Properties (Advanced Users) - Редактирование CSS (для опытных) - - core - admin_templates - sk_editcss - Edit CSS - Изменить CSS - - core - admin_templates - sk_edittemplates - Edit Templates - Редактирование шаблонов - - core - admin_templates - sk_l_new_full - Added Template Bit - Добавленные шаблоны - - core - admin_templates - sk_l_inherited_full - Inherited changed from parent set - Измененные наследования - - core - admin_templates - sk_l_new - New - Новый - - core - admin_templates - sk_l_inherited - Inherited - Наследованные - - core - admin_templates - sk_l_modified_full - Modified in this set - Измененные в этом стиле - - core - admin_templates - sk_editreplace - Edit This Replacement - Изменить макрос - - core - admin_templates - sk_l_default - Default - По умолчанию - - core - admin_templates - sk_l_default_full - Unmodified in this set - Не измененные в этом стиле - - core - admin_templates - sk_l_modified - Modified - Измененные - - core - admin_templates - sk_revertreplace - Revert This Replacement - Отменить этот макрос - - core - admin_templates - sk_removereplace - Remove This Replacement - Удалить этот макрос - - core - admin_templates - sk_replacementadd - Add New Replacement - Добавить макрос - - core - admin_templates - sk_legend - Legend - Легенда - - core - admin_templates - sk_replacekey - Replace Key - Ключ замены - - core - admin_templates - sk_replacecontent - Replace Content - Заменяется на - - core - admin_templates - sk_replacements - Replacements - Макросы - - core - admin_templates - sk_cancel - Cancel - Отмена - - core - admin_templates - sk_replace_info - {style_images_url} can be used. When displayed in the skin, this tag gets converted into the appropriate image URL for this skin.]]> - {style_images_url} там где необходим URL к изображениям стиля.]]> - - core - admin_templates - sk_position - Position - Позиция - - core - admin_templates - sk_replaceinset - Replacements In Set - Макросы стиля - - core - admin_templates - sk_editskinsettings - Edit Skin Settings - Настройки стиля - - core - admin_templates - sk_edittempcss - - Редактирование шаблонов и CSS - - core - admin_templates - sk_cssfilename - CSS File Name - Имя CSS-файла - - core - admin_templates - sk_usestyleurl - {style_images_url} inplace of your IMG dir URL.
    For Example: {style_images_url}/image.png is parsed as: %s/image.png]]>
    - {style_images_url} там где нужен URL директории изображений.
    Например: -{style_images_url}/image.png выведет %s/image.png]]>
    - - core - admin_templates - sk_editing - Editing - Редактирование - - core - admin_templates - sk_differences - Difference Report - Отчет о различиях - - core - admin_templates - sk_revert - Revert - Отменить - - core - admin_templates - sk_newcss - New CSS in this skin set - Новые CSS в этом стиле - - core - admin_templates - sk_modifiedcss - Modified CSS in this skin set - Измененные CSS в этом стиле - - core - admin_templates - sk_unmodifiedcss2 - Unmodified CSS in this skin set, but modified CSS in parent skin(s) - Не измененные CSS в этом стиле, но измененные в родительском - - core - admin_templates - sk_unmodifiedcss - Unmodified CSS in this skin set - Не измененные CSS в этом стиле - - core - admin_templates - sk_cssfor - CSS For - CSS для - - core - admin_templates - sk_addnewcss - Add New CSS File - Добавить CSS-файл - - core - admin_templates - sk_addnewsettoparent - Add A New Set To This Parent - Добавить стиль для этого родителя - - core - admin_templates - sk_setname - Set Name - Название - - core - admin_templates - sk_outputformat - Output Format - Формат - - core - admin_templates - sk_notempcache - No template caches found! - Кеш шаблонов не найден! - - core - admin_templates - sk_pleasebuildthem - Please build them now! - Пожалуйста, обновите их сейчас! - - core - admin_templates - sk_editsettings - Edit Settings - Настройки - - core - admin_templates - sk_managetempcss - - Управление шаблонами и CSS - - core - admin_templates - sk_managereplacements - Manage Replacements - Управление макросами - - core - admin_templates - sk_manageuagentmapping - Manage User Agent Mapping - Управление переназначениями по User Agent - - core - admin_templates - sk_manageurlmapping - Manage URL Mapping - Управление переназначениями по URL - - core - admin_templates - sk_skinsets - Skin Sets - Стили - - core - admin_templates - sk_addnewrootskin - Create New Skin Set - Создать новый стиль - - core - admin_templates - sk_importnewskin - Import Skin Set - Импортировать стиль - - core - admin_templates - sk_pleaseconfirminfo - You are about to remove skin set %s
    There is no way to undo this action, and this is the last confirmation screen. Only press the button below if you mean to do this!]]>
    - Удаление стиля %s
    -Это действие нельзя отменить. Нажмите на кнопку ниже для продолжения.]]>
    - - core - admin_templates - sk_skinmanagement - Skin Management - Управление стилями - - core - admin_templates - sk_removeskinset - Remove Skin Set - Удалить стиль - - core - admin_templates - sk_pleaseconfirm - Please Confirm - Подтвердите выполнение - - core - admin_templates - sk_removingset - Removing Set - Удаление стиля - - core - admin_templates - sk_templatexmllast - templates.xml last updated - templates.xml обновлен - - core - admin_templates - sk_forapps - For Applications - Для приложений - - core - admin_templates - sk_members - Members - Пользователей - - core - admin_templates - sk_forums - Forums - Форумов - - core - admin_templates - sk_usedefault - Use Default - По умолчанию - - core - admin_templates - sk_resetto - Reset To: - Переустановить на - - core - admin_templates - sk_wheretheyuse - Where They Use: - Использующих стиль - - core - admin_templates - sk_reset - Reset - Переустановить - - core - admin_templates - sk_rebuildmasterdata - Rebuild Master Skin Data - Обновить данные базового стиля - - core - admin_templates - sk_rebuild - Rebuild - Обновить - - core - admin_templates - sk_rebuildhtml - Rebuild HTML - Обновить HTML - - core - admin_templates - sk_rebuildcss - Rebuild CSS - Обновить CSS - - core - admin_templates - sk_rebuildreplacements - Rebuild Replacements - Обновить макросы - - core - admin_templates - sk_allskinsets - All Skin Sets - Все стили - - core - admin_templates - sk_resetskinusage - Reset Skin Set Usage - Переустановка стилей - - core - admin_templates - sk_imageoptions - Image Options - Настройки изображений - - core - admin_templates - sk_useimgdir - Use image directory? - Директория с изображениями - - core - admin_templates - sk_useimgdir_info - The image directory will be used in place of {style_images_url} in CSS and replacements. - Директория изображений будет заменяться {style_images_url} в CSS и макросах. - - core - admin_templates - sk_useemoset - Use emoticons set? - Используемые смайлики - - core - admin_templates - sk_useemoset_info - Choose which set of emoticons to assign to this skin. - Выберите, какие смайлики будут использоваться в этом стиле. - - core - admin_templates - sk_setauthor - Set Author - Сведения об авторе - - core - admin_templates - sk_setauthorname - Set Author Name - Имя - - core - admin_templates - sk_recacheskinsets - Recache Skin Sets - Обновление кеш-файлов - - core - admin_templates - sk_skintools - Skin Tools - Обновление HTML шаблонов - - core - admin_templates - sk_setauthorurl - Set Author Website Address - Домашняя страница - - core - admin_templates - sk_cachecss_info - Warning: Changing this value will re-cache any cached stylesheet information. Please make sure that you have synchronized any cache files with the database.]]> - Внимание: Изменение значения этой опции обновит все кеши CSS стилей. Убедитесь, что все ваши кеши CSS синхронизированы с базой данных.]]> - - core - admin_templates - sk_cachecss - Cache CSS to text files? - Кешировать CSS стили в файл? - - core - admin_templates - sk_cssoptions - CSS Options - Hастройки CSS - - core - admin_templates - sk_hideskin_info - If you are choosing to tie user-agents to this skin, you may wish to remove it from the drop down list - Если стилю назначены user-agent, то, возможно, вы хотите скрыть его в меню выбора стиля. - - core - admin_templates - sk_optional - Optional - Не обязательно - - core - admin_templates - sk_hideskin - Hide this skin from the drop down list? - Скрыть от пользователей? - - core - admin_templates - sk_skinsetkey - Skin Set Key? - Ключ стиля - - core - admin_templates - sk_skinsetparent - Skin Set Parent? - Родительский стиль - - core - admin_templates - sk_temp_diff - Template Differences - Различия шаблонов - - core - admin_templates - sk_setasdefault_info - Make this the default skin? - Сделать стилем по умолчанию? - - core - admin_templates - sk_setasdefault - Set as default skin? - Установить как стиль по умолчанию. - - core - admin_templates - sk_defaultalready - Skin set as default already. - Стиль уже является стилем по умолчанию. - - core - admin_templates - sk_versions - Versions - Версии - - core - admin_templates - sk_settitle - Set Title - Название - - core - admin_templates - sk_basics - Basics - Основные - - core - admin_templates - sk_setoutputformat - Set Output Format - Формат - - core - admin_templates - sk_setperms - Set Permissions - Настройки доступа - - core - admin_templates - sk_selectallgroups - Select ALL current and future groups or... - Доступен всем группам пользователей - - core - admin_templates - sk_selectwhichgroups - Select which groups have access to this skin. - Выберите группы пользователей, которые будут иметь доступ к стилю. - - core - admin_templates - sk_selectmorethanone - You may select more than one. - Вы можете выбрать несколько групп. - - core - admin_templates - sk_useragents - User Agents - User Agents - - core - admin_templates - sk_groups - Groups - Группы - - core - admin_templates - sk_uagentmappingfor - User Agent Mapping for - Переназначения по User Agent для - - core - admin_templates - sk_url - URL - URL - - core - admin_templates - sk_url_info - Enter the string to match in the query string - Введите строку для совпадения со строкой запроса - - core - admin_templates - sk_urlremappingfor - URL Remapping For - Переназначения URL для - - core - admin_templates - sk_addnewurl - Add New URL - Добавить URL - - core - admin_templates - sk_added - Added - Добавлено - - core - admin_templates - sk_useragent_info - You can apply groups and individual agents to this skin.
    NOTE: IP.Board will let you apply the same user-agent to many skins as you can have different permissions. It is therefore conceivable that two or more skins have the same permissions and the same user-agents. If this happens, IP.Board will just select the first available which may or may not be the same one each time depending on the position of the skin in the cache.]]>
    - -Вы можете назначить группы или отдельных агентов к стилю.
    -ЗАМЕЧАНИЕ: Вы можете назначить одинаковый user-agent к разным стилям. Если это произойдет, то IP.Board выберет первый доступный стиль, что может не совпасть с вашим выбором.]]>
    - - core - admin_templates - sk_removemapping - REMOVE Mapping - Удалить переназначение - - core - admin_templates - sk_noremapping - There are no skin set URL remappings set up for this skin set currently. - Переназначений URL для этого стиля ещё не создано. - - core - admin_templates - sk_mappedurls - Mapped URLs - Переназначенные URLы - - core - admin_templates - sk_editmapping - Edit Mapping - Редактировать переназначение - - core - admin_templates - sk_type_info - - - - core - admin_templates - sk_type - Type - Тип - - core - admin_templates - sk_title_info - The title is for your information only so you can distinguish between items. - Необходим для различия переназначений в списке. - - core - admin_templates - sk_skipnewmiss - Skip all new/missing template bits? - Пропускать все новые/ошибочные шаблоны? - - core - admin_templates - sk_skipnewmiss_info - If you are comparing an old ipb_templates.xml file from an older IPB release, then you may wish to disable this. If you are comparing an XML file from a customized skin set, you should enable this. - - - core - admin_templates - sk_title - Title - Название - - core - admin_templates - sk_generalsettings - General Settings - Основные настройки - - core - admin_templates - sk_urlmapfor - URL Map For - Переназначения URL для - - core - admin_templates - sk_selectskinxml_info - - Будет произведено сравнение с HTML шаблонами главного стиля - - core - admin_templates - sk_selectskinxml - Select a valid XML skin export file from your computer. - Выберите корректный файл «ipb_templates.xml». - - core - admin_templates - sk_createnewskindiff - Create New Skin Differences Report - Создать новый отчет сравнения стилей - - core - admin_templates - sk_enterdifftitle - Enter a new skin difference title - Введите название - - core - admin_templates - sk_import - Import - Импорт - - core - admin_templates - sk_createhtmlexport - Create HTML Export - Экспортировать в HTML - - core - admin_templates - sk_removediffresults - REMOVE Difference Results - УДАЛИТЬ результаты сравнения - - core - admin_templates - sk_difftitle - Title - Название - - core - admin_templates - sk_viewdiffresults - View Merge Results - Просмотр результатов сравнения - - core - admin_templates - sk_created - Created - Создано - - core - admin_templates - sk_skindiffreports - Template Merge Reports - Отчет сравнения стилей - - core - admin_templates - sk_clickviewreport - Click here to view the report]]> - Нажмите здесь для просмотра отчета]]> - - core - admin_templates - sk_bitsof - template bits of %s processed - шаблонов %s обработано - - core - admin_templates - sk_error - Error - Ошибка: - - core - admin_templates - sk_skindiff - Skin Differences - Различия стилей - - core - admin_templates - sk_processing - Processing - Обработка - - core - admin_templates - sk_nodiffs - No skin differences to show - Нет отчетов сравнения стилей - - core - admin_templates - sk_viewdiffs - View Differences - Просмотр различий - - core - admin_templates - sk_changed - Changed - Изменен - - core - admin_templates - sk_skindiffreport - Template Merge Report - Отчет сравнения стилей - - core - admin_templates - sk_new - New - Новый - - core - admin_templates - sk_howmanytemps - %s new template bits, %s changed template bits - Новых шаблонов: %s , измененных шаблонов: %s - - core - admin_templates - sk_regularexpression - Regular Expression - Включить регулярные выражения? - - core - admin_templates - sk_title_export - export - экспорт - - core - admin_templates - sk_exported - Exported - Экспортировано - - core - admin_templates - sk_searchfor - Search For - Поиск по... - - core - admin_templates - sk_replacewith - Replace With - Заменить на... - - core - admin_templates - sk_replacewith_info - (Optional: Omitting will perform just a search) - (Опционально: Если вы хотите сделать замену) - - core - admin_templates - sk_searchininfo - Search in selected set and all parents including the master set. - Также искать в родительских стилях, включая главный стиль. - - core - admin_templates - sk_selectskinset - Select a skin set - Выберите стиль - - core - admin_templates - sk_searchandreplace - Search and Replace - Поиск и замена - - core - admin_templates - sk_continue - Continue - Искать и заменить - - core - admin_templates - sk_run - Run - Запуск - - core - admin_templates - sk_searchreplaceinfo - - - - core - admin_templates - sk_submit - Submit - Установить - - core - admin_templates - sk_replaceselected - Replace Selected - Заменить выбранные - - core - admin_templates - sk_removedhtml - Removed HTML - Удаленный HTML - - core - admin_templates - sk_addedhtml - Added HTML - Добавленный HTML - - core - admin_templates - sk_easylogochanger - Easy Logo Changer - Простая смена логотипа - - core - admin_templates - sk_save - Save - Сохранить - - core - admin_templates - sk_uploadlogo_info - Browse your computer for a logo to upload. Filename must end in .gif, .jpg, .jpeg or .png - Выберите файл для загрузки с вашего компьютера. Файл должен иметь разрешение .gif, .jpg, .jpeg или .png - - core - admin_templates - sk_applywhichset - Apply to which skin set? - Применить к следующему набору стилей: - - core - admin_templates - sk_applywhichset_info - This will change the replacement macro for your community header. You can revert at any time. - Если вы уже изменяли шапку стиля из «Управления шаблонами», то это действие удалит все ваши изменения. - - core - admin_templates - sk_uploadlogo - OR upload a new logo]]> - ИЛИ загрузить новый логотип]]> - - core - admin_templates - sk_urlnewlogo_info - You can use a relative URL or a full URL starting with http:// - Вы можете использовать относительные ссылки или полный URL, начинающийся с http:// - - core - admin_templates - sk_urlnewlogo - URL to new logo - Ссылка на логотип - - core - admin_templates - sk_elc_warning - WARNING: Unable to upload into '/public/style_images/'. If you wish to upload a file, please CHMOD that directory now!]]> - ВНИМАНИЕ: Невозможно загрузить файл в '/public/style_images/'. Если вы хотите загрузить файл, то измените права доступа к этой директории.]]> - - core - admin_templates - el_wrongformat - The file you uploaded is not in the correct format. It has to be one of the following: GIF, JPG/JPEG, or PNG. - Загруженный файл имеет не верное расширение. Оно должно быть одним из следующих: GIF, JPG/JPEG, PNG. - - core - admin_templates - sk_close - Close - Закрыть - - core - admin_templates - sk_ajax_noperm - You do not have permission to use this function - У вас нет прав для использования этой функции - - core - admin_templates - sk_writemaster - - Записать шаблоны в директорию базового стиля - - core - admin_templates - el_log - Logo Changed and Skin Set Caches Rebuilt (Skin ID: %s ) - Логотип изменен, кеш стиля обновлен (ID стиля: %s) - - core - admin_templates - el_nofile - You must either upload a new logo or enter a URL for a new logo. Please try again - Вы должны либо загрузить новый логотип, либо ввести ссылку на существующий - - core - admin_templates - el_noskinid - No skin set ID was passed. Please try again, ensuring you select a skin - Не передан ID стиля. Попробуйте еще раз. - - core - admin_templates - el_chmod - - - - core - admin_templates - sm_skinnone - Select One - Выберите - - core - admin_templates - ua_nav2 - Manage User Agents in - Управление User Agents в - - core - admin_templates - ua_nav1 - - Управление стилями и шаблонами - - core - admin_templates - um_nav2 - Manage URL Remapping in - Управление переназначениями URL для - - core - admin_templates - ua_saved - User Agent Settings Saved - Настройки user agent сохранены - - core - admin_templates - um_savechanges - Save Changes - Сохранить - - core - admin_templates - um_nav1 - - Управление стилями и шаблонами - - core - admin_templates - um_editremap - Edit Remapping - Редактировать переназначения - - core - admin_templates - um_noid - No ID was passed. Please try again. - Не указан ID. Попробуйте ещё раз. - - core - admin_templates - um_addnew - Add New Skin Remap - Добавить переназначение - - core - admin_templates - um_contains - Contains - Содержит - - core - admin_templates - um_isexactly - Is Exactly - В точности - - core - admin_templates - um_edited - Skin Remap Edited - Переназначение для стиля изменено - - core - admin_templates - um_added - Skin Remap Added - Переназначение для стиля добавлено - - core - admin_templates - um_removed - Remapping removed - Переназначение удалено - - core - admin_templates - um_entireform - You must complete the entire form. Please try again. - Форма должна быть заполнена полностью. - - core - admin_templates - to_recachedset - Recached set: - Обновлен кеш стиля: - - core - admin_templates - to_phprebuilt - PHP Templates Rebuilt For: - PHP шаблоны пересозданы для: - - core - admin_templates - to_templatetools - Template Tools - Инструменты - - core - admin_templates - to_rebuildcomplete - Rebuild complete - Обновление завершено - - core - admin_templates - to_masterhtml - - - - core - admin_templates - to_mastercssrebuilt - - - - core - admin_templates - to_noapps - No apps to rebuild! - Нет приложения для обновления. - - core - admin_templates - to_forumsupdated - forums updated - форумов обновлено - - core - admin_templates - to_membersupdated - members updated - пользователей обновлено - - core - admin_templates - to_masterskinrebuilt - Master rebuilt for set ID: - Базовый стиль обновлен для ID: - - core - admin_templates - to_resultxmlimp - Result of template XML importing... - Результат XML импорта шаблонов... - - core - admin_templates - to_masterreplace - Master Replacements Rebuilt - Базовые макросы обновлены - - core - admin_templates - to_resultrebuild - Skin data successfully imported - Стиль успешно импортирован - - core - admin_templates - to_resultbuild - Result of building for release... - Результат сборки для релиза... - - core - admin_templates - te_nav1 - - Управление стилями и шаблонами - - core - admin_templates - te_nav2 - Manage Templates in - Управление шаблонами в - - core - admin_templates - to_recache_done - Skin set(s) recached successfully - Кеширование стилей завершено - - core - admin_templates - to_writetoprs - Cannot write to /admin/setup/xml/skins/ - Невозможна запись в /public/resources/skins/ - - core - admin_templates - to_replacerecached - Replacements recached for - Завершено кеширование макросов для - - core - admin_templates - to_couldnotwrite - Could not write - Невозможна запись - - core - admin_templates - to_wrote - Wrote - Записано - - core - admin_templates - to_xmltempsavedout - XML Templates Saved Out - XML шаблоны сохранены - - core - admin_templates - to_alldone - All Done! - Завершено! - - core - admin_templates - ss_saveset - Save Set - Сохранить стиль - - core - admin_templates - ss_manageskinsets - Manage Skin Sets - Управление стилем - - core - admin_templates - ss_addnewset - Add New Set - Создание нового стиля - - core - admin_templates - ss_edituserset - Edit User Set - Редактирование стиля - - core - admin_templates - ss_dontmoveintoself - You cannot move this skin set into its own parent tree - Нельзя наследовать стиль от самого себя - - core - admin_templates - ss_skinsetsaved - Skin Set Saved - Настройки стиля сохранены - - core - admin_templates - ss_unavailable - Unavailable, IP.Board cannot write into your 'public/style_css' folder]]> - Недоступно, IP.Board не может записывать файлы в директорию 'public/style_css' ]]> - - core - admin_templates - ss_emodirnoexist - The emoticons directory you selected does not exist. - Выбранная директория смайликов не существует. - - core - admin_templates - ss_imgdirnoexist - The image directory you selected does not exist. - Выбранная директория изображений не существует. - - core - admin_templates - ss_specifyname - You must specify a set name. - Вы должны ввести имя для этого пакета. - - core - admin_templates - ss_nogroupaccess - No group has access to this skin. At least ensure that one group has access. - Хотя бы одна группа пользователей должна иметь доступ к стилю. - - core - admin_templates - ss_noid - No ID was passed. Please try again. - ID не найден. Попробуйте еще раз. - - core - admin_templates - ss_cannotremove - Cannot remove this skin set - Невозможно удалить стиль - - core - admin_templates - ss_setremoved - Set Removed - Стиль удален - - core - admin_templates - ss_authkeyerror - Authorization Key Error - Ошибка ключа авторизации - - core - admin_templates - sd_nocontent - There was no content in the file to process - Файл не был загружен - - core - admin_templates - ss_masterwritten - Master skin has been written - Базовый стиль записан - - core - admin_templates - sd_noid - No skin ID passed. Please try again. - Не найден ID стиля. Попробуйте еще раз. - - core - admin_templates - sd_title - Comparison from skin set: - Сравнение для стиля: - - core - admin_templates - sd_entertitle - You must enter a title - Вы должны вве��ти ��азвание - - core - admin_templates - sd_removed - Differences report removed - Отчет об изменениях удален - - core - admin_templates - sd_nosession - Could not get the current template compare session. - Невозможно получить текущую сессию сравнения шаблонов. - - core - admin_templates - sr_sometext - You must enter some text to search by - Вы не ввели значение для поиска. - - core - admin_templates - sr_nomatches - No Matches Found! - Не найдено ни одной записи, соответствующей искомой строке. Попробуйте еще раз и расширьте диапазон поиска. - - core - admin_templates - re_nav1 - - Управление стилями и шаблонами - - core - admin_templates - re_nav2 - Manage Replacements in - Редактировать макросы в - - core - admin_templates - ie_ex_skin - Export customizations in this skin only - Экспортировать изменения только этого стиля - - core - admin_templates - ie_ex_skin_p - Export customizations in this skin and any parent skins - Экспортировать изменения этого стиля и родительских - - core - admin_templates - ie_set_imported - %s template(s) added, %s replacement(s) added, %s CSS file(s) added.]]> - шаблонов добавлено: %s, заменено: %s, CSS файлов добавлено: %s]]> - - core - admin_templates - ie_none - - None - - Никакую - - core - admin_templates - ie_set_upgraded - %s template(s) edited, %s replacement(s) edited, %s CSS file(s) edited.]]> - шаблонов добавлено: %s, заменено: %s, CSS файлов добавлено: %s]]> - - core - admin_templates - sk_cleanup_title - Clean Up Tools - Инструменты очистки - - core - admin_templates - sk_cleanup_templates - Clean Up Templates Database - Очистка базы данных - - core - admin_templates - sk_cleanup_templates_exp - - Инструмент позволяет очистить базу от старых и потерянных шаблонов, которые больше не используются в системе. - - core - admin_templates - templates_NO_SUCH_TEMPLATE - We could not find the template bit you were attempting to edit. Reload the form and try again. - Система не смогла найти шаблон, который вы пытаетесь изменить. Попробуйте обновить форму и попробовать снова. - - core - admin_templates - ie_images_added - %s image(s) added - Изображений добавлено: %s - - core - admin_templates - ie_importfail_no - Import Failed: Nothing to import! - Ошибка импортирования: Нечего импортировать! - - core - admin_templates - ie_importfail - Import Failed: - Ошибка импортирования: - - core - admin_templates - ie_replace_added - %s replacement(s) imported - %s макросов импортировано - - core - admin_templates - cs_nav2 - Manage CSS in - Управление CSS в - - core - admin_templates - ss_revertcomplete - Revert Complete - Отмена завершена - - core - admin_templates - cs_nav1 - - Управление стилями и шаблонами - - core - admin_templates - sk_revert_replacements - replacement customizations - изменений макросов - - core - admin_templates - sk_revert_button - Revert Customizations - Отменить изменения - - core - admin_templates - sk_revert_templates - template customizations - изменений шаблонов - - core - admin_templates - sk_revert_desc - Please select which customizations to remove. The default template, CSS, and replacement items will be restored once the customizations have been removed. There is no undo. - Выберите изменения для удаления. После удаления будут восстановлены шаблоны и стили по умолчанию. Это действие нельзя отменить. - - core - admin_templates - sk_revert_customizations - Revert all CSS and Template Customizations... - Отменить все изменения CSS и шаблонов - - core - admin_templates - sk_revert_title - Reverting Customizations for: - Отмена изменений для: - - core - admin_templates - sk_clean_caches_cb_tem - Template Files - Файлы шаблона - - core - admin_templates - sk_clean_caches_cb_css - CSS Files - CSS файлы - - core - admin_templates - sk_clean_caches - Clean File Caches For: - Очистить кеш файлы: - - core - admin_templates - sk_cleanup_css - Clean Up CSS Database - Очистка CSS - - core - admin_templates - sk_cleanup_css_exp - - Инструмент позволяет очистить систему от потерянных и старых CSS, которые уже не используются - - core - admin_templates - tool_cache_clean_desc - Result: %s css cache files removed, %s template cache files removed - Результат: удалено %s кешей css, %s кешей шаблонов - - core - admin_templates - tool_cache_clean_run - Cache File Cleanup Performed - Очистка файлов кеша выполнена - - core - admin_templates - tool_css_clean_desc - Result: %s cache entries removed, %s CSS entries removed - Результат: удалено %s кешей и %s CSS - - core - admin_templates - tool_css_clean_run - CSS Database Cleanup Performed - Очистка CSS выполнена - - core - admin_templates - tool_template_clean_run - Template Database Cleanup Performed - Очистка шаблонов выполнена - - core - admin_templates - tool_template_clean_desc - Result: %s cache entries removed, %s template entries removed - Результат: удалено %s кешей и %s шаблонов - - core - admin_templates - templates_TEMPLATE_EXISTS - The template bit name already exists in this group. Please give the template a different name. - Шаблон с таким именем уже существует в данной группе. - - core - admin_templates - sk_revert_css - CSS customizations - изменений CSS - - core - admin_templates - templates_SYNTAX_INCORRECT - There is a syntax error in the template, usually caused by PHP code not properly formed. Please correct the error and hit save again. - В шаблоне обнаружена ошибка синтаксиса. Проверьте правильность содержимого шаблона и попробуйте сохранить его снова. - - core - admin_templates - tt_ss_of - This is the default set for this output engine - Этот стиль отмечен, как основной, для данного формата вывода. - - core - admin_templates - sk_run_tool - Run Tool - Запустить - - core - admin_templates - ss_defaultdone - Skin set made default - Стиль отмечен как основной. - - core - admin_templates - tt_ss_of_off - Click to make this set the default set for this output engine - Отметить стиль, как основной, для данного формата вывода. - - core - admin_templates - ss_not_hidden - This set is NOT hidden from the public drop down. Click to hide - Стиль отображается в списке стилей. Скрыть его. - - core - admin_templates - ss_hidden - This set is hidden from the public drop down. Click to make visible - Стиль не отображается в списке стилей. Сделать его видимым. - - core - admin_templates - ss_hiddentoggled - Visibility toggled. Note: hiding from the public drop down still allows access via direct URL and via user agent mapping. To fully restrict access please edit the settings and restrict by member group. - Видимость переключена. Примечание: скрытие стиля из списка не запрещает просматривать форум в этом стиле при указании ID стиля в URL, он так же будет доступен и пользователям, попадающим под user agent. Для полного запрета использования стиля необходимо изменить настройки пользовательских групп. - - core - admin_templates - ss_canttoggle - You cannot toggle the visibility of a default skin - Базовый стиль не может быть скрыт - - core - admin_templates - ss_minify - Compress Cached CSS? - Сжимать кешированные CSS? - - core - admin_templates - ss_minify_desc - This will remove whitespace and comments to reduce filesize. Changes will take affect next time you recache this skin. - Будут удалены пробелы и комментарии для уменьшения размера файла. Изменения вступят в силу при следующем перекешировании стиля. - - core - admin_templates - ss_importexport - Skin Import/Export - Импорт/Экспорт стилей - - core - admin_templates - used_in_no_others - (Used in %s) - (Используется в %s) - - core - admin_templates - none_root_set - None - Root Skin Set - Никакой - Базовый стиль - - core - admin_templates - reset_for - Reset For: - Переустановить для: - - core - admin_templates - used_in_plus_others - (Used in %s and %s other(s)) - (Используется в %s и в %s других) - - core - admin_templates - uagent_mapping - User Agent Mapping - Переназначение по User Agent - - core - admin_templates - sk_for_apps_desc - - Укажите приложения, которые вы хотите включить в экспорт - - core - admin_templates - sandr_search_results_for - Search Results For: - Результаты поиска для: - - core - admin_templates - diff_folder_error - Folder %s was missing or empty - Директория %s отсутствует или пуста - - core - admin_templates - sk_for_apps - Include Templates For Applications: - Включая шаблоны для приложений: - - core - admin_templates - addrep_btn_f_tpl - Add Replacement - Добавить макрос - - core - admin_templates - diff_folder_path - Or enter the name of a folder (in root forum folder) that contains valid application template XML files]]> - ИЛИ введите имя директории (в корневой директории форума), содержащей XML файлы шаблонов приложения]]> - - core - admin_templates - rep_ctn_f_tpl - Replacement Content - Содержимое - - core - admin_templates - add_repl_f_tpl - Add Replacement - Добавить макрос - - core - admin_templates - rep_key_f_tpl - Replacement Key - Ключ - - core - admin_templates - ajax_missing_data - Missing Data - Отсутствуют данные - - core - admin_templates - basicwrittenpre - Wrote: - Записан: - - core - admin_templates - basiccouldnotwrite - Error: Could not write - Ошибка записи - - core - admin_templates - basicnothingtowritepre - Error: No content to write for - Ошибка записи: отсутствует содержимое для записи - - core - admin_templates - sd_exception - There was an error initiating the skin merge report. - Возникла ошибка при подготовке отчета объединения стилей. - - core - admin_templates - fatalnotemplsafe - Fatal! %scache/skin_cache not writeable - please change permissions via FTP or turn on Safe Mode - %scache/skin_cache не доступен для записи, попробуйте изменить права доступа через FTP-клиент или включите безопасный режим стилей в настройках форума - - core - admin_templates - templatefilenowrite - cache/skin_cache/cacheid_%s/%s.php not writeable - cannot cache to PHP file - cache/skin_cache/cacheid_%s/%s.php не имеет прав на запись - не удалось создать файл PHP кеша - - core - admin_templates - fatalnotemplatew - Fatal! cannot create: cache/skin_cache/cacheid_%s/ - Не удалось создать cache/skin_cache/cacheid_%s/ - - core - admin_templates - safemodeenablednow - Safe Mode Enabled: Skipping Writing CSS Cache Files - Включен режим безопасности стилей: пропущено создание CSS кешей - - core - admin_templates - fatalnotwreite - Fatal! %s/style_css not writeable - please change permissions via FTP or turn on Safe Mode - %s/style_css не доступен для записи, попробуйте изменить права доступа через FTP-клиент или включите безопасный режим стилей в настройках форума - - core - admin_templates - cssdirnotwritaaaable - public/style_css/css_%s/ not writeable - public/style_css/css_%s/ не доступен на запись - - core - admin_templates - cssfilenotwriteable - public/style_css/css_%s/%s.css not writeable - public/style_css/css_%s/%s.css не доступен на запись - - core - admin_templates - couldnotcreatecssdir - Fatal! cannot create: public/style_css/css_%s/ - Не удалось создать public/style_css/css_%s/ - - core - admin_templates - cpltrebuildfromcaches - Completed database rebuild from PHP cache files. - Кеш стилей в базе обновлен из PHP файлов. - - core - admin_templates - tplbitimported - %s imported (Added %s; updated %s template bits) - %s импортировано (добавлено %s; обновлено %s шаблонов) - - core - admin_templates - nogroupsforexportapp - Nothing to export for %s: No template bits - Нет данных для экспорта для %s - - core - admin_templates - nothingtoexportfor - Nothing to export for - Нет данных для экспорта для - - core - admin_templates - css_isnotwritable - is not writeable - не может быть записан - - core - admin_templates - csscreatedmsg - CSS for %s - %s created - CSS для %s - %s создан - - core - admin_templates - templatescreatedmsg - Templates for %s - %s created - Шаблон для %s - %s создан - - core - admin_templates - finishedcachinghtml - Done HTML templates rebuild... (Skin Set: %s) - Закончено обновление HTML шаблонов (Стиль: %s) - - core - admin_templates - basicimportedpre - Imported - Импортирован - - core - admin_templates - couldnotopenfile - Could not open %s for reading, skipping file... - Не удалось прочитать файл %s, пропускаем... - - core - admin_templates - couldnotfindlineeol - Could not find any line endings in %s, skipping file... - Похоже что файл %s пустой, пропускаем... - - core - admin_templates - nocsstoexport - No CSS to export for - Нет CSS для экспорта для - - core - admin_templates - couldnotlocate - Could not locate: - Не удалось найти: - - core - admin_templates - nothingtoexportforapp - Nothing to export for %s: No groups set in information.xml - Нет данных для экспорта для %s, отсутствуют данные групп в information.xml - - core - admin_templates - noreplacementstoexport - No replacements to export - Нет макросов для экспорта - - core - admin_templates - importnothingtoimport - : Nothing to import - : нет данных для импорта - - core - admin_templates - importaddupdate - %s: %s updated, %s added - %s: %s обновлено, %s добавлено - - core - admin_templates - xmldirnotwrite - /xml/ is not writeable - /xml/ не имеет прав на запись - - core - admin_templates - imagedirnotexists - Image directory %s does not exist - Директория изображений %s не существует - - core - admin_templates - xmldirmissing - /xml/ does not exist - /xml/ не существует - - core - admin_templates - noinfoxml - The info.xml file is empty or was not included - info.xml пуст или отсутсвует - - core - admin_templates - imagedircannotcreate - Could not create public/style_images/%s. Please check file permissions and try again. - Не удалось создать public/style_images/%s. Пожалуйста убедитесь, что права доступа выставленны правильно и повторите попытку. - - core - admin_templates - cannotwriteimageset - Could not write the image set to disk - Не удалось записать пакет изображений - - core - admin_templates - imagediralreadyexists - The directory public/style_images/%s already exists - Директория public/style_images/%s уже существует - - core - admin_templates - emptyxmlarchivei - The XML Archive is empty - XML-архив пуст - - core - admin_templates - invalidxmlarchivei - The content was not a valid XML Archive - Не является XML-архивом - - core - admin_templates - appxmlrecachedfor - App XML Written For %s - Записан XML для %s - - core - admin_templates - appcssrecachedfor - App CSS Written For %s - Записан CSS для %s - - core - admin_templates - reprebuilt_for - Replacements Rebuilt for %s - Макросы обновлены для %s - - core - admin_templates - replacerebuilt - Replacements Rebuilt - Макросы обновлены - - core - admin_templates - aborted_suffix - ABORTED - ОТМЕНЕНО - - core - admin_templates - templatesrecached_for - PHP Templates Recached for %s - Обновлены PHP кеши для %s - - core - admin_templates - cssrecached_for - CSS Recached for %s - Кеш CSS обновлен для %s - - core - admin_templates - ajax_tbmlll - Merging template bit changes - Результаты объединения шаблонов - - core - admin_templates - ajax_cssmlll - Merging CSS file changes - Внесение изменений в CSS - - core - admin_templates - skindiff_okmsg - Items updated - Элементы обновлены - - core - admin_templates - cannotcreatemasterdir - Could not create directory: %scache/skin_cache/master_skin please create it via FTP and run the tool again - Не удалось создать директорию: %scache/skin_cache/master_skin, попробуйте создать ее вручную, используя FTP клиент - - core - admin_templates - htmlrebuilt_for - HTML Rebuilt for %s - Обновление для %s - - core - admin_templates - cssrebuilt_for - CSS Rebuilt for %s - CSS обновлен для %s - - core - admin_templates - masterdircreatetitle - master_skin Directory Creation Results - Результаты создания master_skin директории - - core - admin_templates - ajax_cssdprocess - %s of %s CSS files processed... - %s из %s CSS файлов обработано... - - core - admin_templates - ajax_cssdlll - Checking for CSS file differences - Проверка изменений в CSS - - core - admin_templates - ajax_tbdlll - Checking for template bit differences - Поиск различий в шаблонах - - core - admin_templates - ajax_tbdprocess - %s of %s template bits processed... - %s из %s шаблонов обработано... - - - core - admin_templates - ajax_invalidsession - Could not locate a valid differences session - Не удалось найти сессию - - core - admin_templates - ajax_changescommitted - . Changes committed - . Изменений применено - - core - admin_templates - ajax_mergeconflicts - merge conflicts - конфликтов - - core - admin_templates - ajax_noconflicts - no conflicts - нет конфликтов - - core - admin_templates - ajax_newitem4thisv - New item for this version - Новый элемент - - core - admin_templates - ajax_resolvedconflicts - resolved conflicts - решенных конфликтов - - core - admin_templates - ajax_nosuchitemid - No such item ID - Нет элемента с таким ID - - core - admin_templates - nopreviouslystoredtemp - The merge tool is not available as you have no previously stored templates - Инструмент объединения недоступен, так как у вас нет старых шаблонов - - core - admin_templates - ajax_nokeyfound - No Key Found - Не найден ключ - - core - admin_templates - runnewreporton - Run a new report on: - Запустить для: - - core - admin_templates - minutepatience - Each step can take a few minutes, please be patient - Каждый шаг может занять несколько минут. - - core - admin_templates - resolve__go - Go - Ок - - core - admin_templates - resolvealluncommit - Revert Changes - Отменить изменения - - core - admin_templates - resolveallcommit - Save Changes To Skin - Сохранить изменения в стиль - - core - admin_templates - resolveallnewdefault - Auto Resolve: New Default Skin Wins - Автоматически: приоритет оригинальным изменениям - - core - admin_templates - resolveallcustom - Auto Resolve: Your Custom Skin Wins - Автоматически: приоритет пользовательским изменениям - - core - admin_templates - manuallyresolveconflict - Manually Edit/Resolve Conflicts... - Разрешение конфликтов вручную - - core - admin_templates - mergewithselected - With Selected: - С выбранным: - - core - admin_templates - viewmergepreview - View Merge Preview... - Предпросмотр объединения - - core - admin_templates - menu__oldnew - - - - core - admin_templates - menu__viewnewdef - View new default item - Просмотр нового - - core - admin_templates - menu__viewcustomized - View customized item - Просмотр измененного - - core - admin_templates - menu__vieworigdef - View original default item - Просмотр оригинального - - core - admin_templates - changescommitted - . Changes committed - Изменения приняты - - core - admin_templates - noconflicts - no conflicts - нет конфликтов - - core - admin_templates - mergeconflicts - merge conflicts - объединить конфликты - - core - admin_templates - resolvedconflicts - resolved conflicts - решенные конфликты - - core - admin_templates - mergereportdiffs - %s differences - %s различий - - core - admin_templates - mergenewitemversion - New item for this version - Новое для этой версии - - core - admin_templates - mergereportnoconflict - No conflicts - Нет конфликтов - - core - admin_templates - mergereportconflicts - %s conflicts - %s конфликтов - - core - admin_templates - resolve__custom - Resolve: Custom Wins - Решить: приоритет пользовательским изменениям - - core - admin_templates - resolve__new - Resolve: New Wins - Решить: приоритет новым изменениям - - core - admin_templates - mergereportnewitem - New item - Новое - - core - admin_templates - mergereportdifferences - %s differences - %s различий - - core - admin_templates - merge__showcommita - Committed - Внесено - - core - admin_templates - merge__showcommit - Uncommitted - Не внесено - - core - admin_templates - merge__showmerged - Merged - Объединено - - core - admin_templates - merge__showconflict - Conflicted - Конфликтует - - core - admin_templates - mergereporttitle - Merge Report - Отчет объединения - - core - admin_templates - mergerepoptions - Show... - Показать - - core - admin_templates - mergeexportprefix - - - - core - admin_templates - merge__showall - New/No Conflict - Новое/Без конфликтов - - core - admin_templates - ss_keynogoodyo - You cannot use that Skin Key as it is already in use. Please select another. - Вы не можете использовать этот ключ, так как он уже используется другим стилем. Пожалуйста, выберите другой. - - core - admin_templates - importmastertempl - - - - core - admin_templates - exportmastercss - - - - core - admin_templates - importmastercss - - - - core - admin_templates - ie_importfail_old_version - IP.Board %s. You are currently running IP.Board %s.
    You can continue but the skin may have errors or missing functionality.

    Continue and import skin]]>
    - IP.Board %s. Вы используете версию %s.
    Данную операцию можно продолжить, однако возможны проблемы в работе этого стиля.

    Продолжить -]]>
    - - core - admin_templates - skin_gen_new_vis_skin_title - New Visual Editor Skin - Создать новый визуальный стиль - - core - admin_templates - exportmastertempl - - - - core - admin_templates - runmergereports - Run Merge Report... - Запустить - - core - admin_templates - merge_done_desc - All your templates have been saved and are now 'live' on your community
    You can optionally edit them further or uncommit ('revert') the changes by using the checkboxes and drop down box.
    ]]>
    - Все ваши шаблоны сохранены и сейчас отображаются на 'живом' форуме
    При желании вы можете редактировать их дальше или отозвать (Обратить) сделанные изменения, просто проставив галочки напротив нужных и выбрать нужную операцию в выпадающем меню.
    ]]>
    - - core - admin_templates - merge_uncommitted_desc - You have %s items with uncommitted ('unsaved') changes.
    This means that although the items are now merged, they need to be committed ('saved') before the changes will show on your community. Please use the checkboxes and drop down to commit these changes.
    ]]>
    - У вас %s отозванных несохраненных изменений.
    Хоть элементы сейчас и объединены, но они требуют сохранения для того, чтобы они появились на работающем форуме. Вы можете сделать это просто проставив галочки напротив нужных пунктов и выбрать нужную операцию в выпадающем меню.
    ]]>
    - - core - admin_templates - merge_conflicts_desc - You have %s items with conflicts that need resolving.
    This means that the items could not be automatically 'merged'. You need to either edit them manually to 'resolve' the conflicts or use the 'resolve all' option to determine the final template.
    ]]>
    - У вас %s конфликтов, требующих исправления.
    Это означает, что эти элементы не могут быть автоматически объединены. Вам нужно или исправить конфликтные моменты вручную или использовать опцию 'Исправить все' для формирования окончательного шаблона.
    ]]>
    - - core - admin_templates - in - in - в - - core - admin_templates - skin_gen_desc - Created by visual editor - Создано через визуальный редактор - - core - admin_templates - skin_gen_new_vis_skin_desc - This new skin will remain hidden to others until you set it as visible. - Этот новый стиль будет оставаться скрытым от других пользователей, пока вы не сделаете его видимым. - - core - admin_templates - skin_gen_next_dotdotdot - Next... - Дальше... - - core - admin_templates - skin_gen_manual_title - Manual Mode - Ручной режим - - core - admin_templates - skin_gen_manual_desc - This gives you full control over the HTML and CSS code which is all fully editable for advanced layout changes. - Это даст вам возможность полностью изменять исходный коды HTML и CSS. - - core - admin_templates - skin_gen_next - Next - Дальше - - core - admin_templates - skin_gen_ready_button_launch - Launch visual editor - Запустить визуальный редактор - - core - admin_templates - skin_gen_ready_button_edit - Edit Skin Settings - Изменить настройки стиля - - core - admin_templates - skin_gen_new_title - Create New Skin - Создать новый стиль - - core - admin_templates - skin_gen_new_visual_title - Visual Editor - Визуальный редактор - - core - admin_templates - skin_gen_new_visual_desc - The visual editor allows you to change color and board width using a visual editor with instant preview. Please be aware that the visual editor should be considered a beta feature, and that additional improvements and features are expected yet. - Визуальный редактор позволяет изменять цвета дизайна вашего форума, щелкая прямо на визуальные элементы дизайна и задавая цвет. - - core - admin_templates - skin_gen_ready_title - New Skin Created - Новый стиль создан - - core - admin_templates - skin_gen_ready_desc - The skin has been created. Simply click the button below to launch a new browser window. - Стиль успешно создан. Для открытия в новом окне браузера просто нажмите на кнопку чуть ниже. - - core - admin_templates - skin_gen_convert_go - Convert Now - Конвертировать сейчас + sk_ornamearchive + OR enter the filename of the XML Archive]]> + core admin_templates sk_ee_title - Внешнее редактирование шаблонов и CSS + core admin_templates - sk_ee_enable - Enable external editing - Включить внешнее редактирование + sk_intoroot + + core admin_templates - skin_gen_convert_done - The skin has been converted - Стиль успешно сконвертирован + sk_useimageset + Use Image Set + core admin_templates - sk_ee_webdav_password - Password - Пароль + sk_xmlorxmlgz + + core admin_templates - sk_ee_main_title - External Editing - Внешнее редактирование + sk_fail_cache + IP.Board cannot write to your /cache/skin_cache/ directory which means imports may fail! + core admin_templates - sk_ee_main_desc - this page.]]> - по ссылке. ]]> + sk_export + Export + core admin_templates - skin_gen_convert_desc - This action cannot be undone.]]> - Вернуть назад будет невозможно.]]> + sk_importskinset + Import Skin Set + core admin_templates - skin_gen_convert_title - Convert to full skin - Конвертировать в полный стиль + sk_cssapphide_desc + Will not include this CSS file if not in the application specified above + core admin_templates - sk_ee_webdav_path - Path - Путь + sk_cssattributes_desc + + core admin_templates - sk_ee_webdav_username - Username - Имя пользователя + sk_cssapphide + + core admin_templates - sk_ee_webdav_ur_password - (Your Admin CP Password) - Ваш пароль к админцентру + sk_cssattributes + Attributes + core admin_templates - sk_ee_webdav_host - Server/Host - Сервер/Хост + sk_cssmodules_desc + Separate many with comma]]> + + + core + admin_templates + sk_cssapp_desc + Used to tie this CSS file to a particular application + + + core + admin_templates + sk_cssmodules + Module Keys + + + core + admin_templates + sk_cssapp + Application Key + + + core + admin_templates + sk_cssposition_desc + Position this css file is inserted in the page + + + core + admin_templates + sk_cssposition + Include Position + + + core + admin_templates + sk_datavariables + Data Variables + + + core + admin_templates + sk_newgroup + or Create New Group]]> + + + core + admin_templates + sk_add + Add + + + core + admin_templates + sk_group + Add to Group + + + core + admin_templates + sk_cssname + CSS File Name + + + core + admin_templates + sk_alphanumericonly + Alphanumerics only, no spaces + + + core + admin_templates + sk_bitname + Template Bit Name + + + core + admin_templates + sk_editvariables + Edit Template Variables + + + core + admin_templates + sk_addcssfile + Add CSS File + + + core + admin_templates + sk_addbit + Add New Bit + + + core + admin_templates + sk_cssprops + CSS Properties + + + core + admin_templates + sk_variables + Variables + + + core + admin_templates + sk_css + CSS + + + core + admin_templates + sk_comparediff + Compare Differences + + + core + admin_templates + sk_updateproperties + Update properties + + + core + admin_templates + sk_templates + Templates + + + core + admin_templates + sk_editcssprops + Edit CSS Properties (Advanced Users) + + + core + admin_templates + sk_editcss + Edit CSS + + + core + admin_templates + sk_edittemplates + Edit Templates + + + core + admin_templates + sk_l_new_full + Added Template Bit + + + core + admin_templates + sk_editreplacevar + Edit Replacement Variables + + + core + admin_templates + sk_editingset + Editing Set + + + core + admin_templates + sk_l_new + New + + + core + admin_templates + sk_l_inherited_full + Inherited changed from parent set + + + core + admin_templates + sk_l_inherited + Inherited + + + core + admin_templates + sk_l_modified_full + Modified in this set + + + core + admin_templates + sk_l_modified + Modified + + + core + admin_templates + sk_l_default_full + Unmodified in this set + + + core + admin_templates + sk_editreplace + Edit This Replacement + + + core + admin_templates + sk_l_default + Default + + + core + admin_templates + sk_revertreplace + Revert This Replacement + + + core + admin_templates + sk_removereplace + Remove This Replacement + + + core + admin_templates + sk_replacementadd + Add New Replacement + + + core + admin_templates + sk_legend + Legend + + + core + admin_templates + sk_replacecontent + Replace Content + + + core + admin_templates + sk_replacekey + Replace Key + + + core + admin_templates + sk_replacements + Replacements + + + core + admin_templates + sk_position + Position + + + core + admin_templates + sk_replaceinset + Replacements In Set + + + core + admin_templates + sk_editskinsettings + Edit Skin Settings + + + core + admin_templates + sk_edittempcss + + + + core + admin_templates + sk_replace_info + {style_images_url} can be used. When displayed in the skin, this tag gets converted into the appropriate image URL for this skin.]]> + + + core + admin_templates + sk_cancel + Cancel + + + core + admin_templates + sk_differences + Difference Report + + + core + admin_templates + sk_editing + Editing + + + core + admin_templates + sk_usestyleurl + {style_images_url} inplace of your IMG dir URL.
    For Example: {style_images_url}/image.png is parsed as: %s/image.png]]>
    +
    + + core + admin_templates + sk_cssfilename + CSS File Name + + + core + admin_templates + sk_revert + Revert + + + core + admin_templates + sk_newcss + New CSS in this skin set + + + core + admin_templates + sk_modifiedcss + Modified CSS in this skin set + + + core + admin_templates + sk_unmodifiedcss2 + Unmodified CSS in this skin set, but modified CSS in parent skin(s) + + + core + admin_templates + sk_unmodifiedcss + Unmodified CSS in this skin set + + + core + admin_templates + sk_cssfor + CSS For + + + core + admin_templates + sk_manageurlmapping + Manage URL Mapping + + + core + admin_templates + sk_addnewsettoparent + Add A New Set To This Parent + + + core + admin_templates + sk_addnewcss + Add New CSS File + + + core + admin_templates + sk_manageuagentmapping + Manage User Agent Mapping + + + core + admin_templates + sk_managereplacements + Manage Replacements + + + core + admin_templates + sk_managetempcss + + + + core + admin_templates + sk_editsettings + Edit Settings + + + core + admin_templates + sk_pleasebuildthem + Please build them now! + + + core + admin_templates + sk_skinsets + Skin Sets + + + core + admin_templates + sk_notempcache + No template caches found! + + + core + admin_templates + sk_outputformat + Output Format + + + core + admin_templates + sk_setname + Set Name + + + core + admin_templates + sk_importnewskin + Import Skin Set + + + core + admin_templates + sk_addnewrootskin + Create New Skin Set + + + core + admin_templates + sk_removingset + Removing Set + + + core + admin_templates + sk_pleaseconfirm + Please Confirm + + + core + admin_templates + sk_pleaseconfirminfo + You are about to remove skin set %s
    There is no way to undo this action, and this is the last confirmation screen. Only press the button below if you mean to do this!]]>
    +
    + + core + admin_templates + sk_removeskinset + Remove Skin Set + + + core + admin_templates + sk_skinmanagement + Skin Management + + + core + admin_templates + sk_forapps + For Applications + + + core + admin_templates + sk_templatexmllast + templates.xml last updated + + + core + admin_templates + sk_useemoset + Use emoticons set? + + + core + admin_templates + sk_useemoset_info + Choose which set of emoticons to assign to this skin. + + + core + admin_templates + sk_rebuildreplacements + Rebuild Replacements + + + core + admin_templates + sk_rebuildcss + Rebuild CSS + + + core + admin_templates + sk_rebuildhtml + Rebuild HTML + + + core + admin_templates + sk_rebuild + Rebuild + + + core + admin_templates + sk_rebuildmasterdata + Rebuild Master Skin Data + + + core + admin_templates + sk_reset + Reset + + + core + admin_templates + sk_forums + Forums + + + core + admin_templates + sk_usedefault + Use Default + + + core + admin_templates + sk_resetto + Reset To: + + + core + admin_templates + sk_wheretheyuse + Where They Use: + + + core + admin_templates + sk_members + Members + + + core + admin_templates + sk_resetskinusage + Reset Skin Set Usage + + + core + admin_templates + sk_allskinsets + All Skin Sets + + + core + admin_templates + sk_recacheskinsets + Recache Skin Sets + + + core + admin_templates + sk_setauthorurl + Set Author Website Address + + + core + admin_templates + sk_skintools + Skin Tools + + + core + admin_templates + sk_setauthorname + Set Author Name + + + core + admin_templates + sk_setauthor + Set Author + + + core + admin_templates + sk_useimgdir_info + The image directory will be used in place of {style_images_url} in CSS and replacements. + + + core + admin_templates + sk_useimgdir + Use image directory? + + + core + admin_templates + sk_imageoptions + Image Options + + + core + admin_templates + sk_hideskin_info + If you are choosing to tie user-agents to this skin, you may wish to remove it from the drop down list + + + core + admin_templates + sk_cssoptions + CSS Options + + + core + admin_templates + sk_cachecss + Cache CSS to text files? + + + core + admin_templates + sk_cachecss_info + Warning: Changing this value will re-cache any cached stylesheet information. Please make sure that you have synchronized any cache files with the database.]]> + + + core + admin_templates + sk_optional + Optional + + + core + admin_templates + sk_hideskin + Hide this skin from the drop down list? + + + core + admin_templates + sk_temp_diff + Template Differences + + + core + admin_templates + sk_skinsetparent + Skin Set Parent? + + + core + admin_templates + sk_selectmorethanone + You may select more than one. + + + core + admin_templates + sk_setasdefault + Set as default skin? + + + core + admin_templates + sk_setasdefault_info + Make this the default skin? + + + core + admin_templates + sk_setoutputformat + Set Output Format + + + core + admin_templates + sk_skinsetkey + Skin Set Key? + + + core + admin_templates + sk_defaultalready + Skin set as default already. + + + core + admin_templates + sk_selectwhichgroups + Select which groups have access to this skin. + + + core + admin_templates + sk_selectallgroups + Select ALL current and future groups or... + + + core + admin_templates + sk_setperms + Set Permissions + + + core + admin_templates + sk_added + Added + + + core + admin_templates + sk_mappedurls + Mapped URLs + + + core + admin_templates + sk_editmapping + Edit Mapping + + + core + admin_templates + sk_removemapping + REMOVE Mapping + + + core + admin_templates + sk_noremapping + There are no skin set URL remappings set up for this skin set currently. + + + core + admin_templates + sk_settitle + Set Title + + + core + admin_templates + sk_basics + Basics + + + core + admin_templates + sk_useragents + User Agents + + + core + admin_templates + sk_groups + Groups + + + core + admin_templates + sk_uagentmappingfor + User Agent Mapping for + + + core + admin_templates + sk_versions + Versions + + + core + admin_templates + sk_useragent_info + You can apply groups and individual agents to this skin.
    NOTE: IP.Board will let you apply the same user-agent to many skins as you can have different permissions. It is therefore conceivable that two or more skins have the same permissions and the same user-agents. If this happens, IP.Board will just select the first available which may or may not be the same one each time depending on the position of the skin in the cache.]]>
    +
    + + core + admin_templates + sk_type_info + + + + core + admin_templates + sk_url + URL + + + core + admin_templates + sk_selectskinxml + Select a valid XML skin export file from your computer. + + + core + admin_templates + sk_urlremappingfor + URL Remapping For + + + core + admin_templates + sk_addnewurl + Add New URL + + + core + admin_templates + sk_url_info + Enter the string to match in the query string + + + core + admin_templates + sk_type + Type + + + core + admin_templates + sk_title_info + The title is for your information only so you can distinguish between items. + + + core + admin_templates + sk_title + Title + + + core + admin_templates + sk_urlmapfor + URL Map For + + + core + admin_templates + sk_generalsettings + General Settings + + + core + admin_templates + sk_selectskinxml_info + + + + core + admin_templates + sk_skipnewmiss_info + If you are comparing an old ipb_templates.xml file from an older IPB release, then you may wish to disable this. If you are comparing an XML file from a customized skin set, you should enable this. + + + core + admin_templates + sk_skipnewmiss + Skip all new/missing template bits? + + + core + admin_templates + sk_import + Import + + + core + admin_templates + sk_createnewskindiff + Create New Skin Differences Report + + + core + admin_templates + sk_enterdifftitle + Enter a new skin difference title + + + core + admin_templates + sk_createhtmlexport + Create HTML Export + + + core + admin_templates + sk_clickviewreport + Click here to view the report]]> + + + core + admin_templates + sk_removediffresults + REMOVE Difference Results + + + core + admin_templates + sk_difftitle + Title + + + core + admin_templates + sk_created + Created + + + core + admin_templates + sk_viewdiffresults + View Merge Results + + + core + admin_templates + sk_skindiffreports + Template Merge Reports + + + core + admin_templates + sk_bitsof + template bits of %s processed + + + core + admin_templates + sk_error + Error + + + core + admin_templates + sk_processing + Processing + + + core + admin_templates + sk_nodiffs + No skin differences to show + + + core + admin_templates + sk_skindiffreport + Template Merge Report + + + core + admin_templates + sk_skindiff + Skin Differences + + + core + admin_templates + sk_viewdiffs + View Differences + + + core + admin_templates + sk_replacewith + Replace With + + + core + admin_templates + sk_replacewith_info + (Optional: Omitting will perform just a search) + + + core + admin_templates + sk_changed + Changed + + + core + admin_templates + sk_new + New + + + core + admin_templates + sk_howmanytemps + %s new template bits, %s changed template bits + + + core + admin_templates + sk_exported + Exported + + + core + admin_templates + sk_title_export + export + + + core + admin_templates + sk_regularexpression + Regular Expression + + + core + admin_templates + sk_searchfor + Search For + + + core + admin_templates + sk_selectskinset + Select a skin set + + + core + admin_templates + sk_searchandreplace + Search and Replace + + + core + admin_templates + sk_searchininfo + Search in selected set and all parents including the master set. + + + core + admin_templates + sk_uploadlogo_info + Browse your computer for a logo to upload. Filename must end in .gif, .jpg, .jpeg or .png + + + core + admin_templates + sk_submit + Submit + + + core + admin_templates + sk_replaceselected + Replace Selected + + + core + admin_templates + sk_save + Save + + + core + admin_templates + sk_continue + Continue + + + core + admin_templates + sk_run + Run + + + core + admin_templates + sk_searchreplaceinfo + + + + core + admin_templates + sk_applywhichset + Apply to which skin set? + + + core + admin_templates + sk_applywhichset_info + This will change the replacement macro for your community header. You can revert at any time. + + + core + admin_templates + sk_urlnewlogo + URL to new logo + + + core + admin_templates + sk_urlnewlogo_info + You can use a relative URL or a full URL starting with http:// + + + core + admin_templates + sk_uploadlogo + OR upload a new logo]]> + + + core + admin_templates + sk_addedhtml + Added HTML + + + core + admin_templates + sk_easylogochanger + Easy Logo Changer + + + core + admin_templates + sk_elc_warning + WARNING: Unable to upload into '/public/style_images/'. If you wish to upload a file, please CHMOD that directory now!]]> + + + core + admin_templates + sk_removedhtml + Removed HTML + + + core + admin_templates + sk_ajax_noperm + You do not have permission to use this function + + + core + admin_templates + sk_close + Close + + + core + admin_templates + sk_writemaster + + + + core + admin_templates + el_wrongformat + The file you uploaded is not in the correct format. It has to be one of the following: GIF, JPG/JPEG, or PNG. + + + core + admin_templates + el_log + Logo Changed and Skin Set Caches Rebuilt (Skin ID: %s ) + + + core + admin_templates + el_chmod + + + + core + admin_templates + el_nofile + You must either upload a new logo or enter a URL for a new logo. Please try again + + + core + admin_templates + el_noskinid + No skin set ID was passed. Please try again, ensuring you select a skin + + + core + admin_templates + sm_skinnone + Select One + + + core + admin_templates + ua_nav2 + Manage User Agents in + + + core + admin_templates + ua_nav1 + + + + core + admin_templates + ua_saved + User Agent Settings Saved + + + core + admin_templates + um_nav2 + Manage URL Remapping in + + + core + admin_templates + um_nav1 + + + + core + admin_templates + um_savechanges + Save Changes + + + core + admin_templates + um_editremap + Edit Remapping + + + core + admin_templates + um_noid + No ID was passed. Please try again. + + + core + admin_templates + um_addnew + Add New Skin Remap + + + core + admin_templates + um_added + Skin Remap Added + + + core + admin_templates + um_edited + Skin Remap Edited + + + core + admin_templates + um_contains + Contains + + + core + admin_templates + um_isexactly + Is Exactly + + + core + admin_templates + to_phprebuilt + PHP Templates Rebuilt For: + + + core + admin_templates + to_templatetools + Template Tools + + + core + admin_templates + um_removed + Remapping removed + + + core + admin_templates + um_entireform + You must complete the entire form. Please try again. + + + core + admin_templates + to_forumsupdated + forums updated + + + core + admin_templates + to_recachedset + Recached set: + + + core + admin_templates + to_rebuildcomplete + Rebuild complete + + + core + admin_templates + to_masterhtml + + + + core + admin_templates + to_noapps + No apps to rebuild! + + + core + admin_templates + to_masterreplace + Master Replacements Rebuilt + + + core + admin_templates + to_resultxmlimp + Result of template XML importing... + + + core + admin_templates + to_masterskinrebuilt + Master rebuilt for set ID: + + + core + admin_templates + to_membersupdated + members updated + + + core + admin_templates + to_mastercssrebuilt + + + + core + admin_templates + to_resultrebuild + Skin data successfully imported + + + core + admin_templates + to_resultbuild + Result of building for release... + + + core + admin_templates + ss_edituserset + Edit User Set + + + core + admin_templates + ss_saveset + Save Set + + + core + admin_templates + ss_manageskinsets + Manage Skin Sets + + + core + admin_templates + te_nav1 + + + + core + admin_templates + te_nav2 + Manage Templates in + + + core + admin_templates + to_recache_done + Skin set(s) recached successfully + + + core + admin_templates + to_writetoprs + Cannot write to /admin/setup/xml/skins/ + + + core + admin_templates + to_replacerecached + Replacements recached for + + + core + admin_templates + to_couldnotwrite + Could not write + + + core + admin_templates + to_wrote + Wrote + + + core + admin_templates + to_xmltempsavedout + XML Templates Saved Out + + + core + admin_templates + to_alldone + All Done! + + + core + admin_templates + ss_emodirnoexist + The emoticons directory you selected does not exist. + + + core + admin_templates + ss_dontmoveintoself + You cannot move this skin set into its own parent tree + + + core + admin_templates + ss_skinsetsaved + Skin Set Saved + + + core + admin_templates + ss_unavailable + Unavailable, IP.Board cannot write into your 'public/style_css' folder]]> + + + core + admin_templates + ss_addnewset + Add New Set + + + core + admin_templates + ss_imgdirnoexist + The image directory you selected does not exist. + + + core + admin_templates + ss_nogroupaccess + No group has access to this skin. At least ensure that one group has access. + + + core + admin_templates + ss_specifyname + You must specify a set name. + + + core + admin_templates + ss_noid + No ID was passed. Please try again. + + + core + admin_templates + ss_setremoved + Set Removed + + + core + admin_templates + ss_authkeyerror + Authorization Key Error + + + core + admin_templates + ss_cannotremove + Cannot remove this skin set + + + core + admin_templates + ss_masterwritten + Master skin has been written + + + core + admin_templates + sd_nocontent + There was no content in the file to process + + + core + admin_templates + sr_sometext + You must enter some text to search by + + + core + admin_templates + sr_nomatches + No Matches Found! + + + core + admin_templates + sd_nosession + Could not get the current template compare session. + + + core + admin_templates + sd_removed + Differences report removed + + + core + admin_templates + sd_noid + No skin ID passed. Please try again. + + + core + admin_templates + sd_entertitle + You must enter a title + + + core + admin_templates + sd_title + Comparison from skin set: + + + core + admin_templates + re_nav1 + + + + core + admin_templates + re_nav2 + Manage Replacements in + + + core + admin_templates + ie_ex_skin_p + Export customizations in this skin and any parent skins + + + core + admin_templates + ie_ex_skin + Export customizations in this skin only + + + core + admin_templates + ie_none + - None - + + + core + admin_templates + ie_set_upgraded + %s template(s) edited, %s replacement(s) edited, %s CSS file(s) edited.]]> + + + core + admin_templates + ie_set_imported + %s template(s) added, %s replacement(s) added, %s CSS file(s) added.]]> + + + core + admin_templates + ie_images_added + %s image(s) added + + + core + admin_templates + ie_importfail_no + Import Failed: Nothing to import! + + + core + admin_templates + ie_importfail + Import Failed: + + + core + admin_templates + ie_replace_added + %s replacement(s) imported + + + core + admin_templates + cs_nav2 + Manage CSS in + + + core + admin_templates + cs_nav1 + + + + core + admin_templates + ss_revertcomplete + Revert Complete + + + core + admin_templates + sk_revert_replacements + replacement customizations + + + core + admin_templates + sk_revert_button + Revert Customizations + + + core + admin_templates + sk_revert_templates + template customizations + + + core + admin_templates + sk_revert_css + CSS customizations + + + core + admin_templates + sk_revert_customizations + Revert all CSS and Template Customizations... + + + core + admin_templates + sk_revert_title + Reverting Customizations for: + + + core + admin_templates + sk_revert_desc + Please select which customizations to remove. The default template, CSS, and replacement items will be restored once the customizations have been removed. There is no undo. + + + core + admin_templates + sk_cleanup_css + Clean Up CSS Database + + + core + admin_templates + sk_cleanup_css_exp + + + + core + admin_templates + sk_clean_caches + Clean File Caches For: + + + core + admin_templates + sk_clean_caches_cb_css + CSS Files + + + core + admin_templates + sk_clean_caches_cb_tem + Template Files + + + core + admin_templates + tool_css_clean_desc + Result: %s cache entries removed, %s CSS entries removed + + + core + admin_templates + templates_TEMPLATE_EXISTS + The template bit name already exists in this group. Please give the template a different name. + + + core + admin_templates + tool_cache_clean_desc + Result: %s css cache files removed, %s template cache files removed + + + core + admin_templates + tool_cache_clean_run + Cache File Cleanup Performed + + + core + admin_templates + tool_css_clean_run + CSS Database Cleanup Performed + + + core + admin_templates + tool_template_clean_run + Template Database Cleanup Performed + + + core + admin_templates + tool_template_clean_desc + Result: %s cache entries removed, %s template entries removed + + + core + admin_templates + templates_SYNTAX_INCORRECT + There is a syntax error in the template, usually caused by PHP code not properly formed. Please correct the error and hit save again. + + + core + admin_templates + templates_NO_SUCH_TEMPLATE + We could not find the template bit you were attempting to edit. Reload the form and try again. + + + core + admin_templates + sk_run_tool + Run Tool + + + core + admin_templates + sk_cleanup_templates_exp + + + + core + admin_templates + sk_cleanup_title + Clean Up Tools + + + core + admin_templates + sk_cleanup_templates + Clean Up Templates Database + + + core + admin_templates + tt_ss_of_off + Click to make this set the default set for this output engine + + + core + admin_templates + tt_ss_of + This is the default set for this output engine + + + core + admin_templates + ss_hidden + This set is hidden from the public drop down. Click to make visible + + + core + admin_templates + ss_not_hidden + This set is NOT hidden from the public drop down. Click to hide + + + core + admin_templates + ss_defaultdone + Skin set made default + + + core + admin_templates + ss_hiddentoggled + Visibility toggled. Note: hiding from the public drop down still allows access via direct URL and via user agent mapping. To fully restrict access please edit the settings and restrict by member group. + + + core + admin_templates + ss_canttoggle + You cannot toggle the visibility of a default skin + + + core + admin_templates + ss_minify_desc + This will remove whitespace and comments to reduce filesize. Changes will take affect next time you recache this skin. + + + core + admin_templates + ss_minify + Compress Cached CSS? + + + core + admin_templates + ss_importexport + Skin Import/Export + + + core + admin_templates + none_root_set + None - Root Skin Set + + + core + admin_templates + used_in_no_others + (Used in %s) + + + core + admin_templates + used_in_plus_others + (Used in %s and %s other(s)) + + + core + admin_templates + uagent_mapping + User Agent Mapping + + + core + admin_templates + reset_for + Reset For: + + + core + admin_templates + sandr_search_results_for + Search Results For: + + + core + admin_templates + sk_for_apps + Include Templates For Applications: + + + core + admin_templates + sk_for_apps_desc + + + + core + admin_templates + fatalnotemplatew + Fatal! cannot create: cache/skin_cache/cacheid_%s/ + + + core + admin_templates + templatefilenowrite + cache/skin_cache/cacheid_%s/%s.php not writeable - cannot cache to PHP file + + + core + admin_templates + fatalnotemplsafe + Fatal! %scache/skin_cache not writeable - please change permissions via FTP or turn on Safe Mode + + + core + admin_templates + sd_exception + There was an error initiating the skin merge report. + + + core + admin_templates + ajax_missing_data + Missing Data + + + core + admin_templates + add_repl_f_tpl + Add Replacement + + + core + admin_templates + rep_key_f_tpl + Replacement Key + + + core + admin_templates + rep_ctn_f_tpl + Replacement Content + + + core + admin_templates + addrep_btn_f_tpl + Add Replacement + + + core + admin_templates + diff_folder_path + Or enter the name of a folder (in root forum folder) that contains valid application template XML files]]> + + + core + admin_templates + diff_folder_error + Folder %s was missing or empty + + + core + admin_templates + cssdirnotwritaaaable + public/style_css/css_%s/ not writeable + + + core + admin_templates + cssfilenotwriteable + public/style_css/css_%s/%s.css not writeable + + + core + admin_templates + safemodeenablednow + Safe Mode Enabled: Skipping Writing CSS Cache Files + + + core + admin_templates + fatalnotwreite + Fatal! %s/style_css not writeable - please change permissions via FTP or turn on Safe Mode + + + core + admin_templates + couldnotcreatecssdir + Fatal! cannot create: public/style_css/css_%s/ + + + core + admin_templates + basicnothingtowritepre + Error: No content to write for + + + core + admin_templates + basiccouldnotwrite + Error: Could not write + + + core + admin_templates + couldnotfindlineeol + Could not find any line endings in %s, skipping file... + + + core + admin_templates + cpltrebuildfromcaches + Completed database rebuild from PHP cache files. + + + core + admin_templates + basicwrittenpre + Wrote: + + + core + admin_templates + tplbitimported + %s imported (Added %s; updated %s template bits) + + + core + admin_templates + couldnotopenfile + Could not open %s for reading, skipping file... + + + core + admin_templates + basicimportedpre + Imported + + + core + admin_templates + finishedcachinghtml + Done HTML templates rebuild... (Skin Set: %s) + + + core + admin_templates + templatescreatedmsg + Templates for %s - %s created + + + core + admin_templates + csscreatedmsg + CSS for %s - %s created + + + core + admin_templates + nothingtoexportfor + Nothing to export for + + + core + admin_templates + css_isnotwritable + is not writeable + + + core + admin_templates + nogroupsforexportapp + Nothing to export for %s: No template bits + + + core + admin_templates + nothingtoexportforapp + Nothing to export for %s: No groups set in information.xml + + + core + admin_templates + nocsstoexport + No CSS to export for + + + core + admin_templates + couldnotlocate + Could not locate: + + + core + admin_templates + noreplacementstoexport + No replacements to export + + + core + admin_templates + importaddupdate + %s: %s updated, %s added + + + core + admin_templates + noinfoxml + The info.xml file is empty or was not included + + + core + admin_templates + imagedirnotexists + Image directory %s does not exist + + + core + admin_templates + xmldirmissing + /xml/ does not exist + + + core + admin_templates + xmldirnotwrite + /xml/ is not writeable + + + core + admin_templates + importnothingtoimport + : Nothing to import + + + core + admin_templates + cannotwriteimageset + Could not write the image set to disk + + + core + admin_templates + imagedircannotcreate + Could not create public/style_images/%s. Please check file permissions and try again. + + + core + admin_templates + emptyxmlarchivei + The XML Archive is empty + + + core + admin_templates + imagediralreadyexists + The directory public/style_images/%s already exists + + + core + admin_templates + invalidxmlarchivei + The content was not a valid XML Archive + + + core + admin_templates + appxmlrecachedfor + App XML Written For %s + + + core + admin_templates + appcssrecachedfor + App CSS Written For %s + + + core + admin_templates + cssrecached_for + CSS Recached for %s + + + core + admin_templates + templatesrecached_for + PHP Templates Recached for %s + + + core + admin_templates + reprebuilt_for + Replacements Rebuilt for %s + + + core + admin_templates + aborted_suffix + ABORTED + + + core + admin_templates + replacerebuilt + Replacements Rebuilt + + + core + admin_templates + htmlrebuilt_for + HTML Rebuilt for %s + + + core + admin_templates + masterdircreatetitle + master_skin Directory Creation Results + + + core + admin_templates + cssrebuilt_for + CSS Rebuilt for %s + + + core + admin_templates + cannotcreatemasterdir + Could not create directory: %scache/skin_cache/master_skin please create it via FTP and run the tool again + + + core + admin_templates + skindiff_okmsg + Items updated + + + core + admin_templates + ajax_cssmlll + Merging CSS file changes + + + core + admin_templates + ajax_tbmlll + Merging template bit changes + + + core + admin_templates + ajax_cssdprocess + %s of %s CSS files processed... + + + core + admin_templates + ajax_cssdlll + Checking for CSS file differences + + + core + admin_templates + ajax_tbdprocess + %s of %s template bits processed... + + + core + admin_templates + ajax_tbdlll + Checking for template bit differences + + + core + admin_templates + ajax_invalidsession + Could not locate a valid differences session + + + core + admin_templates + ajax_changescommitted + . Changes committed + + + core + admin_templates + ajax_noconflicts + no conflicts + + + core + admin_templates + runnewreporton + Run a new report on: + + + core + admin_templates + ajax_nokeyfound + No Key Found + + + core + admin_templates + ajax_mergeconflicts + merge conflicts + + + core + admin_templates + nopreviouslystoredtemp + The merge tool is not available as you have no previously stored templates + + + core + admin_templates + ajax_resolvedconflicts + resolved conflicts + + + core + admin_templates + ajax_newitem4thisv + New item for this version + + + core + admin_templates + ajax_nosuchitemid + No such item ID + + + core + admin_templates + resolveallcommit + Save Changes To Skin + + + core + admin_templates + resolvealluncommit + Revert Changes + + + core + admin_templates + resolve__go + Go + + + core + admin_templates + minutepatience + Each step can take a few minutes, please be patient + + + core + admin_templates + resolveallcustom + Auto Resolve: Your Custom Skin Wins + + + core + admin_templates + resolveallnewdefault + Auto Resolve: New Default Skin Wins + + + core + admin_templates + mergewithselected + With Selected: + + + core + admin_templates + manuallyresolveconflict + Manually Edit/Resolve Conflicts... + + + core + admin_templates + viewmergepreview + View Merge Preview... + + + core + admin_templates + menu__oldnew + + + + core + admin_templates + menu__viewnewdef + View new default item + + + core + admin_templates + menu__viewcustomized + View customized item + + + core + admin_templates + menu__vieworigdef + View original default item + + + core + admin_templates + changescommitted + . Changes committed + + + core + admin_templates + noconflicts + no conflicts + + + core + admin_templates + mergeconflicts + merge conflicts + + + core + admin_templates + resolvedconflicts + resolved conflicts + + + core + admin_templates + mergereportdiffs + %s differences + + + core + admin_templates + mergenewitemversion + New item for this version + + + core + admin_templates + mergereportnoconflict + No conflicts + + + core + admin_templates + mergereportconflicts + %s conflicts + + + core + admin_templates + mergereportdifferences + %s differences + + + core + admin_templates + mergereportnewitem + New item + + + core + admin_templates + resolve__new + Resolve: New Wins + + + core + admin_templates + merge__showcommit + Uncommitted + + + core + admin_templates + merge__showcommita + Committed + + + core + admin_templates + resolve__custom + Resolve: Custom Wins + + + core + admin_templates + mergeexportprefix + + + + core + admin_templates + merge__showall + New/No Conflict + + + core + admin_templates + merge__showconflict + Conflicted + + + core + admin_templates + merge__showmerged + Merged + + + core + admin_templates + mergerepoptions + Show... + + + core + admin_templates + mergereporttitle + Merge Report + + + core + admin_templates + ss_keynogoodyo + You cannot use that Skin Key as it is already in use. Please select another. + + + core + admin_templates + importmastercss + + + + core + admin_templates + runmergereports + Run Merge Report... + + + core + admin_templates + exportmastertempl + + + + core + admin_templates + importmastertempl + + + + core + admin_templates + exportmastercss + + + + core + admin_templates + merge_done_desc + All your templates have been saved and are now 'live' on your community
    You can optionally edit them further or uncommit ('revert') the changes by using the checkboxes and drop down box.
    ]]>
    +
    + + core + admin_templates + merge_uncommitted_desc + You have %s items with uncommitted ('unsaved') changes.
    This means that although the items are now merged, they need to be committed ('saved') before the changes will show on your community. Please use the checkboxes and drop down to commit these changes.
    ]]>
    +
    + + core + admin_templates + in + in + + + core + admin_templates + ie_importfail_old_version + IP.Board %s. You are currently running IP.Board %s.
    You can continue but the skin may have errors or missing functionality.

    Continue and import skin]]>
    +
    + + core + admin_templates + merge_conflicts_desc + You have %s items with conflicts that need resolving.
    This means that the items could not be automatically 'merged'. You need to either edit them manually to 'resolve' the conflicts or use the 'resolve all' option to determine the final template.
    ]]>
    +
    + + core + admin_templates + skin_gen_desc + Created by visual editor + + + core + admin_templates + skin_gen_new_vis_skin_title + New Visual Editor Skin + + + core + admin_templates + skin_gen_new_vis_skin_desc + This new skin will remain hidden to others until you set it as visible. + + + core + admin_templates + skin_gen_ready_desc + The skin has been created. Simply click the button below to launch a new browser window. + + + core + admin_templates + skin_gen_ready_button_launch + Launch visual editor + + + core + admin_templates + skin_gen_ready_button_edit + Edit Skin Settings + + + core + admin_templates + skin_gen_new_title + Create New Skin + + + core + admin_templates + skin_gen_new_visual_title + Visual Editor + + + core + admin_templates + skin_gen_new_visual_desc + The visual editor allows you to change color and board width using a visual editor with instant preview. Please be aware that the visual editor should be considered a beta feature, and that additional improvements and features are expected yet. + + + core + admin_templates + skin_gen_next_dotdotdot + Next... + + + core + admin_templates + skin_gen_manual_title + Manual Mode + + + core + admin_templates + skin_gen_manual_desc + This gives you full control over the HTML and CSS code which is all fully editable for advanced layout changes. + + + core + admin_templates + skin_gen_next + Next + + + core + admin_templates + skin_gen_ready_title + New Skin Created + core admin_templates sk_ee_webdav_title WebDav Details - Данные WebDav + core admin_templates - vse_disabled - Visual Editor Disabled - Визуальный редактор отключен + sk_ee_webdav_host + Server/Host + core admin_templates - vse_disabled_why - here.]]> - вот тут.]]> + sk_ee_webdav_path + Path + + + core + admin_templates + sk_ee_webdav_username + Username + core admin_templates sk_ee_webdav_fgci_desc As you are using FCGI, the standard authentication methods may not work making you unable to log in. To resolve this, create a new file called .htaccess in your forums root directory and add the following code. If you already have a .htaccess file, add this to the bottom. - Так как у вас используется FCGI, стандартные методы авторизации могут не работать. Для исправления этой проблемы необходимо создать новый файл .htaccess, который необходимо расположить в корневой директории форума и добавить следующий код в тело файла. Если в директории уже есть .htaccess файл, то добавьте код в конец файла. + core admin_templates - sk_ee_webdav_fgci_title - FCGI Detected - Включен FCGI + skin_gen_convert_go + Convert Now + core admin_templates - skin_visible - Visible - Видим + skin_gen_convert_desc + This action cannot be undone.]]> + + + core + admin_templates + skin_gen_convert_title + Convert to full skin + + + core + admin_templates + skin_gen_convert_done + The skin has been converted + + + core + admin_templates + sk_ee_enable + Enable external editing + + + core + admin_templates + sk_ee_main_title + External Editing + + + core + admin_templates + sk_ee_main_desc + this page.]]> + + + core + admin_templates + sk_ee_webdav_password + Password + + + core + admin_templates + sk_ee_webdav_ur_password + (Your Admin CP Password) + + + core + admin_templates + vse_disabled + Visual Editor Disabled + + + core + admin_templates + vse_disabled_why + here.]]> + core admin_templates skin_hidden Hidden - Скрыт + + + core + admin_templates + skin_visible + Visible + + + core + admin_templates + sk_ee_webdav_fgci_title + FCGI Detected + core admin_templates skin_default Default - По умолчанию - - core - admin_templates - system_templates_errwrite - The template could not be saved. - Не удалось сохранить шаблон. - - core - admin_templates - st_ipsServerError - Server Error - Ошибка Сервера - - core - admin_templates - st_ipsServerError_desc - This is the template that will be used to display a server error, which may be shown if your server is experiencing problems. - Этот шаблон используется для отображения ошибок сервера. - - core - admin_templates - system_templates - System Templates - Системные Шаблоны - - core - admin_templates - system_templates_nowrite - The cache/skin_cache/system directory is not writeable. You must adjust the permissions on this folder before you can edit templates. - Папка cache/skin_cache/system не доступна для записи. Вы должны настроить права оступа к папке прежде, чем редактировать шаблоны. - - core - admin_templates - system_templates_nowrite_file - %s is not writable. You must adjust the permissions on this file in order to edit this template.]]> - %s не доступен для записи. Вы должны настроить права доступа к этому файлу, чтобы редактировать шаблон.]]> - - core - admin_templates - system_templates_err - Could not locate the system template you are trying to edit. - Не удалось найти системный шаблон, который вы хотите изменить. - - core - admin_templates - system_templates_save - Save Template - Сохранить Шаблон - - core - admin_templates - system_templates_saved - Template Saved! - Шаблн Сохранен! + core admin_templates skins_manage_app_images Manage App Images - Управлять моб. приложениями + core admin_templates - st_ipsDriverError_desc - - - - core - admin_templates - st_ipsDriverError - Driver Error - Ошибка Базы Данных - - core - admin_templates - st_emailWrapper - Email wrapper - Обработчик Email + system_templates_errwrite + The template could not be saved. + core admin_templates st_emailWrapper_desc All emails sent from the community will use this template. - Все письма, отправляемые форумом, будут использовать этот шаблон. + + + core + admin_templates + st_ipsDriverError + Driver Error + + + core + admin_templates + st_ipsDriverError_desc + + + + core + admin_templates + st_ipsServerError + Server Error + + + core + admin_templates + st_ipsServerError_desc + This is the template that will be used to display a server error, which may be shown if your server is experiencing problems. + + + core + admin_templates + system_templates + System Templates + + + core + admin_templates + system_templates_nowrite + The cache/skin_cache/system directory is not writeable. You must adjust the permissions on this folder before you can edit templates. + + + core + admin_templates + system_templates_nowrite_file + %s is not writable. You must adjust the permissions on this file in order to edit this template.]]> + + + core + admin_templates + system_templates_err + Could not locate the system template you are trying to edit. + + + core + admin_templates + system_templates_save + Save Template + + + core + admin_templates + system_templates_saved + Template Saved! + + + core + admin_templates + st_emailWrapper + Email wrapper + core admin_templates vse_close_linktext Close Editor - Закрыть - - core - admin_templates - vse_close_desc - This will cancel the open session and revert any unsaved changes. - Это действие отменит текущую сессию и все не сохраненные изменения. + core admin_templates close_vse_title Close Visual Editor - Закрыть Визуальный Редактор + core - admin_tools - perf_dishooks - Disabled hooks - Отключены хуки + admin_templates + vse_close_desc + This will cancel the open session and revert any unsaved changes. + core - admin_tools - perf_enpms - Enabled private conversations - Включенные личные беседы + admin_templates + vse_launch_vse + Launch visual editor + core - admin_tools - perf_encal - Enabled calendar - Включен календарь + admin_templates + vse_cancel_vse + Cancel Visual Editor + + + core + admin_templates + vse_basic_settings + Basic Settings + core admin_tools perf_enonline Enabled online list - Включен онлайн список + core admin_tools - perf_enhooks - Enabled hooks - Включены хуки + perf_encal + Enabled calendar + core admin_tools - settings_nofile - There were no settings to import - Нет настрооек для импорта + perf_enpms + Enabled private conversations + core admin_tools - perf_disonline - Disabled online list - Отключен список онлайн - - core - admin_tools - perf_discal - Disabled calendar - Отключен календарь - - core - admin_tools - perf_disabled_group - - + perf_dishooks + Disabled hooks + core admin_tools perf_dispms Disabled private conversations - Отключены личные беседы - - core - admin_tools - perf_enabled_group - - + core admin_tools perf_disabled_setting Disabled setting: %s - Отключена настройка: %s + core admin_tools - perf_toggle - Toggle now - Переключить + perf_enabled_group + + core admin_tools - perf_enabled_setting - Enabled setting: %s - Включена настройка: %s + perf_disonline + Disabled online list + core admin_tools - perf_off - Disabled - Отключен + perf_discal + Disabled calendar + core admin_tools - perf_current - Current Status - Текущее состояние: + perf_disabled_group + + core admin_tools perf_on ENABLED - ВКЛЮЧЕН + core admin_tools - qa_none - There are no challenge questions created yet - Нет созданных вопросов. + perf_off + Disabled + core admin_tools - qa_noeditid - We could not determine which question you were trying to edit. - Невозможно определить вопрос для изменения. + perf_toggle + Toggle now + core admin_tools - qa_404 - We could not determine which question you were trying to edit. - Невозможно определить вопрос для редактирования - - core - admin_tools - qa_editbutton - Edit Question - Изменить вопрос - - core - admin_tools - qa_addbutton - Add Question - Добавить вопрос - - core - admin_tools - qa_form_question - Question - Вопрос - - core - admin_tools - qa_form_answers - Valid answers. One per line. - Правильные ответы. Один на строку. - - core - admin_tools - qa_addlog - Added a registration question - Добавить вопрос для регистрации - - core - admin_tools - qa_edited - Edited a registration question - Изменить вопрос для регистрации - - core - admin_tools - qa_options - Options - Настройки - - core - admin_tools - qa_not_on_title - - Внимание: система вопрос и ответ не задействована - - core - admin_tools - qa_not_on_desc - here to switch the system on]]> - здесь]]> + perf_enabled_setting + Enabled setting: %s + core admin_tools qa_no_question You must enter a question. - Необходимо ввести вопрос. - - core - admin_tools - perf_help_title - Toggle Performance Mode - Переключение режима производительности + core admin_tools qa_no_answer You must enter an answer. - Необходимо ввести ответ. + core admin_tools - qa_current - Current Questions - Текущие вопросы + perf_help_title + Toggle Performance Mode + core admin_tools - qa_edit - Edit - Изменить + perf_current + Current Status + core admin_tools - qa_delete - Delete - Удалить + qa_not_on_desc + here to switch the system on]]> + core admin_tools - qa_help_title - Registration Question and Answer Challenges - Вопросы и ответы при регистрации + qa_not_on_title + + + + core + admin_tools + qa_options + Options + + + core + admin_tools + qa_edited + Edited a registration question + + + core + admin_tools + qa_addbutton + Add Question + + + core + admin_tools + qa_form_question + Question + + + core + admin_tools + qa_addlog + Added a registration question + + + core + admin_tools + qa_form_answers + Valid answers. One per line. + + + core + admin_tools + qa_editbutton + Edit Question + + + core + admin_tools + qa_none + There are no challenge questions created yet + + + core + admin_tools + qa_noeditid + We could not determine which question you were trying to edit. + core admin_tools qa_addlink Add New Question - Добавить вопрос + + + core + admin_tools + qa_current + Current Questions + + + core + admin_tools + qa_edit + Edit + + + core + admin_tools + qa_delete + Delete + + + core + admin_tools + qa_help_title + Registration Question and Answer Challenges + core admin_tools qa_deleted The question has been deleted. - Вопрос удален. + core admin_tools qa_noid We could not determine which question you were trying to delete. - Невозможно определить вопрос для удаления. + core admin_tools ua_unknown Unknown Group - Неизвестная группа + core admin_tools postform_badmd5 Key did not match - Указан не верный ключ - - core - admin_tools - ua_noid - No ID was passed. Please try again. - UD не найден. + core admin_tools ua_nav2 Manage User Agents - Управление User Agents в + core admin_tools ua_nav1 Manage User Agent Groups - Управление стилями и шаблонами + core admin_tools ua_savechanges Save Changes - Сохранить + core admin_tools ua_editua Edit User Agent Group %s - Изменение группы %s + core admin_tools - c_title - Cache Management - Управление кешем - - core - admin_tools - c_msg - You can check and rebuild your caches from this control panel. - Вы можете проверить кеши или перестроить их - - core - admin_tools - cache__of - of - из - - core - admin_tools - cache__posts - posts - сообщений - - core - admin_tools - cache__signatures - signatures - подписей - - core - admin_tools - ua_addnewtitle - Add New User Agent Group - Новая группа User Agent + ua_noid + No ID was passed. Please try again. + core admin_tools ua_addnewbutton Add New Group - Добавить группу + core admin_tools - export_group - Export this group - Экспортировать + ua_addnewtitle + Add New User Agent Group + core admin_tools - conf_desc_search - In Group: - В группе: + mr_completed + Completed! + core admin_tools - c_noid - No ID was passed. Please try again. - ID не найден. + cache__signatures + signatures + core admin_tools - c_processed - processed... - продолжаем... + cache__posts + posts + + + core + admin_tools + cache__of + of + + + core + admin_tools + c_msg + You can check and rebuild your caches from this control panel. + + + core + admin_tools + c_title + Cache Management + core admin_tools c_recachethecachegetitgotitgood Cache re-cached - Кеш обновлен + + + core + admin_tools + c_processed + processed... + + + core + admin_tools + c_noid + No ID was passed. Please try again. + + + core + admin_tools + conf_desc_search + In Group: + + + core + admin_tools + export_group + Export this group + core admin_tools choose_to_export_single Export Selected Settings - Экспорт + core admin_tools export_selected EXPORT SELECTED - ЭКСПОРТ ВЫБРАННЫХ - - core - admin_tools - setting_keywords - Setting Keywords - Ключи - - core - admin_tools - setting_keywords_desc - You can enter keywords that will be searched when someone uses the ACP quick search to pull up this setting (space or comma separated) - Вы можете ввести несколько ключей (разделенных запятой или пробелом) для быстрого поиска настройки + core admin_tools choose_export Choose settings to export - Выберите настройки для экспорта - - core - admin_tools - export_helptitle - Export Selected System Settings - Экспорт выбранных настроек + core admin_tools s_ishidden (Hidden) - (скрытая) + core admin_tools - s_createnewtitle - Create New Setting - Создать новую настройку + setting_keywords + Setting Keywords + + + core + admin_tools + setting_keywords_desc + You can enter keywords that will be searched when someone uses the ACP quick search to pull up this setting (space or comma separated) + + + core + admin_tools + export_helptitle + Export Selected System Settings + core admin_tools s_global_dd Global Settings - Общие настройки + + + core + admin_tools + s_createnewtitle + Create New Setting + core admin_tools s_sometoexport You must select SOME settings to export! - Необходимо выбрать 1 или более настроек для экспорта! - - core - admin_tools - s_revertedback - Configuration setting reverted back to default. - Настройка сброшена на значение по умолчанию + core admin_tools s_deleted Configuration Setting Deleted - Настройка удалена + + + core + admin_tools + s_revertedback + Configuration setting reverted back to default. + core admin_tools s_edited2 Setting Edited - Настройка отредактирована + core admin_tools s_added2 New Setting Added - Настройка добавлена + core admin_tools s_updated Settings updated - Настройки обновлены - - core - admin_tools - s_edit - Edit - Изменить + core admin_tools s_nofields No fields were passed to be saved. Please try again. - Нет полей для сохранения. + + + core + admin_tools + s_edit + Edit + core admin_tools s_delete Delete - Удалить - - core - admin_tools - s_revertback - Revert to default value - Отменить + core admin_tools s_set4group Settings for group: %s - Настройки группы: %s + core admin_tools - s_nomatches - %s produced no matches. Please try another phrase.]]> - %s не дал результатов.]]> + s_revertback + Revert to default value + core admin_tools s_searchedfor Searched for: %s - Поиск: %s + + + core + admin_tools + s_nomatches + %s produced no matches. Please try another phrase.]]> + core admin_tools s_nogroup No group was passed. Please try again. - Группа не найдена. + core admin_tools s_name_autocomplete Member Name Auto Complete Field - Поле имени пользователя с автодополнением + core admin_tools s_multi Multi-Select - Мульти выбор + core admin_tools s_editor Full Editor - Расширенный редактор + core admin_tools s_textarea Text Area - Текст (несколько строк) - - core - admin_tools - s_yes_no - Yes/No Radio Buttons - Кнопки Да/Нет + core admin_tools s_dropdown Drop Down - Выпадающее меню + + + core + admin_tools + s_yes_no + Yes/No Radio Buttons + core admin_tools s_input Text Input - Текст (одна строка) - - core - admin_tools - s_edited - Setting Group Edited - Группа настроек отредактирована - - core - admin_tools - s_editsetting - Edit Setting %s - Редактирование настройки %s - - core - admin_tools - s_savechanges - Save Changes - Создать + core admin_tools s_title Add New Setting Group - Добавить группу настроек + + + core + admin_tools + s_edited + Setting Group Edited + core admin_tools s_added New Setting Group Added - Группа настроек добавлена + core admin_tools - s_notitle - You must enter a title for this group. - Вы должны ввести название группы. + s_savechanges + Save Changes + + + core + admin_tools + s_editsetting + Edit Setting %s + core admin_tools s_nokeyword You must enter a keyword for this group. - Вы должны ввести ключевое слово для этой группы + + + core + admin_tools + s_notitle + You must enter a title for this group. + core admin_tools s_noid No ID was passed. Please try again. - ID не найден. - - core - admin_tools - s_recounted - Setting Group Recounted - Группа настроек пересчитана. + core admin_tools s_createnew Create New Setting Group - Создать новую группу настроек + + + core + admin_tools + s_recounted + Setting Group Recounted + core admin_tools s_remove Setting Group Removed - Группа настроек удалена + core admin_tools s_upandin %s settings updated. %s settings inserted. - %s настроек обновлено. %s настроек добавлено. + core admin_tools s_cantremove You cannot remove this setting group as it still contains active settings. Please remove the settings inside it first. - Невозможно удалить группу настроек так как в ней есть активные настройки. + core admin_tools s_noneupdate No settings to update. - Нет настроек для обновления. + core admin_tools s_noopen Could not find the file to open at: %s - Невозможно открыть файл: %s - - core - admin_tools - s_missing_key_data - You must supply at least a title and key. - Для отправки формы, как минимум, необходимо указать название и ключ. - - core - admin_tools - s_keyinuse_already - The setting key you selected is already in use. - Ключ настроек, выбранный вами, уже используется в системе. + core admin_tools s_nofile No upload file was found or no filename was specified. - Загруженный файл не найден. - - core - admin_tools - a_restrictip - API Restrict IP - API IP ограничение]]> - - core - admin_tools - a_restrictip_info - Optional: You may enter the IP Address of the server you only wish to grant access. This increases security and is recommended.]]> - Опционально: Вы можете ввести IP адрес сервера. Рекомендуется для повышения безопасности.]]> + core admin_tools a_save Save - Сохранить + core admin_tools - a_allowaccess - Allow access to - Разрешить доступ в + s_missing_key_data + You must supply at least a title and key. + + + core + admin_tools + s_keyinuse_already + The setting key you selected is already in use. + core admin_tools a_grant_functions Select functions to which you grant access - Выберите функции, которые дадут доступ + core admin_tools - a_usertitle_info - The title is just a name for your records for easier identification. - Заголовок для пользователя для простоты запоминания. + a_allowaccess + Allow access to + core admin_tools - a_userkey - API User Key - API пользовательский ключ]]> + a_restrictip_info + Optional: You may enter the IP Address of the server you only wish to grant access. This increases security and is recommended.]]> + core admin_tools - a_usertitle - API User Title - API заголовок пользователя]]> - - core - admin_tools - a_key_info - This key is automatically generated and will be re-generated if you refresh this form. - Этот ключ автоматически создается и перегенерируется при обновлении этой формы. + a_restrictip + API Restrict IP + core admin_tools a_userbasics API User Basics - API пользователь]]> + core admin_tools - a_create - Create New API User - Создать нового API пользователя + a_userkey + API User Key + core admin_tools - a_createone - Add a new user - Создать? + a_key_info + This key is automatically generated and will be re-generated if you refresh this form. + + + core + admin_tools + a_usertitle + API User Title + + + core + admin_tools + a_usertitle_info + The title is just a name for your records for easier identification. + core admin_tools a_nousers There are no API users currently. - На текущий момент API пользователей нет. + core admin_tools - a_users - XML-RPC API Users - XML-RPC API пользователи + a_create + Create New API User + core admin_tools - a_user - API User - API пользователь - - core - admin_tools - a_edit - Edit API User - Изменить + a_createone + Add a new user + core admin_tools a_remove Remove API User - Удалить + core admin_tools - a_viewdetails - View Details - Подробности + a_edit + Edit API User + core admin_tools - a_log - Log - Запись + a_user + API User + + + core + admin_tools + a_users + XML-RPC API Users + core admin_tools a_status Status - Статус + core admin_tools - a_ip - IP Address - IP адрес + a_log + Log + core admin_tools - a_time - Time - Время - - core - admin_tools - a_success - Success - Успешность - - core - admin_tools - a_formdata - XML-RPC Data (Form Data)]]> - Данные XML-RPC (Данные формы)]]> - - core - admin_tools - a_requestlog - XML-RPC Request Log - Журнал XML-RPC запросов + a_viewdetails + View Details + core admin_tools a_date Date - Дата + core admin_tools - a_detail - XML-RPC Log Detail - Журнал XML-RPC + a_requestlog + XML-RPC Request Log + core admin_tools - a_basics - Basics]]> - Основы]]> + a_formdata + XML-RPC Data (Form Data)]]> + + + core + admin_tools + a_ip + IP Address + + + core + admin_tools + a_time + Time + + + core + admin_tools + a_success + Success + core admin_tools a_key API Key - API ключ + + + core + admin_tools + a_basics + Basics]]> + + + core + admin_tools + a_detail + XML-RPC Log Detail + core admin_tools a_msg4 You may create API users for use with the XML-RPC system which allows other applications to access IP.Board data - Вы можете создавать API пользователей для использования с XML-RPC системой, которая позволяет другим приложениям использовать данные из IP.Board. + core admin_tools a_msg3 The XML-RPC system is not enabled!
    All API requests will fail. Click here to enable it]]>
    - XML-RPC система отключена
    API запросы не обрабатываются. Включить ]]>
    - - core - admin_tools - a_msg2 - You may create API users for use with the XML-RPC system which allows other applications to access IP.Board data - Вы можете создавать API пользователей для использования с XML-RPC системой, которая позволяет другим приложениям использовать данные из IP.Board. - - core - admin_tools - a_disabled - XML-RPC System Disabled - XML-RPC система отключена - - core - admin_tools - a_savechanges - Save Changes - Сохранить - - core - admin_tools - a_edituser - Edit API User: - Редактирование API пользователя: - - core - admin_tools - a_edited - API User Edited - Модуль отредактирован. + core admin_tools a_createnew Create New API User - Создать API пользователя + core admin_tools - a_added - API User Added - Новый модуль добавлен. + a_edituser + Edit API User: + core admin_tools - a_removed - API User successfully removed. - Модуль удален. + a_savechanges + Save Changes + core admin_tools - a_entertitle - You must enter a title - Вы должны ввести название + a_msg2 + You may create API users for use with the XML-RPC system which allows other applications to access IP.Board data + core admin_tools - a_whatuser - Could not determine the user to remove. - Пользователь для удаления не найден. - - core - admin_tools - a_user404 - The API user could not be found. - Невозможно найти API пользователя. + a_disabled + XML-RPC System Disabled + core admin_tools a_noapikey No API user key passed! - Ключ API не найден! + core admin_tools - login_notexists - MISSING - НЕ СОДЕРЖИТ + a_added + API User Added + core admin_tools - xmlrpc_status - XML-RPC Status - XML-RPC статус + a_edited + API User Edited + + + core + admin_tools + a_whatuser + Could not determine the user to remove. + + + core + admin_tools + a_user404 + The API user could not be found. + + + core + admin_tools + a_entertitle + You must enter a title + + + core + admin_tools + a_removed + API User successfully removed. + core admin_tools a_lognoid No log for that ID found. - Не найдено записей для этого ID. + core admin_tools a_title XML-RPC API Logs - Записи XML-RPC API + core admin_tools a_msg The red cross indicates an error during the request and a green tick indicates a successful request.]]> - Красный крест означает ошибку, а зеленая галочка говорит о том, что запрос прошел успешно.]]> + core admin_tools - l_already - The Log In method you requested to install is already installed. - Метод авторизации уже установлен в системе - - core - admin_tools - l_yesinstalled - Log In method was successfully installed! - Метод авторизации успешно установлен в систему + xmlrpc_status + XML-RPC Status + core admin_tools login_exists EXISTS - СОДЕРЖИТ + + + core + admin_tools + login_notexists + MISSING + core admin_tools l_rename_conf
    • %s
    ]]>
    -
    • %s
    ]]>
    - - core - admin_tools - l_moveto - We could not determine where you were trying to move the Log In method to. - Невозможно определить куда был перемещен метод авторизации. + core admin_tools l_installer404 We could not find the installer file for the Log In method you wish to install. - Не удалось найти скрипт установщика для устанавливаемого метода авторизации + core admin_tools - l_uninstalled - Log In method was successfully uninstalled - Модуль авторизации удален + l_already + The Log In method you requested to install is already installed. + core admin_tools - l_others - Other Available Login Handlers - Дополнительные модули авторизации - - core - admin_tools - l_successfully - Login method was successfully - Метод авторизации - - core - admin_tools - l_installed - Installed Login Handlers - Установленные модули авторизации - - core - admin_tools - l_disabled - disabled - отключен + l_yesinstalled + Log In method was successfully installed! + core admin_tools l_enabled enabled - включен + core admin_tools - l_title - Log In Authentication Manager - Управление модулями авторизации + l_disabled + disabled + core admin_tools - l_msg -  ]]> -   ]]> + l_moveto + We could not determine where you were trying to move the Log In method to. + + + core + admin_tools + l_uninstalled + Log In method was successfully uninstalled + core admin_tools l_noconfig This login method does not have any configuration options. - Метод авторизации не содержит опций для настройки + core admin_tools l_noconfigfile We could not find the configuration file. - Не удалось найти конфигурационный файл + core admin_tools l_confwrite /conf.php must be writable - please CHMOD this file 0777 - /conf.php должен иметь права на запись - пожалуйста сделайте CHMOD 777 данному файлу + + + core + admin_tools + l_others + Other Available Login Handlers + + + core + admin_tools + l_successfully + Login method was successfully + + + core + admin_tools + l_installed + Installed Login Handlers + core admin_tools l_nav Manage Log In Authentication - Управление модулями авторизации + core admin_tools - l_email - Email Address - E-mail адрес + l_title + Log In Authentication Manager + + + core + admin_tools + l_msg +  ]]> + core admin_tools l_username_or_email Username or Email Address - Имя пользователя или Email адрес + + + core + admin_tools + l_email + Email Address + core admin_tools l_username Username - Имя пользователя - - core - admin_tools - l_edited - Log In Method Edited - Метод авторизации изменен + core admin_tools l_registernew Register New Log In Method - Добавить метод авторизации + core admin_tools - l_form - You must complete the entire form. - Необходимо заполнить форму полностью. - - core - admin_tools - l_added - New Log In Method Added - Новая запись языка добавлена + l_edited + Log In Method Edited + core admin_tools l_confup Configuration successfully updated for %s - Настройки метода авторизации %s обновлены + + + core + admin_tools + l_form + You must complete the entire form. + + + core + admin_tools + l_added + New Log In Method Added + core admin_tools l_404 We could not find the login method you were attempting to configure, check, enable, uninstall, or edit. Please try again. - Не удалось найти метод авторизации, который вы пытаетесь настроить, проверить, включить/отключить или изменить. Попробуйте еще раз. - - core - admin_tools - re_msgcount_info - This will recount members total messages and folder counts - Будут пересчитаны сообщения пользователей и счетчики папок - - core - admin_tools - re_msgcount - Rebuild User Messenger Totals - Пересчитать сообщения в личном ящике - - core - admin_tools - remenu_none - None - Ничего + core admin_tools remenu_rules Forum Rules - Правила форума + core admin_tools - re_orph_info - This is moderately resource intensive.]]> - Для этого инструмента требуется большее количество ресурсов.]]> - - core - admin_tools - re_uphoto - Remove Orphaned Uploaded Photos - Удалить потерянные фотографии - - core - admin_tools - re_uphoto_info - This is moderately resource intensive.]]> - Для этого инструмента требуется большее количество ресурсов.]]> - - core - admin_tools - remenu_posts - Post Content - Сообщений - - core - admin_tools - remenu_pms - Private Messages - Личных сообщений - - core - admin_tools - remenu_events - Calendar Events - Событий календаря - - core - admin_tools - re_data_info - This is moderately resource intensive.]]> - Для этого инструмента требуется большее количество ресурсов.]]> + remenu_none + None + core admin_tools remenu_announce Announcements - Объявлений + + + core + admin_tools + re_msgcount_info + This will recount members total messages and folder counts + + + core + admin_tools + re_msgcount + Rebuild User Messenger Totals + core admin_tools remenu_sigs Signatures - Подписей + core admin_tools remenu_aboutme About Me Content - Сведений О себе + + + core + admin_tools + remenu_pms + Private Messages + + + core + admin_tools + remenu_events + Calendar Events + + + core + admin_tools + re_uphoto_info + This is moderately resource intensive.]]> + + + core + admin_tools + remenu_posts + Post Content + + + core + admin_tools + re_uphoto + Remove Orphaned Uploaded Photos + core admin_tools re_orph Remove Orphaned Attachments - Удалить потерянные файлы + + + core + admin_tools + re_orph_info + This is moderately resource intensive.]]> + core admin_tools re_data Rebuild Attachment Data - Обновить информацию о прикрепленных файлах + core admin_tools - re_count - Rebuild User Post Counts - Обновление счетчиков пользователей - - core - admin_tools - re_count_info - THERE IS NO UNDO!]]> - ЭТО ДЕЙСТВИЕ НЕЛЬЗЯ ОТМЕНИТЬ!]]> - - core - admin_tools - re_pphoto - Rebuild Profile Photo Thumbnails - Обновить фотографии пользователей - - core - admin_tools - re_pphoto_info - This is moderately resource intensive.]]> - Для этого инструмента требуется большее количество ресурсов.]]> - - core - admin_tools - re_thumb_info - This is moderately resource intensive.]]> - Для этого инструмента требуется большее количество ресурсов.]]> + re_data_info + This is moderately resource intensive.]]> + core admin_tools re_thumb Rebuild Attachment Thumbnails - Обновить изображения предпросмотра + core admin_tools - re_user_info - - Обновление сохраненных имен пользователей в сообщениях, темах, журналах и т.д. Полезно, если вы недавно вручную меняли имена пользователей. + re_thumb_info + This is moderately resource intensive.]]> + core admin_tools - re_rebuild_info - This will rebuild the submitted content including BBCode, custom bbcode, HTML (where allowed) and emoticons. This is only necessary upon upgrading to IP.Board 3.0, and does not need to be run more than once. - Инструмент обновляет содержимое всего контента. Осуществляется перестройка оформления BB-кодов, HTML, смайликов внутри контента. Данный инструмент нужено запустить только единожды - после обновления до IP.Board 3.0 - - core - admin_tools - re_rebuildbutton - Rebuild Content - Перестроение контента - - core - admin_tools - re_seouser_info - This will reset the SEO display name for all members - Инструмент сбрасывает все SEO имена пользователей - - core - admin_tools - re_user - Rebuild User Names - Обновление имен пользователей + re_pphoto_info + This is moderately resource intensive.]]> + core admin_tools re_seouser - Обновление SEO имен пользователей + + + core + admin_tools + re_seouser_info + This will reset the SEO display name for all members + + + core + admin_tools + re_user + Rebuild User Names + + + core + admin_tools + re_user_info + + + + core + admin_tools + re_count + Rebuild User Post Counts + + + core + admin_tools + re_count_info + THERE IS NO UNDO!]]> + + + core + admin_tools + re_pphoto + Rebuild Profile Photo Thumbnails + + + core + admin_tools + re_rebuildbutton + Rebuild Content + core admin_tools re_rebuild - + core admin_tools - re_topics_info - This will rebuild tag caches, recount replies, attachment count and the topic starter and last poster for all your topics. - Инструмент позволяет обновить счетчики, а так же информацию о последнем авторе для всех ваших тем. - - core - admin_tools - re_s_most - - Сбросить информацию о рекорде посещаемости? - - core - admin_tools - re_forums - Resynchronize Forums - Синхронизация форумов + re_rebuild_info + This will rebuild the submitted content including BBCode, custom bbcode, HTML (where allowed) and emoticons. This is only necessary upon upgrading to IP.Board 3.0, and does not need to be run more than once. + core admin_tools re_topics Resynchronize Topics - Синхронизация тем + + + core + admin_tools + re_topics_info + This will rebuild tag caches, recount replies, attachment count and the topic starter and last poster for all your topics. + core admin_tools re_forums_info This will recount replies, views, and the topic starter and last poster for all your forums. - Инструмент позволяет обновить счетчики, а так же информацию о последней теме и авторе для всех ваших форумов. + core admin_tools - re_percycle - Per Cycle - за цикл + re_s_most + + core admin_tools - re_stats - Recount Statistics - Пересчет статистики - - core - admin_tools - re_s_total - Recount total topics and posts - Пересчитать количество тем и сообщений? - - core - admin_tools - re_s_members - Recount Members - Пересчитать количество пользователей? + re_forums + Resynchronize Forums + core admin_tools re_s_last Reset last registered member - Сбросить информацию о последнем зарегистрированном пользователе? + + + core + admin_tools + re_s_members + Recount Members + + + core + admin_tools + re_s_total + Recount total topics and posts + + + core + admin_tools + re_percycle + Per Cycle + + + core + admin_tools + re_stats + Recount Statistics + core admin_tools re_events Convert 2.0.x Calendar Events to 2.1.x Format - Конвертация событий календаря 2.0.х в формат версии 2.1.х + core admin_tools re_events_info - Инструмент позволяет преобразовать события календаря созданные в версии 2.0.х в новый формат, используемый в версии 2.1.х. Используйте данный инструмент после ручного обновления. - - core - admin_tools - re_polls - Convert 2.0.x Polls to 2.1.x Format - Конвертация опросов 2.0.х в формат версии 2.1.х - - core - admin_tools - re_polls_info - - Инструмент позволяет преобразовать опросы созданные в версии 2.0.х в новый формат, используемый в версии 2.1.х. Используйте данный инструмент после ручного обновления. - - core - admin_tools - re_dupe1 - Remove Duplicate System Settings from IPB 2.0.x - Удаление повторяющихся настроек в 2.0.x - - core - admin_tools - re_dupe1_info - This tool finds the duplicates which have a greater ID than the original.]]> - Инструмент позволяет очистить настройки форума от дубликатов, которые могут возникнуть в результате конвертации форума с другой форумной системы или при обновлении форума с версии 1.х.х. - - core - admin_tools - re_ban - - Восстановление бан фильтров + core admin_tools re_ban_info Running this tool attempts to import your old ban settings. Old entries will not overwrite new entries.]]> - Инструмент позволяет восстановить фильтры бана, которые могли быть потеряны в результате обновления с 1.х.х. При восстановлении, новые настройки не удаляются. + core admin_tools - re_converge_info - This tool finds these members and restores them into the default member group and asks them to change their email address.]]> - Инструмент позволяет найти пользователей, чья учетная запись содержит дублирующий e-mail адрес, а аккаунт переведен в группу ожидающих активации. Такое может произойти в результате обновления или же конвертации форума с другой форумной системы. + re_ban + + core admin_tools re_converge - Поиск и восстановление пользователей + + + core + admin_tools + re_converge_info + This tool finds these members and restores them into the default member group and asks them to change their email address.]]> + + + core + admin_tools + re_dupe1 + Remove Duplicate System Settings from IPB 2.0.x + + + core + admin_tools + re_dupe1_info + This tool finds the duplicates which have a greater ID than the original.]]> + + + core + admin_tools + re_polls + Convert 2.0.x Polls to 2.1.x Format + + + core + admin_tools + re_polls_info + + core admin_tools re_dupe2_info - Инструмент позволяет очистить настройки форума от дубликатов, которые могут возникнуть при обновлении форума с версии 2.0.х + core admin_tools re_dupe2 Remove Duplicate System Setting Groups from IPB 2.1.x - Удаление повторяющихся настроек в 2.1.х + core admin_tools re_1xto20_info These tools will clean up and rebuild content from an upgrade from the IP.Board 1.x.x series - Этот инструмент проведет очистку и обновление содержимого после перехода с IP.Board 1.x.x + core admin_tools re_20to21_info These tools will clean up and rebuild content from an upgrade from the IP.Board 2.0.x series - Этот инструмент проведет очистку и обновление содержимого после перехода с IP.Board 2.0.x - - core - admin_tools - re_21to22_info - These tools will clean up and rebuild content from an upgrade from the IP.Board 2.1.x series - Этот инструмент проведет очистку и обновление содержимого после перехода с IP.Board 2.1.x - - core - admin_tools - re_1xto20 - 2.0.0 Upgrade Tools]]> - 2.0.0]]> - - core - admin_tools - re_230to300 - 3.0.x Upgrade Tools]]> - 3.0.x]]> - - core - admin_tools - re_21to22 - 2.2.0 Upgrade Tools]]> - 2.2.0]]> + core admin_tools re_20to21 2.1.0 Upgrade Tools]]> - 2.1.0]]> - - core - admin_tools - re_310to320 - 3.2.x Upgrade Tools]]> - 3.2.x]]> + core admin_tools re_runtool - + + + core + admin_tools + re_310to320 + 3.2.x Upgrade Tools]]> + + + core + admin_tools + re_21to22_info + These tools will clean up and rebuild content from an upgrade from the IP.Board 2.1.x series + + + core + admin_tools + re_1xto20 + 2.0.0 Upgrade Tools]]> + + + core + admin_tools + re_230to300 + 3.0.x Upgrade Tools]]> + + + core + admin_tools + re_21to22 + 2.2.0 Upgrade Tools]]> + core admin_tools re_300pms_info If you chose to skip PM conversion during the upgrade and cannot run the shell tool, then please run this tool - - - core - admin_tools - re_pmsconverted - All PMs converted - Все личные сообщения успешно конвертированы - - core - admin_tools - re_msgsconverted - PMs have already been converted. No action required - Личные сообщения уже сконвертированы, никакие действия не требуются + core admin_tools re_300pms Convert 2.x PMs To 3.0.x Format - Конвертировать личные сообщения из 2.x в формат 3.0.x - - core - admin_tools - re_320photos_info - IP.Board 3.2.x has one image to identify every user. You can use this tool upon upgrading to convert avatars or photos from IP.Board 3.1.x to IP.Board 3.2 photos. - В IP.Board 3.2.x в профиле у каждого участника используется одно изображение. Вы можете использовать утилиту для конвертирования аватаров или фотографий из IP.Board 3.1.x в новый формат фотографий IP.Board 3.2. - - core - admin_tools - re_320photos - Convert 3.1 avatars/photos to 3.2 photos - Конвертировать аватары/фотографии из IPB 3.1 в фотографии IPB 3.2 - - core - admin_tools - re_noresizefound - Could not find file to resize: - Невозможно найти файл: - - core - admin_tools - re_processed - Processed topic - Обработана тема + core admin_tools re_title - Инструменты пересчета и обновления + + + core + admin_tools + re_320photos + Convert 3.1 avatars/photos to 3.2 photos + + + core + admin_tools + re_320photos_info + IP.Board 3.2.x has one image to identify every user. You can use this tool upon upgrading to convert avatars or photos from IP.Board 3.1.x to IP.Board 3.2 photos. + + + core + admin_tools + re_pmsconverted + All PMs converted + + + core + admin_tools + re_msgsconverted + PMs have already been converted. No action required + + + core + admin_tools + re_processed + Processed topic + + + core + admin_tools + re_noresizefound + Could not find file to resize: + core admin_tools re_resized Resized: - Изменен размер: - - core - admin_tools - re_thisgoeshere - Up to %s processed so far, continuing...]]> - Обработано %s. Продолжаем... - -]]> + core admin_tools re_noremove Could not remove: - Невозможно удалить: + + + core + admin_tools + re_thisgoeshere + Up to %s processed so far, continuing...]]> + core admin_tools re_rebuildcomp Rebuild completed]]> - Обновление завершено
    ]]>
    - - core - admin_tools - re_attachedok - Attached file OK: - Прикрепленный файл: + core admin_tools re_removedorph Removed orphan: - Удален: + core admin_tools - re_pollstartto - Polls: %s to %s of %s completed...]]> - Опросы: с %s по %s из %s завершено]]> - - core - admin_tools - re_pollconverted - Polls converted]]> - Опросы сконвертированы]]> - - core - admin_tools - re_nothing - Nothing to recount! - Ничего не выбрано для пересчета! - - core - admin_tools - re_statsrecount - Statistics Recounted - Статистика пересчитана + re_attachedok + Attached file OK: + core admin_tools re_statscenter Recount Statistics Section - Раздел пересчета статистики + core admin_tools - re_calconverted - Calendar events converted]]> - События календаря сконвертированы]]> - - core - admin_tools - re_calalready - Calendar events already converted. - Календарные события уже конвертированы. + re_statsrecount + Statistics Recounted + core admin_tools re_calstartto Calendar events: %s to %s completed...]]> - Календарные события: c %s по %s завершено.]]> + core admin_tools - re_calremoved - You cannot run this tool as the old calendar_events table has been removed. - Запуск инструмента невозможен, так как таблица calendar_events была удалена. + re_calconverted + Calendar events converted]]> + core admin_tools - re_deletetitle - %s duplicate setting titles deleted and %s duplicate settings deleted. - Удалено повторяющихся названий: %s, повторяющихся настроек: %s + re_pollstartto + Polls: %s to %s of %s completed...]]> + core admin_tools - re_deletingid - Deleting: %s ID %s - Удаление: %s ID %s + re_pollconverted + Polls converted]]> + core admin_tools - re_keepingid - KEEPING: %s ID %s - Сохранение: %s ID %s + re_nothing + Nothing to recount! + + + core + admin_tools + re_calalready + Calendar events already converted. + core admin_tools re_duplicatetitle %s]]> - %s]]> + + + core + admin_tools + re_calremoved + You cannot run this tool as the old calendar_events table has been removed. + + + core + admin_tools + re_deletingid + Deleting: %s ID %s + + + core + admin_tools + re_keepingid + KEEPING: %s ID %s + core admin_tools re_convergerest %s members found and restored. - %s пользователей восстановлено. + core admin_tools - h_remove - Remove - Удалить - - core - admin_tools - h_addnew - Add New Help File - Добавить раздел помощи + re_deletetitle + %s duplicate setting titles deleted and %s duplicate settings deleted. + core admin_tools re_bansimport %s IP address(es) imported, %s email address(es) imported, %s name(s) imported. - %s IP-адресов импортировано, %s адресов e-mail импортировано, %s имен импортировано. + + + core + admin_tools + h_addnew + Add New Help File + + + core + admin_tools + h_remove + Remove + core admin_tools h_edit Edit - Изменить + core admin_tools h_ftitle Title - Название + core admin_tools h_current Current Help Files - Разделы помощи - - core - admin_tools - h_fileapp - Help File Application - Приложение + core admin_tools h_filetext Help File Text - Текст + core admin_tools h_export Export XML into App Dirs - Экспортировать XML + core admin_tools - h_filedesc - Help File Description - Краткое описание + h_fileapp + Help File Application + core admin_tools h_filetitle Help File Title - Название - - core - admin_tools - h_exported - Help Files Exported as XML - Файлы помощи экспортированы в XML + core admin_tools h_import_added App: %s - %s added, %s updated help files inserted - Приложение: %s - %s добавлено, %s обновленных файлов помощи добавлено + + + core + admin_tools + h_filedesc + Help File Description + + + core + admin_tools + h_exported + Help Files Exported as XML + core admin_tools h_imported XML Files Imported - Файлы XML импортированы + core admin_tools h_import Import App XML Files - Импортировать XML + core admin_tools h_addlog Added a help file - Добавлен файл помощи - - core - admin_tools - h_added - Added a help file - Файл помощи добавлен - - core - admin_tools - h_edited - Edited help files - Измененные файлы помощи - - core - admin_tools - h_404 - We could not find that help file in the database. Please try again. - Файл помощи не найден в базе данных. + core admin_tools h_title Help File Management - Управление разделами помощи + core admin_tools h_addbutton Add this Help File - Добавить этот файл помощи + + + core + admin_tools + h_404 + We could not find that help file in the database. Please try again. + core admin_tools h_editbutton Edit this Help File - Изменить раздел помощи + + + core + admin_tools + h_edited + Edited help files + + + core + admin_tools + h_added + Added a help file + core admin_tools h_entertitle You must enter a title. Please try again. - Необходимо ввести название. + core admin_tools h_removed Removed a help file - Файл помощи удален - - core - admin_tools - ua_rebuild_master - Rebuild Default User Agents - Обновить стандартные User Agents - - core - admin_tools - h_noid - You must pass a valid ID. Please try again. - ID не найден. - - core - admin_tools - t_l_nomethods - There are no %s login methods available - Нет %s доступных методов авторизации + core admin_tools t_l_enable Enable - Включить + core admin_tools t_l_disable Disable - Отключить + core admin_tools t_l_configdetails Configure Details... - Настроить + core admin_tools t_l_moredetails More - Подробнее + core admin_tools t_l_export Export... - Экспортировать + core admin_tools t_l_uninstall Uninstall... - Удалить + core admin_tools t_import Import - Импортировать + + + core + admin_tools + ua_rebuild_master + Rebuild Default User Agents + + + core + admin_tools + h_noid + You must pass a valid ID. Please try again. + core admin_tools t_l_html2 ACP Log In Form HTML]]> - HTML код формы Админцентра для замены]]> + core admin_tools t_l_html2_info Enter the HTML to add or replace the ACP log in form. - Введите HTML код для замены формы авторизации Админцентра или для добавление к ней. + core admin_tools t_l_html3 Log In HTML Replace Form]]> - HTML код формы для замены]]> + core admin_tools t_l_html3_info - + core admin_tools - t_l_html_info - Enter the HTML to add or replace the log in form. - Введите HTML код для замены формы авторизации или для добавление к ней. - - core - admin_tools - t_l_html - Log In Form HTML]]> - HTML код формы]]> - - core - admin_tools - t_configdetails - Configuration Details for - Детали настроек для - - core - admin_tools - t_l_type - Login Type]]> - Тип]]> + t_l_nomethods + There are no %s login methods available + core admin_tools t_uacapture_desc (If yes, enter the parenthesis # you wish to capture) - (если необходимо получать версию агента, введите номер группы regex, в который сохраняется версия) + + + core + admin_tools + t_l_html + Log In Form HTML]]> + + + core + admin_tools + t_l_html_info + Enter the HTML to add or replace the log in form. + + + core + admin_tools + t_l_type + Login Type]]> + + + core + admin_tools + t_configdetails + Configuration Details for + core admin_tools t_uacapture Regex Capture Version Number? - Версия User Agent в Regex - - core - admin_tools - t_uaother - Other - Иное - - core - admin_tools - t_ua_position - User Agent Position: - Позиция: + core admin_tools t_uaregex Regex: - Регулярное выражение: + + + core + admin_tools + t_ua_position + User Agent Position: + + + core + admin_tools + t_uaother + Other + core admin_tools t_uasearchengine Search Engine - Поисковик + core admin_tools t_uabrowser Web Browser - Веб-браузер + core admin_tools t_uatype User Agent Type: - Тип + core admin_tools t_uakey_desc (Alphanumerics and underscore only; Example: firefox) - - - core - admin_tools - t_uaaddnew - Add New User Agent - Добавить User Agent - - core - admin_tools - t_uaposition - Position: - Позиция: - - core - admin_tools - t_ua_editing - Editing: - Редактирование: - - core - admin_tools - t_uaname - User Agent Name: - Название - - core - admin_tools - t_uaname_desc - (Example: Firefox) - (Например: Firefox) + core admin_tools t_uakey User Agent Key: - Ключ + + + core + admin_tools + t_uaname_desc + (Example: Firefox) + + + core + admin_tools + t_uaname + User Agent Name: + + + core + admin_tools + t_ua_editing + Editing: + + + core + admin_tools + t_uaposition + Position: + core admin_tools t_uamanagement User Agent Management - Список User Agent + core admin_tools - t_ua_longtext -
    It is also recommended that you allow 'Explorer', 'Netscape' and 'Mozilla' to be positioned last. Many other browsers contain 'Explorer' or 'Mozilla' in the user agent which could lead to incorrect identifications.]]>
    -
    Так же рекомендуется ставить 'Explorer', 'Netscape' и 'Mozilla' на последнее место, так как многие браузеры содержат 'Explorer' или 'Mozilla' в своих user agent строках, что может привести к неправильной их идентификации.]]>
    + t_uaaddnew + Add New User Agent + core admin_tools t_ua_information Information - Информация + + + core + admin_tools + t_ua_longtext +
    It is also recommended that you allow 'Explorer', 'Netscape' and 'Mozilla' to be positioned last. Many other browsers contain 'Explorer' or 'Mozilla' in the user agent which could lead to incorrect identifications.]]>
    +
    core admin_tools t_ua_nonein Click me to build the master User Agent list]]> - Создать базовый список]]> + core admin_tools t_ua_none You do not have any User Agent Groups set up. - создать одну.]]> - - core - admin_tools - t_uasave - Save - Сохранить - - core - admin_tools - t_uaclose - Close - Закрыть - - core - admin_tools - t_uamanagegroup - Manage User Agent Groups - Управление группами User Agent - - core - admin_tools - tua_manage - Manage User Agents - Управление User Agent - - core - admin_tools - t_ua_groups - User Agent Groups - Группы User Agent - - core - admin_tools - t_ua_editg - Edit Group... - Изменить + core admin_tools t_ua_removeg Remove Group... - Удалить + + + core + admin_tools + t_ua_editg + Edit Group... + + + core + admin_tools + t_ua_groups + User Agent Groups + + + core + admin_tools + tua_manage + Manage User Agents + + + core + admin_tools + t_uamanagegroup + Manage User Agent Groups + + + core + admin_tools + t_uaclose + Close + + + core + admin_tools + t_uasave + Save + core admin_tools t_ua_info Leave it blank to match all versions of this user-agent.]]> - Не заполняйте поле, если нет необходимости определять версию user-agent.]]> + core admin_tools t_uaediting Editing Versions for - Редактирование версии для - - core - admin_tools - t_uaversions - Versions - Версии + core admin_tools t_uaconfigure Configure - Настроить + + + core + admin_tools + t_uaversions + Versions + core admin_tools t_uarevert Revert - Сбросить - - core - admin_tools - t_uaremove - Remove - Удалить + core admin_tools t_uaedit Edit - Изменить + + + core + admin_tools + t_uaremove + Remove + core admin_tools t_uaallavail All Available Agents (Click to add to group) - Доступные агенты (нажатие добавляет в группу) + core admin_tools t_uagroups - Агенты этой группы - - core - admin_tools - tol_add_this_option_into_the_setti - Add this option into the settings cache? - Добавить в кеш + core admin_tools t_uatitle User Agent Group Title]]> - Название группы]]> + core admin_tools - tol_enter_title_here_or_leave_blan - Enter a subtitle here to group this and following settings - Введите название группы или оставьте поле пустым + tol_add_this_option_into_the_setti + Add this option into the settings cache? + core admin_tools tol_make_a_default_setting_cannot_ Make a default setting (cannot be removed by user)? - Настройка по умолчанию? + + + core + admin_tools + tol_enter_title_here_or_leave_blan + Enter a subtitle here to group this and following settings + core admin_tools tol_start_setting_group Setting Sub-grouping? - Начинает новую группу настроек + core admin_tools tol_036show_1_is_set_when_showing_ $save = 1; is set when saving the setting.
    Use $key and $value when writing PHP code.]]>
    - Параметр $save имеет значение 1 - когда происходит сохранение значения настройки
    Параметры $key и $value обозначают, соответственно, ключ и значение настройки]]>
    + core admin_tools tol_raw_php_code_to_eval_before_sh Raw PHP code to eval before showing and saving? - PHP, исполняемый при показе и сохранении настройки - - core - admin_tools - tol_use_for_creating_form_element_ - Drop down box use: Key=Value; one per line.]]> - Например для выпадающего список в данном поле перечисляются значения полей в виде: Ключ=Значение]]> - - core - admin_tools - tol_setting_extra - Setting Extra - Дополнительные параметры + core admin_tools tol_setting_default_value Setting Default Value - Значение настройки по умолчанию + core admin_tools - tol_setting_current_value - Setting Current Value - Текущее значение настройки + tol_setting_extra + Setting Extra + + + core + admin_tools + tol_use_for_creating_form_element_ + Drop down box use: Key=Value; one per line.]]> + core admin_tools tol_setting_title Setting Title - Название + core admin_tools tol_setting_position Setting Position - Позиция в списке + core admin_tools tol_setting_description Setting Description - Описание + core admin_tools tol_setting_group Setting Group - Группа + core admin_tools tol_setting_type Setting Type - Тип + core admin_tools tol_setting_key Setting Key - Ключ + core admin_tools - tol_update_settings - Update Settings - Применить + tol_setting_current_value + Setting Current Value + core admin_tools tol_hide_from_main_settings_list Hide from main settings list? - Не выводить в списке настроек + core admin_tools - tol_setting_group_keyword - Group Keyword - Ключ + tol_update_settings + Update Settings + core admin_tools tol_used_to_pull_this_from_the_db_ Used to pull this from the DB without relying on an ID - Используется для получения настройки из базы данных без ID + core admin_tools - tol_setting_group_description - Group Description - Описание + tol_setting_group_keyword + Group Keyword + core admin_tools tol_setting_group_tab Group Tab - Принадлежит закладке + core admin_tools - tol_the_file_must_be_uploaded_into - - - - core - admin_tools - tol_setting_group_application - Group Application - Приложение - - core - admin_tools - tol_settings_groups - Settings Groups - Группы Настроек - - core - admin_tools - tol_setting_group_title - Group Title - Название + tol_setting_group_description + Group Description + core admin_tools tol_search_settings Search Settings... - Поиск настроек + core admin_tools tol_go Go - Отправить + core admin_tools - tol_or_enter_the_filename_of_the_x - OR enter the filename of the XML settings file]]> - ИЛИ введите название файла]]> + tol_settings_groups + Settings Groups + core admin_tools - tol_duplicate_entries_will_not_be_ - - + tol_setting_group_title + Group Title + core admin_tools - tol_upload_xml_settings_file_from_ - Upload XML settings file from your computer - Загрузка файла XML с настройками + qa_404 + We could not determine which question you were trying to edit. + + + core + admin_tools + tol_setting_group_application + Group Application + + + core + admin_tools + tol_the_file_must_be_uploaded_into + + core admin_tools tol_import_xml_settings Import XML Settings - Импортирование настроек + core admin_tools - tol_recount_settings_group - Recount Settings Group... - Пересчитать Группы Настроек... + tol_upload_xml_settings_file_from_ + Upload XML settings file from your computer + core admin_tools - tol_delete_settings_group - Delete Settings Group... - Удалить Группу Настроек... + tol_duplicate_entries_will_not_be_ + + + + core + admin_tools + tol_or_enter_the_filename_of_the_x + OR enter the filename of the XML settings file]]> + core admin_tools tol_edit_settings_group Edit Settings Group... - Редактировать Группу Настроек... + + + core + admin_tools + tol_delete_settings_group + Delete Settings Group... + + + core + admin_tools + tol_recount_settings_group + Recount Settings Group... + core admin_tools tol_manage_settings Manage Settings... - Перейти к настройкам - - core - admin_tools - tol_view_cache - View Cache - Посмотреть содержимое - - core - admin_tools - tol_total_cache_size - Total Cache Size - Общий размер кеша - - core - admin_tools - tol_recache_all - Recache All - Перестроить весь кеш + core admin_tools tol_folder Folder - Директория + + + core + admin_tools + tol_total_cache_size + Total Cache Size + + + core + admin_tools + tol_view_cache + View Cache + core admin_tools tol_recache_cache Recache Cache - Обновить + + + core + admin_tools + tol_recache_all + Recache All + core admin_tools tol_not_loaded_on_initialization NOT loaded on Initialization - НЕ ЗАГРУЖАЕТСЯ в начале работы форума + core admin_tools tol_loaded_on_initialization_canno Loaded on Initialization - Загружается в начале работы форума (не может быть отключен) - - core - admin_tools - tol_loaded_on_initialization - Loaded on Initialization - ЗАГРУЖАЕТСЯ в начале работы форума + core admin_tools tol_init_state Init State - Подключение + core admin_tools - tol_caches - Caches - Кеши + tol_loaded_on_initialization + Loaded on Initialization + core admin_tools tol_size Size - Размер + core admin_tools - tol_cache_management - Cache Management - Управление кешем - - core - admin_tools - tol_global_caches - Core Caches - Система - - core - admin_tools - tol_install - Install... - Установить + tol_caches + Caches + core admin_tools tol_diagnostics Diagnostics... - Проверить - - core - admin_tools - tol_cannot_be_deleted_or_edited_by - Cannot be deleted or edited by user - Не может быть удалена или изменена - - core - admin_tools - tol_edit_details - Edit Details... - Редактировать - - core - admin_tools - tol_log_in_user_log_out_url - Log In User Log Out URL - URL завершения сессии - - core - admin_tools - tol_the_url_for_the_place_to_log_o - (Optional) The URL to send the user to when they request to log out. - (Не обязательно) URL для перенаправления пользователя для выхода из системы. - - core - admin_tools - tol_the_main_folder_the_php_files_ - E.G: If ./sources/loginauth/internal/auth.php then enter: internal]]> - Например: Если файл './sources/loginauth/internal/auth.php', то директория - internal]]> - - core - admin_tools - tol_if_yes_this_log_in_will_be_ena - - + core admin_tools tol_enable_safemode Enable Safemode? - Включить режим безопасности? + core admin_tools - tol_the_url_for_the_place_to_log_i - (Optional) The URL to send the user to when they request to log in. - (Не обязательно) URL для перенаправления пользователя для авторизации + tol_cannot_be_deleted_or_edited_by + Cannot be deleted or edited by user + + + core + admin_tools + tol_cache_management + Cache Management + + + core + admin_tools + tol_global_caches + Core Caches + + + core + admin_tools + tol_install + Install... + + + core + admin_tools + tol_edit_details + Edit Details... + core admin_tools tol_log_in_user_log_in_url Log In User Log In URL - URL формы авторизации + core admin_tools - tol_log_in_user_register_url - Log In User Register URL - URL регистрации - - core - admin_tools - tol_the_url_for_the_place_to_regis - (Optional) The URL to send the user to when they attempt to register a new account. - (Не обязательно) URL для перенаправления пользователя желающего пройти регистрацию. - - core - admin_tools - tol_the_url_for_the_place_they_can - (Optional) The URL to send a user to when they request to change their email address or password. - (Не обязательно) URL для переадресации пользователя, желающего сменить e-mail или пароль. - - core - admin_tools - tol_log_in_user_maintenance_url - Log In User Maintenance URL - Служебный URL для пользователей - - core - admin_tools - tol_log_in_files_folder_name - Log In Files Folder Name - Имя директории с файлами модуля - - core - admin_tools - tol_a_short_description_for_this_l - A short description for this log in method - Короткое описание модуля авторизации + tol_the_url_for_the_place_to_log_i + (Optional) The URL to send the user to when they request to log in. + core admin_tools tol_log_in_description Log In Description - Описание + core admin_tools - tol_log_in_title - Log In Title - Название + tol_if_yes_this_log_in_will_be_ena + + core admin_tools - tol_writeable - Writeable - Доступен на запись + tol_the_url_for_the_place_to_log_o + (Optional) The URL to send the user to when they request to log out. + core admin_tools - tol_exists - Exists - Существует + tol_log_in_user_log_out_url + Log In User Log Out URL + + + core + admin_tools + tol_log_in_user_maintenance_url + Log In User Maintenance URL + + + core + admin_tools + tol_the_url_for_the_place_they_can + (Optional) The URL to send a user to when they request to change their email address or password. + + + core + admin_tools + tol_log_in_user_register_url + Log In User Register URL + + + core + admin_tools + tol_the_url_for_the_place_to_regis + (Optional) The URL to send the user to when they attempt to register a new account. + + + core + admin_tools + tol_a_short_description_for_this_l + A short description for this log in method + + + core + admin_tools + tol_log_in_files_folder_name + Log In Files Folder Name + + + core + admin_tools + tol_the_main_folder_the_php_files_ + E.G: If ./sources/loginauth/internal/auth.php then enter: internal]]> + core admin_tools tol_auth_exists Auth file exists? - Файл авторизации существует? + + + core + admin_tools + tol_exists + Exists + + + core + admin_tools + tol_writeable + Writeable + + + core + admin_tools + tol_log_in_title + Log In Title + core admin_tools tol_file_name File Name - Имя файла + core admin_tools tol_log_in_has_settings Log In Has Settings - Модуль имеет настройки? - - core - admin_tools - tol_log_in_installed - Log In Installed - Модуль установлен? - - core - admin_tools - tol_diagnostics_title - Log In Method Diagnostics - Отчет о проверке модуля + core admin_tools tol_log_in_enabled Log In Enabled - Модуль включен? + + + core + admin_tools + tol_log_in_installed + Log In Installed + core admin_tools tol_options Options - Действия + core admin_tools - tol_register_new_log_in_method - Add Log In Method - Добавить метод + tol_diagnostics_title + Log In Method Diagnostics + core admin_tools tol_diagnostics_for Diagnostics for - Отчет для + core admin_tools - tol_registered_log_in_authenticati - Registered Log In Authentication Methods - Модули авторизации - - core - admin_tools - tol_add_new_setting_group - Add New Setting Group - Добавить группу настроек - - core - admin_tools - tol_settings - Settings - Настройки - - core - admin_tools - perf_help_information - - Режим производительности позволяет легко перевести вашу систему в состояние, при котором будут отключены ресурсоемкие возможности, не являющиеся критичными для функционирования форума. При переключении в данный режим, старые настройки запоминаются и вы в любой момент снова можете вернуться к ним. Рекомендуется использовать данный режим в случаях внезапного повышения нагрузки на систему (например, в результате лавинообразного трафика). - - core - admin_tools - cc_processed - Removal Completed: %s items removed - Удаление завершено: %s позиций удалено - - core - admin_tools - cc_sigs - Cached Signatures - Кешированных подписей + tol_register_new_log_in_method + Add Log In Method + core admin_tools cc_posts Cached Posts - Сообщений в кеше + + + core + admin_tools + cc_sigs + Cached Signatures + + + core + admin_tools + cc_processed + Removal Completed: %s items removed + + + core + admin_tools + perf_help_information + + + + core + admin_tools + tol_settings + Settings + + + core + admin_tools + tol_add_new_setting_group + Add New Setting Group + + + core + admin_tools + tol_registered_log_in_authenticati + Registered Log In Authentication Methods + core admin_tools cc_header Cached Content - Кеш содержимого + core admin_tools cc_remove_seven Remove items older than %s days - Удалить записи старше %s дней - - core - admin_tools - setting_staff_tag - ( STAFF ) - ( АДМ ) - - core - admin_tools - login_manage_enabled - Enabled? - Включен? + core admin_tools cc_remove_all Remove all items - Очистить полностью + + + core + admin_tools + login_manage_enabled + Enabled? + core admin_tools add_setting_button Add New Setting - Добавить настройку + + + core + admin_tools + setting_staff_tag + ( STAFF ) + core admin_tools settings_h_prefix Settings: - Настройки: - - core - admin_tools - noneed_rebuild_again - You do not need to rebuild this content again. - Содержимое уже обновлено + core admin_tools rebuild_process_f Processed forum %s - Обработан форум %s + core admin_tools - tools300pms - Checked %s PMs so far. This cycle: %s Private Messages converted into conversations.. - Обработано %s личных сообщений. + noneed_rebuild_again + You do not need to rebuild this content again. + core admin_tools sl_deletebook Delete - Удалить + core admin_tools - sl_title - Title - Название + tools300pms + Checked %s PMs so far. This cycle: %s Private Messages converted into conversations.. + core admin_tools sl_editbook Edit... - Изменить + core admin_tools - license_addons - License Addons - Добавление лицензии - - core - admin_tools - license_activate - Activate Your License - Данные лицензии - - core - admin_tools - license_url - Community URL - Адрес форума - - core - admin_tools - license_cache - click here to refresh the data.]]> - нажмите сюда чтобы обновить данные]]> - - core - admin_tools - license_key_server_error - There was an error contacting the license server, please try again later - Ошибка соединения с сервером, повторите попытку позже - + sl_title + Title + core admin_tools sl_m_title Share Link Services - Сервисы публикации ссылок - - core - admin_tools - sl_add - Add Service - Добавить сервис + core admin_tools sl_services Services - Сервисы + core admin_tools - sl_icon - Icon - Иконка + sl_add + Add Service + core admin_tools sl_icon_info Images are located in public/style_extra/sharelinks/ - Изображения расположены в public/style_extra/sharelinks/ + + + core + admin_tools + sl_icon + Icon + core admin_tools sl_url_info - - - core - admin_tools - license_refresh - Reload - Перезагрузить - - core - admin_tools - sl_current_title - Share Services - Сервисы публикации ссылок + core admin_tools sl_url URL - URL + core admin_tools - license_key_test_in_use - You have entered a test license key which is already in use on another site. Try entering the key without the -TESTINSTALL suffix. - Вы ввели тестовый лицензионный ключ, который уже используется на другой сайте. Попробуйте ввести ключ без суффикса -TESTINSTALL. + sl_current_title + Share Services + core admin_tools - license_key_notfound - Your license key appears to be invalid. Please check the key you have entered is valid and is not already in use. If you require assistance, please contact technical support. - Ваш лицензионный ключ неверный. Пожалуйста, свяжитесь с технической поддержкой. + license_refresh + Reload + + + core + admin_tools + license_cache + click here to refresh the data.]]> + + + core + admin_tools + license_key_server_error + There was an error contacting the license server, please try again later + core admin_tools license_key_bad Your license key could not be activated. Please contact technical support. - Ваш лицензионный ключ еще не активирован. Пожалуйста, проверьте правильность ввода ключа и попробуйте еще раз. Если проблема сохранится, обратитесь в техническую поддержку. + core admin_tools - license_services - License Services - Сервис лицензии + license_key_notfound + Your license key appears to be invalid. Please check the key you have entered is valid and is not already in use. If you require assistance, please contact technical support. + + + core + admin_tools + license_key_test_in_use + You have entered a test license key which is already in use on another site. Try entering the key without the -TESTINSTALL suffix. + core admin_tools license_key License Key - Ключ лицензии + + + core + admin_tools + license_services + License Services + + + core + admin_tools + license_addons + License Addons + + + core + admin_tools + license_activate + Activate Your License + + + core + admin_tools + license_url + Community URL + core admin_tools login_method_missing_functions PHP functions required by this login method are missing: %s - Запрос php функции данного метода авторизации утерян: %s + core admin_tools pop3_okay Test successful: %d messages found. - Тест успешен. Найдено %s сообщений. + core admin_tools pop3_err_stats Could not retrieve mailbox statistics - Не удалось получить статистику ящика + core admin_tools pop3_err_login Could not log in - Не удалось идентифицироваться - - core - admin_tools - ie_test_pop3 - Test POP3 - Проверка POP3 + core admin_tools pop3_err_connect Could not connect to the server - Не удалось соединится с сервером - - core - admin_tools - ie_delete_done - Rule Deleted - Правило удалено - - core - admin_tools - ie_deleted - Deleted Incoming Email Rule %s - Удалено правил для входящих E-mail адресов %s + core admin_tools ie_sendto Send to: - Отправить: + + + core + admin_tools + ie_deleted + Deleted Incoming Email Rule %s + + + core + admin_tools + ie_delete_done + Rule Deleted + + + core + admin_tools + ie_test_pop3 + Test POP3 + core admin_tools ie_saved Rule Saved - Правило сохранено + core admin_tools ie_added Added Incoming Email Rule %s - Добавлено правил для входящих Email %s - - core - admin_tools - ie_updated - Altered Incoming Email Rule %s - Изменено правил для входящих Email адресов %s + core admin_tools ie_save Save Rule - Сохранить + core admin_tools - ie_ignore - Ignore Message - Игнорируемые сообщения + ie_updated + Altered Incoming Email Rule %s + core admin_tools ie_rule Rule - Правило + core admin_tools - ie_cf_body - Body - Сообщение - - core - admin_tools - ie_ct_ctns - Contains - Содержимое + ie_ignore + Ignore Message + core admin_tools ie_ct_eqls Equals - Совпадение + core admin_tools ie_ct_regx Matches Regular Expression - Удовлетворяет регулярному выражению + core admin_tools - ie_cf_sbjt - Subject - Тема + ie_ct_ctns + Contains + + + core + admin_tools + ie_cf_body + Body + core admin_tools ie_cf_to Destination Email - Адресат + + + core + admin_tools + ie_cf_sbjt + Subject + core admin_tools ie_cf_from Sender Email - Исходящий e-mail + core admin_tools ie_not_found Could not locate the rule you are trying to edit. - Не найдено правило для изменения - - core - admin_tools - ie_action - Action - Действие - - core - admin_tools - ie_none - No rules to show - Никакую - - core - admin_tools - ie_criteria - Criteria - Критерий + core admin_tools ie_edit Edit Rule - Изменить + + + core + admin_tools + ie_criteria + Criteria + + + core + admin_tools + ie_action + Action + + + core + admin_tools + ie_none + No rules to show + core admin_tools ie_add Add Rule - Добавить правило + core admin_tools ie_title Incoming Email Rules - Правила для входящих Email адресов - - core - admin_tools - sl_updated - - - - core - admin_tools - sl_removed - Share link service removed - Сервис удален + core admin_tools sl_formerror Form Error - Ошибка формы + core admin_tools - sl_form_enabled - Enabled - Включено + sl_removed + Share link service removed + core admin_tools - sl_form_canonical - Use Canonical URL - Использовать стандартную ссылку - - core - admin_tools - sl_form_groups - Can be used by - Может использоваться группами: - - core - admin_tools - sl_form_groups_desc - Leave blank for all groups - Оставьте пустым для включения всех групп - - core - admin_tools - sl_must_title - You must enter a title - Вы должны ввести название - - core - admin_tools - sl_must_url - You must enter a URL format - Вы должны ввести формат сслыки + sl_updated + + core admin_tools sl_must_key You must enter a key - Вы должны ввести ключ + core admin_tools sl_added - + core admin_tools - sl_form_key_info - It is also used as the icon file name: /public/style_extra/sharelinks/KEY.png]]> - А также используется в имени файла иконки метода: /public/style_extra/sharelinks/KEY.png]]> + sl_form_groups_desc + Leave blank for all groups + + + core + admin_tools + sl_must_title + You must enter a title + + + core + admin_tools + sl_must_url + You must enter a URL format + + + core + admin_tools + sl_form_groups + Can be used by + + + core + admin_tools + sl_form_canonical + Use Canonical URL + + + core + admin_tools + sl_form_enabled + Enabled + core admin_tools sl_form_key Key - Ключ + core admin_tools - sl_form_url_info - - + sl_form_key_info + It is also used as the icon file name: /public/style_extra/sharelinks/KEY.png]]> + core admin_tools sl_form_url URL Format - Формат ссылки + + + core + admin_tools + sl_form_url_info + + core admin_tools removelicensekey Remove License Key - Удалить ключ - - core - admin_tools - uaversions - Versions: - Версии: - - core - admin_tools - sl_form_new_title - Add New Share Link Service - Добавление нового сервиса публикации ссылок - - core - admin_tools - sl_form_new_button - Add Service - Добавить - - core - admin_tools - sl_form_edit_title - Edit Share Link Service - Изменить ссылку публичного сервиса - - core - admin_tools - sl_form_main_title - Service Information - Сервисная информация - - core - admin_tools - sl_form_edit_button - Save Changes - Сохранить + core admin_tools sl_form_title Link Service Name - Название + core admin_tools - qa_createonenow - Create one now - Добавить первый + sl_form_edit_button + Save Changes + core admin_tools - gcaches_cache_rebuilt - Global Caches cache rebuilt - Глобальные кеши перестроены + sl_form_main_title + Service Information + core admin_tools - gcaches_cannot_write - Could not write to the cache file, please check permissions on /cache and /cache/globalCaches.php - Система не может произвести запись в файл кешей, пожалуйста, проверьте права на папку /cache/ и файл /cache/globalCaches.php + sl_form_edit_title + Edit Share Link Service + core admin_tools - gcaches_no_data - There are no global caches active, there is no need to rebuild anything - Глобальных кешей для перестройки нет + sl_form_new_button + Add Service + core admin_tools - gcaches_rebuild_cache - Rebuild Global Caches Cache - Перестроить только глобальные кеши + sl_form_new_title + Add New Share Link Service + + + core + admin_tools + uaversions + Versions: + core admin_tools editloginmethod Edit Log In Method - Редактирование метода входа + core admin_tools rebuild_furl_link Rebuild FURL Cache - Перестроить FURL кеш + core admin_tools - qahelp_infos - Question and Answer Challenges can help provide another line of defense against spam bots that attempt to register in your community. By setting some challenge questions unique to your site, general-purpose spam bots will find it more difficult to complete the registration process and in turn spam your community. - Система «Вопрос-ответ» предлагает другой тип защиты от спам ботов, которые пытаются регистрироваться в вашем сообществе. Уникальный (не системный) вручную заданный вопрос для регистрирующегося человека легок, но практически невозможен для спам бота. - - core - admin_tools - qastatus - - Статус системы «Вопрос-ответ» + gcaches_rebuild_cache + Rebuild Global Caches Cache + core admin_tools rebuild_furl_title Rebuilds the friendly URL cache file from all apps - Перестроить кеш файл ЧПУ для всех приложений + + + core + admin_tools + qastatus + + + + core + admin_tools + gcaches_no_data + There are no global caches active, there is no need to rebuild anything + + + core + admin_tools + gcaches_cannot_write + Could not write to the cache file, please check permissions on /cache and /cache/globalCaches.php + + + core + admin_tools + qa_createonenow + Create one now + core admin_tools qa_form_answers_extra - Не забудьте использовать много различных правильных ответов в случаях, когда на разных языках правильные ответы могут немного отличаться + core admin_tools - license_lifetime - Never]]> - Никогда]]> + gcaches_cache_rebuilt + Global Caches cache rebuilt + + + core + admin_tools + qahelp_infos + Question and Answer Challenges can help provide another line of defense against spam bots that attempt to register in your community. By setting some challenge questions unique to your site, general-purpose spam bots will find it more difficult to complete the registration process and in turn spam your community. + core admin_tools tools320photos Up to %s photos converted so far (%s photos this cycle) - %s фотографий уже сконвертировано (%s за цикл) + core admin_tools re_photosconverted All photos converted successfully - Все фотографии успешно сконвертированы. + core admin_tools expires_prefix Expires: - Истекает: + core admin_tools settings_suffix settings - настройки + core admin_tools ipssoftware_license IPS Software License - Лицензия - - core - admin_tools - re_convertfromphotos - Convert From - Конвертировать из - - core - admin_tools - re_cp_avatars - Avatars - Аватары - - core - admin_tools - re_cp_photos - Profile Photos - Фотографии профиля + core admin_tools rep_count_info THERE IS NO UNDO!]]> - ДЕЙСТВИЕ ВОЗВРАТА НЕ ИМЕЕТ]]> + core admin_tools - rep_count - Rebuild User Reputation - Обновить репутацию пользователей + license_lifetime + Never]]> + + + core + admin_tools + re_cp_photos + Profile Photos + + + core + admin_tools + re_cp_avatars + Avatars + + + core + admin_tools + re_convertfromphotos + Convert From + core admin_tools uagent_reverted The user agent has been reverted. - User Agent успешно сброшен. + core admin_tools - uagent_locate - Could not locate the user agent you are trying to edit. - Невозможно найти User Agent, который вы пытаетесь редактировать - - core - admin_tools - windowslive_help - For assistance setting up Windows Live, visit the Community Enhancements page. - Для дополнительной информации по настройке Windows Live, перейдите в раздел Расшерения Сообщества. + rep_count + Rebuild User Reputation + core admin_tools ipsconnect_details URL: %s
    Key: %s

    Note: You can use an IP.Board installation as either a master or a slave in an IPS Connect network, but not both. If this installation is the master, do not enable the IPS Connect login method.]]>
    - URL: %s
    Ключ: %s]]>
    + core admin_tools l_slave_master_slave You cannot set an IPS Connect master installation to be a slave of itself. If you are trying to configure this installation as a master in an IPS Connect network you do not need to enable or configure the IPS Connect login method on this installation. If you are trying to configure this installation as a slave in an IPS Connect network, please check the information supplied and resubmit. - Вы не можете назначить ведущий форум в сети IPS Connect одновременно и ведомым. Если вы пытаетесь настроить этот форум главным, вы не должны включать и настраивать метод авторизации IPS Connect. Если же вы настраиваете этот форум как ведомый, то проверьте введенную информацию еще раз. + + + core + admin_tools + uagent_locate + Could not locate the user agent you are trying to edit. + + + core + admin_tools + settings_nofile + There were no settings to import + + + core + admin_tools + perf_enhooks + Enabled hooks + + + core + admin_tools + windowslive_help + For assistance setting up Windows Live, visit the Community Enhancements page. + diff --git a/upload/admin/applications/core/xml/core_bbcode.xml b/upload/admin/applications/core/xml/core_bbcode.xml index e154f7c5..d5fda32f 100644 --- a/upload/admin/applications/core/xml/core_bbcode.xml +++ b/upload/admin/applications/core/xml/core_bbcode.xml @@ -3,8 +3,8 @@ 1 - Возврат к сообщению - Данный тег отображает маленький ярлычок ссылки, с помощью которого можно перейти непосредственно к сообщению - используется при цитировании сообщений форума. По умолчанию открывается в том же самом окне. + Post Snap Back + This tag displays a little linked image which links back to a post - used when quoting posts from the board. Opens in same window by default. snapback 0 @@ -26,12 +26,12 @@ 2 - Выровнять по правому краю - Выравнивание содержимого поля для размещения сообщений по правому краю + Right + Aligns content to the right of the posting area right {content}

    ]]>
    0 - + 0 @@ -49,12 +49,12 @@
    3 - Выровнять по левому краю - Выравнивание содержимого поля для размещения сообщений по левому краю + Left + Aligns content to the left of the post left {content}

    ]]>
    0 - + 0 @@ -72,15 +72,15 @@
    4 - Выровнять по центру - Выравнивание содержимого поля для размещения сообщений по центру + Center + Aligns content to the center of the posting area. center {content}

    ]]>
    0 - + 0 - Введите текст для выравнивания по центру + Enter content to be centered 0 all all @@ -95,15 +95,15 @@
    5 - Ссылка на тему - Данный тег позволяет легко создать ссылку на тему + Topic Link + This tag provides an easy way to link to a topic topic {content}]]> 1 - + 0 - Введите ID темы - Введите название для данной ссылки + Enter the topic ID + Enter the title for this link 0 all all @@ -118,15 +118,15 @@ 6 - Ссылка на сообщение - Данный тег позволяет легко создать ссылку на сообщение + Post Link + This tag provides an easy way to link to a post. post {content}]]> 1 - + 0 - Введите ID сообщения - Введите название для данной ссылки + Enter the Post ID + Enter the title for this link 0 all all @@ -141,18 +141,18 @@ 7 - Скрытый текст(spoiler) - Тег скрытого текста + Spoiler + Spoiler tag spoiler - Скрытый текст + Spoiler
    ]]>
    0 - + 0 - Введите текст, который необходимо скрыть + Enter the text to be masked 0 all all @@ -167,15 +167,15 @@
    8 - Сокращение - Позволяет ввести сокращение, описание которого будет отображаться при наведении указателя мыши на сокращение + Acronym + Allows you to make an acronym that will display a description when moused over acronym {content}]]> 1 0 - Введите описание сокращения (напр.: Laugh Out Loud) - Введите сокращение (напр.: lol) + Enter the description for this acronym (EG: Laugh Out Loud) + Enter the acronym (EG: lol) 0 all all @@ -190,12 +190,12 @@ 9 - Полужирный шрифт - Отображает текст полужирным шрифтом + Bold Text + Makes text bold b {content}]]> 0 - + 0 @@ -213,12 +213,12 @@ 10 - Курсив - Отображает текст курсивом + Italic Text + Makes the text italic i {content}]]> 0 - + 0 @@ -236,12 +236,12 @@ 11 - Нижнее подчеркивание - Подчеркивает текст + Underlined Text + Makes the text underlined u {content}]]> 0 - + 0 @@ -259,8 +259,8 @@ 12 - Горизонтальная черта - Добавляет горизонтальную черту для разделения текста + Horizontal Rule + Adds a horizontal rule to separate text hr  ]]> 0 @@ -282,15 +282,15 @@ 13 - Код - Используйте данный ВВ-код для отображения поля с кодом + Code + Allows you to enter general code code 0 0 - Код + Code 0 all all @@ -305,8 +305,8 @@ 14 - PHP код - Отображение PHP кода с форматированием и подсветкой синтаксиса + PHP Code + Allows you to enter PHP code into a formatted/highlighted syntax box php {content} @@ -317,7 +317,7 @@ print_r($variable);[/php]]]> 0 - PHP код + PHP Code 0 all all @@ -332,19 +332,19 @@ print_r($variable);[/php]]]> 15 - HTML код - Отображение HTML разметки с форматированием и подсветкой синтаксиса + HTML Code + Allows you to enter formatted/syntax-highlighted HTML code html {content}
  • ]]>0 -

    Привет, Мир!

    +

    Hello World

    [/html]]]>
    0 - HTML код + HTML Code 0 all all @@ -359,8 +359,8 @@ print_r($variable);[/php]]]> 16 - SQL код - Отображение SQL кода с форматированием и подсветкой синтаксиса + SQL Code + Allows you to enter formatted/syntax-highlighted SQL code sql {content} @@ -369,7 +369,7 @@ print_r($variable);[/php]]]> 0 - SQL команда + SQL Commands 0 all all @@ -384,8 +384,8 @@ print_r($variable);[/php]]]> 17 - XML код - Отображение XML разметки с форматированием и подсветкой синтаксиса + XML Code + Allows you to enter formatted/syntax-highlighted XML code xml {content} @@ -398,7 +398,7 @@ print_r($variable);[/php]]]> [/xml]]]> 0 - XML код + XML Code 0 all all @@ -414,7 +414,7 @@ print_r($variable);[/php]]]> 18 URL - Тег для создания гиперссылки + A standard HTML url anchor tag url 1 @@ -438,8 +438,8 @@ print_r($variable);[/php]]]> 19 - Изображение - Вставка изображения в текст + Image + Displays linked images img 1 @@ -461,14 +461,14 @@ print_r($variable);[/php]]]> 20 - Цитата - Отобажение цитаты в тексте + Quote + Displayed quoted text within post content quote 0 - +[quote name='Username' date='Jun 30 2008, 10:39 AM' post='1735291']Quoted post content here[/quote]]]> 0 @@ -486,12 +486,12 @@ print_r($variable);[/php]]]> 21 - Отступ - Небольшой отступ текста от левой границы + Indent + Indents text a few spaces from the left content border indent {content}]]> 1 - + 0 @@ -509,19 +509,19 @@ print_r($variable);[/php]]]> 22 - Список - Создание HTML списка. Поддерживаются многоуровневые списки и разные типы маркеров + Lists + Generate HTML lists. Supports multi-dimensional lists, and different list marker types. list 0 - 0 @@ -541,12 +541,12 @@ print_r($variable);[/php]]]> 23 - Перечеркнутый текст - Отображает перечеркнутый текст + strike + Displays text striked-out strike {content}]]> 0 - + 0 @@ -564,12 +564,12 @@ print_r($variable);[/php]]]> 24 - Подстрочный текст - Отображение подстрочного текста + Subscript text + Displays text lowered on the line sub {content}]]> 0 - + 0 @@ -587,12 +587,12 @@ print_r($variable);[/php]]]> 25 - Надстрочный текст - Отображение надстрочного текста + Superscript Text + Displays superscript text sup {content}]]> 0 - + 0 @@ -610,14 +610,14 @@ print_r($variable);[/php]]]> 26 - Email адрес - Создание ссылки на Email адрес + Email address + Formats an email address as a mailto link email {content}]]> 1 - +My email address is [email]my@emailaddress.com[/email]]]> 0 @@ -635,12 +635,12 @@ print_r($variable);[/php]]]> 27 - Цвет фона - Изменяет цвет фона текста + Background-color + Adds a background color behind the text background {content}]]> 1 - + 0 @@ -658,12 +658,12 @@ print_r($variable);[/php]]]> 28 - Цвет текста - Изменяет цвет отображаемого текста + Color text + Applies a different text-color to the text color {content}]]> 1 - + 0 @@ -681,12 +681,12 @@ print_r($variable);[/php]]]> 29 - Размер текста - Увеличивает или уменьшает размер текста + Size tag + Makes text bigger or smaller in font-size size 1 - + 0 @@ -704,12 +704,12 @@ print_r($variable);[/php]]]> 30 - Шрифт - Изменяет шрифт текста + Font tag + Applies a different font-family to the text font {content}]]> 1 - + 0 @@ -727,14 +727,14 @@ print_r($variable);[/php]]]> 31 - Ссылка на пользователя - + Member + member 1 - + 0 - Имя пользователя + Member Name 1 all @@ -750,15 +750,15 @@ print_r($variable);[/php]]]> 32 - Медиа - Позволяет размещать видео, аудио и другие ролики с некоторых сайтов + Media + Allows a user to post media content from certain common media sites media 1 0 - Разрешение (только Flash) - Ссылка + Dimensions (Flash Only) + Media URL 0 all all @@ -774,14 +774,14 @@ print_r($variable);[/php]]]> 33 Twitter - + twitter @{content}]]> 0 0 - Пользователь + Twitter Username 0 all all @@ -796,8 +796,8 @@ print_r($variable);[/php]]]> 34 - Медиа приложений - Размещение медиа контента из дополнительных приложений к IP.Board + Shared Media + Allows users to share media throughout IP.Board and addon applications sharedmedia 1 diff --git a/upload/admin/applications/core/xml/core_help.xml b/upload/admin/applications/core/xml/core_help.xml index 736486d9..7f0747b6 100644 --- a/upload/admin/applications/core/xml/core_help.xml +++ b/upload/admin/applications/core/xml/core_help.xml @@ -2,179 +2,183 @@ - Поиск - + Searching +
    - Быстрый поиск
    -Вы можете начать быстрый поиск, набрав ключевые слова в панели быстрого поиска в верхней части любой страницы и нажать кнопку "Поиск".
    +<strong>Quick Search</strong>
    +You can start a quick search by typing your keywords into the quick-search bar at the top of any page and pressing the "Search" button.

    - Дополнительные параметры
    -Если вместо ввода ключевых слов в панели быстрого поиска, вы нажмите кнопку "Расширенный поиск", вы увидите дополнительные параметры поиска.
    +<strong>Advanced Options</strong>
    +If instead of typing your keywords into the quick-search bar, you click the "Advanced" link next to it, you will see some advanced options for searching.

    -Первый вариант, "Поиск по ключевым словам", где вы можете ввести ключевые слова для поиска.
    +The first option, "Find <strong>words</strong>" is where you can enter the keywords to search for.

    -Опция "Поиск по автору" может быть использован для поиска содержимого, связанного с конкретным пользователем. Как только вы начнете вводить имя, вы увидите выпадающее с предложением имен пользователей, которые вы можете выбрать.
    +The next option, "Find <strong>author</strong>" can be used to only find content from a specific user. As you begin typing ausername, you should see a dropdown with username suggestions that you can select from.

    -Опция "Поиск по дате " позволяет получить результаты между конкретными датами. Чтобы выбрать дату, нажмите <img src='{style_image_url}/date.png' /> - это вызов календаря. Здесь вы можете выбрать любую дату и ваш выбор будет занесен в форму поиска.
    +The next option, "Find by <strong>date</strong>" allows you to restrict the results to content added between particular dates. To select your date, click the <img src='{style_image_url}/date.png' /> button - this will bring up a calendar. From here you can select any date and your option will be filled into the search form.

    -Опция "Поиск в разделе позволяет ограничить результаты содержимым одного или нескольких форумов. Вы можете выбрать несколько вариантов, удерживая нажатой клавишу Ctrl (или CMD, если вы используете Mac).
    +The next option, "Find in <strong>forum</strong> allows you to restrict your results to content within particular forums. You can select multiple options by holding the Ctrl key on your keyboard (or the cmd key if you use a Mac) and clicking on your options.

    -Вы можете оставить любое из этих полей пустым, однако вы должны указать по крайней мере один критерий поиска при отправке формы. После того как вы заполнили параметры, которые требуются, нажмите <span class='input_submit'> Найти </span>.
    +You can leave any of these options blank, however you must supply at least one search criteria when submitting the form. Once you have filled in the options that you require, press the <span class='input_submit'>Do Search</span> button.

    - Контекстный поиск
    -Когда вы читаете определенную тему или форум, вы заметите, что панель поиска изменяется с "Форумы" на "Эта тема" - это позволяет легко и быстро выполнять поиск по текущей теме, форуму, или приложению.
    +<strong>Inline Search</strong>
    +When you are viewing a particular topic, or a particular forum, you will notice that the search bar changes from "Search Forum" to "Search This Topic" - this allows you to easily and quickly search through the current topic, forum, or application, without getting search results for other areas of the forum.

    - Результаты
    -После того как вы закончили поиск, на странице результатов появятся вкладки - вы можете изменить выбранную закладку, чтобы получить результаты для другой области. Например, для результатов в разделе "Форум" откроются любые темы и сообщения, которые содержат ключевые слова поиска, если же нажать на закладку «Пользователи» появятся пользователи, которые соответствуют критериям поиска.
    +<strong>Results</strong>
    +Once you have submitted your search, a tabbed page of results will appear - you can change the selected tab to choose which area of the community you wish to search. For example, results under the "Forums" tab will bring up any topics and posts that contain your search keywords, while the "Members" tab will bring up any member accounts that match your search criteria.

    -Вы можете изменить порядок сортировки результатов по релевантности или дате, используя опции в верхней части страницы результатов поиска.
    +You can change the order of the results to sort by relevance or to sort by date using the options at the top of the results page.

    -Ключевые слова, которые вы искали будут выделены .
    +The keywords that you searched for will be highlighted like <span class='searchlite'>this</span>.

    -Как только вы нашли в результатах то, что искали, вы можете нажать на элемент, чтобы открыть страницу. Если вы ищете темы или сообщения, вы можете использовать значок предварительного просмотра, чтобы просмотреть результаты поиска не покидая страницы.]]>
    - Как пользоваться поиском. +Once you have found the result you are looking for, you can click on it to bring up the page, or, if you are searching through the forums, you can click on the preview icon to preview the search results without having to leave the search page.]]>
    + How to use the search feature. 8 core
    - Ваши настройки - Вы можете получить доступ к настройкам с любой страницы, выбрав свое имя в верхней части экрана, а затем выбрав пункт "настройки".
    -
    -Есть несколько вкладок в боковой части страницы, которые позволяют настраивать и обновлять различные опции:
    -
    -
    -
    - Данные профиля
    -В этом разделе вы можете настроить различные данные вашего профиля, в том числе:

    + Your Settings + + You can access your settings from any page by selecting your name at the top of the screen and then selecting "My Settings".
    +
    + There are several tabs on the side of the page, which allow you to configure and update different board settings:
    +
    +
    +
    + Profile Settings
    + From the Profile Settings area of your UserCP, you can configure various aspects of your profile, including:

      -
    • -Фотография Профиля: Эта фотография используется для отображения во всех разделах сообщества.
    • -
    • -Установить часовой пояс
    • -
    • -Настроить комментарии: Другие участники форума смогут оставлять комментарии в вашем профиле
    • . -
    • -Изменить список друзей.
    • -
    • -Изменить информацию "О себе"
    • -
    • -Изменить Статус
    • -
    • -Указать свой день рождения
    • -
    • -Добавить дополнительную информацию, такую как интересы
    • -
    • -Добавить контактную информацию, такую ​​как номер ICQ.
    • -
    +
  • + Profile Picture: This is the photo used to identify you throughtout the community.
  • +
  • + Timezome
  • +
  • + Allow Comments: If checked, other forum members can leave comments on your profile.
  • +
  • + Friends
  • +
  • + Edit your "About Me" information
  • +
  • + Change your Member Title
  • +
  • + Update your Birthday
  • +
  • + Add profile information, such as interests
  • +
  • + Share contact information such as AIM usernames.
  • +

    -

    +  

    - Персонализация профиля

    + Profile Customization

    -Здесь вы можете настроить пользовательский фон, настроить внешний вид вашего профиля.

    + From the Profile Customization tab of your UserCP, you can setup a custom profile background, change the colors of your profile, and perform other ways to customize the look and feel of your profile.

    -

    +  

    - E-mail и пароль

    + Email & Password

    -Раздел E-mail и пароль позволяет изменить пароль или адрес электронной почты, связанный с вашим аккаунтом.

    + The Email & Password area allows you to update the password or email address associated with your account.

    -

    +  

    - Отображаемое Имя

    + Display Name

    -На странице Отображаемое Имя можно изменить имя, которое отображается для других пользователей сообщества. Администратор ограничивает количество раз, которое вы можете изменить свое отображаемое имя.

    + The Display Name page allows you to change the name that is shown to members throughout the community. The board administrator limits the number of times you can change your display name, so make changes wisely.

    -

    +  

    - Подпись

    + Signature

    -Позволяет изменить подпись, которая приведена внизу всех ваших сообщений.

    + The signature page allows you to modify the custom signature that is shown below all of your posts.

    -

    +  

    - Игнорируемые

    + Ignore

    -На вкладке "Игнорируемые" вы можете скрыть или показать ранее скрытые сообщения отдельных пользователей, подписи, чаты, обновления статуса или другие элементы.

    . + The "ignore" tab allows you to configure your Ignore settings - you can choose to hide individual member's posts, signatures, chats, status updates, or other aspects of a member that you wish to hide.

    -

    +  

    - Соединение с Facebook / Twitter / Вконтакте

    + Manage Facebook/Twitter

    -Если вы подключили ваш профиль в Facebook или Twitter, вы можете управлять соединением, в том числе параметрами импорта обновлений статуса, фотографией профиля, и т.д.

    + If you have connected your forum profile to Facebook or Twitter, you can manage your connection here, including settings on importing status updates, linking your user photo, and more.

    -

    +  

    - Управление вложениями

    + Manage Attachments

    -Эта страница будет отображать все вложения, которые вы загрузили на форум. Если вы достигли лимита объема вложений, можете удалить вложения с помощью этой вкладки.

    + This page will display all attachments that you have uploaded to the forum. If you are running close to your global attachment limit, you can delete attachments from this area. 

    -

    +  

    - Параметры уведомлений

    + Notification Options

    -На странице Параметры уведомлений можно настроить, как вы должны быть уведомлены о событиях, таких как ответ в тему, личное сообщение, или новая тема. Вы можете настроить, как вы хотели бы получать эти уведомления, через мобильные приложения, электронную почту, или встроенную систему.

    + The Notification Options page allows you to configure how you should be notified of certain events, such as a reply to a topic, a private message, or a new topic. You can configure how you would like to recieve these notifications as well, such as via the mobile application, email, or inline notifications.

    -

    +  

    - Ваши уведомления

    + Your Notifications

    -На этой вкладке отображаются последние уведомления, которые вы получили.

    + This tab will display the most recent notifications that you have recieved.

    -

    +  

    -

    +  

    -

    +  

    -

    ]]>
    - Управление контактной информацией, данными профиля, подписью и т.д.. +  

    ]]>
    + Editing contact information, personal information, signatures, board settings, languages and style choices. 3 core
    - Как зарегистрироваться - в верхней части любой страницы. Вам нужно будет ввести ваш адрес электронной почты и пароль для завершения процесса регистрации. На некоторых форумах может быть включена система подтверждения e-mail адреса. В таком случае на ваш почтовый ящик придет письмо со ссылкой для активации вашего аккаунта и получения полного доступа к функциям. -

    -Некоторые сообщества могут иметь более простой способ регистрации без заполнения регистрационной формы. Если вы видите значек Вконтакте,Facebook или Twitter рядом с кнопкой входа, вы можете использовать существующую регистрационную информацию от этих сайтов, чтобы создать свой ​​аккаунт. Регистрация с помощью этого метода занимает всего 3 клика.
    ]]>
    - Как зарегистрироваться и получить все преимущества зарегистрированного пользователя. + How to Register + +
    + To sign up, click the "Create Account" link at the top of any page. You can then provide your email address and password to complete the registration process. +
    +Some communities may have an easier way to register without filling out the registration form. If enabled, you will see a Facebook or Twitter icon next to the Create Account button. If you use these services, you can use your existing login information from those services to link your account. Registration via this method takes only 3 clicks and will return you back to the forum after you authorize it. +
    + You may be registered and logged straight in, or you may have to verify your email address by clicking a link in an email that we will send you. If this is the case, a screen will appear with further instructions. You will receive a confirmation of your membership as an email.]]>
    + How to register and the added benefits of being a registered member. 1 core
    - Вход и выход с форума - Вход в систему
    -После того как вы зарегистрировались, вы можете войти в систему, нажав кнопку "Вход" вверху любой страницы.
    + Logging In and Out + +Once you have signed up for an account, you can log in by pressing the "Sign In" button at the top of any page.

    -Здесь, вы должны ввести ваше имя пользователя или адрес электронной почты и пароль, который вы использовали при регистрации. Если поставить галочку "Запомнить меня" вам не придется заполнять форму, при следующих посещениях форума. Эта возможность может быть очень полезной, но не следует ее использовать, если другие люди имеют доступ к вашему компьютеру или если Вы используете компьютер в общественном месте.
    +From here, you should enter your username or email address, and the password you used when you registered. If you tick the "Remember Me" box you will not have to sign in when you visit the community in future. This ability can be very useful, but should not be used if other people have access to your computer or if you are using a public computer.

    -Вы также можете скрыть свою имя в списке онлайн-пользователей, поставив галочку "Анонимный вход". Администраторы по-прежнему смогут видеть вас, если вы это сделаете, однако другие пользователи не смогут.
    +You may also be able to hide your username from the online list by checking the "Sign in anonymously" box. Administrators will still be able to see you online if you do so, however other members will not be able to.

    -Когда вы будете готовы, нажмите кнопку Войти .
    -После входа вы будете перемещены на страницу, которую вы ранее просматривали.
    +When you are ready, click <span class='input_submit'>Sign In</span>.
    +Once logged in, you should be taken back to whatever page you were previously viewing.

    -Вы также можете увидеть дрополнительные параметры входа, такие как Twitter или Facebook Connect. Если эти функции доступны, и вы предпочли бы использовать один из этих вариантов входа в систему, нажмите на соответствующую кнопку и следуйте инструкциям на экране.
    +You may also see additional log in options such as Twitter or Facebook Connect. If these features are available and you would prefer to use one of these options to log in, click on the appropriate button and follow the on-screen instructions.


    - Забыли пароль?
    -Если вы забыли свой пароль, вы можете нажать кнопку "Я забыл пароль" на странице входа ниже поле пароля. Это приведет вас на страницу, где вы можете ввести ваше имя пользователя или адрес электронной почты, и мы вышлем по электронной почте новый пароль, который вы можете использовать или ссылку, чтобы сбросить пароль.
    +<strong>Forgotten your password</strong>
    +If you have forgotten your password, you can click the "I've forgotten my password" link on the sign in page below the password box. This will take you to a page where you can enter your username or email address, and we will then either email you a new password that you can use or a link for you to reset your password.

    -Обратите внимание, что если вы заблокировали свой аккаунт, введя неправильный пароль слишком много раз, вам все равно нужно, разблокировать аккаунт, прежде чем вы сможете использовать ваш новый пароль.
    +Note that if you locked your account by typing in the wrong password too many times, you will still need to unlock your account before you can use your new password. Please contact an administrator for assistance if you encounter trouble with a locked account.


    - Выход
    -Для выхода нажмите кнопку "Выход" в верхней части экрана с любой страницы.]]>
    - Как войти на форум и выйти из него, как оставаться невидимым для других пользователей и что делать, если вы забыли свой пароль. +<strong>Logging Out</strong>
    +To log out click the "Sign Out" link at the top of the screen from any page.]]>
    + How to log in and out from the board, how to remain anonymous and not be shown on the active users list and what to do if you forget your password. 2 core
    - Связь с администрацией - + Contacting the staff +
    -Обратите внимание, что вы можете сообщить о нарушении правил всем сотрудникам, нажав кнопку "Жалоба" при просмотре содержимого.]]>
    - Где найти список контактов администраторов и модераторов форума. +Note that you can report content to all staff by pressing the "Report" button when viewing the content.]]>
    + Where to find a list of the board moderators and administrators. 10 core
    diff --git a/upload/admin/applications/core/xml/core_mediatag.xml b/upload/admin/applications/core/xml/core_mediatag.xml index 0e7aeb16..37f8f9d1 100644 --- a/upload/admin/applications/core/xml/core_mediatag.xml +++ b/upload/admin/applications/core/xml/core_mediatag.xml @@ -7,13 +7,13 @@ ]]> - Google Видео - + Google Video + http://video.google.com/videoplay?docid={1} ]]> - MySpace Видео - + MySpace Video + http://www.myspace.com/video/{1}/(\d+)$ @@ -24,7 +24,7 @@ GameTrailers - + http://www.gametrailers.com/{1}/{2}/{3} ]]> @@ -33,8 +33,8 @@ ]]> - Фотосет из Flickr - + Flickr Image Set + http://www.flickr.com/photos/{1}/sets/{2}/ ]]> @@ -46,24 +46,14 @@ ]]> - Flash-ролик + Flash Movie/Game {1}.swf - ]]> + ]]> Vimeo http{1}://vimeo.com/{2} ]]> - - Vkontakte - - ]]> - - - Videomore - - ]]> - diff --git a/upload/admin/applications/core/xml/core_mobile_css.xml b/upload/admin/applications/core/xml/core_mobile_css.xml index 7893778b..51bbdc31 100644 --- a/upload/admin/applications/core/xml/core_mobile_css.xml +++ b/upload/admin/applications/core/xml/core_mobile_css.xml @@ -2,7 +2,7 @@ 0 - 1369791762 + 1383006097 calendar_select 1 @@ -15,7 +15,7 @@ 0 - 1369791762 + 1383006097 ipb_editor 1 @@ -28,7 +28,7 @@ 0 - 1369791762 + 1383006097 ipb_ie #search { position: absolute !important; @@ -105,7 +105,7 @@ 0 - 1369791762 + 1383006097 ipb_print 0 - 1369791762 + 1383006097 ipb_styles skin_global - xmlns:fb="http://www.facebook.com/2008/fbml"> + xmlns:fb="http://www.facebook.com/2008/fbml"> {$header_items['title']}<if test="pagenumberintitle:|:$header_items['page']"> {$this->lang->words['page_title_page']} {$header_items['page']}</if> @@ -1292,7 +1292,7 @@ if( empty($r['author']['member_id']) && !empty($r['author']['comment_author_name
    {$this->lang->words['skin_gen_new_visual_title']} @@ -284,26 +279,6 @@ HTML;

    {$this->lang->words['skin_gen_next_dotdotdot']}

    - {$this->lang->words['skin_gen_new_visual_title']} -
    -

    {$this->lang->words['vse_disabled']}

    -

    $lang

    -
    -