membership_news_stream

The Membership 2 membership news stream function.

Description

membership_news_stream(); 

Usage

  1. if ( !function_exists( 'membership_news_stream' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'membership-2/app_old/membershipincludes/addons/newsstream.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = membership_news_stream(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/app_old/membershipincludes/addons/newsstream.php  
  1. function membership_news_stream() { 
  2.  
  3. global $wpdb; 
  4.  
  5. $table = membership_db_prefix($wpdb, 'membership_news'); 
  6.  
  7. // Superfluous prepare, but do it anyway 
  8. $news = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$table} ORDER BY newsdate DESC LIMIT %d, %d", 0, 50) ); 
  9.  
  10. ?> 
  11.  
  12. <div class="postbox " id="dashboard_news"> 
  13. <h3 class="hndle"><span><?php _e('News', 'membership'); ?></span></h3> 
  14. <div class="inside"> 
  15. <?php 
  16.  
  17. if(!empty($news)) { 
  18.  
  19. foreach($news as $key => $newsitem) { 
  20. echo "<p id='newsitem-" . $newsitem->id . "'>"; 
  21. echo "[ "; 
  22. echo date("Y-m-d : H:i", strtotime($newsitem->newsdate)); 
  23. echo " ] "; 
  24. echo $newsitem->newsitem; 
  25. echo "</p>"; 
  26.  
  27. } else { 
  28. echo "<p>" . __('There will be some interesting news here when your site gets going.', 'membership') . "</p>"; 
  29.  
  30. ?> 
  31. <br class="clear"> 
  32. </div> 
  33. </div> 
  34.  
  35. <?php