pretty much today's bread

This commit is contained in:
Pachira 2015-08-28 22:32:31 +02:00
parent 15ec4b04c7
commit df0a14de27
20 changed files with 214 additions and 136 deletions

View file

@ -48,7 +48,10 @@
"20150820",
"20150821",
"20150822",
"20150823"
"20150823",
"20150825",
"20150826",
"20150828"
]
@ -2252,6 +2255,41 @@
"user": "Flashwave"
}
],
"20150825": [
{
"type": "UPD",
"change": "Moved profile templates to own folder.",
"user": "Flashwave"
}
],
"20150826": [
{
"type": "ADD",
"change": "Added profile entry for birthday.",
"user": "Flashwave"
}
],
"20150828": [
{
"type": "UPD",
"change": "Did a plethora of changes to Misaki.",
"user": "Flashwave"
},
{
"type": "UPD",
"change": "Cleaned up the code for the front page stats.",
"user": "Flashwave"
}
]
}

View file

@ -1428,4 +1428,11 @@ class Users {
}
// Get the ID of the newest user
public static function getNewestUserId() {
return Database::fetch('users', false, ['password_algo' => ['nologin', '!=']], ['id', true], ['1'])['id'];
}
}

View file

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

View file

@ -1,4 +0,0 @@
<div class="stats">
<h1 class="sectionHead">stats</h1>
<div class="content">We have <b>{{ stats.userCount }}</b>, <b><a href="//{{ sakura.urls.main }}/u/{{ stats.newestUser.id }}" class="default">{{ stats.newestUser.username }}</a></b> is the newest user, it has been <b>{{ stats.lastRegDate }}</b> since the last user registered, there's <b>{{ stats.chatOnline }}</b> in chat right now and the forum has <b>{{ stats.topicCount }}</b> and <b>{{ stats.postCount }}</b>.</div>
</div>

View file

@ -1,7 +1,6 @@
{% include 'global/header.tpl' %}
<div class="content standalone">
<h1 class="sectionHeader">Information</h1>
<hr class="default" />
<h1 class="sectionHead">Information</h1>
{{ page.message }}
{% if page.redirect %}<br /><a href="{{ page.redirect }}" class="default">Click here if you aren't being redirected.</a>{% endif %}
</div>

View file

@ -5,9 +5,8 @@
<div class="ft-logo"></div>
<div class="ft-text">
<div>Copyright &copy; 2013-2015 <a href="http://flash.moe/" target="_blank">Flashwave</a> &amp; <a href="http://circlestorm.net/" target="_blank">Circlestorm</a>, <a href="/credits">et al</a>.</div>
<div><a href="/r/terms">Terms of Service</a> | <a href="/contact">Contact</a> | <a href="/faq">FAQ</a> | <a href="/feedback">Feedback</a> | <a href="/p/rules">Rules</a> | <a href="/changelog">Changelog</a> | <a href="http://status.flashii.net/">Status</a></div>
<div><a href="/p/terms">Terms of Service</a> | <a href="/contact">Contact</a> | <a href="/faq">FAQ</a> | <a href="/feedback">Feedback</a> | <a href="/p/rules">Rules</a> | <a href="/changelog">Changelog</a> | <a href="http://status.flashii.net/">Status</a></div>
</div>
<div class="clear"></div>
</div>
</div>
</body>

View file

