You are here

function spam_admin_list_feedback in Spam 5.3

Same name and namespace in other branches
  1. 6 spam.module \spam_admin_list_feedback()

Spam feedback overview.

1 string reference to 'spam_admin_list_feedback'
spam_menu in ./spam.module
Drupal _menu() hook.

File

./spam.module, line 1002

Code

function spam_admin_list_feedback() {
  $header = array(
    array(
      'data' => t('Date'),
      'field' => 'timestamp',
      'sort' => 'desc',
    ),
    array(
      'data' => t('Type'),
      'field' => 'content_type',
    ),
    array(
      'data' => t('From'),
      'field' => 'hostname',
    ),
    array(
      'data' => t('Preview'),
    ),
    array(
      'data' => t('Options'),
    ),
  );
  $sql = 'SELECT * FROM {spam_filters_errors}';
  $sql .= tablesort_sql($header);
  $result = pager_query($sql, 25);
  $rows = array();
  while ($feedback = db_fetch_object($result)) {
    $row = array();
    $row[] = array(
      'data' => format_date($feedback->timestamp, 'small'),
    );
    $row[] = array(
      'data' => $feedback->content_type,
    );
    $row[] = array(
      'data' => $feedback->hostname,
    );
    $row[] = array(
      'data' => _spam_truncate($feedback->feedback, 32),
    );
    $row[] = l(t('view'), "admin/content/spam/feedback/{$feedback->bid}");
    $rows[] = $row;
  }
  $output = theme('table', $header, $rows);
  $output .= theme('pager', NULL, 25, 0);
  return $output;
}