示例#1
0
文件: db-sql.php 项目: alx/blogsfera
function fs_botlist_import_array($lines, $remove_existing)
{
    if ($remove_existing) {
        $res = fs_clear_bots_list();
        if ($res != '') {
            return $res;
        }
    }
    foreach ($lines as $line) {
        $l = trim($line);
        if (strlen($l) > 0 && $l[0] != '#') {
            $ok = fs_add_bot($line, false);
            if ($ok != '') {
                return $ok;
            }
        }
    }
    return '';
}
示例#2
0
function fs_ajax_addBot(&$response)
{
    $wildcard = $_POST['wildcard'];
    if ($wildcard != '') {
        $res = fs_add_bot($wildcard);
        if ($res == '') {
            $response['message'] = sprintf(fs_r('Added %s to bots list'), $wildcard);
            $response['fields']['botlist_placeholder'] = addslashes(fs_get_bot_list());
            $response['fields']['num_excluded'] = fs_get_num_excluded();
        } else {
            ajax_error($response, $res);
        }
    } else {
        ajax_error($response, fs_r('Empty string is not allowed'));
    }
}