posting
This commit is contained in:
parent
d059fcb90b
commit
7ee70b3966
7 changed files with 148 additions and 4 deletions
|
@ -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."
|
||||
}
|
||||
|
||||
]
|
||||
|
|
|
@ -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) {
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
<td class="forumLastColumn">
|
||||
<div>
|
||||
{% if forum.last_poster.user.id %}
|
||||
<a href="//{{ sakura.urls.main }}/forum/thread/{{ forum.last_poster.post.topic_id }}" class="default">{{ forum.last_poster.post.post_subject }}</a><br /><span title="{{ forum.last_poster.post.post_time|date("r") }}">{{ forum.last_poster.elap }}</span> by {% if forum.last_poster.user.id %}<a href="//{{ sakura.urls.main }}/u/{{ forum.last_poster.user.id }}" class="default" style="color: {% if forum.last_poster.user.name_colour %}{{ forum.last_poster.user.name_colour }}{% else %}{{ forum.last_poster.rank.colour }}{% endif %};">{{ forum.last_poster.user.username }}</a>{% else %}[deleted user]{% endif %} <a href="/forum/post/{{ forum.last_poster.post.post_id }}#p{{ forum.last_poster.post.post_id }}" class="default fa fa-tag"></a>
|
||||
<a href="//{{ sakura.urls.main }}/forum/thread/{{ forum.last_poster.post.topic_id }}" class="default">{{ forum.last_poster.post.post_subject }}</a><br /><span title="{{ forum.last_poster.post.post_time|date(sakura.date_format) }}">{{ forum.last_poster.elap }}</span> by {% if forum.last_poster.user.id %}<a href="//{{ sakura.urls.main }}/u/{{ forum.last_poster.user.id }}" class="default" style="color: {% if forum.last_poster.user.name_colour %}{{ forum.last_poster.user.name_colour }}{% else %}{{ forum.last_poster.rank.colour }}{% endif %};">{{ forum.last_poster.user.username }}</a>{% else %}[deleted user]{% endif %} <a href="/forum/post/{{ forum.last_poster.post.post_id }}#p{{ forum.last_poster.post.post_id }}" class="default fa fa-tag"></a>
|
||||
{% else %}
|
||||
There are no posts in this forum.<br />
|
||||
{% endif %}
|
||||
|
|
60
_sakura/templates/yuuno/forum/posting.tpl
Normal file
60
_sakura/templates/yuuno/forum/posting.tpl
Normal file
|
@ -0,0 +1,60 @@
|
|||
{% include 'global/header.tpl' %}
|
||||
<div class="content">
|
||||
<div class="content-column forum posting">
|
||||
<form method="post" action="{{ sakura.currentpage }}">
|
||||
<div class="head">Forum / Posting</div>
|
||||
<div class="posting-subject">
|
||||
<input type="text" class="inputStyling" name="subject" placeholder="Subject" />
|
||||
</div>
|
||||
<hr class="default" />
|
||||
<div class="posting-bbcodes">
|
||||
{% for bbcode in posting.bbcodes %}
|
||||
{% if bbcode.on_posting %}
|
||||
<button type="button" class="inputStyling small">{{ bbcode.title }}</button>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<hr class="default" />
|
||||
<div class="posting-bbcode-description" id="bbcodedescr">
|
||||
Hover over a styling button to view a short description of what it does.
|
||||
</div>
|
||||
<hr class="default" />
|
||||
<div class="posting-text">
|
||||
<textarea class="inputStyling" name="text" id="postingText"></textarea>
|
||||
</div>
|
||||
<hr class="default" />
|
||||
<div class="posting-emotes">
|
||||
{% for emoticon in posting.emoticons %}
|
||||
<img src="//{{ sakura.urls.content }}/{{ emoticon.emote_path }}" alt="{{ emoticon.emote_string }}" title="{{ emoticon.emote_string }}" />
|
||||
{% endfor %}
|
||||
</div>
|
||||
<hr class="default" />
|
||||
<div class="posting-options">
|
||||
<div>
|
||||
<div>
|
||||
<input type="checkbox" id="enableSig" checked="checked" /> <label for="enableSig">Attach Signature</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" id="enableEmotes" checked="checked" /> <label for="enableEmotes">Parse emoticons</label>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="parseMode">Parsing Mode:</label>
|
||||
<select>
|
||||
<option>None</option>
|
||||
<option selected="selected">BBCodes</option>
|
||||
<option>Markdown</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<hr class="default" />
|
||||
<div class="posting-buttons">
|
||||
<input class="inputStyling" type="submit" name="preview" value="Preview" />
|
||||
<input class="inputStyling" type="submit" name="post" value="Post" />
|
||||
<input class="inputStyling" type="submit" name="cancel" value="Cancel" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% include 'global/footer.tpl' %}
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -8,4 +8,21 @@ namespace Sakura;
|
|||
|
||||
// Include components
|
||||
require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) .'_sakura/sakura.php';
|
||||
print 'posting ui';
|
||||
|
||||
// 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);
|
||||
|
|
|
@ -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')
|
||||
];
|
||||
|
||||
|
|
Reference in a new issue