Index: /branches/release-33/php/lib/mtdb_base.php
===================================================================
--- /branches/release-33/php/lib/mtdb_base.php (revision 1583)
+++ /branches/release-33/php/lib/mtdb_base.php (revision 1777)
@@ -719,4 +719,6 @@
                     $post_sort_offset = $offset;
                     $limit = 0; $offset = 0;
+                } elseif ($args['sort_by'] == 'trackback_count') {
+                    $sort_field = 'entry_ping_count';  
                 } else {  
                     $sort_field = 'entry_' . $args['sort_by'];  
@@ -831,4 +833,6 @@
                 } elseif ($args['sort_by'] == 'rate') {
                     $sort_field = $args['sort_by'];
+                } elseif ($args['sort_by'] == 'trackback_count') {
+                    $sort_field = 'entry_ping_count';  
                 } else {
                     $sort_field = 'entry_' . $args['sort_by'];
@@ -905,5 +909,6 @@
                     $entries = $entries_sorted;
                 } else {
-                    if (($sort_field == 'entry_status') || ($sort_field == 'entry_author_id') || ($sort_field == 'entry_id')) {
+                    if (($sort_field == 'entry_status') || ($sort_field == 'entry_author_id') || ($sort_field == 'entry_id')
+                          || ($sort_field == 'entry_comment_count') || ($sort_field == 'entry_ping_count')) {
                         $sort_fn = "if (\$a['$sort_field'] == \$b['$sort_field']) return 0; return \$a['$sort_field'] < \$b['$sort_field'] ? -1 : 1;";
                     } else {
