本文整理匯總了PHP中IPSText::stripslashes方法的典型用法代碼示例。如果您正苦於以下問題:PHP IPSText::stripslashes方法的具體用法?PHP IPSText::stripslashes怎麽用?PHP IPSText::stripslashes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類IPSText
的用法示例。
在下文中一共展示了IPSText::stripslashes方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: renderForum
/**
* Builds an array of forum data for use in the output template
*
* @return array
*/
public function renderForum()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$this->request['page'] = $this->request['changefilters'] ? 0 : (isset($this->request['page']) ? intval($this->request['page']) : 0);
$announce_data = array();
$topic_data = array();
$other_data = array();
$multi_mod_data = array();
$footer_filter = array();
$member_ids = array();
//-----------------------------------------
// Show?
//-----------------------------------------
if (isset($this->request['show']) and $this->request['show'] == 'sinceLastVisit') {
$this->request['prune_day'] = 200;
}
//-----------------------------------------
// Are we actually a moderator for this forum?
//-----------------------------------------
$mod = $this->memberData['forumsModeratorData'];
if (!$this->memberData['g_is_supmod']) {
if (!isset($mod[$this->forum['id']]) or !is_array($mod[$this->forum['id']])) {
$this->memberData['is_mod'] = 0;
}
}
//-----------------------------------------
// Announcements
//-----------------------------------------
if (is_array($this->registry->cache()->getCache('announcements')) and count($this->registry->cache()->getCache('announcements'))) {
$announcements = array();
foreach ($this->registry->cache()->getCache('announcements') as $announce) {
$order = $announce['announce_start'] ? $announce['announce_start'] . ',' . $announce['announce_id'] : $announce['announce_id'];
if ($announce['announce_forum'] == '*') {
$announcements[$order] = $announce;
} else {
if (strstr(',' . $announce['announce_forum'] . ',', ',' . $this->forum['id'] . ',')) {
$announcements[$order] = $announce;
}
}
}
if (count($announcements)) {
//-----------------------------------------
// sort by start date
//-----------------------------------------
krsort($announcements);
foreach ($announcements as $announce) {
if ($announce['announce_start']) {
$announce['announce_start'] = $this->lang->getDate($announce['announce_start'], 'date');
} else {
$announce['announce_start'] = '--';
}
$announce['announce_title'] = IPSText::stripslashes($announce['announce_title']);
$announce['forum_id'] = $this->forum['id'];
$announce['announce_views'] = intval($announce['announce_views']);
$announce_data[] = $announce;
$member_ids[$announce['member_id']] = $announce['member_id'];
}
$this->forum['_showAnnouncementsBar'] = 1;
}
}
//-----------------------------------------
// Read topics
//-----------------------------------------
$First = $this->registry->class_forums->pageToSt(intval($this->request['page']));
//-----------------------------------------
// Sort options
//-----------------------------------------
$cookie_prune = IPSCookie::get($this->forum['id'] . "_prune_day");
$cookie_sort = IPSCookie::get($this->forum['id'] . "_sort_key");
$cookie_sortb = IPSCookie::get($this->forum['id'] . "_sort_by");
$cookie_fill = IPSCookie::get($this->forum['id'] . "_topicfilter");
$prune_value = $this->selectVariable(array(1 => !empty($this->request['prune_day']) ? $this->request['prune_day'] : NULL, 2 => !empty($cookie_prune) ? $cookie_prune : NULL, 3 => $this->forum['prune'], 4 => '100'));
$sort_key = $this->selectVariable(array(1 => !empty($this->request['sort_key']) ? $this->request['sort_key'] : NULL, 2 => !empty($cookie_sort) ? $cookie_sort : NULL, 3 => $this->forum['sort_key'], 4 => 'last_post'));
$sort_by = $this->selectVariable(array(1 => !empty($this->request['sort_by']) ? $this->request['sort_by'] : NULL, 2 => !empty($cookie_sortb) ? $cookie_sortb : NULL, 3 => $this->forum['sort_order'], 4 => 'Z-A'));
$topicfilter = $this->selectVariable(array(1 => !empty($this->request['topicfilter']) ? $this->request['topicfilter'] : NULL, 2 => !empty($cookie_fill) ? $cookie_fill : NULL, 3 => $this->forum['topicfilter'], 4 => 'all'));
if (!empty($this->request['remember'])) {
if ($this->request['prune_day']) {
IPSCookie::set($this->forum['id'] . "_prune_day", $this->request['prune_day']);
}
if ($this->request['sort_key']) {
IPSCookie::set($this->forum['id'] . "_sort_key", $this->request['sort_key']);
}
if ($this->request['sort_by']) {
IPSCookie::set($this->forum['id'] . "_sort_by", $this->request['sort_by']);
}
if ($this->request['topicfilter']) {
IPSCookie::set($this->forum['id'] . "_topicfilter", $this->request['topicfilter']);
}
}
//-----------------------------------------
// Figure out sort order, day cut off, etc
//-----------------------------------------
$Prune = $prune_value < 100 ? time() - $prune_value * 60 * 60 * 24 : (($prune_value == 200 and $this->memberData['member_id']) ? $this->memberData['last_visit'] : 0);
//.........這裏部分代碼省略.........
示例2: _mediaTagForm
/**
* Show the mediatag add/edit form
*
* @access private
* @param string [$type='add']
* @param array [Optional] array of errors
* @return void
*/
private function _mediaTagForm($type = 'add', $errors = array())
{
/* Check form type */
if ($type == 'add') {
/* Data */
$data = array('mediatag_name' => $this->request['mediatag_name'], 'mediatag_match' => rtrim(str_replace('\', '\\', str_replace(''', "'", trim(IPSText::stripslashes($_POST['mediatag_match'])))), ','), 'mediatag_replace' => rtrim(str_replace('\', '\\', str_replace(''', "'", trim(IPSText::stripslashes($_POST['mediatag_replace'])))), ','));
} else {
/* Data */
$id = intval($this->request['id']);
$data = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'bbcode_mediatag', 'where' => "mediatag_id={$id}"));
/* Set Defaults */
$data['mediatag_name'] = isset($this->request['mediatag_name']) && $this->request['mediatag_name'] ? $this->request['mediatag_name'] : $data['mediatag_name'];
$data['mediatag_match'] = isset($this->request['mediatag_match']) && $this->request['mediatag_match'] ? $this->request['mediatag_match'] : $data['mediatag_match'];
$data['mediatag_replace'] = isset($this->request['mediatag_replace']) && $this->request['mediatag_replace'] ? $this->request['mediatag_replace'] : $data['mediatag_replace'];
}
/* Setup Form */
$this->registry->output->html .= $this->html->mediaTagForm($type, $data, $errors);
}
示例3: doExecute
//.........這裏部分代碼省略.........
// Get MySQL & PHP Version
//-----------------------------------------
$this->DB->getSqlVersion();
//-----------------------------------------
// Upgrade history?
//-----------------------------------------
$latest_version = array('upgrade_version_id' => NULL);
$this->DB->build(array('select' => '*', 'from' => 'upgrade_history', 'order' => 'upgrade_version_id DESC', 'limit' => array(1)));
$this->DB->execute();
while ($r = $this->DB->fetch()) {
$latest_version = $r;
}
//-----------------------------------------
// Resetting security image?
//-----------------------------------------
if ($this->request['reset_security_flag'] and $this->request['reset_security_flag'] == 1 and $this->request['new_build']) {
$_latest = IPSLib::fetchVersionNumber('core');
$new_build = intval($this->request['new_build']);
$new_reason = trim(substr($this->request['new_reason'], 0, 1));
$new_version = $_latest['long'] . '.' . $new_build . '.' . $new_reason;
$this->DB->update('upgrade_history', array('upgrade_notes' => $new_version), 'upgrade_version_id=' . $latest_version['upgrade_version_id']);
$latest_version['upgrade_notes'] = $new_version;
}
//-----------------------------------------
// Got real version number?
//-----------------------------------------
ipsRegistry::$version = 'v' . $latest_version['upgrade_version_human'];
ipsRegistry::$vn_full = !empty($latest_version['upgrade_notes']) ? $latest_version['upgrade_notes'] : ipsRegistry::$vn_full;
//-----------------------------------------
// Notepad
//-----------------------------------------
if ($this->request['save'] and $this->request['save'] == 1) {
$_POST['notes'] = $_POST['notes'] ? $_POST['notes'] : $this->lang->words['cp_acpnotes'];
$this->cache->setCache('adminnotes', IPSText::stripslashes($_POST['notes']), array('donow' => 1, 'array' => 0));
}
$text = $this->lang->words['cp_acpnotes'];
if (!$this->cache->getCache('adminnotes')) {
$this->cache->setCache('adminnotes', $text, array('donow' => 1, 'array' => 0));
}
$this->cache->updateCacheWithoutSaving('adminnotes', htmlspecialchars($this->cache->getCache('adminnotes'), ENT_QUOTES));
$this->cache->updateCacheWithoutSaving('adminnotes', str_replace("&#", "&#", $this->cache->getCache('adminnotes')));
$content['ad_notes'] = $this->html->acp_notes($this->cache->getCache('adminnotes'));
//-----------------------------------------
// ADMINS USING CP
//-----------------------------------------
$t_time = time() - 60 * 10;
$time_now = time();
$seen_name = array();
$acponline = "";
$this->DB->build(array('select' => 's.session_member_name, s.session_member_id, s.session_location, s.session_log_in_time, s.session_running_time, s.session_ip_address, s.session_url', 'from' => array('core_sys_cp_sessions' => 's'), 'add_join' => array(array('select' => 'm.*', 'from' => array('members' => 'm'), 'where' => "m.member_id=s.session_member_id", 'type' => 'left'), array('select' => 'pp.*', 'from' => array('profile_portal' => 'pp'), 'where' => 'pp.pp_member_id=m.member_id', 'type' => 'left'))));
$q = $this->DB->execute();
while ($r = $this->DB->fetch($q)) {
if (isset($seen_name[$r['session_member_name']]) and $seen_name[$r['session_member_name']] == 1) {
continue;
} else {
$seen_name[$r['session_member_name']] = 1;
}
$r['_log_in'] = $time_now - $r['session_log_in_time'];
$r['_click'] = $time_now - $r['session_running_time'];
if ($r['_log_in'] / 60 < 1) {
$r['_log_in'] = sprintf("%0d", $r['_log_in']) . ' ' . $this->lang->words['cp_secondsago'];
} else {
$r['_log_in'] = sprintf("%0d", $r['_log_in'] / 60) . ' ' . $this->lang->words['cp_minutesago'];
}
if ($r['_click'] / 60 < 1) {
$r['_click'] = sprintf("%0d", $r['_click']) . ' ' . $this->lang->words['cp_secondsago'];
示例4: rssImportValidate
/**
* Validate an RSS Feed
*
* @param bool $standalone If set to true, data will be queried from the db based on rss_id, otherwise data will be gathered from form fields
* @return void
*/
public function rssImportValidate($standalone = false)
{
/* INI */
$return = 0;
if (!$standalone) {
/* Get data from the form */
$rss_import_id = intval($this->request['rss_import_id']);
$rss_import_title = trim($this->request['rss_import_title']);
$rss_import_url = IPSText::stripslashes(trim($this->request['rss_import_url']));
$rss_import_mid = trim($this->request['rss_import_mid']);
$rss_import_showlink = IPSText::stripslashes(trim($this->request['rss_import_showlink']));
$rss_import_enabled = intval($this->request['rss_import_enabled']);
$rss_import_forum_id = intval($this->request['rss_import_forum_id']);
$rss_import_pergo = intval($this->request['rss_import_pergo']);
$rss_import_time = intval($this->request['rss_import_time']);
$rss_import_topic_open = intval($this->request['rss_import_topic_open']);
$rss_import_topic_hide = intval($this->request['rss_import_topic_hide']);
$rss_import_topic_pre = $this->request['rss_import_topic_pre'];
$rss_import_allow_html = intval($this->request['rss_import_allow_html']);
$rss_import_auth = intval($this->request['rss_import_auth']);
$rss_import_auth_user = trim($this->request['rss_import_auth_user']) ? trim($this->request['rss_import_auth_user']) : '';
$rss_import_auth_pass = trim($this->request['rss_import_auth_pass']) ? trim($this->request['rss_import_auth_pass']) : '';
$return = 1;
} else {
/* Get the RSS ID */
$rss_input_id = $this->request['rss_id'] ? intval($this->request['rss_id']) : 0;
/* Found an id */
if ($rss_input_id > 0) {
/* Query the data from the db */
$rss_data = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'rss_import', 'where' => 'rss_import_id=' . $rss_input_id));
/* Format Data */
if (!$rss_data['rss_import_url']) {
$rss_import_url = "";
$rss_import_auth = "";
$rss_import_auth_user = "";
$rss_import_auth_pass = "";
} else {
$standalone = 0;
$rss_import_id = intval($rss_data['rss_import_id']);
$rss_import_url = $rss_data['rss_import_url'];
$member = $this->DB->buildAndFetch(array('select' => 'members_display_name', 'from' => 'members', 'where' => 'member_id=' . $rss_data['rss_import_mid']));
$rss_import_mid = $member['members_display_name'];
$rss_import_forum_id = intval($rss_data['rss_import_forum_id']);
$rss_import_auth = intval($rss_data['rss_import_auth']);
$rss_import_auth_user = trim($rss_data['rss_import_auth_user']);
$rss_import_auth_pass = trim($rss_data['rss_import_auth_pass']);
}
} else {
$rss_import_url = IPSText::stripslashes(trim($this->request['rss_url']));
$rss_import_auth = "";
$rss_import_auth_user = "";
$rss_import_auth_pass = "";
}
}
/* Check for URL */
if (!$rss_import_url) {
$this->validate_errors[] = $this->lang->words['im_nourl'];
} else {
/* INIT */
if (!$this->classes_loaded) {
/* Load RSS Class */
if (!is_object($this->class_rss)) {
$classToLoad = IPSLib::loadLibrary(IPS_KERNEL_PATH . 'classRss.php', 'classRss');
$this->class_rss = new $classToLoad();
$this->class_rss->rss_max_show = 100;
}
$this->classes_loaded = 1;
}
/* Set this imports doc type */
$this->class_rss->doc_type = strtoupper(IPS_DOC_CHAR_SET);
/* Set this import's authentication */
$this->class_rss->auth_req = $rss_import_auth;
$this->class_rss->auth_user = $rss_import_auth_user;
$this->class_rss->auth_pass = $rss_import_auth_pass;
$this->class_rss->userAgent = $_SERVER['HTTP_USER_AGENT'];
/* Clear RSS object's error cache first */
$this->class_rss->errors = array();
$this->class_rss->rss_items = array();
/* Reset the rss count as this is a new feed */
$this->class_rss->rss_count = 0;
/* Parse RSS */
$this->class_rss->parseFeedFromUrl($rss_import_url);
/* Validate Data - HTTP Status Code/Text */
if ($this->class_rss->classFileManagement->http_status_code != "200") {
if ($this->class_rss->classFileManagement->http_status_code) {
$this->validate_errors[] = "{$this->lang->words['im_http']} {$this->class_rss->classFileManagement->http_status_code} ({$this->class_rss->classFileManagement->http_status_text})";
}
} else {
$this->validate_msg[] = "{$this->lang->words['im_http']} {$this->class_rss->classFileManagement->http_status_code} ({$this->class_rss->classFileManagement->http_status_text})";
}
/* Display any errors found */
if (is_array($this->class_rss->errors) and count($this->class_rss->errors)) {
foreach ($this->class_rss->errors as $error) {
$this->validate_errors[] = $error;
//.........這裏部分代碼省略.........
示例5: doExecute
//.........這裏部分代碼省略.........
//-----------------------------------------
if ($this->filter != 'ALL') {
if (!in_array($this->filter, $see_groups)) {
$query[] = 'm.member_group_id IN(' . implode(',', $see_groups) . ')';
} else {
$query[] = 'm.member_group_id=' . $this->filter;
}
$url['filter'] = 'filter=' . $this->filter;
}
//-----------------------------------------
// NOT IN Member Groups...
//-----------------------------------------
if (count($hide_ids)) {
$query[] = "m.member_group_id NOT IN(" . implode(",", $hide_ids) . ")";
}
/* Not banned */
$query[] = "m.member_banned=0";
/* Not a spammer */
$query[] = '( ! ' . IPSBWOptions::sql('bw_is_spammer', 'members_bitoptions', 'members', 'global', 'has') . ')';
//-----------------------------------------
// Build query
//-----------------------------------------
$dates = array('lastpost', 'lastvisit', 'joined');
$mapit = array('posts' => 'm.posts', 'joined' => 'm.joined', 'lastpost' => 'm.last_post', 'lastvisit' => 'm.last_visit', 'signature' => 'pp.signature', 'name' => 'm.members_display_name', 'photoonly' => 'pp.pp_main_photo');
//-----------------------------------------
// Do search
//-----------------------------------------
foreach ($mapit as $in => $tbl) {
/**
* Leave isset && != '', can't use empty or 0 values are skipped as well
* @link http://community.invisionpower.com/tracker/issue-37350-sorting-members-by-post-count/
*/
$this->request[$in] = isset($this->request[$in]) && $this->request[$in] != '' ? $this->request[$in] : '';
$inbit = $this->request[$in] = IPSText::parseCleanValue(trim(urldecode(IPSText::stripslashes($this->request[$in]))));
$url[$in] = $in . '=' . urlencode($this->request[$in]);
//-----------------------------------------
// Name...
//-----------------------------------------
if ($in == 'name' and $inbit != "") {
if ($this->request['name_box'] == 'begins') {
$query[] = "m.members_l_display_name LIKE '" . strtolower($inbit) . "%'";
} else {
$query[] = "m.members_l_display_name LIKE '%" . strtolower($inbit) . "%'";
}
} else {
if ($in == 'posts' and is_numeric($inbit) and intval($inbit) > -1) {
$ltmt = $this->request[$in . '_ltmt'] == 'lt' ? '<' : '>';
$query[] = $tbl . ' ' . $ltmt . ' ' . intval($inbit);
$url[$in] = $in . '_ltmt=' . $this->request[$in . '_ltmt'] . '&posts=' . intval($inbit);
} else {
if (in_array($in, $dates) and $inbit) {
if (preg_match('/\\d{2}-\\d{2}-\\d{4}/', $this->request[$in])) {
$_tmp = explode('-', $this->request[$in]);
$time_int = mktime(23, 59, 59, $_tmp[0], $_tmp[1], $_tmp[2]);
} else {
$time_int = strtotime($inbit);
}
if ($time_int) {
$ltmt = $this->request[$in . '_ltmt'] == 'lt' ? '<' : '>';
$query[] = $tbl . ' ' . $ltmt . ' ' . $time_int;
$url[$in . '_ltmt'] = $in . '_ltmt=' . $this->request[$in . '_ltmt'];
}
} else {
if ($in == 'photoonly') {
if ($this->request['photoonly'] == 1) {
$_queryPP = true;
示例6: mailForm
/**
* Bulk mail form
*
* @param string Type (add|edit)
* @param array Mail data
* @param string Mail content
* @param array Filter classes
* @param array Error messages
* @return string HTML
*/
public function mailForm($type, $mail, $mail_content, $filters, $errors)
{
$dd_ltmt = array(0 => array('lt', $this->lang->words['b_lessthan']), 1 => array('mt', $this->lang->words['b_morethan']));
if ($type == 'add') {
$title = $this->lang->words['b_create'];
$button = $this->lang->words['b_proceed'];
$html_checked = 0;
} else {
$title = $this->lang->words['b_editstored'];
$button = $this->lang->words['b_edit'];
//-----------------------------------------
// Unpack more..
//-----------------------------------------
$tmp = unserialize(stripslashes($mail['mail_opts']));
if (is_array($tmp) and count($tmp)) {
foreach ($tmp as $k => $v) {
if (!$mail[$k]) {
$mail[$k] = $v;
}
}
}
$html_checked = $mail['mail_html_on'];
}
$classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite');
$editor = new $classToLoad();
$editor->setContent($mail_content);
$form = array();
$form['groups'] = '';
$form['mail_subject'] = $this->registry->output->formInput('mail_subject', htmlspecialchars(IPSText::stripslashes($_POST['mail_subject'] ? $_POST['mail_subject'] : $mail['mail_subject']), ENT_QUOTES));
$form['mail_content'] = $editor->show('mail_content');
$form['mail_content_plain'] = $this->registry->output->formTextarea('mail_content_plain', $mail_content, 60, 14, '', 'mail_content_plain', "' style='width: 100%'");
// Hacky CSS thing, but eh
$form['mail_post_ltmt'] = $this->registry->output->formDropdown('mail_post_ltmt', $dd_ltmt, $_POST['mail_post_ltml'] ? $_POST['mail_post_ltml'] : $mail['mail_post_ltmt']);
$form['mail_filter_post'] = $this->registry->output->formSimpleInput("mail_filter_post", $_POST['mail_filter_post'] ? $_POST['mail_filter_post'] : $mail['mail_filter_post'], 7);
$form['mail_visit_ltmt'] = $this->registry->output->formDropdown('mail_visit_ltmt', $dd_ltmt, $_POST['mail_visit_ltml'] ? $_POST['mail_visit_ltml'] : $mail['mail_visit_ltmt']);
$form['mail_filter_visit'] = $this->registry->output->formSimpleInput("mail_filter_visit", $_POST['mail_filter_visit'] ? $_POST['mail_filter_visit'] : $mail['mail_filter_visit'], 7);
$form['mail_joined_ltmt'] = $this->registry->output->formDropdown('mail_joined_ltmt', $dd_ltmt, $_POST['mail_joined_ltml'] ? $_POST['mail_joined_ltml'] : $mail['mail_joined_ltmt']);
$form['mail_filter_joined'] = $this->registry->output->formSimpleInput("mail_filter_joined", $_POST['mail_filter_joined'] ? $_POST['mail_filter_joined'] : $mail['mail_filter_joined'], 7);
$form['tags'] = $this->registry->output->formInput('mandrill_tags', $_POST['mandrill_tags'] ? $_POST['mandrill_tags'] : is_array($mail['mandrill_tags']) ? implode(',', $mail['mandrill_tags']) : '');
foreach ($this->cache->getCache('group_cache') as $g) {
if ($g['g_id'] == $this->settings['guest_group']) {
continue;
}
$checked = 0;
if ($mail['mail_groups']) {
if (strstr(',' . $mail['mail_groups'] . ',', ',' . $g['g_id'] . ',')) {
$checked = 1;
}
}
$form['groups'] .= $this->registry->output->formCheckbox('sg_' . $g['g_id'], $checked) . " <b>{$g['g_title']}</b><br />";
}
$standardStyle = '';
$plainStyle = 'display:none';
$htmlOn = 0;
if ($mail['mail_html_on'] or $this->request['mail_html_on'] or !$this->settings['email_use_html']) {
$standardStyle = 'display:none';
$plainStyle = '';
$htmlOn = 1;
}
$IPBHTML = "";
//--starthtml--//
$IPBHTML .= <<<HTML
<div class='section_title'>
\t<h2>{$title}</h2>
</div>
HTML;
if (!empty($errors)) {
$errors = implode('<br />', $errors);
$IPBHTML .= <<<HTML
\t<div class='warning'>
\t\t{$errors}
\t</div>
\t<br />
HTML;
}
$IPBHTML .= <<<HTML
<form name='theAdminForm' id='adminform' action='{$this->settings['base_url']}{$this->form_code}&do=mail_save' method='post'>
\t<input type='hidden' name='id' value='{$mail['mail_id']}' />
\t<input type='hidden' name='type' value='{$type}' />
\t<input type='hidden' name='_admin_auth_key' value='{$this->registry->getClass('adminFunctions')->_admin_auth_key}' />
\t<input type='hidden' name='mail_html_on' id='mail_html_on' value='{$htmlOn}' />
\t
\t<div class='acp-box'>
\t\t<h3>{$title}</h3>
\t\t
\t\t<table class='ipsTable double_pad' cellspacing='0' cellpadding='0'>
\t\t \t<tr>
\t\t \t\t<th colspan='2'>{$this->lang->words['b_step1_title']}</th>
\t\t \t</tr>
//.........這裏部分代碼省略.........
示例7: _remapSave
/**
* Save the form
*
* @param string Type of form
* @return string HTML
*/
protected function _remapSave($type = 'add')
{
//--------------------------------------------
// INIT
//--------------------------------------------
$setID = intval($this->request['setID']);
$map_id = intval($this->request['map_id']);
$map_title = trim(IPSText::stripslashes(IPSText::htmlspecialchars($_POST['map_title'])));
$map_url = trim(IPSText::stripslashes(IPSText::UNhtmlspecialchars($_POST['map_url'])));
$map_match_type = trim($this->request['map_match_type']);
//--------------------------------------------
// Checks...
//--------------------------------------------
if ($type == 'edit') {
if (!$map_id or !$map_title or !$map_url) {
$this->registry->getClass('output')->global_message = $this->lang->words['um_entireform'];
$this->_remapForm($type);
return;
}
} else {
if (!$map_title or !$map_url) {
$this->registry->getClass('output')->global_message = $this->lang->words['um_entireform'];
$this->_remapForm($type);
return;
}
}
//--------------------------------------------
// Save...
//--------------------------------------------
$array = array('map_title' => $map_title, 'map_url' => $map_url, 'map_match_type' => $map_match_type, 'map_skin_set_id' => $setID);
if ($type == 'add') {
$array['map_date_added'] = time();
$this->DB->insert('skin_url_mapping', $array);
$this->registry->getClass('output')->global_message = $this->lang->words['um_added'];
} else {
$this->DB->update('skin_url_mapping', $array, 'map_id=' . $map_id);
$this->registry->getClass('output')->global_message = $this->lang->words['um_edited'];
}
//-----------------------------------------
// Rebuild skin cache...
//-----------------------------------------
$this->skinFunctions->rebuildURLMapCache();
//-----------------------------------------
// Done...
//-----------------------------------------
return $this->_showURLMappingList();
}
示例8: processAfterForm
/**
* Process the content before passing off to the bbcode library
*
* @access public
* @param string Form field name OR Raw text
* @return string Text ready for editor
*/
public function processAfterForm($form_field)
{
$t = isset($_POST[$form_field]) ? IPSText::stripslashes($_POST[$form_field]) : $form_field;
$ot = $t;
//-----------------------------------------
// Fix up spaces
//-----------------------------------------
$t = str_replace(' ', ' ', $t);
//-----------------------------------------
// Gecko engine seems to put \r\n at edge
// of iframe when wrapping? If so, add a
// space or it'll get weird later
//-----------------------------------------
// print $t;
// print "<br><br><br>---------------------<br><br><br>";
//print nl2br(htmlspecialchars($t));
//print "<br><br><br>---------------------<br><br><br>";
if ($this->memberData['userAgentKey'] == 'firefox' or $this->memberData['userAgentKey'] == 'gecko') {
$t = str_ireplace("<br>\r\n", "<br>", $t);
$t = str_ireplace("<br>\n", "<br>", $t);
$t = str_ireplace("<br>\r", "<br>", $t);
$t = str_ireplace("<br />\r\n", "<br />", $t);
$t = str_ireplace("<br />\n", "<br />", $t);
$t = str_ireplace("<br />\r", "<br />", $t);
$t = preg_replace("/((?:\r)?\n?(?:\\s)+)/", " ", $t);
} else {
$t = str_replace("\r\n", "", $t);
}
//print nl2br(htmlspecialchars($t));exit;
//-----------------------------------------
// RTE sends newlines as line break tags
//-----------------------------------------
$t = str_replace("\n", "", $t);
//-----------------------------------------
// Clean up already encoded HTML
//-----------------------------------------
$t = str_replace('"', '"', $t);
$t = str_replace(''', "'", $t);
//-----------------------------------------
// Fix up incorrectly nested urls / BBcode
//-----------------------------------------
$t = preg_replace('#<a\\s+?href=[\'"]([^>]+?)\\[(.+?)[\'"](.+?)' . '>(.+?)\\[\\2</a>#is', '<a href="\\1"\\3>\\4</a>[\\2', $t);
//-----------------------------------------
// Make URLs safe (prevent tag stripping)
//-----------------------------------------
$t = preg_replace_callback('#<(a href|img src)=([\'"])([^>]+?)(\\2)#is', array($this, '_unhtmlUrl'), $t);
//-----------------------------------------
// WYSI-Weirdness #1: BR tags to \n
//-----------------------------------------
$t = str_ireplace(array("<br>", "<br />"), "\n", $t);
$t = trim($t);
//-----------------------------------------
// Before we can use strip_tags, we should
// clean out any javascript and CSS
//-----------------------------------------
$t = preg_replace("/\\<script(.*?)\\>(.*?)\\<\\/script\\>/", '', $t);
$t = preg_replace("/\\<style(.*?)\\>(.*?)\\<\\/style\\>/", '', $t);
//-----------------------------------------
// Remove tags we're not bothering with
// with PHPs wonderful strip tags func
//-----------------------------------------
if (!$this->allow_html) {
$t = strip_tags($t, '<h1><h2><h3><h4><h5><h6><font><span><div><br><p><img><a><li><ol><ul><b><strong><em><i><u><s><strike><blockquote><sub><sup>');
}
//-----------------------------------------
// WYSI-Weirdness #2: named anchors
//-----------------------------------------
$t = preg_replace("#<a\\s+?name=.+?" . ">(.+?)</a>#is", "\\1", $t);
//-----------------------------------------
// WYSI-Weirdness #2.1: Empty a hrefs
//-----------------------------------------
$t = preg_replace("#<a\\s+?href([^>]+)></a>#is", "", $t);
$t = preg_replace("#<a\\s+?href=(['\"])>\\1(.+?)</a>#is", "\\1", $t);
//-----------------------------------------
// WYSI-Weirdness #2.2: Double linked links
//-----------------------------------------
$t = preg_replace("#href=[\"']\\w+://(%27|'|\"|")(.+?)\\1[\"']#is", "href=\"\\2\"", $t);
//-----------------------------------------
// WYSI-Weirdness #3: Headline tags
//-----------------------------------------
$t = preg_replace("#<(h[0-9])>(.+?)</\\1>#is", "\n[b]\\2[/b]\n", $t);
//-----------------------------------------
// WYSI-Weirdness #4: Font tags
//-----------------------------------------
$t = preg_replace("#<font (color|size|face)=\"([a-zA-Z0-9\\s\\#\\-]*?)\">(\\s*)</font>#is", " ", $t);
//-----------------------------------------
// WYSI-Weirdness #5: Fix up smilies
//-----------------------------------------
$current = $this->memberData['view_img'];
$this->member->setProperty('view_img', 0);
$t = IPSText::getTextClass('bbcode')->memberViewImages($t);
$this->member->setProperty('view_img', $current);
//-----------------------------------------
//.........這裏部分代碼省略.........
示例9: parseCleanValue
/**
* Clean _GET _POST value
*
* @access public
* @param string Input
* @param bool Also run postParseCleanValue
* @return string Cleaned Input
* @since 2.1
*/
public static function parseCleanValue($val, $postParse = true)
{
if ($val == "") {
return "";
}
$val = str_replace(" ", " ", IPSText::stripslashes($val));
# Convert all carriage return combos
$val = str_replace(array("\r\n", "\n\r", "\r"), "\n", $val);
$val = str_replace("&", "&", $val);
$val = str_replace("<!--", "<!--", $val);
$val = str_replace("-->", "-->", $val);
$val = str_ireplace("<script", "<script", $val);
$val = str_replace(">", ">", $val);
$val = str_replace("<", "<", $val);
$val = str_replace('"', """, $val);
$val = str_replace("\n", "<br />", $val);
// Convert literal newlines
$val = str_replace("\$", "$", $val);
$val = str_replace("!", "!", $val);
$val = str_replace("'", "'", $val);
// IMPORTANT: It helps to increase sql query safety.
if (IPS_ALLOW_UNICODE) {
$val = preg_replace("/&#([0-9]+);/s", "&#\\1;", $val);
//-----------------------------------------
// Try and fix up HTML entities with missing ;
//-----------------------------------------
$val = preg_replace("/&#(\\d+?)([^\\d;])/i", "&#\\1;\\2", $val);
}
//-----------------------------------------
// Shortcut to auto run other cleaning
//-----------------------------------------
if ($postParse) {
$val = IPSText::postParseCleanValue($val);
}
return $val;
}
示例10: _replace
/**
* Fetch a JSON list of template bits for the template group
*
* @return @e void
*/
protected function _replace()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$finalIDs = array();
$templates = array();
$sessionID = IPSText::md5Clean($this->request['sessionID']);
$sessionData = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'template_sandr', 'where' => "sandr_session_id='" . addslashes($sessionID) . "'"));
$templateData = unserialize($sessionData['sandr_results']);
if (is_array($templateData)) {
foreach ($templateData as $_group => $_data) {
if (!empty($_POST['groups'][$_group])) {
foreach ($_data as $_name => $_id) {
$finalIDs[] = $_id;
}
} else {
foreach ($_data as $_name => $_id) {
if (!empty($_POST['templates'][$_id])) {
$finalIDs[] = $_id;
}
}
}
}
}
/* Check... */
if (!count($finalIDs)) {
$this->returnJsonError($this->lang->words['ajax_missing_data']);
}
/* Load templates */
$this->DB->build(array('select' => '*', 'from' => 'skin_templates', 'where' => 'template_id IN (' . implode(',', $finalIDs) . ')'));
$this->DB->execute();
while ($row = $this->DB->fetch()) {
$templates[$row['template_id']] = $row;
}
/* Perform the replacement */
foreach ($templates as $template_id => $template) {
if ($sessionData['sandr_is_regex']) {
$before = str_replace('#', '\\#', IPSText::stripslashes($sessionData['sandr_search_for']));
$after = preg_replace('#\\\\\\\\(\\d+?)#i', '$\\1', $sessionData['sandr_replace_with']);
$template['template_content'] = preg_replace("#{$before}#si", $after, $template['template_content']);
} else {
$template['template_content'] = str_ireplace($sessionData['sandr_search_for'], $sessionData['sandr_replace_with'], $template['template_content']);
}
/* Save it */
$this->skinFunctions->saveTemplateBitFromEdit($template['template_id'], $sessionData['sandr_set_id'], $template['template_content'], $template['template_data']);
}
/* Done */
$this->returnJsonArray(array('status' => 'ok'));
}
示例11: searchTemplates
/**
* Search template bits
*
* @access public
* @param int Template set id to search
* @param string String to search
* @param boolean Is regex
* @param boolean Search all parents including master template set
* @return array array( 'searchCount' => int, 'matchCount' => int, 'matches' => array )
* Exception Codes
* REGEX_INCORRECT Regex is not valid
*/
public function searchTemplates($setID, $searchString, $isRegex = FALSE, $searchParents = FALSE)
{
//-----------------------------------------
// INIT
//-----------------------------------------
$searchString = IPSText::stripslashes($searchString);
$regexString = str_replace('#', '\\#', str_replace('"', '\\"', $searchString));
$_templates = array();
$_matches = array();
$_matchCount = 0;
$return = array('searchCount' => 0, 'matchCount' => 0, 'matches' => array());
/* Test Regex */
if ($isRegex) {
ob_start();
eval("preg_match( \"#{$regexString}#i\", 'sometexthere' );");
$return = ob_get_contents();
ob_end_clean();
if ($return) {
throw new Exception("REGEX_INCORRECT");
}
}
/* Grab templates to search in */
if ($searchParents) {
$_templates = $this->fetchTemplates($setID);
} else {
$this->DB->build(array('select' => '*', 'from' => 'skin_templates', 'where' => 'template_set_id=' . $setID));
$this->DB->execute();
while ($row = $this->DB->fetch()) {
$_templates[$row['template_group']][strtolower($row['template_name'])] = $row;
}
}
/* Got anything? */
if (!count($_templates)) {
return $return;
}
$_templateCount = 0;
/* You may continue... */
foreach ($_templates as $_group => $_gdata) {
foreach ($_gdata as $_name => $_data) {
if ($isRegex) {
if (preg_match("#{$regexString}#i", $_data['template_content'])) {
$_matches[$_group][$_name] = $_data;
$_matchCount++;
}
} else {
if (stristr($_data['template_content'], $searchString)) {
$_matches[$_group][$_name] = $_data;
$_matchCount++;
}
}
$_templateCount++;
}
}
/* Return to sender */
return array('searchCount' => $_templateCount, 'matchCount' => $_matchCount, 'matches' => $_matches);
}
示例12: _start
/**
* Processes the template bits...
*
* @return string HTML
*/
protected function _start()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$setID = intval($this->request['setID']);
$searchParents = intval($this->request['searchParents']);
$isRegex = intval($this->request['isRegex']);
$searchFor_RAW = IPSText::stripslashes($_POST['searchFor']);
$replaceWith_RAW = IPSText::stripslashes($_POST['replaceWith']);
$_finalMatches = array();
/* Checks */
if (!$searchFor_RAW) {
$this->registry->output->global_error = $this->lang->words['sr_sometext'];
return $this->_showForm();
}
//-----------------------------------------
// Get template set data
//-----------------------------------------
$setData = $this->skinFunctions->fetchSkinData($setID);
try {
$result = $this->skinFunctions->searchTemplates($setID, $_POST['searchFor'], $isRegex, $searchParents);
if ($result['matchCount']) {
/* Finalize */
foreach ($result['matches'] as $_group => $_gdata) {
foreach ($_gdata as $_name => $_data) {
$_finalMatches[$_group][$_name] = $_data['template_id'];
}
}
/* Prep array */
$sessionData = array('sandr_set_id' => $setID, 'sandr_search_only' => $replaceWith_RAW ? 0 : 1, 'sandr_search_all' => $searchParents, 'sandr_search_for' => $searchFor_RAW, 'sandr_replace_with' => $replaceWith_RAW, 'sandr_is_regex' => $isRegex, 'sandr_template_count' => $result['searchCount'], 'sandr_template_processed' => $result['searchCount'], 'sandr_updated' => time(), 'sandr_results' => serialize($_finalMatches));
/* Insert into DB */
$this->DB->insert('template_sandr', $sessionData);
$sessionData['sandr_session_id'] = $this->DB->getInsertID();
} else {
$this->registry->output->global_error = $this->lang->words['sr_nomatches'];
return $this->_showForm();
}
//-----------------------------------------
// Print it...
//-----------------------------------------
$this->registry->output->html .= $this->html->searchandreplace_listTemplateGroups($_finalMatches, $setData, $sessionData);
} catch (Exception $error) {
$this->registry->output->global_error = $error->getMessage();
return $this->_showForm();
}
}
示例13: _showNewTopicForm
/**
* Show PM form
*
* @param string Error message
* @return string returns HTML
*/
protected function _showNewTopicForm($errors = '')
{
//-----------------------------------------
// INIT
//-----------------------------------------
/* Check max per day */
if ($this->messengerFunctions->checkHasHitMax()) {
$this->registry->getClass('output')->showError('maxperday_hit', 10271);
}
/* Check PM flood */
if ($this->messengerFunctions->floodControlCheck() !== TRUE) {
$this->registry->getClass('output')->showError(sprintf($this->lang->words['pm_flood_stop'], $this->messengerFunctions->exceptionData[0]), 010271);
}
/* Check limit*/
if (!$this->messengerFunctions->withinPMQuota($this->memberData)) {
$this->registry->getClass('output')->showError('cannot_send_new_limit', 10273, FALSE, '', 40);
}
$_msg_id = 0;
$formMemberID = intval($this->request['fromMemberID']);
# WAS MID
$topicID = intval($this->request['topicID']);
$preview = $this->request['preview'];
$inviteUsers = array();
$displayData = array('errors' => $errors ? array($errors) : array(), 'topicID' => $topicID, 'preview' => '', 'name' => '', 'title' => '', 'message' => '');
$_POST['Post-NS'] = isset($_POST['Post']) ? $_POST['Post'] : '';
$_POST['Post'] = IPSText::raw2form(isset($_POST['Post']) ? $_POST['Post'] : '');
//-----------------------------------------
// Load editor
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite');
$_editor = new $classToLoad();
$_editor->setAllowHtml(false);
//-----------------------------------------
// Preview post?
//-----------------------------------------
if ($preview) {
/* Grab language for attachment previews */
$this->registry->getClass('class_localization')->loadLanguageFile(array("public_topic"), 'forums');
/* Load parser */
$classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/text/parser.php', 'classes_text_parser');
$parser = new $classToLoad();
$parser->set(array('memberData' => $this->memberData, 'parseBBCode' => 1, 'parseArea' => 'pms', 'parseHtml' => 0, 'parseEmoticons' => 1));
if ($this->request['_from'] == 'quickPM') {
$old_msg = $_editor->process($_editor->fromPlainTextArea($_POST['Post']));
} else {
$old_msg = $_editor->process($_POST['Post']);
}
$old_msg = $parser->display($old_msg);
if (!is_object($this->class_attach)) {
//-----------------------------------------
// Grab render attach class
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('core') . '/sources/classes/attach/class_attach.php', 'class_attach');
$this->class_attach = new $classToLoad($this->registry);
}
//-----------------------------------------
// Continue...
//-----------------------------------------
$this->class_attach->type = 'msg';
$this->class_attach->attach_post_key = $this->_postKey;
$this->class_attach->init();
$attachData = $this->class_attach->renderAttachments(array(0 => $old_msg));
$displayData['preview'] = $attachData[0]['html'] . $attachData[0]['attachmentHtml'];
}
//-----------------------------------------
// Errors
//-----------------------------------------
if ($errors or IPSText::getTextClass('bbcode')->error != "") {
if (IPSText::getTextClass('bbcode')->error) {
$displayData['errors'][] = $this->lang->words[IPSText::getTextClass('bbcode')->error];
}
$preview = 1;
}
//-----------------------------------------
// Did we come from a button with a user ID?
//-----------------------------------------
if ($formMemberID) {
$name = IPSMember::load($formMemberID, 'core');
if ($name['member_id']) {
$displayData['name'] = $name['members_display_name'];
}
} else {
$displayData['name'] = $this->request['entered_name'] ? $this->request['entered_name'] : '';
}
//-----------------------------------------
// Are we quoting an old message?
//-----------------------------------------
if ($preview) {
$displayData['message'] = $_POST['Post-NS'];
if ($this->request['_from'] == 'quickPM') {
$displayData['message'] = IPSText::parseCleanValue($displayData['message'], true);
}
$displayData['title'] = str_replace("'", "'", str_replace('"', '"', IPSText::stripslashes($_POST['msg_title'])));
} else {
//.........這裏部分代碼省略.........
示例14: save_member_name
/**
* Update a user's login or display name
*
* @param string Field to update
* @return @e void [Outputs to screen]
*/
protected function save_member_name($field = 'members_display_name')
{
$member_id = intval($this->request['member_id']);
$member = IPSMember::load($member_id);
//-----------------------------------------
// Allowed to edit administrators?
//-----------------------------------------
if ($member['g_access_cp'] and !$this->registry->getClass('class_permissions')->checkPermission('member_edit_admin', 'members', 'members')) {
$this->registry->output->showError($this->lang->words['m_editadmin']);
}
if ($field == 'members_display_name') {
$display_name = $this->request['display_name'];
$display_name = str_replace("+", "+", $display_name);
} else {
$display_name = $this->request['name'];
$display_name = str_replace("+", "+", $display_name);
$display_name = str_replace('|', '|', $display_name);
$display_name = trim(preg_replace("/\\s{2,}/", " ", $display_name));
}
if ($this->settings['strip_space_chr']) {
// use hexdec to convert between '0xAD' and chr
$display_name = IPSText::removeControlCharacters($display_name);
}
if ($field == 'members_display_name' and preg_match("#[\\[\\];,\\|]#", IPSText::UNhtmlspecialchars($display_name))) {
$this->registry->output->showError($this->lang->words['m_displaynames']);
}
try {
if (IPSMember::getFunction()->updateName($member_id, $display_name, $field, TRUE) === TRUE) {
if ($field == 'members_display_name') {
ipsRegistry::getClass('adminFunctions')->saveAdminLog(sprintf($this->lang->words['m_dnamelog'], $member['members_display_name'], $display_name));
} else {
ipsRegistry::getClass('adminFunctions')->saveAdminLog(sprintf($this->lang->words['m_namelog'], $member['name'], $display_name));
//-----------------------------------------
// If updating a name, and display names
// disabled, update display name too
//-----------------------------------------
if (!ipsRegistry::$settings['auth_allow_dnames']) {
IPSMember::getFunction()->updateName($member_id, $display_name, 'members_display_name', TRUE);
}
//-----------------------------------------
// I say, did we choose to email 'dis member?
//-----------------------------------------
if ($this->request['send_email'] == 1) {
//-----------------------------------------
// By golly, we did!
//-----------------------------------------
$msg = trim(IPSText::stripslashes(nl2br($_POST['email_contents'])));
$msg = str_replace("{old_name}", $member['name'], $msg);
$msg = str_replace("{new_name}", $display_name, $msg);
$msg = str_replace("<#BOARD_NAME#>", $this->settings['board_name'], $msg);
$msg = str_replace("<#BOARD_ADDRESS#>", $this->settings['board_url'] . '/index.' . $this->settings['php_ext'], $msg);
IPSText::getTextClass('email')->message = stripslashes(IPSText::getTextClass('email')->cleanMessage($msg));
IPSText::getTextClass('email')->subject = $this->lang->words['m_changesubj'];
IPSText::getTextClass('email')->to = $member['email'];
IPSText::getTextClass('email')->sendMail();
}
}
$this->cache->rebuildCache('stats', 'global');
} else {
# We should absolutely never get here. So this is a fail-safe, really to
# prevent a "false" positive outcome for the end-user
$this->registry->output->showError($this->lang->words['m_namealready']);
}
} catch (Exception $error) {
// $this->returnJsonError( $error->getMessage() );
switch ($error->getMessage()) {
case 'NO_USER':
$this->registry->output->showError($this->lang->words['m_noid']);
break;
case 'NO_PERMISSION':
case 'NO_NAME':
$this->registry->output->showError(sprintf($this->lang->words['m_morethan3'], $this->settings['max_user_name_length']));
break;
case 'ILLEGAL_CHARS':
$this->registry->output->showError($this->lang->words['m_illegal']);
break;
case 'USER_NAME_EXISTS':
$this->registry->output->showError($this->lang->words['m_namealready']);
break;
default:
$this->registry->output->showError($error->getMessage());
break;
}
}
$this->registry->output->global_message = $this->lang->words[$field . '_updated_success'];
$this->registry->output->silentRedirectWithMessage($this->settings['base_url'] . 'module=members&do=viewmember&member_id=' . $member_id);
}
示例15: mainSave
/**
* Saves a custom field form
*
* @param string Type (add|edit)
* @return @e void
*/
public function mainSave($type = 'edit')
{
/* ID */
$id = intval($this->request['id']);
/* Custom Fields Class */
$classToLoad = IPSLib::loadLibrary(IPS_KERNEL_PATH . 'classCustomFields.php', 'classCustomFields');
$cfields_class = new $classToLoad(array());
if (!$this->request['pf_title']) {
$this->registry->output->showError($this->lang->words['cf_entertitle'], 11221);
}
if (!$this->request['pf_key']) {
$this->registry->output->showError($this->lang->words['cf_enterkey'], 11221.5);
} else {
if ($type == 'edit') {
$_exist = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'pfields_data', 'where' => "pf_key='{$this->request['pf_key']}' AND pf_id <> {$id}"));
} else {
$_exist = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'pfields_data', 'where' => "pf_key='{$this->request['pf_key']}'"));
}
if ($_exist['pf_id']) {
$this->registry->output->showError($this->lang->words['cf_duplicatekey'], 11221.6);
}
}
//-----------------------------------------
// check-da-motcha
//-----------------------------------------
if ($type == 'edit') {
if (!$id) {
$this->registry->output->showError($this->lang->words['cf_norow'], 11222);
}
}
$content = "";
if ($_POST['pf_content'] != "") {
$content = $cfields_class->formatContentForSave($_POST['pf_content']);
}
$db_string = array('pf_title' => $this->request['pf_title'], 'pf_desc' => $this->request['pf_desc'], 'pf_content' => IPSText::stripslashes($content), 'pf_type' => $this->request['pf_type'], 'pf_not_null' => intval($this->request['pf_not_null']), 'pf_member_hide' => intval($this->request['pf_member_hide']), 'pf_max_input' => intval($this->request['pf_max_input']), 'pf_member_edit' => intval($this->request['pf_member_edit']), 'pf_position' => intval($this->request['pf_position']), 'pf_show_on_reg' => intval($this->request['pf_show_on_reg']), 'pf_input_format' => $this->request['pf_input_format'], 'pf_admin_only' => intval($this->request['pf_admin_only']), 'pf_topic_format' => IPSText::stripslashes($_POST['pf_topic_format']), 'pf_group_id' => intval($this->request['pf_group_id']), 'pf_icon' => trim($this->request['pf_icon']), 'pf_key' => trim($this->request['pf_key']), 'pf_search_type' => trim($this->request['pf_search_type']), 'pf_filtering' => intval($this->request['pf_filtering']));
if ($type == 'edit') {
$this->DB->update('pfields_data', $db_string, 'pf_id=' . $id);
$this->registry->output->global_message = $this->lang->words['cf_edited'];
} else {
$this->DB->insert('pfields_data', $db_string);
$new_id = $this->DB->getInsertId();
$this->DB->addField('pfields_content', "field_{$new_id}", 'text');
$this->DB->optimize('pfields_content');
$this->registry->output->global_message = $this->lang->words['cf_added'];
}
$this->rebuildCache();
$this->mainScreen();
}