$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditionBuilder->getParameters());
$conversations = [];
- while (($row = $statement->fetchArray())) {
+ while ($row = $statement->fetchArray()) {
$conversations[$row['conversationID']] = new Conversation(null, $row);
}
".$conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
- while (($row = $statement->fetchArray())) {
+ while ($row = $statement->fetchArray()) {
$index = array_search($row['conversationID'], $conversationIDs);
unset($conversationIDs[$index]);
}
".$conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
- while (($row = $statement->fetchArray())) {
+ while ($row = $statement->fetchArray()) {
$index = array_search($row['conversationID'], $conversationIDs);
unset($conversationIDs[$index]);
}
'data' => $messageData,
'conversation' => $conversation,
'isFirstPost' => true,
- 'attachmentHandler' => (isset($this->parameters['attachmentHandler']) ? $this->parameters['attachmentHandler'] : null),
- 'htmlInputProcessor' => (isset($this->parameters['htmlInputProcessor']) ? $this->parameters['htmlInputProcessor'] : null)
+ 'attachmentHandler' => isset($this->parameters['attachmentHandler']) ? $this->parameters['attachmentHandler'] : null,
+ 'htmlInputProcessor' => isset($this->parameters['htmlInputProcessor']) ? $this->parameters['htmlInputProcessor'] : null
]);
$resultValues = $messageAction->executeAction();
* Validates parameters to hide conversations.
*/
public function validateHideConversation() {
- $this->parameters['hideConversation'] = (isset($this->parameters['hideConversation'])) ? intval($this->parameters['hideConversation']) : null;
+ $this->parameters['hideConversation'] = isset($this->parameters['hideConversation']) ? intval($this->parameters['hideConversation']) : null;
if ($this->parameters['hideConversation'] === null || !in_array($this->parameters['hideConversation'], [Conversation::STATE_DEFAULT, Conversation::STATE_HIDDEN, Conversation::STATE_LEFT])) {
throw new UserInputException('hideConversation');
}
$statement->execute($conditionBuilder->getParameters());
$objectIDs = [];
- while (($row = $statement->fetchArray())) {
+ while ($row = $statement->fetchArray()) {
if (!$row['messages']) {
continue;
}
".$conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
- while (($row = $statement->fetchArray())) {
+ while ($row = $statement->fetchArray()) {
$usernames[$row['userID']] = $row['username'];
}
}
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$this->conversationID]);
$i = 0;
- while (($row = $statement->fetchArray())) {
+ while ($row = $statement->fetchArray()) {
// create fake user profiles
$this->objects['x'.(++$i)] = UserProfile::getGuestUserProfile($row['username']);
$this->indexToObject[] = 'x'.$i;
}
else {
$this->getConditionBuilder()->add('conversation_to_user.participantID = ?', [$userID]);
- $this->getConditionBuilder()->add('conversation_to_user.hideConversation = ?', [($this->filter == 'hidden' ? 1 : 0)]);
+ $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)";
if ($this->filter == 'outbox') $this->getConditionBuilder()->add('conversation.userID = ?', [$userID]);
}
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
$data = [];
- while (($row = $statement->fetchArray())) {
+ while ($row = $statement->fetchArray()) {
if (!isset($data[$row['conversationID']])) {
$data[$row['conversationID']] = [];
}
".$conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
- while (($row = $statement->fetchArray())) {
+ while ($row = $statement->fetchArray()) {
$conversation->assignLabel($labels[$row['labelID']]);
}
}
}
// validate conversation id
- $this->parameters['conversationIDs'] = (isset($this->parameters['conversationIDs'])) ? ArrayUtil::toIntegerArray($this->parameters['conversationIDs']) : [];
+ $this->parameters['conversationIDs'] = isset($this->parameters['conversationIDs']) ? ArrayUtil::toIntegerArray($this->parameters['conversationIDs']) : [];
if (empty($this->parameters['conversationIDs'])) {
throw new UserInputException('conversationID');
}
$this->parameters['htmlInputProcessor']->setObjectID($message->messageID);
if ($message->hasEmbeddedObjects != MessageEmbeddedObjectManager::getInstance()->registerObjects($this->parameters['htmlInputProcessor'])) {
- $message->update(['hasEmbeddedObjects' => ($message->hasEmbeddedObjects ? 0 : 1)]);
+ $message->update(['hasEmbeddedObjects' => $message->hasEmbeddedObjects ? 0 : 1]);
}
}
}
'time' => TIME_NOW,
'userID' => WCF::getUser()->userID,
'username' => WCF::getUser()->username,
- 'isDraft' => ($this->draft ? 1 : 0),
+ 'isDraft' => $this->draft ? 1 : 0,
'participantCanInvite' => $this->participantCanInvite
]);
if ($this->draft) {
}
// get participants
- $this->participantList = new ConversationParticipantList($this->conversationID, WCF::getUser()->userID, ($this->conversation->userID == WCF::getUser()->userID));
+ $this->participantList = new ConversationParticipantList($this->conversationID, WCF::getUser()->userID, $this->conversation->userID == WCF::getUser()->userID);
$this->participantList->readObjects();
// init quote objects
".$conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
- while (($row = $statement->fetchArray())) {
+ while ($row = $statement->fetchArray()) {
$index = array_search($row['conversationID'], $conversationIDs);
unset($conversationIDs[$index]);
}
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
$lastVisitTime = [];
- while (($row = $statement->fetchArray())) {
+ while ($row = $statement->fetchArray()) {
$lastVisitTime[$row['conversationID']] = $row['lastVisitTime'];
}
// get participant summary
$participantStatement->execute([$conversation->conversationID, $conversation->userID, 0]);
$users = [];
- while (($row = $participantStatement->fetchArray())) {
+ while ($row = $participantStatement->fetchArray()) {
$users[] = $row;
}
$data['participantSummary'] = serialize($users);