MP3-jPlayer - Version 1.3.2

Version Description

  • 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"]
  • Tweaked transport button graphic a wee bit.
Download this release

Release Info

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

Code changes from version 1.3.1 to 1.3.2

css/images/Thumbs.db CHANGED
Binary file
css/images/{Copy of buttons2.png → buttons2.png} RENAMED
File without changes
css/images/{Copy of buttons2H.png → buttons2H.png} RENAMED
File without changes
css/mp3-jplayer-cyanALT.css CHANGED
@@ -135,20 +135,20 @@ div.jp-interface { position: relative;
135
  height:30px;
136
  border: 0px solid #b2b2b2; }
137
 
138
- a.jp-play { left: 229px; width:29px; height:31px; background: url("images/buttons.png") -110px 1px no-repeat; }
139
- a.jp-play:hover { background: url("images/buttonsH.png") -110px 1px no-repeat; }
140
 
141
- a.jp-pause { left: 229px; width:29px; height:31px; background: url("images/buttons.png") -2px 1px no-repeat; }
142
- a.jp-pause:hover { background: url("images/buttonsH.png") -2px 1px no-repeat; }
143
 
144
- a.jp-stop { left: 199px; width:28px; height:31px; background: url("images/buttons.png") -80px 1px no-repeat; }
145
- a.jp-stop:hover { background: url("images/buttonsH.png") -80px 1px no-repeat; }
146
 
147
- a.jp-previous { left:141px; width:22px; top:66px; background: url("images/buttons.png") -32px 0px no-repeat; }
148
- a.jp-previous:hover { background: url("images/buttonsH.png") -32px 0px no-repeat; }
149
 
150
- a.jp-next { left:165px; width:22px; top:66px; background: url("images/buttons.png") -55px 0px no-repeat; }
151
- a.jp-next:hover { background: url("images/buttonsH.png") -55px 0px no-repeat; }
152
 
153
 
154
  /* other buttons*/
@@ -231,24 +231,24 @@ div.jp-interface { position: relative;
231
  #sliderVolume .ui-widget-header { background: #ccc; /* 5d84dcb4a488 */ }
232
 
233
  #sliderVolume .ui-slider-handle {
234
- height: 10px;
235
- width: 9px;
236
  margin-left: -4px;
237
- top: -4px;
238
  border: 0px;
239
  -moz-border-radius: 2px;
240
  -webkit-border-radius: 2px;
241
- background: transparent url('images/pos-handle.gif') no-repeat -2px -2px; }
242
 
243
  #sliderVolume .ui-slider-handle:hover {
244
  border-color: #888;
245
  background: #606060;
246
- background: transparent url('images/pos-handleH.gif') no-repeat -2px -2px; }
247
 
248
  #sliderVolume .ui-state-active,
249
  #sliderVolume .ui-widget-content .ui-state-active {
250
  border: 0px solid #777;
251
- background: transparent url('images/pos-handleH.gif') no-repeat -2px -2px;
252
  outline: none; }
253
 
254
  #bars_holder { position:absolute;
135
  height:30px;
136
  border: 0px solid #b2b2b2; }
137
 
138
+ a.jp-play { left: 232px; width:29px; height:31px; background: url("images/buttons2.png") -110px 1px no-repeat; }
139
+ a.jp-play:hover { background: url("images/buttons2H.png") -110px 1px no-repeat; }
140
 
141
+ a.jp-pause { left: 232px; width:29px; height:31px; background: url("images/buttons2.png") -2px 1px no-repeat; }
142
+ a.jp-pause:hover { background: url("images/buttons2H.png") -2px 1px no-repeat; }
143
 
144
+ a.jp-stop { left: 202px; width:28px; height:31px; background: url("images/buttons2.png") -80px 1px no-repeat; }
145
+ a.jp-stop:hover { background: url("images/buttons2H.png") -80px 1px no-repeat; }
146
 
147
+ a.jp-previous { left:149px; width:22px; top:64px; background: url("images/buttons2.png") -32px 0px no-repeat; }
148
+ a.jp-previous:hover { background: url("images/buttons2H.png") -32px 0px no-repeat; }
149
 
150
+ a.jp-next { left:171px; width:22px; top:64px; background: url("images/buttons2.png") -55px 0px no-repeat; }
151
+ a.jp-next:hover { background: url("images/buttons2H.png") -55px 0px no-repeat; }
152
 
