|
|
View image galleries Choose one of the sub-categories below:
|
|
Odtwarzacz mp3 |
|
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
global $mosConfig_live_site, $database;
$query = "SELECT a.id"
. "\n FROM #__components AS a"
. "\n WHERE a.option = 'com_mp3player'"
;
$database->setQuery( $query );
$id = $database->loadResult();
$component = new mosComponent( $database );
$component->load( $id );
$params =& new mosParameters( $component->params );
$playlistfile = $params->get('playlistfile', 'cache/mp3playlist.xml');
if($playlistfile == "cache/mp3playlist.xml")
createPlaylist("cache/mp3playlist.xml", $params);
?>
function createPlaylist($file, &$params)
{
global $database, $mosConfig_absolute_path;
$database->SetQuery("SELECT * FROM #__mp3player ORDER BY ordering");
$rows = $database->loadObjectList();
$playlist = "\n";
$playlist .= "get('showDisplay', 'yes') . "\" showPlaylist=\"" . $params->get('showPlaylist', 'no') . "\" autoStart=\"" . $params->get('autoStart', 'yes') . "\">";
foreach($rows as $row)
{
$playlist .= "mp3_filename . "\" title=\"" . $row->mp3_title . "\" />\n";
}
$playlist .= "";
$thefile = fopen($mosConfig_absolute_path . "/" . $file, "w+");
fwrite($thefile, $playlist);
fclose($thefile);
}
?> |
|