Ticket #1083: reworked_player_preview.4.patch
| File reworked_player_preview.4.patch, 68.3 KB (added by ntm, 3 years ago) |
|---|
-
podpress.css
79 79 clear:left; 80 80 } 81 81 82 .podPress_videoplayer_wrapper:hover { 83 cursor:pointer; 84 } 85 82 86 /* Navi 83 87 ************************************************/ 84 88 -
podpress.js
33 33 refPlayerDiv.innerHTML = podPressGenerateVideoPreview (strPlayerDiv, strMediaFile, numWidth, numHeight, strPreviewImg); 34 34 } 35 35 36 function podPressGenerateVideoPreview (strPlayerDiv, strMediaFile, numWidth, numHeight, strPreviewImg, bPreviewOnly, forEditor) { 37 if (typeof numWidth == 'undefined') { 38 numWidth = 320; 39 } 40 if (typeof numHeight == 'undefined') { 41 numHeight = 240; 42 } 43 if (typeof strPreviewImg == 'undefined') { 44 strPreviewImg = podPressDefaultPreviewImage; 45 } 46 if (typeof bPreviewOnly == 'undefined') { 47 bPreviewOnly = false; 48 } 36 function podPressGenerateVideoPreview (strPlayerDiv, strMediaFile, numWidth, numHeight, strPreviewImg, bPreviewOnly) { 37 if (typeof numWidth == 'undefined') { numWidth = 320; } 38 if (typeof numHeight == 'undefined') { numHeight = 240; } 39 if (typeof strPreviewImg == 'undefined') { strPreviewImg = podPressDefaultPreviewImage; } 40 if (typeof bPreviewOnly == 'undefined') { bPreviewOnly = false; } 49 41 50 if(numHeight < 80) { 51 strPreviewImg = podPressBackendURL+'images/vpreview_center_text.png'; 52 } 42 if (false == bPreviewOnly) { 43 var strOnclick= ' onclick="javascript:podPressShowHidePlayer('+strPlayerDiv+', \''+strMediaFile+'\', '+numWidth+', '+numHeight+', \'force\'); return false;"'; 44 } else { 45 var strOnclick= ''; // for a preview of this preview player at the player settings page on the admin pages 46 } 53 47 54 var strTopBgWidth = numWidth-14;55 var strBottomBgWidth = numWidth - 126;56 var strTableWidth = numWidth+14;57 var strDimensions = numWidth+':'+numHeight;58 59 48 var strResult = ''; 60 // This "if"-condition is only a kind of a quick fix. The Box-Model layout will be used for the blog pages and the old table based layout for the editor pages. 61 // This should be cleaned up in future versions. 62 if (true != forEditor) { 63 strResult += '<div class="podPress_videoplayer_wrapper" style="width: '+strTableWidth+'px; padding:0px; margin:0px; display:block; background-color:#ff0000;">'; 64 strResult += ' <div class="podPress_videoplayer_toprow" style="width:100%; padding:0px; margin:0px;">'; 65 strResult += ' <img src="'+podPressBackendURL+'images/vpreview_top_left.png" style="width:7px; height:27px; float:left; padding:0px; margin:0px;" alt="."/>'; 66 strResult += ' <span style="height:27px; border:0px; display:block; float:left; padding:0px; margin:0px; width: '+numWidth+'px; text-align:center; background:url(\''+podPressBackendURL+'images/vpreview_top_background.png\'); background-repeat: repeat-x;"><img src="'+podPressBackendURL+'images/vpreview_top_middle.png" style="width:119px; height:27px padding:0px; margin:0px; border:0px;" alt="." /></span>'; 67 strResult += ' <img src="'+podPressBackendURL+'images/vpreview_top_right.png" style="width:7px; height:27px; float:left; padding:0px; margin:0px;" alt="." />'; 68 strResult += ' </div>'; 69 70 strResult += ' <div class="podPress_videoplayer_middlerow" style="width:100%; padding:0px; margin:0px; background-color:#ffff00;">'; 71 strResult += ' <span style="width:7px; height:'+numHeight+'px; padding:0px; margin:0px; display:block; float:left; background:url(\''+podPressBackendURL+'images/vpreview_left_background.png\'); background-repeat:repeat-y;"></span>'; 72 strResult += ' <img class="#podPress_previewImage" src="'+strPreviewImg+'" style="width:'+numWidth+'px; height:'+numHeight+'px; padding:0px; margin:0px; border:0px; float:left;" alt="previewImg" id="podPress_previewImageIMG_'+strPlayerDiv+'"'; 73 if(!bPreviewOnly) { 74 strResult += ' onclick="javascript:podPressShowHidePlayer('+strPlayerDiv+', \''+strMediaFile+'\', '+numWidth+', '+numHeight+', \'force\'); return false;"'; 75 } 76 strResult += ' />'; 77 strResult += ' <span style="width:7px; height:'+numHeight+'px; padding:0px; margin:0px; display:block; float:left; background:url(\''+podPressBackendURL+'images/vpreview_right_background.png\'); background-repeat:repeat-y;"></span>'; 78 strResult += ' </div>'; 79 80 strResult += ' <div class="podPress_videoplayer_bottomrow" style="width:100%; padding:0px; margin:0px; background-color:#ff00ff;">'; 81 strResult += ' <img src="'+podPressBackendURL+'images/vpreview_bottom_left.png" style="width:7px; height:23px; float:left; padding:0px; margin:0px;" alt="." />'; 82 strResult += ' <span style="display:block; float:left; padding:0px; margin:0px; text-align: left; background:url(\''+podPressBackendURL+'images/vpreview_bottom_background.png\'); background-repeat: repeat-x;"><img src="'+podPressBackendURL+'images/vpreview_bottom_middle_left.png" style="width:56px; height:23px" alt="." /></span>'; 83 strResult += ' <span style="height:23px; display:block; float:left; padding:0px; margin:0px; width:'+String(Math.abs(numWidth-112))+'px; background:url(\''+podPressBackendURL+'images/vpreview_bottom_background.png\'); background-repeat: repeat-x;"></span>'; 84 strResult += ' <span style="display:block; float:left; padding:0px; margin:0px; text-align:right; background:url(\''+podPressBackendURL+'images/vpreview_bottom_background.png\'); background-repeat: repeat-x;"><img src="'+podPressBackendURL+'images/vpreview_bottom_middle_right.png" style="width:56px; height:23px" alt="." /></span>'; 85 strResult += ' <img src="'+podPressBackendURL+'images/vpreview_bottom_right.png" style="width:7px; height:23px; float:left; padding:0px; margin:0px;" alt="." />'; 86 strResult += ' </div>'; 87 strResult += '</div>'; 88 } else { 89 strResult += '<table class="podPress_previewImage" style="width: '+strTableWidth+'px;" cellpadding="0" cellspacing="0">'; 90 strResult += '<tr class="podPress_previewImage">'; 91 strResult += '<td class="podPress_previewImage" style="height: 27px; width: 7px; text-align: left;"><img class="podPress_previewImage" width="7" height="27" src="'+podPressBackendURL+'images/vpreview_top_left.png" border="0" alt="."/></td>'; 92 strResult += '<td class="podPress_previewImage" colspan="3" style="height: 27px; width: '+strTopBgWidth+'px; text-align: center; background: url(\''+podPressBackendURL+'images/vpreview_top_background.png\'); background-repeat: repeat-x;"><img width="119" height="27" class="podPress_previewImage" src="'+podPressBackendURL+'images/vpreview_top_middle.png" border="0" alt="."/></td>'; 93 strResult += '<td class="podPress_previewImage" style="height: 27px; width: 7px; text-align: right;"><img class="podPress_previewImage" width="7" height="27" src="'+podPressBackendURL+'images/vpreview_top_right.png" border="0" alt="."/></td>'; 94 strResult += '</tr>'; 95 strResult += '<tr class="podPress_previewImage">'; 96 strResult += '<td class="podPress_previewImage" style="width: 7px; background: url(\''+podPressBackendURL+'images/vpreview_left_background.png\'); background-repeat: repeat-y;"> </td>'; 97 strResult += '<td class="podPress_previewImage" colspan="3" style="width: '+numWidth+'px;">'; 98 strResult += '<img class="#podPress_previewImage" src="'+strPreviewImg+'" border="0" width="'+numWidth+'" height="'+numHeight+'" alt="previewImg" id="podPress_previewImageIMG_'+strPlayerDiv+'"'; 99 if(!bPreviewOnly) { 100 strResult += ' onclick="javascript: podPressShowHidePlayer('+strPlayerDiv+', \''+strMediaFile+'\', '+numWidth+', '+numHeight+', \'force\'); return false;"'; 101 } 102 strResult += '/>'; 103 strResult += '</td>'; 104 strResult += '<td class="podPress_previewImage" style="width: 7px; background: url(\''+podPressBackendURL+'images/vpreview_right_background.png\'); background-repeat: repeat-y;"> </td>'; 105 strResult += '</tr>'; 106 strResult += '<tr class="podPress_previewImage">'; 107 strResult += '<td class="podPress_previewImage" style="height: 23px; width: 7px;"><img class="podPress_previewImage" width="7" height="23" src="'+podPressBackendURL+'images/vpreview_bottom_left.png" border="0" alt="."/></td>'; 108 strResult += '<td class="podPress_previewImage" style="height: 23px; text-align: left; background: url(\''+podPressBackendURL+'images/vpreview_bottom_background.png\'); background-repeat: repeat-x;"><img class="podPress_previewImage" width="56" height="23" src="'+podPressBackendURL+'images/vpreview_bottom_middle_left.png" border="0" alt="."/></td>'; 109 strResult += '<td class="podPress_previewImage" style="height: 23px; width: '+strBottomBgWidth+'px; background: url(\''+podPressBackendURL+'images/vpreview_bottom_background.png\'); background-repeat: repeat-x;"> </td>'; 110 strResult += '<td class="podPress_previewImage" style="height: 23px; text-align: right; background: url(\''+podPressBackendURL+'images/vpreview_bottom_background.png\'); background-repeat: repeat-x;"><img class="podPress_previewImage" width="56" height="23" src="'+podPressBackendURL+'images/vpreview_bottom_middle_right.png" border="0" alt="."/></td>'; 111 strResult += '<td class="podPress_previewImage" style="height: 23px; width: 7px;"><img class="podPress_previewImage" width="7" height="23" src="'+podPressBackendURL+'images/vpreview_bottom_right.png" border="0" alt="."/></td>'; 112 strResult += '</tr>'; 113 strResult += '</table>'; 49 strResult += '<div class="podPress_videoplayer_wrapper" style="width: '+String(Number(numWidth)+14)+'px; padding:0px; margin:0px; display:block; background-color:#ff0000;"'+strOnclick+'>'; 50 strResult += ' <div class="podPress_videoplayer_toprow" style="width:100%; padding:0px; margin:0px;">'; 51 strResult += ' <img src="'+podPressBackendURL+'images/vpreview_top_left.png" style="width:7px; height:27px; float:left; padding:0px; margin:0px;" alt="."/>'; 52 strResult += ' <span style="height:27px; border:0px; display:block; float:left; padding:0px; margin:0px; width: '+numWidth+'px; text-align:center; background:url(\''+podPressBackendURL+'images/vpreview_top_background.png\'); background-repeat: repeat-x;"><img src="'+podPressBackendURL+'images/vpreview_top_middle.png" style="width:119px; height:27px padding:0px; margin:0px; border:0px;" alt="." /></span>'; 53 strResult += ' <img src="'+podPressBackendURL+'images/vpreview_top_right.png" style="width:7px; height:27px; float:left; padding:0px; margin:0px;" alt="." />'; 54 strResult += ' </div>'; 55 56 if (25 < Number(numHeight)) { // if the height value is smaller than 25 px then create a player preview without an cover or chapter image 57 strResult += ' <div class="podPress_videoplayer_middlerow" style="width:100%; padding:0px; margin:0px;">'; 58 strResult += ' <span style="width:7px; height:'+numHeight+'px; padding:0px; margin:0px; display:block; float:left; background:url(\''+podPressBackendURL+'images/vpreview_left_background.png\'); background-repeat:repeat-y;"></span>'; 59 strResult += ' <img class="podPress_previewImage" src="'+strPreviewImg+'" style="width:'+numWidth+'px; height:'+numHeight+'px; padding:0px; margin:0px; border:0px; float:left;" alt="previewImg" id="podPress_previewImageIMG_'+strPlayerDiv+'" />'; 60 strResult += ' <span style="width:7px; height:'+numHeight+'px; padding:0px; margin:0px; display:block; float:left; background:url(\''+podPressBackendURL+'images/vpreview_right_background.png\'); background-repeat:repeat-y;"></span>'; 61 strResult += ' </div>'; 114 62 } 63 64 strResult += ' <div class="podPress_videoplayer_bottomrow" style="width:100%; padding:0px; margin:0px;">'; 65 strResult += ' <img src="'+podPressBackendURL+'images/vpreview_bottom_left.png" style="width:7px; height:23px; float:left; padding:0px; margin:0px;" alt="." />'; 66 strResult += ' <span style="display:block; float:left; padding:0px; margin:0px; text-align: left; background:url(\''+podPressBackendURL+'images/vpreview_bottom_background.png\'); background-repeat: repeat-x;"><img src="'+podPressBackendURL+'images/vpreview_bottom_middle_left.png" style="width:56px; height:23px" alt="." /></span>'; 67 strResult += ' <span style="height:23px; display:block; float:left; padding:0px; margin:0px; width:'+String(Math.abs(Number(numWidth)-112))+'px; background:url(\''+podPressBackendURL+'images/vpreview_bottom_background.png\'); background-repeat: repeat-x;"></span>'; 68 strResult += ' <span style="display:block; float:left; padding:0px; margin:0px; text-align:right; background:url(\''+podPressBackendURL+'images/vpreview_bottom_background.png\'); background-repeat: repeat-x;"><img src="'+podPressBackendURL+'images/vpreview_bottom_middle_right.png" style="width:56px; height:23px" alt="." /></span>'; 69 strResult += ' <img src="'+podPressBackendURL+'images/vpreview_bottom_right.png" style="width:7px; height:23px; float:left; padding:0px; margin:0px;" alt="." />'; 70 strResult += ' </div>'; 71 strResult += '</div>'; 115 72 return String(strResult); 116 73 } 117 74 118 75 function podPressGeneratePlayer(strPlayerDiv, strMediaFile, numWidth, numHeight, strAutoStart, strPreviewImg) { 119 if (typeof numWidth == 'undefined' || numWidth == '') { 120 numWidth = 320; 121 } 122 if (typeof numHeight == 'undefined' || numHeight == '') { 123 numHeight = 240; 124 } 125 126 if (typeof strAutoStart == 'undefined') { 127 strAutoStart = 'false'; 128 } 76 if (typeof numWidth == 'undefined') { numWidth = 320; } 77 if (typeof numHeight == 'undefined') { numHeight = 240; } 78 if (typeof strAutoStart == 'undefined') { strAutoStart = 'false'; } 79 129 80 if(strAutoStart == 'nopreview') { 130 81 return ''; 131 82 } … … 143 94 var strExt = ''; 144 95 } 145 96 strExt = strExt.toLowerCase(); 146 147 if(strExt != 'mp3' && strExt != 'flv' && strExt != 'y youtube' && strAutoStart == 'false') {97 98 if(strExt != 'mp3' && strExt != 'flv' && strExt != 'youtube' && strAutoStart == 'false') { 148 99 if(strExt == 'youtube') { 149 100 strMediaFile = strMediaFile+'.youtube'; 150 101 } 151 return podPressGenerateVideoPreview (strPlayerDiv, strMediaFile, numWidth, numHeight, strPreviewImg);102 return podPressGenerateVideoPreview(strPlayerDiv, strMediaFile, numWidth, numHeight, strPreviewImg); 152 103 } 104 105 var strResult = ''; 153 106 switch (strExt) { 154 107 case 'm4v': 155 108 case 'm4a': … … 181 134 var strMimeType = 'video/quicktime'; 182 135 break; 183 136 } 184 strResult = '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="'+numWidth+'" height="'+numHeight+'" codebase="http://www.apple.com/qtactivex/qtplugin.cab">'; 137 numHeight = String(Number(numHeight)+ 18); // add up the height of the player controls 138 strResult = '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="'+numWidth+'px" height="'+numHeight+'px" codebase="http://www.apple.com/qtactivex/qtplugin.cab">'; 185 139 strResult += ' <param name="src" value="'+strMediaFile+'" />'; 186 140 strResult += ' <param name="href" value="'+strMediaFile+'" />'; 187 141 strResult += ' <param name="scale" value="aspect" />'; … … 189 143 strResult += ' <param name="autoplay" value="'+strAutoStart+'" />'; 190 144 strResult += ' <param name="bgcolor" value="000000" />'; 191 145 strResult += ' <param name="pluginspage" value="http://www.apple.com/quicktime/download/" />'; 192 strResult += ' <embed src="'+strMediaFile+'" width="'+numWidth+'" height="'+numHeight+'" scale="aspect" cache="true" bgcolor="000000" autoplay="'+strAutoStart+'" controller="true" src="'+strMediaFile+'" type="'+strMimeType+'" pluginspage="http://www.apple.com/quicktime/download/"></embed>';193 strResult += '</object><br/> <br/>';146 strResult += ' <embed src="'+strMediaFile+'" style="width:'+numWidth+'px; height:'+numHeight+'px; background-color:#000;" scale="aspect" cache="true" autoplay="'+strAutoStart+'" controller="true" src="'+strMediaFile+'" type="'+strMimeType+'" pluginspage="http://www.apple.com/quicktime/download/"></embed>'; 147 strResult += '</object><br/>'; 194 148 break; 195 149 case 'wma': 196 150 case 'wmv': 197 151 case 'asf': 198 strResult = '<object id="winplayer" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="'+numWidth+'" height="'+numHeight+'" standby="Media is loading..." type="application/x-oleobject">'; 152 numHeight = String(Number(numHeight)+ 44); // add up the height of the player controls 153 strResult = '<object id="winplayer" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="'+numWidth+'px" height="'+numHeight+'px" standby="Media is loading..." type="application/x-oleobject">'; 199 154 strResult += ' <param name="url" value="'+strMediaFile+'" />'; 200 155 strResult += ' <param name="AutoStart" value="'+strAutoStart+'" />'; 201 156 strResult += ' <param name="AutoSize" value="true" />'; … … 207 162 strResult += ' <param name="ShowCaptioning" value="false" />'; 208 163 strResult += ' <param name="ShowDisplay" value="false" />'; 209 164 strResult += ' <param name="ShowStatusBar" value="false" />'; 210 strResult += ' <embed type="application/x-mplayer2" src="'+strMediaFile+'" width="'+numWidth+'" height="'+numHeight+'" scale="aspect" AutoStart="'+strAutoStart+'" ShowDisplay="0" ShowStatusBar="0" AutoSize="1" AnimationAtStart="1" AllowChangeDisplaySize="1" ShowControls="1"></embed>';211 strResult += '</object><br/> <br/>';165 strResult += ' <embed type="application/x-mplayer2" src="'+strMediaFile+'" style="width:'+numWidth+'px; height:'+numHeight+'px; background-color:#000;" scale="aspect" AutoStart="'+strAutoStart+'" ShowDisplay="0" ShowStatusBar="0" AutoSize="1" AnimationAtStart="1" AllowChangeDisplaySize="1" ShowControls="1"></embed>'; 166 strResult += '</object><br/>'; 212 167 break; 213 168 case 'swf': 214 169 if(strAutoStart == 'true') { … … 235 190 strResult = '<object type="application/x-shockwave-flash" width="'+numWidth+'" height="'+numHeight+'" wmode="transparent" data="'+podPressBackendURL+'players/flvplayer.swf?file='+encodeURI(strMediaFile)+strAutoStart+'">'; 236 191 strResult += ' <param name="movie" value="'+podPressBackendURL+'players/flvplayer.swf?file='+encodeURI(strMediaFile)+strAutoStart+'" />'; 237 192 strResult += ' <param name="wmode" value="transparent" />'; 238 strResult += '</object><br/> <br/>';193 strResult += '</object><br/>'; 239 194 break; 240 195 case '.rm': 241 196 strResult = '<object id="realplayer" classid="clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa" width="'+numWidth+'" height="'+numHeight+'">'; … … 243 198 strResult += ' <param name="autostart" value="'+strAutoStart+'" />'; 244 199 strResult += ' <param name="controls" value="imagewindow,controlpanel" />'; 245 200 strResult += ' <embed src="'+strMediaFile+'" width="'+numWidth+'" height="'+numHeight+'" autostart="'+strAutoStart+'" controls="imagewindow,controlpanel" type="audio/x-pn-realaudio-plugin"></embed>'; 246 strResult += '</object><br/> <br/>';201 strResult += '</object><br/>'; 247 202 break; 248 203 case 'ogg': 249 204 if(strAutoStart == 'true') { … … 262 217 strResult += ' <param name="jorbis.player.playonstartup" VALUE="'+strAutoStart+'" />'; 263 218 strResult += ' <param name="type" VALUE="application/x-java-applet;version=1.3" />'; 264 219 strResult += ' <comment><embed type="application/x-java-applet;version=1.3" width="'+numWidth+'" height="'+numHeight+'" java_codebase="'+podPressBackendURL+'players/" java_code="JOrbisPlayer.class" archive="JOrbisPlayer.jar,jogg.jar,jorbis.jar" jorbis.player.play.0="'+strMediaFile+'" jorbis.player.icestats="no" jorbis.player.playonstartup="'+strAutoStart+'" pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"></embed></comment>'; 265 strResult += '</object><br/> <br/>';220 strResult += '</object><br/>'; 266 221 break; 267 222 case 'youtube': 268 223 if(strAutoStart == 'true') { … … 274 229 strResult += ' <param name="movie" value="http://www.youtube.com/v/'+strMediaFile+'&rel=1&autoplay=1" />'; 275 230 strResult += ' <param name="wmode" value="transparent" />'; 276 231 strResult += ' <embed src="http://www.youtube.com/v/'+strMediaFile+'&rel=1&autoplay=1" type="application/x-shockwave-flash" wmode="transparent" width="'+numWidth+'" height="'+numHeight+'"></embed>'; 277 strResult += '</object><br/> <br/>';232 strResult += '</object><br/>'; 278 233 break; 279 234 case 'mp3': 280 235 default: … … 306 261 function podPressShowHidePlayer(strPlayerDiv, strMediaFile, numWidth, numHeight, strAutoStart, strPreviewImg) { 307 262 var refPlayerDiv = document.getElementById('podPressPlayerSpace_'+strPlayerDiv); 308 263 var refPlayerDivLink = document.getElementById('podPressPlayerSpace_'+strPlayerDiv+'_PlayLink'); 309 264 310 265 if(refPlayerDiv == undefined) { 311 266 return false; 312 267 } … … 341 296 return true; 342 297 } 343 298 } 344 299 345 300 if(strAutoStart == 'nopreview') { 346 301 refPlayerDivLink.innerHTML=podPressText_PlayNow; 347 302 refPlayerDiv.style.display='none'; … … 358 313 refPlayerDiv.innerHTML=podPressGeneratePlayer(strPlayerDiv, strMediaFile, numWidth, numHeight, strAutoStart, strPreviewImg); 359 314 } 360 315 361 function podPressPopupPlayer(strPlayerDiv, strMediaFile, numWidth, numHeight ) {316 function podPressPopupPlayer(strPlayerDiv, strMediaFile, numWidth, numHeight, windowName) { 362 317 var refPlayerDiv = document.getElementById('podPressPlayerSpace_'+strPlayerDiv); 363 318 var refPlayerDivLink = document.getElementById('podPressPlayerSpace_'+strPlayerDiv+'_PlayLink'); 364 319 … … 374 329 } 375 330 refPlayerDivLink.parentNode.onclick = function(){ podPressShowHidePlayer(strPlayerDiv, strMediaFile, numWidth, numHeight, 'force'); return false; }; 376 331 } 377 332 333 if (typeof windowName == 'undefined') { windowName = 'podPress'; } 334 378 335 var strResult = '<HTML>\n'; 379 336 strResult += '<HEAD>\n'; 380 strResult += '<TITLE> podPressPopup Player</TITLE>\n';337 strResult += '<TITLE>'+windowName+' - Popup Player</TITLE>\n'; 381 338 strResult += '</HEAD>\n'; 382 339 strResult += '<BODY>\n'; 340 strResult += '<div style="margin:auto;">\n'; 383 341 strResult += podPressGeneratePlayer(1, strMediaFile, numWidth, numHeight, 'true'); 342 strResult += '</div>\n'; 384 343 strResult += '</BODY>\n'; 385 344 strResult += '</HTML>'; 386 345 387 if (typeof numWidth == 'undefined' || numWidth == '') { 388 numWidth = 320; 389 } 390 if (typeof numHeight == 'undefined' || numHeight == '') { 391 numHeight = 240; 392 } 346 if (typeof numWidth == 'undefined') { numWidth = 320; } 347 if (typeof numHeight == 'undefined') { numHeight = 240; } 393 348 394 349 if(podPressMP3PlayerWrapper) { 395 numWidth = numWidth+ 50;350 var windowWidth = Number(numWidth) + 50; 396 351 } else { 397 numWidth = numWidth + 10;352 var windowWidth = Number(numWidth) + 20; 398 353 } 399 354 400 numHeight = numHeight + 50; 401 402 newwindow=window.open('', 'podPressPlayer', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width='+numWidth+',height='+numHeight); 355 var windowHeight = Number(numHeight) + 50; 356 newwindow=window.open('', windowName+' - Popup Player', 'toolbar=0,scrollbars=0,location=no,statusbar=0,menubar=0,resizable=1,width='+windowWidth+',height='+windowHeight); 403 357 newdocument=newwindow.document; 404 358 newdocument.write(strResult); 405 359 newdocument.close(); 360 newwindow.focus(); 406 361 } 407 362 408 363 function podPressGetBaseName(file) { -
podpress_admin.js
186 186 } 187 187 188 188 function podPressUpdateDimensions(VarNum, val) { 189 var valArray = val.split(':'); 189 // this function updates the player preview on the editor pages 190 var valArray = String(val).split(':'); 191 if (2 != valArray.length) { 192 valArray[0] = 320; 193 valArray[1] = 240; 194 } else { 195 var dim_x = Number(valArray[0].replace(/\D+/g, '')); 196 var dim_y = Number(valArray[1].replace(/\D+/g, '')); 197 if ('NaN' == dim_x || 120 > dim_x) { 198 valArray[0]=120; 199 } 200 if (1650 < dim_x) { 201 valArray[0]=1650; 202 } 203 if ('NaN' == dim_y || 25 >= dim_y) { 204 valArray[1]=0; 205 } 206 if (1050 < dim_y) { 207 valArray[1]=1050; 208 } 209 } 210 document.getElementById('podPressMedia_'+VarNum+'_dimensionW').value = valArray[0]; 211 document.getElementById('podPressMedia_'+VarNum+'_dimensionH').value = valArray[1]; 190 212 podPressMediaFiles[VarNum]['dimensionW'] = valArray[0]; 191 document.getElementById('podPressMedia_'+VarNum+'_dimensionW').value = valArray[0];192 213 podPressMediaFiles[VarNum]['dimensionH'] = valArray[1]; 193 document.getElementById('podPress Media_'+VarNum+'_dimensionH').value = valArray[1];214 document.getElementById('podPressPlayerSpace_'+String(VarNum)).innerHTML = podPressGenerateVideoPreview(VarNum, '', valArray[0], valArray[1], document.getElementById('podPressMedia_'+String(VarNum)+'_previewImage').value, true); 194 215 podPressShowPreviewImage(VarNum); 195 216 } 196 217 218 function podPressUpdateDimensionList(VarNum) { 219 // this function updates the player preview on the editor pages and tries to select the value W:H value in the selectbox with the predefined formats 220 var dimensionsStr = String(document.getElementById('podPressMedia_'+VarNum+'_dimensionW').value)+':'+String(document.getElementById('podPressMedia_'+VarNum+'_dimensionH').value); 221 podPressUpdateDimensions(VarNum, dimensionsStr); 222 var is_in = podPress_isset_in_the_list(dimensionsStr, 'podPressMedia_'+VarNum+'_dimensionList'); 223 if ( true == is_in[0] ) { 224 document.getElementById('podPressMedia_'+VarNum+'_dimensionList').selectedIndex = is_in[1]; 225 } 226 } 227 197 228 function podPress_set_blognamePreview(val) { 198 229 document.getElementById('iTunesBlognamePreview').innerHTML = val; 199 230 document.getElementById('PCABlognamePreview').innerHTML = val; … … 444 475 } 445 476 } 446 477 var newMediaFileData = new Array(); 447 newMediaFileData['showme'] = showme;448 newMediaFileData['URI'] = txtURI;449 newMediaFileData['URI_torrent'] = txtURI_torrent;450 newMediaFileData['title'] = txttitle;478 newMediaFileData['showme'] = showme; 479 newMediaFileData['URI'] = txtURI; 480 newMediaFileData['URI_torrent'] = txtURI_torrent; 481 newMediaFileData['title'] = txttitle; 451 482 newMediaFileData['type'] = txttype; 452 483 newMediaFileData['size'] = txtsize; 453 484 newMediaFileData['duration'] = duration; … … 547 578 } 548 579 549 580 var typeOfMedia = data['type'].substring(0,6); 550 if (typeOfMedia != 'video_'){581 if (typeOfMedia != 'video_' && data['type'] != 'audio_m4a' && data['type'] != 'audio_mp4' && data['type'] != 'audio_wma') { 551 582 document.getElementById('podPressMediaPreviewImageWrapper_'+VarNum).style.display = 'none'; 552 583 document.getElementById('podPressMediaPreviewImageDisplayWrapper_'+VarNum).style.display = 'none'; 553 document.getElementById('podPress_previewImageIMG_'+VarNum).src = '';554 document.getElementById('podPress_previewImageIMG_'+VarNum).width = '0';555 document.getElementById('podPress_previewImageIMG_'+VarNum).height = '0';556 584 } else { 557 585 if(data['previewImage'] == '') { 558 586 document.getElementById('podPressMediaPreviewImageWrapper_'+VarNum).style.display = ''; 559 document.getElementById('podPressMediaPreviewImageDisplayWrapper_'+VarNum).style.display = 'none'; 560 document.getElementById('podPress_previewImageIMG_'+VarNum).src = ''; 561 document.getElementById('podPress_previewImageIMG_'+VarNum).width = '0'; 562 document.getElementById('podPress_previewImageIMG_'+VarNum).height = '0'; 587 data['previewImage'] = document.getElementById('podPressMedia_defaultpreviewImage').value; 588 //~ document.getElementById('podPressMediaPreviewImageDisplayWrapper_'+VarNum).style.display = 'none'; 563 589 } else { 564 590 document.getElementById('podPressMediaPreviewImageWrapper_'+VarNum).style.display = ''; 565 591 document.getElementById('podPressMediaPreviewImageDisplayWrapper_'+VarNum).style.display = ''; 566 document.getElementById('podPress_previewImageIMG_'+VarNum).src = data['previewImage'];567 document.getElementById('podPress_previewImageIMG_'+VarNum).width = data['dimensionW'];568 document.getElementById('podPress_previewImageIMG_'+VarNum).height = data['dimensionH'];569 592 } 570 593 } 571 594 } 572 595 596 function podPressPreviewImageOnChange(VarNum, imageUrl) { 597 imageUrl = imageUrl.replace(/<\S[^><]*>/g, ''); 598 var ltrim = /\s+$/; // one blank or blanks at the begin of the string 599 var rtrim = /^\s+/; // one blank or blanks at the end of the string 600 imageUrl = imageUrl.replace(ltrim, ''); 601 imageUrl = imageUrl.replace(rtrim, ''); 602 var data = new Array(); 603 if (podPressMediaFiles[VarNum] == undefined) { 604 data = newMediaDefaults; 605 } else { 606 data = podPressMediaFiles[VarNum]; 607 } 608 data['previewImage'] = imageUrl; 609 try { 610 document.getElementById('podPress_previewImageIMG_'+VarNum).src = imageUrl; 611 } catch (e) { 612 //alert('preview player without preview image'); 613 } 614 } 615 573 616 function podPressMediaSetNonTextInputs(VarNum) { 574 617 var data = new Array(); 575 618 if(podPressMediaFiles[VarNum] == undefined) { … … 616 659 } 617 660 } 618 661 662 function podPress_isset_in_the_list(value, list_id) { 663 var list = document.getElementById( list_id ); 664 var listlen = list.length; 665 var is_in = false; 666 var index = 0; 667 for (var i = 0; i < listlen; i++ ) { 668 if ( value == list.options[i].value ) { 669 is_in = true; 670 index=i; 671 } 672 } 673 return Array(is_in, index); 674 } 675 619 676 function podPressAdjustMediaFieldsBasedOnType(VarNum) { 620 677 var data = new Array(); 621 678 if(podPressMediaFiles[VarNum] == undefined) { … … 624 681 data = podPressMediaFiles[VarNum]; 625 682 } 626 683 var typeOfMedia = data['type'].substring(0,6); 627 if(typeOfMedia == 'audio_' || typeOfMedia == 'video_') {684 if(typeOfMedia == 'audio_' || typeOfMedia == 'video_') { 628 685 document.getElementById('podPressMediaDurationWrapper_'+VarNum).style.display=''; 629 } else {686 } else { 630 687 document.getElementById('podPressMediaDurationWrapper_'+VarNum).style.display='none'; 631 }688 } 632 689 633 if(typeOfMedia == 'video_'){690 if (typeOfMedia == 'video_' || data['type'] == 'audio_m4a' || data['type'] == 'audio_mp4' || data['type'] == 'audio_wma') { 634 691 document.getElementById('podPressMediaPreviewImageWrapper_'+VarNum).style.display=''; 635 692 document.getElementById('podPressMediaDimensionWrapper_'+VarNum).style.display=''; 636 podPressShowPreviewImage(VarNum); 637 } else if(typeOfMedia == 'embed_') { 693 //alert('(1a)\n'+typeOfMedia+'\n'+'W: '+String(data['dimensionW'])+'\t'+ String(typeof data['dimensionW']) + '\n'+'H: '+String(data['dimensionH'])+'\t'+ String(typeof data['dimensionH'])+'\n'); 694 if ('video_' == typeOfMedia) { 695 if ( 0 >= Number(data['dimensionW']) || 0 >= Number(data['dimensionH'])) {// this means: if nothing is saved then set the default values 696 data['dimensionW'] = 320; 697 data['dimensionH'] = 240; 698 } 699 } else { 700 if ( 0 >= Number(data['dimensionW']) || 0 > Number(data['dimensionH'])) { 701 data['dimensionW'] = 320; 702 data['dimensionH'] = 0; 703 } 704 } 705 //alert('(1.1a)\n'+typeOfMedia+'\n'+'W: '+String(data['dimensionW'])+'\t'+ String(typeof data['dimensionW']) + '\n'+'H: '+String(data['dimensionH'])+'\t'+ String(typeof data['dimensionH'])+'\n'); 706 document.getElementById('podPressMedia_'+VarNum+'_dimensionW').value = data['dimensionW']; 707 document.getElementById('podPressMedia_'+VarNum+'_dimensionH').value = data['dimensionH']; 708 var dimensionsStr = String(document.getElementById('podPressMedia_'+VarNum+'_dimensionW').value)+':'+String(document.getElementById('podPressMedia_'+VarNum+'_dimensionH').value); 709 var is_in = podPress_isset_in_the_list(dimensionsStr, 'podPressMedia_'+VarNum+'_dimensionList'); 710 if ( true == is_in[0] ) { 711 document.getElementById('podPressMedia_'+VarNum+'_dimensionList').selectedIndex = is_in[1]; 712 } 713 //alert('(1b)\n'+typeOfMedia+'\n'+'W: '+String(document.getElementById('podPressMedia_'+VarNum+'_dimensionW').value) + '\n'+'H: '+String(document.getElementById('podPressMedia_'+VarNum+'_dimensionH').value)+'\ndata_W: '+String(data['dimensionW'])+'\ndata_H: '+String(data['dimensionH'])); 714 podPressPreviewImageOnChange(VarNum, document.getElementById('podPressMedia_'+VarNum+'_previewImage').value); 715 podPressUpdateDimensions(VarNum, dimensionsStr); 716 } else if(typeOfMedia == 'embed_') { 638 717 document.getElementById('podPressMediaPreviewImageWrapper_'+VarNum).style.display=''; 639 718 document.getElementById('podPressMediaPreviewImageDisplayWrapper_'+VarNum).style.display=''; 640 719 document.getElementById('podPressMediaDimensionWrapper_'+VarNum).style.display='none'; 641 720 document.getElementById('podPressMediaDurationWrapper_'+VarNum).style.display='none'; 642 document.getElementById('podPressMediaSizeWrapper_'+VarNum).style.display='none'; 643 podPressShowPreviewImage(VarNum); 721 document.getElementById('podPressMediaSizeWrapper_'+VarNum).style.display='none'; 722 if ( 0 >= Number(data['dimensionW']) || 0 >= Number(data['dimensionH'])) { // this means: if nothing is saved then set the default values 723 data['dimensionW'] = 320; 724 data['dimensionH'] = 240; 725 } 726 document.getElementById('podPressMedia_'+VarNum+'_dimensionW').value = data['dimensionW']; 727 document.getElementById('podPressMedia_'+VarNum+'_dimensionH').value = data['dimensionH']; 728 podPressPreviewImageOnChange(VarNum, document.getElementById('podPressMedia_'+VarNum+'_previewImage').value); 729 podPressUpdateDimensions(VarNum, String(document.getElementById('podPressMedia_'+VarNum+'_dimensionW').value)+':'+String(document.getElementById('podPressMedia_'+VarNum+'_dimensionH').value)); 644 730 } else { 645 731 document.getElementById('podPressMediaPreviewImageWrapper_'+VarNum).style.display='none'; 646 732 document.getElementById('podPressMediaPreviewImageDisplayWrapper_'+VarNum).style.display='none'; 647 document.getElementById('podPressMediaDimensionWrapper_'+VarNum).style.display='none'; 648 } 733 document.getElementById('podPressMediaDimensionWrapper_'+VarNum).style.display='none'; 734 data['dimensionW'] = 0; 735 data['dimensionH'] = 0; 736 document.getElementById('podPressMedia_'+VarNum+'_dimensionW').value = data['dimensionW']; 737 document.getElementById('podPressMedia_'+VarNum+'_dimensionH').value = data['dimensionH']; 738 } 649 739 } 650 740 651 741 function podPressDetectType(VarNum) { … … 684 774 case 'mpg': result = 'video_mpg'; break 685 775 case 'peg': result = 'video_mpg'; break 686 776 case 'asf': result = 'video_asf'; break 777 case 'wma': result = 'audio_wma'; break 687 778 case 'wmv': result = 'video_wmv'; break 688 779 case 'flv': result = 'video_flv'; break 689 780 case 'swf': result = 'video_swf'; break -
podpress_admin_class.php
178 178 } 179 179 echo '</script>'."\n"; 180 180 181 echo '<input type="hidden" id="podPressMedia_defaultpreviewImage" value="'.PODPRESS_URL.'/images/vpreview_center.png" />'."\n"; 182 181 183 echo '<div id="podPressstuff" class="dbx-group">'."\n"; 182 184 echo ' <fieldset id="podpresscontent" class="dbx-box">'."\n"; 183 185 echo ' <h3 class="dbx-handle">'.__('Podcasting', 'podpress').'</h3> '."\n"; … … 323 325 echo ' <label for="podPressMedia_'.$num.'_previewImage">'.__('Preview Image URL', 'podpress').'</label>: '."\n"; 324 326 echo ' </td>'."\n"; 325 327 echo ' <td>'."\n"; 326 echo ' <input type="text" id="podPressMedia_'.$num.'_previewImage" name="podPressMedia['.$num.'][previewImage]" size="40" value="'.$thisMedia['previewImage'].'" onchange="javascript: podPress MediaFiles['.$num.'][\'previewImage\'] = this.value; podPressShowPreviewImage('.$num.');" />'."\n";328 echo ' <input type="text" id="podPressMedia_'.$num.'_previewImage" name="podPressMedia['.$num.'][previewImage]" size="40" value="'.$thisMedia['previewImage'].'" onchange="javascript: podPressPreviewImageOnChange('.$num.', this.value);" />'."\n"; 327 329 echo ' </td>'."\n"; 328 330 echo ' </tr>'."\n"; 329 331 echo ' <tr id="podPressMediaPreviewImageDisplayWrapper_'.$num.'" style="display: none;">'."\n"; … … 333 335 echo ' <td>'."\n"; 334 336 echo ' <div id="podPressPlayerSpace_'.$num.'"></div>'."\n"; 335 337 echo '<script type="text/javascript"><!--'."\n"; 336 echo " document.getElementById('podPressPlayerSpace_".$num."').innerHTML = podPressGenerateVideoPreview (".$num.", '', '', '', document.getElementById('podPressMedia_".$num."_previewImage').value, true);\n";338 echo " document.getElementById('podPressPlayerSpace_".$num."').innerHTML = podPressGenerateVideoPreview (".$num.", '', ".$thisMedia['dimensionW'].", ".$thisMedia['dimensionH'].", document.getElementById('podPressMedia_".$num."_previewImage').value, true);\n"; 337 339 echo "--></script>\n"; 338 340 echo ' </td>'."\n"; 339 341 echo ' </tr>'."\n"; … … 343 345 echo ' '.__('Dimensions', 'podpress').' (WxH): '."\n"; 344 346 echo ' </td>'."\n"; 345 347 echo ' <td>'."\n"; 346 echo ' <input type="text" id="podPressMedia_'.$num.'_dimensionW" name="podPressMedia['.$num.'][dimensionW]" size="5" value="'.$thisMedia['dimensionW'].'" onchange="javascript: podPressMediaFiles['.$num.'][\'dimensionW\'] = this.value; " />x<input type="text" id="podPressMedia_'.$num.'_dimensionH" name="podPressMedia['.$num.'][dimensionH]" size="5" value="'.$thisMedia['dimensionH'].'" onchange="javascript: podPressMediaFiles['.$num.'][\'dimensionH\'] = this.value;" /> '."\n";347 echo ' <select onchange="javascript: podPressUpdateDimensions(\''.$num.'\', this.value);">'."\n"; podPress_videoDimensionOptions($thisMedia['dimensionW'].':'.$thisMedia['dimensionH']); echo '</select>'."\n";348 echo ' <input type="text" id="podPressMedia_'.$num.'_dimensionW" name="podPressMedia['.$num.'][dimensionW]" size="5" value="'.$thisMedia['dimensionW'].'" onchange="javascript: podPressMediaFiles['.$num.'][\'dimensionW\'] = this.value; podPressUpdateDimensionList(\''.$num.'\');" />x<input type="text" id="podPressMedia_'.$num.'_dimensionH" name="podPressMedia['.$num.'][dimensionH]" size="5" value="'.$thisMedia['dimensionH'].'" onchange="javascript: podPressMediaFiles['.$num.'][\'dimensionH\'] = this.value; podPressUpdateDimensionList(\''.$num.'\')" /> '."\n"; 349 echo ' <select id="podPressMedia_'.$num.'_dimensionList" onchange="javascript: podPressUpdateDimensions(\''.$num.'\', this.value);">'."\n"; podPress_videoDimensionOptions($thisMedia['dimensionW'].':'.$thisMedia['dimensionH']); echo '</select>'."\n"; 348 350 echo ' </td>'."\n"; 349 351 echo ' </tr>'."\n"; 350 352 … … 728 730 } 729 731 echo '</script>'."\n"; 730 732 733 echo '<input type="hidden" id="podPressMedia_defaultpreviewImage" value="'.PODPRESS_URL.'/images/vpreview_center.png" />'."\n"; 734 731 735 echo '<p style="padding-bottom:1em;">'.__('To control player location in your post, put', 'podpress').' '.$this->podcastTag.' '.__(' where you want it to appear', 'podpress').'.<br /> '."\n"; 732 736 echo ''.__('File Uploading support is not part of podPress', 'podpress').'.</p> '."\n"; 733 737 echo ' <h4>'.__('Podcasting', 'podpress').' '.__('Files', 'podpress').':</h4>'."\n"; … … 871 875 echo ' <label for="podPressMedia_'.$num.'_previewImage">'.__('Preview Image URL', 'podpress').'</label>: '."\n"; 872 876 echo ' </td>'."\n"; 873 877 echo ' <td>'."\n"; 874 echo ' <input type="text" id="podPressMedia_'.$num.'_previewImage" name="podPressMedia['.$num.'][previewImage]" size="40" value="'.$thisMedia['previewImage'].'" onchange="javascript: podPress MediaFiles['.$num.'][\'previewImage\'] = this.value; podPressShowPreviewImage('.$num.');" />'."\n";878 echo ' <input type="text" id="podPressMedia_'.$num.'_previewImage" name="podPressMedia['.$num.'][previewImage]" size="40" value="'.$thisMedia['previewImage'].'" onchange="javascript: podPressPreviewImageOnChange('.$num.', this.value);" />'."\n"; 875 879 echo ' </td>'."\n"; 876 880 echo ' </tr>'."\n"; 877 881 echo ' <tr id="podPressMediaPreviewImageDisplayWrapper_'.$num.'" style="display: none;">'."\n"; … … 881 885 echo ' <td>'."\n"; 882 886 echo ' <div id="podPressPlayerSpace_'.$num.'"></div>'."\n"; 883 887 echo '<script type="text/javascript"><!--'."\n"; 884 echo " document.getElementById('podPressPlayerSpace_".$num."').innerHTML = podPressGenerateVideoPreview (".$num.", '', '', '', document.getElementById('podPressMedia_".$num."_previewImage').value, true, true);\n";888 echo " document.getElementById('podPressPlayerSpace_".$num."').innerHTML = podPressGenerateVideoPreview (".$num.", '', ".$thisMedia['dimensionW'].", ".$thisMedia['dimensionH'].", document.getElementById('podPressMedia_".$num."_previewImage').value, true);\n"; 885 889 echo "--></script>\n"; 886 890 echo ' </td>'."\n"; 887 891 echo ' </tr>'."\n"; … … 891 895 echo ' '.__('Dimensions', 'podpress').' (WxH): '."\n"; 892 896 echo ' </td>'."\n"; 893 897 echo ' <td>'."\n"; 894 echo ' <input type="text" id="podPressMedia_'.$num.'_dimensionW" name="podPressMedia['.$num.'][dimensionW]" size="5" value="'.$thisMedia['dimensionW'].'" onchange="javascript: podPressMediaFiles['.$num.'][\'dimensionW\'] = this.value; " />x<input type="text" id="podPressMedia_'.$num.'_dimensionH" name="podPressMedia['.$num.'][dimensionH]" size="5" value="'.$thisMedia['dimensionH'].'" onchange="javascript: podPressMediaFiles['.$num.'][\'dimensionH\'] = this.value;" /> '."\n";895 echo ' <select onchange="javascript: podPressUpdateDimensions(\''.$num.'\', this.value);">'."\n"; podPress_videoDimensionOptions($thisMedia['dimensionW'].':'.$thisMedia['dimensionH']); echo '</select>'."\n";898 echo ' <input type="text" id="podPressMedia_'.$num.'_dimensionW" name="podPressMedia['.$num.'][dimensionW]" size="5" value="'.$thisMedia['dimensionW'].'" onchange="javascript: podPressMediaFiles['.$num.'][\'dimensionW\'] = this.value; podPressUpdateDimensionList(\''.$num.'\');" />x<input type="text" id="podPressMedia_'.$num.'_dimensionH" name="podPressMedia['.$num.'][dimensionH]" size="5" value="'.$thisMedia['dimensionH'].'" onchange="javascript: podPressMediaFiles['.$num.'][\'dimensionH\'] = this.value; podPressUpdateDimensionList(\''.$num.'\')" /> '."\n"; 899 echo ' <select id="podPressMedia_'.$num.'_dimensionList" onchange="javascript: podPressUpdateDimensions(\''.$num.'\', this.value);">'."\n"; podPress_videoDimensionOptions($thisMedia['dimensionW'].':'.$thisMedia['dimensionH']); echo '</select>'."\n"; 896 900 echo ' </td>'."\n"; 897 901 echo ' </tr>'."\n"; 898 902 … … 968 972 969 973 $num++; 970 974 } 971 echo ' <input type="button" name="podPressAddAnother" value=" Add Media File" onclick="javascript: podPressAddMediaFile(true, \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'new\', true, false, false, \'free\'); podPressDisplayMediaFiles();"/>'."\n";975 echo ' <input type="button" name="podPressAddAnother" value="'.__('Add Media File', 'podpress').'" onclick="javascript: podPressAddMediaFile(true, \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'new\', true, false, false, \'free\'); podPressDisplayMediaFiles();"/>'."\n"; 972 976 if($entryType != 'page') { 973 977 echo ' <br/>'."\n"; 974 978 echo ' <h4>'.__('Post specific settings for iTunes', 'podpress').': </h4>'."\n"; … … 1186 1190 } 1187 1191 podPress_add_post_meta($post_id, 'podPressMedia', $verifiedMedia, true) ; 1188 1192 } 1189 } 1193 } 1190 1194 if(isset($_POST['iTunesSubtitleChoice']) AND $_POST['iTunesSummaryChoice'] AND $_POST['iTunesKeywordsChoice'] AND $_POST['iTunesAuthorChoice'] AND $_POST['iTunesExplicit'] AND $_POST['iTunesBlock']) { 1191 1195 if($_POST['iTunesSubtitleChoice'] == 'Custom' && !empty($_POST['iTunesSubtitle'])) { 1192 1196 $podPressPostSpecific['itunes:subtitle'] = $_POST['iTunesSubtitle']; … … 1253 1257 } 1254 1258 1255 1259 function edit_category_form($input) { 1260 global $wp_version; 1256 1261 $data = podPress_get_option('podPress_category_'.$input->cat_ID); 1257 1262 $blog_charset = get_bloginfo('charset'); 1258 1263 if(empty($data['podcastFeedURL'])) { 1259 1264 $data['podcastFeedURL'] = get_settings('siteurl').'/?feed=rss2&cat='.$input->cat_ID; 1260 1265 } 1261 global $wp_version;1266 // Since WP 2.7 the column on the categories page is to small and scrollbars are necessary. This is only a short fix. 1262 1267 if (TRUE == version_compare($wp_version, '2.7','<') ){ 1263 1268 echo '<div class="wrap">'."\n"; 1264 1269 } else { … … 1366 1371 echo ' <td width="50%">'; 1367 1372 echo ' <label for="iTunesImageChoice"><strong>'.__('iTunes:Image', 'podpress').'</strong></label>'."\n"; 1368 1373 echo ' <br/>'; 1369 echo ' '.__('The iTunes image should be a square image with <a href="http://www.apple.com/itunes/podcasts/specs.html#image" target="_blank">at least 600 x 600 pixels</a> as Apple writes (01/2010) in "<a href="http://www.apple.com/itunes/podcasts/specs.html" target="_blank">Making a Podcast</a>" of their own Podcasting Resources. In the past 300 x 300 pixels were recommended. iTunes supports JPEG and PNG images (the file name extensions should ".jpg" or ".png").', 'podpress')."\n";1374 echo ' '.__('The iTunes image should be a square image with <a href="http://www.apple.com/itunes/podcasts/specs.html#image" target="_blank">at least 600 x 600 pixels</a> as Apple writes (01/2010) in "<a href="http://www.apple.com/itunes/podcasts/specs.html" target="_blank">Making a Podcast</a>" of their own Podcasting Resources. In the "<a href="http://www.apple.com/itunes/podcasts/creatorfaq.html" target="_blank">FAQs: For Podcast Makers</a>" 300 x 300 pixels are recommended by Apple. iTunes supports JPEG and PNG images (the file name extensions should ".jpg" or ".png").', 'podpress')."\n"; 1370 1375 echo ' <br/>'; 1371 1376 echo ' <select id="iTunesImageChoice" name="iTunesImageChoice" onchange="javascript: podPress_updateCategoryCasting();">'."\n"; 1372 1377 echo ' <option value="Global" '; if($data['iTunesImageChoice'] != 'Custom') { echo 'selected="selected"'; } echo '>'.__('Use Global', 'podpress').'</option>'."\n"; … … 1483 1488 echo ' <br/>'; 1484 1489 echo ' <select id="iTunesCategory_0" name="iTunesCategory[0]" onchange="podPress_updateCategoryCasting();">'."\n"; 1485 1490 echo ' <optgroup label="'.__('Select Primary', 'podpress').'">'."\n"; 1486 echo ' <option value="##Global##" '; if($data['iTunesCategory'][0] == '##Global##' || empty($data['iTunesCategory'][0])) { echo 'selected="selected"'; } echo '>'.__('Use Global', 'podpress').' ('.$this->settings['iTunes']['category'][0].')</option>'."\n"; 1491 if ('' == trim($this->settings['iTunes']['category'][0])) { 1492 $current_global = '[ '.__('nothing', 'podpress').' ]'; 1493 } else { 1494 $current_global = $this->settings['iTunes']['category'][0]; 1495 } 1496 echo ' <option value="##Global##" '; if($data['iTunesCategory'][0] == '##Global##' || empty($data['iTunesCategory'][0])) { echo 'selected="selected"'; } echo '>'.__('Use Global', 'podpress').' ('.$current_global.')</option>'."\n"; 1487 1497 if (empty($data['iTunesCategory'][0])) { 1488 1498 podPress_itunesCategoryOptions(htmlentities('##Global##'), ENT_QUOTES, $blog_charset); 1489 1499 } else { … … 1494 1504 echo ' <input type="hidden" id="global_iTunesCategory" value="'.htmlentities(stripslashes($this->settings['iTunes']['category'][0]), ENT_QUOTES, $blog_charset).'" />'."\n"; 1495 1505 echo ' <select name="iTunesCategory[1]">'."\n"; 1496 1506 echo ' <optgroup label="'.__('Select Second', 'podpress').'">'."\n"; 1497 echo ' <option value="##Global##" '; if($data['iTunesCategory'][1] == '##Global##' || empty($data['iTunesCategory'][1])) { echo 'selected="selected"'; } echo '>'.__('Use Global', 'podpress').' ('.$this->settings['iTunes']['category'][1].')</option>'."\n"; 1507 if ('' == trim($this->settings['iTunes']['category'][1])) { 1508 $current_global = '[ '.__('nothing', 'podpress').' ]'; 1509 } else { 1510 $current_global = $this->settings['iTunes']['category'][1]; 1511 } 1512 echo ' <option value="##Global##" '; if($data['iTunesCategory'][1] == '##Global##' || empty($data['iTunesCategory'][1])) { echo 'selected="selected"'; } echo '>'.__('Use Global', 'podpress').' ('.$current_global.')</option>'."\n"; 1498 1513 if (empty($data['iTunesCategory'][1])) { 1499 1514 podPress_itunesCategoryOptions(htmlentities('##Global##'), ENT_QUOTES, $blog_charset); 1500 1515 } else { … … 1504 1519 echo ' </select><br/>'."\n"; 1505 1520 echo ' <select name="iTunesCategory[2]">'."\n"; 1506 1521 echo ' <optgroup label="'.__('Select Third', 'podpress').'">'."\n"; 1507 echo ' <option value="##Global##" '; if($data['iTunesCategory'][2] == '##Global##' || empty($data['iTunesCategory'][2])) { echo 'selected="selected"'; } echo '>'.__('Use Global', 'podpress').' ('.$this->settings['iTunes']['category'][2].')</option>'."\n"; 1522 if ('' == trim($this->settings['iTunes']['category'][2])) { 1523 $current_global = '[ '.__('nothing', 'podpress').' ]'; 1524 } else { 1525 $current_global = $this->settings['iTunes']['category'][2]; 1526 } 1527 echo ' <option value="##Global##" '; if($data['iTunesCategory'][2] == '##Global##' || empty($data['iTunesCategory'][2])) { echo 'selected="selected"'; } echo '>'.__('Use Global', 'podpress').' ('.$current_global.')</option>'."\n"; 1508 1528 if (empty($data['iTunesCategory'][2])) { 1509 1529 podPress_itunesCategoryOptions(htmlentities('##Global##'), ENT_QUOTES, $blog_charset); 1510 1530 } else { … … 1526 1546 echo ' <option value="Clean" '; if($data['iTunesExplicit'] == 'Clean') { echo 'selected="selected"'; } echo '>'.__('Clean', 'podpress').'</option>'."\n"; 1527 1547 echo ' </select>'."\n"; 1528 1548 echo ' <div id="iTunesExplicitHelp" style="display: none;">'."\n"; 1529 echo ' '.__('Headphones Required? Sets the parental advisory graphic in name column.', 'podpress')."\n"; 1549 echo ' '.__('Setting to indicate whether or not your podcast contains explicit material', 'podpress')."\n"; 1550 echo ' <br/>'.__('"No" (default) - no indicator will show up', 'podpress')."\n"; 1551 echo ' <br/>'.__('"Yes" - an "EXPLICIT" parental advisory graphic will appear next to your podcast artwork or name in iTunes', 'podpress')."\n"; 1552 echo ' <br/>'.__('"Clean" - means that you are sure that no explicit language or adult content is included any of the episodes, and a "CLEAN" graphic will appear', 'podpress')."\n"; 1553 echo ' <p>'.__('You can also use such an option for each of your podcast episodes (in the post/page editor).', 'podpress').'</p>'."\n"; 1530 1554 echo ' </div>'."\n"; 1531 1555 echo ' </td>'."\n"; 1532 1556 echo ' <td width="50%">'."\n"; … … 1537 1561 echo ' <option value="Global" '; if($data['rss_copyrightChoice'] != 'Custom') { echo 'selected="selected"'; } echo '>'.__('Use Global', 'podpress').' ('.podPress_stringLimiter(ucfirst(stripslashes($this->settings['rss_copyright'])), 40).')</option>'."\n"; 1538 1562 echo ' <option value="Custom" '; if($data['rss_copyrightChoice'] == 'Custom') { echo 'selected="selected"'; } echo '>'.__('Custom', 'podpress').'</option>'."\n"; 1539 1563 echo ' </select>'."\n"; 1540 echo ' <div id="rss_copyright Wrapper" style="display: none;">'."\n";1564 echo ' <div id="rss_copyrightHelp" style="display: none;">'."\n"; 1541 1565 echo ' <input type="text" name="rss_copyright" size="40" id="rss_copyright" value="'.htmlentities(stripslashes($data['rss_copyright']), ENT_QUOTES, $blog_charset).'" onchange="javascript: podPress_updateCategoryCasting();"/>'; 1542 1566 echo ' <br />'.__('Enter the complete copyright string or the license name. For example: Copyright © by Jon Doe, 2009 OR <a href="http://creativecommons.org/licenses/by-nc-sa/2.5/" target="_blank">CreativeCommons Attribution-Noncommercial-Share Alike 2.5</a>', 'podpress')."\n"; 1543 1567 echo ' <input type="hidden" id="global_rss_copyright" value="'.htmlentities(stripslashes($this->settings['rss_copyright']), ENT_QUOTES, $blog_charset).'" />'."\n"; 1544 echo ' </div>'."\n"; 1545 echo ' <div id="rss_copyrightHelp" style="display: none;">'."\n"; 1568 echo ' <p>'."\n"; 1546 1569 echo ' '.__('Used if this Copyright phrase should be different than the global copyright phrase.', 'podpress')."\n"; 1570 echo ' </p>'."\n"; 1547 1571 echo ' </div>'."\n"; 1548 1572 1549 1573 echo ' <br /><br />'."\n"; … … 1554 1578 echo ' <option value="Global" '; if($data['rss_license_urlChoice'] != 'Custom') { echo 'selected="selected"'; } echo '>'.__('Use Global', 'podpress').' ('.podPress_stringLimiter(ucfirst(stripslashes($this->settings['rss_license_url'])), 40).')</option>'."\n"; 1555 1579 echo ' <option value="Custom" '; if($data['rss_license_urlChoice'] == 'Custom') { echo 'selected="selected"'; } echo '>'.__('Custom', 'podpress').'</option>'."\n"; 1556 1580 echo ' </select>'."\n"; 1557 echo ' <div id="rss_license_url Wrapper" style="display: none;">'."\n";1581 echo ' <div id="rss_license_urlHelp" style="display: none;">'."\n"; 1558 1582 echo ' <input name="rss_license_url" type="text" id="rss_license_url" value="'.htmlentities($data['rss_license_url'], ENT_QUOTES, $blog_charset).'" size="65%" />'."\n"; 1559 1583 echo ' <br />'.__('If you use a special license like a <a href="http://creativecommons.org/licenses" target="_blank" title="Creative Commons">Creative Commons</a> License for your news feeds then enter the complete URL (e.g. <a href="http://creativecommons.org/licenses/by-nc-sa/2.5/" target="_blank">http://creativecommons.org/licenses/by-nc-sa/2.5/</a>) to the full text of this particular license here.', 'podpress')."<br/><br/>\n"; 1560 1584 echo ' <input type="hidden" id="global_rss_license_url" value="'.htmlentities(stripslashes($this->settings['rss_license_url']), ENT_QUOTES, $blog_charset).'" />'."\n"; 1561 echo ' </div>'."\n"; 1562 echo ' <div id="rss_license_urlHelp" style="display: none;">'."\n"; 1585 echo ' <p>'."\n"; 1563 1586 echo ' '.__('Used if this license URL should be different than the global license URL.', 'podpress')."\n"; 1587 echo ' </p>'."\n"; 1564 1588 echo ' </div>'."\n"; 1565 1589 1566 1590 … … 1577 1601 echo ' <option value="Yes" '; if($data['iTunesBlock'] == 'Yes') { echo 'selected="selected"'; } echo '>'.__('Yes', 'podpress').'</option>'."\n"; 1578 1602 echo ' </select>'."\n"; 1579 1603 echo ' <div id="itunesBlockHelp" style="display: none;">'."\n"; 1580 echo ' '.__('Prevent this episode or podcast from appearing in iTunes.', 'podpress')."\n"; 1604 echo ' '.__('Use this if you are no longer creating a podcast and you want it removed from iTunes.', 'podpress')."\n"; 1605 echo ' <br/>'.__('"No" (default) - the podcast appears in the iTunes Podcast directory', 'podpress')."\n"; 1606 echo ' <br/>'.__('"Yes" - prevent the entire podcast from appearing in the iTunes Podcast directory', 'podpress')."\n"; 1607 echo ' <p>'.__('You can also use such an option for each of your podcast episodes (in the post/page editor).', 'podpress').'</p>'."\n"; 1581 1608 echo ' </div>'."\n"; 1582 1609 echo ' </td>'."\n"; 1583 1610 echo ' <td width="50%"> </td>'."\n"; -
podpress_admin_functions.php
345 345 $options['video_mpg'] = __('MPG - Video', 'podpress'); 346 346 $options['video_asf'] = __('ASF - Video', 'podpress'); 347 347 $options['video_wmv'] = __('WMV - Video', 'podpress'); 348 $options[' video_wma'] = __('WMA - Video', 'podpress');348 $options['audio_wma'] = __('WMA - Audio', 'podpress'); 349 349 $options['video_flv'] = __('FLV - Flash Video', 'podpress'); 350 350 $options['video_swf'] = __('SWF - Flash content', 'podpress'); 351 351 $options['ebook_pdf'] = __('PDF - eBook', 'podpress'); … … 362 362 function podPress_videoDimensionOptions($selected='320:240') { 363 363 $dimensions = array(); 364 364 reset($dimensions); 365 $dimensions_noimage = array(); 366 reset($dimensions_noimage); 365 367 366 368 $dimensions['160:120'] = '160 x 120'; 367 369 $dimensions['320:240'] = '320 x 240'; … … 371 373 $dimensions['480:260'] = '480 x 260 [16:9 - 1.85:1]'; 372 374 $dimensions['720:405'] = '720 x 405 [16:9 - 1.78:1]'; 373 375 $dimensions['720:390'] = '720 x 390 [16:9 - 1.85:1]'; 376 374 377 echo '<optgroup label="'.__('Common Dimensions', 'podpress').'">'."\n"; 375 378 foreach ($dimensions as $key => $value) { 376 379 if ($key == $selected) { … … 381 384 echo '<option value="'.$key.'"'.$selected_str.'>'.$value.'</option>'."\n"; 382 385 } 383 386 echo '</optgroup>'."\n"; 387 $dimensions_noimage['160:0'] = __('width: 160 px', 'podpress'); 388 $dimensions_noimage['320:0'] = __('width: 320 px', 'podpress'); 389 $dimensions_noimage['640:0'] = __('width: 640 px', 'podpress'); 390 $dimensions_noimage['720:0'] = __('width: 720 px', 'podpress'); 391 echo '<optgroup label="'.__('player without images', 'podpress').'">'."\n"; 392 foreach ($dimensions_noimage as $key => $value) { 393 if ($key == $selected) { 394 $selected_str =' selected="selected"'; 395 } else { 396 $selected_str =''; 397 } 398 echo '<option value="'.$key.'"'.$selected_str.'>'.$value.'</option>'."\n"; 399 } 400 echo '</optgroup>'."\n"; 401 384 402 } 385 403 386 404 function podPress_itunesLanguageArray() { … … 596 614 $foundit = true; 597 615 echo ' selected="selected"'; 598 616 } 599 echo ' >'.$value.'</option>'."\n";617 echo '>'.$value.'</option>'."\n"; 600 618 } 601 619 602 620 if(!$foundit AND '##Global##' != $current) { … … 880 898 881 899 function podPress_getID3tags($mediafile, $resolved = false, $limitDownload = false) { 882 900 GLOBAL $podPress; 901 $tmp_download_exists = FALSE; 902 883 903 if($podPress->settings['enablePodangoIntegration']) { 884 904 if(substr($mediafile, 0, strlen('Podango:')) == 'Podango:') { 885 905 $fileNameParts = explode(':', $mediafile); … … 906 926 } else { 907 927 $uriFileName = $mediafile; 908 928 } 909 $uriFileName = podPress_downloadFile($uriFileName, false, $limitDownload); 929 $siteurl = get_bloginfo('siteurl'); 930 if (FALSE !== $siteurl AND FALSE !== strpos($uriFileName, $siteurl)) { // then it is not a real remote file - it is only an URL to a local file 931 // get the absolute folder of the file from the URL 932 $purl = parse_url($uriFileName); 933 $path_part = end(explode('wp-content', $purl['path'])); 934 $uriFileName = WP_CONTENT_DIR.$path_part; 935 } else { 936 $uriFileName = podPress_downloadFile($uriFileName, false, $limitDownload); 937 $tmp_download_exists = TRUE; 938 } 910 939 } 911 940 912 941 $fileinfo = @$getID3->analyze($uriFileName); 913 914 if (empty($fileinfo)) {942 943 if (empty($fileinfo)) { 915 944 return 'Remote MP3 File could not be read.'; 916 945 } 917 946 918 947 getid3_lib::CopyTagsToComments($fileinfo); 948 949 if (TRUE === $tmp_download_exists) { // if the file have been downloaded to a local folder then delete the tempfile 950 if ('' != $fileinfo['filenamepath']) { // take the folder and file from getID3 if possible 951 $unlink_result = @unlink($fileinfo['filenamepath']); 952 } else { 953 $unlink_result = @unlink($uriFileName); 954 } 955 } 919 956 return $fileinfo; 920 957 } 921 958 … … 1034 1071 if($pos) { 1035 1072 $ext = substr($ext, 0, $pos); 1036 1073 } 1037 $localtempfilename = tempnam('/tmp', 'getID3').'.'.$ext; 1074 $localtempfilename = @tempnam('/tmp', 'getID3').'.'.$ext; 1075 if (FALSE == $localtempfilename OR '.'.$ext == $localtempfilename) { 1076 $localtempfilename = 'podpress_tmp.'.$ext; 1077 } 1038 1078 if (!$fp_local = @fopen($localtempfilename, 'wb')) { 1039 1079 $continue = false; 1040 1080 } … … 1116 1156 if(file_exists($systemFileName)) { 1117 1157 return filesize($systemFileName); 1118 1158 } 1159 1160 // if it is a remote file then get the file size from the header information: 1119 1161 $uriFileName = $podPress->convertPodcastFileNameToValidWebPath($mediafile); 1162 1120 1163 // Request headers 1121 1122 1164 $sRemoteHeaders = podPress_downloadFile($uriFileName, true); 1123 1165 1124 1166 // Parsing the headers -
podpress_class.php
639 639 function insert_content($content = '') { 640 640 GLOBAL $post, $podPressTemplateData, $podPressTemplateUnauthorizedData, $wpdb; 641 641 642 643 642 if ( !empty($post->post_password) ) { // if there's a password 644 643 if ( stripslashes($_COOKIE['wp-postpass_'.COOKIEHASH]) != $post->post_password ) { // and it doesn't match the cookie 645 644 return $content; … … 671 670 $hasLocationDefined = (bool)strstr($content, $this->podcastTag); 672 671 if(!$hasLocationDefined) { 673 672 if($this->settings['contentBeforeMore'] == 'no') { 674 return $content; 673 if (is_home() or is_archive()) { 674 if (FALSE !== strpos($content, 'class="more-link">')) { 675 return $content; 676 } 677 } 675 678 } 676 679 if($this->settings['contentLocation'] == 'start') { 677 680 $content = $this->podcastTag.$content; … … 698 701 $post->podPressMedia[$key]['previewImage'] = $this->settings['videoPreviewImage']; 699 702 } 700 703 701 $supportedVideoTypes = array('video_mp4', 'video_m4v', 'video_mov', 'video_qt', 'video_avi', 'video_mpg', 'video_asf', 'video_wmv', 'video_ wma', 'video_flv', 'video_swf');704 $supportedVideoTypes = array('video_mp4', 'video_m4v', 'video_mov', 'video_qt', 'video_avi', 'video_mpg', 'video_asf', 'video_wmv', 'video_flv', 'video_swf'); 702 705 if (TRUE == $this->settings['disableVideoPreview'] AND TRUE == in_array($post->podPressMedia[$key]['type'], $supportedVideoTypes)) { 703 706 $post->podPressMedia[$key]['disablePreview'] = true; 704 } 705 707 } 708 706 709 if($post->podPressMedia[$key]['feedonly'] == 'on') { 707 710 continue; 708 711 } … … 721 724 $post->podPressMedia[$key]['stats'] = array('feed'=>$stats[0]->feed, 'web'=>$stats[0]->web, 'play'=>$stats[0]->play, 'total'=>$stats[0]->total); 722 725 } 723 726 } 724 $supportedMediaTypes = array('audio_mp3', 'audio_ogg', 'audio_m4a', 'audio_mp4', 'audio_m3u', 'video_mp4', 'video_m4v', 'video_mov', 'video_qt', 'video_avi', 'video_mpg', 'video_asf', 'video_wmv', ' video_wma', 'video_flv', 'video_swf', 'ebook_pdf', 'embed_youtube');727 $supportedMediaTypes = array('audio_mp3', 'audio_ogg', 'audio_m4a', 'audio_mp4', 'audio_m3u', 'video_mp4', 'video_m4v', 'video_mov', 'video_qt', 'video_avi', 'video_mpg', 'video_asf', 'video_wmv', 'audio_wma', 'video_flv', 'video_swf', 'ebook_pdf', 'embed_youtube'); 725 728 if(!in_array($post->podPressMedia[$key]['type'], $supportedMediaTypes)) { 726 729 $post->podPressMedia[$key]['type'] = 'misc_other'; 727 730 } … … 782 785 $post->podPressMedia[$key]['dimensionH'] = 30; 783 786 break; 784 787 case 'audio_m4a': 785 case 'audio_m4a':786 788 case 'audio_mp4': 789 case 'audio_wma': 787 790 case 'video_m4v': 788 791 case 'video_mp4': 789 792 case 'video_mov': … … 791 794 case 'video_avi': 792 795 case 'video_mpg': 793 796 case 'video_asf': 794 case 'video_wma':795 797 case 'video_wmv': 796 798 case 'video_flv': 797 799 case 'video_swf': … … 842 844 /* The theme file needs to populate these */ 843 845 $podPressContent = podPress_webContent($podPressTemplateData); 844 846 } 845 return str_replace($this->podcastTag, $podPressContent,$content);847 return str_replace($this->podcastTag, $podPressContent, $content); 846 848 } 847 849 848 850 function xmlrpc_post_addMedia($input) { -
podpress_theme.php
36 36 $val['dimensionH'] = "''"; 37 37 } 38 38 $dividerNeeded = false; 39 39 40 $podPressEpisodeTitle = __($val['title'], 'podpress'); // if the title is not given by the author then it will be a defaultTitle (see podPress_defaultTitles) 41 40 42 if($val['enablePlayer']) { 41 43 if($podPressContent != '') { 42 44 $podPressContent .= "<br />\n"; 43 45 } 44 $podPressContent .= "\n".'<div id="podPressPlayerSpace_'.$GLOBALS['podPressPlayer'].'"> </div>'."\n" .'<!-- Begin: podPress download link line -->'."\n".'<div class="podPress_downloadlinks">';46 $podPressContent .= "\n".'<div id="podPressPlayerSpace_'.$GLOBALS['podPressPlayer'].'"> </div>'."\n"; 45 47 } 46 48 49 $podPressContent .= '<!-- Begin: podPress download link line -->'."\n".'<div class="podPress_downloadlinks">'; 50 47 51 if(isset($val['image'])) { 48 52 if($val['enableDownload'] && !empty($val['URI'])) { 49 53 $podPressContent .= '<a href="'.$val['URI'].'" target="new">'; 50 54 } 51 $podPressContent .= '<img src="'.podPress_url().'images/'.$val['image'].'" border="0" align="top" class="podPress_imgicon" alt="icon for podpress" />'; 55 switch ($val['image']) { // this is only a temporarily until there are the changed buttons -> WMA files are audio files! 56 case 'audio_wma_button.png' : 57 $podPressContent .= '<img src="'.podPress_url().'images/video_wma_button.png" class="podPress_imgicon" alt="'.$podPressEpisodeTitle.'" />'; 58 break; 59 case 'audio_wma_icon.png' : 60 $podPressContent .= '<img src="'.podPress_url().'images/video_wma_icon.png" class="podPress_imgicon" alt="'.$podPressEpisodeTitle.'" />'; 61 break; 62 default: 63 $podPressContent .= '<img src="'.podPress_url().'images/'.$val['image'].'" class="podPress_imgicon" alt="'.$podPressEpisodeTitle.'" />'; 64 break; 65 } 52 66 if($val['enableDownload'] && !empty($val['URI'])) { 53 67 $podPressContent .= '</a>'; 54 68 } … … 56 70 $val['enableDownload'] = false; 57 71 } 58 72 } 73 59 74 if($val['enableTorrentDownload']) { 60 75 $podPressContent .= '<a href="'.$val['URI_torrent'].'" target="new">'; 61 76 if(strstr($val['image'], '_button')) { … … 63 78 } else { 64 79 $torrentimg = 'misc_torrent_icon.png'; 65 80 } 66 $podPressContent .= '<img src="'.podPress_url().'images/'.$torrentimg.'" border="0" align="top" class="podPress_imgicon" alt="icon for podpress" />';81 $podPressContent .= '<img src="'.podPress_url().'images/'.$torrentimg.'" class="podPress_imgicon" alt="'.$podPressEpisodeTitle.' - '.__('Torrent','podpress').'" />'; 67 82 $podPressContent .= '</a>'; 68 83 } 69 84 70 85 $podPressContent .= ' '; 71 $podPressContent .= __($val['title'], 'podpress');86 $podPressContent .= $podPressEpisodeTitle; 72 87 73 88 if($podPressTemplateData['showDuration'] == 'enabled' && !empty($val['duration']) && preg_match("/([0-9]):([0-9])/", $val['duration'])) { 74 89 $podPressContent .= ' ['.$val['duration'].'m]'; … … 90 105 } else { 91 106 $previewVal = 'false'; 92 107 } 93 $podPressContent .= "<a href=\"#\" onclick=\"javascript: podPressShowHidePlayer('".$GLOBALS['podPressPlayer']."','".$val['URI_Player']."',".$val['dimensionW'].",".$val['dimensionH'].",'true'); return false;\"><span id=\"podPressPlayerSpace_".$GLOBALS['podPressPlayer']."_PlayLink\">".__('Play Now', 'podpress')."</span></a>";108 $podPressContent .= '<a href="#podPressPlayerSpace_'.$GLOBALS['podPressPlayer'].'" onclick="javascript:podPressShowHidePlayer(\''.$GLOBALS['podPressPlayer'].'\', \''.$val['URI_Player'].'\', '.strval(intval($val['dimensionW'])).', '.strval(intval($val['dimensionH'])).', \'true\'); return false;"><span id="podPressPlayerSpace_'.$GLOBALS['podPressPlayer'].'_PlayLink">'.__('Play Now', 'podpress').'</span></a>'; 94 109 $dividerNeeded = true; 95 110 if($podPress->settings['contentAutoDisplayPlayer']) { 96 $podPressPlayBlockScripts .= "podPressShowHidePlayer('".$GLOBALS['podPressPlayer']."', '".$val['URI_Player']."',".$val['dimensionW'].",".$val['dimensionH'].", '".$previewVal."', '".$val['previewImage']."');\n";111 $podPressPlayBlockScripts .= 'podPressShowHidePlayer(\''.$GLOBALS['podPressPlayer'].'\', \''.$val['URI_Player'].'\', '.strval(intval($val['dimensionW'])).', '.strval(intval($val['dimensionH'])).', \''.$previewVal.'\', \''.$val['previewImage'].'\');'; 97 112 } 98 113 } 99 114 … … 101 116 if($dividerNeeded) { 102 117 $podPressContent .= $divider; 103 118 } 104 $podPressContent .= "<a href=\"#\" onclick=\"javascript: podPressPopupPlayer('".$GLOBALS['podPressPlayer']."', '".$val['URI_Player']."',".$val['dimensionW'].",".$val['dimensionH']."); return false;\">".__('Play in Popup', 'podpress')."</a>";119 $podPressContent .= '<a href="#podPressPlayerSpace_'.$GLOBALS['podPressPlayer'].'" onclick="javascript:podPressPopupPlayer(\''.$GLOBALS['podPressPlayer'].'\', \''.$val['URI_Player'].'\', '.strval(intval($val['dimensionW'])).', '.strval(intval($val['dimensionH'])).', \''.get_bloginfo('name').'\'); return false;">'.__('Play in Popup', 'podpress').'</a>'; 105 120 $dividerNeeded = true; 106 121 } 107 122 … … 125 140 $dividerNeeded = true; 126 141 } 127 142 128 $podPressContent .= '</div>'."\n".'<!-- End: podPress download link line -->'."\n";129 143 } 144 145 $podPressContent .= '</div>'."\n".'<!-- End: podPress download link line -->'."\n"; 130 146 } 131 147 132 148 if($podPress->settings['contentAutoDisplayPlayer']) { 133 149 $podPressPlayBlockScripts = '<script type="text/javascript"><!--'."\n".$podPressPlayBlockScripts; 134 $podPressPlayBlockScripts .= "\n -->\n</script>";150 $podPressPlayBlockScripts .= "\n".'-->'."\n".'</script>'; 135 151 } 136 return '<div class="podPress_content">'.$podPressContent.'</div>'."\n".$podPressPlayBlockScripts;152 return "<!-- Begin: podPress -->\n".'<div class="podPress_content">'.$podPressContent.'</div>'."\n".$podPressPlayBlockScripts."\n<!-- End: podPress -->\n"; 137 153 } 138 154 } 139 155 … … 162 178 case 'video_mpg': 163 179 case 'video_asf': 164 180 case 'video_wmv': 165 case 'video_wma':166 181 return 'Online Video'; 167 182 break; 183 case 'audio_wma': 184 return 'Online Audio'; 185 break; 168 186 case 'video_swf': 169 187 return 'Flash Content'; 170 188 break; … … 183 201 } 184 202 } 185 203 } 186 204 ?>
