diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 57622f8..c0c7b11 100755 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -100,7 +100,7 @@ class UserController extends Controller $links = DB::table('links')->join('buttons', 'buttons.id', '=', 'links.button_id')->select('links.link', 'links.id', 'links.button_id', 'links.title', 'links.custom_css', 'links.custom_icon', 'buttons.name')->where('user_id', $id)->orderBy('up_link', 'asc')->orderBy('order', 'asc')->get(); - return view('littlelink', ['userinfo' => $userinfo, 'information' => $information, 'links' => $links, 'littlelink_name' => $littlelink_name]); + return view('linkstack.linkstack', ['userinfo' => $userinfo, 'information' => $information, 'links' => $links, 'littlelink_name' => $littlelink_name]); } //Redirect to user page @@ -135,7 +135,7 @@ class UserController extends Controller $links = DB::table('links')->join('buttons', 'buttons.id', '=', 'links.button_id')->select('links.link', 'links.id', 'links.button_id', 'links.title', 'links.custom_css', 'links.custom_icon', 'buttons.name')->where('user_id', $id)->orderBy('up_link', 'asc')->orderBy('order', 'asc')->get(); - return view('littlelink', ['userinfo' => $userinfo, 'information' => $information, 'links' => $links, 'littlelink_name' => $littlelink_name]); + return view('linkstack.linkstack', ['userinfo' => $userinfo, 'information' => $information, 'links' => $links, 'littlelink_name' => $littlelink_name]); } //Show add/update form diff --git a/resources/views/linkstack/elements/avatar.blade.php b/resources/views/linkstack/elements/avatar.blade.php new file mode 100644 index 0000000..aa03daa --- /dev/null +++ b/resources/views/linkstack/elements/avatar.blade.php @@ -0,0 +1,8 @@ + + @if(file_exists(base_path(findAvatar($userinfo->id)))) + avatar + @elseif(file_exists(base_path("assets/linkstack/images/").findFile('avatar'))) + avatar + @else + avatar + @endif \ No newline at end of file diff --git a/resources/views/linkstack/elements/bio.blade.php b/resources/views/linkstack/elements/bio.blade.php new file mode 100644 index 0000000..7448271 --- /dev/null +++ b/resources/views/linkstack/elements/bio.blade.php @@ -0,0 +1,3 @@ + + +

@if(env('ALLOW_USER_HTML') === true){!! $info->littlelink_description !!}@else{{ $info->littlelink_description }}@endif

