'; } if($read_text == '') { if($mar_options['read_text'] != '') { $read_text = $mar_options['read_text']; } else { $read_text = 'Mark as Read'; } } if($unread_text == '') { if($mar_options['unread_text'] != '') { $unread_text = $mar_options['unread_text']; } else { $unread_text = 'Mark as Unread'; } } if(mar_check_post_is_read($post_id, mar_get_user_id())) { $link .= '' . $unread_text . ''; $link .= ''; } else { $link .= ''; $link .= '' . $read_text . ''; } if($wrapper == true) { $link .= ''; } return $link; } } // show mark as read / unread links automatically if enabled. Do not use this as a template tag function mar_show_links($content) { global $post; global $mar_options; if(is_single() && get_post_type() == 'post' && $mar_options['show_links'] == true) { if($mar_options['post_position'] == 'Top') { $content = mar_read_unread_links($mar_options['read_text'], $mar_options['unread_text']) . $content; } else { $content = $content . mar_read_unread_links($mar_options['read_text'], $mar_options['unread_text']); } } return $content; } add_filter('the_content', 'mar_show_links'); function mar_list_unread_posts($number = 5) { if(is_user_logged_in()) { $read_ids = mar_get_user_read_posts( mar_get_user_id() ); $unread_posts = get_posts(array('exclude' => $read_ids, 'numberposts' => $number)); ob_start(); ?> true, 'unread' => true, 'total' => true, 'percentage' => true, 'labels' => array( 'read' => 'Read Posts: ', 'unread' => 'Unread Posts: ', 'total' => 'Total Posts: ', 'percentage' => 'Percentage Complete: ' ) ); $args = wp_parse_args( $args, $defaults ); extract( $args, EXTR_SKIP ); $report = mar_get_user_report(); ob_start(); ?> get_results("SELECT * FROM " . $mar_db_table . " WHERE read_count != 0 ORDER BY read_count DESC LIMIT $number;"); if($read_posts) { $popular_list = ''; } return $popular_list; }