MP3-jPlayer - Version 1.4.0

Version Description

  • Added a widget.
  • Improvements to admin including library and default folder mp3 lists, custom stylesheet setting, and some new options.
  • Added new shortcode attributes shuffle, slice, id. New values for list
  • Added a way to play whole folders, the entire library, to grab the tracks from another page.
  • Added a simpler text-only player style that adopts theme link colours.
  • Improved admin help.
  • Some minor bug fixes.
  • Some minor css improvements and fixes.
Download this release

Release Info

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

Code changes from version 1.3.4 to 1.4.0

css/images/Thumbs.db CHANGED
Binary file
css/images/buttons.png DELETED
Binary file
css/images/buttons3H.png ADDED
Binary file
css/images/buttonsH.png DELETED
Binary file
css/images/finding-bar1.gif ADDED
Binary file
css/images/finding-bar1b.gif ADDED
Binary file
css/images/grey-bar.gif DELETED
Binary file
css/images/t2b.png ADDED
Binary file
css/images/t3b.png ADDED
Binary file
css/images/t5b.png ADDED
Binary file
css/images/vol-handle.gif DELETED
Binary file
css/images/vol-handleT.gif ADDED
Binary file
css/mp3jplayer-blu-sidebar.css CHANGED
@@ -1,6 +1,6 @@
1
  /* ________________________________________
2
 
3
- MP3-jPlayer CSS - Blue - www.sjward.org
4
  ________________________________________
5
  */
6
 
@@ -13,7 +13,7 @@ div.jp-playlist-player {
13
  margin: 0px;
14
  font-family: Verdana, Arial, sans-serif;
15
  color: #666;
16
- width: auto;
17
  background: transparent; }
18
 
19
 
@@ -41,7 +41,7 @@ div.jp-innerwrap { position: relative;
41
 
42
  #innerright { position: absolute;
43
  width: 10px;
44
- height: 44px; /* IE6 */
45
  right: -1px;
46
  bottom: 0px;
47
  background: url('images/case2-r.png') no-repeat left bottom; }
@@ -79,7 +79,7 @@ div.jp-interface { position: relative;
79
  #player-artist {
80
  position: absolute;
81
  font: normal normal 500 9px 'verdana', 'Lucida Grande', 'arial', sans-serif;
82
- top: 22px;
83
  left: 24px;
84
  width: auto;
85
  color: #fff;
@@ -93,7 +93,7 @@ div.jp-interface { position: relative;
93
  div.jp-total-time,
94
  #status { position: absolute;
95
  font: normal normal 500 8px 'verdana', 'Lucida Grande', 'arial', sans-serif;
96
- color: #eee;
97
  top: 42px;
98
  text-align: left;
99
  z-index: 50; }
@@ -246,8 +246,9 @@ div.jp-interface { position: relative;
246
  right: 1px;
247
  width: 108px;
248
  height:2px;
249
- background: #778;
250
- border: 1px solid #aab;
 
251
  font-size: 1px; /* IE6 */
252
  cursor: default;
253
  z-index: 150; }
@@ -257,7 +258,7 @@ div.jp-interface { position: relative;
257
  #sliderVolume .ui-slider-handle {
258
  height: 11px;
259
  width: 10px;
260
- margin-left: -8px;
261
  top: -4px;
262
  border: 0px;
263
  -moz-border-radius: 2px;
@@ -280,7 +281,8 @@ div.jp-interface { position: relative;
280
  #bars_holder { position:absolute;
281
  top: 0px;
282
  left: 0px;
283
- width:201px;
 
284
  height: 55px;
285
  background: #f0f0f0;
286
  font-size: 1px; /* IE6 */
@@ -288,7 +290,7 @@ div.jp-interface { position: relative;
288
 
289
  #sliderPlayback { position:absolute;
290
  width: 199px;
291
- left: 1px;
292
  top: 0px;
293
  background: transparent;
294
  font-size: 5px; /* IE6 */
@@ -317,7 +319,7 @@ div.jp-interface { position: relative;
317
 
318
  #loaderBar { position:absolute;
319
  top: 0px;
320
- left: 1px;
321
  background: #ddd; }
322
 
323
  #loaderBar.ui-progressbar {
@@ -328,7 +330,7 @@ div.jp-interface { position: relative;
328
  background: #c0c0c0; }
329
 
330
  .ui-progressbar .ui-progressbar-value {margin: 0px; height:100%;
331
- background: #90a0b7;
332
  }
333
 
334
  #bars_holder .ui-slider-horizontal { height: 53px; }
1
  /* ________________________________________
2
 
3
+ MP3-jPlayer - Blue (sidebar)
4
  ________________________________________
5
  */
6
 
13
  margin: 0px;
14
  font-family: Verdana, Arial, sans-serif;
15
  color: #666;
16
+ width: 201px;
17
  background: transparent; }
18
 
19
 
41
 
42
  #innerright { position: absolute;
43
  width: 10px;
44
+ height: 35px; /* IE6 */
45
  right: -1px;
46
  bottom: 0px;
47
  background: url('images/case2-r.png') no-repeat left bottom; }
79
  #player-artist {
80
  position: absolute;
81
  font: normal normal 500 9px 'verdana', 'Lucida Grande', 'arial', sans-serif;
82
+ top: 20px;
83
  left: 24px;
84
  width: auto;
85
  color: #fff;
93
  div.jp-total-time,
94
  #status { position: absolute;
95
  font: normal normal 500 8px 'verdana', 'Lucida Grande', 'arial', sans-serif;
96
+ color: #eaeaea;
97
  top: 42px;
98
  text-align: left;
99
  z-index: 50; }
246
  right: 1px;
247
  width: 108px;
248
  height:2px;
249
+ background: #999;
250
+ border: 1px solid #999;
251
+ border-right: 4px solid #999;
252
  font-size: 1px; /* IE6 */
253
  cursor: default;
254
  z-index: 150; }
258
  #sliderVolume .ui-slider-handle {
259
  height: 11px;
260
  width: 10px;
261
+ margin-left: -5px;
262
  top: -4px;
263
  border: 0px;
264
  -moz-border-radius: 2px;
281
  #bars_holder { position:absolute;
282
  top: 0px;
283
  left: 0px;
284
+ border-left: 1px solid #ccc;
285
+ width:199px;
286
  height: 55px;
287
  background: #f0f0f0;
288
  font-size: 1px; /* IE6 */
290
 
291
  #sliderPlayback { position:absolute;
292
  width: 199px;
293
+ left: 0px;
294
  top: 0px;
295
  background: transparent;
296
  font-size: 5px; /* IE6 */
319
 
320
  #loaderBar { position:absolute;
321
  top: 0px;
322
+ left: 0px;
323
  background: #ddd; }
324
 
325
  #loaderBar.ui-progressbar {
330
  background: #c0c0c0; }
331
 
332
  .ui-progressbar .ui-progressbar-value {margin: 0px; height:100%;
333
+ background: #90a0b7; /* 8d97a5 90a0b7 */
334
  }
335
 
336
  #bars_holder .ui-slider-horizontal { height: 53px; }
css/mp3jplayer-blu.css CHANGED
@@ -1,6 +1,6 @@
1
  /* ________________________________________
2
 
3
- MP3-jPlayer CSS - Blue - www.sjward.org
4
  ________________________________________
5
  */
6
 
@@ -13,7 +13,7 @@ div.jp-playlist-player {
13
  margin: 0px;
14
  font-family: Verdana, Arial, sans-serif;
15
  color: #666;
16
- width: auto;
17
  background: transparent; }
18
 
19
 
@@ -41,7 +41,7 @@ div.jp-innerwrap { position: relative;
41
 
42
  #innerright { position: absolute;
43
  width: 10px;
44
- height: 50px; /* IE6 */
45
  right: -1px;
46
  bottom: 0px;
47
  background: url('images/case2-r.png') no-repeat left bottom; }
@@ -109,7 +109,7 @@ div.jp-interface { position: relative;
109
 
110
  #status { font-size: 8px; }
111
 
112
- span.mp3-finding { background: url('../css/images/finding-bar10.gif') repeat-y -2px 3px; margin-left: -3px; padding-left: 4px; }
113
  span.mp3-loading { background: url('../css/images/finding-barBc.gif') repeat-y -2px 3px; margin-left: -3px; padding-left: 4px; }
114
 
115
  /* span.mp3-finding { background: url('../css/images/finding-bar11.gif') repeat-y 0px 3px; padding-left: 6px; }
@@ -218,7 +218,7 @@ div.jp-interface { position: relative;
218
  #downloadmp3-button.whilelinks a { color: #f3f3f3; }
219
  #downloadmp3-button.whilelinks a:hover { color: #fff; }
220
 
221
-
222
  /* sliders/bars */
223
  .ui-state-disabled { cursor: default !important; }
224
  .ui-slider { position: relative; text-align: left; }
@@ -246,8 +246,9 @@ div.jp-interface { position: relative;
246
  right: 1px;
247
  width: 108px;
248
  height:2px;
249
- background: #778;
250
- border: 1px solid #aab;
 
251
  font-size: 1px; /* IE6 */
252
  cursor: default;
253
  z-index: 150; }
@@ -257,7 +258,7 @@ div.jp-interface { position: relative;
257
  #sliderVolume .ui-slider-handle {
258
  height: 11px;
259
  width: 10px;
260
- margin-left: -8px;
261
  top: -4px;
262
  border: 0px;
263
  -moz-border-radius: 2px;
@@ -280,7 +281,8 @@ div.jp-interface { position: relative;
280
  #bars_holder { position:absolute;
281
  top: 0px;
282
  left: 0px;
283
- width:281px;
 
284
  height: 57px;
285
  background: #f0f0f0;
286
  font-size: 1px; /* IE6 */
@@ -288,7 +290,7 @@ div.jp-interface { position: relative;
288
 
289
  #sliderPlayback { position:absolute;
290
  width: 279px;
291
- left: 1px;
292
  top: 0px;
293
  background: transparent;
294
  font-size: 5px; /* IE6 */
@@ -317,7 +319,7 @@ div.jp-interface { position: relative;
317
 
318
  #loaderBar { position:absolute;
319
  top: 0px;
320
- left: 1px;
321
  background: #ddd; }
322
 
323
  #loaderBar.ui-progressbar {
@@ -328,7 +330,7 @@ div.jp-interface { position: relative;
328
  background: #c0c0c0; }
329
 
330
  .ui-progressbar .ui-progressbar-value {margin: 0px; height:100%;
331
- background: #90a0b7;
332
  }
333
 
334
  #bars_holder .ui-slider-horizontal { height: 55px; }
1
  /* ________________________________________
2
 
3
+ MP3-jPlayer - Blue
4
  ________________________________________
5
  */
6
 
13
  margin: 0px;
14
  font-family: Verdana, Arial, sans-serif;
15
  color: #666;
16
+ width: 281px;
17
  background: transparent; }
18
 
19
 
41
 
42
  #innerright { position: absolute;
43
  width: 10px;
44
+ height: 41px; /* IE6 */
45
  right: -1px;
46
  bottom: 0px;
47
  background: url('images/case2-r.png') no-repeat left bottom; }
109
 
110
  #status { font-size: 8px; }
111
 
112
+ span.mp3-finding { background: url('../css/images/finding-barBc.gif') repeat-y -2px 3px; margin-left: -3px; padding-left: 4px; }
113
  span.mp3-loading { background: url('../css/images/finding-barBc.gif') repeat-y -2px 3px; margin-left: -3px; padding-left: 4px; }
114
 
115
  /* span.mp3-finding { background: url('../css/images/finding-bar11.gif') repeat-y 0px 3px; padding-left: 6px; }
218
  #downloadmp3-button.whilelinks a { color: #f3f3f3; }
219
  #downloadmp3-button.whilelinks a:hover { color: #fff; }
220
 
221
+
222
  /* sliders/bars */
223
  .ui-state-disabled { cursor: default !important; }
224
  .ui-slider { position: relative; text-align: left; }
246
  right: 1px;
247
  width: 108px;
248
  height:2px;
249
+ background: #999;
250
+ border: 1px solid #999;
251
+ border-right: 4px solid #999;
252
  font-size: 1px; /* IE6 */
253
  cursor: default;
254
  z-index: 150; }
258
  #sliderVolume .ui-slider-handle {
259
  height: 11px;
260
  width: 10px;
261
+ margin-left: -5px;
262
  top: -4px;
263
  border: 0px;
264
  -moz-border-radius: 2px;
281
  #bars_holder { position:absolute;
282
  top: 0px;
283
  left: 0px;
284
+ border-left: 1px solid #ccc;
285
+ width:279px;
286
  height: 57px;
287
  background: #f0f0f0;
288
  font-size: 1px; /* IE6 */
290
 
291
  #sliderPlayback { position:absolute;
292
  width: 279px;
293
+ left: 0px;
294
  top: 0px;
295
  background: transparent;
296
  font-size: 5px; /* IE6 */
319
 
320
  #loaderBar { position:absolute;
321
  top: 0px;
322
+ left: 0px;
323
  background: #ddd; }
324
 
325
  #loaderBar.ui-progressbar {
330
  background: #c0c0c0; }
331
 
332
  .ui-progressbar .ui-progressbar-value {margin: 0px; height:100%;
333
+ background: #90a0b7; /* 8d97a5 90a0b7 */
334
  }
335
 
336
  #bars_holder .ui-slider-horizontal { height: 55px; }
css/{mp3-jplayer-cyanALT-sidebar.css → mp3jplayer-cyanALT-sidebar.css} RENAMED
@@ -1,6 +1,6 @@
1
  /* ____________________________________________
2
 
3
- MP3-jPlayer CSS - ALT cyan - www.sjward.org
4
  ____________________________________________
5
  */
6
 
@@ -13,7 +13,7 @@ div.jp-playlist-player {
13
  margin: 0px;
14
  font-family: Verdana, Arial, sans-serif;
15
  color: #666;
16
- width: auto;
17
  background: transparent; }
18
 
19
 
1
  /* ____________________________________________
2
 
3
+ MP3-jPlayer - cyan ALT (sidebar)
4
  ____________________________________________
5
  */
6
 
13
  margin: 0px;
14
  font-family: Verdana, Arial, sans-serif;
15
  color: #666;
16
+ width: 201px;
17
  background: transparent; }
18
 
19
 
css/{mp3-jplayer-cyanALT.css → mp3jplayer-cyanALT.css} RENAMED
@@ -1,6 +1,6 @@
1
  /* ____________________________________________
2
 
3
- MP3-jPlayer CSS - ALT cyan - www.sjward.org
4
  ____________________________________________
5
  */
6
 
@@ -13,7 +13,7 @@ div.jp-playlist-player {
13
  margin: 0px;
14
  font-family: Verdana, Arial, sans-serif;
15
  color: #666;
16
- width: auto;
17
  background: transparent; }
18
 
19
 
1
  /* ____________________________________________
2
 
3
+ MP3-jPlayer - cyan ALT
4
  ____________________________________________
5
  */
6
 
13
  margin: 0px;
14
  font-family: Verdana, Arial, sans-serif;
15
  color: #666;
16
+ width: 281px;
17
  background: transparent; }
18
 
19
 
css/mp3jplayer-green-sidebar.css CHANGED
@@ -1,6 +1,6 @@
1
  /* _________________________________________
2
 
3
- MP3-jPlayer CSS - Green - www.sjward.org
4
  _________________________________________
5
  */
6
 
@@ -13,7 +13,7 @@ div.jp-playlist-player {
13
  margin: 0px;
14
  font-family: Verdana, Arial, sans-serif;
15
  color: #666;
16
- width: auto;
17
  background: transparent; }
18
 
19
 
@@ -40,7 +40,7 @@ div.jp-innerwrap { position: relative;
40
 
41
  #innerright { position: absolute;
42
  width: 10px;
43
- height: 44px; /* IE6 */
44
  right: -1px;
45
  bottom: 0px;
46
  background: url('images/case2-r.png') no-repeat left bottom; }
@@ -78,7 +78,7 @@ div.jp-interface { position: relative;
78
  #player-artist {
79
  position: absolute;
80
  font: normal normal 500 9px 'verdana', 'Lucida Grande', 'arial', sans-serif;
81
- top: 22px;
82
  left: 24px;
83
  width: auto;
84
  color: #fff;
@@ -92,7 +92,7 @@ div.jp-interface { position: relative;
92
  div.jp-total-time,
93
  #status { position: absolute;
94
  font: normal normal 500 8px 'verdana', 'Lucida Grande', 'arial', sans-serif;
95
- color: #eee;
96
  top: 42px;
97
  text-align: left;
98
  z-index: 50; }
@@ -103,7 +103,7 @@ div.jp-interface { position: relative;
103
 
104
  div.jp-play-time { left: 95px; color: #fff; }
105
  div.jp-total-time { right: 10px; }
106
- #status { right: 37px; width: 40px; color: #fff; }
107
 
108
 
109
  #status { font-size: 8px; }
@@ -243,8 +243,9 @@ div.jp-interface { position: relative;
243
  right: 1px;
244
  width: 108px;
245
  height:2px;
246
- background: #777;
247
- border: 1px solid #aaa;
 
248
  font-size: 1px; /* IE6 */
249
  cursor: default;
250
  z-index: 150; }
@@ -254,7 +255,7 @@ div.jp-interface { position: relative;
254
  #sliderVolume .ui-slider-handle {
255
  height: 11px;
256
  width: 10px;
257
- margin-left: -8px;
258
  top: -4px;
259
  border: 0px;
260
  -moz-border-radius: 2px;
@@ -277,7 +278,8 @@ div.jp-interface { position: relative;
277
  #bars_holder { position:absolute;
278
  top: 0px;
279
  left: 0px;
280
- width:201px;
 
281
  height: 55px;
282
  background: #f0f0f0;
283
  font-size: 1px; /* IE6 */
@@ -285,7 +287,7 @@ div.jp-interface { position: relative;
285
 
286
  #sliderPlayback { position:absolute;
287
  width: 199px;
288
- left: 1px;
289
  top: 0px;
290
  background: transparent;
291
  font-size: 5px; /* IE6 */
@@ -314,7 +316,7 @@ div.jp-interface { position: relative;
314
 
315
  #loaderBar { position:absolute;
316
  top: 0px;
317
- left: 1px;
318
  background: #ddd; }
319
 
320
  #loaderBar.ui-progressbar {
@@ -337,7 +339,6 @@ div.jp-interface { position: relative;
337
 
338
  div.jp-playlist { width: 199px; }
339
 
340
- /* #playlist-wrap div.jp-playlist ul{ */
341
  div.jp-playlist-player div#jplayer_playlist.jp-playlist ul {
342
  list-style-type:none;
343
  margin:-1px 0 0 1px !important;
@@ -346,7 +347,6 @@ div.jp-interface { position: relative;
346
  border:0px solid #666;
347
  border-top:none; }
348
 
349
- /* div.jp-playlist-player div.jp-playlist li, #playlist-wrap div.jp-playlist li { */
350
  div.jp-playlist-player div#jplayer_playlist.jp-playlist li, #playlist-wrap div.jp-playlist li {
351
  padding:0px 0px 0px 2px !important;
352
  border-bottom:1px solid #ebebeb !important;
@@ -380,12 +380,11 @@ div.jp-interface { position: relative;
380
  border: 0px; }
381
 
382
  div.jp-playlist-player div.jp-playlist a:hover, #playlist-wrap div.jp-playlist a:hover {
383
- color:#808080; /* b4b4b4 c7b67f d1b37c 00c0f0 */
384
  background: #f7f7f7; }
385
 
386
  div.jp-playlist-player div.jp-playlist a.jplayer_playlist_current, #playlist-wrap div.jp-playlist a.jplayer_playlist_current {
387
- color:#b8a47e; /* 77c0f0 */
388
  background: #f4f4f4; }
389
 
390
-
391
- /* ______________________________________________________________________ */
1
  /* _________________________________________
2
 
3
+ MP3-jPlayer - Green (sidebar)
4
  _________________________________________
5
  */
6
 
13
  margin: 0px;
14
  font-family: Verdana, Arial, sans-serif;
15
  color: #666;
16
+ width: 201px;
17
  background: transparent; }
18
 
19
 
40
 
41
  #innerright { position: absolute;
42
  width: 10px;
43
+ height: 35px; /* IE6 */
44
  right: -1px;
45
  bottom: 0px;
46
  background: url('images/case2-r.png') no-repeat left bottom; }
78
  #player-artist {
79
  position: absolute;
80
  font: normal normal 500 9px 'verdana', 'Lucida Grande', 'arial', sans-serif;
81
+ top: 20px;
82
  left: 24px;
83
  width: auto;
84
  color: #fff;
92
  div.jp-total-time,
93
  #status { position: absolute;
94
  font: normal normal 500 8px 'verdana', 'Lucida Grande', 'arial', sans-serif;
95
+ color: #eaeaea;
96
  top: 42px;
97
  text-align: left;
98
  z-index: 50; }
103
 
104
  div.jp-play-time { left: 95px; color: #fff; }
105
  div.jp-total-time { right: 10px; }
106
+ #status { right: 37px; width: 40px; }
107
 
108
 
109
  #status { font-size: 8px; }
243
  right: 1px;
244
  width: 108px;
245
  height:2px;
246
+ background: #999;
247
+ border: 1px solid #999;
248
+ border-right: 4px solid #999;
249
  font-size: 1px; /* IE6 */
250
  cursor: default;
251
  z-index: 150; }
255
  #sliderVolume .ui-slider-handle {
256
  height: 11px;
257
  width: 10px;
258
+ margin-left: -5px;
259
  top: -4px;
260
  border: 0px;
261
  -moz-border-radius: 2px;
278
  #bars_holder { position:absolute;
279
  top: 0px;
280
  left: 0px;
281
+ border-left: 1px solid #ccc;
282
+ width:199px;
283
  height: 55px;
284
  background: #f0f0f0;
285
  font-size: 1px; /* IE6 */
287
 
288
  #sliderPlayback { position:absolute;
289
  width: 199px;
290
+ left: 0px;
291
  top: 0px;
292
  background: transparent;
293
  font-size: 5px; /* IE6 */
316
 
317
  #loaderBar { position:absolute;
318
  top: 0px;
319
+ left: 0px;
320
  background: #ddd; }
321
 
322
  #loaderBar.ui-progressbar {
339
 
340
  div.jp-playlist { width: 199px; }
341
 
 
342
  div.jp-playlist-player div#jplayer_playlist.jp-playlist ul {
343
  list-style-type:none;
344
  margin:-1px 0 0 1px !important;
347
  border:0px solid #666;
348
  border-top:none; }
349
 
 
350
  div.jp-playlist-player div#jplayer_playlist.jp-playlist li, #playlist-wrap div.jp-playlist li {
351
  padding:0px 0px 0px 2px !important;
352
  border-bottom:1px solid #ebebeb !important;
380
  border: 0px; }
381
 
382
  div.jp-playlist-player div.jp-playlist a:hover, #playlist-wrap div.jp-playlist a:hover {
383
+ color:#808080;
384
  background: #f7f7f7; }
385
 
386
  div.jp-playlist-player div.jp-playlist a.jplayer_playlist_current, #playlist-wrap div.jp-playlist a.jplayer_playlist_current {
387
+ color:#b8a47e;
388
  background: #f4f4f4; }
389
 
390
+ /* ______________________________________________________________________ */
 
css/mp3jplayer-green.css CHANGED
@@ -1,6 +1,6 @@
1
  /* _________________________________________
2
 
3
- MP3-jPlayer CSS - Green - www.sjward.org
4
  _________________________________________
5
  */
6
 
@@ -13,7 +13,7 @@ div.jp-playlist-player {
13
  margin: 0px;
14
  font-family: Verdana, Arial, sans-serif;
15
  color: #666;
16
- width: auto;
17
  background: transparent; }
18
 
19
 
@@ -40,7 +40,7 @@ div.jp-innerwrap { position: relative;
40
 
41
  #innerright { position: absolute;
42
  width: 10px;
43
- height: 50px; /* IE6 */
44
  right: -1px;
45
  bottom: 0px;
46
  background: url('images/case2-r.png') no-repeat left bottom; }
@@ -243,8 +243,9 @@ div.jp-interface { position: relative;
243
  right: 1px;
244
  width: 108px;
245
  height:2px;
246
- background: #777;
247
- border: 1px solid #aaa;
 
248
  font-size: 1px; /* IE6 */
249
  cursor: default;
250
  z-index: 150; }
@@ -254,7 +255,7 @@ div.jp-interface { position: relative;
254
  #sliderVolume .ui-slider-handle {
255
  height: 11px;
256
  width: 10px;
257
- margin-left: -8px;
258
  top: -4px;
259
  border: 0px;
260
  -moz-border-radius: 2px;
@@ -277,7 +278,8 @@ div.jp-interface { position: relative;
277
  #bars_holder { position:absolute;
278
  top: 0px;
279
  left: 0px;
280
- width:281px;
 
281
  height: 57px;
282
  background: #f0f0f0;
283
  font-size: 1px; /* IE6 */
@@ -285,7 +287,7 @@ div.jp-interface { position: relative;
285
 
286
  #sliderPlayback { position:absolute;
287
  width: 279px;
288
- left: 1px;
289
  top: 0px;
290
  background: transparent;
291
  font-size: 5px; /* IE6 */
@@ -314,7 +316,7 @@ div.jp-interface { position: relative;
314
 
315
  #loaderBar { position:absolute;
316
  top: 0px;
317
- left: 1px;
318
  background: #ddd; }
319
 
320
  #loaderBar.ui-progressbar {
@@ -325,7 +327,7 @@ div.jp-interface { position: relative;
325
  background: #c7c7c7; }
326
 
327
  .ui-progressbar .ui-progressbar-value {margin: 0px; height:100%;
328
- background: #a3baa5; /* b0b8b1 b8 a3baa5 94c098 8dc392 83b387 b5cfb7 */
329
  }
330
 
331
  #bars_holder .ui-slider-horizontal { height: 55px; }
1
  /* _________________________________________
2
 
3
+ MP3-jPlayer - Green
4
  _________________________________________
5
  */
6
 
13
  margin: 0px;
14
  font-family: Verdana, Arial, sans-serif;
15
  color: #666;
16
+ width: 281px;
17
  background: transparent; }
18
 
19
 
40
 
41
  #innerright { position: absolute;
42
  width: 10px;
43
+ height: 41px; /* IE6 */
44
  right: -1px;
45
  bottom: 0px;
46
  background: url('images/case2-r.png') no-repeat left bottom; }
243
  right: 1px;
244
  width: 108px;
245
  height:2px;
246
+ background: #999;
247
+ border: 1px solid #999;
248
+ border-right: 4px solid #999;
249
  font-size: 1px; /* IE6 */
250
  cursor: default;
251
  z-index: 150; }
255
  #sliderVolume .ui-slider-handle {
256
  height: 11px;
257
  width: 10px;
258
+ margin-left: -5px;
259
  top: -4px;
260
  border: 0px;
261
  -moz-border-radius: 2px;
278
  #bars_holder { position:absolute;
279
  top: 0px;
280
  left: 0px;
281
+ border-left: 1px solid #ccc;
282
+ width:279px;
283
  height: 57px;
284
  background: #f0f0f0;
285
  font-size: 1px; /* IE6 */
287
 
288
  #sliderPlayback { position:absolute;
289
  width: 279px;
290
+ left: 0px;
291
  top: 0px;
292
  background: transparent;
293
  font-size: 5px; /* IE6 */
316
 
317
  #loaderBar { position:absolute;
318
  top: 0px;
319
+ left: 0px;
320
  background: #ddd; }
321
 
322
  #loaderBar.ui-progressbar {
327
  background: #c7c7c7; }
328
 
329
  .ui-progressbar .ui-progressbar-value {margin: 0px; height:100%;
330
+ background: #a3baa5;
331
  }
332
 
333
  #bars_holder .ui-slider-horizontal { height: 55px; }
css/mp3jplayer-grey-sidebar.css CHANGED
@@ -1,6 +1,6 @@
1
  /* ___________________________________________________
2
 
3
- MP3-jPlayer CSS - Neutral colours - www.sjward.org
4
  ___________________________________________________
5
  */
6
 
@@ -13,7 +13,7 @@ div.jp-playlist-player {
13
  margin: 0px;
14
  font-family: Verdana, Arial, sans-serif;
15
  color: #666;
16
- width: auto;
17
  background: transparent; }
18
 
19
 
@@ -41,7 +41,7 @@ div.jp-innerwrap { position: relative;
41
 
42
  #innerright { position: absolute;
43
  width: 10px;
44
- height: 44px; /* IE6 */
45
  right: -1px;
46
  bottom: 0px;
47
  background: url('images/case2-r.png') no-repeat left bottom; }
@@ -79,7 +79,7 @@ div.jp-interface { position: relative;
79
  #player-artist {
80
  position: absolute;
81
  font: normal normal 500 9px 'verdana', 'Lucida Grande', 'arial', sans-serif;
82
- top: 22px;
83
  left: 24px;
84
  width: auto;
85
  color: #fff;
@@ -93,7 +93,7 @@ div.jp-interface { position: relative;
93
  div.jp-total-time,
94
  #status { position: absolute;
95
  font: normal normal 500 8px 'verdana', 'Lucida Grande', 'arial', sans-serif;
96
- color: #eee;
97
  top: 42px;
98
  text-align: left;
99
  z-index: 50; }
@@ -104,15 +104,15 @@ div.jp-interface { position: relative;
104
 
105
  div.jp-play-time { left: 95px; color: #fff; }
106
  div.jp-total-time { right: 10px; }
107
- #status { right: 37px; width: 40px; color: #fff; }
108
 
109
 
110
  #status { font-size: 8px; }
111
 
112
 
113
 
114
- span.mp3-finding { background: url('../css/images/finding-bar10.gif') repeat-y -2px 3px; margin-left: -3px; padding-left: 4px; }
115
- span.mp3-loading { background: url('../css/images/finding-bar10b.gif') repeat-y -2px 3px; margin-left: -3px; padding-left: 4px; }
116
 
117
 
118
  /* transport buttons */
@@ -246,8 +246,9 @@ div.jp-interface { position: relative;
246
  right: 1px;
247
  width: 108px;
248
  height:2px;
249
- background: #777;
250
- border: 1px solid #bbb;
 
251
  font-size: 1px; /* IE6 */
252
  cursor: default;
253
  z-index: 150; }
@@ -257,7 +258,7 @@ div.jp-interface { position: relative;
257
  #sliderVolume .ui-slider-handle {
258
  height: 11px;
259
  width: 10px;
260
- margin-left: -8px;
261
  top: -4px;
262
  border: 0px;
263
  -moz-border-radius: 2px;
@@ -280,7 +281,8 @@ div.jp-interface { position: relative;
280
  #bars_holder { position:absolute;
281
  top: 0px;
282
  left: 0px;
283
- width:201px;
 
284
  height: 55px;
285
  background: #f0f0f0;
286
  font-size: 1px; /* IE6 */
@@ -288,7 +290,7 @@ div.jp-interface { position: relative;
288
 
289
  #sliderPlayback { position:absolute;
290
  width: 199px;
291
- left: 1px;
292
  top: 0px;
293
  background: transparent;
294
  font-size: 5px; /* IE6 */
@@ -317,7 +319,7 @@ div.jp-interface { position: relative;
317
 
318
  #loaderBar { position:absolute;
319
  top: 0px;
320
- left: 1px;
321
  background: #ddd; }
322
 
323
  #loaderBar.ui-progressbar {
@@ -383,11 +385,11 @@ div.jp-interface { position: relative;
383
  border: 0px; }
384
 
385
  div.jp-playlist-player div.jp-playlist a:hover, #playlist-wrap div.jp-playlist a:hover {
386
- color:#808080;
387
  background: #f7f7f7; }
388
 
389
  div.jp-playlist-player div.jp-playlist a.jplayer_playlist_current, #playlist-wrap div.jp-playlist a.jplayer_playlist_current {
390
- color:#b8a47e;
391
  background: #f4f4f4; }
392
 
393
 
1
  /* ___________________________________________________
2
 
3
+ MP3-jPlayer - Neutral colours (sidebar)
4
  ___________________________________________________
5
  */
6
 
13
  margin: 0px;
14
  font-family: Verdana, Arial, sans-serif;
15
  color: #666;
16
+ width: 201px;
17
  background: transparent; }
18
 
19
 
41
 
42
  #innerright { position: absolute;
43
  width: 10px;
44
+ height: 35px; /* IE6 */
45
  right: -1px;
46
  bottom: 0px;
47
  background: url('images/case2-r.png') no-repeat left bottom; }
79
  #player-artist {
80
  position: absolute;
81
  font: normal normal 500 9px 'verdana', 'Lucida Grande', 'arial', sans-serif;
82
+ top: 20px;
83
  left: 24px;
84
  width: auto;
85
  color: #fff;
93
  div.jp-total-time,
94
  #status { position: absolute;
95
  font: normal normal 500 8px 'verdana', 'Lucida Grande', 'arial', sans-serif;
96
+ color: #eaeaea;
97
  top: 42px;
98
  text-align: left;
99
  z-index: 50; }
104
 
105
  div.jp-play-time { left: 95px; color: #fff; }
106
  div.jp-total-time { right: 10px; }
107
+ #status { right: 37px; width: 40px; }
108
 
109
 
110
  #status { font-size: 8px; }
111
 
112
 
113
 
114
+ span.mp3-finding { background: url('../css/images/finding-bar1b.gif') repeat-y -2px 3px; margin-left: -3px; padding-left: 4px; }
115
+ span.mp3-loading { background: url('../css/images/finding-bar1b.gif') repeat-y -2px 3px; margin-left: -3px; padding-left: 4px; }
116
 
117
 
118
  /* transport buttons */
246
  right: 1px;
247
  width: 108px;
248
  height:2px;
249
+ background: #999;
250
+ border: 1px solid #999;
251
+ border-right: 4px solid #999;
252
  font-size: 1px; /* IE6 */
253
  cursor: default;
254
  z-index: 150; }
258
  #sliderVolume .ui-slider-handle {
259
  height: 11px;
260
  width: 10px;
261
+ margin-left: -5px;
262
  top: -4px;
263
  border: 0px;
264
  -moz-border-radius: 2px;
281
  #bars_holder { position:absolute;
282
  top: 0px;
283
  left: 0px;
284
+ border-left: 1px solid #ccc;
285
+ width:199px;
286
  height: 55px;
287
  background: #f0f0f0;
288
  font-size: 1px; /* IE6 */
290
 
291
  #sliderPlayback { position:absolute;
292
  width: 199px;
293
+ left: 0px;
294
  top: 0px;
295
  background: transparent;
296
  font-size: 5px; /* IE6 */
319
 
320
  #loaderBar { position:absolute;
321
  top: 0px;
322
+ left: 0px;
323
  background: #ddd; }
324
 
325
  #loaderBar.ui-progressbar {
385
  border: 0px; }
386
 
387
  div.jp-playlist-player div.jp-playlist a:hover, #playlist-wrap div.jp-playlist a:hover {
388
+ color:#606060;
389
  background: #f7f7f7; }
390
 
391
  div.jp-playlist-player div.jp-playlist a.jplayer_playlist_current, #playlist-wrap div.jp-playlist a.jplayer_playlist_current {
392
+ color:#bbb; /* b8a47e */
393
  background: #f4f4f4; }
394
 
395
 
css/mp3jplayer-grey.css CHANGED
@@ -1,6 +1,6 @@
1
  /* ___________________________________________________
2
 
3
- MP3-jPlayer CSS - Neutral colours - www.sjward.org
4
  ___________________________________________________
5
  */
6
 
@@ -13,7 +13,7 @@ div.jp-playlist-player {
13
  margin: 0px;
14
  font-family: Verdana, Arial, sans-serif;
15
  color: #666;
16
- width: auto;
17
  background: transparent; }
18
 
19
 
@@ -41,7 +41,7 @@ div.jp-innerwrap { position: relative;
41
 
42
  #innerright { position: absolute;
43
  width: 10px;
44
- height: 50px; /* IE6 */
45
  right: -1px;
46
  bottom: 0px;
47
  background: url('images/case2-r.png') no-repeat left bottom; }
@@ -111,8 +111,8 @@ div.jp-interface { position: relative;
111
 
112
 
113
 
114
- span.mp3-finding { background: url('../css/images/finding-bar10.gif') repeat-y -2px 3px; margin-left: -3px; padding-left: 4px; }
115
- span.mp3-loading { background: url('../css/images/finding-bar10b.gif') repeat-y -2px 3px; margin-left: -3px; padding-left: 4px; }
116
 
117
 
118
  /* transport buttons */
@@ -246,8 +246,9 @@ div.jp-interface { position: relative;
246
  right: 1px;
247
  width: 108px;
248
  height:2px;
249
- background: #777;
250
- border: 1px solid #bbb;
 
251
  font-size: 1px; /* IE6 */
252
  cursor: default;
253
  z-index: 150; }
@@ -257,7 +258,7 @@ div.jp-interface { position: relative;
257
  #sliderVolume .ui-slider-handle {
258
  height: 11px;
259
  width: 10px;
260
- margin-left: -8px;
261
  top: -4px;
262
  border: 0px;
263
  -moz-border-radius: 2px;
@@ -280,7 +281,8 @@ div.jp-interface { position: relative;
280
  #bars_holder { position:absolute;
281
  top: 0px;
282
  left: 0px;
283
- width:281px;
 
284
  height: 57px;
285
  background: #f0f0f0;
286
  font-size: 1px; /* IE6 */
@@ -288,7 +290,7 @@ div.jp-interface { position: relative;
288
 
289
  #sliderPlayback { position:absolute;
290
  width: 279px;
291
- left: 1px;
292
  top: 0px;
293
  background: transparent;
294
  font-size: 5px; /* IE6 */
@@ -317,7 +319,7 @@ div.jp-interface { position: relative;
317
 
318
  #loaderBar { position:absolute;
319
  top: 0px;
320
- left: 1px;
321
  background: #ddd; }
322
 
323
  #loaderBar.ui-progressbar {
@@ -381,13 +383,14 @@ div.jp-interface { position: relative;
381
  font-weight: 500;
382
  background-image: none;
383
  border: 0px; }
 
384
 
385
  div.jp-playlist-player div.jp-playlist a:hover, #playlist-wrap div.jp-playlist a:hover {
386
- color:#808080;
387
  background: #f7f7f7; }
388
 
389
  div.jp-playlist-player div.jp-playlist a.jplayer_playlist_current, #playlist-wrap div.jp-playlist a.jplayer_playlist_current {
390
- color:#b8a47e;
391
  background: #f4f4f4; }
392
 
393
 
1
  /* ___________________________________________________
2
 
3
+ MP3-jPlayer - Neutral colours
4
  ___________________________________________________
5
  */
6
 
13
  margin: 0px;
14
  font-family: Verdana, Arial, sans-serif;
15
  color: #666;
16
+ width: 281px;
17
  background: transparent; }
18
 
19
 
41
 
42
  #innerright { position: absolute;
43
  width: 10px;
44
+ height: 41px; /* IE6 */
45
  right: -1px;
46
  bottom: 0px;
47
  background: url('images/case2-r.png') no-repeat left bottom; }
111
 
112
 
113
 
114
+ span.mp3-finding { background: url('../css/images/finding-bar1b.gif') repeat-y -2px 3px; margin-left: -3px; padding-left: 4px; }
115
+ span.mp3-loading { background: url('../css/images/finding-bar1b.gif') repeat-y -2px 3px; margin-left: -3px; padding-left: 4px; }
116
 
117
 
118
  /* transport buttons */
246
  right: 1px;
247
  width: 108px;
248
  height:2px;
249
+ background: #999;
250
+ border: 1px solid #999;
251
+ border-right: 4px solid #999;
252
  font-size: 1px; /* IE6 */
253
  cursor: default;
254
  z-index: 150; }
258
  #sliderVolume .ui-slider-handle {
259
  height: 11px;
260
  width: 10px;
261
+ margin-left: -5px;
262
  top: -4px;
263
  border: 0px;
264
  -moz-border-radius: 2px;
281
  #bars_holder { position:absolute;
282
  top: 0px;
283
  left: 0px;
284
+ border-left: 1px solid #ccc;
285
+ width:279px;
286
  height: 57px;
287
  background: #f0f0f0;
288
  font-size: 1px; /* IE6 */
290
 
291
  #sliderPlayback { position:absolute;
292
  width: 279px;
293
+ left: 0px;
294
  top: 0px;
295
  background: transparent;
296
  font-size: 5px; /* IE6 */
319
 
320
  #loaderBar { position:absolute;
321
  top: 0px;
322
+ left: 0px;
323
  background: #ddd; }
324
 
325
  #loaderBar.ui-progressbar {
383
  font-weight: 500;
384
  background-image: none;
385
  border: 0px; }
386
+
387
 
388
  div.jp-playlist-player div.jp-playlist a:hover, #playlist-wrap div.jp-playlist a:hover {
389
+ color:#606060;
390
  background: #f7f7f7; }
391
 
392
  div.jp-playlist-player div.jp-playlist a.jplayer_playlist_current, #playlist-wrap div.jp-playlist a.jplayer_playlist_current {
393
+ color:#bbb; /* b8a47e */
394
  background: #f4f4f4; }
395
 
396
 
css/mp3jplayer-text-sidebar.css ADDED
@@ -0,0 +1,349 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* _________________________________________
2
+
3
+ MP3-jPlayer - Text player (sidebar)
4
+ _________________________________________
5
+ */
6
+
7
+ div.jp-playlist-player {
8
+
9
+ /* NOTE position or float is set at the admin panel */
10
+ border: 0 !important;
11
+ margin: 0 !important;
12
+ padding: 0 !important;
13
+ width: 211px;
14
+ background: transparent;
15
+ font-family: 'trebuchet ms', Arial, sans-serif; }
16
+
17
+
18
+ /* skin
19
+ ----------------------------------------- */
20
+ div.jp-innerwrap { position: relative;
21
+ background: transparent; }
22
+
23
+ #innerx { position: absolute;
24
+ visibility: hidden; }
25
+ #innerleft { position: absolute;
26
+ visibility: hidden; }
27
+ #innerright { position: absolute;
28
+ visibility: hidden; }
29
+ #innertab { position: absolute;
30
+ visibility: hidden; }
31
+
32
+
33
+ /* interface
34
+ ----------------------------------------- */
35
+ div.jp-interface {
36
+ position: relative !important;
37
+ width: 211px !important;
38
+ height: 85px !important;
39
+ border: 0 !important;
40
+ cursor: default !important;
41
+ }
42
+
43
+ /* display */
44
+
45
+ #player-track-title {
46
+ position: absolute;
47
+ top: 3px;
48
+ left: 18px;
49
+ font-size: 14px;
50
+ width: auto;
51
+ max-width: 206px;
52
+ white-space: nowrap;
53
+ /*overflow: hidden;*/
54
+ z-index: 50;
55
+ font-family: 'trebuchet ms', Arial, sans-serif;
56
+ }
57
+
58
+ #player-artist {
59
+ position: absolute;
60
+ top: 21px;
61
+ left: 18px;
62
+ width: auto;
63
+ max-width: 190px;
64
+ padding: 0px 0px 0px 0px;
65
+ font-size: 11px;
66
+ font-style: italic;
67
+ opacity:0.5;
68
+ filter:alpha(opacity=50);
69
+ white-space: nowrap;
70
+ /*overflow: hidden;*/
71
+ z-index: 50;
72
+ font-family: 'trebuchet ms', Arial, sans-serif;
73
+ }
74
+
75
+
76
+ div.jp-play-time,
77
+ div.jp-total-time,
78
+ #status { position: absolute !important;
79
+ left: 0px !important;
80
+ margin:0px !important;
81
+ padding:0px !important;
82
+ text-align: left;
83
+ font-size: 11px;
84
+ z-index: 50;
85
+ font-family: 'trebuchet ms', Arial, sans-serif;
86
+ }
87
+
88
+ div.jp-play-time { top: 48px !important; width:37px; opacity:0.6; filter:alpha(opacity=60) }
89
+ div.jp-total-time { top: 63px; width:37px; visibility:hidden; }
90
+ #status { top: 48px !important; left: 35px !important; }
91
+
92
+ span.mp3-finding { background: url('../css/images/finding-bar1b.gif') repeat-y -4px 3px; margin-left: -3px; padding-left: 4px; }
93
+ span.mp3-loading { background: url('../css/images/finding-bar1b.gif') repeat-y -4px 3px; margin-left: -3px; padding-left: 4px; }
94
+
95
+ /* transport buttons */
96
+ div.jp-interface ul.jp-controls {
97
+ list-style-type:none;
98
+ padding:0;
99
+ margin: 0px 0px 0px 0px !important; }
100
+
101
+ div.jp-interface ul.jp-controls li {
102
+ position: absolute;
103
+ margin: 0px;
104
+ padding: 0px;
105
+ list-style-type:none !important;
106
+ font-family: 'trebuchet ms', Arial, sans-serif; }
107
+
108
+ div.jp-interface ul.jp-controls a, div.jp-interface ul.jp-controls a:hover {
109
+ display: block;
110
+ position: absolute;
111
+ overflow:hidden;
112
+ text-indent:0px;
113
+ outline: none;
114
+ margin: 0px;
115
+ padding: 0px;
116
+ border-bottom: none !important;
117
+ font-family: 'trebuchet ms', Arial, sans-serif; }
118
+
119
+ a.jp-play, a.jp-pause, a.jp-stop, a.jp-previous, a.jp-next {
120
+ top: 47px;
121
+ width:auto;
122
+ height:auto;
123
+ border: 0;
124
+ cursor: default;
125
+ border-bottom: none !important;
126
+ background:none !important;
127
+ font-family: 'trebuchet ms', Arial, sans-serif; }
128
+
129
+
130
+ a.jp-play { left: 184px; font-size: 14px; }
131
+ a.jp-pause { left: 175px; font-size: 13px; }
132
+ a.jp-stop { visibility: hidden; left: 50px; font-size: 14px; }
133
+ a.jp-previous { left:108px; font-size: 11px; top: 48px; }
134
+ a.jp-next { left:140px; font-size: 11px; top: 48px; }
135
+
136
+
137
+ /* other buttons*/
138
+ #playlist-toggle {
139
+ position: absolute;
140
+ top: 63px;
141
+ right: 1px;
142
+ width: auto;
143
+ font-size: 10px;
144
+ opacity:0.7;
145
+ filter:alpha(opacity=70);
146
+ font-family: 'trebuchet ms', Arial, sans-serif;
147
+ }
148
+
149
+ #playlist-toggle:hover {
150
+ /*color: #888;*/
151
+ opacity:1.0;
152
+ filter:alpha(opacity=100);
153
+ }
154
+
155
+ #downloadmp3-button {
156
+ position: absolute;
157
+ font-size: 11px;
158
+ top: 63px;
159
+ left: 0px !important;
160
+ margin:0;
161
+ font-family: 'trebuchet ms', Arial, sans-serif;
162
+ }
163
+
164
+ #downloadmp3-button.betweenlinks { }
165
+ #downloadmp3-button.whilelinks { }
166
+ #downloadmp3-button.whilelinks:hover { }
167
+
168
+ #downloadmp3-button a { font-size: 10px; margin:0px !important; padding: 0px !important; background:none; border:none; }
169
+ #downloadmp3-button a:hover { background:none; }
170
+
171
+ #downloadmp3-button.betweenlinks a { display: none; }
172
+ #downloadmp3-button.whilelinks a { display: block; }
173
+ #downloadmp3-button.whilelinks a:hover { }
174
+
175
+
176
+
177
+
178
+ /* sliders/bars */
179
+ .ui-state-disabled { cursor: default !important; }
180
+ .ui-slider { position: relative; text-align: left; }
181
+ .ui-slider .ui-slider-handle { position: absolute; z-index: 100; width: 1.2em; height: 1.2em; cursor: default; }
182
+ .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; }
183
+ .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
184
+ .ui-slider-horizontal .ui-slider-range-min { left: 0; }
185
+ .ui-slider-horizontal .ui-slider-range-max { right: 0; }
186
+
187
+ .ui-state-default, .ui-widget-content .ui-state-default {
188
+ outline: none;
189
+ border: 0px;
190
+ }
191
+
192
+
193
+ .ui-widget-header { border: 0px solid #888;
194
+ border-left: 0px;
195
+ border-right: 0px;
196
+ background: url('images/t3b.png') repeat left top;
197
+ color: #888;
198
+ font-weight: bold; }
199
+
200
+ #sliderVolume { position:absolute;
201
+ top:43px;
202
+ right: 5px;
203
+ width: 96px;
204
+ height:2px;
205
+ background: transparent;
206
+ border: 0px solid #999;
207
+ font-size: 1px; /* IE6 */
208
+ cursor: default;
209
+ z-index: 150; }
210
+
211
+ #sliderVolume .ui-widget-header { background: transparent; }
212
+
213
+ #sliderVolume .ui-slider-handle {
214
+ height: 11px;
215
+ width: 10px !important;
216
+ padding:0 !important;
217
+ margin-left: -5px;
218
+ top: -4px;
219
+ border: 0px !important;
220
+ -moz-border-radius: 2px !important;
221
+ -webkit-border-radius: 2px !important;
222
+ background: transparent url('images/vol-handleT.gif') no-repeat -1px 0px;
223
+ z-index: 150;
224
+ overflow:hidden !important;
225
+ cursor: default; }
226
+
227
+ #sliderVolume .ui-slider-handle:hover {
228
+ border-color: #888;
229
+ background: #606060;
230
+ background: transparent url('images/vol-handleH.gif') no-repeat -1px 0px; }
231
+
232
+ #sliderVolume .ui-state-active,
233
+ #sliderVolume .ui-widget-content .ui-state-active {
234
+ border: 0px solid #777;
235
+ background: transparent url('images/vol-handleH.gif') no-repeat -1px 0px;
236
+ outline: none; }
237
+
238
+ #bars_holder { position:absolute;
239
+ top: 0px;
240
+ left: 0px;
241
+ width:209px;
242
+ height: 45px;
243
+ border-bottom: 1px solid #f2f2f2;
244
+ font-size: 1px; /* IE6 */
245
+ cursor: default; }
246
+
247
+ #sliderPlayback { position:absolute;
248
+ width: 209px;
249
+ left: 0px;
250
+ top: 0px;
251
+ font-size: 5px; /* IE6 */
252
+ }
253
+
254
+ #sliderPlayback .ui-slider-handle {
255
+ top: 0px;
256
+ margin-left: -10px !important;
257
+ border: 0px;
258
+ height: 45px;
259
+ width: 20px !important;
260
+ z-index: 100;
261
+ cursor: e-resize;
262
+ background:none;
263
+ padding:0px !important; }
264
+
265
+ #sliderPlayback .ui-slider-handle:hover { background:none; }
266
+
267
+ #sliderPlayback .ui-state-active, #sliderPlayback .ui-widget-content .ui-state-active {
268
+ outline: none;
269
+ z-index: 100;
270
+ background:none; }
271
+
272
+ #loaderBar { position:absolute;
273
+ top: 0px;
274
+ left: 0px;
275
+ background: transparent; }
276
+
277
+ #loaderBar.ui-progressbar {
278
+ text-align: left;
279
+ height: 45px;
280
+ width: 211px; }
281
+
282
+ .ui-progressbar .ui-progressbar-value {margin: 0px; height:100%;
283
+ background: url('images/t2b.png') repeat right top;
284
+ }
285
+
286
+ #bars_holder .ui-slider-horizontal { height: 45px; }
287
+
288
+
289
+ /* playlist
290
+ ----------------------------------------- */
291
+
292
+ #playlist-wrap {
293
+ position: relative;
294
+ border-top: 1px solid #f6f6f6;
295
+ }
296
+
297
+ div.jp-playlist { width: 209px; }
298
+
299
+ div.jp-playlist-player div#jplayer_playlist.jp-playlist ul {
300
+ list-style-type:none;
301
+ margin:0px 0 0 0px !important;
302
+ padding:10px 0px 0px 0px !important;
303
+ border:0px solid #666;
304
+ border-top:none; }
305
+
306
+
307
+ div.jp-playlist-player div#jplayer_playlist.jp-playlist li, #playlist-wrap div.jp-playlist li {
308
+ padding:0px 0px 0px 2px !important;
309
+ font-size: 13px;
310
+ letter-spacing: 0px;
311
+ word-spacing: 0px;
312
+ margin: 0px;
313
+ list-style-type:none !important;
314
+ font-family: 'trebuchet ms', Arial, sans-serif; }
315
+
316
+ div.jp-playlist-player div.jp-playlist li.jplayer_playlist_item_last { border-bottom:none; background-image: none; }
317
+ div.jp-playlist-player div.jp-playlist li.jplayer_playlist_current {
318
+ background-image: none;
319
+ opacity:0.5;
320
+ filter:alpha(opacity=50);
321
+ }
322
+
323
+
324
+ div.jp-playlist-player div.jp-playlist a, #playlist-wrap div.jp-playlist a {
325
+ /*display: block !important;
326
+ padding: 5px 0px 4px 20px !important;*/
327
+ width: auto;
328
+ white-space: nowrap;
329
+ overflow: hidden !important;
330
+ outline: none;
331
+ margin: 0px !important;
332
+ padding-left: 0px !important;
333
+ font-weight: 500;
334
+ background:none;
335
+ border: 0px;
336
+ font-family: 'trebuchet ms', Arial, sans-serif; }
337
+
338
+ div.jp-playlist-player div.jp-playlist a:hover, #playlist-wrap div.jp-playlist a:hover {
339
+ background:none !important;
340
+ }
341
+
342
+ div.jp-playlist-player div.jp-playlist a.jplayer_playlist_current, #playlist-wrap div.jp-playlist a.jplayer_playlist_current {
343
+ background:none !important;
344
+ color: #666;
345
+ }
346
+
347
+
348
+
349
+ /* ______________________________________________________________________ */
css/mp3jplayer-text.css ADDED
@@ -0,0 +1,348 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* _________________________________________
2
+
3
+ MP3-jPlayer - Text player
4
+ _________________________________________
5
+ */
6
+
7
+ div.jp-playlist-player {
8
+
9
+ /* NOTE position or float is set at the admin panel */
10
+ border: 0;
11
+ margin: 0;
12
+ font-family: 'trebuchet ms', Arial, sans-serif;
13
+ width: 281px;
14
+ background: transparent; }
15
+
16
+
17
+ /* skin
18
+ ----------------------------------------- */
19
+ div.jp-innerwrap { position: relative;
20
+ background: transparent; }
21
+
22
+ #innerx { position: absolute;
23
+ visibility: hidden; }
24
+ #innerleft { position: absolute;
25
+ visibility: hidden; }
26
+ #innerright { position: absolute;
27
+ visibility: hidden; }
28
+ #innertab { position: absolute;
29
+ visibility: hidden; }
30
+
31
+
32
+ /* interface
33
+ ----------------------------------------- */
34
+ div.jp-interface {
35
+ position: relative;
36
+ width: 281px;
37
+ height: 84px;
38
+ border: 0;
39
+ cursor: default;
40
+ }
41
+
42
+ /* display */
43
+
44
+ #player-track-title {
45
+ position: absolute;
46
+ top: 3px;
47
+ left: 19px;
48
+ font-size: 15px;
49
+ width: auto;
50
+ max-width: 262px;
51
+ white-space: nowrap;
52
+ /*overflow: hidden;*/
53
+ z-index: 50;
54
+ font-family: 'trebuchet ms', Arial, sans-serif;
55
+ }
56
+
57
+ #player-artist {
58
+ position: absolute;
59
+ top: 21px;
60
+ left: 38px;
61
+ width: auto;
62
+ max-width: 240px;
63
+ padding: 0px 0px 0px 0px;
64
+ font-size: 12px;
65
+ font-style: italic;
66
+ opacity:0.5;
67
+ filter:alpha(opacity=50);
68
+ white-space: nowrap;
69
+ /*overflow: hidden;*/
70
+ z-index: 50;
71
+ font-family: 'trebuchet ms', Arial, sans-serif;
72
+ }
73
+
74
+
75
+ div.jp-play-time,
76
+ div.jp-total-time,
77
+ #status { position: absolute;
78
+ left: 0px;
79
+ text-align: left;
80
+ font-size: 11px;
81
+ z-index: 50;
82
+ font-family: 'trebuchet ms', Arial, sans-serif;
83
+ }
84
+
85
+ div.jp-play-time { top: 48px; width:37px; opacity:0.6; filter:alpha(opacity=60); }
86
+ div.jp-total-time { top: 63px; width:37px; visibility:hidden; }
87
+ #status { top: 48px; left: 35px;; }
88
+
89
+ span.mp3-finding { background: url('../css/images/finding-bar1b.gif') repeat-y -4px 3px; margin-left: -3px; padding-left: 4px; }
90
+ span.mp3-loading { background: url('../css/images/finding-bar1b.gif') repeat-y -4px 3px; margin-left: -3px; padding-left: 4px; }
91
+
92
+ /* transport buttons */
93
+ div.jp-interface ul.jp-controls {
94
+ list-style-type:none;
95
+ padding:0;
96
+ margin: 0px 0px 0px 0px !important; }
97
+
98
+ div.jp-interface ul.jp-controls li {
99
+ position: absolute;
100
+ margin: 0px;
101
+ padding: 0px;
102
+ list-style-type:none !important;
103
+ font-family: 'trebuchet ms', Arial, sans-serif; }
104
+
105
+ div.jp-interface ul.jp-controls a, div.jp-interface ul.jp-controls a:hover {
106
+ display: block;
107
+ position: absolute;
108
+ overflow:hidden;
109
+ text-indent:0px;
110
+ outline: none;
111
+ margin: 0px;
112
+ padding: 0px;
113
+ border-bottom: none !important;
114
+ font-family: 'trebuchet ms', Arial, sans-serif; }
115
+
116
+ a.jp-play, a.jp-pause, a.jp-stop, a.jp-previous, a.jp-next {
117
+ top: 47px;
118
+ width:auto;
119
+ height:auto;
120
+ border: 0;
121
+ cursor: default;
122
+ border-bottom: none !important;
123
+ background:none !important;
124
+ font-family: 'trebuchet ms', Arial, sans-serif; }
125
+
126
+
127
+ a.jp-play { left: 254px; font-size: 14px; }
128
+ a.jp-pause { left: 243px; font-size: 14px; }
129
+ a.jp-stop { visibility: hidden; left: 50px; font-size: 14px; }
130
+ a.jp-previous { left:178px; font-size: 11px; top: 48px; }
131
+ a.jp-next { left:210px; font-size: 11px; top: 48px; }
132
+
133
+
134
+ /* other buttons*/
135
+ #playlist-toggle {
136
+ position: absolute;
137
+ top: 63px;
138
+ right: 1px;
139
+ width: auto;
140
+ font-size: 10px;
141
+ opacity:0.7;
142
+ filter:alpha(opacity=70);
143
+ font-family: 'trebuchet ms', Arial, sans-serif;
144
+ }
145
+
146
+ #playlist-toggle:hover {
147
+ opacity:1.0;
148
+ filter:alpha(opacity=100);
149
+ }
150
+
151
+ #downloadmp3-button {
152
+ position: absolute;
153
+ font-size: 12px;
154
+ top: 63px;
155
+ left: 0px !important;
156
+ margin:0;
157
+ font-family: 'trebuchet ms', Arial, sans-serif;
158
+ }
159
+
160
+ #downloadmp3-button.betweenlinks { }
161
+ #downloadmp3-button.whilelinks { }
162
+ #downloadmp3-button.whilelinks:hover { }
163
+
164
+ #downloadmp3-button a { font-size: 11px; margin:0px !important; padding: 0px !important; background:none; }
165
+ #downloadmp3-button a:hover { background:none; }
166
+
167
+ #downloadmp3-button.betweenlinks a { display: none; }
168
+ #downloadmp3-button.whilelinks a { display: block; }
169
+ #downloadmp3-button.whilelinks a:hover { }
170
+
171
+
172
+
173
+
174
+ /* sliders/bars */
175
+ .ui-state-disabled { cursor: default !important; }
176
+ .ui-slider { position: relative; text-align: left; }
177
+ .ui-slider .ui-slider-handle { position: absolute; z-index: 100; width: 1.2em; height: 1.2em; cursor: default; }
178
+ .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; }
179
+ .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
180
+ .ui-slider-horizontal .ui-slider-range-min { left: 0; }
181
+ .ui-slider-horizontal .ui-slider-range-max { right: 0; }
182
+
183
+ .ui-state-default, .ui-widget-content .ui-state-default {
184
+ outline: none;
185
+ border: 0px;
186
+ }
187
+
188
+
189
+ .ui-widget-header { border: 0px solid #888;
190
+ border-left: 0px;
191
+ border-right: 0px;
192
+ background: url('images/t3b.png') repeat left top;
193
+ color: #888;
194
+ font-weight: bold; }
195
+
196
+ #sliderVolume { position:absolute;
197
+ top:43px;
198
+ right: 5px;
199
+ width: 96px;
200
+ height:2px;
201
+ background: transparent;
202
+ border: 0px solid #999;
203
+ font-size: 1px; /* IE6 */
204
+ cursor: default;
205
+ z-index: 150; }
206
+
207
+ #sliderVolume .ui-widget-header { background: transparent; }
208
+
209
+ #sliderVolume .ui-slider-handle {
210
+ height: 11px;
211
+ width: 10px !important;
212
+ padding:0 !important;
213
+ margin-left: -5px;
214
+ top: -4px;
215
+ border: 0px !important;
216
+ -moz-border-radius: 2px !important;
217
+ -webkit-border-radius: 2px !important;
218
+ background: transparent url('images/vol-handleT.gif') no-repeat -1px 0px;
219
+ z-index: 150;
220
+ overflow:hidden !important;
221
+ cursor: default; }
222
+
223
+ #sliderVolume .ui-slider-handle:hover {
224
+ border-color: #888;
225
+ background: #606060;
226
+ background: transparent url('images/vol-handleH.gif') no-repeat -1px 0px; }
227
+
228
+ #sliderVolume .ui-state-active,
229
+ #sliderVolume .ui-widget-content .ui-state-active {
230
+ border: 0px solid #777;
231
+ background: transparent url('images/vol-handleH.gif') no-repeat -1px 0px;
232
+ outline: none; }
233
+
234
+ #bars_holder { position:absolute;
235
+ top: 0px;
236
+ left: 0px;
237
+ width:279px;
238
+ height: 45px;
239
+ border-bottom: 1px solid #f2f2f2;
240
+ font-size: 1px; /* IE6 */
241
+ cursor: default; }
242
+
243
+ #sliderPlayback { position:absolute;
244
+ width: 279px;
245
+ left: 0px;
246
+ top: 0px;
247
+ font-size: 5px; /* IE6 */
248
+ }
249
+
250
+ #sliderPlayback .ui-slider-handle {
251
+ top: 0px;
252
+ margin-left: -10px !important;
253
+ border: 0px;
254
+ height: 45px;
255
+ width: 20px !important;
256
+ z-index: 100;
257
+ cursor: e-resize;
258
+ background:none;
259
+ padding:0px !important; }
260
+
261
+ #sliderPlayback .ui-slider-handle:hover { background:none; }
262
+
263
+ #sliderPlayback .ui-state-active, #sliderPlayback .ui-widget-content .ui-state-active {
264
+ outline: none;
265
+ z-index: 100;
266
+ background:none; }
267
+
268
+ #loaderBar { position:absolute;
269
+ top: 0px;
270
+ left: 0px;
271
+ background: transparent; }
272
+
273
+ #loaderBar.ui-progressbar {
274
+ text-align: left;
275
+ height: 45px;
276
+ width: 281px; }
277
+
278
+ .ui-progressbar .ui-progressbar-value {margin: 0px; height:100%;
279
+ background: url('images/t2b.png') repeat right top;
280
+ }
281
+
282
+ #bars_holder .ui-slider-horizontal { height: 45px; }
283
+
284
+
285
+ /* playlist
286
+ ----------------------------------------- */
287
+
288
+ #playlist-wrap {
289
+ position: relative;
290
+ border-top: 1px solid #f6f6f6;
291
+ }
292
+
293
+ div.jp-playlist { width: 279px; }
294
+
295
+ div.jp-playlist-player div#jplayer_playlist.jp-playlist ul {
296
+ list-style-type:none !important;
297
+ margin:0px 0 0 0px !important;
298
+ padding:10px 0px 0px 0px !important;
299
+ border:0px solid #666;
300
+ border-top:none;
301
+ }
302
+
303
+
304
+ div.jp-playlist-player div#jplayer_playlist.jp-playlist li, #playlist-wrap div.jp-playlist li {
305
+ padding:0px 0px 0px 2px !important;
306
+ font-size: 13px;
307
+ letter-spacing: 0px;
308
+ word-spacing: 0px;
309
+ margin: 0px !important;
310
+ background-image: none;
311
+ list-style-type:none !important;
312
+ font-family: 'trebuchet ms', Arial, sans-serif;
313
+ }
314
+
315
+ div.jp-playlist-player div.jp-playlist li.jplayer_playlist_item_last { border-bottom:none; background-image: none; }
316
+
317
+ div.jp-playlist-player div.jp-playlist li.jplayer_playlist_current {
318
+ background-image: none;
319
+ opacity:0.5;
320
+ filter:alpha(opacity=50);
321
+ }
322
+
323
+ div.jp-playlist-player div.jp-playlist a, #playlist-wrap div.jp-playlist a {
324
+ width: auto;
325
+ white-space: nowrap;
326
+ overflow: hidden !important;
327
+ outline: none;
328
+ margin: 0px !important;
329
+ padding-left: 0px !important;
330
+ font-weight: 500;
331
+ background-image: none;
332
+ border: 0px;
333
+ font-family: 'trebuchet ms', Arial, sans-serif;
334
+ }
335
+
336
+ div.jp-playlist-player div.jp-playlist a:hover, #playlist-wrap div.jp-playlist a:hover {
337
+ background:none !important;
338
+ }
339
+
340
+ div.jp-playlist-player div.jp-playlist a.jplayer_playlist_current, #playlist-wrap div.jp-playlist a.jplayer_playlist_current {
341
+ background:none !important;
342
+ cursor:default;
343
+ color: #666;
344
+ }
345
+
346
+
347
+
348
+ /* ______________________________________________________________________ */
js/mp3-jplayer.js CHANGED
@@ -1,5 +1,5 @@
1
  <!--
