00001 <?php
00005 class views_handler_sort_comment_thread extends views_handler_sort {
00006 function query() {
00007 $this->ensure_my_table();
00008
00009
00010
00011 if ($this->options['order'] == 'DESC') {
00012 $this->query->add_orderby($this->table_alias, $this->real_field, $this->options['order']);
00013 }
00014 else {
00015 $alias = $this->table_alias . '_' . $this->real_field . 'asc';
00016
00017 $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);
00018 }
00019 }
00020 }