• Avail guidance to develop Drupal modules & Drupal themes
  • Share and get review of your code
  • Get Access to free CodeBooks and ThemeBooks
  • Drupal 5, 6 and 7 covered

Userpoints Meter

0 Points /1000 Points

Drupal hook: hook_comment

hook_comment lets you operate on comments that is being operated upon. You can perform actions on comments by using this hook. For example, after certain number of commnets reached, you want to hide certain number of comments just like the way facebook does. You can use hook_commentk and theme the output as per your requirements.
Syntax:
Drupal 5.x - 6.x: hook_comment($a1, $op)
$a1: when $op is either 'validate', 'insert' or 'update', this holds the foprm submmitted values.
When you are editing the comment from comment/edit/*, $a1 will be an array, in rest of the cases, it will be an object.
$op: $op is every thing that can be performed on a comment. like
'insert',
'update',
'validate',
'publish',
'delete',
'view'.
Please note that there is no 'unpublish' operation.

5
Your rating: None Average: 5 (3 votes)
Syndicate content

Recent comments