Skip to content

Commit 314701d

Browse files
committed
Fixed changes in merged pull request
1279d47 @MagicLike
1 parent 1279d47 commit 314701d

File tree

4 files changed

+24
-38
lines changed

4 files changed

+24
-38
lines changed

littlelink/icons/mastodon.svg

Lines changed: 2 additions & 4 deletions
Loading

resources/views/layouts/sidebar.blade.php

Lines changed: 15 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -296,29 +296,23 @@ function getUrlSatusCodesb($urlsb, $timeoutsb = 3)
296296
@endif
297297
@endif
298298
@elseif(env('NOTIFY_UPDATES') == 'true' or env('NOTIFY_UPDATES') === 'major' or env('NOTIFY_UPDATES') === 'all')
299-
<?php // Checks if URL exists
300-
try {
301-
function URL_exists(string $urlsb): bool
302-
{
303-
return str_contains(get_headers($urlsb)[0], "200 OK");
304-
}
305-
// Sets $ServerExists to true if URL exists
306-
if (URL_exists("https://julianprieber.github.io/littlelink-custom/version.json")){
307-
$ServerExists = "true";
308-
}
309-
} catch (exception $e) {
310-
$ServerExists = "false";
311-
}
312-
?>
313299
314300
<! –– Checks if file version.json exists AND if version.json exists on server to continue (without this PHP will throw ErrorException ) ––>
315-
@if(file_exists(base_path("version.json")) and $ServerExists == 'true')
301+
@if(file_exists(base_path("version.json")))
316302
317303
<?php // Requests newest version from server and sets it as variable
318-
$Vgit = file_get_contents("https://julianprieber.github.io/littlelink-custom/version.json");
304+
305+
try{
306+
$Vgit = file_get_contents("https://version.littlelink-custom.com/");
319307
320308
// Requests current version from the local version file and sets it as variable
321-
$Vlocal = file_get_contents(base_path("version.json"));
309+
$Vlocal = file_get_contents(base_path("version.json"));
310+
}
311+
312+
catch (Exception $e){
313+
$Vgit = "0";
314+
$Vlocal = "0";
315+
}
322316
?>
323317
324318
<! –– If user has role admin AND newest GitHub release version is higher than the local one an update notice will be displayed ––>
@@ -454,22 +448,10 @@ function copyText(text) {
454448
@endif
455449
456450
<! –– #### begin event detection #### ––>
457-
<?php
458-
try {
459-
function URL_event_exists(string $urlsb): bool
460-
{
461-
return str_contains(get_headers($urlsb)[0], "200 OK");
462-
}
463-
if (URL_event_exists("https://julianprieber.github.io/littlelink-custom-events/event.json")){
464-
$EventServerExists = "true";
465-
}
466-
} catch (exception $e) {
467-
$EventServerExists = "false";
468-
}
469-
?>
470-
@if(env('NOTIFY_EVENTS') === true and $EventServerExists == 'true')
451+
@if(env('NOTIFY_EVENTS') === true)
471452
<?php
472-
$GetEventJson = file_get_contents("https://julianprieber.github.io/littlelink-custom-events/event.json");
453+
try{
454+
$GetEventJson = file_get_contents("https://event.littlelink-custom.com/");
473455
$EventJson = json_decode($GetEventJson, true);
474456
if(isset($_COOKIE['HideEvent']) == NULL) {
475457
setcookie("HideEvent",$_COOKIE['ID'] = "0", time()+60*60*24*5, "/");
@@ -504,6 +486,7 @@ function URL_event_exists(string $urlsb): bool
504486
}
505487
</script>
506488
@endif
489+
<?php } catch (Exception $e){} ?>
507490
@endif
508491
<! –– #### end event detection #### ––>
509492
@yield('content')

resources/views/littlelink.blade.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,11 @@ function themeAsset($path){
9595
<meta name="designer" href="{{ url('') . "/theme/@" . $littlelink_name}}" content="{{ url('') . "/theme/@" . $littlelink_name}}">
9696

9797
<link rel="stylesheet" href="themes/{{$info->theme}}/share.button.css">
98+
@if(theme('use_default_buttons') == "true")
99+
<link rel="stylesheet" href="{{ asset('littlelink/css/brands.css') }}">
100+
@else
98101
<link rel="stylesheet" href="themes/{{$info->theme}}/brands.css">
102+
@endif
99103
<link rel="stylesheet" href="themes/{{$info->theme}}/skeleton-auto.css">
100104
@if(file_exists(base_path('themes/' . $info->theme . '/animations.css')))
101105
<link rel="stylesheet" href="<?php echo asset('themes/' . $info->theme . '/animations.css') ?>">
@@ -286,7 +290,8 @@ function get_operating_system() {
286290
@elseif($link->name === "heading")
287291
<h2>{{ $link->title }}</h2>
288292
@else
289-
<div style="--delay: {{ $initial++ }}s" class="button-entrance"><a class="button button-{{ $link->name }} button button-hover icon-hover" rel="noopener noreferrer nofollow" href="{{ route('clickNumber') . '/' . $link->id . '/' . $link->link}}" @if(theme('open_links_in_same_tab') != "true")target="_blank"@endif ><img alt="button-icon" class="icon hvr-icon" src="@if(theme('use_custom_icons') == "true"){{ url('themes/' . $GLOBALS['themeName'] . '/extra/custom-icons')}}/{{$linkName}}{{theme('custom_icon_extension')}} @else{{ asset('\/littlelink/icons\/') . $linkName }}.svg @endif">{{ $link->title }}</a></div>
293+
<?php include base_path('config/button-names.php'); $newLinkName = $linkName; $isNewName = "false"; foreach($buttonNames as $key => $value) { if($newLinkName == $key) { $newLinkName = $value; $isNewName = "true"; } } ?>
294+
<div style="--delay: {{ $initial++ }}s" class="button-entrance"><a class="button button-{{ $link->name }} button button-hover icon-hover" rel="noopener noreferrer nofollow" href="{{ route('clickNumber') . '/' . $link->id . '/' . $link->link}}" @if(theme('open_links_in_same_tab') != "true")target="_blank"@endif ><img alt="button-icon" class="icon hvr-icon" src="@if(theme('use_custom_icons') == "true"){{ url('themes/' . $GLOBALS['themeName'] . '/extra/custom-icons')}}/{{$linkName}}{{theme('custom_icon_extension')}} @else{{ asset('\/littlelink/icons\/') . $linkName }}.svg @endif">@if($isNewName == "true"){{ $newLinkName }}@else{{ ucfirst($newLinkName) }}@endif</a></div>
290295
@endif
291296
@endforeach
292297

storage/templates/advanced-config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105

106106
// The URL prefix is the symbol that comes before a LittleLink URL.
107107
// For example the '@' in 'example.com/@admin'.
108-
// If empty no prefix is required. Use with caution.
108+
// If empty no prefix is required.
109109
'custom_url_prefix' => '+', // The '@' prefix will always work regardless of this setting.
110110

111111

0 commit comments

Comments
 (0)