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


PHP discuz_censor类代码示例

本文整理汇总了PHP中discuz_censor的典型用法代码示例。如果您正苦于以下问题:PHP discuz_censor类的具体用法?PHP discuz_censor怎么用?PHP discuz_censor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getstr

function getstr($string, $length, $in_slashes = 0, $out_slashes = 0, $censor = 0, $bbcode = 0, $html = 0)
{
    global $_G;
    $string = trim($string);
    if ($in_slashes) {
        $string = dstripslashes($string);
    }
    if ($html < 0) {
        $string = preg_replace("/(\\<[^\\<]*\\>|\r|\n|\\s|\\[.+?\\])/is", ' ', $string);
    } elseif ($html == 0) {
        $string = dhtmlspecialchars($string);
    }
    if ($censor) {
        if (!class_exists('discuz_censor')) {
            include libfile('class/censor');
        }
        $censor = discuz_censor::instance();
        $censor->check($string);
        if ($censor->modbanned() || $censor->modmoderated()) {
            showmessage('word_banned');
        }
    }
    if ($length) {
        $string = cutstr($string, $length);
    }
    if ($bbcode) {
        require_once DISCUZ_ROOT . './source/class/class_bbcode.php';
        $bb =& bbcode::instance();
        $string = $bb->bbcode2html($string, $bbcode);
    }
    if ($out_slashes) {
        $string = daddslashes($string);
    }
    return trim($string);
}
开发者ID:Kingson4Wu,项目名称:php_demo,代码行数:35,代码来源:function_home.php

示例2: censormod

function censormod($message)
{
    require_once libfile('class/censor');
    $censor = discuz_censor::instance();
    $censor->check($message);
    return $censor->modmoderated();
}
开发者ID:pan289091315,项目名称:Discuz,代码行数:7,代码来源:function_discuzcode.php

示例3: censormod

function censormod($message)
{
    if (!class_exists('discuz_censor')) {
        include libfile('class/censor');
    }
    $censor = discuz_censor::instance();
    $censor->check($message);
    if ($censor->modmoderated()) {
        return TRUE;
    }
    return FALSE;
}
开发者ID:Kingson4Wu,项目名称:php_demo,代码行数:12,代码来源:function_discuzcode.php

