Add changelog

This commit is contained in:
flash 2015-04-26 16:01:28 +00:00
parent 60ceddc40b
commit ddb5d055cb
6 changed files with 879 additions and 8 deletions

618
_sakura/changelog.json Normal file
View file

@ -0,0 +1,618 @@
{
"versions": {
"Cyan": {
"colour": "#4EC9B0",
"builds": [
"20150221",
"20150222",
"20150308",
"20150321",
"20150322",
"20150329",
"20150330",
"20150401",
"20150402",
"20150405",
"20150406",
"20150407",
"20150408",
"20150412",
"20150413",
"20150414",
"20150417",
"20150418",
"20150419",
"20150420",
"20150421",
"20150424",
"20150425",
"20150426"
]
}
},
"changelog": {
"20150221": [
{
"type": "ADD",
"change": "Start work on new Flashii backend."
},
{
"type": "ADD",
"change": "Display version in the footer."
}
],
"20150222": [
{
"type": "ADD",
"change": "Upload assets."
}
],
"20150308": [
{
"type": "ADD",
"change": "Dynamic SQL database library."
},
{
"type": "UPD",
"change": "Add ROOT_DIRECTORY constant."
},
{
"type": "UPD",
"change": "Slight changes to the templating system."
},
{
"type": "ADD",
"change": "Add Configuration class for better configuration management."
},
{
"type": "FIX",
"change": "Replace broken template tags."
},
{
"type": "FIX",
"change": "Replace broken template tags."
},
{
"type": "ADD",
"change": "Upload remaining assets."
},
{
"type": "REM",
"change": "Remove per-file twig initialisation."
},
{
"type": "ADD",
"change": "Start work on expanding the templates."
},
{
"type": "ADD",
"change": "Add 404 page."
},
{
"type": "ADD",
"change": "Add SQL to the repository."
}
],
"20150321": [
{
"type": "UPD",
"change": "Change entire system to static classes."
},
{
"type": "ADD",
"change": "ReCAPTCHA verification function."
},
{
"type": "UPD",
"change": "Add more features to SQL library."
}
],
"20150322": [
{
"type": "ADD",
"change": "Add sessions class."
},
{
"type": "UPD",
"change": "Change namespace to Sakura."
}
],
"20150329": [
{
"type": "ADD",
"change": "Add files for sys.flashii.net."
},
{
"type": "REM",
"change": "Deprecate sys.flashii.net."
},
{
"type": "UPD",
"change": "Update SQL library."
},
{
"type": "ADD",
"change": "Begin work on user system."
},
{
"type": "FIX",
"change": "Login forms not showing when user is logged out."
},
{
"type": "FIX",
"change": "More JavaScript fixes."
},
{
"type": "ADD",
"change": "Add login form below the header."
},
{
"type": "ADD",
"change": "Add common PHP function template tags."
},
{
"type": "ADD",
"change": "Add remember me checkbox."
},
{
"type": "ADD",
"change": "Add function to get a user's database row."
},
{
"type": "ADD",
"change": "Add news post template."
},
{
"type": "ADD",
"change": "Add function to get a group's database row."
},
{
"type": "ADD",
"change": "Add function to get a certain amount of news posts."
},
{
"type": "ADD",
"change": "Add avatar and background serving PHP script."
},
{
"type": "FIX",
"change": "Fix a define collision."
}
],
"20150330": [
{
"type": "ADD",
"change": "Add chat directory."
},
{
"type": "FIX",
"change": "Make getting news posts less heavy on the SQL server."
},
{
"type": "ADD",
"change": "Add descriptive files."
}
],
"20150401": [
{
"type": "ADD",
"change": "Add more function descriptions."
},
{
"type": "ADD",
"change": "Add template configuration parsing function."
},
{
"type": "ADD",
"change": "Add template engine wrapper class."
},
{
"type": "ADD",
"change": "Add GZIP compression."
},
{
"type": "ADD",
"change": "Add .git* files and a license."
},
{
"type": "ADD",
"change": "Add error logging."
},
{
"type": "REM",
"change": "Remove GZIP compression (for now) relating to issues with the error handler."
},
{
"type": "UPD",
"change": "Rename ROOT_DIRECTORY to ROOT."
},
{
"type": "REM",
"change": "Remove affiliates section from the footer."
},
{
"type": "ADD",
"change": "Add credits page."
},
{
"type": "ADD",
"change": "Add infopage system (/r/page)."
},
{
"type": "UPD",
"change": "Update SQL structure file."
},
{
"type": "FIX",
"change": "Make markdown parsing function public."
}
],
"20150402": [
{
"type": "ADD",
"change": "Add hardcoded dummy group and user."
},
{
"type": "FIX",
"change": "Make the markdown parsing function actually have access to the class."
},
{
"type": "ADD",
"change": "Add news page."
},
{
"type": "FIX",
"change": "Make frontpage stats actually work."
},
{
"type": "ADD",
"change": "Add news XML feed."
}
],
"20150405": [
{
"type": "ADD",
"change": "Add example config."
},
{
"type": "UPD",
"change": "Improve news functions."
},
{
"type": "UPD",
"change": "Update SQL structure."
}
],
"20150406": [
{
"type": "UPD",
"change": "Open source'd and repository now hosted on GitHub."
},
{
"type": "REM",
"change": "Remove static locations."
},
{
"type": "UPD",
"change": "Update SQL structure and mistake in .htaccess."
},
{
"type": "ADD",
"change": "Add session system."
},
{
"type": "ADD",
"change": "Begin work on authentication."
},
{
"type": "UPD",
"change": "Improve template engine wrapper."
}
],
"20150407": [
{
"type": "UPD",
"change": "Replace tabs with 4 spaces."
}
],
"20150408": [
{
"type": "UPD",
"change": "More work on the authentication pages."
},
{
"type": "ADD",
"change": "Add login function."
}
],
"20150412": [
{
"type": "FIX",
"change": "Fix massive mistake causing all hashes to break."
},
{
"type": "ADD",
"change": "Add a function to get users by the IP assigned to their user."
},
{
"type": "UPD",
"change": "Reindex assets."
}
],
"20150413": [
{
"type": "UPD",
"change": "Update SQL structure."
},
{
"type": "ADD",
"change": "Add logout function."
},
{
"type": "REM",
"change": "Remove static locations from CSS files."
}
],
"20150414": [
{
"type": "ADD",
"change": "Add PayPal SDK."
},
{
"type": "ADD",
"change": "Add function if the e-mail address used has a valid MX-Record."
},
{
"type": "ADD",
"change": "Add some IP functions."
},
{
"type": "ADD",
"change": "Add checking if an IP originates from CloudFlare and then replace the IP with the proper one set in the header."
}
],
"20150417": [
{
"type": "UPD",
"change": "Logging in works!"
},
{
"type": "ADD",
"change": "Add proper session management."
},
{
"type": "ADD",
"change": "Add delete function to SQL library."
}
],
"20150418": [
{
"type": "UPD",
"change": "Logging out works."
},
{
"type": "ADD",
"change": "Add Sock Chat authentication file."
},
{
"type": "ADD",
"change": "Add e-mail function."
},
{
"type": "ADD",
"change": "Add function to get country code from CloudFlare header."
},
{
"type": "ADD",
"change": "Add whois class."
},
{
"type": "ADD",
"change": "Add HTML e-mail template."
},
{
"type": "ADD",
"change": "Begin work on registration function."
}
],
"20150419": [
{
"type": "ADD",
"change": "Add automatic user activation."
},
{
"type": "UPD",
"change": "Completely user registration function."
}
],
"20150420": [
{
"type": "ADD",
"change": "Add AJAX form submission."
},
{
"type": "FIX",
"change": "Fix bug in registration process causing username cleaning to fail."
}
],
"20150421": [
{
"type": "ADD",
"change": "Add e-mail sanitising to registration process."
},
{
"type": "ADD",
"change": "Add automatic activation e-mail resend function."
},
{
"type": "REM",
"change": "Remove PayPal API since we don't need it for what we do."
},
{
"type": "ADD",
"change": "Add password forget template."
}
],
"20150424": [
{
"type": "UPD",
"change": "Update .gitignore."
},
{
"type": "ADD",
"change": "Add password entropy function."
},
{
"type": "UPD",
"change": "Update links in the footer."
},
{
"type": "FIX",
"change": "Make header login form properly responsive."
},
{
"type": "FIX",
"change": "Display PDO errors."
},
{
"type": "ADD",
"change": "Add authentication locking option."
},
{
"type": "REM",
"change": "Remove method of determining password strength based on length (aaaaaaaaaaaaaaaaaaaaaaaaaaaa ain't strong just because it's long)."
},
{
"type": "FIX",
"change": "Make logged in users unable to view the authentication page."
}
],
"20150425": [
{
"type": "ADD",
"change": "Add custom user colours."
},
{
"type": "ADD",
"change": "Make users with the legacy algorhythm force-change their password."
},
{
"type": "ADD",
"change": "Add password resetting functions."
},
{
"type": "ADD",
"change": "Tell users to enable JavaScript."
},
{
"type": "REM",
"change": "Remove development tools from the repository."
},
{
"type": "FIX",
"change": "Fix the backend not expecting an empty users table."
}
],
"20150426": [
{
"type": "ADD",
"change": "Begin work on profile system."
},
{
"type": "FIX",
"change": "The system thinking 0 is the rank ID for deactivated while it's 1."
},
{
"type": "ADD",
"change": "Add some missing assets."
},
{
"type": "ADD",
"change": "Add changelog page."
}
]
}
}

