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


PHP BoincTeam::enum方法代码示例

本文整理汇总了PHP中BoincTeam::enum方法的典型用法代码示例。如果您正苦于以下问题:PHP BoincTeam::enum方法的具体用法?PHP BoincTeam::enum怎么用?PHP BoincTeam::enum使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BoincTeam的用法示例。


在下文中一共展示了BoincTeam::enum方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_teams

function get_teams($clause, $active)
{
    $c2 = '';
    if ($active) {
        $c2 = "and expavg_credit>0.1";
    }
    return BoincTeam::enum("{$clause} {$c2} order by expavg_credit desc limit 20");
}
开发者ID:Turante,项目名称:boincweb,代码行数:8,代码来源:team_search.php

示例2: get_teams

function get_teams($clause, $active)
{
    $c2 = '';
    if ($active) {
        $c2 = "and expavg_credit>0.1";
    }
    $x = BoincTeam::enum("{$clause} {$c2} order by expavg_credit desc limit 20");
    foreach ($x as $t) {
        $t->refcnt = 0;
    }
    return $x;
}
开发者ID:CalvinZhu,项目名称:boinc,代码行数:12,代码来源:team_search.php

示例3: main

function main()
{
    $f = fopen("temp.xml", "w");
    $teams = BoincTeam::enum();
    fwrite($f, "<teams>\n");
    foreach ($teams as $team) {
        handle_team($team, $f);
    }
    fwrite($f, "</teams>\n");
    fclose($f);
    rename("temp.xml", "/home/boincadm/boinc/doc/boinc_teams.xml");
}
开发者ID:Turante,项目名称:boincweb,代码行数:12,代码来源:team_export.php

示例4: main

function main()
{
    echo "------------ Starting at " . time_str(time()) . "-------\n";
    $f = fopen("temp.xml", "w");
    $teams = BoincTeam::enum(null);
    fwrite($f, "<teams>\n");
    foreach ($teams as $team) {
        handle_team($team, $f);
    }
    fwrite($f, "</teams>\n");
    fclose($f);
    if (!rename("temp.xml", "/home/boincadm/boinc/doc/boinc_teams.xml")) {
        echo "Rename failed\n";
    }
}
开发者ID:nicolas17,项目名称:boincgit-test,代码行数:15,代码来源:team_export.php

示例5: get_top_teams

function get_top_teams($offset, $sort_by, $type)
{
    global $teams_per_page;
    $db = BoincDb::get(true);
    $type_clause = null;
    if ($type) {
        $type_clause = "type={$type}";
    }
    if ($sort_by == "total_credit") {
        $sort_order = "total_credit desc";
    } else {
        $sort_order = "expavg_credit desc";
    }
    return BoincTeam::enum($type_clause, "order by {$sort_order} limit {$offset}, {$teams_per_page}");
}
开发者ID:CalvinZhu,项目名称:boinc,代码行数:15,代码来源:top_teams.php

示例6: get_str

                $total++;
                if ($total == 100) {
                    break;
                }
            }
            //do not error out
        }
    }
    echo "</teams>\n";
    exit;
}
$team_name = get_str("team_name");
$name_lc = strtolower($team_name);
$name_lc = escape_pattern($name_lc);
$clause = "name like '%" . BoincDb::escape_string($name_lc) . "%' order by expavg_credit desc limit 100";
$teams = BoincTeam::enum($clause);
if ($format == 'xml') {
    echo "<teams>\n";
    $total = 0;
    foreach ($teams as $team) {
        show_team_xml($team);
        $total++;
        if ($total == 100) {
            break;
        }
    }
    echo "</teams>\n";
    exit;
}
page_head(tra("Search Results"));
if (count($teams)) {
开发者ID:gchilders,项目名称:boinc,代码行数:31,代码来源:team_lookup.php

示例7: delete_teams

function delete_teams()
{
    global $days, $test;
    $query = "nusers < 2 and seti_id=0 and total_credit=0";
    if ($days) {
        $x = time() - $days * 86400;
        $query .= " and create_time > {$x}";
    }
    $teams = BoincTeam::enum($query);
    foreach ($teams as $team) {
        $n = team_count_members($team->id);
        if ($n > 1) {
            continue;
        }
        if (!has_link($team->description)) {
            continue;
        }
        $user = BoincUser::lookup_id($team->userid);
        if ($user) {
            $n = BoincPost::count("user={$user->id}");
            if ($n) {
                continue;
            }
            $n = BoincHost::count("userid={$user->id}");
            if ($n) {
                continue;
            }
        }
        if ($test) {
            echo "would delete team:\n";
            echo "   ID: {$team->id}\n";
            echo "   name: {$team->name}\n";
            echo "   description: {$team->description}\n";
        } else {
            $team->delete();
            echo "deleted team ID {$team->id} name {$team->name}\n";
            if ($user) {
                do_delete_user($user);
            }
        }
    }
}
开发者ID:privat1,项目名称:boinc,代码行数:42,代码来源:delete_spammers.php


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