Example #1
0
<title>Warnings - <?php 
echo $page->settings->name;
?>
</title>
<div class="container">
    <?php 
$page->print_page_header("Warnings");
?>
    <div class="row" style="margin-bottom:60px;">
        <div class="col-lg-12">
            <table class="table table-hover table-bordered table-condensed">
                <?php 
$page->print_table_headers(array("Name", "Warned By", "Reason", "Warned Until", "Received Warning?"));
$result = $page->run_query($page->settings->table_warnings);
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
    $player_name = $page->get_name($row['uuid']);
    if ($player_name === null) {
        continue;
    }
    $until = $page->millis_to_date($row['until']);
    ?>
                    <tr>
                        <td><?php 
    echo $page->get_avatar($player_name);
    ?>
</td>
                        <td><?php 
    echo $page->get_avatar($page->get_banner_name($row));
    ?>
</td>
                        <td style="width: 30%;"><?php 
Example #2
0
$site->protocol = '';
//no protocol, so the page's default (http or https) will be used
if ($site->development == true) {
    $site->ace_scripts = array();
    $scripts = json_decode(file_get_contents($path['assets'] . '/js/ace/scripts.json'));
    foreach ($scripts as $name => $include) {
        if ($include) {
            $site->ace_scripts[] = $name;
        }
    }
}
//if no such page, then show 404 page!
if (!is_file($path['data'] . "/pages/{$page_name}.json")) {
    $page_name = "error-404";
}
$sidenav = new Sidenav();
$page = new Page(array('path' => $path, 'name' => $page_name, 'type' => 'page'));
$layout_name = $page->get_var('layout');
$layout = new Page(array('path' => $path, 'name' => $layout_name, 'type' => 'layout'));
if ($navList =& $layout->get_var('sidebar_items')) {
    $sidenav->set_items($navList);
    $sidenav->mark_active_item($page_name);
}
//now make an engine, with custom loader, pass page&layout name to it and let it autoload!
$engine = new Mustache_Engine(array('cache' => '_cache', 'partials_loader' => new CustomLoader($path['views'], array('layout' => $layout_name, 'page' => $page->get_name()))));
$context = array("page" => $page->get_vars(), "layout" => $layout->get_vars(), "path" => $path, "site" => $site);
$context['breadcrumbs'] = $sidenav->get_breadcrumbs();
$context['createLinkFunction'] = function ($value) {
    return '?page=' . $value;
};
echo $engine->render($layout->get_template(), $context);