本文整理汇总了PHP中Date::BritishDate方法的典型用法代码示例。如果您正苦于以下问题:PHP Date::BritishDate方法的具体用法?PHP Date::BritishDate怎么用?PHP Date::BritishDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Date
的用法示例。
在下文中一共展示了Date::BritishDate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: OnPrePageLoad
function OnPrePageLoad()
{
if ($this->page_not_found) {
$this->SetPageTitle('Page not found');
return;
}
$title = "Statistics for the " . $this->tournament->GetTitle() . ", " . Date::BritishDate($this->tournament->GetStartTime());
$this->SetPageTitle($title);
$this->SetContentConstraint(StoolballPage::ConstrainBox());
$this->SetContentCssClass('stats');
}
示例2: BuildItems
/**
* (non-PHPdoc)
* @see data/DataManager#BuildItems($o_result)
*/
public function BuildItems(MySqlRawData $result)
{
$this->Clear();
while ($o_row = $result->fetch()) {
$o_sub = new Subscription($this->GetSettings());
$o_sub->SetType($o_row->item_type);
$o_sub->SetSubscribeDate($o_row->date_changed);
$o_sub->SetSubscribedItemId($o_row->item_id);
switch ($o_sub->GetType()) {
case ContentType::STOOLBALL_MATCH:
$o_sub->SetTitle($o_row->match_title);
$o_sub->SetContentDate(Date::BritishDate($o_row->start_time));
$o_sub->SetSubscribedItemUrl($o_row->short_url);
break;
}
$this->Add($o_sub);
}
}
示例3: OnPrePageLoad
function OnPrePageLoad()
{
if ($this->page_not_found) {
$this->SetPageTitle('Page not found');
return;
}
$title = "Statistics for " . $this->match->GetTitle() . ", " . Date::BritishDate($this->match->GetStartTime(), false);
$this->SetPageTitle($title);
$this->SetContentConstraint(StoolballPage::ConstrainBox());
if ($this->has_statistics) {
$this->LoadClientScript("/scripts/lib/chart.min.js");
$this->LoadClientScript("/scripts/chart.js?v=2");
$this->LoadClientScript("/play/statistics/match.js");
?>
<!--[if lte IE 8]><script src="/scripts/lib/excanvas.compiled.js"></script><![endif]-->
<?php
}
}
示例4: OnPreRender
public function OnPreRender()
{
$i = $this->first_result;
$last_value = "";
foreach ($this->bowling_data as $bowling) {
$current_value = $bowling["wickets"] . "/" . $bowling["runs_conceded"];
if ($current_value != $last_value) {
# If 11th value is not same as 10th, stop. This can happen because DB query sees selects all performances with the same number of wickets as the tenth.
if (!is_null($this->max_results) and $i > $this->max_results) {
break;
}
$pos = $i;
$last_value = $current_value;
} else {
$pos = "=";
}
$i++;
$position = new XhtmlCell(false, $pos);
$position->SetCssClass("position");
$player = new XhtmlCell(false, '<a property="schema:name" rel="schema:url" href="' . $bowling["player_url"] . '">' . $bowling["player_name"] . "</a>");
$player->SetCssClass("player");
$player->AddAttribute("typeof", "schema:Person");
$player->AddAttribute("about", "http://www.stoolball.org.uk/id/player" . $bowling["player_url"]);
if ($this->display_team) {
$team = new XhtmlCell(false, $bowling["team_name"]);
$team->SetCssClass("team");
}
$opposition = new XhtmlCell(false, $bowling["opposition_name"]);
$opposition->SetCssClass("team");
$date = new XhtmlCell(false, Date::BritishDate($bowling["match_time"], false, true, $this->display_team));
$date->SetCssClass("date");
$wickets = new XhtmlCell(false, $bowling["wickets"]);
$wickets->SetCssClass("numeric");
$runs = new XhtmlCell(false, $bowling["runs_conceded"]);
$runs->SetCssClass("numeric");
if ($this->display_team) {
$row = new XhtmlRow(array($position, $player, $team, $opposition, $date, $wickets, $runs));
} else {
$row = new XhtmlRow(array($position, $player, $opposition, $date, $wickets, $runs));
}
$this->AddRow($row);
}
parent::OnPreRender();
}
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:44,代码来源:bowling-performance-table.class.php
示例5: OnPreRender
public function OnPreRender()
{
$i = $this->first_result;
$last_value = "";
foreach ($this->batting_data as $batting) {
$current_value = $batting["runs_scored"];
$not_out = ($batting["how_out"] == Batting::NOT_OUT or $batting["how_out"] == Batting::RETIRED or $batting["how_out"] == Batting::RETIRED_HURT);
if ($not_out) {
$current_value .= "*";
}
if ($current_value != $last_value) {
# If 11th value is not same as 10th, stop. This can happen because DB query sees 40* and 40 as equal, but they're not.
if (!is_null($this->max_results) and $i > $this->max_results) {
break;
}
$pos = $i;
$last_value = $current_value;
} else {
$pos = "=";
}
$i++;
$position = new XhtmlCell(false, $pos);
$position->SetCssClass("position");
$player = new XhtmlCell(false, '<a property="schema:name" rel="schema:url" href="' . $batting["player_url"] . '">' . $batting["player_name"] . "</a>");
$player->SetCssClass("player");
$player->AddAttribute("typeof", "schema:Person");
$player->AddAttribute("about", "http://www.stoolball.org.uk/id/player" . $batting["player_url"]);
if ($this->display_team) {
$team = new XhtmlCell(false, $batting["team_name"]);
$team->SetCssClass("team");
}
$opposition = new XhtmlCell(false, $batting["opposition_name"]);
$opposition->SetCssClass("team");
$date = new XhtmlCell(false, Date::BritishDate($batting["match_time"], false, true, $this->display_team));
$date->SetCssClass("date");
$runs = new XhtmlCell(false, $current_value);
$runs->SetCssClass("numeric");
if (!$not_out) {
$runs->AddCssClass("out");
}
$balls_faced = is_null($batting["balls_faced"]) ? "–" : '<span class="balls-faced">' . $batting["balls_faced"] . '</span>';
$balls = new XhtmlCell(false, $balls_faced);
$balls->SetCssClass("numeric");
if ($this->display_team) {
$row = new XhtmlRow(array($position, $player, $team, $opposition, $date, $runs, $balls));
} else {
$row = new XhtmlRow(array($position, $player, $opposition, $date, $runs, $balls));
}
$this->AddRow($row);
}
parent::OnPreRender();
}
示例6: OnPrePageLoad
function OnPrePageLoad()
{
/* @var $match Match */
# set page title
if ($this->tournament instanceof Match) {
$action = "Edit ";
$this->SetPageTitle($action . $this->tournament->GetTitle() . ', ' . Date::BritishDate($this->tournament->GetStartTime()));
} else {
$this->SetPageTitle('Page not found');
}
$this->SetContentCssClass('matchEdit');
$this->SetContentConstraint(StoolballPage::ConstrainText());
}
示例7: OnPrePageLoad
public function OnPrePageLoad()
{
/* @var $match Match */
$this->SetContentConstraint(StoolballPage::ConstrainText());
if ($this->page_not_found) {
$this->SetPageTitle('Page not found');
return;
# Don't load any JS
}
# Set page title
$edit_or_update = ($this->b_user_is_match_admin or $this->b_user_is_match_owner) ? "Edit" : "Update";
if ($this->match->GetStartTime() > gmdate('U') and !$this->b_user_is_match_admin and !$this->b_user_is_match_owner) {
$step = "";
# definitely only this step because match in future and can't change date
} else {
$step = ", step 1 of 4";
}
$this->SetPageTitle("{$edit_or_update} " . $this->match->GetTitle() . ', ' . Date::BritishDate($this->match->GetStartTime()) . $step);
# Load JavaScript
if ($this->b_user_is_match_admin or $this->b_user_is_match_owner) {
$this->LoadClientScript('/scripts/match-fixture-edit-control-5.js');
}
if ($this->b_user_is_match_admin) {
$this->LoadClientScript('matchedit-admin-3.js', true);
}
$this->LoadClientScript('matchedit.js', true);
}
示例8: ApplyTournamentFilter
/**
* If the tournament parameter is in the query string apply tournament filter
* @param SiteSettings $settings
* @param MySqlConnection $connection
* @param StatisticsManager $statistics_manager
*/
public static function ApplyTournamentFilter(SiteSettings $settings, MySqlConnection $connection, StatisticsManager $statistics_manager)
{
$filter = "";
if (isset($_GET['tournament']) and is_numeric($_GET['tournament'])) {
require_once 'stoolball/match-manager.class.php';
$match_manager = new MatchManager($settings, $connection);
$match_manager->ReadByMatchId(array($_GET['tournament']));
$tournament = $match_manager->GetFirst();
unset($match_manager);
if (!is_null($tournament)) {
$statistics_manager->FilterByTournament(array($tournament->GetId()));
$filter = "in the " . $tournament->GetTitle() . " on " . Date::BritishDate($tournament->GetStartTime()) . " ";
}
}
return $filter;
}
示例9: OnPrePageLoad
function OnPrePageLoad()
{
/* @var $match Match */
# set page title
if ($this->tournament instanceof Match) {
$action = $this->adding ? "Add " : "Edit ";
$this->SetPageTitle($action . $this->tournament->GetTitle() . ', ' . Date::BritishDate($this->tournament->GetStartTime()));
} else {
$this->SetPageTitle('Page not found');
}
$this->SetContentCssClass('matchEdit');
$this->SetContentConstraint(StoolballPage::ConstrainText());
$except = array();
if ($this->tournament instanceof Match) {
foreach ($this->tournament->GetAwayTeams() as $team) {
$except[] = $team->GetId();
}
}
$this->LoadClientScript("/scripts/lib/jquery-ui-1.8.11.custom.min.js");
$this->LoadClientScript("/play/teams/suggest-teams.js.php?except=" . trim(implode(",", $except), ","));
?>
<link rel="stylesheet" type="text/css" href="/css/custom-theme/jquery-ui-1.8.11.custom.css" media="all" />
<?php
}
示例10: CreateValidators
/**
* @return void
* @desc Create DataValidator objects to validate the edit control
*/
public function CreateValidators()
{
require_once 'data/validation/required-field-validator.class.php';
require_once 'data/validation/numeric-validator.class.php';
require_once 'data/validation/length-validator.class.php';
$o_match = $this->GetDataObject();
/* @var $o_match Match */
$s_match_date = $this->GetShowDateInValidationErrors() ? ' for ' . Date::BritishDate($o_match->GetStartTime(), false) : '';
$s_home_team = (is_object($o_match) and is_object($o_match->GetHomeTeam())) ? $o_match->GetHomeTeam()->GetName() : 'home team';
$s_away_team = (is_object($o_match) and is_object($o_match->GetAwayTeam())) ? $o_match->GetAwayTeam()->GetName() : 'away team';
$this->AddValidator(new NumericValidator($this->GetNamingPrefix() . 'HomeRuns', 'The ' . $s_home_team . ' score' . $s_match_date . ' should be a number. For example: \'5\', not \'five\'.'));
$this->AddValidator(new NumericValidator($this->GetNamingPrefix() . 'HomeWickets', 'The ' . $s_home_team . ' wickets' . $s_match_date . ' should be a number. For example: \'5\', not \'five\'.'));
$this->AddValidator(new NumericValidator($this->GetNamingPrefix() . 'AwayRuns', 'The ' . $s_away_team . ' score' . $s_match_date . ' should be a number. For example: \'5\', not \'five\'.'));
$this->AddValidator(new NumericValidator($this->GetNamingPrefix() . 'AwayWickets', 'The ' . $s_away_team . ' wickets' . $s_match_date . ' should be a number. For example: \'5\', not \'five\'.'));
$this->AddValidator(new NumericValidator($this->GetNamingPrefix() . 'Result', 'The result identifier' . $s_match_date . ' should be a number'));
}
开发者ID:stoolball-england,项目名称:stoolball-england-website,代码行数:20,代码来源:match-result-edit-control.class.php
示例11: OnPageLoad
function OnPageLoad()
{
$is_tournament = $this->match->GetMatchType() == MatchType::TOURNAMENT;
$class = $is_tournament ? "match" : "match vevent";
?>
<div class="$class" typeof="schema:SportsEvent" about="<?php
echo Html::Encode($this->match->GetLinkedDataUri());
?>
">
<?php
require_once 'xhtml/navigation/tabs.class.php';
$tabs = array('Summary' => '');
if ($is_tournament) {
$tabs['Tournament statistics'] = $this->match->GetNavigateUrl() . '/statistics';
# Make sure the reader knows this is a tournament, and the player type
$says_tournament = strpos(strtolower($this->match->GetTitle()), 'tournament') !== false;
$player_type = PlayerType::Text($this->match->GetPlayerType());
$says_player_type = strpos(strtolower($this->match->GetTitle()), strtolower(rtrim($player_type, '\''))) !== false;
$page_title = $this->match->GetTitle() . ", " . Date::BritishDate($this->match->GetStartTime(), false);
if (!$says_tournament and !$says_player_type) {
$page_title .= ' (' . $player_type . ' stoolball tournament)';
} else {
if (!$says_tournament) {
$page_title .= ' stoolball tournament';
} else {
if (!$says_player_type) {
$page_title .= ' (' . $player_type . ')';
}
}
}
$heading = new XhtmlElement('h1', $page_title);
$heading->AddAttribute("property", "schema:name");
echo $heading;
} else {
if ($this->match->GetMatchType() == MatchType::TOURNAMENT_MATCH) {
$tabs['Match statistics'] = $this->match->GetNavigateUrl() . '/statistics';
$tabs['Tournament statistics'] = $this->match->GetTournament()->GetNavigateUrl() . '/statistics';
$page_title = $this->match->GetTitle() . " in the " . $this->match->GetTournament()->GetTitle();
} else {
$tabs['Statistics'] = $this->match->GetNavigateUrl() . '/statistics';
$page_title = $this->match->GetTitle();
}
$o_title = new XhtmlElement('h1', Html::Encode($page_title));
$o_title->AddAttribute("property", "schema:name");
# hCalendar
$o_title->SetCssClass('summary');
$o_title_meta = new XhtmlElement('span', ' (stoolball)');
$o_title_meta->SetCssClass('metadata');
$o_title->AddControl($o_title_meta);
if ($this->match->GetMatchType() !== MatchType::TOURNAMENT_MATCH) {
$o_title->AddControl(", " . Date::BritishDate($this->match->GetStartTime(), false));
}
echo $o_title;
}
echo new Tabs($tabs);
?>
<div class="box tab-box">
<div class="dataFilter"></div>
<div class="box-content">
<?php
if ($is_tournament) {
require_once 'stoolball/tournaments/tournament-control.class.php';
echo new TournamentControl($this->GetSettings(), $this->match);
} else {
require_once 'stoolball/matches/match-control.class.php';
echo new MatchControl($this->GetSettings(), $this->match);
}
$this->DisplayComments();
$this->ShowSocial();
?>
</div>
</div>
</div>
<?php
$this->AddSeparator();
# add/edit/delete options
$user_is_admin = AuthenticationManager::GetUser()->Permissions()->HasPermission(PermissionType::MANAGE_MATCHES);
$user_is_owner = AuthenticationManager::GetUser()->GetId() == $this->match->GetAddedBy()->GetId();
$panel = new UserEditPanel($this->GetSettings(), 'this match');
$panel->AddCssClass("with-tabs");
if ($user_is_admin or $user_is_owner) {
$link_text = $is_tournament ? 'tournament' : 'match';
$panel->AddLink('edit this ' . $link_text, $this->match->GetEditNavigateUrl());
} else {
if ($this->match->GetMatchType() != MatchType::PRACTICE and !$is_tournament) {
$panel->AddLink('update result', $this->match->GetEditNavigateUrl());
}
}
if ($is_tournament) {
$panel->AddCssClass("with-tabs");
if ($user_is_admin or $user_is_owner) {
$panel->AddLink('add or remove teams', $this->match->EditTournamentTeamsUrl());
}
$panel->AddLink('add or remove matches', $this->match->GetEditTournamentMatchesUrl());
if (count($this->match->GetMatchesInTournament())) {
$panel->AddLink('update results', $this->match->GetNavigateUrl() . "/matches/results");
}
}
if ($user_is_admin or $user_is_owner) {
if ($is_tournament) {
//.........这里部分代码省略.........
示例12: OnPrePageLoad
function OnPrePageLoad()
{
/* @var $match Match */
# set page title
if ($this->tournament instanceof Match) {
$this->SetPageTitle('Edit ' . $this->tournament->GetTitle() . ', ' . Date::BritishDate($this->tournament->GetStartTime()));
} else {
$this->SetPageTitle('Page not found');
}
$this->SetContentCssClass('matchEdit');
$this->SetContentConstraint(StoolballPage::ConstrainText());
$this->LoadClientScript('/scripts/tournament-edit-control-3.js');
}
示例13: BritishDateAndTime
/**
* @return string
* @param int $i_utc_timestamp
* @param bool $b_include_day_name
* @param Refer to "this Sunday" rather than "Sunday 12 June" $b_relative_date
* @param Use Jan, Feb etc rather than January, February etc $b_short_month
* @desc Get a date in the format "10am, Sunday 1 January 2000"
*/
public static function BritishDateAndTime($i_utc_timestamp, $b_include_day_name = true, $b_relative_date = true, $b_short_month = false)
{
return Date::Time($i_utc_timestamp) . Date::TimeDateSeparator($i_utc_timestamp) . Date::BritishDate($i_utc_timestamp, $b_include_day_name, $b_relative_date, $b_short_month);
}
示例14: OnPrePageLoad
public function OnPrePageLoad()
{
/* @var $match Match */
#$this->SetContentConstraint(StoolballPage::ConstrainText());
$this->SetContentCssClass('scorecardPage');
$this->SetContentCssClass('scorecardPage');
if ($this->page_not_found) {
$this->SetPageTitle('Page not found');
return;
# Don't load any JS
}
# Set page title
$edit_or_update = ($this->b_user_is_match_admin or $this->b_user_is_match_owner) ? "Edit" : "Update";
$step = ", step " . $this->editor->GetCurrentPage() . " of 4";
$this->SetPageTitle("{$edit_or_update} " . $this->match->GetTitle() . ', ' . Date::BritishDate($this->match->GetStartTime()) . $step);
# Load JavaScript
$autocomplete_team_ids = array();
if ($this->match->GetHomeTeamId()) {
$autocomplete_team_ids[] = $this->match->GetHomeTeamId();
}
if ($this->match->GetAwayTeamId()) {
$autocomplete_team_ids[] = $this->match->GetAwayTeamId();
}
if (count($autocomplete_team_ids)) {
$this->LoadClientScript("/scripts/lib/jquery-ui-1.8.11.custom.min.js");
$this->LoadClientScript("/play/playersuggest.js.php?v=2&team=" . implode(",", $autocomplete_team_ids));
// . "&time=" . time());
?>
<link rel="stylesheet" type="text/css" href="/css/custom-theme/jquery-ui-1.8.11.custom.css" media="all" />
<?php
}
$this->LoadClientScript('scorecard.js', true);
}
示例15: GetSubscribeDateCell
function GetSubscribeDateCell($o_sub)
{
$o_td = new XhtmlElement('td', Html::Encode(ucfirst(Date::BritishDate($o_sub->GetSubscribeDate()))));
$o_td->SetCssClass('date');
return $o_td;
}