You are here

function theme_ip_tracker_ip_records in IP address manager 6

Same name and namespace in other branches
  1. 7 ip.module \theme_ip_tracker_ip_records()

Theme the IP tracker records for an IP.

1 theme call to theme_ip_tracker_ip_records()
ip_manage in ./ip.module
Page callback for IP address management.

File

./ip.module, line 211
IP address manager module.

Code

function theme_ip_tracker_ip_records($ip) {

  // Set the page title.
  drupal_set_title(t('Manage IP address %ip', array(
    '%ip' => $ip,
  )));

  // Get the record data.
  $records = ip_tracker_ip_records($ip);

  // Create a table header.
  $header = array(
    t('User'),
    t('Visits'),
    t('First visit'),
    t('Last visit'),
  );
  foreach ($records as $record) {
    $account = user_load($record['uid']);

    // Check that account is loaded.
    if ($account) {

      // Build a table row.
      $rows[] = array(
        theme('ip_username', $account),
        $record['visits'],
        format_date($record['first_visit']),
        format_date($record['last_visit']),
      );
    }
  }
  $out = theme('table', $header, $rows);
  return $out;
}