Example #1
0
function olc_cache_manufacturers_box($auto_expire = false, $refresh = false)
{
    if ($refresh == true || !read_cache($cache_output, 'manufacturers_box-' . SESSION_LANGUAGE . '.cache' . $_GET['manufacturers_id'], $auto_expire)) {
        ob_start();
        include box_code_script_path('manufacturers.php');
        $cache_output = ob_get_contents();
        ob_end_clean();
        write_cache($cache_output, 'manufacturers_box-' . SESSION_LANGUAGE . '.cache' . $_GET['manufacturers_id']);
    }
    return $cache_output;
}
Example #2
0
function olc_cache_categories_box($auto_expire = false, $refresh = false)
{
    global $cPath, $foo, $id, $categories_string;
    if ($refresh == true || !read_cache($cache_output, 'categories_box-' . SESSION_LANGUAGE . '.cache' . $cPath, $auto_expire)) {
        ob_start();
        include box_code_script_path('categories.php');
        $cache_output = ob_get_contents();
        ob_end_clean();
        write_cache($cache_output, 'categories_box-' . SESSION_LANGUAGE . '.cache' . $cPath);
    }
    return $cache_output;
}
if ($use_standard_menue) {
    $s = 'OPEN_ALL_MENUE_LEVELS';
    if (!defined($s)) {
        define($s, FALSE_STRING_S);
    }
    $open_all_menues = OPEN_ALL_MENUE_LEVELS == TRUE_STRING_S;
    //Open all submenues always.
    if (!$build_menu) {
        $build_menu = !$open_all_menues;
    }
    if ($build_menu) {
        $html_blank = array(HTML_NBSP, strtoupper(HTML_NBSP));
        $html_break = array(HTML_BR, strtoupper(HTML_BR), "<p>", "<P>");
        ${$text_break} = "\n ";
        // include needed functions
        require_once box_code_script_path('inc/olc_show_category.inc.php');
        require_once DIR_FS_INC . 'olc_has_category_subcategories.inc.php';
        require_once DIR_FS_INC . 'olc_count_products_in_category.inc.php';
        olc_smarty_init($box_smarty, $cacheid);
        $box_content = EMPTY_STRING;
        $all_categories_string = EMPTY_STRING;
        if (DO_GROUP_CHECK) {
            $group_check = " and c." . SQL_GROUP_CONDITION;
        }
        //W. Kaiser
        $not_open_all_menues = !$open_all_menues;
        $prev_id = 'prev_id';
        $categories_id = 'categories_id';
        $categories_name = 'categories_name';
        $categories_heading_title = 'categories_heading_title';
        $next_id_text = 'next_id';
based on:
(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
(c) 2002-2003 osCommerce(categories.php,v 1.23 2002/11/12); www.oscommerce.com
(c) 2003	    nextcommerce (categories.php,v 1.10 2003/08/17); www.nextcommerce.org
(c) 2004      XT - Commerce; www.xt-commerce.com

Released under the GNU General Public License
-----------------------------------------------------------------------------------------
*/
define('COMMON_TEMPLATE', '');
define('FULL_COMMON_TEMPLATE', TEMPLATE_PATH . COMMON_TEMPLATE);
define('BOXES_DIR', SLASH . 'boxes' . SLASH);
$source = 'source';
define('DIR_WS_BOXES', FULL_CURRENT_TEMPLATE . $source . BOXES_DIR);
define('DIR_WS_BOXES_INC', 'inc' . SLASH);
$s = box_code_script_path('boxes.php');
define('BOXES', str_replace(BOXES_DIR, SLASH, $s));
function box_code_script_path($box)
{
    //Assume to use the 'common' script-path
    $standard_box_path = DIR_WS_BOXES . $box;
    if (CHECK_UNIFIED_BOXES) {
        //Unified boxes
        //$index=str_replace(SLASH,UNDERSCORE,$box);
        //$index=$box;
        $stored_box_code_script_path = $_SESSION[$box];
        if ($stored_box_code_script_path) {
            $box_code_script_path = $stored_box_code_script_path;
        } else {
            //Check if box is available in the individual templates' directory
            //If not, use box the from the common template directory
function getCategoriesArray($basecss, $active_tab)
{
    global $is_ajax_mode, $tab_id_text, $current_template_text, $tab_ajax;
    # read cats form database
    if (DO_GROUP_CHECK) {
        $group_check = " and c." . SQL_GROUP_CONDITION;
    }
    $categories_query = SELECT . "\n\tc.categories_id,\n\tcd.categories_name,\n\tc.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd\n\twhere c.categories_status='1'\n\tand c.parent_id='0'\n\t" . $group_check . "\n\tand c.categories_id=cd.categories_id\n\tand cd.language_id='" . SESSION_LANGUAGE_ID . "'\n\torder by sort_order, cd.categories_name";
    $categories_query = olc_db_query($categories_query);
    $subcat_query0 = TABLE_PREFIX_COMMON . "categories";
    $subcat_query0 = SELECT . "\n\tc.categories_id,\n\tcd.categories_name,\n\tc.parent_id\n\tfrom " . $subcat_query0 . " c, " . $subcat_query0 . "_description cd\n\twhere\n\tc.categories_status='1' and\n\tc.parent_id='#' and\n\tc.categories_id=cd.categories_id and\n\tcd.language_id='" . SESSION_LANGUAGE_ID . "'\n\torder by sort_order,cd.categories_name";
    $tab_id = AMP . $tab_id_text . EQUAL;
    if ($is_ajax_mode) {
        $tab_id = AMP . SID . AMP . $current_template_text . EQUAL . CURRENT_TEMPLATE . AMP . $tab_ajax . EQUAL . TRUE_STRING_S . $tab_id;
        $path = box_code_script_path('tab_navigation.php');
    } else {
        $path = 'index.php';
    }
    $path .= QUESTION . "cPath" . EQUAL;
    $categories_id_text = 'categories_id';
    $categories_name_text = 'categories_name';
    $parent_id_text = 'parent_id';
    $name_text = 'NAME';
    $url_text = 'URL';
    $css_text = 'CSS';
    $main_text = 'main';
    $sub_text = 'sub';
    $key = 0;
    while ($categories = olc_db_fetch_array(&$categories_query, true)) {
        $categories_id = $categories[$categories_id_text];
        # crate main cats
        $css = $key == $active_tab ? $basecss . $key : $basecss;
        $cat_array[$main_text][] = array($name_text => $categories[$categories_name_text], $url_text => $path . $categories_id . $tab_id . $key, $css_text => $css);
        $subcat_query = str_replace(HASH, $categories_id, $subcat_query0);
        $subcat_query = olc_db_query($subcat_query);
        $category_check = olc_db_num_rows(&$subcat_query, true);
        # create sub cats
        if ($category_check > 0) {
            while ($row = olc_db_fetch_array(&$subcat_query, true)) {
                $cat_array[$sub_text][$key][] = array($name_text => $row[$categories_name_text], $url_text => $path . $row[$parent_id_text] . UNDERSCORE . $row[$categories_id_text] . $tab_id . $key);
            }
        }
        $key++;
    }
    return $cat_array;
}
         if ($include_reviews) {
             include $box_reviews;
         }
     }
 }
 if (SHOW_LAST_VIEWED) {
     require $box_last_viewed;
 }
 if ($include_tell_a_friend) {
     include $box_tell_a_friend;
 }
 if ($include_best_sellers) {
     include $box_best_sellers;
 }
 if (LIVE_HELP_ACTIVE === true) {
     include box_code_script_path('livehelp.php');
 }
 if (strpos(CURRENT_SCRIPT, 'checkout_') !== false) {
     if (OL_COMMERCE && CUSTOMER_ID == 0) {
         $current_script = FILENAME_LOGIN;
     } else {
         $current_script = CURRENT_SCRIPT;
     }
     //$step_start_text='step_start';
     $step_start_text = 'class_start';
     olc_smarty_init($box_smarty, $cacheid);
     require_once $inc_path . 'olc_get_smarty_config_variable.inc.php';
     $normal = 'normal';
     $classes = array($normal, $normal, $normal, $normal, $normal);
     $order_step_text_finished = EMPTY_STRING;
     switch ($current_script) {