You are here

function spam_logs_entry in Spam 5

Same name and namespace in other branches
  1. 5.3 spam.module \spam_logs_entry()
  2. 6 spam.module \spam_logs_entry()

Displays complete information about a single log entry ID.

Parameters

$id: The log entry to get details of.

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

File

./spam.module, line 1601

Code

function spam_logs_entry($id = NULL) {
  if (!$id) {
    return NULL;
  }
  $entry = db_fetch_object(db_query('SELECT s.*, u.name, u.uid FROM {spam_log} s INNER JOIN {users} u ON s.uid = u.uid WHERE s.sid = %d', $id));
  return theme('table', NULL, array(
    array(
      array(
        'data' => t('Type'),
        'header' => TRUE,
      ),
      array(
        'data' => l(t($entry->source), "admin/logs/spam/logs/{$entry->source}"),
      ),
    ),
    array(
      array(
        'data' => t('!type ID', array(
          '!type' => ucfirst($entry->source),
        )),
        'header' => TRUE,
      ),
      array(
        'data' => l(t($entry->id), "admin/logs/spam/logs/{$entry->source}/{$entry->id}"),
      ),
    ),
    array(
      array(
        'data' => t('Date'),
        'header' => TRUE,
      ),
      array(
        'data' => format_date($entry->timestamp, 'large'),
      ),
    ),
    array(
      array(
        'data' => t('User'),
        'header' => TRUE,
      ),
      array(
        'data' => theme('username', $entry),
      ),
    ),
    array(
      array(
        'data' => t('Message'),
        'header' => TRUE,
      ),
      array(
        'data' => $entry->entry,
      ),
    ),
    array(
      array(
        'data' => t('Hostname'),
        'header' => TRUE,
      ),
      array(
        'data' => $entry->hostname,
      ),
    ),
  ));
}