[ Index ]

MailPress 7.0.1

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/mp-includes/class/options/dashboard/widgets_comment/ -> posts_most_subs.php (source)

   1  <?php
   2  class MP_Dashboard_posts_most_subs extends MP_WP_Dashboard_widget_
   3  {
   4      var $id = 'mp_posts_most_subs';
   5  
   6  	function widget()
   7      {
   8          global $wpdb, $wp_locale;
   9  
  10          $wgt_post = false;
  11          $posts = $wpdb->get_results( $wpdb->prepare( "SELECT count( * ) as count, id, post_title, guid, post_modified FROM $wpdb->posts a, $wpdb->postmeta b WHERE meta_key = %s AND id = post_id AND post_status = 'publish' GROUP BY id, post_title, guid ORDER BY 1;", MailPress_comment::meta_key ) );
  12          foreach( $posts as $post )
  13          {
  14              $wgt_post .= '<li>';
  15              $wgt_post .= '( ' . $post->count . ' ) <a class="rsswidget" title="" href="' . $post->guid . '">' . $post->post_title . '</a>';
  16              $wgt_post .= '<span class="rss-date">' . mysql2date( get_option( 'date_format' ), $post->post_modified ) . '</span>';
  17              $wgt_post .= '</li>' . "\r\n";
  18          }
  19  
  20          if ( $wgt_post )
  21          {
  22  
  23              echo '<div><ul>' . "\r\n" . $wgt_post . '</ul></div>' . "\r\n";
  24          }
  25      }
  26  }
  27  new MP_Dashboard_posts_most_subs( __( 'MailPress - Most subscribed', 'MailPress' ) );


Generated: Mon Jan 28 00:07:10 2019 Cross-referenced by PHPXref 0.7.1