示例4: array

}
$allowcstatus = !empty($_G['group']['allowcstatus']) ? true : false;
$verify = DB::fetch_first("SELECT * FROM " . DB::table("common_member_verify") . " WHERE uid='{$_G['uid']}'");
$validate = array();
if ($_G['setting']['regverify'] == 2 && $_G['groupid'] == 8) {
    $validate = DB::fetch_first("SELECT * FROM " . DB::table('common_member_validate') . " WHERE uid='{$_G['uid']}' AND status='1'");
}
$conisregister = $operation == 'password' && $_G['setting']['connect']['allow'] && DB::result_first("SELECT conisregister FROM " . DB::table('common_member_connect') . " WHERE uid='{$_G['uid']}'");
if (submitcheck('profilesubmit')) {
    require_once libfile('function/discuzcode');
    $forum = $setarr = $verifyarr = $errorarr = array();
    $forumfield = array('customstatus', 'sightml');
    if (!class_exists('discuz_censor')) {
        include libfile('class/censor');
    }
    $censor = discuz_censor::instance();
    if ($_G['gp_vid']) {
        $vid = intval($_G['gp_vid']);
        $verifyconfig = $_G['setting']['verify'][$vid];
        if ($verifyconfig['available']) {
            $verifyinfo = DB::fetch_first("SELECT * FROM " . DB::table("common_member_verify_info") . " WHERE uid='{$_G['uid']}' AND verifytype='{$vid}'");
            if (!empty($verifyinfo)) {
                $verifyinfo['field'] = unserialize($verifyinfo['field']);
            }
            foreach ($verifyconfig['field'] as $key => $field) {
                if (!isset($verifyinfo['field'][$key])) {
                    $verifyinfo['field'][$key] = $key;
                }
            }
        } else {
            $vid = 0;
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:spacecp_profile.php

示例5: censormod

 public static function censormod($message)
 {
     global $_G;
     if ($_G['group']['ignorecensor']) {
         return false;
     }
     $modposturl = false;
     if ($_G['group']['allowposturl'] == 1) {
         $urllist = self::get_url_list($message);
         if (is_array($urllist[1])) {
             foreach ($urllist[1] as $key => $val) {
                 if (!($val = trim($val))) {
                     continue;
                 }
                 if (!iswhitelist($val)) {
                     $modposturl = true;
                 }
             }
         }
     }
     if ($modposturl) {
         return true;
     }
     $censor = discuz_censor::instance();
     $censor->check($message);
     return $censor->modmoderated();
 }
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:27,代码来源:helper_form.php

示例6: _applyActivityTopic

 private function _applyActivityTopic($res, $tid, $uid, $data)
 {
     // from forum_misc.php
     require_once libfile('function/post');
     $activity = DzForumActivity::getActivityByTid($tid);
     if ($activity['expiration'] && $activity['expiration'] < TIMESTAMP) {
         return $this->_makeErrorInfo($res, 'activity_stop');
     }
     $applyinfo = DzForumActivityApply::getApplyByTidUid($tid, $uid);
     if ($applyinfo && $applyinfo['verified'] < DzForumActivityApply::STATUS_VERIFIED_IMPROVE) {
         return $this->_makeErrorInfo($res, 'activity_repeat_apply');
     }
     global $_G;
     $_GET = $data;
     $thread = ForumUtils::getTopicInfo($tid);
     $payvalue = intval($_GET['payvalue']);
     $payment = $_GET['payment'] ? $payvalue : -1;
     $message = cutstr(dhtmlspecialchars($_GET['message']), 200);
     $verified = $thread['authorid'] == $uid ? 1 : 0;
     $ufielddata = '';
     if ($activity['ufield']) {
         $ufielddata = array();
         $version = MobcentDiscuz::getMobcentDiscuzVersion();
         $activity['ufield'] = $version != MobcentDiscuz::VERSION_X20 ? dunserialize($activity['ufield']) : unserialize($activity['ufield']);
         if (!empty($activity['ufield']['userfield'])) {
             if ($version == MobcentDiscuz::VERSION_X20) {
                 if (!class_exists('discuz_censor')) {
                     include libfile('class/censor');
                 }
             }
             $censor = discuz_censor::instance();
             loadcache('profilesetting');
             foreach ($data as $key => $value) {
                 if (empty($_G['cache']['profilesetting'][$key])) {
                     continue;
                 }
                 if (is_array($value)) {
                     $value = implode(',', $value);
                 }
                 $value = cutstr(dhtmlspecialchars(trim($value)), 100, '.');
                 // if ($_G['cache']['profilesetting'][$key]['formtype'] == 'file' && !preg_match("/^https?:\/\/(.*)?\.(jpg|png|gif|jpeg|bmp)$/i", $value)) {
                 //     showmessage('activity_imgurl_error');
                 // }
                 if (empty($value) && $key != 'residedist' && $key != 'residecommunity') {
                     return $this->_makeErrorInfo($res, 'activity_exile_field');
                 }
                 $ufielddata['userfield'][$key] = $value;
             }
         }
         if (!empty($activity['ufield']['extfield'])) {
             foreach ($activity['ufield']['extfield'] as $fieldid) {
                 $value = cutstr(dhtmlspecialchars(trim($_GET['' . $fieldid])), 50, '.');
                 $ufielddata['extfield'][$fieldid] = $value;
             }
         }
         $ufielddata = !empty($ufielddata) ? serialize($ufielddata) : '';
     }
     if ($_G['setting']['activitycredit'] && $activity['credit'] && empty($applyinfo['verified'])) {
         checklowerlimit(array('extcredits' . $_G['setting']['activitycredit'] => '-' . $activity['credit']));
         updatemembercount($uid, array($_G['setting']['activitycredit'] => '-' . $activity['credit']), true, 'ACC', $tid);
     }
     $data = array('tid' => $tid, 'username' => $_G['username'], 'uid' => $uid, 'message' => $message, 'verified' => $verified, 'dateline' => $_G['timestamp'], 'payment' => $payment, 'ufielddata' => $ufielddata);
     if ($applyinfo && $applyinfo['verified'] == DzForumActivityApply::STATUS_VERIFIED_IMPROVE) {
         DzForumActivityApply::updateApplyById($data, $applyinfo['applyid']);
     } else {
         DzForumActivityApply::insertApply($data);
     }
     DzForumActivity::updateApplyNumberByTid($tid);
     if ($thread['authorid'] != $uid) {
         notification_add($thread['authorid'], 'activity', 'activity_notice', array('tid' => $tid, 'subject' => $thread['subject']));
         $space = array();
         space_merge($space, 'field_home');
         if (!empty($space['privacy']['feed']['newreply'])) {
             $feed['icon'] = 'activity';
             $feed['title_template'] = 'feed_reply_activity_title';
             $feed['title_data'] = array('subject' => "<a href=\"forum.php?mod=viewthread&tid={$tid}\">{$thread['subject']}</a>", 'hash_data' => "tid{$tid}");
             $feed['id'] = $tid;
             $feed['idtype'] = 'tid';
             postfeed($feed);
         }
     }
     $res = $this->_makeErrorInfo($res, 'activity_completion');
     $res['rs'] = 1;
     return $res;
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:85,代码来源:TopicActivityAction.php

示例7: censor

function censor($message, $modword = NULL)
{
    if (!class_exists('discuz_censor')) {
        include libfile('class/censor');
    }
    $censor = discuz_censor::instance();
    $censor->check($message, $modword);
    if ($censor->modbanned()) {
        showmessage('word_banned');
    }
    return $message;
}
开发者ID:Kingson4Wu,项目名称:php_demo,代码行数:12,代码来源:function_core.php

示例8: censor

function censor($message, $modword = NULL)
{
    require_once libfile('class/censor');
    $censor = discuz_censor::instance();
    $censor->check($message, $modword);
    if ($censor->modbanned()) {
        $wordbanned = implode(', ', $censor->words_found);
        showmessage('word_banned', '', array('wordbanned' => $wordbanned));
    }
    return $message;
}
开发者ID:pan289091315,项目名称:Discuz,代码行数:11,代码来源:function_core.php

示例9: _adminUserInfo

 private function _adminUserInfo($act)
 {
     global $_G;
     $defaultop = '';
     $profilegroup = C::t('common_setting')->fetch('profilegroup', true);
     foreach ($profilegroup as $key => $value) {
         if ($value['available']) {
             $defaultop = $key;
             break;
         }
     }
     $errorMsg = '';
     $operation = $act;
     require_once libfile('function/editor');
     include_once libfile('function/profile');
     $space = getuserbyuid($_G['uid']);
     space_merge($space, 'profile');
     space_merge($space, 'field_home');
     space_merge($space, 'field_forum');
     $space['sightml'] = html2bbcode($space['sightml']);
     $vid = $_GET['vid'] ? intval($_GET['vid']) : 0;
     $privacy = $space['privacy']['profile'] ? $space['privacy']['profile'] : array();
     $_G['setting']['privacy'] = $_G['setting']['privacy'] ? $_G['setting']['privacy'] : array();
     $_G['setting']['privacy'] = is_array($_G['setting']['privacy']) ? $_G['setting']['privacy'] : dunserialize($_G['setting']['privacy']);
     $_G['setting']['privacy']['profile'] = !empty($_G['setting']['privacy']['profile']) ? $_G['setting']['privacy']['profile'] : array();
     $privacy = array_merge($_G['setting']['privacy']['profile'], $privacy);
     $actives = array('profile' => ' class="a"');
     $opactives = array($operation => ' class="a"');
     $allowitems = array();
     $allowitems = $profilegroup[$operation]['field'];
     $showbtn = $vid && $verify['verify' . $vid] != 1 || empty($vid);
     if (!empty($verify) && is_array($verify)) {
         foreach ($verify as $key => $flag) {
             if (in_array($key, array('verify1', 'verify2', 'verify3', 'verify4', 'verify5', 'verify6', 'verify7')) && $flag == 1) {
                 $verifyid = intval(substr($key, -1, 1));
                 if ($_G['setting']['verify'][$verifyid]['available']) {
                     foreach ($_G['setting']['verify'][$verifyid]['field'] as $field) {
                         $_G['cache']['profilesetting'][$field]['unchangeable'] = 1;
                     }
                 }
             }
         }
     }
     if ($vid) {
         if ($value = C::t('common_member_verify_info')->fetch_by_uid_verifytype($_G['uid'], $vid)) {
             $field = dunserialize($value['field']);
             foreach ($field as $key => $fvalue) {
                 $space[$key] = $fvalue;
             }
         }
     }
     $htmls = $settings = array();
     foreach ($allowitems as $fieldid) {
         if (!in_array($fieldid, array('sightml', 'customstatus', 'timeoffset'))) {
             $html = profile_setting($fieldid, $space, $vid ? false : true);
             if ($html) {
                 $settings[$fieldid] = $_G['cache']['profilesetting'][$fieldid];
                 $htmls[$fieldid] = $html;
             }
         }
     }
     if (!empty($_POST)) {
         require_once libfile('function/discuzcode');
         $forum = $setarr = $verifyarr = $errorarr = array();
         $forumfield = array('customstatus', 'sightml');
         $censor = discuz_censor::instance();
         if ($_GET['vid']) {
             $vid = intval($_GET['vid']);
             $verifyconfig = $_G['setting']['verify'][$vid];
             if ($verifyconfig['available'] && (empty($verifyconfig['groupid']) || in_array($_G['groupid'], $verifyconfig['groupid']))) {
                 $verifyinfo = C::t('common_member_verify_info')->fetch_by_uid_verifytype($_G['uid'], $vid);
                 if (!empty($verifyinfo)) {
                     $verifyinfo['field'] = dunserialize($verifyinfo['field']);
                 }
                 foreach ($verifyconfig['field'] as $key => $field) {
                     if (!isset($verifyinfo['field'][$key])) {
                         $verifyinfo['field'][$key] = $key;
                     }
                 }
             } else {
                 $_GET['vid'] = $vid = 0;
                 $verifyconfig = array();
             }
         }
         if (isset($_POST['birthprovince'])) {
             $initcity = array('birthprovince', 'birthcity', 'birthdist', 'birthcommunity');
             foreach ($initcity as $key) {
                 $_GET['' . $key] = $_POST[$key] = !empty($_POST[$key]) ? $_POST[$key] : '';
             }
         }
         if (isset($_POST['resideprovince'])) {
             $initcity = array('resideprovince', 'residecity', 'residedist', 'residecommunity');
             foreach ($initcity as $key) {
                 $_GET['' . $key] = $_POST[$key] = !empty($_POST[$key]) ? $_POST[$key] : '';
             }
         }
         foreach ($_POST as $key => $value) {
             $field = $_G['cache']['profilesetting'][$key];
             if (in_array($field['formtype'], array('text', 'textarea')) || in_array($key, $forumfield)) {
                 $censor->check($value);
//.........这里部分代码省略.........
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:101,代码来源:UserInfoAdminViewAction.php

示例10: censormod

function censormod($message)
{
    global $_G;
    if ($_G['group']['ignorecensor']) {
        return false;
    }
    require_once libfile('class/censor');
    $censor = discuz_censor::instance();
    $censor->check($message);
    return $censor->modmoderated();
}
开发者ID:v998,项目名称:discuzx-en,代码行数:11,代码来源:function_core.php


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