mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 22:03:49 -07:00
fear(vote topic): Improved functionality & implemented caching
This commit is contained in:
parent
f80cad0c6f
commit
506c428fde
2 changed files with 8 additions and 5 deletions
|
@ -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':
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue