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


PHP text::makeClean方法代码示例

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


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

示例1: array

$hide = array('outter_template_source', 'outter_template_source_time', 'outter_template_cache', 'outter_template_cache_time', 'mail_type', 'mail_from', 'smtp_username', 'smtp_password', 'smtp_host', 'sendmail_path');
// remove hidden fields.
$getconfig = $config->config;
foreach ($hide as $item) {
    unset($getconfig[$item]);
}
$required = array_keys($getconfig);
$text = new text($_POST, $required);
$text->validate();
// dealing with input?
if (!empty($_POST)) {
    if ($text->is_missing_required) {
        $baddata = true;
    }
    if (!$baddata) {
        $text->makeClean('slash_if_needed');
        $clean = $text->clean;
        $oldconfig = $config->config;
        $diff = array();
        foreach ($clean as $key => $val) {
            if ($oldconfig[$key] != $val) {
                $diff[$key] = $val;
            }
        }
        if (empty($diff)) {
            $ets->page_body .= $l['acp-nochange'];
        } else {
            $q = "";
            foreach ($diff as $key => $val) {
                $db->query("UPDATE " . db_config . " SET value='" . $val . "' WHERE name='" . $key . "' LIMIT 1;");
            }
开发者ID:nickfun,项目名称:newlifeblogger,代码行数:31,代码来源:config.php

示例2: array

 *		B A N   U S E R
 * =======================================
 */
if (!defined('IN_NLB3')) {
    echo 'NLB3 Denies Direct Access';
    exit;
}
$baddata = false;
$problems = array();
$ets->page_body = '';
$ets_outter->main_title = $config->get('site_name') . ": " . $l['title-admincp'];
$ets_outter->page_title = $l['title-banuser'];
$USESKIN = skin_basic;
$text = new text($_POST, array('name', 'reason', 'until'));
$text->validate();
$text->makeClean('trim', 'slash_if_needed');
if (!empty($_POST)) {
    if ($text->is_missing_required) {
        $baddata = true;
    } else {
        $c = $text->clean;
        // get userid
        $user_data = $db->getArray('SELECT user_id, ip FROM ' . db_users . ' WHERE username="' . $c['name'] . '";');
        if ($db->getRowCount() == 0) {
            $baddata = true;
            $problems[] = $l['acp-ban-err-user'];
        } else {
            // time okay?
            $until = strtotime($c['until']);
            if ($until == -1) {
                $baddata = true;
开发者ID:nickfun,项目名称:newlifeblogger,代码行数:31,代码来源:ban_user.php

示例3: text

<?php

/**
 * =======================================
 * 		E D I T   S M I L E
 * =======================================
 */
if (!defined('IN_NLB3')) {
    echo 'NLB3 Denies Direct Access';
    exit;
}
$text = new text($_POST, array('smile_id', 'image', 'code', 'desc'), array("delete"));
$text->validate();
if ($text->is_missing_required) {
    jsRedirect("admincp.php?action=smiles");
    die;
}
$text->makeClean("slash_if_needed");
$c = $text->clean;
// delete or update?
if (empty($c['delete'])) {
    $db->query("UPDATE `" . db_smiles . "`\r\n\tSET `code` = '" . $c['code'] . "', \r\n\t`image` = '" . $c['image'] . "', \r\n\t`desc` = '" . $c['desc'] . "' \r\n\tWHERE `smile_id` = " . $c['smile_id'] . "\r\n\tLIMIT 1;");
} else {
    $db->query("DELETE FROM " . db_smiles . "\r\n\tWHERE `smile_id` = " . $c['smile_id'] . "\r\n\tLIMIT 1;");
}
// done here, back to manager...
jsRedirect("admincp.php?action=smiles");
开发者ID:nickfun,项目名称:newlifeblogger,代码行数:27,代码来源:edit_smile.php


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