MP3-jPlayer - Version 2.5

Version Description

  • New feature: Auto Resume, gives near-continuous audio between pages (there will be a short pause as the next page loads). Resuming will work wherever you have used the same piece of audio across pages.
  • Updated the Settings page layout with clearer interfaces, better descriptions, and easier access to information.
  • Added pagination controls to the Media Library files list on the settings page.
  • Updated plugin security.
Download this release

Release Info

Developer simon.ward
Plugin Icon 128x128 MP3-jPlayer
Version 2.5
Comparing to
See all releases

Code changes from version 2.4.2 to 2.5

admin-colours.php CHANGED
@@ -40,7 +40,7 @@ function mp3j_print_colours_page()
40
  MJPdesign_submit();
41
  ?>
42
  <!-- save message -->
43
- <div class="updated"><p><strong><?php _e("Settings Updated.", $MP3JP->textdomain );?></strong></p></div>
44
  <?php
45
  }
46
 
@@ -103,6 +103,7 @@ function mp3j_print_colours_page()
103
  <h2>&nbsp;</h2>
104
  <h1>Player Design</h1>
105
  <p>&nbsp;</p>
 
106
  <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">
107
 
108
 
@@ -272,7 +273,7 @@ function mp3j_print_colours_page()
272
  <div id="plusT1" class="plus" onclick="MP3jP.clickPlus('T1','color');"></div>
273
  </div>
274
  </td>
275
- <td><input type="checkbox" name="titleHide" id="titleHide" value="true"<?php echo ( $C['titleHide'] === 'true' ? ' checked="checked"' : ''); ?>/><label for="titleHide" style="font-weight:500;">&nbsp;Hide</label></td>
276
  <td></td>
277
  <td></td>
278
 
@@ -291,7 +292,7 @@ function mp3j_print_colours_page()
291
  <td></td>
292
  </tr>
293
  <tr>
294
- <td>&nbsp;&nbsp;&nbsp;<span class="description">Hover:</span></td>
295
  <td>
296
  <div class="patch">
297
  <div id="patchT3" onclick="MP3jP.clickPatch('T3','');" class="PatchCol" style="background-color:<?php echo $C['list_hover_colour']; ?>;" title="Retrieve"></div>
@@ -306,11 +307,11 @@ function mp3j_print_colours_page()
306
  <div id="plusBG5" class="plus" onclick="MP3jP.clickPlus('BG5','background-color','T3');"></div>
307
  </div>
308
  </td>
309
- <td><span class="description">Background</span></td>
310
  <td></td>
311
  </tr>
312
  <tr>
313
- <td>&nbsp;&nbsp;&nbsp;<span class="description">Current:</span></td>
314
  <td>
315
  <div class="patch">
316
  <div id="patchT4" onclick="MP3jP.clickPatch('T4','');" class="PatchCol" style="background-color:<?php echo $C['list_current_colour']; ?>;" title="Retrieve"></div>
@@ -325,7 +326,7 @@ function mp3j_print_colours_page()
325
  <div id="plusBG6" class="plus" onclick="MP3jP.clickPlus('BG6','background','T4');"></div>
326
  </div>
327
  </td>
328
- <td><span class="description">Background</span></td>
329
  <td></td>
330
  </tr>
331
  <?php
@@ -416,7 +417,7 @@ function mp3j_print_colours_page()
416
  <div id="plusBG3" class="plus" onclick="MP3jP.clickPlus('BG3','background-color');"></div>
417
  </div>
418
  </td>
419
- <td><span class="description">Indicator</span></td>
420
  <td><select name="indicator" style="width:90px; font-size:11px;">
