-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
47 lines (39 loc) · 1.16 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
include 'lib/main.inc.php';
$master = $_GET['master'] ?? false;
$delay = $_GET['delay'] ?? 15;
$test = $_GET['test'] ?? false;
$admin = isset($_GET['admin']);
$anonyme = isset($_GET['anonyme']);
if ($test) {
$delay = 3000;
}
$users = get_users($delay, ['anonyme' => $anonyme, 'micro' => !$admin]);
if ($test) {
while (count($users) < $test) {
$users = array_merge($users, $users);
}
$users = array_slice($users, 0, $test);
}
$total = count($users);
$locations = array_count_values(array_column($users,'location'));
$grid = calculateGridDimensions($total);
$colonnes = $grid['colonnes'];
$lignes = $grid['lignes'];
$cssFile = '/css/trombi.css';
$cssPath = CHEMIN_SITE . $cssFile;
$jsFile = '/trombi.js';
$jsPath = CHEMIN_SITE . $jsFile;
if ($admin) {
noCacheHeaders();
} else {
cacheHeaders(CINQ_MINUTES);
}
?>
<?php include CHEMIN_SITE . 'composants/head.php'; ?>
<?php include CHEMIN_SITE . 'composants/fond.php'; ?>
<div class="wrapper">
<?php include CHEMIN_SITE . 'composants/infos.php'; ?>
<?php include CHEMIN_SITE . 'composants/trombi.php'; ?>
</div>
<?php include CHEMIN_SITE . 'composants/foot.php'; ?>