MP3-jPlayer - Version 2.7

Version Description

  • Added option to show the players to logged in users only. This is a global option. The setting is at the top of the 'Advanced' tab on the settings page.
  • Fixed admin-side bug with the list colour pickers on the 'Design' page.
  • Removed redundant update routines.
  • Added developer methods for accessing the shortcode atts, and extending the js track objects.
Download this release

Release Info

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

Code changes from version 2.6 to 2.7

admin-colours.php CHANGED
@@ -34,7 +34,7 @@ function mp3j_print_colours_page()
34
 
35
 
36
  //update
37
- update_option($MP3JP->adminOptionsName, $O);
38
  $MP3JP->theSettings = $O;
39
 
40
  MJPdesign_submit();
@@ -100,7 +100,7 @@ function mp3j_print_colours_page()
100
  ?>
101
 
102
  <div class="wrap">
103
- <h2>&nbsp;</h2>
104
  <h1><?php _e( 'Player Design', 'mp3-jplayer' ); ?></h1>
105
  <p>&nbsp;</p>
106
 
@@ -209,7 +209,7 @@ function mp3j_print_colours_page()
209
  <div class="buttons-wrap-mjp">
210
  <div class="playlist-toggle-MI" id="listtog-mjp">HIDE PLAYLIST</div>
211
  <div class="mp3j-popout-MI"><?php echo $O['popout_button_title']; ?></div>
212
- <div id="download_mp3j_1" class="dloadmp3-MI"></div>
213
  </div>
214
  </div>
215
 
@@ -228,9 +228,9 @@ function mp3j_print_colours_page()
228
  <div class="playlist-colour" id="playerBG2"></div>
229
  <div class="wrapper-mjp">
230
  <ul id="ul-mjp" class="ul-mjp<?php echo $ulClass . $liClass . $listWeight. $listItalic . $listAlign; ?>">
231
- <li class="li-mjp"><a id="playerT2" class="a-mjp" href="#"><?php _e( 'Example List Item', 'mp3-jplayer' ); ?></a></li>
232
- <li class="li-mjp"><a id="playerT3" class="a-mjp" style="background:<?php echo $C['listBGa_hover']; ?>; color:<?php echo $C['list_hover_colour']; ?>;" href="#"><?php _e( 'Example List item (hover)', 'mp3-jplayer' ); ?></a></li>
233
- <li class="li-mjp mjp-li-last"><a id="playerT4" class="a-mjp mp3j_A_current" style="background:<?php echo $C['listBGa_current']; ?>; color:<?php echo $C['list_current_colour']; ?>;" href="#"><?php _e( 'Example List Item (Current)', 'mp3-jplayer' ); ?></a></li>
234
  </ul>
235
  </div>
236
  </div>
@@ -251,11 +251,11 @@ function mp3j_print_colours_page()
251
 
252
  <!-- TABS start -->
253
  <div class="mp3j-tabbuttons-wrap">
254
- <div class="mp3j-tabbutton" id="mp3j_tabbutton_0"><?php _e( 'Text', 'mp3-jplayer' ); ?></div>
255
  <div class="mp3j-tabbutton" id="mp3j_tabbutton_1"><?php _e( 'Areas', 'mp3-jplayer' ); ?></div>
256
  <div class="mp3j-tabbutton" id="mp3j_tabbutton_2"><?php _e( 'Fonts', 'mp3-jplayer' ); ?></div>
257
  <div class="mp3j-tabbutton" id="mp3j_tabbutton_3"><?php _e( 'Alignments', 'mp3-jplayer' ); ?></div>
258
- <div class="mp3j-tabbutton" id="mp3j_tabbutton_4"><?php _ex( 'Mods', 'as in modifications', 'mp3-jplayer' ); ?></div>
259
  <br class="clearB" />
260
  </div>
261
  <div class="mp3j-tabs-wrap">
@@ -323,7 +323,7 @@ function mp3j_print_colours_page()
323
  <div class="patch fR">
324
  <div id="patchBG6" onclick="MP3jP.clickPatch('BG6','');" class="PatchCol" style="background-color:<?php echo $C['listBGa_current']; ?>;" title="Retrieve"></div>
325
  <div id="minusBG6" class="minus" onclick="MP3jP.clickMinus('BG6','background-color','T4');"></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;"><?php _e( 'Background', 'mp3-jplayer' ); ?></span></td>
@@ -387,7 +387,7 @@ function mp3j_print_colours_page()
387
  </div>
388
 
389
  <div style="float:left; width:230px; height:273px; overflow:hidden;">
390
- <input type="text" value="#5985bc" id="spectrumPicker" />
391
  </div>
392
  </div><!-- close TAB -->
393
 
@@ -498,7 +498,7 @@ function mp3j_print_colours_page()
498
  </div>
499
 
500
  <div style="float:left; width:230px; min-height:273px; overflow:hidden;">
501
- <input type="text" value="rgb(80, 168, 79)" id="spectrumPickerAlpha" />
502
  </div>
503
  </div><!-- close TAB -->
504
 
@@ -509,7 +509,7 @@ function mp3j_print_colours_page()
509
  <table class="colours unselectable">
510
  <tr>
511
  <td><strong><?php _e( 'Titles:', 'mp3-jplayer' ); ?></strong></td>
512
- <td><select id="font_family_1" name="font_family_1" style="width:110px; font-size:11px;">
513
  <option value="theme"<?php if ( 'theme' == $C['font_family_1'] ) { echo ' selected="selected"'; } ?>><?php _e( 'Theme\'s Font', 'mp3-jplayer' ); ?></option>
514
  <option value="arial"<?php if ( 'arial' == $C['font_family_1'] ) { echo ' selected="selected"'; } ?>><?php _e( 'Arial', 'mp3-jplayer' ); ?></option>
515
  <option value="verdana"<?php if ( 'verdana' == $C['font_family_1'] ) { echo ' selected="selected"'; } ?>><?php _e( 'Verdana', 'mp3-jplayer' ); ?></option>
@@ -545,7 +545,7 @@ function mp3j_print_colours_page()
545
  </tr>
546
  <tr>
547
  <td><strong><?php _e( 'Playlist:', 'mp3-jplayer' ); ?></strong></td>
548
- <td><select id="font_family_2" name="font_family_2" style="width:110px; font-size:11px;">
549
  <option value="theme"<?php if ( 'theme' == $C['font_family_2'] ) { echo ' selected="selected"'; } ?>><?php _e( 'Theme\'s Font', 'mp3-jplayer' ); ?></option>
550
  <option value="arial"<?php if ( 'arial' == $C['font_family_2'] ) { echo ' selected="selected"'; } ?>><?php _e( 'Arial', 'mp3-jplayer' ); ?></option>
551
  <option value="verdana"<?php if ( 'verdana' == $C['font_family_2'] ) { echo ' selected="selected"'; } ?>><?php _e( 'Verdana', 'mp3-jplayer' ); ?></option>
34
 
35
 
36
  //update
37
+ update_option( MP3J_SETTINGS_NAME, $O );
38
  $MP3JP->theSettings = $O;
39
 
40
  MJPdesign_submit();
100
  ?>
101
 
102
  <div class="wrap">
103
+ <h2 style="font-size:4px;line-height:4px;">&nbsp;</h2>
104
  <h1><?php _e( 'Player Design', 'mp3-jplayer' ); ?></h1>
105
  <p>&nbsp;</p>
106
 
209
  <div class="buttons-wrap-mjp">
210
  <div class="playlist-toggle-MI" id="listtog-mjp">HIDE PLAYLIST</div>
211
  <div class="mp3j-popout-MI"><?php echo $O['popout_button_title']; ?></div>
212
+ <div id="download_mp3j_1" class="dloadmp3-MI"><a class=""><?php echo $O['dload_text']; ?></a></div>
213
  </div>
214
  </div>
215
 
228
  <div class="playlist-colour" id="playerBG2"></div>
229
  <div class="wrapper-mjp">
230
  <ul id="ul-mjp" class="ul-mjp<?php echo $ulClass . $liClass . $listWeight. $listItalic . $listAlign; ?>">
231
+ <li class="li-mjp"><a id="playerT2" class="a-mjp" href="#"><?php _e( 'Example List Item', 'mp3-jplayer' ); ?><br><span><?php _e( 'Example Caption', 'mp3-jplayer' ); ?></span></a></li>
232
+ <li class="li-mjp"><a id="playerT3" class="a-mjp" style="background:<?php echo $C['listBGa_hover']; ?>; color:<?php echo $C['list_hover_colour']; ?>;" href="#"><?php _e( 'Example List item (hover)', 'mp3-jplayer' ); ?><br><span><?php _e( 'Example Caption', 'mp3-jplayer' ); ?></span></a></li>
233
+ <li class="li-mjp mjp-li-last"><a id="playerT4" class="a-mjp" style="background:<?php echo $C['listBGa_current']; ?>; color:<?php echo $C['list_current_colour']; ?>;" href="#"><?php _e( 'Example List Item (Current)', 'mp3-jplayer' ); ?><br><span><?php _e( 'Example Caption', 'mp3-jplayer' ); ?></span></a></li>
234
  </ul>
235
  </div>
236
  </div>
251
 
252
  <!-- TABS start -->
253
  <div class="mp3j-tabbuttons-wrap">
254
+ <div class="mp3j-tabbutton first" id="mp3j_tabbutton_0"><?php _e( 'Text', 'mp3-jplayer' ); ?></div>
255
  <div class="mp3j-tabbutton" id="mp3j_tabbutton_1"><?php _e( 'Areas', 'mp3-jplayer' ); ?></div>
256
  <div class="mp3j-tabbutton" id="mp3j_tabbutton_2"><?php _e( 'Fonts', 'mp3-jplayer' ); ?></div>
257
  <div class="mp3j-tabbutton" id="mp3j_tabbutton_3"><?php _e( 'Alignments', 'mp3-jplayer' ); ?></div>
258
+ <div class="mp3j-tabbutton last" id="mp3j_tabbutton_4"><?php _ex( 'Mods', 'as in modifications', 'mp3-jplayer' ); ?></div>
259
  <br class="clearB" />
260
  </div>
261
  <div class="mp3j-tabs-wrap">
323
  <div class="patch fR">
324
  <div id="patchBG6" onclick="MP3jP.clickPatch('BG6','');" class="PatchCol" style="background-color:<?php echo $C['listBGa_current']; ?>;" title="Retrieve"></div>
325
  <div id="minusBG6" class="minus" onclick="MP3jP.clickMinus('BG6','background-color','T4');"></div>
326
+ <div id="plusBG6" class="plus" onclick="MP3jP.clickPlus('BG6','background-color','T4');"></div>
327
  </div>
328
  </td>
329
  <td><span class="" style="font-size:12px;"><?php _e( 'Background', 'mp3-jplayer' ); ?></span></td>
387
  </div>
388
 
389
  <div style="float:left; width:230px; height:273px; overflow:hidden;">
390
+ <input type="text" value="#bc5c5c" id="spectrumPicker" />
391
  </div>
392
  </div><!-- close TAB -->
393
 
498
  </div>
499
 
500
  <div style="float:left; width:230px; min-height:273px; overflow:hidden;">
501
+ <input type="text" value="rgb(189,89,89)" id="spectrumPickerAlpha" />
502
  </div>
503
  </div><!-- close TAB -->
504
 
509
  <table class="colours unselectable">
510
  <tr>
511
  <td><strong><?php _e( 'Titles:', 'mp3-jplayer' ); ?></strong></td>
512
+ <td><select id="font_family_1" name="font_family_1" style="width:110px; font-size:12px;">
513
  <option value="theme"<?php if ( 'theme' == $C['font_family_1'] ) { echo ' selected="selected"'; } ?>><?php _e( 'Theme\'s Font', 'mp3-jplayer' ); ?></option>
514
  <option value="arial"<?php if ( 'arial' == $C['font_family_1'] ) { echo ' selected="selected"'; } ?>><?php _e( 'Arial', 'mp3-jplayer' ); ?></option>
515
  <option value="verdana"<?php if ( 'verdana' == $C['font_family_1'] ) { echo ' selected="selected"'; } ?>><?php _e( 'Verdana', 'mp3-jplayer' ); ?></option>
545
  </tr>
546
  <tr>
547
  <td><strong><?php _e( 'Playlist:', 'mp3-jplayer' ); ?></strong></td>
548
+ <td><select id="font_family_2" name="font_family_2" style="width:110px; font-size:12px;">
549
  <option value="theme"<?php if ( 'theme' == $C['font_family_2'] ) { echo ' selected="selected"'; } ?>><?php _e( 'Theme\'s Font', 'mp3-jplayer' ); ?></option>
550
  <option value="arial"<?php if ( 'arial' == $C['font_family_2'] ) { echo ' selected="selected"'; } ?>><?php _e( 'Arial', 'mp3-jplayer' ); ?></option>
551
  <option value="verdana"<?php if ( 'verdana' == $C['font_family_2'] ) { echo ' selected="selected"'; } ?>><?php _e( 'Verdana', 'mp3-jplayer' ); ?></option>
admin-settings.php CHANGED
@@ -1,12 +1,5 @@
1
  <?php
2
 
3
-
4
- function drawSplashScreen_mp3j ()
5
- {
6
- echo '<br><br><br><p>Thanks for updating!</p><br><br>';
7
- }
8
-
9
-
10
  function mp3j_print_admin_page()
11
  {
12
 
@@ -18,84 +11,47 @@ function mp3j_print_admin_page()
18
  if ( isset( $_POST['update_mp3foxSettings'] ) )
19
  {
20
  //prep/sanitize values
21
- if (isset($_POST['mp3foxVol'])) {
22
- $O['initial_vol'] = preg_replace("/[^0-9]/", "", $_POST['mp3foxVol']);
23
- if ($O['initial_vol'] < 0 || $O['initial_vol']=="") { $O['initial_vol'] = "0"; }
24
- if ($O['initial_vol'] > 100) { $O['initial_vol'] = "100"; }
25
- }
26
- if (isset($_POST['mp3foxPopoutMaxHeight'])) {
27
- $O['popout_max_height'] = preg_replace("/[^0-9]/", "", $_POST['mp3foxPopoutMaxHeight']);
28
- if ( $O['popout_max_height'] == "" ) { $O['popout_max_height'] = "750"; }
29
- if ( $O['popout_max_height'] < 200 ) { $O['popout_max_height'] = "200"; }
30
- if ( $O['popout_max_height'] > 1200 ) { $O['popout_max_height'] = "1200"; }
31
- }
32
- if (isset($_POST['mp3foxPopoutWidth'])) {
33
- $O['popout_width'] = preg_replace("/[^0-9]/", "", $_POST['mp3foxPopoutWidth']);
34
- if ( $O['popout_width'] == "" ) { $O['popout_width'] = "400"; }
35
- if ( $O['popout_width'] < 250 ) { $O['popout_width'] = "250"; }
36
- if ( $O['popout_width'] > 1600 ) { $O['popout_width'] = "1600"; }
37
- }
38
- if (isset($_POST['mp3foxMaxListHeight'])) {
39
- $O['max_list_height'] = preg_replace("/[^0-9]/", "", $_POST['mp3foxMaxListHeight']);
40
- if ( $O['max_list_height'] < 0 ) { $O['max_list_height'] = ""; }
41
- }
42
- if (isset($_POST['mp3foxfolder'])) {
43
- $O['mp3_dir'] = $MP3JP->prep_path( $_POST['mp3foxfolder'] );
44
- }
45
- if (isset($_POST['mp3foxPopoutBGimage'])) {
46
- $O['popout_background_image'] = $MP3JP->prep_path( $_POST['mp3foxPopoutBGimage'] );
47
- }
48
-
49
- $O['dloader_remote_path'] = ( isset($_POST['dloader_remote_path']) ) ? $MP3JP->prep_value( $_POST['dloader_remote_path'] ) : "";
50
- $O['loggedout_dload_link'] = ( $_POST['loggedout_dload_link'] == "" ) ? "" : $MP3JP->prep_value( $_POST['loggedout_dload_link'] ); //allow it to be empty
51
-
52
- if (isset($_POST['mp3foxFloat'])) {
53
- $O['player_float'] = $MP3JP->prep_value( $_POST['mp3foxFloat'] );
54
- }
55
- if (isset($_POST['librarySortcol'])) {
56
- $O['library_sortcol'] = $MP3JP->prep_value( $_POST['librarySortcol'] );
57
- }
58
- if (isset($_POST['libraryDirection'])) {
59
- $O['library_direction'] = $MP3JP->prep_value( $_POST['libraryDirection'] );
60
- }
61
- if (isset($_POST['folderFeedSortcol'])) {
62
- $O['folderFeedSortcol'] = $MP3JP->prep_value( $_POST['folderFeedSortcol'] );
63
- }
64
- if (isset($_POST['folderFeedDirection'])) {
65
- $O['folderFeedDirection'] = $MP3JP->prep_value( $_POST['folderFeedDirection'] );
66
- }
67
- if (isset($_POST['file_separator'])) {
68
- $O['f_separator'] = $MP3JP->prep_value( $_POST['file_separator'] );
69
- }
70
- if (isset($_POST['caption_separator'])) {
71
- $O['c_separator'] = $MP3JP->prep_value( $_POST['caption_separator'] );
72
- }
73
- if (isset($_POST['mp3foxDownloadMp3'])) {
74
- $O['show_downloadmp3'] = $MP3JP->prep_value( $_POST['mp3foxDownloadMp3'] );
75
- }
76
- if (isset($_POST['replacerShortcode_playlist'])) {
77
- $O['replacerShortcode_playlist'] = $MP3JP->prep_value( $_POST['replacerShortcode_playlist'] );
78
- }
79
- if (isset($_POST['replacerShortcode_single'])) {
80
- $O['replacerShortcode_single'] = $MP3JP->prep_value( $_POST['replacerShortcode_single'] );
81
- }
82
- if (isset($_POST['showErrors'])) {
83
- $O['showErrors'] = $MP3JP->prep_value( $_POST['showErrors'] );
84
- }
85
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
 
87
  $O['playerTitle1'] = ( isset( $_POST['playerTitle1'] ) ) ? $MP3JP->prep_value( $_POST['playerTitle1'] ) : '';
88
  $O['playerTitle2'] = ( isset( $_POST['playerTitle2'] ) ) ? $MP3JP->prep_value( $_POST['playerTitle2'] ) : '';
89
 
90
-
91
  $O['mp3tColour_on'] = ( isset($_POST['mp3tColour_on']) ) ? "true" : "false";
92
- if (isset($_POST['mp3tColour'])) {
93
- $O['mp3tColour'] = $MP3JP->prep_value( $_POST['mp3tColour'] );
94
- }
95
  $O['mp3jColour_on'] = ( isset($_POST['mp3jColour_on']) ) ? "true" : "false";
96
- if (isset($_POST['mp3jColour'])) {
97
- $O['mp3jColour'] = $MP3JP->prep_value( $_POST['mp3jColour'] );
98
- }
99
 
100
  $O['echo_debug'] = ( isset($_POST['mp3foxEchoDebug']) ) ? "true" : "false";
101
  $O['add_track_numbering'] = ( isset($_POST['mp3foxAddTrackNumbers']) ) ? "true" : "false";
@@ -105,7 +61,6 @@ function mp3j_print_admin_page()
105
  $O['run_shcode_in_excerpt'] = ( isset($_POST['runShcodeInExcerpt']) ) ? "true" : "false";
106
  $O['volslider_on_singles'] = ( isset($_POST['volslider_onsingles']) ) ? "true" : "false";
107
  $O['volslider_on_mp3j'] = ( isset($_POST['volslider_onmp3j']) ) ? "true" : "false";
108
- //$O['touch_punch_js'] = ( isset($_POST['touch_punch_js']) ) ? "true" : "false";
109
  $O['force_browser_dload'] = ( isset($_POST['force_browser_dload']) ) ? "true" : "false";
110
  $O['make_player_from_link'] = ( isset($_POST['make_player_from_link']) ) ? "true" : "false";
111
  $O['auto_play'] = ( isset($_POST['mp3foxAutoplay']) ) ? "true" : "false";
@@ -120,15 +75,12 @@ function mp3j_print_admin_page()
120
  $O['replace_WP_attached'] = ( isset($_POST['replace_WP_attached']) ) ? "true" : "false";
121
  $O['autoCounterpart'] = ( isset($_POST['autoCounterpart']) ) ? "true" : "false";
122
  $O['allowRangeRequests'] = ( isset($_POST['allowRangeRequests']) ) ? "true" : "false";
123
-
124
  $O['flipMP3j'] = ( isset($_POST['flipMP3j']) ) ? "false" : "true";
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";
132
 
133
  $O['paddings_top'] = ( $_POST['mp3foxPaddings_top'] == "" ) ? "0px" : $MP3JP->prep_value( $_POST['mp3foxPaddings_top'] );
134
  $O['paddings_bottom'] = ( $_POST['mp3foxPaddings_bottom'] == "" ) ? "0px" : $MP3JP->prep_value( $_POST['mp3foxPaddings_bottom'] );
@@ -152,29 +104,19 @@ function mp3j_print_admin_page()
152
  $O['audioFormats']['mp3'] = "true";
153
  }
154
 
155
- if (isset($_POST['mp3foxPlayerWidth'])) {
156
- $O['player_width'] = $MP3JP->prep_value( $_POST['mp3foxPlayerWidth'] );
157
- }
158
- if (isset($_POST['disableJSlibs'])) {
159
- $O['disable_jquery_libs'] = ( preg_match("/^yes$/i", $_POST['disableJSlibs']) ) ? "yes" : "";
160
- }
161
- if ( isset($_POST['mp3foxPopoutButtonText']) ) {
162
- $O['popout_button_title'] = $MP3JP->strip_scripts( $_POST['mp3foxPopoutButtonText'] );
163
- }
164
- if ( isset($_POST['make_player_from_link_shcode']) ) {
165
- $O['make_player_from_link_shcode'] = $MP3JP->strip_scripts( $_POST['make_player_from_link_shcode'] );
166
- }
167
- if ( isset($_POST['mp3foxPopoutBackground']) ) {
168
- $O['popout_background'] = $MP3JP->prep_value( $_POST['mp3foxPopoutBackground'] );
169
- }
170
- if ( isset($_POST['mp3foxPluginVersion']) ) {
171
- $O['db_plugin_version'] = $MP3JP->prep_value( $_POST['mp3foxPluginVersion'] );
172
- }
173
 
174
- update_option($MP3JP->adminOptionsName, $O);
 
175
  $MP3JP->theSettings = $O;
176
  $MP3JP->setAllowedFeedTypesArrays();
177
 
 
178
  MJPsettings_submit();
179
  ?>
180
 
@@ -383,6 +325,8 @@ function mp3j_print_admin_page()
383
  <p class="description"><?php _e( 'Automatic Counterparts are chosen with the following format priority: OGG, WEBM, WAV.', 'mp3-jplayer' ); ?></p>
384
  </div>
385
  <br>
 
 
386
  </div>
387
 
388
 
@@ -670,6 +614,14 @@ function mp3j_print_admin_page()
670
  <td><input type="text" style="width:150px;" name="dload_text" value="<?php echo $O['dload_text']; ?>" /></td>
671
  </tr>
672
 
 
 
 
 
 
 
 
 
673
  <tr>
674
  <td colspan="2"><br><hr></td>
675
  </tr>
@@ -717,7 +669,7 @@ function mp3j_print_admin_page()
717
  </td>
718
  </tr>
719
  </table>
720
- <p class="description" style="margin:0px 0 10px 4px; font-size:14px;"><?php _e( 'If you play from other domains and want smooth downloads, then use the field above to specify a path to the downloader file.', 'mp3-jplayer' ); ?> <strong><a href="<?php echo $MP3JP->PluginFolder; ?>/remote/help.txt">See help on setting this up</a></strong></p>
721
  <br>
722
 
723
  </div>
@@ -764,6 +716,16 @@ function mp3j_print_admin_page()
764
  <div class="mp3j-tab" id="mp3j_tab_2">
765
 
766
  <br>
 
 
 
 
 
 
 
 
 
 
767
  <p class="description" style="font-size:14px; margin-bottom:20px;"><?php _e( 'Choose which aspects of your content you\'d like MP3-jPlayer to handle.', 'mp3-jplayer' ); ?></p>
768
  <table class="advancedSettingsTable">
769
  <tr>
1
  <?php
2
 
 
 
 
 
 
 
 
3
  function mp3j_print_admin_page()
4
  {
5
 
11
  if ( isset( $_POST['update_mp3foxSettings'] ) )
12
  {
13
  //prep/sanitize values
14
+ $O['initial_vol'] = preg_replace("/[^0-9]/", "", $_POST['mp3foxVol']);
15
+ if ($O['initial_vol'] < 0 || $O['initial_vol']=="") { $O['initial_vol'] = "0"; }
16
+ if ($O['initial_vol'] > 100) { $O['initial_vol'] = "100"; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
+ $O['popout_max_height'] = preg_replace("/[^0-9]/", "", $_POST['mp3foxPopoutMaxHeight']);
19
+ if ( $O['popout_max_height'] == "" ) { $O['popout_max_height'] = "750"; }
20
+ if ( $O['popout_max_height'] < 200 ) { $O['popout_max_height'] = "200"; }
21
+ if ( $O['popout_max_height'] > 1200 ) { $O['popout_max_height'] = "1200"; }
22
+
23
+ $O['popout_width'] = preg_replace("/[^0-9]/", "", $_POST['mp3foxPopoutWidth']);
24
+ if ( $O['popout_width'] == "" ) { $O['popout_width'] = "400"; }
25
+ if ( $O['popout_width'] < 250 ) { $O['popout_width'] = "250"; }
26
+ if ( $O['popout_width'] > 1600 ) { $O['popout_width'] = "1600"; }
27
+
28
+ $O['max_list_height'] = preg_replace("/[^0-9]/", "", $_POST['mp3foxMaxListHeight']);
29
+ if ( $O['max_list_height'] < 0 ) { $O['max_list_height'] = ""; }
30
+
31
+ $O['mp3_dir'] = $MP3JP->prep_path( $_POST['mp3foxfolder'] );
32
+ $O['popout_background_image'] = $MP3JP->prep_path( $_POST['mp3foxPopoutBGimage'] );
33
+ $O['dloader_remote_path'] = $MP3JP->prep_value( $_POST['dloader_remote_path'] );
34
+ $O['loggedout_dload_link'] = $MP3JP->prep_value( $_POST['loggedout_dload_link'] );
35
+ $O['player_float'] = $MP3JP->prep_value( $_POST['mp3foxFloat'] );
36
+ $O['library_sortcol'] = $MP3JP->prep_value( $_POST['librarySortcol'] );
37
+ $O['library_direction'] = $MP3JP->prep_value( $_POST['libraryDirection'] );
38
+ $O['folderFeedSortcol'] = $MP3JP->prep_value( $_POST['folderFeedSortcol'] );
39
+ $O['folderFeedDirection'] = $MP3JP->prep_value( $_POST['folderFeedDirection'] );
40
+ $O['f_separator'] = $MP3JP->prep_value( $_POST['file_separator'] );
41
+ $O['c_separator'] = $MP3JP->prep_value( $_POST['caption_separator'] );
42
+ $O['show_downloadmp3'] = $MP3JP->prep_value( $_POST['mp3foxDownloadMp3'] );
43
+ $O['replacerShortcode_playlist'] = $MP3JP->prep_value( $_POST['replacerShortcode_playlist'] );
44
+ $O['replacerShortcode_single'] = $MP3JP->prep_value( $_POST['replacerShortcode_single'] );
45
+ $O['showErrors'] = $MP3JP->prep_value( $_POST['showErrors'] );
46
 
47
  $O['playerTitle1'] = ( isset( $_POST['playerTitle1'] ) ) ? $MP3JP->prep_value( $_POST['playerTitle1'] ) : '';
48
  $O['playerTitle2'] = ( isset( $_POST['playerTitle2'] ) ) ? $MP3JP->prep_value( $_POST['playerTitle2'] ) : '';
49
 
 
50
  $O['mp3tColour_on'] = ( isset($_POST['mp3tColour_on']) ) ? "true" : "false";
51
+ $O['mp3tColour'] = $MP3JP->prep_value( $_POST['mp3tColour'] );
52
+
 
53
  $O['mp3jColour_on'] = ( isset($_POST['mp3jColour_on']) ) ? "true" : "false";
54
+ $O['mp3jColour'] = $MP3JP->prep_value( $_POST['mp3jColour'] );
 
 
55
 
56
  $O['echo_debug'] = ( isset($_POST['mp3foxEchoDebug']) ) ? "true" : "false";
57
  $O['add_track_numbering'] = ( isset($_POST['mp3foxAddTrackNumbers']) ) ? "true" : "false";
61
  $O['run_shcode_in_excerpt'] = ( isset($_POST['runShcodeInExcerpt']) ) ? "true" : "false";
62
  $O['volslider_on_singles'] = ( isset($_POST['volslider_onsingles']) ) ? "true" : "false";
63
  $O['volslider_on_mp3j'] = ( isset($_POST['volslider_onmp3j']) ) ? "true" : "false";
 
64
  $O['force_browser_dload'] = ( isset($_POST['force_browser_dload']) ) ? "true" : "false";
65
  $O['make_player_from_link'] = ( isset($_POST['make_player_from_link']) ) ? "true" : "false";
66
  $O['auto_play'] = ( isset($_POST['mp3foxAutoplay']) ) ? "true" : "false";
75
  $O['replace_WP_attached'] = ( isset($_POST['replace_WP_attached']) ) ? "true" : "false";
76
  $O['autoCounterpart'] = ( isset($_POST['autoCounterpart']) ) ? "true" : "false";
77
  $O['allowRangeRequests'] = ( isset($_POST['allowRangeRequests']) ) ? "true" : "false";
 
78
  $O['flipMP3j'] = ( isset($_POST['flipMP3j']) ) ? "false" : "true";
79
  $O['flipMP3t'] = ( isset($_POST['flipMP3t']) ) ? "true" : "false";
 
80
  $O['hasListMeta'] = ( isset($_POST['hasListMeta']) ) ? "true" : "false";
81
  $O['autoResume'] = ( isset($_POST['autoResume']) ) ? "true" : "false";
82
 
83
+ $O['can_view_players'] = $MP3JP->prep_value( $_POST['can_view_players'] );
 
84
 
85
  $O['paddings_top'] = ( $_POST['mp3foxPaddings_top'] == "" ) ? "0px" : $MP3JP->prep_value( $_POST['mp3foxPaddings_top'] );
86
  $O['paddings_bottom'] = ( $_POST['mp3foxPaddings_bottom'] == "" ) ? "0px" : $MP3JP->prep_value( $_POST['mp3foxPaddings_bottom'] );
104
  $O['audioFormats']['mp3'] = "true";
105
  }
106
 
107
+ $O['player_width'] = $MP3JP->prep_value( $_POST['mp3foxPlayerWidth'] );
108
+ $O['disable_jquery_libs'] = ( preg_match("/^yes$/i", $_POST['disableJSlibs']) ) ? "yes" : "";
109
+ $O['popout_button_title'] = $MP3JP->strip_scripts( $_POST['mp3foxPopoutButtonText'] );
110
+ $O['make_player_from_link_shcode'] = $MP3JP->strip_scripts( $_POST['make_player_from_link_shcode'] );
111
+ $O['popout_background'] = $MP3JP->prep_value( $_POST['mp3foxPopoutBackground'] );
112
+ $O['db_plugin_version'] = $MP3JP->prep_value( $_POST['mp3foxPluginVersion'] );
 
 
 
 
 
 
 
 
 
 
 
 
113
 
114
+
115
+ update_option( MP3J_SETTINGS_NAME, $O );
116
  $MP3JP->theSettings = $O;
117
  $MP3JP->setAllowedFeedTypesArrays();
118
 
119
+ //Extensions - save their options
120
  MJPsettings_submit();
121
  ?>
122
 
325
  <p class="description"><?php _e( 'Automatic Counterparts are chosen with the following format priority: OGG, WEBM, WAV.', 'mp3-jplayer' ); ?></p>
326
  </div>
327
  <br>
328
+
329
+
330
  </div>
331
 
332
 
614
  <td><input type="text" style="width:150px;" name="dload_text" value="<?php echo $O['dload_text']; ?>" /></td>
615
  </tr>
616
 
617
+ <tr>
618
+ <td colspan="2">
619
+ <?php
620
+ MJPsettings_downloads_above();
621
+ ?>
622
+ </td>
623
+ </tr>
624
+
625
  <tr>
626
  <td colspan="2"><br><hr></td>
627
  </tr>
669
  </td>
670
  </tr>
671
  </table>
672
+ <p class="description" style="margin:0px 0 10px 4px; font-size:14px;"><?php _e( 'If you play from other domains and want smooth downloads, then use the field above to specify a path to the downloader file.', 'mp3-jplayer' ); ?> <strong><a href="<?php echo MP3J_PLUGIN_URL; ?>/remote/help.txt">See help on setting this up</a></strong></p>
673
  <br>
674
 
675
  </div>
716
  <div class="mp3j-tab" id="mp3j_tab_2">
717
 
718
  <br>
719
+ <p class="mainTick"><label><?php _e( 'Show players to:', 'mp3-jplayer' ); ?> &nbsp;&nbsp;</label>
720
+ <select name="can_view_players" style="width:180px;">
721
+ <option value="all"<?php if ( 'all' == $O['can_view_players'] ) { echo ' SELECTED'; } ?>><?php _e( 'All Visitors', 'mp3-jplayer' ); ?></option>
722
+ <option value="loggedin"<?php if ( 'loggedin' == $O['can_view_players'] ) { echo ' SELECTED'; } ?>><?php _e( 'Logged in users only', 'mp3-jplayer' ); ?></option>
723
+ </select></p>
724
+
725
+
726
+
727
+
728
+ <br><hr><br>
729
  <p class="description" style="font-size:14px; margin-bottom:20px;"><?php _e( 'Choose which aspects of your content you\'d like MP3-jPlayer to handle.', 'mp3-jplayer' ); ?></p>
730
  <table class="advancedSettingsTable">
731
  <tr>
css/admin/admin-colours.css CHANGED
@@ -16,11 +16,11 @@
16
  }
17
  .mp3j-tabbutton {
18
  float:left;
19
- padding:6px 24px 6px 22px;
20
- font-size:12px;
21
  margin:0;
22
- background:#e6e6e6;
23
- font-weight:700;
24
  -webkit-border-top-left-radius: 1px;
25
  -webkit-border-top-right-radius: 1px;
26
  -moz-border-radius-topleft: 1px;
@@ -41,11 +41,11 @@
41
  text-decoration:underline;
42
  }
43
  .active-tab {
44
- border:1px solid #c8c8c8;
45
  border-bottom:0px;
46
- padding:6px 23px 6px 21px;
47
  color:#333;
48
- font-weight:700;
49
  background:none;
50
  margin-top:-1px;
51
  }
@@ -54,6 +54,17 @@
54
  text-decoration:none;
55
  }
56
 
 
 
 
 
 
 
 
 
 
 
 
57
  .mp3j-tabs-wrap {
58
  position:relative;
59
  height:auto;
@@ -62,7 +73,7 @@
62
  .mp3j-tab {
63
  position:relative;
64
  height:auto;
65
- padding:0;
66
  background:#f1f1f1;
67
  }
68
  .tab-header { padding:2px 0 0 0; margin:0; width:100%; }
16
  }
17
  .mp3j-tabbutton {
18
  float:left;
19
+ padding:8px 24px 8px 22px;
20
+ font-size:14px;
21
  margin:0;
22
+ background:#e9e9e9;
23
+ font-weight:500;
24
  -webkit-border-top-left-radius: 1px;
25
  -webkit-border-top-right-radius: 1px;
26
  -moz-border-radius-topleft: 1px;
41
  text-decoration:underline;
42
  }
43
  .active-tab {
44
+ border:1px solid #fff;
45
  border-bottom:0px;
46
+ padding:8px 23px 8px 21px;
47
  color:#333;
48
+ font-weight:600;
49
  background:none;
50
  margin-top:-1px;
51
  }
54
  text-decoration:none;
55
  }
