Jump to content
xt:Commerce Community Forum

HILFE DRINGEND


tanja10_6

Recommended Posts

Liebe XTler,

bin wirklich am verzweifeln. Hab im Bereich admin includes versucht das verzeichnis zu ?ndern da ich nicht m?chte das mein shop xt commerce heisst sondern shop. Danach kam eine Fehlermeldung und ich wollte meine Sicherung wieder draufspielen. jetz komm ich zwar noch in den Shop aber es kommt folgende fehlermeldung wenn ich in den Adminbereich wechseln will

Warning: main(lang/german/gv_german.php): failed to open stream: No such file or directory in /.../xtcommerce/lang/german/german.php on line 438

Warning: main(lang/german/gv_german.php): failed to open stream: No such file or directory in /.../xtcommerce/lang/german/german.php on line 438

Warning: main(lang/german/gv_german.php): failed to open stream: No such file or directory in /.../xtcommerce/lang/german/german.php on line 438

Warning: main(): Failed opening 'lang/german/gv_german.php' for inclusion (include_path='./:/usr/local/lib/php') in /.../home/xtcommerce/lang/german/german.php on line 438

bitte um eure hilfe habe keine PHP kenntnisse nur ein wenig HTML hab schon mit m?h und not den Shop installiert. Bitte um Hilfe bin echt verzweifelt!

DANKE tanja

Link to comment
Share on other sites

Hallo hab nun einige Fehlermeldungen weg gebracht da ich die Sicherung des Admin Verzeichnisses wieder draufgespielt habe nun kommt folgende fehlermeldung!

Warning: main(includes/functions/compatibility.php): failed to open stream: No such file or directory in ...home/xtcommerce/admin/includes/application_top.php on line 251

Warning: main(includes/functions/compatibility.php): failed to open stream: No such file or directory in /.../xtcommerce/admin/includes/application_top.php on line 251

Warning: main(includes/functions/compatibility.php): failed to open stream: No such file or directory in /.../xtcommerce/admin/includes/application_top.php on line 251

Fatal error: main(): Failed opening required 'includes/functions/compatibility.php' (include_path='./:/usr/local/lib/php') in /.../xtcommerce/admin/includes/application_top.php on line 251

Was bedeutet das und wie komme ich in den Adminbereich

Link to comment
Share on other sites

Ich hab das verzeichnis zuerst ge?ndert und dann aber vor lauter schreck den alten bestand Sicherungskopie wieder daufgespielt. Das hat dann aber nicht mehr funktioniert und so kamen die Fehlermeldungen. Was soll ich denn in diesen Dateien ?ndern. Bitte kenne mich damit ?berhaupt nicht aus...Danke f?r die Hilfe liebe Gr??e tanja

Link to comment
Share on other sites

Am besten schreibst Du nochmal ganz langsam was genau getan wurde!

Was wir mitbekamen ist:

Habe das Verzeichnis von xtcommerce umbenannt. Als dann nichts mehr ging habe ich den alten Bestand wieder zur?ckgesichert??

Was denn genau hast Du zur?ckgesichert?? Alles was Du machen m?sstest w?re erstmal das Verzeichnis wieder umbenennen in xtcommerce so wie es ganz am anfang war.

Wenn dann der Shop wieder ohne Fehlermeldungen l?uft, kannst Du das Verzeichnis shop erstellen.

Kopiere s?mtliche Files vom Verzeichnis xtcommerce in das shop verzeichnis. Aber noch nichts l?schen, parallel alles so belassen.

Nun ?ffnest Du unter shop includes die Datei configure.php und ?nderst alle pfade wo xtcommerce vorndran steht ab indem du anstatt xtcommerce eben shop schreibst, aber nur dies, den restlichen Pfad der hintendran kommt sch?n so belassen.

Das selbe tust Du nun unter shop admin includes configure.php

Wenn alles richtig ist, gehst du in den Browser und gibst anstatt /xtcommerce eben mal /shop ein.

Wenn alles geht BRAVO das wars, wenn nicht dann stimmt noch was nicht. Mache aber nun erstmal bis dahin!

Gruss patrick

PS: Das ganze befindet sich auf einem Live-Server nicht Lokal oder??

Dann kopiere uns doch sonst mal den Code deiner configure.php hier rein damit wir dir helfen k?nnen.

