[ Index ]

MailPress 544

[ 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_dashboard_widget_
   3  {
   4      var $id = 'mp_posts_most_subs';
   5  
   6  	function widget()
   7      {
   8          global $wpdb, $wp_locale;
   9  
  10          $wgt_post = '';
  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>\n";
  15              $wgt_post .= "($post->count) <a class='rsswidget' title='' href='$post->guid'>$post->post_title</a> \n";
  16              $wgt_post .= "<span class='rss-date'>" . mysql2date(get_option('date_format'), $post->post_modified) . "</span>\n";
  17              $wgt_post .= "</li>\n";
  18          }
  19          if ('' != $wgt_post)
  20          {
  21  ?>
  22  <div>
  23  <ul>
  24  <?php echo $wgt_post; ?>
  25  </ul>
  26  </div>
  27  <?php
  28          }
  29      }
  30  }
  31  new MP_Dashboard_posts_most_subs(__( 'MailPress - Most subscribed', MP_TXTDOM ));


Generated: Thu Apr 28 18:38:52 2016 Cross-referenced by PHPXref 0.7.1