• User Attivo

    Unire codice di 2 pagine php in 1

    Salve, mi servirebbe un piccolo aiutino per un pezzo di codice, e di una pagina prodotto di oscommerce, dovrei sostituire un richiamo di codice direttamente con il codice ossia il: [HTML] require(DIR_WS_INCLUDES . 'template_top.php');[/HTML] praticamente richiama il codice head da un'altro file: [HTML]<?php
    /*
    $Id$
    osCommerce, Open Source E-Commerce Solutions
    http://www.oscommerce.com
    Copyright (c) 2010 osCommerce
    Released under the GNU General Public License
    */
    $oscTemplate->buildBlocks();
    if (!$oscTemplate->hasBlocks('boxes_column_left')) {
    $oscTemplate->setGridContentWidth($oscTemplate->getGridContentWidth() + $oscTemplate->getGridColumnWidth());
    }
    if (!$oscTemplate->hasBlocks('boxes_column_right')) {
    $oscTemplate->setGridContentWidth($oscTemplate->getGridContentWidth() + $oscTemplate->getGridColumnWidth());
    }
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?>>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>" />
    <title><?php echo tep_output_string_protected($oscTemplate->getTitle()); ?></title>
    <?php include_once DIR_WS_MODULES . 'kiss_meta_tags/kiss_meta_tags.php'; ?>
    <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>" />
    <link rel="stylesheet" type="text/css" href="ext/jquery/ui/redmond/jquery-ui-1.8.6-osc.css" />
    <script type="text/javascript" src="ext/jquery/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="ext/jquery/ui/jquery-ui-1.8.6.min.js"></script>
    <?php
    if (tep_not_null(JQUERY_DATEPICKER_I18N_CODE)) {
    ?>
    <script type="text/javascript" src="ext/jquery/ui/i18n/jquery.ui.datepicker-<?php echo JQUERY_DATEPICKER_I18N_CODE; ?>.js"></script>
    <script type="text/javascript">
    $.datepicker.setDefaults($.datepicker.regional['<?php echo JQUERY_DATEPICKER_I18N_CODE; ?>']);
    </script>
    <?php
    }
    ?>
    <script type="text/javascript" src="ext/jquery/bxGallery/jquery.bxGallery.1.1.min.js"></script>
    <link rel="stylesheet" type="text/css" href="ext/jquery/fancybox/jquery.fancybox-1.3.4.css" />
    <script type="text/javascript" src="ext/jquery/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
    <link rel="stylesheet" type="text/css" href="ext/960gs/<?php echo ((stripos(HTML_PARAMS, 'dir="rtl"') !== false) ? 'rtl_' : ''); ?>960_24_col.css" />
    <link rel="stylesheet" type="text/css" href="css/stylesheet.css" />
    <link rel="stylesheet" type="text/css" href="css/constants.css" />
    <link rel="stylesheet" type="text/css" href="css/stylesheet_boxes.css" />
    <link rel="stylesheet" type="text/css" href="css/header.css" />
    <?php require('ext/js/ie6/ie6.php');?>
    <?php include(DIR_WS_FUNCTIONS . 'case_page.php');?>
    <?php echo $oscTemplate->getBlocks('header_tags');?>
    <link rel="stylesheet" type="text/css" href="css/style.css" />

    <script type="text/javascript" src="ext/js/loopedslider.0.5.4.js"></script>
    <script type="text/javascript" charset="utf-8">
    $(function(){
    $('#loopedSlider').loopedSlider();
    });
    </script>
    <?php
    if (!isset($lng) || (isset($lng) && !is_object($lng))) {
    include_once(DIR_WS_CLASSES . 'language.php');
    $lng = new language;
    }
    reset($lng->catalog_languages);
    while (list($key, $value) = each($lng->catalog_languages)) {
    ?>
    <link rel="alternate" type="application/rss+xml" title="<?php echo STORE_NAME . ' - ' . BOX_INFORMATION_RSS; ?>" href="<?php echo FILENAME_RSS, '?language=' . $key.((isset($_GET['cPath']))?'&cPath='.$_GET['cPath']:'').((isset($_GET['manufacturers_id']))?'&manufacturers_id='.$_GET['manufacturers_id']:''); ?>" />
    <?php
    }
    ?>
    </head>
    <body>
    <div id="bodyWrapper" class="container_24">
    <?php require(DIR_WS_INCLUDES . 'header.php'); ?>
    <div id="bodyContent" class="grid_16 push_4">
    [/HTML]
    Il codice postato sopra dovrei inserirlo in quest'altro file:
    [HTML]<?php
    /*
    $Id$
    osCommerce, Open Source E-Commerce Solutions
    http://www.oscommerce.com
    Copyright (c) 2010 osCommerce
    Released under the GNU General Public License
    /
    require('includes/application_top.php');
    require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);
    $product_check_query = tep_db_query("select count(
    ) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
    $product_check = tep_db_fetch_array($product_check_query);
    require(DIR_WS_INCLUDES . 'template_top.php');
    if ($product_check['total'] < 1) {
    ?>
    <div class="contentContainer">
    <div class="contentText">
    <?php echo TEXT_PRODUCT_NOT_FOUND; ?>
    </div>
    <div style="float: right;">
    <?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', tep_href_link(FILENAME_DEFAULT)); ?>
    </div>
    </div> ecc.....[/HTML] Come faccio per unirli? Grazie