Link to comment
Share on other sites

Also hier nochmals. Habe auf mein letztes posting eine Antwort bekommen in der stand dass ich die Datei admin includes configure.php ver?ndern soll. DH alle dateien die mit xtcomerce beginnen auf shop umstellen. Das habe ich gemacht und habe zus?tzlich diese Datei local gespeichert. Dann wollte ich meinen Shop ?ffnen und es kam nichts ausser Fehlermeldungen. Geschockt habe ich das verzeichnis configure php wieder vom Server gel?scht und die Sicherung dieses Verzeichnisses wieder draufgespielt. Das hat dann aber nicht mehr funktioniert. Ich habe das komplette adminverzeichnis welche ich vorher auch gesichert habe vom Server heruntergel?scht und dann die Kopie local wieder auf den Server gespielt. Nun komme ich zwar mit Passwort und Benutzer wieder als Administrator rein aber wenn ich auf den Admin Button klicke kommen die Fehlemeldungen welche ich oben beschrieben habe. Hier meine configure PHP datei

<?php

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

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 (configure.php,v 1.14 2003/02/21); www.oscommerce.com

Released under the GNU General Public License

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

// Define the webserver and path parameters

// * DIR_FS_* = Filesystem directories (local/physical)

// * DIR_WS_* = Webserver directories (virtual/URL)

define('HTTP_SERVER', 'http://www.redmaho.at''>http://www.redmaho.at'); // eg, http://localhost or - https://localhost should not be empty for productive servers

define('HTTP_CATALOG_SERVER', 'http://www.redmaho.at''>http://www.redmaho.at');

define('HTTPS_CATALOG_SERVER', 'https://www.redmaho.at');

define('ENABLE_SSL_CATALOG', 'false'); // secure webserver for catalog module

define('DIR_FS_DOCUMENT_ROOT', '/home/re000210/www/home/xtcommerce/'); // where the pages are located on the server

define('DIR_WS_ADMIN', '/xtcommerce/admin/'); // absolute path required

define('DIR_FS_ADMIN', '/home/re000210/www/home/xtcommerce/admin/'); // absolute pate required

define('DIR_WS_CATALOG', '/xtcommerce/'); // absolute path required

define('DIR_FS_CATALOG', '/home/re000210/www/home/xtcommerce/'); // absolute path required

define('DIR_WS_IMAGES', 'images/');

define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');

define('DIR_FS_CATALOG_ORIGINAL_IMAGES', DIR_FS_CATALOG_IMAGES .'product_images/original_images/');

define('DIR_FS_CATALOG_THUMBNAIL_IMAGES', DIR_FS_CATALOG_IMAGES .'product_images/thumbnail_images/');

define('DIR_FS_CATALOG_INFO_IMAGES', DIR_FS_CATALOG_IMAGES .'product_images/info_images/');

define('DIR_FS_CATALOG_POPUP_IMAGES', DIR_FS_CATALOG_IMAGES .'product_images/popup_images/');

define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');

define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/');

define('DIR_WS_CATALOG_ORIGINAL_IMAGES', DIR_WS_CATALOG_IMAGES .'product_images/original_images/');

define('DIR_WS_CATALOG_THUMBNAIL_IMAGES', DIR_WS_CATALOG_IMAGES .'product_images/thumbnail_images/');

define('DIR_WS_CATALOG_INFO_IMAGES', DIR_WS_CATALOG_IMAGES .'product_images/info_images/');

define('DIR_WS_CATALOG_POPUP_IMAGES', DIR_WS_CATALOG_IMAGES .'product_images/popup_images/');

define('DIR_WS_INCLUDES', 'includes/');

define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');

define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');

define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');

define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');

define('DIR_WS_LANGUAGES', DIR_WS_CATALOG. 'lang/');

define('DIR_FS_LANGUAGES', DIR_FS_CATALOG. 'lang/');

define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');

define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');

define('DIR_FS_INC', DIR_FS_CATALOG . 'inc/');

// define our database connection

define('DB_SERVER', '195.58.xxx.xx'); // eg, localhost - should not be empty for productive servers

define('DB_SERVER_USERNAME', '.............');

define('DB_SERVER_PASSWORD', '...');

