-
-
Save cafuego/3223498 to your computer and use it in GitHub Desktop.
// Better yet, sue the language as defined in the entity. $entity->language? | |
foreach ($GLOBALS['user']->field_product_brand[LANGUAGE_NONE] as $term) { | |
if ($entity->field_product_brand[LANGUAGE_NONE][0]['tid'] == $term['tid']) | |
return $term['tid']; | |
} | |
} | |
return NULL; |
global $user;
$account = user_load($user->uid);
foreach ($account->field_product_brand[LANGUAGE_NONE] as $term) {
if ($entity->field_product_brand[LANGUAGE_NONE][0]['tid'] == $term['tid'])
return $term['tid'];
}
}
return NULL;
global $user;
$account = user_load($user->uid);
foreach ($account->field_product_brand[LANGUAGE_NONE] as $term) {
if ($entity->field_product_brand[LANGUAGE_NONE][0]['tid'] == $term['tid'])
drupal_set_message($term['tid']);
return $term['tid'];
}
}
return NULL;
global $user;
$account = user_load($user->uid);
$entity = node_load($view->args[0]);
foreach ($account->field_product_brand[LANGUAGE_NONE] as $term) {
if ($entity->field_product_brand[LANGUAGE_NONE][0]['tid'] == $term['tid'])
return $term['tid'];
}
}
return NULL;
global $user;
$account = user_load($user->uid);
$entity = node_load(arg(1));
foreach ($account->field_product_brand[LANGUAGE_NONE] as $term) {
if ($entity->field_product_brand[LANGUAGE_NONE][0]['tid'] == $term['tid'])
return $term['tid'];
}
}
return NULL;
global $user;
$account = user_load($user->uid);
foreach ($account->field_product_brand['und'] as $term) {
if ($entity->field_product_brand['und'][0]['tid'] == $term['tid'])
return $term['tid'];
}
}
return NULL;