r20151104

Signed-off-by: Flashwave <me@flash.moe>
This commit is contained in:
Pachira 2015-11-04 22:26:58 +01:00
parent 5201e8c3fb
commit a6196f2357
8 changed files with 136 additions and 176 deletions

View file

@ -11,4 +11,6 @@ namespace Sakura;
*/ */
class BBcode class BBcode
{ {
// Array containing bbcodes
private static $bbcodes = [];
} }

View file

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

View file

@ -81,31 +81,38 @@
<div id="userBackground" style="background-image: url('{{ urls.format('IMAGE_BACKGROUND', [(php.self == '/profile.php' ? profile : user).data.user_id]) }}');"></div> <div id="userBackground" style="background-image: url('{{ urls.format('IMAGE_BACKGROUND', [(php.self == '/profile.php' ? profile : user).data.user_id]) }}');"></div>
{% endif %} {% endif %}
<div id="navigation"> <div id="navigation">
<ul class="nav-left floatLeft"> <ul class="site-menu">
<li class="logo"><a href="{{ urls.format('SITE_HOME') }}"><div {% if sakura.siteLogo %} style="background-image: url('{{ sakura.siteLogo }}');"{% endif %}></div><div>Home</div></a></li> <li title="Home" class="logo"><a href="{{ urls.format('SITE_HOME') }}" {% if sakura.siteLogo %} style="background-image: url('{{ sakura.siteLogo }}');"{% endif %}></a></li>
<li><a href="{{ urls.format('SITE_NEWS') }}"><div class="fa fa-newspaper-o"></div><div>News</div></a></li> <li title="News"><a href="{{ urls.format('SITE_NEWS') }}" class="fa fa-newspaper-o"></a></li>
<li><a href="//chat.{{ sakura.urlMain }}/"><div class="fa fa-commenting"></div><div>Chat</div></a></li> <li title="Chat"><a href="//chat.{{ sakura.urlMain }}/" class="fa fa-commenting"></a></li>
<li><a href="{{ urls.format('FORUM_INDEX') }}"><div class="fa fa-comments"></div><div>Forum</div></a></li> <li title="Forums"><a href="{{ urls.format('FORUM_INDEX') }}" class="fa fa-comments"></a></li>
<li><a href="{{ urls.format('MEMBERLIST_INDEX') }}"><div class="fa fa-users"></div><div>Members</div></a></li> <li title="Members"><a href="{{ urls.format('MEMBERLIST_INDEX') }}" class="fa fa-users"></a></li>
<li><a href="{{ urls.format('SITE_SEARCH') }}"><div class="fa fa-search"></div><div>Search</div></a></li> <li title="Search"><a href="{{ urls.format('SITE_SEARCH') }}" class="fa fa-search"></a></li>
<li><a href="{{ urls.format('SITE_PREMIUM') }}"><div class="fa fa-heart"></div><div>Support us</div></a></li> <li title="Support us"><a href="{{ urls.format('SITE_PREMIUM') }}" class="fa fa-heart"></a></li>
</ul> </ul>
<ul class="nav-right floatRight"> <ul class="user-menu">
<li class="nav-usermenu"> <li class="nav-usermenu">
<a href="#"{% if session.checkLogin %} style="color: {{ user.colour }};"{% endif %}>{% if session.checkLogin %}{{ user.data.username }}{% else %}Guest{% endif %}</a> <a href="{% if session.checkLogin %}javascript:void(0);{% else %}{{ urls.format('SITE_LOGIN') }}{% endif %}">
<ul> <div>
<div class="nav-username"{% if session.checkLogin %} style="color: {{ user.colour }};"{% endif %}>
{% if session.checkLogin %}{{ user.data.username }} <span class="nav-user-dropdown"></span>{% else %}Guest{% endif %}
</div>
<div class="nav-userstats">
{% if session.checkLogin %}<span class="fa fa-envelope"></span> 0 / <span class="fa fa-user-plus"></span> 0 / <span class="fa fa-warning"></span> 0 / <span class="fa fa-reply"></span> 0{% else %}Please log in to proceed!{% endif %}
</div>
</div>
</a>
{% if session.checkLogin %} {% if session.checkLogin %}
<li><a href="{{ urls.format('USER_PROFILE', [user.data.user_id]) }}">My Profile</a></li> <ul>
<li><a href="{{ urls.format('SETTING_CAT', ['messages']) }}">Private Messages</a></li> <li><a href="{{ urls.format('USER_PROFILE', [user.data.user_id]) }}">My Profile</a></li>
<li><a href="{{ urls.format('SETTINGS_INDEX') }}">User Settings</a></li> <li><a href="{{ urls.format('SETTING_CAT', ['messages']) }}">Private Messages</a></li>
<li><a href="{{ urls.format('MANAGE_INDEX') }}">Site Management</a></li> <li><a href="{{ urls.format('SETTINGS_INDEX') }}">User Settings</a></li>
<li><a href="{{ urls.format('USER_LOGOUT', [php.time, php.sessionid, sakura.currentPage]) }}">Logout</a></li> <li><a href="{{ urls.format('MANAGE_INDEX') }}">Site Management</a></li>
{% else %} <li><a href="{{ urls.format('USER_LOGOUT', [php.time, php.sessionid, sakura.currentPage]) }}">Logout</a></li>
<li><a href="{{ urls.format('SITE_LOGIN') }}">Login or Register</a></li> </ul>
{% endif %} {% endif %}
</ul>
</li> </li>
<li><a href="{{ urls.format('USER_PROFILE', [user.data.user_id]) }}" class="ignore"><img src="{{ sakura.contentPath }}/pixel.png" alt="{{ user.data.username }}" style="background-image: url('{{ urls.format('IMAGE_AVATAR', [user.data.user_id]) }}');" class="nav-avatar" /></a></li> <li><a href="{% if session.checkLogin %}{{ urls.format('USER_PROFILE', [user.data.user_id]) }}{% else %}{{ urls.format('SITE_LOGIN') }}{% endif %}"><img src="{{ sakura.contentPath }}/pixel.png" alt="{{ user.data.username }}" style="background-image: url('{{ urls.format('IMAGE_AVATAR', [user.data.user_id]) }}');" class="nav-avatar" /></a></li>
</ul> </ul>
</div> </div>
<div id="content"> <div id="content">

