r20160121

This commit is contained in:
flash 2016-01-21 00:06:21 +01:00
parent 25f032b470
commit 8a39677267
24 changed files with 95 additions and 2649 deletions

View file

@ -5,7 +5,6 @@
"ext-json": "*", "ext-json": "*",
"twig/twig": "*", "twig/twig": "*",
"phpmailer/phpmailer": "*", "phpmailer/phpmailer": "*",
"erusev/parsedown": "*",
"paypal/rest-api-sdk-php": "*", "paypal/rest-api-sdk-php": "*",
"jbbcode/jbbcode": "^1.3" "jbbcode/jbbcode": "^1.3"
} }

View file

@ -29,9 +29,6 @@ class News
$this->posters[$post['user_id']] = User::construct($post['user_id']); $this->posters[$post['user_id']] = User::construct($post['user_id']);
} }
// Parse the news post
$post['news_content_parsed'] = Utils::mdParse($post['news_content']);
// Attach the poster // Attach the poster
$post['news_poster'] = $this->posters[$post['user_id']]; $post['news_poster'] = $this->posters[$post['user_id']];

View file

@ -692,13 +692,13 @@ class User
// Get a user's userpage // Get a user's userpage
public function userPage() public function userPage()
{ {
return Utils::mdParse($this->page, true); return BBcode::toHTML(htmlentities($this->page));
} }
// Get a user's signature // Get a user's signature
public function signature() public function signature()
{ {
return BBcode::toHTML($this->signature); return BBcode::toHTML(htmlentities($this->signature));
} }
// Get username change history // Get username change history

View file