View file

@ -8,7 +8,10 @@
namespace Sakura;
// Define Sakura version
define('SAKURA_VERSION', '20150424');
define('SAKURA_VERSION', '20150426');
define('SAKURA_VLABEL', 'Cyan');
define('SAKURA_VTYPE', 'Development');
define('SAKURA_COLOUR', '#4EC9B0');
// Define Sakura Path
define('ROOT', str_replace(basename(__DIR__), '', dirname(__FILE__)));

View file

@ -0,0 +1,112 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Sakura Changelog</title>
<style type="text/css">
body {
background: #000;
color: #FFF;
font: 300 12px/20px "Segoe UI", sans-serif;
margin: 45px 30px;
padding: 0;
}
a {
color: inherit;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
h1, h3 {
font-weight: 100;
}
h1 {
font-size: 5em;
}
.changecont {
background: #FFF;
position: fixed;
bottom: 45px;
left: 30px;
right: 30px;
top: 130px;
border: 1px solid #333;
background: #111;
overflow: auto;
}
.footer {
position: fixed;
bottom: 25px;
left: 30px;
right: 30px;
text-align: center;
}
.release > div > span.tag {
display: inline-block;
min-width: 100px;
text-align: center;
background: #222;
font-weight: 500;
letter-spacing: 2px;
border-right: 1px solid #222;
box-shadow: inset 0 0 .5em rgba(255, 255, 255, .4);
}
.release > div > span.addition-tag {
background: #2A2;
}
.release > div > span.removal-tag {
background: #A22;
}
.release > div > span.fixed-tag {
background: #2AA;
}
.release > div > span.update-tag {
background: #2AA;
}
.release > div > span.changedesc {
padding: 0 5px;
}
.release > div {
border-bottom: 1px #222 solid;
}
.release > div:first-child,
.release:last-child > div:last-child {
border-bottom: 0;
}
.release > .title {
font-size: 1.5em;
line-height: 1.5em;
background: #222;
box-shadow: inset 0 0 .5em #444;
padding: 0 5px 2px;
display: block;
}
.release:not(:first-child) {
margin-top: 5px;
}
</style>
</head>
<body>
<h1 style="color: {{ colour }};">Sakura {{ version_label }}</h1>
<h3>Installed version: {{ version }} ({{ version_type }})</h3>
<div class="changecont">
{{ changeloghtml }}
</div>
<div class="footer">
<a href="http://flash.moe">Flashwave</a> /
<a href="http://sakura.flashii.net">Sakura</a> /
<a href="http://github.com/flashii/Sakura">GitHub</a>
</div>
</body>
</html>

View file

@ -1,3 +1,34 @@
{% include 'global/header.tpl' %}
{% if profile.notset or profile.user.id == 0 %}
<div class="content standalone" style="padding: 20px;">
<h1>The requested user does not exist!</h1>
There are a few possible reasons for this:
<ul style="padding-left: 40px;">
<li>They changed their username.</li>
<li>They may have been abyss'd.</li>
<li>You made a typo.</li>
<li>They never existed.</li>
</ul>
</div>
{% else %}
<div class="content profile">
<div class="{% if profile.profpage|length > 1 %}content-right {% endif %}content-column">
<div style="text-align: center;">
<img src="/a/{{ profile.user.id }}" alt="{{ profile.user.username }}'s Avatar" class="default-avatar-setting" />
<br /><span style="font-size: .8em;">{{ profile.user.usertitle }}</span>
<h1 style="color: {{ profile.colour }}; text-shadow: 0 0 7px #888; padding: 0 0 10px;">{{ profile.user.username }}</h1>
<hr class="default" />
<b>Joined</b> {{ profile.user.regdate|date("l Y-m-d H:i") }}<br />
<b>Last Seen on</b> {{ profile.user.lastdate|date("l Y-m-d H:i") }}
<hr class="default" />
<b>Account Standing</b>
<h2 style="color: green; text-shadow: 0 0 7px #888; margin-top: 0;">Good</h2>
</div>
</div>
<div class="content-left content-column markdown{% if profile.profpage|length < 1 %} hidden{% endif %}">
{{ profile.profpage|raw }}
</div>
<div class="clear"></div>
</div>
{% endif %}
{% include 'global/footer.tpl' %}

113
main/changelog.php Normal file
View file

@ -0,0 +1,113 @@
<?php
/*
* Sakura Main Index
*/
// Declare Namespace
namespace Sakura;
// Include components
require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) .'_sakura/sakura.php';
// Path the changelog JSON
$changelogFile = json_decode(file_get_contents(ROOT .'_sakura/changelog.json'), true);
$changelog = array();
// Create version categories
foreach($changelogFile['versions'] as $name => $data) {
// Reverse the array
$data['builds'] = array_reverse($data['builds'], true);
foreach($data['builds'] as $build) {
$changelog[$build]['name'] = $name;
$changelog[$build]['colour'] = $data['colour'];
$changelog[$build]['changes'] = array();
}
}
// Sort changes properly
foreach($changelogFile['changelog'] as $ver => $data) {
// Reverse the array
$data = array_reverse($data, true);
// Add the log to the array
foreach($data as $id => $change)
$changelog[$ver]['changes'][$id] = $change;
}
// Add a thing to only get the json
if(isset($_REQUEST['getjson'])) {
// Print encoded json and exit
print json_encode($changelog);
exit;
}
// Create variable to store HTML in
$changelogHTML = null;
// Format HTML
foreach($changelog as $build => $buildData) {
$changelogHTML .= '<div class="release" id="b'. $build .'">';
$changelogHTML .= '<a href="#b'. $build .'" class="title" style="color: '. $buildData['colour'] .';">Build '. $build .' ('. $buildData['name'] .')</a>';
foreach($buildData['changes'] as $id => $changeData) {
$changelogHTML .= '<div id="b'. $build .'c'. $id .'">';
switch($changeData['type']) {
case 'ADD':
$changelogHTML .= '<span class="tag addition-tag">Added</span>';
break;
case 'REM':
$changelogHTML .= '<span class="tag removal-tag">Removed</span>';
break;
case 'FIX':
$changelogHTML .= '<span class="tag fixed-tag">Fixed</span>';
break;
case 'UPD':
$changelogHTML .= '<span class="tag update-tag">Updated</span>';
break;
default:
$changelogHTML .= '<span class="tag">Unknown</span>';
}
$changelogHTML .= '<span class="changedesc">';
$changelogHTML .= $changeData['change'];
$changelogHTML .= '</span>';
$changelogHTML .= '</div>';
}
$changelogHTML .= '</div>';
}
// Get special template file
$tpl = file_get_contents(ROOT .'_sakura/templates/versionInfo.tpl');
// Parse tags
$tpl = str_replace('{{ version }}', SAKURA_VERSION, $tpl);
$tpl = str_replace('{{ version_label }}', SAKURA_VLABEL, $tpl);
$tpl = str_replace('{{ version_type }}', SAKURA_VTYPE, $tpl);
$tpl = str_replace('{{ colour }}', SAKURA_COLOUR, $tpl);
$tpl = str_replace('{{ changeloghtml }}', $changelogHTML, $tpl);
// Print template
print $tpl;

View file

@ -1,6 +0,0 @@
===
todo list
===
> Fix footer resizing because of the removal of the Affiliates section
> Use CloudFlare to get a user's country for their profile