本文整理汇总了PHP中set_flood函数的典型用法代码示例。如果您正苦于以下问题:PHP set_flood函数的具体用法?PHP set_flood怎么用?PHP set_flood使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_flood函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: forum_opt
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();
$cache = array();
$t = array_merge($team['admin'], $team['gmod']);
foreach ($t as $row) {
$cache[] = "FIND_IN_SET({$row},groups)";
}
$cache = implode(' OR ', $cache);
$result = $db->query("SELECT id, name, mail, language FROM {$db->pre}user WHERE {$cache}", __LINE__, __FILE__);
$cache = array();
while ($row = $db->fetch_assoc($result)) {
示例2: eval
}
$data['guest'] = 1;
$data['name'] = $_POST['name'];
}
($code = $plugins->load('addreply_save_errordata')) ? eval($code) : null;
$fid = save_error_data($data, $fid);
if (!empty($_POST['Preview'])) {
$slog->updatelogged();
$db->close();
sendStatusCode(307, $config['furl'] . "/addreply.php?action=preview&id={$id}&fid=" . $fid . SID2URL_JS_x);
exit;
} else {
error($error, "addreply.php?id={$id}&fid=" . $fid . SID2URL_x);
}
} else {
set_flood(FLOOD_TYPE_POSTING);
if ($my->vlogin) {
$guest = 0;
} else {
$guest = 1;
}
$date = time();
($code = $plugins->load('addreply_save_queries')) ? eval($code) : null;
$db->query("\n\t\tUPDATE {$db->pre}topics\n\t\tSET last_name = '{$pnameid}', last = '{$date}', posts = posts+1\n\t\tWHERE id = '{$id}'\n\t\t");
$db->query("\n\t\tINSERT INTO {$db->pre}replies (board,topic,topic_id,name,comment,dosmileys,dowords,email,date,ip,guest,edit,report)\n\t\tVALUES ('{$info['board']}','{$_POST['topic']}','{$id}','{$pnameid}','{$_POST['comment']}','{$_POST['dosmileys']}','{$_POST['dowords']}','{$_POST['email']}','{$date}','{$my->ip}','{$guest}','','')\n\t\t");
$redirect = $db->insert_id();
// Set uploads to correct reply
$db->query("UPDATE {$db->pre}uploads SET tid = '{$redirect}' WHERE mid = '{$pid}' AND topic_id = '{$id}' AND tid = '0'");
// Update, insert notifications
if ($my->vlogin && in_array($digest, $validDigest)) {
switch ($digest) {
示例3: define
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);
$ignorewords = $lang->get_words();
$word_seperator = "\\.\\,;:\\+!\\?\\_\\|\\s\"'\\#\\[\\]\\%\\{\\}\\(\\)\\/\\\\";
$searchwords = preg_split('/[' . $word_seperator . ']+?/', $search, -1, PREG_SPLIT_NO_EMPTY);
示例4: md5
$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();
xmail($to, $from, $data['title'], $data['comment']);
($code = $plugins->load('log_pwremind3_success')) ? eval($code) : null;
ok($lang->phrase('log_pwremind_changed'), "log.php?action=login" . SID2URL_x);