diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-12-24 15:09:43 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-12-24 15:09:43 +0000 |
commit | cb7c2e09ed6f1ba12e8c277f1690576ea802bcb3 (patch) | |
tree | 8f183f0a5815a62c1d4c2b8d5033ec983dcdd2d7 /modules/taxonomy.module | |
parent | 4c06410d18cea85c4c26e5ccb27b75c33aa68340 (diff) | |
download | brdo-cb7c2e09ed6f1ba12e8c277f1690576ea802bcb3.tar.gz brdo-cb7c2e09ed6f1ba12e8c277f1690576ea802bcb3.tar.bz2 |
- Fixed the breadcrumb trail of nested forums. Patch by Goba.
Diffstat (limited to 'modules/taxonomy.module')
-rw-r--r-- | modules/taxonomy.module | 14 |
1 files changed, 14 insertions, 0 deletions
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) { |