DrupalBin
Submit Code
About
Recent Posts
float?
2 hours 5 min
ago
views handler
5 hours 36 min
ago
Code
5 hours 51 min
ago
Code
5 hours 53 min
ago
more
Tags
CCK
drupal
fapi
jquery
menu
module
Panels
php
simpletest
test
theme
views
more tags
User login
Log in using OpenID:
What is OpenID?
Username:
*
Password:
*
Create new account
Request new password
Log in using OpenID
Cancel OpenID login
Home
Function to retrieve a certain level from a vocabulary
View
Download
Fix
June 25, 2008 - 7:27am —
Wim Leers
function
taxonomy_get_level
(
$vid
,
$level
)
{
static
$levels
;
if
(
!
isset
(
$levels
[
$vid
]
[
$level
]
)
)
{
$tree
=
taxonomy_get_tree
(
$vid
)
;
foreach
(
$tree
as
$term
)
{
if
(
$term
->
depth
==
$level
-
1
)
{
$levels
[
$vid
]
[
$level
]
[
$term
->
tid
]
=
$term
->
name
;
}
}
}
return
$levels
[
$vid
]
[
$level
]
;
}
taxonomy