421
  <option value="tint" <?php if ( 'tint' == $C['indicator'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Greyscale</option>
422
  <option value="colour" <?php if ( 'colour' == $C['indicator'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Colour</option>
@@ -431,7 +432,7 @@ function mp3j_print_colours_page()
431
  <div id="plusBG4" class="plus" onclick="MP3jP.clickPlus('BG4','background-color');"></div>
432
  </div>
433
  </td>
434
- <td><span class="description">Gradient</span></td>
435
  <td><select name="posbar_tint" id="posbar_tint" style="width:90px; font-size:11px;">
436
  <option value="none" <?php if ( 'none' == $C['posbar_tint'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>None</option>
437
  <option value="soften" <?php if ( 'soften' == $C['posbar_tint'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Light grad</option>
@@ -448,7 +449,7 @@ function mp3j_print_colours_page()
448
  <div id="plusBG2" class="plus" onclick="MP3jP.clickPlus('BG2','background-color');"></div>
449
  </div>
450
  </td>
451
- <td><span class="description">Gradient</span></td>
452
  <td><select id="playlist_tint" name="playlist_tint" style="width:90px; font-size:11px;">
453
  <option value="none" <?php if ( 'none' == $C['playlist_tint'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>None</option>
454
  <option value="lighten1" <?php if ( 'lighten1' == $C['playlist_tint'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Light Short</option>
@@ -460,7 +461,7 @@ function mp3j_print_colours_page()
460
  <tr>
461
  <td></td>
462
  <td></td>
463
- <td><span class="description">Dividers</span></td>
464
  <td><select id="list_divider" name="list_divider" style="width:100%; font-size:11px;">
465
  <option value="none" <?php if ( 'none' == $C['list_divider'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>None</option>
466
  <option value="light" <?php if ( 'light' == $C['list_divider'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Light</option>
@@ -523,7 +524,7 @@ function mp3j_print_colours_page()
523
  </tr>
524
  <tr>
525
  <td></td>
526
- <td style="text-align:right;"><span class="description">Track:&nbsp;&nbsp;</span>
527
  <label for="titleBold" id="titleBold_label" class="unselectable format-button-B<?php if ( 'true' == $C['titleBold'] ) { echo ' formatOn'; } ?>">B</label>
528
  <label for="titleItalic" id="titleItalic_label" class="unselectable format-button-i<?php if ( 'true' == $C['titleItalic'] ) { echo ' formatOn'; } ?>">i</label>
529
  </td>
@@ -532,7 +533,7 @@ function mp3j_print_colours_page()
532
  </tr>
533
  <tr>
534
  <td></td>
535
- <td style="text-align:right;"><span class="description">Caption:&nbsp;&nbsp;</span>
536
  <label for="captionBold" id="captionBold_label" class="unselectable format-button-B<?php if ( 'true' == $C['captionBold'] ) { echo ' formatOn'; } ?>">B</label>
537
  <label for="captionItalic" id="captionItalic_label" class="unselectable format-button-i<?php if ( 'true' == $C['captionItalic'] ) { echo ' formatOn'; } ?>">i</label>
538
  </td>
@@ -644,7 +645,7 @@ function mp3j_print_colours_page()
644
  <td></td>
645
  </tr>
646
  <tr>
647
- <td style="text-align:right;"><span class="description" style="font-size:11px;">Top</span></td>
648
  <td colspan="2">
649
  <div class="sliderWrap" style="padding-left:5px;" onmouseover="jQuery('#trackTitles').addClass('highlight');" onmouseout="jQuery('#trackTitles').removeClass('highlight');">
650
  <div id="offsetSlider_6" class="fontSizeSlider" style="width:250px;"></div>
@@ -656,7 +657,7 @@ function mp3j_print_colours_page()
656
  <td></td>
657
  </tr>
658
  <tr>
659
- <td style="text-align:right;"><span class="description" style="font-size:11px;">Margins</span></td>
660
  <td colspan="2">
661
  <div class="sliderWrap" style="padding-left:5px;" onmouseover="jQuery('#trackTitles').addClass('highlight');" onmouseout="jQuery('#trackTitles').removeClass('highlight');">
662
  <div id="offsetSlider_1" class="fontSizeSlider" style="width:250px;"></div>
@@ -688,6 +689,13 @@ function mp3j_print_colours_page()
688
  <td><code>flip</code></td>
689
  <td>Puts play buttons on the left</td>
690
  </tr>
 
 
 
 
 
 
 
691
  <tr>
692
  <td><code>nostop</code></td>
693
  <td>Hides the stop button</td>
40
  MJPdesign_submit();
41
  ?>
42
  <!-- save message -->
43
+ <div class="updated"><p><strong><?php _e("Settings saved.", $MP3JP->textdomain );?></strong></p></div>
44
  <?php
45
  }
46
 
103
  <h2>&nbsp;</h2>
104
  <h1>Player Design</h1>
105
  <p>&nbsp;</p>
106
+
107
  <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">
108
 
109
 
273
  <div id="plusT1" class="plus" onclick="MP3jP.clickPlus('T1','color');"></div>
274
  </div>
275
  </td>
276
+ <td><input type="checkbox" name="titleHide" id="titleHide" value="true"<?php echo ( $C['titleHide'] === 'true' ? ' checked="checked"' : ''); ?>/><label for="titleHide" style="font-weight:500;">&nbsp;<strong>Hide</strong></label></td>
277
  <td></td>
278
  <td></td>
279
 
292
  <td></td>
293
  </tr>
294
  <tr>
295
+ <td>&nbsp;&nbsp;&nbsp;<span class="">Hover:</span></td>
296
  <td>
297
  <div class="patch">
298
  <div id="patchT3" onclick="MP3jP.clickPatch('T3','');" class="PatchCol" style="background-color:<?php echo $C['list_hover_colour']; ?>;" title="Retrieve"></div>
307
  <div id="plusBG5" class="plus" onclick="MP3jP.clickPlus('BG5','background-color','T3');"></div>
308
  </div>
309
  </td>
310
+ <td><span class="" style="font-size:12px;">Background</span></td>
311
  <td></td>
312
  </tr>
313
  <tr>
314
+ <td>&nbsp;&nbsp;&nbsp;<span class="">Current:</span></td>
315
  <td>
316
  <div class="patch">
317
  <div id="patchT4" onclick="MP3jP.clickPatch('T4','');" class="PatchCol" style="background-color:<?php echo $C['list_current_colour']; ?>;" title="Retrieve"></div>
326
  <div id="plusBG6" class="plus" onclick="MP3jP.clickPlus('BG6','background','T4');"></div>
327
  </div>
328
  </td>
329
+ <td><span class="" style="font-size:12px;">Background</span></td>
330
  <td></td>
331
  </tr>
332
  <?php
417
  <div id="plusBG3" class="plus" onclick="MP3jP.clickPlus('BG3','background-color');"></div>
418
  </div>
419
  </td>
420
+ <td><span class="" style="font-size:12px;">Indicator</span></td>
421
  <td><select name="indicator" style="width:90px; font-size:11px;">
422
  <option value="tint" <?php if ( 'tint' == $C['indicator'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Greyscale</option>
423
  <option value="colour" <?php if ( 'colour' == $C['indicator'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Colour</option>
432
  <div id="plusBG4" class="plus" onclick="MP3jP.clickPlus('BG4','background-color');"></div>
433
  </div>
434
  </td>
435
+ <td><span class="" style="font-size:12px;">Gradient</span></td>
436
  <td><select name="posbar_tint" id="posbar_tint" style="width:90px; font-size:11px;">
437
  <option value="none" <?php if ( 'none' == $C['posbar_tint'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>None</option>
438
  <option value="soften" <?php if ( 'soften' == $C['posbar_tint'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Light grad</option>
449
  <div id="plusBG2" class="plus" onclick="MP3jP.clickPlus('BG2','background-color');"></div>
450
  </div>
451
  </td>
452
+ <td><span class="" style="font-size:12px;">Gradient</span></td>
453
  <td><select id="playlist_tint" name="playlist_tint" style="width:90px; font-size:11px;">
454
  <option value="none" <?php if ( 'none' == $C['playlist_tint'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>None</option>
455
  <option value="lighten1" <?php if ( 'lighten1' == $C['playlist_tint'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Light Short</option>
461
  <tr>
462
  <td></td>
463
  <td></td>
464
+ <td><span class="" style="font-size:12px;">Dividers</span></td>
465
  <td><select id="list_divider" name="list_divider" style="width:100%; font-size:11px;">
466
  <option value="none" <?php if ( 'none' == $C['list_divider'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>None</option>
467
  <option value="light" <?php if ( 'light' == $C['list_divider'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Light</option>
524
  </tr>
525
  <tr>
526
  <td></td>
527
+ <td style="text-align:right;"><span class="" style="font-size:13px;">Track:&nbsp;&nbsp;</span>
528
  <label for="titleBold" id="titleBold_label" class="unselectable format-button-B<?php if ( 'true' == $C['titleBold'] ) { echo ' formatOn'; } ?>">B</label>
529
  <label for="titleItalic" id="titleItalic_label" class="unselectable format-button-i<?php if ( 'true' == $C['titleItalic'] ) { echo ' formatOn'; } ?>">i</label>
530
  </td>
533
  </tr>
534
  <tr>
535
  <td></td>
536
+ <td style="text-align:right;"><span class="" style="font-size:13px;">Caption:&nbsp;&nbsp;</span>
537
  <label for="captionBold" id="captionBold_label" class="unselectable format-button-B<?php if ( 'true' == $C['captionBold'] ) { echo ' formatOn'; } ?>">B</label>
538
  <label for="captionItalic" id="captionItalic_label" class="unselectable format-button-i<?php if ( 'true' == $C['captionItalic'] ) { echo ' formatOn'; } ?>">i</label>
539
  </td>
645
  <td></td>
646
  </tr>
647
  <tr>
648
+ <td style="text-align:right;"><span class="" style="font-size:11px;">Top</span></td>
649
  <td colspan="2">
650
  <div class="sliderWrap" style="padding-left:5px;" onmouseover="jQuery('#trackTitles').addClass('highlight');" onmouseout="jQuery('#trackTitles').removeClass('highlight');">
651
  <div id="offsetSlider_6" class="fontSizeSlider" style="width:250px;"></div>
657
  <td></td>
658
  </tr>
659
  <tr>
660
+ <td style="text-align:right;"><span class="" style="font-size:11px;">Margins</span></td>
661
  <td colspan="2">
662
  <div class="sliderWrap" style="padding-left:5px;" onmouseover="jQuery('#trackTitles').addClass('highlight');" onmouseout="jQuery('#trackTitles').removeClass('highlight');">
663
  <div id="offsetSlider_1" class="fontSizeSlider" style="width:250px;"></div>
689
  <td><code>flip</code></td>
690
  <td>Puts play buttons on the left</td>
691
  </tr>
692
+ <tr>
693
+ <td><code>noplayer</code></td>
694
+ <td>Hides the entire player (eg. background audio)</td>
695
+ </tr>
696
+
697
+
698
+
699
  <tr>
700
  <td><code>nostop</code></td>
701
  <td>Hides the stop button</td>
admin-settings.php CHANGED
@@ -125,7 +125,7 @@ function mp3j_print_admin_page()
125
  $O['flipMP3t'] = ( isset($_POST['flipMP3t']) ) ? "true" : "false";
126
 
127
  $O['hasListMeta'] = ( isset($_POST['hasListMeta']) ) ? "true" : "false";
128
-
129
 
130
 
131
  //$O['libUseID3'] = ( isset($_POST['libUseID3']) ) ? "true" : "false";
@@ -179,7 +179,7 @@ function mp3j_print_admin_page()
179
  ?>
180
 
181
  <!-- Settings saved message -->
182
- <div class="updated"><p><strong><?php _e("Settings Updated.", $MP3JP->textdomain );?></strong></p></div>
183
  <?php
184
  }
185
 
@@ -188,27 +188,18 @@ function mp3j_print_admin_page()
188
  ?>
189
  <div class="wrap">
190
 
191
-
192
  <h2>&nbsp;</h2>
193
- <h1>MP3-jPlayer
194
- <span class="description" style="font-size:10px;">Version <?php echo $MP3JP->version_of_plugin; ?></span>
195
- &nbsp;<span class="description" style="font-size:13px; font-weight:700;"><a class="button-secondary" style="background-color:#f0fff0;" target="_blank" href="http://mp3-jplayer.com/help-docs/">Help & Docs &raquo;</a></span>
196
- </h1>
197
- <p style="margin-bottom:10px;">&nbsp;</p>
198
- <?php
199
- if ( $O['disable_jquery_libs'] == "yes" ) {
200
- echo '&nbsp;<span style="font-size: 11px; font-weight:700; color:#f66;">(jQuery and UI scripts are turned off)</span>';
201
- }
202
- ?>
203
  <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">
204
 
205
 
206
- <div class="mp3j-tabbuttons-wrap">
207
- <div class="mp3j-tabbutton" id="mp3j_tabbutton_1">Files</div>
 
208
  <div class="mp3j-tabbutton" id="mp3j_tabbutton_0">Players</div>
209
  <div class="mp3j-tabbutton" id="mp3j_tabbutton_3">Downloads</div>
210
  <div class="mp3j-tabbutton" id="mp3j_tabbutton_4">Popout</div>
211
- <div class="mp3j-tabbutton" id="mp3j_tabbutton_2">Advanced</div>
212
  <br class="clearB" />
213
  </div>
214
 
@@ -216,36 +207,29 @@ function mp3j_print_admin_page()
216
 
217
  <!-- TAB 0.......................... -->
218
  <div class="mp3j-tab" id="mp3j_tab_0">
219
- <p class="tabD" style="margin:0 0 10px 0; max-width:550px;">These are the player default settings, most of them can be set per-player using <strong><a target="_blank" href="http://mp3-jplayer.com/shortcode-reference/">shortcode parameters</a></strong>.</p>
220
 
221
- <p style="margin-bottom:10px;"><label>Initial volume: &nbsp; </label><input type="text" style="text-align:center;" size="2" name="mp3foxVol" value="<?php echo $O['initial_vol']; ?>" /> &nbsp; <span class="description">(0 - 100)</span></p>
222
- <p><input type="checkbox" name="mp3foxAutoplay" id="mp3foxAutoplay" value="true" <?php if ($O['auto_play'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); } ?> /><label for="mp3foxAutoplay"> &nbsp; Autoplay</label> &nbsp; <span class="description">(Disallowed by most touchscreen devices, this will only activate on desktops and laptops)</span></p>
223
- <p><input type="checkbox" name="mp3foxPlaylistRepeat" id="mp3foxPlaylistRepeat" value="true" <?php if ($O['playlist_repeat'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); } ?> /><label for="mp3foxPlaylistRepeat"> &nbsp; Loop</label></p>
224
- <p><input type="checkbox" name="mp3foxAddTrackNumbers" id="mp3foxAddTrackNumbers" value="true" <?php if ($O['add_track_numbering'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); } ?> />
225
- <label for="mp3foxAddTrackNumbers"> &nbsp; Number the tracks</label></p>
226
 
227
  <?php
228
  MJPsettings_players();
229
  ?>
230
 
231
- <br><br>
232
- <div style="float:left; width:260px; margin-right:10px;">
233
- <div style="background:#e9e9e9; border-bottom:1px solid #fff; padding:8px 0 8px 10px; margin:0 0 5px 0; font-size:14px; font-weight:600;">Single-File Text Players</div>
234
- <table class="player-settings" style="margin:0 0 0px 10px; width:250px">
235
  <tr>
236
- <td><strong>Font Size</strong>:</td>
237
  <td><input type="text" value="<?php echo $O['font_size_mp3t']; ?>" name="font_size_mp3t" style="width:70px;" /></td>
238
  </tr>
239
  <tr>
240
- <td style="height:32px;"><label for="volslider_onsingles"><strong>Volume Control</strong>: &nbsp;</label></td>
241
  <td><input type="checkbox" name="volslider_onsingles" id="volslider_onsingles" value="true" <?php if ($O['volslider_on_singles'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> /></td>
242
  </tr>
243
  <tr>
244
- <td><label for="flipMP3t"><strong>Play on RHS</strong>: &nbsp;</label></td>
245
  <td><input type="checkbox" name="flipMP3t" id="flipMP3t" value="true" <?php if ($O['flipMP3t'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> /></td>
246
  </tr>
247
  <tr>
248
- <td><strong>Colour Scheme</strong>:</td>
249
  <td><input type="checkbox" name="mp3tColour_on" id="mp3tColour_on" value="true" <?php if ($O['mp3tColour_on'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> />
250
  On &nbsp;<input type="text" value="<?php echo $O['mp3tColour']; ?>" name="mp3tColour" id="mp3tColour" /></td>
251
  </tr>
@@ -255,23 +239,23 @@ function mp3j_print_admin_page()
255
  </table>
256
  </div>
257
 
258
- <div style="float:left; width:260px;">
259
- <div style="background:#e9e9e9; border-bottom:1px solid #fff; padding:8px 0 8px 10px; margin:0 0 5px 0; font-size:14px; font-weight:600;">Single-File Button Players</div>
260
- <table class="player-settings" style="margin:0 0 0px 10px; width:250px">
261
  <tr>
262
- <td><strong>Font Size</strong>:</td>
263
  <td><input type="text" value="<?php echo $O['font_size_mp3j']; ?>" name="font_size_mp3j" style="width:70px;" /></td>
264
  </tr>
265
  <tr>
266
- <td style="height:32px;"><label for="volslider_onmp3j"><strong>Volume Control</strong>: &nbsp;</label></td>
267
  <td><input type="checkbox" name="volslider_onmp3j" id="volslider_onmp3j" value="true" <?php if ($O['volslider_on_mp3j'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> /></td>
268
  </tr>
269
  <tr>
270
- <td><label for="flipMP3j"><strong>Play on RHS</strong>: &nbsp;</label></td>
271
  <td><input type="checkbox" name="flipMP3j" id="flipMP3j" value="false" <?php if ($O['flipMP3j'] == "false") { _e('checked="checked"', $MP3JP->textdomain ); }?> /></td>
272
  </tr>
273
  <tr>
274
- <td><strong>Colour Scheme</strong>:</td>
275
  <td><input type="checkbox" name="mp3jColour_on" id="mp3jColour_on" value="true" <?php if ($O['mp3jColour_on'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> />
276
  On &nbsp;<input type="text" value="<?php echo $O['mp3jColour']; ?>" name="mp3jColour" id="mp3jColour" />
277
  </td>
@@ -291,15 +275,15 @@ function mp3j_print_admin_page()
291
  <br class="clearB">
292
 
293
  <br>
294
- <div style="background:#e9e9e9; border-bottom:1px solid #fff; padding:8px 0 8px 10px; margin:0 0 5px 0; width:520px; font-size:14px; font-weight:600;">Playlist Players</div>
295
- <table class="player-settings" style="margin:0 0 0px 10px;">
296
  <tr>
297
- <td><strong>Width:</strong></td>
298
  <td><input type="text" style="width:100px;" name="mp3foxPlayerWidth" value="<?php echo $O['player_width']; ?>" /></td>
299
- <td><span class="description">pixels (px) or percent (%)</span></td>
300
  </tr>
301
  <tr>
302
- <td><strong>Alignment:</strong></td>
303
  <td><select name="mp3foxFloat" style="width:100px;">
304
  <option value="none" <?php if ( 'none' == $O['player_float'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Left</option>
305
  <option value="rel-C" <?php if ( 'rel-C' == $O['player_float'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Centre</option>
@@ -309,39 +293,56 @@ function mp3j_print_admin_page()
309
  </select></td>
310
  <td></td>
311
  </tr>
 
 
 
312
  <tr>
313
- <td>&nbsp;</td>
314
- <td></td>
315
- <td></td>
316
  </tr>
317
  <tr>
318
- <td><strong>Margins:</strong></td>
319
- <td colspan="2">&nbsp;<span class="description">pixels (px) or percent (%)</span></td>
320
  </tr>
321
  <tr>
322
- <td></td>
323
- <td colspan="2"><input type="text" size="5" style="text-align:center;" name="mp3foxPaddings_top" value="<?php echo $O['paddings_top']; ?>" /> Above players<br />
324
- <input type="text" size="5" style="text-align:center;" name="mp3foxPaddings_inner" value="<?php echo $O['paddings_inner']; ?>" /> Inner margin (floated players)<br />
325
- <input type="text" size="5" style="text-align:center;" name="mp3foxPaddings_bottom" value="<?php echo $O['paddings_bottom']; ?>" /> Below players</td>
326
  </tr>
327
- </table>
328
- <br>
 
 
 
 
 
 
 
 
 
 
 
329
 
 
330
 
331
- <p style="margin:0 0 6px 15px;"><input type="checkbox" value="true" name="hasListMeta" id="hasListMeta" <?php echo ( $O['hasListMeta'] === "true" ? 'checked="checked"' : ''); ?>/>
332
- <label for="hasListMeta"> &nbsp; Show sub title in playlists</label></p>
333
 
334
 
335
- <p style="margin:0 0 6px 15px;"><input type="checkbox" name="mp3foxEnablePopout" id="mp3foxEnablePopout" value="true" <?php if ($O['enable_popout'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> />
336
- <label for="mp3foxEnablePopout"> &nbsp; Show popout player button</label></p>
 
 
 
 
 
 
 
 
 
 
 
 
337
 
338
- <p style="margin:0 0 0px 15px;"><input type="checkbox" name="mp3foxShowPlaylist" id="mp3foxShowPlaylist" value="true" <?php if ($O['playlist_show'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> />
339
- <label for="mp3foxShowPlaylist"> &nbsp; Start with playlists open</label></p>
340
 
341
 
342
- <p style="margin:5px 0 0 45px;"><label>Max playlist height:</label>
343
- &nbsp; <input type="text" size="6" style="text-align:center;" name="mp3foxMaxListHeight" value="<?php echo $O['max_list_height']; ?>" />
344
- px &nbsp; <span class="description">(a scroll bar will show for longer playlists, leave it blank for no limit)</span></p>
345
 
346
  <?php
347
  MJPsettings_playlist();
@@ -354,99 +355,190 @@ function mp3j_print_admin_page()
354
  <!-- TAB 1......................... -->
355
  <div class="mp3j-tab" id="mp3j_tab_1">
356
 
357
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
358
 
359
 
 
360
 
 
361
 
362
 
363
- ////
364
- //Library
365
- $library = $MP3JP->grab_library_info();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
366
 
367
 
368
 
 
 
369
 
370
 
371
 
 
 
 
 
 
 
 
 
372
 
373
- $libCount = ( $library ) ? $library['count'] : "0";
374
- $libText = '';
375
- $libButton = '';
376
- $liblist = '';
377
- $blank = '<span class="blank">-</span>';
378
 
379
- $libText .= '<span class="tabD" style="margin:0 0 10px 0;">Library contains <strong>' . $libCount . '</strong> audio file' . ( $libCount != 1 ? 's' : '' ) . '</span>. &nbsp;<strong><a href="media-new.php">Upload new &raquo;</a></strong>';
 
 
 
380
 
381
- if ( $libCount > 0 )
382
- {
383
- $libButton .= '<a class="button-secondary" href="javascript:" onclick="jQuery(\'#library-list\').toggle();" id="library-open">View files</a>';
384
- $n = 1;
385
- $rowClass = 'even';
386
-
387
- $liblist .= '<div id="library-list" style="display:none;"><table class="fileList">';
388
-
389
- /*
390
- $liblist .= '<tr>';
391
- $liblist .= '<tr><input type="ckeckbox" name="" id="" value="true"></tr>';
392
- $liblist .= '<tr></tr>';
393
- $liblist .= '<tr></tr>';
394
- $liblist .= '<tr></tr>';
395
-
396
- $liblist .= '<tr></tr>';
397
- $liblist .= '<tr></tr>';
398
- $liblist .= '<tr></tr>';
399
- $liblist .= '<tr></tr>';
400
- $liblist .= '</tr>';
401
- */
402
-
403
- $liblist .= '<tr>';
404
- $liblist .= '<th></th>';
405
- $liblist .= '<th></th>';
406
- $liblist .= '<th>Title</th>';
407
- $liblist .= '<th>Artist</th>';
408
-
409
- $liblist .= '<th>Album</th>';
410
- $liblist .= '<th>Caption</th>';
411
- $liblist .= '<th>Uploaded</th>';
412
- $liblist .= '<th>Filename</th>';
413
- $liblist .= '</tr>';
414
- foreach ( $library['filenames'] as $i => $file )
415
- {
416
- $id3data = wp_get_attachment_metadata( $library['postIDs'][ $i ], true );
417
-
418
- if ( ! is_array( $id3data ) ) {
419
- $id3data = array();
420
- }
421
- $id3data['artist'] = ( empty( $id3data['artist'] ) ) ? $blank : $id3data['artist'];
422
- $id3data['album'] = ( empty( $id3data['album'] ) ) ? $blank : $id3data['album'];
423
-
424
- $niceDate = date( 'jS F Y', strtotime($library['postDates'][$i]) );
425
- $rowClass = ( $rowClass === 'even' ) ? 'odd' : 'even';
426
-
427
- $liblist .= '<tr class="' . $rowClass . '">';
428
- $liblist .= '<td class="files-edit"><a href="post.php?post=' . $library['postIDs'][$i] . '&amp;action=edit" target="_blank">Edit</a></td>';
429
- $liblist .= '<td class="files-number">' . $n . '</td>';
430
- $liblist .= '<td class="files-title">' . $library['titles'][$i] . '</td>';
431
- $liblist .= '<td class="files-artist">' . $id3data['artist'] . '</td>';
432
-
433
- $liblist .= '<td class="files-album">' . $id3data['album'] . '</td>';
434
- $liblist .= '<td class="files-caption">' . $library['excerpts'][$i] . '</td>';
435
- $liblist .= '<td class="files-date">' . $niceDate . '</td>';
436
- $liblist .= '<td class="files-url">' . $file . '</td>';
437
- $liblist .= '</tr>';
438
-
439
- $n++;
440
- }
441
- $liblist .= '</table></div>';
442
- }
443
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
444
  ////
445
  //Default Folder
446
  $n = 1;
447
  $folderInfo = $MP3JP->grabFolderURLs( $O['mp3_dir'] ); //grab all
448
  $folderText = '';
449
- $folderButton = '';
450
  $folderHtml = '';
451
 
452
  if ( is_array($folderInfo) )
@@ -462,7 +554,7 @@ function mp3j_print_admin_page()
462
  $folderText .= "<span class=\"tabD\">This folder contains <strong>" . $c . "</strong> audio file" . ( $c != 1 ? 's' : '' ) . "</span>";
463
 
464
  if ( $c > 0 ) {
465
- $folderButton .= '<a class="button-secondary" href="javascript:" onclick="jQuery(\'#folder-list\').toggle();">View files</a>';
466
 
467
  $folderHtml .= '<div id="folder-list" style="display:none;">';
468
  $folderHtml .= '<table class="fileList">';
@@ -497,108 +589,64 @@ function mp3j_print_admin_page()
497
  else {
498
  $folderText .= "<p class=\"tabD\">No info is available on remote folders but you can play from here if you know the filenames</p>";
499
  }
500
- ?>
501
-
502
-
503
- <!-- File Lists -->
504
- <table>
505
- <tr>
506
- <td style="width:100px;"><strong>Media Library</strong>&nbsp;&nbsp;</td>
507
- <td style="width:100px;"><?php echo $libButton; ?>&nbsp;&nbsp;</td>
508
- <td><?php echo $libText; ?></td>
509
- </tr>
510
- </table>
511
- <?php
512
- echo $liblist;
513
- $version = substr( get_bloginfo('version'), 0, 3);
514
- ?>
515
- <br>
516
- <?php
517
- if ( $version >= 3.6 ) {
518
  ?>
519
 
520
- <table>
521
- <tr>
522
- <td colspan="4"></td>
523
- </tr>
524
- <tr>
525
- <td style="width:100px;"></td>
526
- <td style="width:100px; height:40px;"><strong>Player Titles</strong></td>
527
- <td style="width:50px; height:40px;">Display</td>
528
- <td style="width:350px; height:40px;"><select name="playerTitle1" id="playerTitle1">
529
- <option value="titles"<?php if ( 'titles' == $O['playerTitle1'] ) { echo ' selected="selected"'; } ?>>Title</option>
530
- <option value="artist"<?php if ( 'artist' == $O['playerTitle1'] ) { echo ' selected="selected"'; } ?>>Artist</option>
531
- <option value="album"<?php if ( 'album' == $O['playerTitle1'] ) { echo ' selected="selected"'; } ?>>Album</option>
532
- <option value="excerpts"<?php if ( 'excerpts' == $O['playerTitle1'] ) { echo ' selected="selected"'; } ?>>Caption</option>
533
- <option value="postDates"<?php if ( 'postDates' == $O['playerTitle1'] ) { echo ' selected="selected"'; } ?>>Upload Date</option>
534
- </select>&nbsp; for player Main title.</td>
535
- </tr>
536
- <tr>
537
- <td style="width:105px;"></td>
538
- <td></td>
539
- <td style="width:50px;">Display</td>
540
- <td><select name="playerTitle2" id="playerTitle2">
541
- <option value=""<?php if ( '' == $O['playerTitle2'] ) { echo ' selected="selected"'; } ?>>- None -</option>
542
- <option value="titles"<?php if ( 'titles' == $O['playerTitle2'] ) { echo ' selected="selected"'; } ?>>Title</option>
543
- <option value="artist"<?php if ( 'artist' == $O['playerTitle2'] ) { echo ' selected="selected"'; } ?>>Artist</option>
544
- <option value="album"<?php if ( 'album' == $O['playerTitle2'] ) { echo ' selected="selected"'; } ?>>Album</option>
545
- <option value="excerpts"<?php if ( 'excerpts' == $O['playerTitle2'] ) { echo ' selected="selected"'; } ?>>Caption</option>
546
- <option value="postDates"<?php if ( 'postDates' == $O['playerTitle2'] ) { echo ' selected="selected"'; } ?>>Upload Date</option>
547
- </select>&nbsp; for player Sub title.</td>
548
- </tr>
549
- </table>
550
- <?php
551
- }
552
- ?>
553
- <hr>
554
  <br>
 
 
 
 
 
 
 
 
 
 
 
555
  <table>
556
  <tr>
557
- <td style="width:100px;"><strong>Default Folder</strong>&nbsp;&nbsp;</td>
558
- <td style="width:100px;"><?php echo $folderButton; ?>&nbsp;&nbsp;</td>
559
- <td><strong>Path:</strong> <input type="text" style="width:250px;" name="mp3foxfolder" value="<?php echo $O['mp3_dir']; ?>" /> &nbsp; <strong><a href="javascript:" onclick="jQuery('#folderHelp').toggle(300);">Help..</a></strong></td>
560
  </tr>
561
  <tr>
562
  <td></td>
563
- <td></td>
564
- <td>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <?php echo $folderText; ?></td>
565
  </tr>
566
  </table>
 
567
  <?php echo $folderHtml; ?>
568
 
569
- <div id="folderHelp" class="helpBox" style="display:none; margin:10px 0 0 30px; max-width:550px;">
570
- <p class="description">You can specify a default folder path (local or remote) to play audio from, eg. <code>/my/music</code> or <code>www.anothersite.com/music</code>.
571
- You can then just write filenames in playlists to play from here (you don't need a full url).</p>
572
- </div>
573
  <br>
574
- <hr /><br>
575
 
576
 
577
 
578
- <!-- Auto Counterpart -->
579
- <label for="autoCounterpart" style="margin:0px 0 0 0px;">Auto-find counterpart files &nbsp; </label>
580
- <input type="checkbox" name="autoCounterpart" id="autoCounterpart" value="true" <?php echo ( $O['autoCounterpart'] === "true" ? 'checked="checked"' : ''); ?>/>
581
 
582
- <p class="description" style="margin:10px 0 0 0px;">This will pick up a fallback format if it's in the same location as the playlisted track, based on a
583
- filename match. <strong><a href="javascript:" onclick="jQuery('#counterpartHelp').toggle(300);">Help..</a></strong></p>
584
 
585
- <div id="counterpartHelp" class="helpBox" style="display:none; margin:10px 0 0 30px; max-width:550px;">
586
- <p class="description" style="margin-bottom:10px;">With this option ticked, the plugin will automatically look for counterpart files for any players on a page. The
587
- playlisted (primary) track must be from the MPEG family (an mp3, m4a, or mp4 file).</p>
 
 
 
 
 
 
 
 
588
 
589
- <p class="description" style="margin-bottom:10px;">Auto-counterparting works for MPEGS in the library, in local folders, and when using bulk play or FEED commands.
590
- Just make sure your counterparts have the same filename, and are in the same location as the primary track. You can always manually add a counterpart to any
591
- primary track format by using the <code>counterpart</code> parameter in a shortcode and specifying a url.</p>
592
 
593
- <p class="description" style="margin-bottom:10px;">Automatic Counterparts are chosen with the following format priority: OGG, WEBM, WAV.</p>
 
 
 
594
  </div>
595
 
596
-
597
- <br><br>
598
- <p><strong>Bulk-Play Settings</strong>
599
- <br><span class="description">Choose which audio formats are playlisted when bulk-playing from folders, the library, and via the</span> <code>FEED</code> <span class="description">command in playlists.</span></p>
600
-
601
- <p style="margin:12px 0 20px 0;">
602
  <?php
603
  foreach ( $O['audioFormats'] as $k => $f )
604
  {
@@ -608,18 +656,21 @@ function mp3j_print_admin_page()
608
  ?>
609
  </p>
610
 
611
- <table style="margin-left:30px;">
 
 
612
  <tr>
613
- <td>Order Library by:&nbsp;&nbsp;</td>
 
614
  <td>
615
  <select name="librarySortcol" style="width:160px;">
 
 
616
  <option value="file" <?php if ( 'file' == $O['library_sortcol'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Filename</option>
617
  <option value="date" <?php if ( 'date' == $O['library_sortcol'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Date Uploaded</option>
618
- <option value="caption" <?php if ( 'caption' == $O['library_sortcol'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Caption, Title</option>
619
- <option value="title" <?php if ( 'title' == $O['library_sortcol'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Title</option>
620
  </select>&nbsp;&nbsp;
621
  </td>
622
- <td>&nbsp; Direction: &nbsp;</td>
623
  <td>
624
  <select name="libraryDirection" style="width:100px;">
625
  <option value="ASC" <?php if ( 'ASC' == $O['library_direction'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Asc</option>
@@ -628,14 +679,15 @@ function mp3j_print_admin_page()
628
  </td>
629
  </tr>
630
  <tr>
631
- <td>Order Folders by:&nbsp;&nbsp;</td>
 
632
  <td>
633
  <select name="folderFeedSortcol" style="width:160px;">
634
  <option value="file" <?php if ( 'file' == $O['folderFeedSortcol'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Filename</option>
635
  <option value="date" <?php if ( 'date' == $O['folderFeedSortcol'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Date Uploaded</option>
636
  </select>&nbsp;&nbsp;
637
  </td>
638
- <td>&nbsp; Direction: &nbsp;</td>
639
  <td>
640
  <select name="folderFeedDirection" style="width:100px;">
641
  <option value="ASC" <?php if ( 'ASC' == $O['folderFeedDirection'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Asc</option>
@@ -646,20 +698,21 @@ function mp3j_print_admin_page()
646
  </table>
647
 
648
  <br />
649
- <p style="margin-left:30px;"><span class="description" id="feedCounterpartInfo"></span></p>
650
-
651
-
652
- </div><!-- CLOSE FILES TAB -->
653
 
654
 
655
 
 
 
 
656
  <!-- DOWNLOADS TAB .......................... -->
657
  <div class="mp3j-tab" id="mp3j_tab_3">
658
- <p class="tabD" style="margin:0 0 10px 0;">Download buttons are shown on playlist players, use these options to set their behavior.</p>
 
659
 
660
- <table>
661
  <tr>
662
- <td><strong>Show Download Button</strong>:</td>
663
  <td><select name="mp3foxDownloadMp3" style="width:150px;">
664
  <option value="true" <?php if ( 'true' == $O['show_downloadmp3'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Yes</option>
665
  <option value="false" <?php if ( 'false' == $O['show_downloadmp3'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>No</option>
@@ -667,48 +720,69 @@ function mp3j_print_admin_page()
667
  </select></td>
668
  </tr>
669
  <tr>
670
- <td><strong>Button Text</strong>:</td>
671
  <td><input type="text" style="width:150px;" name="dload_text" value="<?php echo $O['dload_text']; ?>" /></td>
672
  </tr>
673
 
674
- </table>
675
-
676
-
677
- <p class="description" style="margin:20px 0 5px 0px; max-width:400px;">When setting any players for logged-in downloads, use the following options to set the text/link for any logged out visitors.</p>
678
- <table>
679
  <tr>
680
- <td><strong>Visitor Text</strong>:</td>
 
 
 
 
 
 
 
 
681
  <td>
682
  <input type="text" style="width:150px;" name="loggedout_dload_text" value="<?php echo $O['loggedout_dload_text']; ?>" />
683
  </td>
684
  </tr>
685
  <tr>
686
- <td><strong>Visitor Link</strong>:</td>
687
  <td>
688
  <input type="text" style="width:300px;" name="loggedout_dload_link" value="<?php echo $O['loggedout_dload_link']; ?>" />
689
  &nbsp; <span class="description">Optional URL for the visitor text</span>
690
  </td>
691
  </tr>
692
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
693
  </table>
694
 
695
- <br><br>
696
- <input type="checkbox" name="force_browser_dload" id="force_browser_dload" value="true" <?php if ($O['force_browser_dload'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> />
697
- &nbsp;<label for="force_browser_dload">Smooth Downloads</label>
698
- <p class="description" style="margin:10px 0 10px 30px; max-width:500px;">This makes downloading seamless for most users, or it will display a dialog box with a link when a seamless download is not possible.</p>
699
 
700
- <p class="description" style="margin:10px 0 10px 30px; max-width:500px;">If you play from other domains and want seamless downloads, then use
701
- the field below to specify a path to the downloader file. <strong><a href="<?php echo $MP3JP->PluginFolder; ?>/remote/help.txt">See help on setting this up</a></strong></p>
702
 
703
- <table style="margin-left:25px;">
 
 
 
 
704
  <tr>
705
- <td><strong>Path to remote downloader file</strong>:</td>
706
  <td>
707
- <input type="text" style="width:150px;" name="dloader_remote_path" value="<?php echo $O['dloader_remote_path']; ?>" />
708
  </td>
709
  </tr>
710
  </table>
 
 
711
 
 
712
 
713
  </div>
714
 
@@ -718,104 +792,108 @@ function mp3j_print_admin_page()
718
 
719
  <!-- POPOUT TAB .......................... -->
720
  <div class="mp3j-tab" id="mp3j_tab_4">
721
-
722
- <table style="margin-left:0px;">
 
 
 
 
 
 
723
  <tr>
724
- <td><strong>Launch Button Text</strong>:</td>
725
- <td><input type="text" style="width:150px;" name="mp3foxPopoutButtonText" value="<?php echo $O['popout_button_title']; ?>" /><span class="description"> &nbsp;The default text shown on popout links and buttons.</span></td>
726
  </tr>
727
  <tr>
728
- <td><strong>Window Width</strong>:</td>
 
 
 
729
  <td><input type="text" size="4" style="text-align:center;" name="mp3foxPopoutWidth" value="<?php echo $O['popout_width']; ?>" /> px <span class="description">&nbsp; (250 - 1600)</span></td>
730
  </tr>
731
  <tr>
732
- <td><strong>Window Height</strong>: &nbsp;</td>
733
  <td><input type="text" size="4" style="text-align:center;" name="mp3foxPopoutMaxHeight" value="<?php echo $O['popout_max_height']; ?>" /> px <span class="description">&nbsp; (200 - 1200) &nbsp; a scroll bar will show for longer playlists</span></td>
734
  </tr>
735
  <tr>
736
- <td><strong>Background Colour</strong>:</td>
737
  <td><input type="text"name="mp3foxPopoutBackground" style="width:100px;" value="<?php echo $O['popout_background']; ?>" /></td>
738
  </tr>
739
  <tr>
740
- <td><strong>Background Image</strong>:</td>
741
  <td><input type="text" style="width:100%;" name="mp3foxPopoutBGimage" value="<?php echo $O['popout_background_image']; ?>" /></td>
742
  </tr>
743
  </table>
744
  </div><!-- CLOSE POPOUT TAB -->
745
 
746
 
 
 
 
 
747
  <!-- TAB 2.......................... -->
748
  <div class="mp3j-tab" id="mp3j_tab_2">
749
- <?php $greyout_text = ( $O['disable_jquery_libs'] == "yes" ) ? ' style="color:#d6d6d6;"' : ''; ?>
750
- <p class="tabD" style="margin:0 0 10px 0;">Choose which aspects of your content you'd like MP3-jPlayer to handle.</p>
751
 
752
- <table>
 
 
753
  <tr>
754
- <td><input type="checkbox" name="replace_WP_audio" id="replace_WP_audio" value="true" <?php if ($O['replace_WP_audio'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); } ?> />
755
  &nbsp; <label for="replace_WP_audio">Audio Players</label></td>
756
  <td><span class="description">Use the 'Add Media' Button on post/page edit screens and choose 'Embed Player' from the right select (WP 3.6+).</span></td>
757
  </tr>
758
  <tr>
759
- <td><input type="checkbox" name="replace_WP_playlist" id="replace_WP_playlist" value="true" <?php if ($O['replace_WP_playlist'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); } ?> />
760
  &nbsp; <label for="replace_WP_playlist">Playlist Players</label></td>
761
  <td><span class="description">Use the 'Add Media' Button on post/page edit screens and choose 'Audio Playlist' from the left menu (WP 3.9+).</span></td>
762
  </tr>
763
  <tr>
764
- <td><input type="checkbox" name="make_player_from_link" id="make_player_from_link" value="true" <?php if ($O['make_player_from_link'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); } ?> />
765
- &nbsp; <label for="make_player_from_link">Links to Audio Files</label> &nbsp;</td>
766
  <td><span class="description">Links within post/page content will be turned into players using the shortcode specified under the 'Advanced' tab.</span></td>
767
  </tr>
768
  <tr>
769
- <td><input type="checkbox" name="replace_WP_attached" id="replace_WP_attached" value="true" <?php if ($O['replace_WP_attached'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); } ?> />
770
  &nbsp; <label for="replace_WP_attached">Attached Audio</label></td>
771
  <td><span class="description">Use the shortcode <code>[audio]</code> in posts and pages to playlist any attached audio.</span></td>
772
  </tr>
773
  <tr>
774
- <td><input type="checkbox" name="replace_WP_embedded" id="replace_WP_embedded" value="true" <?php if ($O['replace_WP_embedded'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); } ?> />
775
  &nbsp; <label for="replace_WP_embedded">URLs</label></td>
776
  <td><span class="description">Paste urls directly into posts and pages (WP 3.6+).</span></td>
777
  </tr>
778
-
779
  </table>
780
-
781
  <br>
782
- <p><span class="description">You can always use MP3-jPlayer's own shortcodes and widgets regardless of the above settings.</span></p>
 
 
783
 
784
 
785
 
 
786
 
787
- <br><br><hr>
788
- <p class="tabD" style="margin:0 0 10px 0; max-width:550px;">On pages like index, archive and search pages, set whether to show players within posts. These settings won't affect player widgets.</p>
789
- <p><input type="checkbox" name="mp3foxOnBlog" id="mp3foxOnBlog" value="true" <?php if ($O['player_onblog'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> />
 
790
  <label for="mp3foxOnBlog"> &nbsp; Show players when the full content is used.</p>
791
- <p><input type="checkbox" name="runShcodeInExcerpt" id="runShcodeInExcerpt" value="true" <?php if ($O['run_shcode_in_excerpt'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> />
792
- <label for="runShcodeInExcerpt"> &nbsp; Show players when excerpts are used.</label>
793
- &nbsp;<span class="description">NOTE: this works for manually written post excerpts only, write your shortcodes into the excerpt field on post edit screens.</span></p>
794
 
 
795
 
796
 
797
 
798
 
799
- <br><br><hr>
800
- <p class="tabD" style="margin:0 0 10px 0;">Misc File Settings</p>
801
- <p><input type="checkbox" name="allowRangeRequests" id="allowRangeRequests" value="true"<?php echo ( $O['allowRangeRequests'] === "true" ? ' checked="checked"' : ''); ?>/><label for="allowRangeRequests">&nbsp;&nbsp; Allow position seeking beyond buffered</label></p>
802
- <p class="description" style="margin:0 0 5px 30px; max-width:550px;">Lets users seek to end of tracks without waiting for media to load. Most servers
803
- should allow this by default, if you are having issues then check that your server has the <code>accept-ranges: bytes</code> header set, or
804
- you can just switch this option off.</p>
805
- <p><input type="checkbox" id="mp3foxHideExtension" name="mp3foxHideExtension" value="true" <?php if ($O['hide_mp3extension'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> /> &nbsp; <label for="mp3foxHideExtension">Hide file extensions if a filename is displayed</label><br /><span class="description" style="margin-left:30px;">Filenames are displayed when there's no available titles.</span></p>
806
- <p><input type="checkbox" id="mp3foxEncodeFiles" name="mp3foxEncodeFiles" value="true" <?php if ($O['encode_files'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> /> &nbsp; <label for="mp3foxEncodeFiles">Encode URLs</label><br /><span class="description" style="margin-left:28px;">Provides some obfuscation of your urls in the page source.</span></p>
807
- <p><input type="checkbox" id="mp3foxAllowRemote" name="mp3foxAllowRemote" value="true" <?php if ($O['allow_remoteMp3'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> /> &nbsp; <label for="mp3foxAllowRemote">Allow playing of off-site files</label><br /><span class="description" style="margin-left:28px;">Un-checking this option filters out any files coming from other domains, but doesn't affect ability to play from a remote default path if one has been set above.</span></p>
808
-
809
 
 
810
 
811
 
812
 
813
- <br><br><hr>
814
- <p class="tabD" style="margin:0 0 10px 0;">Conversion Options</p>
815
  <table>
816
  <tr>
817
- <td><strong>Turn</strong> <code>[audio]</code> <strong>shortcodes into</strong>:</td>
818
- <td>
819
  <select name="replacerShortcode_single" style="width:200px; font-weight:500;">
820
  <option value="mp3j"<?php if ( 'mp3j' == $O['replacerShortcode_single'] ) { echo ' selected="selected"'; } ?>>Single Players - Graphic</option>
821
  <option value="mp3t"<?php if ( 'mp3t' == $O['replacerShortcode_single'] ) { echo ' selected="selected"'; } ?>>Single Players - Text</option>
@@ -825,8 +903,8 @@ function mp3j_print_admin_page()
825
  </td>
826
  </tr>
827
  <tr>
828
- <td><strong>Turn</strong> <code>[playlist]</code> <strong>shortcodes into</strong>:&nbsp;&nbsp;&nbsp;</td>
829
- <td>
830
  <select name="replacerShortcode_playlist" id="replacerShortcode_playlist" style="width:200px; font-weight:500;">
831
  <option value="player"<?php if ( 'player' == $O['replacerShortcode_playlist'] ) { echo ' selected="selected"'; } ?>>Playlist Players</option>
832
  <option value="popout"<?php if ( 'popout' == $O['replacerShortcode_playlist'] ) { echo ' selected="selected"'; } ?>>Popout Links</option>
@@ -834,42 +912,50 @@ function mp3j_print_admin_page()
834
  </td>
835
  </tr>
836
  <tr>
837
- <td class="vTop"><br /><strong>Turn converted links into</strong>:</td>
838
- <td>
839
- <br />
840
  <textarea class="widefat" style="width:400px; height:100px;" name="make_player_from_link_shcode"><?php
841
  $deslashed = str_replace('\"', '"', $O['make_player_from_link_shcode'] );
842
  echo $deslashed;
843
  ?></textarea><br />
844
- <span class="description">Placeholders:</span> <code>{TEXT}</code> <span class="description">- Link text,</span> <code>{URL}</code> <span class="description">- Link url.
845
- <br />This field can also include arbitrary text/html.</span>
846
  </td>
847
  </tr>
848
  </table>
 
849
 
850
 
 
 
 
 
 
 
 
 
 
851
 
852
 
853
- <br><br><hr>
854
- <p class="tabD" style="margin:0 0 10px 0;">Javascripts</p>
855
-
856
- <?php $bgc = ( $O['disable_jquery_libs'] == "yes" ) ? "#fdd" : "#f9f9f9"; ?>
857
- <div style="margin: 20px 0px 10px 0px; padding:6px; background:<?php echo $bgc; ?>; border:1px solid #ccc;">
858
- <p style="margin:0 0 5px 18px; font-weight:700;">Disable jQuery and jQuery-UI javascript libraries? &nbsp; <input type="text" style="width:60px;" name="disableJSlibs" value="<?php echo $O['disable_jquery_libs']; ?>" /></p>
859
- <p style="margin: 0 0 8px 18px;"><span class="description"><span style="color:#333;">CAUTION!!</span> This option will bypass the request <strong>from this plugin only</strong> for both jQuery <strong>and</strong> jQuery-UI scripts,
860
- you <strong>MUST</strong> be providing these scripts from an alternative source.
861
- <br />Type <code>yes</code> in the box and save settings to bypass jQuery and jQuery-UI.</span></p>
862
- </div>
863
 
864
 
865
 
866
- <br><br><hr>
867
- <p class="tabD" style="margin:0 0 10px 0;">Playlist Separators</p>
868
  <div style="margin: 10px 0px 10px 0px; padding:6px 18px 6px 18px; background:#f9f9f9; border:1px solid #ccc;">
869
- <span class="description">If you manually write playlists then you can choose the separators you use in the tracks and captions lists.
870
- <br /><span style="color:#333;">CAUTION!!</span> You'll need to manually update any existing playlists if you change the separators!</span>
871
 
872
- <p style="margin:10px 0 0 20px;"><strong>Files:</strong> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
873
  <select name="file_separator" style="width:120px; font-size:11px; line-height:16px;">
874
  <option value="," <?php if ( ',' == $O['f_separator'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>, (comma)</option>
875
  <option value=";" <?php if ( ';' == $O['f_separator'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>; (semicolon)</option>
@@ -877,7 +963,7 @@ function mp3j_print_admin_page()
877
  </select>
878
  &nbsp;&nbsp;<span class="description">eg.</span> <code>tracks="fileA.mp3 <?php echo $O['f_separator']; ?> Title@fileB.mp3 <?php echo $O['f_separator']; ?> fileC.mp3"</code></p>
879
 
880
- <p style="margin-left:20px;"><strong>Captions:</strong> &nbsp;&nbsp;
881
  <select name="caption_separator" style="width:120px; font-size:11px; line-height:16px;">
882
  <option value="," <?php if ( ',' == $O['c_separator'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>, (comma)</option>
883
  <option value=";" <?php if ( ';' == $O['c_separator'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>; (semicolon)</option>
@@ -886,26 +972,37 @@ function mp3j_print_admin_page()
886
  &nbsp;&nbsp;<span class="description">eg.</span> <code>captions="Caption A <?php echo $O['c_separator']; ?> Caption B <?php echo $O['c_separator']; ?> Caption C"</code></p>
887
  </div>
888
 
889
- <br><br><hr>
890
- <p class="tabD" style="margin:0 0 10px 0;">Other Settings</p>
891
 
 
892
 
893
- <p style="margin-bottom:10px;"><strong>Show error messages</strong>:
894
- &nbsp;&nbsp;&nbsp;
895
- <select name="showErrors">
896
- <option value="false"<?php if ( 'false' == $O['showErrors'] ) { echo ' selected="selected"'; } ?>>Never</option>
897
- <option value="admin"<?php if ( 'admin' == $O['showErrors'] ) { echo ' selected="selected"'; } ?>>To Admins only</option>
898
- <option value="true"<?php if ( 'true' == $O['showErrors'] ) { echo ' selected="selected"'; } ?>>To All</option>
899
- </select></p>
900
 
901
 
902
- <p><input type="checkbox" id="mp3foxEchoDebug" name="mp3foxEchoDebug" value="true" <?php if ($O['echo_debug'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> /> &nbsp;<label for="mp3foxEchoDebug">Turn on debug</label><br />&nbsp; &nbsp; &nbsp; &nbsp;<span class="description">(info appears in the source view near the bottom)</span></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
903
 
904
 
905
 
906
  </div><!-- CLOSE ADVANCED TAB -->
 
 
907
  </div><!-- close tabs wrapper -->
908
 
 
 
909
  <hr /><br />
910
  <table>
911
  <tr>
@@ -919,7 +1016,6 @@ function mp3j_print_admin_page()
919
  <tr>
920
  </table>
921
 
922
- <!--<input type="hidden" id="fox_styling" name="MtogBox1" value="<?php //echo $O['admin_toggle_1']; // Colour settings toggle state ?>" />-->
923
  <input type="hidden" name="mp3foxPluginVersion" value="<?php echo $MP3JP->version_of_plugin; ?>" />
924
 
925
  </form>
@@ -928,8 +1024,8 @@ function mp3j_print_admin_page()
928
  <div style="margin: 15px 0px 0px 0px; min-height:30px;">
929
  <p class="description" style="margin: 0px 120px px 0px; font-weight:700; color:#d0d0d0;">
930
  <a class="button-secondary" target="_blank" href="http://mp3-jplayer.com/help-docs/">Help & Docs &raquo;</a>
931
- &nbsp;&nbsp; <a class="button-secondary" target="_blank" href="http://mp3-jplayer.com/skins">Get Skins &raquo;</a>
932
  &nbsp;&nbsp; <a class="button-secondary" target="_blank" href="http://mp3-jplayer.com/add-ons">Get Add-Ons &raquo;</a>
 
933
  </p>
934
  </div>
935
 
125
  $O['flipMP3t'] = ( isset($_POST['flipMP3t']) ) ? "true" : "false";
126
 
127
  $O['hasListMeta'] = ( isset($_POST['hasListMeta']) ) ? "true" : "false";
128
+ $O['autoResume'] = ( isset($_POST['autoResume']) ) ? "true" : "false";
129
 
130
 
131
  //$O['libUseID3'] = ( isset($_POST['libUseID3']) ) ? "true" : "false";
179
  ?>
180
 
181
  <!-- Settings saved message -->
182
+ <div class="updated"><p><strong><?php _e("Settings saved.", $MP3JP->textdomain );?></strong></p></div>
183
  <?php
184
  }
185
 
188
  ?>
189
  <div class="wrap">
190
 
 
191
  <h2>&nbsp;</h2>
192
+
 
 
 
 
 
 
 
 
 
193
  <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">
194
 
195
 
196
+ <div class="mp3j-tabbuttons-wrap unselectable">
197
+ <div class="mp3j-tabbutton first" id="mp3j_tabbutton_1"><h1>MP3-jPlayer</h1></div>
198
+ <div class="mp3j-tabbutton" id="mp3j_tabbutton_5">Media</div>
199
  <div class="mp3j-tabbutton" id="mp3j_tabbutton_0">Players</div>
200
  <div class="mp3j-tabbutton" id="mp3j_tabbutton_3">Downloads</div>
201
  <div class="mp3j-tabbutton" id="mp3j_tabbutton_4">Popout</div>
202
+ <div class="mp3j-tabbutton last" id="mp3j_tabbutton_2">Advanced</div>
203
  <br class="clearB" />
204
  </div>
205
 
207
 
208
  <!-- TAB 0.......................... -->
209
  <div class="mp3j-tab" id="mp3j_tab_0">
 
210
 
 
 
 
 
 
211
 
212
  <?php
213
  MJPsettings_players();
214
  ?>
215
 
216
+ <div style="float:left; width:270px; margin:8px 10px 0 0;">
217
+ <div class="os" style="border-bottom:1px solid #d3d3d3; padding:8px 0 8px 0px; margin:0 0 15px 0; font-size:18px; font-weight:500;">Text Players (single-file)</div>
218
+ <table class="player-settings" style="margin:0 0 0px 0px; width:260px">
 
219
  <tr>
220
+ <td class="psHeight"><strong style="font-size:14px;">Font Size</strong>:</td>
221
  <td><input type="text" value="<?php echo $O['font_size_mp3t']; ?>" name="font_size_mp3t" style="width:70px;" /></td>
222
  </tr>
223
  <tr>
224
+ <td class="psHeight"><label for="volslider_onsingles"><strong style="font-size:14px;">Volume</strong>: &nbsp;</label></td>
225
  <td><input type="checkbox" name="volslider_onsingles" id="volslider_onsingles" value="true" <?php if ($O['volslider_on_singles'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> /></td>
226
  </tr>
227
  <tr>
228
+ <td class="psHeight"><label for="flipMP3t"><strong style="font-size:14px;">Play on RHS</strong>: &nbsp;</label></td>
229
  <td><input type="checkbox" name="flipMP3t" id="flipMP3t" value="true" <?php if ($O['flipMP3t'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> /></td>
230
  </tr>
231
  <tr>
232
+ <td class="psHeight"><strong style="font-size:14px;">Colour Scheme</strong>:</td>
233
  <td><input type="checkbox" name="mp3tColour_on" id="mp3tColour_on" value="true" <?php if ($O['mp3tColour_on'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> />
234
  On &nbsp;<input type="text" value="<?php echo $O['mp3tColour']; ?>" name="mp3tColour" id="mp3tColour" /></td>
235
  </tr>
239
  </table>
240
  </div>
241
 
242
+ <div style="float:left; width:270px; margin:8px 10px 0 0;">
243
+ <div style="border-bottom:1px solid #d3d3d3; padding:8px 0 8px 0px; margin:0 0 15px 0; font-size:18px; font-weight:500;">Button Players (single-file)</div>
244
+ <table class="player-settings" style="margin:0 0 0px 0px; width:260px">
245
  <tr>
246
+ <td class="psHeight"><strong style="font-size:14px;">Font Size</strong>:</td>
247
  <td><input type="text" value="<?php echo $O['font_size_mp3j']; ?>" name="font_size_mp3j" style="width:70px;" /></td>
248
  </tr>
249
  <tr>
250
+ <td class="psHeight"><label for="volslider_onmp3j"><strong style="font-size:14px;">Volume</strong>: &nbsp;</label></td>
251
  <td><input type="checkbox" name="volslider_onmp3j" id="volslider_onmp3j" value="true" <?php if ($O['volslider_on_mp3j'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> /></td>
252
  </tr>
253
  <tr>
254
+ <td class="psHeight"><label for="flipMP3j"><strong style="font-size:14px;">Play on RHS</strong>: &nbsp;</label></td>
255
  <td><input type="checkbox" name="flipMP3j" id="flipMP3j" value="false" <?php if ($O['flipMP3j'] == "false") { _e('checked="checked"', $MP3JP->textdomain ); }?> /></td>
256
  </tr>
257
  <tr>
258
+ <td class="psHeight"><strong style="font-size:14px;">Colour Scheme</strong>:</td>
259
  <td><input type="checkbox" name="mp3jColour_on" id="mp3jColour_on" value="true" <?php if ($O['mp3jColour_on'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> />
260
  On &nbsp;<input type="text" value="<?php echo $O['mp3jColour']; ?>" name="mp3jColour" id="mp3jColour" />
261
  </td>
275
  <br class="clearB">
276
 
277
  <br>
278
+ <div style="border-bottom:1px solid #d3d3d3; padding:8px 0 8px 0px; margin:10px 0 15px 0; width:540px; font-size:18px; font-weight:500;">Playlist Players</div>
279
+ <table class="playlist-settings" style="margin:0 0 0px 0px;">
280
  <tr>
281
+ <td style="width:175px;"><strong style="font-size:14px;">Width:</strong></td>
282
  <td><input type="text" style="width:100px;" name="mp3foxPlayerWidth" value="<?php echo $O['player_width']; ?>" /></td>
283
+ <td><span class="description">Pixels (px) or percent (%).</span></td>
284
  </tr>
285
  <tr>
286
+ <td><strong style="font-size:14px;">Alignment:</strong></td>
287
  <td><select name="mp3foxFloat" style="width:100px;">
288
  <option value="none" <?php if ( 'none' == $O['player_float'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Left</option>
289
  <option value="rel-C" <?php if ( 'rel-C' == $O['player_float'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Centre</option>
293
  </select></td>
294
  <td></td>
295
  </tr>
296
+
297
+
298
+
299
  <tr>
300
+ <td style="padding-bottom:4px;"><strong style="font-size:14px;">Margins:</strong></td>
301
+ <td style="padding-bottom:4px;" colspan="2"><input type="text" size="5" name="mp3foxPaddings_top" value="<?php echo $O['paddings_top']; ?>" /> &nbsp; Above players</td>
 
302
  </tr>
303
  <tr>
304
+ <td style="padding-top:0px; padding-bottom:4px;"></td>
305
+ <td style="padding-top:0px; padding-bottom:4px;" colspan="2"><input type="text" size="5" name="mp3foxPaddings_inner" value="<?php echo $O['paddings_inner']; ?>" /> &nbsp; Inner margin (floated players)</td>
306
  </tr>
307
  <tr>
308
+ <td style="padding-top:0px; padding-bottom:2px;"></td>
309
+ <td style="padding-top:0px; padding-bottom:2px;" colspan="2"><input type="text" size="5" name="mp3foxPaddings_bottom" value="<?php echo $O['paddings_bottom']; ?>" /> &nbsp; Below players</td>
 
 
310
  </tr>
311
+ <tr>
312
+ <td style="padding-top:5px; padding-bottom:20px;"></td>
313
+ <td style="padding-top:5px; padding-bottom:20px;" colspan="2"><span class="description">Pixels (px) or percent (%).</span></td>
314
+ </tr>
315
+
316
+
317
+ <tr>
318
+ <td style="padding-bottom:0;padding-top:0px;"><label style="font-size:14px;">Max playlist height:</label></td>
319
+ <td style="padding-bottom:0;padding-top:0px;" colspan="2"><input type="text" size="5" name="mp3foxMaxListHeight" value="<?php echo $O['max_list_height']; ?>" /> px</td>
320
+ </tr>
321
+ <tr>
322
+ <td style="padding-bottom:20px;padding-top:0;" colspan="3"><span class="description">A scroll bar will show for longer playlists, leave it blank for no limit.</span></td>
323
+ </tr>
324
 
325
+ </table>
326
 
 
 
327
 
328
 
329
+ <table class="playlist-settings">
330
+ <tr>
331
+ <td style="width:220px;"><label for="hasListMeta" style="font-size:14px;">Show sub titles in playlists</label></td>
332
+ <td colspan="2"><input type="checkbox" value="true" name="hasListMeta" id="hasListMeta" <?php echo ( $O['hasListMeta'] === "true" ? 'checked="checked"' : ''); ?>/></td>
333
+ </tr>
334
+ <tr>
335
+ <td><label for="mp3foxShowPlaylist" style="font-size:14px;">Start with playlists open</label></td>
336
+ <td colspan="2"><input type="checkbox" name="mp3foxShowPlaylist" id="mp3foxShowPlaylist" value="true" <?php if ($O['playlist_show'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> /></td>
337
+ </tr>
338
+ <tr>
339
+ <td><label for="mp3foxEnablePopout" style="font-size:14px;">Show popout player button</label></td>
340
+ <td colspan="2"><input type="checkbox" name="mp3foxEnablePopout" id="mp3foxEnablePopout" value="true" <?php if ($O['enable_popout'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> /></td>
341
+ </tr>
342
+ </table>
343
 
 
 
344
 
345
 
 
 
 
346
 
347
  <?php
348
  MJPsettings_playlist();
355
  <!-- TAB 1......................... -->
356
  <div class="mp3j-tab" id="mp3j_tab_1">
357
 
358
+ <div class="settingsBox">
359
+ <p style="margin-bottom:25px;" class="mainTick"><label>Initial volume: &nbsp; </label>
360
+ <input type="text" style="text-align:center;" size="2" name="mp3foxVol" value="<?php echo $O['initial_vol']; ?>" />
361
+ &nbsp; <span class="description">(0 - 100)</span></p>
362
+
363
+ <p class="mainTick"><input type="checkbox" name="mp3foxAddTrackNumbers" id="mp3foxAddTrackNumbers" value="true" <?php if ($O['add_track_numbering'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); } ?> />
364
+ <label for="mp3foxAddTrackNumbers"> &nbsp; Number the tracks</label></p>
365
+
366
+ <p class="mainTick"><input type="checkbox" name="mp3foxAutoplay" id="mp3foxAutoplay" value="true" <?php if ($O['auto_play'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); } ?> />
367
+ <label for="mp3foxAutoplay"> &nbsp; Auto play</label>
368
+ &nbsp;</p>
369
+
370
+ <p class="mainTick"><input type="checkbox" name="mp3foxPlaylistRepeat" id="mp3foxPlaylistRepeat" value="true" <?php if ($O['playlist_repeat'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); } ?> />
371
+ <label for="mp3foxPlaylistRepeat"> &nbsp; Loop playlist</label></p>
372
+
373
+ <p class="mainTick"><input type="checkbox" name="autoResume" id="autoResume" value="true" <?php if ($O['autoResume'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); } ?> />
374
+ <label for="autoResume"> &nbsp; Resume playback</label></p>
375
+
376
+ <p class="description" style="margin-bottom:20px; font-size:14px;"><br><span>Note that Resume and Auto play are prevented by many devices, these will activate on desktops and laptops only.</span> <a class="slimButton" href="javascript:" onclick="jQuery('#resumeHelp').toggle(300);">Help</a></p>
377
+
378
+ <div id="resumeHelp" class="helpBox" style="display:none; max-width:550px;">
379
+ <h4>Resume Playback</h4>
380
+ <p class="description">This gives near-continuous listening when browsing the site (there will be a short pause as the next page loads). Resuming will work wherever you have used the same piece of audio on different pages on the site.</p>
381
+ <h4>Auto Play</h4>
382
+ <p class="description">If you set multiple players on a page to autoplay then they will play their playlists in sequence one after the other.</p>
383
+ </div>
384
+
385
+
386
+ <br>
387
+ <!-- Auto Counterpart -->
388
+ <input type="checkbox" name="autoCounterpart" id="autoCounterpart" value="true" <?php echo ( $O['autoCounterpart'] === "true" ? 'checked="checked"' : ''); ?>/>
389
+ &nbsp; <label for="autoCounterpart" style="margin:0px 0 0 0px; font-size:14px;">Auto-find counterpart files &nbsp; </label>
390
+
391
+
392
+ <p class="description" style="margin:10px 0 0 0px; font-size:14px;">This will pick up a fallback format if it's in the same location as the playlisted track, based on a
393
+ filename match. <strong><a class="slimButton" href="javascript:" onclick="jQuery('#counterpartHelp').toggle(300);">Help</a></strong></p>
394
+
395
+ <div id="counterpartHelp" class="helpBox" style="display:none; max-width:550px;">
396
+ <p class="description">With this option ticked, the plugin will automatically look for counterpart files for any players on a page. The
397
+ playlisted (primary) track must be from the MPEG family (an mp3, m4a, or mp4 file).</p>
398
+
399
+ <p class="description">Auto-counterparting works for MPEGS in the library, in local folders, and when using bulk play or FEED commands.
400
+ Just make sure your counterparts have the same filename, and are in the same location as the primary track.</p>
401
+
402
+ <p class="description">You can always manually add a counterpart to any
403
+ primary track format by using the <code>counterpart</code> parameter in a shortcode and specifying a url.</p>
404
+
405
+ <p class="description">Automatic Counterparts are chosen with the following format priority: OGG, WEBM, WAV.</p>
406
+ </div>
407
 
408
 
409
+ <br>
410
 
411
+ </div>
412
 
413
 
414
+ <div class="infoBox">
415
+ <?php
416
+ if ( $O['disable_jquery_libs'] == "yes" ) {
417
+ echo '<p style="font-weight:600; color:#d33;margin-bottom:10px;">NOTE: jQuery and UI scripts are turned off.</p>';
418
+ }
419
+ ?>
420
+
421
+ <div class="gettingstarted">
422
+ <h4>Get Started:</h4>
423
+ <p class="infoLinks"><a href="media-new.php">Upload some audio</a></p>
424
+ <p class="infoLinks"><a href="http://mp3-jplayer.com/adding-players/">How to add players</a></p>
425
+ <p class="infoLinks"><a href="http://mp3-jplayer.com/audio-format-advice/">Audio Format Help</a></p>
426
+ </div>
427
+ <br>
428
+ <div class="moreinfo">
429
+ <h4>More Info:</h4>
430
+ <p class="infoLinks"><a href="http://mp3-jplayer.com/help-docs/">Help & Docs main page</a></p>
431
+ <p class="infoLinks"><a href="http://mp3-jplayer.com/shortcode-reference/">Shortcode Reference</a></p>
432
+ </div>
433
+
434
+ <hr>
435
+ <p class="infoLinks"><a href="http://mp3-jplayer.com">Plugin home page</a></p>
436
+ <p style="margin-bottom:0;" class="r"><span class="description" style="font-size:11px;">Version <?php echo $MP3JP->version_of_plugin; ?></span></p>
437
+
438
+
439
+ </div>
440
 
441
 
442
 
443
+ <br class="clearB">
444
+
445
 
446
 
447
 
448
+ </div><!-- CLOSE START TAB -->
449
+
450
+
451
+
452
+
453
+
454
+ <!-- TAB 5.......................... -->
455
+ <div class="mp3j-tab" id="mp3j_tab_5">
456
 
 
 
 
 
 
457
 
458
+ <?php
459
+ $version = substr( get_bloginfo('version'), 0, 3);
460
+ if ( $version >= 3.6 ) {
461
+ ?>
462
 
463
+ <h3 style="margin-top:15px; margin-bottom:10px; font-weight:500;">Library</h3>
464
+ <p class="description" style="font-size:14px; margin-bottom:10px;">Choose which title information to show in the players and playlists when playing from your WordPress Media Library.</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
465
 
466
+ <table>
467
+ <tr>
468
+ <td colspan="2"></td>
469
+ </tr>
470
+ <tr>
471
+ <td style="width:135px; height:40px; font-size:14px;"><strong>Main Titles</strong></td>
472
+ <td style="height:40px;"><select name="playerTitle1" id="playerTitle1" style="width:160px;">
473
+ <option value="titles"<?php if ( 'titles' == $O['playerTitle1'] ) { echo ' selected="selected"'; } ?>>Track Title</option>
474
+ <option value="artist"<?php if ( 'artist' == $O['playerTitle1'] ) { echo ' selected="selected"'; } ?>>Artist</option>
475
+ <option value="album"<?php if ( 'album' == $O['playerTitle1'] ) { echo ' selected="selected"'; } ?>>Album</option>
476
+ <option value="excerpts"<?php if ( 'excerpts' == $O['playerTitle1'] ) { echo ' selected="selected"'; } ?>>Caption</option>
477
+ <option value="postDates"<?php if ( 'postDates' == $O['playerTitle1'] ) { echo ' selected="selected"'; } ?>>Upload Date</option>
478
+ </select></td>
479
+ </tr>
480
+ <tr>
481
+ <td style="width:135px; height:40px; font-size:14px;"><strong>Secondary Titles</strong></td>
482
+ <td><select name="playerTitle2" id="playerTitle2" style="width:160px;">
483
+ <option value=""<?php if ( '' == $O['playerTitle2'] ) { echo ' selected="selected"'; } ?>>- None -</option>
484
+ <option value="titles"<?php if ( 'titles' == $O['playerTitle2'] ) { echo ' selected="selected"'; } ?>>Title</option>
485
+ <option value="artist"<?php if ( 'artist' == $O['playerTitle2'] ) { echo ' selected="selected"'; } ?>>Artist</option>
486
+ <option value="album"<?php if ( 'album' == $O['playerTitle2'] ) { echo ' selected="selected"'; } ?>>Album</option>
487
+ <option value="excerpts"<?php if ( 'excerpts' == $O['playerTitle2'] ) { echo ' selected="selected"'; } ?>>Caption</option>
488
+ <option value="postDates"<?php if ( 'postDates' == $O['playerTitle2'] ) { echo ' selected="selected"'; } ?>>Upload Date</option>
489
+ </select></td>
490
+ </tr>
491
+
492
+ </table>
493
+ <?php
494
+ }
495
+ ?>
496
+
497
+
498
+ <table style="margin-top:3px;">
499
+ <tr>
500
+ <td style="width:137px; height:40px;"></td>
501
+ <td style="height:40px;">
502
+ <span class="button-secondary unselectable" style="display:inline-block; font-size:13px; font-weight:600; margin-top:-4px;" id="showLibFilesButton">View Files</span>
503
+ &nbsp; &nbsp; <a href="media-new.php" style="font-weight:600; font-size:14px;">Upload Audio &raquo;</a>
504
+ </td>
505
+ </tr>
506
+ </table>
507
+
508
+ <div id="libraryViewerWrap" style="display:none;">
509
+ <div class="navWrap navWrapHeader">
510
+ <div class="fL">
511
+ <span class="button-secondary unselectable tNavPrev unPad" id="tNavControl_first">&lt;&lt;</span>
512
+ <span class="button-secondary unselectable tNavPrev" id="tNavControl_prev">&lt;</span>
513
+ <select id="tNavControl_page" class="tNavSelect vTop"></select>
514
+ <span class="button-secondary unselectable tNavNext" id="tNavControl_next">&gt;</span>
515
+ <span class="button-secondary unselectable tNavNext unPad" id="tNavControl_last">&gt;&gt;</span>
516
+ &nbsp; &nbsp; &nbsp; &nbsp;<input type="text" value="" id="tNavControl_rows" class="vTop" />
517
+ </div>
518
+ <div class="fL tpos ctext">rows per page</div>
519
+ <div class="fL">
520
+ <span id="tNavControl_refresh" class="button-secondary unselectable" style="background:#fff; font-size:11px;">Refresh</span>
521
+ <span class="mjp-spinner" id="tSpinner"></span>
522
+ </div>
523
+ <div class="tNavMessage ctext"></div>
524
+ <br class="clearB" style="height:0px;">
525
+ </div>
526
+ <div id="libraryFilesTable"></div>
527
+ </div>
528
+ <br>
529
+ <hr>
530
+
531
+
532
+
533
+
534
+
535
+ <?php
536
  ////
537
  //Default Folder
538
  $n = 1;
539
  $folderInfo = $MP3JP->grabFolderURLs( $O['mp3_dir'] ); //grab all
540
  $folderText = '';
541
+ //$folderButton = '';
542
  $folderHtml = '';
543
 
544
  if ( is_array($folderInfo) )
554
  $folderText .= "<span class=\"tabD\">This folder contains <strong>" . $c . "</strong> audio file" . ( $c != 1 ? 's' : '' ) . "</span>";
555
 
556
  if ( $c > 0 ) {
557
+ //$folderButton .= '<span class="button-secondary" href="javascript:" onclick="jQuery(\'#folder-list\').toggle();"><strong style="font-weight:600;">View files</strong></a>';
558
 
559
  $folderHtml .= '<div id="folder-list" style="display:none;">';
560
  $folderHtml .= '<table class="fileList">';
589
  else {
590
  $folderText .= "<p class=\"tabD\">No info is available on remote folders but you can play from here if you know the filenames</p>";
591
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
592
  ?>
593
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
594
  <br>
595
+ <h3 style="margin-top:10px; margin-bottom:10px; font-weight:500;">Default Folder</h3>
596
+ <p class="description" style="font-size:14px; margin-bottom:10px;">Set a folder path or url below. <a href="javascript:" class="slimButton" onclick="jQuery('#folderHelp').toggle(300);" style="font-size:13px; font-weight:600;">Help</a></p>
597
+
598
+ <div id="folderHelp" class="helpBox" style="display:none; max-width:550px;">
599
+ <p class="description">If you like, you can specify a location (local or remote) to play some of your audio from. For example:</p>
600
+ <p class="description"><code>/my/music</code> or <code>http://anothersite.com/music</code>.</p>
601
+ <p class="description">This means you only need to write the filenames in playlists to play from this location (you don't need to use the full url).</p>
602
+ <p class="description">If the path is local (on your domain) then you can also bulk-play this folder.</p>
603
+ </div>
604
+
605
+
606
  <table>
607
  <tr>
608
+ <td style="font-size:14px; width:135px;"><strong>Folder Path</strong> &nbsp; </td>
609
+ <td style="width:260px;"><input type="text" style="width:250px;" name="mp3foxfolder" value="<?php echo $O['mp3_dir']; ?>" /></td>
610
+ <td style="font-weight:600;"><a class="button-secondary unselectable" href="javascript:" onclick="jQuery('#folder-list').toggle();">View files</a>&nbsp;&nbsp;</td>
611
  </tr>
612
  <tr>
613
  <td></td>
614
+ <td colspan="2" style="padding-left:4px; padding-top:4px;"><?php echo $folderText; ?></td>
 
615
  </tr>
616
  </table>
617
+ <br>
618
  <?php echo $folderHtml; ?>
619
 
620
+
621
+ <hr>
 
 
622
  <br>
 
623
 
624
 
625
 
 
 
 
626
 
 
 
627
 
628
+
629
+ <h3 style="margin-top:10px; font-weight:500;">Bulk-Play Settings</h3>
630
+ <p class="description" style="font-size:14px; margin:10px 0 0 0px;">Choose which audio formats are playlisted when bulk-playing from
631
+ folders, the library, and via the FEED command in playlists.
632
+ <a href="javascript:" class="slimButton" onclick="jQuery('#feedHelp').toggle(300);">Help</a></p>
633
+
634
+ <div id="feedHelp" class="helpBox" style="display:none; max-width:550px;">
635
+ <p class="description">Use a simple shortcode in your posts and pages to playlist entire folders that are on your domain. You can also play your entire library.</p>
636
+
637
+ <p class="description">Play all audio in your library</p>
638
+ <p class="description"><code>[playlist tracks="FEED:LIB"]</code></p>
639
 
640
+ <p class="description">Play all audio in your default folder</p>
641
+ <p class="description"><code>[playlist tracks="FEED:DF"]</code></p>
 
642
 
643
+ <p class="description">Play all audio from the folder http://mysite.com/mytunes</p>
644
+ <p class="description"><code>[playlist tracks="FEED:/mytunes"]</code></p>
645
+
646
+ <p class="description">Control which of your file types get picked up using the tickboxes below.</p>
647
  </div>
648
 
649
+ <p style="margin:15px 0 30px 0; font-size:14px;">
 
 
 
 
 
650
  <?php
651
  foreach ( $O['audioFormats'] as $k => $f )
652
  {
656
  ?>
657
  </p>
658
 
659
+ <p class="description" style="font-size:14px; margin:0px 0 10px 0px;">Set the ordering for the playlists when bulk playing.</p>
660
+
661
+ <table style="margin-left:0px;">
662
  <tr>
663
+ <td style="font-size:14px; width:135px;"><strong>Library:</strong></td>
664
+ <td style="font-size:14px;">Order by &nbsp;</td>
665
  <td>
666
  <select name="librarySortcol" style="width:160px;">
667
+ <option value="title" <?php if ( 'title' == $O['library_sortcol'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Title</option>
668
+ <option value="caption" <?php if ( 'caption' == $O['library_sortcol'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Sub-title, Title</option>
669
  <option value="file" <?php if ( 'file' == $O['library_sortcol'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Filename</option>
670
  <option value="date" <?php if ( 'date' == $O['library_sortcol'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Date Uploaded</option>
 
 
671
  </select>&nbsp;&nbsp;
672
  </td>
673
+ <td style="font-size:14px;">&nbsp; Direction &nbsp;</td>
674
  <td>
675
  <select name="libraryDirection" style="width:100px;">
676
  <option value="ASC" <?php if ( 'ASC' == $O['library_direction'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Asc</option>
679
  </td>
680
  </tr>
681
  <tr>
682
+ <td style="font-size:14px; width:135px;"><strong>Folders:</strong></td>
683
+ <td style="font-size:14px;">Order by &nbsp;</td>
684
  <td>
685
  <select name="folderFeedSortcol" style="width:160px;">
686
  <option value="file" <?php if ( 'file' == $O['folderFeedSortcol'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Filename</option>
687
  <option value="date" <?php if ( 'date' == $O['folderFeedSortcol'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Date Uploaded</option>
688
  </select>&nbsp;&nbsp;
689
  </td>
690
+ <td style="font-size:14px;">&nbsp; Direction &nbsp;</td>
691
  <td>
692
  <select name="folderFeedDirection" style="width:100px;">
693
  <option value="ASC" <?php if ( 'ASC' == $O['folderFeedDirection'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Asc</option>
698
  </table>
699
 
700
  <br />
701
+ <p style="margin:10px 0 0 0;"><span class="description" id="feedCounterpartInfo"></span></p>
 
 
 
702
 
703
 
704
 
705
+ </div><!-- CLOSE MEDIA TAB -->
706
+
707
+
708
  <!-- DOWNLOADS TAB .......................... -->
709
  <div class="mp3j-tab" id="mp3j_tab_3">
710
+ <br>
711
+ <p class="description" style="font-size:14px; margin-bottom:10px;">Download buttons are shown on playlist players, use these options to set their behavior.</p>
712
 
713
+ <table class="dSettingsTable">
714
  <tr>
715
+ <td><strong class="mainTick">Show Download Button</strong></td>
716
  <td><select name="mp3foxDownloadMp3" style="width:150px;">
717
  <option value="true" <?php if ( 'true' == $O['show_downloadmp3'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Yes</option>
718
  <option value="false" <?php if ( 'false' == $O['show_downloadmp3'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>No</option>
720
  </select></td>
721
  </tr>
722
  <tr>
723
+ <td><strong class="mainTick">Button Text</strong></td>
724
  <td><input type="text" style="width:150px;" name="dload_text" value="<?php echo $O['dload_text']; ?>" /></td>
725
  </tr>
726
 
 
 
 
 
 
727
  <tr>
728
+ <td colspan="2"><br><hr></td>
729
+ </tr>
730
+
731
+ <tr>
732
+ <td colspan="2" class="mainTick" style="margin-left:0px;"><p class="description" style="margin:0px 0 5px 0px; font-size:14px;">When setting players for logged-in downloads, optionally set the text/link for any logged out visitors.</p></td>
733
+ </tr>
734
+
735
+ <tr>
736
+ <td><strong class="mainTick">Visitor Text</strong>:</td>
737
  <td>
738
  <input type="text" style="width:150px;" name="loggedout_dload_text" value="<?php echo $O['loggedout_dload_text']; ?>" />
739
  </td>
740
  </tr>
741
  <tr>
742
+ <td><strong class="mainTick">Visitor Link</strong>:</td>
743
  <td>
744
  <input type="text" style="width:300px;" name="loggedout_dload_link" value="<?php echo $O['loggedout_dload_link']; ?>" />
745
  &nbsp; <span class="description">Optional URL for the visitor text</span>
746
  </td>
747
  </tr>
748
 
749
+
750
+ <tr>
751
+ <td colspan="2"><br><hr></td>
752
+ </tr>
753
+
754
+
755
+
756
+ <tr>
757
+ <td style="padding-top:5px;"><label for="force_browser_dload" class="mainTick">Use Smooth Downloading</label></td>
758
+ <td style="padding-top:5px;"><input type="checkbox" name="force_browser_dload" id="force_browser_dload" value="true" <?php if ($O['force_browser_dload'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> /></td>
759
+ </tr>
760
+ <tr>
761
+ <td colspan="2"><p class="description" style="margin:0px 0 0px 0px; font-size:14px;">This option makes downloading seamless for most users, or it will display a dialog box with a link when a seamless download is not possible.</p></td>
762
+ </tr>
763
+ <tr>
764
+ <td colspan="2"><br><hr></td>
765
+ </tr>
766
  </table>
767
 
 
 
 
 
768
 
 
 
769
 
770
+
771
+
772
+
773
+
774
+ <table>
775
  <tr>
776
+ <td><strong class="mainTick">Path to remote downloader file</strong> &nbsp; &nbsp; &nbsp; </td>
777
  <td>
778
+ <input type="text" style="width:300px;" name="dloader_remote_path" value="<?php echo $O['dloader_remote_path']; ?>" />
779
  </td>
780
  </tr>
781
  </table>
782
+ <p class="description" style="margin:0px 0 10px 4px; font-size:14px;">If you play from other domains and want smooth downloads, then use
783
+ the field above to specify a path to the downloader file. <strong><a href="<?php echo $MP3JP->PluginFolder; ?>/remote/help.txt">See help on setting this up</a></strong></p>
784
 
785
+ <br>
786
 
787
  </div>
788
 
792
 
793
  <!-- POPOUT TAB .......................... -->
794
  <div class="mp3j-tab" id="mp3j_tab_4">
795
+ <br>
796
+ <p class="description" style="font-size:14px; margin-bottom:10px;">Set the default text displayed on popout buttons.</p>
797
+ <table class="popoutSettingsTable">
798
+ <tr>
799
+ <td><strong class="mainTick">Launch Button Text</strong>:</td>
800
+ <td><input type="text" style="width:150px;" name="mp3foxPopoutButtonText" value="<?php echo $O['popout_button_title']; ?>" /></td>
801
+ </tr>
802
+
803
  <tr>
804
+ <td colspan="2"><br><hr></td>
 
805
  </tr>
806
  <tr>
807
+ <td colspan="2" style="padding-left:0;"><p class="description" style="font-size:14px; margin-bottom:10px;">Popout window settings.</p></td>
808
+ </tr>
809
+ <tr>
810
+ <td><strong class="mainTick">Window Width</strong>:</td>
811
  <td><input type="text" size="4" style="text-align:center;" name="mp3foxPopoutWidth" value="<?php echo $O['popout_width']; ?>" /> px <span class="description">&nbsp; (250 - 1600)</span></td>
812
  </tr>
813
  <tr>
814
+ <td><strong class="mainTick">Window Height</strong>: &nbsp;</td>
815
  <td><input type="text" size="4" style="text-align:center;" name="mp3foxPopoutMaxHeight" value="<?php echo $O['popout_max_height']; ?>" /> px <span class="description">&nbsp; (200 - 1200) &nbsp; a scroll bar will show for longer playlists</span></td>
816
  </tr>
817
  <tr>
818
+ <td><strong class="mainTick">Background Colour</strong>:</td>
819
  <td><input type="text"name="mp3foxPopoutBackground" style="width:100px;" value="<?php echo $O['popout_background']; ?>" /></td>
820
  </tr>
821
  <tr>
822
+ <td><strong class="mainTick">Background Image</strong>:</td>
823
  <td><input type="text" style="width:100%;" name="mp3foxPopoutBGimage" value="<?php echo $O['popout_background_image']; ?>" /></td>
824
  </tr>
825
  </table>
826
  </div><!-- CLOSE POPOUT TAB -->
827
 
828
 
829
+
830
+
831
+
832
+
833
  <!-- TAB 2.......................... -->
834
  <div class="mp3j-tab" id="mp3j_tab_2">
 
 
835
 
836
+ <br>
837
+ <p class="description" style="font-size:14px; margin-bottom:20px;">Choose which aspects of your content you'd like MP3-jPlayer to handle.</p>
838
+ <table class="advancedSettingsTable">
839
  <tr>
840
+ <td class="mainTick"><input type="checkbox" name="replace_WP_audio" id="replace_WP_audio" value="true" <?php if ($O['replace_WP_audio'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); } ?> />
841
  &nbsp; <label for="replace_WP_audio">Audio Players</label></td>
842
  <td><span class="description">Use the 'Add Media' Button on post/page edit screens and choose 'Embed Player' from the right select (WP 3.6+).</span></td>
843
  </tr>
844
  <tr>
845
+ <td class="mainTick"><input type="checkbox" name="replace_WP_playlist" id="replace_WP_playlist" value="true" <?php if ($O['replace_WP_playlist'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); } ?> />
846
  &nbsp; <label for="replace_WP_playlist">Playlist Players</label></td>
847
  <td><span class="description">Use the 'Add Media' Button on post/page edit screens and choose 'Audio Playlist' from the left menu (WP 3.9+).</span></td>
848
  </tr>
849
  <tr>
850
+ <td class="mainTick"><input type="checkbox" name="make_player_from_link" id="make_player_from_link" value="true" <?php if ($O['make_player_from_link'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); } ?> />
851
+ &nbsp; <label for="make_player_from_link">Links to Audio Files</label></td>
852
  <td><span class="description">Links within post/page content will be turned into players using the shortcode specified under the 'Advanced' tab.</span></td>
853
  </tr>
854
  <tr>
855
+ <td class="mainTick"><input type="checkbox" name="replace_WP_attached" id="replace_WP_attached" value="true" <?php if ($O['replace_WP_attached'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); } ?> />
856
  &nbsp; <label for="replace_WP_attached">Attached Audio</label></td>
857
  <td><span class="description">Use the shortcode <code>[audio]</code> in posts and pages to playlist any attached audio.</span></td>
858
  </tr>
859
  <tr>
860
+ <td class="mainTick"><input type="checkbox" name="replace_WP_embedded" id="replace_WP_embedded" value="true" <?php if ($O['replace_WP_embedded'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); } ?> />
861
  &nbsp; <label for="replace_WP_embedded">URLs</label></td>
862
  <td><span class="description">Paste urls directly into posts and pages (WP 3.6+).</span></td>
863
  </tr>
 
864
  </table>
 
865
  <br>
866
+ <p class="description" style="font-size:14px;">You can always use MP3-jPlayer's own shortcodes and widgets regardless of the above settings.</p>
867
+
868
+
869
 
870
 
871
 
872
+ <br><hr><br>
873
 
874
+
875
+
876
+ <p class="description" style="font-size:14px; margin-bottom:10px;">On pages like Index, Archive and Search pages, choose whether players should be seen within the results. These settings won't affect player widgets.</p>
877
+ <p style="font-size:14px; margin-bottom:8px;"><input type="checkbox" name="mp3foxOnBlog" id="mp3foxOnBlog" value="true" <?php if ($O['player_onblog'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> />
878
  <label for="mp3foxOnBlog"> &nbsp; Show players when the full content is used.</p>
879
+ <p style="font-size:14px; margin-bottom:8px;"><input type="checkbox" name="runShcodeInExcerpt" id="runShcodeInExcerpt" value="true" <?php if ($O['run_shcode_in_excerpt'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> />
880
+ <label for="runShcodeInExcerpt"> &nbsp; Show players when excerpts (short summaries) are used.</label></p>
 
881
 
882
+ <p class="description" style="margin:0 0 10px 30px; font-size:14px;">NOTE: You will need to manually write your post excerpts for this to work. Write your shortcodes into the excerpt field on post edit screens.</p>
883
 
884
 
885
 
886
 
 
 
 
 
 
 
 
 
 
 
887
 
888
+ <br><hr><br>
889
 
890
 
891
 
892
+ <h3 style="margin:0 0 20px 0; font-weight:500;">Conversion Options</h3>
 
893
  <table>
894
  <tr>
895
+ <td class="padB" style="font-size:14px;"><strong>Turn</strong> <code>[audio]</code> <strong>shortcodes into</strong>:</td>
896
+ <td class="padB">
897
  <select name="replacerShortcode_single" style="width:200px; font-weight:500;">
898
  <option value="mp3j"<?php if ( 'mp3j' == $O['replacerShortcode_single'] ) { echo ' selected="selected"'; } ?>>Single Players - Graphic</option>
899
  <option value="mp3t"<?php if ( 'mp3t' == $O['replacerShortcode_single'] ) { echo ' selected="selected"'; } ?>>Single Players - Text</option>
903
  </td>
904
  </tr>
905
  <tr>
906
+ <td class="padB" style="font-size:14px;"><strong>Turn</strong> <code>[playlist]</code> <strong>shortcodes into</strong>:&nbsp;&nbsp;&nbsp;</td>
907
+ <td class="padB">
908
  <select name="replacerShortcode_playlist" id="replacerShortcode_playlist" style="width:200px; font-weight:500;">
909
  <option value="player"<?php if ( 'player' == $O['replacerShortcode_playlist'] ) { echo ' selected="selected"'; } ?>>Playlist Players</option>
910
  <option value="popout"<?php if ( 'popout' == $O['replacerShortcode_playlist'] ) { echo ' selected="selected"'; } ?>>Popout Links</option>
912
  </td>
913
  </tr>
914
  <tr>
915
+ <td class="vTop padB" style="font-size:14px;"><strong>Turn converted links into</strong>:</td>
916
+ <td class="padB">
 
917
  <textarea class="widefat" style="width:400px; height:100px;" name="make_player_from_link_shcode"><?php
918
  $deslashed = str_replace('\"', '"', $O['make_player_from_link_shcode'] );
919
  echo $deslashed;
920
  ?></textarea><br />
921
+ <p class="description" style="margin:5px 0 10px 0; font-size:14px;">Placeholders: <code>{TEXT}</code> - Link text, <code>{URL}</code> - Link url.
922
+ <br />This field can also include arbitrary text/html.</p>
923
  </td>
924
  </tr>
925
  </table>
926
+ <hr><br>
927
 
928
 
929
+ <h3 style="margin:0 0 20px 0; font-weight:500;">Misc File Settings</h3>
930
+ <p class="mainTick"><input type="checkbox" name="allowRangeRequests" id="allowRangeRequests" value="true"<?php echo ( $O['allowRangeRequests'] === "true" ? ' checked="checked"' : ''); ?>/><label for="allowRangeRequests">&nbsp;&nbsp; Allow position seeking beyond buffered</label></p>
931
+ <p class="description" style="margin:0 0 10px 30px; max-width:550px; font-size:14px;">Lets users seek to end of tracks without waiting for media to load. Most servers
932
+ should allow this by default, if you are having issues then check that your server has the <code>accept-ranges: bytes</code> header set, or
933
+ you can just switch this option off.</p>
934
+ <p class="mainTick" style="margin:0 0 10px 0px;"><input type="checkbox" id="mp3foxHideExtension" name="mp3foxHideExtension" value="true" <?php if ($O['hide_mp3extension'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> /> &nbsp; <label for="mp3foxHideExtension">Hide file extensions if a filename is displayed</label><br /><span class="description" style="margin-left:30px; font-size:14px;">Filenames are displayed when there's no available titles.</span></p>
935
+ <p class="mainTick" style="margin:0 0 10px 0px;"><input type="checkbox" id="mp3foxEncodeFiles" name="mp3foxEncodeFiles" value="true" <?php if ($O['encode_files'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> /> &nbsp; <label for="mp3foxEncodeFiles">Encode URLs</label><br /><span class="description" style="margin-left:30px;font-size:14px;">Provides some obfuscation of your urls in the page source.</span></p>
936
+ <p class="mainTick" style="margin:0 0 10px 0px;"><input type="checkbox" id="mp3foxAllowRemote" name="mp3foxAllowRemote" value="true" <?php if ($O['allow_remoteMp3'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> /> &nbsp; <label for="mp3foxAllowRemote">Allow playing of off-site files</label><br /><span class="description" style="margin-left:30px;font-size:14px;">Un-checking this option filters out any files coming from other domains, but doesn't affect ability to play from a remote default path if one has been set above.</span></p>
937
+ <br><hr><br>
938
 
939
 
940
+
941
+ <h3 style="margin:0 0 20px 0; font-weight:500;">Misc Player Settings</h3>
942
+ <p class="mainTick" style="margin-bottom:10px;"><strong>Show player error messages</strong>:
943
+ &nbsp;&nbsp;&nbsp;
944
+ <select name="showErrors">
945
+ <option value="false"<?php if ( 'false' == $O['showErrors'] ) { echo ' selected="selected"'; } ?>>Never</option>
946
+ <option value="admin"<?php if ( 'admin' == $O['showErrors'] ) { echo ' selected="selected"'; } ?>>To Admins only</option>
947
+ <option value="true"<?php if ( 'true' == $O['showErrors'] ) { echo ' selected="selected"'; } ?>>To All</option>
948
+ </select></p>
949
+ <br><hr><br>
950
 
951
 
952
 
953
+ <h3 style="margin:0 0 20px 0; font-weight:500;">Playlist Separator Settings</h3>
 
954
  <div style="margin: 10px 0px 10px 0px; padding:6px 18px 6px 18px; background:#f9f9f9; border:1px solid #ccc;">
955
+ <p><span class="description" style="font-size:14px;">If you manually write playlists then you can choose the separators you use in the tracks and captions lists.
956
+ <br /><span style="color:#333;">CAUTION!!</span> You'll need to manually update any existing playlists if you change the separators!</span></p>
957
 
958
+ <p class="mainTick" style="margin:10px 0 0 20px;"><strong>Files:</strong> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
959
  <select name="file_separator" style="width:120px; font-size:11px; line-height:16px;">
960
  <option value="," <?php if ( ',' == $O['f_separator'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>, (comma)</option>
961
  <option value=";" <?php if ( ';' == $O['f_separator'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>; (semicolon)</option>
963
  </select>
964
  &nbsp;&nbsp;<span class="description">eg.</span> <code>tracks="fileA.mp3 <?php echo $O['f_separator']; ?> Title@fileB.mp3 <?php echo $O['f_separator']; ?> fileC.mp3"</code></p>
965
 
966
+ <p class="mainTick" style="margin-left:20px;"><strong>Captions:</strong> &nbsp;&nbsp;
967
  <select name="caption_separator" style="width:120px; font-size:11px; line-height:16px;">
968
  <option value="," <?php if ( ',' == $O['c_separator'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>, (comma)</option>
969
  <option value=";" <?php if ( ';' == $O['c_separator'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>; (semicolon)</option>
972
  &nbsp;&nbsp;<span class="description">eg.</span> <code>captions="Caption A <?php echo $O['c_separator']; ?> Caption B <?php echo $O['c_separator']; ?> Caption C"</code></p>
973
  </div>
974
 
 
 
975
 
976
+
977
 
978
+ <br><hr><br>
 
 
 
 
 
 
979
 
980
 
981
+
982
+
983
+ <h3 style="margin:0 0 20px 0; font-weight:500;">Developer Settings</h3>
984
+ <p class="mainTick"><input type="checkbox" id="mp3foxEchoDebug" name="mp3foxEchoDebug" value="true" <?php if ($O['echo_debug'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> />
985
+ &nbsp;<label for="mp3foxEchoDebug">Turn on debug</label>
986
+ <br />&nbsp; &nbsp; &nbsp; &nbsp;<span class="description" style="font-size:14px;">Info appears in the source view near the bottom.</span></p>
987
+
988
+
989
+ <?php $bgc = ( $O['disable_jquery_libs'] == "yes" ) ? "#fdd" : "#f9f9f9"; ?>
990
+ <div style="margin: 20px 0px 10px 0px; padding:6px; background:<?php echo $bgc; ?>; border:1px solid #ccc;">
991
+ <p class="mainTick" style="margin:0 0 5px 18px; font-weight:700;">Disable jQuery and jQuery-UI javascript libraries? &nbsp; <input type="text" style="width:60px;" name="disableJSlibs" value="<?php echo $O['disable_jquery_libs']; ?>" /></p>
992
+ <p style="margin: 0 0 8px 18px;"><span class="description" style="font-size:14px;"><span style="color:#333;">CAUTION!!</span> This option will bypass the request <strong>from this plugin only</strong> for both jQuery <strong>and</strong> jQuery-UI scripts,
993
+ you <strong>MUST</strong> be providing these scripts from an alternative source.
994
+ <br />Type <code>yes</code> in the box and save settings to bypass jQuery and jQuery-UI.</span></p>
995
+ </div>
996
 
997
 
998
 
999
  </div><!-- CLOSE ADVANCED TAB -->
1000
+
1001
+
1002
  </div><!-- close tabs wrapper -->
1003
 
1004
+
1005
+
1006
  <hr /><br />
1007
  <table>
1008
  <tr>
1016
  <tr>
1017
  </table>
1018
 
 
1019
  <input type="hidden" name="mp3foxPluginVersion" value="<?php echo $MP3JP->version_of_plugin; ?>" />
1020
 
1021
  </form>
1024
  <div style="margin: 15px 0px 0px 0px; min-height:30px;">
1025
  <p class="description" style="margin: 0px 120px px 0px; font-weight:700; color:#d0d0d0;">
1026
  <a class="button-secondary" target="_blank" href="http://mp3-jplayer.com/help-docs/">Help & Docs &raquo;</a>
 
1027
  &nbsp;&nbsp; <a class="button-secondary" target="_blank" href="http://mp3-jplayer.com/add-ons">Get Add-Ons &raquo;</a>
1028
+ &nbsp;&nbsp; <a class="button-secondary" target="_blank" href="http://mp3-jplayer.com/skins">Get Skins &raquo;</a>
1029
  </p>
1030
  </div>
1031
 
css/admin/admin-colours.css CHANGED
@@ -442,3 +442,16 @@ div.wrap {
442
  #tog_0-list p { margin:10px 0 10px 0; }
443
  #tog_0-list h4 { margin:10px 0 10px 0; }
444
 
 
 
 
 
 
 
 
 
 
 
 
 
 
442
  #tog_0-list p { margin:10px 0 10px 0; }
443
  #tog_0-list h4 { margin:10px 0 10px 0; }
444
 
445
+
446
+
447
+ .form-table td .notice p,
448
+ .notice p,
449
+ div.error p,
450
+ div.updated p {
451
+ margin: .5em 0;
452
+ padding: 2px;
453
+ }
454
+
455
+ div.updated { margin: 5px 0 15px;}
456
+
457
+
css/admin/admin-settings.css CHANGED
@@ -5,16 +5,16 @@
5
  .mp3j-tabbuttons-wrap {
6
  position:relative;
7
  min-height:30px;
8
- padding:5px 0 0 0;
9
  width:auto;
10
  overflow:visible;
11
  }
12
  .mp3j-tabbutton {
13
  float:left;
14
- padding:6px 24px 6px 22px;
15
- font-size:13px;
16
  margin:0;
17
- background:#e6e6e6;
18
  font-weight:500;
19
  -webkit-border-top-left-radius: 1px;
20
  -webkit-border-top-right-radius: 1px;
@@ -24,18 +24,29 @@
24
  border-top-right-radius: 1px;
25
  border-bottom:1px solid #fcfcfc;
26
  cursor:pointer;
27
- color:#888;
 
 
 
 
 
 
 
28
  }
29
  .mp3j-tabbutton:hover {
30
- background:#e6e6e6;
31
- text-decoration:underline;
32
  }
 
 
 
33
  .active-tab {
34
- border:1px solid #fff;
35
  border-bottom:0px;
36
- padding:6px 23px 6px 21px;
37
- color:#333;
38
- font-weight:700;
 
39
  background:none;
40
  margin-top:-1px;
41
  text-decoration:none;
@@ -44,7 +55,34 @@
44
  background:none;
45
  text-decoration:none;
46
  }
47
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  .mp3j-tabs-wrap {
49
  position:relative;
50
  height:auto;
@@ -53,14 +91,14 @@
53
  .mp3j-tab {
54
  position:relative;
55
  height:auto;
56
- padding:20px 0px 40px 0px;
57
  background:#f1f1f1;
58
  }
59
  .tab-header { padding:2px 0 6px 0; margin:0; width:100%; }
60
  .tab-header h3 { margin:0 0 0 0 !important; }
61
 
62
  .tabH { font-size:19px; font-weight:700; }
63
- .tabD { font-style:italic; padding:0 0 10px 0; }
64
 
65
  .mp3j-tab label { font-weight:700; }
66
 
@@ -69,16 +107,25 @@
69
  .mp3j-tab hr { margin-bottom:8px; }
70
 
71
 
 
 
 
 
72
  /* --- */
73
- div#library-list,
 
74
  div#folder-list {
75
  position:relative;
76
  padding:10px 20px 15px 20px;
77
- margin:5px 0px 0px 0px;
78
  background:#f9f9f9;
79
- border:1px solid #eee;
 
 
 
 
 
80
  }
81
-
82
 
83
  /* --- */
84
  .unselectable,
@@ -121,11 +168,11 @@ table.fileList tr.even {
121
  td.files-edit { padding-right:5px; }
122
  td.files-number { padding-right:5px; color:#aaa; font-size:11px; }
123
  td.files-title {}
124
- td.files-artist { font-size: 12px; color: #999; }
125
- td.files-album { font-size: 12px; color: #999; }
126
- td.files-caption { font-size: 12px; color: #999; }
127
  td.files-date { font-size: 12px;}
128
- td.files-url { font-size: 12px; color: #999; }
129
 
130
 
131
 
@@ -193,8 +240,21 @@ table.vTop td { vertical-align:top; padding:0 10px 10px 0; }
193
  .helpBox {
194
  border:2px solid #fff;
195
  border-radius:3px; -moz-border-radius:3px; -webkit-border-radius:3px;
196
- background:#f0f6f0;
197
  padding:15px;
 
 
 
 
 
 
 
 
 
 
 
 
 
198
  }
199
 
200
  /* ====================================================================================== */
@@ -218,20 +278,6 @@ a.fox_buttonlink {
218
 
219
 
220
 
221
-
222
-
223
-
224
- div.wrap {
225
- border: 0px solid #FF3300;
226
- margin:0px 10px 0 20px;
227
- max-width:1200px;
228
- }
229
- div.wrap p { margin:0 0 4px 0; }
230
- div.wrap h1 { font-weight:500; font-size: 22px; line-height:22px; margin:20px 0 5px 0; padding:0; }
231
- div.wrap h2 { font-size: 10px; line-height:10px; margin:0; padding:0; }
232
- div.wrap h3 { margin:0 0 8px 20px; }
233
- div.wrap h4 { margin:20px 0 0px 0; }
234
-
235
 
236
 
237
  .clearB { clear:both; }
@@ -248,7 +294,9 @@ table.player-settings td {
248
  padding-bottom: 6px;
249
  }
250
 
251
-
 
 
252
 
253
 
254
 
@@ -286,8 +334,8 @@ code { background:#fff; border:1px solid #e0e0e0; }
286
 
287
  div.wrap {
288
  border: 0px solid #FF3300;
289
- margin:0px 10px 0 20px;
290
- max-width:1200px;
291
  }
292
  div.wrap p { margin:0 0 4px 0; }
293
  div.wrap h1 { font-weight:500; font-size: 22px; line-height:22px; margin:20px 0 5px 0; padding:0; }
@@ -405,10 +453,232 @@ a.underline, a.underline:hover, a.underline:active, a.underline:visited, a.under
405
 
406
 
407
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
408
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
409
 
410
 
411
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
412
 
413
  /* ----- */
414
  @media screen and (max-width: 1250px) {
5
  .mp3j-tabbuttons-wrap {
6
  position:relative;
7
  min-height:30px;
8
+ padding:15px 0 0 0;
9
  width:auto;
10
  overflow:visible;
11
  }
12
  .mp3j-tabbutton {
13
  float:left;
14
+ padding:9px 36px 12px 32px;
15
+ font-size:15px;
16
  margin:0;
17
+ background:#e9e9e9;
18
  font-weight:500;
19
  -webkit-border-top-left-radius: 1px;
20
  -webkit-border-top-right-radius: 1px;
24
  border-top-right-radius: 1px;
25
  border-bottom:1px solid #fcfcfc;
26
  cursor:pointer;
27
+ color:#707070;
28
+ font-family: "Open Sans",sans-serif;
29
+ line-height:24px;
30
+ }
31
+ div.wrap .mp3j-tabbutton h1 {
32
+ margin:0;
33
+ font-size:20px;
34
+ line-height:24px;
35
  }
36
  .mp3j-tabbutton:hover {
37
+ background:#ededed;
38
+ text-decoration:none;
39
  }
40
+
41
+
42
+
43
  .active-tab {
44
+ border:1px solid #fcfcfc;
45
  border-bottom:0px;
46
+ padding-left:31px;
47
+ padding-right:35px;
48
+ color:#222;
49
+ font-weight:500;
50
  background:none;
51
  margin-top:-1px;
52
  text-decoration:none;
55
  background:none;
56
  text-decoration:none;
57
  }
58
+
59
+ .mp3j-tabbutton.first {
60
+ padding-top:8px;
61
+ padding-bottom:13px;
62
+ padding-left:22px;
63
+ padding-right:26px;
64
+ }
65
+
66
+ .mp3j-tabbutton.first.active-tab {
67
+ border-left:0;
68
+ border-top:0;
69
+ padding-right:25px;
70
+ padding-top:9px;
71
+ padding-left:22px;
72
+ padding-bottom:13px;
73
+ }
74
+
75
+ .mp3j-tabbutton.last { padding-right:52px; }
76
+ .mp3j-tabbutton.last.active-tab {
77
+ border-right:0;
78
+ padding-right:52px;
79
+ }
80
+
81
+
82
+
83
+
84
+
85
+
86
  .mp3j-tabs-wrap {
87
  position:relative;
88
  height:auto;
91
  .mp3j-tab {
92
  position:relative;
93
  height:auto;
94
+ padding:20px 0px 40px 22px;
95
  background:#f1f1f1;
96
  }
97
  .tab-header { padding:2px 0 6px 0; margin:0; width:100%; }
98
  .tab-header h3 { margin:0 0 0 0 !important; }
99
 
100
  .tabH { font-size:19px; font-weight:700; }
101
+ .tabD { font-style:italic; padding:0 0 10px 0; }
102
 
103
  .mp3j-tab label { font-weight:700; }
104
 
107
  .mp3j-tab hr { margin-bottom:8px; }
108
 
109
 
110
+ .os {
111
+ font-family: 'Open Sans', sans-serif;
112
+ }
113
+
114
  /* --- */
115
+ div#library-list,
116
+ div.library-list,
117
  div#folder-list {
118
  position:relative;
119
  padding:10px 20px 15px 20px;
120
+ margin:0px 0px 0px 0px;
121
  background:#f9f9f9;
122
+
123
+ border:1px solid #c3c3c3;
124
+ border-top:none;
125
+ }
126
+ div#folder-list {
127
+ border:1px solid #c3c3c3;
128
  }
 
129
 
130
  /* --- */
131
  .unselectable,
168
  td.files-edit { padding-right:5px; }
169
  td.files-number { padding-right:5px; color:#aaa; font-size:11px; }
170
  td.files-title {}
171
+ td.files-artist { font-size: 12px; }
172
+ td.files-album { font-size: 12px; }
173
+ td.files-caption { font-size: 12px; }
174
  td.files-date { font-size: 12px;}
175
+ td.files-url { font-size: 12px; }
176
 
177
 
178
 
240
  .helpBox {
241
  border:2px solid #fff;
242
  border-radius:3px; -moz-border-radius:3px; -webkit-border-radius:3px;
243
+ background:#fafafa;
244
  padding:15px;
245
+ margin:10px 0 20px 0px;
246
+ }
247
+
248
+ .helpBox p.description {
249
+ color: #333;
250
+ line-height:160%;
251
+ font-size:14px;
252
+ font-style:normal;
253
+ margin-bottom:20px;
254
+ }
255
+
256
+ div.wrap .helpBox h4 {
257
+ margin-bottom:10px;
258
  }
259
 
260
  /* ====================================================================================== */
278
 
279
 
280
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
281
 
282
 
283
  .clearB { clear:both; }
294
  padding-bottom: 6px;
295
  }
296
 
297
+ table.playlist-settings td {
298
+ padding-bottom: 10px;
299
+ }
300
 
301
 
302
 
334
 
335
  div.wrap {
336
  border: 0px solid #FF3300;
337
+ margin:0px 20px 0 0px;
338
+ max-width:1600px;
339
  }
340
  div.wrap p { margin:0 0 4px 0; }
341
  div.wrap h1 { font-weight:500; font-size: 22px; line-height:22px; margin:20px 0 5px 0; padding:0; }
453
 
454
 
455
 
456
+ /* table nav controls
457
+ -------------------------- */
458
+ .navWrap {
459
+ padding: 5px;
460
+ border: 1px solid #ccc;
461
+ background: #fff;
462
+ }
463
+ .navWrap .button-secondary {
464
+ box-shadow: none;
465
+ -webkit-box-shadow: none;
466
+ font-weight:700;
467
+ }
468
+
469
+ .navWrapHeader{
470
+ margin: 0 0 0px 0;
471
+ }
472
+ .navWrapFooter {
473
+ margin: 0px 0 0 0;
474
+ }
475
+
476
+ .unPad {
477
+ padding: 0 5px 1px !important;
478
+ }
479
+
480
+ .vTop {
481
+ vertical-align: top !important;
482
+ }
483
+
484
+ .buttonDisabled {
485
+ color: #ececec !important;
486
+ border: 1px solid #f1f1f1 !important;
487
+ background: #fbfbfb !important;
488
+ cursor: default !important;
489
+ }
490
+
491
+ .tNavSelect,
492
+ .vNavSelect {
493
+ margin-top: 0px;
494
+ }
495
+
496
+ .mjp-spinner {
497
+ display: inline-block;
498
+ width: 25px;
499
+ height: 25px;
500
+ }
501
+
502
+ #vNavControl_rows,
503
+ #tNavControl_rows {
504
+ width: 50px;
505
+ }
506
+
507
+ .vNavMessage,
508
+ .tNavMessage {
509
+ text-align: right;
510
+ float: right;
511
+ padding-right:20px;
512
+ }
513
+ .vNavMessage span,
514
+ .tNavMessage span {
515
+ color: #333;
516
+ font-weight: 600;
517
+ }
518
+
519
+ .tpos {
520
+
521
+ }
522
+ .ctext {
523
+ padding:5px 20px 0 5px;
524
+ }
525
+
526
+
527
+ .loader {
528
+ background-image:url('images/loader.gif');
529
+ background-repeat:no-repeat;
530
+ background-position:center center;
531
+ }
532
+
533
+
534
+ #tNavControl_rows {
535
+ padding: 3px 5px;
536
+ }
537
+
538
+
539
+
540
+
541
+ #libraryViewerWrap {
542
+ margin:10px 0 20px 0;
543
+ }
544
+
545
+ #libraryFilesTable {
546
+ margin:0;
547
+ }
548
+
549
+
550
+ .infoBox {
551
+ background:#f6f6f6;
552
+ padding:10px 10px 5px 15px;
553
+ border:1px solid #fcfcfc;
554
+ width: 220px;
555
+ float: left;
556
+ margin: 10px 0px 0 0;
557
+ }
558
+
559
+ .settingsBox {
560
+ float: left;
561
+ padding:15px 10px 0px 0px;
562
+ width:475px;
563
+ margin: 0 50px 0 0;
564
+ }
565
+
566
+
567
+ .infoBox ul {
568
+ margin: 0 0 20px 0;
569
+ }
570
+
571
+
572
 
573
+ div.wrap .infoBox h4 { font-size:14px; margin:0 0 10px 0; }
574
+
575
+ .mainTick {
576
+ font-size: 14px;
577
+ }
578
+
579
+ .mainTick .label {
580
+ }
581
+
582
+
583
+ div.wrap p.infoLinks {
584
+ margin: 0 0 0px 0;
585
+ font-weight: 600;
586
+ font-size: 13px;
587
+ }
588
+
589
+
590
+ div.underline {
591
+ border-bottom:1px solid #ccc;
592
+ margin-bottom: 20px;
593
+ }
594
+
595
+
596
+
597
+ .moreinfo {
598
+ margin-bottom:20px;
599
+ }
600
+
601
+
602
+ .halfBox {
603
+ float:left;
604
+ width:430px;
605
+ }
606
 
607
 
608
 
609
+ .dSettingsTable {}
610
+ .dSettingsTable td {
611
+ padding: 0px 10px 6px 0px;
612
+
613
+ }
614
+
615
+ .mainSettingsTable {}
616
+ .mainSettingsTable td {
617
+ padding: 5px 10px 10px 10px;
618
+
619
+ }
620
+
621
+
622
+ .popoutSettingsTable {}
623
+ .popoutSettingsTable td {
624
+ padding: 5px 10px 10px 0px;
625
+
626
+ }
627
+
628
+ .advancedSettingsTable {}
629
+ .advancedSettingsTable td {
630
+ padding: 0px 15px 10px 0px;
631
+ }
632
+
633
+ .playerSettingsTable {}
634
+ .playerSettingsTable td {
635
+ padding: 0px 15px 7px 0px;
636
+ }
637
+
638
+
639
+ div.wrap p.advancedP {
640
+ font-size:15px;
641
+ font-weight:500;
642
+ margin-bottom:20px;
643
+ }
644
+
645
+ .padB {
646
+ padding-bottom:15px;
647
+ }
648
+
649
+
650
+
651
+ .form-table td .notice p,
652
+ .notice p,
653
+ div.error p,
654
+ div.updated p {
655
+ margin: .5em 0;
656
+ padding: 2px;
657
+ }
658
+
659
+
660
+
661
+ .psHeight {
662
+ height: 30px;
663
+ }
664
+
665
+ .ps2Height {
666
+ height: 50px;
667
+ }
668
+
669
+ .slimButton {
670
+ background:#f7f7f7;
671
+ padding:1px 12px 2px 10px;
672
+ border: 1px solid #ccc;
673
+ border-radius: 2px; -moz-border-radius: 2px; -webkit-border-radius: 2px;
674
+ -webkit-box-shadow: inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);
675
+ box-shadow: inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);
676
+ font-style: italic;
677
+ font-size:13px;
678
+ font-weight:600;
679
+ }
680
+
681
+
682
 
683
  /* ----- */
684
  @media screen and (max-width: 1250px) {
css/admin/images/loader.gif ADDED
Binary file
download.php CHANGED
@@ -1,94 +1,143 @@
1
  <?php
2
  /*
3
- MP3-jPlayer 2.0
4
- www.sjward.org
 
 
5
  */
6
 
7
- function strip_scripts ( $field )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  {
9
  $search = array(
10
- '@<script[^>]*?>.*?</script>@si', // Strip out javascript
11
- '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly
12
- '@<![\s\S]*?--[ \t\n\r]*>@' // Strip multi-line comments including CDATA
 
 
13
  );
14
-
15
  $text = preg_replace( $search, '', $field );
16
  return $text;
17
  }
18
 
19
 
20
 
21
- $mp3 = false;
22
- $playerID = "";
23
- $fp = "";
24
- $file = "";
25
- $dbug = "";
26
- $sent = "";
27
- $pagetext = '';
28
- $js_pagetext = '';
29
- $rooturl = preg_replace("/^www\./i", "", $_SERVER['HTTP_HOST']);
30
 
 
 
 
 
 
 
 
31
 
32
 
33
  if ( isset($_GET['mp3']) ) {
34
-
35
 
36
- $mp3 = strip_tags($_GET['mp3']);
37
- $mp3 = rawurldecode( $mp3 );
38
- $mp3 = strip_scripts( $mp3 );
39
 
 
 
 
 
 
 
 
 
 
 
 
40
  $playerID = ( isset($_GET['pID']) ) ? strip_tags($_GET['pID']) : "";
41
- $playerID = strip_scripts( $playerID );
 
 
 
 
 
42
 
 
43
  $matches = array();
44
- if ( preg_match("!\.(mp3|mp4|m4a|ogg|oga|wav|webm)$!i", $mp3, $matches) ) {
 
45
 
 
46
  $fileExtension = $matches[0];
47
  if ( $fileExtension === 'mp3' || $fileExtension === 'mp4' || $fileExtension === 'm4a' ) {
48
  $mimeType = 'audio/mpeg';
49
- }
50
- elseif( $fileExtension === 'ogg' || $fileExtension === 'oga' ) {
51
  $mimeType = 'audio/ogg';
52
- }
53
- else {
54
  $mimeType = 'audio/' . ( str_replace('.', '', $fileExtension) );
55
  }
56
 
57
 
58
- $sent = substr($mp3, 3);
59
- $file = substr(strrchr($sent, "/"), 1);
60
 
61
- if ( ($lp = strpos($sent, $rooturl)) || preg_match("!^/!", $sent) ) { //if local
62
-
63
- if ( $lp !== false ) { //url
64
-
 
 
65
  $fp = str_replace($rooturl, "", $sent);
66
  $fp = str_replace("www.", "", $fp);
67
  $fp = str_replace("http://", "", $fp);
68
  $fp = str_replace("https://", "", $fp);
69
-
70
- } else { //folder path
71
-
72
  $fp = $sent;
73
  }
74
 
75
- if ( ($fsize = @filesize($_SERVER['DOCUMENT_ROOT'] . $fp)) !== false ) { //if file can be read then set headers and cookie
 
 
 
 
 
 
 
 
 
 
76
 
 
77
  header('Content-Type: ' . $mimeType);
78
  $cookiename = 'mp3Download' . $playerID;
79
  setcookie($cookiename, "true", 0, '/', '', '', false);
80
  header('Accept-Ranges: bytes'); // download resume
81
  header('Content-Disposition: attachment; filename=' . $file);
82
-
83
  header('Content-Length: ' . $fsize);
84
 
85
- readfile($_SERVER['DOCUMENT_ROOT'] . $fp);
86
-
87
 
88
- $dbug .= "#read failed"; //if past readfile() then something went wrong
 
89
 
90
  } else {
91
-
92
  $dbug .= "#no file";
93
  }
94
 
@@ -114,32 +163,16 @@ if ( isset($_GET['mp3']) ) {
114
  <title>Download Audio</title>
115
  </head>
116
  <body>
117
-
118
  <?php
119
- echo $js_pagetext;
120
- $info = "<p>
121
- Get: " . $mp3 . "<br />
122
- Sent: " . $sent . "<br />
123
- File: " . $file . "<br />
124
- Open: " . $_SERVER['DOCUMENT_ROOT'] . $fp . "<br />
125
- Root: " . $rooturl . "<br />
126
- pID: " . $playerID . "<br />
127
- Dbug: " . $dbug . "<br />
128
- extension: " . $fileExtension . "</p>";
129
- echo $info;
130
-
131
  if ( $playerID != "" ) {
132
  ?>
133
-
134
  <script type="text/javascript">
135
  if ( typeof window.parent.MP3_JPLAYER.dl_dialogs !== 'undefined' ) {
136
  window.parent.MP3_JPLAYER.dl_dialogs[<?php echo $playerID; ?>] = window.parent.MP3_JPLAYER.vars.message_fail;
137
  }
138
  </script>
139
-
140
  <?php
141
  }
142
  ?>
143
-
144
  </body>
145
- </html>
1
  <?php
2
  /*
3
+ * Local Downloader
4
+ * MP3-jPlayer 2.5
5
+ * http://mp3-jplayer.com
6
+ * ---
7
  */
8
 
9
+
10
+ //~~~ Flag
11
+ function checkCharsOK ( $string )
12
+ {
13
+ $badChars = 0;
14
+ $charArray = str_split( $string );
15
+
16
+ if ( is_array( $charArray ) ) {
17
+ foreach ( $charArray as $char ) {
18
+ $ascii = ord( $char );
19
+ if ( 0 === $ascii ) { //null bytes
20
+ $badChars += 1;
21
+ }
22
+ }
23
+ } else {
24
+ $badChars += 1;
25
+ }
26
+ return ( $badChars === 0 ? true : false );
27
+ }
28
+
29
+
30
+ //~~~ Clean
31
+ function stripScripts ( $field )
32
  {
33
  $search = array(
34
+ '@<script[^>]*?>.*?</script>@si', // Javascript
35
+ '@<style[^>]*?>.*?</style>@siU', // Style tags
36
+ '@<![\s\S]*?--[ \t\n\r]*>@', // Multi-line comments including CDATA
37
+ '@%00@', // Null bytes
38
+ '@\.\.@' // Traversals
39
  );
 
40
  $text = preg_replace( $search, '', $field );
41
  return $text;
42
  }
43
 
44
 
45
 
46
+ // Start ~~~~~~~~~~~~~~~~~~~~~~
 
 
 
 
 
 
 
 
47
 
48
+ $dbug = "";
49
+ $sent = "";
50
+ $mp3 = false;
51
+ $playerID = "";
52
+ $fp = "";
53
+ $file = "";
54
+ $rooturl = preg_replace("/^www\./i", "", $_SERVER['HTTP_HOST']);
55
 
56
 
57
  if ( isset($_GET['mp3']) ) {
 
58
 
 
 
 
59
 
60
+ // Clean the url/path
61
+ $mp3 = strip_tags($_GET['mp3']);
62
+ $mp3 = rawurldecode( $mp3 );
63
+ $mp3 = stripScripts( $mp3 );
64
+ $sent = substr($mp3, 3);
65
+ if ( ! checkCharsOK( $sent ) ) {
66
+ die();
67
+ }
68
+
69
+
70
+ // Clean player ID
71
  $playerID = ( isset($_GET['pID']) ) ? strip_tags($_GET['pID']) : "";
72
+ $playerID = stripScripts( $playerID );
73
+ $playerID = preg_replace( '![^0-9]!', '', $playerID );
74
+ if ( $playerID == '' ) {
75
+ die();
76
+ }
77
+
78
 
79
+ // Check it's a valid file type
80
  $matches = array();
81
+ if ( preg_match("!\.(mp3|mp4|m4a|ogg|oga|wav|webm)$!i", $mp3, $matches) )
82
+ {
83
 
84
+ // Decide the mime type
85
  $fileExtension = $matches[0];
86
  if ( $fileExtension === 'mp3' || $fileExtension === 'mp4' || $fileExtension === 'm4a' ) {
87
  $mimeType = 'audio/mpeg';
88
+ } elseif( $fileExtension === 'ogg' || $fileExtension === 'oga' ) {
 
89
  $mimeType = 'audio/ogg';
90
+ } else {
 
91
  $mimeType = 'audio/' . ( str_replace('.', '', $fileExtension) );
92
  }
93
 
94
 
95
+ // Get the file's name
96
+ $file = substr( strrchr( $sent, "/" ), 1 );
97
 
98
+
99
+ // Check that the file is locally hosted
100
+ if ( ($lp = strpos($sent, $rooturl)) || preg_match("!^/!", $sent) )
101
+ {
102
+ if ( $lp !== false ) {
103
+ // It's url format, prep as path
104
  $fp = str_replace($rooturl, "", $sent);
105
  $fp = str_replace("www.", "", $fp);
106
  $fp = str_replace("http://", "", $fp);
107
  $fp = str_replace("https://", "", $fp);
108
+ } else {
109
+ // It's a path already
 
110
  $fp = $sent;
111
  }
112
 
113
+
114
+ // Bail if path to the file is not valid
115
+ $realPath = realpath( $_SERVER['DOCUMENT_ROOT'] . $fp );
116
+ if ( $realPath === false ) {
117
+ die();
118
+ }
119
+
120
+
121
+ // Try to send file
122
+ $fsize = @filesize( $realPath );
123
+ if ( $fsize !== false ) {
124
 
125
+ //set headers and cookie
126
  header('Content-Type: ' . $mimeType);
127
  $cookiename = 'mp3Download' . $playerID;
128
  setcookie($cookiename, "true", 0, '/', '', '', false);
129
  header('Accept-Ranges: bytes'); // download resume
130
  header('Content-Disposition: attachment; filename=' . $file);
 
131
  header('Content-Length: ' . $fsize);
132
 
133
+ //Send the file
134
+ readfile( $realPath );
135
 
136
+ //If past readfile() then something went wrong
137
+ $dbug .= "#read failed";
138
 
139
  } else {
140
+
141
  $dbug .= "#no file";
142
  }
143
 
163
  <title>Download Audio</title>
164
  </head>
165
  <body>
 
166
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
167
  if ( $playerID != "" ) {
168
  ?>
 
169
  <script type="text/javascript">
170
  if ( typeof window.parent.MP3_JPLAYER.dl_dialogs !== 'undefined' ) {
171
  window.parent.MP3_JPLAYER.dl_dialogs[<?php echo $playerID; ?>] = window.parent.MP3_JPLAYER.vars.message_fail;
172
  }
173
  </script>
 
174
  <?php
175
  }
176
  ?>
 
177
  </body>
178
+ </html>
frontend.php CHANGED
@@ -5,6 +5,10 @@ class MP3j_Front extends MP3j_Main {
5
 
6
  function onInit () {
7
  $this->SKINS = $this->getSkinData();
 
 
 
 
8
  }
9
 
10
  function onAdminInit () {
@@ -47,11 +51,6 @@ class MP3j_Front extends MP3j_Main {
47
  }
48
 
49
 
50
-
51
-
52
-
53
-
54
-
55
  function addPluginListLink( $links, $file ) {
56
  if ( $file == 'mp3-jplayer/mp3jplayer.php' ) {
57
  $settings_link = '<a href="admin.php?page=mp3-jplayer">'.__('Settings').'</a>';
@@ -122,7 +121,6 @@ class MP3j_Front extends MP3j_Main {
122
  add_shortcode( 'popout', array( $this, 'popout_link_player' ) );
123
  add_shortcode( 'mp3-popout', array( $this, 'popout_link_player' ) );
124
 
125
-
126
  if ( $ops['replace_WP_playlist'] === 'true' && ! is_admin() ) {
127
  remove_shortcode( 'playlist' );
128
  add_shortcode( 'playlist', array( $this, 'replacePlaylistShortcode ') );
@@ -138,47 +136,13 @@ class MP3j_Front extends MP3j_Main {
138
  //TODO
139
  function registerTagCallbacks ()
140
  {
141
- $ops = $this->theSettings;
142
-
143
- add_action( 'mp3j_addscripts', array( $this, 'scripts_tag_handler' ), 1, 1 );
144
- add_action( 'mp3j_put', array( $this, 'template_tag_handler' ), 10, 1 );
145
- add_action( 'mp3j_debug', array( $this, 'debug_info' ), 10, 1 );
146
- add_filter( 'mp3j_grab_library', array( $this, 'grablibrary_handler' ), 10, 1 );
147
- add_action( 'mp3j_settings', array( $this, 'mp3j_settings' ), 1, 1 );
148
-
149
- /*
150
- * should use this conditional but it means that as page loads up players initially appear unstyled (aren't styled until
151
- * last minute) TODO:enqueue style in header when poss.
152
- * always run both hooks for the mo.
153
- */
154
- //$WPversion = substr( get_bloginfo('version'), 0, 3);
155
- //if ( $WPversion < 3.3 ) {
156
- add_action('wp_head', array( $this, 'header_scripts_handler' ), 2); //Support for WP versions below 3.3
157
- //}
158
- add_action('wp_footer', array( $this, 'checkAddScripts' ), 1); //Final chance to enqueue, process this action early (priority < 20).
159
- add_action('wp_footer', array( $this, 'footercode_handler' ), 200); //Add any inline js, process this action late (enqueues fire at priority 20).
160
-
161
- add_filter('get_the_excerpt', array( $this, 'get_excerpt_handler' ), 1);
162
- add_filter('the_content', array( $this, 'afterExcerpt' ), 9999);
163
-
164
- if ( $ops['make_player_from_link'] == "true" ) {
165
- add_filter('the_content', array( $this, 'replace_links' ), 1);
166
- }
167
- if ( $ops['run_shcode_in_excerpt'] == "true" ) {
168
- add_filter( 'the_excerpt', 'shortcode_unautop' );
169
- add_filter( 'the_excerpt', 'do_shortcode' );
170
- }
171
  }
172
 
173
 
174
 
175
 
176
-
177
- /** Returns library via template tag mp3j_grab_library(). */
178
-
179
-
180
-
181
 
 
182
  function createAdminPages ()
183
  {
184
  /*
@@ -227,19 +191,53 @@ class MP3j_Front extends MP3j_Main {
227
  'mp3-jplayer-welcome',
228
  'drawSplashScreen_mp3j'
229
  );
230
-
231
  }
232
 
233
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
234
 
235
 
236
-
237
-
238
-
239
-
240
-
241
-
242
-
 
 
 
 
 
 
 
 
 
 
243
 
244
 
245
  /**
@@ -311,6 +309,10 @@ class MP3j_Front extends MP3j_Main {
311
  $JS .= "\n\t\tMP3_JPLAYER.vars.dl_remote_path = '" . $O['dloader_remote_path'] . "';";
312
  }
313
 
 
 
 
 
314
  $showErrors = $O['showErrors'];
315
  if ( $showErrors === 'admin' ) {
316
  $showErrors = ( current_user_can( 'manage_options' ) ) ? 'true' : 'false';
@@ -321,94 +323,88 @@ class MP3j_Front extends MP3j_Main {
321
  $JS .= "\n\t}";
322
  $JS .= "\n});\n</script>\n";
323
  echo $JS;
324
- }
325
-
326
-
327
-
328
- if ( $this->setup['cssHead'] === true ) {
329
- echo $this->writeColoursCSS();
330
- }
331
-
332
 
333
-
334
-
335
- $CSS = "\n\n";
336
- if ( $O['mp3tColour_on'] === 'true' )
337
- {
338
- $CSS .= "\n<style>\n";
339
-
340
- $CSS .= "\n
341
- span.textbutton_mp3j {
342
- color:" . $O['mp3tColour'] . ";
343
- }
344
- span.vol_mp3t .ui-slider-handle,
345
- span.vol_mp3t .ui-slider-handle:hover,
346
- span.posbar_mp3j .ui-slider-handle,
347
- span.posbar_mp3j .ui-slider-handle:hover,
348
- .load_mp3j,
349
- .s-text .Smp3-tint {
350
- background-color:" . $O['mp3tColour'] . ";
351
- border-color:" . $O['mp3tColour'] . ";
352
- }
353
- .s-text .Smp3-tint {
354
- opacity:0.4;
355
- filter:alpha(opacity=40);
356
- }
357
- .s-text .Smp3-finding,
358
- .s-text .mp3-gtint,
359
- .load_mp3j {
360
- opacity:0.25;
361
- filter:alpha(opacity=25);
362
- }
363
- span.posbar_mp3j .ui-slider-handle,
364
- span.posbar_mp3j .ui-slider-handle:hover {
365
- background:rgba(" . $this->hexToRGB ( $O['mp3tColour'], true ) . ",0.3);
366
- border-color:" . $O['mp3tColour'] . ";
367
- }";
368
 
369
- $CSS .= "\n</style>\n";
370
- }
371
-
372
- if ( $O['mp3jColour_on'] === 'true' )
373
- {
374
- $CSS .= "\n<style>\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
375
 
376
- $CSS .= "
377
- span.gfxbutton_mp3j.play-mjp,
378
- span.gfxbutton_mp3j.pause-mjp,
379
- span.gfxbutton_mp3j.play-mjp:hover,
380
- span.gfxbutton_mp3j.pause-mjp:hover,
381
- span.vol_mp3j .ui-slider-handle,
382
- span.vol_mp3j .ui-slider-handle:hover,
383
- span.posbarB_mp3j .ui-slider-handle,
384
- span.posbarB_mp3j .ui-slider-handle:hover,
385
- .loadB_mp3j,
386
- .s-graphic .Smp3-tint {
387
- background-color:" . $O['mp3jColour'] . ";
388
- border-color:" . $O['mp3jColour'] . ";
389
- }
390
- .s-graphic .Smp3-tint {
391
- opacity:0.4;
392
- filter:alpha(opacity=40);
393
- }
394
- .s-graphic .Smp3-finding,
395
- .s-graphic .mp3-gtint,
396
- .loadB_mp3j {
397
- opacity:0.25;
398
- filter:alpha(opacity=25);
399
- }
400
- span.posbarB_mp3j .ui-slider-handle,
401
- span.posbarB_mp3j .ui-slider-handle:hover {
402
- background:rgba(" . $this->hexToRGB ( $O['mp3jColour'], true ) . ",0.3);
403
- border-color:" . $O['mp3jColour'] . ";
404
- }";
 
 
 
 
 
 
 
405
 
406
- $CSS .= "\n</style>\n";
407
  }
408
 
409
- echo $CSS;
410
-
411
-
412
  // Write debug
413
  if ( $O['echo_debug'] == "true" ) {
414
  $this->debug_info();
@@ -425,23 +421,21 @@ class MP3j_Front extends MP3j_Main {
425
  $listJS = '';
426
 
427
  global $post;
428
- $currentID = $post->ID;
429
  if ( $currentID !== $this->currentID ) {
430
  $this->S_arb = 1;
431
  $this->currentID = $currentID;
432
  }
433
- //$this->S_arb = ( $currentID === $this->currentID ) ? $this->S_arb : 1;
434
 
435
  if ( $ids !== '' ) //came via [audio] shortcode, has 1 attachment
436
  {
437
- //$TRACKS = $this->IDsToTracks( $ids, 'false' );
438
  $TRACKS = $this->IDsToTracks( $ids, 'true' );
439
  if ( ! $TRACKS ) {
440
  return false;
441
  }
442
  $track = 1;
443
  $playername = "inline_" . $this->S_no++;
444
- //TODO: track numbering issue
445
  $trackNumber = ( $this->theSettings['add_track_numbering'] == "true" ) ? $this->S_arb . '. ' : '';
446
  $listJS = $this->writePlaylistJS( $TRACKS, $playername, $this->S_arb++ );
447
  }
@@ -454,7 +448,7 @@ class MP3j_Front extends MP3j_Main {
454
  }
455
  $track = ++$this->S_autotrack;
456
  $playername = $this->F_listname;
457
- //TODO: track numbering issue
458
  $trackNumber = ( $this->theSettings['add_track_numbering'] == "true" ) ? $track . '. ' : '';
459
  $TRACKS = $this->F_LISTS[ $playername ];
460
  }
@@ -464,7 +458,7 @@ class MP3j_Front extends MP3j_Main {
464
  return false;
465
  }
466
  $playername = $this->F_listname;
467
- //TODO: track numbering issue
468
  $trackNumber = ( $this->theSettings['add_track_numbering'] == "true" ) ? $track . '. ' : '';
469
  $TRACKS = $this->F_LISTS[ $playername ];
470
  }
@@ -476,7 +470,7 @@ class MP3j_Front extends MP3j_Main {
476
  }
477
  $track = 1;
478
  $playername = "inline_" . $this->S_no++;
479
- //TODO: track numbering issue
480
  $trackNumber = ( $this->theSettings['add_track_numbering'] == "true" ) ? $this->S_arb . '. ' : '';
481
  $listJS = $this->writePlaylistJS( $TRACKS, $playername, $this->S_arb++ );
482
  }
@@ -524,7 +518,6 @@ class MP3j_Front extends MP3j_Main {
524
  return;
525
  }
526
 
527
-
528
  $C = $this->theSettings['colour_settings'];
529
  $id = $this->Player_ID;
530
 
@@ -535,7 +528,6 @@ class MP3j_Front extends MP3j_Main {
535
  $divC = "</span>";
536
  $b = "";
537
  if ( $flow == "n" || $this->Caller == "widget" ) {
538
- //$divO = ( $cssclass == "" ) ? '<div id="mp3jWrap_' . $id. '" class="mjp-s-wrapper s-text unsel-mjp' . $font1Class . '" style="font-size:' .$fontsize. ';">' : '<div id="mp3jWrap_' . $id. '" class="unsel-mjp ' . $cssclass . $font1Class . '" style="font-size:' .$fontsize. ';">';
539
  $divO = '<div id="mp3jWrap_' . $id. '" class="mjp-s-wrapper s-text unsel-mjp ' . $cssclass . $font1Class . '" style="font-size:' .$fontsize. ';">';
540
  $divC = "</div>";
541
  }
@@ -576,7 +568,6 @@ class MP3j_Front extends MP3j_Main {
576
  $errorMsg = "<span class=\"s-nosolution\" id=\"mp3j_nosolution_" . $id . "\" style=\"display:none;\"></span>";
577
 
578
  // Assemble them
579
- //$html = ( $flip != "l" ) ? $openWrap . $pos . $title_h . $spacer . $play_h . $closeWrap . $errorMsg : $openWrap . $pos . $play_h . $spacer . $title_h . $closeWrap . $errorMsg;
580
  $html = ( $flip != "false" ) ? $openWrap . $pos . $title_h . $spacer . $play_h . $closeWrap . $errorMsg : $openWrap . $pos . $play_h . $spacer . $title_h . $closeWrap . $errorMsg;
581
 
582
  // Add info to js info array
@@ -586,7 +577,6 @@ class MP3j_Front extends MP3j_Main {
586
 
587
  $this->defineJSvars();
588
  $playerInfo = "{ list: MP3jPLAYLISTS." . $tn['playername'] . ", tr: " . ($tn['track']-1) . ", type: 'single', lstate: '', loop: " . $loop . ", play_txt: '" . $play . "', pause_txt: '" . $stop . "', pp_title: '', autoplay:" . $autoplay . ", download:" . $dload . ", vol: " . $vol . ", height: '' }";
589
- //$playerJS = "<script>MP3jPLAYERS.push(" . $playerInfo . ");</script>";
590
  $playerJS = "<script>MP3jPLAYERS[" .$id. "] = " . $playerInfo . ";</script>";
591
 
592
  $this->dbug['str'] .= "\nOK (id " . $this->Player_ID . ")";
@@ -625,9 +615,7 @@ class MP3j_Front extends MP3j_Main {
625
  $this->dbug['str'] .= "\nExiting (no track here)";
626
  return;
627
  }
628
-
629
-
630
-
631
  $C = $this->theSettings['colour_settings'];
632
  $id = $this->Player_ID;
633
 
@@ -638,7 +626,6 @@ class MP3j_Front extends MP3j_Main {
638
  $divC = "</span>";
639
  $b = "";
640
  if ( $flow == "n" || $this->Caller == "widget" ) {
641
- //$divO = ( $cssclass == "" ) ? '<div id="mp3jWrap_' . $id. '" class="mjp-s-wrapper s-graphic unsel-mjp' . $font1Class . '" style="font-size:' .$fontsize. ';">' : '<div id="mp3jWrap_' . $id. '" class="unsel-mjp ' . $cssclass . $font1Class . '" style="font-size:' .$fontsize. ';">';
642
  $divO = '<div id="mp3jWrap_' . $id. '" class="mjp-s-wrapper s-graphic unsel-mjp ' . $cssclass . $font1Class . '" style="font-size:' .$fontsize. ';">';
643
  $divC = "</div>";
644
  }
@@ -660,12 +647,10 @@ class MP3j_Front extends MP3j_Main {
660
  }
661
 
662
  // Make id'd span elements
663
- //$flippedcss = ( $flip == "r" ) ? "" : " flipped";
664
  $flippedcss = ( $flip == "false" ) ? "" : " flipped";
665
  $openWrap = $divO . "<span id=\"playpause_wrap_mp3j_" . $id . "\" class=\"wrap_inline_mp3j\"" . $b . ">";
666
  $vol_h = ( $volslider == 'true' || $volslider == 'y' || $volslider == 'Y' ) ? "<span class=\"vol_mp3j" . $flippedcss . "\" id=\"vol_mp3j_" . $id . "\"></span>" : "";
667
  $pos = "<span class=\"bars_mp3j\"><span class=\"loadB_mp3j\" id=\"load_mp3j_" . $id . "\"></span><span class=\"posbarB_mp3j\" id=\"posbar_mp3j_" . $id . "\"></span></span>";
668
- //$play_h = "<span class=\"play-mjp\" id=\"playpause_mp3j_" . $id . "\">&nbsp;</span>";
669
  $play_h = "<span class=\"gfxbutton_mp3j play-mjp\" id=\"playpause_mp3j_" . $id . "\" style=\"font-size:" .$fontsize. ";\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>";
670
  $spacer = "";
671
 
@@ -673,7 +658,6 @@ class MP3j_Front extends MP3j_Main {
673
  $indi_h = ( $ind != "y" ) ? "<span style=\"display:none;\" id=\"statusMI_" . $id . "\"></span>" : "<span class=\"indi_mp3j\" style=\"font-size:" .(intval($fontsize)*0.7) . "px;\" id=\"statusMI_" . $id . "\"></span>";
674
  $errorMsg = "<span class=\"s-nosolution\" id=\"mp3j_nosolution_" . $id . "\" style=\"display:none;\"></span>";
675
  // Assemble them
676
- //$html = ( $flip == "r" ) ? $openWrap . "<span class=\"group_wrap\">" . $pos . $title_h . $indi_h . "</span>" . $play_h . $vol_h . "</span>" . $divC . $errorMsg : $openWrap . $play_h . "&nbsp;<span class=\"group_wrap\">" . $pos . $title_h . $indi_h . "</span>" . $vol_h . "</span>" . $divC . $errorMsg;
677
  $html = ( $flip == "false" ) ? $openWrap . "<span class=\"group_wrap\">" . $pos . $title_h . $indi_h . "</span>" . $play_h . $vol_h . "</span>" . $divC . $errorMsg : $openWrap . $play_h . "&nbsp;<span class=\"group_wrap\">" . $pos . $title_h . $indi_h . "</span>" . $vol_h . "</span>" . $divC . $errorMsg;
678
 
679
  // Add info to js info array
@@ -683,7 +667,6 @@ class MP3j_Front extends MP3j_Main {
683
 
684
  $this->defineJSvars();
685
  $playerInfo = "{ list: MP3jPLAYLISTS." . $tn['playername'] . ", tr:" . ($tn['track']-1) . ", type:'single', lstate:'', loop:" . $loop . ", play_txt:'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', pause_txt:'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', pp_title:'', autoplay:" . $autoplay . ", download:" . $dload . ", vol:" . $vol . ", height:'' }";
686
- //$playerJS = "<script>MP3jPLAYERS.push(" . $playerInfo . ");</script>";
687
  $playerJS = "<script>MP3jPLAYERS[" .$id. "] = " . $playerInfo . ";</script>";
688
 
689
  $this->dbug['str'] .= "\nOK (id " . $this->Player_ID . ")";
@@ -701,8 +684,6 @@ class MP3j_Front extends MP3j_Main {
701
  $imageInfo = wp_get_attachment_image_src( $thumb_id, $size );
702
  $url = $imageInfo[0];
703
  } else {
704
- //$url = wp_mime_type_icon( $postID ); //default WP image
705
- //$url = $this->PluginFolder . '/css/images/music-default-2.png';
706
  $url = 'false';
707
  }
708
  return $url;
@@ -928,7 +909,6 @@ class MP3j_Front extends MP3j_Main {
928
  $output = $this->primary_player( $attr, $content );
929
  }
930
  }
931
- //return ( $i > 1 ? $this->primary_player( $attr, $content ) : $this->inline_play_graphic( $attr ) );
932
  return $output;
933
  }
934
 
@@ -976,7 +956,6 @@ class MP3j_Front extends MP3j_Main {
976
  if ( ! isset( $attr['captions'] ) ) {
977
  $attr['captions'] = ( isset($attr['artists']) && $attr['artists'] === 'false' ) ? false : '';
978
  }
979
- //$attr['images'] = ( isset($attr['images']) && $attr['images'] === 'false' ) ? '' : 'true';
980
  $attr['images'] = ( !isset($attr['images']) ) ? 'true' : $attr['images'];
981
  $attr['text'] = ( ! empty($attr['title']) && empty($attr['text']) ) ? $attr['title'] : ( empty($attr['text']) ? '' : $attr['text'] ); //popout link text
982
 
@@ -995,14 +974,12 @@ class MP3j_Front extends MP3j_Main {
995
  return;
996
  }
997
 
998
-
999
  $O = $this->theSettings;
1000
  $pID = $this->Player_ID;
1001
 
1002
  $defaults = $this->playerDefaultParams( 'playlist' );
1003
  $ATTS = shortcode_atts( $defaults, $atts );
1004
 
1005
-
1006
  //Alias params
1007
  if ( $ATTS['tracks'] == '' && $ATTS['track'] != '' ) {
1008
  $ATTS['tracks'] = $ATTS['track'];
@@ -1012,7 +989,6 @@ class MP3j_Front extends MP3j_Main {
1012
  }
1013
  $ATTS['userClasses'] = $O['colour_settings']['userClasses'] . ' ' . $ATTS['style'];
1014
 
1015
-
1016
  //Try build a playlist
1017
  $TRACKS = $this->decide_M_playlist( $ATTS );
1018
  if ( !$TRACKS ) {
@@ -1029,7 +1005,6 @@ class MP3j_Front extends MP3j_Main {
1029
  $trnum = 0;
1030
  $pp_height = (int)$ATTS['height'];
1031
  $pp_height = ( empty($pp_height) || $pp_height === 0 ) ? 'false' : $pp_height;
1032
- //$play = "#USE_G#";
1033
  $pp_title = ( $ATTS['title'] == "" ) ? get_bloginfo('name') : $ATTS['title'] . " | " . get_bloginfo('name');
1034
  $pp_title = str_replace("'", "\'", $pp_title);
1035
  $pp_title = str_replace("&#039;", "\'", $pp_title);
@@ -1062,7 +1037,6 @@ class MP3j_Front extends MP3j_Main {
1062
  $ATTS['autoplay'] = ( $ATTS['autoplay'] == "true" || $ATTS['autoplay'] == "y" || $ATTS['autoplay'] == "1" ) ? "true" : "false";
1063
  $ATTS['loop'] = ( $ATTS['loop'] == "true" || $ATTS['loop'] == "y" || $ATTS['loop'] == "1" ) ? "true" : "false";
1064
 
1065
-
1066
  //Make transport buttons
1067
  $ATTS['prevnext'] = ( $ATTS['trackCount'] > 1 && $ATTS['pn'] == "y" ) ? "<div class=\"next-mjp\" id=\"Next_mp3j_" . $pID . "\">Next&raquo;</div><div class=\"prev-mjp\" id=\"Prev_mp3j_" . $pID . "\">&laquo;Prev</div>" : "";
1068
  $ATTS['play_h'] = "<div class=\"play-mjp\" id=\"playpause_mp3j_" . $pID . "\">Play</div>";
@@ -1074,9 +1048,7 @@ class MP3j_Front extends MP3j_Main {
1074
 
1075
  //js player info
1076
  $popoutcss = ( $this->setup['cssPopout'] === true ) ? "{ enabled:true, " .$player['js']. "}" : "{ enabled:false, " .$player['js']. "}";
1077
- //$playerInfo = "{ list:MP3jPLAYLISTS." .$PlayerName. ", tr:" .$trnum. ", type:'MI', lstate:" .$ATTS['list']. ", loop:" .$ATTS['loop']. ", play_txt:'Play', pause_txt:'Pause', pp_title:'" .$pp_title. "', autoplay:" .$ATTS['autoplay']. ", download:" .$dload_info. ", vol:" .$ATTS['vol']. ", height:" .$pp_height. ", cssclass:'" .$ATTS['userClasses']. "', popout_css:{" .$player['js']. "} }";
1078
  $playerInfo = "{ list:MP3jPLAYLISTS." .$PlayerName. ", tr:" .$trnum. ", type:'MI', lstate:" .$ATTS['list']. ", loop:" .$ATTS['loop']. ", play_txt:'Play', pause_txt:'Pause', pp_title:'" .$pp_title. "', autoplay:" .$ATTS['autoplay']. ", download:" .$dload_info. ", vol:" .$ATTS['vol']. ", height:" .$pp_height. ", cssclass:'" .$ATTS['userClasses']. "', popout_css:" .$popoutcss. " }";
1079
- //$playerJS = "<script>MP3jPLAYERS.push(" . $playerInfo . ");</script>\n\n";
1080
  $playerJS = "<script>MP3jPLAYERS[" .$pID. "] = " . $playerInfo . ";</script>\n\n";
1081
 
1082
 
@@ -1105,7 +1077,6 @@ class MP3j_Front extends MP3j_Main {
1105
  $defaults = $this->playerDefaultParams( 'popout' );
1106
  $ATTS = shortcode_atts( $defaults, $atts );
1107
 
1108
-
1109
  //Alias some params
1110
  if ( $ATTS['tracks'] == '' && $ATTS['track'] != '' ) {
1111
  $ATTS['tracks'] = $ATTS['track'];
@@ -1123,21 +1094,17 @@ class MP3j_Front extends MP3j_Main {
1123
  $this->dbug['str'] .= "\nExiting (no tracks here)";
1124
  return;
1125
  }
1126
- //$trackCount = count( $TRACKS );
1127
  $ATTS['trackCount'] = count( $TRACKS );
1128
 
1129
  extract( $ATTS );
1130
- //$ATTS['cssclass'] = $ATTS['style'];
1131
 
1132
  //Make js list
1133
  $PlayerName = "popout_" . $this->M_no;
1134
  $listJS = $this->writePlaylistJS( $TRACKS, $PlayerName );
1135
 
1136
  //Make settings..
1137
- //$ATTS['cssclass'] = ( $ATTS['cssclass'] == "" ) ? "wrap-mjp" : $ATTS['cssclass'];
1138
  $pp_height = (int)$height;
1139
  $pp_height = ( empty($pp_height) || $pp_height === 0 ) ? 'false' : $pp_height;
1140
- //$play = "#USE_G#";
1141
  $pp_title = ( $title == "" ) ? get_bloginfo('name') : $title;
1142
  $pp_title = str_replace("'", "\'", $pp_title);
1143
  $pp_title = str_replace("&#039;", "\'", $pp_title);
@@ -1148,29 +1115,20 @@ class MP3j_Front extends MP3j_Main {
1148
 
1149
 
1150
  //Make player
1151
- //$image_h = ( $image == "" ) ? "<div class=\"mp3j-popout-link\"></div>" : "<img class=\"mp3j-popout-link-image\" src=\"" . $image . "\" />";
1152
- //$player = '<div class="mp3j-popout-link-wrap unsel-mjp" id="mp3j_popout_' . $pID . '">' . $image_h . '<'.$tag.'>' . $text . '</'.$tag.'></div>';
1153
  $image_h = ( $image === "" ) ? '<div class="popout-image-mjp"></div>' : '<img class="popout-image-mjp-custom" src="' . $image . '" />';
1154
  $text_h = ( $text !== "" ) ? '<div class="popout-text-mjp"><'.$tag.'>' . $text . '</'.$tag.'></div>' : '';
1155
 
1156
  $player = '<div class="popout-wrap-mjp unsel-mjp" id="mp3j_popout_' . $pID . '">';
1157
  $player .= $image_h . $text_h;
1158
- //$player .= '<br class="clearL-mjp">';
1159
  $player .= '</div>';
1160
 
1161
-
1162
- ////
1163
  $output = $this->drawPlaylistPlayer( $ATTS, true );
1164
  //js player info
1165
  $popoutcss = ( $this->setup['cssPopout'] === true ) ? "{ enabled:true, " .$output['js']. "}" : "{ enabled:false, " .$output['js']. "}";
1166
- //$playerInfo = "{ list: MP3jPLAYLISTS." . $PlayerName . ", tr:0, type:'popout', lstate:" . $list . ", loop:" . $loop . ", play_txt:'Play', pause_txt:'Pause', pp_title:'" . $pp_title . "', autoplay:" . $autoplay . ", download:" . $dload_info . ", vol:" . $vol . ", height:" . $pp_height . ", cssclass: '" . $ATTS['userClasses'] . "', popout_css:{" .$output['js']. "} }";
1167
  $playerInfo = "{ list: MP3jPLAYLISTS." . $PlayerName . ", tr:0, type:'popout', lstate:" . $list . ", loop:" . $loop . ", play_txt:'Play', pause_txt:'Pause', pp_title:'" . $pp_title . "', autoplay:" . $autoplay . ", download:" . $dload_info . ", vol:" . $vol . ", height:" . $pp_height . ", cssclass: '" . $ATTS['userClasses'] . "', popout_css:" .$popoutcss. " }";
1168
- //$playerJS = "<script>MP3jPLAYERS.push(" . $playerInfo . ");</script>\n\n";
1169
  $playerJS = "<script>MP3jPLAYERS[" .$pID. "] = " . $playerInfo . ";</script>\n\n";
1170
 
1171
-
1172
-
1173
-
1174
  //Finish up
1175
  $this->dbug['str'] .= "\nOK (id " . $this->Player_ID . ")";
1176
  $this->M_no++;
@@ -1200,7 +1158,8 @@ class MP3j_Front extends MP3j_Main {
1200
  function checkGrabFields ()
1201
  {
1202
  global $post;
1203
- if ( $post->ID != "" && $post->ID != $this->postID )
 
1204
  {
1205
  $this->postID = $post->ID;
1206
  $this->F_listname = false;
5
 
6
  function onInit () {
7
  $this->SKINS = $this->getSkinData();
8
+
9
+ if ( is_admin() ) {
10
+ add_action( 'wp_ajax_ax_mjp_liblist', 'ax_mjp_liblist' );
11
+ }
12
  }
13
 
14
  function onAdminInit () {
51
  }
52
 
53
 
 
 
 
 
 
54
  function addPluginListLink( $links, $file ) {
55
  if ( $file == 'mp3-jplayer/mp3jplayer.php' ) {
56
  $settings_link = '<a href="admin.php?page=mp3-jplayer">'.__('Settings').'</a>';
121
  add_shortcode( 'popout', array( $this, 'popout_link_player' ) );
122
  add_shortcode( 'mp3-popout', array( $this, 'popout_link_player' ) );
123
 
 
124
  if ( $ops['replace_WP_playlist'] === 'true' && ! is_admin() ) {
125
  remove_shortcode( 'playlist' );
126
  add_shortcode( 'playlist', array( $this, 'replacePlaylistShortcode ') );
136
  //TODO
137
  function registerTagCallbacks ()
138
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  }
140
 
141
 
142
 
143
 
 
 
 
 
 
144
 
145
+ //~~~~~
146
  function createAdminPages ()
147
  {
148
  /*
191
  'mp3-jplayer-welcome',
192
  'drawSplashScreen_mp3j'
193
  );
194
+
195
  }
196
 
197
 
198
+ //~~~~~
199
+ function mp3j_admin_header ()
200
+ {
201
+ wp_enqueue_script('jquery');
202
+ wp_enqueue_script('mp3jp-settings-js', $this->PluginFolder .'/js/admin/settings.2.5.js' );
203
+ wp_enqueue_script('spectrum-CP-js', $this->PluginFolder .'/js/spectrum/spectrum.js' );
204
+
205
+ wp_localize_script(
206
+ 'mp3jp-settings-js',
207
+ 'MJPajax',
208
+ array(
209
+ 'WPajaxurl' => admin_url('admin-ajax.php')
210
+ )
211
+ );
212
+
213
+
214
+
215
+ wp_enqueue_style( 'spectrum-css', plugins_url( '/css/admin/spectrum-custom.css', __FILE__ ) );
216
+ wp_enqueue_style('mp3jp-settings-css', $this->PluginFolder .'/css/admin/admin-settings.css' );
217
+ }
218
+
219
+
220
+ //~~~~~
221
+ function mp3j_admin_footer () {}
222
 
223
 
224
+ //~~~~~
225
+ function mp3j_admin_colours_header ()
226
+ {
227
+ //scripts
228
+ wp_enqueue_script('jquery');
229
+ wp_enqueue_script('jquery-ui-core');
230
+ wp_enqueue_script('jquery-ui-widget');
231
+ wp_enqueue_script('jquery-ui-mouse');
232
+ wp_enqueue_script('jquery-ui-slider');
233
+ wp_enqueue_script('jquery-ui-resizable');
234
+ wp_enqueue_script('mp3jp-colours-js', $this->PluginFolder .'/js/admin/admin-colours.js' );
235
+ wp_enqueue_script('spectrum-CP-js', $this->PluginFolder .'/js/spectrum/spectrum.js' );
236
+
237
+ //styles
238
+ wp_enqueue_style('spectrum-CP-css', $this->PluginFolder .'/css/admin/spectrum-custom.css' );
239
+ wp_enqueue_style('mp3jp-colours-css', $this->PluginFolder .'/css/admin/admin-colours.css' );
240
+ }
241
 
242
 
243
  /**
309
  $JS .= "\n\t\tMP3_JPLAYER.vars.dl_remote_path = '" . $O['dloader_remote_path'] . "';";
310
  }
311
 
312
+ if ( $O['autoResume'] == "false" ) {
313
+ $JS .= "\n\t\tMP3_JPLAYER.pickup = false;";
314
+ }
315
+
316
  $showErrors = $O['showErrors'];
317
  if ( $showErrors === 'admin' ) {
318
  $showErrors = ( current_user_can( 'manage_options' ) ) ? 'true' : 'false';
323
  $JS .= "\n\t}";
324
  $JS .= "\n});\n</script>\n";
325
  echo $JS;
 
 
 
 
 
 
 
 
326
 
327
+ if ( $this->setup['cssHead'] === true ) {
328
+ echo $this->writeColoursCSS();
329
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
330
 
331
+ $CSS = "\n\n";
332
+ if ( $O['mp3tColour_on'] === 'true' )
333
+ {
334
+ $CSS .= "\n<style>\n";
335
+
336
+ $CSS .= "\n
337
+ span.textbutton_mp3j {
338
+ color:" . $O['mp3tColour'] . ";
339
+ }
340
+ span.vol_mp3t .ui-slider-handle,
341
+ span.vol_mp3t .ui-slider-handle:hover,
342
+ span.posbar_mp3j .ui-slider-handle,
343
+ span.posbar_mp3j .ui-slider-handle:hover,
344
+ .load_mp3j,
345
+ .s-text .Smp3-tint {
346
+ background-color:" . $O['mp3tColour'] . ";
347
+ border-color:" . $O['mp3tColour'] . ";
348
+ }
349
+ .s-text .Smp3-tint {
350
+ opacity:0.4;
351
+ filter:alpha(opacity=40);
352
+ }
353
+ .s-text .Smp3-finding,
354
+ .s-text .mp3-gtint,
355
+ .load_mp3j {
356
+ opacity:0.25;
357
+ filter:alpha(opacity=25);
358
+ }
359
+ span.posbar_mp3j .ui-slider-handle,
360
+ span.posbar_mp3j .ui-slider-handle:hover {
361
+ background:rgba(" . $this->hexToRGB ( $O['mp3tColour'], true ) . ",0.3);
362
+ border-color:" . $O['mp3tColour'] . ";
363
+ }";
364
+
365
+ $CSS .= "\n</style>\n";
366
+ }
367
 
368
+ if ( $O['mp3jColour_on'] === 'true' )
369
+ {
370
+ $CSS .= "\n<style>\n";
371
+
372
+ $CSS .= "
373
+ span.gfxbutton_mp3j.play-mjp,
374
+ span.gfxbutton_mp3j.pause-mjp,
375
+ span.gfxbutton_mp3j.play-mjp:hover,
376
+ span.gfxbutton_mp3j.pause-mjp:hover,
377
+ span.vol_mp3j .ui-slider-handle,
378
+ span.vol_mp3j .ui-slider-handle:hover,
379
+ span.posbarB_mp3j .ui-slider-handle,
380
+ span.posbarB_mp3j .ui-slider-handle:hover,
381
+ .loadB_mp3j,
382
+ .s-graphic .Smp3-tint {
383
+ background-color:" . $O['mp3jColour'] . ";
384
+ border-color:" . $O['mp3jColour'] . ";
385
+ }
386
+ .s-graphic .Smp3-tint {
387
+ opacity:0.4;
388
+ filter:alpha(opacity=40);
389
+ }
390
+ .s-graphic .Smp3-finding,
391
+ .s-graphic .mp3-gtint,
392
+ .loadB_mp3j {
393
+ opacity:0.25;
394
+ filter:alpha(opacity=25);
395
+ }
396
+ span.posbarB_mp3j .ui-slider-handle,
397
+ span.posbarB_mp3j .ui-slider-handle:hover {
398
+ background:rgba(" . $this->hexToRGB ( $O['mp3jColour'], true ) . ",0.3);
399
+ border-color:" . $O['mp3jColour'] . ";
400
+ }";
401
+
402
+ $CSS .= "\n</style>\n";
403
+ }
404
 
405
+ echo $CSS;
406
  }
407
 
 
 
 
408
  // Write debug
409
  if ( $O['echo_debug'] == "true" ) {
410
  $this->debug_info();
421
  $listJS = '';
422
 
423
  global $post;
424
+ $currentID = ( ! empty( $post->ID ) ) ? $post->ID : '';
425
  if ( $currentID !== $this->currentID ) {
426
  $this->S_arb = 1;
427
  $this->currentID = $currentID;
428
  }
 
429
 
430
  if ( $ids !== '' ) //came via [audio] shortcode, has 1 attachment
431
  {
 
432
  $TRACKS = $this->IDsToTracks( $ids, 'true' );
433
  if ( ! $TRACKS ) {
434
  return false;
435
  }
436
  $track = 1;
437
  $playername = "inline_" . $this->S_no++;
438
+ //TODO: track numbering issue?
439
  $trackNumber = ( $this->theSettings['add_track_numbering'] == "true" ) ? $this->S_arb . '. ' : '';
440
  $listJS = $this->writePlaylistJS( $TRACKS, $playername, $this->S_arb++ );
441
  }
448
  }
449
  $track = ++$this->S_autotrack;
450
  $playername = $this->F_listname;
451
+ //TODO: track numbering issue?
452
  $trackNumber = ( $this->theSettings['add_track_numbering'] == "true" ) ? $track . '. ' : '';
453
  $TRACKS = $this->F_LISTS[ $playername ];
454
  }
458
  return false;
459
  }
460
  $playername = $this->F_listname;
461
+ //TODO: track numbering issue?
462
  $trackNumber = ( $this->theSettings['add_track_numbering'] == "true" ) ? $track . '. ' : '';
463
  $TRACKS = $this->F_LISTS[ $playername ];
464
  }
470
  }
471
  $track = 1;
472
  $playername = "inline_" . $this->S_no++;
473
+ //TODO: track numbering issue?
474
  $trackNumber = ( $this->theSettings['add_track_numbering'] == "true" ) ? $this->S_arb . '. ' : '';
475
  $listJS = $this->writePlaylistJS( $TRACKS, $playername, $this->S_arb++ );
476
  }
518
  return;
519
  }
520
 
 
521
  $C = $this->theSettings['colour_settings'];
522
  $id = $this->Player_ID;
523
 
528
  $divC = "</span>";
529
  $b = "";
530
  if ( $flow == "n" || $this->Caller == "widget" ) {
 
531
  $divO = '<div id="mp3jWrap_' . $id. '" class="mjp-s-wrapper s-text unsel-mjp ' . $cssclass . $font1Class . '" style="font-size:' .$fontsize. ';">';
532
  $divC = "</div>";
533
  }
568
  $errorMsg = "<span class=\"s-nosolution\" id=\"mp3j_nosolution_" . $id . "\" style=\"display:none;\"></span>";
569
 
570
  // Assemble them
 
571
  $html = ( $flip != "false" ) ? $openWrap . $pos . $title_h . $spacer . $play_h . $closeWrap . $errorMsg : $openWrap . $pos . $play_h . $spacer . $title_h . $closeWrap . $errorMsg;
572
 
573
  // Add info to js info array
577
 
578
  $this->defineJSvars();
579
  $playerInfo = "{ list: MP3jPLAYLISTS." . $tn['playername'] . ", tr: " . ($tn['track']-1) . ", type: 'single', lstate: '', loop: " . $loop . ", play_txt: '" . $play . "', pause_txt: '" . $stop . "', pp_title: '', autoplay:" . $autoplay . ", download:" . $dload . ", vol: " . $vol . ", height: '' }";
 
580
  $playerJS = "<script>MP3jPLAYERS[" .$id. "] = " . $playerInfo . ";</script>";
581
 
582
  $this->dbug['str'] .= "\nOK (id " . $this->Player_ID . ")";
615
  $this->dbug['str'] .= "\nExiting (no track here)";
616
  return;
617
  }
618
+
 
 
619
  $C = $this->theSettings['colour_settings'];
620
  $id = $this->Player_ID;
621
 
626
  $divC = "</span>";
627
  $b = "";
628
  if ( $flow == "n" || $this->Caller == "widget" ) {
 
629
  $divO = '<div id="mp3jWrap_' . $id. '" class="mjp-s-wrapper s-graphic unsel-mjp ' . $cssclass . $font1Class . '" style="font-size:' .$fontsize. ';">';
630
  $divC = "</div>";
631
  }
647
  }
648
 
649
  // Make id'd span elements
 
650
  $flippedcss = ( $flip == "false" ) ? "" : " flipped";
651
  $openWrap = $divO . "<span id=\"playpause_wrap_mp3j_" . $id . "\" class=\"wrap_inline_mp3j\"" . $b . ">";
652
  $vol_h = ( $volslider == 'true' || $volslider == 'y' || $volslider == 'Y' ) ? "<span class=\"vol_mp3j" . $flippedcss . "\" id=\"vol_mp3j_" . $id . "\"></span>" : "";
653
  $pos = "<span class=\"bars_mp3j\"><span class=\"loadB_mp3j\" id=\"load_mp3j_" . $id . "\"></span><span class=\"posbarB_mp3j\" id=\"posbar_mp3j_" . $id . "\"></span></span>";
 
654
  $play_h = "<span class=\"gfxbutton_mp3j play-mjp\" id=\"playpause_mp3j_" . $id . "\" style=\"font-size:" .$fontsize. ";\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>";
655
  $spacer = "";
656
 
658
  $indi_h = ( $ind != "y" ) ? "<span style=\"display:none;\" id=\"statusMI_" . $id . "\"></span>" : "<span class=\"indi_mp3j\" style=\"font-size:" .(intval($fontsize)*0.7) . "px;\" id=\"statusMI_" . $id . "\"></span>";
659
  $errorMsg = "<span class=\"s-nosolution\" id=\"mp3j_nosolution_" . $id . "\" style=\"display:none;\"></span>";
660
  // Assemble them
 
661
  $html = ( $flip == "false" ) ? $openWrap . "<span class=\"group_wrap\">" . $pos . $title_h . $indi_h . "</span>" . $play_h . $vol_h . "</span>" . $divC . $errorMsg : $openWrap . $play_h . "&nbsp;<span class=\"group_wrap\">" . $pos . $title_h . $indi_h . "</span>" . $vol_h . "</span>" . $divC . $errorMsg;
662
 
663
  // Add info to js info array
667
 
668
  $this->defineJSvars();
669
  $playerInfo = "{ list: MP3jPLAYLISTS." . $tn['playername'] . ", tr:" . ($tn['track']-1) . ", type:'single', lstate:'', loop:" . $loop . ", play_txt:'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', pause_txt:'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', pp_title:'', autoplay:" . $autoplay . ", download:" . $dload . ", vol:" . $vol . ", height:'' }";
 
670
  $playerJS = "<script>MP3jPLAYERS[" .$id. "] = " . $playerInfo . ";</script>";
671
 
672
  $this->dbug['str'] .= "\nOK (id " . $this->Player_ID . ")";
684
  $imageInfo = wp_get_attachment_image_src( $thumb_id, $size );
685
  $url = $imageInfo[0];
686
  } else {
 
 
687
  $url = 'false';
688
  }
689
  return $url;
909
  $output = $this->primary_player( $attr, $content );
910
  }
911
  }
 
912
  return $output;
913
  }
914
 
956
  if ( ! isset( $attr['captions'] ) ) {
957
  $attr['captions'] = ( isset($attr['artists']) && $attr['artists'] === 'false' ) ? false : '';
958
  }
 
959
  $attr['images'] = ( !isset($attr['images']) ) ? 'true' : $attr['images'];
960
  $attr['text'] = ( ! empty($attr['title']) && empty($attr['text']) ) ? $attr['title'] : ( empty($attr['text']) ? '' : $attr['text'] ); //popout link text
961
 
974
  return;
975
  }
976
 
 
977
  $O = $this->theSettings;
978
  $pID = $this->Player_ID;
979
 
980
  $defaults = $this->playerDefaultParams( 'playlist' );
981
  $ATTS = shortcode_atts( $defaults, $atts );
982
 
 
983
  //Alias params
984
  if ( $ATTS['tracks'] == '' && $ATTS['track'] != '' ) {
985
  $ATTS['tracks'] = $ATTS['track'];
989
  }
990
  $ATTS['userClasses'] = $O['colour_settings']['userClasses'] . ' ' . $ATTS['style'];
991
 
 
992
  //Try build a playlist
993
  $TRACKS = $this->decide_M_playlist( $ATTS );
994
  if ( !$TRACKS ) {
1005
  $trnum = 0;
1006
  $pp_height = (int)$ATTS['height'];
1007
  $pp_height = ( empty($pp_height) || $pp_height === 0 ) ? 'false' : $pp_height;
 
1008
  $pp_title = ( $ATTS['title'] == "" ) ? get_bloginfo('name') : $ATTS['title'] . " | " . get_bloginfo('name');
1009
  $pp_title = str_replace("'", "\'", $pp_title);
1010
  $pp_title = str_replace("&#039;", "\'", $pp_title);
1037
  $ATTS['autoplay'] = ( $ATTS['autoplay'] == "true" || $ATTS['autoplay'] == "y" || $ATTS['autoplay'] == "1" ) ? "true" : "false";
1038
  $ATTS['loop'] = ( $ATTS['loop'] == "true" || $ATTS['loop'] == "y" || $ATTS['loop'] == "1" ) ? "true" : "false";
1039
 
 
1040
  //Make transport buttons
1041
  $ATTS['prevnext'] = ( $ATTS['trackCount'] > 1 && $ATTS['pn'] == "y" ) ? "<div class=\"next-mjp\" id=\"Next_mp3j_" . $pID . "\">Next&raquo;</div><div class=\"prev-mjp\" id=\"Prev_mp3j_" . $pID . "\">&laquo;Prev</div>" : "";
1042
  $ATTS['play_h'] = "<div class=\"play-mjp\" id=\"playpause_mp3j_" . $pID . "\">Play</div>";
1048
 
1049
  //js player info
1050
  $popoutcss = ( $this->setup['cssPopout'] === true ) ? "{ enabled:true, " .$player['js']. "}" : "{ enabled:false, " .$player['js']. "}";
 
1051
  $playerInfo = "{ list:MP3jPLAYLISTS." .$PlayerName. ", tr:" .$trnum. ", type:'MI', lstate:" .$ATTS['list']. ", loop:" .$ATTS['loop']. ", play_txt:'Play', pause_txt:'Pause', pp_title:'" .$pp_title. "', autoplay:" .$ATTS['autoplay']. ", download:" .$dload_info. ", vol:" .$ATTS['vol']. ", height:" .$pp_height. ", cssclass:'" .$ATTS['userClasses']. "', popout_css:" .$popoutcss. " }";
 
1052
  $playerJS = "<script>MP3jPLAYERS[" .$pID. "] = " . $playerInfo . ";</script>\n\n";
1053
 
1054
 
1077
  $defaults = $this->playerDefaultParams( 'popout' );
1078
  $ATTS = shortcode_atts( $defaults, $atts );
1079
 
 
1080
  //Alias some params
1081
  if ( $ATTS['tracks'] == '' && $ATTS['track'] != '' ) {
1082
  $ATTS['tracks'] = $ATTS['track'];
1094
  $this->dbug['str'] .= "\nExiting (no tracks here)";
1095
  return;
1096
  }
 
1097
  $ATTS['trackCount'] = count( $TRACKS );
1098
 
1099
  extract( $ATTS );
 
1100
 
1101
  //Make js list
1102
  $PlayerName = "popout_" . $this->M_no;
1103
  $listJS = $this->writePlaylistJS( $TRACKS, $PlayerName );
1104
 
1105
  //Make settings..
 
1106
  $pp_height = (int)$height;
1107
  $pp_height = ( empty($pp_height) || $pp_height === 0 ) ? 'false' : $pp_height;
 
1108
  $pp_title = ( $title == "" ) ? get_bloginfo('name') : $title;
1109
  $pp_title = str_replace("'", "\'", $pp_title);
1110
  $pp_title = str_replace("&#039;", "\'", $pp_title);
1115
 
1116
 
1117
  //Make player
 
 
1118
  $image_h = ( $image === "" ) ? '<div class="popout-image-mjp"></div>' : '<img class="popout-image-mjp-custom" src="' . $image . '" />';
1119
  $text_h = ( $text !== "" ) ? '<div class="popout-text-mjp"><'.$tag.'>' . $text . '</'.$tag.'></div>' : '';
1120
 
1121
  $player = '<div class="popout-wrap-mjp unsel-mjp" id="mp3j_popout_' . $pID . '">';
1122
  $player .= $image_h . $text_h;
 
1123
  $player .= '</div>';
1124
 
1125
+
 
1126
  $output = $this->drawPlaylistPlayer( $ATTS, true );
1127
  //js player info
1128
  $popoutcss = ( $this->setup['cssPopout'] === true ) ? "{ enabled:true, " .$output['js']. "}" : "{ enabled:false, " .$output['js']. "}";
 
1129
  $playerInfo = "{ list: MP3jPLAYLISTS." . $PlayerName . ", tr:0, type:'popout', lstate:" . $list . ", loop:" . $loop . ", play_txt:'Play', pause_txt:'Pause', pp_title:'" . $pp_title . "', autoplay:" . $autoplay . ", download:" . $dload_info . ", vol:" . $vol . ", height:" . $pp_height . ", cssclass: '" . $ATTS['userClasses'] . "', popout_css:" .$popoutcss. " }";
 
1130
  $playerJS = "<script>MP3jPLAYERS[" .$pID. "] = " . $playerInfo . ";</script>\n\n";
1131
 
 
 
 
1132
  //Finish up
1133
  $this->dbug['str'] .= "\nOK (id " . $this->Player_ID . ")";
1134
  $this->M_no++;
1158
  function checkGrabFields ()
1159
  {
1160
  global $post;
1161
+ //if ( $post->ID != "" && $post->ID != $this->postID )
1162
+ if ( ! empty( $post->ID ) && $post->ID != $this->postID )
1163
  {
1164
  $this->postID = $post->ID;
1165
  $this->F_listname = false;
js/{mp3-jplayer-2.3.4.js → _mp3-jplayer-2.3.4.js} RENAMED
File without changes
js/admin/settings.2.4.js DELETED
@@ -1,148 +0,0 @@
1
- /*
2
- MP3-jPlayer 1.8
3
- Admin-Settings js
4
- */
5
-
6
- var MP3jP = {
7
-
8
- openTab: 1,
9
-
10
- add_tab_listener: function ( j ) {
11
- var that = this;
12
- jQuery('#mp3j_tabbutton_' + j).click( function (e) {
13
- that.changeTab( j );
14
- });
15
- },
16
-
17
- changeTab: function ( j ) {
18
- if ( j !== this.openTab ) {
19
- jQuery('#mp3j_tab_' + this.openTab).hide();
20
- jQuery('#mp3j_tabbutton_' + this.openTab).removeClass('active-tab');
21
- jQuery('#mp3j_tab_' + j).show();
22
- jQuery('#mp3j_tabbutton_' + j).addClass('active-tab');
23
- this.openTab = j;
24
- }
25
- },
26
-
27
- counterpartsFeedback: function () {
28
- var noCP = [ 'ogg', 'webm', 'wav' ],
29
- isTicked = false,
30
- message = 'Auto-counterparting is switched off.',
31
- l = noCP.length,
32
- j;
33
-
34
- for ( j = 0; j < l; j += 1 ) {
35
- if ( jQuery('#audioFormats_' + noCP[j]).prop( 'checked' ) === true ) {
36
- isTicked = true;
37
- break;
38
- }
39
- }
40
-
41
- if ( jQuery('#autoCounterpart').prop( 'checked' ) ) {
42
- if ( isTicked ) {
43
- message = 'Bulk auto-counterparting is not available with this format selection.';
44
- } else {
45
- message = '<span class="tick">&nbsp;</span>Bulk auto-counterparting is active.';
46
- }
47
- }
48
- jQuery('#feedCounterpartInfo').empty().append( message );
49
- },
50
-
51
- initSpectrumPicker: function ( elemID, ops ) {
52
- jQuery( '#' + elemID ).spectrum( ops );
53
- },
54
-
55
- init: function () {
56
- jQuery( '.mp3j-tabbutton').each( function ( j ) {
57
- MP3jP.add_tab_listener( j );
58
- if ( j !== MP3jP.openTab ) {
59
- jQuery('#mp3j_tab_' + j ).hide();
60
- }
61
- });
62
- jQuery('#mp3j_tabbutton_' + this.openTab ).addClass('active-tab');
63
-
64
- jQuery('.formatChecker, #autoCounterpart').on( 'change', function ( e ) {
65
- MP3jP.counterpartsFeedback();
66
- });
67
- MP3jP.counterpartsFeedback();
68
-
69
- this.initSpectrumPicker( 'mp3tColour', {
70
- clickoutFiresChange: true,
71
- preferredFormat: 'hex',
72
- move: function( color ) {
73
- jQuery('#mp3tColour').val( color );
74
- },
75
- showInput: true,
76
- showAlpha: false
77
- });
78
- this.initSpectrumPicker( 'mp3jColour', {
79
- clickoutFiresChange: true,
80
- preferredFormat: 'hex',
81
- move: function( color ) {
82
- jQuery('#mp3jColour').val( color );
83
- },
84
- showInput: true,
85
- showAlpha: false
86
- });
87
- }
88
- };
89
-
90
-
91
-
92
- function HextoRGB(hexString) {
93
- if(hexString === null || typeof(hexString) != "string") {
94
- SetRGB(0,0,0);
95
- return;
96
- }
97
- if (hexString.substr(0, 1) == '#')
98
- hexString = hexString.substr(1);
99
- if(hexString.length != 6) {
100
- SetRGB(0,0,0);
101
- return;
102
- }
103
- var r = parseInt(hexString.substr(0, 2), 16);
104
- var g = parseInt(hexString.substr(2, 2), 16);
105
- var b = parseInt(hexString.substr(4, 2), 16);
106
- if (isNaN(r) || isNaN(g) || isNaN(b)) {
107
- SetRGB(0,0,0);
108
- return;
109
- }
110
- SetRGB(r,g,b);
111
- }
112
- function SetRGB(r, g, b){
113
- red = r/255.0;
114
- green = g/255.0;
115
- blue = b/255.0;
116
- }
117
- function RGBtoHSV(){
118
- var max = Math.max(Math.max(red, green), blue);
119
- var min = Math.min(Math.min(red, green), blue);
120
- value = max;
121
- saturation = 0;
122
- if(max !== 0)
123
- saturation = 1 - min/max;
124
- hue = 0;
125
- if(min == max)
126
- return;
127
-
128
- var delta = (max - min);
129
- if (red == max)
130
- hue = (green - blue) / delta;
131
- else if (green == max)
132
- hue = 2 + ((blue - red) / delta);
133
- else
134
- hue = 4 + ((red - green) / delta);
135
- hue = hue * 60;
136
- if(hue < 0)
137
- hue += 360;
138
- }
139
-
140
-
141
-
142
-
143
- jQuery(document).ready( function () {
144
- MP3jP.init();
145
- });
146
-
147
-
148
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/admin/settings.2.5.js ADDED
@@ -0,0 +1,353 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ MP3-jPlayer 2.4
3
+ Admin-Settings js
4
+ */
5
+
6
+ var MP3jP = {
7
+
8
+
9
+ panels: {
10
+ library: false
11
+ },
12
+
13
+
14
+ //Media library pagination
15
+ tracks: {
16
+ limit: 20,
17
+ offset: 0,
18
+ order: 'title',
19
+ direction: 'ASC',
20
+ total: '',
21
+ pages: '',
22
+ selectID: '#tNavControl_page',
23
+ name: 'tracks',
24
+ label: 'audio files',
25
+ selectClass: '.tNavSelect',
26
+ prevClass: '.tNavPrev',
27
+ nextClass: '.tNavNext',
28
+ messageClass: '.tNavMessage'
29
+ },
30
+
31
+ runTracksDisplay: function ( orderBy ) {
32
+ var onSuccess = function ( response, status ) {
33
+ jQuery('#tSpinner').removeClass('loader');
34
+ var parts = response.split( '#DATA#' );
35
+ jQuery('#libraryFilesTable').empty().append( parts[0] );
36
+ MP3jP.tracks.total = parseInt( parts[1], 10 );
37
+ MP3jP.buildTableNav( MP3jP.tracks );
38
+ };
39
+ var onError = function ( jqXHR, status, error ) {
40
+ jQuery('#tSpinner').removeClass('loader');
41
+ jQuery('#panel_trackSummaryTable').empty().append( "Timed out, try again." );
42
+ };
43
+ jQuery('#tSpinner').addClass('loader');
44
+ this.request({
45
+ limit: this.tracks.limit,
46
+ offset: this.tracks.offset,
47
+ orderBy: orderBy,
48
+ direction: this.tracks.direction
49
+ },
50
+ 'ax_mjp_liblist',
51
+ onSuccess,
52
+ onError
53
+ );
54
+ this.tracks.order = orderBy;
55
+ },
56
+
57
+
58
+
59
+
60
+ buildTableNav: function ( data ) {
61
+ var numPages = ( data.total > 0 && data.limit !== 'all' ) ? Math.ceil( data.total / data.limit ) : 1;
62
+ var currentPage = ( data.limit !== 'all' ) ? Math.ceil( (data.offset + 1) / data.limit ) : 1;
63
+
64
+ var selectOps = this.makePageSelect( currentPage, numPages );
65
+ jQuery( data.selectClass ).empty().append( selectOps );
66
+ data.pages = numPages;
67
+
68
+ this.setNavButtons( currentPage, data );
69
+ this.writeNavMessage( data );
70
+ },
71
+
72
+ writeNavMessage: function ( data ) {
73
+ var message = '';
74
+ var to = data.offset + data.limit;
75
+ to = ( to < data.total ) ? to : data.total;
76
+ if ( data.total < 1 ) {
77
+ message = 'No records';
78
+ } else {
79
+ message = 'Showing <span>' + ( data.offset + 1 ) + '</span> to <span>' + to + '</span> of <span>' + data.total + '</span> ' + data.label;
80
+ }
81
+ jQuery( data.messageClass ).empty().append( message );
82
+ },
83
+
84
+ makePageSelect: function ( current, total ) {
85
+ var j;
86
+ var html = '';
87
+ for ( j = 1; j <= total; j += 1 ) {
88
+ html += '<option value="' + j + '"' + ( current === j ? ' SELECTED' : '' ) + '>' + j + '</option>';
89
+ }
90
+ return html;
91
+ },
92
+
93
+ setNavButtons: function ( currentPage, data ) {
94
+ if ( 1 === currentPage ) {
95
+ jQuery( data.prevClass ).addClass( 'buttonDisabled' );
96
+ } else {
97
+ jQuery( data.prevClass ).removeClass( 'buttonDisabled' );
98
+ }
99
+ if ( data.pages === currentPage ) {
100
+ jQuery( data.nextClass ).addClass( 'buttonDisabled' );
101
+ } else {
102
+ jQuery( data.nextClass ).removeClass( 'buttonDisabled' );
103
+ }
104
+ },
105
+
106
+ changeTracksRows: function ( limit, hideID, showID ) {
107
+ MP3jP.tracks.limit = limit;
108
+ MP3jP.tracks.offset = 0;
109
+ MP3jP.runTracksDisplay( MP3jP.tracks.order );
110
+ jQuery( hideID ).hide();
111
+ jQuery( showID ).show();
112
+ },
113
+
114
+ changeTracksPage: function ( page ) {
115
+ var page = parseInt( page, 10 );
116
+ this.tracks.offset = ( page - 1 ) * this.tracks.limit;
117
+ this.runTracksDisplay( this.tracks.order );
118
+ },
119
+
120
+ initTableNav: function () {
121
+ jQuery('#tNavControl_rows').on( 'blur', function ( e ) {
122
+ var rows = jQuery('#tNavControl_rows').val().replace( /[^0-9]+/, '' );
123
+ rows = ( ! rows ) ? 30 : parseInt( rows, 10 );
124
+ jQuery( this ).val( rows );
125
+ MP3jP.changeTracksRows( rows, '#tNavControl_paged', '#tNavControl_all' );
126
+ });
127
+
128
+ jQuery( this.tracks.selectClass ).on( 'change', function ( e ) {
129
+ var page = jQuery( this ).val();
130
+ MP3jP.changeTracksPage( page );
131
+ });
132
+ jQuery('#tNavControl_prev, #tNavControl_prev2').click( function ( e ) {
133
+ var page = parseInt( jQuery( MP3jP.tracks.selectID ).val(), 10 );
134
+ if ( page > 1 ) {
135
+ MP3jP.changeTracksPage( page - 1 );
136
+ }
137
+ });
138
+ jQuery('#tNavControl_next, #tNavControl_next2').click( function ( e ) {
139
+ var page = parseInt( jQuery( MP3jP.tracks.selectID ).val(), 10 );
140
+ if ( page < MP3jP.tracks.pages ) {
141
+ MP3jP.changeTracksPage( page + 1 );
142
+ }
143
+ });
144
+ jQuery('#tNavControl_first, #tNavControl_first2').click( function ( e ) {
145
+ var page = parseInt( jQuery( MP3jP.tracks.selectID ).val(), 10 );
146
+ if ( page !== 1 ) {
147
+ MP3jP.changeTracksPage( 1 );
148
+ }
149
+ });
150
+ jQuery('#tNavControl_last, #tNavControl_last2').click( function ( e ) {
151
+ var page = parseInt( jQuery( MP3jP.tracks.selectID ).val(), 10 );
152
+ if ( page !== MP3jP.tracks.pages ) {
153
+ MP3jP.changeTracksPage( MP3jP.tracks.pages );
154
+ }
155
+ });
156
+ jQuery('#tNavControl_refresh').click( function ( e ) {
157
+ MP3jP.runTracksDisplay( MP3jP.tracks.order );
158
+ });
159
+ jQuery('#tNavControl_rows').val( this.tracks.limit );
160
+ },
161
+
162
+
163
+ //Tabs
164
+ openTab: 1,
165
+
166
+ add_tab_listener: function ( j ) {
167
+ var that = this;
168
+ jQuery('#mp3j_tabbutton_' + j).click( function (e) {
169
+ that.changeTab( j );
170
+ });
171
+ },
172
+
173
+ changeTab: function ( j ) {
174
+ if ( j !== this.openTab ) {
175
+ jQuery('#mp3j_tab_' + this.openTab).hide();
176
+ jQuery('#mp3j_tabbutton_' + this.openTab).removeClass('active-tab');
177
+ jQuery('#mp3j_tab_' + j).show();
178
+ jQuery('#mp3j_tabbutton_' + j).addClass('active-tab');
179
+ this.openTab = j;
180
+ }
181
+ },
182
+
183
+
184
+ //Counterpart messages
185
+ counterpartsFeedback: function () {
186
+ var noCP = [ 'ogg', 'webm', 'wav' ],
187
+ isTicked = false,
188
+ message = 'Auto-counterparting is switched off.',
189
+ l = noCP.length,
190
+ j;
191
+
192
+ for ( j = 0; j < l; j += 1 ) {
193
+ if ( jQuery('#audioFormats_' + noCP[j]).prop( 'checked' ) === true ) {
194
+ isTicked = true;
195
+ break;
196
+ }
197
+ }
198
+
199
+ if ( jQuery('#autoCounterpart').prop( 'checked' ) ) {
200
+ if ( isTicked ) {
201
+ message = 'Bulk auto-counterparting is not available with this format selection.';
202
+ } else {
203
+ message = '<span class="tick">&nbsp;</span>Bulk auto-counterparting is active.';
204
+ }
205
+ }
206
+ jQuery('#feedCounterpartInfo').empty().append( message );
207
+ },
208
+
209
+
210
+ //Colour pickers
211
+ initSpectrumPicker: function ( elemID, ops ) {
212
+ jQuery( '#' + elemID ).spectrum( ops );
213
+ },
214
+
215
+
216
+ //Init
217
+ init: function () {
218
+
219
+ jQuery( '.mp3j-tabbutton').each( function ( j ) {
220
+ MP3jP.add_tab_listener( j );
221
+ if ( j !== MP3jP.openTab ) {
222
+ jQuery('#mp3j_tab_' + j ).hide();
223
+ }
224
+ });
225
+ jQuery('#mp3j_tabbutton_' + this.openTab ).addClass('active-tab');
226
+
227
+
228
+ jQuery('.formatChecker, #autoCounterpart').on( 'change', function ( e ) {
229
+ MP3jP.counterpartsFeedback();
230
+ });
231
+ MP3jP.counterpartsFeedback();
232
+
233
+
234
+ this.initSpectrumPicker( 'mp3tColour', {
235
+ clickoutFiresChange: true,
236
+ preferredFormat: 'hex',
237
+ move: function( color ) {
238
+ jQuery('#mp3tColour').val( color );
239
+ jQuery('#mp3tColour_on').prop( 'checked', true );
240
+ },
241
+ change: function ( colour ) {
242
+ jQuery('#mp3tColour_on').prop( 'checked', true );
243
+ },
244
+ showInput: true,
245
+ showAlpha: false
246
+ });
247
+ this.initSpectrumPicker( 'mp3jColour', {
248
+ clickoutFiresChange: true,
249
+ preferredFormat: 'hex',
250
+ move: function( color ) {
251
+ jQuery('#mp3jColour').val( color );
252
+ jQuery('#mp3jColour_on').prop( 'checked', true );
253
+ },
254
+ change: function ( colour ) {
255
+ jQuery('#mp3jColour_on').prop( 'checked', true );
256
+ },
257
+ showInput: true,
258
+ showAlpha: false
259
+ });
260
+
261
+
262
+ this.initTableNav();
263
+
264
+ jQuery('#showLibFilesButton').on( 'click', function ( e ) {
265
+ jQuery('#libraryViewerWrap').toggle();
266
+ if ( ! MP3jP.panels.library ) {
267
+ MP3jP.runTracksDisplay( MP3jP.tracks.order );
268
+ MP3jP.panels.library = true;
269
+ }
270
+ });
271
+ //this.runTracksDisplay( this.tracks.order )
272
+ },
273
+
274
+
275
+ //Request
276
+ request: function ( info, action, onSuccess, onError ) {
277
+ var data = {
278
+ 'action': action,
279
+ 'info': info
280
+ };
281
+ jQuery.ajax({
282
+ type: "POST",
283
+ data: data,
284
+ url: MJPajax.WPajaxurl,
285
+ success: function( response, status ) {
286
+ onSuccess( response, status );
287
+ },
288
+ error: function ( jqXHR, status, error ) {
289
+ onError( jqXHR, status, error );
290
+ }
291
+ });
292
+ }
293
+ };
294
+
295
+
296
+
297
+ function HextoRGB(hexString) {
298
+ if(hexString === null || typeof(hexString) != "string") {
299
+ SetRGB(0,0,0);
300
+ return;
301
+ }
302
+ if (hexString.substr(0, 1) == '#')
303
+ hexString = hexString.substr(1);
304
+ if(hexString.length != 6) {
305
+ SetRGB(0,0,0);
306
+ return;
307
+ }
308
+ var r = parseInt(hexString.substr(0, 2), 16);
309
+ var g = parseInt(hexString.substr(2, 2), 16);
310
+ var b = parseInt(hexString.substr(4, 2), 16);
311
+ if (isNaN(r) || isNaN(g) || isNaN(b)) {
312
+ SetRGB(0,0,0);
313
+ return;
314
+ }
315
+ SetRGB(r,g,b);
316
+ }
317
+ function SetRGB(r, g, b){
318
+ red = r/255.0;
319
+ green = g/255.0;
320
+ blue = b/255.0;
321
+ }
322
+ function RGBtoHSV(){
323
+ var max = Math.max(Math.max(red, green), blue);
324
+ var min = Math.min(Math.min(red, green), blue);
325
+ value = max;
326
+ saturation = 0;
327
+ if(max !== 0)
328
+ saturation = 1 - min/max;
329
+ hue = 0;
330
+ if(min == max)
331
+ return;
332
+
333
+ var delta = (max - min);
334
+ if (red == max)
335
+ hue = (green - blue) / delta;
336
+ else if (green == max)
337
+ hue = 2 + ((blue - red) / delta);
338
+ else
339
+ hue = 4 + ((red - green) / delta);
340
+ hue = hue * 60;
341
+ if(hue < 0)
342
+ hue += 360;
343
+ }
344
+
345
+
346
+
347
+
348
+ jQuery(document).ready( function () {
349
+ MP3jP.init();
350
+ });
351
+
352
+
353
+
js/mp3-jplayer-2.5.js ADDED
@@ -0,0 +1,1140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ MP3-jPlayer
3
+ Version 2.5
4
+ http://mp3-jplayer.com
5
+ */
6
+ var MP3_JPLAYER = {
7
+
8
+ tID: '',
9
+ state: '',
10
+ pl_info: [],
11
+ load_pc: 0,
12
+ played_t: 0,
13
+ total_t: 0,
14
+ pp_abs: 0,
15
+ dl_dialogs: [],
16
+ timeoutIDs: [],
17
+ intervalIDs: [],
18
+ jperrorIDs: [],
19
+ dl_domain: '',
20
+ jp_audio: {},
21
+ jp_seekable: 0,
22
+ sliding: false,
23
+ jpID: '#mp3_jplayer_1_8',
24
+ plugin_path: '',
25
+ lastformats: 'mp3',
26
+ popoutformats: 'mp3',
27
+ allowRanges: true,
28
+ extCalls: {
29
+ init:[],
30
+ change_pre: [],
31
+ change_begin: [],
32
+ change_end: [],
33
+ change_post: [],
34
+ button_playpause: [],
35
+ button_popout: [],
36
+ update_time: [],
37
+ write_titles: [],
38
+ write_download: [],
39
+ download: [],
40
+ download_dialog: [],
41
+ error: []
42
+ },
43
+ extStyles: [],
44
+ extJS: [],
45
+ skinJS: '',
46
+ mutes: [],
47
+ preSlideVol: false,
48
+ exData: false,
49
+ exThresh: 2,
50
+ showErrors: false,
51
+ factors: { vol: 1 },
52
+ hasListMeta: true,
53
+ pickup: true,
54
+ pRefs: { id: false, tr: false, pt: 0, vol: 100 },
55
+
56
+ vars: {
57
+ play_f: true,
58
+ stylesheet_url: '',
59
+ dload_text: '',
60
+ force_dload: true,
61
+ message_interval: '<h2>Download Audio</h2><p style="margin-top:34px !important;">Your download should start in a second!</p>',
62
+ message_ok: '',
63
+ message_indark: '<h2>Download Audio</h2><p>Your download should start in a second!</p>',
64
+ message_promtlink: '<h2>Download Audio</h2><p>Link to the file:</p><h3><a target="_blank" href="#1">#2</a></h3><p>Depending on your browser settings, you may need to right click the link to save it.</p>',
65
+ message_fail: '<h2>Download Failed</h2><p>Sorry, something went wrong!</p>',
66
+ message_timeout: '<h2>Download<br />Unavailable</h2><p>please try again later!</p>',
67
+ message_nosolution: 'Unable to play this item, please update your browser or try another.',
68
+ message_nosolution_mpeg: 'To play this item please update your browser or get the <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>.',
69
+ message_bad_url: 'Can\'t locate audio.',
70
+ dl_remote_path: ''
71
+ },
72
+
73
+ eID: {
74
+ play: '#playpause_mp3j_',
75
+ playW: '#playpause_wrap_mp3j_',
76
+ stp: '#stop_mp3j_',
77
+ prev: '#Prev_mp3j_',
78
+ next: '#Next_mp3j_',
79
+ vol: '#vol_mp3j_',
80
+ loader: '#load_mp3j_',
81
+ pos: '#posbar_mp3j_',
82
+ poscol: '#poscol_mp3j_',
83
+ title: '#T_mp3j_',
84
+ caption: '#C_mp3j_',
85
+ pT: '#P-Time-MI_',
86
+ tT: '#T-Time-MI_',
87
+ dload: '#download_mp3j_',
88
+ plwrap: '#L_mp3j_',
89
+ ul: '#UL_mp3j_',
90
+ a: 'mp3j_A_', //No hash!
91
+ indiM: '#statusMI_',
92
+ toglist: '#playlist-toggle_',
93
+ lPP: '#lpp_mp3j_',
94
+ pplink: '#mp3j_popout_',
95
+ img: '#MI_image_'
96
+ },
97
+
98
+ runExternals: function ( hookname, data ) {
99
+ var l = this.extCalls[ hookname ].length;
100
+ for ( var x = 0; x < l; x += 1 ) {
101
+ ( this.extCalls[ hookname ][ x ] )( data );
102
+ }
103
+ },
104
+
105
+ findFile: function ( file ) {
106
+ var i,
107
+ p,
108
+ list,
109
+ l,
110
+ j,
111
+ id = false,
112
+ tr = false;
113
+
114
+ //if ( typeof MP3jPLAYERS !== "undefined" ) {
115
+ //for ( i in MP3jPLAYERS ) {
116
+ //p = MP3jPLAYERS[ i ];
117
+ if ( typeof this.pl_info !== "undefined" ) {
118
+ for ( i in this.pl_info ) {
119
+ p = this.pl_info[ i ];
120
+ list = p.list;
121
+ if ( p.type === 'MI' ) {
122
+ l = list.length;
123
+ for ( j = 0; j < l; j += 1 ) {
124
+ if ( file === list[ j ].mp3 ) {
125
+ id = i;
126
+ tr = j;
127
+ break;
128
+ }
129
+ }
130
+ } else if ( p.type === 'single' ) {
131
+ if ( file === list[ p.tr ].mp3 ) {
132
+ id = i;
133
+ tr = p.tr;
134
+ break;
135
+ }
136
+ }
137
+ if ( id !== false ) {
138
+ break;
139
+ }
140
+ }
141
+ }
142
+ return { id: id, tr: tr };
143
+ },
144
+
145
+ getFormats: function ( player ) {
146
+ return player.list[ player.tr ].formats[0] + ( ( typeof player.list[ player.tr ].formats[1] !== 'undefined' ) ? ',' + player.list[ player.tr ].formats[1] : '' );
147
+ },
148
+
149
+ initialise_jp: function ( supplied, track, vol ) {
150
+ var that = this;
151
+ jQuery(this.jpID).jPlayer({
152
+ ready: function () {
153
+ if ( track === true ) {
154
+ var dinfo = that.deviceInfo();
155
+ if ( dinfo.device === 'Desk/Laptop' ) {
156
+ if ( that.pickup ) {
157
+ if ( that.pRefs.id === false ) {
158
+ that.startup();
159
+ } else {
160
+ var puVol = parseFloat( that.pRefs.vol );
161
+ that.pl_info[ that.pRefs.id ].vol = puVol;
162
+ jQuery( that.eID.vol + that.pRefs.id ).slider({ value: puVol });
163
+
164
+ that.E_change_track( that.pRefs.id, that.pRefs.tr, parseFloat( that.pRefs.pt ) );
165
+ that.write_cookie( 'mjp_pickup', '', -1 );
166
+ }
167
+ } else {
168
+ that.startup();
169
+ }
170
+ } else { //just remove first autolay if there's any
171
+ var j;
172
+ for ( j in that.pl_info ) {
173
+ if ( that.pl_info[j].autoplay ) {
174
+ that.pl_info[j].autoplay = false;
175
+ break;
176
+ }
177
+ }
178
+ }
179
+ } else {
180
+ that.setAudio( track );
181
+ that.playit();
182
+ jQuery(that.jpID).jPlayer("volume", that.factors.vol * vol/100 ); //Set to player vol
183
+ if ( track === false ) { //silence
184
+ that.clearit();
185
+ }
186
+ }
187
+ },
188
+ swfPath: that.plugin_path + '/js/Jplayer271.swf',
189
+ volume: 1,
190
+ supplied: supplied,
191
+ wmode: "window",
192
+ solution:"html, flash",
193
+ error: function( event ) {
194
+ that.check_show_jperrors( event );
195
+ },
196
+ preload: "none"
197
+ });
198
+ jQuery(this.jpID).bind(jQuery.jPlayer.event.ended, function(event) {
199
+ that.E_complete(that.tID);
200
+ });
201
+ jQuery(this.jpID).bind(jQuery.jPlayer.event.timeupdate, function(event) {
202
+ var lp = that.get_loaded(event);
203
+ var ppA = event.jPlayer.status.currentPercentAbsolute;
204
+ var pt = event.jPlayer.status.currentTime;
205
+ var tt = event.jPlayer.status.duration;
206
+ that.E_update(that.tID, lp, ppA, pt, tt);
207
+ });
208
+ jQuery(this.jpID).bind(jQuery.jPlayer.event.ready, function(event) {
209
+ if(event.jPlayer.html.used && event.jPlayer.html.audio.available) {
210
+ that.jp_audio = jQuery(that.jpID).data("jPlayer").htmlElement.audio;
211
+ } else {
212
+ that.jp_audio = 'flash';
213
+ }
214
+ });
215
+ jQuery(this.jpID).bind(jQuery.jPlayer.event.progress, function(event) {
216
+ var lp = that.get_loaded(event);
217
+ var pt = event.jPlayer.status.currentTime;
218
+ var tt = event.jPlayer.status.duration;
219
+ that.E_loading( that.tID, lp, tt, pt );
220
+ });
221
+
222
+ that.lastformats = supplied;
223
+ },
224
+
225
+ writePickupData: function () {
226
+ if ( 'playing' === this.state ) {
227
+ var p = this.pl_info[ this.tID ];
228
+ var preppedurl = p.list[ p.tr ].mp3.replace( /;/, ':::' );
229
+ var valuestring = this.played_t + '?' + p.vol + '?' + preppedurl;
230
+ this.write_cookie( 'mjp_pickup', valuestring, 0.0001 );
231
+ } else {
232
+ this.write_cookie( 'mjp_pickup', '', -1 );
233
+ }
234
+ },
235
+
236
+ getPlayerRefs: function () {
237
+ var playerRefs = { id: false, tr: false, pt: false, vol:false };
238
+ var cvals = this.read_cookie( 'mjp_pickup' );
239
+ if ( cvals !== false ) {
240
+ var cparts = cvals.split('?');
241
+ var depreppedurl = cparts[2].replace( /:::/, ';' );
242
+ playerRefs = ( typeof cparts[2] !== 'undefined' ) ? this.findFile( depreppedurl ) : playerRefs;
243
+ playerRefs.pt = ( typeof cparts[0] !== 'undefined' ) ? cparts[0] : 0;
244
+ playerRefs.vol = ( typeof cparts[1] !== 'undefined' ) ? cparts[1] : 100;
245
+ }
246
+ return playerRefs;
247
+ },
248
+
249
+ init: function () {
250
+ var plpath;
251
+ plpath = this.plugin_path.split('/');
252
+ this.dl_domain = plpath[2].replace(/^www./i, "");
253
+ this.unwrap();
254
+ if ( this.pickup ) {
255
+ jQuery('a').on( 'click', function ( e ) {
256
+ MP3_JPLAYER.writePickupData();
257
+ });
258
+ var prefs = this.getPlayerRefs();
259
+ if ( prefs.id !== false ) {
260
+ var p = this.pl_info[ prefs.id ];
261
+ this.lastformats = this.getFormats( p );
262
+ this.pRefs.id = prefs.id;
263
+ this.pRefs.tr = prefs.tr;
264
+ this.pRefs.pt = prefs.pt;
265
+ this.pRefs.vol = prefs.vol;
266
+ }
267
+ }
268
+
269
+ this.write_controls();
270
+ this.add_jpconstruct_div();
271
+ this.runExternals( 'init', {} );
272
+ this.addExtStyles();
273
+ this.initialise_jp( this.lastformats, true, 1 );
274
+ },
275
+
276
+ addExtStyles: function () {
277
+ var j;
278
+ var l = this.extStyles.length;
279
+ for ( j = 0; j < l; j += 1 ) {
280
+ jQuery( '<style type="text/css">' + this.extStyles[ j ] + '</style>' ).appendTo( 'head' );
281
+ }
282
+ },
283
+
284
+ destroy_jp: function () {
285
+ jQuery(this.jpID).unbind();
286
+ jQuery(this.jpID).jPlayer("destroy");
287
+ jQuery(this.jpID).empty();
288
+ },
289
+
290
+ check_show_jperrors: function ( event ) {
291
+ if ( this.tID !== '' && ! this.jperrorIDs[ this.tID ] ) {
292
+ if ( this.showErrors === true ) {
293
+ this.show_nosolution( this.tID, event.jPlayer.error.type );
294
+ }
295
+ this.jperrorIDs[ this.tID ] = event.jPlayer.error.type;
296
+ }
297
+ },
298
+
299
+ show_nosolution: function ( j, errortype ) {
300
+ var p = this.pl_info[j];
301
+ var track = p.tr;
302
+ var formats = p.list[track].formats;
303
+ var message = '';
304
+
305
+ if ( errortype === 'e_no_solution' || errortype === 'e_no_support' ) {
306
+ message = this.vars.message_nosolution;
307
+ if ( formats === 'mp3' || formats === 'm4a' ) {
308
+ message = this.vars.message_nosolution_mpeg;
309
+ }
310
+ } else if ( errortype === 'e_url' ) {
311
+ message = this.vars.message_bad_url;
312
+ }
313
+ jQuery('#mp3j_nosolution_' + j).empty().append(message).fadeIn(200);
314
+
315
+ if ( this.exData !== false ) {
316
+ this.exData.jperror = errortype;
317
+ this.runExternals( 'change_post', this.exData );
318
+ this.exData = false;
319
+ }
320
+ },
321
+
322
+ add_jpconstruct_div: function () {
323
+ var html = '<div id="mp3_jplayer_items" style="position:relative; overflow:hidden; margin:0; padding:0; border:0; width:0px; height:0px;"><div id="mp3_jplayer_1_8" style="left:-999em;"></div></div>';
324
+ jQuery('body').prepend( html );
325
+ },
326
+
327
+ get_loaded: function (event) {
328
+ var lp;
329
+ if ( typeof this.jp_audio.buffered === "object" ) {
330
+ if( this.jp_audio.buffered.length > 0 && this.jp_audio.duration > 0 ) {
331
+ lp = 100 * this.jp_audio.buffered.end(this.jp_audio.buffered.length-1) / this.jp_audio.duration;
332
+ } else {
333
+ lp = 0;
334
+ }
335
+ } else {
336
+ lp = event.jPlayer.status.seekPercent;
337
+ }
338
+ this.jp_seekable = event.jPlayer.status.seekPercent; //use this for slider calcs for both html/flash solution
339
+ this.load_pc = lp;
340
+ return lp;
341
+ },
342
+
343
+ Tformat: function ( sec ) {
344
+ var t = sec,
345
+ s = Math.floor((t)%60),
346
+ m = Math.floor((t/60)%60),
347
+ h = Math.floor(t/3600);
348
+ return ((h > 0) ? h+':' : '') + ((m > 9) ? m : '0'+m) + ':' + ((s > 9) ? s : '0'+s);
349
+ },
350
+
351
+ E_loading: function ( j, lp, tt, pt ) {
352
+ if (j !== '') {
353
+ jQuery(this.eID.loader + j).css( "width", lp + '%' );
354
+ if (this.pl_info[j].type === 'MI') {
355
+ if (tt > 0 && this.played_t > 0) {
356
+ jQuery(this.eID.tT + j).text(this.Tformat(tt));
357
+ }
358
+ }
359
+ if ( this.jp_audio !== 'flash' && lp < 100 ) {
360
+ if ( pt === this.played_t && this.state === 'playing' && pt > 0 && !this.sliding ) {
361
+ if (this.pl_info[j].type === 'MI') {
362
+ jQuery(this.eID.indiM + j).empty().append('<span class="mp3-finding"></span><span class="mp3-tint"></span><span class="mjp-buffering">Buffering</span>');
363
+ }
364
+ if (this.pl_info[j].type === 'single' ) {
365
+ jQuery(this.eID.indiM + j).empty().append('<span class="Smp3-finding"></span><span class="mp3-gtint"></span> ' + this.Tformat(pt));
366
+ }
367
+ }
368
+ this.played_t = pt;
369
+ this.total_t = tt;
370
+ }
371
+ }
372
+ },
373
+
374
+ E_update: function (j, lp, ppA, pt, tt) {
375
+ if (j !== '') {
376
+ jQuery(this.eID.loader + j).css( "width", lp + '%' );
377
+ jQuery(this.eID.poscol + j).css( "width", ppA + '%' );
378
+ if ( jQuery(this.eID.pos + j + ' div.ui-widget-header').length > 0 ) {
379
+ jQuery(this.eID.pos + j).slider('option', 'value', 10*ppA);
380
+ }
381
+ if (pt > 0) {
382
+ jQuery(this.eID.pos + j).css( 'visibility', 'visible' );
383
+ }
384
+ if (this.pl_info[j].type === 'MI') {
385
+ jQuery(this.eID.pT + j).text(this.Tformat(pt));
386
+ }
387
+ if ('playing' === this.state) {
388
+ if ('MI' === this.pl_info[j].type) {
389
+ if (tt > 0 && this.played_t === pt && lp < 99 && !this.sliding ) {
390
+ jQuery(this.eID.indiM + j).empty().append('<span class="mp3-finding"></span><span class="mp3-tint"></span><span class="mjp-buffering">Buffering</span>');
391
+ jQuery(this.eID.tT + j).text(this.Tformat(tt));
392
+ } else if (pt > 0) {
393
+ jQuery(this.eID.indiM + j).empty().append('<span class="mjp-playing">Playing</span>');
394
+ jQuery(this.eID.tT + j).text(this.Tformat(tt));
395
+ }
396
+ }
397
+ if ('single' === this.pl_info[j].type){
398
+ if (pt > 0 ) {
399
+ if (this.played_t === pt && lp < 99 && !this.sliding ) {
400
+ jQuery(this.eID.indiM + j).empty().append('<span class="Smp3-finding"></span><span class="mp3-gtint"></span> ' + this.Tformat(pt));
401
+ } else {
402
+ jQuery(this.eID.indiM + j).empty().append('<span class="Smp3-tint tintmarg"></span> ' + this.Tformat(pt));
403
+ }
404
+ }
405
+ }
406
+ }
407
+ this.runExternals( 'update_time', { pt: pt, id: j } );
408
+ if ( pt >= this.exThresh && this.exData !== false ) {
409
+ this.runExternals( 'change_post', this.exData );
410
+ this.exData = false;
411
+ }
412
+ this.played_t = pt;
413
+ this.total_t = tt;
414
+ this.pp_abs = ppA;
415
+ }
416
+ },
417
+
418
+ E_complete: function (j) {
419
+ var p = this.pl_info[j];
420
+ if ('MI' === p.type) {
421
+ if (p.loop || p.tr+1 < p.list.length) {
422
+ this.E_change_track(j, 'next');
423
+ } else {
424
+ this.E_dblstop(j);
425
+ this.startup();
426
+ }
427
+ }
428
+ if ('single' === p.type) {
429
+ if (p.loop) {
430
+ this.E_change_track(j, 'next');
431
+ } else {
432
+ this.E_stop(j);
433
+ this.startup();
434
+ }
435
+ }
436
+ },
437
+
438
+ write_controls: function () {
439
+ var j;
440
+ for ( j in this.pl_info ) {
441
+ this.setup_a_player(j);
442
+ this.mutes[j] = false;
443
+ }
444
+ },
445
+
446
+ startup: function () {
447
+ var j;
448
+ for ( j in this.pl_info ) {
449
+ if ( this.pl_info[j].autoplay && (this.pl_info[j].type === 'single' || this.pl_info[j].type === 'MI') ) {
450
+ this.pl_info[j].autoplay = false;
451
+ this.E_change_track(j, this.pl_info[j].tr);
452
+ return;
453
+ }
454
+ }
455
+ },
456
+
457
+ setup_a_player: function (j) {
458
+ var i, li, sel, that = this, p = this.pl_info[j];
459
+
460
+ //PLAYLISTERS and SINGLES
461
+ if ('MI' === p.type || 'single' === p.type) {
462
+ jQuery(this.eID.vol + j).slider({
463
+ value : p.vol,
464
+ max: 100,
465
+ range: 'min',
466
+ start: function ( event, ui ) {
467
+ that.preSlideVol = p.vol;
468
+ },
469
+ stop: function ( event, ui ) {
470
+ that.preSlideVol = false;
471
+ },
472
+ slide: function (event, ui) {
473
+ if (j === that.tID) {
474
+ jQuery(that.jpID).jPlayer("volume", that.factors.vol * ui.value/100);
475
+ }
476
+ if ( ui.value === 0 ) {
477
+ jQuery('#innerExt1_' + j).addClass('vol-muted');
478
+ that.mutes[ j ] = that.preSlideVol;
479
+ } else {
480
+ jQuery('#innerExt1_' + j).removeClass('vol-muted');
481
+ that.mutes[ j ] = false;
482
+ }
483
+ p.vol = ui.value;
484
+ }
485
+ });
486
+
487
+ jQuery(this.eID.vol + j).click( function ( e ) {
488
+ e.stopPropagation();
489
+ });
490
+
491
+ sel = ('MI' === p.type) ? this.eID.play : this.eID.playW;
492
+ jQuery(sel + j).click(function () { //play-pause click
493
+ that.E_change_track(j, p.tr);
494
+ jQuery(this).blur();
495
+ });
496
+ jQuery(sel + j).dblclick(function () { //play-pause dbl click
497
+ if (that.state !== "playing") {
498
+ that.E_change_track(j, p.tr);
499
+ }
500
+ jQuery(this).blur();
501
+ });
502
+
503
+ this.titles(j, p.tr);
504
+ }
505
+
506
+ //PLAYLISTERS
507
+ if ('MI' === p.type) {
508
+ jQuery(this.eID.pT + j).text('00:00');
509
+ jQuery(this.eID.indiM + j).empty().append('<span class="mjp-ready">Ready</span>');
510
+ jQuery(this.eID.stp + j).click(function () {
511
+ that.E_stop(j);
512
+ });
513
+ jQuery(this.eID.stp + j).dblclick(function () {
514
+ that.E_dblstop(j);
515
+ });
516
+
517
+ jQuery(this.eID.plwrap + j).hide();
518
+ if (p.list.length > 1) {
519
+ jQuery(this.eID.next + j).click(function () {
520
+ that.E_change_track(j, 'next');
521
+ });
522
+ jQuery(this.eID.prev + j).click(function () {
523
+ that.E_change_track(j, 'prev');
524
+ });
525
+
526
+ var liClass = '';
527
+ var l = p.list.length;
528
+ jQuery(this.eID.ul + j).empty();
529
+ for (i = 0; i < l; i += 1) {
530
+ liClass = ( i === l-1 ) ? ' mjp-li-last' : '';
531
+ li = '<li class="li-mjp' + liClass + '"><a class="a-mjp" href="#" id="' + this.eID.a + j + '_' + i + '">';
532
+ li += p.list[i].name;
533
+ if ( this.hasListMeta && p.list[i].artist !== '' ) {
534
+ li += '<br><span>' + p.list[i].artist + '</span>';
535
+ }
536
+ li += '</a></li>';
537
+
538
+
539
+
540
+ jQuery(this.eID.ul + j).append(li);
541
+ this.add_ul_click(j, i);
542
+ }
543
+ jQuery('#' + this.eID.a + j + '_' + p.tr).addClass('mp3j_A_current');
544
+ jQuery(this.eID.toglist + j).click(function () {
545
+ that.togglelist(j);
546
+ });
547
+ if (p.lstate === true) {
548
+ jQuery(this.eID.plwrap + j).show();
549
+ }
550
+ }
551
+
552
+ this.writedownload(j, p.tr);
553
+ if ( this.vars.force_dload === true ) {
554
+ this.dl_closeinfo_click(j);
555
+ }
556
+
557
+ jQuery(this.eID.lPP + j).click(function () {
558
+ return that.E_launchPP(j);
559
+ });
560
+
561
+ jQuery( '#innerExt1_' + j ).click( function ( e ) {
562
+ if ( that.mutes[j] === false ) {
563
+ if ( j === that.tID ) {
564
+ jQuery( that.jpID ).jPlayer( 'volume', 0 );
565
+ }
566
+ jQuery( '#innerExt1_' + j ).addClass( 'vol-muted' );
567
+ jQuery( that.eID.vol + j ).slider( 'value', 0 );
568
+ that.mutes[j] = p.vol;
569
+ p.vol = 0;
570
+ } else {
571
+ if ( j === that.tID ) {
572
+ jQuery( that.jpID ).jPlayer( 'volume', that.factors.vol * that.mutes[j]/100 );
573
+ }
574
+ jQuery( '#innerExt1_' + j ).removeClass( 'vol-muted' );
575
+ jQuery( that.eID.vol + j ).slider( 'value', that.mutes[j] );
576
+ p.vol = that.mutes[j];
577
+ that.mutes[j] = false;
578
+ }
579
+ });
580
+ }
581
+
582
+ //POPOUT LINKS
583
+ if ('popout' === p.type) {
584
+ jQuery(this.eID.pplink + j).click(function () {
585
+ return that.E_launchPP(j);
586
+ });
587
+ }
588
+ },
589
+
590
+ add_ul_click: function (j, i) { //playlist item click
591
+ var that = this;
592
+ jQuery('#' + this.eID.a + j + "_" + i).click(function (e) {
593
+ that.E_change_track(j, i);
594
+ e.preventDefault();
595
+ });
596
+ },
597
+
598
+ unwrap: function () {
599
+ var i, j, arr;
600
+ if ( this.vars.play_f === true && typeof MP3jPLAYLISTS !== "undefined" ) {
601
+ for ( var key in MP3jPLAYLISTS ) {
602
+ if ( MP3jPLAYLISTS.hasOwnProperty( key ) ) {
603
+ arr = MP3jPLAYLISTS[key];
604
+ for ( j = 0; j < arr.length; j += 1 ) {
605
+ arr[j].mp3 = this.f_undo.f_con( arr[j].mp3 );
606
+ if ( arr[j].counterpart !== '' ) {
607
+ arr[j].counterpart = this.f_undo.f_con( arr[j].counterpart );
608
+ }
609
+ }
610
+ }
611
+ }
612
+ }
613
+ },
614
+
615
+ f_undo: {
616
+ keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
617
+ f_con : function (input) {
618
+ var output = "", i = 0, chr1, chr2, chr3, enc1, enc2, enc3, enc4;
619
+ input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
620
+ while (i < input.length) {
621
+ enc1 = this.keyStr.indexOf(input.charAt(i++)); enc2 = this.keyStr.indexOf(input.charAt(i++));
622
+ enc3 = this.keyStr.indexOf(input.charAt(i++)); enc4 = this.keyStr.indexOf(input.charAt(i++));
623
+ chr1 = (enc1 << 2) | (enc2 >> 4); chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); chr3 = ((enc3 & 3) << 6) | enc4;
624
+ output = output + String.fromCharCode(chr1);
625
+ if (enc3 !== 64) { output = output + String.fromCharCode(chr2); }
626
+ if (enc4 !== 64) { output = output + String.fromCharCode(chr3); }
627
+ }
628
+ output = this.utf8_f_con(output);
629
+ return output;
630
+ },
631
+ utf8_f_con : function (utftext) {
632
+ var string = "", i = 0, c, c1, c2, c3;
633
+ while (i < utftext.length) {
634
+ c = utftext.charCodeAt(i);
635
+ if (c < 128) {
636
+ string += String.fromCharCode(c); i++;
637
+ } else if ((c > 191) && (c < 224)) {
638
+ c2 = utftext.charCodeAt(i + 1); string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); i += 2;
639
+ } else {
640
+ c2 = utftext.charCodeAt(i + 1); c3 = utftext.charCodeAt(i + 2); string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); i += 3;
641
+ }
642
+ }
643
+ return string;
644
+ }
645
+ },
646
+
647
+ E_stop: function ( j, caller ) {
648
+ var exData = { pT:'', tT:'', pState: '', pU: '', lp:'', ppA:'', jperror:'' };
649
+ if (j === this.tID && j !== '') {
650
+ var preL = (this.tID !== '' ) ? this.pl_info[this.tID].list : false;
651
+ var pU = ( preL !== false ) ? preL[ this.pl_info[this.tID].tr ].mp3 : '';
652
+
653
+ if ( this.exData === false ) {
654
+ exData.pT = this.played_t;
655
+ exData.tT = this.total_t;
656
+ exData.pState = this.state;
657
+ exData.pU = pU;
658
+ exData.lp = this.load_pc;
659
+ exData.ppA = this.pp_abs;
660
+ } else {
661
+ exData = this.exData;
662
+ }
663
+
664
+ if ( caller !== 'Echange' && this.jperrorIDs[j] === false ) {
665
+ this.runExternals( 'change_pre', exData );
666
+ }
667
+
668
+ this.clearit();
669
+ if ( jQuery(this.eID.pos + j + ' div.ui-widget-header').length > 0 ) {
670
+ jQuery(this.eID.pos + j).off( 'click', MP3_JPLAYER.stopProp );
671
+ jQuery(this.eID.pos + j).slider('destroy');
672
+ }
673
+ jQuery(this.eID.loader + j).css( "width", '0%' );
674
+ this.button(j, 'play');
675
+ if (this.pl_info[j].type === 'MI') {
676
+ jQuery(this.eID.poscol + j).css( "width", '0%' );
677
+ jQuery(this.eID.tT + j).empty();
678
+ jQuery(this.eID.indiM + j).empty().append('<span class="mjp-stopped">Stopped</span>');
679
+ jQuery(this.eID.pT + j).text(this.Tformat(0));
680
+ } else {
681
+ jQuery(this.eID.indiM + j).empty();
682
+ }
683
+ this.load_pc = 0;
684
+ this.played_t = 0;
685
+ jQuery('#mp3j_nosolution_' + j).empty().hide();
686
+ }
687
+ return exData;
688
+ },
689
+
690
+ E_dblstop: function (j) { //playlisters only
691
+ this.listclass(j, this.pl_info[j].tr, 0);
692
+ if ( this.pl_info[j].tr !== 0 ) {
693
+ this.titles(j, 0);
694
+ }
695
+ this.writedownload(j, 0);
696
+ this.E_stop(j);
697
+ jQuery(this.eID.indiM + j).empty().append('<span class="mjp-ready">Ready</span>');
698
+ this.pl_info[j].tr = 0;
699
+ },
700
+
701
+ E_change_track: function ( j, change, secsIn ) {
702
+ var track;
703
+ var txt;
704
+ var p = this.pl_info[j];
705
+
706
+ this.runExternals( 'change_begin', { id: j, change: change } );
707
+
708
+ if (j === this.tID && change === p.tr) {
709
+ if ('playing' === this.state) {
710
+ if (this.load_pc === 0) {
711
+ this.E_stop( j, 'Echange');
712
+ } else {
713
+ this.pauseit();
714
+ this.button(j, 'play');
715
+ if ('MI' === p.type) {
716
+ jQuery(this.eID.indiM + j).empty().append('<span class="mjp-paused">Paused</span>');
717
+ }
718
+ }
719
+ return;
720
+ } else if ('paused' === this.state || 'set' === this.state) {
721
+ this.playit();
722
+ this.button(j, 'pause');
723
+ return;
724
+ }
725
+ }
726
+
727
+ var exData = this.E_stop( this.tID, 'Echange' );
728
+
729
+ if ('prev' === change) {
730
+ track = (p.tr-1 < 0) ? p.list.length-1 : p.tr-1;
731
+ } else if ('next' === change) {
732
+ track = (p.tr+1 < p.list.length) ? p.tr+1 : 0;
733
+ } else {
734
+ track = change;
735
+ }
736
+
737
+ jQuery(this.jpID).jPlayer("volume", 1 ); //Vol scaling fix
738
+ jQuery('#mp3j_nosolution_' + j).hide();
739
+ txt = ('MI' === p.type) ? '<span class="mp3-finding"></span><span class="mp3-tint"></span><span class="mjp-connecting">Connecting</span>' : '<span class="Smp3-finding"></span><span class="mp3-gtint"></span>';
740
+ jQuery(this.eID.indiM + j).empty().append(txt);
741
+ this.button(j, 'pause');
742
+ this.makeslider(j);
743
+ if ('MI' === p.type) {
744
+ this.listclass(j, p.tr, track);
745
+ if ( p.tr !== track ) {
746
+ this.titles(j, track);
747
+ }
748
+ if (p.download) {
749
+ this.writedownload(j, track);
750
+ jQuery(this.eID.dload + j).hide().addClass('whilelinks').fadeIn(400);
751
+ }
752
+ }
753
+ p.tr = track;
754
+ this.tID = j;
755
+
756
+ var formatString = this.getFormats( p );
757
+ if ( formatString !== this.lastformats || this.jperrorIDs[ j ] ) {
758
+ this.jperrorIDs[ j ] = false;
759
+ this.destroy_jp();
760
+ this.initialise_jp( formatString, p.list[track], p.vol );
761
+ } else {
762
+ this.jperrorIDs[ j ] = false;
763
+ this.setAudio( p.list[track] );
764
+ this.playit( secsIn );
765
+ jQuery(this.jpID).jPlayer("volume", this.factors.vol * p.vol/100 ); //Reset to correct vol
766
+ }
767
+ exData.mp3 = p.list[track].mp3;
768
+ exData.name = p.list[track].name;
769
+ exData.artist = p.list[track].artist;
770
+ this.exData = exData;
771
+ this.runExternals( 'change_end', exData );
772
+ },
773
+
774
+ E_launchPP: function (j) {
775
+ this.writePickupData();
776
+ this.popoutformats = this.lastformats;
777
+ this.launched_ID = j;
778
+ this.was_playing = ( this.state === "playing" ) ? true : false;
779
+ var data = { id: this.launched_ID, playing: this.was_playing };
780
+ this.runExternals( 'button_popout', data );
781
+
782
+ if ( this.tID !== '' ) {
783
+ this.E_stop(this.tID);
784
+ if ( 'mp3,oga' !== this.lastformats ) {
785
+ this.destroy_jp();
786
+ this.initialise_jp( 'mp3,oga', false, 100 );
787
+ } else {
788
+ this.setAudio( false );
789
+ this.playit(); //make chrome let go of last track (incase it didn't finish loading)
790
+ this.clearit();
791
+ }
792
+ }
793
+
794
+ var newwindow = window.open( this.plugin_path + '/popout.php', 'mp3jpopout', 'height=' +this.pl_info[j].popout_css.colours[13]+ ', width=' +this.pl_info[j].popout_css.colours[12]+ ', location=1, status=1, scrollbars=1, resizable=1, left=25, top=25' );
795
+ if ( window.focus ) {
796
+ newwindow.focus();
797
+ }
798
+ return false;
799
+ },
800
+
801
+ setAudio: function ( track ) {
802
+ var media = {};
803
+ this.state = 'set';
804
+ if ( false === track ) {
805
+ media['mp3'] = this.plugin_path + '/mp3/silence.mp3';
806
+ media['ogg'] = this.plugin_path + '/mp3/silence.ogg';
807
+ } else {
808
+ media[ track.formats[0] ] = track.mp3;
809
+ if ( typeof track.formats[1] !== 'undefined' ) {
810
+ media[ track.formats[1] ] = track.counterpart;
811
+ }
812
+ }
813
+ jQuery(this.jpID).jPlayer( "setMedia", media );
814
+ },
815
+
816
+ playit: function ( secs ) {
817
+ this.state = 'playing';
818
+ if ( typeof secs === 'undefined' ) {
819
+ jQuery( this.jpID ).jPlayer("play");
820
+ } else {
821
+ jQuery( this.jpID ).jPlayer( "play", secs );
822
+ }
823
+ },
824
+ pauseit: function () {
825
+ this.state = 'paused';
826
+ jQuery(this.jpID).jPlayer("pause");
827
+ },
828
+ clearit: function () {
829
+ this.state = '';
830
+ jQuery(this.jpID).jPlayer("clearMedia");
831
+ },
832
+
833
+ button: function (j, type) {
834
+ if (j !== '') {
835
+ if ('pause' === type) {
836
+ jQuery( this.eID.play + j ).removeClass( 'play-mjp' ).addClass( 'pause-mjp' ).empty().append( this.pl_info[j].pause_txt );
837
+ }
838
+ if ('play' === type) {
839
+ jQuery( this.eID.play + j ).removeClass( 'pause-mjp' ).addClass( 'play-mjp' ).empty().append( this.pl_info[j].play_txt );
840
+ }
841
+ }
842
+ this.runExternals( 'button_playpause', { type: type } );
843
+ },
844
+
845
+ listclass: function ( j, rem, add ) {
846
+ jQuery('#'+ this.eID.a + j +'_'+ rem).removeClass('mp3j_A_current');
847
+ jQuery('#'+ this.eID.a + j +'_'+ add).addClass('mp3j_A_current');
848
+ },
849
+
850
+ titles: function ( j, track ) {
851
+ var data;
852
+ var p = this.pl_info[j], Olink = '', Clink = '';
853
+ var img = p.list[track].image;
854
+ if (p.type === "MI") {
855
+ jQuery(this.eID.title + j).empty().append(p.list[track].name).append('<br /><div>' + p.list[track].artist + '</div>');
856
+ var lastImg = jQuery(this.eID.img + j + ' img').attr('src');
857
+ if ( img === 'false' || img === 'true' || img === '' ) {
858
+ jQuery(this.eID.img + j).empty();
859
+ } else if ( img !== lastImg ) {
860
+ if (p.list[track].imgurl !== '') {
861
+ Olink = '<a href="' + p.list[track].imgurl + '">';
862
+ Clink = '</a>';
863
+ }
864
+ jQuery(this.eID.img + j).empty().hide().append(Olink + '<img src="' + p.list[track].image + '" />' + Clink).fadeIn(300);
865
+ }
866
+ }
867
+ data = { title: p.list[track].name, caption: p.list[track].artist, id: j };
868
+ this.runExternals( 'write_titles', data );
869
+ },
870
+
871
+ writedownload: function ( j, track, text ) {
872
+ var data;
873
+ var p = this.pl_info[j];
874
+ text = ( typeof text === 'undefined' ) ? this.vars.dload_text : text;
875
+ if ( p.download ) {
876
+ jQuery(this.eID.dload + j).empty().removeClass('whilelinks').append('<a id="mp3j_dlanchor_' + j + '" href="' + p.list[track].mp3 + '" target="_blank">' + text + '</a>');
877
+ if ( this.vars.force_dload === true ) {
878
+ this.dl_button_click( j );
879
+ }
880
+ }
881
+ data = { is_download: p.download , url: p.list[track].mp3 };
882
+ this.runExternals( 'write_download', data );
883
+ },
884
+
885
+ togglelist: function ( j ) {
886
+ if (this.pl_info[j].lstate === true) {
887
+ jQuery(this.eID.plwrap + j).fadeOut(300);
888
+ jQuery(this.eID.toglist + j).text('SHOW');
889
+ this.pl_info[j].lstate = false;
890
+ } else if (this.pl_info[j].lstate === false) {
891
+ jQuery(this.eID.plwrap + j).fadeIn("slow");
892
+ jQuery(this.eID.toglist + j).text('HIDE');
893
+ this.pl_info[j].lstate = true;
894
+ }
895
+ },
896
+
897
+ makeslider: function ( j ) {
898
+ var phmove, cssmove, that = this;
899
+ jQuery(this.eID.pos + j).css( 'visibility', 'hidden' );
900
+
901
+ jQuery(this.eID.pos + j).slider({
902
+ max: 1000,
903
+ range: 'min',
904
+ slide: function (event, ui) {
905
+ if ( that.allowRanges || (ui.value/10) < that.load_pc ) {
906
+ cssmove = ui.value/10;
907
+ phmove = ui.value*(10.0/that.jp_seekable);
908
+ } else {
909
+ cssmove = 0.99*that.load_pc;
910
+ phmove = (9.9*that.load_pc)*(10.0/that.jp_seekable);
911
+ }
912
+ jQuery(that.eID.poscol + j).css('width', cssmove + '%');
913
+ jQuery(that.jpID).jPlayer("playHead", phmove );
914
+ if (that.state === 'paused') {
915
+ that.button(j, 'pause');
916
+ that.playit();
917
+ }
918
+ that.state = 'playing';
919
+ },
920
+ start: function ( event, ui ) {
921
+ that.sliding = true;
922
+ },
923
+ stop: function ( event, ui ) {
924
+ that.sliding = false;
925
+ }
926
+ });
927
+
928
+ jQuery(this.eID.pos + j).on( 'click', MP3_JPLAYER.stopProp );
929
+ },
930
+
931
+ stopProp: function ( e ) {
932
+ e.stopPropagation();
933
+ },
934
+
935
+ deviceInfo: function () {
936
+ var isMobile = false;
937
+ var os = '';
938
+ var device = '';
939
+ var ua = navigator.userAgent;
940
+ var p = navigator.platform;
941
+ var matched;
942
+
943
+ if ( /bot|spider/i.test( ua ) ) {
944
+ os = 'spider';
945
+ } else {
946
+ if ( /iPhone|iPod|iPad/.test( p ) ) {
947
+ os = 'iOS';
948
+ device = p;
949
+ isMobile = true;
950
+ } else {
951
+ var matched = /Android|BlackBerry|IEMobile|Opera Mini|Mobi|Tablet/.exec( ua );
952
+ if ( matched ) {
953
+ device = ( matched[0] === 'Mobi' ) ? 'Mobile' : matched[0];
954
+ isMobile = true;
955
+ }
956
+ }
957
+ if ( ! isMobile ) {
958
+ if ( /Mac/.test( p ) ) {
959
+ os = 'Mac';
960
+ device = 'Desk/Laptop';
961
+ } else if ( /Linux/.test( p ) ) {
962
+ os = 'Linux';
963
+ device = 'Desk/Laptop';
964
+ } else if ( /Win|Pocket PC/.test( p ) ) {
965
+ os = 'Windows';
966
+ device = 'Desk/Laptop';
967
+ }
968
+ }
969
+ }
970
+ return { os:os, device:device, isMobile:isMobile };
971
+ }
972
+ };
973
+
974
+ MP3_JPLAYER.dl_button_click = function ( j ) {
975
+ var that = this, p = this.pl_info[j];
976
+ jQuery('#mp3j_dlanchor_' + j).click(function (e) {
977
+ that.dl_runinfo( p.list[p.tr].mp3, j, e );
978
+ that.runExternals( 'download', p.list[p.tr] );
979
+ e.preventDefault();
980
+ });
981
+ };
982
+
983
+ MP3_JPLAYER.dl_closeinfo_click = function ( j ) {
984
+ var that = this;
985
+ jQuery('#mp3j_finfo_close_' + j).click(function () {
986
+ that.dl_dialogue( j, '', 'close');
987
+ that.clear_timers( j );
988
+ });
989
+ };
990
+
991
+ MP3_JPLAYER.dl_runinfo = function ( get, j, e ) {
992
+ var can_write,
993
+ dlpath,
994
+ message,
995
+ that = this,
996
+ dlframe = false,
997
+ p = this.pl_info[j],
998
+ is_local = this.is_local_dload( get );
999
+
1000
+ var enc_get;
1001
+ if ( !this.intervalIDs[ j ] && !this.timeoutIDs[ j ] ) { //if timers not already running for this player
1002
+ can_write = this.write_cookie('mp3Download' + j, 'waiting', '');
1003
+ if ( is_local ) {
1004
+ if ( can_write !== false ) {
1005
+ this.dl_dialogue( j, this.vars.message_interval, 'check');
1006
+ } else {
1007
+ this.dl_dialogue( j, this.vars.message_indark, 'indark');
1008
+ }
1009
+ this.intervalIDs[ j ] = setInterval( function(){ that.dl_interval_check( j, can_write ); }, 500);
1010
+ this.timeoutIDs[ j ] = setTimeout( function(){ that.dl_timeout( j, can_write ); }, 7000);
1011
+ dlframe = true;
1012
+ } else {
1013
+ if ( this.vars.dl_remote_path === '' ) {
1014
+ message = this.vars.message_promtlink.replace('#1', get);
1015
+ message = message.replace('#2', p.list[p.tr].name);
1016
+ this.dl_dialogue( j, message, 'indark');
1017
+ } else {
1018
+ message = this.vars.message_indark.replace('#1', get);
1019
+ message = message.replace('#2', p.list[p.tr].name);
1020
+ this.dl_dialogue( j, message, 'indark');
1021
+ dlframe = true;
1022
+ }
1023
+ }
1024
+ this.dl_dialogs[ j ] = 'false';
1025
+ if ( dlframe ) {
1026
+ dlpath = this.get_dloader_path( get );
1027
+ enc_get = encodeURIComponent( get );
1028
+ jQuery('#mp3j_dlf_' + j).empty().append('<iframe id="mp3j_dlframe_' + j + '" name="mp3j_dlframe_' + j + '" class="mp3j-dlframe" src="' + dlpath + '?mp3=loc' + enc_get + '&pID=' + j + '" style="display:none;"></iframe>');
1029
+ }
1030
+ }
1031
+ };
1032
+
1033
+ MP3_JPLAYER.dl_interval_check = function ( j, can_write ) {
1034
+ if ( can_write !== false && this.read_cookie('mp3Download' + j) === 'true' ) { //got cookie back, all should be good
1035
+ this.dl_dialogue( j, this.vars.message_ok, 'hide');
1036
+ this.clear_timers( j );
1037
+ } else if ( this.dl_dialogs[ j ] !== 'false' ) { //got a message back
1038
+ this.dl_dialogue( j, this.dl_dialogs[ j ], 'add');
1039
+ this.clear_timers( j );
1040
+ }
1041
+ };
1042
+
1043
+ MP3_JPLAYER.dl_timeout = function ( j, can_write ) {
1044
+ this.clear_timers( j );
1045
+ if ( can_write !== false ) {
1046
+ this.dl_dialogue( j, this.vars.message_timeout, 'add');
1047
+ }
1048
+ };
1049
+
1050
+ MP3_JPLAYER.clear_timers = function ( j ) {
1051
+ if ( this.intervalIDs[ j ] !== null && this.timeoutIDs[ j ] !== null ) {
1052
+ clearInterval( this.intervalIDs[j] );
1053
+ clearTimeout( this.timeoutIDs[j] );
1054
+ this.intervalIDs[ j ] = null;
1055
+ this.timeoutIDs[j] = null;
1056
+ }
1057
+ jQuery('#mp3j_dlf_' + j).empty(); //ditch iframe
1058
+ this.write_cookie('mp3Download' + j, '', -1); //clear any cookie
1059
+ };
1060
+
1061
+ MP3_JPLAYER.dl_dialogue = function ( j, text, state ) {
1062
+ if ( 'check' === state ) {
1063
+ jQuery('#mp3j_finfo_gif_' + j).show();
1064
+ jQuery('#mp3j_finfo_txt_' + j).empty().append(text).show();
1065
+ jQuery('#mp3j_finfo_' + j).show();
1066
+ } else if ( 'add' === state ) {
1067
+ jQuery('#mp3j_finfo_gif_' + j).hide();
1068
+ jQuery('#mp3j_finfo_txt_' + j).empty().append(text).show();
1069
+ } else if ( 'indark' === state ) {
1070
+ jQuery('#mp3j_finfo_gif_' + j).hide();
1071
+ jQuery('#mp3j_finfo_txt_' + j).empty().append(text).show();
1072
+ jQuery('#mp3j_finfo_' + j).fadeIn(100);
1073
+ } else if ( 'close' === state ) {
1074
+ jQuery('#mp3j_finfo_gif_' + j).hide();
1075
+ jQuery('#mp3j_finfo_' + j).hide();
1076
+ } else {
1077
+ jQuery('#mp3j_finfo_gif_' + j).hide();
1078
+ if ( text !== '' ) {
1079
+ jQuery('#mp3j_finfo_txt_' + j).empty().append(text).show();
1080
+ }
1081
+ jQuery('#mp3j_finfo_' + j).fadeOut(1000);
1082
+ }
1083
+ this.runExternals( 'download_dialog', { id: j, text: text, state: state } );
1084
+ };
1085
+
1086
+ MP3_JPLAYER.read_cookie = function ( name ) {
1087
+ var i, cookie, allCookies = document.cookie.split('; ');
1088
+ if ( allCookies.length > 0 ) {
1089
+ for ( i = 0; i < allCookies.length; i += 1 ) {
1090
+ cookie = allCookies[i].split( '=' );
1091
+ if ( cookie[0] === name ) {
1092
+ return cookie[1];
1093
+ }
1094
+ }
1095
+ }
1096
+ return false;
1097
+ };
1098
+
1099
+ MP3_JPLAYER.write_cookie = function ( name, value, days ) {
1100
+ var date, expires = "";
1101
+ if ( days ) {
1102
+ date = new Date();
1103
+ date.setTime( date.getTime() + (days*24*60*60*1000) );
1104
+ expires = "; expires=" + date.toUTCString();
1105
+ }
1106
+ document.cookie = name + "=" + value + expires + "; path=/";
1107
+ return this.read_cookie( name );
1108
+ };
1109
+
1110
+ MP3_JPLAYER.get_dloader_path = function ( loc ) {
1111
+ var k, path = "", file = "", chunks;
1112
+ chunks = loc.split('/');
1113
+ file = chunks[chunks.length-1];
1114
+ if ( loc.charAt(0) === '/' ) {
1115
+ path = this.plugin_path + '/download.php';
1116
+ } else {
1117
+ path = chunks[2].replace(/^www./i, "");
1118
+ if ( path === this.dl_domain ) {
1119
+ path = this.plugin_path + '/download.php';
1120
+ } else {
1121
+ path = chunks[0] + '//' + chunks[2] + this.vars.dl_remote_path;
1122
+ }
1123
+ }
1124
+ return path;
1125
+ };
1126
+
1127
+ MP3_JPLAYER.is_local_dload = function ( loc ) {
1128
+ var domain = "", file = "", chunks, is_local = false;
1129
+ chunks = loc.split('/');
1130
+ file = chunks[chunks.length-1];
1131
+ if ( loc.charAt(0) === '/' ) {
1132
+ is_local = true;
1133
+ } else {
1134
+ domain = chunks[2].replace(/^www./i, "");
1135
+ if ( domain === this.dl_domain ) {
1136
+ is_local = true;
1137
+ }
1138
+ }
1139
+ return is_local;
1140
+ };
main.php CHANGED
@@ -2,7 +2,7 @@
2
  class MP3j_Main {
3
 
4
  // --------- Update Me ------------
5
- var $version_of_plugin = "2.4.2";
6
  var $showSplash = false;
7
  // --------------------------------
8
 
@@ -91,8 +91,8 @@ class MP3j_Main {
91
  //~~~~~
92
  function get_excerpt_handler( $stored = "" )
93
  {
94
- global $post;
95
- $this->dbug['str'] .= "\n#early excerpt [" .$post->post_title. "]#";
96
  $this->isExcerpt = true;
97
  $this->isAllowedExcerpt = false;
98
  if ( $stored != "" && $this->theSettings['run_shcode_in_excerpt'] ) {
@@ -104,8 +104,8 @@ class MP3j_Main {
104
  //~~~~~
105
  function afterExcerpt ( $stuff = '' )
106
  {
107
- global $post;
108
- $this->dbug['str'] .= "\n#late excerpt [" .$post->post_title. "]#";
109
  $this->isExcerpt = false;
110
  $this->isAllowedExcerpt = false;
111
  return $stuff;
@@ -1207,7 +1207,7 @@ class MP3j_Main {
1207
 
1208
  //jplayer and plugin js
1209
  wp_enqueue_script( 'jplayer271', $this->PluginFolder . '/js/jquery.jplayer.min.2.7.1.js', false, '2.7.1' );
1210
- wp_enqueue_script( 'mp3-jplayer', $this->PluginFolder . '/js/mp3-jplayer-2.3.4.js', false, '2.3.4' );
1211
 
1212
  $skins = $this->SKINS;
1213
  if ( isset( $skins[ $theme ]['url'] ) ) {
@@ -1783,40 +1783,6 @@ class MP3j_Main {
1783
 
1784
 
1785
 
1786
- //~~~~~
1787
- function mp3j_admin_header ()
1788
- {
1789
- wp_enqueue_script('jquery');
1790
- wp_enqueue_script('mp3jp-settings-js', $this->PluginFolder .'/js/admin/settings.2.4.js' );
1791
- wp_enqueue_script('spectrum-CP-js', $this->PluginFolder .'/js/spectrum/spectrum.js' );
1792
-
1793
- wp_enqueue_style( 'spectrum-css', plugins_url( '/css/admin/spectrum-custom.css', __FILE__ ) );
1794
- wp_enqueue_style('mp3jp-settings-css', $this->PluginFolder .'/css/admin/admin-settings.css' );
1795
- }
1796
-
1797
-
1798
- //~~~~~
1799
- function mp3j_admin_footer () {}
1800
-
1801
-
1802
- //~~~~~
1803
- function mp3j_admin_colours_header ()
1804
- {
1805
- //scripts
1806
- wp_enqueue_script('jquery');
1807
- wp_enqueue_script('jquery-ui-core');
1808
- wp_enqueue_script('jquery-ui-widget');
1809
- wp_enqueue_script('jquery-ui-mouse');
1810
- wp_enqueue_script('jquery-ui-slider');
1811
- wp_enqueue_script('jquery-ui-resizable');
1812
- wp_enqueue_script('mp3jp-colours-js', $this->PluginFolder .'/js/admin/admin-colours.js' );
1813
- wp_enqueue_script('spectrum-CP-js', $this->PluginFolder .'/js/spectrum/spectrum.js' );
1814
-
1815
- //styles
1816
- wp_enqueue_style('spectrum-CP-css', $this->PluginFolder .'/css/admin/spectrum-custom.css' );
1817
- wp_enqueue_style('mp3jp-colours-css', $this->PluginFolder .'/css/admin/admin-colours.css' );
1818
- }
1819
-
1820
 
1821
  //~~~~~
1822
  function prep_value ( $field )
@@ -2156,7 +2122,6 @@ class MP3j_Main {
2156
  'dload_text' => 'Download',
2157
  'loggedout_dload_text' => 'Log in to download',
2158
  'loggedout_dload_link' => $this->WPinstallpath . '/wp-login.php',
2159
- //'touch_punch_js' => 'true',
2160
  'force_browser_dload' => 'true',
2161
  'dloader_remote_path' => '',
2162
  'make_player_from_link' => 'true',
@@ -2173,13 +2138,12 @@ class MP3j_Main {
2173
  'folderFeedDirection' => 'ASC',
2174
  'autoCounterpart' => 'true',
2175
  'allowRangeRequests' => 'true',
2176
- 'playerHeight' => '92px',
2177
  'font_size_mp3t' => '18px',
2178
  'font_size_mp3j' => '18px',
2179
  'showErrors' => 'admin',
2180
  'flipMP3t' => 'false',
2181
  'flipMP3j' => 'true',
2182
- //'libUseID3' => 'false',
2183
  'mp3tColour' => '#00869b',
2184
  'mp3tColour_on' => 'false',
2185
  'mp3jColour' => '#404040',
@@ -2187,15 +2151,11 @@ class MP3j_Main {
2187
  'playerTitle1' => 'titles',
2188
  'playerTitle2' => 'artist',
2189
  'hasListMeta' => 'false',
 
2190
  );
2191
 
2192
  return $SETTINGS;
2193
  }
2194
-
2195
-
2196
-
2197
-
2198
-
2199
 
2200
  } //end class
2201
  ?>
2
  class MP3j_Main {
3
 
4
  // --------- Update Me ------------
5
+ var $version_of_plugin = "2.5";
6
  var $showSplash = false;
7
  // --------------------------------
8
 
91
  //~~~~~
92
  function get_excerpt_handler( $stored = "" )
93
  {
94
+ //global $post;
95
+ //$this->dbug['str'] .= "\n#early excerpt [" .$post->post_title. "]#";
96
  $this->isExcerpt = true;
97
  $this->isAllowedExcerpt = false;
98
  if ( $stored != "" && $this->theSettings['run_shcode_in_excerpt'] ) {
104
  //~~~~~
105
  function afterExcerpt ( $stuff = '' )
106
  {
107
+ //global $post;
108
+ //$this->dbug['str'] .= "\n#late excerpt [" .$post->post_title. "]#";
109
  $this->isExcerpt = false;
110
  $this->isAllowedExcerpt = false;
111
  return $stuff;
1207
 
1208
  //jplayer and plugin js
1209
  wp_enqueue_script( 'jplayer271', $this->PluginFolder . '/js/jquery.jplayer.min.2.7.1.js', false, '2.7.1' );
1210
+ wp_enqueue_script( 'mp3-jplayer', $this->PluginFolder . '/js/mp3-jplayer-2.5.js', false, '2.5' );
1211
 
1212
  $skins = $this->SKINS;
1213
  if ( isset( $skins[ $theme ]['url'] ) ) {
1783
 
1784
 
1785
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1786
 
1787
  //~~~~~
1788
  function prep_value ( $field )
2122
  'dload_text' => 'Download',
2123
  'loggedout_dload_text' => 'Log in to download',
2124
  'loggedout_dload_link' => $this->WPinstallpath . '/wp-login.php',
 
2125
  'force_browser_dload' => 'true',
2126
  'dloader_remote_path' => '',
2127
  'make_player_from_link' => 'true',
2138
  'folderFeedDirection' => 'ASC',
2139
  'autoCounterpart' => 'true',
2140
  'allowRangeRequests' => 'true',
2141
+ 'playerHeight' => '120px',
2142
  'font_size_mp3t' => '18px',
2143
  'font_size_mp3j' => '18px',
2144
  'showErrors' => 'admin',
2145
  'flipMP3t' => 'false',
2146
  'flipMP3j' => 'true',
 
2147
  'mp3tColour' => '#00869b',
2148
  'mp3tColour_on' => 'false',
2149
  'mp3jColour' => '#404040',
2151
  'playerTitle1' => 'titles',
2152
  'playerTitle2' => 'artist',
2153
  'hasListMeta' => 'false',
2154
+ 'autoResume' => 'true',
2155
  );
2156
 
2157
  return $SETTINGS;
2158
  }
 
 
 
 
 
2159
 
2160
  } //end class
2161
  ?>
mp3jplayer.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: MP3-jPlayer
4
  Plugin URI: http://mp3-jplayer.com
5
  Description: Easy, Flexible Audio for WordPress.
6
- Version: 2.4.2
7
  Author: Simon Ward
8
  Author URI: http://www.sjward.org
9
  License: GPL2
3
  Plugin Name: MP3-jPlayer
4
  Plugin URI: http://mp3-jplayer.com
5
  Description: Easy, Flexible Audio for WordPress.
6
+ Version: 2.5
7
  Author: Simon Ward
8
  Author URI: http://www.sjward.org
9
  License: GPL2
popout.php CHANGED
@@ -9,7 +9,7 @@
9
  MP3-jPlayer
10
  http://mp3-jplayer.com
11
  --->
12
-
13
  <script type='text/javascript' src='js/popout/jquery.js'></script>
14
  <script type='text/javascript' src='js/popout/core.min.js'></script>
15
  <script type='text/javascript' src='js/popout/widget.min.js'></script>
@@ -17,7 +17,7 @@
17
  <script type='text/javascript' src='js/popout/slider.min.js'></script>
18
  <script type='text/javascript' src='js/wp-backwards-compat/jquery.ui.touch-punch.min.js'></script>
19
  <script type='text/javascript' src='js/jquery.jplayer.min.2.7.1.js'></script>
20
- <script type='text/javascript' src='js/mp3-jplayer-2.3.4.js'></script>
21
 
22
  <script type='text/javascript'>
23
  function loadcss(filename) {
@@ -33,7 +33,7 @@
33
  function getParentInfo ( j ) {
34
  jQuery.getScript( window.opener.MP3_JPLAYER.extJS[ j ].loc, function(){} );
35
  };
36
-
37
  if( window.opener && !window.opener.closed && window.opener.MP3_JPLAYER && window.opener.MP3_JPLAYER.launched_ID !== null ) {
38
 
39
  if ( typeof window.opener.MP3_JPLAYER.vars.stylesheet_url !== 'undefined' ) {
@@ -46,7 +46,8 @@
46
  MP3_JPLAYER.vars.dload_text = window.opener.MP3_JPLAYER.vars.dload_text;
47
  MP3_JPLAYER.vars.force_dload = window.opener.MP3_JPLAYER.vars.force_dload;
48
  MP3_JPLAYER.vars.dl_remote_path = window.opener.MP3_JPLAYER.vars.dl_remote_path;
49
-
 
50
  var pl_info_wo = window.opener.MP3_JPLAYER.pl_info; //copy
51
  var auto_play = ( typeof window.opener.MP3_JPLAYER.was_playing !== 'undefined' && window.opener.MP3_JPLAYER.was_playing === true ) ? true : pl_info_wo[MP3_JPLAYER.launched_ID].autoplay;
52
  window.opener.MP3_JPLAYER.was_playing = false;
@@ -68,8 +69,10 @@
68
  popout_css: pl_info_wo[MP3_JPLAYER.launched_ID].popout_css
69
  }];
70
 
71
- var p = MP3_JPLAYER.pl_info[0];
72
- MP3_JPLAYER.lastformats = window.opener.MP3_JPLAYER.lastformats;
 
 
73
  MP3_JPLAYER.vars.pp_playerheight = window.opener.MP3_JPLAYER.vars.pp_playerheight;
74
  MP3_JPLAYER.vars.pp_windowheight = window.opener.MP3_JPLAYER.vars.pp_windowheight;
75
 
@@ -90,10 +93,9 @@
90
  }
91
  }
92
 
93
-
94
  jQuery(document).ready(function () {
 
95
  if( window.opener && !window.opener.closed && window.opener.MP3_JPLAYER && window.opener.MP3_JPLAYER.launched_ID !== null ) {
96
-
97
  var j;
98
  var l = window.opener.MP3_JPLAYER.extJS.length;
99
  if ( l > 0 ) {
@@ -101,7 +103,6 @@
101
  getParentInfo( j );
102
  }
103
  }
104
-
105
  if ( MP3_JPLAYER.skinJS !== '' ) {
106
  jQuery.getScript( MP3_JPLAYER.skinJS, function () {
107
  MJP_SKINS_INIT();
@@ -198,7 +199,6 @@
198
  <div style="display:none;" class="Ebelow-mjp"></div>
199
  </div>
200
 
201
-
202
  <script type="text/javascript">
203
  if( window.opener && ! window.opener.closed ) {
204
 
9
  MP3-jPlayer
10
  http://mp3-jplayer.com
11
  --->
12
+
13
  <script type='text/javascript' src='js/popout/jquery.js'></script>
14
  <script type='text/javascript' src='js/popout/core.min.js'></script>
15
  <script type='text/javascript' src='js/popout/widget.min.js'></script>
17
  <script type='text/javascript' src='js/popout/slider.min.js'></script>
18
  <script type='text/javascript' src='js/wp-backwards-compat/jquery.ui.touch-punch.min.js'></script>
19
  <script type='text/javascript' src='js/jquery.jplayer.min.2.7.1.js'></script>
20
+ <script type='text/javascript' src='js/mp3-jplayer-2.5.js'></script>
21
 
22
  <script type='text/javascript'>
23
  function loadcss(filename) {
33
  function getParentInfo ( j ) {
34
  jQuery.getScript( window.opener.MP3_JPLAYER.extJS[ j ].loc, function(){} );
35
  };
36
+
37
  if( window.opener && !window.opener.closed && window.opener.MP3_JPLAYER && window.opener.MP3_JPLAYER.launched_ID !== null ) {
38
 
39
  if ( typeof window.opener.MP3_JPLAYER.vars.stylesheet_url !== 'undefined' ) {
46
  MP3_JPLAYER.vars.dload_text = window.opener.MP3_JPLAYER.vars.dload_text;
47
  MP3_JPLAYER.vars.force_dload = window.opener.MP3_JPLAYER.vars.force_dload;
48
  MP3_JPLAYER.vars.dl_remote_path = window.opener.MP3_JPLAYER.vars.dl_remote_path;
49
+ MP3_JPLAYER.pickup = window.opener.MP3_JPLAYER.pickup;
50
+
51
  var pl_info_wo = window.opener.MP3_JPLAYER.pl_info; //copy
52
  var auto_play = ( typeof window.opener.MP3_JPLAYER.was_playing !== 'undefined' && window.opener.MP3_JPLAYER.was_playing === true ) ? true : pl_info_wo[MP3_JPLAYER.launched_ID].autoplay;
53
  window.opener.MP3_JPLAYER.was_playing = false;
69
  popout_css: pl_info_wo[MP3_JPLAYER.launched_ID].popout_css
70
  }];
71
 
72
+ if ( ! MP3_JPLAYER.pickup ) {
73
+ MP3_JPLAYER.lastformats = window.opener.MP3_JPLAYER.popoutformats;
74
+ }
75
+
76
  MP3_JPLAYER.vars.pp_playerheight = window.opener.MP3_JPLAYER.vars.pp_playerheight;
77
  MP3_JPLAYER.vars.pp_windowheight = window.opener.MP3_JPLAYER.vars.pp_windowheight;
78
 
93
  }
94
  }
95
 
 
96
  jQuery(document).ready(function () {
97
+
98
  if( window.opener && !window.opener.closed && window.opener.MP3_JPLAYER && window.opener.MP3_JPLAYER.launched_ID !== null ) {
 
99
  var j;
100
  var l = window.opener.MP3_JPLAYER.extJS.length;
101
  if ( l > 0 ) {
103
  getParentInfo( j );
104
  }
105
  }
 
106
  if ( MP3_JPLAYER.skinJS !== '' ) {
107
  jQuery.getScript( MP3_JPLAYER.skinJS, function () {
108
  MJP_SKINS_INIT();
199
  <div style="display:none;" class="Ebelow-mjp"></div>
200
  </div>
201
 
 
202
  <script type="text/javascript">
203
  if( window.opener && ! window.opener.closed ) {
204
 
readme.txt CHANGED
@@ -7,23 +7,24 @@ Tags: audio, audio player, audio playlist, mp3 player, music player, media, mobi
7
  License: GPLv2 or later
8
  Requires at least: 2.9
9
  Tested up to: 4.3
10
- Stable tag: 2.4.2
11
 
12
  Easy, Flexible Audio for WordPress.
13
 
14
  == Description ==
15
 
16
- = Mobile friendly HTML5 audio players and audio playlist players =
17
 
18
  * Flexible multi-player audio plugin.
19
- * Play from your library, uploaded folders, and urls.
20
- * Player style, colour, and layout options.
21
- * Popout players and popout links, audio widgets, and smooth audio downloads.
 
22
  * Works with all built-in WordPress options for adding your music, including the recently introduced *Create Audio Playlist* drag & drop interface.
23
 
24
 
25
  [Basic Demo - Showing the included player skins](http://mp3-jplayer.com/player-skins/) <br>
26
- [How to Add Your Players](http://mp3-jplayer.com/adding-players/) <br>
27
  [Help & Docs main page](http://mp3-jplayer.com/help-docs/)
28
 
29
 
@@ -31,7 +32,7 @@ MP3-jPlayer will expand WP's native shortcodes with new functions and options, g
31
 
32
  * Add unlimited music players to pages, posts, sidebars, and template files.
33
  * Offer downloads to visitors or logged-in users.
34
- * Playlist folders with one simple feed folder command.
35
  * Can be selectively integrated with WordPress default audio players.
36
  * Customise the colour scheme, fonts, title and image placements and more on the Player Design page.
37
  * A fully integrated Pop-out player that can be launched from playlist players, or from a stand-alone popout link.
@@ -96,21 +97,33 @@ Either on the [forum at Wordpress](https://wordpress.org/support/plugin/mp3-jpla
96
 
97
  == Screenshots ==
98
 
99
- 1. An example audio playlist player.
100
- 2. A Popout playlist on a desktop.
101
- 3. A single file music player and a music playlist.
102
- 4. The plugin's Settings screen.
103
- 5. The plugin's Design screen.
104
- 6. Single-file Button audio players.
105
- 7. Single-file Text music players.
106
- 8. A Popout player playing on an Android phone.
 
 
 
 
 
 
107
 
108
 
109
  == Changelog ==
110
 
 
 
 
 
 
 
111
  = 2.4.2 =
112
- * Add new developer hook on settings page (players tab), to support the upcoming Single Player Downloads add-on.
113
- * Update javascript GMT methods with the current standard UTC methods.
114
 
115
  = 2.4.1 =
116
  * Compatibility update for WordPress 4.3, see (this thread)[https://make.wordpress.org/core/2015/07/02/deprecating-php4-style-constructors-in-wordpress-4-3/] for more info.
7
  License: GPLv2 or later
8
  Requires at least: 2.9
9
  Tested up to: 4.3
10
+ Stable tag: 2.5
11
 
12
  Easy, Flexible Audio for WordPress.
13
 
14
  == Description ==
15
 
16
+ = Mobile friendly HTML5 audio players and playlists =
17
 
18
  * Flexible multi-player audio plugin.
19
+ * Near-continuous playback between pages.
20
+ * Play from your media library, uploaded folders, and urls.
21
+ * Style, colour, and layout options.
22
+ * Audio player widgets, popout players and buttons, and smooth downloads.
23
  * Works with all built-in WordPress options for adding your music, including the recently introduced *Create Audio Playlist* drag & drop interface.
24
 
25
 
26
  [Basic Demo - Showing the included player skins](http://mp3-jplayer.com/player-skins/) <br>
27
+ [How to Add Audio Players](http://mp3-jplayer.com/adding-players/) <br>
28
  [Help & Docs main page](http://mp3-jplayer.com/help-docs/)
29
 
30
 
32
 
33
  * Add unlimited music players to pages, posts, sidebars, and template files.
34
  * Offer downloads to visitors or logged-in users.
35
+ * Playlist entire folders with a single line of shortcode.
36
  * Can be selectively integrated with WordPress default audio players.
37
  * Customise the colour scheme, fonts, title and image placements and more on the Player Design page.
38
  * A fully integrated Pop-out player that can be launched from playlist players, or from a stand-alone popout link.
97
 
98
  == Screenshots ==
99
 
100
+ 1. Example single-file audio players.
101
+ 2. Example audio playlist players.
102
+ 3. Example single-file audio players with text buttons.
103
+ 4. A popout player on a desktop.
104
+ 5. A Popout playlist playing on an Android phone.
105
+ 6. The player Design screen.
106
+ 7. The Admin settings page.
107
+ 8. Admin settings - Tab 2, Media Settings.
108
+ 9. Admin settings - Tab 3, Player Settings.
109
+ 10. Admin settings - Tab 4, Download Settings.
110
+ 11. Admin settings - Tab 5, Popout Settings.
111
+ 12. Admin settings - Tab 6, Advanced Settings.
112
+ 13. Help page examples at mp3-jplayer.com.
113
+ 14. More help page examples at mp3-jplayer.com.
114
 
115
 
116
  == Changelog ==
117
 
118
+ = 2.5 =
119
+ * New feature: Auto Resume, gives near-continuous audio between pages (there will be a short pause as the next page loads). Resuming will work wherever you have used the same piece of audio across pages.
120
+ * Updated the Settings page layout with clearer interfaces, better descriptions, and easier access to information.
121
+ * Added pagination controls to the Media Library files list on the settings page.
122
+ * Updated plugin security.
123
+
124
  = 2.4.2 =
125
+ * Added new developer hook on settings page (players tab), to support the upcoming Single Player Downloads add-on.
126
+ * Updated javascript GMT methods with the current standard UTC methods.
127
 
128
  = 2.4.1 =
129
  * Compatibility update for WordPress 4.3, see (this thread)[https://make.wordpress.org/core/2015/07/02/deprecating-php4-style-constructors-in-wordpress-4-3/] for more info.
remote/downloader.php CHANGED
@@ -1,85 +1,143 @@
1
  <?php
2
  /*
3
- Remote Downloader
4
- MP3-jPlayer 1.8.5
5
- www.sjward.org
 
6
  */
7
 
8
- function strip_scripts ( $field )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  {
10
  $search = array(
11
- '@<script[^>]*?>.*?</script>@si', // Strip out javascript
12
- '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly
13
- '@<![\s\S]*?--[ \t\n\r]*>@' // Strip multi-line comments including CDATA
 
 
14
  );
15
-
16
  $text = preg_replace( $search, '', $field );
17
  return $text;
18
  }
19
 
20
 
21
- $mp3 = false;
22
- $playerID = "";
23
- $fp = "";
24
- $file = "";
25
- $dbug = "";
26
- $sent = "";
27
- $rooturl = preg_replace("/^www\./i", "", $_SERVER['HTTP_HOST']);
28
 
29
- if ( isset($_GET['mp3']) ) {
30
 
31
- $mp3 = strip_tags($_GET['mp3']);
32
- $mp3 = rawurldecode( $mp3 );
33
- $mp3 = strip_scripts( $mp3 );
 
 
 
 
 
 
 
34
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  $playerID = ( isset($_GET['pID']) ) ? strip_tags($_GET['pID']) : "";
36
- $playerID = strip_scripts( $playerID );
 
 
 
 
 
37
 
 
38
  $matches = array();
39
- if ( preg_match("!\.(mp3|mp4|m4a|ogg|oga|wav|webm)$!i", $mp3, $matches) ) {
 
40
 
 
41
  $fileExtension = $matches[0];
42
  if ( $fileExtension === 'mp3' || $fileExtension === 'mp4' || $fileExtension === 'm4a' ) {
43
  $mimeType = 'audio/mpeg';
44
- }
45
- elseif( $fileExtension === 'ogg' || $fileExtension === 'oga' ) {
46
  $mimeType = 'audio/ogg';
47
- }
48
- else {
49
  $mimeType = 'audio/' . ( str_replace('.', '', $fileExtension) );
50
  }
51
 
52
- $sent = substr($mp3, 3);
53
- $file = substr(strrchr($sent, "/"), 1);
54
 
55
- if ( ($lp = strpos($sent, $rooturl)) || preg_match("!^/!", $sent) ) { //if local
56
-
57
- if ( $lp !== false ) { //a url
58
-
 
 
 
 
 
59
  $fp = str_replace($rooturl, "", $sent);
60
  $fp = str_replace("www.", "", $fp);
61
  $fp = str_replace("http://", "", $fp);
62
  $fp = str_replace("https://", "", $fp);
63
-
64
- } else { //a folder path
65
-
66
  $fp = $sent;
67
  }
68
 
69
- if ( ($fsize = @filesize($_SERVER['DOCUMENT_ROOT'] . $fp)) !== false ) { //if file can be read then set headers and cookie
 
 
 
 
 
 
 
 
 
 
70
 
 
 
 
 
71
  header('Accept-Ranges: bytes'); // download resume
72
  header('Content-Disposition: attachment; filename=' . $file);
73
- header('Content-Type: ' . $mimeType);
74
  header('Content-Length: ' . $fsize);
75
 
76
- @readfile($_SERVER['DOCUMENT_ROOT'] . $fp);
 
77
 
78
- //if past the readfile then something went wrong
79
- $dbug .= "#read failed";
80
 
81
  } else {
82
-
83
  $dbug .= "#no file";
84
  }
85
 
@@ -102,22 +160,7 @@ if ( isset($_GET['mp3']) ) {
102
  <!DOCTYPE html>
103
  <html>
104
  <head>
105
- <title>Download Audio</title>
106
  </head>
107
- <body>
108
-
109
- <?php
110
- $info = "<p>
111
- Get: " . $mp3 . "<br />
112
- Sent: " . $sent . "<br />
113
- File: " . $file . "<br />
114
- Open: " . $_SERVER['DOCUMENT_ROOT'] . $fp . "<br />
115
- Root: " . $rooturl . "<br />
116
- pID: " . $playerID . "<br />
117
- Dbug: " . $dbug . "<br /></p>";
118
-
119
- echo $info;
120
- ?>
121
-
122
  </body>
123
  </html>
1
  <?php
2
  /*
3
+ * Remote Downloader
4
+ * MP3-jPlayer 2.5
5
+ * http://mp3-jplayer.com
6
+ * ---
7
  */
8
 
9
+
10
+ //~~~ Flag
11
+ function checkCharsOK ( $string )
12
+ {
13
+ $badChars = 0;
14
+ $charArray = str_split( $string );
15
+
16
+ if ( is_array( $charArray ) ) {
17
+ foreach ( $charArray as $char ) {
18
+ $ascii = ord( $char );
19
+ if ( 0 === $ascii ) { //null bytes
20
+ $badChars += 1;
21
+ }
22
+ }
23
+ } else {
24
+ $badChars += 1;
25
+ }
26
+ return ( $badChars === 0 ? true : false );
27
+ }
28
+
29
+
30
+ //~~~ Clean
31
+ function stripScripts ( $field )
32
  {
33
  $search = array(
34
+ '@<script[^>]*?>.*?</script>@si', // Javascript
35
+ '@<style[^>]*?>.*?</style>@siU', // Style tags
36
+ '@<![\s\S]*?--[ \t\n\r]*>@', // Multi-line comments including CDATA
37
+ '@%00@', // Null bytes
38
+ '@\.\.@' // Traversals
39
  );
 
40
  $text = preg_replace( $search, '', $field );
41
  return $text;
42
  }
43
 
44
 
 
 
 
 
 
 
 
45
 
46
+ // Start ~~~~~~~~~~~~~~~~~~~~~~
47
 
48
+ $dbug = "";
49
+ $sent = "";
50
+ $mp3 = false;
51
+ $playerID = "";
52
+ $fp = "";
53
+ $file = "";
54
+ $rooturl = preg_replace("/^www\./i", "", $_SERVER['HTTP_HOST']);
55
+
56
+
57
+ if ( isset($_GET['mp3']) ) {
58
 
59
+
60
+ // Clean the url/path
61
+ $mp3 = strip_tags($_GET['mp3']);
62
+ $mp3 = rawurldecode( $mp3 );
63
+ $mp3 = stripScripts( $mp3 );
64
+ $sent = substr($mp3, 3);
65
+ if ( ! checkCharsOK( $sent ) ) {
66
+ die();
67
+ }
68
+
69
+
70
+ // Clean player ID
71
  $playerID = ( isset($_GET['pID']) ) ? strip_tags($_GET['pID']) : "";
72
+ $playerID = stripScripts( $playerID );
73
+ $playerID = preg_replace( '![^0-9]!', '', $playerID );
74
+ if ( $playerID == '' ) {
75
+ die();
76
+ }
77
+
78
 
79
+ // Check it's a valid file type
80
  $matches = array();
81
+ if ( preg_match("!\.(mp3|mp4|m4a|ogg|oga|wav|webm)$!i", $mp3, $matches) )
82
+ {
83
 
84
+ // Decide the mime type
85
  $fileExtension = $matches[0];
86
  if ( $fileExtension === 'mp3' || $fileExtension === 'mp4' || $fileExtension === 'm4a' ) {
87
  $mimeType = 'audio/mpeg';
88
+ } elseif( $fileExtension === 'ogg' || $fileExtension === 'oga' ) {
 
89
  $mimeType = 'audio/ogg';
90
+ } else {
 
91
  $mimeType = 'audio/' . ( str_replace('.', '', $fileExtension) );
92
  }
93
 
 
 
94
 
95
+ // Get the file's name
96
+ $file = substr( strrchr( $sent, "/" ), 1 );
97
+
98
+
99
+ // Check that the file is locally hosted
100
+ if ( ($lp = strpos($sent, $rooturl)) || preg_match("!^/!", $sent) )
101
+ {
102
+ if ( $lp !== false ) {
103
+ // It's url format, prep as path
104
  $fp = str_replace($rooturl, "", $sent);
105
  $fp = str_replace("www.", "", $fp);
106
  $fp = str_replace("http://", "", $fp);
107
  $fp = str_replace("https://", "", $fp);
108
+ } else {
109
+ // It's a path already
 
110
  $fp = $sent;
111
  }
112
 
113
+
114
+ // Bail if path to the file is not valid
115
+ $realPath = realpath( $_SERVER['DOCUMENT_ROOT'] . $fp );
116
+ if ( $realPath === false ) {
117
+ die();
118
+ }
119
+
120
+
121
+ // Try to send file
122
+ $fsize = @filesize( $realPath );
123
+ if ( $fsize !== false ) {
124
 
125
+ //set headers and cookie
126
+ header('Content-Type: ' . $mimeType);
127
+ $cookiename = 'mp3Download' . $playerID;
128
+ setcookie($cookiename, "true", 0, '/', '', '', false);
129
  header('Accept-Ranges: bytes'); // download resume
130
  header('Content-Disposition: attachment; filename=' . $file);
 
131
  header('Content-Length: ' . $fsize);
132
 
133
+ //Send the file
134
+ readfile( $realPath );
135
 
136
+ //If past readfile() then something went wrong
137
+ $dbug .= "#read failed";
138
 
139
  } else {
140
+
141
  $dbug .= "#no file";
142
  }
143
 
160
  <!DOCTYPE html>
161
  <html>
162
  <head>
 
163
  </head>
164
+ <body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  </body>
166
  </html>
template-functions.php CHANGED
@@ -1,6 +1,5 @@
1
  <?php
2
 
3
-
4
  //Widgets
5
  function mp3jplayer_widget_init() {
6
  register_widget( 'MP3_jPlayer' );
@@ -10,8 +9,6 @@ function mp3jshortcodes_widget_init() {
10
  }
11
 
12
 
13
-
14
-
15
  //hooks - settings
16
  function MJPsettings_players() {
17
  do_action( 'MJPsettings_players' );
@@ -32,6 +29,7 @@ function MJPsettings_submit() {
32
  do_action( 'MJPsettings_submit' );
33
  }
34
 
 
35
  //hooks - design
36
  function MJPdesign_text() {
37
  do_action( 'MJPdesign_text' );
@@ -51,7 +49,8 @@ function MJPdesign_mods() {
51
  function MJPdesign_submit() {
52
  do_action( 'MJPdesign_submit' );
53
  }
54
-
 
55
  //hooks - process
56
  function MJPfront_mp3t( $atts = array() ) {
57
  return apply_filters( 'MJPfront_mp3t', $atts );
@@ -65,32 +64,21 @@ function MJPfront_mp3j( $atts = array() ) {
65
  function mp3j_addscripts( $style = "" ) {
66
  do_action('mp3j_addscripts', $style);
67
  }
68
-
69
-
70
  function mp3j_put( $shortcodes = "" ) {
71
  do_action( 'mp3j_put', $shortcodes );
72
  }
73
-
74
-
75
  function mp3j_debug( $display = "" ) {
76
  do_action('mp3j_debug', $display);
77
  }
78
-
79
-
80
  function mp3j_grab_library( $format = "" ) {
81
  $lib = apply_filters('mp3j_grab_library', '' );
82
  return $lib;
83
  }
84
-
85
-
86
  function mp3j_settings ( $settings = array() ) {
87
  do_action('mp3j_settings', $settings );
88
  }
89
 
90
 
91
-
92
-
93
-
94
  //retired
95
  function mp3j_set_meta( $tracks, $captions = "", $startnum = 1 ) { } //since 1.7
96
  function mp3j_flag( $set = 1 ) { } //since 1.6
@@ -98,5 +86,126 @@ function mp3j_div() { } //since 1.8
98
 
99
 
100
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
 
102
  ?>
1
  <?php
2
 
 
3
  //Widgets
4
  function mp3jplayer_widget_init() {
5
  register_widget( 'MP3_jPlayer' );
9
  }
10
 
11
 
 
 
12
  //hooks - settings
13
  function MJPsettings_players() {
14
  do_action( 'MJPsettings_players' );
29
  do_action( 'MJPsettings_submit' );
30
  }
31
 
32
+
33
  //hooks - design
34
  function MJPdesign_text() {
35
  do_action( 'MJPdesign_text' );
49
  function MJPdesign_submit() {
50
  do_action( 'MJPdesign_submit' );
51
  }
52
+
53
+
54
  //hooks - process
55
  function MJPfront_mp3t( $atts = array() ) {
56
  return apply_filters( 'MJPfront_mp3t', $atts );
64
  function mp3j_addscripts( $style = "" ) {
65
  do_action('mp3j_addscripts', $style);
66
  }
 
 
67
  function mp3j_put( $shortcodes = "" ) {
68
  do_action( 'mp3j_put', $shortcodes );
69
  }
 
 
70
  function mp3j_debug( $display = "" ) {
71
  do_action('mp3j_debug', $display);
72
  }
 
 
73
  function mp3j_grab_library( $format = "" ) {
74
  $lib = apply_filters('mp3j_grab_library', '' );
75
  return $lib;
76
  }
 
 
77
  function mp3j_settings ( $settings = array() ) {
78
  do_action('mp3j_settings', $settings );
79
  }
80
 
81
 
 
 
 
82
  //retired
83
  function mp3j_set_meta( $tracks, $captions = "", $startnum = 1 ) { } //since 1.7
84
  function mp3j_flag( $set = 1 ) { } //since 1.6
86
 
87
 
88
 
89
+ // Fetch / Draw Library list
90
+ //~~~ Draw
91
+ function ax_mjp_liblist ()
92
+ {
93
+ $I = ax_mjp_getPostInfo();
94
+ $stuff = ax_mjp_getLibraryPaged( $I );
95
+ $html = '';
96
+
97
+ if ( isset( $stuff['results'] ) && is_array( $stuff['results'] ) ) {
98
+
99
+ $AUDIO = $stuff['results'];
100
+ $blank = '<span class="blank">-</span>';
101
+
102
+ $n = 1 + $I['offset'];
103
+ $rowClass = 'even';
104
+
105
+ $html .= '<div class="library-list"><table class="fileList">';
106
+ $html .= '<tr>';
107
+ $html .= '<th style="width:35px; padding-right:0;"></th>';
108
+ $html .= '<th style="width:20px; text-align:right;"></th>';
109
+ $html .= '<th>Title</th>';
110
+ $html .= '<th>Artist</th>';
111
+
112
+ $html .= '<th>Album</th>';
113
+ $html .= '<th>Caption</th>';
114
+ $html .= '<th>Uploaded</th>';
115
+ $html .= '<th>Filename</th>';
116
+ $html .= '</tr>';
117
+
118
+ foreach ( $AUDIO as $i => $post )
119
+ {
120
+ $id3data = wp_get_attachment_metadata( $post->ID, true );
121
+
122
+ if ( ! is_array( $id3data ) ) {
123
+ $id3data = array();
124
+ }
125
+ $id3data['artist'] = ( empty( $id3data['artist'] ) ) ? $blank : $id3data['artist'];
126
+ $id3data['album'] = ( empty( $id3data['album'] ) ) ? $blank : $id3data['album'];
127
+
128
+ $niceDate = date( 'jS F Y', strtotime( $post->post_date_gmt ) );
129
+ $rowClass = ( $rowClass === 'even' ) ? 'odd' : 'even';
130
+
131
+ $filename = strrchr( $post->guid, "/");
132
+ $filename = str_replace( "/", "", $filename );
133
+
134
+ $html .= '<tr class="' . $rowClass . '">';
135
+ $html .= '<td class="files-edit" style="width:35px; padding-right:0;"><a href="post.php?post=' . $post->ID . '&amp;action=edit" target="_blank">Edit</a></td>';
136
+ $html .= '<td class="files-number" style="width:20px; text-align:right;">' . $n . '</td>';
137
+ $html .= '<td class="files-title">' . $post->post_title . '</td>';
138
+ $html .= '<td class="files-artist">' . $id3data['artist'] . '</td>';
139
+
140
+ $html .= '<td class="files-album">' . $id3data['album'] . '</td>';
141
+ $html .= '<td class="files-caption">' . $post->post_excerpt . '</td>';
142
+ $html .= '<td class="files-date">' . $niceDate . '</td>';
143
+ $html .= '<td class="files-url">' . $filename . '</td>';
144
+ $html .= '</tr>';
145
+
146
+ $n++;
147
+ }
148
+ $html .= '</table></div>';
149
+
150
+ } else {
151
+ $html = '<p>No</p>';
152
+ $html .= '<span class="tabD">No audio in the Media Library, <a href="media-new.php">Upload new &raquo;</a></strong>';
153
+ }
154
+
155
+ echo $html . '#DATA#' . $stuff['rows'][0][0];
156
+ die();
157
+ }
158
+
159
+
160
+ //~~~ Get data
161
+ function ax_mjp_getLibraryPaged ( $I )
162
+ {
163
+ global $MP3JP;
164
+ $ops = $MP3JP->theSettings;
165
+ $LIB = false;
166
+
167
+ $MIMES = "post_mime_type = 'audio/mpeg' OR post_mime_type = 'audio/ogg' OR post_mime_type = 'audio/wav' OR post_mime_type = 'audio/webm'";
168
+
169
+ switch( $MP3JP->theSettings['library_sortcol'] ) {
170
+ case "date":
171
+ $order = " ORDER BY post_date " . $ops['library_direction'];
172
+ break;
173
+ case "title":
174
+ $order = " ORDER BY post_title " . $ops['library_direction'];
175
+ break;
176
+ case "caption":
177
+ $order = " ORDER BY post_excerpt " . $ops['library_direction'] . ", post_title " . $ops['library_direction'];
178
+ break;
179
+ default:
180
+ $order = "";
181
+ }
182
+
183
+ $offset = ( isset( $I['offset'] ) ) ? $I['offset'] . ',' : '0,';
184
+ $limit = ( isset( $I['limit'] ) && 'all' !== $I['limit'] ) ? ' LIMIT ' . $offset . $I['limit'] : '';
185
+
186
+ global $wpdb;
187
+ $results = $wpdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->posts WHERE " . $MIMES . $order . $limit );
188
+ $totalRows = $wpdb->get_results( 'SELECT FOUND_ROWS()', ARRAY_N );
189
+
190
+ return array(
191
+ 'results' => $results,
192
+ 'rows' => $totalRows,
193
+ );
194
+ }
195
+
196
+
197
+ //~~~ Clean POST
198
+ function ax_mjp_getPostInfo ()
199
+ {
200
+ global $MP3JP;
201
+ $cleaned = array();
202
+ if ( isset( $_POST['info'] ) && is_array( $_POST['info'] ) ) {
203
+ foreach ( $_POST['info'] as $k => $val ) {
204
+ $cleaned[ $k ] = $MP3JP->strip_scripts( $val );
205
+ }
206
+ }
207
+ return $cleaned;
208
+ }
209
+
210
 
211
  ?>
widget-ui.php CHANGED
@@ -236,7 +236,7 @@ if ( class_exists("WP_Widget") ) {
236
 
237
  <input type="radio" id="<?php echo $this->get_field_id( 'widget_mode' ); ?>_2" name="<?php echo $this->get_field_name( 'widget_mode' ); ?>" value="2" <?php if ($instance['widget_mode'] == "2") { _e('checked="checked"', "mp3jplayerwidget"); }?> />
238
  <label for="<?php echo $this->get_field_id( 'widget_mode' ); ?>_2"><strong>Write a Playlist...</strong></label>
239
- <p style="margin:3px 0 10px 18px;"><span class="description">A <code><?php echo $MP3JP->theSettings['f_separator']; ?></code> separated list of URI's, library/default folder filenames, or FEEDs.</span></p>
240
  <div style="margin:0px 0 15px 24px;"><textarea class="widefat" style="font-size:11px;" rows="4" cols="80" id="<?php echo $this->get_field_id( 'arb_playlist' ); ?>" name="<?php echo $this->get_field_name( 'arb_playlist' ); ?>"><?php echo $instance['arb_playlist']; ?></textarea></div>
241
 
242
  <input type="radio" id="<?php echo $this->get_field_id( 'widget_mode' ); ?>_3" name="<?php echo $this->get_field_name( 'widget_mode' ); ?>" value="3" <?php if ($instance['widget_mode'] == "3") { _e('checked="checked"', "mp3jplayerwidget"); }?> />
@@ -386,6 +386,7 @@ if ( class_exists("WP_Widget") ) {
386
 
387
  <hr/><br>
388
 
 
389
  <?php
390
  }
391
  } //end class
236
 
237
  <input type="radio" id="<?php echo $this->get_field_id( 'widget_mode' ); ?>_2" name="<?php echo $this->get_field_name( 'widget_mode' ); ?>" value="2" <?php if ($instance['widget_mode'] == "2") { _e('checked="checked"', "mp3jplayerwidget"); }?> />
238
  <label for="<?php echo $this->get_field_id( 'widget_mode' ); ?>_2"><strong>Write a Playlist...</strong></label>
239
+ <p style="margin:3px 0 10px 18px;"><span class="description">A <code><?php echo $MP3JP->theSettings['f_separator']; ?></code> separated list of URLs, library/default folder filenames, or FEEDs.</span></p>
240
  <div style="margin:0px 0 15px 24px;"><textarea class="widefat" style="font-size:11px;" rows="4" cols="80" id="<?php echo $this->get_field_id( 'arb_playlist' ); ?>" name="<?php echo $this->get_field_name( 'arb_playlist' ); ?>"><?php echo $instance['arb_playlist']; ?></textarea></div>
241
 
242
  <input type="radio" id="<?php echo $this->get_field_id( 'widget_mode' ); ?>_3" name="<?php echo $this->get_field_name( 'widget_mode' ); ?>" value="3" <?php if ($instance['widget_mode'] == "3") { _e('checked="checked"', "mp3jplayerwidget"); }?> />
386
 
387
  <hr/><br>
388
 
389
+
390
  <?php
391
  }
392
  } //end class