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/infopage.php

31 lines
779 B
PHP
Raw Normal View History

2015-04-01 17:25:14 +00:00
<?php
/*
* Sakura Info Page Handler
*/
// 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:25:14 +00:00
2015-04-01 17:34:36 +00:00
// Set default variables
2015-04-01 17:25:14 +00:00
$renderData['page'] = [
2015-04-01 17:27:42 +00:00
'title' => 'Info pages',
2015-04-01 17:45:05 +00:00
'content' => Main::mdParse("# Unable to load the requested info page.\r\n\r\nCheck the URL and try again.")
2015-04-01 17:25:14 +00:00
];
2015-04-01 17:45:05 +00:00
// Get info page data from the database
if($ipData = Main::loadInfoPage(isset($_GET['r']) ? strtolower($_GET['r']) : '')) {
// Assign new proper variable
$renderData['page'] = [
2015-04-02 13:31:52 +00:00
'title' => $ipData['pagetitle'],
2015-04-01 17:45:05 +00:00
'content' => Main::mdParse($ipData['content'])
2015-04-01 17:45:34 +00:00
];
2015-04-01 17:45:05 +00:00
}
2015-04-01 17:34:36 +00:00
2015-04-01 17:25:14 +00:00
// Print page contents
print Main::$_TPL->render('main/infopage.tpl', $renderData);