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


PHP ewiki_db::APPEND方法代码示例

本文整理汇总了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;
    }
}
开发者ID:gpuenteallott,项目名称:rox,代码行数:41,代码来源:spam_block.php

示例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)) {
开发者ID:gpuenteallott,项目名称:rox,代码行数:31,代码来源:S35mail2wiki.php


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