Neuigkeiten
  • Die modified eCommerce Shopsoftware ist kostenlos, aber nicht umsonst.
    Spenden
  • Damit wir die modified eCommerce Shopsoftware auch zukünftig kostenlos anbieten können:
    Spenden
  • Thema: Warning Meldung nach Eingabe einer Artikel Nummer im Suchfeld

    longchuan

    • Viel Schreiber
    • Beiträge: 640
    • Geschlecht:
    Wenn ich im Suchfeld eine Artikel Nummer oder Artikel Name eingebe kommt folgende Meldung.
    Siehe auch Anhang.
    Warnin:array_key-exists()expects parameter 2 to be arry, boolean given in /home/Kubotans/public_html/includes

    Hat jeman eine idee woran das liegt?
    Danke

    Linkback: https://www.modified-shop.org/forum/index.php?topic=35274.0

    Teratek

    • Schreiberling
    • Beiträge: 273
    Wenn die Suchfunktion so an sich funktioniert dann schalte doch einfach die error_reporting aus

    longchuan

    • Viel Schreiber
    • Beiträge: 640
    • Geschlecht:
    Und wo schalte ich das aus.
    Danke

    Teratek

    • Schreiberling
    • Beiträge: 273
    in der includes/application_top.php

    longchuan

    • Viel Schreiber
    • Beiträge: 640
    • Geschlecht:
    Warning: array_key_exists() expects parameter 2 to be array, boolean given in /home/kubotans/public_html/includes/modules/product_listing.php on line 92 ..

    Und wo stelle ich was ein um es ab bzw auszustellen.
    Hier meine Datei

    Code: PHP  [Auswählen]
    <?php
    /* -----------------------------------------------------------------------------------------
       $Id: application_top.php 3121 2012-06-23 19:29:57Z franky-n-modified eCommerce Shopsoftware $

       modified eCommerce Shopsoftware
       http://www.modified-shop.org

       Copyright (c) 2009 - 2013 [www.modified-shop.org]
       -----------------------------------------------------------------------------------------
       based on:
       (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
       (c) 2002-2003 osCommerce(application_top.php,v 1.273 2003/05/19); www.oscommerce.com
       (c) 2003 nextcommerce (application_top.php,v 1.54 2003/08/25); www.nextcommerce.org
       (c) 2006 XT-Commerce (application_top.php 1194 2010-08-22)

       Released under the GNU General Public License
       -----------------------------------------------------------------------------------------
       Third Party contribution:
       Add A Quickie v1.0 Autor  Harald Ponce de Leon

       Credit Class/Gift Vouchers/Discount Coupons (Version 5.10)
       http://www.oscommerce.com/community/contributions,282
       Copyright (c) Strider | Strider@oscworks.com
       Copyright (c) Nick Stanko of UkiDev.com, nick@ukidev.com
       Copyright (c) Andre ambidex@gmx.net
       Copyright (c) 2001,2002 Ian C Wilson http://www.phesis.org

       Released under the GNU General Public License
       ---------------------------------------------------------------------------------------*/


    // start the timer for the page parse time log
    define('PAGE_PARSE_START_TIME', microtime(true));

    // configuration parameters
    if (file_exists('includes/local/configure.php')) {
      include ('includes/local/configure.php');
    } else {
      include ('includes/configure.php');
    }

    // call Installer
    if (DB_DATABASE == '' && is_dir('./_installer')) {
      header("Location: ./_installer");
      exit();
    }

    // LOG dir
    define('DIR_FS_LOG', DIR_FS_CATALOG . 'log/');

    // external
    define('DIR_WS_EXTERNAL', DIR_WS_CATALOG . 'includes/external/');
    define('DIR_FS_EXTERNAL', DIR_FS_CATALOG . 'includes/external/');

    /**
     * set the level of error reporting
     */

    if (file_exists(DIR_FS_CATALOG.'export/_error_reporting.all') || file_exists(DIR_FS_CATALOG.'export/_error_reporting.shop')) {
      @ini_set('display_errors', true);
      error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT); //exlude E_STRICT on PHP 5.4
    } elseif (file_exists(DIR_FS_CATALOG.'export/_error_reporting.dev')) {
      @ini_set('display_errors', true);
      error_reporting(-1); // Development value
    } else {
      error_reporting(0);
    }

    /*
     * turn off magic-quotes support, for both runtime and sybase, as both will cause problems if enabled
     */

    if (version_compare(PHP_VERSION, 5.3, '<') && function_exists('set_magic_quotes_runtime')) set_magic_quotes_runtime(0);
    if (version_compare(PHP_VERSION, 5.4, '<') && @ini_get('magic_quotes_sybase') != 0) @ini_set('magic_quotes_sybase', 0);

    // include the list of project filenames
    require (DIR_WS_INCLUDES.'filenames.php');
    if (version_compare(PHP_VERSION, '5.1.0', '>=')) {
      date_default_timezone_set('Europe/Berlin');
    }

    // Debug-Log-Class - thx to franky
    include_once(DIR_WS_CLASSES.'class.debug.php');
    $log = new debug;

    // for xtc_db_perform
    $php4_3_10 = (0 == version_compare(phpversion(), "4.3.10"));
    define('PHP4_3_10', $php4_3_10);

    // project version
    define('PROJECT_VERSION', 'modified eCommerce Shopsoftware');

    define('TAX_DECIMAL_PLACES', 0);

    // set the type of request (secure or not)
    if (file_exists('includes/request_type.php')) {
      include ('includes/request_type.php');
    } else {
      $request_type = 'NONSSL';
    }
    // Base/PHP_SELF/SSL-PROXY
    require_once(DIR_FS_INC . 'set_php_self.inc.php');
    $PHP_SELF = set_php_self();

    //compatibility for modified eCommerce Shopsoftware 1.06 files
    define('DIR_WS_BASE', '');

    // list of project database tables
    require (DIR_WS_INCLUDES.'database_tables.php');

    // SQL caching dir
    define('SQL_CACHEDIR', DIR_FS_CATALOG.'cache/');

    // graduated prices model or products assigned ?
    define('GRADUATED_ASSIGN', 'true');

    // Database
    require_once (DIR_FS_INC.'xtc_db_connect.inc.php');
    require_once (DIR_FS_INC.'xtc_db_close.inc.php');
    require_once (DIR_FS_INC.'xtc_db_error.inc.php');
    require_once (DIR_FS_INC.'xtc_db_perform.inc.php');
    require_once (DIR_FS_INC.'xtc_db_query.inc.php');
    require_once (DIR_FS_INC.'xtc_db_queryCached.inc.php');
    require_once (DIR_FS_INC.'xtc_db_fetch_array.inc.php');
    require_once (DIR_FS_INC.'xtc_db_num_rows.inc.php');
    require_once (DIR_FS_INC.'xtc_db_data_seek.inc.php');
    require_once (DIR_FS_INC.'xtc_db_insert_id.inc.php');
    require_once (DIR_FS_INC.'xtc_db_free_result.inc.php');
    require_once (DIR_FS_INC.'xtc_db_fetch_fields.inc.php');
    require_once (DIR_FS_INC.'xtc_db_output.inc.php');
    require_once (DIR_FS_INC.'xtc_db_input.inc.php');
    require_once (DIR_FS_INC.'xtc_db_prepare_input.inc.php');

    // html basics
    require_once (DIR_FS_INC.'xtc_href_link.inc.php');
    require_once (DIR_FS_INC.'xtc_php_mail.inc.php');

    require_once (DIR_FS_INC.'xtc_product_link.inc.php');
    require_once (DIR_FS_INC.'xtc_category_link.inc.php');
    require_once (DIR_FS_INC.'xtc_manufacturer_link.inc.php');

    // html functions
    require_once (DIR_FS_INC.'xtc_draw_checkbox_field.inc.php');
    require_once (DIR_FS_INC.'xtc_draw_form.inc.php');
    require_once (DIR_FS_INC.'xtc_draw_hidden_field.inc.php');
    require_once (DIR_FS_INC.'xtc_draw_input_field.inc.php');
    require_once (DIR_FS_INC.'xtc_draw_password_field.inc.php');
    require_once (DIR_FS_INC.'xtc_draw_pull_down_menu.inc.php');
    require_once (DIR_FS_INC.'xtc_draw_radio_field.inc.php');
    require_once (DIR_FS_INC.'xtc_draw_selection_field.inc.php');
    require_once (DIR_FS_INC.'xtc_draw_separator.inc.php');
    require_once (DIR_FS_INC.'xtc_draw_textarea_field.inc.php');
    require_once (DIR_FS_INC.'xtc_image_button.inc.php');

    require_once (DIR_FS_INC.'xtc_not_null.inc.php');
    require_once (DIR_FS_INC.'xtc_update_whos_online.inc.php');
    require_once (DIR_FS_INC.'xtc_activate_banners.inc.php');
    require_once (DIR_FS_INC.'xtc_expire_banners.inc.php');
    require_once (DIR_FS_INC.'xtc_expire_specials.inc.php');
    require_once (DIR_FS_INC.'xtc_parse_category_path.inc.php');
    require_once (DIR_FS_INC.'xtc_get_product_path.inc.php');
    require_once (DIR_FS_INC.'xtc_get_top_level_domain.inc.php');
    require_once (DIR_FS_INC.'xtc_get_category_path.inc.php');

    require_once (DIR_FS_INC.'xtc_get_parent_categories.inc.php');
    require_once (DIR_FS_INC.'xtc_redirect.inc.php');
    require_once (DIR_FS_INC.'xtc_get_uprid.inc.php');
    require_once (DIR_FS_INC.'xtc_get_all_get_params.inc.php');
    require_once (DIR_FS_INC.'xtc_has_product_attributes.inc.php');
    require_once (DIR_FS_INC.'xtc_image.inc.php');
    require_once (DIR_FS_INC.'xtc_check_stock_attributes.inc.php');
    require_once (DIR_FS_INC.'xtc_currency_exists.inc.php');
    require_once (DIR_FS_INC.'xtc_remove_non_numeric.inc.php');
    require_once (DIR_FS_INC.'xtc_get_ip_address.inc.php');
    require_once (DIR_FS_INC.'xtc_setcookie.inc.php');
    require_once (DIR_FS_INC.'xtc_check_agent.inc.php');
    require_once (DIR_FS_INC.'xtc_count_cart.inc.php');
    require_once (DIR_FS_INC.'xtc_get_qty.inc.php');
    require_once (DIR_FS_INC.'create_coupon_code.inc.php');
    require_once (DIR_FS_INC.'xtc_gv_account_update.inc.php');
    require_once (DIR_FS_INC.'xtc_get_tax_rate_from_desc.inc.php');
    require_once (DIR_FS_INC.'xtc_get_tax_rate.inc.php');
    require_once (DIR_FS_INC.'xtc_add_tax.inc.php');
    require_once (DIR_FS_INC.'xtc_cleanName.inc.php');
    require_once (DIR_FS_INC.'xtc_calculate_tax.inc.php');
    require_once (DIR_FS_INC.'xtc_input_validation.inc.php');
    require_once (DIR_FS_INC.'xtc_js_lang.php');
    require_once (DIR_FS_INC.'html_encoding.php'); //new function for PHP5.4
    // make a connection to the database... now
    xtc_db_connect() or die('Unable to connect to database server!');

    // load configuration
    $configuration_query = xtc_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from '.TABLE_CONFIGURATION);
    while ($configuration = xtc_db_fetch_array($configuration_query)) {
      define($configuration['cfgKey'], stripslashes($configuration['cfgValue'])); //Web28 - 2012-08-09 - fix slashes
    }
    // Set the length of the redeem code, the longer the more secure
    // Kommt eigentlich schon aus der Table configuration
    if(SECURITY_CODE_LENGTH=='')
      define('SECURITY_CODE_LENGTH', '10');

    // PHPMailer
    require_once (DIR_WS_CLASSES.'class.phpmailer.php');
    if (EMAIL_TRANSPORT == 'smtp') {
      require_once (DIR_WS_CLASSES.'class.smtp.php');
    }

    require_once (DIR_FS_INC.'xtc_Security.inc.php');

    // move to xtc_db_queryCached.inc.php
    function xtDBquery($query) {
      if (defined('DB_CACHE') && DB_CACHE == 'true') {
        $result = xtc_db_queryCached($query);
      } else {
        $result = xtc_db_query($query);
      }
      return $result;
    }

    function CacheCheck() {
      if (USE_CACHE == 'false') return false;
      if (!isset($_COOKIE['MODsid'])) return false;
      return true;
    }

    // if gzip_compression is enabled and gzip_off is not set, start to buffer the output
    if ((!isset($gzip_off) || !$gzip_off) && (GZIP_COMPRESSION == 'true') && ($ext_zlib_loaded = extension_loaded('zlib')) && (PHP_VERSION >= '4')) {
      if (($ini_zlib_output_compression = (int) ini_get('zlib.output_compression')) < 1) {
        ob_start('ob_gzhandler');
      } else {
        ini_set('zlib.output_compression_level', GZIP_LEVEL);
      }
    }

    // security inputfilter for GET/POST/COOKIE
    require (DIR_WS_CLASSES.'class.inputfilter.php');
    $InputFilter = new InputFilter();

    $_GET = $InputFilter->process($_GET);
    $_POST = $InputFilter->process($_POST);
    $_REQUEST = $InputFilter->process($_REQUEST);
    $_GET = $InputFilter->safeSQL($_GET);
    $_POST = $InputFilter->safeSQL($_POST);
    $_REQUEST = $InputFilter->safeSQL($_REQUEST);

    // set the top level domains
    $http_domain = xtc_get_top_level_domain(HTTP_SERVER);
    $https_domain = xtc_get_top_level_domain(HTTPS_SERVER);
    $current_domain = (($request_type == 'NONSSL') ? $http_domain : $https_domain);

    // include shopping cart class
    require (DIR_WS_CLASSES.'shopping_cart.php');

    // include navigation history class
    require (DIR_WS_CLASSES.'navigation_history.php');

    // some code to solve compatibility issues
    require (DIR_WS_FUNCTIONS.'compatibility.php');

    // define how the session functions will be used
    require (DIR_WS_FUNCTIONS.'sessions.php');

    // set the session name and save path
    session_name('MODsid');
    if (STORE_SESSIONS != 'mysql') session_save_path(SESSION_WRITE_DIRECTORY);

    // set the session cookie parameters
    if (function_exists('session_set_cookie_params')) {
      session_set_cookie_params(0, '/', (xtc_not_null($current_domain) ? '.'.$current_domain : ''));
    } elseif (function_exists('ini_set')) {
      ini_set('session.cookie_lifetime', '0');
      ini_set('session.cookie_path', '/');
      ini_set('session.cookie_domain', (xtc_not_null($current_domain) ? '.'.$current_domain : ''));
    }
    // set the session ID if it exists
    if (isset($_POST[xtc_session_name()])) {
      xtc_session_id($_POST[xtc_session_name()]);
    }
    elseif ($request_type == 'SSL' && isset($_GET[xtc_session_name()])) {
      if (!isset($_COOKIE[xtc_session_name()]) || $_GET[xtc_session_name()] != $_COOKIE[xtc_session_name()]) {
        xtc_session_id($_GET[xtc_session_name()]);
      }
    }

    // start the session
    $session_started = false;
    if (SESSION_FORCE_COOKIE_USE == 'True') {
      xtc_setcookie('cookie_test', 'please_accept_for_session', time() + 60 * 60 * 24 * 30, '/', $current_domain);
      if (isset ($_COOKIE['cookie_test'])) {
        session_start();
        $session_started = true;
      }
    } else {
      session_start();  
      $session_started = true;
    }
    include (DIR_WS_INCLUDES.'tracking.php');
    // check the Agent
    $truncate_session_id = false;
    if (CHECK_CLIENT_AGENT && xtc_check_agent() == 1) {
      $truncate_session_id = true;
    }

    // verify the ssl_session_id if the feature is enabled
    if (($request_type == 'SSL') && (SESSION_CHECK_SSL_SESSION_ID == 'True') && (ENABLE_SSL == true) && ($session_started == true)) {
      $ssl_session_id = getenv('SSL_SESSION_ID');
      if (!isset($_SESSION['SSL_SESSION_ID'])) {
        $_SESSION['SESSION_SSL_ID'] = $ssl_session_id;
      }
      if ($_SESSION['SESSION_SSL_ID'] != $ssl_session_id) {
        session_destroy();
        xtc_redirect(xtc_href_link(FILENAME_SSL_CHECK));
      }
    }

    // verify the browser user agent if the feature is enabled
    if (SESSION_CHECK_USER_AGENT == 'True') {
      $http_user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
      $http_user_agent2 = strtolower(getenv("HTTP_USER_AGENT"));
      $http_user_agent = ($http_user_agent == $http_user_agent2) ? $http_user_agent : $http_user_agent.';'.$http_user_agent2;
      if (!isset ($_SESSION['SESSION_USER_AGENT'])) {
        $_SESSION['SESSION_USER_AGENT'] = $http_user_agent;
      } elseif ($_SESSION['SESSION_USER_AGENT'] != $http_user_agent) {
        session_destroy();
        xtc_redirect(xtc_href_link(FILENAME_LOGIN));
      }
    }

    // verify the IP address if the feature is enabled
    if (SESSION_CHECK_IP_ADDRESS == 'True') {
      $ip_address = xtc_get_ip_address();
      if (!isset($_SESSION['SESSION_IP_ADDRESS'])) {
        $_SESSION['SESSION_IP_ADDRESS'] = $ip_address;
      } elseif ($_SESSION['SESSION_IP_ADDRESS'] != $ip_address) {
        session_destroy();
        xtc_redirect(xtc_href_link(FILENAME_LOGIN));
      }
    }

    // Redirect search engines with session id to the same url without session id to prevent indexing session id urls
    if ( $truncate_session_id == true ) {
      if (preg_match('/' . xtc_session_name() . '/i', $_SERVER['REQUEST_URI']) ){
        $uri = preg_replace("/([^\?]*)(\?.*)/", "$1", $_SERVER['REQUEST_URI']);
        $params = str_replace($uri,'',$_SERVER['REQUEST_URI']);
        $params = ltrim($params,'?');
        parse_str($params,$params);
        $key = xtc_session_name();
        if (isset($params[$key])) unset($params[$key]);
        $params = http_build_query($params);
        $location = (isset($_SERVER['HTTPS']) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $uri . (xtc_not_null($params) ? '?' . $params : '');
        header("HTTP/1.0 301 Moved Permanently");
        header("Location: $location");
        exit();
      }
    }

    if (!(preg_match('/^[a-z0-9]{26}$/i', session_id()) || preg_match('/^[a-z0-9]{32}$/i', session_id()))) {
      session_regenerate_id(true); // Thanks to HHGAG ;-)
    }

    // set the language
    include (DIR_WS_MODULES.'set_language_sessions.php');

    // language translations
    require (DIR_WS_LANGUAGES.$_SESSION['language'].'/'.$_SESSION['language'].'.php');

    // currency
    if (!isset ($_SESSION['currency']) || isset ($_GET['currency']) || ((USE_DEFAULT_LANGUAGE_CURRENCY == 'true') && (LANGUAGE_CURRENCY != $_SESSION['currency']))) {
      if (isset ($_GET['currency'])) {
        $_GET['currency'] = xtc_input_validation($_GET['currency'], 'char', '');
        if (!$_SESSION['currency'] = xtc_currency_exists($_GET['currency']))
          $_SESSION['currency'] = (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY;
      } else {
        $_SESSION['currency'] = (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY;
      }
    }
    if (isset ($_SESSION['currency']) && $_SESSION['currency'] == '') {
      $_SESSION['currency'] = DEFAULT_CURRENCY;
    }

    // write customers status in session
    require (DIR_WS_INCLUDES.'write_customers_status.php');

    //BOC web28 2011-11-30 - Versandkosten im Warenkorb
    if (strpos($PHP_SELF, FILENAME_SHOPPING_CART) === false) {
      unset($_SESSION['country']);
    }
    //EOC web28 2011-11-30 - Versandkosten im Warenkorb

    // main class
    require (DIR_WS_CLASSES.'main.php');
    $main = new main();

    // price class
    require (DIR_WS_CLASSES.'xtcPrice.php');
    $xtPrice = new xtcPrice($_SESSION['currency'], $_SESSION['customers_status']['customers_status_id']);

    // econda tracking
    if (TRACKING_ECONDA_ACTIVE=='true') {
      require(DIR_WS_INCLUDES . 'econda/class.econda304SP2.php');
      $econda = new econda();
    }

    // PayPal Express
    if (defined('PAYPAL_API_VERSION')) {
      require_once (DIR_WS_CLASSES . 'paypal_checkout.php');
      $o_paypal = new paypal_checkout();
    }

    // create the shopping cart & fix the cart if necesary
    if (!isset($_SESSION['cart']) || !is_object($_SESSION['cart'])) {
      $_SESSION['cart'] = new shoppingCart();
    }

    require (DIR_WS_INCLUDES.FILENAME_CART_ACTIONS);

    // who's online functions
    xtc_update_whos_online();

    // split-page-results
    require (DIR_WS_CLASSES.'split_page_results.php');

    // infobox
    require (DIR_WS_CLASSES.'boxes.php');

    // auto activate and expire banners
    xtc_activate_banners();
    xtc_expire_banners();

    // auto expire special products
    xtc_expire_specials();

    // class product
    require (DIR_WS_CLASSES.'product.php');

    // set $actual_products_id,  $current_category_id, $ cPath, $_GET['manufacturers_id']
    include (DIR_WS_MODULES.'set_ids_by_url_parameters.php');

    // breadcrumb class and start the breadcrumb trail
    require (DIR_WS_CLASSES.'breadcrumb.php');
    $breadcrumb = new breadcrumb;
    include (DIR_WS_MODULES.'create_breadcrumb.php');

    // initialize the message stack for output messages
    require (DIR_WS_CLASSES.'message_stack.php');
    $messageStack = new messageStack;

    // set which precautions should be checked
    define('WARN_INSTALL_EXISTENCE', 'true');
    define('WARN_CONFIG_WRITEABLE', 'true');
    define('WARN_SESSION_DIRECTORY_NOT_WRITEABLE', 'true');
    define('WARN_SESSION_AUTO_START', 'true');
    define('WARN_DOWNLOAD_DIRECTORY_NOT_READABLE', 'true');

    // Smarty Template Engine
    require (DIR_WS_CLASSES.'Smarty_2.6.27/Smarty.class.php');

    if (isset ($_SESSION['customer_id'])) {
    $account_type_query = xtc_db_query("-- /includes/application_top.php
                                          SELECT account_type,
                                                 customers_default_address_id
                                            FROM "
    .TABLE_CUSTOMERS."
                                           WHERE customers_id = '"
    .(int) $_SESSION['customer_id']."'");
      $account_type = xtc_db_fetch_array($account_type_query);

      // check if zone id is unset bug
      if (!isset ($_SESSION['customer_country_id'])) {
        $zone_query = xtc_db_query("-- /includes/application_top.php
                                SELECT entry_country_id
                                  FROM "
    .TABLE_ADDRESS_BOOK."
                                 WHERE customers_id='"
    .(int) $_SESSION['customer_id']."'
                                   AND address_book_id='"
    .$account_type['customers_default_address_id']."'");

        $zone = xtc_db_fetch_array($zone_query);
        $_SESSION['customer_country_id'] = $zone['entry_country_id'];
      }
      $_SESSION['account_type'] = $account_type['account_type'];
    } else {
      $_SESSION['account_type'] = '0';
    }

    // modification for nre graduated system
    unset ($_SESSION['actual_content']);

    // econda tracking
    if (TRACKING_ECONDA_ACTIVE == 'true') {
      require(DIR_WS_INCLUDES . 'econda/emos.php');
    }

    ## janolaw
    if (defined('MODULE_JANOLAW_STATUS') && MODULE_JANOLAW_STATUS == 'True') {
      require_once(DIR_FS_CATALOG.'includes/external/janolaw/janolaw.php');
      $janolaw = new janolaw_content();
    }

    ## protectedshops
    if (defined('MODULE_PROTECTEDSHOPS_STATUS') && MODULE_PROTECTEDSHOPS_STATUS == 'true') {
      require_once(DIR_FS_CATALOG.'includes/external/protectedshops/protectedshops_update.php');
      $protectedshops = new protectedshops_update();
      $protectedshops->check_update();
    }

    xtc_count_cart();
    ?>

    Bonsai

    • Viel Schreiber
    • Beiträge: 4.127
    • Geschlecht:
    Es wäre konstruktiver den Fehler zu beseitigen.

    Wenn Du Dir den HTML Quellcode der Seite anzeigen lässt, siehst Du den Rest der Fehlermeldung, der hinter dem Suchfenster liegt. Da steht die Zeilennummer ....

    longchuan

    • Viel Schreiber
    • Beiträge: 640
    • Geschlecht:
    Und wie mache ich das am besten?

    longchuan

    • Viel Schreiber
    • Beiträge: 640
    • Geschlecht:
    Das hier ist die ganze warnung

    Warning: array_key_exists() expects parameter 2 to be array, boolean given in /home/kubotans/public_html/includes/modules/product_listing.php on line 92 ..

    und das ist meine Datei
    was ist hier falsch

    Code: PHP  [Auswählen]
    <?php
    /* -----------------------------------------------------------------------------------------
       $Id: product_listing.php 1286 2005-10-07 10:10:18Z mz $

       XT-Commerce - community made shopping
       http://www.(( Wir dulden keine kommerziellen Werbelinks - Bitte <a href="index.php?topic=3013.0">Forenregeln</a> beachten! ))

       Copyright (c) 2003 XT-Commerce
       -----------------------------------------------------------------------------------------
       based on:
       (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
       (c) 2002-2003 osCommerce(product_listing.php,v 1.42 2003/05/27); www.oscommerce.com
       (c) 2003  nextcommerce (product_listing.php,v 1.19 2003/08/1); www.nextcommerce.org

       Released under the GNU General Public License
       ---------------------------------------------------------------------------------------*/


    $module_smarty = new Smarty;
    $module_smarty->assign('tpl_path', 'templates/'.CURRENT_TEMPLATE.'/');
    $result = true;

    // include needed functions
    require_once (DIR_FS_INC.'xtc_get_all_get_params.inc.php');
    require_once (DIR_FS_INC.'xtc_get_vpe_name.inc.php');
    $listing_split = new splitPageResults($listing_sql, (isset($_GET['page']) ? (int)$_GET['page'] : 1), MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');
    $module_content = array ();
    $category = array();

    if ($listing_split->number_of_rows > 0) {

      $navigation = '
        <table border="0" width="100%" cellspacing="0" cellpadding="2">
          <tr>
            <td class="smallText">'
    .$listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS).'</td>
            <td class="smallText" align="right">'
    .TEXT_RESULT_PAGE.' '.$listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, xtc_get_all_get_params(array ('page', 'info', 'x', 'y', 'keywords')).(isset($_GET['keywords'])?'&keywords='. urlencode($_GET['keywords']):'')).'</td>
          </tr>
        </table>'
    ;
      $group_check = '';
      if (GROUP_CHECK == 'true') {
        $group_check = "and c.group_permission_".$_SESSION['customers_status']['customers_status_id']."=1 ";
      }

      $category_query = xtDBquery("SELECT cd.categories_description,
                                          cd.categories_name,
                                          cd.categories_heading_title,
                                          c.listing_template,
                                          c.categories_image
                                     FROM "
    .TABLE_CATEGORIES." c,
                                          "
    .TABLE_CATEGORIES_DESCRIPTION." cd
                                    WHERE c.categories_id = '"
    .$current_category_id."'
                                      AND cd.categories_id = '"
    .$current_category_id."'
                                          "
    .$group_check."
                                      AND cd.language_id = '"
    .$_SESSION['languages_id']."'
                                    LIMIT 1"
    );
      $category = xtc_db_fetch_array($category_query,true);
      $image = '';
      if ($category['categories_image'] != '') {
        $image = DIR_WS_IMAGES.'categories/'.$category['categories_image'];
        if(!file_exists($image)) $image = DIR_WS_IMAGES.'categories/noimage.gif';
      }

      if (isset ($_GET['manufacturers_id']) && $_GET['manufacturers_id'] > 0) {
        $manu_query = xtDBquery("select manufacturers_image, manufacturers_name from ".TABLE_MANUFACTURERS." where manufacturers_id = '".(int) $_GET['manufacturers_id']."'");
        $manu = xtc_db_fetch_array($manu_query,true);
        $category['categories_name'] = $manu['manufacturers_name'];

        if ($manu['manufacturers_image'] != '') {
          $image = DIR_WS_IMAGES.$manu['manufacturers_image'];
          if(!file_exists($image)) $image = '';
        }

      }
      //EOF -web28- 2010-08-06 - BUGFIX no manufacturers image displayed

      $module_smarty->assign('CATEGORIES_NAME', $category['categories_name']);
      $module_smarty->assign('CATEGORIES_HEADING_TITLE', $category['categories_heading_title']);
      $module_smarty->assign('CATEGORIES_IMAGE', $image);
      $module_smarty->assign('CATEGORIES_DESCRIPTION', $category['categories_description']);
      $rows = 0;
      $listing_query = xtDBquery($listing_split->sql_query);
      while ($listing = xtc_db_fetch_array($listing_query, true)) {
        $rows ++;
        $module_content[] =  $product->buildDataArray($listing);
      }
    } else {
      // no product found
      $result = false;
    }

    if ($result != false) {
      // get default template
      if (!array_key_exists('listing_template', $category) || $category['listing_template'] == '' || $category['listing_template'] == 'default') {
        $files = array ();
        if ($dir = opendir(DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/module/product_listing/')) {
          while (($file = readdir($dir)) !== false) {
            if (is_file(DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/module/product_listing/'.$file) and (substr($file, -5) == ".html") and ($file != "index.html") and (substr($file, 0, 1) !=".")) {
              $files[] = $file;
            }
          }
          closedir($dir);
        }
        sort($files);
        $category['listing_template'] = $files[0];
      }

      $module_smarty->assign('MANUFACTURER_DROPDOWN', (isset($manufacturer_dropdown) ? $manufacturer_dropdown : ''));
      $module_smarty->assign('language', $_SESSION['language']);
      $module_smarty->assign('module_content', $module_content);
      $module_smarty->assign('NAVIGATION', $navigation);
      // set cache ID
       if (!CacheCheck()) {
        $module_smarty->caching = 0;
        $module = $module_smarty->fetch(CURRENT_TEMPLATE.'/module/product_listing/'.$category['listing_template']);
      } else {
        $module_smarty->caching = 1;
        $module_smarty->cache_lifetime = CACHE_LIFETIME;
        $module_smarty->cache_modified_check = CACHE_CHECK;

        //setting/clearing params
        $get_params = isset($_GET['manufacturers_id']) && xtc_not_null($_GET['manufacturers_id']) ? '_'.(int)$_GET['manufacturers_id'] : '';
        $get_params .= isset($_GET['filter_id']) && xtc_not_null($_GET['filter_id']) ? '_'.(int)$_GET['filter_id'] : '';
        $get_params .= isset($_GET['page']) && $_GET['page'] > 0  ? '_'.(int)$_GET['page'] : '';
        $get_params .= isset($_GET['categories_id']) && xtc_not_null($_GET['categories_id']) ? '_'.(int)$_GET['categories_id'] : '';
        $get_params .= isset($_GET['keywords']) && !empty($_GET['keywords']) ? '_'.stripslashes(trim(urldecode($_GET['keywords']))) : '';
        $get_params .= isset($_GET['pfrom']) && !empty($_GET['pfrom']) ? '_'.stripslashes($_GET['pfrom']) : '';
        $get_params .= isset($_GET['pto']) && !empty($_GET['pto']) ? '_'.stripslashes($_GET['pto']) : '';
        $get_params .= isset($_GET['x']) && $_GET['x'] >= 0 ? '_'.(int)$_GET['x'] : '';
        $get_params .= isset($_GET['y']) && $_GET['y'] >= 0 ? '_'.(int)$_GET['y'] : '';

        $cache_id = $current_category_id.'_'.$_SESSION['language'].'_'.$_SESSION['customers_status']['customers_status_name'].'_'.$_SESSION['currency'].$get_params;
        $module = $module_smarty->fetch(CURRENT_TEMPLATE.'/module/product_listing/'.$category['listing_template'], $cache_id);
      }
      $smarty->assign('main_content', $module);
    } else {
      $error = TEXT_PRODUCT_NOT_FOUND;
      include (DIR_WS_MODULES.FILENAME_ERROR_HANDLER);
    }
    ?>

    Bonsai

    • Viel Schreiber
    • Beiträge: 4.127
    • Geschlecht:
    Ich habe jetzt keine Zeit den eigentlichen Fehler zu finden, aber ein Workaround wäre, einfach den Problemfall abzufangen. Es soll ja ein Array sein, also bauen wir eins, und zwar genau das was in der Zeile danach gewünscht ist. Also eine Zeile vor dem Fehler das einbauen:
    Code: PHP  [Auswählen]
    if (!is_array($category)) $category['listing_template'] = 'default';

    Und bitte gewöhne Dir den PHP Knopf an um Code zu posten!

    longchuan

    • Viel Schreiber
    • Beiträge: 640
    • Geschlecht:
    Vielen Dank nun gehts wieder
    1 Antworten
    2266 Aufrufe
    27. September 2011, 13:34:50 von Tomcraft
    1 Antworten
    2506 Aufrufe
    11. April 2009, 18:54:59 von Anonym
    9 Antworten
    4362 Aufrufe
    25. April 2012, 16:58:08 von noRiddle (revilonetz)