diff --git a/_sakura/changelog.json b/_sakura/changelog.json index 9d29129..78f4b51 100644 --- a/_sakura/changelog.json +++ b/_sakura/changelog.json @@ -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." + } + ] } diff --git a/_sakura/sakura.php b/_sakura/sakura.php index 63682ec..695d1c9 100644 --- a/_sakura/sakura.php +++ b/_sakura/sakura.php @@ -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'); diff --git a/_sakura/templates/yuuno/main/profile.tpl b/_sakura/templates/yuuno/main/profile.tpl index 645d103..4b80de7 100644 --- a/_sakura/templates/yuuno/main/profile.tpl +++ b/_sakura/templates/yuuno/main/profile.tpl @@ -17,10 +17,15 @@ {{ profile.user.username }}'s Avatar
{{ profile.ranktitle }}

{{ profile.user.username }}

+ {% if profile.user.rank_main > 1 %} {% if profile.istenshi %}Tenshi {% endif %}{{ profile.user.country }} {{ profile.country }}
Joined {{ profile.user.regdate|date("l Y-m-d H:i T") }}
+ {% if profile.user.lastdate == 0 %} + User hasn't logged in yet. + {% else %} Last Seen on {{ profile.user.lastdate|date("l Y-m-d H:i T") }} + {% endif %} {% if profile.data is not null %}
{% if user.checklogin %} @@ -32,7 +37,7 @@ {% if name == 'youtube' %} - {{ field.value }} + {% if field.youtubetype == 1 %}{{ profile.user.username }}'s Channel{% else %}{{ field.value }}{% endif %} {% else %} {% if field.islink %} @@ -50,9 +55,14 @@ Log in to view the full profile! {% endif %} {% endif %} + {% endif %}
Account Standing + {% if profile.user.rank_main < 2 %} +

Deactivated

+ {% else %}

Good

+ {% endif %}
diff --git a/content/images/banned-av.png b/content/images/banned-av.png new file mode 100644 index 0000000..b7da007 Binary files /dev/null and b/content/images/banned-av.png differ diff --git a/content/images/deactivated-av.png b/content/images/deactivated-av.png new file mode 100644 index 0000000..1b52de4 Binary files /dev/null and b/content/images/deactivated-av.png differ diff --git a/main/imageserve.php b/main/imageserve.php index 6e4a7a2..bb9ab9f 100644 --- a/main/imageserve.php +++ b/main/imageserve.php @@ -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';