define('DB_DATABASE', 'xxxxxxtcommerce');

define('USE_PCONNECT', 'false'); // use persisstent connections?

define('STORE_SESSIONS', ''); // leave empty '' for default handler or set to 'mysql'

?>

Link to comment
Share on other sites

Hallo worm,

hab die Zeile genau so hineingeschrieben wie Du es geschrieben hast, aber es hat sich nichts ver?ndert. Die Fehlermeldungen kommen immer noch! Muss ich das admin durch etwas ersetzen???

Hoffe das war keine Bl?de frage aber ich kenne mich wirklich nicht aus und bin f?r jede hilfe Dankbar!

lg Tanja

Link to comment
Share on other sites

hallo hast recht war ein tippfehler von mir hier die datei

<?php

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

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 (configure.php,v 1.13 2003/02/10); www.oscommerce.com

Released under the GNU General Public License

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

// Define the webserver and path parameters

// * DIR_FS_* = Filesystem directories (local/physical)

// * DIR_WS_* = Webserver directories (virtual/URL)

define('HTTP_SERVER', 'http://www.redmaho.at'); // eg, http://localhost - should not be empty for productive servers

define('HTTPS_SERVER', 'https://www.redmaho.at'); // eg, https://localhost - should not be empty for productive servers

define('ENABLE_SSL', false); // secure webserver for checkout procedure?

define('DIR_WS_CATALOG', '/xtcommerce/'); // absolute path required

define('DIR_FS_DOCUMENT_ROOT', '/home/re000210/www/home/xtcommerce/');

define('DIR_FS_CATALOG', '/home/re000210/www/home/xtcommerce/');

define('DIR_WS_IMAGES', 'images/');

define('DIR_WS_ORIGINAL_IMAGES', DIR_WS_IMAGES .'product_images/original_images/');

define('DIR_WS_THUMBNAIL_IMAGES', DIR_WS_IMAGES .'product_images/thumbnail_images/');

define('DIR_WS_INFO_IMAGES', DIR_WS_IMAGES .'product_images/info_images/');

define('DIR_WS_POPUP_IMAGES', DIR_WS_IMAGES .'product_images/popup_images/');

define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');

define('DIR_WS_INCLUDES',DIR_FS_DOCUMENT_ROOT. 'includes/');

define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');

define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');

define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');

define('DIR_WS_LANGUAGES', DIR_FS_CATALOG . 'lang/');

define('DIR_WS_DOWNLOAD_PUBLIC', DIR_WS_CATALOG . 'pub/');

define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

define('DIR_FS_INC', DIR_FS_CATALOG . 'inc/');

// define our database connection

define('DB_SERVER', '195.58.xxx.xx'); // eg, localhost - should not be empty for productive servers

define('DB_SERVER_USERNAME', '...........');

define('DB_SERVER_PASSWORD', '...');

define('DB_DATABASE', 'xxxxtcommerce');

define('USE_PCONNECT', 'false'); // use persistent connections?

define('STORE_SESSIONS', ''); // leave empty '' for default handler or set to 'mysql'

?>

gru? Tanja :wacko:

Link to comment
Share on other sites

Hallo Andy,

ja die Datei ist vorhanden. Mir ist aber aufgefallen dass ich im Adminverzeichnis zweimal einen Ordner mit includes habe. Einmal ist nur ein Unterverzeichnis n?mlich classes drin und das andre mal befinden sich die Unterverzeichnisse classes data functions data und modules drin. K?nnte das der Fehler sein oder geh?rt das so?????

Danke f?r die Hilfe Tanja

Link to comment
Share on other sites

Hi Worm,

Ja hab ich hier die Datei.

<?php

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

$Id: application_top.php,v 1.20 2004/04/25 16:30:44 fanta2k Exp $

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(application_top.php,v 1.273 2003/05/19); www.oscommerce.com

© 2003 nextcommerce (application_top.php,v 1.54 2003/08/25); www.nextcommerce.org

Released under the GNU General Public License

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

Third Party contribution:

Add A Quickie v1.0 Autor Harald Ponce de Leon

Credit Class/Gift Vouchers/Discount Coupons (Version 5.10)

http://www.oscommerce.com/community/contributions,282

Copyright © Strider | [email protected]

Copyright (c Nick Stanko of UkiDev.com, [email protected]

Copyright © Andre [email protected]

Copyright © 2001,2002 Ian C Wilson http://www.phesis.org

Released under the GNU General Public License

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

// start the timer for the page parse time log

define('PAGE_PARSE_START_TIME', microtime());

// set the level of error reporting

error_reporting(E_ALL & ~E_NOTICE);

// error_reporting(E_ALL);

// Set the local configuration parameters - mainly for developers - if exists else the mainconfigure

if (file_exists('includes/local/configure.php')) {

include('includes/local/configure.php');

} else {

include('includes/configure.php');

}

// define the project version

define('PROJECT_VERSION', 'XT-Commerce v2.0 RC1.2');

// set the type of request (secure or not)

$request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';

// set php_self in the local scope

$PHP_SELF = $_SERVER['PHP_SELF'];

// include the list of project filenames

require(DIR_WS_INCLUDES . 'filenames.php');

// include the list of project database tables

require(DIR_WS_INCLUDES . 'database_tables.php');

// Below are some defines which affect the way the discount coupon/gift voucher system work

// Be careful when editing them.

//

// Set the length of the redeem code, the longer the more secure

define('SECURITY_CODE_LENGTH', '10');

//

// The settings below determine whether a new customer receives an incentive when they first signup

//

// Set the amount of a Gift Voucher that the new signup will receive, set to 0 for none

// define('NEW_SIGNUP_GIFT_VOUCHER_AMOUNT', '10'); // placed in the admin configuration mystore

//

// Set the coupon ID that will be sent by email to a new signup, if no id is set then no email :)

// define('NEW_SIGNUP_DISCOUNT_COUPON', '3'); // placed in the admin configuration mystore

// Store DB-Querys in a Log File

define('STORE_DB_TRANSACTIONS', 'false');

// include used functions

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// make a connection to the database... now

xtc_db_connect() or die('Unable to connect to database server!');

// set the application parameters

$configuration_query = xtc_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);

while ($configuration = xtc_db_fetch_array($configuration_query)) {

define($configuration['cfgKey'], $configuration['cfgValue']);

}

// if gzip_compression is enabled, start to buffer the output

if ( (GZIP_COMPRESSION == 'true') && ($ext_zlib_loaded = extension_loaded('zlib')) && (PHP_VERSION >= '4') ) {

if (($ini_zlib_output_compression = (int)ini_get('zlib.output_compression')) < 1) {

ob_start('ob_gzhandler');

} else {

ini_set('zlib.output_compression_level', GZIP_LEVEL);

}

}

// set the HTTP GET parameters manually if search_engine_friendly_urls is enabled

if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') {

if (strlen(getenv('PATH_INFO')) > 1) {

$GET_array = array();

$PHP_SELF = str_replace(getenv('PATH_INFO'), '', $PHP_SELF);

$vars = explode('/', substr(getenv('PATH_INFO'), 1));

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

if (strpos($vars[$i], '[]')) {

$GET_array[substr($vars[$i], 0, -2)][] = $vars[$i+1];

} else {

$_GET[$vars[$i]] = $vars[$i+1];

}

$i++;

}

if (sizeof($GET_array) > 0) {

while (list($key, $value) = each($GET_array)) {

$_GET[$key] = $value;

}

}

}

}

// set the top level domains

$http_domain = xtc_get_top_level_domain(HTTP_SERVER);

$https_domain = xtc_get_top_level_domain(HTTPS_SERVER);

$current_domain = (($request_type == 'NONSSL') ? $http_domain : $https_domain);

// include cache functions if enabled

// if (USE_CACHE == 'true') include(DIR_WS_FUNCTIONS . 'cache.php');

// include shopping cart class

require(DIR_WS_CLASSES . 'shopping_cart.php');

// include navigation history class

require(DIR_WS_CLASSES . 'navigation_history.php');

// some code to solve compatibility issues

require(DIR_WS_FUNCTIONS . 'compatibility.php');

// define how the session functions will be used

require(DIR_WS_FUNCTIONS . 'sessions.php');

// set the session name and save path

session_name('XTCsid');

session_save_path(SESSION_WRITE_DIRECTORY);

// set the session cookie parameters

