diff --git a/library/ajax/thanks.php b/library/ajax/thanks.php index cbe29ac01..0d37e0b2b 100644 --- a/library/ajax/thanks.php +++ b/library/ajax/thanks.php @@ -48,9 +48,12 @@ switch ($mode) { DB()->query('INSERT IGNORE INTO ' . BB_THX . " ($columns) VALUES ($values)"); // Limit voters per topic - $thanks_count = DB()->fetch_row('SELECT COUNT(*) as thx FROM ' . BB_THX . " WHERE topic_id = $topic_id")['thx']; - if ($thanks_count > (int)$bb_cfg['tor_thank_limit_per_topic']) { - DB()->query('DELETE FROM ' . BB_THX . " WHERE topic_id = $topic_id ORDER BY time ASC LIMIT 1"); + $tor_thank_limit_per_topic = (int)$bb_cfg['tor_thank_limit_per_topic']; + if ($tor_thank_limit_per_topic > 0) { + $thanks_count = DB()->fetch_row('SELECT COUNT(*) as thx FROM ' . BB_THX . " WHERE topic_id = $topic_id")['thx']; + if ($thanks_count > $tor_thank_limit_per_topic) { + DB()->query('DELETE FROM ' . BB_THX . " WHERE topic_id = $topic_id ORDER BY time ASC LIMIT 1"); + } } break; case 'get': diff --git a/library/config.php b/library/config.php index 847562369..407fa2e42 100644 --- a/library/config.php +++ b/library/config.php @@ -569,7 +569,7 @@ $bb_cfg['limit_max_search_results'] = false; // Limit for number of search resul // Posting $bb_cfg['prevent_multiposting'] = true; // TODO: replace "reply" with "edit last msg" if user (not admin or mod) is last topic poster -$bb_cfg['max_smilies'] = 25; //Max number of smilies in a post (0 - unlimited) +$bb_cfg['max_smilies'] = 25; // Max number of smilies in a post (0 - unlimited) $bb_cfg['max_symbols_post'] = 5000; // TODO: Max number of symbols in a post (0 - unlimited) // PM @@ -593,7 +593,7 @@ $bb_cfg['user_not_active_days_keep'] = 180; // After how many days should I dele // Vote for torrents $bb_cfg['tor_thank'] = true; $bb_cfg['tor_thanks_list_guests'] = true; // Show voters to guests -$bb_cfg['tor_thank_limit_per_topic'] = 50; +$bb_cfg['tor_thank_limit_per_topic'] = 50; // Set "0" to disable limit // Groups $bb_cfg['group_members_per_page'] = 50; // How many groups will be displayed in a page