當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BoincTeam::lookup方法代碼示例

本文整理匯總了PHP中BoincTeam::lookup方法的典型用法代碼示例。如果您正苦於以下問題:PHP BoincTeam::lookup方法的具體用法?PHP BoincTeam::lookup怎麽用?PHP BoincTeam::lookup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BoincTeam的用法示例。


在下文中一共展示了BoincTeam::lookup方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: strtolower

$team_name = BoincDb::escape_string(strip_tags(post_str("name")));
$team_name_lc = strtolower($team_name);
$tnh = post_str("name_html", true);
$team_name_html = sanitize_html($tnh);
$team_name_html = BoincDb::escape_string($team_name_html);
$team_description = BoincDb::escape_string(post_str("description", true));
$type = BoincDb::escape_string(post_str("type", true));
$country = BoincDb::escape_string(post_str("country", true));
if ($country == "") {
    $country = "International";
}
if (!is_valid_country($country)) {
    error_page("bad country");
}
$joinable = post_str('joinable', true) ? 1 : 0;
$t = BoincTeam::lookup("name='{$team_name}'");
if ($t && $t->id != $teamid) {
    error_page("The name '{$team_name}' is being used by another team.");
}
if (strlen($team_name) == 0) {
    error_page("Must specify team name");
}
// Should be caught up with the post_str("name"),
// but you can never be too safe.
$clause = sprintf("name = '%s',\r\n\tname_lc = '%s',\r\n\tname_html = '%s',\r\n\turl = '%s',\r\n\tdescription = '%s',\r\n\ttype = %d,\r\n\tcountry='%s',\r\n\tjoinable=%d", $team_name, $team_name_lc, $team_name_html, $team_url, $team_description, $type, $country, $joinable);
$ret = $team->update($clause);
if ($ret) {
    Header("Location: team_display.php?teamid={$team->id}");
} else {
    error_page("Could not update team - please try later.");
}
開發者ID:Turante,項目名稱:boincweb,代碼行數:31,代碼來源:team_edit_action.php

示例2: lookup_team_seti_id

function lookup_team_seti_id($seti_id)
{
    return BoincTeam::lookup("seti_id={$seti_id}");
}
開發者ID:ChristianBeer,項目名稱:boinc,代碼行數:4,代碼來源:team_import.php


注:本文中的BoincTeam::lookup方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。