Changeset 77 for branches/1.1dev/lib/NodeHeirarchy.inc.php
- Timestamp:
- Mar 30, 2006 10:40:42 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.1dev/lib/NodeHeirarchy.inc.php
r76 r77 347 347 * @return string The parents as an array of serialized node identifiers. 348 348 */ 349 function getParents($child_type=null, $child_id=null )349 function getParents($child_type=null, $child_id=null, $type_constraint=null, $order='') 350 350 { 351 351 if (!isset($child_type) || !isset($child_id)) { … … 357 357 return false; 358 358 } 359 } 360 361 $in_clause = ''; 362 if (isset($type_constraint)) { 363 if (!is_array($type_constraint)) { 364 $type_constraint = array($type_constraint); 365 } 366 $in_clause = "AND parent_type IN ('" . join("','", array_map('addslashes', $type_constraint)) . "')"; 359 367 } 360 368 361 369 $qid = dbQuery(" 362 370 SELECT parent_type, parent_id 363 FROM node_tbl 371 FROM node_tbl 364 372 WHERE child_type = '" . addslashes($child_type) . "' 365 AND child_id = '" . addslashes($child_id) . "' 373 AND child_id = '" . addslashes($child_id) . "' 374 $in_clause 375 " . addslashes($order) . " 366 376 "); 367 377
Note: See TracChangeset
for help on using the changeset viewer.