当前位置: 首页>>代码示例>>PHP>>正文


PHP ParseFilter::process方法代码示例

本文整理汇总了PHP中ParseFilter::process方法的典型用法代码示例。如果您正苦于以下问题:PHP ParseFilter::process方法的具体用法?PHP ParseFilter::process怎么用?PHP ParseFilter::process使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ParseFilter的用法示例。


在下文中一共展示了ParseFilter::process方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ParseFilter

        <city></city>
</user>
XML;
        }
        $resp .= "</profiles>";
        break;
        // Отправляем ПМ
    // Отправляем ПМ
    case "sendmessage":
        require_once ENGINE_DIR . '/classes/parse.class.php';
        $parse = new ParseFilter();
        $parse->safe_mode = true;
        $uid = intval($_GET['uid']);
        $sender_id = intval($_GET['sender_id']);
        $message = convert_unicode($_GET['message'], $config['charset']);
        $message = $parse->BB_Parse($parse->process($message), false);
        $subj = strip_tags($db->safesql($nextgame['subj_pm'], $config['charset']));
        if ($_GET['type'] == 'user') {
            $user = $db->super_query("SELECT user_id,name from " . USERPREFIX . "_users where user_id='{$sender_id}'");
        } else {
            $user['name'] = "NexGame Aplication";
        }
        $time = time() + $config['date_adjust'] * 60;
        $db->query("INSERT INTO " . USERPREFIX . "_pm (subj, text, user, user_from, date, pm_read, folder) values ('{$subj}', '{$message}', '{$uid}', '{$user['name']}', '{$time}', 'no', 'inbox')");
        $db->query("UPDATE " . USERPREFIX . "_users set pm_all=pm_all+1, pm_unread=pm_unread+1  where user_id='{$uid}'");
        $resp = "<msg><uid>{$uid}</uid><delivered>1</delivered></msg>";
        break;
    case 'sendinvite':
        /// Инвайт отправим.
        if (empty($_GET['uid']) or intval($_GET['sender_id']) == 0 or intval($_GET['app_id']) == 0) {
            die;
开发者ID:skypach,项目名称:skypach.ru,代码行数:31,代码来源:api.xml.php

示例2: Add

 public function Add($values_array)
 {
     if (!in_array($this->member['group'], $this->config['user_int_allow_no_code'])) {
         $sec_code_session = $_SESSION['sec_code_session'] != '' ? $_SESSION['sec_code_session'] : false;
         $_SESSION['sec_code_session'] = false;
         if ($_POST['sec_code'] != $sec_code_session or !$sec_code_session) {
             $this->Errors[] = $this->lang['error_code'];
         }
     }
     if (!$GLOBALS['is_logged'] && $this->config['general_allow_reg']) {
         $parse = new ParseFilter(array(), array(), 1, 1);
         $password1 = $this->base->EscapeString($parse->process($_POST['password1']));
         $password2 = $this->base->EscapeString($parse->process($_POST['password2']));
         $name = $this->base->EscapeString($parse->process(htmlspecialchars(trim($_POST['name']))));
         $email = $this->base->EscapeString($parse->process(htmlspecialchars(trim($_POST['email']))));
         $member_id = $GLOBALS['db']->super_query("SELECT * FROM " . USERPREFIX . "_users where name='{$name}' and password='" . md5(md5($password1)) . "'");
         if ($member_id) {
             $this->LoginIn($password1);
             $GLOBALS['member_id'] = $member_id;
             $this->member['id'] = $member_id['user_id'];
             $this->member['name'] = $member_id['name'];
             $this->member['group'] = $member_id['user_group'];
             $this->member['ip'] = $member_id['logged_ip'];
             $this->guest_session = '';
         } else {
             auto_check_reg($name, $email, $password1, $password2);
         }
     }
     $this->values = $values_array;
     $this->CheckError();
     require_once ENGINE_DIR . '/car-market/classes/Fields.php';
     $xfields = new Fields($this->base, $this);
     $this->values['xfields'] = $xfields->EncodeFields($this->values);
     $this->Errors = $this->Errors + $xfields->getErrors();
     if ($this->Errors) {
         return false;
     }
     if (!$GLOBALS['is_logged'] && $this->config['general_allow_reg']) {
         if (intval($GLOBALS['config']['reg_group']) < 3) {
             $GLOBALS['config']['reg_group'] = 4;
         }
         $regpassword = md5(md5($password1));
         $GLOBALS['db']->query("INSERT INTO " . USERPREFIX . "_users (name, password, email, reg_date, lastdate, user_group, info, signature, favorites, xfields, logged_ip) VALUES ('{$name}', '{$regpassword}', '{$email}', '{$this->base->timer->cur_time}', '{$this->base->timer->cur_time}', '" . $GLOBALS['config']['reg_group'] . "', '', '', '', '', '" . $this->member['ip'] . "')");
         $this->member['id'] = $GLOBALS['db']->insert_id();
         $this->member['name'] = $name;
         $this->member['group'] = $GLOBALS['config']['reg_group'];
         $guest_session = $this->guest_session;
         $this->guest_session = '';
         $this->LoginIn($password1);
     }
     //        if ($this->values['capacity_motor'] > 1000)
     //        {
     //            $this->values['capacity_motor'] = $this->values['capacity_motor']/1000;
     //        }
     $this->PreparationValues();
     if (in_array($this->member['group'], $this->config['user_int_allow_change_exp'])) {
         if ($this->values['count_day']) {
             $this->values['exp_date'] = $this->base->timer->cur_time + (int) $this->values['count_day'] * 24 * 60 * 60;
         } else {
             $this->values['exp_date'] = 0;
         }
     } elseif ($this->config['user_int_default_day_count']) {
         $this->values['exp_date'] = $this->base->timer->cur_time + (int) $this->config['user_int_default_day_count'] * 24 * 60 * 60;
     } else {
         $this->values['exp_date'] = 0;
     }
     if (in_array($this->member['group'], $this->config['user_int_allow_no_moder'])) {
         $this->values['allow_site'] = 1;
     }
     $this->values['guest_session'] = $this->guest_session;
     $this->values['add_date'] = $this->values['update_date'] = $this->base->timer->cur_time;
     $this->values['author'] = $this->member['name'];
     $this->values['author_id'] = $this->member['id'];
     $this->values['author_ip'] = $this->member['ip'];
     $id = $this->base->Insert('auto_autos', $this->values);
     if (!empty($this->values['images'])) {
         $this->values['images'] = array_slice($this->values['images'], 0, $this->config['count_photo'][$this->member['group']]);
         if ($this->values['images']) {
             $this->base->SetWhere('id', $this->values['images'], 'IN', 'auto_images');
             if ($this->member['id']) {
                 $this->base->Update('auto_images', array('auto_id' => $id), array('auto_id' => 0, 'user_id' => $this->member['id']));
             } else {
                 if (!empty($guest_session)) {
                     $this->base->Update('auto_images', array('auto_id' => $id, 'user_id' => $this->member['id'], 'guest_session' => ''), array('auto_id' => 0, 'guest_session' => $guest_session));
                 } else {
                     $this->base->Update('auto_images', array('auto_id' => $id), array('auto_id' => 0, 'guest_session' => $this->guest_session));
                 }
             }
             if (!(int) $this->values['main_photo']) {
                 $this->values['main_photo'] = reset($this->values['images']);
             }
             $this->base->Update('auto_autos', array('photo' => $this->values['main_photo'], 'photo_count' => count($this->values['images'])), array('id' => $id));
         }
     }
     if (!empty($_FILES['photo']['name'][0]) && $this->UploadPhoto($id)) {
         $this->base->Update('auto_autos', array('photo' => $this->values['photo'], 'photo_count' => $this->values['photo_count']), array('id' => $id));
     }
     if (!empty($this->values['allow_site'])) {
         $this->IncrementCounter($this->values['mark_id'], $this->values['model_id']);
         Cache::ClearAllCache();
//.........这里部分代码省略.........
开发者ID:dautushenka,项目名称:car-market,代码行数:101,代码来源:CarMarketUser.php

示例3: array

        $user_group[$row['id']] = array();
        foreach ($row as $key => $value) {
            $user_group[$row['id']][$key] = stripslashes($value);
        }
    }
    set_vars("usergroup", $user_group);
    $db->free();
}
@header("Content-type: text/html; charset=" . $config['charset']);
$parse = new ParseFilter();
$parse->safe_mode = true;
$parse->allow_url = $user_group[$member_id['user_group']]['allow_url'];
$parse->allow_image = $user_group[$member_id['user_group']]['allow_image'];
$id = intval($_POST['id']);
$text = convert_unicode($_POST['text'], $config['charset']);
$text = $parse->BB_Parse($parse->process(trim($text)), false);
if ($config['allow_complaint_mail']) {
    include_once ENGINE_DIR . '/classes/mail.class.php';
    $mail = new dle_mail($config);
    $lang['mail_complaint_1'] = str_replace("{site}", $config['http_home_url'], $lang['mail_complaint_1']);
}
if ($_POST['action'] == "pm") {
    if (!$is_logged) {
        die("error");
    }
    if (!$id or !$text) {
        die("error");
    }
    $row = $db->super_query("SELECT id, text, user, user_from FROM " . USERPREFIX . "_pm WHERE id='{$id}'");
    if ($row['user'] != $member_id['user_id'] or !$row['id']) {
        die("Operation not Allowed");
开发者ID:Gordondalos,项目名称:union,代码行数:31,代码来源:complaint.php

示例4: die

     die("error");
 }
 if ($config['allow_comments_wysiwyg']) {
     $parse->wysiwyg = true;
     $use_html = true;
     $parse->ParseFilter(array('div', 'span', 'p', 'br', 'strong', 'em', 'ul', 'li', 'ol', 'b', 'u', 'i', 's'), array(), 0, 1);
     if ($user_group[$member_id['user_group']]['allow_url']) {
         $parse->tagsArray[] = 'a';
     }
     if ($user_group[$member_id['user_group']]['allow_image']) {
         $parse->tagsArray[] = 'img';
     }
 } else {
     $use_html = false;
 }
 $comm_txt = trim($parse->BB_Parse($parse->process(convert_unicode($_POST['comm_txt'], $config['charset'])), $use_html));
 if ($parse->not_allowed_tags) {
     die("error");
 }
 if ($parse->not_allowed_text) {
     die("error");
 }
 if (dle_strlen($comm_txt, $config['charset']) > $config['comments_maxlen']) {
     die("error");
 }
 if ($comm_txt == "") {
     die("error");
 }
 if (intval($config['comments_minlen']) and dle_strlen($comm_txt, $config['charset']) < $config['comments_minlen']) {
     die("error");
 }
开发者ID:Banych,项目名称:SiteCreate,代码行数:31,代码来源:editcomments.php

示例5: explode

 $allow_list = explode(',', $user_group[$member_id['user_group']]['cat_add']);
 foreach ($category as $selected) {
     if ($allow_list[0] != "all" and !in_array($selected, $allow_list) and $member_id['user_group'] != 1) {
         $approve = 0;
     }
 }
 if (!$user_group[$member_id['user_group']]['moderation']) {
     $approve = 0;
 }
 $allow_list = explode(',', $user_group[$member_id['user_group']]['cat_allow_addnews']);
 foreach ($category as $selected) {
     if ($allow_list[0] != "all" and !in_array($selected, $allow_list) and $ifdelete != "yes") {
         msg("error", $lang['addnews_error'], $lang['news_err_41'], "javascript:history.go(-1)");
     }
 }
 $title = $parse->process(trim(strip_tags($_POST['title'])));
 if (!$user_group[$member_id['user_group']]['allow_html']) {
     $_POST['short_story'] = strip_tags($_POST['short_story']);
     $_POST['full_story'] = strip_tags($_POST['full_story']);
 }
 if ($config['allow_admin_wysiwyg']) {
     $parse->allow_code = false;
 }
 $full_story = $parse->process($_POST['full_story']);
 $short_story = $parse->process($_POST['short_story']);
 if ($config['allow_admin_wysiwyg'] or $allow_br != '1') {
     $full_story = $db->safesql($parse->BB_Parse($full_story));
     $short_story = $db->safesql($parse->BB_Parse($short_story));
 } else {
     $full_story = $db->safesql($parse->BB_Parse($full_story, false));
     $short_story = $db->safesql($parse->BB_Parse($short_story, false));
开发者ID:Banych,项目名称:SiteCreate,代码行数:31,代码来源:editnews.php

示例6: echofooter

</table>
</div></form>
HTML;
    echofooter();
    exit;
} elseif ($_POST['action'] == "do_mass_move_to_ban") {
    include_once ENGINE_DIR . '/classes/parse.class.php';
    $parse = new ParseFilter();
    foreach ($selected_users as $id) {
        $id = intval($id);
        $row = $db->super_query("SELECT name, user_group FROM " . USERPREFIX . "_users WHERE user_id='{$id}'");
        if ($member_id['user_group'] != 1 and $row['user_group'] == 1) {
            msg("error", $lang['mass_error'], $lang['edit_not_admin'], "?mod=editusers&amp;action=list");
        }
        $db->query("INSERT INTO " . USERPREFIX . "_admin_logs (name, date, ip, action, extras) values ('" . $db->safesql($member_id['name']) . "', '{$_TIME}', '{$_IP}', '44', '{$row['name']}')");
        $banned_descr = $db->safesql($parse->BB_Parse($parse->process($_POST['banned_descr']), false));
        $this_time = time() + $config['date_adjust'] * 60;
        $banned_date = intval($_POST['banned_date']);
        $this_time = $banned_date ? $this_time + $banned_date * 60 * 60 * 24 : 0;
        $row = $db->super_query("SELECT users_id, days FROM " . USERPREFIX . "_banned WHERE users_id = '{$id}'");
        if (!$row['users_id']) {
            $db->query("INSERT INTO " . USERPREFIX . "_banned (users_id, descr, date, days) values ('{$id}', '{$banned_descr}', '{$this_time}', '{$banned_date}')");
        } else {
            if ($row['days'] != $banned_date) {
                $db->query("UPDATE " . USERPREFIX . "_banned SET descr='{$banned_descr}', days='{$banned_date}', date='{$this_time}' WHERE users_id = '{$id}'");
            } else {
                $db->query("UPDATE " . USERPREFIX . "_banned set descr='{$banned_descr}' WHERE users_id = '{$id}'");
            }
        }
        @unlink(ENGINE_DIR . '/cache/system/banned.php');
        $db->query("UPDATE " . USERPREFIX . "_users SET banned='yes' WHERE user_id ='{$id}'");
开发者ID:Hadryan,项目名称:L2LWEB,代码行数:31,代码来源:mass_user_actions.php

示例7: die

*/
if (!defined('DATALIFEENGINE') or !$config['allow_comments']) {
    die("Hacking attempt!");
}
require_once ENGINE_DIR . '/classes/parse.class.php';
if ($config['allow_comments_wysiwyg'] > 0) {
    $parse = new ParseFilter(array('div', 'span', 'p', 'br', 'strong', 'em', 'ul', 'li', 'ol', 'b', 'u', 'i', 's'), array(), 0, 1);
} else {
    $parse = new ParseFilter();
}
$parse->safe_mode = true;
$parse->allow_url = $user_group[$member_id['user_group']]['allow_url'];
$parse->allow_image = $user_group[$member_id['user_group']]['allow_image'];
$_TIME = time();
$_IP = get_ip();
$name = $db->safesql($parse->process(trim($_POST['name'])));
$not_allow_symbol = array("\"", "`", "\t", '\\n', '\\r', "\n", "\r", '\\', ",", "/", "¬", "#", ";", ":", "~", "[", "]", "{", "}", ")", "(", "*", "^", "%", "\$", "<", ">", "?", "!", '"', "'", " ", "&");
$mail = $db->safesql(trim(str_replace($not_allow_symbol, '', strip_tags(stripslashes($_POST['mail'])))));
$post_id = intval($_POST['post_id']);
$stop = array();
$added_comments_id = 0;
if ($is_logged) {
    $name = $db->safesql($member_id['name']);
    $mail = $db->safesql($member_id['email']);
}
if ($user_group[$member_id['user_group']]['spamfilter']) {
    $row = $db->super_query("SELECT * FROM " . PREFIX . "_spam_log WHERE ip = '{$_IP}'");
    if (!$row['id'] or !$row['email']) {
        include_once ENGINE_DIR . '/classes/stopspam.class.php';
        $sfs = new StopSpam($config['spam_api_key'], $user_group[$member_id['user_group']]['spamfilter']);
        $args = array('ip' => $_IP, 'email' => $mail);
开发者ID:Gordondalos,项目名称:union,代码行数:31,代码来源:addcomments.php

示例8: die

    if ($_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash) {
        die("Hacking attempt! User not found");
    }
    if ($config['allow_comments_wysiwyg']) {
        $parse->wysiwyg = true;
        $use_html = true;
        $parse->ParseFilter(array('div', 'a', 'span', 'p', 'br'), array(), 0, 1);
    } else {
        $use_html = false;
    }
    if (!$_POST['selected_comments']) {
        msg("error", $lang['mass_error'], $lang['mass_acomm'], "?mod=cmoderation");
    }
    foreach ($_POST['selected_comments'] as $c_id) {
        $c_id = intval($c_id);
        $comments = $db->safesql($parse->BB_Parse($parse->process($_POST['selected_text'][$c_id]), $use_html));
        $post_id = intval($_POST['post_id'][$c_id]);
        $db->query("UPDATE " . PREFIX . "_comments SET text='{$comments}', approve='1' WHERE id='{$c_id}'");
        $db->query("UPDATE " . PREFIX . "_post SET comm_num=comm_num+1 WHERE id='{$post_id}'");
    }
    $db->query("INSERT INTO " . USERPREFIX . "_admin_logs (name, date, ip, action, extras) values ('" . $db->safesql($member_id['name']) . "', '{$_TIME}', '{$_IP}', '19', '')");
    clear_cache();
    msg("info", $lang['mass_head'], $lang['mass_approve_ok'], "?mod=cmoderation");
}
if ($action == "mass_delete") {
    if ($_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash) {
        die("Hacking attempt! User not found");
    }
    if (!$_POST['selected_comments']) {
        msg("error", $lang['mass_error'], $lang['mass_dcomm'], "?mod=cmoderation");
    }
开发者ID:Zzepish,项目名称:IvanShikalovWebSIte,代码行数:31,代码来源:cmoderation.php

示例9: ParseFilter

$parse = new ParseFilter(array(), array(), 1, 1);
$allow_br = intval($_POST['allow_br']);
if ($_POST['preview_mode'] == "static") {
    if ($member_id['user_group'] != 1 and $allow_br > 1) {
        $allow_br = 1;
    }
    if ($allow_br == 2) {
        if (function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc()) {
            $_POST['template'] = stripslashes($_POST['template']);
        }
        $template = trim(addslashes($_POST['template']));
    } else {
        if ($config['allow_static_wysiwyg']) {
            $parse->allow_code = false;
        }
        $template = $parse->process($_POST['template']);
        if ($config['allow_static_wysiwyg'] or $allow_br != '1') {
            $template = $parse->BB_Parse($template);
        } else {
            $template = $parse->BB_Parse($template, false);
        }
    }
    $descr = trim(htmlspecialchars(stripslashes($_POST['description']), ENT_QUOTES, $config['charset']));
    if ($_GET['page'] == "rules") {
        $descr = $lang['rules_edit'];
    }
    if ($_POST['allow_template']) {
        $dle_module = "static";
        if ($_POST['static_tpl'] == "") {
            if (@is_file($tpl->dir . "/preview.tpl")) {
                $tpl->load_template('preview.tpl');
开发者ID:Banych,项目名称:SiteCreate,代码行数:31,代码来源:preview.php

示例10: array

             if ($resp->is_valid) {
                 $sec_code = 1;
                 $sec_code_session = 1;
             }
         }
     } else {
         $sec_code = $_POST['sec_code'];
         $sec_code_session = $_SESSION['sec_code_session'] != '' ? $_SESSION['sec_code_session'] : false;
     }
 } else {
     $sec_code = 1;
     $sec_code_session = 1;
 }
 $password1 = $_POST['password1'];
 $password2 = $_POST['password2'];
 $name = $db->safesql($parse->process(htmlspecialchars(trim($_POST['name']), ENT_COMPAT, $config['charset'])));
 $name = preg_replace('#\\s+#i', ' ', $name);
 $not_allow_symbol = array("\"", "`", "\t", '\\n', '\\r', "\n", "\r", '\\', ",", "/", "¬", "#", ";", ":", "~", "[", "]", "{", "}", ")", "(", "*", "^", "%", "\$", "<", ">", "?", "!", '"', "'", " ", "&");
 $email = $db->safesql(trim(str_replace($not_allow_symbol, '', strip_tags(stripslashes($_POST['email'])))));
 $reg_error = check_reg($name, $email, $password1, $password2, $sec_code, $sec_code_session);
 if ($config['reg_question']) {
     if (intval($_SESSION['question'])) {
         $answer = $db->super_query("SELECT id, answer FROM " . PREFIX . "_question WHERE id='" . intval($_SESSION['question']) . "'");
         $answers = explode("\n", $answer['answer']);
         $pass_answer = false;
         if (function_exists('mb_strtolower')) {
             $question_answer = trim(mb_strtolower($_POST['question_answer'], $config['charset']));
         } else {
             $question_answer = trim(strtolower($_POST['question_answer']));
         }
         if (count($answers) and $question_answer) {
开发者ID:Zzepish,项目名称:IvanShikalovWebSIte,代码行数:31,代码来源:register.php

示例11: explode

 $allow_list = explode(',', $user_group[$member_id['user_group']]['cat_allow_addnews']);
 if ($allow_list[0] != "all") {
     foreach ($catlist as $selected) {
         if (!in_array($selected, $allow_list) and $member_id['user_group'] != "1") {
             $stop .= "<li>" . $lang['news_err_41'] . "</li>";
         }
     }
 }
 if (!$user_group[$member_id['user_group']]['allow_html']) {
     $config['allow_site_wysiwyg'] = "no";
     $_POST['short_story'] = strip_tags($_POST['short_story']);
     $_POST['full_story'] = strip_tags($_POST['full_story']);
 }
 if ($config['allow_site_wysiwyg'] == "yes") {
     $parse->allow_code = false;
     $full_story = $db->safesql($parse->BB_Parse($parse->process($_POST['full_story'])));
     $short_story = $db->safesql($parse->BB_Parse($parse->process($_POST['short_story'])));
     $allow_br = 0;
 } else {
     $full_story = $db->safesql($parse->BB_Parse($parse->process($_POST['full_story']), false));
     $short_story = $db->safesql($parse->BB_Parse($parse->process($_POST['short_story']), false));
     $allow_br = 1;
 }
 if ($parse->not_allowed_text) {
     $stop .= "<li>" . $lang['news_err_39'] . "</li>";
 }
 $parse->ParseFilter();
 $title = $db->safesql($parse->process(trim(strip_tags($_POST['title']))));
 $alt_name = trim($parse->process(stripslashes($_POST['alt_name'])));
 if ($config['safe_xfield']) {
     $parse->ParseFilter();
开发者ID:Hadryan,项目名称:L2LWEB,代码行数:31,代码来源:addnews.php

示例12: _create_dle_account

 protected function _create_dle_account()
 {
     $member_id['email'] = $this->user['email'];
     $member_id['icq'] = $this->user['icq'];
     if (VB_CHARSET && VB_CHARSET != DLE_CHARSET) {
         $member_id['email'] = iconv(VB_CHARSET, DLE_CHARSET, $this->user['email']);
         $member_id['icq'] = iconv(VB_CHARSET, DLE_CHARSET, $this->user['icq']);
     }
     $member_id['user_group'] = $GLOBALS['config']['reg_group'];
     $member_id['name'] = $_POST['login_name'];
     $add = array();
     $add['name'] = $this->db->safesql($_POST['login_name']);
     $add['password'] = md5($_POST['login_password']);
     $add['email'] = $this->db->safesql($this->user['email']);
     $add['icq'] = $this->db->safesql($member_id['icq']);
     $add['reg_date'] = TIMENOW + $GLOBALS['config']['date_adjust'] * 60;
     $add['lastdate'] = TIMENOW + $GLOBALS['config']['date_adjust'] * 60;
     $add['logged_ip'] = $this->db->safesql(IPADRESS);
     $update_fields = array();
     $this->_init_parse();
     foreach ($this->config['fields'] as $dle_field => $vb_field_id) {
         if ($vb_field_id) {
             if ($vb_field_id < 0) {
                 $vb_field = array_search($vb_field_id, $this->user_vb_field);
             } else {
                 $vb_field = 'field' . $vb_field_id;
             }
             if (empty($this->user[$vb_field])) {
                 continue;
             } else {
                 $value = $this->user[$vb_field];
             }
             if (VB_CHARSET && VB_CHARSET != DLE_CHARSET) {
                 $value = iconv(VB_CHARSET, DLE_CHARSET, $value);
             }
             if (in_array($dle_field, array('info', 'land', 'fullname'))) {
                 $member_id[$dle_field] = $add[$dle_field] = $this->db->safesql($value);
             } else {
                 $value = $this->_parse->BB_Parse($this->_parse->process($value));
                 $value = str_replace("|", "&#124;", $value);
                 $update_fields[] = $this->db->safesql($dle_field . "|" . $value);
             }
         }
     }
     $add['user_group'] = $GLOBALS['config']['reg_group'];
     $add['favorites'] = '';
     $add['signature'] = '';
     if ($update_fields) {
         $add['xfields'] = implode("||", $update_fields);
     }
     $this->db->query("INSERT INTO " . USERPREFIX . "_users (" . implode(", ", array_keys($add)) . ") VALUES ('" . implode("', '", $add) . "')");
     $member_id['user_id'] = $this->db->insert_id();
     $member_id['logged_ip'] = $_SERVER['REMOTE_ADDR'];
     $member_id['reg_date'] = $member_id['lastdate'] = time() + $GLOBALS['config']['date_adjust'] * 60;
     set_cookie("dle_user_id", $member_id['user_id'], 365);
     set_cookie("dle_password", $_POST['login_password'], 365);
     $_SESSION['dle_user_id'] = $member_id['user_id'];
     $_SESSION['dle_password'] = $_POST['login_password'];
     $_SESSION['member_lasttime'] = $member_id['lastdate'];
     $_SESSION['dle_log'] = 0;
     $GLOBALS['dle_login_hash'] = md5(strtolower($_SERVER['HTTP_HOST'] . $member_id['name'] . $_POST['login_password'] . $GLOBALS['config']['key'] . date("Ymd")));
     if ($GLOBALS['config']['log_hash']) {
         $hash = md5(uniqid(time()) . time());
         $this->db->query("UPDATE " . USERPREFIX . "_users set hash='" . $hash . "' WHERE user_id='{$member_id['user_id']}'");
         set_cookie("dle_hash", $hash, 365);
         $_COOKIE['dle_hash'] = $hash;
         $member_id['hash'] = $hash;
     }
     $GLOBALS['member_id'] = $member_id;
     $GLOBALS['is_logged'] = true;
     if ($this->user['avatarid']) {
         $avatarid = $this->_db_connect()->super_query("SELECT avatarpath FROM " . VB_PREFIX . "avatar WHERE avatarid=" . $this->user['avatarid']);
         if ($avatarid) {
             $this->_db_disconnect();
             $this->UpdateDLEAvatar(array('username' => $this->user['username'], 'avatarurl' => $avatarid['avatarurl']));
         }
     } else {
         if ($this->vb_config['usefileavatar'] && $this->user['avatarrevision']) {
             $this->UpdateDLEAvatar(array('username' => $this->user['username'], 'avatarurl' => $this->vb_config['bburl'] . "/" . $this->vb_config['avatarurl'] . "/avatar" . $this->user['userid'] . "_" . $this->user['avatarrevision'] . ".gif"));
         }
     }
     return $member_id;
 }
开发者ID:dautushenka,项目名称:dle-vb,代码行数:83,代码来源:dle_vs_vb.php

示例13: intval

 $save_con['allow_social'] = intval($save_con['allow_social']);
 $save_con['auth_only_social'] = intval($save_con['auth_only_social']);
 $save_con['allow_comments_rating'] = intval($save_con['allow_comments_rating']);
 $save_con['tree_comments'] = intval($save_con['tree_comments']);
 $save_con['tree_comments_level'] = intval($save_con['tree_comments_level']);
 $save_con['simple_reply'] = intval($save_con['simple_reply']);
 if ($save_con['adminlog_maxdays'] < 30) {
     $save_con['adminlog_maxdays'] = 30;
 }
 if (substr($save_con['http_home_url'], -1, 1) != '/') {
     $save_con['http_home_url'] = $save_con['http_home_url'] . "/";
 }
 include_once ENGINE_DIR . '/classes/parse.class.php';
 $parse = new ParseFilter();
 $parse->safe_mode = true;
 $save_con['offline_reason'] = $parse->process(stripslashes(trim($save_con['offline_reason'])));
 $save_con['offline_reason'] = str_replace('"', '&quot;', $parse->BB_Parse($save_con['offline_reason'], false));
 $save_con['admin_allowed_ip'] = str_replace("\r", "", trim($save_con['admin_allowed_ip']));
 $save_con['admin_allowed_ip'] = str_replace("\n", "|", $save_con['admin_allowed_ip']);
 $temp_array = explode("|", $save_con['admin_allowed_ip']);
 $allowed_ip = array();
 if (count($temp_array)) {
     foreach ($temp_array as $value) {
         $value1 = str_replace("*", "0", trim($value));
         $value1 = explode('/', $value1);
         $value1 = ip2long($value1[0]);
         if ($value1 != -1 and $value1 !== FALSE) {
             $allowed_ip[] = trim($value);
         }
     }
 }
开发者ID:Gordondalos,项目名称:union,代码行数:31,代码来源:options.php

示例14: PreparationValues

 protected function PreparationValues()
 {
     if (!class_exists('ParseFilter')) {
         throw new ExceptionAllError('Не найден класс ParseFilter');
     }
     $parse = new ParseFilter(array(), array(), 1, 1);
     foreach ($this->checkbox_fields as $box_name => $name) {
         if (!empty($this->values[$box_name])) {
             $this->values[$box_name] = 1;
         } else {
             $this->values[$box_name] = 0;
         }
     }
     if (empty($this->values['cost'])) {
         $this->values['cost'] = 0;
     } else {
         $this->values['cost'] = str_replace(",", ".", str_replace(" ", "", $this->values['cost']));
     }
     if (empty($this->values['currency'])) {
         $this->values['currency'] = "USD";
     }
     $this->values['cost_search'] = $this->values['cost'] / $this->config['currency'][$this->values['currency']];
     if (!empty($this->values['auction']) && $this->values['cost']) {
         $this->values['auction'] = 1;
     } else {
         $this->values['auction'] = 0;
     }
     if (!empty($this->values['allow_site'])) {
         $this->values['allow_site'] = 1;
     } else {
         $this->values['allow_site'] = 0;
     }
     if (!empty($this->values['allow_block'])) {
         $this->values['allow_block'] = 1;
         if (!empty($this->values['block_date'])) {
             $this->values['block_date'] = strtotime($this->values['block_date']);
         } else {
             $this->values['block_date'] = 0;
         }
     } else {
         $this->values['block_date'] = 0;
         $this->values['allow_block'] = 0;
     }
     if (!empty($this->values['exp_date'])) {
         $this->values['exp_date'] = strtotime($this->values['exp_date']);
     } else {
         $this->values['exp_date'] = 0;
     }
     $this->values['city_other'] = $parse->process(trim($this->values['city_other']));
     $this->values['model_other'] = $parse->process(trim($this->values['model_other']));
     $this->values['phone'] = $parse->process(trim($this->values['phone']));
     $this->values['contact_person'] = $parse->process(trim($this->values['contact_person']));
     $this->values['description'] = $parse->BB_Parse($this->values['description'], false);
     if ($this->values['model_other']) {
         $this->values['model_id'] = 0;
     }
     if ($this->values['city_other']) {
         $this->values['city_id'] = 0;
     }
 }
开发者ID:dautushenka,项目名称:car-market,代码行数:60,代码来源:CarMarket.php

示例15: xfieldsload

     $short_story = $db->safesql($parse->BB_Parse($short_story));
 } else {
     $full_story = $db->safesql($parse->BB_Parse($full_story, false));
     $short_story = $db->safesql($parse->BB_Parse($short_story, false));
 }
 if ($row['xfields'] != "") {
     $xfields = xfieldsload();
     $postedxfields = xfieldsdataload($row['xfields']);
     $filecontents = array();
     $newpostedxfields = array();
     if (!empty($postedxfields)) {
         foreach ($xfields as $name => $value) {
             if ($value[3] == "textarea" and $postedxfields[$value[0]] != "") {
                 if ($config['allow_admin_wysiwyg'] == "yes" or $row['allow_br'] != '1') {
                     $postedxfields[$value[0]] = $parsexf->decodeBBCodes($postedxfields[$value[0]], true, "yes");
                     $newpostedxfields[$value[0]] = $parsexf->BB_Parse($parsexf->process($postedxfields[$value[0]]));
                 } else {
                     $postedxfields[$value[0]] = $parsexf->decodeBBCodes($postedxfields[$value[0]], false);
                     $newpostedxfields[$value[0]] = $parsexf->BB_Parse($parsexf->process($postedxfields[$value[0]]), false);
                 }
             } elseif ($postedxfields[$value[0]] != "") {
                 $newpostedxfields[$value[0]] = $parsexf->process(stripslashes($postedxfields[$value[0]]));
             }
         }
         if (count($newpostedxfields)) {
             foreach ($newpostedxfields as $xfielddataname => $xfielddatavalue) {
                 if ($xfielddatavalue == "") {
                     continue;
                 }
                 $xfielddatavalue = str_replace("|", "&#124;", $xfielddatavalue);
                 $filecontents[] = $db->safesql("{$xfielddataname}|{$xfielddatavalue}");
开发者ID:Hadryan,项目名称:L2LWEB,代码行数:31,代码来源:rebuild.php


注:本文中的ParseFilter::process方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。