153
 
154
  /* other buttons*/
231
  #sliderVolume .ui-widget-header { background: #ccc; /* 5d84dcb4a488 */ }
232
 
233
  #sliderVolume .ui-slider-handle {
234
+ height: 11px;
235
+ width: 10px;
236
  margin-left: -4px;
237
+ top: -5px;
238
  border: 0px;
239
  -moz-border-radius: 2px;
240
  -webkit-border-radius: 2px;
241
+ background: transparent url('images/vol-handle2.gif') no-repeat -1px 0px; }
242
 
243
  #sliderVolume .ui-slider-handle:hover {
244
  border-color: #888;
245
  background: #606060;
246
+ background: transparent url('images/vol-handleH.gif') no-repeat -1px 0px; }
247
 
248
  #sliderVolume .ui-state-active,
249
  #sliderVolume .ui-widget-content .ui-state-active {
250
  border: 0px solid #777;
251
+ background: transparent url('images/vol-handleH.gif') no-repeat -1px 0px;
252
  outline: none; }
253
 
254
  #bars_holder { position:absolute;
css/mp3jplayer-blu.css CHANGED
@@ -143,20 +143,20 @@ div.jp-interface { position: relative;
143
  border: 0px solid #b2b2b2;
144
  cursor: default; }
145
 
146
- a.jp-play { left: 233px; background: url("images/buttons.png") -110px 1px no-repeat; }
147
- a.jp-play:hover { background: url("images/buttonsH.png") -110px 1px no-repeat; }
148
 
149
- a.jp-pause { left: 233px; background: url("images/buttons.png") -2px 1px no-repeat; }
150
- a.jp-pause:hover { background: url("images/buttonsH.png") -2px 1px no-repeat; }
151
 
152
- a.jp-stop { left: 203px; background: url("images/buttons.png") -80px 1px no-repeat; }
153
- a.jp-stop:hover { background: url("images/buttonsH.png") -80px 1px no-repeat; }
154
 
155
- a.jp-previous { left:151px; width:22px; top:57px; background: url("images/buttons.png") -32px 0px no-repeat; }
156
- a.jp-previous:hover { background: url("images/buttonsH.png") -32px 0px no-repeat; }
157
 
158
- a.jp-next { left:175px; width:22px; top:57px; background: url("images/buttons.png") -55px 0px no-repeat; }
159
- a.jp-next:hover { background: url("images/buttonsH.png") -55px 0px no-repeat; }
160
 
161
 
162
  /* other buttons*/
143
  border: 0px solid #b2b2b2;
144
  cursor: default; }
145
 
146
+ a.jp-play { left: 233px; background: url("images/buttons2.png") -110px 1px no-repeat; }
147
+ a.jp-play:hover { background: url("images/buttons2H.png") -110px 1px no-repeat; }
148
 
149
+ a.jp-pause { left: 233px; background: url("images/buttons2.png") -2px 1px no-repeat; }
150
+ a.jp-pause:hover { background: url("images/buttons2H.png") -2px 1px no-repeat; }
151
 
152
+ a.jp-stop { left: 203px; background: url("images/buttons2.png") -80px 1px no-repeat; }
153
+ a.jp-stop:hover { background: url("images/buttons2H.png") -80px 1px no-repeat; }
154
 
155
+ a.jp-previous { left:151px; width:22px; top:57px; background: url("images/buttons2.png") -32px 0px no-repeat; }
156
+ a.jp-previous:hover { background: url("images/buttons2H.png") -32px 0px no-repeat; }
157
 
158
+ a.jp-next { left:175px; width:22px; top:57px; background: url("images/buttons2.png") -55px 0px no-repeat; }
159
+ a.jp-next:hover { background: url("images/buttons2H.png") -55px 0px no-repeat; }
160
 
161
 
162
  /* other buttons*/
css/mp3jplayer-green.css CHANGED
@@ -140,20 +140,20 @@ div.jp-interface { position: relative;
140
  border: 0px solid #b2b2b2;
141
  cursor: default; }
142
 
143
- a.jp-play { left: 233px; background: url("images/buttons.png") -110px 1px no-repeat; }
144
- a.jp-play:hover { background: url("images/buttonsH.png") -110px 1px no-repeat; }
145
 
