Fixed error while trying to delete posts by bot (#1004)

This commit is contained in:
Roman Kelesidis 2023-10-28 17:20:32 +07:00 committed by GitHub
commit afab42c1f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View file

@ -524,6 +524,7 @@ switch ($mode) {
WHERE p.topic_id = $topic_id
AND p.poster_id = u.user_id
AND p.post_id = pt.post_id
AND p.poster_id != " . BOT_UID . "
ORDER BY p.post_time ASC";
if (!($result = DB()->sql_query($sql))) {
bb_die('Could not get topic / post information');

View file

@ -496,6 +496,8 @@ class Post
$post_text_values = "$post_id, '$post_text'";
DB()->query("INSERT INTO " . BB_POSTS_TEXT . " ($post_text_columns) VALUES ($post_text_values)");
DB()->query("UPDATE " . BB_USERS . " SET user_posts = user_posts + 1 WHERE user_id = $poster_id");
}
/**