Diskuse

Téma: XML feed

Ahoj. Jde nějak udělat to, aby se mi na webu zobrazovala data z XML feedu od partnera.
Děkuji.
postZaslat odpověď
1) Musíš vytvořit vlastní HCMko
2) Pročti si něco o použití

Inspiruj se:
<?php

if(!defined('_core')) {
exit;
}

function _hcm_studioart_svaz($limit = "") {

$xml = simplexml_load_file('http://www.handball.cz/xmlexport/clubs/183_match_list.xml');

$result = "
<div class='vysledky'>
<table class='results-box lastmatcheslist'><tbody>";

foreach($xml->teams->team as $key => $value)
{

foreach($value->competitions->competition as $k=>$league)
{

foreach($league->matches->match as $k2 => $match)
{
if(strtotime($match->date) < strtotime(date('Y-m-d')) && !(strtotime($match->date) == strtotime('0001-01-01')))
{
$match->age_cat = $value->age_cat;
$value->id == 423 ? $match->age_cat.=' A':'';
$value->id == 736 ? $match->age_cat.=' B':'';
$matches[] = $match;
}
}
}
}
usort($matches, function($a,$b){
return strtotime($b->date)-strtotime($a->date);
});

$iterator = 0;
if($limit == "") $limit=3;

foreach($matches as $k3 => $match)
{

//resize to
$team_home=_pictureThumb("pictures/clubs/"._anchorStr($match->team_home).".png", array('x' => 64, 'y' => 64, 'mode' => 'fit', 'keep_smaller' => false, 'bgcolor' => array(255, 255, 255), 'pad' => true, 'trans' => true));
$team_visiting=_pictureThumb("pictures/clubs/"._anchorStr($match->team_visiting).".png", array('x' => 64, 'y' => 64, 'mode' => 'fit', 'keep_smaller' => false, 'bgcolor' => array(255, 255, 255), 'pad' => true, 'trans' => true));

$result .= "
<tr class='legend'>
<th colspan='4'><span class='matchtime'>". date("j.n.Y",strtotime($match->date))."</span><span class='teamname'>$match->age_cat</span></th>
</tr>";

$result .= "
<tr>
<td>
<div class='logotypes'>
<img src='{$team_home}' class='i_home icon' alt='Logo domácí' />
<img src='{$team_visiting}' class='i_visiting icon' alt='Logo hosté' />
</div>

<div class='teams_names'>
<span class='i_home'>{$match->team_home}</span>
<span class='i_vs'>vs</span>
<span class='i_visiting'>{$match->team_visiting}</span>

<div class='score_sum'>
{$match->score_home} : {$match->score_visiting}
</div>

</div>

</td>
</tr>";

$iterator++;
if($iterator>=$limit && $limit!=0) break;
}

$result .= "
</tbody>
</table>
</div>";

return $result;

}
Výstupy na http://www.kpbrno.cz/vysledky#nextmatches
Díky za radu, ale tohle nedám.
Tak mě kontaktuj, jestli to fakt potřebuješ 😁
Díky za nabídku. Zkusím se s tím poprat a případně se ozvu.
Hezké vánoce.