[Webbinder-commits] root/lib/categories categlib.php,1.3,1.4
Brought to you by:
jasondiceman,
sylvieg
|
From: Sylvie G. <sy...@us...> - 2006-07-06 16:48:43
|
Update of /cvsroot/webbinder/root/lib/categories In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv21886/lib/categories Modified Files: categlib.php Log Message: and betwen categ Index: categlib.php =================================================================== RCS file: /cvsroot/webbinder/root/lib/categories/categlib.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** categlib.php 14 Jun 2006 21:08:19 -0000 1.3 --- categlib.php 6 Jul 2006 15:59:58 -0000 1.4 *************** *** 272,279 **** } ! function list_category_objects($categId, $offset, $maxRecords, $sort_mode='pageName_asc', $type='', $find='', $deep=false) { // Build the condition to restrict which categories objects must be in to be returned. ! if (is_array($categId)) { $bindWhere = $categId; if ($deep) { --- 272,288 ---- } ! function list_category_objects($categId, $offset, $maxRecords, $sort_mode='pageName_asc', $type='', $find='', $deep=false, $and=false) { // Build the condition to restrict which categories objects must be in to be returned. ! $join = ''; ! if (is_array($categId) && $and) { ! $i = count($categId); ! $bindWhere = $categId; ! foreach ($categId as $c) { ! if (--$i) ! $join .= " INNER JOIN tiki_category_objects tco$i on (tco$i.`catObjectId`=o.`catObjectId` and tco$i.`categId`=?) "; ! } ! $where = ' AND c.`categId`=? '; ! } elseif (is_array($categId)) { $bindWhere = $categId; if ($deep) { *************** *** 368,372 **** } ! $query_cant = "SELECT c.*, o.*, count(u.`objectId`) as perms, $allowField as allow FROM `tiki_category_objects` c,`tiki_categorized_objects` o LEFT JOIN `users_objectpermissions` u ON u.`objectId`=MD5(".$this->db->concat("o.`type`","LOWER(o.`objId`)").") AND u.`objectType`=o.`type` WHERE c.`catObjectId`=o.`catObjectId` $where GROUP BY o.`type`, o.`objId` $sqlHaving"; $query = $query_cant . $orderBy; $result = $this->query($query,$bindVars,$maxRecords,$offset); --- 377,381 ---- } ! $query_cant = "SELECT c.*, o.*, count(u.`objectId`) as perms, $allowField as allow FROM `tiki_category_objects` c,`tiki_categorized_objects` o LEFT JOIN `users_objectpermissions` u ON u.`objectId`=MD5(".$this->db->concat("o.`type`","LOWER(o.`objId`)").") AND u.`objectType`=o.`type` $join WHERE c.`catObjectId`=o.`catObjectId` $where GROUP BY o.`type`, o.`objId` $sqlHaving"; $query = $query_cant . $orderBy; $result = $this->query($query,$bindVars,$maxRecords,$offset); |