function vud_term_node_view in Vote Up/Down 7
Implementation of hook_node_view().
File
- vud_term/
vud_term.module, line 78 - Adds a voting widget to terms.
Code
function vud_term_node_view($node, $view_mode, $langcode) {
if (user_access('use vote up/down on terms')) {
$node_type = in_array($node->type, variable_get('vud_term_types', array()), TRUE);
$showmode = variable_get('vud_term_votetable_show', 1);
$teaser = 0;
if ($view_mode == 'teaser') {
$teaser = 1;
}
if ($node_type) {
switch ($showmode) {
case 0:
if ($teaser == 1) {
_vud_term_generate_table($node);
}
break;
case 1:
if ($teaser == 0) {
_vud_term_generate_table($node);
}
break;
case 2:
_vud_term_generate_table($node);
break;
}
}
}
}