コード例 #1
0
ファイル: db-sql.php プロジェクト: alx/blogsfera
function fs_clear_bots_list()
{
    $res = fs_get_bots();
    if ($res) {
        foreach ($res as $r) {
            $id = $r['id'];
            $res1 = fs_remove_bot($id);
            if ($res1 != '') {
                return $res1;
            }
        }
    }
    return '';
}
コード例 #2
0
ファイル: html-utils.php プロジェクト: alx/blogsfera
function fs_get_bot_list()
{
    $list = fs_get_bots();
    if ($list === false) {
        return fs_db_error();
    }
    $c = count($list);
    $res = "<select class='full_width' size='10' id=\"botlist\" " . ($c == 0 ? "disabled='disabled'" : "") . " >";
    if ($c == 0) {
        $res .= '<option>' . fs_r('Empty') . '</option>';
    } else {
        foreach ($list as $row) {
            $res .= "<option value='" . $row['id'] . "'>" . $row['wildcard'] . "</option>";
        }
    }
    $res .= "</select>";
    return $res;
}
コード例 #3
0
ファイル: export-bots-list.php プロジェクト: alx/blogsfera
<?php

require_once dirname(__FILE__) . '/init.php';
require_once dirname(__FILE__) . '/db-sql.php';
$res = fs_get_bots();
if ($res !== false) {
    header('Content-disposition: attachment; filename=botlist.txt');
    echo "# FireStats bots list\n";
    echo "# Generated at " . date("D M j G:i:s T Y") . "\n";
    if ($res) {
        foreach ($res as $r) {
            echo $r['wildcard'] . "\n";
        }
    }
} else {
    fs_r("Error exporting bots list");
}