if (function_exists('session_set_cookie_params')) {

session_set_cookie_params(0, '/', (xtc_not_null($current_domain) ? '.' . $current_domain : ''));

} elseif (function_exists('ini_set')) {

ini_set('session.cookie_lifetime', '0');

ini_set('session.cookie_path', '/');

ini_set('session.cookie_domain', (xtc_not_null($current_domain) ? '.' . $current_domain : ''));

}

// set the session ID if it exists

if (isset($_POST[session_name()])) {

session_id($_POST[session_name()]);

} elseif ( ($request_type == 'SSL') && isset($_GET[session_name()]) ) {

session_id($_GET[session_name()]);

}

// start the session

$session_started = false;

if (SESSION_FORCE_COOKIE_USE == 'True') {

xtc_setcookie('cookie_test', 'please_accept_for_session', time()+60*60*24*30, '/', $current_domain);

if (isset($HTTP_COOKIE_VARS['cookie_test'])) {

session_start();

$session_started = true;

}

} elseif (SESSION_BLOCK_SPIDERS == 'True') {

$user_agent = strtolower(getenv('HTTP_USER_AGENT'));

$spider_flag = false;

if (xtc_not_null($user_agent)) {

$spiders = file(DIR_WS_INCLUDES . 'spiders.txt');

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

if (xtc_not_null($spiders[$i])) {

if (is_integer(strpos($user_agent, trim($spiders[$i])))) {

$spider_flag = true;

break;

}

}

}

}

if ($spider_flag == false) {

session_start();

$session_started = true;

}

} else {

session_start();

$session_started = true;

}

// verify the ssl_session_id if the feature is enabled

if ( ($request_type == 'SSL') && (SESSION_CHECK_SSL_SESSION_ID == 'True') && (ENABLE_SSL == true) && ($session_started == true) ) {

$ssl_session_id = getenv('SSL_SESSION_ID');

if (!session_is_registered('SSL_SESSION_ID')) {

$_SESSION['SESSION_SSL_ID'] = $ssl_session_id;

}

if ($_SESSION['SESSION_SSL_ID'] != $ssl_session_id) {

session_destroy();

xtc_redirect(xtc_href_link(FILENAME_SSL_CHECK));

}

}

// verify the browser user agent if the feature is enabled

if (SESSION_CHECK_USER_AGENT == 'True') {

$http_user_agent = getenv('HTTP_USER_AGENT');

if (!session_is_registered('SESSION_USER_AGENT')) {

$_SESSION['SESSION_USER_AGENT'] = $http_user_agent;

}

if ($_SESSION['SESSION_USER_AGENT'] != $http_user_agent) {

session_destroy();

xtc_redirect(xtc_href_link(FILENAME_LOGIN));

}

}

// verify the IP address if the feature is enabled

if (SESSION_CHECK_IP_ADDRESS == 'True') {

$ip_address = xtc_get_ip_address();

if (!isset($_SESSION['SESSION_IP_ADDRESS'])) {

$_SESSION['SESSION_IP_ADDRESS'] = $ip_address;

}

if ($_SESSION['SESSION_IP_ADDRESS'] != $ip_address) {

session_destroy();

xtc_redirect(xtc_href_link(FILENAME_LOGIN));

}

}

// create the shopping cart & fix the cart if necesary

if (!is_object($_SESSION['cart'])) {

$_SESSION['cart'] = new shoppingCart;

}

// include currencies class and create an instance

require(DIR_WS_CLASSES . 'currencies.php');

$currencies = new currencies();

// include the mail classes

if (EMAIL_TRANSPORT == 'sendmail') include(DIR_WS_CLASSES . 'class.phpmailer.php');

if (EMAIL_TRANSPORT == 'smtp') include(DIR_WS_CLASSES . 'class.smtp.php');

// set the language

if (!isset($_SESSION['language']) || isset($_GET['language'])) {

include(DIR_WS_CLASSES . 'language.php');

$lng = new language($_GET['language']);

if (!isset($_GET['language'])) $lng->get_browser_language();

$_SESSION['language'] = $lng->language['directory'];

$_SESSION['languages_id'] = $lng->language['id'];

$_SESSION['language_charset'] = $lng->language['language_charset'];

}

// include the language translations

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

// currency

