| 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 |
| 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; |
| 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() { |