示例#1
0
    // conversion of old data if existing
    if(isset($PHORUM["bad_words"]) && count($PHORUM['bad_words'])) {
    print "upgrading badwords<br>";
        foreach($PHORUM['bad_words'] as $key => $data) {
            phorum_db_mod_banlists(PHORUM_BAD_WORDS ,0 ,$data ,0 ,0);
            unset($PHORUM["bad_words"][$key]);
        }
        phorum_db_update_settings(array("bad_words"=>$PHORUM["bad_words"]));
    }

    if(count($_POST) && $_POST["string"]!=""){
        if($_POST["curr"]!="NEW"){
            $ret=phorum_db_mod_banlists(PHORUM_BAD_WORDS ,0 ,$_POST["string"] ,$_POST['forumid'] ,$_POST['curr']);
        } else {
            $ret=phorum_db_mod_banlists(PHORUM_BAD_WORDS ,0 ,$_POST["string"] ,$_POST['forumid'] ,0);
        }

        if(!$ret){
            $error="Database error while updating badwords.";
        } else {
            echo "Bad Word Added<br />";
        }
    }

    if(isset($_GET["curr"])){
        if(isset($_GET["delete"])){
            phorum_db_del_banitem($_GET['curr']);
            echo "Ban Item Deleted<br />";
        } else {
            $curr = $_GET["curr"];
示例#2
0
文件: banlist.php 项目: mgs2/kw-forum
        $ret = phorum_db_mod_banlists($_POST['type'], $_POST['pcre'], $_POST['string'], $_POST['forum_id'], $_POST['comments'], $_POST['curr']);
        if (isset($PHORUM['cache_banlists']) && $PHORUM['cache_banlists']) {
            // we need to increase the version in that case to
            // invalidate them all in the cache.
            // TODO: I think I have to work out a way to make the same
            // work with vroots
            if ($_POST['forum_id'] == 0) {
                $PHORUM['banlist_version'] = $PHORUM['banlist_version'] + 1;
                phorum_db_update_settings(array('banlist_version' => $PHORUM['banlist_version']));
            } else {
                // remove the one for that forum
                phorum_cache_remove('banlist', $_POST['forum_id']);
            }
        }
    } else {
        $ret = phorum_db_mod_banlists($_POST['type'], $_POST['pcre'], $_POST['string'], $_POST['forum_id'], $_POST['comments'], 0);
    }
    if (!$ret) {
        $error = "Database error while updating settings.";
    } else {
        phorum_admin_okmsg("Ban Item Updated");
    }
}
if (isset($_POST["curr"]) && isset($_POST["delete"]) && $_POST["confirm"] == "Yes") {
    phorum_db_del_banitem((int) $_POST['curr']);
    phorum_admin_okmsg("Ban Item Deleted");
}
if (isset($_GET["curr"])) {
    $curr = (int) $_GET["curr"];
}
if ($curr != "NEW") {