Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Custom Sort Order of Image  (Read 4420 times)

0 Members and 1 Guest are viewing this topic.

Singular

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 95
    • A Singular Creation
Custom Sort Order of Image
« on: October 03, 2012, 02:46:28 am »

Hello all,

I used a Coppermine developer to help me with my gallery customizations of the last few years. I have not been able to contact him recently and need some help. One of the things that needs to be fixed is the sort order of images on the thumnail page. The way I need it to work is that the images in the users' personal galleries are ordered by sort order, then by date uploaded desc. I need the images in the public galleries to be displayed in order by newest, all the time. The public galleries can not be uploaded directly to. Users can upload to their personal gallery and to contest albums. They have the option to select public albums to be included to. That is a mod that my developer added for me. It is another way of linking to additional albums. So the public galleries include all images that were included from users' personal albums. Some of the images in those albums have been sorted in the personal albums. However, that should not affect the order that they are displayed in the public albums. Like I said above, images in public galleries should always be displayed by newest first. Currently, the sort order in the personal galleries is not displaying correctly.

Can anyone please help me? Not sure if a function has to be written to do this. I would really appreciate any assistance. Will pay if needed because of time involved.

all the best,
Joe

http://www.asingularcreation.com/Gallery/
Logged

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Re: Custom Sort Order of Image
« Reply #1 on: October 03, 2012, 05:20:27 am »

I'm not positive what you are asking for.
This will make the personal galleries show date descending, public galleries date ascending and will remove sort options.

In thumbnails.php
Find
Code: [Select]
    //show sort options only when not a meta album
    $js_sort_vars = array(
        'aid'           => $album,
        'page'          => $page,
        'sort_name'     => $lang_thumb_view['name'],
        'sort_title'    => $lang_common['title'],
        'sort_date'     => $lang_thumb_view['date'],
        'sort_position' => $lang_thumb_view['position'],
        'sort_ta'       => $lang_thumb_view['sort_ta'],
        'sort_td'       => $lang_thumb_view['sort_td'],
        'sort_na'       => $lang_thumb_view['sort_na'],
        'sort_nd'       => $lang_thumb_view['sort_nd'],
        'sort_da'       => $lang_thumb_view['sort_da'],
        'sort_dd'       => $lang_thumb_view['sort_dd'],
        'sort_pa'       => $lang_thumb_view['sort_pa'],
        'sort_pd'       => $lang_thumb_view['sort_pd']
    );
   
    set_js_var('sort_vars', $js_sort_vars);
    js_include('js/thumbnails.js');
Replace with
Code: [Select]
    if ($actual_cat > 10000) {
        $USER['sort'] = 'dd';
    } else {
        $USER['sort'] = 'da';
    }

    //show sort options only when not a meta album
    /*$js_sort_vars = array(
        'aid'           => $album,
        'page'          => $page,
        'sort_name'     => $lang_thumb_view['name'],
        'sort_title'    => $lang_common['title'],
        'sort_date'     => $lang_thumb_view['date'],
        'sort_position' => $lang_thumb_view['position'],
        'sort_ta'       => $lang_thumb_view['sort_ta'],
        'sort_td'       => $lang_thumb_view['sort_td'],
        'sort_na'       => $lang_thumb_view['sort_na'],
        'sort_nd'       => $lang_thumb_view['sort_nd'],
        'sort_da'       => $lang_thumb_view['sort_da'],
        'sort_dd'       => $lang_thumb_view['sort_dd'],
        'sort_pa'       => $lang_thumb_view['sort_pa'],
        'sort_pd'       => $lang_thumb_view['sort_pd']
    );
   
    set_js_var('sort_vars', $js_sort_vars);
    js_include('js/thumbnails.js');*/
Logged
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

Singular

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 95
    • A Singular Creation
Re: Custom Sort Order of Image
« Reply #2 on: October 04, 2012, 01:11:27 am »

Thanks so much for your reply. I appreciate your time. I should be more precise in what I am asking. I don't want there to be any sort options for the viewer. I want the images in the personal albums to always be ordered by sort order (the same way they are displayed in picmgr.php), then date descending. I wan't the images in the public galleries to always be ordered by date descending (newest first).

I hope that makes sense.

all the best,
Joe
Logged

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Re: Custom Sort Order of Image
« Reply #3 on: October 04, 2012, 01:33:06 am »

The code I posted removes the sortorder options and forces it to what you set in the if statement.

Change the dd to pa, the da to dd and make sure Default sort order for files is set to date descending.

Code: [Select]
    $CONFIG['default_sort_order'] = 'dd';
    if ($actual_cat > 10000) {
        $USER['sort'] = 'pa';
    } else {
        $USER['sort'] = 'dd';
    }

    //show sort options only when not a meta album
    /*$js_sort_vars = array(
        'aid'           => $album,
        'page'          => $page,
        'sort_name'     => $lang_thumb_view['name'],
        'sort_title'    => $lang_common['title'],
        'sort_date'     => $lang_thumb_view['date'],
        'sort_position' => $lang_thumb_view['position'],
        'sort_ta'       => $lang_thumb_view['sort_ta'],
        'sort_td'       => $lang_thumb_view['sort_td'],
        'sort_na'       => $lang_thumb_view['sort_na'],
        'sort_nd'       => $lang_thumb_view['sort_nd'],
        'sort_da'       => $lang_thumb_view['sort_da'],
        'sort_dd'       => $lang_thumb_view['sort_dd'],
        'sort_pa'       => $lang_thumb_view['sort_pa'],
        'sort_pd'       => $lang_thumb_view['sort_pd']
    );
   
    set_js_var('sort_vars', $js_sort_vars);
    js_include('js/thumbnails.js');*/
Logged
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

Singular

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 95
    • A Singular Creation
Re: Custom Sort Order of Image
« Reply #4 on: October 04, 2012, 03:57:01 am »

Thanks again. I tried what you recommended but it did not work. I think that there was probably a function written for my request that handled all of my gallery's customizations. I may have to hire someone to look at it, if I can not get a hold of Stramm.

Thanks again for your time.

To Stramm: If you see this post, could you please contact me. I would appreciate if you could let me know if you are or are not available any longer.

all the best,
Joe
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Custom Sort Order of Image
« Reply #5 on: October 04, 2012, 12:58:53 pm »

As Jeff's mod should work on stock Coppermine galleries, there's probably something that overwrites that code. Without knowing those modifications it's not possible to fix anything. However, Stramm still visits this board from time to time, so maybe he replies to this thread.
Logged

Singular

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 95
    • A Singular Creation
Re: Custom Sort Order of Image
« Reply #6 on: October 05, 2012, 01:54:00 am »

Thanks again for your reply. Stramm did email me and will be able to help me soon. I appreciate you guys taking the time to try to help me. Keep up the outstanding work.

all the best,
Joe
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 19 queries.