├── msreader-files ├── views │ ├── dashboard-reader │ │ ├── content-page.php │ │ ├── 404.php │ │ ├── index.php │ │ ├── content-post.php │ │ ├── sidebar.php │ │ ├── content-single.php │ │ └── comments.php │ └── page-settings-network.php ├── languages │ └── default.mo ├── includes │ ├── modules │ │ ├── shortcode-recent-posts-grid │ │ │ ├── img │ │ │ │ └── controls.png │ │ │ ├── css │ │ │ │ ├── ajax-loader.gif │ │ │ │ ├── fonts │ │ │ │ │ ├── slick.eot │ │ │ │ │ ├── slick.ttf │ │ │ │ │ ├── slick.woff │ │ │ │ │ └── slick.svg │ │ │ │ ├── slick.css │ │ │ │ ├── slick-theme.css │ │ │ │ └── lightslider.min.css │ │ │ └── js │ │ │ │ └── lightslider.min.js │ │ ├── recent-posts.php │ │ ├── popular-posts.php │ │ ├── my-posts.php │ │ ├── my-sites.php │ │ ├── filter-blog-author.php │ │ ├── trending-tags.php │ │ ├── user-widget.php │ │ ├── search.php │ │ ├── widget-recent-posts.php │ │ ├── rss-feeds.php │ │ ├── featured-posts.php │ │ └── shortcode-recent-posts-grid.php │ ├── helpers.php │ ├── query.php │ └── modules.php ├── css │ ├── network-admin.css │ └── admin.css └── js │ └── network-admin.js ├── .gitmodules ├── changelog.txt └── README.md /msreader-files/views/dashboard-reader/content-page.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /msreader-files/languages/default.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/msreader/master/msreader-files/languages/default.mo -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "dash-notice"] 2 | path = dash-notice 3 | url = git@bitbucket.org:incsub/wpmudev-dashboard-notification.git 4 | branch = master 5 | -------------------------------------------------------------------------------- /msreader-files/views/dashboard-reader/404.php: -------------------------------------------------------------------------------- 1 |
-------------------------------------------------------------------------------- /msreader-files/includes/modules/shortcode-recent-posts-grid/img/controls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/msreader/master/msreader-files/includes/modules/shortcode-recent-posts-grid/img/controls.png -------------------------------------------------------------------------------- /msreader-files/includes/modules/shortcode-recent-posts-grid/css/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/msreader/master/msreader-files/includes/modules/shortcode-recent-posts-grid/css/ajax-loader.gif -------------------------------------------------------------------------------- /msreader-files/includes/modules/shortcode-recent-posts-grid/css/fonts/slick.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/msreader/master/msreader-files/includes/modules/shortcode-recent-posts-grid/css/fonts/slick.eot -------------------------------------------------------------------------------- /msreader-files/includes/modules/shortcode-recent-posts-grid/css/fonts/slick.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/msreader/master/msreader-files/includes/modules/shortcode-recent-posts-grid/css/fonts/slick.ttf -------------------------------------------------------------------------------- /msreader-files/includes/modules/shortcode-recent-posts-grid/css/fonts/slick.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/msreader/master/msreader-files/includes/modules/shortcode-recent-posts-grid/css/fonts/slick.woff -------------------------------------------------------------------------------- /msreader-files/css/network-admin.css: -------------------------------------------------------------------------------- 1 | #msreader-control-modules label { 2 | line-height: 28px; 3 | } 4 | #msreader-control-modules .sub-options { 5 | display: none; 6 | } 7 | .msreader-control-module { 8 | margin: 5px 0; 9 | } 10 | #msreader-control-modules .sub-options .postbox { 11 | cursor: default; 12 | padding: 12px; 13 | margin: 0 0 5px 0; 14 | display: inline-block; 15 | } 16 | #msreader-control-modules button { 17 | outline: none; 18 | margin-bottom: 0 !important; 19 | } 20 | #msreader-control-modules button.active { 21 | -webkit-border-radius: 3px 3px 0 0; 22 | border-radius: 3px 3px 0 0; 23 | border-color:#e5e5e5; 24 | box-shadow: none; 25 | border-bottom: none; 26 | background: #fff; 27 | } -------------------------------------------------------------------------------- /msreader-files/js/network-admin.js: -------------------------------------------------------------------------------- 1 | (function($) { 2 | $(document).ready(function() { 3 | $('#msreader-page-name').on('input', function() { 4 | $('.reader-menu-page').text($(this).val()); 5 | }); 6 | 7 | $('#msreader-control-modules .open-module-options').click(function(event) { 8 | event.preventDefault(); 9 | 10 | var target = $(this).attr('data-module'); 11 | var position = $(this).position(); 12 | 13 | if($(this).hasClass('active')) { 14 | $('#msreader-control-modules .sub-options[data-module="'+target+'"]').hide(); 15 | $(this).removeClass('active'); 16 | } 17 | else { 18 | $('#msreader-control-modules .sub-options[data-module="'+target+'"]').show(); 19 | console.log(position); 20 | $('#msreader-control-modules .sub-options[data-module="'+target+'"] .postbox').css('min-width', position.left -150); 21 | $(this).addClass('active'); 22 | } 23 | }); 24 | }); 25 | })(jQuery); -------------------------------------------------------------------------------- /changelog.txt: -------------------------------------------------------------------------------- 1 | Plugin Name: Reader 2 | Author: WPMUDEV 3 | Lead developer: Maniu 4 | 5 | == Changelog == 6 | 7 | = 1.2.6 = 8 | * Fixed list manager page not loading 9 | * Other small improvements 10 | 11 | = 1.2.5 = 12 | * Added new [reader-posts-grid] shortcode 13 | * Improved shortcode handling in reader posts 14 | * Other small improvements 15 | 16 | = 1.2 = 17 | * Added lists to easily group followed sites 18 | * Added user's private sites to post lists even when blocked 19 | * Improved cache system 20 | * Fixed comment moderation issue 21 | * Fixed translation issues 22 | 23 | = 1.1 = 24 | * Added widget to display reader content in sidebars 25 | * Added option for users to overwrite default Reader localization 26 | * Fixed problems related to media being in post excerpt 27 | * Other small improvements 28 | 29 | = 1.0.1 = 30 | * Added missing translation strings 31 | * Improved security 32 | 33 | = 1.0.0 = 34 | * Initial Release -------------------------------------------------------------------------------- /msreader-files/views/dashboard-reader/index.php: -------------------------------------------------------------------------------- 1 |main_query->module->message; ?>
'.count($user_sites).'
'; 64 | 65 | /* 66 | $user_info['stats']['my-posts'] = 67 | ''. $this->get_user_post_count($current_user->ID).'
'; 69 | */ 70 | 71 | $user_info = apply_filters('msreader_user_widget_user_info', $user_info); 72 | 73 | $content = ''; 74 | 75 | $widgets['reader']['data'] = array_merge(array('html' => $content), $widgets['reader']['data']); 76 | 77 | return $widgets; 78 | } 79 | 80 | function get_user_post_count($user_id = 0) { 81 | global $wpdb; 82 | 83 | if(!$user_id) 84 | $user_id = get_current_user_id(); 85 | 86 | $user_post_count = wp_cache_get('user_post_count_'.$user_id, 'msreader_global'); 87 | 88 | if(!$user_post_count) { 89 | $query = " 90 | SELECT count(*) 91 | FROM $this->db_network_posts AS posts 92 | INNER JOIN $this->db_blogs AS blogs ON blogs.blog_id = posts.BLOG_ID 93 | WHERE blogs.archived = 0 AND blogs.spam = 0 AND blogs.deleted = 0 94 | AND post_status = 'publish' 95 | AND post_password = '' 96 | AND post_author = $user_id 97 | "; 98 | $query = apply_filters('msreader_'.$this->details['slug'].'_user_post_count', $query, $this->args, $user_id); 99 | $user_post_count = $wpdb->get_var($query); 100 | 101 | wp_cache_set('user_post_count_'.$user_id, $user_post_count, 'msreader_global', 14400); 102 | } 103 | 104 | return $user_post_count; 105 | } 106 | function flush_user_post_count() { 107 | $user_id = get_current_user_id(); 108 | 109 | wp_cache_delete('user_post_count_'.$user_id, 'msreader_global'); 110 | } 111 | } -------------------------------------------------------------------------------- /msreader-files/includes/modules/search.php: -------------------------------------------------------------------------------- 1 | __( 'Search', 'wmd_msreader' ), 4 | 'description' => __( 'Allows to search posts by title, author or tag', 'wmd_msreader' ), 5 | 'slug' => 'search', 6 | 'class' => 'WMD_MSReader_Module_Search', 7 | 'can_be_default' => false, 8 | 'global_cache' => true, 9 | 'type' => array('query', 'query_args_required') 10 | ); 11 | 12 | class WMD_MSReader_Module_Search extends WMD_MSReader_Modules { 13 | 14 | function init() { 15 | add_filter( 'msreader_dashboard_reader_sidebar_widgets', array($this,'add_widget'), 5 ); 16 | add_action( 'admin_print_styles', array($this,'add_css')); 17 | 18 | add_filter('msreader_rss_feeds_extra_enable_feed', array($this,'add_module_slug_to_array'),10,1); 19 | add_filter('msreader_rss_feeds_enable_args', array($this,'add_module_slug_to_array'),10,1); 20 | } 21 | 22 | function add_css() { 23 | ?> 24 | 35 | args['search_author']) && !isset($this->args['search_tag']) && !isset($this->args['search_title'])) 40 | $this->args['search_title'] = 1; 41 | 42 | $search_value = isset($this->args['search_value']) ? esc_attr($this->args['search_value']) : ''; 43 | $search_html = ' 44 | 57 | '; 58 | 59 | $widget = array('search' => array( 60 | 'title' => $this->details['menu_title'], 61 | 'default_style' => 0, 62 | 'data' => array( 63 | 'html' => $search_html 64 | ) 65 | )); 66 | 67 | $widgets = array_merge($widget, $widgets); 68 | 69 | return $widgets; 70 | } 71 | 72 | function get_page_title() { 73 | return $this->details['page_title'].': '.esc_attr($this->args['search_value']).''; 74 | } 75 | 76 | function query() { 77 | global $wpdb; 78 | 79 | $blocked_words = apply_filters('msreader_'.$this->details['slug'].'_blocked_words', array()); 80 | $search_words = explode(' ', $this->args['search_value']); 81 | $blocked = 0; 82 | foreach ($search_words as $search_word) 83 | if(in_array(trim($search_word), $blocked_words)) { 84 | $blocked = 1; 85 | break; 86 | } 87 | 88 | if(!$blocked) { 89 | $limit = $this->get_limit(); 90 | $public = $this->get_public(); 91 | 92 | //set title search as default 93 | if(!isset($this->args['search_author']) && !isset($this->args['search_tag']) && !isset($this->args['search_title'])) 94 | $this->args['search_title'] = 1; 95 | 96 | $query = " 97 | SELECT posts.BLOG_ID AS BLOG_ID, posts.ID AS ID, post_author, post_date, post_date_gmt, post_content, post_title 98 | FROM $this->db_network_posts AS posts 99 | INNER JOIN $this->db_blogs AS blogs ON blogs.blog_id = posts.BLOG_ID"; 100 | if(isset($this->args['search_tag']) && $this->args['search_tag']) 101 | $query .= " 102 | LEFT JOIN $this->db_network_term_rel AS b ON (b.object_id = posts.ID AND b.blog_id = posts.BLOG_ID) 103 | LEFT JOIN $this->db_network_terms AS c ON (c.term_id = b.term_taxonomy_id)"; 104 | if(isset($this->args['search_author']) && $this->args['search_author']) 105 | $query .= " 106 | LEFT JOIN $this->db_users AS d ON (d.ID = posts.post_author)"; 107 | $query .= " 108 | WHERE $public blogs.archived = 0 AND blogs.spam = 0 AND blogs.deleted = 0 109 | AND post_status = 'publish' 110 | AND post_password = '' 111 | "; 112 | 113 | $where_search = array(); 114 | if(isset($this->args['search_title']) && $this->args['search_title']) { 115 | $where_search[] = $wpdb->prepare("posts.post_title LIKE %s", $this->args['search_value'].'%'); 116 | $where_search[] = $wpdb->prepare("posts.post_title LIKE %s", '% '.$this->args['search_value'].'%'); 117 | } 118 | if(isset($this->args['search_tag']) && $this->args['search_tag']) { 119 | $where_search[] = $wpdb->prepare("c.name LIKE %s", $this->args['search_value'].'%'); 120 | $where_search[] = $wpdb->prepare("c.name LIKE %s", '% '.$this->args['search_value'].'%'); 121 | } 122 | if(isset($this->args['search_author']) && $this->args['search_author']) { 123 | $where_search[] = $wpdb->prepare("d.display_name LIKE %s", $this->args['search_value'].'%'); 124 | $where_search[] = $wpdb->prepare("d.display_name LIKE %s", '% '.$this->args['search_value'].'%'); 125 | } 126 | 127 | $where_search = count($where_search) > 0 ? 'AND ('.implode(' OR ', $where_search).')' : ''; 128 | $query .= " 129 | $where_search 130 | ORDER BY post_date_gmt DESC 131 | $limit 132 | "; 133 | $query = apply_filters('msreader_'.$this->details['slug'].'_query', $query, $this->args, $limit, $public); 134 | $posts = $wpdb->get_results($query); 135 | } 136 | else 137 | $posts = 'error'; 138 | 139 | return $posts; 140 | } 141 | } -------------------------------------------------------------------------------- /msreader-files/includes/modules/widget-recent-posts.php: -------------------------------------------------------------------------------- 1 | __( 'Widget - Post List', 'wmd_msreader' ), 4 | 'description' => __( 'Allows usage of WordPress sidebar widget that displays latest posts', 'wmd_msreader' ), 5 | 'slug' => 'widget_recent_posts', 6 | 'class' => 'WMD_MSReader_Module_WidgetRecentPosts', 7 | 'can_be_default' => false, 8 | 'type' => 'wp-widget' 9 | ); 10 | 11 | class WMD_MSReader_Module_WidgetRecentPosts extends WMD_MSReader_Modules { 12 | 13 | function init() { 14 | add_action( 'widgets_init', create_function( '', 'return register_widget("wmd_msreader_post_list");' ) ); 15 | add_action('admin_footer-widgets.php', array($this,'add_js')); 16 | } 17 | 18 | function add_js() { 19 | ?> 20 | 34 | plugin['dir'].'includes/query.php'); 40 | 41 | extract( $args ); 42 | 43 | $title = isset($instance['title']) ? apply_filters( 'widget_title', $instance['title'] ) : ''; 44 | $number = (is_numeric($instance['number']) ) ? $instance['number'] : 7; 45 | $show_date = $instance['show_date'] == 'on' ? true : false; 46 | $show_excerpt = (isset($instance['show_excerpt']) && $instance['show_excerpt'] == 'on') ? true : false; 47 | $show_author = (isset($instance['show_author']) && $instance['show_author'] == 'on') ? true : false; 48 | 49 | $query = new WMD_MSReader_Query(); 50 | 51 | $arg_module = explode('|', $instance['module']); 52 | if(isset($arg_module[1])) { 53 | $instance['module'] = $arg_module[0]; 54 | $instance['args'] = array($arg_module[1]); 55 | } 56 | else 57 | $instance['args'] = array(); 58 | 59 | if(isset($wmd_msreader->modules[$instance['module']]) && isset($instance['user_id']) && $instance['user_id']) { 60 | $query->limit = $number; 61 | $query->user = $instance['user_id']; 62 | $query->args = $instance['args']; 63 | $query->load_module($wmd_msreader->modules[$instance['module']]); 64 | 65 | $posts = $query->get_posts(); 66 | 67 | if(is_array($posts) && count($posts) > 0) { 68 | if(isset($before_widget)) 69 | echo $before_widget; 70 | 71 | if(isset($title) && isset($before_title)) 72 | echo $before_title; 73 | 74 | if ( $title ) 75 | echo $title; 76 | if(isset($title) && isset($after_title)) 77 | echo $after_title; 78 | 79 | if(!isset($instance['remove_widget_class']) || !$instance['remove_widget_class']) 80 | echo ''; 109 | if(isset($after_widget)) 110 | echo $after_widget; 111 | } 112 | } 113 | } 114 | } 115 | 116 | // Widget for Subscribe 117 | class wmd_msreader_post_list extends WP_Widget { 118 | //constructor 119 | function __construct() { 120 | $widget_ops = array( 'description' => __( 'List of most recent Reader related Posts', 'wmd_msreader') ); 121 | parent::__construct( false, __( 'Reader: Recent Posts', 'wmd_msreader' ), $widget_ops ); 122 | } 123 | 124 | /** @see WP_Widget::widget */ 125 | function widget( $args, $instance ) { 126 | global $msreader_modules; 127 | 128 | $msreader_modules['widget_recent_posts']->widget( $args, $instance ); 129 | } 130 | 131 | /** @see WP_Widget::update */ 132 | function update( $new_instance, $old_instance ) { 133 | $instance = $old_instance; 134 | $instance['title'] = strip_tags($new_instance['title']); 135 | $instance['number'] = strip_tags($new_instance['number']); 136 | $instance['number'] = $instance['number'] > 20 ? 20 : ($instance['number'] < 1 ? 1 : $instance['number']); 137 | $instance['show_date'] = strip_tags($new_instance['show_date']); 138 | $instance['show_excerpt'] = strip_tags($new_instance['show_excerpt']); 139 | $instance['show_author'] = strip_tags($new_instance['show_author']); 140 | $instance['module'] = strip_tags($new_instance['module']); 141 | if(!$instance['user_id']) 142 | $instance['user_id'] = get_current_user_id(); 143 | 144 | return $instance; 145 | } 146 | 147 | /** @see WP_Widget::form */ 148 | function form( $instance ) { 149 | global $msreader_helpers, $wmd_msreader; 150 | $options = $wmd_msreader->plugin['site_options']; 151 | 152 | $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; 153 | $number = (isset( $instance['number'] ) && is_numeric($instance['number'])) ? esc_attr( $instance['number'] ) : 7; 154 | $show_date = isset( $instance['show_date'] ) ? esc_attr( $instance['show_date'] ) : ''; 155 | $show_excerpt = isset( $instance['show_excerpt'] ) ? esc_attr( $instance['show_excerpt'] ) : ''; 156 | $show_author = isset( $instance['show_author'] ) ? esc_attr( $instance['show_author'] ) : ''; 157 | $current_module = isset( $instance['module'] ) ? esc_attr( $instance['module'] ) : ''; 158 | 159 | $user_id = (isset($instance['user_id']) && $instance['user_id']) ? $instance['user_id'] : get_current_user_id(); 160 | $user_name = get_userdata($user_id); 161 | $user_name = $user_name->user_login; 162 | ?> 163 | 213 | ul, 510 | .comment-content li > ol { 511 | margin-bottom: 0; 512 | } 513 | 514 | .comment-content > :last-child { 515 | margin-bottom: 0; 516 | } 517 | 518 | .comments .children { 519 | list-style: none; 520 | margin: 0 0 0 35px; 521 | } 522 | 523 | .comment-respond { 524 | margin-bottom: 24px; 525 | padding: 0; 526 | } 527 | 528 | .comment .comment-respond { 529 | margin-top: 24px; 530 | } 531 | 532 | .comment-respond h3 { 533 | margin-top: 0; 534 | margin-bottom: 24px; 535 | } 536 | 537 | .comment-notes, 538 | .comment-awaiting-moderation, 539 | .logged-in-as { 540 | font-size: 14px; 541 | line-height: 1.7142857142; 542 | } 543 | 544 | .msreader-add-comment h4 { 545 | font-size: 1.1em; 546 | margin: 0; 547 | min-height: 42px; 548 | } 549 | .msreader-add-comment h4 small { 550 | font-weight: normal; 551 | margin-left: 5px; 552 | } 553 | .msreader-add-comment h4 small.disabled { 554 | color: #727272; 555 | } 556 | .msreader-add-comment h4 small.disabled label { 557 | cursor: default; 558 | } 559 | 560 | .msreader-add-comment .reply-info a { 561 | text-decoration: none; 562 | } 563 | 564 | /*EASY BLOGGING COMPATIBILITY*/ 565 | #wdeb-mode .msreader-rss-feeds-link, #wdeb-mode .msreader-rss-feeds-box, #wdeb-mode .msreader-follow-icon, #wdeb-mode #msreader-dashboard .current-text, #wdeb-mode .msreader-post-overlay .current-text, #wdeb-mode #msreader-dashboard .user-info { 566 | display: none; 567 | } -------------------------------------------------------------------------------- /msreader-files/includes/modules/rss-feeds.php: -------------------------------------------------------------------------------- 1 | __( 'RSS Feeds', 'wmd_msreader' ), 4 | 'description' => __( 'Allows users to get links for all post lists available in Reader', 'wmd_msreader' ), 5 | 'slug' => 'rss_feeds', 6 | 'class' => 'WMD_MSReader_Module_RssFeeds', 7 | 'can_be_default' => false, 8 | 'type' => 'other' 9 | ); 10 | 11 | class WMD_MSReader_Module_RssFeeds extends WMD_MSReader_Modules { 12 | 13 | function init() { 14 | if(isset($_GET['msreader_'.$this->details['slug']]) && $_GET['msreader_'.$this->details['slug']] == 'view' && isset($_GET['key']) && isset($_GET['module'])) { 15 | add_action('msreader_before_main_query_load_module', array( $this, "set_current_user" ), 15); 16 | add_filter('msreader_requested', '__return_true'); 17 | add_filter('msreader_query_limit_default', array( $this, "msreader_query_limit_default")); 18 | add_action('init', array( $this, "display_rss" ), 15); 19 | } 20 | 21 | add_filter('msreader_dashboard_page_title', array( $this, "add_rss_icon" ), 50, 1 ); 22 | add_action( 'admin_head', array( $this, "add_css_js" ) ); 23 | add_action('msreader_dashboard_after_page_title', array( $this, "add_rss_info_box" ), 5); 24 | 25 | add_action( 'wp_ajax_dashboard_get_rss_feed_link', array($this, 'get_rss_feed_link'), 20 ); 26 | } 27 | 28 | function msreader_query_limit_default($current) { 29 | return 25; 30 | } 31 | 32 | function add_rss_icon($current_title) { 33 | global $msreader_main_query; 34 | 35 | $blocked_modules = apply_filters('msreader_rss_feeds_blocked_modules', array()); 36 | 37 | if(in_array('query', $msreader_main_query->module->details['type']) && !in_array($msreader_main_query->module->details['slug'], $blocked_modules)) 38 | $current_title = $current_title.''; 39 | 40 | return $current_title; 41 | } 42 | 43 | function add_rss_info_box() { 44 | global $msreader_main_query; 45 | 46 | $blocked_modules = apply_filters('msreader_rss_feeds_blocked_modules', array()); 47 | 48 | if(in_array('query', $msreader_main_query->module->details['type']) && !in_array($msreader_main_query->module->details['slug'], $blocked_modules)) { 49 | $feed_url = $this->get_rss_feed_link(0); 50 | ?> 51 | 52 |59 | 60 |
61 |62 | 63 | here.', 'wmd_msreader'); ?> 64 |
65 |