r20151020.1

Signed-off-by: Flashwave <me@flash.moe>
This commit is contained in:
flash 2015-10-20 02:49:09 +02:00
parent 59460fb22a
commit d73b73c026
3 changed files with 51 additions and 20 deletions

View file

@ -8,7 +8,7 @@
namespace Sakura;
// Define Sakura version
define('SAKURA_VERSION', '20151019');
define('SAKURA_VERSION', '20151020');
define('SAKURA_VLABEL', 'Eminence');
define('SAKURA_COLOUR', '#6C3082');
define('SAKURA_STABLE', false);

View file

@ -904,7 +904,6 @@ a.default:active {
min-height: 80px;
background: rgba(113, 74, 150, .9);
border: 1px solid #507;
border-right-width: 5px;
color: #FFF;
padding: 2px 0 2px 2px;
margin: 5px;
@ -966,19 +965,18 @@ a.default:active {
}
#notifications > div > .notification-close {
font-size: 2em;
width: 20px;
font-size: 0;
width: 3px;
line-height: 100%;
background: #507;
margin-top: -3px;
margin-bottom: -3px;
padding-left: 2px;
padding-bottom: 3px;
border-left: 3px solid #507;
padding: 0 1px;
text-align: center;
visibility: hidden;
display: flex;
align-items: center;
justify-content: center;
transition: .1s;
}
#notifications > div > .notification-close > div {
@ -986,7 +984,9 @@ a.default:active {
}
#notifications > div:hover > .notification-close {
visibility: visible;
font-size: 2em;
width: 20px;
padding: 0 3px;
}
#notifications > div > .notification-close > div:before {

View file

@ -22,18 +22,58 @@ $forumId = isset($_GET['f']) ?
$_GET['f'] :
Forum::getForumIdFromTopicId($topicId);
$mode = isset($_GET['f']) ? 'f' : (isset($_GET['t']) || isset($_GET['p']) ? 't' : null);
$mode = isset($_GET['f']) ? 'f' : (isset($_GET['t']) ? 't' : (isset($_GET['p']) ? 'p' : null));
// Include emotes and bbcodes
$posting = [
'emoticons' => Main::getEmotes(),
'bbcodes' => Main::getBBcodes(),
];
// Check if we're in reply mode
if ($mode != 'f') {
// Attempt to get the topic
$topic = Forum::getTopic($topicId, true);
// Prompt an error if the topic doesn't exist
if(!$topic) {
// Add page specific things
$renderData['page'] = [
'redirect' => (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : $urls->format('FORUM_INDEX')),
'message' => 'The requested thread does not exist.',
];
// Render information page
print Templates::render('global/information.tpl', $renderData);
exit;
}
// Check if we're in quote mode
if ($mode == 'p' && isset($_GET['quote']) && $_GET['quote'] == $_GET['p'] && array_key_exists($_GET['p'], $topic['posts'])) {
// Reassign post for ease
$post = $topic['posts'][$_GET['p']];
// Add subject to render data
$posting['text'] = '[quote]' . $post['post_text'] . '[/quote]';
}
// Add subject to render data
$posting['subject'] = 'Re: '. $topic['topic']['topic_title'];
}
// Check if a post is being made
if (isset($_POST['post'])) {
// Set post mode
switch($_POST['parseMode']) {
// BBcode
case '1':
$parse = '1';
break;
// Markdown
case '2':
$parse = '2';
break;
// Raw
default:
$parse = '0';
}
@ -43,11 +83,9 @@ if (isset($_POST['post'])) {
// Add page specific things
$renderData['page'] = [
'redirect' => $urls->format('FORUM_THREAD', [$makePost[3]]),
'message' => 'Made the post!',
'success' => $makePost[0],
];
// Print page contents or if the AJAX request is set only display the render data
@ -63,14 +101,7 @@ if (isset($_POST['post'])) {
// Set additional render data
$renderData = array_merge($renderData, [
'posting' => [
'emoticons' => Main::getEmotes(),
'bbcodes' => Main::getBBcodes(),
],
'posting' => $posting,
]);
print Templates::render('forum/posting.tpl', $renderData);