2
- // MP3-jPlayer for Wordpress version 1.3.3.12
3
  // www.sjward.org
4
 
5
  var foxcurrentstate = "open";
@@ -24,7 +24,7 @@ function toggleplaylist(){
24
  if (foxcurrentstate == "closed") {
25
  jQuery("#" + foxtogglediv).fadeIn("slow");
26
  jQuery("#" + foxtogglebutton).empty();
27
- jQuery("#" + foxtogglebutton).append('HIDE&nbsp;');
28
  foxcurrentstate = "open"
29
  return;
30
  }
@@ -32,20 +32,19 @@ function toggleplaylist(){
32
 
33
  jQuery(document).ready(function(){
34
 
35
-
36
- if (document.images) { pic1= new Image(138,32); pic1.src=foxpathtoimages+"buttons.png";
37
- pic2= new Image(138,32); pic2.src=foxpathtoimages+"buttonsH.png";
 
 
38
  pic3= new Image(12,13); pic3.src=foxpathtoimages+"pos-handle.gif";
39
  pic4= new Image(12,13); pic4.src=foxpathtoimages+"pos-handleH.gif";
40
  pic5= new Image(12,13); pic5.src=foxpathtoimages+"pos-handle3.gif";
41
  pic6= new Image(12,13); pic6.src=foxpathtoimages+"pos-handle3H.gif";
42
  pic7= new Image(12,13); pic7.src=foxpathtoimages+"vol-handle2.gif";
43
  pic8= new Image(12,13); pic8.src=foxpathtoimages+"vol-handleH.gif";
44
- pic9= new Image(138,32); pic9.src=foxpathtoimages+"buttons2.png";
45
- pic10= new Image(138,32); pic10.src=foxpathtoimages+"buttons2H.png";
46
  }
47
 
48
-
49
  var playItem = 0;
50
  var global_lp = 0;
51
  var jpPlayTime = jQuery("#jplayer_play_time");
@@ -154,7 +153,6 @@ jQuery(document).ready(function(){
154
  jQuery(this).blur();
155
  return false;
156
  });
157
-
158
  function displayPlayList() {
159
  jQuery("#jplayer_playlist ul").empty();
160
  for (i=0; i < foxPlayList.length; i++) {
@@ -205,11 +203,9 @@ jQuery(document).ready(function(){
205
  var index = (playItem-1 >= 0) ? playItem-1 : foxPlayList.length-1;
206
  playListChange( index );
207
  }
208
-
209
  if (foxShowPlaylist == "false"){
210
  foxtogglecount = 1;
211
  toggleplaylist();
212
  }
213
-
214
  });
215
  //-->
1
  <!--
2
+ // MP3-jPlayer 1.4.0
3
  // www.sjward.org
4
 
5
  var foxcurrentstate = "open";
24
  if (foxcurrentstate == "closed") {
25
  jQuery("#" + foxtogglediv).fadeIn("slow");
26
  jQuery("#" + foxtogglebutton).empty();
27
+ jQuery("#" + foxtogglebutton).append('HIDE');
28
  foxcurrentstate = "open"
29
  return;
30
  }
32
 
33
  jQuery(document).ready(function(){
34
 
35
+ if ( typeof foxPlayList == "undefined" ) {
36
+ return;
37
+ }
38
+ if (document.images) { pic1= new Image(138,32); pic1.src=foxpathtoimages+"buttons2.png";
39
+ pic2= new Image(138,32); pic2.src=foxpathtoimages+"buttons2H.png";
40
  pic3= new Image(12,13); pic3.src=foxpathtoimages+"pos-handle.gif";
41
  pic4= new Image(12,13); pic4.src=foxpathtoimages+"pos-handleH.gif";
42
  pic5= new Image(12,13); pic5.src=foxpathtoimages+"pos-handle3.gif";
43
  pic6= new Image(12,13); pic6.src=foxpathtoimages+"pos-handle3H.gif";
44
  pic7= new Image(12,13); pic7.src=foxpathtoimages+"vol-handle2.gif";
45
  pic8= new Image(12,13); pic8.src=foxpathtoimages+"vol-handleH.gif";
 
 
46
  }
47
 
 
48
  var playItem = 0;
49
  var global_lp = 0;
50
  var jpPlayTime = jQuery("#jplayer_play_time");
153
  jQuery(this).blur();
154
  return false;
155
  });
 
156
  function displayPlayList() {
157
  jQuery("#jplayer_playlist ul").empty();
158
  for (i=0; i < foxPlayList.length; i++) {
203
  var index = (playItem-1 >= 0) ? playItem-1 : foxPlayList.length-1;
204
  playListChange( index );
205
  }
 
206
  if (foxShowPlaylist == "false"){
207
  foxtogglecount = 1;
208
  toggleplaylist();
209
  }
 
210
  });
211
  //-->
js/ui.core.js CHANGED
@@ -1,9 +1,10 @@
1
- /*
2
- * jQuery UI 1.7.3
3
- *
4
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
5
- * Dual licensed under the MIT (MIT-LICENSE.txt)
6
- * and GPL (GPL-LICENSE.txt) licenses.
7
- *
8
- * http://docs.jquery.com/UI
9
- */
 
1
+ /*
2
+ * jQuery UI 1.7.3
3
+ *
4
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
6
+ * and GPL (GPL-LICENSE.txt) licenses.
7
+ *
8
+ * http://docs.jquery.com/UI
9
+ */
10
+ jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.3",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m<n.length;m++){if(j.options[n[m][0]]){n[m][1].apply(j.element,k)}}}},contains:function(k,j){return document.compareDocumentPosition?k.compareDocumentPosition(j)&16:k!==j&&k.contains(j)},hasScroll:function(m,k){if(c(m).css("overflow")=="hidden"){return false}var j=(k&&k=="left")?"scrollLeft":"scrollTop",l=false;if(m[j]>0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(j,k){return this.each(function(){if(!k){if(!j||c.filter(j,[this]).length){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")})}}return i.call(c(this),j,k)})},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);
js/ui.progressbar.min.js CHANGED
@@ -1,12 +1,13 @@
1
- /*
2
- * jQuery UI Progressbar 1.7.3
3
- *
4
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
5
- * Dual licensed under the MIT (MIT-LICENSE.txt)
6
- * and GPL (GPL-LICENSE.txt) licenses.
7
- *
8
- * http://docs.jquery.com/UI/Progressbar
9
- *
10
- * Depends:
11
- * ui.core.js
12
- */
 
