r20151020.1
Signed-off-by: Flashwave <me@flash.moe>
This commit is contained in:
parent
59460fb22a
commit
d73b73c026
3 changed files with 51 additions and 20 deletions
|
@ -8,7 +8,7 @@
|
||||||
namespace Sakura;
|
namespace Sakura;
|
||||||
|
|
||||||
// Define Sakura version
|
// Define Sakura version
|
||||||
define('SAKURA_VERSION', '20151019');
|
define('SAKURA_VERSION', '20151020');
|
||||||
define('SAKURA_VLABEL', 'Eminence');
|
define('SAKURA_VLABEL', 'Eminence');
|
||||||
define('SAKURA_COLOUR', '#6C3082');
|
define('SAKURA_COLOUR', '#6C3082');
|
||||||
define('SAKURA_STABLE', false);
|
define('SAKURA_STABLE', false);
|
||||||
|
|
|
@ -904,7 +904,6 @@ a.default:active {
|
||||||
min-height: 80px;
|
min-height: 80px;
|
||||||
background: rgba(113, 74, 150, .9);
|
background: rgba(113, 74, 150, .9);
|
||||||
border: 1px solid #507;
|
border: 1px solid #507;
|
||||||
border-right-width: 5px;
|
|
||||||
color: #FFF;
|
color: #FFF;
|
||||||
padding: 2px 0 2px 2px;
|
padding: 2px 0 2px 2px;
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
|
@ -966,19 +965,18 @@ a.default:active {
|
||||||
}
|
}
|
||||||
|
|
||||||
#notifications > div > .notification-close {
|
#notifications > div > .notification-close {
|
||||||
font-size: 2em;
|
font-size: 0;
|
||||||
width: 20px;
|
width: 3px;
|
||||||
line-height: 100%;
|
line-height: 100%;
|
||||||
background: #507;
|
background: #507;
|
||||||
margin-top: -3px;
|
margin-top: -3px;
|
||||||
margin-bottom: -3px;
|
margin-bottom: -3px;
|
||||||
padding-left: 2px;
|
padding: 0 1px;
|
||||||
padding-bottom: 3px;
|
|
||||||
border-left: 3px solid #507;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
visibility: hidden;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
transition: .1s;
|
||||||
}
|
}
|
||||||
|
|
||||||
#notifications > div > .notification-close > div {
|
#notifications > div > .notification-close > div {
|
||||||
|
@ -986,7 +984,9 @@ a.default:active {
|
||||||
}
|
}
|
||||||
|
|
||||||
#notifications > div:hover > .notification-close {
|
#notifications > div:hover > .notification-close {
|
||||||
visibility: visible;
|
font-size: 2em;
|
||||||
|
width: 20px;
|
||||||
|
padding: 0 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#notifications > div > .notification-close > div:before {
|
#notifications > div > .notification-close > div:before {
|
||||||
|
|
|
@ -22,18 +22,58 @@ $forumId = isset($_GET['f']) ?
|
||||||
$_GET['f'] :
|
$_GET['f'] :
|
||||||
Forum::getForumIdFromTopicId($topicId);
|
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
|
// Check if a post is being made
|
||||||
if (isset($_POST['post'])) {
|
if (isset($_POST['post'])) {
|
||||||
// Set post mode
|
// Set post mode
|
||||||
switch($_POST['parseMode']) {
|
switch($_POST['parseMode']) {
|
||||||
|
// BBcode
|
||||||
case '1':
|
case '1':
|
||||||
$parse = '1';
|
$parse = '1';
|
||||||
break;
|
break;
|
||||||
|
// Markdown
|
||||||
case '2':
|
case '2':
|
||||||
$parse = '2';
|
$parse = '2';
|
||||||
break;
|
break;
|
||||||
|
// Raw
|
||||||
default:
|
default:
|
||||||
$parse = '0';
|
$parse = '0';
|
||||||
}
|
}
|
||||||
|
@ -43,11 +83,9 @@ if (isset($_POST['post'])) {
|
||||||
|
|
||||||
// Add page specific things
|
// Add page specific things
|
||||||
$renderData['page'] = [
|
$renderData['page'] = [
|
||||||
|
|
||||||
'redirect' => $urls->format('FORUM_THREAD', [$makePost[3]]),
|
'redirect' => $urls->format('FORUM_THREAD', [$makePost[3]]),
|
||||||
'message' => 'Made the post!',
|
'message' => 'Made the post!',
|
||||||
'success' => $makePost[0],
|
'success' => $makePost[0],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// Print page contents or if the AJAX request is set only display the render data
|
// 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
|
// Set additional render data
|
||||||
$renderData = array_merge($renderData, [
|
$renderData = array_merge($renderData, [
|
||||||
|
'posting' => $posting,
|
||||||
'posting' => [
|
|
||||||
|
|
||||||
'emoticons' => Main::getEmotes(),
|
|
||||||
'bbcodes' => Main::getBBcodes(),
|
|
||||||
|
|
||||||
],
|
|
||||||
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
print Templates::render('forum/posting.tpl', $renderData);
|
print Templates::render('forum/posting.tpl', $renderData);
|
||||||
|
|
Reference in a new issue