Location: PHPKode > projects > Top Music module > Top Music 3.0.7/html/modules/topMusic/getAlbumXspf.php
<?php
require_once("lib/com/sergids/common/PHPNuke.php");
$module_name=PHPNuke::getModuleName(__FILE__);
if($module_name=="blocks"){ //we are inside a block
	$module_name="topMusic";
	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/AlbumDAO.php");
require_once($tm_include."lib/com/sergids/topmusic/model/ConfigDAO.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();
$albumDAO=new AlbumDAO($db,$prefix);
$album=$albumDAO->getAlbum($_GET['idalbum'],$currentlang);
$songDAO=new SongDAO($db,$prefix);
$songList=$songDAO->getSongList($_GET['idalbum'],$currentlang);
?>
<playlist version="1" xmlns="http://xspf.org/ns/0/">
<title><?=$album->title?></title>
<info>http://www.sergids.com/</info>
<annotation>Top Music Player</annotation>
    <trackList>
<?php
foreach($songList as $song){
	$iniTitle=substr($song->track,0,4);
	$extension=substr($song->track,-3);
	$player_extensions=array("MP3","FLV","SWF","JPG","PNG","GIF");
	if(in_array(strtoupper($extension),$player_extensions)){
	?>
	<track>
		<title><?=$song->title?></title>
		<creator><?=$song->artistname?></creator>
		<location><?php
				if($iniTitle!="http"){
					if($extension=="mp3")
						echo "modules/".$module_name."/getSongTrack.php?idsong=".$song->id;
				}else
					echo $song->track;
        ?></location>
        <image><?php
				if($album->frontcover_file!="")
					echo 'modules/'.$module_name.'/photos/albums/'.$album->frontcover_file;
				elseif($album->frontcover_url!="")
		         	echo $album->frontcover_url;
				else
				    echo 'modules/'.$module_name.'/photos/albums/no_cover.gif';
		?></image>
        <info><?=$config->base_url?>/modules.php?name=<?=$module_name?>&op=song&idartist=<?=$album->idartist?>&idalbum=<?=$album->id?>&idsong=<?=$song->id?></info>
		<identifier><?=$song->id?></identifier>
		<album><?=$album->title?></album>
		<meta rel="type">mp3</meta>
	</track>
<?}}?>
    </trackList>
</playlist>
Return current item: Top Music module