if ($this->count === null) {
$this->count = 0;
$sql = "SELECT MAX(messageID) AS messageID
- FROM wcf" . WCF_N . "_conversation_message";
- $statement = WCF::getDB()->prepareStatement($sql);
+ FROM wcf1_conversation_message";
+ $statement = WCF::getDB()->prepare($sql);
$statement->execute();
$row = $statement->fetchArray();
if ($row !== false) {
$attachmentObjectType = ObjectTypeCache::getInstance()
->getObjectTypeByName('com.woltlab.wcf.attachment.objectType', 'com.woltlab.wcf.conversation.message');
$sql = "SELECT COUNT(*) AS attachments
- FROM wcf" . WCF_N . "_attachment
+ FROM wcf1_attachment
WHERE objectTypeID = ?
AND objectID = ?";
- $attachmentStatement = WCF::getDB()->prepareStatement($sql);
+ $attachmentStatement = WCF::getDB()->prepare($sql);
// retrieve permissions
$userIDs = [];
$updateData[$message->messageID] = $data;
}
- $sql = "UPDATE wcf" . WCF_N . "_conversation_message
+ $sql = "UPDATE wcf1_conversation_message
SET attachments = ?,
message = ?,
enableHtml = ?,
hasEmbeddedObjects = ?
WHERE messageID = ?";
- $statement = WCF::getDB()->prepareStatement($sql);
+ $statement = WCF::getDB()->prepare($sql);
WCF::getDB()->beginTransaction();
foreach ($updateData as $messageID => $data) {
if ($this->count === null) {
$this->count = 0;
$sql = "SELECT MAX(conversationID) AS conversationID
- FROM wcf" . WCF_N . "_conversation";
- $statement = WCF::getDB()->prepareStatement($sql);
+ FROM wcf1_conversation";
+ $statement = WCF::getDB()->prepare($sql);
$statement->execute();
$row = $statement->fetchArray();
if ($row !== false) {
// prepare statements
$sql = "SELECT messageID, time, userID, username
- FROM wcf" . WCF_N . "_conversation_message
+ FROM wcf1_conversation_message
WHERE conversationID = ?
ORDER BY time";
- $firstMessageStatement = WCF::getDB()->prepareStatement($sql, 1);
+ $firstMessageStatement = WCF::getDB()->prepare($sql, 1);
$sql = "SELECT time, userID, username
- FROM wcf" . WCF_N . "_conversation_message
+ FROM wcf1_conversation_message
WHERE conversationID = ?
ORDER BY time DESC";
- $lastMessageStatement = WCF::getDB()->prepareStatement($sql, 1);
+ $lastMessageStatement = WCF::getDB()->prepare($sql, 1);
$sql = "SELECT COUNT(*) AS messages,
SUM(attachments) AS attachments
- FROM wcf" . WCF_N . "_conversation_message
+ FROM wcf1_conversation_message
WHERE conversationID = ?";
- $statsStatement = WCF::getDB()->prepareStatement($sql);
+ $statsStatement = WCF::getDB()->prepare($sql);
$sql = "SELECT COUNT(*) AS participants
- FROM wcf" . WCF_N . "_conversation_to_user conversation_to_user
+ FROM wcf1_conversation_to_user conversation_to_user
WHERE conversation_to_user.conversationID = ?
AND conversation_to_user.hideConversation <> ?
AND conversation_to_user.participantID <> ?
AND conversation_to_user.isInvisible = ?";
- $participantCounterStatement = WCF::getDB()->prepareStatement($sql);
+ $participantCounterStatement = WCF::getDB()->prepare($sql);
$sql = "SELECT conversation_to_user.participantID AS userID, conversation_to_user.hideConversation, 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
WHERE conversation_to_user.conversationID = ?
AND conversation_to_user.participantID <> ?
AND conversation_to_user.isInvisible = ?
ORDER BY user_table.username";
- $participantStatement = WCF::getDB()->prepareStatement($sql, 5);
+ $participantStatement = WCF::getDB()->prepare($sql, 5);
$sql = "SELECT COUNT(*) AS participants
- FROM wcf" . WCF_N . "_conversation_to_user
+ FROM wcf1_conversation_to_user
WHERE conversationID = ?
AND hideConversation <> ?
AND participantID IS NOT NULL";
- $existingParticipantStatement = WCF::getDB()->prepareStatement($sql);
+ $existingParticipantStatement = WCF::getDB()->prepare($sql);
$obsoleteConversations = [];
$updateData = [];
$updateData[$conversation->conversationID] = $data;
}
- $sql = "UPDATE wcf" . WCF_N . "_conversation
+ $sql = "UPDATE wcf1_conversation
SET firstMessageID = ?,
lastPostTime = ?,
lastPosterID = ?,
participants = ?,
participantSummary = ?
WHERE conversationID = ?";
- $statement = WCF::getDB()->prepareStatement($sql);
+ $statement = WCF::getDB()->prepare($sql);
WCF::getDB()->beginTransaction();
foreach ($updateData as $conversationID => $data) {