@@ -84,8 +84,13 @@ public function index()
84
84
//Show littlelink page. example => http://127.0.0.1:8000/+admin
85
85
public function littlelink (request $ request )
86
86
{
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
+ }
89
94
90
95
if (empty ($ id )) {
91
96
return abort (404 );
@@ -103,39 +108,39 @@ public function littlelink(request $request)
103
108
return view ('linkstack.linkstack ' , ['userinfo ' => $ userinfo , 'information ' => $ information , 'links ' => $ links , 'littlelink_name ' => $ littlelink_name ]);
104
109
}
105
110
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 )
108
113
{
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 ' );
111
116
112
117
if (empty ($ id )) {
113
118
return abort (404 );
114
119
}
115
120
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 ();
119
125
120
- return redirect ( url ( ' @ ' . $ user ) );
126
+ return view ( ' linkstack.linkstack ' , [ ' userinfo ' => $ userinfo , ' information ' => $ information , ' links ' => $ links , ' littlelink_name ' => $ littlelink_name ] );
121
127
}
122
128
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 )
125
131
{
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 ' );
128
134
129
135
if (empty ($ id )) {
130
136
return abort (404 );
131
137
}
132
138
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
+ }
137
142
138
- return view ( ' linkstack.linkstack ' , [ ' userinfo ' => $ userinfo , ' information ' => $ information , ' links ' => $ links , ' littlelink_name ' => $ littlelink_name ] );
143
+ return redirect ( url ( ' @ ' . $ user ) );
139
144
}
140
145
141
146
//Show add/update form
0 commit comments