56
 
57
+
58
+ .mp3j-tabbutton.last.active-tab {
59
+ border-right:0;
60
+ padding-left: 23px;
61
+ }
62
+ .mp3j-tabbutton.first.active-tab {
63
+ border-left:0;
64
+ padding-right: 24px;
65
+ }
66
+
67
+
68
  .mp3j-tabs-wrap {
69
  position:relative;
70
  height:auto;
73
  .mp3j-tab {
74
  position:relative;
75
  height:auto;
76
+ padding:10px 0 0 0;
77
  background:#f1f1f1;
78
  }
79
  .tab-header { padding:2px 0 0 0; margin:0; width:100%; }
css/dark.css CHANGED
@@ -28,7 +28,7 @@ div.innertab { left:0px; top:0px; right:0px; bottom:42px; }
28
 
29
  /* PLAYLIST */
30
  .ul-mjp { margin:0px !important; padding:3px 8px 4px 8px !important; list-style-type:none !important; list-style:none !important; list-style-image:none !important; }
31
- .li-mjp { margin:0px !important; padding:0px 0px 1px 0px !important; letter-spacing:0px !important; word-spacing:0px !important; margin:0px 1px 0px 1px !important; list-style-type:none !important; }
32
  .li-mjp:before { content:none !important; }
33
  .a-mjp {
34
  border:0 !important;
@@ -129,6 +129,8 @@ div.transport-MI { position:absolute; width:auto; height:38px; right:2px; bottom
129
  min-width:36px;
130
  line-height: 18px;
131
  }
 
 
132
  div.dloadmp3-MI * {
133
  outline:none !important;
134
  display:block;
@@ -216,7 +218,7 @@ div.mp3j-finfo {
216
  div.mp3j-finfo-sleeve { position:relative !important; width:100%; height:100%; }
217
  div.mp3j-finfo-gif { position:absolute !important; top:0; left:0; right:10%; bottom:0; background:url('images/spinner.gif') no-repeat center 27px; width:auto; padding:0px; height:100%; }
218
  div.mp3j-finfo-txt { position:relative !important; margin:0px 15px 0 15px !important; padding:10px 0 10px 0 !important; width:auto; }
219
- div.mp3j-finfo-close { position:absolute !important; width:31px !important; height:27px !important; padding-top:5px !important; right:0 !important; top:0 !important; text-align:center !important; font-weight:700 !important; font-size:18px !important; line-height:22px !important; color:#aaa !important; border-bottom:1px solid #ccc !important; border-left:1px solid #ccc !important; background:url('images/t40w.png') repeat left top !important; }
220
  div.mp3j-finfo-close:hover { color:#888 !important; }
221
 
222
  div.mp3j-finfo-txt h2 { font-size:15px !important; color:#333 !important; margin:0 0 35px 0 !important; }
@@ -621,5 +623,7 @@ iframe.mp3j-dlframe {
621
  user-select: none;
622
  }
623
 
624
-
 
 
625
 
28
 
29
  /* PLAYLIST */
30
  .ul-mjp { margin:0px !important; padding:3px 8px 4px 8px !important; list-style-type:none !important; list-style:none !important; list-style-image:none !important; }
31
+ .li-mjp { margin:0px !important; padding:0px 0px 1px 0px !important; letter-spacing:0px !important; word-spacing:0px !important; margin:0px 1px 0px 1px !important; list-style-type:none !important; clear: both; }
32
  .li-mjp:before { content:none !important; }
33
  .a-mjp {
34
  border:0 !important;
129
  min-width:36px;
130
  line-height: 18px;
131
  }
132
+ div.dloadmp3-MI:hover { background-color:#383838; }
133
+
134
  div.dloadmp3-MI * {
135
  outline:none !important;
136
  display:block;
218
  div.mp3j-finfo-sleeve { position:relative !important; width:100%; height:100%; }
219
  div.mp3j-finfo-gif { position:absolute !important; top:0; left:0; right:10%; bottom:0; background:url('images/spinner.gif') no-repeat center 27px; width:auto; padding:0px; height:100%; }
220
  div.mp3j-finfo-txt { position:relative !important; margin:0px 15px 0 15px !important; padding:10px 0 10px 0 !important; width:auto; }
221
+ div.mp3j-finfo-close { cursor:pointer; position:absolute !important; width:31px !important; height:27px !important; padding-top:5px !important; right:0 !important; top:0 !important; text-align:center !important; font-weight:700 !important; font-size:18px !important; line-height:22px !important; color:#aaa !important; border-bottom:1px solid #ccc !important; border-left:1px solid #ccc !important; background:url('images/t40w.png') repeat left top !important; }
222
  div.mp3j-finfo-close:hover { color:#888 !important; }
223
 
224
  div.mp3j-finfo-txt h2 { font-size:15px !important; color:#333 !important; margin:0 0 35px 0 !important; }
623
  user-select: none;
624
  }
625
 
626
+ .emjp_clear {
627
+ height: 0px;
628
+ }
629
 
css/light.css CHANGED
@@ -27,7 +27,7 @@ div.innertab { left:0px; top:0px; right:0px; bottom:41px; border-bottom:1px soli
27
 
28
  /* PLAYLIST */
29
  .ul-mjp { margin:0px !important; padding:3px 8px 4px 8px !important; list-style-type:none !important; list-style:none !important; list-style-image:none !important; border-top:1px solid #f0f0f0; }
30
- .li-mjp { margin:0px !important; padding:0px 0px 1px 0px !important; letter-spacing:0px !important; word-spacing:0px !important; margin:0px 1px 0px 1px !important; list-style-type:none !important; }
31
  .li-mjp:before { content:none !important; }
32
  .a-mjp {
33
  border:0 !important;
@@ -124,6 +124,8 @@ div.transport-MI { position:absolute; width:auto; height:38px; right:2px; bottom
124
  min-width:36px;
125
  line-height: 18px;
126
  }
 
 
127
  div.dloadmp3-MI * {
128
  outline:none !important;
129
  display:block;
@@ -214,7 +216,7 @@ div.mp3j-finfo {
214
  div.mp3j-finfo-sleeve { position:relative !important; width:100%; height:100%; }
215
  div.mp3j-finfo-gif { position:absolute !important; top:0; left:0; right:10%; bottom:0; background:url('images/spinner.gif') no-repeat center 27px; width:auto; padding:0px; height:100%; }
216
  div.mp3j-finfo-txt { position:relative !important; margin:0px 15px 0 15px !important; padding:10px 0 10px 0 !important; width:auto; }
217
- div.mp3j-finfo-close { position:absolute !important; width:31px !important; height:27px !important; padding-top:5px !important; right:0 !important; top:0 !important; text-align:center !important; font-weight:700 !important; font-size:18px !important; line-height:22px !important; color:#aaa !important; border-bottom:1px solid #ccc !important; border-left:1px solid #ccc !important; background:url('images/t40w.png') repeat left top !important; }
218
  div.mp3j-finfo-close:hover { color:#888 !important; }
219
 
220
  div.mp3j-finfo-txt h2 { font-size:15px !important; color:#333 !important; margin:0 0 35px 0 !important; }
@@ -613,3 +615,7 @@ iframe.mp3j-dlframe {
613
  user-select: none;
614
  }
615
 
 
 
 
 
27
 
28
  /* PLAYLIST */
29
  .ul-mjp { margin:0px !important; padding:3px 8px 4px 8px !important; list-style-type:none !important; list-style:none !important; list-style-image:none !important; border-top:1px solid #f0f0f0; }
30
+ .li-mjp { margin:0px !important; padding:0px 0px 1px 0px !important; letter-spacing:0px !important; word-spacing:0px !important; margin:0px 1px 0px 1px !important; list-style-type:none !important; clear: both; }
31
  .li-mjp:before { content:none !important; }
32
  .a-mjp {
33
  border:0 !important;
124
  min-width:36px;
125
  line-height: 18px;
126
  }
127
+ div.dloadmp3-MI:hover { background-color:#e0e0e0; }
128
+
129
  div.dloadmp3-MI * {
130
  outline:none !important;
131
  display:block;
216
  div.mp3j-finfo-sleeve { position:relative !important; width:100%; height:100%; }
217
  div.mp3j-finfo-gif { position:absolute !important; top:0; left:0; right:10%; bottom:0; background:url('images/spinner.gif') no-repeat center 27px; width:auto; padding:0px; height:100%; }
218
  div.mp3j-finfo-txt { position:relative !important; margin:0px 15px 0 15px !important; padding:10px 0 10px 0 !important; width:auto; }
219
+ div.mp3j-finfo-close { cursor:pointer; position:absolute !important; width:31px !important; height:27px !important; padding-top:5px !important; right:0 !important; top:0 !important; text-align:center !important; font-weight:700 !important; font-size:18px !important; line-height:22px !important; color:#aaa !important; border-bottom:1px solid #ccc !important; border-left:1px solid #ccc !important; background:url('images/t40w.png') repeat left top !important; }
220
  div.mp3j-finfo-close:hover { color:#888 !important; }
221
 
222
  div.mp3j-finfo-txt h2 { font-size:15px !important; color:#333 !important; margin:0 0 35px 0 !important; }
615
  user-select: none;
616
  }
617
 
618
+
619
+ .emjp_clear {
620
+ height: 0px;
621
+ }
css/text.css CHANGED
@@ -27,7 +27,7 @@ div.innertab { left:0px; top:0px; right:0px; bottom:50px; }
27
 
28
  /* PLAYLIST */
29
  .ul-mjp { margin:0px !important; padding:3px 8px 4px 8px !important; list-style-type:none !important; list-style:none !important; list-style-image:none !important; border:0px; }
30
- .li-mjp { margin:0px !important; padding:0px 0px 1px 0px !important; letter-spacing:0px !important; word-spacing:0px !important; margin:0px 1px 0px 1px !important; list-style-type:none !important; }
31
  .li-mjp:before { content:none !important; }
32
  .a-mjp {
33
  border:0 !important;
@@ -199,7 +199,7 @@ div.mp3j-finfo {
199
  div.mp3j-finfo-sleeve { position:relative !important; width:100%; height:100%; }
200
  div.mp3j-finfo-gif { position:absolute !important; top:0; left:0; right:10%; bottom:0; background:url('images/spinner.gif') no-repeat center 27px; width:auto; padding:0px; height:100%; }
201
  div.mp3j-finfo-txt { position:relative !important; margin:0px 15px 0 15px !important; padding:10px 0 10px 0 !important; width:auto; }
202
- div.mp3j-finfo-close { position:absolute !important; width:31px !important; height:27px !important; padding-top:5px !important; right:0 !important; top:0 !important; text-align:center !important; font-weight:700 !important; font-size:18px !important; line-height:22px !important; color:#aaa !important; border-bottom:1px solid #ccc !important; border-left:1px solid #ccc !important; background:url('images/t40w.png') repeat left top !important; }
203
  div.mp3j-finfo-close:hover { color:#888 !important; }
204
 
205
  div.mp3j-finfo-txt h2 { font-size:15px !important; color:#333 !important; margin:0 0 35px 0 !important; }
@@ -585,3 +585,7 @@ iframe.mp3j-dlframe {
585
  user-select: none;
586
  }
587
 
 
 
 
 
27
 
28
  /* PLAYLIST */
29
  .ul-mjp { margin:0px !important; padding:3px 8px 4px 8px !important; list-style-type:none !important; list-style:none !important; list-style-image:none !important; border:0px; }
30
+ .li-mjp { margin:0px !important; padding:0px 0px 1px 0px !important; letter-spacing:0px !important; word-spacing:0px !important; margin:0px 1px 0px 1px !important; list-style-type:none !important; clear: both; }
31
  .li-mjp:before { content:none !important; }
32
  .a-mjp {
33
  border:0 !important;
199
  div.mp3j-finfo-sleeve { position:relative !important; width:100%; height:100%; }
200
  div.mp3j-finfo-gif { position:absolute !important; top:0; left:0; right:10%; bottom:0; background:url('images/spinner.gif') no-repeat center 27px; width:auto; padding:0px; height:100%; }
201
  div.mp3j-finfo-txt { position:relative !important; margin:0px 15px 0 15px !important; padding:10px 0 10px 0 !important; width:auto; }
202
+ div.mp3j-finfo-close { cursor:pointer; position:absolute !important; width:31px !important; height:27px !important; padding-top:5px !important; right:0 !important; top:0 !important; text-align:center !important; font-weight:700 !important; font-size:18px !important; line-height:22px !important; color:#aaa !important; border-bottom:1px solid #ccc !important; border-left:1px solid #ccc !important; background:url('images/t40w.png') repeat left top !important; }
203
  div.mp3j-finfo-close:hover { color:#888 !important; }
204
 
205
  div.mp3j-finfo-txt h2 { font-size:15px !important; color:#333 !important; margin:0 0 35px 0 !important; }
585
  user-select: none;
586
  }
587
 
588
+
589
+ .emjp_clear {
590
+ height: 0px;
591
+ }
css/v1-skins/v1-dark.css CHANGED
@@ -249,7 +249,7 @@ div.mjp-volwrap { position:absolute; top:0; right:0; }
249
 
250
  /* PLAYLIST */
251
  .ul-mjp { margin:0px !important; padding:0px 0px 0px 0px !important; list-style-type:none !important; list-style:none !important; list-style-image:none !important; }
252
- .li-mjp { margin:0px !important; padding:0px 0px 1px 0px !important; letter-spacing:0px !important; word-spacing:0px !important; margin:0px 1px 0px 1px !important; list-style-type:none !important; }
253
  .li-mjp:before { content:none !important; }
254
  .a-mjp {
255
  border:0 !important;
@@ -384,7 +384,7 @@ div.mp3j-finfo {
384
  div.mp3j-finfo-sleeve { position:relative !important; width:100%; height:100%; }
385
  div.mp3j-finfo-gif { position:absolute !important; top:0; left:0; right:10%; bottom:0; background:url('images/loader-w2.gif') no-repeat center 37px; width:auto; padding:0px !important; height:100%; }
386
  div.mp3j-finfo-txt { position:relative !important; margin:0px 15px 0 15px !important; padding:10px 0 10px 0 !important; width:auto; }
387
- div.mp3j-finfo-close { position:absolute !important; width:31px !important; height:27px !important; padding-top:5px !important; right:0 !important; top:0 !important; text-align:center !important; font-weight:700 !important; font-size:18px !important; line-height:22px !important; color:#999 !important; border-bottom:1px solid #777 !important; border-left:1px solid #777 !important; background:url('images/t40b.png') repeat left top; }
388
  div.mp3j-finfo-close:hover { color:#eee !important; }
389
 
390
  div.mp3j-finfo-txt h2 { font-size:15px !important; color:#fff !important; margin:0 0 10px 0 !important; }
@@ -882,3 +882,12 @@ div.mp3j-finfo {
882
  .flip .buttons-wrap-mjp div { float:right }
883
  .flip div.playlist-toggle-MI { left: auto; right:1px; }
884
  .flip div.mp3j-popout-MI { left: auto; right:0px; }
 
 
 
 
 
 
 
 
 
249
 
250
  /* PLAYLIST */
251
  .ul-mjp { margin:0px !important; padding:0px 0px 0px 0px !important; list-style-type:none !important; list-style:none !important; list-style-image:none !important; }
252
+ .li-mjp { clear: both; margin:0px !important; padding:0px 0px 1px 0px !important; letter-spacing:0px !important; word-spacing:0px !important; margin:0px 1px 0px 1px !important; list-style-type:none !important; }
253
  .li-mjp:before { content:none !important; }
254
  .a-mjp {
255
  border:0 !important;
384
  div.mp3j-finfo-sleeve { position:relative !important; width:100%; height:100%; }
385
  div.mp3j-finfo-gif { position:absolute !important; top:0; left:0; right:10%; bottom:0; background:url('images/loader-w2.gif') no-repeat center 37px; width:auto; padding:0px !important; height:100%; }
386
  div.mp3j-finfo-txt { position:relative !important; margin:0px 15px 0 15px !important; padding:10px 0 10px 0 !important; width:auto; }
387
+ div.mp3j-finfo-close { cursor:pointer; position:absolute !important; width:31px !important; height:27px !important; padding-top:5px !important; right:0 !important; top:0 !important; text-align:center !important; font-weight:700 !important; font-size:18px !important; line-height:22px !important; color:#999 !important; border-bottom:1px solid #777 !important; border-left:1px solid #777 !important; background:url('images/t40b.png') repeat left top; }
388
  div.mp3j-finfo-close:hover { color:#eee !important; }
389
 
390
  div.mp3j-finfo-txt h2 { font-size:15px !important; color:#fff !important; margin:0 0 10px 0 !important; }
882
  .flip .buttons-wrap-mjp div { float:right }
883
  .flip div.playlist-toggle-MI { left: auto; right:1px; }
884
  .flip div.mp3j-popout-MI { left: auto; right:0px; }
885
+
886
+
887
+
888
+
889
+ .emjp_clear {
890
+ height: 0px;
891
+ }
892
+
893
+
css/v1-skins/v1-silver.css CHANGED
@@ -252,7 +252,7 @@ div.innertab2 { display:none; }
252
 
253
  /* PLAYLIST */
254
  .ul-mjp { margin:0px !important; padding:3px 0px 0px 0px !important; list-style-type:none !important; list-style:none !important; list-style-image:none !important; }
255
- .li-mjp { margin:0px !important; padding:0px 0px 1px 0px !important; letter-spacing:0px !important; word-spacing:0px !important; margin:0px 1px 0px 1px !important; list-style-type:none !important; }
256
  .li-mjp:before { content:none !important; }
257
  .a-mjp {
258
  border:0 !important;
@@ -380,7 +380,7 @@ div.mp3j-finfo {
380
  div.mp3j-finfo-sleeve { position:relative !important; width:100%; height:100%; }
381
  div.mp3j-finfo-gif { position:absolute !important; top:0; left:0; right:10%; bottom:0; background:url('images/loader.gif') no-repeat center 37px; width:auto; padding:0px; height:100%; }
382
  div.mp3j-finfo-txt { position:relative !important; margin:0px 15px 0 15px !important; padding:10px 0 10px 0 !important; width:auto; }
383
- div.mp3j-finfo-close { position:absolute !important; width:31px !important; height:27px !important; padding-top:5px !important; right:0 !important; top:0 !important; text-align:center !important; font-weight:700 !important; font-size:18px !important; line-height:22px !important; color:#aaa !important; border-bottom:1px solid #ccc !important; border-left:1px solid #ccc !important; background:url('images/t40w.png') repeat left top !important; }
384
  div.mp3j-finfo-close:hover { color:#888 !important; }
385
 
386
  div.mp3j-finfo-txt h2 { font-size:15px !important; color:#333 !important; margin:0 0 10px 0 !important; }
@@ -884,4 +884,11 @@ ul.ul-mjp.mp3j_widgetmods li a { font-size:10px !important; line-height:14px !im
884
  .flip .buttons-wrap-mjp div { float:right }
885
  .flip div.playlist-toggle-MI { left: auto; right:1px; }
886
  .flip div.mp3j-popout-MI { left: auto; right:0px; }
 
 
 
 
 
 
 
887
 
252
 
253
  /* PLAYLIST */
254
  .ul-mjp { margin:0px !important; padding:3px 0px 0px 0px !important; list-style-type:none !important; list-style:none !important; list-style-image:none !important; }
255
+ .li-mjp { clear: both; margin:0px !important; padding:0px 0px 1px 0px !important; letter-spacing:0px !important; word-spacing:0px !important; margin:0px 1px 0px 1px !important; list-style-type:none !important; }
256
  .li-mjp:before { content:none !important; }
257
  .a-mjp {
258
  border:0 !important;
380
  div.mp3j-finfo-sleeve { position:relative !important; width:100%; height:100%; }
381
  div.mp3j-finfo-gif { position:absolute !important; top:0; left:0; right:10%; bottom:0; background:url('images/loader.gif') no-repeat center 37px; width:auto; padding:0px; height:100%; }
382
  div.mp3j-finfo-txt { position:relative !important; margin:0px 15px 0 15px !important; padding:10px 0 10px 0 !important; width:auto; }
383
+ div.mp3j-finfo-close { cursor:pointer; position:absolute !important; width:31px !important; height:27px !important; padding-top:5px !important; right:0 !important; top:0 !important; text-align:center !important; font-weight:700 !important; font-size:18px !important; line-height:22px !important; color:#aaa !important; border-bottom:1px solid #ccc !important; border-left:1px solid #ccc !important; background:url('images/t40w.png') repeat left top !important; }
384
  div.mp3j-finfo-close:hover { color:#888 !important; }
385
 
386
  div.mp3j-finfo-txt h2 { font-size:15px !important; color:#333 !important; margin:0 0 10px 0 !important; }
884
  .flip .buttons-wrap-mjp div { float:right }
885
  .flip div.playlist-toggle-MI { left: auto; right:1px; }
886
  .flip div.mp3j-popout-MI { left: auto; right:0px; }
887
+
888
+
889
+ .emjp_clear {
890
+ height: 0px;
891
+ }
892
+
893
+
894
 
frontend.php CHANGED
@@ -1,62 +1,99 @@
1
  <?php
2
 
3
- class MP3j_Front extends MP3j_Main {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  function loadTranslation () {
7
  $path = dirname( __FILE__ ) . '/lang';
8
  load_plugin_textdomain( 'mp3-jplayer', false, $path );
9
  }
10
 
11
 
 
12
  function onInit () {
13
  $this->SKINS = $this->getSkinData();
14
-
15
  if ( is_admin() ) {
16
  add_action( 'wp_ajax_ax_mjp_liblist', 'ax_mjp_liblist' );
17
  }
18
  }
19
 
20
- function onAdminInit () {
21
- if ( $this->showSplash ) {
22
- $this->checkSplashRedirect();
23
- }
24
- }
25
 
26
-
27
  function deactivate () {
28
- $O = get_option( $this->adminOptionsName );
29
  if ( $O['remember_settings'] == "false" ) {
30
- delete_option( $this->adminOptionsName );
31
  }
32
  }
33
 
34
-
35
- function activate () {
36
- if ( $this->showSplash ) {
37
- set_transient( 'mp3jplayer_activation_flag', 'true', 10 );
38
- }
39
- }
40
-
41
- function checkSplashRedirect ()
42
- {
43
- if ( get_transient( 'mp3jplayer_activation_flag' ) !== 'true' ) {
44
- return;
45
- }
46
- delete_transient( 'mp3jplayer_activation_flag' );
47
-
48
- if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { //bail if activating from network or bulk
49
- return;
50
- }
51
- wp_safe_redirect( add_query_arg( array( 'page' => 'mp3-jplayer-welcome' ), admin_url( 'admin.php' ) ) );
52
- exit;
53
- }
54
-
55
- function removeSplashMenuItem () {
56
- remove_submenu_page( 'mp3-jplayer', 'mp3-jplayer-welcome' );
57
- }
58
-
59
 
 
60
  function addPluginListLink( $links, $file ) {
61
  if ( $file == 'mp3-jplayer/mp3jplayer.php' ) {
62
  $settings_link = '<a href="admin.php?page=mp3-jplayer">'.__('Settings').'</a>';
@@ -66,6 +103,7 @@ class MP3j_Front extends MP3j_Main {
66
  }
67
 
68
 
 
69
  function mp3j_settings ( $devsettings = array() ) {
70
  foreach ( $this->setup as $k => $v ) {
71
  if ( array_key_exists( $k, $devsettings ) ) {
@@ -75,85 +113,39 @@ class MP3j_Front extends MP3j_Main {
75
  }
76
 
77
 
 
78
  function registerWidgets () {
79
  register_widget( 'MP3_jPlayer' );
80
  register_widget( 'MP3j_single' );
81
  }
82
 
83
 
84
- function grablibrary_handler( $x ) {
 
85
  return $this->grab_library_info( $x );
86
  }
87
 
88
-
89
- function scripts_tag_handler( $style = "" )
90
- {
91
- // Since 1.7 - convert old option name to new
92
- if ( $style == "styleA" || $style == "styleE" ) { $style = "styleF"; }
93
- if ( $style == "styleB" ) { $style = "styleG"; }
94
- if ( $style == "styleC" ) { $style = "styleH"; }
95
- if ( $style == "styleD" ) { $style = "styleI"; }
96
-
97
  $this->stylesheet = ( $style == "" ) ? $this->theSettings['player_theme'] : $style;
98
- $this->scriptsflag = "true";
99
  return;
100
  }
101
 
102
 
103
- function checkAddScripts ()
104
- {
105
- if ( $this->Player_ID > 0 && $this->SCRIPT_CALL === false )
106
- {
107
- $style = ( $this->stylesheet == "" ) ? $this->theSettings['player_theme'] : $this->stylesheet;
108
- $this->add_Scripts( $style );
109
-
110
- $version = substr( get_bloginfo('version'), 0, 3);
111
- if ( $version < 3.3 ) {
112
- $this->dbug['str'] .= "\nFAIL Warning: Can't recover because this version of WordPress is too old (below 3.3). Possible causes:\n- Using do_shortcode without adding the scripts first (see plugin help)\n- A genuine bug, please report.\n";
113
- }
114
- }
115
- }
116
-
117
- //TODO
118
- function registerShortcodes ()
119
- {
120
- $ops = $this->theSettings;
121
- /*
122
- add_shortcode( 'mp3t', array( $this, 'inline_play_handler' ) );
123
- add_shortcode( 'mp3j', array( $this, 'inline_play_graphic' ) );
124
- add_shortcode( 'mp3-jplayer', array( $this, 'primary_player' ) );
125
-
126
- remove_shortcode( 'popout' );
127
- add_shortcode( 'popout', array( $this, 'popout_link_player' ) );
128
- add_shortcode( 'mp3-popout', array( $this, 'popout_link_player' ) );
129
-
130
- if ( $ops['replace_WP_playlist'] === 'true' && ! is_admin() ) {
131
- remove_shortcode( 'playlist' );
132
- add_shortcode( 'playlist', array( $this, 'replacePlaylistShortcode ') );
133
  }
134
-
135
- if ( ! is_admin() && ( $ops['replace_WP_audio'] === 'true' || $ops['replace_WP_embedded'] === 'true' || $ops['replace_WP_attached'] === 'true' ) ) {
136
- remove_shortcode( 'audio' );
137
- add_shortcode( 'audio', array( $this, 'replaceAudioShortcode' ) );
138
- }
139
- */
140
  }
141
 
142
- //TODO
143
- function registerTagCallbacks ()
144
- {
145
- }
146
-
147
-
148
-
149
 
150
-
151
- //~~~~~
152
  function createAdminPages ()
153
  {
154
- /*
155
- extension page (arr)
156
- --
157
  [parent] str
158
  [title] str
159
  [menuName] str
@@ -161,7 +153,6 @@ class MP3j_Front extends MP3j_Main {
161
  [slug] str
162
  [drawFunction] str
163
  ['scriptsFunction'] false/str
164
- --
165
  */
166
 
167
  //Core Settings pages
@@ -185,28 +176,18 @@ class MP3j_Front extends MP3j_Main {
185
  add_action( 'admin_head-'. $submenu, $p['scriptsFunction'] );
186
  }
187
  }
188
-
189
- add_filter( 'plugin_action_links', array( $this, 'addPluginListLink' ), 10, 2 );
190
-
191
- //splash
192
- add_submenu_page(
193
- 'mp3-jplayer',
194
- 'Welcome to MP3-jPlayer',
195
- 'Welcome',
196
- 'manage_options',
197
- 'mp3-jplayer-welcome',
198
- 'drawSplashScreen_mp3j'
199
- );
200
 
 
 
201
  }
202
 
203
 
204
- //~~~~~
205
- function mp3j_admin_header ()
206
  {
207
  wp_enqueue_script('jquery');
208
- wp_enqueue_script('mp3jp-settings-js', $this->PluginFolder .'/js/admin/settings.2.5.js' );
209
- wp_enqueue_script('spectrum-CP-js', $this->PluginFolder .'/js/spectrum/spectrum.js' );
210
 
211
  wp_localize_script(
212
  'mp3jp-settings-js',
@@ -216,18 +197,12 @@ class MP3j_Front extends MP3j_Main {
216
  )
217
  );
218
 
219
-
220
-
221
- wp_enqueue_style( 'spectrum-css', plugins_url( '/css/admin/spectrum-custom.css', __FILE__ ) );
222
- wp_enqueue_style('mp3jp-settings-css', $this->PluginFolder .'/css/admin/admin-settings.css' );
223
  }
224
-
225
-
226
- //~~~~~
227
- function mp3j_admin_footer () {}
228
 
229
 
230
- //~~~~~
231
  function mp3j_admin_colours_header ()
232
  {
233
  //scripts
@@ -237,57 +212,27 @@ class MP3j_Front extends MP3j_Main {
237
  wp_enqueue_script('jquery-ui-mouse');
238
  wp_enqueue_script('jquery-ui-slider');
239
  wp_enqueue_script('jquery-ui-resizable');
240
- wp_enqueue_script('mp3jp-colours-js', $this->PluginFolder .'/js/admin/admin-colours.js' );
241
- wp_enqueue_script('spectrum-CP-js', $this->PluginFolder .'/js/spectrum/spectrum.js' );
242
 
243
  //styles
244
- wp_enqueue_style('spectrum-CP-css', $this->PluginFolder .'/css/admin/spectrum-custom.css' );
245
- wp_enqueue_style('mp3jp-colours-css', $this->PluginFolder .'/css/admin/admin-colours.css' );
246
  }
247
 
248
 
249
- /**
250
- * Provides support for WP versions below 3.3 that can't late enqueue. Labourious
251
- * checking of active widgets, and loose checking post content for shortcodes and extensions
252
- * so as to avoid unecessary script addition.
253
- */
254
- function header_scripts_handler()
255
- {
256
- $scripts = false;
257
- $allowed_widget = $this->has_allowed_widget( "mp3-jplayer-widget" );
258
- $allowed_widget_B = $this->has_allowed_widget( "mp3mi-widget" );
259
-
260
- //Flagged in template
261
- if ( $this->scriptsflag == "true" ) {
262
- $scripts = true;
263
- }
264
-
265
- //On page types
266
- if ( is_home() || is_archive() || is_search() ) {
267
- if ( $allowed_widget || $allowed_widget_B || $this->theSettings['player_onblog'] == "true" || $this->theSettings['run_shcode_in_excerpt'] == "true" ) {
268
- $scripts = true;
269
- }
270
  }
271
- if ( is_singular() ) {
272
- if ( $allowed_widget || $allowed_widget_B || $this->has_shortcodes() || $this->post_has_string() ) {
273
- $scripts = true;
274
- }
275
- }
276
-
277
- if ( $scripts ) { //Add the scripts
278
- $style = ( $this->stylesheet == "" ) ? $this->theSettings['player_theme'] : $this->stylesheet;
279
- $this->add_Scripts( $style );
280
- }
281
-
282
- // Always define js player info and playlist arrays here as some
283
- // themes cause issues if it's left until shortcode is processed.
284
  $this->defineJSvars();
285
-
286
- return;
287
  }
288
 
289
 
290
- /** Writes js playlists, startup, and debug info. */
291
  function footercode_handler()
292
  {
293
  $O = $this->theSettings;
@@ -298,7 +243,7 @@ class MP3j_Front extends MP3j_Main {
298
  $JS .= "\n\tif (typeof MP3_JPLAYER !== 'undefined') {";
299
 
300
  $JS .= ( $this->FIRST_FORMATS !== 'mp3' ) ? "\n\t\tMP3_JPLAYER.lastformats = '" . $this->FIRST_FORMATS . "';" : "";
301
- $JS .= "\n\t\tMP3_JPLAYER.plugin_path = '" . $this->PluginFolder . "';";
302
 
303
  $JS .= ( $O['allowRangeRequests'] !== 'true' ) ? "\n\t\tMP3_JPLAYER.allowRanges = " . $O['allowRangeRequests'] . ";" : "";
304
  $JS .= "\n\t\tMP3_JPLAYER.pl_info = MP3jPLAYERS;";
@@ -441,7 +386,6 @@ class MP3j_Front extends MP3j_Main {
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 +398,6 @@ 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 +407,6 @@ 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 +418,6 @@ 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
  }
@@ -742,11 +683,7 @@ class MP3j_Front extends MP3j_Main {
742
  //#### Work out playlist for playlist players
743
  function decide_M_playlist( $ATTS )
744
  {
745
- extract( $ATTS );
746
-
747
- //TODO: do support this still
748
- $this->folder_order = $fsort;
749
-
750
  $TRACKS = $this->stringsToTracks( $tracks, $counterparts, $captions, $images, $imglinks );
751
  if ( ! $TRACKS )
752
  {
@@ -980,12 +917,15 @@ class MP3j_Front extends MP3j_Main {
980
  return;
981
  }
982
 
 
 
 
983
  $O = $this->theSettings;
984
  $pID = $this->Player_ID;
985
 
986
  $defaults = $this->playerDefaultParams( 'playlist' );
987
  $ATTS = shortcode_atts( $defaults, $atts );
988
-
989
  //Alias params
990
  if ( $ATTS['tracks'] == '' && $ATTS['track'] != '' ) {
991
  $ATTS['tracks'] = $ATTS['track'];
@@ -1004,7 +944,7 @@ class MP3j_Front extends MP3j_Main {
1004
  $ATTS['trackCount'] = count( $TRACKS );
1005
 
1006
  //Make js list
1007
- $PlayerName = "MI_" . $this->M_no;
1008
  $listJS = $this->writePlaylistJS( $TRACKS, $PlayerName );
1009
 
1010
  //Make settings..
@@ -1060,7 +1000,6 @@ class MP3j_Front extends MP3j_Main {
1060
 
1061
  //Finish up
1062
  $this->dbug['str'] .= "\nOK (id " . $this->Player_ID . ")";
1063
- $this->M_no++;
1064
  $this->Player_ID++;
1065
 
1066
  return $player['html'] . $listJS . $playerJS;
@@ -1077,6 +1016,9 @@ class MP3j_Front extends MP3j_Main {
1077
  return;
1078
  }
1079
 
 
 
 
1080
  $O = $this->theSettings;
1081
  $pID = $this->Player_ID;
1082
 
@@ -1105,7 +1047,7 @@ class MP3j_Front extends MP3j_Main {
1105
  extract( $ATTS );
1106
 
1107
  //Make js list
1108
- $PlayerName = "popout_" . $this->M_no;
1109
  $listJS = $this->writePlaylistJS( $TRACKS, $PlayerName );
1110
 
1111
  //Make settings..
@@ -1137,19 +1079,15 @@ class MP3j_Front extends MP3j_Main {
1137
 
1138
  //Finish up
1139
  $this->dbug['str'] .= "\nOK (id " . $this->Player_ID . ")";
1140
- $this->M_no++;
1141
  $this->Player_ID++;
1142
 
1143
  return $player . $listJS . $playerJS;
1144
  }
1145
 
1146
 
1147
- //###########################
1148
  function template_tag_handler( $stuff = "" ) {
1149
- //if ( $this->theSettings['disable_template_tag'] == "true" ) {
1150
- // return;
1151
- //}
1152
- if ( !empty($stuff) ) {
1153
  $this->checkGrabFields(); //for singles
1154
  $this->Caller = "tag";
1155
  $players = do_shortcode( $stuff );
@@ -1160,11 +1098,10 @@ class MP3j_Front extends MP3j_Main {
1160
  }
1161
 
1162
 
1163
- //###########################
1164
  function checkGrabFields ()
1165
  {
1166
  global $post;
1167
- //if ( $post->ID != "" && $post->ID != $this->postID )
1168
  if ( ! empty( $post->ID ) && $post->ID != $this->postID )
1169
  {
1170
  $this->postID = $post->ID;
1
  <?php
2
 
3
+ class MP3j_Front extends MP3j_Main
4
+ {
5
+
6
+ //~~
7
+ function addPrimaryHooks ()
8
+ {
9
+ add_action( 'plugins_loaded', array( $this, 'loadTranslation' ) );
10
+ add_action( 'init', array( $this, 'onInit' ), 100 );
11
+ add_action( 'widgets_init', array( $this, 'registerWidgets' ) );
12
+
13
+ if ( is_admin() ) {
14
+ add_action( 'admin_menu', array( $this, 'createAdminPages' ), 100 );
15
+ add_action( 'deactivate_mp3-jplayer/mp3jplayer.php', array( $this, 'deactivate' ) );
16
+ }
17
+
18
+ add_action( 'wp_head', array( $this, 'header_scripts_handler' ), 2 );
19
+ add_action( 'wp_footer', array( $this, 'checkAddScripts' ), 1 ); // Final chance to enqueue, process this action early (priority < 20).
20
+ add_action( 'wp_footer', array( $this, 'footercode_handler' ), 200 ); // Inline js, after enqueues. Keep at 200! Add-ons may go either side.
21
+
22
+ add_filter( 'get_the_excerpt', array( $this, 'get_excerpt_handler' ), 1 );
23
+ add_filter( 'the_content', array( $this, 'afterExcerpt' ), 9999 );
24
+
25
+ if ( $this->theSettings['make_player_from_link'] == "true" ) {
26
+ add_filter('the_content', array( $this, 'replace_links' ), 1);
27
+ }
28
+
29
+ if ( $this->theSettings['run_shcode_in_excerpt'] == "true" ) {
30
+ add_filter( 'the_excerpt', 'shortcode_unautop' );
31
+ add_filter( 'the_excerpt', 'do_shortcode' );
32
+ }
33
+ }
34
 
35
 
36
+ //~~
37
+ function registerShortcodes ()
38
+ {
39
+ $ops = $this->theSettings;
40
+ add_shortcode( 'mp3t', array( $this, 'inline_play_handler' ) );
41
+ add_shortcode( 'mp3j', array( $this, 'inline_play_graphic' ) );
42
+ add_shortcode( 'mp3-jplayer', array( $this, 'primary_player' ) );
43
+ add_shortcode( 'mp3-popout', array( $this, 'popout_link_player' ) );
44
+
45
+ remove_shortcode( 'popout' );
46
+ add_shortcode( 'popout', array( $this, 'popout_link_player' ) );
47
+
48
+ if ( $ops['replace_WP_playlist'] === 'true' && ! is_admin() ) {
49
+ remove_shortcode( 'playlist' );
50
+ add_shortcode( 'playlist', array( $this, 'replacePlaylistShortcode' ) );
51
+ }
52
+
53
+ if ( ! is_admin() && ( $ops['replace_WP_audio'] === 'true' || $ops['replace_WP_embedded'] === 'true' || $ops['replace_WP_attached'] === 'true' ) ) {
54
+ remove_shortcode( 'audio' );
55
+ add_shortcode( 'audio', array( $this, 'replaceAudioShortcode' ) );
56
+ }
57
+ }
58
+
59
+
60
+ //~~
61
+ function registerTagCallbacks ()
62
+ {
63
+ add_action( 'mp3j_addscripts', array( $this, 'scripts_tag_handler' ), 1, 1 );
64
+ add_action( 'mp3j_put', array( $this, 'template_tag_handler' ), 10, 1 );
65
+ add_action( 'mp3j_debug', array( $this, 'debug_info' ), 10, 1 );
66
+ add_filter( 'mp3j_grab_library', array( $this, 'grablibrary_handler' ), 10, 1 );
67
+ add_action( 'mp3j_settings', array( $this, 'mp3j_settings' ), 1, 1 );
68
+ }
69
+
70
+
71
+ //~~
72
  function loadTranslation () {
73
  $path = dirname( __FILE__ ) . '/lang';
74
  load_plugin_textdomain( 'mp3-jplayer', false, $path );
75
  }
76
 
77
 
78
+ //~~
79
  function onInit () {
80
  $this->SKINS = $this->getSkinData();
 
81
  if ( is_admin() ) {
82
  add_action( 'wp_ajax_ax_mjp_liblist', 'ax_mjp_liblist' );
83
  }
84
  }
85
 
 
 
 
 
 
86
 
87
+ //~~
88
  function deactivate () {
89
+ $O = get_option( MP3J_SETTINGS_NAME );
90
  if ( $O['remember_settings'] == "false" ) {
91
+ delete_option( MP3J_SETTINGS_NAME );
92
  }
93
  }
94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
 
96
+ //~~
97
  function addPluginListLink( $links, $file ) {
98
  if ( $file == 'mp3-jplayer/mp3jplayer.php' ) {
99
  $settings_link = '<a href="admin.php?page=mp3-jplayer">'.__('Settings').'</a>';
103
  }
104
 
105
 
106
+ //~~
107
  function mp3j_settings ( $devsettings = array() ) {
108
  foreach ( $this->setup as $k => $v ) {
109
  if ( array_key_exists( $k, $devsettings ) ) {
113
  }
114
 
115
 
116
+ //~~
117
  function registerWidgets () {
118
  register_widget( 'MP3_jPlayer' );
119
  register_widget( 'MP3j_single' );
120
  }
121
 
122
 
123
+ //~~
124
+ function grablibrary_handler ( $x ) {
125
  return $this->grab_library_info( $x );
126
  }
127
 
128
+
129
+ //~~
130
+ function scripts_tag_handler ( $style = "" ) {
 
 
 
 
 
 
131
  $this->stylesheet = ( $style == "" ) ? $this->theSettings['player_theme'] : $style;
 
132
  return;
133
  }
134
 
135
 
136
+ //~~
137
+ function checkAddScripts () {
138
+ if ( $this->Player_ID > 0 && $this->SCRIPT_CALL === false ) {
139
+ $this->enqueueJS();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
  }
 
 
 
 
 
 
141
  }
142
 
 
 
 
 
 
 
 
143
 
144
+ //~~
 
145
  function createAdminPages ()
146
  {
147
+ /* extension page (arr)
148
+ --
 
149
  [parent] str
150
  [title] str
151
  [menuName] str
153
  [slug] str
154
  [drawFunction] str
155
  ['scriptsFunction'] false/str
 
156
  */
157
 
158
  //Core Settings pages
176
  add_action( 'admin_head-'. $submenu, $p['scriptsFunction'] );
177
  }
178
  }
 
 
 
 
 
 
 
 
 
 
 
 
179
 
180
+ //add link to settings on the plugin list dashboard
181
+ add_filter( 'plugin_action_links', array( $this, 'addPluginListLink' ), 10, 2 );
182
  }
183
 
184
 
185
+ //~~
186
+ function mp3j_admin_header ()
187
  {
188
  wp_enqueue_script('jquery');
189
+ wp_enqueue_script('mp3jp-settings-js', MP3J_PLUGIN_URL .'/js/admin/settings.2.5.js' );
190
+ wp_enqueue_script('spectrum-CP-js', MP3J_PLUGIN_URL .'/js/spectrum/spectrum.js' );
191
 
192
  wp_localize_script(
193
  'mp3jp-settings-js',
197
  )
198
  );
199
 
200
+ wp_enqueue_style( 'spectrum-css', MP3J_PLUGIN_URL . '/css/admin/spectrum-custom.css' );
201
+ wp_enqueue_style('mp3jp-settings-css', MP3J_PLUGIN_URL . '/css/admin/admin-settings.css' );
 
 
202
  }
 
 
 
 
203
 
204
 
205
+ //~~
206
  function mp3j_admin_colours_header ()
207
  {
208
  //scripts
212
  wp_enqueue_script('jquery-ui-mouse');
213
  wp_enqueue_script('jquery-ui-slider');
214
  wp_enqueue_script('jquery-ui-resizable');
215
+ wp_enqueue_script('mp3jp-colours-js', MP3J_PLUGIN_URL .'/js/admin/admin-colours.2.7.js' );
216
+ wp_enqueue_script('spectrum-CP-js', MP3J_PLUGIN_URL .'/js/spectrum/spectrum.js' );
217
 
218
  //styles
219
+ wp_enqueue_style('spectrum-CP-css', MP3J_PLUGIN_URL .'/css/admin/spectrum-custom.css' );
220
+ wp_enqueue_style('mp3jp-colours-css', MP3J_PLUGIN_URL .'/css/admin/admin-colours.css' );
221
  }
222
 
223
 
224
+ //~~
225
+ function header_scripts_handler() {
226
+ $this->enqueueCSS();
227
+ $WPversion = substr( get_bloginfo('version'), 0, 3 );
228
+ if ( $WPversion < 3.3 ) {
229
+ $this->enqueueJS();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
230
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
231
  $this->defineJSvars();
 
 
232
  }
233
 
234
 
235
+ //~~
236
  function footercode_handler()
237
  {
238
  $O = $this->theSettings;
243
  $JS .= "\n\tif (typeof MP3_JPLAYER !== 'undefined') {";
244
 
245
  $JS .= ( $this->FIRST_FORMATS !== 'mp3' ) ? "\n\t\tMP3_JPLAYER.lastformats = '" . $this->FIRST_FORMATS . "';" : "";
246
+ $JS .= "\n\t\tMP3_JPLAYER.plugin_path = '" . MP3J_PLUGIN_URL . "';";
247
 
248
  $JS .= ( $O['allowRangeRequests'] !== 'true' ) ? "\n\t\tMP3_JPLAYER.allowRanges = " . $O['allowRangeRequests'] . ";" : "";
249
  $JS .= "\n\t\tMP3_JPLAYER.pl_info = MP3jPLAYERS;";
386
  }
387
  $track = 1;
388
  $playername = "inline_" . $this->S_no++;
 
389
  $trackNumber = ( $this->theSettings['add_track_numbering'] == "true" ) ? $this->S_arb . '. ' : '';
390
  $listJS = $this->writePlaylistJS( $TRACKS, $playername, $this->S_arb++ );
391
  }
398
  }
399
  $track = ++$this->S_autotrack;
400
  $playername = $this->F_listname;
 
401
  $trackNumber = ( $this->theSettings['add_track_numbering'] == "true" ) ? $track . '. ' : '';
402
  $TRACKS = $this->F_LISTS[ $playername ];
403
  }
407
  return false;
408
  }
409
  $playername = $this->F_listname;
 
410
  $trackNumber = ( $this->theSettings['add_track_numbering'] == "true" ) ? $track . '. ' : '';
411
  $TRACKS = $this->F_LISTS[ $playername ];
412
  }
418
  }
419
  $track = 1;
420
  $playername = "inline_" . $this->S_no++;
 
421
  $trackNumber = ( $this->theSettings['add_track_numbering'] == "true" ) ? $this->S_arb . '. ' : '';
422
  $listJS = $this->writePlaylistJS( $TRACKS, $playername, $this->S_arb++ );
423
  }
683
  //#### Work out playlist for playlist players
684
  function decide_M_playlist( $ATTS )
685
  {
686
+ extract( $ATTS );
 
 
 
 
687
  $TRACKS = $this->stringsToTracks( $tracks, $counterparts, $captions, $images, $imglinks );
688
  if ( ! $TRACKS )
689
  {
917
  return;
918
  }
919
 
920
+ //Extensions - Send the pre filtered params.
921
+ $atts = MJPfront_playlist_player( $atts );
922
+
923
  $O = $this->theSettings;
924
  $pID = $this->Player_ID;
925
 
926
  $defaults = $this->playerDefaultParams( 'playlist' );
927
  $ATTS = shortcode_atts( $defaults, $atts );
928
+
929
  //Alias params
930
  if ( $ATTS['tracks'] == '' && $ATTS['track'] != '' ) {
931
  $ATTS['tracks'] = $ATTS['track'];
944
  $ATTS['trackCount'] = count( $TRACKS );
945
 
946
  //Make js list
947
+ $PlayerName = "MI_" . $pID;
948
  $listJS = $this->writePlaylistJS( $TRACKS, $PlayerName );
949
 
950
  //Make settings..
1000
 
1001
  //Finish up
1002
  $this->dbug['str'] .= "\nOK (id " . $this->Player_ID . ")";
 
1003
  $this->Player_ID++;
1004
 
1005
  return $player['html'] . $listJS . $playerJS;
1016
  return;
1017
  }
1018
 
1019
+ //Extensions - Send the pre filtered params.
1020
+ $atts = MJPfront_popout_player( $atts );
1021
+
1022
  $O = $this->theSettings;
1023
  $pID = $this->Player_ID;
1024
 
1047
  extract( $ATTS );
1048
 
1049
  //Make js list
1050
+ $PlayerName = "popout_" . $pID;
1051
  $listJS = $this->writePlaylistJS( $TRACKS, $PlayerName );
1052
 
1053
  //Make settings..
1079
 
1080
  //Finish up
1081
  $this->dbug['str'] .= "\nOK (id " . $this->Player_ID . ")";
 
1082
  $this->Player_ID++;
1083
 
1084
  return $player . $listJS . $playerJS;
1085
  }
1086
 
1087
 
1088
+ //~~
1089
  function template_tag_handler( $stuff = "" ) {
1090
+ if ( ! empty( $stuff ) ) {
 
 
 
1091
  $this->checkGrabFields(); //for singles
1092
  $this->Caller = "tag";
1093
  $players = do_shortcode( $stuff );
1098
  }
1099
 
1100
 
1101
+ //~~
1102
  function checkGrabFields ()
1103
  {
1104
  global $post;
 
1105
  if ( ! empty( $post->ID ) && $post->ID != $this->postID )
1106
  {
1107
  $this->postID = $post->ID;
js/_mp3-jplayer-2.3.4.js DELETED
@@ -1,1049 +0,0 @@
1
- /*
2
- MP3-jPlayer
3
- Version 2.3.4
4
- http://mp3-jplayer.com
5
- 2015 Simon Ward
6
- */
7
-
8
- var MP3_JPLAYER = {
9
-
10
- tID: '',
11
- state: '',
12
- pl_info: [],
13
- load_pc: 0,
14
- played_t: 0,
15
- total_t: 0,
16
- pp_abs: 0,
17
- dl_dialogs: [],
18
- timeoutIDs: [],
19
- intervalIDs: [],
20
- jperrorIDs: [],
21
- dl_domain: '',
22
- jp_audio: {},
23
- jp_seekable: 0,
24
- sliding: false,
25
- jpID: '#mp3_jplayer_1_8',
26
- plugin_path: '',
27
- lastformats: 'mp3',
28
- allowRanges: true,
29
- extCalls: {
30
- init:[],
31
- change_pre: [],
32
- change_begin: [],
33
- change_end: [],
34
- change_post: [],
35
- button_playpause: [],
36
- button_popout: [],
37
- update_time: [],
38
- write_titles: [],
39
- write_download: [],
40
- download: [],
41
- download_dialog: [],
42
- error: []
43
- },
44
- extStyles: [],
45
- extJS: [],
46
- skinJS: '',
47
- mutes: [],
48
- preSlideVol: false,
49
- exData: false,
50
- exThresh: 2,
51
- showErrors: false,
52
- factors: { vol: 1 },
53
- hasListMeta: true,
54
-
55
- vars: {
56
- play_f: true,
57
- stylesheet_url: '',
58
- dload_text: '',
59
- force_dload: true,
60
- message_interval: '<h2>Download Audio</h2><p style="margin-top:34px !important;">Your download should start in a second!</p>',
61
- message_ok: '',
62
- message_indark: '<h2>Download Audio</h2><p>Your download should start in a second!</p>',
63
- 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>',
64
- message_fail: '<h2>Download Failed</h2><p>Sorry, something went wrong!</p>',
65
- message_timeout: '<h2>Download<br />Unavailable</h2><p>please try again later!</p>',
66
- message_nosolution: 'Unable to play this item, please update your browser or try another.',
67
- 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>.',
68
- message_bad_url: 'Can\'t locate audio.',
69
- dl_remote_path: ''
70
- },
71
-
72
- eID: {
73
- play: '#playpause_mp3j_',
74
- playW: '#playpause_wrap_mp3j_',
75
- stp: '#stop_mp3j_',
76
- prev: '#Prev_mp3j_',
77
- next: '#Next_mp3j_',
78
- vol: '#vol_mp3j_',
79
- loader: '#load_mp3j_',
80
- pos: '#posbar_mp3j_',
81
- poscol: '#poscol_mp3j_',
82
- title: '#T_mp3j_',
83
- caption: '#C_mp3j_',
84
- pT: '#P-Time-MI_',
85
- tT: '#T-Time-MI_',
86
- dload: '#download_mp3j_',
87
- plwrap: '#L_mp3j_',
88
- ul: '#UL_mp3j_',
89
- a: 'mp3j_A_', //No hash!
90
- indiM: '#statusMI_',
91
- toglist: '#playlist-toggle_',
92
- lPP: '#lpp_mp3j_',
93
- pplink: '#mp3j_popout_',
94
- img: '#MI_image_'
95
- },
96
-
97
- runExternals: function ( hookname, data ) {
98
- var l = this.extCalls[ hookname ].length;
99
- for ( var x = 0; x < l; x += 1 ) {
100
- ( this.extCalls[ hookname ][ x ] )( data );
101
- }
102
- },
103
-
104
- initialise_jp: function ( supplied, track, vol ) {
105
- var that = this;
106
- jQuery(this.jpID).jPlayer({
107
- ready: function () {
108
- if ( track === true ) {
109
- var dinfo = that.deviceInfo();
110
- if ( dinfo.device === 'Desk/Laptop' ) {
111
- that.startup();
112
- } else { //just remove first autolay if there's any
113
- var j;
114
- for ( j in that.pl_info ) {
115
- if ( that.pl_info[j].autoplay ) {
116
- that.pl_info[j].autoplay = false;
117
- break;
118
- }
119
- }
120
- }
121
- } else {
122
- that.setAudio( track );
123
- that.playit();
124
- jQuery(that.jpID).jPlayer("volume", that.factors.vol * vol/100 ); //Set to player vol
125
- if ( track === false ) { //silence
126
- that.clearit();
127
- }
128
- }
129
- },
130
- swfPath: that.plugin_path + '/js/Jplayer271.swf',
131
- volume: 1,
132
- supplied: supplied,
133
- wmode: "window",
134
- solution:"html, flash",
135
- error: function( event ) {
136
- that.check_show_jperrors( event );
137
- },
138
- preload: "none"
139
- });
140
- jQuery(this.jpID).bind(jQuery.jPlayer.event.ended, function(event) {
141
- that.E_complete(that.tID);
142
- });
143
- jQuery(this.jpID).bind(jQuery.jPlayer.event.timeupdate, function(event) {
144
- var lp = that.get_loaded(event);
145
- var ppA = event.jPlayer.status.currentPercentAbsolute;
146
- var pt = event.jPlayer.status.currentTime;
147
- var tt = event.jPlayer.status.duration;
148
- that.E_update(that.tID, lp, ppA, pt, tt);
149
- });
150
- jQuery(this.jpID).bind(jQuery.jPlayer.event.ready, function(event) {
151
- if(event.jPlayer.html.used && event.jPlayer.html.audio.available) {
152
- that.jp_audio = jQuery(that.jpID).data("jPlayer").htmlElement.audio;
153
- } else {
154
- that.jp_audio = 'flash';
155
- }
156
- });
157
- jQuery(this.jpID).bind(jQuery.jPlayer.event.progress, function(event) {
158
- var lp = that.get_loaded(event);
159
- var pt = event.jPlayer.status.currentTime;
160
- var tt = event.jPlayer.status.duration;
161
- that.E_loading( that.tID, lp, tt, pt );
162
- });
163
-
164
- that.lastformats = supplied;
165
- },
166
-
167
- init: function () {
168
- var plpath;
169
- plpath = this.plugin_path.split('/');
170
- this.dl_domain = plpath[2].replace(/^www./i, "");
171
-
172
- this.unwrap();
173
- this.write_controls();
174
- this.add_jpconstruct_div();
175
- this.runExternals( 'init', {} );
176
- this.addExtStyles();
177
- this.initialise_jp( this.lastformats, true, 1 );
178
- },
179
-
180
- addExtStyles: function () {
181
- var j;
182
- var l = this.extStyles.length;
183
- for ( j = 0; j < l; j += 1 ) {
184
- jQuery( '<style type="text/css">' + this.extStyles[ j ] + '</style>' ).appendTo( 'head' );
185
- }
186
- },
187
-
188
- destroy_jp: function () {
189
- jQuery(this.jpID).unbind();
190
- jQuery(this.jpID).jPlayer("destroy");
191
- jQuery(this.jpID).empty();
192
- },
193
-
194
- check_show_jperrors: function ( event ) {
195
- if ( this.tID !== '' && ! this.jperrorIDs[ this.tID ] ) {
196
- if ( this.showErrors === true ) {
197
- this.show_nosolution( this.tID, event.jPlayer.error.type );
198
- }
199
- this.jperrorIDs[ this.tID ] = event.jPlayer.error.type;
200
- }
201
- },
202
-
203
- show_nosolution: function ( j, errortype ) {
204
- var p = this.pl_info[j];
205
- var track = p.tr;
206
- var formats = p.list[track].formats;
207
- var message = '';
208
-
209
- if ( errortype === 'e_no_solution' || errortype === 'e_no_support' ) {
210
- message = this.vars.message_nosolution;
211
- if ( formats === 'mp3' || formats === 'm4a' ) {
212
- message = this.vars.message_nosolution_mpeg;
213
- }
214
- } else if ( errortype === 'e_url' ) {
215
- message = this.vars.message_bad_url;
216
- }
217
- jQuery('#mp3j_nosolution_' + j).empty().append(message).fadeIn(200);
218
-
219
- if ( this.exData !== false ) {
220
- this.exData.jperror = errortype;
221
- this.runExternals( 'change_post', this.exData );
222
- this.exData = false;
223
- }
224
- },
225
-
226
- add_jpconstruct_div: function () {
227
- 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>';
228
- jQuery('body').prepend( html );
229
- },
230
-
231
- get_loaded: function (event) {
232
- var lp;
233
- if ( typeof this.jp_audio.buffered === "object" ) {
234
- if( this.jp_audio.buffered.length > 0 && this.jp_audio.duration > 0 ) {
235
- lp = 100 * this.jp_audio.buffered.end(this.jp_audio.buffered.length-1) / this.jp_audio.duration;
236
- } else {
237
- lp = 0;
238
- }
239
- } else {
240
- lp = event.jPlayer.status.seekPercent;
241
- }
242
- this.jp_seekable = event.jPlayer.status.seekPercent; //use this for slider calcs for both html/flash solution
243
- this.load_pc = lp;
244
- return lp;
245
- },
246
-
247
- Tformat: function ( sec ) {
248
- var t = sec,
249
- s = Math.floor((t)%60),
250
- m = Math.floor((t/60)%60),
251
- h = Math.floor(t/3600);
252
- return ((h > 0) ? h+':' : '') + ((m > 9) ? m : '0'+m) + ':' + ((s > 9) ? s : '0'+s);
253
- },
254
-
255
- E_loading: function ( j, lp, tt, pt ) {
256
- if (j !== '') {
257
- jQuery(this.eID.loader + j).css( "width", lp + '%' );
258
- if (this.pl_info[j].type === 'MI') {
259
- if (tt > 0 && this.played_t > 0) {
260
- jQuery(this.eID.tT + j).text(this.Tformat(tt));
261
- }
262
- }
263
- if ( this.jp_audio !== 'flash' && lp < 100 ) {
264
- if ( pt === this.played_t && this.state === 'playing' && pt > 0 && !this.sliding ) {
265
- if (this.pl_info[j].type === 'MI') {
266
- jQuery(this.eID.indiM + j).empty().append('<span class="mp3-finding"></span><span class="mp3-tint"></span><span class="mjp-buffering">Buffering</span>');
267
- }
268
- if (this.pl_info[j].type === 'single' ) {
269
- jQuery(this.eID.indiM + j).empty().append('<span class="Smp3-finding"></span><span class="mp3-gtint"></span> ' + this.Tformat(pt));
270
- }
271
- }
272
- this.played_t = pt;
273
- this.total_t = tt;
274
- }
275
- }
276
- },
277
-
278
- E_update: function (j, lp, ppA, pt, tt) {
279
- if (j !== '') {
280
- jQuery(this.eID.loader + j).css( "width", lp + '%' );
281
- jQuery(this.eID.poscol + j).css( "width", ppA + '%' );
282
- if ( jQuery(this.eID.pos + j + ' div.ui-widget-header').length > 0 ) {
283
- jQuery(this.eID.pos + j).slider('option', 'value', 10*ppA);
284
- }
285
- if (pt > 0) {
286
- jQuery(this.eID.pos + j).css( 'visibility', 'visible' );
287
- }
288
- if (this.pl_info[j].type === 'MI') {
289
- jQuery(this.eID.pT + j).text(this.Tformat(pt));
290
- }
291
- if ('playing' === this.state) {
292
- if ('MI' === this.pl_info[j].type) {
293
- if (tt > 0 && this.played_t === pt && lp < 99 && !this.sliding ) {
294
- jQuery(this.eID.indiM + j).empty().append('<span class="mp3-finding"></span><span class="mp3-tint"></span><span class="mjp-buffering">Buffering</span>');
295
- jQuery(this.eID.tT + j).text(this.Tformat(tt));
296
- } else if (pt > 0) {
297
- jQuery(this.eID.indiM + j).empty().append('<span class="mjp-playing">Playing</span>');
298
- jQuery(this.eID.tT + j).text(this.Tformat(tt));
299
- }
300
- }
301
- if ('single' === this.pl_info[j].type){
302
- if (pt > 0 ) {
303
- if (this.played_t === pt && lp < 99 && !this.sliding ) {
304
- jQuery(this.eID.indiM + j).empty().append('<span class="Smp3-finding"></span><span class="mp3-gtint"></span> ' + this.Tformat(pt));
305
- } else {
306
- jQuery(this.eID.indiM + j).empty().append('<span class="Smp3-tint tintmarg"></span> ' + this.Tformat(pt));
307
- }
308
- }
309
- }
310
- }
311
- this.runExternals( 'update_time', { pt: pt, id: j } );
312
- if ( pt >= this.exThresh && this.exData !== false ) {
313
- this.runExternals( 'change_post', this.exData );
314
- this.exData = false;
315
- }
316
- this.played_t = pt;
317
- this.total_t = tt;
318
- this.pp_abs = ppA;
319
- }
320
- },
321
-
322
- E_complete: function (j) {
323
- var p = this.pl_info[j];
324
- if ('MI' === p.type) {
325
- if (p.loop || p.tr+1 < p.list.length) {
326
- this.E_change_track(j, 'next');
327
- } else {
328
- this.E_dblstop(j);
329
- this.startup();
330
- }
331
- }
332
- if ('single' === p.type) {
333
- if (p.loop) {
334
- this.E_change_track(j, 'next');
335
- } else {
336
- this.E_stop(j);
337
- this.startup();
338
- }
339
- }
340
- },
341
-
342
- write_controls: function () {
343
- var j;
344
- for ( j in this.pl_info ) {
345
- this.setup_a_player(j);
346
- this.mutes[j] = false;
347
- }
348
- },
349
-
350
- startup: function () {
351
- var j;
352
- for ( j in this.pl_info ) {
353
- if ( this.pl_info[j].autoplay && (this.pl_info[j].type === 'single' || this.pl_info[j].type === 'MI') ) {
354
- this.pl_info[j].autoplay = false;
355
- this.E_change_track(j, this.pl_info[j].tr);
356
- return;
357
- }
358
- }
359
- },
360
-
361
- setup_a_player: function (j) {
362
- var i, li, sel, that = this, p = this.pl_info[j];
363
-
364
- //PLAYLISTERS and SINGLES
365
- if ('MI' === p.type || 'single' === p.type) {
366
- jQuery(this.eID.vol + j).slider({
367
- value : p.vol,
368
- max: 100,
369
- range: 'min',
370
- start: function ( event, ui ) {
371
- that.preSlideVol = p.vol;
372
- },
373
- stop: function ( event, ui ) {
374
- that.preSlideVol = false;
375
- },
376
- slide: function (event, ui) {
377
- if (j === that.tID) {
378
- jQuery(that.jpID).jPlayer("volume", that.factors.vol * ui.value/100);
379
- }
380
- if ( ui.value === 0 ) {
381
- jQuery('#innerExt1_' + j).addClass('vol-muted');
382
- that.mutes[ j ] = that.preSlideVol;
383
- } else {
384
- jQuery('#innerExt1_' + j).removeClass('vol-muted');
385
- that.mutes[ j ] = false;
386
- }
387
- p.vol = ui.value;
388
- }
389
- });
390
-
391
- jQuery(this.eID.vol + j).click( function ( e ) {
392
- e.stopPropagation();
393
- });
394
-
395
- sel = ('MI' === p.type) ? this.eID.play : this.eID.playW;
396
- jQuery(sel + j).click(function () { //play-pause click
397
- that.E_change_track(j, p.tr);
398
- jQuery(this).blur();
399
- });
400
- jQuery(sel + j).dblclick(function () { //play-pause dbl click
401
- if (that.state !== "playing") {
402
- that.E_change_track(j, p.tr);
403
- }
404
- jQuery(this).blur();
405
- });
406
-
407
- this.titles(j, p.tr);
408
- }
409
-
410
- //PLAYLISTERS
411
- if ('MI' === p.type) {
412
- jQuery(this.eID.pT + j).text('00:00');
413
- jQuery(this.eID.indiM + j).empty().append('<span class="mjp-ready">Ready</span>');
414
- jQuery(this.eID.stp + j).click(function () {
415
- that.E_stop(j);
416
- });
417
- jQuery(this.eID.stp + j).dblclick(function () {
418
- that.E_dblstop(j);
419
- });
420
-
421
- jQuery(this.eID.plwrap + j).hide();
422
- if (p.list.length > 1) {
423
- jQuery(this.eID.next + j).click(function () {
424
- that.E_change_track(j, 'next');
425
- });
426
- jQuery(this.eID.prev + j).click(function () {
427
- that.E_change_track(j, 'prev');
428
- });
429
-
430
- var liClass = '';
431
- var l = p.list.length;
432
- jQuery(this.eID.ul + j).empty();
433
- for (i = 0; i < l; i += 1) {
434
- liClass = ( i === l-1 ) ? ' mjp-li-last' : '';
435
- li = '<li class="li-mjp' + liClass + '"><a class="a-mjp" href="#" id="' + this.eID.a + j + '_' + i + '">';
436
- li += p.list[i].name;
437
- if ( this.hasListMeta && p.list[i].artist !== '' ) {
438
- li += '<br><span>' + p.list[i].artist + '</span>';
439
- }
440
- li += '</a></li>';
441
-
442
-
443
-
444
- jQuery(this.eID.ul + j).append(li);
445
- this.add_ul_click(j, i);
446
- }
447
- jQuery('#' + this.eID.a + j + '_' + p.tr).addClass('mp3j_A_current');
448
- jQuery(this.eID.toglist + j).click(function () {
449
- that.togglelist(j);
450
- });
451
- if (p.lstate === true) {
452
- jQuery(this.eID.plwrap + j).show();
453
- }
454
- }
455
-
456
- this.writedownload(j, p.tr);
457
- if ( this.vars.force_dload === true ) {
458
- this.dl_closeinfo_click(j);
459
- }
460
-
461
- jQuery(this.eID.lPP + j).click(function () {
462
- return that.E_launchPP(j);
463
- });
464
-
465
- jQuery( '#innerExt1_' + j ).click( function ( e ) {
466
- if ( that.mutes[j] === false ) {
467
- if ( j === that.tID ) {
468
- jQuery( that.jpID ).jPlayer( 'volume', 0 );
469
- }
470
- jQuery( '#innerExt1_' + j ).addClass( 'vol-muted' );
471
- jQuery( that.eID.vol + j ).slider( 'value', 0 );
472
- that.mutes[j] = p.vol;
473
- p.vol = 0;
474
- } else {
475
- if ( j === that.tID ) {
476
- jQuery( that.jpID ).jPlayer( 'volume', that.factors.vol * that.mutes[j]/100 );
477
- }
478
- jQuery( '#innerExt1_' + j ).removeClass( 'vol-muted' );
479
- jQuery( that.eID.vol + j ).slider( 'value', that.mutes[j] );
480
- p.vol = that.mutes[j];
481
- that.mutes[j] = false;
482
- }
483
- });
484
- }
485
-
486
- //POPOUT LINKS
487
- if ('popout' === p.type) {
488
- jQuery(this.eID.pplink + j).click(function () {
489
- return that.E_launchPP(j);
490
- });
491
- }
492
- },
493
-
494
- add_ul_click: function (j, i) { //playlist item click
495
- var that = this;
496
- jQuery('#' + this.eID.a + j + "_" + i).click(function (e) {
497
- that.E_change_track(j, i);
498
- e.preventDefault();
499
- });
500
- },
501
-
502
- unwrap: function () {
503
- var i, j, arr;
504
- if ( this.vars.play_f === true && typeof MP3jPLAYLISTS !== "undefined" ) {
505
- for ( var key in MP3jPLAYLISTS ) {
506
- if ( MP3jPLAYLISTS.hasOwnProperty( key ) ) {
507
- arr = MP3jPLAYLISTS[key];
508
- for ( j = 0; j < arr.length; j += 1 ) {
509
- arr[j].mp3 = this.f_undo.f_con( arr[j].mp3 );
510
- if ( arr[j].counterpart !== '' ) {
511
- arr[j].counterpart = this.f_undo.f_con( arr[j].counterpart );
512
- }
513
- }
514
- }
515
- }
516
- }
517
- },
518
-
519
- f_undo: {
520
- keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
521
- f_con : function (input) {
522
- var output = "", i = 0, chr1, chr2, chr3, enc1, enc2, enc3, enc4;
523
- input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
524
- while (i < input.length) {
525
- enc1 = this.keyStr.indexOf(input.charAt(i++)); enc2 = this.keyStr.indexOf(input.charAt(i++));
526
- enc3 = this.keyStr.indexOf(input.charAt(i++)); enc4 = this.keyStr.indexOf(input.charAt(i++));
527
- chr1 = (enc1 << 2) | (enc2 >> 4); chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); chr3 = ((enc3 & 3) << 6) | enc4;
528
- output = output + String.fromCharCode(chr1);
529
- if (enc3 !== 64) { output = output + String.fromCharCode(chr2); }
530
- if (enc4 !== 64) { output = output + String.fromCharCode(chr3); }
531
- }
532
- output = this.utf8_f_con(output);
533
- return output;
534
- },
535
- utf8_f_con : function (utftext) {
536
- var string = "", i = 0, c, c1, c2, c3;
537
- while (i < utftext.length) {
538
- c = utftext.charCodeAt(i);
539
- if (c < 128) {
540
- string += String.fromCharCode(c); i++;
541
- } else if ((c > 191) && (c < 224)) {
542
- c2 = utftext.charCodeAt(i + 1); string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); i += 2;
543
- } else {
544
- c2 = utftext.charCodeAt(i + 1); c3 = utftext.charCodeAt(i + 2); string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); i += 3;
545
- }
546
- }
547
- return string;
548
- }
549
- },
550
-
551
- E_stop: function ( j, caller ) {
552
- var exData = { pT:'', tT:'', pState: '', pU: '', lp:'', ppA:'', jperror:'' };
553
- if (j === this.tID && j !== '') {
554
- var preL = (this.tID !== '' ) ? this.pl_info[this.tID].list : false;
555
- var pU = ( preL !== false ) ? preL[ this.pl_info[this.tID].tr ].mp3 : '';
556
-
557
- if ( this.exData === false ) {
558
- exData.pT = this.played_t;
559
- exData.tT = this.total_t;
560
- exData.pState = this.state;
561
- exData.pU = pU;
562
- exData.lp = this.load_pc;
563
- exData.ppA = this.pp_abs;
564
- } else {
565
- exData = this.exData;
566
- }
567
-
568
- if ( caller !== 'Echange' && this.jperrorIDs[j] === false ) {
569
- this.runExternals( 'change_pre', exData );
570
- }
571
-
572
- this.clearit();
573
- if ( jQuery(this.eID.pos + j + ' div.ui-widget-header').length > 0 ) {
574
- jQuery(this.eID.pos + j).off( 'click', MP3_JPLAYER.stopProp );
575
- jQuery(this.eID.pos + j).slider('destroy');
576
- }
577
- jQuery(this.eID.loader + j).css( "width", '0%' );
578
- this.button(j, 'play');
579
- if (this.pl_info[j].type === 'MI') {
580
- jQuery(this.eID.poscol + j).css( "width", '0%' );
581
- jQuery(this.eID.tT + j).empty();
582
- jQuery(this.eID.indiM + j).empty().append('<span class="mjp-stopped">Stopped</span>');
583
- jQuery(this.eID.pT + j).text(this.Tformat(0));
584
- } else {
585
- jQuery(this.eID.indiM + j).empty();
586
- }
587
- this.load_pc = 0;
588
- this.played_t = 0;
589
- jQuery('#mp3j_nosolution_' + j).empty().hide();
590
- }
591
- return exData;
592
- },
593
-
594
- E_dblstop: function (j) { //playlisters only
595
- this.listclass(j, this.pl_info[j].tr, 0);
596
- if ( this.pl_info[j].tr !== 0 ) {
597
- this.titles(j, 0);
598
- }
599
- this.writedownload(j, 0);
600
- this.E_stop(j);
601
- jQuery(this.eID.indiM + j).empty().append('<span class="mjp-ready">Ready</span>');
602
- this.pl_info[j].tr = 0;
603
- },
604
-
605
- E_change_track: function (j, change) {
606
- var track;
607
- var txt;
608
- var p = this.pl_info[j];
609
-
610
- this.runExternals( 'change_begin', { id: j, change: change } );
611
-
612
- if (j === this.tID && change === p.tr) {
613
- if ('playing' === this.state) {
614
- if (this.load_pc === 0) {
615
- this.E_stop( j, 'Echange');
616
- } else {
617
- this.pauseit();
618
- this.button(j, 'play');
619
- if ('MI' === p.type) {
620
- jQuery(this.eID.indiM + j).empty().append('<span class="mjp-paused">Paused</span>');
621
- }
622
- }
623
- return;
624
- } else if ('paused' === this.state || 'set' === this.state) {
625
- this.playit();
626
- this.button(j, 'pause');
627
- return;
628
- }
629
- }
630
-
631
- var exData = this.E_stop( this.tID, 'Echange' );
632
-
633
- if ('prev' === change) {
634
- track = (p.tr-1 < 0) ? p.list.length-1 : p.tr-1;
635
- } else if ('next' === change) {
636
- track = (p.tr+1 < p.list.length) ? p.tr+1 : 0;
637
- } else {
638
- track = change;
639
- }
640
-
641
- jQuery(this.jpID).jPlayer("volume", 1 ); //Vol scaling fix
642
- jQuery('#mp3j_nosolution_' + j).hide();
643
- 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>';
644
- jQuery(this.eID.indiM + j).empty().append(txt);
645
- this.button(j, 'pause');
646
- this.makeslider(j);
647
- if ('MI' === p.type) {
648
- this.listclass(j, p.tr, track);
649
- if ( p.tr !== track ) {
650
- this.titles(j, track);
651
- }
652
- if (p.download) {
653
- this.writedownload(j, track);
654
- jQuery(this.eID.dload + j).hide().addClass('whilelinks').fadeIn(400);
655
- }
656
- }
657
- p.tr = track;
658
- this.tID = j;
659
-
660
- var formatString = p.list[track].formats[0] + ( (typeof p.list[track].formats[1] !== 'undefined') ? ',' + p.list[track].formats[1] : '' );
661
- if ( formatString !== this.lastformats || this.jperrorIDs[ j ] ) {
662
- this.jperrorIDs[ j ] = false;
663
- this.destroy_jp();
664
- this.initialise_jp( formatString, p.list[track], p.vol );
665
- } else {
666
- this.jperrorIDs[ j ] = false;
667
- this.setAudio( p.list[track] );
668
- this.playit();
669
- jQuery(this.jpID).jPlayer("volume", this.factors.vol * p.vol/100 ); //Reset to correct vol
670
- }
671
-
672
- exData.mp3 = p.list[track].mp3;
673
- exData.name = p.list[track].name;
674
- exData.artist = p.list[track].artist;
675
- this.exData = exData;
676
- this.runExternals( 'change_end', exData );
677
- },
678
-
679
- E_launchPP: function (j) {
680
- this.launched_ID = j;
681
- this.was_playing = ( this.state === "playing" ) ? true : false;
682
- var data = { id: this.launched_ID, playing: this.was_playing };
683
-
684
- this.runExternals( 'button_popout', data );
685
-
686
- if ( this.tID !== '' ) {
687
- this.E_stop(this.tID);
688
- if ( 'mp3,oga' !== this.lastformats ) {
689
- this.destroy_jp();
690
- this.initialise_jp( 'mp3,oga', false, 100 );
691
- } else {
692
- this.setAudio( false );
693
- this.playit(); //make chrome let go of last track (incase it didn't finish loading)
694
- this.clearit();
695
- }
696
- }
697
-
698
- 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' );
699
- if ( window.focus ) {
700
- newwindow.focus();
701
- }
702
- return false;
703
- },
704
-
705
- setAudio: function ( track ) {
706
- var media = {};
707
- this.state = 'set';
708
- if ( false === track ) {
709
- media['mp3'] = this.plugin_path + '/mp3/silence.mp3';
710
- media['ogg'] = this.plugin_path + '/mp3/silence.ogg';
711
- } else {
712
- media[ track.formats[0] ] = track.mp3;
713
- if ( typeof track.formats[1] !== 'undefined' ) {
714
- media[ track.formats[1] ] = track.counterpart;
715
- }
716
- }
717
- jQuery(this.jpID).jPlayer( "setMedia", media );
718
- },
719
-
720
- playit: function () {
721
- this.state = 'playing';
722
- jQuery(this.jpID).jPlayer("play");
723
- },
724
- pauseit: function () {
725
- this.state = 'paused';
726
- jQuery(this.jpID).jPlayer("pause");
727
- },
728
- clearit: function () {
729
- this.state = '';
730
- jQuery(this.jpID).jPlayer("clearMedia");
731
- },
732
-
733
- button: function (j, type) {
734
- if (j !== '') {
735
- if ('pause' === type) {
736
- jQuery( this.eID.play + j ).removeClass( 'play-mjp' ).addClass( 'pause-mjp' ).empty().append( this.pl_info[j].pause_txt );
737
- }
738
- if ('play' === type) {
739
- jQuery( this.eID.play + j ).removeClass( 'pause-mjp' ).addClass( 'play-mjp' ).empty().append( this.pl_info[j].play_txt );
740
- }
741
- }
742
- this.runExternals( 'button_playpause', { type: type } );
743
- },
744
-
745
- listclass: function ( j, rem, add ) {
746
- jQuery('#'+ this.eID.a + j +'_'+ rem).removeClass('mp3j_A_current');
747
- jQuery('#'+ this.eID.a + j +'_'+ add).addClass('mp3j_A_current');
748
- },
749
-
750
- titles: function ( j, track ) {
751
- var data;
752
- var p = this.pl_info[j], Olink = '', Clink = '';
753
- var img = p.list[track].image;
754
- if (p.type === "MI") {
755
- jQuery(this.eID.title + j).empty().append(p.list[track].name).append('<br /><div>' + p.list[track].artist + '</div>');
756
- var lastImg = jQuery(this.eID.img + j + ' img').attr('src');
757
- if ( img === 'false' || img === 'true' || img === '' ) {
758
- jQuery(this.eID.img + j).empty();
759
- } else if ( img !== lastImg ) {
760
- if (p.list[track].imgurl !== '') {
761
- Olink = '<a href="' + p.list[track].imgurl + '">';
762
- Clink = '</a>';
763
- }
764
- jQuery(this.eID.img + j).empty().hide().append(Olink + '<img src="' + p.list[track].image + '" />' + Clink).fadeIn(300);
765
- }
766
- }
767
- data = { title: p.list[track].name, caption: p.list[track].artist, id: j };
768
- this.runExternals( 'write_titles', data );
769
- },
770
-
771
- writedownload: function ( j, track, text ) {
772
- var data;
773
- var p = this.pl_info[j];
774
- text = ( typeof text === 'undefined' ) ? this.vars.dload_text : text;
775
- if ( p.download ) {
776
- jQuery(this.eID.dload + j).empty().removeClass('whilelinks').append('<a id="mp3j_dlanchor_' + j + '" href="' + p.list[track].mp3 + '" target="_blank">' + text + '</a>');
777
- if ( this.vars.force_dload === true ) {
778
- this.dl_button_click( j );
779
- }
780
- }
781
- data = { is_download: p.download , url: p.list[track].mp3 };
782
- this.runExternals( 'write_download', data );
783
- },
784
-
785
- togglelist: function ( j ) {
786
- if (this.pl_info[j].lstate === true) {
787
- jQuery(this.eID.plwrap + j).fadeOut(300);
788
- jQuery(this.eID.toglist + j).text('SHOW');
789
- this.pl_info[j].lstate = false;
790
- } else if (this.pl_info[j].lstate === false) {
791
- jQuery(this.eID.plwrap + j).fadeIn("slow");
792
- jQuery(this.eID.toglist + j).text('HIDE');
793
- this.pl_info[j].lstate = true;
794
- }
795
- },
796
-
797
- makeslider: function ( j ) {
798
- var phmove, cssmove, that = this;
799
- jQuery(this.eID.pos + j).css( 'visibility', 'hidden' );
800
-
801
- jQuery(this.eID.pos + j).slider({
802
- max: 1000,
803
- range: 'min',
804
- slide: function (event, ui) {
805
- if ( that.allowRanges || (ui.value/10) < that.load_pc ) {
806
- cssmove = ui.value/10;
807
- phmove = ui.value*(10.0/that.jp_seekable);
808
- } else {
809
- cssmove = 0.99*that.load_pc;
810
- phmove = (9.9*that.load_pc)*(10.0/that.jp_seekable);
811
- }
812
- jQuery(that.eID.poscol + j).css('width', cssmove + '%');
813
- jQuery(that.jpID).jPlayer("playHead", phmove );
814
- if (that.state === 'paused') {
815
- that.button(j, 'pause');
816
- that.playit();
817
- }
818
- that.state = 'playing';
819
- },
820
- start: function ( event, ui ) {
821
- that.sliding = true;
822
- },
823
- stop: function ( event, ui ) {
824
- that.sliding = false;
825
- }
826
- });
827
-
828
- jQuery(this.eID.pos + j).on( 'click', MP3_JPLAYER.stopProp );
829
- },
830
-
831
- stopProp: function ( e ) {
832
- e.stopPropagation();
833
- },
834
-
835
- deviceInfo: function () {
836
- var isMobile = false;
837
- var os = '';
838
- var device = '';
839
- var ua = navigator.userAgent;
840
- var p = navigator.platform;
841
- var matched;
842
-
843
- if ( /bot|spider/i.test( ua ) ) {
844
- os = 'spider';
845
- } else {
846
- if ( /iPhone|iPod|iPad/.test( p ) ) {
847
- os = 'iOS';
848
- device = p;
849
- isMobile = true;
850
- } else {
851
- var matched = /Android|BlackBerry|IEMobile|Opera Mini|Mobi|Tablet/.exec( ua );
852
- if ( matched ) {
853
- device = ( matched[0] === 'Mobi' ) ? 'Mobile' : matched[0];
854
- isMobile = true;
855
- }
856
- }
857
-
858
- if ( ! isMobile ) {
859
- if ( /Mac/.test( p ) ) {
860
- os = 'Mac';
861
- device = 'Desk/Laptop';
862
- } else if ( /Linux/.test( p ) ) {
863
- os = 'Linux';
864
- device = 'Desk/Laptop';
865
- } else if ( /Win|Pocket PC/.test( p ) ) {
866
- os = 'Windows';
867
- device = 'Desk/Laptop';
868
- }
869
- }
870
- }
871
- return { os:os, device:device, isMobile:isMobile };
872
- }
873
- };
874
-
875
-
876
- /*
877
- * Force browser download
878
- * Version 1.1
879
- * 2014 Simon Ward
880
- */
881
- MP3_JPLAYER.dl_button_click = function ( j ) {
882
- var that = this, p = this.pl_info[j];
883
- jQuery('#mp3j_dlanchor_' + j).click(function (e) {
884
- that.dl_runinfo( p.list[p.tr].mp3, j, e );
885
- that.runExternals( 'download', p.list[p.tr] );
886
- e.preventDefault();
887
- });
888
- };
889
-
890
- MP3_JPLAYER.dl_closeinfo_click = function ( j ) {
891
- var that = this;
892
- jQuery('#mp3j_finfo_close_' + j).click(function () {
893
- that.dl_dialogue( j, '', 'close');
894
- that.clear_timers( j );
895
- });
896
- };
897
-
898
- MP3_JPLAYER.dl_runinfo = function ( get, j, e ) {
899
- var can_write,
900
- dlpath,
901
- message,
902
- that = this,
903
- dlframe = false,
904
- p = this.pl_info[j],
905
- is_local = this.is_local_dload( get );
906
-
907
- var enc_get;
908
-
909
- if ( !this.intervalIDs[ j ] && !this.timeoutIDs[ j ] ) { //if timers not already running for this player
910
- can_write = this.write_cookie('mp3Download' + j, 'waiting', '');
911
- if ( is_local ) {
912
- if ( can_write !== false ) {
913
- this.dl_dialogue( j, this.vars.message_interval, 'check');
914
- } else {
915
- this.dl_dialogue( j, this.vars.message_indark, 'indark');
916
- }
917
- this.intervalIDs[ j ] = setInterval( function(){ that.dl_interval_check( j, can_write ); }, 500);
918
- this.timeoutIDs[ j ] = setTimeout( function(){ that.dl_timeout( j, can_write ); }, 7000);
919
- dlframe = true;
920
- } else {
921
- if ( this.vars.dl_remote_path === '' ) {
922
- message = this.vars.message_promtlink.replace('#1', get);
923
- message = message.replace('#2', p.list[p.tr].name);
924
- this.dl_dialogue( j, message, 'indark');
925
- } else {
926
- message = this.vars.message_indark.replace('#1', get);
927
- message = message.replace('#2', p.list[p.tr].name);
928
- this.dl_dialogue( j, message, 'indark');
929
- dlframe = true;
930
- }
931
- }
932
- this.dl_dialogs[ j ] = 'false';
933
- if ( dlframe ) {
934
- dlpath = this.get_dloader_path( get );
935
- enc_get = encodeURIComponent( get );
936
- 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>');
937
- }
938
- }
939
- };
940
-
941
- MP3_JPLAYER.dl_interval_check = function ( j, can_write ) {
942
- if ( can_write !== false && this.read_cookie('mp3Download' + j) === 'true' ) { //got cookie back, all should be good
943
- this.dl_dialogue( j, this.vars.message_ok, 'hide');
944
- this.clear_timers( j );
945
- } else if ( this.dl_dialogs[ j ] !== 'false' ) { //got a message back
946
- this.dl_dialogue( j, this.dl_dialogs[ j ], 'add');
947
- this.clear_timers( j );
948
- }
949
- };
950
-
951
- MP3_JPLAYER.dl_timeout = function ( j, can_write ) {
952
- this.clear_timers( j );
953
- if ( can_write !== false ) {
954
- this.dl_dialogue( j, this.vars.message_timeout, 'add');
955
- }
956
- };
957
-
958
- MP3_JPLAYER.clear_timers = function ( j ) {
959
- if ( this.intervalIDs[ j ] !== null && this.timeoutIDs[ j ] !== null ) {
960
- clearInterval( this.intervalIDs[j] );
961
- clearTimeout( this.timeoutIDs[j] );
962
- this.intervalIDs[ j ] = null;
963
- this.timeoutIDs[j] = null;
964
- }
965
- jQuery('#mp3j_dlf_' + j).empty(); //ditch iframe
966
- this.write_cookie('mp3Download' + j, '', -1); //clear any cookie
967
- };
968
-
969
- MP3_JPLAYER.dl_dialogue = function ( j, text, state ) {
970
- if ( 'check' === state ) {
971
- jQuery('#mp3j_finfo_gif_' + j).show();
972
- jQuery('#mp3j_finfo_txt_' + j).empty().append(text).show();
973
- jQuery('#mp3j_finfo_' + j).show();
974
- } else if ( 'add' === state ) {
975
- jQuery('#mp3j_finfo_gif_' + j).hide();
976
- jQuery('#mp3j_finfo_txt_' + j).empty().append(text).show();
977
- } else if ( 'indark' === state ) {
978
- jQuery('#mp3j_finfo_gif_' + j).hide();
979
- jQuery('#mp3j_finfo_txt_' + j).empty().append(text).show();
980
- jQuery('#mp3j_finfo_' + j).fadeIn(100);
981
- } else if ( 'close' === state ) {
982
- jQuery('#mp3j_finfo_gif_' + j).hide();
983
- jQuery('#mp3j_finfo_' + j).hide();
984
- } else {
985
- jQuery('#mp3j_finfo_gif_' + j).hide();
986
- if ( text !== '' ) {
987
- jQuery('#mp3j_finfo_txt_' + j).empty().append(text).show();
988
- }
989
- jQuery('#mp3j_finfo_' + j).fadeOut(1000);
990
- }
991
-
992
- this.runExternals( 'download_dialog', { id: j, text: text, state: state } );
993
- };
994
-
995
- MP3_JPLAYER.read_cookie = function ( name ) {
996
- var i, cookie, allCookies = document.cookie.split('; ');
997
- if ( allCookies.length > 0 ) {
998
- for ( i = 0; i < allCookies.length; i += 1 ) {
999
- cookie = allCookies[i].split( '=' );
1000
- if ( cookie[0] === name ) {
1001
- return cookie[1];
1002
- }
1003
- }
1004
- }
1005
- return false;
1006
- };
1007
-
1008
- MP3_JPLAYER.write_cookie = function ( name, value, days ) {
1009
- var date, expires = "";
1010
- if ( days ) {
1011
- date = new Date();
1012
- date.setTime( date.getTime() + (days*24*60*60*1000) );
1013
- expires = "; expires=" + date.toUTCString();
1014
- }
1015
- document.cookie = name + "=" + value + expires + "; path=/";
1016
- return this.read_cookie( name );
1017
- };
1018
-
1019
- MP3_JPLAYER.get_dloader_path = function ( loc ) {
1020
- var k, path = "", file = "", chunks;
1021
- chunks = loc.split('/');
1022
- file = chunks[chunks.length-1];
1023
- if ( loc.charAt(0) === '/' ) {
1024
- path = this.plugin_path + '/download.php';
1025
- } else {
1026
- path = chunks[2].replace(/^www./i, "");
1027
- if ( path === this.dl_domain ) {
1028
- path = this.plugin_path + '/download.php';
1029
- } else {
1030
- path = chunks[0] + '//' + chunks[2] + this.vars.dl_remote_path;
1031
- }
1032
- }
1033
- return path;
1034
- };
1035
-
1036
- MP3_JPLAYER.is_local_dload = function ( loc ) {
1037
- var domain = "", file = "", chunks, is_local = false;
1038
- chunks = loc.split('/');
1039
- file = chunks[chunks.length-1];
1040
- if ( loc.charAt(0) === '/' ) {
1041
- is_local = true;
1042
- } else {
1043
- domain = chunks[2].replace(/^www./i, "");
1044
- if ( domain === this.dl_domain ) {
1045
- is_local = true;
1046
- }
1047
- }
1048
- return is_local;
1049
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/admin/{admin-colours.js → admin-colours.2.7.js} RENAMED
@@ -72,6 +72,9 @@ var MP3jP = {
72
  } else {
73
  if ( this.pickID !== false ) {
74
  jQuery( '#plus' + this.pickID ).removeClass('activePicker');
 
 
 
75
  }
76
  var handle = ( this.openTab === 1 ) ? 'Alpha' : '';
77
  var colour = jQuery('#'+ID).val();
@@ -206,7 +209,7 @@ var MP3jP = {
206
  fontCheckers: function ( ID, selector, onClass, offClass ) {
207
  var ext = '-mjp';
208
  var isChecked = jQuery( ID ).prop('checked');
209
- console.log(isChecked);
210
  if ( isChecked ) {
211
  jQuery( selector ).removeClass( offClass + ext ).addClass( onClass + ext );
212
  jQuery( ID + '_label').addClass('formatOn');
@@ -323,7 +326,7 @@ var MP3jP = {
323
  var style = {};
324
  if ( fieldID === '#barsOffsetVT' ) { //choose top or height
325
  property = jQuery('input[name=barsTopOrHeight]:checked').val();
326
- console.log(property);
327
  if ( 'top' === property ) {
328
  jQuery('#bars-mjp').css({ 'height': 'auto' });
329
  } else {
72
  } else {
73
  if ( this.pickID !== false ) {
74
  jQuery( '#plus' + this.pickID ).removeClass('activePicker');
75
+ this.pickID = false;
76
+ this.CSSprop = false;
77
+ this.partID = false;
78
  }
79
  var handle = ( this.openTab === 1 ) ? 'Alpha' : '';
80
  var colour = jQuery('#'+ID).val();
209
  fontCheckers: function ( ID, selector, onClass, offClass ) {
210
  var ext = '-mjp';
211
  var isChecked = jQuery( ID ).prop('checked');
212
+ //console.log(isChecked);
213
  if ( isChecked ) {
214
  jQuery( selector ).removeClass( offClass + ext ).addClass( onClass + ext );
215
  jQuery( ID + '_label').addClass('formatOn');
326
  var style = {};
327
  if ( fieldID === '#barsOffsetVT' ) { //choose top or height
328
  property = jQuery('input[name=barsTopOrHeight]:checked').val();
329
+ //console.log(property);
330
  if ( 'top' === property ) {
331
  jQuery('#bars-mjp').css({ 'height': 'auto' });
332
  } else {
js/{mp3-jplayer-2.5.js → mp3-jplayer-2.7.js} RENAMED
@@ -533,8 +533,9 @@ var MP3_JPLAYER = {
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);
@@ -864,7 +865,7 @@ var MP3_JPLAYER = {
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
 
533
  if ( this.hasListMeta && p.list[i].artist !== '' ) {
534
  li += '<br><span>' + p.list[i].artist + '</span>';
535
  }
536
+ li += '</a>';
537
+ li += '<div class="mjp_ext_li" id="mjp_ext_li_' + j + '_' + i + '"></div><div class="emjp_clear"></div>';
538
+ li += '</li>';
539
 
540
 
541
  jQuery(this.eID.ul + j).append(li);
865
  jQuery(this.eID.img + j).empty().hide().append(Olink + '<img src="' + p.list[track].image + '" />' + Clink).fadeIn(300);
866
  }
867
  }
868
+ data = { title: p.list[track].name, caption: p.list[track].artist, id: j, track: track };
869
  this.runExternals( 'write_titles', data );
870
  },
871
 
main.php CHANGED
@@ -2,24 +2,26 @@
2
  class MP3j_Main {
3
 
4
  // --------- Update Me ------------
5
- var $version_of_plugin = "2.6";
6
- var $showSplash = false;
7
  // --------------------------------
8
 
9
- var $M_no = 0;
10
- var $F_no = 0;
11
- var $S_no = 0;
12
- var $Caller = false;
13
- var $S_autotrack = 0;
14
- var $S_arb = 1;
15
- var $Player_ID = 0;
16
- var $scriptsflag = "false";
17
- var $postID = false;
18
- var $F_listname = false;
19
- var $F_listlength = false;
20
- var $F_LISTS = array();
21
- var $isExcerpt = false;
22
- var $isAllowedExcerpt = false;
 
 
 
23
  var $setup = array(
24
  'stylesheet' => true,
25
  'cssHead' => true,
@@ -27,27 +29,21 @@ class MP3j_Main {
27
  'cssPopout' => true,
28
  'designPage' => true
29
  );
30
-
31
- var $currentID = '';
32
- var $LibraryI = false;
33
  var $JS = array(
34
- 'playlists' => array(),
35
- 'players' => array()
36
  );
37
  var $dbug = array(
38
- 'str' => '',
39
- 'arr' => array()
40
  );
41
- var $adminOptionsName = "mp3FoxAdminOptions";
42
  var $theSettings = array();
43
  var $Rooturl;
44
  var $WPinstallpath;
45
  var $textdomain = "mp3-jplayer";
46
- var $newCSScustom;
47
  var $stylesheet = "";
48
- var $folder_order = "asc";
49
  var $PP_css_url = "";
50
- var $PluginFolder = "";
51
 
52
  var $allowedFeedExtensions = array();
53
  var $allowedFeedMimes = array();
@@ -64,35 +60,20 @@ class MP3j_Main {
64
  'design' => false
65
  );
66
 
67
- /**
68
- * Sets some vars and makes stored
69
- * options compatible.
70
- */
71
  function __construct ()
72
  {
73
  $this->WPinstallpath = get_bloginfo('wpurl');
74
  $this->Rooturl = preg_replace("/^www\./i", "", $_SERVER['HTTP_HOST']);
75
- $this->PluginFolder = plugins_url('', __FILE__);
76
- //$this->newCSScustom = $this->PluginFolder . "/css/player-silverALT.css";
77
- $this->newCSScustom = $this->PluginFolder . "/css/example.css";
78
  $this->theSettings = $this->getAdminOptions();
79
- //$this->theSettings = $this->OPS; //alias, to go
80
  if ( ! isset( $_POST['update_mp3foxSettings'] ) ) {
81
  $this->setAllowedFeedTypesArrays();
82
  }
83
- //$this->SKINS = $this->getSkinData();
84
  }
85
 
86
-
87
- ////
88
-
89
-
90
-
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'] ) {
@@ -101,28 +82,29 @@ class MP3j_Main {
101
  return $stored;
102
  }
103
 
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;
112
  }
113
 
114
- //~~~~~
115
  function canRun ()
116
  {
117
  $allowed = true;
 
 
 
 
 
118
 
119
  if ( $this->isExcerpt === true ) {
120
  if ( $this->isAllowedExcerpt === false ) {
121
  $this->dbug['str'] .= "\nExiting (isExcerpt, allowed/manual:false)";
122
  $allowed = false;
123
  }
124
- }
125
- else {
126
  if ( ! $this->Caller && ! is_singular() ) {
127
  if ( $this->theSettings['player_onblog'] == 'false' ) {
128
  $this->dbug['str'] .= "\nExiting (player_onblog is unticked)";
@@ -133,10 +115,7 @@ class MP3j_Main {
133
  return $allowed;
134
  }
135
 
136
-
137
-
138
-
139
- //##########
140
  function getImageSizeWP ( $size )
141
  {
142
  $dims = array();
@@ -151,49 +130,47 @@ class MP3j_Main {
151
  return $dims;
152
  }
153
 
154
-
155
- //~~~~~
156
  function getSkinData ()
157
- {
158
- $custom_css = ( $this->theSettings['custom_stylesheet'] == "/" ) ? $this->newCSScustom : $this->prep_value( $this->theSettings['custom_stylesheet'] );
159
- if ( strpos( $custom_css, '/' ) === 0 ) {
160
- $protocol = ( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ) ? 'https' : 'http';
161
- $custom_css = $protocol . '://' . $this->Rooturl . $custom_css;
162
- }
163
-
164
  //v2 skins
165
  $opValue = 'defaultDark';
166
  $this->SKINS[ $opValue ] = array(
167
  'opValue' => $opValue,
168
  'opName' => 'Dark',
169
- 'url' => $this->PluginFolder . "/css/dark.css"
170
  );
171
  $opValue = 'defaultLight';
172
  $this->SKINS[ $opValue ] = array(
173
  'opValue' => $opValue,
174
  'opName' => 'Light',
175
- 'url' => $this->PluginFolder . "/css/light.css"
176
  );
177
  $opValue = 'defaultText';
178
  $this->SKINS[ $opValue ] = array(
179
  'opValue' => $opValue,
180
  'opName' => 'Text',
181
- 'url' => $this->PluginFolder . "/css/text.css"
182
  );
183
 
184
  //v1 skins
185
  $this->SKINS['styleG'] = array(
186
  'opValue' => 'styleG',
187
  'opName' => 'v1 Dark - legacy support',
188
- 'url' => $this->PluginFolder . "/css/v1-skins/v1-dark.css"
189
  );
190
  $this->SKINS['styleF'] = array(
191
  'opValue' => 'styleF',
192
  'opName' => 'v1 Light - legacy support',
193
- 'url' => $this->PluginFolder . "/css/v1-skins/v1-silver.css"
194
  );
195
 
196
  //user's custom css
 
 
 
 
 
197
  $this->SKINS['styleI'] = array(
198
  'opValue' => 'styleI',
199
  'opName' => 'Custom CSS - Enter your own URL below',
@@ -203,9 +180,7 @@ class MP3j_Main {
203
  return $this->SKINS;
204
  }
205
 
206
-
207
-
208
- //###############
209
  function defineJSvars ()
210
  {
211
  if ( ! $this->JSvars ) {
@@ -217,8 +192,7 @@ class MP3j_Main {
217
  }
218
  }
219
 
220
-
221
- //###############
222
  function setAllowedFeedTypesArrays ()
223
  {
224
  $formats = $this->theSettings['audioFormats'];
@@ -263,8 +237,7 @@ class MP3j_Main {
263
  $this->setFeedFormatsSQL( $allowedFeedMimes );
264
  }
265
 
266
-
267
- //###############
268
  function setFeedFormatsRegex ( $extensions )
269
  {
270
  $i = 1;
@@ -278,8 +251,7 @@ class MP3j_Main {
278
  $this->formatsFeedRegex = $regex;
279
  }
280
 
281
-
282
- //###############
283
  function setFeedFormatsSQL ( $mimes )
284
  {
285
  $i = 1;
@@ -292,8 +264,7 @@ class MP3j_Main {
292
  $this->formatsFeedSQL = $mimeTypes;
293
  }
294
 
295
-
296
- //###############
297
  function grab_library_info( $mimeTypes = '' )
298
  {
299
  if ( $this->LibraryI !== false && $mimeTypes === '' ) {
@@ -360,10 +331,7 @@ class MP3j_Main {
360
  return $LIB;
361
  }
362
 
363
-
364
-
365
-
366
- //###############
367
  function grabLibraryURLs( $mimeType )
368
  {
369
  global $wpdb;
@@ -378,8 +346,7 @@ class MP3j_Main {
378
  return ( empty($URLs) ? false : $URLs );
379
  }
380
 
381
-
382
- //###############
383
  function grabFolderURLs( $folder, $extensions = "" )
384
  {
385
  $items = array();
@@ -425,7 +392,6 @@ class MP3j_Main {
425
  natcasesort( $items );
426
  }
427
 
428
- //if ( $this->folder_order != "asc" ) { //TODO:support this still?
429
  if ( $this->theSettings['folderFeedDirection'] === "DESC" ) {
430
  $items = array_reverse( $items, true );
431
  $modTimes = array_reverse( $modTimes, true );
@@ -559,7 +525,7 @@ class MP3j_Main {
559
  }
560
 
561
 
562
-
563
  function pickMetaPart ( $opName, $j )
564
  {
565
  $meta = '';
@@ -665,20 +631,33 @@ class MP3j_Main {
665
  $numdisplay = '';
666
  foreach ( $tracks as $tr )
667
  {
 
668
  if ( $this->FIRST_FORMATS === false ) {
669
- $this->FIRST_FORMATS = $tr['formats'][0] . ( !empty($tr['formats'][1]) ? ','.$tr['formats'][1] : '' );
670
  }
 
 
 
 
671
  if ( $this->theSettings['encode_files'] == "true" ) {
672
- $tr['src'] = base64_encode( $tr['src'] );
673
- $tr['counterpart'] = base64_encode( $tr['counterpart'] );
674
  }
675
 
 
676
  $js .= "\n\t{ name: \"";
677
  if ( $this->theSettings['add_track_numbering'] == "true" ) {
678
  $numdisplay = ( $numbering === false ) ? $no : $numbering;
679
  $js .= $numdisplay . ". ";
680
  }
681
- $js .= $tr['title']. "\", formats: [\"" .$tr['formats'][0] . "\"" . ( ! empty($tr['formats'][1]) ? ", \"".$tr['formats'][1]."\"" : "" ) . "], mp3: \"" .$tr['src']. "\", counterpart:\"" . $tr['counterpart'] . "\", artist: \"" .$tr['caption']. "\", image: \"" .$tr['image']. "\", imgurl: \"" .$tr['link']. "\" }";
 
 
 
 
 
 
 
682
  if ( $no != $count ) {
683
  $js .= ",";
684
  }
@@ -978,51 +957,8 @@ class MP3j_Main {
978
  }
979
 
980
 
981
- /* Looks for any active widget that isn't ruled out by
982
- the page filter. Returns true if finds a widget that will be building. */
983
- function has_allowed_widget( $type )
984
- {
985
- global $_wp_sidebars_widgets;
986
- if ( empty($_wp_sidebars_widgets) ) {
987
- $SBsettings = get_option('sidebars_widgets', array());
988
- }
989
- else {
990
- $SBsettings = $_wp_sidebars_widgets;
991
- }
992
- if ( empty($SBsettings) || is_null($SBsettings) ) {
993
- return false;
994
- }
995
- $active = array();
996
- $scripts = false;
997
- foreach ( $SBsettings as $key => $arr ) {
998
- if ( is_array($arr) && $key != "wp_inactive_widgets" ) {
999
- foreach ( $arr as $i => $widget ) {
1000
- if ( strchr($widget, $type) ) {
1001
- $active[] = $widget;
1002
- }
1003
- }
1004
- }
1005
- }
1006
- $this->dbug['arr'][] = $active;
1007
-
1008
- if ( !empty($active) ) {
1009
- $name = "widget_". $type;
1010
- $ops = get_option($name);
1011
- foreach ( $active as $i => $widget ) {
1012
- $wID = strrchr( $widget, "-" );
1013
- $wID = str_replace( "-", "", $wID );
1014
- foreach ( $ops as $j => $arr ) {
1015
- if ( $j == $wID ) {
1016
- if ( !$this->page_filter($arr['restrict_list'], $arr['restrict_mode']) ) {
1017
- $scripts = true;
1018
- break 2;
1019
- }
1020
- }
1021
- }
1022
- }
1023
- }
1024
- return $scripts;
1025
- }
1026
 
1027
 
1028
  /* Checks current page against widget page-filter settings.
@@ -1090,82 +1026,6 @@ class MP3j_Main {
1090
  return $f;
1091
  }
1092
 
1093
-
1094
- /* Checks whether current post ID
1095
- content contains a shortcode. */
1096
- function has_shortcodes ( $shtype = "" )
1097
- {
1098
- global $post;
1099
- if ( empty($post->ID) ) {
1100
- return false;
1101
- }
1102
- $success = false;
1103
- global $wpdb;
1104
- $content = $wpdb->get_results("SELECT post_content FROM $wpdb->posts WHERE ID=" . $post->ID );
1105
- $con = $content[0]->post_content;
1106
-
1107
- if ( $shtype != "" ) { //check for it
1108
- if ( strpos($con, $shtype) !== false ) {
1109
- //return true;
1110
- $success = true;
1111
- }
1112
- } else { //check for all player making shortcodes
1113
- if ( strpos($con, "[mp3-jplayer") !== false || strpos($con, "[mp3j") !== false || strpos($con, "[mp3t") !== false || strpos($con, "[mp3-popout") !== false ) {
1114
- //return true;
1115
- $success = true;
1116
- }
1117
- if ( $this->theSettings['replace_WP_playlist'] === 'true' ){
1118
- if ( strpos($con, "[playlist") !== false ) {
1119
- $success = true;
1120
- }
1121
- }
1122
- if ( $this->theSettings['replace_WP_audio'] === 'true' || $this->theSettings['replace_WP_attached'] === 'true' ){
1123
- if ( strpos($con, "[audio") !== false ) {
1124
- $success = true;
1125
- }
1126
- }
1127
- if ( $this->theSettings['replace_WP_embedded'] === 'true' ){
1128
- if ( strpos($con, "[embed") !== false ) {
1129
- $success = true;
1130
- }
1131
- }
1132
- }
1133
- //return false;
1134
- return $success;
1135
- }
1136
-
1137
- /* Checks for a string in post content */
1138
- function post_has_string ( $str = "" )
1139
- {
1140
- global $post;
1141
- if ( empty($post->ID) ) {
1142
- return false;
1143
- }
1144
- global $wpdb;
1145
- $content = $wpdb->get_results("SELECT post_content FROM $wpdb->posts WHERE ID=" . $post->ID );
1146
- $con = $content[0]->post_content;
1147
- $success = false;
1148
- if ( $str !== '' ) //check for it
1149
- {
1150
- if ( strpos($con, $str) !== false ) {
1151
- $success = true;
1152
- }
1153
- }
1154
- else //check replacement settings and look for relevant extensions
1155
- {
1156
- if ( $this->theSettings['replace_WP_embedded'] === 'true' || $this->theSettings['make_player_from_link'] === 'true' ) {
1157
- $extensions = array( '.mp3', '.mp4', '.m4a', '.ogg', '.oga', '.wav', '.webm', '.webma' );
1158
- foreach ( $extensions as $ext ) {
1159
- if ( strpos($con, $ext) !== false ) {
1160
- $success = true;
1161
- break;
1162
- }
1163
- }
1164
- }
1165
- }
1166
- return $success;
1167
- }
1168
-
1169
 
1170
  /* Swaps out links for player shortcodes, hooked to the_content. */
1171
  function replace_links ( $stuff = '' )
@@ -1180,62 +1040,45 @@ class MP3j_Main {
1180
 
1181
  return preg_replace( $remove, $add, $stuff );
1182
  }
1183
-
1184
-
1185
- /* Enqueues js and css scripts. */
1186
- function add_Scripts( $theme )
1187
- {
1188
- $version = substr( get_bloginfo('version'), 0, 3);
1189
-
1190
- //jquery and jquery-ui
1191
- //backward compat for older versions of WP, otherwise jquery components will just enqueue from wp-includes
 
 
 
 
1192
  if ( $this->theSettings['disable_jquery_libs'] != "yes" ) {
 
1193
  if ( $version >= 3.1 ) {
1194
- wp_enqueue_script( 'jquery-ui-slider', $this->PluginFolder . '/js/wp-backwards-compat/ui.slider.js', array( 'jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-mouse' ), '1.8.10' );
1195
  }
1196
  else { //pre WP 3.1
1197
- wp_enqueue_script( 'jquery-ui-widget', $this->PluginFolder . '/js/wp-backwards-compat/ui.widget.js', array( 'jquery', 'jquery-ui-core' ), '1.8.10' );
1198
- wp_enqueue_script( 'jquery-ui-mouse', $this->PluginFolder . '/js/wp-backwards-compat/ui.mouse.js', false, '1.8.10' );
1199
- wp_enqueue_script( 'jquery-ui-slider', $this->PluginFolder . '/js/wp-backwards-compat/ui.slider.js', false, '1.8.10' );
1200
  }
1201
- wp_enqueue_script( 'jquery-touch-punch', $this->PluginFolder . '/js/wp-backwards-compat/jquery.ui.touch-punch.min.js', false, '0.2.2' );
1202
- $this->dbug['str'] .= "\n\nScript request added (jQuery & UI)";
1203
- }
1204
- else {
1205
- $this->dbug['str'] .= "\n\nScripts are OFF (jQuery & UI)";
1206
  }
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'] ) ) {
1214
- $themepath = $skins[ $theme ]['url'];
1215
- } else { //fall back to default
1216
- $themepath = $skins['defaultLight']['url'];
1217
- $this->dbug['str'] .= "\nNo css, falling back to default";
1218
- }
1219
 
1220
- if ( $this->setup['stylesheet'] === true ) {
1221
- wp_enqueue_style( 'mp3-jplayer', $themepath, false, $this->version_of_plugin );
1222
- }
1223
- //if ( $this->setup['cssHead'] === true ) {
1224
- // echo $this->writeColoursCSS();
1225
- //}
1226
- $this->PP_css_url = $themepath;
1227
  $this->SCRIPT_CALL = true;
1228
- return;
1229
  }
1230
-
1231
-
1232
  //~~~~~
1233
-
1234
  function writeColoursCSS ()
1235
  {
1236
  $settings = $this->theSettings;
1237
  $colours = $settings['colour_settings'];
1238
- $imgDir = $this->PluginFolder . "/css/images/";
1239
 
1240
  $CSS = "\n<style type=\"text/css\">\n";
1241
 
@@ -1491,91 +1334,34 @@ class MP3j_Main {
1491
  {
1492
  $mp3FoxAdminOptions = $this->pluginDefaultSettings();
1493
  $colour_keys = $mp3FoxAdminOptions['colour_settings'];
1494
- $theOptions = get_option( $this->adminOptionsName );
1495
 
1496
  if ( ! empty($theOptions) )
1497
  {
1498
  if ( $theOptions['db_plugin_version'] !== $this->version_of_plugin ) //do compat
1499
  {
1500
-
1501
- $libUseID3 = ( ! empty( $theOptions['libUseID3'] ) ) ? $theOptions['libUseID3'] : '';
1502
-
1503
- if ( ! empty( $theOptions['libUseID3'] ) ) {
1504
- if ( 'true' === $theOptions['libUseID3'] ) {
1505
- $mp3FoxAdminOptions['playerTitle2'] = 'artist';
1506
- }
1507
- $mp3FoxAdminOptions['playerTitle2'] = ( 'true' === $theOptions['libUseID3'] ) ? 'artist' : 'excerpts';
1508
  }
1509
 
1510
-
1511
- //backwards compat with v1.4 style
1512
- $styleCompat = $this->do_style_compat( $theOptions['player_theme'], $theOptions['custom_stylesheet'] );
1513
- if ( $styleCompat[0] )
1514
- {
1515
- $theOptions['player_theme'] = $styleCompat[0];
1516
- $theOptions['custom_stylesheet'] = $styleCompat[2];
1517
- }
1518
  //ditch un-needed stored settings
1519
- foreach ( $theOptions as $key => $option )
1520
- {
1521
- if ( array_key_exists( $key, $mp3FoxAdminOptions) )
1522
- {
1523
- $mp3FoxAdminOptions[$key] = $option;
1524
  }
1525
  }
1526
 
1527
  //add in any new colour keys
1528
- foreach ( $colour_keys as $key => $val )
1529
- {
1530
- if ( ! array_key_exists( $key, $mp3FoxAdminOptions['colour_settings'] ) )
1531
- {
1532
  $mp3FoxAdminOptions['colour_settings'][ $key ] = $val;
1533
  }
1534
  }
1535
 
1536
- //Pre v2 compatibility stuff
1537
- $saved_version = intval( substr( $theOptions['db_plugin_version'], 0 ,1 ) );
1538
- if ( $saved_version < 2 )
1539
- {
1540
- //fill-in any old default colours that weren't shown admin-side
1541
- $mp3FoxAdminOptions['colour_settings'] = $this->do_colourkey_compat( $mp3FoxAdminOptions['colour_settings'], $mp3FoxAdminOptions['player_theme'] );
1542
-
1543
- //convert old separate colour and opacity fields to rgba in single field
1544
- $mp3FoxAdminOptions['colour_settings'] = $this->areaColourReformat( $mp3FoxAdminOptions['colour_settings'] );
1545
-
1546
- //set a compatible default height
1547
- $mp3FoxAdminOptions['playerHeight'] = ( "styleI" == $mp3FoxAdminOptions['player_theme'] ) ? '71px' : '62px';
1548
-
1549
- $mp3FoxAdminOptions['colour_settings']['titleTop'] = "8px";
1550
- $mp3FoxAdminOptions['colour_settings']['font_size_1'] = "16";
1551
- $mp3FoxAdminOptions['colour_settings']['font_size_2'] = "12";
1552
- $mp3FoxAdminOptions['colour_settings']['font_family_1'] = "verdana";
1553
- $mp3FoxAdminOptions['colour_settings']['font_family_2'] = "verdana";
1554
- $mp3FoxAdminOptions['colour_settings']['posbar_tint'] = "none";
1555
- $mp3FoxAdminOptions['font_size_mp3t'] = '14px';
1556
- $mp3FoxAdminOptions['font_size_mp3j'] = '14px';
1557
-
1558
- $styleKey = $mp3FoxAdminOptions['player_theme'];
1559
-
1560
- if ( $styleKey == 'styleH' ) {
1561
- $mp3FoxAdminOptions['player_theme'] = 'defaultText';
1562
- } else {
1563
- $mp3FoxAdminOptions['colour_settings']['titleBold'] = "false";
1564
- $mp3FoxAdminOptions['colour_settings']['captionItalic'] = "false";
1565
- }
1566
-
1567
- if ( $styleKey == 'styleF' || $styleKey == 'styleG' || $styleKey == 'styleH' ) {
1568
- $mp3FoxAdminOptions['colour_settings']['userClasses'] = 'fullbars';
1569
- } elseif ( $styleKey == 'styleI' ) {
1570
- if ( $mp3FoxAdminOptions['custom_stylesheet'] === $this->newCSScustom ) {
1571
- $mp3FoxAdminOptions['custom_stylesheet'] = '/';
1572
- $mp3FoxAdminOptions['player_theme'] = 'styleF';
1573
- }
1574
- }
1575
- }
1576
-
1577
  $mp3FoxAdminOptions['db_plugin_version'] = $this->version_of_plugin; //set last!
1578
- update_option($this->adminOptionsName, $mp3FoxAdminOptions);
1579
  }
1580
  else
1581
  {
@@ -1587,180 +1373,13 @@ class MP3j_Main {
1587
  $mp3FoxAdminOptions['mp3tColour_on'] = 'true';
1588
  $mp3FoxAdminOptions['mp3jColour_on'] = 'true';
1589
  $mp3FoxAdminOptions['hasListMeta'] = 'true';
1590
- update_option($this->adminOptionsName, $mp3FoxAdminOptions);
1591
-
1592
  }
1593
 
1594
  return $mp3FoxAdminOptions;
1595
- }
1596
-
1597
-
1598
- /**
1599
- * Backwards compat function - Updates player skin
1600
- * options if user has old settings.
1601
- */
1602
- function do_style_compat ( $s, $path = "" )
1603
- {
1604
- //custom stlesheet
1605
- $csspath = $this->PluginFolder . "/css/mp3jplayer-cyanALT.css"; //orig custom stylesheet in v1.4
1606
- $path = ( $path == $csspath || $path == "" ) ? $this->newCSScustom : $path;
1607
-
1608
- //player theme
1609
- if ( "styleA" == $s ) { //orig 'neutral'
1610
- $s = "styleF";
1611
- }
1612
- elseif ( "styleB" == $s ) { //orig 'green'
1613
- $s = "styleF";
1614
- }
1615
- elseif ( "styleC" == $s ) { //orig 'blu'
1616
- $s = "styleF";
1617
- }
1618
- elseif ( "styleD" == $s ) { //orig 'cyanALT', or custom css
1619
- $s = "styleI";
1620
- }
1621
- elseif ( "styleE" == $s ) { //orig 'text'
1622
- $s = "styleH";
1623
- }
1624
- else {
1625
- $s = false;
1626
- }
1627
- return array( $s, $path );
1628
  }
1629
 
1630
-
1631
- /**
1632
- * Backwards compat function (for pre v2 settings) - Puts any default colours (those that
1633
- * weren't specified in user's options) into the current settings for saving.
1634
- */
1635
- function do_colourkey_compat ( $current, $style )
1636
- {
1637
- //old default colour arrays
1638
- $silver = array(
1639
- 'screen_colour' => '#a7a7a7',
1640
- 'screen_opacity' => '35',
1641
- 'loadbar_colour' => '#34A2D9',
1642
- 'loadbar_opacity' => '70',
1643
- 'posbar_colour' => '#5CC9FF',
1644
- 'posbar_opacity' => '80',
1645
- 'posbar_tint' => 'softenT',
1646
- 'playlist_colour' => '#f1f1f1',
1647
- 'playlist_opacity' => '100',
1648
- 'playlist_tint' => 'darken1',
1649
- 'list_divider' => 'med',
1650
- 'screen_text_colour' => '#525252',
1651
- 'list_text_colour' => '#525252',
1652
- 'list_current_colour' => '#47ACDE',
1653
- 'list_hover_colour' => '#768D99',
1654
- 'listBGa_current' => 'transparent',
1655
- 'listBGa_hover' => 'transparent',
1656
- 'indicator' => 'colour',
1657
- 'font_size_1' => '16',
1658
- 'font_size_2' => '14',
1659
- 'font_family_1' => 'theme',
1660
- 'font_family_2' => 'theme',
1661
- 'volume_grad' => 'light'
1662
- );
1663
- $darkgrey = array(
1664
- 'screen_colour' => '#333',
1665
- 'screen_opacity' => '15',
1666
- 'loadbar_colour' => '#34A2D9',
1667
- 'loadbar_opacity' => '70',
1668
- 'posbar_colour' => '#5CC9FF',
1669
- 'posbar_opacity' => '100',
1670
- 'posbar_tint' => 'darken',
1671
- 'playlist_colour' => '#fafafa',
1672
- 'playlist_opacity' => '100',
1673
- 'playlist_tint' => 'darken2',
1674
- 'list_divider' => 'none',
1675
- 'screen_text_colour' => '#525252',
1676
- 'list_text_colour' => '#525252',
1677
- 'list_current_colour' => '#34A2D9',
1678
- 'list_hover_colour' => '#768D99',
1679
- 'listBGa_current' => 'transparent',
1680
- 'listBGa_hover' => 'transparent',
1681
- 'indicator' => 'colour',
1682
- 'font_size_1' => '16',
1683
- 'font_size_2' => '14',
1684
- 'font_family_1' => 'theme',
1685
- 'font_family_2' => 'theme',
1686
- 'volume_grad' => 'dark'
1687
- );
1688
- $text = array(
1689
- 'screen_colour' => 'transparent',
1690
- 'screen_opacity' => '100',
1691
- 'loadbar_colour' => '#aaa',
1692
- 'loadbar_opacity' => '20',
1693
- 'posbar_colour' => '#fff',
1694
- 'posbar_opacity' => '58',
1695
- 'posbar_tint' => 'none',
1696
- 'playlist_colour' => '#f6f6f6',
1697
- 'playlist_opacity' => '100',
1698
- 'playlist_tint' => 'lighten2',
1699
- 'list_divider' => 'none',
1700
- 'screen_text_colour' => '#869399',
1701
- 'list_text_colour' => '#777',
1702
- 'list_current_colour' => '#47ACDE',
1703
- 'list_hover_colour' => '#829FAD',
1704
- 'listBGa_current' => 'transparent',
1705
- 'listBGa_hover' => 'transparent',
1706
- 'indicator' => 'tint',
1707
- 'font_size_1' => '16',
1708
- 'font_size_2' => '14',
1709
- 'font_family_1' => 'theme',
1710
- 'font_family_2' => 'theme',
1711
- 'volume_grad' => 'dark'
1712
- );
1713
-
1714
- switch( $style ) {
1715
- case "styleG":
1716
- $old_colours = $darkgrey;
1717
- break;
1718
-
1719
- case "styleH":
1720
- $old_colours = $text;
1721
- break;
1722
-
1723
- default:
1724
- $old_colours = $silver;
1725
- }
1726
-
1727
- foreach ( $old_colours as $key => $val ) {
1728
- if ( array_key_exists( $key, $current ) && $current[ $key ] == '' ) {
1729
- $current[ $key ] = $val;
1730
- }
1731
- }
1732
- return $current;
1733
- }
1734
-
1735
-
1736
-
1737
-
1738
- //~~~~~
1739
- function areaColourReformat ( $currentColours )
1740
- {
1741
- $c = $currentColours;
1742
- //screen
1743
- $rgb = $this->hexToRGB( $c['screen_colour'], true );
1744
- $c['screen_colour'] = ( $c['screen_opacity'] >= '100' ) ? 'rgb(' .$rgb. ')' : 'rgba(' .$rgb. ',' .( intval($c['screen_opacity']) / 100 ). ')';
1745
-
1746
- //load
1747
- $rgb = $this->hexToRGB( $c['loadbar_colour'], true );
1748
- $c['loadbar_colour'] = ( $c['loadbar_opacity'] >= '100' ) ? 'rgb(' .$rgb. ')' : 'rgba(' .$rgb. ',' .( intval($c['loadbar_opacity']) / 100 ). ')';
1749
-
1750
- //pos
1751
- $rgb = $this->hexToRGB( $c['posbar_colour'], true );
1752
- $c['posbar_colour'] = ( $c['posbar_opacity'] >= '100' ) ? 'rgb(' .$rgb. ')' : 'rgba(' .$rgb. ',' .( intval($c['posbar_opacity']) / 100 ). ')';
1753
-
1754
- //playlist
1755
- $rgb = $this->hexToRGB( $c['playlist_colour'], true );
1756
- $c['playlist_colour'] = ( $c['playlist_opacity'] >= '100' ) ? 'rgb(' .$rgb. ')' : 'rgba(' .$rgb. ',' .( intval($c['playlist_opacity']) / 100 ). ')';
1757
-
1758
- return $c;
1759
- }
1760
-
1761
-
1762
-
1763
- //~~~~~
1764
  function hexToRGB ( $hexStr, $returnAsString = false, $seperator = ',' )
1765
  {
1766
  $hexStr = preg_replace( "/[^0-9A-Fa-f]/", '', $hexStr ); // Gets a proper hex string
@@ -1781,10 +1400,7 @@ class MP3j_Main {
1781
  return $returnAsString ? implode($seperator, $rgbArray) : $rgbArray; // returns the rgb string or the associative array
1782
  }
1783
 
1784
-
1785
-
1786
-
1787
- //~~~~~
1788
  function prep_value ( $field )
1789
  {
1790
  $search = array( "'", '"', '\\' );
@@ -1793,8 +1409,7 @@ class MP3j_Main {
1793
  return $option;
1794
  }
1795
 
1796
-
1797
- //~~~~~
1798
  function strip_scripts ( $field )
1799
  {
1800
  $search = array(
@@ -1806,8 +1421,7 @@ class MP3j_Main {
1806
  return $text;
1807
  }
1808
 
1809
-
1810
- //~~~~~
1811
  function prep_path ( $field )
1812
  {
1813
  $search = array( "'", '"', ';', '\\' );
@@ -1845,12 +1459,6 @@ class MP3j_Main {
1845
  if ( is_front_page() ) { echo " (Home page)"; }
1846
  if ( is_archive() ) { echo "\nTemplate: Archive"; }
1847
 
1848
- //echo "\nUse tags: ";
1849
- //if ( $this->theSettings['disable_template_tag'] == "false" ) {
1850
- // echo "Yes\n";
1851
- //} else {
1852
- // echo "No\n";
1853
- //}
1854
  echo $this->dbug['str'] . "\n";
1855
  echo "\nPlayer count: " . $this->Player_ID;
1856
  echo "\n\nAdmin Settings:\n";
@@ -1871,10 +1479,7 @@ class MP3j_Main {
1871
  return;
1872
  }
1873
 
1874
-
1875
-
1876
-
1877
-
1878
  function playerDefaultParams ( $shortcode ) {
1879
 
1880
  $O = $this->theSettings;
@@ -2023,52 +1628,49 @@ class MP3j_Main {
2023
 
2024
  return $defaults[ $shortcode ];
2025
  }
2026
-
2027
-
2028
-
2029
-
2030
 
 
2031
  function pluginDefaultSettings () {
2032
 
2033
  $colour_keys = array(
2034
- 'screen_colour' => 'rgba(0, 0, 0, 0.13)',
2035
- 'loadbar_colour' => 'rgba(0, 73, 86, 0.59)',
2036
- 'posbar_colour' => 'rgba(0, 177, 180, 0.99)',
2037
  'posbar_tint' => 'soften',
2038
- 'playlist_colour' => 'rgba(16, 16, 16, 0.82)',
2039
- 'playlist_tint' => 'lighten1',
2040
  'list_divider' => 'none',
2041
- 'screen_text_colour' => '#202020',
2042
- 'list_text_colour' => '#ffffff',
2043
- 'list_current_colour' => '#00e2f0',
2044
- 'list_hover_colour' => '#bdfdf7',
2045
- 'listBGa_current' => 'transparent',
2046
- 'listBGa_hover' => 'transparent',
2047
- 'font_size_1' => '23',
2048
- 'font_size_2' => '17',
2049
  'font_family_1' => 'theme',
2050
  'font_family_2' => 'theme',
2051
- 'titleAlign' => 'left',
2052
- 'titleOffset' => '16px',
2053
- 'titleOffsetR' => '16px',
2054
  'titleBold' => 'true',
2055
  'titleHide' => 'false',
2056
  'titleItalic' => 'false',
2057
- 'titleTop' => '20px',
2058
  'captionBold' => 'false',
2059
  'captionItalic' => 'true',
2060
  'listBold' => 'false',
2061
  'listItalic' => 'false',
2062
  'listAlign' => 'left',
2063
- 'imageAlign' => 'right',
2064
  'imgOverflow' => 'false',
2065
- 'userClasses' => 'nostop',
2066
  'indicator' => 'colour',
2067
  'adminBG' => '#f6f6f6',
2068
- 'adminCheckerIMG' => 'false',
2069
- 'adminIMG' => $this->PluginFolder . '/css/admin/images/test-image.jpg',
2070
  'adminSizer_w' => '570px',
2071
- 'adminSizer_h' => '320px'
2072
  );
2073
 
2074
  $audioFormats = array(
@@ -2091,9 +1693,8 @@ class MP3j_Main {
2091
  'remember_settings' => 'true',
2092
  'hide_mp3extension' => 'true',
2093
  'show_downloadmp3' => 'false',
2094
- //'disable_template_tag' => 'false',
2095
  'db_plugin_version' => $this->version_of_plugin,
2096
- 'custom_stylesheet' => $this->newCSScustom,
2097
  'echo_debug' => 'false',
2098
  'add_track_numbering' => 'false',
2099
  'enable_popout' => 'true',
@@ -2102,13 +1703,12 @@ class MP3j_Main {
2102
  'popout_background' => '#f0f0f0',
2103
  'popout_background_image' => '',
2104
  'colour_settings' => $colour_keys,
2105
- //'use_fixed_css' => 'false',
2106
  'paddings_top' => '5px',
2107
  'paddings_bottom' => '30px',
2108
  'paddings_inner' => '30px',
2109
  'popout_max_height' => '600',
2110
  'popout_width' => '400',
2111
- 'popout_button_title' => 'Popout',
2112
  'max_list_height' => '450',
2113
  'encode_files' => 'true',
2114
  'library_sortcol' => 'file',
@@ -2119,7 +1719,7 @@ class MP3j_Main {
2119
  'c_separator' => ';',
2120
  'volslider_on_singles' => 'false',
2121
  'volslider_on_mp3j' => 'false',
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',
@@ -2152,6 +1752,7 @@ class MP3j_Main {
2152
  'playerTitle2' => 'artist',
2153
  'hasListMeta' => 'false',
2154
  'autoResume' => 'true',
 
2155
  );
2156
 
2157
  return $SETTINGS;
2
  class MP3j_Main {
3
 
4
  // --------- Update Me ------------
5
+ var $version_of_plugin = "2.7";
 
6
  // --------------------------------
7
 
8
+ var $S_no = 0;
9
+ var $S_autotrack = 0;
10
+ var $S_arb = 1;
11
+ var $F_no = 0;
12
+ var $Player_ID = 0;
13
+
14
+ var $postID = false;
15
+ var $currentID = '';
16
+ var $F_listname = false;
17
+ var $F_listlength = false;
18
+ var $F_LISTS = array();
19
+
20
+ var $isExcerpt = false;
21
+ var $isAllowedExcerpt = false;
22
+ var $Caller = false;
23
+ var $LibraryI = false;
24
+
25
  var $setup = array(
26
  'stylesheet' => true,
27
  'cssHead' => true,
29
  'cssPopout' => true,
30
  'designPage' => true
31
  );
 
 
 
32
  var $JS = array(
33
+ 'playlists' => array(),
34
+ 'players' => array()
35
  );
36
  var $dbug = array(
37
+ 'str' => '',
38
+ 'arr' => array()
39
  );
40
+
41
  var $theSettings = array();
42
  var $Rooturl;
43
  var $WPinstallpath;
44
  var $textdomain = "mp3-jplayer";
 
45
  var $stylesheet = "";
 
46
  var $PP_css_url = "";
 
47
 
48
  var $allowedFeedExtensions = array();
49
  var $allowedFeedMimes = array();
60
  'design' => false
61
  );
62
 
63
+
64
+ //~~
 
 
65
  function __construct ()
66
  {
67
  $this->WPinstallpath = get_bloginfo('wpurl');
68
  $this->Rooturl = preg_replace("/^www\./i", "", $_SERVER['HTTP_HOST']);
 
 
 
69
  $this->theSettings = $this->getAdminOptions();
 
70
  if ( ! isset( $_POST['update_mp3foxSettings'] ) ) {
71
  $this->setAllowedFeedTypesArrays();
72
  }
 
73
  }
74
 
75
+ //~~
76
+ function get_excerpt_handler( $stored = "" ) {
 
 
 
 
 
 
 
 
77
  $this->isExcerpt = true;
78
  $this->isAllowedExcerpt = false;
79
  if ( $stored != "" && $this->theSettings['run_shcode_in_excerpt'] ) {
82
  return $stored;
83
  }
84
 
85
+ //~~
86
+ function afterExcerpt ( $stuff = '' ) {
 
 
 
87
  $this->isExcerpt = false;
88
  $this->isAllowedExcerpt = false;
89
  return $stuff;
90
  }
91
 
92
+ //~~
93
  function canRun ()
94
  {
95
  $allowed = true;
96
+ if ( 'loggedin' == $this->theSettings['can_view_players'] ) {
97
+ if ( ! is_user_logged_in() ) {
98
+ $allowed = false;
99
+ }
100
+ }
101
 
102
  if ( $this->isExcerpt === true ) {
103
  if ( $this->isAllowedExcerpt === false ) {
104
  $this->dbug['str'] .= "\nExiting (isExcerpt, allowed/manual:false)";
105
  $allowed = false;
106
  }
107
+ } else {
 
108
  if ( ! $this->Caller && ! is_singular() ) {
109
  if ( $this->theSettings['player_onblog'] == 'false' ) {
110
  $this->dbug['str'] .= "\nExiting (player_onblog is unticked)";
115
  return $allowed;
116
  }
117
 
118
+ //~~
 
 
 
119
  function getImageSizeWP ( $size )
120
  {
121
  $dims = array();
130
  return $dims;
131
  }
132
 
133
+ //~~
 
134
  function getSkinData ()
135
+ {
 
 
 
 
 
 
136
  //v2 skins
137
  $opValue = 'defaultDark';
138
  $this->SKINS[ $opValue ] = array(
139
  'opValue' => $opValue,
140
  'opName' => 'Dark',
141
+ 'url' => MP3J_PLUGIN_URL . "/css/dark.css"
142
  );
143
  $opValue = 'defaultLight';
144
  $this->SKINS[ $opValue ] = array(
145
  'opValue' => $opValue,
146
  'opName' => 'Light',
147
+ 'url' => MP3J_PLUGIN_URL . "/css/light.css"
148
  );
149
  $opValue = 'defaultText';
150
  $this->SKINS[ $opValue ] = array(
151
  'opValue' => $opValue,
152
  'opName' => 'Text',
153
+ 'url' => MP3J_PLUGIN_URL . "/css/text.css"
154
  );
155
 
156
  //v1 skins
157
  $this->SKINS['styleG'] = array(
158
  'opValue' => 'styleG',
159
  'opName' => 'v1 Dark - legacy support',
160
+ 'url' => MP3J_PLUGIN_URL . "/css/v1-skins/v1-dark.css"
161
  );
162
  $this->SKINS['styleF'] = array(
163
  'opValue' => 'styleF',
164
  'opName' => 'v1 Light - legacy support',
165
+ 'url' => MP3J_PLUGIN_URL . "/css/v1-skins/v1-silver.css"
166
  );
167
 
168
  //user's custom css
169
+ $custom_css = $this->prep_value( $this->theSettings['custom_stylesheet'] );
170
+ if ( strpos( $custom_css, '/' ) === 0 ) {
171
+ $protocol = ( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ) ? 'https' : 'http';
172
+ $custom_css = $protocol . '://' . $this->Rooturl . $custom_css;
173
+ }
174
  $this->SKINS['styleI'] = array(
175
  'opValue' => 'styleI',
176
  'opName' => 'Custom CSS - Enter your own URL below',
180
  return $this->SKINS;
181
  }
182
 
183
+ //~~
 
 
184
  function defineJSvars ()
185
  {
186
  if ( ! $this->JSvars ) {
192
  }
193
  }
194
 
195
+ //~~
 
196
  function setAllowedFeedTypesArrays ()
197
  {
198
  $formats = $this->theSettings['audioFormats'];
237
  $this->setFeedFormatsSQL( $allowedFeedMimes );
238
  }
239
 
240
+ //~~
 
241
  function setFeedFormatsRegex ( $extensions )
242
  {
243
  $i = 1;
251
  $this->formatsFeedRegex = $regex;
252
  }
253
 
254
+ //~~
 
255
  function setFeedFormatsSQL ( $mimes )
256
  {
257
  $i = 1;
264
  $this->formatsFeedSQL = $mimeTypes;
265
  }
266
 
267
+ //~~
 
268
  function grab_library_info( $mimeTypes = '' )
269
  {
270
  if ( $this->LibraryI !== false && $mimeTypes === '' ) {
331
  return $LIB;
332
  }
333
 
334
+ //~~
 
 
 
335
  function grabLibraryURLs( $mimeType )
336
  {
337
  global $wpdb;
346
  return ( empty($URLs) ? false : $URLs );
347
  }
348
 
349
+ //~~
 
350
  function grabFolderURLs( $folder, $extensions = "" )
351
  {
352
  $items = array();
392
  natcasesort( $items );
393
  }
394
 
 
395
  if ( $this->theSettings['folderFeedDirection'] === "DESC" ) {
396
  $items = array_reverse( $items, true );
397
  $modTimes = array_reverse( $modTimes, true );
525
  }
526
 
527
 
528
+ //~~
529
  function pickMetaPart ( $opName, $j )
530
  {
531
  $meta = '';
631
  $numdisplay = '';
632
  foreach ( $tracks as $tr )
633
  {
634
+ //Capture the first audio formats to be playlisted (jPlayer will be initialised with these)
635
  if ( $this->FIRST_FORMATS === false ) {
636
+ $this->FIRST_FORMATS = $tr['formats'][0] . ( ! empty($tr['formats'][1]) ? ','.$tr['formats'][1] : '' );
637
  }
638
+
639
+ //Encode urls
640
+ $tr['src_js'] = $tr['src'];
641
+ $tr['counterpart_js'] = $tr['counterpart'];
642
  if ( $this->theSettings['encode_files'] == "true" ) {
643
+ $tr['src_js'] = base64_encode( $tr['src'] );
644
+ $tr['counterpart_js'] = base64_encode( $tr['counterpart'] );
645
  }
646
 
647
+ //Make the track object JS
648
  $js .= "\n\t{ name: \"";
649
  if ( $this->theSettings['add_track_numbering'] == "true" ) {
650
  $numdisplay = ( $numbering === false ) ? $no : $numbering;
651
  $js .= $numdisplay . ". ";
652
  }
653
+ $js .= $tr['title']. "\", formats: [\"" .$tr['formats'][0] . "\"" . ( ! empty($tr['formats'][1]) ? ", \"".$tr['formats'][1]."\"" : "" ) . "], mp3: \"" .$tr['src_js']. "\", counterpart:\"" . $tr['counterpart_js'] . "\", artist: \"" .$tr['caption']. "\", image: \"" .$tr['image']. "\", imgurl: \"" .$tr['link']. "\"";
654
+
655
+ //Run extension Callbacks - Additions to track object JS
656
+ $js = MJPwriteJS_playlist( $js, $tr );
657
+
658
+ //Close track object
659
+ $js .= " }";
660
+
661
  if ( $no != $count ) {
662
  $js .= ",";
663
  }
957
  }
958
 
959
 
960
+
961
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
962
 
963
 
964
  /* Checks current page against widget page-filter settings.
1026
  return $f;
1027
  }
1028
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1029
 
1030
  /* Swaps out links for player shortcodes, hooked to the_content. */
1031
  function replace_links ( $stuff = '' )
1040
 
1041
  return preg_replace( $remove, $add, $stuff );
1042
  }
1043
+
1044
+ //~~
1045
+ function enqueueCSS () {
1046
+ $theme = ( $this->stylesheet == "" ) ? $this->theSettings['player_theme'] : $this->stylesheet;
1047
+ $themepath = isset( $this->SKINS[ $theme ]['url'] )? $this->SKINS[ $theme ]['url'] : $this->SKINS['defaultLight']['url']; //fall back to default
1048
+ if ( $this->setup['stylesheet'] === true ) {
1049
+ wp_enqueue_style( 'mp3-jplayer', $themepath, false, $this->version_of_plugin );
1050
+ }
1051
+ $this->PP_css_url = $themepath;
1052
+ }
1053
+
1054
+ //~~
1055
+ function enqueueJS () {
1056
  if ( $this->theSettings['disable_jquery_libs'] != "yes" ) {
1057
+ $version = substr( get_bloginfo('version'), 0, 3 );
1058
  if ( $version >= 3.1 ) {
1059
+ wp_enqueue_script( 'jquery-ui-slider', MP3J_PLUGIN_URL . '/js/wp-backwards-compat/ui.slider.js', array( 'jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-mouse' ), '1.8.10' );
1060
  }
1061
  else { //pre WP 3.1
1062
+ wp_enqueue_script( 'jquery-ui-widget', MP3J_PLUGIN_URL . '/js/wp-backwards-compat/ui.widget.js', array( 'jquery', 'jquery-ui-core' ), '1.8.10' );
1063
+ wp_enqueue_script( 'jquery-ui-mouse', MP3J_PLUGIN_URL . '/js/wp-backwards-compat/ui.mouse.js', false, '1.8.10' );
1064
+ wp_enqueue_script( 'jquery-ui-slider', MP3J_PLUGIN_URL . '/js/wp-backwards-compat/ui.slider.js', false, '1.8.10' );
1065
  }
1066
+ wp_enqueue_script( 'jquery-touch-punch', MP3J_PLUGIN_URL . '/js/wp-backwards-compat/jquery.ui.touch-punch.min.js', false, '0.2.2' );
 
 
 
 
1067
  }
1068
 
1069
  //jplayer and plugin js
1070
+ wp_enqueue_script( 'jplayer271', MP3J_PLUGIN_URL . '/js/jquery.jplayer.min.2.7.1.js', false, '2.7.1' );
1071
+ wp_enqueue_script( 'mp3-jplayer', MP3J_PLUGIN_URL . '/js/mp3-jplayer-2.7.js', false, '2.7' );
 
 
 
 
 
 
 
 
1072
 
 
 
 
 
 
 
 
1073
  $this->SCRIPT_CALL = true;
 
1074
  }
1075
+
 
1076
  //~~~~~
 
1077
  function writeColoursCSS ()
1078
  {
1079
  $settings = $this->theSettings;
1080
  $colours = $settings['colour_settings'];
1081
+ $imgDir = MP3J_PLUGIN_URL . "/css/images/";
1082
 
1083
  $CSS = "\n<style type=\"text/css\">\n";
1084
 
1334
  {
1335
  $mp3FoxAdminOptions = $this->pluginDefaultSettings();
1336
  $colour_keys = $mp3FoxAdminOptions['colour_settings'];
1337
+ $theOptions = get_option( MP3J_SETTINGS_NAME );
1338
 
1339
  if ( ! empty($theOptions) )
1340
  {
1341
  if ( $theOptions['db_plugin_version'] !== $this->version_of_plugin ) //do compat
1342
  {
1343
+ //Pre v2 compatibility stuff
1344
+ $saved_version = intval( substr( $theOptions['db_plugin_version'], 0 ,1 ) );
1345
+ if ( $saved_version < 2 ) {
1346
+ $theOptions['colour_settings'] = $colour_keys;
 
 
 
 
1347
  }
1348
 
 
 
 
 
 
 
 
 
1349
  //ditch un-needed stored settings
1350
+ foreach ( $theOptions as $key => $option ) {
1351
+ if ( array_key_exists( $key, $mp3FoxAdminOptions ) ) {
1352
+ $mp3FoxAdminOptions[ $key ] = $option;
 
 
1353
  }
1354
  }
1355
 
1356
  //add in any new colour keys
1357
+ foreach ( $colour_keys as $key => $val ) {
1358
+ if ( ! array_key_exists( $key, $mp3FoxAdminOptions['colour_settings'] ) ) {
 
 
1359
  $mp3FoxAdminOptions['colour_settings'][ $key ] = $val;
1360
  }
1361
  }
1362
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1363
  $mp3FoxAdminOptions['db_plugin_version'] = $this->version_of_plugin; //set last!
1364
+ update_option( MP3J_SETTINGS_NAME, $mp3FoxAdminOptions );
1365
  }
1366
  else
1367
  {
1373
  $mp3FoxAdminOptions['mp3tColour_on'] = 'true';
1374
  $mp3FoxAdminOptions['mp3jColour_on'] = 'true';
1375
  $mp3FoxAdminOptions['hasListMeta'] = 'true';
1376
+ update_option( MP3J_SETTINGS_NAME, $mp3FoxAdminOptions );
 
1377
  }
1378
 
1379
  return $mp3FoxAdminOptions;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1380
  }
1381
 
1382
+ //~~
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1383
  function hexToRGB ( $hexStr, $returnAsString = false, $seperator = ',' )
1384
  {
1385
  $hexStr = preg_replace( "/[^0-9A-Fa-f]/", '', $hexStr ); // Gets a proper hex string
1400
  return $returnAsString ? implode($seperator, $rgbArray) : $rgbArray; // returns the rgb string or the associative array
1401
  }
1402
 
1403
+ //~~
 
 
 
1404
  function prep_value ( $field )
1405
  {
1406
  $search = array( "'", '"', '\\' );
1409
  return $option;
1410
  }
1411
 
1412
+ //~~
 
1413
  function strip_scripts ( $field )
1414
  {
1415
  $search = array(
1421
  return $text;
1422
  }
1423
 
1424
+ //~~
 
1425
  function prep_path ( $field )
1426
  {
1427
  $search = array( "'", '"', ';', '\\' );
1459
  if ( is_front_page() ) { echo " (Home page)"; }
1460
  if ( is_archive() ) { echo "\nTemplate: Archive"; }
1461
 
 
 
 
 
 
 
1462
  echo $this->dbug['str'] . "\n";
1463
  echo "\nPlayer count: " . $this->Player_ID;
1464
  echo "\n\nAdmin Settings:\n";
1479
  return;
1480
  }
1481
 
1482
+ //~~
 
 
 
1483
  function playerDefaultParams ( $shortcode ) {
1484
 
1485
  $O = $this->theSettings;
1628
 
1629
  return $defaults[ $shortcode ];
1630
  }
 
 
 
 
1631
 
1632
+ //~~
1633
  function pluginDefaultSettings () {
1634
 
1635
  $colour_keys = array(
1636
+ 'screen_colour' => 'rgba(0, 0, 0, 0.18)',
1637
+ 'loadbar_colour' => 'rgba(49, 49, 49, 0.64)',
1638
+ 'posbar_colour' => 'rgba(0, 180, 37, 0.91)',
1639
  'posbar_tint' => 'soften',
1640
+ 'playlist_colour' => 'rgba(167, 167, 167, 0.55)',
1641
+ 'playlist_tint' => 'none',
1642
  'list_divider' => 'none',
1643
+ 'screen_text_colour' => '#3d3232',
1644
+ 'list_text_colour' => '#262120',
1645
+ 'list_current_colour' => '#11912b',
1646
+ 'list_hover_colour' => '#262120',
1647
+ 'listBGa_current' => '#d8d8d8',
1648
+ 'listBGa_hover' => '#d3d3d3',
1649
+ 'font_size_1' => '22',
1650
+ 'font_size_2' => '18',
1651
  'font_family_1' => 'theme',
1652
  'font_family_2' => 'theme',
1653
+ 'titleAlign' => 'right',
1654
+ 'titleOffset' => '36px',
1655
+ 'titleOffsetR' => '36px',
1656
  'titleBold' => 'true',
1657
  'titleHide' => 'false',
1658
  'titleItalic' => 'false',
1659
+ 'titleTop' => '30px',
1660
  'captionBold' => 'false',
1661
  'captionItalic' => 'true',
1662
  'listBold' => 'false',
1663
  'listItalic' => 'false',
1664
  'listAlign' => 'left',
1665
+ 'imageAlign' => 'left',
1666
  'imgOverflow' => 'false',
1667
+ 'userClasses' => 'nostop flip',
1668
  'indicator' => 'colour',
1669
  'adminBG' => '#f6f6f6',
1670
+ 'adminCheckerIMG' => 'true',
1671
+ 'adminIMG' => MP3J_PLUGIN_URL . '/css/admin/images/test-image.jpg',
1672
  'adminSizer_w' => '570px',
1673
+ 'adminSizer_h' => '395px'
1674
  );
1675
 
1676
  $audioFormats = array(
1693
  'remember_settings' => 'true',
1694
  'hide_mp3extension' => 'true',
1695
  'show_downloadmp3' => 'false',
 
1696
  'db_plugin_version' => $this->version_of_plugin,
1697
+ 'custom_stylesheet' => '',
1698
  'echo_debug' => 'false',
1699
  'add_track_numbering' => 'false',
1700
  'enable_popout' => 'true',
1703
  'popout_background' => '#f0f0f0',
1704
  'popout_background_image' => '',
1705
  'colour_settings' => $colour_keys,
 
1706
  'paddings_top' => '5px',
1707
  'paddings_bottom' => '30px',
1708
  'paddings_inner' => '30px',
1709
  'popout_max_height' => '600',
1710
  'popout_width' => '400',
1711
+ 'popout_button_title' => '',
1712
  'max_list_height' => '450',
1713
  'encode_files' => 'true',
1714
  'library_sortcol' => 'file',
1719
  'c_separator' => ';',
1720
  'volslider_on_singles' => 'false',
1721
  'volslider_on_mp3j' => 'false',
1722
+ 'dload_text' => '',
1723
  'loggedout_dload_text' => 'Log in to download',
1724
  'loggedout_dload_link' => $this->WPinstallpath . '/wp-login.php',
1725
  'force_browser_dload' => 'true',
1752
  'playerTitle2' => 'artist',
1753
  'hasListMeta' => 'false',
1754
  'autoResume' => 'true',
1755
+ 'can_view_players' => 'all',
1756
  );
1757
 
1758
  return $SETTINGS;
mp3jplayer.php CHANGED
@@ -1,9 +1,9 @@
1
- <?php
2
  /*
3
  Plugin Name: MP3-jPlayer
4
  Plugin URI: http://mp3-jplayer.com
5
  Description: Easy, Flexible Audio for WordPress.
6
- Version: 2.6
7
  Author: Simon Ward
8
  Author URI: http://www.sjward.org
9
  License: GPL2
@@ -11,98 +11,44 @@ Text Domain: mp3-jplayer
11
 
12
  This program is free software; you can redistribute it and/or modify
13
  it under the terms of the GNU General Public License, version 2, as
14
- published by the Free Software Foundation.
15
  */
16
 
17
 
18
- if ( ! function_exists( 'get_bloginfo' ) ) { //prevent direct access
 
19
  die();
20
  }
21
 
22
 
23
- $path = dirname( __FILE__ );
24
- include_once( $path . '/widget-ui.php' );
25
- include_once( $path . '/widget-sh.php' );
26
- include_once( $path . '/template-functions.php' );
27
- include_once( $path . '/main.php' );
28
- include_once( $path . '/frontend.php' );
29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  if ( class_exists( 'MP3j_Front' ) ) {
31
  $MP3JP = new MP3j_Front();
32
  }
33
 
34
  if ( isset( $MP3JP ) ) {
35
-
36
- add_action( 'plugins_loaded', array( &$MP3JP, 'loadTranslation' ) );
37
-
38
- add_action( 'init', array( &$MP3JP, 'onInit' ), 100 );
39
- add_action( 'admin_init', array( &$MP3JP, 'onAdminInit' ) );
40
- add_action( 'widgets_init', array( &$MP3JP, 'registerWidgets' ) );
41
-
42
- if ( is_admin() ) {
43
- include_once( $path . '/admin-settings.php');
44
- include_once( $path . '/admin-colours.php');
45
-
46
- add_action( 'admin_menu', array( &$MP3JP, 'createAdminPages' ), 100 );
47
- add_action( 'deactivate_mp3-jplayer/mp3jplayer.php', array( &$MP3JP, 'deactivate' ) );
48
- add_action( 'activate_mp3-jplayer/mp3jplayer.php', array(&$MP3JP, 'activate'));
49
- add_action( 'admin_head', array(&$MP3JP, 'removeSplashMenuItem') );
50
- }
51
-
52
-
53
- //$MP3JP->registerShortcodes();
54
- $ops = $MP3JP->theSettings;
55
- add_shortcode( 'mp3t', array( &$MP3JP, 'inline_play_handler' ) );
56
- add_shortcode( 'mp3j', array( &$MP3JP, 'inline_play_graphic' ) );
57
- add_shortcode( 'mp3-jplayer', array( &$MP3JP, 'primary_player' ) );
58
-
59
- remove_shortcode( 'popout' );
60
- add_shortcode( 'popout', array( &$MP3JP, 'popout_link_player' ) );
61
- add_shortcode( 'mp3-popout', array( &$MP3JP, 'popout_link_player' ) );
62
-
63
- if ( $ops['replace_WP_playlist'] === 'true' && ! is_admin() ) {
64
- remove_shortcode('playlist');
65
- add_shortcode('playlist', array(&$MP3JP, 'replacePlaylistShortcode'));
66
- }
67
-
68
- if ( ! is_admin() && ($ops['replace_WP_audio'] === 'true' || $ops['replace_WP_embedded'] === 'true' || $ops['replace_WP_attached'] === 'true') ) {
69
- remove_shortcode('audio');
70
- add_shortcode('audio', array(&$MP3JP, 'replaceAudioShortcode'));
71
- }
72
-
73
-
74
- //$MP3JP->registerTagCallbacks();
75
- add_action( 'mp3j_addscripts', array( &$MP3JP, 'scripts_tag_handler' ), 1, 1 );
76
- add_action( 'mp3j_put', array( &$MP3JP, 'template_tag_handler' ), 10, 1 );
77
- add_action( 'mp3j_debug', array( &$MP3JP, 'debug_info' ), 10, 1 );
78
- add_filter( 'mp3j_grab_library', array( &$MP3JP, 'grablibrary_handler' ), 10, 1 );
79
- add_action( 'mp3j_settings', array( &$MP3JP, 'mp3j_settings' ), 1, 1 );
80
-
81
- /*
82
- * should use this conditional but it means that as page loads up players initially appear unstyled (aren't styled until
83
- * last minute) TODO:enqueue style in header when poss.
84
- * always run both hooks for the mo.
85
- */
86
- //$WPversion = substr( get_bloginfo('version'), 0, 3);
87
- //if ( $WPversion < 3.3 ) {
88
- add_action('wp_head', array( &$MP3JP, 'header_scripts_handler' ), 2); //Support for WP versions below 3.3
89
- //}
90
- add_action('wp_footer', array( &$MP3JP, 'checkAddScripts' ), 1); //Final chance to enqueue, process this action early (priority < 20).
91
- add_action('wp_footer', array( &$MP3JP, 'footercode_handler' ), 200); //Add any inline js, process this action late (enqueues fire at priority 20).
92
-
93
- add_filter('get_the_excerpt', array( &$MP3JP, 'get_excerpt_handler' ), 1);
94
- add_filter('the_content', array( &$MP3JP, 'afterExcerpt' ), 9999);
95
-
96
- if ( $ops['make_player_from_link'] == "true" ) {
97
- add_filter('the_content', array( &$MP3JP, 'replace_links' ), 1);
98
- }
99
- if ( $ops['run_shcode_in_excerpt'] == "true" ) {
100
- add_filter( 'the_excerpt', 'shortcode_unautop' );
101
- add_filter( 'the_excerpt', 'do_shortcode' );
102
- }
103
-
104
-
105
-
106
  }
107
 
108
  ?>
1
+ <?php
2
  /*
3
  Plugin Name: MP3-jPlayer
4
  Plugin URI: http://mp3-jplayer.com
5
  Description: Easy, Flexible Audio for WordPress.
6
+ Version: 2.7
7
  Author: Simon Ward
8
  Author URI: http://www.sjward.org
9
  License: GPL2
11
 
12
  This program is free software; you can redistribute it and/or modify
13
  it under the terms of the GNU General Public License, version 2, as
14
+ published by the Free Software Foundation.
15
  */
16
 
17
 
18
+ //prevent direct access
19
+ if ( ! function_exists( 'get_bloginfo' ) ) {
20
  die();
21
  }
22
 
23
 
24
+ //constants
25
+ define( 'MP3J_PLUGIN_PATH', dirname( __FILE__ ) );
26
+ define( 'MP3J_PLUGIN_URL', plugins_url( '', __FILE__ ) );
27
+ define( 'MP3J_SETTINGS_NAME', 'mp3FoxAdminOptions' );
 
 
28
 
29
+
30
+ //includes
31
+ include_once( MP3J_PLUGIN_PATH . '/widget-ui.php' );
32
+ include_once( MP3J_PLUGIN_PATH . '/widget-sh.php' );
33
+ include_once( MP3J_PLUGIN_PATH . '/template-functions.php' );
34
+ include_once( MP3J_PLUGIN_PATH . '/main.php' );
35
+ include_once( MP3J_PLUGIN_PATH . '/frontend.php' );
36
+
37
+ if ( is_admin() ) {
38
+ include_once( MP3J_PLUGIN_PATH . '/admin-settings.php');
39
+ include_once( MP3J_PLUGIN_PATH . '/admin-colours.php');
40
+ }
41
+
42
+
43
+ //create instance and hookup with wp
44
  if ( class_exists( 'MP3j_Front' ) ) {
45
  $MP3JP = new MP3j_Front();
46
  }
47
 
48
  if ( isset( $MP3JP ) ) {
49
+ $MP3JP->addPrimaryHooks();
50
+ $MP3JP->registerShortcodes();
51
+ $MP3JP->registerTagCallbacks();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  }
53
 
54
  ?>
popout.php CHANGED
@@ -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.5.js'></script>
21
 
22
  <script type='text/javascript'>
23
  function loadcss(filename) {
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.7.js'></script>
21
 
22
  <script type='text/javascript'>
23
  function loadcss(filename) {
readme.txt CHANGED
@@ -3,11 +3,11 @@ Author URI: http://sjward.org
3
  Plugin URI: http://mp3-jplayer.com
4
  Contributors: simon.ward
5
  Donate link: http://www.sjward.org/jplayer-for-wordpress
6
- Tags: audio, audio player, audio playlist, mp3 player, music player, media, mobile, iphone, ipad, integration, multisite, playlist player, media player, audio widget, audio download, html5 audio, music player, mp3, music, html5, flash, jplayer, playlist, jquery, shortcode, widget, css, post, page, sidebar, html 5
7
  License: GPLv2 or later
8
  Requires at least: 2.9
9
  Tested up to: 4.4
10
- Stable tag: 2.6
11
 
12
  Easy, Flexible Audio for WordPress.
13
 
@@ -19,7 +19,10 @@ Easy, Flexible Audio for WordPress.
19
  * Near-continuous playback between pages.
20
  * Play from your media library, uploaded folders, and urls.
21
  * Style, colour, and layout options.
22
- * 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
 
@@ -31,6 +34,7 @@ Easy, Flexible Audio for WordPress.
31
  MP3-jPlayer will expand WP's native shortcodes with new functions and options, giving you a lot of choice in how to set up your music playlists. Here's a few of the features:
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.
@@ -115,6 +119,12 @@ Either on the [forum at Wordpress](https://wordpress.org/support/plugin/mp3-jpla
115
 
116
  == Changelog ==
117
 
 
 
 
 
 
 
118
  = 2.6 =
119
  * The plugin can now be translated. The .pot file is in the 'lang' folder of the plugin.
120
 
3
  Plugin URI: http://mp3-jplayer.com
4
  Contributors: simon.ward
5
  Donate link: http://www.sjward.org/jplayer-for-wordpress
6
+ Tags: audio, playlist, player, music, audio player, audio playlist, mp3 player, music player, media, mobile, iphone, ipad, integration, multisite, playlist player, media player, audio widget, audio download, html5 audio, music player, mp3, html5, flash, jplayer, jquery, shortcode, widget, css, post, page, sidebar, html 5
7
  License: GPLv2 or later
8
  Requires at least: 2.9
9
  Tested up to: 4.4
10
+ Stable tag: 2.7
11
 
12
  Easy, Flexible Audio for WordPress.
13
 
19
  * Near-continuous playback between pages.
20
  * Play from your media library, uploaded folders, and urls.
21
  * Style, colour, and layout options.
22
+ * Playlist and single file audio players
23
+ * Popout players
24
+ * Smooth downloads.
25
+ * Login options for playing and downloading.
26
  * Works with all built-in WordPress options for adding your music, including the recently introduced *Create Audio Playlist* drag & drop interface.
27
 
28
 
34
  MP3-jPlayer will expand WP's native shortcodes with new functions and options, giving you a lot of choice in how to set up your music playlists. Here's a few of the features:
35
 
36
  * Add unlimited music players to pages, posts, sidebars, and template files.
37
+ * Show the players to all visitors, or just logged-in users.
38
  * Offer downloads to visitors or logged-in users.
39
  * Playlist entire folders with a single line of shortcode.
40
  * Can be selectively integrated with WordPress default audio players.
119
 
120
  == Changelog ==
121
 
122
+ = 2.7 =
123
+ * Added option to show the players to logged in users only. This is a global option. The setting is at the top of the 'Advanced' tab on the settings page.
124
+ * Fixed admin-side bug with the list colour pickers on the 'Design' page.
125
+ * Removed redundant update routines.
126
+ * Added developer methods for accessing the shortcode atts, and extending the js track objects.
127
+
128
  = 2.6 =
129
  * The plugin can now be translated. The .pot file is in the 'lang' folder of the plugin.
130
 
template-functions.php CHANGED
@@ -1,14 +1,5 @@
1
  <?php
2
 
3
- //Widgets
4
- function mp3jplayer_widget_init() {
5
- register_widget( 'MP3_jPlayer' );
6
- }
7
- function mp3jshortcodes_widget_init() {
8
- register_widget( 'MP3j_single' );
9
- }
10
-
11
-
12
  //hooks - settings
13
  function MJPsettings_players() {
14
  do_action( 'MJPsettings_players' );
@@ -24,7 +15,11 @@ function MJPsettings_after_mp3tj() {
24
  }
25
  function MJPsettings_playlist() {
26
  do_action( 'MJPsettings_playlist' );
 
 
 
27
  }
 
28
  function MJPsettings_submit() {
29
  do_action( 'MJPsettings_submit' );
30
  }
@@ -58,6 +53,15 @@ function MJPfront_mp3t( $atts = array() ) {
58
  function MJPfront_mp3j( $atts = array() ) {
59
  return apply_filters( 'MJPfront_mp3j', $atts );
60
  }
 
 
 
 
 
 
 
 
 
61
 
62
 
63
  //hooks - frontend templates
1
  <?php
2
 
 
 
 
 
 
 
 
 
 
3
  //hooks - settings
4
  function MJPsettings_players() {
5
  do_action( 'MJPsettings_players' );
15
  }
16
  function MJPsettings_playlist() {
17
  do_action( 'MJPsettings_playlist' );
18
+ }
19
+ function MJPsettings_downloads_above() {
20
+ do_action( 'MJPsettings_downloads_above' );
21
  }
22
+
23
  function MJPsettings_submit() {
24
  do_action( 'MJPsettings_submit' );
25
  }
53
  function MJPfront_mp3j( $atts = array() ) {
54
  return apply_filters( 'MJPfront_mp3j', $atts );
55
  }
56
+ function MJPfront_playlist_player( $atts = array() ) {
57
+ return apply_filters( 'MJPfront_playlist_player', $atts );
58
+ }
59
+ function MJPfront_popout_player( $atts = array() ) {
60
+ return apply_filters( 'MJPfront_popout_player', $atts );
61
+ }
62
+ function MJPwriteJS_playlist( $js = '', $track ) {
63
+ return apply_filters( 'MJPwriteJS_playlist', $js, $track );
64
+ }
65
 
66
 
67
  //hooks - frontend templates