DrupalBin
Submit Code
About
Recent Posts
css path
53 min 28 sec
ago
Fix for Code
4 hours 53 min
ago
Fix for Code
4 hours 59 min
ago
Fix for Code
5 hours 7 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
Fix for Function to retrieve a certain level from a vocabulary
View
Download
Fix
This fix will not be saved to the database until you submit.
Summary:
Tags:
Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Source code:
*
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]; }
Syntax highlighting mode:
ActionScript
ColdFusion
Diff
Drupal
Drupal 5
Drupal 6
HTML
Javascript
MySQL
PHP
Python
robots.txt
SQL
Text
Select the syntax highlighting mode to use.