Tuesday, 22 January 2008

New Classes, DOCman issues and MP3 Gallery solution

The new quarter for my Masters program here in Sweden has started and this quarter seems to be hella tough! The course R&D Strategy seems to be the toughest amongst all of the MEI program courses! Apart from that I implemented a sweet embedded MP3 player using flash and php on my customer's website. I used the free Jooma extension called Mp3 gallery and modified its code a little to suit my requirements. The problem I was facing was that there were multiple types of files inside the DOCman upload folder and I only wanted to filter it to mp3 files for the mp3 gallery plugin because at its default settings, it reads and lists all the files inside the DOCman uploads folder and even tries to add zip files and txt files to its playlist which basically sucks! So here is the modification in line 40 of the mod_mp3gallery_playlister.php file add the following code

$ext = substr($file, strrpos($file, '.') + 1);

Replace the if-statement below this line to this one

if (($filetype == "file") && ($ext=="mp3")) {

and now change the default folder $dir = "your DOCman uploads folder";
where of course you specify the path for your uploads folder, by default it is dmdocuments/
Another thing is that you might want to remove the .htaccess file in that folder (the docman uploads folder) if you want the files to be played because otherwise they won't!

2 comments:

Greg FitzPatrick said...

How does one get in touch with you?

Greg FitzPatrick

greg@shortlist.se

Umar said...

I just sent you an email at greg@shortlist.se

Cheers!