\ No newline at end of file diff --git a/resources/views/linkstack/elements/buttons.blade.php b/resources/views/linkstack/elements/buttons.blade.php new file mode 100644 index 0000000..1e8e4f1 --- /dev/null +++ b/resources/views/linkstack/elements/buttons.blade.php @@ -0,0 +1,51 @@ + + @php $initial = 1; @endphp + + @foreach($links as $link) + @php $linkName = str_replace('default ','',$link->title) @endphp + @switch($link->name) + @case('icon') + @break + @case('phone') +
link }}">{{ $link->name }}{{ $link->title }}
+ @break + @case('default email') + @case('default email_alt') +
link }}">email{{ $link->title }}
+ @break + @case('buy me a coffee') +
link }}" @if(theme('open_links_in_same_tab') != "true")target="_blank"@endif >{{ $link->name }}Buy me a Coffee
+ @break + @case('space') + @php $title = $link->title; if (is_numeric($title)) { echo str_repeat("
", $title < 10 ? $title : 10); } else { echo "


"; } @endphp + @break + @case('heading') +

{{ $link->title }}

+ @break + @case('text') +
@if(env('ALLOW_USER_HTML') === true){!! $link->title !!}@else{{ $link->title }}@endif
+ @break + @case('vcard') +
{{ $link->name }}{{ $link->title }}
+ @break + @case('custom') + @if($link->custom_css === "" or $link->custom_css === "NULL" or (theme('allow_custom_buttons') == "false")) +
link }}" @if(theme('open_links_in_same_tab') != "true")target="_blank"@endif >{{ $link->title }}
+ @break + @elseif($link->custom_css != "") +
link }}" @if(theme('open_links_in_same_tab') != "true")target="_blank"@endif >{{ $link->title }}
+ @break + @endif + @case('custom_website') + @if($link->custom_css === "" or $link->custom_css === "NULL" or (theme('allow_custom_buttons') == "false")) +
link }}" @if(theme('open_links_in_same_tab') != "true")target="_blank"@endif >{{ $link->name }}id))){{url('assets/favicon/icons/'.localIcon($link->id))}}@else{{getFavIcon($link->id)}}@endif" onerror="this.onerror=null; this.src='{{asset('assets/linkstack/icons/website.svg')}}';">{{ $link->title }}
+ @break + @elseif($link->custom_css != "") +
link }}" @if(theme('open_links_in_same_tab') != "true")target="_blank"@endif >{{ $link->name }}id))){{url('assets/favicon/icons/'.localIcon($link->id))}}@else{{getFavIcon($link->id)}}@endif" onerror="this.onerror=null; this.src='{{asset('assets/linkstack/icons/website.svg')}}';">{{ $link->title }}
+ @break + @endif + @default + $value) { if($newLinkName == $key) { $newLinkName = $value; $isNewName = "true"; }} ?> +
link }}" @if(theme('open_links_in_same_tab') != "true")target="_blank"@endif >{{ $link->name }}name}}{{theme('custom_icon_extension')}} @else{{ asset('\/assets/linkstack/icons\/') . $link->name }}.svg @endif">@if($isNewName == "true"){{ ucfirst($newLinkName) }}@else{{ ucfirst($newLinkName) }}@endif
+ @endswitch + @endforeach \ No newline at end of file diff --git a/resources/views/linkstack/elements/heading.blade.php b/resources/views/linkstack/elements/heading.blade.php new file mode 100644 index 0000000..e4b2f22 --- /dev/null +++ b/resources/views/linkstack/elements/heading.blade.php @@ -0,0 +1,3 @@ + + +

