E_ALL fix HEAD
authorDirk Haun <dirk@haun-online.de>
Sun Nov 08 13:47:41 2009 +0100 (2009-11-08)
branchHEAD
changeset 7461026789ae2533
parent 7460 1c2d87e8c9e2
child 7462 029182f0ca35
E_ALL fix
system/classes/listfactory.class.php
     1.1 --- a/system/classes/listfactory.class.php	Sun Nov 08 12:26:46 2009 +0100
     1.2 +++ b/system/classes/listfactory.class.php	Sun Nov 08 13:47:41 2009 +0100
     1.3 @@ -479,13 +479,17 @@
     1.4          $num_query_results = $this->_per_page - $this->_total_found;
     1.5          $pp_total = $this->_total_found;
     1.6          $limits = array();
     1.7 -        for ($i = 0; $i < count($this->_sources_arr); $i++)
     1.8 -        {
     1.9 +        $num = count($this->_sources_arr);
    1.10 +        for ($i = 0; $i < $num; $i++) {
    1.11              $limits[$i]['total'] = $this->_getTotal($this->_sources_arr[$i]);
    1.12              $limits[$i]['pp'] = round(($this->_sources_arr[$i]['rank'] / $this->_total_rank) * $num_query_results);
    1.13              $this->_total_found += $limits[$i]['total'];
    1.14              $pp_total += $limits[$i]['pp'];
    1.15          }
    1.16 +        if ($num == 0) {
    1.17 +            $limits[0]['total'] = 0;
    1.18 +            $limits[0]['pp'] = 0;
    1.19 +        }
    1.20          if ($pp_total < $this->_per_page) {
    1.21              $limits[0]['pp'] += $this->_per_page - $pp_total;
    1.22          } else if ($this->_per_page < $pp_total) {