1
+ /*
2
+ * jQuery UI Progressbar 1.7.3
3
+ *
4
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
6
+ * and GPL (GPL-LICENSE.txt) licenses.
7
+ *
8
+ * http://docs.jquery.com/UI/Progressbar
9
+ *
10
+ * Depends:
11
+ * ui.core.js
12
+ */
13
+ (function(a){a.widget("ui.progressbar",{_init:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this._valueMin(),"aria-valuemax":this._valueMax(),"aria-valuenow":this._value()});this.valueDiv=a('<div class="ui-progressbar-value ui-widget-header ui-corner-left"></div>').appendTo(this.element);this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow").removeData("progressbar").unbind(".progressbar");this.valueDiv.remove();a.widget.prototype.destroy.apply(this,arguments)},value:function(b){if(b===undefined){return this._value()}this._setData("value",b);return this},_setData:function(b,c){switch(b){case"value":this.options.value=c;this._refreshValue();this._trigger("change",null,{});break}a.widget.prototype._setData.apply(this,arguments)},_value:function(){var b=this.options.value;if(b<this._valueMin()){b=this._valueMin()}if(b>this._valueMax()){b=this._valueMax()}return b},_valueMin:function(){var b=0;return b},_valueMax:function(){var b=100;return b},_refreshValue:function(){var b=this.value();this.valueDiv[b==this._valueMax()?"addClass":"removeClass"]("ui-corner-right");this.valueDiv.width(b+"%");this.element.attr("aria-valuenow",b)}});a.extend(a.ui.progressbar,{version:"1.7.3",defaults:{value:0}})})(jQuery);
js/ui.slider.min.js CHANGED
@@ -1,12 +1,13 @@
1
- /*
2
- * jQuery UI Slider 1.7.3
3
- *
4
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
5
- * Dual licensed under the MIT (MIT-LICENSE.txt)
6
- * and GPL (GPL-LICENSE.txt) licenses.
7
- *
8
- * http://docs.jquery.com/UI/Slider
9
- *
10
- * Depends:
11
- * ui.core.js
12
- */
 
1
+ /*
2
+ * jQuery UI Slider 1.7.3
3
+ *
4
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
6
+ * and GPL (GPL-LICENSE.txt) licenses.
7
+ *
8
+ * http://docs.jquery.com/UI/Slider
9
+ *
10
+ * Depends:
11
+ * ui.core.js
12
+ */
13
+ (function(a){a.widget("ui.slider",a.extend({},a.ui.mouse,{_init:function(){var b=this,c=this.options;this._keySliding=false;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");this.range=a([]);if(c.range){if(c.range===true){this.range=a("<div></div>");if(!c.values){c.values=[this._valueMin(),this._valueMin()]}if(c.values.length&&c.values.length!=2){c.values=[c.values[0],c.values[0]]}}else{this.range=a("<div></div>")}this.range.appendTo(this.element).addClass("ui-slider-range");if(c.range=="min"||c.range=="max"){this.range.addClass("ui-slider-range-"+c.range)}this.range.addClass("ui-widget-header")}if(a(".ui-slider-handle",this.element).length==0){a('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}if(c.values&&c.values.length){while(a(".ui-slider-handle",this.element).length<c.values.length){a('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}}this.handles=a(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(d){d.preventDefault()}).hover(function(){if(!c.disabled){a(this).addClass("ui-state-hover")}},function(){a(this).removeClass("ui-state-hover")}).focus(function(){if(!c.disabled){a(".ui-slider .ui-state-focus").removeClass("ui-state-focus");a(this).addClass("ui-state-focus")}else{a(this).blur()}}).blur(function(){a(this).removeClass("ui-state-focus")});this.handles.each(function(d){a(this).data("index.ui-slider-handle",d)});this.handles.keydown(function(i){var f=true;var e=a(this).data("index.ui-slider-handle");if(b.options.disabled){return}switch(i.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:f=false;if(!b._keySliding){b._keySliding=true;a(this).addClass("ui-state-active");b._start(i,e)}break}var g,d,h=b._step();if(b.options.values&&b.options.values.length){g=d=b.values(e)}else{g=d=b.value()}switch(i.keyCode){case a.ui.keyCode.HOME:d=b._valueMin();break;case a.ui.keyCode.END:d=b._valueMax();break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(g==b._valueMax()){return}d=g+h;break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(g==b._valueMin()){return}d=g-h;break}b._slide(i,e,d);return f}).keyup(function(e){var d=a(this).data("index.ui-slider-handle");if(b._keySliding){b._stop(e,d);b._change(e,d);b._keySliding=false;a(this).removeClass("ui-state-active")}});this._refreshValue()},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy()},_mouseCapture:function(d){var e=this.options;if(e.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();var h={x:d.pageX,y:d.pageY};var j=this._normValueFromMouse(h);var c=this._valueMax()-this._valueMin()+1,f;var k=this,i;this.handles.each(function(l){var m=Math.abs(j-k.values(l));if(c>m){c=m;f=a(this);i=l}});if(e.range==true&&this.values(1)==e.min){f=a(this.handles[++i])}this._start(d,i);k._handleIndex=i;f.addClass("ui-state-active").focus();var g=f.offset();var b=!a(d.target).parents().andSelf().is(".ui-slider-handle");this._clickOffset=b?{left:0,top:0}:{left:d.pageX-g.left-(f.width()/2),top:d.pageY-g.top-(f.height()/2)-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)};j=this._normValueFromMouse(h);this._slide(d,i,j);return true},_mouseStart:function(b){return true},_mouseDrag:function(d){var b={x:d.pageX,y:d.pageY};var c=this._normValueFromMouse(b);this._slide(d,this._handleIndex,c);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._handleIndex=null;this._clickOffset=null;return false},_detectOrientation:function(){this.orientation=this.options.orientation=="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(d){var c,h;if("horizontal"==this.orientation){c=this.elementSize.width;h=d.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{c=this.elementSize.height;h=d.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}var f=(h/c);if(f>1){f=1}if(f<0){f=0}if("vertical"==this.orientation){f=1-f}var e=this._valueMax()-this._valueMin(),i=f*e,b=i%this.options.step,g=this._valueMin()+i-b;if(b>(this.options.step/2)){g+=this.options.step}return parseFloat(g.toFixed(5))},_start:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("start",d,b)},_slide:function(f,e,d){var g=this.handles[e];if(this.options.values&&this.options.values.length){var b=this.values(e?0:1);if((this.options.values.length==2&&this.options.range===true)&&((e==0&&d>b)||(e==1&&d<b))){d=b}if(d!=this.values(e)){var c=this.values();c[e]=d;var h=this._trigger("slide",f,{handle:this.handles[e],value:d,values:c});var b=this.values(e?0:1);if(h!==false){this.values(e,d,(f.type=="mousedown"&&this.options.animate),true)}}}else{if(d!=this.value()){var h=this._trigger("slide",f,{handle:this.handles[e],value:d});if(h!==false){this._setData("value",d,(f.type=="mousedown"&&this.options.animate))}}}},_stop:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("stop",d,b)},_change:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("change",d,b)},value:function(b){if(arguments.length){this._setData("value",b);this._change(null,0)}return this._value()},values:function(b,e,c,d){if(arguments.length>1){this.options.values[b]=e;this._refreshValue(c);if(!d){this._change(null,b)}}if(arguments.length){if(this.options.values&&this.options.values.length){return this._values(b)}else{return this.value()}}else{return this._values()}},_setData:function(b,d,c){a.widget.prototype._setData.apply(this,arguments);switch(b){case"disabled":if(d){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled")}else{this.handles.removeAttr("disabled")}case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue(c);break;case"value":this._refreshValue(c);break}},_step:function(){var b=this.options.step;return b},_value:function(){var b=this.options.value;if(b<this._valueMin()){b=this._valueMin()}if(b>this._valueMax()){b=this._valueMax()}return b},_values:function(b){if(arguments.length){var c=this.options.values[b];if(c<this._valueMin()){c=this._valueMin()}if(c>this._valueMax()){c=this._valueMax()}return c}else{return this.options.values}},_valueMin:function(){var b=this.options.min;return b},_valueMax:function(){var b=this.options.max;return b},_refreshValue:function(c){var f=this.options.range,d=this.options,l=this;if(this.options.values&&this.options.values.length){var i,h;this.handles.each(function(p,n){var o=(l.values(p)-l._valueMin())/(l._valueMax()-l._valueMin())*100;var m={};m[l.orientation=="horizontal"?"left":"bottom"]=o+"%";a(this).stop(1,1)[c?"animate":"css"](m,d.animate);if(l.options.range===true){if(l.orientation=="horizontal"){(p==0)&&l.range.stop(1,1)[c?"animate":"css"]({left:o+"%"},d.animate);(p==1)&&l.range[c?"animate":"css"]({width:(o-lastValPercent)+"%"},{queue:false,duration:d.animate})}else{(p==0)&&l.range.stop(1,1)[c?"animate":"css"]({bottom:(o)+"%"},d.animate);(p==1)&&l.range[c?"animate":"css"]({height:(o-lastValPercent)+"%"},{queue:false,duration:d.animate})}}lastValPercent=o})}else{var j=this.value(),g=this._valueMin(),k=this._valueMax(),e=k!=g?(j-g)/(k-g)*100:0;var b={};b[l.orientation=="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[c?"animate":"css"](b,d.animate);(f=="min")&&(this.orientation=="horizontal")&&this.range.stop(1,1)[c?"animate":"css"]({width:e+"%"},d.animate);(f=="max")&&(this.orientation=="horizontal")&&this.range[c?"animate":"css"]({width:(100-e)+"%"},{queue:false,duration:d.animate});(f=="min")&&(this.orientation=="vertical")&&this.range.stop(1,1)[c?"animate":"css"]({height:e+"%"},d.animate);(f=="max")&&(this.orientation=="vertical")&&this.range[c?"animate":"css"]({height:(100-e)+"%"},{queue:false,duration:d.animate})}}}));a.extend(a.ui.slider,{getter:"value values",version:"1.7.3",eventPrefix:"slide",defaults:{animate:false,delay:0,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null}})})(jQuery);
mp3jplayer.php CHANGED
@@ -1,41 +1,38 @@
1
- <?php
2
- /*
3
  Plugin Name: MP3-jPlayer
4
  Plugin URI: http://sjward.org/jplayer-for-wordpress
5
- Description: Adds an mp3 player with a playlist to any Wordpress pages and posts that you have assigned mp3's to.
6
- Version: 1.3.4
7
  Author: Simon Ward
8
  Author URI: http://www.sjward.org
9
  License: GPL2
10
- */
11
-
12
- /*
13
- Copyright 2010 Simon Ward (email: sinomward@yahoo.co.uk)
14
-
15
- This program is free software; you can redistribute it and/or modify
16
- it under the terms of the GNU General Public License, version 2, as
17
- published by the Free Software Foundation.
18
-
19
- This program is distributed in the hope that it will be useful,
20
- but WITHOUT ANY WARRANTY; without even the implied warranty of
21
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
- GNU General Public License for more details.
23
-
24
- You should have received a copy of the GNU General Public License
25
- along with this program; if not, write to the Free Software
26
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27
- */
28
 
29
- if (!class_exists("mp3Fox"))
30
  {
31
  class mp3Fox
32
  {
33
- // -------------------------------
34
- var $version_of_plugin = "1.3.4";
35
- var $option_count = 16;
36
- var $iscompat = false;
37
- // -------------------------------
38
 
 
39
  var $playerHasBeenSet = "false";
40
  var $customFieldsGrabbed = "false";
41
  var $countPlaylist = 0;
@@ -43,66 +40,66 @@ if (!class_exists("mp3Fox"))
43
  var $scriptsflag = "false";
44
  var $postMetaKeys = array();
45
  var $postMetaValues = array();
 
46
  var $feedKeys = array();
47
  var $feedValues = array();
 
48
  var $stylesheet = "";
49
  var $mp3LibraryWP = array();
50
  var $mp3LibraryI = array();
51
- var $PlayerPlaylist = array();
52
- var $idfirstFound;
53
-
54
  var $adminOptionsName = "mp3FoxAdminOptions";
55
  var $theSettings = array();
56
-
57
- // debug
58
  var $playerSetMethod = "*not attempted*";
59
  var $putTag_runCount = 0;
60
  var $shortcode_runCount = 0;
61
  var $defaultAdd_runCount = 0;
 
62
  var $playerAddedOnRun = 0;
63
  var $debugCount = "0";
64
  var $scriptsForced = "false";
 
65
 
66
-
67
  /**
68
- * Handles SCRIPT ADDITION. If page is the posts index then always adding scripts (and then checking for tracks
69
- * during content hook), if singular then only adding them when either they've been flagged, or when there's mp3s in this id's
70
- * custom meta.
71
- *
72
- * (called via wp_head)
73
  */
74
  function check_if_scripts_needed() {
75
 
76
- $this->make_compatible();
77
- if ( $this->scriptsflag == "true" && $this->theSettings['disable_template_tag'] == "false" ) {
78
  if ( $this->stylesheet == "" ) {
79
  $this->stylesheet = $this->theSettings['player_theme'];
80
  }
81
  $this->add_Scripts( $this->stylesheet );
 
82
  if (is_singular() ) {
83
  $this->TT_grab_Custom_Meta();
84
  }
85
- $this->scriptsForced = "true";
86
  }
87
- else {
88
- if ( is_singular() ) {
89
- if ( $this->TT_grab_Custom_Meta() > 0 ) {
90
- $this->add_Scripts( $this->theSettings['player_theme'] );
91
- }
92
- }
93
- if ( is_home() && $this->theSettings['player_onblog'] == "true" ) {
94
  $this->add_Scripts( $this->theSettings['player_theme'] );
95
  }
96
  }
97
  return;
98
  }
99
 
100
-
101
  /**
102
- * Handles DEFAULT player addition via CONTENT.
103
- * (Called via the_content hook)
104
- *
105
- * The meta key match is done now (rather than in the head) on each loop if the page is the posts index.
106
  */
107
  function add_player($content='') {
108
 
@@ -110,28 +107,25 @@ if (!class_exists("mp3Fox"))
110
  if ($this->playerHasBeenSet == "true") {
111
  return $content;
112
  }
113
- if ( $this->tagflag == "true" && $this->theSettings['disable_template_tag'] == "false" ) {
114
- if ( empty($this->idfirstFound) ) {
115
- if ( $this->TT_grab_Custom_Meta() > 0 ) {
116
- $customvalues = $this->postMetaValues;
117
- $customkeys = $this->postMetaKeys;
118
- global $post;
119
- $this->idfirstFound = $post->ID;
120
- }
121
  }
 
 
122
  return $content;
123
  }
124
-
125
- if ( is_home() && $this->theSettings['player_onblog'] == "true" ) {
126
  if ( $this->TT_grab_Custom_Meta() > 0 ) {
127
  $customvalues = $this->postMetaValues;
128
  $customkeys = $this->postMetaKeys;
129
- }
130
  else {
131
  return $content;
132
  }
133
  }
134
- else if ( is_singular() && $this->customFieldsGrabbed == "true" ) {
135
  $customvalues = $this->postMetaValues;
136
  $customkeys = $this->postMetaKeys;
137
  }
@@ -139,26 +133,24 @@ if (!class_exists("mp3Fox"))
139
  return $content;
140
  }
141
 
142
- $theSplitMeta = $this->splitup_meta( $customkeys, $customvalues );
143
- $theAssembledMeta = $this->compare_swap( $theSplitMeta, $customkeys, $customvalues );
144
- $theTrackLists = $this->sort_tracks( $theAssembledMeta, $customkeys );
145
- $thePlayList = $this->remove_mp3remote( $theTrackLists );
146
  if ( $thePlayList['count'] == 0 ) {
147
  return $content;
148
  }
149
  $this->countPlaylist = $thePlayList['count'];
150
  $this->PlayerPlaylist = $thePlayList;
151
 
152
- if ( strpos($content, "[mp3-jplayer") !== false ) {
153
  return $content;
154
  }
155
-
156
  $this->write_startup_vars( $thePlayList['count'], $this->theSettings['auto_play'], $this->theSettings['playlist_show'] );
157
  $this->write_playlist( $thePlayList );
158
-
159
  $theplayer = $this->write_player_html( $thePlayList['count'], $this->theSettings['player_float'], $this->theSettings['show_downloadmp3'] );
160
  $content = $theplayer . $content . "<br clear=\"all\" />";
161
  $this->playerHasBeenSet = "true";
 
162
  $this->playerSetMethod = "content (default)";
163
  $this->playerAddedOnRun = $this->defaultAdd_runCount;
164
  return $content;
@@ -166,61 +158,86 @@ if (!class_exists("mp3Fox"))
166
 
167
 
168
  /**
169
- * Handles player addition via SHORTCODE.
170
  * The attributes overide the settings page values.
171
- * (Called via [mp3-jplayer] shortcode)
172
  */
173
  function shortcode_handler($atts, $content = null) {
174
 
175
  $this->shortcode_runCount++;
176
- if ( $this->tagflag == "true" && $this->theSettings['disable_template_tag'] == "false" ) {
177
- return;
178
- }
179
- if ($this->playerHasBeenSet == "true") {
180
  return;
181
  }
182
- if ($this->customFieldsGrabbed == "false") {
183
  return;
184
  }
185
-
186
- extract(shortcode_atts(array(
187
- 'pos' => $this->theSettings['player_float'],
188
  'dload' => $this->theSettings['show_downloadmp3'],
189
  'play' => $this->theSettings['auto_play'],
190
- 'list' => $this->theSettings['playlist_show']
 
 
 
191
  ), $atts));
192
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
193
  $this->write_startup_vars( $this->PlayerPlaylist['count'], $play, $list );
194
  $this->write_playlist( $this->PlayerPlaylist );
195
-
196
  $theplayer = $this->write_player_html( $this->countPlaylist, $pos, $dload );
197
  $this->playerHasBeenSet = "true";
 
198
  $this->playerSetMethod = "shortcode";
199
  $this->playerAddedOnRun = $this->shortcode_runCount;
200
  return $theplayer;
201
  }
202
-
203
 
204
  /**
205
- * Handles player addition via mp3j_put TAG.
206
  */
207
  function template_tag_handler( $id = "", $pos = "", $dload = "", $play = "", $list = "" ) {
208
 
209
  $this->putTag_runCount++;
210
- if ( $this->playerHasBeenSet == "true" ) {
211
  return;
212
  }
213
- if ( $this->theSettings['disable_template_tag'] == "true" ) {
214
- return;
215
- }
216
- if ( $this->tagflag == "false" ) {
217
- return;
218
- }
219
  if ( ((is_home() || is_archive()) && $this->theSettings['player_onblog'] == "true") || is_singular() ) {
220
- if ( $id == "first" && !empty($this->idfirstFound) ) {
221
  $id = $this->idfirstFound;
222
  }
223
-
224
  if ( $this->TT_grab_Custom_Meta($id) > 0 && $id != "feed" ) {
225
  $customvalues = $this->postMetaValues;
226
  $customkeys = $this->postMetaKeys;
@@ -237,59 +254,113 @@ if (!class_exists("mp3Fox"))
237
  return;
238
  }
239
 
240
- $theSplitMeta = $this->splitup_meta( $customkeys, $customvalues );
241
- $theAssembledMeta = $this->compare_swap( $theSplitMeta, $customkeys, $customvalues );
242
- $theTrackLists = $this->sort_tracks( $theAssembledMeta, $customkeys );
243
- $thePlayList = $this->remove_mp3remote( $theTrackLists );
244
  if ( $thePlayList['count'] == 0 ) {
245
  return;
246
  }
247
  $this->countPlaylist = $thePlayList['count'];
248
  $this->PlayerPlaylist = $thePlayList;
249
 
250
- if ( $pos == "" ) {
251
- $pos = $this->theSettings['player_float'];
252
- }
253
- if ( $dload == "" ) {
254
- $dload = $this->theSettings['show_downloadmp3'];
255
- }
256
- if ( $play == "" ) {
257
- $play = $this->theSettings['auto_play'];
258
- }
259
- if ( $list == "" ) {
260
- $list = $this->theSettings['playlist_show'];
261
  }
 
262
 
263
  $this->write_startup_vars( $thePlayList['count'], $play, $list );
264
  $this->write_playlist( $thePlayList );
265
-
266
  $theplayer = $this->write_player_html( $thePlayList['count'], $pos, $dload );
 
267
  $this->playerHasBeenSet = "true";
 
268
  $this->playerSetMethod = "mp3j_put";
269
  $this->playerAddedOnRun = $this->putTag_runCount;
270
- echo $theplayer;
271
  return;
272
  }
273
 
274
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
275
  /**
276
  * FLAGS for an UPCOMING mp3j_put TAG.
277
  * Called via mp3j_flag.
278
  */
279
  function flag_tag_handler($set = 1) {
280
- if ( $set == 0 ) {
281
- $this->tagflag = "false";
282
- }
283
- if ( $set == 1 ) {
284
- $this->tagflag = "true";
285
- }
286
  return;
287
  }
288
 
289
 
290
  /**
291
  * FLAGS for SCRIPTS to be added.
292
- * Called via mp3j_addscripts.
293
  */
294
  function scripts_tag_handler( $style = "" ) {
295
 
@@ -298,9 +369,7 @@ if (!class_exists("mp3Fox"))
298
  $this->theSettings = get_option($this->adminOptionsName);
299
  $this->stylesheet = $this->theSettings['player_theme'];
300
  }
301
- else {
302
- $this->stylesheet = $style;
303
- }
304
  return;
305
  }
306
 
@@ -311,9 +380,7 @@ if (!class_exists("mp3Fox"))
311
  */
312
  function grablibrary_handler( $thereturn ) {
313
 
314
- if ( empty($this->mp3LibraryI) ) {
315
- $this->grab_library_info();
316
- }
317
  $thereturn = $this->mp3LibraryI;
318
  return $thereturn;
319
  }
@@ -325,14 +392,108 @@ if (!class_exists("mp3Fox"))
325
  */
326
  function grablibraryWP_handler( $thereturn ) {
327
 
328
- if ( empty($this->mp3LibraryWP) ) {
329
- $this->grab_library_info();
330
- }
331
  $thereturn = $this->mp3LibraryWP;
332
  return $thereturn;
333
  }
334
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
335
 
 
336
  /**
337
  * GETS custom field META from post/page.
338
  * Takes optional post id, creates indexed arrays.
@@ -343,44 +504,53 @@ if (!class_exists("mp3Fox"))
343
  if ( $id == "feed" ) {
344
  return 1;
345
  }
346
-
347
- global $wpdb;
348
- global $post;
349
- if ( $id == "" ) {
350
- $id = $post->ID;
351
- }
352
- $pagesmeta = $wpdb->get_results("SELECT * FROM $wpdb->postmeta WHERE post_id =" .$id. " ORDER BY meta_key ASC");
353
-
354
  if ( !empty($this->postMetaValues) ) {
355
- unset( $this->postMetaKeys );
356
- unset( $this->postMetaValues );
357
  $this->postMetaKeys = array();
358
  $this->postMetaValues = array();
359
  $this->customFieldsGrabbed = "false";
360
  }
 
361
 
 
 
 
 
362
  $i = 0;
363
  $metacount = 0;
364
- foreach ( $pagesmeta as $obj ) {
365
  $flag = 0;
366
  foreach ( $obj as $k => $value ) {
367
  if ( $k == "meta_key" ){
368
- if ( preg_match('/^([0-9]+(\s)?)?mp3(\..*)?$/', $value) == 1 ) {
369
  $this->postMetaKeys[$i] = $value;
370
  $metacount++;
371
  $flag = 1;
372
  }
373
  }
374
  if ( $k == "meta_value" ){
375
- if ( $flag == 1 ) {
376
- $this->postMetaValues[$i++] = $value;
377
- }
378
  }
379
  }
380
  }
381
- if ( $metacount > 0 ) {
382
- $this->customFieldsGrabbed = "true";
383
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
384
  return $metacount;
385
  }
386
 
@@ -389,46 +559,91 @@ if (!class_exists("mp3Fox"))
389
  * Creates ALTERNATIVE META ARRAYS.
390
  * Called via mp3j_set_meta.
391
  *
392
- * $mode not used yet
393
  */
394
- function feed_metadata( $tracks, $captions = "", $mode = 1 ) {
395
 
396
- if ( empty($tracks) || !is_array($tracks) ) {
397
- return;
398
  }
399
- if ( $mode == 1 ) {
400
- unset( $this->feedKeys );
401
- unset( $this->feedValues );
402
- $this->feedKeys = array();
403
- $this->feedValues = array();
404
-
405
- $j = 1;
406
- if ( empty($captions) ) {
407
- foreach ( $tracks as $i => $file ) {
408
- $this->feedKeys[$i] = $j++ . " mp3";
409
- $this->feedValues[$i] = $file;
410
- }
411
  }
412
- else {
413
- foreach ( $tracks as $i => $file ) {
414
- if ( !empty($captions[$i]) ) {
415
- $this->feedKeys[$i] = $j++ . " mp3." . $captions[$i];
 
 
416
  }
417
  else {
418
- $this->feedKeys[$i] = $j++ . " mp3";
419
  }
420
- $this->feedValues[$i] = $file;
421
  }
 
 
 
 
422
  }
423
-
424
- return;
425
- }
426
- else {
427
- return;
428
  }
 
429
  }
430
 
431
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
432
  /**
433
  * Returns LIBRARY mp3 filenames, titles, excerpts, content, uri's
434
  * in indexed arrays.
@@ -436,7 +651,7 @@ if (!class_exists("mp3Fox"))
436
  function grab_library_info() {
437
 
438
  global $wpdb;
439
- $audioInLibrary = $wpdb->get_results("SELECT DISTINCT guid, post_title, post_excerpt, post_content FROM $wpdb->posts WHERE post_mime_type = 'audio/mpeg'");
440
  $j=0;
441
  $Lcount = count($audioInLibrary);
442
  $this->mp3LibraryWP = $audioInLibrary;
@@ -457,14 +672,19 @@ if (!class_exists("mp3Fox"))
457
  if ( $itemkey == "post_content" ) {
458
  $libraryDescriptions[$j] = $itemvalue;
459
  }
 
 
 
460
  }
461
  $j++;
462
  }
 
463
  $theLibrary = array( 'filenames' => $libraryFilenames,
464
  'titles' => $libraryTitles,
465
  'urls' => $libraryURLs,
466
  'excerpts' => $libraryExcerpts,
467
  'descriptions' => $libraryDescriptions,
 
468
  'count' => $Lcount );
469
  $this->mp3LibraryI = $theLibrary;
470
  return $theLibrary;
@@ -479,11 +699,11 @@ if (!class_exists("mp3Fox"))
479
  */
480
  function splitup_meta($customkeys, $customvalues) {
481
 
482
- /* artists */
483
  $prevArtist = "";
484
  foreach ( $customkeys as $i => $ckvalue ) {
485
  $splitkey = explode('.', $ckvalue, 2);
486
- if ( $splitkey[1] == "" ) {
487
  if ( preg_match('/^([0-9]+(\s)?)?mp3\.$/', $ckvalue) == 1 ) {
488
  $customArtists[$i] = "";
489
  }
@@ -497,9 +717,8 @@ if (!class_exists("mp3Fox"))
497
  $prevArtist = $customArtists[$i];
498
  }
499
 
500
- /* titles & filenames */
501
  foreach ( $customvalues as $i => $cvvalue ) {
502
-
503
  $checkfortitle = strpos($cvvalue, '@');
504
  if ( $checkfortitle === false ) {
505
  $customTitles[$i] = str_replace(".mp3", "", $cvvalue);
@@ -524,7 +743,6 @@ if (!class_exists("mp3Fox"))
524
  }
525
  }
526
  }
527
-
528
  $theSplitMeta = array( 'artists' => $customArtists,
529
  'titles' => $customTitles,
530
  'files' => $customFilenames );
@@ -533,7 +751,7 @@ if (!class_exists("mp3Fox"))
533
 
534
 
535
  /**
536
- * Returns PREPARED ARRAYS that are ready for js playlist.
537
  * Looks for $customFilenames that exist in the library and grabs their full uri's, otherwise
538
  * adds default path or makes sure has an http when remote. Cleans up titles that are uri's, swaps
539
  * titles and/or artists for the library ones when required.
@@ -542,25 +760,22 @@ if (!class_exists("mp3Fox"))
542
  */
543
  function compare_swap($theSplitMeta, $customkeys, $customvalues) {
544
 
545
- if ( empty($this->mp3LibraryI) ) {
546
- $library = $this->grab_library_info();
547
  }
548
- else {
549
  $library = $this->mp3LibraryI;
550
  }
551
-
552
  foreach ( $theSplitMeta['files'] as $i => $cfvalue )
553
  {
554
- if ( $library['count'] == 0 ) {
555
  $inLibraryID = false;
556
  }
557
  else {
558
  $inLibraryID = array_search( $cfvalue, $library['filenames'] );
559
  }
560
  $mp3haswww = strpos($cfvalue, 'http://');
561
-
562
- /* if file is local but not in library */
563
- if ( $mp3haswww === false && $inLibraryID === false ) {
564
  if ( $this->theSettings['mp3_dir'] == "/" ) {
565
  $theSplitMeta['files'][$i] = $this->theSettings['mp3_dir'] . $theSplitMeta['files'][$i];
566
  }
@@ -568,9 +783,7 @@ if (!class_exists("mp3Fox"))
568
  $theSplitMeta['files'][$i] = $this->theSettings['mp3_dir']. "/" . $theSplitMeta['files'][$i];
569
  }
570
  }
571
-
572
- /* if file is in library */
573
- if ( $inLibraryID !== false ) {
574
  $theSplitMeta['files'][$i] = $library['urls'][$inLibraryID];
575
  if ( $this->theSettings['playlist_UseLibrary'] == "true" ) {
576
  $theSplitMeta['titles'][$i] = $library['titles'][$inLibraryID];
@@ -588,9 +801,7 @@ if (!class_exists("mp3Fox"))
588
  }
589
  }
590
  }
591
-
592
- /* if file is remote or user is over-riding the default path */
593
- if ( $mp3haswww !== false && $inLibraryID === false ) {
594
  if ( strpos($theSplitMeta['titles'][$i], 'http://') !== false || strpos($theSplitMeta['titles'][$i], 'www.') !== false ) {
595
  $theSplitMeta['titles'][$i] = strrchr($theSplitMeta['titles'][$i], "/");
596
  $theSplitMeta['titles'][$i] = str_replace( "/", "", $theSplitMeta['titles'][$i]);
@@ -602,13 +813,12 @@ if (!class_exists("mp3Fox"))
602
  'titles' => $theSplitMeta['titles'],
603
  'files' => $theSplitMeta['files'] );
604
  return $theAssembledMeta;
605
-
606
  }
607
 
608
 
609
  /**
610
- * SORTS by either the titles(if a-z ticked) or by the keys (only if there's
611
- * any numbering in them) and makes an ordering array
612
  *
613
  * Return: artists, titles, files, order.
614
  */
@@ -677,7 +887,7 @@ if (!class_exists("mp3Fox"))
677
  $playlistArtists = $theTrackLists['artists'];
678
  $indexorderAllowed = $theTrackLists['order'];
679
  }
680
- $playlistTitles = str_replace('"', '\"', $playlistTitles); // escapes quotes for the js array
681
  $nAllowed = count($playlistFilenames);
682
 
683
  $thePlayList = array( 'artists' => $playlistArtists,
@@ -699,31 +909,20 @@ if (!class_exists("mp3Fox"))
699
  wp_enqueue_script( 'ui.progressbar.min', '/wp-content/plugins/mp3-jplayer/js/ui.progressbar.min.js', array( 'jquery' ) );
700
  wp_enqueue_script( 'ui.slider.min', '/wp-content/plugins/mp3-jplayer/js/ui.slider.min.js', array( 'jquery' ) );
701
  wp_enqueue_script( 'jquery.jplayer.min', '/wp-content/plugins/mp3-jplayer/js/jquery.jplayer.min.js', array( 'jquery' ) );
702
- wp_enqueue_script( 'mp3-jplayer', '/wp-content/plugins/mp3-jplayer/js/mp3-jplayer.js', array( 'jquery' ) );
703
-
704
- // Set the style sheets choosable from admin
705
-
706
- $small = "";
707
- if ( $this->theSettings['use_small_player'] == "true" ) {
708
- $small = "-sidebar";
709
- }
710
- if ( $theme == "styleA" ) {
711
- $theme = "/wp-content/plugins/mp3-jplayer/css/mp3jplayer-grey" . $small . ".css";
712
- }
713
- if ( $theme == "styleB" ) {
714
- $theme = "/wp-content/plugins/mp3-jplayer/css/mp3jplayer-green" . $small . ".css";
715
- }
716
- if ( $theme == "styleC" ) {
717
- $theme = "/wp-content/plugins/mp3-jplayer/css/mp3jplayer-blu" . $small . ".css";
718
- }
719
- if ( $theme == "styleD" ) {
720
- $theme = "/wp-content/plugins/mp3-jplayer/css/mp3-jplayer-cyanALT" . $small . ".css";
721
- }
722
-
723
- $name = strrchr( $theme, "/");
724
  $name = str_replace( "/", "", $name);
725
  $name = str_replace( ".css", "", $name);
726
- wp_enqueue_style( $name, $theme );
727
  return;
728
  }
729
 
@@ -733,12 +932,8 @@ if (!class_exists("mp3Fox"))
733
  */
734
  function write_startup_vars( $count, $autoplay = "", $showlist = "" ) {
735
 
736
- if ( $autoplay != "true" && $autoplay != "false" ) {
737
- $autoplay = $this->theSettings['auto_play'];
738
- }
739
- if ( $showlist != "true" && $showlist != "false" ) {
740
- $showlist = $this->theSettings['playlist_show'];
741
- }
742
 
743
  $wpinstallpath = get_bloginfo('wpurl');
744
  echo "\n\n<script type=\"text/javascript\">\n<!--\n";
@@ -765,8 +960,13 @@ if (!class_exists("mp3Fox"))
765
  echo "\n\n<script type=\"text/javascript\">\n<!--\n";
766
  echo "var foxPlayList = [\n";
767
  $tracknumber = 1;
 
768
  foreach ( $thePlayList['order'] as $ik => $i ) {
769
- echo "{name: \"" .$tracknumber. ". " .$thePlayList['titles'][$i]. "\", mp3: \"" .$thePlayList['files'][$i]. "\", artist: \"" .$thePlayList['artists'][$i]. "\"}";
 
 
 
 
770
  if ( $tracknumber != $thePlayList['count'] ) {
771
  echo ",";
772
  }
@@ -783,47 +983,38 @@ if (!class_exists("mp3Fox"))
783
  * WRITES PLAYER HTML
784
  */
785
  function write_player_html( $count, $position, $download ) {
786
-
787
- if ( $this->theSettings['use_small_player'] == "true" ) { //set player widths for centred and right aligned positions
788
- $width = "201px";
789
- }
790
- else {
791
- $width = "281px";
792
- }
793
-
794
- if ( $position == "left" ) {
795
- $floater = "float: left; padding: 5px 50px 50px 0px;";
796
- }
797
- else if ( $position == "right" ) {
798
- $floater = "float: right; padding: 5px 0px 50px 50px;";
799
- }
800
- else if ( $position == "absolute" ) {
801
- $floater = "position: absolute;";
802
- }
803
- else if ( $position == "rel-C" ) {
804
- $floater = "position:relative; padding:5px 0px 50px 0px; width:" . $width . "; margin:0px auto 0px auto;";
805
- }
806
- else if ( $position == "rel-R" ) {
807
- $floater = "position:relative; padding:5px 0px 50px 0px; width:" . $width . "; margin:0px 0px 0px auto;";
808
- }
809
- else {
810
- $floater = "position: relative; padding: 5px 0px 50px 0px;";
811
- }
812
-
813
- if ( $download == "true" ) {
814
- $showMp3Link = "visibility: visible;";
815
- }
816
- else {
817
- $showMp3Link = "visibility: hidden;";
818
- }
819
-
820
- if ( $count < 2 ) {
821
- $showlistcontrols = "visibility: hidden;";
822
- }
823
- else {
824
- $showlistcontrols = "visibility: visible;";
825
- }
826
-
827
  $player = "<div id=\"jquery_jplayer\"></div>
828
  <div class=\"jp-playlist-player\" style=\"" .$floater. "\">
829
  <div class=\"jp-innerwrap\">
@@ -832,12 +1023,14 @@ if (!class_exists("mp3Fox"))
832
  <div id=\"innerright\"></div>
833
  <div id=\"innertab\"></div>\n
834
  <div class=\"jp-interface\">
 
 
835
  <ul class=\"jp-controls\">
836
- <li><a href=\"#\" id=\"jplayer_play\" class=\"jp-play\" tabindex=\"1\">play</a></li>
837
- <li><a href=\"#\" id=\"jplayer_pause\" class=\"jp-pause\" tabindex=\"1\">pause</a></li>
838
- <li><a href=\"#\" id=\"jplayer_stop\" class=\"jp-stop\" tabindex=\"1\">stop</a></li>
839
- <li><a href=\"#\" id=\"jplayer_previous\" class=\"jp-previous\" tabindex=\"1\" style=\"" .$showlistcontrols. "\">previous</a></li>
840
- <li><a href=\"#\" id=\"jplayer_next\" class=\"jp-next\" tabindex=\"1\" style=\"" .$showlistcontrols. "\">next</a></li>
841
  </ul>
842
  <div id=\"sliderVolume\"></div>
843
  <div id=\"bars_holder\">
@@ -847,73 +1040,86 @@ if (!class_exists("mp3Fox"))
847
  <div id=\"jplayer_play_time\" class=\"jp-play-time\"></div>
848
  <div id=\"jplayer_total_time\" class=\"jp-total-time\"></div>
849
  <div id=\"status\"></div>
850
- <div id=\"player-track-title\"></div>
851
- <div id=\"player-artist\"></div>
852
  <div id=\"downloadmp3-button\" style=\"" .$showMp3Link. "\"></div>
853
- <div id=\"playlist-toggle\" style=\"" .$showlistcontrols. "\" onclick=\"javascript:toggleplaylist();\">HIDE PLAYLIST</div>
854
  </div>
855
  </div>\n
856
  <div id=\"playlist-wrap\">
857
  <div id=\"jplayer_playlist\" class=\"jp-playlist\"><ul><li></li></ul></div>
858
  </div>
859
  </div>\n";
860
-
861
  return $player;
862
  }
863
-
 
 
 
 
 
 
 
 
 
 
 
 
864
 
865
  /**
866
- * DEBUG HELP, prints vars/arrays to browser source view.
867
- * Called via mp3j_debug() template tag.
868
  * needs improvement.
869
  */
870
  function debug_info( $display = "" ) {
871
 
872
  $this->make_compatible();
873
  $this->debugCount++;
874
- echo "\n\n<!-- *** DEBUG " . $this->debugCount;
875
- if ( $display == "" ) { echo " (Vars)"; }
876
- else { echo " (All)"; }
877
- echo " * MP3-jPlayer (" . $this->version_of_plugin . ") ***\n\nPage type: ";
878
-
879
  if ( is_home() ) { echo "Posts index"; }
880
- else if ( is_single() ) { echo "Single post"; }
881
- else if ( is_page() ) { echo "Single page"; }
882
  else if ( is_archive() ) { echo "Archive"; }
883
  else { echo "other"; }
884
  echo "\nAllow tags: ";
885
  if ( $this->theSettings['disable_template_tag'] == "false" ) { echo "Yes"; }
886
  else { echo "NO"; }
887
- echo "\nScripts flagged: " . $this->scriptsflag . "\nScripts forced: " . $this->scriptsForced . "\nCustom fields grabbed: " . $this->customFieldsGrabbed . "\nmp3j_put flagged: " . $this->tagflag;
888
- echo "\n\n*** Calls to add player functions\ncontent (default): " . $this->defaultAdd_runCount . "\nshortcode: " . $this->shortcode_runCount . "\nmp3j_put: " . $this->putTag_runCount;
889
- echo "\n\nAttempted to add via: " . $this->playerSetMethod;
890
- if ( $this->playerAddedOnRun > 0 ) { echo " on call no. " . $this->playerAddedOnRun; }
891
  echo "\nplaylist count: " . $this->countPlaylist;
892
- echo "\nflagged as added: " . $this->playerHasBeenSet;
893
  echo "\n\nADMIN SETTINGS:\n";
894
  print_r($this->theSettings);
 
 
 
 
 
895
 
896
  if ( $display == "" || $display == "vars" ) {
897
  echo " \n\n-->\n\n";
898
  return;
899
- }
900
-
901
- //*
902
- echo "\n\nMETA KEY MATCHES:\n";
903
  print_r($this->postMetaKeys);
904
- echo "\n\nMETA VALUES:\n";
905
  print_r($this->postMetaValues);
906
- echo "\n\nFEED KEYS:\n";
907
  print_r($this->feedKeys);
908
- echo "\n\nFEED VALUES:\n";
909
  print_r($this->feedValues);
910
- echo "\n\nTHE PLAYLIST:\n";
911
  print_r($this->PlayerPlaylist);
912
  if ( empty($this->mp3LibraryI) ) { $this->grab_library_info(); }
913
- echo "\n\n* MP3's IN LIBRARY:\n";
914
  print_r($this->mp3LibraryI);
915
- // */
916
-
 
 
917
  echo " \n\n-->\n\n";
918
  return;
919
  }
@@ -923,11 +1129,10 @@ if (!class_exists("mp3Fox"))
923
  * called when PLUGIN is ACTIVATED to create options if none exist.
924
  */
925
  function initFox() {
926
-
927
  $this->getAdminOptions();
928
  }
929
 
930
-
931
  /**
932
  * called when PLUGIN DEactivated, keeps the admin settings if option was ticked.
933
  */
@@ -938,8 +1143,8 @@ if (!class_exists("mp3Fox"))
938
  delete_option($this->adminOptionsName);
939
  }
940
  }
 
941
 
942
-
943
  /**
944
  * Makes sure options array is up to date with current plugin.
945
  */
@@ -966,7 +1171,7 @@ if (!class_exists("mp3Fox"))
966
  */
967
  function getAdminOptions() {
968
 
969
- $mp3FoxAdminOptions = array( // default settings
970
  'initial_vol' => '100',
971
  'auto_play' => 'true',
972
  'mp3_dir' => '/',
@@ -982,7 +1187,12 @@ if (!class_exists("mp3Fox"))
982
  'show_downloadmp3' => 'false',
983
  'disable_template_tag' => 'false',
984
  'db_plugin_version' => $this->version_of_plugin,
985
- 'use_small_player' => 'false' );
 
 
 
 
 
986
 
987
  $theOptions = get_option($this->adminOptionsName);
988
  if ( !empty($theOptions) ) {
@@ -996,19 +1206,16 @@ if (!class_exists("mp3Fox"))
996
 
997
 
998
  /**
999
- * UPDATES and DISPLAYS ADMIN settings on the settings page.
1000
  */
1001
  function printAdminPage() {
1002
 
1003
  $theOptions = $this->getAdminOptions();
1004
  if (isset($_POST['update_mp3foxSettings']))
1005
  {
1006
- if (isset($_POST['mp3foxAutoplay'])) {
1007
- $theOptions['auto_play'] = $_POST['mp3foxAutoplay'];
1008
- }
1009
- else {
1010
- $theOptions['auto_play'] = "false";
1011
- }
1012
  if (isset($_POST['mp3foxVol'])) {
1013
  $theOptions['initial_vol'] = preg_replace("/[^0-9]/","", $_POST['mp3foxVol']);
1014
  if ($theOptions['initial_vol'] < 0 || $theOptions['initial_vol']=="") {
@@ -1018,6 +1225,7 @@ if (!class_exists("mp3Fox"))
1018
  $theOptions['initial_vol'] = "100";
1019
  }
1020
  }
 
1021
  if (isset($_POST['mp3foxfolder'])) {
1022
  $theOptions['mp3_dir'] = preg_replace("!^.*www*\.!", "http://www.", $_POST['mp3foxfolder']);
1023
  if (strpos($theOptions['mp3_dir'], "http://") === false) {
@@ -1027,84 +1235,86 @@ if (!class_exists("mp3Fox"))
1027
  else {
1028
  $theOptions['mp3_dir'] = preg_replace("!^/+!", "/", $theOptions['mp3_dir']);
1029
  }
1030
- if (preg_match("!.+/+$!", $theOptions['mp3_dir']) == 1) {
1031
- $theOptions['mp3_dir'] = preg_replace("!/+$!", "", $theOptions['mp3_dir']);
1032
- }
 
1033
  }
1034
  if ($theOptions['mp3_dir'] == "") {
1035
  $theOptions['mp3_dir'] = "/";
1036
  }
1037
  }
1038
- if (isset($_POST['mp3foxTheme'])) {
1039
- $theOptions['player_theme'] = $_POST['mp3foxTheme'];
1040
- }
1041
- if (isset($_POST['mp3foxAllowRemote'])) {
1042
- $theOptions['allow_remoteMp3'] = $_POST['mp3foxAllowRemote'];
1043
- }
1044
- else {
1045
- $theOptions['allow_remoteMp3'] = "false";
1046
- }
1047
- if (isset($_POST['mp3foxAtoZ'])) {
1048
- $theOptions['playlist_AtoZ'] = $_POST['mp3foxAtoZ'];
1049
- }
1050
- else {
1051
- $theOptions['playlist_AtoZ'] = "false";
1052
- }
1053
- if (isset($_POST['mp3foxFloat'])) {
1054
- $theOptions['player_float'] = $_POST['mp3foxFloat'];
1055
- }
1056
- if (isset($_POST['mp3foxOnBlog'])) {
1057
- $theOptions['player_onblog'] = $_POST['mp3foxOnBlog'];
1058
- }
1059
- else {
1060
- $theOptions['player_onblog'] = "false";
1061
- }
1062
- if (isset($_POST['mp3foxUseLibrary'])) {
1063
- $theOptions['playlist_UseLibrary'] = $_POST['mp3foxUseLibrary'];
1064
- }
1065
- else {
1066
- $theOptions['playlist_UseLibrary'] = "false";
1067
- }
1068
- if (isset($_POST['mp3foxShowPlaylist'])) {
1069
- $theOptions['playlist_show'] = $_POST['mp3foxShowPlaylist'];
1070
- }
1071
- else {
1072
- $theOptions['playlist_show'] = "false";
1073
- }
1074
- if (isset($_POST['mp3foxRemember'])) {
1075
- $theOptions['remember_settings'] = $_POST['mp3foxRemember'];
1076
- }
1077
- else {
1078
- $theOptions['remember_settings'] = "false";
1079
- }
1080
- if (isset($_POST['mp3foxHideExtension'])) {
1081
- $theOptions['hide_mp3extension'] = $_POST['mp3foxHideExtension'];
1082
- }
1083
- else {
1084
- $theOptions['hide_mp3extension'] = "false";
1085
- }
1086
- if (isset($_POST['mp3foxDownloadMp3'])) {
1087
- $theOptions['show_downloadmp3'] = $_POST['mp3foxDownloadMp3'];
1088
- }
1089
- else {
1090
- $theOptions['show_downloadmp3'] = "false";
1091
- }
1092
- if (isset($_POST['disableTemplateTag'])) {
1093
- $theOptions['disable_template_tag'] = $_POST['disableTemplateTag'];
1094
- }
1095
- else {
1096
- $theOptions['disable_template_tag'] = "false";
1097
- }
1098
- if (isset($_POST['mp3foxSmallPlayer'])) {
1099
- $theOptions['use_small_player'] = $_POST['mp3foxSmallPlayer'];
1100
- }
1101
- else {
1102
- $theOptions['use_small_player'] = "false";
1103
  }
1104
 
 
 
 
 
 
 
 
 
 
 
 
1105
  update_option($this->adminOptionsName, $theOptions);
1106
- ?>
1107
-
 
1108
  <div class="updated"><p><strong><?php _e("Settings Updated.", "mp3Fox");?></strong></p></div>
1109
 
1110
  <?php
@@ -1113,146 +1323,762 @@ if (!class_exists("mp3Fox"))
1113
 
1114
  <div class="wrap">
1115
  <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">
1116
-
1117
- <h2>Mp3-jPlayer <span class="description" style="font-size: 10px;"> (<?php echo $this->version_of_plugin; ?>)</span></h2>
1118
-
1119
- <p class="description" style="margin: 8px 120px 0px 0px;">Below are the global settings for the player, it
1120
- will automatically appear on any posts and pages that you have a playlist on. You can use the shortcode to over-ride some of these options.</p>
1121
- <h4 class="description" style="margin-top: 5px; margin-bottom: 30px; font-weight:500"><a href="#howto">Help</a></h4>
1122
 
 
1123
  <h3 style="margin-bottom: 0px;">Player</h3>
1124
- <p style="margin-top: 7px; margin-bottom: 5px;">&nbsp; Initial volume &nbsp; <input type="text" style="text-align:right;" size="2" name="mp3foxVol" value="<?php echo $theOptions['initial_vol'] ?>" /> &nbsp; <span class="description">(0 - 100)</span></p>
1125
  <p style="margin-top: 0px; margin-bottom: 8px;">&nbsp; <input type="checkbox" name="mp3foxAutoplay" value="true" <?php if ($theOptions['auto_play'] == "true") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp; Autoplay</p>
 
1126
  <p style="margin-top: 0px; margin-bottom: 8px;">&nbsp; <input type="checkbox" name="mp3foxShowPlaylist" value="true" <?php if ($theOptions['playlist_show'] == "true") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp; Start with the playlist showing</p>
1127
- <p style="margin-top: 0px; margin-bottom: 8px;">&nbsp; <input type="checkbox" name="mp3foxOnBlog" value="true" <?php if ($theOptions['player_onblog'] == "true") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp; Show a player on the posts index page when there's something to play
1128
- <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="description">(the player is added to the highest post in the list that has a playlist)</span></p>
1129
  <p style="margin-top: 0px; margin-bottom: 8px;">&nbsp; <input type="checkbox" name="mp3foxAtoZ" value="true" <?php if ($theOptions['playlist_AtoZ'] == "true") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp; Playlist the tracks in alphabetical order</p>
1130
- <p style="margin-top: 0px; margin-bottom: 15px;">&nbsp; <input type="checkbox" name="mp3foxDownloadMp3" value="true" <?php if ($theOptions['show_downloadmp3'] == "true") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp; Display a 'Download mp3' button</p>
1131
-
1132
 
1133
- <h3 style="margin-bottom: 4px;"><br />Library mp3's</h3>
1134
- <p style="margin-bottom: 5px;">&nbsp; <input type="checkbox" name="mp3foxUseLibrary" value="true" <?php if ($theOptions['playlist_UseLibrary'] == "true") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp; Always use Media Library titles and excerpts when they exist</p>
1135
- <p class="description" style="margin: 0px 0px 9px 35px;"><a href="media-new.php">Upload new tracks</a>
1136
- <br /><a href="upload.php?post_mime_type=audio">Go to media library</a></p>
1137
 
1138
- <?php
1139
- //media settings page has moved in WP 3
1140
- if ( substr(get_bloginfo('version'), 0, 1) > 2 ) { // if WP 3.x
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1141
  $mediapagelink = get_bloginfo('wpurl') . "/wp-admin/options-media.php";
1142
  }
1143
  else {
1144
  $mediapagelink = get_bloginfo('wpurl') . "/wp-admin/options-misc.php";
1145
  }
1146
-
1147
  $upload_dir = wp_upload_dir();
1148
  $localurl = get_bloginfo('url');
1149
- $uploadsfolder = str_replace($localurl, "", $upload_dir['baseurl']); // is empty string only if library is empty
1150
  if ( $uploadsfolder != "" ) {
1151
- echo "<p class=\"description\" style=\"margin: 0px 120px 15px 35px;\">Your Media Library uploads folder is currently set to <code>" .$uploadsfolder. "</code> , you can always <a href=\"" . $mediapagelink . "\">change it</a> without affecting any playlists.</p>";
 
1152
  }
1153
  ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1154
 
1155
- <h3 style="margin-bottom: 8px;"><br />Non-Library mp3's</h3>
1156
- <p class="description" style="margin: 0px 120px 0px 7px;">Set a folder to play non-library tracks from in the box below. eg <code>/mymusic</code>
1157
- or <code>www.another-domain.com/folder</code>. You only need write filenames for tracks from here. You can over-ride the
1158
- default path/URI anytime on a playlist by putting the full URI for an mp3.</p>
1159
-
1160
- <p>&nbsp; Default path or URI &nbsp; <input type="text" size="55" name="mp3foxfolder" value="<?php echo $theOptions['mp3_dir'] ?>" /></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1161
  <p style="margin-top: 20px; margin-bottom: 8px;">&nbsp; <input type="checkbox" name="mp3foxAllowRemote" value="true" <?php if ($theOptions['allow_remoteMp3'] == "true") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp; Allow mp3's from other domains on
1162
- the player's playlists<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="description">(unchecking this option doesn't affect mp3's using your default path above if it's an external URI)</span></p>
1163
- <p style="margin-top: 0px; margin-bottom: 14px;">&nbsp; <input type="checkbox" name="mp3foxHideExtension" value="true" <?php if ($theOptions['hide_mp3extension'] == "true") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp; Hide .mp3 if a filename is displayed
1164
  <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="description">(filenames are displayed when there's no available titles)</span></p>
1165
 
1166
- <h3 style="margin-bottom: 6px;"><br />Style</h3>
1167
- <p style="margin-bottom: 0px;">&nbsp; <input type="radio" name="mp3foxTheme" value="styleA" <?php if ($theOptions['player_theme'] == "styleA") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp;&nbsp;Neutral<br />
 
 
1168
  &nbsp; <input type="radio" name="mp3foxTheme" value="styleB" <?php if ($theOptions['player_theme'] == "styleB") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp;&nbsp;Green<br />
1169
  &nbsp; <input type="radio" name="mp3foxTheme" value="styleC" <?php if ($theOptions['player_theme'] == "styleC") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp;&nbsp;Blue<br />
1170
- &nbsp; <input type="radio" name="mp3foxTheme" value="styleD" <?php if ($theOptions['player_theme'] == "styleD") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp;&nbsp;Cyan (Alternative style)</p>
1171
- <p style="margin-top:10px; margin-bottom: 24px;">&nbsp; <input type="checkbox" name="mp3foxSmallPlayer" value="true" <?php if ($theOptions['use_small_player'] == "true") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp; Use a small player</p>
1172
-
1173
- <h3 style="margin-bottom: 6px;"><br />Position</h3>
1174
- <p>&nbsp; Left &nbsp;<input type="radio" name="mp3foxFloat" value="left" <?php if ($theOptions['player_float'] == "left") { _e('checked="checked"', "mp3Fox"); }?> />&nbsp;&nbsp;
1175
- | &nbsp;&nbsp;<input type="radio" name="mp3foxFloat" value="right" <?php if ($theOptions['player_float'] == "right") { _e('checked="checked"', "mp3Fox"); }?> />&nbsp; Right
1176
- <br /><span class="description">&nbsp; (<strong>floated</strong>, content wraps around the player)</span></p>
1177
 
 
 
 
 
 
 
1178
  <p>&nbsp; Left &nbsp;<input type="radio" name="mp3foxFloat" value="none" <?php if ($theOptions['player_float'] == "none") { _e('checked="checked"', "mp3Fox"); }?> />&nbsp;&nbsp;
1179
  | &nbsp;&nbsp;<input type="radio" name="mp3foxFloat" value="rel-C" <?php if ($theOptions['player_float'] == "rel-C") { _e('checked="checked"', "mp3Fox"); }?> />&nbsp; Centre &nbsp;
1180
  | &nbsp;&nbsp;<input type="radio" name="mp3foxFloat" value="rel-R" <?php if ($theOptions['player_float'] == "rel-R") { _e('checked="checked"', "mp3Fox"); }?> />&nbsp; Right
1181
- <br /><span class="description">&nbsp; (<strong>relative</strong>, content appears above/below the player)</span></p>
1182
-
1183
- <p style="margin-top: 20px; margin-bottom: 8px;">&nbsp; <input type="checkbox" name="disableTemplateTag" value="true" <?php if ($theOptions['disable_template_tag'] == "true") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp;Ignore player template-tags in theme
1184
- <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="description">(player positioning within content only)</span></p>
1185
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1186
  <br /><br /><br />
1187
  <p style="margin-top: 4px;"><input type="submit" name="update_mp3foxSettings" class="button-primary" value="<?php _e('Update Settings', 'mp3Fox') ?>" />
1188
- &nbsp; Remember settings if plugin is deactivated &nbsp;<input type="checkbox" name="mp3foxRemember" value="true" <?php if ($theOptions['remember_settings'] == "true") { _e('checked="checked"', "mp3Fox"); }?> /></p>
1189
  </form>
1190
 
1191
  <a name="howto"></a>
1192
- <div style="margin: 26px 120px 0px 0px; border-top: 1px solid #555; height: 10px;"></div>
1193
  <p style="margin: 0px 120px 0px 0px;">&nbsp;</p>
1194
- <h4 style="margin: 0px 120px 0px 0px">Help</h4>
1195
- <p class="description" style="margin: 10px 120px 0px 10px;"><strong>How to play mp3's</strong></p>
1196
- <p class="description" style="margin: 10px 120px 10px 10px;">Add tracks on page/post edit screens using the custom fields (below the content box), as follows:</p>
1197
- <p class="description" style="margin: 0px 120px 10px 10px;">1. Enter <code>mp3</code> into the left hand box
1198
- <br />2. Write the filename* into the right hand box and hit 'add custom field'
1199
- <br />3. Repeat above to add more mp3's and and hit 'update page' when you're done</p>
1200
- <p class="description" style="margin: 0px 120px 5px 10px;">* If the file is not in either the media library or your default location then use a full URI.</p>
1201
-
1202
- <p class="description" style="margin: 20px 120px 5px 10px;"><strong>Adding a title and caption:</strong></p>
1203
- <p class="description" style="margin: 10px 120px 5px 10px;">1. Add a dot, then a caption in the left hand box, eg: <code>mp3.Caption</code><br />2. Add the title, then an '@' before the filename, eg: <code>Title@filename</code></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1204
 
1205
- <p class="description" style="margin: 20px 120px 5px 10px;"><strong>Ordering the tracks:</strong></p>
1206
- <p class="description" style="margin: 10px 120px 5px 10px;">Number the left boxes, eg:<code>1 mp3.Caption</code> will be first on the playlist. Un-numbered tracks appear
1207
- below any numbered tracks.</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1208
 
1209
- <p class="description" style="margin: 20px 120px 5px 10px;"><strong>Shortcode:</strong></p>
1210
- <p class="description" style="margin: 10px 120px 5px 10px;"><code>[mp3-jplayer]</code></p>
1211
- <p class="description" style="margin: 5px 120px 5px 10px;">Has the following attributes for control of player position, download, autoplay, and show playlist on each page/post:</p>
1212
- <p class="description" style="margin: 5px 120px 5px 10px;">pos - left, right, rel (or none), rel-C, rel-R, absolute)
1213
- <br />dload - true, false
1214
- <br />play - true, false
1215
- <br />list - true, false</p>
1216
- <p class="description" style="margin: 10px 120px 5px 10px;">eg. <code>[mp3-jplayer play=&quot;true&quot; dload=&quot;true&quot; pos=&quot;rel-C&quot;]</code></p>
1217
- <p class="description" style="margin: 5px 120px 5px 10px;">Shortcode parameters over-ride the settings on this page</p>
 
 
1218
 
1219
- <p class="description" style="margin: 20px 120px 5px 10px;"><strong>Template tags:</strong></p>
1220
- <p class="description" style="margin: 10px 120px 3px 10px;"><code>mp3j_addscripts( $style )</code></p>
1221
- <p class="description" style="margin: 0px 120px 3px 10px;"><code>mp3j_flag( $set )</code></p>
1222
- <p class="description" style="margin: 0px 120px 3px 10px;"><code>mp3j_grab_library( $format )</code></p>
1223
- <p class="description" style="margin: 0px 120px 3px 10px;"><code>mp3j_set_meta( $tracks, $captions )</code></p>
1224
- <p class="description" style="margin: 0px 120px 3px 10px;"><code>mp3j_put( $id, $pos, $dload, $autoplay, $showplaylist )</code></p>
1225
- <p class="description" style="margin: 0px 120px 14px 10px;"><code>mp3j_debug( $output )</code></p>
1226
- <p class="description" style="margin: 0px 120px 5px 10px;">eg: <code>&lt;?php if ( function_exists( 'mp3j_put' ) ) { mp3j_put( 3, 'absolute', '', 'true' ); } ?&gt;</code></p>
1227
-
1228
- <?php
1229
- echo '<p class="description" style="margin: 15px 120px 5px 10px;">See the <a href="' . get_bloginfo('wpurl') . '/wp-content/plugins/mp3-jplayer/readme.htm">readme</a> for more detailed info.</p>';
1230
- //echo '<p class="description" style="margin: 20px 120px 5px 10px;"><a href="http://sjward.org/jplayer-for-wordpress">Plugin home page</a></p>';
1231
- ?>
 
 
 
1232
 
1233
- <div style="margin: 40px 120px 0px 0px; border-top: 1px solid #555; height: 30px;">
1234
  <p class="description" style="margin: 0px 120px px 0px;"><a href="http://sjward.org/jplayer-for-wordpress">Plugin home page</a></p>
1235
  </div>
1236
  <br /><br /><br /><br />
1237
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1238
 
1239
  <?php
1240
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1241
 
1242
- } //end class
1243
- } // end if
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1244
 
1245
 
 
1246
  if ( class_exists("mp3Fox") ) {
1247
  $mp3_fox = new mp3Fox();
1248
  }
1249
- if ( isset($mp3_fox) ) {
1250
 
1251
- /* initialize mp3-jplayer admin page */
1252
 
 
1253
  if ( !function_exists("mp3Fox_ap") ) {
 
1254
  function mp3Fox_ap() {
1255
-
1256
  global $mp3_fox;
1257
  if ( !isset($mp3_fox) ) {
1258
  return;
@@ -1263,30 +2089,24 @@ if ( isset($mp3_fox) ) {
1263
  }
1264
  }
1265
 
1266
- /* mp3j hooks */
1267
-
1268
  function mp3j_put( $id = "", $pos = "", $dload = "", $play = "", $list = "" ) {
1269
-
1270
  do_action( 'mp3j_put', $id, $pos, $dload, $play, $list );
1271
  }
1272
 
1273
  function mp3j_flag( $set = 1 ) {
1274
-
1275
  do_action('mp3j_flag', $set);
1276
  }
1277
 
1278
  function mp3j_addscripts( $style = "" ) {
1279
-
1280
  do_action('mp3j_addscripts', $style);
1281
  }
1282
 
1283
  function mp3j_debug( $display = "" ) {
1284
-
1285
  do_action('mp3j_debug', $display);
1286
  }
1287
 
1288
  function mp3j_grab_library( $format = 1 ) {
1289
-
1290
  $thereturn = array();
1291
  if ( $format == 1 ) {
1292
  $library = apply_filters('mp3j_grab_library', $thereturn );
@@ -1301,24 +2121,27 @@ if ( isset($mp3_fox) ) {
1301
  }
1302
  }
1303
 
1304
- function mp3j_set_meta( $tracks, $captions = "", $mode = 1 ) {
1305
-
1306
  if ( empty($tracks) || !is_array($tracks) ) {
1307
- return;
1308
- }
1309
- do_action('mp3j_set_meta', $tracks, $captions, $mode);
1310
  }
1311
 
1312
- /* register hooks */
 
 
 
1313
 
1314
- //admin
 
1315
  add_action('activate_mp3-jplayer/mp3jplayer.php', array(&$mp3_fox, 'initFox'));
1316
  add_action('deactivate_mp3-jplayer/mp3jplayer.php', array(&$mp3_fox, 'uninitFox'));
1317
  add_action('admin_menu', 'mp3Fox_ap');
1318
-
1319
- //template
1320
  add_action('wp_head', array(&$mp3_fox, 'check_if_scripts_needed'), 2);
1321
  add_filter('the_content', array(&$mp3_fox, 'add_player'));
 
1322
  add_shortcode('mp3-jplayer', array(&$mp3_fox, 'shortcode_handler'));
1323
  add_action('mp3j_put', array(&$mp3_fox, 'template_tag_handler'), 10, 5 );
1324
  add_action('mp3j_flag', array(&$mp3_fox, 'flag_tag_handler'), 10, 1 );
@@ -1327,6 +2150,7 @@ if ( isset($mp3_fox) ) {
1327
  add_filter('mp3j_grab_library', array(&$mp3_fox, 'grablibrary_handler'), 10, 1 );
1328
  add_filter('mp3j_grab_library_wp', array(&$mp3_fox, 'grablibraryWP_handler'), 10, 1 );
1329
  add_action('mp3j_set_meta', array(&$mp3_fox, 'feed_metadata'), 10, 3 );
1330
-
 
1331
  }
1332
  ?>
1
+ <?php /*
 
2
  Plugin Name: MP3-jPlayer
3
  Plugin URI: http://sjward.org/jplayer-for-wordpress
4
+ Description: A flexible MP3 player with a playlist that can be added to your content or sidebar.
5
+ Version: 1.4.0
6
  Author: Simon Ward
7
  Author URI: http://www.sjward.org
8
  License: GPL2
9
+
10
+ Copyright 2011 Simon Ward (email: sinomward@yahoo.co.uk)
11
+
12
+ This program is free software; you can redistribute it and/or modify
13
+ it under the terms of the GNU General Public License, version 2, as
14
+ published by the Free Software Foundation.
15
+
16
+ This program is distributed in the hope that it will be useful,
17
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ GNU General Public License for more details.
20
+
21
+ You should have received a copy of the GNU General Public License
22
+ along with this program; if not, write to the Free Software
23
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
+ */
 
 
25
 
26
+ if ( !class_exists("mp3Fox") )
27
  {
28
  class mp3Fox
29
  {
30
+ // ------------------ //
31
+ var $version_of_plugin = "1.4.0"; // Update me! //
32
+ var $option_count = 21;
33
+ // ------------------ //
 
34
 
35
+ var $iscompat = false;
36
  var $playerHasBeenSet = "false";
37
  var $customFieldsGrabbed = "false";
38
  var $countPlaylist = 0;
40
  var $scriptsflag = "false";
41
  var $postMetaKeys = array();
42
  var $postMetaValues = array();
43
+ var $IDflag_inMeta = "false";
44
  var $feedKeys = array();
45
  var $feedValues = array();
46
+ var $listDisplayMode = "";
47
  var $stylesheet = "";
48
  var $mp3LibraryWP = array();
49
  var $mp3LibraryI = array();
50
+ var $PlayerPlaylist = array( 'artists' => array(), 'titles' => array(), 'files' => array(), 'order' => array(), 'count' => 0 );
51
+ var $idfirstFound = "";
 
52
  var $adminOptionsName = "mp3FoxAdminOptions";
53
  var $theSettings = array();
54
+ // debug //
 
55
  var $playerSetMethod = "*not attempted*";
56
  var $putTag_runCount = 0;
57
  var $shortcode_runCount = 0;
58
  var $defaultAdd_runCount = 0;
59
+ var $widget_runcount = 0;
60
  var $playerAddedOnRun = 0;
61
  var $debugCount = "0";
62
  var $scriptsForced = "false";
63
+ var $activeWidgets = array();
64
 
65
+
66
  /**
67
+ * Handles auto/forced SCRIPT ADDITION.
68
+ * singular pages - scripts are added if there's tracks in custom fields, or if required by widget, or if forced.
69
+ * index page - scripts are added if 'show player on index' option is ticked.
70
+ * called by wp_head() hook
 
71
  */
72
  function check_if_scripts_needed() {
73
 
74
+ $this->make_compatible(); // make sure all plugin options are available //
75
+ if ( ($this->scriptsflag == "true" && $this->theSettings['disable_template_tag'] == "false") || $this->theSettings['force_scripts_from_admin'] == "true" ) {
76
  if ( $this->stylesheet == "" ) {
77
  $this->stylesheet = $this->theSettings['player_theme'];
78
  }
79
  $this->add_Scripts( $this->stylesheet );
80
+ $this->scriptsForced = "true";
81
  if (is_singular() ) {
82
  $this->TT_grab_Custom_Meta();
83
  }
84
+ return;
85
  }
86
+ if ( (is_home() || is_archive()) && $this->theSettings['player_onblog'] == "true" ) {
87
+ $this->add_Scripts( $this->theSettings['player_theme'] );
88
+ }
89
+ if ( is_singular() ) {
90
+ if ( $this->TT_grab_Custom_Meta() > 0 || $this->widget_needs_scripts() ) { // check meta before widget scripts! //
 
 
91
  $this->add_Scripts( $this->theSettings['player_theme'] );
92
  }
93
  }
94
  return;
95
  }
96
 
97
+
98
  /**
99
+ * Handles DEFAULT player placement via CONTENT.
100
+ * If on the posts index then meta key matches are run on each loop.
101
+ * If singular then picking up any tracks found from meta key match run from header
102
+ * Called by the_content() hook
103
  */
104
  function add_player($content='') {
105
 
107
  if ($this->playerHasBeenSet == "true") {
108
  return $content;
109
  }
110
+ if ( empty($this->idfirstFound) && (is_home() || is_archive()) && $this->theSettings['player_onblog'] == "true" ) { // Store id of 1st post with tracks for widget/tag to use when on non-singular pages //
111
+ if ( $this->TT_grab_Custom_Meta() > 0 ) {
112
+ global $post;
113
+ $this->idfirstFound = $post->ID;
 
 
 
 
114
  }
115
+ }
116
+ if ( $this->tagflag == "true" && $this->theSettings['disable_template_tag'] == "false" ) {
117
  return $content;
118
  }
119
+ if ( is_home() && $this->theSettings['player_onblog'] == "true" ) { // Check meta now (on each loop) //
 
120
  if ( $this->TT_grab_Custom_Meta() > 0 ) {
121
  $customvalues = $this->postMetaValues;
122
  $customkeys = $this->postMetaKeys;
123
+ }
124
  else {
125
  return $content;
126
  }
127
  }
128
+ else if ( is_singular() && $this->customFieldsGrabbed == "true" ) { // Try grab the meta from earlier //
129
  $customvalues = $this->postMetaValues;
130
  $customkeys = $this->postMetaKeys;
131
  }
133
  return $content;
134
  }
135
 
136
+ // build playlist //
137
+ $thePlayList = $this->generate_playlist( $customkeys, $customvalues, 1 );
 
 
138
  if ( $thePlayList['count'] == 0 ) {
139
  return $content;
140
  }
141
  $this->countPlaylist = $thePlayList['count'];
142
  $this->PlayerPlaylist = $thePlayList;
143
 
144
+ if ( is_active_widget( false, false, 'mp3-jplayer-widget' , true ) || strpos($content, "[mp3-jplayer") !== false ) {
145
  return $content;
146
  }
147
+ // write startup js and player html //
148
  $this->write_startup_vars( $thePlayList['count'], $this->theSettings['auto_play'], $this->theSettings['playlist_show'] );
149
  $this->write_playlist( $thePlayList );
 
150
  $theplayer = $this->write_player_html( $thePlayList['count'], $this->theSettings['player_float'], $this->theSettings['show_downloadmp3'] );
151
  $content = $theplayer . $content . "<br clear=\"all\" />";
152
  $this->playerHasBeenSet = "true";
153
+ // debug info //
154
  $this->playerSetMethod = "content (default)";
155
  $this->playerAddedOnRun = $this->defaultAdd_runCount;
156
  return $content;
158
 
159
 
160
  /**
161
+ * Handles player placement via SHORTCODE.
162
  * The attributes overide the settings page values.
163
+ * Called via [mp3-jplayer] shortcode.
164
  */
165
  function shortcode_handler($atts, $content = null) {
166
 
167
  $this->shortcode_runCount++;
168
+ if ( ($this->tagflag == "true" && $this->theSettings['disable_template_tag'] == "false") || $this->playerHasBeenSet == "true" || $this->customFieldsGrabbed == "false" ) {
 
 
 
169
  return;
170
  }
171
+ if ( is_active_widget(false, false, 'mp3-jplayer-widget', true) && ((is_home() || is_archive()) || (is_singular() && $this->theSettings['give_shortcode_priority'] == "false")) ) {
172
  return;
173
  }
174
+ extract(shortcode_atts(array( // Defaults //
175
+ 'pos' => $this->theSettings['player_float'],
 
176
  'dload' => $this->theSettings['show_downloadmp3'],
177
  'play' => $this->theSettings['auto_play'],
178
+ 'list' => $this->theSettings['playlist_show'],
179
+ 'shuffle' => false,
180
+ 'id' => '',
181
+ 'slice' => ''
182
  ), $atts));
183
 
184
+ // If FEED:ID was flagged in the custom fields and the shortcode contains an id then try add tracks to current playlist //
185
+ if ( $id != "" && $this->IDflag_inMeta == "true" ) {
186
+ $id = trim($id);
187
+ if ( $this->TT_grab_Custom_Meta($id) > 0 ) {
188
+ $thePlayList = $this->generate_playlist( $this->postMetaKeys, $this->postMetaValues, 1 );
189
+ if ( $thePlayList['count'] > 0 ) {
190
+ foreach ( $this->PlayerPlaylist['order'] as $i => $val ) {
191
+ array_push( $thePlayList['order'], $i + $thePlayList['count'] );
192
+ array_push( $thePlayList['artists'], $this->PlayerPlaylist['artists'][$i] );
193
+ array_push( $thePlayList['titles'], $this->PlayerPlaylist['titles'][$i] );
194
+ array_push( $thePlayList['files'], $this->PlayerPlaylist['files'][$i] );
195
+ }
196
+ $thePlayList['count'] += $this->PlayerPlaylist['count'];
197
+ unset( $this->PlayerPlaylist );
198
+ $this->PlayerPlaylist = $thePlayList;
199
+ }
200
+ }
201
+ }
202
+ if ( $this->PlayerPlaylist['count'] < 1 ) {
203
+ return;
204
+ }
205
+ if ( $slice != "" && $slice > 0 ) {
206
+ $this->take_playlist_slice( $slice );
207
+ }
208
+ // Write startup js and player html //
209
+ if ( $shuffle ) {
210
+ if ( $this->PlayerPlaylist['count'] > 1 ) { shuffle( $this->PlayerPlaylist['order'] ); }
211
+ }
212
+ if ( $list == "radio" || $list == "hidden" || $list == "closed" ) {
213
+ $this->listDisplayMode = $list;
214
+ $list = "false";
215
+ }
216
+ if ( $list == "open" ) { $list = "true"; }
217
  $this->write_startup_vars( $this->PlayerPlaylist['count'], $play, $list );
218
  $this->write_playlist( $this->PlayerPlaylist );
 
219
  $theplayer = $this->write_player_html( $this->countPlaylist, $pos, $dload );
220
  $this->playerHasBeenSet = "true";
221
+ // Debug info //
222
  $this->playerSetMethod = "shortcode";
223
  $this->playerAddedOnRun = $this->shortcode_runCount;
224
  return $theplayer;
225
  }
226
+
227
 
228
  /**
229
+ * Handles player placement via mp3j_put() TAG.
230
  */
231
  function template_tag_handler( $id = "", $pos = "", $dload = "", $play = "", $list = "" ) {
232
 
233
  $this->putTag_runCount++;
234
+ if ( $this->playerHasBeenSet == "true" || $this->theSettings['disable_template_tag'] == "true" || $this->tagflag == "false" ) {
235
  return;
236
  }
 
 
 
 
 
 
237
  if ( ((is_home() || is_archive()) && $this->theSettings['player_onblog'] == "true") || is_singular() ) {
238
+ if ( $id == "first" ) {
239
  $id = $this->idfirstFound;
240
  }
 
241
  if ( $this->TT_grab_Custom_Meta($id) > 0 && $id != "feed" ) {
242
  $customvalues = $this->postMetaValues;
243
  $customkeys = $this->postMetaKeys;
254
  return;
255
  }
256
 
257
+ // Build a playlist //
258
+ $thePlayList = $this->generate_playlist( $customkeys, $customvalues, 1 );
 
 
259
  if ( $thePlayList['count'] == 0 ) {
260
  return;
261
  }
262
  $this->countPlaylist = $thePlayList['count'];
263
  $this->PlayerPlaylist = $thePlayList;
264
 
265
+ // Write startup js and player html //
266
+ if ( $pos == "" ) { $pos = $this->theSettings['player_float']; }
267
+ if ( $dload == "" ) { $dload = $this->theSettings['show_downloadmp3']; }
268
+ if ( $play == "" ) { $play = $this->theSettings['auto_play']; }
269
+
270
+ if ( $list == "" ) { $list = $this->theSettings['playlist_show']; }
271
+ if ( $list == "radio" || $list == "hidden" || $list == "closed" ) {
272
+ $this->listDisplayMode = $list;
273
+ $list = "false";
 
 
274
  }
275
+ if ( $list == "open" ) { $list = "true"; }
276
 
277
  $this->write_startup_vars( $thePlayList['count'], $play, $list );
278
  $this->write_playlist( $thePlayList );
 
279
  $theplayer = $this->write_player_html( $thePlayList['count'], $pos, $dload );
280
+ echo $theplayer;
281
  $this->playerHasBeenSet = "true";
282
+ // debug info //
283
  $this->playerSetMethod = "mp3j_put";
284
  $this->playerAddedOnRun = $this->putTag_runCount;
285
+
286
  return;
287
  }
288
 
289
 
290
+ /**
291
+ * GENERATES A PLAYLIST, puts the custom meta through sorting/filtering routine and returns arrays
292
+ * ready for write_playlist().
293
+ *
294
+ * $method not used yet
295
+ */
296
+ function generate_playlist( $customkeys, $customvalues, $method = 1 ) {
297
+
298
+ if ( count($customkeys) == 0 ) { return; }
299
+ $theSplitMeta = $this->splitup_meta( $customkeys, $customvalues );
300
+ $theAssembledMeta = $this->compare_swap( $theSplitMeta, $customkeys, $customvalues );
301
+ $theTrackLists = $this->sort_tracks( $theAssembledMeta, $customkeys );
302
+ $thePlayList = $this->remove_mp3remote( $theTrackLists );
303
+ return $thePlayList;
304
+ }
305
+
306
+
307
+ /**
308
+ * Selects a random selection of x tracks from the playlist
309
+ * while preserving track running order
310
+ */
311
+ function take_playlist_slice( $slicesize ) {
312
+
313
+ if ( ($n = $this->PlayerPlaylist['count']) < 1 ) { return; }
314
+ $n = $this->PlayerPlaylist['count'];
315
+ $slicesize = trim($slicesize);
316
+ if ( !empty($slicesize) && $slicesize >= 1 ) {
317
+ if ( $n > 1 ) {
318
+ if ( $slicesize > $n ) { $slicesize = $n; }
319
+ $picklist = array();
320
+ for ( $i = 0; $i < $n; $i++ ) { // make a numbers array //
321
+ $picklist[$i] = $i;
322
+ }
323
+ shuffle( $picklist );
324
+ $picklist = array_slice( $picklist, 0, $slicesize ); // take a shuffled slice //
325
+ natsort( $picklist ); // reorder it //
326
+ $j=0;
327
+ foreach ( $picklist as $i => $num ) { // use it to pick the random tracks in order //
328
+ $Ptitles[$j] = $this->PlayerPlaylist['titles'][$num];
329
+ $Partists[$j] = $this->PlayerPlaylist['artists'][$num];
330
+ $Pfiles[$j] = $this->PlayerPlaylist['files'][$num];
331
+ //$Porder[$j++] = $this->PlayerPlaylist['order'][$num];
332
+ $Porder[$j] = $j;
333
+ $j++;
334
+ }
335
+ $thePlayList = array( 'artists' => $Partists,
336
+ 'titles' => $Ptitles,
337
+ 'files' => $Pfiles,
338
+ 'order' => $Porder,
339
+ 'count' => $j );
340
+ unset($this->PlayerPlaylist);
341
+ $this->PlayerPlaylist = $thePlayList;
342
+ $this->countPlaylist = $thePlayList['count'];
343
+ return $thePlayList;
344
+ }
345
+ }
346
+ }
347
+
348
+
349
  /**
350
  * FLAGS for an UPCOMING mp3j_put TAG.
351
  * Called via mp3j_flag.
352
  */
353
  function flag_tag_handler($set = 1) {
354
+
355
+ if ( $set == 0 ) { $this->tagflag = "false"; }
356
+ if ( $set == 1 ) { $this->tagflag = "true"; }
 
 
 
357
  return;
358
  }
359
 
360
 
361
  /**
362
  * FLAGS for SCRIPTS to be added.
363
+ * Called via mp3j_addscripts template tag.
364
  */
365
  function scripts_tag_handler( $style = "" ) {
366
 
369
  $this->theSettings = get_option($this->adminOptionsName);
370
  $this->stylesheet = $this->theSettings['player_theme'];
371
  }
372
+ else { $this->stylesheet = $style; }
 
 
373
  return;
374
  }
375
 
380
  */
381
  function grablibrary_handler( $thereturn ) {
382
 
383
+ if ( empty($this->mp3LibraryI) ) { $this->grab_library_info(); }
 
 
384
  $thereturn = $this->mp3LibraryI;
385
  return $thereturn;
386
  }
392
  */
393
  function grablibraryWP_handler( $thereturn ) {
394
 
395
+ if ( empty($this->mp3LibraryWP) ) { $this->grab_library_info(); }
 
 
396
  $thereturn = $this->mp3LibraryWP;
397
  return $thereturn;
398
  }
399
 
400
+
401
+ /**
402
+ * READS mp3's from a LOCAL DIRECTORY.
403
+ * Returns an array of their uri's.
404
+ */
405
+ function grab_local_folder_mp3s( $folder ) {
406
+
407
+ $Srooturl = $_SERVER['HTTP_HOST'];
408
+ $rooturl = str_replace("www.", "", $Srooturl);
409
+ $items = array();
410
+ $debug = $this->theSettings['echo_debug'];
411
+ if ( ($lp = strpos($folder, $rooturl)) || preg_match("!^/!", $folder) ) {
412
+ if ( $lp !== false ) {
413
+ $folderpath = str_replace($rooturl, "", $folder);
414
+ $folderpath = str_replace("www.", "", $folderpath);
415
+ $folderpath = str_replace("http://", "", $folderpath);
416
+ }
417
+ else {
418
+ $folderpath = $folder;
419
+ }
420
+ $path = $_SERVER['DOCUMENT_ROOT'] . $folderpath;
421
+ if ($handle = @opendir($path)) {
422
+ $j=0;
423
+ while (false !== ($file = readdir($handle))) {
424
+ if ( $file != '.' && $file != '..' && filetype($path.'/'.$file) == 'file' && preg_match("!\.mp3$!i", $file) ) {
425
+ $items[$j++] = $file;
426
+ }
427
+ }
428
+ closedir($handle);
429
+ if ( ($c = count($items)) > 0 ) {
430
+ natcasesort($items);
431
+ $folderpath = preg_replace( "!/+$!", "", $folderpath );
432
+ foreach ( $items as $i => $mp3 ) {
433
+ $items[$i] = "http://" . $Srooturl . $folderpath . "/" . $mp3;
434
+ }
435
+ }
436
+ if ( $debug == "true" ) { echo "\n<!-- \n\nMP3-jPlayer\nDone\nmp3's in folder: " . $c . "\nhttp://" . $Srooturl . $folderpath . "\n\n -->"; }
437
+ return $items;
438
+ }
439
+ else {
440
+ if ( $debug == "true" ) { echo "\n<!-- \n\nMP3-jPlayer\nFailed to open local folder, check path and permissions.\nhttp://" . $Srooturl . $folderpath . "\n\n-->"; }
441
+ return true;
442
+ }
443
+ }
444
+ else {
445
+ if ( $debug == "true" ) { echo "\n<!-- \n\nMP3-jPlayer\nFolder path is either unreadable or remote, didn't attempt to read it.\n" . $folderpath . "\n\n -->"; }
446
+ return false;
447
+ }
448
+ }
449
+
450
+
451
+ /**
452
+ * GETS the current ACTIVE player WIDGETS and checks their settings to see if any
453
+ * are in mode 2 or 3 (playing a set list, if so then scripts will be needed regardless of custom fields).
454
+ * Returns true if it finds an active widget in mode 2 or 3
455
+ */
456
+ function widget_needs_scripts() {
457
+
458
+ $activeplayerwidgets = array();
459
+ $widgetneedsScripts = false;
460
+
461
+ // get instances of active players //
462
+ $name = "sidebars_widgets";
463
+ $sidebarsettings = get_option($name);
464
+ $n = 0;
465
+ foreach ( $sidebarsettings as $key => $arr ) {
466
+ if ( strpos($key, "sidebar") !== false ) {
467
+ foreach ( $arr as $i => $widget ) {
468
+ if ( strchr($widget, "mp3-jplayer-widget") ) {
469
+ $activeplayerwidgets[$n++] = $widget;
470
+ }
471
+ }
472
+ }
473
+ }
474
+ $this->activeWidgets = $activeplayerwidgets; // Debug //
475
+
476
+ // if active then check their modes //
477
+ if ( !empty($activeplayerwidgets) ) {
478
+ $name = "widget_mp3-jplayer-widget";
479
+ $widgetoptions = get_option($name);
480
+ foreach ( $activeplayerwidgets as $i => $playerwidget ) {
481
+ $widgetID = strrchr( $playerwidget, "-" );
482
+ $widgetID = str_replace( "-", "", $widgetID );
483
+ foreach ( $widgetoptions as $j => $arr ) {
484
+ if ( $j == $widgetID ) {
485
+ if ( $arr['widget_mode'] == "2" || $arr['widget_mode'] == "3" ) {
486
+ $widgetneedsScripts = true;
487
+ break 2;
488
+ }
489
+ }
490
+ }
491
+ }
492
+ }
493
+ return $widgetneedsScripts;
494
+ }
495
 
496
+
497
  /**
498
  * GETS custom field META from post/page.
499
  * Takes optional post id, creates indexed arrays.
504
  if ( $id == "feed" ) {
505
  return 1;
506
  }
 
 
 
 
 
 
 
 
507
  if ( !empty($this->postMetaValues) ) {
508
+ unset( $this->postMetaKeys, $this->postMetaValues );
 
509
  $this->postMetaKeys = array();
510
  $this->postMetaValues = array();
511
  $this->customFieldsGrabbed = "false";
512
  }
513
+ $this->IDflag_inMeta == "false";
514
 
515
+ global $wpdb;
516
+ global $post;
517
+ if ( $id == "" ) { $id = $post->ID; }
518
+ $pagesmeta = $wpdb->get_results("SELECT * FROM $wpdb->postmeta WHERE post_id =" .$id. " ORDER BY meta_key ASC");
519
  $i = 0;
520
  $metacount = 0;
521
+ foreach ( $pagesmeta as $obj ) {
522
  $flag = 0;
523
  foreach ( $obj as $k => $value ) {
524
  if ( $k == "meta_key" ){
525
+ if ( preg_match('/^([0-9]+(\s)?)?mp3(\..*)?$/', $value) == 1 ) { // Grab the meta //
526
  $this->postMetaKeys[$i] = $value;
527
  $metacount++;
528
  $flag = 1;
529
  }
530
  }
531
  if ( $k == "meta_value" ){
532
+ if ( $flag == 1 ) { $this->postMetaValues[$i++] = $value; }
 
 
533
  }
534
  }
535
  }
536
+
537
+ foreach ( $this->postMetaValues as $i => $val ) { // Store any 'FEED' values/keys and delete them //
538
+ if ( preg_match( "!^FEED:(DF|ID|LIB|/.*)$!i", $val ) == 1 ) {
539
+ $sources[$i] = strstr( $val, ":" );
540
+ $sources[$i] = str_replace( ":", "", $sources[$i] );
541
+ $sourcekeys[$i] = $this->postMetaKeys[$i];
542
+ unset( $this->postMetaValues[$i], $this->postMetaKeys[$i] );
543
+ $metacount--;
544
+ }
545
+ }
546
+ if ( !empty($sources) ) { // Add the feeds to postMeta arrays //
547
+ $this->extend_custom_meta( $sources, $sourcekeys );
548
+ $metacount = count($this->postMetaKeys);
549
+ if ( $this->IDflag_inMeta == "true" ) { $metacount++; } // Add a confusing 'false' count for any ID type feeds to be picked up later //
550
+ }
551
+ $this->postMetaValues = array_values( $this->postMetaValues );
552
+ $this->postMetaKeys = array_values( $this->postMetaKeys );
553
+ if ( $metacount > 0 ) { $this->customFieldsGrabbed = "true"; } // it has become confusing since FEED:ID added, to sort! //
554
  return $metacount;
555
  }
556
 
559
  * Creates ALTERNATIVE META ARRAYS.
560
  * Called via mp3j_set_meta.
561
  *
562
+ * $startnum is the track number offset to use when labeling the metakeys
563
  */
564
+ function feed_metadata( $tracks, $captions = "", $startnum = 1 ) {
565
 
566
+ if ( empty($tracks) || !is_array($tracks) ) {
567
+ return;
568
  }
569
+ unset( $this->feedKeys );
570
+ unset( $this->feedValues );
571
+ $this->feedKeys = array();
572
+ $this->feedValues = array();
573
+
574
+ $j = 1;
575
+ if ( empty($captions) ) {
576
+ foreach ( $tracks as $i => $file ) {
577
+ $this->feedKeys[$i] = $startnum++ . " mp3.";
578
+ $this->feedValues[$i] = $file;
 
 
579
  }
580
+ }
581
+ else {
582
+ foreach ( $tracks as $i => $file ) {
583
+ if ( !empty($captions[$i]) ) {
584
+ if ( preg_match('/^([0-9]+(\s)?)?mp3(\..*)?$/', $captions[$i]) == 1 ) {
585
+ $this->feedKeys[$i] = $captions[$i];
586
  }
587
  else {
588
+ $this->feedKeys[$i] = $startnum++ . " mp3." . $captions[$i];
589
  }
 
590
  }
591
+ else {
592
+ $this->feedKeys[$i] = $startnum++ . " mp3.";
593
+ }
594
+ $this->feedValues[$i] = $file;
595
  }
 
 
 
 
 
596
  }
597
+ return;
598
  }
599
 
600
 
601
+ /**
602
+ * PUSHES new tracks onto POSTMETA arrays according to Library and local folder feed types,
603
+ * and flags for an ID feed to be set by shortcode
604
+ */
605
+ function extend_custom_meta( $feeds, $keys ) {
606
+
607
+ foreach ( $feeds as $i => $val )
608
+ {
609
+ if ( $val == "ID" ) {
610
+ $this->IDflag_inMeta = "true";
611
+ }
612
+ elseif ( $val == "LIB" ) {
613
+ if ( empty($this->mp3LibraryI) ) { $library = $this->grab_library_info(); }
614
+ else { $library = $this->mp3LibraryI; }
615
+ if ( $library['count'] >= 1 ) {
616
+ $counter = count($this->postMetaValues);
617
+ foreach ( $library['filenames'] as $k => $fn ) {
618
+ $captions[$k] = $keys[$i];
619
+ }
620
+ $this->feed_metadata( $library['filenames'], $captions, ++$counter );
621
+ foreach ( $this->feedKeys as $j => $x ) {
622
+ array_push( $this->postMetaValues, $this->feedValues[$j] );
623
+ array_push( $this->postMetaKeys, $x );
624
+ }
625
+ }
626
+ }
627
+ else {
628
+ if ( $val == "DF" ) { $val = $this->theSettings['mp3_dir']; }
629
+ $tracks = $this->grab_local_folder_mp3s( $val );
630
+ if ( $tracks !== true && $tracks !== false && count($tracks) > 0 ) {
631
+ $counter = count($this->postMetaValues);
632
+ foreach ( $tracks as $k => $fn ) {
633
+ $captions[$k] = $keys[$i];
634
+ }
635
+ $this->feed_metadata( $tracks, $captions, ++$counter );
636
+ foreach ( $this->feedKeys as $j => $x ) {
637
+ array_push( $this->postMetaValues, $this->feedValues[$j] );
638
+ array_push( $this->postMetaKeys, $x );
639
+ }
640
+ }
641
+ }
642
+ }
643
+ return;
644
+ }
645
+
646
+
647
  /**
648
  * Returns LIBRARY mp3 filenames, titles, excerpts, content, uri's
649
  * in indexed arrays.
651
  function grab_library_info() {
652
 
653
  global $wpdb;
654
+ $audioInLibrary = $wpdb->get_results("SELECT DISTINCT guid, post_title, post_excerpt, post_content, ID FROM $wpdb->posts WHERE post_mime_type = 'audio/mpeg'");
655
  $j=0;
656
  $Lcount = count($audioInLibrary);
657
  $this->mp3LibraryWP = $audioInLibrary;
672
  if ( $itemkey == "post_content" ) {
673
  $libraryDescriptions[$j] = $itemvalue;
674
  }
675
+ if ( $itemkey == "ID" ) {
676
+ $libraryPostIDs[$j] = $itemvalue;
677
+ }
678
  }
679
  $j++;
680
  }
681
+ if ( $libraryFilenames ) { natcasesort($libraryFilenames); }
682
  $theLibrary = array( 'filenames' => $libraryFilenames,
683
  'titles' => $libraryTitles,
684
  'urls' => $libraryURLs,
685
  'excerpts' => $libraryExcerpts,
686
  'descriptions' => $libraryDescriptions,
687
+ 'postIDs' => $libraryPostIDs,
688
  'count' => $Lcount );
689
  $this->mp3LibraryI = $theLibrary;
690
  return $theLibrary;
699
  */
700
  function splitup_meta($customkeys, $customvalues) {
701
 
702
+ // Captions //
703
  $prevArtist = "";
704
  foreach ( $customkeys as $i => $ckvalue ) {
705
  $splitkey = explode('.', $ckvalue, 2);
706
+ if ( empty($splitkey[1]) ) {
707
  if ( preg_match('/^([0-9]+(\s)?)?mp3\.$/', $ckvalue) == 1 ) {
708
  $customArtists[$i] = "";
709
  }
717
  $prevArtist = $customArtists[$i];
718
  }
719
 
720
+ // Titles & Filenames //
721
  foreach ( $customvalues as $i => $cvvalue ) {
 
722
  $checkfortitle = strpos($cvvalue, '@');
723
  if ( $checkfortitle === false ) {
724
  $customTitles[$i] = str_replace(".mp3", "", $cvvalue);
743
  }
744
  }
745
  }
 
746
  $theSplitMeta = array( 'artists' => $customArtists,
747
  'titles' => $customTitles,
748
  'files' => $customFilenames );
751
 
752
 
753
  /**
754
+ * Returns PREPARED ARRAYS that are ready for playlist.
755
  * Looks for $customFilenames that exist in the library and grabs their full uri's, otherwise
756
  * adds default path or makes sure has an http when remote. Cleans up titles that are uri's, swaps
757
  * titles and/or artists for the library ones when required.
760
  */
761
  function compare_swap($theSplitMeta, $customkeys, $customvalues) {
762
 
763
+ if ( empty($this->mp3LibraryI) ) {
764
+ $library = $this->grab_library_info();
765
  }
766
+ else {
767
  $library = $this->mp3LibraryI;
768
  }
 
769
  foreach ( $theSplitMeta['files'] as $i => $cfvalue )
770
  {
771
+ if ( $library['count'] == 0 ) {
772
  $inLibraryID = false;
773
  }
774
  else {
775
  $inLibraryID = array_search( $cfvalue, $library['filenames'] );
776
  }
777
  $mp3haswww = strpos($cfvalue, 'http://');
778
+ if ( $mp3haswww === false && $inLibraryID === false ) { // File is local but not in library //
 
 
779
  if ( $this->theSettings['mp3_dir'] == "/" ) {
780
  $theSplitMeta['files'][$i] = $this->theSettings['mp3_dir'] . $theSplitMeta['files'][$i];
781
  }
783
  $theSplitMeta['files'][$i] = $this->theSettings['mp3_dir']. "/" . $theSplitMeta['files'][$i];
784
  }
785
  }
786
+ if ( $inLibraryID !== false ) { // File is in library //
 
 
787
  $theSplitMeta['files'][$i] = $library['urls'][$inLibraryID];
788
  if ( $this->theSettings['playlist_UseLibrary'] == "true" ) {
789
  $theSplitMeta['titles'][$i] = $library['titles'][$inLibraryID];
801
  }
802
  }
803
  }
804
+ if ( $mp3haswww !== false && $inLibraryID === false ) { // File is remote or user is over-riding default path //
 
 
805
  if ( strpos($theSplitMeta['titles'][$i], 'http://') !== false || strpos($theSplitMeta['titles'][$i], 'www.') !== false ) {
806
  $theSplitMeta['titles'][$i] = strrchr($theSplitMeta['titles'][$i], "/");
807
  $theSplitMeta['titles'][$i] = str_replace( "/", "", $theSplitMeta['titles'][$i]);
813
  'titles' => $theSplitMeta['titles'],
814
  'files' => $theSplitMeta['files'] );
815
  return $theAssembledMeta;
 
816
  }
817
 
818
 
819
  /**
820
+ * SORTS TRACKS by either the titles(if a-z ticked) or by the keys (only if there's
821
+ * any numbering in them) and adds an ordering array
822
  *
823
  * Return: artists, titles, files, order.
824
  */
887
  $playlistArtists = $theTrackLists['artists'];
888
  $indexorderAllowed = $theTrackLists['order'];
889
  }
890
+ $playlistTitles = str_replace('"', '\"', $playlistTitles); // Escapes quotes for the js array //
891
  $nAllowed = count($playlistFilenames);
892
 
893
  $thePlayList = array( 'artists' => $playlistArtists,
909
  wp_enqueue_script( 'ui.progressbar.min', '/wp-content/plugins/mp3-jplayer/js/ui.progressbar.min.js', array( 'jquery' ) );
910
  wp_enqueue_script( 'ui.slider.min', '/wp-content/plugins/mp3-jplayer/js/ui.slider.min.js', array( 'jquery' ) );
911
  wp_enqueue_script( 'jquery.jplayer.min', '/wp-content/plugins/mp3-jplayer/js/jquery.jplayer.min.js', array( 'jquery' ) );
912
+ wp_enqueue_script( 'mp3-jplayer', '/wp-content/plugins/mp3-jplayer/js/mp3-jplayer.js', array( 'jquery' ) );
913
+
914
+ // Set the style sheet either from admin (A-E) or template tag //
915
+ $size = "";
916
+ if ( $this->theSettings['use_small_player'] == "true" ) { $size = "-sidebar"; }
917
+ if ( $theme == "styleA" ) { $themepath = "/wp-content/plugins/mp3-jplayer/css/mp3jplayer-grey" . $size . ".css"; }
918
+ if ( $theme == "styleB" ) { $themepath = "/wp-content/plugins/mp3-jplayer/css/mp3jplayer-green" . $size . ".css"; }
919
+ if ( $theme == "styleC" ) { $themepath = "/wp-content/plugins/mp3-jplayer/css/mp3jplayer-blu" . $size . ".css"; }
920
+ if ( $theme == "styleD" ) { $themepath = str_replace(".css", "", $this->theSettings['custom_stylesheet']) . $size . ".css"; }
921
+ if ( $theme == "styleE" ) { $themepath = "/wp-content/plugins/mp3-jplayer/css/mp3jplayer-text" . $size . ".css"; }
922
+ $name = strrchr( $themepath, "/");
 
 
 
 
 
 
 
 
 
 
 
923
  $name = str_replace( "/", "", $name);
924
  $name = str_replace( ".css", "", $name);
925
+ wp_enqueue_style( $name, $themepath );
926
  return;
927
  }
928
 
932
  */
933
  function write_startup_vars( $count, $autoplay = "", $showlist = "" ) {
934
 
935
+ if ( $autoplay != "true" && $autoplay != "false" ) { $autoplay = $this->theSettings['auto_play']; }
936
+ if ( $showlist != "true" && $showlist != "false" ) { $showlist = $this->theSettings['playlist_show']; }
 
 
 
 
937
 
938
  $wpinstallpath = get_bloginfo('wpurl');
939
  echo "\n\n<script type=\"text/javascript\">\n<!--\n";
960
  echo "\n\n<script type=\"text/javascript\">\n<!--\n";
961
  echo "var foxPlayList = [\n";
962
  $tracknumber = 1;
963
+ $addNo = $this->theSettings['add_track_numbering'];
964
  foreach ( $thePlayList['order'] as $ik => $i ) {
965
+ echo "{name: \"";
966
+ if ( $addNo == "true" ) {
967
+ echo $tracknumber . ". ";
968
+ }
969
+ echo $thePlayList['titles'][$i]. "\", mp3: \"" .$thePlayList['files'][$i]. "\", artist: \"" .$thePlayList['artists'][$i]. "\"}";
970
  if ( $tracknumber != $thePlayList['count'] ) {
971
  echo ",";
972
  }
983
  * WRITES PLAYER HTML
984
  */
985
  function write_player_html( $count, $position, $download ) {
986
+
987
+ if ( $position == "left" ) { $floater = "float: left; padding: 5px 50px 50px 0px;"; }
988
+ else if ( $position == "right" ) { $floater = "float: right; padding: 5px 0px 50px 50px;"; }
989
+ else if ( $position == "absolute" ) { $floater = "position: absolute;"; }
990
+ else if ( $position == "rel-C" ) { $floater = "position:relative; padding:5px 0px 50px 0px; margin:0px auto 0px auto;"; }
991
+ else if ( $position == "rel-R" ) { $floater = "position:relative; padding:5px 0px 50px 0px; margin:0px 0px 0px auto;"; }
992
+ else { $floater = "position: relative; padding: 5px 0px 50px 0px;"; }
993
+
994
+ if ( $download == "true" ) { $showMp3Link = "visibility: visible;"; }
995
+ else { $showMp3Link = "visibility: hidden;"; }
996
+
997
+ if ( $count < 2 ) {
998
+ $showlistcontrolsP = "visibility: hidden;";
999
+ $showlistcontrolsN = "visibility: hidden;";
1000
+ $showlisttoggle = "visibility: hidden;";
1001
+ }
1002
+ else if ( $count >= 2 && $this->listDisplayMode == "radio" ) {
1003
+ $showlistcontrolsP = "visibility: hidden;";
1004
+ $showlistcontrolsN = "visibility: visible;";
1005
+ $showlisttoggle = "visibility: hidden;";
1006
+ }
1007
+ else if ( $count >= 2 && $this->listDisplayMode == "hidden" ) {
1008
+ $showlistcontrolsP = "visibility: visible;";
1009
+ $showlistcontrolsN = "visibility: visible;";
1010
+ $showlisttoggle = "visibility: hidden;";
1011
+ }
1012
+ else {
1013
+ $showlistcontrolsP = "visibility: visible;";
1014
+ $showlistcontrolsN = "visibility: visible;";
1015
+ $showlisttoggle = "visibility: visible;";
1016
+ }
1017
+
 
 
 
 
 
 
 
 
 
1018
  $player = "<div id=\"jquery_jplayer\"></div>
1019
  <div class=\"jp-playlist-player\" style=\"" .$floater. "\">
1020
  <div class=\"jp-innerwrap\">
1023
  <div id=\"innerright\"></div>
1024
  <div id=\"innertab\"></div>\n
1025
  <div class=\"jp-interface\">
1026
+ <div id=\"player-track-title\"></div>
1027
+ <div id=\"player-artist\"></div>
1028
  <ul class=\"jp-controls\">
1029
+ <li><a href=\"#\" id=\"jplayer_play\" class=\"jp-play\" tabindex=\"1\">Play</a></li>
1030
+ <li><a href=\"#\" id=\"jplayer_pause\" class=\"jp-pause\" tabindex=\"1\">Pause</a></li>
1031
+ <li><a href=\"#\" id=\"jplayer_stop\" class=\"jp-stop\" tabindex=\"1\">Stop</a></li>
1032
+ <li><a href=\"#\" id=\"jplayer_previous\" class=\"jp-previous\" tabindex=\"1\" style=\"" .$showlistcontrolsP. "\">&laquo;prev</a></li>
1033
+ <li><a href=\"#\" id=\"jplayer_next\" class=\"jp-next\" tabindex=\"1\" style=\"" .$showlistcontrolsN. "\">next&raquo;</a></li>
1034
  </ul>
1035
  <div id=\"sliderVolume\"></div>
1036
  <div id=\"bars_holder\">
1040
  <div id=\"jplayer_play_time\" class=\"jp-play-time\"></div>
1041
  <div id=\"jplayer_total_time\" class=\"jp-total-time\"></div>
1042
  <div id=\"status\"></div>
 
 
1043
  <div id=\"downloadmp3-button\" style=\"" .$showMp3Link. "\"></div>
1044
+ <div id=\"playlist-toggle\" style=\"" .$showlisttoggle. "\" onclick=\"javascript:toggleplaylist();\">HIDE PLAYLIST</div>
1045
  </div>
1046
  </div>\n
1047
  <div id=\"playlist-wrap\">
1048
  <div id=\"jplayer_playlist\" class=\"jp-playlist\"><ul><li></li></ul></div>
1049
  </div>
1050
  </div>\n";
 
1051
  return $player;
1052
  }
1053
+
1054
+
1055
+ /**
1056
+ * Diagnostic print handler.
1057
+ * Called by wp_footer().
1058
+ */
1059
+ function debug_print_handler() {
1060
+ if ( $this->theSettings['echo_debug'] == "true" ) {
1061
+ $this->debug_info('all');
1062
+ }
1063
+ return;
1064
+ }
1065
+
1066
 
1067
  /**
1068
+ * DIAGNOSTIC HELP, prints vars/arrays to browser source view.
1069
+ * Called via mp3j_debug() template tag, or admin settings.
1070
  * needs improvement.
1071
  */
1072
  function debug_info( $display = "" ) {
1073
 
1074
  $this->make_compatible();
1075
  $this->debugCount++;
1076
+ echo "\n\n<!-- *** DIAGNOSTIC " . $this->debugCount;
1077
+ if ( $display == "" ) { echo " (Summary)"; }
1078
+ else { echo " (Long)"; }
1079
+ echo " * MP3-jPlayer (" . $this->version_of_plugin . ") ***\n\n*** Template:\nPage type: ";
1080
+ if ( is_singular() ) { echo "Singular "; }
1081
  if ( is_home() ) { echo "Posts index"; }
1082
+ else if ( is_single() ) { echo "post"; }
1083
+ else if ( is_page() ) { echo "page"; }
1084
  else if ( is_archive() ) { echo "Archive"; }
1085
  else { echo "other"; }
1086
  echo "\nAllow tags: ";
1087
  if ( $this->theSettings['disable_template_tag'] == "false" ) { echo "Yes"; }
1088
  else { echo "NO"; }
1089
+ echo "\nScripts forced: " . $this->scriptsForced . "\nmp3j_put flagged: " . $this->tagflag;
1090
+ echo "\n\n*** Things encountered:\ncontent: " . $this->defaultAdd_runCount . "\nshortcodes: " . $this->shortcode_runCount . "\nwidgets: " . $this->widget_runcount . "\nmp3j_put tags: " . $this->putTag_runCount;
1091
+ echo "\n\nAttempted to add player via: " . $this->playerSetMethod;
1092
+ if ( $this->playerAddedOnRun > 0 ) { echo " on encounter no. " . $this->playerAddedOnRun; }
1093
  echo "\nplaylist count: " . $this->countPlaylist;
 
1094
  echo "\n\nADMIN SETTINGS:\n";
1095
  print_r($this->theSettings);
1096
+ echo "\n\nACTIVE PLAYER WIDGETS:\n";
1097
+ if ( empty($this->activeWidgets) ) {
1098
+ $this->widget_needs_scripts();
1099
+ }
1100
+ print_r( $this->activeWidgets );
1101
 
1102
  if ( $display == "" || $display == "vars" ) {
1103
  echo " \n\n-->\n\n";
1104
  return;
1105
+ }
1106
+ echo "\n\nTHE CURRENT META KEYS:\n";
 
 
1107
  print_r($this->postMetaKeys);
1108
+ echo "\n\nTHE CURRENT META VALUES:\n";
1109
  print_r($this->postMetaValues);
1110
+ echo "\n\nTHE CURRENT FEED KEYS:\n";
1111
  print_r($this->feedKeys);
1112
+ echo "\n\nTHE CURRENT FEED VALUES:\n";
1113
  print_r($this->feedValues);
1114
+ echo "\n\nTHE CURRENT PLAYLIST:\n";
1115
  print_r($this->PlayerPlaylist);
1116
  if ( empty($this->mp3LibraryI) ) { $this->grab_library_info(); }
1117
+ echo "\n\n* MP3's IN THE LIBRARY:\n";
1118
  print_r($this->mp3LibraryI);
1119
+ echo "\n\nWIDGET SETTINGS (including inactive widgets):\n";
1120
+ $get = "widget_mp3-jplayer-widget";
1121
+ $widgetoptions = get_option($get);
1122
+ print_r( $widgetoptions );
1123
  echo " \n\n-->\n\n";
1124
  return;
1125
  }
1129
  * called when PLUGIN is ACTIVATED to create options if none exist.
1130
  */
1131
  function initFox() {
 
1132
  $this->getAdminOptions();
1133
  }
1134
 
1135
+
1136
  /**
1137
  * called when PLUGIN DEactivated, keeps the admin settings if option was ticked.
1138
  */
1143
  delete_option($this->adminOptionsName);
1144
  }
1145
  }
1146
+
1147
 
 
1148
  /**
1149
  * Makes sure options array is up to date with current plugin.
1150
  */
1171
  */
1172
  function getAdminOptions() {
1173
 
1174
+ $mp3FoxAdminOptions = array( // default settings //
1175
  'initial_vol' => '100',
1176
  'auto_play' => 'true',
1177
  'mp3_dir' => '/',
1187
  'show_downloadmp3' => 'false',
1188
  'disable_template_tag' => 'false',
1189
  'db_plugin_version' => $this->version_of_plugin,
1190
+ 'use_small_player' => 'false',
1191
+ 'force_scripts_from_admin' => 'false',
1192
+ 'custom_stylesheet' => '/wp-content/plugins/mp3-jplayer/css/mp3jplayer-cyanALT.css',
1193
+ 'give_shortcode_priority' => 'true',
1194
+ 'echo_debug' => 'false',
1195
+ 'add_track_numbering' => 'true' );
1196
 
1197
  $theOptions = get_option($this->adminOptionsName);
1198
  if ( !empty($theOptions) ) {
1206
 
1207
 
1208
  /**
1209
+ * DISPLAYS ADMIN page.
1210
  */
1211
  function printAdminPage() {
1212
 
1213
  $theOptions = $this->getAdminOptions();
1214
  if (isset($_POST['update_mp3foxSettings']))
1215
  {
1216
+ if (isset($_POST['mp3foxAutoplay'])) { $theOptions['auto_play'] = $_POST['mp3foxAutoplay']; }
1217
+ else { $theOptions['auto_play'] = "false"; }
1218
+
 
 
 
1219
  if (isset($_POST['mp3foxVol'])) {
1220
  $theOptions['initial_vol'] = preg_replace("/[^0-9]/","", $_POST['mp3foxVol']);
1221
  if ($theOptions['initial_vol'] < 0 || $theOptions['initial_vol']=="") {
1225
  $theOptions['initial_vol'] = "100";
1226
  }
1227
  }
1228
+
1229
  if (isset($_POST['mp3foxfolder'])) {
1230
  $theOptions['mp3_dir'] = preg_replace("!^.*www*\.!", "http://www.", $_POST['mp3foxfolder']);
1231
  if (strpos($theOptions['mp3_dir'], "http://") === false) {
1235
  else {
1236
  $theOptions['mp3_dir'] = preg_replace("!^/+!", "/", $theOptions['mp3_dir']);
1237
  }
1238
+
1239
+ }
1240
+ if (preg_match("!.+/+$!", $theOptions['mp3_dir']) == 1) {
1241
+ $theOptions['mp3_dir'] = preg_replace("!/+$!", "", $theOptions['mp3_dir']);
1242
  }
1243
  if ($theOptions['mp3_dir'] == "") {
1244
  $theOptions['mp3_dir'] = "/";
1245
  }
1246
  }
1247
+
1248
+ if (isset($_POST['mp3foxTheme'])) { $theOptions['player_theme'] = $_POST['mp3foxTheme']; }
1249
+
1250
+ if (isset($_POST['mp3foxAllowRemote'])) { $theOptions['allow_remoteMp3'] = $_POST['mp3foxAllowRemote']; }
1251
+ else { $theOptions['allow_remoteMp3'] = "false"; }
1252
+
1253
+ if (isset($_POST['mp3foxAtoZ'])) { $theOptions['playlist_AtoZ'] = $_POST['mp3foxAtoZ']; }
1254
+ else { $theOptions['playlist_AtoZ'] = "false"; }
1255
+
1256
+ if (isset($_POST['mp3foxFloat'])) { $theOptions['player_float'] = $_POST['mp3foxFloat']; }
1257
+
1258
+ if (isset($_POST['mp3foxOnBlog'])) { $theOptions['player_onblog'] = $_POST['mp3foxOnBlog']; }
1259
+ else { $theOptions['player_onblog'] = "false"; }
1260
+
1261
+ if (isset($_POST['mp3foxUseLibrary'])) { $theOptions['playlist_UseLibrary'] = $_POST['mp3foxUseLibrary']; }
1262
+ else { $theOptions['playlist_UseLibrary'] = "false"; }
1263
+
1264
+ if (isset($_POST['mp3foxShowPlaylist'])) { $theOptions['playlist_show'] = $_POST['mp3foxShowPlaylist']; }
1265
+ else { $theOptions['playlist_show'] = "false"; }
1266
+
1267
+ if (isset($_POST['mp3foxRemember'])) { $theOptions['remember_settings'] = $_POST['mp3foxRemember']; }
1268
+ else { $theOptions['remember_settings'] = "false"; }
1269
+
1270
+ if (isset($_POST['mp3foxHideExtension'])) { $theOptions['hide_mp3extension'] = $_POST['mp3foxHideExtension']; }
1271
+ else { $theOptions['hide_mp3extension'] = "false"; }
1272
+
1273
+ if (isset($_POST['mp3foxDownloadMp3'])) { $theOptions['show_downloadmp3'] = $_POST['mp3foxDownloadMp3']; }
1274
+ else { $theOptions['show_downloadmp3'] = "false"; }
1275
+
1276
+ if (isset($_POST['disableTemplateTag'])) { $theOptions['disable_template_tag'] = $_POST['disableTemplateTag']; }
1277
+ else { $theOptions['disable_template_tag'] = "false"; }
1278
+
1279
+ if (isset($_POST['mp3foxSmallPlayer'])) { $theOptions['use_small_player'] = $_POST['mp3foxSmallPlayer']; }
1280
+ else { $theOptions['use_small_player'] = "false"; }
1281
+
1282
+ if (isset($_POST['mp3foxForceScripts'])) { $theOptions['force_scripts_from_admin'] = $_POST['mp3foxForceScripts']; }
1283
+ else { $theOptions['force_scripts_from_admin'] = "false"; }
1284
+
1285
+ if (isset($_POST['mp3foxCustomStylesheet'])) {
1286
+ $theOptions['custom_stylesheet'] = preg_replace("!^.*www*\.!", "http://www.", $_POST['mp3foxCustomStylesheet']);
1287
+ if (strpos($theOptions['custom_stylesheet'], "http://") === false) {
1288
+ if (preg_match("!^/!", $theOptions['custom_stylesheet']) == 0) {
1289
+ $theOptions['custom_stylesheet'] = "/" .$theOptions['custom_stylesheet'];
1290
+ }
1291
+ else {
1292
+ $theOptions['custom_stylesheet'] = preg_replace("!^/+!", "/", $theOptions['custom_stylesheet']);
1293
+ }
1294
+ }
1295
+ if (preg_match("!.+/+$!", $theOptions['custom_stylesheet']) == 1) {
1296
+ $theOptions['custom_stylesheet'] = preg_replace("!/+$!", "", $theOptions['custom_stylesheet']);
1297
+ }
1298
+ if ($theOptions['custom_stylesheet'] == "") {
1299
+ $theOptions['custom_stylesheet'] = "/";
1300
+ }
 
 
 
 
 
 
 
 
 
 
 
1301
  }
1302
 
1303
+ if (isset($_POST['giveShortcodePriority'])) { $theOptions['give_shortcode_priority'] = $_POST['giveShortcodePriority']; }
1304
+ else { $theOptions['give_shortcode_priority'] = "false"; }
1305
+
1306
+ if (isset($_POST['mp3foxEchoDebug'])) { $theOptions['echo_debug'] = $_POST['mp3foxEchoDebug']; }
1307
+ else { $theOptions['echo_debug'] = "false"; }
1308
+
1309
+ if (isset($_POST['mp3foxPluginVersion'])) { $theOptions['db_plugin_version'] = $_POST['mp3foxPluginVersion']; }
1310
+
1311
+ if (isset($_POST['mp3foxAddTrackNumbers'])) { $theOptions['add_track_numbering'] = $_POST['mp3foxAddTrackNumbers']; }
1312
+ else { $theOptions['add_track_numbering'] = "false"; }
1313
+
1314
  update_option($this->adminOptionsName, $theOptions);
1315
+
1316
+ ?>
1317
+ <!-- Settings saved message -->
1318
  <div class="updated"><p><strong><?php _e("Settings Updated.", "mp3Fox");?></strong></p></div>
1319
 
1320
  <?php
1323
 
1324
  <div class="wrap">
1325
  <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">
1326
+ <div style="padding: 0px; margin: 0px 120px 0px 0px; border-bottom: 1px solid #ddd;">
1327
+ <h2 style="margin-top: 4px; margin-bottom: -6px;">Mp3<span style="font-size: 15px;"> - </span>jPlayer<span class="description" style="font-size: 10px;">&nbsp; (<?php echo $this->version_of_plugin; ?>)</span></h2>
1328
+ </div>
1329
+ <p class="description" style="margin: 12px 120px 0px 0px;">Below are the global settings for the player, it
1330
+ will automatically appear in any posts and pages that have a playlist or widget assigned. You can use the shortcode to over-ride some of these options.</p>
1331
+ <h4 class="description" style="margin-top: 5px; margin-bottom: 30px; font-weight:500"><a href="#howto">Help</a> | <a href="widgets.php">Widget settings</a></h4>
1332
 
1333
+ <!-- Player -->
1334
  <h3 style="margin-bottom: 0px;">Player</h3>
1335
+ <p style="margin-top: 10px; margin-bottom: 10px;">&nbsp; Initial volume &nbsp; <input type="text" style="text-align:right;" size="2" name="mp3foxVol" value="<?php echo $theOptions['initial_vol']; ?>" /> &nbsp; <span class="description">(0 - 100)</span></p>
1336
  <p style="margin-top: 0px; margin-bottom: 8px;">&nbsp; <input type="checkbox" name="mp3foxAutoplay" value="true" <?php if ($theOptions['auto_play'] == "true") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp; Autoplay</p>
1337
+ <p style="margin-top: 0px; margin-bottom: 8px;">&nbsp; <input type="checkbox" name="mp3foxAddTrackNumbers" value="true" <?php if ($theOptions['add_track_numbering'] == "true") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp; Number the tracks</p>
1338
  <p style="margin-top: 0px; margin-bottom: 8px;">&nbsp; <input type="checkbox" name="mp3foxShowPlaylist" value="true" <?php if ($theOptions['playlist_show'] == "true") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp; Start with the playlist showing</p>
1339
+ <p style="margin-top: 0px; margin-bottom: 8px;">&nbsp; <input type="checkbox" name="mp3foxDownloadMp3" value="true" <?php if ($theOptions['show_downloadmp3'] == "true") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp; Display a 'Download mp3' link</p>
 
1340
  <p style="margin-top: 0px; margin-bottom: 8px;">&nbsp; <input type="checkbox" name="mp3foxAtoZ" value="true" <?php if ($theOptions['playlist_AtoZ'] == "true") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp; Playlist the tracks in alphabetical order</p>
1341
+ <p style="margin-top: 0px; margin-bottom: 15px;">&nbsp; <input type="checkbox" name="mp3foxOnBlog" value="true" <?php if ($theOptions['player_onblog'] == "true") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp; Show the player on the posts index page
1342
+ <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="description">(the player is added into the first post with a playlist, or may be set via widget)</span></p>
1343
 
1344
+ <!-- Library -->
1345
+ <div style="margin: 0px 120px 0px 0px; border-bottom: 1px solid #eee; height: 15px;"></div>
1346
+ <h3 style="margin-top: 0px; margin-bottom: 4px;"><br />Library mp3's</h3>
1347
+ <p style="margin-bottom: 15px;">&nbsp; <input type="checkbox" name="mp3foxUseLibrary" value="true" <?php if ($theOptions['playlist_UseLibrary'] == "true") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp; Always use Media Library titles and excerpts when they exist</p>
1348
 
1349
+ <?php
1350
+ // create library file list //
1351
+ $library = $this->grab_library_info();
1352
+ echo "<p class=\"description\" style=\"margin: 0px 120px 6px 35px;\">Library contains <strong>" . $library['count'] . "</strong> mp3";
1353
+ if ( $library['count'] != 1 ) { echo "'s&nbsp;"; }
1354
+ else { echo "&nbsp;"; }
1355
+
1356
+ if ( $library['count'] > 0 ) {
1357
+ echo "<a href=\"javascript:mp3jp_listtoggle('fox_library','files');\" id=\"fox_library-toggle\">Show files</a> | <a href=\"media-new.php\">Upload new</a>";
1358
+ echo "</p>";
1359
+
1360
+ echo "<div id=\"fox_library-list\" style=\"display:none;\">\n";
1361
+ $liblist = '<p style="margin-left:35px;">';
1362
+ $br = '<br />';
1363
+ $tagclose = '</p>';
1364
+ $n = 1;
1365
+ foreach ( $library['filenames'] as $i => $file ) {
1366
+ $liblist .= "<a href=\"media.php?attachment_id=" . $library['postIDs'][$i] . "&amp;action=edit\" style=\"font-size:11px;\">[Edit]</a>&nbsp;&nbsp;" . $file . $br;
1367
+ }
1368
+ $liblist .= $tagclose;
1369
+ echo $liblist;
1370
+ echo '</div>';
1371
+ }
1372
+ else {
1373
+ echo "</p>";
1374
+ }
1375
+
1376
+ // media settings page has moved in WP 3 //
1377
+ if ( substr(get_bloginfo('version'), 0, 1) > 2 ) { // if WP 3.x //
1378
  $mediapagelink = get_bloginfo('wpurl') . "/wp-admin/options-media.php";
1379
  }
1380
  else {
1381
  $mediapagelink = get_bloginfo('wpurl') . "/wp-admin/options-misc.php";
1382
  }
 
1383
  $upload_dir = wp_upload_dir();
1384
  $localurl = get_bloginfo('url');
1385
+ $uploadsfolder = str_replace($localurl, "", $upload_dir['baseurl']); // is empty string only if library is empty //
1386
  if ( $uploadsfolder != "" ) {
1387
+ echo "<p class=\"description\" style=\"margin: 0px 120px 15px 33px;\">You only need to write filenames in your playlists to play mp3's from the library.
1388
+ <br />The Media Library uploads folder is currently set to <code>" .$uploadsfolder. "</code> , you can always <a href=\"" . $mediapagelink . "\">change it</a> without affecting any playlists.</p>";
1389
  }
1390
  ?>
1391
+ <!-- Non-library -->
1392
+ <div style="margin: 0px 120px 0px 0px; border-bottom: 1px solid #eee; height: 15px;"></div>
1393
+ <h3 style="margin-top: 0px; margin-bottom: 15px;"><br />Non-Library mp3's</h3>
1394
+ <p class="description" style="margin: 0px 120px 0px 7px;">Set a folder for playing non-library mp3's from in the box
1395
+ below, eg. <code>/music</code> or <code>www.anothersite.com/music</code><br />You
1396
+ only need to write filenames in your playlists to play tracks from here.</p>
1397
+ <p style="margin-left:0px; margin-bottom:5px;">&nbsp; Default folder: &nbsp; <input type="text" style="width:385px;" name="mp3foxfolder" value="<?php echo $theOptions['mp3_dir']; ?>" /></p>
1398
+
1399
+ <?php
1400
+ // create a file-list if directory is local (this still needs tidying, and should use grab_local_folder_mp3s!) //
1401
+ $rooturl = $_SERVER['HTTP_HOST'];
1402
+ $rooturl = str_replace("www.", "", $rooturl);
1403
+ //if ( preg_match("!^/!", $theOptions['mp3_dir']) || ($lp = strpos($theOptions['mp3_dir'], $rooturl)) ) {
1404
+ if ( ($lp = strpos($theOptions['mp3_dir'], $rooturl)) || preg_match("!^/!", $theOptions['mp3_dir']) ) {
1405
+ if ( $lp !== false ) {
1406
+ $folderpath = str_replace($rooturl, "", $theOptions['mp3_dir']);
1407
+ $folderpath = str_replace("www.", "", $folderpath);
1408
+ $folderpath = str_replace("http://", "", $folderpath);
1409
+ }
1410
+ else {
1411
+ $folderpath = $theOptions['mp3_dir'];
1412
+ }
1413
+ $path = $_SERVER['DOCUMENT_ROOT'] . $folderpath;
1414
+ if ($handle = @opendir($path)) {
1415
+ $j=0;
1416
+ while (false !== ($file = readdir($handle))) {
1417
+ if ( $file != '.' && $file != '..' && filetype($path.'/'.$file) == 'file' && preg_match("!\.mp3$!i", $file) ) {
1418
+ $items[$j++] = $file;
1419
+ }
1420
+ }
1421
+ $c = count($items);
1422
+ echo "<p class=\"description\" style=\"margin: 0px 0px 4px 112px;\">This folder contains <strong>" . $c . "</strong> mp3";
1423
+ if ( $c != 1 ) { echo "'s&nbsp;"; }
1424
+ else { echo "&nbsp;"; }
1425
 
1426
+ if ( $c > 0 ) {
1427
+ echo "<a href=\"javascript:mp3jp_listtoggle('fox_folder','');\" id=\"fox_folder-toggle\">Show files</a></p>";
1428
+ echo "<div id=\"fox_folder-list\" style=\"display:none;\">\n<p style=\"margin-left:114px;\">";
1429
+ natcasesort($items);
1430
+ foreach ( $items as $i => $val ) {
1431
+ echo $val . "<br />";
1432
+ }
1433
+ echo "</p>\n</div>\n";
1434
+ }
1435
+ else {
1436
+ echo "</p>";
1437
+ }
1438
+ closedir($handle);
1439
+ }
1440
+ else {
1441
+ echo "<p class=\"description\" style=\"margin: 0px 0px 4px 112px;\">Unable to read or locate the folder <code>" . $folderpath . "</code> check the path and folder permissions</p>";
1442
+ }
1443
+ }
1444
+ else {
1445
+ echo "<p class=\"description\" style=\"margin: 0px 0px 4px 112px;\">No info is available on remote folders but you can play from here if you know the filenames</p>";
1446
+ }
1447
+ ?>
1448
  <p style="margin-top: 20px; margin-bottom: 8px;">&nbsp; <input type="checkbox" name="mp3foxAllowRemote" value="true" <?php if ($theOptions['allow_remoteMp3'] == "true") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp; Allow mp3's from other domains on
1449
+ the player's playlists<br /><span class="description" style="margin-left:34px;">(unchecking this option doesn't affect mp3's playing from a remote default folder if one is set above)</span></p>
1450
+ <p style="margin-top: 0px; margin-bottom: 14px;">&nbsp; <input type="checkbox" name="mp3foxHideExtension" value="true" <?php if ($theOptions['hide_mp3extension'] == "true") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp; Hide '.mp3' extension if a filename is displayed
1451
  <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="description">(filenames are displayed when there's no available titles)</span></p>
1452
 
1453
+ <!-- Style -->
1454
+ <div style="margin: 0px 120px 0px 0px; border-bottom: 1px solid #eee; height: 15px;"></div>
1455
+ <h3 style="margin-top: 0px; margin-bottom: 6px;"><br />Style</h3>
1456
+ <p style="margin-bottom: 0px; line-height:19px;">&nbsp; <input type="radio" name="mp3foxTheme" value="styleA" <?php if ($theOptions['player_theme'] == "styleA") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp;&nbsp;Neutral colours<br />
1457
  &nbsp; <input type="radio" name="mp3foxTheme" value="styleB" <?php if ($theOptions['player_theme'] == "styleB") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp;&nbsp;Green<br />
1458
  &nbsp; <input type="radio" name="mp3foxTheme" value="styleC" <?php if ($theOptions['player_theme'] == "styleC") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp;&nbsp;Blue<br />
1459
+ &nbsp; <input type="radio" name="mp3foxTheme" value="styleE" <?php if ($theOptions['player_theme'] == "styleE") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp;&nbsp;Text-based<br />
1460
+ &nbsp; <input type="radio" name="mp3foxTheme" value="styleD" <?php if ($theOptions['player_theme'] == "styleD") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp;&nbsp;A custom CSS file:<br />
1461
+ <span style="margin-left:32px;"><input type="text" style="width:465px;" name="mp3foxCustomStylesheet" value="<?php echo $theOptions['custom_stylesheet']; ?>" /></span></p>
1462
+ <p style="margin-top:10px; margin-bottom: 10px;">&nbsp; <input type="checkbox" name="mp3foxSmallPlayer" value="true" <?php if ($theOptions['use_small_player'] == "true") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp; Use a small player</p>
1463
+ <p class="description" style="margin:0px 0px 14px 10px">(to enable a small player option with your custom css create a second stylesheet and append <code>-sidebar</code> to the filename eg. <code>mystyle.css</code> and <code>mystyle-sidebar.css</code>)</p>
 
 
1464
 
1465
+ <!-- Position -->
1466
+ <div style="margin: 0px 120px 0px 0px; border-bottom: 1px solid #eee; height: 15px;"></div>
1467
+ <h3 style="margin-top: 0px; margin-bottom: 6px;"><br />Position</h3>
1468
+ <p>&nbsp; Left &nbsp;<input type="radio" name="mp3foxFloat" value="left" <?php if ($theOptions['player_float'] == "left") { _e('checked="checked"', "mp3Fox"); }?> />&nbsp;&nbsp;
1469
+ | &nbsp;&nbsp;<input type="radio" name="mp3foxFloat" value="right" <?php if ($theOptions['player_float'] == "right") { _e('checked="checked"', "mp3Fox"); }?> />&nbsp; Right
1470
+ <br /><span class="description">&nbsp; <strong>floated</strong>, content wraps around the player</span></p>
1471
  <p>&nbsp; Left &nbsp;<input type="radio" name="mp3foxFloat" value="none" <?php if ($theOptions['player_float'] == "none") { _e('checked="checked"', "mp3Fox"); }?> />&nbsp;&nbsp;
1472
  | &nbsp;&nbsp;<input type="radio" name="mp3foxFloat" value="rel-C" <?php if ($theOptions['player_float'] == "rel-C") { _e('checked="checked"', "mp3Fox"); }?> />&nbsp; Centre &nbsp;
1473
  | &nbsp;&nbsp;<input type="radio" name="mp3foxFloat" value="rel-R" <?php if ($theOptions['player_float'] == "rel-R") { _e('checked="checked"', "mp3Fox"); }?> />&nbsp; Right
1474
+ <br /><span class="description">&nbsp; <strong>relative</strong>, content appears above/below the player</span></p>
1475
+ <p style="margin-top: 20px; margin-bottom: 8px;">&nbsp; <input type="checkbox" name="giveShortcodePriority" value="true" <?php if ($theOptions['give_shortcode_priority'] == "true") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp;Give shortcodes priority over widget</p>
 
 
1476
 
1477
+ <!-- Template tools -->
1478
+ <div style="margin: 0px 120px 0px 0px; border-bottom: 1px solid #eee; height: 15px;"></div>
1479
+ <h3 style="margin-top: 0px; margin-bottom: 6px;"><br />Template tools
1480
+ <span style="font-size:11px;">&nbsp;<a href="javascript:mp3jp_listtoggle('fox_tools','');" id="fox_tools-toggle">Show</a></span></h3>
1481
+ <div id="fox_tools-list" style="display:none;">
1482
+ <p class="description" style="margin: 0px 120px 15px 7px;">If you're developing a theme using the player's template-tags
1483
+ then these options can help out.</p>
1484
+ <p style="margin-top: 0px; margin-bottom: 8px;">&nbsp; <input type="checkbox" name="mp3foxEchoDebug" value="true" <?php if ($theOptions['echo_debug'] == "true") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp;Add debug output to the browser's page source view
1485
+ <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="description">(info appears in the page source view (CTRL+U on most browsers), and is not visible on the site)</span></p>
1486
+ <p style="margin-top: 0px; margin-bottom: 8px;">&nbsp; <input type="checkbox" name="mp3foxForceScripts" value="true" <?php if ($theOptions['force_scripts_from_admin'] == "true") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp;Enqueue player scripts on all site pages
1487
+ <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="description">(normally scripts are only requested when they're needed by a page or widget)</span></p>
1488
+ <p style="margin-bottom: 8px;">&nbsp; <input type="checkbox" name="disableTemplateTag" value="true" <?php if ($theOptions['disable_template_tag'] == "true") { _e('checked="checked"', "mp3Fox"); }?> /> &nbsp;Ignore player template-tags in theme files
1489
+ <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="description">(this ignores the mp3j_addscripts(), mp3j_flag(), and mp3j_put() tag functions)</span></p>
1490
+ </div>
1491
+ <input type="hidden" name="mp3foxPluginVersion" value="1.4.0" />
1492
  <br /><br /><br />
1493
  <p style="margin-top: 4px;"><input type="submit" name="update_mp3foxSettings" class="button-primary" value="<?php _e('Update Settings', 'mp3Fox') ?>" />
1494
+ &nbsp; Remember settings if plugin is deactivated &nbsp;<input type="checkbox" name="mp3foxRemember" value="true" <?php if ($theOptions['remember_settings'] == "true") { _e('checked="checked"', "mp3Fox"); }?> /></p>
1495
  </form>
1496
 
1497
  <a name="howto"></a>
1498
+ <div style="margin: 20px 120px 0px 0px; border-top: 1px solid #aaa; height: 10px;"></div>
1499
  <p style="margin: 0px 120px 0px 0px;">&nbsp;</p>
1500
+ <h3 style="margin: 0px 120px 0px 0px; color:#888;">Help</h3>
1501
+ <p class="description" style="margin: 10px 120px 12px 10px;">The plugin plays your mp3's by looking in the page/post custom fields
1502
+ for any playlist you have written. The player is added automatically when it picks up a playlist to play. You can also
1503
+ write a playlist straight into the widget, and use multiple widgets to set different playlists for different pages.</p>
1504
+
1505
+ <h3 class="description" style="margin:0px 0px 2px 10px; color:#888;">Custom fields
1506
+ <span style="font-size:11px;font-weight:500;">&nbsp;<a href="javascript:mp3jp_listtoggle('fox_help1','');" id="fox_help1-toggle">Show help</a></span></h3>
1507
+ <div id="fox_help1-list" style="display:none;margin:10px 0px 0px 15px;">
1508
+ <p class="description" style="margin: 0px 120px 6px 10px;">You can use the custom fields
1509
+ to enter a single mp3 per line with track number, title, and caption, or they can be used to play
1510
+ an entire local folder, the library, or in combination with the shortcode, to pick up the playlist from another post or page.</p>
1511
+ <p class="description" style="margin: 0px 120px 6px 10px;">If you use your Wordpress library or ftp your tracks
1512
+ to a main folder then you can play these tracks by writing just the filename in the playlist (the file extension
1513
+ can be ommited). You can set your default folder to a directory on a different domain if
1514
+ that's where you want to play from (you won't see a list of the filenames for remote folders so you'll need to know them).</p>
1515
+ <p class="description" style="margin: 0px 120px 6px 10px;">Enter full URI's for any other tracks you want to play.</p>
1516
+ <p class="description" style="margin: 0px 120px 6px 10px;"><br /><strong>Making a playlist</strong></p>
1517
+ <p class="description" style="margin: 10px 120px 10px 10px;">Add tracks on page/post edit screens using the custom fields (below the content box), as follows:</p>
1518
+ <p class="description" style="margin: 0px 120px 10px 10px;">1. Enter <code>mp3</code> into the left hand box, this is the 'key' that the plugin looks for when reading the custom fields and you must always add it.
1519
+ <br />2. Write the filename/URI into the right hand box and hit 'add custom field'</p>
1520
+ <p class="description" style="margin: 0px 120px 10px 10px;">Repeat the above to add more mp3's and hit 'Update page' when you're done</p>
1521
+ <p class="description" style="margin: 20px 120px 5px 10px;"><strong>Adding a title and caption</strong></p>
1522
+ <p class="description" style="margin: 10px 120px 5px 10px;">1. Add a dot, then a caption in the left hand box, eg: <code>mp3.Caption</code><br />2. Add the title, then an '@' before the filename, eg: <code>Title@filename</code></p>
1523
+ <p class="description" style="margin: 10px 120px 5px 10px;">Captions get carried over to the next track automatically in some cases, to blank out a caption just add the dot like so <code>mp3.</code></p>
1524
+
1525
+ <p class="description" style="margin: 20px 120px 5px 10px;"><strong>Ordering the tracks</strong></p>
1526
+ <p class="description" style="margin: 10px 120px 5px 10px;">Number the keys (the left boxes), eg:<code>1 mp3</code> will be first on the playlist. Un-numbered tracks appear below any numbered tracks.</p>
1527
+ <p class="description" style="margin: 20px 120px 5px 10px;"><strong>Playing a folder, the library, or another page's playlist</strong></p>
1528
+ <p class="description" style="margin: 10px 120px 10px 10px;">Use these special entries in the 'value' (right hand) box:</p>
1529
+ <p class="description" style="margin: 10px 120px 10px 10px;"><code>FEED:LIB</code> - Play entire library
1530
+ <br /><code>FEED:DF</code> - Play the default folder
1531
+ <br /><code>FEED:/mymusic</code> - Play the local folder 'mymusic' (folder paths must be local and are relative to the root of your site, NOT the Wordpress install)
1532
+ <br /><code>FEED:ID</code> - Play a list from a different page (used in conjunction with the shortcode which sets the id to pick up)</p>
1533
+ <br />
1534
+
1535
+ </div>
1536
 
1537
+ <h3 class="description" style="margin:0px 0px 2px 10px; color:#888;">Shortcode
1538
+ <span style="font-size:11px;font-weight:500;">&nbsp;<a href="javascript:mp3jp_listtoggle('fox_help2','');" id="fox_help2-toggle">Show help</a></span></h3>
1539
+ <div id="fox_help2-list" style="display:none;margin:15px 0px 0px 15px;">
1540
+ <p class="description" style="margin: 10px 120px 5px 10px;"><code>[mp3-jplayer]</code></p>
1541
+ <p class="description" style="margin: 10px 120px 5px 10px;">Use the shortcode to position the player in your content and to control
1542
+ various playback settings. It accepts the following parameters for individual control of player position/float, download link, autoplay, playlist mode, shuffle, page id, and random slice:</p>
1543
+ <p class="description" style="margin: 10px 120px 5px 10px;">
1544
+ <code>pos</code> - left, right, rel, rel-C, rel-R, absolute)<br />
1545
+ <code>dload</code> - true, false<br />
1546
+ <code>play</code> - true, false<br />
1547
+ <code>list</code> - open, closed, hidden, radio<br />
1548
+ <code>shuffle</code> - true<br />
1549
+ <code>slice</code> - (number of tracks to pick)<br />
1550
+ <code>id</code> - (a page ID) this is needed when using <code>FEED:ID</code> written in a custom field, the shortcode contains the ID to pick up a playlist from.</p>
1551
+ <p class="description" style="margin: 10px 120px 5px 10px;">eg. <code>[mp3-jplayer id=&quot;7&quot; dload=&quot;true&quot; shuffle=&quot;true&quot;]</code></p>
1552
+ <p class="description" style="margin: 10px 120px 5px 10px;">NOTE: If there's no playlist on the page the shortcode will not add the player</p>
1553
+ <br />
1554
+ </div>
1555
 
1556
+ <h3 class="description" style="margin:0px 0px 2px 10px; color:#888;">Widget
1557
+ <span style="font-size:11px;font-weight:500;">&nbsp;<a href="javascript:mp3jp_listtoggle('fox_help3','');" id="fox_help3-toggle">Show help</a></span></h3>
1558
+ <div id="fox_help3-list" style="display:none;margin:0px 0px 0px 15px;">
1559
+ <p class="description" style="margin: 10px 120px 5px 10px;">Drag the player widget into one of your sidebars and set
1560
+ it's playback mode or write a playlist. Use the page filter to include-only or exclude any pages and posts. Once a widget is active
1561
+ then player addition into the content is bypassed, if you want a player in the content on some of your pages then tick
1562
+ the box 'Give shortcodes priority over widget' above in the Position settings, then you can use the shortcode to over-ride the widget.</p>
1563
+ <p class="description" style="margin: 10px 120px 5px 10px;">Note that the folder setting under mode 3 must be local and is a path from the root of the domain
1564
+ and not the Wordpress install. Leave it blank to play the default folder (if it's local).</p>
1565
+ <br />
1566
+ </div>
1567
 
1568
+ <h3 class="description" style="margin:0px 0px 2px 10px; color:#888;">Tags
1569
+ <span style="font-size:11px;font-weight:500;">&nbsp;<a href="javascript:mp3jp_listtoggle('fox_help4','');" id="fox_help4-toggle">Show help</a></span></h3>
1570
+ <div id="fox_help4-list" style="display:none;margin:15px 0px 0px 15px;">
1571
+ <p class="description" style="margin: 10px 120px 5px 10px;">The following template tag functions can be used in your theme files:</p>
1572
+ <p class="description" style="margin: 10px 120px 3px 10px;"><code>mp3j_addscripts( $style )</code></p>
1573
+ <p class="description" style="margin: 0px 120px 3px 10px;"><code>mp3j_flag( $set )</code></p>
1574
+ <p class="description" style="margin: 0px 120px 3px 10px;"><code>mp3j_grab_library( $format )</code></p>
1575
+ <p class="description" style="margin: 0px 120px 3px 10px;"><code>mp3j_set_meta( $tracks, $captions )</code></p>
1576
+ <p class="description" style="margin: 0px 120px 3px 10px;"><code>mp3j_put( $id, $pos, $dload, $autoplay, $showplaylist )</code></p>
1577
+ <p class="description" style="margin: 0px 120px 14px 10px;"><code>mp3j_debug( $output )</code></p>
1578
+ <p class="description" style="margin: 0px 120px 5px 10px;">eg: <code>&lt;?php if ( function_exists( 'mp3j_put' ) ) { mp3j_put( 3, 'absolute', '', 'true' ); } ?&gt;</code></p>
1579
+ <?php
1580
+ echo '<p class="description" style="margin: 15px 120px 5px 10px;">Please see the <a href="' . get_bloginfo('wpurl') . '/wp-content/plugins/mp3-jplayer/template-tag-help.htm">Template tag help</a> for a detailed explaination of the tags.</p>';
1581
+ ?>
1582
+ <br />
1583
+ </div>
1584
 
1585
+ <div style="margin: 40px 120px 0px 0px; border-top: 1px solid #999; height: 30px;">
1586
  <p class="description" style="margin: 0px 120px px 0px;"><a href="http://sjward.org/jplayer-for-wordpress">Plugin home page</a></p>
1587
  </div>
1588
  <br /><br /><br /><br />
1589
+ </div>
1590
+
1591
+ <script type="text/javascript">
1592
+ <!--
1593
+ var fox_tog1 = false;
1594
+ var fox_tog2 = false;
1595
+ var fox_tog3 = false;
1596
+ var fox_tog4 = false;
1597
+ var fox_tog5 = false;
1598
+ var fox_tog6 = false;
1599
+ var fox_tog7 = false;
1600
+ var fox_tog8 = false;
1601
+ var fox_tognewstate;
1602
+ function mp3jp_listtoggle( id_base, label ) {
1603
+ if ( id_base == 'fox_tools' ) {
1604
+ fox_tognewstate = fox_runtoggle( id_base, fox_tog1, label );
1605
+ fox_tog1 = fox_tognewstate;
1606
+ }
1607
+ if ( id_base == 'fox_library' ) {
1608
+ fox_tognewstate = fox_runtoggle( id_base, fox_tog2, label );
1609
+ fox_tog2 = fox_tognewstate;
1610
+ }
1611
+ if ( id_base == 'fox_folder' ) {
1612
+ fox_tognewstate = fox_runtoggle( id_base, fox_tog3, label );
1613
+ fox_tog3 = fox_tognewstate;
1614
+ }
1615
+ if ( id_base == 'fox_help1' ) {
1616
+ fox_tognewstate = fox_runtoggle( id_base, fox_tog4, label );
1617
+ fox_tog4 = fox_tognewstate;
1618
+ }
1619
+ if ( id_base == 'fox_help2' ) {
1620
+ fox_tognewstate = fox_runtoggle( id_base, fox_tog5, label );
1621
+ fox_tog5 = fox_tognewstate;
1622
+ }
1623
+ if ( id_base == 'fox_help3' ) {
1624
+ fox_tognewstate = fox_runtoggle( id_base, fox_tog6, label );
1625
+ fox_tog6 = fox_tognewstate;
1626
+ }
1627
+ if ( id_base == 'fox_help4' ) {
1628
+ fox_tognewstate = fox_runtoggle( id_base, fox_tog7, label );
1629
+ fox_tog7 = fox_tognewstate;
1630
+ }
1631
+ if ( id_base == 'fox_help5' ) {
1632
+ fox_tognewstate = fox_runtoggle( id_base, fox_tog8, label );
1633
+ fox_tog8 = fox_tognewstate;
1634
+ }
1635
+ return;
1636
+ }
1637
+ function fox_runtoggle( id_base, state, label ) {
1638
+ if (state == true) {
1639
+ jQuery("#"+id_base+"-list").fadeOut(300);
1640
+ jQuery("#"+id_base+"-toggle").empty();
1641
+ jQuery("#"+id_base+"-toggle").append('Show '+label);
1642
+ return false;
1643
+ }
1644
+ if (state == false) {
1645
+ jQuery("#"+id_base+"-list").fadeIn(300);
1646
+ jQuery("#"+id_base+"-toggle").empty();
1647
+ jQuery("#"+id_base+"-toggle").append('Hide '+label);
1648
+ return true;
1649
+ }
1650
+ }
1651
+ //-->
1652
+ </script>
1653
 
1654
  <?php
1655
  }
1656
+ } //end class mp3Fox //
1657
+ }
1658
+
1659
+
1660
+ /**
1661
+ * Extend the WP_Widget class available since WP2.8
1662
+ */
1663
+ if ( class_exists("WP_Widget") )
1664
+ {
1665
+ if ( !class_exists("MP3_jPlayer") )
1666
+ {
1667
+ class MP3_jPlayer extends WP_Widget
1668
+ {
1669
+
1670
+ /**
1671
+ * Set up widgets interface with admin.
1672
+ * (function required by widgets API)
1673
+ */
1674
+ function MP3_jPlayer() {
1675
+
1676
+ $widget_ops = array( 'classname' => 'mp3jplayerwidget', 'description' => __('Drag the player into a widget area and set it\'s playback mode.', 'mp3jplayerwidget') );
1677
+ $control_ops = array( 'id_base' => 'mp3-jplayer-widget' );
1678
+ $this->WP_Widget( 'mp3-jplayer-widget', __('MP3-jPlayer', 'mp3jplayerwidget'), $widget_ops, $control_ops );
1679
+ }
1680
+
1681
+
1682
+ /**
1683
+ * Handles widget addition to the page, and builds the playlist depending on mode and settings.
1684
+ * needs breaking out to smaller functions.
1685
+ *
1686
+ * (function required by widgets API)
1687
+ */
1688
+ function widget( $args, $instance ) {
1689
+
1690
+ global $mp3_fox;
1691
+ $mp3_fox->widget_runcount++;
1692
+ //if ( $mp3_fox->playerHasBeenSet == "true" || ($mp3_fox->tagflag == "true" && $mp3_fox->theSettings['disable_template_tag'] == "false") ) {
1693
+ if ( $mp3_fox->playerHasBeenSet == "true" ) {
1694
+ return;
1695
+ }
1696
+ if ( is_singular() ) { //run page filter on singulars //
1697
+ if ( $this->page_filter( $instance['restrict_list'], $instance['restrict_mode'] ) ) {
1698
+ return;
1699
+ }
1700
+ }
1701
+ if ( ((is_home() || is_archive()) && $mp3_fox->theSettings['player_onblog'] == "true") || is_singular() )
1702
+ {
1703
+ // MODE 1 - Auto-add, playing custom fields //
1704
+ // *******************************************
1705
+ if ( $instance['widget_mode'] == "1" ) {
1706
+ if ( is_singular() && $mp3_fox->customFieldsGrabbed == "true" ) {
1707
+ $customvalues = $mp3_fox->postMetaValues;
1708
+ $customkeys = $mp3_fox->postMetaKeys;
1709
+ }
1710
+ elseif ( !is_singular() && !empty($mp3_fox->idfirstFound) ) {
1711
+ $mp3_fox->TT_grab_Custom_Meta($mp3_fox->idfirstFound);
1712
+ $customvalues = $mp3_fox->postMetaValues;
1713
+ $customkeys = $mp3_fox->postMetaKeys;
1714
+ }
1715
+ else {
1716
+ return;
1717
+ }
1718
+ }
1719
+
1720
+ // MODE 2 - Play the arbitrary playlist //
1721
+ // ***************************************
1722
+ if ( $instance['widget_mode'] == "2" ) {
1723
+ $playlist = trim( $instance['arb_playlist'] );
1724
+ $playlist = trim( $playlist, "," );
1725
+ if ( empty($playlist) ) {
1726
+ return;
1727
+ }
1728
+ $tracks = explode( ",", $playlist );
1729
+ foreach ( $tracks as $i => $file ) {
1730
+ $tracks[$i] = trim($file);
1731
+ }
1732
+ $mp3_fox->feed_metadata( $tracks );
1733
+ $customvalues = $mp3_fox->feedValues;
1734
+ $customkeys = $mp3_fox->feedKeys;
1735
+ }
1736
+
1737
+ // MODE 3 - Play ID and/or Library slice //
1738
+ // ****************************************
1739
+ if ( $instance['widget_mode'] == "3" ) {
1740
+ $customvalues = array();
1741
+ $customkeys = array();
1742
+ // Create 1st array from id //
1743
+ if ( !empty($instance['id_to_play']) && $instance['play_page'] == "true" ) {
1744
+ $id = trim($instance['id_to_play']);
1745
+ if ( $mp3_fox->TT_grab_Custom_Meta($id) > 0 ) {
1746
+ $customvalues = $mp3_fox->postMetaValues;
1747
+ $customkeys = $mp3_fox->postMetaKeys;
1748
+ }
1749
+ }
1750
+ // Create 2nd array from library //
1751
+ $customvaluesB = array();
1752
+ $customkeysB = array();
1753
+ if ( $instance['play_library'] == "true" ) {
1754
+ if ( empty($mp3_fox->mp3LibraryI) ) {
1755
+ $library = $mp3_fox->grab_library_info();
1756
+ }
1757
+ else {
1758
+ $library = $mp3_fox->mp3LibraryI;
1759
+ }
1760
+ if ( $library['count'] >= 1 ) {
1761
+ $counter = count($customvalues);
1762
+ $mp3_fox->feed_metadata( $library['filenames'], '', ++$counter );
1763
+ $customvaluesB = $mp3_fox->feedValues;
1764
+ $customkeysB = $mp3_fox->feedKeys;
1765
+ }
1766
+ }
1767
+ foreach ( $customkeysB as $i => $v ) {
1768
+ array_push( $customvalues, $customvaluesB[$i] );
1769
+ array_push( $customkeys, $v );
1770
+ }
1771
+ // Create 3rd array from a local folder //
1772
+ $customvaluesC = array();
1773
+ $customkeysC = array();
1774
+ if ( $instance['play_folder'] == "true" ) {
1775
+ if ( $instance['folder_to_play'] == "" ) {
1776
+ $folder = $mp3_fox->theSettings['mp3_dir'];
1777
+ }
1778
+ else {
1779
+ $folder = $instance['folder_to_play'];
1780
+ }
1781
+ $tracks = $mp3_fox->grab_local_folder_mp3s( $folder );
1782
+ if ( $tracks !== true && $tracks !== false && count($tracks) > 0 ) {
1783
+ $counter = count($customvalues);
1784
+ $mp3_fox->feed_metadata( $tracks, '', ++$counter );
1785
+ $customvaluesC = $mp3_fox->feedValues;
1786
+ $customkeysC = $mp3_fox->feedKeys;
1787
+ foreach ( $customkeysC as $i => $v ) {
1788
+ array_push( $customvalues, $customvaluesC[$i] );
1789
+ array_push( $customkeys, $v );
1790
+ }
1791
+ }
1792
+ }
1793
+ if ( ($n = count($customvalues)) < 1 ) {
1794
+ return;
1795
+ }
1796
+
1797
+ // Take the random slice //
1798
+ $slicesize = trim($instance['slice_size']);
1799
+ if ( !empty($slicesize) && $slicesize > 0 ) {
1800
+ if ( $n > 1 ) {
1801
+ if ( $slicesize > $n ) {
1802
+ $slicesize = $n;
1803
+ }
1804
+ $picklist = array();
1805
+ for ( $i = 0; $i < $n; $i++ ) { // make a numbers array //
1806
+ $picklist[$i] = $i;
1807
+ }
1808
+ shuffle( $picklist );
1809
+ $picklist = array_slice( $picklist, 0, $slicesize ); // take a shuffled slice //
1810
+ natsort( $picklist ); // reorder it //
1811
+ $j=0;
1812
+ foreach ( $picklist as $i => $num ) { // use it to pick the random tracks in order //
1813
+ $cv[$j] = $customvalues[$num];
1814
+ $ck[$j++] = $customkeys[$num];
1815
+ }
1816
+ unset($customvalues);
1817
+ unset($customkeys);
1818
+ $customvalues = $cv;
1819
+ $customkeys = $ck;
1820
+ }
1821
+ }
1822
+ }
1823
+ }
1824
+ else {
1825
+ return;
1826
+ }
1827
+
1828
+ // Build the playlist //
1829
+ $thePlayList = $mp3_fox->generate_playlist( $customkeys, $customvalues, 1 );
1830
+ if ( ($mp3_fox->countPlaylist = $thePlayList['count']) == 0 ) {
1831
+ return;
1832
+ }
1833
+ // Write js and html //
1834
+ if ( $instance['shuffle'] == "true" ) {
1835
+ if ( $thePlayList['count'] > 1 ) { shuffle( $thePlayList['order'] ); }
1836
+ }
1837
+ $pos = $mp3_fox->theSettings['player_float'];
1838
+ $dload = $instance['download_link'];
1839
+ $play = $mp3_fox->theSettings['auto_play'];
1840
+
1841
+ $list = $instance['playlist_mode'];
1842
+ if ( $list == "radio" || $list == "hidden" || $list == "closed" ) {
1843
+ $mp3_fox->listDisplayMode = $list;
1844
+ $list = "false";
1845
+ }
1846
+ if ( $list == "open" ) { $list = "true"; }
1847
 
1848
+ $mp3_fox->write_startup_vars( $thePlayList['count'], $play, $list );
1849
+ $mp3_fox->write_playlist( $thePlayList );
1850
+ $theplayer = $mp3_fox->write_player_html( $thePlayList['count'], $pos, $dload );
1851
+
1852
+ extract( $args ); // wp supplied theme vars //
1853
+ echo $before_widget;
1854
+ if ( $instance['widget_title'] ) { echo $before_title . $instance['widget_title'] . $after_title; }
1855
+ echo $theplayer;
1856
+ echo $after_widget;
1857
+ $mp3_fox->playerHasBeenSet = "true";
1858
+ // Debug info //
1859
+ $mp3_fox->countPlaylist = $thePlayList['count'];
1860
+ $mp3_fox->PlayerPlaylist = $thePlayList;
1861
+ $mp3_fox->playerSetMethod = "Widget";
1862
+ $mp3_fox->playerAddedOnRun = $mp3_fox->widget_runcount;
1863
+ }
1864
+
1865
+
1866
+ /**
1867
+ * Update admin settings of the instance of the widget.
1868
+ * (function required by widgets API)
1869
+ */
1870
+ function update( $new_instance, $old_instance ) {
1871
+
1872
+ $instance = $old_instance;
1873
+ //$instance['widget_title'] = strip_tags( $new_instance['widget_title'] );
1874
+ $instance['widget_title'] = $new_instance['widget_title'];
1875
+ $instance['id_to_play'] = strip_tags( $new_instance['id_to_play'] );
1876
+ $instance['widget_mode'] = $new_instance['widget_mode'];
1877
+ $instance['shuffle'] = $new_instance['shuffle'];
1878
+ $instance['restrict_list'] = strip_tags( $new_instance['restrict_list'] );
1879
+ $instance['restrict_mode'] = $new_instance['restrict_mode'];
1880
+ $instance['play_library'] = $new_instance['play_library'];
1881
+ $instance['arb_playlist'] = strip_tags( $new_instance['arb_playlist'] );
1882
+ $instance['play_page'] = $new_instance['play_page'];
1883
+ $instance['slice_size'] = strip_tags( $new_instance['slice_size'] );
1884
+ $instance['play_folder'] = $new_instance['play_folder'];
1885
+ $instance['folder_to_play'] = strip_tags( $new_instance['folder_to_play'] );
1886
+ if ( strpos($instance['folder_to_play'], "http://") === false && strpos($instance['folder_to_play'], "www.") === false ) {
1887
+ if ( !empty($instance['folder_to_play']) ) {
1888
+ $instance['folder_to_play'] = trim($instance['folder_to_play']);
1889
+ if ( $instance['folder_to_play'] != "/" ) {
1890
+ $instance['folder_to_play'] = trim($instance['folder_to_play'], "/");
1891
+ $instance['folder_to_play'] = "/" . $instance['folder_to_play'];
1892
+ }
1893
+ }
1894
+ }
1895
+ $instance['download_link'] = $new_instance['download_link'];
1896
+ $instance['playlist_mode'] = $new_instance['playlist_mode'];
1897
+ return $instance;
1898
+ }
1899
+
1900
+ /**
1901
+ * Create widget default settings and admin ui.
1902
+ * (function required by widgets API)
1903
+ */
1904
+ function form( $instance ) {
1905
+
1906
+ $defaultvalues = array(
1907
+ 'widget_title' => '',
1908
+ 'id_to_play' => '',
1909
+ 'widget_mode' => '1',
1910
+ 'shuffle' => 'false',
1911
+ 'restrict_list' => '',
1912
+ 'restrict_mode' => 'exclude',
1913
+ 'play_library' => 'false',
1914
+ 'arb_playlist' => '',
1915
+ 'play_page' => 'false',
1916
+ 'slice_size' => '',
1917
+ 'play_folder' => 'false',
1918
+ 'folder_to_play' => '',
1919
+ 'download_link' => 'false',
1920
+ 'playlist_mode' => 'open' );
1921
+ $instance = wp_parse_args( (array) $instance, $defaultvalues );
1922
+ ?>
1923
+
1924
+ <p style="text-align:right; font-size: 11px; margin-bottom:0px;"><a href="options-general.php?page=mp3jplayer.php">Plugin options</a> | <a href="options-general.php?page=mp3jplayer.php#howto">Help</a></p>
1925
+
1926
+ <!-- Play Mode -->
1927
+ <p style="margin-top:-3px; margin-bottom:10px;">Play Mode</p>
1928
+
1929
+ <!-- mode 1 -->
1930
+ <p style="margin-bottom: 2px;"><input type="radio" id="<?php echo $this->get_field_id( 'widget_mode' ); ?>" name="<?php echo $this->get_field_name( 'widget_mode' ); ?>" value="1" <?php if ($instance['widget_mode'] == "1") { _e('checked="checked"', "mp3jplayerwidget"); }?> />
1931
+ &nbsp;&nbsp;Mode 1 &nbsp;<span class="description" style="margin-left: 0px;">Play my custom fields</span></p>
1932
+ <p class="description" style="margin: 0px 0px 14px 25px; font-size: 11px;">Auto adds the player when there are tracks to play.</p>
1933
+
1934
+ <!-- mode 2 -->
1935
+ <div style="margin:0px 0px 0px 25px; border-top: 1px solid #eee; height: 10px;"></div>
1936
+ <p style="margin-top:2px; margin-bottom:2px;"><input type="radio" id="<?php echo $this->get_field_id( 'widget_mode' ); ?>" name="<?php echo $this->get_field_name( 'widget_mode' ); ?>" value="2" <?php if ($instance['widget_mode'] == "2") { _e('checked="checked"', "mp3jplayerwidget"); }?> />
1937
+ &nbsp;&nbsp;Mode 2 &nbsp;<span class="description" style="margin-left: 0px;">Play a fixed playlist</span></p>
1938
+ <p class="description" style="margin: 0px 0px 14px 25px; font-size: 11px;">Any filenames from the
1939
+ library and default folder, or full URI's:</p>
1940
+ <p style="margin-left:25px; margin-bottom:0px; font-size: 11px;"><textarea class="widefat" style="font-size:11px;" rows="5" 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></p>
1941
+ <p class="description" style="text-align:right; font-size:11px; margin-bottom: 10px;">(a comma separated list)</p>
1942
+
1943
+ <!-- mode 3 -->
1944
+ <div style="margin: 0px 0px 0px 25px; border-top: 1px solid #eee; height: 10px;"></div>
1945
+ <p style="margin-top: 3px;margin-bottom: 10px;"><input type="radio" id="<?php echo $this->get_field_id( 'widget_mode' ); ?>" name="<?php echo $this->get_field_name( 'widget_mode' ); ?>" value="3" <?php if ($instance['widget_mode'] == "3") { _e('checked="checked"', "mp3jplayerwidget"); }?> />
1946
+ &nbsp;&nbsp;Mode 3 &nbsp;<span class="description" style="margin-left: 0px;">Generate a playlist</span></p>
1947
+ <p style="margin: 0px 0px 2px 25px; font-size: 11px;">
1948
+ <input type="checkbox" id="<?php echo $this->get_field_id( 'play_page' ); ?>" name="<?php echo $this->get_field_name( 'play_page' ); ?>" value="true" <?php if ($instance['play_page'] == "true") { _e('checked="checked"', "mp3jplayerwidget"); }?> />
1949
+ &nbsp;From page ID &nbsp;<input class="widefat" style="width:55px;" type="text" id="<?php echo $this->get_field_id( 'id_to_play' ); ?>" name="<?php echo $this->get_field_name( 'id_to_play' ); ?>" value="<?php echo $instance['id_to_play']; ?>" /></p>
1950
+ <p style="margin:0px 0px 1px 25px; font-size:11px;">
1951
+ <input type="checkbox" id="<?php echo $this->get_field_id( 'play_library' ); ?>" name="<?php echo $this->get_field_name( 'play_library' ); ?>" value="true" <?php if ($instance['play_library'] == "true") { _e('checked="checked"', "mp3jplayerwidget"); }?> />
1952
+ &nbsp;My library</p>
1953
+
1954
+ <?php
1955
+ global $mp3_fox;
1956
+ $mp3_fox->theSettings = get_option('mp3FoxAdminOptions');
1957
+ if ( $instance['folder_to_play'] == "" ) {
1958
+ $folder = $mp3_fox->theSettings['mp3_dir'];
1959
+ }
1960
+ else {
1961
+ $folder = $instance['folder_to_play'];
1962
+ }
1963
+ $foldertracks = $mp3_fox->grab_local_folder_mp3s( $folder );
1964
+ if ( $foldertracks !== true && $foldertracks !== false ) {
1965
+ if ( ($c = count($foldertracks)) > 0 ) {
1966
+ $style = "color:#282;";
1967
+ $txt = $c . "&nbsp;mp3";
1968
+ if ( $c != 1 ) { $txt .= "'s"; }
1969
+ $txt .= "&nbsp;in this folder";
1970
+ }
1971
+ else {
1972
+ $style = "color:#aaa;";
1973
+ $txt = "No mp3's here";
1974
+ }
1975
+ }
1976
+ elseif ( $foldertracks === true ) {
1977
+ $txt = "Check this path!";
1978
+ $style = "color:#e5c70f;";
1979
+ }
1980
+ else {
1981
+ $txt = "x Invalid or remote";
1982
+ $style = "color:#f56b0f;";
1983
+ }
1984
+ ?>
1985
+
1986
+ <p style="margin:0px 0px 0px 25px; font-size: 11px;">
1987
+ <input type="checkbox" id="<?php echo $this->get_field_id( 'play_folder' ); ?>" name="<?php echo $this->get_field_name( 'play_folder' ); ?>" value="true" <?php if ($instance['play_folder'] == "true") { _e('checked="checked"', "mp3jplayerwidget"); }?> />
1988
+ &nbsp;A folder: &nbsp;<input class="widefat" type="text" style="width:120px; margin-right:0px; font-size:11px;" id="<?php echo $this->get_field_id( 'folder_to_play' ); ?>" name="<?php echo $this->get_field_name( 'folder_to_play' ); ?>" value="<?php echo $instance['folder_to_play']; ?>" /></p>
1989
+ <p class="description" style="text-align:right; margin:0px 0px 4px 0px; font-size:10px; <?php echo $style; ?>"><?php echo $txt; ?></p>
1990
+
1991
+
1992
+ <p style="margin:0px 0px 15px 25px; font-size:11px;">
1993
+ Pick &nbsp;<input class="widefat" style="width:35px; text-align:right;" type="text" id="<?php echo $this->get_field_id( 'slice_size' ); ?>" name="<?php echo $this->get_field_name( 'slice_size' ); ?>" value="<?php echo $instance['slice_size']; ?>" />&nbsp; track(s)</p>
1994
+
1995
+ <!-- Other Settings -->
1996
+ <div style="margin: 0px 0px 12px 0px; border-top: 1px solid #eee; border-bottom: 1px solid #eee;">
1997
+ <p style="font-size: 11px;margin: 10px 0px 2px 0px;">
1998
+ <input type="checkbox" id="<?php echo $this->get_field_id( 'shuffle' ); ?>" name="<?php echo $this->get_field_name( 'shuffle' ); ?>" value="true" <?php if ($instance['shuffle'] == "true") { _e('checked="checked"', "mp3jplayerwidget"); }?> />
1999
+ &nbsp;Shuffle</p>
2000
+ <p style="font-size: 11px;margin: 0px 0px 6px 0px;">
2001
+ <input type="checkbox" id="<?php echo $this->get_field_id( 'download_link' ); ?>" name="<?php echo $this->get_field_name( 'download_link' ); ?>" value="true" <?php if ($instance['download_link'] == "true") { _e('checked="checked"', "mp3jplayerwidget"); }?> />
2002
+ &nbsp;Download link</p>
2003
+
2004
+
2005
+ <p style="margin:0px 0px 12px 0px; font-size:11px;">Playlist&nbsp;
2006
+ <select id="<?php echo $this->get_field_id( 'playlist_mode' ); ?>" name="<?php echo $this->get_field_name( 'playlist_mode' ); ?>" class="widefat" style="width:90px; font-size:11px;">
2007
+ <option value="open" <?php if ( 'open' == $instance['playlist_mode'] ) { echo 'selected="selected"'; } ?>>Open</option>
2008
+ <option value="closed" <?php if ( 'closed' == $instance['playlist_mode'] ) { echo 'selected="selected"'; } ?>>Closed</option>
2009
+ <option value="hidden" <?php if ( 'hidden' == $instance['playlist_mode'] ) { echo 'selected="selected"'; } ?>>Hidden</option>
2010
+ <option value="radio" <?php if ( 'radio' == $instance['playlist_mode'] ) { echo 'selected="selected"'; } ?>>Radio</option>
2011
+ </select>
2012
+ </p>
2013
+ </div>
2014
+
2015
+ <!-- Page Filter -->
2016
+ <p style="margin-top:0px; margin-bottom: 0px;">Page Filter</p>
2017
+ <p style="font-size: 11px; margin:12px 0px 8px 0px;">
2018
+ Include <input type="radio" id="<?php echo $this->get_field_id( 'restrict_mode' ); ?>" name="<?php echo $this->get_field_name( 'restrict_mode' ); ?>" value="include" <?php if ($instance['restrict_mode'] == "include") { _e('checked="checked"', "mp3jplayerwidget"); }?> />
2019
+ or <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"', "mp3jplayerwidget"); }?> />
2020
+ Exclude</p>
2021
+ <p style="font-size: 11px; margin-bottom: 0px;"><input class="widefat" style="font-size:11px;" type="text" id="<?php echo $this->get_field_id( 'restrict_list' ); ?>" name="<?php echo $this->get_field_name( 'restrict_list' ); ?>" value="<?php echo $instance['restrict_list']; ?>" /></p>
2022
+ <p class="description" style="text-align:right; font-size:11px; margin-bottom: 0px;">(a comma separated list of post ID's)</p>
2023
+ <p class="description" style="font-size:11px; margin-top:8px; margin-bottom:1px;">Set to Include and write 'index' for a posts index only player.</p>
2024
+ <div style="margin: 0px 0px 0px 0px; border-bottom: 1px solid #eee; height: 10px;"></div>
2025
+
2026
+ <!-- Widget Heading -->
2027
+ <p style="margin: 10px 0px 7px 0px;">Widget Heading:</p>
2028
+ <p style="margin: 0px 0px 10px 0px;"><input class="widefat" type="text" id="<?php echo $this->get_field_id( 'widget_title' ); ?>" name="<?php echo $this->get_field_name( 'widget_title' ); ?>" value="<?php echo $instance['widget_title']; ?>" /></p>
2029
+
2030
+ <?php
2031
+ }
2032
+
2033
+
2034
+ /**
2035
+ * Checks current page id against widget page-filter settings.
2036
+ * returns true if page should be filtered.
2037
+ */
2038
+ function page_filter( $list, $mode ) {
2039
+
2040
+ if ( !empty($list) ) {
2041
+ $pagelist = explode( ",", $list );
2042
+ if ( !empty($pagelist) ) {
2043
+ foreach ( $pagelist as $i => $id ) {
2044
+ $pagelist[$i] = str_replace( " ", "", $id );
2045
+ }
2046
+ }
2047
+ global $post;
2048
+ $thisID = $post->ID;
2049
+ if ( $mode == "include" ) {
2050
+ foreach ( $pagelist as $i => $id ) {
2051
+ if ( $id != $thisID ) {
2052
+ return true;
2053
+ }
2054
+ }
2055
+ }
2056
+ if ( $mode == "exclude" ) {
2057
+ foreach ( $pagelist as $i => $id ) {
2058
+ if ( $id == $thisID ) {
2059
+ return true;
2060
+ }
2061
+ }
2062
+ }
2063
+ }
2064
+ return false;
2065
+ }
2066
+ } //end class MP3_jPlayer //
2067
+ }
2068
+ }
2069
 
2070
 
2071
+ // Create plugin class instance //
2072
  if ( class_exists("mp3Fox") ) {
2073
  $mp3_fox = new mp3Fox();
2074
  }
 
2075
 
2076
+ if ( isset($mp3_fox) ) {
2077
 
2078
+ // Initialize main admin page //
2079
  if ( !function_exists("mp3Fox_ap") ) {
2080
+
2081
  function mp3Fox_ap() {
 
2082
  global $mp3_fox;
2083
  if ( !isset($mp3_fox) ) {
2084
  return;
2089
  }
2090
  }
2091
 
2092
+ // Initialize mp3j template tags //
 
2093
  function mp3j_put( $id = "", $pos = "", $dload = "", $play = "", $list = "" ) {
 
2094
  do_action( 'mp3j_put', $id, $pos, $dload, $play, $list );
2095
  }
2096
 
2097
  function mp3j_flag( $set = 1 ) {
 
2098
  do_action('mp3j_flag', $set);
2099
  }
2100
 
2101
  function mp3j_addscripts( $style = "" ) {
 
2102
  do_action('mp3j_addscripts', $style);
2103
  }
2104
 
2105
  function mp3j_debug( $display = "" ) {
 
2106
  do_action('mp3j_debug', $display);
2107
  }
2108
 
2109
  function mp3j_grab_library( $format = 1 ) {
 
2110
  $thereturn = array();
2111
  if ( $format == 1 ) {
2112
  $library = apply_filters('mp3j_grab_library', $thereturn );
2121
  }
2122
  }
2123
 
2124
+ function mp3j_set_meta( $tracks, $captions = "", $startnum = 1 ) {
 
2125
  if ( empty($tracks) || !is_array($tracks) ) {
2126
+ return;
2127
+ }
2128
+ do_action('mp3j_set_meta', $tracks, $captions, $startnum);
2129
  }
2130
 
2131
+ // Initialize widget //
2132
+ function mp3jplayer_widget_init() {
2133
+ register_widget( 'MP3_jPlayer' );
2134
+ }
2135
 
2136
+ // add hook calls //
2137
+ // admin //
2138
  add_action('activate_mp3-jplayer/mp3jplayer.php', array(&$mp3_fox, 'initFox'));
2139
  add_action('deactivate_mp3-jplayer/mp3jplayer.php', array(&$mp3_fox, 'uninitFox'));
2140
  add_action('admin_menu', 'mp3Fox_ap');
2141
+ // template //
 
2142
  add_action('wp_head', array(&$mp3_fox, 'check_if_scripts_needed'), 2);
2143
  add_filter('the_content', array(&$mp3_fox, 'add_player'));
2144
+ add_action('wp_footer', array(&$mp3_fox, 'debug_print_handler'));
2145
  add_shortcode('mp3-jplayer', array(&$mp3_fox, 'shortcode_handler'));
2146
  add_action('mp3j_put', array(&$mp3_fox, 'template_tag_handler'), 10, 5 );
2147
  add_action('mp3j_flag', array(&$mp3_fox, 'flag_tag_handler'), 10, 1 );
2150
  add_filter('mp3j_grab_library', array(&$mp3_fox, 'grablibrary_handler'), 10, 1 );
2151
  add_filter('mp3j_grab_library_wp', array(&$mp3_fox, 'grablibraryWP_handler'), 10, 1 );
2152
  add_action('mp3j_set_meta', array(&$mp3_fox, 'feed_metadata'), 10, 3 );
2153
+ // widget //
2154
+ add_action( 'widgets_init', 'mp3jplayer_widget_init' );
2155
  }
2156
  ?>
readme.htm DELETED
@@ -1,360 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html>
4
- <head>
5
- <title>Readme</title>
6
- </head>
7
- <style type="text/css">
8
- <!--
9
- body {
10
- font-family: Lucida Grande, Verdana, sans-serif;
11
- }
12
-
13
- code {
14
- font-size: 1.3em
15
- }
16
-
17
-
18
-
19
- -->
20
- </style>
21
- <body>
22
-
23
-
24
- <h1>MP3-jPlayer</h1>
25
-
26
- <p><em>Auto adds an mp3 audio player to pages / posts that you make a playlist on. Can be customised into themes.</em></p>
27
-
28
- <hr />
29
-
30
- <p>
31
- <strong>Contributors:</strong> simon.ward<br />
32
- <strong>Donate link:</strong> <br />
33
- <strong>Tags:</strong> mp3, audio, player, music, jplayer, integration, music player, mp3 player, playlist, media, jquery, javascript, plugin, shortcode, css, post, page, sidebar<br />
34
-
35
- <strong>Requires at least:</strong> 2.8<br />
36
- <strong>Tested up to:</strong> 3.0.1<br />
37
- <strong>Stable tag:</strong> 1.3.4 </p>
38
-
39
- <hr />
40
-
41
- <h3>Description</h3>
42
- <p>Version 1.3.4 adds a set of template tags for sidebar/header players etc, new shortcode options including centering and download setting, and a smaller player size option.</p>
43
-
44
- <p>Features:</p>
45
-
46
- <ul>
47
- <li>No setup.</li>
48
- <li>Play mp3's from your Media Library, a default folder, another domain.</li>
49
- <li>Add titles and captions to any mp3.</li>
50
-
51
- <li>Set playlists for download.</li>
52
- <li>Use or overide the library titles/captions.</li>
53
- <li>Optional shortcode.</li>
54
- <li>Simple admin panel.</li>
55
- <li>Template tags.</li>
56
- <li>CSS styleable.</li>
57
- <li>Integrates jquery jPlayer, works on the iPad.</li>
58
- </ul>
59
-
60
- <p><br />
61
-
62
- <a href="http://sjward.org/jplayer-for-wordpress">See a Demo here</a></p>
63
-
64
- <p><br />
65
- The player can be added to the most recent post on the post index (that has a playlist), or using template tags it can be put in sidebars/headers etc, fed a playlist, appear on archive pages, and set a stylesheet. Player has sliders, loader bar, status info, and optional download button.</p>
66
-
67
- <p><br /><br />
68
- <strong>Making a Playlist</strong></p>
69
-
70
- <p>Add tracks on page/post edit screens using the custom fields (below the content box), as follows:</p>
71
-
72
- <ol>
73
- <li><p>In the left box of a new custom-field enter:</p>
74
-
75
- <p>mp3</p></li>
76
- <li><p>Write the filename or URI* of the mp3 into the right box and hit 'Add custom field'.</p></li>
77
- </ol>
78
-
79
- <p>Repeat the above to add more tracks, and hit the 'update/publish' button when you're done.</p>
80
-
81
- <p><br />
82
- *Use a full URI when the mp3 is not in either a) the library or b) from the default folder/uri. You'll need to set the default folder that you want to use on the settings page.</p>
83
-
84
- <p><br /><br />
85
- <strong>Adding a Title</strong></p>
86
-
87
- <p>Add titles in the right box, before the filename (or uri), separate with an @ sign, eg:</p>
88
-
89
- <pre><code>Title@filename
90
- </code></pre>
91
-
92
- <p><br /><br />
93
- <strong>Adding aCaption</strong></p>
94
-
95
- <p>Add the caption in the left hand box after 'mp3', separate with a dot, eg.</p>
96
-
97
- <pre><code>mp3.Caption
98
- </code></pre>
99
-
100
- <p>You can blank out a library caption (or a caption that's been carried over from a previous track) by using just the dot (ie. 'mp3.')</p>
101
-
102
- <p><br /><br />
103
- <strong>Play Order</strong></p>
104
-
105
- <p>To control the playlist order number the left hand boxes, eg:</p>
106
-
107
- <pre><code>1 mp3
108
-
109
-
110
- 2 mp3.Caption
111
-
112
-
113
- 3 mp3.Another Caption
114
- </code></pre>
115
-
116
- <p><br /><br />
117
- <strong>Shortcode</strong></p>
118
-
119
- <p>Using the shortcode is optional, it lets you position the player within the content rather than at the top of it, and has 4 optional attributes for controlling the position (pos), download setting (dload), autoplay (play), and show playlist (list) on each page. The shortcode is:</p>
120
-
121
- <p><strong><code>&#x5b;mp3-jplayer]</code></strong></p>
122
-
123
- <p>The attributes are:</p>
124
-
125
- <p>pos: left, right, rel (or none), rel-C, rel-R, absolute</p>
126
-
127
- <p>dload: true, false</p>
128
-
129
- <p>play: true, false</p>
130
-
131
- <p>list: true, false</p>
132
-
133
- <p><br />
134
- for example</p>
135
-
136
- <p><strong><code>&#x5b;mp3-jplayer play="true" pos="rel-C" dload="true"]</code></strong></p>
137
-
138
- <p><br /><br />
139
- <strong>Template Tags</strong></p>
140
-
141
- <p><strong>Quick example:</strong>
142
-
143
- <strong>Make the player move to sidebar on the posts index and play 5 random tracks from your library</strong></p>
144
-
145
- <p>Put this in index.php before the posts loop starts:</p>
146
-
147
- <pre><code>&lt;?php if ( function_exists('mp3j_flag') ) { mp3j_flag(); } ?&gt;
148
- </code></pre>
149
-
150
-
151
- <p><br />
152
- Put this in sidebar.php somewhere below the opening div(s):</p>
153
-
154
- <pre><code>&lt;?php
155
- if ( function_exists( 'mp3j_grab_library' ) ) {
156
- $lib = mp3j_grab_library();
157
- $files = $lib&#x5b;'filenames'];
158
- shuffle( $files );
159
- $files = array_slice( $files, 0, 5 );
160
- mp3j_set_meta( $files );
161
- mp3j_put( 'feed' );
162
- }
163
- ?&gt;
164
-
165
- </code></pre>
166
-
167
- <p><br />
168
- To use the smaller player stylesheet on the above example put this in header.php above wp_head():</p>
169
-
170
- <pre><code>&lt;?php
171
- if ( function_exists('mp3j_addscripts') ) {
172
- if ( is_home() ) {
173
- mp3j_addscripts('/wp-content/plugins/mp3-jplayer/css/mp3jplayer-blu-sidebar.css');
174
- }
175
- }
176
- ?&gt;
177
- </code></pre>
178
-
179
- <p><br /><br />
180
- <strong>Tag Details</strong></p>
181
-
182
- <p>Note: there's an admin option to ignore the tags which needs to be unticked when you want to use them!</p>
183
-
184
- <p><strong><code>mp3j_addscripts( $style )</code></strong></p>
185
-
186
- <ul>
187
- <li><p>Forces the player's javascript/CSS to be loaded and allows you to change stylesheet. Scripts aren't automatically enqueued on archive pages and any singular that has no playlist of it's own. When used this tag must be placed above wp_head().</p></li>
188
- <li><p>$style can be either a uri to a stylesheet, or 'styleA', 'styleB', 'styleC', 'styleD' to use one of the included. Defaults to admin setting if not specified.</p></li>
189
- </ul>
190
-
191
- <p><br /></p>
192
-
193
- <p><strong><code>mp3j_flag( $set )</code></strong></p>
194
-
195
- <ul>
196
- <li><p>Tells the plugin to ignore content and shortcodes and to wait for an mp3j_put tag. The flag tag can be anywhere and can be used more than once.</p></li>
197
-
198
- <li><p>$set can be either 1 (set the flag) or 0 (unset the flag), and is 1 if not specified.</p></li>
199
- </ul>
200
-
201
- <p><br /></p>
202
-
203
- <p><strong><code>mp3j_grab_library( $format )</code></strong></p>
204
-
205
- <ul>
206
- <li><p>returns an array of all the mp3's in the library with their 'filenames', 'urls', 'titles', 'excerpts', and 'descriptions'. Can be used anywhere.</p></li>
207
- <li><p>$format can be either 1 (gives back the above fields in indexed arrays) or 0 (gives back the arrays as returned from the select query), defaults to 1.</p></li>
208
- </ul>
209
-
210
- <p><br /></p>
211
-
212
- <p><strong><code>mp3j_set_meta( $tracks, $captions )</code></strong></p>
213
-
214
- <ul>
215
- <li><p>Sets an on-the-fly playlist for the mp3j_put tag to pick up. Can be used anywhere to create a playlist. The arrays you feed in go through the same sorting/filtering routine as if the tracks had been pulled from a page or post, and still respond to the admin settings like 'hide file extension' or 'play in alphabetical order'.</p></li>
216
- <li><p>$tracks must be an indexed array of any mix of either filenames (from default folder or library) or full uri's, and can include a prefixed title using an '@' as a separator same as the fields do. As the admin settings are still applied, if 'always use library titles..' is ticked and it's a library 'filename' that you're using then any corresponding caption in the $captions array won't make it through, to get control of titles and captions for library files use their 'urls' in the $tracks array.</p></li>
217
- <li><p>$captions is an optional array, the indexes should correspond to the indexes of their files in the $tracks array.</p></li>
218
- </ul>
219
-
220
- <p><br /></p>
221
-
222
- <p><strong><code>mp3j_put( $mode, $position, $dload, $autoplay, $playlist )</code></strong></p>
223
-
224
- <ul>
225
- <li><p>Puts the player on the page (but only if mp3j_flag is set and what you're asking it to play results in some tracks!). Can be used multiple times and must be within the &lt;body&gt;&lt;/body&gt; section of a page.</p></li>
226
- <li><p>$mode can be: A post id to grab tracks from; 'first' to pick up the tracks from the first content encountered that had a playlist (see note below); 'feed' to pick up an alternative playlist created with mp3j_set_meta; or not set ('') to pick up tracks from any current id;</p></li>
227
- <li><p>$pos can be 'left', 'right' for float; 'none', 'rel-C', 'rel-R' for relative position; or 'absolute'). Defaults to admin setting</p></li>
228
- <li><p>$dload - show download button, 'true' or 'false'. defaults to admin setting.</p></li>
229
- <li><p>$autoplay - 'true' or 'false'. defaults to admin setting.</p></li>
230
- <li><p>$playlist - start with playlist showing, 'true' or 'false'. defaults to admin setting.</p></li>
231
-
232
- <li><p>Note on 'first': Typically you'd use this on an index page when the player is in the sidebar (ie. when the put tag comes after the loop has run) and you want to play the most recent tracks post. If there is no first id to collect (when no posts have a playlist) the player would not be added, to set a backup use another put tag directly underneath the first with $mode set to some id you want to pick up tracks from, or set to 'feed' to pick up an alternative playlist you've created using mp3j_set_meta.</p></li>
233
- <li><p>Another note on 'first': Because it actually waits for the content and has a look for tracks, it won't do anything if the put tag using 'first' is above the loop. To get header players to play the first post with tracks you either have to put the put-tag in a div after the loop and css absolute position it, or query the upcoming posts and use the id.</p></li>
234
- </ul>
235
-
236
- <p><br /></p>
237
-
238
- <p><strong><code>mp3j_debug($info)</code></strong></p>
239
-
240
- <ul>
241
- <li><p>Prints some info and variables from the plugin to the browser's source view (CTRL+U or Page-&gt;view source) about what content and tags appeared on the page that just ran. Can be used more than once to get info at different points in page. Can be useful for debugging when customising templates.</p></li>
242
- <li><p>$info can be 'vars' to see info only or 'all' to also see meta and library arrays (a potentially long list), defaults to vars.</p></li>
243
-
244
- </ul>
245
-
246
- <p><br /><br />
247
- Best to use function_exists() to make sure the tags exist before running them, eg:</p>
248
-
249
- <pre><code>&lt;?php if ( function_exists('mp3j_addscripts') ) { mp3j_addscripts('styleD'); } ?&gt;
250
- </code></pre>
251
-
252
- <p>Running them without checking when the plugin is not activated will throw an error.</p>
253
-
254
- <p><br /></p> <hr />
255
- <h3>Installation</h3>
256
-
257
- <p>To install using Wordpress:</p>
258
-
259
- <ol>
260
- <li>Download the zip file to your computer.</li>
261
- <li>Log in to your Wordpress admin and go to 'plugins' -&gt; 'Add New'.</li>
262
- <li>Click 'Upload' at the top of the page then browse' for the zip file on your computer and hit the 'Install' button, Wordpress should install it for you.</li>
263
- <li>Once installed go to your Wordpress 'Plugins' menu and activate MP3-jPlayer.</li>
264
- </ol>
265
-
266
- <p>To Install manually:</p>
267
-
268
- <ol>
269
- <li>Download the zip file and unzip it. </li>
270
- <li>Open the unzipped folder and upload the entire contents (1 folder and it's files and subfolders) to your <code>/wp-content/plugins</code> directory on the server.</li>
271
- <li>Activate the plugin via your Wordpress 'Plugins' menu.</li>
272
- </ol> <hr />
273
- <h3>Frequently Asked Questions</h3>
274
-
275
- <h4>Can the player go in the header/sidebar?</h4>
276
-
277
- <p>Yes from this version 1.3.4 if you use template tags. It's not a widget yet so you can't do it from the admin area currently.</p>
278
-
279
- <h4>Why is the default folder set to your domain?</h4>
280
-
281
- <p>It's not anymore, it was going to be for testing a default install without needing to know any mp3's. So you could activate, go to a page and use 'test' as the filename and it would play that file from my domain, but a)i forgot to mention it, and b)it's prob not that useful. On fresh install it's now set to the root of your domain.</p> <hr />
282
- <h3>Screenshots</h3>
283
- <ol>
284
-
285
- <li>Player</li>
286
- <li>Admin settings page</li>
287
- <li>Playlist example</li>
288
- </ol> <hr />
289
- <h3>Changelog</h3>
290
- <h4>1.3.4</h4>
291
-
292
- <ul>
293
- <li>Added template tags.</li>
294
-
295
- <li>Added new shortcode attributes play and list, and added more values for pos.</li>
296
- <li>Added new default position options on settings page</li>
297
- <li>Added a smaller player option</li>
298
- </ul>
299
-
300
- <h4>1.3.3</h4>
301
-
302
- <ul>
303
- <li>Fixed the CSS that caused player to display poorly in some themes.</li>
304
- </ul>
305
-
306
- <h4>1.3.2</h4>
307
-
308
- <ul>
309
- <li>Added the shortcode [mp3-jplayer] and attributes: pos (left, right, none), dload (true, false) which over-ride the admin-panel position and download settings on that post/page. Eg. [mp3-jplayer pos="right" dload="true"]</li>
310
- <li>Tweaked transport button graphic a wee bit.</li>
311
- </ul>
312
-
313
- <h4>1.3.1</h4>
314
-
315
- <ul>
316
- <li>Fixed image rollover on buttons when wordpress not installed in root of site.</li>
317
- </ul>
318
-
319
- <h4>1.3.0</h4>
320
-
321
- <ul>
322
- <li>Updated jquery.jplayer.min.js to version 1.2.0 (including the new .swf file). The plugin should now work on the iPad.</li>
323
- <li>Fixed admin side broken display of the uploads folder path that occured when a path had been specified but didn't yet exist.</li>
324
- <li>Fixed the broken link to the (new) media settings page when running in Wordpress 3.</li>
325
- <li>Changed the 'Use my media library titles...' option logic to allow any titles or captions to independently over-ride the library by default. The option is now 'Always use my media library titles...' which when ticked will give preference to library titles/captions over those in the custom fields.</li>
326
- <li>Modified the css for compatibility with Internet Explorer 6. The player should now display almost the same in IE6 as in other browsers.</li>
327
- </ul>
328
-
329
- <h4>1.2.12</h4>
330
-
331
- <ul>
332
- <li>Added play order setting, a 'download mp3' link option, show/hide playlist and option, a connecting state, a new style. </li>
333
- <li>The 'Default folder' option can now be a remote uri to a folder, if it is then it doesn't get filtered from the playists when 'allow remote' is unticked. </li>
334
- </ul>
335
-
336
- <h4>1.2.0</h4>
337
-
338
- <ul>
339
- <li>Added playing of media library mp3's in the same way as from the default folder (ie. by entering just a filename). User does not have to specify where the tracks reside (recognises library file, default folder file, and local or remote uri's). </li>
340
- <li>Added filter option to remove off-site mp3's from the playlists.</li>
341
- <li>The plugin now clears out it's settings from the database by default upon deactivation. This can be changed from the settings page.</li>
342
-
343
- <li>It's no longer necessary to include the file extension when writing filenames.</li>
344
- </ul>
345
-
346
- <h4>1.1.0</h4>
347
-
348
- <ul>
349
- <li>Added captions, player status info, a-z sort option, basic player positioning, detecting of urls/default folder</li>
350
- <li>Fixed bug where using unescaped double quotes in a title broke the playlist, quotes are now escaped automatically and can be used.</li>
351
- </ul>
352
-
353
- <h4>1.0</h4>
354
-
355
- <ul>
356
- <li>First release</li>
357
- </ul> <hr />
358
-
359
-
360
- </body></html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -2,132 +2,153 @@
2
  Author URI: http://www.sjward.org
3
  Plugin URI: http://www.sjward.org/jplayer-for-wordpress
4
  Contributors: simon.ward
5
- Tags: mp3, audio, player, music, jplayer, integration, music player, mp3 player, playlist, media, jquery, javascript, plugin, shortcode, css, post, page, sidebar
6
  Requires at least: 2.8
7
- Tested up to: 3.0.1
8
- Stable tag: 1.3.4
9
-
10
- Auto adds an mp3 audio player to pages / posts that you make a playlist on. Can be customised into themes.
11
 
 
12
 
13
 
14
  == Description ==
15
- Version 1.3.4 adds a set of template tags for sidebar/header players etc, new shortcode options including centering and download setting, and a smaller player size option.
16
-
17
- Features:
18
 
19
- * No setup.
20
- * Play mp3's from your Media Library, a default folder, another domain.
21
- * Add titles and captions to any mp3.
22
- * Set playlists for download.
23
- * Use or overide the library titles/captions.
24
- * Optional shortcode.
25
- * Simple admin panel.
26
- * Template tags.
27
- * CSS styleable.
28
- * Integrates jquery jPlayer, works on the iPad.
29
 
30
 
31
- <br />
32
  [See a Demo here](http://sjward.org/jplayer-for-wordpress)
33
 
34
- <br />
35
- The player can be added to the most recent post on the post index (that has a playlist), or using template tags it can be put in sidebars/headers etc, fed a playlist, appear on archive pages, and set a stylesheet. Player has sliders, loader bar, status info, and optional download button.
36
-
37
-
38
- <br /><br />
39
- **Making a Playlist**
40
 
 
41
 
42
- Add tracks on page/post edit screens using the custom fields (below the content box), as follows:
 
 
 
 
 
 
 
 
43
 
44
- 1. In the left box of a new custom-field enter:
45
 
46
- <code>mp3</code>
 
47
 
48
 
49
- 2. Write the filename or URI* of the mp3 into the right box and hit 'Add custom field'.
 
50
 
 
51
 
52
- Repeat the above to add more tracks, and hit the 'update/publish' button when you're done.
53
 
54
  <br />
55
- *Use a full URI when the mp3 is not in either a) the library or b) from the default folder/uri. You'll need to set the default folder that you want to use on the settings page.
56
 
 
57
 
58
- <br /><br />
59
- **Adding a Title**
60
 
61
- Add titles in the right box, before the filename (or uri), separate with an @ sign, eg:
62
 
63
- <code>Title@filename</code>
64
 
 
65
 
66
- <br /><br />
67
- **Adding aCaption**
68
 
69
- Add the caption in the left hand box after 'mp3', separate with a dot, eg.
70
 
71
- <code>mp3.Caption</code>
 
72
 
 
73
 
74
- You can blank out a library caption (or a caption that's been carried over from a previous track) by using just the dot (ie. 'mp3.')
75
 
76
 
77
- <br /><br />
78
  **Play Order**
79
 
80
- To control the playlist order number the left hand boxes, eg:
81
 
82
- <code>1 mp3</code>
 
83
 
 
84
 
85
- <code>2 mp3.Caption</code>
 
86
 
 
 
87
 
88
- <code>3 mp3.Another Caption</code>
 
89
 
 
90
 
91
 
92
- <br /><br />
93
  **Shortcode**
94
 
95
- Using the shortcode is optional, it lets you position the player within the content rather than at the top of it, and has 4 optional attributes for controlling the position (pos), download setting (dload), autoplay (play), and show playlist (list) on each page. The shortcode is:
96
 
97
  **<code>[mp3-jplayer]</code>**
98
 
99
 
100
  The attributes are:
101
 
102
- pos: left, right, rel (or none), rel-C, rel-R, absolute
103
 
104
  dload: true, false
105
 
106
  play: true, false
107
 
108
- list: true, false
109
 
 
110
 
111
- <br />
112
- for example
 
113
 
114
- **<code>[mp3-jplayer play="true" pos="rel-C" dload="true"]</code>**
 
115
 
 
116
 
117
 
118
- <br /><br />
119
  **Template Tags**
120
 
121
- **Quick example:**
122
- **Make the player move to sidebar on the posts index and play 5 random tracks from your library**
 
 
 
 
 
 
 
 
 
 
 
 
123
 
124
  Put this in index.php before the posts loop starts:
125
 
126
  `<?php if ( function_exists('mp3j_flag') ) { mp3j_flag(); } ?>`
127
 
128
-
129
  <br />
130
- Put this in sidebar.php somewhere below the opening div(s):
131
 
132
  `<?php
133
  if ( function_exists( 'mp3j_grab_library' ) ) {
@@ -142,7 +163,7 @@ if ( function_exists( 'mp3j_grab_library' ) ) {
142
 
143
 
144
  <br />
145
- To use the smaller player stylesheet on the above example put this in header.php above wp_head():
146
 
147
  `<?php
148
  if ( function_exists('mp3j_addscripts') ) {
@@ -153,91 +174,9 @@ if ( function_exists('mp3j_addscripts') ) {
153
  ?>`
154
 
155
 
156
- <br /><br />
157
- **Tag Details**
158
 
159
- Note: there's an admin option to ignore the tags which needs to be unticked when you want to use them!
160
-
161
- **<code>mp3j_addscripts( $style )</code>**
162
-
163
-
164
- - Forces the player's javascript/CSS to be loaded and allows you to change stylesheet. Scripts aren't automatically enqueued on archive pages and any singular that has no playlist of it's own. When used this tag must be placed above wp_head().
165
-
166
- - $style can be either a uri to a stylesheet, or 'styleA', 'styleB', 'styleC', 'styleD' to use one of the included. Defaults to admin setting if not specified.
167
-
168
-
169
- <br />
170
-
171
- **<code>mp3j_flag( $set )</code>**
172
 
173
-
174
- - Tells the plugin to ignore content and shortcodes and to wait for an mp3j_put tag. The flag tag can be anywhere and can be used more than once.
175
-
176
- - $set can be either 1 (set the flag) or 0 (unset the flag), and is 1 if not specified.
177
-
178
-
179
- <br />
180
-
181
- **<code>mp3j_grab_library( $format )</code>**
182
-
183
-
184
- - returns an array of all the mp3's in the library with their 'filenames', 'urls', 'titles', 'excerpts', and 'descriptions'. Can be used anywhere.
185
-
186
- - $format can be either 1 (gives back the above fields in indexed arrays) or 0 (gives back the arrays as returned from the select query), defaults to 1.
187
-
188
-
189
- <br />
190
-
191
- **<code>mp3j_set_meta( $tracks, $captions )</code>**
192
-
193
-
194
- - Sets an on-the-fly playlist for the mp3j_put tag to pick up. Can be used anywhere to create a playlist. The arrays you feed in go through the same sorting/filtering routine as if the tracks had been pulled from a page or post, and still respond to the admin settings like 'hide file extension' or 'play in alphabetical order'.
195
-
196
- - $tracks must be an indexed array of any mix of either filenames (from default folder or library) or full uri's, and can include a prefixed title using an '@' as a separator same as the fields do. As the admin settings are still applied, if 'always use library titles..' is ticked and it's a library 'filename' that you're using then any corresponding caption in the $captions array won't make it through, to get control of titles and captions for library files use their 'urls' in the $tracks array.
197
-
198
- - $captions is an optional array, the indexes should correspond to the indexes of their files in the $tracks array.
199
-
200
-
201
- <br />
202
-
203
- **<code>mp3j_put( $mode, $position, $dload, $autoplay, $playlist )</code>**
204
-
205
-
206
- - Puts the player on the page (but only if mp3j_flag is set and what you're asking it to play results in some tracks!). Can be used multiple times and must be within the &lt;body&gt;&lt;/body&gt; section of a page.
207
-
208
- - $mode can be: A post id to grab tracks from; 'first' to pick up the tracks from the first content encountered that had a playlist (see note below); 'feed' to pick up an alternative playlist created with mp3j_set_meta; or not set ('') to pick up tracks from any current id;
209
-
210
- - $pos can be 'left', 'right' for float; 'none', 'rel-C', 'rel-R' for relative position; or 'absolute'). Defaults to admin setting
211
-
212
- - $dload - show download button, 'true' or 'false'. defaults to admin setting.
213
-
214
- - $autoplay - 'true' or 'false'. defaults to admin setting.
215
-
216
- - $playlist - start with playlist showing, 'true' or 'false'. defaults to admin setting.
217
-
218
- - Note on 'first': Typically you'd use this on an index page when the player is in the sidebar (ie. when the put tag comes after the loop has run) and you want to play the most recent tracks post. If there is no first id to collect (when no posts have a playlist) the player would not be added, to set a backup use another put tag directly underneath the first with $mode set to some id you want to pick up tracks from, or set to 'feed' to pick up an alternative playlist you've created using mp3j_set_meta.
219
-
220
- - Another note on 'first': Because it actually waits for the content and has a look for tracks, it won't do anything if the put tag using 'first' is above the loop. To get header players to play the first post with tracks you either have to put the put-tag in a div after the loop and css absolute position it, or query the upcoming posts and use the id.
221
-
222
- <br />
223
-
224
- **<code>mp3j_debug($info)</code>**
225
-
226
-
227
- - Prints some info and variables from the plugin to the browser's source view (CTRL+U or Page->view source) about what content and tags appeared on the page that just ran. Can be used more than once to get info at different points in page. Can be useful for debugging when customising templates.
228
-
229
- - $info can be 'vars' to see info only or 'all' to also see meta and library arrays (a potentially long list), defaults to vars.
230
-
231
-
232
- <br /><br />
233
- Best to use function_exists() to make sure the tags exist before running them, eg:
234
-
235
- `<?php if ( function_exists('mp3j_addscripts') ) { mp3j_addscripts('styleD'); } ?>`
236
-
237
- Running them without checking when the plugin is not activated will throw an error.
238
-
239
-
240
- <br />
241
  == Installation ==
242
 
243
  To install using Wordpress:
@@ -257,31 +196,39 @@ To Install manually:
257
 
258
  == Frequently Asked Questions ==
259
 
260
- = Can the player go in the header/sidebar? =
261
- Yes from this version 1.3.4 if you use template tags. It's not a widget yet so you can't do it from the admin area currently.
262
-
263
 
264
- = Why is the default folder set to your domain? =
265
- It's not anymore, it was going to be for testing a default install without needing to know any mp3's. So you could activate, go to a page and use 'test' as the filename and it would play that file from my domain, but a)i forgot to mention it, and b)it's prob not that useful. On fresh install it's now set to the root of your domain.
266
 
267
 
268
  == Screenshots ==
269
 
270
- 1. Player
271
- 2. Admin settings page
272
- 3. Playlist example
273
-
274
 
275
 
276
  == Changelog ==
277
 
 
 
 
 
 
 
 
 
 
 
278
  = 1.3.4 =
279
  * Added template tags.
280
  * Added new shortcode attributes play and list, and added more values for pos.
281
  * Added new default position options on settings page
282
  * Added a smaller player option
283
 
284
-
285
  = 1.3.3 =
286
  * Fixed the CSS that caused player to display poorly in some themes.
287
 
@@ -293,6 +240,7 @@ It's not anymore, it was going to be for testing a default install without needi
293
  * Fixed image rollover on buttons when wordpress not installed in root of site.
294
 
295
  = 1.3.0 =
 
296
  * Updated jquery.jplayer.min.js to version 1.2.0 (including the new .swf file). The plugin should now work on the iPad.
297
  * Fixed admin side broken display of the uploads folder path that occured when a path had been specified but didn't yet exist.
298
  * Fixed the broken link to the (new) media settings page when running in Wordpress 3.
2
  Author URI: http://www.sjward.org
3
  Plugin URI: http://www.sjward.org/jplayer-for-wordpress
4
  Contributors: simon.ward
5
+ Tags: mp3, audio, player, music, jplayer, integration, music player, mp3 player, playlist, media, jquery, javascript, plugin, shortcode, widget, widgets, css, posts, page, sidebar
6
  Requires at least: 2.8
7
+ Tested up to: 3.0.4
8
+ Stable tag: 1.4.0
 
 
9
 
10
+ An mp3 player for pages and posts, optional widget and shortcode, template tags. HTML 5 / Flash, works on iphone and ipad.
11
 
12
 
13
  == Description ==
14
+ New in 1.4.0 -
 
 
15
 
16
+ * A sidebar widget
17
+ * A text based player style
18
+ * Easy play of entire folders and library
19
+ * Randomise playlists
20
+ * Show library and local folder filenames on admin page
21
+ * Set a custom stylesheet from admin
22
+ * Playlist numbering optional
23
+ * More shortcode options
24
+ * Better help on the admin page
 
25
 
26
 
 
27
  [See a Demo here](http://sjward.org/jplayer-for-wordpress)
28
 
 
 
 
 
 
 
29
 
30
+ Features -
31
 
32
+ * No setup
33
+ * Play from your Media Library, a default folder, another domain
34
+ * Set playlists for download
35
+ * Add titles and captions
36
+ * Optional widget with playlist and page-filter control
37
+ * Optional shortcode and parameters
38
+ * A set of template-tags
39
+ * Fully CSS styleable
40
+ * Integrates Happyworm's jquery.jplayer that can use HTML 5 or Flash as needed.
41
 
 
42
 
43
+ <br />
44
+ The plugin plays your mp3's by looking in the page/post custom fields for any playlist you have written. The player is added automatically when it picks up a playlist to play. You can also write a playlist in the widget.
45
 
46
 
47
+ <br>
48
+ **Widget**
49
 
50
+ Drag the player widget into one of your sidebars and set it's playback mode or playlist. Use the page filter to include-only or exclude any pages and posts. You can use multiple widgets to set different playlists for different pages.
51
 
 
52
 
53
  <br />
54
+ **Writing a playlist in the custom fields**
55
 
56
+ Add tracks on page/post edit screens using the custom fields (below the content box), as follows:
57
 
58
+ 1. Enter <code>mp3</code> into the left hand box, this is the 'key' that the plugin looks for when reading the custom fields and you must always add it.
 
59
 
60
+ 2. Write the filename/URI* into the right hand box and hit 'add custom field'
61
 
 
62
 
63
+ Repeat the above to add more tracks, and hit the 'Update page' button when you're done.
64
 
65
+ *Use a full URI when the mp3 is not in either a) the library or b) from the default folder/uri.
 
66
 
 
67
 
68
+ <br />
69
+ **Adding Titles and captions**
70
 
71
+ 1. Add a dot, then a caption in the left hand box, eg: <code>mp3.Caption</code>
72
 
73
+ 2. Add the title, then an '@' before the filename, eg: <code>Title@filename</code>
74
 
75
 
76
+ <br />
77
  **Play Order**
78
 
79
+ To control the playlist order number the left hand boxes, eg: <code>1 mp3</code> will be first on the playlist. Un-numbered tracks appear below any numbered tracks.
80
 
81
+ <br />
82
+ **Playing a folder, the library, or another playlist**
83
 
84
+ Use these special commands in the value (right) box:
85
 
86
+ <code>FEED:LIB</code> Plays the entire library
87
+ <br />
88
 
89
+ <code>FEED:DF</code> Plays all from the default folder
90
+ <br />
91
 
92
+ <code>FEED:/mytunes</code> Play all from the local folder path /mytunes
93
+ <br />
94
 
95
+ <code>FEED:ID</code> Play the list from another ID (the id to pick up is set with the shortcode)
96
 
97
 
98
+ <br />
99
  **Shortcode**
100
 
101
+ The shortcode is optional, it lets you position the player within the content and has 7 optional attributes for controlling the position (pos), download setting (dload), autoplay (play), playlist state (list), page ID (id), shuffle tracks (shuffle), take a random selection (slice). The shortcode is:
102
 
103
  **<code>[mp3-jplayer]</code>**
104
 
105
 
106
  The attributes are:
107
 
108
+ pos: left, right, rel, rel-C, rel-R, absolute
109
 
110
  dload: true, false
111
 
112
  play: true, false
113
 
114
+ list: open, closed, hidden, radio
115
 
116
+ id: (a page ID to pick up a playlist from when using 'FEED:ID' above)
117
 
118
+ shuffle: true
119
+
120
+ slice: (the number of tracks)
121
 
122
+ <br />
123
+ eg.
124
 
125
+ **<code>[mp3-jplayer id="7" list="hidden" pos="rel-C" shuffle="true"]</code>**
126
 
127
 
128
+ <br />
129
  **Template Tags**
130
 
131
+ **<code>mp3j_addscripts( $style )</code>**
132
+
133
+ **<code>mp3j_flag( $set )</code>**
134
+
135
+ **<code>mp3j_grab_library( $format )</code>**
136
+
137
+ **<code>mp3j_set_meta( $tracks, $captions )</code>**
138
+
139
+ **<code>mp3j_put( $mode, $position, $dload, $autoplay, $playlist )</code>**
140
+
141
+ **<code>mp3j_debug($info)</code>**
142
+
143
+ <br>
144
+ Here's a quick example to make the player move to the sidebar on the posts index page and play 5 random tracks from your library
145
 
146
  Put this in index.php before the posts loop starts:
147
 
148
  `<?php if ( function_exists('mp3j_flag') ) { mp3j_flag(); } ?>`
149
 
 
150
  <br />
151
+ Put this in sidebar.php somewhere below the opening div (note this is simplistic code, you'll need at least 5 tracks in your library for it to work):
152
 
153
  `<?php
154
  if ( function_exists( 'mp3j_grab_library' ) ) {
163
 
164
 
165
  <br />
166
+ Finally, to set the smaller player stylesheet for the posts index only, put this in header.php above wp_head():
167
 
168
  `<?php
169
  if ( function_exists('mp3j_addscripts') ) {
174
  ?>`
175
 
176
 
177
+ See the help in the plugin for more info
 
178
 
 
 
 
 
 
 
 
 
 
 
 
 
 
179
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
180
  == Installation ==
181
 
182
  To install using Wordpress:
196
 
197
  == Frequently Asked Questions ==
198
 
199
+ = Can the player go in the sidebar? =
200
+ Yes, by widgets or template-tags.
 
201
 
202
+ = Can the player go in the header/footer? =
203
+ Yes if your theme has header/footer widget areas, if it doesn't then you can use template-tags to place the player anywhere in the theme.
204
 
205
 
206
  == Screenshots ==
207
 
208
+ 1. Included player styles
209
+ 2. Main admin page
210
+ 3. Widget panel
211
+ 3. Playlist example written into the custom fields
212
 
213
 
214
  == Changelog ==
215
 
216
+ = 1.4.0 =
217
+ * Added a widget.
218
+ * Improvements to admin including library and default folder mp3 lists, custom stylesheet setting, and some new options.
219
+ * Added new shortcode attributes shuffle, slice, id. New values for list
220
+ * Added a way to play whole folders, the entire library, to grab the tracks from another page.
221
+ * Added a simpler text-only player style that adopts theme link colours.
222
+ * Improved admin help.
223
+ * Some minor bug fixes.
224
+ * Some minor css improvements and fixes.
225
+
226
  = 1.3.4 =
227
  * Added template tags.
228
  * Added new shortcode attributes play and list, and added more values for pos.
229
  * Added new default position options on settings page
230
  * Added a smaller player option
231
 
 
232
  = 1.3.3 =
233
  * Fixed the CSS that caused player to display poorly in some themes.
234
 
240
  * Fixed image rollover on buttons when wordpress not installed in root of site.
241
 
242
  = 1.3.0 =
243
+ * First release on Wordpress.org
244
  * Updated jquery.jplayer.min.js to version 1.2.0 (including the new .swf file). The plugin should now work on the iPad.
245
  * Fixed admin side broken display of the uploads folder path that occured when a path had been specified but didn't yet exist.
246
  * Fixed the broken link to the (new) media settings page when running in Wordpress 3.
screenshot-1.png CHANGED
Binary file
screenshot-2.png CHANGED
Binary file
screenshot-3.png CHANGED
Binary file
screenshot-4.png ADDED
Binary file
template-tag-help.htm ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html>
4
+ <head>
5
+ <title>Template Tag Help</title>
6
+ </head>
7
+ <style type="text/css">
8
+ <!--
9
+ body {
10
+ font-family: Lucida Grande, Verdana, sans-serif;
11
+ }
12
+
13
+ code {
14
+ font-size: 1.3em
15
+ }
16
+
17
+
18
+
19
+ -->
20
+ </style>
21
+ <body>
22
+ <div style="width:700px; margin:50px auto 50px auto;">
23
+
24
+
25
+
26
+ <p><br />
27
+ <strong>Template Tags</strong></p>
28
+
29
+ <p>Here's a quick example to make the player move to the sidebar on the posts index page and play 5 random tracks from your library</p>
30
+
31
+ <p>Put this in index.php before the posts loop starts:</p>
32
+
33
+ <pre><code>&lt;?php if ( function_exists(&#039;mp3j_flag&#039;) ) { mp3j_flag(); } ?&gt;</code></pre>
34
+
35
+ <p><br />
36
+ Put this in sidebar.php somewhere below the opening div (note this is very simplistic code, you'll need at least 5 tracks in your library for it to work):</p>
37
+
38
+ <pre><code>&lt;?php
39
+ if ( function_exists( &#039;mp3j_grab_library&#039; ) ) {
40
+ $lib = mp3j_grab_library();
41
+ $files = $lib&#x5b;&#039;filenames&#039;];
42
+ shuffle( $files );
43
+ $files = array_slice( $files, 0, 5 );
44
+ mp3j_set_meta( $files );
45
+ mp3j_put( &#039;feed&#039; );
46
+ }
47
+ ?&gt;</code></pre>
48
+
49
+ <p><br />
50
+ Finally, to set the smaller player stylesheet for the posts index only, put this in header.php above wp_head():</p>
51
+
52
+ <pre><code>&lt;?php
53
+ if ( function_exists(&#039;mp3j_addscripts&#039;) ) {
54
+ if ( is_home() ) {
55
+ mp3j_addscripts(&#039;/wp-content/plugins/mp3-jplayer/css/mp3jplayer-blu-sidebar.css&#039;);
56
+ }
57
+ }
58
+ ?&gt;</code></pre>
59
+
60
+ <p><br />
61
+ <strong>Tag Details</strong></p>
62
+
63
+ <p>Note: there's an admin option to ignore the tags which needs to remain unticked when you want to use them!</p>
64
+
65
+ <p><strong><code>mp3j_addscripts( $style )</code></strong></p>
66
+
67
+ <ul>
68
+ <li><p>Forces the player's javascript/CSS to be loaded and allows you to set a stylesheet. Scripts aren't automatically enqueued on archive pages and any singular that has no playlist of it's own. When used this tag must be placed above wp_head().</p></li>
69
+ <li><p>$style can be either a uri to a stylesheet, or 'styleA', 'styleB', 'styleC', 'styleD', 'styleE' to use one available from admin. Defaults to current admin setting if not specified.</p></li>
70
+ </ul>
71
+
72
+ <p><br /></p>
73
+
74
+ <p><strong><code>mp3j_flag( $set )</code></strong></p>
75
+
76
+ <ul>
77
+ <li><p>Tells the plugin to ignore addition via content/shortcode (but not widget) and to wait for an mp3j_put tag. The flag tag can be anywhere and can be used more than once.</p></li>
78
+ <li><p>$set can be either 1 (set the flag) or 0 (unset the flag), and is 1 if not specified.</p></li>
79
+ </ul>
80
+
81
+ <p><br /></p>
82
+
83
+ <p><strong><code>mp3j_grab_library( $format )</code></strong></p>
84
+
85
+ <ul>
86
+ <li><p>returns an array of all the mp3's in the library with their 'filenames', 'urls', 'titles', 'excerpts', 'descriptions', and original ID (not attachment). Can be used anywhere.</p></li>
87
+ <li><p>$format can be either 1 (gives back the above fields in indexed arrays) or 0 (gives back the arrays as returned from the select query), defaults to 1.</p></li>
88
+
89
+ </ul>
90
+
91
+ <p><br /></p>
92
+
93
+ <p><strong><code>mp3j_set_meta( $tracks, $captions )</code></strong></p>
94
+
95
+ <ul>
96
+ <li><p>Sets a playlist for the mp3j_put tag to pick up. Can be used anywhere to create a playlist. The arrays you feed in go through the same sorting/filtering routine as if the tracks had been pulled from a page or post, and still respond to the admin settings like 'hide file extension' or 'play in alphabetical order'.</p></li>
97
+ <li><p>$tracks must be an indexed array of any mix of either filenames (from default folder or library) or full uri's, and can include a prefixed title using an '@' as a separator same as the fields do. As the admin settings are still applied, if 'always use library titles..' is ticked and it's a library 'filename' that you're using then any corresponding caption in the $captions array won't make it through, to get control of titles and captions for library files use their 'urls' in the $tracks array.</p></li>
98
+ <li><p>$captions is an optional array, the indexes should correspond to the indexes of their files in the $tracks array.</p></li>
99
+ </ul>
100
+
101
+ <p><br /></p>
102
+
103
+ <p><strong><code>mp3j_put( $mode, $position, $dload, $autoplay, $playlist )</code></strong></p>
104
+
105
+ <ul>
106
+ <li><p>Puts the player on the page (but only if mp3j_flag is set and what you're asking it to play results in some tracks!). Although only a single player can be added, the tag can be used multiple times. It must be within the &lt;body&gt;&lt;/body&gt; section of a page.</p></li>
107
+ <li><p>$mode can be: A post id to grab tracks from; 'first' to pick up the tracks from the first content encountered that had a playlist (see note below); 'feed' to pick up an alternative playlist created with mp3j_set_meta; or not set ('') to pick up tracks from any current id;</p></li>
108
+ <li><p>$pos can be 'left', 'right' for float; 'none', 'rel-C', 'rel-R' for relative position; or 'absolute'). Defaults to admin setting</p></li>
109
+ <li><p>$dload - show download button, 'true' or 'false'. defaults to admin setting.</p></li>
110
+
111
+ <li><p>$autoplay - 'true' or 'false'. defaults to admin setting.</p></li>
112
+ <li><p>$playlist - start with playlist showing, 'true' or 'false'. defaults to admin setting.</p></li>
113
+ <li><p>Note on 'first': Typically you'd use this on an index page when the player is in the sidebar (ie. when the put tag comes after the loop has run) and you want to play the most recent tracks post. If there is no first id to collect (when no posts have a playlist) the player would not be added, to set a backup use another put tag directly underneath the first with $mode set to some id you want to pick up tracks from, or set to 'feed' to pick up an alternative playlist you've created using mp3j_set_meta.</p></li>
114
+ <li><p>Another note on 'first': Because it actually waits for the content and has a look for tracks, it won't do anything if the put tag using 'first' is above the loop. To get header players to play the first post with tracks you either have to put the put-tag in a div after the loop and css absolute position it, or query the upcoming posts and use the id.</p></li>
115
+ </ul>
116
+
117
+ <p><br /></p>
118
+
119
+ <p><strong><code>mp3j_debug($info)</code></strong></p>
120
+
121
+ <ul>
122
+ <li><p>Prints some info and variables from the plugin to the browser's source view (CTRL+U or Page-&gt;view source) about what content and tags appeared on the page that just ran. Can be used more than once to get info at different points in page. Can be useful for debugging when customising templates.</p></li>
123
+
124
+ <li><p>$info can be 'vars' to see info only or 'all' to also see meta and library arrays (a potentially long list), defaults to vars.</p></li>
125
+ </ul>
126
+
127
+ <p><br /><br />
128
+ ALWAYS use function_exists() to make sure the tags are available before running them, eg:</p>
129
+
130
+ <pre><code>&lt;?php if ( function_exists(&#039;mp3j_addscripts&#039;) ) { mp3j_addscripts(&#039;styleD&#039;); } ?&gt;</code></pre>
131
+
132
+ <p>If you ever disable the plugin, running the tags in your theme without checking first will break your pages.
133
+ <br /></p>
134
+
135
+ <br /><br />
136
+
137
+ <hr /><br /><br />
138
+
139
+
140
+
141
+ </div>
142
+ </body></html>