diff --git a/e107_plugins/poll/admin_config.php b/e107_plugins/poll/admin_config.php index aff71ba8a..dc680de70 100644 --- a/e107_plugins/poll/admin_config.php +++ b/e107_plugins/poll/admin_config.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/poll/admin_config.php,v $ -| $Revision: 1.3 $ -| $Date: 2007-10-28 21:09:52 $ +| $Revision: 1.4 $ +| $Date: 2007-11-01 22:46:19 $ | $Author: e107steved $ +----------------------------------------------------------------------------+ */ @@ -107,13 +107,16 @@ if (POLLACTION == "edit" && !$_POST['preview'] && !$_POST['submit']) $_POST['multipleChoice'] = $poll_allow_multiple; $_POST['showResults'] = $poll_result_type; - $_POST['pollUserclass'] = $poll_vote_userclass; + // Can't have everyone voting if tracking method is user ID + $_POST['pollUserclass'] = (($poll_vote_userclass == e_UC_PUBLIC) && $poll_storage_method == 2) ? e_UC_MEMBER : $poll_vote_userclass; $_POST['storageMethod'] = $poll_storage_method; } } if (isset($_POST['preview'])) { + // Can't have everyone voting if tracking method is user ID + if (($_POST['pollUserclass'] == e_UC_PUBLIC) && ($_POST['storageMethod'] == 2)) $_POST['pollUserclass'] = e_UC_MEMBER; $poll->render_poll($_POST, "preview"); } @@ -144,8 +147,10 @@ if ($poll_total = $sql->db_Select("polls", "*", "poll_type=1")) { "; } $text .= ""; -} else { - $text .= "
".POLLAN_7."
"; +} +else +{ + $text .= "
".POLLAN_7."
"; } $text .= ""; $ns->tablerender(POLLAN_1, $text); @@ -156,17 +161,22 @@ $text = $poll -> renderPollForm(); $ns->tablerender(POLLAN_2, $text); require_once(e_ADMIN."footer.php"); -function headerjs() { + + +function headerjs() +{ global $tp; $headerjs = ""; +function confirm_(poll_id) +{ + var x=confirm(\"Delete this poll? [ID: \" + poll_id + \"]\"); + if (x) + { + document.getElementById('del_poll').action='".e_SELF."?delete.' + poll_id; + document.getElementById('del_poll').submit(); + } +} +"; return $headerjs; } ?> \ No newline at end of file diff --git a/e107_plugins/poll/poll_class.php b/e107_plugins/poll/poll_class.php index 6e20fb83d..31cae34bd 100644 --- a/e107_plugins/poll/poll_class.php +++ b/e107_plugins/poll/poll_class.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/poll/poll_class.php,v $ -| $Revision: 1.6 $ -| $Date: 2007-08-12 19:52:55 $ +| $Revision: 1.7 $ +| $Date: 2007-11-01 22:47:25 $ | $Author: e107steved $ +----------------------------------------------------------------------------+ */ @@ -541,14 +541,14 @@ class poll ".POLLAN_15." - ".r_userclass("pollUserclass", $_POST['pollUserclass'], 'off', "member,admin,classes,matchclass")." + ".r_userclass("pollUserclass", $_POST['pollUserclass'], 'off', "public,member,admin,classes,matchclass")." ".POLLAN_16." ".POLLAN_17."
- ".POLLAN_18."
+ ".POLLAN_18."
".POLLAN_19."