You are here

function _custom_search_i18n_term_depth in Custom Search 6

Same name and namespace in other branches
  1. 7 modules/custom_search_i18n/custom_search_i18n.module \_custom_search_i18n_term_depth()
1 call to _custom_search_i18n_term_depth()
custom_search_i18n_form_alter in modules/custom_search_i18n/custom_search_i18n.module
Implementation of hook_form_alter().

File

modules/custom_search_i18n/custom_search_i18n.module, line 250
Brings Internationalization to Custom Search

Code

function _custom_search_i18n_term_depth($tid) {
  $limit = 99;
  $depth = 0;
  while ($parent = db_result(db_query("SELECT parent FROM {term_hierarchy} WHERE tid=%d", $tid))) {
    $depth++;
    $tid = $parent;
    if ($depth > $limit) {
      break;
    }
  }
  return $depth;
}