{{ $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)@include('components.verify-svg')@endif

\ No newline at end of file diff --git a/resources/views/linkstack/elements/icons.blade.php b/resources/views/linkstack/elements/icons.blade.php new file mode 100644 index 0000000..2c9e6ba --- /dev/null +++ b/resources/views/linkstack/elements/icons.blade.php @@ -0,0 +1,9 @@ + + @php $icons = DB::table('links')->where('user_id', $userinfo->id)->where('button_id', 94)->get(); @endphp + @if(count($icons) > 0) +
+ @foreach($icons as $icon) + link}}" title="{{ucfirst($icon->title)}}" aria-label="{{ucfirst($icon->title)}}" @if(theme('open_links_in_same_tab') != "true")target="_blank"@endif> + @endforeach +
+ @endif \ No newline at end of file diff --git a/resources/views/linkstack/linkstack.blade.php b/resources/views/linkstack/linkstack.blade.php new file mode 100644 index 0000000..84c4e8c --- /dev/null +++ b/resources/views/linkstack/linkstack.blade.php @@ -0,0 +1,30 @@ + +@include('layouts.lang') + + @include('linkstack.modules.meta') + @include('linkstack.modules.theme') + @stack('linkstack-head') + @include('linkstack.modules.assets') + @foreach($information as $info) + @stack('linkstack-head-end') + + + @stack('linkstack-body-start') + @include('linkstack.modules.share-button') + @include('components.report-icon') +
+
+
+ @include('linkstack.elements.avatar') + @include('linkstack.elements.heading') + @include('linkstack.elements.bio') + @include('linkstack.elements.icons') + @endforeach + @include('linkstack.elements.buttons') + @include('layouts.footer') +
+
+
+ @stack('linkstack-body-end') + + \ No newline at end of file diff --git a/resources/views/linkstack/modules/assets.blade.php b/resources/views/linkstack/modules/assets.blade.php new file mode 100644 index 0000000..55129e5 --- /dev/null +++ b/resources/views/linkstack/modules/assets.blade.php @@ -0,0 +1,7 @@ + + + +@include('layouts.fonts') + + + \ No newline at end of file diff --git a/resources/views/linkstack/modules/meta.blade.php b/resources/views/linkstack/modules/meta.blade.php new file mode 100644 index 0000000..abf0412 --- /dev/null +++ b/resources/views/linkstack/modules/meta.blade.php @@ -0,0 +1,74 @@ + + +{{-- Fediverse rel="me" links --}} +@php + $relMe = "mastodon, firefish, streams"; + $relMeList = explode(', ', $relMe); +@endphp + +@foreach($links as $link) + @if(in_array($link->name, $relMeList)) + + @endif +@endforeach + +@if(env('CUSTOM_META_TAGS') == 'true') + @include('layouts.meta') +@else + + + +@endif + + + + + + + + + + @if(file_exists(base_path(findAvatar($userinfo->id)))) + + @elseif(file_exists(base_path("assets/linkstack/images/").findFile('avatar'))) + + @else + + @endif + + + + + + + + @if(file_exists(base_path(findAvatar($userinfo->id)))) + + @elseif(file_exists(base_path("assets/linkstack/images/").findFile('avatar'))) + + @else + + @endif + + + +@if(config('advanced-config.linkstack_title') != '' and env('HOME_URL') === '') +{{ $userinfo->name }} {{ config('advanced-config.linkstack_title') }} +@elseif(env('CUSTOM_META_TAGS') == 'true' and config('advanced-config.title') != '') +{{ config('advanced-config.title') }} +@elseif(env('HOME_URL') != '') +{{ $userinfo->name }} +@else +{{ $userinfo->name }} 🔗 {{ config('app.name') }} +@endif + +@include('components.favicon') +@include('components.favicon-extension') + +@if(file_exists(base_path("assets/linkstack/images/").findFile('favicon'))) + +@else + +@endif + +@include('layouts.analytics') \ No newline at end of file diff --git a/resources/views/linkstack/modules/share-button.blade.php b/resources/views/linkstack/modules/share-button.blade.php new file mode 100644 index 0000000..74d6ce9 --- /dev/null +++ b/resources/views/linkstack/modules/share-button.blade.php @@ -0,0 +1,31 @@ + + +@php + $ShowShrBtn = config('advanced-config.display_share_button'); + + if ($ShowShrBtn === '') { + $ShowShrBtn = 'true'; + } elseif ($ShowShrBtn === 'false') { + $ShowShrBtn = 'false'; + } elseif ($ShowShrBtn === 'user') { + $ShowShrBtn = Auth::user()->littlelink_name ? 'true' : 'false'; + } else { + $ShowShrBtn = 'true'; + } + + $DisplayShowShrBtn = $ShowShrBtn === 'true' && UserData::getData($userinfo->id, 'disable-sharebtn') !== "true"; +@endphp + + + + +@if($DisplayShowShrBtn == true) + +@endif \ No newline at end of file diff --git a/resources/views/linkstack/modules/theme.blade.php b/resources/views/linkstack/modules/theme.blade.php new file mode 100644 index 0000000..6c3f561 --- /dev/null +++ b/resources/views/linkstack/modules/theme.blade.php @@ -0,0 +1,109 @@ + + +@foreach($information as $info) @php $GLOBALS['themeName'] = $info->theme; @endphp @endforeach + +@if(theme('enable_custom_code') == "true" and theme('enable_custom_head') == "true" and env('ALLOW_CUSTOM_CODE_IN_THEMES') == 'true')@include($GLOBALS['themeName'] . '.extra.custom-head')@endif + +@if(theme('allow_custom_background') != "false") +@php +$customBackgroundFile = findBackground($userinfo->id); +$customBackgroundPath = base_path('assets/img/background-img/'.$customBackgroundFile); +$customBackgroundURL = url('assets/img/background-img/'.$customBackgroundFile); +$customBackgroundExists = file_exists($customBackgroundPath); +if($customBackgroundExists == true){ + $customBackgroundBrightness = analyzeImageBrightness($customBackgroundFile); + } else { + $customBackgroundBrightness = false;} +@endphp + +@if($customBackgroundExists == true) + +@endif +@endif + +@push('linkstack-head-end') +@if($info->theme != '' and $info->theme != 'default') + + + + + + + + @if(theme('use_default_buttons') == "true") + + @else + + @endif + +@if(file_exists(base_path('themes/' . $info->theme . '/animations.css'))) + +@else + +@endif + +@else + + + + +@endif + +@endpush + +@push('linkstack-body-start') +@if(theme('enable_custom_code') == "true" and theme('enable_custom_body') == "true" and env('ALLOW_CUSTOM_CODE_IN_THEMES') == 'true')@include($GLOBALS['themeName'] . '.extra.custom-body')@endif + +@if($info->theme != '' and $info->theme != 'default') + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +@endif +@endpush + +@push('linkstack-body-end') +@if(theme('enable_custom_code') == "true" and theme('enable_custom_body_end') == "true" and env('ALLOW_CUSTOM_CODE_IN_THEMES') == 'true')@include($GLOBALS['themeName'] . '.extra.custom-body-end')@endif +@endpush \ No newline at end of file diff --git a/resources/views/littlelink.blade.php b/resources/views/littlelink.blade.php deleted file mode 100644 index 4e5a9e3..0000000 --- a/resources/views/littlelink.blade.php +++ /dev/null @@ -1,349 +0,0 @@ - - - -@include('layouts.lang') - - - -{{-- Fediverse rel="me" links --}} -@php - $relMe = "mastodon, firefish, streams"; - $relMeList = explode(', ', $relMe); -@endphp - -@foreach($links as $link) - @if(in_array($link->name, $relMeList)) - - @endif -@endforeach - - - -@foreach($information as $info) @php $GLOBALS['themeName'] = $info->theme; @endphp @endforeach - -@if(theme('enable_custom_code') == "true" and theme('enable_custom_head') == "true" and env('ALLOW_CUSTOM_CODE_IN_THEMES') == 'true')@include($GLOBALS['themeName'] . '.extra.custom-head')@endif - -@include('layouts.analytics') - - @if(config('advanced-config.linkstack_title') != '' and env('HOME_URL') === '') - {{ $userinfo->name }} {{ config('advanced-config.linkstack_title') }} - @elseif(env('CUSTOM_META_TAGS') == 'true' and config('advanced-config.title') != '') - {{ config('advanced-config.title') }} - @elseif(env('HOME_URL') != '') - {{ $userinfo->name }} - @else - {{ $userinfo->name }} 🔗 {{ config('app.name') }} - @endif - -@if(env('CUSTOM_META_TAGS') == 'true') - @include('layouts.meta') -@else - - - -@endif - -@if(theme('allow_custom_background') != "false") -@php -$customBackgroundFile = findBackground($userinfo->id); -$customBackgroundPath = base_path('assets/img/background-img/'.$customBackgroundFile); -$customBackgroundURL = url('assets/img/background-img/'.$customBackgroundFile); -$customBackgroundExists = file_exists($customBackgroundPath); -if($customBackgroundExists == true){ - $customBackgroundBrightness = analyzeImageBrightness($customBackgroundFile); - } else { - $customBackgroundBrightness = false;} -@endphp - -@if($customBackgroundExists == true) - -@endif -@endif - - - - - - - - - - @if(file_exists(base_path(findAvatar($userinfo->id)))) - - @elseif(file_exists(base_path("assets/linkstack/images/").findFile('avatar'))) - - @else - - @endif - - - - - - - - @if(file_exists(base_path(findAvatar($userinfo->id)))) - - @elseif(file_exists(base_path("assets/linkstack/images/").findFile('avatar'))) - - @else - - @endif - - - - - {{-- --}} - - - @include('layouts.fonts') - - - @if(file_exists(base_path("assets/linkstack/images/").findFile('favicon'))) - - @else - - @endif - -@foreach($information as $info) -@if($info->theme != '' and $info->theme != 'default') - - - - - - - - @if(theme('use_default_buttons') == "true") - - @else - - @endif - -@if(file_exists(base_path('themes/' . $info->theme . '/animations.css'))) - -@else - -@endif - -@else - - - - -@endif - - - - -@if(theme('enable_custom_code') == "true" and theme('enable_custom_body') == "true" and env('ALLOW_CUSTOM_CODE_IN_THEMES') == 'true')@include($GLOBALS['themeName'] . '.extra.custom-body')@endif - -@if($info->theme != '' and $info->theme != 'default') - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -@endif - -@include('components.favicon') -@include('components.favicon-extension') - - - -@if(config('advanced-config.display_share_button') != '') - - @if(config('advanced-config.display_share_button') == 'false') - - @elseif(config('advanced-config.display_share_button') == 'user') - @if($littlelink_names = Auth::user()->littlelink_name) - - @else - - @endif - @else - - @endif - -@else - - -@endif - -id, 'disable-sharebtn') != "true"){$DisplayShowShrBtn = true;}else{$DisplayShowShrBtn = false;} ?> - -@if($DisplayShowShrBtn == true)@endif - - - -@if($DisplayShowShrBtn == true) - -@endif - - - -@include('components.report-icon') - -
-
-
- - @if(file_exists(base_path(findAvatar($userinfo->id)))) - avatar - @elseif(file_exists(base_path("assets/linkstack/images/").findFile('avatar'))) - avatar - @else - avatar - @endif - - -

