aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/posting.php
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2003-04-22 16:47:34 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2003-04-22 16:47:34 +0000
commit899f7bc1d7127dda2daeff29015e907e81fc029e (patch)
tree798b4fa0405094f2b18bae13eed1fa01f7230ae3 /phpBB/posting.php
parent9cb38cc0f9b8434cd4f738c790a41fcb0ec564c7 (diff)
downloadforums-899f7bc1d7127dda2daeff29015e907e81fc029e.tar
forums-899f7bc1d7127dda2daeff29015e907e81fc029e.tar.gz
forums-899f7bc1d7127dda2daeff29015e907e81fc029e.tar.bz2
forums-899f7bc1d7127dda2daeff29015e907e81fc029e.tar.xz
forums-899f7bc1d7127dda2daeff29015e907e81fc029e.zip
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
Diffstat (limited to 'phpBB/posting.php')
-rw-r--r--phpBB/posting.php22
1 files changed, 14 insertions, 8 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php
index fed17c7e7b..a472cb3f55 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -79,7 +79,7 @@ $post_validate = false;
// Easier validation
$forum_fields = array('forum_name' => 's', 'parent_id' => 'i', 'forum_parents' => 's', 'forum_status' => 'i', 'forum_postable' => 'i', 'enable_icons' => 'i');
-$topic_fields = array('topic_status' => 'i', 'topic_first_post_id' => 'i', 'topic_last_post_id' => 'i', 'topic_type' => 'i', 'topic_title' => 's', 'poll_last_vote' => 'i', 'poll_start' => 'i', 'poll_title' => 's', 'poll_length' => 'i');
+$topic_fields = array('topic_status' => 'i', 'topic_first_post_id' => 'i', 'topic_last_post_id' => 'i', 'topic_type' => 'i', 'topic_title' => 's', 'poll_last_vote' => 'i', 'poll_start' => 'i', 'poll_title' => 's', 'poll_max_options' => 'i', 'poll_length' => 'i');
$post_fields = array('post_time' => 'i', 'poster_id' => 'i', 'post_username' => 's', 'post_text' => 's', 'post_subject' => 's', 'post_checksum' => 's', 'post_attachment' => 'i', 'bbcode_uid' => 's', 'enable_magic_url' => 'i', 'enable_sig' => 'i', 'enable_smilies' => 'i', 'enable_bbcode' => 'i', 'post_edit_locked' => 'i');
@@ -530,6 +530,7 @@ if (($submit) || ($preview) || ($refresh))
}
$message_parser->message = (!empty($_POST['message'])) ? trim(stripslashes($_POST['message'])) : '';
+
$username = (!empty($_POST['username'])) ? trim($_POST['username']) : '';
$topic_type = (!empty($_POST['topic_type'])) ? intval($_POST['topic_type']) : POST_NORMAL;
$icon_id = (!empty($_POST['icon'])) ? intval($_POST['icon']) : 0;
@@ -557,10 +558,11 @@ if (($submit) || ($preview) || ($refresh))
$db->sql_query($sql);
$topic_sql = array(
- 'poll_title' => '',
- 'poll_start' => 0,
- 'poll_length' => 0,
- 'poll_last_vote' => 0
+ 'poll_title' => '',
+ 'poll_start' => 0,
+ 'poll_length' => 0,
+ 'poll_last_vote' => 0,
+ 'poll_max_options' => 0
);
$sql = 'UPDATE ' . TOPICS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $topic_sql) . ' WHERE topic_id = ' . $topic_id;
@@ -569,12 +571,14 @@ if (($submit) || ($preview) || ($refresh))
$poll_title = '';
$poll_length = '';
$poll_option_text = '';
+ $poll_max_options = '';
}
else
{
$poll_title = (!empty($_POST['poll_title'])) ? trim($_POST['poll_title']) : '';
$poll_length = (!empty($_POST['poll_length'])) ? $_POST['poll_length'] : '';
$poll_option_text = (!empty($_POST['poll_option_text'])) ? $_POST['poll_option_text'] : '';
+ $poll_max_options = (!empty($_POST['poll_max_options'])) ? $_POST['poll_max_options'] : 1;
}
$err_msg = '';
@@ -714,6 +718,7 @@ if (($submit) || ($preview) || ($refresh))
$poll_data = array(
'poll_title' => $poll_title,
'poll_length' => $poll_length,
+ 'poll_max_options' => $poll_max_options,
'poll_option_text' => $poll_option_text,
'poll_start' => $poll_start,
'poll_last_vote' => $poll_last_vote,
@@ -1074,9 +1079,10 @@ if ( ( ($mode == 'post') || ( ($mode == 'edit') && ($post_id == $topic_first_pos
'L_POLL_OPTIONS_EXPLAIN'=> sprintf($user->lang['POLL_OPTIONS_EXPLAIN'], $config['max_poll_options']),
- 'POLL_TITLE' => $poll_title,
- 'POLL_OPTIONS' => (!empty($poll_options)) ? implode("\n", $poll_options) : '',
- 'POLL_LENGTH' => $poll_length)
+ 'POLL_TITLE' => $poll_title,
+ 'POLL_OPTIONS' => (!empty($poll_options)) ? implode("\n", $poll_options) : '',
+ 'POLL_MAX_OPTIONS' => (!empty($poll_max_options)) ? $poll_max_options : 1,
+ 'POLL_LENGTH' => $poll_length)
);
}