Skip to content

Commit

Permalink
Initial commit to change likes to reactions...
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Eshom <[email protected]>
  • Loading branch information
Oldiesmann committed Apr 27, 2024
1 parent bf6ad0f commit 130cca4
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 36 deletions.
2 changes: 1 addition & 1 deletion Languages/en_US/Alerts.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
$txt['alert_topic_unapproved_reply'] = '{member_link} replied to your unapproved topic, {topic_msg}, in {board_msg}';
$txt['alert_msg_quote'] = '{member_link} quoted you in {msg_msg}';
$txt['alert_msg_mention'] = '{member_link} mentioned you in {msg_msg}';
$txt['alert_msg_like'] = '{member_link} liked your post, {msg_msg}';
$txt['alert_msg_react'] = '{member_link} reacted to your post, {msg_msg}';
$txt['alert_msg_report'] = '{member_link} reported the post {msg_msg}';
$txt['alert_msg_report_reply'] = '{member_link} replied to the report about {msg_msg}';
$txt['alert_member_report'] = '{member_link} reported the profile of {profile_msg}';
Expand Down
33 changes: 18 additions & 15 deletions Languages/en_US/General.php
Original file line number Diff line number Diff line change
Expand Up @@ -845,24 +845,27 @@
// Mentions
$txt['mentions'] = 'Mentions';

