You are here

function spam_reported_details in Spam 5

1 string reference to 'spam_reported_details'
spam_menu in ./spam.module
Implementation of hook_menu().

File

./spam.module, line 2566

Code

function spam_reported_details() {

  /*  admin/content/spam/reported/source/id/details
   *  0     1       2    3        4      5  6
   */
  $source = arg(4);
  $id = arg(5);
  $output = '';
  if ($id) {
    $result = db_query("SELECT * FROM {spam_reported} WHERE source = '%s' AND id = %d ORDER BY timestamp DESC", $source, $id);
    while ($entry = db_fetch_object($result)) {
      if (!empty($output)) {
        $output .= ' <tr bgcolor="#888"><td colspan="2"></td></tr>';
      }
      else {
        $output .= '<table border="1" cellpadding="2" cellspacing="2">';
      }
      $output .= ' <tr><th>' . t('Type') . '</th><td>' . l(t($entry->source), "admin/logs/spam/logs/{$entry->source}") . '</td></tr>';
      $output .= ' <tr><th>' . t('@type ID', array(
        '@type' => ucfirst($entry->source),
      )) . '</th><td>' . l(t($entry->id), "admin/logs/spam/logs/{$entry->source}/{$entry->id}") . '</td></tr>';
      $output .= ' <tr><th>' . t('Date') . '</th><td>' . format_date($entry->timestamp, 'large') . '</td></tr>';
      $reported_user = user_load(array(
        'uid' => $entry->uid,
      ));
      $output .= ' <tr><th>' . t('User') . '</th><td>' . theme('username', $reported_user) . '</td></tr>';
      $output .= ' <tr><th>' . t('Feedback') . "</th><td>{$entry->feedback}</td></tr>";
      $output .= ' <tr><th>' . t('Hostname') . "</th><td>{$entry->hostname}</td></tr>";
    }
    $output .= '</table>';
  }
  return $output;
}