You are here

function visitors_platform in Visitors 7.2

Display platform report.

Return value

string platform report html source

1 string reference to 'visitors_platform'
visitors_browscap_menu in ./visitors_browscap.module
Menu callback. Prints a listing of active nodes on the site.

File

reports/platform.inc, line 57
Platform report for the visitors module.

Code

function visitors_platform() {
  $header = array(
    array(
      'data' => t('#'),
    ),
    array(
      'data' => t('Platform'),
      'field' => 'platform',
    ),
    array(
      'data' => t('Pages'),
      'field' => 'count',
      'sort' => 'desc',
    ),
    array(
      'data' => t('%'),
    ),
  );
  $hits_count = visitors_get_hits_count();
  $results = visitors_platform_data($header);
  $rows = array();
  $i = 0;
  $count = 0;
  foreach ($results as $data) {
    $rows[] = array(
      ++$i,
      $data->platform,
      $data->count,
      round($data->count / $hits_count * 100, 3),
    );
    $count += $data->count;
  }
  $output = visitors_date_filter();
  if (count($rows) > 1) {
    $output .= sprintf('<img src="%s" alt="%s">', url('visitors/platform/chart'), t('Platform'));
  }
  $output .= theme('table', array(
    'header' => $header,
    'rows' => $rows,
  ));
  return $output;
}