daily bread
This commit is contained in:
parent
b336e65909
commit
5dcd2804a5
8 changed files with 58 additions and 14 deletions
|
@ -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."
|
||||
}
|
||||
|
||||
]
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -119,7 +119,7 @@
|
|||
};
|
||||
</script>
|
||||
</head>
|
||||
<body{% if page.background %} style="background: url('{{ page.background }}') no-repeat fixed center center / cover inherit !important;"{% endif %}>
|
||||
<body>
|
||||
<div id="container">
|
||||
<span id="top"></span>
|
||||
<div class="header" id="header">
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
</ul>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="content profile"{% if page.background %} style="background: rgba(211, 191, 255, .8) !important;"{% endif %}>
|
||||
<div class="userBackground"></div>
|
||||
<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" style="box-shadow: 0 3px 7px #{% if profile.online %}484{% else %}844{% endif %};" />
|
||||
|
@ -61,7 +62,12 @@
|
|||
{% 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>
|
||||
{% if profile.warnings %}
|
||||
<h2 style="color: red; text-shadow: 0 0 7px #888; margin-top: 0;">Bad</h2>
|
||||
<span style="font-size: 10px; line-height: 10px;">This user has <b>{{ profile.warnings|length }} warning{% if profile.warnings|length != 1 %}s{% endif %}</b>.<br />After 5 to 10 more warnings (depending on what they are for) this user may be permanently banned.</span>
|
||||
{% else %}
|
||||
<h2 style="color: green; text-shadow: 0 0 7px #888; margin-top: 0;">Good</h2>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
|
BIN
content/images/no-bg.png
Normal file
BIN
content/images/no-bg.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
|
@ -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;
|
||||
|
|
|
@ -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'
|
||||
|
|
Reference in a new issue