r20151012

Signed-off-by: Flashwave <me@flash.moe>
This commit is contained in:
flash 2015-10-12 19:28:34 +02:00
parent c996de34c3
commit a28cfd6e69
7 changed files with 146 additions and 115 deletions

View file

@ -3107,6 +3107,42 @@
"user": "Flashwave"
}
],
"20151012": [
"eminence",
{
"type": "FIX",
"change": "Fixed Misaki template tags.",
"user": "Flashwave"
},
{
"type": "ADD",
"change": "Readded code for testing style.",
"user": "Flashwave"
},
{
"type": "FIX",
"change": "Fixed broken ternary in the testing style switching code.",
"user": "Flashwave"
},
{
"type": "FIX",
"change": "Display comment counts in Misaki.",
"user": "Flashwave"
},
{
"type": "UPD",
"change": "Redid the markup of Misaki profiles.",
"user": "Flashwave"
},
{
"type": "REM",
"change": "Removed LIKE SELECT statement from the User class.",
"user": "Flashwave"
}
]
}

View file

@ -26,17 +26,6 @@ class User
]
);
// Check if anything like the username exists
if (empty($this->data)) {
$this->data = Database::fetch(
'users',
false,
[
'username_clean' => ['%' . Main::cleanString($uid, true) . '%', 'LIKE'],
]
);
}
// Check if the user actually exists
if (empty($this->data)) {
// If not assign as the fallback user

View file

@ -8,7 +8,7 @@
namespace Sakura;
// Define Sakura version
define('SAKURA_VERSION', '20151011');
define('SAKURA_VERSION', '20151012');
define('SAKURA_VLABEL', 'Eminence');
define('SAKURA_COLOUR', '#6C3082');
define('SAKURA_STABLE', false);
@ -105,12 +105,14 @@ $templateName =
defined('SAKURA_MANAGE') ?
Configuration::getConfig('manage_style') :
(
(
isset($currentUser->data['user_data']['userOptions']['useMisaki']) &&
$currentUser->data['user_data']['userOptions']['useMisaki'] &&
$currentUser->checkPermission('SITE', 'ALTER_PROFILE')
) ?
'misaki' :
Configuration::getConfig('site_style');
) ?
'misaki' :
Configuration::getConfig('site_style')
);
if (!defined('SAKURA_NO_TPL')) {
// Initialise templating engine

View file

@ -3,7 +3,7 @@
<a class="news-title floatLeft" href="{{ urls.format('SITE_NEWS_POST', [post.news_id]) }}">{{ post.news_title }}</a>
<div class="news-details floatRight">
<div>{{ post.news_timestamp|date(sakura.dateFormat) }}</div>
<div>Posted by <a class="username" style="color: {{ post.news_poster.colour }};" href="{{ urls.format('USER_PROFILE', [post.news_poster.data.user_id]) }}">{{ post.news_poster.data.username }}</a>{% if posts|length > 1 %} / <a class="default" href="{{ urls.format('SITE_NEWS_POST', [post.news_id]) }}#comments">View comments</a>{% endif %}</div>
<div>Posted by <a class="username" style="color: {{ post.news_poster.colour }};" href="{{ urls.format('USER_PROFILE', [post.news_poster.data.user_id]) }}">{{ post.news_poster.data.username }}</a>{% if not (viewPost and postExists) %} / <a class="default" href="{{ urls.format('SITE_NEWS_POST', [post.news_id]) }}#comments">{{ post.news_comments.count }} comment{% if post.news_comments.count != 1 %}s{% endif %}</a>{% endif %}</div>
</div>
<div class="clear"></div>
</div>

View file

@ -22,26 +22,24 @@
</div>
{% else %}
<div class="profile" id="u{{ profile.data.user_id }}">
<div class="profileHeader" style="background-image: url('{{ urls.format('IMAGE_HEADER', [profile.data.user_id]) }}');">
<div class="profileFade"></div>
<div class="headerLeft">
<img class="userAvatar" src="{{ urls.format('IMAGE_AVATAR', [profile.data.user_id]) }}" alt="{{ profile.data.username }}'s Avatar" />
<div class="profileHeaderContent profileHeader" style="background-image: linear-gradient(0deg, transparent 0%, transparent 12%, rgba(0, 0, 0, .7) 30%, transparent 76%, transparent 100%), url('{{ urls.format('IMAGE_HEADER', [profile.data.user_id]) }}');">
<div class="userAvatar" style="background-image: url('{{ urls.format('IMAGE_AVATAR', [profile.data.user_id]) }}');">{{ profile.data.username }}'s Avatar</div>
<div class="userData">
<div class="headerLeft">
<div class="profileUsername" style="color: {{ profile.colour }};"{% if profile.getUsernameHistory %} title="Known as {{ profile.getUsernameHistory[0]['username_old'] }} before {{ profile.getUsernameHistory[0]['change_time']|date(sakura.dateFormat) }}."{% endif %}>
{{ profile.data.username }}
</div>
<div class="profileUsertitle">
<div class="profileUserTitle">
{{ profile.userTitle }}
</div>
</div>
</div>
<div class="joinedLast">
<div class="headerRight">
<div>Joined <span title="{{ profile.data.user_registered|date(sakura.dateFormat) }}">{{ profile.elapsed.joined }}</span></div>
<div>{% if profile.data.user_last_online < 1 %}User hasn't logged in yet.{% else %}Last Active <span title="{{ profile.data.user_last_online|date(sakura.dateFormat) }}">{{ profile.elapsed.lastOnline }}</span>{% endif %}</div>
</div>
<div class="clear"></div>
</div>
<div class="profileContent">
</div>
<div class="profileContainer profileContent">
<div class="userDataBar">
{% if not profile.checkPermission('SITE', 'DEACTIVATED') and (profile.checkPremium[0] or profile.checkPermission('MANAGE', 'USE_MANAGE')) %}
<div class="profilePlatform hierarchyContainer">
@ -121,32 +119,56 @@
</div>
</div>
</div>
<div class="userPage">
<div class="profileMain">
{% if not profile.checkPermission('SITE', 'DEACTIVATED') %}
<div class="statsRow">
{% if profileView != (noUserpage ? 'comments' : 'index') %}
<div class="profilePlatform">
<a class="inner" href="{{ urls.format('USER_FRIENDS', [profile.data.user_id]) }}">
<div>Friends</div>
<a class="inner" title="Userpage" href="{{ urls.format('USER_PROFILE', [profile.data.user_id]) }}">
<div class="fa fa-user"></div>
</a>
</div>
{% endif %}
{% if profileView != 'friends' %}
<div class="profilePlatform">
<a class="inner" title="Friends" href="{{ urls.format('USER_FRIENDS', [profile.data.user_id]) }}">
<div class="fa fa-user-plus"></div>
<div class="count">{{ profile.getFriends|length }}</div>
</a>
</div>
{% endif %}
{% if profileView != 'groups' %}
<div class="profilePlatform">
<a class="inner" href="{{ urls.format('USER_GROUPS', [profile.data.user_id]) }}">
<div>Groups</div>
<div class="count">n/a</div>
<a class="inner" title="Groups" href="{{ urls.format('USER_GROUPS', [profile.data.user_id]) }}">
<div class="fa fa-users"></div>
<div class="count">0</div>
</a>
</div>
<div class="profilePlatform forumStats">
<div class="inner">
<div class="forumStatTitle">Forum stats</div>
<div class="forumStatCount">
<a class="posts" href="{{ urls.format('USER_POSTS', [profile.data.user_id]) }}">{{ profile.forumStats.posts }} post{% if profile.forumStats.posts != 1 %}s{% endif %}</a>
<a class="threads" href="{{ urls.format('USER_THREADS', [profile.data.user_id]) }}">{% if profile.forumStats.topics %}{{ profile.forumStats.topics }}{% else %}0{% endif %} thread{% if profile.forumStats.topics != 1 %}s{% endif %}</a>
{% endif %}
{% if profileView != 'comments' %}
<div class="profilePlatform">
<a class="inner" title="Comments" href="{{ urls.format('USER_COMMENTS', [profile.data.user_id]) }}">
<div class="fa fa-comments"></div>
<div class="count">{{ profile.profileComments.count }}</div>
</a>
</div>
<div class="clear"></div>
{% endif %}
{% if profileView != 'threads' %}
<div class="profilePlatform">
<a class="inner" title="Threads" href="{{ urls.format('USER_THREADS', [profile.data.user_id]) }}">
<div class="fa fa-list"></div>
<div class="count">{{ profile.forumStats.topics }}</div>
</a>
</div>
{% endif %}
{% if profileView != 'posts' %}
<div class="profilePlatform">
<a class="inner" title="Posts" href="{{ urls.format('USER_POSTS', [profile.data.user_id]) }}">
<div class="fa fa-reply"></div>
<div class="count">{{ profile.forumStats.posts }}</div>
</a>
</div>
<div class="clear"></div>
{% endif %}
</div>
<div class="userPage profilePlatform">
<div class="inner">
@ -155,7 +177,6 @@
</div>
{% endif %}
</div>
<div class="clear"></div>
</div>
</div>
{% endif %}

View file

@ -379,15 +379,23 @@ a:active {
.profile {
text-shadow: 1px 1px 2px rgba(0, 0, 0, .75);
font-family: "Exo2-0-LightItalic", sans-serif;
display: flex;
flex-direction: column;
align-content: stretch;
width: 100%;
position: relative;
top: -35px;
margin-bottom: -35px;
}
.profile .profileContainer {
display: flex;
}
.profile .profilePlatform {
background: rgba(148, 117, 178, .2);
box-shadow: 0 2px 6px rgba(0, 0, 0, .75);
margin-left: 10px;
margin-top: 10px;
margin: 0 0 10px 10px;
}
.profile .profilePlatform > .inner {
@ -403,61 +411,57 @@ a:active {
.profile > .profileHeader {
height: 250px;
float: left;
width: 100%;
display: flex;
align-items: flex-end;
}
.profile > .profileHeader > .profileFade {
background: linear-gradient(0deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .7) 30%, rgba(0, 0, 0, 0) 100%);
height: 160px;
width: 100%;
position: relative;
top: 60px;
z-index: 1;
}
.profile > .profileHeader > .headerLeft > .userAvatar {
.profile > .profileHeader > .userAvatar {
font-size: 0;
background: transparent no-repeat scroll left center / contain;
height: 200px;
width: 200px;
position: relative;
top: -100px;
z-index: 2;
margin-left: 10px;
border-radius: 2px;
box-shadow: 0 2px 6px rgba(0, 0, 0, .75);
float: left;
margin: 10px;
margin-bottom: -10px;
flex-shrink: 0;
}
.profile > .profileHeader > .headerLeft > .userData {
.profile > .profileHeader > .userData {
display: flex;
align-items: center;
position: relative;
top: -16px;
float: left;
margin: 0 10px;
z-index: 3;
top: -55px;
width: 100%;
}
.profile > .profileHeader > .headerLeft > .userData > .profileUsername {
.profile > .profileHeader > .userData > .headerLeft {
flex-grow: 1;
}
.profile > .profileHeader > .userData > .headerLeft > .profileUsername {
font-size: 3em;
line-height: .8em;
}
.profile > .profileHeader > .headerLeft > .userData > .profileUsertitle {
margin-left: 12px;
.profile > .profileHeader > .userData > .headerLeft > .profileUserTitle {
padding-left: 12px;
}
.profile > .profileHeader > .joinedLast {
position: relative;
top: -10px;
z-index: 3;
float: right;
.profile > .profileHeader > .userData > .headerRight {
text-align: right;
margin-right: 10px;
padding-right: 12px;
}
.profile > .profileContent {
margin: 10px 10px 0 0;
}
.profile > .profileContent > .userDataBar {
float: left;
width: 210px;
margin-top: 10px;
flex-shrink: 0;
}
.profile > .profileContent > .userDataBar > .hierarchyContainer > .inner > .hierarchies {
@ -539,53 +543,32 @@ a:active {
text-align: center;
}
.profile > .profileContent > .userPage {
float: left;
width: 800px;
.profile > .profileContent > .profileMain {
width: 100%;
}
.profile > .profileContent > .userPage > .statsRow > div {
float: left;
width: 200px;
.profile > .profileContent > .profileMain > .statsRow {
width: 100%;
display: flex;
}
.profile > .profileContent > .profileMain > .statsRow > div {
font-size: 2.5em;
line-height: 1em;
flex-basis: 0;
flex-grow: 1;
flex-shrink: 0;
}
.profile > .profileContent > .userPage > .statsRow > div > .inner > .count {
font-size: 1.2em;
line-height: 1em;
text-align: right;
}
.profile > .profileContent > .userPage > .statsRow > .forumStats {
width: 370px;
}
.profile > .profileContent > .userPage > .statsRow > .forumStats > .inner > .forumStatTitle {
float: left;
}
.profile > .profileContent > .userPage > .statsRow > .forumStats > .inner > .forumStatCount {
.profile > .profileContent > .profileMain > .statsRow .inner > .count {
float: right;
text-align: right;
}
.profile > .profileContent > .userPage > .statsRow > .forumStats > .inner > .forumStatCount > a {
display: block;
.profile > .profileContent > .profileMain > .statsRow .inner a {
text-decoration: none;
color: inherit;
}
.profile > .profileContent > .userPage > .statsRow > .forumStats > .inner > .forumStatCount > .posts {
font-size: .8em;
line-height: 1.25em;
}
.profile > .profileContent > .userPage > .statsRow > .forumStats > .inner > .forumStatCount > .threads {
font-size: 1.2em;
line-height: 1em;
}
/*
* User Background
*/