<?php session_start();?>
<?php include('php_gene1.php'); ?>
<?php //include('../_cfg/config.php');?>
<?php include('php_session.php');?>
<?php $xspf=$_POST['xspf']; ?>


<?php 
// echo '<br>'.$xspf;
if(substr($xspf,0,7)!='http://'){$xspf='http://'.$xspf;}
$xml = file_get_contents($xspf);
$DOM = new DOMDocument('1.0', 'utf-8');
$DOM2 = new DOMDocument('1.0', 'utf-8');
$DOM->loadXML($xml);

$server = $_SERVER['SERVER_NAME'];

echo '<br>';
echo '<a href="'.'/'.'">'.'Inicio'.'</a>';
echo '<br>';

$tracklistx=$DOM->getElementsByTagName('trackList');
foreach($tracklistx as $tracklisty)
{
	$conta=0;
	echo '<table width="100%">';
	echo '<tr>';
	foreach($tracklisty->childNodes as $trackx)
	{
		$title='';
		$location='';
		$image='';
		$conta++;	
		
		foreach($trackx->childNodes as $tracky)
		{
			if($tracky->nodeName=='title'){$title=$tracky->nodeValue;}
			if($tracky->nodeName=='location'){$location=$tracky->nodeValue;}
			if($tracky->nodeName=='image'){$image=$tracky->nodeValue;}
		}
		echo '<td align="center" valign="top" width="12.5%">';
		if(mb_stristr($location,$server))
		{
			echo '<a href="'.$server.'/?'.$location.'">'.'<img src="'.$image.'" width="50" height="50" />'.'</a>';
			echo '<br>';
			echo '<a href="'.$server.'/?'.$location.'">'.$title.'</a>';
			echo '<br>';
			echo '<br>';
		}
		else
		{
// 			echo '<a href="'.''.'/?'.$location.'">'.'<img src="'.$image.'" width="50" height="50" />'.'</a>';
			echo '<img src="'.$image.'" width="80" height="60" class="img1" />';
			echo '<br>';
			echo '<a href="'.''.'/?'.$location.'">'.$title.'</a>';
			echo '<br>';
			echo '<br>';
		}
		echo '</td>';
		
		if($conta %8==0){echo '</tr><tr>';}
			
		
	}
	echo '</tr>';
	echo '</table>';

}

?>