From cb7c2e09ed6f1ba12e8c277f1690576ea802bcb3 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 24 Dec 2003 15:09:43 +0000 Subject: - Fixed the breadcrumb trail of nested forums. Patch by Goba. --- modules/taxonomy.module | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'modules/taxonomy.module') diff --git a/modules/taxonomy.module b/modules/taxonomy.module index b60fd1c89..5bed8bb16 100644 --- a/modules/taxonomy.module +++ b/modules/taxonomy.module @@ -437,6 +437,20 @@ function taxonomy_get_parents($tid, $key = "tid") { } } +// Gets all parents, parents of parents, etc. +function taxonomy_get_parents_all($tid, $key = "tid") { + $parents = array(); + if ($tid) { + $parents[] = taxonomy_get_term($tid); + $n = 0; + while ($parent = taxonomy_get_parents($parents[$n]->tid)) { + $parents = array_merge($parents, $parent); + $n++; + } + } + return $parents; +} + // hierarchy: get children function taxonomy_get_children($tid, $vid = 0, $key = "tid") { if ($vid) { -- cgit v1.2.3