From ab942f84bedbb7145e086cc61a91dada5c0e8f46 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Wed, 20 Aug 2025 14:26:09 +0300 Subject: [PATCH] Updated --- library/includes/init_bb.php | 3 ++- poll.php | 2 +- src/Legacy/Poll.php | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/library/includes/init_bb.php b/library/includes/init_bb.php index 1cb8a6c6f..e529d928f 100644 --- a/library/includes/init_bb.php +++ b/library/includes/init_bb.php @@ -183,7 +183,8 @@ define('FEMALE', 2); define('NOGENDER', 0); // Poll -# 1 - обычный опрос +define('POLL_DELETED', 0); +define('POLL_STARTED', 1); define('POLL_FINISHED', 2); // Group avatars diff --git a/poll.php b/poll.php index e0d475a9e..bd3a0b1dc 100644 --- a/poll.php +++ b/poll.php @@ -111,7 +111,7 @@ switch ($mode) { ]); // Starting the poll - DB()->query("UPDATE " . BB_TOPICS . " SET topic_vote = 1 WHERE topic_id = $topic_id"); + DB()->query("UPDATE " . BB_TOPICS . " SET topic_vote = " . POLL_STARTED . " WHERE topic_id = $topic_id"); bb_die($lang['NEW_POLL_START']); break; case 'poll_finish': diff --git a/src/Legacy/Poll.php b/src/Legacy/Poll.php index c0d70b7bc..24cc3b63b 100644 --- a/src/Legacy/Poll.php +++ b/src/Legacy/Poll.php @@ -79,7 +79,7 @@ class Poll DB()->query("REPLACE INTO " . BB_POLL_VOTES . $sql_args); - DB()->query("UPDATE " . BB_TOPICS . " SET topic_vote = 1 WHERE topic_id = $topic_id"); + DB()->query("UPDATE " . BB_TOPICS . " SET topic_vote = " . POLL_STARTED . " WHERE topic_id = $topic_id"); } /** @@ -89,7 +89,7 @@ class Poll */ public function delete_poll($topic_id) { - DB()->query("UPDATE " . BB_TOPICS . " SET topic_vote = 0 WHERE topic_id = $topic_id"); + DB()->query("UPDATE " . BB_TOPICS . " SET topic_vote = " . POLL_DELETED . " WHERE topic_id = $topic_id"); $this->delete_votes_data($topic_id); }