View file

@ -0,0 +1,10 @@
{% extends 'global/master.tpl' %}
{% block title %}Restricted{% endblock %}
{% block content %}
<div class="platform">
<h1 class="sectionHead">You aren't allowed to view this page!</h1>
Please make sure that you're logged in and are supposed to be able to access this page. If you think this was a mistake please contact a staff member.
</div>
{% endblock %}

View file

@ -28,7 +28,7 @@
<script type="text/javascript"> <script type="text/javascript">
// Header // Header
window.addEventListener("scroll", function(e) { window.addEventListener("scroll", function(e) {
if(e.pageY > 165) { if(window.scrollY > 170) {
var profileHeader = document.getElementById('profileHeader'); var profileHeader = document.getElementById('profileHeader');
var profileContent = document.getElementById('profileContent'); var profileContent = document.getElementById('profileContent');
profileHeader.className = 'profileHeaderContent floating'; profileHeader.className = 'profileHeaderContent floating';

View file

@ -193,80 +193,11 @@ a:active {
color: inherit; color: inherit;
} }
/*
* Site header
*/
#header {
height: 120px;
max-width: 1024px;
margin: 0 auto;
display: flex;
justify-content: space-between;
}
#header > * {
display: inline-block;
}
#header .logo {
background: url('../images/image-logo.svg') no-repeat scroll center center / cover;
height: 120px;
width: 120px;
flex-grow: 1;
margin: auto;
}
#header .logo.loading {
transform-origin: 50% 50.5%;
animation: spin 2s infinite linear;
background-image: url('../images/spinner.svg');
}
#header .social {
z-index: 1;
font-size: 2.5em;
background: rgba(0, 0, 0, .4);
padding: 6px;
margin: 1em .5em;
position: relative;
bottom: -4px;
height: 40px;
border-radius: 5px;
text-align: center;
}
#header .social > ul {
list-style: none;
}
#header .social > ul > li {
float: left;
margin: 5px;
width: 30px;
}
#header .social > ul > li > a {
color: inherit;
text-decoration: none;
text-shadow: 0 0 2px #fcfcfc;
transition: .4s;
}
#header .social > ul > li > a:hover {
color: #eee;
text-shadow: 0 0 6px #fcfcfc;
}
#header .social > ul > li > a:active {
color: #ccc;
text-shadow: 0 0 3px #fcfcfc;
}
/* /*
* Wrapper * Wrapper
*/ */
#wrapper { #wrapper {
padding-top: 5px; padding-top: 10px;
padding-bottom: 100px; padding-bottom: 100px;
} }
@ -310,6 +241,9 @@ a:active {
width: 100%; width: 100%;
border: 1px solid rgba(148, 117, 178, .6); border: 1px solid rgba(148, 117, 178, .6);
box-shadow: 0 0 7px rgba(255, 255, 255, .2); box-shadow: 0 0 7px rgba(255, 255, 255, .2);
display: flex;
justify-content: space-between;
z-index: 999;
transition: background-color .2s, box-shadow .2s, height .2s, line-height .2s; transition: background-color .2s, box-shadow .2s, height .2s, line-height .2s;
} }
@ -326,20 +260,34 @@ a:active {
max-width: 1024px; max-width: 1024px;
} }
#navigation > ul > li { #navigation > ul {
list-style: none; list-style: none;
float: left; display: flex;
flex-grow: 0;
flex-shrink: 0;
}
#navigation > ul > li {
max-height: 30px; max-height: 30px;
transition: .2s; transition: .2s;
} }
#navigation > ul > .site-menu {
text-align: left;
}
#navigation > ul > .user-menu {
text-align: right;
}
#navigation.floating > ul > li { #navigation.floating > ul > li {
max-height: 25px; max-height: 25px;
} }
#navigation > ul > li > a:not(.ignore) { #navigation > ul > li > a {
height: 30px; height: 30px;
line-height: 30px; line-height: 30px;
min-width: 30px;
display: block; display: block;
text-align: center; text-align: center;
color: inherit; color: inherit;
@ -347,89 +295,19 @@ a:active {
transition: .2s; transition: .2s;
} }
#navigation > .nav-right > li > a:not(.ignore) { #navigation.floating > ul > li > a {
padding: 0 10px;
}
#navigation > .nav-left > li > a:not(.ignore) {
width: 30px;
}
#navigation.floating > ul > li > a:not(.ignore) {
height: 25px; height: 25px;
min-width: 25px;
line-height: 25px; line-height: 25px;
} }
#navigation.floating > .nav-left > li > a:not(.ignore) { #navigation > ul > li.logo > a {
width: 25px; background: transparent url('../images/image-logo-white.svg') no-repeat scroll center center / cover;
} }
#navigation > ul > li.logo { #navigation > ul > li > a:hover {
width: 30px; background-color: rgba(69, 56, 81, .2);
height: 30px; box-shadow: inset 0 0 2px rgba(0, 0, 0, .75);
}
#navigation.floating > ul > li.logo {
width: 25px;
height: 25px;
}
#navigation > ul > li.logo > a > div:first-child {
background: url('../images/image-logo-white.svg') no-repeat scroll center center / cover;
content: ".";
font-size: 0;
width: 100%;
height: 100%;
display: block;
}
#navigation > ul > li > a {
position: relative;
z-index: 901;
}
#navigation > .nav-left > li > a:not(.ignore) > div:first-child {
position: relative;
width: 30px;
height: 30px;
}
#navigation > .nav-left > li > a:not(.ignore):hover > div:first-child {
z-index: 9;
}
#navigation > .nav-left > li > a:not(.ignore) > div:last-child {
display: none;
position: absolute;
top: 0;
left: 0;
width: 100px;
max-height: 30px;
font-family: "Exo2-0-LightItalic", sans-serif;
background: rgba(69, 56, 81, .8);
padding: 0 10px 0 30px;
box-shadow: 0 2px 6px rgba(0, 0, 0, .75);
z-index: 8;
text-align: center;
}
#navigation > .nav-left > li > a:not(.ignore):hover > div {
display: block;
}
#navigation .nav-usermenu > a {
display: block !important;
text-align: right !important;
}
#navigation .nav-usermenu > a:after {
font-family: FontAwesome;
content: " \f0d7";
}
#navigation .nav-usermenu:hover > a:after {
font-family: FontAwesome;
content: " \f0d8";
} }
#navigation .nav-avatar { #navigation .nav-avatar {
@ -437,6 +315,8 @@ a:active {
width: 30px; width: 30px;
background: url('/pixel.png') no-repeat scroll left center / cover transparent; background: url('/pixel.png') no-repeat scroll left center / cover transparent;
transition: .2s; transition: .2s;
position: relative;
z-index: 2;
} }
#navigation.floating .nav-avatar { #navigation.floating .nav-avatar {
@ -444,13 +324,53 @@ a:active {
width: 25px; width: 25px;
} }
#navigation .nav-usermenu {
position: relative;
z-index: 2;
}
#navigation .nav-usermenu > a {
display: flex !important;
text-align: right !important;
justify-content: space-around;
position: relative;
z-index: 2;
background: transparent !important;
box-shadow: 0 0 0 transparent !important;
padding-right: 5px;
}
#navigation .nav-usermenu .nav-user-dropdown:after {
font-family: FontAwesome;
content: " \f107";
line-height: 1em;
}
#navigation .nav-usermenu:hover .nav-user-dropdown:after {
font-family: FontAwesome;
content: " \f106";
}
#navigation .nav-usermenu > a > div {
display: inline-block;
}
#navigation .nav-usermenu > a > div > .nav-username {
font-size: .8em;
line-height: 1.1em;
}
#navigation .nav-usermenu > a > div > .nav-userstats {
font-size: .6em;
line-height: 1.1em;
}
#navigation > ul > li > ul { #navigation > ul > li > ul {
display: none; display: none;
} }
#navigation > ul > li:hover > ul { #navigation > ul > li:hover > ul {
display: block; display: block;
z-index: 900;
background: rgba(69, 56, 81, .8); background: rgba(69, 56, 81, .8);
position: absolute; position: absolute;
top: 0; top: 0;
@ -458,6 +378,8 @@ a:active {
list-style: none; list-style: none;
padding: 30px 4px 5px; padding: 30px 4px 5px;
box-shadow: 0 2px 6px rgba(0, 0, 0, .75); box-shadow: 0 2px 6px rgba(0, 0, 0, .75);
font-size: .8em;
line-height: 1.5em;
} }
#navigation > ul > li > ul > li > a { #navigation > ul > li > ul > li > a {
@ -466,6 +388,7 @@ a:active {
display: block; display: block;
transition: .2s; transition: .2s;
padding: 2px 7px; padding: 2px 7px;
z-index: 1;
} }
#navigation > ul > li > ul > li > a:hover { #navigation > ul > li > ul > li > a:hover {
@ -477,11 +400,15 @@ a:active {
} }
#navigation .nav-usermenu ul { #navigation .nav-usermenu ul {
right: -30px; right: -30px !important;
text-align: right; text-align: right;
min-width: 150px; min-width: 150px;
} }
#navigation.floating .nav-usermenu ul {
right: -25px !important;
}
/* /*
* Profiles * Profiles
*/ */

