Código PHP:
if(isset($data['SONGHISTORY']['SONG']['TITLE'])) {
$tmp_data = $data['SONGHISTORY'];
} else {
$tmp_data = $data['SONGHISTORY']['SONG'];
}
$song_history = array();
foreach ( (array)$tmp_data as $song )
{
$song_history[] = array (
"TIMESTAMP" => intval ($song['PLAYEDAT']),
"TITLE" => $song['TITLE']
);
}
$this->vars['SONG_HISTORY'] = $song_history;
if ( $s->admin_mode() )
{
$str_history = '';
foreach ( $s->get('SONG_HISTORY') as $song )
$str_history .= '<br>' . $song['TITLE'] ;
printf ($str_history);
}