The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Sort by file date (9 posts)

  1. wik
    Posted 4 years ago #

    Hi there,

    I'm using the mp3j-ui widget.
    In the 'More options' side there is a 'Playlist the tracks in alphabetical order' checkbox. I have this unchecked, but the playlist appears in alphabetical order.

    There is an option to change the order of the playlist? For example to file date (it's the uploaded order) with the last file on top.

    You can see this at the bottom of right sidebar http://rxi.cat/



  2. DavidBrugge
    Posted 4 years ago #

    Yes, I too need a way to sort a playlist by date (latest on top as well)
    We anxiously await your reply.

  3. wik
    Posted 4 years ago #

    Hey David, Simon answered me to my mail:

    Hi Pau,
    yes there is but it's only in my development version at the moment! Let me know if you'd like to try it out (v1.8beta) and i'll send it over (you can sort library files a few different ways with it)

    ps. the alpha order option is a bit weird in 1.7.3, as it's also the default (and sometimes the only way files can be ordered) it was more of an over-ride function but it wasn't obvious!

    You can write him to sinomward at yahoo dot co dot uk
    So maybe I can mark it as resolved..

    What I did (with 1.7.3) is write numbers on the file name (like "42 Cesk Freixas - Que no et falli mai la sort.mp3"), and then not showing this number with PHP. Quite anoying but not too much.


  4. Frutke
    Posted 3 years ago #

    In version 1.7.3 with the Playlist the tracks in alphabetical order option enabled, the default sorting looks like this (when using the [mp3-jplayer tracks="FEED:LIB"] shortcode):

    1. 07-15-2012
    2. 07-16-2012
    3. 07-17-2012

    Dandy. But I needed the reverse order (with the most recent date at the top).

    I emailed Simon regarding 1.8beta too, but in the meantime, I just edited mp3j_main.php to reverse the default sorting order (which suits my needs perfectly).

    I added the following line to mp3j_main.php at line 690 (just before the $theTrackLists array is built):
    $indexorder = array_reverse($indexorder);

    Now, I get this in the playlist:

    1. 07-17-2012
    2. 07-16-2012
    3. 07-15-2012


  5. womynaloud
    Posted 3 years ago #


    I have tried to find where in my mp3j_main.php to put that line of code. I looked at line 690, but the $theTrackLists array isn't right after that. I admit i am a novice at editing code, so if you could give me a little better clue, i would certainly appreciate it! using version 1.7.3

  6. Frutke
    Posted 3 years ago #

    Hmm... interesting, womynaloud. Here's the edit I made in context. Perhaps that will help you to locate it.

    else {
    		foreach ( $theAssembledMeta['titles'] as $kt => $vt ) {
    			$indexorder[$x++] = $kt;
    $indexorder = array_reverse($indexorder);
    $theTrackLists = array(	'artists' => $theAssembledMeta['artists'],
    						'titles' => $theAssembledMeta['titles'],
    						'files' => $theAssembledMeta['files'],
    						'order' => $indexorder );
    return $theTrackLists;
  7. womynaloud
    Posted 3 years ago #

    that is where i put the code the first time and it didn't work. worked this time. it is perfect. thanks

  8. Frutke
    Posted 3 years ago #

    I forgot to mention that to make it work, it is also imperative that you hold your mouth precisely like this:

  9. womynaloud
    Posted 3 years ago #

    that must have been my problem the first time!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic


No tags yet.