{{ $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)@include('components.verify-svg')@endif

- - - -

@if(env('ALLOW_USER_HTML') === true){!! $info->littlelink_description !!}@else{{ $info->littlelink_description }}@endif

- - - @php $icons = DB::table('links')->where('user_id', $userinfo->id)->where('button_id', 94)->get(); @endphp - @if(count($icons) > 0) - - @endif - - @endforeach - - - @php $initial = 1; @endphp - - @foreach($links as $link) - @php $linkName = str_replace('default ','',$link->title) @endphp - @switch($link->name) - @case('icon') - @break - @case('phone') - - @break - @case('default email') - @case('default email_alt') - - @break - @case('buy me a coffee') - - @break - @case('space') - @php $title = $link->title; if (is_numeric($title)) { echo str_repeat("
", $title < 10 ? $title : 10); } else { echo "


"; } @endphp - @break - @case('heading') -

{{ $link->title }}

- @break - @case('text') -
@if(env('ALLOW_USER_HTML') === true){!! $link->title !!}@else{{ $link->title }}@endif
- @break - @case('vcard') - - @break - @case('custom') - @if($link->custom_css === "" or $link->custom_css === "NULL" or (theme('allow_custom_buttons') == "false")) - - @break - @elseif($link->custom_css != "") - - @break - @endif - @case('custom_website') - @if($link->custom_css === "" or $link->custom_css === "NULL" or (theme('allow_custom_buttons') == "false")) - - @break - @elseif($link->custom_css != "") - - @break - @endif - @default - $value) { if($newLinkName == $key) { $newLinkName = $value; $isNewName = "true"; }} ?> - - @endswitch - @endforeach - - @include('layouts.footer') - -
-
-
- -@if(theme('enable_custom_code') == "true" and theme('enable_custom_body_end') == "true" and env('ALLOW_CUSTOM_CODE_IN_THEMES') == 'true')@include($GLOBALS['themeName'] . '.extra.custom-body-end')@endif - - -