Use `Database::prepare()` instead of `Database::prepareStatement()`.
authorCyperghost <olaf_schmitz_1@t-online.de>
Wed, 30 Oct 2024 09:24:41 +0000 (10:24 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Wed, 30 Oct 2024 09:24:41 +0000 (10:24 +0100)
24 files changed:
files/lib/data/conversation/Conversation.class.php
files/lib/data/conversation/ConversationAction.class.php
files/lib/data/conversation/ConversationEditor.class.php
files/lib/data/conversation/ConversationParticipantList.class.php
files/lib/data/conversation/FeedConversationList.class.php
files/lib/data/conversation/UserConversationList.class.php
files/lib/data/conversation/ViewableConversation.class.php
files/lib/data/conversation/label/ConversationLabelAction.class.php
files/lib/data/conversation/message/ConversationMessageAction.class.php
files/lib/data/conversation/message/SearchResultConversationMessageList.class.php
files/lib/data/modification/log/ConversationLogModificationLogList.class.php
files/lib/form/ConversationDraftEditForm.class.php
files/lib/page/ConversationFeedPage.class.php
files/lib/page/ConversationListPage.class.php
files/lib/page/ConversationPage.class.php
files/lib/system/clipboard/action/ConversationClipboardAction.class.php
files/lib/system/conversation/ConversationHandler.class.php
files/lib/system/event/listener/ConversationPruneIpAddressesCronjobListener.class.php
files/lib/system/event/listener/ConversationUserActionRenameListener.class.php
files/lib/system/event/listener/ConversationUserMergeListener.class.php
files/lib/system/search/ConversationMessageSearch.class.php
files/lib/system/stat/ConversationMessageStatDailyHandler.class.php
files/lib/system/stat/ConversationStatDailyHandler.class.php
files/lib/system/worker/ConversationMessageRebuildDataWorker.class.php

index abb8fb21bf7a1440b5eef9b2f73d41d8a2cfeb7f..3d6bf1c567ad4e442c9b1c268f6aecd13542efec 100644 (file)
@@ -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;
index 65853a13251f2e5fcc1e124950f280a4c157edcb..1afa8a11ec265a25e142a3ad2c82d39917653bd1 100644 (file)
@@ -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 = [];
index 149167d1dbe1676869e2999648910a98c5829b30..dea31864ddf7e9199585f0d1b3336e918bec571a 100644 (file)
@@ -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,
         ]);
index fc5db5e61fbb3df43ca44e9f0dff1ff47d96c765..f43944d0cd34c1a1f8d8d25d6a3fc85b399ce450 100644 (file)
@@ -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()) {
index 4d1c732994c210358a21e3f2a57b80fdddfef12f..63e280c89367516a680b8ed786448665e06146b5 100644 (file)
@@ -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);
     }
index 8a759ad504c9370410fd54919943be1f42a0bb93..331805aac0816f1f9d390b14c930f04d7a846c1d 100644 (file)
@@ -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()) {
index e6e5e2d17fd372c71136a5a95d32aa29ef655144..6a7126eabcf9cf0ff0abb6d2ee34f59b62e86b8b 100644 (file)
@@ -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']]);
index 9a3f4323bf4b1ca193e0c6af9e0930e96a8936a9..11c3c743807fa01aae9f3d944a41c58606e9de5a 100644 (file)
@@ -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) {
index d95f48db46e12ede6c398e894857ceef882d4806..8e0ce9105234eaf9f2c96f93b8d2ae18e057cce2 100644 (file)
@@ -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();
 
index a5449d581f09cfa5fe8cd4af6df0ec08fc4a93ca..365dc8f3f8439ae583cf6ecd181a762898cf112c 100644 (file)
@@ -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";
     }
 }
index 919f285dd08121bcbb404709ed4acc50389bfec8..c4ac1811dec2f9cd0163a69e939babd64ac17349 100644 (file)
@@ -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));
 
index c373385c1addd159c2510604b8bbce5f5d7683b8..c72b480863cbe9cb467778f87eb90db402f4a863 100644 (file)
@@ -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})) {
index ed5798480c748c76a46341e309a9b3ceb2cf2474..e7dfe70145da9c174d9fe8c196dfcf5951b6d682 100644 (file)
@@ -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();
index 3c9897ef0b7456fa0180dc0d82d96360e6f705b4..b7e4095fd4400c3e521a4c3ce70d4cbd0a7833ca 100644 (file)
@@ -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
index 3c7898a013a6017b1d45ce6d1052f0209c06f35a..0d58f2bc070abe315a36862bae1bb25f874dedaf 100644 (file)
@@ -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) {
index cddeb69af387a3d0248a6c8d442734d47aed5a51..76268da08832095a9d838583e42c5edb592dc73a 100644 (file)
@@ -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);
index da0befc724748196f5eb6cd0ea29e25cfea0ed26..7a8e2d9bf35a1b1a190470b0e5b35af0e650be4d 100644 (file)
@@ -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()
index 4f5e50c2106b131b43cde7a09b7d5bd278a55b7f..096d73245be3c5a8eca35fa43ef5683b70dfb269 100644 (file)
@@ -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';
     }
 }
index 563b62af02a0f520a62e7fe2a689f9218d9f7020..41f108ab48f9dea96125b4759102199d98b112ec 100644 (file)
@@ -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',
         ],
     ];
index e250f643f37e6b4072a15bc228390b372fece5f9..75abd9e1f69fa05da0daedfc8de1c21437d9f541 100644 (file)
@@ -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,
         ],
index 11524374b8f0068b4815463b594fdde873f9b7f8..f9aab10e457522376e8767b0c45ed59cb14dbae6 100644 (file)
@@ -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';
     }
 
     /**
index 224404ac04d1ea185881296da80790e5965e62c1..3753429d7c179b1e8c2caf5fdd757cefad3f2319 100644 (file)
@@ -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'),
         ];
     }
 }
index cff7012a54e752c4ff59eee0a4195f748d70685f..e771ccbdd1c35a604bba904fcc17cf986b1c31b9 100644 (file)
@@ -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'),
         ];
     }
 }
index 77f033065391e4cf15540c15847c3dfceaf27776..97adba353bef9ed639218c13bbf6c8d9cab82927 100644 (file)
@@ -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';
     }