Changeset 1528 in ExiteCMS for modules/common/download_statistics/php-files/modules/download_statistics/report.topfiles.php
- Timestamp:
- 07/07/08 17:53:43 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/common/download_statistics/php-files/modules/download_statistics/report.topfiles.php
r1499 r1528 80 80 81 81 // check how many rows this would output 82 $rptresult = dbquery($sql.($top ? (" LIMIT 0,".$top) : "")); 83 // store some row counter for the pager 84 $variables['rows'] = dbrows($rptresult); 85 $variables['rowstart'] = $rowstart; 82 $rptresult = mysql_query($sql); 83 if ($rptresult) { 84 // store some row counter for the pager 85 $variables['rows'] = dbrows($rptresult); 86 $variables['rowstart'] = $rowstart; 86 87 87 // now add a query limit, make sure not to overshoot the limit requested 88 if ($top > 0 && $rowstart+$settings['numofthreads'] > $top) { 89 $rowstart = max(0, $limit - $settings['numofthreads']); 88 // now add a query limit, make sure not to overshoot the limit requested 89 if ($top > 0 && $rowstart+$settings['numofthreads'] > $top) { 90 $rowstart = max(0, $limit - $settings['numofthreads']); 91 } else { 92 // technically, this is never going to be the limit ;-) 93 $top = 99999999999999; 94 } 95 $rptresult = dbquery($sql." LIMIT ".$rowstart.",".min($rowstart+$top, $settings['numofthreads'])); 96 97 // get the results 98 $reportvars['output'] = array(); 99 while ($rptdata = dbarray($rptresult)) { 100 $reportvars['output'][] = $rptdata; 101 } 90 102 } else { 91 // technically, this is never going to be the limit ;-) 92 $top = 99999999999999; 103 $variables['message'] = $locale['dls950']." ".mysql_error(); 93 104 } 94 $rptresult = dbquery($sql." LIMIT ".$rowstart.",".min($rowstart+$top, $settings['numofthreads']));95 96 // get the results97 $reportvars['output'] = array();98 while ($rptdata = dbarray($rptresult)) {99 $reportvars['output'][] = $rptdata;100 }101 102 105 } 103 106 }
Note: See TracChangeset
for help on using the changeset viewer.
