Skip to content

Commit 231586b

Browse files
committed
Added option for users to disable checkmark
First test of the new database user setting save system.
1 parent 8dea98a commit 231586b

File tree

3 files changed

+174
-2
lines changed

3 files changed

+174
-2
lines changed

app/Http/Controllers/UserController.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,13 +523,20 @@ public function editPage(request $request)
523523
$pageDescription = strip_tags($request->pageDescription,'<a><p><strong><i><ul><ol><li><blockquote><h2><h3><h4>');
524524
$pageDescription = preg_replace("/<a([^>]*)>/i", "<a $1 rel=\"noopener noreferrer nofollow\">", $pageDescription);
525525
$name = $request->name;
526+
$checkmark = $request->checkmark;
526527

527528
User::where('id', $userId)->update(['littlelink_name' => $pageName, 'littlelink_description' => $pageDescription, 'name' => $name]);
528529

529530
if ($request->hasFile('image')) {
530531
$profilePhoto->move(base_path('/img'), $userId . ".png");
531532
}
532533

534+
if($checkmark == "on"){
535+
UserData::saveData($userId, 'checkmark', true);
536+
} else {
537+
UserData::saveData($userId, 'checkmark', false);
538+
}
539+
533540
return Redirect('/studio/page');
534541
}
535542