// Likes
$txt['likes'] = 'Likes';
// Reactions. Previously "likes".
$txt['reactions'] = 'Reactions';
// Leave these two for now - "like" will still be the default
$txt['like'] = 'Like';
$txt['unlike'] = 'Unlike';
$txt['like_success'] = 'Your content was successfully liked.';
$txt['like_delete'] = 'Your content was successfully deleted.';
$txt['like_insert'] = 'Your content was successfully inserted.';
$txt['like_error'] = 'There was an error with your request.';
$txt['like_disable'] = 'Likes feature is disabled.';
$txt['not_valid_like_type'] = 'The liked type is not a valid type.';
$txt['likes_count'] = '{num, plural,
one {<a href="{url}"># person</a> likes this.}
other {<a href="{url}"># people</a> like this.}

// Todo - i18n this? Maybe react_{type}_success?
$txt['react_success'] = 'You succesfully reacted to the content ';
$txt['react_delete'] = 'Your content was successfully deleted.';
$txt['react_insert'] = 'Your content was successfully inserted.';
$txt['react_error'] = 'There was an error with your request.';
$txt['reactions_disable'] = 'Reactions feature is disabled.';
$txt['not_valid_react_type'] = 'The reacted type is not a valid type.';
$txt['reactions_count'] = '{num, plural,
one {<a href="{url}"># person</a> reacted to this.}
other {<a href="{url}"># people</a> reacted to this.}
}';
$txt['you_likes_count'] = '{num, plural,
=0 {You like this.}
one {You and <a href="{url}"># other person</a> like this.}
other {You and <a href="{url}"># other people</a> like this.}
$txt['you_reactions_count'] = '{num, plural,
=0 {You reacted to this.}
one {You and <a href="{url}"># other person</a> reacted to this.}
other {You and <a href="{url}"># other people</a> reacted to this.}
}';

$txt['report_to_mod'] = 'Report to moderator';
Expand Down
6 changes: 3 additions & 3 deletions Languages/en_US/ManagePermissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,9 @@
$txt['permissionname_report_any'] = 'Report posts to the moderators';
$txt['permissionhelp_report_any'] = 'This permission adds a link to each message, allowing a user to report a post to a moderator. On reporting, all moderators on that board will receive an email with a link to the reported post and a description of the problem (as given by the reporting user).';

$txt['permissiongroup_likes'] = 'Likes';
$txt['permissionname_likes_like'] = 'Can like any content';
$txt['permissionhelp_likes_like'] = 'This permission allows a user to like any content. Users are not allowed to like their own content.';
$txt['permissiongroup_reactions'] = 'Reactions';
$txt['permissionname_reactions_react'] = 'Can react to any content';
$txt['permissionhelp_reactions_react'] = 'This permission allows a user to react to any content. Users are not allowed to react to their own content.';

$txt['permissiongroup_mentions'] = 'Mentions';
$txt['permissionname_mention'] = 'Mention others via @name';
Expand Down
2 changes: 1 addition & 1 deletion Languages/en_US/Profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
$txt['alert_board_notify'] = 'When a new topic is created in a board I follow, I normally want to know via...';
$txt['alert_msg_mention'] = 'When my @name is mentioned in a post';
$txt['alert_msg_quote'] = 'When one of my posts is quoted';
$txt['alert_msg_like'] = 'When one of my posts is liked';
$txt['alert_msg_react'] = 'When someoe reacts to one of my posts';
$txt['alert_unapproved_reply'] = 'When a reply is made to my unapproved topic';
$txt['alert_group_pm'] = 'Personal Messages';
$txt['alert_pm_new'] = 'When I receive a new personal message';
Expand Down
15 changes: 8 additions & 7 deletions other/install_3-0_MySQL.sql
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ CREATE TABLE {$db_prefix}messages (
body TEXT NOT NULL,
icon VARCHAR(16) NOT NULL DEFAULT 'xx',
approved TINYINT NOT NULL DEFAULT '1',
likes SMALLINT UNSIGNED NOT NULL DEFAULT '0',
reacts SMALLINT UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (id_msg),
UNIQUE idx_id_board (id_board, id_msg, approved),
UNIQUE idx_id_member (id_member, id_msg),
Expand All @@ -815,7 +815,7 @@ CREATE TABLE {$db_prefix}messages (
INDEX idx_id_member_msg (id_member, approved, id_msg),
INDEX idx_current_topic (id_topic, id_msg, id_member, approved),
INDEX idx_related_ip (id_member, poster_ip, id_msg),
INDEX idx_likes (likes)
INDEX idx_reacts (reacts)
) ENGINE={$engine};

#
Expand Down Expand Up @@ -1188,17 +1188,18 @@ CREATE TABLE {$db_prefix}user_drafts (
) ENGINE={$engine};

#
# Table structure for table `user_likes`
# Table structure for table `user_reacts`
#

CREATE TABLE {$db_prefix}user_likes (
CREATE TABLE {$db_prefix}user_reacts (
id_member MEDIUMINT UNSIGNED DEFAULT '0',
content_type CHAR(6) DEFAULT '',
content_id INT UNSIGNED DEFAULT '0',
like_time INT UNSIGNED NOT NULL DEFAULT '0',
react_time INT UNSIGNED NOT NULL DEFAULT '0',
react_id INT UNSIGNED DEFAULT '0',
PRIMARY KEY (content_id, content_type, id_member),
INDEX content (content_id, content_type),
INDEX liker (id_member)
INDEX reactor (id_member)
) ENGINE={$engine};

#
Expand Down Expand Up @@ -2272,7 +2273,7 @@ VALUES (0, 'alert_timeout', 10),
(0, 'member_report', 3),
(0, 'member_report_reply', 3),
(0, 'msg_auto_notify', 0),
(0, 'msg_like', 1),
(0, 'msg_react', 1),
(0, 'msg_mention', 1),
(0, 'msg_notify_pref', 1),
(0, 'msg_notify_type', 1),
Expand Down
19 changes: 10 additions & 9 deletions other/install_3-0_PostgreSQL.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1210,7 +1210,7 @@ CREATE TABLE {$db_prefix}messages (
body text NOT NULL,
icon varchar(16) NOT NULL DEFAULT 'xx',
approved smallint NOT NULL DEFAULT '1',
likes smallint NOT NULL DEFAULT '0',
reacts smallint NOT NULL DEFAULT '0',
PRIMARY KEY (id_msg)
);

Expand All @@ -1226,7 +1226,7 @@ CREATE INDEX {$db_prefix}messages_show_posts ON {$db_prefix}messages (id_member,
CREATE INDEX {$db_prefix}messages_id_member_msg ON {$db_prefix}messages (id_member, approved, id_msg);
CREATE INDEX {$db_prefix}messages_current_topic ON {$db_prefix}messages (id_topic, id_msg, id_member, approved);
CREATE INDEX {$db_prefix}messages_related_ip ON {$db_prefix}messages (id_member, poster_ip, id_msg);
CREATE INDEX {$db_prefix}messages_likes ON {$db_prefix}messages (likes);
CREATE INDEX {$db_prefix}messages_reacts ON {$db_prefix}messages (reacts);
#
# Table structure for table `moderators`
#
Expand Down Expand Up @@ -1734,23 +1734,24 @@ CREATE TABLE {$db_prefix}user_drafts (
CREATE UNIQUE INDEX {$db_prefix}user_drafts_id_member ON {$db_prefix}user_drafts (id_member, id_draft, type);

#
# Table structure for table `user_likes`
# Table structure for table `user_reacts`
#

CREATE TABLE {$db_prefix}user_likes (
CREATE TABLE {$db_prefix}user_reacts (
id_member int NOT NULL DEFAULT '0',
content_type char(6) DEFAULT '',
content_id int NOT NULL DEFAULT '0',
like_time int NOT NULL DEFAULT '0',
react_time int NOT NULL DEFAULT '0',
react_id int NOT NULL DEFAULT '0',
PRIMARY KEY (content_id, content_type, id_member)
);

#
# Indexes for table `user_likes`
# Indexes for table `user_reacts`
#

CREATE INDEX {$db_prefix}user_likes_content ON {$db_prefix}user_likes (content_id, content_type);
CREATE INDEX {$db_prefix}user_likes_liker ON {$db_prefix}user_likes (id_member);
CREATE INDEX {$db_prefix}user_reacts_content ON {$db_prefix}user_reacts (content_id, content_type);
CREATE INDEX {$db_prefix}user_reacts_reactorr ON {$db_prefix}user_reacts (id_member);

#
# Table structure for `mentions`
Expand Down Expand Up @@ -2827,7 +2828,7 @@ VALUES (0, 'alert_timeout', 10),
(0, 'member_report', 3),
(0, 'member_report_reply', 3),
(0, 'msg_auto_notify', 0),
(0, 'msg_like', 1),
(0, 'msg_react', 1),
(0, 'msg_mention', 1),
(0, 'msg_notify_pref', 1),
(0, 'msg_notify_type', 1),
Expand Down

0 comments on commit 130cca4

Please sign in to comment.