/[drupal]/contributions/modules/vote_up_down/vud_comment/vud_comment.module
ViewVC logotype

Diff of /contributions/modules/vote_up_down/vud_comment/vud_comment.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.16, Sun Aug 16 19:30:02 2009 UTC revision 1.1.2.17, Sat Aug 22 04:42:49 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: vud_comment.module,v 1.1.2.15 2009/08/15 21:15:45 lut4rp Exp $  // $Id: vud_comment.module,v 1.1.2.16 2009/08/16 19:30:02 lut4rp Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 72  function vud_comment_admin_settings() { Line 72  function vud_comment_admin_settings() {
72  function vud_comment_comment(&$comment, $op) {  function vud_comment_comment(&$comment, $op) {
73    switch ($op) {    switch ($op) {
74      case 'view':      case 'view':
75        if (user_access('use vote up/down on comments')) {        $type = _vud_comment_get_node_type($comment->nid);
76          $comment_allow = in_array($type, variable_get('vud_comment_node_types', array()), TRUE);
77          if ($comment_allow && user_access('use vote up/down on comments')) {
78          $tag = variable_get('vud_tag', 'vote');          $tag = variable_get('vud_tag', 'vote');
79          $widget = variable_get('vud_comment_widget', 'plain');          $widget = variable_get('vud_comment_widget', 'plain');
80          $comment->comment = theme('vud_widget', $comment->cid, 'comment', $tag, $widget) . $comment->comment;          $comment->comment = theme('vud_widget', $comment->cid, 'comment', $tag, $widget) . $comment->comment;
# Line 82  function vud_comment_comment(&$comment, Line 84  function vud_comment_comment(&$comment,
84  }  }
85    
86  /**  /**
87     * Function to return the node type of a particular node ID.
88     */
89    function _vud_comment_get_node_type($nid) {
90      return db_result(db_query("SELECT type from {node} where nid = %d", $nid));
91    }
92    
93    /**
94   * Implementation of hook_theme().   * Implementation of hook_theme().
95   */   */
96  function vud_comment_theme() {  function vud_comment_theme() {

Legend:
Removed from v.1.1.2.16  
changed lines
  Added in v.1.1.2.17

  ViewVC Help
Powered by ViewVC 1.1.2