1
McDonald
WF-Links 1.03: alphabetically ordering permission lists
  • 2006/1/22 20:53

  • McDonald

  • Home away from home

  • Posts: 1072

  • Since: 2005/8/15


The categories and links in the permission setting lists are ordered by category id-number.

$cat_form = new XoopsGroupPermForm( '', $xoopsModule -> getVar( 'mid' ), 'WFLinkCatPerm', _AM_WFL_PERM_CSELECTPERMISSIONS."<br />" );
$result = $xoopsDB -> query( "SELECT cid, pid, title FROM " . $xoopsDB -> prefix( WFLINKS_CAT ) );
if ( 
$xoopsDB -> getRowsNum( $result ) )
{
    while ( 
$cat_row = $xoopsDB -> fetcharray( $result ) )
    {
        
$cat_form -> addItem( $cat_row['cid'], $cat_row['title'], $cat_row['pid'] );
    } 
    echo 
$cat_form -> render();
} 
else
{
    echo 
"<div><b>" . _AM_WFL_PERM_CNOCATEGORY . "</b></div>";
} 
unset ( 
$cat_form );

etc. etc. etc.

How can I get these lists being displayed alphabetically?