From 32bd58238b0e9a296c953491b34c8153d41c95d5 Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Fri, 18 Oct 2024 11:38:20 +0200 Subject: [PATCH] Use `prepare()` instand of `prepareStatement()` Don't use `WCF_N` anymore --- ...pdate_com.woltlab.wcf_6.1_spider_step1.php | 2 +- .../acp/action/InstallPackageAction.class.php | 4 +- .../acp/action/UserExportGdprAction.class.php | 24 ++-- .../action/UserQuickSearchAction.class.php | 36 ++--- .../form/ApplicationManagementForm.class.php | 8 +- .../lib/acp/form/BBCodeEditForm.class.php | 4 +- .../files/lib/acp/form/BoxAddForm.class.php | 4 +- .../lib/acp/form/DataImportForm.class.php | 4 +- .../lib/acp/form/LabelGroupAddForm.class.php | 8 +- .../lib/acp/form/LabelGroupEditForm.class.php | 4 +- .../files/lib/acp/form/MenuAddForm.class.php | 4 +- .../lib/acp/form/NoticeEditForm.class.php | 4 +- .../NotificationPresetSettingsForm.class.php | 10 +- .../files/lib/acp/form/PageAddForm.class.php | 4 +- .../lib/acp/form/SmileyAddForm.class.php | 4 +- .../files/lib/acp/form/StyleAddForm.class.php | 8 +- .../files/lib/acp/form/TagEditForm.class.php | 4 +- .../lib/acp/form/TemplateAddForm.class.php | 8 +- .../acp/form/TemplateGroupAddForm.class.php | 8 +- .../lib/acp/form/TrophyEditForm.class.php | 8 +- .../files/lib/acp/form/UserAddForm.class.php | 4 +- .../acp/form/UserAssignToGroupForm.class.php | 4 +- .../files/lib/acp/form/UserEditForm.class.php | 4 +- .../form/UserEmailAddressExportForm.class.php | 8 +- .../acp/form/UserGroupOptionForm.class.php | 4 +- .../lib/acp/form/UserMergeForm.class.php | 64 ++++----- .../lib/acp/form/UserOptionAddForm.class.php | 4 +- .../form/UserOptionSetDefaultsForm.class.php | 12 +- .../lib/acp/form/UserSearchForm.class.php | 2 +- .../lib/acp/page/ArticleListPage.class.php | 6 +- .../files/lib/acp/page/BoxListPage.class.php | 4 +- .../lib/acp/page/CronjobLogListPage.class.php | 2 +- .../lib/acp/page/LabelGroupListPage.class.php | 2 +- .../lib/acp/page/LabelListPage.class.php | 2 +- .../lib/acp/page/LanguageListPage.class.php | 6 +- .../files/lib/acp/page/LicensePage.class.php | 36 ++--- .../files/lib/acp/page/MenuListPage.class.php | 6 +- .../files/lib/acp/page/PackagePage.class.php | 4 +- .../files/lib/acp/page/PageListPage.class.php | 4 +- ...bscriptionTransactionLogListPage.class.php | 6 +- .../PaidSubscriptionUserListPage.class.php | 6 +- .../lib/acp/page/StyleListPage.class.php | 2 +- .../lib/acp/page/SystemCheckPage.class.php | 26 ++-- .../files/lib/acp/page/TagListPage.class.php | 6 +- .../acp/page/TemplateGroupListPage.class.php | 4 +- .../lib/acp/page/UserGroupListPage.class.php | 2 +- .../files/lib/acp/page/UserListPage.class.php | 26 ++-- .../page/UserOptionCategoryListPage.class.php | 2 +- .../lib/acp/page/UserOptionListPage.class.php | 2 +- .../lib/acp/page/UserRankListPage.class.php | 2 +- .../lib/acp/page/UserTrophyListPage.class.php | 4 +- .../AbstractDatabaseObjectAction.class.php | 2 +- .../files/lib/data/DatabaseObject.class.php | 24 ++-- .../lib/data/DatabaseObjectEditor.class.php | 6 +- .../lib/data/DatabaseObjectList.class.php | 8 +- .../lib/data/I18nDatabaseObjectList.class.php | 2 +- .../files/lib/data/TFastCreate.class.php | 2 +- .../lib/data/TMultiCategoryObject.class.php | 4 +- .../lib/data/acp/session/ACPSession.class.php | 2 +- .../acp/session/ACPSessionEditor.class.php | 2 +- .../acp/session/log/ACPSessionLog.class.php | 6 +- .../session/log/ACPSessionLogList.class.php | 4 +- .../files/lib/data/ad/AdAction.class.php | 4 +- .../files/lib/data/ad/AdEditor.class.php | 8 +- .../application/ApplicationAction.class.php | 4 +- .../files/lib/data/article/Article.class.php | 8 +- .../lib/data/article/ArticleAction.class.php | 8 +- .../lib/data/article/ArticleEditor.class.php | 4 +- .../data/article/TaggedArticleList.class.php | 2 +- .../data/article/ViewableArticle.class.php | 18 +-- .../article/ViewableArticleList.class.php | 4 +- .../category/ArticleCategory.class.php | 4 +- .../category/ArticleCategoryCache.class.php | 4 +- .../article/content/ArticleContent.class.php | 8 +- .../AdministrativeAttachmentList.class.php | 10 +- .../attachment/AttachmentEditor.class.php | 8 +- .../GroupedAttachmentList.class.php | 2 +- .../files/lib/data/bbcode/BBCode.class.php | 4 +- .../lib/data/bbcode/BBCodeAction.class.php | 12 +- .../blacklist/entry/BlacklistEntry.class.php | 12 +- .../entry/BlacklistEntryAction.class.php | 4 +- .../install/files/lib/data/box/Box.class.php | 20 +-- .../files/lib/data/box/BoxAction.class.php | 12 +- .../lib/data/box/content/BoxContent.class.php | 8 +- .../data/category/CategoryAction.class.php | 4 +- .../data/category/CategoryEditor.class.php | 14 +- .../LikeableCommentResponseProvider.class.php | 6 +- .../option/ContactOptionAction.class.php | 4 +- .../ContactRecipientAction.class.php | 4 +- .../lib/data/cronjob/CronjobEditor.class.php | 12 +- .../cronjob/log/CronjobLogEditor.class.php | 4 +- .../lib/data/label/LabelAction.class.php | 8 +- .../lib/data/label/LabelEditor.class.php | 12 +- .../label/group/LabelGroupAction.class.php | 8 +- .../data/language/LanguageEditor.class.php | 128 +++++++++--------- .../files/lib/data/like/Like.class.php | 4 +- .../files/lib/data/like/LikeAction.class.php | 12 +- .../lib/data/like/object/LikeObject.class.php | 4 +- .../files/lib/data/media/Media.class.php | 4 +- .../lib/data/media/MediaAction.class.php | 16 +-- .../files/lib/data/media/MediaList.class.php | 2 +- .../data/media/ViewableMediaList.class.php | 2 +- .../files/lib/data/menu/MenuEditor.class.php | 12 +- .../data/menu/item/MenuItemAction.class.php | 4 +- .../data/menu/item/MenuItemEditor.class.php | 12 +- .../queue/ModerationQueue.class.php | 4 +- .../queue/ModerationQueueAction.class.php | 12 +- .../ViewableModerationQueueList.class.php | 8 +- .../files/lib/data/notice/Notice.class.php | 4 +- .../lib/data/notice/NoticeAction.class.php | 8 +- .../lib/data/notice/NoticeEditor.class.php | 8 +- .../files/lib/data/option/Option.class.php | 4 +- .../lib/data/option/OptionEditor.class.php | 12 +- .../files/lib/data/package/Package.class.php | 8 +- .../queue/PackageInstallationQueue.class.php | 4 +- .../update/PackageUpdateAction.class.php | 50 +++---- .../server/PackageUpdateServer.class.php | 6 +- .../server/PackageUpdateServerList.class.php | 2 +- .../files/lib/data/page/Page.class.php | 28 ++-- .../files/lib/data/page/PageAction.class.php | 32 ++--- .../files/lib/data/page/PageEditor.class.php | 10 +- .../data/page/content/PageContent.class.php | 8 +- .../PaidSubscriptionEditor.class.php | 8 +- .../PaidSubscriptionTransactionLog.class.php | 4 +- .../user/PaidSubscriptionUser.class.php | 4 +- .../files/lib/data/poll/PollAction.class.php | 34 ++--- .../files/lib/data/poll/PollEditor.class.php | 16 +-- .../data/reaction/ReactionAction.class.php | 14 +- .../type/ReactionTypeAction.class.php | 16 +-- .../keyword/SearchKeywordAction.class.php | 8 +- .../data/stat/daily/StatDailyAction.class.php | 10 +- .../files/lib/data/style/Style.class.php | 6 +- .../lib/data/style/StyleAction.class.php | 14 +- .../lib/data/style/StyleEditor.class.php | 50 +++---- .../install/files/lib/data/tag/Tag.class.php | 4 +- .../files/lib/data/tag/TagAction.class.php | 4 +- .../files/lib/data/tag/TagEditor.class.php | 8 +- .../lib/data/template/Template.class.php | 8 +- .../data/template/TemplateEditor.class.php | 8 +- .../lib/data/template/TemplateList.class.php | 4 +- .../template/group/TemplateGroup.class.php | 4 +- .../group/TemplateGroupAction.class.php | 8 +- .../group/TemplateGroupEditor.class.php | 8 +- .../lib/data/trophy/TrophyAction.class.php | 20 +-- .../lib/data/trophy/TrophyEditor.class.php | 8 +- .../lib/data/unfurl/url/UnfurlUrl.class.php | 12 +- .../data/unfurl/url/UnfurlUrlAction.class.php | 6 +- .../data/unfurl/url/UnfurlUrlList.class.php | 2 +- .../files/lib/data/user/TeamList.class.php | 22 +-- .../files/lib/data/user/User.class.php | 32 ++--- .../files/lib/data/user/UserAction.class.php | 44 +++--- .../files/lib/data/user/UserEditor.class.php | 40 +++--- .../files/lib/data/user/UserList.class.php | 2 +- .../files/lib/data/user/UserProfile.class.php | 32 ++--- .../lib/data/user/UserProfileAction.class.php | 34 ++--- .../lib/data/user/UserProfileList.class.php | 4 +- .../UserAuthenticationFailure.class.php | 8 +- .../user/avatar/UserAvatarEditor.class.php | 8 +- .../lib/data/user/follow/UserFollow.class.php | 4 +- .../user/follow/UserFollowAction.class.php | 12 +- .../user/follow/UserFollowerList.class.php | 4 +- .../user/follow/UserFollowingAction.class.php | 8 +- .../user/follow/UserFollowingList.class.php | 6 +- .../lib/data/user/group/UserGroup.class.php | 10 +- .../data/user/group/UserGroupAction.class.php | 32 ++--- .../data/user/group/UserGroupEditor.class.php | 28 ++-- .../option/UserGroupOptionAction.class.php | 8 +- .../lib/data/user/ignore/UserIgnore.class.php | 4 +- .../user/ignore/UserIgnoreAction.class.php | 4 +- .../ignore/ViewableUserIgnoreList.class.php | 6 +- .../notification/UserNotification.class.php | 4 +- .../UserNotificationEventAction.class.php | 6 +- ...erNotificationEventRecipientList.class.php | 4 +- .../object/watch/UserObjectWatch.class.php | 4 +- .../user/online/UsersOnlineList.class.php | 16 +-- .../user/option/UserOptionEditor.class.php | 24 ++-- .../category/UserOptionCategory.class.php | 4 +- .../UserOptionCategoryAction.class.php | 4 +- .../item/UserProfileMenuItemAction.class.php | 8 +- .../item/UserProfileMenuItemEditor.class.php | 20 +-- .../visitor/UserProfileVisitor.class.php | 2 +- .../UserProfileVisitorAction.class.php | 16 ++- .../visitor/UserProfileVisitorList.class.php | 4 +- .../user/trophy/UserTrophyAction.class.php | 12 +- .../data/user/trophy/UserTrophyList.class.php | 8 +- .../form/NotificationSettingsForm.class.php | 12 +- .../NotificationUnsubscribeForm.class.php | 8 +- .../files/lib/form/SearchForm.class.php | 4 +- .../files/lib/form/UserSearchForm.class.php | 6 +- .../lib/page/AbstractArticlePage.class.php | 8 +- .../files/lib/page/ArticleListPage.class.php | 6 +- .../page/CategoryArticleListPage.class.php | 2 +- .../lib/page/CategoryTrophyListPage.class.php | 2 +- .../files/lib/page/TrophyListPage.class.php | 2 +- .../files/lib/page/TrophyPage.class.php | 8 +- .../lib/page/UnreadArticleListPage.class.php | 2 +- .../files/lib/system/WCFSetup.class.php | 12 +- .../files/lib/system/acl/ACLHandler.class.php | 24 ++-- .../acl/simple/SimpleAclHandler.class.php | 24 ++-- .../box/SystemInfoAcpDashboardBox.class.php | 2 +- .../application/ApplicationHandler.class.php | 4 +- .../attachment/AttachmentHandler.class.php | 8 +- ...cationEmailDeliveryBackgroundJob.class.php | 8 +- .../job/UnfurlUrlBackgroundJob.class.php | 4 +- .../ArticleCommentListBoxController.class.php | 4 +- .../files/lib/system/box/BoxHandler.class.php | 12 +- .../ProfileCommentListBoxController.class.php | 2 +- .../StaffOnlineListBoxController.class.php | 4 +- .../box/UserTrophyListBoxController.class.php | 16 +-- .../CreateBoxToPageAssignments.class.php | 8 +- ...AbstractUserBulkProcessingAction.class.php | 4 +- ...ArticleCategoryLabelCacheBuilder.class.php | 6 +- .../builder/BBCodeCacheBuilder.class.php | 6 +- .../builder/CategoryCacheBuilder.class.php | 2 +- .../ClipboardPageCacheBuilder.class.php | 4 +- .../builder/CronjobCacheBuilder.class.php | 4 +- .../EventListenerCacheBuilder.class.php | 4 +- .../builder/ObjectTypeCacheBuilder.class.php | 8 +- .../builder/OptionCacheBuilder.class.php | 8 +- .../cache/builder/PageCacheBuilder.class.php | 4 +- .../builder/SimpleAclCacheBuilder.class.php | 8 +- .../builder/SmileyCacheBuilder.class.php | 4 +- .../cache/builder/StyleCacheBuilder.class.php | 4 +- .../builder/TagCloudCacheBuilder.class.php | 10 +- .../UserBirthdayCacheBuilder.class.php | 4 +- .../UserGroupPermissionCacheBuilder.class.php | 10 +- .../builder/UserMenuCacheBuilder.class.php | 8 +- ...serNotificationEventCacheBuilder.class.php | 6 +- .../builder/UserStatsCacheBuilder.class.php | 8 +- .../WhoWasOnlineCacheBuilder.class.php | 6 +- .../category/AbstractCategoryType.class.php | 4 +- .../category/TrophyCategoryType.class.php | 4 +- .../cli/command/ImportCLICommand.class.php | 4 +- .../clipboard/ClipboardHandler.class.php | 28 ++-- .../action/UserClipboardAction.class.php | 4 +- .../system/comment/CommentHandler.class.php | 12 +- .../condition/UserGroupCondition.class.php | 4 +- .../condition/UserTrophyCondition.class.php | 4 +- .../AttachmentCleanUpCronjob.class.php | 4 +- .../BackgroundQueueCleanUpCronjob.class.php | 8 +- .../system/cronjob/CronjobScheduler.class.php | 8 +- .../DailyMailNotificationCronjob.class.php | 20 +-- ...iringPaidSubscriptionUserCronjob.class.php | 2 +- .../cronjob/ModerationQueueCronjob.class.php | 8 +- .../cronjob/PruneIpAddressesCronjob.class.php | 4 +- .../cronjob/StatDailyBuilderCronjob.class.php | 4 +- .../system/cronjob/UserBanCronjob.class.php | 16 +-- .../system/cronjob/UserQuitCronjob.class.php | 4 +- .../system/database/MySQLDatabase.class.php | 2 +- .../editor/MySQLDatabaseEditor.class.php | 34 ++--- .../system/database/util/SQLParser.class.php | 2 +- ...iXmlGuiPackageInstallationPlugin.class.php | 4 +- ...TXmlGuiPackageInstallationPlugin.class.php | 2 +- .../system/edit/EditHistoryManager.class.php | 16 +-- ...AbstractUserActionRenameListener.class.php | 4 +- .../AbstractUserMergeListener.class.php | 4 +- .../exporter/AbstractExporter.class.php | 2 +- .../field/option/OptionFormField.class.php | 4 +- .../option/UserGroupOptionFormField.class.php | 4 +- .../node/HtmlInputNodeTextParser.class.php | 4 +- .../importer/AbstractACLImporter.class.php | 12 +- .../AbstractCommentResponseImporter.class.php | 8 +- .../importer/AbstractImporter.class.php | 8 +- .../importer/AbstractLikeImporter.class.php | 16 +-- .../AbstractPollOptionVoteImporter.class.php | 4 +- .../system/importer/ArticleImporter.class.php | 10 +- .../system/importer/ImportHandler.class.php | 16 +-- .../importer/LabelGroupImporter.class.php | 4 +- .../system/importer/MediaImporter.class.php | 4 +- .../system/importer/SmileyImporter.class.php | 4 +- .../system/importer/TrophyImporter.class.php | 10 +- .../importer/UserAvatarImporter.class.php | 4 +- .../importer/UserFollowerImporter.class.php | 6 +- .../system/importer/UserImporter.class.php | 20 +-- .../importer/UserOptionImporter.class.php | 8 +- .../lib/system/label/LabelHandler.class.php | 24 ++-- .../system/language/LanguageFactory.class.php | 16 +-- .../lib/system/like/LikeHandler.class.php | 6 +- .../AbstractModificationLogHandler.class.php | 12 +- ...ediaMessageEmbeddedObjectHandler.class.php | 4 +- .../MessageEmbeddedObjectManager.class.php | 20 +-- ...ntResponseModerationQueueHandler.class.php | 6 +- .../AbstractModerationQueueHandler.class.php | 6 +- .../AbstractModerationQueueManager.class.php | 16 +-- .../queue/ModerationQueueManager.class.php | 30 ++-- .../ModerationQueueReportManager.class.php | 12 +- .../option/UseroptionsOptionType.class.php | 6 +- .../package/ACPTemplatesFileHandler.class.php | 12 +- .../PackageInstallationFormManager.class.php | 20 +-- .../PackageInstallationNodeBuilder.class.php | 2 +- .../PackageInstallationSQLParser.class.php | 36 ++--- .../PackageUninstallationDispatcher.class.php | 4 +- .../package/TemplatesFileHandler.class.php | 12 +- ...LOptionPackageInstallationPlugin.class.php | 52 +++---- ...roviderPackageInstallationPlugin.class.php | 6 +- ...actMenuPackageInstallationPlugin.class.php | 10 +- ...tOptionPackageInstallationPlugin.class.php | 52 +++---- ...bstractPackageInstallationPlugin.class.php | 8 +- ...ractXMLPackageInstallationPlugin.class.php | 10 +- .../BBCodePackageInstallationPlugin.class.php | 8 +- .../BoxPackageInstallationPlugin.class.php | 2 +- ...dActionPackageInstallationPlugin.class.php | 6 +- ...eObjectPackageInstallationPlugin.class.php | 6 +- ...CronjobPackageInstallationPlugin.class.php | 2 +- ...istenerPackageInstallationPlugin.class.php | 10 +- ...anguagePackageInstallationPlugin.class.php | 4 +- ...roviderPackageInstallationPlugin.class.php | 6 +- ...enuItemPackageInstallationPlugin.class.php | 2 +- .../MenuPackageInstallationPlugin.class.php | 2 +- ...initionPackageInstallationPlugin.class.php | 6 +- ...ectTypePackageInstallationPlugin.class.php | 10 +- .../OptionPackageInstallationPlugin.class.php | 4 +- .../PIPPackageInstallationPlugin.class.php | 6 +- .../PagePackageInstallationPlugin.class.php | 6 +- .../SmileyPackageInstallationPlugin.class.php | 6 +- ...istenerPackageInstallationPlugin.class.php | 6 +- ...pOptionPackageInstallationPlugin.class.php | 4 +- ...onEventPackageInstallationPlugin.class.php | 6 +- ...rOptionPackageInstallationPlugin.class.php | 6 +- ...ileMenuPackageInstallationPlugin.class.php | 6 +- .../page/handler/ArticlePageHandler.class.php | 4 +- .../handler/ContactFormPageHandler.class.php | 4 +- ...coratedCategoryLookupPageHandler.class.php | 6 +- .../page/handler/TrophyPageHandler.class.php | 2 +- .../lib/system/poll/PollManager.class.php | 10 +- .../system/reaction/ReactionHandler.class.php | 14 +- .../AbstractSearchIndexManager.class.php | 4 +- .../lib/system/search/ArticleSearch.class.php | 12 +- .../lib/system/search/PageSearch.class.php | 24 ++-- .../lib/system/search/SearchHandler.class.php | 4 +- .../search/SearchIndexManager.class.php | 2 +- .../MenuItemACPSearchResultProvider.class.php | 8 +- .../OptionACPSearchResultProvider.class.php | 8 +- .../PackageACPSearchResultProvider.class.php | 8 +- .../TrophyACPSearchResultProvider.class.php | 8 +- .../acp/UserACPSearchResultProvider.class.php | 4 +- ...oupOptionACPSearchResultProvider.class.php | 8 +- .../search/mysql/MysqlSearchEngine.class.php | 4 +- .../mysql/MysqlSearchIndexManager.class.php | 16 +-- .../MultilingualPageSitemapObject.class.php | 4 +- .../AbstractCommentStatDailyHandler.class.php | 16 +-- ...bstractDiskUsageStatDailyHandler.class.php | 4 +- .../stat/AbstractStatDailyHandler.class.php | 4 +- ...achmentDiskUsageStatDailyHandler.class.php | 4 +- .../stat/AttachmentStatDailyHandler.class.php | 4 +- .../stat/LikeStatDailyHandler.class.php | 8 +- .../stat/UserStatDailyHandler.class.php | 4 +- .../lib/system/style/StyleCompiler.class.php | 12 +- .../lib/system/tagging/TagEngine.class.php | 28 ++-- .../template/EmailTemplateEngine.class.php | 4 +- .../TrophyConditionHandler.class.php | 8 +- ...CommentResponseUserActivityEvent.class.php | 2 +- .../ArticleCommentUserActivityEvent.class.php | 2 +- .../event/UserActivityEventHandler.class.php | 16 +-- .../point/UserActivityPointHandler.class.php | 26 ++-- .../UserCollapsibleContentHandler.class.php | 24 ++-- .../CreateRegistrationNotification.class.php | 2 +- .../UserGroupAssignmentHandler.class.php | 2 +- .../UserNotificationHandler.class.php | 64 ++++----- .../TReactionUserNotificationEvent.class.php | 6 +- ...rationQueueUserNotificationEvent.class.php | 4 +- ...ommentUserNotificationObjectType.class.php | 4 +- ...ommentUserNotificationObjectType.class.php | 16 +-- ...ommentUserNotificationObjectType.class.php | 4 +- .../watch/UserObjectWatchHandler.class.php | 12 +- .../system/version/VersionTracker.class.php | 28 ++-- .../AbstractRebuildDataWorker.class.php | 4 +- .../worker/ArticleRebuildDataWorker.class.php | 8 +- .../lib/system/worker/ImportWorker.class.php | 2 +- .../lib/system/worker/MailWorker.class.php | 12 +- .../worker/PollRebuildDataWorker.class.php | 12 +- .../worker/SitemapRebuildWorker.class.php | 4 +- .../StatDailyRebuildDataWorker.class.php | 12 +- ...rActivityPointUpdateEventsWorker.class.php | 4 +- .../worker/UserRebuildDataWorker.class.php | 2 +- .../files/lib/util/MessageUtil.class.php | 10 +- .../install/files/lib/util/UserUtil.class.php | 8 +- 377 files changed, 1812 insertions(+), 1808 deletions(-) diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.1_spider_step1.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.1_spider_step1.php index cf91642998..28958c96aa 100644 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.1_spider_step1.php +++ b/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.1_spider_step1.php @@ -17,7 +17,7 @@ use wcf\system\database\table\PartialDatabaseTable; use wcf\system\WCF; $tableNames = WCF::getDB()->getEditor()->getTableNames(); -if (!\in_array('wcf' . WCF_N . '_spider', $tableNames)) { +if (!\in_array('wcf1_spider', $tableNames)) { // The table `wcf1_spider` will be removed by a database PIP that is // executed after this script. return; diff --git a/wcfsetup/install/files/lib/acp/action/InstallPackageAction.class.php b/wcfsetup/install/files/lib/acp/action/InstallPackageAction.class.php index f8dd8f7f61..cef970087e 100755 --- a/wcfsetup/install/files/lib/acp/action/InstallPackageAction.class.php +++ b/wcfsetup/install/files/lib/acp/action/InstallPackageAction.class.php @@ -176,9 +176,9 @@ class InstallPackageAction extends AbstractSecureAction { // get domain path $sql = "SELECT * - FROM wcf" . WCF_N . "_application + FROM wcf1_application WHERE packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([1]); /** @var Application $application */ diff --git a/wcfsetup/install/files/lib/acp/action/UserExportGdprAction.class.php b/wcfsetup/install/files/lib/acp/action/UserExportGdprAction.class.php index 677409f2c1..2544d0c761 100644 --- a/wcfsetup/install/files/lib/acp/action/UserExportGdprAction.class.php +++ b/wcfsetup/install/files/lib/acp/action/UserExportGdprAction.class.php @@ -155,15 +155,15 @@ final class UserExportGdprAction extends AbstractAction parent::execute(); $this->ipAddresses = [ - 'com.woltlab.blog' => ['blog' . WCF_N . '_entry '], - 'com.woltlab.calendar' => ['calendar' . WCF_N . '_event'], + 'com.woltlab.blog' => ['blog1_entry '], + 'com.woltlab.calendar' => ['calendar1_event'], 'com.woltlab.filebase' => [ - 'filebase' . WCF_N . '_file', + 'filebase1_file', ], 'com.woltlab.gallery' => [], // intentionally left empty, the image table is queried manually - 'com.woltlab.wbb' => ['wbb' . WCF_N . '_post'], - 'com.woltlab.wcf.conversation' => ['wcf' . WCF_N . '_conversation_message'], + 'com.woltlab.wbb' => ['wbb1_post'], + 'com.woltlab.wcf.conversation' => ['wcf1_conversation_message'], ]; // content @@ -173,7 +173,7 @@ final class UserExportGdprAction extends AbstractAction 'userOptions' => [], 'ipAddresses' => [], 'paidSubscriptionTransactionLog' => $this->dumpTable( - 'wcf' . WCF_N . '_paid_subscription_transaction_log', + 'wcf1_paid_subscription_transaction_log', 'userID' ), ], @@ -210,12 +210,12 @@ final class UserExportGdprAction extends AbstractAction if ($package === 'com.woltlab.filebase') { $ipAddresses = \array_merge( $ipAddresses, - $this->exportIpAddresses('filebase' . WCF_N . '_file_version', 'ipAddress', 'uploadTime', 'userID') + $this->exportIpAddresses('filebase1_file_version', 'ipAddress', 'uploadTime', 'userID') ); } elseif ($package === 'com.woltlab.gallery') { $ipAddresses = \array_merge( $ipAddresses, - $this->exportIpAddresses('gallery' . WCF_N . '_image', 'ipAddress', 'uploadTime', 'userID') + $this->exportIpAddresses('gallery1_image', 'ipAddress', 'uploadTime', 'userID') ); } @@ -257,7 +257,7 @@ final class UserExportGdprAction extends AbstractAction FROM {$databaseTable} WHERE {$userIDColumn} = ? AND {$ipAddressColumn} <> ''"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->user->userID]); return $this->fetchIpAddresses($statement, $ipAddressColumn, $timeColumn); @@ -268,7 +268,7 @@ final class UserExportGdprAction extends AbstractAction $sql = "SELECT * FROM {$tableName} WHERE {$userIDColumn} = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->user->userID]); $data = []; @@ -305,7 +305,7 @@ final class UserExportGdprAction extends AbstractAction ]; $data['session'] = $this->exportIpAddresses( - 'wcf' . WCF_N . '_user_session', + 'wcf1_user_session', 'ipAddress', 'lastActivityTime', 'userID' @@ -314,7 +314,7 @@ final class UserExportGdprAction extends AbstractAction // we can ignore the wcfN_acp_session_access_log table because it is directly related // to the wcfN_acp_session_log table and ACP sessions are bound to the ip address $data['acpSessionLog'] = $this->exportIpAddresses( - 'wcf' . WCF_N . '_acp_session_log', + 'wcf1_acp_session_log', 'ipAddress', 'lastActivityTime', 'userID' diff --git a/wcfsetup/install/files/lib/acp/action/UserQuickSearchAction.class.php b/wcfsetup/install/files/lib/acp/action/UserQuickSearchAction.class.php index 9532209b27..2dcf9aee08 100644 --- a/wcfsetup/install/files/lib/acp/action/UserQuickSearchAction.class.php +++ b/wcfsetup/install/files/lib/acp/action/UserQuickSearchAction.class.php @@ -97,11 +97,11 @@ final class UserQuickSearchAction extends AbstractAction switch ($this->mode) { case 'banned': $sql = "SELECT user_table.userID - FROM wcf" . WCF_N . "_user user_table - LEFT JOIN wcf" . WCF_N . "_user_option_value option_value + FROM wcf1_user user_table + LEFT JOIN wcf1_user_option_value option_value ON option_value.userID = user_table.userID WHERE banned = ?"; - $statement = WCF::getDB()->prepareStatement($sql, $this->maxResults); + $statement = WCF::getDB()->prepare($sql, $this->maxResults); $statement->execute([1]); $this->matches = $statement->fetchAll(\PDO::FETCH_COLUMN); break; @@ -111,11 +111,11 @@ final class UserQuickSearchAction extends AbstractAction $this->sortField = 'registrationDate'; $this->sortOrder = 'DESC'; $sql = "SELECT user_table.userID - FROM wcf" . WCF_N . "_user user_table - LEFT JOIN wcf" . WCF_N . "_user_option_value option_value + FROM wcf1_user user_table + LEFT JOIN wcf1_user_option_value option_value ON option_value.userID = user_table.userID ORDER BY user_table.registrationDate DESC"; - $statement = WCF::getDB()->prepareStatement($sql, $this->maxResults); + $statement = WCF::getDB()->prepare($sql, $this->maxResults); $statement->execute(); $this->matches = $statement->fetchAll(\PDO::FETCH_COLUMN); break; @@ -124,12 +124,12 @@ final class UserQuickSearchAction extends AbstractAction $this->sortField = 'registrationDate'; $this->sortOrder = 'DESC'; $sql = "SELECT user_table.userID - FROM wcf" . WCF_N . "_user user_table - LEFT JOIN wcf" . WCF_N . "_user_option_value option_value + FROM wcf1_user user_table + LEFT JOIN wcf1_user_option_value option_value ON option_value.userID = user_table.userID WHERE activationCode <> ? ORDER BY user_table.registrationDate DESC"; - $statement = WCF::getDB()->prepareStatement($sql, $this->maxResults); + $statement = WCF::getDB()->prepare($sql, $this->maxResults); $statement->execute([0]); $this->matches = $statement->fetchAll(\PDO::FETCH_COLUMN); break; @@ -145,34 +145,34 @@ final class UserQuickSearchAction extends AbstractAction $this->sortField = 'registrationDate'; $this->sortOrder = 'DESC'; $sql = "SELECT user_table.userID - FROM wcf" . WCF_N . "_user user_table - LEFT JOIN wcf" . WCF_N . "_user_option_value option_value + FROM wcf1_user user_table + LEFT JOIN wcf1_user_option_value option_value ON option_value.userID = user_table.userID " . $conditionBuilder . " ORDER BY user_table.registrationDate DESC"; - $statement = WCF::getDB()->prepareStatement($sql, $this->maxResults); + $statement = WCF::getDB()->prepare($sql, $this->maxResults); $statement->execute($conditionBuilder->getParameters()); $this->matches = $statement->fetchAll(\PDO::FETCH_COLUMN); break; case 'disabledAvatars': $sql = "SELECT user_table.userID - FROM wcf" . WCF_N . "_user user_table - LEFT JOIN wcf" . WCF_N . "_user_option_value option_value + FROM wcf1_user user_table + LEFT JOIN wcf1_user_option_value option_value ON option_value.userID = user_table.userID WHERE disableAvatar = ?"; - $statement = WCF::getDB()->prepareStatement($sql, $this->maxResults); + $statement = WCF::getDB()->prepare($sql, $this->maxResults); $statement->execute([1]); $this->matches = $statement->fetchAll(\PDO::FETCH_COLUMN); break; case 'disabledSignatures': $sql = "SELECT user_table.userID - FROM wcf" . WCF_N . "_user user_table - LEFT JOIN wcf" . WCF_N . "_user_option_value option_value + FROM wcf1_user user_table + LEFT JOIN wcf1_user_option_value option_value ON option_value.userID = user_table.userID WHERE disableSignature = ?"; - $statement = WCF::getDB()->prepareStatement($sql, $this->maxResults); + $statement = WCF::getDB()->prepare($sql, $this->maxResults); $statement->execute([1]); $this->matches = $statement->fetchAll(\PDO::FETCH_COLUMN); break; diff --git a/wcfsetup/install/files/lib/acp/form/ApplicationManagementForm.class.php b/wcfsetup/install/files/lib/acp/form/ApplicationManagementForm.class.php index 9ebe0c8e7e..d95609f2c4 100644 --- a/wcfsetup/install/files/lib/acp/form/ApplicationManagementForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/ApplicationManagementForm.class.php @@ -161,20 +161,20 @@ final class ApplicationManagementForm extends AbstractForm parent::save(); if (!ENABLE_ENTERPRISE_MODE || WCF::getUser()->hasOwnerAccess()) { - $sql = "UPDATE wcf" . WCF_N . "_application + $sql = "UPDATE wcf1_application SET domainName = ?, cookieDomain = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $this->domainName, $this->cookieDomain, ]); } - $sql = "UPDATE wcf" . WCF_N . "_application + $sql = "UPDATE wcf1_application SET landingPageID = ? WHERE packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($this->landingPageID as $packageID => $landingPageID) { $statement->execute([ $landingPageID ?: null, diff --git a/wcfsetup/install/files/lib/acp/form/BBCodeEditForm.class.php b/wcfsetup/install/files/lib/acp/form/BBCodeEditForm.class.php index 8470048883..bf376193e3 100644 --- a/wcfsetup/install/files/lib/acp/form/BBCodeEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/BBCodeEditForm.class.php @@ -138,9 +138,9 @@ class BBCodeEditForm extends BBCodeAddForm $this->objectAction->executeAction(); // clear existing attributes - $sql = "DELETE FROM wcf" . WCF_N . "_bbcode_attribute + $sql = "DELETE FROM wcf1_bbcode_attribute WHERE bbcodeID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->bbcodeID]); foreach ($this->attributes as $attribute) { diff --git a/wcfsetup/install/files/lib/acp/form/BoxAddForm.class.php b/wcfsetup/install/files/lib/acp/form/BoxAddForm.class.php index a9221c653e..a594edb0bb 100644 --- a/wcfsetup/install/files/lib/acp/form/BoxAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/BoxAddForm.class.php @@ -541,9 +541,9 @@ class BoxAddForm extends AbstractForm $conditionBuilder = new PreparedStatementConditionBuilder(); $conditionBuilder->add('pageID IN (?)', [$this->pageIDs]); $sql = "SELECT pageID - FROM wcf" . WCF_N . "_page + FROM wcf1_page " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); $this->pageIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); } diff --git a/wcfsetup/install/files/lib/acp/form/DataImportForm.class.php b/wcfsetup/install/files/lib/acp/form/DataImportForm.class.php index 052e8d5046..605c280989 100644 --- a/wcfsetup/install/files/lib/acp/form/DataImportForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/DataImportForm.class.php @@ -318,8 +318,8 @@ class DataImportForm extends AbstractForm if (empty($_POST)) { if (!$this->exporterName) { $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_import_mapping"; - $statement = WCF::getDB()->prepareStatement($sql); + FROM wcf1_import_mapping"; + $statement = WCF::getDB()->prepare($sql); $statement->execute(); if ($statement->fetchSingleColumn()) { diff --git a/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php b/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php index 2e10bcef9b..78282d5105 100644 --- a/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php @@ -264,18 +264,18 @@ class LabelGroupAddForm extends AbstractForm // remove old relations if ($groupID !== null) { - $sql = "DELETE FROM wcf" . WCF_N . "_label_group_to_object + $sql = "DELETE FROM wcf1_label_group_to_object WHERE groupID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$groupID]); } // insert new relations if (!empty($this->objectTypes)) { - $sql = "INSERT INTO wcf" . WCF_N . "_label_group_to_object + $sql = "INSERT INTO wcf1_label_group_to_object (groupID, objectTypeID, objectID) VALUES (?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($this->objectTypes as $objectTypeID => $data) { foreach ($data as $objectID) { diff --git a/wcfsetup/install/files/lib/acp/form/LabelGroupEditForm.class.php b/wcfsetup/install/files/lib/acp/form/LabelGroupEditForm.class.php index 821a8dcfe3..175d5a4781 100644 --- a/wcfsetup/install/files/lib/acp/form/LabelGroupEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/LabelGroupEditForm.class.php @@ -145,9 +145,9 @@ class LabelGroupEditForm extends LabelGroupAddForm if (empty($_POST)) { // read database values $sql = "SELECT objectTypeID, objectID - FROM wcf" . WCF_N . "_label_group_to_object + FROM wcf1_label_group_to_object WHERE groupID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->groupID]); $data = []; diff --git a/wcfsetup/install/files/lib/acp/form/MenuAddForm.class.php b/wcfsetup/install/files/lib/acp/form/MenuAddForm.class.php index d8dfcd747e..51c369c075 100644 --- a/wcfsetup/install/files/lib/acp/form/MenuAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/MenuAddForm.class.php @@ -156,9 +156,9 @@ class MenuAddForm extends AbstractForm $conditionBuilder = new PreparedStatementConditionBuilder(); $conditionBuilder->add('pageID IN (?)', [$this->pageIDs]); $sql = "SELECT pageID - FROM wcf" . WCF_N . "_page + FROM wcf1_page " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); $this->pageIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); } diff --git a/wcfsetup/install/files/lib/acp/form/NoticeEditForm.class.php b/wcfsetup/install/files/lib/acp/form/NoticeEditForm.class.php index ec99b99d16..e313b8eab2 100644 --- a/wcfsetup/install/files/lib/acp/form/NoticeEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/NoticeEditForm.class.php @@ -183,9 +183,9 @@ class NoticeEditForm extends NoticeAddForm ); if ($this->resetIsDismissed) { - $sql = "DELETE FROM wcf" . WCF_N . "_notice_dismissed + $sql = "DELETE FROM wcf1_notice_dismissed WHERE noticeID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $this->notice->noticeID, ]); diff --git a/wcfsetup/install/files/lib/acp/form/NotificationPresetSettingsForm.class.php b/wcfsetup/install/files/lib/acp/form/NotificationPresetSettingsForm.class.php index b55dc2c74b..76afa72d43 100644 --- a/wcfsetup/install/files/lib/acp/form/NotificationPresetSettingsForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/NotificationPresetSettingsForm.class.php @@ -207,16 +207,16 @@ class NotificationPresetSettingsForm extends AbstractForm if ($this->applyChangesToExistingUsers) { if (!$preset) { - $sql = "DELETE FROM wcf" . WCF_N . "_user_notification_event_to_user + $sql = "DELETE FROM wcf1_user_notification_event_to_user WHERE eventID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$event->eventID]); } else { - $sql = "REPLACE INTO wcf" . WCF_N . "_user_notification_event_to_user + $sql = "REPLACE INTO wcf1_user_notification_event_to_user (userID, eventID, mailNotificationType) SELECT userID, ?, ? - FROM wcf" . WCF_N . "_user"; - $statement = WCF::getDB()->prepareStatement($sql); + FROM wcf1_user"; + $statement = WCF::getDB()->prepare($sql); $statement->execute([$event->eventID, $presetMailNotificationType]); } } diff --git a/wcfsetup/install/files/lib/acp/form/PageAddForm.class.php b/wcfsetup/install/files/lib/acp/form/PageAddForm.class.php index 8b7e8050a6..4689936b00 100644 --- a/wcfsetup/install/files/lib/acp/form/PageAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/PageAddForm.class.php @@ -674,9 +674,9 @@ class PageAddForm extends AbstractForm } $sql = "SELECT MAX(showOrder) - FROM wcf" . WCF_N . "_menu_item + FROM wcf1_menu_item " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); $maxShowOrder = $statement->fetchSingleColumn() ?? 0; diff --git a/wcfsetup/install/files/lib/acp/form/SmileyAddForm.class.php b/wcfsetup/install/files/lib/acp/form/SmileyAddForm.class.php index 53fc4c47be..45328828c9 100644 --- a/wcfsetup/install/files/lib/acp/form/SmileyAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/SmileyAddForm.class.php @@ -364,9 +364,9 @@ class SmileyAddForm extends AbstractForm $conditionBuilder->add('smileyID <> ?', [$this->smiley->smileyID]); } $sql = "SELECT smileyCode, aliases - FROM wcf" . WCF_N . "_smiley + FROM wcf1_smiley " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); $aliases = \explode("\n", $this->aliases); diff --git a/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php b/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php index 9d8b370e2e..132e8c31d4 100644 --- a/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php @@ -634,8 +634,8 @@ class StyleAddForm extends AbstractForm // get available variables $sql = "SELECT variableName - FROM wcf" . WCF_N . "_style_variable"; - $statement = WCF::getDB()->prepareStatement($sql); + FROM wcf1_style_variable"; + $statement = WCF::getDB()->prepare($sql); $statement->execute(); $variables = $statement->fetchAll(\PDO::FETCH_COLUMN); @@ -822,8 +822,8 @@ class StyleAddForm extends AbstractForm protected function readStyleVariables() { $sql = "SELECT variableName, defaultValue - FROM wcf" . WCF_N . "_style_variable"; - $statement = WCF::getDB()->prepareStatement($sql); + FROM wcf1_style_variable"; + $statement = WCF::getDB()->prepare($sql); $statement->execute(); $this->variables = $statement->fetchMap('variableName', 'defaultValue'); } diff --git a/wcfsetup/install/files/lib/acp/form/TagEditForm.class.php b/wcfsetup/install/files/lib/acp/form/TagEditForm.class.php index 3455201090..754a8f5af1 100644 --- a/wcfsetup/install/files/lib/acp/form/TagEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/TagEditForm.class.php @@ -74,10 +74,10 @@ class TagEditForm extends TagAddForm if ($this->tagObj->synonymFor === null) { // remove synonyms first - $sql = "UPDATE wcf" . WCF_N . "_tag + $sql = "UPDATE wcf1_tag SET synonymFor = ? WHERE synonymFor = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ null, $this->tagID, diff --git a/wcfsetup/install/files/lib/acp/form/TemplateAddForm.class.php b/wcfsetup/install/files/lib/acp/form/TemplateAddForm.class.php index a66f3aeb0c..b6bb3fa9ed 100644 --- a/wcfsetup/install/files/lib/acp/form/TemplateAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/TemplateAddForm.class.php @@ -152,9 +152,9 @@ class TemplateAddForm extends AbstractFormBuilderForm } $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_template + FROM wcf1_template " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); if ($statement->fetchSingleColumn()) { @@ -219,10 +219,10 @@ class TemplateAddForm extends AbstractFormBuilderForm $parameters['data']['application'] = $this->copiedTemplate->application; } else { $sql = "SELECT packageID - FROM wcf" . WCF_N . "_template + FROM wcf1_template WHERE templateName = ? AND templateGroupID IS NULL"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $parameters['data']['templateName'] ]); diff --git a/wcfsetup/install/files/lib/acp/form/TemplateGroupAddForm.class.php b/wcfsetup/install/files/lib/acp/form/TemplateGroupAddForm.class.php index 2a7647e6e4..fc829f55b6 100644 --- a/wcfsetup/install/files/lib/acp/form/TemplateGroupAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/TemplateGroupAddForm.class.php @@ -100,9 +100,9 @@ class TemplateGroupAddForm extends AbstractForm } $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_template_group + FROM wcf1_template_group WHERE templateGroupName = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->templateGroupName]); if ($statement->fetchSingleColumn()) { @@ -124,9 +124,9 @@ class TemplateGroupAddForm extends AbstractForm } $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_template_group + FROM wcf1_template_group WHERE templateGroupFolderName = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->templateGroupFolderName]); if ($statement->fetchSingleColumn()) { diff --git a/wcfsetup/install/files/lib/acp/form/TrophyEditForm.class.php b/wcfsetup/install/files/lib/acp/form/TrophyEditForm.class.php index c5be4d0bfa..475fa62f65 100644 --- a/wcfsetup/install/files/lib/acp/form/TrophyEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/TrophyEditForm.class.php @@ -209,9 +209,9 @@ class TrophyEditForm extends TrophyAddForm // reset special trophies, if trophy is disabled if ($this->isDisabled) { - $sql = "DELETE FROM wcf" . WCF_N . "_user_special_trophy + $sql = "DELETE FROM wcf1_user_special_trophy WHERE trophyID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->trophyID]); UserStorageHandler::getInstance()->resetAll('specialTrophies'); @@ -222,10 +222,10 @@ class TrophyEditForm extends TrophyAddForm $conditionBuilder = new PreparedStatementConditionBuilder(); $conditionBuilder->add('trophyID = ?', [$this->trophyID]); $sql = "SELECT COUNT(*) as count, userID - FROM wcf" . WCF_N . "_user_trophy + FROM wcf1_user_trophy " . $conditionBuilder . " GROUP BY userID"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); while ($row = $statement->fetchArray()) { diff --git a/wcfsetup/install/files/lib/acp/form/UserAddForm.class.php b/wcfsetup/install/files/lib/acp/form/UserAddForm.class.php index fd1094c61f..afce997d97 100644 --- a/wcfsetup/install/files/lib/acp/form/UserAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserAddForm.class.php @@ -226,9 +226,9 @@ class UserAddForm extends UserOptionListForm $conditions->add("groupType NOT IN (?)", [[UserGroup::GUESTS, UserGroup::EVERYONE, UserGroup::USERS]]); $sql = "SELECT groupID - FROM wcf" . WCF_N . "_user_group + FROM wcf1_user_group " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $this->groupIDs = []; while ($row = $statement->fetchArray()) { diff --git a/wcfsetup/install/files/lib/acp/form/UserAssignToGroupForm.class.php b/wcfsetup/install/files/lib/acp/form/UserAssignToGroupForm.class.php index 50ce3a5160..0267fbcfb3 100755 --- a/wcfsetup/install/files/lib/acp/form/UserAssignToGroupForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserAssignToGroupForm.class.php @@ -133,9 +133,9 @@ class UserAssignToGroupForm extends AbstractForm $conditions->add("userID IN (?)", [$this->userIDs]); $sql = "SELECT userID, groupID - FROM wcf" . WCF_N . "_user_to_group + FROM wcf1_user_to_group " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $groups = $statement->fetchMap('userID', 'groupID', false); diff --git a/wcfsetup/install/files/lib/acp/form/UserEditForm.class.php b/wcfsetup/install/files/lib/acp/form/UserEditForm.class.php index 052a05cd94..c2aca3f0f0 100755 --- a/wcfsetup/install/files/lib/acp/form/UserEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserEditForm.class.php @@ -527,9 +527,9 @@ class UserEditForm extends UserAddForm } // remove assignments - $sql = "DELETE FROM wcf" . WCF_N . "_moderation_queue_to_user + $sql = "DELETE FROM wcf1_moderation_queue_to_user WHERE userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->user->userID]); // reset moderation count diff --git a/wcfsetup/install/files/lib/acp/form/UserEmailAddressExportForm.class.php b/wcfsetup/install/files/lib/acp/form/UserEmailAddressExportForm.class.php index 385d778957..447e6133a4 100755 --- a/wcfsetup/install/files/lib/acp/form/UserEmailAddressExportForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserEmailAddressExportForm.class.php @@ -128,18 +128,18 @@ class UserEmailAddressExportForm extends AbstractForm // count users $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_user + FROM wcf1_user " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $count = $statement->fetchSingleColumn(); // get users $sql = "SELECT email - FROM wcf" . WCF_N . "_user + FROM wcf1_user " . $conditions . " ORDER BY email"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $i = 0; diff --git a/wcfsetup/install/files/lib/acp/form/UserGroupOptionForm.class.php b/wcfsetup/install/files/lib/acp/form/UserGroupOptionForm.class.php index 00133482c2..36fa730765 100644 --- a/wcfsetup/install/files/lib/acp/form/UserGroupOptionForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserGroupOptionForm.class.php @@ -230,9 +230,9 @@ class UserGroupOptionForm extends AbstractForm $conditions->add("optionID = ?", [$this->userGroupOption->optionID]); $sql = "SELECT groupID, optionValue - FROM wcf" . WCF_N . "_user_group_option_value + FROM wcf1_user_group_option_value " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $this->values = $statement->fetchMap('groupID', 'optionValue'); } diff --git a/wcfsetup/install/files/lib/acp/form/UserMergeForm.class.php b/wcfsetup/install/files/lib/acp/form/UserMergeForm.class.php index 2dcf3dc0ae..00124ae78d 100644 --- a/wcfsetup/install/files/lib/acp/form/UserMergeForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserMergeForm.class.php @@ -125,28 +125,28 @@ class UserMergeForm extends AbstractForm // poll_option_vote $conditions = new PreparedStatementConditionBuilder(); $conditions->add("userID IN (?)", [$this->mergedUserIDs]); - $sql = "UPDATE IGNORE wcf" . WCF_N . "_poll_option_vote + $sql = "UPDATE IGNORE wcf1_poll_option_vote SET userID = ? " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(\array_merge([$this->destinationUserID], $conditions->getParameters())); // comment $conditions = new PreparedStatementConditionBuilder(); $conditions->add("userID IN (?)", [$this->mergedUserIDs]); - $sql = "UPDATE wcf" . WCF_N . "_comment + $sql = "UPDATE wcf1_comment SET userID = ? " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(\array_merge([$this->destinationUserID], $conditions->getParameters())); // comment_response $conditions = new PreparedStatementConditionBuilder(); $conditions->add("userID IN (?)", [$this->mergedUserIDs]); - $sql = "UPDATE wcf" . WCF_N . "_comment_response + $sql = "UPDATE wcf1_comment_response SET userID = ? " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(\array_merge([$this->destinationUserID], $conditions->getParameters())); // profile comments @@ -157,119 +157,119 @@ class UserMergeForm extends AbstractForm $conditions = new PreparedStatementConditionBuilder(); $conditions->add("objectTypeID = ?", [$objectType->objectTypeID]); $conditions->add("objectID IN (?)", [$this->mergedUserIDs]); - $sql = "UPDATE wcf" . WCF_N . "_comment + $sql = "UPDATE wcf1_comment SET objectID = ? " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(\array_merge([$this->destinationUserID], $conditions->getParameters())); // like (userID) $conditions = new PreparedStatementConditionBuilder(); $conditions->add("userID IN (?)", [$this->mergedUserIDs]); - $sql = "UPDATE IGNORE wcf" . WCF_N . "_like + $sql = "UPDATE IGNORE wcf1_like SET userID = ? " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(\array_merge([$this->destinationUserID], $conditions->getParameters())); // like (objectUserID) $conditions = new PreparedStatementConditionBuilder(); $conditions->add("objectUserID IN (?)", [$this->mergedUserIDs]); - $sql = "UPDATE wcf" . WCF_N . "_like + $sql = "UPDATE wcf1_like SET objectUserID = ? " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(\array_merge([$this->destinationUserID], $conditions->getParameters())); // like_object $conditions = new PreparedStatementConditionBuilder(); $conditions->add("objectUserID IN (?)", [$this->mergedUserIDs]); - $sql = "UPDATE wcf" . WCF_N . "_like_object + $sql = "UPDATE wcf1_like_object SET objectUserID = ? " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(\array_merge([$this->destinationUserID], $conditions->getParameters())); // user_follow (userID) $conditions = new PreparedStatementConditionBuilder(); $conditions->add("userID IN (?)", [$this->mergedUserIDs]); $conditions->add("followUserID <> ?", [$this->destinationUserID]); - $sql = "UPDATE IGNORE wcf" . WCF_N . "_user_follow + $sql = "UPDATE IGNORE wcf1_user_follow SET userID = ? " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(\array_merge([$this->destinationUserID], $conditions->getParameters())); // user_follow (followUserID) $conditions = new PreparedStatementConditionBuilder(); $conditions->add("followUserID IN (?)", [$this->mergedUserIDs]); $conditions->add("userID <> ?", [$this->destinationUserID]); - $sql = "UPDATE IGNORE wcf" . WCF_N . "_user_follow + $sql = "UPDATE IGNORE wcf1_user_follow SET followUserID = ? " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(\array_merge([$this->destinationUserID], $conditions->getParameters())); // user_ignore (userID) $conditions = new PreparedStatementConditionBuilder(); $conditions->add("userID IN (?)", [$this->mergedUserIDs]); $conditions->add("ignoreUserID <> ?", [$this->destinationUserID]); - $sql = "UPDATE IGNORE wcf" . WCF_N . "_user_ignore + $sql = "UPDATE IGNORE wcf1_user_ignore SET userID = ? " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(\array_merge([$this->destinationUserID], $conditions->getParameters())); // user_ignore (ignoreUserID) $conditions = new PreparedStatementConditionBuilder(); $conditions->add("ignoreUserID IN (?)", [$this->mergedUserIDs]); $conditions->add("userID <> ?", [$this->destinationUserID]); - $sql = "UPDATE IGNORE wcf" . WCF_N . "_user_ignore + $sql = "UPDATE IGNORE wcf1_user_ignore SET ignoreUserID = ? " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(\array_merge([$this->destinationUserID], $conditions->getParameters())); // user_object_watch $conditions = new PreparedStatementConditionBuilder(); $conditions->add("userID IN (?)", [$this->mergedUserIDs]); - $sql = "UPDATE IGNORE wcf" . WCF_N . "_user_object_watch + $sql = "UPDATE IGNORE wcf1_user_object_watch SET userID = ? " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(\array_merge([$this->destinationUserID], $conditions->getParameters())); // user_activity_event $conditions = new PreparedStatementConditionBuilder(); $conditions->add("userID IN (?)", [$this->mergedUserIDs]); - $sql = "UPDATE wcf" . WCF_N . "_user_activity_event + $sql = "UPDATE wcf1_user_activity_event SET userID = ? " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(\array_merge([$this->destinationUserID], $conditions->getParameters())); // attachments $conditions = new PreparedStatementConditionBuilder(); $conditions->add("userID IN (?)", [$this->mergedUserIDs]); - $sql = "UPDATE wcf" . WCF_N . "_attachment + $sql = "UPDATE wcf1_attachment SET userID = ? " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(\array_merge([$this->destinationUserID], $conditions->getParameters())); // modification_log $conditions = new PreparedStatementConditionBuilder(); $conditions->add("userID IN (?)", [$this->mergedUserIDs]); - $sql = "UPDATE wcf" . WCF_N . "_modification_log + $sql = "UPDATE wcf1_modification_log SET userID = ? " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(\array_merge([$this->destinationUserID], $conditions->getParameters())); // user notifications $conditions = new PreparedStatementConditionBuilder(); $conditions->add("authorID IN (?)", [$this->mergedUserIDs]); - $sql = "UPDATE IGNORE wcf" . WCF_N . "_user_notification_author + $sql = "UPDATE IGNORE wcf1_user_notification_author SET authorID = ? " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(\array_merge([$this->destinationUserID], $conditions->getParameters())); // delete merged users diff --git a/wcfsetup/install/files/lib/acp/form/UserOptionAddForm.class.php b/wcfsetup/install/files/lib/acp/form/UserOptionAddForm.class.php index d7e0e42611..1a2f1c0e12 100644 --- a/wcfsetup/install/files/lib/acp/form/UserOptionAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserOptionAddForm.class.php @@ -306,9 +306,9 @@ class UserOptionAddForm extends AbstractForm throw new UserInputException('categoryName'); } $sql = "SELECT categoryID - FROM wcf" . WCF_N . "_user_option_category + FROM wcf1_user_option_category WHERE categoryName = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->categoryName]); if ($statement->fetchArray() === false) { throw new UserInputException('categoryName'); diff --git a/wcfsetup/install/files/lib/acp/form/UserOptionSetDefaultsForm.class.php b/wcfsetup/install/files/lib/acp/form/UserOptionSetDefaultsForm.class.php index caf81ff8e3..84ea66f8f8 100644 --- a/wcfsetup/install/files/lib/acp/form/UserOptionSetDefaultsForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserOptionSetDefaultsForm.class.php @@ -89,9 +89,9 @@ class UserOptionSetDefaultsForm extends AbstractForm // get changed options $sql = "SELECT optionID, defaultValue - FROM wcf" . WCF_N . "_user_option + FROM wcf1_user_option WHERE optionID IN (?" . \str_repeat(', ?', \count($optionIDs) - 1) . ")"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($optionIDs); $optionIDs = $optionValues = []; while ($row = $statement->fetchArray()) { @@ -102,18 +102,18 @@ class UserOptionSetDefaultsForm extends AbstractForm } if (!empty($optionIDs)) { - $sql = "UPDATE wcf" . WCF_N . "_user_option_value + $sql = "UPDATE wcf1_user_option_value SET userOption" . \implode(' = ?, userOption', $optionIDs) . " = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(\array_merge($optionValues)); } } // save values - $sql = "UPDATE wcf" . WCF_N . "_user_option + $sql = "UPDATE wcf1_user_option SET defaultValue = ? WHERE optionID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($saveOptions as $optionID => $value) { $statement->execute([$value, $optionID]); } diff --git a/wcfsetup/install/files/lib/acp/form/UserSearchForm.class.php b/wcfsetup/install/files/lib/acp/form/UserSearchForm.class.php index 9e3dc40bfd..d639b8b96a 100755 --- a/wcfsetup/install/files/lib/acp/form/UserSearchForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserSearchForm.class.php @@ -288,7 +288,7 @@ class UserSearchForm extends UserOptionListForm { $this->userList = new UserList(); $this->userList->sqlConditionJoins .= " - LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value + LEFT JOIN wcf1_user_option_value user_option_value ON user_option_value.userID = user_table.userID"; $this->userList->sqlLimit = $this->maxResults; diff --git a/wcfsetup/install/files/lib/acp/page/ArticleListPage.class.php b/wcfsetup/install/files/lib/acp/page/ArticleListPage.class.php index 4820570080..9dfc855b2d 100644 --- a/wcfsetup/install/files/lib/acp/page/ArticleListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/ArticleListPage.class.php @@ -161,7 +161,7 @@ class ArticleListPage extends SortablePage $this->objectList->getConditionBuilder()->add( 'article.articleID IN ( SELECT articleID - FROM wcf' . WCF_N . '_article_content + FROM wcf1_article_content WHERE title LIKE ? )', ['%' . $this->title . '%'] @@ -171,7 +171,7 @@ class ArticleListPage extends SortablePage $this->objectList->getConditionBuilder()->add( 'article.articleID IN ( SELECT articleID - FROM wcf' . WCF_N . '_article_content + FROM wcf1_article_content WHERE content LIKE ? )', ['%' . $this->content . '%'] @@ -180,7 +180,7 @@ class ArticleListPage extends SortablePage $this->objectList->sqlSelects = "( SELECT title - FROM wcf" . WCF_N . "_article_content + FROM wcf1_article_content WHERE articleID = article.articleID AND ( languageID IS NULL diff --git a/wcfsetup/install/files/lib/acp/page/BoxListPage.class.php b/wcfsetup/install/files/lib/acp/page/BoxListPage.class.php index f828e87bad..638257dac5 100644 --- a/wcfsetup/install/files/lib/acp/page/BoxListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/BoxListPage.class.php @@ -140,7 +140,7 @@ class BoxListPage extends SortablePage $this->objectList->getConditionBuilder()->add( 'box.boxID IN ( SELECT boxID - FROM wcf' . WCF_N . '_box_content + FROM wcf1_box_content WHERE title LIKE ? )', ['%' . $this->title . '%'] @@ -150,7 +150,7 @@ class BoxListPage extends SortablePage $this->objectList->getConditionBuilder()->add( 'box.boxID IN ( SELECT boxID - FROM wcf' . WCF_N . '_box_content + FROM wcf1_box_content WHERE content LIKE ? )', ['%' . $this->content . '%'] diff --git a/wcfsetup/install/files/lib/acp/page/CronjobLogListPage.class.php b/wcfsetup/install/files/lib/acp/page/CronjobLogListPage.class.php index c3d6f0f92e..2c7bc8b99c 100755 --- a/wcfsetup/install/files/lib/acp/page/CronjobLogListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/CronjobLogListPage.class.php @@ -93,7 +93,7 @@ class CronjobLogListPage extends SortablePage $this->objectList->sqlSelects = "cronjob.*"; $this->objectList->sqlJoins = " - LEFT JOIN wcf" . WCF_N . "_cronjob cronjob + LEFT JOIN wcf1_cronjob cronjob ON cronjob.cronjobID = cronjob_log.cronjobID"; if ($this->cronjobID) { diff --git a/wcfsetup/install/files/lib/acp/page/LabelGroupListPage.class.php b/wcfsetup/install/files/lib/acp/page/LabelGroupListPage.class.php index ac224caf61..b375e1f684 100644 --- a/wcfsetup/install/files/lib/acp/page/LabelGroupListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/LabelGroupListPage.class.php @@ -102,7 +102,7 @@ class LabelGroupListPage extends SortablePage $this->objectList->sqlSelects .= '( SELECT COUNT(*) - FROM wcf' . WCF_N . '_label + FROM wcf1_label WHERE groupID = label_group.groupID ) AS labels'; diff --git a/wcfsetup/install/files/lib/acp/page/LabelListPage.class.php b/wcfsetup/install/files/lib/acp/page/LabelListPage.class.php index 84d30e0c5e..57870b0608 100644 --- a/wcfsetup/install/files/lib/acp/page/LabelListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/LabelListPage.class.php @@ -110,7 +110,7 @@ class LabelListPage extends SortablePage $this->objectList->sqlSelects = "label_group.groupName, label_group.groupDescription"; $this->objectList->sqlJoins = " - LEFT JOIN wcf" . WCF_N . "_label_group label_group + LEFT JOIN wcf1_label_group label_group ON label_group.groupID = label.groupID"; if ($this->labelGroup) { $this->objectList->getConditionBuilder()->add('label.groupID = ?', [$this->labelGroup->groupID]); diff --git a/wcfsetup/install/files/lib/acp/page/LanguageListPage.class.php b/wcfsetup/install/files/lib/acp/page/LanguageListPage.class.php index e67500e399..53f1f72fca 100644 --- a/wcfsetup/install/files/lib/acp/page/LanguageListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/LanguageListPage.class.php @@ -51,15 +51,15 @@ class LanguageListPage extends SortablePage $this->objectList->sqlSelects = "( SELECT COUNT(*) - FROM wcf" . WCF_N . "_user user + FROM wcf1_user user WHERE languageID = language.languageID ) AS users, ( SELECT COUNT(*) - FROM wcf" . WCF_N . "_language_item + FROM wcf1_language_item WHERE languageID = language.languageID ) AS variables, ( SELECT COUNT(*) - FROM wcf" . WCF_N . "_language_item + FROM wcf1_language_item WHERE languageID = language.languageID AND languageCustomItemValue IS NOT NULL ) AS customVariables"; diff --git a/wcfsetup/install/files/lib/acp/page/LicensePage.class.php b/wcfsetup/install/files/lib/acp/page/LicensePage.class.php index 40b9fddfb7..fd2f754cf5 100644 --- a/wcfsetup/install/files/lib/acp/page/LicensePage.class.php +++ b/wcfsetup/install/files/lib/acp/page/LicensePage.class.php @@ -252,16 +252,16 @@ final class LicensePage extends AbstractPage // get installed packages $sql = "SELECT package, packageVersion - FROM wcf" . WCF_N . "_package"; - $statement = WCF::getDB()->prepareStatement($sql); + FROM wcf1_package"; + $statement = WCF::getDB()->prepare($sql); $statement->execute(); $installedPackages = $statement->fetchMap('package', 'packageVersion'); // get excluded packages (of installed packages) $excludedPackagesOfInstalledPackages = []; $sql = "SELECT excludedPackage, excludedPackageVersion - FROM wcf" . WCF_N . "_package_exclusion"; - $statement = WCF::getDB()->prepareStatement($sql); + FROM wcf1_package_exclusion"; + $statement = WCF::getDB()->prepare($sql); $statement->execute(); while ($row = $statement->fetchArray()) { if (!isset($excludedPackagesOfInstalledPackages[$row['excludedPackage']])) { @@ -300,9 +300,9 @@ final class LicensePage extends AbstractPage $conditions = new PreparedStatementConditionBuilder(); $conditions->add("packageUpdateID IN (?)", [\array_keys($packageUpdates)]); $sql = "SELECT packageUpdateID, packageUpdateServerID, package - FROM wcf" . WCF_N . "_package_update + FROM wcf1_package_update " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $possiblePackages = []; while ($row = $statement->fetchArray()) { @@ -349,9 +349,9 @@ final class LicensePage extends AbstractPage $conditions->add("packageUpdateVersionID IN (?)", [$packageUpdateVersionIDs]); $sql = "SELECT packageUpdateVersionID, packageUpdateID, packageVersion - FROM wcf" . WCF_N . "_package_update_version + FROM wcf1_package_update_version " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $packageVersions = []; while ($row = $statement->fetchArray()) { @@ -429,15 +429,15 @@ final class LicensePage extends AbstractPage $conditions->add( "packageUpdateVersionID IN ( SELECT packageUpdateVersionID - FROM wcf" . WCF_N . "_package_update_version + FROM wcf1_package_update_version WHERE packageUpdateID = ? )", [$packageUpdateID] ); $sql = "SELECT * - FROM wcf" . WCF_N . "_package_update_exclusion + FROM wcf1_package_update_exclusion " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $excludedPackages = []; while ($row = $statement->fetchArray()) { @@ -469,11 +469,11 @@ final class LicensePage extends AbstractPage ); $sql = "SELECT pu.package, pu.packageUpdateServerID, puv.packageUpdateVersionID, puv.packageUpdateID, puv.packageVersion, puv.isAccessible - FROM wcf" . WCF_N . "_package_update_version puv - LEFT JOIN wcf" . WCF_N . "_package_update pu + FROM wcf1_package_update_version puv + LEFT JOIN wcf1_package_update pu ON pu.packageUpdateID = puv.packageUpdateID " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $packageVersions = []; while ($row = $statement->fetchArray()) { @@ -588,9 +588,9 @@ final class LicensePage extends AbstractPage // validate dependencies foreach ($packageUpdates as $packageUpdateData) { $sql = "SELECT package, minversion - FROM wcf" . WCF_N . "_package_update_requirement + FROM wcf1_package_update_requirement WHERE packageUpdateVersionID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$packageUpdateData['accessible']]); $requirements = []; while ($row = $statement->fetchArray()) { @@ -616,9 +616,9 @@ final class LicensePage extends AbstractPage $conditions = new PreparedStatementConditionBuilder(); $conditions->add("package IN (?)", [\array_keys($requirements)]); $sql = "SELECT packageUpdateID, package - FROM wcf" . WCF_N . "_package_update + FROM wcf1_package_update " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); while ($row = $statement->fetchArray()) { if (!\in_array($row['package'], $openRequirements)) { diff --git a/wcfsetup/install/files/lib/acp/page/MenuListPage.class.php b/wcfsetup/install/files/lib/acp/page/MenuListPage.class.php index 9e4981e37d..22788ccbcc 100644 --- a/wcfsetup/install/files/lib/acp/page/MenuListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/MenuListPage.class.php @@ -56,15 +56,15 @@ class MenuListPage extends SortablePage $this->objectList->sqlSelects .= '( SELECT COUNT(*) - FROM wcf' . WCF_N . '_menu_item + FROM wcf1_menu_item WHERE menuID = menu.menuID ) AS items, ( SELECT position - FROM wcf' . WCF_N . '_box + FROM wcf1_box WHERE menuID = menu.menuID ) AS position, ( SELECT showOrder - FROM wcf' . WCF_N . '_box + FROM wcf1_box WHERE menuID = menu.menuID ) AS showOrder'; } diff --git a/wcfsetup/install/files/lib/acp/page/PackagePage.class.php b/wcfsetup/install/files/lib/acp/page/PackagePage.class.php index c9533edf6f..6b4aa753c4 100755 --- a/wcfsetup/install/files/lib/acp/page/PackagePage.class.php +++ b/wcfsetup/install/files/lib/acp/page/PackagePage.class.php @@ -76,10 +76,10 @@ class PackagePage extends AbstractPage parent::readData(); $sql = "SELECT pluginStoreFileID - FROM wcf" . WCF_N . "_package_update + FROM wcf1_package_update WHERE package = ? AND pluginStoreFileID <> 0"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->package->package]); $this->pluginStoreFileID = \intval($statement->fetchSingleColumn()); } diff --git a/wcfsetup/install/files/lib/acp/page/PageListPage.class.php b/wcfsetup/install/files/lib/acp/page/PageListPage.class.php index 8e37066073..2592e388a0 100644 --- a/wcfsetup/install/files/lib/acp/page/PageListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/PageListPage.class.php @@ -158,7 +158,7 @@ class PageListPage extends SortablePage $this->objectList->getConditionBuilder()->add( 'page.pageID IN ( SELECT pageID - FROM wcf' . WCF_N . '_page_content + FROM wcf1_page_content WHERE title LIKE ? )', ['%' . $this->title . '%'] @@ -168,7 +168,7 @@ class PageListPage extends SortablePage $this->objectList->getConditionBuilder()->add( 'page.pageID IN ( SELECT pageID - FROM wcf' . WCF_N . '_page_content + FROM wcf1_page_content WHERE content LIKE ? )', ['%' . $this->content . '%'] diff --git a/wcfsetup/install/files/lib/acp/page/PaidSubscriptionTransactionLogListPage.class.php b/wcfsetup/install/files/lib/acp/page/PaidSubscriptionTransactionLogListPage.class.php index 3c906af190..42d23937cb 100644 --- a/wcfsetup/install/files/lib/acp/page/PaidSubscriptionTransactionLogListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/PaidSubscriptionTransactionLogListPage.class.php @@ -116,7 +116,7 @@ class PaidSubscriptionTransactionLogListPage extends SortablePage $this->objectList->getConditionBuilder()->add( 'paid_subscription_transaction_log.userID IN ( SELECT userID - FROM wcf' . WCF_N . '_user + FROM wcf1_user WHERE username LIKE ? )', ['%' . $this->username . '%'] @@ -131,9 +131,9 @@ class PaidSubscriptionTransactionLogListPage extends SortablePage $this->objectList->sqlSelects = 'user_table.username, paid_subscription.title'; $this->objectList->sqlJoins = " - LEFT JOIN wcf" . WCF_N . "_user user_table + LEFT JOIN wcf1_user user_table ON user_table.userID = paid_subscription_transaction_log.userID - LEFT JOIN wcf" . WCF_N . "_paid_subscription paid_subscription + LEFT JOIN wcf1_paid_subscription paid_subscription ON paid_subscription.subscriptionID = paid_subscription_transaction_log.subscriptionID"; } diff --git a/wcfsetup/install/files/lib/acp/page/PaidSubscriptionUserListPage.class.php b/wcfsetup/install/files/lib/acp/page/PaidSubscriptionUserListPage.class.php index ad67074eac..de8221478b 100644 --- a/wcfsetup/install/files/lib/acp/page/PaidSubscriptionUserListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/PaidSubscriptionUserListPage.class.php @@ -87,7 +87,7 @@ class PaidSubscriptionUserListPage extends SortablePage $this->objectList->getConditionBuilder()->add( 'paid_subscription_user.userID IN ( SELECT userID - FROM wcf' . WCF_N . '_user + FROM wcf1_user WHERE username LIKE ? )', ['%' . $this->username . '%'] @@ -103,9 +103,9 @@ class PaidSubscriptionUserListPage extends SortablePage $this->objectList->getConditionBuilder()->add('paid_subscription_user.isActive = ?', [1]); $this->objectList->sqlSelects = 'user_table.username, paid_subscription.title'; $this->objectList->sqlJoins = " - LEFT JOIN wcf" . WCF_N . "_user user_table + LEFT JOIN wcf1_user user_table ON user_table.userID = paid_subscription_user.userID - LEFT JOIN wcf" . WCF_N . "_paid_subscription paid_subscription + LEFT JOIN wcf1_paid_subscription paid_subscription ON paid_subscription.subscriptionID = paid_subscription_user.subscriptionID"; } diff --git a/wcfsetup/install/files/lib/acp/page/StyleListPage.class.php b/wcfsetup/install/files/lib/acp/page/StyleListPage.class.php index 3170b52b44..a59ba74de6 100644 --- a/wcfsetup/install/files/lib/acp/page/StyleListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/StyleListPage.class.php @@ -50,7 +50,7 @@ class StyleListPage extends MultipleLinkPage $this->objectList->sqlSelects = "( SELECT COUNT(*) - FROM wcf" . WCF_N . "_user + FROM wcf1_user WHERE styleID = style.styleID ) AS users"; } diff --git a/wcfsetup/install/files/lib/acp/page/SystemCheckPage.class.php b/wcfsetup/install/files/lib/acp/page/SystemCheckPage.class.php index 450f2b8e0e..c3fc12f02f 100644 --- a/wcfsetup/install/files/lib/acp/page/SystemCheckPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/SystemCheckPage.class.php @@ -85,33 +85,33 @@ class SystemCheckPage extends AbstractPage ]; public $foreignKeys = [ - 'wcf' . WCF_N . '_user' => [ + 'wcf1_user' => [ 'avatarID' => [ - 'referenceTable' => 'wcf' . WCF_N . '_user_avatar', + 'referenceTable' => 'wcf1_user_avatar', 'referenceColumn' => 'avatarID', ], ], - 'wcf' . WCF_N . '_comment' => [ + 'wcf1_comment' => [ 'userID' => [ - 'referenceTable' => 'wcf' . WCF_N . '_user', + 'referenceTable' => 'wcf1_user', 'referenceColumn' => 'userID', ], 'objectTypeID' => [ - 'referenceTable' => 'wcf' . WCF_N . '_object_type', + 'referenceTable' => 'wcf1_object_type', 'referenceColumn' => 'objectTypeID', ], ], - 'wcf' . WCF_N . '_moderation_queue' => [ + 'wcf1_moderation_queue' => [ 'objectTypeID' => [ - 'referenceTable' => 'wcf' . WCF_N . '_object_type', + 'referenceTable' => 'wcf1_object_type', 'referenceColumn' => 'objectTypeID', ], 'assignedUserID' => [ - 'referenceTable' => 'wcf' . WCF_N . '_user', + 'referenceTable' => 'wcf1_user', 'referenceColumn' => 'userID', ], 'userID' => [ - 'referenceTable' => 'wcf' . WCF_N . '_user', + 'referenceTable' => 'wcf1_user', 'referenceColumn' => 'userID', ], ], @@ -243,13 +243,13 @@ class SystemCheckPage extends AbstractPage // check for MySQL Native driver $sql = "SELECT 1"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(); $this->results['mysql']['mysqlnd'] = ($statement->fetchSingleColumn() === 1); // check innodb support $sql = "SHOW ENGINES"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(); while ($row = $statement->fetchArray()) { if ($row['Engine'] == 'InnoDB' && \in_array($row['Support'], ['DEFAULT', 'YES'])) { @@ -279,13 +279,13 @@ class SystemCheckPage extends AbstractPage $sql = "SELECT COUNT(*) FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); $this->results['mysql']['foreignKeys'] = $statement->fetchSingleColumn() == $expectedForeignKeyCount; $sql = "SELECT @@innodb_buffer_pool_size"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(); $this->results['mysql']['bufferPool']['value'] = $statement->fetchSingleColumn(); if ($this->results['mysql']['bufferPool']['value'] > 134217728) { diff --git a/wcfsetup/install/files/lib/acp/page/TagListPage.class.php b/wcfsetup/install/files/lib/acp/page/TagListPage.class.php index 96ee59c802..f594702d43 100644 --- a/wcfsetup/install/files/lib/acp/page/TagListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/TagListPage.class.php @@ -89,16 +89,16 @@ class TagListPage extends SortablePage $this->objectList->sqlSelects = "( SELECT COUNT(*) - FROM wcf" . WCF_N . "_tag_to_object t2o + FROM wcf1_tag_to_object t2o WHERE t2o.tagID = tag.tagID ) AS usageCount"; $this->objectList->sqlSelects .= ", language.languageName, language.languageCode"; $this->objectList->sqlSelects .= ", synonym.name AS synonymName"; $this->objectList->sqlJoins = " - LEFT JOIN wcf" . WCF_N . "_language language + LEFT JOIN wcf1_language language ON tag.languageID = language.languageID - LEFT JOIN wcf" . WCF_N . "_tag synonym + LEFT JOIN wcf1_tag synonym ON tag.synonymFor = synonym.tagID"; if ($this->search !== '') { diff --git a/wcfsetup/install/files/lib/acp/page/TemplateGroupListPage.class.php b/wcfsetup/install/files/lib/acp/page/TemplateGroupListPage.class.php index d9ba15773f..969f2180b4 100644 --- a/wcfsetup/install/files/lib/acp/page/TemplateGroupListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/TemplateGroupListPage.class.php @@ -57,12 +57,12 @@ class TemplateGroupListPage extends SortablePage $this->objectList->sqlSelects = " ( SELECT COUNT(*) - FROM wcf" . WCF_N . "_template + FROM wcf1_template WHERE templateGroupID = template_group.templateGroupID ) AS templates, ( SELECT COUNT(*) - FROM wcf" . WCF_N . "_style + FROM wcf1_style WHERE templateGroupID = template_group.templateGroupID ) AS styles"; } diff --git a/wcfsetup/install/files/lib/acp/page/UserGroupListPage.class.php b/wcfsetup/install/files/lib/acp/page/UserGroupListPage.class.php index 4bcb32e02d..3e4443c4ac 100755 --- a/wcfsetup/install/files/lib/acp/page/UserGroupListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/UserGroupListPage.class.php @@ -73,7 +73,7 @@ class UserGroupListPage extends SortablePage } $this->objectList->sqlSelects .= "( SELECT COUNT(*) - FROM wcf" . WCF_N . "_user_to_group + FROM wcf1_user_to_group WHERE groupID = user_group.groupID ) AS members"; } diff --git a/wcfsetup/install/files/lib/acp/page/UserListPage.class.php b/wcfsetup/install/files/lib/acp/page/UserListPage.class.php index da8ee25207..311b427838 100755 --- a/wcfsetup/install/files/lib/acp/page/UserListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/UserListPage.class.php @@ -242,9 +242,9 @@ class UserListPage extends SortablePage EventHandler::getInstance()->fireAction($this, 'countItems'); $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_user user_table + FROM wcf1_user user_table " . $this->conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($this->conditions->getParameters()); return $statement->fetchSingleColumn(); @@ -257,14 +257,14 @@ class UserListPage extends SortablePage { // get user ids $sql = "SELECT user_table.userID - FROM wcf" . WCF_N . "_user user_table + FROM wcf1_user user_table " . (isset($this->options[$this->sortField]) ? " - LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value + LEFT JOIN wcf1_user_option_value user_option_value ON user_option_value.userID = user_table.userID " : '') . " " . $this->conditions . " ORDER BY " . (($this->sortField != 'email' && isset($this->options[$this->sortField])) ? 'user_option_value.userOption' . $this->options[$this->sortField]->optionID : $this->sortField) . " " . $this->sortOrder; - $statement = WCF::getDB()->prepareStatement( + $statement = WCF::getDB()->prepare( $sql, $this->itemsPerPage, ($this->pageNo - 1) * $this->itemsPerPage @@ -279,21 +279,21 @@ class UserListPage extends SortablePage $conditions->add("user_table.userID IN (?)", [$userIDs]); $sql = "SELECT userID, groupID - FROM wcf" . WCF_N . "_user_to_group user_table + FROM wcf1_user_to_group user_table " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $userToGroups = $statement->fetchMap('userID', 'groupID', false); $sql = "SELECT user_avatar.*, option_value.*, user_table.* - FROM wcf" . WCF_N . "_user user_table - LEFT JOIN wcf" . WCF_N . "_user_option_value option_value + FROM wcf1_user user_table + LEFT JOIN wcf1_user_option_value option_value ON option_value.userID = user_table.userID - LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar + LEFT JOIN wcf1_user_avatar user_avatar ON user_avatar.avatarID = user_table.avatarID " . $conditions . " ORDER BY " . (($this->sortField != 'email' && isset($this->options[$this->sortField])) ? 'option_value.userOption' . $this->options[$this->sortField]->optionID : 'user_table.' . $this->sortField) . " " . $this->sortOrder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); while ($row = $statement->fetchArray()) { $groupIDs = ($userToGroups[$row['userID']] ?? []); @@ -365,11 +365,11 @@ class UserListPage extends SortablePage { // get user search from database $sql = "SELECT searchData - FROM wcf" . WCF_N . "_search + FROM wcf1_search WHERE searchID = ? AND userID = ? AND searchType = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $this->searchID, WCF::getUser()->userID, diff --git a/wcfsetup/install/files/lib/acp/page/UserOptionCategoryListPage.class.php b/wcfsetup/install/files/lib/acp/page/UserOptionCategoryListPage.class.php index 561211f950..2841acf31f 100644 --- a/wcfsetup/install/files/lib/acp/page/UserOptionCategoryListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/UserOptionCategoryListPage.class.php @@ -50,7 +50,7 @@ class UserOptionCategoryListPage extends SortablePage $this->objectList->sqlSelects = "( SELECT COUNT(*) - FROM wcf" . WCF_N . "_user_option + FROM wcf1_user_option WHERE categoryName = user_option_category.categoryName ) AS userOptions"; $this->objectList->getConditionBuilder()->add('user_option_category.parentCategoryName = ?', ['profile']); diff --git a/wcfsetup/install/files/lib/acp/page/UserOptionListPage.class.php b/wcfsetup/install/files/lib/acp/page/UserOptionListPage.class.php index 7f168bb752..929cd7b60d 100644 --- a/wcfsetup/install/files/lib/acp/page/UserOptionListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/UserOptionListPage.class.php @@ -51,7 +51,7 @@ class UserOptionListPage extends SortablePage $this->objectList->getConditionBuilder()->add( "option_table.categoryName IN ( SELECT categoryName - FROM wcf" . WCF_N . "_user_option_category + FROM wcf1_user_option_category WHERE parentCategoryName = ? )", ['profile'] diff --git a/wcfsetup/install/files/lib/acp/page/UserRankListPage.class.php b/wcfsetup/install/files/lib/acp/page/UserRankListPage.class.php index ddd3e9f893..366c4ff65a 100644 --- a/wcfsetup/install/files/lib/acp/page/UserRankListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/UserRankListPage.class.php @@ -55,7 +55,7 @@ class UserRankListPage extends SortablePage $this->objectList->sqlSelects .= (!empty($this->objectList->sqlSelects) ? ', ' : '') . 'user_group.groupName'; $this->objectList->sqlJoins .= ' - LEFT JOIN wcf' . WCF_N . '_user_group user_group + LEFT JOIN wcf1_user_group user_group ON user_group.groupID = user_rank.groupID'; } } diff --git a/wcfsetup/install/files/lib/acp/page/UserTrophyListPage.class.php b/wcfsetup/install/files/lib/acp/page/UserTrophyListPage.class.php index c0b88c50e5..00d6f30dac 100644 --- a/wcfsetup/install/files/lib/acp/page/UserTrophyListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/UserTrophyListPage.class.php @@ -99,7 +99,7 @@ class UserTrophyListPage extends SortablePage { parent::initObjectList(); - $this->objectList->sqlJoins .= ' LEFT JOIN wcf' . WCF_N . '_user users ON (users.userID = user_trophy.userID)'; + $this->objectList->sqlJoins .= ' LEFT JOIN wcf1_user users ON (users.userID = user_trophy.userID)'; if ($this->trophyID) { $this->objectList->getConditionBuilder()->add('user_trophy.trophyID = ?', [$this->trophyID]); } @@ -108,7 +108,7 @@ class UserTrophyListPage extends SortablePage $this->objectList->getConditionBuilder()->add( 'user_trophy.userID IN ( SELECT userID - FROM wcf' . WCF_N . '_user + FROM wcf1_user WHERE username LIKE ? )', ['%' . $this->username . '%'] diff --git a/wcfsetup/install/files/lib/data/AbstractDatabaseObjectAction.class.php b/wcfsetup/install/files/lib/data/AbstractDatabaseObjectAction.class.php index dc4639a666..5d48507e2c 100644 --- a/wcfsetup/install/files/lib/data/AbstractDatabaseObjectAction.class.php +++ b/wcfsetup/install/files/lib/data/AbstractDatabaseObjectAction.class.php @@ -415,7 +415,7 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction, ID $sql = "SELECT * FROM " . $tableName . " WHERE " . $indexName . " IN (" . \str_repeat('?,', \count($this->objectIDs) - 1) . "?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($this->objectIDs); while ($object = $statement->fetchObject($baseClass)) { $this->objects[] = new $this->className($object); diff --git a/wcfsetup/install/files/lib/data/DatabaseObject.class.php b/wcfsetup/install/files/lib/data/DatabaseObject.class.php index 1bb5e6cbea..b7d7c6e3ec 100644 --- a/wcfsetup/install/files/lib/data/DatabaseObject.class.php +++ b/wcfsetup/install/files/lib/data/DatabaseObject.class.php @@ -62,7 +62,7 @@ abstract class DatabaseObject implements IIDObject, IStorableObject $sql = "SELECT * FROM " . static::getDatabaseTableName() . " WHERE " . static::getDatabaseTableIndexName() . " = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$id]); $row = $statement->fetchArray(); @@ -135,20 +135,22 @@ abstract class DatabaseObject implements IIDObject, IStorableObject $classParts = \explode('\\', $className); if (static::$databaseTableName !== '') { - return $classParts[0] . WCF_N . '_' . static::$databaseTableName; + return $classParts[0] . '1_' . static::$databaseTableName; } static $databaseTableNames = []; if (!isset($databaseTableNames[$className])) { - $databaseTableNames[$className] = $classParts[0] . WCF_N . '_' . \strtolower(\implode( - '_', - \preg_split( - '~(?=[A-Z](?=[a-z]))~', - \array_pop($classParts), - -1, - \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY - ) - )); + $databaseTableNames[$className] = $classParts[0] . '1_' . \strtolower( + \implode( + '_', + \preg_split( + '~(?=[A-Z](?=[a-z]))~', + \array_pop($classParts), + -1, + \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY + ) + ) + ); } return $databaseTableNames[$className]; diff --git a/wcfsetup/install/files/lib/data/DatabaseObjectEditor.class.php b/wcfsetup/install/files/lib/data/DatabaseObjectEditor.class.php index 454551e4b0..f9d07b0472 100644 --- a/wcfsetup/install/files/lib/data/DatabaseObjectEditor.class.php +++ b/wcfsetup/install/files/lib/data/DatabaseObjectEditor.class.php @@ -50,7 +50,7 @@ abstract class DatabaseObjectEditor extends DatabaseObjectDecorator implements I $sql = "UPDATE " . static::getDatabaseTableName() . " SET " . $updateSQL . " WHERE " . static::getDatabaseTableIndexName() . " = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($statementParameters); } @@ -77,7 +77,7 @@ abstract class DatabaseObjectEditor extends DatabaseObjectDecorator implements I $sql = "UPDATE " . static::getDatabaseTableName() . " SET " . $updateSQL . " WHERE " . static::getDatabaseTableIndexName() . " = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($statementParameters); } @@ -108,7 +108,7 @@ abstract class DatabaseObjectEditor extends DatabaseObjectDecorator implements I $sql = "DELETE FROM " . static::getDatabaseTableName() . " " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); $affectedCount += $statement->getAffectedRows(); } diff --git a/wcfsetup/install/files/lib/data/DatabaseObjectList.class.php b/wcfsetup/install/files/lib/data/DatabaseObjectList.class.php index b5845e96ce..73181ac403 100644 --- a/wcfsetup/install/files/lib/data/DatabaseObjectList.class.php +++ b/wcfsetup/install/files/lib/data/DatabaseObjectList.class.php @@ -149,7 +149,7 @@ abstract class DatabaseObjectList implements \Countable, ITraversableObject FROM " . $this->getDatabaseTableName() . " " . $this->getDatabaseTableAlias() . " " . $this->sqlConditionJoins . " " . $this->getConditionBuilder(); - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($this->getConditionBuilder()->getParameters()); return $statement->fetchSingleColumn(); @@ -166,7 +166,7 @@ abstract class DatabaseObjectList implements \Countable, ITraversableObject " . $this->sqlConditionJoins . " " . $this->getConditionBuilder() . " " . (!empty($this->sqlOrderBy) ? "ORDER BY " . $this->sqlOrderBy : ''); - $statement = WCF::getDB()->prepareStatement($sql, $this->sqlLimit, $this->sqlOffset); + $statement = WCF::getDB()->prepare($sql, $this->sqlLimit, $this->sqlOffset); $statement->execute($this->getConditionBuilder()->getParameters()); $this->objectIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); } @@ -189,7 +189,7 @@ abstract class DatabaseObjectList implements \Countable, ITraversableObject " . $this->sqlJoins . " WHERE " . $this->getDatabaseTableAlias() . "." . $this->getDatabaseTableIndexName() . " IN ({$objectIdPlaceholder}) " . (!empty($this->sqlOrderBy) ? "ORDER BY " . $this->sqlOrderBy : ''); - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($this->objectIDs); $this->objects = $statement->fetchObjects(($this->objectClassName ?: $this->className)); } else { @@ -199,7 +199,7 @@ abstract class DatabaseObjectList implements \Countable, ITraversableObject " . $this->sqlJoins . " " . $this->getConditionBuilder() . " " . (!empty($this->sqlOrderBy) ? "ORDER BY " . $this->sqlOrderBy : ''); - $statement = WCF::getDB()->prepareStatement($sql, $this->sqlLimit, $this->sqlOffset); + $statement = WCF::getDB()->prepare($sql, $this->sqlLimit, $this->sqlOffset); $statement->execute($this->getConditionBuilder()->getParameters()); $this->objects = $statement->fetchObjects(($this->objectClassName ?: $this->className)); } diff --git a/wcfsetup/install/files/lib/data/I18nDatabaseObjectList.class.php b/wcfsetup/install/files/lib/data/I18nDatabaseObjectList.class.php index 27dbebd974..191c2955a9 100644 --- a/wcfsetup/install/files/lib/data/I18nDatabaseObjectList.class.php +++ b/wcfsetup/install/files/lib/data/I18nDatabaseObjectList.class.php @@ -54,7 +54,7 @@ abstract class I18nDatabaseObjectList extends DatabaseObjectList $this->sqlSelects .= (!empty($this->sqlSelects) ? ', ' : '') . "COALESCE(" . $matchTable . ".languageItemValue, " . $this->getDatabaseTableAlias() . "." . $key . ") AS " . $value; $this->sqlJoins .= " - LEFT JOIN wcf" . WCF_N . "_language_item " . $matchTable . " + LEFT JOIN wcf1_language_item " . $matchTable . " ON " . $matchTable . ".languageItem = " . $this->getDatabaseTableAlias() . "." . $key . " AND " . $matchTable . ".languageID = " . $languageID; } diff --git a/wcfsetup/install/files/lib/data/TFastCreate.class.php b/wcfsetup/install/files/lib/data/TFastCreate.class.php index 79421d029e..18e68d687c 100644 --- a/wcfsetup/install/files/lib/data/TFastCreate.class.php +++ b/wcfsetup/install/files/lib/data/TFastCreate.class.php @@ -39,7 +39,7 @@ trait TFastCreate $sql = "INSERT INTO " . static::getDatabaseTableName() . " (" . $keys . ") VALUES (" . $values . ")"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($statementParameters); // return new object diff --git a/wcfsetup/install/files/lib/data/TMultiCategoryObject.class.php b/wcfsetup/install/files/lib/data/TMultiCategoryObject.class.php index 924f89d25d..47937c1f4f 100644 --- a/wcfsetup/install/files/lib/data/TMultiCategoryObject.class.php +++ b/wcfsetup/install/files/lib/data/TMultiCategoryObject.class.php @@ -74,14 +74,14 @@ trait TMultiCategoryObject } } else { $sql = "SELECT categoryID - FROM wcf" . WCF_N . "_category + FROM wcf1_category WHERE categoryID IN ( SELECT categoryID FROM " . static::getCategoryMappingDatabaseTableName() . " WHERE " . static::getDatabaseTableIndexName() . " = ? ) ORDER BY parentCategoryID, showOrder"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->getObjectID()]); while ($categoryID = $statement->fetchColumn()) { /** @noinspection PhpUndefinedMethodInspection */ diff --git a/wcfsetup/install/files/lib/data/acp/session/ACPSession.class.php b/wcfsetup/install/files/lib/data/acp/session/ACPSession.class.php index 30743ba928..3437c9c847 100644 --- a/wcfsetup/install/files/lib/data/acp/session/ACPSession.class.php +++ b/wcfsetup/install/files/lib/data/acp/session/ACPSession.class.php @@ -51,7 +51,7 @@ class ACPSession extends DatabaseObject $sql = "SELECT * FROM " . static::getDatabaseTableName() . " WHERE userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$userID]); return $statement->fetchObject(static::class); diff --git a/wcfsetup/install/files/lib/data/acp/session/ACPSessionEditor.class.php b/wcfsetup/install/files/lib/data/acp/session/ACPSessionEditor.class.php index 9693cb2648..684965846f 100644 --- a/wcfsetup/install/files/lib/data/acp/session/ACPSessionEditor.class.php +++ b/wcfsetup/install/files/lib/data/acp/session/ACPSessionEditor.class.php @@ -63,7 +63,7 @@ class ACPSessionEditor extends DatabaseObjectEditor $sql = "DELETE FROM " . \call_user_func([static::$baseClass, 'getDatabaseTableName']) . " " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); } diff --git a/wcfsetup/install/files/lib/data/acp/session/log/ACPSessionLog.class.php b/wcfsetup/install/files/lib/data/acp/session/log/ACPSessionLog.class.php index 5dbdfdaa8a..1ce711238f 100644 --- a/wcfsetup/install/files/lib/data/acp/session/log/ACPSessionLog.class.php +++ b/wcfsetup/install/files/lib/data/acp/session/log/ACPSessionLog.class.php @@ -39,11 +39,11 @@ class ACPSessionLog extends DatabaseObject { if ($id !== null) { $sql = "SELECT acp_session_log.*, user_table.username, 0 AS active - FROM wcf" . WCF_N . "_acp_session_log acp_session_log - LEFT JOIN wcf" . WCF_N . "_user user_table + FROM wcf1_acp_session_log acp_session_log + LEFT JOIN wcf1_user user_table ON user_table.userID = acp_session_log.userID WHERE acp_session_log.sessionLogID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$id]); $row = $statement->fetchArray(); } elseif ($object !== null) { diff --git a/wcfsetup/install/files/lib/data/acp/session/log/ACPSessionLogList.class.php b/wcfsetup/install/files/lib/data/acp/session/log/ACPSessionLogList.class.php index f6fcf2ec1e..f440b012f4 100644 --- a/wcfsetup/install/files/lib/data/acp/session/log/ACPSessionLogList.class.php +++ b/wcfsetup/install/files/lib/data/acp/session/log/ACPSessionLogList.class.php @@ -37,12 +37,12 @@ class ACPSessionLogList extends DatabaseObjectList 0 AS active, ( SELECT COUNT(*) - FROM wcf" . WCF_N . "_acp_session_access_log + FROM wcf1_acp_session_access_log WHERE sessionLogID = " . $this->getDatabaseTableAlias() . ".sessionLogID ) AS accesses"; $this->sqlJoins .= " - LEFT JOIN wcf" . WCF_N . "_user user_table + LEFT JOIN wcf1_user user_table ON user_table.userID = " . $this->getDatabaseTableAlias() . ".userID"; parent::readObjects(); diff --git a/wcfsetup/install/files/lib/data/ad/AdAction.class.php b/wcfsetup/install/files/lib/data/ad/AdAction.class.php index fd91ad4951..b3b890fd15 100644 --- a/wcfsetup/install/files/lib/data/ad/AdAction.class.php +++ b/wcfsetup/install/files/lib/data/ad/AdAction.class.php @@ -111,10 +111,10 @@ class AdAction extends AbstractDatabaseObjectAction implements ISortableAction, */ public function updatePosition() { - $sql = "UPDATE wcf" . WCF_N . "_ad + $sql = "UPDATE wcf1_ad SET showOrder = ? WHERE adID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $showOrder = $this->parameters['data']['offset']; WCF::getDB()->beginTransaction(); diff --git a/wcfsetup/install/files/lib/data/ad/AdEditor.class.php b/wcfsetup/install/files/lib/data/ad/AdEditor.class.php index 25711c2bc5..1fdbccc770 100644 --- a/wcfsetup/install/files/lib/data/ad/AdEditor.class.php +++ b/wcfsetup/install/files/lib/data/ad/AdEditor.class.php @@ -35,9 +35,9 @@ class AdEditor extends DatabaseObjectEditor implements IEditableCachedObject public function setShowOrder($showOrder = 0) { $sql = "SELECT MAX(showOrder) - FROM wcf" . WCF_N . "_ad + FROM wcf1_ad WHERE objectTypeID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $this->objectTypeID, ]); @@ -50,11 +50,11 @@ class AdEditor extends DatabaseObjectEditor implements IEditableCachedObject $newShowOrder = $maxShowOrder + 1; } else { // shift other ads - $sql = "UPDATE wcf" . WCF_N . "_ad + $sql = "UPDATE wcf1_ad SET showOrder = showOrder + 1 WHERE objectTypeID = ? AND showOrder >= ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $this->objectTypeID, $showOrder, diff --git a/wcfsetup/install/files/lib/data/application/ApplicationAction.class.php b/wcfsetup/install/files/lib/data/application/ApplicationAction.class.php index c557b21a2a..c91c443618 100644 --- a/wcfsetup/install/files/lib/data/application/ApplicationAction.class.php +++ b/wcfsetup/install/files/lib/data/application/ApplicationAction.class.php @@ -41,10 +41,10 @@ class ApplicationAction extends AbstractDatabaseObjectAction $this->readObjects(); } - $sql = "UPDATE wcf" . WCF_N . "_application + $sql = "UPDATE wcf1_application SET cookieDomain = ? WHERE packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); // calculate cookie domain $regex = new Regex(':[0-9]+'); diff --git a/wcfsetup/install/files/lib/data/article/Article.class.php b/wcfsetup/install/files/lib/data/article/Article.class.php index c05d015c40..93de809aac 100644 --- a/wcfsetup/install/files/lib/data/article/Article.class.php +++ b/wcfsetup/install/files/lib/data/article/Article.class.php @@ -285,9 +285,9 @@ class Article extends DatabaseObject implements ILinkableObject, IUserContent $this->articleContents = []; $sql = "SELECT * - FROM wcf" . WCF_N . "_article_content + FROM wcf1_article_content WHERE articleID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->articleID]); while ($row = $statement->fetchArray()) { $this->articleContents[$row['languageID'] ?: 0] = new ArticleContent(null, $row); @@ -307,9 +307,9 @@ class Article extends DatabaseObject implements ILinkableObject, IUserContent if ($this->languageLinks === null) { $this->languageLinks = []; $sql = "SELECT articleContentID, title, languageID - FROM wcf" . WCF_N . "_article_content + FROM wcf1_article_content WHERE articleID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->articleID]); while ($row = $statement->fetchArray()) { $this->languageLinks[$row['languageID'] ?: 0] = new ArticleContent(null, $row); diff --git a/wcfsetup/install/files/lib/data/article/ArticleAction.class.php b/wcfsetup/install/files/lib/data/article/ArticleAction.class.php index c45b7573d5..eadee4e7dd 100644 --- a/wcfsetup/install/files/lib/data/article/ArticleAction.class.php +++ b/wcfsetup/install/files/lib/data/article/ArticleAction.class.php @@ -359,11 +359,11 @@ class ArticleAction extends AbstractDatabaseObjectAction // update author in recent activities if (isset($this->parameters['data']['userID'])) { - $sql = "UPDATE wcf" . WCF_N . "_user_activity_event + $sql = "UPDATE wcf1_user_activity_event SET userID = ? WHERE objectTypeID = ? AND objectID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($this->objects as $articleEditor) { if ($articleEditor->userID != $this->parameters['data']['userID']) { @@ -890,14 +890,14 @@ class ArticleAction extends AbstractDatabaseObjectAction public function search() { $sql = "SELECT articleID - FROM wcf" . WCF_N . "_article_content + FROM wcf1_article_content WHERE title LIKE ? AND ( languageID = ? OR languageID IS NULL ) ORDER BY title"; - $statement = WCF::getDB()->prepareStatement($sql, 5); + $statement = WCF::getDB()->prepare($sql, 5); $statement->execute([ '%' . $this->parameters['searchString'] . '%', WCF::getLanguage()->languageID, diff --git a/wcfsetup/install/files/lib/data/article/ArticleEditor.class.php b/wcfsetup/install/files/lib/data/article/ArticleEditor.class.php index fb730301fc..1dd11f4b38 100644 --- a/wcfsetup/install/files/lib/data/article/ArticleEditor.class.php +++ b/wcfsetup/install/files/lib/data/article/ArticleEditor.class.php @@ -32,10 +32,10 @@ class ArticleEditor extends DatabaseObjectEditor */ public static function updateArticleCounter(array $users) { - $sql = "UPDATE wcf" . WCF_N . "_user + $sql = "UPDATE wcf1_user SET articles = articles + ? WHERE userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($users as $userID => $articles) { $statement->execute([$articles, $userID]); } diff --git a/wcfsetup/install/files/lib/data/article/TaggedArticleList.class.php b/wcfsetup/install/files/lib/data/article/TaggedArticleList.class.php index be123346c6..7b6369ee84 100644 --- a/wcfsetup/install/files/lib/data/article/TaggedArticleList.class.php +++ b/wcfsetup/install/files/lib/data/article/TaggedArticleList.class.php @@ -32,7 +32,7 @@ class TaggedArticleList extends AccessibleArticleList ); $this->getConditionBuilder()->add("article.articleID IN ( SELECT articleID - FROM wcf" . WCF_N . "_article_content + FROM wcf1_article_content WHERE articleContentID IN ({$subselect['sql']}) )", $subselect['parameters']); } diff --git a/wcfsetup/install/files/lib/data/article/ViewableArticle.class.php b/wcfsetup/install/files/lib/data/article/ViewableArticle.class.php index 2af6d025a3..ee6f8dde95 100644 --- a/wcfsetup/install/files/lib/data/article/ViewableArticle.class.php +++ b/wcfsetup/install/files/lib/data/article/ViewableArticle.class.php @@ -257,13 +257,13 @@ class ViewableArticle extends DatabaseObjectDecorator $conditionBuilder->add('(article.time > tracked_visit.visitTime OR tracked_visit.visitTime IS NULL)'); $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_article article - LEFT JOIN wcf" . WCF_N . "_tracked_visit tracked_visit + FROM wcf1_article article + LEFT JOIN wcf1_tracked_visit tracked_visit ON tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.article') . " AND tracked_visit.objectID = article.articleID AND tracked_visit.userID = " . WCF::getUser()->userID . " " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); self::$unreadArticles = $statement->fetchSingleColumn(); } @@ -383,13 +383,13 @@ class ViewableArticle extends DatabaseObjectDecorator $conditionBuilder->add('(article.time > tracked_visit.visitTime OR tracked_visit.visitTime IS NULL)'); $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_article article - LEFT JOIN wcf" . WCF_N . "_tracked_visit tracked_visit + FROM wcf1_article article + LEFT JOIN wcf1_tracked_visit tracked_visit ON tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.article') . " AND tracked_visit.objectID = article.articleID AND tracked_visit.userID = " . WCF::getUser()->userID . " " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); return $statement->fetchSingleColumn(); @@ -424,13 +424,13 @@ class ViewableArticle extends DatabaseObjectDecorator $conditionBuilder->add('(article.time > tracked_visit.visitTime OR tracked_visit.visitTime IS NULL)'); $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_article article - LEFT JOIN wcf" . WCF_N . "_tracked_visit tracked_visit + FROM wcf1_article article + LEFT JOIN wcf1_tracked_visit tracked_visit ON tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.article') . " AND tracked_visit.objectID = article.articleID AND tracked_visit.userID = " . WCF::getUser()->userID . " " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); self::$unreadWatchedArticles = $statement->fetchSingleColumn(); } diff --git a/wcfsetup/install/files/lib/data/article/ViewableArticleList.class.php b/wcfsetup/install/files/lib/data/article/ViewableArticleList.class.php index 361f991acf..f7c27db127 100644 --- a/wcfsetup/install/files/lib/data/article/ViewableArticleList.class.php +++ b/wcfsetup/install/files/lib/data/article/ViewableArticleList.class.php @@ -57,7 +57,7 @@ class ViewableArticleList extends ArticleList } $this->sqlSelects .= 'tracked_visit.visitTime'; $this->sqlJoins .= " - LEFT JOIN wcf" . WCF_N . "_tracked_visit tracked_visit + LEFT JOIN wcf1_tracked_visit tracked_visit ON tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.article') . " AND tracked_visit.objectID = article.articleID AND tracked_visit.userID = " . WCF::getUser()->userID; @@ -68,7 +68,7 @@ class ViewableArticleList extends ArticleList } $this->sqlSelects .= "like_object.cachedReactions"; $this->sqlJoins .= " - LEFT JOIN wcf" . WCF_N . "_like_object like_object + LEFT JOIN wcf1_like_object like_object ON like_object.objectTypeID = " . ReactionHandler::getInstance()->getObjectType('com.woltlab.wcf.likeableArticle')->objectTypeID . " AND like_object.objectID = article.articleID"; } diff --git a/wcfsetup/install/files/lib/data/article/category/ArticleCategory.class.php b/wcfsetup/install/files/lib/data/article/category/ArticleCategory.class.php index b203c54f71..d8b686d747 100644 --- a/wcfsetup/install/files/lib/data/article/category/ArticleCategory.class.php +++ b/wcfsetup/install/files/lib/data/article/category/ArticleCategory.class.php @@ -241,10 +241,10 @@ class ArticleCategory extends AbstractDecoratedCategory implements IAccessibleOb $objectTypeID = UserObjectWatchHandler::getInstance()->getObjectTypeID('com.woltlab.wcf.article.category'); $sql = "SELECT objectID - FROM wcf" . WCF_N . "_user_object_watch + FROM wcf1_user_object_watch WHERE objectTypeID = ? AND userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$objectTypeID, WCF::getUser()->userID]); self::$subscribedCategories = $statement->fetchAll(\PDO::FETCH_COLUMN); diff --git a/wcfsetup/install/files/lib/data/article/category/ArticleCategoryCache.class.php b/wcfsetup/install/files/lib/data/article/category/ArticleCategoryCache.class.php index b81347c42d..1472b26c78 100644 --- a/wcfsetup/install/files/lib/data/article/category/ArticleCategoryCache.class.php +++ b/wcfsetup/install/files/lib/data/article/category/ArticleCategoryCache.class.php @@ -39,10 +39,10 @@ class ArticleCategoryCache extends SingletonFactory } $sql = "SELECT COUNT(*) AS count, categoryID - FROM wcf" . WCF_N . "_article + FROM wcf1_article " . $conditionBuilder . " GROUP BY categoryID"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); $articles = $statement->fetchMap('categoryID', 'count'); diff --git a/wcfsetup/install/files/lib/data/article/content/ArticleContent.class.php b/wcfsetup/install/files/lib/data/article/content/ArticleContent.class.php index 43b5273110..b7dabac60f 100644 --- a/wcfsetup/install/files/lib/data/article/content/ArticleContent.class.php +++ b/wcfsetup/install/files/lib/data/article/content/ArticleContent.class.php @@ -208,17 +208,17 @@ class ArticleContent extends DatabaseObject implements ILinkableObject, IRouteCo { if ($languageID !== null) { $sql = "SELECT * - FROM wcf" . WCF_N . "_article_content + FROM wcf1_article_content WHERE articleID = ? AND languageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$articleID, $languageID]); } else { $sql = "SELECT * - FROM wcf" . WCF_N . "_article_content + FROM wcf1_article_content WHERE articleID = ? AND languageID IS NULL"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$articleID]); } diff --git a/wcfsetup/install/files/lib/data/attachment/AdministrativeAttachmentList.class.php b/wcfsetup/install/files/lib/data/attachment/AdministrativeAttachmentList.class.php index 3aea4be7ab..5e88e36992 100644 --- a/wcfsetup/install/files/lib/data/attachment/AdministrativeAttachmentList.class.php +++ b/wcfsetup/install/files/lib/data/attachment/AdministrativeAttachmentList.class.php @@ -34,7 +34,7 @@ class AdministrativeAttachmentList extends AttachmentList $this->sqlSelects = 'user_table.username'; $this->sqlJoins = " - LEFT JOIN wcf" . WCF_N . "_user user_table + LEFT JOIN wcf1_user user_table ON user_table.userID = attachment.userID"; } @@ -69,9 +69,9 @@ class AdministrativeAttachmentList extends AttachmentList { $fileTypes = []; $sql = "SELECT DISTINCT attachment.fileType - FROM wcf" . WCF_N . "_attachment attachment + FROM wcf1_attachment attachment " . $this->getConditionBuilder(); - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($this->getConditionBuilder()->getParameters()); while ($row = $statement->fetchArray()) { if ($row['fileType']) { @@ -94,9 +94,9 @@ class AdministrativeAttachmentList extends AttachmentList $sql = "SELECT COUNT(*) AS count, COALESCE(SUM(attachment.filesize), 0) AS size, COALESCE(SUM(downloads), 0) AS downloads - FROM wcf" . WCF_N . "_attachment attachment + FROM wcf1_attachment attachment " . $this->getConditionBuilder(); - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($this->getConditionBuilder()->getParameters()); return $statement->fetchArray(); diff --git a/wcfsetup/install/files/lib/data/attachment/AttachmentEditor.class.php b/wcfsetup/install/files/lib/data/attachment/AttachmentEditor.class.php index 4fc95f9d6a..be58fdddb7 100644 --- a/wcfsetup/install/files/lib/data/attachment/AttachmentEditor.class.php +++ b/wcfsetup/install/files/lib/data/attachment/AttachmentEditor.class.php @@ -31,9 +31,9 @@ class AttachmentEditor extends DatabaseObjectEditor */ public function delete() { - $sql = "DELETE FROM wcf" . WCF_N . "_attachment + $sql = "DELETE FROM wcf1_attachment WHERE attachmentID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->attachmentID]); $this->deleteFiles(); @@ -49,9 +49,9 @@ class AttachmentEditor extends DatabaseObjectEditor $conditionBuilder->add("attachmentID IN (?)", [$objectIDs]); $sql = "SELECT * - FROM wcf" . WCF_N . "_attachment + FROM wcf1_attachment " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); while ($attachment = $statement->fetchObject(static::$baseClass)) { $editor = new self($attachment); diff --git a/wcfsetup/install/files/lib/data/attachment/GroupedAttachmentList.class.php b/wcfsetup/install/files/lib/data/attachment/GroupedAttachmentList.class.php index 6f38520a17..8100de9d72 100644 --- a/wcfsetup/install/files/lib/data/attachment/GroupedAttachmentList.class.php +++ b/wcfsetup/install/files/lib/data/attachment/GroupedAttachmentList.class.php @@ -53,7 +53,7 @@ class GroupedAttachmentList extends AttachmentList $this->getConditionBuilder()->add( '( SELECT DISTINCT embeddedObjectID - FROM wcf' . WCF_N . '_message_embedded_object + FROM wcf1_message_embedded_object WHERE messageObjectTypeID = ? AND messageID = attachment.objectID AND embeddedObjectTypeID = ? diff --git a/wcfsetup/install/files/lib/data/bbcode/BBCode.class.php b/wcfsetup/install/files/lib/data/bbcode/BBCode.class.php index 09297e434e..fe8f50bfde 100644 --- a/wcfsetup/install/files/lib/data/bbcode/BBCode.class.php +++ b/wcfsetup/install/files/lib/data/bbcode/BBCode.class.php @@ -103,9 +103,9 @@ class BBCode extends ProcessibleDatabaseObject implements IRouteController public static function getBBCodeByTag($tag) { $sql = "SELECT * - FROM wcf" . WCF_N . "_bbcode + FROM wcf1_bbcode WHERE bbcodeTag = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$tag]); $row = $statement->fetchArray(); if (!$row) { diff --git a/wcfsetup/install/files/lib/data/bbcode/BBCodeAction.class.php b/wcfsetup/install/files/lib/data/bbcode/BBCodeAction.class.php index dd3a617b13..e53369159f 100644 --- a/wcfsetup/install/files/lib/data/bbcode/BBCodeAction.class.php +++ b/wcfsetup/install/files/lib/data/bbcode/BBCodeAction.class.php @@ -52,9 +52,9 @@ class BBCodeAction extends AbstractDatabaseObjectAction // add bbcode to BBCodeSelect user group options $sql = "SELECT optionID - FROM wcf" . WCF_N . "_user_group_option + FROM wcf1_user_group_option WHERE optionType = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(['BBCodeSelect']); $optionIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); @@ -65,16 +65,16 @@ class BBCodeAction extends AbstractDatabaseObjectAction $conditionBuilder->add("optionValue <> ?", ['all']); $sql = "SELECT * - FROM wcf" . WCF_N . "_user_group_option_value + FROM wcf1_user_group_option_value " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); - $sql = "UPDATE wcf" . WCF_N . "_user_group_option_value + $sql = "UPDATE wcf1_user_group_option_value SET optionValue = ? WHERE optionID = ? AND groupID = ?"; - $updateStatement = WCF::getDB()->prepareStatement($sql); + $updateStatement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); while ($row = $statement->fetchArray()) { diff --git a/wcfsetup/install/files/lib/data/blacklist/entry/BlacklistEntry.class.php b/wcfsetup/install/files/lib/data/blacklist/entry/BlacklistEntry.class.php index aedc4aeede..f4b81a8fc8 100644 --- a/wcfsetup/install/files/lib/data/blacklist/entry/BlacklistEntry.class.php +++ b/wcfsetup/install/files/lib/data/blacklist/entry/BlacklistEntry.class.php @@ -61,9 +61,9 @@ class BlacklistEntry extends DatabaseObject } $sql = "SELECT type, occurrences - FROM wcf" . WCF_N . "_blacklist_entry + FROM wcf1_blacklist_entry " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $matches = []; while ($row = $statement->fetchArray()) { @@ -115,18 +115,18 @@ class BlacklistEntry extends DatabaseObject $percentile[$type] = 99999; $sql = "SELECT COUNT(*) AS count - FROM wcf" . WCF_N . "_blacklist_entry + FROM wcf1_blacklist_entry WHERE type = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$type]); $count = $statement->fetchSingleColumn(); if ($count > 0) { $sql = "SELECT occurrences - FROM wcf" . WCF_N . "_blacklist_entry + FROM wcf1_blacklist_entry WHERE type = ? ORDER BY occurrences DESC"; - $statement = WCF::getDB()->prepareStatement($sql, 1, \round($count * 0.9)); + $statement = WCF::getDB()->prepare($sql, 1, \round($count * 0.9)); $statement->execute([$type]); $percentile[$type] = $statement->fetchSingleColumn(); diff --git a/wcfsetup/install/files/lib/data/blacklist/entry/BlacklistEntryAction.class.php b/wcfsetup/install/files/lib/data/blacklist/entry/BlacklistEntryAction.class.php index 07c9efae51..8d4104e848 100644 --- a/wcfsetup/install/files/lib/data/blacklist/entry/BlacklistEntryAction.class.php +++ b/wcfsetup/install/files/lib/data/blacklist/entry/BlacklistEntryAction.class.php @@ -61,12 +61,12 @@ class BlacklistEntryAction extends AbstractDatabaseObjectAction $data = JSON::decode((string)$response->getBody()); if (\is_array($data)) { - $sql = "INSERT INTO wcf" . WCF_N . "_blacklist_entry + $sql = "INSERT INTO wcf1_blacklist_entry (type, hash, lastSeen, occurrences) VALUES (?, ?, ?, ?) ON DUPLICATE KEY UPDATE lastSeen = VALUES(lastSeen), occurrences = VALUES(occurrences)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $lastSeen = \preg_replace('~^(.+)T(.+)Z~', '$1 $2', $data['meta']['end']); diff --git a/wcfsetup/install/files/lib/data/box/Box.class.php b/wcfsetup/install/files/lib/data/box/Box.class.php index 266f1605e5..399f444c1d 100644 --- a/wcfsetup/install/files/lib/data/box/Box.class.php +++ b/wcfsetup/install/files/lib/data/box/Box.class.php @@ -208,9 +208,9 @@ class Box extends DatabaseObject $this->boxContents = []; $sql = "SELECT * - FROM wcf" . WCF_N . "_box_content + FROM wcf1_box_content WHERE boxID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->boxID]); while ($row = $statement->fetchArray()) { $this->boxContents[$row['languageID'] ?: 0] = new BoxContent(null, $row); @@ -518,9 +518,9 @@ class Box extends DatabaseObject { if ($this->pageIDs === null) { $sql = "SELECT pageID - FROM wcf" . WCF_N . "_box_to_page + FROM wcf1_box_to_page WHERE boxID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->boxID]); $this->pageIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); @@ -641,9 +641,9 @@ class Box extends DatabaseObject public static function getBoxByIdentifier($identifier) { $sql = "SELECT * - FROM wcf" . WCF_N . "_box + FROM wcf1_box WHERE identifier = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$identifier]); return $statement->fetchObject(self::class); @@ -658,9 +658,9 @@ class Box extends DatabaseObject public static function getBoxByName($name) { $sql = "SELECT * - FROM wcf" . WCF_N . "_box + FROM wcf1_box WHERE name = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$name]); return $statement->fetchObject(self::class); @@ -675,9 +675,9 @@ class Box extends DatabaseObject public static function getBoxByMenuID($menuID) { $sql = "SELECT * - FROM wcf" . WCF_N . "_box + FROM wcf1_box WHERE menuID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$menuID]); return $statement->fetchObject(self::class); diff --git a/wcfsetup/install/files/lib/data/box/BoxAction.class.php b/wcfsetup/install/files/lib/data/box/BoxAction.class.php index 8ef852e7f5..f2a42417ed 100644 --- a/wcfsetup/install/files/lib/data/box/BoxAction.class.php +++ b/wcfsetup/install/files/lib/data/box/BoxAction.class.php @@ -113,10 +113,10 @@ class BoxAction extends AbstractDatabaseObjectAction implements IToggleAction // save box to page if (!empty($this->parameters['pageIDs'])) { - $sql = "INSERT INTO wcf" . WCF_N . "_box_to_page + $sql = "INSERT INTO wcf1_box_to_page (boxID, pageID, visible) VALUES (?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($this->parameters['pageIDs'] as $pageID) { $statement->execute([ @@ -232,14 +232,14 @@ class BoxAction extends AbstractDatabaseObjectAction implements IToggleAction // save box to page if (isset($this->parameters['pageIDs'])) { - $sql = "DELETE FROM wcf" . WCF_N . "_box_to_page + $sql = "DELETE FROM wcf1_box_to_page WHERE boxID = ?"; - $deleteStatement = WCF::getDB()->prepareStatement($sql); + $deleteStatement = WCF::getDB()->prepare($sql); - $sql = "INSERT INTO wcf" . WCF_N . "_box_to_page + $sql = "INSERT INTO wcf1_box_to_page (boxID, pageID, visible) VALUES (?, ?, ?)"; - $insertStatement = WCF::getDB()->prepareStatement($sql); + $insertStatement = WCF::getDB()->prepare($sql); foreach ($this->getObjects() as $box) { $deleteStatement->execute([$box->boxID]); diff --git a/wcfsetup/install/files/lib/data/box/content/BoxContent.class.php b/wcfsetup/install/files/lib/data/box/content/BoxContent.class.php index dc812ed856..0d3d503470 100644 --- a/wcfsetup/install/files/lib/data/box/content/BoxContent.class.php +++ b/wcfsetup/install/files/lib/data/box/content/BoxContent.class.php @@ -53,17 +53,17 @@ class BoxContent extends DatabaseObject { if ($languageID !== null) { $sql = "SELECT * - FROM wcf" . WCF_N . "_box_content + FROM wcf1_box_content WHERE boxID = ? AND languageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$boxID, $languageID]); } else { $sql = "SELECT * - FROM wcf" . WCF_N . "_box_content + FROM wcf1_box_content WHERE boxID = ? AND languageID IS NULL"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$boxID]); } diff --git a/wcfsetup/install/files/lib/data/category/CategoryAction.class.php b/wcfsetup/install/files/lib/data/category/CategoryAction.class.php index 1fc4dc2ffa..51305684c6 100644 --- a/wcfsetup/install/files/lib/data/category/CategoryAction.class.php +++ b/wcfsetup/install/files/lib/data/category/CategoryAction.class.php @@ -88,9 +88,9 @@ class CategoryAction extends AbstractDatabaseObjectAction implements $conditions->add('languageItem IN (?)', [$languageVariables]); $sql = "SELECT languageItemID - FROM wcf" . WCF_N . "_language_item + FROM wcf1_language_item " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $languageItemIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); diff --git a/wcfsetup/install/files/lib/data/category/CategoryEditor.class.php b/wcfsetup/install/files/lib/data/category/CategoryEditor.class.php index 8d3fa6d114..900031db5f 100644 --- a/wcfsetup/install/files/lib/data/category/CategoryEditor.class.php +++ b/wcfsetup/install/files/lib/data/category/CategoryEditor.class.php @@ -46,7 +46,7 @@ class CategoryEditor extends DatabaseObjectEditor implements IEditableCachedObje WHERE showOrder > ? AND parentCategoryID = ? AND objectTypeID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $this->showOrder, $this->parentCategoryID, @@ -62,7 +62,7 @@ class CategoryEditor extends DatabaseObjectEditor implements IEditableCachedObje AND showOrder < ? AND parentCategoryID = ? AND objectTypeID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $showOrder, $this->showOrder, @@ -74,7 +74,7 @@ class CategoryEditor extends DatabaseObjectEditor implements IEditableCachedObje FROM " . static::getDatabaseTableName() . " WHERE objectTypeID = ? AND parentCategoryID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $this->objectTypeID, $this->parentCategoryID, @@ -94,7 +94,7 @@ class CategoryEditor extends DatabaseObjectEditor implements IEditableCachedObje WHERE showOrder <= ? AND showOrder > ? AND objectTypeID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $showOrder, $this->showOrder, @@ -143,7 +143,7 @@ class CategoryEditor extends DatabaseObjectEditor implements IEditableCachedObje SET showOrder = showOrder - 1 WHERE parentCategoryID = ? AND showOrder > ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($objectIDs as $categoryID) { $category = CategoryHandler::getInstance()->getCategory($categoryID); @@ -172,7 +172,7 @@ class CategoryEditor extends DatabaseObjectEditor implements IEditableCachedObje FROM " . static::getDatabaseTableName() . " WHERE objectTypeID = ? AND parentCategoryID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $objectTypeID, $parentCategoryID, @@ -189,7 +189,7 @@ class CategoryEditor extends DatabaseObjectEditor implements IEditableCachedObje WHERE objectTypeID = ? AND showOrder >= ? AND parentCategoryID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $objectTypeID, $showOrder, diff --git a/wcfsetup/install/files/lib/data/comment/response/LikeableCommentResponseProvider.class.php b/wcfsetup/install/files/lib/data/comment/response/LikeableCommentResponseProvider.class.php index d67cec41de..c6b5c2df1d 100644 --- a/wcfsetup/install/files/lib/data/comment/response/LikeableCommentResponseProvider.class.php +++ b/wcfsetup/install/files/lib/data/comment/response/LikeableCommentResponseProvider.class.php @@ -74,11 +74,11 @@ class LikeableCommentResponseProvider extends AbstractObjectTypeProvider impleme $conditionBuilder = new PreparedStatementConditionBuilder(); $conditionBuilder->add('comment_response.responseID IN (?)', [$responseIDs]); $sql = "SELECT comment.objectTypeID, comment_response.responseID - FROM wcf" . WCF_N . "_comment_response comment_response - LEFT JOIN wcf" . WCF_N . "_comment comment + FROM wcf1_comment_response comment_response + LEFT JOIN wcf1_comment comment ON comment.commentID = comment_response.commentID " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); $responses = $statement->fetchMap('responseID', 'objectTypeID'); diff --git a/wcfsetup/install/files/lib/data/contact/option/ContactOptionAction.class.php b/wcfsetup/install/files/lib/data/contact/option/ContactOptionAction.class.php index 1780ba85c2..9e750776d3 100644 --- a/wcfsetup/install/files/lib/data/contact/option/ContactOptionAction.class.php +++ b/wcfsetup/install/files/lib/data/contact/option/ContactOptionAction.class.php @@ -151,10 +151,10 @@ class ContactOptionAction extends CustomOptionAction implements ISortableAction */ public function updatePosition() { - $sql = "UPDATE wcf" . WCF_N . "_contact_option + $sql = "UPDATE wcf1_contact_option SET showOrder = ? WHERE optionID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $showOrder = 1; WCF::getDB()->beginTransaction(); diff --git a/wcfsetup/install/files/lib/data/contact/recipient/ContactRecipientAction.class.php b/wcfsetup/install/files/lib/data/contact/recipient/ContactRecipientAction.class.php index a7a12589f0..1142fa67ff 100644 --- a/wcfsetup/install/files/lib/data/contact/recipient/ContactRecipientAction.class.php +++ b/wcfsetup/install/files/lib/data/contact/recipient/ContactRecipientAction.class.php @@ -97,10 +97,10 @@ class ContactRecipientAction extends AbstractDatabaseObjectAction implements ISo */ public function updatePosition() { - $sql = "UPDATE wcf" . WCF_N . "_contact_recipient + $sql = "UPDATE wcf1_contact_recipient SET showOrder = ? WHERE recipientID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $showOrder = $this->parameters['data']['offset']; WCF::getDB()->beginTransaction(); diff --git a/wcfsetup/install/files/lib/data/cronjob/CronjobEditor.class.php b/wcfsetup/install/files/lib/data/cronjob/CronjobEditor.class.php index 011f30e42c..25072ceb0c 100644 --- a/wcfsetup/install/files/lib/data/cronjob/CronjobEditor.class.php +++ b/wcfsetup/install/files/lib/data/cronjob/CronjobEditor.class.php @@ -80,9 +80,9 @@ class CronjobEditor extends DatabaseObjectEditor implements IEditableCachedObjec // fetch data directly from database during framework installation if (!PACKAGE_ID) { $sql = "SELECT * - FROM wcf" . WCF_N . "_language_category + FROM wcf1_language_category WHERE languageCategory = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(['wcf.acp.cronjob']); $languageCategory = $statement->fetchObject(LanguageCategory::class); @@ -94,12 +94,12 @@ class CronjobEditor extends DatabaseObjectEditor implements IEditableCachedObjec } // save new descriptions - $sql = "INSERT INTO wcf" . WCF_N . "_language_item + $sql = "INSERT INTO wcf1_language_item (languageID, languageItem, languageItemValue, languageCategoryID, packageID) VALUES (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE languageItemValue = VALUES(languageItemValue), languageCategoryID = VALUES(languageCategoryID)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($languages as $language) { $value = $defaultValue; @@ -150,9 +150,9 @@ class CronjobEditor extends DatabaseObjectEditor implements IEditableCachedObjec { // delete language items if (!empty($objectIDs)) { - $sql = "DELETE FROM wcf" . WCF_N . "_language_item + $sql = "DELETE FROM wcf1_language_item WHERE languageItem = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); foreach ($objectIDs as $cronjobID) { diff --git a/wcfsetup/install/files/lib/data/cronjob/log/CronjobLogEditor.class.php b/wcfsetup/install/files/lib/data/cronjob/log/CronjobLogEditor.class.php index 77092e5ee4..a415abf729 100644 --- a/wcfsetup/install/files/lib/data/cronjob/log/CronjobLogEditor.class.php +++ b/wcfsetup/install/files/lib/data/cronjob/log/CronjobLogEditor.class.php @@ -29,8 +29,8 @@ class CronjobLogEditor extends DatabaseObjectEditor public static function clearLogs() { // delete logs - $sql = "DELETE FROM wcf" . WCF_N . "_cronjob_log"; - $statement = WCF::getDB()->prepareStatement($sql); + $sql = "DELETE FROM wcf1_cronjob_log"; + $statement = WCF::getDB()->prepare($sql); $statement->execute(); } } diff --git a/wcfsetup/install/files/lib/data/label/LabelAction.class.php b/wcfsetup/install/files/lib/data/label/LabelAction.class.php index 1e5ecc122d..30bdb79f46 100644 --- a/wcfsetup/install/files/lib/data/label/LabelAction.class.php +++ b/wcfsetup/install/files/lib/data/label/LabelAction.class.php @@ -112,9 +112,9 @@ class LabelAction extends AbstractDatabaseObjectAction implements ISortableActio $conditions->add("languageItem IN (?)", [$languageVariables]); $sql = "SELECT languageItemID - FROM wcf" . WCF_N . "_language_item + FROM wcf1_language_item " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $languageItemIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); @@ -159,10 +159,10 @@ class LabelAction extends AbstractDatabaseObjectAction implements ISortableActio */ public function updatePosition() { - $sql = "UPDATE wcf" . WCF_N . "_label + $sql = "UPDATE wcf1_label SET showOrder = ? WHERE labelID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $showOrder = $this->parameters['data']['offset']; diff --git a/wcfsetup/install/files/lib/data/label/LabelEditor.class.php b/wcfsetup/install/files/lib/data/label/LabelEditor.class.php index f50d1133e6..a656591e9f 100644 --- a/wcfsetup/install/files/lib/data/label/LabelEditor.class.php +++ b/wcfsetup/install/files/lib/data/label/LabelEditor.class.php @@ -43,29 +43,29 @@ class LabelEditor extends DatabaseObjectEditor implements IEditableCachedObject { // shift back labels in old label group with higher showOrder if ($this->showOrder) { - $sql = "UPDATE wcf" . WCF_N . "_label + $sql = "UPDATE wcf1_label SET showOrder = showOrder - 1 WHERE groupID = ? AND showOrder >= ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->groupID, $this->showOrder]); } // shift labels in new label group with higher showOrder if ($showOrder) { - $sql = "UPDATE wcf" . WCF_N . "_label + $sql = "UPDATE wcf1_label SET showOrder = showOrder + 1 WHERE groupID = ? AND showOrder >= ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$groupID, $showOrder]); } // get maximum existing show order $sql = "SELECT MAX(showOrder) - FROM wcf" . WCF_N . "_label + FROM wcf1_label WHERE groupID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$groupID]); $maxShowOrder = $statement->fetchSingleColumn() ?: 0; diff --git a/wcfsetup/install/files/lib/data/label/group/LabelGroupAction.class.php b/wcfsetup/install/files/lib/data/label/group/LabelGroupAction.class.php index b410916c6a..8aa8a474a8 100644 --- a/wcfsetup/install/files/lib/data/label/group/LabelGroupAction.class.php +++ b/wcfsetup/install/files/lib/data/label/group/LabelGroupAction.class.php @@ -58,9 +58,9 @@ class LabelGroupAction extends AbstractDatabaseObjectAction $conditions->add('groupID IN (?)', [$this->objectIDs]); $sql = "SELECT labelID - FROM wcf" . WCF_N . "_label + FROM wcf1_label " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $labelIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); @@ -88,9 +88,9 @@ class LabelGroupAction extends AbstractDatabaseObjectAction $conditions->add('languageItem IN (?)', [$languageVariables]); $sql = "SELECT languageItemID - FROM wcf" . WCF_N . "_language_item + FROM wcf1_language_item " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $languageItemIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); diff --git a/wcfsetup/install/files/lib/data/language/LanguageEditor.class.php b/wcfsetup/install/files/lib/data/language/LanguageEditor.class.php index 0e04537dcb..f4a2484bdc 100644 --- a/wcfsetup/install/files/lib/data/language/LanguageEditor.class.php +++ b/wcfsetup/install/files/lib/data/language/LanguageEditor.class.php @@ -75,9 +75,9 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje // get language items $sql = "SELECT languageItem, languageItemValue, languageCustomItemValue, languageUseCustomValue, languageCategoryID - FROM wcf" . WCF_N . "_language_item + FROM wcf1_language_item " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $items = []; while ($row = $statement->fetchArray()) { @@ -139,11 +139,11 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje $sql = "SELECT languageItem, " . ($exportCustomValues ? "CASE WHEN languageUseCustomValue > 0 THEN languageCustomItemValue ELSE languageItemValue END AS languageItemValue" : "languageItemValue") . ", languageCategory - FROM wcf" . WCF_N . "_language_item language_item - LEFT JOIN wcf" . WCF_N . "_language_category language_category + FROM wcf1_language_item language_item + LEFT JOIN wcf1_language_category language_category ON language_category.languageCategoryID = language_item.languageCategoryID " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $items = []; while ($row = $statement->fetchArray()) { @@ -177,11 +177,11 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje $conditions->add("page.packageID = ?", [$packageID]); $conditions->add("page.originIsSystem = ?", [1]); $sql = "SELECT page.identifier, page_content.title, page_content.content - FROM wcf" . WCF_N . "_page page, - wcf" . WCF_N . "_page_content page_content + FROM wcf1_page page, + wcf1_page_content page_content " . $conditions . " ORDER BY page.identifier"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); while ($row = $statement->fetchArray()) { $pages[] = $row; @@ -210,11 +210,11 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje $conditions->add("box.packageID = ?", [$packageID]); $conditions->add("box.originIsSystem = ?", [1]); $sql = "SELECT box.identifier, box_content.title, box_content.content - FROM wcf" . WCF_N . "_box box, - wcf" . WCF_N . "_box_content box_content + FROM wcf1_box box, + wcf1_box_content box_content " . $conditions . " ORDER BY box.identifier"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); while ($row = $statement->fetchArray()) { $boxes[] = $row; @@ -346,9 +346,9 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje $conditions->add("languageCategory IN (?)", [\array_keys($usedCategories)]); $sql = "SELECT languageCategoryID, languageCategory - FROM wcf" . WCF_N . "_language_category + FROM wcf1_language_category " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); while ($row = $statement->fetchArray()) { $usedCategories[$row['languageCategory']] = $row['languageCategoryID']; @@ -454,9 +454,9 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje $conditions->add("(languageUseCustomValue = ? OR isCustomLanguageItem = ?)", [1, 1]); $sql = "SELECT languageItemID, languageItem, languageItemValue, isCustomLanguageItem - FROM wcf" . WCF_N . "_language_item + FROM wcf1_language_item " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $updateValues = $customLanguageItemIDs = []; while ($row = $statement->fetchArray()) { @@ -471,12 +471,12 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje } if (!empty($updateValues)) { - $sql = "UPDATE wcf" . WCF_N . "_language_item + $sql = "UPDATE wcf1_language_item SET languageItemOldValue = languageItemValue, languageCustomItemDisableTime = ?, languageUseCustomValue = ? WHERE languageItemID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); foreach ($updateValues as $languageItemID) { @@ -491,12 +491,12 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje // make custom language items normal ones if (!empty($customLanguageItemIDs)) { - $sql = "UPDATE wcf" . WCF_N . "_language_item + $sql = "UPDATE wcf1_language_item SET isCustomLanguageItem = ?, languageItemOriginIsSystem = ?, packageID = ? WHERE languageItemID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); foreach ($updateValues as $languageItemID) { @@ -523,7 +523,7 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje 0, -1 ); - $sql = "INSERT" . (!$updateExistingItems ? " IGNORE" : "") . " INTO wcf" . WCF_N . "_language_item + $sql = "INSERT" . (!$updateExistingItems ? " IGNORE" : "") . " INTO wcf1_language_item (languageID, languageItem, languageItemValue, languageCategoryID" . ($packageID ? ", packageID" : "") . ") VALUES {$placeholders}"; @@ -541,7 +541,7 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje } } - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($parameters); } WCF::getDB()->commitTransaction(); @@ -554,9 +554,9 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje $conditions = new PreparedStatementConditionBuilder(); $conditions->add("identifier IN (?)", [\array_keys($pageContents)]); $sql = "SELECT pageID, identifier - FROM wcf" . WCF_N . "_page + FROM wcf1_page " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); while ($row = $statement->fetchArray()) { $pageIDs[$row['identifier']] = $row['pageID']; @@ -569,16 +569,16 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje WHERE pageID = ? AND languageID = ?"; $createLanguageVersionStatement = WCF::getDB()->prepare($sql); - $sql = "UPDATE wcf" . WCF_N . "_page_content + $sql = "UPDATE wcf1_page_content SET title = ? WHERE pageID = ? AND languageID = ?"; - $updateTitleStatement = WCF::getDB()->prepareStatement($sql); - $sql = "UPDATE wcf" . WCF_N . "_page_content + $updateTitleStatement = WCF::getDB()->prepare($sql); + $sql = "UPDATE wcf1_page_content SET content = ? WHERE pageID = ? AND languageID = ?"; - $updateContentStatement = WCF::getDB()->prepareStatement($sql); + $updateContentStatement = WCF::getDB()->prepare($sql); foreach ($pageContents as $identifier => $pageContent) { if (!isset($pageIDs[$identifier])) { @@ -611,28 +611,28 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje $conditions = new PreparedStatementConditionBuilder(); $conditions->add("identifier IN (?)", [\array_keys($boxContents)]); $sql = "SELECT boxID, identifier - FROM wcf" . WCF_N . "_box + FROM wcf1_box " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); while ($row = $statement->fetchArray()) { $boxIDs[$row['identifier']] = $row['boxID']; } - $sql = "INSERT IGNORE INTO wcf" . WCF_N . "_box_content + $sql = "INSERT IGNORE INTO wcf1_box_content (boxID, languageID) VALUES (?, ?)"; - $createLanguageVersionStatement = WCF::getDB()->prepareStatement($sql); - $sql = "UPDATE wcf" . WCF_N . "_box_content + $createLanguageVersionStatement = WCF::getDB()->prepare($sql); + $sql = "UPDATE wcf1_box_content SET title = ? WHERE boxID = ? AND languageID = ?"; - $updateTitleStatement = WCF::getDB()->prepareStatement($sql); - $sql = "UPDATE wcf" . WCF_N . "_box_content + $updateTitleStatement = WCF::getDB()->prepare($sql); + $sql = "UPDATE wcf1_box_content SET content = ? WHERE boxID = ? AND languageID = ?"; - $updateContentStatement = WCF::getDB()->prepareStatement($sql); + $updateContentStatement = WCF::getDB()->prepare($sql); foreach ($boxContents as $identifier => $boxContent) { if (!isset($boxIDs[$identifier])) { @@ -836,12 +836,12 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje */ public function copy(Language $destination) { - $sql = "INSERT INTO wcf" . WCF_N . "_language_item + $sql = "INSERT INTO wcf1_language_item (languageID, languageItem, languageItemValue, languageItemOriginIsSystem, languageCategoryID, packageID) SELECT ?, languageItem, languageItemValue, languageItemOriginIsSystem, languageCategoryID, packageID - FROM wcf" . WCF_N . "_language_item + FROM wcf1_language_item WHERE languageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $destination->languageID, $this->languageID, @@ -886,10 +886,10 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje // create remaining items if (!empty($items)) { // bypass LanguageItemEditor::create() for performance reasons - $sql = "INSERT INTO wcf" . WCF_N . "_language_item + $sql = "INSERT INTO wcf1_language_item (languageID, languageItem, languageItemValue, languageItemOriginIsSystem, languageCategoryID, packageID) VALUES (?, ?, ?, ?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($items as $itemName => $itemValue) { $statement->execute([ @@ -916,9 +916,9 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje public function setAsDefault() { // remove default flag from all languages - $sql = "UPDATE wcf" . WCF_N . "_language + $sql = "UPDATE wcf1_language SET isDefault = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([0]); // set current language as default language @@ -942,9 +942,9 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje */ public static function enableMultilingualism(array $languageIDs = []) { - $sql = "UPDATE wcf" . WCF_N . "_language + $sql = "UPDATE wcf1_language SET hasContent = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([0]); if (!empty($languageIDs)) { @@ -958,10 +958,10 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje $statementParameters[] = $languageID; } - $sql = "UPDATE wcf" . WCF_N . "_language + $sql = "UPDATE wcf1_language SET hasContent = ? WHERE languageID IN (" . $sql . ")"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); \array_unshift($statementParameters, 1); $statement->execute($statementParameters); } @@ -984,33 +984,33 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje public static function copyLanguageContent($sourceLanguageID, $destinationLanguageID) { // article content - $sql = "INSERT IGNORE INTO wcf" . WCF_N . "_article_content + $sql = "INSERT IGNORE INTO wcf1_article_content (articleID, languageID, title, teaser, content, imageID, hasEmbeddedObjects) SELECT articleID, ?, title, teaser, content, imageID, hasEmbeddedObjects - FROM wcf" . WCF_N . "_article_content + FROM wcf1_article_content WHERE languageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$destinationLanguageID, $sourceLanguageID]); // box content - $sql = "INSERT IGNORE INTO wcf" . WCF_N . "_box_content + $sql = "INSERT IGNORE INTO wcf1_box_content (boxID, languageID, title, content, imageID, hasEmbeddedObjects) SELECT boxID, ?, title, content, imageID, hasEmbeddedObjects - FROM wcf" . WCF_N . "_box_content + FROM wcf1_box_content WHERE languageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$destinationLanguageID, $sourceLanguageID]); // create tpl files $sql = "SELECT * - FROM wcf" . WCF_N . "_box_content + FROM wcf1_box_content WHERE boxID IN ( SELECT boxID - FROM wcf" . WCF_N . "_box + FROM wcf1_box WHERE boxType = ? ) AND languageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(['tpl', $destinationLanguageID]); while ($row = $statement->fetchArray()) { \file_put_contents( @@ -1020,33 +1020,33 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje } // media content - $sql = "INSERT IGNORE INTO wcf" . WCF_N . "_media_content + $sql = "INSERT IGNORE INTO wcf1_media_content (mediaID, languageID, title, caption, altText) SELECT mediaID, ?, title, caption, altText - FROM wcf" . WCF_N . "_media_content + FROM wcf1_media_content WHERE languageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$destinationLanguageID, $sourceLanguageID]); // page content - $sql = "INSERT IGNORE INTO wcf" . WCF_N . "_page_content + $sql = "INSERT IGNORE INTO wcf1_page_content (pageID, languageID, title, content, metaDescription, customURL, hasEmbeddedObjects) SELECT pageID, ?, title, content, metaDescription, CASE WHEN customURL <> '' THEN CONCAT(customURL, '_', ?) ELSE '' END, hasEmbeddedObjects - FROM wcf" . WCF_N . "_page_content + FROM wcf1_page_content WHERE languageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$destinationLanguageID, $destinationLanguageID, $sourceLanguageID]); // create tpl files $sql = "SELECT * - FROM wcf" . WCF_N . "_page_content + FROM wcf1_page_content WHERE pageID IN ( SELECT pageID - FROM wcf" . WCF_N . "_page + FROM wcf1_page WHERE pageType = ? ) AND languageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(['tpl', $destinationLanguageID]); while ($row = $statement->fetchArray()) { \file_put_contents( diff --git a/wcfsetup/install/files/lib/data/like/Like.class.php b/wcfsetup/install/files/lib/data/like/Like.class.php index b8fd205676..732621baba 100644 --- a/wcfsetup/install/files/lib/data/like/Like.class.php +++ b/wcfsetup/install/files/lib/data/like/Like.class.php @@ -70,11 +70,11 @@ class Like extends DatabaseObject public static function getLike($objectTypeID, $objectID, $userID) { $sql = "SELECT * - FROM wcf" . WCF_N . "_like + FROM wcf1_like WHERE objectTypeID = ? AND objectID = ? AND userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $objectTypeID, $objectID, diff --git a/wcfsetup/install/files/lib/data/like/LikeAction.class.php b/wcfsetup/install/files/lib/data/like/LikeAction.class.php index d687e43f48..31ace26e21 100644 --- a/wcfsetup/install/files/lib/data/like/LikeAction.class.php +++ b/wcfsetup/install/files/lib/data/like/LikeAction.class.php @@ -73,11 +73,11 @@ class LikeAction extends AbstractDatabaseObjectAction implements IGroupedUserLis public function getLikeDetails() { $sql = "SELECT userID, likeValue - FROM wcf" . WCF_N . "_like + FROM wcf1_like WHERE objectID = ? AND objectTypeID = ? ORDER BY time DESC"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $this->parameters['data']['objectID'], $this->objectType->objectTypeID, @@ -252,10 +252,10 @@ class LikeAction extends AbstractDatabaseObjectAction implements IGroupedUserLis { // fetch number of pages $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_like + FROM wcf1_like WHERE objectID = ? AND objectTypeID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $this->parameters['data']['objectID'], $this->objectType->objectTypeID, @@ -263,11 +263,11 @@ class LikeAction extends AbstractDatabaseObjectAction implements IGroupedUserLis $pageCount = \ceil($statement->fetchSingleColumn() / 20); $sql = "SELECT userID, likeValue - FROM wcf" . WCF_N . "_like + FROM wcf1_like WHERE objectID = ? AND objectTypeID = ? ORDER BY likeValue DESC, time DESC"; - $statement = WCF::getDB()->prepareStatement($sql, 20, ($this->parameters['pageNo'] - 1) * 20); + $statement = WCF::getDB()->prepare($sql, 20, ($this->parameters['pageNo'] - 1) * 20); $statement->execute([ $this->parameters['data']['objectID'], $this->objectType->objectTypeID, diff --git a/wcfsetup/install/files/lib/data/like/object/LikeObject.class.php b/wcfsetup/install/files/lib/data/like/object/LikeObject.class.php index e2a5009d88..b48dbaa71c 100644 --- a/wcfsetup/install/files/lib/data/like/object/LikeObject.class.php +++ b/wcfsetup/install/files/lib/data/like/object/LikeObject.class.php @@ -203,10 +203,10 @@ class LikeObject extends DatabaseObject public static function getLikeObject($objectTypeID, $objectID) { $sql = "SELECT * - FROM wcf" . WCF_N . "_like_object + FROM wcf1_like_object WHERE objectTypeID = ? AND objectID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $objectTypeID, $objectID, diff --git a/wcfsetup/install/files/lib/data/media/Media.class.php b/wcfsetup/install/files/lib/data/media/Media.class.php index 8bc9f4e79a..8ab39464e7 100644 --- a/wcfsetup/install/files/lib/data/media/Media.class.php +++ b/wcfsetup/install/files/lib/data/media/Media.class.php @@ -206,9 +206,9 @@ class Media extends DatabaseObject implements ILinkableObject, IRouteController, ]; $sql = "SELECT * - FROM wcf" . WCF_N . "_media_content + FROM wcf1_media_content WHERE mediaID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->mediaID]); while ($row = $statement->fetchArray()) { diff --git a/wcfsetup/install/files/lib/data/media/MediaAction.class.php b/wcfsetup/install/files/lib/data/media/MediaAction.class.php index 132cbf195e..f0f63744b1 100644 --- a/wcfsetup/install/files/lib/data/media/MediaAction.class.php +++ b/wcfsetup/install/files/lib/data/media/MediaAction.class.php @@ -272,9 +272,9 @@ class MediaAction extends AbstractDatabaseObjectAction implements ISearchAction, $conditionBuilder->add('mediaID IN (?)', [$mediaList->getObjectIDs()]); $sql = "SELECT * - FROM wcf" . WCF_N . "_media_content + FROM wcf1_media_content " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); $mediaData = []; @@ -439,15 +439,15 @@ class MediaAction extends AbstractDatabaseObjectAction implements ISearchAction, $isMultilingual = $this->parameters['data']['isMultilingual']; } - $sql = "DELETE FROM wcf" . WCF_N . "_media_content + $sql = "DELETE FROM wcf1_media_content WHERE mediaID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$media->mediaID]); - $sql = "INSERT INTO wcf" . WCF_N . "_media_content + $sql = "INSERT INTO wcf1_media_content (mediaID, languageID, title, caption, altText) VALUES (?, ?, ?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); if (!$isMultilingual) { $languageID = $media->languageID; @@ -726,10 +726,10 @@ class MediaAction extends AbstractDatabaseObjectAction implements ISearchAction, $conditionBuilder = new PreparedStatementConditionBuilder(); $conditionBuilder->add('mediaID IN (?)', [$this->objectIDs]); - $sql = "UPDATE wcf" . WCF_N . "_media + $sql = "UPDATE wcf1_media SET categoryID = ? " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(\array_merge( [$this->parameters['categoryID'] ?: null], $conditionBuilder->getParameters() diff --git a/wcfsetup/install/files/lib/data/media/MediaList.class.php b/wcfsetup/install/files/lib/data/media/MediaList.class.php index 9da29dca3a..685655cc38 100644 --- a/wcfsetup/install/files/lib/data/media/MediaList.class.php +++ b/wcfsetup/install/files/lib/data/media/MediaList.class.php @@ -40,7 +40,7 @@ class MediaList extends DatabaseObjectList $searchString = '%' . \addcslashes($searchString, '_%') . '%'; $this->sqlConditionJoins .= ' - LEFT JOIN wcf' . WCF_N . '_media_content media_content + LEFT JOIN wcf1_media_content media_content ON media_content.mediaID = media.mediaID'; $conditionBuilder = new PreparedStatementConditionBuilder(false, 'OR'); diff --git a/wcfsetup/install/files/lib/data/media/ViewableMediaList.class.php b/wcfsetup/install/files/lib/data/media/ViewableMediaList.class.php index a64274a7c6..237f530435 100644 --- a/wcfsetup/install/files/lib/data/media/ViewableMediaList.class.php +++ b/wcfsetup/install/files/lib/data/media/ViewableMediaList.class.php @@ -41,7 +41,7 @@ class ViewableMediaList extends MediaList // fetch content data $this->sqlSelects .= "media_content.*, COALESCE(media.languageID, " . $languageID . ") AS localizedLanguageID"; $this->sqlJoins .= " - LEFT JOIN wcf" . WCF_N . "_media_content media_content + LEFT JOIN wcf1_media_content media_content ON media_content.mediaID = media.mediaID AND media_content.languageID = COALESCE(media.languageID, " . $languageID . ")"; } diff --git a/wcfsetup/install/files/lib/data/menu/MenuEditor.class.php b/wcfsetup/install/files/lib/data/menu/MenuEditor.class.php index 4fff17874a..304a7f5356 100644 --- a/wcfsetup/install/files/lib/data/menu/MenuEditor.class.php +++ b/wcfsetup/install/files/lib/data/menu/MenuEditor.class.php @@ -44,16 +44,16 @@ class MenuEditor extends DatabaseObjectEditor implements IEditableCachedObject if (\is_array($title)) { if (\count($title) > 1) { $sql = "SELECT languageCategoryID - FROM wcf" . WCF_N . "_language_category + FROM wcf1_language_category WHERE languageCategory = ?"; - $statement = WCF::getDB()->prepareStatement($sql, 1); + $statement = WCF::getDB()->prepare($sql, 1); $statement->execute(['wcf.menu']); $languageCategoryID = $statement->fetchSingleColumn(); - $sql = "INSERT INTO wcf" . WCF_N . "_language_item + $sql = "INSERT INTO wcf1_language_item (languageID, languageItem, languageItemValue, languageItemOriginIsSystem, languageCategoryID, packageID) VALUES (?, ?, ?, ?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); foreach ($title as $languageCode => $value) { @@ -93,9 +93,9 @@ class MenuEditor extends DatabaseObjectEditor implements IEditableCachedObject $menuList->readObjects(); if (\count($menuList)) { - $sql = "DELETE FROM wcf" . WCF_N . "_language_item + $sql = "DELETE FROM wcf1_language_item WHERE languageItem = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); foreach ($menuList as $menu) { diff --git a/wcfsetup/install/files/lib/data/menu/item/MenuItemAction.class.php b/wcfsetup/install/files/lib/data/menu/item/MenuItemAction.class.php index 55e11b51fc..f8c10a03a9 100644 --- a/wcfsetup/install/files/lib/data/menu/item/MenuItemAction.class.php +++ b/wcfsetup/install/files/lib/data/menu/item/MenuItemAction.class.php @@ -116,11 +116,11 @@ class MenuItemAction extends AbstractDatabaseObjectAction implements ISortableAc */ public function updatePosition() { - $sql = "UPDATE wcf" . WCF_N . "_menu_item + $sql = "UPDATE wcf1_menu_item SET parentItemID = ?, showOrder = ? WHERE itemID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); foreach ($this->parameters['data']['structure'] as $parentItemID => $children) { diff --git a/wcfsetup/install/files/lib/data/menu/item/MenuItemEditor.class.php b/wcfsetup/install/files/lib/data/menu/item/MenuItemEditor.class.php index c1477fa048..df678947e9 100644 --- a/wcfsetup/install/files/lib/data/menu/item/MenuItemEditor.class.php +++ b/wcfsetup/install/files/lib/data/menu/item/MenuItemEditor.class.php @@ -44,16 +44,16 @@ class MenuItemEditor extends DatabaseObjectEditor implements IEditableCachedObje if (\is_array($title)) { if (\count($title) > 1) { $sql = "SELECT languageCategoryID - FROM wcf" . WCF_N . "_language_category + FROM wcf1_language_category WHERE languageCategory = ?"; - $statement = WCF::getDB()->prepareStatement($sql, 1); + $statement = WCF::getDB()->prepare($sql, 1); $statement->execute(['wcf.menu']); $languageCategoryID = $statement->fetchSingleColumn(); - $sql = "INSERT INTO wcf" . WCF_N . "_language_item + $sql = "INSERT INTO wcf1_language_item (languageID, languageItem, languageItemValue, languageItemOriginIsSystem, languageCategoryID, packageID) VALUES (?, ?, ?, ?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); foreach ($title as $languageCode => $value) { @@ -93,9 +93,9 @@ class MenuItemEditor extends DatabaseObjectEditor implements IEditableCachedObje $menuItemList->readObjects(); if (\count($menuItemList)) { - $sql = "DELETE FROM wcf" . WCF_N . "_language_item + $sql = "DELETE FROM wcf1_language_item WHERE languageItem = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); foreach ($menuItemList as $menuItem) { diff --git a/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueue.class.php b/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueue.class.php index 60f13741ce..719913050d 100644 --- a/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueue.class.php +++ b/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueue.class.php @@ -82,10 +82,10 @@ class ModerationQueue extends DatabaseObject } $sql = "SELECT isAffected - FROM wcf" . WCF_N . "_moderation_queue_to_user + FROM wcf1_moderation_queue_to_user WHERE queueID = ? AND userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $this->queueID, $user->userID, diff --git a/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php b/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php index 83b87d1c52..5d84b5b5b7 100644 --- a/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php +++ b/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php @@ -88,10 +88,10 @@ class ModerationQueueAction extends AbstractDatabaseObjectAction $conditions = new PreparedStatementConditionBuilder(); $conditions->add("queueID IN (?)", [$queueIDs]); - $sql = "UPDATE wcf" . WCF_N . "_moderation_queue + $sql = "UPDATE wcf1_moderation_queue SET status = " . ModerationQueue::STATUS_DONE . " " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); // reset number of active moderation queue items @@ -154,16 +154,16 @@ class ModerationQueueAction extends AbstractDatabaseObjectAction $conditions->add("(moderation_queue.time > tracked_visit.visitTime OR tracked_visit.visitTime IS NULL)"); $sql = "SELECT moderation_queue.queueID - FROM wcf" . WCF_N . "_moderation_queue_to_user moderation_queue_to_user - LEFT JOIN wcf" . WCF_N . "_moderation_queue moderation_queue + FROM wcf1_moderation_queue_to_user moderation_queue_to_user + LEFT JOIN wcf1_moderation_queue moderation_queue ON moderation_queue.queueID = moderation_queue_to_user.queueID - LEFT JOIN wcf" . WCF_N . "_tracked_visit tracked_visit + LEFT JOIN wcf1_tracked_visit tracked_visit ON tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.moderation.queue') . " AND tracked_visit.objectID = moderation_queue.queueID AND tracked_visit.userID = " . WCF::getUser()->userID . " " . $conditions . " ORDER BY moderation_queue.lastChangeTime DESC"; - $statement = WCF::getDB()->prepareStatement($sql, $MAX_ITEMS); + $statement = WCF::getDB()->prepare($sql, $MAX_ITEMS); $statement->execute($conditions->getParameters()); $queueIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); diff --git a/wcfsetup/install/files/lib/data/moderation/queue/ViewableModerationQueueList.class.php b/wcfsetup/install/files/lib/data/moderation/queue/ViewableModerationQueueList.class.php index 4deebf0adc..f03f72fa4b 100644 --- a/wcfsetup/install/files/lib/data/moderation/queue/ViewableModerationQueueList.class.php +++ b/wcfsetup/install/files/lib/data/moderation/queue/ViewableModerationQueueList.class.php @@ -43,12 +43,12 @@ class ViewableModerationQueueList extends ModerationQueueList parent::__construct(); $this->sqlSelects = "moderation_queue.*, assigned_user.username AS assignedUsername, user_table.username"; - $this->sqlConditionJoins = ", wcf" . WCF_N . "_moderation_queue moderation_queue"; - $this->sqlJoins = ", wcf" . WCF_N . "_moderation_queue moderation_queue"; + $this->sqlConditionJoins = ", wcf1_moderation_queue moderation_queue"; + $this->sqlJoins = ", wcf1_moderation_queue moderation_queue"; $this->sqlJoins .= " - LEFT JOIN wcf" . WCF_N . "_user assigned_user + LEFT JOIN wcf1_user assigned_user ON assigned_user.userID = moderation_queue.assignedUserID - LEFT JOIN wcf" . WCF_N . "_user user_table + LEFT JOIN wcf1_user user_table ON user_table.userID = moderation_queue.userID"; $this->getConditionBuilder()->add("moderation_queue_to_user.queueID = moderation_queue.queueID"); $this->getConditionBuilder()->add("moderation_queue_to_user.userID = ?", [WCF::getUser()->userID]); diff --git a/wcfsetup/install/files/lib/data/notice/Notice.class.php b/wcfsetup/install/files/lib/data/notice/Notice.class.php index 81cadf923c..c2eedc2702 100644 --- a/wcfsetup/install/files/lib/data/notice/Notice.class.php +++ b/wcfsetup/install/files/lib/data/notice/Notice.class.php @@ -96,9 +96,9 @@ class Notice extends DatabaseObject implements IRouteController $dismissedNotices = UserStorageHandler::getInstance()->getField('dismissedNotices'); if ($dismissedNotices === null) { $sql = "SELECT noticeID - FROM wcf" . WCF_N . "_notice_dismissed + FROM wcf1_notice_dismissed WHERE userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ WCF::getUser()->userID, ]); diff --git a/wcfsetup/install/files/lib/data/notice/NoticeAction.class.php b/wcfsetup/install/files/lib/data/notice/NoticeAction.class.php index 136e9ff0db..117a4fcc73 100644 --- a/wcfsetup/install/files/lib/data/notice/NoticeAction.class.php +++ b/wcfsetup/install/files/lib/data/notice/NoticeAction.class.php @@ -83,10 +83,10 @@ class NoticeAction extends AbstractDatabaseObjectAction implements ISortableActi public function dismiss() { if (WCF::getUser()->userID) { - $sql = "INSERT IGNORE INTO wcf" . WCF_N . "_notice_dismissed + $sql = "INSERT IGNORE INTO wcf1_notice_dismissed (noticeID, userID) VALUES (?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ \reset($this->objectIDs), WCF::getUser()->userID, @@ -162,10 +162,10 @@ class NoticeAction extends AbstractDatabaseObjectAction implements ISortableActi */ public function updatePosition() { - $sql = "UPDATE wcf" . WCF_N . "_notice + $sql = "UPDATE wcf1_notice SET showOrder = ? WHERE noticeID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $showOrder = $this->parameters['data']['offset']; WCF::getDB()->beginTransaction(); diff --git a/wcfsetup/install/files/lib/data/notice/NoticeEditor.class.php b/wcfsetup/install/files/lib/data/notice/NoticeEditor.class.php index 090fefd94d..f74e3ecce2 100644 --- a/wcfsetup/install/files/lib/data/notice/NoticeEditor.class.php +++ b/wcfsetup/install/files/lib/data/notice/NoticeEditor.class.php @@ -35,8 +35,8 @@ class NoticeEditor extends DatabaseObjectEditor implements IEditableCachedObject public function setShowOrder($showOrder = 0) { $sql = "SELECT MAX(showOrder) - FROM wcf" . WCF_N . "_notice"; - $statement = WCF::getDB()->prepareStatement($sql); + FROM wcf1_notice"; + $statement = WCF::getDB()->prepare($sql); $statement->execute(); $maxShowOrder = $statement->fetchSingleColumn(); if (!$maxShowOrder) { @@ -47,10 +47,10 @@ class NoticeEditor extends DatabaseObjectEditor implements IEditableCachedObject $newShowOrder = $maxShowOrder + 1; } else { // shift other notices - $sql = "UPDATE wcf" . WCF_N . "_notice + $sql = "UPDATE wcf1_notice SET showOrder = showOrder + 1 WHERE showOrder >= ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $showOrder, ]); diff --git a/wcfsetup/install/files/lib/data/option/Option.class.php b/wcfsetup/install/files/lib/data/option/Option.class.php index d7e3bf47c2..ffa7d43c9f 100644 --- a/wcfsetup/install/files/lib/data/option/Option.class.php +++ b/wcfsetup/install/files/lib/data/option/Option.class.php @@ -75,7 +75,7 @@ class Option extends DatabaseObject { $sql = "SELECT * FROM " . self::getDatabaseTableName(); - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(); $options = []; @@ -95,7 +95,7 @@ class Option extends DatabaseObject $sql = "SELECT * FROM " . self::getDatabaseTableName() . " WHERE optionName = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$optionName]); return $statement->fetchObject(static::class); diff --git a/wcfsetup/install/files/lib/data/option/OptionEditor.class.php b/wcfsetup/install/files/lib/data/option/OptionEditor.class.php index dece6ba663..a5fbf0f13d 100644 --- a/wcfsetup/install/files/lib/data/option/OptionEditor.class.php +++ b/wcfsetup/install/files/lib/data/option/OptionEditor.class.php @@ -45,8 +45,8 @@ class OptionEditor extends DatabaseObjectEditor implements IEditableCachedObject { // get option ids $sql = "SELECT optionName, optionID - FROM wcf" . WCF_N . "_option"; - $statement = WCF::getDB()->prepareStatement($sql); + FROM wcf1_option"; + $statement = WCF::getDB()->prepare($sql); $statement->execute(); $optionIDs = $statement->fetchMap('optionName', 'optionID'); @@ -68,19 +68,19 @@ class OptionEditor extends DatabaseObjectEditor implements IEditableCachedObject public static function updateAll(array $options) { $sql = "SELECT optionID, optionName, optionValue - FROM wcf" . WCF_N . "_option + FROM wcf1_option WHERE optionName IN (?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(['cache_source_type', 'visitor_use_tiny_build']); $oldValues = []; while ($row = $statement->fetchArray()) { $oldValues[$row['optionID']] = $row; } - $sql = "UPDATE wcf" . WCF_N . "_option + $sql = "UPDATE wcf1_option SET optionValue = ? WHERE optionID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $flushCache = false; $flushPermissions = false; diff --git a/wcfsetup/install/files/lib/data/package/Package.class.php b/wcfsetup/install/files/lib/data/package/Package.class.php index 8bee55aeb6..f31588a754 100644 --- a/wcfsetup/install/files/lib/data/package/Package.class.php +++ b/wcfsetup/install/files/lib/data/package/Package.class.php @@ -288,8 +288,8 @@ class Package extends DatabaseObject implements ILinkableObject, IRouteControlle { if (self::$requirements === null) { $sql = "SELECT packageID, requirement - FROM wcf" . WCF_N . "_package_requirement"; - $statement = WCF::getDB()->prepareStatement($sql); + FROM wcf1_package_requirement"; + $statement = WCF::getDB()->prepare($sql); $statement->execute(); self::$requiredPackageIDs = []; @@ -317,9 +317,9 @@ class Package extends DatabaseObject implements ILinkableObject, IRouteControlle public static function isAlreadyInstalled($package) { $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_package + FROM wcf1_package WHERE package = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$package]); return $statement->fetchSingleColumn() > 0; diff --git a/wcfsetup/install/files/lib/data/package/installation/queue/PackageInstallationQueue.class.php b/wcfsetup/install/files/lib/data/package/installation/queue/PackageInstallationQueue.class.php index 13432bb014..96943b960a 100644 --- a/wcfsetup/install/files/lib/data/package/installation/queue/PackageInstallationQueue.class.php +++ b/wcfsetup/install/files/lib/data/package/installation/queue/PackageInstallationQueue.class.php @@ -34,8 +34,8 @@ class PackageInstallationQueue extends DatabaseObject public static function getNewProcessNo() { $sql = "SELECT MAX(processNo) AS processNo - FROM wcf" . WCF_N . "_package_installation_queue"; - $statement = WCF::getDB()->prepareStatement($sql); + FROM wcf1_package_installation_queue"; + $statement = WCF::getDB()->prepare($sql); $statement->execute(); $row = $statement->fetchArray(); diff --git a/wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php b/wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php index 1371c38bf0..2266845338 100644 --- a/wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php +++ b/wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php @@ -94,12 +94,12 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction // find matching packages $sql = "SELECT package_update.packageUpdateID - FROM wcf" . WCF_N . "_package_update package_update - LEFT JOIN wcf" . WCF_N . "_package package + FROM wcf1_package_update package_update + LEFT JOIN wcf1_package package ON package.package = package_update.package " . $conditions . " ORDER BY package_update.packageName ASC"; - $statement = WCF::getDB()->prepareStatement($sql, 1000); + $statement = WCF::getDB()->prepare($sql, 1000); $statement->execute($conditions->getParameters()); $packageUpdateIDs = []; while ($row = $statement->fetchArray()) { @@ -124,16 +124,16 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction // get installed packages $sql = "SELECT package, packageVersion - FROM wcf" . WCF_N . "_package"; - $statement = WCF::getDB()->prepareStatement($sql); + FROM wcf1_package"; + $statement = WCF::getDB()->prepare($sql); $statement->execute(); $installedPackages = $statement->fetchMap('package', 'packageVersion'); // get excluded packages (of installed packages) $excludedPackagesOfInstalledPackages = []; $sql = "SELECT excludedPackage, excludedPackageVersion - FROM wcf" . WCF_N . "_package_exclusion"; - $statement = WCF::getDB()->prepareStatement($sql); + FROM wcf1_package_exclusion"; + $statement = WCF::getDB()->prepare($sql); $statement->execute(); while ($row = $statement->fetchArray()) { if (!isset($excludedPackagesOfInstalledPackages[$row['excludedPackage']])) { @@ -184,9 +184,9 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction $conditions = new PreparedStatementConditionBuilder(); $conditions->add("packageUpdateID IN (?)", [\array_keys($packageUpdates)]); $sql = "SELECT packageUpdateID, packageUpdateServerID, package - FROM wcf" . WCF_N . "_package_update + FROM wcf1_package_update " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $possiblePackages = []; while ($row = $statement->fetchArray()) { @@ -233,9 +233,9 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction $conditions->add("packageUpdateVersionID IN (?)", [$packageUpdateVersionIDs]); $sql = "SELECT packageUpdateVersionID, packageUpdateID, packageVersion - FROM wcf" . WCF_N . "_package_update_version + FROM wcf1_package_update_version " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $packageVersions = []; while ($row = $statement->fetchArray()) { @@ -289,15 +289,15 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction $conditions->add( "packageUpdateVersionID IN ( SELECT packageUpdateVersionID - FROM wcf" . WCF_N . "_package_update_version + FROM wcf1_package_update_version WHERE packageUpdateID = ? )", [$packageUpdateID] ); $sql = "SELECT * - FROM wcf" . WCF_N . "_package_update_exclusion + FROM wcf1_package_update_exclusion " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $excludedPackages = []; while ($row = $statement->fetchArray()) { @@ -321,11 +321,11 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction $conditions = new PreparedStatementConditionBuilder(); $conditions->add("puv.packageUpdateID IN (?)", [$packageUpdateID]); $sql = "SELECT pu.package, puv.packageUpdateVersionID, puv.packageUpdateID, puv.packageVersion, puv.isAccessible - FROM wcf" . WCF_N . "_package_update_version puv - LEFT JOIN wcf" . WCF_N . "_package_update pu + FROM wcf1_package_update_version puv + LEFT JOIN wcf1_package_update pu ON pu.packageUpdateID = puv.packageUpdateID " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $packageVersions = []; while ($row = $statement->fetchArray()) { @@ -440,9 +440,9 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction // validate dependencies foreach ($packageUpdates as $packageUpdateData) { $sql = "SELECT package, minversion - FROM wcf" . WCF_N . "_package_update_requirement + FROM wcf1_package_update_requirement WHERE packageUpdateVersionID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$packageUpdateData['accessible']]); $requirements = []; while ($row = $statement->fetchArray()) { @@ -468,9 +468,9 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction $conditions = new PreparedStatementConditionBuilder(); $conditions->add("package IN (?)", [\array_keys($requirements)]); $sql = "SELECT packageUpdateID, package - FROM wcf" . WCF_N . "_package_update + FROM wcf1_package_update " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); while ($row = $statement->fetchArray()) { if (!\in_array($row['package'], $openRequirements)) { @@ -512,9 +512,9 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction $conditions->add("packageUpdateID IN (?)", [\array_keys($updateData)]); $sql = "SELECT * - FROM wcf" . WCF_N . "_package_update + FROM wcf1_package_update " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $packageUpdates = $packageVersionIDs = []; while ($packageUpdate = $statement->fetchObject(PackageUpdate::class)) { @@ -531,9 +531,9 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction $conditions->add("packageUpdateVersionID IN (?)", [$packageVersionIDs]); $sql = "SELECT packageUpdateVersionID, packageVersion, packageDate, license, licenseURL - FROM wcf" . WCF_N . "_package_update_version + FROM wcf1_package_update_version " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); /** @var PackageUpdateVersion[] $updateVersions */ diff --git a/wcfsetup/install/files/lib/data/package/update/server/PackageUpdateServer.class.php b/wcfsetup/install/files/lib/data/package/update/server/PackageUpdateServer.class.php index 07698a9982..203feede0f 100644 --- a/wcfsetup/install/files/lib/data/package/update/server/PackageUpdateServer.class.php +++ b/wcfsetup/install/files/lib/data/package/update/server/PackageUpdateServer.class.php @@ -407,18 +407,18 @@ class PackageUpdateServer extends DatabaseObject public static function resetAll(): void { // purge package cache - WCF::getDB()->prepareStatement("DELETE FROM wcf" . WCF_N . "_package_update")->execute(); + WCF::getDB()->prepare("DELETE FROM wcf1_package_update")->execute(); PackageUpdateCacheBuilder::getInstance()->reset(); // reset servers into their original state - $sql = "UPDATE wcf" . WCF_N . "_package_update_server + $sql = "UPDATE wcf1_package_update_server SET lastUpdateTime = ?, status = ?, errorMessage = ?, apiVersion = ?, metaData = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ 0, 'online', diff --git a/wcfsetup/install/files/lib/data/package/update/server/PackageUpdateServerList.class.php b/wcfsetup/install/files/lib/data/package/update/server/PackageUpdateServerList.class.php index cd4c66bcf9..fa4ca02247 100644 --- a/wcfsetup/install/files/lib/data/package/update/server/PackageUpdateServerList.class.php +++ b/wcfsetup/install/files/lib/data/package/update/server/PackageUpdateServerList.class.php @@ -34,7 +34,7 @@ class PackageUpdateServerList extends DatabaseObjectList } $this->sqlSelects .= "( SELECT COUNT(*) - FROM wcf" . WCF_N . "_package_update + FROM wcf1_package_update WHERE packageUpdateServerID = " . $this->getDatabaseTableAlias() . ".packageUpdateServerID ) AS packages"; diff --git a/wcfsetup/install/files/lib/data/page/Page.class.php b/wcfsetup/install/files/lib/data/page/Page.class.php index 347d1e1040..361dfec009 100644 --- a/wcfsetup/install/files/lib/data/page/Page.class.php +++ b/wcfsetup/install/files/lib/data/page/Page.class.php @@ -127,9 +127,9 @@ class Page extends DatabaseObject implements ILinkableObject, ITitledObject $this->pageContents = []; $sql = "SELECT * - FROM wcf" . WCF_N . "_page_content + FROM wcf1_page_content WHERE pageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->pageID]); while ($row = $statement->fetchArray()) { $this->pageContents[$row['languageID'] ?: 0] = new PageContent(null, $row); @@ -157,9 +157,9 @@ class Page extends DatabaseObject implements ILinkableObject, ITitledObject } $sql = "SELECT * - FROM wcf" . WCF_N . "_page_content + FROM wcf1_page_content " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql, 1); + $statement = WCF::getDB()->prepare($sql, 1); $statement->execute($conditions->getParameters()); $row = $statement->fetchSingleRow(); if ($row !== false) { @@ -285,10 +285,10 @@ class Page extends DatabaseObject implements ILinkableObject, ITitledObject } WCF::getDB()->beginTransaction(); - $sql = "UPDATE wcf" . WCF_N . "_application + $sql = "UPDATE wcf1_application SET landingPageID = ? WHERE packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $this->pageID, 1, @@ -317,9 +317,9 @@ class Page extends DatabaseObject implements ILinkableObject, ITitledObject { if ($this->boxIDs === null) { $sql = "SELECT boxID - FROM wcf" . WCF_N . "_box_to_page + FROM wcf1_box_to_page WHERE pageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->pageID]); $this->boxIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); } @@ -368,9 +368,9 @@ class Page extends DatabaseObject implements ILinkableObject, ITitledObject $this->pageLanguages = []; if ($this->isMultilingual) { $sql = "SELECT languageID - FROM wcf" . WCF_N . "_page_content + FROM wcf1_page_content WHERE pageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->pageID]); while ($languageID = $statement->fetchColumn()) { if (LanguageFactory::getInstance()->getLanguage($languageID) !== null) { @@ -403,9 +403,9 @@ class Page extends DatabaseObject implements ILinkableObject, ITitledObject public static function getPageByIdentifier($identifier) { $sql = "SELECT * - FROM wcf" . WCF_N . "_page + FROM wcf1_page WHERE identifier = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$identifier]); return $statement->fetchObject(self::class); @@ -420,9 +420,9 @@ class Page extends DatabaseObject implements ILinkableObject, ITitledObject public static function getPageByName($name) { $sql = "SELECT * - FROM wcf" . WCF_N . "_page + FROM wcf1_page WHERE name = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$name]); return $statement->fetchObject(self::class); diff --git a/wcfsetup/install/files/lib/data/page/PageAction.class.php b/wcfsetup/install/files/lib/data/page/PageAction.class.php index 88fc65f79c..a7eb85cb65 100644 --- a/wcfsetup/install/files/lib/data/page/PageAction.class.php +++ b/wcfsetup/install/files/lib/data/page/PageAction.class.php @@ -135,10 +135,10 @@ class PageAction extends AbstractDatabaseObjectAction implements ISearchAction, // save box to page assignments if (!empty($this->parameters['boxToPage'])) { - $sql = "INSERT INTO wcf" . WCF_N . "_box_to_page + $sql = "INSERT INTO wcf1_box_to_page (boxID, pageID, visible) VALUES (?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($this->parameters['boxToPage'] as $boxData) { $statement->execute([ @@ -265,14 +265,14 @@ class PageAction extends AbstractDatabaseObjectAction implements ISearchAction, // save box to page assignments if (isset($this->parameters['boxToPage'])) { - $sql = "DELETE FROM wcf" . WCF_N . "_box_to_page + $sql = "DELETE FROM wcf1_box_to_page WHERE pageID = ?"; - $deleteStatement = WCF::getDB()->prepareStatement($sql); + $deleteStatement = WCF::getDB()->prepare($sql); - $sql = "INSERT INTO wcf" . WCF_N . "_box_to_page + $sql = "INSERT INTO wcf1_box_to_page (boxID, pageID, visible) VALUES (?, ?, ?)"; - $insertStatement = WCF::getDB()->prepareStatement($sql); + $insertStatement = WCF::getDB()->prepare($sql); foreach ($this->getObjects() as $page) { $deleteStatement->execute([$page->pageID]); @@ -359,11 +359,11 @@ class PageAction extends AbstractDatabaseObjectAction implements ISearchAction, public function search() { $sql = "SELECT pageID - FROM wcf" . WCF_N . "_page + FROM wcf1_page WHERE name LIKE ? AND requireObjectID = ? ORDER BY name"; - $statement = WCF::getDB()->prepareStatement($sql, 5); + $statement = WCF::getDB()->prepare($sql, 5); $statement->execute([ '%' . $this->parameters['searchString'] . '%', 0, @@ -453,9 +453,9 @@ class PageAction extends AbstractDatabaseObjectAction implements ISearchAction, $conditions->add("boxID IN (?)", [$seenBoxIDs]); $sql = "SELECT boxID - FROM wcf" . WCF_N . "_box + FROM wcf1_box " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $validBoxIDs = []; while ($boxID = $statement->fetchColumn()) { @@ -476,15 +476,15 @@ class PageAction extends AbstractDatabaseObjectAction implements ISearchAction, { $pageID = $this->pageEditor->getDecoratedObject()->pageID; - $sql = "DELETE FROM wcf" . WCF_N . "_page_box_order + $sql = "DELETE FROM wcf1_page_box_order WHERE pageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$pageID]); - $sql = "INSERT INTO wcf" . WCF_N . "_page_box_order + $sql = "INSERT INTO wcf1_page_box_order (pageID, boxID, showOrder) VALUES (?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); foreach ($this->parameters['position'] as $boxIDs) { @@ -514,9 +514,9 @@ class PageAction extends AbstractDatabaseObjectAction implements ISearchAction, */ public function resetPosition() { - $sql = "DELETE FROM wcf" . WCF_N . "_page_box_order + $sql = "DELETE FROM wcf1_page_box_order WHERE pageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->pageEditor->getDecoratedObject()->pageID]); } } diff --git a/wcfsetup/install/files/lib/data/page/PageEditor.class.php b/wcfsetup/install/files/lib/data/page/PageEditor.class.php index 197b175767..de5c97ab3d 100644 --- a/wcfsetup/install/files/lib/data/page/PageEditor.class.php +++ b/wcfsetup/install/files/lib/data/page/PageEditor.class.php @@ -86,10 +86,10 @@ class PageEditor extends DatabaseObjectEditor implements IEditableCachedObject // check custom controller urls $sql = "SELECT COUNT(*) AS count - FROM wcf" . WCF_N . "_page + FROM wcf1_page WHERE controllerCustomURL = ? AND applicationPackageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$customURL, $packageID]); if ($statement->fetchSingleColumn()) { return false; @@ -97,14 +97,14 @@ class PageEditor extends DatabaseObjectEditor implements IEditableCachedObject // check custom urls $sql = "SELECT COUNT(*) AS count - FROM wcf" . WCF_N . "_page_content + FROM wcf1_page_content WHERE customURL = ? AND pageID IN ( SELECT pageID - FROM wcf" . WCF_N . "_page + FROM wcf1_page WHERE applicationPackageID = ? )"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$customURL, $packageID]); if ($statement->fetchSingleColumn()) { return false; diff --git a/wcfsetup/install/files/lib/data/page/content/PageContent.class.php b/wcfsetup/install/files/lib/data/page/content/PageContent.class.php index 78f1cb8450..0e9727d1ce 100644 --- a/wcfsetup/install/files/lib/data/page/content/PageContent.class.php +++ b/wcfsetup/install/files/lib/data/page/content/PageContent.class.php @@ -111,17 +111,17 @@ class PageContent extends DatabaseObject implements ITitledLinkObject { if ($languageID !== null) { $sql = "SELECT * - FROM wcf" . WCF_N . "_page_content + FROM wcf1_page_content WHERE pageID = ? AND languageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$pageID, $languageID]); } else { $sql = "SELECT * - FROM wcf" . WCF_N . "_page_content + FROM wcf1_page_content WHERE pageID = ? AND languageID IS NULL"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$pageID]); } diff --git a/wcfsetup/install/files/lib/data/paid/subscription/PaidSubscriptionEditor.class.php b/wcfsetup/install/files/lib/data/paid/subscription/PaidSubscriptionEditor.class.php index 51de2b32e0..e960759384 100644 --- a/wcfsetup/install/files/lib/data/paid/subscription/PaidSubscriptionEditor.class.php +++ b/wcfsetup/install/files/lib/data/paid/subscription/PaidSubscriptionEditor.class.php @@ -33,8 +33,8 @@ class PaidSubscriptionEditor extends DatabaseObjectEditor implements IEditableCa public function setShowOrder($showOrder = 0) { $sql = "SELECT MAX(showOrder) - FROM wcf" . WCF_N . "_paid_subscription"; - $statement = WCF::getDB()->prepareStatement($sql); + FROM wcf1_paid_subscription"; + $statement = WCF::getDB()->prepare($sql); $statement->execute(); $maxShowOrder = $statement->fetchSingleColumn(); if (!$maxShowOrder) { @@ -45,10 +45,10 @@ class PaidSubscriptionEditor extends DatabaseObjectEditor implements IEditableCa $newShowOrder = $maxShowOrder + 1; } else { // shift other subscriptions - $sql = "UPDATE wcf" . WCF_N . "_paid_subscription + $sql = "UPDATE wcf1_paid_subscription SET showOrder = showOrder + 1 WHERE showOrder >= ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $showOrder, ]); diff --git a/wcfsetup/install/files/lib/data/paid/subscription/transaction/log/PaidSubscriptionTransactionLog.class.php b/wcfsetup/install/files/lib/data/paid/subscription/transaction/log/PaidSubscriptionTransactionLog.class.php index ee5496faf6..acb0fed993 100644 --- a/wcfsetup/install/files/lib/data/paid/subscription/transaction/log/PaidSubscriptionTransactionLog.class.php +++ b/wcfsetup/install/files/lib/data/paid/subscription/transaction/log/PaidSubscriptionTransactionLog.class.php @@ -99,10 +99,10 @@ class PaidSubscriptionTransactionLog extends DatabaseObject public static function getLogByTransactionID($paymentMethodObjectTypeID, $transactionID) { $sql = "SELECT * - FROM wcf" . WCF_N . "_paid_subscription_transaction_log + FROM wcf1_paid_subscription_transaction_log WHERE paymentMethodObjectTypeID = ? AND transactionID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$paymentMethodObjectTypeID, $transactionID]); $row = $statement->fetchArray(); if ($row !== false) { diff --git a/wcfsetup/install/files/lib/data/paid/subscription/user/PaidSubscriptionUser.class.php b/wcfsetup/install/files/lib/data/paid/subscription/user/PaidSubscriptionUser.class.php index c3a5878806..b7128a6677 100644 --- a/wcfsetup/install/files/lib/data/paid/subscription/user/PaidSubscriptionUser.class.php +++ b/wcfsetup/install/files/lib/data/paid/subscription/user/PaidSubscriptionUser.class.php @@ -89,10 +89,10 @@ class PaidSubscriptionUser extends DatabaseObject public static function getSubscriptionUser($subscriptionID, $userID) { $sql = "SELECT * - FROM wcf" . WCF_N . "_paid_subscription_user + FROM wcf1_paid_subscription_user WHERE subscriptionID = ? AND userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$subscriptionID, $userID]); $row = $statement->fetchArray(); if ($row !== false) { diff --git a/wcfsetup/install/files/lib/data/poll/PollAction.class.php b/wcfsetup/install/files/lib/data/poll/PollAction.class.php index 5b182596f7..b6edba8ff2 100644 --- a/wcfsetup/install/files/lib/data/poll/PollAction.class.php +++ b/wcfsetup/install/files/lib/data/poll/PollAction.class.php @@ -55,10 +55,10 @@ class PollAction extends AbstractDatabaseObjectAction implements IGroupedUserLis $poll = parent::create(); // create options - $sql = "INSERT INTO wcf" . WCF_N . "_poll_option + $sql = "INSERT INTO wcf1_poll_option (pollID, optionValue, showOrder) VALUES (?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); foreach ($this->parameters['options'] as $showOrder => $option) { @@ -117,10 +117,10 @@ class PollAction extends AbstractDatabaseObjectAction implements IGroupedUserLis // check if new options should be created if (!empty($newOptions)) { - $sql = "INSERT INTO wcf" . WCF_N . "_poll_option + $sql = "INSERT INTO wcf1_poll_option (pollID, optionValue, showOrder) VALUES (?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($newOptions as $option) { $statement->execute([ $pollEditor->pollID, @@ -132,11 +132,11 @@ class PollAction extends AbstractDatabaseObjectAction implements IGroupedUserLis // check if existing options should be updated if (!empty($updateOptions)) { - $sql = "UPDATE wcf" . WCF_N . "_poll_option + $sql = "UPDATE wcf1_poll_option SET optionValue = ?, showOrder = ? WHERE optionID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($updateOptions as $optionID => $option) { $statement->execute([ $option['optionValue'], @@ -148,9 +148,9 @@ class PollAction extends AbstractDatabaseObjectAction implements IGroupedUserLis // check if options should be removed if (!empty($options)) { - $sql = "DELETE FROM wcf" . WCF_N . "_poll_option + $sql = "DELETE FROM wcf1_poll_option WHERE optionID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($options as $option) { $statement->execute([$option->optionID]); } @@ -396,10 +396,10 @@ class PollAction extends AbstractDatabaseObjectAction implements IGroupedUserLis { // get options $sql = "SELECT optionID, optionValue - FROM wcf" . WCF_N . "_poll_option + FROM wcf1_poll_option WHERE pollID = ? ORDER BY " . ($this->poll->sortByVotes ? "votes DESC" : "showOrder ASC"); - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->poll->pollID]); $options = []; while ($row = $statement->fetchArray()) { @@ -408,9 +408,9 @@ class PollAction extends AbstractDatabaseObjectAction implements IGroupedUserLis // get votes $sql = "SELECT userID, optionID - FROM wcf" . WCF_N . "_poll_option_vote + FROM wcf1_poll_option_vote WHERE pollID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->poll->pollID]); $voteData = $statement->fetchMap('optionID', 'userID', false); @@ -452,10 +452,10 @@ class PollAction extends AbstractDatabaseObjectAction implements IGroupedUserLis // get poll $sql = "SELECT * - FROM wcf" . WCF_N . "_poll + FROM wcf1_poll WHERE objectTypeID = ? AND objectID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $sourceObjectType->objectTypeID, $this->parameters['sourceObjectID'], @@ -501,12 +501,12 @@ class PollAction extends AbstractDatabaseObjectAction implements IGroupedUserLis // copy votes WCF::getDB()->beginTransaction(); foreach ($newOptionIDs as $oldOptionID => $newOptionID) { - $sql = "INSERT INTO wcf" . WCF_N . "_poll_option_vote + $sql = "INSERT INTO wcf1_poll_option_vote (pollID, optionID, userID) SELECT " . $newPoll->pollID . ", " . $newOptionID . ", userID - FROM wcf" . WCF_N . "_poll_option_vote + FROM wcf1_poll_option_vote WHERE optionID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$oldOptionID]); } WCF::getDB()->commitTransaction(); diff --git a/wcfsetup/install/files/lib/data/poll/PollEditor.class.php b/wcfsetup/install/files/lib/data/poll/PollEditor.class.php index adb2cb72ba..38b433d6c2 100644 --- a/wcfsetup/install/files/lib/data/poll/PollEditor.class.php +++ b/wcfsetup/install/files/lib/data/poll/PollEditor.class.php @@ -29,25 +29,25 @@ class PollEditor extends DatabaseObjectEditor public function calculateVotes() { // update option votes - $sql = "UPDATE wcf" . WCF_N . "_poll_option poll_option + $sql = "UPDATE wcf1_poll_option poll_option SET poll_option.votes = ( SELECT COUNT(*) - FROM wcf" . WCF_N . "_poll_option_vote + FROM wcf1_poll_option_vote WHERE optionID = poll_option.optionID ) WHERE poll_option.pollID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->pollID]); // update total count - $sql = "UPDATE wcf" . WCF_N . "_poll poll + $sql = "UPDATE wcf1_poll poll SET poll.votes = ( SELECT COUNT(DISTINCT userID) - FROM wcf" . WCF_N . "_poll_option_vote + FROM wcf1_poll_option_vote WHERE pollID = poll.pollID ) WHERE poll.pollID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->pollID]); } @@ -56,10 +56,10 @@ class PollEditor extends DatabaseObjectEditor */ public function increaseVotes() { - $sql = "UPDATE wcf" . WCF_N . "_poll + $sql = "UPDATE wcf1_poll SET votes = votes + 1 WHERE pollID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->pollID]); } } diff --git a/wcfsetup/install/files/lib/data/reaction/ReactionAction.class.php b/wcfsetup/install/files/lib/data/reaction/ReactionAction.class.php index 9179012e63..fc75cc6af0 100644 --- a/wcfsetup/install/files/lib/data/reaction/ReactionAction.class.php +++ b/wcfsetup/install/files/lib/data/reaction/ReactionAction.class.php @@ -308,10 +308,10 @@ class ReactionAction extends AbstractDatabaseObjectAction // get like object $sql = "SELECT * - FROM wcf" . WCF_N . "_like_object + FROM wcf1_like_object WHERE objectTypeID = ? AND objectID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $sourceObjectType->objectTypeID, $this->parameters['sourceObjectID'], @@ -332,13 +332,13 @@ class ReactionAction extends AbstractDatabaseObjectAction // step 2) copy // - $sql = "INSERT INTO wcf" . WCF_N . "_like + $sql = "INSERT INTO wcf1_like (objectID, objectTypeID, objectUserID, userID, time, likeValue, reactionTypeID) SELECT " . $this->parameters['targetObjectID'] . ", " . $targetObjectType->objectTypeID . ", objectUserID, userID, time, likeValue, reactionTypeID - FROM wcf" . WCF_N . "_like + FROM wcf1_like WHERE objectTypeID = ? AND objectID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $sourceObjectType->objectTypeID, $this->parameters['sourceObjectID'], @@ -350,10 +350,10 @@ class ReactionAction extends AbstractDatabaseObjectAction if ($newLikeObject->objectUserID) { $sql = "SELECT COUNT(*) as count - FROM wcf" . WCF_N . "_like + FROM wcf1_like WHERE objectTypeID = ? AND objectID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $targetObjectType->objectTypeID, $this->parameters['targetObjectID'], diff --git a/wcfsetup/install/files/lib/data/reaction/type/ReactionTypeAction.class.php b/wcfsetup/install/files/lib/data/reaction/type/ReactionTypeAction.class.php index 7100f160d0..8bb62098d1 100644 --- a/wcfsetup/install/files/lib/data/reaction/type/ReactionTypeAction.class.php +++ b/wcfsetup/install/files/lib/data/reaction/type/ReactionTypeAction.class.php @@ -48,10 +48,10 @@ class ReactionTypeAction extends AbstractDatabaseObjectAction implements ISortab public function create() { if (isset($this->parameters['data']['showOrder']) && $this->parameters['data']['showOrder'] !== null) { - $sql = "UPDATE wcf" . WCF_N . "_reaction_type + $sql = "UPDATE wcf1_reaction_type SET showOrder = showOrder + 1 WHERE showOrder >= ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $this->parameters['data']['showOrder'], ]); @@ -155,20 +155,20 @@ class ReactionTypeAction extends AbstractDatabaseObjectAction implements ISortab // update show order if (isset($this->parameters['data']['showOrder']) && $this->parameters['data']['showOrder'] !== null) { - $sql = "UPDATE wcf" . WCF_N . "_reaction_type + $sql = "UPDATE wcf1_reaction_type SET showOrder = showOrder + 1 WHERE showOrder >= ? AND reactionTypeID <> ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $this->parameters['data']['showOrder'], $object->reactionTypeID, ]); - $sql = "UPDATE wcf" . WCF_N . "_reaction_type + $sql = "UPDATE wcf1_reaction_type SET showOrder = showOrder - 1 WHERE showOrder > ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $object->showOrder, ]); @@ -228,10 +228,10 @@ class ReactionTypeAction extends AbstractDatabaseObjectAction implements ISortab { $returnValues = parent::delete(); - $sql = "UPDATE wcf" . WCF_N . "_reaction_type + $sql = "UPDATE wcf1_reaction_type SET showOrder = showOrder - 1 WHERE showOrder > ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($this->getObjects() as $object) { $statement->execute([ $object->showOrder, diff --git a/wcfsetup/install/files/lib/data/search/keyword/SearchKeywordAction.class.php b/wcfsetup/install/files/lib/data/search/keyword/SearchKeywordAction.class.php index 706d72ff0d..460b7d9b56 100644 --- a/wcfsetup/install/files/lib/data/search/keyword/SearchKeywordAction.class.php +++ b/wcfsetup/install/files/lib/data/search/keyword/SearchKeywordAction.class.php @@ -51,10 +51,10 @@ class SearchKeywordAction extends AbstractDatabaseObjectAction implements ISearc // find users $sql = "SELECT * - FROM wcf" . WCF_N . "_search_keyword + FROM wcf1_search_keyword WHERE keyword LIKE ? ORDER BY searches DESC"; - $statement = WCF::getDB()->prepareStatement($sql, 10); + $statement = WCF::getDB()->prepare($sql, 10); $statement->execute([$this->parameters['data']['searchString'] . '%']); while ($row = $statement->fetchArray()) { $list[] = [ @@ -72,12 +72,12 @@ class SearchKeywordAction extends AbstractDatabaseObjectAction implements ISearc */ public function registerSearch() { - $sql = "INSERT INTO wcf" . WCF_N . "_search_keyword + $sql = "INSERT INTO wcf1_search_keyword (keyword, searches, lastSearchTime) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE searches = searches + VALUES(searches), lastSearchTime = VALUES(lastSearchTime)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ \mb_substr($this->parameters['data']['keyword'], 0, 191), ($this->parameters['data']['searches'] ?? 1), diff --git a/wcfsetup/install/files/lib/data/stat/daily/StatDailyAction.class.php b/wcfsetup/install/files/lib/data/stat/daily/StatDailyAction.class.php index 53dbdcd847..f291189ed6 100644 --- a/wcfsetup/install/files/lib/data/stat/daily/StatDailyAction.class.php +++ b/wcfsetup/install/files/lib/data/stat/daily/StatDailyAction.class.php @@ -83,32 +83,32 @@ class StatDailyAction extends AbstractDatabaseObjectAction $limit = 0; if ($this->parameters['dateGrouping'] == 'yearly') { $sql = "SELECT MIN(date) AS date, SUM(counter) AS counter, MAX(total) AS total, objectTypeID - FROM wcf" . WCF_N . "_stat_daily + FROM wcf1_stat_daily " . $conditionBuilder . " GROUP BY EXTRACT(YEAR FROM date), objectTypeID ORDER BY date"; } elseif ($this->parameters['dateGrouping'] == 'monthly') { $sql = "SELECT MIN(date) AS date, SUM(counter) AS counter, MAX(total) AS total, objectTypeID - FROM wcf" . WCF_N . "_stat_daily + FROM wcf1_stat_daily " . $conditionBuilder . " GROUP BY EXTRACT(YEAR_MONTH FROM date), objectTypeID ORDER BY date"; } elseif ($this->parameters['dateGrouping'] == 'weekly') { $sql = "SELECT MIN(date) AS date, SUM(counter) AS counter, MAX(total) AS total, objectTypeID - FROM wcf" . WCF_N . "_stat_daily + FROM wcf1_stat_daily " . $conditionBuilder . " GROUP BY EXTRACT(YEAR FROM date), EXTRACT(WEEK FROM date), objectTypeID ORDER BY date"; $limit = 260; } else { $sql = "SELECT * - FROM wcf" . WCF_N . "_stat_daily + FROM wcf1_stat_daily " . $conditionBuilder . " ORDER BY date"; $limit = 365; } - $statement = WCF::getDB()->prepareStatement($sql, $limit); + $statement = WCF::getDB()->prepare($sql, $limit); $statement->execute($conditionBuilder->getParameters()); while ($row = $statement->fetchArray()) { $value = $row['counter']; diff --git a/wcfsetup/install/files/lib/data/style/Style.class.php b/wcfsetup/install/files/lib/data/style/Style.class.php index 536e624734..af31c0b97e 100644 --- a/wcfsetup/install/files/lib/data/style/Style.class.php +++ b/wcfsetup/install/files/lib/data/style/Style.class.php @@ -189,12 +189,12 @@ class Style extends DatabaseObject } $sql = "SELECT variable.variableName, variable.defaultValue, variable.defaultValueDarkMode, value.variableValue, value.variableValueDarkMode - FROM wcf" . WCF_N . "_style_variable variable - LEFT JOIN wcf" . WCF_N . "_style_variable_value value + FROM wcf1_style_variable variable + LEFT JOIN wcf1_style_variable_value value ON value.variableID = variable.variableID AND value.styleID = ? ORDER BY variable.variableID ASC"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->styleID]); while ($row = $statement->fetchArray()) { $variableName = $row['variableName']; diff --git a/wcfsetup/install/files/lib/data/style/StyleAction.class.php b/wcfsetup/install/files/lib/data/style/StyleAction.class.php index 1f15ff8cb9..3b26cef541 100644 --- a/wcfsetup/install/files/lib/data/style/StyleAction.class.php +++ b/wcfsetup/install/files/lib/data/style/StyleAction.class.php @@ -539,10 +539,10 @@ BROWSERCONFIG; { // get unique style name $sql = "SELECT styleName - FROM wcf" . WCF_N . "_style + FROM wcf1_style WHERE styleName LIKE ? AND styleID <> ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $this->styleEditor->styleName . '%', $this->styleEditor->styleID, @@ -589,18 +589,18 @@ BROWSERCONFIG; $styleDescription = 'wcf.style.styleDescription' . $newStyle->styleID; // delete any phrases that were the result of an import - $sql = "DELETE FROM wcf" . WCF_N . "_language_item + $sql = "DELETE FROM wcf1_language_item WHERE languageItem = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$styleDescription]); // copy language items - $sql = "INSERT INTO wcf" . WCF_N . "_language_item + $sql = "INSERT INTO wcf1_language_item (languageID, languageItem, languageItemValue, languageItemOriginIsSystem, languageCategoryID, packageID) SELECT languageID, '" . $styleDescription . "', languageItemValue, 0, languageCategoryID, packageID - FROM wcf" . WCF_N . "_language_item + FROM wcf1_language_item WHERE languageItem = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$newStyle->styleDescription]); // update style description diff --git a/wcfsetup/install/files/lib/data/style/StyleEditor.class.php b/wcfsetup/install/files/lib/data/style/StyleEditor.class.php index 8161861fe4..861a5557f6 100644 --- a/wcfsetup/install/files/lib/data/style/StyleEditor.class.php +++ b/wcfsetup/install/files/lib/data/style/StyleEditor.class.php @@ -115,9 +115,9 @@ final class StyleEditor extends DatabaseObjectEditor implements IEditableCachedO } // delete language items - $sql = "DELETE FROM wcf" . WCF_N . "_language_item + $sql = "DELETE FROM wcf1_language_item WHERE languageItem = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(['wcf.style.styleDescription' . $this->styleID]); } @@ -168,10 +168,10 @@ final class StyleEditor extends DatabaseObjectEditor implements IEditableCachedO public function setAsDefault() { // remove old default - $sql = "UPDATE wcf" . WCF_N . "_style + $sql = "UPDATE wcf1_style SET isDefault = ? WHERE isDefault = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([0, 1]); // set new default @@ -205,13 +205,13 @@ final class StyleEditor extends DatabaseObjectEditor implements IEditableCachedO public function getImplicitVariables() { $sql = "SELECT variable.variableName - FROM wcf" . WCF_N . "_style_variable variable - LEFT JOIN wcf" . WCF_N . "_style_variable_value variable_value + FROM wcf1_style_variable variable + LEFT JOIN wcf1_style_variable_value variable_value ON variable_value.variableID = variable.variableID AND variable_value.styleID = ? WHERE variable.variableName LIKE ? AND variable_value.variableValue IS NULL"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $this->styleID, 'wcf%', @@ -497,9 +497,9 @@ final class StyleEditor extends DatabaseObjectEditor implements IEditableCachedO $i = 1; while (true) { $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_template_group + FROM wcf1_template_group WHERE templateGroupName = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$templateGroupName]); if (!$statement->fetchSingleColumn()) { break; @@ -512,9 +512,9 @@ final class StyleEditor extends DatabaseObjectEditor implements IEditableCachedO $i = 1; while (true) { $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_template_group + FROM wcf1_template_group WHERE templateGroupFolderName = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ FileUtil::addTrailingSlash($templateGroupFolderName), ]); @@ -576,10 +576,10 @@ final class StyleEditor extends DatabaseObjectEditor implements IEditableCachedO foreach ($packageToTemplates as $package => $templates) { // try to find package $sql = "SELECT * - FROM wcf" . WCF_N . "_package + FROM wcf1_package WHERE package = ? AND isApplication = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $package, 1, @@ -838,10 +838,10 @@ final class StyleEditor extends DatabaseObjectEditor implements IEditableCachedO protected static function saveLocalizedDescriptions(self $styleEditor, array $descriptions) { // localize package information - $sql = "REPLACE INTO wcf" . WCF_N . "_language_item + $sql = "REPLACE INTO wcf1_language_item (languageID, languageItem, languageItemValue, languageCategoryID, packageID) VALUES (?, ?, ?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); // get language list $languageList = new LanguageList(); @@ -850,9 +850,9 @@ final class StyleEditor extends DatabaseObjectEditor implements IEditableCachedO // workaround for WCFSetup if (!PACKAGE_ID) { $sql = "SELECT * - FROM wcf" . WCF_N . "_language_category + FROM wcf1_language_category WHERE languageCategory = ?"; - $statement2 = WCF::getDB()->prepareStatement($sql); + $statement2 = WCF::getDB()->prepare($sql); $statement2->execute(['wcf.style']); $languageCategory = $statement2->fetchObject(LanguageCategory::class); } else { @@ -941,11 +941,11 @@ final class StyleEditor extends DatabaseObjectEditor implements IEditableCachedO // fetch style description $sql = "SELECT language.languageCode, language_item.languageItemValue - FROM wcf" . WCF_N . "_language_item language_item - LEFT JOIN wcf" . WCF_N . "_language language + FROM wcf1_language_item language_item + LEFT JOIN wcf1_language language ON language.languageID = language_item.languageID WHERE language_item.languageItem = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->styleDescription]); $styleDescriptions = $statement->fetchMap('languageCode', 'languageItemValue'); @@ -1071,11 +1071,11 @@ final class StyleEditor extends DatabaseObjectEditor implements IEditableCachedO // append templates to tar // get templates $sql = "SELECT template.*, package.package - FROM wcf" . WCF_N . "_template template - LEFT JOIN wcf" . WCF_N . "_package package + FROM wcf1_template template + LEFT JOIN wcf1_package package ON package.packageID = template.packageID WHERE template.templateGroupID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->templateGroupID]); while ($row = $statement->fetchArray()) { $packageDir = 'com.woltlab.wcf'; @@ -1308,9 +1308,9 @@ final class StyleEditor extends DatabaseObjectEditor implements IEditableCachedO // check if no default style is defined $sql = "SELECT styleID - FROM wcf" . WCF_N . "_style + FROM wcf1_style WHERE isDefault = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([1]); $row = $statement->fetchArray(); diff --git a/wcfsetup/install/files/lib/data/tag/Tag.class.php b/wcfsetup/install/files/lib/data/tag/Tag.class.php index 955e90071d..6d6f2d2a70 100644 --- a/wcfsetup/install/files/lib/data/tag/Tag.class.php +++ b/wcfsetup/install/files/lib/data/tag/Tag.class.php @@ -31,10 +31,10 @@ class Tag extends DatabaseObject implements IRouteController public static function getTag($name, $languageID = 0) { $sql = "SELECT * - FROM wcf" . WCF_N . "_tag + FROM wcf1_tag WHERE languageID = ? AND name = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$languageID, $name]); return $statement->fetchObject(self::class); diff --git a/wcfsetup/install/files/lib/data/tag/TagAction.class.php b/wcfsetup/install/files/lib/data/tag/TagAction.class.php index 77167a6f08..cd0dfbb58b 100644 --- a/wcfsetup/install/files/lib/data/tag/TagAction.class.php +++ b/wcfsetup/install/files/lib/data/tag/TagAction.class.php @@ -89,9 +89,9 @@ class TagAction extends AbstractDatabaseObjectAction implements ISearchAction // find tags $sql = "SELECT tagID, name - FROM wcf" . WCF_N . "_tag + FROM wcf1_tag " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql, 5); + $statement = WCF::getDB()->prepare($sql, 5); $statement->execute($conditionBuilder->getParameters()); while ($row = $statement->fetchArray()) { $list[] = [ diff --git a/wcfsetup/install/files/lib/data/tag/TagEditor.class.php b/wcfsetup/install/files/lib/data/tag/TagEditor.class.php index 5a1692bbc2..617a9ff95b 100644 --- a/wcfsetup/install/files/lib/data/tag/TagEditor.class.php +++ b/wcfsetup/install/files/lib/data/tag/TagEditor.class.php @@ -35,16 +35,16 @@ class TagEditor extends DatabaseObjectEditor } // assign all associations for the synonym with this tag - $sql = "UPDATE IGNORE wcf" . WCF_N . "_tag_to_object + $sql = "UPDATE IGNORE wcf1_tag_to_object SET tagID = ? WHERE tagID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->tagID, $synonym->tagID]); // remove remaining associations (object was tagged with both tags => duplicate key previously ignored) - $sql = "DELETE FROM wcf" . WCF_N . "_tag_to_object + $sql = "DELETE FROM wcf1_tag_to_object WHERE tagID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$synonym->tagID]); $editor = new self($synonym); diff --git a/wcfsetup/install/files/lib/data/template/Template.class.php b/wcfsetup/install/files/lib/data/template/Template.class.php index a1a30af1ab..ebc4f89dd4 100644 --- a/wcfsetup/install/files/lib/data/template/Template.class.php +++ b/wcfsetup/install/files/lib/data/template/Template.class.php @@ -39,13 +39,13 @@ class Template extends DatabaseObject if ($id !== null) { $sql = "SELECT template.*, template_group.templateGroupFolderName, package.package - FROM wcf" . WCF_N . "_template template - LEFT JOIN wcf" . WCF_N . "_template_group template_group + FROM wcf1_template template + LEFT JOIN wcf1_template_group template_group ON template_group.templateGroupID = template.templateGroupID - LEFT JOIN wcf" . WCF_N . "_package package + LEFT JOIN wcf1_package package ON package.packageID = template.packageID WHERE template.templateID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$id]); $row = $statement->fetchArray(); diff --git a/wcfsetup/install/files/lib/data/template/TemplateEditor.class.php b/wcfsetup/install/files/lib/data/template/TemplateEditor.class.php index ace4f6c587..3370b9cd8a 100644 --- a/wcfsetup/install/files/lib/data/template/TemplateEditor.class.php +++ b/wcfsetup/install/files/lib/data/template/TemplateEditor.class.php @@ -72,9 +72,9 @@ class TemplateEditor extends DatabaseObjectEditor if ($templateGroupID != $this->templateGroupID) { // get folder name $sql = "SELECT templateGroupFolderName - FROM wcf" . WCF_N . "_template_group + FROM wcf1_template_group WHERE templateGroupID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$templateGroupID]); $row = $statement->fetchArray(); $this->object->data['templateGroupFolderName'] = $row['templateGroupFolderName']; @@ -98,9 +98,9 @@ class TemplateEditor extends DatabaseObjectEditor { $this->deleteFile(); - $sql = "DELETE FROM wcf" . WCF_N . "_template + $sql = "DELETE FROM wcf1_template WHERE templateID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->templateID]); } diff --git a/wcfsetup/install/files/lib/data/template/TemplateList.class.php b/wcfsetup/install/files/lib/data/template/TemplateList.class.php index 06694ba0d1..14d3356c77 100644 --- a/wcfsetup/install/files/lib/data/template/TemplateList.class.php +++ b/wcfsetup/install/files/lib/data/template/TemplateList.class.php @@ -33,9 +33,9 @@ class TemplateList extends DatabaseObjectList $this->sqlSelects = 'package.package, template_group.templateGroupFolderName'; $this->sqlJoins = " - LEFT JOIN wcf" . WCF_N . "_package package + LEFT JOIN wcf1_package package ON package.packageID = template.packageID - LEFT JOIN wcf" . WCF_N . "_template_group template_group + LEFT JOIN wcf1_template_group template_group ON template_group.templateGroupID = template.templateGroupID"; } } diff --git a/wcfsetup/install/files/lib/data/template/group/TemplateGroup.class.php b/wcfsetup/install/files/lib/data/template/group/TemplateGroup.class.php index 1e218826f0..c3e2e90c05 100644 --- a/wcfsetup/install/files/lib/data/template/group/TemplateGroup.class.php +++ b/wcfsetup/install/files/lib/data/template/group/TemplateGroup.class.php @@ -84,9 +84,9 @@ class TemplateGroup extends DatabaseObject implements ITitledObject self::$templateGroupStructure = []; $sql = "SELECT * - FROM wcf" . WCF_N . "_template_group + FROM wcf1_template_group ORDER BY templateGroupName ASC"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(); while ($row = $statement->fetchArray()) { self::$templateGroupStructure[$row['parentTemplateGroupID'] ?: 0][] = new self(null, $row); diff --git a/wcfsetup/install/files/lib/data/template/group/TemplateGroupAction.class.php b/wcfsetup/install/files/lib/data/template/group/TemplateGroupAction.class.php index 12ad7aa044..34f99aacd9 100644 --- a/wcfsetup/install/files/lib/data/template/group/TemplateGroupAction.class.php +++ b/wcfsetup/install/files/lib/data/template/group/TemplateGroupAction.class.php @@ -69,9 +69,9 @@ class TemplateGroupAction extends AbstractDatabaseObjectAction // validate name $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_template_group + FROM wcf1_template_group WHERE templateGroupName = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->parameters['templateGroupName']]); if ($statement->fetchSingleColumn()) { @@ -84,9 +84,9 @@ class TemplateGroupAction extends AbstractDatabaseObjectAction } $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_template_group + FROM wcf1_template_group WHERE templateGroupFolderName = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->parameters['templateGroupFolderName']]); if ($statement->fetchSingleColumn()) { diff --git a/wcfsetup/install/files/lib/data/template/group/TemplateGroupEditor.class.php b/wcfsetup/install/files/lib/data/template/group/TemplateGroupEditor.class.php index c1aea48939..76ea1d9e5f 100644 --- a/wcfsetup/install/files/lib/data/template/group/TemplateGroupEditor.class.php +++ b/wcfsetup/install/files/lib/data/template/group/TemplateGroupEditor.class.php @@ -43,10 +43,10 @@ class TemplateGroupEditor extends DatabaseObjectEditor implements IEditableCache // check template group folders in other applications $sql = "SELECT DISTINCT application - FROM wcf" . WCF_N . "_template + FROM wcf1_template WHERE templateGroupID = ? AND application <> ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->templateGroupID, 'wcf']); while ($row = $statement->fetchArray()) { $application = ApplicationHandler::getInstance()->getApplication($row['application']); @@ -87,10 +87,10 @@ class TemplateGroupEditor extends DatabaseObjectEditor implements IEditableCache // check template group folders in other applications $sql = "SELECT DISTINCT application - FROM wcf" . WCF_N . "_template + FROM wcf1_template WHERE templateGroupID = ? AND application <> ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->templateGroupID, 'wcf']); while ($row = $statement->fetchArray()) { $application = ApplicationHandler::getInstance()->getApplication($row['application']); diff --git a/wcfsetup/install/files/lib/data/trophy/TrophyAction.class.php b/wcfsetup/install/files/lib/data/trophy/TrophyAction.class.php index 0b07345605..73b32a6a6a 100644 --- a/wcfsetup/install/files/lib/data/trophy/TrophyAction.class.php +++ b/wcfsetup/install/files/lib/data/trophy/TrophyAction.class.php @@ -85,9 +85,9 @@ class TrophyAction extends AbstractDatabaseObjectAction implements IToggleAction $userTrophyList->sqlJoins .= ' '; } $userTrophyList->sqlJoins .= ' - LEFT JOIN wcf' . WCF_N . '_trophy trophy + LEFT JOIN wcf1_trophy trophy ON user_trophy.trophyID = trophy.trophyID - LEFT JOIN wcf' . WCF_N . '_category category + LEFT JOIN wcf1_category category ON trophy.categoryID = category.categoryID'; $userTrophyList->getConditionBuilder()->add('trophy.isDisabled = ?', [0]); @@ -152,19 +152,19 @@ class TrophyAction extends AbstractDatabaseObjectAction implements IToggleAction if (!empty($disabledTrophyIDs)) { $conditionBuilder = new PreparedStatementConditionBuilder(); $conditionBuilder->add('trophyID IN (?)', [$disabledTrophyIDs]); - $sql = "DELETE FROM wcf" . WCF_N . "_user_special_trophy + $sql = "DELETE FROM wcf1_user_special_trophy " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); // update trophy points $conditionBuilder = new PreparedStatementConditionBuilder(); $conditionBuilder->add('trophyID IN (?)', [$disabledTrophyIDs]); $sql = "SELECT COUNT(*) as count, userID - FROM wcf" . WCF_N . "_user_trophy + FROM wcf1_user_trophy " . $conditionBuilder . " GROUP BY userID"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); while ($row = $statement->fetchArray()) { @@ -182,10 +182,10 @@ class TrophyAction extends AbstractDatabaseObjectAction implements IToggleAction $conditionBuilder = new PreparedStatementConditionBuilder(); $conditionBuilder->add('trophyID IN (?)', [$enabledTrophyIDs]); $sql = "SELECT COUNT(*) as count, userID - FROM wcf" . WCF_N . "_user_trophy + FROM wcf1_user_trophy " . $conditionBuilder . " GROUP BY userID"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); while ($row = $statement->fetchArray()) { @@ -340,10 +340,10 @@ class TrophyAction extends AbstractDatabaseObjectAction implements IToggleAction */ public function updatePosition() { - $sql = "UPDATE wcf" . WCF_N . "_trophy + $sql = "UPDATE wcf1_trophy SET showOrder = ? WHERE trophyID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $showOrder = $this->parameters['data']['offset']; WCF::getDB()->beginTransaction(); diff --git a/wcfsetup/install/files/lib/data/trophy/TrophyEditor.class.php b/wcfsetup/install/files/lib/data/trophy/TrophyEditor.class.php index 2043932992..0910510982 100644 --- a/wcfsetup/install/files/lib/data/trophy/TrophyEditor.class.php +++ b/wcfsetup/install/files/lib/data/trophy/TrophyEditor.class.php @@ -31,8 +31,8 @@ class TrophyEditor extends DatabaseObjectEditor implements IEditableCachedObject public function setShowOrder($showOrder = 0) { $sql = "SELECT MAX(showOrder) - FROM wcf" . WCF_N . "_trophy"; - $statement = WCF::getDB()->prepareStatement($sql); + FROM wcf1_trophy"; + $statement = WCF::getDB()->prepare($sql); $statement->execute(); $maxShowOrder = $statement->fetchSingleColumn(); if (!$maxShowOrder) { @@ -43,10 +43,10 @@ class TrophyEditor extends DatabaseObjectEditor implements IEditableCachedObject $newShowOrder = $maxShowOrder + 1; } else { // shift other trophies - $sql = "UPDATE wcf" . WCF_N . "_trophy + $sql = "UPDATE wcf1_trophy SET showOrder = showOrder + 1 WHERE showOrder >= ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $showOrder, ]); diff --git a/wcfsetup/install/files/lib/data/unfurl/url/UnfurlUrl.class.php b/wcfsetup/install/files/lib/data/unfurl/url/UnfurlUrl.class.php index 585c135b26..e44bdc8559 100644 --- a/wcfsetup/install/files/lib/data/unfurl/url/UnfurlUrl.class.php +++ b/wcfsetup/install/files/lib/data/unfurl/url/UnfurlUrl.class.php @@ -56,11 +56,11 @@ class UnfurlUrl extends DatabaseObject { if ($id !== null) { $sql = "SELECT unfurl_url.*, unfurl_url_image.* - FROM wcf" . WCF_N . "_unfurl_url unfurl_url - LEFT JOIN wcf" . WCF_N . "_unfurl_url_image unfurl_url_image + FROM wcf1_unfurl_url unfurl_url + LEFT JOIN wcf1_unfurl_url_image unfurl_url_image ON unfurl_url_image.imageID = unfurl_url.imageID WHERE unfurl_url.urlID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$id]); $row = $statement->fetchArray(); @@ -171,11 +171,11 @@ class UnfurlUrl extends DatabaseObject } $sql = "SELECT unfurl_url.*, unfurl_url_image.* - FROM wcf" . WCF_N . "_unfurl_url unfurl_url - LEFT JOIN wcf" . WCF_N . "_unfurl_url_image unfurl_url_image + FROM wcf1_unfurl_url unfurl_url + LEFT JOIN wcf1_unfurl_url_image unfurl_url_image ON unfurl_url_image.imageID = unfurl_url.imageID WHERE unfurl_url.urlHash = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([\sha1($url)]); $row = $statement->fetchArray(); if (!$row) { diff --git a/wcfsetup/install/files/lib/data/unfurl/url/UnfurlUrlAction.class.php b/wcfsetup/install/files/lib/data/unfurl/url/UnfurlUrlAction.class.php index 9b73cbc46d..c5160d5e88 100644 --- a/wcfsetup/install/files/lib/data/unfurl/url/UnfurlUrlAction.class.php +++ b/wcfsetup/install/files/lib/data/unfurl/url/UnfurlUrlAction.class.php @@ -69,13 +69,13 @@ class UnfurlUrlAction extends AbstractDatabaseObjectAction } // save object - $sql = "INSERT INTO wcf" . WCF_N . "_unfurl_url_image + $sql = "INSERT INTO wcf1_unfurl_url_image (" . $keys . ") VALUES (" . $values . ")"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($statementParameters); - return WCF::getDB()->getInsertID("wcf" . WCF_N . "_unfurl_url_image", "imageID"); + return WCF::getDB()->getInsertID("wcf1_unfurl_url_image", "imageID"); } /** diff --git a/wcfsetup/install/files/lib/data/unfurl/url/UnfurlUrlList.class.php b/wcfsetup/install/files/lib/data/unfurl/url/UnfurlUrlList.class.php index 562d1bded1..228fd02c3c 100644 --- a/wcfsetup/install/files/lib/data/unfurl/url/UnfurlUrlList.class.php +++ b/wcfsetup/install/files/lib/data/unfurl/url/UnfurlUrlList.class.php @@ -32,7 +32,7 @@ class UnfurlUrlList extends DatabaseObjectList } $this->sqlSelects .= "unfurl_url_image.*"; $this->sqlJoins .= " - LEFT JOIN wcf" . WCF_N . "_unfurl_url_image unfurl_url_image + LEFT JOIN wcf1_unfurl_url_image unfurl_url_image ON unfurl_url_image.imageID = unfurl_url.imageID"; } } diff --git a/wcfsetup/install/files/lib/data/user/TeamList.class.php b/wcfsetup/install/files/lib/data/user/TeamList.class.php index 62013a3365..8ca6a83284 100644 --- a/wcfsetup/install/files/lib/data/user/TeamList.class.php +++ b/wcfsetup/install/files/lib/data/user/TeamList.class.php @@ -27,11 +27,11 @@ class TeamList extends UserProfileList public function countObjects() { $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_user_group user_group, - wcf" . WCF_N . "_user_to_group user_to_group + FROM wcf1_user_group user_group, + wcf1_user_to_group user_to_group WHERE user_to_group.groupID = user_group.groupID AND user_group.showOnTeamPage = 1"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(); return $statement->fetchSingleColumn(); @@ -44,14 +44,14 @@ class TeamList extends UserProfileList { $this->objectIDs = []; $sql = "SELECT user_to_group.userID AS objectID - FROM wcf" . WCF_N . "_user_group user_group, - wcf" . WCF_N . "_user_to_group user_to_group - LEFT JOIN wcf" . WCF_N . "_user user_table + FROM wcf1_user_group user_group, + wcf1_user_to_group user_to_group + LEFT JOIN wcf1_user user_table ON user_table.userID = user_to_group.userID WHERE user_to_group.groupID = user_group.groupID AND user_group.showOnTeamPage = 1 ORDER BY user_group.priority DESC" . (!empty($this->sqlOrderBy) ? ", " . $this->sqlOrderBy : ''); - $statement = WCF::getDB()->prepareStatement($sql, $this->sqlLimit, $this->sqlOffset); + $statement = WCF::getDB()->prepare($sql, $this->sqlLimit, $this->sqlOffset); $statement->execute(); $this->objectIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); } @@ -64,14 +64,14 @@ class TeamList extends UserProfileList parent::readObjects(); $sql = "SELECT user_to_group.* - FROM wcf" . WCF_N . "_user_group user_group, - wcf" . WCF_N . "_user_to_group user_to_group - LEFT JOIN wcf" . WCF_N . "_user user_table + FROM wcf1_user_group user_group, + wcf1_user_to_group user_to_group + LEFT JOIN wcf1_user user_table ON user_table.userID = user_to_group.userID WHERE user_to_group.groupID = user_group.groupID AND user_group.showOnTeamPage = 1 ORDER BY user_group.priority DESC" . (!empty($this->sqlOrderBy) ? ", " . $this->sqlOrderBy : ''); - $statement = WCF::getDB()->prepareStatement($sql, $this->sqlLimit, $this->sqlOffset); + $statement = WCF::getDB()->prepare($sql, $this->sqlLimit, $this->sqlOffset); $statement->execute(); while ($row = $statement->fetchArray()) { if (!isset($this->teams[$row['groupID']])) { diff --git a/wcfsetup/install/files/lib/data/user/User.class.php b/wcfsetup/install/files/lib/data/user/User.class.php index 1d6d47b598..f3eecdfa3d 100644 --- a/wcfsetup/install/files/lib/data/user/User.class.php +++ b/wcfsetup/install/files/lib/data/user/User.class.php @@ -125,11 +125,11 @@ final class User extends DatabaseObject implements IPopoverObject, IRouteControl { if ($id !== null) { $sql = "SELECT user_option_value.*, user_table.* - FROM wcf" . WCF_N . "_user user_table - LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value + FROM wcf1_user user_table + LEFT JOIN wcf1_user_option_value user_option_value ON user_option_value.userID = user_table.userID WHERE user_table.userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$id]); $row = $statement->fetchArray(); @@ -216,9 +216,9 @@ final class User extends DatabaseObject implements IPopoverObject, IRouteControl // cache does not exist or is outdated if ($data === null || $skipCache) { $sql = "SELECT groupID - FROM wcf" . WCF_N . "_user_to_group + FROM wcf1_user_to_group WHERE userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->userID]); $this->groupIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); @@ -258,9 +258,9 @@ final class User extends DatabaseObject implements IPopoverObject, IRouteControl // cache does not exist or is outdated if ($data === null) { $sql = "SELECT languageID - FROM wcf" . WCF_N . "_user_to_language + FROM wcf1_user_to_language WHERE userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->userID]); $this->languageIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); @@ -345,11 +345,11 @@ final class User extends DatabaseObject implements IPopoverObject, IRouteControl public static function getUserByUsername($username) { $sql = "SELECT user_option_value.*, user_table.* - FROM wcf" . WCF_N . "_user user_table - LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value + FROM wcf1_user user_table + LEFT JOIN wcf1_user_option_value user_option_value ON user_option_value.userID = user_table.userID WHERE user_table.username = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$username]); $row = $statement->fetchArray(); if (!$row) { @@ -368,11 +368,11 @@ final class User extends DatabaseObject implements IPopoverObject, IRouteControl public static function getUserByEmail($email) { $sql = "SELECT user_option_value.*, user_table.* - FROM wcf" . WCF_N . "_user user_table - LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value + FROM wcf1_user user_table + LEFT JOIN wcf1_user_option_value user_option_value ON user_option_value.userID = user_table.userID WHERE user_table.email = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$email]); $row = $statement->fetchArray(); if (!$row) { @@ -391,11 +391,11 @@ final class User extends DatabaseObject implements IPopoverObject, IRouteControl public static function getUserByAuthData($authData) { $sql = "SELECT user_option_value.*, user_table.* - FROM wcf" . WCF_N . "_user user_table - LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value + FROM wcf1_user user_table + LEFT JOIN wcf1_user_option_value user_option_value ON user_option_value.userID = user_table.userID WHERE user_table.authData = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$authData]); $row = $statement->fetchArray(); if (!$row) { diff --git a/wcfsetup/install/files/lib/data/user/UserAction.class.php b/wcfsetup/install/files/lib/data/user/UserAction.class.php index 0b5e6ab1f4..7be5ec915b 100644 --- a/wcfsetup/install/files/lib/data/user/UserAction.class.php +++ b/wcfsetup/install/files/lib/data/user/UserAction.class.php @@ -107,9 +107,9 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio $conditions->add("userID IN (?)", [$this->objectIDs]); $sql = "SELECT DISTINCT groupID - FROM wcf" . WCF_N . "_user_to_group + FROM wcf1_user_to_group " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $groupIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); @@ -232,12 +232,12 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio $conditionBuilder = new PreparedStatementConditionBuilder(); $conditionBuilder->add('userID IN (?)', [$this->objectIDs]); - $sql = "UPDATE wcf" . WCF_N . "_user + $sql = "UPDATE wcf1_user SET banned = ?, banReason = ?, banExpires = ? " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute( \array_merge([ 1, @@ -261,11 +261,11 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio $conditionBuilder = new PreparedStatementConditionBuilder(); $conditionBuilder->add('userID IN (?)', [$this->objectIDs]); - $sql = "UPDATE wcf" . WCF_N . "_user + $sql = "UPDATE wcf1_user SET banned = ?, banExpires = ? " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute( \array_merge([ 0, @@ -303,12 +303,12 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio if (PACKAGE_ID) { // set default notifications - $sql = "INSERT INTO wcf" . WCF_N . "_user_notification_event_to_user + $sql = "INSERT INTO wcf1_user_notification_event_to_user (userID, eventID, mailNotificationType) SELECT ?, eventID, presetMailNotificationType - FROM wcf" . WCF_N . "_user_notification_event + FROM wcf1_user_notification_event WHERE preset = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$user->userID, 1]); // update user rank @@ -401,38 +401,38 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio WCF::getDB()->beginTransaction(); // update article - $sql = "UPDATE wcf" . WCF_N . "_article + $sql = "UPDATE wcf1_article SET username = ? WHERE userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$username, $userID]); // update comments - $sql = "UPDATE wcf" . WCF_N . "_comment + $sql = "UPDATE wcf1_comment SET username = ? WHERE userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$username, $userID]); // update comment responses - $sql = "UPDATE wcf" . WCF_N . "_comment_response + $sql = "UPDATE wcf1_comment_response SET username = ? WHERE userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$username, $userID]); // update media - $sql = "UPDATE wcf" . WCF_N . "_media + $sql = "UPDATE wcf1_media SET username = ? WHERE userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$username, $userID]); // update modification log - $sql = "UPDATE wcf" . WCF_N . "_modification_log + $sql = "UPDATE wcf1_modification_log SET username = ? WHERE userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$username, $userID]); WCF::getDB()->commitTransaction(); @@ -836,11 +836,11 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio // get objects $sql = "SELECT user_option_value.*, user_table.* - FROM wcf" . WCF_N . "_user user_table - LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value + FROM wcf1_user user_table + LEFT JOIN wcf1_user_option_value user_option_value ON user_option_value.userID = user_table.userID WHERE user_table.userID IN (" . \str_repeat('?,', \count($this->objectIDs) - 1) . "?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($this->objectIDs); while ($object = $statement->fetchObject($baseClass)) { $this->objects[] = new $this->className($object); diff --git a/wcfsetup/install/files/lib/data/user/UserEditor.class.php b/wcfsetup/install/files/lib/data/user/UserEditor.class.php index ef81052a58..a21dc933af 100644 --- a/wcfsetup/install/files/lib/data/user/UserEditor.class.php +++ b/wcfsetup/install/files/lib/data/user/UserEditor.class.php @@ -125,9 +125,9 @@ class UserEditor extends DatabaseObjectEditor implements IEditableCachedObject self::$userOptionDefaultValues = []; $sql = "SELECT optionID, defaultValue - FROM wcf" . WCF_N . "_user_option + FROM wcf1_user_option WHERE defaultValue IS NOT NULL"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(); while ($row = $statement->fetchArray()) { self::$userOptionDefaultValues[$row['optionID']] = $row['defaultValue']; @@ -143,10 +143,10 @@ class UserEditor extends DatabaseObjectEditor implements IEditableCachedObject $statementParameters[] = $optionValue; } - $sql = "INSERT INTO wcf" . WCF_N . "_user_option_value + $sql = "INSERT INTO wcf1_user_option_value (userID" . $keys . ") VALUES (?" . $values . ")"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($statementParameters); } @@ -170,10 +170,10 @@ class UserEditor extends DatabaseObjectEditor implements IEditableCachedObject $statementParameters[] = $this->userID; if (!empty($updateSQL)) { - $sql = "UPDATE wcf" . WCF_N . "_user_option_value + $sql = "UPDATE wcf1_user_option_value SET " . $updateSQL . " WHERE userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($statementParameters); } } @@ -193,18 +193,18 @@ class UserEditor extends DatabaseObjectEditor implements IEditableCachedObject // remove old groups if ($deleteOldGroups) { - $sql = "DELETE FROM wcf" . WCF_N . "_user_to_group + $sql = "DELETE FROM wcf1_user_to_group WHERE userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->userID]); } // insert new groups if (!empty($groupIDs)) { - $sql = "INSERT IGNORE INTO wcf" . WCF_N . "_user_to_group + $sql = "INSERT IGNORE INTO wcf1_user_to_group (userID, groupID) VALUES (?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($groupIDs as $groupID) { $statement->execute([$this->userID, $groupID]); } @@ -216,10 +216,10 @@ class UserEditor extends DatabaseObjectEditor implements IEditableCachedObject */ public function addToGroup(int $groupID): void { - $sql = "INSERT IGNORE INTO wcf" . WCF_N . "_user_to_group + $sql = "INSERT IGNORE INTO wcf1_user_to_group (userID, groupID) VALUES (?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->userID, $groupID]); } @@ -228,10 +228,10 @@ class UserEditor extends DatabaseObjectEditor implements IEditableCachedObject */ public function removeFromGroup(int $groupID): void { - $sql = "DELETE FROM wcf" . WCF_N . "_user_to_group + $sql = "DELETE FROM wcf1_user_to_group WHERE userID = ? AND groupID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->userID, $groupID]); } @@ -242,10 +242,10 @@ class UserEditor extends DatabaseObjectEditor implements IEditableCachedObject */ public function removeFromGroups(array $groupIDs): void { - $sql = "DELETE FROM wcf" . WCF_N . "_user_to_group + $sql = "DELETE FROM wcf1_user_to_group WHERE userID = ? AND groupID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($groupIDs as $groupID) { $statement->execute([ $this->userID, @@ -263,17 +263,17 @@ class UserEditor extends DatabaseObjectEditor implements IEditableCachedObject { // remove previous languages if ($deleteOldLanguages) { - $sql = "DELETE FROM wcf" . WCF_N . "_user_to_language + $sql = "DELETE FROM wcf1_user_to_language WHERE userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->userID]); } // insert language ids - $sql = "INSERT IGNORE INTO wcf" . WCF_N . "_user_to_language + $sql = "INSERT IGNORE INTO wcf1_user_to_language (userID, languageID) VALUES (?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); if (!empty($languageIDs)) { WCF::getDB()->beginTransaction(); diff --git a/wcfsetup/install/files/lib/data/user/UserList.class.php b/wcfsetup/install/files/lib/data/user/UserList.class.php index 86e7a81a2d..5dc3df47a1 100644 --- a/wcfsetup/install/files/lib/data/user/UserList.class.php +++ b/wcfsetup/install/files/lib/data/user/UserList.class.php @@ -36,7 +36,7 @@ class UserList extends DatabaseObjectList } $this->sqlSelects .= "user_option_value.*"; $this->sqlJoins .= " - LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value + LEFT JOIN wcf1_user_option_value user_option_value ON user_option_value.userID = user_table.userID"; } } diff --git a/wcfsetup/install/files/lib/data/user/UserProfile.class.php b/wcfsetup/install/files/lib/data/user/UserProfile.class.php index ba335761a8..9f25aa0a52 100644 --- a/wcfsetup/install/files/lib/data/user/UserProfile.class.php +++ b/wcfsetup/install/files/lib/data/user/UserProfile.class.php @@ -147,9 +147,9 @@ class UserProfile extends DatabaseObjectDecorator implements ITitledLinkObject // cache does not exist or is outdated if ($data === null) { $sql = "SELECT followUserID - FROM wcf" . WCF_N . "_user_follow + FROM wcf1_user_follow WHERE userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->userID]); $this->followingUserIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); @@ -185,9 +185,9 @@ class UserProfile extends DatabaseObjectDecorator implements ITitledLinkObject // cache does not exist or is outdated if ($data === null) { $sql = "SELECT userID - FROM wcf" . WCF_N . "_user_follow + FROM wcf1_user_follow WHERE followUserID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->userID]); $this->followerUserIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); @@ -224,9 +224,9 @@ class UserProfile extends DatabaseObjectDecorator implements ITitledLinkObject // cache does not exist or is outdated if ($data === null) { $sql = "SELECT ignoreUserID, type - FROM wcf" . WCF_N . "_user_ignore + FROM wcf1_user_ignore WHERE userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->userID]); $this->ignoredUserIDs = $statement->fetchMap('ignoreUserID', 'type'); @@ -272,9 +272,9 @@ class UserProfile extends DatabaseObjectDecorator implements ITitledLinkObject // cache does not exist or is outdated if ($data === null) { $sql = "SELECT userID, type - FROM wcf" . WCF_N . "_user_ignore + FROM wcf1_user_ignore WHERE ignoreUserID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->userID]); $this->ignoredByUserIDs = $statement->fetchMap('userID', 'type'); @@ -503,9 +503,9 @@ class UserProfile extends DatabaseObjectDecorator implements ITitledLinkObject if ($specialTrophies === null) { // load special trophies for the user $sql = "SELECT trophyID - FROM wcf" . WCF_N . "_user_special_trophy + FROM wcf1_user_special_trophy WHERE userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->userID]); $specialTrophies = $statement->fetchAll(\PDO::FETCH_COLUMN); @@ -527,9 +527,9 @@ class UserProfile extends DatabaseObjectDecorator implements ITitledLinkObject $conditionBuilder->add('trophyID IN (?)', [$trophyDeleteIDs]); // reset the user special trophies - $sql = "DELETE FROM wcf" . WCF_N . "_user_special_trophy + $sql = "DELETE FROM wcf1_user_special_trophy " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); UserStorageHandler::getInstance()->update($this->userID, 'specialTrophies', \serialize($specialTrophies)); @@ -587,9 +587,9 @@ class UserProfile extends DatabaseObjectDecorator implements ITitledLinkObject $conditionBuilder->add('userID IN (?)', [$rebuildUserIDs]); $sql = "SELECT userID, trophyID - FROM wcf" . WCF_N . "_user_special_trophy + FROM wcf1_user_special_trophy " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); $data = \array_combine($rebuildUserIDs, \array_fill(0, \count($rebuildUserIDs), [])); @@ -608,9 +608,9 @@ class UserProfile extends DatabaseObjectDecorator implements ITitledLinkObject $conditionBuilder->add('(userID = ? AND trophyID IN (?))', [$userID, $trophyIDs]); } - $sql = "DELETE FROM wcf" . WCF_N . "_user_special_trophy + $sql = "DELETE FROM wcf1_user_special_trophy " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); } } diff --git a/wcfsetup/install/files/lib/data/user/UserProfileAction.class.php b/wcfsetup/install/files/lib/data/user/UserProfileAction.class.php index cf700a79d6..c9b1116dad 100644 --- a/wcfsetup/install/files/lib/data/user/UserProfileAction.class.php +++ b/wcfsetup/install/files/lib/data/user/UserProfileAction.class.php @@ -146,9 +146,9 @@ class UserProfileAction extends UserAction $conditionBuilder->add('objectTypeID IN (?)', [\array_keys($activityPointObjectTypes)]); $sql = "SELECT objectTypeID, activityPoints, items - FROM wcf" . WCF_N . "_user_activity_point + FROM wcf1_user_activity_point " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); $entries = []; while ($row = $statement->fetchArray()) { @@ -350,12 +350,12 @@ class UserProfileAction extends UserAction } $sql = "SELECT user_rank.rankID - FROM wcf" . WCF_N . "_user_rank user_rank - LEFT JOIN wcf" . WCF_N . "_user_group user_group + FROM wcf1_user_rank user_rank + LEFT JOIN wcf1_user_group user_group ON user_group.groupID = user_rank.groupID " . $conditionBuilder . " ORDER BY user_group.priority DESC, user_rank.requiredPoints DESC, user_rank.requiredGender DESC"; - $statement = WCF::getDB()->prepareStatement($sql, 1); + $statement = WCF::getDB()->prepare($sql, 1); $statement->execute($conditionBuilder->getParameters()); $row = $statement->fetchArray(); if ($row === false) { @@ -370,10 +370,10 @@ class UserProfileAction extends UserAction } if (!empty($userToRank)) { - $sql = "UPDATE wcf" . WCF_N . "_user + $sql = "UPDATE wcf1_user SET rankID = ? WHERE userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); foreach ($userToRank as $userID => $rankID) { @@ -426,10 +426,10 @@ class UserProfileAction extends UserAction $conditionBuilder->add('groupID IN (?)', [$groupIDs]); $sql = "SELECT groupID - FROM wcf" . WCF_N . "_user_group + FROM wcf1_user_group " . $conditionBuilder . " ORDER BY priority DESC"; - $statement = WCF::getDB()->prepareStatement($sql, 1); + $statement = WCF::getDB()->prepare($sql, 1); $statement->execute($conditionBuilder->getParameters()); $row = $statement->fetchArray(); if ($row['groupID'] != $user->userOnlineGroupID) { @@ -439,10 +439,10 @@ class UserProfileAction extends UserAction // add users to missing default user groups if (!empty($fixUserGroupIDs)) { - $sql = "INSERT INTO wcf" . WCF_N . "_user_to_group + $sql = "INSERT INTO wcf1_user_to_group (userID, groupID) VALUES (?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); foreach ($fixUserGroupIDs as $userID => $groupIDs) { @@ -456,10 +456,10 @@ class UserProfileAction extends UserAction } if (!empty($userToGroup)) { - $sql = "UPDATE wcf" . WCF_N . "_user + $sql = "UPDATE wcf1_user SET userOnlineGroupID = ? WHERE userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); foreach ($userToGroup as $userID => $groupID) { @@ -481,14 +481,14 @@ class UserProfileAction extends UserAction $this->readObjects(); } - $sql = "DELETE FROM wcf" . WCF_N . "_user_special_trophy + $sql = "DELETE FROM wcf1_user_special_trophy WHERE userID = ?"; - $deleteStatement = WCF::getDB()->prepareStatement($sql); + $deleteStatement = WCF::getDB()->prepare($sql); - $sql = "INSERT INTO wcf" . WCF_N . "_user_special_trophy + $sql = "INSERT INTO wcf1_user_special_trophy (userID, trophyID) VALUES (?, ?)"; - $insertStatement = WCF::getDB()->prepareStatement($sql); + $insertStatement = WCF::getDB()->prepare($sql); foreach ($this->getObjects() as $user) { WCF::getDB()->beginTransaction(); diff --git a/wcfsetup/install/files/lib/data/user/UserProfileList.class.php b/wcfsetup/install/files/lib/data/user/UserProfileList.class.php index dcbf27e1a5..ebe37f6b37 100644 --- a/wcfsetup/install/files/lib/data/user/UserProfileList.class.php +++ b/wcfsetup/install/files/lib/data/user/UserProfileList.class.php @@ -39,13 +39,13 @@ class UserProfileList extends UserList } $this->sqlSelects .= "user_avatar.*"; $this->sqlJoins .= " - LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar + LEFT JOIN wcf1_user_avatar user_avatar ON user_avatar.avatarID = user_table.avatarID"; // get current location $this->sqlSelects .= ", session.pageID, session.pageObjectID, session.lastActivityTime AS sessionLastActivityTime"; $this->sqlJoins .= " - LEFT JOIN wcf" . WCF_N . "_session session + LEFT JOIN wcf1_session session ON session.userID = user_table.userID"; } diff --git a/wcfsetup/install/files/lib/data/user/authentication/failure/UserAuthenticationFailure.class.php b/wcfsetup/install/files/lib/data/user/authentication/failure/UserAuthenticationFailure.class.php index 36e7f481fb..4c4e57ec6b 100644 --- a/wcfsetup/install/files/lib/data/user/authentication/failure/UserAuthenticationFailure.class.php +++ b/wcfsetup/install/files/lib/data/user/authentication/failure/UserAuthenticationFailure.class.php @@ -42,10 +42,10 @@ class UserAuthenticationFailure extends DatabaseObject public static function countIPFailures($ipAddress) { $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_user_authentication_failure + FROM wcf1_user_authentication_failure WHERE ipAddress = ? AND time > ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$ipAddress, TIME_NOW - USER_AUTHENTICATION_FAILURE_TIMEOUT]); return $statement->fetchSingleColumn(); @@ -60,10 +60,10 @@ class UserAuthenticationFailure extends DatabaseObject public static function countUserFailures($userID) { $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_user_authentication_failure + FROM wcf1_user_authentication_failure WHERE userID = ? AND time > ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$userID, TIME_NOW - USER_AUTHENTICATION_FAILURE_TIMEOUT]); return $statement->fetchSingleColumn(); diff --git a/wcfsetup/install/files/lib/data/user/avatar/UserAvatarEditor.class.php b/wcfsetup/install/files/lib/data/user/avatar/UserAvatarEditor.class.php index a90f6401b2..f38fa1b7af 100644 --- a/wcfsetup/install/files/lib/data/user/avatar/UserAvatarEditor.class.php +++ b/wcfsetup/install/files/lib/data/user/avatar/UserAvatarEditor.class.php @@ -29,9 +29,9 @@ class UserAvatarEditor extends DatabaseObjectEditor */ public function delete() { - $sql = "DELETE FROM wcf" . WCF_N . "_user_avatar + $sql = "DELETE FROM wcf1_user_avatar WHERE avatarID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->avatarID]); $this->deleteFiles(); @@ -43,9 +43,9 @@ class UserAvatarEditor extends DatabaseObjectEditor public static function deleteAll(array $objectIDs = []) { $sql = "SELECT * - FROM wcf" . WCF_N . "_user_avatar + FROM wcf1_user_avatar WHERE avatarID IN (" . \str_repeat('?,', \count($objectIDs) - 1) . "?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($objectIDs); while ($avatar = $statement->fetchObject(self::$baseClass)) { $editor = new self($avatar); diff --git a/wcfsetup/install/files/lib/data/user/follow/UserFollow.class.php b/wcfsetup/install/files/lib/data/user/follow/UserFollow.class.php index 28efd7619b..ba5c08e6e9 100644 --- a/wcfsetup/install/files/lib/data/user/follow/UserFollow.class.php +++ b/wcfsetup/install/files/lib/data/user/follow/UserFollow.class.php @@ -29,10 +29,10 @@ class UserFollow extends DatabaseObject public static function getFollow($userID, $followUserID) { $sql = "SELECT followID - FROM wcf" . WCF_N . "_user_follow + FROM wcf1_user_follow WHERE userID = ? AND followUserID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $userID, $followUserID, diff --git a/wcfsetup/install/files/lib/data/user/follow/UserFollowAction.class.php b/wcfsetup/install/files/lib/data/user/follow/UserFollowAction.class.php index a14e7af2b8..ec208e570a 100644 --- a/wcfsetup/install/files/lib/data/user/follow/UserFollowAction.class.php +++ b/wcfsetup/install/files/lib/data/user/follow/UserFollowAction.class.php @@ -54,10 +54,10 @@ class UserFollowAction extends AbstractDatabaseObjectAction implements IGroupedU // check if current user is ignored by target user $sql = "SELECT ignoreID - FROM wcf" . WCF_N . "_user_ignore + FROM wcf1_user_ignore WHERE userID = ? AND ignoreUserID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $this->parameters['data']['userID'], WCF::getUser()->userID, @@ -184,17 +184,17 @@ class UserFollowAction extends AbstractDatabaseObjectAction implements IGroupedU { // resolve page count $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_user_follow + FROM wcf1_user_follow WHERE followUserID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->parameters['userID']]); $pageCount = \ceil($statement->fetchSingleColumn() / 20); // get user ids $sql = "SELECT userID - FROM wcf" . WCF_N . "_user_follow + FROM wcf1_user_follow WHERE followUserID = ?"; - $statement = WCF::getDB()->prepareStatement($sql, 20, ($this->parameters['pageNo'] - 1) * 20); + $statement = WCF::getDB()->prepare($sql, 20, ($this->parameters['pageNo'] - 1) * 20); $statement->execute([$this->parameters['userID']]); $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); diff --git a/wcfsetup/install/files/lib/data/user/follow/UserFollowerList.class.php b/wcfsetup/install/files/lib/data/user/follow/UserFollowerList.class.php index bdc62cf430..d98244c995 100644 --- a/wcfsetup/install/files/lib/data/user/follow/UserFollowerList.class.php +++ b/wcfsetup/install/files/lib/data/user/follow/UserFollowerList.class.php @@ -51,9 +51,9 @@ class UserFollowerList extends UserFollowList $this->sqlSelects .= ", user_avatar.*"; $this->sqlJoins .= " - LEFT JOIN wcf" . WCF_N . "_user user_table + LEFT JOIN wcf1_user user_table ON user_table.userID = user_follow.userID - LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar + LEFT JOIN wcf1_user_avatar user_avatar ON user_avatar.avatarID = user_table.avatarID"; } } diff --git a/wcfsetup/install/files/lib/data/user/follow/UserFollowingAction.class.php b/wcfsetup/install/files/lib/data/user/follow/UserFollowingAction.class.php index dbc793add2..f05236137a 100644 --- a/wcfsetup/install/files/lib/data/user/follow/UserFollowingAction.class.php +++ b/wcfsetup/install/files/lib/data/user/follow/UserFollowingAction.class.php @@ -50,17 +50,17 @@ class UserFollowingAction extends UserFollowAction { // resolve page count $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_user_follow + FROM wcf1_user_follow WHERE userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->parameters['userID']]); $pageCount = \ceil($statement->fetchSingleColumn() / 20); // get user ids $sql = "SELECT followUserID - FROM wcf" . WCF_N . "_user_follow + FROM wcf1_user_follow WHERE userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql, 20, ($this->parameters['pageNo'] - 1) * 20); + $statement = WCF::getDB()->prepare($sql, 20, ($this->parameters['pageNo'] - 1) * 20); $statement->execute([$this->parameters['userID']]); $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); diff --git a/wcfsetup/install/files/lib/data/user/follow/UserFollowingList.class.php b/wcfsetup/install/files/lib/data/user/follow/UserFollowingList.class.php index 52abde2adc..8d266ce42f 100644 --- a/wcfsetup/install/files/lib/data/user/follow/UserFollowingList.class.php +++ b/wcfsetup/install/files/lib/data/user/follow/UserFollowingList.class.php @@ -28,11 +28,11 @@ class UserFollowingList extends UserFollowerList $this->sqlSelects .= "user_avatar.*, user_follow.followID, user_option_value.*"; $this->sqlJoins .= " - LEFT JOIN wcf" . WCF_N . "_user user_table + LEFT JOIN wcf1_user user_table ON user_table.userID = user_follow.followUserID - LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value + LEFT JOIN wcf1_user_option_value user_option_value ON user_option_value.userID = user_table.userID - LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar + LEFT JOIN wcf1_user_avatar user_avatar ON user_avatar.avatarID = user_table.avatarID"; $this->sqlSelects .= ", user_table.*"; diff --git a/wcfsetup/install/files/lib/data/user/group/UserGroup.class.php b/wcfsetup/install/files/lib/data/user/group/UserGroup.class.php index 242e2b885e..b9fd5600d6 100644 --- a/wcfsetup/install/files/lib/data/user/group/UserGroup.class.php +++ b/wcfsetup/install/files/lib/data/user/group/UserGroup.class.php @@ -488,8 +488,8 @@ class UserGroup extends DatabaseObject implements ITitledObject $this->groupOptions = []; $sql = "SELECT optionName, optionID - FROM wcf" . WCF_N . "_user_group_option"; - $statement = WCF::getDB()->prepareStatement($sql); + FROM wcf1_user_group_option"; + $statement = WCF::getDB()->prepare($sql); $statement->execute(); $groupOptionIDs = $statement->fetchMap('optionName', 'optionID'); @@ -499,11 +499,11 @@ class UserGroup extends DatabaseObject implements ITitledObject $conditions->add("option_value.optionID IN (?)", [$groupOptionIDs]); $sql = "SELECT group_option.optionName, option_value.optionValue - FROM wcf" . WCF_N . "_user_group_option_value option_value - LEFT JOIN wcf" . WCF_N . "_user_group_option group_option + FROM wcf1_user_group_option_value option_value + LEFT JOIN wcf1_user_group_option group_option ON group_option.optionID = option_value.optionID " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $this->groupOptions = $statement->fetchMap('optionName', 'optionValue'); } diff --git a/wcfsetup/install/files/lib/data/user/group/UserGroupAction.class.php b/wcfsetup/install/files/lib/data/user/group/UserGroupAction.class.php index 4704c5639d..e779da1416 100644 --- a/wcfsetup/install/files/lib/data/user/group/UserGroupAction.class.php +++ b/wcfsetup/install/files/lib/data/user/group/UserGroupAction.class.php @@ -112,14 +112,14 @@ class UserGroupAction extends AbstractDatabaseObjectAction // fetch user group option values if ($this->parameters['copyUserGroupOptions']) { $sql = "SELECT optionID, optionValue - FROM wcf" . WCF_N . "_user_group_option_value + FROM wcf1_user_group_option_value WHERE groupID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->groupEditor->groupID]); } else { $sql = "SELECT optionID, defaultValue AS optionValue - FROM wcf" . WCF_N . "_user_group_option"; - $statement = WCF::getDB()->prepareStatement($sql); + FROM wcf1_user_group_option"; + $statement = WCF::getDB()->prepare($sql); $statement->execute(); } @@ -152,12 +152,12 @@ class UserGroupAction extends AbstractDatabaseObjectAction $groupName = 'wcf.acp.group.group' . $group->groupID; // create group name language item - $sql = "INSERT INTO wcf" . WCF_N . "_language_item + $sql = "INSERT INTO wcf1_language_item (languageID, languageItem, languageItemValue, languageItemOriginIsSystem, languageCategoryID, packageID) SELECT languageID, '" . $groupName . "', CONCAT(languageItemValue, ' (2)'), 0, languageCategoryID, packageID - FROM wcf" . WCF_N . "_language_item + FROM wcf1_language_item WHERE languageItem = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->groupEditor->groupName]); } else { $groupName .= ' (2)'; @@ -169,12 +169,12 @@ class UserGroupAction extends AbstractDatabaseObjectAction $groupDescription = 'wcf.acp.group.groupDescription' . $group->groupID; // create group name language item - $sql = "INSERT INTO wcf" . WCF_N . "_language_item + $sql = "INSERT INTO wcf1_language_item (languageID, languageItem, languageItemValue, languageItemOriginIsSystem, languageCategoryID, packageID) SELECT languageID, '" . $groupDescription . "', languageItemValue, 0, languageCategoryID, packageID - FROM wcf" . WCF_N . "_language_item + FROM wcf1_language_item WHERE languageItem = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->groupEditor->groupDescription]); } @@ -185,23 +185,23 @@ class UserGroupAction extends AbstractDatabaseObjectAction // copy members if ($this->parameters['copyMembers']) { - $sql = "INSERT INTO wcf" . WCF_N . "_user_to_group + $sql = "INSERT INTO wcf1_user_to_group (userID, groupID) SELECT userID, " . $group->groupID . " - FROM wcf" . WCF_N . "_user_to_group + FROM wcf1_user_to_group WHERE groupID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->groupEditor->groupID]); } // copy acl options if ($this->parameters['copyACLOptions']) { - $sql = "INSERT INTO wcf" . WCF_N . "_acl_option_to_group + $sql = "INSERT INTO wcf1_acl_option_to_group (optionID, objectID, groupID, optionValue) SELECT optionID, objectID, " . $group->groupID . ", optionValue - FROM wcf" . WCF_N . "_acl_option_to_group + FROM wcf1_acl_option_to_group WHERE groupID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->groupEditor->groupID]); // it is likely that applications or plugins use caches diff --git a/wcfsetup/install/files/lib/data/user/group/UserGroupEditor.class.php b/wcfsetup/install/files/lib/data/user/group/UserGroupEditor.class.php index f62603fafa..956438785e 100644 --- a/wcfsetup/install/files/lib/data/user/group/UserGroupEditor.class.php +++ b/wcfsetup/install/files/lib/data/user/group/UserGroupEditor.class.php @@ -74,9 +74,9 @@ class UserGroupEditor extends DatabaseObjectEditor implements IEditableCachedObj return; } - $sql = "DELETE FROM wcf" . WCF_N . "_user_to_group + $sql = "DELETE FROM wcf1_user_to_group WHERE groupID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($groupIDs as $groupID) { $statement->execute([$groupID]); } @@ -93,9 +93,9 @@ class UserGroupEditor extends DatabaseObjectEditor implements IEditableCachedObj return; } - $sql = "DELETE FROM wcf" . WCF_N . "_user_group_option_value + $sql = "DELETE FROM wcf1_user_group_option_value WHERE groupID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($groupIDs as $groupID) { $statement->execute([$groupID]); } @@ -110,16 +110,16 @@ class UserGroupEditor extends DatabaseObjectEditor implements IEditableCachedObj { WCF::getDB()->beginTransaction(); // delete old group options - $sql = "DELETE FROM wcf" . WCF_N . "_user_group_option_value + $sql = "DELETE FROM wcf1_user_group_option_value WHERE groupID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->groupID]); // insert new options - $sql = "INSERT INTO wcf" . WCF_N . "_user_group_option_value + $sql = "INSERT INTO wcf1_user_group_option_value (groupID, optionID, optionValue) VALUES (?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($groupOptions as $id => $value) { $statement->execute([$this->groupID, $id, $value]); } @@ -136,9 +136,9 @@ class UserGroupEditor extends DatabaseObjectEditor implements IEditableCachedObj protected static function updateAccessibleGroups($groupID, $delete = false) { $sql = "SELECT optionID - FROM wcf" . WCF_N . "_user_group_option + FROM wcf1_user_group_option WHERE optionName = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(['admin.user.accessibleGroups']); $optionID = $statement->fetchSingleColumn(); @@ -159,16 +159,16 @@ class UserGroupEditor extends DatabaseObjectEditor implements IEditableCachedObj $groupIDs[] = $userGroup->groupID; } - $sql = "UPDATE wcf" . WCF_N . "_user_group_option_value + $sql = "UPDATE wcf1_user_group_option_value SET optionValue = ? WHERE groupID = ? AND optionID = ?"; - $updateStatement = WCF::getDB()->prepareStatement($sql); + $updateStatement = WCF::getDB()->prepare($sql); $sql = "SELECT groupID, optionValue - FROM wcf" . WCF_N . "_user_group_option_value + FROM wcf1_user_group_option_value WHERE optionID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$optionID]); while ($row = $statement->fetchArray()) { $valueIDs = \array_filter( diff --git a/wcfsetup/install/files/lib/data/user/group/option/UserGroupOptionAction.class.php b/wcfsetup/install/files/lib/data/user/group/option/UserGroupOptionAction.class.php index 99f306f49a..d392455a55 100644 --- a/wcfsetup/install/files/lib/data/user/group/option/UserGroupOptionAction.class.php +++ b/wcfsetup/install/files/lib/data/user/group/option/UserGroupOptionAction.class.php @@ -41,16 +41,16 @@ class UserGroupOptionAction extends AbstractDatabaseObjectAction } // remove old values - $sql = "DELETE FROM wcf" . WCF_N . "_user_group_option_value + $sql = "DELETE FROM wcf1_user_group_option_value " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); if (!empty($this->parameters['values'])) { - $sql = "INSERT INTO wcf" . WCF_N . "_user_group_option_value + $sql = "INSERT INTO wcf1_user_group_option_value (optionID, groupID, optionValue) VALUES (?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); foreach ($this->parameters['values'] as $groupID => $optionValue) { diff --git a/wcfsetup/install/files/lib/data/user/ignore/UserIgnore.class.php b/wcfsetup/install/files/lib/data/user/ignore/UserIgnore.class.php index 7dd83546cb..2c6c3402e9 100644 --- a/wcfsetup/install/files/lib/data/user/ignore/UserIgnore.class.php +++ b/wcfsetup/install/files/lib/data/user/ignore/UserIgnore.class.php @@ -35,10 +35,10 @@ class UserIgnore extends DatabaseObject public static function getIgnore($ignoreUserID) { $sql = "SELECT * - FROM wcf" . WCF_N . "_user_ignore + FROM wcf1_user_ignore WHERE userID = ? AND ignoreUserID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ WCF::getUser()->userID, $ignoreUserID, diff --git a/wcfsetup/install/files/lib/data/user/ignore/UserIgnoreAction.class.php b/wcfsetup/install/files/lib/data/user/ignore/UserIgnoreAction.class.php index 81595ce2c0..c672f4bd6f 100644 --- a/wcfsetup/install/files/lib/data/user/ignore/UserIgnoreAction.class.php +++ b/wcfsetup/install/files/lib/data/user/ignore/UserIgnoreAction.class.php @@ -93,10 +93,10 @@ class UserIgnoreAction extends AbstractDatabaseObjectAction // check if target user is following the current user $sql = "SELECT * - FROM wcf" . WCF_N . "_user_follow + FROM wcf1_user_follow WHERE userID = ? AND followUserID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $this->parameters['data']['userID'], WCF::getUser()->userID, diff --git a/wcfsetup/install/files/lib/data/user/ignore/ViewableUserIgnoreList.class.php b/wcfsetup/install/files/lib/data/user/ignore/ViewableUserIgnoreList.class.php index b1b3d6940f..3a682cd71c 100644 --- a/wcfsetup/install/files/lib/data/user/ignore/ViewableUserIgnoreList.class.php +++ b/wcfsetup/install/files/lib/data/user/ignore/ViewableUserIgnoreList.class.php @@ -49,11 +49,11 @@ class ViewableUserIgnoreList extends UserIgnoreList $this->sqlSelects .= ", user_avatar.*"; $this->sqlJoins .= " - LEFT JOIN wcf" . WCF_N . "_user user_table + LEFT JOIN wcf1_user user_table ON user_table.userID = user_ignore.ignoreUserID - LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value + LEFT JOIN wcf1_user_option_value user_option_value ON user_option_value.userID = user_table.userID - LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar + LEFT JOIN wcf1_user_avatar user_avatar ON user_avatar.avatarID = user_table.avatarID"; $this->sqlSelects .= ", user_table.*"; diff --git a/wcfsetup/install/files/lib/data/user/notification/UserNotification.class.php b/wcfsetup/install/files/lib/data/user/notification/UserNotification.class.php index 689e8e51c2..0cb52ead22 100644 --- a/wcfsetup/install/files/lib/data/user/notification/UserNotification.class.php +++ b/wcfsetup/install/files/lib/data/user/notification/UserNotification.class.php @@ -68,11 +68,11 @@ class UserNotification extends DatabaseObject public static function getNotification($packageID, $eventID, $objectID) { $sql = "SELECT * - FROM wcf" . WCF_N . "_user_notification + FROM wcf1_user_notification WHERE packageID = ? AND eventID = ? AND objectID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$packageID, $eventID, $objectID]); $row = $statement->fetchArray(); if ($row !== false) { diff --git a/wcfsetup/install/files/lib/data/user/notification/event/UserNotificationEventAction.class.php b/wcfsetup/install/files/lib/data/user/notification/event/UserNotificationEventAction.class.php index d11d58a0c9..eb4bbe3504 100644 --- a/wcfsetup/install/files/lib/data/user/notification/event/UserNotificationEventAction.class.php +++ b/wcfsetup/install/files/lib/data/user/notification/event/UserNotificationEventAction.class.php @@ -44,11 +44,11 @@ class UserNotificationEventAction extends AbstractDatabaseObjectAction $event = parent::create(); if ($event->preset) { - $sql = "INSERT INTO wcf" . WCF_N . "_user_notification_event_to_user + $sql = "INSERT INTO wcf1_user_notification_event_to_user (userID, eventID, mailNotificationType) SELECT userID, ?, ? - FROM wcf" . WCF_N . "_user"; - $statement = WCF::getDB()->prepareStatement($sql); + FROM wcf1_user"; + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $event->eventID, $event->presetMailNotificationType, diff --git a/wcfsetup/install/files/lib/data/user/notification/event/recipient/UserNotificationEventRecipientList.class.php b/wcfsetup/install/files/lib/data/user/notification/event/recipient/UserNotificationEventRecipientList.class.php index ca1c7380b9..1e5c1e1fdd 100644 --- a/wcfsetup/install/files/lib/data/user/notification/event/recipient/UserNotificationEventRecipientList.class.php +++ b/wcfsetup/install/files/lib/data/user/notification/event/recipient/UserNotificationEventRecipientList.class.php @@ -19,7 +19,7 @@ class UserNotificationEventRecipientList extends UserList public function __construct() { $this->sqlJoins = " - LEFT JOIN wcf" . WCF_N . "_user user_table + LEFT JOIN wcf1_user user_table ON user_table.userID = event_to_user.userID"; $this->sqlSelects = 'user_table.*'; @@ -31,7 +31,7 @@ class UserNotificationEventRecipientList extends UserList */ public function getDatabaseTableName() { - return 'wcf' . WCF_N . '_user_notification_event_to_user'; + return 'wcf1_user_notification_event_to_user'; } /** diff --git a/wcfsetup/install/files/lib/data/user/object/watch/UserObjectWatch.class.php b/wcfsetup/install/files/lib/data/user/object/watch/UserObjectWatch.class.php index 2034bbaf4a..463c445597 100644 --- a/wcfsetup/install/files/lib/data/user/object/watch/UserObjectWatch.class.php +++ b/wcfsetup/install/files/lib/data/user/object/watch/UserObjectWatch.class.php @@ -32,11 +32,11 @@ class UserObjectWatch extends DatabaseObject public static function getUserObjectWatch($objectTypeID, $userID, $objectID) { $sql = "SELECT * - FROM wcf" . WCF_N . "_user_object_watch + FROM wcf1_user_object_watch WHERE objectTypeID = ? AND userID = ? AND objectID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$objectTypeID, $userID, $objectID]); $row = $statement->fetch(); if (!$row) { diff --git a/wcfsetup/install/files/lib/data/user/online/UsersOnlineList.class.php b/wcfsetup/install/files/lib/data/user/online/UsersOnlineList.class.php index ed89614378..06b342d873 100644 --- a/wcfsetup/install/files/lib/data/user/online/UsersOnlineList.class.php +++ b/wcfsetup/install/files/lib/data/user/online/UsersOnlineList.class.php @@ -58,16 +58,16 @@ class UsersOnlineList extends SessionList $this->sqlSelects .= "user_avatar.*, user_option_value.*, user_group.userOnlineMarking, user_table.*"; $this->sqlConditionJoins .= " - LEFT JOIN wcf" . WCF_N . "_user user_table + LEFT JOIN wcf1_user user_table ON user_table.userID = session.userID"; $this->sqlJoins .= " - LEFT JOIN wcf" . WCF_N . "_user user_table + LEFT JOIN wcf1_user user_table ON user_table.userID = session.userID - LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value + LEFT JOIN wcf1_user_option_value user_option_value ON user_option_value.userID = user_table.userID - LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar + LEFT JOIN wcf1_user_avatar user_avatar ON user_avatar.avatarID = user_table.avatarID - LEFT JOIN wcf" . WCF_N . "_user_group user_group + LEFT JOIN wcf1_user_group user_group ON user_group.groupID = user_table.userOnlineGroupID"; $this->getConditionBuilder()->add('session.lastActivityTime > ?', [TIME_NOW - USER_ONLINE_TIMEOUT]); @@ -103,11 +103,11 @@ class UsersOnlineList extends SessionList $conditionBuilder->add('session.spiderIdentifier IS NULL'); $sql = "SELECT user_option_value.userOption" . User::getUserOptionID('canViewOnlineStatus') . " AS canViewOnlineStatus, session.userID - FROM wcf" . WCF_N . "_session session - LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value + FROM wcf1_session session + LEFT JOIN wcf1_user_option_value user_option_value ON user_option_value.userID = session.userID " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); $users = $userIDs = []; diff --git a/wcfsetup/install/files/lib/data/user/option/UserOptionEditor.class.php b/wcfsetup/install/files/lib/data/user/option/UserOptionEditor.class.php index b7ae092bdd..6eb498d3d5 100644 --- a/wcfsetup/install/files/lib/data/user/option/UserOptionEditor.class.php +++ b/wcfsetup/install/files/lib/data/user/option/UserOptionEditor.class.php @@ -33,18 +33,18 @@ class UserOptionEditor extends DatabaseObjectEditor implements IEditableCachedOb /** @var UserOption $userOption */ $userOption = parent::create($parameters); - // alter the table "wcf".WCF_N."_user_option_value" with this new option + // alter the table "wcf1_user_option_value" with this new option WCF::getDB()->getEditor()->addColumn( - 'wcf' . WCF_N . '_user_option_value', + 'wcf1_user_option_value', 'userOption' . $userOption->optionID, self::getColumnDefinition($parameters['optionType']) ); // add the default value to this column if (isset($parameters['defaultValue']) && $parameters['defaultValue'] !== null) { - $sql = "UPDATE wcf" . WCF_N . "_user_option_value + $sql = "UPDATE wcf1_user_option_value SET userOption" . $userOption->optionID . " = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$parameters['defaultValue']]); } @@ -58,10 +58,10 @@ class UserOptionEditor extends DatabaseObjectEditor implements IEditableCachedOb { parent::update($parameters); - // alter the table "wcf".WCF_N."_user_option_value" with this new option + // alter the table "wcf1_user_option_value" with this new option if (isset($parameters['optionType']) && $parameters['optionType'] != $this->optionType) { WCF::getDB()->getEditor()->alterColumn( - 'wcf' . WCF_N . '_user_option_value', + 'wcf1_user_option_value', 'userOption' . $this->optionID, 'userOption' . $this->optionID, self::getColumnDefinition($parameters['optionType']) @@ -74,12 +74,12 @@ class UserOptionEditor extends DatabaseObjectEditor implements IEditableCachedOb */ public function delete() { - $sql = "DELETE FROM wcf" . WCF_N . "_user_option + $sql = "DELETE FROM wcf1_user_option WHERE optionID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->optionID]); - WCF::getDB()->getEditor()->dropColumn('wcf' . WCF_N . '_user_option_value', 'userOption' . $this->optionID); + WCF::getDB()->getEditor()->dropColumn('wcf1_user_option_value', 'userOption' . $this->optionID); } /** @@ -90,7 +90,7 @@ class UserOptionEditor extends DatabaseObjectEditor implements IEditableCachedOb $returnValue = parent::deleteAll($objectIDs); foreach ($objectIDs as $objectID) { - WCF::getDB()->getEditor()->dropColumn('wcf' . WCF_N . '_user_option_value', 'userOption' . $objectID); + WCF::getDB()->getEditor()->dropColumn('wcf1_user_option_value', 'userOption' . $objectID); } return $returnValue; @@ -113,10 +113,10 @@ class UserOptionEditor extends DatabaseObjectEditor implements IEditableCachedOb { $value = \intval(!$enable); - $sql = "UPDATE wcf" . WCF_N . "_user_option + $sql = "UPDATE wcf1_user_option SET isDisabled = ? WHERE optionID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$value, $this->optionID]); } diff --git a/wcfsetup/install/files/lib/data/user/option/category/UserOptionCategory.class.php b/wcfsetup/install/files/lib/data/user/option/category/UserOptionCategory.class.php index 15e9638f06..0ef3fcb1c2 100644 --- a/wcfsetup/install/files/lib/data/user/option/category/UserOptionCategory.class.php +++ b/wcfsetup/install/files/lib/data/user/option/category/UserOptionCategory.class.php @@ -48,9 +48,9 @@ class UserOptionCategory extends DatabaseObject implements ITitledObject public static function getCategoryByName($categoryName) { $sql = "SELECT * - FROM wcf" . WCF_N . "_user_option_category + FROM wcf1_user_option_category WHERE categoryName = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$categoryName]); $row = $statement->fetchArray(); if ($row === false) { diff --git a/wcfsetup/install/files/lib/data/user/option/category/UserOptionCategoryAction.class.php b/wcfsetup/install/files/lib/data/user/option/category/UserOptionCategoryAction.class.php index 299cc3cbf0..8bb79190e1 100644 --- a/wcfsetup/install/files/lib/data/user/option/category/UserOptionCategoryAction.class.php +++ b/wcfsetup/install/files/lib/data/user/option/category/UserOptionCategoryAction.class.php @@ -60,9 +60,9 @@ class UserOptionCategoryAction extends AbstractDatabaseObjectAction $conditions = new PreparedStatementConditionBuilder(); $conditions->add("categoryName IN (?)", [$categoryNames]); $sql = "SELECT COUNT(*) AS count - FROM wcf" . WCF_N . "_user_option + FROM wcf1_user_option " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $count = $statement->fetchSingleColumn(); if ($count > 0) { diff --git a/wcfsetup/install/files/lib/data/user/profile/menu/item/UserProfileMenuItemAction.class.php b/wcfsetup/install/files/lib/data/user/profile/menu/item/UserProfileMenuItemAction.class.php index 48eebddd9d..4d9bc962f3 100644 --- a/wcfsetup/install/files/lib/data/user/profile/menu/item/UserProfileMenuItemAction.class.php +++ b/wcfsetup/install/files/lib/data/user/profile/menu/item/UserProfileMenuItemAction.class.php @@ -95,8 +95,8 @@ class UserProfileMenuItemAction extends AbstractDatabaseObjectAction implements } $sql = "SELECT menuItemID - FROM wcf" . WCF_N . "_user_profile_menu_item"; - $statement = WCF::getDB()->prepareStatement($sql); + FROM wcf1_user_profile_menu_item"; + $statement = WCF::getDB()->prepare($sql); $statement->execute(); $menuItemIDs = []; while ($menuItemID = $statement->fetchColumn()) { @@ -122,10 +122,10 @@ class UserProfileMenuItemAction extends AbstractDatabaseObjectAction implements */ public function updatePosition() { - $sql = "UPDATE wcf" . WCF_N . "_user_profile_menu_item + $sql = "UPDATE wcf1_user_profile_menu_item SET showOrder = ? WHERE menuItemID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); for ($i = 0, $length = \count($this->parameters['data']['structure'][0]); $i < $length; $i++) { diff --git a/wcfsetup/install/files/lib/data/user/profile/menu/item/UserProfileMenuItemEditor.class.php b/wcfsetup/install/files/lib/data/user/profile/menu/item/UserProfileMenuItemEditor.class.php index 88e6de81e5..93a2ac6a09 100644 --- a/wcfsetup/install/files/lib/data/user/profile/menu/item/UserProfileMenuItemEditor.class.php +++ b/wcfsetup/install/files/lib/data/user/profile/menu/item/UserProfileMenuItemEditor.class.php @@ -55,10 +55,10 @@ class UserProfileMenuItemEditor extends DatabaseObjectEditor implements IEditabl public function delete() { // update show order - $sql = "UPDATE wcf" . WCF_N . "_user_profile_menu_item + $sql = "UPDATE wcf1_user_profile_menu_item SET showOrder = showOrder - 1 WHERE showOrder >= ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->showOrder]); parent::delete(); @@ -73,21 +73,21 @@ class UserProfileMenuItemEditor extends DatabaseObjectEditor implements IEditabl { if ($this->showOrder != $showOrder) { if ($showOrder < $this->showOrder) { - $sql = "UPDATE wcf" . WCF_N . "_user_profile_menu_item + $sql = "UPDATE wcf1_user_profile_menu_item SET showOrder = showOrder + 1 WHERE showOrder >= ? AND showOrder < ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $showOrder, $this->showOrder, ]); } elseif ($showOrder > $this->showOrder) { - $sql = "UPDATE wcf" . WCF_N . "_user_profile_menu_item + $sql = "UPDATE wcf1_user_profile_menu_item SET showOrder = showOrder - 1 WHERE showOrder <= ? AND showOrder > ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $showOrder, $this->showOrder, @@ -107,8 +107,8 @@ class UserProfileMenuItemEditor extends DatabaseObjectEditor implements IEditabl if ($showOrder == 0) { // get next number in row $sql = "SELECT MAX(showOrder) AS showOrder - FROM wcf" . WCF_N . "_user_profile_menu_item"; - $statement = WCF::getDB()->prepareStatement($sql); + FROM wcf1_user_profile_menu_item"; + $statement = WCF::getDB()->prepare($sql); $statement->execute(); $row = $statement->fetchArray(); if (!empty($row)) { @@ -117,10 +117,10 @@ class UserProfileMenuItemEditor extends DatabaseObjectEditor implements IEditabl $showOrder = 1; } } else { - $sql = "UPDATE wcf" . WCF_N . "_user_profile_menu_item + $sql = "UPDATE wcf1_user_profile_menu_item SET showOrder = showOrder + 1 WHERE showOrder >= ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$showOrder]); } diff --git a/wcfsetup/install/files/lib/data/user/profile/visitor/UserProfileVisitor.class.php b/wcfsetup/install/files/lib/data/user/profile/visitor/UserProfileVisitor.class.php index 6933e341f2..28d300d5df 100644 --- a/wcfsetup/install/files/lib/data/user/profile/visitor/UserProfileVisitor.class.php +++ b/wcfsetup/install/files/lib/data/user/profile/visitor/UserProfileVisitor.class.php @@ -32,7 +32,7 @@ class UserProfileVisitor extends DatabaseObject FROM " . static::getDatabaseTableName() . " WHERE ownerID = ? AND userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$ownerID, $userID]); if ($row = $statement->fetchArray()) { return new self(null, $row); diff --git a/wcfsetup/install/files/lib/data/user/profile/visitor/UserProfileVisitorAction.class.php b/wcfsetup/install/files/lib/data/user/profile/visitor/UserProfileVisitorAction.class.php index e4c5b32bc4..4fc2acedb8 100644 --- a/wcfsetup/install/files/lib/data/user/profile/visitor/UserProfileVisitorAction.class.php +++ b/wcfsetup/install/files/lib/data/user/profile/visitor/UserProfileVisitorAction.class.php @@ -11,6 +11,10 @@ use wcf\system\exception\UserInputException; use wcf\system\user\GroupedUserList; use wcf\system\WCF; +use wcf\system\exception\UserInputException; +use wcf\system\user\GroupedUserList; +use wcf\system\WCF; + /** * Executes profile visitor-related actions. * @@ -63,18 +67,18 @@ class UserProfileVisitorAction extends AbstractDatabaseObjectAction implements I { // resolve page count $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_user_profile_visitor + FROM wcf1_user_profile_visitor WHERE ownerID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->parameters['userID']]); $pageCount = \ceil($statement->fetchSingleColumn() / 20); // get user ids $sql = "SELECT userID - FROM wcf" . WCF_N . "_user_profile_visitor + FROM wcf1_user_profile_visitor WHERE ownerID = ? ORDER BY time DESC"; - $statement = WCF::getDB()->prepareStatement($sql, 20, ($this->parameters['pageNo'] - 1) * 20); + $statement = WCF::getDB()->prepare($sql, 20, ($this->parameters['pageNo'] - 1) * 20); $statement->execute([$this->parameters['userID']]); $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); @@ -101,11 +105,11 @@ class UserProfileVisitorAction extends AbstractDatabaseObjectAction implements I */ public function registerVisitor() { - $sql = "INSERT INTO wcf" . WCF_N . "_user_profile_visitor + $sql = "INSERT INTO wcf1_user_profile_visitor (ownerID, userID, time) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE time = VALUES(time)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $this->parameters['data']['ownerID'], $this->parameters['data']['userID'], diff --git a/wcfsetup/install/files/lib/data/user/profile/visitor/UserProfileVisitorList.class.php b/wcfsetup/install/files/lib/data/user/profile/visitor/UserProfileVisitorList.class.php index a4eae3b178..39233b8bd9 100644 --- a/wcfsetup/install/files/lib/data/user/profile/visitor/UserProfileVisitorList.class.php +++ b/wcfsetup/install/files/lib/data/user/profile/visitor/UserProfileVisitorList.class.php @@ -47,9 +47,9 @@ class UserProfileVisitorList extends DatabaseObjectList $this->sqlSelects .= ", user_avatar.*"; $this->sqlJoins .= " - LEFT JOIN wcf" . WCF_N . "_user user_table + LEFT JOIN wcf1_user user_table ON user_table.userID = user_profile_visitor.userID - LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar + LEFT JOIN wcf1_user_avatar user_avatar ON user_avatar.avatarID = user_table.avatarID"; } } diff --git a/wcfsetup/install/files/lib/data/user/trophy/UserTrophyAction.class.php b/wcfsetup/install/files/lib/data/user/trophy/UserTrophyAction.class.php index cf288941e0..d3cc9acff0 100644 --- a/wcfsetup/install/files/lib/data/user/trophy/UserTrophyAction.class.php +++ b/wcfsetup/install/files/lib/data/user/trophy/UserTrophyAction.class.php @@ -155,9 +155,9 @@ class UserTrophyAction extends AbstractDatabaseObjectAction } $conditionBuilder->add('userID = ?', [$userID]); - $sql = "DELETE FROM wcf" . WCF_N . "_user_special_trophy + $sql = "DELETE FROM wcf1_user_special_trophy " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); UserStorageHandler::getInstance()->reset([$userID], 'specialTrophies'); @@ -227,18 +227,18 @@ class UserTrophyAction extends AbstractDatabaseObjectAction $userTrophyList->sqlConditionJoins .= ' '; } $userTrophyList->sqlJoins .= ' - LEFT JOIN wcf' . WCF_N . '_trophy trophy + LEFT JOIN wcf1_trophy trophy ON user_trophy.trophyID = trophy.trophyID'; $userTrophyList->sqlConditionJoins .= ' - LEFT JOIN wcf' . WCF_N . '_trophy trophy + LEFT JOIN wcf1_trophy trophy ON user_trophy.trophyID = trophy.trophyID'; // trophy category join $userTrophyList->sqlJoins .= ' - LEFT JOIN wcf' . WCF_N . '_category category + LEFT JOIN wcf1_category category ON trophy.categoryID = category.categoryID'; $userTrophyList->sqlConditionJoins .= ' - LEFT JOIN wcf' . WCF_N . '_category category + LEFT JOIN wcf1_category category ON trophy.categoryID = category.categoryID'; $userTrophyList->getConditionBuilder()->add('trophy.isDisabled = ?', [0]); diff --git a/wcfsetup/install/files/lib/data/user/trophy/UserTrophyList.class.php b/wcfsetup/install/files/lib/data/user/trophy/UserTrophyList.class.php index 612ac39766..94c8d2b402 100644 --- a/wcfsetup/install/files/lib/data/user/trophy/UserTrophyList.class.php +++ b/wcfsetup/install/files/lib/data/user/trophy/UserTrophyList.class.php @@ -44,18 +44,18 @@ class UserTrophyList extends DatabaseObjectList $trophyList->sqlConditionJoins .= ' '; } $trophyList->sqlJoins .= ' - LEFT JOIN wcf' . WCF_N . '_trophy trophy + LEFT JOIN wcf1_trophy trophy ON user_trophy.trophyID = trophy.trophyID'; $trophyList->sqlConditionJoins .= ' - LEFT JOIN wcf' . WCF_N . '_trophy trophy + LEFT JOIN wcf1_trophy trophy ON user_trophy.trophyID = trophy.trophyID'; // trophy category join $trophyList->sqlJoins .= ' - LEFT JOIN wcf' . WCF_N . '_category category + LEFT JOIN wcf1_category category ON trophy.categoryID = category.categoryID'; $trophyList->sqlConditionJoins .= ' - LEFT JOIN wcf' . WCF_N . '_category category + LEFT JOIN wcf1_category category ON trophy.categoryID = category.categoryID'; $trophyList->getConditionBuilder()->add('trophy.isDisabled = ?', [0]); diff --git a/wcfsetup/install/files/lib/form/NotificationSettingsForm.class.php b/wcfsetup/install/files/lib/form/NotificationSettingsForm.class.php index e7798fc801..eefa47a690 100644 --- a/wcfsetup/install/files/lib/form/NotificationSettingsForm.class.php +++ b/wcfsetup/install/files/lib/form/NotificationSettingsForm.class.php @@ -138,9 +138,9 @@ class NotificationSettingsForm extends AbstractForm // get activation state $sql = "SELECT eventID, mailNotificationType - FROM wcf" . WCF_N . "_user_notification_event_to_user + FROM wcf1_user_notification_event_to_user WHERE userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([WCF::getUser()->userID]); while ($row = $statement->fetchArray()) { $this->settings[$row['eventID']]['enabled'] = true; @@ -209,10 +209,10 @@ class NotificationSettingsForm extends AbstractForm */ protected function updateActivationStates() { - $sql = "DELETE FROM wcf" . WCF_N . "_user_notification_event_to_user + $sql = "DELETE FROM wcf1_user_notification_event_to_user WHERE eventID = ? AND userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); $newSettings = []; foreach ($this->settings as $eventID => $setting) { @@ -230,10 +230,10 @@ class NotificationSettingsForm extends AbstractForm } if (!empty($newSettings)) { - $sql = "INSERT INTO wcf" . WCF_N . "_user_notification_event_to_user + $sql = "INSERT INTO wcf1_user_notification_event_to_user (eventID, userID, mailNotificationType) VALUES (?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($newSettings as $newSetting) { $statement->execute([ $newSetting['eventID'], diff --git a/wcfsetup/install/files/lib/form/NotificationUnsubscribeForm.class.php b/wcfsetup/install/files/lib/form/NotificationUnsubscribeForm.class.php index 361cff0ef2..3536fccd27 100644 --- a/wcfsetup/install/files/lib/form/NotificationUnsubscribeForm.class.php +++ b/wcfsetup/install/files/lib/form/NotificationUnsubscribeForm.class.php @@ -95,21 +95,21 @@ class NotificationUnsubscribeForm extends AbstractForm parent::save(); if ($this->event !== null) { - $sql = "UPDATE wcf" . WCF_N . "_user_notification_event_to_user + $sql = "UPDATE wcf1_user_notification_event_to_user SET mailNotificationType = ? WHERE userID = ? AND eventID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ 'none', $this->user->userID, $this->event->eventID, ]); } else { - $sql = "UPDATE wcf" . WCF_N . "_user_notification_event_to_user + $sql = "UPDATE wcf1_user_notification_event_to_user SET mailNotificationType = ? WHERE userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ 'none', $this->user->userID, diff --git a/wcfsetup/install/files/lib/form/SearchForm.class.php b/wcfsetup/install/files/lib/form/SearchForm.class.php index e71ec2fbe9..09d3a77b86 100644 --- a/wcfsetup/install/files/lib/form/SearchForm.class.php +++ b/wcfsetup/install/files/lib/form/SearchForm.class.php @@ -306,12 +306,12 @@ class SearchForm extends AbstractCaptchaForm } $sql = "SELECT searchID - FROM wcf" . WCF_N . "_search + FROM wcf1_search WHERE searchHash = ? AND searchType = ? AND searchTime > ? " . (WCF::getUser()->userID ? 'AND userID = ?' : 'AND userID IS NULL'); - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($parameters); $row = $statement->fetchArray(); if ($row !== false) { diff --git a/wcfsetup/install/files/lib/form/UserSearchForm.class.php b/wcfsetup/install/files/lib/form/UserSearchForm.class.php index 367fd7b574..8c1ca6ae36 100644 --- a/wcfsetup/install/files/lib/form/UserSearchForm.class.php +++ b/wcfsetup/install/files/lib/form/UserSearchForm.class.php @@ -187,11 +187,11 @@ class UserSearchForm extends UserOptionListForm // perform search $sql = "SELECT user_table.userID - FROM wcf" . WCF_N . "_user user_table - LEFT JOIN wcf" . WCF_N . "_user_option_value option_value + FROM wcf1_user user_table + LEFT JOIN wcf1_user_option_value option_value ON option_value.userID = user_table.userID {$this->conditions}"; - $statement = WCF::getDB()->prepareStatement($sql, $this->maxResults); + $statement = WCF::getDB()->prepare($sql, $this->maxResults); $statement->execute($this->conditions->getParameters()); $this->matches = $statement->fetchAll(\PDO::FETCH_COLUMN); } diff --git a/wcfsetup/install/files/lib/page/AbstractArticlePage.class.php b/wcfsetup/install/files/lib/page/AbstractArticlePage.class.php index 4f1496b598..222fa5572d 100644 --- a/wcfsetup/install/files/lib/page/AbstractArticlePage.class.php +++ b/wcfsetup/install/files/lib/page/AbstractArticlePage.class.php @@ -153,16 +153,16 @@ abstract class AbstractArticlePage extends AbstractPage $conditionBuilder->add('tag_to_object.tagID IN (?)', [\array_keys($this->tags)]); $conditionBuilder->add('tag_to_object.objectID <> ?', [$this->articleContentID]); $sql = "SELECT MAX(article.articleID), COUNT(*) AS count - FROM wcf" . WCF_N . "_tag_to_object tag_to_object - INNER JOIN wcf" . WCF_N . "_article_content article_content + FROM wcf1_tag_to_object tag_to_object + INNER JOIN wcf1_article_content article_content ON tag_to_object.objectID = article_content.articleContentID - INNER JOIN wcf" . WCF_N . "_article article + INNER JOIN wcf1_article article ON article_content.articleID = article.articleID " . $conditionBuilder . " GROUP BY tag_to_object.objectID HAVING COUNT(*) >= " . \round(\count($this->tags) * ARTICLE_RELATED_ARTICLES_MATCH_THRESHOLD / 100) . " ORDER BY count DESC, MAX(article.time) DESC"; - $statement = WCF::getDB()->prepareStatement($sql, ARTICLE_RELATED_ARTICLES * 4); + $statement = WCF::getDB()->prepare($sql, ARTICLE_RELATED_ARTICLES * 4); $statement->execute($conditionBuilder->getParameters()); $articleIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); diff --git a/wcfsetup/install/files/lib/page/ArticleListPage.class.php b/wcfsetup/install/files/lib/page/ArticleListPage.class.php index e710640586..ca6a811c9d 100644 --- a/wcfsetup/install/files/lib/page/ArticleListPage.class.php +++ b/wcfsetup/install/files/lib/page/ArticleListPage.class.php @@ -191,7 +191,7 @@ class ArticleListPage extends SortablePage } $this->objectList->sqlSelects .= "( SELECT title - FROM wcf" . WCF_N . "_article_content + FROM wcf1_article_content WHERE articleID = article.articleID AND ( languageID IS NULL @@ -223,7 +223,7 @@ class ArticleListPage extends SortablePage $this->objectList->getConditionBuilder()->add( 'article.articleID NOT IN ( SELECT objectID - FROM wcf' . WCF_N . '_label_object + FROM wcf1_label_object WHERE objectTypeID = ? AND labelID IN (?) )', @@ -237,7 +237,7 @@ class ArticleListPage extends SortablePage $this->objectList->getConditionBuilder()->add( 'article.articleID IN ( SELECT objectID - FROM wcf' . WCF_N . '_label_object + FROM wcf1_label_object WHERE objectTypeID = ? AND labelID = ? )', diff --git a/wcfsetup/install/files/lib/page/CategoryArticleListPage.class.php b/wcfsetup/install/files/lib/page/CategoryArticleListPage.class.php index 62fd497439..a64d03d426 100644 --- a/wcfsetup/install/files/lib/page/CategoryArticleListPage.class.php +++ b/wcfsetup/install/files/lib/page/CategoryArticleListPage.class.php @@ -95,7 +95,7 @@ class CategoryArticleListPage extends ArticleListPage if ($this->sortField === 'title') { $this->objectList->sqlSelects = "( SELECT title - FROM wcf" . WCF_N . "_article_content + FROM wcf1_article_content WHERE articleID = article.articleID AND ( languageID IS NULL diff --git a/wcfsetup/install/files/lib/page/CategoryTrophyListPage.class.php b/wcfsetup/install/files/lib/page/CategoryTrophyListPage.class.php index de6a63f217..25ffdf6f90 100644 --- a/wcfsetup/install/files/lib/page/CategoryTrophyListPage.class.php +++ b/wcfsetup/install/files/lib/page/CategoryTrophyListPage.class.php @@ -69,7 +69,7 @@ class CategoryTrophyListPage extends TrophyListPage $this->objectList->sqlSelects = '( SELECT COUNT(*) - FROM wcf' . WCF_N . '_user_trophy + FROM wcf1_user_trophy WHERE trophyID = trophy.trophyID ) AS awarded'; $this->objectList->getConditionBuilder()->add('isDisabled = ?', [0]); diff --git a/wcfsetup/install/files/lib/page/TrophyListPage.class.php b/wcfsetup/install/files/lib/page/TrophyListPage.class.php index 45a78895ad..2766ee382a 100644 --- a/wcfsetup/install/files/lib/page/TrophyListPage.class.php +++ b/wcfsetup/install/files/lib/page/TrophyListPage.class.php @@ -93,7 +93,7 @@ class TrophyListPage extends MultipleLinkPage $this->objectList->sqlSelects = '( SELECT COUNT(*) - FROM wcf' . WCF_N . '_user_trophy + FROM wcf1_user_trophy WHERE trophyID = trophy.trophyID ) AS awarded'; $this->objectList->getConditionBuilder()->add('isDisabled = ?', [0]); diff --git a/wcfsetup/install/files/lib/page/TrophyPage.class.php b/wcfsetup/install/files/lib/page/TrophyPage.class.php index e079677c31..e361c9fdfc 100644 --- a/wcfsetup/install/files/lib/page/TrophyPage.class.php +++ b/wcfsetup/install/files/lib/page/TrophyPage.class.php @@ -177,13 +177,13 @@ class TrophyPage extends MultipleLinkPage if (!WCF::getUser()->userID) { $this->objectList->getConditionBuilder()->add('user_trophy.userID IN ( SELECT userID - FROM wcf' . WCF_N . '_user_option_value + FROM wcf1_user_option_value WHERE COALESCE(userOption' . $canViewTrophiesOptionID . ', ' . $canViewTrophyDefaultValue . ') = 0)'); } elseif (!WCF::getSession()->getPermission('admin.general.canViewPrivateUserOptions')) { $conditionBuilder = new PreparedStatementConditionBuilder(false, 'OR'); $conditionBuilder->add('user_trophy.userID IN ( SELECT userID - FROM wcf' . WCF_N . '_user_option_value + FROM wcf1_user_option_value WHERE ( COALESCE(userOption' . $canViewTrophiesOptionID . ', ' . $canViewTrophyDefaultValue . ') = 0 OR COALESCE(userOption' . $canViewTrophiesOptionID . ', ' . $canViewTrophyDefaultValue . ') = 1 @@ -193,13 +193,13 @@ class TrophyPage extends MultipleLinkPage $friendshipConditionBuilder = new PreparedStatementConditionBuilder(false); $friendshipConditionBuilder->add('user_trophy.userID IN ( SELECT userID - FROM wcf' . WCF_N . '_user_option_value + FROM wcf1_user_option_value WHERE COALESCE(userOption' . $canViewTrophiesOptionID . ', ' . $canViewTrophyDefaultValue . ') = 2 )'); $friendshipConditionBuilder->add( 'user_trophy.userID IN ( SELECT userID - FROM wcf' . WCF_N . '_user_follow + FROM wcf1_user_follow WHERE followUserID = ? )', [WCF::getUser()->userID] diff --git a/wcfsetup/install/files/lib/page/UnreadArticleListPage.class.php b/wcfsetup/install/files/lib/page/UnreadArticleListPage.class.php index d0c4c2e2c7..9b611fcd81 100644 --- a/wcfsetup/install/files/lib/page/UnreadArticleListPage.class.php +++ b/wcfsetup/install/files/lib/page/UnreadArticleListPage.class.php @@ -59,7 +59,7 @@ class UnreadArticleListPage extends ArticleListPage if (WCF::getUser()->userID) { $this->objectList->sqlConditionJoins = " - LEFT JOIN wcf" . WCF_N . "_tracked_visit tracked_visit + LEFT JOIN wcf1_tracked_visit tracked_visit ON tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.article') . " AND tracked_visit.objectID = article.articleID AND tracked_visit.userID = " . WCF::getUser()->userID; diff --git a/wcfsetup/install/files/lib/system/WCFSetup.class.php b/wcfsetup/install/files/lib/system/WCFSetup.class.php index 73c23af7ba..9e4bea578d 100644 --- a/wcfsetup/install/files/lib/system/WCFSetup.class.php +++ b/wcfsetup/install/files/lib/system/WCFSetup.class.php @@ -8,7 +8,6 @@ use Psr\Http\Message\ResponseInterface; use wcf\data\language\LanguageEditor; use wcf\data\language\SetupLanguage; use wcf\data\package\installation\queue\PackageInstallationQueueEditor; -use wcf\data\package\Package; use wcf\data\user\User; use wcf\data\user\UserAction; use wcf\system\cache\builder\LanguageCacheBuilder; @@ -21,7 +20,6 @@ use wcf\system\exception\SystemException; use wcf\system\exception\UserInputException; use wcf\system\image\adapter\GDImageAdapter; use wcf\system\image\adapter\ImagickImageAdapter; -use wcf\system\io\File; use wcf\system\io\Tar; use wcf\system\language\LanguageFactory; use wcf\system\package\PackageArchive; @@ -553,7 +551,7 @@ final class WCFSetup extends WCF // check innodb support $sql = "SHOW ENGINES"; - $statement = $db->prepareStatement($sql); + $statement = $db->prepare($sql); $statement->execute(); $hasInnoDB = false; while ($row = $statement->fetchArray()) { @@ -569,7 +567,7 @@ final class WCFSetup extends WCF // check for PHP's MySQL native driver $sql = "SELECT 1"; - $statement = $db->prepareStatement($sql); + $statement = $db->prepare($sql); $statement->execute(); // MySQL native driver understands data types, libmysqlclient does not if ($statement->fetchSingleColumn() !== 1) { @@ -685,7 +683,7 @@ final class WCFSetup extends WCF $sql = "INSERT INTO wcf1_package_installation_sql_log (packageID, sqlTable) VALUES (?, ?)"; - $statement = self::getDB()->prepareStatement($sql); + $statement = self::getDB()->prepare($sql); foreach ($matches[1] as $tableName) { $statement->execute([1, $tableName]); } @@ -706,7 +704,7 @@ final class WCFSetup extends WCF $sql = "INSERT INTO wcf1_package_installation_plugin (packageID, pluginName, priority, className) VALUES (?, ?, ?, ?)"; - $statement = self::getDB()->prepareStatement($sql); + $statement = self::getDB()->prepare($sql); $statement->execute([ 1, 'packageInstallationPlugin', @@ -861,7 +859,7 @@ final class WCFSetup extends WCF $sql = "SELECT languageID FROM wcf1_language WHERE languageCode = ?"; - $statement = self::getDB()->prepareStatement($sql); + $statement = self::getDB()->prepare($sql); $statement->execute([self::$selectedLanguageCode]); $row = $statement->fetchArray(); if (isset($row['languageID'])) { diff --git a/wcfsetup/install/files/lib/system/acl/ACLHandler.class.php b/wcfsetup/install/files/lib/system/acl/ACLHandler.class.php index 6fc3407ecd..4059f3aa61 100644 --- a/wcfsetup/install/files/lib/system/acl/ACLHandler.class.php +++ b/wcfsetup/install/files/lib/system/acl/ACLHandler.class.php @@ -257,9 +257,9 @@ class ACLHandler extends SingletonFactory $conditions->add("optionID IN (?)", [\array_keys($options)]); $conditions->add("objectID = ?", [$objectID]); - $sql = "DELETE FROM wcf" . WCF_N . "_acl_option_to_" . $type . " + $sql = "DELETE FROM wcf1_acl_option_to_" . $type . " " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $objectTypeID = \reset($options)->objectTypeID; @@ -272,10 +272,10 @@ class ACLHandler extends SingletonFactory $values = JSON::decode($_POST['aclValues'][$type]); } - $sql = "INSERT INTO wcf" . WCF_N . "_acl_option_to_" . $type . " + $sql = "INSERT INTO wcf1_acl_option_to_" . $type . " (optionID, objectID, " . $type . "ID, optionValue) VALUES (?, ?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); foreach ($values as $typeID => $optionData) { @@ -383,9 +383,9 @@ class ACLHandler extends SingletonFactory $conditions->add("optionID IN (?)", [$optionsIDs]); $conditions->add("objectID IN (?)", [$objectIDs]); $sql = "SELECT * - FROM wcf" . WCF_N . "_acl_option_to_" . $type . " + FROM wcf1_acl_option_to_" . $type . " " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); while ($row = $statement->fetchArray()) { if (!isset($data[$type][$row['objectID']])) { @@ -419,9 +419,9 @@ class ACLHandler extends SingletonFactory if ($type == 'group') { $conditions->add("groupID IN (?)", [\array_keys($data[$type]['option'])]); $sql = "SELECT groupID, groupName - FROM wcf" . WCF_N . "_user_group + FROM wcf1_user_group " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); while ($row = $statement->fetchArray()) { @@ -430,9 +430,9 @@ class ACLHandler extends SingletonFactory } else { $conditions->add("userID IN (?)", [\array_keys($data[$type]['option'])]); $sql = "SELECT userID, username - FROM wcf" . WCF_N . "_user + FROM wcf1_user " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $data['user']['label'] = $statement->fetchMap('userID', 'username'); } @@ -482,9 +482,9 @@ class ACLHandler extends SingletonFactory WCF::getDB()->beginTransaction(); foreach (['group', 'user'] as $type) { - $sql = "DELETE FROM wcf" . WCF_N . "_acl_option_to_" . $type . " + $sql = "DELETE FROM wcf1_acl_option_to_" . $type . " " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); } WCF::getDB()->commitTransaction(); diff --git a/wcfsetup/install/files/lib/system/acl/simple/SimpleAclHandler.class.php b/wcfsetup/install/files/lib/system/acl/simple/SimpleAclHandler.class.php index ea00bd69cf..707c2b11a9 100644 --- a/wcfsetup/install/files/lib/system/acl/simple/SimpleAclHandler.class.php +++ b/wcfsetup/install/files/lib/system/acl/simple/SimpleAclHandler.class.php @@ -69,10 +69,10 @@ class SimpleAclHandler extends SingletonFactory ]; $sql = "SELECT userID - FROM wcf" . WCF_N . "_acl_simple_to_user + FROM wcf1_acl_simple_to_user WHERE objectTypeID = ? AND objectID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $objectTypeID, $objectID, @@ -80,10 +80,10 @@ class SimpleAclHandler extends SingletonFactory $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); $sql = "SELECT groupID - FROM wcf" . WCF_N . "_acl_simple_to_group + FROM wcf1_acl_simple_to_group WHERE objectTypeID = ? AND objectID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $objectTypeID, $objectID, @@ -123,10 +123,10 @@ class SimpleAclHandler extends SingletonFactory } // users - $sql = "DELETE FROM wcf" . WCF_N . "_acl_simple_to_user + $sql = "DELETE FROM wcf1_acl_simple_to_user WHERE objectTypeID = ? AND objectID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $objectTypeID, $objectID, @@ -135,10 +135,10 @@ class SimpleAclHandler extends SingletonFactory if ($values['allowAll'] == 0 && !empty($values['user'])) { $values['user'] = ArrayUtil::toIntegerArray($values['user']); if (!empty($values['user'])) { - $sql = "INSERT INTO wcf" . WCF_N . "_acl_simple_to_user + $sql = "INSERT INTO wcf1_acl_simple_to_user (objectTypeID, objectID, userID) VALUES (?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); foreach ($values['user'] as $userID) { @@ -153,10 +153,10 @@ class SimpleAclHandler extends SingletonFactory } // groups - $sql = "DELETE FROM wcf" . WCF_N . "_acl_simple_to_group + $sql = "DELETE FROM wcf1_acl_simple_to_group WHERE objectTypeID = ? AND objectID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $objectTypeID, $objectID, @@ -165,10 +165,10 @@ class SimpleAclHandler extends SingletonFactory if ($values['allowAll'] == 0 && !empty($values['group'])) { $values['group'] = ArrayUtil::toIntegerArray($values['group']); if (!empty($values['group'])) { - $sql = "INSERT INTO wcf" . WCF_N . "_acl_simple_to_group + $sql = "INSERT INTO wcf1_acl_simple_to_group (objectTypeID, objectID, groupID) VALUES (?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); foreach ($values['group'] as $groupID) { diff --git a/wcfsetup/install/files/lib/system/acp/dashboard/box/SystemInfoAcpDashboardBox.class.php b/wcfsetup/install/files/lib/system/acp/dashboard/box/SystemInfoAcpDashboardBox.class.php index 8d21cf48aa..bbaf22104c 100644 --- a/wcfsetup/install/files/lib/system/acp/dashboard/box/SystemInfoAcpDashboardBox.class.php +++ b/wcfsetup/install/files/lib/system/acp/dashboard/box/SystemInfoAcpDashboardBox.class.php @@ -64,7 +64,7 @@ final class SystemInfoAcpDashboardBox extends AbstractAcpDashboardBox private function getInnodbFlushLogAtTrxCommit(): int { $sql = "SELECT @@innodb_flush_log_at_trx_commit"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(); return $statement->fetchSingleColumn(); } diff --git a/wcfsetup/install/files/lib/system/application/ApplicationHandler.class.php b/wcfsetup/install/files/lib/system/application/ApplicationHandler.class.php index 3587c469c5..46c63a2982 100644 --- a/wcfsetup/install/files/lib/system/application/ApplicationHandler.class.php +++ b/wcfsetup/install/files/lib/system/application/ApplicationHandler.class.php @@ -277,7 +277,7 @@ final class ApplicationHandler extends SingletonFactory $string = \preg_replace( $regex, - '${1}' . WCF_N . '_', + '${1}1_', $string ); } else { @@ -296,7 +296,7 @@ final class ApplicationHandler extends SingletonFactory $string = \preg_replace( $regex, - '${1}' . WCF_N . '_', + '${1}1_', $string ); } diff --git a/wcfsetup/install/files/lib/system/attachment/AttachmentHandler.class.php b/wcfsetup/install/files/lib/system/attachment/AttachmentHandler.class.php index 74c46aecd2..f1c7e66155 100644 --- a/wcfsetup/install/files/lib/system/attachment/AttachmentHandler.class.php +++ b/wcfsetup/install/files/lib/system/attachment/AttachmentHandler.class.php @@ -131,11 +131,11 @@ class AttachmentHandler implements \Countable $conditions->add("tmpHash IN (?)", [$this->tmpHash]); $conditions->add("(objectID IS NULL OR objectID = 0)"); - $sql = "UPDATE wcf" . WCF_N . "_attachment + $sql = "UPDATE wcf1_attachment SET objectID = ?, tmpHash = '' " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $parameters = $conditions->getParameters(); \array_unshift($parameters, $objectID); @@ -163,10 +163,10 @@ class AttachmentHandler implements \Countable $parameters = $conditions->getParameters(); \array_unshift($parameters, $newObjectID); - $sql = "UPDATE wcf" . WCF_N . "_attachment + $sql = "UPDATE wcf1_attachment SET objectID = ? " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($parameters); } diff --git a/wcfsetup/install/files/lib/system/background/job/NotificationEmailDeliveryBackgroundJob.class.php b/wcfsetup/install/files/lib/system/background/job/NotificationEmailDeliveryBackgroundJob.class.php index 7afd15a335..eccb0ff0da 100644 --- a/wcfsetup/install/files/lib/system/background/job/NotificationEmailDeliveryBackgroundJob.class.php +++ b/wcfsetup/install/files/lib/system/background/job/NotificationEmailDeliveryBackgroundJob.class.php @@ -77,14 +77,14 @@ class NotificationEmailDeliveryBackgroundJob extends AbstractBackgroundJob { // see UserNotificationHandler::fetchNotifications() $sql = "SELECT notification.*, notification_event.eventID, object_type.objectType - FROM wcf" . WCF_N . "_user_notification notification - LEFT JOIN wcf" . WCF_N . "_user_notification_event notification_event + FROM wcf1_user_notification notification + LEFT JOIN wcf1_user_notification_event notification_event ON notification_event.eventID = notification.eventID - LEFT JOIN wcf" . WCF_N . "_object_type object_type + LEFT JOIN wcf1_object_type object_type ON object_type.objectTypeID = notification_event.objectTypeID WHERE notification.notificationID = ? ORDER BY notification.time DESC"; - $statement = WCF::getDB()->prepareStatement($sql, 1); + $statement = WCF::getDB()->prepare($sql, 1); $statement->execute([$this->notificationID]); /** @var UserNotification $notification */ diff --git a/wcfsetup/install/files/lib/system/background/job/UnfurlUrlBackgroundJob.class.php b/wcfsetup/install/files/lib/system/background/job/UnfurlUrlBackgroundJob.class.php index 2e97f94240..08d1c4c200 100644 --- a/wcfsetup/install/files/lib/system/background/job/UnfurlUrlBackgroundJob.class.php +++ b/wcfsetup/install/files/lib/system/background/job/UnfurlUrlBackgroundJob.class.php @@ -169,9 +169,9 @@ final class UnfurlUrlBackgroundJob extends AbstractBackgroundJob private static function getImageIdByUrl(string $url): ?int { $sql = "SELECT imageID - FROM wcf" . WCF_N . "_unfurl_url_image + FROM wcf1_unfurl_url_image WHERE imageUrlHash = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([\sha1($url)]); $imageID = $statement->fetchSingleColumn(); diff --git a/wcfsetup/install/files/lib/system/box/ArticleCommentListBoxController.class.php b/wcfsetup/install/files/lib/system/box/ArticleCommentListBoxController.class.php index 91578710a2..94d3c6a714 100644 --- a/wcfsetup/install/files/lib/system/box/ArticleCommentListBoxController.class.php +++ b/wcfsetup/install/files/lib/system/box/ArticleCommentListBoxController.class.php @@ -30,9 +30,9 @@ class ArticleCommentListBoxController extends AbstractCommentListBoxController $accessibleCategoryIDs = ArticleCategory::getAccessibleCategoryIDs(); if (!empty($accessibleCategoryIDs)) { $commentList->sqlJoins .= ' - INNER JOIN wcf' . WCF_N . '_article_content article_content + INNER JOIN wcf1_article_content article_content ON article_content.articleContentID = comment.objectID - INNER JOIN wcf' . WCF_N . '_article article + INNER JOIN wcf1_article article ON article.articleID = article_content.articleID'; $commentList->sqlSelects = 'article_content.title'; diff --git a/wcfsetup/install/files/lib/system/box/BoxHandler.class.php b/wcfsetup/install/files/lib/system/box/BoxHandler.class.php index 4dae577d31..65642c69bf 100644 --- a/wcfsetup/install/files/lib/system/box/BoxHandler.class.php +++ b/wcfsetup/install/files/lib/system/box/BoxHandler.class.php @@ -177,13 +177,13 @@ class BoxHandler extends SingletonFactory (box.visibleEverywhere = ? AND boxID NOT IN ( SELECT boxID - FROM wcf' . WCF_N . '_box_to_page + FROM wcf1_box_to_page WHERE pageID = ? AND visible = ? )) OR boxID IN ( SELECT boxID - FROM wcf' . WCF_N . '_box_to_page + FROM wcf1_box_to_page WHERE pageID = ? AND visible = ? ) @@ -203,9 +203,9 @@ class BoxHandler extends SingletonFactory $showOrders = []; if ($pageID) { $sql = "SELECT boxID, showOrder - FROM wcf" . WCF_N . "_page_box_order + FROM wcf1_page_box_order WHERE pageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$pageID]); while ($row = $statement->fetchArray()) { $showOrders[$row['boxID']] = $row['showOrder']; @@ -262,9 +262,9 @@ class BoxHandler extends SingletonFactory public static function hasCustomShowOrder($pageID) { $sql = "SELECT COUNT(*) AS count - FROM wcf" . WCF_N . "_page_box_order + FROM wcf1_page_box_order WHERE pageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$pageID]); return $statement->fetchSingleColumn() > 0; diff --git a/wcfsetup/install/files/lib/system/box/ProfileCommentListBoxController.class.php b/wcfsetup/install/files/lib/system/box/ProfileCommentListBoxController.class.php index 8d80d2633b..2c3f2aee43 100644 --- a/wcfsetup/install/files/lib/system/box/ProfileCommentListBoxController.class.php +++ b/wcfsetup/install/files/lib/system/box/ProfileCommentListBoxController.class.php @@ -33,7 +33,7 @@ class ProfileCommentListBoxController extends AbstractCommentListBoxController if (WCF::getSession()->getPermission('user.profile.canViewUserProfile')) { $optionID = User::getUserOptionID('canViewProfile'); $commentList->sqlJoins .= ' - INNER JOIN wcf' . WCF_N . '_user_option_value user_option_value + INNER JOIN wcf1_user_option_value user_option_value ON user_option_value.userID = comment.objectID'; if (WCF::getUser()->userID) { diff --git a/wcfsetup/install/files/lib/system/box/StaffOnlineListBoxController.class.php b/wcfsetup/install/files/lib/system/box/StaffOnlineListBoxController.class.php index 9d49d29487..8e788e0be3 100644 --- a/wcfsetup/install/files/lib/system/box/StaffOnlineListBoxController.class.php +++ b/wcfsetup/install/files/lib/system/box/StaffOnlineListBoxController.class.php @@ -29,10 +29,10 @@ class StaffOnlineListBoxController extends AbstractDatabaseObjectListBoxControll $objectList->getConditionBuilder()->add( 'session.userID IN ( SELECT userID - FROM wcf' . WCF_N . '_user_to_group + FROM wcf1_user_to_group WHERE groupID IN ( SELECT groupID - FROM wcf' . WCF_N . '_user_group + FROM wcf1_user_group WHERE showOnTeamPage = ? ) )', diff --git a/wcfsetup/install/files/lib/system/box/UserTrophyListBoxController.class.php b/wcfsetup/install/files/lib/system/box/UserTrophyListBoxController.class.php index 1220f580e1..126530e457 100644 --- a/wcfsetup/install/files/lib/system/box/UserTrophyListBoxController.class.php +++ b/wcfsetup/install/files/lib/system/box/UserTrophyListBoxController.class.php @@ -76,18 +76,18 @@ class UserTrophyListBoxController extends AbstractDatabaseObjectListBoxControlle $list->sqlConditionJoins .= ' '; } $list->sqlJoins .= ' - LEFT JOIN wcf' . WCF_N . '_trophy trophy + LEFT JOIN wcf1_trophy trophy ON user_trophy.trophyID = trophy.trophyID'; $list->sqlConditionJoins .= ' - LEFT JOIN wcf' . WCF_N . '_trophy trophy + LEFT JOIN wcf1_trophy trophy ON user_trophy.trophyID = trophy.trophyID'; // trophy category join $list->sqlJoins .= ' - LEFT JOIN wcf' . WCF_N . '_category category + LEFT JOIN wcf1_category category ON trophy.categoryID = category.categoryID'; $list->sqlConditionJoins .= ' - LEFT JOIN wcf' . WCF_N . '_category category + LEFT JOIN wcf1_category category ON trophy.categoryID = category.categoryID'; $list->getConditionBuilder()->add('trophy.isDisabled = ?', [0]); @@ -97,14 +97,14 @@ class UserTrophyListBoxController extends AbstractDatabaseObjectListBoxControlle if (!WCF::getUser()->userID) { $list->getConditionBuilder()->add('user_trophy.userID IN ( SELECT userID - FROM wcf' . WCF_N . '_user_option_value + FROM wcf1_user_option_value WHERE userOption' . $canViewTrophiesOptionID . ' = 0 )'); } elseif (!WCF::getSession()->getPermission('admin.general.canViewPrivateUserOptions')) { $conditionBuilder = new PreparedStatementConditionBuilder(false, 'OR'); $conditionBuilder->add('user_trophy.userID IN ( SELECT userID - FROM wcf' . WCF_N . '_user_option_value + FROM wcf1_user_option_value WHERE ( userOption' . $canViewTrophiesOptionID . ' = 0 OR userOption' . $canViewTrophiesOptionID . ' = 1 @@ -114,13 +114,13 @@ class UserTrophyListBoxController extends AbstractDatabaseObjectListBoxControlle $friendshipConditionBuilder = new PreparedStatementConditionBuilder(false); $friendshipConditionBuilder->add('user_trophy.userID IN ( SELECT userID - FROM wcf' . WCF_N . '_user_option_value + FROM wcf1_user_option_value WHERE userOption' . $canViewTrophiesOptionID . ' = 2 )'); $friendshipConditionBuilder->add( 'user_trophy.userID IN ( SELECT userID - FROM wcf' . WCF_N . '_user_follow + FROM wcf1_user_follow WHERE followUserID = ? )', [WCF::getUser()->userID] diff --git a/wcfsetup/install/files/lib/system/box/command/CreateBoxToPageAssignments.class.php b/wcfsetup/install/files/lib/system/box/command/CreateBoxToPageAssignments.class.php index 0cd5c3a473..1d312a042e 100644 --- a/wcfsetup/install/files/lib/system/box/command/CreateBoxToPageAssignments.class.php +++ b/wcfsetup/install/files/lib/system/box/command/CreateBoxToPageAssignments.class.php @@ -46,18 +46,18 @@ final class CreateBoxToPageAssignments } if (($this->visible && $box->visibleEverywhere) || (!$this->visible && !$box->visibleEverywhere)) { - $sql = "DELETE FROM wcf" . WCF_N . "_box_to_page + $sql = "DELETE FROM wcf1_box_to_page WHERE boxID = ? AND pageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($pages as $page) { $statement->execute([$box->boxID, $page->pageID]); } } else { - $sql = "REPLACE INTO wcf" . WCF_N . "_box_to_page + $sql = "REPLACE INTO wcf1_box_to_page (boxID, pageID, visible) VALUES (?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($pages as $page) { $statement->execute([$box->boxID, $page->pageID, $this->visible ? 1 : 0]); } diff --git a/wcfsetup/install/files/lib/system/bulk/processing/user/AbstractUserBulkProcessingAction.class.php b/wcfsetup/install/files/lib/system/bulk/processing/user/AbstractUserBulkProcessingAction.class.php index bc4733c4da..02949f18f4 100644 --- a/wcfsetup/install/files/lib/system/bulk/processing/user/AbstractUserBulkProcessingAction.class.php +++ b/wcfsetup/install/files/lib/system/bulk/processing/user/AbstractUserBulkProcessingAction.class.php @@ -41,9 +41,9 @@ abstract class AbstractUserBulkProcessingAction extends AbstractBulkProcessingAc $conditionBuilder->add('userID IN (?)', [$userList->getObjectIDs()]); $sql = "SELECT userID, groupID - FROM wcf" . WCF_N . "_user_to_group + FROM wcf1_user_to_group " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); $groupIDs = $statement->fetchMap('userID', 'groupID', false); diff --git a/wcfsetup/install/files/lib/system/cache/builder/ArticleCategoryLabelCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/ArticleCategoryLabelCacheBuilder.class.php index 3ee986867d..670c322fc0 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/ArticleCategoryLabelCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/ArticleCategoryLabelCacheBuilder.class.php @@ -32,16 +32,16 @@ class ArticleCategoryLabelCacheBuilder extends AbstractCacheBuilder $conditionBuilder->add( 'objectID IN ( SELECT categoryID - FROM wcf' . WCF_N . '_category + FROM wcf1_category WHERE objectTypeID = ? )', [CategoryHandler::getInstance()->getObjectTypeByName('com.woltlab.wcf.article.category')->objectTypeID] ); $sql = "SELECT groupID, objectID - FROM wcf" . WCF_N . "_label_group_to_object + FROM wcf1_label_group_to_object " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); return $statement->fetchMap('objectID', 'groupID', false); diff --git a/wcfsetup/install/files/lib/system/cache/builder/BBCodeCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/BBCodeCacheBuilder.class.php index 7f3636ab10..a61283155f 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/BBCodeCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/BBCodeCacheBuilder.class.php @@ -25,11 +25,11 @@ class BBCodeCacheBuilder extends AbstractCacheBuilder // get attributes $sql = "SELECT attribute.*, bbcode.bbcodeTag - FROM wcf" . WCF_N . "_bbcode_attribute attribute - LEFT JOIN wcf" . WCF_N . "_bbcode bbcode + FROM wcf1_bbcode_attribute attribute + LEFT JOIN wcf1_bbcode bbcode ON bbcode.bbcodeID = attribute.bbcodeID ORDER BY attribute.attributeNo"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(); while ($row = $statement->fetchArray()) { if (!isset($attributes[$row['bbcodeTag']])) { diff --git a/wcfsetup/install/files/lib/system/cache/builder/CategoryCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/CategoryCacheBuilder.class.php index cec9ed9ec9..f83e43d184 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/CategoryCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/CategoryCacheBuilder.class.php @@ -21,7 +21,7 @@ class CategoryCacheBuilder extends AbstractCacheBuilder $list = new CategoryList(); $list->sqlSelects = "object_type.objectType"; $list->sqlJoins = " - LEFT JOIN wcf" . WCF_N . "_object_type object_type + LEFT JOIN wcf1_object_type object_type ON object_type.objectTypeID = category.objectTypeID"; $list->sqlOrderBy = "category.showOrder ASC"; $list->readObjects(); diff --git a/wcfsetup/install/files/lib/system/cache/builder/ClipboardPageCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/ClipboardPageCacheBuilder.class.php index ce30dcece1..57831ccd22 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/ClipboardPageCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/ClipboardPageCacheBuilder.class.php @@ -19,8 +19,8 @@ class ClipboardPageCacheBuilder extends AbstractCacheBuilder public function rebuild(array $parameters) { $sql = "SELECT pageClassName, actionID - FROM wcf" . WCF_N . "_clipboard_page"; - $statement = WCF::getDB()->prepareStatement($sql); + FROM wcf1_clipboard_page"; + $statement = WCF::getDB()->prepare($sql); $statement->execute(); return $statement->fetchMap('pageClassName', 'actionID', false); diff --git a/wcfsetup/install/files/lib/system/cache/builder/CronjobCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/CronjobCacheBuilder.class.php index 180710ae2f..b4b6474958 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/CronjobCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/CronjobCacheBuilder.class.php @@ -20,9 +20,9 @@ class CronjobCacheBuilder extends AbstractCacheBuilder { $sql = "SELECT MIN(nextExec) AS nextExec, MIN(afterNextExec) AS afterNextExec - FROM wcf" . WCF_N . "_cronjob + FROM wcf1_cronjob WHERE isDisabled = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([0]); $row = $statement->fetchArray(); diff --git a/wcfsetup/install/files/lib/system/cache/builder/EventListenerCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/EventListenerCacheBuilder.class.php index 4be8c008d2..78b454404f 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/EventListenerCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/EventListenerCacheBuilder.class.php @@ -34,9 +34,9 @@ class EventListenerCacheBuilder extends AbstractCacheBuilder ]; $sql = "SELECT * - FROM wcf" . WCF_N . "_event_listener + FROM wcf1_event_listener ORDER BY niceValue ASC, listenerClassName ASC"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(); /** @var EventListener $eventListener */ diff --git a/wcfsetup/install/files/lib/system/cache/builder/ObjectTypeCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/ObjectTypeCacheBuilder.class.php index 2a764448a1..1a05b981d8 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/ObjectTypeCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/ObjectTypeCacheBuilder.class.php @@ -29,8 +29,8 @@ class ObjectTypeCacheBuilder extends AbstractCacheBuilder // get definitions $sql = "SELECT * - FROM wcf" . WCF_N . "_object_type_definition"; - $statement = WCF::getDB()->prepareStatement($sql); + FROM wcf1_object_type_definition"; + $statement = WCF::getDB()->prepare($sql); $statement->execute(); while ($row = $statement->fetchArray()) { $data['definitions'][$row['definitionID']] = new ObjectTypeDefinition(null, $row); @@ -46,8 +46,8 @@ class ObjectTypeCacheBuilder extends AbstractCacheBuilder // get object types $sql = "SELECT * - FROM wcf" . WCF_N . "_object_type object_type"; - $statement = WCF::getDB()->prepareStatement($sql); + FROM wcf1_object_type object_type"; + $statement = WCF::getDB()->prepare($sql); $statement->execute(); while ($row = $statement->fetchArray()) { $data['objectTypes'][$row['objectTypeID']] = $objectType = new ObjectType(null, $row); diff --git a/wcfsetup/install/files/lib/system/cache/builder/OptionCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/OptionCacheBuilder.class.php index 2ff47dd0ff..d0e7fdb613 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/OptionCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/OptionCacheBuilder.class.php @@ -47,9 +47,9 @@ class OptionCacheBuilder extends AbstractCacheBuilder // option categories $sql = "SELECT * - FROM " . $this->application . WCF_N . "_" . $this->tableName . "_category + FROM " . $this->application . "1_" . $this->tableName . "_category ORDER BY showOrder"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(); while ($category = $statement->fetchObject(OptionCategory::class)) { $data['categories'][$category->categoryName] = $category; @@ -62,9 +62,9 @@ class OptionCacheBuilder extends AbstractCacheBuilder // options $sql = "SELECT * - FROM " . $this->application . WCF_N . "_" . $this->tableName . " + FROM " . $this->application . "1_" . $this->tableName . " ORDER BY showOrder"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(); while ($row = $statement->fetchArray()) { diff --git a/wcfsetup/install/files/lib/system/cache/builder/PageCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/PageCacheBuilder.class.php index 5031a105da..0027a366ee 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/PageCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/PageCacheBuilder.class.php @@ -36,8 +36,8 @@ class PageCacheBuilder extends AbstractCacheBuilder // get page titles $sql = "SELECT pageID, languageID, title, metaDescription - FROM wcf" . WCF_N . "_page_content"; - $statement = WCF::getDB()->prepareStatement($sql); + FROM wcf1_page_content"; + $statement = WCF::getDB()->prepare($sql); $statement->execute(); while ($row = $statement->fetchArray()) { $pageID = $row['pageID']; diff --git a/wcfsetup/install/files/lib/system/cache/builder/SimpleAclCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/SimpleAclCacheBuilder.class.php index 6367cb4966..0d4a5259fa 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/SimpleAclCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/SimpleAclCacheBuilder.class.php @@ -24,9 +24,9 @@ class SimpleAclCacheBuilder extends AbstractCacheBuilder $objectTypeID = SimpleAclHandler::getInstance()->getObjectTypeID($parameters['objectType']); $sql = "SELECT objectID, userID - FROM wcf" . WCF_N . "_acl_simple_to_user + FROM wcf1_acl_simple_to_user WHERE objectTypeID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$objectTypeID]); while ($row = $statement->fetchArray()) { $objectID = $row['objectID']; @@ -42,9 +42,9 @@ class SimpleAclCacheBuilder extends AbstractCacheBuilder } $sql = "SELECT objectID, groupID - FROM wcf" . WCF_N . "_acl_simple_to_group + FROM wcf1_acl_simple_to_group WHERE objectTypeID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$objectTypeID]); while ($row = $statement->fetchArray()) { $objectID = $row['objectID']; diff --git a/wcfsetup/install/files/lib/system/cache/builder/SmileyCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/SmileyCacheBuilder.class.php index 218a7baa98..9b841c4a52 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/SmileyCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/SmileyCacheBuilder.class.php @@ -23,9 +23,9 @@ class SmileyCacheBuilder extends AbstractCacheBuilder // get smilies $sql = "SELECT * - FROM wcf" . WCF_N . "_smiley + FROM wcf1_smiley ORDER BY showOrder"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(); /** @var Smiley $object */ diff --git a/wcfsetup/install/files/lib/system/cache/builder/StyleCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/StyleCacheBuilder.class.php index 187a3d7b5b..e50331d6c1 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/StyleCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/StyleCacheBuilder.class.php @@ -26,9 +26,9 @@ class StyleCacheBuilder extends AbstractCacheBuilder // get all styles $sql = "SELECT * - FROM wcf" . WCF_N . "_style + FROM wcf1_style ORDER BY styleName ASC"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(); while ($row = $statement->fetchArray()) { if ($row['isDefault']) { diff --git a/wcfsetup/install/files/lib/system/cache/builder/TagCloudCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/TagCloudCacheBuilder.class.php index afd0717e0b..7b6d2df975 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/TagCloudCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/TagCloudCacheBuilder.class.php @@ -89,13 +89,13 @@ class TagCloudCacheBuilder extends AbstractCacheBuilder $conditionBuilder->add('object.objectTypeID IN (?)', [$this->objectTypeIDs]); $conditionBuilder->add('tag.languageID IN (?)', [$this->languageIDs]); $sql = "SELECT tag.tagID, COUNT(*) AS counter - FROM wcf" . WCF_N . "_tag_to_object object - INNER JOIN wcf" . WCF_N . "_tag tag + FROM wcf1_tag_to_object object + INNER JOIN wcf1_tag tag ON tag.tagID = object.tagID " . $conditionBuilder . " GROUP BY tag.tagID ORDER BY counter DESC"; - $statement = WCF::getDB()->prepareStatement($sql, 500); + $statement = WCF::getDB()->prepare($sql, 500); $statement->execute($conditionBuilder->getParameters()); $tagIDs = $statement->fetchMap('tagID', 'counter'); @@ -104,9 +104,9 @@ class TagCloudCacheBuilder extends AbstractCacheBuilder $conditionBuilder = new PreparedStatementConditionBuilder(); $conditionBuilder->add('tagID IN (?)', [\array_keys($tagIDs)]); $sql = "SELECT * - FROM wcf" . WCF_N . "_tag + FROM wcf1_tag " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); while ($row = $statement->fetchArray()) { $row['counter'] = $tagIDs[$row['tagID']]; diff --git a/wcfsetup/install/files/lib/system/cache/builder/UserBirthdayCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/UserBirthdayCacheBuilder.class.php index 816addf3e4..728949fc41 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/UserBirthdayCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/UserBirthdayCacheBuilder.class.php @@ -33,9 +33,9 @@ class UserBirthdayCacheBuilder extends AbstractCacheBuilder $data = []; $birthday = 'userOption' . $userOptionID; $sql = "SELECT userID, " . $birthday . " - FROM wcf" . WCF_N . "_user_option_value + FROM wcf1_user_option_value WHERE " . $birthday . " LIKE ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(['%-' . ($parameters['month'] < 10 ? '0' : '') . $parameters['month'] . '-%']); while ($row = $statement->fetchArray()) { [, $month, $day] = \explode('-', $row[$birthday]); diff --git a/wcfsetup/install/files/lib/system/cache/builder/UserGroupPermissionCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/UserGroupPermissionCacheBuilder.class.php index a06fc8704f..4ab4cf826b 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/UserGroupPermissionCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/UserGroupPermissionCacheBuilder.class.php @@ -38,9 +38,9 @@ class UserGroupPermissionCacheBuilder extends AbstractCacheBuilder foreach ($parameters as $groupID) { if (UserGroup::getGroupByID($groupID)->groupType == UserGroup::GUESTS) { $sql = "SELECT optionName, additionalData - FROM wcf" . WCF_N . "_user_group_option + FROM wcf1_user_group_option WHERE optionType = 'boolean'"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(); while ($option = $statement->fetchObject(UserGroupOption::class)) { if ($option->excludedInTinyBuild) { @@ -64,11 +64,11 @@ class UserGroupPermissionCacheBuilder extends AbstractCacheBuilder option_value.groupID, option_table.enableOptions, option_table.usersOnly - FROM wcf" . WCF_N . "_user_group_option_value option_value - LEFT JOIN wcf" . WCF_N . "_user_group_option option_table + FROM wcf1_user_group_option_value option_value + LEFT JOIN wcf1_user_group_option option_table ON option_table.optionID = option_value.optionID " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); while ($row = $statement->fetchArray()) { if ( diff --git a/wcfsetup/install/files/lib/system/cache/builder/UserMenuCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/UserMenuCacheBuilder.class.php index f6828f1e7f..a4919fdb31 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/UserMenuCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/UserMenuCacheBuilder.class.php @@ -24,10 +24,10 @@ class UserMenuCacheBuilder extends AbstractCacheBuilder // get all option categories $sql = "SELECT * - FROM wcf" . WCF_N . "_user_option_category + FROM wcf1_user_option_category WHERE parentCategoryName = ? ORDER BY showOrder ASC"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(['settings']); while ($row = $statement->fetchArray()) { if (!isset($data['wcf.user.menu.settings'])) { @@ -49,9 +49,9 @@ class UserMenuCacheBuilder extends AbstractCacheBuilder // get all menu items $sql = "SELECT * - FROM wcf" . WCF_N . "_user_menu_item + FROM wcf1_user_menu_item ORDER BY showOrder ASC"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(); while ($row = $statement->fetchArray()) { if (!isset($data[$row['parentMenuItem']])) { diff --git a/wcfsetup/install/files/lib/system/cache/builder/UserNotificationEventCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/UserNotificationEventCacheBuilder.class.php index 52dd5cfe2c..da0973c15f 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/UserNotificationEventCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/UserNotificationEventCacheBuilder.class.php @@ -23,10 +23,10 @@ class UserNotificationEventCacheBuilder extends AbstractCacheBuilder // get events $sql = "SELECT event.*, object_type.objectType - FROM wcf" . WCF_N . "_user_notification_event event - LEFT JOIN wcf" . WCF_N . "_object_type object_type + FROM wcf1_user_notification_event event + LEFT JOIN wcf1_object_type object_type ON object_type.objectTypeID = event.objectTypeID"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(); while ($row = $statement->fetchArray()) { if (!isset($data[$row['objectType']])) { diff --git a/wcfsetup/install/files/lib/system/cache/builder/UserStatsCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/UserStatsCacheBuilder.class.php index 7ac5cd7bb9..b138be9568 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/UserStatsCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/UserStatsCacheBuilder.class.php @@ -28,16 +28,16 @@ class UserStatsCacheBuilder extends AbstractCacheBuilder // number of members $sql = "SELECT COUNT(*) AS amount - FROM wcf" . WCF_N . "_user"; - $statement = WCF::getDB()->prepareStatement($sql); + FROM wcf1_user"; + $statement = WCF::getDB()->prepare($sql); $statement->execute(); $data['members'] = $statement->fetchColumn(); // newest member $sql = "SELECT userID - FROM wcf" . WCF_N . "_user + FROM wcf1_user ORDER BY userID DESC"; - $statement = WCF::getDB()->prepareStatement($sql, 1); + $statement = WCF::getDB()->prepare($sql, 1); $statement->execute(); $data['newestMember'] = UserProfileRuntimeCache::getInstance()->getObject($statement->fetchSingleColumn()); diff --git a/wcfsetup/install/files/lib/system/cache/builder/WhoWasOnlineCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/WhoWasOnlineCacheBuilder.class.php index 8c7bd5eecb..d498afcb50 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/WhoWasOnlineCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/WhoWasOnlineCacheBuilder.class.php @@ -26,15 +26,15 @@ class WhoWasOnlineCacheBuilder extends AbstractCacheBuilder $userIDs = []; $sql = "( SELECT userID - FROM wcf" . WCF_N . "_user + FROM wcf1_user WHERE lastActivityTime > ? ) UNION ( SELECT userID - FROM wcf" . WCF_N . "_session + FROM wcf1_session WHERE userID IS NOT NULL AND lastActivityTime > ? )"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([TIME_NOW - 86400, TIME_NOW - USER_ONLINE_TIMEOUT]); while ($userID = $statement->fetchColumn()) { $userIDs[] = $userID; diff --git a/wcfsetup/install/files/lib/system/category/AbstractCategoryType.class.php b/wcfsetup/install/files/lib/system/category/AbstractCategoryType.class.php index 90e618b88b..b55489ebf3 100644 --- a/wcfsetup/install/files/lib/system/category/AbstractCategoryType.class.php +++ b/wcfsetup/install/files/lib/system/category/AbstractCategoryType.class.php @@ -71,10 +71,10 @@ abstract class AbstractCategoryType extends SingletonFactory implements ICategor // move child categories to parent category $conditionBuilder = new PreparedStatementConditionBuilder(); $conditionBuilder->add("categoryID IN (?)", [$categoryIDs]); - $sql = "UPDATE wcf" . WCF_N . "_category + $sql = "UPDATE wcf1_category SET parentCategoryID = ? " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(\array_merge([$categoryEditor->parentCategoryID], $conditionBuilder->getParameters())); } diff --git a/wcfsetup/install/files/lib/system/category/TrophyCategoryType.class.php b/wcfsetup/install/files/lib/system/category/TrophyCategoryType.class.php index da3945c902..a0f6c6f57b 100644 --- a/wcfsetup/install/files/lib/system/category/TrophyCategoryType.class.php +++ b/wcfsetup/install/files/lib/system/category/TrophyCategoryType.class.php @@ -67,9 +67,9 @@ class TrophyCategoryType extends AbstractCategoryType $userTrophyList->sqlJoins .= ' '; } $userTrophyList->sqlJoins .= ' - LEFT JOIN wcf' . WCF_N . '_trophy trophy + LEFT JOIN wcf1_trophy trophy ON user_trophy.trophyID = trophy.trophyID - LEFT JOIN wcf' . WCF_N . '_category category + LEFT JOIN wcf1_category category ON trophy.categoryID = category.categoryID'; $userTrophyList->getConditionBuilder()->add('trophy.isDisabled = ?', [0]); diff --git a/wcfsetup/install/files/lib/system/cli/command/ImportCLICommand.class.php b/wcfsetup/install/files/lib/system/cli/command/ImportCLICommand.class.php index 1080990753..c37deb78bc 100644 --- a/wcfsetup/install/files/lib/system/cli/command/ImportCLICommand.class.php +++ b/wcfsetup/install/files/lib/system/cli/command/ImportCLICommand.class.php @@ -129,8 +129,8 @@ class ImportCLICommand implements ICLICommand // step 1) previous import $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_import_mapping"; - $statement = WCF::getDB()->prepareStatement($sql); + FROM wcf1_import_mapping"; + $statement = WCF::getDB()->prepare($sql); $statement->execute(); if ($statement->fetchSingleColumn()) { CLIWCF::getReader()->println(StringUtil::stripHTML(WCF::getLanguage()->getDynamicVariable('wcf.acp.dataImport.existingMapping.notice'))); diff --git a/wcfsetup/install/files/lib/system/clipboard/ClipboardHandler.class.php b/wcfsetup/install/files/lib/system/clipboard/ClipboardHandler.class.php index 77999a9e9d..4dda5691a3 100644 --- a/wcfsetup/install/files/lib/system/clipboard/ClipboardHandler.class.php +++ b/wcfsetup/install/files/lib/system/clipboard/ClipboardHandler.class.php @@ -101,10 +101,10 @@ class ClipboardHandler extends SingletonFactory // remove existing entries first, prevents conflict with INSERT $this->unmark($objectIDs, $objectTypeID); - $sql = "INSERT INTO wcf" . WCF_N . "_clipboard_item + $sql = "INSERT INTO wcf1_clipboard_item (objectTypeID, userID, objectID) VALUES (?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($objectIDs as $objectID) { $statement->execute([ $objectTypeID, @@ -131,9 +131,9 @@ class ClipboardHandler extends SingletonFactory $conditions->add("objectID IN (?)", [$objectIDs]); $conditions->add("userID = ?", [WCF::getUser()->userID]); - $sql = "DELETE FROM wcf" . WCF_N . "_clipboard_item + $sql = "DELETE FROM wcf1_clipboard_item " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); } @@ -144,10 +144,10 @@ class ClipboardHandler extends SingletonFactory */ public function unmarkAll($objectTypeID) { - $sql = "DELETE FROM wcf" . WCF_N . "_clipboard_item + $sql = "DELETE FROM wcf1_clipboard_item WHERE objectTypeID = ? AND userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $objectTypeID, WCF::getUser()->userID, @@ -227,9 +227,9 @@ class ClipboardHandler extends SingletonFactory // fetch object ids $sql = "SELECT objectTypeID, objectID - FROM wcf" . WCF_N . "_clipboard_item + FROM wcf1_clipboard_item " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); // group object ids by type name @@ -282,9 +282,9 @@ class ClipboardHandler extends SingletonFactory $conditions->add("userID = ?", [WCF::getUser()->userID]); $conditions->add("objectID IN (?)", [$objectData['objectIDs']]); - $sql = "DELETE FROM wcf" . WCF_N . "_clipboard_item + $sql = "DELETE FROM wcf1_clipboard_item " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); } } @@ -432,9 +432,9 @@ class ClipboardHandler extends SingletonFactory $conditions->add("objectTypeID = ?", [$typeID]); } - $sql = "DELETE FROM wcf" . WCF_N . "_clipboard_item + $sql = "DELETE FROM wcf1_clipboard_item " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); } @@ -457,9 +457,9 @@ class ClipboardHandler extends SingletonFactory } $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_clipboard_item + FROM wcf1_clipboard_item " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); return $statement->fetchSingleColumn() ? 1 : 0; diff --git a/wcfsetup/install/files/lib/system/clipboard/action/UserClipboardAction.class.php b/wcfsetup/install/files/lib/system/clipboard/action/UserClipboardAction.class.php index 6e63ed1c24..ffc45ccd16 100644 --- a/wcfsetup/install/files/lib/system/clipboard/action/UserClipboardAction.class.php +++ b/wcfsetup/install/files/lib/system/clipboard/action/UserClipboardAction.class.php @@ -179,9 +179,9 @@ class UserClipboardAction extends AbstractClipboardAction $conditions->add("userID IN (?)", [$userIDs]); $sql = "SELECT userID, groupID - FROM wcf" . WCF_N . "_user_to_group + FROM wcf1_user_to_group " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $userToGroup = $statement->fetchMap('userID', 'groupID', false); diff --git a/wcfsetup/install/files/lib/system/comment/CommentHandler.class.php b/wcfsetup/install/files/lib/system/comment/CommentHandler.class.php index dc6a9377be..a395b12893 100644 --- a/wcfsetup/install/files/lib/system/comment/CommentHandler.class.php +++ b/wcfsetup/install/files/lib/system/comment/CommentHandler.class.php @@ -282,7 +282,7 @@ class CommentHandler extends SingletonFactory ); $notificationList->getConditionBuilder()->add('user_notification.userID = ?', [WCF::getUser()->userID]); $notificationList->sqlJoins .= " - LEFT JOIN wcf" . WCF_N . "_comment comment + LEFT JOIN wcf1_comment comment ON comment.commentID = user_notification.objectID AND comment.objectTypeID = " . \intval($this->getObjectTypeID($objectType)); $notificationList->getConditionBuilder()->add('comment.objectID IN (?)', [$objectIDs]); @@ -331,7 +331,7 @@ class CommentHandler extends SingletonFactory ); $notificationList->getConditionBuilder()->add('user_notification.userID = ?', [WCF::getUser()->userID]); $notificationList->sqlJoins .= " - LEFT JOIN wcf" . WCF_N . "_comment comment + LEFT JOIN wcf1_comment comment ON comment.commentID = user_notification.baseObjectID AND comment.objectTypeID = " . \intval($this->getObjectTypeID($objectType)); $notificationList->getConditionBuilder()->add('comment.objectID IN (?)', [$objectIDs]); @@ -380,9 +380,9 @@ class CommentHandler extends SingletonFactory ); $notificationList->getConditionBuilder()->add('user_notification.userID = ?', [WCF::getUser()->userID]); $notificationList->sqlJoins .= " - LEFT JOIN wcf" . WCF_N . "_comment_response comment_response + LEFT JOIN wcf1_comment_response comment_response ON comment_response.responseID = user_notification.objectID - LEFT JOIN wcf" . WCF_N . "_comment comment + LEFT JOIN wcf1_comment comment ON comment.commentID = comment_response.commentID"; $notificationList->getConditionBuilder()->add( 'comment.objectTypeID IN (?)', @@ -434,9 +434,9 @@ class CommentHandler extends SingletonFactory ); $notificationList->getConditionBuilder()->add('user_notification.userID = ?', [WCF::getUser()->userID]); $notificationList->sqlJoins .= " - LEFT JOIN wcf" . WCF_N . "_comment_response comment_response + LEFT JOIN wcf1_comment_response comment_response ON comment_response.responseID = user_notification.baseObjectID - LEFT JOIN wcf" . WCF_N . "_comment comment + LEFT JOIN wcf1_comment comment ON comment.commentID = comment_response.commentID"; $notificationList->getConditionBuilder()->add( 'comment.objectTypeID IN (?)', diff --git a/wcfsetup/install/files/lib/system/condition/UserGroupCondition.class.php b/wcfsetup/install/files/lib/system/condition/UserGroupCondition.class.php index f445907d50..93c3f69774 100644 --- a/wcfsetup/install/files/lib/system/condition/UserGroupCondition.class.php +++ b/wcfsetup/install/files/lib/system/condition/UserGroupCondition.class.php @@ -80,7 +80,7 @@ class UserGroupCondition extends AbstractMultipleFieldsCondition implements $objectList->getConditionBuilder()->add( $tableName . '.userID IN ( SELECT userID - FROM wcf' . WCF_N . '_user_to_group + FROM wcf1_user_to_group WHERE groupID IN (?) GROUP BY userID HAVING COUNT(userID) = ? @@ -92,7 +92,7 @@ class UserGroupCondition extends AbstractMultipleFieldsCondition implements $objectList->getConditionBuilder()->add( $tableName . '.userID NOT IN ( SELECT userID - FROM wcf' . WCF_N . '_user_to_group + FROM wcf1_user_to_group WHERE groupID IN (?) )', [$conditionData['notGroupIDs']] diff --git a/wcfsetup/install/files/lib/system/condition/UserTrophyCondition.class.php b/wcfsetup/install/files/lib/system/condition/UserTrophyCondition.class.php index 801ba0f125..ecb7e6d79b 100644 --- a/wcfsetup/install/files/lib/system/condition/UserTrophyCondition.class.php +++ b/wcfsetup/install/files/lib/system/condition/UserTrophyCondition.class.php @@ -76,7 +76,7 @@ class UserTrophyCondition extends AbstractMultipleFieldsCondition implements $objectList->getConditionBuilder()->add( 'user_table.userID IN ( SELECT userID - FROM wcf' . WCF_N . '_user_trophy + FROM wcf1_user_trophy WHERE trophyID IN (?) GROUP BY userID HAVING COUNT(DISTINCT trophyID) = ? @@ -88,7 +88,7 @@ class UserTrophyCondition extends AbstractMultipleFieldsCondition implements $objectList->getConditionBuilder()->add( 'user_table.userID NOT IN ( SELECT userID - FROM wcf' . WCF_N . '_user_trophy + FROM wcf1_user_trophy WHERE trophyID IN (?) )', [$conditionData['notUserTrophyIDs']] diff --git a/wcfsetup/install/files/lib/system/cronjob/AttachmentCleanUpCronjob.class.php b/wcfsetup/install/files/lib/system/cronjob/AttachmentCleanUpCronjob.class.php index f3e6b383e3..4ae7c48057 100644 --- a/wcfsetup/install/files/lib/system/cronjob/AttachmentCleanUpCronjob.class.php +++ b/wcfsetup/install/files/lib/system/cronjob/AttachmentCleanUpCronjob.class.php @@ -60,10 +60,10 @@ class AttachmentCleanUpCronjob extends AbstractCronjob protected function getOldContactAttachmentIDs() { $sql = "SELECT attachmentID - FROM wcf" . WCF_N . "_attachment + FROM wcf1_attachment WHERE objectTypeID = ? AND uploadTime < ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ ObjectTypeCache::getInstance() ->getObjectTypeIDByName('com.woltlab.wcf.attachment.objectType', 'com.woltlab.wcf.contact'), diff --git a/wcfsetup/install/files/lib/system/cronjob/BackgroundQueueCleanUpCronjob.class.php b/wcfsetup/install/files/lib/system/cronjob/BackgroundQueueCleanUpCronjob.class.php index 60a750f616..c7a53b3450 100644 --- a/wcfsetup/install/files/lib/system/cronjob/BackgroundQueueCleanUpCronjob.class.php +++ b/wcfsetup/install/files/lib/system/cronjob/BackgroundQueueCleanUpCronjob.class.php @@ -32,12 +32,12 @@ class BackgroundQueueCleanUpCronjob extends AbstractCronjob $uniqueJobs = []; try { $sql = "SELECT jobID, job - FROM wcf" . WCF_N . "_background_job + FROM wcf1_background_job WHERE status = ? AND time <= ? ORDER BY time ASC, jobID ASC FOR UPDATE"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ 'processing', TIME_NOW - 600, // running longer than 10 minutes @@ -79,9 +79,9 @@ class BackgroundQueueCleanUpCronjob extends AbstractCronjob // delete jobs $condition = new PreparedStatementConditionBuilder(); $condition->add('jobID IN (?)', [$jobIDs]); - $sql = "DELETE FROM wcf" . WCF_N . "_background_job + $sql = "DELETE FROM wcf1_background_job " . $condition; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($condition->getParameters()); WCF::getDB()->commitTransaction(); diff --git a/wcfsetup/install/files/lib/system/cronjob/CronjobScheduler.class.php b/wcfsetup/install/files/lib/system/cronjob/CronjobScheduler.class.php index 5e43bbfe78..301bc7b4b5 100644 --- a/wcfsetup/install/files/lib/system/cronjob/CronjobScheduler.class.php +++ b/wcfsetup/install/files/lib/system/cronjob/CronjobScheduler.class.php @@ -120,12 +120,12 @@ final class CronjobScheduler extends SingletonFactory $committed = false; try { $sql = "SELECT * - FROM wcf" . WCF_N . "_cronjob + FROM wcf1_cronjob WHERE state <> ? AND isDisabled = ? AND afterNextExec <= ? FOR UPDATE"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ Cronjob::READY, 0, @@ -211,13 +211,13 @@ final class CronjobScheduler extends SingletonFactory $committed = false; try { $sql = "SELECT * - FROM wcf" . WCF_N . "_cronjob + FROM wcf1_cronjob WHERE isDisabled = ? AND state = ? AND nextExec <= ? ORDER BY failCount ASC FOR UPDATE"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ 0, Cronjob::READY, diff --git a/wcfsetup/install/files/lib/system/cronjob/DailyMailNotificationCronjob.class.php b/wcfsetup/install/files/lib/system/cronjob/DailyMailNotificationCronjob.class.php index 1b99d7fa51..989c039d85 100644 --- a/wcfsetup/install/files/lib/system/cronjob/DailyMailNotificationCronjob.class.php +++ b/wcfsetup/install/files/lib/system/cronjob/DailyMailNotificationCronjob.class.php @@ -40,11 +40,11 @@ class DailyMailNotificationCronjob extends AbstractCronjob // get user ids $sql = "SELECT DISTINCT userID - FROM wcf" . WCF_N . "_user_notification + FROM wcf1_user_notification WHERE mailNotified = ? AND time < ? AND confirmTime = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ 0, TIME_NOW - 3600 * 23, @@ -68,24 +68,24 @@ class DailyMailNotificationCronjob extends AbstractCronjob $conditions->add("notification.confirmTime = ?", [0]); $sql = "SELECT notification.*, notification_event.eventID, object_type.objectType - FROM wcf" . WCF_N . "_user_notification notification - LEFT JOIN wcf" . WCF_N . "_user_notification_event notification_event + FROM wcf1_user_notification notification + LEFT JOIN wcf1_user_notification_event notification_event ON notification_event.eventID = notification.eventID - LEFT JOIN wcf" . WCF_N . "_object_type object_type + LEFT JOIN wcf1_object_type object_type ON object_type.objectTypeID = notification_event.objectTypeID " . $conditions . " ORDER BY notification.time"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); // mark notifications as done $conditions = new PreparedStatementConditionBuilder(); $conditions->add("userID IN (?)", [$userIDs]); $conditions->add("mailNotified = ?", [0]); - $sql = "UPDATE wcf" . WCF_N . "_user_notification + $sql = "UPDATE wcf1_user_notification SET mailNotified = 1 " . $conditions; - $statement2 = WCF::getDB()->prepareStatement($sql); + $statement2 = WCF::getDB()->prepare($sql); $statement2->execute($conditions->getParameters()); // collect data @@ -116,10 +116,10 @@ class DailyMailNotificationCronjob extends AbstractCronjob $conditions = new PreparedStatementConditionBuilder(); $conditions->add("notificationID IN (?)", [\array_keys($notificationObjects)]); $sql = "SELECT notificationID, authorID - FROM wcf" . WCF_N . "_user_notification_author + FROM wcf1_user_notification_author " . $conditions . " ORDER BY time ASC"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $authorIDs = $authorToNotification = []; while ($row = $statement->fetchArray()) { diff --git a/wcfsetup/install/files/lib/system/cronjob/ExpiringPaidSubscriptionUserCronjob.class.php b/wcfsetup/install/files/lib/system/cronjob/ExpiringPaidSubscriptionUserCronjob.class.php index 4216eb86a2..b35e884a56 100644 --- a/wcfsetup/install/files/lib/system/cronjob/ExpiringPaidSubscriptionUserCronjob.class.php +++ b/wcfsetup/install/files/lib/system/cronjob/ExpiringPaidSubscriptionUserCronjob.class.php @@ -48,7 +48,7 @@ class ExpiringPaidSubscriptionUserCronjob extends AbstractCronjob $paidSubscriptionUserList = new PaidSubscriptionUserList(); $paidSubscriptionUserList->sqlJoins .= " - LEFT JOIN wcf" . WCF_N . "_paid_subscription paid_subscription + LEFT JOIN wcf1_paid_subscription paid_subscription ON paid_subscription.subscriptionID = paid_subscription_user.subscriptionID"; $paidSubscriptionUserList->getConditionBuilder()->add('paid_subscription_user.endDate <> ?', [0]); $paidSubscriptionUserList->getConditionBuilder()->add( diff --git a/wcfsetup/install/files/lib/system/cronjob/ModerationQueueCronjob.class.php b/wcfsetup/install/files/lib/system/cronjob/ModerationQueueCronjob.class.php index cb5c3a15d8..2ab37915b0 100644 --- a/wcfsetup/install/files/lib/system/cronjob/ModerationQueueCronjob.class.php +++ b/wcfsetup/install/files/lib/system/cronjob/ModerationQueueCronjob.class.php @@ -26,10 +26,10 @@ class ModerationQueueCronjob extends AbstractCronjob parent::execute($cronjob); $sql = "SELECT queueID - FROM wcf" . WCF_N . "_moderation_queue + FROM wcf1_moderation_queue WHERE status IN (?, ?, ?) AND lastChangeTime < ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ ModerationQueue::STATUS_DONE, ModerationQueue::STATUS_REJECTED, @@ -42,9 +42,9 @@ class ModerationQueueCronjob extends AbstractCronjob $conditions = new PreparedStatementConditionBuilder(); $conditions->add("queueID IN (?)", [$queueIDs]); - $sql = "DELETE FROM wcf" . WCF_N . "_moderation_queue + $sql = "DELETE FROM wcf1_moderation_queue " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); // reset moderation count for all users diff --git a/wcfsetup/install/files/lib/system/cronjob/PruneIpAddressesCronjob.class.php b/wcfsetup/install/files/lib/system/cronjob/PruneIpAddressesCronjob.class.php index 66028fd938..0ed0ab1b06 100644 --- a/wcfsetup/install/files/lib/system/cronjob/PruneIpAddressesCronjob.class.php +++ b/wcfsetup/install/files/lib/system/cronjob/PruneIpAddressesCronjob.class.php @@ -35,7 +35,7 @@ class PruneIpAddressesCronjob extends AbstractCronjob return; } - $this->columns['wcf' . WCF_N . '_user']['registrationIpAddress'] = 'registrationDate'; + $this->columns['wcf1_user']['registrationIpAddress'] = 'registrationDate'; parent::execute($cronjob); @@ -45,7 +45,7 @@ class PruneIpAddressesCronjob extends AbstractCronjob SET {$ipAddressColumn} = ? WHERE {$timestampColumn} <= ? AND {$ipAddressColumn} <> ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ '', TIME_NOW - 86400 * PRUNE_IP_ADDRESS, // 86400 = 1 day diff --git a/wcfsetup/install/files/lib/system/cronjob/StatDailyBuilderCronjob.class.php b/wcfsetup/install/files/lib/system/cronjob/StatDailyBuilderCronjob.class.php index 32d9587b19..34c5be80bf 100644 --- a/wcfsetup/install/files/lib/system/cronjob/StatDailyBuilderCronjob.class.php +++ b/wcfsetup/install/files/lib/system/cronjob/StatDailyBuilderCronjob.class.php @@ -31,10 +31,10 @@ class StatDailyBuilderCronjob extends AbstractCronjob $date = $d->getTimestamp(); // prepare insert statement - $sql = "INSERT IGNORE INTO wcf" . WCF_N . "_stat_daily + $sql = "INSERT IGNORE INTO wcf1_stat_daily (objectTypeID, date, counter, total) VALUES (?, ?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); // get object types foreach (ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.statDailyHandler') as $objectType) { diff --git a/wcfsetup/install/files/lib/system/cronjob/UserBanCronjob.class.php b/wcfsetup/install/files/lib/system/cronjob/UserBanCronjob.class.php index 72442ead27..3a4d846dd6 100644 --- a/wcfsetup/install/files/lib/system/cronjob/UserBanCronjob.class.php +++ b/wcfsetup/install/files/lib/system/cronjob/UserBanCronjob.class.php @@ -22,13 +22,13 @@ class UserBanCronjob extends AbstractCronjob parent::execute($cronjob); // unban users - $sql = "UPDATE wcf" . WCF_N . "_user + $sql = "UPDATE wcf1_user SET banned = ?, banExpires = ? WHERE banned = ? AND banExpires <> ? AND banExpires <= ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ 0, 0, @@ -38,13 +38,13 @@ class UserBanCronjob extends AbstractCronjob ]); // enable avatars - $sql = "UPDATE wcf" . WCF_N . "_user + $sql = "UPDATE wcf1_user SET disableAvatar = ?, disableAvatarExpires = ? WHERE disableAvatar = ? AND disableAvatarExpires <> ? AND disableAvatarExpires <= ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ 0, 0, @@ -54,13 +54,13 @@ class UserBanCronjob extends AbstractCronjob ]); // enable signatures - $sql = "UPDATE wcf" . WCF_N . "_user + $sql = "UPDATE wcf1_user SET disableSignature = ?, disableSignatureExpires = ? WHERE disableSignature = ? AND disableSignatureExpires <> ? AND disableSignatureExpires <= ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ 0, 0, @@ -70,13 +70,13 @@ class UserBanCronjob extends AbstractCronjob ]); // enable cover photos - $sql = "UPDATE wcf" . WCF_N . "_user + $sql = "UPDATE wcf1_user SET disableCoverPhoto = ?, disableCoverPhotoExpires = ? WHERE disableCoverPhoto = ? AND disableCoverPhotoExpires <> ? AND disableCoverPhotoExpires <= ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ 0, 0, diff --git a/wcfsetup/install/files/lib/system/cronjob/UserQuitCronjob.class.php b/wcfsetup/install/files/lib/system/cronjob/UserQuitCronjob.class.php index 621f1cbda0..2cccd692c7 100644 --- a/wcfsetup/install/files/lib/system/cronjob/UserQuitCronjob.class.php +++ b/wcfsetup/install/files/lib/system/cronjob/UserQuitCronjob.class.php @@ -23,10 +23,10 @@ class UserQuitCronjob extends AbstractCronjob parent::execute($cronjob); $sql = "SELECT userID - FROM wcf" . WCF_N . "_user + FROM wcf1_user WHERE quitStarted > ? AND quitStarted < ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ 0, TIME_NOW - 7 * 24 * 3600, diff --git a/wcfsetup/install/files/lib/system/database/MySQLDatabase.class.php b/wcfsetup/install/files/lib/system/database/MySQLDatabase.class.php index 7d474580f2..e16aa913ad 100644 --- a/wcfsetup/install/files/lib/system/database/MySQLDatabase.class.php +++ b/wcfsetup/install/files/lib/system/database/MySQLDatabase.class.php @@ -90,7 +90,7 @@ class MySQLDatabase extends Database public function getVersion() { try { - $statement = $this->prepareStatement('SELECT VERSION()'); + $statement = $this->prepare('SELECT VERSION()'); $statement->execute(); return $statement->fetchSingleColumn(); diff --git a/wcfsetup/install/files/lib/system/database/editor/MySQLDatabaseEditor.class.php b/wcfsetup/install/files/lib/system/database/editor/MySQLDatabaseEditor.class.php index 0fb1c68fe5..0be6a05c60 100644 --- a/wcfsetup/install/files/lib/system/database/editor/MySQLDatabaseEditor.class.php +++ b/wcfsetup/install/files/lib/system/database/editor/MySQLDatabaseEditor.class.php @@ -22,7 +22,7 @@ class MySQLDatabaseEditor extends DatabaseEditor { $existingTables = []; $sql = "SHOW TABLES FROM `" . $this->dbObj->getDatabaseName() . "`"; - $statement = $this->dbObj->prepareStatement($sql); + $statement = $this->dbObj->prepare($sql); $statement->execute(); while ($row = $statement->fetchArray(\PDO::FETCH_NUM)) { $existingTables[] = $row[0]; @@ -40,7 +40,7 @@ class MySQLDatabaseEditor extends DatabaseEditor $regex = new Regex('([a-z]+)\((.+)\)', Regex::CASE_INSENSITIVE); $sql = "SHOW COLUMNS FROM `" . $tableName . "`"; - $statement = $this->dbObj->prepareStatement($sql); + $statement = $this->dbObj->prepare($sql); $statement->execute(); while ($row = $statement->fetchArray()) { $regex->match($row['Type']); @@ -110,7 +110,7 @@ class MySQLDatabaseEditor extends DatabaseEditor FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS WHERE CONSTRAINT_SCHEMA = ? AND TABLE_NAME = ?"; - $statement = $this->dbObj->prepareStatement($sql); + $statement = $this->dbObj->prepare($sql); $statement->execute([ $this->dbObj->getDatabaseName(), $tableName, @@ -147,7 +147,7 @@ class MySQLDatabaseEditor extends DatabaseEditor $sql = "SELECT CONSTRAINT_NAME, COLUMN_NAME, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE " . $conditionBuilder; - $statement = $this->dbObj->prepareStatement($sql); + $statement = $this->dbObj->prepare($sql); $statement->execute($conditionBuilder->getParameters()); $keyColumnUsage = $statement->fetchAll(\PDO::FETCH_ASSOC); @@ -172,7 +172,7 @@ class MySQLDatabaseEditor extends DatabaseEditor { $sql = "SHOW INDEX FROM `" . $tableName . "`"; - $statement = $this->dbObj->prepareStatement($sql); + $statement = $this->dbObj->prepare($sql); $statement->execute(); $indices = $statement->fetchAll(\PDO::FETCH_ASSOC); @@ -207,7 +207,7 @@ class MySQLDatabaseEditor extends DatabaseEditor { $indices = []; $sql = "SHOW INDEX FROM `" . $tableName . "`"; - $statement = $this->dbObj->prepareStatement($sql); + $statement = $this->dbObj->prepare($sql); $statement->execute(); while ($row = $statement->fetchArray()) { $indices[] = $row['Key_name']; @@ -245,7 +245,7 @@ class MySQLDatabaseEditor extends DatabaseEditor " . (!empty($indexDefinition) ? ',' : '') . " " . $indexDefinition . " ) ENGINE=InnoDB ROW_FORMAT=dynamic DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"; - $statement = $this->dbObj->prepareStatement($sql); + $statement = $this->dbObj->prepare($sql); $statement->execute(); } @@ -255,7 +255,7 @@ class MySQLDatabaseEditor extends DatabaseEditor public function dropTable($tableName) { $sql = "DROP TABLE IF EXISTS `" . $tableName . "`"; - $statement = $this->dbObj->prepareStatement($sql); + $statement = $this->dbObj->prepare($sql); $statement->execute(); } @@ -265,7 +265,7 @@ class MySQLDatabaseEditor extends DatabaseEditor public function addColumn($tableName, $columnName, $columnData) { $sql = "ALTER TABLE `" . $tableName . "` ADD COLUMN " . $this->buildColumnDefinition($columnName, $columnData); - $statement = $this->dbObj->prepareStatement($sql); + $statement = $this->dbObj->prepare($sql); $statement->execute(); } @@ -278,7 +278,7 @@ class MySQLDatabaseEditor extends DatabaseEditor $newColumnName, $newColumnData ); - $statement = $this->dbObj->prepareStatement($sql); + $statement = $this->dbObj->prepare($sql); $statement->execute(); } @@ -315,7 +315,7 @@ class MySQLDatabaseEditor extends DatabaseEditor } } - $this->dbObj->prepareStatement("ALTER TABLE `{$tableName}` " . \rtrim($queries, ','))->execute(); + $this->dbObj->prepare("ALTER TABLE `{$tableName}` " . \rtrim($queries, ','))->execute(); } /** @@ -325,7 +325,7 @@ class MySQLDatabaseEditor extends DatabaseEditor { try { $sql = "ALTER TABLE `" . $tableName . "` DROP COLUMN `" . $columnName . "`"; - $statement = $this->dbObj->prepareStatement($sql); + $statement = $this->dbObj->prepare($sql); $statement->execute(); } catch (DatabaseQueryExecutionException $e) { if ($e->getCode() != '42000') { @@ -343,7 +343,7 @@ class MySQLDatabaseEditor extends DatabaseEditor public function addIndex($tableName, $indexName, $indexData) { $sql = "ALTER TABLE `" . $tableName . "` ADD " . $this->buildIndexDefinition($indexName, $indexData); - $statement = $this->dbObj->prepareStatement($sql); + $statement = $this->dbObj->prepare($sql); $statement->execute(); } @@ -379,7 +379,7 @@ class MySQLDatabaseEditor extends DatabaseEditor $sql .= " ON UPDATE " . $indexData['ON UPDATE']; } - $statement = $this->dbObj->prepareStatement($sql); + $statement = $this->dbObj->prepare($sql); $statement->execute(); } @@ -390,7 +390,7 @@ class MySQLDatabaseEditor extends DatabaseEditor { try { $sql = "ALTER TABLE `" . $tableName . "` DROP INDEX `" . $indexName . "`"; - $statement = $this->dbObj->prepareStatement($sql); + $statement = $this->dbObj->prepare($sql); $statement->execute(); } catch (DatabaseQueryExecutionException $e) { if ($e->getCode() != '42000') { @@ -409,7 +409,7 @@ class MySQLDatabaseEditor extends DatabaseEditor { try { $sql = "ALTER TABLE " . $tableName . " DROP PRIMARY KEY"; - $statement = $this->dbObj->prepareStatement($sql); + $statement = $this->dbObj->prepare($sql); $statement->execute(); } catch (DatabaseQueryExecutionException $e) { if ($e->getCode() != '42000') { @@ -428,7 +428,7 @@ class MySQLDatabaseEditor extends DatabaseEditor { try { $sql = "ALTER TABLE `" . $tableName . "` DROP FOREIGN KEY `" . $indexName . "`"; - $statement = $this->dbObj->prepareStatement($sql); + $statement = $this->dbObj->prepare($sql); $statement->execute(); } catch (DatabaseQueryExecutionException $e) { if ($e->getCode() != '42000') { diff --git a/wcfsetup/install/files/lib/system/database/util/SQLParser.class.php b/wcfsetup/install/files/lib/system/database/util/SQLParser.class.php index b53af5bb3f..fc96dfbedf 100644 --- a/wcfsetup/install/files/lib/system/database/util/SQLParser.class.php +++ b/wcfsetup/install/files/lib/system/database/util/SQLParser.class.php @@ -402,7 +402,7 @@ class SQLParser */ protected function executeStandardStatement($query) { - $statement = WCF::getDB()->prepareStatement($query); + $statement = WCF::getDB()->prepare($query); $statement->execute(); } diff --git a/wcfsetup/install/files/lib/system/devtools/pip/TMultiXmlGuiPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/devtools/pip/TMultiXmlGuiPackageInstallationPlugin.class.php index 0b6f00ea50..23fb348285 100644 --- a/wcfsetup/install/files/lib/system/devtools/pip/TMultiXmlGuiPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/devtools/pip/TMultiXmlGuiPackageInstallationPlugin.class.php @@ -257,10 +257,10 @@ trait TMultiXmlGuiPackageInstallationPlugin */ protected function deleteObject(\DOMElement $element) { - $sql = "DELETE FROM wcf" . WCF_N . "_language_item + $sql = "DELETE FROM wcf1_language_item WHERE languageItem = ? AND packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$element->getAttribute('name')]); } } diff --git a/wcfsetup/install/files/lib/system/devtools/pip/TXmlGuiPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/devtools/pip/TXmlGuiPackageInstallationPlugin.class.php index e083848203..7180962c78 100644 --- a/wcfsetup/install/files/lib/system/devtools/pip/TXmlGuiPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/devtools/pip/TXmlGuiPackageInstallationPlugin.class.php @@ -597,7 +597,7 @@ XML; $sqlData = $this->findExistingItem($this->getElementData($oldElement, true)); if ($sqlData !== null) { - $statement = WCF::getDB()->prepareStatement($sqlData['sql']); + $statement = WCF::getDB()->prepare($sqlData['sql']); $statement->execute($sqlData['parameters']); $existingRow = $statement->fetchArray() ?: []; diff --git a/wcfsetup/install/files/lib/system/edit/EditHistoryManager.class.php b/wcfsetup/install/files/lib/system/edit/EditHistoryManager.class.php index 45730e86dc..8419fd515f 100644 --- a/wcfsetup/install/files/lib/system/edit/EditHistoryManager.class.php +++ b/wcfsetup/install/files/lib/system/edit/EditHistoryManager.class.php @@ -70,10 +70,10 @@ class EditHistoryManager extends SingletonFactory } // save new entry - $sql = "INSERT INTO wcf" . WCF_N . "_edit_history_entry + $sql = "INSERT INTO wcf1_edit_history_entry (objectTypeID, objectID, message, time, obsoletedAt, userID, username, editReason, obsoletedByUserID) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $this->getObjectTypeID($objectType), $objectID, @@ -108,9 +108,9 @@ class EditHistoryManager extends SingletonFactory $conditionBuilder->add('objectTypeID = ?', [$objectTypeID]); $conditionBuilder->add('objectID IN (?)', [$batchObjectIDs]); - $sql = "DELETE FROM wcf" . WCF_N . "_edit_history_entry + $sql = "DELETE FROM wcf1_edit_history_entry " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); } WCF::getDB()->commitTransaction(); @@ -135,14 +135,14 @@ class EditHistoryManager extends SingletonFactory // b) by a non offending user $userIDPlaceholders = '?' . \str_repeat(',?', \count($userIDs) - 1); $sql = "SELECT MAX(entryID) - FROM wcf" . WCF_N . "_edit_history_entry revertTo + FROM wcf1_edit_history_entry revertTo INNER JOIN ( SELECT vandalizedEntries.objectID, vandalizedEntries.objectTypeID - FROM wcf" . WCF_N . "_edit_history_entry vandalizedEntries + FROM wcf1_edit_history_entry vandalizedEntries INNER JOIN ( SELECT MAX(newestEntries.entryID) AS entryID - FROM wcf" . WCF_N . "_edit_history_entry newestEntries + FROM wcf1_edit_history_entry newestEntries WHERE newestEntries.obsoletedAt > ? GROUP BY newestEntries.objectTypeID, newestEntries.objectID ) newestEntries2 @@ -157,7 +157,7 @@ class EditHistoryManager extends SingletonFactory OR revertTo.userID NOT IN(" . $userIDPlaceholders . ") ) GROUP BY revertTo.objectTypeID, revertTo.objectID"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(\array_merge( [TIME_NOW - $timeframe], $userIDs, diff --git a/wcfsetup/install/files/lib/system/event/listener/AbstractUserActionRenameListener.class.php b/wcfsetup/install/files/lib/system/event/listener/AbstractUserActionRenameListener.class.php index e4bd4bf37f..aa9a3ecaf5 100644 --- a/wcfsetup/install/files/lib/system/event/listener/AbstractUserActionRenameListener.class.php +++ b/wcfsetup/install/files/lib/system/event/listener/AbstractUserActionRenameListener.class.php @@ -51,10 +51,10 @@ abstract class AbstractUserActionRenameListener implements IParameterizedEventLi $databaseTable['username'] = 'username'; } - $sql = "UPDATE " . \str_replace('{WCF_N}', WCF_N, $databaseTable['name']) . " + $sql = "UPDATE " . \str_replace('{WCF_N}', 1, $databaseTable['name']) . " SET " . $databaseTable['username'] . " = ? WHERE " . $databaseTable['userID'] . " = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$username, $userID]); } diff --git a/wcfsetup/install/files/lib/system/event/listener/AbstractUserMergeListener.class.php b/wcfsetup/install/files/lib/system/event/listener/AbstractUserMergeListener.class.php index 1bece04405..d44d2208a7 100644 --- a/wcfsetup/install/files/lib/system/event/listener/AbstractUserMergeListener.class.php +++ b/wcfsetup/install/files/lib/system/event/listener/AbstractUserMergeListener.class.php @@ -60,13 +60,13 @@ abstract class AbstractUserMergeListener implements IParameterizedEventListener $sql = "UPDATE" . (!empty($databaseTable['ignore']) ? " IGNORE" : "") . " " . \str_replace( '{WCF_N}', - WCF_N, + 1, $databaseTable['name'] ) . " SET " . $databaseTable['userID'] . " = ? " . (!empty($databaseTable['username']) ? ", " . $databaseTable['username'] . " = ? " : "") . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(\array_merge($parameters, $conditionBuilder->getParameters())); } } diff --git a/wcfsetup/install/files/lib/system/exporter/AbstractExporter.class.php b/wcfsetup/install/files/lib/system/exporter/AbstractExporter.class.php index ac7e1c9f38..d63caccd93 100644 --- a/wcfsetup/install/files/lib/system/exporter/AbstractExporter.class.php +++ b/wcfsetup/install/files/lib/system/exporter/AbstractExporter.class.php @@ -219,7 +219,7 @@ abstract class AbstractExporter implements IExporter { $sql = "SELECT MAX(" . $columnName . ") AS maxID FROM " . $tableName; - $statement = $this->database->prepareStatement($sql); + $statement = $this->database->prepare($sql); $statement->execute(); $row = $statement->fetchArray(); if ($row !== false) { diff --git a/wcfsetup/install/files/lib/system/form/builder/field/option/OptionFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/option/OptionFormField.class.php index 16a8beee4d..22ec3122d8 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/option/OptionFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/option/OptionFormField.class.php @@ -61,9 +61,9 @@ final class OptionFormField extends ItemListFormField implements IPackagesFormFi } $sql = "SELECT optionName - FROM wcf" . WCF_N . "_option + FROM wcf1_option " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); $availableOptions = $statement->fetchAll(\PDO::FETCH_COLUMN); diff --git a/wcfsetup/install/files/lib/system/form/builder/field/user/group/option/UserGroupOptionFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/user/group/option/UserGroupOptionFormField.class.php index e5b21e1ede..c3e47fe46f 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/user/group/option/UserGroupOptionFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/user/group/option/UserGroupOptionFormField.class.php @@ -51,9 +51,9 @@ final class UserGroupOptionFormField extends ItemListFormField implements IPacka } $sql = "SELECT optionName - FROM wcf" . WCF_N . "_user_group_option + FROM wcf1_user_group_option " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); $availableOptions = $statement->fetchAll(\PDO::FETCH_COLUMN); diff --git a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeTextParser.class.php b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeTextParser.class.php index 9b5542d8e1..b4c7b66252 100644 --- a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeTextParser.class.php +++ b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeTextParser.class.php @@ -295,9 +295,9 @@ class HtmlInputNodeTextParser } $sql = "SELECT userID, username - FROM wcf" . WCF_N . "_user + FROM wcf1_user " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $users = $statement->fetchMap('userID', 'username'); diff --git a/wcfsetup/install/files/lib/system/importer/AbstractACLImporter.class.php b/wcfsetup/install/files/lib/system/importer/AbstractACLImporter.class.php index 06a9cda9e0..037f8d7d4b 100644 --- a/wcfsetup/install/files/lib/system/importer/AbstractACLImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/AbstractACLImporter.class.php @@ -38,9 +38,9 @@ class AbstractACLImporter extends AbstractImporter { // get options $sql = "SELECT optionName, optionID - FROM wcf" . WCF_N . "_acl_option + FROM wcf1_acl_option WHERE objectTypeID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->objectTypeID]); $this->options = $statement->fetchMap('optionName', 'optionID'); } @@ -66,10 +66,10 @@ class AbstractACLImporter extends AbstractImporter return 0; } - $sql = "INSERT IGNORE INTO wcf" . WCF_N . "_acl_option_to_group + $sql = "INSERT IGNORE INTO wcf1_acl_option_to_group (optionID, objectID, groupID, optionValue) VALUES (?, ?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$data['optionID'], $data['objectID'], $data['groupID'], $data['optionValue']]); return 1; @@ -79,10 +79,10 @@ class AbstractACLImporter extends AbstractImporter return 0; } - $sql = "INSERT IGNORE INTO wcf" . WCF_N . "_acl_option_to_user + $sql = "INSERT IGNORE INTO wcf1_acl_option_to_user (optionID, objectID, userID, optionValue) VALUES (?, ?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$data['optionID'], $data['objectID'], $data['userID'], $data['optionValue']]); return 1; diff --git a/wcfsetup/install/files/lib/system/importer/AbstractCommentResponseImporter.class.php b/wcfsetup/install/files/lib/system/importer/AbstractCommentResponseImporter.class.php index e4c2ba08c7..f72fd2884b 100644 --- a/wcfsetup/install/files/lib/system/importer/AbstractCommentResponseImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/AbstractCommentResponseImporter.class.php @@ -41,19 +41,19 @@ class AbstractCommentResponseImporter extends AbstractImporter $response = CommentResponseEditor::create($data); $sql = "SELECT responseID - FROM wcf" . WCF_N . "_comment_response + FROM wcf1_comment_response WHERE commentID = ? ORDER BY time ASC, responseID ASC"; - $statement = WCF::getDB()->prepareStatement($sql, 5); + $statement = WCF::getDB()->prepare($sql, 5); $statement->execute([$response->commentID]); $responseIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); // update parent comment - $sql = "UPDATE wcf" . WCF_N . "_comment + $sql = "UPDATE wcf1_comment SET responseIDs = ?, responses = responses + 1 WHERE commentID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ \serialize($responseIDs), $response->commentID, diff --git a/wcfsetup/install/files/lib/system/importer/AbstractImporter.class.php b/wcfsetup/install/files/lib/system/importer/AbstractImporter.class.php index 7998dc23ae..f29d965562 100644 --- a/wcfsetup/install/files/lib/system/importer/AbstractImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/AbstractImporter.class.php @@ -40,11 +40,11 @@ abstract class AbstractImporter implements IImporter // get package id $packageID = PackageCache::getInstance()->getPackageID($package); - $sql = "INSERT INTO wcf" . WCF_N . "_language_item + $sql = "INSERT INTO wcf1_language_item (languageID, languageItem, languageItemValue, languageCategoryID, packageID) VALUES (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE languageItemValue = VALUES(languageItemValue)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); foreach ($items as $itemData) { $statement->execute([ @@ -71,9 +71,9 @@ abstract class AbstractImporter implements IImporter if (!isset($languageCategoryIDs[$languageCategory])) { // get language category id $sql = "SELECT languageCategoryID - FROM wcf" . WCF_N . "_language_category + FROM wcf1_language_category WHERE languageCategory = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$languageCategory]); $languageCategoryIDs[$languageCategory] = $statement->fetchSingleColumn(); diff --git a/wcfsetup/install/files/lib/system/importer/AbstractLikeImporter.class.php b/wcfsetup/install/files/lib/system/importer/AbstractLikeImporter.class.php index a30db8ab77..3f97a0bbcf 100644 --- a/wcfsetup/install/files/lib/system/importer/AbstractLikeImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/AbstractLikeImporter.class.php @@ -67,10 +67,10 @@ class AbstractLikeImporter extends AbstractImporter return 0; } - $sql = "INSERT IGNORE INTO wcf" . WCF_N . "_like + $sql = "INSERT IGNORE INTO wcf1_like (objectID, objectTypeID, objectUserID, userID, time, likeValue, reactionTypeID) VALUES (?, ?, ?, ?, ?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $data['objectID'], $this->objectTypeID, @@ -90,22 +90,22 @@ class AbstractLikeImporter extends AbstractImporter protected static function getDislikeReactionTypeID() { if (self::$dislikeReactionTypeID === null) { - $sql = "SELECT reactionTypeID FROM wcf" . WCF_N . "_reaction_type WHERE iconFile = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $sql = "SELECT reactionTypeID FROM wcf1_reaction_type WHERE iconFile = ?"; + $statement = WCF::getDB()->prepare($sql); $statement->execute(['thumbsDown.svg']); $reaction = $statement->fetchObject(ReactionType::class); if ($reaction === null) { - $sql = "SELECT MAX(showOrder) FROM wcf" . WCF_N . "_reaction_type"; - $statement = WCF::getDB()->prepareStatement($sql); + $sql = "SELECT MAX(showOrder) FROM wcf1_reaction_type"; + $statement = WCF::getDB()->prepare($sql); $statement->execute(); $showOrder = $statement->fetchColumn(); $reaction = ReactionTypeEditor::create(['iconFile' => 'thumbsDown.svg', 'showOrder' => $showOrder + 1]); $sql = "SELECT languageCategoryID - FROM wcf" . WCF_N . "_language_category + FROM wcf1_language_category WHERE languageCategory = ?"; - $statement = WCF::getDB()->prepareStatement($sql, 1); + $statement = WCF::getDB()->prepare($sql, 1); $statement->execute(['wcf.reactionType']); $languageCategoryID = $statement->fetchSingleColumn(); diff --git a/wcfsetup/install/files/lib/system/importer/AbstractPollOptionVoteImporter.class.php b/wcfsetup/install/files/lib/system/importer/AbstractPollOptionVoteImporter.class.php index b821d0d43c..933157712c 100644 --- a/wcfsetup/install/files/lib/system/importer/AbstractPollOptionVoteImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/AbstractPollOptionVoteImporter.class.php @@ -45,10 +45,10 @@ class AbstractPollOptionVoteImporter extends AbstractImporter return 0; } - $sql = "INSERT IGNORE INTO wcf" . WCF_N . "_poll_option_vote + $sql = "INSERT IGNORE INTO wcf1_poll_option_vote (pollID, optionID, userID) VALUES (?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$data['pollID'], $data['optionID'], $data['userID']]); return 1; diff --git a/wcfsetup/install/files/lib/system/importer/ArticleImporter.class.php b/wcfsetup/install/files/lib/system/importer/ArticleImporter.class.php index 165c5bd7a1..08a3ad6b43 100644 --- a/wcfsetup/install/files/lib/system/importer/ArticleImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/ArticleImporter.class.php @@ -146,23 +146,23 @@ class ArticleImporter extends AbstractImporter ->getObjectTypeIDByName('com.woltlab.wcf.category', 'com.woltlab.wcf.article.category'); $sql = "SELECT categoryID - FROM wcf" . WCF_N . "_category + FROM wcf1_category WHERE objectTypeID = ? AND parentCategoryID = ? AND title = ? ORDER BY categoryID"; - $statement = WCF::getDB()->prepareStatement($sql, 1); + $statement = WCF::getDB()->prepare($sql, 1); $statement->execute([$objectTypeID, 0, 'Import']); $categoryID = $statement->fetchSingleColumn(); if ($categoryID) { $this->importCategoryID = $categoryID; } else { - $sql = "INSERT INTO wcf" . WCF_N . "_category + $sql = "INSERT INTO wcf1_category (objectTypeID, parentCategoryID, title, showOrder, time) VALUES (?, ?, ?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$objectTypeID, 0, 'Import', 0, TIME_NOW]); - $this->importCategoryID = WCF::getDB()->getInsertID("wcf" . WCF_N . "_category", 'categoryID'); + $this->importCategoryID = WCF::getDB()->getInsertID("wcf1_category", 'categoryID'); } } diff --git a/wcfsetup/install/files/lib/system/importer/ImportHandler.class.php b/wcfsetup/install/files/lib/system/importer/ImportHandler.class.php index 9f009aada6..98d81e2961 100644 --- a/wcfsetup/install/files/lib/system/importer/ImportHandler.class.php +++ b/wcfsetup/install/files/lib/system/importer/ImportHandler.class.php @@ -111,7 +111,7 @@ class ImportHandler extends SingletonFactory implements IAJAXInvokeAction } $sql = "SELECT import_mapping.newID - FROM wcf" . WCF_N . "_import_mapping import_mapping + FROM wcf1_import_mapping import_mapping " . ($tableName ? " LEFT JOIN " . $tableName . " object_table ON object_table." . $indexName . " = import_mapping.newID @@ -120,7 +120,7 @@ class ImportHandler extends SingletonFactory implements IAJAXInvokeAction AND import_mapping.objectTypeID = ? AND import_mapping.oldID = ? " . ($tableName ? "AND object_table." . $indexName . " IS NOT NULL" : ''); - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->importHash, $objectTypeID, $oldID]); $row = $statement->fetchArray(); if ($row !== false) { @@ -145,20 +145,20 @@ class ImportHandler extends SingletonFactory implements IAJAXInvokeAction $objectTypeID = $this->objectTypes[$type]->objectTypeID; if ($statement === null) { - $sql = "INSERT IGNORE INTO wcf" . WCF_N . "_import_mapping + $sql = "INSERT IGNORE INTO wcf1_import_mapping (importHash, objectTypeID, oldID, newID) VALUES (?, ?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); } try { $statement->execute([$this->importHash, $objectTypeID, $oldID, $newID]); } catch (DatabaseException $e) { // Re-prepare the statement once. - $sql = "INSERT IGNORE INTO wcf" . WCF_N . "_import_mapping + $sql = "INSERT IGNORE INTO wcf1_import_mapping (importHash, objectTypeID, oldID, newID) VALUES (?, ?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->importHash, $objectTypeID, $oldID, $newID]); } @@ -182,8 +182,8 @@ class ImportHandler extends SingletonFactory implements IAJAXInvokeAction */ public function resetMapping() { - $sql = "DELETE FROM wcf" . WCF_N . "_import_mapping"; - $statement = WCF::getDB()->prepareStatement($sql); + $sql = "DELETE FROM wcf1_import_mapping"; + $statement = WCF::getDB()->prepare($sql); $statement->execute(); $this->idMappingCache = []; diff --git a/wcfsetup/install/files/lib/system/importer/LabelGroupImporter.class.php b/wcfsetup/install/files/lib/system/importer/LabelGroupImporter.class.php index 30b7cf073f..d729cd7e65 100644 --- a/wcfsetup/install/files/lib/system/importer/LabelGroupImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/LabelGroupImporter.class.php @@ -30,10 +30,10 @@ class LabelGroupImporter extends AbstractImporter // save objects if (!empty($additionalData['objects'])) { - $sql = "INSERT INTO wcf" . WCF_N . "_label_group_to_object + $sql = "INSERT INTO wcf1_label_group_to_object (groupID, objectTypeID, objectID) VALUES (?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($additionalData['objects'] as $objectTypeID => $objectIDs) { foreach ($objectIDs as $objectID) { diff --git a/wcfsetup/install/files/lib/system/importer/MediaImporter.class.php b/wcfsetup/install/files/lib/system/importer/MediaImporter.class.php index c2ffcb71d7..0834d390d6 100644 --- a/wcfsetup/install/files/lib/system/importer/MediaImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/MediaImporter.class.php @@ -124,10 +124,10 @@ class MediaImporter extends AbstractImporter } // save media content - $sql = "INSERT INTO wcf" . WCF_N . "_media_content + $sql = "INSERT INTO wcf1_media_content (mediaID, languageID, title, caption, altText) VALUES (?, ?, ?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($contents as $languageID => $contentData) { $statement->execute([ $media->mediaID, diff --git a/wcfsetup/install/files/lib/system/importer/SmileyImporter.class.php b/wcfsetup/install/files/lib/system/importer/SmileyImporter.class.php index 94e5bd2408..ab37c5f746 100644 --- a/wcfsetup/install/files/lib/system/importer/SmileyImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/SmileyImporter.class.php @@ -33,8 +33,8 @@ class SmileyImporter extends AbstractImporter public function __construct() { $sql = "SELECT smileyID, smileyCode, aliases - FROM wcf" . WCF_N . "_smiley"; - $statement = WCF::getDB()->prepareStatement($sql); + FROM wcf1_smiley"; + $statement = WCF::getDB()->prepare($sql); $statement->execute(); while ($row = $statement->fetchArray()) { diff --git a/wcfsetup/install/files/lib/system/importer/TrophyImporter.class.php b/wcfsetup/install/files/lib/system/importer/TrophyImporter.class.php index fa875a65c7..254df1a167 100644 --- a/wcfsetup/install/files/lib/system/importer/TrophyImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/TrophyImporter.class.php @@ -114,23 +114,23 @@ class TrophyImporter extends AbstractImporter ->getObjectTypeIDByName('com.woltlab.wcf.category', 'com.woltlab.wcf.trophy.category'); $sql = "SELECT categoryID - FROM wcf" . WCF_N . "_category + FROM wcf1_category WHERE objectTypeID = ? AND parentCategoryID = ? AND title = ? ORDER BY categoryID"; - $statement = WCF::getDB()->prepareStatement($sql, 1); + $statement = WCF::getDB()->prepare($sql, 1); $statement->execute([$objectTypeID, 0, 'Import']); $categoryID = $statement->fetchSingleColumn(); if ($categoryID) { $this->importCategoryID = $categoryID; } else { - $sql = "INSERT INTO wcf" . WCF_N . "_category + $sql = "INSERT INTO wcf1_category (objectTypeID, parentCategoryID, title, showOrder, time) VALUES (?, ?, ?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$objectTypeID, 0, 'Import', 0, TIME_NOW]); - $this->importCategoryID = WCF::getDB()->getInsertID("wcf" . WCF_N . "_category", 'categoryID'); + $this->importCategoryID = WCF::getDB()->getInsertID("wcf1_category", 'categoryID'); } } diff --git a/wcfsetup/install/files/lib/system/importer/UserAvatarImporter.class.php b/wcfsetup/install/files/lib/system/importer/UserAvatarImporter.class.php index 12cefdf91d..c1bcb2ace0 100644 --- a/wcfsetup/install/files/lib/system/importer/UserAvatarImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/UserAvatarImporter.class.php @@ -71,10 +71,10 @@ class UserAvatarImporter extends AbstractImporter } // update owner - $sql = "UPDATE wcf" . WCF_N . "_user + $sql = "UPDATE wcf1_user SET avatarID = ? WHERE userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$avatar->avatarID, $data['userID']]); return $avatar->avatarID; diff --git a/wcfsetup/install/files/lib/system/importer/UserFollowerImporter.class.php b/wcfsetup/install/files/lib/system/importer/UserFollowerImporter.class.php index 3fc9d0c1a2..d73928c1cb 100644 --- a/wcfsetup/install/files/lib/system/importer/UserFollowerImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/UserFollowerImporter.class.php @@ -34,16 +34,16 @@ class UserFollowerImporter extends AbstractImporter $data['time'] = 0; } - $sql = "INSERT IGNORE INTO wcf" . WCF_N . "_user_follow + $sql = "INSERT IGNORE INTO wcf1_user_follow (userID, followUserID, time) VALUES (?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $data['userID'], $data['followUserID'], $data['time'], ]); - return WCF::getDB()->getInsertID('wcf' . WCF_N . '_user_follow', 'followID'); + return WCF::getDB()->getInsertID('wcf1_user_follow', 'followID'); } } diff --git a/wcfsetup/install/files/lib/system/importer/UserImporter.class.php b/wcfsetup/install/files/lib/system/importer/UserImporter.class.php index d05ffc9267..7980fc9e45 100644 --- a/wcfsetup/install/files/lib/system/importer/UserImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/UserImporter.class.php @@ -56,9 +56,9 @@ class UserImporter extends AbstractImporter { // get default notification events $sql = "SELECT eventID - FROM wcf" . WCF_N . "_user_notification_event + FROM wcf1_user_notification_event WHERE preset = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([1]); $this->eventIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); @@ -224,10 +224,10 @@ class UserImporter extends AbstractImporter $this->defaultGroups[$user->pendingActivation() ? 'notActivated' : 'activated'] ); $placeholders = '(?,?)' . \str_repeat(',(?,?)', \count($groupIDs) - 1); - $sql = "INSERT IGNORE INTO wcf" . WCF_N . "_user_to_group + $sql = "INSERT IGNORE INTO wcf1_user_to_group (userID, groupID) VALUES {$placeholders}"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $parameters = []; foreach ($groupIDs as $groupID) { $parameters[] = $user->userID; @@ -236,10 +236,10 @@ class UserImporter extends AbstractImporter $statement->execute($parameters); // save languages - $sql = "INSERT IGNORE INTO wcf" . WCF_N . "_user_to_language + $sql = "INSERT IGNORE INTO wcf1_user_to_language (userID, languageID) VALUES (?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($languageIDs as $languageID) { $statement->execute([ $user->userID, @@ -250,10 +250,10 @@ class UserImporter extends AbstractImporter if (!empty($this->eventIDs)) { // save default user events $placeholders = '(?,?)' . \str_repeat(',(?,?)', \count($this->eventIDs) - 1); - $sql = "INSERT IGNORE INTO wcf" . WCF_N . "_user_notification_event_to_user + $sql = "INSERT IGNORE INTO wcf1_user_notification_event_to_user (userID, eventID) VALUES {$placeholders}"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $parameters = []; foreach ($this->eventIDs as $eventID) { $parameters[] = $user->userID; @@ -282,9 +282,9 @@ class UserImporter extends AbstractImporter $newUsername = 'Duplicate' . ($i > 1 ? $i : '') . ' ' . $username; // try username $sql = "SELECT userID - FROM wcf" . WCF_N . "_user + FROM wcf1_user WHERE username = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$newUsername]); $row = $statement->fetchArray(); if (empty($row['userID'])) { diff --git a/wcfsetup/install/files/lib/system/importer/UserOptionImporter.class.php b/wcfsetup/install/files/lib/system/importer/UserOptionImporter.class.php index 0b2b189e28..984f2b6728 100644 --- a/wcfsetup/install/files/lib/system/importer/UserOptionImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/UserOptionImporter.class.php @@ -44,9 +44,9 @@ class UserOptionImporter extends AbstractImporter { // get language category id $sql = "SELECT languageCategoryID - FROM wcf" . WCF_N . "_language_category + FROM wcf1_language_category WHERE languageCategory = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(['wcf.user.option']); $row = $statement->fetchArray(); $this->languageCategoryID = $row['languageCategoryID']; @@ -82,10 +82,10 @@ class UserOptionImporter extends AbstractImporter ]); // save name - $sql = "INSERT IGNORE INTO wcf" . WCF_N . "_language_item + $sql = "INSERT IGNORE INTO wcf1_language_item (languageID, languageItem, languageItemValue, languageItemOriginIsSystem, languageCategoryID, packageID) VALUES (?, ?, ?, ?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ LanguageFactory::getInstance()->getDefaultLanguageID(), 'wcf.user.option.option' . $userOption->optionID, diff --git a/wcfsetup/install/files/lib/system/label/LabelHandler.class.php b/wcfsetup/install/files/lib/system/label/LabelHandler.class.php index 41de59be72..9d143e142e 100644 --- a/wcfsetup/install/files/lib/system/label/LabelHandler.class.php +++ b/wcfsetup/install/files/lib/system/label/LabelHandler.class.php @@ -190,18 +190,18 @@ class LabelHandler extends SingletonFactory $conditions->add("objectTypeID = ?", [$objectTypeID]); $conditions->add("objectID = ?", [$objectID]); - $sql = "DELETE FROM wcf" . WCF_N . "_label_object + $sql = "DELETE FROM wcf1_label_object " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); } // insert new labels if (!empty($labelIDs)) { - $sql = "INSERT INTO wcf" . WCF_N . "_label_object + $sql = "INSERT INTO wcf1_label_object (labelID, objectTypeID, objectID) VALUES (?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($labelIDs as $labelID) { $statement->execute([ $labelID, @@ -243,17 +243,17 @@ class LabelHandler extends SingletonFactory $conditionBuilder->add("objectTypeID = ?", [$objectTypeID]); $conditionBuilder->add("objectID = ?", [$objectID]); - $sql = "DELETE FROM wcf" . WCF_N . "_label_object + $sql = "DELETE FROM wcf1_label_object " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); // assign new labels if (!empty($labelIDs)) { - $sql = "INSERT INTO wcf" . WCF_N . "_label_object + $sql = "INSERT INTO wcf1_label_object (labelID, objectTypeID, objectID) VALUES (?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($labelIDs as $labelID) { $statement->execute([ $labelID, @@ -278,9 +278,9 @@ class LabelHandler extends SingletonFactory $conditions->add("objectTypeID = ?", [$objectTypeID]); $conditions->add("objectID IN (?)", [$objectIDs]); $sql = "SELECT objectID, labelID - FROM wcf" . WCF_N . "_label_object + FROM wcf1_label_object " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $labels = $statement->fetchMap('labelID', 'objectID', false); @@ -420,9 +420,9 @@ class LabelHandler extends SingletonFactory $conditions = new PreparedStatementConditionBuilder(); $conditions->add("objectTypeID = ?", [$objectTypeID]); $conditions->add("objectID IN (?)", [$objectIDs]); - $sql = "DELETE FROM wcf" . WCF_N . "_label_object + $sql = "DELETE FROM wcf1_label_object " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); } } diff --git a/wcfsetup/install/files/lib/system/language/LanguageFactory.class.php b/wcfsetup/install/files/lib/system/language/LanguageFactory.class.php index cf566e69c1..d642e43d25 100644 --- a/wcfsetup/install/files/lib/system/language/LanguageFactory.class.php +++ b/wcfsetup/install/files/lib/system/language/LanguageFactory.class.php @@ -98,9 +98,9 @@ class LanguageFactory extends SingletonFactory // called within WCFSetup if ($this->cache === false || empty($this->cache['codes'])) { $sql = "SELECT languageID - FROM wcf" . WCF_N . "_language + FROM wcf1_language WHERE languageCode = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$languageCode]); $row = $statement->fetchArray(); if (isset($row['languageID'])) { @@ -329,17 +329,17 @@ class LanguageFactory extends SingletonFactory public function makeDefault($languageID) { // remove old default language - $sql = "UPDATE wcf" . WCF_N . "_language + $sql = "UPDATE wcf1_language SET isDefault = 0 WHERE isDefault = 1"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(); // make this language to default - $sql = "UPDATE wcf" . WCF_N . "_language + $sql = "UPDATE wcf1_language SET isDefault = 1 WHERE languageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$languageID]); // rebuild language cache @@ -377,9 +377,9 @@ class LanguageFactory extends SingletonFactory public function countRecentlyDisabledCustomValues() { $sql = "SELECT COUNT(*) AS count - FROM wcf" . WCF_N . "_language_item + FROM wcf1_language_item WHERE languageCustomItemDisableTime >= ?"; - $statement = WCF::getDB()->prepareStatement($sql, 1); + $statement = WCF::getDB()->prepare($sql, 1); $statement->execute([TIME_NOW - 86400 * 7]); return $statement->fetchSingleColumn(); diff --git a/wcfsetup/install/files/lib/system/like/LikeHandler.class.php b/wcfsetup/install/files/lib/system/like/LikeHandler.class.php index d3c2308fe3..d839d90c7b 100644 --- a/wcfsetup/install/files/lib/system/like/LikeHandler.class.php +++ b/wcfsetup/install/files/lib/system/like/LikeHandler.class.php @@ -178,13 +178,13 @@ class LikeHandler extends SingletonFactory { $sql = "SELECT like_object.likes, like_object.dislikes, like_object.cumulativeLikes, CASE WHEN like_table.likeValue IS NOT NULL THEN like_table.likeValue ELSE 0 END AS liked - FROM wcf" . WCF_N . "_like_object like_object - LEFT JOIN wcf" . WCF_N . "_like like_table + FROM wcf1_like_object like_object + LEFT JOIN wcf1_like like_table ON like_table.objectTypeID = ? AND like_table.objectID = like_object.objectID AND like_table.userID = ? WHERE like_object.likeObjectID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $likeObject->objectTypeID, $user->userID, diff --git a/wcfsetup/install/files/lib/system/log/modification/AbstractModificationLogHandler.class.php b/wcfsetup/install/files/lib/system/log/modification/AbstractModificationLogHandler.class.php index 175bcdf53d..4d50b64bbf 100644 --- a/wcfsetup/install/files/lib/system/log/modification/AbstractModificationLogHandler.class.php +++ b/wcfsetup/install/files/lib/system/log/modification/AbstractModificationLogHandler.class.php @@ -121,9 +121,9 @@ abstract class AbstractModificationLogHandler extends SingletonFactory $conditionBuilder->add('action NOT IN (?)', [$ignoredActions]); } - $sql = "DELETE FROM wcf" . WCF_N . "_modification_log + $sql = "DELETE FROM wcf1_modification_log " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); } @@ -142,9 +142,9 @@ abstract class AbstractModificationLogHandler extends SingletonFactory $conditionBuilder->add('objectTypeID = ?', [$this->objectType->objectTypeID]); $conditionBuilder->add('parentObjectID IN (?)', [$parentObjectIDs]); - $sql = "DELETE FROM wcf" . WCF_N . "_modification_log + $sql = "DELETE FROM wcf1_modification_log " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); } @@ -181,10 +181,10 @@ abstract class AbstractModificationLogHandler extends SingletonFactory $conditionBuilder->add('objectTypeID = ?', [$this->objectType->objectTypeID]); $conditionBuilder->add('objectID IN (?)', [$objectIDs]); - $sql = "UPDATE wcf" . WCF_N . "_modification_log + $sql = "UPDATE wcf1_modification_log SET parentObjectID = ? " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(\array_merge([$newParentObjectID], $conditionBuilder->getParameters())); } } diff --git a/wcfsetup/install/files/lib/system/message/embedded/object/MediaMessageEmbeddedObjectHandler.class.php b/wcfsetup/install/files/lib/system/message/embedded/object/MediaMessageEmbeddedObjectHandler.class.php index 2b97de268a..93b6930db7 100644 --- a/wcfsetup/install/files/lib/system/message/embedded/object/MediaMessageEmbeddedObjectHandler.class.php +++ b/wcfsetup/install/files/lib/system/message/embedded/object/MediaMessageEmbeddedObjectHandler.class.php @@ -61,9 +61,9 @@ class MediaMessageEmbeddedObjectHandler extends AbstractSimpleMessageEmbeddedObj $conditions->add("languageID = ?", [$contentLanguageID]); $sql = "SELECT * - FROM wcf" . WCF_N . "_media_content + FROM wcf1_media_content " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); while ($row = $statement->fetchArray()) { $viewableMedia[$row['mediaID']]->setLocalizedContent($row['languageID'], $row); diff --git a/wcfsetup/install/files/lib/system/message/embedded/object/MessageEmbeddedObjectManager.class.php b/wcfsetup/install/files/lib/system/message/embedded/object/MessageEmbeddedObjectManager.class.php index 0f75c6233b..d3d012802c 100644 --- a/wcfsetup/install/files/lib/system/message/embedded/object/MessageEmbeddedObjectManager.class.php +++ b/wcfsetup/install/files/lib/system/message/embedded/object/MessageEmbeddedObjectManager.class.php @@ -103,10 +103,10 @@ class MessageEmbeddedObjectManager extends SingletonFactory $statement = null; if (!$isBulk) { // prepare statement - $sql = "INSERT INTO wcf" . WCF_N . "_message_embedded_object + $sql = "INSERT INTO wcf1_message_embedded_object (messageObjectTypeID, messageID, embeddedObjectTypeID, embeddedObjectID) VALUES (?, ?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); } @@ -153,10 +153,10 @@ class MessageEmbeddedObjectManager extends SingletonFactory WCF::getDB()->commitTransaction(); // prepare statement - $sql = "INSERT INTO wcf" . WCF_N . "_message_embedded_object + $sql = "INSERT INTO wcf1_message_embedded_object (messageObjectTypeID, messageID, embeddedObjectTypeID, embeddedObjectID) VALUES (?, ?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); foreach ($this->bulkData['insert'] as $parameters) { @@ -192,10 +192,10 @@ class MessageEmbeddedObjectManager extends SingletonFactory } // prepare statement - $sql = "INSERT INTO wcf" . WCF_N . "_message_embedded_object + $sql = "INSERT INTO wcf1_message_embedded_object (messageObjectTypeID, messageID, embeddedObjectTypeID, embeddedObjectID) VALUES (?, ?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); // call embedded object handlers WCF::getDB()->beginTransaction(); @@ -224,9 +224,9 @@ class MessageEmbeddedObjectManager extends SingletonFactory ); $conditionBuilder->add('messageID IN (?)', [$messageIDs]); - $sql = "DELETE FROM wcf" . WCF_N . "_message_embedded_object + $sql = "DELETE FROM wcf1_message_embedded_object " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); } @@ -252,9 +252,9 @@ class MessageEmbeddedObjectManager extends SingletonFactory // get object ids $sql = "SELECT * - FROM wcf" . WCF_N . "_message_embedded_object + FROM wcf1_message_embedded_object " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); $embeddedObjects = []; while ($row = $statement->fetchArray()) { diff --git a/wcfsetup/install/files/lib/system/moderation/queue/AbstractCommentResponseModerationQueueHandler.class.php b/wcfsetup/install/files/lib/system/moderation/queue/AbstractCommentResponseModerationQueueHandler.class.php index c0a28d21ed..fb3e764d4e 100644 --- a/wcfsetup/install/files/lib/system/moderation/queue/AbstractCommentResponseModerationQueueHandler.class.php +++ b/wcfsetup/install/files/lib/system/moderation/queue/AbstractCommentResponseModerationQueueHandler.class.php @@ -51,11 +51,11 @@ class AbstractCommentResponseModerationQueueHandler extends AbstractCommentComme $conditions->add("comment_response.responseID IN (?)", [$responseIDs]); $sql = "SELECT comment_response.responseID, comment.commentID, comment.objectTypeID, comment.objectID - FROM wcf" . WCF_N . "_comment_response comment_response - LEFT JOIN wcf" . WCF_N . "_comment comment + FROM wcf1_comment_response comment_response + LEFT JOIN wcf1_comment comment ON comment.commentID = comment_response.commentID " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $comments = $responses = []; while ($row = $statement->fetchArray()) { diff --git a/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueHandler.class.php b/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueHandler.class.php index 9953f1a244..1e5fc914e9 100644 --- a/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueHandler.class.php +++ b/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueHandler.class.php @@ -68,7 +68,7 @@ abstract class AbstractModerationQueueHandler implements IModerationQueueHandler $sql = "SELECT " . $indexName . " FROM " . $tableName . " " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); while ($row = $statement->fetchArray()) { unset($queues[$row[$indexName]]); @@ -93,9 +93,9 @@ abstract class AbstractModerationQueueHandler implements IModerationQueueHandler $conditions->add("objectID IN (?)", [$objectIDs]); $sql = "SELECT queueID - FROM wcf" . WCF_N . "_moderation_queue + FROM wcf1_moderation_queue " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $queueIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); diff --git a/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueManager.class.php b/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueManager.class.php index 868f997f2a..ecbfcb1214 100644 --- a/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueManager.class.php +++ b/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueManager.class.php @@ -95,10 +95,10 @@ abstract class AbstractModerationQueueManager extends SingletonFactory implement protected function addEntry($objectTypeID, $objectID, $containerID = 0, array $additionalData = []) { $sql = "SELECT queueID - FROM wcf" . WCF_N . "_moderation_queue + FROM wcf1_moderation_queue WHERE objectTypeID = ? AND objectID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $objectTypeID, $objectID, @@ -154,9 +154,9 @@ abstract class AbstractModerationQueueManager extends SingletonFactory implement $conditionBuilder->add('objectID IN (?)', [$objectIDs]); $sql = "SELECT queueID, objectID - FROM wcf" . WCF_N . "_moderation_queue + FROM wcf1_moderation_queue " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); $existingQueueIDs = $statement->fetchMap('objectID', 'queueID'); @@ -185,13 +185,13 @@ abstract class AbstractModerationQueueManager extends SingletonFactory implement ]); } - $sql = "INSERT INTO wcf" . WCF_N . "_moderation_queue + $sql = "INSERT INTO wcf1_moderation_queue (objectTypeID, objectID, containerID, userID, time, lastChangeTime, additionalData) VALUES (?, ?, ?, ?, ?, ?, ?)" . \str_repeat( ', (?, ?, ?, ?, ?, ?, ?)', \count($batchObjectIDs) - 1 ); - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($parameters); } WCF::getDB()->commitTransaction(); @@ -219,7 +219,7 @@ abstract class AbstractModerationQueueManager extends SingletonFactory implement $conditionBuilder = new PreparedStatementConditionBuilder(); $conditionBuilder->add('queueID IN (?)', [$batchQueueIDs]); - $sql = "UPDATE wcf" . WCF_N . "_moderation_queue + $sql = "UPDATE wcf1_moderation_queue SET status = ?, containerID = ?, userID = ?, @@ -227,7 +227,7 @@ abstract class AbstractModerationQueueManager extends SingletonFactory implement lastChangeTime = ?, additionalData = ? " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(\array_merge( [ ModerationQueue::STATUS_OUTSTANDING, diff --git a/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueManager.class.php b/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueManager.class.php index c9b494eb3a..2a1f66c7ed 100644 --- a/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueManager.class.php +++ b/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueManager.class.php @@ -241,11 +241,11 @@ class ModerationQueueManager extends SingletonFactory ); $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_moderation_queue_to_user moderation_queue_to_user - LEFT JOIN wcf" . WCF_N . "_moderation_queue moderation_queue + FROM wcf1_moderation_queue_to_user moderation_queue_to_user + LEFT JOIN wcf1_moderation_queue moderation_queue ON moderation_queue.queueID = moderation_queue_to_user.queueID " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $count = $statement->fetchSingleColumn(); @@ -287,15 +287,15 @@ class ModerationQueueManager extends SingletonFactory $conditions->add("(moderation_queue.time > tracked_visit.visitTime OR tracked_visit.visitTime IS NULL)"); $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_moderation_queue_to_user moderation_queue_to_user - LEFT JOIN wcf" . WCF_N . "_moderation_queue moderation_queue + FROM wcf1_moderation_queue_to_user moderation_queue_to_user + LEFT JOIN wcf1_moderation_queue moderation_queue ON moderation_queue.queueID = moderation_queue_to_user.queueID - LEFT JOIN wcf" . WCF_N . "_tracked_visit tracked_visit + LEFT JOIN wcf1_tracked_visit tracked_visit ON tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.moderation.queue') . " AND tracked_visit.objectID = moderation_queue.queueID AND tracked_visit.userID = " . WCF::getUser()->userID . " " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $count = $statement->fetchSingleColumn(); @@ -313,7 +313,7 @@ class ModerationQueueManager extends SingletonFactory { $queueList = new ModerationQueueList(); $queueList->sqlJoins = " - LEFT JOIN wcf" . WCF_N . "_moderation_queue_to_user moderation_queue_to_user + LEFT JOIN wcf1_moderation_queue_to_user moderation_queue_to_user ON moderation_queue_to_user.queueID = moderation_queue.queueID AND moderation_queue_to_user.userID = " . WCF::getUser()->userID; $queueList->getConditionBuilder()->add("moderation_queue_to_user.queueID IS NULL"); @@ -359,10 +359,10 @@ class ModerationQueueManager extends SingletonFactory ); } - $sql = "INSERT IGNORE INTO wcf" . WCF_N . "_moderation_queue_to_user + $sql = "INSERT IGNORE INTO wcf1_moderation_queue_to_user (queueID, userID, isAffected) VALUES (?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); foreach ($assignments as $queueID => $isAffected) { @@ -381,13 +381,13 @@ class ModerationQueueManager extends SingletonFactory public function identifyOrphans() { $sql = "SELECT moderation_queue.queueID, moderation_queue.objectTypeID, moderation_queue.objectID - FROM wcf" . WCF_N . "_moderation_queue_to_user moderation_queue_to_user - LEFT JOIN wcf" . WCF_N . "_moderation_queue moderation_queue + FROM wcf1_moderation_queue_to_user moderation_queue_to_user + LEFT JOIN wcf1_moderation_queue moderation_queue ON moderation_queue.queueID = moderation_queue_to_user.queueID WHERE moderation_queue_to_user.userID = ? AND moderation_queue_to_user.isAffected = ? AND moderation_queue.status <> ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ WCF::getUser()->userID, 1, @@ -431,9 +431,9 @@ class ModerationQueueManager extends SingletonFactory if (!empty($queueIDs)) { $conditions = new PreparedStatementConditionBuilder(); $conditions->add("queueID IN (?)", [$queueIDs]); - $sql = "DELETE FROM wcf" . WCF_N . "_moderation_queue + $sql = "DELETE FROM wcf1_moderation_queue " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); CommentHandler::getInstance()->deleteObjects('com.woltlab.wcf.moderation.queue', $queueIDs); diff --git a/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueReportManager.class.php b/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueReportManager.class.php index 77aad36ea2..dc969805c7 100644 --- a/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueReportManager.class.php +++ b/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueReportManager.class.php @@ -41,10 +41,10 @@ class ModerationQueueReportManager extends AbstractModerationQueueManager $objectTypeID = $this->getObjectTypeID($objectType); $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_moderation_queue + FROM wcf1_moderation_queue WHERE objectTypeID = ? AND objectID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $objectTypeID, $objectID, @@ -66,11 +66,11 @@ class ModerationQueueReportManager extends AbstractModerationQueueManager $objectTypeID = $this->getObjectTypeID($objectType); $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_moderation_queue + FROM wcf1_moderation_queue WHERE objectTypeID = ? AND objectID = ? AND status IN (?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $objectTypeID, $objectID, @@ -157,11 +157,11 @@ class ModerationQueueReportManager extends AbstractModerationQueueManager protected function addEntry($objectTypeID, $objectID, $containerID = 0, array $additionalData = []) { $sql = "SELECT queueID - FROM wcf" . WCF_N . "_moderation_queue + FROM wcf1_moderation_queue WHERE objectTypeID = ? AND objectID = ? AND status <> ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $objectTypeID, $objectID, diff --git a/wcfsetup/install/files/lib/system/option/UseroptionsOptionType.class.php b/wcfsetup/install/files/lib/system/option/UseroptionsOptionType.class.php index 07f8642ea1..014689ff63 100644 --- a/wcfsetup/install/files/lib/system/option/UseroptionsOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/UseroptionsOptionType.class.php @@ -84,14 +84,14 @@ class UseroptionsOptionType extends AbstractOptionType if (self::$userOptions === null) { self::$userOptions = []; $sql = "SELECT optionName - FROM wcf" . WCF_N . "_user_option + FROM wcf1_user_option WHERE categoryName IN ( SELECT categoryName - FROM wcf" . WCF_N . "_user_option_category + FROM wcf1_user_option_category WHERE parentCategoryName = 'profile' ) AND optionType <> 'boolean'"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(); self::$userOptions = $statement->fetchAll(\PDO::FETCH_COLUMN); } diff --git a/wcfsetup/install/files/lib/system/package/ACPTemplatesFileHandler.class.php b/wcfsetup/install/files/lib/system/package/ACPTemplatesFileHandler.class.php index 03568f8e84..3da7c9c5bb 100644 --- a/wcfsetup/install/files/lib/system/package/ACPTemplatesFileHandler.class.php +++ b/wcfsetup/install/files/lib/system/package/ACPTemplatesFileHandler.class.php @@ -57,9 +57,9 @@ class ACPTemplatesFileHandler extends PackageInstallationFileHandler } $sql = "SELECT packageID, templateName - FROM wcf" . WCF_N . "_" . $this->tableName . " + FROM wcf1_" . $this->tableName . " " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $lockedFiles = $statement->fetchMap('templateName', 'packageID'); @@ -103,9 +103,9 @@ class ACPTemplatesFileHandler extends PackageInstallationFileHandler $conditions->add('application = ?', [$this->application]); $sql = "SELECT templateName - FROM wcf" . WCF_N . "_" . $this->tableName . " + FROM wcf1_" . $this->tableName . " " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); while ($templateName = $statement->fetchColumn()) { @@ -117,10 +117,10 @@ class ACPTemplatesFileHandler extends PackageInstallationFileHandler } if (!empty($files)) { - $sql = "INSERT INTO wcf" . WCF_N . "_" . $this->tableName . " + $sql = "INSERT INTO wcf1_" . $this->tableName . " (packageID, templateName, application) VALUES (?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($files as $file) { $statement->execute([ diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationFormManager.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationFormManager.class.php index e6fdc69f2f..127ffb2d5c 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationFormManager.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationFormManager.class.php @@ -62,10 +62,10 @@ abstract class PackageInstallationFormManager public static function findForm(PackageInstallationQueue $queue, $formName) { $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_package_installation_form + FROM wcf1_package_installation_form WHERE queueID = ? AND formName = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $queue->queueID, $formName, @@ -82,10 +82,10 @@ abstract class PackageInstallationFormManager */ private static function insertForm(PackageInstallationQueue $queue, FormDocument $document) { - $sql = "INSERT INTO wcf" . WCF_N . "_package_installation_form + $sql = "INSERT INTO wcf1_package_installation_form (queueID, formName, document) VALUES (?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $queue->queueID, $document->getName(), @@ -101,11 +101,11 @@ abstract class PackageInstallationFormManager */ private static function updateForm(PackageInstallationQueue $queue, FormDocument $document) { - $sql = "UPDATE wcf" . WCF_N . "_package_installation_form + $sql = "UPDATE wcf1_package_installation_form SET document = ? WHERE queueID = ? AND formName = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ \base64_encode(\serialize($document)), $queue->queueID, @@ -120,9 +120,9 @@ abstract class PackageInstallationFormManager */ public static function deleteForms(PackageInstallationQueue $queue) { - $sql = "DELETE FROM wcf" . WCF_N . "_package_installation_form + $sql = "DELETE FROM wcf1_package_installation_form WHERE queueID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$queue->queueID]); } @@ -136,10 +136,10 @@ abstract class PackageInstallationFormManager public static function getForm(PackageInstallationQueue $queue, $formName) { $sql = "SELECT document - FROM wcf" . WCF_N . "_package_installation_form + FROM wcf1_package_installation_form WHERE queueID = ? AND formName = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $queue->queueID, $formName, diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php index aab8692754..205d0c0a56 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php @@ -828,7 +828,7 @@ class PackageInstallationNodeBuilder ); $queueList->getConditionBuilder()->add("package_installation_queue.queueID NOT IN ( SELECT queueID - FROM wcf" . WCF_N . "_package_installation_node + FROM wcf1_package_installation_node )"); $queueList->readObjects(); diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationSQLParser.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationSQLParser.class.php index 10c856ae83..80b0b5fe1a 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationSQLParser.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationSQLParser.class.php @@ -120,16 +120,16 @@ class PackageInstallationSQLParser extends SQLParser { // tables foreach ($this->tableLog as $logEntry) { - $sql = "DELETE FROM wcf" . WCF_N . "_package_installation_sql_log + $sql = "DELETE FROM wcf1_package_installation_sql_log WHERE sqlTable = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$logEntry['tableName']]); if ($logEntry['action'] == 'insert') { - $sql = "INSERT INTO wcf" . WCF_N . "_package_installation_sql_log + $sql = "INSERT INTO wcf1_package_installation_sql_log (packageID, sqlTable) VALUES (?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $logEntry['packageID'], $logEntry['tableName'], @@ -139,15 +139,15 @@ class PackageInstallationSQLParser extends SQLParser // columns if (!empty($this->columnLog)) { - $sql = "DELETE FROM wcf" . WCF_N . "_package_installation_sql_log + $sql = "DELETE FROM wcf1_package_installation_sql_log WHERE sqlTable = ? AND sqlColumn = ?"; - $deleteStatement = WCF::getDB()->prepareStatement($sql); + $deleteStatement = WCF::getDB()->prepare($sql); - $sql = "INSERT INTO wcf" . WCF_N . "_package_installation_sql_log + $sql = "INSERT INTO wcf1_package_installation_sql_log (packageID, sqlTable, sqlColumn) VALUES (?, ?, ?)"; - $insertStatement = WCF::getDB()->prepareStatement($sql); + $insertStatement = WCF::getDB()->prepare($sql); foreach ($this->columnLog as $logEntry) { $deleteStatement->execute([ @@ -167,15 +167,15 @@ class PackageInstallationSQLParser extends SQLParser // indices if (!empty($this->indexLog)) { - $sql = "DELETE FROM wcf" . WCF_N . "_package_installation_sql_log + $sql = "DELETE FROM wcf1_package_installation_sql_log WHERE sqlTable = ? AND sqlIndex = ?"; - $deleteStatement = WCF::getDB()->prepareStatement($sql); + $deleteStatement = WCF::getDB()->prepare($sql); - $sql = "INSERT INTO wcf" . WCF_N . "_package_installation_sql_log + $sql = "INSERT INTO wcf1_package_installation_sql_log (packageID, sqlTable, sqlIndex) VALUES (?, ?, ?)"; - $insertStatement = WCF::getDB()->prepareStatement($sql); + $insertStatement = WCF::getDB()->prepare($sql); foreach ($this->indexLog as $logEntry) { $deleteStatement->execute([ @@ -200,10 +200,10 @@ class PackageInstallationSQLParser extends SQLParser protected function getKnownTables() { $sql = "SELECT packageID, sqlTable - FROM wcf" . WCF_N . "_package_installation_sql_log + FROM wcf1_package_installation_sql_log WHERE sqlColumn = '' AND sqlIndex = ''"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(); $this->knownTables = $statement->fetchMap('sqlTable', 'packageID'); } @@ -218,10 +218,10 @@ class PackageInstallationSQLParser extends SQLParser protected function getColumnOwnerID($tableName, $columnName) { $sql = "SELECT packageID - FROM wcf" . WCF_N . "_package_installation_sql_log + FROM wcf1_package_installation_sql_log WHERE sqlTable = ? AND sqlColumn = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $tableName, $columnName, @@ -246,10 +246,10 @@ class PackageInstallationSQLParser extends SQLParser protected function getIndexOwnerID($tableName, $indexName) { $sql = "SELECT packageID - FROM wcf" . WCF_N . "_package_installation_sql_log + FROM wcf1_package_installation_sql_log WHERE sqlTable = ? AND sqlIndex = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $tableName, $indexName, diff --git a/wcfsetup/install/files/lib/system/package/PackageUninstallationDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageUninstallationDispatcher.class.php index 7a8ea40de8..39ab50032f 100644 --- a/wcfsetup/install/files/lib/system/package/PackageUninstallationDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageUninstallationDispatcher.class.php @@ -172,9 +172,9 @@ class PackageUninstallationDispatcher extends PackageInstallationDispatcher PackageEditor::deleteAll([$this->queue->packageID]); // remove localized package info - $sql = "DELETE FROM wcf" . WCF_N . "_language_item + $sql = "DELETE FROM wcf1_language_item WHERE languageItem IN (?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ 'wcf.acp.package.packageName.package' . $this->queue->packageID, 'wcf.acp.package.packageDescription.package' . $this->queue->packageID, diff --git a/wcfsetup/install/files/lib/system/package/TemplatesFileHandler.class.php b/wcfsetup/install/files/lib/system/package/TemplatesFileHandler.class.php index 7bed8202bf..4cd03cd36f 100644 --- a/wcfsetup/install/files/lib/system/package/TemplatesFileHandler.class.php +++ b/wcfsetup/install/files/lib/system/package/TemplatesFileHandler.class.php @@ -40,19 +40,19 @@ class TemplatesFileHandler extends ACPTemplatesFileHandler // get existing templates $updateTemplateIDs = []; $sql = "SELECT templateName, templateID - FROM wcf" . WCF_N . "_template + FROM wcf1_template WHERE packageID = ? AND application = ? AND templateGroupID IS NULL"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$packageID, $this->application]); $existingTemplates = $statement->fetchMap('templateName', 'templateID'); // save new templates - $sql = "INSERT INTO wcf" . WCF_N . "_template + $sql = "INSERT INTO wcf1_template (packageID, templateName, lastModificationTime, application) VALUES (?, ?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($files as $file) { if (isset($existingTemplates[$file])) { $updateTemplateIDs[] = $existingTemplates[$file]; @@ -72,10 +72,10 @@ class TemplatesFileHandler extends ACPTemplatesFileHandler $conditionBuilder = new PreparedStatementConditionBuilder(); $conditionBuilder->add('templateID IN (?)', [$updateTemplateIDs]); - $sql = "UPDATE wcf" . WCF_N . "_template + $sql = "UPDATE wcf1_template SET lastModificationTime = ? " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(\array_merge([TIME_NOW], $conditionBuilder->getParameters())); } } diff --git a/wcfsetup/install/files/lib/system/package/plugin/ACLOptionPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/ACLOptionPackageInstallationPlugin.class.php index c9955b2e7e..64868d33b9 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/ACLOptionPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/ACLOptionPackageInstallationPlugin.class.php @@ -71,11 +71,11 @@ class ACLOptionPackageInstallationPlugin extends AbstractOptionPackageInstallati } if (!empty($options)) { - $sql = "DELETE FROM " . $this->application . WCF_N . "_" . $this->tableName . " + $sql = "DELETE FROM " . $this->application . "1_" . $this->tableName . " WHERE optionName = ? AND objectTypeID = ? AND packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($options as $option) { $statement->execute([ @@ -100,11 +100,11 @@ class ACLOptionPackageInstallationPlugin extends AbstractOptionPackageInstallati if (!empty($categories)) { // delete options for given categories - $sql = "DELETE FROM " . $this->application . WCF_N . "_" . $this->tableName . " + $sql = "DELETE FROM " . $this->application . "1_" . $this->tableName . " WHERE categoryName = ? AND objectTypeID = ? AND packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($categories as $category) { $statement->execute([ $category['name'], @@ -114,11 +114,11 @@ class ACLOptionPackageInstallationPlugin extends AbstractOptionPackageInstallati } // delete categories - $sql = "DELETE FROM " . $this->application . WCF_N . "_" . $this->tableName . "_category + $sql = "DELETE FROM " . $this->application . "1_" . $this->tableName . "_category WHERE categoryName = ? AND objectTypeID = ? AND packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($categories as $category) { $statement->execute([ @@ -165,11 +165,11 @@ class ACLOptionPackageInstallationPlugin extends AbstractOptionPackageInstallati if ($this->editedEntry === null) { // search existing category $sql = "SELECT categoryID - FROM wcf" . WCF_N . "_" . $this->tableName . "_category + FROM wcf1_" . $this->tableName . "_category WHERE categoryName = ? AND objectTypeID = ? AND packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $category['categoryName'], $objectTypeID, @@ -178,10 +178,10 @@ class ACLOptionPackageInstallationPlugin extends AbstractOptionPackageInstallati $row = $statement->fetchArray(); if (!$row) { // insert new category - $sql = "INSERT INTO wcf" . WCF_N . "_" . $this->tableName . "_category + $sql = "INSERT INTO wcf1_" . $this->tableName . "_category (packageID, objectTypeID, categoryName) VALUES (?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $this->installation->getPackageID(), $objectTypeID, @@ -192,11 +192,11 @@ class ACLOptionPackageInstallationPlugin extends AbstractOptionPackageInstallati $editedData = $this->getElementData($this->editedEntry, true); $sql = "SELECT categoryID - FROM wcf" . WCF_N . "_" . $this->tableName . "_category + FROM wcf1_" . $this->tableName . "_category WHERE categoryName = ? AND objectTypeID = ? AND packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $editedData['categoryName'], $editedData['objectTypeID'], @@ -238,10 +238,10 @@ class ACLOptionPackageInstallationPlugin extends AbstractOptionPackageInstallati // validate category name if (isset($data['categoryname'])) { $sql = "SELECT COUNT(categoryID) - FROM wcf" . WCF_N . "_" . $this->tableName . "_category + FROM wcf1_" . $this->tableName . "_category WHERE categoryName = ? AND objectTypeID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $data['categoryname'], $objectTypeID, @@ -269,11 +269,11 @@ class ACLOptionPackageInstallationPlugin extends AbstractOptionPackageInstallati { // check for option existence $sql = "SELECT optionID - FROM wcf" . WCF_N . "_" . $this->tableName . " + FROM wcf1_" . $this->tableName . " WHERE optionName = ? AND objectTypeID = ? AND packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $option['optionName'], $option['objectTypeID'], @@ -281,10 +281,10 @@ class ACLOptionPackageInstallationPlugin extends AbstractOptionPackageInstallati ]); $row = $statement->fetchArray(); if (!$row) { - $sql = "INSERT INTO wcf" . WCF_N . "_" . $this->tableName . " + $sql = "INSERT INTO wcf1_" . $this->tableName . " (packageID, objectTypeID, optionName, categoryName) VALUES (?, ?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $this->installation->getPackageID(), $option['objectTypeID'], @@ -292,10 +292,10 @@ class ACLOptionPackageInstallationPlugin extends AbstractOptionPackageInstallati $categoryName, ]); } else { - $sql = "UPDATE wcf" . WCF_N . "_" . $this->tableName . " + $sql = "UPDATE wcf1_" . $this->tableName . " SET categoryName = ? WHERE optionID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $categoryName, $row['optionID'], @@ -664,22 +664,22 @@ class ACLOptionPackageInstallationPlugin extends AbstractOptionPackageInstallati switch ($this->entryType) { case 'categories': // also delete options - $sql = "DELETE FROM " . $this->application . WCF_N . "_" . $this->tableName . " + $sql = "DELETE FROM " . $this->application . "1_" . $this->tableName . " WHERE categoryName = ? AND objectTypeID = ? AND packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $name, $this->getObjectTypeID($objectType), $this->installation->getPackageID(), ]); - $sql = "DELETE FROM " . $this->application . WCF_N . "_" . $this->tableName . "_category + $sql = "DELETE FROM " . $this->application . "1_" . $this->tableName . "_category WHERE categoryName = ? AND objectTypeID = ? AND packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $name, $this->getObjectTypeID($objectType), @@ -689,11 +689,11 @@ class ACLOptionPackageInstallationPlugin extends AbstractOptionPackageInstallati break; case 'options': - $sql = "DELETE FROM " . $this->application . WCF_N . "_" . $this->tableName . " + $sql = "DELETE FROM " . $this->application . "1_" . $this->tableName . " WHERE optionName = ? AND objectTypeID = ? AND packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $name, $this->getObjectTypeID($objectType), diff --git a/wcfsetup/install/files/lib/system/package/plugin/ACPSearchProviderPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/ACPSearchProviderPackageInstallationPlugin.class.php index faa78ba446..83a2170a0c 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/ACPSearchProviderPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/ACPSearchProviderPackageInstallationPlugin.class.php @@ -42,10 +42,10 @@ class ACPSearchProviderPackageInstallationPlugin extends AbstractXMLPackageInsta */ protected function handleDelete(array $items) { - $sql = "DELETE FROM wcf" . WCF_N . "_" . $this->tableName . " + $sql = "DELETE FROM wcf1_" . $this->tableName . " WHERE providerName = ? AND packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); foreach ($items as $item) { @@ -79,7 +79,7 @@ class ACPSearchProviderPackageInstallationPlugin extends AbstractXMLPackageInsta protected function findExistingItem(array $data) { $sql = "SELECT * - FROM wcf" . WCF_N . "_" . $this->tableName . " + FROM wcf1_" . $this->tableName . " WHERE providerName = ? AND packageID = ?"; $parameters = [ diff --git a/wcfsetup/install/files/lib/system/package/plugin/AbstractMenuPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/AbstractMenuPackageInstallationPlugin.class.php index cafa0513f6..e5d566d944 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/AbstractMenuPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/AbstractMenuPackageInstallationPlugin.class.php @@ -44,10 +44,10 @@ abstract class AbstractMenuPackageInstallationPlugin extends AbstractXMLPackageI */ protected function handleDelete(array $items) { - $sql = "DELETE FROM " . $this->application . WCF_N . "_" . $this->tableName . " + $sql = "DELETE FROM " . $this->application . "1_" . $this->tableName . " WHERE menuItem = ? AND packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($items as $item) { $statement->execute([ $item['attributes']['name'], @@ -88,9 +88,9 @@ abstract class AbstractMenuPackageInstallationPlugin extends AbstractXMLPackageI } $sql = "SELECT COUNT(menuItemID) - FROM " . $this->application . WCF_N . "_" . $this->tableName . " + FROM " . $this->application . "1_" . $this->tableName . " WHERE menuItem = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$data['parentMenuItem']]); if (!$statement->fetchSingleColumn()) { @@ -104,7 +104,7 @@ abstract class AbstractMenuPackageInstallationPlugin extends AbstractXMLPackageI protected function findExistingItem(array $data) { $sql = "SELECT * - FROM " . $this->application . WCF_N . "_" . $this->tableName . " + FROM " . $this->application . "1_" . $this->tableName . " WHERE menuItem = ? AND packageID = ?"; $parameters = [ diff --git a/wcfsetup/install/files/lib/system/package/plugin/AbstractOptionPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/AbstractOptionPackageInstallationPlugin.class.php index 423984b929..3f2fcc30f5 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/AbstractOptionPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/AbstractOptionPackageInstallationPlugin.class.php @@ -119,10 +119,10 @@ abstract class AbstractOptionPackageInstallationPlugin extends AbstractXMLPackag } if (!empty($options)) { - $sql = "DELETE FROM " . $this->application . WCF_N . "_" . $this->tableName . " + $sql = "DELETE FROM " . $this->application . "1_" . $this->tableName . " WHERE optionName = ? AND packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($options as $option) { $statement->execute([ @@ -143,10 +143,10 @@ abstract class AbstractOptionPackageInstallationPlugin extends AbstractXMLPackag if (!empty($categories)) { // delete options for given categories - $sql = "DELETE FROM " . $this->application . WCF_N . "_" . $this->tableName . " + $sql = "DELETE FROM " . $this->application . "1_" . $this->tableName . " WHERE categoryName = ? AND packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($categories as $category) { $statement->execute([ $category, @@ -155,10 +155,10 @@ abstract class AbstractOptionPackageInstallationPlugin extends AbstractXMLPackag } // delete categories - $sql = "DELETE FROM " . $this->application . WCF_N . "_" . $this->tableName . "_category + $sql = "DELETE FROM " . $this->application . "1_" . $this->tableName . "_category WHERE categoryName = ? AND packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($categories as $category) { $statement->execute([ @@ -211,9 +211,9 @@ abstract class AbstractOptionPackageInstallationPlugin extends AbstractXMLPackag // validate parent if (!empty($data['parentCategoryName'])) { $sql = "SELECT COUNT(categoryID) - FROM " . $this->application . WCF_N . "_" . $this->tableName . "_category + FROM " . $this->application . "1_" . $this->tableName . "_category WHERE categoryName = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$data['parentCategoryName']]); if (!$statement->fetchSingleColumn()) { @@ -257,9 +257,9 @@ abstract class AbstractOptionPackageInstallationPlugin extends AbstractXMLPackag { $hasUninstallOptions = parent::hasUninstall(); $sql = "SELECT COUNT(categoryID) - FROM " . $this->application . WCF_N . "_" . $this->tableName . "_category + FROM " . $this->application . "1_" . $this->tableName . "_category WHERE packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->installation->getPackageID()]); return $hasUninstallOptions || $statement->fetchSingleColumn() > 0; @@ -274,9 +274,9 @@ abstract class AbstractOptionPackageInstallationPlugin extends AbstractXMLPackag parent::uninstall(); // delete categories - $sql = "DELETE FROM " . $this->application . WCF_N . "_" . $this->tableName . "_category + $sql = "DELETE FROM " . $this->application . "1_" . $this->tableName . "_category WHERE packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->installation->getPackageID()]); } @@ -289,9 +289,9 @@ abstract class AbstractOptionPackageInstallationPlugin extends AbstractXMLPackag protected function getExistingCategory($category) { $sql = "SELECT categoryID, packageID - FROM " . $this->application . WCF_N . "_" . $this->tableName . "_category + FROM " . $this->application . "1_" . $this->tableName . "_category WHERE categoryName = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $category, ]); @@ -311,11 +311,11 @@ abstract class AbstractOptionPackageInstallationPlugin extends AbstractXMLPackag $row = $this->getExistingCategory($category['categoryName']); if (empty($row['categoryID'])) { // insert new category - $sql = "INSERT INTO " . $this->application . WCF_N . "_" . $this->tableName . "_category + $sql = "INSERT INTO " . $this->application . "1_" . $this->tableName . "_category (packageID, categoryName, parentCategoryName, permissions, options" . ($category['showOrder'] !== null ? ",showOrder" : "") . ") VALUES (?, ?, ?, ?, ?" . ($category['showOrder'] !== null ? ", ?" : "") . ")"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $data = [ $this->installation->getPackageID(), @@ -335,13 +335,13 @@ abstract class AbstractOptionPackageInstallationPlugin extends AbstractXMLPackag } // update existing category - $sql = "UPDATE " . $this->application . WCF_N . "_" . $this->tableName . "_category + $sql = "UPDATE " . $this->application . "1_" . $this->tableName . "_category SET parentCategoryName = ?, permissions = ?, options = ? " . (isset($category['showOrder']) ? ", showOrder = ?" : "") . " WHERE categoryID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $data = [ $category['parentCategoryName'] ?? '', @@ -382,9 +382,9 @@ abstract class AbstractOptionPackageInstallationPlugin extends AbstractXMLPackag // check if option already exists $sql = "SELECT * - FROM " . $this->application . WCF_N . "_" . $this->tableName . " + FROM " . $this->application . "1_" . $this->tableName . " WHERE optionName = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $data['name'], ]); @@ -1221,19 +1221,19 @@ abstract class AbstractOptionPackageInstallationPlugin extends AbstractXMLPackag switch ($this->entryType) { case 'categories': // also delete options - $sql = "DELETE FROM " . $this->application . WCF_N . "_" . $this->tableName . " + $sql = "DELETE FROM " . $this->application . "1_" . $this->tableName . " WHERE categoryName = ? AND packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $name, $this->installation->getPackageID(), ]); - $sql = "DELETE FROM " . $this->application . WCF_N . "_" . $this->tableName . "_category + $sql = "DELETE FROM " . $this->application . "1_" . $this->tableName . "_category WHERE categoryName = ? AND packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $name, $this->installation->getPackageID(), @@ -1242,10 +1242,10 @@ abstract class AbstractOptionPackageInstallationPlugin extends AbstractXMLPackag break; case 'options': - $sql = "DELETE FROM " . $this->application . WCF_N . "_" . $this->tableName . " + $sql = "DELETE FROM " . $this->application . "1_" . $this->tableName . " WHERE optionName = ? AND packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $name, $this->installation->getPackageID(), diff --git a/wcfsetup/install/files/lib/system/package/plugin/AbstractPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/AbstractPackageInstallationPlugin.class.php index 08dc5aaab5..b76888ef2a 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/AbstractPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/AbstractPackageInstallationPlugin.class.php @@ -84,9 +84,9 @@ abstract class AbstractPackageInstallationPlugin implements IPackageInstallation EventHandler::getInstance()->fireAction($this, 'hasUninstall'); $sql = "SELECT COUNT(*) - FROM " . $this->application . WCF_N . "_" . $this->tableName . " + FROM " . $this->application . "1_" . $this->tableName . " WHERE packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->installation->getPackageID()]); return $statement->fetchSingleColumn() > 0; @@ -100,9 +100,9 @@ abstract class AbstractPackageInstallationPlugin implements IPackageInstallation // call 'uninstall' event EventHandler::getInstance()->fireAction($this, 'uninstall'); - $sql = "DELETE FROM " . $this->application . WCF_N . "_" . $this->tableName . " + $sql = "DELETE FROM " . $this->application . "1_" . $this->tableName . " WHERE packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->installation->getPackageID()]); } diff --git a/wcfsetup/install/files/lib/system/package/plugin/AbstractXMLPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/AbstractXMLPackageInstallationPlugin.class.php index ac3f9e6fbc..de846cc1df 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/AbstractXMLPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/AbstractXMLPackageInstallationPlugin.class.php @@ -176,7 +176,7 @@ abstract class AbstractXMLPackageInstallationPlugin extends AbstractPackageInsta if ($sqlData === null) { $row = false; } else { - $statement = WCF::getDB()->prepareStatement($sqlData['sql']); + $statement = WCF::getDB()->prepare($sqlData['sql']); $statement->execute($sqlData['parameters']); $row = $statement->fetchArray(); } @@ -435,20 +435,20 @@ abstract class AbstractXMLPackageInstallationPlugin extends AbstractPackageInsta } $sql = "SELECT MAX(showOrder) AS showOrder - FROM " . $this->application . WCF_N . "_" . $this->tableName . $tableNameExtension . " + FROM " . $this->application . "1_" . $this->tableName . $tableNameExtension . " " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $maxShowOrder = $statement->fetchArray(); return (!$maxShowOrder) ? 1 : ($maxShowOrder['showOrder'] + 1); } else { // increase all showOrder values which are >= $showOrder - $sql = "UPDATE " . $this->application . WCF_N . "_" . $this->tableName . $tableNameExtension . " + $sql = "UPDATE " . $this->application . "1_" . $this->tableName . $tableNameExtension . " SET showOrder = showOrder + 1 WHERE showOrder >= ? " . ($columnName !== null ? "AND " . $columnName . " = ?" : ""); - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $data = [$showOrder]; if ($columnName !== null) { diff --git a/wcfsetup/install/files/lib/system/package/plugin/BBCodePackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/BBCodePackageInstallationPlugin.class.php index 7784e1e904..1bc818e910 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/BBCodePackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/BBCodePackageInstallationPlugin.class.php @@ -69,10 +69,10 @@ class BBCodePackageInstallationPlugin extends AbstractXMLPackageInstallationPlug */ protected function handleDelete(array $items) { - $sql = "DELETE FROM wcf" . WCF_N . "_" . $this->tableName . " + $sql = "DELETE FROM wcf1_" . $this->tableName . " WHERE bbcodeTag = ? AND packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($items as $item) { $statement->execute([ $item['attributes']['name'], @@ -155,7 +155,7 @@ class BBCodePackageInstallationPlugin extends AbstractXMLPackageInstallationPlug { // check if bbcode tag already exists $sqlData = $this->findExistingItem($data); - $statement = WCF::getDB()->prepareStatement($sqlData['sql']); + $statement = WCF::getDB()->prepare($sqlData['sql']); $statement->execute($sqlData['parameters']); $row = $statement->fetchArray(); if ($row && $row['packageID'] != $this->installation->getPackageID()) { @@ -170,7 +170,7 @@ class BBCodePackageInstallationPlugin extends AbstractXMLPackageInstallationPlug protected function findExistingItem(array $data) { $sql = "SELECT * - FROM wcf" . WCF_N . "_" . $this->tableName . " + FROM wcf1_" . $this->tableName . " WHERE bbcodeTag = ?"; $parameters = [$data['bbcodeTag']]; diff --git a/wcfsetup/install/files/lib/system/package/plugin/BoxPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/BoxPackageInstallationPlugin.class.php index 35af138b62..c573bb1437 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/BoxPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/BoxPackageInstallationPlugin.class.php @@ -288,7 +288,7 @@ class BoxPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin protected function findExistingItem(array $data) { $sql = "SELECT * - FROM wcf" . WCF_N . "_box + FROM wcf1_box WHERE identifier = ? AND packageID = ?"; $parameters = [ diff --git a/wcfsetup/install/files/lib/system/package/plugin/ClipboardActionPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/ClipboardActionPackageInstallationPlugin.class.php index b97b4e8976..f04331bffe 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/ClipboardActionPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/ClipboardActionPackageInstallationPlugin.class.php @@ -53,11 +53,11 @@ class ClipboardActionPackageInstallationPlugin extends AbstractXMLPackageInstall */ protected function handleDelete(array $items) { - $sql = "DELETE FROM wcf" . WCF_N . "_" . $this->tableName . " + $sql = "DELETE FROM wcf1_" . $this->tableName . " WHERE actionName = ? AND actionClassName = ? AND packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($items as $item) { $statement->execute([ $item['attributes']['name'], @@ -109,7 +109,7 @@ class ClipboardActionPackageInstallationPlugin extends AbstractXMLPackageInstall protected function findExistingItem(array $data) { $sql = "SELECT * - FROM wcf" . WCF_N . "_" . $this->tableName . " + FROM wcf1_" . $this->tableName . " WHERE actionName = ? AND actionClassName = ? AND packageID = ?"; diff --git a/wcfsetup/install/files/lib/system/package/plugin/CoreObjectPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/CoreObjectPackageInstallationPlugin.class.php index 90c93a24b7..44fc8716c1 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/CoreObjectPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/CoreObjectPackageInstallationPlugin.class.php @@ -38,10 +38,10 @@ class CoreObjectPackageInstallationPlugin extends AbstractXMLPackageInstallation */ protected function handleDelete(array $items) { - $sql = "DELETE FROM wcf" . WCF_N . "_" . $this->tableName . " + $sql = "DELETE FROM wcf1_" . $this->tableName . " WHERE objectName = ? AND packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($items as $item) { $statement->execute([ $item['attributes']['name'], @@ -66,7 +66,7 @@ class CoreObjectPackageInstallationPlugin extends AbstractXMLPackageInstallation protected function findExistingItem(array $data) { $sql = "SELECT * - FROM wcf" . WCF_N . "_" . $this->tableName . " + FROM wcf1_" . $this->tableName . " WHERE objectName = ? AND packageID = ?"; $parameters = [ diff --git a/wcfsetup/install/files/lib/system/package/plugin/CronjobPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/CronjobPackageInstallationPlugin.class.php index 883ecefb95..9f14fb59d9 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/CronjobPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/CronjobPackageInstallationPlugin.class.php @@ -203,7 +203,7 @@ class CronjobPackageInstallationPlugin extends AbstractXMLPackageInstallationPlu protected function findExistingItem(array $data) { $sql = "SELECT * - FROM wcf" . WCF_N . "_" . $this->tableName . " + FROM wcf1_" . $this->tableName . " WHERE packageID = ? AND cronjobName = ?"; $parameters = [ diff --git a/wcfsetup/install/files/lib/system/package/plugin/EventListenerPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/EventListenerPackageInstallationPlugin.class.php index f8e9c24cd0..bb11cf7b8c 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/EventListenerPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/EventListenerPackageInstallationPlugin.class.php @@ -57,19 +57,19 @@ class EventListenerPackageInstallationPlugin extends AbstractXMLPackageInstallat */ protected function handleDelete(array $items) { - $sql = "DELETE FROM wcf" . WCF_N . "_" . $this->tableName . " + $sql = "DELETE FROM wcf1_" . $this->tableName . " WHERE packageID = ? AND environment = ? AND eventClassName = ? AND eventName = ? AND inherit = ? AND listenerClassName = ?"; - $legacyStatement = WCF::getDB()->prepareStatement($sql); + $legacyStatement = WCF::getDB()->prepare($sql); - $sql = "DELETE FROM wcf" . WCF_N . "_" . $this->tableName . " + $sql = "DELETE FROM wcf1_" . $this->tableName . " WHERE packageID = ? AND listenerName = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($items as $item) { if (!isset($item['attributes']['name'])) { @@ -126,7 +126,7 @@ class EventListenerPackageInstallationPlugin extends AbstractXMLPackageInstallat protected function findExistingItem(array $data) { $sql = "SELECT * - FROM wcf" . WCF_N . "_" . $this->tableName . " + FROM wcf1_" . $this->tableName . " WHERE packageID = ? AND listenerName = ?"; $parameters = [ diff --git a/wcfsetup/install/files/lib/system/package/plugin/LanguagePackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/LanguagePackageInstallationPlugin.class.php index 7bbd3780cd..6e068ff617 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/LanguagePackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/LanguagePackageInstallationPlugin.class.php @@ -199,10 +199,10 @@ class LanguagePackageInstallationPlugin extends AbstractXMLPackageInstallationPl } if (!empty($itemIDs)) { - $sql = "DELETE FROM wcf" . WCF_N . "_" . $this->tableName . " + $sql = "DELETE FROM wcf1_" . $this->tableName . " WHERE languageItemID = ? AND packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($itemIDs as $itemID) { $statement->execute([ diff --git a/wcfsetup/install/files/lib/system/package/plugin/MediaProviderPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/MediaProviderPackageInstallationPlugin.class.php index 3f80e3b6a4..7a4c79ef47 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/MediaProviderPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/MediaProviderPackageInstallationPlugin.class.php @@ -50,10 +50,10 @@ class MediaProviderPackageInstallationPlugin extends AbstractXMLPackageInstallat */ protected function handleDelete(array $items) { - $sql = "DELETE FROM wcf" . WCF_N . "_" . $this->tableName . " + $sql = "DELETE FROM wcf1_" . $this->tableName . " WHERE packageID = ? AND name = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($items as $item) { $statement->execute([ $this->installation->getPackageID(), @@ -90,7 +90,7 @@ class MediaProviderPackageInstallationPlugin extends AbstractXMLPackageInstallat protected function findExistingItem(array $data) { $sql = "SELECT * - FROM wcf" . WCF_N . "_" . $this->tableName . " + FROM wcf1_" . $this->tableName . " WHERE packageID = ? AND name = ?"; $parameters = [ diff --git a/wcfsetup/install/files/lib/system/package/plugin/MenuItemPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/MenuItemPackageInstallationPlugin.class.php index 696bd67b67..7046b775b3 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/MenuItemPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/MenuItemPackageInstallationPlugin.class.php @@ -223,7 +223,7 @@ class MenuItemPackageInstallationPlugin extends AbstractXMLPackageInstallationPl protected function findExistingItem(array $data) { $sql = "SELECT * - FROM wcf" . WCF_N . "_menu_item + FROM wcf1_menu_item WHERE identifier = ? AND packageID = ?"; $parameters = [ diff --git a/wcfsetup/install/files/lib/system/package/plugin/MenuPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/MenuPackageInstallationPlugin.class.php index 7a1983c237..e9cac64b09 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/MenuPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/MenuPackageInstallationPlugin.class.php @@ -203,7 +203,7 @@ class MenuPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin protected function findExistingItem(array $data) { $sql = "SELECT * - FROM wcf" . WCF_N . "_menu + FROM wcf1_menu WHERE identifier = ? AND packageID = ?"; $parameters = [ diff --git a/wcfsetup/install/files/lib/system/package/plugin/ObjectTypeDefinitionPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/ObjectTypeDefinitionPackageInstallationPlugin.class.php index deca5c8d82..5b9ff3de79 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/ObjectTypeDefinitionPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/ObjectTypeDefinitionPackageInstallationPlugin.class.php @@ -43,10 +43,10 @@ class ObjectTypeDefinitionPackageInstallationPlugin extends AbstractXMLPackageIn */ protected function handleDelete(array $items) { - $sql = "DELETE FROM wcf" . WCF_N . "_" . $this->tableName . " + $sql = "DELETE FROM wcf1_" . $this->tableName . " WHERE definitionName = ? AND packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($items as $item) { $statement->execute([ $item['attributes']['name'], @@ -81,7 +81,7 @@ class ObjectTypeDefinitionPackageInstallationPlugin extends AbstractXMLPackageIn protected function findExistingItem(array $data) { $sql = "SELECT * - FROM wcf" . WCF_N . "_" . $this->tableName . " + FROM wcf1_" . $this->tableName . " WHERE definitionName = ?"; $parameters = [$data['definitionName']]; diff --git a/wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php index 5a317de481..0a5b3cb995 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php @@ -113,11 +113,11 @@ class ObjectTypePackageInstallationPlugin extends AbstractXMLPackageInstallation */ protected function handleDelete(array $items) { - $sql = "DELETE FROM wcf" . WCF_N . "_" . $this->tableName . " + $sql = "DELETE FROM wcf1_" . $this->tableName . " WHERE objectType = ? AND definitionID = ? AND packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($items as $item) { $statement->execute([ $item['attributes']['name'], @@ -174,7 +174,7 @@ class ObjectTypePackageInstallationPlugin extends AbstractXMLPackageInstallation protected function findExistingItem(array $data) { $sql = "SELECT * - FROM wcf" . WCF_N . "_" . $this->tableName . " + FROM wcf1_" . $this->tableName . " WHERE objectType = ? AND definitionID = ? AND packageID = ?"; @@ -1113,7 +1113,7 @@ class ObjectTypePackageInstallationPlugin extends AbstractXMLPackageInstallation $className, UserIntegerPropertyCondition::class, $prefix . 'UserIntegerPropertyName', - 'wcf' . WCF_N . '_user' + 'wcf1_user' )->required() ); $this->definitionElementChildren[$objectTypeDefinition]['propertyname'] = ''; @@ -1124,7 +1124,7 @@ class ObjectTypePackageInstallationPlugin extends AbstractXMLPackageInstallation $className, UserTimestampPropertyCondition::class, $prefix . 'UserTimestampPropertyName', - 'wcf' . WCF_N . '_user' + 'wcf1_user' )->required() ); // already added above: diff --git a/wcfsetup/install/files/lib/system/package/plugin/OptionPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/OptionPackageInstallationPlugin.class.php index 6431a3b2b4..3bfcd467bb 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/OptionPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/OptionPackageInstallationPlugin.class.php @@ -141,9 +141,9 @@ class OptionPackageInstallationPlugin extends AbstractOptionPackageInstallationP // try to find an existing option for updating $sql = "SELECT * - FROM wcf" . WCF_N . "_" . $this->tableName . " + FROM wcf1_" . $this->tableName . " WHERE optionName = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $optionName, ]); diff --git a/wcfsetup/install/files/lib/system/package/plugin/PIPPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/PIPPackageInstallationPlugin.class.php index 8317ffda83..66b582f062 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/PIPPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/PIPPackageInstallationPlugin.class.php @@ -41,10 +41,10 @@ class PIPPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin */ protected function handleDelete(array $items) { - $sql = "DELETE FROM wcf" . WCF_N . "_" . $this->tableName . " + $sql = "DELETE FROM wcf1_" . $this->tableName . " WHERE pluginName = ? AND packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($items as $item) { $statement->execute([ $item['attributes']['name'], @@ -80,7 +80,7 @@ class PIPPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin protected function findExistingItem(array $data) { $sql = "SELECT * - FROM wcf" . WCF_N . "_" . $this->tableName . " + FROM wcf1_" . $this->tableName . " WHERE pluginName = ? AND packageID = ?"; $parameters = [ diff --git a/wcfsetup/install/files/lib/system/package/plugin/PagePackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/PagePackageInstallationPlugin.class.php index 1c9ab0554b..51faa10413 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/PagePackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/PagePackageInstallationPlugin.class.php @@ -172,9 +172,9 @@ class PagePackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin $parentPageID = null; if (!empty($data['elements']['parent'])) { $sql = "SELECT pageID - FROM wcf" . WCF_N . "_" . $this->tableName . " + FROM wcf1_" . $this->tableName . " WHERE identifier = ?"; - $statement = WCF::getDB()->prepareStatement($sql, 1); + $statement = WCF::getDB()->prepare($sql, 1); $statement->execute([$data['elements']['parent']]); $row = $statement->fetchSingleRow(); if ($row === false) { @@ -287,7 +287,7 @@ class PagePackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin protected function findExistingItem(array $data) { $sql = "SELECT * - FROM wcf" . WCF_N . "_" . $this->tableName . " + FROM wcf1_" . $this->tableName . " WHERE identifier = ? AND packageID = ?"; $parameters = [ diff --git a/wcfsetup/install/files/lib/system/package/plugin/SmileyPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/SmileyPackageInstallationPlugin.class.php index f73fbe406b..3c8253c21f 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/SmileyPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/SmileyPackageInstallationPlugin.class.php @@ -52,10 +52,10 @@ class SmileyPackageInstallationPlugin extends AbstractXMLPackageInstallationPlug */ protected function handleDelete(array $items) { - $sql = "DELETE FROM wcf" . WCF_N . "_" . $this->tableName . " + $sql = "DELETE FROM wcf1_" . $this->tableName . " WHERE smileyCode = ? AND packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($items as $item) { $statement->execute([ $item['attributes']['name'], @@ -95,7 +95,7 @@ class SmileyPackageInstallationPlugin extends AbstractXMLPackageInstallationPlug protected function findExistingItem(array $data) { $sql = "SELECT * - FROM wcf" . WCF_N . "_" . $this->tableName . " + FROM wcf1_" . $this->tableName . " WHERE smileyCode = ? AND packageID = ?"; $parameters = [ diff --git a/wcfsetup/install/files/lib/system/package/plugin/TemplateListenerPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/TemplateListenerPackageInstallationPlugin.class.php index f86e63fffc..2403fbd125 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/TemplateListenerPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/TemplateListenerPackageInstallationPlugin.class.php @@ -52,13 +52,13 @@ class TemplateListenerPackageInstallationPlugin extends AbstractXMLPackageInstal */ protected function handleDelete(array $items) { - $sql = "DELETE FROM wcf" . WCF_N . "_" . $this->tableName . " + $sql = "DELETE FROM wcf1_" . $this->tableName . " WHERE packageID = ? AND environment = ? AND eventName = ? AND name = ? AND templateName = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($items as $item) { $statement->execute([ $this->installation->getPackageID(), @@ -100,7 +100,7 @@ class TemplateListenerPackageInstallationPlugin extends AbstractXMLPackageInstal protected function findExistingItem(array $data) { $sql = "SELECT * - FROM wcf" . WCF_N . "_" . $this->tableName . " + FROM wcf1_" . $this->tableName . " WHERE packageID = ? AND name = ? AND templateName = ? diff --git a/wcfsetup/install/files/lib/system/package/plugin/UserGroupOptionPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/UserGroupOptionPackageInstallationPlugin.class.php index 7542e1a899..57f36d4618 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/UserGroupOptionPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/UserGroupOptionPackageInstallationPlugin.class.php @@ -207,10 +207,10 @@ class UserGroupOptionPackageInstallationPlugin extends AbstractOptionPackageInst } // save values - $sql = "INSERT INTO wcf" . WCF_N . "_user_group_option_value + $sql = "INSERT INTO wcf1_user_group_option_value (groupID, optionID, optionValue) VALUES (?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); foreach ($values as $groupID => $value) { $statement->execute([ diff --git a/wcfsetup/install/files/lib/system/package/plugin/UserNotificationEventPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/UserNotificationEventPackageInstallationPlugin.class.php index 2546bfc13c..c2390794b2 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/UserNotificationEventPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/UserNotificationEventPackageInstallationPlugin.class.php @@ -62,11 +62,11 @@ class UserNotificationEventPackageInstallationPlugin extends AbstractXMLPackageI */ protected function handleDelete(array $items) { - $sql = "DELETE FROM wcf" . WCF_N . "_" . $this->tableName . " + $sql = "DELETE FROM wcf1_" . $this->tableName . " WHERE packageID = ? AND objectTypeID = ? AND eventName = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($items as $item) { $statement->execute([ $this->installation->getPackageID(), @@ -139,7 +139,7 @@ class UserNotificationEventPackageInstallationPlugin extends AbstractXMLPackageI protected function findExistingItem(array $data) { $sql = "SELECT * - FROM wcf" . WCF_N . "_" . $this->tableName . " + FROM wcf1_" . $this->tableName . " WHERE objectTypeID = ? AND eventName = ?"; $parameters = [ diff --git a/wcfsetup/install/files/lib/system/package/plugin/UserOptionPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/UserOptionPackageInstallationPlugin.class.php index ad2893f987..e526aafaa0 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/UserOptionPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/UserOptionPackageInstallationPlugin.class.php @@ -182,10 +182,10 @@ class UserOptionPackageInstallationPlugin extends AbstractOptionPackageInstallat // get optionID if it was installed by this package already $sql = "SELECT * - FROM wcf" . WCF_N . "_" . $this->tableName . " + FROM wcf1_" . $this->tableName . " WHERE optionName = ? AND packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $optionName, $this->installation->getPackageID(), @@ -244,7 +244,7 @@ class UserOptionPackageInstallationPlugin extends AbstractOptionPackageInstallat $statement->execute([$this->installation->getPackageID()]); while ($row = $statement->fetchArray()) { WCF::getDB()->getEditor()->dropColumn( - 'wcf' . WCF_N . '_user_option_value', + 'wcf1_user_option_value', 'userOption' . $row['optionID'] ); } diff --git a/wcfsetup/install/files/lib/system/package/plugin/UserProfileMenuPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/UserProfileMenuPackageInstallationPlugin.class.php index 1224b77507..099d0a28d3 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/UserProfileMenuPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/UserProfileMenuPackageInstallationPlugin.class.php @@ -53,10 +53,10 @@ class UserProfileMenuPackageInstallationPlugin extends AbstractXMLPackageInstall */ protected function handleDelete(array $items) { - $sql = "DELETE FROM wcf" . WCF_N . "_" . $this->tableName . " + $sql = "DELETE FROM wcf1_" . $this->tableName . " WHERE menuItem = ? AND packageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($items as $item) { $statement->execute([ $item['attributes']['name'], @@ -98,7 +98,7 @@ class UserProfileMenuPackageInstallationPlugin extends AbstractXMLPackageInstall protected function findExistingItem(array $data) { $sql = "SELECT * - FROM wcf" . WCF_N . "_" . $this->tableName . " + FROM wcf1_" . $this->tableName . " WHERE menuItem = ? AND packageID = ?"; $parameters = [ diff --git a/wcfsetup/install/files/lib/system/page/handler/ArticlePageHandler.class.php b/wcfsetup/install/files/lib/system/page/handler/ArticlePageHandler.class.php index 170e6c0137..b8f5da81c6 100644 --- a/wcfsetup/install/files/lib/system/page/handler/ArticlePageHandler.class.php +++ b/wcfsetup/install/files/lib/system/page/handler/ArticlePageHandler.class.php @@ -55,7 +55,7 @@ class ArticlePageHandler extends AbstractLookupPageHandler implements IOnlineLoc $articleList = new ViewableArticleList(); $articleList->sqlSelects = "( SELECT title - FROM wcf" . WCF_N . "_article_content + FROM wcf1_article_content WHERE articleID = article.articleID AND ( languageID IS NULL @@ -66,7 +66,7 @@ class ArticlePageHandler extends AbstractLookupPageHandler implements IOnlineLoc $articleList->getConditionBuilder()->add( 'article.articleID IN ( SELECT articleID - FROM wcf' . WCF_N . '_article_content + FROM wcf1_article_content WHERE title LIKE ? )', ['%' . $searchString . '%'] diff --git a/wcfsetup/install/files/lib/system/page/handler/ContactFormPageHandler.class.php b/wcfsetup/install/files/lib/system/page/handler/ContactFormPageHandler.class.php index 178dbaf0a8..a4ed2b2e5c 100644 --- a/wcfsetup/install/files/lib/system/page/handler/ContactFormPageHandler.class.php +++ b/wcfsetup/install/files/lib/system/page/handler/ContactFormPageHandler.class.php @@ -21,10 +21,10 @@ class ContactFormPageHandler extends AbstractMenuPageHandler { $sql = "SELECT EXISTS( SELECT * - FROM wcf" . WCF_N . "_contact_recipient + FROM wcf1_contact_recipient WHERE isDisabled = ? )"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([0]); return $statement->fetchSingleColumn(); diff --git a/wcfsetup/install/files/lib/system/page/handler/TDecoratedCategoryLookupPageHandler.class.php b/wcfsetup/install/files/lib/system/page/handler/TDecoratedCategoryLookupPageHandler.class.php index 1d08a2a9dd..2ee2252b92 100644 --- a/wcfsetup/install/files/lib/system/page/handler/TDecoratedCategoryLookupPageHandler.class.php +++ b/wcfsetup/install/files/lib/system/page/handler/TDecoratedCategoryLookupPageHandler.class.php @@ -111,11 +111,11 @@ trait TDecoratedCategoryLookupPageHandler ['%' . $searchString . '%', '%' . $searchString . '%'] ); $sql = "SELECT DISTINCT categoryID - FROM wcf" . WCF_N . "_category category - LEFT JOIN wcf" . WCF_N . "_language_item language_item + FROM wcf1_category category + LEFT JOIN wcf1_language_item language_item ON language_item.languageItem = category.title " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql, 10); + $statement = WCF::getDB()->prepare($sql, 10); $statement->execute($conditionBuilder->getParameters()); $results = []; while ($categoryID = $statement->fetchColumn()) { diff --git a/wcfsetup/install/files/lib/system/page/handler/TrophyPageHandler.class.php b/wcfsetup/install/files/lib/system/page/handler/TrophyPageHandler.class.php index c90cbd846a..2c96f11e7b 100644 --- a/wcfsetup/install/files/lib/system/page/handler/TrophyPageHandler.class.php +++ b/wcfsetup/install/files/lib/system/page/handler/TrophyPageHandler.class.php @@ -50,7 +50,7 @@ class TrophyPageHandler extends AbstractLookupPageHandler $trophyList->sqlJoins .= ', '; } $trophyList->sqlJoins = " - LEFT JOIN wcf" . WCF_N . "_language_item language_item + LEFT JOIN wcf1_language_item language_item ON language_item.languageItem = trophy.title"; $trophyList->getConditionBuilder()->add( '(trophy.title LIKE ? OR language_item.languageItemValue LIKE ?)', diff --git a/wcfsetup/install/files/lib/system/poll/PollManager.class.php b/wcfsetup/install/files/lib/system/poll/PollManager.class.php index 2a01d020dd..3bb374dc1e 100644 --- a/wcfsetup/install/files/lib/system/poll/PollManager.class.php +++ b/wcfsetup/install/files/lib/system/poll/PollManager.class.php @@ -98,9 +98,9 @@ class PollManager extends SingletonFactory $conditions = new PreparedStatementConditionBuilder(); $conditions->add("pollID IN (?)", [$pollIDs]); - $sql = "DELETE FROM wcf" . WCF_N . "_poll + $sql = "DELETE FROM wcf1_poll " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); } @@ -146,10 +146,10 @@ class PollManager extends SingletonFactory // load poll options $sql = "SELECT optionID, optionValue - FROM wcf" . WCF_N . "_poll_option + FROM wcf1_poll_option WHERE pollID = ? ORDER BY showOrder ASC"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->poll->pollID]); while ($row = $statement->fetchArray()) { $this->pollOptions[] = $row; @@ -431,7 +431,7 @@ class PollManager extends SingletonFactory if (WCF::getUser()->userID) { $optionList->sqlSelects = "CASE WHEN poll_option_vote.optionID IS NULL THEN '0' ELSE '1' END AS voted"; $optionList->sqlJoins = " - LEFT JOIN wcf" . WCF_N . "_poll_option_vote poll_option_vote + LEFT JOIN wcf1_poll_option_vote poll_option_vote ON poll_option_vote.optionID = poll_option.optionID AND poll_option_vote.userID = " . WCF::getUser()->userID; } else { diff --git a/wcfsetup/install/files/lib/system/reaction/ReactionHandler.class.php b/wcfsetup/install/files/lib/system/reaction/ReactionHandler.class.php index b11da7a375..de28adc8f4 100644 --- a/wcfsetup/install/files/lib/system/reaction/ReactionHandler.class.php +++ b/wcfsetup/install/files/lib/system/reaction/ReactionHandler.class.php @@ -275,8 +275,8 @@ class ReactionHandler extends SingletonFactory $sql = "SELECT like_object.*, COALESCE(like_table.reactionTypeID, 0) AS reactionTypeID, COALESCE(like_table.likeValue, 0) AS liked - FROM wcf" . WCF_N . "_like_object like_object - LEFT JOIN wcf" . WCF_N . "_like like_table + FROM wcf1_like_object like_object + LEFT JOIN wcf1_like like_table ON like_table.objectTypeID = like_object.objectTypeID AND like_table.objectID = like_object.objectID AND like_table.userID = ? @@ -285,11 +285,11 @@ class ReactionHandler extends SingletonFactory \array_unshift($parameters, WCF::getUser()->userID); } else { $sql = "SELECT like_object.*, 0 AS liked - FROM wcf" . WCF_N . "_like_object like_object + FROM wcf1_like_object like_object " . $conditions; } - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($parameters); while ($row = $statement->fetchArray()) { $this->likeObjectCache[$objectType->objectTypeID][$row['objectID']] = new LikeObject(null, $row); @@ -770,13 +770,13 @@ class ReactionHandler extends SingletonFactory $sql = "SELECT like_object.likes, like_object.dislikes, like_object.cumulativeLikes, COALESCE(like_table.reactionTypeID, 0) AS reactionTypeID, COALESCE(like_table.likeValue, 0) AS liked - FROM wcf" . WCF_N . "_like_object like_object - LEFT JOIN wcf" . WCF_N . "_like like_table + FROM wcf1_like_object like_object + LEFT JOIN wcf1_like like_table ON like_table.objectTypeID = ? AND like_table.objectID = like_object.objectID AND like_table.userID = ? WHERE like_object.likeObjectID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $likeObject->objectTypeID, $user->userID, diff --git a/wcfsetup/install/files/lib/system/search/AbstractSearchIndexManager.class.php b/wcfsetup/install/files/lib/system/search/AbstractSearchIndexManager.class.php index 3aed7fa8d3..71adb13ea3 100644 --- a/wcfsetup/install/files/lib/system/search/AbstractSearchIndexManager.class.php +++ b/wcfsetup/install/files/lib/system/search/AbstractSearchIndexManager.class.php @@ -24,9 +24,9 @@ abstract class AbstractSearchIndexManager extends SingletonFactory implements IS { // get definition id $sql = "SELECT definitionID - FROM wcf" . WCF_N . "_object_type_definition + FROM wcf1_object_type_definition WHERE definitionName = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(['com.woltlab.wcf.searchableObjectType']); $row = $statement->fetchArray(); diff --git a/wcfsetup/install/files/lib/system/search/ArticleSearch.class.php b/wcfsetup/install/files/lib/system/search/ArticleSearch.class.php index 9699006c52..1d85da0188 100644 --- a/wcfsetup/install/files/lib/system/search/ArticleSearch.class.php +++ b/wcfsetup/install/files/lib/system/search/ArticleSearch.class.php @@ -57,7 +57,7 @@ class ArticleSearch extends AbstractSearchProvider */ public function getTableName(): string { - return 'wcf' . WCF_N . '_article_content'; + return 'wcf1_article_content'; } /** @@ -81,7 +81,7 @@ class ArticleSearch extends AbstractSearchProvider */ public function getUsernameFieldName(): string { - return 'wcf' . WCF_N . '_article.username'; + return 'wcf1_article.username'; } /** @@ -89,7 +89,7 @@ class ArticleSearch extends AbstractSearchProvider */ public function getTimeFieldName(): string { - return 'wcf' . WCF_N . '_article.time'; + return 'wcf1_article.time'; } /** @@ -114,7 +114,7 @@ class ArticleSearch extends AbstractSearchProvider $conditionBuilder->add('1=0'); } else { $conditionBuilder->add( - 'wcf' . WCF_N . '_article.categoryID IN (?) AND wcf' . WCF_N . '_article.publicationStatus = ?', + 'wcf1_article.categoryID IN (?) AND wcf1_article.publicationStatus = ?', [$articleCategoryIDs, Article::PUBLISHED] ); } @@ -144,8 +144,8 @@ class ArticleSearch extends AbstractSearchProvider public function getJoins(): string { return ' - INNER JOIN wcf' . WCF_N . '_article - ON wcf' . WCF_N . '_article.articleID = ' . $this->getTableName() . '.articleID'; + INNER JOIN wcf1_article + ON wcf1_article.articleID = ' . $this->getTableName() . '.articleID'; } /** diff --git a/wcfsetup/install/files/lib/system/search/PageSearch.class.php b/wcfsetup/install/files/lib/system/search/PageSearch.class.php index 326394c0a8..32ea886ecb 100644 --- a/wcfsetup/install/files/lib/system/search/PageSearch.class.php +++ b/wcfsetup/install/files/lib/system/search/PageSearch.class.php @@ -51,7 +51,7 @@ class PageSearch extends AbstractSearchProvider */ public function getTableName(): string { - return 'wcf' . WCF_N . '_page_content'; + return 'wcf1_page_content'; } /** @@ -83,7 +83,7 @@ class PageSearch extends AbstractSearchProvider */ public function getTimeFieldName(): string { - return 'wcf' . WCF_N . '_page_content.pageContentID'; + return 'wcf1_page_content.pageContentID'; } /** @@ -93,12 +93,12 @@ class PageSearch extends AbstractSearchProvider { $conditionBuilder = new PreparedStatementConditionBuilder(); $conditionBuilder->add( - 'wcf' . WCF_N . '_page.pageType IN (?) AND wcf' . WCF_N . '_page.isDisabled = ?', + 'wcf1_page.pageType IN (?) AND wcf1_page.isDisabled = ?', [['text', 'html'], 0] ); // Exclude versions of disabled languages. $conditionBuilder->add( - '(wcf' . WCF_N . '_page_content.languageID IS NULL OR wcf' . WCF_N . '_page_content.languageID IN (?))', + '(wcf1_page_content.languageID IS NULL OR wcf1_page_content.languageID IN (?))', [\array_keys(LanguageFactory::getInstance()->getLanguages())] ); $this->initAclCondition($conditionBuilder); @@ -111,24 +111,24 @@ class PageSearch extends AbstractSearchProvider $objectTypeID = ObjectTypeCache::getInstance() ->getObjectTypeIDByName('com.woltlab.wcf.acl.simple', 'com.woltlab.wcf.page'); $conditionBuilder->add('( - wcf' . WCF_N . '_page_content.pageID NOT IN ( + wcf1_page_content.pageID NOT IN ( SELECT objectID - FROM wcf' . WCF_N . '_acl_simple_to_group + FROM wcf1_acl_simple_to_group WHERE objectTypeID = ? UNION SELECT objectID - FROM wcf' . WCF_N . '_acl_simple_to_user + FROM wcf1_acl_simple_to_user WHERE objectTypeID = ? ) OR - wcf' . WCF_N . '_page_content.pageID IN ( + wcf1_page_content.pageID IN ( SELECT objectID - FROM wcf' . WCF_N . '_acl_simple_to_group + FROM wcf1_acl_simple_to_group WHERE objectTypeID = ? AND groupID IN (?) UNION SELECT objectID - FROM wcf' . WCF_N . '_acl_simple_to_user + FROM wcf1_acl_simple_to_user WHERE objectTypeID = ? AND userID = ? ) @@ -148,8 +148,8 @@ class PageSearch extends AbstractSearchProvider public function getJoins(): string { return ' - INNER JOIN wcf' . WCF_N . '_page - ON wcf' . WCF_N . '_page.pageID = ' . $this->getTableName() . '.pageID'; + INNER JOIN wcf1_page + ON wcf1_page.pageID = ' . $this->getTableName() . '.pageID'; } /** diff --git a/wcfsetup/install/files/lib/system/search/SearchHandler.class.php b/wcfsetup/install/files/lib/system/search/SearchHandler.class.php index bf52e0f655..31557569bf 100644 --- a/wcfsetup/install/files/lib/system/search/SearchHandler.class.php +++ b/wcfsetup/install/files/lib/system/search/SearchHandler.class.php @@ -326,9 +326,9 @@ final class SearchHandler } $sql = "SELECT searchID - FROM wcf" . WCF_N . "_search + FROM wcf1_search " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); if ($searchID = $statement->fetchSingleColumn()) { return new Search($searchID); diff --git a/wcfsetup/install/files/lib/system/search/SearchIndexManager.class.php b/wcfsetup/install/files/lib/system/search/SearchIndexManager.class.php index 3098e3ce59..5e59db6630 100644 --- a/wcfsetup/install/files/lib/system/search/SearchIndexManager.class.php +++ b/wcfsetup/install/files/lib/system/search/SearchIndexManager.class.php @@ -237,6 +237,6 @@ class SearchIndexManager extends SingletonFactory implements IContextAwareSearch } } - return 'wcf' . WCF_N . '_search_index_' . \substr(\sha1($objectType->objectType), 0, 8); + return 'wcf1_search_index_' . \substr(\sha1($objectType->objectType), 0, 8); } } diff --git a/wcfsetup/install/files/lib/system/search/acp/MenuItemACPSearchResultProvider.class.php b/wcfsetup/install/files/lib/system/search/acp/MenuItemACPSearchResultProvider.class.php index 7fc6cf1cbf..2e02c79661 100644 --- a/wcfsetup/install/files/lib/system/search/acp/MenuItemACPSearchResultProvider.class.php +++ b/wcfsetup/install/files/lib/system/search/acp/MenuItemACPSearchResultProvider.class.php @@ -41,10 +41,10 @@ class MenuItemACPSearchResultProvider extends AbstractACPSearchResultProvider im $conditions->add("languageItemValue LIKE ?", ['%' . $query . '%']); $sql = "SELECT languageItem, languageItemValue - FROM wcf" . WCF_N . "_language_item + FROM wcf1_language_item " . $conditions . " ORDER BY languageItemValue ASC"; - $statement = WCF::getDB()->prepareStatement($sql); // don't use a limit here + $statement = WCF::getDB()->prepare($sql); // don't use a limit here $statement->execute($conditions->getParameters()); $languageItems = $statement->fetchMap('languageItem', 'languageItemValue'); @@ -57,9 +57,9 @@ class MenuItemACPSearchResultProvider extends AbstractACPSearchResultProvider im $conditions->add("menuItemController <> ''"); $sql = "SELECT * - FROM wcf" . WCF_N . "_acp_menu_item + FROM wcf1_acp_menu_item " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); // don't use a limit here + $statement = WCF::getDB()->prepare($sql); // don't use a limit here $statement->execute($conditions->getParameters()); $menuItems = ACPMenu::getInstance()->menuItemList; diff --git a/wcfsetup/install/files/lib/system/search/acp/OptionACPSearchResultProvider.class.php b/wcfsetup/install/files/lib/system/search/acp/OptionACPSearchResultProvider.class.php index 0d488e201d..4fb0b2772b 100644 --- a/wcfsetup/install/files/lib/system/search/acp/OptionACPSearchResultProvider.class.php +++ b/wcfsetup/install/files/lib/system/search/acp/OptionACPSearchResultProvider.class.php @@ -42,10 +42,10 @@ class OptionACPSearchResultProvider extends AbstractCategorizedACPSearchResultPr $conditions->add("languageItemValue LIKE ?", ['%' . $query . '%']); $sql = "SELECT languageItem - FROM wcf" . WCF_N . "_language_item + FROM wcf1_language_item " . $conditions . " ORDER BY languageItemValue ASC"; - $statement = WCF::getDB()->prepareStatement($sql); // don't use a limit here + $statement = WCF::getDB()->prepare($sql); // don't use a limit here $statement->execute($conditions->getParameters()); $optionNames = $categoryNames = []; while ($languageItem = $statement->fetchColumn()) { @@ -75,9 +75,9 @@ class OptionACPSearchResultProvider extends AbstractCategorizedACPSearchResultPr } $sql = "SELECT optionName, categoryName, options, permissions, hidden - FROM wcf" . WCF_N . "_option + FROM wcf1_option " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); // don't use a limit here + $statement = WCF::getDB()->prepare($sql); // don't use a limit here $statement->execute($conditions->getParameters()); $optionCategories = OptionCacheBuilder::getInstance()->getData([], 'categories'); diff --git a/wcfsetup/install/files/lib/system/search/acp/PackageACPSearchResultProvider.class.php b/wcfsetup/install/files/lib/system/search/acp/PackageACPSearchResultProvider.class.php index a812e3f1d6..c0fa9db262 100644 --- a/wcfsetup/install/files/lib/system/search/acp/PackageACPSearchResultProvider.class.php +++ b/wcfsetup/install/files/lib/system/search/acp/PackageACPSearchResultProvider.class.php @@ -36,9 +36,9 @@ class PackageACPSearchResultProvider implements IACPSearchResultProvider $conditions->add("languageItemValue LIKE ?", ['%' . $query . '%']); $sql = "SELECT languageItem - FROM wcf" . WCF_N . "_language_item + FROM wcf1_language_item " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $packageIDs = []; @@ -52,11 +52,11 @@ class PackageACPSearchResultProvider implements IACPSearchResultProvider } $sql = "SELECT * - FROM wcf" . WCF_N . "_package + FROM wcf1_package WHERE packageName LIKE ? OR package LIKE ? " . (\count($conditions->getParameters()) ? "OR " . $conditions : ""); - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(\array_merge([ '%' . $query . '%', '%' . $query . '%', diff --git a/wcfsetup/install/files/lib/system/search/acp/TrophyACPSearchResultProvider.class.php b/wcfsetup/install/files/lib/system/search/acp/TrophyACPSearchResultProvider.class.php index fbf1b599e8..b6fd8dde81 100644 --- a/wcfsetup/install/files/lib/system/search/acp/TrophyACPSearchResultProvider.class.php +++ b/wcfsetup/install/files/lib/system/search/acp/TrophyACPSearchResultProvider.class.php @@ -34,9 +34,9 @@ class TrophyACPSearchResultProvider implements IACPSearchResultProvider $conditions->add("languageItemValue LIKE ?", ['%' . $query . '%']); $sql = "SELECT languageItem - FROM wcf" . WCF_N . "_language_item + FROM wcf1_language_item " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $trophyIDs = []; @@ -50,10 +50,10 @@ class TrophyACPSearchResultProvider implements IACPSearchResultProvider } $sql = "SELECT * - FROM wcf" . WCF_N . "_trophy + FROM wcf1_trophy WHERE title LIKE ? " . (!empty($conditions->getParameters()) ? "OR " . $conditions : ""); - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(\array_merge([ '%' . $query . '%', ], $conditions->getParameters())); diff --git a/wcfsetup/install/files/lib/system/search/acp/UserACPSearchResultProvider.class.php b/wcfsetup/install/files/lib/system/search/acp/UserACPSearchResultProvider.class.php index e3217dc4cf..98cf4f1378 100644 --- a/wcfsetup/install/files/lib/system/search/acp/UserACPSearchResultProvider.class.php +++ b/wcfsetup/install/files/lib/system/search/acp/UserACPSearchResultProvider.class.php @@ -34,9 +34,9 @@ class UserACPSearchResultProvider implements IACPSearchResultProvider } $sql = "SELECT * - FROM wcf" . WCF_N . "_user + FROM wcf1_user {$conditionBuilder}"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); $results = []; diff --git a/wcfsetup/install/files/lib/system/search/acp/UserGroupOptionACPSearchResultProvider.class.php b/wcfsetup/install/files/lib/system/search/acp/UserGroupOptionACPSearchResultProvider.class.php index dd46609a00..bd7e61b136 100644 --- a/wcfsetup/install/files/lib/system/search/acp/UserGroupOptionACPSearchResultProvider.class.php +++ b/wcfsetup/install/files/lib/system/search/acp/UserGroupOptionACPSearchResultProvider.class.php @@ -51,10 +51,10 @@ class UserGroupOptionACPSearchResultProvider extends AbstractCategorizedACPSearc $conditions->add("languageItemValue LIKE ?", ['%' . $query . '%']); $sql = "SELECT languageItem - FROM wcf" . WCF_N . "_language_item + FROM wcf1_language_item " . $conditions . " ORDER BY languageItemValue ASC"; - $statement = WCF::getDB()->prepareStatement($sql); // don't use a limit here + $statement = WCF::getDB()->prepare($sql); // don't use a limit here $statement->execute($conditions->getParameters()); $languageItems = []; while ($languageItem = $statement->fetchColumn()) { @@ -80,9 +80,9 @@ class UserGroupOptionACPSearchResultProvider extends AbstractCategorizedACPSearc } $sql = "SELECT optionID, optionName, categoryName, permissions, options - FROM wcf" . WCF_N . "_user_group_option + FROM wcf1_user_group_option " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); // don't use a limit here + $statement = WCF::getDB()->prepare($sql); // don't use a limit here $statement->execute($conditions->getParameters()); $optionCategories = UserGroupOptionCacheBuilder::getInstance()->getData([], 'categories'); diff --git a/wcfsetup/install/files/lib/system/search/mysql/MysqlSearchEngine.class.php b/wcfsetup/install/files/lib/system/search/mysql/MysqlSearchEngine.class.php index d267fc8cd3..6f90de03cd 100644 --- a/wcfsetup/install/files/lib/system/search/mysql/MysqlSearchEngine.class.php +++ b/wcfsetup/install/files/lib/system/search/mysql/MysqlSearchEngine.class.php @@ -117,7 +117,7 @@ class MysqlSearchEngine extends AbstractSearchEngine try { $messages = []; - $statement = WCF::getDB()->prepareStatement($sql, $limit); + $statement = WCF::getDB()->prepare($sql, $limit); $statement->execute($parameters); while ($row = $statement->fetchArray()) { $messages[] = [ @@ -565,7 +565,7 @@ class MysqlSearchEngine extends AbstractSearchEngine if (!isset($this->minTokenSize)) { try { $sql = "SELECT @@innodb_ft_min_token_size"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(); $this->minTokenSize = $statement->fetchSingleColumn(); } catch (DatabaseQueryExecutionException $e) { diff --git a/wcfsetup/install/files/lib/system/search/mysql/MysqlSearchIndexManager.class.php b/wcfsetup/install/files/lib/system/search/mysql/MysqlSearchIndexManager.class.php index 7bb605b967..005923260f 100644 --- a/wcfsetup/install/files/lib/system/search/mysql/MysqlSearchIndexManager.class.php +++ b/wcfsetup/install/files/lib/system/search/mysql/MysqlSearchIndexManager.class.php @@ -40,7 +40,7 @@ class MysqlSearchIndexManager extends AbstractSearchIndexManager $sql = "REPLACE INTO " . SearchIndexManager::getTableName($objectType) . " (objectID, subject, message, time, userID, username, languageID, metaData) VALUES (?, ?, ?, ?, ?, ?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$objectID, $subject, $message, $time, $userID, $username, $languageID, $metaData]); } @@ -62,7 +62,7 @@ class MysqlSearchIndexManager extends AbstractSearchIndexManager $sql = "DELETE FROM " . $tableName . " " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); } WCF::getDB()->commitTransaction(); @@ -76,7 +76,7 @@ class MysqlSearchIndexManager extends AbstractSearchIndexManager $this->createSearchIndex(SearchIndexManager::getInstance()->getObjectType($objectType)); $sql = "TRUNCATE TABLE " . SearchIndexManager::getTableName($objectType); - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(); } @@ -89,9 +89,9 @@ class MysqlSearchIndexManager extends AbstractSearchIndexManager // check if table already exists $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_package_installation_sql_log + FROM wcf1_package_installation_sql_log WHERE sqlTable = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$tableName]); if ($statement->fetchSingleColumn()) { @@ -133,14 +133,14 @@ class MysqlSearchIndexManager extends AbstractSearchIndexManager // add comment $sql = "ALTER TABLE " . $tableName . " COMMENT = 'Search index for " . $objectType->objectType . "'"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(); // log table - $sql = "INSERT INTO wcf" . WCF_N . "_package_installation_sql_log + $sql = "INSERT INTO wcf1_package_installation_sql_log (packageID, sqlTable) VALUES (?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $objectType->packageID, $tableName, diff --git a/wcfsetup/install/files/lib/system/sitemap/object/MultilingualPageSitemapObject.class.php b/wcfsetup/install/files/lib/system/sitemap/object/MultilingualPageSitemapObject.class.php index 0942d4874f..fd2ff0f590 100644 --- a/wcfsetup/install/files/lib/system/sitemap/object/MultilingualPageSitemapObject.class.php +++ b/wcfsetup/install/files/lib/system/sitemap/object/MultilingualPageSitemapObject.class.php @@ -38,10 +38,10 @@ class MultilingualPageSitemapObject extends AbstractSitemapObjectObjectType $pageList = parent::getObjectList(); $pageList->sqlConditionJoins = ' - LEFT JOIN wcf' . WCF_N . '_page page + LEFT JOIN wcf1_page page ON page_content.pageID = page.pageID'; $pageList->sqlJoins = ' - LEFT JOIN wcf' . WCF_N . '_page page + LEFT JOIN wcf1_page page ON page_content.pageID = page.pageID'; $pageList->getConditionBuilder()->add('page.isMultilingual = ?', [1]); $pageList->getConditionBuilder()->add('page.allowSpidersToIndex = ?', [1]); diff --git a/wcfsetup/install/files/lib/system/stat/AbstractCommentStatDailyHandler.class.php b/wcfsetup/install/files/lib/system/stat/AbstractCommentStatDailyHandler.class.php index 0b8e0e65d5..d14c8e6ec0 100644 --- a/wcfsetup/install/files/lib/system/stat/AbstractCommentStatDailyHandler.class.php +++ b/wcfsetup/install/files/lib/system/stat/AbstractCommentStatDailyHandler.class.php @@ -34,18 +34,18 @@ abstract class AbstractCommentStatDailyHandler extends AbstractStatDailyHandler $sql = "SELECT ( SELECT COUNT(*) - FROM wcf" . WCF_N . "_comment + FROM wcf1_comment WHERE objectTypeID = ? AND time BETWEEN ? AND ? ) + ( SELECT COUNT(*) - FROM wcf" . WCF_N . "_comment_response comment_response - LEFT JOIN wcf" . WCF_N . "_comment comment + FROM wcf1_comment_response comment_response + LEFT JOIN wcf1_comment comment ON comment.commentID = comment_response.commentID WHERE comment.objectTypeID = ? AND comment_response.time BETWEEN ? AND ? )"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $objectTypeID, $date, @@ -58,18 +58,18 @@ abstract class AbstractCommentStatDailyHandler extends AbstractStatDailyHandler $sql = "SELECT ( SELECT COUNT(*) - FROM wcf" . WCF_N . "_comment + FROM wcf1_comment WHERE objectTypeID = ? AND time < ? ) + ( SELECT COUNT(*) - FROM wcf" . WCF_N . "_comment_response comment_response - LEFT JOIN wcf" . WCF_N . "_comment comment + FROM wcf1_comment_response comment_response + LEFT JOIN wcf1_comment comment ON comment.commentID = comment_response.commentID WHERE comment.objectTypeID = ? AND comment_response.time < ? )"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $objectTypeID, $date + 86400, diff --git a/wcfsetup/install/files/lib/system/stat/AbstractDiskUsageStatDailyHandler.class.php b/wcfsetup/install/files/lib/system/stat/AbstractDiskUsageStatDailyHandler.class.php index b3847d1136..4a8ba738ce 100644 --- a/wcfsetup/install/files/lib/system/stat/AbstractDiskUsageStatDailyHandler.class.php +++ b/wcfsetup/install/files/lib/system/stat/AbstractDiskUsageStatDailyHandler.class.php @@ -34,7 +34,7 @@ abstract class AbstractDiskUsageStatDailyHandler extends AbstractStatDailyHandle $sql = "SELECT CEIL(SUM(" . $this->columnName . ") / 1000) FROM " . $tableName . " " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); return $statement->fetchSingleColumn(); @@ -53,7 +53,7 @@ abstract class AbstractDiskUsageStatDailyHandler extends AbstractStatDailyHandle $sql = "SELECT CEIL(SUM(" . $this->columnName . ") / 1000) FROM " . $tableName . " " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); return $statement->fetchSingleColumn(); diff --git a/wcfsetup/install/files/lib/system/stat/AbstractStatDailyHandler.class.php b/wcfsetup/install/files/lib/system/stat/AbstractStatDailyHandler.class.php index 73d03754b6..20fa2ae83a 100644 --- a/wcfsetup/install/files/lib/system/stat/AbstractStatDailyHandler.class.php +++ b/wcfsetup/install/files/lib/system/stat/AbstractStatDailyHandler.class.php @@ -32,7 +32,7 @@ abstract class AbstractStatDailyHandler implements IStatDailyHandler $sql = "SELECT COUNT(*) FROM " . $tableName . " " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); return $statement->fetchSingleColumn(); @@ -56,7 +56,7 @@ abstract class AbstractStatDailyHandler implements IStatDailyHandler $sql = "SELECT COUNT(*) FROM " . $tableName . " " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); return $statement->fetchSingleColumn(); diff --git a/wcfsetup/install/files/lib/system/stat/AttachmentDiskUsageStatDailyHandler.class.php b/wcfsetup/install/files/lib/system/stat/AttachmentDiskUsageStatDailyHandler.class.php index 85b6094f1c..572b3fe3e4 100644 --- a/wcfsetup/install/files/lib/system/stat/AttachmentDiskUsageStatDailyHandler.class.php +++ b/wcfsetup/install/files/lib/system/stat/AttachmentDiskUsageStatDailyHandler.class.php @@ -17,8 +17,8 @@ class AttachmentDiskUsageStatDailyHandler extends AbstractDiskUsageStatDailyHand public function getData($date) { return [ - 'counter' => $this->getCounter($date, 'wcf' . WCF_N . '_attachment', 'uploadTime'), - 'total' => $this->getTotal($date, 'wcf' . WCF_N . '_attachment', 'uploadTime'), + 'counter' => $this->getCounter($date, 'wcf1_attachment', 'uploadTime'), + 'total' => $this->getTotal($date, 'wcf1_attachment', 'uploadTime'), ]; } } diff --git a/wcfsetup/install/files/lib/system/stat/AttachmentStatDailyHandler.class.php b/wcfsetup/install/files/lib/system/stat/AttachmentStatDailyHandler.class.php index b7c62f4f82..6a9de60524 100644 --- a/wcfsetup/install/files/lib/system/stat/AttachmentStatDailyHandler.class.php +++ b/wcfsetup/install/files/lib/system/stat/AttachmentStatDailyHandler.class.php @@ -17,8 +17,8 @@ class AttachmentStatDailyHandler extends AbstractStatDailyHandler public function getData($date) { return [ - 'counter' => $this->getCounter($date, 'wcf' . WCF_N . '_attachment', 'uploadTime'), - 'total' => $this->getTotal($date, 'wcf' . WCF_N . '_attachment', 'uploadTime'), + 'counter' => $this->getCounter($date, 'wcf1_attachment', 'uploadTime'), + 'total' => $this->getTotal($date, 'wcf1_attachment', 'uploadTime'), ]; } } diff --git a/wcfsetup/install/files/lib/system/stat/LikeStatDailyHandler.class.php b/wcfsetup/install/files/lib/system/stat/LikeStatDailyHandler.class.php index 17e5556ec1..84671ee4cd 100644 --- a/wcfsetup/install/files/lib/system/stat/LikeStatDailyHandler.class.php +++ b/wcfsetup/install/files/lib/system/stat/LikeStatDailyHandler.class.php @@ -19,16 +19,16 @@ class LikeStatDailyHandler extends AbstractStatDailyHandler public function getData($date) { $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_like + FROM wcf1_like WHERE time BETWEEN ? AND ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$date, $date + 86399]); $counter = \intval($statement->fetchSingleColumn()); $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_like + FROM wcf1_like WHERE time < ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$date + 86400]); $total = \intval($statement->fetchSingleColumn()); diff --git a/wcfsetup/install/files/lib/system/stat/UserStatDailyHandler.class.php b/wcfsetup/install/files/lib/system/stat/UserStatDailyHandler.class.php index 76b51597a3..7b570b676b 100644 --- a/wcfsetup/install/files/lib/system/stat/UserStatDailyHandler.class.php +++ b/wcfsetup/install/files/lib/system/stat/UserStatDailyHandler.class.php @@ -17,8 +17,8 @@ class UserStatDailyHandler extends AbstractStatDailyHandler public function getData($date) { return [ - 'counter' => $this->getCounter($date, 'wcf' . WCF_N . '_user', 'registrationDate'), - 'total' => $this->getTotal($date, 'wcf' . WCF_N . '_user', 'registrationDate'), + 'counter' => $this->getCounter($date, 'wcf1_user', 'registrationDate'), + 'total' => $this->getTotal($date, 'wcf1_user', 'registrationDate'), ]; } } diff --git a/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php b/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php index 2f3f196f34..d7627a2bce 100644 --- a/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php +++ b/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php @@ -89,9 +89,9 @@ final class StyleCompiler extends SingletonFactory public static function getDefaultVariables(): array { $sql = "SELECT variable.variableName, variable.defaultValue - FROM wcf" . WCF_N . "_style_variable variable + FROM wcf1_style_variable variable ORDER BY variable.variableID ASC"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(); $variables = $statement->fetchMap('variableName', 'defaultValue'); @@ -219,11 +219,11 @@ final class StyleCompiler extends SingletonFactory // read stylesheets in dependency order $sql = "SELECT filename, application - FROM wcf" . WCF_N . "_package_installation_file_log + FROM wcf1_package_installation_file_log WHERE CONVERT(filename using utf8) REGEXP ? AND packageID <> ? ORDER BY packageID"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ '^style/([a-zA-Z0-9\-\.]+)\.scss', 1, @@ -425,9 +425,9 @@ final class StyleCompiler extends SingletonFactory // read default values $sql = "SELECT variableName, defaultValue, defaultValueDarkMode - FROM wcf" . WCF_N . "_style_variable + FROM wcf1_style_variable ORDER BY variableID ASC"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(); $variables = []; while ($row = $statement->fetchArray()) { diff --git a/wcfsetup/install/files/lib/system/tagging/TagEngine.class.php b/wcfsetup/install/files/lib/system/tagging/TagEngine.class.php index 8ecc18fd2d..8fbf68d8c2 100644 --- a/wcfsetup/install/files/lib/system/tagging/TagEngine.class.php +++ b/wcfsetup/install/files/lib/system/tagging/TagEngine.class.php @@ -41,13 +41,13 @@ class TagEngine extends SingletonFactory // remove tags prior to apply the new ones (prevents duplicate entries) if ($replace) { $sql = "DELETE tag_to_object - FROM wcf" . WCF_N . "_tag_to_object tag_to_object - INNER JOIN wcf" . WCF_N . "_tag tag + FROM wcf1_tag_to_object tag_to_object + INNER JOIN wcf1_tag tag ON tag.tagID = tag_to_object.tagID WHERE tag_to_object.objectTypeID = ? AND tag_to_object.objectID = ? AND tag.languageID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $objectTypeID, $objectID, @@ -91,11 +91,11 @@ class TagEngine extends SingletonFactory } // save tags - $sql = "INSERT INTO wcf" . WCF_N . "_tag_to_object + $sql = "INSERT INTO wcf1_tag_to_object (objectID, tagID, objectTypeID, languageID) VALUES (?, ?, ?, ?)"; WCF::getDB()->beginTransaction(); - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($tagIDs as $tagID) { $statement->execute([$objectID, $tagID, $objectTypeID, $languageID]); } @@ -114,13 +114,13 @@ class TagEngine extends SingletonFactory $objectTypeID = $this->getObjectTypeID($objectType); $sql = "DELETE tag_to_object - FROM wcf" . WCF_N . "_tag_to_object tag_to_object - INNER JOIN wcf" . WCF_N . "_tag tag + FROM wcf1_tag_to_object tag_to_object + INNER JOIN wcf1_tag tag ON tag.tagID = tag_to_object.tagID WHERE tag_to_object.objectTypeID = ? AND tag_to_object.objectID = ? " . ($languageID !== null ? "AND tag.languageID = ?" : ""); - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $parameters = [ $objectTypeID, $objectID, @@ -145,9 +145,9 @@ class TagEngine extends SingletonFactory $conditionsBuilder->add('objectTypeID = ?', [$objectTypeID]); $conditionsBuilder->add('objectID IN (?)', [$objectIDs]); - $sql = "DELETE FROM wcf" . WCF_N . "_tag_to_object + $sql = "DELETE FROM wcf1_tag_to_object " . $conditionsBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionsBuilder->getParameters()); } @@ -202,11 +202,11 @@ class TagEngine extends SingletonFactory } $sql = "SELECT tag.*, tag_to_object.objectID - FROM wcf" . WCF_N . "_tag_to_object tag_to_object - LEFT JOIN wcf" . WCF_N . "_tag tag + FROM wcf1_tag_to_object tag_to_object + LEFT JOIN wcf1_tag tag ON tag.tagID = tag_to_object.tagID " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $tags = []; @@ -303,7 +303,7 @@ class TagEngine extends SingletonFactory $parameters[] = \count($tags); $sql = "SELECT objectID - FROM wcf" . WCF_N . "_tag_to_object + FROM wcf1_tag_to_object WHERE objectTypeID = ? AND tagID IN (" . $tagIDs . ") GROUP BY objectID diff --git a/wcfsetup/install/files/lib/system/template/EmailTemplateEngine.class.php b/wcfsetup/install/files/lib/system/template/EmailTemplateEngine.class.php index 0e6ff4b680..0aeab6e3fc 100644 --- a/wcfsetup/install/files/lib/system/template/EmailTemplateEngine.class.php +++ b/wcfsetup/install/files/lib/system/template/EmailTemplateEngine.class.php @@ -27,9 +27,9 @@ class EmailTemplateEngine extends TemplateEngine if (!$initialized) { $sql = "SELECT templateGroupID - FROM wcf" . WCF_N . "_template_group + FROM wcf1_template_group WHERE templateGroupFolderName = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(['_wcf_email/']); parent::setTemplateGroupID($statement->fetchSingleColumn()); diff --git a/wcfsetup/install/files/lib/system/trophy/condition/TrophyConditionHandler.class.php b/wcfsetup/install/files/lib/system/trophy/condition/TrophyConditionHandler.class.php index 3c9c900bd1..00d743d5df 100644 --- a/wcfsetup/install/files/lib/system/trophy/condition/TrophyConditionHandler.class.php +++ b/wcfsetup/install/files/lib/system/trophy/condition/TrophyConditionHandler.class.php @@ -134,7 +134,7 @@ class TrophyConditionHandler extends SingletonFactory { $userList = new UserList(); $userList->sqlConditionJoins .= " - LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value + LEFT JOIN wcf1_user_option_value user_option_value ON user_option_value.userID = user_table.userID"; $conditions = $trophy->getConditions(); @@ -146,7 +146,7 @@ class TrophyConditionHandler extends SingletonFactory $userList->getConditionBuilder()->add( 'user_table.userID NOT IN ( SELECT userID - FROM wcf' . WCF_N . '_user_trophy + FROM wcf1_user_trophy WHERE trophyID IN (?) )', [$trophy->trophyID] @@ -199,7 +199,7 @@ class TrophyConditionHandler extends SingletonFactory // We joining the user_trophy table to receive the userTrophyID, which should be deleted. $userList->sqlJoins .= " - LEFT JOIN wcf" . WCF_N . "_user_trophy user_trophy + LEFT JOIN wcf1_user_trophy user_trophy ON user_table.userID = user_trophy.userID"; // We do not need the complete user object, but only the userTrophyID. @@ -221,7 +221,7 @@ class TrophyConditionHandler extends SingletonFactory $userList->getConditionBuilder()->add( 'user_table.userID IN ( SELECT userID - FROM wcf' . WCF_N . '_user_trophy + FROM wcf1_user_trophy WHERE trophyID IN (?) )', [$trophy->trophyID] diff --git a/wcfsetup/install/files/lib/system/user/activity/event/ArticleCommentResponseUserActivityEvent.class.php b/wcfsetup/install/files/lib/system/user/activity/event/ArticleCommentResponseUserActivityEvent.class.php index e4ee8fdb06..08a88a2896 100644 --- a/wcfsetup/install/files/lib/system/user/activity/event/ArticleCommentResponseUserActivityEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/activity/event/ArticleCommentResponseUserActivityEvent.class.php @@ -37,7 +37,7 @@ class ArticleCommentResponseUserActivityEvent extends SingletonFactory implement $articleList->getConditionBuilder()->add( "article.articleID IN ( SELECT articleID - FROM wcf" . WCF_N . "_article_content + FROM wcf1_article_content WHERE articleContentID IN (?) )", [$this->commentObjectIDs] diff --git a/wcfsetup/install/files/lib/system/user/activity/event/ArticleCommentUserActivityEvent.class.php b/wcfsetup/install/files/lib/system/user/activity/event/ArticleCommentUserActivityEvent.class.php index 72bff7bbd0..dd30c15aac 100644 --- a/wcfsetup/install/files/lib/system/user/activity/event/ArticleCommentUserActivityEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/activity/event/ArticleCommentUserActivityEvent.class.php @@ -47,7 +47,7 @@ class ArticleCommentUserActivityEvent extends SingletonFactory implements IUserA $articleList->getConditionBuilder()->add( "article.articleID IN ( SELECT articleID - FROM wcf" . WCF_N . "_article_content + FROM wcf1_article_content WHERE articleContentID IN (?) )", [$articleContentIDs] diff --git a/wcfsetup/install/files/lib/system/user/activity/event/UserActivityEventHandler.class.php b/wcfsetup/install/files/lib/system/user/activity/event/UserActivityEventHandler.class.php index 1b8fb10595..e9c3e8f3e1 100644 --- a/wcfsetup/install/files/lib/system/user/activity/event/UserActivityEventHandler.class.php +++ b/wcfsetup/install/files/lib/system/user/activity/event/UserActivityEventHandler.class.php @@ -140,10 +140,10 @@ class UserActivityEventHandler extends SingletonFactory ]); } - $sql = "INSERT INTO wcf" . WCF_N . "_user_activity_event + $sql = "INSERT INTO wcf1_user_activity_event (objectTypeID, objectID, languageID, userID, time, additionalData) VALUES (?, ?, ?, ?, ?, ?)" . \str_repeat(', (?, ?, ?, ?, ?, ?)', \count($batchEventData) - 1); - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($parameters); } WCF::getDB()->commitTransaction(); @@ -168,11 +168,11 @@ class UserActivityEventHandler extends SingletonFactory $userID = WCF::getUser()->userID; } - $sql = "DELETE FROM wcf" . WCF_N . "_user_activity_event + $sql = "DELETE FROM wcf1_user_activity_event WHERE objectTypeID = ? AND objectID = ? AND userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $objectTypeID, $objectID, @@ -202,9 +202,9 @@ class UserActivityEventHandler extends SingletonFactory $conditions->add("objectTypeID = ?", [$objectTypeID]); $conditions->add("objectID IN (?)", [$objectIDs]); - $sql = "DELETE FROM wcf" . WCF_N . "_user_activity_event + $sql = "DELETE FROM wcf1_user_activity_event " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); } @@ -219,9 +219,9 @@ class UserActivityEventHandler extends SingletonFactory // remove orphaned event ids if (!empty($eventIDs)) { - $sql = "DELETE FROM wcf" . WCF_N . "_user_activity_event + $sql = "DELETE FROM wcf1_user_activity_event WHERE eventID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($eventIDs as $eventID) { $statement->execute([$eventID]); diff --git a/wcfsetup/install/files/lib/system/user/activity/point/UserActivityPointHandler.class.php b/wcfsetup/install/files/lib/system/user/activity/point/UserActivityPointHandler.class.php index 716f9251c5..a70c8229a8 100644 --- a/wcfsetup/install/files/lib/system/user/activity/point/UserActivityPointHandler.class.php +++ b/wcfsetup/install/files/lib/system/user/activity/point/UserActivityPointHandler.class.php @@ -70,22 +70,22 @@ class UserActivityPointHandler extends SingletonFactory } // update user_activity_point - $sql = "INSERT INTO wcf" . WCF_N . "_user_activity_point + $sql = "INSERT INTO wcf1_user_activity_point (userID, objectTypeID, activityPoints, items) VALUES (?, ?, ?, 1) ON DUPLICATE KEY UPDATE activityPoints = activityPoints + VALUES(activityPoints), items = items + 1"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $userID, $objectTypeObj->objectTypeID, $objectTypeObj->points, ]); - $sql = "UPDATE wcf" . WCF_N . "_user + $sql = "UPDATE wcf1_user SET activityPoints = activityPoints + ? WHERE userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $objectTypeObj->points, $userID, @@ -142,12 +142,12 @@ class UserActivityPointHandler extends SingletonFactory $userIDs[] = $userID; } - $sql = "INSERT INTO wcf" . WCF_N . "_user_activity_point + $sql = "INSERT INTO wcf1_user_activity_point (userID, objectTypeID, activityPoints, items) VALUES " . $values . " ON DUPLICATE KEY UPDATE activityPoints = activityPoints + VALUES(activityPoints), items = items + VALUES(items)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($parameters); // update activity points for given user ids @@ -180,12 +180,12 @@ class UserActivityPointHandler extends SingletonFactory } // remove activity points - $sql = "UPDATE wcf" . WCF_N . "_user_activity_point + $sql = "UPDATE wcf1_user_activity_point SET activityPoints = activityPoints - ?, items = items - ? WHERE objectTypeID = ? AND userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($userToItems as $userID => $items) { $statement->execute([ $items * $objectTypeObj->points, @@ -211,15 +211,15 @@ class UserActivityPointHandler extends SingletonFactory $conditions = new PreparedStatementConditionBuilder(); $conditions->add("userID IN (?)", [$userIDs]); - $sql = "UPDATE wcf" . WCF_N . "_user user_table + $sql = "UPDATE wcf1_user user_table SET activityPoints = COALESCE(( SELECT SUM(activityPoints) AS activityPoints - FROM wcf" . WCF_N . "_user_activity_point + FROM wcf1_user_activity_point WHERE userID = user_table.userID GROUP BY userID ), 0) " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); // update user ranks @@ -240,11 +240,11 @@ class UserActivityPointHandler extends SingletonFactory throw new InvalidObjectTypeException($objectType, 'com.woltlab.wcf.user.activityPointEvent'); } - $sql = "UPDATE wcf" . WCF_N . "_user_activity_point + $sql = "UPDATE wcf1_user_activity_point SET activityPoints = 0, items = 0 WHERE objectTypeID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$objectTypeObj->objectTypeID]); } diff --git a/wcfsetup/install/files/lib/system/user/collapsible/content/UserCollapsibleContentHandler.class.php b/wcfsetup/install/files/lib/system/user/collapsible/content/UserCollapsibleContentHandler.class.php index 4c76bcac7f..70bdf0c1ed 100644 --- a/wcfsetup/install/files/lib/system/user/collapsible/content/UserCollapsibleContentHandler.class.php +++ b/wcfsetup/install/files/lib/system/user/collapsible/content/UserCollapsibleContentHandler.class.php @@ -94,10 +94,10 @@ class UserCollapsibleContentHandler extends SingletonFactory // cache does not exist or is outdated if ($data === null) { $sql = "SELECT objectID - FROM wcf" . WCF_N . "_user_collapsible_content + FROM wcf1_user_collapsible_content WHERE objectTypeID = ? AND userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $objectTypeID, WCF::getUser()->userID, @@ -137,11 +137,11 @@ class UserCollapsibleContentHandler extends SingletonFactory if ($userID) { $sql = "SELECT * - FROM wcf" . WCF_N . "_user_collapsible_content + FROM wcf1_user_collapsible_content WHERE objectTypeID = ? AND objectID = ? AND userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $objectTypeID, $objectID, @@ -150,10 +150,10 @@ class UserCollapsibleContentHandler extends SingletonFactory $row = $statement->fetchArray(); if (!$row) { - $sql = "INSERT INTO wcf" . WCF_N . "_user_collapsible_content + $sql = "INSERT INTO wcf1_user_collapsible_content (objectTypeID, objectID, userID) VALUES (?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $objectTypeID, $objectID, @@ -188,11 +188,11 @@ class UserCollapsibleContentHandler extends SingletonFactory } if ($userID) { - $sql = "DELETE FROM wcf" . WCF_N . "_user_collapsible_content + $sql = "DELETE FROM wcf1_user_collapsible_content WHERE objectTypeID = ? AND objectID = ? AND userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $objectTypeID, $objectID, @@ -227,10 +227,10 @@ class UserCollapsibleContentHandler extends SingletonFactory public function reset($objectTypeID) { if (WCF::getUser()->userID) { - $sql = "DELETE FROM wcf" . WCF_N . "_user_collapsible_content + $sql = "DELETE FROM wcf1_user_collapsible_content WHERE objectTypeID = ? AND userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $objectTypeID, WCF::getUser()->userID, @@ -273,9 +273,9 @@ class UserCollapsibleContentHandler extends SingletonFactory $conditionBuilder->add('objectID = ?', [$objectID]); } - $sql = "DELETE FROM wcf" . WCF_N . "_user_collapsible_content + $sql = "DELETE FROM wcf1_user_collapsible_content " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); UserStorageHandler::getInstance()->resetAll('collapsedContent-' . $objectTypeID); diff --git a/wcfsetup/install/files/lib/system/user/command/CreateRegistrationNotification.class.php b/wcfsetup/install/files/lib/system/user/command/CreateRegistrationNotification.class.php index b3798162bf..9e26d9c0f9 100644 --- a/wcfsetup/install/files/lib/system/user/command/CreateRegistrationNotification.class.php +++ b/wcfsetup/install/files/lib/system/user/command/CreateRegistrationNotification.class.php @@ -55,7 +55,7 @@ final class CreateRegistrationNotification ) AND optionValue = ? )"; - $statement = WCF::getDB()->prepareStatement($sql, 100); + $statement = WCF::getDB()->prepare($sql, 100); $statement->execute([ 'admin.user.canSearchUser', 1, diff --git a/wcfsetup/install/files/lib/system/user/group/assignment/UserGroupAssignmentHandler.class.php b/wcfsetup/install/files/lib/system/user/group/assignment/UserGroupAssignmentHandler.class.php index 9ef9bd7c9c..724467a870 100644 --- a/wcfsetup/install/files/lib/system/user/group/assignment/UserGroupAssignmentHandler.class.php +++ b/wcfsetup/install/files/lib/system/user/group/assignment/UserGroupAssignmentHandler.class.php @@ -106,7 +106,7 @@ class UserGroupAssignmentHandler extends SingletonFactory $userList->getConditionBuilder()->add( 'user_table.userID NOT IN ( SELECT userID - FROM wcf' . WCF_N . '_user_to_group + FROM wcf1_user_to_group WHERE groupID = ? )', [$assignment->groupID] diff --git a/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php b/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php index 95b5fe5bbc..0758b4871d 100644 --- a/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php @@ -154,9 +154,9 @@ class UserNotificationHandler extends SingletonFactory $conditions->add("confirmTime = ?", [0]); $sql = "SELECT notificationID, userID - FROM wcf" . WCF_N . "_user_notification + FROM wcf1_user_notification " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $notifications = $statement->fetchMap('userID', 'notificationID'); @@ -171,9 +171,9 @@ class UserNotificationHandler extends SingletonFactory } $sql = "SELECT notificationID - FROM wcf" . WCF_N . "_user_notification_author + FROM wcf1_user_notification_author " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $notificationIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); @@ -187,11 +187,11 @@ class UserNotificationHandler extends SingletonFactory if (!empty($notificationIDs)) { // update trigger count - $sql = "UPDATE wcf" . WCF_N . "_user_notification + $sql = "UPDATE wcf1_user_notification SET timesTriggered = timesTriggered + ?, guestTimesTriggered = guestTimesTriggered + ? WHERE notificationID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); foreach ($notificationIDs as $notificationID) { @@ -225,9 +225,9 @@ class UserNotificationHandler extends SingletonFactory $conditions->add("ignoreUserID = ?", [$userProfile->getUserID()]); $sql = "SELECT userID - FROM wcf" . WCF_N . "_user_ignore + FROM wcf1_user_ignore " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $userIDs = []; while ($userID = $statement->fetchColumn()) { @@ -354,10 +354,10 @@ class UserNotificationHandler extends SingletonFactory // cache does not exist or is outdated if ($data === null || $skipCache) { $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_user_notification + FROM wcf1_user_notification WHERE userID = ? AND confirmTime = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ WCF::getUser()->userID, 0, @@ -388,9 +388,9 @@ class UserNotificationHandler extends SingletonFactory public function countAllNotifications() { $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_user_notification + FROM wcf1_user_notification WHERE userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([WCF::getUser()->userID]); return $statement->fetchSingleColumn(); @@ -464,14 +464,14 @@ class UserNotificationHandler extends SingletonFactory } $sql = "SELECT notification.*, notification_event.eventID, object_type.objectType - FROM wcf" . WCF_N . "_user_notification notification - LEFT JOIN wcf" . WCF_N . "_user_notification_event notification_event + FROM wcf1_user_notification notification + LEFT JOIN wcf1_user_notification_event notification_event ON notification_event.eventID = notification.eventID - LEFT JOIN wcf" . WCF_N . "_object_type object_type + LEFT JOIN wcf1_object_type object_type ON object_type.objectTypeID = notification_event.objectTypeID " . $conditions . " ORDER BY notification.time DESC"; - $statement = WCF::getDB()->prepareStatement($sql, $limit, $offset); + $statement = WCF::getDB()->prepare($sql, $limit, $offset); $statement->execute($conditions->getParameters()); return $statement->fetchObjects(UserNotification::class, 'notificationID'); @@ -513,10 +513,10 @@ class UserNotificationHandler extends SingletonFactory $conditions = new PreparedStatementConditionBuilder(); $conditions->add("notificationID IN (?)", [$notificationIDs]); $sql = "SELECT notificationID, authorID - FROM wcf" . WCF_N . "_user_notification_author + FROM wcf1_user_notification_author " . $conditions . " ORDER BY time ASC"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $authorIDs = $authorToNotification = []; while ($row = $statement->fetchArray()) { @@ -682,9 +682,9 @@ class UserNotificationHandler extends SingletonFactory } $sql = "SELECT notificationID - FROM wcf" . WCF_N . "_user_notification + FROM wcf1_user_notification " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $row = $statement->fetchArray(); @@ -876,9 +876,9 @@ class UserNotificationHandler extends SingletonFactory // get event ids $sql = "SELECT eventID - FROM wcf" . WCF_N . "_user_notification_event + FROM wcf1_user_notification_event WHERE objectTypeID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $objectTypeObj->objectTypeID, ]); @@ -890,9 +890,9 @@ class UserNotificationHandler extends SingletonFactory $conditions->add("objectID IN (?)", [$objectIDs]); $sql = "SELECT userID - FROM wcf" . WCF_N . "_user_notification + FROM wcf1_user_notification " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); @@ -910,9 +910,9 @@ class UserNotificationHandler extends SingletonFactory EventHandler::getInstance()->fireAction($this, 'removeNotifications', $parameters); // delete notifications - $sql = "DELETE FROM wcf" . WCF_N . "_user_notification + $sql = "DELETE FROM wcf1_user_notification " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); } } @@ -947,10 +947,10 @@ class UserNotificationHandler extends SingletonFactory $conditions->add("objectID IN (?)", [$objectIDs]); } - $sql = "UPDATE wcf" . WCF_N . "_user_notification + $sql = "UPDATE wcf1_user_notification SET confirmTime = ? " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $parameters = $conditions->getParameters(); \array_unshift($parameters, TIME_NOW); $statement->execute($parameters); @@ -1002,10 +1002,10 @@ class UserNotificationHandler extends SingletonFactory $conditions->add("confirmTime = ?", [0]); // mark notifications as confirmed - $sql = "UPDATE wcf" . WCF_N . "_user_notification + $sql = "UPDATE wcf1_user_notification SET confirmTime = ? " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $parameters = $conditions->getParameters(); \array_unshift($parameters, TIME_NOW); $statement->execute($parameters); @@ -1034,10 +1034,10 @@ class UserNotificationHandler extends SingletonFactory // get setting $sql = "SELECT mailNotificationType - FROM wcf" . WCF_N . "_user_notification_event_to_user + FROM wcf1_user_notification_event_to_user WHERE eventID = ? AND userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$event->eventID, WCF::getUser()->userID]); $row = $statement->fetchArray(); if ($row === false) { diff --git a/wcfsetup/install/files/lib/system/user/notification/event/TReactionUserNotificationEvent.class.php b/wcfsetup/install/files/lib/system/user/notification/event/TReactionUserNotificationEvent.class.php index 63a9ee8c3f..e8ef532043 100644 --- a/wcfsetup/install/files/lib/system/user/notification/event/TReactionUserNotificationEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/event/TReactionUserNotificationEvent.class.php @@ -40,14 +40,14 @@ trait TReactionUserNotificationEvent $conditionBuilder->add('like_table_join.likeID = ?', [$this->getUserNotificationObject()->getObjectID()]); $sql = "SELECT like_table.reactionTypeID, COUNT(like_table.reactionTypeID) as count - FROM wcf" . WCF_N . "_like like_table - LEFT JOIN wcf" . WCF_N . "_like like_table_join + FROM wcf1_like like_table + LEFT JOIN wcf1_like like_table_join ON like_table_join.objectTypeID = like_table.objectTypeID AND like_table_join.objectID = like_table.objectID " . $conditionBuilder . " GROUP BY like_table.reactionTypeID"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); $this->cachedReactions = $statement->fetchMap('reactionTypeID', 'count'); diff --git a/wcfsetup/install/files/lib/system/user/notification/event/TTestableModerationQueueUserNotificationEvent.class.php b/wcfsetup/install/files/lib/system/user/notification/event/TTestableModerationQueueUserNotificationEvent.class.php index 41e2b91d15..964b6558d5 100644 --- a/wcfsetup/install/files/lib/system/user/notification/event/TTestableModerationQueueUserNotificationEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/event/TTestableModerationQueueUserNotificationEvent.class.php @@ -43,10 +43,10 @@ trait TTestableModerationQueueUserNotificationEvent WCF::getSession()->changeUser($originalUser, true); $sql = "SELECT * - FROM wcf" . WCF_N . "_moderation_queue + FROM wcf1_moderation_queue WHERE objectTypeID = ? AND objectID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$objectTypeID, $reportedUser->userID]); $moderationQueue = $statement->fetchObject(ModerationQueue::class); diff --git a/wcfsetup/install/files/lib/system/user/notification/object/type/TMultiRecipientModerationQueueCommentUserNotificationObjectType.class.php b/wcfsetup/install/files/lib/system/user/notification/object/type/TMultiRecipientModerationQueueCommentUserNotificationObjectType.class.php index dcf4bff469..0cf59285e5 100644 --- a/wcfsetup/install/files/lib/system/user/notification/object/type/TMultiRecipientModerationQueueCommentUserNotificationObjectType.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/object/type/TMultiRecipientModerationQueueCommentUserNotificationObjectType.class.php @@ -42,9 +42,9 @@ trait TMultiRecipientModerationQueueCommentUserNotificationObjectType $conditionBuilder->add('queueID = ?', [$comment->objectID]); $conditionBuilder->add('isAffected = ?', [1]); $sql = "SELECT userID - FROM wcf" . WCF_N . "_moderation_queue_to_user + FROM wcf1_moderation_queue_to_user " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); $recipientIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); diff --git a/wcfsetup/install/files/lib/system/user/notification/object/type/TMultiRecipientPageCommentUserNotificationObjectType.class.php b/wcfsetup/install/files/lib/system/user/notification/object/type/TMultiRecipientPageCommentUserNotificationObjectType.class.php index c401abfe92..5f8e612321 100644 --- a/wcfsetup/install/files/lib/system/user/notification/object/type/TMultiRecipientPageCommentUserNotificationObjectType.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/object/type/TMultiRecipientPageCommentUserNotificationObjectType.class.php @@ -23,14 +23,14 @@ trait TMultiRecipientPageCommentUserNotificationObjectType { // find all userIDs with the permission to manage pages $sql = "SELECT userID - FROM wcf" . WCF_N . "_user_to_group - INNER JOIN wcf" . WCF_N . "_user_group_option_value - ON wcf" . WCF_N . "_user_to_group.groupID = wcf" . WCF_N . "_user_group_option_value.groupID - AND wcf" . WCF_N . "_user_group_option_value.optionValue = ? - INNER JOIN wcf" . WCF_N . "_user_group_option - ON wcf" . WCF_N . "_user_group_option_value.optionID = wcf" . WCF_N . "_user_group_option.optionID - AND wcf" . WCF_N . "_user_group_option.optionName = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + FROM wcf1_user_to_group + INNER JOIN wcf1_user_group_option_value + ON wcf1_user_to_group.groupID = wcf1_user_group_option_value.groupID + AND wcf1_user_group_option_value.optionValue = ? + INNER JOIN wcf1_user_group_option + ON wcf1_user_group_option_value.optionID = wcf1_user_group_option.optionID + AND wcf1_user_group_option.optionName = ?"; + $statement = WCF::getDB()->prepare($sql); $statement->execute([ 1, 'admin.content.cms.canManagePage', diff --git a/wcfsetup/install/files/lib/system/user/notification/object/type/UserProfileCommentUserNotificationObjectType.class.php b/wcfsetup/install/files/lib/system/user/notification/object/type/UserProfileCommentUserNotificationObjectType.class.php index 1dee5b95df..51b0fc4d27 100644 --- a/wcfsetup/install/files/lib/system/user/notification/object/type/UserProfileCommentUserNotificationObjectType.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/object/type/UserProfileCommentUserNotificationObjectType.class.php @@ -38,9 +38,9 @@ class UserProfileCommentUserNotificationObjectType extends AbstractUserNotificat public function getOwnerID($objectID) { $sql = "SELECT objectID - FROM wcf" . WCF_N . "_comment + FROM wcf1_comment WHERE commentID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$objectID]); $row = $statement->fetchArray(); diff --git a/wcfsetup/install/files/lib/system/user/object/watch/UserObjectWatchHandler.class.php b/wcfsetup/install/files/lib/system/user/object/watch/UserObjectWatchHandler.class.php index 797eab6c7b..54f07b7a8d 100644 --- a/wcfsetup/install/files/lib/system/user/object/watch/UserObjectWatchHandler.class.php +++ b/wcfsetup/install/files/lib/system/user/object/watch/UserObjectWatchHandler.class.php @@ -62,9 +62,9 @@ class UserObjectWatchHandler extends SingletonFactory $conditionsBuilder->add('objectTypeID = ?', [$objectTypeObj->objectTypeID]); $conditionsBuilder->add('objectID IN (?)', [$objectIDs]); $sql = "SELECT userID - FROM wcf" . WCF_N . "_user_object_watch + FROM wcf1_user_object_watch " . $conditionsBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionsBuilder->getParameters()); $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); @@ -95,9 +95,9 @@ class UserObjectWatchHandler extends SingletonFactory $conditionsBuilder->add('userID IN (?)', [$userIDs]); } - $sql = "DELETE FROM wcf" . WCF_N . "_user_object_watch + $sql = "DELETE FROM wcf1_user_object_watch " . $conditionsBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionsBuilder->getParameters()); } @@ -162,10 +162,10 @@ class UserObjectWatchHandler extends SingletonFactory ->getObjectTypeByName('com.woltlab.wcf.user.objectWatch', $objectType); $sql = "SELECT userID, notification - FROM wcf" . WCF_N . "_user_object_watch + FROM wcf1_user_object_watch WHERE objectTypeID = ? AND objectID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$objectTypeObj->objectTypeID, $objectID]); return $statement->fetchMap('userID', 'notification'); diff --git a/wcfsetup/install/files/lib/system/version/VersionTracker.class.php b/wcfsetup/install/files/lib/system/version/VersionTracker.class.php index 9c62c9ff50..ed57158329 100644 --- a/wcfsetup/install/files/lib/system/version/VersionTracker.class.php +++ b/wcfsetup/install/files/lib/system/version/VersionTracker.class.php @@ -83,7 +83,7 @@ class VersionTracker extends SingletonFactory implements IAJAXInvokeAction $sql = "INSERT INTO " . $this->getTableName($objectType) . "_version (objectID, userID, username, time, data) VALUES (?, ?, ?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $object->getObjectID(), WCF::getUser()->userID, @@ -107,7 +107,7 @@ class VersionTracker extends SingletonFactory implements IAJAXInvokeAction $sql = "SELECT COUNT(*) as count FROM " . $this->getTableName($objectType) . "_version WHERE objectID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$objectID]); return $statement->fetchSingleColumn(); @@ -128,7 +128,7 @@ class VersionTracker extends SingletonFactory implements IAJAXInvokeAction FROM " . $this->getTableName($objectType) . "_version WHERE objectID = ? ORDER BY versionID DESC"; - $statement = WCF::getDB()->prepareStatement($sql, 1); + $statement = WCF::getDB()->prepare($sql, 1); $statement->execute([$objectID]); return $statement->fetchObject(VersionTrackerEntry::class); @@ -149,7 +149,7 @@ class VersionTracker extends SingletonFactory implements IAJAXInvokeAction FROM " . $this->getTableName($objectType) . "_version WHERE objectID = ? ORDER BY versionID DESC"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$objectID]); $versions = []; while ($version = $statement->fetchObject(VersionTrackerEntry::class)) { @@ -173,7 +173,7 @@ class VersionTracker extends SingletonFactory implements IAJAXInvokeAction $sql = "SELECT * FROM " . $this->getTableName($objectType) . "_version WHERE versionID = ?"; - $statement = WCF::getDB()->prepareStatement($sql, 1); + $statement = WCF::getDB()->prepare($sql, 1); $statement->execute([$versionID]); return $statement->fetchObject(VersionTrackerEntry::class); @@ -186,9 +186,9 @@ class VersionTracker extends SingletonFactory implements IAJAXInvokeAction { // get definition id $sql = "SELECT definitionID - FROM wcf" . WCF_N . "_object_type_definition + FROM wcf1_object_type_definition WHERE definitionName = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(['com.woltlab.wcf.versionTracker.objectType']); $row = $statement->fetchArray(); @@ -279,7 +279,7 @@ class VersionTracker extends SingletonFactory implements IAJAXInvokeAction $sql = "DELETE FROM " . $this->getTableName($objectType) . "_version WHERE objectID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$objectID]); } @@ -296,9 +296,9 @@ class VersionTracker extends SingletonFactory implements IAJAXInvokeAction // check if table already exists $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_package_installation_sql_log + FROM wcf1_package_installation_sql_log WHERE sqlTable = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$tableName]); if ($statement->fetchSingleColumn()) { @@ -340,7 +340,7 @@ class VersionTracker extends SingletonFactory implements IAJAXInvokeAction \md5($tableName . '_userID') . '_fk', [ 'columns' => 'userID', - 'referencedTable' => 'wcf' . WCF_N . '_user', + 'referencedTable' => 'wcf1_user', 'referencedColumns' => 'userID', 'ON DELETE' => 'SET NULL', ] @@ -349,14 +349,14 @@ class VersionTracker extends SingletonFactory implements IAJAXInvokeAction // add comment $sql = "ALTER TABLE " . $tableName . " COMMENT = 'Version tracking for " . $objectType->objectType . "'"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(); // log table - $sql = "INSERT INTO wcf" . WCF_N . "_package_installation_sql_log + $sql = "INSERT INTO wcf1_package_installation_sql_log (packageID, sqlTable) VALUES (?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $objectType->packageID, $tableName, diff --git a/wcfsetup/install/files/lib/system/worker/AbstractRebuildDataWorker.class.php b/wcfsetup/install/files/lib/system/worker/AbstractRebuildDataWorker.class.php index 90bba34f51..a152fa6a4a 100644 --- a/wcfsetup/install/files/lib/system/worker/AbstractRebuildDataWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/AbstractRebuildDataWorker.class.php @@ -127,9 +127,9 @@ abstract class AbstractRebuildDataWorker extends AbstractWorker implements IRebu $conditions->add("userID IN (?)", [$userIDs]); $sql = "SELECT userID, groupID - FROM wcf" . WCF_N . "_user_to_group + FROM wcf1_user_to_group " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $groupData = []; diff --git a/wcfsetup/install/files/lib/system/worker/ArticleRebuildDataWorker.class.php b/wcfsetup/install/files/lib/system/worker/ArticleRebuildDataWorker.class.php index a7bed857ba..ae65689328 100644 --- a/wcfsetup/install/files/lib/system/worker/ArticleRebuildDataWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/ArticleRebuildDataWorker.class.php @@ -70,10 +70,10 @@ class ArticleRebuildDataWorker extends AbstractRebuildDataWorker $commentObjectType = ObjectTypeCache::getInstance() ->getObjectTypeByName('com.woltlab.wcf.comment.commentableContent', 'com.woltlab.wcf.articleComment'); $sql = "SELECT COUNT(*) AS comments, SUM(responses) AS responses - FROM wcf" . WCF_N . "_comment + FROM wcf1_comment WHERE objectTypeID = ? AND objectID = ?"; - $commentStatement = WCF::getDB()->prepareStatement($sql); + $commentStatement = WCF::getDB()->prepare($sql); $comments = []; // update article content @@ -133,9 +133,9 @@ class ArticleRebuildDataWorker extends AbstractRebuildDataWorker $conditions->add("objectID IN (?)", [$this->objectList->getObjectIDs()]); $sql = "SELECT objectID, cumulativeLikes - FROM wcf" . WCF_N . "_like_object + FROM wcf1_like_object " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $cumulativeLikes = $statement->fetchMap('objectID', 'cumulativeLikes'); diff --git a/wcfsetup/install/files/lib/system/worker/ImportWorker.class.php b/wcfsetup/install/files/lib/system/worker/ImportWorker.class.php index fdc398e1c1..9af157a975 100644 --- a/wcfsetup/install/files/lib/system/worker/ImportWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/ImportWorker.class.php @@ -133,7 +133,7 @@ class ImportWorker extends AbstractWorker // disable mysql strict mode $sql = "SET SESSION sql_mode = 'ANSI,ONLY_FULL_GROUP_BY'"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(); $this->getExporter()->exportData($this->parameters['objectType'], $this->loopCount); diff --git a/wcfsetup/install/files/lib/system/worker/MailWorker.class.php b/wcfsetup/install/files/lib/system/worker/MailWorker.class.php index 55db0e10cc..ceaa4ee49e 100644 --- a/wcfsetup/install/files/lib/system/worker/MailWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/MailWorker.class.php @@ -85,7 +85,7 @@ class MailWorker extends AbstractWorker $this->conditions->add( "user.userID IN ( SELECT userID - FROM wcf" . WCF_N . "_user_to_group + FROM wcf1_user_to_group WHERE groupID IN (?) )", [$this->mailData['groupIDs']] @@ -94,9 +94,9 @@ class MailWorker extends AbstractWorker } $sql = "SELECT COUNT(*) - FROM wcf" . WCF_N . "_user user + FROM wcf1_user user " . $this->conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($this->conditions->getParameters()); $this->count = $statement->fetchSingleColumn(); @@ -152,12 +152,12 @@ class MailWorker extends AbstractWorker // get users $sql = "SELECT user_option.*, user.* - FROM wcf" . WCF_N . "_user user - LEFT JOIN wcf" . WCF_N . "_user_option_value user_option + FROM wcf1_user user + LEFT JOIN wcf1_user_option_value user_option ON user_option.userID = user.userID " . $this->conditions . " ORDER BY user.userID"; - $statement = WCF::getDB()->prepareStatement($sql, $this->limit, $this->limit * $this->loopCount); + $statement = WCF::getDB()->prepare($sql, $this->limit, $this->limit * $this->loopCount); $statement->execute($this->conditions->getParameters()); while ($row = $statement->fetchArray()) { $user = new User(null, $row); diff --git a/wcfsetup/install/files/lib/system/worker/PollRebuildDataWorker.class.php b/wcfsetup/install/files/lib/system/worker/PollRebuildDataWorker.class.php index 48e58b24d2..b9fc4f91c8 100644 --- a/wcfsetup/install/files/lib/system/worker/PollRebuildDataWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/PollRebuildDataWorker.class.php @@ -53,27 +53,27 @@ class PollRebuildDataWorker extends AbstractRebuildDataWorker // update poll options $conditionBuilder = new PreparedStatementConditionBuilder(); $conditionBuilder->add('poll_option.pollID IN (?)', [$pollIDs]); - $sql = "UPDATE wcf" . WCF_N . "_poll_option poll_option + $sql = "UPDATE wcf1_poll_option poll_option SET votes = ( SELECT COUNT(*) - FROM wcf" . WCF_N . "_poll_option_vote + FROM wcf1_poll_option_vote WHERE optionID = poll_option.optionID ) " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); // update polls $conditionBuilder = new PreparedStatementConditionBuilder(); $conditionBuilder->add('poll.pollID IN (?)', [$pollIDs]); - $sql = "UPDATE wcf" . WCF_N . "_poll poll + $sql = "UPDATE wcf1_poll poll SET votes = ( SELECT COUNT(DISTINCT userID) - FROM wcf" . WCF_N . "_poll_option_vote + FROM wcf1_poll_option_vote WHERE pollID = poll.pollID ) " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); } } diff --git a/wcfsetup/install/files/lib/system/worker/SitemapRebuildWorker.class.php b/wcfsetup/install/files/lib/system/worker/SitemapRebuildWorker.class.php index 416e66daaf..76cc01e854 100755 --- a/wcfsetup/install/files/lib/system/worker/SitemapRebuildWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/SitemapRebuildWorker.class.php @@ -389,10 +389,10 @@ class SitemapRebuildWorker extends AbstractRebuildDataWorker private function registerSitemapFiles() { - $sql = "INSERT IGNORE INTO wcf" . WCF_N . "_package_installation_file_log + $sql = "INSERT IGNORE INTO wcf1_package_installation_file_log (packageID, filename, application) VALUES (?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); foreach ($this->workerData['filesToPackage'] as $packageID => $files) { diff --git a/wcfsetup/install/files/lib/system/worker/StatDailyRebuildDataWorker.class.php b/wcfsetup/install/files/lib/system/worker/StatDailyRebuildDataWorker.class.php index 1d8b2e0b05..6c45eec957 100644 --- a/wcfsetup/install/files/lib/system/worker/StatDailyRebuildDataWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/StatDailyRebuildDataWorker.class.php @@ -54,16 +54,16 @@ class StatDailyRebuildDataWorker extends AbstractRebuildDataWorker if (!$this->loopCount) { // delete existing stat - $sql = "DELETE FROM wcf" . WCF_N . "_stat_daily"; - $statement = WCF::getDB()->prepareStatement($sql); + $sql = "DELETE FROM wcf1_stat_daily"; + $statement = WCF::getDB()->prepare($sql); $statement->execute(); } // prepare insert statement - $sql = "INSERT IGNORE INTO wcf" . WCF_N . "_stat_daily + $sql = "INSERT IGNORE INTO wcf1_stat_daily (objectTypeID, date, counter, total) VALUES (?, ?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $this->getStartDate(); $d = DateUtil::getDateTimeByTimestamp($this->startDate); @@ -97,8 +97,8 @@ class StatDailyRebuildDataWorker extends AbstractRebuildDataWorker } $sql = "SELECT MIN(registrationDate) - FROM wcf" . WCF_N . "_user"; - $statement = WCF::getDB()->prepareStatement($sql); + FROM wcf1_user"; + $statement = WCF::getDB()->prepare($sql); $statement->execute(); $this->startDate = $statement->fetchSingleColumn(); } diff --git a/wcfsetup/install/files/lib/system/worker/UserActivityPointUpdateEventsWorker.class.php b/wcfsetup/install/files/lib/system/worker/UserActivityPointUpdateEventsWorker.class.php index 4b3e6a2ec9..18ede548da 100644 --- a/wcfsetup/install/files/lib/system/worker/UserActivityPointUpdateEventsWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/UserActivityPointUpdateEventsWorker.class.php @@ -61,10 +61,10 @@ class UserActivityPointUpdateEventsWorker extends AbstractWorker $i = 0; foreach ($this->objectTypes as $objectType) { if ($i == $this->loopCount) { - $sql = "UPDATE wcf" . WCF_N . "_user_activity_point + $sql = "UPDATE wcf1_user_activity_point SET activityPoints = items * ? WHERE objectTypeID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $objectType->points, $objectType->objectTypeID, diff --git a/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php b/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php index a29b883aec..729f710430 100644 --- a/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php @@ -49,7 +49,7 @@ final class UserRebuildDataWorker extends AbstractLinearRebuildDataWorker $this->objectList->sqlSelects = 'user_option_value.userOption' . User::getUserOptionID('aboutMe') . ' AS aboutMe'; $this->objectList->sqlJoins = " - LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value + LEFT JOIN wcf1_user_option_value user_option_value ON user_option_value.userID = user_table.userID"; } diff --git a/wcfsetup/install/files/lib/util/MessageUtil.class.php b/wcfsetup/install/files/lib/util/MessageUtil.class.php index 48c754b938..dd64ad0fd1 100644 --- a/wcfsetup/install/files/lib/util/MessageUtil.class.php +++ b/wcfsetup/install/files/lib/util/MessageUtil.class.php @@ -96,9 +96,9 @@ class MessageUtil } $sql = "SELECT userID - FROM wcf" . WCF_N . "_user_to_group + FROM wcf1_user_to_group " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); while ($userID = $statement->fetchColumn()) { $userIDs[] = $userID; @@ -160,11 +160,11 @@ class MessageUtil } $sql = "SELECT user_table.username - FROM wcf" . WCF_N . "_user_to_group user_to_group - LEFT JOIN wcf" . WCF_N . "_user user_table + FROM wcf1_user_to_group user_to_group + LEFT JOIN wcf1_user user_table ON user_table.userID = user_to_group.userID " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); while ($username = $statement->fetchColumn()) { $usernames[] = $username; diff --git a/wcfsetup/install/files/lib/util/UserUtil.class.php b/wcfsetup/install/files/lib/util/UserUtil.class.php index 64ae47de5e..85e812a4ca 100644 --- a/wcfsetup/install/files/lib/util/UserUtil.class.php +++ b/wcfsetup/install/files/lib/util/UserUtil.class.php @@ -60,9 +60,9 @@ final class UserUtil public static function isAvailableUsername($name): bool { $sql = "SELECT COUNT(username) - FROM wcf" . WCF_N . "_user + FROM wcf1_user WHERE username = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$name]); return $statement->fetchSingleColumn() == 0; @@ -94,9 +94,9 @@ final class UserUtil public static function isAvailableEmail($email): bool { $sql = "SELECT COUNT(email) - FROM wcf" . WCF_N . "_user + FROM wcf1_user WHERE email = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$email]); return $statement->fetchSingleColumn() == 0; -- 2.20.1