Version Description
- WordPress 4.4 compatibility.
Download this release
Release Info
Developer | mra13 |
Plugin | 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 +14 -14
- includes/sdm-latest-downloads.php +1 -1
- includes/sdm-logs-list-table.php +37 -36
- includes/sdm-utility-functions.php +1 -1
- includes/templates/fancy0/sdm-fancy-0.php +2 -2
- includes/templates/fancy1/sdm-fancy-1.php +3 -3
- includes/templates/fancy2/sdm-fancy-2.php +1 -1
- langs/SDM.mo +0 -0
- langs/SDM.po +0 -342
- langs/sdm_lang.mo +0 -0
- langs/sdm_lang.po +0 -342
- langs/{sdm_lang-de_DE.mo → simple-download-monitor-de_DE.mo} +0 -0
- langs/{sdm_lang-de_DE.po → simple-download-monitor-de_DE.po} +0 -0
- langs/{sdm_lang-es_ES.mo → simple-download-monitor-es_ES.mo} +0 -0
- langs/{sdm_lang-es_ES.po → simple-download-monitor-es_ES.po} +0 -0
- langs/{sdm_lang-it_IT.mo → simple-download-monitor-it_IT.mo} +0 -0
- langs/{sdm_lang-it_IT.po → simple-download-monitor-it_IT.po} +0 -0
- langs/{sdm_lang-nl_NL.mo → simple-download-monitor-nl_NL.mo} +0 -0
- langs/{sdm_lang-nl_NL.po → simple-download-monitor-nl_NL.po} +0 -0
- langs/{sdm_lang-pt_BR.mo → simple-download-monitor-pt_BR.mo} +0 -0
- langs/{sdm_lang-pt_BR.po → simple-download-monitor-pt_BR.po} +0 -0
- langs/{sdm_lang-ru_RU.mo → simple-download-monitor-ru_RU.mo} +0 -0
- langs/{sdm_lang-ru_RU.po → simple-download-monitor-ru_RU.po} +0 -0
- langs/{sdm_lang.pot → simple-download-monitor.pot} +0 -0
- main.php +63 -56
- readme.txt +13 -2
- sdm-post-type-and-taxonomy.php +35 -35
- sdm-post-type-content-handler.php +3 -3
- sdm-shortcodes.php +12 -12
- tinymce/sdm_editor_plugin.js +25 -9
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', '
|
44 |
-
$sdm_settings_page = add_submenu_page('edit.php?post_type=sdm_downloads', __('Settings', '
|
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', '
|
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', '
|
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', '
|
68 |
</div>
|
69 |
<div class="sdm_desc">
|
70 |
-
<?php _e("Control various plugin features.", '
|
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', '
|
88 |
</div>
|
89 |
<div class="sdm_desc">
|
90 |
-
<?php _e("Adjust color options", '
|
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', '
|
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!', '
|
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', '
|
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.', '
|
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', '
|
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', '
|
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.', '
|
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', '
|
20 |
-
'plural' => __('Downloads', '
|
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', '
|
46 |
-
'delete' => sprintf('<a href="?post_type=sdm_downloads&page=%s&action=%s&download=%s&datetime=%s">' . __('Delete', '
|
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', '
|
71 |
-
'URL' => __('File', '
|
72 |
-
'visitor_ip' => __('Visitor IP', '
|
73 |
-
'date' => __('Date', '
|
74 |
-
'visitor_country' => __('Country', '
|
75 |
-
'visitor_name' => __('Username', '
|
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', '
|
97 |
-
$actions['export_all'] = __('Export All as Excel', '
|
98 |
-
//$actions['export-selected'] = __( 'Export Selected', '
|
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!', '
|
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', '
|
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.', '
|
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!', '
|
144 |
} else {
|
145 |
-
echo '<div id="message" class="updated fade"><p><strong>' . __('Error', '
|
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!', '
|
163 |
} else {
|
164 |
-
echo '<div id="message" class="updated fade"><p><strong>' . __('Error', '
|
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 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
|
|
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 |
-
$
|
|
|
|
|
194 |
|
195 |
-
|
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 |
-
//
|
205 |
-
|
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!', '
|
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', '
|
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!', '
|
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', '
|
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!', '
|
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', '
|
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!', '
|
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.
|
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.
|
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('
|
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", '
|
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', '
|
162 |
-
'ajax_error' => __('Error with AJAX', '
|
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 = {
|
|
|
|
|
|
|
|
|
|
|
|
|
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', '
|
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', '
|
204 |
);
|
205 |
-
add_meta_box('sdm_upload_meta_box', __('Upload File', '
|
206 |
);
|
207 |
-
add_meta_box('sdm_thumbnail_meta_box', __('File Thumbnail (Optional)', '
|
208 |
);
|
209 |
-
add_meta_box('sdm_shortcode_meta_box', __('Shortcodes', '
|
210 |
);
|
211 |
-
add_meta_box('sdm_stats_meta_box', __('Statistics', '
|
212 |
);
|
213 |
}
|
214 |
|
215 |
public function display_sdm_description_meta_box($post) { // Description metabox
|
216 |
-
_e('Add a description for this download item.', '
|
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.', '
|
230 |
?>
|
231 |
<br /><br />
|
232 |
-
<input id="upload_image_button" type="button" class="button-primary" value="<?php _e('Select File', '
|
233 |
<span style="margin-left:40px;"></span>
|
234 |
-
<?php _e('File URL:', '
|
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.', '
|
243 |
echo '<br />';
|
244 |
-
_e('This thumbnail image will be used to create a fancy file download box if you want to use it.', '
|
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', '
|
250 |
-
<input id="remove_thumbnail_button" type="button" class="button" value="<?php _e('Remove Image', '
|
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.', '
|
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.', '
|
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.', '
|
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:', '
|
288 |
echo ' <strong>' . $wpdb->num_rows . '</strong>';
|
289 |
echo '<span style="margin-left: 20px;"></span>';
|
290 |
-
_e('Offset Count', '
|
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.', '
|
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', '
|
369 |
-
add_settings_section('sdm_colors', __('Colors', '
|
370 |
|
371 |
-
add_settings_field('admin_tinymce_button', __('Remove Tinymce Button', '
|
372 |
-
add_settings_field('admin_log_unique', __('Log Unique IP', '
|
373 |
-
add_settings_field('admin_no_logs', __('Disable Download Logs', '
|
374 |
-
add_settings_field('download_button_color', __('Download Button Color', '
|
375 |
}
|
376 |
|
377 |
public function admin_options_cb() {
|
378 |
-
_e('Admin options settings', '
|
379 |
}
|
380 |
|
381 |
public function sdm_colors_cb() {
|
382 |
-
_e('Front End colors settings', '
|
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.', '
|
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.', '
|
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.)', '
|
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', '
|
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', '
|
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.', '
|
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:', '
|
424 |
$data .= '<form method="post">';
|
425 |
$data .= '<input type="password" class="pass_text" value="" /> ';
|
426 |
-
$data .= '<input type="button" class="pass_sumbit" value="' . __('Submit', '
|
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.', '
|
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.', '
|
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','
|
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', '
|
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','
|
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', '
|
715 |
-
$cols['title'] = __('Title', '
|
716 |
-
$cols['sdm_downloads_id'] = __('ID', '
|
717 |
-
$cols['sdm_downloads_file'] = __('File', '
|
718 |
-
$cols['taxonomy-sdm_categories'] = __('Categories', '
|
719 |
-
$cols['taxonomy-sdm_tags'] = __('Tags', '
|
720 |
-
$cols['sdm_downloads_count'] = __('Downloads', '
|
721 |
-
$cols['date'] = __('Date Posted', '
|
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.
|
7 |
-
Stable tag: 3.2.
|
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', '
|
8 |
-
'singular_name' => __('Downloads', '
|
9 |
-
'add_new' => __('Add New', '
|
10 |
-
'add_new_item' => __('Add New', '
|
11 |
-
'edit_item' => __('Edit Download', '
|
12 |
-
'new_item' => __('New Download', '
|
13 |
-
'all_items' => __('Downloads', '
|
14 |
-
'view_item' => __('View Download', '
|
15 |
-
'search_items' => __('Search Downloads', '
|
16 |
-
'not_found' => __('No Downloads found', '
|
17 |
-
'not_found_in_trash' => __('No Downloads found in Trash', '
|
18 |
-
'parent_item_colon' => __('Parent Download', '
|
19 |
-
'menu_name' => __('Downloads', '
|
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', '
|
47 |
-
'singular_name' => _x('Category', '
|
48 |
-
'search_items' => __('Search Categories', '
|
49 |
-
'all_items' => __('All Categories', '
|
50 |
-
'parent_item' => __('Categories Genre', '
|
51 |
-
'parent_item_colon' => __('Categories Genre:', '
|
52 |
-
'edit_item' => __('Edit Category', '
|
53 |
-
'update_item' => __('Update Category', '
|
54 |
-
'add_new_item' => __('Add New Category', '
|
55 |
-
'new_item_name' => __('New Category', '
|
56 |
-
'menu_name' => __('Categories', '
|
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', '
|
71 |
-
'singular_name' => _x('Tag', '
|
72 |
-
'search_items' => __('Search Tags', '
|
73 |
-
'all_items' => __('All Tags', '
|
74 |
-
'parent_item' => __('Tags Genre', '
|
75 |
-
'parent_item_colon' => __('Tags Genre:', '
|
76 |
-
'edit_item' => __('Edit Tag', '
|
77 |
-
'update_item' => __('Update Tag', '
|
78 |
-
'add_new_item' => __('Add New Tag', '
|
79 |
-
'new_item_name' => __('New Tag', '
|
80 |
-
'menu_name' => __('Tags', '
|
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', '
|
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!', '
|
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', '
|
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.', '
|
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', '
|
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!', '
|
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.', '
|
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.', '
|
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', '
|
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.', '
|
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.', '
|
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.', '
|
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.', '
|
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', '
|
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!', '
|
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 |
-
|
|
|
|
|
|
|
|
|
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 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
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
|