File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,17 @@ function findFile($name){
1111 return $ pathinfo ;
1212}
1313
14+ function findAvatar ($ name ){
15+ $ directory = base_path ('/img ' );
16+ $ files = scandir ($ directory );
17+ $ pathinfo = "error.error " ;
18+ foreach ($ files as $ file ) {
19+ if (strpos ($ file , $ name .'. ' ) !== false ) {
20+ $ pathinfo = "/img/ " . $ name . ". " . pathinfo ($ file , PATHINFO_EXTENSION );
21+ }}
22+ return $ pathinfo ;
23+ }
24+
1425function findBackground ($ name ){
1526 $ directory = base_path ('/img/background-img/ ' );
1627 $ files = scandir ($ directory );
Original file line number Diff line number Diff line change @@ -283,10 +283,8 @@ function get_operating_system() {
283283 <div class =" row" >
284284 <div class =" column" style =" margin-top : 5% " >
285285 <!-- Your Image Here -->
286- @if (file_exists (base_path (" img/" . $userinfo -> id . " .png" )) )
287- <img alt =" avatar" class =" rounded-avatar fadein" src =" {{ asset (" img/" . $userinfo -> id . " .png" ) } }" width =" 128px" height =" 128px" style =" object-fit : cover ;" >
288- @elseif (file_exists (base_path (" littlelink/images/" ). findFile (' avatar' )) )
289- <img alt =" avatar" class =" rounded-avatar fadein" src =" {{ asset (' littlelink/images/' . findFile (' avatar' )) } }" srcset =" {{ asset (' littlelink/images/avatar@2x.png 2x' ) } }" width =" 128px" height =" 128px" style =" object-fit : cover ;" >
286+ @if (file_exists (base_path (findAvatar ($userinfo -> id ))) )
287+ <img alt =" avatar" class =" rounded-avatar fadein" src =" {{ url (findAvatar ($userinfo -> id )) } }" srcset =" {{ asset (' littlelink/images/avatar@2x.png 2x' ) } }" width =" 128px" height =" 128px" style =" object-fit : cover ;" >
290288 @else
291289 <img alt =" avatar" class =" rounded-avatar fadein" src =" {{ asset (' littlelink/images/logo.svg' ) } }" srcset =" {{ asset (' littlelink/images/avatar@2x.png 2x' ) } }" width =" 128px" height =" 128px" style =" object-fit : cover ;" >
292290 @endif
You can’t perform that action at this time.
0 commit comments