[Webbinder-commits] root/lib/categories categlib.php,1.2,1.3
Brought to you by:
jasondiceman,
sylvieg
|
From: Sylvie G. <sy...@us...> - 2006-06-14 21:08:26
|
Update of /cvsroot/webbinder/root/lib/categories In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv5549/lib/categories Modified Files: categlib.php Log Message: can give a list of parentIds to category browse: parentId[]=1&parentId[]=2 Index: categlib.php =================================================================== RCS file: /cvsroot/webbinder/root/lib/categories/categlib.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** categlib.php 1 Sep 2005 11:02:08 -0000 1.2 --- categlib.php 14 Jun 2006 21:08:19 -0000 1.3 *************** *** 275,285 **** // Build the condition to restrict which categories objects must be in to be returned. ! if ($deep) { ! $bindWhere = $this->get_category_descendants($categId); ! $bindWhere[] = $categId; ! $where = " AND c.`categId` IN (".str_repeat("?,",count($bindWhere)-1)."?)"; } else { ! $bindWhere = array($categId); ! $where = ' AND c.`categId`=? '; } --- 275,295 ---- // Build the condition to restrict which categories objects must be in to be returned. ! if (is_array($categId)) { ! $bindWhere = $categId; ! if ($deep) { ! foreach ($categId as $c) { ! $bindWhere = array_merge($bindWhere, $this->get_category_descendants($c)); ! } ! } ! $where = " AND c.`categId` IN (".str_repeat("?,",count($bindWhere)-1)."?)"; } else { ! if ($deep) { ! $bindWhere = $this->get_category_descendants($categId); ! $bindWhere[] = $categId; ! $where = " AND c.`categId` IN (".str_repeat("?,",count($bindWhere)-1)."?)"; ! } else { ! $bindWhere = array($categId); ! $where = ' AND c.`categId`=? '; ! } } |