MP3-jPlayer - Version 2.3

Version Description

  • Fixed a major issue on index/cat/search type pages that could incorrectly assign the playlists or break players in some scenarios.
  • Added support for custom js (for skin extensions) on the player Design page.
  • Developer note: renamed the MP3-jPlayer plugin class instance to MP3JP.
Download this release

Release Info

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

Code changes from version 2.2 to 2.3

admin-colours.php CHANGED
@@ -2,11 +2,11 @@
2
 
3
  function mp3j_print_colours_page()
4
  {
5
- global $mp3_fox;
6
- $O = $mp3_fox->getAdminOptions();
7
  $openTab = '0';
8
 
9
- if ( isset( $_POST['save_MP3jP'] ) )
10
  {
11
  //colours array
12
  foreach ( $O['colour_settings'] as $key => $val ) {
@@ -27,18 +27,18 @@ function mp3j_print_colours_page()
27
  $O['colour_settings']['imgOverflow'] = ( isset($_POST['imgOverflow']) ) ? "visible" : "hidden";
28
 
29
 
30
- $O['playerHeight'] = $mp3_fox->prep_value( $_POST['playerHeight'] );
31
- $O['custom_stylesheet'] = $mp3_fox->prep_path( $_POST['custom_stylesheet'] );
32
- $O['player_theme'] = $mp3_fox->prep_value( $_POST['player_theme'] );
33
- $O['imageSize'] = $mp3_fox->prep_value( $_POST['imageSize'] );
34
 
35
 
36
  //update
37
- update_option($mp3_fox->adminOptionsName, $O);
38
- $mp3_fox->theSettings = $O;
39
  ?>
40
  <!-- save message -->
41
- <div class="updated"><p><strong><?php _e("Settings Updated.", $mp3_fox->textdomain );?></strong></p></div>
42
  <?php
43
  }
44
 
@@ -46,8 +46,8 @@ function mp3j_print_colours_page()
46
 
47
 
48
  //Write js vars..
49
- //$css_urls = $mp3_fox->getSkinData();
50
- $css_urls = $mp3_fox->SKINS;
51
 
52
  //..current stylesheet url to js
53
  $player_theme = $O['player_theme'];
@@ -83,7 +83,7 @@ function mp3j_print_colours_page()
83
 
84
  echo "\nvar imgDimsWP = {\n";
85
  foreach ( $imgSizesWP as $i => $size ) {
86
- $s = $mp3_fox->getImageSizeWP( $size );
87
  echo "\t" . $size . "_w: " . $s['width'] . ",\n";
88
  echo "\t" . $size . "_h: " . $s['height'];
89
  echo ( $i < 2 ? ",\n" : "\n" );
@@ -92,7 +92,7 @@ function mp3j_print_colours_page()
92
  echo '</script>';
93
 
94
  //write css settings
95
- echo $mp3_fox->writeColoursCSS();
96
  ?>
97
 
98
  <div class="wrap">
@@ -149,7 +149,7 @@ function mp3j_print_colours_page()
149
  $tweakerClass = ' Fimg';
150
  }
151
  else { //use specific WP media sizes, ad auto set the player height.
152
- $dims = $mp3_fox->getImageSizeWP( $O['imageSize'] );
153
  $imgCSS .= ' width:' .$dims['width']. 'px; height:' .$dims['height']. 'px;';
154
  $heightProp = ' height:' .$dims['height']. 'px;';
155
  }
@@ -411,8 +411,8 @@ function mp3j_print_colours_page()
411
  </td>
412
  <td><span class="description">Indicator</span></td>
413
  <td><select name="indicator" style="width:90px; font-size:11px;">
414
- <option value="tint" <?php if ( 'tint' == $C['indicator'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>Greyscale</option>
415
- <option value="colour" <?php if ( 'colour' == $C['indicator'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>Colour</option>
416
  </select></td>
417
  </tr>
418
  <tr>
@@ -426,10 +426,10 @@ function mp3j_print_colours_page()
426
  </td>
427
  <td><span class="description">Gradient</span></td>
428
  <td><select name="posbar_tint" id="posbar_tint" style="width:90px; font-size:11px;">
429
- <option value="none" <?php if ( 'none' == $C['posbar_tint'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>None</option>
430
- <option value="soften" <?php if ( 'soften' == $C['posbar_tint'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>Light grad</option>
431
- <option value="softenT" <?php if ( 'softenT' == $C['posbar_tint'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>Pipe</option>
432
- <option value="darken" <?php if ( 'darken' == $C['posbar_tint'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>Dark grad</option>
433
  </select></td>
434
  </tr>
435
  <tr>
@@ -443,11 +443,11 @@ function mp3j_print_colours_page()
443
  </td>
444
  <td><span class="description">Gradient</span></td>
445
  <td><select id="playlist_tint" name="playlist_tint" style="width:90px; font-size:11px;">
446
- <option value="none" <?php if ( 'none' == $C['playlist_tint'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>None</option>
447
- <option value="lighten1" <?php if ( 'lighten1' == $C['playlist_tint'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>Light Short</option>
448
- <option value="lighten2" <?php if ( 'lighten2' == $C['playlist_tint'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>Light Long</option>
449
- <option value="darken1" <?php if ( 'darken1' == $C['playlist_tint'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>Dark Short</option>
450
- <option value="darken2" <?php if ( 'darken2' == $C['playlist_tint'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>Dark Long</option>
451
  </select></td>
452
  </tr>
453
  <tr>
@@ -455,10 +455,10 @@ function mp3j_print_colours_page()
455
  <td></td>
456
  <td><span class="description">Dividers</span></td>
457
  <td><select id="list_divider" name="list_divider" style="width:100%; font-size:11px;">
458
- <option value="none" <?php if ( 'none' == $C['list_divider'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>None</option>
459
- <option value="light" <?php if ( 'light' == $C['list_divider'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>Light</option>
460
- <option value="med" <?php if ( 'med' == $C['list_divider'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>Medium</option>
461
- <option value="dark" <?php if ( 'dark' == $C['list_divider'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>Dark</option>
462
  </select></td>
463
  </tr>
464
  </table>
@@ -708,8 +708,8 @@ function mp3j_print_colours_page()
708
 
709
  <!-- SAVE SETTINGS -->
710
  <div class="savewrap">
711
- <input type="submit" name="save_MP3jP" class="button-primary" style="font-weight:700;" value="&nbsp;Save All Changes &nbsp;" />
712
- <input type="hidden" name="version_MP3jP" value="<?php echo $mp3_fox->version_of_plugin; ?>" />
713
  <input type="hidden" name="adminSizer_w" id="adminSizer_w" value="<?php echo $C['adminSizer_w']; ?>" />
714
  <input type="hidden" name="adminSizer_h" id="adminSizer_h" value="<?php echo $C['adminSizer_h']; ?>" />
715
  </div>
2
 
3
  function mp3j_print_colours_page()
4
  {
5
+ global $MP3JP;
6
+ $O = $MP3JP->getAdminOptions();
7
  $openTab = '0';
8
 
9
+ if ( isset( $_POST['save_MP3JP'] ) )
10
  {
11
  //colours array
12
  foreach ( $O['colour_settings'] as $key => $val ) {
27
  $O['colour_settings']['imgOverflow'] = ( isset($_POST['imgOverflow']) ) ? "visible" : "hidden";
28
 
29
 
30
+ $O['playerHeight'] = $MP3JP->prep_value( $_POST['playerHeight'] );
31
+ $O['custom_stylesheet'] = $MP3JP->prep_path( $_POST['custom_stylesheet'] );
32
+ $O['player_theme'] = $MP3JP->prep_value( $_POST['player_theme'] );
33
+ $O['imageSize'] = $MP3JP->prep_value( $_POST['imageSize'] );
34
 
35
 
36
  //update
37
+ update_option($MP3JP->adminOptionsName, $O);
38
+ $MP3JP->theSettings = $O;
39
  ?>
40
  <!-- save message -->
41
+ <div class="updated"><p><strong><?php _e("Settings Updated.", $MP3JP->textdomain );?></strong></p></div>
42
  <?php
43
  }
44
 
46
 
47
 
48
  //Write js vars..
49
+ //$css_urls = $MP3JP->getSkinData();
50
+ $css_urls = $MP3JP->SKINS;
51
 
52
  //..current stylesheet url to js
53
  $player_theme = $O['player_theme'];
83
 
84
  echo "\nvar imgDimsWP = {\n";
85
  foreach ( $imgSizesWP as $i => $size ) {
86
+ $s = $MP3JP->getImageSizeWP( $size );
87
  echo "\t" . $size . "_w: " . $s['width'] . ",\n";
88
  echo "\t" . $size . "_h: " . $s['height'];
89
  echo ( $i < 2 ? ",\n" : "\n" );
92
  echo '</script>';
93
 
94
  //write css settings
95
+ echo $MP3JP->writeColoursCSS();
96
  ?>
97
 
98
  <div class="wrap">
149
  $tweakerClass = ' Fimg';
150
  }
151
  else { //use specific WP media sizes, ad auto set the player height.
152
+ $dims = $MP3JP->getImageSizeWP( $O['imageSize'] );
153
  $imgCSS .= ' width:' .$dims['width']. 'px; height:' .$dims['height']. 'px;';
154
  $heightProp = ' height:' .$dims['height']. 'px;';
155
  }
411
  </td>
412
  <td><span class="description">Indicator</span></td>
413
  <td><select name="indicator" style="width:90px; font-size:11px;">
414
+ <option value="tint" <?php if ( 'tint' == $C['indicator'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Greyscale</option>
415
+ <option value="colour" <?php if ( 'colour' == $C['indicator'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Colour</option>
416
  </select></td>
417
  </tr>
418
  <tr>
426
  </td>
427
  <td><span class="description">Gradient</span></td>
428
  <td><select name="posbar_tint" id="posbar_tint" style="width:90px; font-size:11px;">
429
+ <option value="none" <?php if ( 'none' == $C['posbar_tint'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>None</option>
430
+ <option value="soften" <?php if ( 'soften' == $C['posbar_tint'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Light grad</option>
431
+ <option value="softenT" <?php if ( 'softenT' == $C['posbar_tint'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Pipe</option>
432
+ <option value="darken" <?php if ( 'darken' == $C['posbar_tint'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Dark grad</option>
433
  </select></td>
434
  </tr>
435
  <tr>
443
  </td>
444
  <td><span class="description">Gradient</span></td>
445
  <td><select id="playlist_tint" name="playlist_tint" style="width:90px; font-size:11px;">
446
+ <option value="none" <?php if ( 'none' == $C['playlist_tint'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>None</option>
447
+ <option value="lighten1" <?php if ( 'lighten1' == $C['playlist_tint'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Light Short</option>
448
+ <option value="lighten2" <?php if ( 'lighten2' == $C['playlist_tint'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Light Long</option>
449
+ <option value="darken1" <?php if ( 'darken1' == $C['playlist_tint'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Dark Short</option>
450
+ <option value="darken2" <?php if ( 'darken2' == $C['playlist_tint'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Dark Long</option>
451
  </select></td>
452
  </tr>
453
  <tr>
455
  <td></td>
456
  <td><span class="description">Dividers</span></td>
457
  <td><select id="list_divider" name="list_divider" style="width:100%; font-size:11px;">
458
+ <option value="none" <?php if ( 'none' == $C['list_divider'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>None</option>
459
+ <option value="light" <?php if ( 'light' == $C['list_divider'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Light</option>
460
+ <option value="med" <?php if ( 'med' == $C['list_divider'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Medium</option>
461
+ <option value="dark" <?php if ( 'dark' == $C['list_divider'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Dark</option>
462
  </select></td>
463
  </tr>
464
  </table>
708
 
709
  <!-- SAVE SETTINGS -->
710
  <div class="savewrap">
711
+ <input type="submit" name="save_MP3JP" class="button-primary" style="font-weight:700;" value="&nbsp;Save All Changes &nbsp;" />
712
+ <input type="hidden" name="version_MP3JP" value="<?php echo $MP3JP->version_of_plugin; ?>" />
713
  <input type="hidden" name="adminSizer_w" id="adminSizer_w" value="<?php echo $C['adminSizer_w']; ?>" />
714
  <input type="hidden" name="adminSizer_h" id="adminSizer_h" value="<?php echo $C['adminSizer_h']; ?>" />
715
  </div>
admin-settings.php CHANGED
@@ -3,8 +3,8 @@
3
  function mp3j_print_admin_page()
4
  {
5
 
6
- global $mp3_fox;
7
- $O = $mp3_fox->getAdminOptions();
8
  $colours_array = array();
9
 
10
 
@@ -33,47 +33,47 @@ function mp3j_print_admin_page()
33
  if ( $O['max_list_height'] < 0 ) { $O['max_list_height'] = ""; }
34
  }
35
  if (isset($_POST['mp3foxfolder'])) {
36
- $O['mp3_dir'] = $mp3_fox->prep_path( $_POST['mp3foxfolder'] );
37
  }
38
  if (isset($_POST['mp3foxPopoutBGimage'])) {
39
- $O['popout_background_image'] = $mp3_fox->prep_path( $_POST['mp3foxPopoutBGimage'] );
40
  }
41
 
42
- $O['dloader_remote_path'] = ( isset($_POST['dloader_remote_path']) ) ? $mp3_fox->prep_value( $_POST['dloader_remote_path'] ) : "";
43
- $O['loggedout_dload_link'] = ( $_POST['loggedout_dload_link'] == "" ) ? "" : $mp3_fox->prep_value( $_POST['loggedout_dload_link'] ); //allow it to be empty
44
 
45
  if (isset($_POST['mp3foxFloat'])) {
46
- $O['player_float'] = $mp3_fox->prep_value( $_POST['mp3foxFloat'] );
47
  }
48
  if (isset($_POST['librarySortcol'])) {
49
- $O['library_sortcol'] = $mp3_fox->prep_value( $_POST['librarySortcol'] );
50
  }
51
  if (isset($_POST['libraryDirection'])) {
52
- $O['library_direction'] = $mp3_fox->prep_value( $_POST['libraryDirection'] );
53
  }
54
  if (isset($_POST['folderFeedSortcol'])) {
55
- $O['folderFeedSortcol'] = $mp3_fox->prep_value( $_POST['folderFeedSortcol'] );
56
  }
57
  if (isset($_POST['folderFeedDirection'])) {
58
- $O['folderFeedDirection'] = $mp3_fox->prep_value( $_POST['folderFeedDirection'] );
59
  }
60
  if (isset($_POST['file_separator'])) {
61
- $O['f_separator'] = $mp3_fox->prep_value( $_POST['file_separator'] );
62
  }
63
  if (isset($_POST['caption_separator'])) {
64
- $O['c_separator'] = $mp3_fox->prep_value( $_POST['caption_separator'] );
65
  }
66
  if (isset($_POST['mp3foxDownloadMp3'])) {
67
- $O['show_downloadmp3'] = $mp3_fox->prep_value( $_POST['mp3foxDownloadMp3'] );
68
  }
69
  if (isset($_POST['replacerShortcode_playlist'])) {
70
- $O['replacerShortcode_playlist'] = $mp3_fox->prep_value( $_POST['replacerShortcode_playlist'] );
71
  }
72
  if (isset($_POST['replacerShortcode_single'])) {
73
- $O['replacerShortcode_single'] = $mp3_fox->prep_value( $_POST['replacerShortcode_single'] );
74
  }
75
  if (isset($_POST['showErrors'])) {
76
- $O['showErrors'] = $mp3_fox->prep_value( $_POST['showErrors'] );
77
  }
78
 
79
  $O['echo_debug'] = ( isset($_POST['mp3foxEchoDebug']) ) ? "true" : "false";
@@ -100,13 +100,13 @@ function mp3j_print_admin_page()
100
  $O['autoCounterpart'] = ( isset($_POST['autoCounterpart']) ) ? "true" : "false";
101
  $O['allowRangeRequests'] = ( isset($_POST['allowRangeRequests']) ) ? "true" : "false";
102
 
103
- $O['paddings_top'] = ( $_POST['mp3foxPaddings_top'] == "" ) ? "0px" : $mp3_fox->prep_value( $_POST['mp3foxPaddings_top'] );
104
- $O['paddings_bottom'] = ( $_POST['mp3foxPaddings_bottom'] == "" ) ? "0px" : $mp3_fox->prep_value( $_POST['mp3foxPaddings_bottom'] );
105
- $O['paddings_inner'] = ( $_POST['mp3foxPaddings_inner'] == "" ) ? "0px" : $mp3_fox->prep_value( $_POST['mp3foxPaddings_inner'] );
106
- $O['font_size_mp3t'] = ( $_POST['font_size_mp3t'] == "" ) ? "14px" : $mp3_fox->prep_value( $_POST['font_size_mp3t'] );
107
- $O['font_size_mp3j'] = ( $_POST['font_size_mp3j'] == "" ) ? "14px" : $mp3_fox->prep_value( $_POST['font_size_mp3j'] );
108
- $O['dload_text'] = ( $_POST['dload_text'] == "" ) ? "" : $mp3_fox->strip_scripts( $_POST['dload_text'] );
109
- $O['loggedout_dload_text'] = ( $_POST['loggedout_dload_text'] == "" ) ? "" : $mp3_fox->strip_scripts( $_POST['loggedout_dload_text'] );
110
 
111
  $hasFormat = false;
112
  foreach ( $O['audioFormats'] as $k => $f ) {
@@ -123,31 +123,31 @@ function mp3j_print_admin_page()
123
  }
124
 
125
  if (isset($_POST['mp3foxPlayerWidth'])) {
126
- $O['player_width'] = $mp3_fox->prep_value( $_POST['mp3foxPlayerWidth'] );
127
  }
128
  if (isset($_POST['disableJSlibs'])) {
129
  $O['disable_jquery_libs'] = ( preg_match("/^yes$/i", $_POST['disableJSlibs']) ) ? "yes" : "";
130
  }
131
  if ( isset($_POST['mp3foxPopoutButtonText']) ) {
132
- $O['popout_button_title'] = $mp3_fox->strip_scripts( $_POST['mp3foxPopoutButtonText'] );
133
  }
134
  if ( isset($_POST['make_player_from_link_shcode']) ) {
135
- $O['make_player_from_link_shcode'] = $mp3_fox->strip_scripts( $_POST['make_player_from_link_shcode'] );
136
  }
137
  if ( isset($_POST['mp3foxPopoutBackground']) ) {
138
- $O['popout_background'] = $mp3_fox->prep_value( $_POST['mp3foxPopoutBackground'] );
139
  }
140
  if ( isset($_POST['mp3foxPluginVersion']) ) {
141
- $O['db_plugin_version'] = $mp3_fox->prep_value( $_POST['mp3foxPluginVersion'] );
142
  }
143
 
144
- update_option($mp3_fox->adminOptionsName, $O);
145
- $mp3_fox->theSettings = $O;
146
- $mp3_fox->setAllowedFeedTypesArrays();
147
  ?>
148
 
149
  <!-- Settings saved message -->
150
- <div class="updated"><p><strong><?php _e("Settings Updated.", $mp3_fox->textdomain );?></strong></p></div>
151
  <?php
152
  }
153
 
@@ -159,7 +159,7 @@ function mp3j_print_admin_page()
159
 
160
  <h2>&nbsp;</h2>
161
  <h1>MP3-jPlayer
162
- <span class="description" style="font-size:10px;">Version <?php echo $mp3_fox->version_of_plugin; ?></span>
163
  &nbsp;<span class="description" style="font-size:13px; font-weight:700;"><a class="button-secondary" style="background-color:#f0fff0;" target="_blank" href="http://mp3-jplayer.com/help-docs/">Help & Docs &raquo;</a></span>
164
  </h1>
165
  <p style="margin-bottom:10px;">&nbsp;</p>
@@ -188,9 +188,9 @@ function mp3j_print_admin_page()
188
  <p class="tabD" style="margin:0 0 10px 0; max-width:550px;">These are the player default settings, most of them can be set per-player using <strong><a target="_blank" href="http://mp3-jplayer.com/shortcode-reference/">shortcode parameters</a></strong>.</p>
189
 
190
  <p style="margin-bottom:10px;"><label>Initial volume: &nbsp; </label><input type="text" style="text-align:center;" size="2" name="mp3foxVol" value="<?php echo $O['initial_vol']; ?>" /> &nbsp; <span class="description">(0 - 100)</span></p>
191
- <p><input type="checkbox" name="mp3foxAutoplay" id="mp3foxAutoplay" value="true" <?php if ($O['auto_play'] == "true") { _e('checked="checked"', $mp3_fox->textdomain ); } ?> /><label for="mp3foxAutoplay"> &nbsp; Autoplay</label> &nbsp; <span class="description">(Disallowed by most touchscreen devices, this will only activate on desktops and laptops)</span></p>
192
- <p><input type="checkbox" name="mp3foxPlaylistRepeat" id="mp3foxPlaylistRepeat" value="true" <?php if ($O['playlist_repeat'] == "true") { _e('checked="checked"', $mp3_fox->textdomain ); } ?> /><label for="mp3foxPlaylistRepeat"> &nbsp; Loop</label></p>
193
- <p><input type="checkbox" name="mp3foxAddTrackNumbers" id="mp3foxAddTrackNumbers" value="true" <?php if ($O['add_track_numbering'] == "true") { _e('checked="checked"', $mp3_fox->textdomain ); } ?> />
194
  <label for="mp3foxAddTrackNumbers"> &nbsp; Number the tracks</label></p>
195
 
196
  <br><br>
@@ -204,7 +204,7 @@ function mp3j_print_admin_page()
204
  </tr>
205
  <tr>
206
  <td><label for="volslider_onsingles"><strong>Volume Control</strong>: &nbsp;</label></td>
207
- <td><input type="checkbox" name="volslider_onsingles" id="volslider_onsingles" value="true" <?php if ($O['volslider_on_singles'] == "true") { _e('checked="checked"', $mp3_fox->textdomain ); }?> /></td>
208
  </tr>
209
  </table>
210
  </div>
@@ -218,7 +218,7 @@ function mp3j_print_admin_page()
218
  </tr>
219
  <tr>
220
  <td><label for="volslider_onmp3j"><strong>Volume Control</strong>: &nbsp;</label></td>
221
- <td><input type="checkbox" name="volslider_onmp3j" id="volslider_onmp3j" value="true" <?php if ($O['volslider_on_mp3j'] == "true") { _e('checked="checked"', $mp3_fox->textdomain ); }?> /></td>
222
  </tr>
223
  </table>
224
  </div>
@@ -234,11 +234,11 @@ function mp3j_print_admin_page()
234
  <tr>
235
  <td><strong>Alignment:</strong></td>
236
  <td><select name="mp3foxFloat" style="width:100px;">
237
- <option value="none" <?php if ( 'none' == $O['player_float'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>Left</option>
238
- <option value="rel-C" <?php if ( 'rel-C' == $O['player_float'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>Centre</option>
239
- <option value="rel-R" <?php if ( 'rel-R' == $O['player_float'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>Right</option>
240
- <option value="left" <?php if ( 'left' == $O['player_float'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>Float Left</option>
241
- <option value="right" <?php if ( 'right' == $O['player_float'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>Float Right</option>
242
  </select></td>
243
  <td></td>
244
  </tr>
@@ -260,10 +260,10 @@ function mp3j_print_admin_page()
260
  </table>
261
  <br>
262
 
263
- <p style="margin:0 0 6px 15px;"><input type="checkbox" name="mp3foxEnablePopout" id="mp3foxEnablePopout" value="true" <?php if ($O['enable_popout'] == "true") { _e('checked="checked"', $mp3_fox->textdomain ); }?> />
264
  <label for="mp3foxEnablePopout"> &nbsp; Show popout player button</label></p>
265
 
266
- <p style="margin:0 0 0px 15px;"><input type="checkbox" name="mp3foxShowPlaylist" id="mp3foxShowPlaylist" value="true" <?php if ($O['playlist_show'] == "true") { _e('checked="checked"', $mp3_fox->textdomain ); }?> />
267
  <label for="mp3foxShowPlaylist"> &nbsp; Start with playlists open</label></p>
268
 
269
 
@@ -281,7 +281,7 @@ function mp3j_print_admin_page()
281
  <?php
282
  ////
283
  //Library
284
- $library = $mp3_fox->grab_library_info();
285
  $libCount = ( $library ) ? $library['count'] : "0";
286
  $libText = '';
287
  $libButton = '';
@@ -322,7 +322,7 @@ function mp3j_print_admin_page()
322
  ////
323
  //Default Folder
324
  $n = 1;
325
- $folderInfo = $mp3_fox->grabFolderURLs( $O['mp3_dir'] ); //grab all
326
  $folderText = '';
327
  $folderButton = '';
328
  $folderHtml = '';
@@ -445,17 +445,17 @@ function mp3j_print_admin_page()
445
  <td>Order Library by:&nbsp;&nbsp;</td>
446
  <td>
447
  <select name="librarySortcol" style="width:160px;">
448
- <option value="file" <?php if ( 'file' == $O['library_sortcol'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>Filename</option>
449
- <option value="date" <?php if ( 'date' == $O['library_sortcol'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>Date Uploaded</option>
450
- <option value="caption" <?php if ( 'caption' == $O['library_sortcol'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>Caption, Title</option>
451
- <option value="title" <?php if ( 'title' == $O['library_sortcol'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>Title</option>
452
  </select>&nbsp;&nbsp;
453
  </td>
454
  <td>&nbsp; Direction: &nbsp;</td>
455
  <td>
456
  <select name="libraryDirection" style="width:100px;">
457
- <option value="ASC" <?php if ( 'ASC' == $O['library_direction'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>Asc</option>
458
- <option value="DESC" <?php if ( 'DESC' == $O['library_direction'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>Desc</option>
459
  </select>
460
  </td>
461
  </tr>
@@ -463,15 +463,15 @@ function mp3j_print_admin_page()
463
  <td>Order Folders by:&nbsp;&nbsp;</td>
464
  <td>
465
  <select name="folderFeedSortcol" style="width:160px;">
466
- <option value="file" <?php if ( 'file' == $O['folderFeedSortcol'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>Filename</option>
467
- <option value="date" <?php if ( 'date' == $O['folderFeedSortcol'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>Date Uploaded</option>
468
  </select>&nbsp;&nbsp;
469
  </td>
470
  <td>&nbsp; Direction: &nbsp;</td>
471
  <td>
472
  <select name="folderFeedDirection" style="width:100px;">
473
- <option value="ASC" <?php if ( 'ASC' == $O['folderFeedDirection'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>Asc</option>
474
- <option value="DESC" <?php if ( 'DESC' == $O['folderFeedDirection'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>Desc</option>
475
  </select>
476
  </td>
477
  </tr>
@@ -493,9 +493,9 @@ function mp3j_print_admin_page()
493
  <tr>
494
  <td><strong>Show Download Button</strong>:</td>
495
  <td><select name="mp3foxDownloadMp3" style="width:150px;">
496
- <option value="true" <?php if ( 'true' == $O['show_downloadmp3'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>Yes</option>
497
- <option value="false" <?php if ( 'false' == $O['show_downloadmp3'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>No</option>
498
- <option value="loggedin" <?php if ( 'loggedin' == $O['show_downloadmp3'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>To logged in users</option>
499
  </select></td>
500
  </tr>
501
  <tr>
@@ -525,12 +525,12 @@ function mp3j_print_admin_page()
525
  </table>
526
 
527
  <br><br>
528
- <input type="checkbox" name="force_browser_dload" id="force_browser_dload" value="true" <?php if ($O['force_browser_dload'] == "true") { _e('checked="checked"', $mp3_fox->textdomain ); }?> />
529
  &nbsp;<label for="force_browser_dload">Smooth Downloads</label>
530
  <p class="description" style="margin:10px 0 10px 30px; max-width:500px;">This makes downloading seamless for most users, or it will display a dialog box with a link when a seamless download is not possible.</p>
531
 
532
  <p class="description" style="margin:10px 0 10px 30px; max-width:500px;">If you play from other domains and want seamless downloads, then use
533
- the field below to specify a path to the downloader file. <strong><a href="<?php echo $mp3_fox->PluginFolder; ?>/remote/help.txt">See help on setting this up</a></strong></p>
534
 
535
  <table style="margin-left:25px;">
536
  <tr>
@@ -583,27 +583,27 @@ function mp3j_print_admin_page()
583
 
584
  <table>
585
  <tr>
586
- <td><input type="checkbox" name="replace_WP_audio" id="replace_WP_audio" value="true" <?php if ($O['replace_WP_audio'] == "true") { _e('checked="checked"', $mp3_fox->textdomain ); } ?> />
587
  &nbsp; <label for="replace_WP_audio">Audio Players</label></td>
588
  <td><span class="description">Use the 'Add Media' Button on post/page edit screens and choose 'Embed Player' from the right select (WP 3.6+).</span></td>
589
  </tr>
590
  <tr>
591
- <td><input type="checkbox" name="replace_WP_playlist" id="replace_WP_playlist" value="true" <?php if ($O['replace_WP_playlist'] == "true") { _e('checked="checked"', $mp3_fox->textdomain ); } ?> />
592
  &nbsp; <label for="replace_WP_playlist">Playlist Players</label></td>
593
  <td><span class="description">Use the 'Add Media' Button on post/page edit screens and choose 'Audio Playlist' from the left menu (WP 3.9+).</span></td>
594
  </tr>
595
  <tr>
596
- <td><input type="checkbox" name="make_player_from_link" id="make_player_from_link" value="true" <?php if ($O['make_player_from_link'] == "true") { _e('checked="checked"', $mp3_fox->textdomain ); } ?> />
597
  &nbsp; <label for="make_player_from_link">Links to Audio Files</label> &nbsp;</td>
598
  <td><span class="description">Links within post/page content will be turned into players using the shortcode specified under the 'Advanced' tab.</span></td>
599
  </tr>
600
  <tr>
601
- <td><input type="checkbox" name="replace_WP_attached" id="replace_WP_attached" value="true" <?php if ($O['replace_WP_attached'] == "true") { _e('checked="checked"', $mp3_fox->textdomain ); } ?> />
602
  &nbsp; <label for="replace_WP_attached">Attached Audio</label></td>
603
  <td><span class="description">Use the shortcode <code>[audio]</code> in posts and pages to playlist any attached audio.</span></td>
604
  </tr>
605
  <tr>
606
- <td><input type="checkbox" name="replace_WP_embedded" id="replace_WP_embedded" value="true" <?php if ($O['replace_WP_embedded'] == "true") { _e('checked="checked"', $mp3_fox->textdomain ); } ?> />
607
  &nbsp; <label for="replace_WP_embedded">URLs</label></td>
608
  <td><span class="description">Paste urls directly into posts and pages (WP 3.6+).</span></td>
609
  </tr>
@@ -618,9 +618,9 @@ function mp3j_print_admin_page()
618
 
619
  <br><br><hr>
620
  <p class="tabD" style="margin:0 0 10px 0; max-width:550px;">On pages like index, archive and search pages, set whether to show players within posts. These settings won't affect player widgets.</p>
621
- <p><input type="checkbox" name="mp3foxOnBlog" id="mp3foxOnBlog" value="true" <?php if ($O['player_onblog'] == "true") { _e('checked="checked"', $mp3_fox->textdomain ); }?> />
622
  <label for="mp3foxOnBlog"> &nbsp; Show players when the full content is used.</p>
623
- <p><input type="checkbox" name="runShcodeInExcerpt" id="runShcodeInExcerpt" value="true" <?php if ($O['run_shcode_in_excerpt'] == "true") { _e('checked="checked"', $mp3_fox->textdomain ); }?> />
624
  <label for="runShcodeInExcerpt"> &nbsp; Show players when excerpts are used.</label>
625
  &nbsp;<span class="description">NOTE: this works for manually written post excerpts only, write your shortcodes into the excerpt field on post edit screens.</span></p>
626
 
@@ -634,9 +634,9 @@ function mp3j_print_admin_page()
634
  <p class="description" style="margin:0 0 5px 30px; max-width:550px;">Lets users seek to end of tracks without waiting for media to load. Most servers
635
  should allow this by default, if you are having issues then check that your server has the <code>accept-ranges: bytes</code> header set, or
636
  you can just switch this option off.</p>
637
- <p><input type="checkbox" id="mp3foxHideExtension" name="mp3foxHideExtension" value="true" <?php if ($O['hide_mp3extension'] == "true") { _e('checked="checked"', $mp3_fox->textdomain ); }?> /> &nbsp; <label for="mp3foxHideExtension">Hide file extensions if a filename is displayed</label><br /><span class="description" style="margin-left:30px;">Filenames are displayed when there's no available titles.</span></p>
638
- <p><input type="checkbox" id="mp3foxEncodeFiles" name="mp3foxEncodeFiles" value="true" <?php if ($O['encode_files'] == "true") { _e('checked="checked"', $mp3_fox->textdomain ); }?> /> &nbsp; <label for="mp3foxEncodeFiles">Encode URLs</label><br /><span class="description" style="margin-left:28px;">Provides some obfuscation of your urls in the page source.</span></p>
639
- <p><input type="checkbox" id="mp3foxAllowRemote" name="mp3foxAllowRemote" value="true" <?php if ($O['allow_remoteMp3'] == "true") { _e('checked="checked"', $mp3_fox->textdomain ); }?> /> &nbsp; <label for="mp3foxAllowRemote">Allow playing of off-site files</label><br /><span class="description" style="margin-left:28px;">Un-checking this option filters out any files coming from other domains, but doesn't affect ability to play from a remote default path if one has been set above.</span></p>
640
 
641
 
642
 
@@ -684,11 +684,7 @@ function mp3j_print_admin_page()
684
 
685
  <br><br><hr>
686
  <p class="tabD" style="margin:0 0 10px 0;">Javascripts</p>
687
-
688
- <!--<p<?php //echo $greyout_text; ?>><input type="checkbox" id="touch_punch_js" name="touch_punch_js" value="true" <?php //if ($O['touch_punch_js'] == "true") { _e('checked="checked"', $mp3_fox->textdomain ); }?> /> &nbsp;<label for="touch_punch_js">Include additional js for touch screen support</label><br />&nbsp; &nbsp; &nbsp; &nbsp;<span class="description"<?php //echo $greyout_text; ?>>(adds jQuery touch-punch.js script, it's best to leave this ticked)</span></p>-->
689
- <!--<p><input type="checkbox" id="mp3foxUseFixedCSS" name="mp3foxUseFixedCSS" value="true" <?php //if ($O['use_fixed_css'] == "true") { _e('checked="checked"', $mp3_fox->textdomain ); }?> /> &nbsp;<label for="mp3foxUseFixedCSS">Bypass colour settings</label><br />&nbsp; &nbsp; &nbsp; &nbsp;<span class="description">(colours can still be set in css)</span></p>-->
690
- <!--<p><input type="checkbox" id="disableTemplateTag" name="disableTemplateTag" value="true" <?php //if ($O['disable_template_tag'] == "true") { _e('checked="checked"', $mp3_fox->textdomain ); }?> /> &nbsp;<label for="disableTemplateTag">Bypass player template-tags in theme files</label><br />&nbsp; &nbsp; &nbsp; &nbsp;<span class="description">(ignores mp3j_addscripts() and mp3j_put() template functions)</span></p>-->
691
-
692
  <?php $bgc = ( $O['disable_jquery_libs'] == "yes" ) ? "#fdd" : "#f9f9f9"; ?>
693
  <div style="margin: 20px 0px 10px 0px; padding:6px; background:<?php echo $bgc; ?>; border:1px solid #ccc;">
694
  <p style="margin:0 0 5px 18px; font-weight:700;">Disable jQuery and jQuery-UI javascript libraries? &nbsp; <input type="text" style="width:60px;" name="disableJSlibs" value="<?php echo $O['disable_jquery_libs']; ?>" /></p>
@@ -707,17 +703,17 @@ function mp3j_print_admin_page()
707
 
708
  <p style="margin:10px 0 0 20px;"><strong>Files:</strong> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
709
  <select name="file_separator" style="width:120px; font-size:11px; line-height:16px;">
710
- <option value="," <?php if ( ',' == $O['f_separator'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>, (comma)</option>
711
- <option value=";" <?php if ( ';' == $O['f_separator'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>; (semicolon)</option>
712
- <option value="###" <?php if ( '###' == $O['f_separator'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>### (3 hashes)</option>
713
  </select>
714
  &nbsp;&nbsp;<span class="description">eg.</span> <code>tracks="fileA.mp3 <?php echo $O['f_separator']; ?> Title@fileB.mp3 <?php echo $O['f_separator']; ?> fileC.mp3"</code></p>
715
 
716
  <p style="margin-left:20px;"><strong>Captions:</strong> &nbsp;&nbsp;
717
  <select name="caption_separator" style="width:120px; font-size:11px; line-height:16px;">
718
- <option value="," <?php if ( ',' == $O['c_separator'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>, (comma)</option>
719
- <option value=";" <?php if ( ';' == $O['c_separator'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>; (semicolon)</option>
720
- <option value="###" <?php if ( '###' == $O['c_separator'] ) { _e('selected="selected"', $mp3_fox->textdomain ); } ?>>### (3 hashes)</option>
721
  </select>
722
  &nbsp;&nbsp;<span class="description">eg.</span> <code>captions="Caption A <?php echo $O['c_separator']; ?> Caption B <?php echo $O['c_separator']; ?> Caption C"</code></p>
723
  </div>
@@ -735,7 +731,7 @@ function mp3j_print_admin_page()
735
  </select></p>
736
 
737
 
738
- <p><input type="checkbox" id="mp3foxEchoDebug" name="mp3foxEchoDebug" value="true" <?php if ($O['echo_debug'] == "true") { _e('checked="checked"', $mp3_fox->textdomain ); }?> /> &nbsp;<label for="mp3foxEchoDebug">Turn on debug</label><br />&nbsp; &nbsp; &nbsp; &nbsp;<span class="description">(info appears in the source view near the bottom)</span></p>
739
 
740
 
741
 
@@ -746,17 +742,17 @@ function mp3j_print_admin_page()
746
  <table>
747
  <tr>
748
  <td>
749
- <input type="submit" name="update_mp3foxSettings" class="button-primary" style="font-weight:700;" value="<?php _e('Save All Changes', $mp3_fox->textdomain ) ?>" />&nbsp;&nbsp;&nbsp;
750
  </td>
751
  <td>
752
  <p style="margin-top:5px;"><label for="mp3foxRemember">Remember settings if plugin is deactivated &nbsp;</label>
753
- <input type="checkbox" id="mp3foxRemember" name="mp3foxRemember" value="true" <?php if ($O['remember_settings'] == "true") { _e('checked="checked"', $mp3_fox->textdomain ); }?> /></p>
754
  </td>
755
  <tr>
756
  </table>
757
 
758
  <!--<input type="hidden" id="fox_styling" name="MtogBox1" value="<?php //echo $O['admin_toggle_1']; // Colour settings toggle state ?>" />-->
759
- <input type="hidden" name="mp3foxPluginVersion" value="<?php echo $mp3_fox->version_of_plugin; ?>" />
760
 
761
  </form>
762
  <br>
@@ -776,28 +772,5 @@ function mp3j_print_admin_page()
776
 
777
  <?php
778
 
779
- /*DBUG
780
- echo '<pre>';
781
- print_r($mp3_fox->allowedFeedExtensions);
782
- print_r($mp3_fox->allowedFeedMimes);
783
- echo '</pre>';
784
-
785
- echo '<pre>';
786
- //echo $mp3_fox->formatsFeedRegex . '<br />';
787
- //echo $mp3_fox->formatsFeedSQL;
788
- print_r($O);
789
- echo '</pre>';
790
-
791
- //$folderuris = $mp3_fox->grabFolderURLs( $O['mp3_dir'], $mp3_fox->formatsFeedRegex );
792
- //echo '<pre>folders: ';
793
- //print_r($folderuris);
794
- //echo '</pre>';
795
- //*/
796
- //echo '<pre>';
797
- //print_r( $mp3_fox->getSkinData() );
798
- //echo '</pre>';
799
- //echo $mp3_fox->dbug['str'];
800
-
801
-
802
  }
803
  ?>
3
  function mp3j_print_admin_page()
4
  {
5
 
6
+ global $MP3JP;
7
+ $O = $MP3JP->getAdminOptions();
8
  $colours_array = array();
9
 
10
 
33
  if ( $O['max_list_height'] < 0 ) { $O['max_list_height'] = ""; }
34
  }
35
  if (isset($_POST['mp3foxfolder'])) {
36
+ $O['mp3_dir'] = $MP3JP->prep_path( $_POST['mp3foxfolder'] );
37
  }
38
  if (isset($_POST['mp3foxPopoutBGimage'])) {
39
+ $O['popout_background_image'] = $MP3JP->prep_path( $_POST['mp3foxPopoutBGimage'] );
40
  }
41
 
42
+ $O['dloader_remote_path'] = ( isset($_POST['dloader_remote_path']) ) ? $MP3JP->prep_value( $_POST['dloader_remote_path'] ) : "";
43
+ $O['loggedout_dload_link'] = ( $_POST['loggedout_dload_link'] == "" ) ? "" : $MP3JP->prep_value( $_POST['loggedout_dload_link'] ); //allow it to be empty
44
 
45
  if (isset($_POST['mp3foxFloat'])) {
46
+ $O['player_float'] = $MP3JP->prep_value( $_POST['mp3foxFloat'] );
47
  }
48
  if (isset($_POST['librarySortcol'])) {
49
+ $O['library_sortcol'] = $MP3JP->prep_value( $_POST['librarySortcol'] );
50
  }
51
  if (isset($_POST['libraryDirection'])) {
52
+ $O['library_direction'] = $MP3JP->prep_value( $_POST['libraryDirection'] );
53
  }
54
  if (isset($_POST['folderFeedSortcol'])) {
55
+ $O['folderFeedSortcol'] = $MP3JP->prep_value( $_POST['folderFeedSortcol'] );
56
  }
57
  if (isset($_POST['folderFeedDirection'])) {
58
+ $O['folderFeedDirection'] = $MP3JP->prep_value( $_POST['folderFeedDirection'] );
59
  }
60
  if (isset($_POST['file_separator'])) {
61
+ $O['f_separator'] = $MP3JP->prep_value( $_POST['file_separator'] );
62
  }
63
  if (isset($_POST['caption_separator'])) {
64
+ $O['c_separator'] = $MP3JP->prep_value( $_POST['caption_separator'] );
65
  }
66
  if (isset($_POST['mp3foxDownloadMp3'])) {
67
+ $O['show_downloadmp3'] = $MP3JP->prep_value( $_POST['mp3foxDownloadMp3'] );
68
  }
69
  if (isset($_POST['replacerShortcode_playlist'])) {
70
+ $O['replacerShortcode_playlist'] = $MP3JP->prep_value( $_POST['replacerShortcode_playlist'] );
71
  }
72
  if (isset($_POST['replacerShortcode_single'])) {
73
+ $O['replacerShortcode_single'] = $MP3JP->prep_value( $_POST['replacerShortcode_single'] );
74
  }
75
  if (isset($_POST['showErrors'])) {
76
+ $O['showErrors'] = $MP3JP->prep_value( $_POST['showErrors'] );
77
  }
78
 
79
  $O['echo_debug'] = ( isset($_POST['mp3foxEchoDebug']) ) ? "true" : "false";
100
  $O['autoCounterpart'] = ( isset($_POST['autoCounterpart']) ) ? "true" : "false";
101
  $O['allowRangeRequests'] = ( isset($_POST['allowRangeRequests']) ) ? "true" : "false";
102
 
103
+ $O['paddings_top'] = ( $_POST['mp3foxPaddings_top'] == "" ) ? "0px" : $MP3JP->prep_value( $_POST['mp3foxPaddings_top'] );
104
+ $O['paddings_bottom'] = ( $_POST['mp3foxPaddings_bottom'] == "" ) ? "0px" : $MP3JP->prep_value( $_POST['mp3foxPaddings_bottom'] );
105
+ $O['paddings_inner'] = ( $_POST['mp3foxPaddings_inner'] == "" ) ? "0px" : $MP3JP->prep_value( $_POST['mp3foxPaddings_inner'] );
106
+ $O['font_size_mp3t'] = ( $_POST['font_size_mp3t'] == "" ) ? "14px" : $MP3JP->prep_value( $_POST['font_size_mp3t'] );
107
+ $O['font_size_mp3j'] = ( $_POST['font_size_mp3j'] == "" ) ? "14px" : $MP3JP->prep_value( $_POST['font_size_mp3j'] );
108
+ $O['dload_text'] = ( $_POST['dload_text'] == "" ) ? "" : $MP3JP->strip_scripts( $_POST['dload_text'] );
109
+ $O['loggedout_dload_text'] = ( $_POST['loggedout_dload_text'] == "" ) ? "" : $MP3JP->strip_scripts( $_POST['loggedout_dload_text'] );
110
 
111
  $hasFormat = false;
112
  foreach ( $O['audioFormats'] as $k => $f ) {
123
  }
124
 
125
  if (isset($_POST['mp3foxPlayerWidth'])) {
126
+ $O['player_width'] = $MP3JP->prep_value( $_POST['mp3foxPlayerWidth'] );
127
  }
128
  if (isset($_POST['disableJSlibs'])) {
129
  $O['disable_jquery_libs'] = ( preg_match("/^yes$/i", $_POST['disableJSlibs']) ) ? "yes" : "";
130
  }
131
  if ( isset($_POST['mp3foxPopoutButtonText']) ) {
132
+ $O['popout_button_title'] = $MP3JP->strip_scripts( $_POST['mp3foxPopoutButtonText'] );
133
  }
134
  if ( isset($_POST['make_player_from_link_shcode']) ) {
135
+ $O['make_player_from_link_shcode'] = $MP3JP->strip_scripts( $_POST['make_player_from_link_shcode'] );
136
  }
137
  if ( isset($_POST['mp3foxPopoutBackground']) ) {
138
+ $O['popout_background'] = $MP3JP->prep_value( $_POST['mp3foxPopoutBackground'] );
139
  }
140
  if ( isset($_POST['mp3foxPluginVersion']) ) {
141
+ $O['db_plugin_version'] = $MP3JP->prep_value( $_POST['mp3foxPluginVersion'] );
142
  }
143
 
144
+ update_option($MP3JP->adminOptionsName, $O);
145
+ $MP3JP->theSettings = $O;
146
+ $MP3JP->setAllowedFeedTypesArrays();
147
  ?>
148
 
149
  <!-- Settings saved message -->
150
+ <div class="updated"><p><strong><?php _e("Settings Updated.", $MP3JP->textdomain );?></strong></p></div>
151
  <?php
152
  }
153
 
159
 
160
  <h2>&nbsp;</h2>
161
  <h1>MP3-jPlayer
162
+ <span class="description" style="font-size:10px;">Version <?php echo $MP3JP->version_of_plugin; ?></span>
163
  &nbsp;<span class="description" style="font-size:13px; font-weight:700;"><a class="button-secondary" style="background-color:#f0fff0;" target="_blank" href="http://mp3-jplayer.com/help-docs/">Help & Docs &raquo;</a></span>
164
  </h1>
165
  <p style="margin-bottom:10px;">&nbsp;</p>
188
  <p class="tabD" style="margin:0 0 10px 0; max-width:550px;">These are the player default settings, most of them can be set per-player using <strong><a target="_blank" href="http://mp3-jplayer.com/shortcode-reference/">shortcode parameters</a></strong>.</p>
189
 
190
  <p style="margin-bottom:10px;"><label>Initial volume: &nbsp; </label><input type="text" style="text-align:center;" size="2" name="mp3foxVol" value="<?php echo $O['initial_vol']; ?>" /> &nbsp; <span class="description">(0 - 100)</span></p>
191
+ <p><input type="checkbox" name="mp3foxAutoplay" id="mp3foxAutoplay" value="true" <?php if ($O['auto_play'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); } ?> /><label for="mp3foxAutoplay"> &nbsp; Autoplay</label> &nbsp; <span class="description">(Disallowed by most touchscreen devices, this will only activate on desktops and laptops)</span></p>
192
+ <p><input type="checkbox" name="mp3foxPlaylistRepeat" id="mp3foxPlaylistRepeat" value="true" <?php if ($O['playlist_repeat'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); } ?> /><label for="mp3foxPlaylistRepeat"> &nbsp; Loop</label></p>
193
+ <p><input type="checkbox" name="mp3foxAddTrackNumbers" id="mp3foxAddTrackNumbers" value="true" <?php if ($O['add_track_numbering'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); } ?> />
194
  <label for="mp3foxAddTrackNumbers"> &nbsp; Number the tracks</label></p>
195
 
196
  <br><br>
204
  </tr>
205
  <tr>
206
  <td><label for="volslider_onsingles"><strong>Volume Control</strong>: &nbsp;</label></td>
207
+ <td><input type="checkbox" name="volslider_onsingles" id="volslider_onsingles" value="true" <?php if ($O['volslider_on_singles'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> /></td>
208
  </tr>
209
  </table>
210
  </div>
218
  </tr>
219
  <tr>
220
  <td><label for="volslider_onmp3j"><strong>Volume Control</strong>: &nbsp;</label></td>
221
+ <td><input type="checkbox" name="volslider_onmp3j" id="volslider_onmp3j" value="true" <?php if ($O['volslider_on_mp3j'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> /></td>
222
  </tr>
223
  </table>
224
  </div>
234
  <tr>
235
  <td><strong>Alignment:</strong></td>
236
  <td><select name="mp3foxFloat" style="width:100px;">
237
+ <option value="none" <?php if ( 'none' == $O['player_float'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Left</option>
238
+ <option value="rel-C" <?php if ( 'rel-C' == $O['player_float'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Centre</option>
239
+ <option value="rel-R" <?php if ( 'rel-R' == $O['player_float'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Right</option>
240
+ <option value="left" <?php if ( 'left' == $O['player_float'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Float Left</option>
241
+ <option value="right" <?php if ( 'right' == $O['player_float'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Float Right</option>
242
  </select></td>
243
  <td></td>
244
  </tr>
260
  </table>
261
  <br>
262
 
263
+ <p style="margin:0 0 6px 15px;"><input type="checkbox" name="mp3foxEnablePopout" id="mp3foxEnablePopout" value="true" <?php if ($O['enable_popout'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> />
264
  <label for="mp3foxEnablePopout"> &nbsp; Show popout player button</label></p>
265
 
266
+ <p style="margin:0 0 0px 15px;"><input type="checkbox" name="mp3foxShowPlaylist" id="mp3foxShowPlaylist" value="true" <?php if ($O['playlist_show'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> />
267
  <label for="mp3foxShowPlaylist"> &nbsp; Start with playlists open</label></p>
268
 
269
 
281
  <?php
282
  ////
283
  //Library
284
+ $library = $MP3JP->grab_library_info();
285
  $libCount = ( $library ) ? $library['count'] : "0";
286
  $libText = '';
287
  $libButton = '';
322
  ////
323
  //Default Folder
324
  $n = 1;
325
+ $folderInfo = $MP3JP->grabFolderURLs( $O['mp3_dir'] ); //grab all
326
  $folderText = '';
327
  $folderButton = '';
328
  $folderHtml = '';
445
  <td>Order Library by:&nbsp;&nbsp;</td>
446
  <td>
447
  <select name="librarySortcol" style="width:160px;">
448
+ <option value="file" <?php if ( 'file' == $O['library_sortcol'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Filename</option>
449
+ <option value="date" <?php if ( 'date' == $O['library_sortcol'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Date Uploaded</option>
450
+ <option value="caption" <?php if ( 'caption' == $O['library_sortcol'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Caption, Title</option>
451
+ <option value="title" <?php if ( 'title' == $O['library_sortcol'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Title</option>
452
  </select>&nbsp;&nbsp;
453
  </td>
454
  <td>&nbsp; Direction: &nbsp;</td>
455
  <td>
456
  <select name="libraryDirection" style="width:100px;">
457
+ <option value="ASC" <?php if ( 'ASC' == $O['library_direction'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Asc</option>
458
+ <option value="DESC" <?php if ( 'DESC' == $O['library_direction'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Desc</option>
459
  </select>
460
  </td>
461
  </tr>
463
  <td>Order Folders by:&nbsp;&nbsp;</td>
464
  <td>
465
  <select name="folderFeedSortcol" style="width:160px;">
466
+ <option value="file" <?php if ( 'file' == $O['folderFeedSortcol'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Filename</option>
467
+ <option value="date" <?php if ( 'date' == $O['folderFeedSortcol'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Date Uploaded</option>
468
  </select>&nbsp;&nbsp;
469
  </td>
470
  <td>&nbsp; Direction: &nbsp;</td>
471
  <td>
472
  <select name="folderFeedDirection" style="width:100px;">
473
+ <option value="ASC" <?php if ( 'ASC' == $O['folderFeedDirection'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Asc</option>
474
+ <option value="DESC" <?php if ( 'DESC' == $O['folderFeedDirection'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Desc</option>
475
  </select>
476
  </td>
477
  </tr>
493
  <tr>
494
  <td><strong>Show Download Button</strong>:</td>
495
  <td><select name="mp3foxDownloadMp3" style="width:150px;">
496
+ <option value="true" <?php if ( 'true' == $O['show_downloadmp3'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>Yes</option>
497
+ <option value="false" <?php if ( 'false' == $O['show_downloadmp3'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>No</option>
498
+ <option value="loggedin" <?php if ( 'loggedin' == $O['show_downloadmp3'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>To logged in users</option>
499
  </select></td>
500
  </tr>
501
  <tr>
525
  </table>
526
 
527
  <br><br>
528
+ <input type="checkbox" name="force_browser_dload" id="force_browser_dload" value="true" <?php if ($O['force_browser_dload'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> />
529
  &nbsp;<label for="force_browser_dload">Smooth Downloads</label>
530
  <p class="description" style="margin:10px 0 10px 30px; max-width:500px;">This makes downloading seamless for most users, or it will display a dialog box with a link when a seamless download is not possible.</p>
531
 
532
  <p class="description" style="margin:10px 0 10px 30px; max-width:500px;">If you play from other domains and want seamless downloads, then use
533
+ the field below to specify a path to the downloader file. <strong><a href="<?php echo $MP3JP->PluginFolder; ?>/remote/help.txt">See help on setting this up</a></strong></p>
534
 
535
  <table style="margin-left:25px;">
536
  <tr>
583
 
584
  <table>
585
  <tr>
586
+ <td><input type="checkbox" name="replace_WP_audio" id="replace_WP_audio" value="true" <?php if ($O['replace_WP_audio'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); } ?> />
587
  &nbsp; <label for="replace_WP_audio">Audio Players</label></td>
588
  <td><span class="description">Use the 'Add Media' Button on post/page edit screens and choose 'Embed Player' from the right select (WP 3.6+).</span></td>
589
  </tr>
590
  <tr>
591
+ <td><input type="checkbox" name="replace_WP_playlist" id="replace_WP_playlist" value="true" <?php if ($O['replace_WP_playlist'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); } ?> />
592
  &nbsp; <label for="replace_WP_playlist">Playlist Players</label></td>
593
  <td><span class="description">Use the 'Add Media' Button on post/page edit screens and choose 'Audio Playlist' from the left menu (WP 3.9+).</span></td>
594
  </tr>
595
  <tr>
596
+ <td><input type="checkbox" name="make_player_from_link" id="make_player_from_link" value="true" <?php if ($O['make_player_from_link'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); } ?> />
597
  &nbsp; <label for="make_player_from_link">Links to Audio Files</label> &nbsp;</td>
598
  <td><span class="description">Links within post/page content will be turned into players using the shortcode specified under the 'Advanced' tab.</span></td>
599
  </tr>
600
  <tr>
601
+ <td><input type="checkbox" name="replace_WP_attached" id="replace_WP_attached" value="true" <?php if ($O['replace_WP_attached'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); } ?> />
602
  &nbsp; <label for="replace_WP_attached">Attached Audio</label></td>
603
  <td><span class="description">Use the shortcode <code>[audio]</code> in posts and pages to playlist any attached audio.</span></td>
604
  </tr>
605
  <tr>
606
+ <td><input type="checkbox" name="replace_WP_embedded" id="replace_WP_embedded" value="true" <?php if ($O['replace_WP_embedded'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); } ?> />
607
  &nbsp; <label for="replace_WP_embedded">URLs</label></td>
608
  <td><span class="description">Paste urls directly into posts and pages (WP 3.6+).</span></td>
609
  </tr>
618
 
619
  <br><br><hr>
620
  <p class="tabD" style="margin:0 0 10px 0; max-width:550px;">On pages like index, archive and search pages, set whether to show players within posts. These settings won't affect player widgets.</p>
621
+ <p><input type="checkbox" name="mp3foxOnBlog" id="mp3foxOnBlog" value="true" <?php if ($O['player_onblog'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> />
622
  <label for="mp3foxOnBlog"> &nbsp; Show players when the full content is used.</p>
623
+ <p><input type="checkbox" name="runShcodeInExcerpt" id="runShcodeInExcerpt" value="true" <?php if ($O['run_shcode_in_excerpt'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> />
624
  <label for="runShcodeInExcerpt"> &nbsp; Show players when excerpts are used.</label>
625
  &nbsp;<span class="description">NOTE: this works for manually written post excerpts only, write your shortcodes into the excerpt field on post edit screens.</span></p>
626
 
634
  <p class="description" style="margin:0 0 5px 30px; max-width:550px;">Lets users seek to end of tracks without waiting for media to load. Most servers
635
  should allow this by default, if you are having issues then check that your server has the <code>accept-ranges: bytes</code> header set, or
636
  you can just switch this option off.</p>
637
+ <p><input type="checkbox" id="mp3foxHideExtension" name="mp3foxHideExtension" value="true" <?php if ($O['hide_mp3extension'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> /> &nbsp; <label for="mp3foxHideExtension">Hide file extensions if a filename is displayed</label><br /><span class="description" style="margin-left:30px;">Filenames are displayed when there's no available titles.</span></p>
638
+ <p><input type="checkbox" id="mp3foxEncodeFiles" name="mp3foxEncodeFiles" value="true" <?php if ($O['encode_files'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> /> &nbsp; <label for="mp3foxEncodeFiles">Encode URLs</label><br /><span class="description" style="margin-left:28px;">Provides some obfuscation of your urls in the page source.</span></p>
639
+ <p><input type="checkbox" id="mp3foxAllowRemote" name="mp3foxAllowRemote" value="true" <?php if ($O['allow_remoteMp3'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> /> &nbsp; <label for="mp3foxAllowRemote">Allow playing of off-site files</label><br /><span class="description" style="margin-left:28px;">Un-checking this option filters out any files coming from other domains, but doesn't affect ability to play from a remote default path if one has been set above.</span></p>
640
 
641
 
642
 
684
 
685
  <br><br><hr>
686
  <p class="tabD" style="margin:0 0 10px 0;">Javascripts</p>
687
+
 
 
 
 
688
  <?php $bgc = ( $O['disable_jquery_libs'] == "yes" ) ? "#fdd" : "#f9f9f9"; ?>
689
  <div style="margin: 20px 0px 10px 0px; padding:6px; background:<?php echo $bgc; ?>; border:1px solid #ccc;">
690
  <p style="margin:0 0 5px 18px; font-weight:700;">Disable jQuery and jQuery-UI javascript libraries? &nbsp; <input type="text" style="width:60px;" name="disableJSlibs" value="<?php echo $O['disable_jquery_libs']; ?>" /></p>
703
 
704
  <p style="margin:10px 0 0 20px;"><strong>Files:</strong> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
705
  <select name="file_separator" style="width:120px; font-size:11px; line-height:16px;">
706
+ <option value="," <?php if ( ',' == $O['f_separator'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>, (comma)</option>
707
+ <option value=";" <?php if ( ';' == $O['f_separator'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>; (semicolon)</option>
708
+ <option value="###" <?php if ( '###' == $O['f_separator'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>### (3 hashes)</option>
709
  </select>
710
  &nbsp;&nbsp;<span class="description">eg.</span> <code>tracks="fileA.mp3 <?php echo $O['f_separator']; ?> Title@fileB.mp3 <?php echo $O['f_separator']; ?> fileC.mp3"</code></p>
711
 
712
  <p style="margin-left:20px;"><strong>Captions:</strong> &nbsp;&nbsp;
713
  <select name="caption_separator" style="width:120px; font-size:11px; line-height:16px;">
714
+ <option value="," <?php if ( ',' == $O['c_separator'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>, (comma)</option>
715
+ <option value=";" <?php if ( ';' == $O['c_separator'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>; (semicolon)</option>
716
+ <option value="###" <?php if ( '###' == $O['c_separator'] ) { _e('selected="selected"', $MP3JP->textdomain ); } ?>>### (3 hashes)</option>
717
  </select>
718
  &nbsp;&nbsp;<span class="description">eg.</span> <code>captions="Caption A <?php echo $O['c_separator']; ?> Caption B <?php echo $O['c_separator']; ?> Caption C"</code></p>
719
  </div>
731
  </select></p>
732
 
733
 
734
+ <p><input type="checkbox" id="mp3foxEchoDebug" name="mp3foxEchoDebug" value="true" <?php if ($O['echo_debug'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> /> &nbsp;<label for="mp3foxEchoDebug">Turn on debug</label><br />&nbsp; &nbsp; &nbsp; &nbsp;<span class="description">(info appears in the source view near the bottom)</span></p>
735
 
736
 
737
 
742
  <table>
743
  <tr>
744
  <td>
745
+ <input type="submit" name="update_mp3foxSettings" class="button-primary" style="font-weight:700;" value="<?php _e('Save All Changes', $MP3JP->textdomain ) ?>" />&nbsp;&nbsp;&nbsp;
746
  </td>
747
  <td>
748
  <p style="margin-top:5px;"><label for="mp3foxRemember">Remember settings if plugin is deactivated &nbsp;</label>
749
+ <input type="checkbox" id="mp3foxRemember" name="mp3foxRemember" value="true" <?php if ($O['remember_settings'] == "true") { _e('checked="checked"', $MP3JP->textdomain ); }?> /></p>
750
  </td>
751
  <tr>
752
  </table>
753
 
754
  <!--<input type="hidden" id="fox_styling" name="MtogBox1" value="<?php //echo $O['admin_toggle_1']; // Colour settings toggle state ?>" />-->
755
+ <input type="hidden" name="mp3foxPluginVersion" value="<?php echo $MP3JP->version_of_plugin; ?>" />
756
 
757
  </form>
758
  <br>
772
 
773
  <?php
774
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
775
  }
776
  ?>
frontend.php CHANGED
@@ -65,7 +65,7 @@ if ( !class_exists("MP3j_Front") && class_exists("MP3j_Main") ) { class MP3j_Fro
65
 
66
  //On page types
67
  if ( is_home() || is_archive() || is_search() ) {
68
- if ( $allowed_widget || $allowed_widget_B || $this->theSettings['player_onblog'] == "true" ) {
69
  $scripts = true;
70
  }
71
  }
@@ -325,7 +325,8 @@ if ( !class_exists("MP3j_Front") && class_exists("MP3j_Main") ) { class MP3j_Fro
325
 
326
  $this->defineJSvars();
327
  $playerInfo = "{ list: MP3jPLAYLISTS." . $tn['playername'] . ", tr: " . ($tn['track']-1) . ", type: 'single', lstate: '', loop: " . $loop . ", play_txt: '" . $play . "', pause_txt: '" . $stop . "', pp_title: '', autoplay:" . $autoplay . ", download: false, vol: " . $vol . ", height: '' }";
328
- $playerJS = "<script>MP3jPLAYERS.push(" . $playerInfo . ");</script>";
 
329
 
330
  $this->dbug['str'] .= "\nOK (id " . $this->Player_ID . ")";
331
  $this->Player_ID++;
@@ -427,7 +428,8 @@ if ( !class_exists("MP3j_Front") && class_exists("MP3j_Main") ) { class MP3j_Fro
427
 
428
  $this->defineJSvars();
429
  $playerInfo = "{ list: MP3jPLAYLISTS." . $tn['playername'] . ", tr:" . ($tn['track']-1) . ", type:'single', lstate:'', loop:" . $loop . ", play_txt:'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', pause_txt:'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', pp_title:'', autoplay:" . $autoplay . ", download:false, vol:" . $vol . ", height:'' }";
430
- $playerJS = "<script>MP3jPLAYERS.push(" . $playerInfo . ");</script>";
 
431
 
432
  $this->dbug['str'] .= "\nOK (id " . $this->Player_ID . ")";
433
  $this->Player_ID++;
@@ -851,8 +853,8 @@ if ( !class_exists("MP3j_Front") && class_exists("MP3j_Main") ) { class MP3j_Fro
851
  $popoutcss = ( $this->setup['cssPopout'] === true ) ? "{ enabled:true, " .$player['js']. "}" : "{ enabled:false, " .$player['js']. "}";
852
  //$playerInfo = "{ list:MP3jPLAYLISTS." .$PlayerName. ", tr:" .$trnum. ", type:'MI', lstate:" .$ATTS['list']. ", loop:" .$ATTS['loop']. ", play_txt:'Play', pause_txt:'Pause', pp_title:'" .$pp_title. "', autoplay:" .$ATTS['autoplay']. ", download:" .$dload_info. ", vol:" .$ATTS['vol']. ", height:" .$pp_height. ", cssclass:'" .$ATTS['userClasses']. "', popout_css:{" .$player['js']. "} }";
853
  $playerInfo = "{ list:MP3jPLAYLISTS." .$PlayerName. ", tr:" .$trnum. ", type:'MI', lstate:" .$ATTS['list']. ", loop:" .$ATTS['loop']. ", play_txt:'Play', pause_txt:'Pause', pp_title:'" .$pp_title. "', autoplay:" .$ATTS['autoplay']. ", download:" .$dload_info. ", vol:" .$ATTS['vol']. ", height:" .$pp_height. ", cssclass:'" .$ATTS['userClasses']. "', popout_css:" .$popoutcss. " }";
854
- $playerJS = "<script>MP3jPLAYERS.push(" . $playerInfo . ");</script>\n\n";
855
-
856
 
857
 
858
  //Finish up
@@ -985,7 +987,8 @@ if ( !class_exists("MP3j_Front") && class_exists("MP3j_Main") ) { class MP3j_Fro
985
  $popoutcss = ( $this->setup['cssPopout'] === true ) ? "{ enabled:true, " .$output['js']. "}" : "{ enabled:false, " .$output['js']. "}";
986
  //$playerInfo = "{ list: MP3jPLAYLISTS." . $PlayerName . ", tr:0, type:'popout', lstate:" . $list . ", loop:" . $loop . ", play_txt:'Play', pause_txt:'Pause', pp_title:'" . $pp_title . "', autoplay:" . $autoplay . ", download:" . $dload_info . ", vol:" . $vol . ", height:" . $pp_height . ", cssclass: '" . $ATTS['userClasses'] . "', popout_css:{" .$output['js']. "} }";
987
  $playerInfo = "{ list: MP3jPLAYLISTS." . $PlayerName . ", tr:0, type:'popout', lstate:" . $list . ", loop:" . $loop . ", play_txt:'Play', pause_txt:'Pause', pp_title:'" . $pp_title . "', autoplay:" . $autoplay . ", download:" . $dload_info . ", vol:" . $vol . ", height:" . $pp_height . ", cssclass: '" . $ATTS['userClasses'] . "', popout_css:" .$popoutcss. " }";
988
- $playerJS = "<script>MP3jPLAYERS.push(" . $playerInfo . ");</script>\n\n";
 
989
 
990
 
991
 
65
 
66
  //On page types
67
  if ( is_home() || is_archive() || is_search() ) {
68
+ if ( $allowed_widget || $allowed_widget_B || $this->theSettings['player_onblog'] == "true" || $this->theSettings['run_shcode_in_excerpt'] == "true" ) {
69
  $scripts = true;
70
  }
71
  }
325
 
326
  $this->defineJSvars();
327
  $playerInfo = "{ list: MP3jPLAYLISTS." . $tn['playername'] . ", tr: " . ($tn['track']-1) . ", type: 'single', lstate: '', loop: " . $loop . ", play_txt: '" . $play . "', pause_txt: '" . $stop . "', pp_title: '', autoplay:" . $autoplay . ", download: false, vol: " . $vol . ", height: '' }";
328
+ //$playerJS = "<script>MP3jPLAYERS.push(" . $playerInfo . ");</script>";
329
+ $playerJS = "<script>MP3jPLAYERS[" .$id. "] = " . $playerInfo . ";</script>";
330
 
331
  $this->dbug['str'] .= "\nOK (id " . $this->Player_ID . ")";
332
  $this->Player_ID++;
428
 
429
  $this->defineJSvars();
430
  $playerInfo = "{ list: MP3jPLAYLISTS." . $tn['playername'] . ", tr:" . ($tn['track']-1) . ", type:'single', lstate:'', loop:" . $loop . ", play_txt:'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', pause_txt:'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', pp_title:'', autoplay:" . $autoplay . ", download:false, vol:" . $vol . ", height:'' }";
431
+ //$playerJS = "<script>MP3jPLAYERS.push(" . $playerInfo . ");</script>";
432
+ $playerJS = "<script>MP3jPLAYERS[" .$id. "] = " . $playerInfo . ";</script>";
433
 
434
  $this->dbug['str'] .= "\nOK (id " . $this->Player_ID . ")";
435
  $this->Player_ID++;
853
  $popoutcss = ( $this->setup['cssPopout'] === true ) ? "{ enabled:true, " .$player['js']. "}" : "{ enabled:false, " .$player['js']. "}";
854
  //$playerInfo = "{ list:MP3jPLAYLISTS." .$PlayerName. ", tr:" .$trnum. ", type:'MI', lstate:" .$ATTS['list']. ", loop:" .$ATTS['loop']. ", play_txt:'Play', pause_txt:'Pause', pp_title:'" .$pp_title. "', autoplay:" .$ATTS['autoplay']. ", download:" .$dload_info. ", vol:" .$ATTS['vol']. ", height:" .$pp_height. ", cssclass:'" .$ATTS['userClasses']. "', popout_css:{" .$player['js']. "} }";
855
  $playerInfo = "{ list:MP3jPLAYLISTS." .$PlayerName. ", tr:" .$trnum. ", type:'MI', lstate:" .$ATTS['list']. ", loop:" .$ATTS['loop']. ", play_txt:'Play', pause_txt:'Pause', pp_title:'" .$pp_title. "', autoplay:" .$ATTS['autoplay']. ", download:" .$dload_info. ", vol:" .$ATTS['vol']. ", height:" .$pp_height. ", cssclass:'" .$ATTS['userClasses']. "', popout_css:" .$popoutcss. " }";
856
+ //$playerJS = "<script>MP3jPLAYERS.push(" . $playerInfo . ");</script>\n\n";
857
+ $playerJS = "<script>MP3jPLAYERS[" .$pID. "] = " . $playerInfo . ";</script>\n\n";
858
 
859
 
860
  //Finish up
987
  $popoutcss = ( $this->setup['cssPopout'] === true ) ? "{ enabled:true, " .$output['js']. "}" : "{ enabled:false, " .$output['js']. "}";
988
  //$playerInfo = "{ list: MP3jPLAYLISTS." . $PlayerName . ", tr:0, type:'popout', lstate:" . $list . ", loop:" . $loop . ", play_txt:'Play', pause_txt:'Pause', pp_title:'" . $pp_title . "', autoplay:" . $autoplay . ", download:" . $dload_info . ", vol:" . $vol . ", height:" . $pp_height . ", cssclass: '" . $ATTS['userClasses'] . "', popout_css:{" .$output['js']. "} }";
989
  $playerInfo = "{ list: MP3jPLAYLISTS." . $PlayerName . ", tr:0, type:'popout', lstate:" . $list . ", loop:" . $loop . ", play_txt:'Play', pause_txt:'Pause', pp_title:'" . $pp_title . "', autoplay:" . $autoplay . ", download:" . $dload_info . ", vol:" . $vol . ", height:" . $pp_height . ", cssclass: '" . $ATTS['userClasses'] . "', popout_css:" .$popoutcss. " }";
990
+ //$playerJS = "<script>MP3jPLAYERS.push(" . $playerInfo . ");</script>\n\n";
991
+ $playerJS = "<script>MP3jPLAYERS[" .$pID. "] = " . $playerInfo . ";</script>\n\n";
992
 
993
 
994
 
js/{mp3-jplayer-2.2.js → mp3-jplayer-2.3.js} RENAMED
@@ -1,6 +1,7 @@
1
  /*
2
  MP3-jPlayer
3
- http://sjward.org/jplayer-for-wordpress
 
4
  */
5
 
6
  var MP3_JPLAYER = {
@@ -79,7 +80,6 @@ var MP3_JPLAYER = {
79
  initialise_jp: function ( supplied, track, vol ) {
80
  var that = this;
81
  //console.log('jp init: ' + supplied );
82
-
83
  jQuery(this.jpID).jPlayer({
84
  ready: function () {
85
  if ( track === true ) {
@@ -89,8 +89,7 @@ var MP3_JPLAYER = {
89
  } else {
90
  //just remove first autolay if there's any
91
  var j;
92
- var l = that.pl_info.length;
93
- for (j = 0; j < l; j += 1) {
94
  if ( that.pl_info[j].autoplay ) {
95
  that.pl_info[j].autoplay = false;
96
  break;
@@ -140,10 +139,6 @@ var MP3_JPLAYER = {
140
  var tt = event.jPlayer.status.duration;
141
  that.E_loading( that.tID, lp, tt, pt );
142
  });
143
- //jQuery(this.jpID).bind(jQuery.jPlayer.event.error, function(event) {
144
- // console.log( 'E:: ' + event.jPlayer.error.type );
145
- // that.check_show_jperrors( event );
146
- //});
147
 
148
  that.lastformats = supplied;
149
  },
@@ -177,26 +172,7 @@ var MP3_JPLAYER = {
177
  jQuery( '<style type="text/css">' + this.extStyles[ j ] + '</style>' ).appendTo( 'head' );
178
  }
179
  },
180
-
181
-
182
- /*
183
- addExtControls: function () {
184
-
185
- var jx;
186
- var lx = this.extCalls.init.length;
187
- var j;
188
- var l = this.pl_info.length;;
189
- var callback;
190
 
191
- for ( j = 0; j < l; j += 1 ) {
192
- for ( jx = 0; jx < lx; jx += 1 ) {
193
- callback = this.extCalls.init[ jx ];
194
- callback( j );
195
- }
196
- }
197
- },
198
- */
199
-
200
  destroy_jp: function () {
201
  jQuery(this.jpID).unbind();
202
  jQuery(this.jpID).jPlayer("destroy");
@@ -364,8 +340,7 @@ var MP3_JPLAYER = {
364
 
365
  write_controls: function () {
366
  var j;
367
- var l = this.pl_info.length;
368
- for (j = 0; j < l; j += 1) {
369
  this.setup_a_player(j);
370
  this.mutes[j] = false;
371
  }
@@ -373,7 +348,7 @@ var MP3_JPLAYER = {
373
 
374
  startup: function () {
375
  var j;
376
- for (j = 0; j < this.pl_info.length; j += 1) {
377
  if ( this.pl_info[j].autoplay && (this.pl_info[j].type === 'single' || this.pl_info[j].type === 'MI') ) {
378
  this.pl_info[j].autoplay = false;
379
  this.E_change_track(j, this.pl_info[j].tr);
@@ -583,7 +558,6 @@ var MP3_JPLAYER = {
583
  } else {
584
  exData = this.exData;
585
  }
586
- //if ( caller !== 'Echange' ) {
587
  if ( caller !== 'Echange' && this.jperrorIDs[j] === false ) {
588
  l = this.extCalls.change_pre.length;
589
  for ( x = 0; x < l; x += 1 ) {
1
  /*
2
  MP3-jPlayer
3
+ Version 2.3
4
+ http://mp3-jplayer.com
5
  */
6
 
7
  var MP3_JPLAYER = {
80
  initialise_jp: function ( supplied, track, vol ) {
81
  var that = this;
82
  //console.log('jp init: ' + supplied );
 
83
  jQuery(this.jpID).jPlayer({
84
  ready: function () {
85
  if ( track === true ) {
89
  } else {
90
  //just remove first autolay if there's any
91
  var j;
92
+ for ( j in that.pl_info ) {
 
93
  if ( that.pl_info[j].autoplay ) {
94
  that.pl_info[j].autoplay = false;
95
  break;
139
  var tt = event.jPlayer.status.duration;
140
  that.E_loading( that.tID, lp, tt, pt );
141
  });
 
 
 
 
142
 
143
  that.lastformats = supplied;
144
  },
172
  jQuery( '<style type="text/css">' + this.extStyles[ j ] + '</style>' ).appendTo( 'head' );
173
  }
174
  },
 
 
 
 
 
 
 
 
 
 
175
 
 
 
 
 
 
 
 
 
 
176
  destroy_jp: function () {
177
  jQuery(this.jpID).unbind();
178
  jQuery(this.jpID).jPlayer("destroy");
340
 
341
  write_controls: function () {
342
  var j;
343
+ for ( j in this.pl_info ) {
 
344
  this.setup_a_player(j);
345
  this.mutes[j] = false;
346
  }
348
 
349
  startup: function () {
350
  var j;
351
+ for ( j in this.pl_info ) {
352
  if ( this.pl_info[j].autoplay && (this.pl_info[j].type === 'single' || this.pl_info[j].type === 'MI') ) {
353
  this.pl_info[j].autoplay = false;
354
  this.E_change_track(j, this.pl_info[j].tr);
558
  } else {
559
  exData = this.exData;
560
  }
 
561
  if ( caller !== 'Echange' && this.jperrorIDs[j] === false ) {
562
  l = this.extCalls.change_pre.length;
563
  for ( x = 0; x < l; x += 1 ) {
main.php CHANGED
@@ -2,7 +2,7 @@
2
  if ( !class_exists("MP3j_Main") ) { class MP3j_Main {
3
 
4
  // ---------------------- Update Me
5
- var $version_of_plugin = "2.2";
6
  var $M_no = 0;
7
  var $F_no = 0;
8
  var $S_no = 0;
@@ -56,6 +56,10 @@ if ( !class_exists("MP3j_Main") ) { class MP3j_Main {
56
 
57
  var $EXTpages = array();
58
  var $SKINS = array();
 
 
 
 
59
 
60
  /**
61
  * Sets some vars and makes stored
@@ -1127,7 +1131,7 @@ if ( !class_exists("MP3j_Main") ) { class MP3j_Main {
1127
  /* Swaps out links for player shortcodes, hooked to the_content. */
1128
  function replace_links ( $stuff = '' )
1129
  {
1130
- if ( ( is_home() || is_archive() || is_search() ) && $this->theSettings['player_onblog'] == "false" ) {
1131
  return $stuff;
1132
  }
1133
  $needles = array( '\"', '{TEXT}', '{URL}' );
@@ -1164,7 +1168,7 @@ if ( !class_exists("MP3j_Main") ) { class MP3j_Main {
1164
 
1165
  //jplayer and plugin js
1166
  wp_enqueue_script( 'jplayer271', $this->PluginFolder . '/js/jquery.jplayer.min.2.7.1.js', false, '2.7.1' );
1167
- wp_enqueue_script( 'mp3-jplayer', $this->PluginFolder . '/js/mp3-jplayer-2.2.js', false, '2.2' );
1168
 
1169
  $skins = $this->SKINS;
1170
  if ( isset( $skins[ $theme ]['url'] ) ) {
2
  if ( !class_exists("MP3j_Main") ) { class MP3j_Main {
3
 
4
  // ---------------------- Update Me
5
+ var $version_of_plugin = "2.3";
6
  var $M_no = 0;
7
  var $F_no = 0;
8
  var $S_no = 0;
56
 
57
  var $EXTpages = array();
58
  var $SKINS = array();
59
+ var $menuHANDLES = array(
60
+ 'parent' => false,
61
+ 'design' => false
62
+ );
63
 
64
  /**
65
  * Sets some vars and makes stored
1131
  /* Swaps out links for player shortcodes, hooked to the_content. */
1132
  function replace_links ( $stuff = '' )
1133
  {
1134
+ if ( ! $this->canRun() ) {
1135
  return $stuff;
1136
  }
1137
  $needles = array( '\"', '{TEXT}', '{URL}' );
1168
 
1169
  //jplayer and plugin js
1170
  wp_enqueue_script( 'jplayer271', $this->PluginFolder . '/js/jquery.jplayer.min.2.7.1.js', false, '2.7.1' );
1171
+ wp_enqueue_script( 'mp3-jplayer', $this->PluginFolder . '/js/mp3-jplayer-2.3.js', false, '2.3' );
1172
 
1173
  $skins = $this->SKINS;
1174
  if ( isset( $skins[ $theme ]['url'] ) ) {
mp3jplayer.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: MP3-jPlayer
4
  Plugin URI: http://mp3-jplayer.com
5
  Description: Easy, Flexible Audio for WordPress.
6
- Version: 2.2
7
  Author: Simon Ward
8
  Author URI: http://www.sjward.org
9
  License: GPL2
@@ -34,15 +34,15 @@ include_once( $path . '/main.php');
34
  include_once( $path . '/frontend.php'); //extends main
35
 
36
  if ( class_exists("MP3j_Front") ) {
37
- $mp3_fox = new MP3j_Front();
38
  }
39
 
40
- if ( isset($mp3_fox) )
41
  {
42
  include_once( $path . '/widget-ui.php'); //ui widget (playlister)
43
  include_once( $path . '/widget-sh.php'); //shortcodes Widget
44
 
45
- $ops = $mp3_fox->theSettings;
46
  if ( is_admin() )
47
  {
48
  include_once( $path . '/admin-settings.php'); //settings page
@@ -63,21 +63,24 @@ if ( isset($mp3_fox) )
63
  */
64
 
65
  //add menu pages
66
- global $mp3_fox;
67
 
68
  //Settings page
69
  $pluginpage = add_menu_page( 'Settings | MP3 jPlayer', 'MP3 jPlayer', 'manage_options', 'mp3-jplayer', 'mp3j_print_admin_page' ); //root
70
  add_submenu_page( 'mp3-jplayer', 'Settings | MP3 jPlayer', 'Settings', 'manage_options', 'mp3-jplayer', 'mp3j_print_admin_page' ); //root in sub
71
- add_action( 'admin_head-'. $pluginpage, array(&$mp3_fox, 'mp3j_admin_header') );
 
72
 
73
- if ( $mp3_fox->setup['designPage'] === true ) {
74
  $subm_colours = add_submenu_page( 'mp3-jplayer', 'Design | MP3 jPlayer', 'Design', 'manage_options', 'mp3-jplayer-colours', 'mp3j_print_colours_page' );
75
- add_action( 'admin_head-'. $subm_colours, array(&$mp3_fox, 'mp3j_admin_colours_header') );
76
- $mp3_fox->dbug['str'] .= 'colours handle: ' . $subm_colours;
 
77
  }
78
  //Extension pages
79
- foreach ( $mp3_fox->EXTpages as $p ) {
80
  $submenu = add_submenu_page( $p['parent'], $p['title'], $p['menuName'], $p['capability'], $p['slug'], $p['drawFunction'] );
 
81
  if ( $p['scriptsFunction'] !== false ) {
82
  add_action( 'admin_head-'. $submenu, $p['scriptsFunction'] );
83
  }
@@ -96,9 +99,9 @@ if ( isset($mp3_fox) )
96
  return $links;
97
  }
98
 
99
- add_action('deactivate_mp3-jplayer/mp3jplayer.php', array(&$mp3_fox, 'uninitFox'));
100
  add_action('admin_menu', 'mp3j_adminpage', 100);
101
- //add_action( 'admin_enqueue_scripts', array(&$mp3_fox, 'adminPostEditHead') );
102
  }
103
 
104
 
@@ -123,7 +126,7 @@ if ( isset($mp3_fox) )
123
  function mp3j_settings ( $settings = array() ) {
124
  do_action('mp3j_settings', $settings );
125
  }
126
- add_action('mp3j_settings', array(&$mp3_fox, 'mp3j_settings'), 1, 1 );
127
 
128
 
129
  //Widgets
@@ -139,22 +142,22 @@ if ( isset($mp3_fox) )
139
 
140
 
141
  //Shortcodes
142
- add_shortcode('mp3t', array(&$mp3_fox, 'inline_play_handler'));
143
- add_shortcode('mp3j', array(&$mp3_fox, 'inline_play_graphic'));
144
- add_shortcode('mp3-jplayer', array(&$mp3_fox, 'primary_player'));
145
 
146
  remove_shortcode('popout');
147
- add_shortcode('popout', array(&$mp3_fox, 'popout_link_player'));
148
- add_shortcode('mp3-popout', array(&$mp3_fox, 'popout_link_player'));
149
 
150
  if ( $ops['replace_WP_playlist'] === 'true' && ! is_admin() ) {
151
  remove_shortcode('playlist');
152
- add_shortcode('playlist', array(&$mp3_fox, 'replacePlaylistShortcode'));
153
  }
154
 
155
  if ( ! is_admin() && ($ops['replace_WP_audio'] === 'true' || $ops['replace_WP_embedded'] === 'true' || $ops['replace_WP_attached'] === 'true') ) {
156
  remove_shortcode('audio');
157
- add_shortcode('audio', array(&$mp3_fox, 'replaceAudioShortcode'));
158
  }
159
 
160
 
@@ -167,17 +170,17 @@ if ( isset($mp3_fox) )
167
  */
168
  //$WPversion = substr( get_bloginfo('version'), 0, 3);
169
  //if ( $WPversion < 3.3 ) {
170
- add_action('wp_head', array(&$mp3_fox, 'header_scripts_handler'), 2); //Support for WP versions below 3.3
171
  //}
172
- add_action('wp_footer', array(&$mp3_fox, 'checkAddScripts'), 1); //Final chance to enqueue, process this action early (priority < 20).
173
- add_action('wp_footer', array(&$mp3_fox, 'footercode_handler'), 200); //Add any inline js, process this action late (enqueues fire at priority 20).
174
 
175
- add_filter('get_the_excerpt', array(&$mp3_fox, 'get_excerpt_handler'), 1);
176
- add_filter('the_content', array(&$mp3_fox, 'afterExcerpt'), 9999);
177
 
178
  //options
179
  if ( $ops['make_player_from_link'] == "true" ) {
180
- add_filter('the_content', array(&$mp3_fox, 'replace_links'), 1);
181
  }
182
  if ( $ops['run_shcode_in_excerpt'] == "true" ) {
183
  add_filter( 'the_excerpt', 'shortcode_unautop');
@@ -185,10 +188,10 @@ if ( isset($mp3_fox) )
185
  }
186
 
187
  //theme template actions
188
- add_action('mp3j_put', array(&$mp3_fox, 'template_tag_handler'), 10, 1 );
189
- add_action('mp3j_addscripts', array(&$mp3_fox, 'scripts_tag_handler'), 1, 1 );
190
- add_filter('mp3j_grab_library', array(&$mp3_fox, 'grablibrary_handler'), 10, 1 );
191
- add_action('mp3j_debug', array(&$mp3_fox, 'debug_info'), 10, 1 );
192
 
193
  //retired
194
  function mp3j_set_meta( $tracks, $captions = "", $startnum = 1 ) { } //since 1.7
3
  Plugin Name: MP3-jPlayer
4
  Plugin URI: http://mp3-jplayer.com
5
  Description: Easy, Flexible Audio for WordPress.
6
+ Version: 2.3
7
  Author: Simon Ward
8
  Author URI: http://www.sjward.org
9
  License: GPL2
34
  include_once( $path . '/frontend.php'); //extends main
35
 
36
  if ( class_exists("MP3j_Front") ) {
37
+ $MP3JP = new MP3j_Front();
38
  }
39
 
40
+ if ( isset($MP3JP) )
41
  {
42
  include_once( $path . '/widget-ui.php'); //ui widget (playlister)
43
  include_once( $path . '/widget-sh.php'); //shortcodes Widget
44
 
45
+ $ops = $MP3JP->theSettings;
46
  if ( is_admin() )
47
  {
48
  include_once( $path . '/admin-settings.php'); //settings page
63
  */
64
 
65
  //add menu pages
66
+ global $MP3JP;
67
 
68
  //Settings page
69
  $pluginpage = add_menu_page( 'Settings | MP3 jPlayer', 'MP3 jPlayer', 'manage_options', 'mp3-jplayer', 'mp3j_print_admin_page' ); //root
70
  add_submenu_page( 'mp3-jplayer', 'Settings | MP3 jPlayer', 'Settings', 'manage_options', 'mp3-jplayer', 'mp3j_print_admin_page' ); //root in sub
71
+ add_action( 'admin_head-'. $pluginpage, array(&$MP3JP, 'mp3j_admin_header') );
72
+ $MP3JP->menuHANDLES['parent'] = $pluginpage;
73
 
74
+ if ( $MP3JP->setup['designPage'] === true ) {
75
  $subm_colours = add_submenu_page( 'mp3-jplayer', 'Design | MP3 jPlayer', 'Design', 'manage_options', 'mp3-jplayer-colours', 'mp3j_print_colours_page' );
76
+ add_action( 'admin_head-'. $subm_colours, array(&$MP3JP, 'mp3j_admin_colours_header') );
77
+ $MP3JP->dbug['str'] .= 'colours handle: ' . $subm_colours;
78
+ $MP3JP->menuHANDLES['design'] = $subm_colours;
79
  }
80
  //Extension pages
81
+ foreach ( $MP3JP->EXTpages as $p ) {
82
  $submenu = add_submenu_page( $p['parent'], $p['title'], $p['menuName'], $p['capability'], $p['slug'], $p['drawFunction'] );
83
+ $MP3JP->menuHANDLES[ $p['slug'] ] = $submenu;
84
  if ( $p['scriptsFunction'] !== false ) {
85
  add_action( 'admin_head-'. $submenu, $p['scriptsFunction'] );
86
  }
99
  return $links;
100
  }
101
 
102
+ add_action('deactivate_mp3-jplayer/mp3jplayer.php', array(&$MP3JP, 'uninitFox'));
103
  add_action('admin_menu', 'mp3j_adminpage', 100);
104
+ //add_action( 'admin_enqueue_scripts', array(&$MP3JP, 'adminPostEditHead') );
105
  }
106
 
107
 
126
  function mp3j_settings ( $settings = array() ) {
127
  do_action('mp3j_settings', $settings );
128
  }
129
+ add_action('mp3j_settings', array(&$MP3JP, 'mp3j_settings'), 1, 1 );
130
 
131
 
132
  //Widgets
142
 
143
 
144
  //Shortcodes
145
+ add_shortcode('mp3t', array(&$MP3JP, 'inline_play_handler'));
146
+ add_shortcode('mp3j', array(&$MP3JP, 'inline_play_graphic'));
147
+ add_shortcode('mp3-jplayer', array(&$MP3JP, 'primary_player'));
148
 
149
  remove_shortcode('popout');
150
+ add_shortcode('popout', array(&$MP3JP, 'popout_link_player'));
151
+ add_shortcode('mp3-popout', array(&$MP3JP, 'popout_link_player'));
152
 
153
  if ( $ops['replace_WP_playlist'] === 'true' && ! is_admin() ) {
154
  remove_shortcode('playlist');
155
+ add_shortcode('playlist', array(&$MP3JP, 'replacePlaylistShortcode'));
156
  }
157
 
158
  if ( ! is_admin() && ($ops['replace_WP_audio'] === 'true' || $ops['replace_WP_embedded'] === 'true' || $ops['replace_WP_attached'] === 'true') ) {
159
  remove_shortcode('audio');
160
+ add_shortcode('audio', array(&$MP3JP, 'replaceAudioShortcode'));
161
  }
162
 
163
 
170
  */
171
  //$WPversion = substr( get_bloginfo('version'), 0, 3);
172
  //if ( $WPversion < 3.3 ) {
173
+ add_action('wp_head', array(&$MP3JP, 'header_scripts_handler'), 2); //Support for WP versions below 3.3
174
  //}
175
+ add_action('wp_footer', array(&$MP3JP, 'checkAddScripts'), 1); //Final chance to enqueue, process this action early (priority < 20).
176
+ add_action('wp_footer', array(&$MP3JP, 'footercode_handler'), 200); //Add any inline js, process this action late (enqueues fire at priority 20).
177
 
178
+ add_filter('get_the_excerpt', array(&$MP3JP, 'get_excerpt_handler'), 1);
179
+ add_filter('the_content', array(&$MP3JP, 'afterExcerpt'), 9999);
180
 
181
  //options
182
  if ( $ops['make_player_from_link'] == "true" ) {
183
+ add_filter('the_content', array(&$MP3JP, 'replace_links'), 1);
184
  }
185
  if ( $ops['run_shcode_in_excerpt'] == "true" ) {
186
  add_filter( 'the_excerpt', 'shortcode_unautop');
188
  }
189
 
190
  //theme template actions
191
+ add_action('mp3j_put', array(&$MP3JP, 'template_tag_handler'), 10, 1 );
192
+ add_action('mp3j_addscripts', array(&$MP3JP, 'scripts_tag_handler'), 1, 1 );
193
+ add_filter('mp3j_grab_library', array(&$MP3JP, 'grablibrary_handler'), 10, 1 );
194
+ add_action('mp3j_debug', array(&$MP3JP, 'debug_info'), 10, 1 );
195
 
196
  //retired
197
  function mp3j_set_meta( $tracks, $captions = "", $startnum = 1 ) { } //since 1.7
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.2.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.3.js'></script>
21
 
22
  <script type='text/javascript'>
23
  function loadcss(filename) {
readme.txt CHANGED
@@ -7,29 +7,29 @@ Tags: audio, audio player, audio playlist, mp3 player, music player, media, mobi
7
  License: GPLv2 or later
8
  Requires at least: 2.9
9
  Tested up to: 4.1
10
- Stable tag: 2.2
11
 
12
  Easy, Flexible Audio for WordPress.
13
 
14
  == Description ==
15
 
16
  = Mobile friendly HTML5 audio players and audio playlist players =
17
- * Add audio player styling and colour options, flexible music playlist players and single-file audio players, popout players and popout links, audio widget players, and downloads to your site.
18
- * Works with all built-in WordPress options for adding your music, including the recently introduced *Create Audio Playlist* drag & drop interface.
19
 
 
 
 
 
 
20
 
21
- [Player Demos](http://mp3-jplayer.com/player-skins/) <br>
22
  [How to Add Your Players](http://mp3-jplayer.com/adding-players/) <br>
23
- [Help & Docs](http://mp3-jplayer.com/help-docs/)
24
 
25
 
26
  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:
27
 
28
- * Flexible multi-player audio plugin, add unlimited audio players to pages, posts, sidebars, and template files.
29
  * Offer audio downloads to visitors or logged-in users.
30
  * Playlist folders with one simple feed folder command.
31
- * Can be selectively integrated with WordPress default audio players.
32
- * Customise the colour scheme, fonts, title and image placements and more on the Player Design page.
33
  * A fully integrated Pop-out player that can be launched from playlist players, or from a stand-alone popout link.
34
  * Shortcode parameters to give you individual control of player heights, widths, volumes, downloads, styling, and allow you to play from your library, local folders or urls.
35
  * You can use custom fields to manage playlists.
@@ -38,10 +38,9 @@ MP3-jPlayer will expand WP's native shortcodes with new functions and options, g
38
  * Very easy file counterparting, just upload.
39
  * Plays Icecast and Shoutcast audio streams.
40
  * Great compatibility across browsers / platforms. Works on iPhone, iPad, Android.
41
- * Editable player designs via CSS.
42
  * Multisite compatible.
43
-
44
-
45
 
46
  See [the plugin's home page](http://mp3-jplayer.com) for info, demos, documentation, and help articles.
47
 
@@ -102,6 +101,11 @@ Either on the [forum at Wordpress](https://wordpress.org/support/plugin/mp3-jpla
102
 
103
  == Changelog ==
104
 
 
 
 
 
 
105
  = 2.2 =
106
  * Simplified error handling to try and eliminate the false triggering of messages that was occurring on some devices.
107
  * Added an option to control the frontend display of player error messages, the options are: Never / To admins only / To all. The setting is under advanced tab, default is admins only.
7
  License: GPLv2 or later
8
  Requires at least: 2.9
9
  Tested up to: 4.1
10
+ Stable tag: 2.3
11
 
12
  Easy, Flexible Audio for WordPress.
13
 
14
  == Description ==
15
 
16
  = Mobile friendly HTML5 audio players and audio playlist players =
 
 
17
 
18
+ * Style and colour options for your audio players. Customise the colour scheme, fonts, title and image placements and more on the Player Design page.
19
+ * Enhanced features for audio playlist players and single-file audio players.
20
+ * Add popout players and popout links, audio widget players, and music downloads.
21
+ * Works with all built-in WordPress options for adding your music players, including the recently introduced *Create Audio Playlist* drag & drop interface.
22
+ * Flexible multi-player audio plugin, add unlimited music players to pages, posts, sidebars, and template files.
23
 
24
+ [Player Demos](http://mp3-jplayer.com/playlist-players/) <br>
25
  [How to Add Your Players](http://mp3-jplayer.com/adding-players/) <br>
26
+ [Included Skins Demo](http://mp3-jplayer.com/player-skins/)
27
 
28
 
29
  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:
30
 
 
31
  * Offer audio downloads to visitors or logged-in users.
32
  * Playlist folders with one simple feed folder command.
 
 
33
  * A fully integrated Pop-out player that can be launched from playlist players, or from a stand-alone popout link.
34
  * Shortcode parameters to give you individual control of player heights, widths, volumes, downloads, styling, and allow you to play from your library, local folders or urls.
35
  * You can use custom fields to manage playlists.
38
  * Very easy file counterparting, just upload.
39
  * Plays Icecast and Shoutcast audio streams.
40
  * Great compatibility across browsers / platforms. Works on iPhone, iPad, Android.
41
+ * Re-skinable player designs via CSS.
42
  * Multisite compatible.
43
+ * Can be selectively integrated with WordPress default audio players.
 
44
 
45
  See [the plugin's home page](http://mp3-jplayer.com) for info, demos, documentation, and help articles.
46
 
101
 
102
  == Changelog ==
103
 
104
+ = 2.3 =
105
+ * Fixed a major issue on index/cat/search type pages that could incorrectly assign the playlists or break players in some scenarios.
106
+ * Added support for custom js (for skin extensions) on the player Design page.
107
+ * Developer note: renamed the MP3-jPlayer plugin class instance to MP3JP.
108
+
109
  = 2.2 =
110
  * Simplified error handling to try and eliminate the false triggering of messages that was occurring on some devices.
111
  * Added an option to control the frontend display of player error messages, the options are: Never / To admins only / To all. The setting is under advanced tab, default is admins only.
widget-sh.php CHANGED
@@ -31,24 +31,24 @@ if ( class_exists("WP_Widget") ) {
31
  return;
32
  }
33
 
34
- global $mp3_fox;
35
- if ( $mp3_fox->page_filter( $instance['restrict_list'], $instance['restrict_mode'] ) ) {
36
  return;
37
  }
38
 
39
- $mp3_fox->Caller = "widget";
40
 
41
- $arb_text = $mp3_fox->strip_scripts( $instance['arb_text'] );
42
 
43
  $shortcodes_return = do_shortcode( $arb_text );
44
- $mp3_fox->Caller = false;
45
 
46
  if ( '' !== $shortcodes_return )
47
  {
48
  extract( $args ); // supplied WP theme vars
49
  echo $before_widget;
50
  if ( $instance['title'] ) {
51
- echo $before_title . $mp3_fox->strip_scripts( $instance['title'] ) . $after_title;
52
  }
53
  echo $shortcodes_return;
54
  echo $after_widget;
@@ -60,13 +60,13 @@ if ( class_exists("WP_Widget") ) {
60
  /* Updates the widget settings (required by api) */
61
  function update( $new_instance, $old_instance ) {
62
 
63
- global $mp3_fox;
64
 
65
  $instance = $old_instance;
66
- $instance['title'] = $mp3_fox->strip_scripts( $new_instance['title'] );
67
- $instance['restrict_list'] = $mp3_fox->strip_scripts( $new_instance['restrict_list'] );
68
- $instance['restrict_mode'] = $mp3_fox->strip_scripts( $new_instance['restrict_mode'] );
69
- $instance['arb_text'] = $mp3_fox->strip_scripts( $new_instance['arb_text'] );
70
  return $instance;
71
  }
72
 
@@ -74,7 +74,7 @@ if ( class_exists("WP_Widget") ) {
74
  /* Creates defaults and writes widget panel (required by api) */
75
  function form( $instance ) {
76
 
77
- global $mp3_fox;
78
 
79
  $defaultvalues = array(
80
  'title' => '',
@@ -85,10 +85,10 @@ if ( class_exists("WP_Widget") ) {
85
  $instance = wp_parse_args( (array) $instance, $defaultvalues );
86
  ?>
87
  <h3>Shortcodes:</h3>
88
- <textarea class="widefat" style="font-size:11px;" rows="8" cols="85" id="<?php echo $this->get_field_id( 'arb_text' ); ?>" name="<?php echo $this->get_field_name( 'arb_text' ); ?>"><?php echo $mp3_fox->strip_scripts( $instance['arb_text'] ); ?></textarea>
89
 
90
  <br><h3>Widget Heading:</h3>
91
- <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $mp3_fox->strip_scripts( $instance['title'] ); ?>" />
92
 
93
  <br><h3>Page Filter:</h3>
94
  <p style="line-height:200%; margin-top:-10px;"><strong>Include</strong>
@@ -96,7 +96,7 @@ if ( class_exists("WP_Widget") ) {
96
  or&nbsp;
97
  <input type="radio" id="<?php echo $this->get_field_id( 'restrict_mode' ); ?>" name="<?php echo $this->get_field_name( 'restrict_mode' ); ?>" value="exclude" <?php if ($instance['restrict_mode'] == "exclude") { _e('checked="checked"', "mp3jplayerwidget2"); }?> />
98
  <strong>Exclude</strong> &nbsp;
99
- <input type="text" class="widefat" style="font-size:11px; width:200px;" id="<?php echo $this->get_field_id( 'restrict_list' ); ?>" name="<?php echo $this->get_field_name( 'restrict_list' ); ?>" value="<?php echo $mp3_fox->strip_scripts( $instance['restrict_list'] ); ?>" />
100
  </p>
101
  <p style="line-height:140%; margin-top:-8px; margin-bottom:20px;"><span>A comma separated list, it can contain <code>index</code>, <code>archive</code>, <code>post</code>, <code>search</code>, and any <strong>post IDs</strong>.</span></p>
102
 
31
  return;
32
  }
33
 
34
+ global $MP3JP;
35
+ if ( $MP3JP->page_filter( $instance['restrict_list'], $instance['restrict_mode'] ) ) {
36
  return;
37
  }
38
 
39
+ $MP3JP->Caller = "widget";
40
 
41
+ $arb_text = $MP3JP->strip_scripts( $instance['arb_text'] );
42
 
43
  $shortcodes_return = do_shortcode( $arb_text );
44
+ $MP3JP->Caller = false;
45
 
46
  if ( '' !== $shortcodes_return )
47
  {
48
  extract( $args ); // supplied WP theme vars
49
  echo $before_widget;
50
  if ( $instance['title'] ) {
51
+ echo $before_title . $MP3JP->strip_scripts( $instance['title'] ) . $after_title;
52
  }
53
  echo $shortcodes_return;
54
  echo $after_widget;
60
  /* Updates the widget settings (required by api) */
61
  function update( $new_instance, $old_instance ) {
62
 
63
+ global $MP3JP;
64
 
65
  $instance = $old_instance;
66
+ $instance['title'] = $MP3JP->strip_scripts( $new_instance['title'] );
67
+ $instance['restrict_list'] = $MP3JP->strip_scripts( $new_instance['restrict_list'] );
68
+ $instance['restrict_mode'] = $MP3JP->strip_scripts( $new_instance['restrict_mode'] );
69
+ $instance['arb_text'] = $MP3JP->strip_scripts( $new_instance['arb_text'] );
70
  return $instance;
71
  }
72
 
74
  /* Creates defaults and writes widget panel (required by api) */
75
  function form( $instance ) {
76
 
77
+ global $MP3JP;
78
 
79
  $defaultvalues = array(
80
  'title' => '',
85
  $instance = wp_parse_args( (array) $instance, $defaultvalues );
86
  ?>
87
  <h3>Shortcodes:</h3>
88
+ <textarea class="widefat" style="font-size:11px;" rows="8" cols="85" id="<?php echo $this->get_field_id( 'arb_text' ); ?>" name="<?php echo $this->get_field_name( 'arb_text' ); ?>"><?php echo $MP3JP->strip_scripts( $instance['arb_text'] ); ?></textarea>
89
 
90
  <br><h3>Widget Heading:</h3>
91
+ <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $MP3JP->strip_scripts( $instance['title'] ); ?>" />
92
 
93
  <br><h3>Page Filter:</h3>
94
  <p style="line-height:200%; margin-top:-10px;"><strong>Include</strong>
96
  or&nbsp;
97
  <input type="radio" id="<?php echo $this->get_field_id( 'restrict_mode' ); ?>" name="<?php echo $this->get_field_name( 'restrict_mode' ); ?>" value="exclude" <?php if ($instance['restrict_mode'] == "exclude") { _e('checked="checked"', "mp3jplayerwidget2"); }?> />
98
  <strong>Exclude</strong> &nbsp;
99
+ <input type="text" class="widefat" style="font-size:11px; width:200px;" id="<?php echo $this->get_field_id( 'restrict_list' ); ?>" name="<?php echo $this->get_field_name( 'restrict_list' ); ?>" value="<?php echo $MP3JP->strip_scripts( $instance['restrict_list'] ); ?>" />
100
  </p>
101
  <p style="line-height:140%; margin-top:-8px; margin-bottom:20px;"><span>A comma separated list, it can contain <code>index</code>, <code>archive</code>, <code>post</code>, <code>search</code>, and any <strong>post IDs</strong>.</span></p>
102
 
widget-ui.php CHANGED
@@ -28,14 +28,14 @@ if ( class_exists("WP_Widget") ) {
28
  /* Sets up widget playlist and writes player (required by api) */
29
  function widget( $args, $instance ) {
30
 
31
- global $mp3_fox;
32
 
33
- $mp3_fox->dbug['str'] .= "\n### Checking UI widget...";
34
  if ( !is_home() && !is_archive() && !is_singular() && !is_search() ) {
35
  return;
36
  }
37
- if ( $mp3_fox->page_filter( $instance['restrict_list'], $instance['restrict_mode'] ) ) {
38
- $mp3_fox->dbug['str'] .= "\nExiting (page filter says no)";
39
  return;
40
  }
41
 
@@ -79,7 +79,7 @@ if ( class_exists("WP_Widget") ) {
79
  }
80
 
81
  global $post;
82
- $attachments = $mp3_fox->getPostAttachedAudio( $post->ID );
83
 
84
  $urls = '';
85
  if ( $attachments !== false ) {
@@ -102,7 +102,7 @@ if ( class_exists("WP_Widget") ) {
102
  $pn = ( $instance['pn_buttons'] == "true" ) ? "y" : "n";
103
  $stop = ( $instance['stop_button'] == "true" ) ? "y" : "n";
104
  $images = ( $instance['images'] == "true" ) ? "true" : "false";
105
- $height = ( $instance['player_height'] == "" ) ? $mp3_fox->theSettings['playerHeight'] : $instance['player_height'];
106
 
107
  $SHORTCODE .= ' list="' . $list . '"';
108
  $SHORTCODE .= ' autoplay="' . $autoplay . '"';
@@ -121,9 +121,9 @@ if ( class_exists("WP_Widget") ) {
121
  $SHORTCODE .= ']';
122
 
123
  //process it
124
- $mp3_fox->Caller = "widget";
125
  $shortcodes_return = do_shortcode( $SHORTCODE );
126
- $mp3_fox->Caller = false;
127
 
128
  //print it
129
  if ( '' !== $shortcodes_return )
@@ -144,7 +144,7 @@ if ( class_exists("WP_Widget") ) {
144
  /* Updates the widget settings (required by api) */
145
  function update( $new_instance, $old_instance ) {
146
 
147
- global $mp3_fox;
148
 
149
  $instance = $old_instance;
150
  $instance['title'] = $new_instance['title'];
@@ -184,8 +184,8 @@ if ( class_exists("WP_Widget") ) {
184
  }
185
  */
186
 
187
- //$instance['folder_to_play'] = $mp3_fox->prep_path( strip_tags( $new_instance['folder_to_play'] ) );
188
- $instance['folder_to_play'] = $mp3_fox->prep_path( $new_instance['folder_to_play'] );
189
 
190
  $instance['volume'] = preg_replace("/[^0-9]/", "", $new_instance['volume']);
191
  if ($instance['volume'] < 0 || $instance['volume']=="") { $instance['volume'] = "0"; }
@@ -198,8 +198,8 @@ if ( class_exists("WP_Widget") ) {
198
  /* Creates defaults and writes widget panel (required by api) */
199
  function form( $instance ) {
200
 
201
- global $mp3_fox;
202
- $mp3_fox->theSettings = get_option('mp3FoxAdminOptions');
203
 
204
  $defaultvalues = array(
205
  'title' => '',
@@ -213,18 +213,18 @@ if ( class_exists("WP_Widget") ) {
213
  'play_page' => 'false',
214
  'slice_size' => '',
215
  'play_folder' => 'false',
216
- 'folder_to_play' => $mp3_fox->theSettings['mp3_dir'],
217
- 'download_link' => $mp3_fox->theSettings['show_downloadmp3'],
218
- 'playlist_mode' => $mp3_fox->theSettings['playlist_show'],
219
  'player_width' => '100%',
220
- 'autoplay' => $mp3_fox->theSettings['auto_play'],
221
- 'loop' => $mp3_fox->theSettings['playlist_repeat'],
222
- 'volume' => $mp3_fox->theSettings['initial_vol'],
223
  'mods' => 'false',
224
  'position' => 'rel-L',
225
  'pn_buttons' => 'false',
226
  'stop_button' => 'false',
227
- 'player_height' => $mp3_fox->theSettings['playerHeight'],
228
  'style' => 'nolistbutton',
229
  'images' => 'true'
230
  );
@@ -244,7 +244,7 @@ if ( class_exists("WP_Widget") ) {
244
 
245
  <input type="radio" id="<?php echo $this->get_field_id( 'widget_mode' ); ?>_2" name="<?php echo $this->get_field_name( 'widget_mode' ); ?>" value="2" <?php if ($instance['widget_mode'] == "2") { _e('checked="checked"', "mp3jplayerwidget"); }?> />
246
  <label for="<?php echo $this->get_field_id( 'widget_mode' ); ?>_2"><strong>Write a Playlist...</strong></label>
247
- <p style="margin:3px 0 10px 18px;"><span class="description">A <code><?php echo $mp3_fox->theSettings['f_separator']; ?></code> separated list of URI's, library/default folder filenames, or FEEDs.</span></p>
248
  <div style="margin:0px 0 15px 24px;"><textarea class="widefat" style="font-size:11px;" rows="4" cols="80" id="<?php echo $this->get_field_id( 'arb_playlist' ); ?>" name="<?php echo $this->get_field_name( 'arb_playlist' ); ?>"><?php echo $instance['arb_playlist']; ?></textarea></div>
249
 
250
  <input type="radio" id="<?php echo $this->get_field_id( 'widget_mode' ); ?>_3" name="<?php echo $this->get_field_name( 'widget_mode' ); ?>" value="3" <?php if ($instance['widget_mode'] == "3") { _e('checked="checked"', "mp3jplayerwidget"); }?> />
@@ -256,7 +256,7 @@ if ( class_exists("WP_Widget") ) {
256
  <?php
257
  /*
258
  if ( $instance['folder_to_play'] == "" ) {
259
- $folder = $mp3_fox->theSettings['mp3_dir'];
260
  } else {
261
  $folder = $instance['folder_to_play'];
262
  }
@@ -264,8 +264,8 @@ if ( class_exists("WP_Widget") ) {
264
 
265
  $folder = $instance['folder_to_play'];
266
  //$folder = '/music/sub';
267
- //$foldertracks = $mp3_fox->grabFolderURLs( $folder );
268
- $fdetails = $mp3_fox->grabFolderURLs( $folder, $mp3_fox->formatsFeedRegex );
269
  $foldertracks = ( isset($fdetails['files']) ) ? $fdetails['files'] : false;
270
 
271
  if ( $foldertracks !== true && $foldertracks !== false ) {
@@ -370,7 +370,7 @@ if ( class_exists("WP_Widget") ) {
370
 
371
  <br class="clear">
372
  <strong>Style</strong>:<br>
373
- <input class="widefat" style="max-width:80%;" type="text" id="<?php echo $this->get_field_id( 'style' ); ?>" name="<?php echo $this->get_field_name( 'style' ); ?>" value="<?php echo $instance['style']; ?>" />&nbsp; <a href="<?php echo $mp3_fox->PluginFolder; ?>/style-param-help.htm">Help</a>
374
 
375
 
376
 
28
  /* Sets up widget playlist and writes player (required by api) */
29
  function widget( $args, $instance ) {
30
 
31
+ global $MP3JP;
32
 
33
+ $MP3JP->dbug['str'] .= "\n### Checking UI widget...";
34
  if ( !is_home() && !is_archive() && !is_singular() && !is_search() ) {
35
  return;
36
  }
37
+ if ( $MP3JP->page_filter( $instance['restrict_list'], $instance['restrict_mode'] ) ) {
38
+ $MP3JP->dbug['str'] .= "\nExiting (page filter says no)";
39
  return;
40
  }
41
 
79
  }
80
 
81
  global $post;
82
+ $attachments = $MP3JP->getPostAttachedAudio( $post->ID );
83
 
84
  $urls = '';
85
  if ( $attachments !== false ) {
102
  $pn = ( $instance['pn_buttons'] == "true" ) ? "y" : "n";
103
  $stop = ( $instance['stop_button'] == "true" ) ? "y" : "n";
104
  $images = ( $instance['images'] == "true" ) ? "true" : "false";
105
+ $height = ( $instance['player_height'] == "" ) ? $MP3JP->theSettings['playerHeight'] : $instance['player_height'];
106
 
107
  $SHORTCODE .= ' list="' . $list . '"';
108
  $SHORTCODE .= ' autoplay="' . $autoplay . '"';
121
  $SHORTCODE .= ']';
122
 
123
  //process it
124
+ $MP3JP->Caller = "widget";
125
  $shortcodes_return = do_shortcode( $SHORTCODE );
126
+ $MP3JP->Caller = false;
127
 
128
  //print it
129
  if ( '' !== $shortcodes_return )
144
  /* Updates the widget settings (required by api) */
145
  function update( $new_instance, $old_instance ) {
146
 
147
+ global $MP3JP;
148
 
149
  $instance = $old_instance;
150
  $instance['title'] = $new_instance['title'];
184
  }
185
  */
186
 
187
+ //$instance['folder_to_play'] = $MP3JP->prep_path( strip_tags( $new_instance['folder_to_play'] ) );
188
+ $instance['folder_to_play'] = $MP3JP->prep_path( $new_instance['folder_to_play'] );
189
 
190
  $instance['volume'] = preg_replace("/[^0-9]/", "", $new_instance['volume']);
191
  if ($instance['volume'] < 0 || $instance['volume']=="") { $instance['volume'] = "0"; }
198
  /* Creates defaults and writes widget panel (required by api) */
199
  function form( $instance ) {
200
 
201
+ global $MP3JP;
202
+ $MP3JP->theSettings = get_option('mp3FoxAdminOptions');
203
 
204
  $defaultvalues = array(
205
  'title' => '',
213
  'play_page' => 'false',
214
  'slice_size' => '',
215
  'play_folder' => 'false',
216
+ 'folder_to_play' => $MP3JP->theSettings['mp3_dir'],
217
+ 'download_link' => $MP3JP->theSettings['show_downloadmp3'],
218
+ 'playlist_mode' => $MP3JP->theSettings['playlist_show'],
219
  'player_width' => '100%',
220
+ 'autoplay' => $MP3JP->theSettings['auto_play'],
221
+ 'loop' => $MP3JP->theSettings['playlist_repeat'],
222
+ 'volume' => $MP3JP->theSettings['initial_vol'],
223
  'mods' => 'false',
224
  'position' => 'rel-L',
225
  'pn_buttons' => 'false',
226
  'stop_button' => 'false',
227
+ 'player_height' => $MP3JP->theSettings['playerHeight'],
228
  'style' => 'nolistbutton',
229
  'images' => 'true'
230
  );
244
 
245
  <input type="radio" id="<?php echo $this->get_field_id( 'widget_mode' ); ?>_2" name="<?php echo $this->get_field_name( 'widget_mode' ); ?>" value="2" <?php if ($instance['widget_mode'] == "2") { _e('checked="checked"', "mp3jplayerwidget"); }?> />
246
  <label for="<?php echo $this->get_field_id( 'widget_mode' ); ?>_2"><strong>Write a Playlist...</strong></label>
247
+ <p style="margin:3px 0 10px 18px;"><span class="description">A <code><?php echo $MP3JP->theSettings['f_separator']; ?></code> separated list of URI's, library/default folder filenames, or FEEDs.</span></p>
248
  <div style="margin:0px 0 15px 24px;"><textarea class="widefat" style="font-size:11px;" rows="4" cols="80" id="<?php echo $this->get_field_id( 'arb_playlist' ); ?>" name="<?php echo $this->get_field_name( 'arb_playlist' ); ?>"><?php echo $instance['arb_playlist']; ?></textarea></div>
249
 
250
  <input type="radio" id="<?php echo $this->get_field_id( 'widget_mode' ); ?>_3" name="<?php echo $this->get_field_name( 'widget_mode' ); ?>" value="3" <?php if ($instance['widget_mode'] == "3") { _e('checked="checked"', "mp3jplayerwidget"); }?> />
256
  <?php
257
  /*
258
  if ( $instance['folder_to_play'] == "" ) {
259
+ $folder = $MP3JP->theSettings['mp3_dir'];
260
  } else {
261
  $folder = $instance['folder_to_play'];
262
  }
264
 
265
  $folder = $instance['folder_to_play'];
266
  //$folder = '/music/sub';
267
+ //$foldertracks = $MP3JP->grabFolderURLs( $folder );
268
+ $fdetails = $MP3JP->grabFolderURLs( $folder, $MP3JP->formatsFeedRegex );
269
  $foldertracks = ( isset($fdetails['files']) ) ? $fdetails['files'] : false;
270
 
271
  if ( $foldertracks !== true && $foldertracks !== false ) {
370
 
371
  <br class="clear">
372
  <strong>Style</strong>:<br>
373
+ <input class="widefat" style="max-width:80%;" type="text" id="<?php echo $this->get_field_id( 'style' ); ?>" name="<?php echo $this->get_field_name( 'style' ); ?>" value="<?php echo $instance['style']; ?>" />&nbsp; <a href="<?php echo $MP3JP->PluginFolder; ?>/style-param-help.htm">Help</a>
374
 
375
 
376