PluginProbe ʕ •ᴥ•ʔ
Download Manager / 3.3.62
Download Manager v3.3.62
3.3.65 3.3.64 3.3.63 3.3.62 3.3.61 3.3.60 3.3.59 3.3.58 3.3.57 3.3.56 trunk 2.1.3 2.3.0 2.5.96 2.5.97 2.6.2 2.6.96 2.8.3 2.9.99 3.0.4 3.1.05 3.1.07 3.1.08 3.1.11 3.1.12 3.1.14 3.1.17 3.1.18 3.1.22 3.1.23 3.1.24 3.1.25 3.1.26 3.1.27 3.1.28 3.2.04 3.2.13 3.2.14 3.2.16 3.2.18 3.2.19 3.2.21 3.2.22 3.2.23 3.2.24 3.2.25 3.2.27 3.2.28 3.2.29 3.2.30 3.2.31 3.2.32 3.2.33 3.2.34 3.2.35 3.2.37 3.2.38 3.2.39 3.2.40 3.2.41 3.2.42 3.2.43 3.2.44 3.2.45 3.2.46 3.2.47 3.2.48 3.2.49 3.2.50 3.2.51 3.2.52 3.2.53 3.2.54 3.2.55 3.2.56 3.2.57 3.2.58 3.2.59 3.2.60 3.2.61 3.2.63 3.2.64 3.2.65 3.2.66 3.2.67 3.2.68 3.2.69 3.2.70 3.2.71 3.2.72 3.2.73 3.2.74 3.2.75 3.2.76 3.2.77 3.2.78 3.2.79 3.2.80 3.2.81 3.2.82 3.2.83 3.2.84 3.2.85 3.2.86 3.2.87 3.2.88 3.2.89 3.2.90 3.2.91 3.2.92 3.2.93 3.2.94 3.2.95 3.2.96 3.2.97 3.2.98 3.2.99 3.3.00 3.3.01 3.3.02 3.3.03 3.3.04 3.3.05 3.3.06 3.3.07 3.3.08 3.3.09 3.3.10 3.3.11 3.3.12 3.3.13 3.3.14 3.3.15 3.3.16 3.3.17 3.3.18 3.3.19 3.3.20 3.3.21 3.3.22 3.3.23 3.3.24 3.3.25 3.3.26 3.3.27 3.3.28 3.3.29 3.3.30 3.3.31 3.3.32 3.3.33 3.3.34 3.3.35 3.3.36 3.3.37 3.3.38 3.3.39 3.3.40 3.3.41 3.3.42 3.3.43 3.3.44 3.3.45 3.3.46 3.3.47 3.3.48 3.3.49 3.3.50 3.3.51 3.3.52 3.3.53 3.3.54 3.3.55
download-manager / src / User / views / dashboard / download-history.php
download-manager / src / User / views / dashboard Last commit date
dashboard.php 5 months ago download-history.php 5 months ago edit-profile.php 5 months ago profile.php 5 months ago
download-history.php
231 lines
1 <?php
2 /**
3 * User Dashboard - Download History
4 * Enterprise-grade design
5 */
6
7 use WPDM\__\__;
8
9 if (!defined('ABSPATH')) die();
10
11 global $wpdb, $current_user, $wp_query;
12
13 $items_per_page = 20;
14 $current_page = isset($_GET['pgd']) ? max(1, absint($_GET['pgd'])) : 1;
15 $start = ($current_page - 1) * $items_per_page;
16
17 // Get total count for pagination
18 $total_items = (int) $wpdb->get_var($wpdb->prepare(
19 "SELECT COUNT(*) FROM {$wpdb->prefix}ahm_download_stats WHERE uid = %d",
20 $current_user->ID
21 ));
22
23 // Get paginated results
24 $downloads = $wpdb->get_results($wpdb->prepare(
25 "SELECT p.post_title, s.* FROM {$wpdb->prefix}posts p, {$wpdb->prefix}ahm_download_stats s
26 WHERE s.uid = %d AND s.pid = p.ID
27 ORDER BY s.timestamp DESC
28 LIMIT %d, %d",
29 $current_user->ID,
30 $start,
31 $items_per_page
32 ));
33
34 $total_pages = ceil($total_items / $items_per_page);
35 ?>
36
37 <?php do_action("wpdm_before_download_history"); ?>
38
39 <?php if (class_exists('\WPDM\AddOn\DownloadLimit')): ?>
40 <!-- Download Limit Info -->
41 <div class="row mb-3">
42 <div class="col-md-6 mb-2">
43 <div class="card h-100">
44 <div class="card-body py-3">
45 <div class="media">
46 <div class="mr-3 text-info">
47 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>
48 </div>
49 <div class="media-body">
50 <small class="text-muted d-block"><?php esc_html_e('Reset Timer', 'download-manager'); ?></small>
51 <strong><?php echo do_shortcode("[wpdm_download_limit_reset_timer]"); ?></strong>
52 </div>
53 </div>
54 </div>
55 </div>
56 </div>
57 <div class="col-md-6 mb-2">
58 <div class="card h-100">
59 <div class="card-body py-3">
60 <div class="media">
61 <div class="mr-3 text-warning">
62 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg>
63 </div>
64 <div class="media-body">
65 <small class="text-muted d-block"><?php esc_html_e('Download Limit', 'download-manager'); ?></small>
66 <strong><?php echo do_shortcode("[wpdm_user_download_count]"); ?> / <?php echo do_shortcode("[wpdm_user_download_limit]"); ?></strong>
67 </div>
68 </div>
69 </div>
70 </div>
71 </div>
72 </div>
73 <?php endif; ?>
74
75 <!-- Download History Card -->
76 <div class="wpdm-card">
77 <div class="wpdm-card-header">
78 <h3>
79 <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>
80 <?php esc_html_e('Download History', 'download-manager'); ?>
81 </h3>
82 <?php if ($total_items > 0): ?>
83 <span class="wpdm-badge wpdm-badge--info"><?php echo number_format($total_items); ?> <?php esc_html_e('total', 'download-manager'); ?></span>
84 <?php endif; ?>
85 </div>
86
87 <?php if (!empty($downloads)): ?>
88 <div class="wpdm-table-wrap">
89 <table class="wpdm-table">
90 <thead>
91 <tr>
92 <th><?php esc_html_e('Package / File', 'download-manager'); ?></th>
93 <th class="wpdm-hide-mobile"><?php esc_html_e('Download Time', 'download-manager'); ?></th>
94 <th class="wpdm-hide-mobile" style="width: 120px;"><?php esc_html_e('IP Address', 'download-manager'); ?></th>
95 </tr>
96 </thead>
97 <tbody>
98 <?php foreach ($downloads as $stat): ?>
99 <tr>
100 <td>
101 <div class="wpdm-product-cell">
102 <a class="wpdm-table-link wpdm-product-name" href="<?php echo esc_url(get_permalink($stat->pid)); ?>">
103 <?php echo esc_html($stat->post_title); ?>
104 </a>
105 <?php if (!empty($stat->filename)): ?>
106 <span class="wpdm-file-meta">
107 <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline></svg>
108 <?php echo esc_html(__::mask($stat->filename, '...', -25, false) ?: 'Package'); ?>
109 </span>
110 <?php endif; ?>
111 <span class="wpdm-mobile-meta wpdm-show-mobile">
112 <?php echo date_i18n(get_option('date_format') . ' H:i', $stat->timestamp + __::timezoneOffset()); ?>
113 </span>
114 </div>
115 </td>
116 <td class="wpdm-hide-mobile">
117 <span class="wpdm-date"><?php echo date_i18n(get_option('date_format') . ' H:i', $stat->timestamp + __::timezoneOffset()); ?></span>
118 </td>
119 <td class="wpdm-hide-mobile">
120 <span class="wpdm-ip"><?php echo esc_html($stat->ip); ?></span>
121 </td>
122 </tr>
123 <?php endforeach; ?>
124 </tbody>
125 </table>
126 </div>
127
128 <?php if ($total_pages > 1): ?>
129 <div class="wpdm-card-footer">
130 <div class="wpdm-pagination">
131 <?php
132 $pagination_args = array(
133 'base' => add_query_arg('pgd', '%#%'),
134 'format' => '',
135 'total' => $total_pages,
136 'current' => $current_page,
137 'show_all' => false,
138 'end_size' => 1,
139 'mid_size' => 2,
140 'prev_next' => true,
141 'prev_text' => '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"></polyline></svg>',
142 'next_text' => '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>',
143 'type' => 'plain',
144 );
145 echo paginate_links($pagination_args);
146 ?>
147 </div>
148 </div>
149 <?php endif; ?>
150
151 <?php else: ?>
152 <div class="wpdm-card-body">
153 <div class="wpdm-empty-state wpdm-empty-state--compact">
154 <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>
155 <h4><?php esc_html_e('No download history', 'download-manager'); ?></h4>
156 <p><?php esc_html_e("You haven't downloaded any files yet.", 'download-manager'); ?></p>
157 </div>
158 </div>
159 <?php endif; ?>
160 </div>
161
162 <?php do_action("wpdm_after_download_history"); ?>
163
164 <style>
165 .wpdm-file-meta {
166 display: inline-flex;
167 align-items: center;
168 gap: 0.375rem;
169 font-size: 0.8125rem;
170 color: #64748b;
171 }
172 .wpdm-file-meta svg {
173 color: #94a3b8;
174 }
175 .wpdm-mobile-meta {
176 display: none;
177 font-size: 0.75rem;
178 color: #94a3b8;
179 margin-top: 0.25rem;
180 }
181 @media (max-width: 768px) {
182 .wpdm-show-mobile {
183 display: block;
184 }
185 }
186 .wpdm-pagination {
187 display: flex;
188 justify-content: center;
189 align-items: center;
190 gap: 0.25rem;
191 flex-wrap: wrap;
192 }
193 .wpdm-pagination a,
194 .wpdm-pagination span {
195 display: inline-flex;
196 align-items: center;
197 justify-content: center;
198 min-width: 36px;
199 height: 36px;
200 padding: 0 0.75rem;
201 font-size: 0.875rem;
202 font-weight: 500;
203 color: #475569;
204 background: #fff;
205 border: 1px solid #e2e8f0;
206 border-radius: 0.5rem;
207 text-decoration: none;
208 transition: all 0.15s ease;
209 }
210 .wpdm-pagination a:hover {
211 background: #f1f5f9;
212 border-color: #cbd5e1;
213 color: #1e293b;
214 }
215 .wpdm-pagination .current {
216 background: var(--wpdm-primary, #008fef);
217 border-color: var(--wpdm-primary, #008fef);
218 color: #fff;
219 }
220 .wpdm-pagination .prev,
221 .wpdm-pagination .next {
222 padding: 0;
223 min-width: 36px;
224 }
225 .wpdm-pagination .dots {
226 border: none;
227 background: transparent;
228 color: #94a3b8;
229 }
230 </style>
231