本文整理汇总了PHP中Team::isMember方法的典型用法代码示例。如果您正苦于以下问题:PHP Team::isMember方法的具体用法?PHP Team::isMember怎么用?PHP Team::isMember使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Team
的用法示例。
在下文中一共展示了Team::isMember方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($seasonId, $requestedWeek = null) {
$this->season = Season::getByLink($seasonId);
$this->week = 1;
$time = time();
while($this->week < $this->season->getWeeksCount()
&& $this->season->weekIsPublished($this->week)) {
$this->week++;
}
$maxWeekMatch = Match::findOne('seasonid = ? order by week desc limit 1', [$this->season->seasonid]);
$this->maxWeek = $maxWeekMatch->week;
if (!Team::isMember()) {
while (!$this->season->weekIsPublic($this->maxWeek)) {
$this->maxWeek--;
}
}
if ($requestedWeek && $requestedWeek <= $this->maxWeek) {
$this->week = $requestedWeek;
}
else if ($requestedWeek) {
HTMLResponse::exitWithRoute("/");
}
$this->canVote = ($this->season->getPublishTimeForWeek($this->week) - $time > 3600);
}
示例2: abandonAction
public function abandonAction(Team $team, Player $me)
{
if (!$team->isMember($me->getId())) {
throw new ForbiddenException("You are not a member of that team!");
}
if ($team->getLeader()->getId() == $me->getId()) {
throw new ForbiddenException("You can't abandon the team you are leading.");
}
return $this->showConfirmationForm(function () use($team, $me) {
$team->removeMember($me->getId());
Service::getDispatcher()->dispatch(Events::TEAM_ABANDON, new Event\TeamAbandonEvent($team, $me));
return new RedirectResponse($team->getUrl());
}, "Are you sure you want to abandon {$team->getEscapedName()}?", "You have left {$team->getName()}", "Abandon");
}
示例3: show
/**
* @return void
*/
public function show()
{
if (!TwitterAuth::isLogged()) {
?>
Sólo los miembros pueden ver esta página.
<a href="<?=HTMLResponse::getRoute()?>?authenticate=1">
Inicia sesión.
</a><br>
<?
return;
}
else if (!Team::isMember()) {
?>
Sólo los miembros pueden ver esta página.<br>
<?
return;
}
else {
?><div style="text-align: left; margin: 0 auto" class="inblock"><?
if (Team::isMember()) {
?><ul><?
foreach(Poll::find('isvisible order by dateline desc') as $poll) {
?>
<li>
<a href="/votaciones/<?=$poll->pollid?>/">
<?=htmlentities($poll->title)?>
</a>
</li>
<?
}
?></ul><?
?>
<a href="/votaciones/crear/">
Haz click aquí para añadir una nueva votación.
</a>
<?
}
?></div><br><br><?
}
}
示例4: show
//.........这里部分代码省略.........
<? foreach($resultNames as $index => $names) {
?><option <?=($index==$match->result?'selected':'')?> value="<?=$index?>"><?=$names[$posIndex]?></option><?
} ?>
</select>
<input type="hidden" name="matchid" value="<?=$match->matchid?>">
</form>
</td>
<td>
<? $this->showMatchVideo($this->team, $match, 2, "Ver Team Preview") ?>
<? $this->showMatchVideo($this->team, $match, 1, "Ver Combate") ?>
</td>
</tr>
<? } ?>
</tbody>
</table>
<?
$this->showFriendlyMatches();
if ($this->team->isManager()) {
$this->checkPlayerChanges();
}
$this->showPlayers();
if ($this->team->isManager()) {
$this->showPlayersEditor();
}
$sanctionLevels = Sanction::getLevelNames();
$sanctions = Sanction::find('seasonid = ? and teamid = ? order by dateline desc',
[$this->season->seasonid, $this->team->teamid]);
if ($sanctions && Team::isMember()) {
?>
<h2>Sanciones recibidas</h2>
<table style="min-width: 512px">
<thead>
<tr>
<!-- <td>Fecha</td> -->
<td>Tipo</td>
<td>Razón</td>
</tr>
</thead>
<? foreach($sanctions as $sanction) { ?>
<tr>
<!-- <td style="font-style: italic">
<?= date("Y-m-d H:i:s", $sanction->dateline) ?>
</td> -->
<td>
<?= $sanctionLevels[$sanction->level] ?>
<? if (Team::isAdmin()) { ?>
<i style="color: #666">
por
</i>
<?= htmlentities($sanction->adminname) ?>
<? } ?>
</td>
<td>
<?= htmlentities($sanction->reason) ?>
</td>
</tr>
<? } ?>
</table><br>
示例5: show
/**
* @return void
*/
public function show()
{
if (!TwitterAuth::isLogged()) {
?>
Sólo los miembros pueden ver esta página.
<a href="<?=HTMLResponse::getRoute()?>?authenticate=1">
Inicia sesión.
</a><br>
<?
return;
}
else {
if (!Team::isMember()) {
HTMLResponse::exitWithRoute('/votaciones/');
}
$answer = PollVote::findOne('userid = ? and pollid = ?',
[TwitterAuth::getUserId(), $this->poll->pollid]);
$options = PollOption::find('pollid = ? order by polloptionid asc', [$this->poll->pollid]);
if (!$answer && strlen($hash = HTMLResponse::fromGET('hash', ''))) {
$optionid = HTMLResponse::fromGET('vote');
foreach($options as $index => $option) {
if ($option->polloptionid == $optionid && $option->getHash() == $hash) {
$answer = PollVote::create();
$answer->userid = TwitterAuth::getUserId();
$answer->dateline = time();
$answer->avatar = TwitterAuth::getAvatar();
$answer->pollid = $this->poll->pollid;
$answer->polloptionid = $option->polloptionid;
$answer->username = TwitterAuth::getUserName();
$answer->save();
}
}
}
$answers = Model::groupBy(PollVote::find('pollid = ?', [$this->poll->pollid]), 'polloptionid');
$hasAnswered = !!$answer;
?><div style="text-align:left; margin: 0 auto" class="inblock">
<table style="width:640px">
<thead>
<tr>
<td>Lista de opciones</td>
</tr>
</thead>
<?
foreach($options as $index => $option) {
?>
<tr><td class="row" style="text-align: left">
<div style="height: 6px"></div>
<div class="inblock middle" style="width:320px">
<b>Opción <?=$index+1?></b>: <?= htmlentities($option->title) ?>
</div>
<div class="inblock middle">
<div class="moreless inblock middle" style="width: 150px">
<a href="javascript:void(0)" onclick="$(this).closest('.row').find('.moreless').toggle(); $(this).closest('.row').find('.onmore').slideDown(500);">+ Mostrar más</a>
</div>
<div class="moreless inblock middle" style="width: 150px; display: none">
<a href="javascript:void(0)" onclick="$(this).closest('.row').find('.moreless').toggle(); $(this).closest('.row').find('.onmore').slideUp(400);">- Mostrar menos</a>
</div>
</div>
<div class="inblock middle">
<? if (!$hasAnswered) { ?>
<a href="<?=HTMLResponse::getRoute()?>?vote=<?=$option->polloptionid?>&hash=<?=$option->getHash()?>" onclick="return confirm('¿Votas <?=htmlentities($option->title)?>?')">
Votar esta opción
</a>
<? } else if ($answer->polloptionid == $option->polloptionid) { ?>
<i>Votaste esta opción</i>
<? } ?>
</div>
<div class="onmore" style="display: none; padding: 12px">
<?= $option->description ?>
</div>
<div style="height: 6px"></div>
<?
if (!$hasAnswered) {
?><i>Vota primero para ver los resultados</i><?
}
else {
$optionAnswers = $answers[$option->polloptionid];
?>
Votado por: <?= $optionAnswers
? '<b>'.implode(', ', Model::pluck($optionAnswers, 'username')).'</b> ('.count($optionAnswers).' votos)'
: '<i>Nadie</i>'; ?>
<?
}
?>
<div style="height: 6px"></div>
</td></tr>
<?
}
//.........这里部分代码省略.........
示例6: showBody
public function showBody()
{
?>
<div id="main" class="public">
<div class="content">
<div class="banner"></div>
<div class="nav" style="text-align: left">
<?php
foreach ($this->topMenu as $arr) {
list($link, $label, $re) = $arr;
$status = '';
if (preg_match("'^$re$'", HTMLResponse::getRoute())) {
$status = 'selected';
}
?><a href="<?= $link ?>" class="<?= $status ?>"><?= $label ?></a><?php }
?>
<div style="float: right">
<select name="season" id="navSeason">
<?php
$seasons = Team::isSuperAdmin() ?
Season::find('1=1') :
Season::find('ispublic');
foreach($seasons as $season) {
$selected = $season->seasonid == $this->season->seasonid ? 'selected' : '';
?>
<option value="<?=$season->getLink()?>" <?=$selected?>>
<?=htmlentities($season->name)?>
</option>
<? } ?>
</select>
</div>
</div>
<div style="padding: 6px">
<?php if (TwitterAuth::isLogged()) { ?>
Estás identificado como <?=htmlentities(TwitterAuth::getUserName())?>. <a href="<?=HTMLResponse::getRoute()?>?logout=1">Cerrar sesión</a>
<?php if (Team::isMember()) {
?>/ <a href="/votaciones/">Votaciones</a><?php
} ?>
<?php if (Team::isSuperAdmin()) {
?>/ <a href="/admin/">Panel de admin</a><?php
} ?>
<br>
<?php
if (TwitterAuth::isBot()) {
$botConfig = TwitterAuth::getBotConfig();
?>
<br>Eres la cuenta oficial de la LCE, haz <a href="/?authenticatebot=1">click aquí</a> para autorizar esta web a usarte como un bot.<br>
<b>Última autorización:</b> <?= isset($botConfig['dateline'])
? date('Y/m/d H:i:s', $botConfig['dateline'])
: 'Nunca' ?>
<?php
}
?>
<?php } else { ?>
No estás identificado. <a href="<?=HTMLResponse::getRoute()?>?authenticate=1">Iniciar sesión</a><br>
<?php } ?>
</div>
<div class="title">
<?= $this->section->getSubtitle() ?>
</div>
<?=$this->contents?>
</div>
</div>
<?php
}