aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/message_parser.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2004-09-05 15:45:50 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2004-09-05 15:45:50 +0000
commite593bcf3d7ff2636b9e0ea578cbd7b795e135a38 (patch)
tree86e5fef9d7f2b7fd3f184c5dbdd6f8b8e521010c /phpBB/includes/message_parser.php
parent76f9c1bdad31500ac0e87c7b8560352f39b0857a (diff)
downloadforums-e593bcf3d7ff2636b9e0ea578cbd7b795e135a38.tar
forums-e593bcf3d7ff2636b9e0ea578cbd7b795e135a38.tar.gz
forums-e593bcf3d7ff2636b9e0ea578cbd7b795e135a38.tar.bz2
forums-e593bcf3d7ff2636b9e0ea578cbd7b795e135a38.tar.xz
forums-e593bcf3d7ff2636b9e0ea578cbd7b795e135a38.zip
- re-enable polls (user is now able to decide if users are able to change votes if this feature is enabled within the given forum)
git-svn-id: file:///svn/phpbb/trunk@4981 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/message_parser.php')
-rw-r--r--phpBB/includes/message_parser.php88
1 files changed, 42 insertions, 46 deletions
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index 1229055b9d..88b83e4cd3 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -995,60 +995,56 @@ class parse_message extends bbcode_firstpass
}
// Parse Poll
- function parse_poll(&$poll, $poll_data)
+ function parse_poll(&$poll)
{
- global $auth, $forum_id, $user, $config;
+ global $auth, $user, $config;
- // Need a second look at
- return;
- /*
- // Process poll options
- if ($poll_data['poll_option_text'] && (($auth->acl_get('f_poll', $forum_id) && !$poll_data['poll_last_vote']) || $auth->acl_get('m_edit', $forum_id)))
- {
- $message = $this->message;
- $this->message = $poll_data['poll_option_text'];
-
- if (($result = $this->parse($poll_data['enable_html'], $poll_data['enable_bbcode'], $poll_data['bbcode_uid'], $poll_data['enable_urls'], $poll_data['enable_smilies'], false)) != '')
- {
- $this->warn_msg[] = $result;
- }
+ $poll_max_options = $poll['poll_max_options'];
- $poll_data['poll_option_text'] = $this->message;
- $this->message = $message;
- unset($message);
+ // Parse Poll Option text ;)
+ $tmp_message = $this->message;
+ $this->message = $poll['poll_option_text'];
+ $bbcode_bitfield = $this->bbcode_bitfield;
- $poll['poll_options'] = explode("\n", trim($poll_data['poll_option_text']));
- $poll['poll_options_size'] = sizeof($poll['poll_options']);
-
- if (sizeof($poll['poll_options']) == 1)
- {
- $this->warn_msg[] = $user->lang['TOO_FEW_POLL_OPTIONS'];
- }
- elseif (sizeof($poll['poll_options']) > intval($config['max_poll_options']))
- {
- $this->warn_msg[] = $user->lang['TOO_MANY_POLL_OPTIONS'];
- }
- elseif (sizeof($poll['poll_options']) < $poll['poll_options_size'])
- {
- $this->warn_msg[] = $user->lang['NO_DELETE_POLL_OPTIONS'];
- }
- elseif ($poll_data['poll_max_options'] > sizeof($poll['poll_options']))
- {
- $this->warn_msg[] = $user->lang['TOO_MANY_USER_OPTIONS'];
- }
+ $poll['poll_option_text'] = $this->parse($poll['enable_html'], $poll['enable_bbcode'], $poll['enable_urls'], $poll['enable_smilies'], $poll['img_status'], false, false, false);
+
+ $this->bbcode_bitfield |= $bbcode_bitfield;
+ $this->message = $tmp_message;
- $poll['poll_title'] = ($poll_data['poll_title']) ? $poll_data['poll_title'] : '';
- $poll['poll_length'] = ($poll_data['poll_length']) ? intval($poll_data['poll_length']) : 0;
+ // Parse Poll Title
+ $tmp_message = $this->message;
+ $this->message = $poll['poll_title'];
+ $bbcode_bitfield = $this->bbcode_bitfield;
- if (!$poll['poll_title'] && $poll['poll_options_size'])
- {
- $this->warn_msg[] = $user->lang['NO_POLL_TITLE'];
- }
+ $poll['poll_title'] = $this->parse($poll['enable_html'], $poll['enable_bbcode'], $poll['enable_urls'], $poll['enable_smilies'], $poll['img_status'], false, false, false);
+
+ $this->bbcode_bitfield |= $bbcode_bitfield;
+ $this->message = $tmp_message;
+
+ unset($tmp_message);
+
+ $poll['poll_options'] = explode("\n", trim($poll['poll_option_text']));
+ $poll['poll_options_size'] = sizeof($poll['poll_options']);
+
+ if (sizeof($poll['poll_options']) == 1)
+ {
+ $this->warn_msg[] = $user->lang['TOO_FEW_POLL_OPTIONS'];
+ }
+ else if ($poll['poll_options_size'] > (int) $config['max_poll_options'])
+ {
+ $this->warn_msg[] = $user->lang['TOO_MANY_POLL_OPTIONS'];
+ }
+ else if ($poll_max_options > $poll['poll_options_size'])
+ {
+ $this->warn_msg[] = $user->lang['TOO_MANY_USER_OPTIONS'];
}
- $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']);
- */
+ if (!$poll['poll_title'] && $poll['poll_options_size'])
+ {
+ $this->warn_msg[] = $user->lang['NO_POLL_TITLE'];
+ }
+
+ $poll['poll_max_options'] = ($poll['poll_max_options'] < 1) ? 1 : (($poll['poll_max_options'] > $config['max_poll_options']) ? $config['max_poll_options'] : $poll['poll_max_options']);
}
}