Forums / General Questions / Different main page when logged in

Different main page when logged in

Views: 636

Results 1 to 6 of 6
2 May 2015, 12:37 PM
#1
digibooks avatar

digibooks

Zen Follower

Join Date:
May 2014
Location:
UK
Posts:
317
Plugin Contributions:
0

Different main page when logged in

Hi

I've done a few searches but cannot find the answer to this little problem.

I want to show a different center main page depending on whether you are logged in or not.

I'm sure it's a really simple thing to do but I'm a bit stuck!

Thanks

2 May 2015, 1:33 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,111
Plugin Contributions:
56

Re: Different main page when logged in

Assuming that you're talking about the main-page content (the define-page), you can edit the define_main_page.php:

<?php
if (!isset ($_SESSION['customer_id'])) {
?>
        [Insert text/HTML for not logged-in customers]
<?php
} else {
?>
        [Insert text/HTML for logged-in customers]
<?php
}
2 May 2015, 2:57 PM
#3
digibooks avatar

digibooks

Zen Follower

Join Date:
May 2014
Location:
UK
Posts:
317
Plugin Contributions:
0

Re: Different main page when logged in

lat9:

Assuming that you're talking about the main-page content (the define-page), you can edit the define_main_page.php:

<?php if (!isset ($_SESSION['customer_id'])) { ?>
    [Insert text/HTML for not logged-in customers]
<?php } else { ?>
    [Insert text/HTML for logged-in customers]
<?php } ``` Wicked ... thank you :smile:
2 May 2015, 3:49 PM
#4
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,111
Plugin Contributions:
56

Re: Different main page when logged in

You're very welcome!

11 Jul 2015, 4:19 PM
#5
knownonesince avatar

knownonesince

New Zenner

Join Date:
Dec 2009
Posts:
22
Plugin Contributions:
0

Re: Different main page when logged in

I tried this in 1.5.4 but it does not work. The main page is now empty. Could it be that in the new version we can not add php code in define_main_page.php?

11 Jul 2015, 5:29 PM
#6
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Different main page when logged in

KnowNoneSince:

I tried this in 1.5.4 but it does not work. The main page is now empty. Could it be that in the new version we can not add php code in define_main_page.php?

Be sure that when/if adding such php code that it is while viewing the source code either through the default text editor or if using something like ck_editor that you have selected the source code button in the toolbar before adding the code.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...