本文整理汇总了PHP中JoomleagueHelper::getTeamMatchResult方法的典型用法代码示例。如果您正苦于以下问题:PHP JoomleagueHelper::getTeamMatchResult方法的具体用法?PHP JoomleagueHelper::getTeamMatchResult怎么用?PHP JoomleagueHelper::getTeamMatchResult使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JoomleagueHelper
的用法示例。
在下文中一共展示了JoomleagueHelper::getTeamMatchResult方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
echo '</td>';
echo "\n";
break;
case 'LASTGAMES':
echo '<td class="rankingrow lastgames"';
if ($color != '' && $config['use_background_row_color']) {
echo 'style="background-color:' . $color . '"';
}
echo '>';
foreach ($this->previousgames[$ptid] as $g) {
$txt = $this->teams[$g->projectteam1_id]->name . ' [ ' . $g->team1_result . ' - ' . $g->team2_result . ' ] ' . $this->teams[$g->projectteam2_id]->name;
$attribs = array('title' => $txt);
if (!($img = JoomleagueHelperHtml::getThumbUpDownImg($g, $ptid, $attribs))) {
continue;
}
switch (JoomleagueHelper::getTeamMatchResult($g, $ptid)) {
case -1:
$attr = array('class' => 'thumblost');
break;
case 0:
$attr = array('class' => 'thumbdraw');
break;
case 1:
$attr = array('class' => 'thumbwon');
break;
}
$url = JRoute::_(JoomleagueHelperRoute::getMatchReportRoute($g->project_slug, $g->slug));
echo JHTML::link($url, $img, $attr);
}
echo '</td>';
echo "\n";
示例2: getThumbUpDownImg
/**
* return thumb up/down image url if team won/loss
*
* @param object $game
* @param int $projectteam_id
* @param array attributes
* @return string image html code
*/
public function getThumbUpDownImg($game, $projectteam_id, $attributes = null)
{
$res = JoomleagueHelper::getTeamMatchResult($game, $projectteam_id);
if ($res === false) {
return false;
}
if ($res == 0) {
$img = 'media/com_joomleague/jl_images/draw.png';
$alt = JText::_('COM_JOOMLEAGUE_DRAW');
$title = $alt;
} else {
if ($res < 0) {
$img = 'media/com_joomleague/jl_images/thumbs_down.png';
$alt = JText::_('COM_JOOMLEAGUE_LOST');
$title = $alt;
} else {
$img = 'media/com_joomleague/jl_images/thumbs_up.png';
$alt = JText::_('COM_JOOMLEAGUE_WON');
$title = $alt;
}
}
// default title attribute, if not specified in passed attributes
$def_attribs = array('title' => $title);
if ($attributes) {
$attributes = array_merge($def_attribs, $attributes);
} else {
$attributes = $def_attribs;
}
return JHTML::image($img, $alt, $attributes);
}