View file

@ -68,7 +68,7 @@ function convertParallaxPositionValue(pos, dir, neg) {
// Menu bar // Menu bar
window.addEventListener("scroll", function(e) { window.addEventListener("scroll", function(e) {
if(e.pageY > 6) { if(window.scrollY > 11) {
var wrapper = document.getElementById('wrapper'); var wrapper = document.getElementById('wrapper');
var navbar = document.getElementById('navigation'); var navbar = document.getElementById('navigation');
wrapper.className = 'navFloat'; wrapper.className = 'navFloat';

View file

@ -47,13 +47,27 @@ if (isset($_REQUEST['request-notifications']) && $_REQUEST['request-notification
// Set header, convert the array to json, print it and exit // Set header, convert the array to json, print it and exit
print json_encode($notifications); print json_encode($notifications);
exit; exit;
} elseif (isset($_REQUEST['comment-action']) && $_REQUEST['comment-action'] && Users::checkLogin()) { } elseif (isset($_REQUEST['comment-action']) && $_REQUEST['comment-action']) {
// Referrer // Referrer
$redirect = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : $urls->format('SITE_INDEX')); $redirect = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : $urls->format('SITE_INDEX'));
// Continue // Continue
$continue = true; $continue = true;
// Match session ids for the same reason
if (!Users::checkLogin()) {
$renderData['page'] = [
'redirect' => $redirect,
'message' => 'You must be logged in to do that!',
'success' => 0,
];
// Prevent
$continue = false;
}
// Match session ids for the same reason // Match session ids for the same reason
if (!isset($_REQUEST['session']) || $_REQUEST['session'] != session_id()) { if (!isset($_REQUEST['session']) || $_REQUEST['session'] != session_id()) {
$renderData['page'] = [ $renderData['page'] = [