This commit is contained in:
flash 2015-07-30 19:07:23 +02:00
parent ef21a94914
commit d059fcb90b
17 changed files with 88 additions and 27 deletions

View file

@ -35,7 +35,8 @@
"20150706",
"20150707",
"20150725",
"20150728"
"20150728",
"20150730"
]
@ -1535,6 +1536,35 @@
"change": "(Temporarily) removed chat online user count."
}
],
"20150730": [
{
"type": "FIX",
"change": "Use the same date() formatting everywhere."
},
{
"type": "ADD",
"change": "Added user banning backend."
},
{
"type": "FIX",
"change": "Replaced money_format function with number_format due to incompatibility with certain platforms."
},
{
"type": "FIX",
"change": "Fixed calculation of remaining premium tag."
},
{
"type": "FIX",
"change": "Fixed &expire=<timestamp> still being in the url when purchasing premium."
},
{
"type": "FIX",
"change": "Fixed background colours on the search page looking slightly mentally challenged."
}
]
}

View file

@ -10,16 +10,40 @@ class Bans {
// Check if a user is banned
public static function checkBan($id) {
if($id == 1) {
// Attempt to get a ban from this user
$bans = Database::fetch('bans', true, ['uid' => [$id, '=']]);
// Reverse the array so new bans are listed first
$bans = array_reverse($bans);
// Go over each ban
foreach($bans as $ban) {
// Check if it hasn't expired
if($ban['ban_end'] != 0 && $ban['ban_end'] < time()) {
// If it has delete the entry and continue
Database::delete('bans', ['id' => [$ban['id'], '=']]);
continue;
}
// Return the ban if all checks were passed
return [
'user' => 1,
'issuer' => 2,
'issued' => 246,
'expires' => time(),
'reason' => 'meow'
'user' => $ban['uid'],
'issuer' => $ban['mod_id'],
'issued' => $ban['ban_begin'],
'expires' => $ban['ban_end'],
'reason' => $ban['ban_reason']
];
}
// Else just return false
return false;
}
}

View file

@ -8,7 +8,7 @@
namespace Sakura;
// Define Sakura version
define('SAKURA_VERSION', '20150728');
define('SAKURA_VERSION', '20150730');
define('SAKURA_VLABEL', 'Eminence');
define('SAKURA_STABLE', false);
define('SAKURA_COLOUR', '#6C3082');
@ -136,7 +136,7 @@ if(!defined('SAKURA_NO_TPL')) {
]
]);
//Users::logout();
Users::logout();
print Templates::render('errors/banned.tpl', $renderData);
exit;

View file

@ -12,5 +12,5 @@
</div>
<div class="clear"></div>
<div class="news-post-time">
Posted on {{ newsPost.date|date("D Y-m-d H:i:s T") }}{% if newsPosts|length > 1 %} <a class="default" href="/news/{{ newsPost.id }}#disqus_thread">View comments</a>{% endif %}
Posted on {{ newsPost.date|date(sakura.date_format) }}{% if newsPosts|length > 1 %} <a class="default" href="/news/{{ newsPost.id }}#disqus_thread">View comments</a>{% endif %}
</div>

View file

@ -3,15 +3,19 @@
<div class="content-column news banned">
<div style="padding: 20px;">
<h1>You are banned!</h1>
{% if ban.reason %}
<h3>The following reason was supplied:</h3>
<p>
{{ ban.reason }}
{{ ban.reason|raw }}
</p>
{% else %}
<h3>No reason was supplied.</h3>
{% endif %}
<br />
<h2>Additional information</h2>
<ul style="margin-left: 30px;">
<li>You were banned on {{ ban.issued|date(sakura.date_format) }}.</li>
<li>{% if ban.expires %}This ban expires on {{ ban.expire|date(sakura.date_format) }}.{% else %}<b>You are permanently banned.</b>{% endif %}</li>
<li>{% if ban.expires %}This ban expires on {{ ban.expires|date(sakura.date_format) }}.{% else %}<b>You are permanently banned.</b>{% endif %}</li>
{% if ban.expires %}
<li>You were banned by <a href="/u/{{ ban.issuer.id }}" class="default">{{ ban.issuer.username }}</a>.</li>
{% endif %}

View file

@ -2,6 +2,6 @@
<div class="content standalone" style="text-align: center;">
<h1 class="stylised" style="margin: 1em auto;">Thank you for your contribution!</h1>
<h1 class="fa fa-heart stylised" style="font-size: 20em;"></h1>
<h3>Your Tenshi will expire on {{ page.expiration|date("l \\t\\h\\e jS \\o\\f F o") }}.</h3>
<h3>Your Tenshi will expire on {{ page.expiration|date(sakura.date_format) }}.</h3>
</div>
{% include 'global/footer.tpl' %}

View file

@ -22,6 +22,6 @@
{% else %}
[deleted user]
{% endif %} <a href="/forum/post/{{ topic.last_poster.post.post_id }}#p{{ topic.last_poster.post.post_id }}" class="default fa fa-tag"></a><br />
<span title="{{ topic.last_poster.post.post_time|date("r") }}">{{ topic.last_poster.elap }}</span>
<span title="{{ topic.last_poster.post.post_time|date(sakura.date_format) }}">{{ topic.last_poster.elap }}</span>
</td>
</tr>

View file

@ -35,7 +35,7 @@
<a href="#p{{ post.post_id }}" class="clean">{{ post.post_subject }}</a>
</div>
<div class="date">
<a href="/forum/post/{{ post.post_id }}#p{{ post.post_id }}" class="clean" title="{{ post.post_time|date("r") }}">{{ post.time_elapsed }}</a>
<a href="/forum/post/{{ post.post_id }}#p{{ post.post_id }}" class="clean" title="{{ post.post_time|date(sakura.date_format) }}">{{ post.time_elapsed }}</a>
</div>
<div class="clear"></div>
</div>

