Added option for users to disable checkmark

First test of the new database user setting save system.
This commit is contained in:
Julian Prieber 2023-02-16 15:38:17 +01:00
parent 8dea98a28c
commit 231586b69a
3 changed files with 174 additions and 2 deletions

View File

@ -523,6 +523,7 @@ class UserController extends Controller
$pageDescription = strip_tags($request->pageDescription,'<a><p><strong><i><ul><ol><li><blockquote><h2><h3><h4>'); $pageDescription = strip_tags($request->pageDescription,'<a><p><strong><i><ul><ol><li><blockquote><h2><h3><h4>');
$pageDescription = preg_replace("/<a([^>]*)>/i", "<a $1 rel=\"noopener noreferrer nofollow\">", $pageDescription); $pageDescription = preg_replace("/<a([^>]*)>/i", "<a $1 rel=\"noopener noreferrer nofollow\">", $pageDescription);
$name = $request->name; $name = $request->name;
$checkmark = $request->checkmark;
User::where('id', $userId)->update(['littlelink_name' => $pageName, 'littlelink_description' => $pageDescription, 'name' => $name]); User::where('id', $userId)->update(['littlelink_name' => $pageName, 'littlelink_description' => $pageDescription, 'name' => $name]);
@ -530,6 +531,12 @@ class UserController extends Controller
$profilePhoto->move(base_path('/img'), $userId . ".png"); $profilePhoto->move(base_path('/img'), $userId . ".png");
} }
if($checkmark == "on"){
UserData::saveData($userId, 'checkmark', true);
} else {
UserData::saveData($userId, 'checkmark', false);
}
return Redirect('/studio/page'); return Redirect('/studio/page');
} }

View File

