'Show unread posts for the current user')); } /** @see WP_Widget::widget */ function widget($args, $instance) { extract( $args ); if(is_user_logged_in()) { $title = apply_filters('widget_title', $instance['title']); $number = (int)$instance['number']; if($number == '' || !isset($number)) { $number = 5; } echo $before_widget; if ( $title ) { echo $before_title . $title . $after_title; } echo mar_list_unread_posts($number); echo $after_widget; } } /** @see WP_Widget::update */ function update($new_instance, $old_instance) { $instance = $old_instance; $instance['title'] = strip_tags($new_instance['title']); $instance['number'] = strip_tags($new_instance['number']); return $instance; } /** @see WP_Widget::form */ function form($instance) { $title = esc_attr($instance['title']); $number = esc_attr($instance['number']); ?>
'Show the number of posts the user has read, not read, etc')); } /** @see WP_Widget::widget */ function widget($args, $instance) { extract( $args ); if(is_user_logged_in()) { $title = apply_filters('widget_title', $instance['title']); $read_posts = (bool)$instance['read_posts']; $read_label = $instance['read_label']; $unread_posts = (bool)$instance['unread_posts']; $unread_label = $instance['unread_label']; $total_posts = (bool)$instance['total_posts']; $total_label = $instance['total_label']; $percentage = (bool)$instance['percentage']; $percentage_label = $instance['percentage_label']; $labels = array( 'read' => $read_label, 'unread' => $unread_label, 'total' => $total_label, 'percentage' => $percentage_label ); echo $before_widget; if ( $title ) { echo $before_title . $title . $after_title; } echo mar_list_user_report( array( 'read' => $read_posts, 'unread' => $unread_posts, 'total' => $total_posts, 'percentage' => $percentage, 'labels' => array( 'read' => $read_label, 'unread' => $unread_label, 'total' => $total_label, 'percentage' => $percentage_label ) ) ); echo $after_widget; } } /** @see WP_Widget::update */ function update($new_instance, $old_instance) { $instance = $old_instance; $instance['title'] = strip_tags($new_instance['title']); $instance['read_posts'] = strip_tags($new_instance['read_posts']); $instance['read_label'] = strip_tags($new_instance['read_label']); $instance['unread_posts'] = strip_tags($new_instance['unread_posts']); $instance['unread_label'] = strip_tags($new_instance['unread_label']); $instance['total_posts'] = strip_tags($new_instance['total_posts']); $instance['total_label'] = strip_tags($new_instance['total_label']); $instance['percentage'] = strip_tags($new_instance['percentage']); $instance['percentage_label'] = strip_tags($new_instance['percentage_label']); return $instance; } /** @see WP_Widget::form */ function form($instance) { $title = esc_attr($instance['title']); $read_posts = esc_attr($instance['read_posts']); $read_label = esc_attr($instance['read_label']); $unread_posts = esc_attr($instance['unread_posts']); $unread_label = esc_attr($instance['unread_label']); $total_posts = esc_attr($instance['total_posts']); $total_label = esc_attr($instance['total_label']); $percentage = esc_attr($instance['percentage']); $percentage_label = esc_attr($instance['percentage_label']); ?>
/>
/>
/>
/>
'Show your most read posts')); } /** @see WP_Widget::widget */ function widget($args, $instance) { extract( $args ); $title = apply_filters('widget_title', $instance['title']); $number = (int)$instance['number']; $read_count = (bool)$instance['read_count']; if($number == '' || !isset($number)) { $number = 5; } echo $before_widget; if ( $title ) { echo $before_title . $title . $after_title; } echo mar_most_read($number, $read_count); echo $after_widget; } /** @see WP_Widget::update */ function update($new_instance, $old_instance) { $instance = $old_instance; $instance['title'] = strip_tags($new_instance['title']); $instance['number'] = strip_tags($new_instance['number']); $instance['read_count'] = strip_tags($new_instance['read_count']); return $instance; } /** @see WP_Widget::form */ function form($instance) { $title = esc_attr($instance['title']); $number = esc_attr($instance['number']); $read_count = esc_attr($instance['read_count']); ?>
/>
'Show link to mark current post as read or unread')); } /** @see WP_Widget::widget */ function widget($args, $instance) { extract( $args ); $title = apply_filters('widget_title', $instance['title']); $read = apply_filters('widget_title', $instance['read']); $unread = apply_filters('widget_title', $instance['unread']); if(is_single() && is_user_logged_in()) { echo $before_widget; if ( $title ) { echo $before_title . $title . $after_title; } echo mar_read_unread_links($read, $unread); echo $after_widget; } } /** @see WP_Widget::update */ function update($new_instance, $old_instance) { $instance = $old_instance; $instance['title'] = strip_tags($new_instance['title']); $instance['read'] = strip_tags($new_instance['read']); $instance['unread'] = strip_tags($new_instance['unread']); return $instance; } /** @see WP_Widget::form */ function form($instance) { $title = esc_attr($instance['title']); $read = esc_attr($instance['read']); $unread = esc_attr($instance['unread']); ?>