Sort Personal Galleries by Date Updated Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.
3 posters

    Sort Personal Galleries by Date Updated

    DesignersSociety
    DesignersSociety
    Forumember


    Female Posts : 146
    Reputation : 3
    Language : english

    In progress Sort Personal Galleries by Date Updated

    Post by DesignersSociety April 8th 2015, 4:33 am

    Alright so is there a way to set it to show the personal galleries in order of most recently updated. It shows the dates they were updated so I'm assuming that means theres a way to do this. I want to have it newest at the top. Heres a link to the page: http://www.designerssociety.net/gallery/personal.htm
    Heres a guest account: username: guestaccount pass:guestpass123
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51556
    Reputation : 3519
    Language : English
    Location : United States

    In progress Re: Sort Personal Galleries by Date Updated

    Post by SLGray April 8th 2015, 7:45 am

    Administration Panel > Modules > Gallery > Display
    How do you have these options set -

    Default Sort Method:
    Default Sort Order:



    Sort Personal Galleries by Date Updated Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.
    DesignersSociety
    DesignersSociety
    Forumember


    Female Posts : 146
    Reputation : 3
    Language : english

    In progress Re: Sort Personal Galleries by Date Updated

    Post by DesignersSociety April 8th 2015, 6:54 pm

    @SLGray I've already gone into that and had them all set by posted and descending. That only sorts the actual images themselves, not the order of the personal albums, which go by name.
    DesignersSociety
    DesignersSociety
    Forumember


    Female Posts : 146
    Reputation : 3
    Language : english

    In progress Re: Sort Personal Galleries by Date Updated

    Post by DesignersSociety April 12th 2015, 10:46 pm

    Bump
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13246
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    In progress Re: Sort Personal Galleries by Date Updated

    Post by Ange Tuteur April 13th 2015, 12:43 am

    @DesignersSociety I wrote a small script to attempt sorting the personal galleries by date. Go to Administration Panel > Modules > JavaScript codes management > Create a new script

    Placement : In all the pages
    Code:
    /\/gallery\/personal/.test(window.location.pathname) && $(function() {
      var a = [], b = [], c = document.getElementsByTagName('TD'), d, i = 0, j = c.length, k, o = {};
     
      for (; i<j; i++) {
        if (c[i].onmouseover) {
          d = +new Date(c[i].getElementsByTagName('TR')[2].innerHTML.replace(/<.*?>|\d+&nbsp;pic/g,''));
          o[d] = c[i].innerHTML;
          a.push(d);
          b.push(c[i]);
        }
      }
     
      a.sort(function(d1, d2) { return d1 > d2 ? 1 : -1 });
     
      for (i = 0, j = a.length; i<j; i++) b[i].innerHTML = o[a[i]];
    });

    I only had 3 personal galleries while testing this, so let me know if anything goes wrong.

    See you bye