mirror of https://github.com/PurpleI2P/regi2p.git
Domain registry project
http://reg.i2p/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.4 KiB
47 lines
1.4 KiB
<?php |
|
|
|
require_once __DIR__ . '/../vendor/autoload.php'; |
|
require_once __DIR__ . '/../config.php'; |
|
|
|
/* Initialize Twig engine */ |
|
$loader = new \Twig\Loader\FilesystemLoader(__DIR__ . '/../templates'); |
|
$twig = new \Twig\Environment($loader, [ |
|
'cache' => __DIR__ . '/../cache', |
|
'auto_reload' => true, |
|
]); |
|
|
|
$all = false; |
|
$pdo = (new App\DB($options))->pdo; |
|
$subscrs = array(); |
|
|
|
if (isset($_GET["all"])) |
|
$all = true; |
|
|
|
if ($options['fetcher']) { |
|
$STH = $pdo->query ("SELECT `name` FROM `subscriptions` WHERE `active` = 1"); |
|
$STH->setFetchMode(PDO::FETCH_ASSOC); |
|
$subscrs = $STH->fetchAll(); |
|
} |
|
|
|
$STH = $pdo->query ("SELECT COUNT(*) FROM `hosts` WHERE `blacklisted` = 1"); |
|
$blackcnt = $STH->fetchColumn(); |
|
|
|
$vars = array( |
|
'activation' => $options['approval'], |
|
'actdelay' => $options['approvedelay'], |
|
'actseen' => $options['approveseen'], |
|
'newdays' => $options['newdays'], |
|
'olddays' => $options['olddays'], |
|
'delnewdays' => $options['delnewdays'], |
|
'delactdays' => $options['delapprdays'], |
|
'delstabdays' => $options['delstabdays'], |
|
'hidedays' => $options['hidedays'], |
|
'fullhour' => $options['fullhour'], |
|
'fetcher' => $options['fetcher'], |
|
'subscrs' => $subscrs, |
|
'blackcnt' => $blackcnt, |
|
'all' => $all |
|
); |
|
|
|
$template = $twig->load('home.twig'); |
|
echo $template->render($vars);
|
|
|