if (!isset($_SESSION['currency']) || isset($_GET['currency']) || ( (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') && (LANGUAGE_CURRENCY != $_SESSION['currency']) ) ) {

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

if (!$_SESSION['currency'] = xtc_currency_exists($_GET['currency'])) $_SESSION['currency'] = (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY;

} else {

$_SESSION['currency'] = (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY;

}

}

if (isset($_SESSION['currency']) && $_SESSION['currency'] == '') {

$_SESSION['currency'] = DEFAULT_CURRENCY;

}

// Shopping cart actions

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

// redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled

if ($session_started == false) {

xtc_redirect(xtc_href_link(FILENAME_COOKIE_USAGE));

}

if (DISPLAY_CART == 'true') {

$goto = FILENAME_SHOPPING_CART;

$parameters = array('action', 'cPath', 'products_id', 'pid');

} else {

$goto = basename($PHP_SELF);

if ($_GET['action'] == 'buy_now') {

$parameters = array('action', 'pid', 'products_id');

} else {

$parameters = array('action', 'pid');

}

}

switch ($_GET['action']) {

// customer wants to update the product quantity in their shopping cart

case 'update_product':

for ($i = 0, $n = sizeof($_POST['products_id']); $i < $n; $i++) {

if (in_array($_POST['products_id'][$i], (is_array($_POST['cart_delete']) ? $_POST['cart_delete'] : array()))) {

$_SESSION['cart']->remove($_POST['products_id'][$i]);

} else {

if ($_POST['cart_quantity'][$i]>MAX_PRODUCTS_QTY) $_POST['cart_quantity'][$i]=MAX_PRODUCTS_QTY;

$attributes = ($_POST['id'][$_POST['products_id'][$i]]) ? $_POST['id'][$_POST['products_id'][$i]] : '';

$_SESSION['cart']->add_cart($_POST['products_id'][$i], xtc_remove_non_numeric($_POST['cart_quantity'][$i]), $attributes, false);

}

}

xtc_redirect(xtc_href_link($goto, xtc_get_all_get_params($parameters)));

break;

// customer adds a product from the products page

case 'add_product':

if (isset($_POST['products_id']) && is_numeric($_POST['products_id'])) {

if ($_POST['products_qty']>MAX_PRODUCTS_QTY) $_POST['products_qty']=MAX_PRODUCTS_QTY;

$_SESSION['cart']->add_cart((int)$_POST['products_id'], $_SESSION['cart']->get_quantity(xtc_get_uprid($_POST['products_id'], $_POST['id']))+$_POST['products_qty'], $_POST['id']);

}

xtc_redirect(xtc_href_link($goto, xtc_get_all_get_params($parameters)));

break;

case 'check_gift':

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

xtc_collect_posts();

// echo $_POST['gift_code'];

break;

// customer wants to add a quickie to the cart (called from a box)

case 'add_a_quickie' :

if (GROUP_CHECK=='true') {

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

}

$quickie_query = xtc_db_query("select

products_fsk18,

products_id from " . TABLE_PRODUCTS . "

where products_model = '" . $_POST['quickie'] . "'

".$group_check."

");

if (!xtc_db_num_rows($quickie_query)) {

if (GROUP_CHECK=='true') {

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

}

$quickie_query = xtc_db_query("select

products_fsk18,

products_id from " . TABLE_PRODUCTS . "

where products_model LIKE '%" . $_POST['quickie'] . "%'

".$group_check."

");

}

if (xtc_db_num_rows($quickie_query) != 1) {

xtc_redirect(xtc_href_link(FILENAME_ADVANCED_SEARCH_RESULT, 'keywords=' . $_POST['quickie'], 'NONSSL'));

}

$quickie = xtc_db_fetch_array($quickie_query);

if (xtc_has_product_attributes($quickie['products_id'])) {

xtc_redirect(xtc_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $quickie['products_id'], 'NONSSL'));

} else {

if ($quickie['products_fsk18']=='1' && $_SESSION['customers_status']['customers_fsk18']=='1') {

xtc_redirect(xtc_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $quickie['products_id'], 'NONSSL'));

}

if ($_SESSION['customers_status']['customers_fsk18_display']=='0' && $quickie['products_fsk18']=='1') {

xtc_redirect(xtc_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $quickie['products_id'], 'NONSSL'));

}

$_SESSION['cart']->add_cart($quickie['products_id'], 1);

xtc_redirect(xtc_href_link($goto, xtc_get_all_get_params(array('action')), 'NONSSL'));

}

break;

// performed by the 'buy now' button in product listings and review page

case 'buy_now':

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

// check permission to view product

$permission_query=xtc_db_query("SELECT group_ids from ".TABLE_PRODUCTS." where products_id='".(int)$_GET['BUYproducts_id']."'");

$permission=xtc_db_fetch_array($permission_query);

if (GROUP_CHECK=='true') {

if (!strstr($permission['group_ids'],'c_'.$_SESSION['customers_status']['customers_status_id'].'_group')) {

xtc_redirect(xtc_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . (int)$_GET['BUYproducts_id']));

}

}

if (xtc_has_product_attributes($_GET['BUYproducts_id'])) {

xtc_redirect(xtc_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . (int)$_GET['BUYproducts_id']));

} else {

$_SESSION['cart']->add_cart((int)$_GET['BUYproducts_id'], $_SESSION['cart']->get_quantity((int)$_GET['BUYproducts_id'])+1);

}

}

