Skip to content

Commit f189d83

Browse files
committed
Added new social icons
+ bugfix
1 parent 42d2fab commit f189d83

File tree

3 files changed

+33
-46
lines changed

3 files changed

+33
-46
lines changed

app/Http/Controllers/UserController.php

Lines changed: 17 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -359,37 +359,7 @@ public function showLinks()
359359
$userId = Auth::user()->id;
360360
$data['pagePage'] = 10;
361361

362-
$data['links'] = Link::select('id', 'link', 'title', 'order', 'click_number', 'up_link', 'links.button_id')->where('user_id', $userId)->orderBy('up_link', 'asc')->orderBy('order', 'asc')->paginate(10);
363-
return view('studio/links', $data);
364-
}
365-
366-
//Show link, 20
367-
public function showLinks20()
368-
{
369-
$userId = Auth::user()->id;
370-
$data['pagePage'] = 20;
371-
372-
$data['links'] = Link::select('id', 'link', 'title', 'order', 'click_number', 'up_link', 'links.button_id')->where('user_id', $userId)->orderBy('up_link', 'asc')->orderBy('order', 'asc')->paginate(20);
373-
return view('studio/links', $data);
374-
}
375-
376-
//Show link, 30
377-
public function showLinks30()
378-
{
379-
$userId = Auth::user()->id;
380-
$data['pagePage'] = 30;
381-
382-
$data['links'] = Link::select('id', 'link', 'title', 'order', 'click_number', 'up_link', 'links.button_id')->where('user_id', $userId)->orderBy('up_link', 'asc')->orderBy('order', 'asc')->paginate(30);
383-
return view('studio/links', $data);
384-
}
385-
386-
//Show link, all
387-
public function showLinksAll()
388-
{
389-
$userId = Auth::user()->id;
390-
$data['pagePage'] = 0;
391-
392-
$data['links'] = Link::select('id', 'link', 'title', 'order', 'click_number', 'up_link', 'links.button_id')->where('user_id', $userId)->orderBy('up_link', 'asc')->orderBy('order', 'asc')->paginate(10000000000);
362+
$data['links'] = Link::select('id', 'link', 'title', 'order', 'click_number', 'up_link', 'links.button_id')->where('user_id', $userId)->orderBy('up_link', 'asc')->orderBy('order', 'asc')->paginate(99999);
393363
return view('studio/links', $data);
394364
}
395365

@@ -757,6 +727,22 @@ function saveIcon($icon, $link){
757727

758728
saveIcon('linkedin', $request->linkedin);
759729

730+
saveIcon('tiktok', $request->tiktok);
731+
732+
saveIcon('discord', $request->discord);
733+
734+
saveIcon('youtube', $request->youtube);
735+
736+
saveIcon('snapchat', $request->snapchat);
737+
738+
saveIcon('reddit', $request->reddit);
739+
740+
saveIcon('pinterest', $request->pinterest);
741+
742+
saveIcon('telegram', $request->telegram);
743+
744+
saveIcon('whatsapp', $request->whatsapp);
745+
760746

761747

762748

resources/views/studio/links.blade.php

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,6 @@
44

55
<?php use App\Models\Button; ?>
66

7-
@if(Request::is('studio/links/10'))
8-
@php setcookie("LinkCount", "10", time()+60*60*24*5, "/"); @endphp
9-
@elseif(Request::is('studio/links/20'))
10-
@php setcookie("LinkCount", "20", time()+60*60*24*5, "/"); @endphp
11-
@elseif(Request::is('studio/links/30'))
12-
@php setcookie("LinkCount", "30", time()+60*60*24*5, "/"); @endphp
13-
@elseif(Request::is('studio/links/all'))
14-
@php setcookie("LinkCount", "all", time()+60*60*24*5, "/"); @endphp
15-
@endif
16-
177
@push('sidebar-stylesheets')
188
<script src="{{ asset('studio/external-dependencies/fontawesome.js') }}" crossorigin="anonymous"></script>
199
<link rel="stylesheet" href="{{ asset('studio/external-dependencies/fontawesome.css') }}" />
@@ -38,7 +28,6 @@
3828

3929
<?php function strp($urlStrp){return str_replace(array('http://', 'https://'), '', $urlStrp);} ?>
4030

41-
<div style="text-align: right;"><a href="{{ url('/studio/links') }}/10">10</a> | <a href="{{ url('/studio/links') }}/20">20</a> | <a href="{{ url('/studio/links') }}/30">30</a> | <a href="{{ url('/studio/links') }}/all">all</a></div>
4231
<div class="row">
4332
<section class='pre-left shadow text-gray-400'>
4433
<h3 class="card-header"><i class="bi bi-link-45deg">My Links</i>
@@ -222,6 +211,22 @@ function icon($name, $label){ echo '
222211

223212
{!!icon('linkedin', 'LinkedIn')!!}
224213

214+
{!!icon('tiktok', 'TikTok')!!}
215+
216+
{!!icon('discord', 'Discord')!!}
217+
218+
{!!icon('youtube', 'YouTube')!!}
219+
220+
{!!icon('snapchat', 'Snapchat')!!}
221+
222+
{!!icon('reddit', 'reddit')!!}
223+
224+
{!!icon('pinterest', 'Pinterest')!!}
225+
226+
{!!icon('telegram', 'Telegram')!!}
227+
228+
{!!icon('whatsapp', 'WhatsApp')!!}
229+
225230

226231
<button type="submit" class="mt-3 ml-3 btn btn-info">Save links</button>
227232
</form>

routes/web.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,6 @@
102102
Route::get('/studio/edit-link/{id}', [UserController::class, 'AddUpdateLink'])->name('showLink');
103103
Route::post('/studio/sort-link', [UserController::class, 'sortLinks'])->name('sortLinks');
104104
Route::get('/studio/links', [UserController::class, $LinkPage])->name($LinkPage);
105-
Route::get('/studio/links/10', [UserController::class, 'showLinks'])->name('showLinks');
106-
Route::get('/studio/links/20', [UserController::class, 'showLinks20'])->name('showLinks20');
107-
Route::get('/studio/links/30', [UserController::class, 'showLinks30'])->name('showLinks30');
108-
Route::get('/studio/links/all', [UserController::class, 'showLinksAll'])->name('showLinksAll');
109105
Route::get('/studio/theme', [UserController::class, 'showTheme'])->name('showTheme');
110106
Route::post('/studio/theme', [UserController::class, 'editTheme'])->name('editTheme');
111107
Route::get('/deleteLink/{id}', [UserController::class, 'deleteLink'])->name('deleteLink');

0 commit comments

Comments
 (0)