You are here

function simplenews_scheduler_handler_newsletters in Simplenews Scheduler 6.2

Same name and namespace in other branches
  1. 8 simplenews_scheduler_views.inc \simplenews_scheduler_handler_newsletters()
  2. 5 simplenews_scheduler_views.inc \simplenews_scheduler_handler_newsletters()
  3. 7 simplenews_scheduler_views.inc \simplenews_scheduler_handler_newsletters()
  4. 2.0.x simplenews_scheduler_views.inc \simplenews_scheduler_handler_newsletters()
1 string reference to 'simplenews_scheduler_handler_newsletters'
simplenews_scheduler_views_tables in ./simplenews_scheduler_views.inc
Implementation of hook_views_tables

File

./simplenews_scheduler_views.inc, line 30
simplenews_scheduler_views.inc Views support for simplenews

Code

function simplenews_scheduler_handler_newsletters() {
  $list = array();
  $result = db_query("SELECT ss.*,n.title FROM {simplenews_scheduler} ss JOIN {node} n ON n.nid = ss.snid GROUP BY snid");
  while ($row = db_fetch_array($result)) {
    $list[$row['snid']] = "Newsletter: " . $row['title'];
  }
  if (sizeof($list) == 0) {
    drupal_set_message('No current newsletter found to filter against, you should create a simplenews newsletter first.');
  }
  return $list;
}