$sql = "SELECT conversation_to_user.*, conversation.*
FROM wcf" . WCF_N . "_conversation conversation
LEFT JOIN wcf" . WCF_N . "_conversation_to_user conversation_to_user
- ON (
- conversation_to_user.participantID = ?
- AND conversation_to_user.conversationID = conversation.conversationID
- )
+ ON conversation_to_user.participantID = ?
+ AND conversation_to_user.conversationID = conversation.conversationID
WHERE conversation.conversationID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$userID, $conversationID]);
$sql = "SELECT conversation_to_user.*, conversation.*
FROM wcf" . WCF_N . "_conversation conversation
LEFT JOIN wcf" . WCF_N . "_conversation_to_user conversation_to_user
- ON (
- conversation_to_user.participantID = " . $userID . "
- AND conversation_to_user.conversationID = conversation.conversationID
- )
+ ON conversation_to_user.participantID = " . $userID . "
+ AND conversation_to_user.conversationID = conversation.conversationID
" . $conditionBuilder;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditionBuilder->getParameters());
$sql = "SELECT user_table.username
FROM wcf" . WCF_N . "_conversation_to_user conversation_to_user
LEFT JOIN wcf" . WCF_N . "_user user_table
- ON (user_table.userID = conversation_to_user.participantID)
+ ON user_table.userID = conversation_to_user.participantID
" . $conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
$sql = "SELECT DISTINCT conversation.conversationID
FROM wcf" . WCF_N . "_conversation conversation
LEFT JOIN wcf" . WCF_N . "_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
- )
+ 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->execute($conditionBuilder->getParameters());
);
}
}
- $this->sqlConditionJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON (user_table.userID = conversation_to_user.participantID)";
+ $this->sqlConditionJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = conversation_to_user.participantID";
if (!empty($this->sqlSelects)) {
$this->sqlSelects .= ',';
}
$this->sqlSelects = 'conversation_to_user.*';
- $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_conversation_to_user conversation_to_user ON (conversation_to_user.participantID = user_table.userID AND conversation_to_user.conversationID = " . $conversationID . ")";
+ $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_conversation_to_user conversation_to_user ON conversation_to_user.participantID = user_table.userID AND conversation_to_user.conversationID = " . $conversationID;
}
/**
$this->getConditionBuilder()->add('conversation_to_user.participantID = ?', [$userID]);
$this->getConditionBuilder()
->add('conversation_to_user.hideConversation = ?', [$this->filter == 'hidden' ? 1 : 0]);
- $this->sqlConditionJoins = "LEFT JOIN wcf" . WCF_N . "_conversation conversation ON (conversation.conversationID = conversation_to_user.conversationID)";
+ $this->sqlConditionJoins = "LEFT JOIN wcf" . WCF_N . "_conversation conversation ON conversation.conversationID = conversation_to_user.conversationID";
if ($this->filter == 'outbox') {
$this->getConditionBuilder()->add('conversation.userID = ?', [$userID]);
}
// own posts
$this->sqlSelects = "DISTINCT conversation_message.userID AS ownPosts";
- $this->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_conversation_message conversation_message ON (conversation_message.conversationID = conversation.conversationID AND conversation_message.userID = " . $userID . ")";
+ $this->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_conversation_message conversation_message ON conversation_message.conversationID = conversation.conversationID AND conversation_message.userID = " . $userID;
// user info
if (!empty($this->sqlSelects)) {
$this->sqlSelects .= ',';
}
$this->sqlSelects .= "conversation_to_user.*";
- $this->sqlJoins .= "LEFT JOIN wcf" . WCF_N . "_conversation_to_user conversation_to_user ON (conversation_to_user.participantID = " . $userID . " AND conversation_to_user.conversationID = conversation.conversationID)";
+ $this->sqlJoins .= "LEFT JOIN wcf" . WCF_N . "_conversation_to_user conversation_to_user ON conversation_to_user.participantID = " . $userID . " AND conversation_to_user.conversationID = conversation.conversationID";
if ($this->filter !== 'draft') {
$this->sqlSelects .= ", conversation.*, CASE WHEN conversation_to_user.leftAt <> 0 THEN conversation_to_user.leftAt ELSE conversation.lastPostTime END AS lastPostTime";
$this->sqlSelects .= ',';
}
$this->sqlSelects .= 'conversation.subject';
- $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_conversation conversation ON (conversation.conversationID = conversation_message.conversationID)";
+ $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_conversation conversation ON conversation.conversationID = conversation_message.conversationID";
}
}
$this->items = new FeedConversationList();
$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 ON (conversation.conversationID = conversation_to_user.conversationID)";
+ $this->items->sqlConditionJoins = "LEFT JOIN wcf" . WCF_N . "_conversation conversation ON conversation.conversationID = conversation_to_user.conversationID";
$this->items->sqlLimit = 20;
$this->items->readObjects();
public function getJoins()
{
return " JOIN wcf" . WCF_N . "_conversation_to_user conversation_to_user
- ON (
- conversation_to_user.participantID = " . WCF::getUser()->userID . "
- AND conversation_to_user.conversationID = " . $this->getTableName() . ".conversationID
- )
+ ON conversation_to_user.participantID = " . WCF::getUser()->userID . "
+ AND conversation_to_user.conversationID = " . $this->getTableName() . ".conversationID
LEFT JOIN wcf" . WCF_N . "_conversation conversation
- ON (conversation.conversationID = " . $this->getTableName() . ".conversationID)";
+ ON conversation.conversationID = " . $this->getTableName() . ".conversationID";
}
/**
$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
- ON (user_table.userID = conversation_to_user.participantID)
+ ON user_table.userID = conversation_to_user.participantID
WHERE conversation_to_user.conversationID = ?
AND conversation_to_user.participantID <> ?
AND conversation_to_user.isInvisible = ?