resources/views/littlelink.blade.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
<?php use App\Models\UserData; ?>
2+
13
<!DOCTYPE html>
24
@include('layouts.lang')
35
<head>
@@ -290,7 +292,7 @@ function get_operating_system() {
290292
@endif
291293

292294
<!-- Your Name -->
293-
<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>
295+
<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>
294296

295297
<!-- Short Bio -->
296298
<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() {
299301
@php $icons = DB::table('links')->where('user_id', $userinfo->id)->where('button_id', 94)->get(); @endphp
300302
<div class="row fadein social-icon-div">
301303
@foreach($icons as $icon)
302-
<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>
304+
<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>
303305
@endforeach
304306
</div>
305307

resources/views/studio/page.blade.php

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<?php use App\Models\UserData; ?>
12
@extends('layouts.sidebar')
23

34
@section('content')
@@ -15,6 +16,158 @@
1516
}
1617
1718
</style>
19+
<style>
20+
@supports (-webkit-appearance: none) or (-moz-appearance: none) {
21+
input[type=checkbox],
22+
input[type=radio] {
23+
--active: #275EFE;
24+
--active-inner: #fff;
25+
--focus: 2px rgba(39, 94, 254, .3);
26+
--border: #BBC1E1;
27+
--border-hover: #275EFE;
28+
--background: #fff;
29+
--disabled: #F6F8FF;
30+
--disabled-inner: #E1E6F9;
31+
-webkit-appearance: none;
32+
-moz-appearance: none;
33+
height: 21px;
34+
outline: none;
35+
display: inline-block;
36+
vertical-align: top;
37+
position: relative;
38+
margin: 0;
39+
cursor: pointer;
40+
border: 1px solid var(--bc, var(--border));
41+
background: var(--b, var(--background));
42+
transition: background 0.3s, border-color 0.3s, box-shadow 0.2s;
43+
}
44+
input[type=checkbox]:after,
45+
input[type=radio]:after {
46+
content: "";
47+
display: block;
48+
left: 0;
49+
top: 0;
50+
position: absolute;
51+
transition: transform var(--d-t, 0.3s) var(--d-t-e, ease), opacity var(--d-o, 0.2s);
52+
}
53+
input[type=checkbox]:checked,
54+
input[type=radio]:checked {
55+
--b: var(--active);
56+
--bc: var(--active);
57+
--d-o: .3s;
58+
--d-t: .6s;
59+
--d-t-e: cubic-bezier(.2, .85, .32, 1.2);
60+
}
61+
input[type=checkbox]:disabled,
62+
input[type=radio]:disabled {
63+
--b: var(--disabled);
64+
cursor: not-allowed;
65+
opacity: 0.9;
66+
}
67+
input[type=checkbox]:disabled:checked,
68+
input[type=radio]:disabled:checked {
69+
--b: var(--disabled-inner);
70+
--bc: var(--border);
71+
}
72+
input[type=checkbox]:disabled + label,
73+
input[type=radio]:disabled + label {
74+
cursor: not-allowed;
75+
}
76+
input[type=checkbox]:hover:not(:checked):not(:disabled),
77+
input[type=radio]:hover:not(:checked):not(:disabled) {
78+
--bc: var(--border-hover);
79+
}
80+
input[type=checkbox]:focus,
81+
input[type=radio]:focus {
82+
box-shadow: 0 0 0 var(--focus);
83+
}
84+
input[type=checkbox]:not(.switch),
85+
input[type=radio]:not(.switch) {
86+
width: 21px;
87+
}
88+
input[type=checkbox]:not(.switch):after,
89+
input[type=radio]:not(.switch):after {
90+
opacity: var(--o, 0);
91+
}
92+
input[type=checkbox]:not(.switch):checked,
93+
input[type=radio]:not(.switch):checked {
94+
--o: 1;
95+
}
96+
input[type=checkbox] + label,
97+
input[type=radio] + label {
98+
font-size: 14px;
99+
line-height: 21px;
100+
display: inline-block;
101+
vertical-align: top;
102+
cursor: pointer;
103+
margin-left: 4px;
104+
}
105+
106+
input[type=checkbox]:not(.switch) {
107+
border-radius: 7px;
108+
}
109+
input[type=checkbox]:not(.switch):after {
110+
width: 5px;
111+
height: 9px;
112+
border: 2px solid var(--active-inner);
113+
border-top: 0;
114+
border-left: 0;
115+
left: 7px;
116+
top: 4px;
117+
transform: rotate(var(--r, 20deg));
118+
}
119+
input[type=checkbox]:not(.switch):checked {
120+
--r: 43deg;
121+
}
122+
input[type=checkbox].switch {
123+
width: 38px;
124+
border-radius: 11px;
125+
}
126+
input[type=checkbox].switch:after {
127+
left: 2px;
128+
top: 2px;
129+
border-radius: 50%;
130+
width: 15px;
131+
height: 15px;
132+
background: var(--ab, var(--border));
133+
transform: translateX(var(--x, 0));
134+
}
135+
input[type=checkbox].switch:checked {
136+
--ab: var(--active-inner);
137+
--x: 17px;
138+
}
139+
input[type=checkbox].switch:disabled:not(:checked):after {
140+
opacity: 0.6;
141+
}
142+
143+
input[type=radio] {
144+
border-radius: 50%;
145+
}
146+
input[type=radio]:after {
147+
width: 19px;
148+
height: 19px;
149+
border-radius: 50%;
150+
background: var(--active-inner);
151+
opacity: 0;
152+
transform: scale(var(--s, 0.7));
153+
}
154+
input[type=radio]:checked {
155+
--s: .5;
156+
}
157+
}
158+
.txt-label{
159+
color: white;
160+
padding-left: 5px;
161+
font-size: 200%;
162+
position: relative;
163+
}
164+
.toggle-btn{
165+
padding-left: 20px;
166+
}
167+
.ch2{
168+
padding-top: 60px;
169+
}
170+
</style>
18171

19172
<section class=' shadow text-gray-400'>
20173
<h3 class="mb-4 card-header"><i class="bi bi-file-earmark-break"> My Page</i></h3>
@@ -70,6 +223,16 @@
70223
<label>Page Description</label>
71224
<textarea class="form-control @if(env('ALLOW_USER_HTML') === true) ckeditor @endif" name="pageDescription" rows="3">{{ $page->littlelink_description ?? '' }}</textarea>
72225
</div>
226+
227+
@if(auth()->user()->role == 'admin' || auth()->user()->role == 'vip')
228+
<div class="form-group col-lg-8">
229+
<h5 style="margin-top:50px">Show checkmark</h5>
230+
<p class="text-muted">You are a verified user. This setting allows you to hide your checkmark on your page.</p>
231+
<div class="input-group">
232+
<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>
233+
</div></div>
234+
<input type="hidden" name="_token" value="{{csrf_token()}}">
235+
@endif
73236
@endforeach
74237
<button type="submit" class="mt-3 ml-3 btn btn-info">Submit</button>
75238
</form>

0 commit comments

Comments
 (0)