Simple Download Monitor - Version 0.06

Version Description

  • Fixed a bug on download display if no downloads were recorded.
Download this release

Release Info

Developer pepak.net
Plugin Icon 128x128 Simple Download Monitor
Version 0.06
Comparing to
See all releases

Code changes from version 0.05 to 0.06

Files changed (2) hide show
  1. readme.txt +4 -1
  2. simple-download-monitor.php +8 -6
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link:
4
  Tags: files, counter, count, tracking, download monitor, monitor, downloads, download
5
  Requires at least: 2.8.0
6
  Tested up to: 2.8.4
7
- Stable tag: 0.05
8
 
9
  Count the number of downloads without having to maintain a comprehensive download page.
10
 
@@ -62,6 +62,9 @@ Nobody asked any yet.
62
 
63
  == Changelog ==
64
 
 
 
 
65
  = 0.05 =
66
  * First intentional public release.
67
 
4
  Tags: files, counter, count, tracking, download monitor, monitor, downloads, download
5
  Requires at least: 2.8.0
6
  Tested up to: 2.8.4
7
+ Stable tag: 0.06
8
 
9
  Count the number of downloads without having to maintain a comprehensive download page.
10
 
62
 
63
  == Changelog ==
64
 
65
+ = 0.06 =
66
+ * Fixed a bug on download display if no downloads were recorded.
67
+
68
  = 0.05 =
69
  * First intentional public release.
70
 
simple-download-monitor.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Simple Download Monitor
5
  Plugin URI: http://www.pepak.net/wordpress/simple-download-monitor-plugin
6
  Description: Count the number of downloads without having to maintain a comprehensive download page.
7
- Version: 0.05
8
  Author: Pepak
9
  Author URI: http://www.pepak.net
10
  */
@@ -31,7 +31,7 @@ if (!class_exists('SimpleDownloadMonitor'))
31
  class SimpleDownloadMonitor
32
  {
33
 
34
- const VERSION = '0.05';
35
  const PREFIX = 'sdmon_';
36
  const PREG_DELIMITER = '`';
37
  const GET_PARAM = 'sdmon';
@@ -389,10 +389,11 @@ if (!class_exists('SimpleDownloadMonitor'))
389
  $totalcount = $wpdb->get_var("SELECT COUNT(*) FROM ${table_downloads} ${where}");
390
  $results = $wpdb->get_results($sql, ARRAY_N);
391
  $rownum = intval($options['from']);
392
- foreach ($results as $row) {
393
- $rownum++;
394
- list($download, $filename, $count, $date, $exists) = $row;
395
- ?>
 
396
  <tr<?php if (!$exists) echo ' class="not-exist"'; ?>>
397
  <td><?php echo $rownum; ?>.</td>
398
  <td><?php if ($detailed): ?><a href="<?php echo $this->GetUrlForList(array('download' => $download)); ?>"><?php endif; echo htmlspecialchars($filename); if ($detailed): ?></a><?php endif; ?></td>
@@ -400,6 +401,7 @@ if (!class_exists('SimpleDownloadMonitor'))
400
  <td><?php echo mysql2date('Y-m-d h:i:s', $date, TRUE); ?></td>
401
  </tr>
402
  </tbody><?php
 
403
  }
404
  ?>
405
  </table>
4
  Plugin Name: Simple Download Monitor
5
  Plugin URI: http://www.pepak.net/wordpress/simple-download-monitor-plugin
6
  Description: Count the number of downloads without having to maintain a comprehensive download page.
7
+ Version: 0.06
8
  Author: Pepak
9
  Author URI: http://www.pepak.net
10
  */
31
  class SimpleDownloadMonitor
32
  {
33
 
34
+ const VERSION = '0.06';
35
  const PREFIX = 'sdmon_';
36
  const PREG_DELIMITER = '`';
37
  const GET_PARAM = 'sdmon';
389
  $totalcount = $wpdb->get_var("SELECT COUNT(*) FROM ${table_downloads} ${where}");
390
  $results = $wpdb->get_results($sql, ARRAY_N);
391
  $rownum = intval($options['from']);
392
+ if (is_array($results)) {
393
+ foreach ($results as $row) {
394
+ $rownum++;
395
+ list($download, $filename, $count, $date, $exists) = $row;
396
+ ?>
397
  <tr<?php if (!$exists) echo ' class="not-exist"'; ?>>
398
  <td><?php echo $rownum; ?>.</td>
399
  <td><?php if ($detailed): ?><a href="<?php echo $this->GetUrlForList(array('download' => $download)); ?>"><?php endif; echo htmlspecialchars($filename); if ($detailed): ?></a><?php endif; ?></td>
401
  <td><?php echo mysql2date('Y-m-d h:i:s', $date, TRUE); ?></td>
402
  </tr>
403
  </tbody><?php
404
+ }
405
  }
406
  ?>
407
  </table>