News:

CPG Release 1.6.31
Minor maintenance release
Clean up remaining remnants of the .net CPG website
Improved installer_stub compatibility with various server configurations

Main Menu

Dropdown sortorder menu with lang configs

Started by Sweetener, October 20, 2019, 05:51:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Sweetener

I was looking through the forum and I found this https://coppermine-gallery.com/forum/index.php?topic=69704.0

Sadly, I get this (check ss.png file) with just {TITLE} and not Title or Order by Title

Is there anyway to put $lang_thumb_view['sort_ta'] (and the other ones) into that code in the theme.php?

Sweetener

Also the {PAGE} doesn't put the page number on the link

ron4mac

Look at my respond theme for how it might be done. I did it there (though I don't remember the details).
https://coppermine-gallery.com/forum/index.php/topic,79594.msg385872.html#msg385872

Sweetener

Quote from: ron4mac on October 20, 2019, 10:14:24 PM
Look at my respond theme for how it might be done. I did it there (though I don't remember the details).
https://coppermine-gallery.com/forum/index.php/topic,79594.msg385872.html#msg385872

yes I found your theme too. Sadly I don't know/understand how to put your code into my theme, because I went through the theme.php and everything seemed so confusing


ron4mac

You need to include the sorting javascript functions from the respond theme somewhere in yours.

// thumbnail sort selection
function sort_go_page (sbd) {
wloc = 'thumbnails.php?album='
+ js_vars.sort_vars.aid
+ '&page='
+ js_vars.sort_vars.page
+ '&sort=' + sbd;
window.location = wloc;
}
function sort_sel_sbd (elm) {
sort_go_page(elm.value);
}
function sort_sel_val (elm) {
sort_go_page(elm.value + js_vars.h5r_sort.charAt(1));
}
function sort_sel_dir (elm) {
sort_go_page(js_vars.h5r_sort.charAt(0) + elm.getAttribute("data-dir"));
}


Sweetener

Quote from: ron4mac on October 20, 2019, 11:36:04 PM
You need to include the sorting javascript functions from the respond theme somewhere in yours.

// thumbnail sort selection
function sort_go_page (sbd) {
wloc = 'thumbnails.php?album='
+ js_vars.sort_vars.aid
+ '&page='
+ js_vars.sort_vars.page
+ '&sort=' + sbd;
window.location = wloc;
}
function sort_sel_sbd (elm) {
sort_go_page(elm.value);
}
function sort_sel_val (elm) {
sort_go_page(elm.value + js_vars.h5r_sort.charAt(1));
}
function sort_sel_dir (elm) {
sort_go_page(js_vars.h5r_sort.charAt(0) + elm.getAttribute("data-dir"));
}


Thank you so so much it worked!!!! Just one last question, is there anyway to put the option "Order by" instead of the selected option?
What I mean is that they will have the Order by when they open the album for the very first time

Sweetener

Quote from: ron4mac on October 20, 2019, 11:36:04 PM
You need to include the sorting javascript functions from the respond theme somewhere in yours.

When I select the option it doesn't show the selection in the menu...  :( I mean the get ordered but the option stays as File Name up

ron4mac

Make sure the theme_display_thumbnails function in your theme.php has $USER declared in its globals.

Sweetener

Quote from: ron4mac on October 21, 2019, 04:12:13 AM
Make sure the theme_display_thumbnails function in your theme.php has $USER declared in its globals.
I can't be more thankful for all your help. Thank you so much