function save_configuration(&$mc) { $curr['CAPTCHA_ENABLE'] = isset($_POST['enable_captcha']) ? 'true' : 'false'; $curr['CAPTCHA_WIDTH'] = isset($_POST['captcha_width']) ? intval($_POST['captcha_width']) : 200; $curr['CAPTCHA_HEIGHT'] = isset($_POST['captcha_height']) ? intval($_POST['captcha_height']) : 50; $curr['CAPTCHA_CHARACTERS'] = isset($_POST['captcha_characters']) ? intval($_POST['captcha_characters']) : 5; $curr['CAPTCHA_LINES'] = isset($_POST['captcha_lines']) ? intval($_POST['captcha_lines']) : 70; $curr['CAPTCHA_ENABLE_SHADOWS'] = isset($_POST['captcha_enable_shadows']) ? 'true' : 'false'; $curr['CAPTCHA_OWNER_TEXT'] = isset($_POST['captcha_owner_text']) ? 'true' : 'false'; $curr['CAPTCHA_CHARACTER_SET'] = isset($_POST['captcha_character_set']) ? stringHandler::clean($_POST['captcha_character_set']) : ''; $curr['CAPTCHA_CASE_INSENSITIVE'] = isset($_POST['captcha_case_insensitive']) ? 'true' : 'false'; $curr['CAPTCHA_BACKGROUND'] = isset($_POST['captcha_background']) ? $_POST['captcha_background'] : ''; $curr['CAPTCHA_MIN_FONT'] = isset($_POST['captcha_min_font']) ? intval($_POST['captcha_min_font']) : 16; $curr['CAPTCHA_MAX_FONT'] = isset($_POST['captcha_max_font']) ? intval($_POST['captcha_max_font']) : 25; $curr['CAPTCHA_USE_COLOR'] = isset($_POST['captcha_use_color']) ? 'true' : 'false'; $curr['CAPTCHA_GRAPHIC_TYPE'] = isset($_POST['captcha_graphic_type']) ? $_POST['captcha_graphic_type'] : 'jpg'; $mc->saveConfiguration($curr); }
/** * Prepare trackback data for storage in the database * * @param int $commentid If supplied, the id of the comment being replied to * @return array */ function prepFieldsForDB($commentid = null) { $replyto = is_null($commentid) ? $commentid : 0; /* * According to the spec, only URL is required, all else is optional */ $vars['posterwebsite'] = $this->_tbdata['url']; /** * Policy: * In the interests of spam-blocking, the only hypertext we allow is the * URL of the poster. This is the only deviance from comment handling. This means no URL transformation is performed */ $vars['title'] = isset($this->_tbdata['title']) ? stringHandler::clean($this->_tbdata['title']) : ''; $vars['commenttext'] = isset($this->_tbdata['excerpt']) ? stringHandler::clean($this->_tbdata['excerpt']) : ''; $vars['postername'] = isset($this->_tbdata['blog_name']) ? stringHandler::clean($this->_tbdata['blog_name']) : ''; $vars['posttime'] = strtotime(gmdate("M d Y H:i:s")); $vars['ip'] = $this->_ip; $vars['postid'] = $this->_post; if ($replyto > 0) { $vars['parentid'] = $replyto; } /* * Added check for moderation. * Follow the same rules as for comments */ $vars['commenttext'] = stringHandler::clean($vars['commenttext']); $vars['onhold'] = $this->needsModeration($vars['commenttext']) ? 1 : 0; $vars['type'] = 'trackback'; return $vars; }
/** * Prepare comment data for storage in the database * * Nothing peculiar to HTML display is done at this stage. Essentially the * comment is stored raw, for later manipulation for the display purposes. * * @param array $vars The comment data * @param int $id The post id receiving this comment * @param int $replyto If supplied, the id of the comment being replied to */ function prepFieldsForDB($vars, $id, $replyto = 0) { $rval['postername'] = stringHandler::clean($vars["name"]); if (empty($rval['postername'])) { $rval['postername'] = "Anonymous"; } $rval['posteremail'] = $this->_db->qstr(stringHandler::clean($vars["email"]), get_magic_quotes_gpc()); $rval['title'] = strlen($vars["title"]) > 0 ? $vars['title'] : 'Title'; $rval['posterwebsite'] = stringHandler::transformLinks(stringHandler::clean($vars["website"])); $rval['commenttext'] = $this->processCommentText($vars["comment"]); $rval['pubemail'] = $vars["public_email"] == 1 ? 1 : 0; $rval['pubwebsite'] = $vars["public_website"] == 1 ? 1 : 0; $rval['posternotify'] = $vars["notify"] == 1 ? 1 : 0; $rval['posttime'] = strtotime(gmdate("M d Y H:i:s")); $rval['ip'] = $_SERVER['REMOTE_ADDR']; $rval['onhold'] = $this->needsModeration($rval['commenttext']) ? 1 : 0; $rval['postid'] = $id; $rval['parentid'] = $replyto; $rval['type'] = 'comment'; return $rval; }
} $loq->get_modifiers(); $optionformrows = array(); $options = get_options(); if (isset($_POST['submit']) && $_POST['submit'] == 'Save Options') { // saving options.. $updatevars = array(); foreach ($options as $option) { if (!isset($_POST[$option['name']])) { break; } switch ($option['type']) { case "text": case "email": case "url": $updatevars[] = array("name" => $option['name'], "value" => stringHandler::clean($_POST[$option['name']])); break; case "password": if ($_POST[$option['name']] != '') { $updatevars[] = array("name" => $option['name'], "value" => md5($_POST[$option['name']])); } break; case "templateselect": // make sure we're not being poked. if (ereg('^[[:alnum:]]+$', $_POST[$option['name']])) { $updatevars[] = array("name" => $option['name'], "value" => strtolower($_POST[$option['name']])); } break; case "statusselect": if ($_POST[$option['name']] == 'live') { $updatevars[] = array("name" => $option['name'], "value" => 'live');