146
- a.jp-pause { left: 233px; background: url("images/buttons.png") -2px 1px no-repeat; }
147
- a.jp-pause:hover { background: url("images/buttonsH.png") -2px 1px no-repeat; }
148
 
149
- a.jp-stop { left: 203px; background: url("images/buttons.png") -80px 1px no-repeat; }
150
- a.jp-stop:hover { background: url("images/buttonsH.png") -80px 1px no-repeat; }
151
 
152
- a.jp-previous { left:151px; width:22px; top:57px; background: url("images/buttons.png") -32px 0px no-repeat; }
153
- a.jp-previous:hover { background: url("images/buttonsH.png") -32px 0px no-repeat; }
154
 
155
- a.jp-next { left:175px; width:22px; top:57px; background: url("images/buttons.png") -55px 0px no-repeat; }
156
- a.jp-next:hover { background: url("images/buttonsH.png") -55px 0px no-repeat; }
157
 
158
 
159
  /* other buttons*/
140
  border: 0px solid #b2b2b2;
141
  cursor: default; }
142
 
143
+ a.jp-play { left: 233px; background: url("images/buttons2.png") -110px 1px no-repeat; }
144
+ a.jp-play:hover { background: url("images/buttons2H.png") -110px 1px no-repeat; }
145
 
146
+ a.jp-pause { left: 233px; background: url("images/buttons2.png") -2px 1px no-repeat; }
147
+ a.jp-pause:hover { background: url("images/buttons2H.png") -2px 1px no-repeat; }
148
 
149
+ a.jp-stop { left: 203px; background: url("images/buttons2.png") -80px 1px no-repeat; }
150
+ a.jp-stop:hover { background: url("images/buttons2H.png") -80px 1px no-repeat; }
151
 
152
+ a.jp-previous { left:151px; width:22px; top:57px; background: url("images/buttons2.png") -32px 0px no-repeat; }
153
+ a.jp-previous:hover { background: url("images/buttons2H.png") -32px 0px no-repeat; }
154
 
155
+ a.jp-next { left:175px; width:22px; top:57px; background: url("images/buttons2.png") -55px 0px no-repeat; }
156
+ a.jp-next:hover { background: url("images/buttons2H.png") -55px 0px no-repeat; }
157
 
158
 
159
  /* other buttons*/
css/mp3jplayer-grey.css CHANGED
@@ -142,22 +142,22 @@ div.jp-interface { position: relative;
142
  border: 0px solid #b2b2b2;
143
  cursor: default; }
144
 
145
- a.jp-play { left: 233px; background: url("images/buttons.png") -110px 1px no-repeat; }
146
- a.jp-play:hover { background: url("images/buttonsH.png") -110px 1px no-repeat; }
147
 
148
- a.jp-pause { left: 233px; background: url("images/buttons.png") -2px 1px no-repeat; }
149
- a.jp-pause:hover { background: url("images/buttonsH.png") -2px 1px no-repeat; }
150
 
151
- a.jp-stop { left: 203px; background: url("images/buttons.png") -80px 1px no-repeat; }
152
- a.jp-stop:hover { background: url("images/buttonsH.png") -80px 1px no-repeat; }
153
 
154
- a.jp-previous { left:151px; width:22px; top:57px; background: url("images/buttons.png") -32px 0px no-repeat; }
155
- a.jp-previous:hover { background: url("images/buttonsH.png") -32px 0px no-repeat; }
156
 
157
- a.jp-next { left:175px; width:22px; top:57px; background: url("images/buttons.png") -55px 0px no-repeat; }
158
- a.jp-next:hover { background: url("images/buttonsH.png") -55px 0px no-repeat; }
159
-
160
 
 
161
  /* other buttons*/
162
  #playlist-toggle, #downloadmp3-button {
163
  position: absolute;
142
  border: 0px solid #b2b2b2;
143
  cursor: default; }
144
 
145
+ a.jp-play { left: 233px; background: url("images/buttons2.png") -110px 1px no-repeat; }
146
+ a.jp-play:hover { background: url("images/buttons2H.png") -110px 1px no-repeat; }
147
 
148
+ a.jp-pause { left: 233px; background: url("images/buttons2.png") -2px 1px no-repeat; }
149
+ a.jp-pause:hover { background: url("images/buttons2H.png") -2px 1px no-repeat; }
150
 
