Добавить комментарий
Для отправки комментария вы должны авторизоваться.
/* Plugin Name: news.yandex.ru WordPress RSS2.0 Plugin URI: https://saintist.ru/ Description: Support XML-based (https://www.w3.org/TR/REC-xml) RSS 2.0 (/tech/rss) from Yandex. Author: Khrapach Pavel {saintist}. Version: 0.2.4.1 */ if ('news-yandex-ru.php' == basename($_SERVER['SCRIPT_FILENAME'])) die ('Please do not access this file directly. Thanks!'); define('NEWS_YANDEX_RU_VERSION', '0.2.4.1'); define('NEWS_YANDEX_RU_FOLDER_NAME', dirname(plugin_basename(__FILE__))); define('NEWS_YANDEX_RU_PATH', ABSPATH.'wp-content/plugins/' . NEWS_YANDEX_RU_FOLDER_NAME); define('NEWS_YANDEX_RU_URL', get_option('url').'/wp-content/plugins/' . NEWS_YANDEX_RU_FOLDER_NAME); class news_yandex_ru { var $cfg=array(); function news_yandex_ru() { //remove_action('do_feed_news.yandex.ru', 'do_feed_news.yandex.ru'); add_action('do_feed_news.yandex.ru', array(&$this,'feed'),1); add_action('init', array(&$this,'init')); add_action('activate_news-yandex-ru/news-yandex-ru.php',array(&$this,'activate')); add_action('deactivate_news-yandex-ru/news-yandex-ru.php',array(&$this,'deactivate')); add_action('admin_menu', array(&$this,'menu')); } function feed($comments) { if (!$comments) { global $wp_query; if($wp_query->query_vars['feed']=='news.yandex.ru') { /*выводим за последние 7 дней*/ function filter_where($where = '') { $today_date = get_the_date('Y-m-d'); //posts between publish date of wrap-up and 7 days prior $where .= " AND post_date >= '" . date('Y-m-d', strtotime('-7 days')) . "' AND post_date <= '" . date('Y-m-d', strtotime('+1 days')) . "'"; return $where; } add_filter('posts_where', 'filter_where'); load_template( NEWS_YANDEX_RU_PATH.'/template.php'); //exit; } } } function category($categoryId=false){ $full=false; $ret='