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.
- 2243 reads
-
Your feedback





Recent comments
20 weeks 6 days ago
39 weeks 3 days ago
41 weeks 1 day ago
50 weeks 4 days ago
1 year 2 weeks ago
1 year 3 weeks ago
1 year 3 weeks ago
1 year 3 weeks ago
1 year 3 weeks ago
1 year 4 weeks ago