Ejemplo n.º 1
0
function get_top_class_cat($nid)
{
    $sql = "select parent_id from " . $GLOBALS['ecs']->table('category') . " where cat_id = " . $nid . "";
    $temp_id = 0;
    $pid = $GLOBALS['db']->getOne($sql);
    if ($pid > 0) {
        $temp_id = get_top_class_cat($pid);
    } else {
        $temp_id = $nid;
    }
    return $temp_id;
}
Ejemplo n.º 2
0
function get_top_class_cat($nid)
{
    $sql = "select parent_id from " . $GLOBALS['ecs']->table("category") . " where cat_id = '" . $nid . "'";
    $temp_id = 0;
    $pid = $GLOBALS['db']->getOne($sql);
    if (0 < $pid) {
        $temp_id = get_top_class_cat($pid);
        return $temp_id;
    }
    $temp_id = $nid;
    return $temp_id;
}