How to redirect user after login How to redirect user after login
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

How to redirect user after login

Started by WBL, September 11, 2007, 06:29:35 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

WBL

How to automatically redirect the user to "My gallery" View [index.php?cat=10010] after login?

Searched the forum but couldnt find a thread which diverts me to the thumbnail view, but i woild like the logged in user to be redirected to his own Gallery

Thanks a lot

Sami

#1
Edit login.php and add this

        $referer = 'index.php?cat=1000'.$USER_DATA['user_id'];        //Mod redirect user to his/her own gallery

to line #39 after this

        $referer=preg_replace("'&'","&",$referer);


This will redirect logged in user to his/her own gallery

Edit : use Nibbler's code instead of this
‍I don't answer to PM with support question
Please post your issue to related board

WBL


Nibbler

Won't work for long. Should read as follows.


$referer = 'index.php?cat=' . (10000 + $USER_DATA['user_id']);        //Mod redirect user to his/her own gallery

Sami

I was sleepy :)
@Nibbler:Indeed you are correct , thanks for pointing that out

@ritson : Please use Nibbler's code cause there is an user_id limit with my code , it's only working with user_id < 10 and other users with user_id more than 9 will see the error message
‍I don't answer to PM with support question
Please post your issue to related board

WBL

Hi Thanks a lot for the support, I have corrected the code..