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


PHP BoincUser::enum方法代码示例

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


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

示例1: update_user_posts

function update_user_posts()
{
    $users = BoincUser::enum();
    foreach ($users as $user) {
        $num = BoincPost::count("user={$user->id}");
        if ($num != $user->posts) {
            echo "user {$user->id}: {$user->posts} {$num}\n";
            $user->update("posts={$num}");
        }
    }
}
开发者ID:Turante,项目名称:boincweb,代码行数:11,代码来源:forum_repair.php

示例2: get_top_participants

function get_top_participants($offset, $sort_by)
{
    global $users_per_page;
    $db = BoincDb::get(true);
    if ($sort_by == "total_credit") {
        $sort_order = "total_credit desc";
    } else {
        $sort_order = "expavg_credit desc";
    }
    return BoincUser::enum(null, "order by {$sort_order} limit {$offset},{$users_per_page}");
}
开发者ID:entibasse,项目名称:superhost,代码行数:11,代码来源:top_users.php

示例3: repair_prefs

        if ($retval) {
            //echo "$user->id: good\n";
        } else {
            echo "repairing prefs for user {$user->id}\n";
            $p = repair_prefs($user->global_prefs);
            if ($p) {
                $retval = @simplexml_load_string($p);
                if ($retval) {
                    $user->update("global_prefs='{$p}'");
                    echo "   repair succeeded\n";
                } else {
                    echo "   repair failed\n";
                }
            } else {
                echo "   prefs are missing end tag\n";
            }
        }
    }
}
$n = 0;
$maxid = BoincUser::max("id");
while ($n <= $maxid) {
    $m = $n + 1000;
    $users = BoincUser::enum("id >= {$n} and id < {$m}");
    //echo "processing from $n\n";
    if (!$users) {
        break;
    }
    process_set($users);
    $n = $m;
}
开发者ID:CalvinZhu,项目名称:boinc,代码行数:31,代码来源:fix_prefs.php

示例4: tra

        echo "<p>" . tra("Team member %1 requested this team's foundership on %2, but left the team, thus canceling the request.", user_links($ping_user), $x) . "</p>";
        $team->update("ping_user=0, ping_time=0");
    } else {
        $ping_user = BoincUser::lookup_id($team->ping_user);
        $x = date_str(transfer_ok_time($team));
        echo "<p>" . tra("Team member %1 has requested this team's foundership. This may be because you left the team or haven't had contact with the team for a long time.", user_links($ping_user)) . "</p>";
        echo "<p>\n            <form method=\"post\" action=\"team_founder_transfer_action.php\">\n            <input type=\"hidden\" name=\"action\" value=\"decline\">\n            <input type=\"hidden\" name=\"teamid\" value=\"" . $team->id . "\">\n            <input type=\"submit\" value=\"" . tra("decline request") . "\">\n            </form>\n            <p>\n            " . tra("If you don't decline the request by %1, %2 will have the option of assuming team foundership.<br /><br />\n                  To accept the request, assign foundership to %3 using the form below.", $x, $ping_user->name, $ping_user->name) . "\n            </p>\n            <hr>\n            <p>\n        ";
    }
} else {
    echo tra("No transfer request is pending.") . "<br /><br />";
}
echo tra("To assign foundership of this team to another member, check the box next to member name and click <strong>Change founder</strong> below.") . "<form method=post action=team_change_founder_action.php>\n    <input type=hidden name=teamid value={$team->id}>";
echo form_tokens($user->authenticator);
start_table();
echo "<tr>\n    <th>" . tra("New founder?") . "</th>\n    <th>" . tra("Name") . "</th>\n    <th>" . tra("Total credit") . "</th>\n    <th>" . tra("Recent average credit") . "</th>\n    </tr>\n";
$users = BoincUser::enum("teamid={$team->id}");
$navailable_users = 0;
foreach ($users as $user) {
    if ($user->id != $team->userid) {
        //don't show current founder
        $user_total_credit = format_credit($user->total_credit);
        $user_expavg_credit = format_credit($user->expavg_credit);
        $selected = $user->id == $team->ping_user ? "selected" : "";
        echo '
            <tr>
            <td align="center"><input type="radio" name="userid" value="' . $user->id . '">
            <td>' . $user->name . '</td>
            <td align=right>' . $user_total_credit . '</td>
            <td align=right>' . $user_expavg_credit . '</td>
            </tr>
        ';
开发者ID:maexlich,项目名称:boinc-igemathome,代码行数:31,代码来源:team_change_founder_form.php

示例5: update_users

function update_users($app_id)
{
    $n = 0;
    $maxid = BoincUser::max("id");
    while ($n <= $maxid) {
        $m = $n + 1000;
        $users = BoincUser::enum("id>={$n} and id<{$m}");
        foreach ($users as $user) {
            update_user($user, $app_id);
        }
        $n = $m;
    }
}
开发者ID:ChristianBeer,项目名称:boinc,代码行数:13,代码来源:app_select_edit.php

示例6:

<?php

// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2012 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
// replace user names that are all whitespace with the user ID
require_once "../inc/boinc_db.inc";
$users = BoincUser::enum("trim(name)=''");
foreach ($users as $u) {
    $n = (string) $u->id;
    $u->update("name='{$n}'");
}
开发者ID:CalvinZhu,项目名称:boinc,代码行数:25,代码来源:fix_blank_user_names.php

示例7: delete_user_url

function delete_user_url()
{
    global $test, $days;
    $users = BoincUser::enum("url <> ''");
    foreach ($users as $user) {
        if ($days) {
            if ($user->create_time < time() - $days * 86400) {
                continue;
            }
        }
        $n = BoincHost::count("userid={$user->id}");
        if ($n) {
            continue;
        }
        $n = BoincPost::count("user={$user->id}");
        if ($n) {
            continue;
        }
        do_delete_user($user);
    }
}
开发者ID:privat1,项目名称:boinc,代码行数:21,代码来源:delete_spammers.php

示例8: do_send_team

function do_send_team($logged_in_user)
{
    check_tokens($logged_in_user->authenticator);
    $subject = post_str("subject", true);
    $content = post_str("content", true);
    $teamid = post_int("teamid");
    if (post_str("preview", true) == tra("Preview")) {
        pm_team_form($logged_in_user, $teamid);
        return;
    }
    // make sure user is authorized, i.e. is a team admin
    //
    $team = BoincTeam::lookup_id($teamid);
    if (!$team) {
        error_page("no such team");
    }
    if (!is_team_admin($logged_in_user, $team)) {
        error_page("no team admin");
    }
    if ($subject == null || $content == null) {
        pm_team_form($logged_in_user, $teamid, tra("You need to fill all fields to send a private message"));
        return;
    }
    $subject = "Message from team " . $team->name . ": " . $subject;
    // don't use tra() here because we don't know language of recipient
    // Also, we use it in pm_count() to exclude team messages from limit check
    $users = BoincUser::enum("teamid={$teamid}");
    foreach ($users as $user) {
        pm_send_msg($logged_in_user, $user, $subject, $content, true);
    }
    page_head(tra("Message sent"));
    echo tra("Your message was sent to %1 team members.", count($users));
    page_tail();
}
开发者ID:gchilders,项目名称:boinc,代码行数:34,代码来源:pm.php


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