From 8c4989c37b7db18a5c270b6c77a175c893c2cb78 Mon Sep 17 00:00:00 2001 From: flashwave Date: Fri, 21 Sep 2018 00:56:14 +0200 Subject: [PATCH] info beginnings, still gotta style this --- CODE_OF_CONDUCT.md | 2 ++ docs/site/privacy.md | 3 ++ docs/site/rules.md | 66 ++++++++++++++++++++++++++++++++++++++ docs/site/terms.md | 5 +++ public/info.php | 64 ++++++++++++++++++++++++++++++++++++ templates/info/index.twig | 25 +++++++++++++++ templates/info/master.twig | 1 + templates/info/view.twig | 14 ++++++++ 8 files changed, 180 insertions(+) create mode 100644 docs/site/privacy.md create mode 100644 docs/site/rules.md create mode 100644 docs/site/terms.md create mode 100644 public/info.php create mode 100644 templates/info/index.twig create mode 100644 templates/info/master.twig create mode 100644 templates/info/view.twig diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 7c6e99dd..fd7d251d 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1 +1,3 @@ +# Code of Conduct + p: diff --git a/docs/site/privacy.md b/docs/site/privacy.md new file mode 100644 index 00000000..8d92d2b7 --- /dev/null +++ b/docs/site/privacy.md @@ -0,0 +1,3 @@ +# Privacy Policy + +Remind me to write this. diff --git a/docs/site/rules.md b/docs/site/rules.md new file mode 100644 index 00000000..bcd27503 --- /dev/null +++ b/docs/site/rules.md @@ -0,0 +1,66 @@ +# Rules + +## Global Rules +All of these rules are in effect on any place on the site unless explicitly stated otherwise. + +1. **Spamming/flooding is not allowed unless otherwise stated.** +One-off jokes are fine, don't overdo it. + +1. **Be decent towards each other.** +Respect is not a given but that does not make for an excuse for baseless antagonisation. + +1. **If you have a problem with someone, point it out.** +Don't be passive aggressive. + +1. **NSFW content is disallowed unless otherwise stated.** +This includes anything sexually suggestive. + +1. **Content considered illegal in the United States and/or the Netherlands is never allowed.** +The server is hosted in the Netherlands and the majority user base is in the United States. +There will never be exceptions to this. + +1. **Users may only have a single account.** +Flashii provides a number of services where having multiple accounts could grant unfair advantages. +Exceptions may be granted for bot accounts. + +1. **Keep political discussions to an absolute minimum.** +There is a time and place for it, but Flashii is intended to be a footloose and fancy-free community. +Moderator intervention will be used for petty shouting matches. + +1. **You must be at least 13 years of age on the Gregorian calendar.** +When validating this a staff member will always ask this in a direct message, never in public channels. + +1. **Link shorteners are not allowed.** +Harmless links will result in a warning, malicious links will result in a ban. + +1. **Self promotion is not allowed.** +You CAN show off your creations, however blatant advertising _not relevant to a conversation/channel topic_ is not allowed. + +## Forum Rules +1. **Defacing posts is not allowed.** +If you blank one of your posts, it will be restored and you will be warned. +If you have a legitimate reason for this, talk to a staff member. + +1. **Abusing post formatting tools is not allowed.** +This includes using a persistent font colour as an "avatar", but excludes making a flashy opening post to your topic. + +1. **Don't make trivial posts.** +Replying with `same` isn't constructive. + +## Chat Rules +1. **Persistent typing quirks are not allowed.** +This applies where Global Rule 1 applies. + +1. **Try to keep topics to their own channels** +If a lengthy discussion shifts to a topic that has its own channel, try to move the discussion to that channel. Action will be taken only for repeated, flagrant offences. + +## Game Service Rules +1. **Play fairly.** +Do not use exploits to gain unfair advantages. + +## What happens if I break rules? +Major offenses will result in a ban. +Minor offenses will result in warnings; however, after five warnings you will be banned. +A warning is retained for ninety (90) days. +Depending on moderator discretion, you may be banned prior to five warnings, and this warning threshold may change at any time. +Permanent bans are reserved for serious or blatantly repetitious violations, and will be issued by administrators. diff --git a/docs/site/terms.md b/docs/site/terms.md new file mode 100644 index 00000000..fa413495 --- /dev/null +++ b/docs/site/terms.md @@ -0,0 +1,5 @@ +# Terms of Service + +Remind me to write this too. +Don't expect cool legalspeak, I'm a human being. +Refer to the regular rules for now. diff --git a/public/info.php b/public/info.php new file mode 100644 index 00000000..ad316f94 --- /dev/null +++ b/public/info.php @@ -0,0 +1,64 @@ + '', + 'title' => '', +]; + +$isMisuzuDoc = $pathInfo === '/misuzu' || starts_with($pathInfo, '/misuzu/'); + +if ($isMisuzuDoc) { + $filename = substr($pathInfo, 8); + $filename = empty($filename) ? 'README' : strtoupper($filename); + + if ($filename !== 'README') { + $titleSuffix = ' - Misuzu Project'; + } +} else { + $filename = strtolower(substr($pathInfo, 1)); +} + +if (!preg_match('#^([A-Za-z0-9_]+)$#', $filename)) { + echo render_error(404); + return; +} + +if ($filename !== 'LICENSE') { + $filename .= '.md'; +} + +$filename = __DIR__ . '/../' . ($isMisuzuDoc ? '' : 'docs/site/') . $filename; +$document['content'] = is_file($filename) ? file_get_contents($filename) : ''; + +if (empty($document['content'])) { + echo render_error(404); + return; +} + +if (empty($document['title'])) { + if (starts_with($document['content'], '# ')) { + $titleOffset = strpos($document['content'], "\n"); + $document['title'] = trim(substr($document['content'], 2, $titleOffset - 1)); + $document['content'] = substr($document['content'], $titleOffset); + } else { + $document['title'] = ucfirst(basename($filename)); + } + + if (!empty($titleSuffix)) { + $document['title'] .= $titleSuffix; + } +} + +echo tpl_render('info.view', [ + 'document' => $document, +]); diff --git a/templates/info/index.twig b/templates/info/index.twig new file mode 100644 index 00000000..4c92fcce --- /dev/null +++ b/templates/info/index.twig @@ -0,0 +1,25 @@ +{% extends 'info/master.twig' %} + +{% set title = 'Info' %} + +{% block content %} +
+
+ Flashii Informational Pages +
+
+

Here's a listing of a few informational pages that'll probably come in handy during your Flashii Experience™.

+ +
+
+{% endblock %} diff --git a/templates/info/master.twig b/templates/info/master.twig new file mode 100644 index 00000000..fc530f21 --- /dev/null +++ b/templates/info/master.twig @@ -0,0 +1 @@ +{% extends 'master.twig' %} diff --git a/templates/info/view.twig b/templates/info/view.twig new file mode 100644 index 00000000..954bd6bd --- /dev/null +++ b/templates/info/view.twig @@ -0,0 +1,14 @@ +{% extends 'info/master.twig' %} + +{% set title = document.title %} + +{% block content %} +
+
+ {{ document.title }} +
+
+ {{ document.content|parse_text('md')|raw }} +
+
+{% endblock %}