@ -5,7 +5,6 @@
namespace Sakura; namespace Sakura;
use Parsedown;
use PHPMailer; use PHPMailer;
/** /**
@ -14,16 +13,6 @@ use PHPMailer;
*/ */
class Utils class Utils
{ {
// Parse markdown
public static function mdParse($text, $escape = false)
{
$pd = new Parsedown();
return $escape ?
$pd->setMarkupEscaped(true)->text($text) :
$pd->text($text);
}
// Get emoticons // Get emoticons
public static function getEmotes() public static function getEmotes()
{ {
@ -270,22 +259,8 @@ class Utils
// Subject line // Subject line
$mail->Subject = $subject; $mail->Subject = $subject;
// Set the mail type to HTML // Set body
$mail->isHTML(true); $mail->Body = $body;
// Set email contents
$htmlMail = file_get_contents(ROOT . 'templates/htmlEmail.html');
// Replace template tags
$htmlMail = str_replace('{{ sitename }}', Config::get('sitename'), $htmlMail);
$htmlMail = str_replace('{{ siteurl }}', '//' . Config::get('url_main'), $htmlMail);
$htmlMail = str_replace('{{ contents }}', self::mdParse($body), $htmlMail);
// Set HTML body
$mail->Body = $htmlMail;
// Set fallback body
$mail->AltBody = $body;
// Send the message // Send the message
$send = $mail->send(); $send = $mail->send();

View file

@ -16,11 +16,6 @@
@import url('/content/fonts/exo2-0-light/font.css'); /* Exo 2.0 Light */ @import url('/content/fonts/exo2-0-light/font.css'); /* Exo 2.0 Light */
@import url('/content/fonts/exo2-0-lightitalic/font.css'); /* Exo 2.0 Light Italic */ @import url('/content/fonts/exo2-0-lightitalic/font.css'); /* Exo 2.0 Light Italic */
/*
* Import markdown stylesheet
*/
@import url('markdown.css');
/* /*
* Keyframe definitions * Keyframe definitions
*/ */

View file

@ -8,7 +8,9 @@
word-wrap: break-word; word-wrap: break-word;
} }
.bbcode h1 { .bbcode h1,
.bbcode h2,
.bbcode h3 {
text-shadow: 0 0 5px #8364A1; text-shadow: 0 0 5px #8364A1;
color: #614390; color: #614390;
} }
@ -30,7 +32,7 @@
border: 1px solid #9475b2; border: 1px solid #9475b2;
border-bottom: 0; border-bottom: 0;
border-right: 0; border-right: 0;
background: linear-gradient(90deg, #B697d4, transparent) transparent; background: #D8B9F6;
margin: .5em; margin: .5em;
} }
@ -44,7 +46,7 @@
.bbcode blockquote > .quote { .bbcode blockquote > .quote {
margin-left: .5em; margin-left: .5em;
padding-bottom: .5em; padding-bottom: .2em;
} }
.bbcode a { .bbcode a {

View file

@ -1,121 +0,0 @@
/*
* Markdown Styling
*/
@charset "utf-8";
.markdown {
line-height: 1.4;
word-wrap: break-word;
}
.markdown a {
color: #00F;
text-decoration: none;
}
.markdown a:hover {
color: #00F;
text-decoration: underline;
}
.markdown a:active {
color: #F00;
text-decoration: underline;
}
.markdown h1,
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
border-bottom: 1px solid;
padding-bottom: 5px;
font-weight: 700;
}
.markdown p,
.markdown blockquote,
.markdown ul,
.markdown ol,
.markdown dl,
.markdown table,
.markdown pre {
margin-top: 0;
margin-bottom: 16px;
}
.markdown hr {
border: 0;
height: 1px;
color: #000;
background: #000;
margin: 0;
}
.markdown table {
display: block;
width: 100%;
overflow: auto;
word-break: keep-all;
border-collapse: collapse;
border-spacing: 0;
}
.markdown table tr {
border-spacing: 0;
border: 1px solid #9475B2;
}
.markdown table th,
.markdown table td {
padding: 6px 13px;
border: 1px solid #9475B2;
}
.markdown table tr:nth-child(even) {
background: #B19DDD;
}
.markdown hr {
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAECAYAAACtBE5DAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OENDRjNBN0E2NTZBMTFFMEI3QjRBODM4NzJDMjlGNDgiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OENDRjNBN0I2NTZBMTFFMEI3QjRBODM4NzJDMjlGNDgiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4Q0NGM0E3ODY1NkExMUUwQjdCNEE4Mzg3MkMyOUY0OCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo4Q0NGM0E3OTY1NkExMUUwQjdCNEE4Mzg3MkMyOUY0OCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PqqezsUAAAAfSURBVHjaYmRABcYwBiM2QSA4y4hNEKYDQxAEAAIMAHNGAzhkPOlYAAAAAElFTkSuQmCC') repeat-x scroll 0 0 transparent;
border: 0 none;
color: #CCC;
height: 4px;
padding: 0;
margin: 15px 0;
}
.markdown blockquote {
border-left: 4px solid #9475B2;
padding: 0 15px;
color: #555;
}
.markdown blockquote > blockquote {
margin-left: 0;
}
.markdown blockquote > :last-child {
margin-bottom: 0;
}
.markdown pre {
word-wrap: normal;
}
.markdown .highlight pre,
.markdown pre {
background: #B19DDD;
border: 1px solid #9475B2;
font-size: 13px;
line-height: 19px;
overflow: auto;
padding: 6px 10px;
border-radius: 3px;
}
.markdown ul,
.markdown ol {
margin-left: 40px;
}

View file

@ -13,9 +13,8 @@
@import url('/content/fonts/segoeui/font.css'); @import url('/content/fonts/segoeui/font.css');
@import url('/content/fonts/segoeui-light/font.css'); @import url('/content/fonts/segoeui-light/font.css');
/* Import bbcode and markdown specific style */ /* Import bbcode specific style */
@import url('bbcode.css'); @import url('bbcode.css');
@import url('markdown.css');
/* /*
* Animation Keyframes * Animation Keyframes
@ -733,6 +732,12 @@ a.default:active {
font-size: .8em; font-size: .8em;
} }
.ad-container img {
box-sizing: border-box;
width: 100%;
height: 100%;
}
.ad-container a { .ad-container a {
color: #22E; color: #22E;
text-decoration: none; text-decoration: none;
@ -752,7 +757,12 @@ a.default:active {
.ad-container.ad-sidebar > .ad-box { .ad-container.ad-sidebar > .ad-box {
text-align: center; text-align: center;
padding: 2px; padding: 6px 2px;
}
.ad-container.ad-sidebar img {
max-height: 250px;
max-width: 250px;
} }
.ad-container.ad-footer { .ad-container.ad-footer {
@ -761,6 +771,11 @@ a.default:active {
text-align: center; text-align: center;
} }
.ad-container.ad-footer img {
max-height: 90px;
max-width: 728px;
}
.ad-container.ad-footer > .ad-box { .ad-container.ad-footer > .ad-box {
display: inline-block; display: inline-block;
padding: 2px; padding: 2px;
@ -1198,10 +1213,15 @@ a.default:active {
} }
.news-body { .news-body {
font-size: 10pt; font-size: .9em;
padding: 2px 0 0 3px; padding: 2px 0 0 3px;
} }
.news-body p {
margin: 0;
margin-bottom: 1em;
}
.news-post-time { .news-post-time {
font-size: 8pt; font-size: 8pt;
padding: 6px 15px; padding: 6px 15px;

View file

@ -378,56 +378,6 @@ function registerVarCheck(id, mode, option) {
input.className = input.className.replace(check ? 'red' : 'green', ''); input.className = input.className.replace(check ? 'red' : 'green', '');
} }
} }
// Initialising the element parallax functionality
function initialiseParallax(id) {
// Assign the element to a variable
var parallax = document.getElementById(id);
// Set proper position values
parallax.style.top = '-2.5px';
parallax.style.bottom = '-2.5px';
parallax.style.left = '-2.5px';
parallax.style.right = '-2.5px';
// Add the event listener to the body element
document.addEventListener("mousemove", function (e) {
// Alter the position of the parallaxed element
parallax.style.top = convertParallaxPositionValue(e.clientY, true, false) + 'px';
parallax.style.bottom = convertParallaxPositionValue(e.clientY, true, true) + 'px';
parallax.style.left = convertParallaxPositionValue(e.clientX, false, false) + 'px';
parallax.style.right = convertParallaxPositionValue(e.clientX, false, true) + 'px';
});
}
// Converting the position value of the mouseover to a pixel value
function convertParallaxPositionValue(pos, dir, neg) {
// Get the body element
var body = document.getElementsByTagName('body')[0];
// Get percentage of current position
var position = (pos / (dir ? body.clientHeight : body.clientWidth)) * 100;
// If someone decided to fuck with the inputs reset it to 0%
if (position < 0 || position > 100) {
position = 0;
}
// Do the first maths
position = (position / (dir ? 25 : 20)) - 2.5;
// If the negative flag is set inverse the number
if (neg) {
position = -position;
}
// Subtract another 2.5 to make the element not go all over the place
position = position - 2.5;
// Return the proper position value
return position;
}
// """"""""Smooth"""""""" scrolling
function scrollToTop() {
// Get the current position
var windowY = window.pageYOffset - 100;
// Move up
window.scrollTo(0, windowY);
// Keep executing this function till we're at the top
if (windowY + 1 > 0) {
setTimeout(function () { scrollToTop(); }, 10);
}
}
// Replace some special tags // Replace some special tags
function replaceTag(tag) { function replaceTag(tag) {
return { '&': '&amp;', '<': '&lt;', '>': '&gt;' }[tag] || tag; return { '&': '&amp;', '<': '&lt;', '>': '&gt;' }[tag] || tag;

View file

@ -466,69 +466,6 @@ function registerVarCheck(id: string, mode: string, option: any = null): void {
} }
} }
// Initialising the element parallax functionality
function initialiseParallax(id: string) {
// Assign the element to a variable
var parallax: HTMLElement = document.getElementById(id);
// Set proper position values
parallax.style.top = '-2.5px';
parallax.style.bottom = '-2.5px';
parallax.style.left = '-2.5px';
parallax.style.right = '-2.5px';
// Add the event listener to the body element
document.addEventListener("mousemove", (e) => {
// Alter the position of the parallaxed element
parallax.style.top = convertParallaxPositionValue(e.clientY, true, false) + 'px';
parallax.style.bottom = convertParallaxPositionValue(e.clientY, true, true) + 'px';
parallax.style.left = convertParallaxPositionValue(e.clientX, false, false) + 'px';
parallax.style.right = convertParallaxPositionValue(e.clientX, false, true) + 'px';
});
}
// Converting the position value of the mouseover to a pixel value
function convertParallaxPositionValue(pos: number, dir: boolean, neg: boolean): number {
// Get the body element
var body: HTMLElement = document.getElementsByTagName('body')[0];
// Get percentage of current position
var position: number = (pos / (dir ? body.clientHeight : body.clientWidth)) * 100;
// If someone decided to fuck with the inputs reset it to 0%
if (position < 0 || position > 100) {
position = 0;
}
// Do the first maths
position = (position / (dir ? 25 : 20)) - 2.5;
// If the negative flag is set inverse the number
if (neg) {
position = -position;
}
// Subtract another 2.5 to make the element not go all over the place
position = position - 2.5;
// Return the proper position value
return position;
}
// """"""""Smooth"""""""" scrolling
function scrollToTop(): void {
// Get the current position
var windowY: number = window.pageYOffset - 100;
// Move up
window.scrollTo(0, windowY);
// Keep executing this function till we're at the top
if (windowY + 1 > 0) {
setTimeout(() => { scrollToTop(); }, 10);
}
}
// Replace some special tags // Replace some special tags
function replaceTag(tag: string): string { function replaceTag(tag: string): string {
return { '&': '&amp;', '<': '&lt;', '>': '&gt;' }[tag] || tag; return { '&': '&amp;', '<': '&lt;', '>': '&gt;' }[tag] || tag;

File diff suppressed because it is too large Load diff

View file

@ -19,7 +19,7 @@ $template->setTemplate($templateName);
if (isset($_GET['p'])) { if (isset($_GET['p'])) {
// Set default variables // Set default variables
$renderData['page'] = [ $renderData['page'] = [
'content' => Utils::mdParse("# Unable to load the requested info page.\r\n\r\nCheck the URL and try again."), 'content' => '<h1>Unable to load the requested info page.</h1><p>Check the URL and try again.</p>',
]; ];
// Set page id // Set page id
@ -31,7 +31,7 @@ if (isset($_GET['p'])) {
$renderData['page'] = [ $renderData['page'] = [
'id' => $pageId, 'id' => $pageId,
'title' => $ipData['page_title'], 'title' => $ipData['page_title'],
'content' => Utils::mdParse($ipData['page_content']), 'content' => $ipData['page_content'],
]; ];
} }
@ -52,6 +52,8 @@ $renderData['newsCount'] = Config::get('front_page_news_posts');
$renderData['forum'] = ($forumMode ? (new Forum\Forum()) : null); $renderData['forum'] = ($forumMode ? (new Forum\Forum()) : null);
$renderData['latestPosts'] = Database::fetch('posts', true, null, ['post_id', true], [3]);
$renderData['stats'] = [ $renderData['stats'] = [
'userCount' => Database::count('users', ['password_algo' => ['nologin', '!='], 'rank_main' => ['1', '!=']])[0], 'userCount' => Database::count('users', ['password_algo' => ['nologin', '!='], 'rank_main' => ['1', '!=']])[0],
'newestUser' => ($_INDEX_NEWEST_USER = User::construct(Users::getNewestUserId())), 'newestUser' => ($_INDEX_NEWEST_USER = User::construct(Users::getNewestUserId())),

View file

@ -18,29 +18,17 @@ $template->setTemplate($templateName);
// CHeck if the user is logged in // CHeck if the user is logged in
if (Users::checkLogin()) { if (Users::checkLogin()) {
// Add page specific things // Add page specific things
$renderData['page'] = [ $renderData['memberlist'] = [
'ranks' => ($_MEMBERLIST_RANKS = Users::getAllRanks()), 'ranks' => ($_MEMBERLIST_RANKS = Users::getAllRanks()),
'active' => ($_MEMBERLIST_ACTIVE = ( 'active' => ($_MEMBERLIST_ACTIVE = (
isset($_GET['rank']) isset($_GET['rank'])
&& $_GET['rank'] && $_GET['rank']
&& array_key_exists($_GET['rank'], $_MEMBERLIST_RANKS) ? $_GET['rank'] : 0 && array_key_exists($_GET['rank'], $_MEMBERLIST_RANKS) ? $_GET['rank'] : 0
)), )),
'notfound' => ($_MEMBERLIST_NFOUND = ( 'users' => ($_MEMBERLIST_ACTIVE && !$_MEMBERLIST_NFOUND ? Users::getUsersInRank($_MEMBERLIST_ACTIVE) : Users::getAllUsers()),
isset($_GET['rank']) 'membersPerPage' => Config::get('members_per_page'),
&& !array_key_exists($_GET['rank'], $_MEMBERLIST_RANKS) && $_GET['rank'] != 0
)),
'sorts' => ($_MEMBERLIST_SORTS = ['boxes', 'rectangles', 'list']),
'sort' => isset($_GET['sort']) && $_GET['sort'] && in_array($_GET['sort'], $_MEMBERLIST_SORTS) ?
$_GET['sort'] :
$_MEMBERLIST_SORTS[0],
]; ];
$renderData['users'] = ($_MEMBERLIST_ACTIVE && !$_MEMBERLIST_NFOUND ? Users::getUsersInRank($_MEMBERLIST_ACTIVE) : Users::getAllUsers());
$renderData['membersPerPage'] = Config::get('members_per_page');
// Set parse variables // Set parse variables
$template->setVariables($renderData); $template->setVariables($renderData);

View file

@ -59,9 +59,10 @@ if (isset($_GET['restrict']) && $_GET['restrict'] == session_id() && $currentUse
if ($restricted) { if ($restricted) {
$profile->removeRanks([Config::get('restricted_rank_id')]); $profile->removeRanks([Config::get('restricted_rank_id')]);
$profile->addRanks([2]);
} else { } else {
$profile->addRanks([Config::get('restricted_rank_id')]); $profile->addRanks([Config::get('restricted_rank_id')]);
$profile->removeRanks($profile->ranks()); $profile->removeRanks(array_keys($profile->ranks));
} }
$renderData['page'] = [ $renderData['page'] = [

View file

@ -8,7 +8,7 @@
namespace Sakura; namespace Sakura;
// Define Sakura version // Define Sakura version
define('SAKURA_VERSION', '20160118'); define('SAKURA_VERSION', '20160120');
define('SAKURA_VLABEL', 'Amethyst'); define('SAKURA_VLABEL', 'Amethyst');
define('SAKURA_COLOUR', '#9966CC'); define('SAKURA_COLOUR', '#9966CC');

View file

@ -1,3 +1,3 @@
<div class="markdown"> <div class="bbcode">
{{ profile.userPage|raw }} {{ profile.userPage|raw }}
</div> </div>

View file

@ -38,11 +38,13 @@
{% else %} {% else %}
There were no online users in the past {{ sakura.onlineTimeout / 60 }} minute{% if sakura.onlineTimeout != 60 %}s{% endif %}. There were no online users in the past {{ sakura.onlineTimeout / 60 }} minute{% if sakura.onlineTimeout != 60 %}s{% endif %}.
{% endif %} {% endif %}
{#<div class="ad-container ad-sidebar" id="sideAd"> {% if not user.permission(constant('Sakura\\Perms\\Site::CHANGE_BACKGROUND')) or user.mainRankId == 4 %}
<div class="head">Advertisment</div> <div class="ad-container ad-sidebar" id="sideAd">
<div class="ad-box"> <div class="ad-box">
<img src="http://i.flash.moe/1445793369-523-9238.png" /> <a href="http://jbox.com/r.php??&acc=269&___store=jlist&bannerid=28" target="_blank">
<div><a href="#">Click here to meow!</a></div> <img src="https://jlist.com/js/magestore/affiliateplus/banner.php?id=28&account_id=269&store_id=2" alt="250x250 PG senpai shirt" title="250x250 PG senpai shirt" width="250" height="250" />
</a>
</div> </div>
</div>#} </div>
{% endif %}
</div> </div>

View file

@ -6,8 +6,8 @@
<h1 style="color: {{ post.news_poster.colour }}; text-shadow: 0 0 7px {% if post.news_poster.colour != 'inherit' %}{{ post.news_poster.colour }}{% else %}#222{% endif %}; padding: 0 0 10px;">{{ post.news_poster.username }}</h1> <h1 style="color: {{ post.news_poster.colour }}; text-shadow: 0 0 7px {% if post.news_poster.colour != 'inherit' %}{{ post.news_poster.colour }}{% else %}#222{% endif %}; padding: 0 0 10px;">{{ post.news_poster.username }}</h1>
</div> </div>
</a> </a>
<div class="markdown"> <div class="bbcode">
{{ post.news_content_parsed|raw }} {{ post.news_content|raw }}
</div> </div>
</div> </div>
<div class="clear"></div> <div class="clear"></div>

View file

@ -132,10 +132,6 @@
} }
{% endif %} {% endif %}
{% if php.self == '/profile.php' ? (profile.background and not profile.optionFields.disableProfileParallax) : (user.permission(constant('Sakura\\Perms\\Site::CHANGE_BACKGROUND')) and user.optionFields.profileBackgroundSiteWide and user.background and not user.optionFields.disableProfileParallax) %}
initialiseParallax('userBackground');
{% endif %}
}); });
// Error reporter // Error reporter
@ -240,11 +236,15 @@
<h1 class="stylised" style="text-align: center; margin: 2em auto;">{{ php.self }} is now printing!</h1> <h1 class="stylised" style="text-align: center; margin: 2em auto;">{{ php.self }} is now printing!</h1>
{% endblock %} {% endblock %}
{#<div class="ad-container ad-footer" id="footerAd"> {% if not user.permission(constant('Sakura\\Perms\\Site::CHANGE_BACKGROUND')) or user.mainRankId == 4 %}
<div class="ad-container ad-footer" id="footerAd">
<div class="ad-box"> <div class="ad-box">
<img src="http://i.flash.moe/1445792838-522-8610.png" /> <a href="http://jbox.com/r.php??series/touhou&acc=269&___store=jlist&bannerid=8" target="_blank">
<img src="https://jlist.com/js/magestore/affiliateplus/banner.php?id=8&account_id=269&store_id=2" alt="728x90 PG -- Touhou 1" title="728x90 PG -- Touhou 1" width="728" height="90" />
</a>
</div> </div>
</div>#} </div>
{% endif %}
</div> </div>
<div class="footer"> <div class="footer">
<div class="ftsections"> <div class="ftsections">

View file

@ -3,7 +3,7 @@
{% block title %}{% if page.title %}{{ page.title }}{% else %}Not found!{% endif %}{% endblock %} {% block title %}{% if page.title %}{{ page.title }}{% else %}Not found!{% endif %}{% endblock %}
{% block content %} {% block content %}
<div class="content standalone markdown"> <div class="content standalone bbcode">
<div> <div>
{{ page.content|raw }} {{ page.content|raw }}
</div> </div>

View file

@ -1,50 +1,55 @@
{% extends 'global/master.twig' %} {% extends 'global/master.twig' %}
{% set sorts = ['boxes', 'rectangles', 'list'] %}
{% set sort = get.sort in sorts ? get.sort : sorts[0] %}
{% set notfound = memberlist.active == 0 and get.rank is defined %}
{% set rankTitle %} {% set rankTitle %}
{% if page.notfound %}Not found{% else %}{% if not page.active %}All members{% else %}{{ page.ranks[page.active].name(true) }}{% endif %}{% endif %} {% if notfound %}Not found{% else %}{% if not memberlist.active %}All members{% else %}{{ memberlist.ranks[memberlist.active].name(true) }}{% endif %}{% endif %}
{% endset %} {% endset %}
{% set rankDescription %} {% set rankDescription %}
{% if page.notfound %}The requested rank could not be found!{% else %}{% if not page.active %}The entire user list.{% else %}{{ page.ranks[page.active].description }}{% endif %}{% endif %} {% if notfound %}The requested rank could not be found!{% else %}{% if not memberlist.active %}The entire user list.{% else %}{{ memberlist.ranks[memberlist.active].description }}{% endif %}{% endif %}
{% endset %} {% endset %}
{% set users = users|batch(membersPerPage) %} {% set users = memberlist.users|batch(memberlist.membersPerPage) %}
{% set currPage = get.page|default(1) - 1 %} {% set currPage = get.page|default(1) - 1 %}
{% set paginationPages = users %} {% set paginationPages = users %}
{% set paginationUrl %}{% if page.sort and page.active %}{{ urls.format('MEMBERLIST_ALL', [page.sort, page.active]) }}{% elseif page.sort %}{{ urls.format('MEMBERLIST_SORT', [page.sort]) }}{% elseif page.active %}{{ urls.format('MEMBERLIST_RANK', [page.active]) }}{% else %}{{ urls.format('MEMBERLIST_INDEX') }}{% endif %}{% endset %} {% set paginationUrl %}{% if sort and memberlist.active %}{{ urls.format('MEMBERLIST_ALL', [sort, memberlist.active]) }}{% elseif sort %}{{ urls.format('MEMBERLIST_SORT', [sort]) }}{% elseif memberlist.active %}{{ urls.format('MEMBERLIST_RANK', [memberlist.active]) }}{% else %}{{ urls.format('MEMBERLIST_INDEX') }}{% endif %}{% endset %}
{% block title %}{{ rankTitle }}{% endblock %} {% block title %}{{ rankTitle }}{% endblock %}
{% block content %} {% block content %}
<div class="headerNotify" style="margin-bottom: 1px;"> <div class="headerNotify" style="margin-bottom: 1px;">
<h1 style="{% if page.active %}text-shadow: 0 0 5px {{ page.ranks[page.active].colour }}; color: {{ page.ranks[page.active].colour }};{% else %}text-shadow: 0 0 5px #555;{% endif %}">{{ rankTitle }}</h1> <h1 style="{% if memberlist.active %}text-shadow: 0 0 5px {{ memberlist.ranks[memberlist.active].colour }}; color: {{ memberlist.ranks[memberlist.active].colour }};{% else %}text-shadow: 0 0 5px #555;{% endif %}">{{ rankTitle }}</h1>
<h3>{{ rankDescription }}</h3> <h3>{{ rankDescription }}</h3>
</div> </div>
<div class="membersPage" style="min-height: 500px;"> <div class="membersPage" style="min-height: 500px;">
<div class="dropDown" style="margin: 0 auto; font-size: 1.5em; line-height: 1.5em; height: 30px;"> <div class="dropDown" style="margin: 0 auto; font-size: 1.5em; line-height: 1.5em; height: 30px;">
<div class="dropDownInner" style="float: left; color: #FFF;"> <div class="dropDownInner" style="float: left; color: #FFF;">
<a class="dropDownDesc">Rank:</a> <a class="dropDownDesc">Rank:</a>
<a href="{% if page.sort %}{{ urls.format('MEMBERLIST_SORT', [page.sort]) }}{% else %}{{ urls.format('MEMBERLIST_INDEX') }}{% endif %}"{% if not page.active %} class="dropDownSelected"{% endif %}>All members</a> <a href="{% if sort %}{{ urls.format('MEMBERLIST_SORT', [sort]) }}{% else %}{{ urls.format('MEMBERLIST_INDEX') }}{% endif %}"{% if not memberlist.active %} class="dropDownSelected"{% endif %}>All members</a>
{% for rank in page.ranks %} {% for rank in memberlist.ranks %}
{% if not rank.hidden or (rank.hidden and page.active == rank.id) %} {% if not rank.hidden or (rank.hidden and memberlist.active == rank.id) %}
<a href="{% if page.sort %}{{ urls.format('MEMBERLIST_ALL', [page.sort, rank.id]) }}{% else %}{{ urls.format('MEMBERLIST_RANK', [rank.id]) }}{% endif %}" style="color: {{ rank.colour }};"{% if page.active == rank.id %} class="dropDownSelected"{% endif %}>{{ rank.name(true) }}</a> <a href="{% if sort %}{{ urls.format('MEMBERLIST_ALL', [sort, rank.id]) }}{% else %}{{ urls.format('MEMBERLIST_RANK', [rank.id]) }}{% endif %}" style="color: {{ rank.colour }};"{% if memberlist.active == rank.id %} class="dropDownSelected"{% endif %}>{{ rank.name(true) }}</a>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</div> </div>
<div class="dropDownInner" style="float: left;"> <div class="dropDownInner" style="float: left;">
<a class="dropDownDesc">View:</a> <a class="dropDownDesc">View:</a>
{% for sort in page.sorts %} {% for s in sorts %}
<a href="{% if page.active %}{{ urls.format('MEMBERLIST_ALL', [sort, page.active]) }}{% else %}{{ urls.format('MEMBERLIST_SORT', [sort]) }}{% endif %}"{% if page.sort == sort %} class="dropDownSelected"{% endif %}>{{ sort|capitalize }}</a> <a href="{% if memberlist.active %}{{ urls.format('MEMBERLIST_ALL', [s, memberlist.active]) }}{% else %}{{ urls.format('MEMBERLIST_SORT', [s]) }}{% endif %}"{% if s == sort %} class="dropDownSelected"{% endif %}>{{ s|capitalize }}</a>
{% endfor %} {% endfor %}
</div> </div>
</div> </div>
{% if not users|length %} {% if not users|length %}
<h1 class="stylised" style="margin: 2em 0;">This rank has no members!</h1> <h1 class="stylised" style="margin: 2em 0;">This rank has no members!</h1>
{% elseif not page.notfound %} {% elseif not notfound %}
<div class="membersPageList {{ page.sort }}"> <div class="membersPageList {{ sort }}">
{% if page.sort == page.sorts[2] %} {% if sort == sorts[2] %}
<table> <table>
<thead> <thead>
<tr> <tr>
@ -70,22 +75,22 @@
<tbody> <tbody>
<tr> <tr>
<td> <td>
#{{ page.active ? count + 1 : count }} #{{ memberlist.active ? count + 1 : count }}
</td> </td>
<td> <td>
<a href="{{ urls.format('USER_PROFILE', [user.id]) }}" class="default" style="font-weight: bold; color: {{ user.colour }}; text-shadow: 0 0 5px {{ user.colour }};">{{ user.username }}</a> <a href="{{ urls.format('USER_PROFILE', [user.id]) }}" class="default" style="font-weight: bold; color: {{ user.colour }}; text-shadow: 0 0 5px {{ user.colour }};">{{ user.username }}</a>
</td> </td>
<td title="{{ user.dates.joined|date(sakura.dateFormat) }}"> <td title="{{ user.registered|date(sakura.dateFormat) }}">
{{ user.elapsed.joined }} {{ user.elapsed.joined }}
</td> </td>
<td title="{% if user.dates.lastOnline == 0 %}Never logged in.{% else %}{{ user.dates.lastOnline|date(sakura.dateFormat) }}{% endif %}"> <td title="{% if user.lastOnline == 0 %}Never logged in.{% else %}{{ user.lastOnline|date(sakura.dateFormat) }}{% endif %}">
{% if user.dates.lastOnline == 0 %}<i>Never logged in.</i>{% else %}{{ user.elapsed.lastOnline }}{% endif %} {% if user.lastOnline == 0 %}<i>Never logged in.</i>{% else %}{{ user.elapsed.lastOnline }}{% endif %}
</td> </td>
<td> <td>
{{ user.userTitle }} {{ user.title }}
</td> </td>
<td> <td>
<img src="{{ sakura.contentPath }}/images/flags/{{ user.country.short|lower }}.png" alt="{% if user.country.short|lower == 'xx' %}?{% else %}{{ user.country.long }}{% endif %}" title="{% if user.country.short|lower == 'xx' %}Unknown{% else %}{{ user.country.long }}{% endif %}" /> <img src="{{ sakura.contentPath }}/images/flags/{{ user.country|lower }}.png" alt="{% if user.country|lower == 'xx' %}?{% else %}{{ user.country(true) }}{% endif %}" title="{% if user.country|lower == 'xx' %}Unknown{% else %}{{ user.country(true) }}{% endif %}" />
</td> </td>
</tr> </tr>
</tbody> </tbody>
@ -104,9 +109,9 @@
{% endfor %} {% endfor %}
{% endif %} {% endif %}
</div> </div>
{% endif %}
{% if users|length > 1 %} {% if users|length > 1 %}
{% include 'elements/pagination.twig' %} {% include 'elements/pagination.twig' %}
{% endif %} {% endif %}
{% endif %}
</div> </div>
{% endblock %} {% endblock %}

View file

@ -29,7 +29,7 @@
<img src="{{ urls.format('IMAGE_AVATAR', [profile.id]) }}" alt="{{ profile.username }}'s Avatar" class="default-avatar-setting" style="box-shadow: 0 3px 7px #{% if profile.isOnline %}484{% else %}844{% endif %};" /><br /> <img src="{{ urls.format('IMAGE_AVATAR', [profile.id]) }}" alt="{{ profile.username }}'s Avatar" class="default-avatar-setting" style="box-shadow: 0 3px 7px #{% if profile.isOnline %}484{% else %}844{% endif %};" /><br />
{% if profile.mainRankId > 1 and profile.checkBan|length < 1 %} {% if profile.mainRankId > 1 and profile.checkBan|length < 1 %}
<span style="font-size: .8em;">{{ profile.title }}</span> <span style="font-size: .8em;">{{ profile.title }}</span>
<h1 style="color: {{ profile.colour }}; text-shadow: 0 0 7px {% if profile.colour != 'inherit' %}{{ profile.colour }}{% else %}#222{% endif %}; padding: 0 0 2px;" {% if profile.getUsernameHistory %} title="Known as {{ profile.getUsernameHistory[0]['username_old'] }} before {{ profile.getUsernameHistory[0]['chahttp://flashii.test/u/2/headernge_time']|date(sakura.dateFormat) }}." {% endif %}>{{ profile.username }}</h1> <h1 style="color: {{ profile.colour }}; text-shadow: 0 0 7px {% if profile.colour != 'inherit' %}{{ profile.colour }}{% else %}#222{% endif %}; padding: 0 0 2px;" {% if profile.getUsernameHistory %} title="Known as {{ profile.getUsernameHistory[0]['username_old'] }} before {{ profile.getUsernameHistory[0]['change_time']|date(sakura.dateFormat) }}." {% endif %}>{{ profile.username }}</h1>
{% if profile.isPremium[0] %}<img src="{{ sakura.contentPath }}/images/tenshi.png" alt="Tenshi" style="vertical-align: middle;" /> {% endif %}<img src="{{ sakura.contentPath }}/images/flags/{{ profile.country|lower }}.png" alt="{{ profile.country.short }}" style="vertical-align: middle;" /> <span style="font-size: .8em; line-height: 11px;">{{ profile.country.long }}</span> {% if profile.isPremium[0] %}<img src="{{ sakura.contentPath }}/images/tenshi.png" alt="Tenshi" style="vertical-align: middle;" /> {% endif %}<img src="{{ sakura.contentPath }}/images/flags/{{ profile.country|lower }}.png" alt="{{ profile.country.short }}" style="vertical-align: middle;" /> <span style="font-size: .8em; line-height: 11px;">{{ profile.country.long }}</span>
{% if session.checkLogin %} {% if session.checkLogin %}
<div class="user-actions"> <div class="user-actions">

View file

@ -1,3 +1,3 @@
<div class="markdown"> <div class="bbcode">
{{ profile.userPage|raw }} {{ profile.userPage|raw }}
</div> </div>

View file

@ -1,34 +1,23 @@
{% block js %} <!--div class="bbcode" id="userPagePreview" style="max-height: 500px; overflow-y: auto; background: #C2AEEE; box-shadow: inset 0 0 1em 1em #D3BFFF;">
<script type="text/javascript" charset="utf-8" src="{{ sakura.contentPath }}/libraries/showdown.js"></script>
{% endblock %}
<div class="markdown" id="userPagePreview" style="max-height: 500px; overflow-y: auto; background: #C2AEEE; box-shadow: inset 0 0 1em 1em #D3BFFF;">
<noscript> <noscript>
<h1 class="stylised" style="margin: 1em auto;">The preview requires JavaScript, enable it.</h1> <h1 class="stylised" style="margin: 1em auto;">The preview requires JavaScript, enable it.</h1>
</noscript> </noscript>
</div> </div-->
<hr class="default" /> <hr class="default" />
<form enctype="multipart/form-data" method="post" action="{{ sakura.currentPage }}" id="userPageEditorForm"> <form enctype="multipart/form-data" method="post" action="{{ sakura.currentPage }}" id="userPageEditorForm">
<input type="hidden" name="sessid" value="{{ php.sessionid }}" /> <input type="hidden" name="sessid" value="{{ php.sessionid }}" />
<input type="hidden" name="timestamp" value="{{ php.time }}" /> <input type="hidden" name="timestamp" value="{{ php.time }}" />
<input type="hidden" name="mode" value="userpage" /> <input type="hidden" name="mode" value="userpage" />
<div><textarea name="userpage" id="userPageEditor" placeholder="# Welcome to my user page!" class="inputStyling" style="width: calc(100% - 12px); height: 400px;">{% if user.page %}{{ user.page }}{% else %}# Welcome to my user page!{% endif %}</textarea></div> <div><textarea name="userpage" id="userPageEditor" placeholder="[header]Welcome to my userpage![/header]" class="inputStyling" style="width: calc(100% - 12px); height: 400px;">{% if user.page %}{{ user.page }}{% else %}[header]Welcome to my userpage![/header]{% endif %}</textarea></div>
<div class="profile-save"> <div class="profile-save">
<input type="submit" value="Save" name="submit" class="inputStyling" /> <input type="submit" value="Save" name="submit" class="inputStyling" />
<input type="reset" value="Reset" name="reset" class="inputStyling" /> <input type="reset" value="Reset" name="reset" class="inputStyling" />
</div> </div>
</form> </form>
<script type="text/javascript"> <script type="text/javascript">
var converter = new showdown.Converter(); //document.getElementById('userPageEditor').addEventListener('keyup', updateUserPage);
function updateUserPage() {
document.getElementById('userPagePreview').innerHTML = converter.makeHtml(safeTagsReplace(document.getElementById('userPageEditor').value));
}
document.getElementById('userPageEditor').addEventListener('keyup', updateUserPage);
window.addEventListener('load', function() { window.addEventListener('load', function() {
prepareAjaxForm('userPageEditorForm', 'Updating user page...'); prepareAjaxForm('userPageEditorForm', 'Updating user page...');
updateUserPage();
}); });
</script> </script>