Reverse Sort from File System
-
Opening caveat – I never recommend editing plugins directly, but when you have no other choice, that is what needs to be done.
When using this plugin and pulling files directly from the file system, there seems to be no way to reverse sort the list (Z – A)… which I am using to show the newest files (by date) in a playlist.
To overcome this limitation, you can edit the main.php file around line 952 to add this:
} //add this to reverse sort $TRACKS = array_reverse($TRACKS); return $TRACKS; }
just before the return. This will return your playlist from your file system in reverse order.
Also, in our case, the plugin uses a different version of jQuery than our theme, which causes conflicts and breaks the player completely. Either the theme or the plugin is not using jQuery.noConflict() so they do bump heads.
My fix for this (since I can’t alter this particular theme) is to again edit the plugin file /js/mp3-player-{your version}.js in 2 places:
once around line 574 :
//replace this //jQuery(this.eID.pos + j).off( 'click', MP3_JPLAYER.stopProp ); //with this jQuery(this.eID.pos + j).live( 'click', MP3_JPLAYER.stopProp );
and again around line 828:
//replace this //jQuery(this.eID.pos + j).on( 'click', MP3_JPLAYER.stopProp ); //with this jQuery(this.eID.pos + j).live( 'click', MP3_JPLAYER.stopProp );
this will fix the error and allow the player to work.
I think both of these issues could be fixed with the plugin by allowing the shortcode to allow sorting when using the file system, and also editing the JS to be more jQuery version agnostic.
Thanks!
- The topic ‘Reverse Sort from File System’ is closed to new replies.