From 7ee70b396618d83ce978599da5a9d0e7d8e29a9e Mon Sep 17 00:00:00 2001 From: flashwave Date: Thu, 30 Jul 2015 20:51:24 +0200 Subject: [PATCH] posting --- _sakura/changelog.json | 4 ++ _sakura/components/Main.php | 14 +++++ _sakura/templates/yuuno/forum/forumEntry.tpl | 2 +- _sakura/templates/yuuno/forum/posting.tpl | 60 ++++++++++++++++++++ content/data/yuuno/css/yuuno.css | 51 ++++++++++++++++- main/posting.php | 19 ++++++- main/support.php | 2 +- 7 files changed, 148 insertions(+), 4 deletions(-) create mode 100644 _sakura/templates/yuuno/forum/posting.tpl diff --git a/_sakura/changelog.json b/_sakura/changelog.json index e339904..b8366ba 100644 --- a/_sakura/changelog.json +++ b/_sakura/changelog.json @@ -1563,6 +1563,10 @@ { "type": "FIX", "change": "Fixed background colours on the search page looking slightly mentally challenged." + }, + { + "type": "ADD", + "change": "Added draft for posting page." } ] diff --git a/_sakura/components/Main.php b/_sakura/components/Main.php index 3f3c642..4388dd5 100644 --- a/_sakura/components/Main.php +++ b/_sakura/components/Main.php @@ -64,6 +64,13 @@ class Main { } + // Get bbcodes + public static function getBBcodes() { + + return Database::fetch('bbcodes'); + + } + // Parse bbcodes public static function bbParse($text) { @@ -88,6 +95,13 @@ class Main { } + // Get emoticons + public static function getEmotes() { + + return Database::fetch('emoticons'); + + } + // Parsing emoticons public static function parseEmotes($text) { diff --git a/_sakura/templates/yuuno/forum/forumEntry.tpl b/_sakura/templates/yuuno/forum/forumEntry.tpl index 4282691..fa9b931 100644 --- a/_sakura/templates/yuuno/forum/forumEntry.tpl +++ b/_sakura/templates/yuuno/forum/forumEntry.tpl @@ -29,7 +29,7 @@
{% if forum.last_poster.user.id %} - {{ forum.last_poster.post.post_subject }}
{{ forum.last_poster.elap }} by {% if forum.last_poster.user.id %}{{ forum.last_poster.user.username }}{% else %}[deleted user]{% endif %} + {{ forum.last_poster.post.post_subject }}
{{ forum.last_poster.elap }} by {% if forum.last_poster.user.id %}{{ forum.last_poster.user.username }}{% else %}[deleted user]{% endif %} {% else %} There are no posts in this forum.
  {% endif %} diff --git a/_sakura/templates/yuuno/forum/posting.tpl b/_sakura/templates/yuuno/forum/posting.tpl new file mode 100644 index 0000000..730fbde --- /dev/null +++ b/_sakura/templates/yuuno/forum/posting.tpl @@ -0,0 +1,60 @@ +{% include 'global/header.tpl' %} +
+
+
+
Forum / Posting
+
+ +
+
+
+ {% for bbcode in posting.bbcodes %} + {% if bbcode.on_posting %} + + {% endif %} + {% endfor %} +
+
+
+ Hover over a styling button to view a short description of what it does. +
+
+
+ +
+
+
+ {% for emoticon in posting.emoticons %} + {{ emoticon.emote_string }} + {% endfor %} +
+
+
+
+
+ +
+
+ +
+
+
+ + +
+
+
+
+
+ + + +
+
+
+
+{% include 'global/footer.tpl' %} diff --git a/content/data/yuuno/css/yuuno.css b/content/data/yuuno/css/yuuno.css index 62ce94a..cdf56dd 100644 --- a/content/data/yuuno/css/yuuno.css +++ b/content/data/yuuno/css/yuuno.css @@ -337,6 +337,7 @@ a.gotop.exit { .support .head, .viewforum .head, .viewtopic .head, +.posting .head, .loginPage > .loginCont .head, .messages .head { margin: -1px -2px; @@ -1462,7 +1463,8 @@ button.inputStyling { input[type="submit"].inputStyling.small, input[type="button"].inputStyling.small, -input[type="reset"].inputStyling.small { +input[type="reset"].inputStyling.small, +button.inputStyling.small { padding: 0 4px 1px; margin: -2px 0 0; font-size: 16px; @@ -1770,6 +1772,53 @@ textarea.inputStyling { overflow: auto; } +.forum.posting .posting-subject { + padding: 3px 0 2px; +} + +.forum.posting .posting-subject input { + width: calc(100% - 10px); +} + +.forum.posting .posting-bbcodes { + padding: 4px 0 2px; +} + +.forum.posting .posting-bbcode-description { + font: .9em/1.2em "SegoeUI", "Segoe UI", sans-serif; + padding: 2px 0 3px; +} + +.forum.posting .posting-text { + padding: 2px 0 0; + margin: 0 0 -1px; +} + +.forum.posting .posting-emotes { + text-align: center; + padding: 10px 0; +} + +.forum.posting .posting-emotes img { + vertical-align: middle; + cursor: pointer; + margin: 0 3px; +} + +.forum.posting .posting-text textarea { + width: calc(100% - 10px); + min-height: 300px; +} + +.forum.posting .posting-options > div { + float: left; + padding: 10px 10px 0; +} + +.forum.posting .posting-buttons { + text-align: center; +} + .forum .buttonRow .leftSide { float: left; } diff --git a/main/posting.php b/main/posting.php index 7d90e54..bffdd4d 100644 --- a/main/posting.php +++ b/main/posting.php @@ -8,4 +8,21 @@ namespace Sakura; // Include components require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) .'_sakura/sakura.php'; -print 'posting ui'; \ No newline at end of file + +// Set location +$locId = isset($_GET['f']) ? $_GET['f'] : (isset($_GET['t']) ? $_GET['t'] : (isset($_GET['p']) ? Forum::getTopicIdFromPostId($_GET['p']) : 0)); +$locMode = isset($_GET['f']) ? 'f' : (isset($_GET['t']) || isset($_GET['p']) ? 't' : null); + +// Set additional render data +$renderData = array_merge($renderData, [ + + 'posting' => [ + + 'emoticons' => Main::getEmotes(), + 'bbcodes' => Main::getBBcodes() + + ] + +]); + +print Templates::render('forum/posting.tpl', $renderData); diff --git a/main/support.php b/main/support.php index f15d0ed..7ef6adb 100644 --- a/main/support.php +++ b/main/support.php @@ -128,7 +128,7 @@ $renderData['page'] = [ 'title' => 'Support '. Configuration::getConfig('sitename'), 'fail' => isset($_GET['fail']), 'price' => Configuration::getConfig('premium_price_per_month'), - 'current' => ($currentPremium = Users::checkUserPremium(Session::$userId)), + 'current' => Users::checkUserPremium(Session::$userId), 'amount_max' => Configuration::getConfig('premium_amount_max') ];