From: Alexander Ebert Date: Mon, 15 Jul 2019 16:06:36 +0000 (+0200) Subject: Removed the rating of reactions X-Git-Tag: 5.2.0_Alpha_2~10^2~6 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=25f91a2f3a776571c3e25a028b0d8542803052fb;p=GitHub%2FWoltLab%2FWCF.git Removed the rating of reactions See #2975 --- diff --git a/com.woltlab.wcf/objectType.xml b/com.woltlab.wcf/objectType.xml index d6bc997d97..138f01e525 100644 --- a/com.woltlab.wcf/objectType.xml +++ b/com.woltlab.wcf/objectType.xml @@ -601,12 +601,6 @@ wcf\system\stat\LikeStatDailyHandler com.woltlab.wcf.user - - com.woltlab.wcf.dislike - com.woltlab.wcf.statDailyHandler - wcf\system\stat\DislikeStatDailyHandler - com.woltlab.wcf.user - com.woltlab.wcf.userProfileComment com.woltlab.wcf.statDailyHandler @@ -676,23 +670,7 @@ com.woltlab.wcf.condition.userGroupAssignment wcf\system\condition\UserIntegerPropertyCondition contents - positiveReactionsReceived - 0 - - - com.woltlab.wcf.negativeReactionsReceived - com.woltlab.wcf.condition.userGroupAssignment - wcf\system\condition\UserIntegerPropertyCondition - contents - negativeReactionsReceived - 0 - - - com.woltlab.wcf.neutralReactionsReceived - com.woltlab.wcf.condition.userGroupAssignment - wcf\system\condition\UserIntegerPropertyCondition - contents - neutralReactionsReceived + likesReceived 0 @@ -784,23 +762,7 @@ com.woltlab.wcf.condition.trophy wcf\system\condition\UserIntegerPropertyCondition contents - positiveReactionsReceived - 0 - - - com.woltlab.wcf.negativeReactionsReceived - com.woltlab.wcf.condition.trophy - wcf\system\condition\UserIntegerPropertyCondition - contents - negativeReactionsReceived - 0 - - - com.woltlab.wcf.neutralReactionsReceived - com.woltlab.wcf.condition.trophy - wcf\system\condition\UserIntegerPropertyCondition - contents - neutralReactionsReceived + likesReceived 0 @@ -935,25 +897,7 @@ wcf\system\condition\UserIntegerPropertyCondition com.woltlab.wcf.user contents - positiveReactionsReceived - 0 - - - com.woltlab.wcf.negativeReactionsReceived - com.woltlab.wcf.condition.notice - wcf\system\condition\UserIntegerPropertyCondition - com.woltlab.wcf.user - contents - negativeReactionsReceived - 0 - - - com.woltlab.wcf.neutralReactionsReceived - com.woltlab.wcf.condition.notice - wcf\system\condition\UserIntegerPropertyCondition - com.woltlab.wcf.user - contents - neutralReactionsReceived + likesReceived 0 @@ -1159,25 +1103,7 @@ wcf\system\condition\UserIntegerPropertyCondition com.woltlab.wcf.user contents - positiveReactionsReceived - 0 - - - com.woltlab.wcf.negativeReactionsReceived - com.woltlab.wcf.condition.ad - wcf\system\condition\UserIntegerPropertyCondition - com.woltlab.wcf.user - contents - negativeReactionsReceived - 0 - - - com.woltlab.wcf.neutralReactionsReceived - com.woltlab.wcf.condition.ad - wcf\system\condition\UserIntegerPropertyCondition - com.woltlab.wcf.user - contents - neutralReactionsReceived + likesReceived 0 @@ -1386,23 +1312,7 @@ com.woltlab.wcf.bulkProcessing.user.condition wcf\system\condition\UserIntegerPropertyCondition contents - positiveReactionsReceived - 0 - - - com.woltlab.wcf.negativeReactionsReceived - com.woltlab.wcf.bulkProcessing.user.condition - wcf\system\condition\UserIntegerPropertyCondition - contents - negativeReactionsReceived - 0 - - - com.woltlab.wcf.neutralReactionsReceived - com.woltlab.wcf.bulkProcessing.user.condition - wcf\system\condition\UserIntegerPropertyCondition - contents - neutralReactionsReceived + likesReceived 0 @@ -1500,23 +1410,7 @@ com.woltlab.wcf.condition.userSearch wcf\system\condition\UserIntegerPropertyCondition contents - positiveReactionsReceived - 0 - - - com.woltlab.wcf.negativeReactionsReceived - com.woltlab.wcf.condition.userSearch - wcf\system\condition\UserIntegerPropertyCondition - contents - negativeReactionsReceived - 0 - - - com.woltlab.wcf.neutralReactionsReceived - com.woltlab.wcf.condition.userSearch - wcf\system\condition\UserIntegerPropertyCondition - contents - neutralReactionsReceived + likesReceived 0 diff --git a/com.woltlab.wcf/templates/messageSidebar.tpl b/com.woltlab.wcf/templates/messageSidebar.tpl index 7737777e4f..aeac425de8 100644 --- a/com.woltlab.wcf/templates/messageSidebar.tpl +++ b/com.woltlab.wcf/templates/messageSidebar.tpl @@ -82,9 +82,8 @@
{content} {if MODULE_LIKE && MESSAGE_SIDEBAR_ENABLE_LIKES_RECEIVED && !$isReply} - {assign var=overallReactionCount value=$userProfile->positiveReactionsReceived - $userProfile->negativeReactionsReceived}
{lang}wcf.like.likesReceived{/lang}
-
{#$overallReactionCount}
+
{#$userProfile->cumulativeLikes}
{/if} {if MESSAGE_SIDEBAR_ENABLE_ACTIVITY_POINTS && $userProfile->activityPoints} diff --git a/com.woltlab.wcf/templates/userInformationStatistics.tpl b/com.woltlab.wcf/templates/userInformationStatistics.tpl index a5fd115378..df4d9a92cf 100644 --- a/com.woltlab.wcf/templates/userInformationStatistics.tpl +++ b/com.woltlab.wcf/templates/userInformationStatistics.tpl @@ -2,12 +2,9 @@ {event name='statistics'} -{if MODULE_LIKE} - {assign var=reactionReputation value=$user->positiveReactionsReceived - $user->negativeReactionsReceived} - {if $reactionReputation} -
{if $__wcf->getSession()->getPermission('user.profile.canViewUserProfile') && !$user->isProtected()}{lang}wcf.like.reputation{/lang}{else}{lang}wcf.like.reputation{/lang}{/if}
-
{#$reactionReputation}
- {/if} +{if MODULE_LIKE && $user->cumulativeLikes} +
{if $__wcf->getSession()->getPermission('user.profile.canViewUserProfile') && !$user->isProtected()}{lang}wcf.like.reputation{/lang}{else}{lang}wcf.like.reputation{/lang}{/if}
+
{#$user->cumulativeLikes}
{/if} {if $user->activityPoints} diff --git a/wcfsetup/install/files/acp/update-com.woltlab.wcf_3.2_reactionUpdate.php b/wcfsetup/install/files/acp/update-com.woltlab.wcf_3.2_reactionUpdate.php index 18069c303e..915ea28149 100644 --- a/wcfsetup/install/files/acp/update-com.woltlab.wcf_3.2_reactionUpdate.php +++ b/wcfsetup/install/files/acp/update-com.woltlab.wcf_3.2_reactionUpdate.php @@ -25,36 +25,30 @@ try { WCF::getDB()->beginTransaction(); $reactionTypes = <<prepareStatement(str_replace('wcf1_', 'wcf'.WCF_N.'_', 'INSERT INTO wcf1_reaction_type (title, type, showOrder, iconFile) VALUES '. $reactionTypes)); + $statement = WCF::getDB()->prepareStatement('INSERT INTO wcf'.WCF_N.'_reaction_type (title, showOrder, iconFile) VALUES '. $reactionTypes); $statement->execute(); // update current likes - $sql = "UPDATE wcf1_like SET reactionTypeID = ? WHERE likeValue = ?"; - $statement = WCF::getDB()->prepareStatement(str_replace('wcf1_', 'wcf'.WCF_N.'_', $sql)); - + $sql = "UPDATE wcf".WCF_N."_like SET reactionTypeID = ? WHERE likeValue = ?"; + $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([ Like::LIKE, 1 ]); - $statement->execute([ - Like::DISLIKE, - 3 - ]); - // delete outdated likes, which aren't likes nor dislikes (normally none should exist) - $sql = "DELETE FROM wcf1_like WHERE reactionTypeID = 0"; - $statement = WCF::getDB()->prepareStatement(str_replace('wcf1_', 'wcf'.WCF_N.'_', $sql)); + // Delete outdated or unsupported likes. + WCF::getDB()->prepareStatement("DELETE FROM wcf".WCF_N."_like WHERE reactionTypeID = 0")->execute(); // add foreign key - $statement = WCF::getDB()->prepareStatement(str_replace('wcf1_', 'wcf'.WCF_N.'_', 'ALTER TABLE wcf1_like ADD FOREIGN KEY (reactionTypeID) REFERENCES wcf1_reaction_type (reactionTypeID) ON DELETE CASCADE')); + $statement = WCF::getDB()->prepareStatement('ALTER TABLE wcf'.WCF_N.'_like ADD FOREIGN KEY (reactionTypeID) REFERENCES wcf1_reaction_type (reactionTypeID) ON DELETE CASCADE'); $statement->execute(); WCF::getDB()->commitTransaction(); diff --git a/wcfsetup/install/files/lib/acp/form/ReactionTypeAddForm.class.php b/wcfsetup/install/files/lib/acp/form/ReactionTypeAddForm.class.php index dce9282938..62b704c436 100644 --- a/wcfsetup/install/files/lib/acp/form/ReactionTypeAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/ReactionTypeAddForm.class.php @@ -60,15 +60,6 @@ class ReactionTypeAddForm extends AbstractFormBuilderForm { ->maximumLength(255) ->i18n() ->languageItemPattern('wcf.reactionType.title\d+'), - RadioButtonFormField::create('type') - ->label('wcf.acp.reactionType.type') - ->required() - ->options([ - ReactionType::REACTION_TYPE_POSITIVE => 'wcf.acp.reactionType.type.positive', - ReactionType::REACTION_TYPE_NEUTRAL => 'wcf.acp.reactionType.type.neutral', - ReactionType::REACTION_TYPE_NEGATIVE => 'wcf.acp.reactionType.type.negative' - ]) - ->value(ReactionType::REACTION_TYPE_POSITIVE), ShowOrderFormField::create() ->description('wcf.acp.reactionType.showOrder.description') ->required() diff --git a/wcfsetup/install/files/lib/data/article/ViewableArticleList.class.php b/wcfsetup/install/files/lib/data/article/ViewableArticleList.class.php index bb18a65639..de8231b940 100644 --- a/wcfsetup/install/files/lib/data/article/ViewableArticleList.class.php +++ b/wcfsetup/install/files/lib/data/article/ViewableArticleList.class.php @@ -3,7 +3,6 @@ namespace wcf\data\article; use wcf\data\article\content\ViewableArticleContentList; use wcf\system\cache\runtime\UserProfileRuntimeCache; use wcf\system\label\object\ArticleLabelObjectHandler; -use wcf\system\reaction\ReactionHandler; use wcf\system\visitTracker\VisitTracker; use wcf\system\WCF; @@ -45,11 +44,6 @@ class ViewableArticleList extends ArticleList { $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.")"; } - - // get like status - if (!empty($this->sqlSelects)) $this->sqlSelects .= ','; - $this->sqlSelects .= "like_object.likes, like_object.dislikes, like_object.neutralReactions"; - $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)"; } /** diff --git a/wcfsetup/install/files/lib/data/like/Like.class.php b/wcfsetup/install/files/lib/data/like/Like.class.php index be6e5c7c4a..f5a7143d61 100644 --- a/wcfsetup/install/files/lib/data/like/Like.class.php +++ b/wcfsetup/install/files/lib/data/like/Like.class.php @@ -72,26 +72,6 @@ class Like extends DatabaseObject { return 'like_table'; } - /** - * Returns true, if like value is a like. - * - * @return boolean - * @deprecated 5.2 - */ - public function isLike() { - return $this->getReactionType()->isPositive(); - } - - /** - * Returns true, if like value is a dislike. - * - * @return boolean - * @deprecated 5.2 - */ - public function isDislike() { - return $this->getReactionType()->isNegative(); - } - /** * Returns the reaction for these like. * diff --git a/wcfsetup/install/files/lib/data/like/object/LikeObject.class.php b/wcfsetup/install/files/lib/data/like/object/LikeObject.class.php index e713a16b6b..4d643b922c 100644 --- a/wcfsetup/install/files/lib/data/like/object/LikeObject.class.php +++ b/wcfsetup/install/files/lib/data/like/object/LikeObject.class.php @@ -4,7 +4,6 @@ use wcf\data\object\type\ObjectTypeCache; use wcf\data\reaction\type\ReactionTypeCache; use wcf\data\user\User; use wcf\data\DatabaseObject; -use wcf\system\reaction\ReactionHandler; use wcf\system\WCF; use wcf\util\JSON; @@ -21,9 +20,8 @@ use wcf\util\JSON; * @property-read integer $objectID id of the liked object * @property-read integer|null $objectUserID id of the user who created the liked object or null if user has been deleted or object was created by guest * @property-read integer $likes number of likes of the liked object - * @property-read integer $dislikes number of dislikes of the liked object - * @property-read integer $neutralReactions number of neutral reactions on the liked object - * @property-read integer $cumulativeLikes cumulative result of likes (counting +1) and dislikes (counting -1) + * @property-read integer $dislikes legacy column, not used anymore + * @property-read integer $cumulativeLikes number of likes of the liked object * @property-read string $cachedUsers serialized array with the ids and names of the three users who liked (+1) the object last * @property-read string $cachedReactions serialized array with the reactionTypeIDs and the count of the reactions */ @@ -151,30 +149,6 @@ class LikeObject extends DatabaseObject { return $this->reactions; } - /** - * Returns the reputation of the current like object. Returns null, if - * there are no reactions on the object. - * - * @return integer|null - * @since 5.2 - */ - public function getReputation() { - if ($this->reputation === null && !empty($this->getReactions())) { - $this->reputation = 0; - foreach ($this->getReactions() as $reactionTypeID => $data) { - $reactionType = ReactionHandler::getInstance()->getReactionTypeByID($reactionTypeID); - if ($reactionType->isPositive()) { - $this->reputation += $data['reactionCount']; - } - else if ($reactionType->isNegative()) { - $this->reputation -= $data['reactionCount']; - } - } - } - - return $this->reputation; - } - /** * Sets the liked object. * diff --git a/wcfsetup/install/files/lib/data/reaction/ReactionAction.class.php b/wcfsetup/install/files/lib/data/reaction/ReactionAction.class.php index 50fe922e39..4d729ec359 100644 --- a/wcfsetup/install/files/lib/data/reaction/ReactionAction.class.php +++ b/wcfsetup/install/files/lib/data/reaction/ReactionAction.class.php @@ -319,49 +319,25 @@ class ReactionAction extends AbstractDatabaseObjectAction { // if ($newLikeObject->objectUserID) { - $sql = "SELECT COUNT(*) as count, like_table.reactionTypeID - FROM wcf".WCF_N."_like like_table - WHERE like_table.objectTypeID = ? - AND like_table.objectID = ? - GROUP BY like_table.reactionTypeID"; + $sql = "SELECT COUNT(*) as count + FROM wcf".WCF_N."_like + WHERE objectTypeID = ? + AND objectID = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([ $targetObjectType->objectTypeID, $this->parameters['targetObjectID'] ]); - - $updateValues = [ - 'positive' => 0, - 'neutral' => 0, - 'negative' => 0 - ]; - while ($row = $statement->fetchArray()) { - $reactionType = ReactionTypeCache::getInstance()->getReactionTypeByID($row['reactionTypeID']); - - if (!$reactionType->isDisabled) { - if ($reactionType->isPositive()) { - $updateValues['positive'] += $row['count']; - } - else if ($reactionType->isNegative()) { - $updateValues['negative'] += $row['count']; - } - else if ($reactionType->isNeutral()) { - $updateValues['neutral'] += $row['count']; - } - } - } + $count = $statement->fetchSingleColumn(); // update received likes $userEditor = new UserEditor(new User($newLikeObject->objectUserID)); $userEditor->updateCounters([ - 'likesReceived' => $updateValues['positive'], - 'positiveReactionsReceived' => $updateValues['positive'], - 'negativeReactionsReceived' => $updateValues['negative'], - 'neutralReactionsReceived' => $updateValues['neutral'] + 'likesReceived' => $count, ]); // add activity points - UserActivityPointHandler::getInstance()->fireEvents('com.woltlab.wcf.like.activityPointEvent.receivedLikes', [$newLikeObject->objectUserID => $updateValues['positive']]); + UserActivityPointHandler::getInstance()->fireEvents('com.woltlab.wcf.like.activityPointEvent.receivedLikes', [$newLikeObject->objectUserID => $count]); } } } diff --git a/wcfsetup/install/files/lib/data/reaction/type/ReactionType.class.php b/wcfsetup/install/files/lib/data/reaction/type/ReactionType.class.php index 8d14204479..771d841a1f 100644 --- a/wcfsetup/install/files/lib/data/reaction/type/ReactionType.class.php +++ b/wcfsetup/install/files/lib/data/reaction/type/ReactionType.class.php @@ -15,30 +15,11 @@ use wcf\system\WCF; * * @property-read integer $reactionTypeID unique id of the reaction type * @property-read string $title - * @property-read integer $type type of the reaction (1 is positive, 0 is neutral and -1 is negative) * @property-read integer $showOrder position of the reaction type in relation to the other reaction types * @property-read string $iconFile the file location of the icon * @property-read integer $isDisabled is `1` if the reaction type is disabled and thus not shown, otherwise `0` */ class ReactionType extends DatabaseObject implements ITitledObject { - /** - * The type value, if this reaction type is a positive reaction. - * @var integer - */ - const REACTION_TYPE_POSITIVE = 1; - - /** - * The type value, if this reaction type is a neutral reaction. - * @var integer - */ - const REACTION_TYPE_NEUTRAL = 0; - - /** - * The type value, if this reaction type is a negative reaction. - * @var integer - */ - const REACTION_TYPE_NEGATIVE = -1; - /** * @inheritDoc */ @@ -71,33 +52,6 @@ class ReactionType extends DatabaseObject implements ITitledObject { return WCF::getPath() . 'images/reaction/'. $this->iconFile; } - /** - * Returns true, if reaction is a positive reaction. - * - * @return bool - */ - public function isPositive() { - return $this->type == self::REACTION_TYPE_POSITIVE; - } - - /** - * Returns true, if reaction is a negative reaction. - * - * @return bool - */ - public function isNegative() { - return $this->type == self::REACTION_TYPE_NEGATIVE; - } - - /** - * Returns true, if reaction is a neutral reaction. - * - * @return bool - */ - public function isNeutral() { - return $this->type == self::REACTION_TYPE_NEUTRAL; - } - /** * Returns the absolute location of the icon file. * diff --git a/wcfsetup/install/files/lib/page/MembersListPage.class.php b/wcfsetup/install/files/lib/page/MembersListPage.class.php index 2f96b3bbfd..da08ea6ebd 100644 --- a/wcfsetup/install/files/lib/page/MembersListPage.class.php +++ b/wcfsetup/install/files/lib/page/MembersListPage.class.php @@ -134,7 +134,7 @@ class MembersListPage extends SortablePage { */ protected function readObjects() { if ($this->sortField === 'reactionReputation') { - $this->sqlOrderBy = '(user_table.positiveReactionsReceived - user_table.negativeReactionsReceived) '. $this->sortOrder; + $this->sqlOrderBy = 'user_table.likesReceived '. $this->sortOrder; } parent::readObjects(); diff --git a/wcfsetup/install/files/lib/system/condition/UserReputationCondition.class.php b/wcfsetup/install/files/lib/system/condition/UserReputationCondition.class.php index a1df321757..0fad8b6151 100644 --- a/wcfsetup/install/files/lib/system/condition/UserReputationCondition.class.php +++ b/wcfsetup/install/files/lib/system/condition/UserReputationCondition.class.php @@ -27,10 +27,10 @@ class UserReputationCondition extends AbstractIntegerCondition implements IConte if (isset($conditionData['greaterThan'])) { /** @noinspection PhpUndefinedFieldInspection */ - $objectList->getConditionBuilder()->add('(user_table.positiveReactionsReceived - user_table.negativeReactionsReceived) > ?', [$conditionData['greaterThan']]); + $objectList->getConditionBuilder()->add('user_table.likesReceived > ?', [$conditionData['greaterThan']]); } if (isset($conditionData['lessThan'])) { - $objectList->getConditionBuilder()->add('(user_table.positiveReactionsReceived - user_table.negativeReactionsReceived) < ?', [$conditionData['lessThan']]); + $objectList->getConditionBuilder()->add('user_table.likesReceived < ?', [$conditionData['lessThan']]); } } @@ -38,10 +38,10 @@ class UserReputationCondition extends AbstractIntegerCondition implements IConte * @inheritDoc */ public function checkUser(Condition $condition, User $user) { - if ($condition->greaterThan !== null && ($user->positiveReactionsReceived - $user->negativeReactionsReceived) <= $condition->greaterThan) { + if ($condition->greaterThan !== null && $user->likesReceived <= $condition->greaterThan) { return false; } - if ($condition->lessThan !== null && ($user->positiveReactionsReceived - $user->negativeReactionsReceived) >= $condition->lessThan) { + if ($condition->lessThan !== null && $user->likesReceived >= $condition->lessThan) { return false; } diff --git a/wcfsetup/install/files/lib/system/importer/AbstractLikeImporter.class.php b/wcfsetup/install/files/lib/system/importer/AbstractLikeImporter.class.php index a0a85cf4dd..6656a696fc 100644 --- a/wcfsetup/install/files/lib/system/importer/AbstractLikeImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/AbstractLikeImporter.class.php @@ -36,10 +36,7 @@ class AbstractLikeImporter extends AbstractImporter { if (!isset($data['reactionTypeID'])) { if ($data['likeValue'] == 1) { - $data['reactionTypeID'] = ReactionHandler::getInstance()->getLegacyReactionTypeID(ReactionType::REACTION_TYPE_POSITIVE); - } - else { - $data['reactionTypeID'] = ReactionHandler::getInstance()->getLegacyReactionTypeID(ReactionType::REACTION_TYPE_NEGATIVE); + $data['reactionTypeID'] = ReactionHandler::getInstance()->getFirstReactionTypeID(); } } else { diff --git a/wcfsetup/install/files/lib/system/like/LikeHandler.class.php b/wcfsetup/install/files/lib/system/like/LikeHandler.class.php index 7162bad46e..85d5368d00 100644 --- a/wcfsetup/install/files/lib/system/like/LikeHandler.class.php +++ b/wcfsetup/install/files/lib/system/like/LikeHandler.class.php @@ -101,11 +101,9 @@ class LikeHandler extends SingletonFactory { * @return array */ public function like(ILikeObject $likeable, User $user, $likeValue, $time = TIME_NOW) { + $reactionTypeID = null; if ($likeValue == 1) { - $reactionTypeID = ReactionHandler::getInstance()->getLegacyReactionTypeID(ReactionType::REACTION_TYPE_POSITIVE); - } - else { - $reactionTypeID = ReactionHandler::getInstance()->getLegacyReactionTypeID(ReactionType::REACTION_TYPE_NEGATIVE); + $reactionTypeID = ReactionHandler::getInstance()->getFirstReactionTypeID(); } if ($reactionTypeID === null) { @@ -114,27 +112,18 @@ class LikeHandler extends SingletonFactory { 'like' => 0, 'newValue' => 0, 'oldValue' => 0, - 'users' => [] + 'users' => [], ]; } $reactData = ReactionHandler::getInstance()->react($likeable, $user, $reactionTypeID, $time); - if ($reactData['reactionTypeID'] === null) { - $newValue = 0; - } - else if (ReactionTypeCache::getInstance()->getReactionTypeByID($reactData['reactionTypeID'])->type == ReactionType::REACTION_TYPE_NEGATIVE) { - $newValue = -1; - } - else { - $newValue = 1; - } return [ 'data' => $this->loadLikeStatus($reactData['likeObject'], $user), 'like' => $reactData['like'], - 'newValue' => $newValue, - 'oldValue' => 0, // this value is currently a dummy value, maybe determine a real value - 'users' => [] + 'newValue' => 0, + 'oldValue' => 0, + 'users' => [], ]; } @@ -154,8 +143,8 @@ class LikeHandler extends SingletonFactory { 'data' => $this->loadLikeStatus($reactData['likeObject'], $user), 'like' => null, 'newValue' => 0, - 'oldValue' => 0, // this value is currently a dummy value, maybe determine a real value - 'users' => [] + 'oldValue' => 0, + 'users' => [], ]; } diff --git a/wcfsetup/install/files/lib/system/reaction/ReactionHandler.class.php b/wcfsetup/install/files/lib/system/reaction/ReactionHandler.class.php index 986b38b09a..3cca143be8 100644 --- a/wcfsetup/install/files/lib/system/reaction/ReactionHandler.class.php +++ b/wcfsetup/install/files/lib/system/reaction/ReactionHandler.class.php @@ -326,7 +326,7 @@ class ReactionHandler extends SingletonFactory { 'reactionTypeID' => $reactionTypeID ]); - if ($reaction->isPositive() && $likeable->getUserID()) { + if ($likeable->getUserID()) { UserActivityPointHandler::getInstance()->fireEvent('com.woltlab.wcf.like.activityPointEvent.receivedLikes', $like->likeID, $likeable->getUserID()); } } @@ -339,12 +339,7 @@ class ReactionHandler extends SingletonFactory { ]); if ($likeable->getUserID()) { - if ($like->getReactionType()->isPositive() && !$reaction->isPositive()) { - UserActivityPointHandler::getInstance()->removeEvents('com.woltlab.wcf.like.activityPointEvent.receivedLikes', [$likeable->getUserID() => 1]); - } - else if (!$like->getReactionType()->isPositive() && $reaction->isPositive()) { - UserActivityPointHandler::getInstance()->fireEvent('com.woltlab.wcf.like.activityPointEvent.receivedLikes', $like->likeID, $likeable->getUserID()); - } + UserActivityPointHandler::getInstance()->removeEvents('com.woltlab.wcf.like.activityPointEvent.receivedLikes', [$likeable->getUserID() => 1]); } } @@ -402,9 +397,6 @@ class ReactionHandler extends SingletonFactory { private function updateLikeObject(ILikeObject $likeable, LikeObject $likeObject, Like $like, ReactionType $reactionType) { // update existing object if ($likeObject->likeObjectID) { - $likes = $likeObject->likes; - $dislikes = $likeObject->dislikes; - $neutralReactions = $likeObject->neutralReactions; $cumulativeLikes = $likeObject->cumulativeLikes; if ($likeObject->cachedReactions !== null) { @@ -419,17 +411,7 @@ class ReactionHandler extends SingletonFactory { } if ($like->likeID) { - if ($like->getReactionType()->isPositive()) { - $likes--; - $cumulativeLikes--; - } - else if ($like->getReactionType()->isNegative()) { - $dislikes--; - $cumulativeLikes++; - } - else { - $neutralReactions--; - } + $cumulativeLikes--; if (isset($cachedReactions[$like->getReactionType()->reactionTypeID])) { if (--$cachedReactions[$like->getReactionType()->reactionTypeID] == 0) { @@ -438,17 +420,7 @@ class ReactionHandler extends SingletonFactory { } } - if ($reactionType->isPositive()) { - $likes++; - $cumulativeLikes++; - } - else if ($reactionType->isNegative()) { - $dislikes++; - $cumulativeLikes--; - } - else { - $neutralReactions++; - } + $cumulativeLikes++; if (isset($cachedReactions[$reactionType->reactionTypeID])) { $cachedReactions[$reactionType->reactionTypeID]++; @@ -459,11 +431,10 @@ class ReactionHandler extends SingletonFactory { // build update date $updateData = [ - 'likes' => $likes, - 'dislikes' => $dislikes, - 'neutralReactions' => $neutralReactions, + 'likes' => $cumulativeLikes, + 'dislikes' => 0, 'cumulativeLikes' => $cumulativeLikes, - 'cachedReactions' => serialize($cachedReactions) + 'cachedReactions' => serialize($cachedReactions), ]; // update data @@ -471,9 +442,9 @@ class ReactionHandler extends SingletonFactory { $likeObjectEditor->update($updateData); } else { - $cumulativeLikes = $reactionType->type; + $cumulativeLikes = 1; $cachedReactions = [ - $reactionType->reactionTypeID => 1 + $reactionType->reactionTypeID => 1, ]; // create cache @@ -481,18 +452,17 @@ class ReactionHandler extends SingletonFactory { 'objectTypeID' => $likeable->getObjectType()->objectTypeID, 'objectID' => $likeable->getObjectID(), 'objectUserID' => $likeable->getUserID() ?: null, - 'likes' => ($reactionType->isPositive()) ? 1 : 0, - 'dislikes' => ($reactionType->isNegative()) ? 1 : 0, - 'neutralReactions' => ($reactionType->isNeutral()) ? 1 : 0, + 'likes' => $cumulativeLikes, + 'dislikes' => 0, 'cumulativeLikes' => $cumulativeLikes, - 'cachedReactions' => serialize($cachedReactions) + 'cachedReactions' => serialize($cachedReactions), ]); } return [ 'cumulativeLikes' => $cumulativeLikes, 'cachedReactions' => $cachedReactions, - 'likeObject' => $likeObject + 'likeObject' => $likeObject, ]; } @@ -506,41 +476,19 @@ class ReactionHandler extends SingletonFactory { */ private function updateUsersLikeCounter(ILikeObject $likeable, LikeObject $likeObject, Like $like, ReactionType $reactionType = null) { if ($likeable->getUserID()) { - $counters = [ - 'likesReceived' => 0, - 'positiveReactionsReceived' => 0, - 'negativeReactionsReceived' => 0, - 'neutralReactionsReceived' => 0 - ]; - + $likesReceived = 0; if ($like->likeID) { - if ($like->getReactionType()->isPositive()) { - $counters['likesReceived']--; - $counters['positiveReactionsReceived']--; - } - else if ($like->getReactionType()->isNegative()) { - $counters['negativeReactionsReceived']--; - } - else if ($like->getReactionType()->isNeutral()) { - $counters['neutralReactionsReceived']--; - } + $likesReceived--; } if ($reactionType !== null) { - if ($reactionType->isPositive()) { - $counters['likesReceived']++; - $counters['positiveReactionsReceived']++; - } - else if ($reactionType->isNegative()) { - $counters['negativeReactionsReceived']++; - } - else if ($reactionType->isNeutral()) { - $counters['neutralReactionsReceived']++; - } + $likesReceived++; } - $userEditor = new UserEditor(UserRuntimeCache::getInstance()->getObject($likeable->getUserID())); - $userEditor->updateCounters($counters); + if ($likesReceived !== 0) { + $userEditor = new UserEditor(UserRuntimeCache::getInstance()->getObject($likeable->getUserID())); + $userEditor->updateCounters(['likesReceived' => $likesReceived]); + } } } @@ -569,7 +517,7 @@ class ReactionHandler extends SingletonFactory { $likeEditor = new LikeEditor($like); $likeEditor->delete(); - if ($likeable->getUserID() && $like->getReactionType()->isPositive()) { + if ($likeable->getUserID()) { UserActivityPointHandler::getInstance()->removeEvents('com.woltlab.wcf.like.activityPointEvent.receivedLikes', [$likeable->getUserID() => 1]); } @@ -615,9 +563,6 @@ class ReactionHandler extends SingletonFactory { } // update existing object - $likes = $likeObject->likes; - $dislikes = $likeObject->dislikes; - $neutralReactions = $likeObject->neutralReactions; $cumulativeLikes = $likeObject->cumulativeLikes; $cachedReactions = @unserialize($likeObject->cachedReactions); if (!is_array($cachedReactions)) { @@ -625,20 +570,7 @@ class ReactionHandler extends SingletonFactory { } if ($like->likeID) { - if ($like->getReactionType()->isPositive()) { - $likes--; - $cumulativeLikes--; - } - else if ($like->getReactionType()->isNegative()) { - $dislikes--; - $cumulativeLikes++; - } - else if ($like->getReactionType()->isNeutral()) { - $neutralReactions--; - } - else { - throw new \LogicException('Unreachable'); - } + $cumulativeLikes--; if (isset($cachedReactions[$like->getReactionType()->reactionTypeID])) { if (--$cachedReactions[$like->getReactionType()->reactionTypeID] == 0) { @@ -648,9 +580,8 @@ class ReactionHandler extends SingletonFactory { // build update date $updateData = [ - 'likes' => $likes, - 'dislikes' => $dislikes, - 'neutralReactions' => $neutralReactions, + 'likes' => $cumulativeLikes, + 'dislikes' => 0, 'cumulativeLikes' => $cumulativeLikes, 'cachedReactions' => serialize($cachedReactions) ]; @@ -694,43 +625,17 @@ class ReactionHandler extends SingletonFactory { foreach ($likeObjects as $likeObject) { if ($likeObject->likes) { if (!isset($users[$likeObject->objectUserID])) { - $users[$likeObject->objectUserID] = [ - 'positiveReactions' => 0, - 'negativeReactions' => 0, - 'neutralReactions' => 0 - ]; + $users[$likeObject->objectUserID] = 0; } - foreach ($likeObject->getReactions() as $reactionTypeID => $data) { - switch (ReactionTypeCache::getInstance()->getReactionTypeByID($reactionTypeID)->type) { - case ReactionType::REACTION_TYPE_POSITIVE: - $users[$likeObject->objectUserID]['positiveReactions'] += $data['reactionCount']; - break; - - case ReactionType::REACTION_TYPE_NEUTRAL: - $users[$likeObject->objectUserID]['neutralReactions'] += $data['reactionCount']; - break; - - case ReactionType::REACTION_TYPE_NEGATIVE: - $users[$likeObject->objectUserID]['negativeReactions'] += $data['reactionCount']; - break; - - default: - throw new \LogicException('Unreachable'); - } - } + $users[$likeObject->objectUserID] -= count($likeObject->getReactions()); } } foreach ($users as $userID => $reactionData) { $userEditor = new UserEditor(new User(null, ['userID' => $userID])); $userEditor->updateCounters([ - 'positiveReactionsReceived' => $users[$userID]['positiveReactions'] *-1, - 'negativeReactionsReceived' => $users[$userID]['negativeReactions'] *-1, - 'neutralReactionsReceived' => $users[$userID]['neutralReactions'] *-1, - - // maintain deprecated value for legacy reasons - 'likesReceived' => $users[$userID]['positiveReactions'] *-1 + 'likesReceived' => $users[$userID], ]); } @@ -741,13 +646,9 @@ class ReactionHandler extends SingletonFactory { $likeList->readObjects(); if (count($likeList)) { - $likeData = $positiveLikeData = []; + $likeData = []; foreach ($likeList as $like) { $likeData[$like->likeID] = $like->userID; - - if ($like->getReactionType()->isPositive()) { - $positiveLikeData[$like->likeID] = $like->userID; - } } // delete like notifications @@ -761,7 +662,7 @@ class ReactionHandler extends SingletonFactory { } // revoke activity points - UserActivityPointHandler::getInstance()->removeEvents('com.woltlab.wcf.like.activityPointEvent.receivedLikes', $positiveLikeData); + UserActivityPointHandler::getInstance()->removeEvents('com.woltlab.wcf.like.activityPointEvent.receivedLikes', $likeData); // delete likes LikeEditor::deleteAll(array_keys($likeData)); @@ -806,39 +707,31 @@ class ReactionHandler extends SingletonFactory { } /** - * Returns the legacy reactionTypeID for a specific type. The given type must be - * ReactionType::REACTION_TYPE_POSITIVE for a like - * or ReactionType::REACTION_TYPE_NEGATIVE for a dislike - * other values are not allowed and will resulted in a LogicException. - * If there are no legacy reaction type, the method returns null. + * Returns the first available reaction type. * - * @param integer $type - * @return integer|null + * @return ReactionType|null */ - public function getLegacyReactionTypeID($type) { - $reactionTypes = ReactionTypeCache::getInstance()->getEnabledReactionTypes(); - ReactionType::sort($reactionTypes, 'showOrder'); - switch ($type) { - case ReactionType::REACTION_TYPE_POSITIVE: - foreach ($reactionTypes as $reactionType) { - if ($reactionType->isPositive()) { - return $reactionType->reactionTypeID; - } - } - - return null; - - case ReactionType::REACTION_TYPE_NEGATIVE: - foreach ($reactionTypes as $reactionType) { - if ($reactionType->isNegative()) { - return $reactionType->reactionTypeID; - } - } - - return null; + public function getFirstReactionType() { + static $firstReactionType; + + if ($firstReactionType === null) { + $reactionTypes = ReactionTypeCache::getInstance()->getEnabledReactionTypes(); + ReactionType::sort($reactionTypes, 'showOrder'); - default: - throw new \LogicException('Invalid type given.'); + $firstReactionType = reset($reactionTypes); } + + return $firstReactionType; + } + + /** + * Returns the first available reaction type's id. + * + * @return int|null + */ + public function getFirstReactionTypeID() { + $firstReactionType = $this->getFirstReactionType(); + + return $firstReactionType ? $firstReactionType->reactionTypeID : null; } } diff --git a/wcfsetup/install/files/lib/system/stat/DislikeStatDailyHandler.class.php b/wcfsetup/install/files/lib/system/stat/DislikeStatDailyHandler.class.php deleted file mode 100644 index 9e6ba946d6..0000000000 --- a/wcfsetup/install/files/lib/system/stat/DislikeStatDailyHandler.class.php +++ /dev/null @@ -1,15 +0,0 @@ - - * @package WoltLabSuite\Core\System\Stat - */ -class DislikeStatDailyHandler extends LikeStatDailyHandler { - protected $likeValue = Like::DISLIKE; -} diff --git a/wcfsetup/install/files/lib/system/stat/LikeStatDailyHandler.class.php b/wcfsetup/install/files/lib/system/stat/LikeStatDailyHandler.class.php index 5902b7aa07..1053282453 100644 --- a/wcfsetup/install/files/lib/system/stat/LikeStatDailyHandler.class.php +++ b/wcfsetup/install/files/lib/system/stat/LikeStatDailyHandler.class.php @@ -1,6 +1,5 @@ prepareStatement($sql); - $statement->execute([$date, $date + 86399, $this->likeValue]); + $statement->execute([$date, $date + 86399]); $counter = intval($statement->fetchSingleColumn()); $sql = "SELECT COUNT(*) FROM wcf".WCF_N."_like - WHERE time < ? - AND likeValue = ?"; + WHERE time < ?"; $statement = WCF::getDB()->prepareStatement($sql); - $statement->execute([$date + 86400, $this->likeValue]); + $statement->execute([$date + 86400]); $total = intval($statement->fetchSingleColumn()); return [ diff --git a/wcfsetup/install/files/lib/system/worker/LikeRebuildDataWorker.class.php b/wcfsetup/install/files/lib/system/worker/LikeRebuildDataWorker.class.php index 8dc4d40c8e..f2682733a5 100644 --- a/wcfsetup/install/files/lib/system/worker/LikeRebuildDataWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/LikeRebuildDataWorker.class.php @@ -57,7 +57,7 @@ class LikeRebuildDataWorker extends AbstractRebuildDataWorker { $itemsToUser = []; $likeObjectData = []; foreach ($this->objectList as $like) { - if ($like->objectUserID && $like->likeValue == Like::LIKE) { + if ($like->objectUserID) { if (!isset($itemsToUser[$like->objectUserID])) { $itemsToUser[$like->objectUserID] = 0; } @@ -71,24 +71,14 @@ class LikeRebuildDataWorker extends AbstractRebuildDataWorker { if (!isset($likeObjectData[$like->objectTypeID][$like->objectID])) { $likeObjectData[$like->objectTypeID][$like->objectID] = [ 'likes' => 0, - 'dislikes' => 0, - 'neutralReactions' => 0, 'cumulativeLikes' => 0, 'objectUserID' => $like->objectUserID, 'cachedReactions' => [] ]; } - if ($like->isLike()) { - $likeObjectData[$like->objectTypeID][$like->objectID]['likes']++; - } - else if ($like->isDislike()) { - $likeObjectData[$like->objectTypeID][$like->objectID]['dislikes']++; - } - else { - $likeObjectData[$like->objectTypeID][$like->objectID]['neutralReactions']++; - } - $likeObjectData[$like->objectTypeID][$like->objectID]['cumulativeLikes'] += $like->likeValue; + $likeObjectData[$like->objectTypeID][$like->objectID]['likes']++; + $likeObjectData[$like->objectTypeID][$like->objectID]['cumulativeLikes']++; if (!isset($likeObjectData[$like->objectTypeID][$like->objectID]['cachedReactions'][$like->getReactionType()->reactionTypeID])) { $likeObjectData[$like->objectTypeID][$like->objectID]['cachedReactions'][$like->getReactionType()->reactionTypeID] = 0; @@ -101,11 +91,9 @@ class LikeRebuildDataWorker extends AbstractRebuildDataWorker { UserActivityPointHandler::getInstance()->fireEvents('com.woltlab.wcf.like.activityPointEvent.receivedLikes', $itemsToUser, false); $sql = "INSERT INTO wcf".WCF_N."_like_object - (objectTypeID, objectID, objectUserID, likes, dislikes, neutralReactions, cumulativeLikes, cachedReactions) - VALUES (?, ?, ?, ?, ?, ?, ?, ?) + (objectTypeID, objectID, objectUserID, likes, dislikes, cumulativeLikes, cachedReactions) + VALUES (?, ?, ?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE likes = likes + VALUES(likes), - dislikes = dislikes + VALUES(dislikes), - neutralReactions = neutralReactions + VALUES(neutralReactions), cumulativeLikes = cumulativeLikes + VALUES(cumulativeLikes), cachedReactions = VALUES(cachedReactions)"; $statement = WCF::getDB()->prepareStatement($sql); @@ -118,8 +106,6 @@ class LikeRebuildDataWorker extends AbstractRebuildDataWorker { $objectID, $data['objectUserID'], $data['likes'], - $data['dislikes'], - $data['neutralReactions'], $data['cumulativeLikes'], serialize($data['cachedReactions']) ]); diff --git a/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php b/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php index d319285edb..edac82bb93 100644 --- a/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php @@ -82,67 +82,21 @@ class UserRebuildDataWorker extends AbstractRebuildDataWorker { // update like counter if (MODULE_LIKE) { - $positiveReactionTypes = $negativeReactionTypes = $neutralReactionTypes = []; - - foreach (ReactionTypeCache::getInstance()->getEnabledReactionTypes() as $reactionType) { - switch ($reactionType->type) { - case ReactionType::REACTION_TYPE_POSITIVE: - $positiveReactionTypes[] = $reactionType->reactionTypeID; - break; - - case ReactionType::REACTION_TYPE_NEGATIVE: - $negativeReactionTypes[] = $reactionType->reactionTypeID; - break; - - case ReactionType::REACTION_TYPE_NEUTRAL: - $neutralReactionTypes[] = $reactionType->reactionTypeID; - break; - - default: - throw new \LogicException('Unreachable'); - } - } - $sql = "UPDATE wcf".WCF_N."_user user_table SET"; - - if (!empty($positiveReactionTypes)) { + + $reactionTypeIDs = array_keys(ReactionTypeCache::getInstance()->getEnabledReactionTypes()); + if (!empty($reactionTypeIDs)) { $sql .= " likesReceived = ( SELECT COUNT(*) FROM wcf".WCF_N."_like WHERE objectUserID = user_table.userID - AND reactionTypeID IN (". implode(',', $positiveReactionTypes) .") - ), positiveReactionsReceived = ( - SELECT COUNT(*) - FROM wcf".WCF_N."_like - WHERE objectUserID = user_table.userID - AND reactionTypeID IN (". implode(',', $positiveReactionTypes) ."))"; + AND reactionTypeID IN (". implode(',', $reactionTypeIDs) .") + )"; } else { - $sql .= " likesReceived = 0, positiveReactionsReceived = 0"; + $sql .= " likesReceived = 0"; } - if (!empty($negativeReactionTypes)) { - $sql .= ", negativeReactionsReceived = ( - SELECT COUNT(*) - FROM wcf".WCF_N."_like - WHERE objectUserID = user_table.userID - AND reactionTypeID IN (". implode(',', $negativeReactionTypes) ."))"; - } - else { - $sql .= ", negativeReactionsReceived = 0"; - } - - if (!empty($neutralReactionTypes)) { - $sql .= ", neutralReactionsReceived = ( - SELECT COUNT(*) - FROM wcf".WCF_N."_like - WHERE objectUserID = user_table.userID - AND reactionTypeID IN (". implode(',', $neutralReactionTypes) ."))"; - } - else { - $sql .= ", neutralReactionsReceived = 0"; - } - $sql .= " ".$conditionBuilder; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditionBuilder->getParameters()); diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index 5d5c150845..41b271a4da 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -2569,9 +2569,6 @@ Kein Abschnitt darf leer sein und alle Abschnitten dürfen nur folgende Zeichen {$reactionType->getTitle()} wirklich löschen?]]> - - - @@ -4904,9 +4901,6 @@ Die E-Mail-Adresse des neuen Benutzers lautet: {@$user->email} - - - diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index 5c15bb14f6..9f060d5ed8 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -2497,9 +2497,6 @@ If you have already bought the licenses for the listed apps, th {$reactionType->getTitle()}?]]> - - - @@ -4900,9 +4897,6 @@ Open the link below to access the user profile: - - - diff --git a/wcfsetup/setup/db/install.sql b/wcfsetup/setup/db/install.sql index 43762c2718..64af1aca36 100644 --- a/wcfsetup/setup/db/install.sql +++ b/wcfsetup/setup/db/install.sql @@ -678,7 +678,6 @@ CREATE TABLE wcf1_like_object ( objectUserID INT(10), likes MEDIUMINT(7) NOT NULL DEFAULT 0, dislikes MEDIUMINT(7) NOT NULL DEFAULT 0, - neutralReactions MEDIUMINT(7) NOT NULL DEFAULT 0, cumulativeLikes MEDIUMINT(7) NOT NULL DEFAULT 0, cachedUsers TEXT, cachedReactions TEXT, @@ -1201,7 +1200,6 @@ DROP TABLE IF EXISTS wcf1_reaction_type; CREATE TABLE wcf1_reaction_type ( reactionTypeID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, title VARCHAR(255), - type TINYINT(1), showOrder INT(10) NOT NULL DEFAULT 0, iconFile MEDIUMTEXT, isDisabled TINYINT(1) NOT NULL DEFAULT 0 @@ -1488,9 +1486,6 @@ CREATE TABLE wcf1_user ( disableCoverPhotoReason TEXT, disableCoverPhotoExpires INT(10) NOT NULL DEFAULT 0, articles INT(10) NOT NULL DEFAULT 0, - positiveReactionsReceived INT(10) NOT NULL DEFAULT 0, - negativeReactionsReceived INT(10) NOT NULL DEFAULT 0, - neutralReactionsReceived INT(10) NOT NULL DEFAULT 0, blacklistMatches VARCHAR(255) NOT NULL DEFAULT '', KEY username (username), @@ -1501,9 +1496,6 @@ CREATE TABLE wcf1_user ( KEY registrationData (registrationIpAddress, registrationDate), KEY activityPoints (activityPoints), KEY likesReceived (likesReceived), - KEY positiveReactionsReceived (positiveReactionsReceived), - KEY negativeReactionsReceived (negativeReactionsReceived), - KEY neutralReactionsReceived (neutralReactionsReceived), KEY authData (authData), KEY trophyPoints (trophyPoints) ); @@ -2430,8 +2422,8 @@ INSERT INTO wcf1_contact_option (optionID, optionTitle, optionDescription, optio INSERT INTO wcf1_contact_recipient (recipientID, name, email, isAdministrator, originIsSystem) VALUES (1, 'wcf.contact.recipient.name1', '', 1, 1); -- default reaction type -INSERT INTO wcf1_reaction_type (title, type, showOrder, iconFile) VALUES ('wcf.reactionType.title1', 1, 1, 'like.svg'); -INSERT INTO wcf1_reaction_type (title, type, showOrder, iconFile) VALUES ('wcf.reactionType.title2', 1, 2, 'haha.svg'); -INSERT INTO wcf1_reaction_type (title, type, showOrder, iconFile) VALUES ('wcf.reactionType.title3', -1, 3, 'sad.svg'); -INSERT INTO wcf1_reaction_type (title, type, showOrder, iconFile) VALUES ('wcf.reactionType.title4', 0, 4, 'confused.svg'); -INSERT INTO wcf1_reaction_type (title, type, showOrder, iconFile) VALUES ('wcf.reactionType.title5', 1, 5, 'thanks.svg'); +INSERT INTO wcf1_reaction_type (title, showOrder, iconFile) VALUES ('wcf.reactionType.title1', 1, 'like.svg'); +INSERT INTO wcf1_reaction_type (title, showOrder, iconFile) VALUES ('wcf.reactionType.title2', 2, 'haha.svg'); +INSERT INTO wcf1_reaction_type (title, showOrder, iconFile) VALUES ('wcf.reactionType.title3', 3, 'sad.svg'); +INSERT INTO wcf1_reaction_type (title, showOrder, iconFile) VALUES ('wcf.reactionType.title4', 4, 'confused.svg'); +INSERT INTO wcf1_reaction_type (title, showOrder, iconFile) VALUES ('wcf.reactionType.title5', 5, 'thanks.svg');