diff --git a/_sakura/changelog.json b/_sakura/changelog.json index dc52f93..1eea13e 100644 --- a/_sakura/changelog.json +++ b/_sakura/changelog.json @@ -19,7 +19,8 @@ "20150427.8", "20150428", "20150429", - "20150430" + "20150430", + "20150501" ] @@ -846,6 +847,15 @@ "change": "Begin work on management panel." } + ], + + "20150501": [ + + { + "type": "UPD", + "change": "Improve error page." + } + ] } diff --git a/_sakura/components/Main.php b/_sakura/components/Main.php index 6e152db..0dc4129 100644 --- a/_sakura/components/Main.php +++ b/_sakura/components/Main.php @@ -7,8 +7,8 @@ namespace Sakura; class Main { - public static $_MD; // Markdown class container - public static $_IN_MANAGE = false; // Manage thing + public static $_MD; // Markdown class container + public static $_MANAGE_MODE = false; // Management mode // Constructor public static function init($config) { @@ -29,8 +29,11 @@ class Main { // Create new session Session::init(); + // Check if management mode was requested + self::$_MANAGE_MODE = defined('SAKURA_MANAGE'); + // Templating engine - Templates::init(Configuration::getConfig('site_style')); + Templates::init(self::$_MANAGE_MODE ? Configuration::getConfig('manage_style') : Configuration::getConfig('site_style')); // Assign servers file to whois class Whois::setServers(Configuration::getLocalConfig('etc', 'whoisservers')); @@ -73,7 +76,7 @@ class Main { } // Error Handler - public static function ErrorHandler($errno, $errstr, $errfile, $errline) { + public static function errorHandler($errno, $errstr, $errfile, $errline) { // Set some variables to work with including A HUGE fallback hackjob for the templates folder $errstr = str_replace(ROOT, '', $errstr); diff --git a/_sakura/components/Manage.php b/_sakura/components/Manage.php new file mode 100644 index 0000000..0c88f92 --- /dev/null +++ b/_sakura/components/Manage.php @@ -0,0 +1,12 @@ +Failed to load database driver.'); // Set Error handler -set_error_handler(array('Sakura\Main', 'ErrorHandler')); +set_error_handler(array('Sakura\Main', 'errorHandler')); // Initialise Flashii Class Main::init($sakuraConf); @@ -57,6 +58,9 @@ Main::init($sakuraConf); $renderData = array( 'sakura' => [ 'version' => SAKURA_VERSION, + 'vlabel' => SAKURA_VLABEL, + 'vtype' => SAKURA_VTYPE, + 'vcolour' => SAKURA_COLOUR, 'urls' => Configuration::getLocalConfig('urls'), 'charset' => Configuration::getConfig('charset'), 'currentpage' => '//'. $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'], diff --git a/_sakura/templates/broomcloset/global/footer.tpl b/_sakura/templates/broomcloset/global/footer.tpl new file mode 100644 index 0000000..786ab60 --- /dev/null +++ b/_sakura/templates/broomcloset/global/footer.tpl @@ -0,0 +1,7 @@ + + + + + diff --git a/_sakura/templates/broomcloset/global/header.tpl b/_sakura/templates/broomcloset/global/header.tpl new file mode 100644 index 0000000..44f3bad --- /dev/null +++ b/_sakura/templates/broomcloset/global/header.tpl @@ -0,0 +1,40 @@ + + + + + + {{ page.title }} + + {% if page.redirect %} + + {% endif %} + + + + + + + + +
+ + +
diff --git a/_sakura/templates/broomcloset/main/index.tpl b/_sakura/templates/broomcloset/main/index.tpl new file mode 100644 index 0000000..31494db --- /dev/null +++ b/_sakura/templates/broomcloset/main/index.tpl @@ -0,0 +1,3 @@ +{% include 'global/header.tpl' %} +meow +{% include 'global/footer.tpl' %} diff --git a/_sakura/templates/errorPage.tpl b/_sakura/templates/errorPage.tpl index 9370362..b4f99df 100644 --- a/_sakura/templates/errorPage.tpl +++ b/_sakura/templates/errorPage.tpl @@ -1,78 +1,78 @@ - - - - - Flashii Internal Error - - - -
-

An Error occurred while executing the script.

-
-

To prevent potential security risks PHP has stopped execution of the script.

-

PHP Reported the following error log:

-
- {{ error }} -
-
-
-
- Contact the System Operator at me@flash.moe or check our Status Page and Twitter Account to see if anything is going on. -
-
- - + + + + + Flashii Internal Error + + + +
+

An Error occurred while executing the script.

+
+

To prevent potential security risks PHP has stopped execution of the script.

+

PHP Reported the following error log:

+
+ {{ error }} +
+

If you have an account on GitHub please go to the issues section and report the error listed above (do a check to see if it hasn't been reported yet as well).

+
+
+ Contact the System Operator at me@flash.moe or check our Status Page and Twitter Account to see if anything is going on. +
+
+ + diff --git a/content/data/broomcloset/css/manage.css b/content/data/broomcloset/css/manage.css new file mode 100644 index 0000000..d6b6a61 --- /dev/null +++ b/content/data/broomcloset/css/manage.css @@ -0,0 +1,102 @@ +/* + * Broom Closet + */ +@charset "utf-8"; + +/* Standard Elements */ +* { + /* Reset margin and padding */ + margin: 0; + padding: 0; +} +html { + width: 100%; + height: 100%; +} +body { + font: 12px/20px "Segoe UI", sans-serif; + background: #EEE; + color: #000; + height: 100%; + position: relative; + width: 100%; +} + +#container { + min-height: 100%; + position: relative; + width: 100%; +} + +.clear { + clear: both !important; + float: none !important; +} +.hidden { + display: none !important; + visibility: hidden !important; +} + +a { + color: #22E; + text-decoration: none; +} +a:hover { + color: #22E; + text-decoration: underline; +} +a:active { + color: #E22; +} + +/* Page header */ +.header { + background: #222; + color: #FFF; + margin-bottom: 10px; + box-shadow: 0 0 1em #222; +} + +.header > .logo { + font-size: 3em; + line-height: 1.7em; + margin: 0 20px; + color: inherit !important; + text-decoration: none !important; + display: inline-block; +} + +.header > .nav { + padding: 0 0 10px 10px; + font-size: 1.3em; + line-height: 1.4em; + cursor: default; +} + +.header > .nav > div > * { + display: inline-block; +} +.header > .nav > div > div { + min-width: 160px; +} +.header > .nav > div > a { + color: #DDD; + text-decoration: none !important; + padding: 0px 5px 2px; + transition: .2s; +} +.header > .nav > div > a:hover { + background: #333; +} +.header > .nav > div > a:active { + text-shadow: 0 0 1em #F1F1F1; +} + +/* Page footer */ +.footer { + background: #222; + text-align: center; + padding-top: 1px; + margin-top: 10px; + box-shadow: 0 0 1em #222; +} diff --git a/content/data/broomcloset/js/manage.js b/content/data/broomcloset/js/manage.js new file mode 100644 index 0000000..e69de29 diff --git a/content/data/yuuno/css/yuuno.css b/content/data/yuuno/css/yuuno.css index 33653a4..74a1187 100644 --- a/content/data/yuuno/css/yuuno.css +++ b/content/data/yuuno/css/yuuno.css @@ -1,5 +1,5 @@ /* - * Flashii.net Style Codename "Yuuno" + * Codename "Yuuno" */ @charset "utf-8"; diff --git a/manage/.htaccess b/manage/.htaccess index 34dab00..249de75 100644 --- a/manage/.htaccess +++ b/manage/.htaccess @@ -1 +1,18 @@ -# Empty .htaccess to make git realise this directory exists \ No newline at end of file +# Block access to every file starting with a dot + + Require all denied + + +# Set Error documents +ErrorDocument 404 /404.php +ErrorDocument 403 /404.php +ErrorDocument 401 /404.php + +# Rewrite Stuff +RewriteEngine on +RewriteBase / +Options +FollowSymLinks -Indexes + +# Manage pages +RewriteRule ^([a-z\-]+)?/?$ index.php?page=$1&sub=0 +RewriteRule ^([a-z\-]+)/([a-z\-]+)?/?$ index.php?page=$1&sub=$2 diff --git a/manage/404.php b/manage/404.php new file mode 100644 index 0000000..4667d25 --- /dev/null +++ b/manage/404.php @@ -0,0 +1,13 @@ + [ + + 'desc' => 'Moderator actions', + + 'pages' => [ + + 'index' => [ + + 'title' => 'Index', + 'sub' => [ + 'front-page' => [ + + 'desc' => 'Front Page' + + ] + ] + + ], + + 'message-board' => [ + + 'title' => 'Message Board', + 'sub' => [] + + ], + + 'reports' => [ + + 'title' => 'Reports', + 'sub' => [] + + ], + + 'banning' => [ + + 'title' => 'Banning', + 'sub' => [] + + ], + + 'warnings' => [ + + 'title' => 'Warnings', + 'sub' => [] + + ], + + 'user-notes' => [ + + 'title' => 'User notes', + 'sub' => [] + + ], + + 'action-logs' => [ + + 'title' => 'Action Logs', + 'sub' => [] + + ] + + ] + + ], + + // Administrative + 'adm' => [ + + 'desc' => 'Administrator actions', + + 'pages' => [ + + 'statistics' => [ + + 'title' => 'Statistics', + 'sub' => [] + + ], + + 'general-settings' => [ + + 'title' => 'General Settings', + 'sub' => [] + + ], + + 'users' => [ + + 'title' => 'Users', + 'sub' => [] + + ], + + 'ranks' => [ + + 'title' => 'Ranks', + 'sub' => [] + + ], + + 'permissions' => [ + + 'title' => 'Permissions', + 'sub' => [] + + ], + + 'customise' => [ + + 'title' => 'Customise', + 'sub' => [] + + ], + + 'system' => [ + + 'title' => 'System', + 'sub' => [] + + ] + + ] + + ] + +]; + +// Add page specific things +$renderData['page'] = [ + + 'title' => 'Manage Index', + 'pages' => $managePages, + 'activepage' => , + 'subs' => , + 'activesub' => + +]; // Print page contents -print Templates::render('login.tpl', $renderData); +print Templates::render('main/index.tpl', $renderData);