本文整理汇总了PHP中Countries::convertIso3to2方法的典型用法代码示例。如果您正苦于以下问题:PHP Countries::convertIso3to2方法的具体用法?PHP Countries::convertIso3to2怎么用?PHP Countries::convertIso3to2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Countries
的用法示例。
在下文中一共展示了Countries::convertIso3to2方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getIso3Flag
public static function getIso3Flag($iso_code_3)
{
$iso2 = Countries::convertIso3to2($iso_code_3);
if ($iso2) {
$path = JURI::root() . 'media/com_joomleague/flags/' . strtolower($iso2) . '.png';
return $path;
}
return null;
}
示例2: getTournamentMatches
//.........这里部分代码省略.........
if (!JFile::exists(JURI::base() . $rowresult->secondlogo)) {
$rowresult->secondlogo = JURI::base() . $this->club_logo;
} else {
$rowresult->secondlogo = JURI::base() . $rowresult->secondlogo;
}
$temp = new stdClass();
$temp->projectteam1_id = $rowresult->projectteam1_id;
$temp->projectteam2_id = $rowresult->projectteam2_id;
$temp->team1_result = $rowresult->team1_result;
$temp->team2_result = $rowresult->team2_result;
$temp->firstname = $rowresult->firstname;
$temp->secondname = $rowresult->secondname;
$temp->firstcountry = $rowresult->firstcountry;
$temp->secondcountry = $rowresult->secondcountry;
$temp->firstlogo = $rowresult->firstlogo;
$temp->secondlogo = $rowresult->secondlogo;
$export[] = $temp;
$this->bracket[$round->roundcode] = array_merge($export);
if (strlen($rowresult->firstname) > $this->team_strlen) {
$this->team_strlen = strlen($rowresult->firstname);
}
if (strlen($rowresult->secondname) > $this->team_strlen) {
$this->team_strlen = strlen($rowresult->secondname);
}
}
}
} else {
if (count($this->bracket[$roundcode]) > 1) {
$temp = new stdClass();
$temp->projectteam1_id = '';
$temp->projectteam2_id = $key->projectteam2_id;
$temp->team1_result = '0';
$temp->team2_result = '1';
$temp->firstname = 'FREILOS';
$temp->secondname = $key->secondname;
$temp->firstcountry = 'DEU';
$temp->secondcountry = $key->secondcountry;
$temp->firstlogo = JURI::base() . 'media/com_joomleague/placeholders/placeholder_150.png';
$temp->secondlogo = $key->secondlogo;
$export[] = $temp;
$this->bracket[$round->roundcode] = array_merge($export);
if (strlen($temp->firstname) > $this->team_strlen) {
$this->team_strlen = strlen($temp->firstname);
}
if (strlen($temp->secondname) > $this->team_strlen) {
$this->team_strlen = strlen($temp->secondname);
}
$result = true;
}
}
}
// müssen freilose angelegt werden ?
$count_matches = sizeof($this->bracket[$round->roundcode]);
if ($this->debug_info) {
echo '3. anzahl paarungen -> <br /><pre>~' . print_r($count_matches, true) . '~</pre><br />';
echo '3. in roundcode -> <br /><pre>~' . print_r($round->roundcode, true) . '~</pre><br />';
}
if ($result) {
$roundcode = $round->roundcode;
$this->exist_result[$round->roundcode] = true;
} else {
$this->exist_result[$round->roundcode] = false;
}
break;
}
$zaehler++;
}
if ($this->debug_info) {
echo 'Gesamt. this->bracket -> <br /><pre>~' . print_r($this->bracket, true) . '~</pre><br />';
echo 'Gesamt. this->exist_result -> <br /><pre>~' . print_r($this->exist_result, true) . '~</pre><br />';
}
// jetzt die teams und ergebnisse zusammenstellen
$varteams = array();
$varresults = array();
if ($this->exist_result[$roundcode]) {
// die mannschaften
foreach ($this->bracket[$roundcode] as $key) {
// mit flagge
// [{name: "Tschechien", flag: 'cz'}, {name: "Portugal", flag: 'pt'}]
switch ($this->request['tree_logo']) {
case 1:
//$varteams[] = '[{name: "'.substr($key->firstname,0,10).'", flag: "'.$key->firstlogo.'"}, {name: "'.substr($key->secondname,0,10).'", flag: "'.$key->secondlogo.'"}]';
$varteams[] = '[{name: "' . $key->firstname . '", flag: "' . $key->firstlogo . '"}, {name: "' . $key->secondname . '", flag: "' . $key->secondlogo . '"}]';
break;
case 2:
//$varteams[] = '[{name: "'.substr($key->firstname,0,10).'", flag: "media/com_joomleague/flags/'.strtolower(Countries::convertIso3to2($key->firstcountry)).'.png"}, {name: "'.substr($key->secondname,0,10).'", flag: "media/com_joomleague/flags/'.strtolower(Countries::convertIso3to2($key->secondcountry)).'.png"}]';
$varteams[] = '[{name: "' . $key->firstname . '", flag: "' . JURI::base() . 'media/com_joomleague/flags/' . strtolower(Countries::convertIso3to2($key->firstcountry)) . '.png"}, {name: "' . $key->secondname . '", flag: "' . JURI::base() . 'media/com_joomleague/flags/' . strtolower(Countries::convertIso3to2($key->secondcountry)) . '.png"}]';
break;
}
// ohne flagge ist das
// ["Tschechien", "Portugal"]
//$varteams[] = '["'.$key->firstname.'", "'.$key->secondname.'"]';
}
}
if ($this->debug_info) {
echo 'Gesamt. varteams -> <br /><pre>~' . print_r($varteams, true) . '~</pre><br />';
}
//$mainframe->enqueueMessage(JText::_('laengster mannschafts string -> '.$this->team_strlen),'Notice');
return implode(",", $varteams);
}