This commit is contained in:
Roman Kelesidis 2025-08-20 14:26:09 +03:00
commit ab942f84be
No known key found for this signature in database
GPG key ID: D8157C4D4C4C6DB4
3 changed files with 5 additions and 4 deletions

View file

@ -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

View file

@ -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':

View file

@ -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);
}