This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

node title in recent comments block

I am looking to try and achieve 3 things with the recent comments block:

1/ Have the node title displayed above each of the recent comments in the recent comments block.
2/ List (eg) 30 words of each comment
3/ Get rid of the time stamp

The code in the comments module that i think must be tweaked is this:

/**
 * Implementation of hook_block().
 *
 * Generates a block with the most recent comments.
 */
function comment_block($op = 'list', $delta = 0) {
  if ($op == 'list') {
    $blocks[0]['info'] = t('Recent comments');
    return $blocks;
  }
  else if ($op == 'view' && user_access('access comments')) {
    $result = db_query_range(db_rewrite_sql('SELECT c.nid, c.* FROM {comments} c WHERE c.status = 0 ORDER BY c.timestamp DESC', 'c'), 0, 10);
    $items = array();
    while ($comment = db_fetch_object($result)) {
      $items[] = l($comment->subject, 'node/'. $comment->nid, NULL, NULL, 'comment-'. $comment->cid) .'<br />'. t('%time ago', array('%time' => format_interval(time() - $comment->timestamp)));
    }

    $block['subject'] = t('Recent comments');
    $block['content'] = theme('item_list', $items);
    return $block;
  }
}

From looking at the code above, would i need to add to the $result query to SELECT title FROM {node}? How would i actually code that in?

With the length of the recent comment itself, where can this be altered?

Modules Available?

Hi guys.. Im using Drupal 4.7 RC

is there any reservation module?

Need Help on E-commerce.Module

Need help..

I've installed the ecommerce.module..
I use the ecommerce.mysql to create tables then enable it to the admin->modules

after enableling the module. I got this error..

Fatal error: Call to undefined function array2object() in E:\XAMPP 1.5.1\xampp\htdocs\ecomerce\modules\ecommerce\store\product.module on line 435

on line 435
--> $edit = array2object($_POST['edit']);

They say that this is superseded means out of date..

so I change the code to

-->$object = (object)$array;

the I still got an error.

Online users with icons/images

Hello,

I was wondering, would it be possible to in some way change the Whos online mod and the users that are online give them an icon if they are admin and another icon for other types of users?

I hope someone can help me with this,

Thanks,
Michiel

Filebrowser not working and no other download manager?

Hello,

We have installed filebrowser manager on www.sharedbans.com and clicking on a directory works fine but then as soon as the file itself comes it thinks its a directory aswell??

http://www.sharedbans.com/filebrowser/sharedbans+plugins/cvar-x

Try clicking the zip file in there and then it says:
cvarx-rc1.zip directory
Unable to get files for this directory

Can create content with my 4.7 module :(

Hi !
I'm really a newb in module development. I tried and developped a little module with a simple node.
It was working quite nicely in 4.6, but not in 4.7 anymore.
I checked the documentation, but can't find what I've forgotten :(
In fact, the node appears in the block 'create content', but not in the main page when clicking on 'create content' (?q=node/add).
And if I click on my node in the menu, I go back to the general create content page (instead of my form).....
If someone has an idea what I am stupidly forgetting, it would be really great :p !

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions