From 5c73e47908157d5a244a0728029f42b9eace9ea9 Mon Sep 17 00:00:00 2001 From: flashwave Date: Mon, 14 Dec 2015 00:29:53 +0100 Subject: [PATCH] r20151213 late edition Signed-off-by: Flashwave --- libraries/Forum/Post.php | 9 ++++ public/content/data/misaki/css/misaki.css | 26 +++++++---- public/posting.php | 15 ++++--- sakura.php | 2 +- .../misaki/elements/settingsNavigation.tpl | 3 -- templates/misaki/main/settings.tpl | 13 +++--- templates/misaki/settings/general.home.tpl | 6 ++- templates/misaki/settings/general.options.tpl | 45 +++++++------------ templates/yuuno/forum/viewtopic.tpl | 2 +- 9 files changed, 64 insertions(+), 57 deletions(-) delete mode 100644 templates/misaki/elements/settingsNavigation.tpl diff --git a/libraries/Forum/Post.php b/libraries/Forum/Post.php index 52f2b5e..d79d6ec 100644 --- a/libraries/Forum/Post.php +++ b/libraries/Forum/Post.php @@ -9,6 +9,7 @@ use Sakura\Main; use Sakura\Database; use Sakura\User; use Sakura\BBcode; +use Sakura\Config; /** * Class Post @@ -62,6 +63,14 @@ class Post // Create a new post public static function create($subject, $text, User $poster, $thread = 0, $forum = 0) { + // Check if the data meets the requirements + if (strlen($subject) < Config::get('forum_title_min') + || strlen($subject) > Config::get('forum_title_max') + || strlen($text) < Config::get('forum_text_min') + || strlen($text) > Config::get('forum_text_max')) { + return null; + } + // If no thread is specified create a new one if ($thread) { $thread = new Thread($thread); diff --git a/public/content/data/misaki/css/misaki.css b/public/content/data/misaki/css/misaki.css index 547ce0f..4e7f19a 100644 --- a/public/content/data/misaki/css/misaki.css +++ b/public/content/data/misaki/css/misaki.css @@ -72,16 +72,17 @@ h5, h6 { font-family: "Exo2-0-LightItalic", sans-serif; font-weight: 100; + color: #ab95bf; + text-shadow: 1px 1px 2px rgba(0, 0, 0, .75); } -h1.sectionHead { - font-style: italic; - font-size: 5em; - color: rgb(148, 117, 178); - opacity: 0.5; - font-weight: 100; - line-height: 1.2em; - margin: 10px 20px; +.box h1, +.box h2, +.box h3, +.box h4, +.box h5, +.box h6 { + color: #fff; } a.clean, @@ -233,13 +234,20 @@ a:active { background: #231C29; box-shadow: 0 2px 6px rgba(0, 0, 0, .75); padding: 2px; - border: 1px solid rgba(148, 117, 178, .6); + border: 1px solid #67517b; } .platform:not(:last-child) { margin-bottom: 5px; } +.box { + margin: 10px; + padding: 5px; + background: #3A2E44; + box-shadow: 0 2px 6px rgba(0, 0, 0, .75); +} + /* * Header navigation */ diff --git a/public/posting.php b/public/posting.php index bcebd03..ea4bbee 100644 --- a/public/posting.php +++ b/public/posting.php @@ -24,9 +24,14 @@ $_GET['t'] : 0 ); +// Get the topic +if ($topicId) { + $thread = new Forum\Thread($topicId); +} + $forumId = isset($_GET['f']) ? $_GET['f'] : -($thread = new Forum\Thread($topicId))->forum; +$thread->forum; $mode = isset($_GET['f']) ? 'f' : (isset($_GET['t']) ? 't' : (isset($_GET['p']) ? 'p' : null)); @@ -172,13 +177,13 @@ if ($mode != 'f') { // Check if a post is being made if (isset($_POST['post'])) { // Attempt to make the post - $post = Forum\Post::create($_POST['subject'], $_POST['text'], $currentUser, $topicId, $forumId); + $post = Forum\Post::create($_POST['subject'], $_POST['text'], $currentUser, $topicId, $forumId); // Add page specific things $renderData['page'] = [ - 'redirect' => $urls->format('FORUM_POST', [$post->id]) . '#p' . $post->id, - 'message' => 'Made the post!', - 'success' => 1, + 'redirect' => $post ? $urls->format('FORUM_POST', [$post->id]) . '#p' . $post->id : '', + 'message' => $post ? 'Made the post!' : 'Something is wrong with your post!', + 'success' => $post ? 1 : 0, ]; // Print page contents or if the AJAX request is set only display the render data diff --git a/sakura.php b/sakura.php index bac2032..37846a7 100644 --- a/sakura.php +++ b/sakura.php @@ -8,7 +8,7 @@ namespace Sakura; // Define Sakura version -define('SAKURA_VERSION', '20151212'); +define('SAKURA_VERSION', '20151213'); define('SAKURA_VLABEL', 'Eminence'); define('SAKURA_COLOUR', '#6C3082'); diff --git a/templates/misaki/elements/settingsNavigation.tpl b/templates/misaki/elements/settingsNavigation.tpl deleted file mode 100644 index a849cbe..0000000 --- a/templates/misaki/elements/settingsNavigation.tpl +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/templates/misaki/main/settings.tpl b/templates/misaki/main/settings.tpl index e1e1df2..1922fbb 100644 --- a/templates/misaki/main/settings.tpl +++ b/templates/misaki/main/settings.tpl @@ -3,16 +3,15 @@ {% block title %}{{ page.category }} / {{ page.mode }}{% endblock %} {% block content %} - {% include 'elements/settingsNavigation.tpl' %} -
+

