Simple Download Monitor - Version 3.2.8

Version Description

  • WordPress 4.4 compatibility.
Download this release

Release Info

Developer mra13
Plugin Icon 128x128 Simple Download Monitor
Version 3.2.8
Comparing to
See all releases

Code changes from version 3.2.5 to 3.2.8

includes/sdm-admin-menu-handler.php CHANGED
@@ -40,8 +40,8 @@ function sdm_handle_admin_menu() {
40
 
41
  //*****
42
  //***** Create the 'logs' and 'settings' submenu pages
43
- $sdm_logs_page = add_submenu_page('edit.php?post_type=sdm_downloads', __('Logs', 'sdm_lang'), __('Logs', 'sdm_lang'), 'manage_options', 'logs', 'sdm_create_logs_page');
44
- $sdm_settings_page = add_submenu_page('edit.php?post_type=sdm_downloads', __('Settings', 'sdm_lang'), __('Settings', 'sdm_lang'), 'manage_options', 'settings', 'sdm_create_settings_page');
45
  }
46
 
47
  /*
@@ -51,11 +51,11 @@ function sdm_create_settings_page() {
51
  echo '<div class="wrap">';
52
  echo '<div id="poststuff"><div id="post-body">';
53
  ?>
54
- <h2><?php _e('Simple Download Monitor Settings Page', 'sdm_lang') ?></h2>
55
 
56
  <div style="background: #FFF6D5; border: 1px solid #D1B655; color: #3F2502; padding: 15px 10px">
57
  Read the full plugin usage documentation <a href="https://www.tipsandtricks-hq.com/simple-wordpress-download-monitor-plugin" target="_blank">here</a>.
58
- You can also <a href="http://www.tipsandtricks-hq.com/development-center" target="_blank"><?php _e('follow us', 'sdm_lang'); ?></a> <?php _e('on Twitter, Google+ or via Email to stay upto date about the new features of this plugin.', 'sdm_lang'); ?>
59
  </div>
60
 
61
  <!-- settings page form -->
@@ -64,10 +64,10 @@ function sdm_create_settings_page() {
64
  <!-- BEGIN ADMIN OPTIONS DIV -->
65
  <div id="sdm_admin_opts_div" class="sdm_sliding_div_title">
66
  <div class="sdm_slider_title">
67
- <?php _e('Admin Options', 'sdm_lang') ?>
68
  </div>
69
  <div class="sdm_desc">
70
- <?php _e("Control various plugin features.", 'sdm_lang') ?>
71
  </div>
72
  </div>
73
  <div id="sliding_div1" class="slidingDiv">
@@ -84,10 +84,10 @@ function sdm_create_settings_page() {
84
  <!-- BEGIN COLORS DIV -->
85
  <div id="sdm_color_opts_div" class="sdm_sliding_div_title">
86
  <div class="sdm_slider_title">
87
- <?php _e('Color Options', 'sdm_lang') ?>
88
  </div>
89
  <div class="sdm_desc">
90
- <?php _e("Adjust color options", 'sdm_lang') ?>
91
  </div>
92
  </div>
93
  <div id="sliding_div2" class="slidingDiv">
@@ -105,7 +105,7 @@ function sdm_create_settings_page() {
105
  </form>
106
 
107
  <div style="background: none repeat scroll 0 0 #FFF6D5;border: 1px solid #D1B655;color: #3F2502;margin: 10px 0;padding: 5px 5px 5px 10px;text-shadow: 1px 1px #FFFFFF;">
108
- <p><?php _e('If you need a feature rich and supported plugin for selling your digital items then checkout our', 'sdm_lang'); ?> <a href="https://www.tipsandtricks-hq.com/wordpress-estore-plugin-complete-solution-to-sell-digital-products-from-your-wordpress-blog-securely-1059" target="_blank"><?php _e('WP eStore Plugin', 'sdm_lang'); ?></a>
109
  </p>
110
  </div>
111
 
@@ -126,7 +126,7 @@ function sdm_create_logs_page() {
126
  $query = "TRUNCATE $table_name";
127
  $result = $wpdb->query($query);
128
  echo '<div id="message" class="updated fade"><p>';
129
- _e('Download log entries deleted!', 'sdm_lang');
130
  echo '</p></div>';
131
  }
132
 
@@ -139,21 +139,21 @@ function sdm_create_logs_page() {
139
  <div class="wrap">
140
 
141
  <div id="icon-users" class="icon32"><br/></div>
142
- <h2><?php _e('Download Logs', 'sdm_lang'); ?></h2>
143
 
144
  <div style="background:#ECECEC;border:1px solid #CCC;padding:0 10px;margin-top:5px;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;">
145
- <p><?php _e('This page lists all tracked downloads.', 'sdm_lang'); ?></p>
146
  </div>
147
 
148
  <div id="poststuff"><div id="post-body">
149
  <!-- Log reset button -->
150
  <div class="postbox">
151
- <h3><label for="title"><?php _e('Reset Download Log Entries', 'sdm_lang'); ?></label></h3>
152
  <div class="inside">
153
 
154
  <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>" onSubmit="return confirm('Are you sure you want to reset all the log entries?');" >
155
  <div class="submit">
156
- <input type="submit" class="button" name="sdm_reset_log_entries" value="<?php _e('Reset Log Entries', 'sdm_lang'); ?>" />
157
  </div>
158
  </form>
159
 
40
 
41
  //*****
42
  //***** Create the 'logs' and 'settings' submenu pages
43
+ $sdm_logs_page = add_submenu_page('edit.php?post_type=sdm_downloads', __('Logs', 'simple-download-monitor'), __('Logs', 'simple-download-monitor'), 'manage_options', 'logs', 'sdm_create_logs_page');
44
+ $sdm_settings_page = add_submenu_page('edit.php?post_type=sdm_downloads', __('Settings', 'simple-download-monitor'), __('Settings', 'simple-download-monitor'), 'manage_options', 'settings', 'sdm_create_settings_page');
45
  }
46
 
47
  /*
51
  echo '<div class="wrap">';
52
  echo '<div id="poststuff"><div id="post-body">';
53
  ?>
54
+ <h2><?php _e('Simple Download Monitor Settings Page', 'simple-download-monitor') ?></h2>
55
 
56
  <div style="background: #FFF6D5; border: 1px solid #D1B655; color: #3F2502; padding: 15px 10px">
57
  Read the full plugin usage documentation <a href="https://www.tipsandtricks-hq.com/simple-wordpress-download-monitor-plugin" target="_blank">here</a>.
58
+ You can also <a href="http://www.tipsandtricks-hq.com/development-center" target="_blank"><?php _e('follow us', 'simple-download-monitor'); ?></a> <?php _e('on Twitter, Google+ or via Email to stay upto date about the new features of this plugin.', 'simple-download-monitor'); ?>
59
  </div>
60
 
61
  <!-- settings page form -->
64
  <!-- BEGIN ADMIN OPTIONS DIV -->
65
  <div id="sdm_admin_opts_div" class="sdm_sliding_div_title">
66
  <div class="sdm_slider_title">
67
+ <?php _e('Admin Options', 'simple-download-monitor') ?>
68
  </div>
69
  <div class="sdm_desc">
70
+ <?php _e("Control various plugin features.", 'simple-download-monitor') ?>
71
  </div>
72
  </div>
73
  <div id="sliding_div1" class="slidingDiv">
84
  <!-- BEGIN COLORS DIV -->
85
  <div id="sdm_color_opts_div" class="sdm_sliding_div_title">
86
  <div class="sdm_slider_title">
87
+ <?php _e('Color Options', 'simple-download-monitor') ?>
88
  </div>
89
  <div class="sdm_desc">
90
+ <?php _e("Adjust color options", 'simple-download-monitor') ?>
91
  </div>
92
  </div>
93
  <div id="sliding_div2" class="slidingDiv">
105
  </form>
106
 
107
  <div style="background: none repeat scroll 0 0 #FFF6D5;border: 1px solid #D1B655;color: #3F2502;margin: 10px 0;padding: 5px 5px 5px 10px;text-shadow: 1px 1px #FFFFFF;">
108
+ <p><?php _e('If you need a feature rich and supported plugin for selling your digital items then checkout our', 'simple-download-monitor'); ?> <a href="https://www.tipsandtricks-hq.com/wordpress-estore-plugin-complete-solution-to-sell-digital-products-from-your-wordpress-blog-securely-1059" target="_blank"><?php _e('WP eStore Plugin', 'simple-download-monitor'); ?></a>
109
  </p>
110
  </div>
111
 
126
  $query = "TRUNCATE $table_name";
127
  $result = $wpdb->query($query);
128
  echo '<div id="message" class="updated fade"><p>';
129
+ _e('Download log entries deleted!', 'simple-download-monitor');
130
  echo '</p></div>';
131
  }
132
 
139
  <div class="wrap">
140
 
141
  <div id="icon-users" class="icon32"><br/></div>
142
+ <h2><?php _e('Download Logs', 'simple-download-monitor'); ?></h2>
143
 
144
  <div style="background:#ECECEC;border:1px solid #CCC;padding:0 10px;margin-top:5px;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;">
145
+ <p><?php _e('This page lists all tracked downloads.', 'simple-download-monitor'); ?></p>
146
  </div>
147
 
148
  <div id="poststuff"><div id="post-body">
149
  <!-- Log reset button -->
150
  <div class="postbox">
151
+ <h3 class="hndle"><label for="title"><?php _e('Reset Download Log Entries', 'simple-download-monitor'); ?></label></h3>
152
  <div class="inside">
153
 
154
  <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>" onSubmit="return confirm('Are you sure you want to reset all the log entries?');" >
155
  <div class="submit">
156
+ <input type="submit" class="button" name="sdm_reset_log_entries" value="<?php _e('Reset Log Entries', 'simple-download-monitor'); ?>" />
157
  </div>
158
  </form>
159
 
includes/sdm-latest-downloads.php CHANGED
@@ -40,7 +40,7 @@ function sdm_show_latest_downloads($args){
40
 
41
  // If no cpt's are found
42
  if (!$get_posts) {
43
- return '<p style="color: red;">' . __('There are no download items matching this shortcode criteria.', 'sdm_lang') . '</p>';
44
  }
45
  // Else iterate cpt's
46
  else {
40
 
41
  // If no cpt's are found
42
  if (!$get_posts) {
43
+ return '<p style="color: red;">' . __('There are no download items matching this shortcode criteria.', 'simple-download-monitor') . '</p>';
44
  }
45
  // Else iterate cpt's
46
  else {
includes/sdm-logs-list-table.php CHANGED
@@ -16,8 +16,8 @@ class sdm_List_Table extends WP_List_Table {
16
 
17
  //Set parent defaults
18
  parent::__construct(array(
19
- 'singular' => __('Download', 'sdm_lang'), //singular name of the listed records
20
- 'plural' => __('Downloads', 'sdm_lang'), //plural name of the listed records
21
  'ajax' => false //does this table support ajax?
22
  ));
23
  }
@@ -42,8 +42,8 @@ class sdm_List_Table extends WP_List_Table {
42
 
43
  //Build row actions
44
  $actions = array(
45
- 'edit' => sprintf('<a href="' . admin_url('post.php?post=' . $item['ID'] . '&action=edit') . '">' . __('Edit', 'sdm_lang') . '</a>'),
46
- 'delete' => sprintf('<a href="?post_type=sdm_downloads&page=%s&action=%s&download=%s&datetime=%s">' . __('Delete', 'sdm_lang') . '</a>', $_REQUEST['page'], 'delete', $item['ID'], $item['date'])
47
  );
48
 
49
  //Return the title contents
@@ -67,12 +67,12 @@ class sdm_List_Table extends WP_List_Table {
67
 
68
  $columns = array(
69
  'cb' => '<input type="checkbox" />', //Render a checkbox instead of text
70
- 'title' => __('Title', 'sdm_lang'),
71
- 'URL' => __('File', 'sdm_lang'),
72
- 'visitor_ip' => __('Visitor IP', 'sdm_lang'),
73
- 'date' => __('Date', 'sdm_lang'),
74
- 'visitor_country' => __('Country', 'sdm_lang'),
75
- 'visitor_name' => __('Username', 'sdm_lang')
76
  );
77
  return $columns;
78
  }
@@ -93,9 +93,9 @@ class sdm_List_Table extends WP_List_Table {
93
  function get_bulk_actions() {
94
 
95
  $actions = array();
96
- $actions['delete2'] = __('Delete Permanently', 'sdm_lang');
97
- $actions['export_all'] = __('Export All as Excel', 'sdm_lang');
98
- //$actions['export-selected'] = __( 'Export Selected', 'sdm_lang' );
99
 
100
  return $actions;
101
  }
@@ -109,7 +109,7 @@ class sdm_List_Table extends WP_List_Table {
109
  $action = 'bulk-' . $this->_args['plural'];
110
 
111
  if (!wp_verify_nonce($nonce, $action))
112
- wp_die(__('Nope! Security check failed!', 'sdm_lang'));
113
  }
114
 
115
  $action = $this->current_action();
@@ -117,14 +117,14 @@ class sdm_List_Table extends WP_List_Table {
117
  // If bulk 'Export All' was clicked
118
  if ('export_all' === $this->current_action()) {
119
 
120
- echo '<div id="message" class="updated"><p><strong><a id="sdm_download_export" href="?post_type=sdm_downloads&page=logs&download_log">' . __('Download Export File', 'sdm_lang') . '</a></strong></p></div>';
121
  }
122
 
123
  // if bulk 'Delete Permanently' was clicked
124
  if ('delete2' === $this->current_action()) {
125
 
126
  if (!isset($_POST['download']) || $_POST['download'] == null) {
127
- echo '<div id="message" class="updated fade"><p><strong>' . __('No entries were selected.', 'sdm_lang') . '</strong></p><p><em>' . __('Click to Dismiss', 'sdm_lang') . '</em></p></div>';
128
  return;
129
  }
130
 
@@ -140,9 +140,9 @@ class sdm_List_Table extends WP_List_Table {
140
  );
141
  }
142
  if ($del_row) {
143
- echo '<div id="message" class="updated fade"><p><strong>' . __('Entries Deleted!', 'sdm_lang') . '</strong></p><p><em>' . __('Click to Dismiss', 'sdm_lang') . '</em></p></div>';
144
  } else {
145
- echo '<div id="message" class="updated fade"><p><strong>' . __('Error', 'sdm_lang') . '</strong></p><p><em>' . __('Click to Dismiss', 'sdm_lang') . '</em></p></div>';
146
  }
147
  }
148
 
@@ -159,9 +159,9 @@ class sdm_List_Table extends WP_List_Table {
159
  AND date_time = "' . $item_datetime . '"'
160
  );
161
  if ($del_row) {
162
- echo '<div id="message" class="updated fade"><p><strong>' . __('Entry Deleted!', 'sdm_lang') . '</strong></p><p><em>' . __('Click to Dismiss', 'sdm_lang') . '</em></p></div>';
163
  } else {
164
- echo '<div id="message" class="updated fade"><p><strong>' . __('Error', 'sdm_lang') . '</strong></p><p><em>' . __('Click to Dismiss', 'sdm_lang') . '</em></p></div>';
165
  }
166
  }
167
  }
@@ -178,34 +178,35 @@ class sdm_List_Table extends WP_List_Table {
178
  $this->_column_headers = array($columns, $hidden, $sortable);
179
  $this->process_bulk_action();
180
 
181
- function usort_reorder($a, $b) {
182
- $orderby = (!empty($_REQUEST['orderby'])) ? $_REQUEST['orderby'] : 'title'; //If no sort, default to title
183
- $order = (!empty($_REQUEST['order'])) ? $_REQUEST['order'] : 'asc'; //If no order, default to asc
184
- $result = strcmp($a[$orderby], $b[$orderby]); //Determine sort order
185
- return ($order === 'asc') ? $result : -$result; //Send final sort direction to usort
 
186
  }
187
-
188
  //Do a query to find the total number of rows then calculate the query limit
189
  $table_name = $wpdb->prefix . 'sdm_downloads';
190
  $query = "SELECT COUNT(*) FROM $table_name";
191
- $total_items = $wpdb->get_var($query);
 
 
 
192
  $offset = ($current_page - 1) * $per_page;
193
- $query_limit =' LIMIT ' . (int) $offset . ',' . (int) $per_page;
 
 
194
 
195
- $data_results = $wpdb->get_results('SELECT * FROM ' . $wpdb->prefix . 'sdm_downloads'. $query_limit);
196
  $data = array();
197
  foreach ($data_results as $data_result) {
198
  $data[] = array('ID' => $data_result->post_id, 'title' => $data_result->post_title, 'URL' => $data_result->file_url, 'visitor_ip' => $data_result->visitor_ip, 'date' => $data_result->date_time, 'visitor_country' => $data_result->visitor_country, 'visitor_name' => $data_result->visitor_name);
199
  }
200
-
201
-
202
- usort($data, 'usort_reorder');
203
 
204
- //The following is not needed as it comes from the extra query and the query limit stuff
205
- //$total_items = count($data);
206
- //$data = array_slice($data, (($current_page - 1) * $per_page), $per_page);
207
 
208
- $this->items = $data;
209
  $this->set_pagination_args(array(
210
  'total_items' => $total_items, //WE have to calculate the total number of items
211
  'per_page' => $per_page, //WE have to determine how many items to show on a page
16
 
17
  //Set parent defaults
18
  parent::__construct(array(
19
+ 'singular' => __('Download', 'simple-download-monitor'), //singular name of the listed records
20
+ 'plural' => __('Downloads', 'simple-download-monitor'), //plural name of the listed records
21
  'ajax' => false //does this table support ajax?
22
  ));
23
  }
42
 
43
  //Build row actions
44
  $actions = array(
45
+ 'edit' => sprintf('<a href="' . admin_url('post.php?post=' . $item['ID'] . '&action=edit') . '">' . __('Edit', 'simple-download-monitor') . '</a>'),
46
+ 'delete' => sprintf('<a href="?post_type=sdm_downloads&page=%s&action=%s&download=%s&datetime=%s">' . __('Delete', 'simple-download-monitor') . '</a>', $_REQUEST['page'], 'delete', $item['ID'], $item['date'])
47
  );
48
 
49
  //Return the title contents
67
 
68
  $columns = array(
69
  'cb' => '<input type="checkbox" />', //Render a checkbox instead of text
70
+ 'title' => __('Title', 'simple-download-monitor'),
71
+ 'URL' => __('File', 'simple-download-monitor'),
72
+ 'visitor_ip' => __('Visitor IP', 'simple-download-monitor'),
73
+ 'date' => __('Date', 'simple-download-monitor'),
74
+ 'visitor_country' => __('Country', 'simple-download-monitor'),
75
+ 'visitor_name' => __('Username', 'simple-download-monitor')
76
  );
77
  return $columns;
78
  }
93
  function get_bulk_actions() {
94
 
95
  $actions = array();
96
+ $actions['delete2'] = __('Delete Permanently', 'simple-download-monitor');
97
+ $actions['export_all'] = __('Export All as Excel', 'simple-download-monitor');
98
+ //$actions['export-selected'] = __( 'Export Selected', 'simple-download-monitor' );
99
 
100
  return $actions;
101
  }
109
  $action = 'bulk-' . $this->_args['plural'];
110
 
111
  if (!wp_verify_nonce($nonce, $action))
112
+ wp_die(__('Nope! Security check failed!', 'simple-download-monitor'));
113
  }
114
 
115
  $action = $this->current_action();
117
  // If bulk 'Export All' was clicked
118
  if ('export_all' === $this->current_action()) {
119
 
120
+ echo '<div id="message" class="updated"><p><strong><a id="sdm_download_export" href="?post_type=sdm_downloads&page=logs&download_log">' . __('Download Export File', 'simple-download-monitor') . '</a></strong></p></div>';
121
  }
122
 
123
  // if bulk 'Delete Permanently' was clicked
124
  if ('delete2' === $this->current_action()) {
125
 
126
  if (!isset($_POST['download']) || $_POST['download'] == null) {
127
+ echo '<div id="message" class="updated fade"><p><strong>' . __('No entries were selected.', 'simple-download-monitor') . '</strong></p><p><em>' . __('Click to Dismiss', 'simple-download-monitor') . '</em></p></div>';
128
  return;
129
  }
130
 
140
  );
141
  }
142
  if ($del_row) {
143
+ echo '<div id="message" class="updated fade"><p><strong>' . __('Entries Deleted!', 'simple-download-monitor') . '</strong></p><p><em>' . __('Click to Dismiss', 'simple-download-monitor') . '</em></p></div>';
144
  } else {
145
+ echo '<div id="message" class="updated fade"><p><strong>' . __('Error', 'simple-download-monitor') . '</strong></p><p><em>' . __('Click to Dismiss', 'simple-download-monitor') . '</em></p></div>';
146
  }
147
  }
148
 
159
  AND date_time = "' . $item_datetime . '"'
160
  );
161
  if ($del_row) {
162
+ echo '<div id="message" class="updated fade"><p><strong>' . __('Entry Deleted!', 'simple-download-monitor') . '</strong></p><p><em>' . __('Click to Dismiss', 'simple-download-monitor') . '</em></p></div>';
163
  } else {
164
+ echo '<div id="message" class="updated fade"><p><strong>' . __('Error', 'simple-download-monitor') . '</strong></p><p><em>' . __('Click to Dismiss', 'simple-download-monitor') . '</em></p></div>';
165
  }
166
  }
167
  }
178
  $this->_column_headers = array($columns, $hidden, $sortable);
179
  $this->process_bulk_action();
180
 
181
+ // This checks for sorting input and passes that to the query (for sorting purpose).
182
+ $orderby_column = isset($_GET['orderby'])?$_GET['orderby']:'';
183
+ $sort_order = isset($_GET['order'])?$_GET['order']:'';
184
+ if(empty($orderby_column)){
185
+ $orderby_column = "date_time";
186
+ $sort_order = "DESC";
187
  }
188
+
189
  //Do a query to find the total number of rows then calculate the query limit
190
  $table_name = $wpdb->prefix . 'sdm_downloads';
191
  $query = "SELECT COUNT(*) FROM $table_name";
192
+ $total_items = $wpdb->get_var($query);//For pagination requirement
193
+
194
+ $query = "SELECT * FROM $table_name ORDER BY $orderby_column $sort_order";
195
+
196
  $offset = ($current_page - 1) * $per_page;
197
+ $query.=' LIMIT ' . (int) $offset . ',' . (int) $per_page;//Limit to query to only load a limited number of records
198
+
199
+ $data_results = $wpdb->get_results($query);
200
 
201
+ //Prepare the array with the correct index names that the table is expecting.
202
  $data = array();
203
  foreach ($data_results as $data_result) {
204
  $data[] = array('ID' => $data_result->post_id, 'title' => $data_result->post_title, 'URL' => $data_result->file_url, 'visitor_ip' => $data_result->visitor_ip, 'date' => $data_result->date_time, 'visitor_country' => $data_result->visitor_country, 'visitor_name' => $data_result->visitor_name);
205
  }
 
 
 
206
 
207
+ // Now we add our *sorted* data to the items property, where it can be used by the rest of the class.
208
+ $this->items = $data;
 
209
 
 
210
  $this->set_pagination_args(array(
211
  'total_items' => $total_items, //WE have to calculate the total number of items
212
  'per_page' => $per_page, //WE have to determine how many items to show on a page
includes/sdm-utility-functions.php CHANGED
@@ -39,7 +39,7 @@ function sdm_redirect_to_url($url, $delay = '0', $exit = '1') {
39
  $url = apply_filters('sdm_before_redirect_to_url',$url);
40
  if (empty($url)) {
41
  echo '<strong>';
42
- _e('Error! The URL value is empty. Please specify a correct URL value to redirect to!', 'sdm_lang');
43
  echo '</strong>';
44
  exit;
45
  }
39
  $url = apply_filters('sdm_before_redirect_to_url',$url);
40
  if (empty($url)) {
41
  echo '<strong>';
42
+ _e('Error! The URL value is empty. Please specify a correct URL value to redirect to!', 'simple-download-monitor');
43
  echo '</strong>';
44
  exit;
45
  }
includes/templates/fancy0/sdm-fancy-0.php CHANGED
@@ -60,7 +60,7 @@ function sdm_generate_fancy0_display_output($args) {
60
  // See if user color option is selected
61
  $main_opts = get_option('sdm_downloads_options');
62
  $color_opt = $main_opts['download_button_color'];
63
- $def_color = isset($color_opt) ? str_replace(' ', '', strtolower($color_opt)) : __('green', 'sdm_lang');
64
 
65
  //See if new window parameter is seet
66
  $window_target = '';
@@ -71,7 +71,7 @@ function sdm_generate_fancy0_display_output($args) {
71
  //Get the download button text
72
  $button_text = isset($args['button_text']) ? $args['button_text'] : '';
73
  if (empty($button_text)) {//Use the default text for the button
74
- $button_text_string = __('Download Now!', 'sdm_lang');
75
  } else {//Use the custom text
76
  $button_text_string = $button_text;
77
  }
60
  // See if user color option is selected
61
  $main_opts = get_option('sdm_downloads_options');
62
  $color_opt = $main_opts['download_button_color'];
63
+ $def_color = isset($color_opt) ? str_replace(' ', '', strtolower($color_opt)) : __('green', 'simple-download-monitor');
64
 
65
  //See if new window parameter is seet
66
  $window_target = '';
71
  //Get the download button text
72
  $button_text = isset($args['button_text']) ? $args['button_text'] : '';
73
  if (empty($button_text)) {//Use the default text for the button
74
+ $button_text_string = __('Download Now!', 'simple-download-monitor');
75
  } else {//Use the custom text
76
  $button_text_string = $button_text;
77
  }
includes/templates/fancy1/sdm-fancy-1.php CHANGED
@@ -61,7 +61,7 @@ function sdm_generate_fancy1_display_output($args) {
61
  // See if user color option is selected
62
  $main_opts = get_option('sdm_downloads_options');
63
  $color_opt = $main_opts['download_button_color'];
64
- $def_color = isset($color_opt) ? str_replace(' ', '', strtolower($color_opt)) : __('green', 'sdm_lang');
65
 
66
  //See if new window parameter is seet
67
  $window_target = '';
@@ -72,7 +72,7 @@ function sdm_generate_fancy1_display_output($args) {
72
  //Get the download button text
73
  $button_text = isset($args['button_text']) ? $args['button_text'] : '';
74
  if (empty($button_text)) {//Use the default text for the button
75
- $button_text_string = __('Download Now!', 'sdm_lang');
76
  } else {//Use the custom text
77
  $button_text_string = $button_text;
78
  }
@@ -104,7 +104,7 @@ function sdm_generate_fancy1_display_output($args) {
104
  }
105
 
106
  $db_count = sdm_get_download_count_for_post($id);
107
- $string = ($db_count == '1') ? __('Download', 'sdm_lang') : __('Downloads', 'sdm_lang');
108
  $download_count_string = '<span class="sdm_item_count_number">' . $db_count . '</span><span class="sdm_item_count_string"> ' . $string . '</span>';
109
 
110
  $css_class = isset($args['css_class']) ? $args['css_class'] : '';
61
  // See if user color option is selected
62
  $main_opts = get_option('sdm_downloads_options');
63
  $color_opt = $main_opts['download_button_color'];
64
+ $def_color = isset($color_opt) ? str_replace(' ', '', strtolower($color_opt)) : __('green', 'simple-download-monitor');
65
 
66
  //See if new window parameter is seet
67
  $window_target = '';
72
  //Get the download button text
73
  $button_text = isset($args['button_text']) ? $args['button_text'] : '';
74
  if (empty($button_text)) {//Use the default text for the button
75
+ $button_text_string = __('Download Now!', 'simple-download-monitor');
76
  } else {//Use the custom text
77
  $button_text_string = $button_text;
78
  }
104
  }
105
 
106
  $db_count = sdm_get_download_count_for_post($id);
107
+ $string = ($db_count == '1') ? __('Download', 'simple-download-monitor') : __('Downloads', 'simple-download-monitor');
108
  $download_count_string = '<span class="sdm_item_count_number">' . $db_count . '</span><span class="sdm_item_count_string"> ' . $string . '</span>';
109
 
110
  $css_class = isset($args['css_class']) ? $args['css_class'] : '';
includes/templates/fancy2/sdm-fancy-2.php CHANGED
@@ -89,7 +89,7 @@ function sdm_generate_fancy2_display_output($args) {
89
  //Get the download button text
90
  $button_text = isset($args['button_text']) ? $args['button_text'] : '';
91
  if (empty($button_text)) {//Use the default text for the button
92
- $button_text_string = __('Download Now!', 'sdm_lang');
93
  } else {//Use the custom text
94
  $button_text_string = $button_text;
95
  }
89
  //Get the download button text
90
  $button_text = isset($args['button_text']) ? $args['button_text'] : '';
91
  if (empty($button_text)) {//Use the default text for the button
92
+ $button_text_string = __('Download Now!', 'simple-download-monitor');
93
  } else {//Use the custom text
94
  $button_text_string = $button_text;
95
  }
langs/SDM.mo DELETED
Binary file
langs/SDM.po DELETED
@@ -1,342 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: simple-download-monitor\n"
4
- "POT-Creation-Date: 2013-11-01 01:22-0500\n"
5
- "PO-Revision-Date: 2013-11-01 01:24-0500\n"
6
- "Last-Translator: \n"
7
- "Language-Team: \n"
8
- "MIME-Version: 1.0\n"
9
- "Content-Type: text/plain; charset=UTF-8\n"
10
- "Content-Transfer-Encoding: 8bit\n"
11
- "X-Generator: Poedit 1.5.5\n"
12
- "X-Poedit-KeywordsList: __;_e;_x\n"
13
- "X-Poedit-Basepath: .\n"
14
- "X-Poedit-SourceCharset: UTF-8\n"
15
- "X-Poedit-SearchPath-0: .\n"
16
- "X-Poedit-SearchPath-1: ..\n"
17
-
18
- #: ../main.php:63 ../main.php:262
19
- msgid "Settings"
20
- msgstr ""
21
-
22
- #: ../main.php:134 ../main.php:135 ../main.php:140 ../main.php:146
23
- #: ../main.php:974
24
- msgid "Downloads"
25
- msgstr ""
26
-
27
- #: ../main.php:136 ../main.php:137
28
- msgid "Add New"
29
- msgstr ""
30
-
31
- #: ../main.php:138
32
- msgid "Edit Download"
33
- msgstr ""
34
-
35
- #: ../main.php:139
36
- msgid "New Download"
37
- msgstr ""
38
-
39
- #: ../main.php:141
40
- msgid "View Download"
41
- msgstr ""
42
-
43
- #: ../main.php:142
44
- msgid "Search Downloads"
45
- msgstr ""
46
-
47
- #: ../main.php:143
48
- msgid "No Downloads found"
49
- msgstr ""
50
-
51
- #: ../main.php:144
52
- msgid "No Downloads found in Trash"
53
- msgstr ""
54
-
55
- #: ../main.php:170 ../main.php:180 ../main.php:972
56
- msgid "Categories"
57
- msgstr ""
58
-
59
- #: ../main.php:171
60
- msgid "Category"
61
- msgstr ""
62
-
63
- #: ../main.php:172
64
- msgid "Search Categories"
65
- msgstr ""
66
-
67
- #: ../main.php:173
68
- msgid "All Categories"
69
- msgstr ""
70
-
71
- #: ../main.php:174
72
- msgid "Categories Genre"
73
- msgstr ""
74
-
75
- #: ../main.php:175
76
- msgid "Categories Genre:"
77
- msgstr ""
78
-
79
- #: ../main.php:176
80
- msgid "Edit Category"
81
- msgstr ""
82
-
83
- #: ../main.php:177
84
- msgid "Update Category"
85
- msgstr ""
86
-
87
- #: ../main.php:178
88
- msgid "Add New Category"
89
- msgstr ""
90
-
91
- #: ../main.php:179
92
- msgid "New Category"
93
- msgstr ""
94
-
95
- #: ../main.php:195 ../main.php:205 ../main.php:973
96
- msgid "Tags"
97
- msgstr ""
98
-
99
- #: ../main.php:196
100
- msgid "Tag"
101
- msgstr ""
102
-
103
- #: ../main.php:197
104
- msgid "Search Tags"
105
- msgstr ""
106
-
107
- #: ../main.php:198
108
- msgid "All Tags"
109
- msgstr ""
110
-
111
- #: ../main.php:199
112
- msgid "Tags Genre"
113
- msgstr ""
114
-
115
- #: ../main.php:200
116
- msgid "Tags Genre:"
117
- msgstr ""
118
-
119
- #: ../main.php:201
120
- msgid "Edit Tag"
121
- msgstr ""
122
-
123
- #: ../main.php:202
124
- msgid "Update Tag"
125
- msgstr ""
126
-
127
- #: ../main.php:203
128
- msgid "Add New Tag"
129
- msgstr ""
130
-
131
- #: ../main.php:204
132
- msgid "New Tag"
133
- msgstr ""
134
-
135
- #: ../main.php:261
136
- msgid "Logs"
137
- msgstr ""
138
-
139
- #: ../main.php:270
140
- msgid "Simple Download Monitor Settings Page"
141
- msgstr ""
142
-
143
- #: ../main.php:278 ../main.php:514
144
- msgid "Admin Options"
145
- msgstr ""
146
-
147
- #: ../main.php:281
148
- msgid "Control various plugin features."
149
- msgstr ""
150
-
151
- #: ../main.php:284 ../main.php:307
152
- msgid "Expand Option Panel"
153
- msgstr ""
154
-
155
- #: ../main.php:301
156
- msgid "Color Options"
157
- msgstr ""
158
-
159
- #: ../main.php:304
160
- msgid "Adjust color options"
161
- msgstr ""
162
-
163
- #: ../main.php:376
164
- msgid "Description"
165
- msgstr ""
166
-
167
- #: ../main.php:381
168
- msgid "Upload File"
169
- msgstr ""
170
-
171
- #: ../main.php:386
172
- msgid "File Thumbnail"
173
- msgstr ""
174
-
175
- #: ../main.php:391
176
- msgid "Shortcode"
177
- msgstr ""
178
-
179
- #: ../main.php:396
180
- msgid "Statistics"
181
- msgstr ""
182
-
183
- #: ../main.php:404
184
- msgid "Add a description for this download item."
185
- msgstr ""
186
-
187
- #: ../main.php:418
188
- msgid "Click \"Select File\" to upload (or choose) the file."
189
- msgstr ""
190
-
191
- #: ../main.php:423
192
- msgid "File:"
193
- msgstr ""
194
-
195
- #: ../main.php:432
196
- msgid "Click \"Select Image\" to upload (or choose) the file thumbnail image."
197
- msgstr ""
198
-
199
- #: ../main.php:434
200
- msgid "Recommended image size is 75px by 75px."
201
- msgstr ""
202
-
203
- #: ../main.php:437
204
- msgid "Select Image"
205
- msgstr ""
206
-
207
- #: ../main.php:438
208
- msgid "Remove Image"
209
- msgstr ""
210
-
211
- #: ../main.php:453
212
- msgid ""
213
- "This is the shortcode which can used on posts or pages for this download."
214
- msgstr ""
215
-
216
- #: ../main.php:460
217
- msgid "These are the statistics for this download item."
218
- msgstr ""
219
-
220
- #: ../main.php:465
221
- msgid "Number of Downloads:"
222
- msgstr ""
223
-
224
- #: ../main.php:515
225
- msgid "Colors"
226
- msgstr ""
227
-
228
- #: ../main.php:517
229
- msgid "Remove Tinymce Button"
230
- msgstr ""
231
-
232
- #: ../main.php:518
233
- msgid "Download Button Color"
234
- msgstr ""
235
-
236
- #: ../main.php:521
237
- msgid "Admin options settings"
238
- msgstr ""
239
-
240
- #: ../main.php:524
241
- msgid "Front End colors settings"
242
- msgstr ""
243
-
244
- #: ../main.php:529
245
- msgid "Removes the SDM Downloads button from the WP content editor."
246
- msgstr ""
247
-
248
- #: ../main.php:534
249
- msgid "Green"
250
- msgstr ""
251
-
252
- #: ../main.php:534
253
- msgid "Blue"
254
- msgstr ""
255
-
256
- #: ../main.php:534
257
- msgid "Purple"
258
- msgstr ""
259
-
260
- #: ../main.php:534
261
- msgid "Teal"
262
- msgstr ""
263
-
264
- #: ../main.php:534
265
- msgid "Dark Blue"
266
- msgstr ""
267
-
268
- #: ../main.php:534
269
- msgid "Black"
270
- msgstr ""
271
-
272
- #: ../main.php:534
273
- msgid "Grey"
274
- msgstr ""
275
-
276
- #: ../main.php:534
277
- msgid "Pink"
278
- msgstr ""
279
-
280
- #: ../main.php:534
281
- msgid "Orange"
282
- msgstr ""
283
-
284
- #: ../main.php:534
285
- msgid "White"
286
- msgstr ""
287
-
288
- #: ../main.php:543
289
- msgid "Adjusts the color of the \"Download Now\" button."
290
- msgstr ""
291
-
292
- #: ../main.php:622 ../main.php:969
293
- msgid "Title"
294
- msgstr ""
295
-
296
- #: ../main.php:623 ../main.php:971
297
- msgid "File"
298
- msgstr ""
299
-
300
- #: ../main.php:624
301
- msgid "Visitor IP"
302
- msgstr ""
303
-
304
- #: ../main.php:625
305
- msgid "Date"
306
- msgstr ""
307
-
308
- #: ../main.php:644
309
- msgid "Delete Permanently"
310
- msgstr ""
311
-
312
- #: ../main.php:645
313
- msgid "Export All as Excel"
314
- msgstr ""
315
-
316
- #: ../main.php:773
317
- msgid "Download Logs"
318
- msgstr ""
319
-
320
- #: ../main.php:776
321
- msgid "This page lists all tracked downloads."
322
- msgstr ""
323
-
324
- #: ../main.php:836
325
- msgid "green"
326
- msgstr ""
327
-
328
- #: ../main.php:841 ../main.php:853
329
- msgid "Download Now!"
330
- msgstr ""
331
-
332
- #: ../main.php:968
333
- msgid "Image"
334
- msgstr ""
335
-
336
- #: ../main.php:970
337
- msgid "ID"
338
- msgstr ""
339
-
340
- #: ../main.php:975
341
- msgid "Date Posted"
342
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
langs/sdm_lang.mo DELETED
Binary file
langs/sdm_lang.po DELETED
@@ -1,342 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: simple-download-monitor\n"
4
- "POT-Creation-Date: 2013-11-01 01:22-0500\n"
5
- "PO-Revision-Date: 2013-11-01 01:24-0500\n"
6
- "Last-Translator: \n"
7
- "Language-Team: \n"
8
- "MIME-Version: 1.0\n"
9
- "Content-Type: text/plain; charset=UTF-8\n"
10
- "Content-Transfer-Encoding: 8bit\n"
11
- "X-Generator: Poedit 1.5.5\n"
12
- "X-Poedit-KeywordsList: __;_e;_x\n"
13
- "X-Poedit-Basepath: .\n"
14
- "X-Poedit-SourceCharset: UTF-8\n"
15
- "X-Poedit-SearchPath-0: .\n"
16
- "X-Poedit-SearchPath-1: ..\n"
17
-
18
- #: ../main.php:63 ../main.php:262
19
- msgid "Settings"
20
- msgstr ""
21
-
22
- #: ../main.php:134 ../main.php:135 ../main.php:140 ../main.php:146
23
- #: ../main.php:974
24
- msgid "Downloads"
25
- msgstr ""
26
-
27
- #: ../main.php:136 ../main.php:137
28
- msgid "Add New"
29
- msgstr ""
30
-
31
- #: ../main.php:138
32
- msgid "Edit Download"
33
- msgstr ""
34
-
35
- #: ../main.php:139
36
- msgid "New Download"
37
- msgstr ""
38
-
39
- #: ../main.php:141
40
- msgid "View Download"
41
- msgstr ""
42
-
43
- #: ../main.php:142
44
- msgid "Search Downloads"
45
- msgstr ""
46
-
47
- #: ../main.php:143
48
- msgid "No Downloads found"
49
- msgstr ""
50
-
51
- #: ../main.php:144
52
- msgid "No Downloads found in Trash"
53
- msgstr ""
54
-
55
- #: ../main.php:170 ../main.php:180 ../main.php:972
56
- msgid "Categories"
57
- msgstr ""
58
-
59
- #: ../main.php:171
60
- msgid "Category"
61
- msgstr ""
62
-
63
- #: ../main.php:172
64
- msgid "Search Categories"
65
- msgstr ""
66
-
67
- #: ../main.php:173
68
- msgid "All Categories"
69
- msgstr ""
70
-
71
- #: ../main.php:174
72
- msgid "Categories Genre"
73
- msgstr ""
74
-
75
- #: ../main.php:175
76
- msgid "Categories Genre:"
77
- msgstr ""
78
-
79
- #: ../main.php:176
80
- msgid "Edit Category"
81
- msgstr ""
82
-
83
- #: ../main.php:177
84
- msgid "Update Category"
85
- msgstr ""
86
-
87
- #: ../main.php:178
88
- msgid "Add New Category"
89
- msgstr ""
90
-
91
- #: ../main.php:179
92
- msgid "New Category"
93
- msgstr ""
94
-
95
- #: ../main.php:195 ../main.php:205 ../main.php:973
96
- msgid "Tags"
97
- msgstr ""
98
-
99
- #: ../main.php:196
100
- msgid "Tag"
101
- msgstr ""
102
-
103
- #: ../main.php:197
104
- msgid "Search Tags"
105
- msgstr ""
106
-
107
- #: ../main.php:198
108
- msgid "All Tags"
109
- msgstr ""
110
-
111
- #: ../main.php:199
112
- msgid "Tags Genre"
113
- msgstr ""
114
-
115
- #: ../main.php:200
116
- msgid "Tags Genre:"
117
- msgstr ""
118
-
119
- #: ../main.php:201
120
- msgid "Edit Tag"
121
- msgstr ""
122
-
123
- #: ../main.php:202
124
- msgid "Update Tag"
125
- msgstr ""
126
-
127
- #: ../main.php:203
128
- msgid "Add New Tag"
129
- msgstr ""
130
-
131
- #: ../main.php:204
132
- msgid "New Tag"
133
- msgstr ""
134
-
135
- #: ../main.php:261
136
- msgid "Logs"
137
- msgstr ""
138
-
139
- #: ../main.php:270
140
- msgid "Simple Download Monitor Settings Page"
141
- msgstr ""
142
-
143
- #: ../main.php:278 ../main.php:514
144
- msgid "Admin Options"
145
- msgstr ""
146
-
147
- #: ../main.php:281
148
- msgid "Control various plugin features."
149
- msgstr ""
150
-
151
- #: ../main.php:284 ../main.php:307
152
- msgid "Expand Option Panel"
153
- msgstr ""
154
-
155
- #: ../main.php:301
156
- msgid "Color Options"
157
- msgstr ""
158
-
159
- #: ../main.php:304
160
- msgid "Adjust color options"
161
- msgstr ""
162
-
163
- #: ../main.php:376
164
- msgid "Description"
165
- msgstr ""
166
-
167
- #: ../main.php:381
168
- msgid "Upload File"
169
- msgstr ""
170
-
171
- #: ../main.php:386
172
- msgid "File Thumbnail"
173
- msgstr ""
174
-
175
- #: ../main.php:391
176
- msgid "Shortcode"
177
- msgstr ""
178
-
179
- #: ../main.php:396
180
- msgid "Statistics"
181
- msgstr ""
182
-
183
- #: ../main.php:404
184
- msgid "Add a description for this download item."
185
- msgstr ""
186
-
187
- #: ../main.php:418
188
- msgid "Click \"Select File\" to upload (or choose) the file."
189
- msgstr ""
190
-
191
- #: ../main.php:423
192
- msgid "File:"
193
- msgstr ""
194
-
195
- #: ../main.php:432
196
- msgid "Click \"Select Image\" to upload (or choose) the file thumbnail image."
197
- msgstr ""
198
-
199
- #: ../main.php:434
200
- msgid "Recommended image size is 75px by 75px."
201
- msgstr ""
202
-
203
- #: ../main.php:437
204
- msgid "Select Image"
205
- msgstr ""
206
-
207
- #: ../main.php:438
208
- msgid "Remove Image"
209
- msgstr ""
210
-
211
- #: ../main.php:453
212
- msgid ""
213
- "This is the shortcode which can used on posts or pages for this download."
214
- msgstr ""
215
-
216
- #: ../main.php:460
217
- msgid "These are the statistics for this download item."
218
- msgstr ""
219
-
220
- #: ../main.php:465
221
- msgid "Number of Downloads:"
222
- msgstr ""
223
-
224
- #: ../main.php:515
225
- msgid "Colors"
226
- msgstr ""
227
-
228
- #: ../main.php:517
229
- msgid "Remove Tinymce Button"
230
- msgstr ""
231
-
232
- #: ../main.php:518
233
- msgid "Download Button Color"
234
- msgstr ""
235
-
236
- #: ../main.php:521
237
- msgid "Admin options settings"
238
- msgstr ""
239
-
240
- #: ../main.php:524
241
- msgid "Front End colors settings"
242
- msgstr ""
243
-
244
- #: ../main.php:529
245
- msgid "Removes the SDM Downloads button from the WP content editor."
246
- msgstr ""
247
-
248
- #: ../main.php:534
249
- msgid "Green"
250
- msgstr ""
251
-
252
- #: ../main.php:534
253
- msgid "Blue"
254
- msgstr ""
255
-
256
- #: ../main.php:534
257
- msgid "Purple"
258
- msgstr ""
259
-
260
- #: ../main.php:534
261
- msgid "Teal"
262
- msgstr ""
263
-
264
- #: ../main.php:534
265
- msgid "Dark Blue"
266
- msgstr ""
267
-
268
- #: ../main.php:534
269
- msgid "Black"
270
- msgstr ""
271
-
272
- #: ../main.php:534
273
- msgid "Grey"
274
- msgstr ""
275
-
276
- #: ../main.php:534
277
- msgid "Pink"
278
- msgstr ""
279
-
280
- #: ../main.php:534
281
- msgid "Orange"
282
- msgstr ""
283
-
284
- #: ../main.php:534
285
- msgid "White"
286
- msgstr ""
287
-
288
- #: ../main.php:543
289
- msgid "Adjusts the color of the \"Download Now\" button."
290
- msgstr ""
291
-
292
- #: ../main.php:622 ../main.php:969
293
- msgid "Title"
294
- msgstr ""
295
-
296
- #: ../main.php:623 ../main.php:971
297
- msgid "File"
298
- msgstr ""
299
-
300
- #: ../main.php:624
301
- msgid "Visitor IP"
302
- msgstr ""
303
-
304
- #: ../main.php:625
305
- msgid "Date"
306
- msgstr ""
307
-
308
- #: ../main.php:644
309
- msgid "Delete Permanently"
310
- msgstr ""
311
-
312
- #: ../main.php:645
313
- msgid "Export All as Excel"
314
- msgstr ""
315
-
316
- #: ../main.php:773
317
- msgid "Download Logs"
318
- msgstr ""
319
-
320
- #: ../main.php:776
321
- msgid "This page lists all tracked downloads."
322
- msgstr ""
323
-
324
- #: ../main.php:836
325
- msgid "green"
326
- msgstr ""
327
-
328
- #: ../main.php:841 ../main.php:853
329
- msgid "Download Now!"
330
- msgstr ""
331
-
332
- #: ../main.php:968
333
- msgid "Image"
334
- msgstr ""
335
-
336
- #: ../main.php:970
337
- msgid "ID"
338
- msgstr ""
339
-
340
- #: ../main.php:975
341
- msgid "Date Posted"
342
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
langs/{sdm_lang-de_DE.mo → simple-download-monitor-de_DE.mo} RENAMED
File without changes
langs/{sdm_lang-de_DE.po → simple-download-monitor-de_DE.po} RENAMED
File without changes
langs/{sdm_lang-es_ES.mo → simple-download-monitor-es_ES.mo} RENAMED
File without changes
langs/{sdm_lang-es_ES.po → simple-download-monitor-es_ES.po} RENAMED
File without changes
langs/{sdm_lang-it_IT.mo → simple-download-monitor-it_IT.mo} RENAMED
File without changes
langs/{sdm_lang-it_IT.po → simple-download-monitor-it_IT.po} RENAMED
File without changes
langs/{sdm_lang-nl_NL.mo → simple-download-monitor-nl_NL.mo} RENAMED
File without changes
langs/{sdm_lang-nl_NL.po → simple-download-monitor-nl_NL.po} RENAMED
File without changes
langs/{sdm_lang-pt_BR.mo → simple-download-monitor-pt_BR.mo} RENAMED
File without changes
langs/{sdm_lang-pt_BR.po → simple-download-monitor-pt_BR.po} RENAMED
File without changes
langs/{sdm_lang-ru_RU.mo → simple-download-monitor-ru_RU.mo} RENAMED
File without changes
langs/{sdm_lang-ru_RU.po → simple-download-monitor-ru_RU.po} RENAMED
File without changes
langs/{sdm_lang.pot → simple-download-monitor.pot} RENAMED
File without changes
main.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Simple Download Monitor
4
  * Plugin URI: https://www.tipsandtricks-hq.com/simple-wordpress-download-monitor-plugin
5
  * Description: Easily manage downloadable files and monitor downloads of your digital files from your WordPress site.
6
- * Version: 3.2.5
7
  * Author: Tips and Tricks HQ, Ruhul Amin, Josh Lobe
8
  * Author URI: https://www.tipsandtricks-hq.com/development-center
9
  * License: GPL2
@@ -13,7 +13,7 @@ if (!defined('ABSPATH')) {
13
  exit;
14
  }
15
 
16
- define('WP_SIMPLE_DL_MONITOR_VERSION', '3.2.5');
17
  define('WP_SIMPLE_DL_MONITOR_DIR_NAME', dirname(plugin_basename(__FILE__)));
18
  define('WP_SIMPLE_DL_MONITOR_URL', plugins_url('', __FILE__));
19
  define('WP_SIMPLE_DL_MONITOR_PATH', plugin_dir_path(__FILE__));
@@ -69,7 +69,7 @@ function sdm_install_db_table() {
69
  add_action('plugins_loaded', 'sdm_plugins_loaded_tasks');
70
  function sdm_plugins_loaded_tasks() {
71
  //Load language
72
- load_plugin_textdomain('sdm_lang', false, dirname(plugin_basename(__FILE__)) . '/langs/');
73
 
74
  //Handle db upgrade stuff
75
  sdm_db_update_check();
@@ -104,7 +104,7 @@ function sdm_settings_link($links, $file) {
104
  if (!$this_plugin)
105
  $this_plugin = plugin_basename(__FILE__);
106
  if ($file == $this_plugin) {
107
- $settings_link = '<a href="edit.php?post_type=sdm_downloads&page=settings" title="SDM Settings Page">' . __("Settings", 'sdm_lang') . '</a>';
108
  array_unshift($links, $settings_link);
109
  }
110
  return $links;
@@ -158,8 +158,8 @@ class simpleDownloadManager {
158
  <?php
159
  // Localize langauge strings used in js file
160
  $sdmTranslations = array(
161
- 'image_removed' => __('Image Successfully Removed', 'sdm_lang'),
162
- 'ajax_error' => __('Error with AJAX', 'sdm_lang')
163
  );
164
  wp_localize_script('sdm-upload', 'sdm_translations', $sdmTranslations);
165
  }
@@ -169,7 +169,13 @@ class simpleDownloadManager {
169
  <script type="text/javascript">
170
  var sdm_admin_ajax_url = {sdm_admin_ajax_url: '<?php echo admin_url('admin-ajax.php?action=ajax'); ?>'};
171
  var sdm_plugin_url = '<?php echo plugins_url(); ?>';
172
- var tinymce_langs = {select_download_item: '<?php _e('Please select a Download Item:', 'sdm_lang') ?>', download_title: '<?php _e('Download Title', 'sdm_lang') ?>', include_fancy: '<?php _e('Include Fancy Box', 'sdm_lang') ?>', insert_shortcode: '<?php _e('Insert SDM Shortcode', 'sdm_lang') ?>'};
 
 
 
 
 
 
173
  </script>
174
  <?php
175
  }
@@ -179,7 +185,7 @@ class simpleDownloadManager {
179
  // Pass language strings to frontend of WP for js usage
180
  ?>
181
  <script type="text/javascript">
182
- var sdm_frontend_translations = {incorrect_password: '<?php _e('Incorrect Password', 'sdm_lang') ?>'};
183
  </script>
184
  <?php
185
  }
@@ -200,20 +206,20 @@ class simpleDownloadManager {
200
 
201
  //*****
202
  //***** Create metaboxes for the custom post type
203
- add_meta_box('sdm_description_meta_box', __('Description', 'sdm_lang'), array(&$this, 'display_sdm_description_meta_box'), 'sdm_downloads', 'normal', 'default'
204
  );
205
- add_meta_box('sdm_upload_meta_box', __('Upload File', 'sdm_lang'), array(&$this, 'display_sdm_upload_meta_box'), 'sdm_downloads', 'normal', 'default'
206
  );
207
- add_meta_box('sdm_thumbnail_meta_box', __('File Thumbnail (Optional)', 'sdm_lang'), array(&$this, 'display_sdm_thumbnail_meta_box'), 'sdm_downloads', 'normal', 'default'
208
  );
209
- add_meta_box('sdm_shortcode_meta_box', __('Shortcodes', 'sdm_lang'), array(&$this, 'display_sdm_shortcode_meta_box'), 'sdm_downloads', 'normal', 'default'
210
  );
211
- add_meta_box('sdm_stats_meta_box', __('Statistics', 'sdm_lang'), array(&$this, 'display_sdm_stats_meta_box'), 'sdm_downloads', 'normal', 'default'
212
  );
213
  }
214
 
215
  public function display_sdm_description_meta_box($post) { // Description metabox
216
- _e('Add a description for this download item.', 'sdm_lang');
217
  echo '<br /><br />';
218
 
219
  $old_description = get_post_meta($post->ID, 'sdm_description', true);
@@ -226,12 +232,12 @@ class simpleDownloadManager {
226
  public function display_sdm_upload_meta_box($post) { // File Upload metabox
227
  $old_upload = get_post_meta($post->ID, 'sdm_upload', true);
228
  $old_value = isset($old_upload) ? $old_upload : '';
229
- _e('Click "Select File" to upload (or choose) the file.', 'sdm_lang');
230
  ?>
231
  <br /><br />
232
- <input id="upload_image_button" type="button" class="button-primary" value="<?php _e('Select File', 'sdm_lang'); ?>" />
233
  <span style="margin-left:40px;"></span>
234
- <?php _e('File URL:', 'sdm_lang') ?> <input id="sdm_upload" type="text" size="70" name="sdm_upload" value="<?php echo $old_value; ?>" placeholder="http://..." />
235
  <?php
236
  wp_nonce_field('sdm_upload_box_nonce', 'sdm_upload_box_nonce_check');
237
  }
@@ -239,15 +245,15 @@ class simpleDownloadManager {
239
  public function display_sdm_thumbnail_meta_box($post) { // Thumbnail upload metabox
240
  $old_thumbnail = get_post_meta($post->ID, 'sdm_upload_thumbnail', true);
241
  $old_value = isset($old_thumbnail) ? $old_thumbnail : '';
242
- _e('Manually enter a valid URL, or click "Select Image" to upload (or choose) the file thumbnail image.', 'sdm_lang');
243
  echo '<br />';
244
- _e('This thumbnail image will be used to create a fancy file download box if you want to use it.', 'sdm_lang');
245
  ?>
246
  <br /><br />
247
  <input id="sdm_upload_thumbnail" type="text" size="70" name="sdm_upload_thumbnail" value="<?php echo $old_value; ?>" placeholder="http://..." />
248
  <br />
249
- <input id="upload_thumbnail_button" type="button" class="button-primary" value="<?php _e('Select Image', 'sdm_lang'); ?>" />
250
- <input id="remove_thumbnail_button" type="button" class="button" value="<?php _e('Remove Image', 'sdm_lang'); ?>" />
251
  <br /><br />
252
 
253
  <span id="sdm_admin_thumb_preview">
@@ -261,12 +267,12 @@ class simpleDownloadManager {
261
  }
262
 
263
  public function display_sdm_shortcode_meta_box($post) { // Shortcode metabox
264
- _e('This is the shortcode which can used on posts or pages to embed a download now button for this file. You can also use the shortcode inserter to add this shortcode to a post or page.', 'sdm_lang');
265
  echo '<br />';
266
  echo '[sdm_download id="' . $post->ID . '" fancy="0"]';
267
  echo '<br /><br />';
268
 
269
- _e('This shortcode may be used as a download counter.', 'sdm_lang');
270
  echo '<br />';
271
  echo '[sdm_download_counter id="' . $post->ID . '"]';
272
  }
@@ -279,22 +285,22 @@ class simpleDownloadManager {
279
  $no_logs = get_post_meta($post->ID, 'sdm_item_no_log', true);
280
  $checked = isset($no_logs) && $no_logs === 'on' ? 'checked="checked"' : '';
281
 
282
- _e('These are the statistics for this download item.', 'sdm_lang');
283
  echo '<br /><br />';
284
 
285
  global $wpdb;
286
  $wpdb->get_results($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'sdm_downloads WHERE post_id=%s', $post->ID));
287
- _e('Number of Downloads:', 'sdm_lang');
288
  echo ' <strong>' . $wpdb->num_rows . '</strong>';
289
  echo '<span style="margin-left: 20px;"></span>';
290
- _e('Offset Count', 'sdm_lang');
291
  echo ' <input type="text" style="width:50px;" name="sdm_count_offset" value="' . $value . '" />';
292
  echo ' <img src="' . WP_SIMPLE_DL_MONITOR_URL . '/css/images/info.png" style="margin-left:10px;" title="Enter any positive or negative numerical value; to offset the download count shown, when using the download counter shortcode." />';
293
 
294
  echo '<br /><br />';
295
  echo '<input type="checkbox" name="sdm_item_no_log" '.$checked.' />';
296
  echo '<span style="margin-left: 5px;"></span>';
297
- _e('Disable download logging for this item.', 'sdm_lang');
298
 
299
  wp_nonce_field('sdm_count_offset_nonce', 'sdm_count_offset_nonce_check');
300
  }
@@ -365,54 +371,54 @@ class simpleDownloadManager {
365
  public function sdm_register_options() {
366
 
367
  register_setting('sdm_downloads_options', 'sdm_downloads_options');
368
- add_settings_section('admin_options', __('Admin Options', 'sdm_lang'), array($this, 'admin_options_cb'), 'admin_options_section');
369
- add_settings_section('sdm_colors', __('Colors', 'sdm_lang'), array($this, 'sdm_colors_cb'), 'sdm_colors_section');
370
 
371
- add_settings_field('admin_tinymce_button', __('Remove Tinymce Button', 'sdm_lang'), array($this, 'admin_tinymce_button_cb'), 'admin_options_section', 'admin_options');
372
- add_settings_field('admin_log_unique', __('Log Unique IP', 'sdm_lang'), array($this, 'admin_log_unique'), 'admin_options_section', 'admin_options');
373
- add_settings_field('admin_no_logs', __('Disable Download Logs', 'sdm_lang'), array($this, 'admin_no_logs_cb'), 'admin_options_section', 'admin_options');
374
- add_settings_field('download_button_color', __('Download Button Color', 'sdm_lang'), array($this, 'download_button_color_cb'), 'sdm_colors_section', 'sdm_colors');
375
  }
376
 
377
  public function admin_options_cb() {
378
- _e('Admin options settings', 'sdm_lang');
379
  }
380
 
381
  public function sdm_colors_cb() {
382
- _e('Front End colors settings', 'sdm_lang');
383
  }
384
 
385
  public function admin_tinymce_button_cb() {
386
  $main_opts = get_option('sdm_downloads_options');
387
  echo '<input name="sdm_downloads_options[admin_tinymce_button]" id="admin_tinymce_button" type="checkbox" class="sdm_opts_ajax_checkboxes" ' . checked(1, isset($main_opts['admin_tinymce_button']), false) . ' /> ';
388
- _e('Removes the SDM Downloads button from the WP content editor.', 'sdm_lang');
389
  }
390
 
391
  public function admin_log_unique() {
392
  $main_opts = get_option('sdm_downloads_options');
393
  echo '<input name="sdm_downloads_options[admin_log_unique]" id="admin_log_unique" type="checkbox" class="sdm_opts_ajax_checkboxes" ' . checked(1, isset($main_opts['admin_log_unique']), false) . ' /> ';
394
- _e('Only logs downloads from unique IP addresses.', 'sdm_lang');
395
  }
396
 
397
  public function admin_no_logs_cb() {
398
  $main_opts = get_option('sdm_downloads_options');
399
  echo '<input name="sdm_downloads_options[admin_no_logs]" id="admin_no_logs" type="checkbox" class="sdm_opts_ajax_checkboxes" ' . checked(1, isset($main_opts['admin_no_logs']), false) . ' /> ';
400
- _e('Disables all download logs. (This global option overrides the individual download item option.)', 'sdm_lang');
401
  }
402
 
403
  public function download_button_color_cb() {
404
  $main_opts = get_option('sdm_downloads_options');
405
  $color_opt = $main_opts['download_button_color'];
406
- $color_opts = array(__('Green', 'sdm_lang'), __('Blue', 'sdm_lang'), __('Purple', 'sdm_lang'), __('Teal', 'sdm_lang'), __('Dark Blue', 'sdm_lang'), __('Black', 'sdm_lang'), __('Grey', 'sdm_lang'), __('Pink', 'sdm_lang'), __('Orange', 'sdm_lang'), __('White', 'sdm_lang'));
407
  echo '<select name="sdm_downloads_options[download_button_color]" id="download_button_color" class="sdm_opts_ajax_dropdowns">';
408
  if (isset($color_opt)) {
409
- echo '<option value="' . $color_opt . '" selected="selected">' . $color_opt . ' (' . __('current', 'sdm_lang') . ')</option>';
410
  }
411
  foreach ($color_opts as $color) {
412
  echo '<option value="' . $color . '">' . $color . '</option>';
413
  }
414
  echo '</select> ';
415
- _e('Adjusts the color of the "Download Now" button.', 'sdm_lang');
416
  }
417
 
418
  }
@@ -420,10 +426,10 @@ class simpleDownloadManager {
420
  $simpleDownloadManager = new simpleDownloadManager();
421
 
422
  function sdm_get_password_entry_form($id) {
423
- $data = __('Enter Password to Download:', 'sdm_lang');
424
  $data .= '<form method="post">';
425
  $data .= '<input type="password" class="pass_text" value="" /> ';
426
- $data .= '<input type="button" class="pass_sumbit" value="' . __('Submit', 'sdm_lang') . '" />';
427
  $data .= '<input type="hidden" value="' . $id . '" />';
428
  $data .= '</form>';
429
  return $data;
@@ -453,10 +459,10 @@ function handle_sdm_download_via_direct_post() {
453
 
454
  //Do some validation checks
455
  if(empty($download_id)){
456
- wp_die(__('Error! Incorrect download item id.', 'sdm_lang'));
457
  }
458
  if(empty($download_link)){
459
- wp_die(__('Error! This download item ('.$download_id.') does not have any download link. Edit this item and specify a downloadable file URL for it.', 'sdm_lang'));
460
  }
461
 
462
  $ipaddress = $_SERVER["REMOTE_ADDR"];
@@ -469,7 +475,7 @@ function handle_sdm_download_via_direct_post() {
469
  $visitor_name = $current_user->user_login;
470
  }
471
  else {
472
- $visitor_name = __('Not Logged In','sdm_lang');
473
  }
474
 
475
  // Get option for global disabling of download logging
@@ -513,13 +519,14 @@ function handle_sdm_download_via_direct_post() {
513
  'visitor_name' => $visitor_name
514
  );
515
 
 
516
  $insert_table = $wpdb->insert($table, $data);
517
 
518
  if ($insert_table) {
519
  //Download request was logged successfully
520
  } else {
521
  //Failed to log the download request
522
- wp_die(__('Error! Failed to log the download request in the database table', 'sdm_lang'));
523
  }
524
  }
525
 
@@ -605,7 +612,7 @@ function sdm_check_pass_ajax_call() {
605
  $visitor_name = $current_user->user_login;
606
  }
607
  else {
608
- $visitor_name = __('Not Logged In','sdm_lang');
609
  }
610
 
611
  // Get option for global disabling of download logging
@@ -711,14 +718,14 @@ function sdm_create_columns($cols) {
711
  unset($cols['taxonomy-sdm_categories']);
712
  unset($cols['date']);
713
 
714
- $cols['sdm_downloads_thumbnail'] = __('Image', 'sdm_lang');
715
- $cols['title'] = __('Title', 'sdm_lang');
716
- $cols['sdm_downloads_id'] = __('ID', 'sdm_lang');
717
- $cols['sdm_downloads_file'] = __('File', 'sdm_lang');
718
- $cols['taxonomy-sdm_categories'] = __('Categories', 'sdm_lang');
719
- $cols['taxonomy-sdm_tags'] = __('Tags', 'sdm_lang');
720
- $cols['sdm_downloads_count'] = __('Downloads', 'sdm_lang');
721
- $cols['date'] = __('Date Posted', 'sdm_lang');
722
  return $cols;
723
  }
724
 
3
  * Plugin Name: Simple Download Monitor
4
  * Plugin URI: https://www.tipsandtricks-hq.com/simple-wordpress-download-monitor-plugin
5
  * Description: Easily manage downloadable files and monitor downloads of your digital files from your WordPress site.
6
+ * Version: 3.2.8
7
  * Author: Tips and Tricks HQ, Ruhul Amin, Josh Lobe
8
  * Author URI: https://www.tipsandtricks-hq.com/development-center
9
  * License: GPL2
13
  exit;
14
  }
15
 
16
+ define('WP_SIMPLE_DL_MONITOR_VERSION', '3.2.8');
17
  define('WP_SIMPLE_DL_MONITOR_DIR_NAME', dirname(plugin_basename(__FILE__)));
18
  define('WP_SIMPLE_DL_MONITOR_URL', plugins_url('', __FILE__));
19
  define('WP_SIMPLE_DL_MONITOR_PATH', plugin_dir_path(__FILE__));
69
  add_action('plugins_loaded', 'sdm_plugins_loaded_tasks');
70
  function sdm_plugins_loaded_tasks() {
71
  //Load language
72
+ load_plugin_textdomain('simple-download-monitor', false, dirname(plugin_basename(__FILE__)) . '/langs/');
73
 
74
  //Handle db upgrade stuff
75
  sdm_db_update_check();
104
  if (!$this_plugin)
105
  $this_plugin = plugin_basename(__FILE__);
106
  if ($file == $this_plugin) {
107
+ $settings_link = '<a href="edit.php?post_type=sdm_downloads&page=settings" title="SDM Settings Page">' . __("Settings", 'simple-download-monitor') . '</a>';
108
  array_unshift($links, $settings_link);
109
  }
110
  return $links;
158
  <?php
159
  // Localize langauge strings used in js file
160
  $sdmTranslations = array(
161
+ 'image_removed' => __('Image Successfully Removed', 'simple-download-monitor'),
162
+ 'ajax_error' => __('Error with AJAX', 'simple-download-monitor')
163
  );
164
  wp_localize_script('sdm-upload', 'sdm_translations', $sdmTranslations);
165
  }
169
  <script type="text/javascript">
170
  var sdm_admin_ajax_url = {sdm_admin_ajax_url: '<?php echo admin_url('admin-ajax.php?action=ajax'); ?>'};
171
  var sdm_plugin_url = '<?php echo plugins_url(); ?>';
172
+ var tinymce_langs = {
173
+ select_download_item: '<?php _e('Please select a Download Item:', 'simple-download-monitor') ?>',
174
+ download_title: '<?php _e('Download Title', 'simple-download-monitor') ?>',
175
+ include_fancy: '<?php _e('Include Fancy Box', 'simple-download-monitor') ?>',
176
+ open_new_window: '<?php _e('Open New Window', 'simple-download-monitor') ?>',
177
+ insert_shortcode: '<?php _e('Insert SDM Shortcode', 'simple-download-monitor') ?>'
178
+ };
179
  </script>
180
  <?php
181
  }
185
  // Pass language strings to frontend of WP for js usage
186
  ?>
187
  <script type="text/javascript">
188
+ var sdm_frontend_translations = {incorrect_password: '<?php _e('Incorrect Password', 'simple-download-monitor') ?>'};
189
  </script>
190
  <?php
191
  }
206
 
207
  //*****
208
  //***** Create metaboxes for the custom post type
209
+ add_meta_box('sdm_description_meta_box', __('Description', 'simple-download-monitor'), array(&$this, 'display_sdm_description_meta_box'), 'sdm_downloads', 'normal', 'default'
210
  );
211
+ add_meta_box('sdm_upload_meta_box', __('Upload File', 'simple-download-monitor'), array(&$this, 'display_sdm_upload_meta_box'), 'sdm_downloads', 'normal', 'default'
212
  );
213
+ add_meta_box('sdm_thumbnail_meta_box', __('File Thumbnail (Optional)', 'simple-download-monitor'), array(&$this, 'display_sdm_thumbnail_meta_box'), 'sdm_downloads', 'normal', 'default'
214
  );
215
+ add_meta_box('sdm_shortcode_meta_box', __('Shortcodes', 'simple-download-monitor'), array(&$this, 'display_sdm_shortcode_meta_box'), 'sdm_downloads', 'normal', 'default'
216
  );
217
+ add_meta_box('sdm_stats_meta_box', __('Statistics', 'simple-download-monitor'), array(&$this, 'display_sdm_stats_meta_box'), 'sdm_downloads', 'normal', 'default'
218
  );
219
  }
220
 
221
  public function display_sdm_description_meta_box($post) { // Description metabox
222
+ _e('Add a description for this download item.', 'simple-download-monitor');
223
  echo '<br /><br />';
224
 
225
  $old_description = get_post_meta($post->ID, 'sdm_description', true);
232
  public function display_sdm_upload_meta_box($post) { // File Upload metabox
233
  $old_upload = get_post_meta($post->ID, 'sdm_upload', true);
234
  $old_value = isset($old_upload) ? $old_upload : '';
235
+ _e('Click "Select File" to upload (or choose) the file.', 'simple-download-monitor');
236
  ?>
237
  <br /><br />
238
+ <input id="upload_image_button" type="button" class="button-primary" value="<?php _e('Select File', 'simple-download-monitor'); ?>" />
239
  <span style="margin-left:40px;"></span>
240
+ <?php _e('File URL:', 'simple-download-monitor') ?> <input id="sdm_upload" type="text" size="70" name="sdm_upload" value="<?php echo $old_value; ?>" placeholder="http://..." />
241
  <?php
242
  wp_nonce_field('sdm_upload_box_nonce', 'sdm_upload_box_nonce_check');
243
  }
245
  public function display_sdm_thumbnail_meta_box($post) { // Thumbnail upload metabox
246
  $old_thumbnail = get_post_meta($post->ID, 'sdm_upload_thumbnail', true);
247
  $old_value = isset($old_thumbnail) ? $old_thumbnail : '';
248
+ _e('Manually enter a valid URL, or click "Select Image" to upload (or choose) the file thumbnail image.', 'simple-download-monitor');
249
  echo '<br />';
250
+ _e('This thumbnail image will be used to create a fancy file download box if you want to use it.', 'simple-download-monitor');
251
  ?>
252
  <br /><br />
253
  <input id="sdm_upload_thumbnail" type="text" size="70" name="sdm_upload_thumbnail" value="<?php echo $old_value; ?>" placeholder="http://..." />
254
  <br />
255
+ <input id="upload_thumbnail_button" type="button" class="button-primary" value="<?php _e('Select Image', 'simple-download-monitor'); ?>" />
256
+ <input id="remove_thumbnail_button" type="button" class="button" value="<?php _e('Remove Image', 'simple-download-monitor'); ?>" />
257
  <br /><br />
258
 
259
  <span id="sdm_admin_thumb_preview">
267
  }
268
 
269
  public function display_sdm_shortcode_meta_box($post) { // Shortcode metabox
270
+ _e('This is the shortcode which can used on posts or pages to embed a download now button for this file. You can also use the shortcode inserter to add this shortcode to a post or page.', 'simple-download-monitor');
271
  echo '<br />';
272
  echo '[sdm_download id="' . $post->ID . '" fancy="0"]';
273
  echo '<br /><br />';
274
 
275
+ _e('This shortcode may be used as a download counter.', 'simple-download-monitor');
276
  echo '<br />';
277
  echo '[sdm_download_counter id="' . $post->ID . '"]';
278
  }
285
  $no_logs = get_post_meta($post->ID, 'sdm_item_no_log', true);
286
  $checked = isset($no_logs) && $no_logs === 'on' ? 'checked="checked"' : '';
287
 
288
+ _e('These are the statistics for this download item.', 'simple-download-monitor');
289
  echo '<br /><br />';
290
 
291
  global $wpdb;
292
  $wpdb->get_results($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'sdm_downloads WHERE post_id=%s', $post->ID));
293
+ _e('Number of Downloads:', 'simple-download-monitor');
294
  echo ' <strong>' . $wpdb->num_rows . '</strong>';
295
  echo '<span style="margin-left: 20px;"></span>';
296
+ _e('Offset Count', 'simple-download-monitor');
297
  echo ' <input type="text" style="width:50px;" name="sdm_count_offset" value="' . $value . '" />';
298
  echo ' <img src="' . WP_SIMPLE_DL_MONITOR_URL . '/css/images/info.png" style="margin-left:10px;" title="Enter any positive or negative numerical value; to offset the download count shown, when using the download counter shortcode." />';
299
 
300
  echo '<br /><br />';
301
  echo '<input type="checkbox" name="sdm_item_no_log" '.$checked.' />';
302
  echo '<span style="margin-left: 5px;"></span>';
303
+ _e('Disable download logging for this item.', 'simple-download-monitor');
304
 
305
  wp_nonce_field('sdm_count_offset_nonce', 'sdm_count_offset_nonce_check');
306
  }
371
  public function sdm_register_options() {
372
 
373
  register_setting('sdm_downloads_options', 'sdm_downloads_options');
374
+ add_settings_section('admin_options', __('Admin Options', 'simple-download-monitor'), array($this, 'admin_options_cb'), 'admin_options_section');
375
+ add_settings_section('sdm_colors', __('Colors', 'simple-download-monitor'), array($this, 'sdm_colors_cb'), 'sdm_colors_section');
376
 
377
+ add_settings_field('admin_tinymce_button', __('Remove Tinymce Button', 'simple-download-monitor'), array($this, 'admin_tinymce_button_cb'), 'admin_options_section', 'admin_options');
378
+ add_settings_field('admin_log_unique', __('Log Unique IP', 'simple-download-monitor'), array($this, 'admin_log_unique'), 'admin_options_section', 'admin_options');
379
+ add_settings_field('admin_no_logs', __('Disable Download Logs', 'simple-download-monitor'), array($this, 'admin_no_logs_cb'), 'admin_options_section', 'admin_options');
380
+ add_settings_field('download_button_color', __('Download Button Color', 'simple-download-monitor'), array($this, 'download_button_color_cb'), 'sdm_colors_section', 'sdm_colors');
381
  }
382
 
383
  public function admin_options_cb() {
384
+ _e('Admin options settings', 'simple-download-monitor');
385
  }
386
 
387
  public function sdm_colors_cb() {
388
+ _e('Front End colors settings', 'simple-download-monitor');
389
  }
390
 
391
  public function admin_tinymce_button_cb() {
392
  $main_opts = get_option('sdm_downloads_options');
393
  echo '<input name="sdm_downloads_options[admin_tinymce_button]" id="admin_tinymce_button" type="checkbox" class="sdm_opts_ajax_checkboxes" ' . checked(1, isset($main_opts['admin_tinymce_button']), false) . ' /> ';
394
+ _e('Removes the SDM Downloads button from the WP content editor.', 'simple-download-monitor');
395
  }
396
 
397
  public function admin_log_unique() {
398
  $main_opts = get_option('sdm_downloads_options');
399
  echo '<input name="sdm_downloads_options[admin_log_unique]" id="admin_log_unique" type="checkbox" class="sdm_opts_ajax_checkboxes" ' . checked(1, isset($main_opts['admin_log_unique']), false) . ' /> ';
400
+ _e('Only logs downloads from unique IP addresses.', 'simple-download-monitor');
401
  }
402
 
403
  public function admin_no_logs_cb() {
404
  $main_opts = get_option('sdm_downloads_options');
405
  echo '<input name="sdm_downloads_options[admin_no_logs]" id="admin_no_logs" type="checkbox" class="sdm_opts_ajax_checkboxes" ' . checked(1, isset($main_opts['admin_no_logs']), false) . ' /> ';
406
+ _e('Disables all download logs. (This global option overrides the individual download item option.)', 'simple-download-monitor');
407
  }
408
 
409
  public function download_button_color_cb() {
410
  $main_opts = get_option('sdm_downloads_options');
411
  $color_opt = $main_opts['download_button_color'];
412
+ $color_opts = array(__('Green', 'simple-download-monitor'), __('Blue', 'simple-download-monitor'), __('Purple', 'simple-download-monitor'), __('Teal', 'simple-download-monitor'), __('Dark Blue', 'simple-download-monitor'), __('Black', 'simple-download-monitor'), __('Grey', 'simple-download-monitor'), __('Pink', 'simple-download-monitor'), __('Orange', 'simple-download-monitor'), __('White', 'simple-download-monitor'));
413
  echo '<select name="sdm_downloads_options[download_button_color]" id="download_button_color" class="sdm_opts_ajax_dropdowns">';
414
  if (isset($color_opt)) {
415
+ echo '<option value="' . $color_opt . '" selected="selected">' . $color_opt . ' (' . __('current', 'simple-download-monitor') . ')</option>';
416
  }
417
  foreach ($color_opts as $color) {
418
  echo '<option value="' . $color . '">' . $color . '</option>';
419
  }
420
  echo '</select> ';
421
+ _e('Adjusts the color of the "Download Now" button.', 'simple-download-monitor');
422
  }
423
 
424
  }
426
  $simpleDownloadManager = new simpleDownloadManager();
427
 
428
  function sdm_get_password_entry_form($id) {
429
+ $data = __('Enter Password to Download:', 'simple-download-monitor');
430
  $data .= '<form method="post">';
431
  $data .= '<input type="password" class="pass_text" value="" /> ';
432
+ $data .= '<input type="button" class="pass_sumbit" value="' . __('Submit', 'simple-download-monitor') . '" />';
433
  $data .= '<input type="hidden" value="' . $id . '" />';
434
  $data .= '</form>';
435
  return $data;
459
 
460
  //Do some validation checks
461
  if(empty($download_id)){
462
+ wp_die(__('Error! Incorrect download item id.', 'simple-download-monitor'));
463
  }
464
  if(empty($download_link)){
465
+ wp_die(__('Error! This download item ('.$download_id.') does not have any download link. Edit this item and specify a downloadable file URL for it.', 'simple-download-monitor'));
466
  }
467
 
468
  $ipaddress = $_SERVER["REMOTE_ADDR"];
475
  $visitor_name = $current_user->user_login;
476
  }
477
  else {
478
+ $visitor_name = __('Not Logged In','simple-download-monitor');
479
  }
480
 
481
  // Get option for global disabling of download logging
519
  'visitor_name' => $visitor_name
520
  );
521
 
522
+ $data = array_filter($data);//Remove any null values.
523
  $insert_table = $wpdb->insert($table, $data);
524
 
525
  if ($insert_table) {
526
  //Download request was logged successfully
527
  } else {
528
  //Failed to log the download request
529
+ wp_die(__('Error! Failed to log the download request in the database table', 'simple-download-monitor'));
530
  }
531
  }
532
 
612
  $visitor_name = $current_user->user_login;
613
  }
614
  else {
615
+ $visitor_name = __('Not Logged In','simple-download-monitor');
616
  }
617
 
618
  // Get option for global disabling of download logging
718
  unset($cols['taxonomy-sdm_categories']);
719
  unset($cols['date']);
720
 
721
+ $cols['sdm_downloads_thumbnail'] = __('Image', 'simple-download-monitor');
722
+ $cols['title'] = __('Title', 'simple-download-monitor');
723
+ $cols['sdm_downloads_id'] = __('ID', 'simple-download-monitor');
724
+ $cols['sdm_downloads_file'] = __('File', 'simple-download-monitor');
725
+ $cols['taxonomy-sdm_categories'] = __('Categories', 'simple-download-monitor');
726
+ $cols['taxonomy-sdm_tags'] = __('Tags', 'simple-download-monitor');
727
+ $cols['sdm_downloads_count'] = __('Downloads', 'simple-download-monitor');
728
+ $cols['date'] = __('Date Posted', 'simple-download-monitor');
729
  return $cols;
730
  }
731
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: Tips and Tricks HQ, Ruhul Amin, josh401
3
  Donate link: https://www.tipsandtricks-hq.com
4
  Tags: download, downloads, count, counter, tracker, tracking, hits, logging, monitor, manager, files, media, digital, download monitor, download manager, downloadmanager, file manager, protect downloads, password, download category, file tree, ajax, download template, grid, documents, ip address
5
  Requires at least: 3.0
6
- Tested up to: 4.3
7
- Stable tag: 3.2.5
8
  License: GPLv2 or later
9
 
10
  Easily manage downloadable files and monitor downloads of your digital files from your WordPress site.
@@ -156,6 +156,17 @@ For screenshots please visit the [download monitor plugin page](https://www.tips
156
 
157
  == Changelog ==
158
 
 
 
 
 
 
 
 
 
 
 
 
159
  = 3.2.5 =
160
  - Modified the 'sdm_download_shortcode_output' filter to pass the arguments array also (allows greater customization option via this filter).
161
  - Added a new option to show X number of latest downloads from a specified category.
3
  Donate link: https://www.tipsandtricks-hq.com
4
  Tags: download, downloads, count, counter, tracker, tracking, hits, logging, monitor, manager, files, media, digital, download monitor, download manager, downloadmanager, file manager, protect downloads, password, download category, file tree, ajax, download template, grid, documents, ip address
5
  Requires at least: 3.0
6
+ Tested up to: 4.4
7
+ Stable tag: 3.2.8
8
  License: GPLv2 or later
9
 
10
  Easily manage downloadable files and monitor downloads of your digital files from your WordPress site.
156
 
157
  == Changelog ==
158
 
159
+ = 3.2.8 =
160
+ - WordPress 4.4 compatibility.
161
+
162
+ = 3.2.7 =
163
+ - Added a new feature to specify the new window parameter when using the shortcode inserter (from TinyMCE).
164
+ - Minor CSS style fix for the "Logs" interface.
165
+ - The log entries will be sorted by "date" field (by default).
166
+
167
+ = 3.2.6 =
168
+ - The language slug has been changed to "simple-download-monitor" so it can be imported to the WordPress language pack.
169
+
170
  = 3.2.5 =
171
  - Modified the 'sdm_download_shortcode_output' filter to pass the arguments array also (allows greater customization option via this filter).
172
  - Added a new option to show X number of latest downloads from a specified category.
sdm-post-type-and-taxonomy.php CHANGED
@@ -4,19 +4,19 @@ function sdm_register_post_type() {
4
 
5
  //***** Create 'sdm_downloads' Custom Post Type
6
  $labels = array(
7
- 'name' => __('Downloads', 'sdm_lang'),
8
- 'singular_name' => __('Downloads', 'sdm_lang'),
9
- 'add_new' => __('Add New', 'sdm_lang'),
10
- 'add_new_item' => __('Add New', 'sdm_lang'),
11
- 'edit_item' => __('Edit Download', 'sdm_lang'),
12
- 'new_item' => __('New Download', 'sdm_lang'),
13
- 'all_items' => __('Downloads', 'sdm_lang'),
14
- 'view_item' => __('View Download', 'sdm_lang'),
15
- 'search_items' => __('Search Downloads', 'sdm_lang'),
16
- 'not_found' => __('No Downloads found', 'sdm_lang'),
17
- 'not_found_in_trash' => __('No Downloads found in Trash', 'sdm_lang'),
18
- 'parent_item_colon' => __('Parent Download', 'sdm_lang'),
19
- 'menu_name' => __('Downloads', 'sdm_lang')
20
  );
21
 
22
  $sdm_permalink_base = 'sdm_downloads'; //TODO - add an option to configure in the settings maybe?
@@ -43,17 +43,17 @@ function sdm_create_taxonomies() {
43
 
44
  //***** Create CATEGORIES Taxonomy
45
  $labels_tags = array(
46
- 'name' => _x('Categories', 'sdm_lang'),
47
- 'singular_name' => _x('Category', 'sdm_lang'),
48
- 'search_items' => __('Search Categories', 'sdm_lang'),
49
- 'all_items' => __('All Categories', 'sdm_lang'),
50
- 'parent_item' => __('Categories Genre', 'sdm_lang'),
51
- 'parent_item_colon' => __('Categories Genre:', 'sdm_lang'),
52
- 'edit_item' => __('Edit Category', 'sdm_lang'),
53
- 'update_item' => __('Update Category', 'sdm_lang'),
54
- 'add_new_item' => __('Add New Category', 'sdm_lang'),
55
- 'new_item_name' => __('New Category', 'sdm_lang'),
56
- 'menu_name' => __('Categories', 'sdm_lang')
57
  );
58
  $args_tags = array(
59
  'hierarchical' => true,
@@ -67,17 +67,17 @@ function sdm_create_taxonomies() {
67
 
68
  //***** Create TAGS Taxonomy
69
  $labels_tags = array(
70
- 'name' => _x('Tags', 'sdm_lang'),
71
- 'singular_name' => _x('Tag', 'sdm_lang'),
72
- 'search_items' => __('Search Tags', 'sdm_lang'),
73
- 'all_items' => __('All Tags', 'sdm_lang'),
74
- 'parent_item' => __('Tags Genre', 'sdm_lang'),
75
- 'parent_item_colon' => __('Tags Genre:', 'sdm_lang'),
76
- 'edit_item' => __('Edit Tag', 'sdm_lang'),
77
- 'update_item' => __('Update Tag', 'sdm_lang'),
78
- 'add_new_item' => __('Add New Tag', 'sdm_lang'),
79
- 'new_item_name' => __('New Tag', 'sdm_lang'),
80
- 'menu_name' => __('Tags', 'sdm_lang')
81
  );
82
  $args_tags = array(
83
  'hierarchical' => false,
4
 
5
  //***** Create 'sdm_downloads' Custom Post Type
6
  $labels = array(
7
+ 'name' => __('Downloads', 'simple-download-monitor'),
8
+ 'singular_name' => __('Downloads', 'simple-download-monitor'),
9
+ 'add_new' => __('Add New', 'simple-download-monitor'),
10
+ 'add_new_item' => __('Add New', 'simple-download-monitor'),
11
+ 'edit_item' => __('Edit Download', 'simple-download-monitor'),
12
+ 'new_item' => __('New Download', 'simple-download-monitor'),
13
+ 'all_items' => __('Downloads', 'simple-download-monitor'),
14
+ 'view_item' => __('View Download', 'simple-download-monitor'),
15
+ 'search_items' => __('Search Downloads', 'simple-download-monitor'),
16
+ 'not_found' => __('No Downloads found', 'simple-download-monitor'),
17
+ 'not_found_in_trash' => __('No Downloads found in Trash', 'simple-download-monitor'),
18
+ 'parent_item_colon' => __('Parent Download', 'simple-download-monitor'),
19
+ 'menu_name' => __('Downloads', 'simple-download-monitor')
20
  );
21
 
22
  $sdm_permalink_base = 'sdm_downloads'; //TODO - add an option to configure in the settings maybe?
43
 
44
  //***** Create CATEGORIES Taxonomy
45
  $labels_tags = array(
46
+ 'name' => _x('Categories', 'simple-download-monitor'),
47
+ 'singular_name' => _x('Category', 'simple-download-monitor'),
48
+ 'search_items' => __('Search Categories', 'simple-download-monitor'),
49
+ 'all_items' => __('All Categories', 'simple-download-monitor'),
50
+ 'parent_item' => __('Categories Genre', 'simple-download-monitor'),
51
+ 'parent_item_colon' => __('Categories Genre:', 'simple-download-monitor'),
52
+ 'edit_item' => __('Edit Category', 'simple-download-monitor'),
53
+ 'update_item' => __('Update Category', 'simple-download-monitor'),
54
+ 'add_new_item' => __('Add New Category', 'simple-download-monitor'),
55
+ 'new_item_name' => __('New Category', 'simple-download-monitor'),
56
+ 'menu_name' => __('Categories', 'simple-download-monitor')
57
  );
58
  $args_tags = array(
59
  'hierarchical' => true,
67
 
68
  //***** Create TAGS Taxonomy
69
  $labels_tags = array(
70
+ 'name' => _x('Tags', 'simple-download-monitor'),
71
+ 'singular_name' => _x('Tag', 'simple-download-monitor'),
72
+ 'search_items' => __('Search Tags', 'simple-download-monitor'),
73
+ 'all_items' => __('All Tags', 'simple-download-monitor'),
74
+ 'parent_item' => __('Tags Genre', 'simple-download-monitor'),
75
+ 'parent_item_colon' => __('Tags Genre:', 'simple-download-monitor'),
76
+ 'edit_item' => __('Edit Tag', 'simple-download-monitor'),
77
+ 'update_item' => __('Update Tag', 'simple-download-monitor'),
78
+ 'add_new_item' => __('Add New Tag', 'simple-download-monitor'),
79
+ 'new_item_name' => __('New Tag', 'simple-download-monitor'),
80
+ 'menu_name' => __('Tags', 'simple-download-monitor')
81
  );
82
  $args_tags = array(
83
  'hierarchical' => false,
sdm-post-type-content-handler.php CHANGED
@@ -29,12 +29,12 @@ function filter_sdm_post_type_content($content) {
29
  // See if user color option is selected
30
  $main_opts = get_option('sdm_downloads_options');
31
  $color_opt = $main_opts['download_button_color'];
32
- $def_color = isset($color_opt) ? str_replace(' ', '', strtolower($color_opt)) : __('green', 'sdm_lang');
33
 
34
  //Download counter
35
  //$dl_counter = sdm_create_counter_shortcode(array('id'=>$id));
36
  //*** Generate the download now button code ***
37
- $button_text_string = __('Download Now!', 'sdm_lang');
38
 
39
  $homepage = get_bloginfo('url');
40
  $download_url = $homepage . '/?smd_process_download=1&download_id=' . $id;
@@ -45,7 +45,7 @@ function filter_sdm_post_type_content($content) {
45
  }
46
 
47
  $db_count = sdm_get_download_count_for_post($id);
48
- $string = ($db_count == '1') ? __('Download', 'sdm_lang') : __('Downloads', 'sdm_lang');
49
  $download_count_string = '<span class="sdm_post_count_number">'.$db_count . '</span><span class="sdm_post_count_string"> ' . $string.'</span>';
50
 
51
  //TODO - make this display better with a new design
29
  // See if user color option is selected
30
  $main_opts = get_option('sdm_downloads_options');
31
  $color_opt = $main_opts['download_button_color'];
32
+ $def_color = isset($color_opt) ? str_replace(' ', '', strtolower($color_opt)) : __('green', 'simple-download-monitor');
33
 
34
  //Download counter
35
  //$dl_counter = sdm_create_counter_shortcode(array('id'=>$id));
36
  //*** Generate the download now button code ***
37
+ $button_text_string = __('Download Now!', 'simple-download-monitor');
38
 
39
  $homepage = get_bloginfo('url');
40
  $download_url = $homepage . '/?smd_process_download=1&download_id=' . $id;
45
  }
46
 
47
  $db_count = sdm_get_download_count_for_post($id);
48
+ $string = ($db_count == '1') ? __('Download', 'simple-download-monitor') : __('Downloads', 'simple-download-monitor');
49
  $download_count_string = '<span class="sdm_post_count_number">'.$db_count . '</span><span class="sdm_post_count_string"> ' . $string.'</span>';
50
 
51
  //TODO - make this display better with a new design
sdm-shortcodes.php CHANGED
@@ -32,7 +32,7 @@ function sdm_create_download_shortcode($atts) {
32
  ), $atts));
33
 
34
  if (empty($id)) {
35
- return '<p style="color: red;">' . __('Error! Please enter an ID value with this shortcode.', 'sdm_lang') . '</p>';
36
  }
37
 
38
  // Check to see if the download link cpt is password protected
@@ -45,7 +45,7 @@ function sdm_create_download_shortcode($atts) {
45
  // See if user color option is selected
46
  $main_opts = get_option('sdm_downloads_options');
47
  $color_opt = $main_opts['download_button_color'];
48
- $def_color = isset($color_opt) ? str_replace(' ', '', strtolower($color_opt)) : __('green', 'sdm_lang');
49
 
50
  //*** Generate the download now button code ***
51
  $window_target = '';
@@ -53,7 +53,7 @@ function sdm_create_download_shortcode($atts) {
53
  $window_target = 'target="_blank"';
54
  }
55
  if (empty($button_text)) {//Use the default text for the button
56
- $button_text_string = __('Download Now!', 'sdm_lang');
57
  } else {//Use the custom text
58
  $button_text_string = $button_text;
59
  }
@@ -91,7 +91,7 @@ function sdm_create_simple_download_link($atts){
91
  ), $atts));
92
 
93
  if (empty($id)) {
94
- return '<p style="color: red;">' . __('Error! Please enter an ID value with this shortcode.', 'sdm_lang') . '</p>';
95
  }
96
 
97
  $download_url = WP_SIMPLE_DL_MONITOR_SITE_HOME_URL . '/?smd_process_download=1&download_id=' . $id;
@@ -106,13 +106,13 @@ function sdm_create_counter_shortcode($atts) {
106
  ), $atts));
107
 
108
  if (empty($id)) {
109
- return '<p style="color: red;">' . __('Error! Please enter an ID value with this shortcode.', 'sdm_lang') . '</p>';
110
  }
111
 
112
  $db_count = sdm_get_download_count_for_post($id);
113
 
114
  // Set string for singular/plural results
115
- $string = ($db_count == '1') ? __('Download', 'sdm_lang') : __('Downloads', 'sdm_lang');
116
 
117
  $output = '<div class="sdm_download_count"><span class="sdm_count_number">' . $db_count . '</span><span class="sdm_count_string"> ' . $string . '</span></div>';
118
  // Return result
@@ -139,11 +139,11 @@ function sdm_handle_category_shortcode($args) {
139
 
140
  // If category slug and category id are empty.. return error
141
  if (empty($category_slug) && empty($category_id)) {
142
- return '<p style="color: red;">' . __('Error! You must enter a category slug OR a category id with this shortcode. Refer to the documentation for usage instructions.', 'sdm_lang') . '</p>';
143
  }
144
  // Else if both category slug AND category id are defined... return error
145
  else if (!empty($category_slug) && !empty($category_id)) {
146
- return '<p style="color: red;">' . __('Error! Please enter a category slug OR id; not both.', 'sdm_lang') . '</p>';
147
  }
148
  // Else setup query arguments for category_slug
149
  else if (!empty($category_slug) && empty($category_id)) {
@@ -162,7 +162,7 @@ function sdm_handle_category_shortcode($args) {
162
  $paged = ( get_query_var( 'paged' ) ) ? absint( get_query_var( 'paged' ) ) : 1;
163
  if(isset($args['pagination'])){
164
  if(!is_numeric($args['pagination'])){
165
- return '<p style="color: red;">' . __('Error! You must enter a numeric number for the "pagination" parameter of the shortcode. Refer to the usage documentation.', 'sdm_lang') . '</p>';
166
  }
167
  $posts_per_page = $args['pagination'];
168
  } else {
@@ -189,7 +189,7 @@ function sdm_handle_category_shortcode($args) {
189
 
190
  // If no cpt's are found
191
  if (!$get_posts) {
192
- return '<p style="color: red;">' . __('There are no download items matching this category criteria.', 'sdm_lang') . '</p>';
193
  }
194
  // Else iterate cpt's
195
  else {
@@ -202,7 +202,7 @@ function sdm_handle_category_shortcode($args) {
202
  // See if user color option is selected
203
  $main_opts = get_option('sdm_downloads_options');
204
  $color_opt = $main_opts['download_button_color'];
205
- $def_color = isset($color_opt) ? str_replace(' ', '', strtolower($color_opt)) : __('green', 'sdm_lang');
206
 
207
  $window_target = '';
208
  if (!empty($new_window)) {
@@ -210,7 +210,7 @@ function sdm_handle_category_shortcode($args) {
210
  }
211
 
212
  if (empty($button_text)) {//Use the default text for the button
213
- $button_text_string = __('Download Now!', 'sdm_lang');
214
  } else {//Use the custom text
215
  $button_text_string = $button_text;
216
  }
32
  ), $atts));
33
 
34
  if (empty($id)) {
35
+ return '<p style="color: red;">' . __('Error! Please enter an ID value with this shortcode.', 'simple-download-monitor') . '</p>';
36
  }
37
 
38
  // Check to see if the download link cpt is password protected
45
  // See if user color option is selected
46
  $main_opts = get_option('sdm_downloads_options');
47
  $color_opt = $main_opts['download_button_color'];
48
+ $def_color = isset($color_opt) ? str_replace(' ', '', strtolower($color_opt)) : __('green', 'simple-download-monitor');
49
 
50
  //*** Generate the download now button code ***
51
  $window_target = '';
53
  $window_target = 'target="_blank"';
54
  }
55
  if (empty($button_text)) {//Use the default text for the button
56
+ $button_text_string = __('Download Now!', 'simple-download-monitor');
57
  } else {//Use the custom text
58
  $button_text_string = $button_text;
59
  }
91
  ), $atts));
92
 
93
  if (empty($id)) {
94
+ return '<p style="color: red;">' . __('Error! Please enter an ID value with this shortcode.', 'simple-download-monitor') . '</p>';
95
  }
96
 
97
  $download_url = WP_SIMPLE_DL_MONITOR_SITE_HOME_URL . '/?smd_process_download=1&download_id=' . $id;
106
  ), $atts));
107
 
108
  if (empty($id)) {
109
+ return '<p style="color: red;">' . __('Error! Please enter an ID value with this shortcode.', 'simple-download-monitor') . '</p>';
110
  }
111
 
112
  $db_count = sdm_get_download_count_for_post($id);
113
 
114
  // Set string for singular/plural results
115
+ $string = ($db_count == '1') ? __('Download', 'simple-download-monitor') : __('Downloads', 'simple-download-monitor');
116
 
117
  $output = '<div class="sdm_download_count"><span class="sdm_count_number">' . $db_count . '</span><span class="sdm_count_string"> ' . $string . '</span></div>';
118
  // Return result
139
 
140
  // If category slug and category id are empty.. return error
141
  if (empty($category_slug) && empty($category_id)) {
142
+ return '<p style="color: red;">' . __('Error! You must enter a category slug OR a category id with this shortcode. Refer to the documentation for usage instructions.', 'simple-download-monitor') . '</p>';
143
  }
144
  // Else if both category slug AND category id are defined... return error
145
  else if (!empty($category_slug) && !empty($category_id)) {
146
+ return '<p style="color: red;">' . __('Error! Please enter a category slug OR id; not both.', 'simple-download-monitor') . '</p>';
147
  }
148
  // Else setup query arguments for category_slug
149
  else if (!empty($category_slug) && empty($category_id)) {
162
  $paged = ( get_query_var( 'paged' ) ) ? absint( get_query_var( 'paged' ) ) : 1;
163
  if(isset($args['pagination'])){
164
  if(!is_numeric($args['pagination'])){
165
+ return '<p style="color: red;">' . __('Error! You must enter a numeric number for the "pagination" parameter of the shortcode. Refer to the usage documentation.', 'simple-download-monitor') . '</p>';
166
  }
167
  $posts_per_page = $args['pagination'];
168
  } else {
189
 
190
  // If no cpt's are found
191
  if (!$get_posts) {
192
+ return '<p style="color: red;">' . __('There are no download items matching this category criteria.', 'simple-download-monitor') . '</p>';
193
  }
194
  // Else iterate cpt's
195
  else {
202
  // See if user color option is selected
203
  $main_opts = get_option('sdm_downloads_options');
204
  $color_opt = $main_opts['download_button_color'];
205
+ $def_color = isset($color_opt) ? str_replace(' ', '', strtolower($color_opt)) : __('green', 'simple-download-monitor');
206
 
207
  $window_target = '';
208
  if (!empty($new_window)) {
210
  }
211
 
212
  if (empty($button_text)) {//Use the default text for the button
213
+ $button_text_string = __('Download Now!', 'simple-download-monitor');
214
  } else {//Use the custom text
215
  $button_text_string = $button_text;
216
  }
tinymce/sdm_editor_plugin.js CHANGED
@@ -107,7 +107,11 @@ jQuery(function(){
107
  <th><label class="sdm_fancy" for "sdm_fancy_option">'+tinymce_langs.include_fancy+'</th>\
108
  <td><input type="checkbox" name="sdm_fancy_cb" id="sdm_fancy_cb" />\
109
  </tr>\
110
- </table>\
 
 
 
 
111
  <p class="submit">\
112
  <input type="button" id="sdm-tinymce-submit" class="button-primary" value="'+tinymce_langs.insert_shortcode+'" name="submit" style=""/>\
113
  </p>\
@@ -120,14 +124,26 @@ jQuery(function(){
120
  // handles the click event of the submit button
121
  form.find('#sdm-tinymce-submit').click(function(){
122
 
123
- fancy_cb = jQuery('#sdm_fancy_cb').is(':checked');
124
- post_id = jQuery('#sdm_select').find(":selected").val(); // Get selected CPT item title value (item id)
125
-
126
- if (jQuery('#sdm_fancy_cb').is(':checked')) {
127
- shortcode = '[sdm_download id="'+post_id+'" fancy="1"]'; // Process shortcode
128
- } else {
129
- shortcode = '[sdm_download id="'+post_id+'" fancy="0"]'; // Process shortcode
130
- }
 
 
 
 
 
 
 
 
 
 
 
 
131
 
132
  // inserts the shortcode into the active editor
133
  tinyMCE.activeEditor.execCommand('mceInsertContent', 0, shortcode); // Send processed shortcode to editor
107
  <th><label class="sdm_fancy" for "sdm_fancy_option">'+tinymce_langs.include_fancy+'</th>\
108
  <td><input type="checkbox" name="sdm_fancy_cb" id="sdm_fancy_cb" />\
109
  </tr>\
110
+ <tr>\
111
+ <th><label class="sdm_new_window" for "sdm_open_new_window">'+tinymce_langs.open_new_window+'</th>\
112
+ <td><input type="checkbox" name="sdm_open_new_window_cb" id="sdm_open_new_window_cb" />\
113
+ </tr>\
114
+ </table>\
115
  <p class="submit">\
116
  <input type="button" id="sdm-tinymce-submit" class="button-primary" value="'+tinymce_langs.insert_shortcode+'" name="submit" style=""/>\
117
  </p>\
124
  // handles the click event of the submit button
125
  form.find('#sdm-tinymce-submit').click(function(){
126
 
127
+ fancy_cb = jQuery('#sdm_fancy_cb').is(':checked');
128
+ new_window_cb = jQuery('#sdm_open_new_window_cb').is(':checked');
129
+ post_id = jQuery('#sdm_select').find(":selected").val(); // Get selected CPT item title value (item id)
130
+
131
+ //Build the shortcode with parameters according to the options
132
+ shortcode = '[sdm_download id="'+post_id+'"';
133
+
134
+ //Add the fancy parameter to the shortcode (if needed
135
+ if (jQuery('#sdm_fancy_cb').is(':checked')) {
136
+ shortcode = shortcode + ' fancy="1"';
137
+ } else {
138
+ shortcode = shortcode + ' fancy="0"';
139
+ }
140
+
141
+ //Add the new_window parameter to the shortcode (if needed)
142
+ if (jQuery('#sdm_open_new_window_cb').is(':checked')) {
143
+ shortcode = shortcode + ' new_window="1"';
144
+ }
145
+
146
+ shortcode = shortcode + ']';//End the shortcode
147
 
148
  // inserts the shortcode into the active editor
149
  tinyMCE.activeEditor.execCommand('mceInsertContent', 0, shortcode); // Send processed shortcode to editor