36 lines
1.1 KiB
PHP
36 lines
1.1 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace Mcp\Api;
|
|
|
|
use Mcp\OpenSim;
|
|
|
|
class ViewerWelcomePage extends \Mcp\RequestHandler
|
|
{
|
|
public function get(): void
|
|
{
|
|
$images = array();
|
|
if ($handle = opendir('./data/viewerWelcomeImages')) {
|
|
while (false !== ($entry = readdir($handle))) {
|
|
if ($entry != "." && $entry != "..") {
|
|
$images[] = "./data/viewerWelcomeImages/".$entry;
|
|
}
|
|
}
|
|
|
|
closedir($handle);
|
|
}
|
|
|
|
shuffle($images);
|
|
|
|
$opensim = new OpenSim($this->app->db());
|
|
|
|
$this->app->template('viewerWelcomeImages.php')->vars([
|
|
'title' => 'Splash',
|
|
'grid-name' => $this->app->config('grid')['name'],
|
|
'news' => $this->app->config('grid')['main-news']
|
|
])->unsafeVar('json-image-array', json_encode($images))
|
|
->unsafeVar('stats', "Registrierte User: ".$opensim->getUserCount()."<br>Regionen: ".$opensim->getRegionCount()."<br>Aktuell Online: ".($opensim->getOnlineCount()-1))
|
|
->render();
|
|
}
|
|
}
|