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/public/members.php

44 lines
1.2 KiB
PHP
Raw Normal View History

2015-04-27 21:07:48 +00:00
<?php
/*
* Sakura Memberlist
*/
// Declare Namespace
namespace Sakura;
// Include components
require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) . 'sakura.php';
2015-04-27 21:07:48 +00:00
// Initialise templating engine
$template = new Template();
// Change templating engine
$template->setTemplate($templateName);
// CHeck if the user is logged in
if (Users::checkLogin()) {
// Add page specific things
2016-01-20 23:06:21 +00:00
$renderData['memberlist'] = [
'ranks' => ($_MEMBERLIST_RANKS = Users::getAllRanks()),
2015-09-14 21:41:43 +00:00
'active' => ($_MEMBERLIST_ACTIVE = (
isset($_GET['rank'])
&& $_GET['rank']
&& array_key_exists($_GET['rank'], $_MEMBERLIST_RANKS) ? $_GET['rank'] : 0
)),
2016-01-22 20:07:44 +00:00
'users' => ($_MEMBERLIST_ACTIVE ? Users::getUsersInRank($_MEMBERLIST_ACTIVE) : Users::getAllUsers(false)),
2016-01-20 23:06:21 +00:00
'membersPerPage' => Config::get('members_per_page'),
];
// Set parse variables
$template->setVariables($renderData);
// Print page contents
echo $template->render('main/memberlist');
} else {
// Set parse variables
$template->setVariables($renderData);
// Print page contents
echo $template->render('global/restricted');
}