diff --git a/e107_plugins/poll/admin_config.php b/e107_plugins/poll/admin_config.php index 0d686bf6b..e343201f6 100644 --- a/e107_plugins/poll/admin_config.php +++ b/e107_plugins/poll/admin_config.php @@ -54,7 +54,7 @@ if (isset($_POST['submit'])) if($_POST['poll_title']) { define("POLLID",$_POST['poll_id']); - $poll -> submit_poll(); + $poll->submit_poll(); $mes->addSuccess(LAN_CREATED); unset($_POST['poll_title'], $_POST['poll_option'], $_POST['activate'], $_POST['poll_comment']); } @@ -82,9 +82,9 @@ if (varset($_POST['edit']) || varset($_GET['mode'])=='create' && !varset($_POST[ define("POLLACTION",'edit'); } - $poll_total = $sql->db_Select("polls"); + $poll_total = $sql->select("polls"); $text = $poll -> renderPollForm(); - $ns->tablerender(POLLAN_MENU_CAPTION." - ".POLLAN_2, $mes->render() . $text); + $ns->tablerender(POLLAN_MENU_CAPTION.SEP.POLLAN_2, $mes->render() . $text); } @@ -101,11 +101,11 @@ function edit_poll() $sql = e107::getDb(); $id = key($_POST['edit']); - if ($sql->db_Select("polls", "*", "poll_id=".$id)) + if ($sql->select("polls", "*", "poll_id=".$id)) { $_GET['mode'] = 'create'; - $row = $sql->db_Fetch(); - extract($row); + $row = $sql->fetch(); + extract($row); // FIXME $tmpArray = explode(chr(1), $poll_options); @@ -177,14 +177,14 @@ function poll_list() $text = "
"; - if ($poll_total = $sql->db_Select("polls", "*", "poll_type=1")) + if ($poll_total = $sql->select("polls", "*", "poll_type=1")) { $text .= ""; $text .= $frm->colGroup($fields,$fieldpref). $frm->thead($fields,$fieldpref); $text .= ""; - while ($row = $sql->db_Fetch()) + while ($row = $sql->fetch()) { extract($row); // FIXME @@ -195,7 +195,7 @@ function poll_list() $text .= " "; - $text .= (in_array("poll_title",$fieldpref)) ? "" : ""; + $text .= (in_array("poll_title",$fieldpref)) ? "" : ""; $text .= (in_array("poll_options",$fieldpref)) ? "" : ""; $text .= (in_array("poll_comment",$fieldpref)) ? "" : ""; $text .= (in_array("poll_vote_userclass",$fieldpref)) ? "" : ""; diff --git a/e107_plugins/poll/languages/English_admin_poll.php b/e107_plugins/poll/languages/English_admin_poll.php index d82564448..51cf4290f 100644 --- a/e107_plugins/poll/languages/English_admin_poll.php +++ b/e107_plugins/poll/languages/English_admin_poll.php @@ -6,8 +6,6 @@ * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * - * $URL$ - * $Id$ */ //define("POLL_ADLAN01", "Poll"); diff --git a/e107_plugins/poll/poll_class.php b/e107_plugins/poll/poll_class.php index 752f21765..7b492238f 100644 --- a/e107_plugins/poll/poll_class.php +++ b/e107_plugins/poll/poll_class.php @@ -6,8 +6,6 @@ * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * - * $URL$ - * $Id$ */ if (!defined('e107_INIT')) { exit; } @@ -35,7 +33,6 @@ class poll } - /* function remove_poll_cookies Remove unused poll cookies. See: http://krijnhoetmer.nl/stuff/javascript/maximum-cookies/ Thanks Fanat1k - bugtracker #4983 @@ -72,7 +69,7 @@ class poll global $admin_log; $sql = e107::getDb(); - if ($sql -> db_Delete("polls", " poll_id='".intval($existing)."' ")) + if ($sql->delete("polls", " poll_id='".intval($existing)."' ")) { if (function_exists("admin_purge_related")) { @@ -99,7 +96,7 @@ class poll $poll_title = $tp->toDB($_POST['poll_title']); - $poll_comment = $tp -> toDB($_POST['poll_comment']); + $poll_comment = $tp->toDB($_POST['poll_comment']); $multipleChoice = intval($_POST['multipleChoice']); $showResults = intval($_POST['showResults']); $pollUserclass = intval($_POST['pollUserclass']); @@ -116,7 +113,7 @@ class poll if (POLLACTION == 'edit' || vartrue($_POST['poll_id'])) { - $sql -> db_Update("polls", "poll_title='{$poll_title}', + $sql->update("polls", "poll_title='{$poll_title}', poll_options='{$poll_options}', poll_comment='{$poll_comment}', poll_type={$mode}, @@ -127,8 +124,8 @@ class poll WHERE poll_id=".intval(POLLID)); /* update poll results - bugtracker #1124 .... */ - $sql -> db_Select("polls", "poll_votes", "poll_id='".intval(POLLID)."' "); - $foo = $sql -> db_Fetch(); + $sql->select("polls", "poll_votes", "poll_id='".intval(POLLID)."' "); + $foo = $sql->fetch(); $voteA = explode(chr(1), $foo['poll_votes']); $opt = count($poll_option) - count($voteA); @@ -139,7 +136,7 @@ class poll { $foo['poll_votes'] .= '0'.chr(1); } - $sql -> db_Update("polls", "poll_votes='".$foo['poll_votes']."' WHERE poll_id='".intval(POLLID)."' "); + $sql->update("polls", "poll_votes='".$foo['poll_votes']."' WHERE poll_id='".intval(POLLID)."' "); } $admin_log->log_event('POLL_02','ID: '.POLLID.' - '.$poll_title,''); @@ -156,20 +153,20 @@ class poll if ($mode == 1) { /* deactivate other polls */ - if ($sql -> db_Select("polls", "*", "poll_type=1 AND poll_vote_userclass!=255")) + if ($sql->select("polls", "*", "poll_type=1 AND poll_vote_userclass!=255")) { - $deacArray = $sql -> db_getList(); + $deacArray = $sql->db_getList(); foreach ($deacArray as $deacpoll) { - $sql -> db_Update("polls", "poll_end_datestamp='".time()."', poll_vote_userclass='255' WHERE poll_id=".$deacpoll['poll_id']); + $sql->update("polls", "poll_end_datestamp='".time()."', poll_vote_userclass='255' WHERE poll_id=".$deacpoll['poll_id']); } } - $ret = $sql -> db_Insert("polls", "'0', ".time().", ".intval($active_start).", ".intval($active_end).", ".ADMINID.", '{$poll_title}', '{$poll_options}', '{$votes}', '', '1', '".$tp -> toDB($poll_comment)."', '".intval($multipleChoice)."', '".intval($showResults)."', '".intval($pollUserclass)."', '".intval($storageMethod)."'"); + $ret = $sql->insert("polls", "'0', ".time().", ".intval($active_start).", ".intval($active_end).", ".ADMINID.", '{$poll_title}', '{$poll_options}', '{$votes}', '', '1', '".$tp->toDB($poll_comment)."', '".intval($multipleChoice)."', '".intval($showResults)."', '".intval($pollUserclass)."', '".intval($storageMethod)."'"); $admin_log->log_event('POLL_03','ID: '.$ret.' - '.$poll_title,''); // Intentionally only log admin-entered polls } else { - $sql -> db_Insert("polls", "'0', ".intval($_POST['iid']).", '0', '0', ".USERID.", '$poll_title', '$poll_options', '$votes', '', '2', '0', '".intval($multipleChoice)."', '0', '0', '".intval($storageMethod)."'"); + $sql->insert("polls", "'0', ".intval($_POST['iid']).", '0', '0', ".USERID.", '$poll_title', '$poll_options', '$votes', '', '2', '0', '".intval($multipleChoice)."', '0', '0', '".intval($storageMethod)."'"); } } return $message; @@ -177,13 +174,12 @@ class poll function get_poll($query) { - global $e107; - + global $e107; $sql = e107::getDb(); - if ($sql->db_Select_gen($query)) + if ($sql->gen($query)) { - $pollArray = $sql -> db_Fetch(); + $pollArray = $sql->fetch(); if (!check_class($pollArray['poll_vote_userclass'])) { $POLLMODE = 'disallowed'; @@ -312,9 +308,9 @@ class poll $POLLMODE = $this->pollmode; break; case 'results' : - if ($sql->db_Select_gen($pollArray)) + if ($sql->gen($pollArray)) { - $pollArray = $sql -> db_Fetch(); + $pollArray = $sql->fetch(); } break; } @@ -402,8 +398,7 @@ class poll $POLL_VOTED_START = $POLL_TEMPLATE['results']['start']; $POLL_VOTED_LOOP = $POLL_TEMPLATE['results']['item']; - $POLL_VOTED_END = $POLL_TEMPLATE['results']['end']; - + $POLL_VOTED_END = $POLL_TEMPLATE['results']['end']; } @@ -422,7 +417,7 @@ class poll $comment_total = 0; if ($pollArray['poll_comment']) { // Only get comments if they're allowed on poll. And we only need the count ATM - $comment_total = $sql->db_Count("comments", "(*)", "WHERE `comment_item_id`='".intval($pollArray['poll_id'])."' AND `comment_type`=4"); + $comment_total = $sql->count("comments", "(*)", "WHERE `comment_item_id`='".intval($pollArray['poll_id'])."' AND `comment_type`=4"); } $sc = e107::getScBatch('poll'); @@ -430,14 +425,14 @@ class poll - $QUESTION = $tp -> toHTML($pollArray['poll_title'], TRUE, "emotes_off, defs"); + $QUESTION = $tp->toHTML($pollArray['poll_title'], TRUE, "emotes_off, defs"); $VOTE_TOTAL = POLLAN_31.": ".$voteTotal; $COMMENTS = ($pollArray['poll_comment'] ? " ".POLLAN_27.": ".$comment_total."" : ""); - $poll_count = $sql->db_Count("polls", "(*)", "WHERE poll_id <= '".$pollArray['poll_id']."'"); + $poll_count = $sql->count("polls", "(*)", "WHERE poll_id <= '".$pollArray['poll_id']."'"); $OLDPOLLS = ''; if ($poll_count > 1) @@ -544,7 +539,7 @@ class poll if ($type == 'preview') { - $caption = POLLAN_23.SEP."Preview"; + $caption = POLLAN_23.SEP."Preview"; // TODO LAN $text = "
\n
".$text."
"; } elseif ($type == 'forum') @@ -602,8 +597,7 @@ class poll //XXX New v2.x default for front-end. Currently used by forum-post in bootstrap mode. if ($mode == 'front') - { - + { $text = " @@ -751,7 +745,7 @@ class poll
$poll_id".$tp -> toHTML($poll_title, TRUE,"no_hook, emotes_off, defs")."".$tp->toHTML($poll_title, TRUE,"no_hook, emotes_off, defs")."
  • ".implode("
  • ",$pollopts)."
".($poll_comment ? LAN_YES : LAN_NO)."".(r_userclass_name($poll_vote_userclass))."
".POLLAN_3.":
- "; + "; $option_count = (varset($_POST['poll_option']) && count($_POST['poll_option']) ? count($_POST['poll_option']) : 2); @@ -763,7 +757,7 @@ class poll for($count = 1; $count <= $option_count; $count++) { $opt = ($count==1) ? "id='pollopt'" : ""; - $text .=" post_toForm($_POST['poll_option'][($count-1)])."\" maxlength='200' />"; + $text .="post_toForm($_POST['poll_option'][($count-1)])."\" maxlength='200' />"; $text .= "
"; } @@ -872,7 +866,7 @@ class poll_shortcodes extends e_shortcode function sc_question($parm = "") { $tp = e107::getParser(); - return $tp -> toHTML($this->var['poll_title'], TRUE, "emotes_off, defs"); + return $tp->toHTML($this->var['poll_title'], TRUE, "emotes_off, defs"); } function sc_answer($parm='') @@ -890,12 +884,6 @@ class poll_shortcodes extends e_shortcode - - - - - - e107::js('inline', ' function setcook(pollid){