forum.coppermine-gallery.net

No Support => Feature requests => Topic started by: JasonB on July 17, 2005, 04:44:24 pm

Title: Re-indexing of Albums / Categories (or Admin Tools alphabetical sorting).
Post by: JasonB on July 17, 2005, 04:44:24 pm
This is a bit of a problem.  When you use the Admin Tools to perform a function on an album, you get the list presented to you in the order in which the albums / categories were created in the database, not in an alphabetical order.  Even in the new 1.4.1 beta, if you tell it to alphabetically sort albums and categories, it only does so in the display of the albums and the presentation of the Category Manager.  If you use the Admin Tools utility, despite all alphabetical sorting, you get everything presented to you in database creation order.  The larger your gallery, the harder it is to locate the album you want to deal with.

It would be very useful if there were a "reindex" function, so that the order of albums / categories could be maintaiined in the database in the same physical order as it is logically - or, probably even simpler, just have the list of albums in Admin Tools sorted alphabetically as it is in the Batch Add Files function when you go to select an album.
Title: Re: Re-indexing of Albums / Categories (or Admin Tools alphabetical sorting).
Post by: RatKing on July 22, 2005, 04:11:18 pm
Ok, here is the quick and dirty solution.

In albmgr.php look for the following code:
Code: [Select]
if (GALLERY_ADMIN_MODE) {
    $result = db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category = $cat ORDER BY pos ASC");
} elseif (USER_ADMIN_MODE) {
    $result = db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category = " . (USER_ID + FIRST_USER_CAT) . " ORDER BY pos ASC");

Replace with:
Code: [Select]
if (GALLERY_ADMIN_MODE) {
    $result = db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category = $cat ORDER BY title ASC");
} elseif (USER_ADMIN_MODE) {
    $result = db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category = " . (USER_ID + FIRST_USER_CAT) . " ORDER BY title ASC");

Ugly dirty bad all round but I didn't feel like making a full fletched mod for this one as it is to minor and will most likely only be set once in an admins life time anyway.
Title: Re: Re-indexing of Albums / Categories (or Admin Tools alphabetical sorting).
Post by: JasonB on July 22, 2005, 07:59:27 pm
Excellent.  Thank you!

(I still think that something like this should make it into the default code, but I'm happy with this for now.)
Title: Re: Re-indexing of Albums / Categories (or Admin Tools alphabetical sorting).
Post by: RatKing on July 22, 2005, 09:43:17 pm
I think if the option is in the beta it will make it in the main stream code in the very next release. The fact that it is not working is just what the beta is meant for to find those kinds of bugs and kill them before a release is done.  ;)
Title: Re: Re-indexing of Albums / Categories (or Admin Tools alphabetical sorting).
Post by: Joachim Müller on July 23, 2005, 01:24:02 pm
FrogFoot's advanced album sorting mod needs to be applied to the album dropdown in util.php as well. Volunteers welcome.
Title: Re: Re-indexing of Albums / Categories (or Admin Tools alphabetical sorting).
Post by: RatKing on July 25, 2005, 01:32:37 pm
GauGau - Drop me a IM with some more information on what exactly you mean by that and I should be able to make that work in a few days...
Title: Re: Re-indexing of Albums / Categories (or Admin Tools alphabetical sorting).
Post by: RatKing on July 25, 2005, 01:36:26 pm
GauGau - Drop me a IM with some more information on what exactly you mean by that and I should be able to make that work in a few days...
Title: Sorting albums & categories in Admin Tools
Post by: treehstn on August 02, 2008, 11:17:15 pm
I've been searching for most of the day in the forum trying to figure out if there is anything new about the issue originally discussed in the following thread.  I've searched in index.php, admin.php, albmgr.php for any references to sorting that I could update to "title" and no changes that I've made seem to work.  I haven't found any mods/hacks that work for 1.4.18.

http://forum.coppermine-gallery.net/index.php/topic,19911.0.html

Title: Re: Sorting albums & categories in Admin Tools
Post by: Joachim Müller on August 03, 2008, 11:44:32 am
I already posted in that thread what needs to be done. Since nobody replied there, reporting that he did what needs to be done, it has probably never been accomplished, so you have to live with what you have right now.
Merged.
Title: Re: Re-indexing of Albums / Categories (or Admin Tools alphabetical sorting).
Post by: boysmakesh.com on November 15, 2008, 02:45:34 am
Ok, here is the quick and dirty solution.

In albmgr.php look for the following code:
Code: [Select]
if (GALLERY_ADMIN_MODE) {
    $result = db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category = $cat ORDER BY pos ASC");
} elseif (USER_ADMIN_MODE) {
    $result = db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category = " . (USER_ID + FIRST_USER_CAT) . " ORDER BY pos ASC");

Replace with:
Code: [Select]
if (GALLERY_ADMIN_MODE) {
    $result = db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category = $cat ORDER BY title ASC");
} elseif (USER_ADMIN_MODE) {
    $result = db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category = " . (USER_ID + FIRST_USER_CAT) . " ORDER BY title ASC");

Ugly dirty bad all round but I didn't feel like making a full fletched mod for this one as it is to minor and will most likely only be set once in an admins life time anyway.


when i used this code i get error and my album manager never displayed.i compared with my original file and i found that
 $result = cpg_db_query("SELECT ..... instead of wat u gave
$result = db_query("SELECT ......


Whether this change is related to database?or this due to the version of cpg?

Title: Re: Re-indexing of Albums / Categories (or Admin Tools alphabetical sorting).
Post by: Joachim Müller on November 15, 2008, 12:01:27 pm
NO SUPPORT in FEATURE REQUESTS (http://forum.coppermine-gallery.net/index.php/topic,15866.0.html). Locking.