Change theme when logged in Change theme when logged in
 

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

Change theme when logged in

Started by nickelas, June 22, 2011, 10:51:44 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

nickelas

I want to use a different theme when the user has logged in.
I found this old link that describes how to change the theme if the user is on a wii

So I guess you can check if (USER_ID) and then set $USER['theme']? Is it possible to do that in theme.php?

http://uppsalafoto.se/galleri/
Human

Αndré

Quote from: nickelas on June 22, 2011, 10:51:44 AM
Is it possible to do that in theme.php?
Might be possible, but then the theme will not change immediately after login, but one page load later. Don't forget the else block so the theme will be switched back to your default theme after logout.

nickelas

Thanks,
I put the code in the section
theme_html_picture
and it works, but only after visiting an intermediate page. So better to put it on the index-page since that is where you go after logging in. I tried it in
theme_display_album_list
but then nothing happens. Any hint on what can go wrong?

if (USER_ID){
$USER['theme'] = 'customtheme';
}
Human

Αndré

I suggest to put it 'directly' into your theme.php file (i.e. in no function). I haven't tested that, but it should work.

nickelas

Human