WordPress Download Manager - Version 2.1.3

Version Description

  • fixed tinymce button and editor issue
Download this release

Release Info

Developer codename065
Plugin Icon 128x128 WordPress Download Manager
Version 2.1.3
Comparing to
See all releases

Version 2.1.3

Files changed (102) hide show
  1. class.db.php +41 -0
  2. class.wpdmpagination.php +409 -0
  3. css/colorbox.css +41 -0
  4. css/front.css +166 -0
  5. css/icons.css +38 -0
  6. css/images/controls.png +0 -0
  7. css/images/loading.gif +0 -0
  8. css/jqueryFileTree.css +91 -0
  9. d16.png +0 -0
  10. d24.png +0 -0
  11. download-manager.php +646 -0
  12. download.php +92 -0
  13. download.png +0 -0
  14. editor_plugin.js +40 -0
  15. file-type-icons/avi.png +0 -0
  16. file-type-icons/doc.png +0 -0
  17. file-type-icons/docx.png +0 -0
  18. file-type-icons/file.png +0 -0
  19. file-type-icons/img.png +0 -0
  20. file-type-icons/mov.png +0 -0
  21. file-type-icons/mp3.png +0 -0
  22. file-type-icons/mp4.png +0 -0
  23. file-type-icons/pps.png +0 -0
  24. file-type-icons/ppt.png +0 -0
  25. file-type-icons/psd.png +0 -0
  26. file-type-icons/rar.png +0 -0
  27. file-type-icons/wav.png +0 -0
  28. file-type-icons/wma.png +0 -0
  29. file-type-icons/zip.png +0 -0
  30. files/.htaccess +5 -0
  31. fm-settings.php +70 -0
  32. functions.php +120 -0
  33. icon/download.png +0 -0
  34. images/Thumbs.db +0 -0
  35. images/add-file.png +0 -0
  36. images/add.png +0 -0
  37. images/application.png +0 -0
  38. images/bg_header.jpg +0 -0
  39. images/browse.png +0 -0
  40. images/bullet1.gif +0 -0
  41. images/bullet2.gif +0 -0
  42. images/category.png +0 -0
  43. images/code.png +0 -0
  44. images/css.png +0 -0
  45. images/db.png +0 -0
  46. images/directory.png +0 -0
  47. images/doc.png +0 -0
  48. images/down.png +0 -0
  49. images/download-16.png +0 -0
  50. images/download-manager-16.png +0 -0
  51. images/download-manager.png +0 -0
  52. images/error.png +0 -0
  53. images/file.png +0 -0
  54. images/film.png +0 -0
  55. images/flash.png +0 -0
  56. images/folder_open.png +0 -0
  57. images/help.png +0 -0
  58. images/help1.png +0 -0
  59. images/html.png +0 -0
  60. images/icons/download.png +0 -0
  61. images/import-files.png +0 -0
  62. images/information-balloon.png +0 -0
  63. images/information.png +0 -0
  64. images/java.png +0 -0
  65. images/linux.png +0 -0
  66. images/loading.gif +0 -0
  67. images/lock.png +0 -0
  68. images/music.png +0 -0
  69. images/pdf.png +0 -0
  70. images/php.png +0 -0
  71. images/picture.png +0 -0
  72. images/play.png +0 -0
  73. images/ppt.png +0 -0
  74. images/psd.png +0 -0
  75. images/remove.png +0 -0
  76. images/ruby.png +0 -0
  77. images/script.png +0 -0
  78. images/settings.png +0 -0
  79. images/spinner.gif +0 -0
  80. images/stats.png +0 -0
  81. images/templates.png +0 -0
  82. images/txt.png +0 -0
  83. images/xls.png +0 -0
  84. images/zip.png +0 -0
  85. img/donwloadmanager.png +0 -0
  86. js/jquery.colorbox-min.js +4 -0
  87. js/jqueryFileTree.js +95 -0
  88. l24.png +0 -0
  89. process.php +265 -0
  90. readme.txt +206 -0
  91. screenshot-1.png +0 -0
  92. screenshot-2.png +0 -0
  93. screenshot-3.png +0 -0
  94. wpdc.ppj +67 -0
  95. wpdc.ppx +1 -0
  96. wpdm-add-new-file.php +307 -0
  97. wpdm-categories.php +125 -0
  98. wpdm-free-mce-button.php +123 -0
  99. wpdm-list-files.php +189 -0
  100. wpdm-server-file-browser.php +71 -0
  101. wpdm-settings.php +70 -0
  102. wpdm-widgets.php +63 -0
