Jump to content
xt:Commerce Community Forum

Error 1054 - Hier eine Allroundlösung gefunden


Recommended Posts

Die Abfrage sieht dann so aus:

select p.products_fsk18, p.products_shippingtime, p.products_model, p.products_ean, pd.products_name, m.manufacturers_name, p.products_quantity, p.products_image, p.products_weight, pd.products_short_description, pd.products_description, p.products_id, p.manufacturers_id, p.products_price, p.products_vpe, p.products_vpe_status, p.products_vpe_value, p.products_discount_allowed, p.products_tax_class_id from (((products_description pd, products p) left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c) left join specials s on p.products_id = s.products_id) where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '2' and p2c.categories_id = '2' ORDER BY p.products_price ASC

Link to comment
Share on other sites

  • Replies 131
  • Created
  • Last Reply

Die Abfrage ist dynamisch, die Problematik ist aber losgelöst von den Parametern. Ich habe die Abfrage auch schon in MySQl ausgeführt; hier wurde der left join als Problem angegeben.

Änderungen haben zwar in MySQL den Fehler behoben, habe die Lösung in die default.php übernommen, nur wurde die Änderung nicht angenommen und der Fehler besteht somit weiterhin.

Hiiiiilllllllffffeeeeeeeeee....

Link to comment
Share on other sites

nur wurde die Änderung nicht angenommen und der Fehler besteht somit weiterhin.

Dann kommt diese Abfrage doch nicht aus der default.php, sondern woanders her...da musst du suchen gehen! das einklammern hilft auf jedenfall wie du siehst, manuell hast du ja abgefragt, allerdings musst du in den scripten die abfrage finden und dort ebenfalls hübsch einklammern...ich weiß das das problem vom join kommt :)

Link to comment
Share on other sites

Ein freundliches Hallo an alle ....

ich komme gerade aus dem Urlaub und freue mich über die akute Fehlermeldung. Von Umsatzaufall wollen wir gar nicht sprechen.

Umlaute gibt es auch nicht mehr.

Könntet Ihr mir bitte helfen. Wäre wirklich sehr dankbar.

Hier kommt die Fehlermeldung:

1054 - Unknown column 'p.products_id' in 'on clause'

select p.products_fsk18, p.products_shippingtime, p.products_model, p.products_ean, pd.products_name, m.manufacturers_name, p.products_quantity, p.products_image, p.products_weight, pd.products_short_description, pd.products_description, p.products_id, p.manufacturers_id, p.products_price, p.products_discount_allowed, p.products_tax_class_id from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '2' and p2c.categories_id = '20' ORDER BY pd.products_name ASC

[XT SQL Error]

Hier der Shop: www.senfgourmet.de

Vielen Dank im Voraus

Gruß Dietolino

Link to comment
Share on other sites

Das ganze passiert gleich bei der index.php

$category_depth = 'top';
if (isset($cPath) && xtc_not_null($cPath)) {
$categories_products_query = "select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . $current_category_id . "'";
$categories_products_query = xtDBquery($categories_products_query);
$cateqories_products = xtc_db_fetch_array(&$categories_products_query,true);
if ($cateqories_products['total'] > 0) {
$category_depth = 'products'; // display products
} else {
$category_parent_query = "select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . $current_category_id . "'";
$category_parent_query = xtDBquery($category_parent_query);
$category_parent = xtc_db_fetch_array(&$category_parent_query,true);
if ($category_parent['total'] > 0) {
$category_depth = 'nested'; // navigate through the categories
} else {
$category_depth = 'products'; // category has no products, but display the 'no products' message
}
}
}[/php]

Falls du noch weitere Infos brauchst - bitte posten - ich versuche dann so schnell wie möglich alles nötige zu liefern.

Und das alles nur nach der Umstellung von Host Europe und deren SQL Datenbanken *grmpff*

