Changeset 1777

Show
Ignore:
Timestamp:
04/05/08 00:44:28 (4 months ago)
Author:
auno
Message:

Added sorting fields - comment_count and trackback_count for MTEntries. BugzID:67729

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/release-33/php/lib/mtdb_base.php

    r1583 r1777  
    719719                    $post_sort_offset = $offset; 
    720720                    $limit = 0; $offset = 0; 
     721                } elseif ($args['sort_by'] == 'trackback_count') { 
     722                    $sort_field = 'entry_ping_count';   
    721723                } else {   
    722724                    $sort_field = 'entry_' . $args['sort_by'];   
     
    831833                } elseif ($args['sort_by'] == 'rate') { 
    832834                    $sort_field = $args['sort_by']; 
     835                } elseif ($args['sort_by'] == 'trackback_count') { 
     836                    $sort_field = 'entry_ping_count';   
    833837                } else { 
    834838                    $sort_field = 'entry_' . $args['sort_by']; 
     
    905909                    $entries = $entries_sorted; 
    906910                } else { 
    907                     if (($sort_field == 'entry_status') || ($sort_field == 'entry_author_id') || ($sort_field == 'entry_id')) { 
     911                    if (($sort_field == 'entry_status') || ($sort_field == 'entry_author_id') || ($sort_field == 'entry_id') 
     912                          || ($sort_field == 'entry_comment_count') || ($sort_field == 'entry_ping_count')) { 
    908913                        $sort_fn = "if (\$a['$sort_field'] == \$b['$sort_field']) return 0; return \$a['$sort_field'] < \$b['$sort_field'] ? -1 : 1;"; 
    909914                    } else {