Minahito
minah****@users*****
2005年 12月 1日 (木) 01:22:08 JST
Index: xoops2jp/html/kernel/module.php diff -u xoops2jp/html/kernel/module.php:1.2.8.2 xoops2jp/html/kernel/module.php:1.2.8.3 --- xoops2jp/html/kernel/module.php:1.2.8.2 Thu Dec 1 00:58:32 2005 +++ xoops2jp/html/kernel/module.php Thu Dec 1 01:22:08 2005 @@ -1,5 +1,5 @@ <?php -// $Id: module.php,v 1.2.8.2 2005/11/30 15:58:32 minahito Exp $ +// $Id: module.php,v 1.2.8.3 2005/11/30 16:22:08 minahito Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -489,7 +489,14 @@ $sql = 'SELECT * FROM '.$this->db->prefix('modules'); if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { $sql .= ' '.$criteria->renderWhere(); - $sql .= ' ORDER BY weight '.$criteria->getOrder().', mid ASC'; + + if($criteria->getSort()!=null) { + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); + } + else { + $sql .= ' ORDER BY weight '.$criteria->getOrder().', mid ASC'; + } + $limit = $criteria->getLimit(); $start = $criteria->getStart(); }