@@ -84,8 +84,13 @@ public function index()
8484 //Show littlelink page. example => http://127.0.0.1:8000/+admin
8585 public function littlelink (request $ request )
8686 {
87- $ littlelink_name = $ request ->littlelink ;
88- $ id = User::select ('id ' )->where ('littlelink_name ' , $ littlelink_name )->value ('id ' );
87+ if (isset ($ request ->useif )){
88+ $ littlelink_name = User::select ('littlelink_name ' )->where ('id ' , $ request ->littlelink )->value ('littlelink_name ' );
89+ $ id = $ request ->littlelink ;
90+ } else {
91+ $ littlelink_name = $ request ->littlelink ;
92+ $ id = User::select ('id ' )->where ('littlelink_name ' , $ littlelink_name )->value ('id ' );
93+ }
8994
9095 if (empty ($ id )) {
9196 return abort (404 );
@@ -103,39 +108,39 @@ public function littlelink(request $request)
103108 return view ('linkstack.linkstack ' , ['userinfo ' => $ userinfo , 'information ' => $ information , 'links ' => $ links , 'littlelink_name ' => $ littlelink_name ]);
104109 }
105110
106- //Redirect to user page
107- public function userRedirect (request $ request )
111+ //Show littlelink page as home page if set in config
112+ public function littlelinkhome (request $ request )
108113 {
109- $ id = $ request -> id ;
110- $ user = User::select ('littlelink_name ' )->where ('id ' , $ id )->value ('littlelink_name ' );
114+ $ littlelink_name = env ( ' HOME_URL ' ) ;
115+ $ id = User::select ('id ' )->where ('littlelink_name ' , $ littlelink_name )->value ('id ' );
111116
112117 if (empty ($ id )) {
113118 return abort (404 );
114119 }
115120
116- if (empty ($ user )) {
117- return abort (404 );
118- }
121+ $ userinfo = User::select ('id ' , 'name ' , 'littlelink_name ' , 'littlelink_description ' , 'theme ' , 'role ' , 'block ' )->where ('id ' , $ id )->first ();
122+ $ information = User::select ('name ' , 'littlelink_name ' , 'littlelink_description ' , 'theme ' )->where ('id ' , $ id )->get ();
123+
124+ $ 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 ();
119125
120- return redirect ( url ( ' @ ' . $ user ) );
126+ return view ( ' linkstack.linkstack ' , [ ' userinfo ' => $ userinfo , ' information ' => $ information , ' links ' => $ links , ' littlelink_name ' => $ littlelink_name ] );
121127 }
122128
123- //Show littlelink page as home page if set in config
124- public function littlelinkhome (request $ request )
129+ //Redirect to user page
130+ public function userRedirect (request $ request )
125131 {
126- $ littlelink_name = env ( ' HOME_URL ' ) ;
127- $ id = User::select ('id ' )->where ('littlelink_name ' , $ littlelink_name )->value ('id ' );
132+ $ id = $ request -> id ;
133+ $ user = User::select ('littlelink_name ' )->where ('id ' , $ id )->value ('littlelink_name ' );
128134
129135 if (empty ($ id )) {
130136 return abort (404 );
131137 }
132138
133- $ userinfo = User::select ('id ' , 'name ' , 'littlelink_name ' , 'littlelink_description ' , 'theme ' , 'role ' )->where ('id ' , $ id )->first ();
134- $ information = User::select ('name ' , 'littlelink_name ' , 'littlelink_description ' , 'theme ' )->where ('id ' , $ id )->get ();
135-
136- $ 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 ();
139+ if (empty ($ user )) {
140+ return abort (404 );
141+ }
137142
138- return view ( ' linkstack.linkstack ' , [ ' userinfo ' => $ userinfo , ' information ' => $ information , ' links ' => $ links , ' littlelink_name ' => $ littlelink_name ] );
143+ return redirect ( url ( ' @ ' . $ user ) );
139144 }
140145
141146 //Show add/update form
0 commit comments