r20151104

Signed-off-by: Flashwave <me@flash.moe>
This commit is contained in:
flash 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
{
// Array containing bbcodes
private static $bbcodes = [];
}

View file

@ -8,7 +8,7 @@
namespace Sakura;
// Define Sakura version
define('SAKURA_VERSION', '20151101');
define('SAKURA_VERSION', '20151104');
define('SAKURA_VLABEL', 'Eminence');
define('SAKURA_COLOUR', '#6C3082');
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>
{% endif %}
<div id="navigation">
<ul class="nav-left floatLeft">
<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><a href="{{ urls.format('SITE_NEWS') }}"><div class="fa fa-newspaper-o"></div><div>News</div></a></li>
<li><a href="//chat.{{ sakura.urlMain }}/"><div class="fa fa-commenting"></div><div>Chat</div></a></li>
<li><a href="{{ urls.format('FORUM_INDEX') }}"><div class="fa fa-comments"></div><div>Forum</div></a></li>
<li><a href="{{ urls.format('MEMBERLIST_INDEX') }}"><div class="fa fa-users"></div><div>Members</div></a></li>
<li><a href="{{ urls.format('SITE_SEARCH') }}"><div class="fa fa-search"></div><div>Search</div></a></li>
<li><a href="{{ urls.format('SITE_PREMIUM') }}"><div class="fa fa-heart"></div><div>Support us</div></a></li>
<ul class="site-menu">
<li title="Home" class="logo"><a href="{{ urls.format('SITE_HOME') }}" {% if sakura.siteLogo %} style="background-image: url('{{ sakura.siteLogo }}');"{% endif %}></a></li>
<li title="News"><a href="{{ urls.format('SITE_NEWS') }}" class="fa fa-newspaper-o"></a></li>
<li title="Chat"><a href="//chat.{{ sakura.urlMain }}/" class="fa fa-commenting"></a></li>
<li title="Forums"><a href="{{ urls.format('FORUM_INDEX') }}" class="fa fa-comments"></a></li>
<li title="Members"><a href="{{ urls.format('MEMBERLIST_INDEX') }}" class="fa fa-users"></a></li>
<li title="Search"><a href="{{ urls.format('SITE_SEARCH') }}" class="fa fa-search"></a></li>
<li title="Support us"><a href="{{ urls.format('SITE_PREMIUM') }}" class="fa fa-heart"></a></li>
</ul>
<ul class="nav-right floatRight">
<ul class="user-menu">
<li class="nav-usermenu">
<a href="#"{% if session.checkLogin %} style="color: {{ user.colour }};"{% endif %}>{% if session.checkLogin %}{{ user.data.username }}{% else %}Guest{% endif %}</a>
<ul>
<a href="{% if session.checkLogin %}javascript:void(0);{% else %}{{ urls.format('SITE_LOGIN') }}{% endif %}">
<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 %}
<li><a href="{{ urls.format('USER_PROFILE', [user.data.user_id]) }}">My Profile</a></li>
<li><a href="{{ urls.format('SETTING_CAT', ['messages']) }}">Private Messages</a></li>
<li><a href="{{ urls.format('SETTINGS_INDEX') }}">User Settings</a></li>
<li><a href="{{ urls.format('MANAGE_INDEX') }}">Site Management</a></li>
<li><a href="{{ urls.format('USER_LOGOUT', [php.time, php.sessionid, sakura.currentPage]) }}">Logout</a></li>
{% else %}
<li><a href="{{ urls.format('SITE_LOGIN') }}">Login or Register</a></li>
<ul>
<li><a href="{{ urls.format('USER_PROFILE', [user.data.user_id]) }}">My Profile</a></li>
<li><a href="{{ urls.format('SETTING_CAT', ['messages']) }}">Private Messages</a></li>
<li><a href="{{ urls.format('SETTINGS_INDEX') }}">User Settings</a></li>
<li><a href="{{ urls.format('MANAGE_INDEX') }}">Site Management</a></li>
<li><a href="{{ urls.format('USER_LOGOUT', [php.time, php.sessionid, sakura.currentPage]) }}">Logout</a></li>
</ul>
{% endif %}
</ul>
</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>
</div>
<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">
// Header
window.addEventListener("scroll", function(e) {
if(e.pageY > 165) {
if(window.scrollY > 170) {
var profileHeader = document.getElementById('profileHeader');
var profileContent = document.getElementById('profileContent');
profileHeader.className = 'profileHeaderContent floating';

View file

@ -193,80 +193,11 @@ a:active {
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 {
padding-top: 5px;
padding-top: 10px;
padding-bottom: 100px;
}
@ -310,6 +241,9 @@ a:active {
width: 100%;
border: 1px solid rgba(148, 117, 178, .6);
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;
}
@ -326,20 +260,34 @@ a:active {
max-width: 1024px;
}
#navigation > ul > li {
#navigation > ul {
list-style: none;
float: left;
display: flex;
flex-grow: 0;
flex-shrink: 0;
}
#navigation > ul > li {
max-height: 30px;
transition: .2s;
}
#navigation > ul > .site-menu {
text-align: left;
}
#navigation > ul > .user-menu {
text-align: right;
}
#navigation.floating > ul > li {
max-height: 25px;
}
#navigation > ul > li > a:not(.ignore) {
#navigation > ul > li > a {
height: 30px;
line-height: 30px;
min-width: 30px;
display: block;
text-align: center;
color: inherit;
@ -347,89 +295,19 @@ a:active {
transition: .2s;
}
#navigation > .nav-right > li > a:not(.ignore) {
padding: 0 10px;
}
#navigation > .nav-left > li > a:not(.ignore) {
width: 30px;
}
#navigation.floating > ul > li > a:not(.ignore) {
#navigation.floating > ul > li > a {
height: 25px;
min-width: 25px;
line-height: 25px;
}
#navigation.floating > .nav-left > li > a:not(.ignore) {
width: 25px;
#navigation > ul > li.logo > a {
background: transparent url('../images/image-logo-white.svg') no-repeat scroll center center / cover;
}
#navigation > ul > li.logo {
width: 30px;
height: 30px;
}
#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 > ul > li > a:hover {
background-color: rgba(69, 56, 81, .2);
box-shadow: inset 0 0 2px rgba(0, 0, 0, .75);
}
#navigation .nav-avatar {
@ -437,6 +315,8 @@ a:active {
width: 30px;
background: url('/pixel.png') no-repeat scroll left center / cover transparent;
transition: .2s;
position: relative;
z-index: 2;
}
#navigation.floating .nav-avatar {
@ -444,13 +324,53 @@ a:active {
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 {
display: none;
}
#navigation > ul > li:hover > ul {
display: block;
z-index: 900;
background: rgba(69, 56, 81, .8);
position: absolute;
top: 0;
@ -458,6 +378,8 @@ a:active {
list-style: none;
padding: 30px 4px 5px;
box-shadow: 0 2px 6px rgba(0, 0, 0, .75);
font-size: .8em;
line-height: 1.5em;
}
#navigation > ul > li > ul > li > a {
@ -466,6 +388,7 @@ a:active {
display: block;
transition: .2s;
padding: 2px 7px;
z-index: 1;
}
#navigation > ul > li > ul > li > a:hover {
@ -477,11 +400,15 @@ a:active {
}
#navigation .nav-usermenu ul {
right: -30px;
right: -30px !important;
text-align: right;
min-width: 150px;
}
#navigation.floating .nav-usermenu ul {
right: -25px !important;
}
/*
* Profiles
*/

View file

@ -68,7 +68,7 @@ function convertParallaxPositionValue(pos, dir, neg) {
// Menu bar
window.addEventListener("scroll", function(e) {
if(e.pageY > 6) {
if(window.scrollY > 11) {
var wrapper = document.getElementById('wrapper');
var navbar = document.getElementById('navigation');
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
print json_encode($notifications);
exit;
} elseif (isset($_REQUEST['comment-action']) && $_REQUEST['comment-action'] && Users::checkLogin()) {
} elseif (isset($_REQUEST['comment-action']) && $_REQUEST['comment-action']) {
// Referrer
$redirect = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : $urls->format('SITE_INDEX'));
// Continue
$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
if (!isset($_REQUEST['session']) || $_REQUEST['session'] != session_id()) {
$renderData['page'] = [