From f83c87b623e71e1b88b1095ab4c4a0fd8fcf0d3a Mon Sep 17 00:00:00 2001 From: kaf Date: Sat, 19 Apr 2014 12:56:59 +0000 Subject: Added: /pol/-like flags based on https://github.com/dubcheck/Tinyboard/commit/a953229de7a370fe036d9458d024e20ea6e8de80 Conflicts: inc/config.php templates/post_form.html --- post.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'post.php') diff --git a/post.php b/post.php index b18fc138..91abe7e6 100644 --- a/post.php +++ b/post.php @@ -469,6 +469,20 @@ if (isset($_POST['delete'])) { } } + if ($config['user_flag'] && isset($_POST['user_flag'])) + if (!empty($_POST['user_flag']) ){ + + $user_flag = $_POST['user_flag']; + + if (!isset($config['user_flags'][$user_flag])) + error('Invalid flag selection!'); + + $flag_alt = isset($user_flag_alt) ? $user_flag_alt : $config['user_flags'][$user_flag]; + + $post['body'] .= "\n" . strtolower($user_flag) . "" . + "\n" . $flag_alt . ""; + } + if (mysql_version() >= 50503) { $post['body_nomarkup'] = $post['body']; // Assume we're using the utf8mb4 charset } else { -- cgit v1.3