Image Order

Last post 08-11-2010, 5:12 AM by Kenneth. 6 replies.
Sort Posts: Previous Next
  •  08-02-2010, 2:55 PM 62952

    Image Order

       Is there a way so that the order of the images that appear in the gallery are by date/time stamp as opposed to the default order of image name?  I am using the slideshow layout.
     
    Thank you,
     
    Eldon
  •  08-03-2010, 3:44 AM 62999 in reply to 62952

    Re: Image Order

    Hi eldong,
     
    1. Open file "\CuteSoft_Client\Gallery\Layout\SlideShow\Code.js"
     
    2. Find section below
     
    div.appendChild(nobr);
     this.items=[];
     
    3. Add the section below under the section above
     
     function BubbleSort(arr)
     {
            var temp;
            var exchange;
            for(var i=0; i<arr.length; i++)
            {
                exchange = false;
                for(var j=arr.length-2; j>=i; j--)
                {
                    if(GalleryFormatTimeHTML(arr[j+1].Time) <GalleryFormatTimeHTML(arr[j].Time))
                    {
                        temp = arr[j+1];
                        arr[j+1] = arr[j];
                        arr[j] = temp;
                        exchange = true;
                    }
                }
                if(!exchange) break;
            }
            return arr;
         }
        photos=BubbleSort(photos);
     
    4. Like
     
    div.appendChild(nobr);
     this.items=[];
      function BubbleSort(arr)
     {
            var temp;
            var exchange;
            for(var i=0; i<arr.length; i++)
            {
                exchange = false;
                for(var j=arr.length-2; j>=i; j--)
                {
                    if(GalleryFormatTimeHTML(arr[j+1].Time) <GalleryFormatTimeHTML(arr[j].Time))
                    {
                        temp = arr[j+1];
                        arr[j+1] = arr[j];
                        arr[j] = temp;
                        exchange = true;
                    }
                }
                if(!exchange) break;
            }
            return arr;
         }
        photos=BubbleSort(photos);
     
    5. You can switch "<" to  ">" to change the order
     
    Regards,
     
    Ken
  •  08-03-2010, 11:45 AM 63028 in reply to 62999

    Re: Image Order

    Hi Ken,
     
    This did part of the trick.  It did sort the thumbnails, but the large pictures still are in the previous order.   So when I go to my page now, the fist picture that displays does not match the thumbmails.   Also, if I click on one of the thumbnails to view it, then click on next, it does not go to the next picture in the list, but the next one alphabetically, which leads to the thumbnails to scroll also.
     
    Does the sort need to happen in another location/file also?
     
    Eldon
  •  08-03-2010, 9:14 PM 63048 in reply to 63028

    Re: Image Order

    Hi eldong,
     
    Try this way
     
    1. Open file "\CuteSoft_Client\Gallery\Layout\SlideShow\Code.js"
     
    2. Add the method below to the top of the page above
     
    function BubbleSort(arr)
     {
            var temp;
            var exchange;
            for(var i=0; i<arr.length; i++)
            {
                exchange = false;
                for(var j=arr.length-2; j>=i; j--)
                {
                    if(GalleryFormatTimeHTML(arr[j+1].Time) <GalleryFormatTimeHTML(arr[j].Time))
                    {
                        temp = arr[j+1];
                        arr[j+1] = arr[j];
                        arr[j] = temp;
                        exchange = true;
                    }
                }
                if(!exchange) break;
            }
            return arr;
         }
     
    3. Fine section below (line 113)
     
     var photos=[];
      for(var i=0;i<this._categories.length;i++)
      {
       photos=photos.concat(this._categories[i].Photos);
      }
     
    4. Add the section below under the section above
     
    photos=BubbleSort(photos);
     
    5. Fine section below (line 178)
     
    div.appendChild(nobr);
     this.items=[];
     
    6. Add the section below under the section above
     
    photos=BubbleSort(photos);
     
    7. Find section below (line 555)
     
    if(photos.length==0)
      return null;
     
    8. Add the section below under the section above
     
    photos=BubbleSort(photos);
     
    Regards,
     
    Ken
  •  08-04-2010, 9:33 AM 63078 in reply to 63048

    Re: Image Order

    That did it!
     
    Thank you.
  •  08-06-2010, 8:38 AM 63176 in reply to 63078

    Re: Image Order

    Ken,
     
    Found one more issue with the sorting - now when a user clicks on "Show Slider" the pictures are displaying in alpha order.  Where can I put that bubble sort to change that?
     
    Also, is it possible to change just the text "Show Slider" to "Full Screen"?
     
    Thank you,
     
    Eldon
  •  08-11-2010, 5:12 AM 63319 in reply to 63176

    Re: Image Order

    Hi eldong,
     
    Have you miss steps 7 and 8? it will sort the photos in full screen mode.
     
    And please send me a screenshot to show which text you want to change.
     
     
    Regards,
     
    ken
View as RSS news feed in XML