@ -1,3 +1,5 @@
<?php use App\Models\UserData; ?>
<!DOCTYPE html> <!DOCTYPE html>
@include('layouts.lang') @include('layouts.lang')
<head> <head>
@ -290,7 +292,7 @@ function get_operating_system() {
@endif @endif
<!-- Your Name --> <!-- Your Name -->
<h1 class="fadein">{{ $info->name }}@if(($userinfo->role == 'vip' or $userinfo->role == 'admin') and theme('disable_verification_badge') != "true" and env('HIDE_VERIFICATION_CHECKMARK') != true)<span title="Verified user">@include('components.verify-svg')@endif</span></h1> <h1 class="fadein">{{ $info->name }}@if(($userinfo->role == 'vip' or $userinfo->role == 'admin') and theme('disable_verification_badge') != "true" and env('HIDE_VERIFICATION_CHECKMARK') != true and UserData::getData($userinfo->id, 'checkmark') != false)<span title="Verified user">@include('components.verify-svg')@endif</span></h1>
<!-- Short Bio --> <!-- Short Bio -->
<div class="fadein"><center><p style="width:50%;min-width:300px;" class="fadein">@if(env('ALLOW_USER_HTML') === true){!! $info->littlelink_description !!}@else{{ $info->littlelink_description }}@endif</p></center></div> <div class="fadein"><center><p style="width:50%;min-width:300px;" class="fadein">@if(env('ALLOW_USER_HTML') === true){!! $info->littlelink_description !!}@else{{ $info->littlelink_description }}@endif</p></center></div>
@ -299,7 +301,7 @@ function get_operating_system() {
@php $icons = DB::table('links')->where('user_id', $userinfo->id)->where('button_id', 94)->get(); @endphp @php $icons = DB::table('links')->where('user_id', $userinfo->id)->where('button_id', 94)->get(); @endphp
<div class="row fadein social-icon-div"> <div class="row fadein social-icon-div">
@foreach($icons as $icon) @foreach($icons as $icon)
<a class="social-hover social-link" href="{{ route('clickNumber') . '/' . $icon->id . "?" . $icon->link }}" @if(theme('open_links_in_same_tab') != "true")target="_blank"@endif><i class="social-icon fa-brands fa-{{$icon->title}}"></i></a> <a class="social-hover social-link" href="{{ route('clickNumber') . '/' . $icon->id. "?" . $icon->link}}" @if(theme('open_links_in_same_tab') != "true")target="_blank"@endif><i class="social-icon fa-brands fa-{{$icon->title}}"></i></a>
@endforeach @endforeach
</div> </div>

View File

@ -1,3 +1,4 @@
<?php use App\Models\UserData; ?>
@extends('layouts.sidebar') @extends('layouts.sidebar')
@section('content') @section('content')
@ -15,6 +16,158 @@
} }
</style> </style>
<style>
@supports (-webkit-appearance: none) or (-moz-appearance: none) {
input[type=checkbox],
input[type=radio] {
--active: #275EFE;
--active-inner: #fff;
--focus: 2px rgba(39, 94, 254, .3);
--border: #BBC1E1;
--border-hover: #275EFE;
--background: #fff;
--disabled: #F6F8FF;
--disabled-inner: #E1E6F9;
-webkit-appearance: none;
-moz-appearance: none;
height: 21px;
outline: none;
display: inline-block;
vertical-align: top;
position: relative;
margin: 0;
cursor: pointer;
border: 1px solid var(--bc, var(--border));
background: var(--b, var(--background));
transition: background 0.3s, border-color 0.3s, box-shadow 0.2s;
}
input[type=checkbox]:after,
input[type=radio]:after {
content: "";
display: block;
left: 0;
top: 0;
position: absolute;
transition: transform var(--d-t, 0.3s) var(--d-t-e, ease), opacity var(--d-o, 0.2s);
}
input[type=checkbox]:checked,
input[type=radio]:checked {
--b: var(--active);
--bc: var(--active);
--d-o: .3s;
--d-t: .6s;
--d-t-e: cubic-bezier(.2, .85, .32, 1.2);
}
input[type=checkbox]:disabled,
input[type=radio]:disabled {
--b: var(--disabled);
cursor: not-allowed;
opacity: 0.9;
}
input[type=checkbox]:disabled:checked,
input[type=radio]:disabled:checked {
--b: var(--disabled-inner);
--bc: var(--border);
}
input[type=checkbox]:disabled + label,
input[type=radio]:disabled + label {
cursor: not-allowed;
}
input[type=checkbox]:hover:not(:checked):not(:disabled),
input[type=radio]:hover:not(:checked):not(:disabled) {
--bc: var(--border-hover);
}
input[type=checkbox]:focus,
input[type=radio]:focus {
box-shadow: 0 0 0 var(--focus);
}
input[type=checkbox]:not(.switch),
input[type=radio]:not(.switch) {
width: 21px;
}
input[type=checkbox]:not(.switch):after,
input[type=radio]:not(.switch):after {
opacity: var(--o, 0);
}
input[type=checkbox]:not(.switch):checked,
input[type=radio]:not(.switch):checked {
--o: 1;
}
input[type=checkbox] + label,
input[type=radio] + label {
font-size: 14px;
line-height: 21px;
display: inline-block;
vertical-align: top;
cursor: pointer;
margin-left: 4px;
}
input[type=checkbox]:not(.switch) {
border-radius: 7px;
}
input[type=checkbox]:not(.switch):after {
width: 5px;
height: 9px;
border: 2px solid var(--active-inner);
border-top: 0;
border-left: 0;
left: 7px;
top: 4px;
transform: rotate(var(--r, 20deg));
}
input[type=checkbox]:not(.switch):checked {
--r: 43deg;
}
input[type=checkbox].switch {
width: 38px;
border-radius: 11px;
}
input[type=checkbox].switch:after {
left: 2px;
top: 2px;
border-radius: 50%;
width: 15px;
height: 15px;
background: var(--ab, var(--border));
transform: translateX(var(--x, 0));
}
input[type=checkbox].switch:checked {
--ab: var(--active-inner);
--x: 17px;
}
input[type=checkbox].switch:disabled:not(:checked):after {
opacity: 0.6;
}
input[type=radio] {
border-radius: 50%;
}
input[type=radio]:after {
width: 19px;
height: 19px;
border-radius: 50%;
background: var(--active-inner);
opacity: 0;
transform: scale(var(--s, 0.7));
}
input[type=radio]:checked {
--s: .5;
}
}
.txt-label{
color: white;
padding-left: 5px;
font-size: 200%;
position: relative;
}
.toggle-btn{
padding-left: 20px;
}
.ch2{
padding-top: 60px;
}
</style>
<section class=' shadow text-gray-400'> <section class=' shadow text-gray-400'>
<h3 class="mb-4 card-header"><i class="bi bi-file-earmark-break"> My Page</i></h3> <h3 class="mb-4 card-header"><i class="bi bi-file-earmark-break"> My Page</i></h3>
@ -70,6 +223,16 @@
<label>Page Description</label> <label>Page Description</label>
<textarea class="form-control @if(env('ALLOW_USER_HTML') === true) ckeditor @endif" name="pageDescription" rows="3">{{ $page->littlelink_description ?? '' }}</textarea> <textarea class="form-control @if(env('ALLOW_USER_HTML') === true) ckeditor @endif" name="pageDescription" rows="3">{{ $page->littlelink_description ?? '' }}</textarea>
</div> </div>
@if(auth()->user()->role == 'admin' || auth()->user()->role == 'vip')
<div class="form-group col-lg-8">
<h5 style="margin-top:50px">Show checkmark</h5>
<p class="text-muted">You are a verified user. This setting allows you to hide your checkmark on your page.</p>
<div class="input-group">
<div class="row toggle-btn"><input name="checkmark" class="switch toggle-btn" type="checkbox" id="checkmark" <?php if(UserData::getData(Auth::user()->id, 'checkmark') == true){echo 'checked>';}else{echo '/>';} ?><label for="MAINTENANCE_MODE" class="label txt-label">Enable</label></div>
</div></div>
<input type="hidden" name="_token" value="{{csrf_token()}}">
@endif
@endforeach @endforeach
<button type="submit" class="mt-3 ml-3 btn btn-info">Submit</button> <button type="submit" class="mt-3 ml-3 btn btn-info">Submit</button>
</form> </form>