sverhagen / mp3-browser

This Joomla plugin will create a table of every MP3 in a specified folder. It displays the ID3 information of each track with a link to download or play the file in the browser
https://www.totaalsoftware.com/products/mp3-browser
GNU General Public License v2.0
5 stars 6 forks source link

Adding Or Finding the list of available tags? #55

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I inserted this code into my mp3browser.php file

if ($musicTag->getConfiguration()->isShowLength()) {
        $column = new HtmlSimpleColumn("Date Recorded" /* column header */, "getYear");

I added this in order to get the date the mp3 file was recorded but it give me 
different dates. I simple need to chance getYear to something else. Where is 
this list of tags I can use?

Original issue reported on code.google.com by ptrista...@gmail.com on 18 Feb 2015 at 7:44

sverhagen commented 9 years ago

This is not how HtmlSimpleColumn works. The userFunction ("getYear" in your example) is meant to be a function on the $data that's passed to getCellText. This $data is of type MusicItem.

getYear is not an existing method on MusicItem. You could add it. The implementation of that method would pull the actual date/year from the ID3 tag information ($getId3FileInfo in MusicItem, and there's plenty of examples in MusicItem of how to access the ID3 tag information).

Look into the getid3/getid3/ folder to know which ID3 tag information may be available. You may want to look in module.tag.id3v....php.