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: albmgr.php changes so that the dropdown menu is sorted alphabetic  (Read 2354 times)

0 Members and 1 Guest are viewing this topic.

olafbecker

  • Coppermine newbie
  • Offline Offline
  • Posts: 2

This is the snip out of the albmgr.php what needs to be changed so that the data is sorted :


/**
 * alb_get_subcat_data()
 *
 * @param integer $parent
 * @param string $ident
 **/

// modified by Olaf Becker for beeing sorted alphabetic.
 
function alb_get_subcat_data($parent, $ident = '')
{
    global $CONFIG, $CAT_LIST;
 
    if ($CONFIG['categories_alpha_sort'] == 1) {
      $sort_query = 'name';
    } else {
      $sort_query = 'pos';
    }

 
    $result = cpg_db_query("SELECT cid, name, description " . " FROM {$CONFIG['TABLE_CATEGORIES']} " . " WHERE parent = '$parent' " . " AND CID != 1  ORDER BY $sort_query ");
 

    if (mysql_num_rows($result) > 0) {
        $rowset = cpg_db_fetch_rowset($result);
        foreach ($rowset as $subcat) {
            $CAT_LIST[] = array($subcat['cid'], $ident . $subcat['name']);
            alb_get_subcat_data($subcat['cid'], $ident . '   ');
        }
    }
}


If you needing any more or other help email me directly at obecker@teranet.de because i modify and reprogramm the hole modules right now to get out more performance and more features out of this product.

Olaf Becker

Logged
Pages: [1]   Go Up
 

Page created in 0.015 seconds with 19 queries.