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


PHP flood_protect函数代码示例

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


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

示例1: get_headboards

     }
 }
 $topforums = get_headboards($fc, $last, TRUE);
 $breadcrumb->Add($last['name'], "showforum.php?id=" . $last['id'] . SID2URL_x);
 $breadcrumb->Add($prefix . $info['topic'], "showtopic.php?id={$last['id']}" . SID2URL_x);
 if ($info['tstart'] == '0') {
     $breadcrumb->Add($info['title'], "showtopic.php?action=jumpto&id={$last['id']}&topic_id={$info['id']}" . SID2URL_x);
 }
 $breadcrumb->Add($lang->phrase('report_post'));
 forum_opt($last);
 if (empty($info['report']) == false) {
     error($lang->phrase('report_post_locked'), "showtopic.php?action=jumpto&id={$last['id']}&topic_id={$info['id']}" . SID2URL_x);
 }
 if ($_GET['action'] == "report_post2") {
     $error = array();
     if (flood_protect() == false) {
         $error[] = $lang->phrase('flood_control');
     }
     if (strxlen($_POST['comment']) < $config['minpostlength']) {
         $error[] = $lang->phrase('comment_too_short');
     }
     if (count($error) > 0) {
         error($error, "misc.php?action=report_post&id={$info['id']}" . SID2URL_x);
     } else {
         set_flood();
         $message = $_POST['comment'];
         // Update the report
         $db->query("UPDATE {$db->pre}replies SET report = '{$message}' WHERE id = '{$info['id']}' LIMIT 1", __LINE__, __FILE__);
         // Get administrators and global moderators
         $groups = $scache->load('groups');
         $team = $groups->team();
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:misc.php

示例2: eval

     }
     if (strxlen($_POST['name']) < $config['minnamelength']) {
         $error[] = $lang->phrase('name_too_short');
     }
     if (strxlen($_POST['email']) > 200) {
         $error[] = $lang->phrase('email_too_long');
     }
     $pname = $_POST['name'];
     $pnameid = $_POST['name'];
     $pid = 0;
 } else {
     $pname = $my->name;
     $pnameid = $my->id;
     $pid = $my->id;
 }
 if (flood_protect() == FALSE) {
     $error[] = $lang->phrase('flood_control');
 }
 if (strxlen($_POST['comment']) > $config['maxpostlength']) {
     $error[] = $lang->phrase('comment_too_long');
 }
 if (strxlen($_POST['comment']) < $config['minpostlength']) {
     $error[] = $lang->phrase('comment_too_short');
 }
 if (strxlen($_POST['topic']) > $config['maxtitlelength']) {
     $error[] = $lang->phrase('title_too_long');
 }
 if (strxlen($_POST['topic']) < $config['mintitlelength']) {
     $error[] = $lang->phrase('title_too_short');
 }
 ($code = $plugins->load('addreply_save_errorhandling')) ? eval($code) : null;
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:addreply.php

示例3: strxlen

     }
     if (strxlen($_POST['name']) < $config['minnamelength']) {
         $error[] = $lang->phrase('name_too_short');
     }
     if (strlen($_POST['email']) > 200) {
         $error[] = $lang->phrase('email_too_long');
     }
     $pname = $_POST['name'];
     $pnameid = $_POST['name'];
     $pid = 0;
 } else {
     $pname = $my->name;
     $pnameid = $my->id;
     $pid = $my->id;
 }
 if (flood_protect(FLOOD_TYPE_POSTING) == false) {
     $error[] = $lang->phrase('flood_control');
 }
 if (strxlen($_POST['comment']) > $config['maxpostlength']) {
     $error[] = $lang->phrase('comment_too_long');
 }
 if (strxlen($_POST['comment']) < $config['minpostlength']) {
     $error[] = $lang->phrase('comment_too_short');
 }
 // Add some chars for reply title prefix
 $maxlength = $config['maxtitlelength'] + strxlen($lang->phrase('reply_prefix'));
 if (strxlen($_POST['topic']) > $maxlength) {
     $error[] = $lang->phrase('title_too_long');
 }
 if (strxlen($_POST['topic']) < $config['mintitlelength']) {
     $error[] = $lang->phrase('title_too_short');
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:addreply.php

示例4: error_reporting

*/
error_reporting(E_ALL);
define('SCRIPTNAME', 'search');
define('VISCACHA_CORE', '1');
include "data/config.inc.php";
include "classes/function.viscacha_frontend.php";
$my->p = $slog->Permissions();
$my->pb = $slog->GlobalPermissions();
if ($my->p['search'] == 0) {
    error($lang->phrase('query_string_error'));
}
$breadcrumb->Add($lang->phrase('search'));
($code = $plugins->load('search_start')) ? eval($code) : null;
if ($_GET['action'] == "search") {
    if ($config['floodsearch'] == 1) {
        if (flood_protect(FLOOD_TYPE_SEARCH) == false) {
            error($lang->phrase('flood_control'));
        }
        set_flood(FLOOD_TYPE_SEARCH);
    }
    $boards = array();
    if (isset($_POST['boards']) && is_array($_POST['boards'])) {
        $_POST['boards'] = array_map('trim', $_POST['boards']);
        foreach ($_POST['boards'] as $b) {
            if (is_id($b) == true) {
                $boards[] = $b;
            }
        }
    }
    $search = preg_replace("/(\\s){1,}/is", " ", $_POST['search']);
    $search = preg_replace("/\\*{1,}/is", '*', $search);
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:search.php

示例5: error

    if ($db->num_rows($result) != 1) {
        error($lang->phrase('log_pwremind_failed'), "log.php?action=pwremind" . SID2URL_x);
    } else {
        $confirmcode = md5($config['cryptkey'] . $user['pw']);
        ($code = $plugins->load('log_pwremind2_prepare')) ? eval($code) : null;
        $user = $gpc->plain_str($user);
        $data = $lang->get_mail('pwremind');
        $to = array('0' => array('name' => $user['name'], 'mail' => $user['mail']));
        $from = array();
        xmail($to, $from, $data['title'], $data['comment']);
        ($code = $plugins->load('log_pwremind2_end')) ? eval($code) : null;
        ok($lang->phrase('log_pwremind_success'), "log.php?action=login" . SID2URL_x);
    }
    $slog->updatelogged();
} elseif ($_GET['action'] == "pwremind3") {
    if (flood_protect(FLOOD_TYPE_PWRENEW) == false) {
        error($lang->phrase('flood_control'), 'log.php?action=login' . SID2URL_x);
    }
    set_flood(FLOOD_TYPE_PWRENEW);
    ($code = $plugins->load('log_pwremind3_start')) ? eval($code) : null;
    $result = $db->query("SELECT id, pw, mail, name FROM {$db->pre}user WHERE id = '{$_GET['id']}' LIMIT 1", __LINE__, __FILE__);
    $user = $db->fetch_assoc($result);
    $confirmcode = md5($config['cryptkey'] . $user['pw']);
    if ($confirmcode == $_GET['fid']) {
        $pw = random_word();
        $md5 = md5($pw);
        $db->query("UPDATE {$db->pre}user SET pw = '{$md5}' WHERE id = '{$user['id']}' LIMIT 1", __LINE__, __FILE__);
        $user = $gpc->plain_str($user);
        $data = $lang->get_mail('pwremind2');
        $to = array('0' => array('name' => $user['name'], 'mail' => $user['mail']));
        $from = array();
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:log.php


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