albmgr.php changes so that the dropdown menu is sorted alphabetic albmgr.php changes so that the dropdown menu is sorted alphabetic
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

albmgr.php changes so that the dropdown menu is sorted alphabetic

Started by olafbecker, June 26, 2006, 10:19:10 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

olafbecker

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