diff --git a/CHANGELOG.md b/CHANGELOG.md index b218ccee3..f90c6e697 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ **Merged pull requests:** -- Vote button code improvements [\#1140](https://github.com/torrentpier/torrentpier/pull/1140) ([belomaxorka](https://github.com/belomaxorka)) +- Vote button code improvements [\#1140](https://github.com/torrentpier/torrentpier/pull/1140), [\#1142](https://github.com/torrentpier/torrentpier/pull/1142) ([belomaxorka](https://github.com/belomaxorka)) - Vote button and v2 file list topic url display [\#1138](https://github.com/torrentpier/torrentpier/pull/1138) ([kovalensky](https://github.com/kovalensky)) - Removed topic watch useless code [\#1137](https://github.com/torrentpier/torrentpier/pull/1137) ([belomaxorka](https://github.com/belomaxorka)) - Fixed topic_watch array key name [\#1136](https://github.com/torrentpier/torrentpier/pull/1136) ([belomaxorka](https://github.com/belomaxorka)) diff --git a/library/ajax/thanks.php b/library/ajax/thanks.php index 3033fb27b..d3f6d8ccf 100644 --- a/library/ajax/thanks.php +++ b/library/ajax/thanks.php @@ -14,7 +14,7 @@ if (!defined('IN_AJAX')) { global $bb_cfg, $lang, $userdata; if (!$bb_cfg['tor_thank']) { - $this->ajax_die($lang['DISABLED']); + $this->ajax_die($lang['MODULE_OFF']); } $mode = (string)$this->request['mode']; @@ -22,14 +22,14 @@ $topic_id = (int)$this->request['topic_id']; switch ($mode) { case 'add': - if (DB()->fetch_row('SELECT * FROM ' . BB_THX . " WHERE topic_id = $topic_id AND user_id = " . $userdata['user_id'])) { - $this->ajax_die($lang['LIKE_ALREADY']); - } - if (DB()->fetch_row('SELECT poster_id FROM ' . BB_BT_TORRENTS . " WHERE topic_id = $topic_id AND poster_id = " . $userdata['user_id'])) { $this->ajax_die($lang['LIKE_OWN_POST']); } + if (DB()->fetch_row('SELECT topic_id FROM ' . BB_THX . " WHERE topic_id = $topic_id AND user_id = " . $userdata['user_id'])) { + $this->ajax_die($lang['LIKE_ALREADY']); + } + $columns = 'topic_id, user_id, time'; $values = "$topic_id, {$userdata['user_id']}, " . TIMENOW; DB()->query('INSERT IGNORE INTO ' . BB_THX . " ($columns) VALUES ($values)"); @@ -51,3 +51,5 @@ switch ($mode) { default: $this->ajax_die('Invalid mode'); } + +$this->response['mode'] = $mode; diff --git a/styles/templates/default/viewtopic_attach.tpl b/styles/templates/default/viewtopic_attach.tpl index 55c505523..564483b07 100644 --- a/styles/templates/default/viewtopic_attach.tpl +++ b/styles/templates/default/viewtopic_attach.tpl @@ -454,7 +454,6 @@ $('#tor-filelist-btn').click(function(){ } } -