diff --git a/_sakura/changelog.json b/_sakura/changelog.json index ded72df..a4acdd6 100644 --- a/_sakura/changelog.json +++ b/_sakura/changelog.json @@ -23,7 +23,9 @@ "20150501", "20150502", "20150503", - "20150503.1" + "20150503.1", + "20150504", + "20150504.1" ] @@ -890,6 +892,28 @@ "change": "Added profile backgrounds." } + ], + + "20150504": [ + + { + "type": "REM", + "change": "Removed blank background for inactive users (will make the backend handle removal)." + } + + ], + + "20150504.1": [ + + { + "type": "UPD", + "change": "Changed profile background handling." + }, + { + "type": "ADD", + "change": "Add beginning parts of the warning systems." + } + ] } diff --git a/_sakura/components/Users.php b/_sakura/components/Users.php index 5cce653..132d564 100644 --- a/_sakura/components/Users.php +++ b/_sakura/components/Users.php @@ -918,4 +918,17 @@ class Users { } + // Get all warnings issued to a user (or all warnings a user issued) + public static function getWarnings($uid, $iid = false) { + + // Do the database query + $warnings = Database::fetch('warnings', true, [ + ($iid ? 'iid' : 'uid') => [$uid, '='] + ]); + + // Return all the warnings + return $warnings; + + } + } diff --git a/_sakura/sakura.php b/_sakura/sakura.php index 76a9fdf..c47d24c 100644 --- a/_sakura/sakura.php +++ b/_sakura/sakura.php @@ -8,7 +8,7 @@ namespace Sakura; // Define Sakura version -define('SAKURA_VERSION', '20150503.1'); +define('SAKURA_VERSION', '20150504'); define('SAKURA_VLABEL', 'Heliotrope'); define('SAKURA_VTYPE', 'Development'); define('SAKURA_COLOUR', '#DF73FF'); diff --git a/_sakura/templates/yuuno/global/header.tpl b/_sakura/templates/yuuno/global/header.tpl index 1531cd3..7646ef3 100644 --- a/_sakura/templates/yuuno/global/header.tpl +++ b/_sakura/templates/yuuno/global/header.tpl @@ -119,7 +119,7 @@ }; - +
{% else %} -
+
+
{{ profile.user.username }}'s Avatar @@ -61,7 +62,12 @@ {% if profile.user.rank_main < 2 %}

Deactivated

{% else %} -

Good

+ {% if profile.warnings %} +

Bad

+ This user has {{ profile.warnings|length }} warning{% if profile.warnings|length != 1 %}s{% endif %}.
After 5 to 10 more warnings (depending on what they are for) this user may be permanently banned.
+ {% else %} +

Good

+ {% endif %} {% endif %}
diff --git a/content/images/no-bg.png b/content/images/no-bg.png new file mode 100644 index 0000000..8e52f7c Binary files /dev/null and b/content/images/no-bg.png differ diff --git a/main/imageserve.php b/main/imageserve.php index 4173348..0b4828f 100644 --- a/main/imageserve.php +++ b/main/imageserve.php @@ -69,12 +69,6 @@ if(isset($_GET['m'])) { // Get user data $user = Users::getUser($_GET['u']); - // If user is deactivated don't display background - if(Users::checkIfUserHasRanks([0, 1], $user, true)) { - $serveImage = $noBackground; - break; - } - // Check if user has an avatar set if(empty($user['background_url']) || !file_exists($bgDirPath . $user['background_url'])) { $serveImage = $noAvatar; diff --git a/main/profile.php b/main/profile.php index 9d705a4..3a03e69 100644 --- a/main/profile.php +++ b/main/profile.php @@ -34,13 +34,20 @@ if(isset($_GET['u'])) { 'istenshi' => Users::checkUserTenshi($_PROFILE_USER_DATA['id']), 'online' => Users::checkUserOnline($_PROFILE_USER_DATA['id']), 'profpage' => Main::mdParse(base64_decode($_PROFILE_USER_DATA['profile_md'])), - 'data' => Users::getUserProfileData($_PROFILE_USER_DATA['id']) + 'data' => Users::getUserProfileData($_PROFILE_USER_DATA['id']), + 'warnings' => Users::getWarnings($_PROFILE_USER_DATA['id']) ]; $renderData['page'] = [ 'title' => ($_PROFILE_USER_DATA['id'] < 1 || $_PROFILE_USER_DATA['password_algo'] == 'nologin' ? 'User not found!' : 'Profile of '. $_PROFILE_USER_DATA['username']), 'style' => ($_PROFILE_USER_DATA['background_url'] ? [ - 'body' => [ - 'background' => 'url("/bg/'. $_PROFILE_USER_DATA['id'] .'") no-repeat fixed center center / cover transparent !important' + '.userBackground' => [ + 'background' => 'url("/bg/'. $_PROFILE_USER_DATA['id'] .'") no-repeat fixed center center / cover transparent !important', + 'position' => 'fixed', + 'top' => '0', + 'bottom' => '0', + 'right' => '0', + 'left' => '0', + 'z-index' => '-1' ], '.profile' => [ 'background' => 'rgba(211, 191, 255, .8) !important'