Show
Ignore:
Timestamp:
04/24/08 21:16:00 (19 months ago)
Author:
bchoate
Message:

Adding meta support for comments/pings and creating a new index to aid selecting by parent object and visible status. Also, comment author method now returns MT::Author nickname when comment has an associated author. BugId:79475

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/release-36/lib/MT/Comment.pm

    r1866 r2057  
    3535        ip => 1, 
    3636        created_on => 1, 
    37         entry_id => 1, 
     37        entry_visible => { 
     38            columns => [ 'entry_id', 'visible' ], 
     39        }, 
    3840        email => 1, 
    3941        commenter_id => 1, 
     
    5759        }, 
    5860    }, 
     61    meta => 1, 
    5962    defaults => { 
    6063        junk_status => NOT_JUNK, 
     
    196199 
    197200*publish = \&approve; 
     201 
     202sub author { 
     203    my $comment = shift; 
     204    if (!@_ && $comment->commenter_id) { 
     205        require MT::Author; 
     206        if (my $auth = MT::Author->load($comment->commenter_id)) { 
     207            return $auth->nickname; 
     208        } 
     209    } 
     210    return $comment->column('author', @_); 
     211} 
    198212 
    199213sub all_text {