New module 'Nodecomment'

This commit is contained in:
Manuel Cillero 2017-07-26 11:36:38 +02:00
parent 09b74574f1
commit 3c2bb788b4
26 changed files with 3513 additions and 0 deletions

View file

@ -0,0 +1,17 @@
<?php
/**
* Field handler to display the depth of a comment
*/
class views_handler_field_comment_depth extends views_handler_field {
function construct() {
parent::construct();
$this->additional_fields['thread'] = 'thread';
}
/**
* Work out the depth of this comment
*/
function render($values) {
return count(explode('.', $values->{$this->aliases['thread']})) - 1;
}
}