mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 06:13:58 -07:00
feat(log action): Show poll (create, finish, edit, delete) actions
This commit is contained in:
parent
16e28a5c41
commit
998ffd9d8a
1 changed files with 35 additions and 0 deletions
35
poll.php
35
poll.php
|
@ -103,6 +103,13 @@ switch ($mode) {
|
|||
bb_die($lang['POST_HAS_NO_POLL']);
|
||||
}
|
||||
|
||||
// Log action
|
||||
$log_action->mod('topic_poll_started', [
|
||||
'forum_id' => $forum_id,
|
||||
'topic_id' => $topic_id,
|
||||
'topic_title' => $t_data['topic_title'],
|
||||
]);
|
||||
|
||||
// Starting the poll
|
||||
DB()->query("UPDATE " . BB_TOPICS . " SET topic_vote = 1 WHERE topic_id = $topic_id");
|
||||
bb_die($lang['NEW_POLL_START']);
|
||||
|
@ -113,6 +120,13 @@ switch ($mode) {
|
|||
bb_die($lang['POST_HAS_NO_POLL']);
|
||||
}
|
||||
|
||||
// Log action
|
||||
$log_action->mod('topic_poll_finish', [
|
||||
'forum_id' => $forum_id,
|
||||
'topic_id' => $topic_id,
|
||||
'topic_title' => $t_data['topic_title'],
|
||||
]);
|
||||
|
||||
// Finishing the poll
|
||||
DB()->query("UPDATE " . BB_TOPICS . " SET topic_vote = " . POLL_FINISHED . " WHERE topic_id = $topic_id");
|
||||
bb_die($lang['NEW_POLL_END']);
|
||||
|
@ -123,6 +137,13 @@ switch ($mode) {
|
|||
bb_die($lang['POST_HAS_NO_POLL']);
|
||||
}
|
||||
|
||||
// Log action
|
||||
$log_action->mod('topic_poll_deleted', [
|
||||
'forum_id' => $forum_id,
|
||||
'topic_id' => $topic_id,
|
||||
'topic_title' => $t_data['topic_title'],
|
||||
]);
|
||||
|
||||
// Removing poll from database
|
||||
$poll->delete_poll($topic_id);
|
||||
bb_die($lang['NEW_POLL_DELETE']);
|
||||
|
@ -141,6 +162,13 @@ switch ($mode) {
|
|||
bb_die($poll->err_msg);
|
||||
}
|
||||
|
||||
// Log action
|
||||
$log_action->mod('topic_poll_added', [
|
||||
'forum_id' => $forum_id,
|
||||
'topic_id' => $topic_id,
|
||||
'topic_title' => $t_data['topic_title'],
|
||||
]);
|
||||
|
||||
// Adding poll info to the database
|
||||
$poll->insert_votes_into_db($topic_id);
|
||||
bb_die($lang['NEW_POLL_ADDED']);
|
||||
|
@ -159,6 +187,13 @@ switch ($mode) {
|
|||
bb_die($poll->err_msg);
|
||||
}
|
||||
|
||||
// Log action
|
||||
$log_action->mod('topic_poll_edited', [
|
||||
'forum_id' => $forum_id,
|
||||
'topic_id' => $topic_id,
|
||||
'topic_title' => $t_data['topic_title'],
|
||||
]);
|
||||
|
||||
// Updating poll info to the database
|
||||
$poll->insert_votes_into_db($topic_id);
|
||||
CACHE('bb_poll_data')->rm("poll_$topic_id");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue