change to week
This commit is contained in:
parent
2103c21b53
commit
97f00c22dd
|
@ -102,14 +102,12 @@
|
||||||
|
|
||||||
$HOUR = 3600;
|
$HOUR = 3600;
|
||||||
$DAY = $HOUR * 24;
|
$DAY = $HOUR * 24;
|
||||||
$BIDAY = $DAY * 2;
|
$WEEK = $DAY * 7;
|
||||||
$TRIDAY = $DAY * 3;
|
|
||||||
|
|
||||||
$stats = [];
|
$stats = [];
|
||||||
$hourly = [];
|
$hourly = [];
|
||||||
$daily = [];
|
$daily = [];
|
||||||
$bidaily = [];
|
$weekly = [];
|
||||||
$tridaily = [];
|
|
||||||
|
|
||||||
foreach (array_merge(... $config['boards']) as $uri) {
|
foreach (array_merge(... $config['boards']) as $uri) {
|
||||||
$_board = getBoardInfo($uri);
|
$_board = getBoardInfo($uri);
|
||||||
|
@ -122,8 +120,7 @@
|
||||||
|
|
||||||
$boardStat['hourly_ips'] = Categories::countUniqueIps($hourly, $HOUR, $_board);
|
$boardStat['hourly_ips'] = Categories::countUniqueIps($hourly, $HOUR, $_board);
|
||||||
$boardStat['daily_ips'] = Categories::countUniqueIps($daily, $DAY, $_board);
|
$boardStat['daily_ips'] = Categories::countUniqueIps($daily, $DAY, $_board);
|
||||||
$boardStat['bidaily_ips'] = Categories::countUniqueIps($bidaily, $BIDAY, $_board);
|
$boardStat['weekly_ips'] = Categories::countUniqueIps($weekly, $WEEK, $_board);
|
||||||
$boardStat['tridaily_ips'] = Categories::countUniqueIps($tridaily, $TRIDAY, $_board);
|
|
||||||
|
|
||||||
$pph_query = query(
|
$pph_query = query(
|
||||||
sprintf("SELECT COUNT(*) AS count FROM ``posts_%s`` WHERE time > %d",
|
sprintf("SELECT COUNT(*) AS count FROM ``posts_%s`` WHERE time > %d",
|
||||||
|
@ -138,8 +135,7 @@
|
||||||
|
|
||||||
$stats['hourly_ips'] = count($hourly);
|
$stats['hourly_ips'] = count($hourly);
|
||||||
$stats['daily_ips'] = count($daily);
|
$stats['daily_ips'] = count($daily);
|
||||||
$stats['bidaily_ips'] = count($bidaily);
|
$stats['weekly_ips'] = count($weekly);
|
||||||
$stats['tridaily_ips'] = count($tridaily);
|
|
||||||
$stats['pph'] = array_sum(array_column($stats['boards'], 'pph'));
|
$stats['pph'] = array_sum(array_column($stats['boards'], 'pph'));
|
||||||
|
|
||||||
return $stats;
|
return $stats;
|
||||||
|
|
Loading…
Reference in New Issue