Changeset 1528 in ExiteCMS


Ignore:
Timestamp:
07/07/08 17:53:43 (4 years ago)
Author:
hverton
Message:

test if the report query is correct and whould produce any results before showing it

Location:
modules/common/download_statistics/php-files/modules/download_statistics
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • modules/common/download_statistics/php-files/modules/download_statistics/module_installer.php

    r1506 r1528  
    1717$mod_title = "Download Statistics"; 
    1818$mod_description = "Gather and display download statistics from download mirror logs. includes a Google Map with downloaders per country"; 
    19 $mod_version = "1.1.1"; 
     19$mod_version = "1.1.2"; 
    2020$mod_developer = "WanWizard"; 
    2121$mod_email = "wanwizard@gmail.com"; 
     
    117117$localestrings['en']['dls800'] = "Top files downloaded"; 
    118118$localestrings['en']['dls801'] = "Filenames filter"; 
    119 $localestrings['en']['dls802'] = "This filter is a regex"; 
     119$localestrings['en']['dls802'] = "This filter is a regexp"; 
    120120$localestrings['en']['dls803'] = "Show me"; 
    121121$localestrings['en']['dls804'] = "the top"; 
     
    124124$localestrings['en']['dls807'] = "Ascending"; 
    125125$localestrings['en']['dls808'] = "Descending"; 
    126 $localestrings['en']['dls809'] = "Error in regex:"; 
     126$localestrings['en']['dls809'] = "Error in regexp:"; 
    127127$localestrings['en']['dls810'] = "Filename"; 
    128128$localestrings['en']['dls811'] = "Download Count"; 
     
    152152$localestrings['en']['dls928'] = "You have to select either a download item or enter filename(s), or both"; 
    153153$localestrings['en']['dls929'] = "Are you sure you want to delete this statistics counter?"; 
     154// Messages: Reports 
     155$localestrings['en']['dls950'] = "The report could not be generated:"; 
    154156 
    155157/*---------------------------------------------------+ 
  • modules/common/download_statistics/php-files/modules/download_statistics/report.topfiles.php

    r1499 r1528  
    8080 
    8181            // 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; 
    8687 
    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                } 
    90102            } else { 
    91                 // technically, this is never going to be the limit ;-) 
    92                 $top = 99999999999999; 
     103                $variables['message'] = $locale['dls950']." ".mysql_error(); 
    93104            } 
    94             $rptresult = dbquery($sql." LIMIT ".$rowstart.",".min($rowstart+$top, $settings['numofthreads'])); 
    95  
    96             // get the results 
    97             $reportvars['output'] = array(); 
    98             while ($rptdata = dbarray($rptresult)) { 
    99                 $reportvars['output'][] = $rptdata; 
    100             } 
    101  
    102105        } 
    103106    } 
  • modules/common/download_statistics/php-files/modules/download_statistics/templates/modules.download_statistics.side_panel.tpl

    r1508 r1528  
    3030        </td> 
    3131        <td style='border-left: 1px solid #cccccc;'> 
    32             <div style='width:background-color: #f6f6f6;{$barwidth}'> 
     32            <div style='background-color: #f6f6f6;width:{$barwidth}px'> 
    3333                <div style='height:12px;width:{$counters[bar].width}px;background-color:rgb({$counters[bar].red},{$counters[bar].green},{$counters[bar].blue});' title='{$counters[bar].description}'></div> 
    3434            </div> 
Note: See TracChangeset for help on using the changeset viewer.