20150427.5

This commit is contained in:
flash 2015-04-27 16:30:31 +00:00
parent b12c15749f
commit 70038cff73
6 changed files with 63 additions and 7 deletions

View file

@ -12,7 +12,8 @@
"20150427.1",
"20150427.2",
"20150427.3",
"20150427.4"
"20150427.4",
"20150427.5"
]
@ -736,6 +737,27 @@
"change": "Fixed profiles not showing profile data to logged in users."
}
],
"20150427.5": [
{
"type": "FIX",
"change": "Fixed Youtubetype 1 displaying the channel ID as the link title."
},
{
"type": "UPD",
"change": "Hide most of the profile if a user is deactivated."
},
{
"type": "ADD",
"change": "Add avatar replacement for deactivated users."
},
{
"type": "UPD",
"change": "Redid avatar serving script."
}
]
}

View file

@ -8,7 +8,7 @@
namespace Sakura;
// Define Sakura version
define('SAKURA_VERSION', '20150427.4');
define('SAKURA_VERSION', '20150427.5');
define('SAKURA_VLABEL', 'Heliotrope');
define('SAKURA_VTYPE', 'Development');
define('SAKURA_COLOUR', '#DF73FF');

View file

@ -17,10 +17,15 @@
<img src="/a/{{ profile.user.id }}" alt="{{ profile.user.username }}'s Avatar" class="default-avatar-setting" style="box-shadow: 0 3px 7px #{% if profile.online %}484{% else %}844{% endif %};" />
<br /><span style="font-size: .8em;">{{ profile.ranktitle }}</span>
<h1 style="color: {{ profile.colour }}; text-shadow: 0 0 7px #888; padding: 0 0 2px;">{{ profile.user.username }}</h1>
{% if profile.user.rank_main > 1 %}
{% if profile.istenshi %}<img src="//{{ sakura.urls.content }}/images/tenshi.png" alt="Tenshi" /> {% endif %}<img src="//{{ sakura.urls.content }}/images/flags/{% if profile.user.country|lower == 'eu' %}europeanunion{% else %}{{ profile.user.country|lower }}{% endif %}.png" alt="{{ profile.user.country }}" /> <span style="font-size: .9em; line-height: 11px;">{{ profile.country }}</span>
<hr class="default" />
<b>Joined</b> {{ profile.user.regdate|date("l Y-m-d H:i T") }}<br />
{% if profile.user.lastdate == 0 %}
<b>User hasn't logged in yet.</b>
{% else %}
<b>Last Seen on</b> {{ profile.user.lastdate|date("l Y-m-d H:i T") }}
{% endif %}
{% if profile.data is not null %}
<hr class="default" />
{% if user.checklogin %}
@ -32,7 +37,7 @@
</td>
<td style="text-align: right;">
{% if name == 'youtube' %}
<a href="https://youtube.com/{% if field.youtubetype == 1 %}channel{% else %}user{% endif %}/{{ field.value }}" class="default">{{ field.value }}</a>
<a href="https://youtube.com/{% if field.youtubetype == 1 %}channel{% else %}user{% endif %}/{{ field.value }}" class="default">{% if field.youtubetype == 1 %}{{ profile.user.username }}'s Channel{% else %}{{ field.value }}{% endif %}</a>
{% else %}
{% if field.islink %}
<a href="{{ field.link }}" class="default">
@ -50,9 +55,14 @@
<b>Log in to view the full profile!</b>
{% endif %}
{% endif %}
{% endif %}
<hr class="default" />
<b>Account Standing</b>
{% if profile.user.rank_main < 2 %}
<h2 style="color: #888; text-shadow: 0 0 7px #888; margin-top: 0;">Deactivated</h2>
{% else %}
<h2 style="color: green; text-shadow: 0 0 7px #888; margin-top: 0;">Good</h2>
{% endif %}
</div>
</div>
<div class="content-left content-column markdown{% if profile.profpage|length < 1 %} hidden{% endif %}">

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 KiB

View file

@ -17,7 +17,10 @@ if(isset($_GET['m'])) {
switch($_GET['m']) {
case 'avatar':
// Set path to no avatar picture
$noAvatar = ROOT .'content/images/no-av.png';
$noAvatar = ROOT .'content/images/no-av.png';
$deactiveAvatar = ROOT .'content/images/deactivated-av.png';
$bannedAvatar = ROOT .'content/images/banned-av.png';
$avatarDirPath = ROOT .'content/images/avatars/';
// If ?u= isn't set or if it isn't numeric
if(!isset($_GET['u']) || !is_numeric($_GET['u'])) {
@ -25,9 +28,30 @@ if(isset($_GET['m'])) {
break;
}
// Get user data
$user = Users::getUser($_GET['u']);
// If user is deactivated use deactive avatar
if(Users::checkIfUserHasRanks([0, 1], $user, true)) {
$serveImage = $deactiveAvatar;
break;
}
// Check if user is banned
if(false) { // [Flashwave 2015-04-27] Banning isn't implemented yet
$serveImage = $bannedAvatar;
break;
}
// Check if user has an avatar set
if(empty($user['avatar_url']) || !file_exists($avatarDirPath . $user['avatar_url'])) {
$serveImage = $noAvatar;
break;
}
// Check if the avatar exist and assign it to a value
$serveImage = empty(Users::getUser($_GET['u'])['avatar_url']) ? $noAvatar : Users::getUser($_GET['u'])['avatar_url'];
break;
$serveImage = $avatarDirPath . $user['avatar_url'];
break;
case 'background':
// Set path to no avatar picture
@ -41,7 +65,7 @@ if(isset($_GET['m'])) {
// Check if the avatar exist and assign it to a value
$serveImage = empty(Users::getUser($_GET['u'])['profilebg']) ? $noBackground : Users::getUser($_GET['u'])['profilebg'];
break;
break;
default:
$serveImage = ROOT .'content/pixel.png';