class.db.php ADDED
@@ -0,0 +1,41 @@
1
+ <?php
2
+
3
+ class DMDB{
4
+
5
+
6
+ function AddNew($table, $data){
7
+ mysql_query("insert into $table set ".self::MakeQuery($data));
8
+ }
9
+
10
+ function Update($table, $data, $cond){
11
+ mysql_query("update $table set ".self::MakeQuery($data)." where ".$cond);
12
+ }
13
+
14
+ function Delete($table, $cond){
15
+ $d = mysql_fetch_assoc(mysql_query("select * from $table where $cond"));
16
+ @unlink(UPLOAD_DIR.$d['file']);
17
+ mysql_query("delete from $table where ".$cond);
18
+ }
19
+
20
+ function getById($table, $id){
21
+ return mysql_fetch_assoc(mysql_query("select * from $table where id='$id'"));
22
+ }
23
+
24
+ function getData($table, $where = '', $limit=''){
25
+ $req = mysql_query("select * from $table $where $limit");
26
+ while($r = mysql_fetch_assoc($res)){
27
+ $rows[] = $r;
28
+ }
29
+ return $rows;
30
+ }
31
+
32
+ function MakeQuery($data){
33
+ foreach($data as $k=>$d){
34
+ $qry[] = "`$k`='$d'";
35
+ }
36
+ return implode(",", $qry);
37
+ }
38
+
39
+ }
40
+
41
+ ?>
class.wpdmpagination.php ADDED
@@ -0,0 +1,409 @@
1
+ <?php
2
+
3
+ class wpdmpagination{
4
+
5
+ /*
6
+
7
+ Script Name: *Digg Style Paginator Class
8
+
9
+ Script URI: http://www.mis-algoritmos.com/2007/05/27/digg-style-pagination-class/
10
+
11
+ Description: Class in PHP that allows to use a pagination like a digg or sabrosus style.
12
+
13
+ Script Version: 0.4
14
+
15
+ Author: Victor De la Rocha
16
+
17
+ Author URI: http://www.mis-algoritmos.com
18
+
19
+ */
20
+
21
+ /*Default values*/
22
+
23
+ var $total_pages = -1;//items
24
+
25
+ var $limit = null;
26
+
27
+ var $target = "";
28
+
29
+ var $page = 1;
30
+
31
+ var $adjacents = 2;
32
+
33
+ var $showCounter = false;
34
+
35
+ var $className = "pagination";
36
+
37
+ var $parameterName = "page";
38
+
39
+ var $urlF = false;//urlFriendly
40
+
41
+ var $uriTPL = '';
42
+
43
+
44
+
45
+ /*Buttons next and previous*/
46
+
47
+ var $nextT = "Next";
48
+
49
+ var $nextI = "&#187;"; //&#9658;
50
+
51
+ var $prevT = "Previous";
52
+
53
+ var $prevI = "&#171;"; //&#9668;
54
+
55
+
56
+
57
+ /*****/
58
+
59
+ var $calculate = false;
60
+
61
+
62
+
63
+ #Total items
64
+
65
+ function items($value){$this->total_pages = (int) $value;}
66
+
67
+
68
+
69
+ #how many items to show per page
70
+
71
+ function limit($value){$this->limit = (int) $value;}
72
+
73
+
74
+
75
+ #Page to sent the page value
76
+
77
+ function target($value){$this->target = $value;}
78
+
79
+
80
+
81
+ function urlTemplate($value){$this->uriTPL = $value;}
82
+
83
+
84
+
85
+ #Current page
86
+
87
+ function currentPage($value){$this->page = (int) $value;}
88
+
89
+
90
+
91
+ #How many adjacent pages should be shown on each side of the current page?
92
+
93
+ function adjacents($value){$this->adjacents = (int) $value;}
94
+
95
+
96
+
97
+ #show counter?
98
+
99
+ function showCounter($value=""){$this->showCounter=($value===true)?true:false;}
100
+
101
+
102
+
103
+ #to change the class name of the pagination div
104
+
105
+ function changeClass($value=""){$this->className=$value;}
106
+
107
+
108
+
109
+ function nextLabel($value){$this->nextT = $value;}
110
+
111
+ function nextIcon($value){$this->nextI = $value;}
112
+
113
+ function prevLabel($value){$this->prevT = $value;}
114
+
115
+ function prevIcon($value){$this->prevI = $value;}
116
+
117
+
118
+
119
+ #to change the class name of the pagination div
120
+
121
+ function parameterName($value=""){$this->parameterName=$value;}
122
+
123
+
124
+
125
+ #to change urlFriendly
126
+
127
+ function urlFriendly($value="%"){
128
+
129
+ if(eregi('^ *#x27;,$value)){
130
+
131
+ $this->urlF=false;
132
+
133
+ return false;
134
+
135
+ }
136
+
137
+ $this->urlF=$value;
138
+
139
+ }
140
+
141
+
142
+
143
+ var $pagination;
144
+
145
+
146
+
147
+ function pagination(){}
148
+
149
+ function show(){
150
+
151
+ if(!$this->calculate)
152
+
153
+ if($this->calculate())
154
+
155
+ return "<div class=\"$this->className\">$this->pagination</div>\n";
156
+
157
+ }
158
+
159
+ function get_pagenum_link($id){
160
+
161
+ /*
162
+
163
+ if(strpos($this->target,'?')===false)
164
+
165
+ if($this->urlF)
166
+
167
+ return str_replace($this->urlF,$id,$this->target);
168
+
169
+ else
170
+
171
+ return "$this->target?$this->parameterName=$id";
172
+
173
+ else
174
+
175
+ return "$this->target&$this->parameterName=$id";
176
+
177
+ */
178
+
179
+ return str_replace('[%PAGENO%]',$id,$this->uriTPL);
180
+
181
+ }
182
+
183
+
184
+
185
+ function calculate(){
186
+
187
+ $this->pagination = "";
188
+
189
+ $this->calculate == true;
190
+
191
+ $error = false;
192
+
193
+ if($this->urlF and $this->urlF != '%' and strpos($this->target,$this->urlF)===false){
194
+
195
+ //Es necesario especificar el comodin para sustituir
196
+
197
+ echo "Especificaste un wildcard para sustituir, pero no existe en el target<br />";
198
+
199
+ $error = true;
200
+
201
+ }elseif($this->urlF and $this->urlF == '%' and strpos($this->target,$this->urlF)===false){
202
+
203
+ echo "Es necesario especificar en el target el comodin % para sustituir el n�mero de p�gina<br />";
204
+
205
+ $error = true;
206
+
207
+ }
208
+
209
+
210
+
211
+ if($this->total_pages < 0){
212
+
213
+ echo "It is necessary to specify the <strong>number of pages</strong> (\$class->items(1000))<br />";
214
+
215
+ $error = true;
216
+
217
+ }
218
+
219
+ if($this->limit == null){
220
+
221
+ echo "It is necessary to specify the <strong>limit of items</strong> to show per page (\$class->limit(10))<br />";
222
+
223
+ $error = true;
224
+
225
+ }
226
+
227
+ if($error)return false;
228
+
229
+
230
+
231
+ $n = trim($this->nextT.' '.$this->nextI);
232
+
233
+ $p = trim($this->prevI.' '.$this->prevT);
234
+
235
+
236
+
237
+ /* Setup vars for query. */
238
+
239
+ if($this->page)
240
+
241
+ $start = ($this->page - 1) * $this->limit; //first item to display on this page
242
+
243
+ else
244
+
245
+ $start = 0; //if no page var is given, set start to 0
246
+
247
+
248
+
249
+ /* Setup page vars for display. */
250
+
251
+ $prev = $this->page - 1; //previous page is page - 1
252
+
253
+ $next = $this->page + 1; //next page is page + 1
254
+
255
+ $lastpage = ceil($this->total_pages/$this->limit); //lastpage is = total pages / items per page, rounded up.
256
+
257
+ $lpm1 = $lastpage - 1; //last page minus 1
258
+
259
+
260
+
261
+ /*
262
+
263
+ Now we apply our rules and draw the pagination object.
264
+
265
+ We're actually saving the code to a variable in case we want to draw it more than once.
266
+
267
+ */
268
+
269
+
270
+
271
+ if($lastpage > 1){
272
+
273
+ if($this->page){
274
+
275
+ //anterior button
276
+
277
+ if($this->page > 1)
278
+
279
+ $this->pagination .= "<a href=\"".$this->get_pagenum_link($prev)."\" class=\"prev\" rel='Com'>$p</a>";
280
+
281
+ else
282
+
283
+ $this->pagination .= "<span class=\"disabled\">$p</span>";
284
+
285
+ }
286
+
287
+ //pages
288
+
289
+ if ($lastpage < 7 + ($this->adjacents * 2)){//not enough pages to bother breaking it up
290
+
291
+ for ($counter = 1; $counter <= $lastpage; $counter++){
292
+
293
+ if ($counter == $this->page)
294
+
295
+ $this->pagination .= "<span class=\"current\">$counter</span>";
296
+
297
+ else
298
+
299
+ $this->pagination .= "<a href=\"".$this->get_pagenum_link($counter)."\" rel='Com'>$counter</a>";
300
+
301
+ }
302
+
303
+ }
304
+
305
+ elseif($lastpage > 5 + ($this->adjacents * 2)){//enough pages to hide some
306
+
307
+ //close to beginning; only hide later pages
308
+
309
+ if($this->page < 1 + ($this->adjacents * 2)){
310
+
311
+ for ($counter = 1; $counter < 4 + ($this->adjacents * 2); $counter++){
312
+
313
+ if ($counter == $this->page)
314
+
315
+ $this->pagination .= "<span class=\"current\">$counter</span>";
316
+
317
+ else
318
+
319
+ $this->pagination .= "<a href=\"".$this->get_pagenum_link($counter)."\" rel='Com'>$counter</a>";
320
+
321
+ }
322
+
323
+ $this->pagination .= "...";
324
+
325
+ $this->pagination .= "<a href=\"".$this->get_pagenum_link($lpm1)."\" rel='Com'>$lpm1</a>";
326
+
327
+ $this->pagination .= "<a href=\"".$this->get_pagenum_link($lastpage)."\" rel='Com'>$lastpage</a>";
328
+
329
+ }
330
+
331
+ //in middle; hide some front and some back
332
+
333
+ elseif($lastpage - ($this->adjacents * 2) > $this->page && $this->page > ($this->adjacents * 2)){
334
+
335
+ $this->pagination .= "<a href=\"".$this->get_pagenum_link(1)."\" rel='Com'>1</a>";
336
+
337
+ $this->pagination .= "<a href=\"".$this->get_pagenum_link(2)."\" rel='Com'>2</a>";
338
+
339
+ $this->pagination .= "...";
340
+
341
+ for ($counter = $this->page - $this->adjacents; $counter <= $this->page + $this->adjacents; $counter++)
342
+
343
+ if ($counter == $this->page)
344
+
345
+ $this->pagination .= "<span class=\"current\">$counter</span>";
346
+
347
+ else
348
+
349
+ $this->pagination .= "<a href=\"".$this->get_pagenum_link($counter)."\" rel='Com'>$counter</a>";
350
+
351
+ $this->pagination .= "...";
352
+
353
+ $this->pagination .= "<a href=\"".$this->get_pagenum_link($lpm1)."\" rel='Com'>$lpm1</a>";
354
+
355
+ $this->pagination .= "<a href=\"".$this->get_pagenum_link($lastpage)."\" rel='Com'>$lastpage</a>";
356
+
357
+ }
358
+
359
+ //close to end; only hide early pages
360
+
361
+ else{
362
+
363
+ $this->pagination .= "<a href=\"".$this->get_pagenum_link(1)."\" rel='Com'>1</a>";
364
+
365
+ $this->pagination .= "<a href=\"".$this->get_pagenum_link(2)."\" rel='Com'>2</a>";
366
+
367
+ $this->pagination .= "...";
368
+
369
+ for ($counter = $lastpage - (2 + ($this->adjacents * 2)); $counter <= $lastpage; $counter++)
370
+
371
+ if ($counter == $this->page)
372
+
373
+ $this->pagination .= "<span class=\"current\">$counter</span>";
374
+
375
+ else
376
+
377
+ $this->pagination .= "<a href=\"".$this->get_pagenum_link($counter)."\" rel='Com'>$counter</a>";
378
+
379
+ }
380
+
381
+ }
382
+
383
+ if($this->page){
384
+
385
+ //siguiente button
386
+
387
+ if ($this->page < $counter - 1)
388
+
389
+ $this->pagination .= "<a href=\"".$this->get_pagenum_link($next)."\" class=\"next\" rel='Com'>$n</a>";
390
+
391
+ else
392
+
393
+ $this->pagination .= "<span class=\"disabled\">$n</span>";
394
+
395
+ if($this->showCounter)$this->pagination .= "<div class=\"pagination_data\">($this->total_pages Pages)</div>";
396
+
397
+ }
398
+
399
+ }
400
+
401
+
402
+
403
+ return true;
404
+
405
+ }
406
+
407
+ }
408
+
409
+ ?>
css/colorbox.css ADDED
@@ -0,0 +1,41 @@
1
+ /*
2
+ ColorBox Core Style:
3
+ The following CSS is consistent between example themes and should not be altered.
4
+ */
5
+ #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
6
+ #cboxOverlay{position:fixed; width:100%; height:100%;}
7
+ #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
8
+ #cboxContent{position:relative;}
9
+ #cboxLoadedContent{overflow:auto;}
10
+ #cboxTitle{margin:0;}
11
+ #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%;}
12
+ #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
13
+ .cboxPhoto{float:left; margin:auto; border:0; display:block;}
14
+ .cboxIframe{width:100%; height:100%; display:block; border:0;}
15
+
16
+ /*
17
+ User Style:
18
+ Change the following styles to modify the appearance of ColorBox. They are
19
+ ordered & tabbed in a way that represents the nesting of the generated HTML.
20
+ */
21
+ #cboxOverlay{background:#fff;}
22
+ #colorbox{}
23
+ #cboxContent{margin-top:32px; overflow:visible;}
24
+ #cboxError{padding:50px; border:1px solid #ccc;}
25
+ #cboxLoadedContent{background:#000; padding:1px;}
26
+ #cboxLoadingGraphic{background:url(images/loading.gif) no-repeat center center;}
27
+ #cboxLoadingOverlay{background:#000;}
28
+ #cboxTitle{position:absolute; top:-22px; left:0; color:#000;}
29
+ #cboxCurrent{position:absolute; top:-22px; right:205px; text-indent:-9999px;}
30
+ #cboxSlideshow, #cboxPrevious, #cboxNext, #cboxClose{text-indent:-9999px; width:20px; height:20px; position:absolute; top:-20px; background:url(images/controls.png) no-repeat 0 0;}
31
+ #cboxPrevious{background-position:0px 0px; right:44px;}
32
+ #cboxPrevious.hover{background-position:0px -25px;}
33
+ #cboxNext{background-position:-25px 0px; right:22px;}
34
+ #cboxNext.hover{background-position:-25px -25px;}
35
+ #cboxClose{background-position:-50px 0px; right:0;}
36
+ #cboxClose.hover{background-position:-50px -25px;}
37
+ .cboxSlideshow_on #cboxPrevious, .cboxSlideshow_off #cboxPrevious{right:66px;}
38
+ .cboxSlideshow_on #cboxSlideshow{background-position:-75px -25px; right:44px;}
39
+ .cboxSlideshow_on #cboxSlideshow.hover{background-position:-100px -25px;}
40
+ .cboxSlideshow_off #cboxSlideshow{background-position:-100px 0px; right:44px;}
41
+ .cboxSlideshow_off #cboxSlideshow.hover{background-position:-75px -25px;}
css/front.css ADDED
@@ -0,0 +1,166 @@
1
+ .download_link{
2
+
3
+ padding:10px 20px;
4
+ background: #6db3f2; /* old browsers */
5
+
6
+ background: -moz-linear-gradient(top, #6db3f2 0%, #1e69de 100%); /* firefox */
7
+
8
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6db3f2), color-stop(100%,#1e69de)); /* webkit */
9
+
10
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6db3f2', endColorstr='#1e69de',GradientType=0 ); /* ie */
11
+ float: left;
12
+ -webkit-border-radius: 7px;
13
+ -moz-border-radius: 7px;
14
+ border-radius: 7px;
15
+ -moz-box-shadow: 0 0 5px #888;
16
+ -webkit-box-shadow: 0 0 5px#888;
17
+ box-shadow: 0 0 5px #888;
18
+ font-size:10pt;
19
+ font-family: Tahoma;
20
+ letter-spacing: 1px;
21
+ text-transform: uppercase;
22
+
23
+ }
24
+ .download_link a{
25
+ color: #FFF;
26
+ font-weight: bold;
27
+ }
28
+ .download_link input{
29
+ border:1px solid #7BBA60;
30
+ padding:4px;
31
+ font-size:10pt;
32
+ font-family: Tahoma;
33
+ letter-spacing: 1px;
34
+ }
35
+
36
+ .wpdm_submit{
37
+ background: #777 url('../images/play.png') 4px center no-repeat;
38
+ color: #FFF;
39
+ padding-left: 20px !important;
40
+ }
41
+ .wpdm_submit_wait{
42
+ background: #777 url('../images/loading.gif') 4px center no-repeat;
43
+ color: #FFF;
44
+ padding-left: 20px !important;
45
+ }
46
+ #wpdm_submit_error{
47
+ background: #FFF4F4;
48
+ border:1px solid #990000;
49
+ padding:10px;
50
+ float: left;
51
+ margin-top:10px;
52
+ display: none;
53
+ }
54
+
55
+ .wpdm_package{
56
+ float: left;
57
+ margin: 5px;
58
+ border:1px solid #ccc;
59
+ padding:5px;
60
+ text-align: center;
61
+ }
62
+ .download_link input{
63
+ margin:0px !important;
64
+ }
65
+
66
+ .myorder th{font-weight:bold;text-align: left;font-size:10pt;}
67
+ .myorder tr.items td{text-align: left;font-size:9pt;}
68
+ .myorder tr.item td{font-size: 8pt;}
69
+
70
+ .wpdm_category .thumb{
71
+
72
+ -moz-box-shadow: 0 0 5px #888;
73
+ -webkit-box-shadow: 0 0 5px#888;
74
+ box-shadow: 0 0 5px #888;
75
+
76
+ }
77
+ .wpdm_category .thumb{
78
+ float:left;
79
+ margin-right:25px;
80
+ }
81
+ .wpdm_category .desc{
82
+ float:left;
83
+ line-height: 1.5;
84
+ width: 70%;
85
+ }
86
+ .middle{
87
+ font-family:Tahoma;
88
+ font-size:10pt;
89
+ letter-spacing: 1px;
90
+ line-height: 1.5;
91
+ }
92
+ .middle .det{padding:15px;}
93
+
94
+
95
+ {
96
+ width: 700px;
97
+ padding: 0;
98
+ margin: 0;
99
+ }
100
+
101
+ #mytable caption {
102
+ padding: 0 0 5px 0;
103
+ width: 700px;
104
+ font: italic 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
105
+ text-align: right;
106
+ }
107
+
108
+ #mytable th {
109
+ font: bold 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
110
+ color: #4f6b72;
111
+ border-right: 1px solid #C1DAD7;
112
+ border-bottom: 1px solid #C1DAD7;
113
+ border-top: 1px solid #C1DAD7;
114
+ letter-spacing: 2px;
115
+ text-transform: uppercase;
116
+ text-align: left;
117
+ padding: 6px 6px 6px 12px;
118
+ background: #CAE8EA url(../images/bg_header.jpg) no-repeat;
119
+ }
120
+
121
+ #mytable th.nobg {
122
+ border-top: 0;
123
+ border-left: 0;
124
+ border-right: 1px solid #C1DAD7;
125
+ background: none;
126
+ }
127
+
128
+ #mytable td {
129
+ border-right: 1px solid #C1DAD7;
130
+ border-bottom: 1px solid #C1DAD7;
131
+ background: #fff;
132
+ padding: 6px 6px 6px 12px;
133
+ color: #4f6b72;
134
+ margin:0px !important;
135
+ }
136
+
137
+
138
+ #mytable tr.order td {
139
+ background: #F5FAFA;
140
+ color: #797268;
141
+ }
142
+
143
+ #mytable th.spec {
144
+ border-left: 1px solid #C1DAD7;
145
+ border-top: 0;
146
+ background: #fff url(../images/bullet1.gif) no-repeat;
147
+ font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
148
+ }
149
+
150
+ #mytable th.specalt {
151
+ border-left: 1px solid #C1DAD7;
152
+ border-top: 0;
153
+ background: #f5fafa url(../images/bullet2.gif) no-repeat;
154
+ font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
155
+ color: #797268;
156
+ }
157
+
158
+ .wpdm-filelist{
159
+ list-style:none;
160
+ }
161
+
162
+ .ind-download{
163
+ position:inline-block;
164
+ background: url(../images/download-16.png) left center no-repeat;
165
+ padding-left:20px;
166
+ }
css/icons.css ADDED
@@ -0,0 +1,38 @@
1
+
2
+ #icon-file-manager{
3
+ background: url('../images/download-manager.png') center center no-repeat;
4
+ }
5
+
6
+ #icon-add-new-file{
7
+ background: url('../images/add-file.png') center center no-repeat;
8
+ }
9
+ #icon-error{
10
+ background: url('../images/error.png') center center no-repeat;
11
+ }
12
+ #icon-import-file{
13
+ background: url('../images/import-files.png') center center no-repeat;
14
+ }
15
+ #icon-categories{
16
+ background: url('../images/category.png') center center no-repeat;
17
+ }
18
+ #icon-template{
19
+ background: url('../images/templates.png') center center no-repeat;
20
+ }
21
+ #icon-settings{
22
+ background: url('../images/settings.png') center center no-repeat;
23
+ }
24
+ #icon-stats{
25
+ background: url('../images/stats.png') center center no-repeat;
26
+ }
27
+
28
+ .infoicon{
29
+ background: url('../images/help1.png') center center no-repeat;
30
+ text-indent: -999999;
31
+ display: inline-block;
32
+ color:transparent;
33
+ width:16px;
34
+ height:16px;
35
+ border:0px !important;
36
+ }
37
+
38
+
css/images/controls.png ADDED
Binary file
css/images/loading.gif ADDED
Binary file
css/jqueryFileTree.css ADDED
@@ -0,0 +1,91 @@
1
+ UL.jqueryFileTree {
2
+ font-family: Verdana, sans-serif;
3
+ font-size: 11px;
4
+ line-height: 18px;
5
+ padding: 0px;
6
+ margin: 0px;
7
+ }
8
+
9
+ UL.jqueryFileTree LI {
10
+ list-style: none;
11
+ padding: 0px;
12
+ padding-left: 20px;
13
+ margin: 0px;
14
+ white-space: nowrap;
15
+ }
16
+
17
+ UL.jqueryFileTree A {
18
+ color: #333;
19
+ text-decoration: none;
20
+ display: block;
21
+ padding: 0px 2px;
22
+ }
23
+
24
+ UL.jqueryFileTree A:hover {
25
+ background: #BDF;
26
+ }
27
+
28
+ /* Core Styles */
29
+ .jqueryFileTree LI.directory { background: url(../images/directory.png) left top no-repeat; }
30
+ .jqueryFileTree LI.expanded { background: url(../images/folder_open.png) left top no-repeat; }
31
+ .jqueryFileTree LI.file { background: url(../images/file.png) left top no-repeat; }
32
+ .jqueryFileTree LI.wait { background: url(../images/spinner.gif) left top no-repeat; }
33
+ /* File Extensions*/
34
+ .jqueryFileTree LI.ext_3gp { background: url(../images/film.png) left top no-repeat; }
35
+ .jqueryFileTree LI.ext_afp { background: url(../images/code.png) left top no-repeat; }
36
+ .jqueryFileTree LI.ext_afpa { background: url(../images/code.png) left top no-repeat; }
37
+ .jqueryFileTree LI.ext_asp { background: url(../images/code.png) left top no-repeat; }
38
+ .jqueryFileTree LI.ext_aspx { background: url(../images/code.png) left top no-repeat; }
39
+ .jqueryFileTree LI.ext_avi { background: url(../images/film.png) left top no-repeat; }
40
+ .jqueryFileTree LI.ext_bat { background: url(../images/application.png) left top no-repeat; }
41
+ .jqueryFileTree LI.ext_bmp { background: url(../images/picture.png) left top no-repeat; }
42
+ .jqueryFileTree LI.ext_c { background: url(../images/code.png) left top no-repeat; }
43
+ .jqueryFileTree LI.ext_cfm { background: url(../images/code.png) left top no-repeat; }
44
+ .jqueryFileTree LI.ext_cgi { background: url(../images/code.png) left top no-repeat; }
45
+ .jqueryFileTree LI.ext_com { background: url(../images/application.png) left top no-repeat; }
46
+ .jqueryFileTree LI.ext_cpp { background: url(../images/code.png) left top no-repeat; }
47
+ .jqueryFileTree LI.ext_css { background: url(../images/css.png) left top no-repeat; }
48
+ .jqueryFileTree LI.ext_doc { background: url(../images/doc.png) left top no-repeat; }
49
+ .jqueryFileTree LI.ext_exe { background: url(../images/application.png) left top no-repeat; }
50
+ .jqueryFileTree LI.ext_gif { background: url(../images/picture.png) left top no-repeat; }
51
+ .jqueryFileTree LI.ext_fla { background: url(../images/flash.png) left top no-repeat; }
52
+ .jqueryFileTree LI.ext_h { background: url(../images/code.png) left top no-repeat; }
53
+ .jqueryFileTree LI.ext_htm { background: url(../images/html.png) left top no-repeat; }
54
+ .jqueryFileTree LI.ext_html { background: url(../images/html.png) left top no-repeat; }
55
+ .jqueryFileTree LI.ext_jar { background: url(../images/java.png) left top no-repeat; }
56
+ .jqueryFileTree LI.ext_jpg { background: url(../images/picture.png) left top no-repeat; }
57
+ .jqueryFileTree LI.ext_jpeg { background: url(../images/picture.png) left top no-repeat; }
58
+ .jqueryFileTree LI.ext_js { background: url(../images/script.png) left top no-repeat; }
59
+ .jqueryFileTree LI.ext_lasso { background: url(../images/code.png) left top no-repeat; }
60
+ .jqueryFileTree LI.ext_log { background: url(../images/txt.png) left top no-repeat; }
61
+ .jqueryFileTree LI.ext_m4p { background: url(../images/music.png) left top no-repeat; }
62
+ .jqueryFileTree LI.ext_mov { background: url(../images/film.png) left top no-repeat; }
63
+ .jqueryFileTree LI.ext_mp3 { background: url(../images/music.png) left top no-repeat; }
64
+ .jqueryFileTree LI.ext_mp4 { background: url(../images/film.png) left top no-repeat; }
65
+ .jqueryFileTree LI.ext_mpg { background: url(../images/film.png) left top no-repeat; }
66
+ .jqueryFileTree LI.ext_mpeg { background: url(../images/film.png) left top no-repeat; }
67
+ .jqueryFileTree LI.ext_ogg { background: url(../images/music.png) left top no-repeat; }
68
+ .jqueryFileTree LI.ext_pcx { background: url(../images/picture.png) left top no-repeat; }
69
+ .jqueryFileTree LI.ext_pdf { background: url(../images/pdf.png) left top no-repeat; }
70
+ .jqueryFileTree LI.ext_php { background: url(../images/php.png) left top no-repeat; }
71
+ .jqueryFileTree LI.ext_png { background: url(../images/picture.png) left top no-repeat; }
72
+ .jqueryFileTree LI.ext_ppt { background: url(../images/ppt.png) left top no-repeat; }
73
+ .jqueryFileTree LI.ext_psd { background: url(../images/psd.png) left top no-repeat; }
74
+ .jqueryFileTree LI.ext_pl { background: url(../images/script.png) left top no-repeat; }
75
+ .jqueryFileTree LI.ext_py { background: url(../images/script.png) left top no-repeat; }
76
+ .jqueryFileTree LI.ext_rb { background: url(../images/ruby.png) left top no-repeat; }
77
+ .jqueryFileTree LI.ext_rbx { background: url(../images/ruby.png) left top no-repeat; }
78
+ .jqueryFileTree LI.ext_rhtml { background: url(../images/ruby.png) left top no-repeat; }
79
+ .jqueryFileTree LI.ext_rpm { background: url(../images/linux.png) left top no-repeat; }
80
+ .jqueryFileTree LI.ext_ruby { background: url(../images/ruby.png) left top no-repeat; }
81
+ .jqueryFileTree LI.ext_sql { background: url(../images/db.png) left top no-repeat; }
82
+ .jqueryFileTree LI.ext_swf { background: url(../images/flash.png) left top no-repeat; }
83
+ .jqueryFileTree LI.ext_tif { background: url(../images/picture.png) left top no-repeat; }
84
+ .jqueryFileTree LI.ext_tiff { background: url(../images/picture.png) left top no-repeat; }
85
+ .jqueryFileTree LI.ext_txt { background: url(../images/txt.png) left top no-repeat; }
86
+ .jqueryFileTree LI.ext_vb { background: url(../images/code.png) left top no-repeat; }
87
+ .jqueryFileTree LI.ext_wav { background: url(../images/music.png) left top no-repeat; }
88
+ .jqueryFileTree LI.ext_wmv { background: url(../images/film.png) left top no-repeat; }
89
+ .jqueryFileTree LI.ext_xls { background: url(../images/xls.png) left top no-repeat; }
90
+ .jqueryFileTree LI.ext_xml { background: url(../images/code.png) left top no-repeat; }
91
+ .jqueryFileTree LI.ext_zip { background: url(../images/zip.png) left top no-repeat; }
d16.png ADDED
Binary file
d24.png ADDED
Binary file
download-manager.php ADDED
@@ -0,0 +1,646 @@
1
+ <?php
2
+ /**
3
+ * @package Download Manager
4
+ * @author Shaon
5
+ * @version 2.1.3
6
+ */
7
+ /*
8
+ Plugin Name: Download Manager
9
+ Plugin URI: http://www.wpdownloadmanager.com/
10
+ Description: Manage, track and controll file download from your wordpress site
11
+ Author: Shaon
12
+ Version: 2.1.3
13
+ Author URI: http://www.wpdownloadmanager.com/
14
+ */
15
+
16
+ $d = str_replace('\\','/',dirname(__FILE__));
17
+ $d = explode("/", $d);
18
+ array_pop($d);
19
+ array_pop($d);
20
+ $d = implode('/', $d);
21
+
22
+ define('UPLOAD_DIR',$d.'/uploads/download-manager-files/');
23
+ define('UPLOAD_BASE',$d.'/uploads/');
24
+
25
+ function wpdm_process(){
26
+ if($_GET['wpdmact']=='process')
27
+ include("process.php");
28
+ }
29
+
30
+ include("functions.php");
31
+ include("class.wpdmpagination.php");
32
+ include("wpdm-server-file-browser.php");
33
+
34
+ if(!$_POST) $_SESSION['download'] = 0;
35
+
36
+ function wpdm_download_info(){
37
+ include("download.php");
38
+ }
39
+
40
+ function wpdm_free_install(){
41
+ global $wpdb;
42
+
43
+ $sql = "CREATE TABLE IF NOT EXISTS `ahm_files` (
44
+ `id` int(11) NOT NULL AUTO_INCREMENT,
45
+ `title` varchar(255) NOT NULL,
46
+ `description` text NOT NULL,
47
+ `category` text NOT NULL,
48
+ `file` varchar(255) NOT NULL,
49
+ `password` varchar(40) NOT NULL,
50
+ `download_count` int(11) NOT NULL,
51
+ `access` enum('guest','member') CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
52
+ `show_counter` tinyint(1) NOT NULL,
53
+ `quota` INT NOT NULL,
54
+ `link_label` varchar(255) NOT NULL,
55
+ PRIMARY KEY (`id`)
56
+ ) ENGINE=MyISAM DEFAULT CHARSET=utf8";
57
+
58
+ require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
59
+
60
+ $wpdb->query($sql);
61
+ //$wpdb->query("ALTER TABLE `ahm_files` ADD `` varchar(255) NOT NULL");
62
+ $wpdb->query("ALTER TABLE `ahm_files` ADD `link_label` varchar(255) NOT NULL");
63
+ $wpdb->query("ALTER TABLE `ahm_files` ADD `show_counter` tinyint(1) NOT NULL");
64
+ $wpdb->query("ALTER TABLE `ahm_files` ADD `download_count` INT NOT NULL");
65
+ $wpdb->query("ALTER TABLE `ahm_files` ADD `quota` INT NOT NULL");
66
+ $wpdb->query("ALTER TABLE `ahm_files` ADD `category` TEXT NOT NULL");
67
+
68
+ update_option('wpdm_access_level','administrator');
69
+ wpdm_create_dir();
70
+
71
+ }
72
+
73
+ function wpdm_new_packages($show=5, $show_count=true){
74
+ global $wpdb;
75
+
76
+ $data = $wpdb->get_results("select * from ahm_files order by id desc limit 0, $show",ARRAY_A);
77
+ foreach($data as $d){
78
+
79
+ $key = $d['id'];
80
+ if($show_count) $sc = "<br/><i>$d[download_count] downloads</i>";
81
+ $url = home_url("/?download={$d[id]}");
82
+ echo "<li><a class='wpdm-popup' rel='colorbox' title='$d[title]' href='$url'>{$d[title]}</a> $sc</li>\r\n";
83
+ }
84
+ }
85
+
86
+ function wpdm_import_download_monitor(){
87
+ global $wpdb;
88
+ $data = $wpdb->get_results("select * from {$wpdb->prefix}download_monitor_files");
89
+ if($data){
90
+ foreach($data as $d){
91
+ $tdata = $wpdb->get_results("select t.name from {$wpdb->prefix}download_monitor_taxonomies t,{$wpdb->prefix}download_monitor_relationships r where t.taxonomy='category' and t.id=r.taxonomy_id and r.download_id={$d->id}");
92
+ $ct = array();
93
+ foreach($tdata as $c){
94
+ $ctu = strtolower(preg_replace("/([^a-zA-Z0-9\-]+)/","-", $c->name));
95
+ $ct[] = $ctu;
96
+ $allc["$ctu"] = array('title'=>$c->name);
97
+ }
98
+ $wpdm = array(
99
+ 'title'=>$d->title,
100
+ 'description'=>$d->file_description,
101
+ 'file'=>$d->filename,
102
+ 'password'=>'',
103
+ 'download_count'=>$d->hits,
104
+ 'access'=> ($d->member?'member':'guest'),
105
+ 'show_counter'=>'1',
106
+ 'quota'=>0,
107
+ 'category' => serialize($ct),
108
+ 'link_label'=>'Download'
109
+ );
110
+ $wpdb->insert('ahm_files', $wpdm);
111
+ }
112
+ $tpldata = maybe_unserialize(get_option('_fm_categories'));
113
+ if(!$tpldata) $tpldata = array();
114
+ $tpldata = $tpldata + $allc;
115
+ update_option('_fm_categories',@serialize($tpldata));
116
+ }
117
+ echo "
118
+ <script>
119
+ location.href='admin.php?page=file-manager';
120
+ </script>
121
+ ";
122
+ die();
123
+
124
+
125
+ }
126
+
127
+
128
+
129
+ function wpdm_downloadable($content){
130
+ global $wpdb;
131
+
132
+ preg_match_all("/\{filelink\=([^\}]+)\}/", $content, $matches);
133
+
134
+ $home = home_url('/');
135
+
136
+ $sap = count($_GET)>0?'&':'?';
137
+ for($i=0;$i<count($matches[1]);$i++){
138
+ $id = $matches[1][$i];
139
+ $data = $wpdb->get_row("select * from ahm_files where id='$id'",ARRAY_A);
140
+ $wpdm_login_msg = get_option('wpdm_login_msg')?get_option('wpdm_login_msg'):'Login Required';
141
+ $link_label = $data['link_label']?$data['link_label']:'Download';
142
+ if($data['access']=='member'&&!is_user_logged_in())
143
+ $matches[1][$i] = "<a href='".get_option('siteurl')."/wp-login.php?redirect_to=".$_SERVER['REQUEST_URI']."' style=\"background:url('".get_option('siteurl')."/wp-content/plugins/download-manager/l24.png') no-repeat;padding:3px 12px 12px 28px;font:bold 10pt verdana;\">".$wpdm_login_msg."</a>";
144
+ else {
145
+ if($data['password']=='') { $url = home_url('/?wpdmact=process&did='.base64_encode($id.'.hotlink')); $classrel = ""; }
146
+ else { $url = home_url('/?download='.$id); $classrel = " class='wpdm-popup' rel='colorbox' "; }
147
+ $matches[1][$i] = "<a $classrel title='{$data[title]}' href='$url' style=\"background:url('".get_option('siteurl')."/wp-content/plugins/download-manager/icon/download.png') no-repeat;padding:3px 12px 12px 28px;font:bold 10pt verdana;\">$link_label</a>";
148
+ if($data['show_counter']!=0)
149
+ $matches[1][$i] .= "<br><small style='margin-left:30px;'>Downloaded $data[download_count] times</small>";
150
+ }
151
+ }
152
+
153
+ preg_match_all("/\{wpdm_category\=([^\}]+)\}/", $content, $cmatches);
154
+ for($i=0;$i<count($cmatches[1]);$i++){
155
+ $cmatches[1][$i] = wpdm_embed_category($cmatches[1][$i]);
156
+ }
157
+ $content = str_replace($cmatches[0],$cmatches[1], $content);
158
+ return str_replace($matches[0],$matches[1], $content);
159
+
160
+ }
161
+
162
+ function wpdm_cblist_categories($parent="", $level = 0, $sel = array()){
163
+ $cats = maybe_unserialize(get_option('_fm_categories'));
164
+ if(is_array($cats)){
165
+ if($parent!='') echo "<ul>";
166
+ foreach($cats as $id=>$cat){
167
+ $pres = str_repeat("&mdash;", $level);
168
+ if($cat['parent']==$parent){
169
+ if(in_array($id,$sel))
170
+ $checked = 'checked=checked';
171
+ else
172
+ $checked = '';
173
+ echo "<li><input type='checkbox' name='file[category][]' value='$id' $checked /> $cat[title]</li>\n";
174
+ wpdm_cblist_categories($id,$level+1, $sel);}
175
+ }
176
+ if($parent!='') echo "</ul>";
177
+ }
178
+ }
179
+
180
+ function wpdm_dropdown_categories($parent="", $level = 0, $sel='',$cid='',$class=array()){
181
+ $cats = maybe_unserialize(get_option('_fm_categories'));
182
+ if(!is_array($cats)) $cats = array();
183
+ foreach($cats as $id=>$cat){
184
+ $pres = str_repeat("&mdash;", $level);
185
+ array_push($class,$parent);
186
+ if($parent=='') $class = array();
187
+ $class = array_unique($class);
188
+ $cssclass = implode(" ",$class);
189
+ if($cat['parent']==$parent){
190
+ if($sel==$id)
191
+ echo "<option class='level_{$level} $id $cssclass' selected=selected value='$id'>{$pres} $cat[title]</option>\n";
192
+ else
193
+ echo "<option class='level_{$level} $id $cssclass' value='$id'>{$pres} $cat[title]</option>\n";
194
+ wpdm_dropdown_categories($id,$level+1, $sel, $cid, $class);}
195
+ }
196
+
197
+ }
198
+
199
+ function wpdm_admin_options(){
200
+
201
+ if(!file_exists(UPLOAD_DIR)&&$_GET[task]!='wpdm_create_dir'){
202
+
203
+ echo "
204
+ <div id=\"warning\" class=\"error fade\"><p>
205
+ Automatic dir creation failed! [ <a href='admin.php?page=file-manager&task=CreateDir&re=1'>Try again to create dir automatically</a> ]<br><br>
206
+ Please create dir <strong>" . UPLOAD_DIR . "</strong> manualy and set permision to <strong>777</strong><br><br>
207
+ Otherwise you will not be able to upload files.</p></div>";
208
+ }
209
+
210
+ if($_GET[success]==1){
211
+ echo "
212
+ <div id=\"message\" class=\"updated fade\"><p>
213
+ Congratulation! Plugin is ready to use now.
214
+ </div>
215
+ ";
216
+ }
217
+
218
+
219
+ if(!file_exists(UPLOAD_DIR.'.htaccess'))
220
+ setHtaccess();
221
+
222
+ if($_GET[task]!='')
223
+ return call_user_func($_GET['task']);
224
+ else
225
+ include('wpdm-list-files.php');
226
+ }
227
+
228
+ function wpdm_delete_file(){
229
+ global $wpdb;
230
+ if(is_array($_GET[id])){
231
+ foreach($_GET[id] as $id){
232
+ $qry[] = "id='".(int)$id."'";
233
+ }
234
+ $cond = implode(" and ", $qry);
235
+ } else
236
+ $cond = "id='".(int)$_GET[id]."'";
237
+ $wpdb->query("delete from ahm_files where ". $cond);
238
+ echo "<script>
239
+ location.href='admin.php?page=file-manager';
240
+ </script>";
241
+ die();
242
+ }
243
+
244
+ function wpdm_create_dir(){
245
+ if(!file_exists(UPLOAD_BASE)){
246
+ @mkdir(UPLOAD_BASE,0777);
247
+ }
248
+ @chmod(UPLOAD_BASE,0777);
249
+ @mkdir(UPLOAD_DIR,0777);
250
+ @chmod(UPLOAD_DIR,0777);
251
+ @chmod(dir(__FILE__).'/cache/',0777);
252
+ wpdm_set_htaccess();
253
+ if($_GET[re]==1) {
254
+ if(file_exists(UPLOAD_DIR)) $s=1;
255
+ else $s = 0;
256
+ echo "<script>
257
+ location.href='{$_SERVER[HTTP_REFERER]}&success={$s}';
258
+ </script>";
259
+ die();
260
+ }
261
+ }
262
+
263
+ function wpdm_settings(){
264
+ if($_POST){
265
+ update_option('wpdm_access_level',$_POST[access]);
266
+ update_option('wpdm_login_msg',$_POST[wpdm_login_msg]);
267
+ }
268
+ if(is_uploaded_file($_FILES['icon']['tmp_name'])){
269
+ ///print_r(dirname(__FILE__).'/icon/download.png');
270
+ move_uploaded_file($_FILES['icon']['tmp_name'],dirname(__FILE__).'/icon/download.png');
271
+ }
272
+ $access = get_option('wpdm_access_level');
273
+ include('wpdm-settings.php');
274
+ }
275
+
276
+ function wpdm_add_new_file(){
277
+ global $wpdb;
278
+ if(!file_exists(UPLOAD_DIR)){
279
+
280
+ echo "
281
+ <div id=\"warning\" class=\"error fade\"><p>
282
+ Automatic dir creation failed! [ <a href='admin.php?page=file-manager&task=wpdm_create_dir&re=1'>Try again to create dir automatically</a> ]<br><br>
283
+ Please create dir <strong>" . UPLOAD_DIR . "</strong> manualy and set permision to <strong>777</strong><br><br>
284
+ Otherwise you will not be able to upload files.
285
+ </p></div>";
286
+ }
287
+
288
+ if($_GET[success]==1){
289
+ echo "
290
+ <div id=\"message\" class=\"updated fade\"><p>
291
+ Congratulation! Plugin is ready to use now.
292
+ </div>
293
+ ";
294
+ }
295
+
296
+ if($_POST){
297
+ extract($_POST);
298
+ if(is_uploaded_file($_FILES['media']['tmp_name'])){
299
+ $info = pathinfo($_FILES['media']['name']);
300
+ //echo dirname(__FILE__).'/files/'.$_FILES['media']['name'];
301
+
302
+ $name = file_exists(dirname(__FILE__).'/files/'.$_FILES['media']['name'])?str_replace('.'.$info['extension'],'_'.uniqid().'.'.$info['extension'],$info['basename']):$_FILES['media']['name'];
303
+ move_uploaded_file($_FILES['media']['tmp_name'], UPLOAD_DIR . $name);
304
+ $file['file'] = $name;
305
+
306
+ }
307
+
308
+ $file['show_counter'] = 0;
309
+ $file['category'] = serialize($file['category']);
310
+ $wpdb->insert("ahm_files", $file);
311
+ if(!$wpdb->insert_id){
312
+ $wpdb->show_errors();
313
+ $wpdb->print_error();
314
+ die();
315
+ }
316
+ echo "<script>
317
+ location.href='admin.php?page=file-manager';
318
+ </script>";
319
+
320
+ }
321
+
322
+
323
+ include('wpdm-add-new-file.php');
324
+ }
325
+
326
+ function wpdm_edit_file(){
327
+ global $wpdb;
328
+ if($_POST){
329
+ extract($_POST);
330
+ if(is_uploaded_file($_FILES['media']['tmp_name'])){
331
+ $info = pathinfo($_FILES['media']['name']);
332
+ //echo dirname(__FILE__).'/files/'.$_FILES['media']['name'];
333
+
334
+ $name = file_exists(UPLOAD_DIR . $_FILES['media']['name'])?str_replace('.'.$info['extension'],'_'.uniqid().'.'.$info['extension'],$info['basename']):$_FILES['media']['name'];
335
+ move_uploaded_file($_FILES['media']['tmp_name'], UPLOAD_DIR . $name);
336
+ $file['file'] = $name;
337
+ }
338
+
339
+ $file['category'] = serialize($file['category']);
340
+
341
+ $wpdb->update("ahm_files", $file, array("id"=>$_POST[id]));
342
+
343
+ echo "<script>
344
+ location.href='admin.php?page=file-manager';
345
+ </script>";
346
+
347
+ }
348
+
349
+ $file = $wpdb->get_row("select * from ahm_files where id='$_GET[id]'",ARRAY_A);
350
+
351
+ include('wpdm-add-new-file.php');
352
+ }
353
+
354
+ function wpdm_categories(){
355
+
356
+ if($_GET['task']=='DeleteCategory'){
357
+ $tpldata = maybe_unserialize(get_option('_fm_categories'));
358
+ unset($tpldata[$_GET['cid']]);
359
+ update_option('_fm_categories',@serialize($tpldata));
360
+ echo "<script>
361
+ location.href='{$_SERVER[HTTP_REFERER]}';
362
+ </script>";
363
+ die();
364
+ }
365
+ if($_POST['cat']){
366
+ $tpldata = maybe_unserialize(get_option('_fm_categories'));
367
+ if(!is_array($tpldata)) $tpldata =array();
368
+ $tcid = $_POST['cid']?$_POST['cid']:strtolower(preg_replace("/([^a-zA-Z0-9\-]+)/","-", $_POST['cat']['title']));
369
+ $cid = $tcid;
370
+ while(array_key_exists($cid, $tpldata)&&$_POST['cid']==''){
371
+ $cid = $tcid."-".(++$postfx);
372
+ }
373
+
374
+ $tpldata[$cid] = $_POST['cat'];
375
+ update_option('_fm_categories',@serialize($tpldata));
376
+ echo "<script>
377
+ location.href='{$_SERVER[HTTP_REFERER]}';
378
+ </script>";
379
+ die();
380
+ }
381
+ include("wpdm-categories.php");
382
+ }
383
+
384
+ function wpdm_cat_dropdown_tree($parent="", $level = 0){
385
+ $cats = maybe_unserialize(get_option('_fm_categories'));
386
+ foreach($cats as $id=>$cat){
387
+ $pres = str_repeat("&mdash;", $level);
388
+ if($cat['parent']==$parent){
389
+ echo "<option value='$id'>{$pres} $cat[title]</option>\n";
390
+ wpdm_cat_dropdown_tree($id,$level+1);}
391
+ }
392
+ }
393
+
394
+ function wpdm_embed_category($id){
395
+ global $wpdb, $current_user, $post, $wp_query;
396
+ $postlink = get_permalink($post->ID);
397
+ get_currentuserinfo();
398
+
399
+ $user = new WP_User(null);
400
+ $categories = maybe_unserialize(get_option("_fm_categories",true));
401
+ $category = $categories[$id];
402
+ $total = $wpdb->get_var("select count(*) from ahm_files where category like '%\"$id\"%'");
403
+
404
+ $item_per_page = 10;
405
+ $pages = ceil($total/$item_per_page);
406
+ $page = $_GET['cp']?$_GET['cp']:1;
407
+ $start = ($page-1)*$item_per_page;
408
+ $pag = new wpdmpagination();
409
+ $pag->items($total);
410
+ $pag->limit($item_per_page);
411
+ $pag->currentPage($page);
412
+ $url = strpos($_SERVER['REQUEST_URI'],'?')?$_SERVER['REQUEST_URI'].'&':$_SERVER['REQUEST_URI'].'?';
413
+ $pag->urlTemplate($url."cp=[%PAGENO%]");
414
+
415
+ $ndata = $wpdb->get_results("select * from ahm_files where category like '%\"$id\"%' limit $start, $item_per_page",ARRAY_A);
416
+
417
+
418
+ $sap = count($_GET)>0?'&':'?';
419
+ $html = '';
420
+ foreach($ndata as $data){
421
+
422
+ $link_label = $data['title']?$data['title']:'Download';
423
+ $data['page_link'] = "<a class='wpdm-popup' style=\"background:url('".get_option('siteurl')."/wp-content/plugins/download-manager/icon/download.png') no-repeat;padding:3px 12px 12px 28px;font:bold 10pt verdana;\" href='{$postlink}{$sap}download={$data[id]}'>$link_label</a>";
424
+ if($data[preview]!='')
425
+ $data['thumb'] = "<img class='wpdm_icon' align='left' src='".plugins_url()."/{$data[preview]}' />";
426
+ else
427
+ $data['thumb'] = '';
428
+ if($data[icon]!='')
429
+ $data['icon'] = "<img class='wpdm_icon' align='left' src='".plugins_url()."/{$data[icon]}' />";
430
+ else
431
+ $data['icon'] = '';
432
+
433
+
434
+ if($data['show_counter']==1){
435
+ $counter = "{$data[download_count]} downloads<br/>";
436
+ $data['counter'] = $counter;
437
+ }
438
+
439
+ //foreach( $data as $ind=>$val ) $reps["[".$ind."]"] = $val;
440
+ //$repeater = stripslashes( strtr( $category['template_repeater'], $reps ));
441
+ $template = "<li><b>$data[page_link]</b><br/>$data[counter]</li>";
442
+ if($data['access']=='member'&&!is_user_logged_in())
443
+ $template = "<li><b><a href='".get_option('siteurl')."/wp-login.php?redirect_to=".$_SERVER['REQUEST_URI']."' style=\"background:url('".get_option('siteurl')."/wp-content/plugins/download-manager/l24.png') no-repeat;padding:3px 12px 12px 28px;font:bold 10pt verdana;\">$data[title]</a></b><br/>login to download</li>";
444
+ $html .= $template;
445
+
446
+
447
+ END;
448
+
449
+
450
+
451
+
452
+
453
+
454
+
455
+ }
456
+
457
+
458
+ return "<ul class='wpdm-category $id'>".$html."</div><div style='clear:both'></ul>";
459
+ }
460
+
461
+
462
+
463
+ function wpdm_tinymce()
464
+ {
465
+ wp_enqueue_script('common');
466
+ wp_enqueue_script('jquery-color');
467
+ wp_admin_css('thickbox');
468
+ wp_print_scripts('post');
469
+ wp_print_scripts('media-upload');
470
+ wp_print_scripts('jquery');
471
+ wp_print_scripts('jquery-ui-core');
472
+ wp_print_scripts('jquery-ui-tabs');
473
+ wp_print_scripts('tiny_mce');
474
+ wp_print_scripts('editor');
475
+ wp_print_scripts('editor-functions');
476
+ add_thickbox();
477
+ //wp_tiny_mce();
478
+ //wp_admin_css();
479
+ wp_enqueue_script('utils');
480
+ do_action("admin_print_styles-post-php");
481
+ do_action('admin_print_styles');
482
+ remove_all_filters('mce_external_plugins');
483
+ }
484
+
485
+ function wpdm_set_htaccess(){
486
+ $cont = 'RewriteEngine On
487
+ <Files *>
488
+ Deny from all
489
+ </Files>
490
+ ';
491
+ @file_put_contents(UPLOAD_DIR.'.htaccess',$cont);
492
+ }
493
+
494
+
495
+ function wpdm_front_js(){
496
+ ?>
497
+ <script language="JavaScript">
498
+ <!--
499
+ jQuery(function(){
500
+ jQuery('.wpdm-popup').colorbox();
501
+ })
502
+ //-->
503
+ </script>
504
+ <?php
505
+ }
506
+
507
+ function wpdm_copyold(){
508
+ global $wpdb;
509
+ $ids = get_option('wpdmc2p_ids',true);
510
+ if($_POST['task']=='wpdm_copy_files'){
511
+ if(!is_array($ids)) $ids = array();
512
+ if(!is_array($_POST[id])) $_POST[id] = array();
513
+ foreach($_POST[id] as $fid){
514
+ //if(!in_array($fid, $ids)){
515
+ $file = $wpdb->get_row("select * from ahm_files where id='$fid'", ARRAY_A);
516
+ unset($file[id]);
517
+ //print_r($file);
518
+ //$wpdb->show_errors();
519
+ $wpdb->insert("ahm_files",$file);
520
+ //$wpdb->print_error();die() ;
521
+ //}
522
+ }
523
+ if(is_array($ids))
524
+ $ids = array_unique(array_merge($ids, $_POST['id']));
525
+ else
526
+ $ids = $_POST['id'];
527
+ /*foreach($_POST as $optn=>$optv){
528
+ update_option($optn, $optv);
529
+ } */
530
+
531
+ update_option('wpdmc2p_ids',$ids);
532
+ die('Copied successfully');
533
+ }
534
+
535
+ $res = mysql_query("select * from ahm_files");
536
+
537
+ ?>
538
+
539
+
540
+ <div class="wrap">
541
+ <div class="icon32" id="icon-upload"><br></div>
542
+
543
+ <h2>Copy from Download Manager</h2> <br>
544
+
545
+ <div class="clear"></div>
546
+ <form action="" method="post">
547
+ <input type="hidden" name="task" value="wpdm_copy_files" />
548
+
549
+ <table cellspacing="0" class="widefat fixed">
550
+ <thead>
551
+ <tr>
552
+ <th style="" class="manage-column column-cb check-column" id="cb" scope="col"><input class="call m" type="checkbox"></th>
553
+ <th style="" class="manage-column column-media" id="media" scope="col">File</th>
554
+ <th style="" class="manage-column column-parent" id="parent" scope="col">Copied</th>
555
+ </tr>
556
+ </thead>
557
+
558
+ <tfoot>
559
+ <tr>
560
+ <th style="" class="manage-column column-cb check-column" id="cb" scope="col"><input class="call m" type="checkbox"></th>
561
+ <th style="" class="manage-column column-media" id="media" scope="col">File</th>
562
+ <th style="" class="manage-column column-parent" id="parent" scope="col">Copied</th>
563
+ </tr>
564
+ </tfoot>
565
+
566
+ <tbody class="list:post" id="the-list">
567
+ <?php while($media = mysql_fetch_assoc($res)) { $media['copied'] = @in_array($media[id],$ids)?'Yes':'No'; ?>
568
+ <tr valign="top" class="alternate author-self status-inherit" id="post-8">
569
+
570
+ <th class="check-column" scope="row"><input type="checkbox" value="<?php echo $media[id];?>" class="m" name="id[]"></th>
571
+
572
+ <td class="media column-media">
573
+ <strong><a title="Edit" href="admin.php?page=file-manager&task=EditFile&id=<?php echo $media['id']?>"><?php echo $media['title']?></a></strong>
574
+ </td>
575
+ <td class="parent column-parent"><b><?php echo $media['copied']; ?></b></td>
576
+
577
+ </tr>
578
+ <?php } ?>
579
+ </tbody>
580
+ </table>
581
+ <br>
582
+
583
+ <input type="submit" value="Copy Selected Files" class="button-primary">
584
+ </form>
585
+ <script language="JavaScript">
586
+ <!--
587
+ jQuery('.call').click(function(){
588
+ if(this.checked)
589
+ jQuery('.m').attr('checked','checked');
590
+ else
591
+ jQuery('.m').removeAttr('checked');
592
+ });
593
+ //-->
594
+ </script>
595
+ </div>
596
+ <?php
597
+ }
598
+
599
+ function wpdm_hotlink($params){
600
+ global $wpdb;
601
+ extract($params);
602
+ if($id=='') return;
603
+ $data = $wpdb->get_row("select * from ahm_files where id='$id'",ARRAY_A);
604
+ if($data['id']=='') return;
605
+ $link_label = $link_label?$link_label:$data['link_label'];
606
+ $url = home_url('/?wpdmact=process&did='.base64_encode($id.'.hotlink'));
607
+ return "<a href='$url'>$link_label</a>";
608
+
609
+ }
610
+
611
+ function wpdm_menu(){
612
+ add_menu_page("File Manager","File Manager",get_option('wpdm_access_level'),'file-manager','wpdm_admin_options');
613
+ $access = get_option('wpdm_access_level')?get_option('wpdm_access_level'):'administrator';
614
+ add_submenu_page( 'file-manager', 'File Manager', 'Manage', $access, 'file-manager', 'wpdm_admin_options');
615
+ add_submenu_page( 'file-manager', 'Add New File &lsaquo; File Manager', 'Add New File', $access, 'file-manager/add-new-file', 'wpdm_add_new_file');
616
+ add_submenu_page( 'file-manager', 'Categories &lsaquo; File Manager', 'Categories', 'administrator', 'file-manager/categories', 'wpdm_categories');
617
+ add_submenu_page( 'file-manager', 'Settings &lsaquo; File Manager', 'Settings', 'administrator', 'file-manager/settings', 'wpdm_settings');
618
+
619
+ }
620
+
621
+ if(is_admin()){
622
+ add_action("admin_menu","wpdm_menu");
623
+ include("wpdm-free-mce-button.php");
624
+ wp_enqueue_style('icons',plugins_url().'/download-manager/css/icons.css');
625
+
626
+ }else{
627
+ wp_enqueue_script('jquery');
628
+ wp_enqueue_script('11',plugins_url().'/download-manager/js/jquery.colorbox-min.js');
629
+ wp_enqueue_style('22',plugins_url().'/download-manager/css/colorbox.css');
630
+ add_action('wp_head','wpdm_front_js');
631
+ }
632
+
633
+ if($_GET['page']=='file-manager/add-new-file')
634
+ add_filter('admin_head','wpdm_tinymce');
635
+
636
+ add_action("wp","wpdm_download_info");
637
+
638
+ add_filter( 'the_content', 'wpdm_downloadable');
639
+
640
+ add_shortcode('wpdm_hotlink','wpdm_hotlink');
641
+
642
+ add_action('init','wpdm_process');
643
+
644
+ include("wpdm-widgets.php");
645
+
646
+ register_activation_hook(__FILE__,'wpdm_free_install');
download.php ADDED
@@ -0,0 +1,92 @@
1
+ <?php
2
+ global $wpdb;
3
+ $dl = (int)$_REQUEST['download'];
4
+ if($dl>0){
5
+ $data = $wpdb->get_row("select * from ahm_files where id='$dl'",ARRAY_A);
6
+ if($data['access']=='member'&&!is_user_logged_in()){
7
+ $wpdm_login_msg = get_option('wpdm_login_msg')?get_option('wpdm_login_msg'):'Login Required';
8
+ die("<div style='padding:20px 30px;background:#fff'><a href='".get_option('siteurl')."/wp-login.php' style=\"background:url('".get_option('siteurl')."/wp-content/plugins/download-manager/l24.png') no-repeat;padding:3px 12px 12px 28px;font:bold 10pt verdana;\">".$wpdm_login_msg."</a></div>") ;
9
+ }
10
+ if($_POST['password']==$data['password']&&isset($_POST['password'])){
11
+ $did = uniqid();
12
+ file_put_contents(dirname(__FILE__).'/cache/'.$did,serialize($data));
13
+ die($did);
14
+ }else if($_POST['password']!=$data['password']&&isset($_POST['password'])){
15
+ die('error');
16
+ }
17
+ ?>
18
+ <style>
19
+
20
+ input,form,p{
21
+ font-size:9pt;
22
+ }
23
+ form{text-align:center;}
24
+ </style>
25
+ <?php
26
+
27
+ if($data){
28
+
29
+ echo "<div style='min-weight:300px;min-height:200px;padding:30px;background:#fff;color:#000'><h1><nobr>$data[title]</nobr></h1><br/><p style='height:100px;overflow:auto;'>$data[description]</p>";
30
+ /*
31
+ if($_POST&&$data[password]==''){
32
+ echo "<script>
33
+ window.opener.location.href='$_SERVER[HTTP_REFERER]'; self.close();</script>"; die(); }
34
+ */
35
+ ?>
36
+ <form method="post">
37
+ <?php
38
+
39
+ if($_POST['password']==$data['password']&&count($_POST)>0){
40
+
41
+
42
+
43
+
44
+ mysql_query("update ahm_files set `download_count`=`download_count`+1 where id='{$data[id]}'");
45
+ echo "Please Wait... Download starting in a while...
46
+ </form>
47
+
48
+ <script>
49
+ window.opener.location.href='".get_option('siteurl')."/?wpdmact=process&did={$did}';
50
+ self.close();
51
+ </script>
52
+ ";
53
+
54
+ die();
55
+ } else {
56
+ if($data['password']!=''){
57
+ if($_POST['password']!=$data['password']&&count($_POST)>0) echo "<span style='color:red'>Wrong password!</span><br>";
58
+ ?>
59
+ Enter Password: <input type="password" id="pass" size="10" name="password" />
60
+ <?php }else{?>
61
+ <input type="hidden" id="pass" name="password" value="" />
62
+ <?php }}
63
+
64
+ ?>
65
+ <input type="button" onclick="validate_pass()" value="Download"/>
66
+ <div id="err" style="color: red;"></div>
67
+ </form>
68
+ <script language="JavaScript">
69
+ <!--
70
+ function validate_pass(){
71
+ jQuery.post("<?php echo home_url('/'); ?>",{'download':'<?php echo $dl; ?>','password':jQuery('#pass').val()},function(res){
72
+ if(res=='error') jQuery('#err').html('Password not matched');
73
+ else
74
+ location.href='<?php echo get_option('siteurl'); ?>/?wpdmact=process&did='+res;
75
+
76
+ });
77
+ }
78
+ //-->
79
+ </script>
80
+ </div>
81
+ <?php
82
+ die();
83
+ }
84
+
85
+ else{
86
+ echo "Error!";
87
+ }
88
+
89
+
90
+ die();
91
+ }
92
+ ?>
download.png ADDED
Binary file
editor_plugin.js ADDED
@@ -0,0 +1,40 @@
1
+
2
+ (function() {
3
+
4
+ tinymce.create('tinymce.plugins.wpdm_tinyplugin', {
5
+
6
+ init : function(ed, url){
7
+ ed.addCommand('wpdm_mcedonwloadmanager', function() {
8
+ ed.windowManager.open({
9
+ title: 'Download Controller',
10
+ file : 'admin.php?wpdm_action=wpdm_tinymce_button',
11
+ height: 300,
12
+ width:400,
13
+ inline : 1
14
+ }, {
15
+ plugin_url : url, // Plugin absolute URL
16
+ some_custom_arg : 'custom arg' // Custom argument
17
+ });
18
+ });
19
+
20
+ ed.addButton('wpdm_tinyplugin', {
21
+ title : 'Download Manager: Insert Package or Category',
22
+ cmd : 'wpdm_mcedonwloadmanager',
23
+ image: url + "/img/donwloadmanager.png"
24
+ });
25
+ },
26
+
27
+ getInfo : function() {
28
+ return {
29
+ longname : 'WPDC - TinyMCE Button Add-on',
30
+ author : 'Shaon',
31
+ authorurl : 'http://www.wpdownloadmanager.com',
32
+ infourl : 'http://www.wpdownloadmanager.com',
33
+ version : "1.0"
34
+ };
35
+ }
36
+ });
37
+
38
+ tinymce.PluginManager.add('wpdm_tinyplugin', tinymce.plugins.wpdm_tinyplugin);
39
+
40
+ })();
file-type-icons/avi.png ADDED
Binary file
file-type-icons/doc.png ADDED
Binary file
file-type-icons/docx.png ADDED
Binary file
file-type-icons/file.png ADDED
Binary file
file-type-icons/img.png ADDED
Binary file
file-type-icons/mov.png ADDED
Binary file
file-type-icons/mp3.png ADDED
Binary file
file-type-icons/mp4.png ADDED
Binary file
file-type-icons/pps.png ADDED
Binary file
file-type-icons/ppt.png ADDED
Binary file
file-type-icons/psd.png ADDED
Binary file
file-type-icons/rar.png ADDED
Binary file
file-type-icons/wav.png ADDED
Binary file
file-type-icons/wma.png ADDED
Binary file
file-type-icons/zip.png ADDED
Binary file
files/.htaccess ADDED
@@ -0,0 +1,5 @@
1
+ RewriteEngine On
2
+
3
+ <Files *>
4
+ Deny from all
5
+ </Files>
fm-settings.php ADDED
@@ -0,0 +1,70 @@
1
+ <style>
2
+ .wrap *{
3
+ font-family: Tahoma;
4
+ letter-spacing: 1px;
5
+ }
6
+
7
+ input[type=text],textarea{
8
+ width:500px;
9
+ padding:5px;
10
+ }
11
+
12
+ input{
13
+ padding: 7px;
14
+ }
15
+ </style>
16
+
17
+ <div class="wrap">
18
+ <div class="icon32" id="icon-options-general"><br></div>
19
+ <h2>Settings</h2>
20
+
21
+ <form action="" method="post" enctype="multipart/form-data">
22
+
23
+ <table cellpadding="5" cellspacing="5">
24
+
25
+ <tr>
26
+ <td>Minimum User Access Level:</td>
27
+ <td><select name="access">
28
+ <option value="level_10">Administrator</option>
29
+ <option value="level_5" <?php echo $access=='level_5'?'selected':''?>>Editor</option>
30
+ <option value="level_2" <?php echo $access=='level_2'?'selected':''?>>Author</option>
31
+ </select>
32
+ </td>
33
+ </tr>
34
+
35
+ <tr>
36
+ <td>Login Required Message:</td>
37
+ <td>
38
+ <input type="text" name="wpdm_login_msg" value="<?php echo get_option('wpdm_login_msg',true); ?>" size="40">
39
+ </td>
40
+ </tr>
41
+
42
+
43
+ <tr>
44
+ <td>Download Link Icon:</td>
45
+ <td>
46
+ <input type="file" name="icon">
47
+ | Current Icon: <img src="<?php echo plugins_url(); ?>/download-manager/icon/download.png" />
48
+ </td>
49
+ </tr>
50
+
51
+
52
+
53
+ <tr>
54
+ <td valign="top"></td>
55
+ <td align="right">
56
+
57
+ <input type="button" value="&#171; back" tabindex="9" class="button-secondary" onclick="location.href='admin.php?page=file-manager'" class="add:the-list:newmeta" name="addmeta" id="addmetasub">
58
+
59
+ <input type="reset" value="reset" tabindex="9" class="button-secondary" class="add:the-list:newmeta" name="addmeta" id="addmetasub">
60
+
61
+ <input type="submit" value="save" accesskey="p" tabindex="5" id="publish" class="button-primary" name="publish">
62
+ </td>
63
+ </tr>
64
+
65
+ </table>
66
+
67
+
68
+ </form>
69
+
70
+ </div>
functions.php ADDED
@@ -0,0 +1,120 @@
1
+ <?php
2
+ /**
3
+ * add new package meta
4
+ *
5
+ * @param mixed $pid
6
+ * @param mixed $name
7
+ * @param mixed $value
8
+ */
9
+ function add_wpdm_meta($pid, $name, $value, $uniq = false){
10
+ global $wpdb;
11
+ $value = is_array($value)?serialize($value):$value;
12
+ $uniq = $uniq?1:0;
13
+ $duplicate = $wpdb->get_var("select pid from {$wpdb->prefix}wpdm_filemeta where pid='$pid' and `name`='$name' and uniq=1");
14
+ if($duplicate&&$uniq) return false;
15
+ $wpdb->insert("{$wpdb->prefix}wpdm_filemeta",array('pid'=>$pid, 'name'=>$name, 'value'=>$value, 'uniq'=>$uniq));
16
+ return true;
17
+ }
18
+
19
+ /**
20
+ * update package meta
21
+ *
22
+ * @param mixed $pid
23
+ * @param mixed $name
24
+ * @param mixed $value
25
+ * @param mixed $uniq
26
+ */
27
+ function update_wpdm_meta($pid, $name, $value, $uniq = false){
28
+ global $wpdb;
29
+ $wpdb->show_errors();
30
+ $uniq = $uniq?1:0;
31
+ delete_wpdm_meta($pid, $name);
32
+ $value = is_array($value)?serialize($value):$value;
33
+ add_wpdm_meta($pid, $name, $value, $uniq);
34
+ }
35
+
36
+
37
+ /**
38
+ * delete package meta
39
+ *
40
+ * @param mixed $pid
41
+ * @param mixed $name
42
+ */
43
+ function delete_wpdm_meta($pid, $name){
44
+ global $wpdb;
45
+ $wpdb->query("delete from {$wpdb->prefix}wpdm_filemeta where pid='$pid' and `name`='$name'");
46
+ }
47
+
48
+ /**
49
+ * get package meta
50
+ *
51
+ * @param mixed $pid
52
+ * @param mixed $name
53
+ * @param mixed $single
54
+ */
55
+ function get_wpdm_meta($pid, $name, $single = true){
56
+ global $wpdb;
57
+ $data = $wpdb->get_results("select * from {$wpdb->prefix}wpdm_filemeta where pid='$pid' and `name`='$name'");
58
+ if($single==true)
59
+ return is_array(@unserialize($data[0]->value))?unserialize($data[0]->value):$data[0]->value;
60
+ foreach($data as $d){
61
+ $d->value = is_array(@unserialize($d->value))?unserialize($d->value):$d->value;
62
+ $metas[$d->name] = $d->value;
63
+ }
64
+ return $metas;
65
+ }
66
+
67
+ /**
68
+ * check if multi-user ebabled
69
+ *
70
+ * @param mixed $cond
71
+ */
72
+
73
+ function wpdm_multi_user($cond=''){
74
+ global $wpdb, $current_user;
75
+ get_currentuserinfo();
76
+ $ismu = get_option('wpdm_multi_user')==1&&!$current_user->caps['administrator']?true:false;
77
+ return $ismu&&$cond?$cond:$ismu;
78
+ }
79
+
80
+ /**
81
+ * popup
82
+ *
83
+ */
84
+ function wpdm_popup(){
85
+ ?>
86
+ <script language="JavaScript">
87
+ <!--
88
+ jQuery(function(){
89
+ jQuery('.popup-link').click(function(){
90
+ jQuery.prompt("<iframe noborder=true width=380px height=400px src='"+this.href+"'></iframe>",{ buttons: { Close: false } });
91
+ return false;
92
+ });
93
+
94
+ });
95
+ //-->
96
+ </script>
97
+ <style>
98
+ /*-------------impromptu---------- */
99
+ .jqifade{ position: absolute; background-color: #aaaaaa; }
100
+ div.jqi{ width: 400px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; position: absolute; background-color: #ffffff; font-size: 11px; text-align: left; border: solid 1px #eeeeee; -moz-border-radius: 10px; -webkit-border-radius: 10px; padding: 7px; }
101
+ div.jqi .jqicontainer{ font-weight: bold; }
102
+ div.jqi .jqiclose{ position: absolute; top: 4px; right: -2px; width: 18px; cursor: default; color: #bbbbbb; font-weight: bold; }
103
+ div.jqi .jqimessage{ padding: 10px; line-height: 20px; color: #444444; }
104
+ div.jqi .jqibuttons{ text-align: right; padding: 5px 0 5px 0; border: solid 1px #eeeeee; background-color: #f4f4f4; }
105
+ div.jqi button{ padding: 3px 10px; margin: 0 10px; background-color: #2F6073; border: solid 1px #f4f4f4; color: #ffffff; font-weight: bold; font-size: 12px; }
106
+ div.jqi button:hover{ background-color: #728A8C; }
107
+ div.jqi button.jqidefaultbutton{ background-color: #BF5E26; }
108
+ .jqiwarning .jqi .jqibuttons{ background-color: #BF5E26; }
109
+ /*-------------------------------- */
110
+ </style>
111
+
112
+ <?php
113
+ }
114
+
115
+ function __msg($key){
116
+ include("messages.php");
117
+ return $msgs[$key]?$msgs[$key]:$key;
118
+ }
119
+
120
+ ?>
icon/download.png ADDED
Binary file
images/Thumbs.db ADDED
Binary file
images/add-file.png ADDED
Binary file
images/add.png ADDED
Binary file
images/application.png ADDED
Binary file
images/bg_header.jpg ADDED
Binary file
images/browse.png ADDED
Binary file
images/bullet1.gif ADDED
Binary file
images/bullet2.gif ADDED
Binary file
images/category.png ADDED
Binary file
images/code.png ADDED
Binary file
images/css.png ADDED
Binary file
images/db.png ADDED
Binary file
images/directory.png ADDED
Binary file
images/doc.png