$sql = "SELECT user_table.userID
FROM wcf" . WCF_N . "_user user_table
LEFT JOIN wcf" . WCF_N . "_user_option_value option_value
- ON (option_value.userID = user_table.userID)
+ ON option_value.userID = user_table.userID
WHERE banned = ?";
$statement = WCF::getDB()->prepareStatement($sql, $this->maxResults);
$statement->execute([1]);
$sql = "SELECT user_table.userID
FROM wcf" . WCF_N . "_user user_table
LEFT JOIN wcf" . WCF_N . "_user_option_value option_value
- ON (option_value.userID = user_table.userID)
+ ON option_value.userID = user_table.userID
ORDER BY user_table.registrationDate DESC";
$statement = WCF::getDB()->prepareStatement($sql, $this->maxResults);
$statement->execute();
$sql = "SELECT user_table.userID
FROM wcf" . WCF_N . "_user user_table
LEFT JOIN wcf" . WCF_N . "_user_option_value option_value
- ON (option_value.userID = user_table.userID)
+ ON option_value.userID = user_table.userID
WHERE activationCode <> ?
ORDER BY user_table.registrationDate DESC";
$statement = WCF::getDB()->prepareStatement($sql, $this->maxResults);
$sql = "SELECT user_table.userID
FROM wcf" . WCF_N . "_user user_table
LEFT JOIN wcf" . WCF_N . "_user_option_value option_value
- ON (option_value.userID = user_table.userID)
+ ON option_value.userID = user_table.userID
" . $conditionBuilder . "
ORDER BY user_table.registrationDate DESC";
$statement = WCF::getDB()->prepareStatement($sql, $this->maxResults);
$sql = "SELECT user_table.userID
FROM wcf" . WCF_N . "_user user_table
LEFT JOIN wcf" . WCF_N . "_user_option_value option_value
- ON (option_value.userID = user_table.userID)
+ ON option_value.userID = user_table.userID
WHERE disableAvatar = ?";
$statement = WCF::getDB()->prepareStatement($sql, $this->maxResults);
$statement->execute([1]);
$sql = "SELECT user_table.userID
FROM wcf" . WCF_N . "_user user_table
LEFT JOIN wcf" . WCF_N . "_user_option_value option_value
- ON (option_value.userID = user_table.userID)
+ ON option_value.userID = user_table.userID
WHERE disableSignature = ?";
$statement = WCF::getDB()->prepareStatement($sql, $this->maxResults);
$statement->execute([1]);
protected function search()
{
$this->userList = new UserList();
- $this->userList->sqlConditionJoins .= " LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON (user_option_value.userID = user_table.userID)";
+ $this->userList->sqlConditionJoins .= " LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON user_option_value.userID = user_table.userID";
$this->userList->sqlLimit = $this->maxResults;
EventHandler::getInstance()->fireAction($this, 'search');
parent::initObjectList();
$this->objectList->sqlSelects = "cronjob.*";
- $this->objectList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_cronjob cronjob ON (cronjob.cronjobID = cronjob_log.cronjobID)";
+ $this->objectList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_cronjob cronjob ON cronjob.cronjobID = cronjob_log.cronjobID";
if ($this->cronjobID) {
$this->objectList->getConditionBuilder()->add('cronjob_log.cronjobID = ?', [$this->cronjobID]);
parent::initObjectList();
$this->objectList->sqlSelects = "label_group.groupName, label_group.groupDescription";
- $this->objectList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_label_group label_group ON (label_group.groupID = label.groupID)";
+ $this->objectList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_label_group label_group ON label_group.groupID = label.groupID";
if ($this->labelGroup) {
$this->objectList->getConditionBuilder()->add('label.groupID = ?', [$this->labelGroup->groupID]);
}
$this->objectList->sqlSelects = 'user_table.username, paid_subscription.title';
- $this->objectList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_user user_table ON (user_table.userID = paid_subscription_transaction_log.userID)";
- $this->objectList->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_paid_subscription paid_subscription ON (paid_subscription.subscriptionID = paid_subscription_transaction_log.subscriptionID)";
+ $this->objectList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = paid_subscription_transaction_log.userID";
+ $this->objectList->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_paid_subscription paid_subscription ON paid_subscription.subscriptionID = paid_subscription_transaction_log.subscriptionID";
}
/**
$this->objectList->getConditionBuilder()->add('paid_subscription_user.isActive = ?', [1]);
$this->objectList->sqlSelects = 'user_table.username, paid_subscription.title';
- $this->objectList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_user user_table ON (user_table.userID = paid_subscription_user.userID)";
- $this->objectList->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_paid_subscription paid_subscription ON (paid_subscription.subscriptionID = paid_subscription_user.subscriptionID)";
+ $this->objectList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = paid_subscription_user.userID";
+ $this->objectList->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_paid_subscription paid_subscription ON paid_subscription.subscriptionID = paid_subscription_user.subscriptionID";
}
/**
// get user ids
$sql = "SELECT user_table.userID
FROM wcf" . WCF_N . "_user user_table
- " . (isset($this->options[$this->sortField]) ? "LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON (user_option_value.userID = user_table.userID)" : '') . "
+ " . (isset($this->options[$this->sortField]) ? "LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON user_option_value.userID = user_table.userID" : '') . "
" . $this->conditions . "
ORDER BY " . (($this->sortField != 'email' && isset($this->options[$this->sortField])) ? 'user_option_value.userOption' . $this->options[$this->sortField]->optionID : $this->sortField) . " " . $this->sortOrder;
$statement = WCF::getDB()->prepareStatement(
$sql = "SELECT user_avatar.*, option_value.*, user_table.*
FROM wcf" . WCF_N . "_user user_table
LEFT JOIN wcf" . WCF_N . "_user_option_value option_value
- ON (option_value.userID = user_table.userID)
+ ON option_value.userID = user_table.userID
LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar
- ON (user_avatar.avatarID = user_table.avatarID)
+ ON user_avatar.avatarID = user_table.avatarID
" . $conditions . "
ORDER BY " . (($this->sortField != 'email' && isset($this->options[$this->sortField])) ? 'option_value.userOption' . $this->options[$this->sortField]->optionID : 'user_table.' . $this->sortField) . " " . $this->sortOrder;
$statement = WCF::getDB()->prepareStatement($sql);
parent::initObjectList();
$this->objectList->sqlSelects = 'user_group.groupName';
- $this->objectList->sqlJoins = 'LEFT JOIN wcf' . WCF_N . '_user_group user_group ON (user_group.groupID = user_rank.groupID)';
+ $this->objectList->sqlJoins = 'LEFT JOIN wcf' . WCF_N . '_user_group user_group ON user_group.groupID = user_rank.groupID';
}
}
$this->sqlSelects .= (!empty($this->sqlSelects) ? ', ' : '') . "COALESCE(" . $matchTable . ".languageItemValue, " . $this->getDatabaseTableAlias() . "." . $key . ") AS " . $value;
$this->sqlJoins .= "
LEFT JOIN wcf" . WCF_N . "_language_item " . $matchTable . "
- ON (
- " . $matchTable . ".languageItem = " . $this->getDatabaseTableAlias() . "." . $key . "
- AND " . $matchTable . ".languageID = " . $languageID . "
- )";
+ ON " . $matchTable . ".languageItem = " . $this->getDatabaseTableAlias() . "." . $key . "
+ AND " . $matchTable . ".languageID = " . $languageID;
}
}
}
$sql = "SELECT acp_session_log.*, user_table.username, 0 AS active
FROM wcf" . WCF_N . "_acp_session_log acp_session_log
LEFT JOIN wcf" . WCF_N . "_user user_table
- ON (user_table.userID = acp_session_log.userID)
+ ON user_table.userID = acp_session_log.userID
WHERE acp_session_log.sessionLogID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$id]);
) AS accesses";
$this->sqlJoins .= "
- LEFT JOIN wcf" . WCF_N . "_user user_table
- ON (user_table.userID = " . $this->getDatabaseTableAlias() . ".userID)";
+ LEFT JOIN wcf" . WCF_N . "_user user_table
+ ON user_table.userID = " . $this->getDatabaseTableAlias() . ".userID";
parent::readObjects();
}
$sql = "SELECT COUNT(*)
FROM wcf" . WCF_N . "_article article
LEFT JOIN wcf" . WCF_N . "_tracked_visit tracked_visit
- ON (
- tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.article') . "
- AND tracked_visit.objectID = article.articleID
- AND tracked_visit.userID = " . WCF::getUser()->userID . "
- )
+ ON tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.article') . "
+ AND tracked_visit.objectID = article.articleID
+ AND tracked_visit.userID = " . WCF::getUser()->userID . "
" . $conditionBuilder;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditionBuilder->getParameters());
$sql = "SELECT COUNT(*)
FROM wcf" . WCF_N . "_article article
LEFT JOIN wcf" . WCF_N . "_tracked_visit tracked_visit
- ON (
- tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.article') . "
- AND tracked_visit.objectID = article.articleID
- AND tracked_visit.userID = " . WCF::getUser()->userID . "
- )
+ ON tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.article') . "
+ AND tracked_visit.objectID = article.articleID
+ AND tracked_visit.userID = " . WCF::getUser()->userID . "
" . $conditionBuilder;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditionBuilder->getParameters());
$sql = "SELECT COUNT(*)
FROM wcf" . WCF_N . "_article article
LEFT JOIN wcf" . WCF_N . "_tracked_visit tracked_visit
- ON (
- tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.article') . "
- AND tracked_visit.objectID = article.articleID
- AND tracked_visit.userID = " . WCF::getUser()->userID . "
- )
+ ON tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.article') . "
+ AND tracked_visit.objectID = article.articleID
+ AND tracked_visit.userID = " . WCF::getUser()->userID . "
" . $conditionBuilder;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditionBuilder->getParameters());
$this->sqlSelects .= ',';
}
$this->sqlSelects .= 'tracked_visit.visitTime';
- $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_tracked_visit tracked_visit ON (tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.article') . " AND tracked_visit.objectID = article.articleID AND tracked_visit.userID = " . WCF::getUser()->userID . ")";
+ $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_tracked_visit tracked_visit ON tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.article') . " AND tracked_visit.objectID = article.articleID AND tracked_visit.userID = " . WCF::getUser()->userID;
}
if (!empty($this->sqlSelects)) {
$this->sqlSelects .= ',';
}
$this->sqlSelects .= "like_object.cachedReactions";
- $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_like_object like_object ON (like_object.objectTypeID = " . ReactionHandler::getInstance()->getObjectType('com.woltlab.wcf.likeableArticle')->objectTypeID . " AND like_object.objectID = article.articleID)";
+ $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_like_object like_object ON like_object.objectTypeID = " . ReactionHandler::getInstance()->getObjectType('com.woltlab.wcf.likeableArticle')->objectTypeID . " AND like_object.objectID = article.articleID";
}
/**
parent::__construct();
$this->sqlSelects = 'user_table.username';
- $this->sqlJoins = " LEFT JOIN wcf" . WCF_N . "_user user_table ON (user_table.userID = attachment.userID)";
+ $this->sqlJoins = " LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = attachment.userID";
}
/**
$sql = "SELECT comment.objectTypeID, comment_response.responseID
FROM wcf" . WCF_N . "_comment_response comment_response
LEFT JOIN wcf" . WCF_N . "_comment comment
- ON (comment.commentID = comment_response.commentID)
+ ON comment.commentID = comment_response.commentID
" . $conditionBuilder;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditionBuilder->getParameters());
$sql = "DELETE devtools_missing_language_item
FROM wcf" . WCF_N . "_devtools_missing_language_item devtools_missing_language_item
INNER JOIN wcf" . WCF_N . "_language_item language_item
- ON (
- language_item.languageItem = devtools_missing_language_item.languageItem
- AND language_item.languageID = devtools_missing_language_item.languageID
- )";
+ ON language_item.languageItem = devtools_missing_language_item.languageItem
+ AND language_item.languageID = devtools_missing_language_item.languageID";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute();
}
languageCategory
FROM wcf" . WCF_N . "_language_item language_item
LEFT JOIN wcf" . WCF_N . "_language_category language_category
- ON (language_category.languageCategoryID = language_item.languageCategoryID)
+ ON language_category.languageCategoryID = language_item.languageCategoryID
" . $conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
$searchString = '%' . \addcslashes($searchString, '_%') . '%';
- $this->sqlConditionJoins .= ' LEFT JOIN wcf' . WCF_N . '_media_content media_content ON (media_content.mediaID = media.mediaID)';
+ $this->sqlConditionJoins .= ' LEFT JOIN wcf' . WCF_N . '_media_content media_content ON media_content.mediaID = media.mediaID';
$conditionBuilder = new PreparedStatementConditionBuilder(false, 'OR');
$conditionBuilder->add('media_content.title LIKE ?', [$searchString]);
// fetch content data
$this->sqlSelects .= "media_content.*, COALESCE(media.languageID, " . $languageID . ") AS localizedLanguageID";
- $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_media_content media_content ON (media_content.mediaID = media.mediaID AND media_content.languageID = COALESCE(media.languageID, " . $languageID . "))";
+ $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_media_content media_content ON media_content.mediaID = media.mediaID AND media_content.languageID = COALESCE(media.languageID, " . $languageID . ")";
}
}
$sql = "SELECT moderation_queue.queueID
FROM wcf" . WCF_N . "_moderation_queue_to_user moderation_queue_to_user
LEFT JOIN wcf" . WCF_N . "_moderation_queue moderation_queue
- ON (moderation_queue.queueID = moderation_queue_to_user.queueID)
+ ON moderation_queue.queueID = moderation_queue_to_user.queueID
LEFT JOIN wcf" . WCF_N . "_tracked_visit tracked_visit
- ON (
- tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.moderation.queue') . "
- AND tracked_visit.objectID = moderation_queue.queueID
- AND tracked_visit.userID = " . WCF::getUser()->userID . "
- )
+ ON tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.moderation.queue') . "
+ AND tracked_visit.objectID = moderation_queue.queueID
+ AND tracked_visit.userID = " . WCF::getUser()->userID . "
" . $conditions . "
ORDER BY moderation_queue.lastChangeTime DESC";
$statement = WCF::getDB()->prepareStatement($sql, $MAX_ITEMS);
$this->sqlSelects = "moderation_queue.*, assigned_user.username AS assignedUsername, user_table.username";
$this->sqlConditionJoins = ", wcf" . WCF_N . "_moderation_queue moderation_queue";
$this->sqlJoins = ", wcf" . WCF_N . "_moderation_queue moderation_queue";
- $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user assigned_user ON (assigned_user.userID = moderation_queue.assignedUserID)";
- $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON (user_table.userID = moderation_queue.userID)";
+ $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user assigned_user ON assigned_user.userID = moderation_queue.assignedUserID";
+ $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = moderation_queue.userID";
$this->getConditionBuilder()->add("moderation_queue_to_user.queueID = moderation_queue.queueID");
$this->getConditionBuilder()->add("moderation_queue_to_user.userID = ?", [WCF::getUser()->userID]);
$this->getConditionBuilder()->add("moderation_queue_to_user.isAffected = ?", [1]);
$sql = "SELECT package_update.packageUpdateID
FROM wcf" . WCF_N . "_package_update package_update
LEFT JOIN wcf" . WCF_N . "_package package
- ON (package.package = package_update.package)
+ ON package.package = package_update.package
" . $conditions . "
ORDER BY package_update.packageName ASC";
$statement = WCF::getDB()->prepareStatement($sql, 1000);
$sql = "SELECT pu.package, puv.packageUpdateVersionID, puv.packageUpdateID, puv.packageVersion, puv.isAccessible
FROM wcf" . WCF_N . "_package_update_version puv
LEFT JOIN wcf" . WCF_N . "_package_update pu
- ON (pu.packageUpdateID = puv.packageUpdateID)
+ ON pu.packageUpdateID = puv.packageUpdateID
" . $conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
$sql = "SELECT variable.variableName, variable.defaultValue, value.variableValue
FROM wcf" . WCF_N . "_style_variable variable
LEFT JOIN wcf" . WCF_N . "_style_variable_value value
- ON (value.variableID = variable.variableID AND value.styleID = ?)
+ ON value.variableID = variable.variableID
+ AND value.styleID = ?
ORDER BY variable.variableID ASC";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$this->styleID]);
$sql = "SELECT variable.variableName
FROM wcf" . WCF_N . "_style_variable variable
LEFT JOIN wcf" . WCF_N . "_style_variable_value variable_value
- ON (
- variable_value.variableID = variable.variableID
- AND variable_value.styleID = ?
- )
+ ON variable_value.variableID = variable.variableID
+ AND variable_value.styleID = ?
WHERE variable.variableName LIKE ?
AND variable_value.variableValue IS NULL";
$statement = WCF::getDB()->prepareStatement($sql);
$sql = "SELECT language.languageCode, language_item.languageItemValue
FROM wcf" . WCF_N . "_language_item language_item
LEFT JOIN wcf" . WCF_N . "_language language
- ON (language.languageID = language_item.languageID)
+ ON language.languageID = language_item.languageID
WHERE language_item.languageItem = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$this->styleDescription]);
$sql = "SELECT variable.variableName, value.variableValue
FROM wcf" . WCF_N . "_style_variable_value value
LEFT JOIN wcf" . WCF_N . "_style_variable variable
- ON (variable.variableID = value.variableID)
+ ON variable.variableID = value.variableID
WHERE value.styleID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$this->styleID]);
$sql = "SELECT template.*, package.package
FROM wcf" . WCF_N . "_template template
LEFT JOIN wcf" . WCF_N . "_package package
- ON (package.packageID = template.packageID)
+ ON package.packageID = template.packageID
WHERE template.templateGroupID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$this->templateGroupID]);
package.package
FROM wcf" . WCF_N . "_template template
LEFT JOIN wcf" . WCF_N . "_template_group template_group
- ON (template_group.templateGroupID = template.templateGroupID)
+ ON template_group.templateGroupID = template.templateGroupID
LEFT JOIN wcf" . WCF_N . "_package package
- ON (package.packageID = template.packageID)
+ ON package.packageID = template.packageID
WHERE template.templateID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$id]);
parent::__construct();
$this->sqlSelects = 'package.package, template_group.templateGroupFolderName';
- $this->sqlJoins = " LEFT JOIN wcf" . WCF_N . "_package package ON (package.packageID = template.packageID)";
- $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_template_group template_group ON (template_group.templateGroupID = template.templateGroupID)";
+ $this->sqlJoins = " LEFT JOIN wcf" . WCF_N . "_package package ON package.packageID = template.packageID";
+ $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_template_group template_group ON template_group.templateGroupID = template.templateGroupID";
}
/**
FROM wcf" . WCF_N . "_user_group user_group,
wcf" . WCF_N . "_user_to_group user_to_group
LEFT JOIN wcf" . WCF_N . "_user user_table
- ON (user_table.userID = user_to_group.userID)
+ ON user_table.userID = user_to_group.userID
WHERE user_to_group.groupID = user_group.groupID
AND user_group.showOnTeamPage = 1
ORDER BY user_group.priority DESC" . (!empty($this->sqlOrderBy) ? ", " . $this->sqlOrderBy : '');
FROM wcf" . WCF_N . "_user_group user_group,
wcf" . WCF_N . "_user_to_group user_to_group
LEFT JOIN wcf" . WCF_N . "_user user_table
- ON (user_table.userID = user_to_group.userID)
+ ON user_table.userID = user_to_group.userID
WHERE user_to_group.groupID = user_group.groupID
AND user_group.showOnTeamPage = 1
ORDER BY user_group.priority DESC" . (!empty($this->sqlOrderBy) ? ", " . $this->sqlOrderBy : '');
$sql = "SELECT user_option_value.*, user_table.*
FROM wcf" . WCF_N . "_user user_table
LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value
- ON (user_option_value.userID = user_table.userID)
+ ON user_option_value.userID = user_table.userID
WHERE user_table.userID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$id]);
$sql = "SELECT user_option_value.*, user_table.*
FROM wcf" . WCF_N . "_user user_table
LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value
- ON (user_option_value.userID = user_table.userID)
+ ON user_option_value.userID = user_table.userID
WHERE user_table.username = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$username]);
$sql = "SELECT user_option_value.*, user_table.*
FROM wcf" . WCF_N . "_user user_table
LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value
- ON (user_option_value.userID = user_table.userID)
+ ON user_option_value.userID = user_table.userID
WHERE user_table.email = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$email]);
$sql = "SELECT user_option_value.*, user_table.*
FROM wcf" . WCF_N . "_user user_table
LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value
- ON (user_option_value.userID = user_table.userID)
+ ON user_option_value.userID = user_table.userID
WHERE user_table.authData = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$authData]);
$sql = "SELECT user_option_value.*, user_table.*
FROM wcf" . WCF_N . "_user user_table
LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value
- ON (user_option_value.userID = user_table.userID)
+ ON user_option_value.userID = user_table.userID
WHERE user_table.userID IN (" . \str_repeat('?,', \count($this->objectIDs) - 1) . "?)";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($this->objectIDs);
$this->sqlSelects .= ',';
}
$this->sqlSelects .= "user_option_value.*";
- $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON (user_option_value.userID = user_table.userID)";
+ $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON user_option_value.userID = user_table.userID";
}
}
$sql = "SELECT user_rank.rankID
FROM wcf" . WCF_N . "_user_rank user_rank
LEFT JOIN wcf" . WCF_N . "_user_group user_group
- ON (user_group.groupID = user_rank.groupID)
+ ON user_group.groupID = user_rank.groupID
" . $conditionBuilder . "
ORDER BY user_group.priority DESC, user_rank.requiredPoints DESC, user_rank.requiredGender DESC";
$statement = WCF::getDB()->prepareStatement($sql, 1);
$this->sqlSelects .= ',';
}
$this->sqlSelects .= "user_avatar.*";
- $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON (user_avatar.avatarID = user_table.avatarID)";
+ $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON user_avatar.avatarID = user_table.avatarID";
if (MODULE_USER_RANK) {
$this->sqlSelects .= ",user_rank.*";
- $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_rank user_rank ON (user_rank.rankID = user_table.rankID)";
+ $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_rank user_rank ON user_rank.rankID = user_table.rankID";
}
// get current location
$this->sqlSelects .= ", session.pageID, session.pageObjectID, session.lastActivityTime AS sessionLastActivityTime";
- $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_session session ON (session.userID = user_table.userID)";
+ $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_session session ON session.userID = user_table.userID";
}
/**
$this->sqlSelects .= "user_table.username, user_table.email, user_table.disableAvatar, user_table.enableGravatar, user_table.gravatarFileExtension";
$this->sqlSelects .= ", user_avatar.*";
- $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON (user_table.userID = user_follow.userID)";
- $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON (user_avatar.avatarID = user_table.avatarID)";
+ $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = user_follow.userID";
+ $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON user_avatar.avatarID = user_table.avatarID";
}
}
$this->sqlSelects .= "user_avatar.*, user_follow.followID, user_option_value.*";
- $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON (user_table.userID = user_follow.followUserID)";
- $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON (user_option_value.userID = user_table.userID)";
- $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON (user_avatar.avatarID = user_table.avatarID)";
+ $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = user_follow.followUserID";
+ $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON user_option_value.userID = user_table.userID";
+ $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON user_avatar.avatarID = user_table.avatarID";
if (MODULE_USER_RANK) {
$this->sqlSelects .= ",user_rank.*";
- $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_rank user_rank ON (user_rank.rankID = user_table.rankID)";
+ $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_rank user_rank ON user_rank.rankID = user_table.rankID";
}
$this->sqlSelects .= ", user_table.*";
$sql = "SELECT group_option.optionName, option_value.optionValue
FROM wcf" . WCF_N . "_user_group_option_value option_value
LEFT JOIN wcf" . WCF_N . "_user_group_option group_option
- ON (group_option.optionID = option_value.optionID)
+ ON group_option.optionID = option_value.optionID
" . $conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
$this->sqlSelects .= ", user_option_value.*";
$this->sqlSelects .= ", user_avatar.*";
- $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON (user_table.userID = user_ignore.ignoreUserID)";
- $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON (user_option_value.userID = user_table.userID)";
- $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON (user_avatar.avatarID = user_table.avatarID)";
+ $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = user_ignore.ignoreUserID";
+ $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON user_option_value.userID = user_table.userID";
+ $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON user_avatar.avatarID = user_table.avatarID";
if (MODULE_USER_RANK) {
$this->sqlSelects .= ",user_rank.*";
- $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_rank user_rank ON (user_rank.rankID = user_table.rankID)";
+ $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_rank user_rank ON user_rank.rankID = user_table.rankID";
}
$this->sqlSelects .= ", user_table.*";
*/
public function __construct()
{
- $this->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_user user_table ON (user_table.userID = event_to_user.userID)";
+ $this->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = event_to_user.userID";
$this->sqlSelects = 'user_table.*';
parent::__construct();
$this->sqlSelects .= "user_avatar.*, user_option_value.*, user_group.userOnlineMarking, user_table.*";
- $this->sqlConditionJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON (user_table.userID = session.userID)";
- $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON (user_table.userID = session.userID)";
- $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON (user_option_value.userID = user_table.userID)";
- $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON (user_avatar.avatarID = user_table.avatarID)";
- $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_group user_group ON (user_group.groupID = user_table.userOnlineGroupID)";
+ $this->sqlConditionJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = session.userID";
+ $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = session.userID";
+ $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON user_option_value.userID = user_table.userID";
+ $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON user_avatar.avatarID = user_table.avatarID";
+ $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_group user_group ON user_group.groupID = user_table.userOnlineGroupID";
$this->getConditionBuilder()->add('session.lastActivityTime > ?', [TIME_NOW - USER_ONLINE_TIMEOUT]);
}
$sql = "SELECT user_option_value.userOption" . User::getUserOptionID('canViewOnlineStatus') . " AS canViewOnlineStatus, session.userID
FROM wcf" . WCF_N . "_session session
LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value
- ON (user_option_value.userID = session.userID)
+ ON user_option_value.userID = session.userID
" . $conditionBuilder;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditionBuilder->getParameters());
$this->sqlSelects .= "user_table.username, user_table.email, user_table.disableAvatar, user_table.enableGravatar, user_table.gravatarFileExtension";
$this->sqlSelects .= ", user_avatar.*";
- $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON (user_table.userID = user_profile_visitor.userID)";
- $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON (user_avatar.avatarID = user_table.avatarID)";
+ $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON user_table.userID = user_profile_visitor.userID";
+ $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON user_avatar.avatarID = user_table.avatarID";
}
}
$sql = "SELECT user_table.userID
FROM wcf" . WCF_N . "_user user_table
LEFT JOIN wcf" . WCF_N . "_user_option_value option_value
- ON (option_value.userID = user_table.userID)";
+ ON option_value.userID = user_table.userID";
// build search condition
$this->conditions = new PreparedStatementConditionBuilder();
if ($this->category->sortField === 'title') {
$this->objectList->sqlJoins .= '
LEFT JOIN wcf' . WCF_N . '_article_content article_content
- ON (
- article_content.articleID = article.articleID
- AND (
- article_content.languageID IS NULL
- OR article_content.languageID = ' . WCF::getLanguage()->languageID . '
- )
+ ON article_content.articleID = article.articleID
+ AND (
+ article_content.languageID IS NULL
+ OR article_content.languageID = ' . WCF::getLanguage()->languageID . '
)';
}
);
if (WCF::getUser()->userID) {
- $this->objectList->sqlConditionJoins = "LEFT JOIN wcf" . WCF_N . "_tracked_visit tracked_visit ON (tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.article') . " AND tracked_visit.objectID = article.articleID AND tracked_visit.userID = " . WCF::getUser()->userID . ")";
+ $this->objectList->sqlConditionJoins = "LEFT JOIN wcf" . WCF_N . "_tracked_visit tracked_visit ON tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.article') . " AND tracked_visit.objectID = article.articleID AND tracked_visit.userID = " . WCF::getUser()->userID;
$this->objectList->getConditionBuilder()->add("(article.time > tracked_visit.visitTime OR tracked_visit.visitTime IS NULL)");
}
}
$sql = "SELECT notification.*, notification_event.eventID, object_type.objectType
FROM wcf" . WCF_N . "_user_notification notification
LEFT JOIN wcf" . WCF_N . "_user_notification_event notification_event
- ON (notification_event.eventID = notification.eventID)
+ ON notification_event.eventID = notification.eventID
LEFT JOIN wcf" . WCF_N . "_object_type object_type
- ON (object_type.objectTypeID = notification_event.objectTypeID)
+ ON object_type.objectTypeID = notification_event.objectTypeID
WHERE notification.notificationID = ?
ORDER BY notification.time DESC";
$statement = WCF::getDB()->prepareStatement($sql, 1);
{
$accessibleCategoryIDs = ArticleCategory::getAccessibleCategoryIDs();
if (!empty($accessibleCategoryIDs)) {
- $commentList->sqlJoins .= ' INNER JOIN wcf' . WCF_N . '_article_content article_content ON (article_content.articleContentID = comment.objectID)';
- $commentList->sqlJoins .= ' INNER JOIN wcf' . WCF_N . '_article article ON (article.articleID = article_content.articleID)';
+ $commentList->sqlJoins .= ' INNER JOIN wcf' . WCF_N . '_article_content article_content ON article_content.articleContentID = comment.objectID';
+ $commentList->sqlJoins .= ' INNER JOIN wcf' . WCF_N . '_article article ON article.articleID = article_content.articleID';
$commentList->sqlSelects = 'article_content.title';
$commentList->getConditionBuilder()->add('article.categoryID IN (?)', [$accessibleCategoryIDs]);
$sql = "SELECT objectTypeID
FROM wcf" . WCF_N . "_object_type object_type
INNER JOIN wcf" . WCF_N . "_object_type_definition object_type_definition
- ON (object_type.definitionID = object_type_definition.definitionID)
+ ON object_type.definitionID = object_type_definition.definitionID
WHERE objectType = ?
AND definitionName = ?";
$statement = WCF::getDB()->prepareStatement($sql);
if (WCF::getSession()->getPermission('user.profile.canViewUserProfile')) {
$optionID = User::getUserOptionID('canViewProfile');
- $commentList->sqlJoins .= ' INNER JOIN wcf' . WCF_N . '_user_option_value user_option_value ON (user_option_value.userID = comment.objectID)';
+ $commentList->sqlJoins .= ' INNER JOIN wcf' . WCF_N . '_user_option_value user_option_value ON user_option_value.userID = comment.objectID';
if (WCF::getUser()->userID) {
$followers = UserProfileHandler::getInstance()->getFollowers();
$sql = "SELECT attribute.*, bbcode.bbcodeTag
FROM wcf" . WCF_N . "_bbcode_attribute attribute
LEFT JOIN wcf" . WCF_N . "_bbcode bbcode
- ON (bbcode.bbcodeID = attribute.bbcodeID)
+ ON bbcode.bbcodeID = attribute.bbcodeID
ORDER BY attribute.attributeNo";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute();
{
$list = new CategoryList();
$list->sqlSelects = "object_type.objectType";
- $list->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_object_type object_type ON (object_type.objectTypeID = category.objectTypeID)";
+ $list->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_object_type object_type ON object_type.objectTypeID = category.objectTypeID";
$list->sqlOrderBy = "category.showOrder ASC";
$list->readObjects();
$sql = "SELECT page_content.customURL AS controllerCustomURL, page_content.pageID, page_content.languageID, page.applicationPackageID
FROM wcf" . WCF_N . "_page_content page_content
LEFT JOIN wcf" . WCF_N . "_page page
- ON (page.pageID = page_content.pageID)";
+ ON page.pageID = page_content.pageID";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute();
while ($row = $statement->fetchArray()) {
$sql = "SELECT option_table.optionName, option_table.optionType, option_value.optionValue, option_value.groupID, option_table.enableOptions
FROM wcf" . WCF_N . "_user_group_option_value option_value
LEFT JOIN wcf" . WCF_N . "_user_group_option option_table
- ON (option_table.optionID = option_value.optionID)
+ ON option_table.optionID = option_value.optionID
" . $conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
$sql = "SELECT event.*, object_type.objectType
FROM wcf" . WCF_N . "_user_notification_event event
LEFT JOIN wcf" . WCF_N . "_object_type object_type
- ON (object_type.objectTypeID = event.objectTypeID)";
+ ON object_type.objectTypeID = event.objectTypeID";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute();
while ($row = $statement->fetchArray()) {
$notificationList->getConditionBuilder()->add('user_notification.userID = ?', [WCF::getUser()->userID]);
$notificationList->sqlJoins .= "
LEFT JOIN wcf" . WCF_N . "_comment comment
- ON (
- comment.commentID = user_notification.objectID
- AND comment.objectTypeID = " . \intval($this->getObjectTypeID($objectType)) . "
- )";
+ ON comment.commentID = user_notification.objectID
+ AND comment.objectTypeID = " . \intval($this->getObjectTypeID($objectType));
$notificationList->getConditionBuilder()->add('comment.objectID IN (?)', [$objectIDs]);
$notificationList->getConditionBuilder()->add('comment.time <= ?', [$time]);
$notificationList->readObjects();
$notificationList->getConditionBuilder()->add('user_notification.userID = ?', [WCF::getUser()->userID]);
$notificationList->sqlJoins .= "
LEFT JOIN wcf" . WCF_N . "_comment comment
- ON (
- comment.commentID = user_notification.baseObjectID
- AND comment.objectTypeID = " . \intval($this->getObjectTypeID($objectType)) . "
- )";
+ ON comment.commentID = user_notification.baseObjectID
+ AND comment.objectTypeID = " . \intval($this->getObjectTypeID($objectType));
$notificationList->getConditionBuilder()->add('comment.objectID IN (?)', [$objectIDs]);
$notificationList->getConditionBuilder()->add('comment.time <= ?', [$time]);
$notificationList->readObjects();
$notificationList->getConditionBuilder()->add('user_notification.userID = ?', [WCF::getUser()->userID]);
$notificationList->sqlJoins .= "
LEFT JOIN wcf" . WCF_N . "_comment_response comment_response
- ON (comment_response.responseID = user_notification.objectID)
+ ON comment_response.responseID = user_notification.objectID
LEFT JOIN wcf" . WCF_N . "_comment comment
- ON (comment.commentID = comment_response.commentID)";
+ ON comment.commentID = comment_response.commentID";
$notificationList->getConditionBuilder()->add(
'comment.objectTypeID IN (?)',
[$this->getObjectTypeID($objectType)]
$notificationList->getConditionBuilder()->add('user_notification.userID = ?', [WCF::getUser()->userID]);
$notificationList->sqlJoins .= "
LEFT JOIN wcf" . WCF_N . "_comment_response comment_response
- ON (comment_response.responseID = user_notification.baseObjectID)
+ ON comment_response.responseID = user_notification.baseObjectID
LEFT JOIN wcf" . WCF_N . "_comment comment
- ON (comment.commentID = comment_response.commentID)";
+ ON comment.commentID = comment_response.commentID";
$notificationList->getConditionBuilder()->add(
'comment.objectTypeID IN (?)',
[$this->getObjectTypeID($objectType)]
$sql = "SELECT notification.*, notification_event.eventID, object_type.objectType
FROM wcf" . WCF_N . "_user_notification notification
LEFT JOIN wcf" . WCF_N . "_user_notification_event notification_event
- ON (notification_event.eventID = notification.eventID)
+ ON notification_event.eventID = notification.eventID
LEFT JOIN wcf" . WCF_N . "_object_type object_type
- ON (object_type.objectTypeID = notification_event.objectTypeID)
+ ON object_type.objectTypeID = notification_event.objectTypeID
" . $conditions . "
ORDER BY notification.time";
$statement = WCF::getDB()->prepareStatement($sql);
);
$paidSubscriptionUserList = new PaidSubscriptionUserList();
- $paidSubscriptionUserList->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_paid_subscription paid_subscription ON (paid_subscription.subscriptionID = paid_subscription_user.subscriptionID)";
+ $paidSubscriptionUserList->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_paid_subscription paid_subscription ON paid_subscription.subscriptionID = paid_subscription_user.subscriptionID";
$paidSubscriptionUserList->getConditionBuilder()->add('paid_subscription_user.endDate <> ?', [0]);
$paidSubscriptionUserList->getConditionBuilder()->add(
'(' . $conditionBuilder . ')',
$sql = "SELECT import_mapping.newID
FROM wcf" . WCF_N . "_import_mapping import_mapping
- " . ($tableName ? "LEFT JOIN " . $tableName . " object_table ON (object_table." . $indexName . " = import_mapping.newID)" : '') . "
+ " . ($tableName ? "LEFT JOIN " . $tableName . " object_table ON object_table." . $indexName . " = import_mapping.newID" : '') . "
WHERE import_mapping.importHash = ?
AND import_mapping.objectTypeID = ?
AND import_mapping.oldID = ?
CASE WHEN like_table.likeValue IS NOT NULL THEN like_table.likeValue ELSE 0 END AS liked
FROM wcf" . WCF_N . "_like_object like_object
LEFT JOIN wcf" . WCF_N . "_like like_table
- ON (
- like_table.objectTypeID = ?
- AND like_table.objectID = like_object.objectID
- AND like_table.userID = ?
- )
+ ON like_table.objectTypeID = ?
+ AND like_table.objectID = like_object.objectID
+ AND like_table.userID = ?
WHERE like_object.likeObjectID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([
$sql = "SELECT comment_response.responseID, comment.commentID, comment.objectTypeID, comment.objectID
FROM wcf" . WCF_N . "_comment_response comment_response
LEFT JOIN wcf" . WCF_N . "_comment comment
- ON (comment.commentID = comment_response.commentID)
+ ON comment.commentID = comment_response.commentID
" . $conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
$sql = "SELECT COUNT(*)
FROM wcf" . WCF_N . "_moderation_queue_to_user moderation_queue_to_user
LEFT JOIN wcf" . WCF_N . "_moderation_queue moderation_queue
- ON (moderation_queue.queueID = moderation_queue_to_user.queueID)
+ ON moderation_queue.queueID = moderation_queue_to_user.queueID
" . $conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
$sql = "SELECT COUNT(*)
FROM wcf" . WCF_N . "_moderation_queue_to_user moderation_queue_to_user
LEFT JOIN wcf" . WCF_N . "_moderation_queue moderation_queue
- ON (moderation_queue.queueID = moderation_queue_to_user.queueID)
+ ON moderation_queue.queueID = moderation_queue_to_user.queueID
LEFT JOIN wcf" . WCF_N . "_tracked_visit tracked_visit
- ON (
- tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.moderation.queue') . "
- AND tracked_visit.objectID = moderation_queue.queueID
- AND tracked_visit.userID = " . WCF::getUser()->userID . "
- )
+ ON tracked_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wcf.moderation.queue') . "
+ AND tracked_visit.objectID = moderation_queue.queueID
+ AND tracked_visit.userID = " . WCF::getUser()->userID . "
" . $conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
protected function forceUserAssignment()
{
$queueList = new ModerationQueueList();
- $queueList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_moderation_queue_to_user moderation_queue_to_user ON (moderation_queue_to_user.queueID = moderation_queue.queueID AND moderation_queue_to_user.userID = " . WCF::getUser()->userID . ")";
+ $queueList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_moderation_queue_to_user moderation_queue_to_user ON moderation_queue_to_user.queueID = moderation_queue.queueID AND moderation_queue_to_user.userID = " . WCF::getUser()->userID;
$queueList->getConditionBuilder()->add("moderation_queue_to_user.queueID IS NULL");
$queueList->readObjects();
$sql = "SELECT moderation_queue.queueID, moderation_queue.objectTypeID, moderation_queue.objectID
FROM wcf" . WCF_N . "_moderation_queue_to_user moderation_queue_to_user
LEFT JOIN wcf" . WCF_N . "_moderation_queue moderation_queue
- ON (moderation_queue.queueID = moderation_queue_to_user.queueID)
+ ON moderation_queue.queueID = moderation_queue_to_user.queueID
WHERE moderation_queue_to_user.userID = ?
AND moderation_queue_to_user.isAffected = ?
AND moderation_queue.status <> ?";
$sql = "SELECT package.*
FROM wcf" . WCF_N . "_package_requirement requirement
LEFT JOIN wcf" . WCF_N . "_package package
- ON (package.packageID = requirement.requirement)
+ ON package.packageID = requirement.requirement
WHERE requirement.packageID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$this->package->packageID]);
$sql = "SELECT package.*, package_exclusion.*
FROM wcf" . WCF_N . "_package_exclusion package_exclusion
LEFT JOIN wcf" . WCF_N . "_package package
- ON (package.packageID = package_exclusion.packageID)
+ ON package.packageID = package_exclusion.packageID
WHERE excludedPackage = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$this->packageInfo['name']]);
package_update.package
FROM wcf" . WCF_N . "_package_update_exclusion package_update_exclusion
LEFT JOIN wcf" . WCF_N . "_package_update_version package_update_version
- ON (package_update_version.packageUpdateVersionID = package_update_exclusion.packageUpdateVersionID)
+ ON package_update_version.packageUpdateVersionID = package_update_exclusion.packageUpdateVersionID
LEFT JOIN wcf" . WCF_N . "_package_update package_update
- ON (package_update.packageUpdateID = package_update_version.packageUpdateID)
+ ON package_update.packageUpdateID = package_update_version.packageUpdateID
LEFT JOIN wcf" . WCF_N . "_package package
- ON (package.package = package_update_exclusion.excludedPackage)
+ ON package.package = package_update_exclusion.excludedPackage
WHERE package_update_exclusion.packageUpdateVersionID IN (
SELECT packageUpdateVersionID
FROM wcf" . WCF_N . "_package_update_version
$sql = "SELECT package.*, package_exclusion.*
FROM wcf" . WCF_N . "_package_exclusion package_exclusion
LEFT JOIN wcf" . WCF_N . "_package package
- ON (package.packageID = package_exclusion.packageID)
+ ON package.packageID = package_exclusion.packageID
" . $conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
$sql = "SELECT puv.packageVersion, puf.fromversion
FROM wcf" . WCF_N . "_package_update_fromversion puf
LEFT JOIN wcf" . WCF_N . "_package_update_version puv
- ON (puv.packageUpdateVersionID = puf.packageUpdateVersionID)
+ ON puv.packageUpdateVersionID = puf.packageUpdateVersionID
WHERE puf.packageUpdateVersionID IN (
SELECT packageUpdateVersionID
FROM wcf" . WCF_N . "_package_update_version
puv.packageUpdateVersionID, puv.packageDate, puv.filename, puv.packageVersion
FROM wcf" . WCF_N . "_package_update pu
LEFT JOIN wcf" . WCF_N . "_package_update_version puv
- ON (puv.packageUpdateID = pu.packageUpdateID AND puv.isAccessible = 1)
+ ON puv.packageUpdateID = pu.packageUpdateID
+ AND puv.isAccessible = 1
" . $conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
$sql = "SELECT pur.package, pur.minversion, p.packageID
FROM wcf" . WCF_N . "_package_update_requirement pur
LEFT JOIN wcf" . WCF_N . "_package p
- ON (p.package = pur.package)
+ ON p.package = pur.package
WHERE pur.packageUpdateVersionID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$packageUpdateVersionID]);
$sql = "SELECT puv.*, pu.*, pus.serverURL, pus.loginUsername, pus.loginPassword
FROM wcf" . WCF_N . "_package_update_version puv
LEFT JOIN wcf" . WCF_N . "_package_update pu
- ON (pu.packageUpdateID = puv.packageUpdateID)
+ ON pu.packageUpdateID = puv.packageUpdateID
LEFT JOIN wcf" . WCF_N . "_package_update_server pus
- ON (pus.packageUpdateServerID = pu.packageUpdateServerID)
+ ON pus.packageUpdateServerID = pu.packageUpdateServerID
" . $conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
$sql = "SELECT objectTypeID
FROM wcf" . WCF_N . "_object_type object_type
LEFT JOIN wcf" . WCF_N . "_object_type_definition object_type_definition
- ON (object_type_definition.definitionID = object_type.definitionID)
+ ON object_type_definition.definitionID = object_type.definitionID
WHERE objectType = ?
AND definitionName = ?";
$statement = WCF::getDB()->prepareStatement($sql);
language_category.languageCategory
FROM wcf" . WCF_N . "_language_category language_category
LEFT JOIN wcf" . WCF_N . "_language_item item
- ON (item.languageCategoryID = language_category.languageCategoryID)
+ ON item.languageCategoryID = language_category.languageCategoryID
" . $conditions . "
GROUP BY language_category.languageCategoryID ASC,
language_category.languageCategory ASC";
template_group.templateGroupFolderName
FROM wcf" . WCF_N . "_template template
LEFT JOIN wcf" . WCF_N . "_template_group template_group
- ON (template_group.templateGroupID = template.templateGroupID)
+ ON template_group.templateGroupID = template.templateGroupID
WHERE packageID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$this->installation->getPackageID()]);
$sql = "SELECT package.*, package_exclusion.*
FROM wcf" . WCF_N . "_package_exclusion package_exclusion
LEFT JOIN wcf" . WCF_N . "_package package
- ON (package.packageID = package_exclusion.packageID)
+ ON package.packageID = package_exclusion.packageID
WHERE excludedPackage = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$this->getArchive()->getPackageInfo('name')]);
$sql = "SELECT DISTINCT categoryID
FROM wcf" . WCF_N . "_category category
LEFT JOIN wcf" . WCF_N . "_language_item language_item
- ON (language_item.languageItem = category.title)
+ ON language_item.languageItem = category.title
" . $conditionBuilder;
$statement = WCF::getDB()->prepareStatement($sql, 10);
$statement->execute($conditionBuilder->getParameters());
if (!empty($trophyList->sqlJoins)) {
$trophyList->sqlJoins .= ', ';
}
- $trophyList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_language_item language_item ON (language_item.languageItem = trophy.title)";
+ $trophyList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_language_item language_item ON language_item.languageItem = trophy.title";
$trophyList->getConditionBuilder()->add(
'(trophy.title LIKE ? OR language_item.languageItemValue LIKE ?)',
['%' . $searchString . '%', '%' . $searchString . '%']
// check for user votes
if (WCF::getUser()->userID) {
$optionList->sqlSelects = "CASE WHEN poll_option_vote.optionID IS NULL THEN '0' ELSE '1' END AS voted";
- $optionList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_poll_option_vote poll_option_vote ON (poll_option_vote.optionID = poll_option.optionID AND poll_option_vote.userID = " . WCF::getUser()->userID . ")";
+ $optionList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_poll_option_vote poll_option_vote ON poll_option_vote.optionID = poll_option.optionID AND poll_option_vote.userID = " . WCF::getUser()->userID;
} else {
$optionList->sqlSelects = "'0' AS voted";
}
COALESCE(like_table.likeValue, 0) AS liked
FROM wcf" . WCF_N . "_like_object like_object
LEFT JOIN wcf" . WCF_N . "_like like_table
- ON (
- like_table.objectTypeID = like_object.objectTypeID
- AND like_table.objectID = like_object.objectID
- AND like_table.userID = ?
- )
+ ON like_table.objectTypeID = like_object.objectTypeID
+ AND like_table.objectID = like_object.objectID
+ AND like_table.userID = ?
" . $conditions;
\array_unshift($parameters, WCF::getUser()->userID);
COALESCE(like_table.likeValue, 0) AS liked
FROM wcf" . WCF_N . "_like_object like_object
LEFT JOIN wcf" . WCF_N . "_like like_table
- ON (
- like_table.objectTypeID = ?
- AND like_table.objectID = like_object.objectID
- AND like_table.userID = ?
- )
+ ON like_table.objectTypeID = ?
+ AND like_table.objectID = like_object.objectID
+ AND like_table.userID = ?
WHERE like_object.likeObjectID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([
*/
public function getJoins()
{
- return 'INNER JOIN wcf' . WCF_N . '_article ON (wcf' . WCF_N . '_article.articleID = ' . $this->getTableName() . '.articleID)';
+ return 'INNER JOIN wcf' . WCF_N . '_article ON wcf' . WCF_N . '_article.articleID = ' . $this->getTableName() . '.articleID';
}
/**
*/
public function getJoins()
{
- return 'INNER JOIN wcf' . WCF_N . '_page ON (wcf' . WCF_N . '_page.pageID = ' . $this->getTableName() . '.pageID)';
+ return 'INNER JOIN wcf' . WCF_N . '_page ON wcf' . WCF_N . '_page.pageID = ' . $this->getTableName() . '.pageID';
}
/**
" . ($orderBy == 'relevance ASC' || $orderBy == 'relevance DESC' ? ',search_index.relevance' : '') . "
FROM " . $objectType->getTableName() . "
INNER JOIN ({WCF_SEARCH_INNER_JOIN}) search_index
- ON (" . $objectType->getIDFieldName() . " = search_index.objectID)
+ ON " . $objectType->getIDFieldName() . " = search_index.objectID
" . $objectType->getJoins() . "
" . ($additionalConditions[$objectTypeName] ?? '');
}
/** @var $pageList PageContentList */
$pageList = parent::getObjectList();
- $pageList->sqlConditionJoins = 'LEFT JOIN wcf' . WCF_N . '_page page ON (page_content.pageID = page.pageID)';
- $pageList->sqlJoins = 'LEFT JOIN wcf' . WCF_N . '_page page ON (page_content.pageID = page.pageID)';
+ $pageList->sqlConditionJoins = 'LEFT JOIN wcf' . WCF_N . '_page page ON page_content.pageID = page.pageID';
+ $pageList->sqlJoins = 'LEFT JOIN wcf' . WCF_N . '_page page ON page_content.pageID = page.pageID';
$pageList->getConditionBuilder()->add('page.isMultilingual = ?', [1]);
$pageList->getConditionBuilder()->add('page.allowSpidersToIndex = ?', [1]);
SELECT COUNT(*)
FROM wcf" . WCF_N . "_comment_response comment_response
LEFT JOIN wcf" . WCF_N . "_comment comment
- ON (comment.commentID = comment_response.commentID)
+ ON comment.commentID = comment_response.commentID
WHERE comment.objectTypeID = ?
AND comment_response.time BETWEEN ? AND ?
)";
SELECT COUNT(*)
FROM wcf" . WCF_N . "_comment_response comment_response
LEFT JOIN wcf" . WCF_N . "_comment comment
- ON (comment.commentID = comment_response.commentID)
+ ON comment.commentID = comment_response.commentID
WHERE comment.objectTypeID = ?
AND comment_response.time < ?
)";
$sql = "SELECT tag.*, tag_to_object.objectID
FROM wcf" . WCF_N . "_tag_to_object tag_to_object
LEFT JOIN wcf" . WCF_N . "_tag tag
- ON (tag.tagID = tag_to_object.tagID)
+ ON tag.tagID = tag_to_object.tagID
" . $conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
private function getUserIDs(Trophy $trophy)
{
$userList = new UserList();
- $userList->sqlConditionJoins .= " LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON (user_option_value.userID = user_table.userID)";
+ $userList->sqlConditionJoins .= " LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON user_option_value.userID = user_table.userID";
$conditions = $trophy->getConditions();
foreach ($conditions as $condition) {
$userList->sqlJoins = $pseudoUserList->sqlJoins;
// We joining the user_trophy table to receive the userTrophyID, which should be deleted.
- $userList->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_trophy user_trophy ON (user_table.userID = user_trophy.userID)";
+ $userList->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_trophy user_trophy ON user_table.userID = user_trophy.userID";
// We do not need the complete user object, but only the userTrophyID.
// So that the UserList object can also assign the users (which is used
$sql = "SELECT notification.*, notification_event.eventID, object_type.objectType
FROM wcf" . WCF_N . "_user_notification notification
LEFT JOIN wcf" . WCF_N . "_user_notification_event notification_event
- ON (notification_event.eventID = notification.eventID)
+ ON notification_event.eventID = notification.eventID
LEFT JOIN wcf" . WCF_N . "_object_type object_type
- ON (object_type.objectTypeID = notification_event.objectTypeID)
+ ON object_type.objectTypeID = notification_event.objectTypeID
" . $conditions . "
ORDER BY notification.time DESC";
$statement = WCF::getDB()->prepareStatement($sql, $limit, $offset);
$sql = "SELECT article.userID
FROM wcf" . WCF_N . "_comment comment
LEFT JOIN wcf" . WCF_N . "_article article
- ON (article.articleID = comment.objectID)
+ ON article.articleID = comment.objectID
WHERE comment.commentID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$objectID]);
SELECT DISTINCT comment_response.userID
FROM wcf" . WCF_N . "_comment_response comment_response
INNER JOIN wcf" . WCF_N . "_comment comment
- ON (comment.commentID = comment_response.commentID)
+ ON comment.commentID = comment_response.commentID
WHERE comment.objectID = ?
AND comment.objectTypeID = ?
)";
$sql = "SELECT user_option.*, user.*
FROM wcf" . WCF_N . "_user user
LEFT JOIN wcf" . WCF_N . "_user_option_value user_option
- ON (user_option.userID = user.userID)
+ ON user_option.userID = user.userID
" . $this->conditions . "
ORDER BY user.userID";
$statement = WCF::getDB()->prepareStatement($sql, $this->limit, $this->limit * $this->loopCount);
$sql = "UPDATE wcf" . WCF_N . "_user_activity_point user_activity_point
LEFT JOIN wcf" . WCF_N . "_user user_table
- ON (user_table.userID = user_activity_point.userID)
+ ON user_table.userID = user_activity_point.userID
SET user_activity_point.items = user_table.likesReceived,
user_activity_point.activityPoints = user_activity_point.items * ?
" . $conditionBuilder;
parent::initObjectList();
$this->objectList->sqlSelects = 'user_option_value.userOption' . User::getUserOptionID('aboutMe') . ' AS aboutMe';
- $this->objectList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON (user_option_value.userID = user_table.userID)";
+ $this->objectList->sqlJoins = "LEFT JOIN wcf" . WCF_N . "_user_option_value user_option_value ON user_option_value.userID = user_table.userID";
$this->objectList->sqlOrderBy = 'user_table.userID';
}
SELECT COUNT(*)
FROM wcf" . WCF_N . "_user_trophy user_trophy
LEFT JOIN wcf" . WCF_N . "_trophy trophy
- ON (user_trophy.trophyID = trophy.trophyID)
+ ON user_trophy.trophyID = trophy.trophyID
LEFT JOIN wcf" . WCF_N . "_category trophy_category
- ON (trophy.categoryID = trophy_category.categoryID)
+ ON trophy.categoryID = trophy_category.categoryID
WHERE user_trophy.userID = user_table.userID
AND trophy.isDisabled = 0
AND trophy_category.isDisabled = 0
$sql = "SELECT user_table.username
FROM wcf" . WCF_N . "_user_to_group user_to_group
LEFT JOIN wcf" . WCF_N . "_user user_table
- ON (user_table.userID = user_to_group.userID)
+ ON user_table.userID = user_to_group.userID
" . $conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());