Ejemplo n.º 1
0
function links_path($id)
{
    global $set, $db, $apx, $user;
    $id = (int) $id;
    if (!$id) {
        return array();
    }
    require_once BASEDIR . 'lib/class.recursivetree.php';
    $tree = new RecursiveTree(PRE . '_links_cat', 'id');
    $data = $tree->getPathTo(array('title'), $id);
    if (!count($data)) {
        return array();
    }
    foreach ($data as $res) {
        ++$i;
        $pathdata[$i]['TITLE'] = $res['title'];
        $pathdata[$i]['LINK'] = mklink('links.php?catid=' . $res['id'], 'links,' . $res['id'] . ',1' . urlformat($res['title']) . '.html');
    }
    return $pathdata;
}