I wonder how to display threade comment in this modules?

Comments

maciej.zgadzaj’s picture

It can't.

Problem with this module is that is uses its own view for displaying comments, instead of native Drupal functionality, which is not really a good thing.

I have my own stripped down version, with removed view (views/commentblock.views_default.inc file and commentblock_views_api() function) and removed commentblock_form_alter() (all comment options for content types _should_ be kept when using Drupal way of displaying them) and added new block for listing comments (using Drupal's comment_render(), which is keeping all comment settings for each content type) and it works like a charm!

petr.gorodechnyj’s picture

Maciej.zgadzaj, could you post your version of module here or at least give a snippet, please? It's really annoying that I can't have a built-in comment representation in that module.

david_p’s picture

maciej.zgadzaj, please let us know how did you do that. I need a better version of this module too.

Thanks!

david_p’s picture

maciej.zgadzaj, please let us know how did you do that. I need a better version of this module too.

Thanks!

boreg’s picture

subscribing

mollyow’s picture

I accomplished something similar by installing Comment block just to get the regular comment display out of the node, and then adding a new block with the following code:

if (arg(0)=='node'&&is_numeric(arg(1))) {
$node=node_load(arg(1));
print comment_render($node);
}
freestone’s picture

In case anyone run accross this module and want to use a functioning version of it as Maciej.zgadzaj indicates you have to remove the views code and then the block itself works fine. So install the 6.x-1.0-beta2 version after you update it. dont bother with DEV. This is a great module without any of the Views code in it.

After you download the files and before you upload and activate the module replace the entire content of the file commentblock.module with this paired down code. After you uplaod and sctivate the module go to blocks and set were you want the block. In my case I limted it to a given content type by making the initial content of that type have a specific URL using path auto and then I was able to configure the block to only show for the path I created.

<?php
// $Id: commentblock.module,v 1.1.2.2 2009/10/09 08:23:31 ximo Exp $

/**
* @file
* Moves the comment form into a block and provides a default view for the
* comment listing.
*
* Author:
* Dick Olsson (http://drupal.org/user/239911)
* Joakim Stai (http://drupal.org/user/88701)
*
* Sponsors:
* Senzilla (http://senzilla.com/)
* NodeOne (http://nodeone.se/)
*/

/**
* Implementation of hook_block().
*/
function commentblock_block($op, $delta = 0, $edit = array()) {
switch ($op) {
case 'list':
$blocks = array();
$blocks['comment_form'] = array('info' => t('Comment form'));
return $blocks;

case 'view':
$block = array();
switch ($delta) {
case 'comment_form':
// Only nodes dressed in page view are invited to this party.
if ((arg(0) == 'node') && is_numeric(arg(1)) && (arg(2) == NULL)) {
$node = node_load(arg(1));

// Only display the form if we are allowed to post comments.
// Note that this works because this function is called before the
// 'view' operation in hook_nodeapi().
if (user_access('post comments') && $node->comment > 1) {
$block['subject'] = t('Post new comment');
$block['content'] = drupal_get_form('comment_form', array('nid' => $node->nid));
}
}
}
return $block;
}
}