Created
August 1, 2012 03:53
-
-
Save cafuego/3223498 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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);
$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;
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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;