本文整理汇总了PHP中ewiki_db::APPEND方法的典型用法代码示例。如果您正苦于以下问题:PHP ewiki_db::APPEND方法的具体用法?PHP ewiki_db::APPEND怎么用?PHP ewiki_db::APPEND使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ewiki_db
的用法示例。
在下文中一共展示了ewiki_db::APPEND方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ewiki_edit_save_antispam_urlblock
function ewiki_edit_save_antispam_urlblock(&$save, &$old_data)
{
global $ewiki_errmsg, $ewiki_id;
$BLOCK = EWIKI_PAGE_BLOCKED;
preg_match_all('°(http://[^\\s*<>"\'\\[\\]\\#]+)°', $save["content"], $save_urls);
preg_match_all('°(http://[^\\s*<>"\'\\[\\]\\#]+)°', $old_data["content"], $old_urls);
$added_urls = array_diff($save_urls[1], $old_urls[1]);
if ($added_urls) {
foreach ($added_urls as $i => $url) {
#-- test against BannedLinks, then deface (filter page) URL
if (ewiki_blocked_link($url, $BLOCK)) {
$block = true;
unset($added_urls[$i]);
}
}
$old = $i + 1;
}
#-- if matched
if ($block) {
#-- add new URLs to our BannedLinks page
if ($new = count($added_urls)) {
$content = "";
foreach ($added_urls as $d) {
$d = preg_replace('#^.+//(?:www\\.)?#', '', $d);
$d = preg_replace('#^([^/]+)(/.*)?$*', '$1', $d);
if ($d) {
$content .= "\n* [{$d}] (auto-added by spam attack on [{$ewiki_id}])";
}
}
if ($content) {
ewiki_db::APPEND($BLOCK, $content);
}
$date = strftime("%c", time());
ewiki_append_to_page("SpamLog", "\n* spam attack on [{$ewiki_id}] from {$_SERVER['REMOTE_ADDRESS']}:{$_SERVER['REMOTE_PORT']} ({$_SERVER['HTTP_USER_AGENT']}) happend at {$date}, around {$new} of the {$old} added URLs were already on BlockedLinks");
}
#-- error reporting method for ["edit_save"]
$save = array();
$ewiki_errmsg = ewiki_t("BLOCKED_URL");
return false;
}
}
示例2: elseif
if (MAIL2WIKI_SPAM) {
ewiki_db::APPEND(MAIL2WIKI_SPAM, "\n----\n{$mbox}\n");
}
} elseif (!ewiki_db::GET($id)) {
ewiki_db::APPEND($id, $page);
} else {
if (preg_match("/^From: [^\n]+/m", $mbox, $uu)) {
$from = from_mail_or_link($uu[1]);
$from = "[{$from}]: ";
} else {
$from = "----\n\n";
}
#-- do
echo "[{$cron}]: storing mail from '{$from}' onto page '{$id}'\n";
$page = trim($page);
ewiki_db::APPEND($id, "\n\n{$from}{$page}\n");
}
}
}
unset($mbox);
unset($incoming);
#-- return a WikiPageUserName or [name|email@...] string back
function from_mail_or_link($from)
{
$from = strtr($from, "<>\"\\'", " ");
$l = strpos($from, "@");
if ($l = strrpos($from, " ", $l)) {
$name = substr($from, 0, $l);
$mail = substr($from, $l + 1);
$wiki = str_replace(" ", "", $name);
if (ewiki_db::GET($wiki)) {