xtc_redirect(xtc_href_link($goto, xtc_get_all_get_params(array('action'))));

break;

case 'notify':

if (isset($_SESSION['customer_id'])) {

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

$notify = (int)$_GET['products_id'];

} elseif (isset($_GET['notify'])) {

$notify = $_GET['notify'];

} elseif (isset($_POST['notify'])) {

$notify = $_POST['notify'];

} else {

xtc_redirect(xtc_href_link(basename($PHP_SELF), xtc_get_all_get_params(array('action', 'notify'))));

}

if (!is_array($notify)) $notify = array($notify);

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

$check_query = xtc_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $notify[$i] . "' and customers_id = '" . (int)$_SESSION['customer_id'] . "'");

$check = xtc_db_fetch_array($check_query);

if ($check['count'] < 1) {

xtc_db_query("insert into " . TABLE_PRODUCTS_NOTIFICATIONS . " (products_id, customers_id, date_added) values ('" . $notify[$i] . "', '" . (int)$_SESSION['customer_id'] . "', now())");

}

}

xtc_redirect(xtc_href_link(basename($PHP_SELF), xtc_get_all_get_params(array('action', 'notify'))));

} else {

//

xtc_redirect(xtc_href_link(FILENAME_LOGIN, '', 'SSL'));

}

break;

case 'notify_remove':

if (isset($_SESSION['customer_id']) && isset($_GET['products_id'])) {

$check_query = xtc_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int)$_GET['products_id'] . "' and customers_id = '" . (int)$_SESSION['customer_id'] . "'");

$check = xtc_db_fetch_array($check_query);

if ($check['count'] > 0) {

xtc_db_query("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int)$_GET['products_id'] . "' and customers_id = '" . (int)$_SESSION['customer_id'] . "'");

}

xtc_redirect(xtc_href_link(basename($PHP_SELF), xtc_get_all_get_params(array('action'))));

} else {

xtc_redirect(xtc_href_link(FILENAME_LOGIN, '', 'SSL'));

}

break;

case 'cust_order':

if (isset($_SESSION['customer_id']) && isset($_GET['pid'])) {

if (xtc_has_product_attributes((int)$_GET['pid'])) {

xtc_redirect(xtc_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . (int)$_GET['pid']));

} else {

$_SESSION['cart']->add_cart((int)$_GET['pid'], $_SESSION['cart']->get_quantity((int)$_GET['pid'])+1);

}

}

xtc_redirect(xtc_href_link($goto, xtc_get_all_get_params($parameters)));

break;

}

}

// write customers status in session

require(DIR_WS_INCLUDES . 'write_customers_status.php');

// include the who's online functions

xtc_update_whos_online();

// split-page-results

require(DIR_WS_CLASSES . 'split_page_results.php');

// infobox

require(DIR_WS_CLASSES . 'boxes.php');

// auto activate and expire banners

xtc_activate_banners();

xtc_expire_banners();

// auto expire special products

xtc_expire_specials();

// calculate category path

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

