}
if (!empty($this->title)) {
$this->objectList->getConditionBuilder()->add(
- 'article.articleID IN (SELECT articleID FROM wcf' . WCF_N . '_article_content WHERE title LIKE ?)',
+ 'article.articleID IN (
+ SELECT articleID
+ FROM wcf' . WCF_N . '_article_content
+ WHERE title LIKE ?
+ )',
['%' . $this->title . '%']
);
}
if (!empty($this->content)) {
$this->objectList->getConditionBuilder()->add(
- 'article.articleID IN (SELECT articleID FROM wcf' . WCF_N . '_article_content WHERE content LIKE ?)',
+ 'article.articleID IN (
+ SELECT articleID
+ FROM wcf' . WCF_N . '_article_content
+ WHERE content LIKE ?
+ )',
['%' . $this->content . '%']
);
}
}
}
- $this->objectList->sqlSelects = "(SELECT title FROM wcf" . WCF_N . "_article_content WHERE articleID = article.articleID AND (languageID IS NULL OR languageID = " . WCF::getLanguage()->languageID . ") LIMIT 1) AS title";
+ $this->objectList->sqlSelects = "(
+ SELECT title
+ FROM wcf" . WCF_N . "_article_content
+ WHERE articleID = article.articleID
+ AND (
+ languageID IS NULL
+ OR languageID = " . WCF::getLanguage()->languageID . "
+ )
+ LIMIT 1
+ ) AS title";
if ($this->publicationStatus != -1) {
$this->objectList->getConditionBuilder()->add('article.publicationStatus = ?', [$this->publicationStatus]);
}
if (!empty($this->title)) {
$this->objectList->getConditionBuilder()->add(
- 'box.boxID IN (SELECT boxID FROM wcf' . WCF_N . '_box_content WHERE title LIKE ?)',
+ 'box.boxID IN (
+ SELECT boxID
+ FROM wcf' . WCF_N . '_box_content
+ WHERE title LIKE ?
+ )',
['%' . $this->title . '%']
);
}
if (!empty($this->content)) {
$this->objectList->getConditionBuilder()->add(
- 'box.boxID IN (SELECT boxID FROM wcf' . WCF_N . '_box_content WHERE content LIKE ?)',
+ 'box.boxID IN (
+ SELECT boxID
+ FROM wcf' . WCF_N . '_box_content
+ WHERE content LIKE ?
+ )',
['%' . $this->content . '%']
);
}
{
parent::initObjectList();
- $this->objectList->sqlSelects .= '(SELECT COUNT(*) FROM wcf' . WCF_N . '_label WHERE groupID = label_group.groupID) AS labels';
+ $this->objectList->sqlSelects .= '(
+ SELECT COUNT(*)
+ FROM wcf' . WCF_N . '_label
+ WHERE groupID = label_group.groupID
+ ) AS labels';
if ($this->groupName) {
$languageItemList = new LanguageItemList();
{
parent::initObjectList();
- $this->objectList->sqlSelects = "(SELECT COUNT(*) FROM wcf" . WCF_N . "_user user WHERE languageID = language.languageID) AS users,";
- $this->objectList->sqlSelects .= "(SELECT COUNT(*) FROM wcf" . WCF_N . "_language_item WHERE languageID = language.languageID) AS variables,";
- $this->objectList->sqlSelects .= "(SELECT COUNT(*) FROM wcf" . WCF_N . "_language_item WHERE languageID = language.languageID AND languageCustomItemValue IS NOT NULL) AS customVariables";
+ $this->objectList->sqlSelects = "(
+ SELECT COUNT(*)
+ FROM wcf" . WCF_N . "_user user
+ WHERE languageID = language.languageID
+ ) AS users, (
+ SELECT COUNT(*)
+ FROM wcf" . WCF_N . "_language_item
+ WHERE languageID = language.languageID
+ ) AS variables, (
+ SELECT COUNT(*)
+ FROM wcf" . WCF_N . "_language_item
+ WHERE languageID = language.languageID
+ AND languageCustomItemValue IS NOT NULL
+ ) AS customVariables";
}
/**
{
parent::initObjectList();
- $this->objectList->sqlSelects .= '(SELECT COUNT(*) FROM wcf' . WCF_N . '_menu_item WHERE menuID = menu.menuID) AS items, (SELECT position FROM wcf' . WCF_N . '_box WHERE menuID = menu.menuID) AS position, (SELECT showOrder FROM wcf' . WCF_N . '_box WHERE menuID = menu.menuID) AS showOrder';
+ $this->objectList->sqlSelects .= '(
+ SELECT COUNT(*)
+ FROM wcf' . WCF_N . '_menu_item
+ WHERE menuID = menu.menuID
+ ) AS items, (
+ SELECT position
+ FROM wcf' . WCF_N . '_box
+ WHERE menuID = menu.menuID
+ ) AS position, (
+ SELECT showOrder
+ FROM wcf' . WCF_N . '_box
+ WHERE menuID = menu.menuID
+ ) AS showOrder';
}
}
}
if (!empty($this->title)) {
$this->objectList->getConditionBuilder()->add(
- 'page.pageID IN (SELECT pageID FROM wcf' . WCF_N . '_page_content WHERE title LIKE ?)',
+ 'page.pageID IN (
+ SELECT pageID
+ FROM wcf' . WCF_N . '_page_content
+ WHERE title LIKE ?
+ )',
['%' . $this->title . '%']
);
}
if (!empty($this->content)) {
$this->objectList->getConditionBuilder()->add(
- 'page.pageID IN (SELECT pageID FROM wcf' . WCF_N . '_page_content WHERE content LIKE ?)',
+ 'page.pageID IN (
+ SELECT pageID
+ FROM wcf' . WCF_N . '_page_content
+ WHERE content LIKE ?
+ )',
['%' . $this->content . '%']
);
}
}
if ($this->username) {
$this->objectList->getConditionBuilder()->add(
- 'paid_subscription_transaction_log.userID IN (SELECT userID FROM wcf' . WCF_N . '_user WHERE username LIKE ?)',
+ 'paid_subscription_transaction_log.userID IN (
+ SELECT userID
+ FROM wcf' . WCF_N . '_user
+ WHERE username LIKE ?
+ )',
['%' . $this->username . '%']
);
}
if ($this->username) {
$this->objectList->getConditionBuilder()->add(
- 'paid_subscription_user.userID IN (SELECT userID FROM wcf' . WCF_N . '_user WHERE username LIKE ?)',
+ 'paid_subscription_user.userID IN (
+ SELECT userID
+ FROM wcf' . WCF_N . '_user
+ WHERE username LIKE ?
+ )',
['%' . $this->username . '%']
);
}
{
parent::initObjectList();
- $this->objectList->sqlSelects = "(SELECT COUNT(*) FROM wcf" . WCF_N . "_user WHERE styleID = style.styleID) AS users";
+ $this->objectList->sqlSelects = "(
+ SELECT COUNT(*)
+ FROM wcf" . WCF_N . "_user
+ WHERE styleID = style.styleID
+ ) AS users";
}
}
{
parent::initObjectList();
- $this->objectList->sqlSelects = "(SELECT COUNT(*) FROM wcf" . WCF_N . "_tag_to_object t2o WHERE t2o.tagID = tag.tagID) AS usageCount";
+ $this->objectList->sqlSelects = "(
+ SELECT COUNT(*)
+ FROM wcf" . WCF_N . "_tag_to_object t2o
+ WHERE t2o.tagID = tag.tagID
+ ) AS usageCount";
$this->objectList->sqlSelects .= ", language.languageName, language.languageCode";
$this->objectList->sqlSelects .= ", synonym.name AS synonymName";
if (!empty($this->objectList->sqlSelects)) {
$this->objectList->sqlSelects .= ',';
}
- $this->objectList->sqlSelects .= "(SELECT COUNT(*) FROM wcf" . WCF_N . "_user_to_group WHERE groupID = user_group.groupID) AS members";
+ $this->objectList->sqlSelects .= "(
+ SELECT COUNT(*)
+ FROM wcf" . WCF_N . "_user_to_group
+ WHERE groupID = user_group.groupID
+ ) AS members";
}
/**
{
parent::initObjectList();
- $this->objectList->sqlSelects = "(SELECT COUNT(*) FROM wcf" . WCF_N . "_user_option WHERE categoryName = user_option_category.categoryName) AS userOptions";
+ $this->objectList->sqlSelects = "(
+ SELECT COUNT(*)
+ FROM wcf" . WCF_N . "_user_option
+ WHERE categoryName = user_option_category.categoryName
+ ) AS userOptions";
$this->objectList->getConditionBuilder()->add('user_option_category.parentCategoryName = ?', ['profile']);
}
}
parent::initObjectList();
$this->objectList->getConditionBuilder()->add(
- "option_table.categoryName IN (SELECT categoryName FROM wcf" . WCF_N . "_user_option_category WHERE parentCategoryName = ?)",
+ "option_table.categoryName IN (
+ SELECT categoryName
+ FROM wcf" . WCF_N . "_user_option_category
+ WHERE parentCategoryName = ?
+ )",
['profile']
);
}
if ($this->username) {
$this->objectList->getConditionBuilder()->add(
- 'user_trophy.userID IN (SELECT userID FROM wcf' . WCF_N . '_user WHERE username LIKE ?)',
+ 'user_trophy.userID IN (
+ SELECT userID
+ FROM wcf' . WCF_N . '_user
+ WHERE username LIKE ?
+ )',
['%' . $this->username . '%']
);
}
$this->getConditionBuilder()->add('attachment.objectTypeID = ?', [$this->objectType->objectTypeID]);
$this->getConditionBuilder()->add(
- '(SELECT embeddedObjectID FROM wcf' . WCF_N . '_message_embedded_object WHERE messageObjectTypeID = ? AND messageID = attachment.objectID AND embeddedObjectTypeID = ? AND embeddedObjectID = attachment.attachmentID) IS NULL',
+ '(
+ SELECT embeddedObjectID
+ FROM wcf' . WCF_N . '_message_embedded_object
+ WHERE messageObjectTypeID = ?
+ AND messageID = attachment.objectID
+ AND embeddedObjectTypeID = ?
+ AND embeddedObjectID = attachment.attachmentID
+ ) IS NULL',
[
ObjectTypeCache::getInstance()->getObjectTypeIDByName('com.woltlab.wcf.message', $objectType),
ObjectTypeCache::getInstance()->getObjectTypeIDByName(
// get excluded packages
$conditions = new PreparedStatementConditionBuilder();
$conditions->add(
- "packageUpdateVersionID IN (SELECT packageUpdateVersionID FROM wcf" . WCF_N . "_package_update_version WHERE packageUpdateID = ?)",
+ "packageUpdateVersionID IN (
+ SELECT packageUpdateVersionID
+ FROM wcf" . WCF_N . "_package_update_version
+ WHERE packageUpdateID = ?
+ )",
[$packageUpdateID]
);
$sql = "SELECT *
if (!empty($this->sqlSelects)) {
$this->sqlSelects .= ',';
}
- $this->sqlSelects .= "(SELECT COUNT(*) FROM wcf" . WCF_N . "_package_update WHERE packageUpdateServerID = " . $this->getDatabaseTableAlias() . ".packageUpdateServerID) AS packages";
+ $this->sqlSelects .= "(
+ SELECT COUNT(*)
+ FROM wcf" . WCF_N . "_package_update
+ WHERE packageUpdateServerID = " . $this->getDatabaseTableAlias() . ".packageUpdateServerID
+ ) AS packages";
parent::readObjects();
}
$this->applyFilters();
if ($this->sortField === 'title') {
- $this->objectList->sqlSelects = "(SELECT title FROM wcf" . WCF_N . "_article_content WHERE articleID = article.articleID AND (languageID IS NULL OR languageID = " . WCF::getLanguage()->languageID . ") LIMIT 1) AS title";
+ $this->objectList->sqlSelects = "(
+ SELECT title
+ FROM wcf" . WCF_N . "_article_content
+ WHERE articleID = article.articleID
+ AND (
+ languageID IS NULL
+ OR languageID = " . WCF::getLanguage()->languageID . "
+ )
+ LIMIT 1
+ ) AS title";
}
}
if (!empty($groupLabelIDs)) {
$this->objectList->getConditionBuilder()->add(
- 'article.articleID NOT IN (SELECT objectID FROM wcf' . WCF_N . '_label_object WHERE objectTypeID = ? AND labelID IN (?))',
+ 'article.articleID NOT IN (
+ SELECT objectID
+ FROM wcf' . WCF_N . '_label_object
+ WHERE objectTypeID = ?
+ AND labelID IN (?)
+ )',
[
$objectTypeID,
$groupLabelIDs,
}
} else {
$this->objectList->getConditionBuilder()->add(
- 'article.articleID IN (SELECT objectID FROM wcf' . WCF_N . '_label_object WHERE objectTypeID = ? AND labelID = ?)',
+ 'article.articleID IN (
+ SELECT objectID
+ FROM wcf' . WCF_N . '_label_object
+ WHERE objectTypeID = ?
+ AND labelID = ?
+ )',
[
$objectTypeID,
$labelID,
{
MultipleLinkPage::initObjectList();
- $this->objectList->sqlSelects = '(SELECT COUNT(*) FROM wcf' . WCF_N . '_user_trophy WHERE trophyID = trophy.trophyID) AS awarded';
+ $this->objectList->sqlSelects = '(
+ SELECT COUNT(*)
+ FROM wcf' . WCF_N . '_user_trophy
+ WHERE trophyID = trophy.trophyID
+ ) AS awarded';
$this->objectList->getConditionBuilder()->add('isDisabled = ?', [0]);
$this->objectList->getConditionBuilder()->add('categoryID = ?', [$this->categoryID]);
}
{
parent::initObjectList();
- $this->objectList->sqlSelects = '(SELECT COUNT(*) FROM wcf' . WCF_N . '_user_trophy WHERE trophyID = trophy.trophyID) AS awarded';
+ $this->objectList->sqlSelects = '(
+ SELECT COUNT(*)
+ FROM wcf' . WCF_N . '_user_trophy
+ WHERE trophyID = trophy.trophyID
+ ) AS awarded';
$this->objectList->getConditionBuilder()->add('isDisabled = ?', [0]);
$this->objectList->getConditionBuilder()->add('categoryID IN (?)', [
\array_map(static function ($category) {
$canViewTrophyDefaultValue = UserOptionCacheBuilder::getInstance()->getData()['options']['canViewTrophies']->defaultValue;
if (!WCF::getUser()->userID) {
- $this->objectList->getConditionBuilder()->add('user_trophy.userID IN (SELECT userID FROM wcf' . WCF_N . '_user_option_value WHERE COALESCE(userOption' . UserOptionCacheBuilder::getInstance()->getData()['options']['canViewTrophies']->optionID . ', ' . $canViewTrophyDefaultValue . ') = 0)');
+ $this->objectList->getConditionBuilder()->add('user_trophy.userID IN (
+ SELECT userID
+ FROM wcf' . WCF_N . '_user_option_value
+ WHERE COALESCE(userOption' . UserOptionCacheBuilder::getInstance()->getData()['options']['canViewTrophies']->optionID . ', ' . $canViewTrophyDefaultValue . ') = 0)');
} elseif (!WCF::getSession()->getPermission('admin.general.canViewPrivateUserOptions')) {
$conditionBuilder = new PreparedStatementConditionBuilder(false, 'OR');
- $conditionBuilder->add('user_trophy.userID IN (SELECT userID FROM wcf' . WCF_N . '_user_option_value WHERE (COALESCE(userOption' . UserOptionCacheBuilder::getInstance()->getData()['options']['canViewTrophies']->optionID . ', ' . $canViewTrophyDefaultValue . ') = 0 OR COALESCE(userOption' . UserOptionCacheBuilder::getInstance()->getData()['options']['canViewTrophies']->optionID . ', ' . $canViewTrophyDefaultValue . ') = 1))');
+ $conditionBuilder->add('user_trophy.userID IN (
+ SELECT userID
+ FROM wcf' . WCF_N . '_user_option_value
+ WHERE (
+ COALESCE(userOption' . UserOptionCacheBuilder::getInstance()->getData()['options']['canViewTrophies']->optionID . ', ' . $canViewTrophyDefaultValue . ') = 0
+ OR COALESCE(userOption' . UserOptionCacheBuilder::getInstance()->getData()['options']['canViewTrophies']->optionID . ', ' . $canViewTrophyDefaultValue . ') = 1
+ )
+ )');
$friendshipConditionBuilder = new PreparedStatementConditionBuilder(false);
- $friendshipConditionBuilder->add('user_trophy.userID IN (SELECT userID FROM wcf' . WCF_N . '_user_option_value WHERE COALESCE(userOption' . UserOptionCacheBuilder::getInstance()->getData()['options']['canViewTrophies']->optionID . ', ' . $canViewTrophyDefaultValue . ') = 2)');
+ $friendshipConditionBuilder->add('user_trophy.userID IN (
+ SELECT userID
+ FROM wcf' . WCF_N . '_user_option_value
+ WHERE COALESCE(userOption' . UserOptionCacheBuilder::getInstance()->getData()['options']['canViewTrophies']->optionID . ', ' . $canViewTrophyDefaultValue . ') = 2
+ )');
$friendshipConditionBuilder->add(
- 'user_trophy.userID IN (SELECT userID FROM wcf' . WCF_N . '_user_follow WHERE followUserID = ?)',
+ 'user_trophy.userID IN (
+ SELECT userID
+ FROM wcf' . WCF_N . '_user_follow
+ WHERE followUserID = ?
+ )',
[WCF::getUser()->userID]
);
$conditionBuilder->add(
{
$objectList = new UsersOnlineList();
$objectList->getConditionBuilder()->add(
- 'session.userID IN (SELECT userID FROM wcf' . WCF_N . '_user_to_group WHERE groupID IN (SELECT groupID FROM wcf' . WCF_N . '_user_group WHERE showOnTeamPage = ?))',
+ 'session.userID IN (
+ SELECT userID
+ FROM wcf' . WCF_N . '_user_to_group
+ WHERE groupID IN (
+ SELECT groupID
+ FROM wcf' . WCF_N . '_user_group
+ WHERE showOnTeamPage = ?
+ )
+ )',
[1]
);
$list->getConditionBuilder()->add('category.isDisabled = ?', [0]);
if (!WCF::getUser()->userID) {
- $list->getConditionBuilder()->add('user_trophy.userID IN (SELECT userID FROM wcf' . WCF_N . '_user_option_value WHERE userOption' . UserOptionCacheBuilder::getInstance()->getData()['options']['canViewTrophies']->optionID . ' = 0)');
+ $list->getConditionBuilder()->add('user_trophy.userID IN (
+ SELECT userID
+ FROM wcf' . WCF_N . '_user_option_value
+ WHERE userOption' . UserOptionCacheBuilder::getInstance()->getData()['options']['canViewTrophies']->optionID . ' = 0
+ )');
} elseif (!WCF::getSession()->getPermission('admin.general.canViewPrivateUserOptions')) {
$conditionBuilder = new PreparedStatementConditionBuilder(false, 'OR');
- $conditionBuilder->add('user_trophy.userID IN (SELECT userID FROM wcf' . WCF_N . '_user_option_value WHERE (userOption' . UserOptionCacheBuilder::getInstance()->getData()['options']['canViewTrophies']->optionID . ' = 0 OR userOption' . UserOptionCacheBuilder::getInstance()->getData()['options']['canViewTrophies']->optionID . ' = 1))');
+ $conditionBuilder->add('user_trophy.userID IN (
+ SELECT userID
+ FROM wcf' . WCF_N . '_user_option_value
+ WHERE (
+ userOption' . UserOptionCacheBuilder::getInstance()->getData()['options']['canViewTrophies']->optionID . ' = 0
+ OR userOption' . UserOptionCacheBuilder::getInstance()->getData()['options']['canViewTrophies']->optionID . ' = 1
+ )
+ )');
$friendshipConditionBuilder = new PreparedStatementConditionBuilder(false);
- $friendshipConditionBuilder->add('user_trophy.userID IN (SELECT userID FROM wcf' . WCF_N . '_user_option_value WHERE userOption' . UserOptionCacheBuilder::getInstance()->getData()['options']['canViewTrophies']->optionID . ' = 2)');
+ $friendshipConditionBuilder->add('user_trophy.userID IN (
+ SELECT userID
+ FROM wcf' . WCF_N . '_user_option_value
+ WHERE userOption' . UserOptionCacheBuilder::getInstance()->getData()['options']['canViewTrophies']->optionID . ' = 2
+ )');
$friendshipConditionBuilder->add(
- 'user_trophy.userID IN (SELECT userID FROM wcf' . WCF_N . '_user_follow WHERE followUserID = ?)',
+ 'user_trophy.userID IN (
+ SELECT userID
+ FROM wcf' . WCF_N . '_user_follow
+ WHERE followUserID = ?
+ )',
[WCF::getUser()->userID]
);
$conditionBuilder->add(
)->objectTypeID,
]);
$conditionBuilder->add(
- 'objectID IN (SELECT categoryID FROM wcf' . WCF_N . '_category WHERE objectTypeID = ?)',
+ 'objectID IN (
+ SELECT categoryID
+ FROM wcf' . WCF_N . '_category
+ WHERE objectTypeID = ?
+ )',
[CategoryHandler::getInstance()->getObjectTypeByName('com.woltlab.wcf.article.category')->objectTypeID]
);
if (isset($conditionData['groupIDs'])) {
$objectList->getConditionBuilder()->add(
- $tableName . '.userID IN (SELECT userID FROM wcf' . WCF_N . '_user_to_group WHERE groupID IN (?) GROUP BY userID HAVING COUNT(userID) = ?)',
+ $tableName . '.userID IN (
+ SELECT userID
+ FROM wcf' . WCF_N . '_user_to_group
+ WHERE groupID IN (?)
+ GROUP BY userID
+ HAVING COUNT(userID) = ?
+ )',
[$conditionData['groupIDs'], \count($conditionData['groupIDs'])]
);
}
if (isset($conditionData['notGroupIDs'])) {
$objectList->getConditionBuilder()->add(
- $tableName . '.userID NOT IN (SELECT userID FROM wcf' . WCF_N . '_user_to_group WHERE groupID IN (?))',
+ $tableName . '.userID NOT IN (
+ SELECT userID
+ FROM wcf' . WCF_N . '_user_to_group
+ WHERE groupID IN (?)
+ )',
[$conditionData['notGroupIDs']]
);
}
if (isset($conditionData['userTrophyIDs'])) {
$objectList->getConditionBuilder()->add(
- 'user_table.userID IN (SELECT userID FROM wcf' . WCF_N . '_user_trophy WHERE trophyID IN (?) GROUP BY userID HAVING COUNT(DISTINCT trophyID) = ?)',
+ 'user_table.userID IN (
+ SELECT userID
+ FROM wcf' . WCF_N . '_user_trophy
+ WHERE trophyID IN (?)
+ GROUP BY userID
+ HAVING COUNT(DISTINCT trophyID) = ?
+ )',
[$conditionData['userTrophyIDs'], \count($conditionData['userTrophyIDs'])]
);
}
if (isset($conditionData['notUserTrophyIDs'])) {
$objectList->getConditionBuilder()->add(
- 'user_table.userID NOT IN (SELECT userID FROM wcf' . WCF_N . '_user_trophy WHERE trophyID IN (?))',
+ 'user_table.userID NOT IN (
+ SELECT userID
+ FROM wcf' . WCF_N . '_user_trophy
+ WHERE trophyID IN (?)
+ )',
[$conditionData['notUserTrophyIDs']]
);
}
"package_installation_queue.parentQueueID = ?",
[$this->installation->queue->queueID]
);
- $queueList->getConditionBuilder()->add("package_installation_queue.queueID NOT IN (SELECT queueID FROM wcf" . WCF_N . "_package_installation_node)");
+ $queueList->getConditionBuilder()->add("package_installation_queue.queueID NOT IN (
+ SELECT queueID
+ FROM wcf" . WCF_N . "_package_installation_node
+ )");
$queueList->readObjects();
foreach ($queueList as $queue) {
// get all update versions
$conditions = new PreparedStatementConditionBuilder();
$conditions->add("pu.packageUpdateServerID IN (?)", [$packageUpdateServerIDs]);
- $conditions->add("package IN (SELECT DISTINCT package FROM wcf" . WCF_N . "_package)");
+ $conditions->add("package IN (
+ SELECT DISTINCT package
+ FROM wcf" . WCF_N . "_package
+ )");
$sql = "SELECT pu.packageUpdateID, pu.packageUpdateServerID, pu.package,
puv.packageUpdateVersionID, puv.packageDate, puv.filename, puv.packageVersion
public function lookup($searchString)
{
$articleList = new ViewableArticleList();
- $articleList->sqlSelects = "(SELECT title FROM wcf" . WCF_N . "_article_content WHERE articleID = article.articleID AND (languageID IS NULL OR languageID = " . WCF::getLanguage()->languageID . ") LIMIT 1) AS title";
+ $articleList->sqlSelects = "(
+ SELECT title
+ FROM wcf" . WCF_N . "_article_content
+ WHERE articleID = article.articleID
+ AND (
+ languageID IS NULL
+ OR languageID = " . WCF::getLanguage()->languageID . "
+ )
+ LIMIT 1
+ ) AS title";
$articleList->getConditionBuilder()->add(
- 'article.articleID IN (SELECT articleID FROM wcf' . WCF_N . '_article_content WHERE title LIKE ?)',
+ 'article.articleID IN (
+ SELECT articleID
+ FROM wcf' . WCF_N . '_article_content
+ WHERE title LIKE ?
+ )',
['%' . $searchString . '%']
);
$articleList->sqlLimit = 10;
// prevent multiple awards from a trophy for a user
$userList->getConditionBuilder()->add(
- 'user_table.userID NOT IN (SELECT userID FROM wcf' . WCF_N . '_user_trophy WHERE trophyID IN (?))',
+ 'user_table.userID NOT IN (
+ SELECT userID
+ FROM wcf' . WCF_N . '_user_trophy
+ WHERE trophyID IN (?)
+ )',
[$trophy->trophyID]
);
$userList->readObjectIDs();
// In order not to get all users who do not fulfill the conditions (in case of
// doubt there can be many), we filter for users who have received the trophy.
$userList->getConditionBuilder()->add(
- 'user_table.userID IN (SELECT userID FROM wcf' . WCF_N . '_user_trophy WHERE trophyID IN (?))',
+ 'user_table.userID IN (
+ SELECT userID
+ FROM wcf' . WCF_N . '_user_trophy
+ WHERE trophyID IN (?)
+ )',
[$trophy->trophyID]
);
if (!empty($this->commentObjectIDs)) {
$articleList = new ViewableArticleList();
$articleList->getConditionBuilder()->add(
- "article.articleID IN (SELECT articleID FROM wcf" . WCF_N . "_article_content WHERE articleContentID IN (?))",
+ "article.articleID IN (
+ SELECT articleID
+ FROM wcf" . WCF_N . "_article_content
+ WHERE articleContentID IN (?)
+ )",
[$this->commentObjectIDs]
);
$articleList->readObjects();
if (!empty($articleContentIDs)) {
$articleList = new ViewableArticleList();
$articleList->getConditionBuilder()->add(
- "article.articleID IN (SELECT articleID FROM wcf" . WCF_N . "_article_content WHERE articleContentID IN (?))",
+ "article.articleID IN (
+ SELECT articleID
+ FROM wcf" . WCF_N . "_article_content
+ WHERE articleContentID IN (?)
+ )",
[$articleContentIDs]
);
$articleList->readObjects();
{
$userList = new UserList();
$userList->getConditionBuilder()->add(
- 'user_table.userID NOT IN (SELECT userID FROM wcf' . WCF_N . '_user_to_group WHERE groupID = ?)',
+ 'user_table.userID NOT IN (
+ SELECT userID
+ FROM wcf' . WCF_N . '_user_to_group
+ WHERE groupID = ?
+ )',
[$assignment->groupID]
);
if ($maxUsers !== null) {
if ($this->mailData['action'] == 'group') {
$this->conditions->add(
- "user.userID IN (SELECT userID FROM wcf" . WCF_N . "_user_to_group WHERE groupID IN (?))",
+ "user.userID IN (
+ SELECT userID
+ FROM wcf" . WCF_N . "_user_to_group
+ WHERE groupID IN (?)
+ )",
[$this->mailData['groupIDs']]
);
}