From 899f7bc1d7127dda2daeff29015e907e81fc029e Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Tue, 22 Apr 2003 16:47:34 +0000 Subject: Re-enabled polling ... includes option of multiple choice polling, indication of option voted for, etc. ... preliminary implementation, various things need finishing git-svn-id: file:///svn/phpbb/trunk@3920 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_posting.php | 5 +++-- phpBB/includes/message_parser.php | 8 ++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 225b286b51..9cb2dabd02 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -949,7 +949,8 @@ function submit_post($mode, $message, $subject, $username, $topic_type, $bbcode_ { $topic_sql = array_merge($topic_sql, array( 'poll_title' => stripslashes($poll['poll_title']), - 'poll_start' => ($poll['poll_start']) ? $poll['poll_start'] : $current_time, + 'poll_start' => ($poll['poll_start']) ? $poll['poll_start'] : $current_time, + 'poll_max_options' => $poll['poll_max_options'], 'poll_length' => $poll['poll_length'] * 3600) ); } @@ -1181,7 +1182,7 @@ function submit_post($mode, $message, $subject, $username, $topic_type, $bbcode_ } // Mark this topic as read and posted to. - $mark_mode = ($mode == 'reply' || $mode == 'quote') ? 'post' : 'topic'; + $mark_mode = ($mode == 'post' || $mode == 'reply' || $mode == 'quote') ? 'post' : 'topic'; markread($mark_mode, $post_data['forum_id'], $post_data['topic_id'], $post_data['post_id']); $db->sql_transaction('commit'); diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 729f712f84..24868b64be 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -652,7 +652,9 @@ class parse_message $err_msg = ''; // Process poll options - if (!empty($poll_data['poll_option_text']) && (($auth->acl_get('f_poll', $forum_id) && !$poll_data['poll_last_vote']) || $auth->acl_get('m_edit', $forum_id))) + if (!empty($poll_data['poll_option_text']) && + (($auth->acl_get('f_poll', $forum_id) && !$poll_data['poll_last_vote']) || + $auth->acl_get('m_edit', $forum_id))) { if (($result = $this->parse($poll_data['poll_option_text'], $poll_data['enable_html'], $poll_data['enable_bbcode'], $poll_data['bbcode_uid'], $poll_data['enable_urls'], $poll_data['enable_smilies'], false)) != '') { @@ -678,9 +680,11 @@ class parse_message $poll['poll_title'] = (!empty($poll_data['poll_title'])) ? trim(htmlspecialchars(strip_tags($poll_data['poll_title']))) : ''; $poll['poll_length'] = (!empty($poll_data['poll_length'])) ? intval($poll_data['poll_length']) : 0; } + $poll['poll_start'] = $poll_data['poll_start']; + $poll['poll_max_options'] = ($poll_data['poll_max_options'] < 1) ? 1 : (($poll_data['poll_max_options'] > $config['max_poll_options']) ? $config['max_poll_options'] : $poll_data['poll_max_options']); - return ($err_msg); + return $err_msg; } } -- cgit v1.2.1