views_handler_field_comment_depth.inc

  1. 3.x modules/comment/views_handler_field_comment_depth.inc
  2. 2.x modules/comment/views_handler_field_comment_depth.inc

Definition of views_handler_field_comment_depth.

File

modules/comment/views_handler_field_comment_depth.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * Definition of views_handler_field_comment_depth.
  5. */
  6. /**
  7. * Field handler to display the depth of a comment.
  8. *
  9. * @ingroup views_field_handlers
  10. */
  11. class views_handler_field_comment_depth extends views_handler_field {
  12. /**
  13. * Work out the depth of this comment
  14. */
  15. function render($values) {
  16. $comment_thread = $this->get_value($values);
  17. return count(explode('.', $comment_thread)) - 1;
  18. }
  19. }