PowerPress Podcasting plugin by Blubrry - Version 2.0

Version Description

  • Released on 3/7/2011
  • PowerPress now requires WordPress version 2.8 or newer.
  • HTML5 video player with Flow Player Classic fallback added
  • HTML5 audio player with Flow Player Classic fallback added
  • Embed Episode feature, embeds your audience can take with them (just like YouTube embeds)
  • WebM video support added
  • Ogg audio/video support improved
  • For mp4/m4v video, a new alternative WebM URL field has been added. This is ideal for supporting all browser based HTML5 video players.
  • Flow Player Classic can now play m4a audio and mp4/m4v video
  • Elimation of Simple Mode
  • Video default size is now 400 wide by 225 high (a 16:9 ratio)
  • New Video Player settings page added
  • Settings pages enhanced with new options such as location, frequency and T.V. options added
  • Episode Entry box enhanced with new 'isHD' option when video entered into Media URL box
  • Episode Entry box now includes option to configure video player width/height on a per-episode basis.
  • New RawVoice RSS namespace added
  • Player logic has been moved to powerpress-player.php, and a new option is available to disable player options completely. When player options disabled completely, the powerpress-player.php is not included in normal page loads.
  • PowerPress updated to be able to import episodes from latest versions of PodPress (change made in February, 2011 in PodPress how episodes are stored in WordPress).
  • New watarmarks added to Episode Entry Box for HH:MM:SS. Watermarks will be incorporated in additional fields in the future.
  • iTunes Update Directory feature (pingPodcast) is slated for removal in next release. Apple no longer supports this feature. Read more here: Apple Drops iTunes Podcast Directory Update Listing/Ping (pingPodcast) Function
  • Upload image option added to supplement the video poster image field. Images are uploaded to the built-in image gallery in WordPress.
  • Option added to include play icon over poster image where applicable (such as HTML5 Video)
  • Error message displayed if another plugin is including a different version of the getid3 library.
  • New Blubrry PowerPress and Community Podcast added to welcome tab and dashboard.
  • By default, media files with extension .ogg are treated as audio. Video ogg files should use the .ogv extension. If you wish to override this behavior, add the following define to your wp-config.php: define('POWERPRESS_OGG_VIDEO', true);
  • Added define option define('POWERPRESS_ENCLOSURE_FIX', true); that can be added to your wp-config.php to fix missing enclosures in feeds when using plugins such as WishList Member. (Thanks Patrick for helping us fix this issue)
  • Fixed bug with download and play in new window text not getting translated for non-english languages. (Thanks infusiastic for bringing to our attention).
Download this release

Release Info

Developer amandato
Plugin Icon 128x128 PowerPress Podcasting plugin by Blubrry
Version 2.0
Comparing to
See all releases

Code changes from version 1.0.13 to 2.0

3rdparty/jquery.watermark.min.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ /*
2
+ Watermark v3.1.1 (January 10, 2011) plugin for jQuery
3
+ http://jquery-watermark.googlecode.com/
4
+ Copyright (c) 2009-2011 Todd Northrop
5
+ http://www.speednet.biz/
6
+ Dual licensed under the MIT or GPL Version 2 licenses.
7
+ */
8
+ (function(b,j,y){var p="function",k="password",d="maxLength",g="type",a="",c=true,o="placeholder",e=false,w="watermark",l=w,i="watermarkClass",t="watermarkFocus",n="watermarkSubmit",r="watermarkMaxLength",h="watermarkPassword",f="watermarkText",m=/\r/g,v=":data("+l+")",q=":text,:password,:search,textarea",s=["Page_ClientValidate"],u=e,x=o in document.createElement("input");b.watermark=b.watermark||{version:"3.1.1",runOnce:c,options:{className:w,useNative:c,hideBeforeUnload:c},hide:function(a){b(a).filter(v).each(function(){b.watermark._hide(b(this))})},_hide:function(b,q){var o=b[0],p=(o.value||a).replace(m,a),l=b.data(f)||a,n=b.data(r)||0,k=b.data(i);if(l.length&&p==l){o.value=a;if(b.data(h))if((b.attr(g)||a)==="text"){var e=b.data(h)||[],c=b.parent()||[];if(e.length&&c.length){c[0].removeChild(b[0]);c[0].appendChild(e[0]);b=e}}if(n){b.attr(d,n);b.removeData(r)}if(q){b.attr("autocomplete","off");j.setTimeout(function(){b.select()},1)}}k&&b.removeClass(k)},show:function(a){b(a).filter(v).each(function(){b.watermark._show(b(this))})},_show:function(e){var p=e[0],v=(p.value||a).replace(m,a),j=e.data(f)||a,q=e.attr(g)||a,s=e.data(i);if((v.length==0||v==j)&&!e.data(t)){u=c;if(e.data(h))if(q===k){var o=e.data(h)||[],n=e.parent()||[];if(o.length&&n.length){n[0].removeChild(e[0]);n[0].appendChild(o[0]);e=o;e.attr(d,j.length);p=e[0]}}if(q==="text"||q==="search"){var l=e.attr(d)||0;if(l>0&&j.length>l){e.data(r,l);e.attr(d,j.length)}}s&&e.addClass(s);p.value=j}else b.watermark._hide(e)},hideAll:function(){if(u){b.watermark.hide(q);u=e}},showAll:function(){b.watermark.show(q)}};b.fn.watermark=b.fn.watermark||function(s,r){var u="string";if(!this.length)return this;var w=e,v=typeof s===u;if(v)s=s.replace(m,a);if(typeof r==="object"){w=typeof r.className===u;r=b.extend({},b.watermark.options,r)}else if(typeof r===u){w=c;r=b.extend({},b.watermark.options,{className:r})}else r=b.watermark.options;if(typeof r.useNative!==p)r.useNative=r.useNative?function(){return c}:function(){return e};return this.each(function(){var z="dragleave",y="dragenter",B=this,e=b(B);if(!e.is(q))return;if(e.data(l)){if(v||w){b.watermark._hide(e);v&&e.data(f,s);w&&e.data(i,r.className)}}else{if(x&&r.useNative.call(B,e)&&(e.attr("tagName")||a)!=="TEXTAREA"){v&&e.attr(o,s);return}e.data(f,v?s:a);e.data(i,r.className);e.data(l,1);if((e.attr(g)||a)===k){var C=e.wrap("<span>").parent(),p=b(C.html().replace(/type=["']?password["']?/i,'type="text"'));p.data(f,e.data(f));p.data(i,e.data(i));p.data(l,1);p.attr(d,s.length);p.focus(function(){b.watermark._hide(p,c)}).bind(y,function(){b.watermark._hide(p)}).bind("dragend",function(){j.setTimeout(function(){p.blur()},1)});e.blur(function(){b.watermark._show(e)}).bind(z,function(){b.watermark._show(e)});p.data(h,e);e.data(h,p)}else e.focus(function(){e.data(t,1);b.watermark._hide(e,c)}).blur(function(){e.data(t,0);b.watermark._show(e)}).bind(y,function(){b.watermark._hide(e)}).bind(z,function(){b.watermark._show(e)}).bind("dragend",function(){j.setTimeout(function(){b.watermark._show(e)},1)}).bind("drop",function(d){var c=e[0],b=d.originalEvent.dataTransfer.getData("Text");if((c.value||a).replace(m,a).replace(b,a)===e.data(f))c.value=b;e.focus()});if(B.form){var u=B.form,A=b(u);if(!A.data(n)){A.submit(b.watermark.hideAll);if(u.submit){A.data(n,u.submit);u.submit=function(c,a){return function(){var d=a.data(n);b.watermark.hideAll();if(d.apply)d.apply(c,Array.prototype.slice.call(arguments));else d()}}(u,A)}else{A.data(n,1);u.submit=function(a){return function(){b.watermark.hideAll();delete a.submit;a.submit()}}(u)}}}}b.watermark._show(e)})};if(b.watermark.runOnce){b.watermark.runOnce=e;b.extend(b.expr[":"],{search:function(b){return"search"===(b.type||a)},data:function(c,d,a){return!!b.data(c,a[3])}});(function(c){b.fn.val=function(){var d=this;if(!d.length)return arguments.length?d:y;if(!arguments.length)if(d.data(l)){var e=(d[0].value||a).replace(m,a);return e===(d.data(f)||a)?a:e}else return c.apply(d,arguments);else{c.apply(d,arguments);b.watermark.show(d);return d}}})(b.fn.val);s.length&&b(function(){for(var a,c,d=s.length-1;d>=0;d--){a=s[d];c=j[a];if(typeof c===p)j[a]=function(a){return function(){b.watermark.hideAll();return a.apply(null,Array.prototype.slice.call(arguments))}}(c)}});b(j).bind("beforeunload",function(){b.watermark.options.hideBeforeUnload&&b.watermark.hideAll()})}})(jQuery,window);
audio-player.swf CHANGED
Binary file
black.png ADDED
Binary file
css/admin.css CHANGED
@@ -19,7 +19,7 @@
19
  font-weight: bold;
20
  }
21
  #powerpress_settings {
22
- background-image:url(http://images.blubrry.com/powerpress/blubrry_logo.png);
23
  background-repeat: no-repeat;
24
  background-position: bottom right;
25
  }
@@ -130,3 +130,54 @@ padding-bottom: 15px;
130
  margin-top: 0;
131
  margin-bottom: 0;
132
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  font-weight: bold;
20
  }
21
  #powerpress_settings {
22
+ background-image:url(http://images.blubrry.com/powerpress/blubrry_logo2.png);
23
  background-repeat: no-repeat;
24
  background-position: bottom right;
25
  }
130
  margin-top: 0;
131
  margin-bottom: 0;
132
  }
133
+
134
+ .powerpress-welcome-news {
135
+ margin: 10px 0 0 0;
136
+ float: left;
137
+ width: 60%;
138
+ border-right: 1px solid #CCCCCC;
139
+ }
140
+ .powerpress-welcome-news > div {
141
+ margin: 0 10px 0 0;
142
+ }
143
+ .powerpress-welcome-news a {
144
+ text-decoration: none;
145
+ }
146
+ .powerpress-welcome-news .rsswidget {
147
+ font-size: 110%;
148
+ font-weight: bold;
149
+ }
150
+ .powerpress-welcome-news .rss-date {
151
+ font-size: 80%;
152
+ margin-left: 10px;
153
+ }
154
+ .powerpress-welcome-news .rssSummary {
155
+ font-size: 95%;
156
+ }
157
+ .powerpress-welcome-news .powerpressNewsPlayer {
158
+ margin-top: 5px;
159
+ }
160
+ .powerpress-welcome-highlighted {
161
+ margin: 10px 0 0 0;
162
+ float: left;
163
+ width: 39%;
164
+ }
165
+ .powerpress-welcome-highlighted > div {
166
+ margin: 0 0 0 10px;
167
+ }
168
+ .powerpress-welcome-highlighted a {
169
+ text-decoration: none;
170
+ }
171
+ .powerpress-welcome-highlighted .rsswidget {
172
+ font-size: 115%;
173
+ font-weight: bold;
174
+ }
175
+ .powerpress-welcome-highlighted .rssSummary {
176
+ font-size: 95%;
177
+ }
178
+ .powerpress-welcome-news ul li, .powerpress-welcome-highlighted ul li {
179
+ margin: 15px 0 10px 0;
180
+ }
181
+ .powerpress-welcome-news h2, .powerpress-welcome-highlighted h2 {
182
+ padding: 0;
183
+ }
images/itunes_modern.png ADDED
Binary file
images/zune.png ADDED
Binary file
mp3info.class.php CHANGED
@@ -478,6 +478,36 @@
478
  $LocalFile = $File;
479
  }
480
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
481
  if( !is_file($LocalFile) )
482
  {
483
  $this->SetError( __('Error occurred downloading media file.', 'powerpress') );
@@ -502,6 +532,8 @@
502
  // Hack so this works in Windows, helper apps are not necessary for what we're doing anyway
503
  define('GETID3_HELPERAPPSDIR', true);
504
  require_once(POWERPRESS_ABSPATH.'/getid3/getid3.php');
 
 
505
  $getID3 = new getID3;
506
  $FileInfo = $getID3->analyze( $LocalFile, $this->m_ContentLength );
507
  if( $DeleteFile )
478
  $LocalFile = $File;
479
  }
480
 
481
+ if( class_exists('getID3') && !defined('POWERPRESS_GETID3_LOADED') )
482
+ {
483
+ $pre_msg = __('PowerPress is unable to detect media information.', 'powerpress') .'<br />';
484
+ $getID3 = new getID3;
485
+ if( defined('GETID3_INCLUDEPATH') ) {
486
+ $plugin_title = '';
487
+ $plugins_path = dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR;
488
+ $path = substr(GETID3_INCLUDEPATH, strlen($plugins_path));
489
+ if( preg_match('/^([^\\/\\\\]*)/i', $path, $matches) )
490
+ {
491
+ $plugin_folder = $matches[1];
492
+ $current_plugins = get_option('active_plugins');
493
+ while( list($null,$plugin_local_path) = each($current_plugins) )
494
+ {
495
+ if( substr($plugin_local_path, 0, strpos($plugin_local_path, '/') ) != $plugin_folder )
496
+ continue;
497
+ $plugin_data = get_plugin_data( rtrim(WP_PLUGIN_DIR, '/\\'). '/'. rtrim($plugin_local_path, '\\/'), false, false ); //Do not apply markup/translate as it'll be cached.
498
+ $plugin_title = $plugin_data['Title'];
499
+ }
500
+ }
501
+ if( $plugin_title )
502
+ $this->SetError( $pre_msg. sprintf(__('Plugin \'%s\' has included a different version of the GetID3 library located in %s', 'powerpress'), $plugin_title, $path) );
503
+ else
504
+ $this->SetError( $pre_msg. sprintf(__('Another plugin has included a different version of the GetID3 library located in %s', 'powerpress'), $path) );
505
+ } else {
506
+ $this->SetError( $pre_msg. __('Another plugin has included a different version of the GetID3 library.', 'powerpress') );
507
+ }
508
+ return false;
509
+ }
510
+
511
  if( !is_file($LocalFile) )
512
  {
513
  $this->SetError( __('Error occurred downloading media file.', 'powerpress') );
532
  // Hack so this works in Windows, helper apps are not necessary for what we're doing anyway
533
  define('GETID3_HELPERAPPSDIR', true);
534
  require_once(POWERPRESS_ABSPATH.'/getid3/getid3.php');
535
+ define('POWERPRESS_GETID3_LOADED', true);
536
+
537
  $getID3 = new getID3;
538
  $FileInfo = $getID3->analyze( $LocalFile, $this->m_ContentLength );
539
  if( $DeleteFile )
play_audio.png ADDED
Binary file
play_default.jpg DELETED
Binary file
play_video.png ADDED
Binary file
play_video_default.jpg CHANGED
Binary file
player.js CHANGED
@@ -8,6 +8,7 @@
8
  * Released under Aoache 2 license:
9
  * http://www.apache.org/licenses/LICENSE-2.0
10
  *
 
11
  * versoin 1.2.0 - 07/20/2009 - Major rewrite, we're now replying less upon this javascript to make way for flexibility for adding future players.
12
  * versoin 1.1.3 - 03/23/2009 - Added code to support FlowPlayer v3.
13
  * versoin 1.1.2 - 03/04/2009 - Added options to set the width for audio, width and height for video.
@@ -35,6 +36,8 @@ function powerpress_embed_quicktime(div,media_url,width,height,scale)
35
  var contentType = 'video/mpeg'; // Default content type
36
  if( media_url.indexOf('.m4v') > -1 )
37
  contentType = 'video/x-m4v';
 
 
38
  else if( media_url.indexOf('.m4a') > -1 )
39
  contentType = 'audio/x-m4a';
40
  else if( media_url.indexOf('.avi') > -1 )
@@ -45,6 +48,8 @@ function powerpress_embed_quicktime(div,media_url,width,height,scale)
45
  contentType = 'video/quicktime';
46
 
47
  var Html = '';
 
 
48
  Html += '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="'+ width +'" height="'+ height +'" codebase="http://www.apple.com/qtactivex/qtplugin.cab">\n';
49
  Html += ' <param name="src" value="'+ media_url +'" />\n';
50
  Html += ' <param name="href" value="'+ media_url +'" />\n';
@@ -54,6 +59,8 @@ function powerpress_embed_quicktime(div,media_url,width,height,scale)
54
  Html += ' <param name="pluginspage" value="http://www.apple.com/quicktime/download/" />\n';
55
  Html += ' <embed type="'+ contentType +'" src="'+ media_url +'" width="'+ width +'" height="'+ height +'" scale="'+ scale +'" correction="full" cache="true" autoplay="true" controller="true" pluginspage="http://www.apple.com/quicktime/download/"></embed>';
56
  Html += '</object>\n';
 
 
57
  document.getElementById(div).innerHTML = Html;
58
  return false; // stop the default link from proceeding
59
  }
@@ -61,6 +68,168 @@ function powerpress_embed_quicktime(div,media_url,width,height,scale)
61
  return true; // let the default link to the media open...
62
  }
63
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  /**
65
  Insert embed for windows media within specified div
66
 
8
  * Released under Aoache 2 license:
9
  * http://www.apache.org/licenses/LICENSE-2.0
10
  *
11
+ * versoin 1.3.0 02/18/2011 - Adding HTML5 audio/video tags if format possibly supported around default video embed.
12
  * versoin 1.2.0 - 07/20/2009 - Major rewrite, we're now replying less upon this javascript to make way for flexibility for adding future players.
13
  * versoin 1.1.3 - 03/23/2009 - Added code to support FlowPlayer v3.
14
  * versoin 1.1.2 - 03/04/2009 - Added options to set the width for audio, width and height for video.
36
  var contentType = 'video/mpeg'; // Default content type
37
  if( media_url.indexOf('.m4v') > -1 )
38
  contentType = 'video/x-m4v';
39
+ if( media_url.indexOf('.mp4') > -1 )
40
+ contentType = 'video/mp4';
41
  else if( media_url.indexOf('.m4a') > -1 )
42
  contentType = 'audio/x-m4a';
43
  else if( media_url.indexOf('.avi') > -1 )
48
  contentType = 'video/quicktime';
49
 
50
  var Html = '';
51
+ if( contentType == 'video/mp4' || contentType == 'video/x-m4v' )
52
+ Html += '<video src="'+ media_url +'" width="'+ width +'" height="'+ height +'" controls autoplay>';
53
  Html += '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="'+ width +'" height="'+ height +'" codebase="http://www.apple.com/qtactivex/qtplugin.cab">\n';
54
  Html += ' <param name="src" value="'+ media_url +'" />\n';
55
  Html += ' <param name="href" value="'+ media_url +'" />\n';
59
  Html += ' <param name="pluginspage" value="http://www.apple.com/quicktime/download/" />\n';
60
  Html += ' <embed type="'+ contentType +'" src="'+ media_url +'" width="'+ width +'" height="'+ height +'" scale="'+ scale +'" correction="full" cache="true" autoplay="true" controller="true" pluginspage="http://www.apple.com/quicktime/download/"></embed>';
61
  Html += '</object>\n';
62
+ if( contentType == 'video/mp4' || contentType == 'video/x-m4v' )
63
+ Html += '</video>';
64
  document.getElementById(div).innerHTML = Html;
65
  return false; // stop the default link from proceeding
66
  }
68
  return true; // let the default link to the media open...
69
  }
70
 
71
+ function powerpress_show_embed(id)
72
+ {
73
+ if( document.getElementById('powerpress_embed_'+id) ) {
74
+ document.getElementById('powerpress_embed_'+id).style.display = 'block';
75
+ document.getElementById('powerpress_embed_'+id +'_t').select();
76
+ }
77
+ return false;
78
+ }
79
+
80
+ function powerpress_embed_html5iframe(id, url, width, height)
81
+ {
82
+ if( document.getElementById('powerpress_player_'+id) ) {
83
+ var Html = '';
84
+ Html += '<iframe';
85
+ Html += ' class="powerpress-player-embed"';
86
+ Html += ' width="' + width +'"';
87
+ Html += ' height="'+ height +'"';
88
+ Html += ' src="'+ url +'"';
89
+ Html += ' frameborder="0"';
90
+ Html += '></iframe>';
91
+ document.getElementById('powerpress_player_'+id).innerHTML = Html;
92
+ return false;
93
+ }
94
+ return true;
95
+ }
96
+
97
+ /**
98
+ Insert embed for H.264 mp4 video, with fallback to WebM
99
+
100
+ @div - specific div to insert embed into
101
+ @media_url - URL of media file to play
102
+ @width - width of player
103
+ @height - height of player
104
+ @webm_media_url - Alternative WebM media URL
105
+ */
106
+ function powerpress_embed_html5v(id,media_url,width,height,webm_media_url)
107
+ {
108
+ if( document.getElementById('powerpress_player_'+id) )
109
+ {
110
+ var poster = '';
111
+ if( document.getElementById('powerpress_player_'+id).getElementsByTagName ) {
112
+ var images = document.getElementById('powerpress_player_'+id).getElementsByTagName('img');
113
+ if( images.length && images[0].src )
114
+ poster = images[0].src;
115
+ }
116
+
117
+ var contentType = 'video/mp4'; // Default content type
118
+ if( media_url.indexOf('.webm') > -1 )
119
+ contentType = 'video/webm';
120
+ if( media_url.indexOf('.ogg') > -1 || media_url.indexOf('.ogv') > -1 )
121
+ contentType = 'video/ogg';
122
+
123
+ var v = document.createElement("video");
124
+ var html5 = false;
125
+ if( !!v.canPlayType ) {
126
+ var status = v.canPlayType(contentType);
127
+ if( status == 'probably' || status == 'maybe' ) {
128
+ html5 = true;
129
+ }
130
+ else if( webm_media_url )
131
+ {
132
+ status = v.canPlayType('video/webm');
133
+ if( status == 'probably' || status == 'maybe' ) {
134
+ html5 = true;
135
+ }
136
+ }
137
+ }
138
+
139
+ if( html5 ) {
140
+ var s = document.createElement('source');
141
+ v.width = width; v.height = height; v.controls = true;
142
+ if( poster ) v.poster = poster;
143
+ s.src = media_url; s.type = contentType;
144
+ v.appendChild(s);
145
+ if( webm_media_url ) {
146
+ var s_webm = document.createElement('source');
147
+ s_webm.src = webm_media_url; s_webm.type = 'video/webm; codecs="vp8, vorbis"';
148
+ v.appendChild(s_webm);
149
+ }
150
+
151
+ document.getElementById('powerpress_player_'+id).innerHTML = '';
152
+ document.getElementById('powerpress_player_'+id).appendChild(v);
153
+ v.play();
154
+ } else {
155
+ delete(v);
156
+ pp_flashembed(
157
+ 'powerpress_player_'+id,
158
+ {src: powerpress_url +'FlowPlayerClassic.swf', width: width, height: height, wmode: 'transparent' },
159
+ {config: { autoPlay: true, autoBuffering: true, initialScale: 'scale', showFullScreenButton: false, showMenu: false, videoFile: media_url, loop: false, autoRewind: true, splashImageFile: poster } }
160
+ );
161
+ }
162
+
163
+ if( window.powerpress_resize_player )
164
+ powerpress_resize_player();
165
+
166
+ return false; // stop the default link from proceeding
167
+ }
168
+
169
+ return true; // let the default link to the media open...
170
+ }
171
+
172
+ /**
173
+ Insert embed for audio, with fallback to flash (m4a/mp3/ogg)
174
+
175
+ @div - specific div to insert embed into
176
+ @media_url - URL of media file to play
177
+ @width - width of player
178
+ @height - height of player
179
+ @webm_media_url - Alternative WebM media URL
180
+ */
181
+ function powerpress_embed_html5a(id,media_url)
182
+ {
183
+ if( document.getElementById('powerpress_player_'+id) )
184
+ {
185
+ var poster = '';
186
+ if( document.getElementById('powerpress_player_'+id).getElementsByTagName ) {
187
+ var images = document.getElementById('powerpress_player_'+id).getElementsByTagName('img');
188
+ if( images.length && images[0].src )
189
+ poster = images[0].src;
190
+ }
191
+
192
+ var contentType = 'audio/mpeg'; // Default content type
193
+ if( media_url.indexOf('.m4a') > -1 )
194
+ contentType = 'audio/x-m4a';
195
+ if( media_url.indexOf('.ogg') > -1 || media_url.indexOf('.oga') > -1 )
196
+ contentType = 'audio/ogg';
197
+
198
+ var a = document.createElement("audio");
199
+ var html5 = false;
200
+ if( !!a.canPlayType ) {
201
+ var status = a.canPlayType(contentType);
202
+ if( status == 'probably' || status == 'maybe' ) {
203
+ html5 = true;
204
+ }
205
+ }
206
+
207
+ if( html5 ) {
208
+ var s = document.createElement('source');
209
+ a.controls = true;
210
+ s.src = media_url; s.type = contentType;
211
+ a.appendChild(s);
212
+
213
+ document.getElementById('powerpress_player_'+id).innerHTML = '';
214
+ document.getElementById('powerpress_player_'+id).appendChild(a);
215
+ a.play();
216
+ } else {
217
+ delete(a);
218
+ if( contentType != 'audio/ogg') {
219
+ pp_flashembed(
220
+ 'powerpress_player_'+id,
221
+ {src: powerpress_url +'FlowPlayerClassic.swf', width: 320, height: 24, wmode: 'transparent' },
222
+ {config: { autoPlay: true, autoBuffering: true, initialScale: 'scale', showFullScreenButton: false, showMenu: false, videoFile: media_url, loop: false, autoRewind: true } }
223
+ );
224
+ } else { return true; }
225
+ }
226
+
227
+ return false; // stop the default link from proceeding
228
+ }
229
+
230
+ return true; // let the default link to the media open...
231
+ }
232
+
233
  /**
234
  Insert embed for windows media within specified div
235
 
powerpress-player.php CHANGED
@@ -3,309 +3,1779 @@
3
  PowerPress player options
4
  */
5
 
6
- // Let PowerPress know that the powerpress_player filter event will be handeled
7
- if( !defined('POWERPRESS_PLAYER') )
8
- define('POWERPRESS_PLAYER', true);
9
 
10
- if( !defined('PHP_EOL') )
11
- define('PHP_EOL', "\n"); // We need this variable defined for new lines.
 
 
 
 
 
 
12
 
13
- function powerpressplayer_get_root_url()
14
  {
15
- return WP_PLUGIN_URL . '/'. basename( POWERPRESS_ABSPATH ) .'/';
 
 
 
 
 
 
 
 
 
16
  }
17
 
18
- function powerpressplayer_filter($content, $media_url, $ExtraData = array())
 
 
 
19
  {
20
- $Settings = get_option('powerpress_general');
21
- if( !empty($Settings['display_player_disable_mobile']) && powerpress_is_mobile_client() )
22
- return $content; // lets not add a player for this situation
 
 
 
 
 
 
 
 
23
 
24
- // Check if we are using a custom flash player...
25
- if( !isset($Settings['player']) || $Settings['player'] == 'default' ) // Either the default player is selected or the user never selected a player
26
- return $content;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
- // Next check that we're working with an mp3
29
- $parts = pathinfo($media_url);
30
- if( strtolower($parts['extension']) != 'mp3' )
31
- return $content; // We're apparently not working with an mp3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
- $player_content = powerpressplayer_build( $media_url, $Settings, $ExtraData );
34
- return $content . $player_content;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  }
36
 
37
- function powerpressplayer_build($media_url, $Settings, $ExtraData = array())
 
38
  {
39
- global $g_powerpress_player_id; // Use the global unique player id variable for the surrounding div
 
 
 
 
 
 
 
 
40
  if( !isset($g_powerpress_player_id) )
41
  $g_powerpress_player_id = rand(0, 10000);
42
- $g_powerpress_player_id++; // increment the player id for the next div so it is unique
43
- $content = '';
44
- $autoplay = false;
 
 
45
  if( isset($ExtraData['autoplay']) && $ExtraData['autoplay'] )
46
- $autoplay = true; // TODO: We need to handle this
 
 
 
47
 
48
- switch( $Settings['player'] )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  {
50
- case 'audio-player': {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
- $PlayerSettings = get_option('powerpress_audio-player');
53
-
54
- if($PlayerSettings == ""):
55
- $PlayerSettings = array(
56
- 'width'=>'290',
57
- 'transparentpagebg' => 'yes',
58
- 'lefticon' => '#333333',
59
- 'leftbg' => '#CCCCCC',
60
- 'bg' => '#E5E5E5',
61
- 'voltrack' => '#F2F2F2',
62
- 'volslider' => '#666666',
63
- 'rightbg' => '#B4B4B4',
64
- 'rightbghover' => '#999999',
65
- 'righticon' => '#333333',
66
- 'righticonhover' => '#FFFFFF',
67
- 'loader' => '#009900',
68
- 'track' => '#FFFFFF',
69
- 'tracker' => '#DDDDDD',
70
- 'border' => '#CCCCCC',
71
- 'skip' => '#666666',
72
- 'text' => '#333333',
73
- 'pagebg' => '',
74
- 'noinfo'=>'yes',
75
- 'rtl' => 'no'
76
- );
77
- endif;
78
-
79
- //$PlayerSettings['noinfo'] = 'yes';
80
- if( $PlayerSettings['titles'] == '' )
81
- $PlayerSettings['titles'] = 'Blubrry PowerPress';
82
- else if( strtoupper($PlayerSettings['titles']) == __('TRACK', 'powerpress') )
83
- unset( $PlayerSettings['titles'] );
84
-
85
- $keys = array_keys($PlayerSettings);
86
- $flashvars ='';
87
- foreach ($keys as $key) {
88
- if($PlayerSettings[$key] != "") {
89
- $flashvars .= '&amp;'. $key .'='. preg_replace('/\#/','',$PlayerSettings[$key]);
90
- }
91
- }
92
-
93
- if( $autoplay )
94
- {
95
- $flashvars .= '&amp;autostart=yes';
96
- }
97
-
98
- if( !isset($PlayerSettings['width']) )
99
- $PlayerSettings['width'] = 290;
100
-
101
- if($PlayerSettings['pagebg'] != ""){
102
- $transparency = '<param name="bgcolor" value="'.$PlayerSettings['pagebg'].'" />';
103
- $PlayerSettings['transparentpagebg'] = "no";
104
- $flashvars .= '&amp;transparentpagebg=no';
105
- $flashvars .= '&amp;pagebg='.$PlayerSettings['pagebg'];
106
- }
107
- else {
108
- $PlayerSettings['transparentpagebg'] = "yes";
109
- $transparency = '<param name="wmode" value="transparent" />';
110
- $flashvars .= '&amp;transparentpagebg=yes';
111
- }
112
- // TODO: Add audio-player player here
113
  $content .= '<div class="powerpress_player" id="powerpress_player_'. $g_powerpress_player_id .'">';
114
- //$content .= '<script language="JavaScript" src="'.powerpressplayer_get_root_url().'audio-player.js"></script>'.PHP_EOL;
115
- $content .= '<object type="application/x-shockwave-flash" data="'.powerpressplayer_get_root_url().'audio-player.swf" id="'.$g_powerpress_player_id.'" height="24" width="'. $PlayerSettings['width'] .'">'.PHP_EOL;
116
- $content .= '<param name="movie" value="'.powerpressplayer_get_root_url().'audio-player.swf" />'.PHP_EOL;
117
- $content .= '<param name="FlashVars" value="playerID='.$g_powerpress_player_id.'&amp;soundFile='.urlencode($media_url).$flashvars.'" />'.PHP_EOL;
118
- $content .= '<param name="quality" value="high" />'.PHP_EOL;
119
- $content .= '<param name="menu" value="false" />'.PHP_EOL;
120
- $content .= '<param name="wmode" value="transparent" />'.PHP_EOL;
121
- $content .= '</object>'.PHP_EOL;
122
- $content .= '</div>'.PHP_EOL;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
 
124
  }; break;
125
- case 'flashmp3-maxi': {
126
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  $PlayerSettings = get_option('powerpress_flashmp3-maxi');
128
- $keys = array('bgcolor1','bgcolor2','bgcolor','textcolor','buttoncolor','buttonovercolor','showstop','showinfo','showvolume','height','width','showloading','buttonwidth','volume','showslider');
129
-
130
- //set PlayerSettings as blank array for initial setup
131
- //This keeps the foreach loop from returning an error
132
- if($PlayerSettings == ""){
133
- $PlayerSettings = array(
134
- 'bgcolor1'=>'#7c7c7c',
135
- 'bgcolor2'=>'#333333',
136
- 'textcolor' => '#FFFFFF',
137
- 'buttoncolor' => '#FFFFFF',
138
- 'buttonovercolor' => '#FFFF00',
139
- 'showstop' => '0',
140
- 'showinfo' => '0',
141
- 'showvolume' => '1',
142
- 'height' => '20',
143
- 'width' => '200',
144
- 'showloading' => 'autohide',
145
- 'buttonwidth' => '26',
146
- 'volume' => '100',
147
- 'showslider' => '1',
148
- 'slidercolor1'=>'#cccccc',
149
- 'slidercolor2'=>'#888888',
150
- 'sliderheight' => '10',
151
- 'sliderwidth' => '20',
152
- 'loadingcolor' => '#FFFF00',
153
- 'volumeheight' => '6',
154
- 'volumewidth' => '30',
155
- 'sliderovercolor' => '#eeee00'
156
- );
157
- }
158
-
159
- $flashvars = '';
160
- $flashvars .= "mp3=" . urlencode($media_url);
161
- if( $autoplay )
162
- $flashvars .= '&amp;autoplay=1';
163
-
164
- //set non-blank options without dependencies as flash variables for preview
165
- foreach($keys as $key) {
166
- if($PlayerSettings[$key] != "") {
167
- $flashvars .= '&amp;'. $key .'='. preg_replace('/\#/','',$PlayerSettings[''.$key.'']);
168
- }
169
- }
170
- //set slider dependencies
171
- if($PlayerSettings['showslider'] != "0") {
172
- if($PlayerSettings['sliderheight'] != "") {
173
- $flashvars .= '&amp;sliderheight='. $PlayerSettings['sliderheight'];
174
- }
175
- if($PlayerSettings['sliderwidth'] != "") {
176
- $flashvars .= '&amp;sliderwidth='. $PlayerSettings['sliderwidth'];
177
- }
178
- if($PlayerSettings['sliderovercolor'] != ""){
179
- $flashvars .= '&amp;sliderovercolor='. preg_replace('/\#/','',$PlayerSettings['sliderovercolor']);
180
- }
181
- }
182
- //set volume dependencies
183
- if($PlayerSettings['showvolume'] != "0") {
184
- if($PlayerSettings['volumeheight'] != "") {
185
- $flashvars .= '&amp;volumeheight='. $PlayerSettings['volumeheight'];
186
- }
187
- if($PlayerSettings['volumewidth'] != "") {
188
- $flashvars .= '&amp;volumewidth='. $PlayerSettings['volumewidth'];
189
- }
190
- }
191
- //set autoload dependencies
192
- if($PlayerSettings['showloading'] != "never") {
193
- if($PlayerSettings['loadingcolor'] != "") {
194
- $flashvars .= '&amp;loadingcolor='. preg_replace('/\#/','',$PlayerSettings['loadingcolor']);
195
- }
196
- }
197
-
198
-
199
- //set default width for object
200
- if($PlayerSettings['width'] == ""){
201
- $width = "200";
202
- }else{
203
- $width = $PlayerSettings['width'];
204
- }
205
- if($PlayerSettings['height'] == ""){
206
- $height = "20";
207
- }else{
208
- $height = $PlayerSettings['height'];
209
- }
210
-
211
- //set background transparency
212
- if($PlayerSettings['bgcolor'] != ""){
213
- $transparency = '<param name="bgcolor" value="'. $color7 .'" />';
214
- }else{
215
- $transparency = '<param name="wmode" value="transparent" />';
216
- }
217
-
218
- //set flashvars
219
- if($flashvars != ""){
220
- $flashvars= '<param name="FlashVars" value="'. $flashvars .'" />'.PHP_EOL;
221
- }
222
-
223
-
224
-
225
- // TODO: Add flashmp3-maxi player here
226
- $content = '<div class="powerpress_player" id="powerpress_player_'. $g_powerpress_player_id .'">'.PHP_EOL;
227
- $content .= '<object type="application/x-shockwave-flash" data="'. powerpressplayer_get_root_url().'player_mp3_maxi.swf" id="'.$g_powerpress_player_id.'" width="'. $width.'" height="'. $height .'">'.PHP_EOL;
228
- $content .= '<param name="movie" value="'. powerpressplayer_get_root_url().'player_mp3_maxi.swf" />'.PHP_EOL;
229
- $content .= $transparency.PHP_EOL;
230
- $content .= $flashvars;
231
- $content .= '</object>'.PHP_EOL;
232
- $content .= '</div>'.PHP_EOL;
233
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
234
 
 
235
  }; break;
236
- case 'audioplay' : {
237
-
238
- $PlayerSettings = get_option('powerpress_audioplay');
239
- if($PlayerSettings == "") {
240
- $PlayerSettings = array(
241
- 'bgcolor' => '',
242
- 'buttondir' => 'negative',
243
- 'mode' => 'playpause'
244
- );
245
- }
246
-
247
- $width = $height = (strstr($PlayerSettings['buttondir'], 'small')===false?30:15);
248
-
249
- // Set standard variables for player
250
- $flashvars = 'file='.urlencode($media_url) ;
251
- $flashvars .= '&amp;repeat=1';
252
- if( $autoplay )
253
- $flashvars .= '&amp;auto=yes';
254
-
255
- if($PlayerSettings['bgcolor'] == ""){
256
- $flashvars .= "&amp;usebgcolor=no";
257
- $transparency = '<param name="wmode" value="transparent" />';
258
- $htmlbg = "";
259
- }
260
- else{
261
- $flashvars .= "&amp;bgcolor=". preg_replace('/\#/','0x',$PlayerSettings['bgcolor']);
262
- $transparency = '<param name="bgcolor" value="'. $PlayerSettings['bgcolor']. '" />';
263
- $htmlbg = 'bgcolor="'. $PlayerSettings['bgcolor'].'"';
264
-
265
- }
266
-
267
- if($PlayerSettings['buttondir'] == "") {
268
- $flashvars .= "&amp;buttondir=".powerpressplayer_get_root_url()."buttons/negative";
269
- }else{
270
- $flashvars .= "&amp;buttondir=".powerpressplayer_get_root_url().'buttons/'.$PlayerSettings['buttondir'];
271
-
272
- }
273
-
274
- $flashvars .= '&amp;mode='. $PlayerSettings['mode'];
275
-
276
- // TODO: Add audioplay player here
277
- $content .= '<div class="powerpress_player" id="powerpress_player_'. $g_powerpress_player_id .'">';
278
- $content .= '<object type="application/x-shockwave-flash" width="'. $width .'" height="'. $height .'" id="'.$g_powerpress_player_id.'" data="'. powerpressplayer_get_root_url().'audioplay.swf?'.$flashvars.'">'.PHP_EOL;
279
- $content .= '<param name="movie" value="'. powerpressplayer_get_root_url().'audioplay.swf?'.$flashvars.'" />'.PHP_EOL;
280
- $content .= '<param name="quality" value="high" />'.PHP_EOL;
281
- $content .= $transparency.PHP_EOL;
282
- $content .= '<param name="FlashVars" value="'.$flashvars.'" />'.PHP_EOL;
283
- $content .= '<embed src="'. powerpressplayer_get_root_url().'audioplay.swf?'.$flashvars.'" quality="high" width="30" height="30" type="application/x-shockwave-flash">'.PHP_EOL;
284
- $content .= "</embed>\n </object>\n";
285
- $content .= "</div>\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
286
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
287
  }; break;
288
- case 'simple_flash' : {
289
- $content .= '<div class="powerpress_player" id="powerpress_player_'. $g_powerpress_player_id .'">';
290
- $content .= '<object type="application/x-shockwave-flash" data="'. powerpressplayer_get_root_url() .'simple_mp3.swf" id="'.$g_powerpress_player_id.'" width="150" height="50">';
291
- $content .= '<param name="movie" value="'. powerpressplayer_get_root_url().'simple_mp3.swf" />';
292
- $content .= '<param name="wmode" value="transparent" />';
293
- $content .= '<param name="FlashVars" value="'. get_bloginfo('url') .'?url='. urlencode($media_url).'&amp;autostart='. ($autostart?'true':'false') .'" />';
294
- $content .= '<param name="quality" value="high" />';
295
- $content .= '<embed wmode="transparent" src="'. get_bloginfo('url') .'?url='.urlencode($media_url).'&amp;autostart='. ($autostart?'true':'false') .'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="150" height="50"></embed>';
296
- $content .= '</object>';
297
- $content .= "</div>\n";
298
- }; break;
299
- // Let all other cases fall through...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
300
  }
301
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
302
  return $content;
303
  }
304
 
305
- // Hook into the powerprss_player filter
306
- add_filter('powerpress_player', 'powerpressplayer_filter', 10, 3);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
307
 
308
- //if( is_admin() )
309
- // require_once( POWERPRESS_ABSPATH .'/powerpressadmin-player.php');
310
 
311
  ?>
3
  PowerPress player options
4
  */
5
 
 
 
 
6
 
7
+ function powerpressplayer_get_next_id()
8
+ {
9
+ if( !isset($GLOBALS['g_powerpress_player_id']) ) // Use the global unique player id variable for the surrounding div
10
+ $GLOBALS['g_powerpress_player_id'] = rand(0, 10000);
11
+ else
12
+ $GLOBALS['g_powerpress_player_id']++; // increment the player id for the next div so it is unique
13
+ return $GLOBALS['g_powerpress_player_id'];
14
+ }
15
 
16
+ function powerpressplayer_get_extension($media_url, $EpisodeData = array() )
17
  {
18
+ $extension = 'unknown';
19
+ $parts = pathinfo($media_url);
20
+ if( !empty($parts['extension']) )
21
+ $extension = strtolower($parts['extension']);
22
+
23
+ // Hack to use the audio/mp3 content type to set extension to mp3, some folks use tinyurl.com to mp3 files which remove the file extension...
24
+ if( isset($EpisodeData['type']) && $EpisodeData['type'] == 'audio/mpeg' && $extension != 'mp3' )
25
+ $extension = 'mp3';
26
+
27
+ return $extension;
28
  }
29
 
30
+ /*
31
+ Initialize powerpress player handling
32
+ */
33
+ function powerpressplayer_init($GeneralSettings)
34
  {
35
+ if( isset($_GET['powerpress_pinw']) )
36
+ powerpress_do_pinw($_GET['powerpress_pinw'], !empty($GeneralSettings['process_podpress']) );
37
+
38
+ if( isset($_GET['powerpress_embed']) )
39
+ powerpress_do_embed($_GET['powerpress_player'], $_GET['powerpress_embed'], !empty($GeneralSettings['process_podpress']) );
40
+
41
+ // If we are to process podpress data..
42
+ if( !empty($GeneralSettings['process_podpress']) )
43
+ {
44
+ add_shortcode('display_podcast', 'powerpress_shortcode_handler');
45
+ }
46
 
47
+ if( defined('POWERPRESS_ENQUEUE_SCRIPTS') )
48
+ {
49
+ // include what's needed for each plaer
50
+ wp_enqueue_script( 'powerpress-player', powerpress_get_root_url() .'player.js');
51
+ }
52
+
53
+ /*
54
+ if( !empty($GeneralSettings['display_player_disable_mobile']) && powerpress_is_mobile_client() )
55
+ {
56
+ // Remove all known filters for player embeds...
57
+ remove_filter('powerpress_player', 'powerpressplayer_player_audio', 10, 3);
58
+ remove_filter('powerpress_player', 'powerpressplayer_player_video', 10, 3);
59
+ remove_filter('powerpress_player', 'powerpressplayer_player_other', 10, 3);
60
+ }
61
+ */
62
+ }
63
+
64
+
65
+ function powerpress_shortcode_handler( $attributes, $content = null )
66
+ {
67
+ global $post, $g_powerpress_player_added;
68
+
69
+ // We can't add flash players to feeds
70
+ if( is_feed() )
71
+ return '';
72
+
73
+ $return = '';
74
+ $feed = '';
75
+ $url = '';
76
+ $image = '';
77
+ $width = '';
78
+ $height = '';
79
+
80
+ extract( shortcode_atts( array(
81
+ 'url' => '',
82
+ 'feed' => '',
83
+ 'image' => '',
84
+ 'width' => '',
85
+ 'height' => ''
86
+ ), $attributes ) );
87
+
88
+ if( !$url && $content )
89
+ {
90
+ $content_url = trim($content);
91
+ if( @parse_url($content_url) )
92
+ $url = $content_url;
93
+ }
94
+
95
+ if( $url )
96
+ {
97
+ $url = powerpress_add_redirect_url($url);
98
+ $content_type = '';
99
+ // Handle the URL differently...
100
+ $return = apply_filters('powerpress_player', '', powerpress_add_flag_to_redirect_url($url, 'p'), array('image'=>$image, 'type'=>$content_type,'width'=>$width, 'height'=>$height) );
101
+ }
102
+ else if( $feed )
103
+ {
104
+ $EpisodeData = powerpress_get_enclosure_data($post->ID, $feed);
105
+ if( !empty($EpisodeData['embed']) )
106
+ $return = $EpisodeData['embed'];
107
 
108
+ // Shortcode over-ride settings:
109
+ if( !empty($image) )
110
+ $EpisodeData['image'] = $image;
111
+ if( !empty($width) )
112
+ $EpisodeData['width'] = $width;
113
+ if( !empty($height) )
114
+ $EpisodeData['height'] = $height;
115
+
116
+ if( !isset($EpisodeData['no_player']) )
117
+ {
118
+ if( isset($GeneralSettings['premium_caps']) && $GeneralSettings['premium_caps'] && !powerpress_premium_content_authorized($feed) )
119
+ {
120
+ $return .= powerpress_premium_content_message($post->ID, $feed, $EpisodeData);
121
+ continue;
122
+ }
123
+
124
+ if( !isset($EpisodeData['no_player']) )
125
+ $return = apply_filters('powerpress_player', '', powerpress_add_flag_to_redirect_url($EpisodeData['url'], 'p'), array('feed'=>$feed, 'image'=>$image, 'type'=>$EpisodeData['type'],'width'=>$width, 'height'=>$height) );
126
+ if( empty($EpisodeData['no_links']) )
127
+ $return .= apply_filters('powerpress_player_links', '', powerpress_add_flag_to_redirect_url($EpisodeData['url'], 'p'), $EpisodeData );
128
+ }
129
+ }
130
+ else
131
+ {
132
+ $GeneralSettings = get_option('powerpress_general');
133
+ if( !isset($GeneralSettings['custom_feeds']['podcast']) )
134
+ $GeneralSettings['custom_feeds']['podcast'] = 'Podcast Feed'; // Fixes scenario where the user never configured the custom default podcast feed.
135
 
136
+ while( list($feed_slug,$feed_title) = each($GeneralSettings['custom_feeds']) )
137
+ {
138
+ if( isset($GeneralSettings['disable_player']) && isset($GeneralSettings['disable_player'][$feed_slug]) )
139
+ continue;
140
+
141
+ $EpisodeData = powerpress_get_enclosure_data($post->ID, $feed_slug);
142
+ if( !$EpisodeData && !empty($GeneralSettings['process_podpress']) && $feed_slug == 'podcast' )
143
+ $EpisodeData = powerpress_get_enclosure_data_podpress($post->ID);
144
+
145
+ if( !$EpisodeData )
146
+ continue;
147
+
148
+ if( !empty($EpisodeData['embed']) )
149
+ $return .= $EpisodeData['embed'];
150
+
151
+ // Shortcode over-ride settings:
152
+ if( !empty($image) )
153
+ $EpisodeData['image'] = $image;
154
+ if( !empty($width) )
155
+ $EpisodeData['width'] = $width;
156
+ if( !empty($height) )
157
+ $EpisodeData['height'] = $height;
158
+
159
+ if( isset($GeneralSettings['premium_caps']) && $GeneralSettings['premium_caps'] && !powerpress_premium_content_authorized($GeneralSettings) )
160
+ {
161
+ $return .= powerpress_premium_content_message($post->ID, $feed_slug, $EpisodeData);
162
+ continue;
163
+ }
164
+
165
+ if( !isset($EpisodeData['no_player']) )
166
+ {
167
+ $return .= apply_filters('powerpress_player', '', powerpress_add_flag_to_redirect_url($EpisodeData['url'], 'p'), $EpisodeData );
168
+ }
169
+ if( !isset($EpisodeData['no_links']) )
170
+ {
171
+ $return .= apply_filters('powerpress_player_links', '', powerpress_add_flag_to_redirect_url($EpisodeData['url'], 'p'), $EpisodeData );
172
+ }
173
+ }
174
+ }
175
+
176
+ return $return;
177
  }
178
 
179
+ add_shortcode('powerpress', 'powerpress_shortcode_handler');
180
+ if( !defined('PODCASTING_VERSION') )
181
  {
182
+ add_shortcode('podcast', 'powerpress_shortcode_handler');
183
+ }
184
+
185
+
186
+
187
+
188
+ function powerpress_player_filter($content, $media_url, $ExtraData = array() )
189
+ {
190
+ global $g_powerpress_player_id;
191
  if( !isset($g_powerpress_player_id) )
192
  $g_powerpress_player_id = rand(0, 10000);
193
+ else
194
+ $g_powerpress_player_id++;
195
+
196
+ // Very important setting, we need to know if the media should auto play or not...
197
+ $autoplay = false; // (default)
198
  if( isset($ExtraData['autoplay']) && $ExtraData['autoplay'] )
199
+ $autoplay = true;
200
+ $cover_image = '';
201
+ if( $ExtraData['image'] )
202
+ $cover_image = $ExtraData['image'];
203
 
204
+ // Based on $ExtraData, we can determine which type of player to handle here...
205
+ $Settings = get_option('powerpress_general');
206
+ $player_width = 400;
207
+ $player_height = 225;
208
+ if( isset($Settings['player_width']) && $Settings['player_width'] )
209
+ $player_width = $Settings['player_width'];
210
+ if( isset($Settings['player_height']) && $Settings['player_height'] )
211
+ $player_height = $Settings['player_height'];
212
+
213
+ // Used with some types
214
+ //$content_type = powerpress_get_contenttype($media_url);
215
+
216
+ $parts = pathinfo($media_url);
217
+ // Hack to use the audio/mp3 content type to set extension to mp3, some folks use tinyurl.com to mp3 files which remove the file extension...
218
+ // This hack only covers mp3s.
219
+ if( isset($EpisodeData['type']) && $EpisodeData['type'] == 'audio/mpeg' && $parts['extension'] != 'mp3' )
220
+ $parts['extension'] = 'mp3';
221
+
222
+ $ogg_video = false; // Extra securty make sure it is definitely set to video
223
+ switch( strtolower($parts['extension']) )
224
  {
225
+ // Quicktime old formats:
226
+ case 'm4a':
227
+ case 'avi':
228
+ case 'mpg':
229
+ case 'mpeg':
230
+
231
+ case 'm4b':
232
+ case 'm4r':
233
+ case 'qt':
234
+ case 'mov': {
235
+
236
+ $GeneralSettings = get_option('powerpress_general');
237
+ if( !isset($GeneralSettings['player_scale']) )
238
+ $GeneralSettings['player_scale'] = 'tofit';
239
+
240
+ // If there is no cover image specified, lets use the default...
241
+ if( $cover_image == '' )
242
+ $cover_image = powerpress_get_root_url() . 'play_video_default.jpg';
243
+
244
+ if( $autoplay )
245
+ {
246
+ $content .= '<div class="powerpress_player" id="powerpress_player_'. $g_powerpress_player_id .'"></div>'.PHP_EOL;
247
+ $content .= '<script type="text/javascript">'.PHP_EOL;
248
+ $content .= "powerpress_embed_quicktime('powerpress_player_{$g_powerpress_player_id}', '{$media_url}', {$player_width}, {$player_height}, '{$GeneralSettings['player_scale']}');\n";
249
+ $content .= "</script>\n";
250
+ }
251
+ else
252
+ {
253
+ $content .= '<div class="powerpress_player" id="powerpress_player_'. $g_powerpress_player_id .'">'.PHP_EOL;
254
+ $content .= '<a href="'. $media_url .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" onclick="';
255
+ $content .= "return powerpress_embed_quicktime('powerpress_player_{$g_powerpress_player_id}', '{$media_url}', {$player_width}, {$player_height}, '{$GeneralSettings['player_scale']}' );";
256
+ $content .= '">';
257
+ $content .= '<img src="'. $cover_image .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" alt="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" />';
258
+ $content .= '</a>';
259
+ $content .= "</div>\n";
260
+ }
261
+
262
+ }; break;
263
 
264
+ // Windows Media:
265
+ case 'wma':
266
+ case 'wmv':
267
+ case 'asf': {
268
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
269
  $content .= '<div class="powerpress_player" id="powerpress_player_'. $g_powerpress_player_id .'">';
270
+ $firefox = (stristr($_SERVER['HTTP_USER_AGENT'], 'firefox') !== false );
271
+
272
+ if( (!$cover_image && !$firefox ) || $autoplay ) // if we don't have a cover image or we're supposed to auto play the media anyway...
273
+ {
274
+ $content .= '<object id="winplayer" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="'. $player_width .'" height="'. $player_height .'" standby="..." type="application/x-oleobject">';
275
+ $content .= ' <param name="url" value="'. $media_url .'" />';
276
+ $content .= ' <param name="AutoStart" value="'. ($autoplay?'true':'false') .'" />';
277
+ $content .= ' <param name="AutoSize" value="true" />';
278
+ $content .= ' <param name="AllowChangeDisplaySize" value="true" />';
279
+ $content .= ' <param name="standby" value="Media is loading..." />';
280
+ $content .= ' <param name="AnimationAtStart" value="true" />';
281
+ $content .= ' <param name="scale" value="aspect" />';
282
+ $content .= ' <param name="ShowControls" value="true" />';
283
+ $content .= ' <param name="ShowCaptioning" value="false" />';
284
+ $content .= ' <param name="ShowDisplay" value="false" />';
285
+ $content .= ' <param name="ShowStatusBar" value="false" />';
286
+ $content .= ' <embed type="application/x-mplayer2" src="'. $media_url .'" width="'. $player_width .'" height="'. $player_height .'" scale="ASPECT" autostart="'. ($autoplay?'1':'0') .'" ShowDisplay="0" ShowStatusBar="0" autosize="1" AnimationAtStart="1" AllowChangeDisplaySize="1" ShowControls="1"></embed>';
287
+ $content .= '</object>';
288
+ }
289
+ else
290
+ {
291
+ if( $cover_image == '' )
292
+ $cover_image = powerpress_get_root_url() . 'play_video_default.jpg';
293
+
294
+ $content .= '<a href="'. $media_url .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" onclick="';
295
+ $content .= "return powerpress_embed_winplayer('powerpress_player_{$g_powerpress_player_id}', '{$media_url}', {$player_width}, {$player_height} );";
296
+ $content .= '">';
297
+ $content .= '<img src="'. $cover_image .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" alt="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" />';
298
+ $content .= '</a>';
299
+ }
300
+
301
+ if( $firefox )
302
+ {
303
+ $content .= '<p style="font-size: 85%;margin-top:0;">'. __('Best viewed with', 'powerpress');
304
+ $content .= ' <a href="http://support.mozilla.com/en-US/kb/Using+the+Windows+Media+Player+plugin+with+Firefox#Installing_the_plugin" target="_blank">';
305
+ $content .= __('Windows Media Player plugin for Firefox', 'powerpress') .'</a></p>';
306
+ }
307
+
308
+ $content .= "</div>\n";
309
 
310
  }; break;
 
311
 
312
+ // Flash:
313
+ case 'swf': {
314
+
315
+ // If there is no cover image specified, lets use the default...
316
+ if( $cover_image == '' )
317
+ $cover_image = powerpress_get_root_url() . 'play_video_default.jpg';
318
+
319
+ $content .= '<div class="powerpress_player" id="powerpress_player_'. $g_powerpress_player_id .'">';
320
+ if( !$autoplay )
321
+ {
322
+ $content .= '<a href="'. $media_url .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" onclick="';
323
+ $content .= "return powerpress_embed_swf('powerpress_player_{$g_powerpress_player_id}', '{$media_url}', {$player_width}, {$player_height} );";
324
+ $content .= '">';
325
+ $content .= '<img src="'. $cover_image .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" alt="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" />';
326
+ $content .= '</a>';
327
+ }
328
+ $content .= "</div>\n";
329
+ if( $autoplay )
330
+ {
331
+ $content .= '<script type="text/javascript">'.PHP_EOL;
332
+ $content .= "powerpress_embed_swf('powerpress_player_{$g_powerpress_player_id}', '{$media_url}', {$player_width}, {$player_height} );\n";
333
+ $content .= "</script>\n";
334
+ }
335
+
336
+ }; break;
337
+
338
+ // Default, just display the play image. If it is set for auto play, then we don't wnat to open a new window, otherwise we want to open this in a new window..
339
+ default: {
340
+
341
+ if( $cover_image == '' )
342
+ $cover_image = powerpress_get_root_url() . 'play_video_default.jpg';
343
+
344
+ $content .= '<div class="powerpress_player" id="powerpress_player_'. $g_powerpress_player_id .'">';
345
+ $content .= '<a href="'. $media_url .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'"'. ($autoplay?'':' target="_blank"') .'>';
346
+ $content .= '<img src="'. $cover_image .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" alt="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" />';
347
+ $content .= '</a>';
348
+ $content .= "</div>\n";
349
+
350
+ }; break;
351
+ }
352
+
353
+ return $content;
354
+ }
355
+
356
+ //add_filter('powerpress_player', 'powerpress_player_filter', 10, 3);
357
+
358
+
359
+ /*
360
+ // Everything in $ExtraData except post_id
361
+ */
362
+ function powerpress_generate_embed($player, $EpisodeData) // $post_id, $feed_slug, $width=false, $height=false, $media_url = false, $autoplay = false)
363
+ {
364
+ if( empty($EpisodeData['id']) && empty($EpisodeData['feed']) )
365
+ return '';
366
+
367
+ $width = 0;
368
+ $height = 0;
369
+ if( !empty($EpisodeData['width']) && is_numeric($EpisodeData['width']) )
370
+ $width = $EpisodeData['width'];
371
+ if( !empty($EpisodeData['height']) && is_numeric($EpisodeData['height']) )
372
+ $height = $EpisodeData['height'];
373
+
374
+ // More efficient, only pull the general settings if necessary
375
+ if( $height == 0 || $width == 0 )
376
+ {
377
+ $GeneralSettings = get_option('powerpress_general');
378
+ if( $width == 0 )
379
+ {
380
+ $width = 400;
381
+ if( !empty($GeneralSettings['player_width']) )
382
+ $width = $GeneralSettings['player_width'];
383
+ }
384
+
385
+ if( $height == 0 )
386
+ {
387
+ $height = 400;
388
+ if( !empty($GeneralSettings['player_height']) )
389
+ $height = $GeneralSettings['player_height'];
390
+ }
391
+
392
+ $extension = powerpressplayer_get_extension($EpisodeData['url']);
393
+ if( $extension == 'mp3' || $extension == 'm4a' )
394
+ {
395
+ $height = 24; // Hack for audio to only include the player without the poster art
396
+ }
397
+ }
398
+
399
+ $embed = '';
400
+ $url = get_bloginfo('url') .'/?powerpress_embed=' . $EpisodeData['id'] .'-'. $EpisodeData['feed'];
401
+ if( isset($EpisodeData['autoplay']) && $EpisodeData['autoplay'] )
402
+ $url .= '&amp;autoplay=true';
403
+
404
+ $url .= '&amp;powerpress_player='.$player;
405
+ $embed .= '<iframe';
406
+ //$embed .= ' class="powerpress-player-embed"';
407
+ $embed .= ' width="'. $width .'"';
408
+ $embed .= ' height="'. $height .'"';
409
+ $embed .= ' src="'. $url .'"';
410
+ $embed .= ' frameborder="0" scrolling="no"';
411
+ $embed .= '></iframe>';
412
+ return $embed;
413
+ }
414
+
415
+ function powerpressplayer_build_embed($player, $media_url, $EpisodeData = array() )
416
+ {
417
+ if( !$player )
418
+ return '';
419
+
420
+ if( empty($EpisodeData['id']) )
421
+ {
422
+ if( get_the_ID() )
423
+ $EpisodeData['id'] = get_the_ID();
424
+ }
425
+
426
+ // We don't have enough info to build an embed for this post or page
427
+ if( empty($EpisodeData['id']) && empty($EpisodeData['feed']) )
428
+ return '';
429
+
430
+ $extension = powerpressplayer_get_extension($media_url, $ExtraData);
431
+ $width = 400;
432
+ $height = 225;
433
+
434
+ // Configure width/height based on player
435
+ switch( $player )
436
+ {
437
+ case 'audio-player': {
438
+
439
+ $height = 25;
440
+ $width = 290;
441
+ if( !empty($EpisodeData['width']) && is_numeric($EpisodeData['width']) )
442
+ {
443
+ $width = $EpisodeData['width'];
444
+ }
445
+ else
446
+ {
447
+ $PlayerSettings = get_option('powerpress_audio-player');
448
+ if( !empty($EpisodeData['width']) && is_numeric($EpisodeData['width']) )
449
+ $width = $EpisodeData['width'];
450
+ }
451
+
452
+ }; break;
453
+ case 'flashmp3-maxi': {
454
+
455
  $PlayerSettings = get_option('powerpress_flashmp3-maxi');
456
+ $height = 20;
457
+ $width = 200;
458
+ if( !empty($PlayerSettings['width']) && is_numeric($PlayerSettings['width']) )
459
+ $width = $PlayerSettings['width'];
460
+ if( !empty($PlayerSettings['height']) && is_numeric($PlayerSettings['height']) )
461
+ $height = $PlayerSettings['height'];
462
+ if( !empty($EpisodeData['width']) && is_numeric($EpisodeData['width']) )
463
+ $width = $EpisodeData['width'];
464
+ if( !empty($EpisodeData['height']) && is_numeric($EpisodeData['height']) )
465
+ $height = $EpisodeData['height'];
466
+
467
+ }; break;
468
+ default: { // Other players are currently not supported
469
+ return '';
470
+ };
471
+ }
472
+
473
+ $embed = '';
474
+ $url = get_bloginfo('url') .'/?powerpress_embed=' . $EpisodeData['id'] .'-'. $EpisodeData['feed'];
475
+ if( isset($EpisodeData['autoplay']) && $EpisodeData['autoplay'] )
476
+ $url .= '&amp;autoplay=true';
477
+
478
+ $url .= '&amp;powerpress_player='.$player;
479
+ $embed .= '<iframe';
480
+ $embed .= ' class="powerpress-player-embed"';
481
+ $embed .= ' width="'. $width .'"';
482
+ $embed .= ' height="'. $height .'"';
483
+ $embed .= ' src="'. $url .'"';
484
+ $embed .= ' frameborder="0"';
485
+ $embed .= '></iframe>';
486
+ return $embed;
487
+ }
488
+
489
+
490
+ function powerpressplayer_in_embed($player, $media_url, $EpisodeData = array())
491
+ {
492
+ $content = '';
493
+ $content .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'. PHP_EOL;
494
+ $content .= '<html xmlns="http://www.w3.org/1999/xhtml">'. PHP_EOL;
495
+ $content .= '<head>'. PHP_EOL;
496
+ $content .= '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'. PHP_EOL;
497
+ $content .= '<title>'. __('Blubrry PowerPress Player', 'powerpress') .'</title>'. PHP_EOL;
498
+ $content .= '<script type="text/javascript" src="'. powerpress_get_root_url() .'player.js"></script>'. PHP_EOL;
499
+ // Include jQuery for convenience
500
+ $content .= '<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>'. PHP_EOL;
501
+ $content .= '<script language="javascript" type="text/javascript">'. PHP_EOL;
502
+ $content .= 'powerpress_url = \''. powerpress_get_root_url() .'\''. PHP_EOL;
503
+ $content .= 'jQuery(document).ready(function($) {'. PHP_EOL;
504
+ $content .= ' powerpress_resize_player();'. PHP_EOL;
505
+ $content .= ' $(window).resize(function() {'. PHP_EOL;
506
+ $content .= ' powerpress_resize_player();'. PHP_EOL;
507
+ $content .= ' });'. PHP_EOL;
508
+
509
+ $content .= '});'. PHP_EOL;
510
+ $content .= 'function powerpress_resize_player() {'. PHP_EOL;
511
+ $content .= ' jQuery(\'video\').css(\'width\', jQuery(window).width() );'. PHP_EOL;
512
+ $content .= ' jQuery(\'video\').css(\'height\', jQuery(window).height() );'. PHP_EOL;
513
+ $content .= ' jQuery(\'.powerpress_player .powerpress-player-poster\').css(\'width\', jQuery(window).width() );'. PHP_EOL;
514
+ $content .= ' jQuery(\'.powerpress_player .powerpress-player-poster\').css(\'height\', jQuery(window).height() );'. PHP_EOL;
515
+ $content .= ' jQuery(\'.powerpress_player .powerpress-player-play-image\').css(\'bottom\', Math.floor( (jQuery(window).height()/2)-30)+\'px\');'. PHP_EOL;
516
+ $content .= ' jQuery(\'.powerpress_player .powerpress-player-play-image\').css(\'left\', Math.floor( (jQuery(window).width()/2)-30)+\'px\');'. PHP_EOL;
517
+ $content .= ' jQuery(\'embed\').css(\'width\', jQuery(window).width() );'. PHP_EOL;
518
+ $content .= ' jQuery(\'embed\').css(\'height\', jQuery(window).height() );'. PHP_EOL;
519
+ $content .= '}'. PHP_EOL;
520
+ $content .= '</script>'. PHP_EOL;
521
+
522
+ /*
523
+
524
+ if( jQuery("#powerpress_settings_page").length > 0 )
525
+ {
526
+ var tabs = jQuery("#powerpress_settings_page").tabs();
527
+ tabs.tabs('select', <?php echo (empty($_POST['tab'])?0:$_POST['tab']); ?>);
528
+ jQuery('form').submit(function() {
529
+ var selectedTemp = tabs.tabs('option', 'selected');
530
+ jQuery('#save_tab_pos').val(selectedTemp);
531
+ });
532
+ }
533
+
534
+ jQuery('.powerpress-parental-rating-tip').click( function() {
535
+ jQuery('.powerpress-parental-rating-tip-p').css('display', 'none');
536
+ jQuery('#'+this.id +'_p').css('display', 'block');
537
+ });
538
+ jQuery('.activate-player').click( function(event) {
539
+ var PlayerName = this.id.replace(/(activate_)(.*)$/, "$2");
540
+ if( !PlayerName )
541
+ return;
542
+
543
+ jQuery('#player_'+PlayerName).attr('checked', true);
544
+ jQuery("form:first").submit();
545
+ event.preventDefault();
546
+ });
547
+
548
+ */
549
+ // Head specific settings for player
550
+ switch( $player )
551
+ {
552
+ case 'html5video': {
553
+ //$Settings = get_option('powerpress_general');
554
+ // TODO: Need to include javascript to insert HTML5 player (with FlowPlayer Classic fallback for mp4)
 
 
 
 
 
 
555
 
556
+ }; break;
557
+ case 'flow-player-classic': {
558
+ //$Settings = get_option('powerpress_general');
559
+ // TODO: Need to include javascript to insert HTML5 player (with FlowPlayer Classic fallback for mp4)
560
+
561
+ }; break;
562
+ case 'default': {
563
+ //$Settings = get_option('powerpress_general');
564
+ // TODO: Need to include javascript to insert HTML5 player (with FlowPlayer Classic fallback for mp4)
565
+
566
+ }; break;
567
+ }
568
+
569
+ $content .= '<style type="text/css" media="screen">' . PHP_EOL;
570
+ $content .= ' body { font-size: 13px; font-family: Arial, Helvetica, sans-serif; margin: 0; padding: 0; } img { border: 0; }' . PHP_EOL;
571
+ $content .= '</style>' . PHP_EOL;
572
+ $content .= '</head>'. PHP_EOL;
573
+ $content .= '<body>'. PHP_EOL;
574
+
575
+ // Body specific content for player
576
+ switch( $player )
577
+ {
578
+ case 'default':
579
+ case 'flow-player-classic': {
580
+
581
+ $content .= powerpressplayer_build_flowplayerclassic($media_url, $EpisodeData + array('jquery_autowidth'=>true) );
582
 
583
+ // $content .= 'Video Flow Player Classic coming soon!';
584
  }; break;
585
+ case 'html5video': {
586
+ $content .= powerpressplayer_build_html5video($media_url, $EpisodeData);
587
+ }; break;
588
+ default: {
589
+ $content .= '<strong>'. __('Player Not Available', 'powerpress') .'</strong>';
590
+ };
591
+ }
592
+
593
+ $content .= '</body>'. PHP_EOL;
594
+ $content .= '</html>'. PHP_EOL;
595
+ return $content;
596
+ }
597
+
598
+
599
+ /*
600
+ Audio Players - Flash/HTML5 compliant mp3 audio
601
+
602
+ @since 2.0
603
+ @content -
604
+ @param string $content Content of post or page to add player to
605
+ @param string $media_url Media URL to add player for
606
+ @param array $EpisodeData Array of key/value settings that optionally can contribute to player being added
607
+ @return string $content The content, possibly modified wih player added
608
+ */
609
+ function powerpressplayer_player_audio($content, $media_url, $EpisodeData = array() )
610
+ {
611
+ if( powerpress_is_mobile_client() ) // Mobile clients are handled in powerpressplayer_player_other
612
+ return $content;
613
+
614
+ $extension = powerpressplayer_get_extension($media_url);
615
+ switch( $extension )
616
+ {
617
+ // MP3
618
+ case 'mp3':
619
+ {
620
+ $Settings = get_option('powerpress_general');
621
+ switch( $Settings['player'] )
622
+ {
623
+ case 'default':
624
+ case 'flow-player-classic': {
625
+ $content .= powerpressplayer_build_flowplayerclassic($media_url, $EpisodeData);
626
+ }; break;
627
+ case 'audio-player': {
628
+ $content .= powerpressplayer_build_1pxoutplayer($media_url, $EpisodeData);
629
+ }; break;
630
+ case 'flashmp3-maxi': {
631
+ $content .= powerpressplayer_build_flashmp3maxi($media_url, $EpisodeData);
632
+ }; break;
633
+ case 'audioplay': {
634
+ $content .= powerpressplayer_build_audioplay($media_url, $EpisodeData);
635
+ }; break;
636
+ case 'simple_flash': {
637
+ $content .= powerpressplayer_build_simpleflash($media_url, $EpisodeData);
638
+ }; break;
639
+ case 'html5audio': {
640
+ $content .= powerpressplayer_build_html5audio($media_url, $EpisodeData);
641
+ }; break;
642
+ }
643
+
644
+ }; break;
645
+ case 'm4a': {
646
+
647
+ $Settings = get_option('powerpress_general');
648
+ switch( $Settings['player'] )
649
+ {
650
+ case 'default':
651
+ case 'flow-player-classic': {
652
+ $content .= powerpressplayer_build_flowplayerclassic($media_url, $EpisodeData);
653
+ }; break;
654
+ case 'html5audio': {
655
+ $content .= powerpressplayer_build_html5audio($media_url, $EpisodeData);
656
+ }; break;
657
+ default: {
658
+ $content .= powerpressplayer_build_playimageaudio($media_url, true);
659
+ };
660
+ }
661
+
662
+ // Use Flow player if configured
663
+ }; break;
664
+ case 'ogg': {
665
+ if( defined('POWERPRESS_OGG_VIDEO') && POWERPRESS_OGG_VIDEO )
666
+ return $content; // Ogg is handled as video
667
+ }
668
+ case 'oga': {
669
+ $content .= powerpressplayer_build_html5audio($media_url, $EpisodeData);
670
+ }; break;
671
+ }
672
+
673
+ return $content;
674
+ }
675
+
676
+ /*
677
+ Video Players - HTML5/Flash compliant video formats
678
+ */
679
+ function powerpressplayer_player_video($content, $media_url, $EpisodeData = array() )
680
+ {
681
+ if( powerpress_is_mobile_client() ) // Mobile clients are handled in powerpressplayer_player_other
682
+ return $content;
683
+
684
+ $extension = powerpressplayer_get_extension($media_url);
685
+ switch( $extension )
686
+ {
687
+ // OGG (audio or video)
688
+ case 'ogg': {
689
+ // Ogg special case, we treat as audio unless specified otherwise
690
+ if( !defined('POWERPRESS_OGG_VIDEO') || POWERPRESS_OGG_VIDEO == false )
691
+ return $content;
692
+ }
693
+ // OGG Video / WebM
694
+ case 'webm':
695
+ case 'ogv': { // Use native player when possible
696
+
697
+ // HTML5 Video as an embed
698
+ $content .= powerpressplayer_build_html5video($media_url, $EpisodeData);
699
+ }; break;
700
+ // H.264
701
+ case 'm4v':
702
+ case 'mp4':
703
+ // Okay, lets see if we we have a player setup to handle this
704
+ {
705
+
706
+ $Settings = get_option('powerpress_general');
707
+ //die($Settings['video_player']);
708
+ switch( $Settings['video_player'] )
709
+ {
710
+ case 'default':
711
+ case 'flow-player-classic': {
712
+
713
+ $content .= powerpressplayer_build_flowplayerclassic($media_url, $EpisodeData);
714
+ }; break;
715
+ case 'html5video': {
716
+ // HTML5 Video as an embed
717
+ $content .= powerpressplayer_build_html5video($media_url, $EpisodeData);
718
+ }; break;
719
+ }
720
+ }; break;
721
+ }
722
+
723
+ return $content;
724
+ }
725
+
726
+ function powerpressplayer_player_other($content, $media_url, $EpisodeData = array() )
727
+ {
728
+ if( powerpress_is_mobile_client() )
729
+ {
730
+ $content .= powerpressplayer_build_html5mobile($media_url, $EpisodeData);
731
+ return $content;
732
+ }
733
+
734
+ // Very important setting, we need to know if the media should auto play or not...
735
+ $autoplay = false; // (default)
736
+ if( isset($EpisodeData['autoplay']) && $EpisodeData['autoplay'] )
737
+ $autoplay = true;
738
+ $cover_image = '';
739
+ if( $EpisodeData['image'] )
740
+ $cover_image = $EpisodeData['image'];
741
+
742
+ $extension = powerpressplayer_get_extension($media_url);
743
+
744
+ switch( $extension )
745
+ {
746
+ // Common formats, we already handle them separately
747
+ case 'mp3':
748
+ case 'mp4':
749
+ case 'm4v':
750
+ case 'm4a':
751
+ case 'webm';
752
+ case 'ogg':
753
+ case 'ogv':
754
+ case 'oga':
755
+ {
756
+ return $content;
757
+ }; break;
758
+ case 'flv': {
759
+ $content .= powerpressplayer_build_flowplayerclassic($media_url, $EpisodeData);
760
+ }; break;
761
+ // Old Quicktime formats:
762
+ case 'avi':
763
+ case 'mpg':
764
+ case 'mpeg':
765
+ case 'm4b':
766
+ case 'm4r':
767
+ case 'qt':
768
+ case 'mov': {
769
+
770
+ $Settings = get_option('powerpress_general');
771
+ $player_id = powerpressplayer_get_next_id();
772
+ $player_width = 400;
773
+ $player_height = 225;
774
+ $scale = 'tofit';
775
+ if( !empty($Settings['player_width']) )
776
+ $player_width = $Settings['player_width'];
777
+ if( !empty($Settings['player_height']) )
778
+ $player_height = $Settings['player_height'];
779
+ if( !empty($EpisodeData['width']) && is_numeric($EpisodeData['width']) )
780
+ $player_width = $EpisodeData['width'];
781
+ if( !empty($EpisodeData['height']) && is_numeric($EpisodeData['height']) )
782
+ $player_height = $EpisodeData['height'];
783
+
784
+ if( !empty($Settings['player_scale']) )
785
+ $scale = $Settings['player_scale'];
786
+
787
+ // If there is no cover image specified, lets use the default...
788
+ if( $cover_image == '' )
789
+ $cover_image = powerpress_get_root_url() . 'play_video_default.jpg';
790
+
791
+ if( $autoplay )
792
+ {
793
+ $content .= '<div class="powerpress_player" id="powerpress_player_'. $player_id .'"></div>'.PHP_EOL;
794
+ $content .= '<script type="text/javascript">'.PHP_EOL;
795
+ $content .= "powerpress_embed_quicktime('powerpress_player_{$player_id}', '{$media_url}', {$player_width}, {$player_height}, '{$scale}');\n";
796
+ $content .= "</script>\n";
797
+ }
798
+ else
799
+ {
800
+ $content .= '<div class="powerpress_player" id="powerpress_player_'. $player_id .'">'.PHP_EOL;
801
+ $content .= '<a href="'. $media_url .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" onclick="';
802
+ $content .= "return powerpress_embed_quicktime('powerpress_player_{$player_id}', '{$media_url}', {$player_width}, {$player_height}, '{$scale}' );";
803
+ $content .= '">';
804
+ $content .= '<img src="'. $cover_image .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" alt="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" />';
805
+ $content .= '</a>';
806
+ $content .= "</div>\n";
807
+ }
808
+
809
+ }; break;
810
+
811
+ // Windows Media:
812
+ case 'wma':
813
+ case 'wmv':
814
+ case 'asf': {
815
+
816
+ $Settings = get_option('powerpress_general');
817
+ $player_id = powerpressplayer_get_next_id();
818
+ $player_width = 400;
819
+ $player_height = 225;
820
+ $scale = 'tofit';
821
+ if( !empty($Settings['player_width']) )
822
+ $player_width = $Settings['player_width'];
823
+ if( !empty($Settings['player_height']) )
824
+ $player_height = $Settings['player_height'];
825
+ if( !empty($EpisodeData['width']) && is_numeric($EpisodeData['width']) )
826
+ $player_width = $EpisodeData['width'];
827
+ if( !empty($EpisodeData['height']) && is_numeric($EpisodeData['height']) )
828
+ $player_height = $EpisodeData['height'];
829
+
830
+ // If there is no cover image specified, lets use the default...
831
+ if( $cover_image == '' )
832
+ $cover_image = powerpress_get_root_url() . 'play_video_default.jpg';
833
+
834
+ $content .= '<div class="powerpress_player" id="powerpress_player_'. $player_id .'">';
835
+ $firefox = (stristr($_SERVER['HTTP_USER_AGENT'], 'firefox') !== false );
836
+
837
+ if( (!$cover_image && !$firefox ) || $autoplay ) // if we don't have a cover image or we're supposed to auto play the media anyway...
838
+ {
839
+ $content .= '<object id="winplayer" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="'. $player_width .'" height="'. $player_height .'" standby="..." type="application/x-oleobject">';
840
+ $content .= ' <param name="url" value="'. $media_url .'" />';
841
+ $content .= ' <param name="AutoStart" value="'. ($autoplay?'true':'false') .'" />';
842
+ $content .= ' <param name="AutoSize" value="true" />';
843
+ $content .= ' <param name="AllowChangeDisplaySize" value="true" />';
844
+ $content .= ' <param name="standby" value="Media is loading..." />';
845
+ $content .= ' <param name="AnimationAtStart" value="true" />';
846
+ $content .= ' <param name="scale" value="aspect" />';
847
+ $content .= ' <param name="ShowControls" value="true" />';
848
+ $content .= ' <param name="ShowCaptioning" value="false" />';
849
+ $content .= ' <param name="ShowDisplay" value="false" />';
850
+ $content .= ' <param name="ShowStatusBar" value="false" />';
851
+ $content .= ' <embed type="application/x-mplayer2" src="'. $media_url .'" width="'. $player_width .'" height="'. $player_height .'" scale="ASPECT" autostart="'. ($autoplay?'1':'0') .'" ShowDisplay="0" ShowStatusBar="0" autosize="1" AnimationAtStart="1" AllowChangeDisplaySize="1" ShowControls="1"></embed>';
852
+ $content .= '</object>';
853
+ }
854
+ else
855
+ {
856
+ if( $cover_image == '' )
857
+ $cover_image = powerpress_get_root_url() . 'play_video_default.jpg';
858
+
859
+ $content .= '<a href="'. $media_url .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" onclick="';
860
+ $content .= "return powerpress_embed_winplayer('powerpress_player_{$player_id}', '{$media_url}', {$player_width}, {$player_height} );";
861
+ $content .= '">';
862
+ $content .= '<img src="'. $cover_image .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" alt="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" />';
863
+ $content .= '</a>';
864
+ }
865
+
866
+ if( $firefox )
867
+ {
868
+ $content .= '<p style="font-size: 85%;margin-top:0;">'. __('Best viewed with', 'powerpress');
869
+ $content .= ' <a href="http://support.mozilla.com/en-US/kb/Using+the+Windows+Media+Player+plugin+with+Firefox#Installing_the_plugin" target="_blank">';
870
+ $content .= __('Windows Media Player plugin for Firefox', 'powerpress') .'</a></p>';
871
+ }
872
+
873
+ $content .= "</div>\n";
874
+
875
+ }; break;
876
+
877
+ // Flash:
878
+ case 'swf': {
879
+
880
+ $Settings = get_option('powerpress_general');
881
+ $player_id = powerpressplayer_get_next_id();
882
+ $player_width = 400;
883
+ $player_height = 225;
884
+ if( !empty($Settings['player_width']) )
885
+ $player_width = $Settings['player_width'];
886
+ if( !empty($Settings['player_height']) )
887
+ $player_height = $Settings['player_height'];
888
+ if( !empty($EpisodeData['width']) && is_numeric($EpisodeData['width']) )
889
+ $player_width = $EpisodeData['width'];
890
+ if( !empty($EpisodeData['height']) && is_numeric($EpisodeData['height']) )
891
+ $player_height = $EpisodeData['height'];
892
+
893
+ // If there is no cover image specified, lets use the default...
894
+ if( $cover_image == '' )
895
+ $cover_image = powerpress_get_root_url() . 'play_video_default.jpg';
896
+
897
+ $content .= '<div class="powerpress_player" id="powerpress_player_'. $player_id .'">';
898
+ if( !$autoplay )
899
+ {
900
+ $content .= '<a href="'. $media_url .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" onclick="';
901
+ $content .= "return powerpress_embed_swf('powerpress_player_{$player_id}','{$media_url}',{$player_width},{$player_height});";
902
+ $content .= '">';
903
+ $content .= '<img src="'. $cover_image .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" alt="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" />';
904
+ $content .= '</a>';
905
+ }
906
+ $content .= "</div>\n";
907
+ if( $autoplay )
908
+ {
909
+ $content .= '<script type="text/javascript">'.PHP_EOL;
910
+ $content .= "powerpress_embed_swf('powerpress_player_{$player_id}','{$media_url}',{$player_width},{$player_height});\n";
911
+ $content .= "</script>\n";
912
+ }
913
+
914
+ }; break;
915
+
916
+ // Default, just display the play image.
917
+ default: {
918
+
919
+ $content .= powerpressplayer_build_playimage($media_url, $EpisodeData, true);
920
+
921
+ }; break;
922
+ }
923
+
924
+ return $content;
925
+ }
926
+
927
+ add_filter('powerpress_player', 'powerpressplayer_player_audio', 10, 3); // Audio players (mp3)
928
+ add_filter('powerpress_player', 'powerpressplayer_player_video', 10, 3); // Video players (mp4/m4v, webm, ogv)
929
+ add_filter('powerpress_player', 'powerpressplayer_player_other', 10, 3); // Audio/Video flv, wmv, wma, oga, m4a and other non-standard media files
930
+
931
+ /*
932
+ Filters for media links, appear below the selected player
933
+ */
934
+ function powerpressplayer_link_download($content, $media_url, $ExtraData = array() )
935
+ {
936
+ $GeneralSettings = get_option('powerpress_general');
937
+
938
+ $player_links = '';
939
+ if( $GeneralSettings['podcast_link'] == 1 )
940
+ {
941
+ $player_links .= "<a href=\"{$media_url}\" class=\"powerpress_link_d\" title=\"". POWERPRESS_DOWNLOAD_TEXT ."\">". POWERPRESS_DOWNLOAD_TEXT ."</a>".PHP_EOL;
942
+ }
943
+ else if( $GeneralSettings['podcast_link'] == 2 )
944
+ {
945
+ $player_links .= "<a href=\"{$media_url}\" class=\"powerpress_link_d\" title=\"". POWERPRESS_DOWNLOAD_TEXT ."\">". POWERPRESS_DOWNLOAD_TEXT ."</a> (".powerpress_byte_size($ExtraData['size']).") ".PHP_EOL;
946
+ }
947
+ else if( $GeneralSettings['podcast_link'] == 3 )
948
+ {
949
+ if( $ExtraData['duration'] && ltrim($ExtraData['duration'], '0:') != '' )
950
+ $player_links .= "<a href=\"{$media_url}\" class=\"powerpress_link_d\" title=\"". POWERPRESS_DOWNLOAD_TEXT ."\">". POWERPRESS_DOWNLOAD_TEXT ."</a> (". htmlspecialchars(POWERPRESS_DURATION_TEXT) .": " . powerpress_readable_duration($ExtraData['duration']) ." &#8212; ".powerpress_byte_size($ExtraData['size']).")".PHP_EOL;
951
+ else
952
+ $player_links .= "<a href=\"{$media_url}\" class=\"powerpress_link_d\" title=\"". POWERPRESS_DOWNLOAD_TEXT ."\">". POWERPRESS_DOWNLOAD_TEXT ."</a> (".powerpress_byte_size($ExtraData['size']).")".PHP_EOL;
953
+ }
954
+
955
+ if( $player_links && !empty($content) )
956
+ $content .= ' '.POWERPRESS_LINK_SEPARATOR .' ';
957
+
958
+ return $content . $player_links;
959
+ }
960
+
961
+ function powerpressplayer_link_pinw($content, $media_url, $ExtraData = array() )
962
+ {
963
+ $GeneralSettings = get_option('powerpress_general');
964
+ $is_pdf = (strtolower( substr($media_url, -3) ) == 'pdf' );
965
+
966
+ $player_links = '';
967
+ switch( $GeneralSettings['player_function'] )
968
+ {
969
+ case 1: // Play on page and new window
970
+ case 3: // Play in new window only
971
+ case 5: { // Play in page and new window
972
+ if( $is_pdf )
973
+ $player_links .= "<a href=\"{$media_url}\" class=\"powerpress_link_pinw\" target=\"_blank\" title=\"". __('Open in New Window', 'powerpress') ."\">". __('Open in New Window', 'powerpress') ."</a>".PHP_EOL;
974
+ else if( !empty($ExtraData['id']) && !empty($ExtraData['feed']) )
975
+ $player_links .= "<a href=\"{$media_url}\" class=\"powerpress_link_pinw\" target=\"_blank\" title=\"". POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT ."\" onclick=\"return powerpress_pinw('{$ExtraData['id']}-{$ExtraData['feed']}');\">". POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT ."</a>".PHP_EOL;
976
+ else
977
+ $player_links .= "<a href=\"{$media_url}\" class=\"powerpress_link_pinw\" target=\"_blank\" title=\"". POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT ."\">". POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT ."</a>".PHP_EOL;
978
+ }; break;
979
+ }//end switch
980
+
981
+ if( $player_links && !empty($content) )
982
+ $content .= ' '.POWERPRESS_LINK_SEPARATOR .' ';
983
+
984
+ return $content . $player_links;
985
+ }
986
+
987
+ function powerpressplayer_embedable($media_url, $ExtraData = array())
988
+ {
989
+ if( empty($ExtraData['id']) || empty($ExtraData['feed']) )
990
+ return false;
991
+
992
+ $extension = powerpressplayer_get_extension($media_url);
993
+ $player = false;
994
+ if( preg_match('/(mp3|m4a|mp4|m4v|webm|ogg|ogv)/i', $extension ) )
995
+ {
996
+ $GeneralSettings = get_option('powerpress_general');
997
+ if( empty($GeneralSettings['podcast_embed']) )
998
+ return false;
999
+ switch( $extension )
1000
+ {
1001
+ case 'mp3':
1002
+ case 'm4a': {
1003
+ if( $GeneralSettings['player'] == 'default' )
1004
+ $player = $GeneralSettings['player'];
1005
 
1006
+ }; break;
1007
+ case 'mp4':
1008
+ case 'm4v':
1009
+ case 'webm':
1010
+ case 'ogg':
1011
+ case 'ogv': {
1012
+ if( $GeneralSettings['video_player'] == 'flow-player-classic' || $GeneralSettings['video_player'] == 'html5video' )
1013
+ $player = $GeneralSettings['video_player'];
1014
+ }; break;
1015
+ }
1016
+ }
1017
+
1018
+ return $player;
1019
+ }
1020
+
1021
+ function powerpressplayer_link_embed($content, $media_url, $ExtraData = array() )
1022
+ {
1023
+ $player_links = '';
1024
+ // TODO: add code to provide embed to media episode
1025
+
1026
+ $player = powerpressplayer_embedable($media_url, $ExtraData);
1027
+ if( $player )
1028
+ {
1029
+ $player_links .= "<a href=\"#\" class=\"powerpress_link_e\" title=\"". __('Embed', 'powerpress') ."\" onclick=\"return powerpress_show_embed('{$ExtraData['id']}-{$ExtraData['feed']}');\">". __('Embed', 'powerpress') ."</a>";
1030
+ }
1031
+
1032
+ if( $player_links && !empty($content) )
1033
+ $content .= ' '.POWERPRESS_LINK_SEPARATOR .' ';
1034
+ return $content . $player_links;
1035
+ }
1036
+
1037
+ function powerpressplayer_link_title($content, $media_url, $ExtraData = array() )
1038
+ {
1039
+ if( $content )
1040
+ {
1041
+ $extension = 'unknown';
1042
+ $parts = pathinfo($media_url);
1043
+ if( $parts && isset($parts['extension']) )
1044
+ $extension = strtolower($parts['extension']);
1045
+
1046
+ $prefix = '';
1047
+ if( $extension == 'pdf' )
1048
+ $prefix .= __('E-Book PDF', 'powerpress') . ( $ExtraData['feed']=='pdf'||$ExtraData['feed']=='podcast'?'':" ({$ExtraData['feed']})") .POWERPRESS_TEXT_SEPARATOR;
1049
+ else if( $ExtraData['feed'] != 'podcast' )
1050
+ $prefix .= htmlspecialchars(POWERPRESS_LINKS_TEXT) .' ('. htmlspecialchars($ExtraData['feed']) .')'. POWERPRESS_TEXT_SEPARATOR;
1051
+ else
1052
+ $prefix .= htmlspecialchars(POWERPRESS_LINKS_TEXT) . POWERPRESS_TEXT_SEPARATOR;
1053
+ if( !empty($prefix) )
1054
+ $prefix .= ' ';
1055
+
1056
+ $return = '<p class="powerpress_links powerpress_links_'. $extension .'">'. $prefix . $content . '</p>'.PHP_EOL;
1057
+ $player = powerpressplayer_embedable($media_url, $ExtraData);
1058
+ if( $player )
1059
+ {
1060
+ $iframe_src = powerpress_generate_embed($player, $ExtraData);
1061
+ $return .= '<p class="powerpress_embed_box" id="powerpress_embed_'. "{$ExtraData['id']}-{$ExtraData['feed']}" .'" style="display: none;">';
1062
+ $return .= '<input id="powerpress_embed_'. "{$ExtraData['id']}-{$ExtraData['feed']}" .'_t" type="text" value="'. htmlspecialchars($iframe_src) .'" onclick="javascript: this.select();" onfocus="javascript: this.select();" style="width: 70%;" readOnly>';
1063
+ $return .= '</p>';
1064
+ }
1065
+ return $return;
1066
+ }
1067
+ return '';
1068
+ }
1069
+
1070
+ add_filter('powerpress_player_links', 'powerpressplayer_link_pinw', 30, 3);
1071
+ add_filter('powerpress_player_links', 'powerpressplayer_link_download', 50, 3);
1072
+ add_filter('powerpress_player_links', 'powerpressplayer_link_embed', 50, 3);
1073
+ add_filter('powerpress_player_links', 'powerpressplayer_link_title', 1000, 3);
1074
+
1075
+ /*
1076
+ Do Play in new Window
1077
+ */
1078
+ function powerpress_do_pinw($pinw, $process_podpress)
1079
+ {
1080
+ list($post_id, $feed_slug) = explode('-', $pinw, 2);
1081
+ $EpisodeData = powerpress_get_enclosure_data($post_id, $feed_slug);
1082
+
1083
+ if( $EpisodeData == false && $process_podpress && $feed_slug == 'podcast' )
1084
+ {
1085
+ $EpisodeData = powerpress_get_enclosure_data_podpress($post_id);
1086
+ }
1087
+
1088
+ echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
1089
+ ?>
1090
+ <html xmlns="http://www.w3.org/1999/xhtml">
1091
+ <head>
1092
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
1093
+ <title><?php echo __('Blubrry PowerPress Player', 'powerpress'); ?></title>
1094
+ <?php
1095
+ wp_head();
1096
+ ?>
1097
+ <style type="text/css">
1098
+ body { font-size: 13px; font-family: Arial, Helvetica, sans-serif; }
1099
+ </style>
1100
+ </head>
1101
+ <body>
1102
+ <div style="margin: 5px;">
1103
+ <?php
1104
+ $GeneralSettings = get_option('powerpress_general');
1105
+ if( !$EpisodeData )
1106
+ {
1107
+ echo '<p>'. __('Unable to retrieve media information.', 'powerpress') .'</p>';
1108
+ }
1109
+ else if( !empty($GeneralSettings['premium_caps']) && !powerpress_premium_content_authorized($feed_slug) )
1110
+ {
1111
+ echo powerpress_premium_content_message($post_id, $feed_slug, $EpisodeData);
1112
+ }
1113
+ else if( !empty($EpisodeData['embed']) )
1114
+ {
1115
+ echo $EpisodeData['embed'];
1116
+ }
1117
+ else // if( !isset($EpisodeData['no_player']) ) // Even if there is no player set, if the play in new window option is enabled then it should play here...
1118
+ {
1119
+ echo apply_filters('powerpress_player', '', powerpress_add_flag_to_redirect_url($EpisodeData['url'], 'p'), array('feed'=>$feed_slug, 'autoplay'=>true, 'type'=>$EpisodeData['type']) );
1120
+ }
1121
+
1122
+ ?>
1123
+ </div>
1124
+ </body>
1125
+ </html>
1126
+ <?php
1127
+ exit;
1128
+ }
1129
+
1130
+ /*
1131
+ Do embed
1132
+ */
1133
+ function powerpress_do_embed($player, $embed, $process_podpress)
1134
+ {
1135
+ list($post_id, $feed_slug) = explode('-', $embed, 2);
1136
+ $EpisodeData = powerpress_get_enclosure_data($post_id, $feed_slug);
1137
+
1138
+ if( $EpisodeData == false && $process_podpress && $feed_slug == 'podcast' )
1139
+ {
1140
+ $EpisodeData = powerpress_get_enclosure_data_podpress($post_id);
1141
+ }
1142
+
1143
+ // Embeds are only available for the following players
1144
+ echo powerpressplayer_in_embed($player, $EpisodeData['url'], $EpisodeData);
1145
+ exit;
1146
+ }
1147
+
1148
+ /*
1149
+ HTTML 5 Video Player
1150
+ */
1151
+ function powerpressplayer_build_html5video($media_url, $EpisodeData=array(), $embed = false )
1152
+ {
1153
+ $player_id = powerpressplayer_get_next_id();
1154
+ $cover_image = '';
1155
+ $player_width = 400;
1156
+ $player_height = 225;
1157
+ $autoplay = false;
1158
+ // Global Settings
1159
+ $Settings = get_option('powerpress_general');
1160
+ if( !empty($Settings['player_width']) )
1161
+ $player_width = $Settings['player_width'];
1162
+ if( !empty($Settings['player_height']) )
1163
+ $player_height = $Settings['player_height'];
1164
+ if( !empty($Settings['poster_image']) )
1165
+ $cover_image = $Settings['poster_image'];
1166
+ // Episode Settings
1167
+ if( !empty($EpisodeData['image']) )
1168
+ $cover_image = $EpisodeData['image'];
1169
+ if( !empty($EpisodeData['width']) )
1170
+ $player_width = $EpisodeData['width'];
1171
+ if( !empty($EpisodeData['height']) )
1172
+ $player_height = $EpisodeData['height'];
1173
+ if( !empty($EpisodeData['autoplay']) )
1174
+ $autoplay = true;
1175
+
1176
+ $content = '';
1177
+ if( $embed )
1178
+ {
1179
+ $content .= '<div class="powerpress_player" id="powerpress_player_'. $player_id .'">'.PHP_EOL;
1180
+ $content .= '<video width="'. $player_width .'" height="'. $player_height .'" controls="controls"';
1181
+ if( $cover_image )
1182
+ $content .= ' poster="'. $cover_image .'"';
1183
+ if( $autoplay )
1184
+ $content .= ' autoplay="autoplay"';
1185
+ else
1186
+ $content .= ' preload="none"';
1187
+ $content .= '>'.PHP_EOL;
1188
+ $content_type = powerpress_get_contenttype($media_url);
1189
+ $content .='<source src="'. $media_url .'" type="'. $content_type .'" />';
1190
+
1191
+ if( !empty($EpisodeData['webm_src']) )
1192
+ {
1193
+ $content .='<source src="'. $EpisodeData['webm_src'] .'" type="video/webm" />';
1194
+ }
1195
+
1196
+ if( !empty($EpisodeData['image']) )
1197
+ $content .= powerpressplayer_build_playimage($media_url, $EpisodeData);
1198
+ else
1199
+ $content .= powerpressplayer_build_playlink($media_url);
1200
+ $content .= '</video>'.PHP_EOL;
1201
+ $content .= '</div>'.PHP_EOL;
1202
+ }
1203
+ else
1204
+ {
1205
+ if( !$cover_image )
1206
+ $cover_image = powerpress_get_root_url() . 'black.png';
1207
+ $webm_src = '';
1208
+ if( !empty($EpisodeData['webm_src']) )
1209
+ $webm_src = $EpisodeData['webm_src'];
1210
+ $content .= '<div class="powerpress_player" id="powerpress_player_'. $player_id .'">';
1211
+ $content .= '<a href="'. $media_url .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" onclick="return powerpress_embed_html5v(\''.$player_id.'\',\''.$media_url.'\',\''. $player_width .'\',\''. $player_height .'\', \''. $webm_src .'\');" target="_blank" style="position: relative;">';
1212
+ $content .= '<img class="powerpress-player-poster" src="'. $cover_image .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" alt="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" style="width: '. $player_width .'px; height: '. $player_height .'px;" />';
1213
+ if(!isset($Settings['poster_play_image']) || $Settings['poster_play_image'] )
1214
+ {
1215
+ $bottom = floor(($player_height/2)-30);
1216
+ if( $bottom < 0 )
1217
+ $bottom = 0;
1218
+ $left = floor(($player_width/2)-30);
1219
+ if( $left < 0 )
1220
+ $left = 0;
1221
+ $content .= '<img class="powerpress-player-play-image" src="'. powerpress_get_root_url() .'play_video.png" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" alt="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" style="position: absolute; bottom: '. $bottom .'px; left: '. $left .'px; border:0;" />';
1222
+ }
1223
+ $content .= '</a>';
1224
+ $content .= "</div>\n";
1225
+
1226
+ if( $autoplay )
1227
+ {
1228
+ $content .= '<script type="text/javascript">'.PHP_EOL;
1229
+ $content .= "powerpress_embed_html5v('{$player_id}','{$media_url}',{$player_width},{$player_height},'{$webm_src}');\n";
1230
+ $content .= "</script>\n";
1231
+ }
1232
+ }
1233
+ return $content;
1234
+ }
1235
+
1236
+ /*
1237
+ HTTML 5 Audio Player
1238
+ */
1239
+ function powerpressplayer_build_html5audio($media_url, $EpisodeData=array(), $embed = false )
1240
+ {
1241
+ $player_id = powerpressplayer_get_next_id();
1242
+ $autoplay = false;
1243
+ // Episode Settings
1244
+ if( !empty($EpisodeData['autoplay']) )
1245
+ $autoplay = true;
1246
+ $content = '';
1247
+ if( $embed )
1248
+ {
1249
+ $content .= '<div class="powerpress_player" id="powerpress_player_'. $player_id .'">'.PHP_EOL;
1250
+ $content .= '<audio controls="controls"';
1251
+ $content .=' src="'. $media_url .'"';
1252
+ if( $cover_image )
1253
+ $content .= ' poster="'. $cover_image .'"';
1254
+ if( $autoplay )
1255
+ $content .= ' autoplay="autoplay"';
1256
+ else
1257
+ $content .= ' preload="none"';
1258
+ $content .= '>'.PHP_EOL;
1259
+
1260
+ $content .= powerpressplayer_build_playlink($media_url);
1261
+ $content .= '</audio>'.PHP_EOL;
1262
+ $content .= '</div>'.PHP_EOL;
1263
+ }
1264
+ else
1265
+ {
1266
+ $cover_image = powerpress_get_root_url() . 'play_audio.png';
1267
+ $content .= '<div class="powerpress_player" id="powerpress_player_'. $player_id .'">';
1268
+ $content .= '<a href="'. $media_url .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" onclick="return powerpress_embed_html5a(\''.$player_id.'\',\''.$media_url.'\');" target="_blank">';
1269
+ $content .= '<img src="'. $cover_image .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" alt="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" style="border:0;" />';
1270
+ $content .= '</a>';
1271
+ $content .= "</div>\n";
1272
+
1273
+ if( $autoplay )
1274
+ {
1275
+ $content .= '<script type="text/javascript">'.PHP_EOL;
1276
+ $content .= "powerpress_embed_html5a('{$player_id}','{$media_url}');\n";
1277
+ $content .= "</script>\n";
1278
+ }
1279
+ }
1280
+
1281
+ return $content;
1282
+ }
1283
+
1284
+ /*
1285
+ HTTML 5 Mobile Player
1286
+ */
1287
+ function powerpressplayer_build_html5mobile($media_url, $EpisodeData)
1288
+ {
1289
+ $content = '';
1290
+ $html5 = true;
1291
+ // Special logic, we need to check if we're dealing with Android 2.2 or older, in which case we don't want to use HTML5 audio/video due to controls bug
1292
+ if( preg_match('/android ([\d\.]+)/i', $_SERVER['HTTP_USER_AGENT'], $matches) )
1293
+ {
1294
+ if( !empty($matches[1]) && version_compare($matches[1], "2.3") < 0 )
1295
+ $html5 = false;
1296
+ }
1297
+
1298
+ $extension = powerpressplayer_get_extension($media_url);
1299
+ switch( $extension )
1300
+ {
1301
+ case 'mp4':
1302
+ case 'webm':
1303
+ case 'm4v':
1304
+ case 'ogg':
1305
+ case 'ogv': {
1306
+ // Video
1307
+ if( $html5 )
1308
+ $content .= powerpressplayer_build_html5video($media_url, $EpisodeData, true);
1309
+ else
1310
+ $content .= powerpressplayer_build_playimage($media_url, $EpisodeData, true);
1311
  }; break;
1312
+ case 'mp3':
1313
+ case 'm4a':
1314
+ case 'oga': {
1315
+ // Audio
1316
+ if( $html5 )
1317
+ $content .= powerpressplayer_build_html5audio($media_url, $EpisodeData, true);
1318
+ else
1319
+ $content .= powerpressplayer_build_playimageaudio($media_url, true);
1320
+ }; break;
1321
+ }
1322
+
1323
+ return $content;
1324
+ }
1325
+
1326
+ /*
1327
+ Flow Player Classic
1328
+ */
1329
+ function powerpressplayer_build_flowplayerclassic($media_url, $EpisodeData = array())
1330
+ {
1331
+ // Very important setting, we need to know if the media should auto play or not...
1332
+ $autoplay = false; // (default)
1333
+ if( !empty($EpisodeData['autoplay']) )
1334
+ $autoplay = true;
1335
+ $cover_image = '';
1336
+ $player_width = 400;
1337
+ $player_height = 225;
1338
+ $Settings = get_option('powerpress_general');
1339
+ // Global Settings
1340
+ if( !empty($Settings['player_width']) )
1341
+ $player_width = $Settings['player_width'];
1342
+ if( !empty($Settings['player_height']) )
1343
+ $player_height = $Settings['player_height'];
1344
+ if( !empty($Settings['poster_image']) )
1345
+ $cover_image = $Settings['poster_image'];
1346
+ // Episode Settings
1347
+ if( !empty($EpisodeData['width']) )
1348
+ $player_width = $EpisodeData['width'];
1349
+ if( !empty($EpisodeData['height']) )
1350
+ $player_height = $EpisodeData['height'];
1351
+ if( $EpisodeData['image'] )
1352
+ $cover_image = $EpisodeData['image'];
1353
+
1354
+ $extension = powerpressplayer_get_extension($media_url, $EpisodeData);
1355
+ if( $extension == 'mp3' || $extension == 'm4a' )
1356
+ {
1357
+ // FlowPlayer has differeent sizes for audio than for video
1358
+ $player_width = 320;
1359
+ if( !empty($Settings['player_width_audio']) )
1360
+ $player_width = $Settings['player_width_audio'];
1361
+
1362
+ if( !empty($EpisodeData['width']) && !empty($Settings['player_width_audio']) )
1363
+ $player_width = $EpisodeData['width'];
1364
+
1365
+ $cover_image = ''; // Audio should not have a cover image
1366
+ if( empty($cover_image) )
1367
+ {
1368
+ $player_height = 24;
1369
+ }
1370
+ }
1371
+
1372
+ // Build player...
1373
+ $player_id = powerpressplayer_get_next_id();
1374
+ $content = '';
1375
+ $content .= '<div class="powerpress_player" id="powerpress_player_'. $player_id .'"></div>'.PHP_EOL;
1376
+ $content .= '<script type="text/javascript">'.PHP_EOL;
1377
+ if( !empty($EpisodeData['jquery_autowidth']) )
1378
+ {
1379
+ $player_width = 'jQuery(window).width()';
1380
+ if( preg_match('/(mp4|m4v|ogg|ogv|webm)/i', $extension) )
1381
+ {
1382
+ $player_height = 'jQuery(window).height()';
1383
+ }
1384
+ }
1385
+ $content .= "pp_flashembed(\n";
1386
+ $content .= " 'powerpress_player_{$player_id}',\n";
1387
+ $content .= " {src: '". powerpress_get_root_url() ."FlowPlayerClassic.swf', width: '{$player_width}', height: '{$player_height}', wmode: 'transparent' },\n";
1388
+ if( $cover_image )
1389
+ $content .= " {config: { autoPlay: ". ($autoplay?'true':'false') .", autoBuffering: false, initialScale: 'scale', showFullScreenButton: false, showMenu: false, videoFile: '{$media_url}', splashImageFile: '{$cover_image}', scaleSplash: true, loop: false, autoRewind: true } }\n";
1390
+ else
1391
+ $content .= " {config: { autoPlay: ". ($autoplay?'true':'false') .", autoBuffering: false, initialScale: 'scale', showFullScreenButton: false, showMenu: false, videoFile: '{$media_url}', loop: false, autoRewind: true } }\n";
1392
+ $content .= ");\n";
1393
+ $content .= "</script>\n";
1394
+ return $content;
1395
+ }
1396
+
1397
+
1398
+ function powerpressplayer_build_playimage($media_url, $EpisodeData = array(), $include_div = false)
1399
+ {
1400
+ $content = '';
1401
+ $autoplay = false;
1402
+ if( !empty($EpisodeData['autoplay']) && $EpisodeData['autoplay'] )
1403
+ $autoplay = true;
1404
+ $player_width = 400;
1405
+ $player_height = 225;
1406
+ $cover_image = '';
1407
+ // Global settings
1408
+ $Settings = get_option('powerpress_general');
1409
+ if( !empty($Settings['player_width']) )
1410
+ $player_width = $Settings['player_width'];
1411
+ if( !empty($Settings['player_height']) )
1412
+ $player_height = $Settings['player_height'];
1413
+ if( !empty($Settings['poster_image']) )
1414
+ $cover_image = $Settings['poster_image'];
1415
+ // episode settings
1416
+ if( !empty($EpisodeData['width']) )
1417
+ $player_width = $EpisodeData['width'];
1418
+ if( !empty($EpisodeData['height']) )
1419
+ $player_height = $EpisodeData['height'];
1420
+ if( !empty($EpisodeData['image']) )
1421
+ $cover_image = $EpisodeData['image'];
1422
+
1423
+ if( !$cover_image )
1424
+ $cover_image = powerpress_get_root_url() . 'black.png';
1425
+
1426
+ if( $include_div )
1427
+ $content .= '<div class="powerpress_player" id="powerpress_player_'. powerpressplayer_get_next_id() .'">';
1428
+ $content .= '<a href="'. $media_url .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" target="_blank" style="position: relative;">';
1429
+ $content .= '<img src="'. $cover_image .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" alt="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" style="width: '. $player_width .'px; height: '. $player_height .'px;" />';
1430
+ if(!isset($Settings['poster_play_image']) || $Settings['poster_play_image'] )
1431
+ {
1432
+ $bottom = floor(($player_height/2)-30);
1433
+ if( $bottom < 0 )
1434
+ $bottom = 0;
1435
+ $left = floor(($player_width/2)-30);
1436
+ if( $left < 0 )
1437
+ $left = 0;
1438
+ $content .= '<img src="'. powerpress_get_root_url() .'play_video.png" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" alt="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" style="position: absolute; bottom:'. $bottom .'px; left:'. $left .'px; border:0;" />';
1439
+ }
1440
+ $content .= '</a>';
1441
+ if( $include_div )
1442
+ $content .= "</div>\n";
1443
+ return $content;
1444
+ }
1445
+
1446
+ function powerpressplayer_build_playimageaudio($media_url, $include_div = false)
1447
+ {
1448
+ $content = '';
1449
+ $cover_image = powerpress_get_root_url() . 'play_audio.png';
1450
+ if( !empty($EpisodeData['image']) )
1451
+ $cover_image = $EpisodeData['image'];
1452
+
1453
+ if( $include_div )
1454
+ $content .= '<div class="powerpress_player" id="powerpress_player_'. powerpressplayer_get_next_id() .'">';
1455
+ $content .= '<a href="'. $media_url .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" target="_blank">';
1456
+ $content .= '<img src="'. $cover_image .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" alt="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" style="border:0;" />';
1457
+ $content .= '</a>';
1458
+ if( $include_div )
1459
+ $content .= "</div>\n";
1460
+ return $content;
1461
+ }
1462
+
1463
+ function powerpressplayer_build_playlink($media_url, $include_div = false)
1464
+ {
1465
+ $content = '';
1466
+ if( $include_div )
1467
+ $content .= '<div class="powerpress_player" id="powerpress_player_'. powerpressplayer_get_next_id() .'">';
1468
+ $content .= '<a href="'. $media_url .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" target="_blank">';
1469
+ $content .= htmlspecialchars(POWERPRESS_PLAY_TEXT);
1470
+ $content .= '</a>';
1471
+ if( $include_div )
1472
+ $content .= "</div>\n";
1473
+ return $content;
1474
+ }
1475
+
1476
+ /*
1477
+ 1 pixel out player
1478
+ */
1479
+ function powerpressplayer_build_1pxoutplayer($media_url, $EpisodeData = array())
1480
+ {
1481
+ $content = '';
1482
+ $autoplay = false;
1483
+ if( isset($EpisodeData['autoplay']) && $EpisodeData['autoplay'] )
1484
+ $autoplay = true; // TODO: We need to handle this
1485
+
1486
+ $PlayerSettings = get_option('powerpress_audio-player');
1487
+ if( !$PlayerSettings )
1488
+ {
1489
+ $PlayerSettings = array(
1490
+ 'width'=>'290',
1491
+ 'transparentpagebg' => 'yes',
1492
+ 'lefticon' => '#333333',
1493
+ 'leftbg' => '#CCCCCC',
1494
+ 'bg' => '#E5E5E5',
1495
+ 'voltrack' => '#F2F2F2',
1496
+ 'volslider' => '#666666',
1497
+ 'rightbg' => '#B4B4B4',
1498
+ 'rightbghover' => '#999999',
1499
+ 'righticon' => '#333333',
1500
+ 'righticonhover' => '#FFFFFF',
1501
+ 'loader' => '#009900',
1502
+ 'track' => '#FFFFFF',
1503
+ 'tracker' => '#DDDDDD',
1504
+ 'border' => '#CCCCCC',
1505
+ 'skip' => '#666666',
1506
+ 'text' => '#333333',
1507
+ 'pagebg' => '',
1508
+ 'noinfo'=>'yes',
1509
+ 'rtl' => 'no' );
1510
+ }
1511
+
1512
+ if( $PlayerSettings['titles'] == '' )
1513
+ $PlayerSettings['titles'] = 'Blubrry PowerPress';
1514
+ else if( strtoupper($PlayerSettings['titles']) == __('TRACK', 'powerpress') )
1515
+ unset( $PlayerSettings['titles'] );
1516
+
1517
+ // Set player width
1518
+ if( !isset($PlayerSettings['width']) )
1519
+ $PlayerSettings['width'] = 290;
1520
+ if( !empty($EpisodeData['width']) && is_numeric($EpisodeData['width']) )
1521
+ $PlayerSettings['width'] = $EpisdoeData['width'];
1522
+
1523
+ $transparency = '<param name="wmode" value="transparent" />';
1524
+ $PlayerSettings['transparentpagebg'] = 'yes';
1525
+ if( !empty($PlayerSettings['pagebg']) )
1526
+ {
1527
+ $transparency = '<param name="bgcolor" value="'.$PlayerSettings['pagebg'].'" />';
1528
+ $PlayerSettings['transparentpagebg'] = 'no';
1529
+ }
1530
+
1531
+ $flashvars ='';
1532
+ while( list($key,$value) = each($PlayerSettings) )
1533
+ {
1534
+ $flashvars .= '&amp;'. $key .'='. preg_replace('/\#/','',$value);
1535
+ }
1536
+
1537
+ if( $autoplay )
1538
+ {
1539
+ $flashvars .= '&amp;autostart=yes';
1540
+ }
1541
+
1542
+ // TODO: Add 1 px out audio-player player here
1543
+ $player_id = powerpressplayer_get_next_id();
1544
+ if( empty($EpisodeData['nodiv']) )
1545
+ $content .= '<div class="powerpress_player" id="powerpress_player_'. $player_id .'">';
1546
+ $content .= '<object type="application/x-shockwave-flash" data="'.powerpress_get_root_url().'audio-player.swf" id="'.$player_id.'" height="24" width="'. $PlayerSettings['width'] .'">'.PHP_EOL;
1547
+ $content .= '<param name="movie" value="'.powerpress_get_root_url().'audio-player.swf" />'.PHP_EOL;
1548
+ $content .= '<param name="FlashVars" value="playerID='.$player_id.'&amp;soundFile='.urlencode($media_url).$flashvars.'" />'.PHP_EOL;
1549
+ $content .= '<param name="quality" value="high" />'.PHP_EOL;
1550
+ $content .= '<param name="menu" value="false" />'.PHP_EOL;
1551
+ $content .= '<param name="wmode" value="transparent" />'.PHP_EOL;
1552
+ $content .= powerpressplayer_build_html5audio($media_url, $EpisodeData, true);
1553
+ $content .= '</object>'.PHP_EOL;
1554
+ if( empty($EpisodeData['nodiv']) )
1555
+ $content .= '</div>'.PHP_EOL;
1556
+
1557
+ return $content;
1558
+ }
1559
+
1560
+ /*
1561
+ Flash Mp3 player Maxi
1562
+ */
1563
+ function powerpressplayer_build_flashmp3maxi($media_url, $EpisodeData = array())
1564
+ {
1565
+ $autoplay = false;
1566
+ if( isset($EpisodeData['autoplay']) && $EpisodeData['autoplay'] )
1567
+ $autoplay = true; // TODO: We need to handle this
1568
+
1569
+ $PlayerSettings = get_option('powerpress_flashmp3-maxi');
1570
+ $keys = array('bgcolor1','bgcolor2','bgcolor','textcolor','buttoncolor','buttonovercolor','showstop','showinfo','showvolume','height','width','showloading','buttonwidth','volume','showslider');
1571
+
1572
+ //set PlayerSettings as blank array for initial setup
1573
+ //This keeps the foreach loop from returning an error
1574
+ if( empty($PlayerSettings) )
1575
+ {
1576
+ $PlayerSettings = array(
1577
+ 'bgcolor1'=>'#7c7c7c',
1578
+ 'bgcolor2'=>'#333333',
1579
+ 'textcolor' => '#FFFFFF',
1580
+ 'buttoncolor' => '#FFFFFF',
1581
+ 'buttonovercolor' => '#FFFF00',
1582
+ 'showstop' => '0',
1583
+ 'showinfo' => '0',
1584
+ 'showvolume' => '1',
1585
+ 'height' => '20',
1586
+ 'width' => '200',
1587
+ 'showloading' => 'autohide',
1588
+ 'buttonwidth' => '26',
1589
+ 'volume' => '100',
1590
+ 'showslider' => '1',
1591
+ 'slidercolor1'=>'#cccccc',
1592
+ 'slidercolor2'=>'#888888',
1593
+ 'sliderheight' => '10',
1594
+ 'sliderwidth' => '20',
1595
+ 'loadingcolor' => '#FFFF00',
1596
+ 'volumeheight' => '6',
1597
+ 'volumewidth' => '30',
1598
+ 'sliderovercolor' => '#eeee00');
1599
+ }
1600
+
1601
+ $flashvars = '';
1602
+ $flashvars .= "mp3=" . urlencode($media_url);
1603
+ if( $autoplay )
1604
+ $flashvars .= '&amp;autoplay=1';
1605
+
1606
+ //set non-blank options without dependencies as flash variables for preview
1607
+ foreach($keys as $key)
1608
+ {
1609
+ if( !empty($PlayerSettings[$key]) )
1610
+ {
1611
+ $flashvars .= '&amp;'. $key .'='. preg_replace('/\#/','',$PlayerSettings[''.$key.'']);
1612
+ }
1613
+ }
1614
+
1615
+ //set slider dependencies
1616
+ if( !empty($PlayerSettings['showslider']) ) // IF not zero
1617
+ {
1618
+ if( !empty($PlayerSettings['sliderheight']) ) {
1619
+ $flashvars .= '&amp;sliderheight='. $PlayerSettings['sliderheight'];
1620
+ }
1621
+ if( !empty($PlayerSettings['sliderwidth']) ) {
1622
+ $flashvars .= '&amp;sliderwidth='. $PlayerSettings['sliderwidth'];
1623
+ }
1624
+ if( !empty($PlayerSettings['sliderovercolor']) ){
1625
+ $flashvars .= '&amp;sliderovercolor='. preg_replace('/\#/','',$PlayerSettings['sliderovercolor']);
1626
+ }
1627
+ }
1628
+
1629
+ //set volume dependencies
1630
+ if($PlayerSettings['showvolume'] != "0")
1631
+ {
1632
+ if( !empty($PlayerSettings['volumeheight']) ) {
1633
+ $flashvars .= '&amp;volumeheight='. $PlayerSettings['volumeheight'];
1634
+ }
1635
+ if( !empty($PlayerSettings['volumewidth']) ) {
1636
+ $flashvars .= '&amp;volumewidth='. $PlayerSettings['volumewidth'];
1637
+ }
1638
+ }
1639
+
1640
+ //set autoload dependencies
1641
+ if($PlayerSettings['showloading'] != "never")
1642
+ {
1643
+ if( !empty($PlayerSettings['loadingcolor']) ) {
1644
+ $flashvars .= '&amp;loadingcolor='. preg_replace('/\#/','',$PlayerSettings['loadingcolor']);
1645
+ }
1646
+ }
1647
+
1648
+ //set default width for object
1649
+ if( empty($PlayerSettings['width']) )
1650
+ $width = '200';
1651
+ else
1652
+ $width = $PlayerSettings['width'];
1653
+ if( !empty($EpisodeData['width']) && is_numeric($EpisodeData['width']))
1654
+ $width = $EpisodeData['width'];
1655
+
1656
+ if( empty($PlayerSettings['height']) )
1657
+ $height = '20';
1658
+ else
1659
+ $height = $PlayerSettings['height'];
1660
+ if( !empty($EpisodeData['height']) && is_numeric($EpisodeData['height']) )
1661
+ $height = $EpisodeData['height'];
1662
+
1663
+ //set background transparency
1664
+ if( !empty($PlayerSettings['bgcolor']) )
1665
+ $transparency = '<param name="bgcolor" value="'. $PlayerSettings['bgcolor'] .'" />';
1666
+ else
1667
+ $transparency = '<param name="wmode" value="transparent" />';
1668
+
1669
+ // Add flashmp3-maxi player here
1670
+ $player_id = powerpressplayer_get_next_id();
1671
+ $content = '';
1672
+ $content .= '<div class="powerpress_player" id="powerpress_player_'. $player_id .'">'.PHP_EOL;
1673
+ $content .= '<object type="application/x-shockwave-flash" data="'. powerpress_get_root_url().'player_mp3_maxi.swf" id="player_mp3_maxi_'.$player_id.'" width="'. $width.'" height="'. $height .'">'.PHP_EOL;
1674
+ $content .= '<param name="movie" value="'. powerpress_get_root_url().'player_mp3_maxi.swf" />'.PHP_EOL;
1675
+ $content .= $transparency.PHP_EOL;
1676
+ $content .= '<param name="FlashVars" value="'. $flashvars .'" />'.PHP_EOL;
1677
+ $content .= powerpressplayer_build_html5audio($media_url, $EpisodeData, true);
1678
+ $content .= '</object>'.PHP_EOL;
1679
+ $content .= '</div>'.PHP_EOL;
1680
+ return $content;
1681
+ }
1682
+
1683
+ /*
1684
+ Audio Play player
1685
+ */
1686
+ function powerpressplayer_build_audioplay($media_url, $EpisodeData = array())
1687
+ {
1688
+ $autoplay = false;
1689
+ if( isset($EpisodeData['autoplay']) && $EpisodeData['autoplay'] )
1690
+ $autoplay = true;
1691
+
1692
+ $PlayerSettings = get_option('powerpress_audioplay');
1693
+ if( empty($PlayerSettings) )
1694
+ {
1695
+ $PlayerSettings = array(
1696
+ 'bgcolor' => '',
1697
+ 'buttondir' => 'negative',
1698
+ 'mode' => 'playpause');
1699
  }
1700
 
1701
+ $width = $height = (strstr($PlayerSettings['buttondir'], 'small')===false?30:15);
1702
+
1703
+ // Set standard variables for player
1704
+ $flashvars = 'file='.urlencode($media_url) ;
1705
+ $flashvars .= '&amp;repeat=1';
1706
+ if( $autoplay )
1707
+ $flashvars .= '&amp;auto=yes';
1708
+
1709
+ if( empty($PlayerSettings['bgcolor']) )
1710
+ {
1711
+ $flashvars .= "&amp;usebgcolor=no";
1712
+ $transparency = '<param name="wmode" value="transparent" />';
1713
+ $htmlbg = "";
1714
+ }
1715
+ else
1716
+ {
1717
+ $flashvars .= "&amp;bgcolor=". preg_replace('/\#/','0x',$PlayerSettings['bgcolor']);
1718
+ $transparency = '<param name="bgcolor" value="'. $PlayerSettings['bgcolor']. '" />';
1719
+ $htmlbg = 'bgcolor="'. $PlayerSettings['bgcolor'].'"';
1720
+ }
1721
+
1722
+ if( empty($PlayerSettings['buttondir']) )
1723
+ $flashvars .= "&amp;buttondir=".powerpress_get_root_url()."buttons/negative";
1724
+ else
1725
+ $flashvars .= "&amp;buttondir=".powerpress_get_root_url().'buttons/'.$PlayerSettings['buttondir'];
1726
+
1727
+ $flashvars .= '&amp;mode='. $PlayerSettings['mode'];
1728
+
1729
+ // Add audioplay player here
1730
+ $player_id = powerpressplayer_get_next_id();
1731
+ $content = '';
1732
+ $content .= '<div class="powerpress_player" id="powerpress_player_'. $player_id .'">';
1733
+ $content .= '<object type="application/x-shockwave-flash" width="'. $width .'" height="'. $height .'" id="audioplay_'.$player_id.'" data="'. powerpress_get_root_url().'audioplay.swf?'.$flashvars.'">'.PHP_EOL;
1734
+ $content .= '<param name="movie" value="'. powerpress_get_root_url().'audioplay.swf?'.$flashvars.'" />'.PHP_EOL;
1735
+ $content .= '<param name="quality" value="high" />'.PHP_EOL;
1736
+ $content .= $transparency.PHP_EOL;
1737
+ $content .= '<param name="FlashVars" value="'.$flashvars.'" />'.PHP_EOL;
1738
+ $content .= '<embed src="'. powerpress_get_root_url().'audioplay.swf?'.$flashvars.'" quality="high" width="30" height="30" type="application/x-shockwave-flash">'.PHP_EOL;
1739
+ $content .= powerpressplayer_build_html5audio($media_url, $EpisodeData, true);
1740
+ $content .= "</embed>\n </object>\n";
1741
+ $content .= "</div>\n";
1742
  return $content;
1743
  }
1744
 
1745
+ /*
1746
+ Simple Flash player
1747
+ */
1748
+ function powerpressplayer_build_simpleflash($media_url, $EpisodeData = array())
1749
+ {
1750
+ $autoplay = false;
1751
+ if( isset($EpisodeData['autoplay']) && $EpisodeData['autoplay'] )
1752
+ $autoplay = true; // TODO: We need to handle this
1753
+
1754
+ $player_id = powerpressplayer_get_next_id();
1755
+ $content = '';
1756
+ $content .= '<div class="powerpress_player" id="powerpress_player_'. $player_id .'">';
1757
+ $content .= '<object type="application/x-shockwave-flash" data="'. powerpress_get_root_url() .'simple_mp3.swf" id="simple_mp3_'.$player_id.'" width="150" height="50">';
1758
+ $content .= '<param name="movie" value="'. powerpress_get_root_url().'simple_mp3.swf" />';
1759
+ $content .= '<param name="wmode" value="transparent" />';
1760
+ $content .= '<param name="FlashVars" value="'. get_bloginfo('url') .'?url='. urlencode($media_url).'&amp;autostart='. ($autoplay?'true':'false') .'" />';
1761
+ $content .= '<param name="quality" value="high" />';
1762
+ $content .= '<embed wmode="transparent" src="'. get_bloginfo('url') .'?url='.urlencode($media_url).'&amp;autostart='. ($autoplay?'true':'false') .'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="150" height="50">';
1763
+ $content .= powerpressplayer_build_html5audio($media_url, $EpisodeData, true);
1764
+ $content .= '</embed>';
1765
+ $content .= '</object>';
1766
+ $content .= "</div>\n";
1767
+ return $content;
1768
+ }
1769
+
1770
+ /*
1771
+ VideoJS for PowerPress 3.0
1772
+ */
1773
+ function powerpressplayer_build_videojs($media_url, $EpisodeData = array())
1774
+ {
1775
+
1776
+
1777
+ return $content;
1778
+ }
1779
 
 
 
1780
 
1781
  ?>
powerpress.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Blubrry PowerPress
4
  Plugin URI: http://www.blubrry.com/powerpress/
5
  Description: <a href="http://www.blubrry.com/powerpress/" target="_blank">Blubrry PowerPress</a> adds podcasting support to your blog. Features include: media player, 3rd party statistics, iTunes integration, Blubrry Services (Media Statistics and Hosting) integration and a lot more.
6
- Version: 1.0.13
7
  Author: Blubrry
8
  Author URI: http://www.blubrry.com/
9
  Change Log:
@@ -21,7 +21,7 @@ Credits:
21
  flashembed(), License: MIT by Tero Piirainen (tipiirai [at] gmail.com)
22
  Note: code found at bottom of player.js
23
 
24
- Copyright 2008-2010 RawVoice Inc. (http://www.rawvoice.com)
25
 
26
  License: GPL (http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt)
27
 
@@ -33,7 +33,16 @@ if( !function_exists('add_action') )
33
  die("access denied.");
34
 
35
  // WP_PLUGIN_DIR (REMEMBER TO USE THIS DEFINE IF NEEDED)
36
- define('POWERPRESS_VERSION', '1.0.13' );
 
 
 
 
 
 
 
 
 
37
 
38
  /////////////////////////////////////////////////////
39
  // The following define options should be placed in your
@@ -82,15 +91,6 @@ if( !defined('POWERPRESS_MOBILE_REGEX') )
82
 
83
  $powerpress_feed = NULL; // DO NOT CHANGE
84
 
85
-
86
- if ( !defined('POWERPRESS_ABSPATH') )
87
- define('POWERPRESS_ABSPATH', dirname(__FILE__) );
88
-
89
- // Translation support loaded:
90
- load_plugin_textdomain('powerpress', // domain / keyword name of plugin
91
- POWERPRESS_ABSPATH .'/languages', // Absolute path
92
- basename(POWERPRESS_ABSPATH).'/languages' ); // relative path in plugins folder
93
-
94
  function powerpress_content($content)
95
  {
96
  global $post, $g_powerpress_excerpt_post_id;
@@ -113,6 +113,10 @@ function powerpress_content($content)
113
  // PowerPress settings:
114
  $GeneralSettings = get_option('powerpress_general');
115
 
 
 
 
 
116
  if( @$GeneralSettings['player_aggressive'] )
117
  {
118
  if( strstr($content, '<!--powerpress_player-->') !== false )
@@ -240,12 +244,13 @@ function powerpress_content($content)
240
  if( isset($EpisodeData['image']) && $EpisodeData['image'] != '' )
241
  $image = $EpisodeData['image'];
242
 
243
- $new_content .= apply_filters('powerpress_player', '', powerpress_add_flag_to_redirect_url($EpisodeData['url'], 'p'), array('feed'=>$feed_slug, 'image'=>$image, 'type'=>$EpisodeData['type']) );
244
  }
245
  }
246
 
247
  if( !isset($EpisodeData['no_links']) )
248
- $new_content .= powerpress_get_player_links($post->ID, $feed_slug, $EpisodeData);
 
249
  }
250
  }
251
  }
@@ -284,7 +289,7 @@ function powerpress_header()
284
  ?>
285
  <script type="text/javascript">
286
  <?php
287
- $new_window_width = 320;
288
  $new_window_height = 240;
289
 
290
  if( isset($Powerpress['new_window_width']) && $Powerpress['new_window_width'] > 100 )
@@ -293,6 +298,7 @@ function powerpress_header()
293
  $new_window_height = $Powerpress['new_window_height'];
294
  ?>
295
  function powerpress_pinw(pinw){window.open('<?php echo get_bloginfo('url'); ?>/?powerpress_pinw='+pinw, 'PowerPressPlayer','toolbar=0,status=0,resizable=1,width=<?php echo ($new_window_width + 40); ?>,height=<?php echo ($new_window_height + 80); ?>'); return false;}
 
296
  </script>
297
  <?php
298
  }
@@ -307,6 +313,10 @@ function powerpress_rss2_ns()
307
 
308
  // Okay, lets add the namespace
309
  echo 'xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"'.PHP_EOL;
 
 
 
 
310
  }
311
 
312
  add_action('rss2_ns', 'powerpress_rss2_ns');
@@ -345,20 +355,7 @@ function powerpress_rss2_head()
345
  $General = get_option('powerpress_general');
346
 
347
  // We made it this far, lets write stuff to the feed!
348
- echo '<!-- podcast_generator="Blubrry PowerPress/'. POWERPRESS_VERSION .'" ';
349
- if( $General['advanced_mode'] == 0 )
350
- echo 'mode="simple" ';
351
- else
352
- echo 'mode="advanced" ';
353
-
354
- if( $General['episode_box_mode'] == 0 )
355
- echo 'entry="normal" ';
356
- else if( $General['episode_box_mode'] == 1)
357
- echo 'entry="simple" ';
358
- else
359
- echo 'entry="advanced" ';
360
-
361
- echo '-->'.PHP_EOL;
362
 
363
  // add the itunes:new-feed-url tag to feed
364
  if( powerpress_is_custom_podcast_feed() )
@@ -445,6 +442,7 @@ function powerpress_rss2_head()
445
  echo "\t".'</image>' . PHP_EOL;
446
  }
447
 
 
448
  // Handle iTunes categories
449
  $Categories = powerpress_itunes_categories();
450
  $Cat1 = false; $Cat2 = false; $Cat3 = false;
@@ -540,6 +538,17 @@ function powerpress_rss2_head()
540
  }
541
  }
542
  // End Handle iTunes categories
 
 
 
 
 
 
 
 
 
 
 
543
  }
544
 
545
  add_action('rss2_head', 'powerpress_rss2_head');
@@ -578,6 +587,14 @@ function powerpress_rss2_item()
578
  if( !$EpisodeData || !$EpisodeData['url'] )
579
  return;
580
 
 
 
 
 
 
 
 
 
581
  $author = $powerpress_feed['itunes_talent_name'];
582
  if( isset($powerpress_feed['itunes_author_post']) )
583
  $author = get_the_author();
@@ -588,26 +605,23 @@ function powerpress_rss2_item()
588
  $keywords = false;
589
  $block = false;
590
 
591
- if( $powerpress_feed['itunes_custom'] )
 
 
 
 
 
 
592
  {
593
- if( isset( $EpisodeData['summary'] ) && strlen($EpisodeData['summary']) > 1 )
594
- $summary = $EpisodeData['summary'];
595
- if( isset( $EpisodeData['subtitle'] ) && strlen($EpisodeData['subtitle']) > 1 )
596
- $subtitle = $EpisodeData['subtitle'];
597
- if( isset( $EpisodeData['keywords'] ) && strlen($EpisodeData['keywords']) > 1 )
598
- $keywords = $EpisodeData['keywords'];
599
- if( isset( $EpisodeData['explicit'] ) && is_numeric($EpisodeData['explicit']) )
600
- {
601
- $explicit_array = array("no", "yes", "clean");
602
- $explicit = $explicit_array[$EpisodeData['explicit']];
603
- }
604
-
605
- // Code for future use:
606
- if( !empty( $EpisodeData['author'] ) )
607
- $author = $EpisodeData['author'];
608
- if( !empty( $EpisodeData['block'] ) )
609
- $block = 'yes';
610
  }
 
 
 
 
 
 
611
 
612
  if( $custom_enclosure ) // We need to add the enclosure tag here...
613
  {
@@ -681,7 +695,36 @@ function powerpress_rss2_item()
681
  echo "\t\t<itunes:duration>" . ltrim($EpisodeData['duration'], '0:') . '</itunes:duration>'.PHP_EOL;
682
 
683
  if( $block && $block == 'yes' )
684
- echo "\t\t<itunes:block>yes</itunes:block>\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
685
  }
686
 
687
  add_action('rss2_item', 'powerpress_rss2_item');
@@ -735,7 +778,7 @@ function powerpress_filter_rss_enclosure($content)
735
  }
736
 
737
 
738
- add_filter('rss_enclosure', 'powerpress_filter_rss_enclosure');
739
 
740
  function powerpress_bloginfo_rss($content, $field = '')
741
  {
@@ -950,11 +993,11 @@ function powerpress_init()
950
  {
951
  $GeneralSettings = get_option('powerpress_general');
952
 
953
- if( !empty($GeneralSettings['player_options']) )
 
954
  require_once( POWERPRESS_ABSPATH.'/powerpress-player.php');
955
-
956
- if( isset($_GET['powerpress_pinw']) )
957
- powerpress_do_pinw($_GET['powerpress_pinw'], !empty($GeneralSettings['process_podpress']) );
958
 
959
  if( defined('PODPRESS_VERSION') || isset($GLOBALS['podcasting_player_id']) || isset($GLOBALS['podcast_channel_active']) || defined('PODCASTING_VERSION') )
960
  return false; // Another podcasting plugin is enabled...
@@ -963,7 +1006,6 @@ function powerpress_init()
963
  if( !empty($GeneralSettings['process_podpress']) )
964
  {
965
  powerpress_podpress_redirect_check();
966
- add_shortcode('display_podcast', 'powerpress_shortcode_handler');
967
  }
968
 
969
  // Add the podcast feeds;
@@ -977,30 +1019,7 @@ function powerpress_init()
977
  }
978
  }
979
 
980
- // FeedSmith support...
981
- /*
982
- // This logic need not apply anymore
983
- if( isset($_GET['feed']) )
984
- {
985
- switch($_GET['feed'])
986
- {
987
- case '':
988
- case 'feed':
989
- case 'atom':
990
- case 'rss':
991
- case 'comments-rss2':
992
- case 'rss2': break; // Let FeedSmith redirect these feeds if it wants
993
- default: { // Otherwise lets remove FeedSmith
994
- if( has_action('init', 'ol_check_url') !== false )
995
- remove_action('init', 'ol_check_url');
996
- }
997
- }
998
- }
999
- */
1000
- if( defined('POWERPRESS_ENQUEUE_SCRIPTS') )
1001
- {
1002
- wp_enqueue_script( 'powerpress-player', powerpress_get_root_url() .'player.js');
1003
- }
1004
  }
1005
 
1006
  add_action('init', 'powerpress_init', -100); // We need to add the feeds before other plugins start screwing with them
@@ -1042,7 +1061,6 @@ function powerpress_load_general_feed_settings()
1042
 
1043
  $powerpress_feed = array();
1044
  $powerpress_feed['is_custom'] = true;
1045
- $powerpress_feed['itunes_custom'] = ($GeneralSettings['episode_box_mode'] == 2);
1046
  $powerpress_feed['category'] = $cat_ID;
1047
  $powerpress_feed['process_podpress'] = !empty($GeneralSettings['process_podpress']); // Category feeds could originate from Podpress
1048
  $powerpress_feed['rss_language'] = ''; // default, let WordPress set the language
@@ -1063,6 +1081,9 @@ function powerpress_load_general_feed_settings()
1063
  $powerpress_feed['itunes_author_post'] = true;
1064
  if( $Feed['rss_language'] != '' )
1065
  $powerpress_feed['rss_language'] = $Feed['rss_language'];
 
 
 
1066
  return;
1067
  }
1068
 
@@ -1075,9 +1096,6 @@ function powerpress_load_general_feed_settings()
1075
 
1076
  $powerpress_feed = array();
1077
  $powerpress_feed['is_custom'] = true;
1078
- $powerpress_feed['itunes_custom'] = false;
1079
- if( isset($GeneralSettings['episode_box_mode']) && $GeneralSettings['episode_box_mode'] == 2 )
1080
- $powerpress_feed['itunes_custom'] = (@$GeneralSettings['episode_box_mode'] == 2);
1081
  $powerpress_feed['feed-slug'] = $feed_slug;
1082
  $powerpress_feed['process_podpress'] = ($feed_slug=='podcast'? !empty($GeneralSettings['process_podpress']): false); // We don't touch podpress data for custom feeds
1083
  $powerpress_feed['rss_language'] = ''; // RSS language should be set by WordPress by default
@@ -1102,8 +1120,13 @@ function powerpress_load_general_feed_settings()
1102
  $powerpress_feed['itunes_author_post'] = true;
1103
  if( !empty($Feed['rss_language']) )
1104
  $powerpress_feed['rss_language'] = $Feed['rss_language'];
 
 
1105
  return;
1106
  }
 
 
 
1107
 
1108
  // We fell this far,we must be in simple mode or the user never saved customized their custom feed settings
1109
  switch( $FeedSettingsBasic['apply_to'] )
@@ -1131,9 +1154,6 @@ function powerpress_load_general_feed_settings()
1131
  {
1132
  $powerpress_feed = array(); // Only store what's needed for each feed item
1133
  $powerpress_feed['is_custom'] = false; // ($feed_slug == 'podcast'?true:false);
1134
- $powerpress_feed['itunes_custom'] = false;
1135
- if( isset($GeneralSettings['episode_box_mode']) && $GeneralSettings['episode_box_mode'] == 2)
1136
- $powerpress_feed['itunes_custom'] = true;
1137
  $powerpress_feed['feed-slug'] = $feed_slug;
1138
  $powerpress_feed['process_podpress'] = !empty($GeneralSettings['process_podpress']); // We don't touch podpress data for custom feeds
1139
  $powerpress_feed['default_url'] = '';
@@ -1156,6 +1176,8 @@ function powerpress_load_general_feed_settings()
1156
  if( !empty($FeedSettingsBasic['itunes_author_post']) )
1157
  $powerpress_feed['itunes_author_post'] = true;
1158
  $powerpress_feed['rss_language'] = ''; // Cannot set the language setting in simple mode
 
 
1159
  }; break;
1160
  // All other cases we let fall through
1161
  }
@@ -1224,7 +1246,7 @@ function powerpress_posts_where($where)
1224
 
1225
  // Include Podpress data if exists...
1226
  if( !empty($powerpress_feed['process_podpress']) && get_query_var('feed') == 'podcast' )
1227
- $where .= " OR {$wpdb->postmeta}.meta_key = 'podPressMedia' ";
1228
 
1229
  $where .= ") ";
1230
  }
@@ -1289,329 +1311,9 @@ function powerpress_future_to_publish($post)
1289
 
1290
  add_action('future_to_publish', 'powerpress_future_to_publish');
1291
 
1292
- function powerpress_player_filter($content, $media_url, $ExtraData = array() )
1293
- {
1294
- global $g_powerpress_player_id;
1295
- if( !isset($g_powerpress_player_id) )
1296
- $g_powerpress_player_id = rand(0, 10000);
1297
- else
1298
- $g_powerpress_player_id++;
1299
-
1300
- // Very important setting, we need to know if the media should auto play or not...
1301
- $autoplay = false; // (default)
1302
- if( isset($ExtraData['autoplay']) && $ExtraData['autoplay'] )
1303
- $autoplay = true;
1304
- $cover_image = '';
1305
- if( $ExtraData['image'] )
1306
- $cover_image = $ExtraData['image'];
1307
-
1308
- // Based on $ExtraData, we can determine which type of player to handle here...
1309
- $Settings = get_option('powerpress_general');
1310
- if( !empty($Settings['display_player_disable_mobile']) && powerpress_is_mobile_client() )
1311
- return $content; // lets not add a player for this situation
1312
-
1313
- if( !isset($Settings['player_function']) )
1314
- $Settings['player_function'] = 1;
1315
- $player_width = 320;
1316
- $player_height = 240;
1317
- if( isset($Settings['player_width']) && $Settings['player_width'] )
1318
- $player_width = $Settings['player_width'];
1319
- if( isset($Settings['player_height']) && $Settings['player_height'] )
1320
- $player_height = $Settings['player_height'];
1321
-
1322
- // Used with some types
1323
- //$content_type = powerpress_get_contenttype($media_url);
1324
-
1325
- $parts = pathinfo($media_url);
1326
- // Hack to use the audio/mp3 content type to set extension to mp3, some folks use tinyurl.com to mp3 files which remove the file extension...
1327
- // This hack only covers mp3s.
1328
- if( isset($EpisodeData['type']) && $EpisodeData['type'] == 'audio/mpeg' && $parts['extension'] != 'mp3' )
1329
- $parts['extension'] = 'mp3';
1330
-
1331
- if( !defined('POWERPRESS_PLAYER') )
1332
- $Settings['player'] = 'default'; // Use the defaul player in case the POWERPRESS_PLAYER is not defined
1333
-
1334
- switch( strtolower($parts['extension']) )
1335
- {
1336
- // PDFs:
1337
- case 'pdf': {
1338
- return $content; // We don't add a player for PDFs!
1339
- }; break;
1340
-
1341
- // Flash Player:
1342
- case 'mp3':
1343
-
1344
- // FlowPlayer has differeent sizes for audio than for video
1345
- if( isset($Settings['player_width_audio']) && $Settings['player_width_audio'] )
1346
- $player_width = $Settings['player_width_audio'];
1347
- if( $cover_image == '' )
1348
- $player_height = 24;
1349
-
1350
- // Check if we are using a custom flash player...
1351
- if( isset($Settings['player']) && $Settings['player'] != 'default' ) // If we are using some other flash player than the default flash player
1352
- return $content;
1353
-
1354
- case 'flv': {
1355
-
1356
- // Okay we are supposed to use FlowPlayerClassic...
1357
- $content .= '<div class="powerpress_player" id="powerpress_player_'. $g_powerpress_player_id .'"></div>'.PHP_EOL;
1358
- $content .= '<script type="text/javascript">'.PHP_EOL;
1359
- $content .= "pp_flashembed(\n";
1360
- $content .= " 'powerpress_player_{$g_powerpress_player_id}',\n";
1361
- $content .= " {src: '". powerpress_get_root_url() ."FlowPlayerClassic.swf', width: {$player_width}, height: {$player_height}, wmode: 'transparent' },\n";
1362
- if( $cover_image ) //
1363
- $content .= " {config: { autoPlay: ". ($autoplay?'true':'false') .", autoBuffering: false, initialScale: 'scale', showFullScreenButton: false, showMenu: false, videoFile: '{$media_url}', splashImageFile: '{$cover_image}', scaleSplash: true, loop: false, autoRewind: true } }\n";
1364
- else
1365
- $content .= " {config: { autoPlay: ". ($autoplay?'true':'false') .", autoBuffering: false, initialScale: 'scale', showFullScreenButton: false, showMenu: false, videoFile: '{$media_url}', loop: false, autoRewind: true } }\n";
1366
- $content .= ");\n";
1367
- $content .= "</script>\n";
1368
-
1369
- }; break;
1370
-
1371
- // Quicktime:
1372
- case 'm4v':
1373
- case 'm4a':
1374
- case 'avi':
1375
- case 'mpg':
1376
- case 'mpeg':
1377
- case 'mp4':
1378
- case 'm4b':
1379
- case 'm4r':
1380
- case 'qt':
1381
- case 'mov': {
1382
-
1383
- $GeneralSettings = get_option('powerpress_general');
1384
- if( !isset($GeneralSettings['player_scale']) )
1385
- $GeneralSettings['player_scale'] = 'tofit';
1386
-
1387
- // If there is no cover image specified, lets use the default...
1388
- if( $cover_image == '' )
1389
- $cover_image = powerpress_get_root_url() . 'play_video_default.jpg';
1390
-
1391
- if( $autoplay )
1392
- {
1393
- $content .= '<div class="powerpress_player" id="powerpress_player_'. $g_powerpress_player_id .'"></div>'.PHP_EOL;
1394
- $content .= '<script type="text/javascript">'.PHP_EOL;
1395
- $content .= "powerpress_embed_quicktime('powerpress_player_{$g_powerpress_player_id}', '{$media_url}', {$player_width}, {$player_height}, '{$GeneralSettings['player_scale']}');\n";
1396
- $content .= "</script>\n";
1397
- }
1398
- else
1399
- {
1400
- $content .= '<div class="powerpress_player" id="powerpress_player_'. $g_powerpress_player_id .'">'.PHP_EOL;
1401
- $content .= '<a href="'. $media_url .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" onclick="';
1402
- $content .= "return powerpress_embed_quicktime('powerpress_player_{$g_powerpress_player_id}', '{$media_url}', {$player_width}, {$player_height}, '{$GeneralSettings['player_scale']}' );";
1403
- $content .= '">';
1404
- $content .= '<img src="'. $cover_image .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" alt="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" />';
1405
- $content .= '</a>';
1406
- $content .= "</div>\n";
1407
- }
1408
-
1409
- }; break;
1410
-
1411
- // Windows Media:
1412
- case 'wma':
1413
- case 'wmv':
1414
- case 'asf': {
1415
-
1416
- $content .= '<div class="powerpress_player" id="powerpress_player_'. $g_powerpress_player_id .'">';
1417
- $firefox = (stristr($_SERVER['HTTP_USER_AGENT'], 'firefox') !== false );
1418
-
1419
- if( (!$cover_image && !$firefox ) || $autoplay ) // if we don't have a cover image or we're supposed to auto play the media anyway...
1420
- {
1421
- $content .= '<object id="winplayer" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="'. $player_width .'" height="'. $player_height .'" standby="..." type="application/x-oleobject">';
1422
- $content .= ' <param name="url" value="'. $media_url .'" />';
1423
- $content .= ' <param name="AutoStart" value="'. ($autoplay?'true':'false') .'" />';
1424
- $content .= ' <param name="AutoSize" value="true" />';
1425
- $content .= ' <param name="AllowChangeDisplaySize" value="true" />';
1426
- $content .= ' <param name="standby" value="Media is loading..." />';
1427
- $content .= ' <param name="AnimationAtStart" value="true" />';
1428
- $content .= ' <param name="scale" value="aspect" />';
1429
- $content .= ' <param name="ShowControls" value="true" />';
1430
- $content .= ' <param name="ShowCaptioning" value="false" />';
1431
- $content .= ' <param name="ShowDisplay" value="false" />';
1432
- $content .= ' <param name="ShowStatusBar" value="false" />';
1433
- $content .= ' <embed type="application/x-mplayer2" src="'. $media_url .'" width="'. $player_width .'" height="'. $player_height .'" scale="ASPECT" autostart="'. ($autoplay?'1':'0') .'" ShowDisplay="0" ShowStatusBar="0" autosize="1" AnimationAtStart="1" AllowChangeDisplaySize="1" ShowControls="1"></embed>';
1434
- $content .= '</object>';
1435
- }
1436
- else
1437
- {
1438
- if( $cover_image == '' )
1439
- $cover_image = powerpress_get_root_url() . 'play_video_default.jpg';
1440
-
1441
- $content .= '<a href="'. $media_url .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" onclick="';
1442
- $content .= "return powerpress_embed_winplayer('powerpress_player_{$g_powerpress_player_id}', '{$media_url}', {$player_width}, {$player_height} );";
1443
- $content .= '">';
1444
- $content .= '<img src="'. $cover_image .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" alt="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" />';
1445
- $content .= '</a>';
1446
- }
1447
-
1448
- if( $firefox )
1449
- {
1450
- $content .= '<p style="font-size: 85%;margin-top:0;">'. __('Best viewed with', 'powerpress');
1451
- $content .= ' <a href="http://support.mozilla.com/en-US/kb/Using+the+Windows+Media+Player+plugin+with+Firefox#Installing_the_plugin" target="_blank">';
1452
- $content .= __('Windows Media Player plugin for Firefox', 'powerpress') .'</a></p>';
1453
- }
1454
-
1455
- $content .= "</div>\n";
1456
-
1457
- }; break;
1458
-
1459
- // Flash:
1460
- case 'swf': {
1461
-
1462
- // If there is no cover image specified, lets use the default...
1463
- if( $cover_image == '' )
1464
- $cover_image = powerpress_get_root_url() . 'play_video_default.jpg';
1465
-
1466
- $content .= '<div class="powerpress_player" id="powerpress_player_'. $g_powerpress_player_id .'">';
1467
- if( !$autoplay )
1468
- {
1469
- $content .= '<a href="'. $media_url .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" onclick="';
1470
- $content .= "return powerpress_embed_swf('powerpress_player_{$g_powerpress_player_id}', '{$media_url}', {$player_width}, {$player_height} );";
1471
- $content .= '">';
1472
- $content .= '<img src="'. $cover_image .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" alt="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" />';
1473
- $content .= '</a>';
1474
- }
1475
- $content .= "</div>\n";
1476
- if( $autoplay )
1477
- {
1478
- $content .= '<script type="text/javascript">'.PHP_EOL;
1479
- $content .= "powerpress_embed_swf('powerpress_player_{$g_powerpress_player_id}', '{$media_url}', {$player_width}, {$player_height} );\n";
1480
- $content .= "</script>\n";
1481
- }
1482
-
1483
- }; break;
1484
-
1485
- // Default, just display the play image. If it is set for auto play, then we don't wnat to open a new window, otherwise we want to open this in a new window..
1486
- default: {
1487
-
1488
- if( $cover_image == '' )
1489
- $cover_image = powerpress_get_root_url() . 'play_video_default.jpg';
1490
-
1491
- $content .= '<div class="powerpress_player" id="powerpress_player_'. $g_powerpress_player_id .'">';
1492
- $content .= '<a href="'. $media_url .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'"'. ($autoplay?'':' target="_blank"') .'>';
1493
- $content .= '<img src="'. $cover_image .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" alt="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" />';
1494
- $content .= '</a>';
1495
- $content .= "</div>\n";
1496
-
1497
- }; break;
1498
- }
1499
-
1500
- return $content;
1501
- }
1502
-
1503
- add_filter('powerpress_player', 'powerpress_player_filter', 10, 3);
1504
-
1505
- function powerpress_shortcode_handler( $attributes, $content = null )
1506
- {
1507
- global $post, $g_powerpress_player_added;
1508
-
1509
- // We can't add flash players to feeds
1510
- if( is_feed() )
1511
- return '';
1512
-
1513
- $return = '';
1514
- $feed = '';
1515
- $url = '';
1516
- $image = '';
1517
-
1518
- extract( shortcode_atts( array(
1519
- 'url' => '',
1520
- 'feed' => '',
1521
- 'image' => ''
1522
- ), $attributes ) );
1523
-
1524
- if( !$url && $content )
1525
- {
1526
- $content_url = trim($content);
1527
- if( @parse_url($content_url) )
1528
- $url = $content_url;
1529
- }
1530
-
1531
- if( $url )
1532
- {
1533
- $url = powerpress_add_redirect_url($url);
1534
- $content_type = '';
1535
- // Handle the URL differently...
1536
- $return = apply_filters('powerpress_player', '', powerpress_add_flag_to_redirect_url($url, 'p'), array('image'=>$image, 'type'=>$content_type) );
1537
- }
1538
- else if( $feed )
1539
- {
1540
- $EpisodeData = powerpress_get_enclosure_data($post->ID, $feed);
1541
- if( !empty($EpisodeData['embed']) )
1542
- $return = $EpisodeData['embed'];
1543
-
1544
- if( $image == '' && isset($EpisodeData['image']) && $EpisodeData['image'] )
1545
- $image = $EpisodeData['image'];
1546
-
1547
- if( !isset($EpisodeData['no_player']) )
1548
- {
1549
- if( isset($GeneralSettings['premium_caps']) && $GeneralSettings['premium_caps'] && !powerpress_premium_content_authorized($feed) )
1550
- {
1551
- $return .= powerpress_premium_content_message($post->ID, $feed, $EpisodeData);
1552
- continue;
1553
- }
1554
-
1555
- $return = apply_filters('powerpress_player', '', powerpress_add_flag_to_redirect_url($EpisodeData['url'], 'p'), array('feed'=>$feed, 'image'=>$image, 'type'=>$EpisodeData['type']) );
1556
- if( !isset($EpisodeData['no_links']) )
1557
- $return .= powerpress_get_player_links($post->ID, $feed, $EpisodeData );
1558
- }
1559
- }
1560
- else
1561
- {
1562
- $GeneralSettings = get_option('powerpress_general');
1563
- if( !isset($GeneralSettings['custom_feeds']['podcast']) )
1564
- $GeneralSettings['custom_feeds']['podcast'] = 'Podcast Feed'; // Fixes scenario where the user never configured the custom default podcast feed.
1565
-
1566
- while( list($feed_slug,$feed_title) = each($GeneralSettings['custom_feeds']) )
1567
- {
1568
- if( isset($GeneralSettings['disable_player']) && isset($GeneralSettings['disable_player'][$feed_slug]) )
1569
- continue;
1570
-
1571
- $EpisodeData = powerpress_get_enclosure_data($post->ID, $feed_slug);
1572
- if( !$EpisodeData && !empty($GeneralSettings['process_podpress']) && $feed_slug == 'podcast' )
1573
- $EpisodeData = powerpress_get_enclosure_data_podpress($post->ID);
1574
-
1575
- if( !$EpisodeData )
1576
- continue;
1577
-
1578
- if( !empty($EpisodeData['embed']) )
1579
- $return .= $EpisodeData['embed'];
1580
-
1581
- $image_current = $image;
1582
- if( $image_current == '' && isset($EpisodeData['image']) && $EpisodeData['image'] )
1583
- $image_current = $EpisodeData['image'];
1584
-
1585
- if( isset($GeneralSettings['premium_caps']) && $GeneralSettings['premium_caps'] && !powerpress_premium_content_authorized($GeneralSettings) )
1586
- {
1587
- $return .= powerpress_premium_content_message($post->ID, $feed_slug, $EpisodeData);
1588
- continue;
1589
- }
1590
-
1591
- if( !isset($EpisodeData['no_player']) )
1592
- {
1593
- $return .= apply_filters('powerpress_player', '', powerpress_add_flag_to_redirect_url($EpisodeData['url'], 'p'), array('feed'=>$feed_slug, 'image'=>$image_current, 'type'=>$EpisodeData['type']) );
1594
- }
1595
- if( !isset($EpisodeData['no_links']) )
1596
- {
1597
- $return .= powerpress_get_player_links($post->ID, $feed_slug, $EpisodeData );
1598
- }
1599
- }
1600
- }
1601
-
1602
- return $return;
1603
- }
1604
-
1605
- add_shortcode('powerpress', 'powerpress_shortcode_handler');
1606
- if( !defined('PODCASTING_VERSION') )
1607
- {
1608
- add_shortcode('podcast', 'powerpress_shortcode_handler');
1609
- }
1610
-
1611
  /*
1612
  Helper functions:
1613
  */
1614
-
1615
  function powerpress_podpress_redirect_check()
1616
  {
1617
  if( preg_match('/podpress_trac\/([^\/]+)\/([^\/]+)\/([^\/]+)\/(.*)$/', $_SERVER['REQUEST_URI'], $matches) )
@@ -1663,6 +1365,10 @@ function get_the_powerpress_content()
1663
  // PowerPress settings:
1664
  $GeneralSettings = get_option('powerpress_general');
1665
 
 
 
 
 
1666
  if( !isset($GeneralSettings['custom_feeds']) )
1667
  $GeneralSettings['custom_feeds'] = array('podcast'=>'Default Podcast Feed');
1668
 
@@ -1730,15 +1436,22 @@ function get_the_powerpress_content()
1730
  if( $AddDefaultPlayer )
1731
  {
1732
  $image = '';
 
 
1733
  if( isset($EpisodeData['image']) && $EpisodeData['image'] != '' )
1734
  $image = $EpisodeData['image'];
 
 
 
 
1735
 
1736
- $new_content .= apply_filters('powerpress_player', '', powerpress_add_flag_to_redirect_url($EpisodeData['url'], 'p'), array('feed'=>$feed_slug, 'image'=>$image, 'type'=>$EpisodeData['type']) );
1737
  }
1738
  }
1739
 
1740
  if( !isset($EpisodeData['no_links']) )
1741
- $new_content .= powerpress_get_player_links($post->ID, $feed_slug, $EpisodeData);
 
1742
  }
1743
  }
1744
  }
@@ -1746,55 +1459,7 @@ function get_the_powerpress_content()
1746
  return $new_content;
1747
  }
1748
 
1749
- function powerpress_do_pinw($pinw, $process_podpress)
1750
- {
1751
- list($post_id, $feed_slug) = explode('-', $pinw, 2);
1752
- $EpisodeData = powerpress_get_enclosure_data($post_id, $feed_slug);
1753
-
1754
- if( $EpisodeData == false && $process_podpress && $feed_slug == 'podcast' )
1755
- {
1756
- $EpisodeData = powerpress_get_enclosure_data_podpress($post_id);
1757
- }
1758
-
1759
- echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
1760
- ?>
1761
- <html xmlns="http://www.w3.org/1999/xhtml">
1762
- <head>
1763
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
1764
- <title><?php echo __('Blubrry PowerPress Player', 'powerpress'); ?></title>
1765
- <?php wp_head(); ?>
1766
- <style type="text/css">
1767
- body { font-size: 13px; font-family: Arial, Helvetica, sans-serif; }
1768
- </style>
1769
- </head>
1770
- <body>
1771
- <div style="margin: 5px;">
1772
- <?php
1773
- $GeneralSettings = get_option('powerpress_general');
1774
- if( !$EpisodeData )
1775
- {
1776
- echo '<p>'. __('Unable to retrieve media information.', 'powerpress') .'</p>';
1777
- }
1778
- else if( !empty($GeneralSettings['premium_caps']) && !powerpress_premium_content_authorized($feed_slug) )
1779
- {
1780
- echo powerpress_premium_content_message($post_id, $feed_slug, $EpisodeData);
1781
- }
1782
- else if( !empty($EpisodeData['embed']) )
1783
- {
1784
- echo $EpisodeData['embed'];
1785
- }
1786
- else // if( !isset($EpisodeData['no_player']) ) // Even if there is no player set, if the play in new window option is enabled then it should play here...
1787
- {
1788
- echo apply_filters('powerpress_player', '', powerpress_add_flag_to_redirect_url($EpisodeData['url'], 'p'), array('feed'=>$feed_slug, 'autoplay'=>true, 'type'=>$EpisodeData['type']) );
1789
- }
1790
-
1791
- ?>
1792
- </div>
1793
- </body>
1794
- </html>
1795
- <?php
1796
- exit;
1797
- }
1798
 
1799
  // Adds content types that are missing from the default wp_check_filetype function
1800
  function powerpress_get_contenttype($file, $use_wp_check_filetype = true)
@@ -1817,14 +1482,9 @@ function powerpress_get_contenttype($file, $use_wp_check_filetype = true)
1817
  case 'm4r': // iPhone ringtone format
1818
  return 'audio/m4r';
1819
  // OGG Internet contnet types as set forth by rfc5334 (http://tools.ietf.org/html/rfc5334)
1820
- case 'ogg':
1821
  case 'oga':
1822
  case 'spx':
1823
  return 'audio/ogg';
1824
- case 'ogv':
1825
- return 'video/ogg';
1826
- case 'ogx':
1827
- return 'application/ogg';
1828
  case 'wma':
1829
  return 'audio/x-ms-wma';
1830
  case 'wax':
@@ -1859,8 +1519,6 @@ function powerpress_get_contenttype($file, $use_wp_check_filetype = true)
1859
  return 'video/x-ms-wmv'; // Check this
1860
  case 'flv':
1861
  return 'video/x-flv';
1862
- case 'swf':
1863
- return 'application/x-shockwave-flash';
1864
  case 'mov':
1865
  case 'qt':
1866
  return 'video/quicktime';
@@ -1868,7 +1526,12 @@ function powerpress_get_contenttype($file, $use_wp_check_filetype = true)
1868
  return 'video/divx';
1869
  case '3gp':
1870
  return 'video/3gpp';
1871
-
 
 
 
 
 
1872
  // rarely used
1873
  case 'mid':
1874
  case 'midi':
@@ -1881,6 +1544,10 @@ function powerpress_get_contenttype($file, $use_wp_check_filetype = true)
1881
  return 'application/pdf';
1882
  case 'torrent':
1883
  return 'application/x-bittorrent';
 
 
 
 
1884
  default: // Let it fall through
1885
  }
1886
 
@@ -2323,10 +1990,14 @@ function powerpress_get_enclosure_data($post_id, $feed_slug = 'podcast')
2323
 
2324
  $Serialized = false;
2325
  $Data = array();
 
 
2326
  $Data['url'] = '';
2327
  $Data['duration'] = '';
2328
  $Data['size'] = '';
2329
  $Data['type'] = '';
 
 
2330
 
2331
  if( count($MetaParts) > 0 )
2332
  $Data['url'] = powerpress_add_redirect_url( trim($MetaParts[0]) );
@@ -2336,11 +2007,6 @@ function powerpress_get_enclosure_data($post_id, $feed_slug = 'podcast')
2336
  $Data['type'] = trim($MetaParts[2]);
2337
  if( count($MetaParts) > 3 )
2338
  $Serialized = $MetaParts[3];
2339
-
2340
- //list($url, $size, $type, $Serialized) = explode("\n", $MetaData, 4);
2341
- //$Data['url'] = powerpress_add_redirect_url( trim($url) );
2342
- //$Data['size'] = trim($size);
2343
- //$Data['type'] = trim($type);
2344
 
2345
  if( $Serialized )
2346
  {
@@ -2365,6 +2031,8 @@ function powerpress_get_enclosure_data($post_id, $feed_slug = 'podcast')
2365
  function powerpress_get_enclosure_data_podpress($post_id, $mediaNum = 0, $include_premium = false)
2366
  {
2367
  $podPressMedia = powerpress_get_post_meta($post_id, 'podPressMedia');
 
 
2368
  if( $podPressMedia )
2369
  {
2370
 
@@ -2389,10 +2057,14 @@ function powerpress_get_enclosure_data_podpress($post_id, $mediaNum = 0, $includ
2389
  return false;
2390
 
2391
  $Data = array();
 
 
2392
  $Data['duration'] = 0;
2393
  $Data['url'] = '';
2394
  $Data['size'] = 0;
2395
  $Data['type'] = '';
 
 
2396
 
2397
  $Data['url'] = $podPressMedia[$mediaNum]['URI'];
2398
  if( isset($podPressMedia[$mediaNum]['size']) )
@@ -2438,79 +2110,6 @@ function powerpress_get_apple_id($url)
2438
  return 0;
2439
  }
2440
 
2441
- function powerpress_get_player_links($post_id, $feed_slug = 'podcast', $EpisodeData = false)
2442
- {
2443
- if( !$EpisodeData && $post_id )
2444
- $EpisodeData = powerpress_get_enclosure_data($post_id, $feed_slug);
2445
-
2446
- if( !$EpisodeData )
2447
- return '';
2448
-
2449
- $GeneralSettings = get_option('powerpress_general');
2450
- $is_pdf = (strtolower( substr($EpisodeData['url'], -3) ) == 'pdf' );
2451
-
2452
- // Build links for player
2453
- $player_links = '';
2454
- switch( $GeneralSettings['player_function'] )
2455
- {
2456
- case 1: // Play on page and new window
2457
- case 3: // Play in new window only
2458
- case 5: { // Play in page and new window
2459
- if( $is_pdf )
2460
- $player_links .= "<a href=\"{$EpisodeData['url']}\" class=\"powerpress_link_pinw\" target=\"_blank\" title=\"". __('Open in New Window', 'powerpress') ."\">". __('Open in New Window', 'powerpress') ."</a>".PHP_EOL;
2461
- else if( $post_id )
2462
- $player_links .= "<a href=\"{$EpisodeData['url']}\" class=\"powerpress_link_pinw\" target=\"_blank\" title=\"". POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT ."\" onclick=\"return powerpress_pinw('{$post_id}-{$feed_slug}');\">". POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT ."</a>".PHP_EOL;
2463
- else
2464
- $player_links .= "<a href=\"{$EpisodeData['url']}\" class=\"powerpress_link_pinw\" target=\"_blank\" title=\"". POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT ."\">". POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT ."</a>".PHP_EOL;
2465
- }; break;
2466
- case 2:
2467
- case 4:{ // Play in/on page only
2468
- }; break;
2469
- }//end switch
2470
-
2471
- if( $GeneralSettings['podcast_link'] == 1 )
2472
- {
2473
- if( $player_links )
2474
- $player_links .= ' '. POWERPRESS_LINK_SEPARATOR .' ';
2475
- $player_links .= "<a href=\"{$EpisodeData['url']}\" class=\"powerpress_link_d\" title=\"". POWERPRESS_DOWNLOAD_TEXT ."\">". POWERPRESS_DOWNLOAD_TEXT ."</a>".PHP_EOL;
2476
- }
2477
- else if( $GeneralSettings['podcast_link'] == 2 )
2478
- {
2479
- if( $player_links )
2480
- $player_links .= ' '. POWERPRESS_LINK_SEPARATOR .' ';
2481
- $player_links .= "<a href=\"{$EpisodeData['url']}\" class=\"powerpress_link_d\" title=\"". POWERPRESS_DOWNLOAD_TEXT ."\">". POWERPRESS_DOWNLOAD_TEXT ."</a> (".powerpress_byte_size($EpisodeData['size']).") ".PHP_EOL;
2482
- }
2483
- else if( $GeneralSettings['podcast_link'] == 3 )
2484
- {
2485
- if( $player_links )
2486
- $player_links .= ' '. POWERPRESS_LINK_SEPARATOR .' ';
2487
- if( $EpisodeData['duration'] && ltrim($EpisodeData['duration'], '0:') != '' )
2488
- $player_links .= "<a href=\"{$EpisodeData['url']}\" class=\"powerpress_link_d\" title=\"". POWERPRESS_DOWNLOAD_TEXT ."\">". POWERPRESS_DOWNLOAD_TEXT ."</a> (". htmlspecialchars(POWERPRESS_DURATION_TEXT) .": " . powerpress_readable_duration($EpisodeData['duration']) ." &#8212; ".powerpress_byte_size($EpisodeData['size']).")".PHP_EOL;
2489
- else
2490
- $player_links .= "<a href=\"{$EpisodeData['url']}\" class=\"powerpress_link_d\" title=\"". POWERPRESS_DOWNLOAD_TEXT ."\">". POWERPRESS_DOWNLOAD_TEXT ."</a> (".powerpress_byte_size($EpisodeData['size']).")".PHP_EOL;
2491
- }
2492
-
2493
- if( $player_links )
2494
- {
2495
- $extension = 'unknown';
2496
- $parts = pathinfo($EpisodeData['url']);
2497
- if( $parts && isset($parts['extension']) )
2498
- $extension = strtolower($parts['extension']);
2499
-
2500
- $prefix = '';
2501
- if( $is_pdf )
2502
- $prefix .= __('E-Book PDF', 'powerpress') . ( $feed_slug=='pdf'||$feed_slug=='podcast'?'':" ($feed_slug)") .POWERPRESS_TEXT_SEPARATOR;
2503
- else if( $feed_slug != 'podcast' )
2504
- $prefix .= htmlspecialchars(POWERPRESS_LINKS_TEXT) .' ('. htmlspecialchars($feed_slug) .')'. POWERPRESS_TEXT_SEPARATOR;
2505
- else
2506
- $prefix .= htmlspecialchars(POWERPRESS_LINKS_TEXT) . POWERPRESS_TEXT_SEPARATOR;
2507
- if( !empty($prefix) )
2508
- $prefix .= ' ';
2509
-
2510
- return '<p class="powerpress_links powerpress_links_'. $extension .'">'. $prefix . $player_links . '</p>'.PHP_EOL;
2511
- }
2512
- return '';
2513
- }
2514
 
2515
  function the_powerpress_all_players($slug = false, $no_link=false)
2516
  {
@@ -2532,6 +2131,11 @@ function get_the_powerpress_all_players($slug = false, $no_link=false)
2532
 
2533
  // Get the list of podcast channel slug names...
2534
  $GeneralSettings = get_option('powerpress_general');
 
 
 
 
 
2535
  $ChannelSlugs = array('podcast');
2536
  if( $slug == false )
2537
  {
@@ -2576,10 +2180,6 @@ function get_the_powerpress_all_players($slug = false, $no_link=false)
2576
  $AddDefaultPlayer = false;
2577
  }
2578
 
2579
- $image_current = $image;
2580
- if( $image_current == '' && isset($EpisodeData['image']) && $EpisodeData['image'] )
2581
- $image_current = $EpisodeData['image'];
2582
-
2583
  if( isset($GeneralSettings['premium_caps']) && $GeneralSettings['premium_caps'] && !powerpress_premium_content_authorized($GeneralSettings) )
2584
  {
2585
  $return .= powerpress_premium_content_message(get_the_ID(), $feed_slug, $EpisodeData);
@@ -2588,11 +2188,12 @@ function get_the_powerpress_all_players($slug = false, $no_link=false)
2588
 
2589
  if( !isset($EpisodeData['no_player']) && $AddDefaultPlayer )
2590
  {
2591
- $return .= apply_filters('powerpress_player', '', powerpress_add_flag_to_redirect_url($EpisodeData['url'], 'p'), array('feed'=>$feed_slug, 'image'=>$image_current, 'type'=>$EpisodeData['type']) );
2592
  }
2593
  if( !isset($EpisodeData['no_links']) && $no_link == false )
2594
  {
2595
- $return .= powerpress_get_player_links(get_the_ID(), $feed_slug, $EpisodeData );
 
2596
  }
2597
  }
2598
  reset($ChannelSlugs);
@@ -2635,7 +2236,13 @@ function powerpress_premium_content_message($post_id, $feed_slug, $EpisodeData =
2635
 
2636
  function powerpress_is_mobile_client()
2637
  {
2638
- return preg_match('/'.POWERPRESS_MOBILE_REGEX.'/i', $_SERVER['HTTP_USER_AGENT']);
 
 
 
 
 
 
2639
  }
2640
  /*
2641
  End Helper Functions
3
  Plugin Name: Blubrry PowerPress
4
  Plugin URI: http://www.blubrry.com/powerpress/
5
  Description: <a href="http://www.blubrry.com/powerpress/" target="_blank">Blubrry PowerPress</a> adds podcasting support to your blog. Features include: media player, 3rd party statistics, iTunes integration, Blubrry Services (Media Statistics and Hosting) integration and a lot more.
6
+ Version: 2.0
7
  Author: Blubrry
8
  Author URI: http://www.blubrry.com/
9
  Change Log:
21
  flashembed(), License: MIT by Tero Piirainen (tipiirai [at] gmail.com)
22
  Note: code found at bottom of player.js
23
 
24
+ Copyright 2008-2011 RawVoice Inc. (http://www.rawvoice.com)
25
 
26
  License: GPL (http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt)
27
 
33
  die("access denied.");
34
 
35
  // WP_PLUGIN_DIR (REMEMBER TO USE THIS DEFINE IF NEEDED)
36
+ define('POWERPRESS_VERSION', '2.0' );
37
+
38
+ // Translation support:
39
+ if ( !defined('POWERPRESS_ABSPATH') )
40
+ define('POWERPRESS_ABSPATH', dirname(__FILE__) );
41
+
42
+ // Translation support loaded:
43
+ load_plugin_textdomain('powerpress', // domain / keyword name of plugin
44
+ POWERPRESS_ABSPATH .'/languages', // Absolute path
45
+ basename(POWERPRESS_ABSPATH).'/languages' ); // relative path in plugins folder
46
 
47
  /////////////////////////////////////////////////////
48
  // The following define options should be placed in your
91
 
92
  $powerpress_feed = NULL; // DO NOT CHANGE
93
 
 
 
 
 
 
 
 
 
 
94
  function powerpress_content($content)
95
  {
96
  global $post, $g_powerpress_excerpt_post_id;
113
  // PowerPress settings:
114
  $GeneralSettings = get_option('powerpress_general');
115
 
116
+ // No player or links to add to content...
117
+ if( !empty($GeneralSettings['disable_appearance']) )
118
+ return $content;
119
+
120
  if( @$GeneralSettings['player_aggressive'] )
121
  {
122
  if( strstr($content, '<!--powerpress_player-->') !== false )
244
  if( isset($EpisodeData['image']) && $EpisodeData['image'] != '' )
245
  $image = $EpisodeData['image'];
246
 
247
+ $new_content .= apply_filters('powerpress_player', '', powerpress_add_flag_to_redirect_url($EpisodeData['url'], 'p'), $EpisodeData );
248
  }
249
  }
250
 
251
  if( !isset($EpisodeData['no_links']) )
252
+ $new_content .= apply_filters('powerpress_player_links', '', powerpress_add_flag_to_redirect_url($EpisodeData['url'], 'p'), $EpisodeData );
253
+ //$new_content .= powerpress_get_player_links($post->ID, $feed_slug, $EpisodeData);
254
  }
255
  }
256
  }
289
  ?>
290
  <script type="text/javascript">
291
  <?php
292
+ $new_window_width = 420;
293
  $new_window_height = 240;
294
 
295
  if( isset($Powerpress['new_window_width']) && $Powerpress['new_window_width'] > 100 )
298
  $new_window_height = $Powerpress['new_window_height'];
299
  ?>
300
  function powerpress_pinw(pinw){window.open('<?php echo get_bloginfo('url'); ?>/?powerpress_pinw='+pinw, 'PowerPressPlayer','toolbar=0,status=0,resizable=1,width=<?php echo ($new_window_width + 40); ?>,height=<?php echo ($new_window_height + 80); ?>'); return false;}
301
+ powerpress_url = '<?php echo powerpress_get_root_url(); ?>';
302
  </script>
303
  <?php
304
  }
313
 
314
  // Okay, lets add the namespace
315
  echo 'xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"'.PHP_EOL;
316
+ if( !defined('POWERPRESS_RAWVOICE_RSS') || POWERPRESS_RAWVOICE_RSS != false )
317
+ {
318
+ echo 'xmlns:rawvoice="http://www.rawvoice.com/rawvoiceRssModule/"'.PHP_EOL;
319
+ }
320
  }
321
 
322
  add_action('rss2_ns', 'powerpress_rss2_ns');
355
  $General = get_option('powerpress_general');
356
 
357
  // We made it this far, lets write stuff to the feed!
358
+ echo '<!-- podcast_generator="Blubrry PowerPress/'. POWERPRESS_VERSION .'" -->'.PHP_EOL;
 
 
 
 
 
 
 
 
 
 
 
 
 
359
 
360
  // add the itunes:new-feed-url tag to feed
361
  if( powerpress_is_custom_podcast_feed() )
442
  echo "\t".'</image>' . PHP_EOL;
443
  }
444
 
445
+
446
  // Handle iTunes categories
447
  $Categories = powerpress_itunes_categories();
448
  $Cat1 = false; $Cat2 = false; $Cat3 = false;
538
  }
539
  }
540
  // End Handle iTunes categories
541
+
542
+ // RawVoice RSS Tags
543
+ if( !defined('POWERPRESS_RAWVOICE_RSS') || POWERPRESS_RAWVOICE_RSS != false )
544
+ {
545
+ if( !empty($Feed['parental_rating']) )
546
+ echo "\t\t<rawvoice:rating>". $Feed['parental_rating'] ."</rawvoice:rating>".PHP_EOL;
547
+ if( !empty($Feed['location']) )
548
+ echo "\t\t<rawvoice:location>". htmlspecialchars($Feed['location']) ."</rawvoice:location>".PHP_EOL;
549
+ if( !empty($Feed['frequency']) )
550
+ echo "\t\t<rawvoice:frequency>". htmlspecialchars($Feed['frequency']) ."</rawvoice:frequency>".PHP_EOL;
551
+ }
552
  }
553
 
554
  add_action('rss2_head', 'powerpress_rss2_head');
587
  if( !$EpisodeData || !$EpisodeData['url'] )
588
  return;
589
 
590
+ // If enclosure not added, check to see why...
591
+ if( defined('POWERPRESS_ENCLOSURE_FIX') && POWERPRESS_ENCLOSURE_FIX && !$custom_enclosure && $GLOBALS['powerpress_rss_enclosure_post_id'] != $post->ID )
592
+ {
593
+ $enclosure_in_wp = apply_filters('rss_enclosure', '<enclosure url="' . trim(htmlspecialchars($EpisodeData['url']) . '" length="' . $EpisodeData['size'] . '" type="' . $EpisodeData['type'] . '" />' . "\n") );
594
+ if( !$enclosure_in_wp )
595
+ $custom_enclosure = true;
596
+ }
597
+
598
  $author = $powerpress_feed['itunes_talent_name'];
599
  if( isset($powerpress_feed['itunes_author_post']) )
600
  $author = get_the_author();
605
  $keywords = false;
606
  $block = false;
607
 
608
+ if( isset( $EpisodeData['summary'] ) && strlen($EpisodeData['summary']) > 1 )
609
+ $summary = $EpisodeData['summary'];
610
+ if( isset( $EpisodeData['subtitle'] ) && strlen($EpisodeData['subtitle']) > 1 )
611
+ $subtitle = $EpisodeData['subtitle'];
612
+ if( isset( $EpisodeData['keywords'] ) && strlen($EpisodeData['keywords']) > 1 )
613
+ $keywords = $EpisodeData['keywords'];
614
+ if( isset( $EpisodeData['explicit'] ) && is_numeric($EpisodeData['explicit']) )
615
  {
616
+ $explicit_array = array("no", "yes", "clean");
617
+ $explicit = $explicit_array[$EpisodeData['explicit']];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
618
  }
619
+
620
+ // Code for future use:
621
+ if( !empty( $EpisodeData['author'] ) )
622
+ $author = $EpisodeData['author'];
623
+ if( !empty( $EpisodeData['block'] ) )
624
+ $block = 'yes';
625
 
626
  if( $custom_enclosure ) // We need to add the enclosure tag here...
627
  {
695
  echo "\t\t<itunes:duration>" . ltrim($EpisodeData['duration'], '0:') . '</itunes:duration>'.PHP_EOL;
696
 
697
  if( $block && $block == 'yes' )
698
+ echo "\t\t<itunes:block>yes</itunes:block>".PHP_EOL;;
699
+
700
+ // RawVoice RSS Tags
701
+ if( !defined('POWERPRESS_RAWVOICE_RSS') || POWERPRESS_RAWVOICE_RSS != false )
702
+ {
703
+ if( !empty($EpisodeData['ishd']) )
704
+ echo "\t\t<rawvoice:isHD>yes</rawvoice:isHD>".PHP_EOL;;
705
+ if( !empty($EpisodeData['image']) )
706
+ echo "\t\t<rawvoice:poster url=\"". $EpisodeData['image'] ."\" />".PHP_EOL;
707
+ if( !empty($EpisodeData['embed']) )
708
+ echo "\t\t<rawvoice:embed>". htmlspecialchars($EpisodeData['embed']) ."</rawvoice:embed>".PHP_EOL;
709
+ else if( !empty($powerpress_feed['podcast_embed_in_feed']) && function_exists('powerpress_generate_embed') )
710
+ {
711
+ $player = powerpressplayer_embedable($EpisodeData['url'], $EpisodeData);
712
+ $embed_content = '';
713
+ // TODO:
714
+ if( $player )
715
+ $embed_content = powerpress_generate_embed($player, $EpisodeData);
716
+ if( $embed_content )
717
+ echo "\t\t<rawvoice:embed>". htmlspecialchars( $embed_content ) ."</rawvoice:embed>".PHP_EOL;
718
+ }
719
+
720
+ if( !empty($EpisodeData['webm_src']) )
721
+ {
722
+ echo "\t\t<rawvoice:webm src=\"". $EpisodeData['webm_src'] ."\"";
723
+ if( $EpisodeData['webm_length'] )
724
+ echo " length=\"". $EpisodeData['webm_length'] ."\"";
725
+ echo " type=\"video/webm\" />".PHP_EOL;
726
+ }
727
+ }
728
  }
729
 
730
  add_action('rss2_item', 'powerpress_rss2_item');
778
  }
779
 
780
 
781
+ add_filter('rss_enclosure', 'powerpress_filter_rss_enclosure', 11);
782
 
783
  function powerpress_bloginfo_rss($content, $field = '')
784
  {
993
  {
994
  $GeneralSettings = get_option('powerpress_general');
995
 
996
+ if( empty($GeneralSettings['disable_appearance']) || $GeneralSettings['disable_appearance'] == false )
997
+ {
998
  require_once( POWERPRESS_ABSPATH.'/powerpress-player.php');
999
+ powerpressplayer_init($GeneralSettings);
1000
+ }
 
1001
 
1002
  if( defined('PODPRESS_VERSION') || isset($GLOBALS['podcasting_player_id']) || isset($GLOBALS['podcast_channel_active']) || defined('PODCASTING_VERSION') )
1003
  return false; // Another podcasting plugin is enabled...
1006
  if( !empty($GeneralSettings['process_podpress']) )
1007
  {
1008
  powerpress_podpress_redirect_check();
 
1009
  }
1010
 
1011
  // Add the podcast feeds;
1019
  }
1020
  }
1021
 
1022
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1023
  }
1024
 
1025
  add_action('init', 'powerpress_init', -100); // We need to add the feeds before other plugins start screwing with them
1061
 
1062
  $powerpress_feed = array();
1063
  $powerpress_feed['is_custom'] = true;
 
1064
  $powerpress_feed['category'] = $cat_ID;
1065
  $powerpress_feed['process_podpress'] = !empty($GeneralSettings['process_podpress']); // Category feeds could originate from Podpress
1066
  $powerpress_feed['rss_language'] = ''; // default, let WordPress set the language
1081
  $powerpress_feed['itunes_author_post'] = true;
1082
  if( $Feed['rss_language'] != '' )
1083
  $powerpress_feed['rss_language'] = $Feed['rss_language'];
1084
+
1085
+ if( !empty($GeneralSettings['podcast_embed_in_feed']) )
1086
+ $powerpress_feed['podcast_embed_in_feed'] = true;
1087
  return;
1088
  }
1089
 
1096
 
1097
  $powerpress_feed = array();
1098
  $powerpress_feed['is_custom'] = true;
 
 
 
1099
  $powerpress_feed['feed-slug'] = $feed_slug;
1100
  $powerpress_feed['process_podpress'] = ($feed_slug=='podcast'? !empty($GeneralSettings['process_podpress']): false); // We don't touch podpress data for custom feeds
1101
  $powerpress_feed['rss_language'] = ''; // RSS language should be set by WordPress by default
1120
  $powerpress_feed['itunes_author_post'] = true;
1121
  if( !empty($Feed['rss_language']) )
1122
  $powerpress_feed['rss_language'] = $Feed['rss_language'];
1123
+ if( !empty($GeneralSettings['podcast_embed_in_feed']) )
1124
+ $powerpress_feed['podcast_embed_in_feed'] = true;
1125
  return;
1126
  }
1127
+
1128
+ if( !isset($FeedSettingsBasic['apply_to']) )
1129
+ $FeedSettingsBasic['apply_to'] = 1;
1130
 
1131
  // We fell this far,we must be in simple mode or the user never saved customized their custom feed settings
1132
  switch( $FeedSettingsBasic['apply_to'] )
1154
  {
1155
  $powerpress_feed = array(); // Only store what's needed for each feed item
1156
  $powerpress_feed['is_custom'] = false; // ($feed_slug == 'podcast'?true:false);
 
 
 
1157
  $powerpress_feed['feed-slug'] = $feed_slug;
1158
  $powerpress_feed['process_podpress'] = !empty($GeneralSettings['process_podpress']); // We don't touch podpress data for custom feeds
1159
  $powerpress_feed['default_url'] = '';
1176
  if( !empty($FeedSettingsBasic['itunes_author_post']) )
1177
  $powerpress_feed['itunes_author_post'] = true;
1178
  $powerpress_feed['rss_language'] = ''; // Cannot set the language setting in simple mode
1179
+ if( !empty($GeneralSettings['podcast_embed_in_feed']) )
1180
+ $powerpress_feed['podcast_embed_in_feed'] = true;
1181
  }; break;
1182
  // All other cases we let fall through
1183
  }
1246
 
1247
  // Include Podpress data if exists...
1248
  if( !empty($powerpress_feed['process_podpress']) && get_query_var('feed') == 'podcast' )
1249
+ $where .= " OR {$wpdb->postmeta}.meta_key = 'podPressMedia' OR {$wpdb->postmeta}.meta_key = '_podPressMedia' ";
1250
 
1251
  $where .= ") ";
1252
  }
1311
 
1312
  add_action('future_to_publish', 'powerpress_future_to_publish');
1313
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1314
  /*
1315
  Helper functions:
1316
  */
 
1317
  function powerpress_podpress_redirect_check()
1318
  {
1319
  if( preg_match('/podpress_trac\/([^\/]+)\/([^\/]+)\/([^\/]+)\/(.*)$/', $_SERVER['REQUEST_URI'], $matches) )
1365
  // PowerPress settings:
1366
  $GeneralSettings = get_option('powerpress_general');
1367
 
1368
+ // No player or links to add to content...
1369
+ if( !empty($GeneralSettings['disable_appearance']) )
1370
+ return $content;
1371
+
1372
  if( !isset($GeneralSettings['custom_feeds']) )
1373
  $GeneralSettings['custom_feeds'] = array('podcast'=>'Default Podcast Feed');
1374
 
1436
  if( $AddDefaultPlayer )
1437
  {
1438
  $image = '';
1439
+ $width = '';
1440
+ $height = '';
1441
  if( isset($EpisodeData['image']) && $EpisodeData['image'] != '' )
1442
  $image = $EpisodeData['image'];
1443
+ if( !empty($EpisodeData['width']) && is_numeric($EpisodeData['width']) )
1444
+ $width = $EpisodeData['width'];
1445
+ if( !empty($EpisodeData['height']) && is_numeric($EpisodeData['height']) )
1446
+ $height = $EpisodeData['height'];
1447
 
1448
+ $new_content .= apply_filters('powerpress_player', '', powerpress_add_flag_to_redirect_url($EpisodeData['url'], 'p'), $EpisodeData );
1449
  }
1450
  }
1451
 
1452
  if( !isset($EpisodeData['no_links']) )
1453
+ $return .= apply_filters('powerpress_player_links', '', powerpress_add_flag_to_redirect_url($EpisodeData['url'], 'p'), $EpisodeData );
1454
+ // $new_content .= powerpress_get_player_links($post->ID, $feed_slug, $EpisodeData);
1455
  }
1456
  }
1457
  }
1459
  return $new_content;
1460
  }
1461
 
1462
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1463
 
1464
  // Adds content types that are missing from the default wp_check_filetype function
1465
  function powerpress_get_contenttype($file, $use_wp_check_filetype = true)
1482
  case 'm4r': // iPhone ringtone format
1483
  return 'audio/m4r';
1484
  // OGG Internet contnet types as set forth by rfc5334 (http://tools.ietf.org/html/rfc5334)
 
1485
  case 'oga':
1486
  case 'spx':
1487
  return 'audio/ogg';
 
 
 
 
1488
  case 'wma':
1489
  return 'audio/x-ms-wma';
1490
  case 'wax':
1519
  return 'video/x-ms-wmv'; // Check this
1520
  case 'flv':
1521
  return 'video/x-flv';
 
 
1522
  case 'mov':
1523
  case 'qt':
1524
  return 'video/quicktime';
1526
  return 'video/divx';
1527
  case '3gp':
1528
  return 'video/3gpp';
1529
+ case 'webm':
1530
+ return 'video/webm';
1531
+ case 'ogg':
1532
+ case 'ogv':
1533
+ return 'video/ogg';
1534
+
1535
  // rarely used
1536
  case 'mid':
1537
  case 'midi':
1544
  return 'application/pdf';
1545
  case 'torrent':
1546
  return 'application/x-bittorrent';
1547
+ case 'swf':
1548
+ return 'application/x-shockwave-flash';
1549
+ case 'ogx':
1550
+ return 'application/ogg';
1551
  default: // Let it fall through
1552
  }
1553
 
1990
 
1991
  $Serialized = false;
1992
  $Data = array();
1993
+ $Data['id'] = $post_id;
1994
+ $Data['feed'] = $feed_slug;
1995
  $Data['url'] = '';
1996
  $Data['duration'] = '';
1997
  $Data['size'] = '';
1998
  $Data['type'] = '';
1999
+ $Data['width'] = '';
2000
+ $Data['height'] = '';
2001
 
2002
  if( count($MetaParts) > 0 )
2003
  $Data['url'] = powerpress_add_redirect_url( trim($MetaParts[0]) );
2007
  $Data['type'] = trim($MetaParts[2]);
2008
  if( count($MetaParts) > 3 )
2009
  $Serialized = $MetaParts[3];
 
 
 
 
 
2010
 
2011
  if( $Serialized )
2012
  {
2031
  function powerpress_get_enclosure_data_podpress($post_id, $mediaNum = 0, $include_premium = false)
2032
  {
2033
  $podPressMedia = powerpress_get_post_meta($post_id, 'podPressMedia');
2034
+ if( !$podPressMedia )
2035
+ $podPressMedia = powerpress_get_post_meta($post_id, '_podPressMedia'); // handles latest verions of PodPress
2036
  if( $podPressMedia )
2037
  {
2038
 
2057
  return false;
2058
 
2059
  $Data = array();
2060
+ $Data['id'] = $post_id;
2061
+ $Data['feed'] = 'podcast';
2062
  $Data['duration'] = 0;
2063
  $Data['url'] = '';
2064
  $Data['size'] = 0;
2065
  $Data['type'] = '';
2066
+ $Data['width'] = '';
2067
+ $Data['height'] = '';
2068
 
2069
  $Data['url'] = $podPressMedia[$mediaNum]['URI'];
2070
  if( isset($podPressMedia[$mediaNum]['size']) )
2110
  return 0;
2111
  }
2112
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2113
 
2114
  function the_powerpress_all_players($slug = false, $no_link=false)
2115
  {
2131
 
2132
  // Get the list of podcast channel slug names...
2133
  $GeneralSettings = get_option('powerpress_general');
2134
+
2135
+ // No player or links to add to content...
2136
+ if( !empty($GeneralSettings['disable_appearance']) )
2137
+ return $return;
2138
+
2139
  $ChannelSlugs = array('podcast');
2140
  if( $slug == false )
2141
  {
2180
  $AddDefaultPlayer = false;
2181
  }
2182
 
 
 
 
 
2183
  if( isset($GeneralSettings['premium_caps']) && $GeneralSettings['premium_caps'] && !powerpress_premium_content_authorized($GeneralSettings) )
2184
  {
2185
  $return .= powerpress_premium_content_message(get_the_ID(), $feed_slug, $EpisodeData);
2188
 
2189
  if( !isset($EpisodeData['no_player']) && $AddDefaultPlayer )
2190
  {
2191
+ $return .= apply_filters('powerpress_player', '', powerpress_add_flag_to_redirect_url($EpisodeData['url'], 'p'), $EpisodeData );
2192
  }
2193
  if( !isset($EpisodeData['no_links']) && $no_link == false )
2194
  {
2195
+ $return .= apply_filters('powerpress_player_links', '', powerpress_add_flag_to_redirect_url($EpisodeData['url'], 'p'), $EpisodeData );
2196
+ // $return .= powerpress_get_player_links(get_the_ID(), $feed_slug, $EpisodeData );
2197
  }
2198
  }
2199
  reset($ChannelSlugs);
2236
 
2237
  function powerpress_is_mobile_client()
2238
  {
2239
+ if( preg_match('/('.POWERPRESS_MOBILE_REGEX.')/i', $_SERVER['HTTP_USER_AGENT'], $matches) )
2240
+ {
2241
+ if( !empty($matches[1]) )
2242
+ return $matches[1];
2243
+ }
2244
+
2245
+ return false;
2246
  }
2247
  /*
2248
  End Helper Functions
powerpressadmin-basic.php CHANGED
@@ -5,22 +5,8 @@ function powerpress_admin_basic()
5
  $General = powerpress_get_settings('powerpress_general');
6
  $General = powerpress_default_settings($General, 'basic');
7
 
8
- // Default setings for advanced mode:
9
- if( @$General['episode_box_mode'] != 2 )
10
- {
11
- /*
12
- $General['episode_box_embed'] = 0;
13
- $General['episode_box_no_player'] = 0;
14
- $General['episode_box_keywords'] = 0;
15
- $General['episode_box_subtitle'] = 0;
16
- $General['episode_box_summary'] = 0;
17
- */
18
- }
19
-
20
  $FeedSettings = powerpress_get_settings('powerpress_feed');
21
  $FeedSettings = powerpress_default_settings($FeedSettings, 'editfeed');
22
-
23
-
24
  ?>
25
  <script type="text/javascript">
26
  function CheckRedirect(obj)
@@ -39,13 +25,6 @@ function CheckRedirect(obj)
39
  }
40
  return true;
41
  }
42
- function SelectEntryBox(mode)
43
- {
44
- if( mode==2 )
45
- jQuery('.episode_box_option').removeAttr("disabled");
46
- else
47
- jQuery('.episode_box_option').attr("disabled","disabled");
48
- }
49
 
50
  function SelectEmbedField(checked)
51
  {
@@ -86,18 +65,25 @@ jQuery(document).ready(function($) {
86
  </script>
87
 
88
  <input type="hidden" name="action" value="powerpress-save-settings" />
 
89
 
90
  <h2><?php echo __('Blubrry PowerPress Settings', 'powerpress'); ?></h2>
91
 
92
  <div id="powerpress_settings_page" class="powerpress_tabbed_content">
93
- <ul class="powerpress_settings_tabs">
94
- <li><a href="#tab1"><span><?php echo __('Basic Settings', 'powerpress'); ?></span></a></li>
95
- <li><a href="#tab2"><span><?php echo htmlspecialchars(__('Services & Statistics', 'powerpress')); ?></span></a></li>
96
- <li><a href="#tab3"><span><?php echo __('Appearance', 'powerpress'); ?></span></a></li>
97
- <li><a href="#tab4"><span><?php echo __('Feeds', 'powerpress'); ?></span></a></li>
98
- <li><a href="#tab5"><span><?php echo __('iTunes', 'powerpress'); ?></span></a></li>
 
 
99
  </ul>
100
 
 
 
 
 
101
  <div id="tab1" class="powerpress_tab">
102
  <?php
103
  powerpressadmin_edit_entry_options($General);
@@ -132,6 +118,12 @@ jQuery(document).ready(function($) {
132
  ?>
133
  </div>
134
 
 
 
 
 
 
 
135
  </div>
136
  <div class="clear"></div>
137
 
@@ -147,14 +139,15 @@ jQuery(document).ready(function($) {
147
  <h3>Advanced Options</h3>
148
  <div style="margin-left: 50px;">
149
  <div>
150
- <input type="checkbox" name="General[advanced_mode]" value="1" <?php echo ($General['advanced_mode']==1?' checked':''); ?> />
151
- <strong><?php echo __('Advanced Mode', 'powerpress'); ?></strong> -
152
- <?php echo __('Uncheck to display only the essential settings for podcasting.', 'powerpress'); ?>
 
153
  </div>
154
  <div>
155
- <input type="checkbox" name="General[player_options]" value="1" <?php echo ($General['player_options']?' checked':''); ?> />
156
- <strong><?php echo __('Audio Player Options', 'powerpress'); ?></strong> -
157
- <?php echo __('Select from 5 different web based audio flash players.', 'powerpress'); ?>
158
  <span style="font-size: 85%;">(<?php echo __('feature will appear in left menu when enabled', 'powerpress'); ?>)</span>
159
  </div>
160
  <div>
@@ -201,12 +194,10 @@ jQuery(document).ready(function($) {
201
 
202
  function powerpressadmin_edit_entry_options($General)
203
  {
204
- if( !isset($General['advanced_mode']) )
205
- $General['advanced_mode'] = 0;
206
  if( !isset($General['default_url']) )
207
  $General['default_url'] = '';
208
  if( !isset($General['episode_box_mode']) )
209
- $General['episode_box_mode'] = 0;
210
  if( !isset($General['episode_box_embed']) )
211
  $General['episode_box_embed'] = 0;
212
  if( !isset($General['set_duration']) )
@@ -215,52 +206,29 @@ function powerpressadmin_edit_entry_options($General)
215
  $General['set_size'] = 0;
216
  if( !isset($General['auto_enclose']) )
217
  $General['auto_enclose'] = 0;
 
 
218
  ?>
219
  <h3><?php echo __('Episode Entry Options', 'powerpress'); ?></h3>
220
 
 
221
  <table class="form-table">
222
- <?php
223
- if( $General['advanced_mode'] )
224
- {
225
- ?>
226
- <tr valign="top">
227
- <th scope="row"><?php echo __('Default Media URL', 'powerpress'); ?></th>
228
- <td>
229
- <input type="text" style="width: 80%;" name="General[default_url]" value="<?php echo $General['default_url']; ?>" maxlength="250" />
230
- <p><?php echo __('e.g. http://example.com/mediafolder/', 'powerpress'); ?></p>
231
- <p><?php echo __('URL above will prefix entered file names that do not start with \'http://\'. URL above must end with a trailing slash. You may leave blank if you always enter the complete URL to your media when creating podcast episodes.', 'powerpress'); ?>
232
- </p>
233
- </td>
234
- </tr>
235
- <?php
236
- }
237
- ?>
238
  <tr valign="top">
239
  <th scope="row">
240
 
241
  <?php echo __('Podcast Entry Box', 'powerpress'); ?></th>
242
  <td>
243
-
244
- <ul>
245
- <li><label><input type="radio" name="General[episode_box_mode]" value="1" <?php if( $General['episode_box_mode'] == 1 ) echo 'checked'; ?> onclick="SelectEntryBox(1);" /> <?php echo __('Simple', 'powerpress'); ?></label></li>
246
- <li>
247
- <ul>
248
- <li><?php echo __('Episode entry box includes Media URL field only. File Size and Duration will be auto detected upon saving the post.', 'powerpress'); ?></li>
249
- </ul>
250
- </li>
251
-
252
- <li><label><input type="radio" name="General[episode_box_mode]" value="0" <?php if( $General['episode_box_mode'] == 0 ) echo 'checked'; ?> onclick="SelectEntryBox(0);" /> <?php echo __('Normal', 'powerpress'); ?></label> (<?php echo __('default', 'powerpress'); ?>)</li>
253
- <li>
254
- <ul>
255
- <li><?php echo __('Episode entry box includes Media URL, File Size and Duration fields.', 'powerpress'); ?></li>
256
- </ul>
257
- </li>
258
-
259
- <li><label><input type="radio" name="General[episode_box_mode]" value="2" <?php if( $General['episode_box_mode'] == 2 ) echo 'checked'; ?> onclick="SelectEntryBox(2);" /> <?php echo __('Custom', 'powerpress'); ?></label></li>
260
- <li>
261
- <ul>
262
- <li><?php echo __('Episode entry box includes Media URL, File Size and Duration fields, plus:', 'powerpress'); ?>
263
  <div id="episode_box_mode_adv">
 
 
 
 
 
 
 
264
  <p style="margin-top: 15px; margin-bottom: 0;"><input id="episode_box_embed" class="episode_box_option" name="General[episode_box_embed]" type="checkbox" value="1"<?php if( !empty($General['episode_box_embed']) ) echo ' checked'; ?> onclick="SelectEmbedField(this.checked);" /> <?php echo __('Embed Field', 'powerpress'); ?>
265
  (<?php echo __('Enter embed code from sites such as YouTube, Viddler and Blip.tv', 'powerpress'); ?>)</p>
266
  <p style="margin-top: 5px; margin-left: 20px; font-size: 90%;"><input id="embed_replace_player" class="episode_box_option" name="General[embed_replace_player]" type="checkbox" value="1"<?php if( !empty($General['embed_replace_player']) ) echo ' checked'; ?> /> <?php echo __('Replace Player with Embed', 'powerpress'); ?>
@@ -283,8 +251,11 @@ function powerpressadmin_edit_entry_options($General)
283
 
284
  </div>
285
 
286
- <p style="margin-top: 15px;"><input id="episode_box_cover_image" class="episode_box_option" name="General[episode_box_cover_image]" type="checkbox" value="1"<?php if( @$General['episode_box_cover_image'] ) echo ' checked'; ?> /> <?php echo __('Video Cover Image', 'powerpress'); ?>
287
- (<?php echo __('specify URL to image to display in place of QuickTime video', 'powerpress'); ?>)</p>
 
 
 
288
 
289
  <p style="margin-top: 15px;"><input id="episode_box_keywords" class="episode_box_option" name="General[episode_box_keywords]" type="checkbox" value="1"<?php if( !empty($General['episode_box_keywords']) ) echo ' checked'; ?> /> <?php echo __('iTunes Keywords Field', 'powerpress'); ?>
290
  (<?php echo __('Leave unchecked to use your blog post tags', 'powerpress'); ?>)</p>
@@ -300,24 +271,49 @@ function powerpressadmin_edit_entry_options($General)
300
  <em><?php echo __('NOTE: An invalid entry into any of the iTunes fields may cause problems with your iTunes listing. It is highly recommended that you validate your feed using feedvalidator.org everytime you modify any of the iTunes fields listed above.', 'powerpress'); ?></em><br />
301
  <em><strong><?php echo __('USE THE ITUNES FIELDS ABOVE AT YOUR OWN RISK.', 'powerpress'); ?></strong></em>
302
  </div>
303
- </li>
304
- </ul>
305
- </li>
306
- </ul>
307
 
308
  </td>
309
  </tr>
310
  </table>
311
  <script language="javascript">
312
- SelectEntryBox(<?php echo $General['episode_box_mode']; ?>);
313
  SelectEmbedField(<?php echo $General['episode_box_embed']; ?>);
314
  </script>
315
 
316
  <?php
317
- if( $General['advanced_mode'] )
318
- {
 
 
 
 
 
 
 
 
 
 
 
 
 
319
  ?>
320
- <div id="episode_entry_settings" style="<?php if( $General['episode_box_mode'] == 1 ) echo 'display:none;'; ?>">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
321
  <table class="form-table">
322
  <tr valign="top">
323
  <th scope="row">
@@ -399,8 +395,10 @@ while( list($value,$desc) = each($options) )
399
  ?>
400
 
401
  </table>
 
 
 
402
  <?php
403
- }
404
  }
405
 
406
  function powerpressadmin_edit_podpress_options($General)
@@ -519,17 +517,20 @@ function powerpressadmin_edit_itunes_general($General, $FeedSettings = false, $f
519
 
520
  </td>
521
  </tr>
 
522
 
523
- <?php
524
- if( @$General['advanced_mode'] )
525
- {
526
- ?>
527
  <tr valign="top">
528
  <th scope="row">
529
 
530
  <?php echo __('Update iTunes Listing', 'powerpress'); ?></th>
531
  <td>
 
 
 
532
  <?php
 
533
  if( $FeedSettings )
534
  {
535
  ?>
@@ -599,14 +600,16 @@ while( list($value,$desc) = each($options) )
599
  ?>
600
 
601
 
602
- <?php } ?>
 
 
603
  </td>
604
  </tr>
 
 
605
  <?php
606
- } // end advanced_mode
607
- ?>
608
 
609
- </table>
610
  <?php
611
  } // end itunes general
612
 
@@ -623,9 +626,45 @@ function powerpressadmin_edit_blubrry_services($General)
623
  $StatsInDashboard = false;
624
 
625
  ?>
626
- <h3><?php echo __('Blubrry Services Integration', 'powerpress'); ?></h3>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
627
  <p>
628
- <?php echo sprintf(
629
  __('Adds %s to your blog\'s %s plus features for %s users to quickly upload and publish media directly from their blog.', 'powerpress'),
630
  '<a href="http://www.blubrry.com/podcast_statistics/" target="_blank">'. __('Blubrry Media Statistics', 'powerpress') .'</a>',
631
  '<a href="'. admin_url() .'">'. __('WordPress Dashboard', 'powerpress') .'</a>',
@@ -663,6 +702,7 @@ which includes U.S. downloads, trending and exporting, is available for $5 month
663
  packages start at $12.</em>
664
  </p>
665
  <?php
 
666
  }
667
 
668
  function powerpressadmin_edit_media_statistics($General)
@@ -673,96 +713,93 @@ function powerpressadmin_edit_media_statistics($General)
673
  $General['redirect2'] = '';
674
  if( !isset($General['redirect3']) )
675
  $General['redirect3'] = '';
676
- if( !isset($General['hide_free_stats']) )
677
- $General['hide_free_stats'] = 0;
678
-
679
  ?>
680
- <h3><?php echo __('Media Statistics', 'powerpress'); ?></h3>
681
- <p>
682
- <?php echo __('Enter your Redirect URL issued by your media statistics service provider below.', 'powerpress'); ?>
683
- </p>
 
684
 
685
- <div style="position: relative;">
686
- <table class="form-table">
687
- <tr valign="top">
688
- <th scope="row">
689
- <?php echo __('Redirect URL 1', 'powerpress'); ?>
690
- </th>
691
- <td>
692
- <input type="text" style="width: 60%;" name="General[redirect1]" value="<?php echo $General['redirect1']; ?>" onChange="return CheckRedirect(this);" maxlength="250" />
693
- </td>
694
- </tr>
695
- </table>
696
- <?php if( empty($General['redirect2']) && empty($General['redirect3']) ) { ?>
697
- <div style="position: absolute;bottom: 0px;right: 10px;font-size: 85%;" id="powerpress_redirect2_showlink">
698
- <a href="javascript:void();" onclick="javascript:document.getElementById('powerpress_redirect2_table').style.display='block';document.getElementById('powerpress_redirect2_showlink').style.display='none';return false;"><?php echo __('Add Another Redirect', 'powerpress'); ?></a>
 
 
699
  </div>
700
- <?php } ?>
701
- </div>
702
 
703
- <div id="powerpress_redirect2_table" style="position: relative;<?php if( empty($General['redirect2']) && empty($General['redirect3']) ) echo 'display:none;'; ?>">
704
- <table class="form-table">
705
- <tr valign="top">
706
- <th scope="row">
707
- <?php echo __('Redirect URL 2', 'powerpress'); ?>
708
- </th>
709
- <td>
710
- <input type="text" style="width: 60%;" name="General[redirect2]" value="<?php echo $General['redirect2']; ?>" onblur="return CheckRedirect(this);" maxlength="250" />
711
- </td>
712
- </tr>
713
- </table>
714
- <?php if( $General['redirect3'] == '' ) { ?>
715
- <div style="position: absolute;bottom: 0px;right: 10px;font-size: 85%;" id="powerpress_redirect3_showlink">
716
- <a href="javascript:void();" onclick="javascript:document.getElementById('powerpress_redirect3_table').style.display='block';document.getElementById('powerpress_redirect3_showlink').style.display='none';return false;"><?php echo __('Add Another Redirect', 'powerpress'); ?></a>
717
- </div>
718
- <?php } ?>
719
- </div>
720
-
721
- <div id="powerpress_redirect3_table" style="<?php if( empty($General['redirect3']) ) echo 'display:none;'; ?>">
722
- <table class="form-table">
723
- <tr valign="top">
724
- <th scope="row">
725
- <?php echo __('Redirect URL 3', 'powerpress'); ?>
726
- </th>
727
- <td>
728
- <input type="text" style="width: 60%;" name="General[redirect3]" value="<?php echo $General['redirect3']; ?>" onblur="return CheckRedirect(this);" maxlength="250" />
729
- </td>
730
- </tr>
731
- </table>
732
- </div>
733
- <style type="text/css">
734
- #TB_window {
735
- border: solid 1px #3D517E;
736
- }
737
- </style>
738
- <input type="hidden" id="hide_free_stats" name="General[hide_free_stats]" value="<?php echo (empty($General['hide_free_stats'])?0:1); ?>" />
739
-
740
- <div id="blubrry_stats_box" style="<?php if( !empty($General['hide_free_stats']) ) echo 'display:none;'; ?>">
741
- <div style="font-family: Arial, Helvetica, sans-serif; border: solid 1px #3D517E; background-color:#D2E9FF;padding:10px; margin-left:10px;margin-right:10px;margin-top:10px;">
742
- <div style="color: #3D517E; font-weight: bold; font-size: 18px;"><?php echo __('Free Access to the Best Media Statistics!', 'powerpress'); ?></div>
743
- <div style="font-size: 14px;margin-top: 10px; margin-bottom: 10px;">
744
- <?php echo sprintf( __('Get %s Media Statistics by taking a few minutes and adding your podcast to Blubrry.com. What\'s the catch? Nothing! For many, our free service is all you will need. But if you\'re looking to further your abilities with media download information, we hope you consider upgrading to our paid Premium Statistics service. ', 'powerpress'),
745
- '<span style="color: #990000; font-weight: bold;">'. __('FREE', 'powerpress') .'</span>' );
746
- ?>
747
  </div>
748
- <div style="text-align: center; font-size: 16px; font-weight: bold;"><a href="http://www.blubrry.com/addpodcast.php?feed=<?php echo urlencode(get_feed_link('podcast')); ?>" target="_blank" style="color: #3D517E;"><?php echo __('Sign Up For Free Media Statistics Now', 'powerpress'); ?></a></div>
749
  </div>
750
- <div style="font-size: 10px;margin-left: 10px;">
751
- <a href="javascript:void();" onclick="javascript:document.getElementById('blubrry_stats_box').style.display='none';document.getElementById('hide_free_stats').value=1;document.getElementById('show_free_stats').style.display='block';return false;"><?php echo __('hide','powerpress'); ?></a>
 
 
 
 
 
 
 
 
 
 
752
  </div>
753
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
754
 
755
- <div id="show_free_stats" style="<?php if( $General['hide_free_stats'] != 1 ) echo 'display:none;'; ?>">
756
- <table class="form-table">
757
- <tr valign="top">
758
- <th scope="row">
759
- &nbsp;
760
- </th>
761
- <td>
762
- <p style="margin: 0;"><a href="javascript:void();" onclick="javascript:document.getElementById('blubrry_stats_box').style.display='block';document.getElementById('hide_free_stats').value=0;document.getElementById('show_free_stats').style.display='none';return false;"><?php echo __('Learn About Free Blubrry Statistics', 'powerpress'); ?></a></p>
763
- </td>
764
- </tr>
765
- </table>
 
 
 
 
766
  </div>
767
  <?php
768
  }
@@ -786,6 +823,8 @@ function powerpressadmin_appearance($General=false)
786
  $General['player_height'] = '';
787
  if( !isset($General['player_width_audio']) )
788
  $General['player_width_audio'] = '';
 
 
789
 
790
 
791
  $Players = array('podcast'=>__('Default Podcast (podcast)', 'powerpress') );
@@ -801,26 +840,63 @@ function powerpressadmin_appearance($General=false)
801
 
802
  ?>
803
 
804
- <h3><?php echo __('Appearance Settings', 'powerpress'); ?></h3>
805
 
806
- <table class="form-table">
807
 
808
- <?php
809
- if( @$General['advanced_mode'] )
810
- {
811
- ?>
812
  <tr valign="top">
813
- <th scope="row"><?php echo __('Media Presentation', 'powerpress'); ?></th>
814
- <td><select name="General[display_player]" class="bpp_input_sm">
815
- <?php
816
- $displayoptions = array(1=>__('Below Post', 'powerpress'), 2=>__('Above Post', 'powerpress'), 0=>__('None', 'powerpress') );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
817
 
818
- while( list($value,$desc) = each($displayoptions) )
819
- echo "\t<option value=\"$value\"". ($General['display_player']==$value?' selected':''). ">$desc</option>\n";
820
 
821
- ?>
822
- </select> (<?php echo __('where media player and download links will be displayed', 'powerpress'); ?>)
823
- <p><input name="General[display_player_excerpt]" type="checkbox" value="1" <?php if( !empty($General['display_player_excerpt']) ) echo 'checked '; ?>/> <?php echo __('Display media / links in:', 'powerpress'); ?> <a href="http://codex.wordpress.org/Template_Tags/the_excerpt" title="<?php echo __('WordPress Excerpts', 'powerpress'); ?>" target="_blank"><?php echo __('WordPress Excerpts', 'powerpress'); ?></a> (<?php echo __('e.g. search results', 'powerpress'); ?>)</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
824
  </td>
825
  </tr>
826
 
@@ -829,8 +905,8 @@ while( list($value,$desc) = each($displayoptions) )
829
  <?php echo __('PowerPress Shortcode', 'powerpress'); ?></th>
830
  <td>
831
  <p>
832
- <?php echo sprintf(__('The %s shortcode is used to position your media presentation (player and download links) exactly where you want within your Post or Page.', 'powerpress'), '<code>[powerpress]</code>'); ?>
833
- <?php echo __('Simply insert the code on a new line in your content like this:', 'powerpress'); ?>
834
  </p>
835
  <div style="margin-left: 30px;">
836
  <code>[powerpress]</code>
@@ -843,18 +919,14 @@ while( list($value,$desc) = each($displayoptions) )
843
 
844
  <tr valign="top">
845
  <th scope="row">
846
- <?php echo __('Display Media Player', 'powerpress'); ?></th>
847
- <td><select name="General[player_function]" class="bpp_input_med" onchange="javascript: jQuery('#new_window_settings').css('display', (this.value==1||this.value==3?'block':'none') );">
848
- <?php
849
- $playeroptions = array(1=>__('On Page & New Window', 'powerpress'), 2=>__('On Page Only', 'powerpress'), 3=>__('New Window Only', 'powerpress'), /* 4=>'On Page Link', 5=>'On Page Link & New Window', */ 0=>__('Disable', 'powerpress') );
850
-
851
- while( list($value,$desc) = each($playeroptions) )
852
- echo "\t<option value=\"$value\"". ($General['player_function']==$value?' selected':''). ">".htmlspecialchars($desc)."</option>\n";
853
 
854
- ?>
855
- </select>
856
- (<?php echo __('select where to display media flash player or embed code', 'powerpress'); ?>)
857
- <p><input type="checkbox" name="General[display_player_disable_mobile]" value="1" <?php if( !empty($General['display_player_disable_mobile']) ) echo 'checked '; ?>/> <?php echo __('Disable Media Player for known mobile devices.', 'powerpress'); ?></p>
 
858
  </td>
859
  </tr>
860
  </table>
@@ -867,25 +939,28 @@ while( list($value,$desc) = each($playeroptions) )
867
  <tr valign="top">
868
  <th scope="row">
869
 
870
- <?php echo __('Download Link', 'powerpress'); ?></th>
871
  <td>
872
- <select name="General[podcast_link]" class="bpp_input_med">
873
- <?php
874
- $linkoptions = array(1=>__('Display', 'powerpress'), 2=>__('Display with file size', 'powerpress'), 3=>__('Display with file size and duration', 'powerpress'), 0=>__('Disable', 'powerpress') );
875
-
876
- while( list($value,$desc) = each($linkoptions) )
877
- echo "\t<option value=\"$value\"". ($General['podcast_link']==$value?' selected':''). ">$desc</option>\n";
878
 
879
- ?>
880
- </select>
 
 
 
 
 
 
 
 
881
  </td>
882
  </tr>
 
883
 
884
- <?php
885
- } // end advanced mode
886
- ?>
887
 
888
 
 
 
889
  <tr valign="top">
890
  <th scope="row" style="background-image: url(../wp-includes/images/smilies/icon_exclaim.gif); background-position: 10px 10px; background-repeat: no-repeat; ">
891
 
@@ -907,10 +982,8 @@ while( list($value,$desc) = each($linkoptions) )
907
  </tr>
908
  </table>
909
 
910
- <?php
911
- if( !empty($General['advanced_mode']) )
912
- {
913
- ?>
914
  <div id="new_window_settings" style="display: <?php echo ( $General['player_function']==1 || $General['player_function']==3 ?'block':'none'); ?>">
915
  <h3><?php echo __('Play in New Window Settings', 'powerpress'); ?></h3>
916
  <table class="form-table">
@@ -921,7 +994,7 @@ while( list($value,$desc) = each($linkoptions) )
921
  </th>
922
  <td>
923
  <input type="text" name="General[new_window_width]" style="width: 50px;" onkeyup="javascript:this.value=this.value.replace(/[^0-9]/g, '');" value="<?php echo $General['new_window_width']; ?>" maxlength="4" />
924
- <?php echo __('Width of new window (leave blank for 320 default)', 'powerpress'); ?>
925
  </td>
926
  </tr>
927
 
@@ -936,80 +1009,87 @@ while( list($value,$desc) = each($linkoptions) )
936
  </tr>
937
  </table>
938
  </div>
939
- <?php
940
- }
941
- ?>
942
-
943
- <h3><?php echo __('Video Player Settings', 'powerpress'); ?></h3>
944
 
945
- <table class="form-table">
946
- <tr valign="top">
947
- <th scope="row">
948
- <?php echo __('Player Width', 'powerpress'); ?>
949
- </th>
950
- <td>
951
- <input type="text" name="General[player_width]" style="width: 50px;" onkeyup="javascript:this.value=this.value.replace(/[^0-9]/g, '');" value="<?php echo $General['player_width']; ?>" maxlength="4" />
952
- <?php echo __('Width of player (leave blank for 320 default)', 'powerpress'); ?>
953
- </td>
954
- </tr>
955
 
956
- <tr valign="top">
957
- <th scope="row">
958
- <?php echo __('Player Height', 'powerpress'); ?>
959
- </th>
960
- <td>
961
- <input type="text" name="General[player_height]" style="width: 50px;" onkeyup="javascript:this.value=this.value.replace(/[^0-9]/g, '');" value="<?php echo $General['player_height']; ?>" maxlength="4" />
962
- <?php echo __('Height of player (leave blank for 240 default)', 'powerpress'); ?>
963
- </td>
964
- </tr>
965
 
966
- <tr valign="top">
967
- <th scope="row">
968
- <?php echo __('QuickTime Scale', 'powerpress'); ?></th>
969
- <td>
970
- <select name="General[player_scale]" class="bpp_input_sm" onchange="javascript:jQuery('#player_scale_custom').css('display', (this.value=='tofit'||this.value=='aspect'? 'none':'inline' ))">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
971
  <?php
972
- $scale_options = array('tofit'=>__('ToFit (default)', 'powerpress'), 'aspect'=>__('Aspect', 'powerpress') );
973
- if( !isset($General['player_scale']) )
974
- $General['player_scale'] = 'tofit'; // Tofit works in almost all cases
975
-
976
- if( is_numeric($General['player_scale']) )
977
- $scale_options[ $General['player_scale'] ]= __('Custom', 'powerpress');
978
- else
979
- $scale_options['custom']= __('Custom', 'powerpress');
980
-
981
 
 
 
 
 
982
 
983
- while( list($value,$desc) = each($scale_options) )
984
- echo "\t<option value=\"$value\"". ($General['player_scale']==$value?' selected':''). ">$desc</option>\n";
985
-
986
  ?>
987
- </select>
988
- <span id="player_scale_custom" style="display: <?php echo (is_numeric($General['player_scale'])?'inline':'none'); ?>">
989
- <?php echo __('Scale:', 'powerpress'); ?> <input type="text" name="PlayerScaleCustom" style="width: 50px;" onkeyup="javascript:this.value=this.value.replace(/[^0-9.]/g, '');" value="<?php echo (is_numeric($General['player_scale'])?$General['player_scale']:''); ?>" maxlength="4" /> <?php echo __('e.g.', 'powerpress'); ?> 1.5
990
- </span>
991
- <p style="margin-top: 5px; margin-bottom: 0;">
992
- <?php echo __('If you do not see video, adjust the width, height and scale settings above.', 'powerpress'); ?>
993
- </p>
994
- </td>
995
- </tr>
996
-
997
- </table>
998
-
999
- <h3><?php echo __('Audio Player Settings', 'powerpress'); ?></h3>
1000
  <table class="form-table">
1001
  <tr valign="top">
1002
  <th scope="row">
1003
- <?php echo __('Default Player Width', 'powerpress'); ?>
1004
- </th>
1005
  <td>
1006
- <input type="text" name="General[player_width_audio]" style="width: 50px;" onkeyup="javascript:this.value=this.value.replace(/[^0-9]/g, '');" value="<?php echo $General['player_width_audio']; ?>" maxlength="4" />
1007
- <?php echo __('Width of Audio mp3 player (leave blank for 320 default)', 'powerpress'); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1008
  </td>
1009
  </tr>
1010
  </table>
1011
 
1012
- <?php
1013
- } // End powerpress_admin_appearance()
 
1014
 
1015
  ?>
5
  $General = powerpress_get_settings('powerpress_general');
6
  $General = powerpress_default_settings($General, 'basic');
7
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  $FeedSettings = powerpress_get_settings('powerpress_feed');
9
  $FeedSettings = powerpress_default_settings($FeedSettings, 'editfeed');
 
 
10
  ?>
11
  <script type="text/javascript">
12
  function CheckRedirect(obj)
25
  }
26
  return true;
27
  }
 
 
 
 
 
 
 
28
 
29
  function SelectEmbedField(checked)
30
  {
65
  </script>
66
 
67
  <input type="hidden" name="action" value="powerpress-save-settings" />
68
+ <input type="hidden" id="save_tab_pos" name="tab" value="<?php echo (empty($_POST['tab'])?0:$_POST['tab']); ?>" />
69
 
70
  <h2><?php echo __('Blubrry PowerPress Settings', 'powerpress'); ?></h2>
71
 
72
  <div id="powerpress_settings_page" class="powerpress_tabbed_content">
73
+ <ul class="powerpress_settings_tabs">
74
+ <li><a href="#tab0"><span><?php echo htmlspecialchars(__('Welcome', 'powerpress')); ?></span></a></li>
75
+ <li><a href="#tab1"><span><?php echo htmlspecialchars(__('Basic Settings', 'powerpress')); ?></span></a></li>
76
+ <li><a href="#tab2"><span><?php echo htmlspecialchars(__('Services & Stats', 'powerpress')); ?></span></a></li>
77
+ <li><a href="#tab3"><span><?php echo htmlspecialchars(__('Media Appearance', 'powerpress')); ?></span></a></li>
78
+ <li><a href="#tab4"><span><?php echo htmlspecialchars(__('Feeds', 'powerpress')); ?></span></a></li>
79
+ <li><a href="#tab5"><span><?php echo htmlspecialchars(__('iTunes', 'powerpress')); ?></span></a></li>
80
+ <li><a href="#tab6"><span><?php echo htmlspecialchars(__('T.V.', 'powerpress')); ?></span></a></li>
81
  </ul>
82
 
83
+ <div id="tab0" class="powerpress_tab">
84
+ <?php powerpressadmin_welcome($General); ?>
85
+ </div>
86
+
87
  <div id="tab1" class="powerpress_tab">
88
  <?php
89
  powerpressadmin_edit_entry_options($General);
118
  ?>
119
  </div>
120
 
121
+ <div id="tab6" class="powerpress_tab">
122
+ <?php
123
+ powerpressadmin_edit_tv($FeedSettings, $feed_slug);
124
+ ?>
125
+ </div>
126
+
127
  </div>
128
  <div class="clear"></div>
129
 
139
  <h3>Advanced Options</h3>
140
  <div style="margin-left: 50px;">
141
  <div>
142
+ <input type="checkbox" name="NULL[player_options]" value="1" checked disabled />
143
+ <strong><?php echo __('Audio Player Options', 'powerpress'); ?></strong> -
144
+ <?php echo __('Select from 6 different web based audio players.', 'powerpress'); ?>
145
+ <span style="font-size: 85%;">(<?php echo __('feature will appear in left menu when enabled', 'powerpress'); ?>)</span>
146
  </div>
147
  <div>
148
+ <input type="checkbox" name="NULL[video_player_options]" value="1" checked disabled />
149
+ <strong><?php echo __('Video Player Options', 'powerpress'); ?></strong> -
150
+ <?php echo __('Select from 2 different web based video players.', 'powerpress'); ?>
151
  <span style="font-size: 85%;">(<?php echo __('feature will appear in left menu when enabled', 'powerpress'); ?>)</span>
152
  </div>
153
  <div>
194
 
195
  function powerpressadmin_edit_entry_options($General)
196
  {
 
 
197
  if( !isset($General['default_url']) )
198
  $General['default_url'] = '';
199
  if( !isset($General['episode_box_mode']) )
200
+ $General['episode_box_mode'] = 0; // Default not set, 1 = no duration/file size, 2 = yes duration/file size (default if not set)
201
  if( !isset($General['episode_box_embed']) )
202
  $General['episode_box_embed'] = 0;
203
  if( !isset($General['set_duration']) )
206
  $General['set_size'] = 0;
207
  if( !isset($General['auto_enclose']) )
208
  $General['auto_enclose'] = 0;
209
+ if( !isset($General['episode_box_player_size']) )
210
+ $General['episode_box_player_size'] = 0;
211
  ?>
212
  <h3><?php echo __('Episode Entry Options', 'powerpress'); ?></h3>
213
 
214
+
215
  <table class="form-table">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
216
  <tr valign="top">
217
  <th scope="row">
218
 
219
  <?php echo __('Podcast Entry Box', 'powerpress'); ?></th>
220
  <td>
221
+ <p style="margin-top: 5px;">
222
+ <?php echo __('Configure your podcast episode entry box with the options that fit your needs.', 'powerpress'); ?>
223
+ </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
224
  <div id="episode_box_mode_adv">
225
+
226
+ <p style="margin-top: 15px;"><input class="episode_box_option" name="Null[ignore]" type="checkbox" value="1" checked onclick="return false" onkeydown="return false" /> <?php echo __('Media URL', 'powerpress'); ?>
227
+ (<?php echo __('Specify URL to episode\'s media file', 'powerpress'); ?>)</p>
228
+
229
+ <p style="margin-top: 15px;"><input id="episode_box_cover_image" class="episode_box_option" name="General[episode_box_mode]" type="checkbox" value="2" <?php if( @$General['episode_box_mode'] != 1 ) echo ' checked'; ?> /> <?php echo __('Media File Size and Duration', 'powerpress'); ?>
230
+ (<?php echo __('Specify episode\'s media file size and duration', 'powerpress'); ?>)</p>
231
+
232
  <p style="margin-top: 15px; margin-bottom: 0;"><input id="episode_box_embed" class="episode_box_option" name="General[episode_box_embed]" type="checkbox" value="1"<?php if( !empty($General['episode_box_embed']) ) echo ' checked'; ?> onclick="SelectEmbedField(this.checked);" /> <?php echo __('Embed Field', 'powerpress'); ?>
233
  (<?php echo __('Enter embed code from sites such as YouTube, Viddler and Blip.tv', 'powerpress'); ?>)</p>
234
  <p style="margin-top: 5px; margin-left: 20px; font-size: 90%;"><input id="embed_replace_player" class="episode_box_option" name="General[embed_replace_player]" type="checkbox" value="1"<?php if( !empty($General['embed_replace_player']) ) echo ' checked'; ?> /> <?php echo __('Replace Player with Embed', 'powerpress'); ?>
251
 
252
  </div>
253
 
254
+ <p style="margin-top: 15px;"><input id="episode_box_cover_image" class="episode_box_option" name="General[episode_box_cover_image]" type="checkbox" value="1"<?php if( @$General['episode_box_cover_image'] ) echo ' checked'; ?> /> <?php echo __('Video Poster Image', 'powerpress'); ?>
255
+ (<?php echo __('Specify URL to poster artwork specific to each episode', 'powerpress'); ?>)</p>
256
+
257
+ <p style="margin-top: 15px;"><input id="episode_box_player_size" class="episode_box_option" name="General[episode_box_player_size]" type="checkbox" value="1"<?php if( @$General['episode_box_player_size'] ) echo ' checked'; ?> /> <?php echo __('Player Width and Height', 'powerpress'); ?> <?php echo powerpressadmin_new(); ?>
258
+ (<?php echo __('Customize player width and height on a per episode basis', 'powerpress'); ?>)</p>
259
 
260
  <p style="margin-top: 15px;"><input id="episode_box_keywords" class="episode_box_option" name="General[episode_box_keywords]" type="checkbox" value="1"<?php if( !empty($General['episode_box_keywords']) ) echo ' checked'; ?> /> <?php echo __('iTunes Keywords Field', 'powerpress'); ?>
261
  (<?php echo __('Leave unchecked to use your blog post tags', 'powerpress'); ?>)</p>
271
  <em><?php echo __('NOTE: An invalid entry into any of the iTunes fields may cause problems with your iTunes listing. It is highly recommended that you validate your feed using feedvalidator.org everytime you modify any of the iTunes fields listed above.', 'powerpress'); ?></em><br />
272
  <em><strong><?php echo __('USE THE ITUNES FIELDS ABOVE AT YOUR OWN RISK.', 'powerpress'); ?></strong></em>
273
  </div>
274
+
 
 
 
275
 
276
  </td>
277
  </tr>
278
  </table>
279
  <script language="javascript">
 
280
  SelectEmbedField(<?php echo $General['episode_box_embed']; ?>);
281
  </script>
282
 
283
  <?php
284
+
285
+ $AdvanecdOptions = false;
286
+ if( !empty($General['default_url']) )
287
+ $AdvanecdOptions = true;
288
+ if( !empty($General['set_duration']) )
289
+ $AdvanecdOptions = true;
290
+ if( !empty($General['set_size']) )
291
+ $AdvanecdOptions = true;
292
+ if( !empty($General['auto_enclose']) )
293
+ $AdvanecdOptions = true;
294
+ if( !empty($General['permalink_feeds_only']) )
295
+ $AdvanecdOptions = true;
296
+
297
+
298
+ if( !$AdvanecdOptions ) {
299
  ?>
300
+ <div style="margin-left: 10px; font-weight: bold;"><a href="#" onclick="document.getElementById('advanced_basic_options').style.display='block';return false;"><?php echo __('Show Advanced Episode Entry Settings', 'powerpress'); ?></a></div>
301
+ <?php } ?>
302
+ <!-- start advanced features -->
303
+ <div id="advanced_basic_options" <?php echo ($AdvanecdOptions?'':'style="display:none;"'); ?>>
304
+ <table class="form-table">
305
+ <tr valign="top">
306
+ <th scope="row"><?php echo __('Default Media URL', 'powerpress'); ?></th>
307
+ <td>
308
+ <input type="text" style="width: 80%;" name="General[default_url]" value="<?php echo $General['default_url']; ?>" maxlength="250" />
309
+ <p><?php echo __('e.g. http://example.com/mediafolder/', 'powerpress'); ?></p>
310
+ <p><?php echo __('URL above will prefix entered file names that do not start with \'http://\'. URL above must end with a trailing slash. You may leave blank if you always enter the complete URL to your media when creating podcast episodes.', 'powerpress'); ?>
311
+ </p>
312
+ </td>
313
+ </tr>
314
+ </table>
315
+
316
+ <div id="episode_entry_settings">
317
  <table class="form-table">
318
  <tr valign="top">
319
  <th scope="row">
395
  ?>
396
 
397
  </table>
398
+ </div>
399
+ <!-- end advanced features -->
400
+
401
  <?php
 
402
  }
403
 
404
  function powerpressadmin_edit_podpress_options($General)
517
 
518
  </td>
519
  </tr>
520
+ </table>
521
 
522
+ <!-- start advanced features -->
523
+ <table class="form-table">
 
 
524
  <tr valign="top">
525
  <th scope="row">
526
 
527
  <?php echo __('Update iTunes Listing', 'powerpress'); ?></th>
528
  <td>
529
+ <p style="margin-top: 5px;"><?php echo __('This option is no longer available.', 'powerpress'); ?>
530
+ <?php echo __('Learn more:', 'powerpress'); ?> <a href="http://blog.blubrry.com/2011/02/11/apple-drops-itunes-podcast-directory-update-listing-ping-functionality/" target="_blank"><?php echo __('Apple Drops iTunes Podcast Directory Update Listing/Ping (pingPodcast) Function', 'powerpress'); ?></a>
531
+ </p>
532
  <?php
533
+ /*
534
  if( $FeedSettings )
535
  {
536
  ?>
600
  ?>
601
 
602
 
603
+ <?php }
604
+ */
605
+ ?>
606
  </td>
607
  </tr>
608
+ </table>
609
+ <!-- end advanced features -->
610
  <?php
 
 
611
 
612
+ ?>
613
  <?php
614
  } // end itunes general
615
 
626
  $StatsInDashboard = false;
627
 
628
  ?>
629
+ <h3><?php echo __('Integrate Blubrry Services', 'powerpress'); ?> &nbsp; <span style="color: #CC0000; font-size: 11px;"><?php echo __('optional', 'powerpress'); ?></span></h3>
630
+ <p style="margin-bottom: 0;">
631
+ <?php echo __('Add Blubrry Media Statistics to your WordPress dashboard.','powerpress'); ?>
632
+ </p>
633
+ <p style="margin-top: 5px;">
634
+ <?php echo __('Blubrry Media Hosting users can also quickly upload and publish media directly from their blog.','powerpress'); ?>
635
+ </p>
636
+
637
+ <div style="margin-left: 40px;">
638
+ <p>
639
+ <?php echo __('Have an account on Blubrry.com?','powerpress'); ?>
640
+ </p>
641
+ <p style="font-size: 110%;">
642
+ <strong><a href="<?php echo admin_url(); echo wp_nonce_url( "admin.php?action=powerpress-jquery-account", 'powerpress-jquery-account'); ?>&amp;KeepThis=true&amp;TB_iframe=true&amp;width=500&amp;height=400&amp;modal=true" target="_blank" class="thickbox" style="color: #3D517E;"><?php echo __('Click here to configure your Blubrry settings', 'powerpress'); ?></a></strong>
643
+ </p>
644
+ <p style="margin-left: 40px;">
645
+ <input name="StatsInDashboard" type="checkbox" value="1"<?php if( $StatsInDashboard == true ) echo ' checked'; ?> />
646
+ <?php echo __('Display Blubrry Media Statistics in your dashboard', 'powerpress'); ?>
647
+ </p>
648
+ <p style="margin-bottom: 0;">
649
+ <?php echo __('Don\'t have an account at Blubrry.com?','powerpress'); ?>
650
+ </p>
651
+ <p style="margin-top: 5px;">
652
+ <?php
653
+ echo sprintf(__('%s offers an array of services to media creators including a %s %s. Our %s, which includes U.S. downloads, trending, exporting, is available for $5 month. Need a reliable place to host your media? %s media hosting packages start at $12. %s', 'powerpress'),
654
+ '<a href="http://www.blubrry.com/" target="_blank">Blubrry.com</a>',
655
+ '<strong style="color: #CC0000;">'.__('FREE','powerpress').'</strong>',
656
+ '<a href="http://www.blubrry.com/podcast_statistics/" target="_blank">'. __('Basic Stats Service', 'powerpress') .'</a>',
657
+ '<a href="https://secure.blubrry.com/podcast-statistics-premium/" target="_blank">'. __('Premium Media Statistics', 'powerpress') .'</a>',
658
+ '<a href="https://secure.blubrry.com/podcast-publishing-premium-with-hosting/" target="_blank" style="text-decoration: none;">'. __('Blubrry Media Hosting', 'powerpress') .'</a>',
659
+ '<a href="https://secure.blubrry.com/podcast-publishing-premium-with-hosting/" target="_blank">'. __('Learn More', 'powerpress') .'</a>'
660
+ );
661
+ ?>
662
+ </p>
663
+ </div>
664
+
665
+ <?php /* ?>
666
  <p>
667
+ <?php //echo sprintf(
668
  __('Adds %s to your blog\'s %s plus features for %s users to quickly upload and publish media directly from their blog.', 'powerpress'),
669
  '<a href="http://www.blubrry.com/podcast_statistics/" target="_blank">'. __('Blubrry Media Statistics', 'powerpress') .'</a>',
670
  '<a href="'. admin_url() .'">'. __('WordPress Dashboard', 'powerpress') .'</a>',
702
  packages start at $12.</em>
703
  </p>
704
  <?php
705
+ */
706
  }
707
 
708
  function powerpressadmin_edit_media_statistics($General)
713
  $General['redirect2'] = '';
714
  if( !isset($General['redirect3']) )
715
  $General['redirect3'] = '';
 
 
 
716
  ?>
717
+ <h3><?php echo __('Media Statistics', 'powerpress'); ?> &nbsp; <span style="color: #CC0000; font-size: 11px;"><?php echo __('optional', 'powerpress'); ?></span></h3>
718
+ <div style="margin-left: 40px;">
719
+ <p>
720
+ <?php echo __('Enter your Redirect URL issued by your media statistics service provider below.', 'powerpress'); ?>
721
+ </p>
722
 
723
+ <div style="position: relative; margin-left: 40px; padding-bottom: 10px;">
724
+ <table class="form-table">
725
+ <tr valign="top">
726
+ <th scope="row">
727
+ <?php echo __('Redirect URL 1', 'powerpress'); ?>
728
+ </th>
729
+ <td>
730
+ <input type="text" style="width: 60%;" name="General[redirect1]" value="<?php echo $General['redirect1']; ?>" onChange="return CheckRedirect(this);" maxlength="250" />
731
+ </td>
732
+ </tr>
733
+ </table>
734
+ <?php if( empty($General['redirect2']) && empty($General['redirect3']) ) { ?>
735
+ <div style="position: absolute;bottom: -2px;left: -40px;" id="powerpress_redirect2_showlink">
736
+ <a href="javascript:void();" onclick="javascript:document.getElementById('powerpress_redirect2_table').style.display='block';document.getElementById('powerpress_redirect2_showlink').style.display='none';return false;"><?php echo __('Add Another Redirect', 'powerpress'); ?></a>
737
+ </div>
738
+ <?php } ?>
739
  </div>
 
 
740
 
741
+
742
+ <div id="powerpress_redirect2_table" style="position: relative;<?php if( empty($General['redirect2']) && empty($General['redirect3']) ) echo 'display:none;'; ?> margin-left: 40px; padding-bottom: 10px;">
743
+ <table class="form-table">
744
+ <tr valign="top">
745
+ <th scope="row">
746
+ <?php echo __('Redirect URL 2', 'powerpress'); ?>
747
+ </th>
748
+ <td>
749
+ <input type="text" style="width: 60%;" name="General[redirect2]" value="<?php echo $General['redirect2']; ?>" onblur="return CheckRedirect(this);" maxlength="250" />
750
+ </td>
751
+ </tr>
752
+ </table>
753
+ <?php if( $General['redirect3'] == '' ) { ?>
754
+ <div style="position: absolute;bottom: -2px;left: -40px;" id="powerpress_redirect3_showlink">
755
+ <a href="javascript:void();" onclick="javascript:document.getElementById('powerpress_redirect3_table').style.display='block';document.getElementById('powerpress_redirect3_showlink').style.display='none';return false;"><?php echo __('Add Another Redirect', 'powerpress'); ?></a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
756
  </div>
757
+ <?php } ?>
758
  </div>
759
+
760
+ <div id="powerpress_redirect3_table" style="<?php if( empty($General['redirect3']) ) echo 'display:none;'; ?> margin-left: 40px;">
761
+ <table class="form-table">
762
+ <tr valign="top">
763
+ <th scope="row">
764
+ <?php echo __('Redirect URL 3', 'powerpress'); ?>
765
+ </th>
766
+ <td>
767
+ <input type="text" style="width: 60%;" name="General[redirect3]" value="<?php echo $General['redirect3']; ?>" onblur="return CheckRedirect(this);" maxlength="250" />
768
+ </td>
769
+ </tr>
770
+ </table>
771
  </div>
772
+ <style type="text/css">
773
+ #TB_window {
774
+ border: solid 1px #3D517E;
775
+ }
776
+ </style>
777
+
778
+ <p>
779
+ <?php echo __('Need a media statistics provider?', 'powerpress'); ?>
780
+ <a href="https://secure.blubrry.com/podcast-statistics-premium/" target="_blank" style="text-decoration: none;">
781
+ <?php
782
+ echo sprintf( __('Blubrry.com offers %s access to the best statistics!', 'powerpress'),
783
+ '<strong style="color: #CC0000;">'.__('FREE', 'powerpress').'</strong>' );
784
+ ?>
785
+ </a>
786
+ </p>
787
 
788
+ <div id="blubrry_stats_box">
789
+ <div style="font-family: Arial, Helvetica, sans-serif; border: solid 1px #ADDA13; background-color:#DFF495;padding:10px; margin-top:10px; position: relative;">
790
+ <p style="font-size: 14px; margin-top: 0;">
791
+ <?php echo __('Blubrry brings you the most all-inclusive digital media statistics service available. Gain unsurpassed insights into your audience. Find out who is linking to you, listener-base demographics and geographical data with worldwide mapping. Try us! You\'ll find our custom reports and daily email summaries are info you can trust, track and build your media program on.', 'powerpress'); ?>
792
+ </p>
793
+ <p style="font-size: 14px;">
794
+ <?php echo sprintf(__('* Get %s Media Statistics by taking a few minutes and adding your podcast to Blubrry.com. What\'s the catch? Nothing! For many, our free service is all you will need. But if you\'re looking to further your abilities with media download information, we hope you consider upgrading to our paid Premium Statistics Service.', 'powerpress'),
795
+ '<strong style="color: #990000;">'. __('FREE', 'powerpress') .'</strong>'
796
+ ); ?>
797
+ </p>
798
+
799
+ <div style="text-align: center; font-size: 24px; font-weight: normal; margin-bottom: 8px;"><a href="http://www.blubrry.com/addpodcast.php?feed=<?php echo urlencode(get_feed_link('podcast')); ?>" target="_blank" style="color: #3D517E;"><?php echo __('Sign Up Now!', 'powerpress'); ?></a></div>
800
+ <div style="font-size: 85%; position: absolute; bottom: 4px; right: 8px;"><i><?php echo __('* some restrictions apply', 'powerpress'); ?> <a href="http://www.blubrry.com/podcast_statistics/" target="_blank"><?php echo __('learn more', 'powerpress'); ?></a></i></div>
801
+ </div>
802
+ </div>
803
  </div>
804
  <?php
805
  }
823
  $General['player_height'] = '';
824
  if( !isset($General['player_width_audio']) )
825
  $General['player_width_audio'] = '';
826
+ if( !isset($General['disable_appearance']) )
827
+ $General['disable_appearance'] = false;
828
 
829
 
830
  $Players = array('podcast'=>__('Default Podcast (podcast)', 'powerpress') );
840
 
841
  ?>
842
 
843
+ <h3><?php echo __('Media Appearance Settings', 'powerpress'); ?></h3>
844
 
845
+ <div id="enable_presentation_settings">
846
 
847
+ <table class="form-table">
 
 
 
848
  <tr valign="top">
849
+ <th scope="row">&nbsp; </th>
850
+ <td>
851
+ <ul>
852
+ <li><label><input type="radio" name="General[disable_appearance]" value="0" <?php if( $General['disable_appearance'] == 0 ) echo 'checked'; ?> onclick="javascript: jQuery('#presentation_settings').css('display', (this.checked?'block':'none') );" /> <?php echo __('Enable PowerPress Media Players and Links', 'powerpress'); ?></label> (<?php echo __('default', 'powerpress'); ?>)</li>
853
+ <li>
854
+ <ul>
855
+ <li><?php echo __('PowerPress will add media players and links to your site.', 'powerpress'); ?></li>
856
+ </ul>
857
+ </li>
858
+
859
+ <li><label><input type="radio" name="General[disable_appearance]" value="1" <?php if( $General['disable_appearance'] == 1 ) echo 'checked'; ?> onclick="javascript: jQuery('#presentation_settings').css('display', (this.checked?'none':'block') );" /> <?php echo __('Disable PowerPress Media Players and Links', 'powerpress'); ?></label></li>
860
+ <li>
861
+ <ul>
862
+ <li><?php echo __('PowerPress will <u>not</u> add any media players or media links to your site. PowerPress will only be used to add podcasting support to your feeds.', 'powerpress'); ?></li>
863
+ </ul>
864
+ </li>
865
+ </ul>
866
+ </td>
867
+ </tr>
868
+ </table>
869
+ </div>
870
 
871
+ <div id="presentation_settings"<?php if($General['disable_appearance']) echo ' style="display: none;"'; ?>><!-- start presentation settings -->
872
+ <h3><?php echo __('Blog Posts and Pages', 'powerpress'); ?></h3>
873
 
874
+ <table class="form-table">
875
+ <tr valign="top">
876
+ <th scope="row"><?php echo __('Display Media & Links', 'powerpress'); ?></th>
877
+ <td>
878
+ <ul>
879
+ <li><label><input type="radio" name="General[display_player]" value="1" <?php if( $General['display_player'] == 1 ) echo 'checked'; ?> /> <?php echo __('Below page content', 'powerpress'); ?></label> (<?php echo __('default', 'powerpress'); ?>)</li>
880
+ <li>
881
+ <ul>
882
+ <li><?php echo __('Player and media links will appear <u>below</u> your post and page content.', 'powerpress'); ?></li>
883
+ </ul>
884
+ </li>
885
+
886
+ <li><label><input type="radio" name="General[display_player]" value="2" <?php if( $General['display_player'] == 2 ) echo 'checked'; ?> /> <?php echo __('Above page content', 'powerpress'); ?></label></li>
887
+ <li>
888
+ <ul>
889
+ <li><?php echo __('Player and media links will appear <u>above</u> your post and page content.', 'powerpress'); ?></li>
890
+ </ul>
891
+ </li>
892
+ <li><label><input type="radio" name="General[display_player]" value="0" <?php if( $General['display_player'] == 0 ) echo 'checked'; ?> /> <?php echo __('Disable', 'powerpress'); ?></label></li>
893
+ <li>
894
+ <ul>
895
+ <li><?php echo __('Player and media links will <u>NOT</u> appear in your post and page content. Media player and links can be added manually by using the <i>shortcode</i> below.', 'powerpress'); ?></li>
896
+ </ul>
897
+ </li>
898
+ </ul>
899
+ <p><input name="General[display_player_excerpt]" type="checkbox" value="1" <?php if( !empty($General['display_player_excerpt']) ) echo 'checked '; ?>/> <?php echo __('Display media / links in:', 'powerpress'); ?> <a href="http://codex.wordpress.org/Template_Tags/the_excerpt" title="<?php echo __('WordPress Excerpts', 'powerpress'); ?>" target="_blank"><?php echo __('WordPress Excerpts', 'powerpress'); ?></a> (<?php echo __('e.g. search results', 'powerpress'); ?>)</p>
900
  </td>
901
  </tr>
902
 
905
  <?php echo __('PowerPress Shortcode', 'powerpress'); ?></th>
906
  <td>
907
  <p>
908
+ <?php echo sprintf(__('The %s shortcode is used to position your media presentation (player and download links) exactly where you want within your post or page content.', 'powerpress'), '<code>[powerpress]</code>'); ?>
909
+ <?php echo __('Simply insert the following code on a new line in your content.', 'powerpress'); ?>
910
  </p>
911
  <div style="margin-left: 30px;">
912
  <code>[powerpress]</code>
919
 
920
  <tr valign="top">
921
  <th scope="row">
922
+ <?php echo __('Media Player', 'powerpress'); ?></th>
923
+ <td>
 
 
 
 
 
924
 
925
+ <p><label><input type="checkbox" name="PlayerSettings[display_media_player]" value="2" <?php if( $General['player_function'] == 1 || $General['player_function'] == 2 ) echo 'checked '; ?>/> <?php echo __('Display Player', 'powerpress'); ?></label></p>
926
+ <?php /* ?>
927
+ <p style="margin-left: 35px;"><input type="checkbox" name="General[display_player_disable_mobile]" value="1" <?php if( !empty($General['display_player_disable_mobile']) ) echo 'checked '; ?>/> <?php echo __('Disable Media Player for known mobile devices.', 'powerpress'); ?></p>
928
+ <?php */ ?>
929
+ <p><?php echo __('Detected mobile and tablet devices use an HTML5 player with a fallback link to download the media.', 'powerpress'); ?></p>
930
  </td>
931
  </tr>
932
  </table>
939
  <tr valign="top">
940
  <th scope="row">
941
 
942
+ <?php echo __('Media Links', 'powerpress'); ?></th>
943
  <td>
944
+ <p><label><input type="checkbox" name="PlayerSettings[display_pinw]" value="3" <?php if( $General['player_function'] == 3 || $General['player_function'] == 1 ) echo 'checked '; ?>/> <?php echo __('Display Play in new Window Link', 'powerpress'); ?></label></p>
 
 
 
 
 
945
 
946
+ <p><label><input type="checkbox" name="PlayerSettings[display_download]" value="1" <?php if( $General['podcast_link'] != 0 ) echo 'checked '; ?>/> <?php echo __('Display Download Link', 'powerpress'); ?></label></p>
947
+
948
+ <p style="margin-left: 35px;"><input type="checkbox" id="display_download_size" name="PlayerSettings[display_download_size]" value="1" <?php if( $General['podcast_link'] == 2 || $General['podcast_link'] == 3 ) echo 'checked'; ?> onclick="if( !this.checked ) { jQuery('#display_download_duration').removeAttr('checked'); }" /> <?php echo __('Include file size', 'powerpress'); ?>
949
+ <input type="checkbox" style="margin-left: 30px;" id="display_download_duration" name="PlayerSettings[display_download_duration]" value="1" <?php if( $General['podcast_link'] == 3 ) echo 'checked'; ?> onclick="if( this.checked ) { jQuery('#display_download_size').attr('checked','checked'); }" /> <?php echo __('Include file size and duration', 'powerpress'); ?></p>
950
+
951
+ <p><label><input type="checkbox" name="General[podcast_embed]" value="1" <?php if( $General['podcast_embed'] != 0 ) echo 'checked '; ?>/> <?php echo __('Display Player Embed Link', 'powerpress'); ?> <?php echo powerpressadmin_new(); ?></label></p>
952
+ <p style="margin-left: 35px;">
953
+ <input type="checkbox" name="General[podcast_embed_in_feed]" value="1" <?php if( !empty($General['podcast_embed_in_feed']) ) echo 'checked'; ?> /> <?php echo __('Include embed in feeds', 'powerpress'); ?>
954
+ </p>
955
+ <p><?php echo __('Embed option only works for Flow Player Classic and HTML5 Video player.', 'powerpress'); ?></p>
956
  </td>
957
  </tr>
958
+ </table>
959
 
 
 
 
960
 
961
 
962
+
963
+ <table class="form-table">
964
  <tr valign="top">
965
  <th scope="row" style="background-image: url(../wp-includes/images/smilies/icon_exclaim.gif); background-position: 10px 10px; background-repeat: no-repeat; ">
966
 
982
  </tr>
983
  </table>
984
 
985
+
986
+ <!-- start advanced features -->
 
 
987
  <div id="new_window_settings" style="display: <?php echo ( $General['player_function']==1 || $General['player_function']==3 ?'block':'none'); ?>">
988
  <h3><?php echo __('Play in New Window Settings', 'powerpress'); ?></h3>
989
  <table class="form-table">
994
  </th>
995
  <td>
996
  <input type="text" name="General[new_window_width]" style="width: 50px;" onkeyup="javascript:this.value=this.value.replace(/[^0-9]/g, '');" value="<?php echo $General['new_window_width']; ?>" maxlength="4" />
997
+ <?php echo __('Width of new window (leave blank for 420 default)', 'powerpress'); ?>
998
  </td>
999
  </tr>
1000
 
1009
  </tr>
1010
  </table>
1011
  </div>
1012
+ <!-- end advanced features -->
 
 
 
 
1013
 
1014
+ </div>
1015
+ <!-- end presentation settings -->
1016
+ <?php
1017
+ } // End powerpress_admin_appearance()
 
 
 
 
 
 
1018
 
 
 
 
 
 
 
 
 
 
1019
 
1020
+ function powerpressadmin_welcome($GeneralSettings)
1021
+ {
1022
+ ?>
1023
+ <div>
1024
+ <div class="powerpress-welcome-news">
1025
+ <h2><?php echo __('Blubrry PowerPress and Community Podcast', 'powerpress'); ?></h2>
1026
+ <?php powerpressadmin_community_news(); ?>
1027
+ <p style="margin-bottom: 0; font-size: 85%;">
1028
+ <input type="checkbox" name="General[disable_dashboard_news]" value="1" <?php echo (empty($GeneralSettings['disable_dashboard_news'])?'':'checked'); ?> /> <?php echo __('Remove from dashboard', 'powerpress'); ?>
1029
+ </p>
1030
+ </div>
1031
+ <div class="powerpress-welcome-highlighted">
1032
+ <div>
1033
+ <h2><?php echo __('Highlighted Topics', 'powerpress'); ?></h2>
1034
+ <?php powerpressadmin_community_highlighted(); ?>
1035
+ </div>
1036
+ </div>
1037
+ <div class="clear"></div>
1038
+ </div>
1039
  <?php
1040
+ } // End powerpressadmin_welcome()
 
 
 
 
 
 
 
 
1041
 
1042
+ function powerpressadmin_edit_tv($FeedSettings = false, $feed_slug='podcast', $cat_ID=false)
1043
+ {
1044
+ if( !isset($FeedSettings['parental_rating']) )
1045
+ $FeedSettings['parental_rating'] = '';
1046
 
 
 
 
1047
  ?>
1048
+ <h3><?php echo __('T.V. Settings', 'powerpress'); ?></h3>
 
 
 
 
 
 
 
 
 
 
 
 
1049
  <table class="form-table">
1050
  <tr valign="top">
1051
  <th scope="row">
1052
+ <?php echo __('Parental Rating', 'powerpress'); ?> <?php echo powerpressadmin_new(); ?></th>
 
1053
  <td>
1054
+ <p><?php echo sprintf(__('A parental rating is used to display your content on %s applications available on Internet connected TV\'s. The TV Parental Rating applies to both audio and video media.', 'powerpress'), '<strong><a href="http://www.blubrry.com/roku_blubrry/" target="_blank">Blubrry</a></strong>'); ?></p>
1055
+ <?php
1056
+ $Ratings = array(''=>__('No rating specified', 'powerpress'),
1057
+ 'TV-Y'=>__('Children of all ages', 'powerpress'),
1058
+ 'TV-Y7'=>__('Children 7 years and older', 'powerpress'),
1059
+ 'TV-Y7-FV'=>__('Children 7 years and older [fantasy violence]', 'powerpress'),
1060
+ 'TV-G'=>__('General audience', 'powerpress'),
1061
+ 'TV-PG'=>__('Parental guidance suggested', 'powerpress'),
1062
+ 'TV-14'=>__('May be unsuitable for children under 14 years of age', 'powerpress'),
1063
+ 'TV-MA'=>__('Mature audience - may be unsuitable for children under 17', 'powerpress')
1064
+ );
1065
+ $RatingsTips = array(''=>'',
1066
+ 'TV-Y'=>__('Whether animated or live-action, the themes and elements in this program are specifically designed for a very young audience, including children from ages 2-6. These programs are not expected to frighten younger children. Examples of programs issued this rating include Sesame Street, Barney & Friends, Dora the Explorer, Go, Diego, Go! and The Backyardigans.', 'powerpress'),
1067
+ 'TV-Y7'=>__('These shows may or may not be appropriate for some children under the age of 7. This rating may include crude, suggestive humor, mild fantasy violence, or content considered too scary or controversial to be shown to children under seven. Examples include Foster\'s Home for Imaginary Friends, Johnny Test, and SpongeBob SquarePants.', 'powerpress'),
1068
+ 'TV-Y7-FV'=>__('When a show has noticeably more fantasy violence, it is assigned the TV-Y7-FV rating. Action-adventure shows such Pokemon series and the Power Rangers series are assigned a TV-Y7-FV rating.', 'powerpress'),
1069
+ 'TV-G'=>__('Although this rating does not signify a program designed specifically for children, most parents may let younger children watch this program unattended. It contains little or no violence, no strong language and little or no sexual dialogue or situation. Networks that air informational, how-to content, or generally inoffensive content.', 'powerpress'),
1070
+ 'TV-PG'=>__('This rating signifies that the program may be unsuitable for younger children without the guidance of a parent. Many parents may want to watch it with their younger children. Various game shows and most reality shows are rated TV-PG for their suggestive dialog, suggestive humor, and/or coarse language. Some prime-time sitcoms such as Everybody Loves Raymond, Fresh Prince of Bel-Air, The Simpsons, Futurama, and Seinfeld usually air with a TV-PG rating.', 'powerpress'),
1071
+ 'TV-14'=>__('Parents are strongly urged to exercise greater care in monitoring this program and are cautioned against letting children of any age watch unattended. This rating may be accompanied by any of the following sub-ratings:', 'powerpress'),
1072
+ 'TV-MA'=>__('A TV-MA rating means the program may be unsuitable for those below 17. The program may contain extreme graphic violence, strong profanity, overtly sexual dialogue, very coarse language, nudity and/or strong sexual content. The Sopranos is a popular example.', 'powerpress')
1073
+ );
1074
+
1075
+
1076
+ while( list($rating,$title) = each($Ratings) )
1077
+ {
1078
+ $tip = $RatingsTips[ $rating ];
1079
+ ?>
1080
+ <div style="margin-bottom: 10px;"><label><input type="radio" name="Feed[parental_rating]" value="<?php echo $rating; ?>" <?php if( $FeedSettings['parental_rating'] == $rating) echo 'checked'; ?> /> <?php if( $rating ) { ?><strong><?php echo $rating; ?></strong><?php } else { ?><strong><?php echo htmlspecialchars($title); ?></strong><?php } ?></label>
1081
+ <?php if( $rating ) { ?> <span style="margin-left: 8px;"><a href="#" class="powerpress-parental-rating-tip" id="rating_tip_<?php echo $rating; ?>"><?php echo htmlspecialchars($title); ?></a><?php } ?></span>
1082
+ <p style="margin: 5px 50px; display: none;" id="rating_tip_<?php echo $rating; ?>_p" class="powerpress-parental-rating-tip-p"><?php echo htmlspecialchars($tip); ?></p>
1083
+ </div>
1084
+ <?php
1085
+ }
1086
+ ?>
1087
  </td>
1088
  </tr>
1089
  </table>
1090
 
1091
+
1092
+ <?php
1093
+ }
1094
 
1095
  ?>
powerpressadmin-categoryfeeds.php CHANGED
@@ -64,19 +64,8 @@ function powerpress_admin_categoryfeeds()
64
 
65
  <tfoot>
66
  <tr>
67
- <?php
68
- if( function_exists('print_column_headers') )
69
- {
70
  print_column_headers('powerpressadmin_categoryfeeds', false);
71
- }
72
- else // WordPress 2.6 or older
73
- {
74
- ?>
75
- <th scope="col" class="manage-column column-name"><?php echo __('Category Name', 'powerpress'); ?></th>
76
- <th scope="col" class="manage-column column-feed-slug"><?php echo __('Slug', 'powerpress'); ?></th>
77
- <th scope="col" class="manage-column column-url"><?php echo __('Feed URL', 'powerpress'); ?></th>
78
- <?php
79
- }
80
  ?>
81
  </tr>
82
  </tfoot>
@@ -127,10 +116,10 @@ function powerpress_admin_categoryfeeds()
127
  }; break;
128
  case 'name': {
129
 
130
- echo '<td '.$class.'><strong><a class="row-title" href="'.$edit_link.'" title="' . attribute_escape(sprintf(__('Edit "%s"', 'powerpress'), $feed_title)) . '">'.$feed_title.'</a></strong><br />';
131
  $actions = array();
132
  $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit', 'powerpress') . '</a>';
133
- $actions['remove'] = "<a class='submitdelete' href='". admin_url() . wp_nonce_url("admin.php?page=powerpress/powerpressadmin_categoryfeeds.php&amp;action=powerpress-delete-category-feed&amp;cat=$cat_ID", 'powerpress-delete-category-feed-' . $cat_ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( __("You are about to remove podcast settings for category feed '%s'\n 'Cancel' to stop, 'OK' to delete.", 'powerpress'), $feed_title )) . "') ) { return true;}return false;\">" . __('Remove', 'powerpress') . "</a>";
134
  $action_count = count($actions);
135
  $i = 0;
136
  echo '<div class="row-actions">';
@@ -146,7 +135,7 @@ function powerpress_admin_categoryfeeds()
146
 
147
  case 'url': {
148
 
149
- echo "<td $class><a href='$url' title='". attribute_escape(sprintf(__('Visit %s', 'powerpress'), $feed_title))."' target=\"_blank\">$short_url</a>";
150
  echo '<div class="row-actions">';
151
  echo '<span class="'.$action .'"><a href="http://www.feedvalidator.org/check.cgi?url='. urlencode( str_replace('&amp;', '&', $url) ) .'" target="_blank">' . __('Validate Feed', 'powerpress') . '</a></span>';
152
  echo '</div>';
@@ -188,7 +177,7 @@ function powerpress_admin_categoryfeeds()
188
  <select name="cat" id="cat_id" style="width: 100%;">
189
  <option value=""><?php echo __('Select Category', 'powerpress'); ?></option>
190
  <?php
191
- wp_dropdown_cats();
192
  ?>
193
  </select>
194
 
64
 
65
  <tfoot>
66
  <tr>
67
+ <?php
 
 
68
  print_column_headers('powerpressadmin_categoryfeeds', false);
 
 
 
 
 
 
 
 
 
69
  ?>
70
  </tr>
71
  </tfoot>
116
  }; break;
117
  case 'name': {
118
 
119
+ echo '<td '.$class.'><strong><a class="row-title" href="'.$edit_link.'" title="' . esc_attr(sprintf(__('Edit "%s"', 'powerpress'), $feed_title)) . '">'.$feed_title.'</a></strong><br />';
120
  $actions = array();
121
  $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit', 'powerpress') . '</a>';
122
+ $actions['remove'] = "<a class='submitdelete' href='". admin_url() . wp_nonce_url("admin.php?page=powerpress/powerpressadmin_categoryfeeds.php&amp;action=powerpress-delete-category-feed&amp;cat=$cat_ID", 'powerpress-delete-category-feed-' . $cat_ID) . "' onclick=\"if ( confirm('" . esc_js(sprintf( __("You are about to remove podcast settings for category feed '%s'\n 'Cancel' to stop, 'OK' to delete.", 'powerpress'), $feed_title )) . "') ) { return true;}return false;\">" . __('Remove', 'powerpress') . "</a>";
123
  $action_count = count($actions);
124
  $i = 0;
125
  echo '<div class="row-actions">';
135
 
136
  case 'url': {
137
 
138
+ echo "<td $class><a href='$url' title='". esc_attr(sprintf(__('Visit %s', 'powerpress'), $feed_title))."' target=\"_blank\">$short_url</a>";
139
  echo '<div class="row-actions">';
140
  echo '<span class="'.$action .'"><a href="http://www.feedvalidator.org/check.cgi?url='. urlencode( str_replace('&amp;', '&', $url) ) .'" target="_blank">' . __('Validate Feed', 'powerpress') . '</a></span>';
141
  echo '</div>';
177
  <select name="cat" id="cat_id" style="width: 100%;">
178
  <option value=""><?php echo __('Select Category', 'powerpress'); ?></option>
179
  <?php
180
+ wp_dropdown_categories();
181
  ?>
182
  </select>
183
 
powerpressadmin-customfeeds.php CHANGED
@@ -50,40 +50,16 @@ function powerpress_admin_customfeeds()
50
  <table class="widefat fixed" cellspacing="0">
51
  <thead>
52
  <tr>
53
- <?php
54
- if( function_exists('print_column_headers') )
55
- {
56
  print_column_headers('powerpressadmin_customfeeds');
57
- }
58
- else // WordPress 2.6 or older
59
- {
60
- ?>
61
- <th scope="col" id="name" class="manage-column column-name"><?php echo __('Name', 'powerpress'); ?></th>
62
- <th scope="col" id="feed-slug" class="manage-column column-feed-slug"><?php echo __('Slug', 'powerpress'); ?></th>
63
- <th scope="col" id="episode-count" class="manage-column column-episode-count"><?php echo __('Episodes', 'powerpress'); ?></th>
64
- <th scope="col" id="url" class="manage-column column-url"><?php echo __('URL', 'powerpress'); ?></th>
65
- <?php
66
- }
67
  ?>
68
  </tr>
69
  </thead>
70
 
71
  <tfoot>
72
  <tr>
73
- <?php
74
- if( function_exists('print_column_headers') )
75
- {
76
  print_column_headers('powerpressadmin_customfeeds', false);
77
- }
78
- else // WordPress 2.6 or older
79
- {
80
- ?>
81
- <th scope="col" class="manage-column column-name"><?php echo __('Name', 'powerpress'); ?></th>
82
- <th scope="col" class="manage-column column-feed-slug"><?php echo __('Slug', 'powerpress'); ?></th>
83
- <th scope="col" class="manage-column column-episode-count"><?php echo __('Episodes', 'powerpress'); ?></th>
84
- <th scope="col" class="manage-column column-url"><?php echo __('URL', 'powerpress'); ?></th>
85
- <?php
86
- }
87
  ?>
88
  </tr>
89
  </tfoot>
@@ -137,10 +113,10 @@ function powerpress_admin_customfeeds()
137
  }; break;
138
  case 'name': {
139
 
140
- echo '<td '.$class.'><strong><a class="row-title" href="'.$edit_link.'" title="' . attribute_escape(sprintf(__('Edit "%s"', 'powerpress'), $feed_title)) . '">'.$feed_title.'</a></strong>'. ( $feed_slug == 'podcast' ?' ('. __('default channel', 'powerpress') .')':'').'<br />';
141
  $actions = array();
142
  $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit', 'powerpress') . '</a>';
143
- $actions['delete'] = "<a class='submitdelete' href='". admin_url() . wp_nonce_url("admin.php?page=powerpress/powerpressadmin_customfeeds.php&amp;action=powerpress-delete-feed&amp;feed_slug=$feed_slug", 'powerpress-delete-feed-' . $feed_slug) . "' onclick=\"if ( confirm('" . js_escape(sprintf( __("You are about to delete feed '%s'\n 'Cancel' to stop, 'OK' to delete.", 'powerpress'), $feed_title )) . "') ) { return true;}return false;\">" . __('Delete', 'powerpress') . "</a>";
144
  if( !isset($General['custom_feeds'][ $feed_slug ]) )
145
  {
146
  unset($actions['delete']);
@@ -160,7 +136,7 @@ function powerpress_admin_customfeeds()
160
 
161
  case 'url': {
162
 
163
- echo "<td $class><a href='$url' title='". attribute_escape(sprintf(__('Visit %s', 'powerpress'), $feed_title))."' target=\"_blank\">$short_url</a>";
164
  echo '<div class="row-actions">';
165
  echo '<span class="'.$action .'"><a href="http://www.feedvalidator.org/check.cgi?url='. urlencode($url) .'" target="_blank">' . __('Validate Feed', 'powerpress') . '</a></span>';
166
  echo '</div>';
@@ -231,7 +207,7 @@ function powerpress_admin_customfeeds()
231
  <?php echo __('Example 2: You have a video podcast with multiple file formats. Use the default podcast channel for the main media that you want to appear on your blog (e.g. m4v). Create additional channels for the remaining formats (e.g. wmv, mov, mpeg).', 'powerpress'); ?>
232
  </p>
233
  <p>
234
- <?php echo __('Example 3: You create two versions of your podcast, a 20 minute summary and a full 2 hour episode. Use the default channel for your 20 minute summary episodes and create a new custom channels for your full length episodes.', 'powerpress'); ?>
235
  </p>
236
 
237
  <?php
50
  <table class="widefat fixed" cellspacing="0">
51
  <thead>
52
  <tr>
53
+ <?php
 
 
54
  print_column_headers('powerpressadmin_customfeeds');
 
 
 
 
 
 
 
 
 
 
55
  ?>
56
  </tr>
57
  </thead>
58
 
59
  <tfoot>
60
  <tr>
61
+ <?php
 
 
62
  print_column_headers('powerpressadmin_customfeeds', false);
 
 
 
 
 
 
 
 
 
 
63
  ?>
64
  </tr>
65
  </tfoot>
113
  }; break;
114
  case 'name': {
115
 
116
+ echo '<td '.$class.'><strong><a class="row-title" href="'.$edit_link.'" title="' . esc_attr(sprintf(__('Edit "%s"', 'powerpress'), $feed_title)) . '">'.$feed_title.'</a></strong>'. ( $feed_slug == 'podcast' ?' ('. __('default channel', 'powerpress') .')':'').'<br />';
117
  $actions = array();
118
  $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit', 'powerpress') . '</a>';
119
+ $actions['delete'] = "<a class='submitdelete' href='". admin_url() . wp_nonce_url("admin.php?page=powerpress/powerpressadmin_customfeeds.php&amp;action=powerpress-delete-feed&amp;feed_slug=$feed_slug", 'powerpress-delete-feed-' . $feed_slug) . "' onclick=\"if ( confirm('" . esc_js(sprintf( __("You are about to delete feed '%s'\n 'Cancel' to stop, 'OK' to delete.", 'powerpress'), $feed_title )) . "') ) { return true;}return false;\">" . __('Delete', 'powerpress') . "</a>";
120
  if( !isset($General['custom_feeds'][ $feed_slug ]) )
121
  {
122
  unset($actions['delete']);
136
 
137
  case 'url': {
138
 
139
+ echo "<td $class><a href='$url' title='". esc_attr(sprintf(__('Visit %s', 'powerpress'), $feed_title))."' target=\"_blank\">$short_url</a>";
140
  echo '<div class="row-actions">';
141
  echo '<span class="'.$action .'"><a href="http://www.feedvalidator.org/check.cgi?url='. urlencode($url) .'" target="_blank">' . __('Validate Feed', 'powerpress') . '</a></span>';
142
  echo '</div>';
207
  <?php echo __('Example 2: You have a video podcast with multiple file formats. Use the default podcast channel for the main media that you want to appear on your blog (e.g. m4v). Create additional channels for the remaining formats (e.g. wmv, mov, mpeg).', 'powerpress'); ?>
208
  </p>
209
  <p>
210
+ <?php echo __('Example 3: You create two versions of your podcast, a 20 minute summary and a full 2 hour episode. Use the default channel for your 20 minute summary episodes and create a new custom channel for your full length episodes.', 'powerpress'); ?>
211
  </p>
212
 
213
  <?php
powerpressadmin-dashboard.php CHANGED
@@ -2,9 +2,38 @@
2
 
3
  if( !function_exists('add_action') )
4
  die("access denied.");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
  function powerpress_dashboard_head()
7
  {
 
8
  ?>
9
  <style type="text/css">
10
  #blubrry_stats_summary {
@@ -46,6 +75,14 @@ function powerpress_dashboard_head()
46
  .blubrry_stats_updated {
47
  font-size: 80%;
48
  }
 
 
 
 
 
 
 
 
49
  </style>
50
  <?php
51
  }
@@ -106,7 +143,27 @@ function powerpress_dashboard_stats_content()
106
  </div>
107
  <?php
108
  }
109
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
 
111
  function powerpress_dashboard_setup()
112
  {
@@ -114,16 +171,96 @@ function powerpress_dashboard_setup()
114
  return;
115
 
116
  $Settings = get_option('powerpress_general');
 
 
117
 
118
  if( isset($Settings['disable_dashboard_widget']) && $Settings['disable_dashboard_widget'] == 1 )
119
- return; // Lets not do anythign to the dashboard for PowerPress Statistics
 
 
 
120
 
121
  if( @$Settings['use_caps'] && !current_user_can('view_podcast_stats') )
122
- return;
123
-
124
  if( $Settings )
125
  {
126
- wp_add_dashboard_widget( 'powerpress_dashboard_stats', __( 'Blubrry Podcast Statistics', 'powerpress'), 'powerpress_dashboard_stats_content' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  }
128
  }
129
 
2
 
3
  if( !function_exists('add_action') )
4
  die("access denied.");
5
+
6
+ define('POWERPRESS_FEED_HIGHLIGHTED', 'http://www.powerpresspodcast.com/category/highlighted/feed/?order=ASC');
7
+ define('POWERPRESS_FEED_NEWS', 'http://www.powerpresspodcast.com/feed/');
8
+
9
+ function powerpress_get_news($feed_url, $limit=10)
10
+ {
11
+ include_once(ABSPATH . WPINC . '/feed.php');
12
+ $rss = fetch_feed( $feed_url );
13
+
14
+ // Bail if feed doesn't work
15
+ if ( is_wp_error($rss) )
16
+ return false;
17
+
18
+ $rss_items = $rss->get_items( 0, $rss->get_item_quantity( $limit ) );
19
+
20
+ // If the feed was erroneously
21
+ if ( !$rss_items ) {
22
+ $md5 = md5( $this->feed );
23
+ delete_transient( 'feed_' . $md5 );
24
+ delete_transient( 'feed_mod_' . $md5 );
25
+ $rss = fetch_feed( $this->feed );
26
+ $rss_items = $rss->get_items( 0, $rss->get_item_quantity( $num ) );
27
+ }
28
+
29
+ return $rss_items;
30
+
31
+ }
32
+
33
 
34
  function powerpress_dashboard_head()
35
  {
36
+ echo "<script type=\"text/javascript\" src=\"". powerpress_get_root_url() ."player.js\"></script>\n";
37
  ?>
38
  <style type="text/css">
39
  #blubrry_stats_summary {
75
  .blubrry_stats_updated {
76
  font-size: 80%;
77
  }
78
+ .powerpress-news-dashboard {
79
+ /* background-image:url(http://images.blubrry.com/powerpress/blubrry_logo.png);
80
+ background-repeat: no-repeat;
81
+ background-position: top right; */
82
+ }
83
+ .powerpress-news-dashboard .powerpressNewsPlayer {
84
+ margin-top: 5px;
85
+ }
86
  </style>
87
  <?php
88
  }
143
  </div>
144
  <?php
145
  }
146
+
147
+
148
+ function powerpress_dashboard_news_content()
149
+ {
150
+ $Settings = get_option('powerpress_general');
151
+
152
+ if( isset($Settings['disable_dashboard_news']) && $Settings['disable_dashboard_news'] == 1 )
153
+ return; // Lets not do anything to the dashboard for PowerPress News
154
+
155
+ powerpressadmin_community_news();
156
+ }
157
+
158
+
159
+ function powerpress_feed_text_limit( $text, $limit, $finish = '&hellip;') {
160
+ if( strlen( $text ) > $limit ) {
161
+ $text = substr( $text, 0, $limit );
162
+ $text = substr( $text, 0, - ( strlen( strrchr( $text,' ') ) ) );
163
+ $text .= $finish;
164
+ }
165
+ return $text;
166
+ }
167
 
168
  function powerpress_dashboard_setup()
169
  {
171
  return;
172
 
173
  $Settings = get_option('powerpress_general');
174
+ $StatsDashboard = true;
175
+ $NewsDashboard = true;
176
 
177
  if( isset($Settings['disable_dashboard_widget']) && $Settings['disable_dashboard_widget'] == 1 )
178
+ $StatsDashboard = false; // Lets not do anythign to the dashboard for PowerPress Statistics
179
+
180
+ if( isset($Settings['disable_dashboard_news']) && $Settings['disable_dashboard_news'] == 1 )
181
+ $NewsDashboard = false; // Lets not do anythign to the dashboard for PowerPress Statistics
182
 
183
  if( @$Settings['use_caps'] && !current_user_can('view_podcast_stats') )
184
+ $StatsDashboard = false;
185
+
186
  if( $Settings )
187
  {
188
+ if( $NewsDashboard )
189
+ wp_add_dashboard_widget( 'powerpress_dashboard_news', __( 'Blubrry PowerPress & Community Podcast', 'powerpress'), 'powerpress_dashboard_news_content' );
190
+
191
+ if( $StatsDashboard )
192
+ wp_add_dashboard_widget( 'powerpress_dashboard_stats', __( 'Blubrry Podcast Statistics', 'powerpress'), 'powerpress_dashboard_stats_content' );
193
+ }
194
+
195
+ $user_options = get_user_option('powerpress_user');
196
+ if( empty($user_options) || empty($user_options['dashboard_installed']) || $user_options['dashboard_installed'] < 2 )
197
+ {
198
+ if( !is_array($user_options) )
199
+ $user_options = array();
200
+ $user = wp_get_current_user();
201
+
202
+ // First time we've seen this setting, so must be first time we've added the widgets, lets stack them at the top for convenience.
203
+ powerpressadmin_add_dashboard_widgets($user->ID);
204
+ $user_options['dashboard_installed'] = 2; // version of PowerPress
205
+ update_user_option($user->ID, "powerpress_user", $user_options, true);
206
+ }
207
+ else
208
+ {
209
+ powerpressadmin_add_dashboard_widgets(false);
210
+ }
211
+ }
212
+
213
+ function powerpressadmin_add_dashboard_widgets( $check_user_id = false)
214
+ {
215
+ // Only re-order the powerpress widgets if they aren't already on the dashboard:
216
+ if( $check_user_id )
217
+ {
218
+ $user_options = get_user_option('meta-box-order_dashboard', $check_user_id);
219
+ if( $user_options )
220
+ {
221
+ $save = false;
222
+ if( !preg_match('/powerpress_dashboard_stats/', $user_options['normal']) && !preg_match('/powerpress_dashboard_stats/', $user_options['side']) && !preg_match('/powerpress_dashboard_stats/', $user_options['column3']) && !preg_match('/powerpress_dashboard_stats/', $user_options['column4']) )
223
+ {
224
+ $save = true;
225
+ if( !empty($user_options['side']) )
226
+ $user_options['side'] = 'powerpress_dashboard_stats,'.$user_options['side'];
227
+ else
228
+ $user_options['normal'] = 'powerpress_dashboard_stats,'.$user_options['normal'];
229
+ }
230
+
231
+ if( !preg_match('/powerpress_dashboard_news/', $user_options['normal']) && !preg_match('/powerpress_dashboard_news/', $user_options['side']) && !preg_match('/powerpress_dashboard_news/', $user_options['column3']) && !preg_match('/powerpress_dashboard_news/', $user_options['column4']) )
232
+ {
233
+ $save = true;
234
+ $user_options['normal'] = 'powerpress_dashboard_news,'.$user_options['normal'];
235
+ }
236
+
237
+ if( $save )
238
+ {
239
+ update_user_option($check_user_id, "meta-box-order_dashboard", $user_options, true);
240
+ }
241
+ }
242
+ }
243
+
244
+ // Reorder for all future users
245
+ global $wp_meta_boxes;
246
+ $dashboard_current = $wp_meta_boxes['dashboard']['normal']['core'];
247
+
248
+ $dashboard_powerpress = array();
249
+ if( isset( $dashboard_current['powerpress_dashboard_news'] ) )
250
+ {
251
+ $dashboard_powerpress['powerpress_dashboard_news'] = $dashboard_current['powerpress_dashboard_news'];
252
+ unset($dashboard_current['powerpress_dashboard_news']);
253
+ }
254
+
255
+ if( isset( $dashboard_current['powerpress_dashboard_stats'] ) )
256
+ {
257
+ $dashboard_powerpress['powerpress_dashboard_stats'] = $dashboard_current['powerpress_dashboard_stats'];
258
+ unset($dashboard_current['powerpress_dashboard_stats']);
259
+ }
260
+
261
+ if( count($dashboard_powerpress) > 0 )
262
+ {
263
+ $wp_meta_boxes['dashboard']['normal']['core'] = array_merge($dashboard_powerpress, $dashboard_current);
264
  }
265
  }
266
 
powerpressadmin-diagnostics.php CHANGED
@@ -254,8 +254,7 @@
254
  $message .= "<br />\n";
255
  $message .= '<strong>'. __('Important PowerPress Settings', 'powerpress') ."</strong><br />\n";
256
  $message .= " &nbsp; \t &nbsp; ". __('PowerPress version:', 'powerpress') .' '. POWERPRESS_VERSION ."<br />\n";
257
- $message .= " &nbsp; \t &nbsp; ". __('advanced mode:', 'powerpress') .' '. ( !empty($SettingsGeneral['advanced_mode']) ?'true':'false') ."<br />\n";
258
- $message .= " &nbsp; \t &nbsp; ". __('episode box mode:', 'powerpress') .' '. ( empty($SettingsGeneral['episode_box_mode']) ?__('normal', 'powerpress'): ($SettingsGeneral['episode_box_mode']==1?__('simple', 'powerpress'):__('advanced', 'powerpress')) ) ."<br />\n";
259
  $message .= " &nbsp; \t &nbsp; ". __('Podcasting capability:', 'powerpress') .' '. ( empty($SettingsGeneral['use_caps'])?__('Disabled (default)', 'powerpress'): __('Enabled', 'powerpress')) ."<br />\n";
260
  $message .= " &nbsp; \t &nbsp; ". __('Feed capability:', 'powerpress') .' '. ( empty($SettingsGeneral['feed_caps'])?__('Disabled (default)', 'powerpress'): __('Enabled', 'powerpress')) ."<br />\n";
261
  $message .= " &nbsp; \t &nbsp; ". __('Category Podcasting:', 'powerpress') .' '. ( empty($SettingsGeneral['cat_casting']) ?__('Disabled (default)', 'powerpress'): __('Enabled', 'powerpress')) ."<br />\n";
@@ -273,12 +272,12 @@
273
  $message .= " &nbsp; \t &nbsp; ". __('message 2:', 'powerpress') .' '. $powerpress_diags['detecting_media']['message2'] ."<br />\n";
274
 
275
  // Pinging iTunes
276
- $message .= "<br />\n";
277
- $message .= '<strong>'.__('Pinging iTunes', 'powerpress') ."</strong><br />\n";
278
- $message .= " &nbsp; \t &nbsp; ". __('success:', 'powerpress') .' '. ($powerpress_diags['pinging_itunes']['success']?'true':'false') ."<br />\n";
279
- $message .= " &nbsp; \t &nbsp; ". __('curl_ssl:', 'powerpress') .' '. ($powerpress_diags['pinging_itunes']['curl_ssl']?'true':'false') ."<br />\n";
280
- $message .= " &nbsp; \t &nbsp; ". __('openssl:', 'powerpress') .' '. ($powerpress_diags['pinging_itunes']['openssl']?'true':'false') ."<br />\n";
281
- $message .= " &nbsp; \t &nbsp; ". __('message:', 'powerpress') .' '. $powerpress_diags['pinging_itunes']['message'] ."<br />\n";
282
 
283
  // Uploading Artwork
284
  $message .= "<br />\n";
@@ -309,7 +308,7 @@
309
  $message .= '<strong>'.__('Active Plugins', 'powerpress') ."</strong><br />\n";
310
  while( list($null,$plugin_path) = each($current_plugins) )
311
  {
312
- $plugin_data = get_plugin_data( rtrim(WP_PLUGIN_DIR, '/'). '/'. rtrim($plugin_path, '\\/'), false, false ); //Do not apply markup/translate as it'll be cached.
313
 
314
  $message .= " &nbsp; \t &nbsp; " . __('Title:', 'powerpress') .' '. $plugin_data['Title']. "<br />\n";
315
  $message .= " &nbsp; \t &nbsp; " . __('Relative Path:', 'powerpress') .' '. $plugin_path. "<br />\n";
@@ -421,6 +420,7 @@
421
  </tr>
422
  </table>
423
 
 
424
  <h3 style="margin-bottom: 0;"><?php echo __('Pinging iTunes', 'powerpress'); ?></h3>
425
  <p style="margin: 0;"><?php echo __('The following test checks to see that your web server can make connections with Apple\'s secure ping server.', 'powerpress'); ?></p>
426
  <table class="form-table">
@@ -436,6 +436,7 @@
436
  </td>
437
  </tr>
438
  </table>
 
439
 
440
  <h3 style="margin-bottom: 0;"><?php echo __('Uploading Artwork', 'powerpress'); ?></h3>
441
  <p style="margin: 0;"><?php echo __('The following test checks to see that you can upload and store files on your web server.', 'powerpress'); ?></p>
254
  $message .= "<br />\n";
255
  $message .= '<strong>'. __('Important PowerPress Settings', 'powerpress') ."</strong><br />\n";
256
  $message .= " &nbsp; \t &nbsp; ". __('PowerPress version:', 'powerpress') .' '. POWERPRESS_VERSION ."<br />\n";
257
+ $message .= " &nbsp; \t &nbsp; ". __('episode box file size/duration fields:', 'powerpress') .' '. ( empty($SettingsGeneral['episode_box_mode']) ?__('yes', 'powerpress'): ($SettingsGeneral['episode_box_mode']==1?__('no', 'powerpress'):__('yes', 'powerpress')) ) ."<br />\n";
 
258
  $message .= " &nbsp; \t &nbsp; ". __('Podcasting capability:', 'powerpress') .' '. ( empty($SettingsGeneral['use_caps'])?__('Disabled (default)', 'powerpress'): __('Enabled', 'powerpress')) ."<br />\n";
259
  $message .= " &nbsp; \t &nbsp; ". __('Feed capability:', 'powerpress') .' '. ( empty($SettingsGeneral['feed_caps'])?__('Disabled (default)', 'powerpress'): __('Enabled', 'powerpress')) ."<br />\n";
260
  $message .= " &nbsp; \t &nbsp; ". __('Category Podcasting:', 'powerpress') .' '. ( empty($SettingsGeneral['cat_casting']) ?__('Disabled (default)', 'powerpress'): __('Enabled', 'powerpress')) ."<br />\n";
272
  $message .= " &nbsp; \t &nbsp; ". __('message 2:', 'powerpress') .' '. $powerpress_diags['detecting_media']['message2'] ."<br />\n";
273
 
274
  // Pinging iTunes
275
+ //$message .= "<br />\n";
276
+ //$message .= '<strong>'.__('Pinging iTunes', 'powerpress') ."</strong><br />\n";
277
+ //$message .= " &nbsp; \t &nbsp; ". __('success:', 'powerpress') .' '. ($powerpress_diags['pinging_itunes']['success']?'true':'false') ."<br />\n";
278
+ //$message .= " &nbsp; \t &nbsp; ". __('curl_ssl:', 'powerpress') .' '. ($powerpress_diags['pinging_itunes']['curl_ssl']?'true':'false') ."<br />\n";
279
+ //$message .= " &nbsp; \t &nbsp; ". __('openssl:', 'powerpress') .' '. ($powerpress_diags['pinging_itunes']['openssl']?'true':'false') ."<br />\n";
280
+ //$message .= " &nbsp; \t &nbsp; ". __('message:', 'powerpress') .' '. $powerpress_diags['pinging_itunes']['message'] ."<br />\n";
281
 
282
  // Uploading Artwork
283
  $message .= "<br />\n";
308
  $message .= '<strong>'.__('Active Plugins', 'powerpress') ."</strong><br />\n";
309
  while( list($null,$plugin_path) = each($current_plugins) )
310
  {
311
+ $plugin_data = get_plugin_data( rtrim(WP_PLUGIN_DIR, '/\\'). '/'. rtrim($plugin_path, '\\/'), false, false ); //Do not apply markup/translate as it'll be cached.
312
 
313
  $message .= " &nbsp; \t &nbsp; " . __('Title:', 'powerpress') .' '. $plugin_data['Title']. "<br />\n";
314
  $message .= " &nbsp; \t &nbsp; " . __('Relative Path:', 'powerpress') .' '. $plugin_path. "<br />\n";
420
  </tr>
421
  </table>
422
 
423
+ <!--
424
  <h3 style="margin-bottom: 0;"><?php echo __('Pinging iTunes', 'powerpress'); ?></h3>
425
  <p style="margin: 0;"><?php echo __('The following test checks to see that your web server can make connections with Apple\'s secure ping server.', 'powerpress'); ?></p>
426
  <table class="form-table">
436
  </td>
437
  </tr>
438
  </table>
439
+ -->
440
 
441
  <h3 style="margin-bottom: 0;"><?php echo __('Uploading Artwork', 'powerpress'); ?></h3>
442
  <p style="margin: 0;"><?php echo __('The following test checks to see that you can upload and store files on your web server.', 'powerpress'); ?></p>
powerpressadmin-editfeed.php CHANGED
@@ -134,26 +134,7 @@ function powerpress_admin_capabilities()
134
  asort($capnames);
135
  return $capnames;
136
  }
137
- $g_SupportUploads = null;
138
- function powerpressadmin_support_uploads()
139
- {
140
- global $g_SupportUploads;
141
- if( $g_SupportUploads != null )
142
- return $g_SupportUploads;
143
-
144
- $g_SupportUploads = false;
145
- $UploadArray = wp_upload_dir();
146
- if( false === $UploadArray['error'] )
147
- {
148
- $upload_path = $UploadArray['basedir'].'/powerpress/';
149
-
150
- if( !file_exists($upload_path) )
151
- $g_SupportUploads = @wp_mkdir_p( rtrim($upload_path, '/') );
152
- else
153
- $g_SupportUploads = true;
154
- }
155
- return $g_SupportUploads;
156
- }
157
 
158
  // powerpressadmin_editfeed.php
159
  function powerpress_admin_editfeed($feed_slug=false, $cat_ID =false)
@@ -211,14 +192,15 @@ function powerpress_admin_editfeed($feed_slug=false, $cat_ID =false)
211
  ?>
212
  <div id="powerpress_settings_page" class="powerpress_tabbed_content">
213
  <ul class="powerpress_settings_tabs">
214
- <li><a href="#feed_tab_feed"><span><?php echo __('Feed Settings', 'powerpress'); ?></span></a></li>
215
- <li><a href="#feed_tab_itunes"><span><?php echo __('iTunes Settings', 'powerpress'); ?></span></a></li>
 
216
  <?php if( $feed_slug ) { ?>
217
- <li><a href="#feed_tab_appearance"><span><?php echo __('Appearance', 'powerpress'); ?></span></a></li>
218
- <li><a href="#feed_tab_other"><span><?php echo __('Other Settings', 'powerpress'); ?></span></a></li>
219
  <?php } ?>
220
  <?php if( $cat_ID ) { ?>
221
- <li><a href="#feed_tab_other"><span><?php echo __('Other Settings', 'powerpress'); ?></span></a></li>
222
  <?php } ?>
223
  </ul>
224
 
@@ -240,6 +222,12 @@ function powerpress_admin_editfeed($feed_slug=false, $cat_ID =false)
240
  ?>
241
  </div>
242
 
 
 
 
 
 
 
243
  <?php if( $feed_slug ) { ?>
244
  <div id="feed_tab_appearance" class="powerpress_tab">
245
  <?php
@@ -301,15 +289,10 @@ function powerpressadmin_edit_category_feed($FeedSettings, $General)
301
 
302
  function powerpressadmin_edit_feed_general($FeedSettings, $General)
303
  {
304
- $AdvancedMode = $General['advanced_mode'];
305
  ?>
306
  <h3>Podcast Feeds</h3>
307
  <table class="form-table">
308
 
309
- <?php
310
- if( @$General['advanced_mode'] )
311
- {
312
- ?>
313
  <tr valign="top">
314
  <th scope="row">
315
 
@@ -346,15 +329,14 @@ function powerpressadmin_edit_feed_general($FeedSettings, $General)
346
  <?php echo __('Main Site Feed', 'powerpress'); ?></th>
347
  <td>
348
  <p style="margin-top: 5px; margin-bottom: 0;"><?php echo __('Main RSS2 Feed', 'powerpress'); ?>: <a href="<?php echo get_bloginfo('rss2_url'); ?>" title="<?php echo __('Main RSS 2 Feed', 'powerpress'); ?>" target="_blank"><?php echo get_bloginfo('rss2_url'); ?></a> | <a href="http://www.feedvalidator.org/check.cgi?url=<?php echo urlencode(get_bloginfo('rss2_url')); ?>" target="_blank"><?php echo __('validate', 'powerpress'); ?></a></p>
 
349
  </td>
350
  </tr>
351
- <?php
352
- }
353
- ?>
354
  <tr valign="top">
355
  <th scope="row">
356
 
357
- <?php echo __('Podcast Channel Feeds', 'powerpress'); ?></th>
358
  <td>
359
  <?php
360
 
@@ -530,10 +512,7 @@ else
530
  </td>
531
  </tr>
532
 
533
- <?php
534
- if( @$General['advanced_mode'] )
535
- {
536
- ?>
537
  <tr valign="top">
538
  <th scope="row">
539
 
@@ -566,10 +545,36 @@ if( isset($Languages[ $rss_language ]) )
566
  <input type="text" name="Feed[copyright]" style="width: 60%;" value="<?php echo $FeedSettings['copyright']; ?>" maxlength="250" />
567
  </td>
568
  </tr>
 
 
 
 
 
569
  <?php
570
- } // end advanced_mode
 
 
 
571
  ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
572
  </table>
 
573
  <?php
574
  }
575
 
@@ -766,12 +771,19 @@ function powerpressadmin_edit_itunes_feed($FeedSettings, $General, $feed_slug=fa
766
 
767
  ?>
768
  <h3><?php echo __('iTunes Feed Settings', 'powerpress'); ?></h3>
769
- <table class="form-table">
770
-
771
  <?php
772
- if( !empty($General['advanced_mode']) )
773
- {
 
 
 
774
  ?>
 
 
 
 
 
775
  <tr valign="top">
776
  <th scope="row">
777
  <?php echo __('iTunes Program Subtitle', 'powerpress'); ?> <br />
@@ -805,7 +817,7 @@ function powerpressadmin_edit_itunes_feed($FeedSettings, $General, $feed_slug=fa
805
  <?php echo __('Creates a friendlier view of your post/episode content by converting web links and images to clickable links in the iTunes application.', 'powerpress'); ?>
806
  </p>
807
  <p><strong>
808
- <?php echo __('Note: With the recent laungh of iTunes web site during the summer of 2010, Optimize iTunes Summary\'s clickable links do not appear online in the same way they do in the iTunes application. For this reason, we no longer recommend using this feature.', 'powerpress'); ?>
809
  </strong></p>
810
  <?php } else { ?>
811
 
@@ -818,9 +830,11 @@ function powerpressadmin_edit_itunes_feed($FeedSettings, $General, $feed_slug=fa
818
  <?php } ?>
819
  </td>
820
  </tr>
821
- <?php
822
- }
823
- ?>
 
 
824
  <tr valign="top">
825
  <th scope="row">
826
  <?php echo __('iTunes Program Keywords', 'powerpress'); ?> <br />
@@ -836,9 +850,15 @@ function powerpressadmin_edit_itunes_feed($FeedSettings, $General, $feed_slug=fa
836
  <?php echo __('iTunes Category', 'powerpress'); ?>
837
  </th>
838
  <td>
839
- <select name="Feed[itunes_cat_1]" style="width: 60%;">
840
  <?php
841
 
 
 
 
 
 
 
842
  $Categories = powerpress_itunes_categories(true);
843
 
844
  echo '<option value="">'. __('Select Category', 'powerpress') .'</option>';
@@ -849,19 +869,24 @@ while( list($value,$desc) = each($Categories) )
849
  reset($Categories);
850
  ?>
851
  </select>
 
 
 
 
852
  </td>
853
  </tr>
 
854
 
855
- <?php
856
- if( @$General['advanced_mode'] )
857
- {
858
- ?>
859
  <tr valign="top">
860
  <th scope="row">
861
  <?php echo __('iTunes Category 2', 'powerpress'); ?>
862
  </th>
863
  <td>
864
- <select name="Feed[itunes_cat_2]" style="width: 60%;">
865
  <?php
866
 
867
 
@@ -882,7 +907,7 @@ reset($Categories);
882
  <?php echo __('iTunes Category 3', 'powerpress'); ?>
883
  </th>
884
  <td>
885
- <select name="Feed[itunes_cat_3]" style="width: 60%;">
886
  <?php
887
 
888
  echo '<option value="">'. __('Select Category', 'powerpress') .'</option>';
@@ -895,10 +920,12 @@ reset($Categories);
895
  </select>
896
  </td>
897
  </tr>
898
- <?php
899
- } // end advanced_mode
900
- ?>
901
 
 
 
902
  <tr valign="top">
903
  <th scope="row">
904
  <?php echo __('iTunes Explicit', 'powerpress'); ?>
@@ -922,9 +949,9 @@ while( list($value,$desc) = each($explicit) )
922
  </th>
923
  <td>
924
  <input type="text" id="itunes_image" name="Feed[itunes_image]" style="width: 60%;" value="<?php echo @$FeedSettings['itunes_image']; ?>" maxlength="250" />
925
- <a href="#" onclick="javascript: window.open( document.getElementById('itunes_image').value ); return false;">preview</a>
926
 
927
- <p><?php echo __('Place the URL to the iTunes image above.', 'powerpress'); ?> <?php echo __('Example', 'powerpress'); ?>: http://mysite.com/images/itunes.jpg<br /><br />
928
  <?php echo __('iTunes prefers square .jpg or .png images that are at 600 x 600 pixels (prevously 300 x 300), which is different than what is specified for the standard RSS image.', 'powerpress'); ?></p>
929
 
930
  <p><?php echo __('Note: It may take some time (days or even a month) for iTunes to cache modified or replaced iTunes images in the iTunes Podcast Directory.', 'powerpress'); ?>
@@ -932,44 +959,38 @@ while( list($value,$desc) = each($explicit) )
932
  <?php if( $SupportUploads ) { ?>
933
  <p><input name="itunes_image_checkbox" type="checkbox" onchange="powerpress_show_field('itunes_image_upload', this.checked)" value="1" /> <?php echo __('Upload new image', 'powerpress'); ?> </p>
934
  <div style="display:none" id="itunes_image_upload">
935
- <label for="itunes_image"><?php echo __('Choose file', 'powerpress'); ?>:</label><input type="file" name="itunes_image_file" />
936
  </div>
937
  <?php } ?>
938
  </td>
939
  </tr>
940
 
941
- <?php
942
- if( @$General['advanced_mode'] )
943
- {
944
- ?>
945
  <tr valign="top">
946
  <th scope="row">
947
  <?php echo __('iTunes Talent Name', 'powerpress'); ?> <br />
948
  </th>
949
  <td>
950
- <input type="text" name="Feed[itunes_talent_name]"style="width: 60%;" value="<?php echo $FeedSettings['itunes_talent_name']; ?>" maxlength="250" /><br />
951
  <div><input type="checkbox" name="Feed[itunes_author_post]" value="1" <?php echo ( !empty($FeedSettings['itunes_author_post'])?'checked ':''); ?>/> <?php echo __('Use blog post author\'s name for individual episodes.', 'powerpress'); ?></div>
952
 
953
  </td>
954
  </tr>
955
- <?php
956
- }
957
- ?>
958
 
959
  <tr valign="top">
960
  <th scope="row">
961
  <?php echo __('iTunes Email', 'powerpress'); ?>
962
  </th>
963
  <td>
964
- <input type="text" name="Feed[email]" style="width: 60%;" value="<?php echo $FeedSettings['email']; ?>" maxlength="250" />
965
  <div>(<?php echo __('iTunes will email this address when your podcast is accepted into the iTunes Directory.', 'powerpress'); ?>)</div>
966
  </td>
967
  </tr>
968
 
969
- <?php
970
- if( @$General['advanced_mode'] )
971
- {
972
- ?>
973
  <tr valign="top">
974
  <th scope="row" >
975
 
@@ -977,6 +998,14 @@ while( list($value,$desc) = each($explicit) )
977
  <td>
978
  <div id="new_feed_url_step_1" style="display: <?php echo ( !empty($FeedSettings['itunes_new_feed_url']) || !empty($FeedSettings['itunes_new_feed_url_podcast']) ?'none':'block'); ?>;">
979
  <p style="margin-top: 5px;"><strong><a href="#" onclick="return powerpress_new_feed_url_prompt();"><?php echo __('Set iTunes New Feed URL', 'powerpress'); ?></a></strong></p>
 
 
 
 
 
 
 
 
980
  </div>
981
  <div id="new_feed_url_step_2" style="display: <?php echo ( !empty($FeedSettings['itunes_new_feed_url']) || !empty($FeedSettings['itunes_new_feed_url_podcast']) ?'block':'none'); ?>;">
982
  <p style="margin-top: 5px;"><strong><?php echo __('WARNING: Changes made here are permanent. If the New Feed URL entered is incorrect, you will lose subscribers and will no longer be able to update your listing in the iTunes Store.', 'powerpress'); ?></strong></p>
@@ -1028,9 +1057,7 @@ while( list($value,$desc) = each($explicit) )
1028
  </div>
1029
  </td>
1030
  </tr>
1031
- <?php
1032
- } // end advanced_mode
1033
- ?>
1034
 
1035
  </table>
1036
  <?php
134
  asort($capnames);
135
  return $capnames;
136
  }
137
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
 
139
  // powerpressadmin_editfeed.php
140
  function powerpress_admin_editfeed($feed_slug=false, $cat_ID =false)
192
  ?>
193
  <div id="powerpress_settings_page" class="powerpress_tabbed_content">
194
  <ul class="powerpress_settings_tabs">
195
+ <li><a href="#feed_tab_feed"><span><?php echo htmlspecialchars(__('Feed Settings', 'powerpress')); ?></span></a></li>
196
+ <li><a href="#feed_tab_itunes"><span><?php echo htmlspecialchars(__('iTunes Settings', 'powerpress')); ?></span></a></li>
197
+ <li><a href="#feed_tab_tv"><span><?php echo htmlspecialchars(__('T.V.', 'powerpress')); ?></span></a></li>
198
  <?php if( $feed_slug ) { ?>
199
+ <li><a href="#feed_tab_appearance"><span><?php echo htmlspecialchars(__('Media Appearance', 'powerpress')); ?></span></a></li>
200
+ <li><a href="#feed_tab_other"><span><?php echo htmlspecialchars(__('Other Settings', 'powerpress')); ?></span></a></li>
201
  <?php } ?>
202
  <?php if( $cat_ID ) { ?>
203
+ <li><a href="#feed_tab_other"><span><?php echo htmlspecialchars(__('Other Settings', 'powerpress')); ?></span></a></li>
204
  <?php } ?>
205
  </ul>
206
 
222
  ?>
223
  </div>
224
 
225
+ <div id="feed_tab_tv" class="powerpress_tab">
226
+ <?php
227
+ powerpressadmin_edit_tv($FeedSettings, $feed_slug);
228
+ ?>
229
+ </div>
230
+
231
  <?php if( $feed_slug ) { ?>
232
  <div id="feed_tab_appearance" class="powerpress_tab">
233
  <?php
289
 
290
  function powerpressadmin_edit_feed_general($FeedSettings, $General)
291
  {
 
292
  ?>
293
  <h3>Podcast Feeds</h3>
294
  <table class="form-table">
295
 
 
 
 
 
296
  <tr valign="top">
297
  <th scope="row">
298
 
329
  <?php echo __('Main Site Feed', 'powerpress'); ?></th>
330
  <td>
331
  <p style="margin-top: 5px; margin-bottom: 0;"><?php echo __('Main RSS2 Feed', 'powerpress'); ?>: <a href="<?php echo get_bloginfo('rss2_url'); ?>" title="<?php echo __('Main RSS 2 Feed', 'powerpress'); ?>" target="_blank"><?php echo get_bloginfo('rss2_url'); ?></a> | <a href="http://www.feedvalidator.org/check.cgi?url=<?php echo urlencode(get_bloginfo('rss2_url')); ?>" target="_blank"><?php echo __('validate', 'powerpress'); ?></a></p>
332
+ <p><?php echo __('Note: We do not recommend submitting your main site feed to podcast directories such as iTunes. iTunes and many other podcast directories work best with feeds that do not have regular blog posts mixed in.', 'powerpress'); ?></p>
333
  </td>
334
  </tr>
335
+
 
 
336
  <tr valign="top">
337
  <th scope="row">
338
 
339
+ <?php echo __('Podcast Feeds', 'powerpress'); ?></th>
340
  <td>
341
  <?php
342
 
512
  </td>
513
  </tr>
514
 
515
+ <!-- start advanced features -->
 
 
 
516
  <tr valign="top">
517
  <th scope="row">
518
 
545
  <input type="text" name="Feed[copyright]" style="width: 60%;" value="<?php echo $FeedSettings['copyright']; ?>" maxlength="250" />
546
  </td>
547
  </tr>
548
+ <!-- end advanced features -->
549
+
550
+ </table>
551
+
552
+ <!-- Location and frequency information -->
553
  <?php
554
+ if( !isset($FeedSettings['location']) )
555
+ $FeedSettings['location'] = '';
556
+ if( !isset($FeedSettings['frequency']) )
557
+ $FeedSettings['frequency'] = '';
558
  ?>
559
+ <h3><?php echo __('Basic Show Information', 'powerpress'); ?></h3>
560
+ <div id="rawvoice_basic_options">
561
+ <table class="form-table">
562
+ <tr valign="top">
563
+ <th scope="row"><?php echo __('Location', 'powerpress'); ?> <?php echo powerpressadmin_new(); ?></th>
564
+ <td>
565
+ <input type="text" style="width: 300px;" name="Feed[location]" value="<?php echo $FeedSettings['location']; ?>" maxlength="50" /> (<?php echo __('optional', 'powerpress'); ?>)
566
+ <p><?php echo __('e.g. Cleveland, Ohio', 'powerpress'); ?></p>
567
+ </td>
568
+ </tr>
569
+ <tr valign="top">
570
+ <th scope="row"><?php echo __('Episode Frequency', 'powerpress'); ?> <?php echo powerpressadmin_new(); ?></th>
571
+ <td>
572
+ <input type="text" style="width: 300px;" name="Feed[frequency]" value="<?php echo $FeedSettings['frequency']; ?>" maxlength="50" /> (<?php echo __('optional', 'powerpress'); ?>)
573
+ <p><?php echo __('e.g. Weekly', 'powerpress'); ?></p>
574
+ </td>
575
+ </tr>
576
  </table>
577
+ </div>
578
  <?php
579
  }
580
 
771
 
772
  ?>
773
  <h3><?php echo __('iTunes Feed Settings', 'powerpress'); ?></h3>
774
+
 
775
  <?php
776
+ $AdvancediTunesSettings = !empty($FeedSettings['itunes_summary']);
777
+ if( !empty($FeedSettings['itunes_subtitle']) )
778
+ $AdvancediTunesSettings = true;
779
+
780
+ if( !$AdvancediTunesSettings ) {
781
  ?>
782
+ <div style="margin-left: 230px; margin-bottom: 10px; font-weight: bold;"><a href="#" onclick="document.getElementById('advanced_itunes_settings').style.display='block';return false;"><?php echo __('Show Advanced iTunes Settings', 'powerpress'); ?></a></div>
783
+ <?php } ?>
784
+ <!-- start advanced features -->
785
+ <div id="advanced_itunes_settings" <?php echo ($AdvancediTunesSettings?'':'style="display: none;"'); ?>>
786
+ <table class="form-table">
787
  <tr valign="top">
788
  <th scope="row">
789
  <?php echo __('iTunes Program Subtitle', 'powerpress'); ?> <br />
817
  <?php echo __('Creates a friendlier view of your post/episode content by converting web links and images to clickable links in the iTunes application.', 'powerpress'); ?>
818
  </p>
819
  <p><strong>
820
+ <?php echo __('Note: With the recent launch of iTunes web site during the summer of 2010, Optimize iTunes Summary\'s clickable links do not appear online in the same way they do in the iTunes application. For this reason, we no longer recommend using this feature.', 'powerpress'); ?>
821
  </strong></p>
822
  <?php } else { ?>
823
 
830
  <?php } ?>
831
  </td>
832
  </tr>
833
+ </table>
834
+ </div>
835
+ <!-- end advanced features -->
836
+
837
+ <table class="form-table">
838
  <tr valign="top">
839
  <th scope="row">
840
  <?php echo __('iTunes Program Keywords', 'powerpress'); ?> <br />
850
  <?php echo __('iTunes Category', 'powerpress'); ?>
851
  </th>
852
  <td>
853
+ <select name="Feed[itunes_cat_1]" class="bpp_input_med">
854
  <?php
855
 
856
+ $MoreCategories = false;
857
+ if( !empty($FeedSettings['itunes_cat_2']) )
858
+ $MoreCategories = true;
859
+ else if( !empty($FeedSettings['itunes_cat_3']) )
860
+ $MoreCategories = true;
861
+
862
  $Categories = powerpress_itunes_categories(true);
863
 
864
  echo '<option value="">'. __('Select Category', 'powerpress') .'</option>';
869
  reset($Categories);
870
  ?>
871
  </select>
872
+ <?php
873
+ if( !$MoreCategories ) { ?>
874
+ <a href="#" onclick="document.getElementById('more_itunes_cats').style.display='block';return false;"><?php echo __('more', 'powerpress'); ?></a>
875
+ <?php } ?>
876
  </td>
877
  </tr>
878
+ </table>
879
 
880
+
881
+ <!-- start advanced features -->
882
+ <div id="more_itunes_cats" style="display: <?php echo ($MoreCategories?'block':'none'); ?>;">
883
+ <table class="form-table">
884
  <tr valign="top">
885
  <th scope="row">
886
  <?php echo __('iTunes Category 2', 'powerpress'); ?>
887
  </th>
888
  <td>
889
+ <select name="Feed[itunes_cat_2]" class="bpp_input_med">
890
  <?php
891
 
892
 
907
  <?php echo __('iTunes Category 3', 'powerpress'); ?>
908
  </th>
909
  <td>
910
+ <select name="Feed[itunes_cat_3]" class="bpp_input_med">
911
  <?php
912
 
913
  echo '<option value="">'. __('Select Category', 'powerpress') .'</option>';
920
  </select>
921
  </td>
922
  </tr>
923
+ </table>
924
+ </div>
925
+ <!-- end advanced features -->
926
 
927
+
928
+ <table class="form-table">
929
  <tr valign="top">
930
  <th scope="row">
931
  <?php echo __('iTunes Explicit', 'powerpress'); ?>
949
  </th>
950
  <td>
951
  <input type="text" id="itunes_image" name="Feed[itunes_image]" style="width: 60%;" value="<?php echo @$FeedSettings['itunes_image']; ?>" maxlength="250" />
952
+ <a href="#" onclick="javascript: window.open( document.getElementById('itunes_image').value ); return false;"><?php echo __('preview', 'powerpress'); ?></a>
953
 
954
+ <p><?php echo __('Place the URL to the iTunes image above.', 'powerpress'); ?> <?php echo __('Example', 'powerpress'); ?>: http://example.com/images/itunes.jpg<br /><br />
955
  <?php echo __('iTunes prefers square .jpg or .png images that are at 600 x 600 pixels (prevously 300 x 300), which is different than what is specified for the standard RSS image.', 'powerpress'); ?></p>
956
 
957
  <p><?php echo __('Note: It may take some time (days or even a month) for iTunes to cache modified or replaced iTunes images in the iTunes Podcast Directory.', 'powerpress'); ?>
959
  <?php if( $SupportUploads ) { ?>
960
  <p><input name="itunes_image_checkbox" type="checkbox" onchange="powerpress_show_field('itunes_image_upload', this.checked)" value="1" /> <?php echo __('Upload new image', 'powerpress'); ?> </p>
961
  <div style="display:none" id="itunes_image_upload">
962
+ <label for="itunes_image_file"><?php echo __('Choose file', 'powerpress'); ?>:</label><input type="file" name="itunes_image_file" />
963
  </div>
964
  <?php } ?>
965
  </td>
966
  </tr>
967
 
968
+
969
+ <!-- start advanced features -->
 
 
970
  <tr valign="top">
971
  <th scope="row">
972
  <?php echo __('iTunes Talent Name', 'powerpress'); ?> <br />
973
  </th>
974
  <td>
975
+ <input type="text" name="Feed[itunes_talent_name]" class="bpp_input_med" value="<?php echo $FeedSettings['itunes_talent_name']; ?>" maxlength="250" /><br />
976
  <div><input type="checkbox" name="Feed[itunes_author_post]" value="1" <?php echo ( !empty($FeedSettings['itunes_author_post'])?'checked ':''); ?>/> <?php echo __('Use blog post author\'s name for individual episodes.', 'powerpress'); ?></div>
977
 
978
  </td>
979
  </tr>
980
+ <!-- end advanced features -->
981
+
 
982
 
983
  <tr valign="top">
984
  <th scope="row">
985
  <?php echo __('iTunes Email', 'powerpress'); ?>
986
  </th>
987
  <td>
988
+ <input type="text" name="Feed[email]" class="bpp_input_med" value="<?php echo $FeedSettings['email']; ?>" maxlength="250" />
989
  <div>(<?php echo __('iTunes will email this address when your podcast is accepted into the iTunes Directory.', 'powerpress'); ?>)</div>
990
  </td>
991
  </tr>
992
 
993
+ <!-- start advanced features -->
 
 
 
994
  <tr valign="top">
995
  <th scope="row" >
996
 
998
  <td>
999
  <div id="new_feed_url_step_1" style="display: <?php echo ( !empty($FeedSettings['itunes_new_feed_url']) || !empty($FeedSettings['itunes_new_feed_url_podcast']) ?'none':'block'); ?>;">
1000
  <p style="margin-top: 5px;"><strong><a href="#" onclick="return powerpress_new_feed_url_prompt();"><?php echo __('Set iTunes New Feed URL', 'powerpress'); ?></a></strong></p>
1001
+ <p><strong>
1002
+ <?php echo __('The iTunes New Feed URL option works primarily for Apple\'s iTunes application only, and should only be used if you are unable to implement a HTTP 301 redirect.', 'powerpress'); ?>
1003
+ <?php echo __('A 301 redirect will route <u>all podcast clients including iTunes</u> to your new feed address.', 'powerpress'); ?>
1004
+ </strong>
1005
+ </p>
1006
+ <p>
1007
+ <?php echo __('Learn more:', 'powerpress'); ?> <a href="http://www.podcastfaq.com/syndicating-your-podcast/changing-your-podcast-rss-feed-address-url/" target="_blank"><?php echo __('Changing Your Podcast RSS Feed Address (URL)', 'powerpress'); ?></a>
1008
+ </p>
1009
  </div>
1010
  <div id="new_feed_url_step_2" style="display: <?php echo ( !empty($FeedSettings['itunes_new_feed_url']) || !empty($FeedSettings['itunes_new_feed_url_podcast']) ?'block':'none'); ?>;">
1011
  <p style="margin-top: 5px;"><strong><?php echo __('WARNING: Changes made here are permanent. If the New Feed URL entered is incorrect, you will lose subscribers and will no longer be able to update your listing in the iTunes Store.', 'powerpress'); ?></strong></p>
1057
  </div>
1058
  </td>
1059
  </tr>
1060
+ <!-- end advanced features -->
 
 
1061
 
1062
  </table>
1063
  <?php
powerpressadmin-jquery.php CHANGED
@@ -187,6 +187,8 @@ function SelectMedia(File)
187
  self.parent.document.getElementById('powerpress_hosting_<?php echo $FeedSlug; ?>').value='1';
188
  self.parent.document.getElementById('powerpress_url_<?php echo $FeedSlug; ?>').readOnly=true;
189
  self.parent.document.getElementById('powerpress_hosting_note_<?php echo $FeedSlug; ?>').style.display='block';
 
 
190
  self.parent.tb_remove();
191
  }
192
  function SelectURL(url)
@@ -195,6 +197,8 @@ function SelectURL(url)
195
  self.parent.document.getElementById('powerpress_hosting_<?php echo $FeedSlug; ?>').value='0';
196
  self.parent.document.getElementById('powerpress_url_<?php echo $FeedSlug; ?>').readOnly=false;
197
  self.parent.document.getElementById('powerpress_hosting_note_<?php echo $FeedSlug; ?>').style.display='none';
 
 
198
  self.parent.tb_remove();
199
  }
200
  function DeleteMedia(File)
@@ -353,7 +357,19 @@ function DeleteMedia(File)
353
  {
354
  $Error = $results['error'];
355
  if( strstr($Error, __('currently not available', 'powerpress') ) )
 
356
  $Error = __('Unable to find podcasts for this account.', 'powerpress');
 
 
 
 
 
 
 
 
 
 
 
357
  }
358
  else if( !is_array($results) )
359
  {
@@ -403,8 +419,10 @@ function DeleteMedia(File)
403
  }
404
  else
405
  {
406
- global $g_powerpress_remote_error;
407
- if( !empty($g_powerpress_remote_error) )
 
 
408
  $Error = __('Error:', 'powerpress') .' '.$g_powerpress_remote_error;
409
  else
410
  $Error = __('Authentication failed.', 'powerpress');
187
  self.parent.document.getElementById('powerpress_hosting_<?php echo $FeedSlug; ?>').value='1';
188
  self.parent.document.getElementById('powerpress_url_<?php echo $FeedSlug; ?>').readOnly=true;
189
  self.parent.document.getElementById('powerpress_hosting_note_<?php echo $FeedSlug; ?>').style.display='block';
190
+ if( self.parent.powerpress_update_for_video )
191
+ self.parent.powerpress_update_for_video(File, '<?php echo $FeedSlug; ?>');
192
  self.parent.tb_remove();
193
  }
194
  function SelectURL(url)
197
  self.parent.document.getElementById('powerpress_hosting_<?php echo $FeedSlug; ?>').value='0';
198
  self.parent.document.getElementById('powerpress_url_<?php echo $FeedSlug; ?>').readOnly=false;
199
  self.parent.document.getElementById('powerpress_hosting_note_<?php echo $FeedSlug; ?>').style.display='none';
200
+ if( self.parent.powerpress_update_for_video )
201
+ self.parent.powerpress_update_for_video(File, '<?php echo $FeedSlug; ?>');
202
  self.parent.tb_remove();
203
  }
204
  function DeleteMedia(File)
357
  {
358
  $Error = $results['error'];
359
  if( strstr($Error, __('currently not available', 'powerpress') ) )
360
+ {
361
  $Error = __('Unable to find podcasts for this account.', 'powerpress');
362
+ $Error .= '<br /><span style="font-weight: normal; font-size: 12px;">';
363
+ if( $SaveSettings['blubrry_hosting'] == 0 )
364
+ $Error .= 'Verify that the email address you enter here matches the email address you used when you listed your podcast on blubrry.com.</span>';
365
+ else
366
+ $Error .= 'Media hosting customers are encouraged to <a href="http://www.blubrry.com/contact.php" target="_blank">contact blubrry</a> for support.</span>';
367
+ }
368
+ else if( preg_match('/No programs found.*media hosting/i', $results['error']) )
369
+ {
370
+ $Error .= '<br/><span style="font-weight: normal; font-size: 12px;">';
371
+ $Error .= 'Service may take up to 48 hours to activate upon receiving payment.</span>';
372
+ }
373
  }
374
  else if( !is_array($results) )
375
  {
419
  }
420
  else
421
  {
422
+ global $g_powerpress_remote_error, $g_powerpress_remote_errorno;
423
+ if( !empty($g_powerpress_remote_errorno) && $g_powerpress_remote_errorno == 401 )
424
+ $Error = 'Incorrect user email address or password. <br /><span style="font-weight: normal; font-size: 12px;">Verify your account settings and try again.</span>';
425
+ else if( !empty($g_powerpress_remote_error) )
426
  $Error = __('Error:', 'powerpress') .' '.$g_powerpress_remote_error;
427
  else
428
  $Error = __('Authentication failed.', 'powerpress');
powerpressadmin-metabox.php CHANGED
@@ -21,6 +21,11 @@ function powerpress_meta_box($object, $box)
21
  $iTunesExplicit = '';
22
  $NoPlayer = false;
23
  $NoLinks = false;
 
 
 
 
 
24
  $GeneralSettings = get_option('powerpress_general');
25
  if( !isset($GeneralSettings['set_size']) )
26
  $GeneralSettings['set_size'] = 0;
@@ -86,6 +91,14 @@ function powerpress_meta_box($object, $box)
86
  $iTunesExplicit = $ExtraData['explicit'];
87
  if( isset($ExtraData['image']) )
88
  $CoverImage = $ExtraData['image'];
 
 
 
 
 
 
 
 
89
  }
90
  }
91
 
@@ -103,6 +116,12 @@ function powerpress_meta_box($object, $box)
103
  if( $DurationHH == '' && $DurationMM == '' && ltrim($DurationSS, '0') == 0 )
104
  $DurationSS = '';
105
  }
 
 
 
 
 
 
106
  }
107
 
108
  if( $EnclosureURL )
@@ -126,7 +145,7 @@ function powerpress_meta_box($object, $box)
126
  {
127
  ?>
128
  <div class="powerpress_row">
129
- <label>Remove</label>
130
  <div class="powerpress_row_content">
131
  <input type="checkbox" name="Powerpress[<?php echo $FeedSlug; ?>][remove_podcast]" id="powerpress_remove" value="1" onchange="javascript:document.getElementById('powerpress_podcast_edit_<?php echo $FeedSlug; ?>').style.display=(this.checked?'none':'block');" />
132
  <?php echo __('Podcast episode will be removed from this post upon save', 'powerpress'); ?>
@@ -141,7 +160,7 @@ function powerpress_meta_box($object, $box)
141
  <div class="powerpress_row">
142
  <label for="Powerpress[<?php echo $FeedSlug; ?>][url]"><?php echo __('Media URL', 'powerpress'); ?></label>
143
  <div class="powerpress_row_content">
144
- <input id="powerpress_url_<?php echo $FeedSlug; ?>" name="Powerpress[<?php echo $FeedSlug; ?>][url]" value="<?php echo $EnclosureURL; ?>" onchange="powerpress_check_url(this.value,'powerpress_warning_<?php echo $FeedSlug; ?>')" <?php echo (@$ExtraData['hosting']==1?'readOnly':''); ?> style="width: 70%; font-size: 90%;" />
145
  <?php if( @$GeneralSettings['blubrry_hosting'] == 1 ) { ?>
146
  <a href="<?php echo admin_url(); ?>?action=powerpress-jquery-media&podcast-feed=<?php echo $FeedSlug; ?>&KeepThis=true&TB_iframe=true&modal=true" title="<?php echo __('Browse Media File', 'powerpress'); ?>" class="thickbox"><img src="<?php echo powerpress_get_root_url(); ?>/images/blubrry_folder.png" alt="<?php echo __('Browse Media Files', 'powerpress'); ?>" /></a>
147
  <?php } ?>
@@ -152,40 +171,48 @@ function powerpress_meta_box($object, $box)
152
  <div id="powerpress_hosting_note_<?php echo $FeedSlug; ?>" style="margin-left: 2px; padding-bottom: 2px; padding-top: 2px; display: <?php echo (@$ExtraData['hosting']==1?'block':'none'); ?>"><em><?php echo __('Media file hosted by blubrry.com.', 'powerpress'); ?>
153
  (<a href="javascript:void();" title="<?php echo __('Remove Blubrry.com hosted media file', 'powerpress'); ?>" onclick="powerpress_remove_hosting('<?php echo $FeedSlug; ?>');return false;"><?php echo __('remove', 'powerpress'); ?></a>)
154
  </em></div>
 
 
 
 
155
  <?php
156
 
157
- if( $GeneralSettings['episode_box_mode'] == 2 && ( !empty($GeneralSettings['episode_box_no_player']) || !empty($GeneralSettings['episode_box_no_links']) || !empty($GeneralSettings['episode_box_no_player_and_links']) ) )
158
  {
159
- ?>
160
- <div style="margin-left: 2px; padding-bottom: 2px; padding-top: 2px;">
161
- <?php
162
  if( $GeneralSettings['episode_box_no_player_and_links'] )
163
  {
164
  ?>
165
- <span><input id="powerpress_no_player_and_links_<?php echo $FeedSlug; ?>" name="Powerpress[<?php echo $FeedSlug; ?>][no_player_and_links]" value="1" type="checkbox" <?php echo ($NoPlayer==1&&$NoLinks==1?'checked':''); ?> /> <?php echo __('Do not display player and media links', 'powerpress'); ?></span>
166
  <?php
167
  }
168
  if( $GeneralSettings['episode_box_no_player'] )
169
  {
170
  ?>
171
- <span style="margin-right: 20px;"><input id="powerpress_no_player_<?php echo $FeedSlug; ?>" name="Powerpress[<?php echo $FeedSlug; ?>][no_player]" value="1" type="checkbox" <?php echo ($NoPlayer==1?'checked':''); ?> /> <?php echo __('Do not display player', 'powerpress'); ?></span>
172
  <?php
173
  }
174
  if( @$GeneralSettings['episode_box_no_links'] )
175
  {
176
  ?>
177
- <span><input id="powerpress_no_links_<?php echo $FeedSlug; ?>" name="Powerpress[<?php echo $FeedSlug; ?>][no_links]" value="1" type="checkbox" <?php echo ($NoLinks==1?'checked':''); ?> /> <?php echo __('Do not display media links', 'powerpress'); ?></span>
178
  <?php
179
  }
180
- ?>
181
- </div>
182
- <?php
183
  }
184
  ?>
 
 
 
 
 
 
 
 
 
 
185
  </div>
186
  </div>
187
  <?php
188
- if( $GeneralSettings['episode_box_mode'] != 1 )
189
  {
190
  ?>
191
  <div class="powerpress_row">
@@ -213,9 +240,9 @@ function powerpress_meta_box($object, $box)
213
  <div style="margin-bottom: 4px;">
214
  <input id="powerpress_set_duration_1_<?php echo $FeedSlug; ?>" name="Powerpress[<?php echo $FeedSlug; ?>][set_duration]" value="1" type="radio" <?php echo ($GeneralSettings['set_duration']==1?'checked':''); ?> />
215
  <?php echo __('Specify', 'powerpress').': '; ?>
216
- <input id="powerpress_duration_hh_<?php echo $FeedSlug; ?>" name="Powerpress[<?php echo $FeedSlug; ?>][duration_hh]" maxlength="2" value="<?php echo $DurationHH; ?>" style="width: 24px; font-size: 90%; text-align: right;" onchange="javascript:jQuery('#powerpress_set_duration_1_<?php echo $FeedSlug; ?>').attr('checked', true);" /><strong>:</strong>
217
- <input id="powerpress_duration_mm_<?php echo $FeedSlug; ?>" name="Powerpress[<?php echo $FeedSlug; ?>][duration_mm]" maxlength="2" value="<?php echo $DurationMM; ?>" style="width: 24px; font-size: 90%; text-align: right;" onchange="javascript:jQuery('#powerpress_set_duration_1_<?php echo $FeedSlug; ?>').attr('checked', true);" /><strong>:</strong>
218
- <input id="powerpress_duration_ss_<?php echo $FeedSlug; ?>" name="Powerpress[<?php echo $FeedSlug; ?>][duration_ss]" maxlength="10" value="<?php echo $DurationSS; ?>" style="width: 24px; font-size: 90%; text-align: right;" onchange="javascript:jQuery('#powerpress_set_duration_1_<?php echo $FeedSlug; ?>').attr('checked', true);" /> HH:MM:SS
219
  </div>
220
  <div>
221
  <input id="powerpress_set_duration_2_<?php echo $FeedSlug; ?>" name="Powerpress[<?php echo $FeedSlug; ?>][set_duration]" value="-1" type="radio" <?php echo ($GeneralSettings['set_duration']==-1?'checked':''); ?> />
@@ -233,38 +260,53 @@ function powerpress_meta_box($object, $box)
233
  <?php
234
  }
235
 
236
-
237
- if( $GeneralSettings['episode_box_mode'] == 2 )
238
- {
239
- // Embed option, enter your own embed code provided by sites such as YouTube, Viddler and Blip.tv
240
- if( $GeneralSettings['episode_box_embed'] )
241
  {
 
242
  ?>
243
  <div class="powerpress_row">
244
- <label for "Powerpress[<?php echo $FeedSlug; ?>][embed]"><?php echo __('Media Embed', 'powerpress'); ?></label>
245
  <div class="powerpress_row_content">
246
- <textarea id="powerpress_embed_<?php echo $FeedSlug; ?>" name="Powerpress[<?php echo $FeedSlug; ?>][embed]" style="width: 90%; height: 80px; font-size: 90%;" onfocus="this.select();"><?php echo htmlspecialchars($Embed); ?></textarea>
 
 
 
 
247
  </div>
248
  </div>
249
  <?php
250
  }
251
-
252
- if( @$GeneralSettings['episode_box_cover_image'] )
 
253
  {
254
  ?>
255
  <div class="powerpress_row">
256
- <label for "Powerpress[<?php echo $FeedSlug; ?>][image]"><?php echo __('Cover Image', 'powerpress'); ?></label>
257
  <div class="powerpress_row_content">
258
- <input id="powerpress_image_<?php echo $FeedSlug; ?>" name="Powerpress[<?php echo $FeedSlug; ?>][image]" value="<?php echo htmlspecialchars($CoverImage); ?>" style="width: 90%; font-size: 90%;" size="250" />
 
 
259
  </div>
 
 
 
 
 
 
 
 
 
 
260
  <div class="powerpress_row_content">
261
- <em><?php echo __('Cover image for Quicktime (m4v, mov, etc..) video only. e.g. http://example.com/path/to/image.jpg', 'powerpress'); ?></em>
262
  </div>
263
  </div>
264
  <?php
265
  }
266
-
267
- if( $GeneralSettings['episode_box_keywords'] )
268
  {
269
  ?>
270
  <div class="powerpress_row">
@@ -279,7 +321,7 @@ function powerpress_meta_box($object, $box)
279
  <?php
280
  }
281
 
282
- if( $GeneralSettings['episode_box_subtitle'] )
283
  {
284
  ?>
285
  <div class="powerpress_row">
@@ -294,7 +336,7 @@ function powerpress_meta_box($object, $box)
294
  <?php
295
  }
296
 
297
- if( !empty($GeneralSettings['episode_box_summary']) )
298
  {
299
  ?>
300
  <div class="powerpress_row">
@@ -309,7 +351,7 @@ function powerpress_meta_box($object, $box)
309
  <?php
310
  }
311
 
312
- if( !empty($GeneralSettings['episode_box_author']) )
313
  {
314
  ?>
315
  <div class="powerpress_row">
@@ -324,7 +366,7 @@ function powerpress_meta_box($object, $box)
324
  <?php
325
  }
326
 
327
- if( $GeneralSettings['episode_box_explicit'] )
328
  {
329
  ?>
330
  <div class="powerpress_row">
@@ -343,7 +385,6 @@ while( list($value,$desc) = each($explicit_array) )
343
  </div>
344
  <?php
345
  }
346
- }
347
  ?>
348
  </div>
349
  </div>
@@ -354,4 +395,139 @@ jQuery('#powerpress-<?php echo $FeedSlug; ?>').css( {'background-color' : '<?php
354
  <?php
355
  }
356
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
357
  ?>
21
  $iTunesExplicit = '';
22
  $NoPlayer = false;
23
  $NoLinks = false;
24
+ $IsHD = false;
25
+ $IsVideo = false;
26
+ $Width = false;
27
+ $Height = false;
28
+ $WebMSrc = false;
29
  $GeneralSettings = get_option('powerpress_general');
30
  if( !isset($GeneralSettings['set_size']) )
31
  $GeneralSettings['set_size'] = 0;
91
  $iTunesExplicit = $ExtraData['explicit'];
92
  if( isset($ExtraData['image']) )
93
  $CoverImage = $ExtraData['image'];
94
+ if( isset($ExtraData['ishd']) )
95
+ $IsHD = $ExtraData['ishd'];
96
+ if( isset($ExtraData['height']) )
97
+ $Height = $ExtraData['height'];
98
+ if( isset($ExtraData['width']) )
99
+ $Width = $ExtraData['width'];
100
+ if( isset($ExtraData['webm_src']) )
101
+ $WebMSrc = $ExtraData['webm_src'];
102
  }
103
  }
104
 
116
  if( $DurationHH == '' && $DurationMM == '' && ltrim($DurationSS, '0') == 0 )
117
  $DurationSS = '';
118
  }
119
+
120
+ // Check for HD Video formats
121
+ if( preg_match('/\.(mp4|m4v|webm|ogg|ogv)$/i', $EnclosureURL ) )
122
+ {
123
+ $IsVideo = true;
124
+ }
125
  }
126
 
127
  if( $EnclosureURL )
145
  {
146
  ?>
147
  <div class="powerpress_row">
148
+ <label><?php echo __('Remove', 'powerpress'); ?></label>
149
  <div class="powerpress_row_content">
150
  <input type="checkbox" name="Powerpress[<?php echo $FeedSlug; ?>][remove_podcast]" id="powerpress_remove" value="1" onchange="javascript:document.getElementById('powerpress_podcast_edit_<?php echo $FeedSlug; ?>').style.display=(this.checked?'none':'block');" />
151
  <?php echo __('Podcast episode will be removed from this post upon save', 'powerpress'); ?>
160
  <div class="powerpress_row">
161
  <label for="Powerpress[<?php echo $FeedSlug; ?>][url]"><?php echo __('Media URL', 'powerpress'); ?></label>
162
  <div class="powerpress_row_content">
163
+ <input id="powerpress_url_<?php echo $FeedSlug; ?>" class="powerpress-url" name="Powerpress[<?php echo $FeedSlug; ?>][url]" value="<?php echo $EnclosureURL; ?>" <?php echo (@$ExtraData['hosting']==1?'readOnly':''); ?> style="width: 70%; font-size: 90%;" />
164
  <?php if( @$GeneralSettings['blubrry_hosting'] == 1 ) { ?>
165
  <a href="<?php echo admin_url(); ?>?action=powerpress-jquery-media&podcast-feed=<?php echo $FeedSlug; ?>&KeepThis=true&TB_iframe=true&modal=true" title="<?php echo __('Browse Media File', 'powerpress'); ?>" class="thickbox"><img src="<?php echo powerpress_get_root_url(); ?>/images/blubrry_folder.png" alt="<?php echo __('Browse Media Files', 'powerpress'); ?>" /></a>
166
  <?php } ?>
171
  <div id="powerpress_hosting_note_<?php echo $FeedSlug; ?>" style="margin-left: 2px; padding-bottom: 2px; padding-top: 2px; display: <?php echo (@$ExtraData['hosting']==1?'block':'none'); ?>"><em><?php echo __('Media file hosted by blubrry.com.', 'powerpress'); ?>
172
  (<a href="javascript:void();" title="<?php echo __('Remove Blubrry.com hosted media file', 'powerpress'); ?>" onclick="powerpress_remove_hosting('<?php echo $FeedSlug; ?>');return false;"><?php echo __('remove', 'powerpress'); ?></a>)
173
  </em></div>
174
+
175
+
176
+ <div style="padding-bottom: 2px; padding-top: 2px;">
177
+ <span id="powerpress_ishd_<?php echo $FeedSlug; ?>_span" style="margin-left: 20px; display: <?php echo ($IsVideo?'inline':'none'); ?>; "><input id="powerpress_ishd_<?php echo $FeedSlug; ?>" name="Powerpress[<?php echo $FeedSlug; ?>][ishd]" value="1" type="checkbox" <?php echo ($IsHD==1?'checked':''); ?> /> <?php echo __('Video is HD (720p/1080i/1080p)', 'powerpress'); ?></span>
178
  <?php
179
 
180
+ if( !empty($GeneralSettings['episode_box_no_player']) || !empty($GeneralSettings['episode_box_no_links']) || !empty($GeneralSettings['episode_box_no_player_and_links']) )
181
  {
 
 
 
182
  if( $GeneralSettings['episode_box_no_player_and_links'] )
183
  {
184
  ?>
185
+ <span style="margin-left: 20px;"><input id="powerpress_no_player_and_links_<?php echo $FeedSlug; ?>" name="Powerpress[<?php echo $FeedSlug; ?>][no_player_and_links]" value="1" type="checkbox" <?php echo ($NoPlayer==1&&$NoLinks==1?'checked':''); ?> /> <?php echo __('Do not display player and media links', 'powerpress'); ?></span>
186
  <?php
187
  }
188
  if( $GeneralSettings['episode_box_no_player'] )
189
  {
190
  ?>
191
+ <span style="margin-left: 20px;"><input id="powerpress_no_player_<?php echo $FeedSlug; ?>" name="Powerpress[<?php echo $FeedSlug; ?>][no_player]" value="1" type="checkbox" <?php echo ($NoPlayer==1?'checked':''); ?> /> <?php echo __('Do not display player', 'powerpress'); ?></span>
192
  <?php
193
  }
194
  if( @$GeneralSettings['episode_box_no_links'] )
195
  {
196
  ?>
197
+ <span style="margin-left: 20px;"><input id="powerpress_no_links_<?php echo $FeedSlug; ?>" name="Powerpress[<?php echo $FeedSlug; ?>][no_links]" value="1" type="checkbox" <?php echo ($NoLinks==1?'checked':''); ?> /> <?php echo __('Do not display media links', 'powerpress'); ?></span>
198
  <?php
199
  }
 
 
 
200
  }
201
  ?>
202
+ </div>
203
+ </div><!-- end powerpress_row_content -->
204
+ </div><!-- end powerpress_row -->
205
+ <div class="powerpress_row" id="powerpress_webm_<?php echo $FeedSlug; ?>" style="display: <?php echo ($WebMSrc != '' || (preg_match('/\.(mp4|m4v)$/i', $EnclosureURL) ) ?'block':'none'); ?>;">
206
+ <label for="Powerpress[<?php echo $FeedSlug; ?>][webm_src]"><?php echo __('Alt WebM URL', 'powerpress'); ?></label>
207
+ <div class="powerpress_row_content">
208
+ <input id="powerpress_webm_src_<?php echo $FeedSlug; ?>" class="powerpress-webm-src" name="Powerpress[<?php echo $FeedSlug; ?>][webm_src]" value="<?php echo $WebMSrc; ?>" style="width: 70%; font-size: 90%;" />
209
+ </div>
210
+ <div class="powerpress_row_content">
211
+ <em><?php echo __('For HTML5 Video fallback, enter an alternative WebM media URL above. (optional)', 'powerpress'); ?></em>
212
  </div>
213
  </div>
214
  <?php
215
+ if( $GeneralSettings['episode_box_mode'] != 1 ) // If not simple mode
216
  {
217
  ?>
218
  <div class="powerpress_row">
240
  <div style="margin-bottom: 4px;">
241
  <input id="powerpress_set_duration_1_<?php echo $FeedSlug; ?>" name="Powerpress[<?php echo $FeedSlug; ?>][set_duration]" value="1" type="radio" <?php echo ($GeneralSettings['set_duration']==1?'checked':''); ?> />
242
  <?php echo __('Specify', 'powerpress').': '; ?>
243
+ <input id="powerpress_duration_hh_<?php echo $FeedSlug; ?>" class="powerpress-duration-hh" name="Powerpress[<?php echo $FeedSlug; ?>][duration_hh]" maxlength="2" value="<?php echo $DurationHH; ?>" style="width: 24px; font-size: 90%; text-align: right;" onchange="javascript:jQuery('#powerpress_set_duration_1_<?php echo $FeedSlug; ?>').attr('checked', true);" /><strong>:</strong>
244
+ <input id="powerpress_duration_mm_<?php echo $FeedSlug; ?>" class="powerpress-duration-mm" name="Powerpress[<?php echo $FeedSlug; ?>][duration_mm]" maxlength="2" value="<?php echo $DurationMM; ?>" style="width: 24px; font-size: 90%; text-align: right;" onchange="javascript:jQuery('#powerpress_set_duration_1_<?php echo $FeedSlug; ?>').attr('checked', true);" /><strong>:</strong>
245
+ <input id="powerpress_duration_ss_<?php echo $FeedSlug; ?>" class="powerpress-duration-ss" name="Powerpress[<?php echo $FeedSlug; ?>][duration_ss]" maxlength="10" value="<?php echo $DurationSS; ?>" style="width: 24px; font-size: 90%; text-align: right;" onchange="javascript:jQuery('#powerpress_set_duration_1_<?php echo $FeedSlug; ?>').attr('checked', true);" />
246
  </div>
247
  <div>
248
  <input id="powerpress_set_duration_2_<?php echo $FeedSlug; ?>" name="Powerpress[<?php echo $FeedSlug; ?>][set_duration]" value="-1" type="radio" <?php echo ($GeneralSettings['set_duration']==-1?'checked':''); ?> />
260
  <?php
261
  }
262
 
263
+ // Video Coverart Image (Poster)
264
+ if( @$GeneralSettings['episode_box_cover_image'] || $CoverImage )
 
 
 
265
  {
266
+ $form_action_url = admin_url("media-upload.php?type=powerpress_image&tab=type&post_id={$object->ID}&powerpress_feed={$FeedSlug}&TB_iframe=true&width=450&height=200");
267
  ?>
268
  <div class="powerpress_row">
269
+ <label for "Powerpress[<?php echo $FeedSlug; ?>][image]"><?php echo __('Poster Image', 'powerpress'); ?></label>
270
  <div class="powerpress_row_content">
271
+ <input id="powerpress_image_<?php echo $FeedSlug; ?>" name="Powerpress[<?php echo $FeedSlug; ?>][image]" value="<?php echo htmlspecialchars($CoverImage); ?>" style="width: 70%; font-size: 90%;" size="250" />
272
+ <a href="<?php echo $form_action_url; ?>" class="thickbox powerpress-image-browser" id="powerpress_image_browser_<?php echo $FeedSlug; ?>" title="<?php echo __('Select Poster Image', 'powerpress'); ?>"><img src="images/media-button-image.gif" /></a>
273
+ </div>
274
+ <div class="powerpress_row_content">
275
+ <em><?php echo __('Poster image for video (m4v, mp4, ogv, webm, etc..). e.g. http://example.com/path/to/image.jpg', 'powerpress'); ?></em>
276
  </div>
277
  </div>
278
  <?php
279
  }
280
+
281
+ // Player width/height
282
+ if( $GeneralSettings['episode_box_player_size'] || $Width || $Height )
283
  {
284
  ?>
285
  <div class="powerpress_row">
286
+ <label><?php echo __('Player Size', 'powerpress'); ?></label>
287
  <div class="powerpress_row_content">
288
+ <input id="powerpress_player_width_<?php echo $FeedSlug; ?>" class="powerpress-player-width" name="Powerpress[<?php echo $FeedSlug; ?>][width]" value="<?php echo htmlspecialchars($Width); ?>" style="width: 50px; font-size: 90%;" size="5" />
289
+ x
290
+ <input id="powerpress_player_height_<?php echo $FeedSlug; ?>" class="powerpress-player-height" name="Powerpress[<?php echo $FeedSlug; ?>][height]" value="<?php echo htmlspecialchars($Height); ?>" style="width: 50px; font-size: 90%;" size="5" />
291
  </div>
292
+ </div>
293
+ <?php
294
+ }
295
+
296
+ // Embed option, enter your own embed code provided by sites such as YouTube, Viddler and Blip.tv
297
+ if( $GeneralSettings['episode_box_embed'] || $Embed )
298
+ {
299
+ ?>
300
+ <div class="powerpress_row">
301
+ <label for "Powerpress[<?php echo $FeedSlug; ?>][embed]"><?php echo __('Media Embed', 'powerpress'); ?></label>
302
  <div class="powerpress_row_content">
303
+ <textarea id="powerpress_embed_<?php echo $FeedSlug; ?>" name="Powerpress[<?php echo $FeedSlug; ?>][embed]" style="width: 90%; height: 80px; font-size: 90%;" onfocus="this.select();"><?php echo htmlspecialchars($Embed); ?></textarea>
304
  </div>
305
  </div>
306
  <?php
307
  }
308
+
309
+ if( $GeneralSettings['episode_box_keywords'] || $iTunesKeywords )
310
  {
311
  ?>
312
  <div class="powerpress_row">
321
  <?php
322
  }
323
 
324
+ if( $GeneralSettings['episode_box_subtitle'] || $iTunesSubtitle )
325
  {
326
  ?>
327
  <div class="powerpress_row">
336
  <?php
337
  }
338
 
339
+ if( !empty($GeneralSettings['episode_box_summary']) || $iTunesSummary )
340
  {
341
  ?>
342
  <div class="powerpress_row">
351
  <?php
352
  }
353
 
354
+ if( !empty($GeneralSettings['episode_box_author']) || $iTunesAuthor )
355
  {
356
  ?>
357
  <div class="powerpress_row">
366
  <?php
367
  }
368
 
369
+ if( $GeneralSettings['episode_box_explicit'] || $iTunesExplicit )
370
  {
371
  ?>
372
  <div class="powerpress_row">
385
  </div>
386
  <?php
387
  }
 
388
  ?>
389
  </div>
390
  </div>
395
  <?php
396
  }
397
 
398
+ /**
399
+ * {@internal Missing Short Description}}
400
+ *
401
+ * @since unknown
402
+ *
403
+ * @return unknown
404
+ */
405
+ function media_upload_powerpress_image() {
406
+ $errors = array();
407
+ $id = 0;
408
+
409
+ if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
410
+ // Upload File button was clicked
411
+ $id = media_handle_upload('async-upload', $_REQUEST['post_id']);
412
+ unset($_FILES);
413
+ if ( is_wp_error($id) ) {
414
+ $errors['upload_error'] = $id;
415
+ $id = false;
416
+ }
417
+ }
418
+
419
+ return wp_iframe( 'powerpress_media_upload_type_form', 'powerpress_image', $errors, $id );
420
+ }
421
+
422
+ add_action('media_upload_powerpress_image', 'media_upload_powerpress_image');
423
+
424
+ /**
425
+ * {@internal Missing Short Description}}
426
+ *
427
+ * @since unknown
428
+ *
429
+ * @param unknown_type $html
430
+ */
431
+ function powerpress_send_to_episode_entry_box($url) {
432
+ ?>
433
+ <script type="text/javascript">
434
+ /* <![CDATA[ */
435
+ var win = window.dialogArguments || opener || parent || top;
436
+ if( win.powerpress_send_to_poster_image )
437
+ win.powerpress_send_to_poster_image('<?php echo addslashes($url); ?>');
438
+ /* ]]> */
439
+ </script>
440
+ <?php
441
+ exit;
442
+ }
443
+
444
+
445
+ /**
446
+ * {@internal Missing Short Description}}
447
+ *
448
+ * @since unknown
449
+ *
450
+ * @param unknown_type $tabs
451
+ * @return unknown
452
+ */
453
+ function powerpress_update_media_upload_tabs($tabs) {
454
+
455
+ if( isset($_GET['type'] ) )
456
+ {
457
+ if( $_GET['type'] == 'powerpress_image' ) // We only want to allow uploads
458
+ {
459
+ unset($tabs['type_url']);
460
+ unset($tabs['gallery']);
461
+ unset($tabs['library']);
462
+ }
463
+ }
464
+ return $tabs;
465
+ }
466
+ add_filter('media_upload_tabs', 'powerpress_update_media_upload_tabs', 100);
467
+
468
+ /**
469
+ * {@internal Missing Short Description}}
470
+ *
471
+ * @since unknown
472
+ *
473
+ * @param unknown_type $type
474
+ * @param unknown_type $errors
475
+ * @param unknown_type $id
476
+ */
477
+ function powerpress_media_upload_type_form($type = 'file', $errors = null, $id = null)
478
+ {
479
+ media_upload_header();
480
+
481
+ $post_id = isset( $_REQUEST['post_id'] )? intval( $_REQUEST['post_id'] ) : 0;
482
+
483
+ $form_action_url = admin_url("media-upload.php?type=$type&tab=type&post_id=$post_id");
484
+ $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
485
+
486
+ if ( $id && !is_wp_error($id) ) {
487
+ $image_url = wp_get_attachment_url($id);
488
+ powerpress_send_to_episode_entry_box( $image_url );
489
+ }
490
+
491
+ ?>
492
+
493
+ <form enctype="multipart/form-data" method="post" action="<?php echo esc_attr($form_action_url); ?>" class="media-upload-form type-form validate" id="<?php echo $type; ?>-form">
494
+ <input type="submit" class="hidden" name="save" value="" />
495
+ <input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
496
+ <?php wp_nonce_field('media-form'); ?>
497
+
498
+ <h3 class="media-title"><?php echo __('Select poster image from your computer.', 'powerpress'); ?></h3>
499
+
500
+ <?php media_upload_form( $errors ); ?>
501
+
502
+ <script type="text/javascript">
503
+ //<![CDATA[
504
+ jQuery(document).ready( function() {
505
+ jQuery('#sidemenu').css('display','none');
506
+ jQuery('body').css('margin','0px 20px');
507
+ jQuery('body').css('height','auto');
508
+ jQuery('html').css('height','auto'); // Elimate the weird scroll bar
509
+ });
510
+ //]]>
511
+ </script>
512
+ <div id="media-items">
513
+ <?php
514
+ if ( $id && is_wp_error($id) ) {
515
+ echo '<div id="media-upload-error">'.esc_html($id->get_error_message()).'</div>';
516
+ }
517
+ ?>
518
+ </div>
519
+ </form>
520
+ <?php
521
+ }
522
+
523
+ function powerpress_media_upload_use_flash($flash) {
524
+ if( isset($_GET['type']) && $_GET['type'] == 'powerpress_image' )
525
+ {
526
+ return false;
527
+ }
528
+ return $flash;
529
+ }
530
+
531
+ add_filter('flash_uploader', 'powerpress_media_upload_use_flash');
532
+
533
  ?>
powerpressadmin-mt.php CHANGED
@@ -297,18 +297,6 @@ if( !function_exists('add_action') )
297
 
298
  add_filter('manage_powerpressadmin_importmt_columns', 'powerpressadmin_importmt_columns');
299
 
300
- function powerpressadmin_importmt_columns_print($include_ids=true)
301
- {
302
- $Columns = powerpressadmin_importmt_columns();
303
- while( list($key,$title) = each($Columns) )
304
- {
305
- if( $include_ids )
306
- echo '<th scope="col" id="'. $key .'" class="manage-column column-'. $key .'" style="">'. $title .'</th>';
307
- else
308
- echo '<th scope="col" class="manage-column column-'. $key .'" style="">'. $title .'</th>';
309
- }
310
- }
311
-
312
  function powerpress_admin_mt()
313
  {
314
  $results = powerpress_get_mt_episodes();
@@ -454,30 +442,16 @@ else
454
  <table class="widefat fixed" cellspacing="0">
455
  <thead>
456
  <tr>
457
- <?php
458
- if( function_exists('print_column_headers') )
459
- {
460
  print_column_headers('powerpressadmin_importmt');
461
- }
462
- else // WordPress 2.6 or older
463
- {
464
- powerpressadmin_importmt_columns_print();
465
- }
466
  ?>
467
  </tr>
468
  </thead>
469
 
470
  <tfoot>
471
  <tr>
472
- <?php
473
- if( function_exists('print_column_headers') )
474
- {
475
  print_column_headers('powerpressadmin_importmt', false);
476
- }
477
- else // WordPress 2.6 or older
478
- {
479
- powerpressadmin_importmt_columns_print(false);
480
- }
481
  ?>
482
  </tr>
483
  </tfoot>
297
 
298
  add_filter('manage_powerpressadmin_importmt_columns', 'powerpressadmin_importmt_columns');
299
 
 
 
 
 
 
 
 
 
 
 
 
 
300
  function powerpress_admin_mt()
301
  {
302
  $results = powerpress_get_mt_episodes();
442
  <table class="widefat fixed" cellspacing="0">
443
  <thead>
444
  <tr>
445
+ <?php
 
 
446
  print_column_headers('powerpressadmin_importmt');
 
 
 
 
 
447
  ?>
448
  </tr>
449
  </thead>
450
 
451
  <tfoot>
452
  <tr>
453
+ <?php
 
 
454
  print_column_headers('powerpressadmin_importmt', false);
 
 
 
 
 
455
  ?>
456
  </tr>
457
  </tfoot>
powerpressadmin-player-page.php CHANGED
@@ -1,14 +1,39 @@
1
  <?php
2
- // PowerPress Player settings page
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
- function powerpress_admin_players()
5
  {
6
  $General = powerpress_get_settings('powerpress_general');
7
  $select_player = false;
8
  if( isset($_GET['sp']) )
9
  $select_player = true;
10
- else if( !isset($General['player']) )
11
- $select_player = true;
 
 
 
 
 
 
 
 
 
 
12
 
13
  $Audio = array();
14
  $Audio['default'] = 'http://media.blubrry.com/blubrry/content.blubrry.com/blubrry/FlowPlayerClassic.mp3';
@@ -17,7 +42,11 @@ function powerpress_admin_players()
17
  $Audio['simple_flash'] = 'http://media.blubrry.com/blubrry/content.blubrry.com/blubrry/Simple_Flash_MP3_Player.mp3';
18
  $Audio['audioplay'] = 'http://media.blubrry.com/blubrry/content.blubrry.com/blubrry/AudioPlay.mp3';
19
 
20
-
 
 
 
 
21
  /*
22
  <div><
23
  object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="30" height="30">
@@ -31,6 +60,8 @@ function powerpress_admin_players()
31
  <script type="text/javascript" src="<?php echo powerpress_get_root_url(); ?>player.js"></script>
32
  <script type="text/javascript">
33
 
 
 
34
  function rgb2hex(rgb) {
35
 
36
  rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
@@ -104,6 +135,34 @@ input#colorpicker-value-input {
104
  padding: 0;
105
  margin: 0;
106
  font-size: 12px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  }
108
  </style>
109
  <?php
@@ -112,80 +171,142 @@ input#colorpicker-value-input {
112
  // a link should be provided to select a different player.
113
  if( $select_player )
114
  {
115
- ?>
116
- <script language="javascript" type="text/javascript">
117
- function powerpress_activate_player(Player)
118
- {
119
- jQuery('#player_'+Player).attr('checked', true);
120
- jQuery("form:first").submit();
121
- return false;
122
- }
123
- </script>
124
  <input type="hidden" name="action" value="powerpress-select-player" />
125
  <h2><?php echo __('Blubrry PowerPress Player Options', 'powerpress'); ?></h2>
126
- <p style="margin-bottom: 0;"><?php echo __('Select the media player you would like to use.', 'powerpress'); ?></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  <table class="form-table">
128
  <tr valign="top">
129
- <th scope="row"><?php echo __('Select Player', 'powerpress'); ?></th>
130
  <td>
131
-
132
  <ul>
133
  <li><label><input type="radio" name="Player[player]" id="player_default" value="default" <?php if( $General['player'] == 'default' || !isset($General['default']) ) echo 'checked'; ?> />
134
  <?php echo __('Flow Player Classic (default)', 'powerpress'); ?></label>
135
- <strong style="padding-top: 8px; margin-left: 20px;"><a href="#" onclick="return powerpress_activate_player('default');"><?php echo __('Activate and Configure Now', 'powerpress'); ?></a></strong>
136
  </li>
137
  <li style="margin-left: 30px; margin-bottom:16px;">
138
  <p>
139
- <?php
140
- $media_url = '';
141
- $content = '';
142
- $content .= '<div id="flow_player_classic"></div>'.PHP_EOL;
143
- $content .= '<script type="text/javascript">'.PHP_EOL;
144
- $content .= "pp_flashembed(\n";
145
- $content .= " 'flow_player_classic',\n";
146
- $content .= " {src: '". powerpress_get_root_url() ."FlowPlayerClassic.swf', width: 320, height: 24 },\n";
147
- $content .= " {config: { autoPlay: false, autoBuffering: false, initialScale: 'scale', showFullScreenButton: false, showMenu: false, videoFile: '{$Audio['default']}', loop: false, autoRewind: true } }\n";
148
- $content .= ");\n";
149
- $content .= "</script>\n";
150
- echo $content;
151
  ?>
152
  </p>
153
- <p>
154
- <?php echo __('Flow Player Classic is an open source flash player that supports both audio (mp3 only) and video (flv only) media files. It includes all the necessary features for playback including a play/pause button, scrollable position bar, ellapsed time, total time, mute button and volume control.', 'powerpress'); ?>
155
- </p>
156
- <p>
157
- <?php echo __('Flow Player Classic was chosen as the default player in Blubrry PowerPress because if its backwards compatibility with older versions of Flash and support for both audio and flash video.', 'powerpress'); ?>
158
- </p>
159
  </li>
160
 
161
  <li><label><input type="radio" name="Player[player]" id="player_audio_player" value="audio-player" <?php if( $General['player'] == 'audio-player' ) echo 'checked'; ?> /> <?php echo __('1 Pixel Out Audio Player', 'powerpress'); ?></label>
162
- <strong style="padding-top: 8px; margin-left: 20px;"><a href="#" onclick="return powerpress_activate_player('audio_player');"><?php echo __('Activate and Configure Now', 'powerpress'); ?></a></strong>
163
  </li>
164
  <li style="margin-left: 30px; margin-bottom:16px;">
165
  <p>
166
- <script language="JavaScript" src="<?php echo powerpressplayer_get_root_url();?>audio-player.js"></script>
167
- <object type="application/x-shockwave-flash" data="<?php echo powerpressplayer_get_root_url();?>audio-player.swf" id="audioplayer1" height="24" width="290">
168
- <param name="movie" value="<?php echo powerpressplayer_get_root_url();?>/audio-player.swf" />
169
- <param name="FlashVars" value="playerID=1&amp;soundFile=<?php echo $Audio['audio-player']; ?>" />
170
- <param name="quality" value="high" />
171
- <param name="menu" value="false" />
172
- <param name="wmode" value="transparent" />
173
- </object> </p>
174
  <p>
175
  <?php echo __('1 Pixel Out Audio Player is a popular customizable audio (mp3 only) flash player. Features include an animated play/pause button, scrollable position bar, ellapsed/remaining time, volume control and color styling options.', 'powerpress'); ?>
176
  </p>
177
  </li>
178
 
179
  <li><label><input type="radio" name="Player[player]" id="player_flashmp3_maxi" value="flashmp3-maxi" <?php if( $General['player'] == 'flashmp3-maxi' ) echo 'checked'; ?> /> <?php echo __('Mp3 Player Maxi', 'powerpress'); ?></label>
180
- <strong style="padding-top: 8px; margin-left: 20px;"><a href="#" onclick="return powerpress_activate_player('flashmp3_maxi');"><?php echo __('Activate and Configure Now', 'powerpress'); ?></a></strong>
181
  </li>
182
  <li style="margin-left: 30px; margin-bottom:16px;">
183
  <p>
184
- <object type="application/x-shockwave-flash" data="<?php echo powerpressplayer_get_root_url(); ?>player_mp3_maxi.swf" width="200" height="20">
185
- <param name="movie" value="<?php echo powerpressplayer_get_root_url(); ?>player_mp3_maxi.swf" />
186
- <param name="bgcolor" value="#ffffff" />
187
- <param name="FlashVars" value="mp3=<?php echo $Audio['flashmp3-maxi']; ?>&amp;showstop=1&amp;showinfo=1&amp;showvolume=1" />
188
- </object>
189
  </p>
190
  <p>
191
  <?php echo __('Flash Mp3 Maxi Player is a customizable open source audio (mp3 only) flash player. Features include pause/play/stop/file info buttons, scrollable position bar, volume control and color styling options.', 'powerpress'); ?>
@@ -193,18 +314,13 @@ function powerpress_activate_player(Player)
193
  </li>
194
 
195
  <li><label><input type="radio" name="Player[player]" id="player_simple_flash" value="simple_flash" <?php if( $General['player'] == 'simple_flash' ) echo 'checked'; ?> /> <?php echo __('Simple Flash MP3 Player', 'powerpress'); ?></label>
196
- <strong style="padding-top: 8px; margin-left: 20px;"><a href="#" onclick="return powerpress_activate_player('simple_flash');"><?php echo __('Activate and Configure Now', 'powerpress'); ?></a></strong>
197
  </li>
198
  <li style="margin-left: 30px; margin-bottom:16px;">
199
  <p>
200
-
201
- <object type="application/x-shockwave-flash" data="<?php echo powerpressplayer_get_root_url(); ?>simple_mp3.swf" width="150" height="50">
202
- <param name="movie" value="<?php echo powerpressplayer_get_root_url(); ?>simple_mp3.swf" />
203
- <param name="wmode" value="transparent" />
204
- <param name="FlashVars" value="url=<?php echo $Audio['simple_flash']; ?>&amp;autostart=false" />
205
- <param name="quality" value="high" />
206
- <embed wmode="transparent" src="<?php echo get_bloginfo('url'); ?>?url=<?php echo $Audio['simple_flash']; ?>&amp;autostart=false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="150" height="50"></embed>
207
- </object>
208
  </p>
209
  <p>
210
  <?php echo __('Simple Flash MP3 Player is a free and simple audio (mp3 only) flash player. Features include play/pause and stop buttons.', 'powerpress'); ?>
@@ -212,104 +328,141 @@ function powerpress_activate_player(Player)
212
  </li>
213
 
214
  <li><label><input type="radio" name="Player[player]" id="player_audioplay" value="audioplay" <?php if( $General['player'] == 'audioplay' ) echo 'checked'; ?> /> <?php echo __('AudioPlay', 'powerpress'); ?></label>
215
- <strong style="padding-top: 8px; margin-left: 20px;"><a href="#" onclick="return powerpress_activate_player('audioplay');"><?php echo __('Activate and Configure Now', 'powerpress'); ?></a></strong>
216
  </li>
217
  <li style="margin-left: 30px; margin-bottom:16px;">
218
  <p>
219
- <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="30" height="30">
220
- <param name="movie" value="<?php echo powerpressplayer_get_root_url(); ?>audioplay.swf?buttondir=<?php echo powerpressplayer_get_root_url(); ?>buttons/negative" />
221
- <param name="quality" value="high" />
222
- <param name="bgcolor" value="#FFFFFF" />
223
-
224
- <param name="FlashVars" value="buttondir=<?php echo powerpressplayer_get_root_url(); ?>buttons/negative&amp;mode=playstop" />
225
- <embed src="<?php echo powerpressplayer_get_root_url(); ?>audioplay.swf?file=<?php echo $Audio['audioplay']; ?>&amp;auto=no&amp;&sendstop=yes&amp;repeat=1&amp;mode=playpause&amp;buttondir=<?php echo powerpressplayer_get_root_url(); ?>buttons/negative" quality=high bgcolor=#FFFFFF width="30" height="30"
226
- align="" TYPE="application/x-shockwave-flash"
227
- pluginspage="http://www.macromedia.com/go/getflashplayer">
228
- </embed>
229
-
230
- </object>
231
-
232
  </p>
233
  <p>
234
  <?php echo __('AudioPlay is one button freeware audio (mp3 only) flash player. Features include a play/stop or play/pause button available in two sizes in either black or white.', 'powerpress'); ?>
235
  </p>
236
  </li>
237
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
238
 
239
  </ul>
240
 
241
  </td>
242
  </tr>
243
- </table>
 
 
 
244
  <h4 style="margin-bottom: 0;"><?php echo __('Click \'Save Changes\' to activate and configure selected player.', 'powerpress'); ?></h4>
245
  <?php
246
  }
247
  else
248
  {
249
  ?>
250
- <h2><?php echo __('Configure Player', 'powerpress'); ?></h2>
251
- <p style="margin-bottom: 20px;"><strong><a href="<?php echo admin_url("admin.php?page=powerpress/powerpressadmin_player.php&amp;sp=1"); ?>"><?php echo __('Select a different flash player', 'powerpress'); ?></a></strong></p>
252
- <?php
253
- // Start adding logic here to display options based on the player selected...
 
 
 
 
 
 
 
254
  switch( $General['player'] )
255
  {
256
- case 'audio-player': {
257
-
258
- $PlayerSettings = powerpress_get_settings('powerpress_audio-player');
259
- if($PlayerSettings == ""):
260
- $PlayerSettings = array(
261
- 'width'=>'290',
262
- 'transparentpagebg' => 'yes',
263
- 'lefticon' => '#333333',
264
- 'leftbg' => '#CCCCCC',
265
- 'bg' => '#E5E5E5',
266
- 'voltrack' => '#F2F2F2',
267
- 'volslider' => '#666666',
268
- 'rightbg' => '#B4B4B4',
269
- 'rightbghover' => '#999999',
270
- 'righticon' => '#333333',
271
- 'righticonhover' => '#FFFFFF',
272
- 'loader' => '#009900',
273
- 'track' => '#FFFFFF',
274
- 'tracker' => '#DDDDDD',
275
- 'border' => '#CCCCCC',
276
- 'skip' => '#666666',
277
- 'text' => '#333333',
278
- 'pagebg' => '',
279
- 'rtl' => 'no',
280
- 'initialvolume'=>'60',
281
- 'animation'=>'yes',
282
- 'remaining'=>'no',
283
- );
284
- endif;
285
-
286
- if( empty($PlayerSettings['remaining']) )
287
- $PlayerSettings['remaining'] = 'no'; // New default setting
288
- if( !isset($PlayerSettings['buffer']) )
289
- $PlayerSettings['buffer'] = ''; // New default setting
290
-
291
-
292
- $keys = array_keys($PlayerSettings);
293
- $flashvars ='';
294
- foreach ($keys as $key) {
295
- if($PlayerSettings[$key] != "") {
296
- $flashvars .= '&amp;'. $key .'='. preg_replace('/\#/','',$PlayerSettings[$key]);
297
- }
298
- }
299
 
300
- if($PlayerSettings['pagebg'] != ""){
301
- $transparency = '<param name="bgcolor" value="'.$PlayerSettings['pagebg'].'" />';
302
- $PlayerSettings['transparentpagebg'] = "no";
303
- $flashvars .= '&amp;transparentpagebg=no';
304
- $flashvars .= '&amp;pagebg='.$PlayerSettings['pagebg'];
305
- }
306
- else {
307
- $PlayerSettings['transparentpagebg'] = "yes";
308
- $transparency = '<param name="wmode" value="transparent" />';
309
- $flashvars .= '&amp;transparentpagebg=yes';
310
- }
311
  ?>
312
-
313
  <script type="text/javascript">
314
 
315
  function update_audio_player()
@@ -320,8 +473,8 @@ function update_audio_player()
320
  if( myWidth < 10 || myWidth > 900 )
321
  myWidth = 290;
322
 
323
- var out = '<object type="application/x-shockwave-flash" data="<?php echo powerpressplayer_get_root_url();?>/audio-player.swf" width="'+myWidth+'" height="24">'+"\n";
324
- out += ' <param name="movie" value="<?php echo powerpressplayer_get_root_url();?>/audio-player.swf" />'+"\n";
325
  out += ' <param name="FlashVars" value="playerID=1&amp;soundFile=<?php echo $Audio['audio-player']; ?>';
326
 
327
  var x = 0;
@@ -369,7 +522,7 @@ function update_audio_player()
369
 
370
  function audio_player_defaults()
371
  {
372
- if( confirm('<?php echo __("Set defaults, are you sure?\n\nAll of the current settings will be overwritten!", 'powerpress'); ?>') )
373
  {
374
  jQuery('#player_width').val('290');
375
  UpdatePlayerPreview('player_width',jQuery('#player_width').val() );
@@ -470,15 +623,10 @@ function audio_player_defaults()
470
  <th scope="row">
471
  <?php echo __('Preview of Player', 'powerpress'); ?>
472
  </th>
473
- <td>
474
- <div id="player_preview">
475
- <object type="application/x-shockwave-flash" data="<?php echo powerpressplayer_get_root_url();?>audio-player.swf" id="audioplayer1" height="24" width="<?php echo $PlayerSettings['width']; ?>">
476
- <param name="movie" value="<?php echo powerpressplayer_get_root_url();?>audio-player.swf" />
477
- <param name="FlashVars" value="playerID=1&amp;soundFile=<?php echo $Audio['audio-player']; ?><?php echo $flashvars;?>" />
478
- <param name="quality" value="high" />
479
- <param name="menu" value="false" />
480
- <?php echo $transparency; ?>
481
- </object>
482
  </div>
483
  </td>
484
  </tr>
@@ -788,22 +936,17 @@ function audio_player_defaults()
788
 
789
  <?php
790
  }; break;
791
- case 'simple_flash':{ ?>
792
  <table class="form-table">
793
  <tr valign="top">
794
  <th scope="row">
795
  <?php echo __('Preview of Player', 'powerpress'); ?>
796
  </th>
797
- <td>
798
- <p>
799
- <object type="application/x-shockwave-flash" data="<?php echo powerpressplayer_get_root_url(); ?>simple_mp3.swf" width="150" height="50">
800
- <param name="movie" value="<?php echo powerpressplayer_get_root_url(); ?>simple_mp3.swf" />
801
- <param name="wmode" value="transparent" />
802
- <param name="FlashVars" value="url=<?php echo $Audio['simple_flash']; ?>&amp;autostart=false" />
803
- <param name="quality" value="high" />
804
- <embed wmode="transparent" src="?url=<?php echo $Audio['simple_flash']; ?>&amp;autostart=false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="150" height="50"></embed>
805
- </object>
806
-
807
  </p>
808
  </td>
809
  </tr>
@@ -820,115 +963,47 @@ function audio_player_defaults()
820
  <?php }; break;
821
 
822
  case 'flashmp3-maxi': {
823
- //get settings for Flash MP3 Maxi player
824
- $PlayerSettings = powerpress_get_settings('powerpress_flashmp3-maxi');
825
-
826
-
827
- //set array values for dropdown lists
828
- $options = array('0','1');
829
- $autoload = array('always'=>'Always','never'=>'Never','autohide'=>'Auto Hide');
830
- $volume = array('0'=>'0','25'=>'25','50'=>'50','75'=>'75','100'=>'100','125'=>'125','150'=>'150','175'=>'175','200'=>'200');
831
-
832
- //set array values for flash variables with no dependencies
833
- $keys = array('bgcolor1','bgcolor2','bgcolor','textcolor','buttoncolor','buttonovercolor','showstop','showinfo','showvolume','height','width','showloading','buttonwidth','volume','showslider');
834
-
835
- //set PlayerSettings as blank array for initial setup
836
- //This keeps the foreach loop from returning an error
837
- if($PlayerSettings == ""){
838
- $PlayerSettings = array(
839
- 'bgcolor1'=>'#7c7c7c',
840
- 'bgcolor2'=>'#333333',
841
- 'textcolor' => '#FFFFFF',
842
- 'buttoncolor' => '#FFFFFF',
843
- 'buttonovercolor' => '#FFFF00',
844
- 'showstop' => '0',
845
- 'showinfo' => '0',
846
- 'showvolume' => '1',
847
- 'height' => '20',
848
- 'width' => '200',
849
- 'showloading' => 'autohide',
850
- 'buttonwidth' => '26',
851
- 'volume' => '100',
852
- 'showslider' => '1',
853
- 'slidercolor1'=>'#cccccc',
854
- 'slidercolor2'=>'#888888',
855
- 'sliderheight' => '10',
856
- 'sliderwidth' => '20',
857
- 'loadingcolor' => '#FFFF00',
858
- 'volumeheight' => '6',
859
- 'volumewidth' => '30',
860
- 'sliderovercolor' => '#eeee00'
861
- );
862
- }
863
-
864
- $flashvars = '';
865
- $flashvars .= "mp3=".$Audio['flashmp3-maxi'];
866
-
867
- //set non-blank options without dependencies as flash variables for preview
868
- foreach($keys as $key) {
869
- if($PlayerSettings[$key] != "") {
870
- $flashvars .= '&amp;'. $key .'='. preg_replace('/\#/','',$PlayerSettings[''.$key.'']);
871
- }
872
- }
873
- //set slider dependencies
874
- if($PlayerSettings['showslider'] != "0") {
875
- if($PlayerSettings['sliderheight'] != "") {
876
- $flashvars .= '&amp;sliderheight='. $PlayerSettings['sliderheight'];
877
- }
878
- if($PlayerSettings['sliderwidth'] != "") {
879
- $flashvars .= '&amp;sliderwidth='. $PlayerSettings['sliderwidth'];
880
- }
881
- if($PlayerSettings['sliderovercolor'] != ""){
882
- $flashvars .= '&amp;sliderovercolor='. preg_replace('/\#/','',$PlayerSettings['sliderovercolor']);
883
- }
884
- }
885
- //set volume dependencies
886
- if($PlayerSettings['showvolume'] != "0") {
887
- if($PlayerSettings['volumeheight'] != "") {
888
- $flashvars .= '&amp;volumeheight='. $PlayerSettings['volumeheight'];
889
- }
890
- if($PlayerSettings['volumewidth'] != "") {
891
- $flashvars .= '&amp;volumewidth='. $PlayerSettings['volumewidth'];
892
- }
893
- }
894
- //set autoload dependencies
895
- if( @$PlayerSettings['showautoload'] != "never") {
896
- if($PlayerSettings['loadingcolor'] != "") {
897
- $flashvars .= '&amp;laodingcolor='. preg_replace('/\#/','',$PlayerSettings['loadingcolor']);
898
- }
899
- }
900
-
901
-
902
- //set default width for object
903
- if($PlayerSettings['width'] == ""){
904
- $width = "200";
905
- }else{
906
- $width = $PlayerSettings['width'];
907
- }
908
- if($PlayerSettings['height'] == ""){
909
- $height = "20";
910
- }else{
911
- $height = $PlayerSettings['height'];
912
- }
913
-
914
- //set background transparency
915
- if($PlayerSettings['bgcolor'] != ""){
916
- $transparency = '<param name="bgcolor" value="'. $color7 .'" />';
917
- }else{
918
- $transparency = '<param name="wmode" value="transparent" />';
919
- }
920
-
921
- //set flashvars
922
- if($flashvars != ""){
923
- $flashvars= '<param name="FlashVars" value="'. $flashvars .'" />'.PHP_EOL;
924
- }
925
-
926
  ?>
927
  <script type="text/javascript">
928
 
929
  function audio_player_defaults()
930
  {
931
- if( confirm('<?php echo __("Set defaults, are you sure?\n\nAll of the current settings will be overwritten!'", 'powerpress'); ?>) )
932
  {
933
  jQuery('#bgcolor1').val('#7c7c7c');
934
  UpdatePlayerPreview('bgcolor1',jQuery('#bgcolor1').val() );
@@ -1012,8 +1087,8 @@ function audio_player_defaults()
1012
  }
1013
 
1014
  </script>
1015
- <input type="hidden" name="action" value="powerpress-flashmp3-maxi" />
1016
- Configure the Flash Mp3 Maxi Player
1017
  <table class="form-table">
1018
 
1019
  <tr valign="top">
@@ -1021,18 +1096,7 @@ function audio_player_defaults()
1021
  <?php echo __('Preview of Player', 'powerpress'); ?>
1022
  </th>
1023
  <td>
1024
- <div id="player_preview">
1025
- <?php
1026
-
1027
- $content = '<object type="application/x-shockwave-flash" data="'. powerpressplayer_get_root_url().'player_mp3_maxi.swf" width="'. $width.'" height="'. $height .'">'.PHP_EOL;
1028
- $content .= '<param name="movie" value="'. powerpressplayer_get_root_url().'player_mp3_maxi.swf" />'.PHP_EOL;
1029
- $content .= $transparency.PHP_EOL;
1030
- $content .= $flashvars;
1031
- $content .= '</object>'.PHP_EOL;
1032
-
1033
- // print $content;
1034
- ?>
1035
- </div>
1036
 
1037
  <script type="text/javascript" src="<?php echo powerpress_get_root_url(); ?>3rdparty/maxi_player/generator.js"></script>
1038
  <input type="hidden" id="gen_mp3" name="gen_mp3" value="<?php echo $Audio['flashmp3-maxi']; ?>" />
@@ -1047,14 +1111,14 @@ $content .= '</object>'.PHP_EOL;
1047
  <a href="#" onclick="audio_player_defaults();return false;"><?php echo __('Set Defaults', 'powerpress'); ?></a>
1048
  </div>
1049
  <ul class="powerpress_settings_tabs">
1050
- <li><a href="#tab_general"><span>Basic Settings</span></a></li>
1051
- <li><a href="#tab_buttons"><span>Button Settings</span></a></li>
1052
- <li><a href="#tab_volume"><span>Volume Settings</span></a></li>
1053
- <li><a href="#tab_slider"><span>Slider Settings</span></a></li>
1054
  </ul>
1055
 
1056
  <div id="tab_general" class="powerpress_tab">
1057
- <h3><?php echo __('General Settings'); ?></h3>
1058
  <table class="form-table">
1059
  <tr valign="top">
1060
  <td colspan="2">
@@ -1364,7 +1428,7 @@ $content .= '</object>'.PHP_EOL;
1364
 
1365
  <script type="text/javascript">
1366
 
1367
- generator.player = '<?php echo powerpressplayer_get_root_url(); ?>player_mp3_maxi.swf';
1368
  generator.addParam("gen_mp3", "mp3", "url", '');
1369
  generator.addParam("player_height", "height", "int", "20");
1370
  generator.addParam("player_width", "width", "int", "200");
@@ -1396,43 +1460,15 @@ $content .= '</object>'.PHP_EOL;
1396
  <?php
1397
  }; break;
1398
 
1399
- case 'audioplay': {
1400
  $PlayerSettings = powerpress_get_settings('powerpress_audioplay');
1401
- if($PlayerSettings == "") {
1402
- $PlayerSettings = array(
1403
- 'bgcolor' => '',
1404
- 'buttondir' => 'negative',
1405
- 'mode' => 'playpause'
1406
- );
1407
- }
1408
-
1409
- // Set standard variables for player
1410
- $flashvars = 'file='. $Audio['audioplay'];
1411
- $flashvars .= '&amp;repeat=1';
1412
-
1413
- if($PlayerSettings['bgcolor'] == ""){
1414
- $flashvars .= "&amp;usebgcolor=no";
1415
- $transparency = '<param name="wmode" value="transparent" />';
1416
- $htmlbg = "";
1417
- }
1418
- else{
1419
- $flashvars .= "&amp;bgcolor=". preg_replace('/\#/','0x',$PlayerSettings['bgcolor']);
1420
- $transparency = '<param name="bgcolor" value="'. $PlayerSettings['bgcolor']. '" />';
1421
- $htmlbg = 'bgcolor="'. $PlayerSettings['bgcolor'].'"';
1422
-
1423
- }
1424
-
1425
- if($PlayerSettings['buttondir'] == "") {
1426
- $flashvars .= "&amp;buttondir=".powerpressplayer_get_root_url()."buttons/negative";
1427
- }else{
1428
- $flashvars .= "&amp;buttondir=".powerpressplayer_get_root_url().'buttons/'.$PlayerSettings['buttondir'];
1429
-
1430
- }
1431
-
1432
- $width = $height = (strstr($PlayerSettings['buttondir'], 'small')===false?30:15);
1433
-
1434
- $flashvars .= '&amp;mode='. $PlayerSettings['mode'];
1435
-
1436
  ?>
1437
  <input type="hidden" name="action" value="powerpress-audioplay" />
1438
  <?php echo __('Configure the AudioPlay Player', 'powerpress'); ?><br clear="all" />
@@ -1447,15 +1483,7 @@ $content .= '</object>'.PHP_EOL;
1447
  <div id="player_preview">
1448
 
1449
  <?php
1450
- $content = '<object type="application/x-shockwave-flash" width="'. $width .'" height="'. $height .'" data="'. powerpressplayer_get_root_url().'audioplay.swf?'.$flashvars.'">'.PHP_EOL;
1451
- $content .= '<param name="movie" value="'. powerpressplayer_get_root_url().'audioplay.swf?'.$flashvars.'" />'.PHP_EOL;
1452
- $content .= '<param name="quality" value="high" />'.PHP_EOL;
1453
- $content .= $transparency.PHP_EOL;
1454
- $content .= '<param name="FlashVars" value="'.$flashvars.'" />'.PHP_EOL;
1455
- $content .= '<embed src="'. powerpressplayer_get_root_url().'audioplay.swf?'.$flashvars.'" quality="high" width="30" height="30" type="application/x-shockwave-flash">'.PHP_EOL;
1456
- $content .= "</embed>\n </object>\n";
1457
-
1458
- print $content;
1459
  ?>
1460
  </div>
1461
  </td>
@@ -1525,7 +1553,7 @@ print $content;
1525
  }
1526
 
1527
  }
1528
- echo '<tr><td><input type="radio" name="Player[buttondir]" value="'. $option .'"'. $selected .' /></td>'.$td.'<img src="'. powerpressplayer_get_root_url().'buttons/'.$option.'/playup.png" /></td><td>'.$name.' Button '.$warning.'</td></tr>';
1529
  }?>
1530
 
1531
  </table>
@@ -1535,12 +1563,41 @@ print $content;
1535
 
1536
  </table>
1537
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1538
  }; break;
1539
 
1540
  default: {
1541
 
1542
  ?>
1543
-
1544
  <table class="form-table">
1545
  <tr valign="top">
1546
  <th scope="row">
@@ -1548,37 +1605,160 @@ print $content;
1548
  </th>
1549
  <td>
1550
  <p>
1551
- <?php
1552
- $media_url = '';
1553
- $content = '';
1554
- $content .= '<div id="flow_player_classic"></div>'.PHP_EOL;
1555
- $content .= '<script type="text/javascript">'.PHP_EOL;
1556
- $content .= "pp_flashembed(\n";
1557
- $content .= " 'flow_player_classic',\n";
1558
- $content .= " {src: '". powerpress_get_root_url() ."FlowPlayerClassic.swf', width: 320, height: 24 },\n";
1559
- $content .= " {config: { autoPlay: false, autoBuffering: false, initialScale: 'scale', showFullScreenButton: false, showMenu: false, videoFile: '{$Audio['default']}', loop: false, autoRewind: true } }\n";
1560
- $content .= ");\n";
1561
- $content .= "</script>\n";
1562
- echo $content;
1563
  ?>
1564
  </p>
1565
  </td>
1566
  </tr>
1567
-
1568
- <tr valign="top">
1569
- <th scope="row">
1570
- &nbsp;
1571
- </th>
1572
- <td>
1573
- <p><?php echo __('Flow Player Classic has no additional settings.', 'powerpress'); ?></p>
1574
- </td>
1575
- </tr>
 
 
 
 
1576
  </table>
1577
-
1578
-
1579
  <?php
1580
  } break;
1581
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1582
  ?>
1583
 
1584
  <?php
1
  <?php
2
+ // PowerPress Player settings page
3
+
4
+ require_once( POWERPRESS_ABSPATH. '/powerpress-player.php'); // Include, if not included already
5
+
6
+ function powerpressplayer_flowplayer_info()
7
+ {
8
+ ?>
9
+ <p>
10
+ <?php echo __('Flow Player Classic is an open source flash player that supports both audio (mp3 and m4a) and video (mp4, m4v and flv) media files. It includes all the necessary features for playback including a play/pause button, scrollable position bar, ellapsed time, total time, mute button and volume control.', 'powerpress'); ?>
11
+ </p>
12
+
13
+ <p>
14
+ <?php echo __('Flow Player Classic was chosen as the default player in Blubrry PowerPress because if its backwards compatibility with older versions of Flash and support for both audio and video.', 'powerpress'); ?>
15
+ </p>
16
+ <?php
17
+ }
18
 
19
+ function powerpress_admin_players($type='audio')
20
  {
21
  $General = powerpress_get_settings('powerpress_general');
22
  $select_player = false;
23
  if( isset($_GET['sp']) )
24
  $select_player = true;
25
+
26
+ if( $type == 'video' )
27
+ {
28
+ if( !isset($General['video_player']) )
29
+ $select_player = true;
30
+ }
31
+ else
32
+ {
33
+ if( !isset($General['player']) )
34
+ $select_player = true;
35
+ }
36
+
37
 
38
  $Audio = array();
39
  $Audio['default'] = 'http://media.blubrry.com/blubrry/content.blubrry.com/blubrry/FlowPlayerClassic.mp3';
42
  $Audio['simple_flash'] = 'http://media.blubrry.com/blubrry/content.blubrry.com/blubrry/Simple_Flash_MP3_Player.mp3';
43
  $Audio['audioplay'] = 'http://media.blubrry.com/blubrry/content.blubrry.com/blubrry/AudioPlay.mp3';
44
 
45
+
46
+ $Video = array();
47
+ $Video['flare-player'] = 'http://media.blubrry.com/blubrry/content.blubrry.com/blubrry/FlarePlayer.mp4';
48
+ $Video['flow-player-classic'] = 'http://media.blubrry.com/blubrry/content.blubrry.com/blubrry/FlowPlayerClassic.flv';
49
+ $Video['html5video'] = 'http://media.blubrry.com/blubrry/content.blubrry.com/blubrry/HTML5Video.mp4';
50
  /*
51
  <div><
52
  object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="30" height="30">
60
  <script type="text/javascript" src="<?php echo powerpress_get_root_url(); ?>player.js"></script>
61
  <script type="text/javascript">
62
 
63
+ powerpress_url = '<?php echo powerpress_get_root_url(); ?>';
64
+
65
  function rgb2hex(rgb) {
66
 
67
  rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
135
  padding: 0;
136
  margin: 0;
137
  font-size: 12px;
138
+ border-spacing: 0;
139
+ border-width: 0;
140
+ }
141
+ table.html5formats {
142
+ width: 600px;
143
+ margin: 0;
144
+ padding: 0;
145
+ }
146
+ table.html5formats tr {
147
+ margin: 0;
148
+ padding: 0;
149
+ }
150
+ table.html5formats tr th {
151
+ font-weight: bold;
152
+ border-bottom: 1px solid #000000;
153
+ margin: 0;
154
+ padding: 0 5px;
155
+ width: 25%;
156
+ }
157
+ table.html5formats tr td {
158
+
159
+ border-right: 1px solid #000000;
160
+ border-bottom: 1px solid #000000;
161
+ margin: 0;
162
+ padding: 0 10px;
163
+ }
164
+ table.html5formats tr > td:first-child {
165
+ border-left: 1px solid #000000;
166
  }
167
  </style>
168
  <?php
171
  // a link should be provided to select a different player.
172
  if( $select_player )
173
  {
174
+ ?>
 
 
 
 
 
 
 
 
175
  <input type="hidden" name="action" value="powerpress-select-player" />
176
  <h2><?php echo __('Blubrry PowerPress Player Options', 'powerpress'); ?></h2>
177
+ <p style="margin-bottom: 0;"><?php echo __('Select the media player you would like to use.', 'powerpress'); ?></p>
178
+
179
+ <?php
180
+ if( $type == 'video' )
181
+ {
182
+ ?>
183
+ <table class="form-table">
184
+ <tr valign="top">
185
+ <th scope="row">&nbsp;</th>
186
+ <td>
187
+ <ul>
188
+ <li><label><input type="radio" name="VideoPlayer[video_player]" id="player_flow_player_classic_player" value="flow-player-classic" <?php if( @$General['video_player'] == 'flow-player-classic' ) echo 'checked'; ?> />
189
+ <?php echo __('Flow Player Classic', 'powerpress'); ?></label>
190
+ <strong style="padding-top: 8px; margin-left: 20px;"><a href="#" id="activate_flow_player_classic_player" class="activate-player"><?php echo __('Activate and Configure Now', 'powerpress'); ?></a></strong>
191
+ </li>
192
+ <li style="margin-left: 30px; margin-bottom:16px;">
193
+ <p>
194
+ <?php
195
+ echo powerpressplayer_build_flowplayerclassic( $Video['flow-player-classic'] );
196
+ ?>
197
+ </p>
198
+ <?php
199
+ powerpressplayer_flowplayer_info();
200
+ ?>
201
+ </li>
202
+
203
+ <li><label><input type="radio" name="VideoPlayer[video_player]" id="player_html5video" value="html5video" <?php if( @$General['video_player'] == 'html5video' ) echo 'checked'; ?> /> <?php echo __('HTML5 Video Player', 'powerpress'); ?> <?php echo powerpressadmin_new(); ?></label>
204
+ <strong style="padding-top: 8px; margin-left: 20px;"><a href="#" id="activate_html5video" class="activate-player"><?php echo __('Activate and Configure Now', 'powerpress'); ?></a></strong>
205
+ </li>
206
+ <li style="margin-left: 30px; margin-bottom:16px;">
207
+ <p>
208
+ <?php
209
+ echo powerpressplayer_build_html5video($Video['html5video']);
210
+ ?>
211
+ </p>
212
+ <p>
213
+ <?php echo __('HTML5 Video is an element introduced in the latest HTML specification (HTML5) for the purpose of playing videos.', 'powerpress'); ?>
214
+ </p>
215
+ <p>
216
+ <?php echo __('HTML5 Video Player is not format specific. See table below for a list of browsers and supported formats.', 'powerpress'); ?>
217
+ </p>
218
+ <table class="html5formats" border="0" cellpadding="0" cellspacing="0">
219
+ <tr>
220
+ <th><?php echo __('Browser', 'powerpress'); ?></th>
221
+ <th>H.264 (.mp4/.m4v)</th>
222
+ <th>WebM (.webm)</th>
223
+ <th>Theora (.ogg/.ogv)</th>
224
+ </tr>
225
+ <tr>
226
+ <td><i><?php echo __('Internet Explorer', 'powerpress'); ?></i></td>
227
+ <td><strong>9.0+</strong></td>
228
+ <td>-</td>
229
+ <td>-</td>
230
+ </tr>
231
+ <tr>
232
+ <td><i><?php echo __('Firefox', 'powerpress'); ?></i></td>
233
+ <td>-</td>
234
+ <td><strong>4.0+</strong></td>
235
+ <td><strong>3.5+</strong></td>
236
+ </tr>
237
+ <tr>
238
+ <td><i><?php echo __('Chrome', 'powerpress'); ?> <sup>1</sup></i></td>
239
+ <td>-</td>
240
+ <td><strong>6.0+</strong></td>
241
+ <td><strong>5.0+</strong></td>
242
+ </tr>
243
+ <tr>
244
+ <td><i><?php echo __('Opera', 'powerpress'); ?></i></td>
245
+ <td>-</td>
246
+ <td><strong>10.6+</strong></td>
247
+ <td><strong>10.5+</strong></td>
248
+ </tr>
249
+ <tr>
250
+ <td><i><?php echo __('Safari', 'powerpress'); ?> <sup>2</sup></i></td>
251
+ <td><strong>3.0+</strong></td>
252
+ <td>-</td>
253
+ <td>-</td>
254
+ </tr>
255
+ </table>
256
+ <div><sup>1</sup> <?php echo __('Chrome supported H.264 in previous versions, but no longer supports the format.', 'powerpress'); ?></div>
257
+ <div><sup>2</sup> <?php echo __('Safari requires QuickTime installed for HTML5 playback.', 'powerpress'); ?></div>
258
+ <p>
259
+ <?php echo __('Flow Player Classic is used when HTML5 support is not available.', 'powerpress'); ?>
260
+ </p>
261
+ </li>
262
+
263
+
264
+ </ul>
265
+
266
+ </td>
267
+ </tr>
268
+ </table>
269
+ <?php
270
+ }
271
+ else
272
+ {
273
+ ?>
274
  <table class="form-table">
275
  <tr valign="top">
276
+ <th scope="row">&nbsp;</th>
277
  <td>
 
278
  <ul>
279
  <li><label><input type="radio" name="Player[player]" id="player_default" value="default" <?php if( $General['player'] == 'default' || !isset($General['default']) ) echo 'checked'; ?> />
280
  <?php echo __('Flow Player Classic (default)', 'powerpress'); ?></label>
281
+ <strong style="padding-top: 8px; margin-left: 20px;"><a href="#" id="activate_default" class="activate-player"><?php echo __('Activate and Configure Now', 'powerpress'); ?></a></strong>
282
  </li>
283
  <li style="margin-left: 30px; margin-bottom:16px;">
284
  <p>
285
+ <?php
286
+ echo powerpressplayer_build_flowplayerclassic( $Audio['default'] );
 
 
 
 
 
 
 
 
 
 
287
  ?>
288
  </p>
289
+ <?php powerpressplayer_flowplayer_info(); ?>
 
 
 
 
 
290
  </li>
291
 
292
  <li><label><input type="radio" name="Player[player]" id="player_audio_player" value="audio-player" <?php if( $General['player'] == 'audio-player' ) echo 'checked'; ?> /> <?php echo __('1 Pixel Out Audio Player', 'powerpress'); ?></label>
293
+ <strong style="padding-top: 8px; margin-left: 20px;"><a href="#" id="activate_audio_player" class="activate-player"><?php echo __('Activate and Configure Now', 'powerpress'); ?></a></strong>
294
  </li>
295
  <li style="margin-left: 30px; margin-bottom:16px;">
296
  <p>
297
+ <?php echo powerpressplayer_build_1pxoutplayer( $Audio['audio-player'] ); ?>
298
+ </p>
 
 
 
 
 
 
299
  <p>
300
  <?php echo __('1 Pixel Out Audio Player is a popular customizable audio (mp3 only) flash player. Features include an animated play/pause button, scrollable position bar, ellapsed/remaining time, volume control and color styling options.', 'powerpress'); ?>
301
  </p>
302
  </li>
303
 
304
  <li><label><input type="radio" name="Player[player]" id="player_flashmp3_maxi" value="flashmp3-maxi" <?php if( $General['player'] == 'flashmp3-maxi' ) echo 'checked'; ?> /> <?php echo __('Mp3 Player Maxi', 'powerpress'); ?></label>
305
+ <strong style="padding-top: 8px; margin-left: 20px;"><a href="#" id="activate_flashmp3_maxi" class="activate-player"><?php echo __('Activate and Configure Now', 'powerpress'); ?></a></strong>
306
  </li>
307
  <li style="margin-left: 30px; margin-bottom:16px;">
308
  <p>
309
+ <?php echo powerpressplayer_build_flashmp3maxi( $Audio['flashmp3-maxi'] ); ?>
 
 
 
 
310
  </p>
311
  <p>
312
  <?php echo __('Flash Mp3 Maxi Player is a customizable open source audio (mp3 only) flash player. Features include pause/play/stop/file info buttons, scrollable position bar, volume control and color styling options.', 'powerpress'); ?>
314
  </li>
315
 
316
  <li><label><input type="radio" name="Player[player]" id="player_simple_flash" value="simple_flash" <?php if( $General['player'] == 'simple_flash' ) echo 'checked'; ?> /> <?php echo __('Simple Flash MP3 Player', 'powerpress'); ?></label>
317
+ <strong style="padding-top: 8px; margin-left: 20px;"><a href="#" id="activate_simple_flash" class="activate-player"><?php echo __('Activate and Configure Now', 'powerpress'); ?></a></strong>
318
  </li>
319
  <li style="margin-left: 30px; margin-bottom:16px;">
320
  <p>
321
+ <?php
322
+ echo powerpressplayer_build_simpleflash($Audio['simple_flash']);
323
+ ?>
 
 
 
 
 
324
  </p>
325
  <p>
326
  <?php echo __('Simple Flash MP3 Player is a free and simple audio (mp3 only) flash player. Features include play/pause and stop buttons.', 'powerpress'); ?>
328
  </li>
329
 
330
  <li><label><input type="radio" name="Player[player]" id="player_audioplay" value="audioplay" <?php if( $General['player'] == 'audioplay' ) echo 'checked'; ?> /> <?php echo __('AudioPlay', 'powerpress'); ?></label>
331
+ <strong style="padding-top: 8px; margin-left: 20px;"><a href="#" id="activate_audioplay" class="activate-player"><?php echo __('Activate and Configure Now', 'powerpress'); ?></a></strong>
332
  </li>
333
  <li style="margin-left: 30px; margin-bottom:16px;">
334
  <p>
335
+ <?php
336
+ echo powerpressplayer_build_audioplay($Audio['audioplay']);
337
+ ?>
 
 
 
 
 
 
 
 
 
 
338
  </p>
339
  <p>
340
  <?php echo __('AudioPlay is one button freeware audio (mp3 only) flash player. Features include a play/stop or play/pause button available in two sizes in either black or white.', 'powerpress'); ?>
341
  </p>
342
  </li>
343
+
344
+ <li><label><input type="radio" name="Player[player]" id="player_html5audio" value="html5audio" <?php if( $General['player'] == 'html5audio' ) echo 'checked'; ?> /> <?php echo __('HTML5 Audio Player', 'powerpress'); ?> <?php echo powerpressadmin_new(); ?></label>
345
+ <strong style="padding-top: 8px; margin-left: 20px;"><a href="#" id="activate_html5audio" class="activate-player"><?php echo __('Activate and Configure Now', 'powerpress'); ?></a></strong>
346
+ </li>
347
+ <li style="margin-left: 30px; margin-bottom:16px;">
348
+ <p>
349
+ <?php
350
+ echo powerpressplayer_build_html5audio($Audio['html5audio']);
351
+ ?>
352
+ </p>
353
+ <p>
354
+ <?php echo __('HTML5 audio is an element introduced in the latest HTML specification (HTML5) for the purpose of playing audio.', 'powerpress'); ?>
355
+ </p>
356
+ <p>
357
+ <?php echo __('HTML5 Audio Player is not format specific. See table below for a list of browsers and supported formats.', 'powerpress'); ?>
358
+ </p>
359
+ <table class="html5formats" border="0" cellpadding="0" cellspacing="0">
360
+ <tr>
361
+ <th><?php echo __('Browser', 'powerpress'); ?></th>
362
+ <th>Mpeg3 (.mp3)</th>
363
+ <th>AAC (.m4a)</th>
364
+ <th>Vorbis (.ogg/.oga)</th>
365
+ </tr>
366
+ <tr>
367
+ <td><i><?php echo __('Internet Explorer', 'powerpress'); ?></i></td>
368
+ <td><strong>9.0+</strong></td>
369
+ <td><strong>9.0+</strong></td>
370
+ <td>-</td>
371
+ </tr>
372
+ <tr>
373
+ <td><i><?php echo __('Firefox', 'powerpress'); ?></i></td>
374
+ <td>-</td>
375
+ <td>-</td>
376
+ <td><strong>3.5+</strong></td>
377
+ </tr>
378
+ <tr>
379
+ <td><i><?php echo __('Chrome', 'powerpress'); ?> <sup>1</sup></i></td>
380
+ <td><strong>5.0+</strong></td>
381
+ <td>-</td>
382
+ <td><strong>5.0+</strong></td>
383
+ </tr>
384
+ <tr>
385
+ <td><i><?php echo __('Opera', 'powerpress'); ?></i></td>
386
+ <td>-</td>
387
+ <td>-</td>
388
+ <td><strong>10.5+</strong></td>
389
+ </tr>
390
+ <tr>
391
+ <td><i><?php echo __('Safari', 'powerpress'); ?> <sup>2</sup></i></td>
392
+ <td><strong>3.0+</strong></td>
393
+ <td><strong>3.0+</strong></td>
394
+ <td>-</td>
395
+ </tr>
396
+ </table>
397
+ <div><sup>1</sup> <?php echo __('Chrome supported AAC in previous versions, but no longer supports the format.', 'powerpress'); ?></div>
398
+ <div><sup>2</sup> <?php echo __('Safari requires QuickTime installed for HTML5 playback.', 'powerpress'); ?></div>
399
+ <p>
400
+ <?php echo __('Flow Player Classic is used when HTML5 support is not available.', 'powerpress'); ?>
401
+ </p>
402
+ </li>
403
 
404
  </ul>
405
 
406
  </td>
407
  </tr>
408
+ </table>
409
+ <?php
410
+ }
411
+ ?>
412
  <h4 style="margin-bottom: 0;"><?php echo __('Click \'Save Changes\' to activate and configure selected player.', 'powerpress'); ?></h4>
413
  <?php
414
  }
415
  else
416
  {
417
  ?>
418
+ <h2><?php echo __('Configure Player', 'powerpress'); ?></h2>
419
+ <?php if( $type == 'audio' ) { ?>
420
+ <p style="margin-bottom: 20px;"><strong><a href="<?php echo admin_url("admin.php?page=powerpress/powerpressadmin_player.php&amp;sp=1"); ?>"><?php echo __('Select a different audio player', 'powerpress'); ?></a></strong></p>
421
+ <?php } else { ?>
422
+ <p style="margin-bottom: 20px;"><strong><a href="<?php echo admin_url("admin.php?page=powerpress/powerpressadmin_videoplayer.php&amp;sp=1"); ?>"><?php echo __('Select a different video player', 'powerpress'); ?></a></strong></p>
423
+ <?php
424
+ }
425
+
426
+ // Start adding logic here to display options based on the player selected...
427
+ if( $type == 'audio' )
428
+ {
429
  switch( $General['player'] )
430
  {
431
+ case 'audio-player': {
432
+
433
+ $PlayerSettings = powerpress_get_settings('powerpress_audio-player');
434
+ if($PlayerSettings == ""):
435
+ $PlayerSettings = array(
436
+ 'width'=>'290',
437
+ 'transparentpagebg' => 'yes',
438
+ 'lefticon' => '#333333',
439
+ 'leftbg' => '#CCCCCC',
440
+ 'bg' => '#E5E5E5',
441
+ 'voltrack' => '#F2F2F2',
442
+ 'volslider' => '#666666',
443
+ 'rightbg' => '#B4B4B4',
444
+ 'rightbghover' => '#999999',
445
+ 'righticon' => '#333333',
446
+ 'righticonhover' => '#FFFFFF',
447
+ 'loader' => '#009900',
448
+ 'track' => '#FFFFFF',
449
+ 'tracker' => '#DDDDDD',
450
+ 'border' => '#CCCCCC',
451
+ 'skip' => '#666666',
452
+ 'text' => '#333333',
453
+ 'pagebg' => '',
454
+ 'rtl' => 'no',
455
+ 'initialvolume'=>'60',
456
+ 'animation'=>'yes',
457
+ 'remaining'=>'no',
458
+ );
459
+ endif;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
460
 
461
+ if( empty($PlayerSettings['remaining']) )
462
+ $PlayerSettings['remaining'] = 'no'; // New default setting
463
+ if( !isset($PlayerSettings['buffer']) )
464
+ $PlayerSettings['buffer'] = ''; // New default setting
 
 
 
 
 
 
 
465
  ?>
 
466
  <script type="text/javascript">
467
 
468
  function update_audio_player()
473
  if( myWidth < 10 || myWidth > 900 )
474
  myWidth = 290;
475
 
476
+ var out = '<object type="application/x-shockwave-flash" data="<?php echo powerpress_get_root_url();?>/audio-player.swf" width="'+myWidth+'" height="24">'+"\n";
477
+ out += ' <param name="movie" value="<?php echo powerpress_get_root_url();?>/audio-player.swf" />'+"\n";
478
  out += ' <param name="FlashVars" value="playerID=1&amp;soundFile=<?php echo $Audio['audio-player']; ?>';
479
 
480
  var x = 0;
522
 
523
  function audio_player_defaults()
524
  {
525
+ if( confirm('<?php echo __("Set defaults, are you sure?\\n\\nAll of the current settings will be overwritten!", 'powerpress'); ?>') )
526
  {
527
  jQuery('#player_width').val('290');
528
  UpdatePlayerPreview('player_width',jQuery('#player_width').val() );
623
  <th scope="row">
624
  <?php echo __('Preview of Player', 'powerpress'); ?>
625
  </th>
626
+ <td><div id="player_preview">
627
+ <?php
628
+ echo powerpressplayer_build_1pxoutplayer($Audio['audio-player'], array('nodiv'=>true) );
629
+ ?>
 
 
 
 
 
630
  </div>
631
  </td>
632
  </tr>
936
 
937
  <?php
938
  }; break;
939
+ case 'simple_flash': { ?>
940
  <table class="form-table">
941
  <tr valign="top">
942
  <th scope="row">
943
  <?php echo __('Preview of Player', 'powerpress'); ?>
944
  </th>
945
+ <td><p>
946
+ <?php
947
+ // TODO
948
+ echo powerpressplayer_build_simpleflash($Audio['simple_flash']);
949
+ ?>
 
 
 
 
 
950
  </p>
951
  </td>
952
  </tr>
963
  <?php }; break;
964
 
965
  case 'flashmp3-maxi': {
966
+ //get settings for Flash MP3 Maxi player
967
+ $PlayerSettings = powerpress_get_settings('powerpress_flashmp3-maxi');
968
+
969
+ //set array values for dropdown lists
970
+ $autoload = array('always'=>'Always','never'=>'Never','autohide'=>'Auto Hide');
971
+ $volume = array('0'=>'0','25'=>'25','50'=>'50','75'=>'75','100'=>'100','125'=>'125','150'=>'150','175'=>'175','200'=>'200');
972
+
973
+ //set PlayerSettings as blank array for initial setup
974
+ //This keeps the foreach loop from returning an error
975
+ if( empty($PlayerSettings) ){
976
+ $PlayerSettings = array(
977
+ 'bgcolor1'=>'#7c7c7c',
978
+ 'bgcolor2'=>'#333333',
979
+ 'textcolor' => '#FFFFFF',
980
+ 'buttoncolor' => '#FFFFFF',
981
+ 'buttonovercolor' => '#FFFF00',
982
+ 'showstop' => '0',
983
+ 'showinfo' => '0',
984
+ 'showvolume' => '1',
985
+ 'height' => '20',
986
+ 'width' => '200',
987
+ 'showloading' => 'autohide',
988
+ 'buttonwidth' => '26',
989
+ 'volume' => '100',
990
+ 'showslider' => '1',
991
+ 'slidercolor1'=>'#cccccc',
992
+ 'slidercolor2'=>'#888888',
993
+ 'sliderheight' => '10',
994
+ 'sliderwidth' => '20',
995
+ 'loadingcolor' => '#FFFF00',
996
+ 'volumeheight' => '6',
997
+ 'volumewidth' => '30',
998
+ 'sliderovercolor' => '#eeee00'
999
+ );
1000
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1001
  ?>
1002
  <script type="text/javascript">
1003
 
1004
  function audio_player_defaults()
1005
  {
1006
+ if( confirm('<?php echo __("Set defaults, are you sure?\\n\\nAll of the current settings will be overwritten!'", 'powerpress'); ?>) )
1007
  {
1008
  jQuery('#bgcolor1').val('#7c7c7c');
1009
  UpdatePlayerPreview('bgcolor1',jQuery('#bgcolor1').val() );
1087
  }
1088
 
1089
  </script>
1090
+ <input type="hidden" name="action" value="powerpress-flashmp3-maxi" />
1091
+ <p><?php echo __('Configure Flash Mp3 Maxi Player', 'powerpress'); ?></p>
1092
  <table class="form-table">
1093
 
1094
  <tr valign="top">
1096
  <?php echo __('Preview of Player', 'powerpress'); ?>
1097
  </th>
1098
  <td>
1099
+ <div id="player_preview"></div>
 
 
 
 
 
 
 
 
 
 
 
1100
 
1101
  <script type="text/javascript" src="<?php echo powerpress_get_root_url(); ?>3rdparty/maxi_player/generator.js"></script>
1102
  <input type="hidden" id="gen_mp3" name="gen_mp3" value="<?php echo $Audio['flashmp3-maxi']; ?>" />
1111
  <a href="#" onclick="audio_player_defaults();return false;"><?php echo __('Set Defaults', 'powerpress'); ?></a>
1112
  </div>
1113
  <ul class="powerpress_settings_tabs">
1114
+ <li><a href="#tab_general"><span><?php echo __('Basic Settings', 'powerpress'); ?></span></a></li>
1115
+ <li><a href="#tab_buttons"><span><?php echo __('Button Settings', 'powerpress'); ?></span></a></li>
1116
+ <li><a href="#tab_volume"><span><?php echo __('Volume Settings', 'powerpress'); ?></span></a></li>
1117
+ <li><a href="#tab_slider"><span><?php echo __('Slider Settings', 'powerpress'); ?></span></a></li>
1118
  </ul>
1119
 
1120
  <div id="tab_general" class="powerpress_tab">
1121
+ <h3><?php echo __('General Settings', 'powerpress'); ?></h3>
1122
  <table class="form-table">
1123
  <tr valign="top">
1124
  <td colspan="2">
1428
 
1429
  <script type="text/javascript">
1430
 
1431
+ generator.player = '<?php echo powerpress_get_root_url(); ?>player_mp3_maxi.swf';
1432
  generator.addParam("gen_mp3", "mp3", "url", '');
1433
  generator.addParam("player_height", "height", "int", "20");
1434
  generator.addParam("player_width", "width", "int", "200");
1460
  <?php
1461
  }; break;
1462
 
1463
+ case 'audioplay': {
1464
  $PlayerSettings = powerpress_get_settings('powerpress_audioplay');
1465
+ if( empty($PlayerSettings) ) {
1466
+ $PlayerSettings = array(
1467
+ 'bgcolor' => '',
1468
+ 'buttondir' => 'negative',
1469
+ 'mode' => 'playpause'
1470
+ );
1471
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1472
  ?>
1473
  <input type="hidden" name="action" value="powerpress-audioplay" />
1474
  <?php echo __('Configure the AudioPlay Player', 'powerpress'); ?><br clear="all" />
1483
  <div id="player_preview">
1484
 
1485
  <?php
1486
+ echo powerpressplayer_build_audioplay($Audio['audioplay']);
 
 
 
 
 
 
 
 
1487
  ?>
1488
  </div>
1489
  </td>
1553
  }
1554
 
1555
  }
1556
+ echo '<tr><td><input type="radio" name="Player[buttondir]" value="'. $option .'"'. $selected .' /></td>'.$td.'<img src="'. powerpress_get_root_url().'buttons/'.$option.'/playup.png" /></td><td>'.$name.' Button '.$warning.'</td></tr>';
1557
  }?>
1558
 
1559
  </table>
1563
 
1564
  </table>
1565
  <?php
1566
+ }; break;
1567
+ case 'html5audio': {
1568
+
1569
+ ?>
1570
+ <p><?php echo __('Configure HTML5 Audio Player', 'powerpress'); ?></p>
1571
+ <table class="form-table">
1572
+ <tr valign="top">
1573
+ <th scope="row">
1574
+ <?php echo __('Preview of Player', 'powerpress'); ?>
1575
+ </th>
1576
+ <td>
1577
+ <p>
1578
+ <?php
1579
+ echo powerpressplayer_build_html5audio( $Audio['default'] );
1580
+ ?>
1581
+ </p>
1582
+ </td>
1583
+ </tr>
1584
+ <tr valign="top">
1585
+ <th scope="row">
1586
+ &nbsp;
1587
+ </th>
1588
+ <td>
1589
+ <p><?php echo __('HTML5 Audio Player has no additional settings.', 'powerpress'); ?></p>
1590
+ </td>
1591
+ </tr>
1592
+ </table>
1593
+
1594
+ <?php
1595
  }; break;
1596
 
1597
  default: {
1598
 
1599
  ?>
1600
+ <p><?php echo __('Configure Flow Player Classic', 'powerpress'); ?></p>
1601
  <table class="form-table">
1602
  <tr valign="top">
1603
  <th scope="row">
1605
  </th>
1606
  <td>
1607
  <p>
1608
+ <?php
1609
+ echo powerpressplayer_build_flowplayerclassic( $Audio['default'] );
 
 
 
 
 
 
 
 
 
 
1610
  ?>
1611
  </p>
1612
  </td>
1613
  </tr>
1614
+ </table>
1615
+
1616
+ <h2><?php echo __('General Settings', 'powerpress'); ?></h2>
1617
+ <table class="form-table">
1618
+ <tr valign="top">
1619
+ <th scope="row">
1620
+ <?php echo __('Width', 'powerpress'); ?>
1621
+ </th>
1622
+ <td valign="top">
1623
+ <input type="text" style="width: 50px;" id="player_width" name="General[player_width_audio]" class="player-width" value="<?php echo $General['player_width_audio']; ?>" maxlength="4" />
1624
+ <?php echo __('Width of Audio mp3 player (leave blank for 320 default)', 'powerpress'); ?>
1625
+ </td>
1626
+ </tr>
1627
  </table>
 
 
1628
  <?php
1629
  } break;
1630
+ }
1631
+ }
1632
+ else // Video
1633
+ {
1634
+ switch( $General['video_player'] )
1635
+ {
1636
+ case 'flow-player-classic': {
1637
+ ?>
1638
+ <p><?php echo __('Configure Flow Player Classic', 'powerpress'); ?></p>
1639
+ <table class="form-table">
1640
+ <tr valign="top">
1641
+ <th scope="row">
1642
+ <?php echo __('Preview of Player', 'powerpress'); ?>
1643
+ </th>
1644
+ <td>
1645
+ <p>
1646
+ <?php
1647
+ echo powerpressplayer_build_flowplayerclassic( $Video['flow-player-classic'] );
1648
+ ?>
1649
+ </p>
1650
+ </td>
1651
+ </tr>
1652
+ </table>
1653
+
1654
+ <?php
1655
+ }; break;
1656
+ case 'html5video': {
1657
+ ?>
1658
+ <p><?php echo __('Configure HTML5 Video Player', 'powerpress'); ?></p>
1659
+ <table class="form-table">
1660
+ <tr valign="top">
1661
+ <th scope="row">
1662
+ <?php echo __('Preview of Player', 'powerpress'); ?>
1663
+ </th>
1664
+ <td>
1665
+ <p>
1666
+ <?php
1667
+ echo powerpressplayer_build_html5video( $Video['flare-player'] );
1668
+ ?>
1669
+ </p>
1670
+ </td>
1671
+ </tr>
1672
+ </table>
1673
+
1674
+ <?php
1675
+ }; break;
1676
+ }
1677
+
1678
+ if( !isset($General['poster_play_image']) )
1679
+ $General['poster_play_image'] = 1;
1680
+ ?>
1681
+ <!-- Global Video Player settings (Appy to all video players -->
1682
+ <input type="hidden" name="action" value="powerpress-save-videocommon" />
1683
+ <h3><?php echo __('Common Settings', 'powerpress'); ?></h3>
1684
+ <p><?php echo __('The following video settings apply to the video player above as well as to classic video &lt;embed&gt; formats such as Microsoft Windows Media (.wmv), QuickTime (.mov) and RealPlayer.', 'powerpress'); ?></p>
1685
+ <table class="form-table">
1686
+ <tr valign="top">
1687
+ <th scope="row">
1688
+ <?php echo __('Player Width', 'powerpress'); ?>
1689
+ </th>
1690
+ <td>
1691
+ <input type="text" name="General[player_width]" style="width: 50px;" onkeyup="javascript:this.value=this.value.replace(/[^0-9]/g, '');" value="<?php echo $General['player_width']; ?>" maxlength="4" />
1692
+ <?php echo __('Width of player (leave blank for 400 default)', 'powerpress'); ?>
1693
+ </td>
1694
+ </tr>
1695
+
1696
+ <tr valign="top">
1697
+ <th scope="row">
1698
+ <?php echo __('Player Height', 'powerpress'); ?>
1699
+ </th>
1700
+ <td>
1701
+ <input type="text" name="General[player_height]" style="width: 50px;" onkeyup="javascript:this.value=this.value.replace(/[^0-9]/g, '');" value="<?php echo $General['player_height']; ?>" maxlength="4" />
1702
+ <?php echo __('Height of player (leave blank for 225 default)', 'powerpress'); ?>
1703
+ </td>
1704
+ </tr>
1705
+
1706
+ <tr valign="top">
1707
+ <th scope="row">
1708
+ <?php echo __('QuickTime Scale', 'powerpress'); ?></th>
1709
+ <td>
1710
+ <select name="General[player_scale]" class="bpp_input_sm" onchange="javascript:jQuery('#player_scale_custom').css('display', (this.value=='tofit'||this.value=='aspect'? 'none':'inline' ))">
1711
+ <?php
1712
+ $scale_options = array('tofit'=>__('ToFit (default)', 'powerpress'), 'aspect'=>__('Aspect', 'powerpress') );
1713
+ if( !isset($General['player_scale']) )
1714
+ $General['player_scale'] = 'tofit'; // Tofit works in almost all cases
1715
+
1716
+ if( is_numeric($General['player_scale']) )
1717
+ $scale_options[ $General['player_scale'] ]= __('Custom', 'powerpress');
1718
+ else
1719
+ $scale_options['custom']= __('Custom', 'powerpress');
1720
+
1721
+
1722
+
1723
+ while( list($value,$desc) = each($scale_options) )
1724
+ echo "\t<option value=\"$value\"". ($General['player_scale']==$value?' selected':''). ">$desc</option>\n";
1725
+
1726
+ $SupportUploads = powerpressadmin_support_uploads();
1727
+ ?>
1728
+ </select>
1729
+ <span id="player_scale_custom" style="display: <?php echo (is_numeric($General['player_scale'])?'inline':'none'); ?>">
1730
+ <?php echo __('Scale:', 'powerpress'); ?> <input type="text" name="PlayerScaleCustom" style="width: 50px;" onkeyup="javascript:this.value=this.value.replace(/[^0-9.]/g, '');" value="<?php echo (is_numeric($General['player_scale'])?$General['player_scale']:''); ?>" maxlength="4" /> <?php echo __('e.g.', 'powerpress'); ?> 1.5
1731
+ </span>
1732
+ <p style="margin-top: 5px; margin-bottom: 0;">
1733
+ <?php echo __('If you do not see video, adjust the width, height and scale settings above.', 'powerpress'); ?>
1734
+ </p>
1735
+ </td>
1736
+ </tr>
1737
+
1738
+ <tr>
1739
+ <th scope="row">
1740
+ <?php echo __('Default Poster Image', 'powerpress'); ?></th>
1741
+ <td>
1742
+
1743
+ <input type="text" id="poster_image" name="General[poster_image]" style="width: 60%;" value="<?php echo @$General['poster_image']; ?>" maxlength="250" />
1744
+ <a href="#" onclick="javascript: window.open( document.getElementById('poster_image').value ); return false;"><?php echo __('preview', 'powerpress'); ?></a>
1745
+
1746
+ <p><?php echo __('Place the URL to the poster image above.', 'powerpress'); ?> <?php echo __('Example', 'powerpress'); ?>: http://example.com/images/poster.jpg<br /><br />
1747
+ <?php echo __('Image should be at minimum the same width/height as the player above. Leave blank to use default black background image.', 'powerpress'); ?></p>
1748
+
1749
+ <?php if( $SupportUploads ) { ?>
1750
+ <p><input name="poster_image_checkbox" type="checkbox" onchange="powerpress_show_field('poster_image_upload', this.checked)" value="1" /> <?php echo __('Upload new image', 'powerpress'); ?> </p>
1751
+ <div style="display:none" id="poster_image_upload">
1752
+ <label for="poster_image_file"><?php echo __('Choose file', 'powerpress'); ?>:</label><input type="file" name="poster_image_file" />
1753
+ </div>
1754
+ <?php } ?>
1755
+ <p><input name="General[poster_play_image]" type="checkbox" value="1" <?php echo ($General['poster_play_image']?'checked':''); ?> /> <?php echo __('Include play icon over poster image when applicable.', 'powerpress'); ?> </p>
1756
+ </td>
1757
+ </tr>
1758
+
1759
+ </table>
1760
+ <?php
1761
+ }
1762
  ?>
1763
 
1764
  <?php
powerpressadmin-player.php CHANGED
@@ -6,12 +6,14 @@
6
  function powerpress_admin_players_init()
7
  {
8
  //wp_enqueue_script('jquery');
 
9
 
10
  $Settings = false; // Important, never remove this
11
  $Step = 1;
12
 
13
  $action = (isset($_GET['action'])?$_GET['action']: (isset($_POST['action'])?$_POST['action']:false) );
14
-
 
15
  if( !$action )
16
  return;
17
 
@@ -20,7 +22,11 @@ function powerpress_admin_players_init()
20
  case 'powerpress-select-player': {
21
 
22
  $SaveSettings = array();
23
- $SaveSettings = $_POST['Player'];
 
 
 
 
24
  powerpress_save_settings($SaveSettings, 'powerpress_general');
25
  powerpress_page_message_add_notice( __('Player activated successfully.', 'powerpress') );
26
 
@@ -50,60 +56,11 @@ function powerpress_admin_players_init()
50
 
51
  // add_action('init', 'powerpress_admin_players_init');
52
 
53
- function powerpress_admin_page_player_error()
54
  {
55
 
56
  }
57
 
58
- // Add what we need to the admin area of Blubrry PowerPress
59
- function powerpress_admin_page_player()
60
- {
61
- // Check that PowerPress is enabled..
62
- if( !defined('POWERPRESS_VERSION') )
63
- {
64
- // Print an error message here..
65
- ?>
66
- <h2><?php echo __('Blubrry PowerPress Player Options', 'powerpress'); ?></h2>
67
- <p><?php echo __('You must have the Blubrry PowerPress version 1.0 or newer installed for this plugin to work.', 'powerpress'); ?></p>
68
- <?php
69
- return;
70
- }
71
-
72
- // Check that PowerPress is new enoguh..
73
- if( version_compare(POWERPRESS_VERSION, '0.9') < 1 && !defined('POWERPRESS_PLAYER_SKIP_VERSION_CHECK') )
74
- {
75
- // Print an error message here..
76
- ?>
77
- <h2><?php echo __('Blubrry PowerPress Player Options', 'powerpress'); ?></h2>
78
- <p><?php echo __('Your copy of Blubrry PowerPress is out of date. You must have Blubrry PowerPress version 1.0 or newer installed for this plugin to work.', 'powerpress'); ?></p>
79
- <?php
80
- return;
81
- }
82
-
83
- //$Settings = get_option('powerpress_general');
84
- //powerpress_admin_page_header('powerpress/powerpressadmin_player.php', 'powerpress-edit', $simple_mode );
85
- require_once( POWERPRESS_ABSPATH.'/powerpressadmin-player-page.php');
86
- powerpress_admin_players();
87
- //powerpress_admin_page_footer(true);
88
- }
89
 
90
- /*
91
- function powerpress_player_admin_menu()
92
- {
93
- if( current_user_can('manage_options') )
94
- {
95
- $Settings = get_option('powerpress_general');
96
- if( $Settings && @$Settings['advanced_mode'] )
97
- {
98
- add_submenu_page('powerpress/powerpressadmin_basic.php', __('PowerPress Player Options'), __('Player Options'), 1, 'powerpress/powerpressadmin_player.php', 'powerpress_admin_page_player');
99
- }
100
- else
101
- {
102
- add_options_page('Blubrry PowerPress Player Options', 'PowerPress Player Options', 1, 'powerpress/powerpressadmin_player.php', 'powerpress_admin_page_player');
103
- }
104
- }
105
- }
106
 
107
- add_action('admin_menu', 'powerpress_player_admin_menu', 11); // later priority than PowerPress
108
- */
109
  ?>
6
  function powerpress_admin_players_init()
7
  {
8
  //wp_enqueue_script('jquery');
9
+ //echo "powerpres player init";
10
 
11
  $Settings = false; // Important, never remove this
12
  $Step = 1;
13
 
14
  $action = (isset($_GET['action'])?$_GET['action']: (isset($_POST['action'])?$_POST['action']:false) );
15
+ //$type = (isset($_GET['type'])?$_GET['type']: (isset($_POST['type'])?$_POST['type']:'audio') );
16
+
17
  if( !$action )
18
  return;
19
 
22
  case 'powerpress-select-player': {
23
 
24
  $SaveSettings = array();
25
+ //$SaveSettings = $_POST['Player'];
26
+ if( isset($_POST['Player']) )
27
+ $SaveSettings = $_POST['Player'];
28
+ if( isset($_POST['VideoPlayer']) )
29
+ $SaveSettings += $_POST['VideoPlayer'];
30
  powerpress_save_settings($SaveSettings, 'powerpress_general');
31
  powerpress_page_message_add_notice( __('Player activated successfully.', 'powerpress') );
32
 
56
 
57
  // add_action('init', 'powerpress_admin_players_init');
58
 
59
+ function powerpress_admin_page_videoplayer_error()
60
  {
61
 
62
  }
63
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
 
 
 
66
  ?>
powerpressadmin-podpress.php CHANGED
@@ -64,7 +64,7 @@ if( !function_exists('add_action') )
64
  $query = "SELECT p.ID, p.post_title, p.post_date, pm.meta_value ";
65
  $query .= "FROM {$wpdb->posts} AS p ";
66
  $query .= "INNER JOIN {$wpdb->postmeta} AS pm ON p.ID = pm.post_id ";
67
- $query .= "WHERE pm.meta_key = 'podPressMedia' ";
68
  $query .= "AND p.post_type != 'revision' ";
69
  $query .= "GROUP BY p.ID ";
70
  $query .= "ORDER BY p.post_date DESC ";
@@ -329,18 +329,6 @@ if( !function_exists('add_action') )
329
 
330
  add_filter('manage_powerpressadmin_importpodpress_columns', 'powerpressadmin_importpodpress_columns');
331
 
332
- function powerpressadmin_importpodpress_columns_print($include_ids=true)
333
- {
334
- $Columns = powerpressadmin_importpodpress_columns();
335
- while( list($key,$title) = each($Columns) )
336
- {
337
- if( $include_ids )
338
- echo '<th scope="col" id="'. $key .'" class="manage-column column-'. $key .'" style="">'. $title .'</th>';
339
- else
340
- echo '<th scope="col" class="manage-column column-'. $key .'" style="">'. $title .'</th>';
341
- }
342
- }
343
-
344
  function powerpress_admin_podpress()
345
  {
346
  $results = powerpress_get_podpress_episodes(false);
@@ -485,30 +473,16 @@ function select_all(index,value)
485
  <table class="widefat fixed" cellspacing="0">
486
  <thead>
487
  <tr>
488
- <?php
489
- if( function_exists('print_column_headers') )
490
- {
491
  print_column_headers('powerpressadmin_importpodpress');
492
- }
493
- else // WordPress 2.6 or older
494
- {
495
- powerpressadmin_importpodpress_columns_print();
496
- }
497
  ?>
498
  </tr>
499
  </thead>
500
 
501
  <tfoot>
502
  <tr>
503
- <?php
504
- if( function_exists('print_column_headers') )
505
- {
506
  print_column_headers('powerpressadmin_importpodpress', false);
507
- }
508
- else // WordPress 2.6 or older
509
- {
510
- powerpressadmin_importpodpress_columns_print(false);
511
- }
512
  ?>
513
  </tr>
514
  </tfoot>
@@ -595,7 +569,7 @@ function select_all(index,value)
595
  echo '<td '.$class.'><strong>';
596
  if ( current_user_can( 'edit_post', $post_id ) )
597
  {
598
- ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"', 'powerpress'), $import_data['post_title'])); ?>"><?php echo $import_data['post_title'] ?></a><?php
599
  }
600
  else
601
  {
64
  $query = "SELECT p.ID, p.post_title, p.post_date, pm.meta_value ";
65
  $query .= "FROM {$wpdb->posts} AS p ";
66
  $query .= "INNER JOIN {$wpdb->postmeta} AS pm ON p.ID = pm.post_id ";
67
+ $query .= "WHERE (pm.meta_key = 'podPressMedia' OR pm.meta_key = '_podPressMedia') ";
68
  $query .= "AND p.post_type != 'revision' ";
69
  $query .= "GROUP BY p.ID ";
70
  $query .= "ORDER BY p.post_date DESC ";
329
 
330
  add_filter('manage_powerpressadmin_importpodpress_columns', 'powerpressadmin_importpodpress_columns');
331
 
 
 
 
 
 
 
 
 
 
 
 
 
332
  function powerpress_admin_podpress()
333
  {
334
  $results = powerpress_get_podpress_episodes(false);
473
  <table class="widefat fixed" cellspacing="0">
474
  <thead>
475
  <tr>
476
+ <?php
 
 
477
  print_column_headers('powerpressadmin_importpodpress');
 
 
 
 
 
478
  ?>
479
  </tr>
480
  </thead>
481
 
482
  <tfoot>
483
  <tr>
484
+ <?php
 
 
485
  print_column_headers('powerpressadmin_importpodpress', false);
 
 
 
 
 
486
  ?>
487
  </tr>
488
  </tfoot>
569
  echo '<td '.$class.'><strong>';
570
  if ( current_user_can( 'edit_post', $post_id ) )
571
  {
572
+ ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr(sprintf(__('Edit "%s"', 'powerpress'), $import_data['post_title'])); ?>"><?php echo $import_data['post_title'] ?></a><?php
573
  }
574
  else
575
  {
powerpressadmin.php CHANGED
@@ -48,10 +48,18 @@ function powerpress_admin_init()
48
 
49
  add_thickbox(); // we use the thckbox for some settings
50
  wp_enqueue_script('jquery');
51
- wp_enqueue_script('jquery-ui-core');
52
  wp_enqueue_script('jquery-ui-tabs');
53
-
54
-
 
 
 
 
 
 
 
 
55
 
56
  if( function_exists('powerpress_admin_jquery_init') )
57
  powerpress_admin_jquery_init();
@@ -67,9 +75,9 @@ function powerpress_admin_init()
67
  powerpress_page_message_add_error( __('Another podcasting plugin has been detected, PowerPress is currently disabled.', 'powerpress') );
68
 
69
  global $wp_version;
70
- $VersionDiff = version_compare($wp_version, 2.6);
71
  if( $VersionDiff < 0 )
72
- powerpress_page_message_add_error( __('Blubrry PowerPress requires Wordpress version 2.6 or greater.', 'powerpress') );
73
 
74
  // Check for incompatible plugins:
75
  if( isset($GLOBALS['objWPOSFLV']) && is_object($GLOBALS['objWPOSFLV']) )
@@ -175,6 +183,32 @@ function powerpress_admin_init()
175
  }
176
  }
177
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  if( isset($_POST['UpdateDisablePlayer']) )
179
  {
180
  $player_feed_slug = $_POST['UpdateDisablePlayer'];
@@ -216,12 +250,14 @@ function powerpress_admin_init()
216
  if( !isset($General['display_player_excerpt']) ) // If we are modifying appearance settings but this option was not checked...
217
  $General['display_player_excerpt'] = 0; // Set it to zero.
218
 
219
- if( !isset($General['display_player_disable_mobile']) )
220
- $General['display_player_disable_mobile'] = 0;
221
 
222
  $General['disable_dashboard_widget'] = 0;
223
  if( !isset($_POST['StatsInDashboard'] ) )
224
  $General['disable_dashboard_widget'] = 1;
 
 
225
 
226
  if( !isset($General['episode_box_embed'] ) )
227
  $General['episode_box_embed'] = 0;
@@ -235,6 +271,8 @@ function powerpress_admin_init()
235
  $General['episode_box_no_player_and_links'] = 0;
236
  if( !isset($General['episode_box_cover_image'] ) )
237
  $General['episode_box_cover_image'] = 0;
 
 
238
  if( !isset($General['episode_box_keywords'] ) )
239
  $General['episode_box_keywords'] = 0;
240
  if( !isset($General['episode_box_subtitle'] ) )
@@ -253,8 +291,32 @@ function powerpress_admin_init()
253
  $General['cat_casting'] = 0;
254
  if( !isset($General['channels'] ) )
255
  $General['channels'] = 0;
256
- if( !isset($General['advanced_mode']) )
257
- $General['advanced_mode'] = 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
258
  }
259
 
260
  if( $_POST['action'] == 'powerpress-save-tags' )
@@ -307,6 +369,12 @@ function powerpress_admin_init()
307
  }
308
  }
309
 
 
 
 
 
 
 
310
  // Wordpress adds slashes to everything, but since we're storing everything serialized, lets remove them...
311
  $General = powerpress_stripslashes($General);
312
  powerpress_save_settings($General);
@@ -363,10 +431,7 @@ function powerpress_admin_init()
363
  powerpress_page_message_add_notice( __('Blubrry PowerPress MP3 Tag settings saved.', 'powerpress') );
364
  }; break;
365
  case 'powerpress-save-mode': {
366
- if( $General['advanced_mode'] == 1 )
367
- powerpress_page_message_add_notice( __('You are now in Advanced Mode.', 'powerpress') );
368
- else
369
- powerpress_page_message_add_notice( __('You are now in Simple Mode.', 'powerpress') );
370
  }; break;
371
  default: {
372
  powerpress_page_message_add_notice( __('Blubrry PowerPress settings saved.', 'powerpress') );
@@ -515,8 +580,8 @@ function powerpress_admin_init()
515
  }; break;
516
  case 'powerpress-save-mode': {
517
 
518
- if( !isset($_POST['General']['advanced_mode']) )
519
- powerpress_page_message_add_notice( __('You must select a Mode to continue.', 'powerpress') );
520
 
521
  }; break;
522
  }
@@ -739,13 +804,9 @@ function powerpress_admin_init()
739
  exit;
740
  }
741
 
742
- $GeneralSettings = get_option('powerpress_general');
743
- if( @$GeneralSettings['player_options'] )
744
- {
745
- // Make sure we include the player-options
746
- require_once( POWERPRESS_ABSPATH .'/powerpressadmin-player.php');
747
- powerpress_admin_players_init();
748
- }
749
  }
750
 
751
  add_action('init', 'powerpress_admin_init');
@@ -893,8 +954,10 @@ function powerpress_admin_menu()
893
 
894
  add_menu_page(__('PowerPress', 'powerpress'), __('PowerPress', 'powerpress'), 'edit_pages', 'powerpress/powerpressadmin_basic.php', 'powerpress_admin_page_basic', powerpress_get_root_url() . 'powerpress_ico.png');
895
  add_submenu_page('powerpress/powerpressadmin_basic.php', __('PowerPress Settings', 'powerpress'), __('Settings', 'powerpress'), 'edit_pages', 'powerpress/powerpressadmin_basic.php', 'powerpress_admin_page_basic' );
896
- if( @$Powerpress['player_options'] )
897
- add_submenu_page('powerpress/powerpressadmin_basic.php', __('PowerPress Audio Player Options', 'powerpress'), __('Audio Player', 'powerpress'), 'edit_pages', 'powerpress/powerpressadmin_player.php', 'powerpress_admin_page_players');
 
 
898
 
899
  if( $Powerpress['channels'] )
900
  add_submenu_page('powerpress/powerpressadmin_basic.php', __('PowerPress Custom Podcast Channels', 'powerpress'), __('Podcast Channels', 'powerpress'), 'edit_pages', 'powerpress/powerpressadmin_customfeeds.php', 'powerpress_admin_page_customfeeds');
@@ -955,14 +1018,14 @@ function powerpress_edit_post($post_ID, $post)
955
  $MediaURL = $Powerpress['url'];
956
  if( defined('POWERPRESS_ENABLE_HTTPS_MEDIA') )
957
  {
958
- if( strpos($MediaURL, 'http://') !== 0 && strpos($MediaURL, 'https://') !== 0 && $Powerpress['hosting'] != 1 ) // If the url entered does not start with a http:// or https://
959
  {
960
  $MediaURL = rtrim(@$GeneralSettings['default_url'], '/') .'/'. ltrim($MediaURL, '/');
961
  }
962
  }
963
  else
964
  {
965
- if( strpos($MediaURL, 'http://') !== 0 && $Powerpress['hosting'] != 1 ) // If the url entered does not start with a http://
966
  {
967
  $MediaURL = rtrim(@$GeneralSettings['default_url'], '/') .'/'. ltrim($MediaURL, '/');
968
  }
@@ -1034,13 +1097,13 @@ function powerpress_edit_post($post_ID, $post)
1034
  {
1035
  $error = __('Error', 'powerpress') ." ({$MediaURL}): {$MediaInfo['error']}";
1036
  powerpress_add_error($error);
1037
- continue;
1038
  }
1039
  else if( empty($MediaInfo['length']) )
1040
  {
1041
  $error = __('Error', 'powerpress') ." ({$MediaURL}): ". __('Unable to obtain size of media.', 'powerpress');
1042
  powerpress_add_error($error);
1043
- continue;
1044
  }
1045
  else
1046
  {
@@ -1092,11 +1155,46 @@ function powerpress_edit_post($post_ID, $post)
1092
  $ToSerialize['no_player'] = 1;
1093
  if( isset($Powerpress['no_links']) && $Powerpress['no_links'] )
1094
  $ToSerialize['no_links'] = 1;
 
 
 
 
 
 
 
1095
  if( isset($Powerpress['no_player_and_links']) && $Powerpress['no_player_and_links'] )
1096
  {
1097
  $ToSerialize['no_player'] = 1;
1098
  $ToSerialize['no_links'] = 1;
1099
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1100
  if( $Powerpress['set_duration'] == -1 )
1101
  unset($ToSerialize['duration']);
1102
  if( count($ToSerialize) > 0 ) // Lets add the serialized data
@@ -1227,12 +1325,39 @@ function powerpress_new_feed_url_prompt() {
1227
  return false;
1228
  }
1229
 
 
1230
  jQuery(document).ready(function($) {
1231
- jQuery("#powerpress_settings_page").tabs();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1232
  });
 
1233
 
1234
  </script>
1235
  <link rel="stylesheet" href="<?php echo powerpress_get_root_url(); ?>css/admin.css" type="text/css" media="screen" />
 
 
1236
  <?php
1237
  }
1238
  else if( $page_name == 'edit' || $page_name == 'edit-pages' ) // || $page_name == '' ) // we don't know the page, we better include our CSS just in case
@@ -1311,9 +1436,14 @@ jQuery(document).ready(function($) {
1311
  vertical-align: bottom;
1312
  font-size: 90%;
1313
  }
 
 
 
1314
  </style>
1315
  <script language="javascript">
1316
 
 
 
1317
  function powerpress_check_url(url)
1318
  {
1319
  var DestDiv = 'powerpress_warning';
@@ -1471,6 +1601,29 @@ function powerpress_get_media_info(FeedSlug)
1471
  }
1472
  }
1473
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1474
  function powerpress_remove_hosting(FeedSlug)
1475
  {
1476
  if( confirm('<?php echo __('Are you sure you want to remove this media file?', 'powerpress'); ?>') )
@@ -1479,7 +1632,43 @@ function powerpress_remove_hosting(FeedSlug)
1479
  jQuery( '#powerpress_url_'+FeedSlug ).val('');
1480
  jQuery( '#powerpress_hosting_'+FeedSlug ).val(0);
1481
  jQuery( '#powerpress_hosting_note_'+FeedSlug ).css('display', 'none');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1482
  }
 
1483
  }
1484
 
1485
  </script>
@@ -1670,7 +1859,7 @@ function powerpress_admin_page_footer($SaveButton=true, $form=true)
1670
  <input type="submit" name="Submit" id="powerpress_save_button" class="button-primary" value="<?php echo __('Save Changes', 'powerpress') ?>" />
1671
  </p>
1672
  <?php } ?>
1673
- <p style="font-size: 85%; text-align: center; padding-bottom: 25px;">
1674
  <a href="http://www.blubrry.com/powerpress/" title="Blubrry PowerPress" target="_blank"><?php echo __('Blubrry PowerPress', 'powerpress'); ?></a> <?php echo POWERPRESS_VERSION; ?> &#8212;
1675
  <a href="http://www.podcastfaq.com/" target="_blank" title="<?php echo __('PodcastFAQ.com', 'powerpress'); ?>"><?php echo __('PodcastFAQ.com', 'powerpress'); ?></a> |
1676
  <a href="http://help.blubrry.com/blubrry-powerpress/" target="_blank" title="<?php echo __('Blubrry PowerPress Documentation', 'powerpress'); ?>"><?php echo __('Documentation', 'powerpress'); ?></a> |
@@ -1688,14 +1877,15 @@ function powerpress_admin_page_basic()
1688
  {
1689
  $Settings = get_option('powerpress_general');
1690
 
1691
- if( !isset($Settings['advanced_mode']) )
1692
- {
1693
- powerpress_admin_page_header(false, 'powerpress-edit', true);
1694
- require_once( POWERPRESS_ABSPATH .'/powerpressadmin-mode.php');
1695
- powerpress_admin_mode();
1696
- powerpress_admin_page_footer(false);
1697
- return;
1698
- }
 
1699
 
1700
  powerpress_admin_page_header();
1701
  require_once( POWERPRESS_ABSPATH .'/powerpressadmin-basic.php');
@@ -1708,8 +1898,20 @@ function powerpress_admin_page_basic()
1708
  function powerpress_admin_page_players()
1709
  {
1710
  powerpress_admin_page_header('powerpress/powerpressadmin_player.php');
1711
- require_once( POWERPRESS_ABSPATH .'/powerpressadmin-player.php');
1712
- powerpress_admin_page_player();
 
 
 
 
 
 
 
 
 
 
 
 
1713
  powerpress_admin_page_footer(true);
1714
  }
1715
 
@@ -1822,7 +2024,7 @@ function powerpress_podpress_episodes_exist()
1822
  global $wpdb;
1823
  $query = "SELECT post_id ";
1824
  $query .= "FROM {$wpdb->postmeta} ";
1825
- $query .= "WHERE meta_key = 'podPressMedia' ";
1826
  $query .= "LIMIT 0, 1";
1827
  $results = $wpdb->get_results($query, ARRAY_A);
1828
  if( count($results) )
@@ -2012,111 +2214,43 @@ function powerpress_remote_fopen($url, $basic_auth = false, $post_args = array()
2012
  $content = curl_exec($curl);
2013
  $error = curl_errno($curl);
2014
  $error_msg = curl_error($curl);
 
2015
  curl_close($curl);
2016
  if( $error )
2017
  {
2018
- global $g_powerpress_remote_error;
2019
  $g_powerpress_remote_error = $error_msg;
 
2020
  return false;
2021
  }
2022
  return $content;
2023
  }
2024
 
2025
- global $wp_version;
2026
- if( version_compare('2.7', $wp_version, '<=') ) // Lets us specify the user agent and set the basic auth string...
2027
- {
2028
- $options = array();
2029
- $options['timeout'] = $timeout;
2030
- $options['user-agent'] = 'Blubrry PowerPress/'.POWERPRESS_VERSION;
2031
- if( $basic_auth )
2032
- $options['headers']['Authorization'] = 'Basic '.$basic_auth;
2033
-
2034
- if( count($post_args) > 0 )
2035
- {
2036
- $options['body'] = $post_args;
2037
- $response = wp_remote_post( $url, $options );
2038
- }
2039
- else
2040
- {
2041
- $response = wp_remote_get( $url, $options );
2042
- }
2043
-
2044
- if ( is_wp_error( $response ) )
2045
- {
2046
- global $g_powerpress_remote_error;
2047
- $g_powerpress_remote_error = $response->get_error_message();
2048
- return false;
2049
- }
2050
-
2051
- return $response['body'];
2052
- }
2053
 
2054
- // Try the fopen way:
2055
- if( count($post_args) > 0 && ini_get( 'allow_url_fopen' ) && function_exists('fsockopen') )
2056
  {
2057
- $post_query = '';
2058
- while( list($name,$value) = each($post_args) )
2059
- {
2060
- if( $post_query != '' )
2061
- $post_query .= '&';
2062
- $post_query .= $name;
2063
- $post_query .= '=';
2064
- $post_query .= urlencode($value);
2065
- }
2066
- $url_parts = parse_url($url);
2067
- $host = $url_parts['host'];
2068
- $port = ($url_parts['scheme']=='https'?443:80);
2069
- if( isset($url_parts['port']) )
2070
- $port = $url_parts['port'];
2071
-
2072
- $http_request = "POST {$url_parts['path']} HTTP/1.0\r\n";
2073
- $http_request .= "Host: $host\r\n";
2074
- if( $basic_auth )
2075
- $http_request .= 'Authorization: Basic '. $basic_auth ."\r\n";
2076
- $http_request .= 'Content-Type: application/x-www-form-urlencoded; charset='.get_option('blog_charset')."\r\n";
2077
- $http_request .= 'Content-Length: ' . strlen($post_query) . "\r\n";
2078
- $http_request .= 'User-Agent: Blubrry PowerPress/'.POWERPRESS_VERSION. "\r\n";
2079
- $http_request .= "\r\n";
2080
- $http_request .= $post_query;
2081
-
2082
- $response = '';
2083
- $fp = @fsockopen($host, $port, $errno, $errstr, 5);
2084
- if( $fp )
2085
- {
2086
- fwrite($fp, $http_request);
2087
- while ( !feof($fs) )
2088
- $response .= fgets($fs, 1160); // One TCP-IP packet
2089
- fclose($fs);
2090
- }
2091
-
2092
- $response = explode("\r\n\r\n", $response, 2);
2093
- if( count($response) > 1 )
2094
- return $response[1];
2095
-
2096
- global $g_powerpress_remote_error;
2097
- $g_powerpress_remote_error = __('Unable to parse response from server.', 'powerpress');
2098
- return false;
2099
  }
2100
-
2101
- // If we made it this far then we got a different problem.
2102
- if( count($post_args) > 0 )
2103
  {
2104
- global $g_powerpress_remote_error;
2105
- $g_powerpress_remote_error = __('Your version of WordPress is too outdated for this function.', 'powerpress');
2106
- return false;
2107
  }
2108
 
2109
- // Last ditch attempt using Pre WP2.7 helper function
2110
- if( $basic_auth )
2111
  {
2112
- $UserPassDecoded = base64_decode($basic_auth);
2113
- list($User, $Pass) = explode(':', $UserPassDecoded, 2);
2114
- $url_prefix = sprintf('http://%s:%s@', str_replace('@', '$', $User), $Pass);
2115
- $url = $url_prefix . substr($url, 7);
2116
  }
2117
-
2118
- // Use the bullt-in remote_fopen...
2119
- return wp_remote_fopen($url);
2120
  }
2121
 
2122
  // Process any episodes for the specified post that have been marked for hosting and that do not have full URLs...
@@ -2567,8 +2701,8 @@ function powerpress_default_settings($Settings, $Section='basic')
2567
  $Settings['podcast_link'] = 1;
2568
  if( !isset($Settings['display_player_excerpt']) )
2569
  $Settings['display_player_excerpt'] = 0;
2570
- if( !isset($Settings['display_player_disable_mobile']) )
2571
- $Settings['display_player_disable_mobile'] = 0;
2572
 
2573
  // Play in page obsolete, switching here:
2574
  if( $Settings['player_function'] == 5 )
@@ -2853,6 +2987,149 @@ function powerpress_print_options($options,$selected=null)
2853
  }
2854
  }
2855
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2856
  require_once( POWERPRESS_ABSPATH .'/powerpressadmin-jquery.php');
2857
  // Only include the dashboard when appropriate.
2858
  require_once( POWERPRESS_ABSPATH .'/powerpressadmin-dashboard.php');
48
 
49
  add_thickbox(); // we use the thckbox for some settings
50
  wp_enqueue_script('jquery');
51
+ wp_enqueue_script('jquery-ui-core'); // Now including the library at Google
52
  wp_enqueue_script('jquery-ui-tabs');
53
+
54
+ // For nice watermarks in admin area
55
+ wp_enqueue_script('jquery-watermark', powerpress_get_root_url() .'3rdparty/jquery.watermark.min.js');
56
+
57
+ // Powerpress page
58
+ if( isset($_GET['page']) && strstr($_GET['page'], 'powerpress' ) !== false )
59
+ {
60
+ //wp_enqueue_script('jquery-ui', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.min.js');
61
+ }
62
+
63
 
64
  if( function_exists('powerpress_admin_jquery_init') )
65
  powerpress_admin_jquery_init();
75
  powerpress_page_message_add_error( __('Another podcasting plugin has been detected, PowerPress is currently disabled.', 'powerpress') );
76
 
77
  global $wp_version;
78
+ $VersionDiff = version_compare($wp_version, 2.8);
79
  if( $VersionDiff < 0 )
80
+ powerpress_page_message_add_error( __('Blubrry PowerPress requires Wordpress version 2.8 or greater.', 'powerpress') );
81
 
82
  // Check for incompatible plugins:
83
  if( isset($GLOBALS['objWPOSFLV']) && is_object($GLOBALS['objWPOSFLV']) )
183
  }
184
  }
185
 
186
+ // New poster image
187
+ if( @$_POST['poster_image_checkbox'] == 1 )
188
+ {
189
+ $filename = str_replace(" ", "_", basename($_FILES['poster_image_file']['name']) );
190
+ $temp = $_FILES['poster_image_file']['tmp_name'];
191
+
192
+ if( file_exists($upload_path . $filename ) )
193
+ {
194
+ $filenameParts = pathinfo($filename);
195
+ do {
196
+ $filename_no_ext = substr($filenameParts['basename'], 0, (strlen($filenameParts['extension'])+1) * -1 );
197
+ $filename = sprintf('%s-%03d.%s', $filename_no_ext, rand(0, 999), $filenameParts['extension'] );
198
+ } while( file_exists($upload_path . $filename ) );
199
+ }
200
+
201
+ if( @getimagesize($temp) ) // Just check that it is an image, we may add more to this later
202
+ {
203
+ move_uploaded_file($temp, $upload_path . $filename);
204
+ $General['poster_image'] = $upload_url . $filename;
205
+ }
206
+ else
207
+ {
208
+ powerpress_page_message_add_error( __('Invalid poster image', 'powerpress') .': ' . htmlspecialchars($_FILES['poster_image_file']['name']) );
209
+ }
210
+ }
211
+
212
  if( isset($_POST['UpdateDisablePlayer']) )
213
  {
214
  $player_feed_slug = $_POST['UpdateDisablePlayer'];
250
  if( !isset($General['display_player_excerpt']) ) // If we are modifying appearance settings but this option was not checked...
251
  $General['display_player_excerpt'] = 0; // Set it to zero.
252
 
253
+ //if( !isset($General['display_player_disable_mobile']) )
254
+ // $General['display_player_disable_mobile'] = 0;
255
 
256
  $General['disable_dashboard_widget'] = 0;
257
  if( !isset($_POST['StatsInDashboard'] ) )
258
  $General['disable_dashboard_widget'] = 1;
259
+ if( !isset($General['disable_dashboard_news'] ) )
260
+ $General['disable_dashboard_news'] = 0;
261
 
262
  if( !isset($General['episode_box_embed'] ) )
263
  $General['episode_box_embed'] = 0;
271
  $General['episode_box_no_player_and_links'] = 0;
272
  if( !isset($General['episode_box_cover_image'] ) )
273
  $General['episode_box_cover_image'] = 0;
274
+ if( !isset($General['episode_box_player_size'] ) )
275
+ $General['episode_box_player_size'] = 0;
276
  if( !isset($General['episode_box_keywords'] ) )
277
  $General['episode_box_keywords'] = 0;
278
  if( !isset($General['episode_box_subtitle'] ) )
291
  $General['cat_casting'] = 0;
292
  if( !isset($General['channels'] ) )
293
  $General['channels'] = 0;
294
+
295
+ // Media Presentation Settings
296
+ $PlayerSettings = array();
297
+ if( !empty($_POST['PlayerSettings']) )
298
+ $PlayerSettings = $_POST['PlayerSettings'];
299
+ if( empty($PlayerSettings['display_pinw']) )
300
+ $PlayerSettings['display_pinw'] = 0;
301
+ if( empty($PlayerSettings['display_media_player']) )
302
+ $PlayerSettings['display_media_player'] = 0;
303
+ $General['player_function'] = abs( @$PlayerSettings['display_pinw'] - @$PlayerSettings['display_media_player'] );
304
+ $PlayerSettings['podcast_link'] = 0;
305
+ if( !empty($PlayerSettings['display_download']) )
306
+ {
307
+ $PlayerSettings['podcast_link'] = 1;
308
+ if( !empty($PlayerSettings['display_download_size']) )
309
+ {
310
+ $PlayerSettings['podcast_link'] = 2;
311
+ if( !empty($PlayerSettings['display_download_duration']) )
312
+ $PlayerSettings['podcast_link'] = 3;
313
+ }
314
+ }
315
+
316
+ if( !isset($General['podcast_embed'] ) )
317
+ $General['podcast_embed'] = 0;
318
+ if( !isset($General['podcast_embed_in_feed'] ) )
319
+ $General['podcast_embed_in_feed'] = 0;
320
  }
321
 
322
  if( $_POST['action'] == 'powerpress-save-tags' )
369
  }
370
  }
371
 
372
+ if( $_POST['action'] == 'powerpress-save-videocommon' )
373
+ {
374
+ if( !isset($General['poster_play_image'] ) )
375
+ $General['poster_play_image'] = 0;
376
+ }
377
+
378
  // Wordpress adds slashes to everything, but since we're storing everything serialized, lets remove them...
379
  $General = powerpress_stripslashes($General);
380
  powerpress_save_settings($General);
431
  powerpress_page_message_add_notice( __('Blubrry PowerPress MP3 Tag settings saved.', 'powerpress') );
432
  }; break;
433
  case 'powerpress-save-mode': {
434
+ // TODO:
 
 
 
435
  }; break;
436
  default: {
437
  powerpress_page_message_add_notice( __('Blubrry PowerPress settings saved.', 'powerpress') );
580
  }; break;
581
  case 'powerpress-save-mode': {
582
 
583
+ //if( !isset($_POST['General']['advanced_mode']) )
584
+ // powerpress_page_message_add_notice( __('You must select a Mode to continue.', 'powerpress') );
585
 
586
  }; break;
587
  }
804
  exit;
805
  }
806
 
807
+ // Hnadle player settings
808
+ require_once( POWERPRESS_ABSPATH .'/powerpressadmin-player.php');
809
+ powerpress_admin_players_init();
 
 
 
 
810
  }
811
 
812
  add_action('init', 'powerpress_admin_init');
954
 
955
  add_menu_page(__('PowerPress', 'powerpress'), __('PowerPress', 'powerpress'), 'edit_pages', 'powerpress/powerpressadmin_basic.php', 'powerpress_admin_page_basic', powerpress_get_root_url() . 'powerpress_ico.png');
956
  add_submenu_page('powerpress/powerpressadmin_basic.php', __('PowerPress Settings', 'powerpress'), __('Settings', 'powerpress'), 'edit_pages', 'powerpress/powerpressadmin_basic.php', 'powerpress_admin_page_basic' );
957
+ //if( @$Powerpress['player_options'] )
958
+
959
+ add_submenu_page('powerpress/powerpressadmin_basic.php', __('PowerPress Audio Player Options', 'powerpress'), __('Audio Player', 'powerpress'), 'edit_pages', 'powerpress/powerpressadmin_player.php', 'powerpress_admin_page_players');
960
+ add_submenu_page('powerpress/powerpressadmin_basic.php', __('PowerPress Video Player Options', 'powerpress'), __('Video Player', 'powerpress'), 'edit_pages', 'powerpress/powerpressadmin_videoplayer.php', 'powerpress_admin_page_videoplayers');
961
 
962
  if( $Powerpress['channels'] )
963
  add_submenu_page('powerpress/powerpressadmin_basic.php', __('PowerPress Custom Podcast Channels', 'powerpress'), __('Podcast Channels', 'powerpress'), 'edit_pages', 'powerpress/powerpressadmin_customfeeds.php', 'powerpress_admin_page_customfeeds');
1018
  $MediaURL = $Powerpress['url'];
1019
  if( defined('POWERPRESS_ENABLE_HTTPS_MEDIA') )
1020
  {
1021
+ if( !empty($GeneralSettings['default_url']) && strpos($MediaURL, 'http://') !== 0 && strpos($MediaURL, 'https://') !== 0 && $Powerpress['hosting'] != 1 ) // If the url entered does not start with a http:// or https://
1022
  {
1023
  $MediaURL = rtrim(@$GeneralSettings['default_url'], '/') .'/'. ltrim($MediaURL, '/');
1024
  }
1025
  }
1026
  else
1027
  {
1028
+ if( !empty($GeneralSettings['default_url']) && strpos($MediaURL, 'http://') !== 0 && $Powerpress['hosting'] != 1 ) // If the url entered does not start with a http://
1029
  {
1030
  $MediaURL = rtrim(@$GeneralSettings['default_url'], '/') .'/'. ltrim($MediaURL, '/');
1031
  }
1097
  {
1098
  $error = __('Error', 'powerpress') ." ({$MediaURL}): {$MediaInfo['error']}";
1099
  powerpress_add_error($error);
1100
+ //continue;
1101
  }
1102
  else if( empty($MediaInfo['length']) )
1103
  {
1104
  $error = __('Error', 'powerpress') ." ({$MediaURL}): ". __('Unable to obtain size of media.', 'powerpress');
1105
  powerpress_add_error($error);
1106
+ //continue;
1107
  }
1108
  else
1109
  {
1155
  $ToSerialize['no_player'] = 1;
1156
  if( isset($Powerpress['no_links']) && $Powerpress['no_links'] )
1157
  $ToSerialize['no_links'] = 1;
1158
+ if( isset($Powerpress['ishd']) && $Powerpress['ishd'] )
1159
+ $ToSerialize['ishd'] = 1;
1160
+ if( isset($Powerpress['width']) && trim($Powerpress['width']) )
1161
+ $ToSerialize['width'] =stripslashes( trim($Powerpress['width']));
1162
+ if( isset($Powerpress['height']) && trim($Powerpress['height']) )
1163
+ $ToSerialize['height'] = stripslashes(trim($Powerpress['height']));
1164
+
1165
  if( isset($Powerpress['no_player_and_links']) && $Powerpress['no_player_and_links'] )
1166
  {
1167
  $ToSerialize['no_player'] = 1;
1168
  $ToSerialize['no_links'] = 1;
1169
  }
1170
+
1171
+ // WebM Support:
1172
+ if( !empty($Powerpress['webm_src']) )
1173
+ {
1174
+ $WebMSrc = $Powerpress['webm_src'];
1175
+ if( !empty($GeneralSettings['default_url']) && strpos($WebMSrc, 'http://') !== 0 ) // && $Powerpress['hosting'] != 1 ) // If the url entered does not start with a http://
1176
+ {
1177
+ $WebMSrc = rtrim(@$GeneralSettings['default_url'], '/') .'/'. ltrim($WebMSrc, '/');
1178
+ }
1179
+ $ToSerialize['webm_src'] = $WebMSrc;
1180
+
1181
+ $MediaInfo = powerpress_get_media_info_local($WebMSrc, 'video/webm', 0, '');
1182
+ if( isset($MediaInfo['error']) )
1183
+ {
1184
+ $error = __('Error', 'powerpress') ." ({$WebMSrc}): {$MediaInfo['error']}";
1185
+ powerpress_add_error($error);
1186
+ }
1187
+ else if( empty($MediaInfo['length']) )
1188
+ {
1189
+ $error = __('Error', 'powerpress') ." ({$WebMSrc}): ". __('Unable to obtain size of media.', 'powerpress');
1190
+ powerpress_add_error($error);
1191
+ }
1192
+ else
1193
+ {
1194
+ $ToSerialize['webm_length'] = $MediaInfo['length'];
1195
+ }
1196
+ }
1197
+
1198
  if( $Powerpress['set_duration'] == -1 )
1199
  unset($ToSerialize['duration']);
1200
  if( count($ToSerialize) > 0 ) // Lets add the serialized data
1325
  return false;
1326
  }
1327
 
1328
+ /* Save tab position */
1329
  jQuery(document).ready(function($) {
1330
+
1331
+ if( jQuery("#powerpress_settings_page").length > 0 )
1332
+ {
1333
+ var tabs = jQuery("#powerpress_settings_page").tabs();
1334
+ tabs.tabs('select', <?php echo (empty($_POST['tab'])?0:$_POST['tab']); ?>);
1335
+ jQuery('form').submit(function() {
1336
+ var selectedTemp = tabs.tabs('option', 'selected');
1337
+ jQuery('#save_tab_pos').val(selectedTemp);
1338
+ });
1339
+ }
1340
+
1341
+ jQuery('.powerpress-parental-rating-tip').click( function() {
1342
+ jQuery('.powerpress-parental-rating-tip-p').css('display', 'none');
1343
+ jQuery('#'+this.id +'_p').css('display', 'block');
1344
+ });
1345
+ jQuery('.activate-player').click( function(event) {
1346
+ var PlayerName = this.id.replace(/(activate_)(.*)$/, "$2");
1347
+ if( !PlayerName )
1348
+ return;
1349
+
1350
+ jQuery('#player_'+PlayerName).attr('checked', true);
1351
+ jQuery("form:first").submit();
1352
+ event.preventDefault();
1353
+ });
1354
  });
1355
+
1356
 
1357
  </script>
1358
  <link rel="stylesheet" href="<?php echo powerpress_get_root_url(); ?>css/admin.css" type="text/css" media="screen" />
1359
+ <link rel="stylesheet" href="<?php echo powerpress_get_root_url(); ?>3rdparty/flare_player/flarevideo.css" type="text/css" media="screen" />
1360
+ <link rel="stylesheet" href="<?php echo powerpress_get_root_url(); ?>3rdparty/flare_player/flarevideo.default.css" type="text/css" media="screen" />
1361
  <?php
1362
  }
1363
  else if( $page_name == 'edit' || $page_name == 'edit-pages' ) // || $page_name == '' ) // we don't know the page, we better include our CSS just in case
1436
  vertical-align: bottom;
1437
  font-size: 90%;
1438
  }
1439
+ .powerpress-watermark {
1440
+ color: #666666;
1441
+ }
1442
  </style>
1443
  <script language="javascript">
1444
 
1445
+ g_powerpress_last_selected_channel = '';
1446
+
1447
  function powerpress_check_url(url)
1448
  {
1449
  var DestDiv = 'powerpress_warning';
1601
  }
1602
  }
1603
 
1604
+ function powerpress_update_for_video(media_url, FeedSlug)
1605
+ {
1606
+ if (media_url.search(/\.(mp4|m4v|ogg|ogv|webm)$/) > -1)
1607
+ {
1608
+ jQuery('#powerpress_ishd_'+ FeedSlug +'_span').css('display','inline');
1609
+ }
1610
+ else
1611
+ {
1612
+ jQuery('#powerpress_ishd_'+ FeedSlug +'_span').css('display','none');
1613
+ jQuery('#powerpress_ishd_'+ FeedSlug +'_span').removeAttr('checked');
1614
+ }
1615
+
1616
+
1617
+ if (media_url.search(/\.(mp4|m4v)$/) > -1)
1618
+ {
1619
+ jQuery('#powerpress_webm_'+ FeedSlug ).css('display', 'block');
1620
+ }
1621
+ else
1622
+ {
1623
+ jQuery('#powerpress_webm_'+ FeedSlug ).css('display', 'none');
1624
+ }
1625
+ }
1626
+
1627
  function powerpress_remove_hosting(FeedSlug)
1628
  {
1629
  if( confirm('<?php echo __('Are you sure you want to remove this media file?', 'powerpress'); ?>') )
1632
  jQuery( '#powerpress_url_'+FeedSlug ).val('');
1633
  jQuery( '#powerpress_hosting_'+FeedSlug ).val(0);
1634
  jQuery( '#powerpress_hosting_note_'+FeedSlug ).css('display', 'none');
1635
+ powerpress_update_for_video('', FeedSlug);
1636
+ }
1637
+ }
1638
+
1639
+ jQuery(document).ready(function($) {
1640
+ jQuery(".powerpress-duration-hh").watermark('HH', {className: 'powerpress-watermark'});
1641
+ jQuery(".powerpress-duration-mm").watermark('MM', {className: 'powerpress-watermark'});
1642
+ jQuery(".powerpress-duration-ss").watermark('SS', {className: 'powerpress-watermark'});
1643
+ jQuery(".powerpress-player-width").watermark('<?php echo __('Width', 'powerpress'); ?>', {className: 'powerpress-watermark'});
1644
+ jQuery(".powerpress-player-height").watermark('<?php echo __('Height', 'powerpress'); ?>', {className: 'powerpress-watermark'});
1645
+
1646
+ jQuery('.powerpress-url').change(function() {
1647
+
1648
+ var FeedSlug = this.id.replace(/(powerpress_url_)(.*)$/, "$2");
1649
+ if( !FeedSlug )
1650
+ return;
1651
+
1652
+ var media_url = jQuery(this).val();
1653
+ powerpress_check_url(media_url,'powerpress_warning_'+FeedSlug)
1654
+ powerpress_update_for_video(media_url, FeedSlug);
1655
+ });
1656
+
1657
+ jQuery('.powerpress-image-browser').click(function() {
1658
+ g_powerpress_last_selected_channel = this.id.replace(/(powerpress_image_browser_)(.*)$/, "$2");
1659
+ tb_show('<?php echo __('Add Poster Image', 'powerpress'); ?>', jQuery(this).attr('href') );
1660
+ return false;
1661
+ });
1662
+ });
1663
+
1664
+ function powerpress_send_to_poster_image(url)
1665
+ {
1666
+ if( g_powerpress_last_selected_channel )
1667
+ {
1668
+ jQuery('#powerpress_image_'+g_powerpress_last_selected_channel).val( url );
1669
+ g_powerpress_last_selected_channel = '';
1670
  }
1671
+ tb_remove();
1672
  }
1673
 
1674
  </script>
1859
  <input type="submit" name="Submit" id="powerpress_save_button" class="button-primary" value="<?php echo __('Save Changes', 'powerpress') ?>" />
1860
  </p>
1861
  <?php } ?>
1862
+ <p style="font-size: 85%; text-align: center; padding-bottom: 35px;">
1863
  <a href="http://www.blubrry.com/powerpress/" title="Blubrry PowerPress" target="_blank"><?php echo __('Blubrry PowerPress', 'powerpress'); ?></a> <?php echo POWERPRESS_VERSION; ?> &#8212;
1864
  <a href="http://www.podcastfaq.com/" target="_blank" title="<?php echo __('PodcastFAQ.com', 'powerpress'); ?>"><?php echo __('PodcastFAQ.com', 'powerpress'); ?></a> |
1865
  <a href="http://help.blubrry.com/blubrry-powerpress/" target="_blank" title="<?php echo __('Blubrry PowerPress Documentation', 'powerpress'); ?>"><?php echo __('Documentation', 'powerpress'); ?></a> |
1877
  {
1878
  $Settings = get_option('powerpress_general');
1879
 
1880
+ // TODO: Replace this with welcome message screen with options to select category and channel podcasting.
1881
+ //if( !isset($Settings['advanced_mode']) )
1882
+ //{
1883
+ // powerpress_admin_page_header(false, 'powerpress-edit', true);
1884
+ // require_once( POWERPRESS_ABSPATH .'/powerpressadmin-mode.php');
1885
+ // powerpress_admin_mode();
1886
+ // powerpress_admin_page_footer(false);
1887
+ // return;
1888
+ //}
1889
 
1890
  powerpress_admin_page_header();
1891
  require_once( POWERPRESS_ABSPATH .'/powerpressadmin-basic.php');
1898
  function powerpress_admin_page_players()
1899
  {
1900
  powerpress_admin_page_header('powerpress/powerpressadmin_player.php');
1901
+
1902
+ require_once( POWERPRESS_ABSPATH.'/powerpressadmin-player-page.php');
1903
+ powerpress_admin_players('audio');
1904
+
1905
+ //require_once( POWERPRESS_ABSPATH .'/powerpressadmin-player.php');
1906
+ //powerpress_admin_page_player();
1907
+ powerpress_admin_page_footer(true);
1908
+ }
1909
+
1910
+ function powerpress_admin_page_videoplayers()
1911
+ {
1912
+ powerpress_admin_page_header('powerpress/powerpressadmin_videoplayer.php');
1913
+ require_once( POWERPRESS_ABSPATH.'/powerpressadmin-player-page.php');
1914
+ powerpress_admin_players('video');
1915
  powerpress_admin_page_footer(true);
1916
  }
1917
 
2024
  global $wpdb;
2025
  $query = "SELECT post_id ";
2026
  $query .= "FROM {$wpdb->postmeta} ";
2027
+ $query .= "WHERE meta_key LIKE '%podPressMedia' ";
2028
  $query .= "LIMIT 0, 1";
2029
  $results = $wpdb->get_results($query, ARRAY_A);
2030
  if( count($results) )
2214
  $content = curl_exec($curl);
2215
  $error = curl_errno($curl);
2216
  $error_msg = curl_error($curl);
2217
+ $http_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
2218
  curl_close($curl);
2219
  if( $error )
2220
  {
2221
+ global $g_powerpress_remote_error, $g_powerpress_remote_errorno;
2222
  $g_powerpress_remote_error = $error_msg;
2223
+ $g_powerpress_remote_errorno = $http_code;
2224
  return false;
2225
  }
2226
  return $content;
2227
  }
2228
 
2229
+ $options = array();
2230
+ $options['timeout'] = $timeout;
2231
+ $options['user-agent'] = 'Blubrry PowerPress/'.POWERPRESS_VERSION;
2232
+ if( $basic_auth )
2233
+ $options['headers']['Authorization'] = 'Basic '.$basic_auth;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2234
 
2235
+ if( count($post_args) > 0 )
 
2236
  {
2237
+ $options['body'] = $post_args;
2238
+ $response = wp_remote_post( $url, $options );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2239
  }
2240
+ else
 
 
2241
  {
2242
+ $response = wp_remote_get( $url, $options );
 
 
2243
  }
2244
 
2245
+ if ( is_wp_error( $response ) )
 
2246
  {
2247
+ global $g_powerpress_remote_error, $g_powerpress_remote_errorno;
2248
+ $g_powerpress_remote_errorno = $response->get_error_code();
2249
+ $g_powerpress_remote_error = $response->get_error_message();
2250
+ return false;
2251
  }
2252
+
2253
+ return $response['body'];
 
2254
  }
2255
 
2256
  // Process any episodes for the specified post that have been marked for hosting and that do not have full URLs...
2701
  $Settings['podcast_link'] = 1;
2702
  if( !isset($Settings['display_player_excerpt']) )
2703
  $Settings['display_player_excerpt'] = 0;
2704
+ //if( !isset($Settings['display_player_disable_mobile']) )
2705
+ // $Settings['display_player_disable_mobile'] = 0;
2706
 
2707
  // Play in page obsolete, switching here:
2708
  if( $Settings['player_function'] == 5 )
2987
  }
2988
  }
2989
 
2990
+ /*
2991
+ Help Link
2992
+ 2.0 beta
2993
+ */
2994
+ function powerpress_help_link($link, $title = false )
2995
+ {
2996
+ if( $title == '' )
2997
+ $title = __('Learn More', 'powerpress');
2998
+
2999
+ return ' [<a href="'. $link .'" title="'. htmlspecialchars($title) .'" target="_blank">'. htmlspecialchars($title) .'</a>] ';
3000
+ }
3001
+
3002
+ $g_SupportUploads = null;
3003
+ function powerpressadmin_support_uploads()
3004
+ {
3005
+ global $g_SupportUploads;
3006
+ if( $g_SupportUploads != null )
3007
+ return $g_SupportUploads;
3008
+
3009
+ $g_SupportUploads = false;
3010
+ $UploadArray = wp_upload_dir();
3011
+ if( false === $UploadArray['error'] )
3012
+ {
3013
+ $upload_path = $UploadArray['basedir'].'/powerpress/';
3014
+
3015
+ if( !file_exists($upload_path) )
3016
+ $g_SupportUploads = @wp_mkdir_p( rtrim($upload_path, '/') );
3017
+ else
3018
+ $g_SupportUploads = true;
3019
+ }
3020
+ return $g_SupportUploads;
3021
+ }
3022
+
3023
+ function powerpressadmin_new()
3024
+ {
3025
+ return '<sup style="color: #CC0000; font-weight: bold;">'. __('new!', 'powerpress') .'</sup>';
3026
+ }
3027
+
3028
+
3029
+ function powerpressadmin_community_news($items=3)
3030
+ {
3031
+ $rss_items = powerpress_get_news(POWERPRESS_FEED_NEWS, $items);
3032
+ echo '<div class="powerpress-news-dashboard">';
3033
+ echo '<ul>';
3034
+
3035
+ if ( !$rss_items )
3036
+ {
3037
+ echo '<li>'. __('Error occurred retrieving news.' , 'powerpress') .'</li>';
3038
+ }
3039
+ else
3040
+ {
3041
+
3042
+ while( list($null,$item) = each($rss_items) )
3043
+ {
3044
+ $enclosure = $item->get_enclosure();
3045
+ echo '<li>';
3046
+ echo '<a class="rsswidget" href="'.esc_url( $item->get_permalink(), $protocolls=null, 'display' ).'" target="_blank">'. esc_html( $item->get_title() ) .'</a>';
3047
+ echo ' <span class="rss-date">'. $item->get_date('F j, Y') .'</span>';
3048
+ echo '<div class="rssSummary">'. esc_html( powerpress_feed_text_limit( strip_tags( $item->get_description() ), 150 ) ).'</div>';
3049
+ if( $enclosure && !empty($enclosure->link) )
3050
+ {
3051
+ $poster_image = '';
3052
+ $poster_tag = $item->get_item_tags('http://www.rawvoice.com/rawvoiceRssModule/', 'poster');
3053
+ if( $poster_tag && !empty($poster_tag[0]['attribs']['']['url']) )
3054
+ $poster_image = $item->sanitize($poster_tag[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT);
3055
+
3056
+ $embed = '';
3057
+ $embed_tag = $item->get_item_tags('http://www.rawvoice.com/rawvoiceRssModule/', 'embed');
3058
+ if( $embed_tag && !empty($embed_tag[0]['data']) )
3059
+ $embed = $embed_tag[0]['data'];
3060
+
3061
+ echo '<div class="powerpressNewsPlayer">';
3062
+
3063
+ if( $embed )
3064
+ {
3065
+ if( preg_match('/width="(\d{1,4})"/i', $embed, $matches ) && count($matches) > 1 )
3066
+ {
3067
+ $max_width = $matches[1];
3068
+ $embed = preg_replace('/width="/i', 'style="max-width: '.$max_width.'px;" width="', $embed );
3069
+ }
3070
+ $embed = preg_replace('/width="(\d{1,4})"/i', 'width="100%"', $embed );
3071
+ echo $embed;
3072
+ }
3073
+ else
3074
+ {
3075
+ $EpisodeData = array();
3076
+ $EpisodeData['type'] = $enclosure->type;
3077
+ $EpisodeData['duration'] = $enclosure->duration;
3078
+ $EpisodeData['poster'] = $poster_image;
3079
+ $EpisodeData['width'] = '80%';
3080
+ echo powerpressplayer_build_flowplayerclassic($enclosure->link, $EpisodeData);
3081
+ }
3082
+ echo '</div>';
3083
+ }
3084
+ echo '</li>';
3085
+ }
3086
+ }
3087
+
3088
+ echo '</ul>';
3089
+ echo '<br class="clear"/>';
3090
+ echo '<div style="margin-top:10px;border-top: 1px solid #ddd; padding-top: 10px; text-align:center;">';
3091
+ echo __('Subscribe:', 'powerpress');
3092
+ echo ' &nbsp; ';
3093
+ echo '<a href="http://www.powerpresspodcast.com/feed/"><img src="'.get_bloginfo('wpurl').'/wp-includes/images/rss.png" /> '. __('Blog', 'powerpress') .'</a>';
3094
+ echo ' &nbsp; ';
3095
+ echo '<a href="http://www.powerpresspodcast.com/feed/podcast/"><img src="'.get_bloginfo('wpurl').'/wp-includes/images/rss.png" /> '. __('Podcast', 'powerpress') .'</a>';
3096
+ echo ' &nbsp; ';
3097
+ echo '<a href="itpc://www.powerpresspodcast.com/feed/podcast/"><img src="'.powerpress_get_root_url().'/images/itunes_modern.png" /> '. __('iTunes', 'powerpress') .'</a>';
3098
+ echo ' &nbsp; ';
3099
+ echo '<a href="zune://subscribe/?Blubrry+PowerPress+and+Community+Podcast=http://www.powerpresspodcast.com/feed/podcast/"><img src="'.powerpress_get_root_url().'/images/zune.png" /> '. __('Zune', 'powerpress') .'</a>';
3100
+ //echo ' &nbsp; &nbsp; ';
3101
+
3102
+ echo '</div>';
3103
+ echo '</div>';
3104
+ }
3105
+
3106
+ function powerpressadmin_community_highlighted($items=8)
3107
+ {
3108
+ $rss_items = powerpress_get_news(POWERPRESS_FEED_HIGHLIGHTED, $items);
3109
+ echo '<div class="powerpress-highlighted-dashboard">';
3110
+ echo '<ul>';
3111
+
3112
+ if ( !$rss_items )
3113
+ {
3114
+ echo '<li>'. __('Error occurred retrieving highlighted items.' , 'powerpress') .'</li>';
3115
+ }
3116
+ else
3117
+ {
3118
+
3119
+ while( list($null,$item) = each($rss_items) )
3120
+ {
3121
+ echo '<li>';
3122
+ echo '<a class="rsswidget" href="'.esc_url( $item->get_permalink(), $protocolls=null, 'display' ).'" target="_blank">'. esc_html( $item->get_title() ) .'</a>';
3123
+ //echo ' <span class="rss-date">'. $item->get_date('F j, Y') .'</span>';
3124
+ echo '<div class="rssSummary">'. esc_html( powerpress_feed_text_limit( strip_tags( $item->get_description() ), 150 ) ).'</div>';
3125
+ echo '</li>';
3126
+ }
3127
+ }
3128
+
3129
+ echo '</ul>';
3130
+ echo '</div>';
3131
+ }
3132
+
3133
  require_once( POWERPRESS_ABSPATH .'/powerpressadmin-jquery.php');
3134
  // Only include the dashboard when appropriate.
3135
  require_once( POWERPRESS_ABSPATH .'/powerpressadmin-dashboard.php');
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Blubrry PowerPress Podcasting plugin ===
2
  Contributors: Angelo Mandato, Blubrry.com
3
- Tags: podcasting, podcast, podcaster, itunes, enclosure, zune, iphone, youtube, viddler, blip.tv, ustream, podcasting, audio, video, rss2, feed, player, media, rss, mp3, music, embed, feedburner, statistics, stats, flv, flash, id3, episodes, blubrry, wordpressmu, mu, wordpress mu, mediacaster, post, plugin, posts, simple, social, dashboard, TSG, Buzzsprout, MTR, WP-boxCast
4
- Requires at least: 2.6.0
5
- Tested up to: 3.0.4
6
- Stable tag: 1.0.13
7
 
8
  Blubrry PowerPress brings the essential features for podcasting to WordPress including full iTunes support, web audio/video media players and more.
9
 
@@ -14,14 +14,15 @@ Blubrry PowerPress brings the essential features for podcasting to WordPress. De
14
  *PowerPress is developed and maintained by [Blubrry](http://www.blubrry.com), a podcasting company and community providing tools and resources for podcasters to measure, monetize, publish and host podcasts. Although we'd like you to become a member of [Blubrry](http://www.blubrry.com/createaccount.php), **no membership is required** to use this free open source podcasting plugin.*
15
 
16
  = Key Features =
 
17
  - Full iTunes Support: Adds iTunes compliant podcast feeds to your WordPress blog.
18
- - Integrated Media Players: Audio/video web players with video embed support from sites such as YouTube and Ustream.tv.
19
  - Media Modifiers: Easily add, modify and remove podcasts form blog posts and pages.
20
  - Migration tools: Quickly migrate from PodPress, Blogger or Movable Type without losing episodes.
21
- - Multi-podcast support: Create separate podcasts by category (category casting) or by media format.
22
- - Supported Media Formats: mp3, m4a, ogg, wma, ra, mp4a, m4v, mp4v, mpg, asf, avi, wmv, flv, swf, mov, divx, 3gp, midi, wav, aa, pdf, torrent, m4b, m4r.
23
  - *Media Statistics: Get FREE Blubrry Media Statistics from your WordPress dashboard.
24
- * Languages supported: English, Danish, French ([Want to translate PowerPress?](http://www.blubrry.com/powerpress_translate/))
25
 
26
  *The Blubrry basic statistics service is FREE. Our [Premium Statistics Service](https://secure.blubrry.com/podcast-statistics-premium/), which includes U.S. downloads, trending and exporting, is available for $5 month.
27
 
@@ -30,19 +31,18 @@ iTunes can make up between 50 and 95 percent of a podcaster's audience. PowerPre
30
 
31
  * iTunes compliant podcast feeds: The appropriate tags are added to your feeds so your iTunes listing looks great.
32
  * Optimized iTunes Summary: Converts your blog post content to a format suited for viewing in iTunes ([learn more](http://help.blubrry.com/blubrry-powerpress/powerpress-settings/enhanced-itunes-summary/))
33
- * Update iTunes Listing: Notify (ping) iTunes when you publish new episodes.
34
- * Update iTunes Listing Logging: Check the status of your last iTunes listing update.
35
  * Upload iTunes Artwork: Upload and change your iTunes artwork directly from within PowerPress settings.
36
 
37
  = Integrated Media Players =
38
  Blubrry PowerPress includes extensive web player options to display your podcast audio and video in your web pages.
39
 
40
- * Pick from five mp3 players including the latest version of the popular [1 Pixel Out Player](http://wpaudioplayer.com/whatsnew).
41
- * Position player above or below your post content.
 
42
  * Place the player exactly where you want by adding the [powerpress] shortcode tag directly in your post content.
43
  * Add video embeds from sites such as YouTube, Viddler, Blip.tv and Ustream.tv.
44
- * Provides download and play in new window links.
45
- * Formats supported: mp3, m4v, m4a, ogg, mp4, wma, mov, pdf, swf, avi, mpeg and more.
46
 
47
  = Integrates with Blubrry's Services =
48
  Make your life easier by adding our FREE or paid services to streamline your podcast productivity.
@@ -57,6 +57,7 @@ The Blubrry basic statistics service is FREE. Our [Premium Statistics Service](h
57
  = Advanced Features =
58
  Want more? Check out the advanced features.
59
 
 
60
  * Media size and duration detection: Enter your media URL and let the PowerPress do the rest.
61
  * Category Casting: Add podcast support to your WordPress category feeds.
62
  * Custom Podcast Channels: Distribute multiple formats (audio/video) and versions (short/full length).
@@ -142,12 +143,41 @@ To install Blubrry PowerPress manually, follow these steps:
142
  == Changelog ==
143
 
144
  = Announcement =
145
- * Future versions of PowerPress will no longer be compatible with WordPress 2.6.x and 2.7.x. Please upgrade to WordPress 2.8 or newer to install future versions of PowerPress.
146
  * Translation support is now complete. Please visit the following link if you would like to have a version in your language: [http://www.blubrry.com/powerpress_translate/](http://www.blubrry.com/powerpress_translate/)
147
 
148
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  = 1.0.13 =
150
- * Released on 1/10/2010
151
  * Added additional support for the 'Podcasting' plugin's [podcast] shortcode. PowerPress will still add its player to the top/bottom of the page for backwards compatibility.
152
  * Eliminated 2 other situations where warning messages would appear in some cases.
153
  * Added Simplified Chinese translation to PowerPress. Thanks webmote for translating!
1
  === Blubrry PowerPress Podcasting plugin ===
2
  Contributors: Angelo Mandato, Blubrry.com
3
+ Tags: podcasting, podcast, podcaster, itunes, enclosure, zune, iphone, youtube, viddler, blip.tv, ustream, podcasting, audio, video, rss2, feed, player, media, rss, mp3, music, embed, feedburner, statistics, stats, flv, flash, id3, episodes, blubrry, webm, mp4, m4v, wordpressmu, mu, wordpress mu, mediacaster, post, plugin, posts, simple, social, dashboard, TSG, Buzzsprout, MTR, WP-boxCast, CastMyBlog
4
+ Requires at least: 2.8.0
5
+ Tested up to: 3.1
6
+ Stable tag: 2.0
7
 
8
  Blubrry PowerPress brings the essential features for podcasting to WordPress including full iTunes support, web audio/video media players and more.
9
 
14
  *PowerPress is developed and maintained by [Blubrry](http://www.blubrry.com), a podcasting company and community providing tools and resources for podcasters to measure, monetize, publish and host podcasts. Although we'd like you to become a member of [Blubrry](http://www.blubrry.com/createaccount.php), **no membership is required** to use this free open source podcasting plugin.*
15
 
16
  = Key Features =
17
+ - HTML5 video support: Add both mp4 and webm media to each episode for maximum platform compatibility
18
  - Full iTunes Support: Adds iTunes compliant podcast feeds to your WordPress blog.
19
+ - Integrated HTML5 and Flash Media Players: Audio/video web players with embed support from sites such as YouTube and Ustream.tv.
20
  - Media Modifiers: Easily add, modify and remove podcasts form blog posts and pages.
21
  - Migration tools: Quickly migrate from PodPress, Blogger or Movable Type without losing episodes.
22
+ - Multi-podcast support: Create separate podcasts by category (category casting) or by media format (Podcast Channels).
23
+ - Supported Media Formats: mp3, m4a, mp4, m4v, webm, ogg, oga, ogv, wma, ra, mp4a, m4v, mp4v, mpg, asf, avi, wmv, flv, swf, mov, divx, 3gp, midi, wav, aa, pdf, torrent, m4b, m4r.
24
  - *Media Statistics: Get FREE Blubrry Media Statistics from your WordPress dashboard.
25
+ * Languages supported: English, Danish, French, Simplified Chinese ([Want to translate PowerPress?](http://www.blubrry.com/powerpress_translate/))
26
 
27
  *The Blubrry basic statistics service is FREE. Our [Premium Statistics Service](https://secure.blubrry.com/podcast-statistics-premium/), which includes U.S. downloads, trending and exporting, is available for $5 month.
28
 
31
 
32
  * iTunes compliant podcast feeds: The appropriate tags are added to your feeds so your iTunes listing looks great.
33
  * Optimized iTunes Summary: Converts your blog post content to a format suited for viewing in iTunes ([learn more](http://help.blubrry.com/blubrry-powerpress/powerpress-settings/enhanced-itunes-summary/))
 
 
34
  * Upload iTunes Artwork: Upload and change your iTunes artwork directly from within PowerPress settings.
35
 
36
  = Integrated Media Players =
37
  Blubrry PowerPress includes extensive web player options to display your podcast audio and video in your web pages.
38
 
39
+ * 6 Audio Players: Pick from 6 audio players including the popular [1 Pixel Out Player](http://wpaudioplayer.com/whatsnew) and HTML5 audio player.
40
+ * 2 Video Players: Pick between HTML5 video or Flow Player Classic Flash player.
41
+ * Position player above or below your post content or use the`[powerpress]` shortcode and position the player where you want.
42
  * Place the player exactly where you want by adding the [powerpress] shortcode tag directly in your post content.
43
  * Add video embeds from sites such as YouTube, Viddler, Blip.tv and Ustream.tv.
44
+ * Provides download, play in new window and embed links.
45
+ * Formats supported: mp3, m4v, mp4, m4a, webm, ogg, ogv, oga, wma, mov, pdf, swf, avi, mpeg and more.
46
 
47
  = Integrates with Blubrry's Services =
48
  Make your life easier by adding our FREE or paid services to streamline your podcast productivity.
57
  = Advanced Features =
58
  Want more? Check out the advanced features.
59
 
60
+ * Embeds! Provide embeds your audience can take with them (just like YouTube embeds)
61
  * Media size and duration detection: Enter your media URL and let the PowerPress do the rest.
62
  * Category Casting: Add podcast support to your WordPress category feeds.
63
  * Custom Podcast Channels: Distribute multiple formats (audio/video) and versions (short/full length).
143
  == Changelog ==
144
 
145
  = Announcement =
146
+ * The future major release of PowerPress (3.x) will no longer be compatible with WordPress 2.8.x and 2.9.x. Please upgrade to WordPress 3.0 or newer to install future versions of PowerPress.
147
  * Translation support is now complete. Please visit the following link if you would like to have a version in your language: [http://www.blubrry.com/powerpress_translate/](http://www.blubrry.com/powerpress_translate/)
148
 
149
 
150
+ = 2.0 =
151
+ * Released on 3/7/2011
152
+ * PowerPress now requires WordPress version 2.8 or newer.
153
+ * HTML5 video player with Flow Player Classic fallback added
154
+ * HTML5 audio player with Flow Player Classic fallback added
155
+ * Embed Episode feature, embeds your audience can take with them (just like YouTube embeds)
156
+ * WebM video support added
157
+ * Ogg audio/video support improved
158
+ * For mp4/m4v video, a new alternative WebM URL field has been added. This is ideal for supporting all browser based HTML5 video players.
159
+ * Flow Player Classic can now play m4a audio and mp4/m4v video
160
+ * Elimation of Simple Mode
161
+ * Video default size is now 400 wide by 225 high (a 16:9 ratio)
162
+ * New Video Player settings page added
163
+ * Settings pages enhanced with new options such as location, frequency and T.V. options added
164
+ * Episode Entry box enhanced with new 'isHD' option when video entered into Media URL box
165
+ * Episode Entry box now includes option to configure video player width/height on a per-episode basis.
166
+ * New RawVoice RSS namespace added
167
+ * Player logic has been moved to powerpress-player.php, and a new option is available to disable player options completely. When player options disabled completely, the powerpress-player.php is not included in normal page loads.
168
+ * PowerPress updated to be able to import episodes from latest versions of PodPress (change made in February, 2011 in PodPress how episodes are stored in WordPress).
169
+ * New watarmarks added to Episode Entry Box for HH:MM:SS. Watermarks will be incorporated in additional fields in the future.
170
+ * iTunes Update Directory feature (pingPodcast) is slated for removal in next release. Apple no longer supports this feature. Read more here: [Apple Drops iTunes Podcast Directory Update Listing/Ping (pingPodcast) Function](http://blog.blubrry.com/2011/02/11/apple-drops-itunes-podcast-directory-update-listing-ping-functionality/)
171
+ * Upload image option added to supplement the video poster image field. Images are uploaded to the built-in image gallery in WordPress.
172
+ * Option added to include play icon over poster image where applicable (such as HTML5 Video)
173
+ * Error message displayed if another plugin is including a different version of the getid3 library.
174
+ * New Blubrry PowerPress and Community Podcast added to welcome tab and dashboard.
175
+ * By default, media files with extension .ogg are treated as audio. Video ogg files should use the .ogv extension. If you wish to override this behavior, add the following define to your wp-config.php: `define('POWERPRESS_OGG_VIDEO', true);`
176
+ * Added define option `define('POWERPRESS_ENCLOSURE_FIX', true);` that can be added to your wp-config.php to fix missing enclosures in feeds when using plugins such as WishList Member. (Thanks Patrick for helping us fix this issue)
177
+ * Fixed bug with download and play in new window text not getting translated for non-english languages. (Thanks infusiastic for bringing to our attention).
178
+
179
  = 1.0.13 =
180
+ * Released on 1/10/2011
181
  * Added additional support for the 'Podcasting' plugin's [podcast] shortcode. PowerPress will still add its player to the top/bottom of the page for backwards compatibility.
182
  * Eliminated 2 other situations where warning messages would appear in some cases.
183
  * Added Simplified Chinese translation to PowerPress. Thanks webmote for translating!