function execute()
 {
     global $SID, $oscTemplate;
     if (USE_CACHE == 'true' && empty($SID)) {
         $output = tep_cache_categories_box();
     } else {
         $output = $this->getData();
     }
     $oscTemplate->addBlock($output, $this->group);
 }
Beispiel #2
0
<?php

/*
  $Id: column_left.php 1739 2007-12-20 00:52:16Z hpdl $

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

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/
if (USE_CACHE == 'true' && empty($SID)) {
    echo tep_cache_categories_box();
} else {
    include DIR_WS_BOXES . 'categories.php';
}
if (USE_CACHE == 'true' && empty($SID)) {
    echo tep_cache_manufacturers_box();
} else {
    include DIR_WS_BOXES . 'manufacturers.php';
}
require DIR_WS_BOXES . 'whats_new.php';
require DIR_WS_BOXES . 'search.php';
require DIR_WS_BOXES . 'information.php';
Beispiel #3
0
function tep_get_module_in_infopage($text)
{
    global $languages_id;
    if (strstr($text, '[box]')) {
        $text = str_replace('<p>', '', $text);
        $text = str_replace('</p>', '', $text);
        $text = trim($text);
        $content = '';
        foreach (explode('[box]', $text) as $group) {
            if (!empty($group)) {
                if (!strstr($group, '[/box]')) {
                    $content .= $group;
                } else {
                    foreach (explode('[/box]', $group) as $sub_group) {
                        $thisblockcontent = '';
                        if (!strstr($sub_group, '.php')) {
                            $content .= $sub_group;
                        } else {
                            ob_start();
                            if (USE_CACHE == 'true' && empty($SID)) {
                                if ($sub_group == 'categories.php') {
                                    echo tep_cache_categories_box();
                                } elseif ($sub_group == 'manufacturers.php') {
                                    echo tep_cache_manufacturers_box();
                                } else {
                                    include 'includes/boxes/' . $sub_group;
                                }
                            } else {
                                include 'includes/boxes/' . $sub_group;
                            }
                            $thisblockcontent = ob_get_contents();
                            ob_end_clean();
                        }
                        if (!empty($thisblockcontent)) {
                            $content .= '<div class="box ' . str_replace('.php', '', $sub_group) . '">' . $thisblockcontent . '</div>';
                        }
                    }
                }
            }
        }
        $text = $content;
    } else {
        $text = $text;
    }
    echo $text;
}
Beispiel #4
0
function tep_get_module($block, $replace_space = true)
{
    global $languages_id, $sts, $currencies, $cart;
    $page = str_replace(DIR_WS_HTTP_CATALOG, '', $_SERVER['PHP_SELF']);
    if ($page == 'index.php' && (isset($_GET['cPath']) || isset($_GET['manufacturers_id']))) {
        $page = 'blablabla';
    }
    $limit_query = " AND (m.elements LIKE '%;i_" . $_GET['page'] . ";%' OR m.elements LIKE '%;p_" . $_GET['products_id'] . ";%' OR m.elements LIKE '%;" . $page . ";%' OR m.elements = ';' OR m.elements = '')";
    $get_module_query = tep_db_query("SELECT m.modules_id, mt.modules_title, mt.modules_description FROM modules m JOIN modules_text mt USING (modules_id) WHERE m.modules_status = '1'" . $limit_query . " AND m.block = '" . $block . "' AND mt.language_id = '" . (int) $languages_id . "' ORDER BY m.sort_order");
    while ($get_module = tep_db_fetch_array($get_module_query)) {
        /*language fallback*/
        if (LANGUAGE_FALLBACK == 'true' && $get_module['modules_description'] == '') {
            $language_fallback_query = tep_db_query("select modules_description from modules_text where modules_id = '" . (int) $get_module['modules_id'] . "' and language_id = '1'");
            $language_fallback = tep_db_fetch_array($language_fallback_query);
            $get_module['modules_description'] = $language_fallback['modules_description'];
        }
        /*language fallback*/
        if ($replace_space == true) {
            $get_module['modules_description'] = str_replace('&nbsp;', ' ', $get_module['modules_description']);
        }
        if ($get_module['modules_description'] == '<br />') {
            $get_module['modules_description'] = '';
        }
        $text = tep_infopage_to_seourls($get_module['modules_description']);
        if (strstr($text, '[box]')) {
            $text = str_replace('<p>', '', $text);
            $text = str_replace('</p>', '', $text);
            $text = trim($text);
            preg_match_all('/\\[box\\]([^\\[]*)\\[\\/box\\]/', $text, $matches);
            foreach ($matches[0] as $modulekey => $modulevalue) {
                $content = '';
                ob_start();
                if (USE_CACHE == 'true' && empty($SID)) {
                    if ($matches[1][$modulekey] == 'categories.php') {
                        echo tep_cache_categories_box();
                    } elseif ($matches[1][$modulekey] == 'manufacturers.php') {
                        echo tep_cache_manufacturers_box();
                    } else {
                        include DIR_FS_CATALOG . 'includes/boxes/' . $matches[1][$modulekey];
                    }
                } else {
                    include DIR_FS_CATALOG . 'includes/boxes/' . $matches[1][$modulekey];
                }
                $thisblockcontent = ob_get_contents();
                ob_end_clean();
                if ($matches[1][$modulekey] == 'compare.php') {
                    if (PRODUCT_COMPARE == 'true' && ($_GET['cPath'] || strstr($_SERVER['PHP_SELF'], FILENAME_PRODUCT_INFO))) {
                        $content = $thisblockcontent;
                    } else {
                        $content = '';
                    }
                } else {
                    $content = '<div class="box ' . str_replace('.php', '', $matches[1][$modulekey]) . '">' . $thisblockcontent . '</div>';
                }
                $text = str_replace($modulevalue, $content, $text);
            }
        } else {
            if ($text != '') {
                $text = '<div class="box ' . tep_get_module_class($get_module['modules_id']) . '">' . $text . '</div>';
            }
        }
        echo $text;
    }
}