This commit is contained in:
Roman Kelesidis 2024-11-22 01:00:23 +07:00
commit d0f4447123
2 changed files with 5 additions and 2 deletions

View file

@ -928,6 +928,7 @@ CREATE TABLE IF NOT EXISTS `bb_posts`
`post_edit_time` INT(11) NOT NULL DEFAULT '0',
`post_edit_count` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
`post_attachment` TINYINT(1) NOT NULL DEFAULT '0',
`post_pinned` TINYINT(1) NOT NULL DEFAULT '0',
`user_post` TINYINT(1) NOT NULL DEFAULT '1',
`mc_comment` TEXT NOT NULL DEFAULT '',
`mc_type` TINYINT(1) NOT NULL DEFAULT '0',
@ -945,7 +946,7 @@ CREATE TABLE IF NOT EXISTS `bb_posts`
-- Records of bb_posts
-- ----------------------------
INSERT INTO `bb_posts`
VALUES ('1', '1', '1', '2', UNIX_TIMESTAMP(), '0', '0', '0', '', '0', '0', '0', '1', '', '0', '0');
VALUES ('1', '1', '1', '2', UNIX_TIMESTAMP(), '0', '0', '0', '', '0', '0', '0', '0', '1', '', '0', '0');
-- ----------------------------
-- Table structure for `bb_posts_html`

View file

@ -65,9 +65,11 @@ switch ($this->request['type']) {
}
break;
case 'unpin':
case 'pin':
if ($post['post_id'] != $post['topic_first_post_id'] && (($userdata['user_id'] == $post['poster_id']) || $is_auth['auth_mod'])) {
$action = $this->request['type'] == 'unpin' ? 0 : 1;
DB()->query("UPDATE " . BB_POSTS . " SET post_pinned = $action WHERE post_id = $post_id LIMIT 1");
} else {
// TODO
}