Ignore:
Timestamp:
Mar 30, 2006 10:40:42 PM (18 years ago)
Author:
scdev
Message:

Q: added truncate() function. added padding-top to forms in the admin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.1dev/lib/NodeHeirarchy.inc.php

    r76 r77  
    347347     * @return string   The parents as an array of serialized node identifiers.
    348348     */
    349     function getParents($child_type=null, $child_id=null)
     349    function getParents($child_type=null, $child_id=null, $type_constraint=null, $order='')
    350350    {
    351351        if (!isset($child_type) || !isset($child_id)) {
     
    357357                return false;
    358358            }
     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)) . "')";
    359367        }
    360368
    361369        $qid = dbQuery("
    362370            SELECT parent_type, parent_id
    363             FROM node_tbl 
     371            FROM node_tbl
    364372            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) . "
    366376        ");
    367377       
Note: See TracChangeset for help on using the changeset viewer.