@ -84,19 +84,19 @@
<div class="header-fade"></div>
<div id="notifications"></div>
<div id="header">
<div class="logo"></div>
<div class="text"></div>
<div class="floatRight">
<div class="social">
<ul>
<li><a target="_blank" title="Flashii on Twitter" class="fa fa-twitter" href="https://twitter.com/_flashii"></a></li>
<li><a target="_blank" title="Flashii on YouTube" class="fa fa-youtube-play" href="https://youtube.com/user/flashiinet"></a></li>
<li><a target="_blank" title="Flashii on Steam" class="fa fa-steam" href="https://steamcommunity.com/groups/flashiinet"></a></li>
<li><a title="Subscribe to the news page feed" class="fa fa-rss" href="/news.xml"></a></li>
</ul>
<div class="clear"></div>
</div>
<div class="image"></div>
<a href="/">
<div class="logo"></div>
</a>
<div class="social">
<ul>
<li><a target="_blank" title="Flashii on Twitter" class="fa fa-twitter" href="https://twitter.com/_flashii"></a></li>
<li><a target="_blank" title="Flashii on YouTube" class="fa fa-youtube-play" href="https://youtube.com/user/flashiinet"></a></li>
<li><a target="_blank" title="Flashii on Steam" class="fa fa-steam" href="https://steamcommunity.com/groups/flashiinet"></a></li>
<li><a target="_blank" title="Circlestorm on BitBucket" class="fa fa-bitbucket" href="https://bitbucket.org/circlestorm"></a></li>
<li><a target="_blank" title="Flashii on osu!" class="fa fa-dot-circle-o" href="https://osu.ppy.sh/#"></a></li>
<li><a title="Subscribe to the news page feed" class="fa fa-rss" href="/news.xml"></a></li>
</ul>
<div class="clear"></div>
</div>
</div>
<div id="wrapper">
@ -112,7 +112,7 @@
<li><a href="/forum">Forum</a></li>
<li><a href="/members">Members</a></li>
<li><a href="/search">Search</a></li>
<li><a href="/donate">Donate</a></li>
<li><a href="/support">Support us</a></li>
</ul>
<ul class="nav-right floatRight">
<li class="nav-usermenu">
@ -132,5 +132,4 @@
</li>
<li><a href="/u/{{ user.data.id }}" class="ignore"><img src="{{ sakura.contentPath }}/pixel.png" alt="{{ user.data.username }}" style="background-image: url('/a/{{ user.data.id }}');" class="nav-avatar" /></a></li>
</ul>
<div class="clear"></div>
</div>

View file

