Page 1 of 4 123 ... LastLast
Results 1 to 10 of 33
  1. #1
    Join Date
    Nov 2008
    Posts
    69
    Plugin Contributions
    0

    Default Sidebox Visible to Logged in Members Only

    I have already tried the tutorial located at: https://www.zen-cart.com/tutorials/i...hp?article=279, but can not get this to work for the "Information" or "More-Information" sideboxes.

    I am assuming the these must also be turned on Left or Right in the Layout Boxes area, but do they need to be turned on for Single Column also?

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

    Default Re: Sidebox Visible to Logged in Members Only

    You need to "clone" the method of using the code to fix the settings of the sidebox you are working with ...

    /includes/modules/sideboxes/information.php

    Can be customized using the code:
    Code:
    <?php
    /**
     * information sidebox - displays list of general info links, as defined in this file
     *
     * @package templateSystem
     * @copyright Copyright 2003-2006 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: information.php 4132 2006-08-14 00:36:39Z drbyte $
     */
    
      unset($information);
    
    // test if box should display
      $show_information= false;
    
    // test if box should display based on customer is logged in
      if (!$_SESSION['customer_id']) {
        $show_information= false;
      } else {
        $show_information= true;
      }
      
      if ($show_information == true) {
    
      if (DEFINE_SHIPPINGINFO_STATUS <= 1) {
        $information[] = '<a href="' . zen_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a>';
      }
      if (DEFINE_PRIVACY_STATUS <= 1) {
        $information[] = '<a href="' . zen_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a>';
      }
      if (DEFINE_CONDITIONS_STATUS <= 1) {
        $information[] = '<a href="' . zen_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a>';
      }
      if (DEFINE_CONTACT_US_STATUS <= 1) {
        $information[] = '<a href="' . zen_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a>';
      }
    
    // Forum (phpBB) link:
      if ( (isset($phpBB->phpBB['db_installed_config']) && $phpBB->phpBB['db_installed_config']) && (isset($phpBB->phpBB['files_installed']) && $phpBB->phpBB['files_installed'])  && (PHPBB_LINKS_ENABLED=='true')) {
        $information[] = '<a href="' . zen_href_link($phpBB->phpBB['phpbb_url'] . FILENAME_BB_INDEX, '', 'NONSSL', false, '', true) . '" target="_blank">' . BOX_BBINDEX . '</a>';
    // or: $phpBB->phpBB['phpbb_url'] . FILENAME_BB_INDEX
    // or: str_replace(str_replace(DIR_WS_CATALOG, '', DIR_FS_CATALOG), '', DIR_WS_PHPBB)
      }
    
      if (DEFINE_SITE_MAP_STATUS <= 1) {
        $information[] = '<a href="' . zen_href_link(FILENAME_SITE_MAP) . '">' . BOX_INFORMATION_SITE_MAP . '</a>';
      }
    
      // only show GV FAQ when installed
      if (MODULE_ORDER_TOTAL_GV_STATUS == 'true') {
        $information[] = '<a href="' . zen_href_link(FILENAME_GV_FAQ) . '">' . BOX_INFORMATION_GV . '</a>';
      }
      // only show Discount Coupon FAQ when installed
      if (DEFINE_DISCOUNT_COUPON_STATUS <= 1 && MODULE_ORDER_TOTAL_COUPON_STATUS == 'true') {
        $information[] = '<a href="' . zen_href_link(FILENAME_DISCOUNT_COUPON) . '">' . BOX_INFORMATION_DISCOUNT_COUPONS . '</a>';
      }
    
      if (SHOW_NEWSLETTER_UNSUBSCRIBE_LINK == 'true') {
        $information[] = '<a href="' . zen_href_link(FILENAME_UNSUBSCRIBE) . '">' . BOX_INFORMATION_UNSUBSCRIBE . '</a>';
      }
    
      require($template->get_template_dir('tpl_information.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_information.php');
    
      $title =  BOX_HEADING_INFORMATION;
      $title_link = false;
    
      require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
    }
    ?>
    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!]
    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
    Nov 2008
    Posts
    69
    Plugin Contributions
    0

    Default Re: Sidebox Visible to Logged in Members Only

    Excellent. It works. I just couldn't figure out where to put the code. It wouldn't work correctly, but yours works beautifully!

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

    Default Re: Sidebox Visible to Logged in Members Only

    Thanks for the update that this was able to work for you ...
    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!]
    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
    Nov 2008
    Posts
    69
    Plugin Contributions
    0

    Default Re: Sidebox Visible to Logged in Members Only

    Does this mean that none of the items in that menu will be able to be indexed by search engines? I need these to be absolutely secure from any prying eyes.

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

    Default Re: Sidebox Visible to Logged in Members Only

    Unless the spider has learned to login and can obtain a customers_id then nothing can show ...

    No customers_id is the same as a guest ...

    Have you tested this as a guest and tested this as a logged in customer?
    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!]
    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!

  7. #7
    Join Date
    Nov 2008
    Posts
    69
    Plugin Contributions
    0

    Default Re: Sidebox Visible to Logged in Members Only

    This is the customer's site: www.welslflmilw.com. I have set up a login form. You can test it out with username: jeskremer and password: 022877. After logging in, there is a Volunteers Section menu that pops-up (An overriden "Information" menu).

    Unfortunately each of the newly created Define Pages addresses are able to be placed in the browser bar and can be opened even when not logged in. I am sure that there is a way to do this on the "Information" override, but I can't quite figure it out.

    Here is my current override:

    Code:
    <?php
    /**
     * information sidebox - displays list of general info links, as defined in this file
     *
     * @package templateSystem
     * @copyright Copyright 2003-2006 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: information.php 4132 2006-08-14 00:36:39Z drbyte $
     */
    
      unset($information);
    
    // test if box should display
      $show_information= false;
    
    // test if box should display based on customer is logged in
      if (!$_SESSION['customer_id']) {
        $show_information= false;
      } else {
        $show_information= true;
      }
      
      if ($show_information == true) {
    
      if (DEFINE_MEMBER_INFO_STATUS <= 1) {
    $information[] = '<a href="' . zen_href_link(FILENAME_MEMBER_INFO) . '">' .
    BOX_INFORMATION_MEMBER_INFO. '</a>';
    }
    if (DEFINE_CALENDAR_STATUS <= 1) {
    $information[] = '<a href="' . zen_href_link(FILENAME_CALENDAR) . '">' .
    BOX_INFORMATION_CALENDAR. '</a>';
    }
      if (DEFINE_SHIPPINGINFO_STATUS <= 1) {
        $information[] = '<a href="' . zen_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a>';
      }
      if (DEFINE_PRIVACY_STATUS <= 1) {
        $information[] = '<a href="' . zen_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a>';
      }
      if (DEFINE_CONDITIONS_STATUS <= 1) {
        $information[] = '<a href="' . zen_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a>';
      }
     
      				
    // Forum (phpBB) link:
      if ( (isset($phpBB->phpBB['db_installed_config']) && $phpBB->phpBB['db_installed_config']) && (isset($phpBB->phpBB['files_installed']) && $phpBB->phpBB['files_installed'])  && (PHPBB_LINKS_ENABLED=='true')) {
        $information[] = '<a href="' . zen_href_link($phpBB->phpBB['phpbb_url'] . FILENAME_BB_INDEX, '', 'NONSSL', false, '', true) . '" target="_blank">' . BOX_BBINDEX . '</a>';
    // or: $phpBB->phpBB['phpbb_url'] . FILENAME_BB_INDEX
    // or: str_replace(str_replace(DIR_WS_CATALOG, '', DIR_FS_CATALOG), '', DIR_WS_PHPBB)
      }
    
      if (DEFINE_SITE_MAP_STATUS <= 1) {
        $information[] = '<a href="' . zen_href_link(FILENAME_SITE_MAP) . '">' . BOX_INFORMATION_SITE_MAP . '</a>';
      }
    
      // only show GV FAQ when installed
      if (MODULE_ORDER_TOTAL_GV_STATUS == 'true') {
        $information[] = '<a href="' . zen_href_link(FILENAME_GV_FAQ) . '">' . BOX_INFORMATION_GV . '</a>';
      }
      // only show Discount Coupon FAQ when installed
      if (DEFINE_DISCOUNT_COUPON_STATUS <= 1 && MODULE_ORDER_TOTAL_COUPON_STATUS == 'true') {
        $information[] = '<a href="' . zen_href_link(FILENAME_DISCOUNT_COUPON) . '">' . BOX_INFORMATION_DISCOUNT_COUPONS . '</a>';
      }
    
      if (SHOW_NEWSLETTER_UNSUBSCRIBE_LINK == 'true') {
        $information[] = '<a href="' . zen_href_link(FILENAME_UNSUBSCRIBE) . '">' . BOX_INFORMATION_UNSUBSCRIBE . '</a>';
      }
    
      require($template->get_template_dir('tpl_information.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_information.php');
    
      $title =  BOX_HEADING_INFORMATION;
      $title_link = false;
    
      require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
    }
    ?>

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

    Default Re: Sidebox Visible to Logged in Members Only

    I cannot get any login to work and create account goes to another site or something ...

    Maybe tomorrow when I am not asleep ...
    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!]
    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!

  9. #9
    Join Date
    Nov 2008
    Posts
    69
    Plugin Contributions
    0

    Default Re: Sidebox Visible to Logged in Members Only

    Oops. I meant [email protected] and 022877

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

    Default Re: Sidebox Visible to Logged in Members Only

    You would want to add a check to the header_php.php for the define page in the:
    /includes/modules/pages/page/header_php.php

    Something like:
    Code:
    // 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'));
      }
    NOTE: this will only control those pages that are using the "page" in the URL meaning:
    index.php?main_page=page
    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!]
    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!

 

 
Page 1 of 4 123 ... LastLast

Similar Threads

  1. sidebox module for logged in users only
    By amat78 in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 21 Apr 2011, 08:19 PM
  2. members only: hiding the products from non members
    By poosk in forum General Questions
    Replies: 2
    Last Post: 18 Nov 2009, 04:17 PM
  3. Sidebox visible- but not accessible unless logged in
    By btolly in forum Basic Configuration
    Replies: 17
    Last Post: 22 Sep 2009, 02:16 PM
  4. Adding products that are only visible to 'club' members?
    By ArtsygalDotNet in forum Setting Up Categories, Products, Attributes
    Replies: 8
    Last Post: 9 Sep 2008, 09:07 PM
  5. Members only can view sidebox
    By misty in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 30 May 2006, 07:45 AM

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