Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / EZ Page - Registered Only

EZ Page - Registered Only

Locked

Views: 888

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
22 Mar 2007, 1:01 AM
#1
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

EZ Page - Registered Only

Hey everyone,

Is it possible to make an EZ-Page that is only accessible if you're logged in?

Thanks in advance...

22 Mar 2007, 1:03 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: EZ Page - Registered Only

You would have to re-write the code for this but yes ... this is Zen Cart and anything can be customized to suit ...

22 Mar 2007, 1:28 AM
#3
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

Re: EZ Page - Registered Only

Thanks Ajeh. I'm assuming it has to be some kind of 'if the customer is registered' then show this page. and if not, then show this page.

does that sound right?

if so, i'm wondering what the registered statement would look like. I could probably figure out the rest...

If i'm in the wrong ballpark... ha. wouldn't be surprised.

Thanks again for your help.

22 Mar 2007, 1:39 AM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: EZ Page - Registered Only

You can use:

if (isset($_SESSION['customer_id']) && (int)$_SESSION['customer_id'] > 0) { 
// blah blah
}

This assures it is set and a real value ...

22 Mar 2007, 1:56 AM
#5
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

Re: EZ Page - Registered Only

Thanks Ajeh,

That should more than get me started... I will post the code if I get it all worked out right.

Have a great night.

26 Mar 2007, 2:34 AM
#6
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

Re: EZ Page - Registered Only

Okay, so I got it. My plans had reversed a bit.

Here is the link to take the customer to the contest page if they are logged in, and an ez-page if they are not.

<?php if (isset($_SESSION['customer_id']) && (int)$_SESSION['customer_id'] > 0) { ?>
	<li><a href="<?php echo zen_href_link(FILENAME_MEMBERSHIP_CONTEST, '', 'NONSSL'); ?>"><?php echo ESSAY_CONTEST; ?></a></li>
<?php } else {?>
	<li><a href="<?php echo zen_ez_pages_link(14, '0', false); ?>"><?php echo ESSAY_CONTEST; ?></a></li>
	<?php } ?>

Thanks again, Linda.

Hope this helps someone else out in the future...