Privacy if you would rather * not keep it. */ // The type column, as written by znote_visitor_insert_detailed_data(). function acp_visit_types(): array { return array( 0 => t('acp.vis.type_pageview'), 1 => t('acp.vis.type_register'), 2 => t('acp.vis.type_char_created'), 3 => t('acp.vis.type_highscores'), 4 => t('acp.vis.type_char_search'), 5 => t('acp.vis.type_other'), ); } $days = intv($_GET['days'] ?? 7); if (!in_array($days, array(1, 7, 30, 90), true)) { $days = 7; } $since = time() - ($days * 86400); $collecting = !empty($config['log_ip']); $totalRows = acp_count("SELECT COUNT(*) AS `c` FROM `znote_visitors_details`;"); $uniqueAll = acp_count("SELECT COUNT(DISTINCT `ip`) AS `c` FROM `znote_visitors_details`;"); $rowsPeriod = acp_count("SELECT COUNT(*) AS `c` FROM `znote_visitors_details` WHERE `time` >= ?;", [$since]); $uniquePeriod= acp_count("SELECT COUNT(DISTINCT `ip`) AS `c` FROM `znote_visitors_details` WHERE `time` >= ?;", [$since]); // Visits per day $perDay = db()->fetchAll(" SELECT FROM_UNIXTIME(`time`, '%Y-%m-%d') AS `day`, COUNT(*) AS `hits`, COUNT(DISTINCT `ip`) AS `uniques` FROM `znote_visitors_details` WHERE `time` >= ? GROUP BY `day` ORDER BY `day` DESC; ", [$since]); $perDay = is_array($perDay) ? $perDay : array(); // Breakdown by what people did $byType = db()->fetchAll(" SELECT `type`, COUNT(*) AS `hits` FROM `znote_visitors_details` WHERE `time` >= ? GROUP BY `type` ORDER BY `hits` DESC; ", [$since]); $byType = is_array($byType) ? $byType : array(); // Busiest addresses $topIps = db()->fetchAll(" SELECT `ip`, COUNT(*) AS `hits`, MAX(`time`) AS `last`, MAX(`account_id`) AS `account_id` FROM `znote_visitors_details` WHERE `time` >= ? GROUP BY `ip` ORDER BY `hits` DESC LIMIT 15; ", [$since]); $topIps = is_array($topIps) ? $topIps : array(); $peak = 0; foreach ($perDay as $row) { $peak = max($peak, (int)$row['hits']); } ?>
'' . t('acp.vis.off') . '', 'link' => '' . t('acp.vis.settings_privacy') . '', ]) ?>
t('acp.vis.today'), 7 => t('acp.vis.7days'), 30 => t('acp.vis.30days'), 90 => t('acp.vis.90days')) as $d => $label): ?>
number_format($totalRows)]) ?>

(int)$days]) ?>

0 ? round(($hits / $peak) * 100) : 0; ?>
 

(int)$days]) ?>

(int)$row['type']])) ?>

0): ?> # —