Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Sort order pull down list when uploading an image  (Read 6249 times)

0 Members and 1 Guest are viewing this topic.

Peter R

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 26
Sort order pull down list when uploading an image
« on: December 18, 2008, 10:04:22 pm »

I have read that hacks should be posted in the appropriate board, so I did. This one is so simple, that calling it a hack is maybe to much. While uploading an image, you get a pull down list from all the categories and albums you can post the image in. I would think, the order of this list is the same as the order of the categories list, but that is not the case, but I wanted it to be like this. I am using version 1.4.19
For making this happen:

In upload.php, line 225
Change:
Code: [Select]
    $listArray = array_csort($listArray,'cat','title');To:
Code: [Select]
    $listArray = array_csort($listArray,'pos','title');
In upload.php, line 220
Under:
Code: [Select]
        $listArray[$list_count]['title'] = $album['title'];
Add:
Code: [Select]
        $listArray[$list_count]['pos'] = $vRes['pos'];
In upload.php, line 209
Change:
Code: [Select]
        $vQuery = "SELECT cat.name FROM " . $CONFIG['TABLE_CATEGORIES'] . " cat, " . $CONFIG['TABLE_ALBUMS'] . " alb WHERE alb.aid='" . $album_id . "' AND cat.cid=alb.category";To:
Code: [Select]
        $vQuery = "SELECT cat.name, cat.pos FROM " . $CONFIG['TABLE_CATEGORIES'] . " cat, " . $CONFIG['TABLE_ALBUMS'] . " alb WHERE alb.aid='" . $album_id . "' AND cat.cid=alb.category";
« Last Edit: December 20, 2008, 11:20:42 am by Joachim Müller »
Logged
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 19 queries.