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: albmgr.php changes so that the dropdown menu is sorted alphabetic  (Read 2128 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.014 seconds with 19 queries.