$cPath = $_GET['cPath'];

} elseif (isset($_GET['products_id']) && !isset($_GET['manufacturers_id'])) {

$cPath = xtc_get_product_path((int)$_GET['products_id']);

} else {

$cPath = '';

}

if (xtc_not_null($cPath)) {

$cPath_array = xtc_parse_category_path($cPath);

$cPath = implode('_', $cPath_array);

$current_category_id = $cPath_array[(sizeof($cPath_array)-1)];

} else {

$current_category_id = 0;

}

// include the breadcrumb class and start the breadcrumb trail

require(DIR_WS_CLASSES . 'breadcrumb.php');

$breadcrumb = new breadcrumb;

$breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER);

$breadcrumb->add(HEADER_TITLE_CATALOG, xtc_href_link(FILENAME_DEFAULT));

// add category names or the manufacturer name to the breadcrumb trail

if (isset($cPath_array)) {

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

if (GROUP_CHECK=='true') {

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

}

$categories_query = xtc_db_query("select

cd.categories_name

from " . TABLE_CATEGORIES_DESCRIPTION . " cd,

".TABLE_CATEGORIES." c

where cd.categories_id = '" . $cPath_array[$i] . "'

and c.categories_id=cd.categories_id

".$group_check."

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

if (xtc_db_num_rows($categories_query) > 0) {

$categories = xtc_db_fetch_array($categories_query);

$breadcrumb->add($categories['categories_name'], xtc_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1)))));

} else {

break;

}

}

} elseif (isset($_GET['manufacturers_id'])) {

$manufacturers_query = xtc_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'");

$manufacturers = xtc_db_fetch_array($manufacturers_query);

$breadcrumb->add($manufacturers['manufacturers_name'], xtc_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . (int)$_GET['manufacturers_id']));

}

// add the products model to the breadcrumb trail

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

$model_query = xtc_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . (int)$_GET['products_id'] . "'");

$model = xtc_db_fetch_array($model_query);

$breadcrumb->add($model['products_model'], xtc_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . (int)$_GET['products_id']));

}

// initialize the message stack for output messages

require(DIR_WS_CLASSES . 'message_stack.php');

$messageStack = new messageStack;

// set which precautions should be checked

define('WARN_INSTALL_EXISTENCE', 'true');

define('WARN_CONFIG_WRITEABLE', 'true');

define('WARN_SESSION_DIRECTORY_NOT_WRITEABLE', 'false');

define('WARN_SESSION_AUTO_START', 'true');

define('WARN_DOWNLOAD_DIRECTORY_NOT_READABLE', 'true');

// for tracking of customers

$_SESSION['user_info'] = array();

if (!$_SESSION['user_info']['user_ip']) {

$_SESSION['user_info']['user_ip'] = $_SERVER['REMOTE_ADDR'];

// $user_info['user_ip_date'] = value will be in fact added when login ;

$_SESSION['user_info']['user_host'] = gethostbyaddr( $_SERVER['REMOTE_ADDR'] );;

$_SESSION['user_info']['advertiser'] = $_GET['ad'];

$_SESSION['user_info']['referer_url'] = $_SERVER['HTTP_REFERER'];

}

// Include Template Engine

require(DIR_WS_CLASSES . 'smarty_2.6.2/Smarty.class.php');

if (isset($_SESSION['customer_id'])) {

$account_type_query=xtc_db_query("SELECT

account_type,

customers_default_address_id

FROM

".TABLE_CUSTOMERS."

WHERE customers_id = '".(int)$_SESSION['customer_id']."'");

$account_type=xtc_db_fetch_array($account_type_query);

// check if zone id is unset bug #0000169

if (!isset($_SESSION['customer_country_id'])) {

$zone_query=xtc_db_query("SELECT entry_country_id

FROM ".TABLE_ADDRESS_BOOK."

WHERE customers_id='".(int)$_SESSION['customer_id']."'

and address_book_id='".$account_type['customers_default_address_id']."'");

$zone=xtc_db_fetch_array($zone_query);

$_SESSION['customer_country_id']=$zone['entry_country_id'];

}

$_SESSION['account_type']=$account_type['account_type'];

} else {

$_SESSION['account_type']='0';

}

// modification for nre graduated system

unset($_SESSION['actual_content']);

xtc_count_cart();

?>

Link to comment
Share on other sites

Archived

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

×
  • Create New...