<?php
/*
  $Id: column_right.php,v 1.5 2006/07/16 05:09:34 ryu Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
  
  modified for Koshoten.net2
  http://www.koshoten.net/
*/

  if (KN_CFG_USE_COLUMN_RIGHT == 'true') {
    echo '<div id="rightColumn">' . "\n";
    // ログインBOX
    if (KN_CFG_BOX_LOGIN == 1) {
      require(DIR_WS_BOXES . 'login.php');
    }
    // 検索BOX
    if (KN_CFG_BOX_SEARCH == 1) {
      require(DIR_WS_BOXES . 'search.php');
    }
    // 連想検索BOX
    if (KN_CFG_BOX_GETA_SEARCH == 1) {
      require(DIR_WS_BOXES . 'geta_search.php');
    }
    // カテゴリー一覧BOX
    if (KN_CFG_BOX_CATEGORIES == 1) {
      if ( (USE_CACHE == 'true') && !SID ) {
        echo tep_cache_categories_box();
      } else {
        include(DIR_WS_BOXES . 'categories.php');
      }
    }
    // 追加分類の一覧BOX
    if (KN_CFG_BOX_MANUFACTURERS == 1) {
      include(DIR_WS_BOXES . 'manufacturers.php');
    }
    // ショッピングカートBOX
    if (KN_CFG_BOX_SHOPPING_CART == 1) {
      if (defined("KN_CFG_ALLOW_CHECKOUT") && (KN_CFG_ALLOW_CHECKOUT == "false")) {
      } else {
        require(DIR_WS_BOXES . 'shopping_cart.php');
      }
    }
    // GETAテーマBOX
    if (KN_CFG_BOX_GETA_THEMES == 1) {
      require(DIR_WS_BOXES . 'geta_themes.php');
    }
    // 新着商品BOX
    if (KN_CFG_BOX_WHATS_NEW == 1) {
      require(DIR_WS_BOXES . 'whats_new.php');
    }
    // 注文履歴BOX
    if (KN_CFG_BOX_ORDER_HISTORY == 1) {
      if (defined("KN_CFG_ALLOW_CHECKOUT") && (KN_CFG_ALLOW_CHECKOUT == "false")) {
      } else {
        if (tep_session_is_registered('customer_id')) include(DIR_WS_BOXES . 'order_history.php');
      }
    }
    // インフォメーションBOX
    if (KN_CFG_BOX_INFORMATION == 1) {
      require(DIR_WS_BOXES . 'information.php');
    }
    // ベストセラーBOX
    if (KN_CFG_BOX_BEST_SELLERS == 1) {
      if (defined("KN_CFG_ALLOW_CHECKOUT") && (KN_CFG_ALLOW_CHECKOUT == "false")) {
      } else {
        require(DIR_WS_BOXES . 'best_sellers.php');
      }
    }
    if (isset($_GET['products_id'])) {
      // 友だちに知らせるBOX
      if (KN_CFG_BOX_TELL_A_FRIEND == 1) {
        if (basename($PHP_SELF) != FILENAME_TELL_A_FRIEND) include(DIR_WS_BOXES . 'tell_a_friend.php');
      }
    } else {
      // 特価商品BOX
      if (KN_CFG_BOX_SPECIALS == 1) {
        include(DIR_WS_BOXES . 'specials.php');
      }
    }
    // 書評BOX
    if ((KN_CFG_BOX_REVIEWS == 1) && (KN_CFG_USE_REVIEWS == 'true')) {
      require(DIR_WS_BOXES . 'reviews.php');
    }

    if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
      // 言語選択BOX
      if (KN_CFG_BOX_LANGUAGES == 1) {
        include(DIR_WS_BOXES . 'languages.php');
      }
      // 通貨選択BOX
      if (KN_CFG_BOX_CURRENCIES == 1) {
        include(DIR_WS_BOXES . 'currencies.php');
      }
    }
    // お知らせ文面
    $si_column_right_query = tep_db_query("select shop_info_title, shop_info_value, allow_tags from " . TABLE_SHOP_INFO . " where shop_info_key = 'SHOP_INFO_COLUMN_RIGHT'");
    $si_column_right = tep_db_fetch_array($si_column_right_query);
    if (isset($si_column_right['shop_info_value']) && tep_not_null($si_column_right['shop_info_value'])) {
      echo '<div id="sideColumnRight">';
      if ($si_column_right['allow_tags']) {
        echo $si_column_right['shop_info_value'];
      } else {
        echo nl2br(htmlspecialchars($si_column_right['shop_info_value']));
      }
      echo "</div>\n";
    }
    echo "</div>\n";
  }
?>