151
+ a.jp-stop { left: 203px; background: url("images/buttons2.png") -80px 1px no-repeat; }
152
+ a.jp-stop:hover { background: url("images/buttons2H.png") -80px 1px no-repeat; }
153
 
154
+ a.jp-previous { left:151px; width:22px; top:57px; background: url("images/buttons2.png") -32px 0px no-repeat; }
155
+ a.jp-previous:hover { background: url("images/buttons2H.png") -32px 0px no-repeat; }
156
 
157
+ a.jp-next { left:175px; width:22px; top:57px; background: url("images/buttons2.png") -55px 0px no-repeat; }
158
+ a.jp-next:hover { background: url("images/buttons2H.png") -55px 0px no-repeat; }
 
159
 
160
+
161
  /* other buttons*/
162
  #playlist-toggle, #downloadmp3-button {
163
  position: absolute;
js/mp3-jplayer.js CHANGED
@@ -1,7 +1,6 @@
1
  <!--
2
- // MP3-jPlayer for Wordpress - www.sjward.org
3
-
4
-
5
 
6
  var foxcurrentstate = "open";
7
  var togglediv = "playlist-wrap";
@@ -42,6 +41,8 @@ jQuery(document).ready(function(){
42
  pic6= new Image(12,13); pic6.src=foxpathtoimages+"pos-handle3H.gif";
43
  pic7= new Image(12,13); pic7.src=foxpathtoimages+"vol-handle2.gif";
44
  pic8= new Image(12,13); pic8.src=foxpathtoimages+"vol-handleH.gif";
 
 
45
  }
46
 
47
 
1
  <!--
2
+ // MP3-jPlayer 1.3.2
3
+ // www.sjward.org
 
4
 
5
  var foxcurrentstate = "open";
6
  var togglediv = "playlist-wrap";
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
 
mp3jplayer.php CHANGED
@@ -1,9 +1,9 @@
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.1
7
  Author: Simon Ward
8
  Author URI: http://www.sjward.org
9
  License: GPL2
@@ -31,6 +31,7 @@ if (!class_exists("mp3Fox"))
31
  {
32
  var $playerHasBeenSet = "false";
33
  var $customFieldsGrabbed = "false";
 
34
 
35
  var $adminOptionsName = "mp3FoxAdminOptions";
36
  var $theSettings = array();
@@ -68,7 +69,7 @@ if (!class_exists("mp3Fox"))
68
  *
69
  * The meta key match is done now (rather than in header) on each loop if the page is the posts index.
70
  *
71
- * @todo: move all key-matching (and array-building) to header once a fail-safe method of pulling the posts that
72
  * will be displayed when not in the loop is figured out).
73
  */
74
  function add_player($content='') {
@@ -76,6 +77,7 @@ if (!class_exists("mp3Fox"))
76
  if ($this->playerHasBeenSet == "true") {
77
  return $content;
78
  }
 
79
  if ( is_home() && $this->theSettings['player_onblog'] == "true" ) {
80
  if ( $this->grab_Custom_Meta() > 0 ) {
81
  $customvalues = $this->postMetaValues;
@@ -103,13 +105,43 @@ if (!class_exists("mp3Fox"))
103
 
104
  $this->write_startup_vars( $thePlayList['count'] );
105
  $this->write_playlist( $thePlayList );
106
- $theplayer = $this->write_player_html( $thePlayList['count'] );
 
 
 
 
 
 
 
107
  $content = $theplayer . $content . "<br clear=\"all\" />";
108
  $this->playerHasBeenSet = "true";
109
  return $content;
110
  }
111
 
112
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  /**
114
  * GETS RELEVANT META keys/values from the current page/post and
115
  * creates arrays with common indexes.
@@ -476,22 +508,22 @@ if (!class_exists("mp3Fox"))
476
  /**
477
  * WRITES PLAYER HTML
478
  */
479
- function write_player_html( $count ) {
480
 
481
- if ( $this->theSettings['player_float'] == "left" ) {
482
  $floater = "float: left; padding: 5px 50px 50px 0px;";
483
  }
484
- else if ( $this->theSettings['player_float'] == "right" ) {
485
  $floater = "float: right; padding: 5px 0px 50px 50px;";
486
  }
487
  else {
488
  $floater = "position: relative; padding: 5px 0px 50px 0px;";
489
  }
490
- if ( $this->theSettings['show_downloadmp3'] == "false" ) {
491
- $showMp3Link = "visibility: hidden;";
492
  }
493
  else {
494
- $showMp3Link = "visibility: visible;";
495
  }
496
  if ( $count < 2 ) {
497
  $showlistcontrols = "visibility: hidden;";
@@ -536,7 +568,7 @@ if (!class_exists("mp3Fox"))
536
 
537
  return $player;
538
  }
539
-
540
 
541
  /**
542
  * called when PLUGIN is ACTIVATED to create options if none exist.
@@ -700,7 +732,7 @@ if (!class_exists("mp3Fox"))
700
  <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">
701
 
702
  <h2>Mp3-jPlayer</h2>
703
- <p class="description" style="margin-top: -4px; margin-bottom: 18px;"><a href="#howto">How to make a playlist</a></p></h2>
704
 
705
  <p class="description" style="margin: 5px 120px 30px 0px;">Below are the global settings for Mp3-jPlayer. The player
706
  will automatically appear on any posts or pages that you have assigned mp3's to.</p>
@@ -766,9 +798,11 @@ if (!class_exists("mp3Fox"))
766
 
767
  <p>__________________________________________________________________________________</p>
768
  <a name="howto"></a>
769
- <p class="description" style="margin: 20px 120px 5px 10px;"><strong>How to assign an mp3</strong> from your Media Library or your default location:</p>
 
770
  <p class="description" style="margin: 10px 120px 5px 10px;">1. Go to a page/post edit screen and scroll down to the custom fields (below the content
771
- box)<br />2. Write <code>mp3</code> into the left hand box<br />3. Write the filename into the right hand box and hit update page</p>
 
772
 
773
  <p class="description" style="margin: 20px 120px 5px 10px;"><strong>Adding a title and caption:</strong></p>
774
  <p class="description" style="margin: 10px 120px 5px 10px;">1. Add a dot, then a caption in the left hand box like so: <code>mp3.Caption</code><br />2. Add the title, then an '@' before the filename like so: <code>Title@filename</code></p>
@@ -777,13 +811,19 @@ if (!class_exists("mp3Fox"))
777
  <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
778
  below any numbered tracks.</p>
779
 
 
 
 
 
 
 
780
  <p class="description" style="margin: 10px 120px 5px 10px;"><br />More help and examples are available from the <a href="http://sjward.org/jplayer-for-wordpress">plugin home page</a></p>
781
  <br /><br /><br /><br /><br />
782
  </div>
783
 
784
  <?php
785
  }
786
-
787
  } /* end class mp3Fox */
788
  }
789
 
@@ -805,14 +845,15 @@ if ( isset($mp3_fox) ) {
805
  }
806
  }
807
 
808
- /* action hooks */
809
  add_action('activate_mp3-jplayer/mp3jplayer.php', array(&$mp3_fox, 'initFox'));
810
  add_action('deactivate_mp3-jplayer/mp3jplayer.php', array(&$mp3_fox, 'uninitFox'));
811
  add_action('wp_head', array(&$mp3_fox, 'check_if_scripts_needed'), 1);
812
  add_action('admin_menu', 'mp3Fox_ap');
813
 
814
- /* filter hooks */
815
  add_filter('the_content', array(&$mp3_fox, 'add_player'));
816
 
 
 
817
  }
818
  ?>
1
  <?php
2
+ /* CURRENT
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.2
7
  Author: Simon Ward
8
  Author URI: http://www.sjward.org
9
  License: GPL2
31
  {
32
  var $playerHasBeenSet = "false";
33
  var $customFieldsGrabbed = "false";
34
+ var $countPlaylist = 0;
35
 
36
  var $adminOptionsName = "mp3FoxAdminOptions";
37
  var $theSettings = array();
69
  *
70
  * The meta key match is done now (rather than in header) on each loop if the page is the posts index.
71
  *
72
+ * @todo: move all key-matching (and array-building) to header once a fail-safe method of pulling the right posts/order that
73
  * will be displayed when not in the loop is figured out).
74
  */
75
  function add_player($content='') {
77
  if ($this->playerHasBeenSet == "true") {
78
  return $content;
79
  }
80
+
81
  if ( is_home() && $this->theSettings['player_onblog'] == "true" ) {
82
  if ( $this->grab_Custom_Meta() > 0 ) {
83
  $customvalues = $this->postMetaValues;
105
 
106
  $this->write_startup_vars( $thePlayList['count'] );
107
  $this->write_playlist( $thePlayList );
108
+
109
+ if ( strpos($content, "[mp3-jplayer") !== false ) {
110
+ $this->countPlaylist = $thePlayList['count'];
111
+ return $content;
112
+ }
113
+
114
+
115
+ $theplayer = $this->write_player_html( $thePlayList['count'], $this->theSettings['player_float'], $this->theSettings['show_downloadmp3'] );
116
  $content = $theplayer . $content . "<br clear=\"all\" />";
117
  $this->playerHasBeenSet = "true";
118
  return $content;
119
  }
120
 
121
 
122
+ /**
123
+ * SHORTCODE HANDLER function.
124
+ * The attributes overide the settings page values.
125
+ */
126
+ function shortcode_handler($atts, $content = null) {
127
+
128
+ if ($this->playerHasBeenSet == "true") {
129
+ return;
130
+ }
131
+ if ($this->customFieldsGrabbed == "false") {
132
+ return;
133
+ }
134
+
135
+ extract(shortcode_atts(array(
136
+ 'pos' => $this->theSettings['player_float'],
137
+ 'dload' => $this->theSettings['show_downloadmp3'],
138
+ ), $atts));
139
+ $theplayer = $this->write_player_html( $this->countPlaylist, $pos, $dload );
140
+ $this->playerHasBeenSet = "true";
141
+ return $theplayer;
142
+ }
143
+
144
+
145
  /**
146
  * GETS RELEVANT META keys/values from the current page/post and
147
  * creates arrays with common indexes.
508
  /**
509
  * WRITES PLAYER HTML
510
  */
511
+ function write_player_html( $count, $position, $download ) {
512
 
513
+ if ( $position == "left" ) {
514
  $floater = "float: left; padding: 5px 50px 50px 0px;";
515
  }
516
+ else if ( $position == "right" ) {
517
  $floater = "float: right; padding: 5px 0px 50px 50px;";
518
  }
519
  else {
520
  $floater = "position: relative; padding: 5px 0px 50px 0px;";
521
  }
522
+ if ( $download == "true" ) {
523
+ $showMp3Link = "visibility: visible;";
524
  }
525
  else {
526
+ $showMp3Link = "visibility: hidden;";
527
  }
528
  if ( $count < 2 ) {
529
  $showlistcontrols = "visibility: hidden;";
568
 
569
  return $player;
570
  }
571
+
572
 
573
  /**
574
  * called when PLUGIN is ACTIVATED to create options if none exist.
732
  <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">
733
 
734
  <h2>Mp3-jPlayer</h2>
735
+ <p class="description" style="margin-top: -4px; margin-bottom: 18px;"><a href="#howto">Player Help</a></p>
736
 
737
  <p class="description" style="margin: 5px 120px 30px 0px;">Below are the global settings for Mp3-jPlayer. The player
738
  will automatically appear on any posts or pages that you have assigned mp3's to.</p>
798
 
799
  <p>__________________________________________________________________________________</p>
800
  <a name="howto"></a>
801
+ <p class="description" style="margin: 20px 120px 5px 10px;"><strong>How to assign an mp3</strong></p>
802
+ <p class="description" style="margin: 10px 120px 5px 10px;">from your Media Library or default path/URI:</p>
803
  <p class="description" style="margin: 10px 120px 5px 10px;">1. Go to a page/post edit screen and scroll down to the custom fields (below the content
804
+ box)<br />2. Write <code>mp3</code> into the left hand box<br />3. Write the filename* into the right hand box and hit update page</p>
805
+ <p class="description" style="margin: 10px 120px 5px 10px;">* If the file is not in either the media library or your default location then use a full URI.</p>
806
 
807
  <p class="description" style="margin: 20px 120px 5px 10px;"><strong>Adding a title and caption:</strong></p>
808
  <p class="description" style="margin: 10px 120px 5px 10px;">1. Add a dot, then a caption in the left hand box like so: <code>mp3.Caption</code><br />2. Add the title, then an '@' before the filename like so: <code>Title@filename</code></p>
811
  <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
812
  below any numbered tracks.</p>
813
 
814
+ <p class="description" style="margin: 20px 120px 5px 10px;"><strong>Shortcode:</strong></p>
815
+ <p class="description" style="margin: 10px 120px 5px 10px;"><code>[mp3-jplayer]</code></p>
816
+ <p class="description" style="margin: 5px 120px 5px 10px;">Supports the following parameters for player float position and display of the download button:<br />pos - left, right, none<br />dload - true, false</p>
817
+ <p class="description" style="margin: 10px 120px 5px 10px;">eg. <code>[mp3-jplayer pos=&quot;right&quot; dload=&quot;true&quot;]</code></p>
818
+ <p class="description" style="margin: 5px 120px 5px 10px;">Shortcode parameters over-ride the settings on this page</p>
819
+
820
  <p class="description" style="margin: 10px 120px 5px 10px;"><br />More help and examples are available from the <a href="http://sjward.org/jplayer-for-wordpress">plugin home page</a></p>
821
  <br /><br /><br /><br /><br />
822
  </div>
823
 
824
  <?php
825
  }
826
+
827
  } /* end class mp3Fox */
828
  }
829
 
845
  }
846
  }
847
 
848
+ /* hooks */
849
  add_action('activate_mp3-jplayer/mp3jplayer.php', array(&$mp3_fox, 'initFox'));
850
  add_action('deactivate_mp3-jplayer/mp3jplayer.php', array(&$mp3_fox, 'uninitFox'));
851
  add_action('wp_head', array(&$mp3_fox, 'check_if_scripts_needed'), 1);
852
  add_action('admin_menu', 'mp3Fox_ap');
853
 
 
854
  add_filter('the_content', array(&$mp3_fox, 'add_player'));
855
 
856
+ add_shortcode('mp3-jplayer', array(&$mp3_fox, 'shortcode_handler'));
857
+
858
  }
