Changeset 2621622
- Timestamp:
- 10/28/2021 08:39:07 PM (4 years ago)
- Location:
- mondoplayer/trunk
- Files:
-
- 6 edited
-
includes/class_mondoplayer_categories.php (modified) (6 diffs)
-
includes/class_mondoplayer_forms.php (modified) (1 diff)
-
includes/class_mondoplayer_options.php (modified) (4 diffs)
-
includes/class_mondoplayer_post.php (modified) (2 diffs)
-
js/web_player_v2.js (modified) (4 diffs)
-
mondoplayer.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mondoplayer/trunk/includes/class_mondoplayer_categories.php
r2607254 r2621622 87 87 if (isset($_POST['category_top_content'])) { 88 88 update_term_meta($term_id, "category_top_content", $_POST['category_top_content'] ); 89 } 90 if (isset($_POST['category_rss_message'])) { 91 update_term_meta($term_id, "category_rss_message", $_POST['category_rss_message'] ); 89 92 } 90 93 if (isset($_POST['category_bottom_content'])) { … … 237 240 $category_url = ""; 238 241 $feed_url = ""; 242 $rss_message = "🎥 Link in Profile for Video"; 239 243 $category_title = "Categories"; 240 244 $category_top_content = ""; … … 328 332 $category_top_content = $category_meta['category_top_content'][0]; 329 333 } 334 if (isset($category_meta['category_rss_message'][0])) { 335 $rss_message = $category_meta['category_rss_message'][0]; 336 } 330 337 if (isset($category_meta['category_bottom_content'][0])) { 331 338 $category_bottom_content = $category_meta['category_bottom_content'][0]; … … 465 472 .order_arrow:hover { 466 473 color: #999; 474 } 475 .abridged_feed { 476 display: none; 477 } 478 #abridged_button { 479 color: white; 480 background-color: #141414; 481 padding: 4px 12px; 482 font-size: 16px; 483 cursor: pointer; 484 transition: all 0.25s; 485 text-align: center; 486 } 487 #abridged_button:hover { 488 background-color: #999; 467 489 } 468 490 </style> … … 802 824 window.location = "/wp-admin/admin.php?page=mondoplayer_menu_categories_slug&sort_direction=" + direction + "&sort_category=" + category; 803 825 } 804 826 function toggle_abridged() { 827 var rows = document.querySelectorAll(".abridged_feed"); 828 if (rows[0].style.display != "table-row") { 829 for (var i = 0; i < rows.length; i++) { 830 rows[i].style.display = "table-row" 831 } 832 } else { 833 for (var i = 0; i < rows.length; i++) { 834 rows[i].style.display = "none" 835 } 836 } 837 } 805 838 </script> 806 839 <div id="categories_page" style='margin-right: 8px'> … … 904 937 ?> 905 938 <table id='category_urls_wrap' style='width: 100%;margin-top:4px;display: <?php echo $category_urls_wrap ?>' cellspacing='0' cellpadding='0'> 906 <tr><td class='label_column' style='border: 0'>Category Vlog Roll</td><td class='content_column' style='border: 0;vertical-align: middle'><div class='category_description'><div style='display: inline-block;' id='category_blog_url'><a href='<?php echo $category_url ?>' target="_blank"><?php echo $category_url ?></a></div><p>Use this RSS Feed to add add this Category to a Menu or Link on your site</p></div></td></tr> 907 <tr><td class='label_column' style='border: 0'>Category RSS Feed</td><td class='content_column' style='border: 0;vertical-align: middle'><div class='category_description'><div style='display: inline-block;' id='category_rss_feed'><a href='<?php echo $feed_url ?>' target="_blank"><?php echo $feed_url ?></a></div><p>Use this RSS Feed to automatically post (without hashtags) to social media with tools like dlvr.it</p><span id='autopilot_category_message'></span></div></td></tr> 908 <tr><td class='label_column' style='border: 0'>Category RSS Feed with Hashtags in Description</td><td class='content_column' style='border: 0;vertical-align: middle'><div class='category_description'><div style='display: inline-block;' id='category_rss_feed'><a href='<?php echo $feed_url ?>?hashtags_with_description' target="_blank"><?php echo $feed_url ?>?hashtags_with_description</a></div><p>Use this RSS Feed to automatically post to social media with tools like dlvr.it on services like Pinterest</p><span id='autopilot_hashtag_message'></span></div></td></tr> 939 <tr><td class='label_column' style='border: 0'>Category Vlog Roll</td><td class='content_column' style='border: 0;vertical-align: middle'><div class='category_description'><div style='display: inline-block;' id='category_blog_url'><a href='<?php echo $category_url ?>' target="_blank"><?php echo $category_url ?></a></div><p>Use this URL to add add this Category to a Menu or Link on your site</p></div></td></tr> 940 <tr><td class='label_column' style='border: 0'>Category RSS Feed</td><td class='content_column' style='border: 0;vertical-align: middle'><div class='category_description'><div style='display: inline-block;' id='category_rss_feed'><a href='<?php echo $feed_url ?>' target="_blank"><?php echo $feed_url ?></a></div><p>Use this RSS Feed to automatically post (without hashtags) to social media with tools like dlvr.it </p><span id='autopilot_category_message'></span></div></td></tr> 941 <tr><td class='label_column' style='border: 0'>Category RSS Feed with Prepend Text</td><td class='content_column' style='border: 0;vertical-align: middle'><div class='category_description'><div style='display: inline-block;' id='category_rss_feed'><a href='<?php echo $feed_url ?>?rss_message' target="_blank"><?php echo $feed_url ?>?rss_message</a></div><div style='margin-top: 10px'><input type='text' style='width: 500px' placeholder='Enter text to include at top of posts' id='category_rss_message' value='<?php echo $rss_message ?>' name='category_rss_message' /></div><p>Use this RSS Feed to automatically post to social media with tools like dlvr.it on services like Instagram</p></div></td></tr> 942 <tr><td class='label_column' style='border: 0'>Category RSS Feed with Hashtags in Description</td><td class='content_column' style='border: 0;vertical-align: middle'><div class='category_description'><div style='display: inline-block;' id='category_rss_feed'><a href='<?php echo $feed_url ?>?hashtags_with_description' target="_blank"><?php echo $feed_url ?>?hashtags_with_description</a></div><p>Use this RSS Feed to automatically post to social media with tools like dlvr.it on services like Pinterest</p></div></td></tr> 909 943 <tr><td class='label_column' style='border: 0'>Category RSS Feed with Hashtags</td><td class='content_column' style='border: 0;vertical-align: middle'><div class='category_description'><div style='display: inline-block;' id='category_rss_feed'><a href='<?php echo $feed_url ?>?hashtags' target="_blank"><?php echo $feed_url ?>?hashtags</a></div><p>Use this RSS Feed to automatically post to social media with tools like dlvr.it on services like Facebook, LinkedIn and Twitter</p><span id='autopilot_hashtag_message'></span></div></td></tr> 910 944 <tr><td style='border: 0' colspan='2'><div id='abridged_button' onclick='toggle_abridged();'>Abridged RSS Feeds</div></td></tr> 945 <tr class='abridged_feed'><td class='label_column' colspan="2" style="border: 0;padding: 24px 8px;text-align: center">These feeds only contain the 2 most popular posts from the past day.</td></tr> 946 <tr class='abridged_feed'><td class='label_column' >Category RSS Feed</td><td class='content_column' style='vertical-align: middle;'><div class='category_description'><div style='display: inline-block;' id='category_rss_feed'><a href='<?php echo $feed_url ?>?abridged' target="_blank"><?php echo $feed_url ?>?abridged</a></div><p>Use this RSS Feed to automatically post (without hashtags) to social media with tools like dlvr.it </p><span id='autopilot_category_message'></span></div></td></tr> 947 <tr class='abridged_feed'><td class='label_column' style='border: 0'>Category RSS Feed with Prepend Text</td><td class='content_column' style='border: 0;vertical-align: middle'><div class='category_description'><div style='display: inline-block;' id='category_rss_feed'><a href='<?php echo $feed_url ?>?rss_message&abridged' target="_blank"><?php echo $feed_url ?>?rss_message&abridged</a></div><div style='margin-top: 10px'></div><p>Use this RSS Feed to automatically post to social media with tools like dlvr.it on services like Instagram</p></div></td></tr> 948 <tr class='abridged_feed'><td class='label_column' style='border: 0'>Category RSS Feed with Hashtags in Description</td><td class='content_column' style='border: 0;vertical-align: middle'><div class='category_description'><div style='display: inline-block;' id='category_rss_feed'><a href='<?php echo $feed_url ?>?hashtags_with_description&abridged' target="_blank"><?php echo $feed_url ?>?hashtags_with_description&abridged</a></div><p>Use this RSS Feed to automatically post to social media with tools like dlvr.it on services like Pinterest</p></div></td></tr> 949 <tr class='abridged_feed'><td class='label_column' style='border: 0'>Category RSS Feed with Hashtags</td><td class='content_column' style='border: 0;vertical-align: middle'><div class='category_description'><div style='display: inline-block;' id='category_rss_feed'><a href='<?php echo $feed_url ?>?hashtags&abridged' target="_blank"><?php echo $feed_url ?>?hashtags&abridged</a></div><p>Use this RSS Feed to automatically post to social media with tools like dlvr.it on services like Facebook, LinkedIn and Twitter</p></div></td></tr> 911 950 </table> 912 951 -
mondoplayer/trunk/includes/class_mondoplayer_forms.php
r2618790 r2621622 326 326 update_option('mondoplayer_delete_age',intval($_POST['mondoplayer_delete_age'])); 327 327 328 if (isset($_POST['mondoplayer_rss_message'])) { 329 error_log("Updating: " . $_POST['mondoplayer_rss_message']); 330 update_option('mondoplayer_rss_message', $_POST['mondoplayer_rss_message']); 331 } 332 328 333 if (isset($_POST['mondoplayer_trusted_domains'])) { 329 334 update_option('mondoplayer_trusted_domains',$_POST['mondoplayer_trusted_domains']); -
mondoplayer/trunk/includes/class_mondoplayer_options.php
r2593402 r2621622 36 36 $mondoplayer_delete_age = get_option('mondoplayer_delete_age', 90); 37 37 $uses_hashtags = 0; 38 $mondoplayer_rss_message = get_option('mondoplayer_rss_message', "🎥 Link in Profile for Video"); 38 39 39 40 ?> … … 185 186 } 186 187 188 function toggle_abridged() { 189 var rows = document.querySelectorAll(".abridged_feed"); 190 if (rows[0].style.display != "table-row") { 191 for (var i = 0; i < rows.length; i++) { 192 rows[i].style.display = "table-row" 193 } 194 } else { 195 for (var i = 0; i < rows.length; i++) { 196 rows[i].style.display = "none" 197 } 198 } 199 } 200 201 187 202 var license_key = "<?php echo addslashes($this->license_key) ?>"; 188 203 var admin_post_url = '<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>'; … … 242 257 margin-bottom: 12px; 243 258 } 259 .abridged_feed { 260 display: none; 261 } 262 #abridged_button { 263 color: white; 264 background-color: #141414; 265 padding: 4px 12px; 266 font-size: 16px; 267 cursor: pointer; 268 transition: all 0.25s; 269 text-align: center; 270 } 271 #abridged_button:hover { 272 background-color: #999; 273 } 244 274 </style> 245 246 275 <div id="options_page" class="right_sub_page right_panel_form"> 247 276 <h1>Account Setup</h1> … … 274 303 <tr><td class='label_column'>Submit a website for us to check for video</td><td class='content_column'><input type="button" class="form_submit_btn_light" value="Submit" onclick="open_submit_website()" style="width: 100px;margin:0" /></td></tr> 275 304 <tr><td class='label_column'>Clear Search History</td><td class='content_column'><input type="button" class="form_submit_btn_light" value="Clear" onclick="clear_history()" style="width: 100px;margin:0" /></td></tr> 276 <tr><td class='label_column'>Site RSS Feed</td><td class='content_column' style='vertical-align: middle'><div class='category_description'><div style='display: inline-block;' id='category_rss_feed'><a href='<?php echo get_feed_link('') ?>' target="_blank"><?php echo get_feed_link('') ?></a></div><p>Use this RSS Feed to automatically post to your social media management tools (e.g. Hootsuite).</p><span id='autopilot_category_message'></span></div></td></tr> 277 <tr><td class='label_column'>Site RSS Feed with Hashtags</td><td class='content_column' style='vertical-align: middle'><div class='category_description'><div style='display: inline-block;' id='category_rss_feed'><a href='<?php echo get_feed_link('') ?>?hashtags' target="_blank"><?php echo get_feed_link('') ?>?hashtags</a></div><p>Use this RSS Feed to automatically post to your social media management tools and include any AutoPilot hashtags.</p><span id='autopilot_hashtag_message'></span></div></td></tr> 305 <tr><td class='label_column'>Site RSS Feed</td><td class='content_column' style='vertical-align: middle'><div class='category_description'><div style='display: inline-block;' id='category_rss_feed'><a href='<?php echo get_feed_link('') ?>' target="_blank"><?php echo get_feed_link('') ?></a></div><p>Use this RSS Feed to automatically post (without hashtags) to social media with tools like dlvr.it</p><span id='autopilot_category_message'></span></div></td></tr> 306 <tr><td class='label_column' style='border: 0'>Site RSS Feed with Prepend Text</td><td class='content_column' style='border: 0;vertical-align: middle'><div class='category_description'><div style='display: inline-block;' id='category_rss_feed'><a href='<?php echo get_feed_link('') ?>?rss_message' target="_blank"><?php echo get_feed_link('') ?>?rss_message</a></div><div style='margin-top: 10px'><input type='text' style='width: 500px' placeholder='Enter text to include at top of posts' id='mondoplayer_rss_message' value='<?php echo $mondoplayer_rss_message ?>' name='mondoplayer_rss_message' /></div><p>Use this RSS Feed to automatically post to social media with tools like dlvr.it on services like Instagram</p></div></td></tr> 307 <tr><td class='label_column' style='border: 0'>Site RSS Feed with Hashtags in Description</td><td class='content_column' style='border: 0;vertical-align: middle'><div class='category_description'><div style='display: inline-block;' id='category_rss_feed'><a href='<?php echo get_feed_link('') ?>?hashtags_with_description' target="_blank"><?php echo get_feed_link('') ?>?hashtags_with_description</a></div><p>Use this RSS Feed to automatically post to social media with tools like dlvr.it on services like Pinterest</p></div></td></tr> 308 <tr><td class='label_column' style='border: 0'>Site RSS Feed with Hashtags</td><td class='content_column' style='vertical-align: middle;border: 0'><div class='category_description'><div style='display: inline-block;' id='category_rss_feed'><a href='<?php echo get_feed_link('') ?>?hashtags' target="_blank"><?php echo get_feed_link('') ?>?hashtags</a></div><p>Use this RSS Feed to automatically post to social media with tools like dlvr.it on services like Facebook, LinkedIn and Twitter</p><span id='autopilot_hashtag_message'></span></div></td></tr> 309 <tr><td style='border: 0;padding:0' colspan='2'><div id='abridged_button' onclick='toggle_abridged();'>Abridged RSS Feeds</div></td></tr> 310 <tr class='abridged_feed'><td class='label_column' colspan="2" style="border: 0;padding: 24px 8px;text-align: center">These feeds only contain the 2 most popular posts from the past day.</td></tr> 311 <tr class='abridged_feed'><td class='label_column' >Site RSS Feed</td><td class='content_column' style='vertical-align: middle;'><div class='category_description'><div style='display: inline-block;' id='category_rss_feed'><a href='<?php echo get_feed_link('') ?>?abridged' target="_blank"><?php echo get_feed_link('') ?>?abridged</a></div><p>Use this RSS Feed to automatically post (without hashtags) to social media with tools like dlvr.it </p><span id='autopilot_category_message'></span></div></td></tr> 312 <tr class='abridged_feed'><td class='label_column' style='border: 0'>Site RSS Feed with Prepend Text</td><td class='content_column' style='border: 0;vertical-align: middle'><div class='category_description'><div style='display: inline-block;' id='category_rss_feed'><a href='<?php echo get_feed_link('') ?>?rss_message&abridged' target="_blank"><?php echo get_feed_link('') ?>?rss_message&abridged</a></div><div style='margin-top: 10px'></div><p>Use this RSS Feed to automatically post to social media with tools like dlvr.it on services like Instagram</p></div></td></tr> 313 <tr class='abridged_feed'><td class='label_column' style='border: 0'>Site RSS Feed with Hashtags in Description</td><td class='content_column' style='border: 0;vertical-align: middle'><div class='category_description'><div style='display: inline-block;' id='category_rss_feed'><a href='<?php echo get_feed_link('') ?>?hashtags_with_description&abridged' target="_blank"><?php echo get_feed_link('') ?>?hashtags_with_description&abridged</a></div><p>Use this RSS Feed to automatically post to social media with tools like dlvr.it on services like Pinterest</p></div></td></tr> 314 <tr class='abridged_feed'><td class='label_column' style='border: 0'>Site RSS Feed with Hashtags</td><td class='content_column' style='border: 0;vertical-align: middle'><div class='category_description'><div style='display: inline-block;' id='category_rss_feed'><a href='<?php echo get_feed_link('') ?>?hashtags&abridged' target="_blank"><?php echo get_feed_link('') ?>?hashtags&abridged</a></div><p>Use this RSS Feed to automatically post to social media with tools like dlvr.it on services like Facebook, LinkedIn and Twitter</p></div></td></tr> 278 315 </table> 279 316 <div class="form_submit_btn-wrapper"><input type="button" class="form_submit_btn_light" value="Save" onclick="save_options()" style="margin: 0 10px;width: 200px" /><div id="options_error" class="form_field_error" style="margin-top: 10px"></div> -
mondoplayer/trunk/includes/class_mondoplayer_post.php
r2612244 r2621622 280 280 if (!isset($readability->content)) { 281 281 error_log("Error no content: " . $body); 282 $readability = array(282 $readability = (object) array( 283 283 'content' => "", 284 284 'description' => "", … … 545 545 } 546 546 547 if ( sizeof($images->featuredImages) > 0 ) {547 if (is_array($images->featuredImages) && sizeof($images->featuredImages) > 0 ) { 548 548 $upload_dir = wp_upload_dir(); 549 549 for ($i = 0; $i < sizeof($images->featuredImages); $i++ ) { -
mondoplayer/trunk/js/web_player_v2.js
r2618790 r2621622 4737 4737 state.options.onlyPostVideosWithThumbnails = 1; 4738 4738 } 4739 state.options.mondoplayer_rss_message = document.getElementById("mondoplayer_rss_message").value; 4739 4740 state.options.ignore_original_tags = 0; 4740 4741 if (document.getElementById("ignore_original_tags").checked) { … … 4788 4789 4789 4790 var requeststring = "id=" + license_key + "&playOnlyDuringWifi=" + state.options.playOnlyDuringWifi + "&playDuringRoaming=" + state.options.playDuringRoaming + "&onlyPostVideosWithThumbnails=" + state.options.onlyPostVideosWithThumbnails + "&ignore_original_tags=" + state.options.ignore_original_tags + "&emailFlag=" + state.options.emailFlag + "¬ification=" + state.options.notification + "&excluded_domains=" + encodeURIComponent(state.options.excluded_domains) + "&content_filters=" + encodeURIComponent(state.options.content_filters) + "&trusted_domains=" + encodeURIComponent(state.options.trusted_domains) + "&excluded_search_terms=" + encodeURIComponent(state.options.excluded_search_terms) + "&excluded_youtube=" + encodeURIComponent(state.options.excluded_youtube); 4790 4791 console.log("requeststring: " + requeststring); 4791 4792 var xmlhttp = new XMLHttpRequest(); 4792 4793 xmlhttp.open("POST", url, false); … … 4826 4827 } 4827 4828 } 4828 requeststring = "action=mondoplayer&form=options&mondoplayer_prepend=" + encodeURIComponent(JSON.stringify(prepend_combined)) + "&mondoplayer_append=" + encodeURIComponent(JSON.stringify(append_combined)) + "& ignore_original_tags=" + state.options.ignore_original_tags + "&mondoplayer_max_words=" + document.getElementById('mondoplayer_max_words').value + "&mondoplayer_delete_age=" + document.getElementById('mondoplayer_delete_age').value;4829 requeststring = "action=mondoplayer&form=options&mondoplayer_prepend=" + encodeURIComponent(JSON.stringify(prepend_combined)) + "&mondoplayer_append=" + encodeURIComponent(JSON.stringify(append_combined)) + "&mondoplayer_rss_message=" + encodeURIComponent(state.options.mondoplayer_rss_message) + "&ignore_original_tags=" + state.options.ignore_original_tags + "&mondoplayer_max_words=" + document.getElementById('mondoplayer_max_words').value + "&mondoplayer_delete_age=" + document.getElementById('mondoplayer_delete_age').value; 4829 4830 xmlhttp.open("POST", admin_post_url, true); 4830 4831 xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); … … 6347 6348 6348 6349 function hashtag_toggle(search, id) { 6349 if ( edit_search_hashtags[id].indexOf("|") != -1) {6350 if (typeof edit_search_hashtags[id] == "string" && edit_search_hashtags[id].indexOf("|") != -1) { 6350 6351 return; 6351 6352 } -
mondoplayer/trunk/mondoplayer.php
r2618790 r2621622 5 5 Description: Video Content Curation Plugin - automatically curate and share videos. Boost engagement on your website and in social media with compelling video. 6 6 Author: MondoTag 7 Version: 1.0.35 38 Tested up to: 5.7. 27 Version: 1.0.357 8 Tested up to: 5.7.3 9 9 License: GPLv2 or later 10 10 */ … … 60 60 61 61 add_action( 'pre_get_posts', array($this, 'filter_posts')); 62 add_filter( 'pre_get_posts', array($this, 'filter_abridged_rss'), 20 ); 62 63 add_action( 'posts_where', array($this, 'posts_where'), 10, 2); 63 64 add_filter( 'posts_orderby', array($this, 'filter_posts_orderby'), 10, 2); … … 187 188 global $db_version; 188 189 189 wp_register_style( $this->mondoplayer_plugin_slug, plugins_url("css/web_player.css",__FILE__), false, '1.0.5 2' );190 wp_register_script( $this->mondoplayer_plugin_slug, plugins_url("js/web_player_v2.js",__FILE__), false, '1.0.12 2' );190 wp_register_style( $this->mondoplayer_plugin_slug, plugins_url("css/web_player.css",__FILE__), false, '1.0.53' ); 191 wp_register_script( $this->mondoplayer_plugin_slug, plugins_url("js/web_player_v2.js",__FILE__), false, '1.0.125' ); 191 192 $db = get_option("mondoplayer_db_version", ''); 192 193 if ($db != $db_version) { … … 383 384 return $title; 384 385 } 386 if ($title['title'] == "") { 387 $title['title'] = "Full site"; 388 } 389 if (isset($_GET['abridged'])) { 390 $title['title'] .= " - abridged"; 391 } 392 385 393 if (isset($_GET['hashtags'])) { 386 394 $title['title'] .= " (hashtags with title)"; … … 392 400 return $title; 393 401 } 402 function filter_abridged_rss($query) { 403 #error_log("Filtering rss: " . $query->is_feed . " - " . $query->is_main_query() . " - " . isset($_GET['abridged'])); 404 if( $query->is_feed && $query->is_main_query() && isset($_GET['abridged'])) { 405 global $wpdb; 406 $posts = $wpdb->get_results("SELECT wp_posts.ID as ID from wp_posts, wp_postmeta WHERE wp_posts.ID = wp_postmeta.post_id AND wp_posts.post_type = 'post' AND wp_posts.post_date >= date_sub(NOW(), interval 36 hour) AND wp_posts.post_date < date_sub(NOW(), interval 6 hour) AND wp_postmeta.meta_key = 'mondoplayer_autopilot_id'"); 407 $post_sql = ""; 408 foreach ($posts as $post) { 409 $post_sql .= $post->ID . ","; 410 } 411 $abridged_posts = array(); 412 if ($post_sql != "") { 413 $category_id = get_query_var('cat', 0); 414 if ($category_id == 0) { 415 $abridged_posts = $wpdb->get_results("SELECT count(*) as count, post_id FROM wp_mondoplayer_ad_tracking WHERE post_id > 0 AND add_date > date_sub(now(), interval 36 hour) AND autopilot_id > 0 AND post_id IN (" . substr($post_sql, 0, -1) . ") group by post_id order by count desc limit 2"); 416 } else { 417 $abridged_posts = $wpdb->get_results("SELECT count(*) as count, post_id FROM wp_mondoplayer_ad_tracking WHERE post_id > 0 AND add_date > date_sub(now(), interval 36 hour) AND autopilot_id > 0 AND post_id IN (" . substr($post_sql, 0, -1) . ") AND category_id = $category_id group by post_id order by count desc limit 2", ARRAY_A); 418 } 419 if (is_wp_error($abridged_posts)) { 420 $error_message = $abridged_posts>get_error_message(); 421 error_log("Error selecting abridged posts " . $error_message); 422 return $query; 423 } 424 } 425 $post_ids = array(); 426 foreach ($abridged_posts as $post) { 427 $post_ids[] = $post->post_id; 428 } 429 if (empty($post_ids)) { 430 $query->set('post__in', array(-1)); 431 } else { 432 $query->set('post__in', $post_ids); 433 } 434 $query->set('orderby', 'post__in'); 435 } 436 return $query; 437 } 438 394 439 function filter_title_rss($title) { 395 440 #error_log("Filtering title: $title"); … … 410 455 function filter_excerpt_rss($excerpt) { 411 456 #error_log("Filtering title: $title"); 457 global $post; 458 if (isset($_GET['rss_message'])) { 459 $hashtags = get_post_meta($post->ID, 'mondoplayer_hashtags', true); 460 $terms = get_the_terms($post, 'category'); 461 $rss_message = get_option('mondoplayer_rss_message', "🎥 Link in Profile for Video"); 462 if ($terms) { 463 $test_message = get_term_meta($terms[0]->term_id, 'category_rss_message', true); 464 if ($test_message != "") { 465 $rss_message = $test_message; 466 } 467 } 468 if (! isset($_GET['hashtags_with_description'])) { 469 return $rss_message . " " . $hashtags . " " . $excerpt; 470 } else { 471 $excerpt = $rss_message . " " . $excerpt; 472 } 473 } 412 474 if (isset($_GET['hashtags_with_description'])) { 413 global $post;414 475 $hashtags = get_post_meta($post->ID, 'mondoplayer_hashtags', true); 415 476 if ($post->post_name != "") { … … 901 962 global $wp_query; 902 963 903 if ($wp_query->is_404() ) {964 if ($wp_query->is_404() && ! isset($_GET['u'])) { 904 965 $request_slug = $wp_query->query_vars['name']; 905 966 #error_log( ' - 404 for ' . $request_slug);
Note: See TracChangeset
for help on using the changeset viewer.