本文整理汇总了PHP中Filter::Save方法的典型用法代码示例。如果您正苦于以下问题:PHP Filter::Save方法的具体用法?PHP Filter::Save怎么用?PHP Filter::Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Filter
的用法示例。
在下文中一共展示了Filter::Save方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Create
static function Create($_ip, $_userId, $_reason, $_expireDays = 2, $_cookie = false, $_chats = false)
{
$filter = new Filter(md5(uniqid(rand())));
$filter->Creator = "SYSTEM";
$filter->Created = time();
$filter->Editor = "SYSTEM";
$filter->Edited = time();
$filter->IP = $_ip;
$filter->Expiredate = $_expireDays * 86400;
$filter->Userid = $_userId;
$filter->Reason = "";
$filter->Filtername = $_reason;
$filter->Activestate = 1;
$filter->Exertion = 0;
$filter->Languages = "";
$filter->Countries = "";
$filter->AllowChats = $_chats;
$filter->Save();
if ($_cookie) {
Cookie::Set(OO_TRACKING_FILTER_NAME, "1");
}
}
示例2: appendFilters
function appendFilters()
{
$creators = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_va"]);
$createds = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_vb"]);
$editors = explode(POST_ACTION_VALUE_SPLITTER, slashesStrip($_POST[POST_INTERN_PROCESS_FILTERS . "_vc"]));
$ips = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_vd"]);
$expiredates = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_ve"]);
$userids = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_vf"]);
$filternames = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_vg"]);
$reasons = explode(POST_ACTION_VALUE_SPLITTER, slashesStrip($_POST[POST_INTERN_PROCESS_FILTERS . "_vh"]));
$filterids = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_vi"]);
$activestates = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_vj"]);
$actiontypes = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_vk"]);
$exertions = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_vl"]);
$languages = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_vm"]);
$activeuserids = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_vn"]);
$activeipaddresses = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_vo"]);
$activelanguages = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_vp"]);
foreach ($filterids as $key => $id) {
$filter = new Filter($filterids[$key]);
$filter->Creator = $creators[$key];
$filter->Created = $createds[$key] != "0" ? $createds[$key] : time();
$filter->Editor = $editors[$key];
$filter->Edited = time();
$filter->IP = $ips[$key];
$filter->Expiredate = $expiredates[$key];
$filter->Userid = $userids[$key];
$filter->Reason = $reasons[$key];
$filter->Filtername = $filternames[$key];
$filter->Activestate = $activestates[$key];
$filter->Exertion = $exertions[$key];
$filter->Languages = $languages[$key];
$filter->Activeipaddress = $activeipaddresses[$key];
$filter->Activeuserid = $activeuserids[$key];
$filter->Activelanguage = $activelanguages[$key];
if ($actiontypes[$key] == POST_ACTION_ADD || $actiontypes[$key] == POST_ACTION_EDIT) {
$filter->Save();
} else {
if ($actiontypes[$key] == POST_ACTION_REMOVE) {
$filter->Destroy();
}
}
}
}
示例3: processFilters
function processFilters()
{
if (isset($_POST[POST_INTERN_PROCESS_FILTERS . "_va"])) {
$creators = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_va"]);
$createds = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_vb"]);
$editors = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_vc"]);
$ips = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_vd"]);
$expiredates = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_ve"]);
$userids = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_vf"]);
$filternames = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_vg"]);
$reasons = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_vh"]);
$filterids = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_vi"]);
$activestates = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_vj"]);
$actiontypes = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_vk"]);
$exertions = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_vl"]);
$languages = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_vm"]);
$countries = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_vp"]);
$allowchats = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_vq"]);
$allowtickets = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_vr"]);
$allowtracking = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_FILTERS . "_vs"]);
foreach ($filterids as $key => $id) {
$filter = new Filter($filterids[$key]);
$filter->Creator = $creators[$key];
$filter->Created = $createds[$key] != "0" ? $createds[$key] : time();
$filter->Editor = $editors[$key];
$filter->Edited = time();
$filter->IP = $ips[$key];
$filter->Expiredate = $expiredates[$key];
$filter->Userid = $userids[$key];
$filter->Reason = $reasons[$key];
$filter->Filtername = $filternames[$key];
$filter->Activestate = $activestates[$key];
$filter->Exertion = $exertions[$key];
$filter->Languages = $languages[$key];
$filter->Countries = $countries[$key];
$filter->AllowChats = !empty($allowchats[$key]);
$filter->AllowTickets = !empty($allowtickets[$key]);
$filter->AllowTracking = !empty($allowtracking[$key]);
if ($actiontypes[$key] == POST_ACTION_ADD || $actiontypes[$key] == POST_ACTION_EDIT) {
$filter->Save();
} else {
if ($actiontypes[$key] == POST_ACTION_REMOVE) {
$filter->Destroy();
} else {
Logging::GeneralLog("unknown command f1");
}
}
}
CacheManager::FlushKey(DATA_CACHE_KEY_FILTERS);
}
}
示例4: createFloodFilter
function createFloodFilter($_ip, $_userId)
{
global $FILTERS;
initData(false, false, false, true);
foreach ($FILTERS->Filters as $currentFilter) {
if ($currentFilter->IP == $_ip && $currentFilter->Activeipaddress == 1 && $currentFilter->Activestate == 1) {
return;
}
}
$filter = new Filter(md5(uniqid(rand())));
$filter->Creator = "SYSTEM";
$filter->Created = time();
$filter->Editor = "SYSTEM";
$filter->Edited = time();
$filter->IP = $_ip;
$filter->Expiredate = 172800;
$filter->Userid = $_userId;
$filter->Reason = "";
$filter->Filtername = "AUTO FLOOD FILTER";
$filter->Activestate = 1;
$filter->Exertion = 0;
$filter->Languages = "";
$filter->Activeipaddress = 1;
$filter->Activeuserid = 0;
$filter->Activelanguage = 0;
$filter->Save();
}
示例5: createFilter
function createFilter($_ip, $_userId, $_reason)
{
$filter = new Filter(md5(uniqid(rand())));
$filter->Creator = "SYSTEM";
$filter->Created = time();
$filter->Editor = "SYSTEM";
$filter->Edited = time();
$filter->IP = $_ip;
$filter->Expiredate = 172800;
$filter->Userid = $_userId;
$filter->Reason = "";
$filter->Filtername = $_reason;
$filter->Activestate = 1;
$filter->Exertion = 0;
$filter->Languages = "";
$filter->Activeipaddress = 1;
$filter->Activeuserid = !empty($_userId) ? 1 : 0;
$filter->Activelanguage = 0;
$filter->Save();
}