Eingesetzt wird [font=Verdana, Arial, Helvetica, sans-serif][size=2][color=#d68000][b]xt:Commerce v3.0.3

[color=Black]Gruß & großen Dank für jegliche Hilfe![/color]

[/b][/color][/size][/font]

Link to comment
Share on other sites

Mist - in der Suche passierts ja leider auch :(

Kann den Syntax dort aber nicht finden ?!?

<?php
/* -----------------------------------------------------------------------------------------
$Id: advanced_search_result.php,v 1.9 2004/05/08 18:13:41 fanta2k Exp $

XT-Commerce - community made shopping
http://www.xt-commerce.com

Copyright (c) 2003 XT-Commerce
-----------------------------------------------------------------------------------------
based on:
(c) 2000-2001 The Exchange Project (earlier name of osCommerce)
(c) 2002-2003 osCommerce(advanced_search_result.php,v 1.68 2003/05/14); www.oscommerce.com
(c) 2003 nextcommerce (advanced_search_result.php,v 1.17 2003/08/21); www.nextcommerce.org

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

include( 'includes/application_top.php');
// create smarty elements
$smarty = new Smarty;
// include boxes
require(DIR_FS_CATALOG .'templates/'.CURRENT_TEMPLATE. '/source/boxes.php');
// include needed functions
require_once(DIR_FS_INC . 'xtc_parse_search_string.inc.php');
require_once(DIR_FS_INC . 'xtc_get_subcategories.inc.php');
require_once(DIR_FS_INC . 'xtc_parse_search_string.inc.php');
require_once(DIR_FS_INC . 'xtc_parse_search_string.inc.php');
require_once(DIR_FS_INC . 'xtc_parse_search_string.inc.php');
require_once(DIR_FS_INC . 'xtc_checkdate.inc.php');
require_once(DIR_FS_INC . 'xtc_get_currencies_values.inc.php');


$error = 0; // reset error flag to false
$errorno = 0;

if ( (isset($_GET['keywords']) && empty($_GET['keywords'])) &&
(isset($_GET['dfrom']) && (empty($_GET['dfrom']) || ($_GET['dfrom'] == DOB_FORMAT_STRING))) &&
(isset($_GET['dto']) && (empty($_GET['dto']) || ($_GET['dto'] == DOB_FORMAT_STRING))) &&
(isset($_GET['pfrom']) && empty($_GET['pfrom'])) &&
(isset($_GET['pto']) && empty($_GET['pto'])) ) {
$errorno += 1;
$error = 1;
}

$dfrom_to_check = (($_GET['dfrom'] == DOB_FORMAT_STRING) ? '' : $_GET['dfrom']);
$dto_to_check = (($_GET['dto'] == DOB_FORMAT_STRING) ? '' : $_GET['dto']);

if (strlen($dfrom_to_check) > 0) {
if (!xtc_checkdate($dfrom_to_check, DOB_FORMAT_STRING, $dfrom_array)) {
$errorno += 10;
$error = 1;
}
}

if (strlen($dto_to_check) > 0) {
if (!xtc_checkdate($dto_to_check, DOB_FORMAT_STRING, $dto_array)) {
$errorno += 100;
$error = 1;
}
}

if (strlen($dfrom_to_check) > 0 && !(($errorno & 10) == 10) && strlen($dto_to_check) > 0 && !(($errorno & 100) == 100)) {
if (mktime(0, 0, 0, $dfrom_array[1], $dfrom_array[2], $dfrom_array[0]) > mktime(0, 0, 0, $dto_array[1], $dto_array[2], $dto_array[0])) {
$errorno += 1000;
$error = 1;
}
}

if (strlen($_GET['pfrom']) > 0) {
$pfrom_to_check = $_GET['pfrom'];
if (!settype($pfrom_to_check, "double")) {
$errorno += 10000;
$error = 1;
}
}

if (strlen($_GET['pto']) > 0) {
$pto_to_check = $_GET['pto'];
if (!settype($pto_to_check, "double")) {
$errorno += 100000;
$error = 1;
}
}

if (strlen($_GET['pfrom']) > 0 && !(($errorno & 10000) == 10000) && strlen($_GET['pto']) > 0 && !(($errorno & 100000) == 100000)) {
if ($pfrom_to_check > $pto_to_check) {
$errorno += 1000000;
$error = 1;
}
}

if (strlen($_GET['keywords']) > 0) {
if (!xtc_parse_search_string(stripslashes($_GET['keywords']), $search_keywords)) {
$errorno += 10000000;
$error = 1;
}
}

if ($error == 1) {
xtc_redirect(xtc_href_link(FILENAME_ADVANCED_SEARCH, 'errorno=' . $errorno . '&' . xtc_get_all_get_params(array('x', 'y'))));
} else {
$breadcrumb->add(NAVBAR_TITLE1_ADVANCED_SEARCH, xtc_href_link(FILENAME_ADVANCED_SEARCH));
$breadcrumb->add(NAVBAR_TITLE2_ADVANCED_SEARCH, xtc_href_link(FILENAME_ADVANCED_SEARCH_RESULT, 'keywords=' . $_GET['keywords'] . '&search_in_description=' . $_GET['search_in_description'] . '&categories_id=' . $_GET['categories_id'] . '&inc_subcat=' . $_GET['inc_subcat'] . '&manufacturers_id=' . $_GET['manufacturers_id'] . '&pfrom=' . $_GET['pfrom'] . '&pto=' . $_GET['pto'] . '&dfrom=' . $_GET['dfrom'] . '&dto=' . $_GET['dto']));

require(DIR_WS_INCLUDES . 'header.php');

//fsk18 lock
$fsk_lock='';
if ($_SESSION['customers_status']['customers_fsk18_display']=='0') {
$fsk_lock=' AND p.products_fsk18!=1';
}
// create column list
$select_str = "SELECT DISTINCT
p.products_model,
pov.products_options_values_name,
pd.products_name,
m.manufacturers_name,
p.products_quantity,
p.products_shippingtime,
p.products_fsk18,
p.products_image,
p.products_weight,
pd.products_short_description,
pd.products_description,
m.manufacturers_id,
p.products_id,
pd.products_name,
p.products_price,
p.products_tax_class_id ";

if ( (DISPLAY_PRICE_WITH_TAX == 'true') && ( (isset($_GET['pfrom']) && xtc_not_null($_GET['pfrom'])) || (isset($_GET['pto']) && xtc_not_null($_GET['pto']))) ) {
$select_str .= ", SUM(tr.tax_rate) AS tax_rate ";
}

$from_str = "FROM " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd LEFT JOIN " . TABLE_SPECIALS . " s ON p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_PRODUCTS . " LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa ON p.products_id = pa.products_id LEFT JOIN " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov ON pa.options_values_id = pov.products_options_values_id ";

if ( (DISPLAY_PRICE_WITH_TAX == 'true') && ( (isset($_GET['pfrom']) && xtc_not_null($_GET['pfrom'])) || (isset($_GET['pto']) && xtc_not_null($_GET['pto']))) ) {
if (!isset($_SESSION['customer_country_id'])) {
$_SESSION['customer_country_id'] = STORE_COUNTRY;
$_SESSION['customer_zone_id'] = STORE_ZONE;
}
$from_str .= " LEFT JOIN " . TABLE_TAX_RATES . " tr ON p.products_tax_class_id = tr.tax_class_id LEFT JOIN " . TABLE_ZONES_TO_GEO_ZONES . " gz ON tr.tax_zone_id = gz.geo_zone_id AND (gz.zone_country_id IS NULL OR gz.zone_country_id = '0' OR gz.zone_country_id = '" . (int)$_SESSION['customer_country_id'] . "') AND (gz.zone_id is null OR gz.zone_id = '0' OR gz.zone_id = '" . (int)$_SESSION['customer_zone_id'] . "')";
}
if (GROUP_CHECK=='true') {
$group_check="AND p.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'";
}
$where_str = " WHERE p.products_status = '1' ".$fsk_lock." AND
p.products_id = pd.products_id
AND pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
AND p.products_id = p2c.products_id
".$group_check."
AND p2c.categories_id = c.categories_id ";

if (isset($_GET['categories_id']) && xtc_not_null($_GET['categories_id'])) {
if ($_GET['inc_subcat'] == '1') {
$subcategories_array = array();
xtc_get_subcategories($subcategories_array, $_GET['categories_id']);
$where_str .= " AND p2c.products_id = p.products_id AND p2c.products_id = pd.products_id AND (p2c.categories_id = '" . (int)$_GET['categories_id'] . "'";
for ($i=0, $n=sizeof($subcategories_array); $i<$n; $i++ ) {
$where_str .= " OR p2c.categories_id = '" . $subcategories_array[$i] . "'";
}
$where_str .= ")";
} else {
$where_str .= " AND p2c.products_id = p.products_id AND p2c.products_id = pd.products_id AND pd.language_id = '" . (int)$_SESSION['languages_id'] . "' and p2c.categories_id = '" . (int)$_GET['categories_id'] . "'";
}
}

if (isset($_GET['manufacturers_id']) && xtc_not_null($_GET['manufacturers_id'])) {
$where_str .= " AND m.manufacturers_id = '" . $_GET['manufacturers_id'] . "'";
}

if (isset($_GET['keywords']) && xtc_not_null($_GET['keywords'])) {
if (xtc_parse_search_string(stripslashes($_GET['keywords']), $search_keywords)) {
$where_str .= " AND (";
for ($i=0, $n=sizeof($search_keywords); $i<$n; $i++ ) {
switch ($search_keywords[$i]) {
case '(':
case ')':
case 'and':
case 'or':
$where_str .= " " . $search_keywords[$i] . " ";
break;
default:
//products with attributes etc
$where_str .= " p.products_id = pa.products_id AND (pd.products_name LIKE '%" . addslashes($search_keywords[$i]) . "%' OR p.products_model LIKE '%" . addslashes($search_keywords[$i]) . "%' OR p.products_ean like '%" . addslashes($search_keywords[$i]) . "%' OR m.manufacturers_name LIKE '%" . addslashes($search_keywords[$i]) . "%' OR pov.products_options_values_name LIKE '%" . addslashes($search_keywords[$i]) . "%'";
$where_str .= " OR pd.products_description LIKE '%" . addslashes($search_keywords[$i]) . "%' OR pd.products_short_description LIKE '%" . addslashes($search_keywords[$i]) . "%' OR pa.attributes_model LIKE '%" . addslashes($search_keywords[$i]) . "%'";
$where_str .= ')';
//or (products without attributes) etc
$where_str .= " OR (pd.products_name LIKE '%" . addslashes($search_keywords[$i]) . "%' OR p.products_model like '%" . addslashes($search_keywords[$i]) . "%' OR p.products_ean LIKE '%" . addslashes($search_keywords[$i]) . "%' OR m.manufacturers_name LIKE '%" . addslashes($search_keywords[$i]) . "%'";
$where_str .= " OR pd.products_description LIKE '%" . addslashes($search_keywords[$i]) . "%' OR pd.products_short_description LIKE '%" . addslashes($search_keywords[$i]) . "%'";
$where_str .= ')';
break;
}
}
$where_str .= " )";
}
}

if (isset($_GET['dfrom']) && xtc_not_null($_GET['dfrom']) && ($_GET['dfrom'] != DOB_FORMAT_STRING)) {
$where_str .= " AND p.products_date_added >= '" . xtc_date_raw($dfrom_to_check) . "'";
}

if (isset($_GET['dto']) && xtc_not_null($_GET['dto']) && ($_GET['dto'] != DOB_FORMAT_STRING)) {
$where_str .= " AND p.products_date_added <= '" . xtc_date_raw($dto_to_check) . "'";
}

$rate=xtc_get_currencies_values($_SESSION['currency']);
$rate=$rate['value'];
if ($rate && $_GET['pfrom'] != '') {
$pfrom = $_GET['pfrom'] / $rate;
}
if ($rate && $_GET['pto'] != '') {
$pto = $_GET['pto'] / $rate;
}

if ($pfrom !='') $where_str .= " AND (IF(s.status, s.specials_new_products_price, p.products_price) >= " . $pfrom . ")";
if ($pto !='') $where_str .= " AND (IF(s.status, s.specials_new_products_price, p.products_price) <= " . $pto . ")";

$order_str = ' GROUP BY pd.products_id ORDER BY pd.products_name';

$listing_sql = $select_str . $from_str . $where_str . $order_str;
require(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);
}
$smarty->assign('language', $_SESSION['language']);
$smarty->caching = 0;
if (!defined(RM)) $smarty->load_filter('output', 'note');
$smarty->display(CURRENT_TEMPLATE . '/index.html');
?>[/php]

Link to comment
Share on other sites

also was du da aus der index.php gedingst hast isses nicht!

dort heisst es select count(*) es werden also die zeilen gezählt...die fehlermeldung sagt aber select p.products_fsk18, p... dort werden die Daten rausgholt...musste mal weitersuchen.

und wegens deinem zweiten posting wirst du den script wahrscheinlich in der advanced_search_result.php finden. Wenn das der script daraus is, dann probier mal das. (komplett ersetzen) ich hoffe ich hab mich nicht verzählt. im fehlerfall noch mal die fehlermeldung hier reinwerfen :D

 [COLOR=#000000][COLOR=#0000bb][FONT=Courier New]<?php

[/FONT][/COLOR][FONT=Courier New][COLOR=#ff8000]/* -----------------------------------------------------------------------------------------

   $Id: advanced_search_result.php,v 1.9 2004/05/08 18:13:41 fanta2k Exp $   


   XT-Commerce - community made shopping

   http://www.xt-commerce.com


   Copyright (c) 2003 XT-Commerce

   -----------------------------------------------------------------------------------------

   based on: 

   (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)

   (c) 2002-2003 osCommerce(advanced_search_result.php,v 1.68 2003/05/14); www.oscommerce.com 

   (c) 2003     nextcommerce (advanced_search_result.php,v 1.17 2003/08/21); www.nextcommerce.org


   Released under the GNU General Public License 

   ---------------------------------------------------------------------------------------*/


  [/COLOR][COLOR=#007700]include( [/COLOR][COLOR=#dd0000]'includes/application_top.php'[/COLOR][/FONT][COLOR=#007700][FONT=Courier New]);

      [/FONT][/COLOR][FONT=Courier New][COLOR=#ff8000]// create smarty elements

  [/COLOR][COLOR=#0000bb]$smarty [/COLOR][COLOR=#007700]= new [/COLOR][COLOR=#0000bb]Smarty[/COLOR][/FONT][COLOR=#007700][FONT=Courier New];

  [/FONT][/COLOR][FONT=Courier New][COLOR=#ff8000]// include boxes

  [/COLOR][COLOR=#007700]require([/COLOR][COLOR=#0000bb]DIR_FS_CATALOG [/COLOR][COLOR=#007700].[/COLOR][COLOR=#dd0000]'templates/'[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]CURRENT_TEMPLATE[/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]'/source/boxes.php'[/COLOR][/FONT][COLOR=#007700][FONT=Courier New]); 

  [/FONT][/COLOR][FONT=Courier New][COLOR=#ff8000]// include needed functions

  [/COLOR][COLOR=#007700]require_once([/COLOR][COLOR=#0000bb]DIR_FS_INC [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]'xtc_parse_search_string.inc.php'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]);

  require_once([/COLOR][COLOR=#0000bb]DIR_FS_INC [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]'xtc_get_subcategories.inc.php'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]);

  require_once([/COLOR][COLOR=#0000bb]DIR_FS_INC [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]'xtc_parse_search_string.inc.php'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]);

  require_once([/COLOR][COLOR=#0000bb]DIR_FS_INC [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]'xtc_parse_search_string.inc.php'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]);

  require_once([/COLOR][COLOR=#0000bb]DIR_FS_INC [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]'xtc_parse_search_string.inc.php'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]);

  require_once([/COLOR][COLOR=#0000bb]DIR_FS_INC [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]'xtc_checkdate.inc.php'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]);

  require_once([/COLOR][COLOR=#0000bb]DIR_FS_INC [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]'xtc_get_currencies_values.inc.php'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]);



  [/COLOR][COLOR=#0000bb]$error [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700]; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// reset error flag to false

  [/COLOR][COLOR=#0000bb]$errorno [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]0[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];


  if ( (isset([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'keywords'[/COLOR][COLOR=#007700]]) && empty([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'keywords'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]])) &&

       (isset([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dfrom'[/COLOR][COLOR=#007700]]) && (empty([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dfrom'[/COLOR][COLOR=#007700]]) || ([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dfrom'[/COLOR][COLOR=#007700]] == [/COLOR][COLOR=#0000bb]DOB_FORMAT_STRING[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]))) &&

       (isset([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dto'[/COLOR][COLOR=#007700]]) && (empty([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dto'[/COLOR][COLOR=#007700]]) || ([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dto'[/COLOR][COLOR=#007700]] == [/COLOR][COLOR=#0000bb]DOB_FORMAT_STRING[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]))) &&

       (isset([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pfrom'[/COLOR][COLOR=#007700]]) && empty([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pfrom'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]])) &&

       (isset([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pto'[/COLOR][COLOR=#007700]]) && empty([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pto'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]])) ) {

    [/COLOR][COLOR=#0000bb]$errorno [/COLOR][COLOR=#007700]+= [/COLOR][COLOR=#0000bb]1[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

    [/COLOR][COLOR=#0000bb]$error [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]1[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

  }


  [/COLOR][COLOR=#0000bb]$dfrom_to_check [/COLOR][COLOR=#007700]= (([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dfrom'[/COLOR][COLOR=#007700]] == [/COLOR][COLOR=#0000bb]DOB_FORMAT_STRING[/COLOR][COLOR=#007700]) ? [/COLOR][COLOR=#dd0000]'' [/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dfrom'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]]);

  [/COLOR][COLOR=#0000bb]$dto_to_check [/COLOR][COLOR=#007700]= (([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dto'[/COLOR][COLOR=#007700]] == [/COLOR][COLOR=#0000bb]DOB_FORMAT_STRING[/COLOR][COLOR=#007700]) ? [/COLOR][COLOR=#dd0000]'' [/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dto'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]]);


  if ([/COLOR][COLOR=#0000bb]strlen[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$dfrom_to_check[/COLOR][COLOR=#007700]) > [/COLOR][COLOR=#0000bb]0[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]) {

    if (![/COLOR][COLOR=#0000bb]xtc_checkdate[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$dfrom_to_check[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]DOB_FORMAT_STRING[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$dfrom_array[/COLOR][/FONT][FONT=Courier New][COLOR=#007700])) {

      [/COLOR][COLOR=#0000bb]$errorno [/COLOR][COLOR=#007700]+= [/COLOR][COLOR=#0000bb]10[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

      [/COLOR][COLOR=#0000bb]$error [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]1[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

    }

  }  


  if ([/COLOR][COLOR=#0000bb]strlen[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$dto_to_check[/COLOR][COLOR=#007700]) > [/COLOR][COLOR=#0000bb]0[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]) {

    if (![/COLOR][COLOR=#0000bb]xtc_checkdate[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$dto_to_check[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]DOB_FORMAT_STRING[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$dto_array[/COLOR][/FONT][FONT=Courier New][COLOR=#007700])) {

      [/COLOR][COLOR=#0000bb]$errorno [/COLOR][COLOR=#007700]+= [/COLOR][COLOR=#0000bb]100[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

      [/COLOR][COLOR=#0000bb]$error [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]1[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

    }

  }  


  if ([/COLOR][COLOR=#0000bb]strlen[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$dfrom_to_check[/COLOR][COLOR=#007700]) > [/COLOR][COLOR=#0000bb]0 [/COLOR][COLOR=#007700]&& !(([/COLOR][COLOR=#0000bb]$errorno [/COLOR][COLOR=#007700]& [/COLOR][COLOR=#0000bb]10[/COLOR][COLOR=#007700]) == [/COLOR][COLOR=#0000bb]10[/COLOR][COLOR=#007700]) && [/COLOR][COLOR=#0000bb]strlen[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$dto_to_check[/COLOR][COLOR=#007700]) > [/COLOR][COLOR=#0000bb]0 [/COLOR][COLOR=#007700]&& !(([/COLOR][COLOR=#0000bb]$errorno [/COLOR][COLOR=#007700]& [/COLOR][COLOR=#0000bb]100[/COLOR][COLOR=#007700]) == [/COLOR][COLOR=#0000bb]100[/COLOR][/FONT][FONT=Courier New][COLOR=#007700])) {

    if ([/COLOR][COLOR=#0000bb]mktime[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$dfrom_array[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]1[/COLOR][COLOR=#007700]], [/COLOR][COLOR=#0000bb]$dfrom_array[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]2[/COLOR][COLOR=#007700]], [/COLOR][COLOR=#0000bb]$dfrom_array[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700]]) > [/COLOR][COLOR=#0000bb]mktime[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$dto_array[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]1[/COLOR][COLOR=#007700]], [/COLOR][COLOR=#0000bb]$dto_array[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]2[/COLOR][COLOR=#007700]], [/COLOR][COLOR=#0000bb]$dto_array[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]0[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]])) {

      [/COLOR][COLOR=#0000bb]$errorno [/COLOR][COLOR=#007700]+= [/COLOR][COLOR=#0000bb]1000[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

      [/COLOR][COLOR=#0000bb]$error [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]1[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

    }

  }


  if ([/COLOR][COLOR=#0000bb]strlen[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pfrom'[/COLOR][COLOR=#007700]]) > [/COLOR][COLOR=#0000bb]0[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]) {

    [/COLOR][COLOR=#0000bb]$pfrom_to_check [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pfrom'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]];

    if (![/COLOR][COLOR=#0000bb]settype[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$pfrom_to_check[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]"double"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700])) {

      [/COLOR][COLOR=#0000bb]$errorno [/COLOR][COLOR=#007700]+= [/COLOR][COLOR=#0000bb]10000[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

      [/COLOR][COLOR=#0000bb]$error [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]1[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

    }

  }


  if ([/COLOR][COLOR=#0000bb]strlen[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pto'[/COLOR][COLOR=#007700]]) > [/COLOR][COLOR=#0000bb]0[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]) {

    [/COLOR][COLOR=#0000bb]$pto_to_check [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pto'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]];

    if (![/COLOR][COLOR=#0000bb]settype[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$pto_to_check[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]"double"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700])) {

      [/COLOR][COLOR=#0000bb]$errorno [/COLOR][COLOR=#007700]+= [/COLOR][COLOR=#0000bb]100000[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

      [/COLOR][COLOR=#0000bb]$error [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]1[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

    }

  }


  if ([/COLOR][COLOR=#0000bb]strlen[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pfrom'[/COLOR][COLOR=#007700]]) > [/COLOR][COLOR=#0000bb]0 [/COLOR][COLOR=#007700]&& !(([/COLOR][COLOR=#0000bb]$errorno [/COLOR][COLOR=#007700]& [/COLOR][COLOR=#0000bb]10000[/COLOR][COLOR=#007700]) == [/COLOR][COLOR=#0000bb]10000[/COLOR][COLOR=#007700]) && [/COLOR][COLOR=#0000bb]strlen[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pto'[/COLOR][COLOR=#007700]]) > [/COLOR][COLOR=#0000bb]0 [/COLOR][COLOR=#007700]&& !(([/COLOR][COLOR=#0000bb]$errorno [/COLOR][COLOR=#007700]& [/COLOR][COLOR=#0000bb]100000[/COLOR][COLOR=#007700]) == [/COLOR][COLOR=#0000bb]100000[/COLOR][/FONT][FONT=Courier New][COLOR=#007700])) {

    if ([/COLOR][COLOR=#0000bb]$pfrom_to_check [/COLOR][COLOR=#007700]> [/COLOR][COLOR=#0000bb]$pto_to_check[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]) {

      [/COLOR][COLOR=#0000bb]$errorno [/COLOR][COLOR=#007700]+= [/COLOR][COLOR=#0000bb]1000000[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

      [/COLOR][COLOR=#0000bb]$error [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]1[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

    }

  }


  if ([/COLOR][COLOR=#0000bb]strlen[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'keywords'[/COLOR][COLOR=#007700]]) > [/COLOR][COLOR=#0000bb]0[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]) {

    if (![/COLOR][COLOR=#0000bb]xtc_parse_search_string[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]stripslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'keywords'[/COLOR][COLOR=#007700]]), [/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][/FONT][FONT=Courier New][COLOR=#007700])) {

      [/COLOR][COLOR=#0000bb]$errorno [/COLOR][COLOR=#007700]+= [/COLOR][COLOR=#0000bb]10000000[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

      [/COLOR][COLOR=#0000bb]$error [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]1[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

    }

  }


  if ([/COLOR][COLOR=#0000bb]$error [/COLOR][COLOR=#007700]== [/COLOR][COLOR=#0000bb]1[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]) {

    [/COLOR][COLOR=#0000bb]xtc_redirect[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]xtc_href_link[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]FILENAME_ADVANCED_SEARCH[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]'errorno=' [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$errorno [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]'&' [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]xtc_get_all_get_params[/COLOR][COLOR=#007700](array([/COLOR][COLOR=#dd0000]'x'[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]'y'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]))));

  } else {

    [/COLOR][COLOR=#0000bb]$breadcrumb[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000bb]add[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]NAVBAR_TITLE1_ADVANCED_SEARCH[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]xtc_href_link[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]FILENAME_ADVANCED_SEARCH[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]));

    [/COLOR][COLOR=#0000bb]$breadcrumb[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000bb]add[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]NAVBAR_TITLE2_ADVANCED_SEARCH[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]xtc_href_link[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]FILENAME_ADVANCED_SEARCH_RESULT[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]'keywords=' [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'keywords'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]'&search_in_description=' [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'search_in_description'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]'&categories_id=' [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'categories_id'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]'&inc_subcat=' [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'inc_subcat'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]'&manufacturers_id=' [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'manufacturers_id'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]'&pfrom=' [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pfrom'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]'&pto=' [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pto'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]'&dfrom=' [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dfrom'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]'&dto=' [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dto'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]]));


 require([/COLOR][COLOR=#0000bb]DIR_WS_INCLUDES [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]'header.php'[/COLOR][/FONT][COLOR=#007700][FONT=Courier New]);


     [/FONT][/COLOR][FONT=Courier New][COLOR=#ff8000]//fsk18 lock

  [/COLOR][COLOR=#0000bb]$fsk_lock[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#dd0000]''[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

  if ([/COLOR][COLOR=#0000bb]$_SESSION[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'customers_status'[/COLOR][COLOR=#007700]][[/COLOR][COLOR=#dd0000]'customers_fsk18_display'[/COLOR][COLOR=#007700]]==[/COLOR][COLOR=#dd0000]'0'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]) {

  [/COLOR][COLOR=#0000bb]$fsk_lock[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#dd0000]' AND p.products_fsk18!=1'[/COLOR][/FONT][COLOR=#007700][FONT=Courier New];

  }

  [/FONT][/COLOR][FONT=Courier New][COLOR=#ff8000]// create column list

  [/COLOR][COLOR=#0000bb]$select_str [/COLOR][COLOR=#007700]= [/COLOR][/FONT][COLOR=#dd0000][FONT=Courier New]"SELECT DISTINCT 

                   p.products_model,

                   pov.products_options_values_name, 

                 pd.products_name,

                 m.manufacturers_name,

                 p.products_quantity,

                 p.products_shippingtime,

                 p.products_fsk18,

                 p.products_image,

                 p.products_weight,

                 pd.products_short_description,

                 pd.products_description,

                 m.manufacturers_id,

                 p.products_id,

                 pd.products_name,

                 p.products_price,

                 p.products_tax_class_id "[/FONT][/COLOR][FONT=Courier New][COLOR=#007700];


  if ( ([/COLOR][COLOR=#0000bb]DISPLAY_PRICE_WITH_TAX [/COLOR][COLOR=#007700]== [/COLOR][COLOR=#dd0000]'true'[/COLOR][COLOR=#007700]) && ( (isset([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pfrom'[/COLOR][COLOR=#007700]]) && [/COLOR][COLOR=#0000bb]xtc_not_null[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pfrom'[/COLOR][COLOR=#007700]])) || (isset([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pto'[/COLOR][COLOR=#007700]]) && [/COLOR][COLOR=#0000bb]xtc_not_null[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pto'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]]))) ) {

    [/COLOR][COLOR=#0000bb]$select_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]", SUM(tr.tax_rate) AS tax_rate "[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

  }


    [/COLOR][COLOR=#0000bb]$from_str [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"FROM (((((" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]TABLE_PRODUCTS [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]" p) LEFT JOIN " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]TABLE_MANUFACTURERS [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]" m using(manufacturers_id), " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]TABLE_PRODUCTS_DESCRIPTION [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]" pd) LEFT JOIN " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]TABLE_SPECIALS [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]" s ON p.products_id = s.products_id, " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]TABLE_CATEGORIES [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]" c, " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]TABLE_PRODUCTS_TO_CATEGORIES [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]" p2c, " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]TABLE_PRODUCTS [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]") LEFT JOIN " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]TABLE_PRODUCTS_ATTRIBUTES [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]" pa ON p.products_id = pa.products_id) LEFT JOIN " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]TABLE_PRODUCTS_OPTIONS_VALUES [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]" pov ON pa.options_values_id = pov.products_options_values_id "[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];


  if ( ([/COLOR][COLOR=#0000bb]DISPLAY_PRICE_WITH_TAX [/COLOR][COLOR=#007700]== [/COLOR][COLOR=#dd0000]'true'[/COLOR][COLOR=#007700]) && ( (isset([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pfrom'[/COLOR][COLOR=#007700]]) && [/COLOR][COLOR=#0000bb]xtc_not_null[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pfrom'[/COLOR][COLOR=#007700]])) || (isset([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pto'[/COLOR][COLOR=#007700]]) && [/COLOR][COLOR=#0000bb]xtc_not_null[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pto'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]]))) ) {

    if (!isset([/COLOR][COLOR=#0000bb]$_SESSION[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'customer_country_id'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]])) {

      [/COLOR][COLOR=#0000bb]$_SESSION[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'customer_country_id'[/COLOR][COLOR=#007700]] = [/COLOR][COLOR=#0000bb]STORE_COUNTRY[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

      [/COLOR][COLOR=#0000bb]$_SESSION[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'customer_zone_id'[/COLOR][COLOR=#007700]] = [/COLOR][COLOR=#0000bb]STORE_ZONE[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

    }

    [/COLOR][COLOR=#0000bb]$from_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]") LEFT JOIN " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]TABLE_TAX_RATES [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]" tr ON p.products_tax_class_id = tr.tax_class_id) LEFT JOIN " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]TABLE_ZONES_TO_GEO_ZONES [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]" gz ON tr.tax_zone_id = gz.geo_zone_id AND (gz.zone_country_id IS NULL OR gz.zone_country_id = '0' OR gz.zone_country_id = '" [/COLOR][COLOR=#007700]. (int)[/COLOR][COLOR=#0000bb]$_SESSION[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'customer_country_id'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]"') AND (gz.zone_id is null OR gz.zone_id = '0' OR gz.zone_id = '" [/COLOR][COLOR=#007700]. (int)[/COLOR][COLOR=#0000bb]$_SESSION[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'customer_zone_id'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]"')"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

  }

    if ([/COLOR][COLOR=#0000bb]GROUP_CHECK[/COLOR][COLOR=#007700]==[/COLOR][COLOR=#dd0000]'true'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]) {

   [/COLOR][COLOR=#0000bb]$group_check[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#dd0000]"AND p.group_ids LIKE '%c_"[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]$_SESSION[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'customers_status'[/COLOR][COLOR=#007700]][[/COLOR][COLOR=#dd0000]'customers_status_id'[/COLOR][COLOR=#007700]].[/COLOR][COLOR=#dd0000]"_group%'"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

  }

  [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]" WHERE p.products_status = '1' "[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]$fsk_lock[/COLOR][COLOR=#007700].[/COLOR][/FONT][FONT=Courier New][COLOR=#dd0000]" AND

                 p.products_id = pd.products_id

                 AND pd.language_id = '" [/COLOR][COLOR=#007700]. (int)[/COLOR][COLOR=#0000bb]$_SESSION[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'languages_id'[/COLOR][COLOR=#007700]] . [/COLOR][/FONT][FONT=Courier New][COLOR=#dd0000]"'

                 AND p.products_id = p2c.products_id

                 "[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]$group_check[/COLOR][COLOR=#007700].[/COLOR][/FONT][COLOR=#dd0000][FONT=Courier New]"

                 AND p2c.categories_id = c.categories_id "[/FONT][/COLOR][FONT=Courier New][COLOR=#007700];


  if (isset([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'categories_id'[/COLOR][COLOR=#007700]]) && [/COLOR][COLOR=#0000bb]xtc_not_null[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'categories_id'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]])) {

    if ([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'inc_subcat'[/COLOR][COLOR=#007700]] == [/COLOR][COLOR=#dd0000]'1'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]) {

      [/COLOR][COLOR=#0000bb]$subcategories_array [/COLOR][/FONT][FONT=Courier New][COLOR=#007700]= array();

      [/COLOR][COLOR=#0000bb]xtc_get_subcategories[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$subcategories_array[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'categories_id'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]]);

      [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]" AND p2c.products_id = p.products_id AND p2c.products_id = pd.products_id AND (p2c.categories_id = '" [/COLOR][COLOR=#007700]. (int)[/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'categories_id'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]"'"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

      for ([/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$n[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]sizeof[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$subcategories_array[/COLOR][COLOR=#007700]); [/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]<[/COLOR][COLOR=#0000bb]$n[/COLOR][COLOR=#007700]; [/COLOR][COLOR=#0000bb]$i[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]++ ) {

        [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]" OR p2c.categories_id = '" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$subcategories_array[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]"'"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

      }

      [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]")"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

    } else {

      [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]" AND p2c.products_id = p.products_id AND p2c.products_id = pd.products_id AND pd.language_id = '" [/COLOR][COLOR=#007700]. (int)[/COLOR][COLOR=#0000bb]$_SESSION[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'languages_id'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]"' and p2c.categories_id = '" [/COLOR][COLOR=#007700]. (int)[/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'categories_id'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]"'"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

    }

  }


  if (isset([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'manufacturers_id'[/COLOR][COLOR=#007700]]) && [/COLOR][COLOR=#0000bb]xtc_not_null[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'manufacturers_id'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]])) {

    [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]" AND m.manufacturers_id = '" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'manufacturers_id'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]"'"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

  }


  if (isset([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'keywords'[/COLOR][COLOR=#007700]]) && [/COLOR][COLOR=#0000bb]xtc_not_null[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'keywords'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]])) {

    if ([/COLOR][COLOR=#0000bb]xtc_parse_search_string[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]stripslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'keywords'[/COLOR][COLOR=#007700]]), [/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][/FONT][FONT=Courier New][COLOR=#007700])) {

      [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]" AND ("[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

      for ([/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$n[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]sizeof[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700]); [/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]<[/COLOR][COLOR=#0000bb]$n[/COLOR][COLOR=#007700]; [/COLOR][COLOR=#0000bb]$i[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]++ ) {

        switch ([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]]) {

          case [/COLOR][COLOR=#dd0000]'('[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]:

          case [/COLOR][COLOR=#dd0000]')'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]:

          case [/COLOR][COLOR=#dd0000]'and'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]:

          case [/COLOR][COLOR=#dd0000]'or'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]:

            [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]" " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]" "[/COLOR][/FONT][COLOR=#007700][FONT=Courier New];

            break;

          default:

            [/FONT][/COLOR][FONT=Courier New][COLOR=#ff8000]//products with attributes etc

            [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]" p.products_id = pa.products_id AND (pd.products_name LIKE '%" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]addslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]]) . [/COLOR][COLOR=#dd0000]"%' OR p.products_model LIKE '%" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]addslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]]) . [/COLOR][COLOR=#dd0000]"%' OR p.products_ean like '%" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]addslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]]) . [/COLOR][COLOR=#dd0000]"%' OR m.manufacturers_name LIKE '%" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]addslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]]) . [/COLOR][COLOR=#dd0000]"%' OR pov.products_options_values_name LIKE '%" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]addslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]]) . [/COLOR][COLOR=#dd0000]"%'"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

            [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]" OR pd.products_description LIKE '%" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]addslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]]) . [/COLOR][COLOR=#dd0000]"%' OR pd.products_short_description LIKE '%" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]addslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]]) . [/COLOR][COLOR=#dd0000]"%' OR pa.attributes_model LIKE '%" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]addslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]]) . [/COLOR][COLOR=#dd0000]"%'"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

            [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]')'[/COLOR][/FONT][COLOR=#007700][FONT=Courier New];

            [/FONT][/COLOR][FONT=Courier New][COLOR=#ff8000]//or (products without attributes) etc

            [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]" OR (pd.products_name LIKE '%" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]addslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]]) . [/COLOR][COLOR=#dd0000]"%' OR p.products_model like '%" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]addslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]]) . [/COLOR][COLOR=#dd0000]"%' OR p.products_ean LIKE '%" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]addslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]]) . [/COLOR][COLOR=#dd0000]"%' OR m.manufacturers_name LIKE '%" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]addslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]]) . [/COLOR][COLOR=#dd0000]"%'"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

            [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]" OR pd.products_description LIKE '%" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]addslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]]) . [/COLOR][COLOR=#dd0000]"%' OR pd.products_short_description LIKE '%" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]addslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]]) . [/COLOR][COLOR=#dd0000]"%'"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

            [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]')'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];            

            break;

        }

      }

      [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]" )"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

    }

  }


  if (isset([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dfrom'[/COLOR][COLOR=#007700]]) && [/COLOR][COLOR=#0000bb]xtc_not_null[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dfrom'[/COLOR][COLOR=#007700]]) && ([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dfrom'[/COLOR][COLOR=#007700]] != [/COLOR][COLOR=#0000bb]DOB_FORMAT_STRING[/COLOR][/FONT][FONT=Courier New][COLOR=#007700])) {

    [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]" AND p.products_date_added >= '" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]xtc_date_raw[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$dfrom_to_check[/COLOR][COLOR=#007700]) . [/COLOR][COLOR=#dd0000]"'"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

  }


  if (isset([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dto'[/COLOR][COLOR=#007700]]) && [/COLOR][COLOR=#0000bb]xtc_not_null[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dto'[/COLOR][COLOR=#007700]]) && ([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dto'[/COLOR][COLOR=#007700]] != [/COLOR][COLOR=#0000bb]DOB_FORMAT_STRING[/COLOR][/FONT][FONT=Courier New][COLOR=#007700])) {

    [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]" AND p.products_date_added <= '" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]xtc_date_raw[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$dto_to_check[/COLOR][COLOR=#007700]) . [/COLOR][COLOR=#dd0000]"'"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

  }


  [/COLOR][COLOR=#0000bb]$rate[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]xtc_get_currencies_values[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_SESSION[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'currency'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]]);

  [/COLOR][COLOR=#0000bb]$rate[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]$rate[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'value'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]];

  if ([/COLOR][COLOR=#0000bb]$rate [/COLOR][COLOR=#007700]&& [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pfrom'[/COLOR][COLOR=#007700]] != [/COLOR][COLOR=#dd0000]''[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]) {

    [/COLOR][COLOR=#0000bb]$pfrom [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pfrom'[/COLOR][COLOR=#007700]] / [/COLOR][COLOR=#0000bb]$rate[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

  }

  if ([/COLOR][COLOR=#0000bb]$rate [/COLOR][COLOR=#007700]&& [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pto'[/COLOR][COLOR=#007700]] != [/COLOR][COLOR=#dd0000]''[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]) {

      [/COLOR][COLOR=#0000bb]$pto [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pto'[/COLOR][COLOR=#007700]] / [/COLOR][COLOR=#0000bb]$rate[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

  }


  if ([/COLOR][COLOR=#0000bb]$pfrom [/COLOR][COLOR=#007700]!=[/COLOR][COLOR=#dd0000]''[/COLOR][COLOR=#007700]) [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]" AND (IF(s.status, s.specials_new_products_price, p.products_price) >= " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$pfrom [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]")"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

  if ([/COLOR][COLOR=#0000bb]$pto [/COLOR][COLOR=#007700]!=[/COLOR][COLOR=#dd0000]''[/COLOR][COLOR=#007700])   [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]" AND (IF(s.status, s.specials_new_products_price, p.products_price) <= " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$pto [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]")"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];


  [/COLOR][COLOR=#0000bb]$order_str [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]' GROUP BY pd.products_id ORDER BY pd.products_name'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];


  [/COLOR][COLOR=#0000bb]$listing_sql [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]$select_str [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$from_str [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$order_str[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

  require([/COLOR][COLOR=#0000bb]DIR_WS_MODULES [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]FILENAME_PRODUCT_LISTING[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]);

}

  [/COLOR][COLOR=#0000bb]$smarty[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000bb]assign[/COLOR][COLOR=#007700]([/COLOR][COLOR=#dd0000]'language'[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$_SESSION[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'language'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]]);

  [/COLOR][COLOR=#0000bb]$smarty[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000bb]caching [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]0[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

  if (![/COLOR][COLOR=#0000bb]defined[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]RM[/COLOR][COLOR=#007700])) [/COLOR][COLOR=#0000bb]$smarty[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000bb]load_filter[/COLOR][COLOR=#007700]([/COLOR][COLOR=#dd0000]'output'[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]'note'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]);

  [/COLOR][COLOR=#0000bb]$smarty[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000bb]display[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]CURRENT_TEMPLATE [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]'/index.html'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]);

  [/COLOR][COLOR=#0000bb]?>[/COLOR] [/FONT][/COLOR]

Link to comment
Share on other sites

Vielen Dank erstmal für deine Hilfe!

1. 1054 Fehler:

Ich finde ums verrecken nicht den Syntax, habe die gesamten PHP Dateien im Root mal lokal durchsucht nach dem select p.products_fsk18 aber ohne Erfolg.

In der URL steht: http://www.senfgourmet.de/xtcommerce/index.php/cPath/17

Wo die Fehlermeldung von oben erscheint.

In welchem Verzeichnis ausser dem ROOT müsste ich denn noch die PHPs durchsuchen?!?

------------------------

2. PROBLEM

Der Code stammt aus der advanced_search_result.php, nach dem erstetzen mit deinem Code kommt nun eine andere Fehlermeldung:

[COLOR=#000000][B]1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE p.products_status = '1' AND p.products_id = pd.products_' at line 17


SELECT DISTINCT p.products_model, pov.products_options_values_name, pd.products_name, m.manufacturers_name, p.products_quantity, p.products_shippingtime, p.products_fsk18, p.products_image, p.products_weight, pd.products_short_description, pd.products_description, m.manufacturers_id, p.products_id, pd.products_name, p.products_price, p.products_tax_class_id FROM (((((products p) LEFT JOIN manufacturers m using(manufacturers_id), products_description pd) LEFT JOIN specials s ON p.products_id = s.products_id, categories c, products_to_categories p2c, products) LEFT JOIN products_attributes pa ON p.products_id = pa.products_id) LEFT JOIN products_options_values pov ON pa.options_values_id = pov.products_options_values_id WHERE p.products_status = '1' AND p.products_id = pd.products_id AND pd.language_id = '2' AND p.products_id = p2c.products_id AND p2c.categories_id = c.categories_id AND ( p.products_id = pa.products_id AND (pd.products_name LIKE '%salsa%' OR p.products_model LIKE '%salsa%' OR p.products_ean like '%salsa%' OR m.manufacturers_name LIKE '%salsa%' OR pov.products_options_values_name LIKE '%salsa%' OR pd.products_description LIKE '%salsa%' OR pd.products_short_description LIKE '%salsa%' OR pa.attributes_model LIKE '%salsa%') OR (pd.products_name LIKE '%salsa%' OR p.products_model like '%salsa%' OR p.products_ean LIKE '%salsa%' OR m.manufacturers_name LIKE '%salsa%' OR pd.products_description LIKE '%salsa%' OR pd.products_short_description LIKE '%salsa%') ) GROUP BY pd.products_id ORDER BY pd.products_name


[COLOR=#ff0000][XT SQL Error][/COLOR]

[/B][/COLOR]

----

Link to comment
Share on other sites

Wegens dem einen FSK18...es gibt einen solchen auch nicht in der default.php? denn von dort kommt diese fehlermeldung wie ich grad nachforschte...

Dann hab ich mich wohl doch verzählt und ersetze den gesamten script:


[COLOR=#0000bb]<?php

[/COLOR][FONT=Courier New][COLOR=#ff8000]/* -----------------------------------------------------------------------------------------

   $Id: advanced_search_result.php,v 1.9 2004/05/08 18:13:41 fanta2k Exp $   


   XT-Commerce - community made shopping

   http://www.xt-commerce.com


   Copyright (c) 2003 XT-Commerce

   -----------------------------------------------------------------------------------------

   based on: 

   (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)

   (c) 2002-2003 osCommerce(advanced_search_result.php,v 1.68 2003/05/14); www.oscommerce.com 

   (c) 2003     nextcommerce (advanced_search_result.php,v 1.17 2003/08/21); www.nextcommerce.org


   Released under the GNU General Public License 

   ---------------------------------------------------------------------------------------*/


  [/COLOR][COLOR=#007700]include( [/COLOR][COLOR=#dd0000]'includes/application_top.php'[/COLOR][/FONT][COLOR=#007700][FONT=Courier New]);

      [/FONT][/COLOR][FONT=Courier New][COLOR=#ff8000]// create smarty elements

  [/COLOR][COLOR=#0000bb]$smarty [/COLOR][COLOR=#007700]= new [/COLOR][COLOR=#0000bb]Smarty[/COLOR][/FONT][COLOR=#007700][FONT=Courier New];

  [/FONT][/COLOR][FONT=Courier New][COLOR=#ff8000]// include boxes

  [/COLOR][COLOR=#007700]require([/COLOR][COLOR=#0000bb]DIR_FS_CATALOG [/COLOR][COLOR=#007700].[/COLOR][COLOR=#dd0000]'templates/'[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]CURRENT_TEMPLATE[/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]'/source/boxes.php'[/COLOR][/FONT][COLOR=#007700][FONT=Courier New]); 

  [/FONT][/COLOR][FONT=Courier New][COLOR=#ff8000]// include needed functions

  [/COLOR][COLOR=#007700]require_once([/COLOR][COLOR=#0000bb]DIR_FS_INC [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]'xtc_parse_search_string.inc.php'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]);

  require_once([/COLOR][COLOR=#0000bb]DIR_FS_INC [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]'xtc_get_subcategories.inc.php'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]);

  require_once([/COLOR][COLOR=#0000bb]DIR_FS_INC [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]'xtc_parse_search_string.inc.php'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]);

  require_once([/COLOR][COLOR=#0000bb]DIR_FS_INC [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]'xtc_parse_search_string.inc.php'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]);

  require_once([/COLOR][COLOR=#0000bb]DIR_FS_INC [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]'xtc_parse_search_string.inc.php'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]);

  require_once([/COLOR][COLOR=#0000bb]DIR_FS_INC [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]'xtc_checkdate.inc.php'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]);

  require_once([/COLOR][COLOR=#0000bb]DIR_FS_INC [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]'xtc_get_currencies_values.inc.php'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]);



  [/COLOR][COLOR=#0000bb]$error [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700]; [/COLOR][/FONT][FONT=Courier New][COLOR=#ff8000]// reset error flag to false

  [/COLOR][COLOR=#0000bb]$errorno [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]0[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];


  if ( (isset([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'keywords'[/COLOR][COLOR=#007700]]) && empty([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'keywords'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]])) &&

       (isset([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dfrom'[/COLOR][COLOR=#007700]]) && (empty([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dfrom'[/COLOR][COLOR=#007700]]) || ([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dfrom'[/COLOR][COLOR=#007700]] == [/COLOR][COLOR=#0000bb]DOB_FORMAT_STRING[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]))) &&

       (isset([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dto'[/COLOR][COLOR=#007700]]) && (empty([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dto'[/COLOR][COLOR=#007700]]) || ([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dto'[/COLOR][COLOR=#007700]] == [/COLOR][COLOR=#0000bb]DOB_FORMAT_STRING[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]))) &&

       (isset([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pfrom'[/COLOR][COLOR=#007700]]) && empty([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pfrom'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]])) &&

       (isset([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pto'[/COLOR][COLOR=#007700]]) && empty([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pto'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]])) ) {

    [/COLOR][COLOR=#0000bb]$errorno [/COLOR][COLOR=#007700]+= [/COLOR][COLOR=#0000bb]1[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

    [/COLOR][COLOR=#0000bb]$error [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]1[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

  }


  [/COLOR][COLOR=#0000bb]$dfrom_to_check [/COLOR][COLOR=#007700]= (([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dfrom'[/COLOR][COLOR=#007700]] == [/COLOR][COLOR=#0000bb]DOB_FORMAT_STRING[/COLOR][COLOR=#007700]) ? [/COLOR][COLOR=#dd0000]'' [/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dfrom'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]]);

  [/COLOR][COLOR=#0000bb]$dto_to_check [/COLOR][COLOR=#007700]= (([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dto'[/COLOR][COLOR=#007700]] == [/COLOR][COLOR=#0000bb]DOB_FORMAT_STRING[/COLOR][COLOR=#007700]) ? [/COLOR][COLOR=#dd0000]'' [/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dto'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]]);


  if ([/COLOR][COLOR=#0000bb]strlen[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$dfrom_to_check[/COLOR][COLOR=#007700]) > [/COLOR][COLOR=#0000bb]0[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]) {

    if (![/COLOR][COLOR=#0000bb]xtc_checkdate[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$dfrom_to_check[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]DOB_FORMAT_STRING[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$dfrom_array[/COLOR][/FONT][FONT=Courier New][COLOR=#007700])) {

      [/COLOR][COLOR=#0000bb]$errorno [/COLOR][COLOR=#007700]+= [/COLOR][COLOR=#0000bb]10[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

      [/COLOR][COLOR=#0000bb]$error [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]1[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

    }

  }  


  if ([/COLOR][COLOR=#0000bb]strlen[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$dto_to_check[/COLOR][COLOR=#007700]) > [/COLOR][COLOR=#0000bb]0[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]) {

    if (![/COLOR][COLOR=#0000bb]xtc_checkdate[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$dto_to_check[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]DOB_FORMAT_STRING[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$dto_array[/COLOR][/FONT][FONT=Courier New][COLOR=#007700])) {

      [/COLOR][COLOR=#0000bb]$errorno [/COLOR][COLOR=#007700]+= [/COLOR][COLOR=#0000bb]100[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

      [/COLOR][COLOR=#0000bb]$error [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]1[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

    }

  }  


  if ([/COLOR][COLOR=#0000bb]strlen[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$dfrom_to_check[/COLOR][COLOR=#007700]) > [/COLOR][COLOR=#0000bb]0 [/COLOR][COLOR=#007700]&& !(([/COLOR][COLOR=#0000bb]$errorno [/COLOR][COLOR=#007700]& [/COLOR][COLOR=#0000bb]10[/COLOR][COLOR=#007700]) == [/COLOR][COLOR=#0000bb]10[/COLOR][COLOR=#007700]) && [/COLOR][COLOR=#0000bb]strlen[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$dto_to_check[/COLOR][COLOR=#007700]) > [/COLOR][COLOR=#0000bb]0 [/COLOR][COLOR=#007700]&& !(([/COLOR][COLOR=#0000bb]$errorno [/COLOR][COLOR=#007700]& [/COLOR][COLOR=#0000bb]100[/COLOR][COLOR=#007700]) == [/COLOR][COLOR=#0000bb]100[/COLOR][/FONT][FONT=Courier New][COLOR=#007700])) {

    if ([/COLOR][COLOR=#0000bb]mktime[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$dfrom_array[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]1[/COLOR][COLOR=#007700]], [/COLOR][COLOR=#0000bb]$dfrom_array[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]2[/COLOR][COLOR=#007700]], [/COLOR][COLOR=#0000bb]$dfrom_array[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700]]) > [/COLOR][COLOR=#0000bb]mktime[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$dto_array[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]1[/COLOR][COLOR=#007700]], [/COLOR][COLOR=#0000bb]$dto_array[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]2[/COLOR][COLOR=#007700]], [/COLOR][COLOR=#0000bb]$dto_array[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]0[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]])) {

      [/COLOR][COLOR=#0000bb]$errorno [/COLOR][COLOR=#007700]+= [/COLOR][COLOR=#0000bb]1000[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

      [/COLOR][COLOR=#0000bb]$error [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]1[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

    }

  }


  if ([/COLOR][COLOR=#0000bb]strlen[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pfrom'[/COLOR][COLOR=#007700]]) > [/COLOR][COLOR=#0000bb]0[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]) {

    [/COLOR][COLOR=#0000bb]$pfrom_to_check [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pfrom'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]];

    if (![/COLOR][COLOR=#0000bb]settype[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$pfrom_to_check[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]"double"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700])) {

      [/COLOR][COLOR=#0000bb]$errorno [/COLOR][COLOR=#007700]+= [/COLOR][COLOR=#0000bb]10000[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

      [/COLOR][COLOR=#0000bb]$error [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]1[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

    }

  }


  if ([/COLOR][COLOR=#0000bb]strlen[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pto'[/COLOR][COLOR=#007700]]) > [/COLOR][COLOR=#0000bb]0[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]) {

    [/COLOR][COLOR=#0000bb]$pto_to_check [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pto'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]];

    if (![/COLOR][COLOR=#0000bb]settype[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$pto_to_check[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]"double"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700])) {

      [/COLOR][COLOR=#0000bb]$errorno [/COLOR][COLOR=#007700]+= [/COLOR][COLOR=#0000bb]100000[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

      [/COLOR][COLOR=#0000bb]$error [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]1[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

    }

  }


  if ([/COLOR][COLOR=#0000bb]strlen[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pfrom'[/COLOR][COLOR=#007700]]) > [/COLOR][COLOR=#0000bb]0 [/COLOR][COLOR=#007700]&& !(([/COLOR][COLOR=#0000bb]$errorno [/COLOR][COLOR=#007700]& [/COLOR][COLOR=#0000bb]10000[/COLOR][COLOR=#007700]) == [/COLOR][COLOR=#0000bb]10000[/COLOR][COLOR=#007700]) && [/COLOR][COLOR=#0000bb]strlen[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pto'[/COLOR][COLOR=#007700]]) > [/COLOR][COLOR=#0000bb]0 [/COLOR][COLOR=#007700]&& !(([/COLOR][COLOR=#0000bb]$errorno [/COLOR][COLOR=#007700]& [/COLOR][COLOR=#0000bb]100000[/COLOR][COLOR=#007700]) == [/COLOR][COLOR=#0000bb]100000[/COLOR][/FONT][FONT=Courier New][COLOR=#007700])) {

    if ([/COLOR][COLOR=#0000bb]$pfrom_to_check [/COLOR][COLOR=#007700]> [/COLOR][COLOR=#0000bb]$pto_to_check[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]) {

      [/COLOR][COLOR=#0000bb]$errorno [/COLOR][COLOR=#007700]+= [/COLOR][COLOR=#0000bb]1000000[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

      [/COLOR][COLOR=#0000bb]$error [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]1[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

    }

  }


  if ([/COLOR][COLOR=#0000bb]strlen[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'keywords'[/COLOR][COLOR=#007700]]) > [/COLOR][COLOR=#0000bb]0[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]) {

    if (![/COLOR][COLOR=#0000bb]xtc_parse_search_string[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]stripslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'keywords'[/COLOR][COLOR=#007700]]), [/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][/FONT][FONT=Courier New][COLOR=#007700])) {

      [/COLOR][COLOR=#0000bb]$errorno [/COLOR][COLOR=#007700]+= [/COLOR][COLOR=#0000bb]10000000[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

      [/COLOR][COLOR=#0000bb]$error [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]1[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

    }

  }


  if ([/COLOR][COLOR=#0000bb]$error [/COLOR][COLOR=#007700]== [/COLOR][COLOR=#0000bb]1[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]) {

    [/COLOR][COLOR=#0000bb]xtc_redirect[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]xtc_href_link[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]FILENAME_ADVANCED_SEARCH[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]'errorno=' [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$errorno [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]'&' [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]xtc_get_all_get_params[/COLOR][COLOR=#007700](array([/COLOR][COLOR=#dd0000]'x'[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]'y'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]))));

  } else {

    [/COLOR][COLOR=#0000bb]$breadcrumb[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000bb]add[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]NAVBAR_TITLE1_ADVANCED_SEARCH[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]xtc_href_link[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]FILENAME_ADVANCED_SEARCH[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]));

    [/COLOR][COLOR=#0000bb]$breadcrumb[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000bb]add[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]NAVBAR_TITLE2_ADVANCED_SEARCH[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]xtc_href_link[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]FILENAME_ADVANCED_SEARCH_RESULT[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]'keywords=' [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'keywords'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]'&search_in_description=' [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'search_in_description'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]'&categories_id=' [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'categories_id'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]'&inc_subcat=' [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'inc_subcat'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]'&manufacturers_id=' [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'manufacturers_id'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]'&pfrom=' [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pfrom'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]'&pto=' [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pto'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]'&dfrom=' [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dfrom'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]'&dto=' [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dto'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]]));


 require([/COLOR][COLOR=#0000bb]DIR_WS_INCLUDES [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]'header.php'[/COLOR][/FONT][COLOR=#007700][FONT=Courier New]);


     [/FONT][/COLOR][FONT=Courier New][COLOR=#ff8000]//fsk18 lock

  [/COLOR][COLOR=#0000bb]$fsk_lock[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#dd0000]''[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

  if ([/COLOR][COLOR=#0000bb]$_SESSION[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'customers_status'[/COLOR][COLOR=#007700]][[/COLOR][COLOR=#dd0000]'customers_fsk18_display'[/COLOR][COLOR=#007700]]==[/COLOR][COLOR=#dd0000]'0'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]) {

  [/COLOR][COLOR=#0000bb]$fsk_lock[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#dd0000]' AND p.products_fsk18!=1'[/COLOR][/FONT][COLOR=#007700][FONT=Courier New];

  }

  [/FONT][/COLOR][FONT=Courier New][COLOR=#ff8000]// create column list

  [/COLOR][COLOR=#0000bb]$select_str [/COLOR][COLOR=#007700]= [/COLOR][/FONT][COLOR=#dd0000][FONT=Courier New]"SELECT DISTINCT 

                   p.products_model,

                   pov.products_options_values_name, 

                 pd.products_name,

                 m.manufacturers_name,

                 p.products_quantity,

                 p.products_shippingtime,

                 p.products_fsk18,

                 p.products_image,

                 p.products_weight,

                 pd.products_short_description,

                 pd.products_description,

                 m.manufacturers_id,

                 p.products_id,

                 pd.products_name,

                 p.products_price,

                 p.products_tax_class_id "[/FONT][/COLOR][FONT=Courier New][COLOR=#007700];


  if ( ([/COLOR][COLOR=#0000bb]DISPLAY_PRICE_WITH_TAX [/COLOR][COLOR=#007700]== [/COLOR][COLOR=#dd0000]'true'[/COLOR][COLOR=#007700]) && ( (isset([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pfrom'[/COLOR][COLOR=#007700]]) && [/COLOR][COLOR=#0000bb]xtc_not_null[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pfrom'[/COLOR][COLOR=#007700]])) || (isset([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pto'[/COLOR][COLOR=#007700]]) && [/COLOR][COLOR=#0000bb]xtc_not_null[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pto'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]]))) ) {

    [/COLOR][COLOR=#0000bb]$select_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]", SUM(tr.tax_rate) AS tax_rate "[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

  }


    [/COLOR][COLOR=#0000bb]$from_str [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]"FROM ((((" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]TABLE_PRODUCTS [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]" p) LEFT JOIN " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]TABLE_MANUFACTURERS [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]" m using(manufacturers_id), " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]TABLE_PRODUCTS_DESCRIPTION [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]" pd) LEFT JOIN " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]TABLE_SPECIALS [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]" s ON p.products_id = s.products_id, " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]TABLE_CATEGORIES [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]" c, " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]TABLE_PRODUCTS_TO_CATEGORIES [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]" p2c, " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]TABLE_PRODUCTS [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]") LEFT JOIN " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]TABLE_PRODUCTS_ATTRIBUTES [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]" pa ON p.products_id = pa.products_id) LEFT JOIN " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]TABLE_PRODUCTS_OPTIONS_VALUES [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]" pov ON pa.options_values_id = pov.products_options_values_id "[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];


  if ( ([/COLOR][COLOR=#0000bb]DISPLAY_PRICE_WITH_TAX [/COLOR][COLOR=#007700]== [/COLOR][COLOR=#dd0000]'true'[/COLOR][COLOR=#007700]) && ( (isset([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pfrom'[/COLOR][COLOR=#007700]]) && [/COLOR][COLOR=#0000bb]xtc_not_null[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pfrom'[/COLOR][COLOR=#007700]])) || (isset([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pto'[/COLOR][COLOR=#007700]]) && [/COLOR][COLOR=#0000bb]xtc_not_null[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pto'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]]))) ) {

    if (!isset([/COLOR][COLOR=#0000bb]$_SESSION[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'customer_country_id'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]])) {

      [/COLOR][COLOR=#0000bb]$_SESSION[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'customer_country_id'[/COLOR][COLOR=#007700]] = [/COLOR][COLOR=#0000bb]STORE_COUNTRY[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

      [/COLOR][COLOR=#0000bb]$_SESSION[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'customer_zone_id'[/COLOR][COLOR=#007700]] = [/COLOR][COLOR=#0000bb]STORE_ZONE[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

    }

    [/COLOR][COLOR=#0000bb]$from_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]") LEFT JOIN " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]TABLE_TAX_RATES [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]" tr ON p.products_tax_class_id = tr.tax_class_id) LEFT JOIN " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]TABLE_ZONES_TO_GEO_ZONES [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]" gz ON tr.tax_zone_id = gz.geo_zone_id AND (gz.zone_country_id IS NULL OR gz.zone_country_id = '0' OR gz.zone_country_id = '" [/COLOR][COLOR=#007700]. (int)[/COLOR][COLOR=#0000bb]$_SESSION[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'customer_country_id'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]"') AND (gz.zone_id is null OR gz.zone_id = '0' OR gz.zone_id = '" [/COLOR][COLOR=#007700]. (int)[/COLOR][COLOR=#0000bb]$_SESSION[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'customer_zone_id'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]"')"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

  }

    if ([/COLOR][COLOR=#0000bb]GROUP_CHECK[/COLOR][COLOR=#007700]==[/COLOR][COLOR=#dd0000]'true'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]) {

   [/COLOR][COLOR=#0000bb]$group_check[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#dd0000]"AND p.group_ids LIKE '%c_"[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]$_SESSION[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'customers_status'[/COLOR][COLOR=#007700]][[/COLOR][COLOR=#dd0000]'customers_status_id'[/COLOR][COLOR=#007700]].[/COLOR][COLOR=#dd0000]"_group%'"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

  }

  [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]" WHERE p.products_status = '1' "[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]$fsk_lock[/COLOR][COLOR=#007700].[/COLOR][/FONT][FONT=Courier New][COLOR=#dd0000]" AND

                 p.products_id = pd.products_id

                 AND pd.language_id = '" [/COLOR][COLOR=#007700]. (int)[/COLOR][COLOR=#0000bb]$_SESSION[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'languages_id'[/COLOR][COLOR=#007700]] . [/COLOR][/FONT][FONT=Courier New][COLOR=#dd0000]"'

                 AND p.products_id = p2c.products_id

                 "[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]$group_check[/COLOR][COLOR=#007700].[/COLOR][/FONT][COLOR=#dd0000][FONT=Courier New]"

                 AND p2c.categories_id = c.categories_id "[/FONT][/COLOR][FONT=Courier New][COLOR=#007700];


  if (isset([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'categories_id'[/COLOR][COLOR=#007700]]) && [/COLOR][COLOR=#0000bb]xtc_not_null[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'categories_id'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]])) {

    if ([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'inc_subcat'[/COLOR][COLOR=#007700]] == [/COLOR][COLOR=#dd0000]'1'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]) {

      [/COLOR][COLOR=#0000bb]$subcategories_array [/COLOR][/FONT][FONT=Courier New][COLOR=#007700]= array();

      [/COLOR][COLOR=#0000bb]xtc_get_subcategories[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$subcategories_array[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'categories_id'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]]);

      [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]" AND p2c.products_id = p.products_id AND p2c.products_id = pd.products_id AND (p2c.categories_id = '" [/COLOR][COLOR=#007700]. (int)[/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'categories_id'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]"'"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

      for ([/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$n[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]sizeof[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$subcategories_array[/COLOR][COLOR=#007700]); [/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]<[/COLOR][COLOR=#0000bb]$n[/COLOR][COLOR=#007700]; [/COLOR][COLOR=#0000bb]$i[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]++ ) {

        [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]" OR p2c.categories_id = '" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$subcategories_array[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]"'"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

      }

      [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]")"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

    } else {

      [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]" AND p2c.products_id = p.products_id AND p2c.products_id = pd.products_id AND pd.language_id = '" [/COLOR][COLOR=#007700]. (int)[/COLOR][COLOR=#0000bb]$_SESSION[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'languages_id'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]"' and p2c.categories_id = '" [/COLOR][COLOR=#007700]. (int)[/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'categories_id'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]"'"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

    }

  }


  if (isset([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'manufacturers_id'[/COLOR][COLOR=#007700]]) && [/COLOR][COLOR=#0000bb]xtc_not_null[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'manufacturers_id'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]])) {

    [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]" AND m.manufacturers_id = '" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'manufacturers_id'[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]"'"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

  }


  if (isset([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'keywords'[/COLOR][COLOR=#007700]]) && [/COLOR][COLOR=#0000bb]xtc_not_null[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'keywords'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]])) {

    if ([/COLOR][COLOR=#0000bb]xtc_parse_search_string[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]stripslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'keywords'[/COLOR][COLOR=#007700]]), [/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][/FONT][FONT=Courier New][COLOR=#007700])) {

      [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]" AND ("[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

      for ([/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$n[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]sizeof[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700]); [/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]<[/COLOR][COLOR=#0000bb]$n[/COLOR][COLOR=#007700]; [/COLOR][COLOR=#0000bb]$i[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]++ ) {

        switch ([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]]) {

          case [/COLOR][COLOR=#dd0000]'('[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]:

          case [/COLOR][COLOR=#dd0000]')'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]:

          case [/COLOR][COLOR=#dd0000]'and'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]:

          case [/COLOR][COLOR=#dd0000]'or'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]:

            [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]" " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]] . [/COLOR][COLOR=#dd0000]" "[/COLOR][/FONT][COLOR=#007700][FONT=Courier New];

            break;

          default:

            [/FONT][/COLOR][FONT=Courier New][COLOR=#ff8000]//products with attributes etc

            [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]" p.products_id = pa.products_id AND (pd.products_name LIKE '%" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]addslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]]) . [/COLOR][COLOR=#dd0000]"%' OR p.products_model LIKE '%" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]addslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]]) . [/COLOR][COLOR=#dd0000]"%' OR p.products_ean like '%" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]addslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]]) . [/COLOR][COLOR=#dd0000]"%' OR m.manufacturers_name LIKE '%" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]addslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]]) . [/COLOR][COLOR=#dd0000]"%' OR pov.products_options_values_name LIKE '%" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]addslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]]) . [/COLOR][COLOR=#dd0000]"%'"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

            [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]" OR pd.products_description LIKE '%" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]addslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]]) . [/COLOR][COLOR=#dd0000]"%' OR pd.products_short_description LIKE '%" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]addslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]]) . [/COLOR][COLOR=#dd0000]"%' OR pa.attributes_model LIKE '%" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]addslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]]) . [/COLOR][COLOR=#dd0000]"%'"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

            [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]')'[/COLOR][/FONT][COLOR=#007700][FONT=Courier New];

            [/FONT][/COLOR][FONT=Courier New][COLOR=#ff8000]//or (products without attributes) etc

            [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]" OR (pd.products_name LIKE '%" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]addslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]]) . [/COLOR][COLOR=#dd0000]"%' OR p.products_model like '%" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]addslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]]) . [/COLOR][COLOR=#dd0000]"%' OR p.products_ean LIKE '%" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]addslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]]) . [/COLOR][COLOR=#dd0000]"%' OR m.manufacturers_name LIKE '%" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]addslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]]) . [/COLOR][COLOR=#dd0000]"%'"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

            [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]" OR pd.products_description LIKE '%" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]addslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]]) . [/COLOR][COLOR=#dd0000]"%' OR pd.products_short_description LIKE '%" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]addslashes[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$search_keywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$i[/COLOR][COLOR=#007700]]) . [/COLOR][COLOR=#dd0000]"%'"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

            [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]')'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];            

            break;

        }

      }

      [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]" )"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

    }

  }


  if (isset([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dfrom'[/COLOR][COLOR=#007700]]) && [/COLOR][COLOR=#0000bb]xtc_not_null[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dfrom'[/COLOR][COLOR=#007700]]) && ([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dfrom'[/COLOR][COLOR=#007700]] != [/COLOR][COLOR=#0000bb]DOB_FORMAT_STRING[/COLOR][/FONT][FONT=Courier New][COLOR=#007700])) {

    [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]" AND p.products_date_added >= '" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]xtc_date_raw[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$dfrom_to_check[/COLOR][COLOR=#007700]) . [/COLOR][COLOR=#dd0000]"'"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

  }


  if (isset([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dto'[/COLOR][COLOR=#007700]]) && [/COLOR][COLOR=#0000bb]xtc_not_null[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dto'[/COLOR][COLOR=#007700]]) && ([/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'dto'[/COLOR][COLOR=#007700]] != [/COLOR][COLOR=#0000bb]DOB_FORMAT_STRING[/COLOR][/FONT][FONT=Courier New][COLOR=#007700])) {

    [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]" AND p.products_date_added <= '" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]xtc_date_raw[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$dto_to_check[/COLOR][COLOR=#007700]) . [/COLOR][COLOR=#dd0000]"'"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

  }


  [/COLOR][COLOR=#0000bb]$rate[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]xtc_get_currencies_values[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$_SESSION[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'currency'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]]);

  [/COLOR][COLOR=#0000bb]$rate[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]$rate[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'value'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]];

  if ([/COLOR][COLOR=#0000bb]$rate [/COLOR][COLOR=#007700]&& [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pfrom'[/COLOR][COLOR=#007700]] != [/COLOR][COLOR=#dd0000]''[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]) {

    [/COLOR][COLOR=#0000bb]$pfrom [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pfrom'[/COLOR][COLOR=#007700]] / [/COLOR][COLOR=#0000bb]$rate[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

  }

  if ([/COLOR][COLOR=#0000bb]$rate [/COLOR][COLOR=#007700]&& [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pto'[/COLOR][COLOR=#007700]] != [/COLOR][COLOR=#dd0000]''[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]) {

      [/COLOR][COLOR=#0000bb]$pto [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]$_GET[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'pto'[/COLOR][COLOR=#007700]] / [/COLOR][COLOR=#0000bb]$rate[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

  }


  if ([/COLOR][COLOR=#0000bb]$pfrom [/COLOR][COLOR=#007700]!=[/COLOR][COLOR=#dd0000]''[/COLOR][COLOR=#007700]) [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]" AND (IF(s.status, s.specials_new_products_price, p.products_price) >= " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$pfrom [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]")"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

  if ([/COLOR][COLOR=#0000bb]$pto [/COLOR][COLOR=#007700]!=[/COLOR][COLOR=#dd0000]''[/COLOR][COLOR=#007700])   [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#dd0000]" AND (IF(s.status, s.specials_new_products_price, p.products_price) <= " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$pto [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]")"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];


  [/COLOR][COLOR=#0000bb]$order_str [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]' GROUP BY pd.products_id ORDER BY pd.products_name'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];


  [/COLOR][COLOR=#0000bb]$listing_sql [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]$select_str [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$from_str [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$where_str [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]$order_str[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

  require([/COLOR][COLOR=#0000bb]DIR_WS_MODULES [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]FILENAME_PRODUCT_LISTING[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]);

}

  [/COLOR][COLOR=#0000bb]$smarty[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000bb]assign[/COLOR][COLOR=#007700]([/COLOR][COLOR=#dd0000]'language'[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$_SESSION[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'language'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]]);

  [/COLOR][COLOR=#0000bb]$smarty[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000bb]caching [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]0[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];

  if (![/COLOR][COLOR=#0000bb]defined[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]RM[/COLOR][COLOR=#007700])) [/COLOR][COLOR=#0000bb]$smarty[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000bb]load_filter[/COLOR][COLOR=#007700]([/COLOR][COLOR=#dd0000]'output'[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]'note'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]);

  [/COLOR][COLOR=#0000bb]$smarty[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000bb]display[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]CURRENT_TEMPLATE [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#dd0000]'/index.html'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]);

  [/COLOR][COLOR=#0000bb]?>[/COLOR] [/FONT]

Link to comment
Share on other sites

Hatte die gleichen Probleme. Es muss die /includes/modules/default.php wie folgt geändert werden:

<?php

/* -----------------------------------------------------------------------------------------

$Id: default.php 1292 2005-10-07 16:10:55Z mz $

XT-Commerce - community made shopping

http://www.xt-commerce.com

Copyright © 2003 XT-Commerce

-----------------------------------------------------------------------------------------

based on:

© 2000-2001 The Exchange Project (earlier name of osCommerce)

© 2002-2003 osCommerce(default.php,v 1.84 2003/05/07); www.oscommerce.com

© 2003 nextcommerce (default.php,v 1.11 2003/08/22); www.nextcommerce.org

Released under the GNU General Public License

-----------------------------------------------------------------------------------------

Third Party contributions:

Enable_Disable_Categories 1.3 Autor: Mikel Williams | [email protected]

Customers Status v3.x © 2002-2003 Copyright Elari [email protected] | www.unlockgsm.com/dload-osc/ | CVS : http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/elari/?sortby=date#dirlist

Released under the GNU General Public License

---------------------------------------------------------------------------------------*/

$default_smarty = new smarty;

$default_smarty->assign('tpl_path', 'templates/'.CURRENT_TEMPLATE.'/');

$default_smarty->assign('session', session_id());

$main_content = '';

// include needed functions

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

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

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

if (xtc_check_categories_status($current_category_id) >= 1) {

$error = CATEGORIE_NOT_FOUND;

include (DIR_WS_MODULES.FILENAME_ERROR_HANDLER);

} else {

if ($category_depth == 'nested') {

if (GROUP_CHECK == 'true') {

$group_check = "and c.group_permission_".$_SESSION['customers_status']['customers_status_id']."=1 ";

}

$category_query = "select

cd.categories_description,

cd.categories_name,

cd.categories_heading_title,

c.categories_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 = '".(int) $_SESSION['languages_id']."'";

$category_query = xtDBquery($category_query);

$category = xtc_db_fetch_array($category_query, true);

if (isset ($cPath) && ereg('_', $cPath)) {

// check to see if there are deeper categories within the current category

$category_links = array_reverse($cPath_array);

for ($i = 0, $n = sizeof($category_links); $i < $n; $i ++) {

if (GROUP_CHECK == 'true') {

$group_check = "and c.group_permission_".$_SESSION['customers_status']['customers_status_id']."=1 ";

}

$categories_query = "select cd.categories_description,

c.categories_id,

cd.categories_name,

cd.categories_heading_title,

c.categories_image,

c.parent_id from ".TABLE_CATEGORIES." c, ".TABLE_CATEGORIES_DESCRIPTION." cd

where c.categories_status = '1'

and c.parent_id = '".$category_links[$i]."'

and c.categories_id = cd.categories_id

".$group_check."

and cd.language_id = '".(int) $_SESSION['languages_id']."'

order by sort_order, cd.categories_name";

$categories_query = xtDBquery($categories_query);

if (xtc_db_num_rows($categories_query, true) < 1) {

// do nothing, go through the loop

} else {

break; // we've found the deepest category the customer is in

}

}

} else {

if (GROUP_CHECK == 'true') {

$group_check = "and c.group_permission_".$_SESSION['customers_status']['customers_status_id']."=1 ";

}

$categories_query = "select cd.categories_description,

c.categories_id,

cd.categories_name,

cd.categories_heading_title,

c.categories_image,

c.parent_id from ".TABLE_CATEGORIES." c, ".TABLE_CATEGORIES_DESCRIPTION." cd

where c.categories_status = '1'

and c.parent_id = '".$current_category_id."'

and c.categories_id = cd.categories_id

".$group_check."

and cd.language_id = '".(int) $_SESSION['languages_id']."'

order by sort_order, cd.categories_name";

$categories_query = xtDBquery($categories_query);

}

$rows = 0;

while ($categories = xtc_db_fetch_array($categories_query, true)) {

$rows ++;

$cPath_new = xtc_category_link($categories['categories_id'],$categories['categories_name']);

$width = (int) (100 / MAX_DISPLAY_CATEGORIES_PER_ROW).'%';

$image = '';

if ($categories['categories_image'] != '') {

$image = DIR_WS_IMAGES.'categories/'.$categories['categories_image'];

}

$categories_content[] = array ('CATEGORIES_NAME' => $categories['categories_name'], 'CATEGORIES_HEADING_TITLE' => $categories['categories_heading_title'], 'CATEGORIES_IMAGE' => $image, 'CATEGORIES_LINK' => xtc_href_link(FILENAME_DEFAULT, $cPath_new), 'CATEGORIES_DESCRIPTION' => $categories['categories_description']);

}

$new_products_category_id = $current_category_id;

include (DIR_WS_MODULES.FILENAME_NEW_PRODUCTS);

$image = '';

if ($category['categories_image'] != '') {

$image = DIR_WS_IMAGES.'categories/'.$category['categories_image'];

}

$default_smarty->assign('CATEGORIES_NAME', $category['categories_name']);

$default_smarty->assign('CATEGORIES_HEADING_TITLE', $category['categories_heading_title']);

$default_smarty->assign('CATEGORIES_IMAGE', $image);

$default_smarty->assign('CATEGORIES_DESCRIPTION', $category['categories_description']);

$default_smarty->assign('language', $_SESSION['language']);

$default_smarty->assign('module_content', $categories_content);

// get default template

if ($category['categories_template'] == '' or $category['categories_template'] == 'default') {

$files = array ();

if ($dir = opendir(DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/module/categorie_listing/')) {

while (($file = readdir($dir)) !== false) {

if (is_file(DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/module/categorie_listing/'.$file) and ($file != "index.html") and (substr($file, 0, 1) !=".")) {

$files[] = array ('id' => $file, 'text' => $file);

} //if

} // while

closedir($dir);

}

$category['categories_template'] = $files[0]['id'];

}

$default_smarty->caching = 0;

$main_content = $default_smarty->fetch(CURRENT_TEMPLATE.'/module/categorie_listing/'.$category['categories_template']);

$smarty->assign('main_content', $main_content);

}

elseif ($category_depth == 'products' || $_GET['manufacturers_id']) {

//fsk18 lock

$fsk_lock = '';

if ($_SESSION['customers_status']['customers_fsk18_display'] == '0') {

$fsk_lock = ' and p.products_fsk18!=1';

}

// show the products of a specified manufacturer

if (isset ($_GET['manufacturers_id'])) {

if (isset ($_GET['filter_id']) && xtc_not_null($_GET['filter_id'])) {

// sorting query

$sorting_query = xtDBquery("SELECT products_sorting,

products_sorting2 FROM ".TABLE_CATEGORIES."

where categories_id='".(int) $_GET['filter_id']."'");

$sorting_data = xtc_db_fetch_array($sorting_query,true);

if (!$sorting_data['products_sorting'])

$sorting_data['products_sorting'] = 'pd.products_name';

$sorting = ' ORDER BY '.$sorting_data['products_sorting'].' '.$sorting_data['products_sorting2'].' ';

// We are asked to show only a specific category

if (GROUP_CHECK == 'true') {

$group_check = " and p.group_permission_".$_SESSION['customers_status']['customers_status_id']."=1 ";

}

$listing_sql = "select DISTINCT p.products_fsk18,

p.products_shippingtime,

p.products_model,

pd.products_name,

p.products_ean,

p.products_price,

p.products_tax_class_id,

m.manufacturers_name,

p.products_quantity,

p.products_image,

p.products_weight,

pd.products_short_description,

pd.products_description,

p.products_id,

p.manufacturers_id,

p.products_price,

p.products_vpe,

p.products_vpe_status,

p.products_vpe_value,

p.products_discount_allowed,

p.products_tax_class_id

from (".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_DESCRIPTION." pd, ".TABLE_MANUFACTURERS." m, ".TABLE_PRODUCTS_TO_CATEGORIES." p2c) left join ".TABLE_SPECIALS." s on p.products_id = s.products_id

where p.products_status = '1'

and p.manufacturers_id = m.manufacturers_id

and m.manufacturers_id = '".(int) $_GET['manufacturers_id']."'

and p.products_id = p2c.products_id

and pd.products_id = p2c.products_id

".$group_check."

".$fsk_lock."

and pd.language_id = '".(int) $_SESSION['languages_id']."'

and p2c.categories_id = '".(int) $_GET['filter_id']."'".$sorting;

} else {

// We show them all

if (GROUP_CHECK == 'true') {

$group_check = " and p.group_permission_".$_SESSION['customers_status']['customers_status_id']."=1 ";

}

$listing_sql = "select p.products_fsk18,

p.products_shippingtime,

p.products_model,

p.products_ean,

pd.products_name,

p.products_id,

p.products_price,

m.manufacturers_name,

p.products_quantity,

p.products_image,

p.products_weight,

pd.products_short_description,

pd.products_description,

p.manufacturers_id,

p.products_vpe,

p.products_vpe_status,

p.products_vpe_value,

p.products_discount_allowed,

p.products_tax_class_id

from (".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_DESCRIPTION." pd, ".TABLE_MANUFACTURERS." m) left join ".TABLE_SPECIALS." s on p.products_id = s.products_id

where p.products_status = '1'

and pd.products_id = p.products_id

".$group_check."

".$fsk_lock."

and pd.language_id = '".(int) $_SESSION['languages_id']."'

and p.manufacturers_id = m.manufacturers_id

and m.manufacturers_id = '".(int) $_GET['manufacturers_id']."'";

}

} else {

// show the products in a given categorie

if (isset ($_GET['filter_id']) && xtc_not_null($_GET['filter_id'])) {

// sorting query

$sorting_query = xtDBquery("SELECT products_sorting,

products_sorting2 FROM ".TABLE_CATEGORIES."

where categories_id='".$current_category_id."'");

$sorting_data = xtc_db_fetch_array($sorting_query,true);

if (!$sorting_data['products_sorting'])

$sorting_data['products_sorting'] = 'pd.products_name';

$sorting = ' ORDER BY '.$sorting_data['products_sorting'].' '.$sorting_data['products_sorting2'].' ';

// We are asked to show only specific catgeory

if (GROUP_CHECK == 'true') {

$group_check = " and p.group_permission_".$_SESSION['customers_status']['customers_status_id']."=1 ";

}

$listing_sql = "select p.products_fsk18,

p.products_shippingtime,

p.products_model,

p.products_ean,

pd.products_name,

p.products_id,

m.manufacturers_name,

p.products_quantity,

p.products_image,

p.products_weight,

pd.products_short_description,

pd.products_description,

p.manufacturers_id,

p.products_price,

p.products_vpe,

p.products_vpe_status,

p.products_vpe_value,

p.products_discount_allowed,

p.products_tax_class_id

from (".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_DESCRIPTION." pd, ".TABLE_MANUFACTURERS." m, ".TABLE_PRODUCTS_TO_CATEGORIES." p2c) left join ".TABLE_SPECIALS." s on p.products_id = s.products_id

where p.products_status = '1'

and p.manufacturers_id = m.manufacturers_id

and m.manufacturers_id = '".(int) $_GET['filter_id']."'

and p.products_id = p2c.products_id

and pd.products_id = p2c.products_id

".$group_check."

".$fsk_lock."

and pd.language_id = '".(int) $_SESSION['languages_id']."'

and p2c.categories_id = '".$current_category_id."'".$sorting;

} else {

// sorting query

$sorting_query = xtDBquery("SELECT products_sorting,

products_sorting2 FROM ".TABLE_CATEGORIES."

where categories_id='".$current_category_id."'");

$sorting_data = xtc_db_fetch_array($sorting_query,true);

if (!$sorting_data['products_sorting'])

$sorting_data['products_sorting'] = 'pd.products_name';

$sorting = ' ORDER BY '.$sorting_data['products_sorting'].' '.$sorting_data['products_sorting2'].' ';

// We show them all

if (GROUP_CHECK == 'true') {

$group_check = " and p.group_permission_".$_SESSION['customers_status']['customers_status_id']."=1 ";

}

$listing_sql = "select p.products_fsk18,

p.products_shippingtime,

p.products_model,

p.products_ean,

pd.products_name,

m.manufacturers_name,

p.products_quantity,

p.products_image,

p.products_weight,

pd.products_short_description,

pd.products_description,

p.products_id,

p.manufacturers_id,

p.products_price,

p.products_vpe,

p.products_vpe_status,

p.products_vpe_value,

p.products_discount_allowed,

p.products_tax_class_id

from (".TABLE_PRODUCTS_DESCRIPTION." pd, ".TABLE_PRODUCTS." p left join ".TABLE_MANUFACTURERS." m on p.manufacturers_id = m.manufacturers_id, ".TABLE_PRODUCTS_TO_CATEGORIES." p2c

) left join ".TABLE_SPECIALS." s on p.products_id = s.products_id

where p.products_status = '1'

and p.products_id = p2c.products_id

and pd.products_id = p2c.products_id

".$group_check."

".$fsk_lock."

and pd.language_id = '".(int) $_SESSION['languages_id']."'

and p2c.categories_id = '".$current_category_id."'".$sorting;

}

}

// optional Product List Filter

if (PRODUCT_LIST_FILTER > 0) {

if (isset ($_GET['manufacturers_id'])) {

$filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_TO_CATEGORIES." p2c, ".TABLE_CATEGORIES." c, ".TABLE_CATEGORIES_DESCRIPTION." cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '".(int) $_SESSION['languages_id']."' and p.manufacturers_id = '".(int) $_GET['manufacturers_id']."' order by cd.categories_name";

} else {

$filterlist_sql = "select distinct m.manufacturers_id as id, m.manufacturers_name as name from ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_TO_CATEGORIES." p2c, ".TABLE_MANUFACTURERS." m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '".$current_category_id."' order by m.manufacturers_name";

}

$filterlist_query = xtDBquery($filterlist_sql);

if (xtc_db_num_rows($filterlist_query, true) > 1) {

$manufacturer_dropdown = xtc_draw_form('filter', FILENAME_DEFAULT, 'get');

if (isset ($_GET['manufacturers_id'])) {

$manufacturer_dropdown .= xtc_draw_hidden_field('manufacturers_id', $_GET['manufacturers_id']);

$options = array (array ('text' => TEXT_ALL_CATEGORIES));

} else {

$manufacturer_dropdown .= xtc_draw_hidden_field('cPath', $cPath);

$options = array (array ('text' => TEXT_ALL_MANUFACTURERS));

}

$manufacturer_dropdown .= xtc_draw_hidden_field('sort', $_GET['sort']);

$manufacturer_dropdown .= xtc_draw_hidden_field(xtc_session_name(), xtc_session_id());

while ($filterlist = xtc_db_fetch_array($filterlist_query, true)) {

$options[] = array ('id' => $filterlist['id'], 'text' => $filterlist['name']);

}

$manufacturer_dropdown .= xtc_draw_pull_down_menu('filter_id', $options, $_GET['filter_id'], 'onchange="this.form.submit()"');

$manufacturer_dropdown .= '</form>'."\n";

}

}

// Get the right image for the top-right

$image = DIR_WS_IMAGES.'table_background_list.gif';

if (isset ($_GET['manufacturers_id'])) {

$image = xtDBquery("select manufacturers_image from ".TABLE_MANUFACTURERS." where manufacturers_id = '".(int) $_GET['manufacturers_id']."'");

$image = xtc_db_fetch_array($image,true);

$image = $image['manufacturers_image'];

}

elseif ($current_category_id) {

$image = xtDBquery("select categories_image from ".TABLE_CATEGORIES." where categories_id = '".$current_category_id."'");

$image = xtc_db_fetch_array($image,true);

$image = $image['categories_image'];

}

include (DIR_WS_MODULES.FILENAME_PRODUCT_LISTING);

} else { // default page

if (GROUP_CHECK == 'true') {

$group_check = "and group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'";

}

$shop_content_query = xtDBquery("SELECT

content_title,

content_heading,

content_text,

content_file

FROM ".TABLE_CONTENT_MANAGER."

WHERE content_group='5'

".$group_check."

AND languages_id='".$_SESSION['languages_id']."'");

$shop_content_data = xtc_db_fetch_array($shop_content_query,true);

$default_smarty->assign('title', $shop_content_data['content_heading']);

include (DIR_WS_INCLUDES.FILENAME_CENTER_MODULES);

if ($shop_content_data['content_file'] != '') {

ob_start();

if (strpos($shop_content_data['content_file'], '.txt'))

echo '<pre>';

include (DIR_FS_CATALOG.'media/content/'.$shop_content_data['content_file']);

if (strpos($shop_content_data['content_file'], '.txt'))

echo '</pre>';

$shop_content_data['content_text'] = ob_get_contents();

ob_end_clean();

}

$default_smarty->assign('text', str_replace('{$greeting}', xtc_customer_greeting(), $shop_content_data['content_text']));

$default_smarty->assign('language', $_SESSION['language']);

// set cache ID

if (!CacheCheck()) {

$default_smarty->caching = 0;

$main_content = $default_smarty->fetch(CURRENT_TEMPLATE.'/module/main_content.html');

} else {

$default_smarty->caching = 1;

$default_smarty->cache_lifetime = CACHE_LIFETIME;

$default_smarty->cache_modified_check = CACHE_CHECK;

$cache_id = $_SESSION['language'].$_SESSION['currency'].$_SESSION['customer_id'];

$main_content = $default_smarty->fetch(CURRENT_TEMPLATE.'/module/main_content.html', $cache_id);

}

$smarty->assign('main_content', $main_content);

}

}

?>

Link to comment
Share on other sites

@ Stutzi

auch Dir ein dickes Danke für deine Hilfe.

Ich habe deine Datei 1:1 übernommen. Leider geht dann bei mir nur noch der Hintergrund.

Ich poste mal meine default.php. Wäre nett, wenn Du die Datei bereinigen könntest.


<?php
/* -----------------------------------------------------------------------------------------
$Id: default.php,v 1.28 2004/05/08 18:13:41 fanta2k Exp $

XT-Commerce - community made shopping
http://www.xt-commerce.com

Copyright (c) 2003 XT-Commerce
-----------------------------------------------------------------------------------------
based on:
(c) 2000-2001 The Exchange Project (earlier name of osCommerce)
(c) 2002-2003 osCommerce(default.php,v 1.84 2003/05/07); www.oscommerce.com
(c) 2003 nextcommerce (default.php,v 1.11 2003/08/22); www.nextcommerce.org

Released under the GNU General Public License
-----------------------------------------------------------------------------------------
Third Party contributions:
Enable_Disable_Categories 1.3 Autor: Mikel Williams | [email protected]
Customers Status v3.x (c) 2002-2003 Copyright Elari [email protected] | www.unlockgsm.com/dload-osc/ | CVS : http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/elari/?sortby=date#dirlist

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

$default_smarty = new smarty;
$default_smarty->assign('tpl_path','templates/'.CURRENT_TEMPLATE.'/');
$default_smarty->assign('session',session_id());
$main_content = '';
// include needed functions
require_once(DIR_FS_INC . 'xtc_customer_greeting.inc.php');
require_once(DIR_FS_INC . 'xtc_get_path.inc.php');
require_once(DIR_FS_INC . 'xtc_draw_hidden_field.inc.php');
require_once(DIR_FS_INC . 'xtc_check_categories_status.inc.php');
require_once(DIR_FS_INC . 'xtc_image_button.inc.php');

if (xtc_check_categories_status($current_category_id)>=1) {

$error=CATEGORIE_NOT_FOUND;
include(DIR_WS_MODULES . FILENAME_ERROR_HANDLER);



} else {

if ($category_depth == 'nested') {
if (GROUP_CHECK=='true') {
$group_check="and c.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'";
}
$category_query = "select
cd.categories_description,
cd.categories_name,
cd.categories_heading_title,
c.categories_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 = '" . (int)$_SESSION['languages_id'] . "'";

$category_query = xtDBquery($category_query);

$category = xtc_db_fetch_array(&$category_query,true);


if (isset($cPath) && ereg('_', $cPath)) {
// check to see if there are deeper categories within the current category
$category_links = array_reverse($cPath_array);
for($i = 0, $n = sizeof($category_links); $i < $n; $i++) {
if (GROUP_CHECK=='true') {
$group_check="and c.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'";
}
$categories_query = "select cd.categories_description,
c.categories_id,
cd.categories_name,
cd.categories_heading_title,
c.categories_image,
c.parent_id from " .
TABLE_CATEGORIES . " c, " .
TABLE_CATEGORIES_DESCRIPTION . " cd
where c.categories_status = '1'
and c.parent_id = '" . $category_links[$i] . "'
and c.categories_id = cd.categories_id
".$group_check."
and cd.language_id = '" . (int)$_SESSION['languages_id'] . "'
order by sort_order, cd.categories_name";
$categories_query = xtDBquery($categories_query);

if (xtc_db_num_rows(&$categories_query,true) < 1) {
// do nothing, go through the loop
} else {
break; // we've found the deepest category the customer is in
}
}
} else {
if (GROUP_CHECK=='true') {
$group_check="and c.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'";
}
$categories_query = "select cd.categories_description,
c.categories_id,
cd.categories_name,
cd.categories_heading_title,
c.categories_image,
c.parent_id from " .
TABLE_CATEGORIES . " c, " .
TABLE_CATEGORIES_DESCRIPTION . " cd
where c.categories_status = '1'
and c.parent_id = '" . $current_category_id . "'
and c.categories_id = cd.categories_id
".$group_check."
and cd.language_id = '" . (int)$_SESSION['languages_id'] . "'
order by sort_order, cd.categories_name";
$categories_query = xtDBquery($categories_query);
}

$rows = 0;
while ($categories = xtc_db_fetch_array(&$categories_query,true)) {
$rows++;
$cPath_new = xtc_get_path($categories['categories_id']);
$width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';
$image='';
if ($categories['categories_image']!='') {
$image=DIR_WS_IMAGES.'categories/'.$categories['categories_image'];
}
$SEF_parameter='';
if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') $SEF_parameter='&category='.xtc_cleanName($categories['categories_name']);

$categories_content[]=array(
'CATEGORIES_NAME' => $categories['categories_name'],
'CATEGORIES_HEADING_TITLE' => $categories['categories_heading_title'],

'CATEGORIES_IMAGE' => $image,
'CATEGORIES_LINK' => xtc_href_link(FILENAME_DEFAULT, $cPath_new.$SEF_parameter),
'CATEGORIES_DESCRIPTION' => $categories['categories_description']);


}
$new_products_category_id = $current_category_id;
include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS);

$image='';
if ($category['categories_image']!='') {
$image=DIR_WS_IMAGES.'categories/'.$category['categories_image'];
}
$default_smarty->assign('CATEGORIES_NAME',$category['categories_name']);
$default_smarty->assign('CATEGORIES_HEADING_TITLE',$category['categories_heading_title']);

$default_smarty->assign('CATEGORIES_IMAGE',$image);
$default_smarty->assign('CATEGORIES_DESCRIPTION',$category['categories_description']);

$default_smarty->assign('language', $_SESSION['language']);
$default_smarty->assign('module_content',$categories_content);

// get default template
if ($category['categories_template']=='' or $category['categories_template']=='default') {
$files=array();
if ($dir= opendir(DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/module/categorie_listing/')){
while (($file = readdir($dir)) !==false) {
if (is_file( DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/module/categorie_listing/'.$file) and ($file !="index.html")){
$files[]=array(
'id' => $file,
'text' => $file);
}//if
} // while
closedir($dir);
}
$category['categories_template']=$files[0]['id'];
}

$default_smarty->caching = 0;
$main_content= $default_smarty->fetch(CURRENT_TEMPLATE.'/module/categorie_listing/'.$category['categories_template']);
$smarty->assign('main_content',$main_content);



} elseif ($category_depth == 'products' || $_GET['manufacturers_id']) {
//fsk18 lock
$fsk_lock='';
if ($_SESSION['customers_status']['customers_fsk18_display']=='0') {
$fsk_lock=' and p.products_fsk18!=1';
}
// show the products of a specified manufacturer
if (isset($_GET['manufacturers_id'])) {
if (isset($_GET['filter_id']) && xtc_not_null($_GET['filter_id'])) {

// sorting query
$sorting_query=xtc_db_query("SELECT products_sorting,
products_sorting2 FROM ".
TABLE_CATEGORIES."
where categories_id='".(int)$_GET['filter_id']."'");
$sorting_data=xtc_db_fetch_array($sorting_query);
if (!$sorting_data['products_sorting']) $sorting_data['products_sorting']='pd.products_name';
$sorting=' ORDER BY '.$sorting_data['products_sorting'].' '.$sorting_data['products_sorting2'].' ';
// We are asked to show only a specific category
if (GROUP_CHECK=='true') {
$group_check="and p.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'";
}
$listing_sql = "select DISTINCT p.products_fsk18,
p.products_shippingtime,
p.products_model,
pd.products_name,
p.products_ean,
p.products_price,
p.products_tax_class_id,
m.manufacturers_name,
p.products_quantity,
p.products_image,
p.products_weight,
pd.products_short_description,
pd.products_description,
p.products_id,
p.manufacturers_id,
p.products_price,
p.products_discount_allowed,
p.products_tax_class_id
from " . TABLE_PRODUCTS . " p, " .
TABLE_PRODUCTS_DESCRIPTION . " pd, " .
TABLE_MANUFACTURERS . " m, " .
TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " .
TABLE_SPECIALS . " s on p.products_id = s.products_id
where p.products_status = '1'
and p.manufacturers_id = m.manufacturers_id
and m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'
and p.products_id = p2c.products_id
and pd.products_id = p2c.products_id
".$group_check."
".$fsk_lock."
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' ".$fsk_lock."
and p2c.categories_id = '" . (int)$_GET['filter_id'] . "'".$sorting;
} else {
// We show them all
if (GROUP_CHECK=='true') {
$group_check="and p.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'";
}
$listing_sql = "select p.products_fsk18,
p.products_shippingtime,
p.products_model,
p.products_ean,
pd.products_name,
p.products_id,
p.products_price,
m.manufacturers_name,
p.products_quantity,
p.products_image,
p.products_weight,
pd.products_short_description,
pd.products_description,
p.manufacturers_id,
p.products_discount_allowed,
p.products_tax_class_id
from " .
TABLE_PRODUCTS . " p, " .
TABLE_PRODUCTS_DESCRIPTION . " pd, " .
TABLE_MANUFACTURERS . " m left join " .
TABLE_SPECIALS . " s on p.products_id = s.products_id
where p.products_status = '1'
and pd.products_id = p.products_id
".$group_check."
".$fsk_lock."
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
and p.manufacturers_id = m.manufacturers_id ".$fsk_lock."
and m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'";
}
} else {
// show the products in a given categorie
if (isset($_GET['filter_id']) && xtc_not_null($_GET['filter_id'])) {

// sorting query
$sorting_query=xtc_db_query("SELECT products_sorting,
products_sorting2 FROM ".
TABLE_CATEGORIES."
where categories_id='".$current_category_id."'");
$sorting_data=xtc_db_fetch_array($sorting_query);
if (!$sorting_data['products_sorting']) $sorting_data['products_sorting']='pd.products_name';
$sorting=' ORDER BY '.$sorting_data['products_sorting'].' '.$sorting_data['products_sorting2'].' ';
// We are asked to show only specific catgeory
if (GROUP_CHECK=='true') {
$group_check="and p.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'";
}
$listing_sql = "select p.products_fsk18,
p.products_shippingtime,
p.products_model,
p.products_ean,
pd.products_name,
p.products_id,
m.manufacturers_name,
p.products_quantity,
p.products_image,
p.products_weight,
pd.products_short_description,
pd.products_description,
p.manufacturers_id,
p.products_price,
p.products_discount_allowed,
p.products_tax_class_id
from " . TABLE_PRODUCTS . " p, " .
TABLE_PRODUCTS_DESCRIPTION . " pd, " .
TABLE_MANUFACTURERS . " m, " .
TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " .
TABLE_SPECIALS . " s on p.products_id = s.products_id
where p.products_status = '1'
and p.manufacturers_id = m.manufacturers_id
and m.manufacturers_id = '" . (int)$_GET['filter_id'] . "'
and p.products_id = p2c.products_id
and pd.products_id = p2c.products_id
".$group_check."
".$fsk_lock."
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' ".$fsk_lock."
and p2c.categories_id = '" . $current_category_id . "'".$sorting;
} else {

// sorting query
$sorting_query=xtc_db_query("SELECT products_sorting,
products_sorting2 FROM ".
TABLE_CATEGORIES."
where categories_id='".$current_category_id."'");
$sorting_data=xtc_db_fetch_array($sorting_query);
if (!$sorting_data['products_sorting']) $sorting_data['products_sorting']='pd.products_name';
$sorting=' ORDER BY '.$sorting_data['products_sorting'].' '.$sorting_data['products_sorting2'].' ';
// We show them all
if (GROUP_CHECK=='true') {
$group_check="and p.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'";
}
$listing_sql = "select p.products_fsk18,
p.products_shippingtime,
p.products_model,
p.products_ean,
pd.products_name,
m.manufacturers_name,
p.products_quantity,
p.products_image,
p.products_weight,
pd.products_short_description,
pd.products_description,
p.products_id,
p.manufacturers_id,
p.products_price,
p.products_discount_allowed,
p.products_tax_class_id
from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " .
TABLE_PRODUCTS . " p left join " .
TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " .
TABLE_PRODUCTS_TO_CATEGORIES . " p2c
left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id
where p.products_status = '1'
and p.products_id = p2c.products_id
and pd.products_id = p2c.products_id
".$group_check."
".$fsk_lock."
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' ".$fsk_lock."
and p2c.categories_id = '" . $current_category_id . "'".$sorting;
}
}
// optional Product List Filter
if (PRODUCT_LIST_FILTER > 0) {
if (isset($_GET['manufacturers_id'])) {
$filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$_SESSION['languages_id'] . "' and p.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "' order by cd.categories_name";
} else {
$filterlist_sql = "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . $current_category_id . "' order by m.manufacturers_name";
}
$filterlist_query = xtDBquery($filterlist_sql);
if (xtc_db_num_rows(&$filterlist_query,true) > 1) {
$manufacturer_dropdown= xtc_draw_form('filter', FILENAME_DEFAULT, 'get');
if (isset($_GET['manufacturers_id'])) {
$manufacturer_dropdown.= xtc_draw_hidden_field('manufacturers_id', $_GET['manufacturers_id']);
$options = array(array('text' => TEXT_ALL_CATEGORIES));
} else {
$manufacturer_dropdown.= xtc_draw_hidden_field('cPath', $cPath);
$options = array(array('text' => TEXT_ALL_MANUFACTURERS));
}
$manufacturer_dropdown.= xtc_draw_hidden_field('sort', $_GET['sort']);
$manufacturer_dropdown.= xtc_draw_hidden_field(xtc_session_name(), xtc_session_id());
while ($filterlist = xtc_db_fetch_array(&$filterlist_query,true)) {
$options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']);
}
$manufacturer_dropdown.= xtc_draw_pull_down_menu('filter_id', $options, $_GET['filter_id'], 'onchange="this.form.submit()"');
$manufacturer_dropdown.= '</form>' . "\n";
}
}

// Get the right image for the top-right
$image = DIR_WS_IMAGES . 'table_background_list.gif';
if (isset($_GET['manufacturers_id'])) {
$image = xtc_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'");
$image = xtc_db_fetch_array($image);
$image = $image['manufacturers_image'];
} elseif ($current_category_id) {
$image = xtc_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . $current_category_id . "'");
$image = xtc_db_fetch_array($image);
$image = $image['categories_image'];
}

include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);

} else { // default page
if (GROUP_CHECK=='true') {
$group_check="and group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'";
}
$shop_content_query=xtc_db_query("SELECT
content_title,
content_heading,
content_text,
content_file
FROM ".TABLE_CONTENT_MANAGER."
WHERE content_group='5'
".$group_check."
AND languages_id='".$_SESSION['languages_id']."'");
$shop_content_data=xtc_db_fetch_array($shop_content_query);

$default_smarty->assign('title',$shop_content_data['content_heading']);
include(DIR_WS_INCLUDES . FILENAME_CENTER_MODULES);

if ($shop_content_data['content_file']!=''){
ob_start();
if (strpos($shop_content_data['content_file'],'.txt')) echo '<pre>';
include(DIR_FS_CATALOG.'media/content/'.$shop_content_data['content_file']);
if (strpos($shop_content_data['content_file'],'.txt')) echo '</pre>';
$shop_content_data['content_text']=ob_get_contents();
ob_end_clean();
}


$default_smarty->assign('text',str_replace('{$greeting}',xtc_customer_greeting(),$shop_content_data['content_text']));
$default_smarty->assign('language', $_SESSION['language']);

// set cache ID
if (USE_CACHE=='false') {
$default_smarty->caching = 0;
$main_content= $default_smarty->fetch(CURRENT_TEMPLATE.'/module/main_content.html');
} else {
$default_smarty->caching = 1;
$default_smarty->cache_lifetime=CACHE_LIFETIME;
$default_smarty->cache_modified_check=CACHE_CHECK;
$cache_id = $_SESSION['language'].$_SESSION['currency'].$_SESSION['customer_id'];
$main_content= $default_smarty->fetch(CURRENT_TEMPLATE.'/module/main_content.html',$cache_id);
}


$smarty->assign('main_content',$main_content);
}
}
?>[/php]

Link to comment
Share on other sites

ich arbeite noch mit 2.irgendwas..., hier deine bereinigte default.php, Dietolino, vermutlich aus Version 3.?.?., übernehme keine Gewähr, da ich's nicht testen konnte. Die Änderungen beziehen sich auf folgende Teile:

from (" . TABLE_PRODUCTS . " p, " .
TABLE_PRODUCTS_DESCRIPTION . " pd, " .
TABLE_MANUFACTURERS . " m, " .
TABLE_PRODUCTS_TO_CATEGORIES . " p2c) left join[/php]

Zwischen [b][i]from[/i][/b] und [b][i]left join[/i][/b] müssen ab MySql 5 Klammern gesetzt werden. Dieser Teil kommt im Script 4 mal so oder so ähnlich vor. Hier die komplette Datei:

[php]<?php
/* -----------------------------------------------------------------------------------------
$Id: default.php,v 1.28 2004/05/08 18:13:41 fanta2k Exp $

XT-Commerce - community made shopping
http://www.xt-commerce.com

Copyright (c) 2003 XT-Commerce
-----------------------------------------------------------------------------------------
based on:
(c) 2000-2001 The Exchange Project (earlier name of osCommerce)
(c) 2002-2003 osCommerce(default.php,v 1.84 2003/05/07); www.oscommerce.com
(c) 2003 nextcommerce (default.php,v 1.11 2003/08/22); www.nextcommerce.org

Released under the GNU General Public License
-----------------------------------------------------------------------------------------
Third Party contributions:
Enable_Disable_Categories 1.3 Autor: Mikel Williams | [email protected]
Customers Status v3.x (c) 2002-2003 Copyright Elari [email protected] | www.unlockgsm.com/dload-osc/ | CVS : http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/elari/?sortby=date#dirlist

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

$default_smarty = new smarty;
$default_smarty->assign('tpl_path','templates/'.CURRENT_TEMPLATE.'/');
$default_smarty->assign('session',session_id());
$main_content = '';
// include needed functions
require_once(DIR_FS_INC . 'xtc_customer_greeting.inc.php');
require_once(DIR_FS_INC . 'xtc_get_path.inc.php');
require_once(DIR_FS_INC . 'xtc_draw_hidden_field.inc.php');
require_once(DIR_FS_INC . 'xtc_check_categories_status.inc.php');
require_once(DIR_FS_INC . 'xtc_image_button.inc.php');

if (xtc_check_categories_status($current_category_id)>=1) {

$error=CATEGORIE_NOT_FOUND;
include(DIR_WS_MODULES . FILENAME_ERROR_HANDLER);



} else {

if ($category_depth == 'nested') {
if (GROUP_CHECK=='true') {
$group_check="and c.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'";
}
$category_query = "select
cd.categories_description,
cd.categories_name,
cd.categories_heading_title,
c.categories_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 = '" . (int)$_SESSION['languages_id'] . "'";

$category_query = xtDBquery($category_query);

$category = xtc_db_fetch_array(&$category_query,true);


if (isset($cPath) && ereg('_', $cPath)) {
// check to see if there are deeper categories within the current category
$category_links = array_reverse($cPath_array);
for($i = 0, $n = sizeof($category_links); $i < $n; $i++) {
if (GROUP_CHECK=='true') {
$group_check="and c.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'";
}
$categories_query = "select cd.categories_description,
c.categories_id,
cd.categories_name,
cd.categories_heading_title,
c.categories_image,
c.parent_id from " .
TABLE_CATEGORIES . " c, " .
TABLE_CATEGORIES_DESCRIPTION . " cd
where c.categories_status = '1'
and c.parent_id = '" . $category_links[$i] . "'
and c.categories_id = cd.categories_id
".$group_check."
and cd.language_id = '" . (int)$_SESSION['languages_id'] . "'
order by sort_order, cd.categories_name";
$categories_query = xtDBquery($categories_query);

if (xtc_db_num_rows(&$categories_query,true) < 1) {
// do nothing, go through the loop
} else {
break; // we've found the deepest category the customer is in
}
}
} else {
if (GROUP_CHECK=='true') {
$group_check="and c.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'";
}
$categories_query = "select cd.categories_description,
c.categories_id,
cd.categories_name,
cd.categories_heading_title,
c.categories_image,
c.parent_id from " .
TABLE_CATEGORIES . " c, " .
TABLE_CATEGORIES_DESCRIPTION . " cd
where c.categories_status = '1'
and c.parent_id = '" . $current_category_id . "'
and c.categories_id = cd.categories_id
".$group_check."
and cd.language_id = '" . (int)$_SESSION['languages_id'] . "'
order by sort_order, cd.categories_name";
$categories_query = xtDBquery($categories_query);
}

$rows = 0;
while ($categories = xtc_db_fetch_array(&$categories_query,true)) {
$rows++;
$cPath_new = xtc_get_path($categories['categories_id']);
$width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';
$image='';
if ($categories['categories_image']!='') {
$image=DIR_WS_IMAGES.'categories/'.$categories['categories_image'];
}
$SEF_parameter='';
if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') $SEF_parameter='&category='.xtc_cleanName($categories['categories_name']);

$categories_content[]=array(
'CATEGORIES_NAME' => $categories['categories_name'],
'CATEGORIES_HEADING_TITLE' => $categories['categories_heading_title'],

'CATEGORIES_IMAGE' => $image,
'CATEGORIES_LINK' => xtc_href_link(FILENAME_DEFAULT, $cPath_new.$SEF_parameter),
'CATEGORIES_DESCRIPTION' => $categories['categories_description']);


}
$new_products_category_id = $current_category_id;
include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS);

$image='';
if ($category['categories_image']!='') {
$image=DIR_WS_IMAGES.'categories/'.$category['categories_image'];
}
$default_smarty->assign('CATEGORIES_NAME',$category['categories_name']);
$default_smarty->assign('CATEGORIES_HEADING_TITLE',$category['categories_heading_title']);

$default_smarty->assign('CATEGORIES_IMAGE',$image);
$default_smarty->assign('CATEGORIES_DESCRIPTION',$category['categories_description']);

$default_smarty->assign('language', $_SESSION['language']);
$default_smarty->assign('module_content',$categories_content);

// get default template
if ($category['categories_template']=='' or $category['categories_template']=='default') {
$files=array();
if ($dir= opendir(DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/module/categorie_listing/')){
while (($file = readdir($dir)) !==false) {
if (is_file( DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/module/categorie_listing/'.$file) and ($file !="index.html")){
$files[]=array(
'id' => $file,
'text' => $file);
}//if
} // while
closedir($dir);
}
$category['categories_template']=$files[0]['id'];
}

$default_smarty->caching = 0;
$main_content= $default_smarty->fetch(CURRENT_TEMPLATE.'/module/categorie_listing/'.$category['categories_template']);
$smarty->assign('main_content',$main_content);



} elseif ($category_depth == 'products' || $_GET['manufacturers_id']) {
//fsk18 lock
$fsk_lock='';
if ($_SESSION['customers_status']['customers_fsk18_display']=='0') {
$fsk_lock=' and p.products_fsk18!=1';
}
// show the products of a specified manufacturer
if (isset($_GET['manufacturers_id'])) {
if (isset($_GET['filter_id']) && xtc_not_null($_GET['filter_id'])) {

// sorting query
$sorting_query=xtc_db_query("SELECT products_sorting,
products_sorting2 FROM ".
TABLE_CATEGORIES."
where categories_id='".(int)$_GET['filter_id']."'");
$sorting_data=xtc_db_fetch_array($sorting_query);
if (!$sorting_data['products_sorting']) $sorting_data['products_sorting']='pd.products_name';
$sorting=' ORDER BY '.$sorting_data['products_sorting'].' '.$sorting_data['products_sorting2'].' ';
// We are asked to show only a specific category
if (GROUP_CHECK=='true') {
$group_check="and p.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'";
}
$listing_sql = "select DISTINCT p.products_fsk18,
p.products_shippingtime,
p.products_model,
pd.products_name,
p.products_ean,
p.products_price,
p.products_tax_class_id,
m.manufacturers_name,
p.products_quantity,
p.products_image,
p.products_weight,
pd.products_short_description,
pd.products_description,
p.products_id,
p.manufacturers_id,
p.products_price,
p.products_discount_allowed,
p.products_tax_class_id
from (" . TABLE_PRODUCTS . " p, " .
TABLE_PRODUCTS_DESCRIPTION . " pd, " .
TABLE_MANUFACTURERS . " m, " .
TABLE_PRODUCTS_TO_CATEGORIES . " p2c) left join " .
TABLE_SPECIALS . " s on p.products_id = s.products_id
where p.products_status = '1'
and p.manufacturers_id = m.manufacturers_id
and m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'
and p.products_id = p2c.products_id
and pd.products_id = p2c.products_id
".$group_check."
".$fsk_lock."
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' ".$fsk_lock."
and p2c.categories_id = '" . (int)$_GET['filter_id'] . "'".$sorting;
} else {
// We show them all
if (GROUP_CHECK=='true') {
$group_check="and p.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'";
}
$listing_sql = "select p.products_fsk18,
p.products_shippingtime,
p.products_model,
p.products_ean,
pd.products_name,
p.products_id,
p.products_price,
m.manufacturers_name,
p.products_quantity,
p.products_image,
p.products_weight,
pd.products_short_description,
pd.products_description,
p.manufacturers_id,
p.products_discount_allowed,
p.products_tax_class_id
from (" .
TABLE_PRODUCTS . " p, " .
TABLE_PRODUCTS_DESCRIPTION . " pd, " .
TABLE_MANUFACTURERS . " m) left join " .
TABLE_SPECIALS . " s on p.products_id = s.products_id
where p.products_status = '1'
and pd.products_id = p.products_id
".$group_check."
".$fsk_lock."
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
and p.manufacturers_id = m.manufacturers_id ".$fsk_lock."
and m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'";
}
} else {
// show the products in a given categorie
if (isset($_GET['filter_id']) && xtc_not_null($_GET['filter_id'])) {

// sorting query
$sorting_query=xtc_db_query("SELECT products_sorting,
products_sorting2 FROM ".
TABLE_CATEGORIES."
where categories_id='".$current_category_id."'");
$sorting_data=xtc_db_fetch_array($sorting_query);
if (!$sorting_data['products_sorting']) $sorting_data['products_sorting']='pd.products_name';
$sorting=' ORDER BY '.$sorting_data['products_sorting'].' '.$sorting_data['products_sorting2'].' ';
// We are asked to show only specific catgeory
if (GROUP_CHECK=='true') {
$group_check="and p.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'";
}
$listing_sql = "select p.products_fsk18,
p.products_shippingtime,
p.products_model,
p.products_ean,
pd.products_name,
p.products_id,
m.manufacturers_name,
p.products_quantity,
p.products_image,
p.products_weight,
pd.products_short_description,
pd.products_description,
p.manufacturers_id,
p.products_price,
p.products_discount_allowed,
p.products_tax_class_id
from (" . TABLE_PRODUCTS . " p, " .
TABLE_PRODUCTS_DESCRIPTION . " pd, " .
TABLE_MANUFACTURERS . " m, " .
TABLE_PRODUCTS_TO_CATEGORIES . " p2c) left join " .
TABLE_SPECIALS . " s on p.products_id = s.products_id
where p.products_status = '1'
and p.manufacturers_id = m.manufacturers_id
and m.manufacturers_id = '" . (int)$_GET['filter_id'] . "'
and p.products_id = p2c.products_id
and pd.products_id = p2c.products_id
".$group_check."
".$fsk_lock."
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' ".$fsk_lock."
and p2c.categories_id = '" . $current_category_id . "'".$sorting;
} else {

// sorting query
$sorting_query=xtc_db_query("SELECT products_sorting,
products_sorting2 FROM ".
TABLE_CATEGORIES."
where categories_id='".$current_category_id."'");
$sorting_data=xtc_db_fetch_array($sorting_query);
if (!$sorting_data['products_sorting']) $sorting_data['products_sorting']='pd.products_name';
$sorting=' ORDER BY '.$sorting_data['products_sorting'].' '.$sorting_data['products_sorting2'].' ';
// We show them all
if (GROUP_CHECK=='true') {
$group_check="and p.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'";
}
$listing_sql = "select p.products_fsk18,
p.products_shippingtime,
p.products_model,
p.products_ean,
pd.products_name,
m.manufacturers_name,
p.products_quantity,
p.products_image,
p.products_weight,
pd.products_short_description,
pd.products_description,
p.products_id,
p.manufacturers_id,
p.products_price,
p.products_discount_allowed,
p.products_tax_class_id
from ((" . TABLE_PRODUCTS_DESCRIPTION . " pd, " .
TABLE_PRODUCTS . " p) left join " .
TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " .
TABLE_PRODUCTS_TO_CATEGORIES . " p2c)
left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id
where p.products_status = '1'
and p.products_id = p2c.products_id
and pd.products_id = p2c.products_id
".$group_check."
".$fsk_lock."
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' ".$fsk_lock."
and p2c.categories_id = '" . $current_category_id . "'".$sorting;
}
}
// optional Product List Filter
if (PRODUCT_LIST_FILTER > 0) {
if (isset($_GET['manufacturers_id'])) {
$filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$_SESSION['languages_id'] . "' and p.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "' order by cd.categories_name";
} else {
$filterlist_sql = "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . $current_category_id . "' order by m.manufacturers_name";
}
$filterlist_query = xtDBquery($filterlist_sql);
if (xtc_db_num_rows(&$filterlist_query,true) > 1) {
$manufacturer_dropdown= xtc_draw_form('filter', FILENAME_DEFAULT, 'get');
if (isset($_GET['manufacturers_id'])) {
$manufacturer_dropdown.= xtc_draw_hidden_field('manufacturers_id', $_GET['manufacturers_id']);
$options = array(array('text' => TEXT_ALL_CATEGORIES));
} else {
$manufacturer_dropdown.= xtc_draw_hidden_field('cPath', $cPath);
$options = array(array('text' => TEXT_ALL_MANUFACTURERS));
}
$manufacturer_dropdown.= xtc_draw_hidden_field('sort', $_GET['sort']);
$manufacturer_dropdown.= xtc_draw_hidden_field(xtc_session_name(), xtc_session_id());
while ($filterlist = xtc_db_fetch_array(&$filterlist_query,true)) {
$options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']);
}
$manufacturer_dropdown.= xtc_draw_pull_down_menu('filter_id', $options, $_GET['filter_id'], 'onchange="this.form.submit()"');
$manufacturer_dropdown.= '</form>' . "\n";
}
}

// Get the right image for the top-right
$image = DIR_WS_IMAGES . 'table_background_list.gif';
if (isset($_GET['manufacturers_id'])) {
$image = xtc_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'");
$image = xtc_db_fetch_array($image);
$image = $image['manufacturers_image'];
} elseif ($current_category_id) {
$image = xtc_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . $current_category_id . "'");
$image = xtc_db_fetch_array($image);
$image = $image['categories_image'];
}

include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);

} else { // default page
if (GROUP_CHECK=='true') {
$group_check="and group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'";
}
$shop_content_query=xtc_db_query("SELECT
content_title,
content_heading,
content_text,
content_file
FROM ".TABLE_CONTENT_MANAGER."
WHERE content_group='5'
".$group_check."
AND languages_id='".$_SESSION['languages_id']."'");
$shop_content_data=xtc_db_fetch_array($shop_content_query);

$default_smarty->assign('title',$shop_content_data['content_heading']);
include(DIR_WS_INCLUDES . FILENAME_CENTER_MODULES);

if ($shop_content_data['content_file']!=''){
ob_start();
if (strpos($shop_content_data['content_file'],'.txt')) echo '<pre>';
include(DIR_FS_CATALOG.'media/content/'.$shop_content_data['content_file']);
if (strpos($shop_content_data['content_file'],'.txt')) echo '</pre>';
$shop_content_data['content_text']=ob_get_contents();
ob_end_clean();
}


$default_smarty->assign('text',str_replace('{$greeting}',xtc_customer_greeting(),$shop_content_data['content_text']));
$default_smarty->assign('language', $_SESSION['language']);

// set cache ID
if (USE_CACHE=='false') {
$default_smarty->caching = 0;
$main_content= $default_smarty->fetch(CURRENT_TEMPLATE.'/module/main_content.html');
} else {
$default_smarty->caching = 1;
$default_smarty->cache_lifetime=CACHE_LIFETIME;
$default_smarty->cache_modified_check=CACHE_CHECK;
$cache_id = $_SESSION['language'].$_SESSION['currency'].$_SESSION['customer_id'];
$main_content= $default_smarty->fetch(CURRENT_TEMPLATE.'/module/main_content.html',$cache_id);
}


$smarty->assign('main_content',$main_content);
}
}
?>

Viel Erfolg!

Link to comment
Share on other sites

@ stutzi Herzlichen Dank - das hat super geklappt....die Katergorien sind wieder da und lassen sich wieder öffnen :):):)

Allerdings würde mich noch interessieren, wie Du das Problem mit den Umlauten gelöst hast??? Müssen alle auf ue, oe, ae, und so weiter per Hand umgestellt werden ??

Wenn du magst, schick uns doch Deine Adresse per Mail [email protected] und wir schicken Dir mal ein Pröbchen aus unserem Sortiment;)

Dank und viele Grüße

Dietolino

Link to comment
Share on other sites

Hi Dietolino,

freut mich wenn's klappt! Mit den Umlauten hab' ich gar nichts gemacht. Das Problem tritt bei mir sporadisch auf und ist auch genauso plötzlich wieder weg, ohne dass ich irgendwas mache. Ich hab' mir noch nie die Zeit genommen, mal genauer zu forschen, obwohl es mich manchmal schon nervt...

Sind deine Seiten auch bei Host Europe gehosted? Ich vermute fast, dass das nach Einspielen irgendwelcher Datenbank-Backups passiert, aber sicher bin ich mir natürlich nicht.

Das mit den Pröbchen nehme ich gerne an, euer Sortiment kann sich sehen lassen und mir läuft jetzt schon das Wasser im Munde zusammen. Adresse folgt per email.

Grüße

stutzi

Link to comment
Share on other sites

Hi Dietolino,

freut mich wenn's klappt! Mit den Umlauten hab' ich gar nichts gemacht. Das Problem tritt bei mir sporadisch auf und ist auch genauso plötzlich wieder weg, ohne dass ich irgendwas mache. Ich hab' mir noch nie die Zeit genommen, mal genauer zu forschen, obwohl es mich manchmal schon nervt...

Sind deine Seiten auch bei Host Europe gehosted? Ich vermute fast, dass das nach Einspielen irgendwelcher Datenbank-Backups passiert, aber sicher bin ich mir natürlich nicht.

Das mit den Pröbchen nehme ich gerne an, euer Sortiment kann sich sehen lassen und mir läuft jetzt schon das Wasser im Munde zusammen. Adresse folgt per email.

Grüße

stutzi

Ja, wir hosten bei HE. Jedes Mal wenn die ein Update einspielen fange ich an zu basteln.

Die Umlaute waren ohne mein Zutun weg !!! Ich habe denen gestern einen kräftigen Schluck eingeschenkt. Der Servicemitarbeiter hat ein sogenanntes "Ticket" für die Technik aufgemacht. Bin ja mal gespannt was draus wird. Ich überlege schon, selber einen Server aufzubauen um diesem Elend zu entgehen. Muß ich mal durchrechnen.

Gruß Dietolino

Link to comment
Share on other sites

  • 2 weeks later...

Hallo

wir bekommen den unten stehenden Fehler wenn wir den 'Customer Status Check' auf 'true' setzten. Wir haben schon die default.php wie beschrieben geändert, was aber leider nicht geklappt hat. Hoffentlich opfert sich nochmal jemand auf und hilft uns :)

Danke schonmal im Vorraus :D

_________________________________________________________________

1054 - Unknown column 'p.group_ids' in 'where clause'

select p.products_fsk18, p.products_id, p.products_price, p.products_tax_class_id, p.products_image, pd.products_name, pd.products_short_description, s.expires_date, s.specials_new_products_price from products p, products_description pd, specials s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '2' and s.status = '1' and p.group_ids LIKE '%c_0_group%' order by s.specials_date_added

[XT SQL Error]

__________________________________________________________________

Link to comment
Share on other sites

Hallo rains,

such mal in der admin/customers.php nach diesen beiden Teilen:

default :

$customers_query = xtc_db_query("select c.customers_id,c.customers_cid, c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, a.entry_company, a.entry_street_address, a.entry_suburb, a.entry_postcode, a.entry_city, a.entry_state, a.entry_zone_id, a.entry_country_id, c.customers_telephone, c.customers_fax, c.customers_newsletter, c.customers_default_address_id from (".TABLE_CUSTOMERS." c) left join ".TABLE_ADDRESS_BOOK." a on c.customers_default_address_id = a.address_book_id where a.customers_id = c.customers_id and c.customers_id = '".$_GET['cID']."'");

if ($_GET['action'] == 'edit' || $_GET['action'] == 'update') {

$customers_query = xtc_db_query("select c.payment_unallowed, c.shipping_unallowed, c.customers_gender, c.customers_vat_id, c.customers_status, c.member_flag, c.customers_firstname,c.customers_cid, c.customers_lastname, c.customers_dob, c.customers_email_address, a.entry_company, a.entry_street_address, a.entry_suburb, a.entry_postcode, a.entry_city, a.entry_state, a.entry_zone_id, a.entry_country_id, c.customers_telephone, c.customers_fax, c.customers_newsletter, c.customers_default_address_id from (".TABLE_CUSTOMERS." c)left join ".TABLE_ADDRESS_BOOK." a on c.customers_default_address_id = a.address_book_id where a.customers_id = c.customers_id and c.customers_id = '".$_GET['cID']."'");

Alles was zwischen "from" und "left join" steht wird in Klammern gesetzt. Ich weiß nicht, ob die Abfragen identisch sind, bitte vergleiche es mit deiner Datei. Kann sein, dass noch weitere Datein betroffen sind, bei denen diese Änderung gemacht werden sollte. Viel Erfolg!
Link to comment
Share on other sites

  • 1 month later...

hallo

ich habe auch ein Problem bei mir startet noch nicht einmal die startseite es kommt sofort folgender fehler

1054 - Unknown column 'p.manufacturers_id' in 'on clause'

select distinct p.products_id, p.products_fsk18, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from products p, categories c, products_to_categories p2c left join manufacturers m on p.manufacturers_id = m.manufacturers_id left join products_description pd on p.products_id = pd.products_id and pd.language_id = '2' where c.categories_status=1 and p.products_id = p2c.products_id and c.categories_id = p2c.categories_id and products_status = '1' and p.products_date_added > '1970.01.01' order by p.products_date_added DESC

[XT SQL Error]

habe euch mal die index.php eingefügt vielleicht hat es damit zu tun

<?php


/* -----------------------------------------------------------------------------------------

   $Id: index.php 1321 2005-10-26 20:55:07Z mz $   


   XT-Commerce - community made shopping

   [url]http://www.xt-commerce.com[/url]


   Copyright (c) 2003 XT-Commerce

   -----------------------------------------------------------------------------------------

   based on:

   (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)

   (c) 2002-2003 osCommerce(default.php,v 1.84 2003/05/07); [url]www.oscommerce.com[/url]

   (c) 2003	 nextcommerce (default.php,v 1.13 2003/08/17); [url]www.nextcommerce.org[/url]


   Released under the GNU General Public License

   -----------------------------------------------------------------------------------------

   Third Party contributions:

   Enable_Disable_Categories 1.3        	Autor: Mikel Williams | [email][email protected][/email]

   Customers Status v3.x  (c) 2002-2003 Copyright Elari [email][email protected][/email] | [url]www.unlockgsm.com/dload-osc/[/url] | CVS : [url]http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/elari/?sortby=date#dirlist[/url]


   Released under the GNU General Public License

   ---------------------------------------------------------------------------------------*/


include ('includes/application_top.php');


// create smarty elements


$smarty = new Smarty;


// include boxes

require (DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/source/boxes.php');


// the following cPath references come from application_top.php

$category_depth = 'top';

if (isset ($cPath) && xtc_not_null($cPath)) {

	$categories_products_query = "select count(*) as total from ".TABLE_PRODUCTS_TO_CATEGORIES." where categories_id = '".$current_category_id."'";

	$categories_products_query = xtDBquery($categories_products_query);

	$cateqories_products = xtc_db_fetch_array($categories_products_query, true);

	if ($cateqories_products['total'] > 0) {

		$category_depth = 'products'; // display products

	} else {

		$category_parent_query = "select count(*) as total from ".TABLE_CATEGORIES." where parent_id = '".$current_category_id."'";

		$category_parent_query = xtDBquery($category_parent_query);

		$category_parent = xtc_db_fetch_array($category_parent_query, true);

		if ($category_parent['total'] > 0) {

			$category_depth = 'nested'; // navigate through the categories

		} else {

			$category_depth = 'products'; // category has no products, but display the 'no products' message

		}

	}

}


require (DIR_WS_INCLUDES.'header.php');


include (DIR_WS_MODULES.'default.php');

$smarty->assign('language', $_SESSION['language']);


$smarty->caching = 0;

if (!defined(RM))

	$smarty->load_filter('output', 'note');

$smarty->display(CURRENT_TEMPLATE.'/index.html');


include ('includes/application_bottom.php');  

?>

hoffe ihr könnt mir helfen

Link to comment
Share on other sites

Lieber asks :P

Öffne bitte die default.php. die befindet sich in include/modules - Ordner.

Mache eine Textsuche nach folgendem String: p2c left join

Du solltest den String 2x finden.

Ändere beide folgende gefundene Abschnitte:

p2c left join ".TABLE_SPECIALS." s on p.products_id

zu

p2c left join (".TABLE_SPECIALS." s) on p.products_id

und dann melde uns den erfolgreichen Erfolg :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
  • Create New...