View file

@ -1,7 +1,7 @@
{% include 'global/header.tpl' %}
<div class="content standalone markdown">
<h1>Credits</h1>
<p>This is the Flashii Sakura contributor list.</p>
<p>This is the Sakura contributor list.</p>
<h3>People</h3>
<table>
<thead>

View file

@ -54,10 +54,10 @@
<a href="/u/{{ user.id }}" class="default" style="font-weight: bold; color: {{ page.ranks[user.rank_main].colour }};">{{ user.username }}</a>
</td>
<td>
{{ user.regdate|date("l Y-m-d H:i T") }}
{{ user.regdate|date(sakura.date_format) }}
</td>
<td>
{% if user.lastdate == 0 %}<i>Never logged in.</i>{% else %}{{ user.lastdate|date("l Y-m-d H:i T") }}{% endif %}
{% if user.lastdate == 0 %}<i>Never logged in.</i>{% else %}{{ user.lastdate|date(sakura.date_format) }}{% endif %}
</td>
<td>
{% if not user.usertitle %}<i>{{ page.ranks[user.rank_main].title }}</i>{% else %}{{ user.usertitle }}{% endif %}

View file

@ -21,7 +21,7 @@
<tr>
<td><a href="//{{ sakura.urls.main }}/u/{{ message.data.from.user.id }}" class="default" style="font-weight: 700; color: {% if message.data.from.user.name_colour == null %}{{ message.data.from.rank.colour }}{% else %}{{ message.data.from.user.name_colour }}{% endif %};">{{ message.data.from.user.username }}</a></td>
<td><a href="//{{ sakura.urls.main }}/messages/read/{{ message.id }}" class="default">{{ message.subject }}</a></td>
<td>{{ message.time|date("l Y-m-d H:i T") }}</td>
<td>{{ message.time|date(sakura.date_format) }}</td>
</tr>
{% endfor %}
</tbody>

View file

@ -32,11 +32,11 @@
</div>
{% endif %}
<hr class="default" />
<b>Joined</b> {{ profile.user.regdate|date("l Y-m-d H:i T") }}<br />
<b>Joined</b> {{ profile.user.regdate|date(sakura.date_format) }}<br />
{% if profile.user.lastdate == 0 %}
<b>{{ profile.user.username }} hasn't logged in yet.</b>
{% else %}
<b>Last Seen on</b> {{ profile.user.lastdate|date("l Y-m-d H:i T") }}
<b>Last Seen on</b> {{ profile.user.lastdate|date(sakura.date_format) }}
{% endif %}<br />
<b>{{ profile.user.username }} has {% if not profile.forum_stats.posts %}no{% else %}{{ profile.forum_stats.posts }}{% endif %} forum post{% if profile.forum_stats.posts != 1 %}s{% endif %}.</b>
{% if profile.fields is not null %}

View file

@ -1,5 +1,5 @@
{% include 'global/header.tpl' %}
<div class="content">
<div class="content" style="background: #FFF;">
<div class="content-column news">
<div class="head">Search</div>
<script>

View file

@ -15,8 +15,8 @@
Your current Tenshi tag
</div>
<div style="margin-bottom: 10px;">
<h3>{% if page.current[0] == 2 %}Your rank has persistent Tenshi.{% else %}Your Tenshi tag is valid till {{ page.current[2]|date("l \\t\\h\\e jS \\o\\f F o") }}.{% endif %}</h3>
<progress value="{{ page.current[0] == 2 ? 100 : page.current[1] / page.current[2] * 100 }}" max="100" style="width: 100%"></progress>
<h3>{% if page.current[0] == 2 %}Your rank has persistent Tenshi.{% else %}Your Tenshi tag is valid till {{ page.current[2]|date(sakura.date_format) }}.{% endif %}</h3>
<progress value="{{ page.current[0] == 2 ? 100 : (100 - (((php.time - page.current[1]) / (page.current[2] - page.current[1])) * 100)) }}" max="100" style="width: 100%"></progress>
</div>
{% endif %}
<div class="sectionHeader">

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -6,6 +6,9 @@
// Declare Namespace
namespace Sakura;
// We don't use twig here
define('SAKURA_NO_TPL', true);
// Include components
require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) .'_sakura/sakura.php';

View file

@ -49,7 +49,7 @@ if(isset($_REQUEST['mode']) && Users::checkLogin() && Permissions::check('SITE',
// Calculate the total
$total = (float)Configuration::getConfig('premium_price_per_month') * (int)$_POST['months'];
$total = money_format('%!i', $total);
$total = number_format($total, 2, '.', '');
// Generate item name
$itemName = 'Flashii Tenshi - '. (string)$_POST['months'] .' month'. ((int)$_POST['months'] == 1 ? '' : 's');
@ -92,7 +92,7 @@ if(isset($_REQUEST['mode']) && Users::checkLogin() && Permissions::check('SITE',
Users::updatePremiumMeta(Session::$userId);
// Redirect to the complete
header('Location: ?mode=complete&expire='. $expiration);
header('Location: ?mode=complete');
exit;
}
@ -128,7 +128,7 @@ $renderData['page'] = [
'title' => 'Support '. Configuration::getConfig('sitename'),
'fail' => isset($_GET['fail']),
'price' => Configuration::getConfig('premium_price_per_month'),
'current' => Users::checkUserPremium(Session::$userId),
'current' => ($currentPremium = Users::checkUserPremium(Session::$userId)),
'amount_max' => Configuration::getConfig('premium_amount_max')
];