Zen Cart Logo
Forums / General Questions / Add a members only area

Add a members only area

Locked

Views: 2,078

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
26 Apr 2007, 6:00 PM
#1
jdl avatar

jdl

New Zenner

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

Add a members only area

Our members can have access to our premium podcasts. Thus, I'd like to add a members only area. Since the members will use zencart to purchase their memberships, I wanted to place the code under the store.

The members area needs to have dynamic pages that display a list of the latest premium podcasts taken from the database. Thus, these changes don't seem like a candidate for ezpages?

I think that it would possible to create these pages by cloning an existing includes/modules/pages directory such as account_history and then modifying the files in that directory, adding the new pages to filenames.php, anything else? However, I'm not sure how to handle the MODIFY code such as at the end of the pages there's the line:

$zco_notifier->notify('NOTIFY_HEADER_END_CHECKOUT_SUCCESS');

I can add the line for my new module:
$zco_notifier->notify('NOTIFY_HEADER_END_MEMBERS');

but where do I add the code to tell it what to do when that page is finished?

Also, I'd like to add a _SESSION variable of when the membership expires when the user logs in. Do zen developers forsee any problems of adding _SESSION variables (as long as they don't conflict with existing _SESSION variables)?

Is there a better way of doing what I want to do?

Thanks,
jdl

28 Apr 2007, 8:17 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Add a members only area

You're on the right track. I don't see any wrong assumptions there.

You'll likely benefit from reading the "program flow documentation" contribution in the downloads section esp to understand how modules/pages files relate to template files, as well as various developer references in the wiki.

Also, studying the "about_us" contribution will give you a quick reference of which files work together to constitute a new "page" in Zen Cart.

28 Apr 2007, 12:37 PM
#3
jdl avatar

jdl

New Zenner

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

Re: Add a members only area

Dr. Byte,

Thank you very much for your response!

I'm glad that you mentioned the documentation. I found a document that describes exactly what to do:

http://www.zen-cart.com/archived_contributions/documentation/how_to_add_a_page_to_your_website.pdf

Do you mind posting the link to the program flow documentation? I couldn't find it.

Thank you,

jdl

28 Apr 2007, 7:37 PM
#4
jdl avatar

jdl

New Zenner

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

Re: Add a members only area

Dear Dr. Byte,

It appears that the architecture has changed a little since the about us pages were added.

When I run my header_php.php file for my members pages, I get this error message:

Fatal error: Call to a member function notify() on a non-object in ..\store\includes\modules\pages\members\header_php.php on line 12

That line is:

$zco_notifier->notify('NOTIFY_HEADER_START_MEMBERS');

I did a search for NOTIFY_HEADER and it appears that this line is called at the beginning of each modules page's php_header.php file.

Do you know what might be causing that error?

Thanks,

jdl

28 Apr 2007, 10:24 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Add a members only area

As I doubt you'll be using the notifier subsystem on those pages in the early stages, you could just leave out the $zco_notifier->.... lines at top and bottom of the page ... for now anyway.

29 Apr 2007, 4:09 AM
#7
jdl avatar

jdl

New Zenner

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

Re: Add a members only area

Thank you again! Commenting out the 2 lines did the trick.

Thanks also for the link to the documents!

jdl

3 May 2007, 1:37 PM
#8
jdl avatar

jdl

New Zenner

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

Re: Add a members only area

Dear Sensei,

I think I've reached the point where I need a few pointers on how the zco_notifier works.

Each week we release new member files. On the main members page, I'll display a list of categories. When the user selects a category and presses the submit button, I'll call the same page with a query string such as

https://www.edufone.com/store/index.php?main_page=members?pod=B15

However, this is just bouncing the user to the store/index.php page. I've looked at the program flow 1.3.x document (this latest version? ). It has a lot of helpful information but I didn't find anything that would help me figure out how the post mechanism is working.

Thanks again,

jdl

3 May 2007, 1:46 PM
#9
jdl avatar

jdl

New Zenner

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

Re: Add a members only area

I just realized that I can probably do what I want with the zen_redirect(zen_href_link()); mechanism.

jdl