Changeset 2983
- Timestamp:
- 08/26/08 09:43:54 (3 months ago)
- Files:
-
- trunk/lib/MT/Template/ContextHandlers.pm (modified) (1 diff)
- trunk/php/lib/mtdb_base.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/MT/Template/ContextHandlers.pm
r2982 r2983 8055 8055 } 8056 8056 8057 # Adds an count of comments filter to the filter list. 8058 if ($args->{max_comment}) { 8059 push @filters, sub { $_[0]->comment_count <= $args->{max_comment}; }; 8060 } 8061 if ($args->{min_comment}) { 8062 push @filters, sub { $_[0]->comment_count >= $args->{min_comment}; }; 8063 } 8064 8057 8065 my $published = $ctx->{__stash}{entry_ids_published} ||= {}; 8058 8066 if ($args->{unique}) { trunk/php/lib/mtdb_base.php
r2712 r2983 715 715 } 716 716 717 # Adds an count of comment filter 718 if (isset($args['max_comment']) && is_numeric($args['max_comment'])) { 719 $max_comment_filter = 'and entry_comment_count <= ' . intval($args['max_comment']); 720 } 721 if (isset($args['min_comment']) && is_numeric($args['min_comment'])) { 722 $min_comment_filter = 'and entry_comment_count >= ' . intval($args['min_comment']); 723 } 724 717 725 if (count($entry_list) && ($entry_filter == '')) { 718 726 $entry_list = implode(",", array_keys($entry_list)); … … 759 767 'min_score', 'max_score', 760 768 'min_rate', 'max_rate', 761 'min_count', 'max_count' 769 'min_count', 'max_count', 770 'min_comment', 'max_comment' 762 771 ) as $valid_key ) 763 772 { … … 908 917 $day_filter 909 918 $class_filter 919 $max_comment_filter 920 $min_comment_filter 910 921 "; 911 922
