diff --git a/assets/less/main.less b/assets/less/main.less index f2217863..bf274e4f 100644 --- a/assets/less/main.less +++ b/assets/less/main.less @@ -40,6 +40,7 @@ body { font: 12px/20px @mio-font-regular; color: var(--text-colour); background-attachment: fixed; + background-position: center center; &__wrapper { max-width: var(--site-max-width); diff --git a/public/profile.php b/public/profile.php index b8c2860c..9ae9c470 100644 --- a/public/profile.php +++ b/public/profile.php @@ -190,11 +190,11 @@ switch ($mode) { } if (!empty($_FILES['background'])) { - if (!empty($_POST['background']['delete'])) { + if ((int)($_POST['background']['attach'] ?? -1) === 0) { user_background_delete($userId); user_background_set_settings($userId, MSZ_USER_BACKGROUND_ATTACHMENT_NONE); } else { - if (!$perms['edit_avatar']) { + if (!$perms['edit_background']) { $notices[] = MSZ_TMP_USER_ERROR_STRINGS['background']['not-allowed']; } elseif (!empty($_FILES['background']) && is_array($_FILES['background'])) { @@ -228,8 +228,8 @@ switch ($mode) { } } - $backgroundSettings = in_array($_POST['background']['attach'] ?? '', MSZ_USER_BACKGROUND_ATTACHMENTS_NAMES) - ? array_flip(MSZ_USER_BACKGROUND_ATTACHMENTS_NAMES)[$_POST['background']['attach']] + $backgroundSettings = in_array($_POST['background']['attach'] ?? '', MSZ_USER_BACKGROUND_ATTACHMENTS) + ? (int)($_POST['background']['attach']) : MSZ_USER_BACKGROUND_ATTACHMENTS[0]; if (!empty($_POST['background']['attr']['blend'])) { diff --git a/templates/_layout/input.twig b/templates/_layout/input.twig index a7696ae3..0674c171 100644 --- a/templates/_layout/input.twig +++ b/templates/_layout/input.twig @@ -80,3 +80,28 @@ {% endspaceless %} {% endmacro %} + +{% macro input_select_option(value, key, selected) %} +{% spaceless %} + +{% endspaceless %} +{% endmacro %} + +{% macro input_select(name, options, selected, value_name, key_name, only_values, class, attributes) %} +{% from _self import input_select_option %} +{% spaceless %} + +{% endspaceless %} +{% endmacro %} diff --git a/templates/manage/changelog/change_edit.twig b/templates/manage/changelog/change_edit.twig index 5048707d..62ad786c 100644 --- a/templates/manage/changelog/change_edit.twig +++ b/templates/manage/changelog/change_edit.twig @@ -1,6 +1,6 @@ {% extends 'manage/changelog/master.twig' %} {% from 'macros.twig' import container_title %} -{% from '_layout/input.twig' import input_csrf, input_text %} +{% from '_layout/input.twig' import input_csrf, input_text, input_select %} {% if edit_change is defined %} {% set site_link = '/changelog.php?c=' ~ edit_change.change_id %} @@ -30,13 +30,7 @@ @@ -63,23 +57,15 @@ {{ container_title('Tags') }} {% if edit_change_assigned_tags|length > 0 %} -
{% endif %} @@ -88,19 +74,11 @@ -