Manual

structure functions

getpath($cid,$table,$reverse=false) {#getpath}

return array of cids to root

getfirsttype($table,$data) {#getfirsttype}

find first type cid

{{lang:php}}
$d = get_path($data['cid'],'articles_categories',true);
$type = get_first_type('articles_types',$d);

getparents($DB,$cid,$table) {#getparents}

Gets all parent categories (recursive) up to the root.

getchilds($DB,$cid,$table) {#getchilds}

Gets all subcategories (recursive) according to parent cid.

getroot($DB,$cid,$table) {#getroot}

Gets pid of root category according to any cid.

Try myPortal 2: