This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/main/index.php

27 lines
871 B
PHP
Raw Normal View History

2015-04-01 17:05:55 +00:00
<?php
/*
* Sakura Main Index
*/
// Declare Namespace
namespace Sakura;
// Include components
2015-04-06 16:15:20 +00:00
require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) .'_sakura/sakura.php';
2015-04-01 17:05:55 +00:00
// Add page specific things
$renderData['page'] = [
'title' => 'Flashii Dev',
'newsComments' => false
2015-04-01 17:05:55 +00:00
];
2015-04-02 14:03:58 +00:00
$renderData['stats'] = [
'userCount' => ($userCount = count($users = Users::getAllUsers())) .' user'. ($userCount == 1 ? '' : 's'),
'newestUser' => max($users),
'lastRegDate' => ($lastRegDate = date_diff(date_create(date('Y-m-d', max($users)['regdate'])), date_create(date('Y-m-d')))->format('%a')) .' day'. ($lastRegDate == 1 ? '' : 's'),
2015-04-02 14:04:26 +00:00
'chatOnline' => ($chatOnline = 0) .' user'. ($chatOnline == 1 ? '' : 's')
2015-04-02 14:03:58 +00:00
];
2015-04-01 17:05:55 +00:00
$renderData['newsPosts'] = Main::getNewsPosts(3);
// Print page contents
2015-04-02 13:41:05 +00:00
print Main::tplRender('main/index.tpl', $renderData);