Minahito
minah****@users*****
2006年 1月 14日 (土) 03:24:57 JST
Index: xoops2jp/html/modules/base/kernel/handler.php diff -u xoops2jp/html/modules/base/kernel/handler.php:1.1.2.8 xoops2jp/html/modules/base/kernel/handler.php:1.1.2.9 --- xoops2jp/html/modules/base/kernel/handler.php:1.1.2.8 Sat Jan 14 03:17:39 2006 +++ xoops2jp/html/modules/base/kernel/handler.php Sat Jan 14 03:24:57 2006 @@ -105,27 +105,24 @@ { $ret = array(); + $sql="SELECT COUNT(*) c FROM " . $this->mTable; + if($criteria !== null && is_a($criteria, 'CriteriaElement')) { $where = $criteria->render(); - return $this->_getCount($where); - } - else { - return $this->_getCount($criteria); + if ($where) { + $sql .= " WHERE " . $where; + } } + + return $this->_getCount($sql); } /** * @access private */ - function _getCount($where = null) + function _getCount($sql = null) { - $sql="SELECT COUNT(*) c FROM " . $this->mTable; - - if ($where) { - $sql .= " WHERE " . $sql; - } - $result=$this->db->query($sql); if (!$result) {