Skip to main content
added 306 characters in body
Source Link
Anil Sagar
  • 12.2k
  • 2
  • 31
  • 54

In Drupal modules extends permissions by defining them using hook_permission.. You can find list of permissions in "admin/people/permissions" ..

For vote up / down set permissions in above page.. See screenshot below..

enter image description here

In Drupal modules extends permissions by defining them using hook_permission.. You can find list of permissions in "admin/people/permissions" ..

For vote up / down set permissions in above page.. See screenshot below..

enter image description here

Source Link
Anil Sagar
  • 12.2k
  • 2
  • 31
  • 54

Widget is getting displayed using hook_node_view code in vud_node.module...

/**
 * Implementation of hook_node_view().
 */
function vud_node_node_view($node, $view_mode, $langcode) {
  // avoid showing the widget in some node builds
  $exclude_modes = array(
    NODE_BUILD_PREVIEW,
    NODE_BUILD_SEARCH_INDEX,
    NODE_BUILD_SEARCH_RESULT,
    NODE_BUILD_RSS,
  );
  if (in_array($node->build_mode, $exclude_modes)) {
    break;
  }
  if (($can_edit=user_access('use vote up/down on nodes')) || user_access('view vote up/down count on nodes')) {
    $node_type = in_array($node->type, variable_get('vud_node_types', array()), TRUE);
    $widget_showmode = variable_get('vud_node_widget_show', VUD_NODE_DISPLAY_BOTH);
    $tag = variable_get('vud_tag', 'vote');
    $widget = variable_get('vud_node_widget', 'plain');
    $vote_on_teaser = (bool)variable_get('vud_node_widget_vote_on_teaser', TRUE);
    $teaser = $a3;

    $widget_message_code = VUD_WIDGET_MESSAGE_ERROR;
    if (!$can_edit) {
      $widget_message_code = VUD_WIDGET_MESSAGE_DENIED;
    }
    elseif (!$vote_on_teaser) {
      $widget_message_code = VUD_NODE_WIDGET_MESSAGE_TEASER_DENIED;
    }

    if ($node_type) {

      switch ($widget_showmode) {
        case VUD_NODE_DISPLAY_TEASER_ONLY:
          if ($teaser == 1) {
            $node->content['vud_node_widget_display'] = array(
              '#value' => theme('vud_widget', $node->nid, 'node', $tag, $widget, !$vote_on_teaser || !$can_edit, $widget_message_code),
              '#weight' => -10,
            );
          }
          break;
        case VUD_NODE_DISPLAY_FULL_ONLY:
          if ($teaser == 0) {
            $node->content['vud_node_widget_display'] = array(
              '#value' => theme('vud_widget', $node->nid, 'node', $tag, $widget, !$can_edit, $widget_message_code),
              '#weight' => -10,
            );
          }
          break;
        case VUD_NODE_DISPLAY_BOTH:
          if ($teaser == 1) {
            $readonly = !$vote_on_teaser || !$can_edit;
          }
          else {
            $readonly = !$can_edit;
          }
          $node->content['vud_node_widget_display'] = array(
            '#value' => theme('vud_widget', $node->nid, 'node', $tag, $widget, $readonly, $widget_message_code),
            '#weight' => -10,
          );
          break;
      }

    }
  }
}

Implement hook_node_view_alter in your custom module and change the weight to higher value so that it will be displayed at bottom...