From 1ce0b00027517a0627bc6c4e817f6a6edbdea7d6 Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Wed, 30 Oct 2024 10:24:41 +0100 Subject: [PATCH] Use `Database::prepare()` instead of `Database::prepareStatement()`. --- .../data/conversation/Conversation.class.php | 46 +++++++++---------- .../conversation/ConversationAction.class.php | 44 +++++++++--------- .../conversation/ConversationEditor.class.php | 34 +++++++------- .../ConversationParticipantList.class.php | 16 +++---- .../FeedConversationList.class.php | 4 +- .../UserConversationList.class.php | 24 +++++----- .../ViewableConversation.class.php | 4 +- .../label/ConversationLabelAction.class.php | 12 ++--- .../ConversationMessageAction.class.php | 12 ++--- ...rchResultConversationMessageList.class.php | 2 +- ...nversationLogModificationLogList.class.php | 4 +- .../form/ConversationDraftEditForm.class.php | 4 +- files/lib/page/ConversationFeedPage.class.php | 2 +- files/lib/page/ConversationListPage.class.php | 8 ++-- files/lib/page/ConversationPage.class.php | 16 +++---- .../ConversationClipboardAction.class.php | 20 ++++---- .../ConversationHandler.class.php | 12 ++--- ...nPruneIpAddressesCronjobListener.class.php | 2 +- ...ersationUserActionRenameListener.class.php | 8 ++-- .../ConversationUserMergeListener.class.php | 8 ++-- .../ConversationMessageSearch.class.php | 6 +-- ...versationMessageStatDailyHandler.class.php | 4 +- .../ConversationStatDailyHandler.class.php | 4 +- ...ersationMessageRebuildDataWorker.class.php | 2 +- 24 files changed, 149 insertions(+), 149 deletions(-) diff --git a/files/lib/data/conversation/Conversation.class.php b/files/lib/data/conversation/Conversation.class.php index abb8fb2..3d6bf1c 100644 --- a/files/lib/data/conversation/Conversation.class.php +++ b/files/lib/data/conversation/Conversation.class.php @@ -165,10 +165,10 @@ class Conversation extends DatabaseObject implements IPopoverObject, IRouteContr } $sql = "SELECT * - FROM wcf" . WCF_N . "_conversation_to_user + FROM wcf1_conversation_to_user WHERE participantID = ? AND conversationID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$userID, $this->conversationID]); $row = $statement->fetchArray(); if ($row !== false) { @@ -186,12 +186,12 @@ class Conversation extends DatabaseObject implements IPopoverObject, IRouteContr public static function getUserConversation($conversationID, $userID) { $sql = "SELECT conversation_to_user.*, conversation.* - FROM wcf" . WCF_N . "_conversation conversation - LEFT JOIN wcf" . WCF_N . "_conversation_to_user conversation_to_user + FROM wcf1_conversation conversation + LEFT JOIN wcf1_conversation_to_user conversation_to_user ON conversation_to_user.participantID = ? AND conversation_to_user.conversationID = conversation.conversationID WHERE conversation.conversationID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$userID, $conversationID]); $row = $statement->fetchArray(); if ($row !== false) { @@ -213,12 +213,12 @@ class Conversation extends DatabaseObject implements IPopoverObject, IRouteContr $conditionBuilder = new PreparedStatementConditionBuilder(); $conditionBuilder->add('conversation.conversationID IN (?)', [$conversationIDs]); $sql = "SELECT conversation_to_user.*, conversation.* - FROM wcf" . WCF_N . "_conversation conversation - LEFT JOIN wcf" . WCF_N . "_conversation_to_user conversation_to_user + FROM wcf1_conversation conversation + LEFT JOIN wcf1_conversation_to_user conversation_to_user ON conversation_to_user.participantID = " . $userID . " AND conversation_to_user.conversationID = conversation.conversationID " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); $conversations = []; while ($row = $statement->fetchArray()) { @@ -289,10 +289,10 @@ class Conversation extends DatabaseObject implements IPopoverObject, IRouteContr $this->canAddUnrestricted = false; if ($this->isActiveParticipant()) { $sql = "SELECT joinedAt - FROM wcf" . WCF_N . "_conversation_to_user + FROM wcf1_conversation_to_user WHERE conversationID = ? AND participantID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $this->conversationID, WCF::getUser()->userID, @@ -329,9 +329,9 @@ class Conversation extends DatabaseObject implements IPopoverObject, IRouteContr } $sql = "SELECT participantID - FROM wcf" . WCF_N . "_conversation_to_user + FROM wcf1_conversation_to_user " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); return $statement->fetchAll(\PDO::FETCH_COLUMN); @@ -356,11 +356,11 @@ class Conversation extends DatabaseObject implements IPopoverObject, IRouteContr } $sql = "SELECT user_table.username - FROM wcf" . WCF_N . "_conversation_to_user conversation_to_user - LEFT JOIN wcf" . WCF_N . "_user user_table + FROM wcf1_conversation_to_user conversation_to_user + LEFT JOIN wcf1_user user_table ON user_table.userID = conversation_to_user.participantID " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); return $statement->fetchAll(\PDO::FETCH_COLUMN); @@ -390,10 +390,10 @@ class Conversation extends DatabaseObject implements IPopoverObject, IRouteContr { if ($this->isActiveParticipant === null) { $sql = "SELECT leftAt - FROM wcf" . WCF_N . "_conversation_to_user + FROM wcf1_conversation_to_user WHERE conversationID = ? AND participantID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ $this->conversationID, WCF::getUser()->userID, @@ -433,9 +433,9 @@ class Conversation extends DatabaseObject implements IPopoverObject, IRouteContr $conditions->add("userID = ?", [$userID]); $sql = "SELECT conversationID - FROM wcf" . WCF_N . "_conversation + FROM wcf1_conversation " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); while ($row = $statement->fetchArray()) { $index = \array_search($row['conversationID'], $conversationIDs); @@ -450,9 +450,9 @@ class Conversation extends DatabaseObject implements IPopoverObject, IRouteContr $conditions->add("hideConversation <> ?", [self::STATE_LEFT]); $sql = "SELECT conversationID - FROM wcf" . WCF_N . "_conversation_to_user + FROM wcf1_conversation_to_user " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); while ($row = $statement->fetchArray()) { $index = \array_search($row['conversationID'], $conversationIDs); @@ -558,9 +558,9 @@ class Conversation extends DatabaseObject implements IPopoverObject, IRouteContr $conditionBuilder = new PreparedStatementConditionBuilder(); $conditionBuilder->add('groupID IN (?)', [$validGroupIDs]); $sql = "SELECT DISTINCT userID - 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()); while ($userID = $statement->fetchColumn()) { $userIDs[] = $userID; diff --git a/files/lib/data/conversation/ConversationAction.class.php b/files/lib/data/conversation/ConversationAction.class.php index 65853a1..1afa8a1 100644 --- a/files/lib/data/conversation/ConversationAction.class.php +++ b/files/lib/data/conversation/ConversationAction.class.php @@ -100,11 +100,11 @@ class ConversationAction extends AbstractDatabaseObjectAction implements UserStorageHandler::getInstance()->reset($conversation->getParticipantIDs(), 'conversationCount'); // mark conversation as read for the author - $sql = "UPDATE wcf" . WCF_N . "_conversation_to_user + $sql = "UPDATE wcf1_conversation_to_user SET lastVisitTime = ? WHERE participantID = ? AND conversationID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$data['time'], $data['userID'], $conversation->conversationID]); } else { // update conversation count @@ -170,9 +170,9 @@ class ConversationAction extends AbstractDatabaseObjectAction implements $conditions = new PreparedStatementConditionBuilder(); $conditions->add("conversationID IN (?)", [$this->objectIDs]); $sql = "SELECT DISTINCT participantID - FROM wcf" . WCF_N . "_conversation_to_user + FROM wcf1_conversation_to_user " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); while ($participantID = $statement->fetchColumn()) { @@ -285,11 +285,11 @@ class ConversationAction extends AbstractDatabaseObjectAction implements } $conversationIDs = []; - $sql = "UPDATE wcf" . WCF_N . "_conversation_to_user + $sql = "UPDATE wcf1_conversation_to_user SET lastVisitTime = ? WHERE participantID = ? AND conversationID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); foreach ($this->getObjects() as $conversation) { $statement->execute([ @@ -325,7 +325,7 @@ class ConversationAction extends AbstractDatabaseObjectAction implements $condition->add('notification.eventID = ?', [$eventID]); $condition->add("notification.objectID IN ( SELECT messageID - FROM wcf" . WCF_N . "_conversation_message + FROM wcf1_conversation_message WHERE conversationID IN (?) AND time <= ? )", [ @@ -334,9 +334,9 @@ class ConversationAction extends AbstractDatabaseObjectAction implements ]); $sql = "SELECT notificationID - FROM wcf" . WCF_N . "_user_notification notification + FROM wcf1_user_notification notification {$condition}"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($condition->getParameters()); UserNotificationHandler::getInstance()->markAsConfirmedByIDs( @@ -400,10 +400,10 @@ class ConversationAction extends AbstractDatabaseObjectAction implements */ public function markAllAsRead() { - $sql = "UPDATE wcf" . WCF_N . "_conversation_to_user + $sql = "UPDATE wcf1_conversation_to_user SET lastVisitTime = ? WHERE participantID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ TIME_NOW, WCF::getUser()->userID, @@ -634,10 +634,10 @@ class ConversationAction extends AbstractDatabaseObjectAction implements { // get hidden state from first conversation (all others have the same state) $sql = "SELECT hideConversation - FROM wcf" . WCF_N . "_conversation_to_user + FROM wcf1_conversation_to_user WHERE conversationID = ? AND participantID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ \current($this->objectIDs), WCF::getUser()->userID, @@ -688,11 +688,11 @@ class ConversationAction extends AbstractDatabaseObjectAction implements */ public function hideConversation() { - $sql = "UPDATE wcf" . WCF_N . "_conversation_to_user + $sql = "UPDATE wcf1_conversation_to_user SET hideConversation = ? WHERE conversationID = ? AND participantID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); foreach ($this->objectIDs as $conversationID) { @@ -735,13 +735,13 @@ class ConversationAction extends AbstractDatabaseObjectAction implements $conditionBuilder->add('conversation.conversationID IN (?)', [$this->objectIDs]); $conditionBuilder->add('conversation_to_user.conversationID IS NULL'); $sql = "SELECT DISTINCT conversation.conversationID - FROM wcf" . WCF_N . "_conversation conversation - LEFT JOIN wcf" . WCF_N . "_conversation_to_user conversation_to_user + FROM wcf1_conversation conversation + LEFT JOIN wcf1_conversation_to_user conversation_to_user ON conversation_to_user.conversationID = conversation.conversationID AND conversation_to_user.hideConversation <> " . Conversation::STATE_LEFT . " AND conversation_to_user.participantID IS NOT NULL " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); $conversationIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); @@ -778,7 +778,7 @@ class ConversationAction extends AbstractDatabaseObjectAction implements { $sqlSelect = ' , ( SELECT participantID - FROM wcf' . WCF_N . '_conversation_to_user + FROM wcf1_conversation_to_user WHERE conversationID = conversation.conversationID AND participantID <> conversation.userID AND isInvisible = 0 @@ -787,7 +787,7 @@ class ConversationAction extends AbstractDatabaseObjectAction implements ) AS otherParticipantID , ( SELECT username - FROM wcf' . WCF_N . '_conversation_to_user + FROM wcf1_conversation_to_user WHERE conversationID = conversation.conversationID AND participantID <> conversation.userID AND isInvisible = 0 @@ -1136,10 +1136,10 @@ class ConversationAction extends AbstractDatabaseObjectAction implements $conditionBuilder = new PreparedStatementConditionBuilder(); $conditionBuilder->add('conversation_message.conversationID IN (?)', [$this->objectIDs]); $sql = "SELECT conversationID, COUNT(messageID) AS messages, SUM(attachments) AS attachments - FROM wcf" . WCF_N . "_conversation_message conversation_message + FROM wcf1_conversation_message conversation_message " . $conditionBuilder . " GROUP BY conversationID"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); $objectIDs = []; diff --git a/files/lib/data/conversation/ConversationEditor.class.php b/files/lib/data/conversation/ConversationEditor.class.php index 149167d..dea3186 100644 --- a/files/lib/data/conversation/ConversationEditor.class.php +++ b/files/lib/data/conversation/ConversationEditor.class.php @@ -46,10 +46,10 @@ class ConversationEditor extends DatabaseObjectEditor */ public function resetParticipants() { - $sql = "DELETE FROM wcf" . WCF_N . "_conversation_to_user + $sql = "DELETE FROM wcf1_conversation_to_user WHERE conversationID = ? AND participantID <> ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->conversationID, $this->userID]); } @@ -68,9 +68,9 @@ class ConversationEditor extends DatabaseObjectEditor $conditions->add("userID IN (?)", [\array_merge($participantIDs, $invisibleParticipantIDs)]); $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()); while ($row = $statement->fetchArray()) { $usernames[$row['userID']] = $row['username']; @@ -79,7 +79,7 @@ class ConversationEditor extends DatabaseObjectEditor if (!empty($participantIDs)) { WCF::getDB()->beginTransaction(); - $sql = "INSERT INTO wcf" . WCF_N . "_conversation_to_user + $sql = "INSERT INTO wcf1_conversation_to_user (conversationID, participantID, username, isInvisible, joinedAt) VALUES (?, ?, ?, ?, ?) ON DUPLICATE KEY @@ -87,7 +87,7 @@ class ConversationEditor extends DatabaseObjectEditor isInvisible = 0, leftAt = 0, leftByOwnChoice = 1"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($participantIDs as $userID) { $statement->execute([ @@ -103,10 +103,10 @@ class ConversationEditor extends DatabaseObjectEditor if (!empty($invisibleParticipantIDs)) { WCF::getDB()->beginTransaction(); - $sql = "INSERT INTO wcf" . WCF_N . "_conversation_to_user + $sql = "INSERT INTO wcf1_conversation_to_user (conversationID, participantID, username, isInvisible) VALUES (?, ?, ?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); foreach ($invisibleParticipantIDs as $userID) { $statement->execute([ @@ -127,17 +127,17 @@ class ConversationEditor extends DatabaseObjectEditor */ public function updateParticipantCount() { - $sql = "UPDATE wcf" . WCF_N . "_conversation conversation + $sql = "UPDATE wcf1_conversation conversation SET participants = ( SELECT COUNT(*) AS count - FROM wcf" . WCF_N . "_conversation_to_user conversation_to_user + FROM wcf1_conversation_to_user conversation_to_user WHERE conversation_to_user.conversationID = conversation.conversationID AND conversation_to_user.hideConversation <> ? AND conversation_to_user.participantID <> ? AND conversation_to_user.isInvisible = ? ) WHERE conversation.conversationID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ Conversation::STATE_LEFT, $this->userID, @@ -152,12 +152,12 @@ class ConversationEditor extends DatabaseObjectEditor public function updateParticipantSummary() { $sql = "SELECT participantID AS userID, hideConversation, username - FROM wcf" . WCF_N . "_conversation_to_user + FROM wcf1_conversation_to_user WHERE conversationID = ? AND participantID <> ? AND isInvisible = 0 ORDER BY username"; - $statement = WCF::getDB()->prepareStatement($sql, 5); + $statement = WCF::getDB()->prepare($sql, 5); $statement->execute([$this->conversationID, $this->userID]); $this->update(['participantSummary' => \serialize($statement->fetchAll(\PDO::FETCH_ASSOC))]); @@ -221,10 +221,10 @@ class ConversationEditor extends DatabaseObjectEditor public function updateFirstMessage() { $sql = "SELECT messageID - FROM wcf" . WCF_N . "_conversation_message + FROM wcf1_conversation_message WHERE conversationID = ? ORDER BY time ASC"; - $statement = WCF::getDB()->prepareStatement($sql, 1); + $statement = WCF::getDB()->prepare($sql, 1); $statement->execute([ $this->conversationID, ]); @@ -240,10 +240,10 @@ class ConversationEditor extends DatabaseObjectEditor public function updateLastMessage() { $sql = "SELECT time, userID, username - FROM wcf" . WCF_N . "_conversation_message + FROM wcf1_conversation_message WHERE conversationID = ? ORDER BY time DESC"; - $statement = WCF::getDB()->prepareStatement($sql, 1); + $statement = WCF::getDB()->prepare($sql, 1); $statement->execute([ $this->conversationID, ]); diff --git a/files/lib/data/conversation/ConversationParticipantList.class.php b/files/lib/data/conversation/ConversationParticipantList.class.php index fc5db5e..f43944d 100644 --- a/files/lib/data/conversation/ConversationParticipantList.class.php +++ b/files/lib/data/conversation/ConversationParticipantList.class.php @@ -52,7 +52,7 @@ class ConversationParticipantList extends UserProfileList } } $this->sqlConditionJoins .= " - LEFT JOIN wcf" . WCF_N . "_user user_table + LEFT JOIN wcf1_user user_table ON user_table.userID = conversation_to_user.participantID"; if (!empty($this->sqlSelects)) { @@ -60,7 +60,7 @@ class ConversationParticipantList extends UserProfileList } $this->sqlSelects .= 'conversation_to_user.*'; $this->sqlJoins .= " - LEFT JOIN wcf" . WCF_N . "_conversation_to_user conversation_to_user + LEFT JOIN wcf1_conversation_to_user conversation_to_user ON conversation_to_user.participantID = user_table.userID AND conversation_to_user.conversationID = " . $conversationID; } @@ -71,10 +71,10 @@ class ConversationParticipantList extends UserProfileList public function countObjects() { $sql = "SELECT COUNT(*) AS count - FROM wcf" . WCF_N . "_conversation_to_user conversation_to_user + FROM wcf1_conversation_to_user conversation_to_user " . $this->sqlConditionJoins . " " . $this->getConditionBuilder(); - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($this->getConditionBuilder()->getParameters()); $row = $statement->fetchArray(); @@ -88,11 +88,11 @@ class ConversationParticipantList extends UserProfileList { $this->objectIDs = []; $sql = "SELECT conversation_to_user.participantID AS objectID - FROM wcf" . WCF_N . "_conversation_to_user conversation_to_user + FROM wcf1_conversation_to_user conversation_to_user " . $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); } @@ -106,10 +106,10 @@ class ConversationParticipantList extends UserProfileList // check for deleted users $sql = "SELECT username - FROM wcf" . WCF_N . "_conversation_to_user + FROM wcf1_conversation_to_user WHERE conversationID = ? AND participantID IS NULL"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$this->conversationID]); $i = 0; while ($row = $statement->fetchArray()) { diff --git a/files/lib/data/conversation/FeedConversationList.class.php b/files/lib/data/conversation/FeedConversationList.class.php index 4d1c732..63e280c 100644 --- a/files/lib/data/conversation/FeedConversationList.class.php +++ b/files/lib/data/conversation/FeedConversationList.class.php @@ -36,11 +36,11 @@ class FeedConversationList extends ConversationList public function readObjectIDs() { $sql = "SELECT conversation_to_user.conversationID AS objectID - FROM wcf" . WCF_N . "_conversation_to_user conversation_to_user + FROM wcf1_conversation_to_user conversation_to_user " . $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); } diff --git a/files/lib/data/conversation/UserConversationList.class.php b/files/lib/data/conversation/UserConversationList.class.php index 8a759ad..331805a 100644 --- a/files/lib/data/conversation/UserConversationList.class.php +++ b/files/lib/data/conversation/UserConversationList.class.php @@ -69,7 +69,7 @@ class UserConversationList extends ConversationList $this->getConditionBuilder() ->add('conversation_to_user.hideConversation = ?', [$this->filter == 'hidden' ? 1 : 0]); $this->sqlConditionJoins = " - LEFT JOIN wcf" . WCF_N . "_conversation conversation + LEFT JOIN wcf1_conversation conversation ON conversation.conversationID = conversation_to_user.conversationID"; if ($this->filter == 'outbox') { $this->getConditionBuilder()->add('conversation.userID = ?', [$userID]); @@ -80,7 +80,7 @@ class UserConversationList extends ConversationList if ($labelID) { $this->getConditionBuilder()->add("conversation.conversationID IN ( SELECT conversationID - FROM wcf" . WCF_N . "_conversation_label_to_object + FROM wcf1_conversation_label_to_object WHERE labelID = ? )", [$labelID]); } @@ -88,7 +88,7 @@ class UserConversationList extends ConversationList // own posts $this->sqlSelects = "DISTINCT conversation_message.userID AS ownPosts"; $this->sqlJoins = " - LEFT JOIN wcf" . WCF_N . "_conversation_message conversation_message + LEFT JOIN wcf1_conversation_message conversation_message ON conversation_message.conversationID = conversation.conversationID AND conversation_message.userID = " . $userID; @@ -98,7 +98,7 @@ class UserConversationList extends ConversationList } $this->sqlSelects .= "conversation_to_user.*"; $this->sqlJoins .= " - LEFT JOIN wcf" . WCF_N . "_conversation_to_user conversation_to_user + LEFT JOIN wcf1_conversation_to_user conversation_to_user ON conversation_to_user.participantID = " . $userID . " AND conversation_to_user.conversationID = conversation.conversationID"; @@ -136,10 +136,10 @@ class UserConversationList extends ConversationList } $sql = "SELECT COUNT(*) AS count - FROM wcf" . WCF_N . "_conversation_to_user conversation_to_user + FROM wcf1_conversation_to_user conversation_to_user " . $this->sqlConditionJoins . " " . $this->getConditionBuilder(); - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($this->getConditionBuilder()->getParameters()); $row = $statement->fetchArray(); @@ -163,11 +163,11 @@ class UserConversationList extends ConversationList THEN conversation_to_user.leftAt ELSE conversation.lastPostTime END) AS lastPostTime - FROM wcf" . WCF_N . "_conversation_to_user conversation_to_user + FROM wcf1_conversation_to_user conversation_to_user " . $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); } @@ -194,9 +194,9 @@ class UserConversationList extends ConversationList $conditions = new PreparedStatementConditionBuilder(); $conditions->add("messageID IN (?)", [$messageIDs]); $sql = "SELECT messageID, userID, username, time - FROM wcf" . WCF_N . "_conversation_message + FROM wcf1_conversation_message " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $messageData = []; while ($row = $statement->fetchArray()) { @@ -277,9 +277,9 @@ class UserConversationList extends ConversationList $conditions->add("labelID IN (?)", [\array_keys($labels)]); $sql = "SELECT labelID, conversationID - FROM wcf" . WCF_N . "_conversation_label_to_object + FROM wcf1_conversation_label_to_object " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $data = []; while ($row = $statement->fetchArray()) { diff --git a/files/lib/data/conversation/ViewableConversation.class.php b/files/lib/data/conversation/ViewableConversation.class.php index e6e5e2d..6a7126e 100644 --- a/files/lib/data/conversation/ViewableConversation.class.php +++ b/files/lib/data/conversation/ViewableConversation.class.php @@ -202,9 +202,9 @@ class ViewableConversation extends DatabaseObjectDecorator $conditions->add("labelID IN (?)", [\array_keys($labels)]); $sql = "SELECT labelID - FROM wcf" . WCF_N . "_conversation_label_to_object + FROM wcf1_conversation_label_to_object " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); while ($row = $statement->fetchArray()) { $conversation->assignLabel($labels[$row['labelID']]); diff --git a/files/lib/data/conversation/label/ConversationLabelAction.class.php b/files/lib/data/conversation/label/ConversationLabelAction.class.php index 9a3f432..11c3c74 100644 --- a/files/lib/data/conversation/label/ConversationLabelAction.class.php +++ b/files/lib/data/conversation/label/ConversationLabelAction.class.php @@ -182,9 +182,9 @@ class ConversationLabelAction extends AbstractDatabaseObjectAction $conditions->add("labelID IN (?)", [$labelIDs]); $sql = "SELECT labelID - FROM wcf" . WCF_N . "_conversation_label_to_object + FROM wcf1_conversation_label_to_object " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $assignedLabels = $statement->fetchAll(\PDO::FETCH_COLUMN); } @@ -247,17 +247,17 @@ class ConversationLabelAction extends AbstractDatabaseObjectAction $conditions->add("conversationID IN (?)", [$this->parameters['conversationIDs']]); $conditions->add("labelID IN (?)", [$labelIDs]); - $sql = "DELETE FROM wcf" . WCF_N . "_conversation_label_to_object + $sql = "DELETE FROM wcf1_conversation_label_to_object " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); // assign label ids if (!empty($this->parameters['labelIDs'])) { - $sql = "INSERT INTO wcf" . WCF_N . "_conversation_label_to_object + $sql = "INSERT INTO wcf1_conversation_label_to_object (labelID, conversationID) VALUES (?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); WCF::getDB()->beginTransaction(); foreach ($this->parameters['labelIDs'] as $labelID) { diff --git a/files/lib/data/conversation/message/ConversationMessageAction.class.php b/files/lib/data/conversation/message/ConversationMessageAction.class.php index d95f48d..8e0ce91 100644 --- a/files/lib/data/conversation/message/ConversationMessageAction.class.php +++ b/files/lib/data/conversation/message/ConversationMessageAction.class.php @@ -121,11 +121,11 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements $userConversation = Conversation::getUserConversation($conversation->conversationID, $message->userID); if ($userConversation !== null && $userConversation->isInvisible) { // make invisible participant visible - $sql = "UPDATE wcf" . WCF_N . "_conversation_to_user + $sql = "UPDATE wcf1_conversation_to_user SET isInvisible = 0 WHERE participantID = ? AND conversationID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$message->userID, $conversation->conversationID]); $conversationEditor->updateParticipantSummary(); @@ -133,11 +133,11 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements } // reset visibility if it was hidden but not left - $sql = "UPDATE wcf" . WCF_N . "_conversation_to_user + $sql = "UPDATE wcf1_conversation_to_user SET hideConversation = ? WHERE conversationID = ? AND hideConversation = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([ Conversation::STATE_DEFAULT, $conversation->conversationID, @@ -577,9 +577,9 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements /** @var Conversation $container */ $sql = "SELECT COUNT(*) AS count - FROM wcf" . WCF_N . "_conversation_message + FROM wcf1_conversation_message WHERE conversationID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([$container->conversationID]); $count = $statement->fetchArray(); diff --git a/files/lib/data/conversation/message/SearchResultConversationMessageList.class.php b/files/lib/data/conversation/message/SearchResultConversationMessageList.class.php index a5449d5..365dc8f 100644 --- a/files/lib/data/conversation/message/SearchResultConversationMessageList.class.php +++ b/files/lib/data/conversation/message/SearchResultConversationMessageList.class.php @@ -34,7 +34,7 @@ class SearchResultConversationMessageList extends SimplifiedViewableConversation } $this->sqlSelects .= 'conversation.subject'; $this->sqlJoins .= " - LEFT JOIN wcf" . WCF_N . "_conversation conversation + LEFT JOIN wcf1_conversation conversation ON conversation.conversationID = conversation_message.conversationID"; } } diff --git a/files/lib/data/modification/log/ConversationLogModificationLogList.class.php b/files/lib/data/modification/log/ConversationLogModificationLogList.class.php index 919f285..c4ac181 100644 --- a/files/lib/data/modification/log/ConversationLogModificationLogList.class.php +++ b/files/lib/data/modification/log/ConversationLogModificationLogList.class.php @@ -45,10 +45,10 @@ class ConversationLogModificationLogList extends ModificationLogList public function readObjects() { $sql = "SELECT modification_log.* - FROM wcf" . WCF_N . "_modification_log modification_log + FROM wcf1_modification_log modification_log " . $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/files/lib/form/ConversationDraftEditForm.class.php b/files/lib/form/ConversationDraftEditForm.class.php index c373385..c72b480 100644 --- a/files/lib/form/ConversationDraftEditForm.class.php +++ b/files/lib/form/ConversationDraftEditForm.class.php @@ -161,9 +161,9 @@ class ConversationDraftEditForm extends ConversationAddForm $condition->add('userID IN (?)', [$draftData[$participantType]]); $sql = "SELECT username - FROM wcf" . WCF_N . "_user + FROM wcf1_user " . $condition; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($condition->getParameters()); if (!empty($this->{$participantType})) { diff --git a/files/lib/page/ConversationFeedPage.class.php b/files/lib/page/ConversationFeedPage.class.php index ed57984..e7dfe70 100644 --- a/files/lib/page/ConversationFeedPage.class.php +++ b/files/lib/page/ConversationFeedPage.class.php @@ -41,7 +41,7 @@ class ConversationFeedPage extends AbstractFeedPage $this->items->getConditionBuilder()->add('conversation_to_user.participantID = ?', [WCF::getUser()->userID]); $this->items->getConditionBuilder()->add('conversation_to_user.hideConversation = ?', [0]); $this->items->sqlConditionJoins = " - LEFT JOIN wcf" . WCF_N . "_conversation conversation + LEFT JOIN wcf1_conversation conversation ON conversation.conversationID = conversation_to_user.conversationID"; $this->items->sqlLimit = 20; $this->items->readObjects(); diff --git a/files/lib/page/ConversationListPage.class.php b/files/lib/page/ConversationListPage.class.php index 3c9897e..b7e4095 100644 --- a/files/lib/page/ConversationListPage.class.php +++ b/files/lib/page/ConversationListPage.class.php @@ -189,9 +189,9 @@ class ConversationListPage extends SortablePage $conditions = new PreparedStatementConditionBuilder(); $conditions->add('username IN (?)', [$this->participants]); $sql = "SELECT userID - FROM wcf" . WCF_N . "_user + FROM wcf1_user " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $userIDs = []; while ($userID = $statement->fetchColumn()) { @@ -214,7 +214,7 @@ class ConversationListPage extends SortablePage conversation.userID = ? AND conversation.conversationID IN ( SELECT conversationID - FROM wcf' . WCF_N . '_conversation_to_user + FROM wcf1_conversation_to_user WHERE participantID IN (?) GROUP BY conversationID HAVING COUNT(conversationID) = ? @@ -225,7 +225,7 @@ class ConversationListPage extends SortablePage conversation.userID <> ? AND conversation.conversationID IN ( SELECT conversationID - FROM wcf' . WCF_N . '_conversation_to_user + FROM wcf1_conversation_to_user WHERE participantID IN (?) AND isInvisible = ? GROUP BY conversationID diff --git a/files/lib/page/ConversationPage.class.php b/files/lib/page/ConversationPage.class.php index 3c7898a..0d58f2b 100644 --- a/files/lib/page/ConversationPage.class.php +++ b/files/lib/page/ConversationPage.class.php @@ -281,11 +281,11 @@ class ConversationPage extends MultipleLinkPage $this->objectList->seek($count - 1); if ($this->objectList->current()->time < $this->conversation->lastPostTime) { $sql = "SELECT time - FROM wcf" . WCF_N . "_conversation_message + FROM wcf1_conversation_message WHERE conversationID = ? AND time > ? ORDER BY time"; - $statement = WCF::getDB()->prepareStatement($sql, 1); + $statement = WCF::getDB()->prepare($sql, 1); $statement->execute([$this->conversationID, $this->objectList->current()->time]); $endTime = $statement->fetchSingleColumn() - 1; } @@ -372,9 +372,9 @@ class ConversationPage extends MultipleLinkPage $conditionBuilder->add('time ' . ($this->sortOrder == 'ASC' ? '<=' : '>=') . ' ?', [$this->message->time]); $sql = "SELECT COUNT(*) AS messages - FROM wcf" . WCF_N . "_conversation_message conversation_message + FROM wcf1_conversation_message conversation_message " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); $row = $statement->fetchArray(); $this->pageNo = \intval(\ceil($row['messages'] / $this->itemsPerPage)); @@ -386,10 +386,10 @@ class ConversationPage extends MultipleLinkPage protected function goToLastPost() { $sql = "SELECT conversation_message.messageID - FROM wcf" . WCF_N . "_conversation_message conversation_message + FROM wcf1_conversation_message conversation_message " . $this->objectList->getConditionBuilder() . " ORDER BY time " . ($this->sortOrder == 'ASC' ? 'DESC' : 'ASC'); - $statement = WCF::getDB()->prepareStatement($sql, 1); + $statement = WCF::getDB()->prepare($sql, 1); $statement->execute($this->objectList->getConditionBuilder()->getParameters()); $row = $statement->fetchArray(); if ($row === false) { @@ -419,10 +419,10 @@ class ConversationPage extends MultipleLinkPage $conditionBuilder->add('time > ?', [$this->conversation->lastVisitTime]); $sql = "SELECT conversation_message.messageID - FROM wcf" . WCF_N . "_conversation_message conversation_message + FROM wcf1_conversation_message conversation_message " . $conditionBuilder . " ORDER BY time ASC"; - $statement = WCF::getDB()->prepareStatement($sql, 1); + $statement = WCF::getDB()->prepare($sql, 1); $statement->execute($conditionBuilder->getParameters()); $row = $statement->fetchArray(); if ($row !== false) { diff --git a/files/lib/system/clipboard/action/ConversationClipboardAction.class.php b/files/lib/system/clipboard/action/ConversationClipboardAction.class.php index cddeb69..76268da 100644 --- a/files/lib/system/clipboard/action/ConversationClipboardAction.class.php +++ b/files/lib/system/clipboard/action/ConversationClipboardAction.class.php @@ -66,9 +66,9 @@ class ConversationClipboardAction extends AbstractClipboardAction case 'assignLabel': // check if user has labels $sql = "SELECT COUNT(*) AS count - FROM wcf" . WCF_N . "_conversation_label + FROM wcf1_conversation_label WHERE userID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute([WCF::getUser()->userID]); $row = $statement->fetchArray(); if ($row['count'] == 0) { @@ -155,9 +155,9 @@ class ConversationClipboardAction extends AbstractClipboardAction $conditions->add("participantID = ?", [WCF::getUser()->userID]); $sql = "SELECT conversationID - FROM wcf" . WCF_N . "_conversation_to_user + FROM wcf1_conversation_to_user " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); while ($row = $statement->fetchArray()) { $index = \array_search($row['conversationID'], $conversationIDs); @@ -215,9 +215,9 @@ class ConversationClipboardAction extends AbstractClipboardAction $conditions->add("hideConversation <> ?", [1]); $sql = "SELECT conversationID - FROM wcf" . WCF_N . "_conversation_to_user + FROM wcf1_conversation_to_user " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); return $statement->fetchAll(\PDO::FETCH_COLUMN); @@ -237,9 +237,9 @@ class ConversationClipboardAction extends AbstractClipboardAction $conditions->add("participantID = ?", [WCF::getUser()->userID]); $sql = "SELECT conversationID, lastVisitTime - FROM wcf" . WCF_N . "_conversation_to_user + FROM wcf1_conversation_to_user " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); $lastVisitTime = []; while ($row = $statement->fetchArray()) { @@ -294,9 +294,9 @@ class ConversationClipboardAction extends AbstractClipboardAction $conditions->add("hideConversation <> ?", [0]); $sql = "SELECT conversationID - FROM wcf" . WCF_N . "_conversation_to_user + FROM wcf1_conversation_to_user " . $conditions; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); return $statement->fetchAll(\PDO::FETCH_COLUMN); diff --git a/files/lib/system/conversation/ConversationHandler.class.php b/files/lib/system/conversation/ConversationHandler.class.php index da0befc..7a8e2d9 100644 --- a/files/lib/system/conversation/ConversationHandler.class.php +++ b/files/lib/system/conversation/ConversationHandler.class.php @@ -63,10 +63,10 @@ final class ConversationHandler extends SingletonFactory $conditionBuilder->add('conversation_to_user.leftAt = 0'); $sql = "SELECT COUNT(*) AS count - FROM wcf" . WCF_N . "_conversation_to_user conversation_to_user, - wcf" . WCF_N . "_conversation conversation + FROM wcf1_conversation_to_user conversation_to_user, + wcf1_conversation conversation " . $conditionBuilder; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute($conditionBuilder->getParameters()); $row = $statement->fetchArray(); $this->unreadConversationCount[$userID] = $row['count']; @@ -118,14 +118,14 @@ final class ConversationHandler extends SingletonFactory $sql = "SELECT ( SELECT COUNT(*) - FROM wcf" . WCF_N . "_conversation_to_user conversation_to_user + FROM wcf1_conversation_to_user conversation_to_user " . $conditionBuilder1 . " ) + ( SELECT COUNT(*) - FROM wcf" . WCF_N . "_conversation conversation + FROM wcf1_conversation conversation " . $conditionBuilder2 . " ) AS count"; - $statement = WCF::getDB()->prepareStatement($sql); + $statement = WCF::getDB()->prepare($sql); $statement->execute(\array_merge( $conditionBuilder1->getParameters(), $conditionBuilder2->getParameters() diff --git a/files/lib/system/event/listener/ConversationPruneIpAddressesCronjobListener.class.php b/files/lib/system/event/listener/ConversationPruneIpAddressesCronjobListener.class.php index 4f5e50c..096d732 100644 --- a/files/lib/system/event/listener/ConversationPruneIpAddressesCronjobListener.class.php +++ b/files/lib/system/event/listener/ConversationPruneIpAddressesCronjobListener.class.php @@ -20,6 +20,6 @@ class ConversationPruneIpAddressesCronjobListener implements IParameterizedEvent public function execute($eventObj, $className, $eventName, array &$parameters) { /** @var PruneIpAddressesCronjob $eventObj */ - $eventObj->columns['wcf' . WCF_N . '_conversation_message']['ipAddress'] = 'time'; + $eventObj->columns['wcf1_conversation_message']['ipAddress'] = 'time'; } } diff --git a/files/lib/system/event/listener/ConversationUserActionRenameListener.class.php b/files/lib/system/event/listener/ConversationUserActionRenameListener.class.php index 563b62a..41f108a 100644 --- a/files/lib/system/event/listener/ConversationUserActionRenameListener.class.php +++ b/files/lib/system/event/listener/ConversationUserActionRenameListener.class.php @@ -15,15 +15,15 @@ class ConversationUserActionRenameListener extends AbstractUserActionRenameListe * @inheritDoc */ protected $databaseTables = [ - 'wcf{WCF_N}_conversation', - 'wcf{WCF_N}_conversation_message', + 'wcf1_conversation', + 'wcf1_conversation_message', [ - 'name' => 'wcf{WCF_N}_conversation', + 'name' => 'wcf1_conversation', 'userID' => 'lastPosterID', 'username' => 'lastPoster', ], [ - 'name' => 'wcf{WCF_N}_conversation_to_user', + 'name' => 'wcf1_conversation_to_user', 'userID' => 'participantID', ], ]; diff --git a/files/lib/system/event/listener/ConversationUserMergeListener.class.php b/files/lib/system/event/listener/ConversationUserMergeListener.class.php index e250f64..75abd9e 100644 --- a/files/lib/system/event/listener/ConversationUserMergeListener.class.php +++ b/files/lib/system/event/listener/ConversationUserMergeListener.class.php @@ -15,14 +15,14 @@ class ConversationUserMergeListener extends AbstractUserMergeListener * @inheritDoc */ protected $databaseTables = [ - 'wcf{WCF_N}_conversation', - 'wcf{WCF_N}_conversation_message', + 'wcf1_conversation', + 'wcf1_conversation_message', [ - 'name' => 'wcf{WCF_N}_conversation_label', + 'name' => 'wcf1_conversation_label', 'username' => null, ], [ - 'name' => 'wcf{WCF_N}_conversation_to_user', + 'name' => 'wcf1_conversation_to_user', 'userID' => 'participantID', 'ignore' => true, ], diff --git a/files/lib/system/search/ConversationMessageSearch.class.php b/files/lib/system/search/ConversationMessageSearch.class.php index 1152437..f9aab10 100644 --- a/files/lib/system/search/ConversationMessageSearch.class.php +++ b/files/lib/system/search/ConversationMessageSearch.class.php @@ -70,10 +70,10 @@ final class ConversationMessageSearch extends AbstractSearchProvider */ public function getJoins(): string { - return " JOIN wcf" . WCF_N . "_conversation_to_user conversation_to_user + return " JOIN wcf1_conversation_to_user conversation_to_user ON conversation_to_user.participantID = " . WCF::getUser()->userID . " AND conversation_to_user.conversationID = " . $this->getTableName() . ".conversationID - LEFT JOIN wcf" . WCF_N . "_conversation conversation + LEFT JOIN wcf1_conversation conversation ON conversation.conversationID = " . $this->getTableName() . ".conversationID"; } @@ -82,7 +82,7 @@ final class ConversationMessageSearch extends AbstractSearchProvider */ public function getTableName(): string { - return 'wcf' . WCF_N . '_conversation_message'; + return 'wcf1_conversation_message'; } /** diff --git a/files/lib/system/stat/ConversationMessageStatDailyHandler.class.php b/files/lib/system/stat/ConversationMessageStatDailyHandler.class.php index 224404a..3753429 100644 --- a/files/lib/system/stat/ConversationMessageStatDailyHandler.class.php +++ b/files/lib/system/stat/ConversationMessageStatDailyHandler.class.php @@ -17,8 +17,8 @@ class ConversationMessageStatDailyHandler extends AbstractStatDailyHandler public function getData($date) { return [ - 'counter' => $this->getCounter($date, 'wcf' . WCF_N . '_conversation_message', 'time'), - 'total' => $this->getTotal($date, 'wcf' . WCF_N . '_conversation_message', 'time'), + 'counter' => $this->getCounter($date, 'wcf1_conversation_message', 'time'), + 'total' => $this->getTotal($date, 'wcf1_conversation_message', 'time'), ]; } } diff --git a/files/lib/system/stat/ConversationStatDailyHandler.class.php b/files/lib/system/stat/ConversationStatDailyHandler.class.php index cff7012..e771ccb 100644 --- a/files/lib/system/stat/ConversationStatDailyHandler.class.php +++ b/files/lib/system/stat/ConversationStatDailyHandler.class.php @@ -17,8 +17,8 @@ class ConversationStatDailyHandler extends AbstractStatDailyHandler public function getData($date) { return [ - 'counter' => $this->getCounter($date, 'wcf' . WCF_N . '_conversation', 'time'), - 'total' => $this->getTotal($date, 'wcf' . WCF_N . '_conversation', 'time'), + 'counter' => $this->getCounter($date, 'wcf1_conversation', 'time'), + 'total' => $this->getTotal($date, 'wcf1_conversation', 'time'), ]; } } diff --git a/files/lib/system/worker/ConversationMessageRebuildDataWorker.class.php b/files/lib/system/worker/ConversationMessageRebuildDataWorker.class.php index 77f0330..97adba3 100644 --- a/files/lib/system/worker/ConversationMessageRebuildDataWorker.class.php +++ b/files/lib/system/worker/ConversationMessageRebuildDataWorker.class.php @@ -57,7 +57,7 @@ class ConversationMessageRebuildDataWorker extends AbstractRebuildDataWorker $this->objectList->sqlOrderBy = 'conversation_message.messageID'; $this->objectList->sqlSelects = '( SELECT subject - FROM wcf' . WCF_N . '_conversation + FROM wcf1_conversation WHERE conversationID = conversation_message.conversationID ) AS subject'; } -- 2.20.1