- {{ page.category }} / {{ page.mode }} + {{ page.category }}
{{ page.mode }}

-
+

{% for descline in page.description %} -
{{ include(template_from_string(descline)) }}
+ {{ include(template_from_string(descline)) }} {% endfor %} -

- {% include 'settings/' ~ current ~ '.tpl' %} +
+ {% include 'settings/' ~ current ~ '.tpl' %} {% endblock %} diff --git a/templates/misaki/settings/general.home.tpl b/templates/misaki/settings/general.home.tpl index 27fb5a4..7d28001 100644 --- a/templates/misaki/settings/general.home.tpl +++ b/templates/misaki/settings/general.home.tpl @@ -1,2 +1,4 @@ -

READ THIS BEFORE PUKING

-These template files were quickly thrown into place to allow switching between the development style and the stable one. You can switch in the Site Options section. +
+

There's nothing here yet...

+

...aside from Site Options.

+
\ No newline at end of file diff --git a/templates/misaki/settings/general.options.tpl b/templates/misaki/settings/general.options.tpl index bacccf2..fc49832 100644 --- a/templates/misaki/settings/general.options.tpl +++ b/templates/misaki/settings/general.options.tpl @@ -1,31 +1,18 @@ -{% if options.fields %} -
- - - - {% for field in options.fields %} -
-
-

{{ field.option_name }}

-
- {{ field.option_description }} -
-
-
- -
+ + + + + {% for field in options.fields %} +
+
+

{{ field.option_name }}

+

{{ field.option_description }}

+
+
+
- {% endfor %} -
- -
- - -{% else %} -

There are currently no changeable options.

-{% endif %} + {% endfor %} + + + diff --git a/templates/yuuno/forum/viewtopic.tpl b/templates/yuuno/forum/viewtopic.tpl index 4cac7d1..11d720d 100644 --- a/templates/yuuno/forum/viewtopic.tpl +++ b/templates/yuuno/forum/viewtopic.tpl @@ -14,7 +14,7 @@ {% endif %} {% endfor %} - {% set num = (num / 10)|round + 1 %} + {% set num = (num / 10)|round(0, 'floor') + 1 %} {% set get = get|merge({'page': num}) %} {% endif %}