本文整理汇总了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");
}
示例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;
}
示例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");
}
示例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";
}
}
示例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}");
}
示例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)) {
示例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);
}
}
}
}