|
62 | 62 | @if($_SERVER['QUERY_STRING'] === 'deleteB' and File::exists(base_path('assets/img/background-img/'.findBackground($user->id))))@php File::delete(base_path('assets/img/background-img/'.findBackground($user->id))); header("Location: ".url()->current()); die(); @endphp @endif
|
63 | 63 | <br>
|
64 | 64 | </div><br>
|
65 |
| - |
66 |
| - <!--<div class="form-group col-lg-8"> |
67 |
| - <label>Littlelink name </label> |
68 |
| - <input type="text" class="form-control" name="littlelink_name" value="{{ $user->id }}"> |
69 |
| - </div>--> |
| 65 | + |
| 66 | + <label>{{__('messages.Select theme')}}</label> |
| 67 | + <div class="form-group col-lg-8"> |
| 68 | + <select id="theme-select" style="margin-bottom: 40px;" class="form-control" name="theme" data-base-url="{{ url('') }}/@<?= Auth::user()->littlelink_name ?>"> |
| 69 | + <?php |
| 70 | + if ($handle = opendir('themes')) { |
| 71 | + while (false !== ($entry = readdir($handle))) { |
| 72 | + if ($entry != "." && $entry != "..") { |
| 73 | + if(file_exists(base_path('themes') . '/' . $entry . '/readme.md')){ |
| 74 | + $text = file_get_contents(base_path('themes') . '/' . $entry . '/readme.md'); |
| 75 | + $pattern = '/Theme Name:.*/'; |
| 76 | + preg_match($pattern, $text, $matches, PREG_OFFSET_CAPTURE); |
| 77 | + if(sizeof($matches) > 0) { |
| 78 | + $themeName = substr($matches[0][0],12); |
| 79 | + } |
| 80 | + } |
| 81 | + if($user->theme != $entry and isset($themeName)){ |
| 82 | + echo '<option value="'.$entry.'" data-image="'.url('themes/'.$entry.'/screenshot.png').'">'.$themeName.'</option>'; |
| 83 | + } |
| 84 | + } |
| 85 | + } |
| 86 | + } |
| 87 | + |
| 88 | + if($user->theme != "default" and $user->theme != ""){ |
| 89 | + if(file_exists(base_path('themes') . '/' . $user->theme . '/readme.md')){ |
| 90 | + $text = file_get_contents(base_path('themes') . '/' . $user->theme . '/readme.md'); |
| 91 | + $pattern = '/Theme Name:.*/'; |
| 92 | + preg_match($pattern, $text, $matches, PREG_OFFSET_CAPTURE); |
| 93 | + $themeName = substr($matches[0][0],12); |
| 94 | + } |
| 95 | + echo '<option value="'.$user->theme.'" data-image="'.url('themes/'.$user->theme.'/screenshot.png').'" selected>'.$themeName.'</option>'; |
| 96 | + } |
| 97 | + |
| 98 | + echo '<option value="default" data-image="'.url('themes/default/screenshot.png').'"'; |
| 99 | + if($user->theme == "default" or $user->theme == ""){ |
| 100 | + echo ' selected'; |
| 101 | + } |
| 102 | + echo '>Default</option>'; |
| 103 | + ?> |
| 104 | + </select> |
| 105 | + </div> |
70 | 106 |
|
71 | 107 | <div class="form-group col-lg-8">
|
72 | 108 | <label>{{__('messages.Page URL')}}</label>
|
|
0 commit comments