當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。