Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2009
    Posts
    206
    Plugin Contributions
    2

    Default Sidebox Customization

    I'm trying to make it so my "Information" Sidebox only shows on my FAQ pages. I used the directions in this link (as well as several others), but to no avail - the stupid thing just won't turn off.

    I've also tried:
    • Deleting my custom files and editing the default ones.
    • Using several different php statements such as
      PHP Code:
      $show_information true;
           if (!
      in_array($current_page_base,explode(",",'faqs_all,faq_info')) ) 
          {
      $show_information false;}
         if (
      $show_information true) { 


    Currently, I'm back to working with my custom files (with the default ones in their original state).

    I would really appreciate it if someone would look at my code and see if there is an error.

    PHP Code:
    <?php
    /** About Us mod
     * 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 $
     */
    // test if box should display
    $show_information true;
      if (
    in_array($current_page_base,explode(",",'faqs_all,faq_info')) ) 
      {
        
    $show_information true;
        }else {
        
    $show_information false;
      }  
    if (
    $show_information true) {
      unset(
    $information);
      if (
    DEFINE_ABOUT_US_STATUS <= 1) {
        
    $information[] = '<a href="' zen_href_link(FILENAME_ABOUT_US) . '">' BOX_INFORMATION_ABOUT_US '</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>';
      }
      if (
    DEFINE_CONTACT_US_STATUS <= 1) {
        
    $information[] = '<a href="' zen_href_link(FILENAME_CONTACT_US) . '">' BOX_INFORMATION_CONTACT '</a>';
      }
        
    $information[] = '<a href="' zen_href_link(FILENAME_CUSTOM_ORDERS) . '">' SIDEBOX_LINK_TEXT_CUSTOM_ORDERS '</a>';
        
    $information[] = '<a href="' zen_href_link(FILENAME_FAQS_ALL) . '">' SIDEBOX_LINK_TEXT_FAQS '</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 <= && 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_defaultDIR_WS_TEMPLATE$current_page_base,'common') . '/' $column_box_default);
    }
      
    ?>
    Thanks in advance.

  2. #2
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,705
    Plugin Contributions
    12

    Default Re: Sidebox Customization

    In this case, It might be simpler to use the stylesheet to turn off the Information box and create a stylesheet for the FAQ page that enables it.

    Just another thought.
    A little help with colors.
    myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
    Free SSL & Domain with semi-annual and longer hosting. Updating 1.5.2 and Up.

  3. #3
    Join Date
    Dec 2009
    Posts
    206
    Plugin Contributions
    2

    Default Re: Sidebox Customization

    Thanks! That was a simple, yet effective, solution.

    I REALLY appreciate your help!

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Sidebox Customization

    Just for "information", this statement has an error
    PHP Code:
    if ($show_information true) { 
    the single = sets $show_information to true; you want
    PHP Code:
    if ($show_information == true) { 
    which tests whether $show_information is true.

  5. #5
    Join Date
    Dec 2009
    Posts
    206
    Plugin Contributions
    2

    Default Re: Sidebox Customization

    Ah! So that was the issue. Thank you very much - the coding error was driving me crazy. I like to know what I'm doing wrong so if I need to use that statement again, I won't spend four hours trying to figure out what I'm missing.

    Thanks again!

 

 

Similar Threads

  1. Sidebox Customization
    By autoace in forum Templates, Stylesheets, Page Layout
    Replies: 10
    Last Post: 20 Nov 2010, 05:22 PM
  2. Stuck on sidebox customization
    By Shane78 in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 31 Aug 2009, 10:16 PM
  3. Sidebox customization
    By ctcentralinfo in forum Templates, Stylesheets, Page Layout
    Replies: 25
    Last Post: 28 Jan 2008, 09:21 PM
  4. Sidebox Customization
    By atsdotha in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 6 Sep 2006, 06:21 PM

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