859
  ?>
readme.txt CHANGED
@@ -2,10 +2,10 @@
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, mp3 player, music, jplayer, music player, audio player, playlist
6
  Requires at least: 2.8
7
  Tested up to: 3.0.1
8
- Stable tag: 1.3.1
9
 
10
  Auto adds an mp3 audio player to pages/posts that you make a playlist on.
11
 
@@ -13,7 +13,10 @@ Auto adds an mp3 audio player to pages/posts that you make a playlist on.
13
 
14
  == Description ==
15
 
16
- - Easy playing of mp3's from your wordpress library, a default folder, another domain
 
 
 
17
  - Use custom fields to make ordered playlists
18
  - Add titles and captions, use or overide media library titles and captions
19
  - No setup
@@ -25,6 +28,14 @@ The player has a loader bar and position/vol sliders, status info, hideable play
25
  [See a Demo here](http://sjward.org/jplayer-for-wordpress)
26
 
27
 
 
 
 
 
 
 
 
 
28
 
29
  **Making a Playlist**
30
 
@@ -91,6 +102,9 @@ To Install manually:
91
 
92
 
93
  == Changelog ==
 
 
 
94
 
95
  = 1.3.1 =
96
  * Fixed image rollover on buttons when wordpress not installed in root of site.
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
6
  Requires at least: 2.8
7
  Tested up to: 3.0.1
8
+ Stable tag: 1.3.2
9
 
10
  Auto adds an mp3 audio player to pages/posts that you make a playlist on.
11
 
13
 
14
  == Description ==
15
 
16
+ This version adds shortcode support
17
+
18
+ features:
19
+ - Easy playing of mp3's from your media library, a default folder, another domain
20
  - Use custom fields to make ordered playlists
21
  - Add titles and captions, use or overide media library titles and captions
22
  - No setup
28
  [See a Demo here](http://sjward.org/jplayer-for-wordpress)
29
 
30
 
31
+ **Shortcode**
32
+
33
+ Using the shortcode is optional, it lets you position the player within the content rather than at the top, and has 2 optional attributes for position and download control on each page. The shortcode is:
34
+ <code>[mp3-jplayer]</code>
35
+
36
+ It's optional attributes are 'pos' (with values of left, right, none), and 'dload' (true, false), eg:
37
+ <code>[mp3-jplayer pos="right" dload="true"]</code>
38
+
39
 
40
  **Making a Playlist**
41
 
102
 
103
 
104
  == Changelog ==
105
+ = 1.3.2 =
106
+ * 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"]
107
+ * Tweaked transport button graphic a wee bit.
108
 
109
  = 1.3.1 =
110
  * Fixed image rollover on buttons when wordpress not installed in root of site.
screenshot-1.png CHANGED
Binary file