<?php
require_once("lib/com/sergids/common/PHPNuke.php");
$module_name=PHPNuke::getModuleName();
if($type=="block"){ //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");
$configDAO=new ConfigDAO($db,$prefix);
$config=$configDAO->load();
if($_SERVER['HTTP_REFERER']!="" && strpos($_SERVER['HTTP_REFERER'],$config->base_url)<0)
die("Invalid operation");
if($currentlang=="")
$currentlang=$configDAO->getNukeLanguage();
$songDAO=new SongDAO($db,$prefix);
$song=new SongO();
$song=$songDAO->getSong($_GET['idsong'],$currentlang);
$iniTitle=substr($song->track,0,4);
if($iniTitle!="http"){
File::getFile(dirname(__FILE__)."/tracks/".$song->track,false);
}else{
File::getUrl($song->getTrack(),false);
}
?>