Changeset 2519

Show
Ignore:
Timestamp:
06/06/08 06:38:41 (20 months ago)
Author:
fumiakiy
Message:

Fixed when to apply the value from entries_on_index in PHP. BugId:80044

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/release-39/php/lib/mtdb_base.php

    r2503 r2519  
    488488            $args['lastn'] = $args['limit']; 
    489489        } elseif (!isset($args['days']) && !isset($args['lastn'])) { 
    490             if ($days = $blog['blog_days_on_index']) { 
    491                 if (!isset($args['recently_commented_on'])) { 
    492                     $args['days'] = $days; 
    493                 } 
    494             } elseif ($posts = $blog['blog_entries_on_index']) { 
    495                 $args['lastn'] = $posts; 
     490        #    if ($days = $blog['blog_days_on_index']) { 
     491        #        if (!isset($args['recently_commented_on'])) { 
     492        #            $args['days'] = $days; 
     493        #        } 
     494        #    } elseif ($posts = $blog['blog_entries_on_index']) { 
     495        #        $args['lastn'] = $posts; 
     496        #    } 
     497            if ($posts = $blog['blog_entries_on_index']) { 
     498                $limit = $posts; 
    496499            } 
    497500        } 
     
    721724            $day_filter = 'and ' . $this->limit_by_day_sql('entry_authored_on', intval($args['days'])); 
    722725        } else { 
     726            $found_valid_args = 0; 
     727            foreach ( array( 
     728                'lastn', 'days', 
     729                'category', 'categories', 'category_id', 
     730                'tag', 'tags', 
     731                'author', 
     732                'min_score',  'max_score', 
     733                'min_rate',    'max_rate', 
     734                'min_count',  'max_count' 
     735              ) as $valid_key ) 
     736            { 
     737                if (array_key_exists($valid_key, $args)) { 
     738                    $found_valid_args = 1; 
     739                    break; 
     740                } 
     741            } 
    723742            if ((!isset($args['current_timestamp']) && 
    724743                !isset($args['current_timestamp_end'])) && 
    725744                ($limit <= 0) && 
    726                 (!isset($args['category'])) && 
    727                 (!isset($args['categories'])) && 
    728                 (!isset($args['category_id'])) && 
     745                (!$found_valid_args) && 
    729746                (isset($blog))) { 
    730747                if ($days = $blog['blog_days_on_index']) {