當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。