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' %} -