Results 1 to 10 of 21

Hybrid View

  1. #1
    Join Date
    Apr 2007
    Posts
    5
    Plugin Contributions
    0

    Default Member only EZ-Pages

    Is there a way to make some EZ-Pages for logged in members only whilst some are available for guests?

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Member only EZ-Pages

    This is not a built in feature to EZ-Pages at this time ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Apr 2007
    Posts
    5
    Plugin Contributions
    0

    Default Re: Member only EZ-Pages

    Possibly something the Zen-Cart team could work on for a future version. I am sure it couldnt be too hard.

    Is there a way to make ALL ez-pages for members only (not half and half). If not I will just have to put the information in as a free download I guess.

    Cheers,
    Alex

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Member only EZ-Pages

    You could customize the /includes/pages/page to not allow access unless logged in ...

    I am not sure how obnoxious it might be ...

    Change the code in the header_php.php file from this:
    PHP Code:
    // This should be first line of the script:
    $zco_notifier->notify('NOTIFY_HEADER_START_EZPAGE'); 
    to read this:
    PHP Code:
    // This should be first line of the script:
    $zco_notifier->notify('NOTIFY_HEADER_START_EZPAGE');

    // if the customer is not logged on, redirect them to the login page
    if (!$_SESSION['customer_id']) {
      
    $_SESSION['navigation']->set_snapshot();
      
    zen_redirect(zen_href_link(FILENAME_LOGIN'''SSL'));

    Now when a link is clicked on to go to one of the pages the customer has to login ...

    NOTE: the spiders cannot login to read anything now ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Apr 2007
    Posts
    5
    Plugin Contributions
    0

    Default Re: Member only EZ-Pages

    Thanks for that, I might give it a go.

  6. #6
    Join Date
    Apr 2007
    Posts
    5
    Plugin Contributions
    0

    Default Re: Member only EZ-Pages

    For someone who might see this page looking for a similar fix, I just made my Documents side box available only to members. All I did was this:

    Put
    [FONT=Courier New]if ($_SESSION['customer_id']) {[/FONT]
    [FONT=Courier New]CODE FROM SIDEBOX FILE[/FONT]
    [FONT=Courier New]}[/FONT]
    [FONT=Courier New][/FONT]
    [FONT=Courier New]Works nicely in my situation[/FONT]

  7. #7
    Join Date
    Feb 2007
    Location
    Dallas area
    Posts
    76
    Plugin Contributions
    0

    Default Re: Member only EZ-Pages

    Quote Originally Posted by Ajeh View Post
    PHP Code:
    // This should be first line of the script:
    $zco_notifier->notify('NOTIFY_HEADER_START_EZPAGE');

    // if the customer is not logged on, redirect them to the login page
    if (!$_SESSION['customer_id']) {
      
    $_SESSION['navigation']->set_snapshot();
      
    zen_redirect(zen_href_link(FILENAME_LOGIN'''SSL'));

    Would it be possible to expand that 'if' statement to include specific ez-page id's? For instance, I want id's 7-12, 15 and 16 to be password protected. All other pages wouldn't need to be.

  8. #8
    Join Date
    Feb 2007
    Location
    Dallas area
    Posts
    76
    Plugin Contributions
    0

    Idea or Suggestion Re: Member only EZ-Pages

    Seek (along with some trial and error) and ye shall find!

    Here's what seems to work for my "would it be possible" question above.

    In 'includes/modules/pages/page/header_php.php' look for the following code around line 22:
    Code:
    $ezpage_id = (int)$_GET['id'];
    if ($ezpage_id == 0) zen_redirect(zen_href_link(FILENAME_DEFAULT));
    Right after that code paste this:
    Code:
    // if you want certain ez-pages accessed by members only, redirect them to the login page
    if (($ezpage_id == 5 || $ezpage_id == 6 || $ezpage_id == 10 || $ezpage_id == 14) && !$_SESSION['customer_id']) {
      $_SESSION['navigation']->set_snapshot();
      zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
    }
    In this case, the ez-pages with id's 5,6,10, & 14 will be redirected to the login page. All other ez-pages will go straight to the page. If you need other pages, you'll have to remember to come back and add them manually. This could also be modified to redirect to just about any ZC page that you have. Just change the zen_href_link() to suit your needs.

    I'm open to suggestions/corrections to this code since I'm no PHP programmer. Maybe this could be added in the next version so that it's controllable through 'admin/configuration/ez-pages settings' similar to where you have control of disabling headers, footers, and columns?

 

 

Similar Threads

  1. Member Only - With a twist
    By TecBrat in forum General Questions
    Replies: 1
    Last Post: 7 Jan 2010, 10:15 PM
  2. Show member price on login only?
    By elvinhau in forum General Questions
    Replies: 6
    Last Post: 10 Dec 2009, 10:43 AM
  3. Replies: 1
    Last Post: 25 Feb 2009, 02:33 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR