views_handler_sort_comment_thread.inc in Views (for Drupal 7) 6.3
File
modules/comment/views_handler_sort_comment_thread.inc
View source
<?php
class views_handler_sort_comment_thread extends views_handler_sort {
function query() {
$this
->ensure_my_table();
if ($this->options['order'] == 'DESC') {
$this->query
->add_orderby($this->table_alias, $this->real_field, $this->options['order']);
}
else {
$alias = $this->table_alias . '_' . $this->real_field . 'asc';
$this->query
->add_orderby(NULL, "SUBSTRING({$this->table_alias}.{$this->real_field}, 1, (LENGTH({$this->table_alias}.{$this->real_field}) - 1))", $this->options['order'], $alias);
}
}
}