<?php
require_once("lib/com/sergids/common/PHPNuke.php");
$module_name=PHPNuke::getModuleName();
if($module_name=="blocks"){ //we are inside a block
define("INCLUDE_PATH","../");
$tm_include='modules/'.$module_name.'/';
}else{
define("INSIDE_MOD",1);
define("MODULE_FILE",1);
define("INCLUDE_PATH","../../");
$tm_include='';
}
require_once(INCLUDE_PATH."config.php");
require_once(INCLUDE_PATH."db/db.php");
require_once($tm_include."lib/com/sergids/common/File.php");
require_once($tm_include."lib/com/sergids/topmusic/model/SongDAO.php");
require_once($tm_include."lib/com/sergids/topmusic/model/ConfigDAO.php");
require_once($tm_include."lib/com/sergids/topmusic/model/ConfigO.php");
$confDAO=new ConfigDAO($db,$prefix);
$config=$confDAO->load();
if($_SERVER['HTTP_REFERER']!="" && strpos($_SERVER['HTTP_REFERER'],$config->base_url)<0)
die("Invalid operation");
if($currentlang=="")
$currentlang=$confDAO->getNukeLanguage();
$songDAO=new SongDAO($db,$prefix);
$song=new SongO();
$song=$songDAO->getSong($_GET['idsong'],$currentlang);
$iniTitle=substr($song->track,0,4);
$extension=substr($song->track,-3);
header( "Content-type: text/xml" );
?>
<?php //<? xml version="1.0" encoding="UTF-8" ?>
<playlist version="1" xmlns="http://xspf.org/ns/0/">
<trackList>
<track><location><?php
if($iniTitle!="http"){
if($extension=="mp3"){
$url=$config->base_url."/modules/".$module_name."/getSongTrack.php?idsong=".$song->id;
if($_GET['type']!="")
$url=$url."&type=".$_GET['type'];
print($url);
}
}else
print $song->track;
?></location>
<annotation><?=$song->title?></annotation>
</track>
</trackList>
</playlist>