@ -1,10 +1,21 @@
{% include 'global/header.tpl' %}
<div class="homepage">
<div class="frontHead">
<h1 class="sectionHead">a</h1>
</div>
<div class="frontStats">
{# include 'elements/indexRight.tpl' #}
<div title="We have {{ stats.userCount }} user{% if stats.userCount != 1 %}s{% endif %}">
<div><span class="fa fa-line-chart"></span> <span>{{ stats.userCount }}</span></div>
</div>
<div title="Active in the last 5 minutes: {% for amount,onlineUser in stats.onlineUsers %}{{ onlineUser.username }}{% if amount != (stats.onlineUsers|length - 1) %}, {% endif %}{% endfor %}">
<div><span class="fa fa-users"></span> <span>{{ stats.onlineUsers|length }}</span></div>
</div>
<div title="Our newest user is {{ stats.newestUser.data.username }}">
<div><span class="fa fa-user-plus"></span> <a href="/u/{{ stats.newestUser.data.id }}" style="color: {{ stats.newestUser.colour }}">{{ stats.newestUser.data.username }}</a></div>
</div>
<div title="It has been {{ stats.lastRegDate }} since the last user registered">
<div><span class="fa fa-clock-o"></span> <span>{{ stats.lastRegDate }}</span></div>
</div>
<div title="The forum has {{ stats.topicCount }} thread{% if stats.topicCount != 1 %}s{% endif %} consisting out of {{ stats.postCount }} post{% if stats.postCount != 1 %}s{% endif %}">
<div><span class="fa fa-list"></span> <span>{{ stats.topicCount }}</span><span style="font-size: .5em; line-height: 1em">/ {{ stats.postCount }}</span></div>
</div>
</div>
<div class="frontNews">
{% for newsPost in newsPosts %}
@ -13,18 +24,5 @@
</div>
<div class="clear"></div>
<!--<script type="text/javascript" src="{{ sakura.resources }}/js/ybabstat.js"></script>-->
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'flashii';
/* * * DO NOT EDIT BELOW THIS LINE * * */
(function () {
var s = document.createElement('script');
s.async = true;
s.type = 'text/javascript';
s.src = '//' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
</div>
{% include 'global/footer.tpl' %}

View file

@ -23,9 +23,9 @@
{% endif %}
{% endif %}
<div class="head">Stats</div>
We have <b>{{ stats.userCount }}</b>,
<b><a href="/u/{{ stats.newestUser.id }}" class="default">{{ stats.newestUser.username }}</a></b> is the newest user,
it has been <b>{{ stats.lastRegDate }}</b> since the last user registered and the forum has <b>{{ stats.topicCount }}</b> and <b>{{ stats.postCount }}</b>.
We have <b>{{ stats.userCount }} user{% if stats.userCount != 1 %}s{% endif %}</b>,
<b><a href="/u/{{ stats.newestUser.data.id }}" class="default">{{ stats.newestUser.data.username }}</a></b> is the newest user,
it has been <b>{{ stats.lastRegDate }}</b> since the last user registered and the forum has <b>{{ stats.topicCount }} thread{% if stats.topicCount != 1 %}s{% endif %}</b> and <b>{{ stats.postCount }} post{% if stats.postCount != 1 %}s{% endif %}</b>.
<div class="head">Online Users</div>
{% if stats.onlineUsers %}
All active users in the past 5 minutes:<br />

View file

@ -11,7 +11,7 @@
</ul>
</div>
{% else %}
<div class="content profile">
<div class="content profile">
<div class="{% if profile.userPage|length > 1 %}content-right {% endif %}content-column">
<div style="text-align: center;">
<img src="/a/{{ profile.data.id }}" alt="{{ profile.data.username }}'s Avatar" class="default-avatar-setting" style="box-shadow: 0 3px 7px #{% if profile.checkOnline %}484{% else %}844{% endif %};" /><br />
@ -85,7 +85,7 @@
<h2 style="color: #A00; text-shadow: 0 0 7px #A00; margin-top: 0;">Bad</h2>
<span style="font-size: 10px; line-height: 10px;">This user has <b>{{ profile.getWarnings|length }} warning{% if profile.getWarnings|length != 1 %}s{% endif %}</b>.<br />After 5 to 10 warnings (depending on what they are for) this user may be permanently banned.</span>
{% else %}
<h2 style="color: #0A0; text-shadow: 0 0 7px #0A0; margin-top: 0;">Good</h2>
<h2 style="color: #080; text-shadow: 0 0 7px #080; margin-top: 0;">Good</h2>
{% endif %}
{% endif %}
</div>

View file

@ -1,46 +1,64 @@
{% if profile.fields %}
<form enctype="multipart/form-data" method="post" action="{{ sakura.currentPage }}" id="editProfileForm">
<input type="hidden" name="sessid" value="{{ php.sessionid }}" />
<input type="hidden" name="timestamp" value="{{ php.time }}" />
<input type="hidden" name="mode" value="profile" />
{% for field in profile.fields %}
<div class="profile-field">
<div>
<h2>{{ field.name }}</h2>
</div>
<div>
<input type="{{ field.formtype }}" name="profile_{{ field.ident }}" class="inputStyling" placeholder="{{ field.description }}"{% if profile.user[field.ident].value %}{% if field.formtype == 'checkbox' and profile.user[field.ident].value == 'true' %} checked="checked"{% else %} value="{{ profile.user[field.ident].value }}"{% endif %}{% endif %} />
</div>
{% if field.addit %}
{% for id,addit in field.addit %}
<div>
<input type="{{ addit[0] }}" id="{{ id }}" name="profile_additional_{{ id }}"{% if profile.user[field.ident][id] %}{% if addit[0] == 'checkbox' and profile.user[field.ident][id] == 'true' %} checked="checked"{% else %} value="{{ profile.user[field.ident][id] }}"{% endif %}{% endif %} />
<label for="{{ id }}" style="font-size: 10px;">{{ addit[1]|raw }}</label>
</div>
{% endfor %}
{% endif %}
<form enctype="multipart/form-data" method="post" action="{{ sakura.currentPage }}" id="editProfileForm">
<input type="hidden" name="sessid" value="{{ php.sessionid }}" />
<input type="hidden" name="timestamp" value="{{ php.time }}" />
<input type="hidden" name="mode" value="profile" />
{% for field in profile.fields %}
<div class="profile-field">
<div>
<h2>{{ field.name }}</h2>
</div>
{% endfor %}
<div class="profile-save">
<input type="submit" value="Save" name="submit" class="inputStyling" />
<input type="reset" value="Reset" name="reset" class="inputStyling" />
<div>
<input type="{{ field.formtype }}" name="profile_{{ field.ident }}" class="inputStyling" placeholder="{{ field.description }}"{% if profile.user[field.ident].value %}{% if field.formtype == 'checkbox' and profile.user[field.ident].value == 'true' %} checked="checked"{% else %} value="{{ profile.user[field.ident].value }}"{% endif %}{% endif %} />
</div>
{% if field.addit %}
{% for id,addit in field.addit %}
<div>
<input type="{{ addit[0] }}" id="{{ id }}" name="profile_additional_{{ id }}"{% if profile.user[field.ident][id] %}{% if addit[0] == 'checkbox' and profile.user[field.ident][id] == 'true' %} checked="checked"{% else %} value="{{ profile.user[field.ident][id] }}"{% endif %}{% endif %} />
<label for="{{ id }}" style="font-size: 10px;">{{ addit[1]|raw }}</label>
</div>
{% endfor %}
{% endif %}
</div>
</form>
<script type="text/javascript">
window.addEventListener("load", function() {
var editProfileForm = document.getElementById('editProfileForm');
var createInput = document.createElement('input');
var submit = editProfileForm.querySelector('[type="submit"]');
{% endfor %}
<div class="profile-field birthday">
<div>
<h2>Birthday</h2>
</div>
<div style="text-align: center;">
Day: <select name="birthday_day">
{% for i in 1..31 %}
<option value="{{ i }}">{{ i }}</option>
{% endfor %}
</select>
Month: <select name="birthday_month">
{% for i in 1..12 %}
<option value="{{ i }}">{{ i }}</option>
{% endfor %}
</select>
Year: <select name="birthday_year">
{% for i in "now"|date('Y')..("now"|date('Y') - 100) %}
<option value="{{ i }}">{{ i }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="profile-save">
<input type="submit" value="Save" name="submit" class="inputStyling" />
<input type="reset" value="Reset" name="reset" class="inputStyling" />
</div>
</form>
<script type="text/javascript">
window.addEventListener("load", function() {
var editProfileForm = document.getElementById('editProfileForm');
var createInput = document.createElement('input');
var submit = editProfileForm.querySelector('[type="submit"]');
createInput.setAttribute('name', 'ajax');
createInput.setAttribute('value', 'true');
createInput.setAttribute('type', 'hidden');
editProfileForm.appendChild(createInput);
createInput.setAttribute('name', 'ajax');
createInput.setAttribute('value', 'true');
createInput.setAttribute('type', 'hidden');
editProfileForm.appendChild(createInput);
submit.setAttribute('type', 'button');
submit.setAttribute('onclick', 'submitPost(\''+ editProfileForm.action +'\', formToObject(\'editProfileForm\'), true, \'Updating Profile...\');');
});
</script>
{% else %}
<h1 class="stylised" style="margin: 2em auto; text-align: center;">There are no changeable profile fields.</h1>
{% endif %}
submit.setAttribute('type', 'button');
submit.setAttribute('onclick', 'submitPost(\''+ editProfileForm.action +'\', formToObject(\'editProfileForm\'), true, \'Updating Profile...\');');
});
</script>

View file

@ -60,11 +60,11 @@ h6 {
h1.sectionHead {
font-style: italic;
font-size: 72px;
font-size: 5em;
color: rgb(148, 117, 178);
opacity: 0.5;
font-weight: 100;
line-height: 90px;
line-height: 1.2em;
margin: 10px 20px;
}
@ -140,9 +140,10 @@ a:active {
* Site footer
*/
#footer {
height: 100px;
height: 70px;
width: 100%;
background: linear-gradient(0deg, rgba(0, 0, 0, .4), rgba(0, 0, 0, 0)) transparent;
background: linear-gradient(0deg, rgba(0, 0, 0, .6) 70%, rgba(0, 0, 0, .7) 80%, rgba(0, 0, 0, .4) 80%, rgba(0, 0, 0, 0) 90%) transparent;
padding-top: 20px;
position: absolute;
bottom: 0;
font-family: "Exo2-0-LightItalic", sans-serif;
@ -151,29 +152,32 @@ a:active {
#footer > .inner {
max-width: 1024px;
margin: 0 auto;
display: flex;
align-items: center;
justify-content: space-between;
}
#footer > .inner > .ft-logo {
background: url('../images/image-logo.svg') no-repeat scroll center center / cover;
height: 100px;
width: 100px;
float: left;
background: url('../images/image-logo-white.svg') no-repeat scroll center center / cover;
height: 66px;
width: 66px;
opacity: .5;
}
#footer > .inner > .ft-text {
margin-left: 10px;
margin-top: 2.6em;
float: left;
text-align: right;
}
/*
* Site header
*/
#header {
height: 164px;
height: 120px;
max-width: 1024px;
margin: 0 auto;
display: flex;
justify-content: space-between;
}
#header > * {
@ -182,39 +186,23 @@ a:active {
#header .logo {
background: url('../images/image-logo.svg') no-repeat scroll center center / cover;
height: 200px;
width: 200px;
position: relative;
bottom: -49px;
left: -18px;
z-index: 1;
}
#header .text {
background: url('../images/text-logo.svg') no-repeat scroll center center / cover;
height: 100px;
width: 460px;
position: relative;
left: -158px;
top: -69px;
}
#header .image {
background: url('../images/right-header.png') no-repeat scroll center center / cover;
height: 164px;
width: 200px;
position: relative;
height: 120px;
width: 120px;
flex-grow: 1;
margin: auto;
}
#header .social {
position: relative;
left: -200px;
z-index: 1;
font-size: 2em;
font-size: 2.5em;
background: rgba(0, 0, 0, .4);
float: right;
padding: 3px;
border-radius: 0 0 5px 5px;
padding: 6px;
margin: 1em .5em;
position: relative;
bottom: -4px;
height: 40px;
border-radius: 5px;
text-align: center;
}
#header .social > ul {
@ -224,6 +212,7 @@ a:active {
#header .social > ul > li {
float: left;
margin: 5px;
width: 30px;
}
#header .social > ul > li > a {
@ -247,7 +236,7 @@ a:active {
* Wrapper
*/
#wrapper {
padding-bottom: 130px;
padding-bottom: 100px;
}
#wrapper > #content {
@ -406,7 +395,6 @@ a:active {
.profile > .profileHeader {
height: 250px;
color: #8364a1;
float: left;
width: 100%;
}
@ -606,6 +594,27 @@ a:active {
/*
* Homepage
*/
.homepage .frontStats {
margin: 1em 0;
width: 100%;
display: flex;
justify-content: space-around;
align-items: stretch;
flex-wrap: wrap;
font: 2.5em/1em "Exo2-0-LightItalic", sans-serif;
text-shadow: 1px 1px 2px rgba(0, 0, 0, .75);
}
.homepage .frontStats > div {
background: rgba(148, 117, 178, .2);
box-shadow: 0 2px 6px rgba(0, 0, 0, .75);
margin: 5px;
}
.homepage .frontStats > div > div {
padding: 10px 14px;
display: block;
}
/*
* News

View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="1024px" height="1024px" viewBox="0 0 1024 1024" enable-background="new 0 0 1024 1024" xml:space="preserve">
<rect x="168.535" y="137.543" transform="matrix(0.9684 0.2495 -0.2495 0.9684 76.1586 -39.9684)" fill="#FFFFFF" width="54.358" height="285.682"/>
<rect x="225.326" y="276.285" transform="matrix(0.9684 0.2495 -0.2495 0.9684 112.5768 -49.7509)" fill="#FFFFFF" width="54.358" height="285.682"/>
<rect x="300.387" y="348.858" transform="matrix(0.9684 0.2495 -0.2495 0.9684 133.0613 -66.1858)" fill="#FFFFFF" width="54.358" height="285.682"/>
<rect x="384.274" y="389.694" transform="matrix(0.9684 0.2495 -0.2495 0.9684 145.9053 -85.827)" fill="#FFFFFF" width="54.358" height="285.682"/>
<rect x="479.629" y="389.694" transform="matrix(0.9684 0.2495 -0.2495 0.9684 148.9219 -109.6219)" fill="#FFFFFF" width="54.358" height="285.682"/>
<rect x="577.756" y="375.747" transform="matrix(0.9684 0.2495 -0.2495 0.9684 148.5475 -134.5507)" fill="#FFFFFF" width="54.357" height="285.683"/>
<rect x="666.446" y="398.09" transform="matrix(0.9684 0.2495 -0.2495 0.9684 156.9289 -155.9756)" fill="#FFFFFF" width="54.357" height="285.683"/>
<rect x="741.108" y="469.576" transform="matrix(0.9684 0.2495 -0.2495 0.9684 177.1295 -172.3455)" fill="#FFFFFF" width="54.357" height="285.683"/>
<rect x="803.295" y="598.097" transform="matrix(0.9684 0.2495 -0.2495 0.9684 211.1683 -183.798)" fill="#FFFFFF" width="54.357" height="285.683"/>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 504 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View file

@ -27,12 +27,12 @@ $renderData['board'] = [
];
$renderData['stats'] = [
'userCount' => ($_INDEX_USER_COUNT = count($_INDEX_USERS = Users::getAllUsers(false))) .' user'. ($_INDEX_USER_COUNT == 1 ? '' : 's'),
'newestUser' => ($_INDEX_NEWEST_USER = empty($_INDEX_USERS) ? (new User(0))->data : max($_INDEX_USERS)),
'lastRegDate' => ($_INDEX_LAST_REGDATE = date_diff(date_create(date('Y-m-d', $_INDEX_NEWEST_USER['regdate'])), date_create(date('Y-m-d')))->format('%a')) .' day'. ($_INDEX_LAST_REGDATE == 1 ? '' : 's'),
'userCount' => ($_INDEX_USER_COUNT = count($_INDEX_USERS = Users::getAllUsers(false))),
'newestUser' => ($_INDEX_NEWEST_USER = new User(Users::getNewestUserId())),
'lastRegDate' => ($_INDEX_LAST_REGDATE = date_diff(date_create(date('Y-m-d', $_INDEX_NEWEST_USER->data['regdate'])), date_create(date('Y-m-d')))->format('%a')) .' day'. ($_INDEX_LAST_REGDATE == 1 ? '' : 's'),
'onlineUsers' => Users::checkAllOnline(),
'topicCount' => ($_TOPICS = count(Database::fetch('topics'))) .' topic'. ($_TOPICS != 1 ? 's' : ''),
'postCount' => ($_POSTS = count(Database::fetch('posts'))) .' post'. ($_POSTS != 1 ? 's' : '')
'topicCount' => ($_TOPICS = count(Database::fetch('topics'))),
'postCount' => ($_POSTS = count(Database::fetch('posts')))
];
// Print page contents

View file

@ -26,4 +26,4 @@ $renderData['page']['title'] = (
);
// Print page contents
print Templates::render('main/profile.tpl', $renderData);
print Templates::render('profile/index.tpl', $renderData);