Ticket #1037: podpress_multiple_enhancements_v2.diff
| File podpress_multiple_enhancements_v2.diff, 45.7 KB (added by ntm, 4 years ago) |
|---|
-
podpress.php
4 4 Info for WordPress: 5 5 ============================================================================== 6 6 Plugin Name: podPress 7 Version: 8.8. 17 Version: 8.8.2 beta 8 8 Plugin URI: http://www.mightyseek.com/podpress/ 9 9 Description: The podPress pluggin gives you everything you need in one easy plugin to use WordPress for Podcasting. Set it up in <a href="admin.php?page=podpress/podpress_feed.php">'podPress'->Feed/iTunes Settings</a>. If you this plugin works for you, send us a comment. 10 10 Author: Dan Kuykendall (Seek3r) … … 339 339 } else { 340 340 $admincss = 'podpress_admin.css'; 341 341 } 342 342 343 echo '<link rel="stylesheet" href="'.podPress_url().$admincss.'" type="text/css" />'."\n"; 343 344 if ((strpos($_SERVER['REQUEST_URI'], 'plugins.php') !== false) && (podPress_remote_version_check() == 1)) { 344 345 $atmp = parse_url(podPress_url()); … … 475 476 } 476 477 } 477 478 478 function podPress_do_feed_atom1( ) {479 function podPress_do_feed_atom1($withcomments) { 479 480 podPress_addFeedHooks(); 480 load_template(ABSPATH.PLUGINDIR.'/podpress/wp-atom1.php'); 481 global $wp_version; 482 // do_feed_atom() exists since WP 2.1 and since WP 2.3 there is a good ATOM feed support build in WP (http://codex.wordpress.org/Version_2.3#Developer_.2F_Power_User_Stuff) 483 // for older WP versions use the podPress ATOM feed template 484 if (!function_exists('do_feed_atom') OR TRUE == version_compare('2.3', $wp_version,'>')) { 485 load_template(ABSPATH.PLUGINDIR.'/podpress/wp-atom1.php'); 486 } else { 487 do_feed_atom($withcomments); 488 } 481 489 } 482 490 483 function podPress_do_feed_torrent( ) {491 function podPress_do_feed_torrent($withcomments) { 484 492 GLOBAL $podPress, $posts; 485 493 podPress_addFeedHooks(); 486 494 define('PODPRESS_TORRENTCAST', true); -
podpress_admin.js
384 384 } else { 385 385 document.getElementById('rss_copyrightWrapper').style.display='none'; 386 386 } 387 if(document.getElementById('rss_license_urlChoice').value == 'Custom') { 388 document.getElementById('rss_license_urlWrapper').style.display=''; 389 } else { 390 document.getElementById('rss_license_urlWrapper').style.display='none'; 391 } 387 392 388 393 if(document.getElementById('rss_language').value == '##Global##') { 389 394 podPress_set_RssLanguagePreview(document.getElementById('global_rss_language').value); -
podpress_admin_class.php
35 35 } 36 36 37 37 function post_form($entryType = 'post') { 38 38 39 if(!is_object($GLOBALS['post']) && isset($GLOBALS['post_cache'][$GLOBALS['post']])) { 39 40 $post = $GLOBALS['post_cache'][$GLOBALS['post']]; 40 41 } else { 41 42 $post = $GLOBALS['post']; 42 43 } 44 43 45 $post = $this->addPostData($post, true); 46 44 47 if(($_GET['action'] == 'edit')) { 45 48 $post_id = $_GET['post']; 46 49 … … 175 178 } 176 179 echo '</script>'."\n"; 177 180 181 178 182 echo '<div id="podPressstuff" class="dbx-group">'."\n"; 179 183 echo ' <fieldset id="podpresscontent" class="dbx-box">'."\n"; 180 184 echo ' <h3 class="dbx-handle">'.__('Podcasting', 'podpress').'</h3> '."\n"; … … 632 636 } 633 637 podPress_add_post_meta($post_id, 'podPressMedia', $verifiedMedia, true) ; 634 638 } 635 } 636 if($_POST['iTunesSubtitleChoice'] == 'Custom' && !empty($_POST['iTunesSubtitle'])) { 637 $podPressPostSpecific['itunes:subtitle'] = $_POST['iTunesSubtitle']; 638 } else { 639 $podPressPostSpecific['itunes:subtitle'] = '##PostExcerpt##'; 640 } 639 } 640 if(isset($_POST['iTunesSubtitleChoice']) AND $_POST['iTunesSummaryChoice'] AND $_POST['iTunesKeywordsChoice'] AND $_POST['iTunesAuthorChoice'] AND $_POST['iTunesExplicit'] AND $_POST['iTunesBlock']) { 641 if($_POST['iTunesSubtitleChoice'] == 'Custom' && !empty($_POST['iTunesSubtitle'])) { 642 $podPressPostSpecific['itunes:subtitle'] = $_POST['iTunesSubtitle']; 643 } else { 644 $podPressPostSpecific['itunes:subtitle'] = '##PostExcerpt##'; 645 } 641 646 642 if($_POST['iTunesSummaryChoice'] == 'Custom' && !empty($_POST['iTunesSummary'])) {643 $podPressPostSpecific['itunes:summary'] = $_POST['iTunesSummary'];644 } elseif($_POST['iTunesSummaryChoice'] == 'Global') {645 $podPressPostSpecific['itunes:summary'] = '##Global##';646 } else {647 $podPressPostSpecific['itunes:summary'] = '##PostExcerpt##';648 }647 if($_POST['iTunesSummaryChoice'] == 'Custom' && !empty($_POST['iTunesSummary'])) { 648 $podPressPostSpecific['itunes:summary'] = $_POST['iTunesSummary']; 649 } elseif($_POST['iTunesSummaryChoice'] == 'Global') { 650 $podPressPostSpecific['itunes:summary'] = '##Global##'; 651 } else { 652 $podPressPostSpecific['itunes:summary'] = '##PostExcerpt##'; 653 } 649 654 650 if($_POST['iTunesKeywordsChoice'] == 'Custom' && !empty($_POST['iTunesKeywords'])) {651 $podPressPostSpecific['itunes:keywords'] = $_POST['iTunesKeywords'];652 } elseif($_POST['iTunesKeywordsChoice'] == 'Global') {653 $podPressPostSpecific['itunes:keywords'] = '##Global##';654 } else {655 $podPressPostSpecific['itunes:keywords'] = '##WordPressCats##';656 }655 if($_POST['iTunesKeywordsChoice'] == 'Custom' && !empty($_POST['iTunesKeywords'])) { 656 $podPressPostSpecific['itunes:keywords'] = $_POST['iTunesKeywords']; 657 } elseif($_POST['iTunesKeywordsChoice'] == 'Global') { 658 $podPressPostSpecific['itunes:keywords'] = '##Global##'; 659 } else { 660 $podPressPostSpecific['itunes:keywords'] = '##WordPressCats##'; 661 } 657 662 658 if($_POST['iTunesAuthorChoice'] == 'Custom' && !empty($_POST['iTunesAuthor'])) {659 $podPressPostSpecific['itunes:author'] = $_POST['iTunesAuthor'];660 } else {661 $podPressPostSpecific['itunes:author'] = '##Global##';662 }663 if($_POST['iTunesAuthorChoice'] == 'Custom' && !empty($_POST['iTunesAuthor'])) { 664 $podPressPostSpecific['itunes:author'] = $_POST['iTunesAuthor']; 665 } else { 666 $podPressPostSpecific['itunes:author'] = '##Global##'; 667 } 663 668 664 if($_POST['iTunesExplicit']) {665 $podPressPostSpecific['itunes:explicit'] = $_POST['iTunesExplicit'];666 } else {667 $podPressPostSpecific['itunes:explicit'] = 'No';668 }669 669 670 if($_POST['iTunesBlock']) { 671 $podPressPostSpecific['itunes:block'] = $_POST['iTunesBlock']; 672 } else { 673 $podPressPostSpecific['itunes:block'] = 'No'; 670 if($_POST['iTunesExplicit']) { 671 $podPressPostSpecific['itunes:explicit'] = $_POST['iTunesExplicit']; 672 } else { 673 $podPressPostSpecific['itunes:explicit'] = 'No'; 674 } 675 676 if($_POST['iTunesBlock']) { 677 $podPressPostSpecific['itunes:block'] = $_POST['iTunesBlock']; 678 } else { 679 $podPressPostSpecific['itunes:block'] = 'No'; 680 } 681 682 delete_post_meta($post_id, 'podPressPostSpecific'); 683 podPress_add_post_meta($post_id, 'podPressPostSpecific', $podPressPostSpecific, true); 674 684 } 675 676 delete_post_meta($post_id, 'podPressPostSpecific');677 podPress_add_post_meta($post_id, 'podPressPostSpecific', $podPressPostSpecific, true) ;678 685 $post->podPressPostSpecific = $podPressPostSpecific; 679 686 680 687 … … 699 706 if(empty($data['podcastFeedURL'])) { 700 707 $data['podcastFeedURL'] = get_settings('siteurl').'/?feed=rss2&cat='.$input->cat_ID; 701 708 } 702 echo '<div class="wrap">'."\n"; 709 global $wp_version; 710 if (TRUE == version_compare($wp_version, '2.7','<') ){ 711 echo '<div class="wrap">'."\n"; 712 } else { 713 echo '<div class="wrap" style="overflow:scroll;">'."\n"; 714 } 703 715 echo ' <h2>'.__('podPress CategoryCasting', 'podpress').'</h2>'."\n"; 704 716 echo ' <label for="categoryCasting"><strong>'.__('Enable Category Casting', 'podpress').'</strong></label> <a href="javascript:void(null);" onclick="javascript: podPressShowHideDiv(\'categoryCastingHelp\');">(?)</a>:'; 705 717 echo ' <input type="checkbox" name="categoryCasting" id="categoryCasting" '; if($data['categoryCasting'] == 'true') { echo 'checked="checked"'; } echo ' onclick="javascript: podPress_updateCategoryCasting();"/>'."\n"; … … 712 724 echo ' <fieldset class="options">'."\n"; 713 725 echo ' <legend>'.__('Podcast Feed Options', 'podpress').'</legend>'."\n"; 714 726 715 echo ' <table width="1 00%" cellspacing="2" cellpadding="5" class="editform" >'."\n";727 echo ' <table width="110%" cellspacing="2" cellpadding="5" class="editform" >'."\n"; 716 728 echo ' <tr>'."\n"; 717 729 echo ' <td width="50%"><h3>'.__('iTunes Settings', 'podpress').'</h3></td>'."\n"; 718 730 echo ' <td width="50%"><h3>'.__('Standard Settings', 'podpress').'</h3></td>'."\n"; … … 944 956 echo ' </td>'."\n"; 945 957 echo ' <td width="50%">'."\n"; 946 958 947 echo ' <label for="rss_copyrightChoice"><strong>'.__(' RSS Copyright', 'podpress').'</strong></label> <a href="javascript:void(null);" onclick="javascript: podPressShowHideRow(\'rss_copyrightHelp\');">(?)</a>:'."\n";959 echo ' <label for="rss_copyrightChoice"><strong>'.__('Feed Copyright / license name', 'podpress').'</strong></label> <a href="javascript:void(null);" onclick="javascript: podPressShowHideRow(\'rss_copyrightHelp\');">(?)</a>:'."\n"; 948 960 echo ' <br/>'; 949 961 echo ' <select id="rss_copyrightChoice" name="rss_copyrightChoice" onchange="javascript: podPress_updateCategoryCasting();">'."\n"; 950 962 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"; … … 952 964 echo ' </select>'."\n"; 953 965 echo ' <div id="rss_copyrightWrapper" style="display: none;">'."\n"; 954 966 echo ' <input type="text" name="rss_copyright" size="40" id="rss_copyright" value="'.htmlentities(stripslashes($data['rss_copyright']), ENT_QUOTES, get_settings('blog_charset')).'" onchange="javascript: podPress_updateCategoryCasting();"/>'; 955 echo ' <br /> The copyright dates. For example: 2006-2007'."\n";967 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"; 956 968 echo ' <input type="hidden" id="global_rss_copyright" value="'.htmlentities(stripslashes($this->settings['rss_copyright']), ENT_QUOTES, get_settings('blog_charset')).'" />'."\n"; 957 969 echo ' </div>'."\n"; 958 970 echo ' <div id="rss_copyrightHelp" style="display: none;">'."\n"; 959 echo ' '.__('Used if this dates are different than the global copyright dates.', 'podpress')."\n";971 echo ' '.__('Used if this Copyright phrase should be different than the global copyright phrase.', 'podpress')."\n"; 960 972 echo ' </div>'."\n"; 973 974 echo ' <br /><br />'."\n"; 975 976 echo ' <label for="rss_license_urlChoice"><strong>'.__('URL to the full Copyright / license text', 'podpress').'</strong></label> <a href="javascript:void(null);" onclick="javascript: podPressShowHideRow(\'rss_license_urlHelp\');">(?)</a>:'."\n"; 977 echo ' <br/>'; 978 echo ' <select id="rss_license_urlChoice" name="rss_license_urlChoice" onchange="javascript: podPress_updateCategoryCasting();">'."\n"; 979 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"; 980 echo ' <option value="Custom" '; if($data['rss_license_urlChoice'] == 'Custom') { echo 'selected="selected"'; } echo '>'.__('Custom', 'podpress').'</option>'."\n"; 981 echo ' </select>'."\n"; 982 echo ' <div id="rss_license_urlWrapper" style="display: none;">'."\n"; 983 echo ' <input name="rss_license_url" type="text" id="rss_license_url" value="'.htmlentities($data['rss_license_url'], ENT_QUOTES, get_settings('blog_charset')).'" size="65%" />'."\n"; 984 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"; 985 echo ' <input type="hidden" id="global_rss_license_url" value="'.htmlentities(stripslashes($this->settings['rss_license_url']), ENT_QUOTES, get_settings('blog_charset')).'" />'."\n"; 986 echo ' </div>'."\n"; 987 echo ' <div id="rss_license_urlHelp" style="display: none;">'."\n"; 988 echo ' '.__('Used if this license URL should be different than the global license URL.', 'podpress')."\n"; 989 echo ' </div>'."\n"; 990 991 961 992 echo ' </td>'."\n"; 962 993 echo ' </tr>'."\n"; 963 994 … … 1022 1053 $data['rss_image'] = $_POST['rss_image']; 1023 1054 $data['rss_copyrightChoice'] = $_POST['rss_copyrightChoice']; 1024 1055 $data['rss_copyright'] = $_POST['rss_copyright']; 1056 $data['rss_license_url'] = $_POST['rss_license_url']; 1057 $data['rss_license_urlChoice'] = $_POST['rss_license_urlChoice']; 1025 1058 $data['iTunesCategory'] = $_POST['iTunesCategory']; 1026 1059 1027 1060 delete_option('podPress_category_'.$cat_ID); -
podpress_admin_feed_class.php
223 223 echo ' <br/>'.__('Sets the parental advisory graphic in name column.', 'podpress')."\n"; 224 224 echo ' </td>'."\n"; 225 225 echo ' <td width="50%">'."\n"; 226 echo ' <label for="rss_copyright"><strong>'.__(' RSS Copyright', 'podpress').'</strong></label>';226 echo ' <label for="rss_copyright"><strong>'.__('Feed Copyright / license name', 'podpress').'</strong></label>'; 227 227 echo ' <br/>'; 228 echo ' <input name="rss_copyright" type="text" id="rss_copyright" value="'.htmlentities($this->settings['rss_copyright'], ENT_QUOTES, get_settings('blog_charset')).'" size="25%" />'."\n"; 229 echo ' <br />The copyright dates. For example: 2006-2007'."\n"; 228 echo ' <input name="rss_copyright" type="text" id="rss_copyright" value="'.htmlentities($this->settings['rss_copyright'], ENT_QUOTES, get_settings('blog_charset')).'" size="65%" />'."\n"; 229 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"; 230 231 echo ' <br /><br />'."\n"; 232 echo ' <label for="rss_license_url"><strong>'.__('URL to the full Copyright / license text', 'podpress').'</strong></label>'; 233 echo ' <br/>'; 234 echo ' <input name="rss_license_url" type="text" id="rss_license_url" value="'.htmlentities($this->settings['rss_license_url'], ENT_QUOTES, get_settings('blog_charset')).'" size="65%" />'."\n"; 235 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"; 236 230 237 echo ' </td>'."\n"; 231 238 echo ' </tr>'."\n"; 232 239 … … 263 270 echo ' <td width="50%">'; 264 271 echo ' <label for="blog_charset"><strong>'.__('Encoding for pages and feeds', 'podpress').'</strong></label>'; 265 272 echo ' <br/>'; 266 echo ' <input type="text" id="blog_charset" name="blog_charset" size="20" value="'.htmlentities(get_option('blog_charset'), ENT_QUOTES, get_settings('blog_charset')).'" /><br />'.__('The character encoding you write your blog in', 'podpress').' ('.__('UTF-8 is', 'podpress').'<a href="http://developer.apple.com/documentation/macos8/TextIntlSvcs/TextEncodingConversionManager/TEC1.5/TEC.b0.html" target="_new">'.__('recommended', 'podpress').'</a>)';273 echo ' <input type="text" id="blog_charset" name="blog_charset" size="20" value="'.htmlentities(get_option('blog_charset'), ENT_QUOTES, get_settings('blog_charset')).'" /><br />'.__('The character encoding you write your blog in', 'podpress').' ('.__('UTF-8 is', 'podpress').' <a href="http://developer.apple.com/documentation/macos8/TextIntlSvcs/TextEncodingConversionManager/TEC1.5/TEC.b0.html" target="_new">'.__('recommended', 'podpress').'</a>)'; 267 274 echo ' </td>'."\n"; 268 275 echo ' </tr>'."\n"; 269 276 … … 329 336 if(isset($_POST['rss_copyright'])) { 330 337 $this->settings['rss_copyright'] = $_POST['rss_copyright']; 331 338 } 339 if(isset($_POST['rss_license_url'])) { 340 $this->settings['rss_license_url'] = clean_url($_POST['rss_license_url'], array('http', 'https'), 'db'); 341 } 332 342 if(isset($_POST['rss_showlinks'])) { 333 343 $this->settings['rss_showlinks'] = $_POST['rss_showlinks']; 334 344 } -
podpress_feed_functions.php
106 106 if($podPress->settings['category_data']['rss_copyrightChoice'] == 'Custom') { 107 107 $data['rss_copyright'] = $podPress->settings['category_data']['rss_copyright']; 108 108 } 109 if($podPress->settings['category_data']['rss_rss_license_urlChoice'] == 'Custom') { 110 $data['rss_copyright'] = $podPress->settings['category_data']['rss_license_url']; 111 } 112 } else { 113 $data['rss_copyright'] = $podPress->settings['rss_copyright']; 114 if (0 < strlen($podPress->settings['iTunesAuthor'])) { 115 $data['author'] = $podPress->settings['iTunesAuthor']; 116 } else { 117 $data['author'] = get_option('blogname'); 118 } 109 119 } 110 120 if (TRUE == empty($podPress->settings['rss_category'])) { 121 $rss_category = 'posts'; 122 } else { 123 $rss_category = $podPress->settings['rss_category']; 124 } 125 111 126 $data['rss_ttl'] = get_option('rss_ttl'); 112 127 if(!empty($data['rss_ttl']) && $data['rss_ttl'] < 1440) { 113 128 $data['rss_ttl'] = 1440; 114 129 } 115 130 echo ' <!-- podcast_generator="podPress/'.PODPRESS_VERSION.'" -->'."\n"; 116 echo ' <copyright>©'.podPress_feedSafeContent($data['author']).' '.podPress_feedSafeContent($data['rss_copyright']).'</copyright>'."\n"; 131 if (empty($data['rss_copyright'])) { 132 echo ' <copyright>'.__('Copyright', 'podpress').' '.get_bloginfo('blogname').' '. date('Y',time()).' '.$podPress->settings['rss_license_url'].'</copyright>'."\n"; 133 } else { 134 echo ' <copyright>'.podPress_feedSafeContent($data['rss_copyright']).' '.$podPress->settings['rss_license_url'].'</copyright>'."\n"; 135 } 117 136 if($data['new-feed-url'] == 'Enable') { 118 137 if(!empty($data['podcastFeedURL']) && !strpos(strtolower($data['podcastFeedURL']), 'phobos.apple.com') && !strpos(strtolower($data['podcastFeedURL']), 'itpc://')) { 119 138 echo ' <itunes:new-feed-url>'.podPress_feedSafeContent($data['podcastFeedURL']).'</itunes:new-feed-url>'."\n"; 120 139 } 121 140 } 122 echo ' <managingEditor>'.podPress_feedSafeContent(stripslashes(get_option('admin_email'))).' ('.podPress_feedSafeContent($ podPress->settings['iTunes']['author']).')</managingEditor>'."\n";123 echo ' <webMaster>'.podPress_feedSafeContent(get_option('admin_email')).' ('.podPress_feedSafeContent($data['author']).')</webMaster>'."\n";124 echo ' <category>'.podPress_feedSafeContent($ podPress->settings['rss_category']).'</category>'."\n";141 echo ' <managingEditor>'.podPress_feedSafeContent(stripslashes(get_option('admin_email'))).' ('.podPress_feedSafeContent($data['author']).')</managingEditor>'."\n"; 142 echo ' <webMaster>'.podPress_feedSafeContent(get_option('admin_email')).' ('.podPress_feedSafeContent($data['author']).')</webMaster>'."\n"; 143 echo ' <category>'.podPress_feedSafeContent($rss_category).'</category>'."\n"; 125 144 if(!empty($data['rss_ttl'])) { 126 145 echo ' <ttl>'.$data['rss_ttl'].'</ttl>'."\n"; 127 146 } … … 154 173 $enclosureTag = podPress_getEnclosureTags(); 155 174 if($enclosureTag != '') // if no enclosure tag, no need for iTunes tags 156 175 { 157 echo ' '. $enclosureTag;176 echo "\t" . $enclosureTag; 158 177 159 178 if($post->podPressPostSpecific['itunes:subtitle'] == '##PostExcerpt##') { 160 179 ob_start(); … … 229 248 echo ' <itunes:block>'.podPress_feedSafeContent($post->podPressPostSpecific['itunes:block']).'</itunes:block>'."\n"; 230 249 //echo '<comments>'. get_comments_link() .'</comments>'."\n"; 231 250 } 251 $episodeLicenseTags = podPress_getEpisodeLicenseTags(); 252 if ($episodeLicenseTags != '') 253 { 254 echo "\t" . $episodeLicenseTags; 255 } 232 256 if(isset($post_meta_cache[$blog_id][$post->ID]['enclosure_podPressHold'])) { 233 257 $post_meta_cache[$blog_id][$post->ID]['enclosure'] = $post_meta_cache[$blog_id][$post->ID]['enclosure_podPressHold']; 234 258 unset($post_meta_cache[$blog_id][$post->ID]['enclosure_podPressHold']); 235 259 } 236 260 } 237 261 262 238 263 function podPress_atom_head() { 239 264 GLOBAL $podPress; 240 265 if(!isset($podPress->settings['category_data'])) { 241 266 podPress_feed_getCategory(); 242 267 } 243 echo '<!-- podcast_generator="podPress/'.PODPRESS_VERSION.'" -->'."\n";244 if ($podPress->settings['category_data']['categoryCasting'] == 'true' && $podPress->settings['category_data']['rss_imageChoice'] == 'Custom') {245 echo ' <icon>'.podPress_feedSafeContent($podPress->settings['category_data']['rss_image']).'</icon>'."\n";268 echo "\t".'<!-- podcast_generator="podPress/'.PODPRESS_VERSION.'" -->'."\n"; 269 if ($podPress->settings['category_data']['categoryCasting'] == 'true' && $podPress->settings['category_data']['rss_imageChoice'] == 'Custom') { 270 echo "\t".'<logo>'.podPress_feedSafeContent($podPress->settings['category_data']['rss_image']).'</logo>'."\n"; 246 271 } else { 247 echo ' <icon>'.podPress_feedSafeContent(get_option('rss_image')).'</icon>'."\n";272 echo "\t".'<logo>'.podPress_feedSafeContent(get_option('rss_image')).'</logo>'."\n"; 248 273 } 274 if ( !empty($podPress->settings['rss_copyright']) ) { 275 echo "\t".'<rights>'.$podPress->settings['rss_copyright'].'</rights>'."\n"; 276 } 277 if ( !empty($podPress->settings['rss_license_url']) ) { 278 echo "\t".'<link rel="license" type="text/html" href="'.$podPress->settings['rss_license_url'].'" />'."\n"; 279 } 249 280 } 250 281 251 282 function podPress_atom_entry() { 252 283 $enclosureTag = podPress_getEnclosureTags('atom'); 253 if ($enclosureTag != '') // if no enclosure tag, no need for iTunes tags284 if ($enclosureTag != '') // if no enclosure tag, no need for iTunes tags 254 285 { 255 echo ' '. $enclosureTag;286 echo "\t" . $enclosureTag; 256 287 } 288 $episodeLicenseTags = podPress_getEpisodeLicenseTags('atom'); 289 if ($episodeLicenseTags != '') 290 { 291 echo "\t" . $episodeLicenseTags; 292 } 257 293 } 258 294 259 295 function podPress_xspf_playlist() { 260 GLOBAL $ more, $posts, $m;261 header( "HTTP/1.0 200 OK");296 GLOBAL $podPress, $more, $posts, $post, $m; 297 header('HTTP/1.0 200 OK'); 262 298 header('Content-type: application/xspf+xml; charset=' . get_settings('blog_charset'), true); 299 header('Content-Disposition: attachment; filename="playlist.xspf"'); 263 300 $more = 1; 264 301 echo '<?xml version="1.0" encoding="'.get_settings('blog_charset').'" ?'.">\n"; 265 echo '<playlist version="0" xmlns="http://xspf.org/ns/0/">'."\n"; 266 echo " <title>"; bloginfo_rss('name'); echo "</title>\n"; 267 echo " <annotation></annotation>\n"; 268 echo " <creator>"; the_author(); echo "</creator>\n"; 269 echo " <location>"; bloginfo_rss('url'); echo "</location>\n"; 270 echo " <license>http://creativecommons.org/licenses/by-sa/1.0/</license>\n"; 271 echo " <trackList>\n"; 272 if ($posts) { 302 echo '<playlist version="1" xmlns="http://xspf.org/ns/0/">'."\n"; 303 echo "\t".'<title>'. get_bloginfo('blogname') . '</title>'."\n"; 304 echo "\t".'<annotation><![CDATA['. $podPress->settings['iTunes']['summary'].']]></annotation>'."\n"; 305 if (empty($podPress->settings['iTunes']['author'])) { 306 $creator = get_bloginfo('blogname'); 307 } else { 308 $creator = $podPress->settings['iTunes']['author']; 309 } 310 echo "\t".'<creator>'. $creator. '</creator>'."\n"; 311 echo "\t".'<location>'.get_feed_link('playlist.xspf').'</location>'."\n"; 312 if ( !empty($podPress->settings['rss_license_url']) ) { 313 echo "\t".'<license>'.$podPress->settings['rss_license_url'].'</license>'."\n"; 314 } 315 echo "\t".'<trackList>'."\n"; 316 if (isset($posts)) { 273 317 foreach ($posts as $post) { 274 start_wp(); 318 start_wp(); /* This is a call to a very very old function and it seems to be not necessary if $post is global. */ 275 319 $enclosureTag = podPress_getEnclosureTags('xspf'); 276 if ($enclosureTag != '') // if no enclosure tag, no need for track tags320 if ($enclosureTag != '') // if no enclosure tag, no need for track tags 277 321 { 278 echo " <track>\n";322 echo "\t\t".'<track>'."\n"; 279 323 echo $enclosureTag; 280 echo " </track>\n";324 echo "\t\t".'</track>'."\n"; 281 325 } 282 326 } 283 327 } 284 echo " </trackList>\n";285 echo "</playlist>\n";328 echo "\t".'</trackList>'."\n"; 329 echo '</playlist>'."\n"; 286 330 exit; 287 331 } 332 333 function podPress_getEpisodeLicenseTags($feedtype = 'rss2') { 334 GLOBAL $podPress, $post, $wpdb; 335 $result = ''; 336 $hasMediaFileAccessible = false; 337 if (is_array($post->podPressMedia)) { 338 $foundPreferred = false; 339 reset($post->podPressMedia); 340 while (list($key, $val) = each($post->podPressMedia)) { 341 // get the post_meta 342 $querystring = 'SELECT meta_key, meta_value FROM '.$wpdb->postmeta." WHERE post_id='".$post->ID."' and (meta_key='podcast_episode_license_url' or meta_key='podcast_episode_license_name')"; 343 $episode_license_infos = $wpdb->get_results($querystring); 344 $license = array(); 345 if ( 0 < count($episode_license_infos) ) { 346 foreach ($episode_license_infos as $episode_license_info) { 347 $license[$episode_license_info->meta_key] = $episode_license_info->meta_value; 348 } 349 } 350 if (TRUE == isset($license['podcast_episode_license_url'])) { 351 switch ($feedtype) { 352 case 'rss2' : 353 case 'rss' : 354 case 'rdf' : // license tags for entries with the help of the Dublin Core 355 if (TRUE == isset($license['podcast_episode_license_url']) AND FALSE == isset($license['podcast_episode_license_name'])) { 356 $result = "\t".'<dc:rights>'.$license['podcast_episode_license_url'].'</dc:rights>'."\n"; 357 } elseif (TRUE == isset($license['podcast_episode_license_name']) AND TRUE == isset($license['podcast_episode_license_name'])) { 358 $result = "\t".'<dc:rights>'.$license['podcast_episode_license_name'].' - '.$license['podcast_episode_license_url'].'</dc:rights>'."\n"; 359 } 360 break; 361 case 'atom' : // Atom License Extension - http://tools.ietf.org/html/rfc4946 362 if (TRUE == isset($license['podcast_episode_license_url']) AND FALSE == isset($license['podcast_episode_license_name'])) { 363 $result = "\t".'<rights>'.$license['podcast_episode_license_url'].'</rights>'."\n"; 364 $result .= "\t".'<link rel="license" type="text/html" href="'.$license['podcast_episode_license_url'].'" />'."\n"; 365 } elseif (TRUE == isset($license['podcast_episode_license_name']) AND TRUE == isset($license['podcast_episode_license_name'])) { 366 $result = "\t".'<rights>'.$license['podcast_episode_license_name'].'</rights>'."\n"; 367 $result .= "\t".'<link rel="license" type="text/html" href="'.$license['podcast_episode_license_url'].'" />'."\n"; 368 } 369 break; 370 default : // no entry license tags for all other feed types like xspf 371 $result = ''; 372 break; 373 } 374 } 375 } 376 } 377 return $result; 378 } 288 379 380 289 381 function podPress_getEnclosureTags($feedtype = 'rss2') { 290 382 GLOBAL $podPress, $post; 291 383 $result = ''; 292 384 $hasMediaFileAccessible = false; 385 $same_enclosure_URL_in_postmeta_exists = false; 293 386 if(is_array($post->podPressMedia)) { 294 387 $foundPreferred = false; 295 388 reset($post->podPressMedia); … … 314 407 if(isset($_GET['format']) && $_GET['format'] == $post->podPressMedia[$key]['ext']) { 315 408 $preferredFormat = true; 316 409 } 317 if ($post->podPressMedia[$key]['rss'] == 'on' || $post->podPressMedia[$key]['atom'] == 'on' || $preferredFormat == true) {318 if ($feedtype == 'atom' && $post->podPressMedia[$key]['atom'] == 'on') {410 if ($post->podPressMedia[$key]['rss'] == 'on' || $post->podPressMedia[$key]['atom'] == 'on' || $preferredFormat == true) { 411 if ($feedtype == 'atom' && $post->podPressMedia[$key]['atom'] == 'on') { 319 412 $post->podPressMedia[$key]['URI'] = $podPress->convertPodcastFileNameToWebPath($post->ID, $key, $post->podPressMedia[$key]['URI'], 'feed'); 320 $result .= '<link rel="enclosure" type="'.$post->podPressMedia[$key]['mimetype'].'" href="'.$post->podPressMedia[$key]['URI'].'" length="'.$post->podPressMedia[$key]['size'].'" />'."\n"; 321 } elseif($feedtype == 'xspf') { 413 global $wp_version; 414 if (TRUE == version_compare('2.3', $wp_version,'<=')) { // only if it is a newer WP version (when the ATOM feed template of WP is used) 415 // check if the URL is stored in postmeta as an enclosure (This is for the case that the wp ATOM template is in use) 416 // TRUE: don't put the same enclosure tag into the feed (WP includes the postmeta enclosures since WP 1.5 viw rss_enlosure) 417 // FALSE: ok, put the enclosure tag with the data from podPressMedia into the feed 418 $same_enclosure_URL_in_postmeta_exists = podPress_meta_data_enclosure_exists($post->ID, $post->podPressMedia[$key]['URI']); 419 } 420 if ( FALSE === $same_enclosure_URL_in_postmeta_exists ) { 421 $result .= '<link rel="enclosure" type="'.$post->podPressMedia[$key]['mimetype'].'" href="'.$post->podPressMedia[$key]['URI'].'" length="'.$post->podPressMedia[$key]['size'].'" />'."\n"; 422 } 423 } elseif ($feedtype == 'xspf') { 322 424 $post->podPressMedia[$key]['URI'] = $podPress->convertPodcastFileNameToValidWebPath($post->podPressMedia[$key]['URI']); 323 if (podPress_getFileExt($post->podPressMedia[$key]['URI']) == 'mp3') {324 $result .= '<location>'.$post->podPressMedia[$key]['URI']."</location>\n";425 if (podPress_getFileExt($post->podPressMedia[$key]['URI']) == 'mp3') { 426 $result .= "\t"."\t"."\t".'<location>'.$post->podPressMedia[$key]['URI']."</location>\n"; 325 427 if(!empty($post->podPressMedia[$key]['title'])) { 326 $result .= '<annotation>'.podPress_feedSafeContent($post->podPressMedia[$key]['title'])."</annotation>\n";327 $result .= '<title>'.podPress_feedSafeContent($post->podPressMedia[$key]['title'])."</title>\n";428 $result .= "\t"."\t"."\t".'<annotation>'.podPress_feedSafeContent($post->podPressMedia[$key]['title'])."</annotation>\n"; 429 $result .= "\t"."\t"."\t".'<title>'.podPress_feedSafeContent($post->podPressMedia[$key]['title'])."</title>\n"; 328 430 } else { 329 $result .= '<annotation>'.podPress_feedSafeContent($post->post_title)."</annotation>\n";330 $result .= '<title>'.podPress_feedSafeContent($post->post_title)."</title>\n";431 $result .= "\t"."\t"."\t".'<annotation>'.podPress_feedSafeContent($post->post_title)."</annotation>\n"; 432 $result .= "\t"."\t"."\t".'<title>'.podPress_feedSafeContent($post->post_title)."</title>\n"; 331 433 } 434 if ( '##Global##' == $post->podPressPostSpecific['itunes:author']) { 435 if (empty($podPress->settings['iTunes']['author'])) { 436 $creator = get_bloginfo('blogname'); 437 } else { 438 $creator = $podPress->settings['iTunes']['author']; 439 } 440 $result .= "\t"."\t"."\t".'<creator>'.$creator.'</creator>'."\n"; 441 } else { 442 $result .= "\t"."\t"."\t".'<creator>'.$post->podPressPostSpecific['itunes:author'].'</creator>'."\n"; 443 } 444 if ( 'UNKNOWN' != $post->podPressMedia[$key]['duration']) { 445 $result .= "\t"."\t"."\t".'<duration>'.$post->podPressMedia[$key]['duration'].'</duration>'."\n"; 446 } 332 447 if(!empty($post->podPressMedia[$key]['previewImage'])) { 333 $result .= '<image>'.$post->podPressMedia[$key]['previewImage']."</image>\n";448 $result .= "\t"."\t"."\t".'<image>'.$post->podPressMedia[$key]['previewImage']."</image>\n"; 334 449 } 335 }336 } elseif ($feedtype == 'rss2') {337 $post->podPressMedia[$key]['URI'] = $podPress->convertPodcastFileNameToWebPath($post->ID, $key, $post->podPressMedia[$key]['URI'], 'feed');450 } 451 } elseif ($feedtype == 'rss2') { 452 //$post->podPressMedia[$key]['URI'] = $podPress->convertPodcastFileNameToWebPath($post->ID, $key, $post->podPressMedia[$key]['URI'], 'feed'); 338 453 if(!isset($post->podPressMedia[$key]['duration']) || !preg_match("/([0-9]):([0-9])/", $post->podPressMedia[$key]['duration'])) { 339 454 $post->podPressMedia[$key]['duration'] = '00:01:01'; 340 455 } 341 456 $durationTag = '<itunes:duration>'.$post->podPressMedia[$key]['duration'].'</itunes:duration>'."\n"; 342 343 if($post->podPressMedia[$key]['rss'] == 'on') { 457 458 // check if the URL is stored in postmeta as an enclosure 459 // TRUE: don't put the same enclosure tag into the feed (WP includes the postmeta enclosures since WP 1.5 viw rss_enlosure) 460 // FALSE: ok, put the enclosure tag with the data from podPressMedia into the feed 461 $same_enclosure_URL_in_postmeta_exists = podPress_meta_data_enclosure_exists($post->ID, $post->podPressMedia[$key]['URI']); 462 463 if($post->podPressMedia[$key]['rss'] == 'on' AND FALSE === $same_enclosure_URL_in_postmeta_exists ) { 344 464 if(!$preferredFormat && $foundPreferred) { 345 465 continue; 346 466 } elseif($preferredFormat) { … … 348 468 } 349 469 $result = '<enclosure url="'.$post->podPressMedia[$key]['URI'].'" length="'.$post->podPressMedia[$key]['size'].'" type="'.$post->podPressMedia[$key]['mimetype'].'"/>'."\n"; 350 470 $result .= $durationTag; 351 } elseif($preferredFormat && !$foundPreferred ) {471 } elseif($preferredFormat && !$foundPreferred AND FALSE === $same_enclosure_URL_in_postmeta_exists) { 352 472 $result = '<enclosure url="'.$post->podPressMedia[$key]['URI'].'" length="'.$post->podPressMedia[$key]['size'].'" type="'.$post->podPressMedia[$key]['mimetype'].'"/>'."\n"; 353 473 $result .= $durationTag; 354 474 $foundPreferred = true; … … 357 477 } 358 478 } 359 479 } 360 if($hasMediaFileAccessible && $result == '' && $feedtype != 'xspf') { 361 echo "<!-- Media File exists for this post, but its not enabled for this feed -->\n"; 480 if ($hasMediaFileAccessible && $result == '' && $feedtype != 'xspf' ) { 481 if ( FALSE == $same_enclosure_URL_in_postmeta_exists ) { 482 echo "<!-- Media File exists for this post, but its not enabled for this feed -->\n"; 483 } 362 484 } 363 485 return $result; 364 486 } 487 488 function podPress_meta_data_enclosure_exists($post_id, $podPressMedia_enclosure_url='') { 489 if (empty($post_id) or empty($podPressMedia_enclosure_url)) { 490 return FALSE; 491 } 492 $exists = FALSE; 493 $enclosures = (Array) get_post_meta($post_id, 'enclosure', FALSE); 494 foreach ($enclosures as $enclosure) { 495 if ( FALSE !== stristr($enclosure, $podPressMedia_enclosure_url) ) { 496 $exists = TRUE; 497 } 498 } 499 return $exists; 500 } 365 501 366 502 function podPress_getiTunesCategoryTags() { 367 503 GLOBAL $podPress, $post; … … 506 642 } 507 643 } 508 644 } 509 645 510 646 function podPress_feedBlogName ($input) { 511 647 return podPress_getCategoryCastingFeedData('blogname', $input); 512 648 } -
podpress_functions.php
301 301 } 302 302 // Tell Dynamic Sidebar about our new widget and its control 303 303 register_sidebar_widget(array('Feed Buttons', 'widgets'), 'podPress_feedButtons'); 304 register_widget_control(array('Feed Buttons', 'widgets'), 'podPress_feedButtons_control' );305 304 register_widget_control(array('Feed Buttons', 'widgets'), 'podPress_feedButtons_control', 300, 200); 305 306 306 // Tell Dynamic Sidebar about our new widget and its control 307 307 register_sidebar_widget(array('XSPF Player', 'widgets'), 'podPress_xspfPlayer'); 308 register_widget_control(array('XSPF Player', 'widgets'), 'podPress_xspfPlayer_control' );308 register_widget_control(array('XSPF Player', 'widgets'), 'podPress_xspfPlayer_control', 300, 200); 309 309 } 310 310 311 311 function podPress_feedButtons_control() { … … 347 347 } 348 348 $title = htmlspecialchars($options['title'], ENT_QUOTES); 349 349 ?> 350 <p style="text-align: right;"><b> A podPress Widget</b></p>350 <p style="text-align: right;"><b><?php _e('A podPress Widget', 'podpress'); ?></b></p> 351 351 <p><label for="podPressFeedButtons-title"><?php _e('Title:'); ?> <input style="width: 250px;" id="podPressFeedButtons-title" name="podPressFeedButtons-title" type="text" value="<?php echo $title; ?>" /></label></p> 352 352 <?php 353 353 if($podPress->settings['podcastFeedURL'] != get_settings('rss2_url')) { 354 354 ?> 355 <p style="text-align:right;margin-right:40px;"><label for="podPressFeedButtons-blog"> Site Blog Feed<input class="checkbox" type="checkbox" <?php echo $blog; ?> id="podPressFeedButtons-blog" name="podPressFeedButtons-blog" /></label></p>355 <p style="text-align:right;margin-right:40px;"><label for="podPressFeedButtons-blog"><?php _e('Site Blog Feed', 'podpress'); ?> <input class="checkbox" type="checkbox" <?php echo $blog; ?> id="podPressFeedButtons-blog" name="podPressFeedButtons-blog" /></label></p> 356 356 <?php 357 357 } 358 358 ?> 359 <p style="text-align:right;margin-right:40px;"><label for="podPressFeedButtons-podcast"> Show Podcast Feed<input class="checkbox" type="checkbox" <?php echo $podcast; ?> id="podPressFeedButtons-podcast" name="podPressFeedButtons-podcast" /></label></p>359 <p style="text-align:right;margin-right:40px;"><label for="podPressFeedButtons-podcast"><?php _e('Show Podcast Feed', 'podpress'); ?> <input class="checkbox" type="checkbox" <?php echo $podcast; ?> id="podPressFeedButtons-podcast" name="podPressFeedButtons-podcast" /></label></p> 360 360 361 <p style="text-align:right;margin-right:40px;"><label for="podPressFeedButtons-itunes"> Show iTunes Music Store<input class="checkbox" type="checkbox" <?php echo $itunes; ?> id="podPressFeedButtons-itunes" name="podPressFeedButtons-itunes" /></label></p>362 <p style="text-align:right;margin-right:40px;"><label for="podPressFeedButtons-iprot"> Use Itunes protcol for URL<input class="checkbox" type="checkbox" <?php echo $iprot; ?> id="podPressItunesProtocol-iprot" name="podPressItunesProtocol-iprot" /></label></p>361 <p style="text-align:right;margin-right:40px;"><label for="podPressFeedButtons-itunes"><?php _e('Show iTunes Music Store', 'podpress'); ?> <input class="checkbox" type="checkbox" <?php echo $itunes; ?> id="podPressFeedButtons-itunes" name="podPressFeedButtons-itunes" /></label></p> 362 <p style="text-align:right;margin-right:40px;"><label for="podPressFeedButtons-iprot"><?php _e('Use Itunes protcol for URL', 'podpress'); ?> <input class="checkbox" type="checkbox" <?php echo $iprot; ?> id="podPressItunesProtocol-iprot" name="podPressItunesProtocol-iprot" /></label></p> 363 363 <input type="hidden" id="podPressFeedButtons-submit" name="podPressFeedButtons-submit" value="1" /> 364 364 <?php 365 365 } … … 423 423 } 424 424 $title = htmlspecialchars($options['title'], ENT_QUOTES); 425 425 ?> 426 <p style="text-align: right;"><b> A podPress Widget</b></p>426 <p style="text-align: right;"><b><?php _e('A podPress Widget', 'podpress'); ?></b></p> 427 427 <p><label for="podPressXspfPlayer-title"><?php _e('Title:'); ?> <input style="width: 250px;" id="podPressXspfPlayer-title" name="podPressXspfPlayer-title" type="text" value="<?php echo $title; ?>" /></label></p> 428 <p style="text-align:right;margin-right:40px;"><label for="podPressXspfPlayer-useSlimPlayer"> Use Slim Player<input class="checkbox" type="checkbox" <?php echo $useSlimPlayer; ?> id="podPressXspfPlayer-useSlimPlayer" name="podPressXspfPlayer-useSlimPlayer" /></label></p>428 <p style="text-align:right;margin-right:40px;"><label for="podPressXspfPlayer-useSlimPlayer"><?php _e('Use Slim Player', 'podpress'); ?> <input class="checkbox" type="checkbox" <?php echo $useSlimPlayer; ?> id="podPressXspfPlayer-useSlimPlayer" name="podPressXspfPlayer-useSlimPlayer" /></label></p> 429 429 <input type="hidden" id="podPressXspfPlayer-submit" name="podPressXspfPlayer-submit" value="1" /> 430 430 <?php 431 431 } … … 447 447 448 448 if($options['useSlimPlayer']) { 449 449 echo '<object type="application/x-shockwave-flash" width="150" height="170" '; 450 echo 'data="'.podPress_url().'players/xspf_player_slim.swf?playlist_url='.get_settings('siteurl').'/playlist.xspf">'."\n"; 451 echo ' <param name="movie" value="'.podPress_url().'players/xspf_player_slim.swf?playlist_url='.get_settings('siteurl').'/playlist.xspf" />'."\n"; 450 //echo 'data="'.podPress_url().'players/xspf_player_slim.swf?playlist_url='.get_settings('siteurl').'/playlist.xspf">'."\n"; 451 echo 'data="'.podPress_url().'players/xspf_player_slim.swf?playlist_url='.get_feed_link('playlist.xspf').'">'."\n"; 452 //echo ' <param name="movie" value="'.podPress_url().'players/xspf_player_slim.swf?playlist_url='.get_settings('siteurl').'/playlist.xspf" />'."\n"; 453 echo ' <param name="movie" value="'.podPress_url().'players/xspf_player_slim.swf?playlist_url='.get_feed_link('playlist.xspf').'" />'."\n"; 452 454 echo '</object>'."\n"; 453 455 } else { 454 456 echo '<object type="application/x-shockwave-flash" width="150" height="170" '; 455 echo 'data="'.podPress_url().'players/xspf_player.swf?playlist_url='.get_settings('siteurl').'/playlist.xspf">'."\n"; 456 echo ' <param name="movie" value="'.podPress_url().'players/xspf_player.swf?playlist_url='.get_settings('siteurl').'/playlist.xspf" />'."\n"; 457 //echo 'data="'.podPress_url().'players/xspf_player.swf?playlist_url='.get_settings('siteurl').'/playlist.xspf">'."\n"; 458 echo 'data="'.podPress_url().'players/xspf_player.swf?playlist_url='.get_feed_link('playlist.xspf').'">'."\n"; 459 //echo ' <param name="movie" value="'.podPress_url().'players/xspf_player.swf?playlist_url='.get_settings('siteurl').'/playlist.xspf" />'."\n"; 460 echo ' <param name="movie" value="'.podPress_url().'players/xspf_player.swf?playlist_url='.get_feed_link('playlist.xspf').'" />'."\n"; 457 461 echo '</object>'."\n"; 458 462 } 459 463 echo $after_widget; … … 917 921 if (@$client->fetch('http://www.mightyseek.com/podpress_downloads/versioncheck.php?url='.get_settings('siteurl').'¤t='.PODPRESS_VERSION) === false) { 918 922 return -1; 919 923 } else { 920 $remote = $client->results;921 if (!$remote || strlen($remote) > 8 ) {924 $remote = $client->results; 925 if (!$remote || strlen($remote) > 8 ) { 922 926 return -1; 923 927 } 924 928 $current = $remote; -
wp-atom1.php
6 6 wp('feed=atom'); 7 7 } 8 8 9 //header('Content-type: text/xml; charset=' . get_settings('blog_charset'), true);10 9 header('Content-type: application/atom+xml; charset=' . get_settings('blog_charset'), true); 11 10 $more = 1; 12 11 13 12 echo '<?xml version="1.0" encoding="' . get_settings('blog_charset') . '"?' . '>'; ?> 14 13 <feed 15 14 xmlns="http://www.w3.org/2005/Atom" 16 xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"17 15 xmlns:dc="http://purl.org/dc/elements/1.1/" 18 16 xmlns:thr="http://purl.org/syndication/thread/1.0" 19 17 xml:lang="<?php echo get_option('rss_language'); ?>" … … 26 24 <link rel="alternate" type="text/html" hreflang="<?php echo get_option('rss_language'); ?>" href="<?php bloginfo_rss('home') ?>" /> 27 25 <subtitle type="text"><?php bloginfo_rss("description") ?></subtitle> 28 26 <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT')); ?></updated> 29 <rights>Copyright <?php echo mysql2date('Y', get_lastpostdate('gmt'), false); ?> <?php bloginfo_rss('name') ?></rights> 30 <creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/</creativeCommons:license> 27 31 28 <generator uri="http://wordpress.org/" version="<?php bloginfo_rss('version'); ?>">WordPress</generator> 32 29 <author> 33 30 <name><?php bloginfo_rss('name'); ?></name> 34 31 <uri><?php bloginfo_rss('siteurl'); ?></uri> 35 32 </author> 33 <?php ######### The rights tag and other license information for this feed will be inserted via 'atom_head' action. ######### ?> 36 34 <?php do_action('atom_head'); ?> 37 35 <?php $items_count = 0; if ($posts) { foreach ($posts as $post) { start_wp(); ?> 38 36 <entry> … … 46 44 </author> 47 45 <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', $post->post_modified_gmt, false); ?></updated> 48 46 <published><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></published> 49 <?php the_category_rss('rdf') ?> 50 <rights>Copyright <?php echo get_post_time('Y', true); ?> <?php the_author() ?></rights> 51 <creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/</creativeCommons:license> 47 <?php the_category_rss('atom') ?> 52 48 <summary type="<?php html_type_rss(); ?>"> 53 <![CDATA[<?php the_excerpt_rss(); ?><br /><br />(<a href="<?php comments_link(); ?>"><?php echo __('Comments');?></a>)]]>49 <![CDATA[<?php the_excerpt_rss(); ?><br /><br />(<a href="<?php comments_link(); ?>"><?php echo __('Comments');?></a>)]]> 54 50 </summary> 55 51 <?php if ( !get_settings('rss_use_excerpt') ) : ?> 56 52 <content type="<?php html_type_rss(); ?>" xml:base="<?php the_permalink_rss() ?>"> 57 <![CDATA[<?php the_content('', 0, '') ?><br /><br />(<a href="<?php comments_link(); ?>"><?php echo __('Comments');?></a>)]]>53 <![CDATA[<?php the_content('', 0, '') ?><br /><br />(<a href="<?php comments_link(); ?>"><?php echo __('Comments');?></a>)]]> 58 54 </content> 59 55 <?php endif; ?> 60 <?php rss_enclosure();?>56 <?php ######### The rights tag and other license information for podcast episode will be inserted via 'atom_head' action. ######### ?> 61 57 <?php do_action('atom_entry'); ?> 62 58 </entry> 63 59 <?php $items_count++; if (($items_count == get_settings('posts_per_rss')) && empty($m)) { break; } } } ?> 64 </feed> 60 </feed> 61 No newline at end of file
