Zen Cart Logo
Forums / All Other Contributions/Addons / Links point to localhost (xoops version of ZC)

Links point to localhost (xoops version of ZC)

Locked

Views: 4,381

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
10 Mar 2008, 4:37 PM
#1
holljac avatar

holljac

New Zenner

Join Date:
May 2006
Posts:
15
Plugin Contributions:
0

Links point to localhost (xoops version of ZC)

I am running Zencart as a module in a xoops install. I had to redo my site the other day because of getting hacked. I used a version several months old and picked and imported sql and other stuff as needed until the site was clean and up to date. Of course I did this on my computer at home so everything was setup to point to localhost. I cleaned out the directory at the hoster and uploaded all the cleaned files. I have changed the server and db settings in the xoops mainfile.php and I have also changed the settings in the /modules/shop/admin/includes/configure.php, /modules/shop/admin/includes/dist-configure.php, /modules/shop/includes/configure.php and /modules/shop/includes/dist-configure.php files. These are the only files that I can find that set the urls of the store. Yet every time I navigate to the store and then hover over one of the links it shows http://localhosthttp://www.bpbows.com/modules/shop ..... So if you click on one of the links, you of course get an error. So the questions are: Where does the index page of the store receive it's setting from? Where does Zencart save it's server and db settings at? Can someone give me an idea of where else to look? Yes, I have cleaned out the templates_c folder as well as my browser cache to make sure it's not just reloading a stale page.

Curt

10 Mar 2008, 4:49 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Links point to localhost (xoops version of ZC)

Only the 2 configure.php files - you do not have to retain the dist-configure.php files at all.

Post the top half of one of yours here

10 Mar 2008, 4:57 PM
#3
holljac avatar

holljac

New Zenner

Join Date:
May 2006
Posts:
15
Plugin Contributions:
0

Re: Links point to localhost (xoops version of ZC)

Here's the top half of the /modules/shop/admin/includes/configure.php

<?php // // +----------------------------------------------------------------------+ // |Zen Cart Open Source E-commerce | // +----------------------------------------------------------------------+ // | Copyright (c) 2004 The Zen Cart developers | // | | // | <http://www.zen-cart.com/index.php> | // | | // | Portions Copyright (c) 2003 osCommerce | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the GPL license, | // | that is bundled with this package in the file LICENSE, and is | // | available through the world-wide-web at the following url: | // | <http://www.zen-cart.com/license/2_0.txt>. | // | If you did not receive a copy of the Zen Cart license and are unable | // | to obtain it through the world-wide-web, please send a note to | // | [email protected] so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // global $xoopsOption; $xoopsOption=array("nocommon" => "1"); require '../../../mainfile.php'; // Define the webserver and path parameters // Main webserver: eg, <http://localhost> - should not be empty for productive servers define('HTTP_SERVER', 'http://www.bpbows.com'); // Secure webserver: eg, <https://localhost> - should not be empty for productive servers define('HTTPS_SERVER', 'https://bpbows.c5.ixwebhosting.com'); // eg, <https://localhost> define('HTTP_CATALOG_SERVER', 'https://bpbows.c5.ixwebhosting.com'); define('HTTPS_CATALOG_SERVER', 'https://bpbows.c5.ixwebhosting.com'); // secure webserver for catalog module and/or admin areas? define('ENABLE_SSL_CATALOG', 'true'); define('ENABLE_SSL_ADMIN', 'true'); define('NXOOPS_URL',str_replace(HTTP_SERVER,'',XOOPS_URL));
10 Mar 2008, 5:08 PM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Links point to localhost (xoops version of ZC)

Probably needed a bit more of your file but on hover this is the address being looked for and definitely an error somewhere

http://localhosthttp://www.bpbows.com/modules/shop...

Either in the Zen Configs or in how XOOPs implementaion adds the /module

10 Mar 2008, 5:10 PM
#5
holljac avatar

holljac

New Zenner

Join Date:
May 2006
Posts:
15
Plugin Contributions:
0

Re: Links point to localhost (xoops version of ZC)

Ok, here's the whole file.

<?php // // +----------------------------------------------------------------------+ // |Zen Cart Open Source E-commerce | // +----------------------------------------------------------------------+ // | Copyright (c) 2004 The Zen Cart developers | // | | // | <http://www.zen-cart.com/index.php> | // | | // | Portions Copyright (c) 2003 osCommerce | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the GPL license, | // | that is bundled with this package in the file LICENSE, and is | // | available through the world-wide-web at the following url: | // | <http://www.zen-cart.com/license/2_0.txt>. | // | If you did not receive a copy of the Zen Cart license and are unable | // | to obtain it through the world-wide-web, please send a note to | // | [email protected] so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // global $xoopsOption; $xoopsOption=array("nocommon" => "1"); require '../../../mainfile.php'; // Define the webserver and path parameters // Main webserver: eg, <http://localhost> - should not be empty for productive servers define('HTTP_SERVER', 'http://www.bpbows.com'); // Secure webserver: eg, <https://localhost> - should not be empty for productive servers define('HTTPS_SERVER', 'https://bpbows.c5.ixwebhosting.com'); // eg, <https://localhost> define('HTTP_CATALOG_SERVER', 'https://bpbows.c5.ixwebhosting.com'); define('HTTPS_CATALOG_SERVER', 'https://bpbows.c5.ixwebhosting.com'); // secure webserver for catalog module and/or admin areas? define('ENABLE_SSL_CATALOG', 'true'); define('ENABLE_SSL_ADMIN', 'true'); define('NXOOPS_URL',str_replace(HTTP_SERVER,'',XOOPS_URL)); // NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes! // * DIR_WS_* = Webserver directories (virtual/URL) // these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder) define('DIR_WS_ADMIN', NXOOPS_URL.'/modules/shop/admin/'); define('DIR_WS_CATALOG', NXOOPS_URL.'/modules/shop/'); define('DIR_WS_HTTPS_ADMIN', NXOOPS_URL.'/modules/shop/admin/'); define('DIR_WS_HTTPS_CATALOG', NXOOPS_URL.'/modules/shop/'); define('DIR_WS_IMAGES', 'images/'); define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/'); define('DIR_WS_CATALOG_IMAGES', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'images/'); define('DIR_WS_CATALOG_TEMPLATE', HTTP_CATALOG_SERVER. DIR_WS_CATALOG . 'includes/templates/'); 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_INCLUDES . 'languages/'); define('DIR_WS_CATALOG_LANGUAGES', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'includes/languages/'); define('DIR_WS_BLOCKS', DIR_WS_INCLUDES . 'blocks/'); // * DIR_FS_* = Filesystem directories (local/physical) //the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/ define('DIR_FS_ADMIN', XOOPS_ROOT_PATH.'/modules/shop/admin/'); define('DIR_FS_CATALOG', XOOPS_ROOT_PATH.'/modules/shop/'); define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/'); define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/'); define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/'); define('DIR_FS_CATALOG_TEMPLATES', DIR_FS_CATALOG . 'includes/templates/'); define('DIR_FS_CATALOG_BLOCKS', DIR_FS_CATALOG . 'includes/blocks/'); define('DIR_FS_CATALOG_BOXES', DIR_FS_CATALOG . 'includes/boxes/'); define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/'); define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/'); define('DIR_FS_FILE_MANAGER_ROOT', XOOPS_ROOT_PATH.'/modules/shop'); // path to starting directory of the file manager // define our database connection define('DB_TYPE', 'mysql'); define('DB_PREFIX', XOOPS_DB_PREFIX. '_zc'); define('DB_SERVER', XOOPS_DB_HOST); // eg, localhost - should not be empty define('DB_SERVER_USERNAME', XOOPS_DB_USER); define('DB_SERVER_PASSWORD', XOOPS_DB_PASS); define('DB_DATABASE', XOOPS_DB_NAME); define('USE_PCONNECT', 'false'); // use persistent connections? define('STORE_SESSIONS', 'db'); // leave empty '' for default handler or set to 'db' // The next 2 "defines" are for SQL cache support. // For SQL_CACHE_METHOD, you can select from: none, database, or file // If you choose "file", then you need to set the DIR_FS_SQL_CACHE to a directory where your apache // or webserver user has write privileges (chmod 666 or 777). We recommend using the "cache" folder inside the Zen Cart folder // ie: /path/to/your/webspace/public_html/zen/cache -- leave no trailing slash define('SQL_CACHE_METHOD', 'none'); define('DIR_FS_SQL_CACHE', XOOPS_ROOT_PATH.'/modules/shop/cache'); ?>
10 Mar 2008, 5:20 PM
#6
holljac avatar

holljac

New Zenner

Join Date:
May 2006
Posts:
15
Plugin Contributions:
0

Re: Links point to localhost (xoops version of ZC)

Just for completeness, here is the xoops mainfile.php. I have removed all distinct values.

<?php // $Id: mainfile.dist.php,v 1.7.6.3 2005/05/21 15:38:20 mithyt2 Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // // <http://www.xoops.org/> // // ------------------------------------------------------------------------ // // This program is free software; you can redistribute it and/or modify // // it under the terms of the GNU General Public License as published by // // the Free Software Foundation; either version 2 of the License, or // // (at your option) any later version. // // // // You may not change or alter any portion of this comment or credits // // of supporting developers from this source code or any supporting // // source code which is considered copyrighted (c) material of the // // original comment or credit authors. // // // // This program is distributed in the hope that it will be useful, // // but WITHOUT ANY WARRANTY; without even the implied warranty of // // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // // GNU General Public License for more details. // // // // You should have received a copy of the GNU General Public License // // along with this program; if not, write to the Free Software // // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // ------------------------------------------------------------------------ // if ( !defined("XOOPS_MAINFILE_INCLUDED") ) { define("XOOPS_MAINFILE_INCLUDED",1); // XOOPS Physical Path // Physical path to your main XOOPS directory WITHOUT trailing slash // Example: define('XOOPS_ROOT_PATH', '/var/www/html/bpbows.homelinux.org'); define('XOOPS_ROOT_PATH', '/path/on/server/to/bpbows.com'); // XOOPS Virtual Path (URL) // Virtual path to your main XOOPS directory WITHOUT trailing slash // Example: define('XOOPS_URL', 'http://bpbows.homelinux.org'); define('XOOPS_URL', 'http://www.bpbows.com'); define('XOOPS_CHECK_PATH', '1'); // Protect against external scripts execution if safe mode is not enabled if ( XOOPS_CHECK_PATH && !@ini_get('safe_mode') ) { if ( function_exists('debug_backtrace') ) { $xoopsScriptPath = debug_backtrace(); if ( !count($xoopsScriptPath) ) { die("XOOPS path check: this file cannot be requested directly"); } $xoopsScriptPath = $xoopsScriptPath[0]['file']; } else { $xoopsScriptPath = isset($_SERVER['PATH_TRANSLATED']) ? $_SERVER['PATH_TRANSLATED'] : $_SERVER['SCRIPT_FILENAME']; } if ( DIRECTORY_SEPARATOR != '/' ) { // IIS6 may double the \ chars $xoopsScriptPath = str_replace( strpos( $xoopsScriptPath, '\\\\', 2 ) ? '\\\\' : DIRECTORY_SEPARATOR, '/', $xoopsScriptPath); } if ( strcasecmp( substr($xoopsScriptPath, 0, strlen(XOOPS_ROOT_PATH)), str_replace( DIRECTORY_SEPARATOR, '/', XOOPS_ROOT_PATH)) ) { exit("XOOPS path check: Script is not inside XOOPS_ROOT_PATH and cannot run."); } } // Database // Choose the database to be used define('XOOPS_DB_TYPE', 'mysql'); // Table Prefix // This prefix will be added to all new tables created to avoid name conflict in the database. Please change this to something different than 'xoops'. define('XOOPS_DB_PREFIX', 'prefix'); // Database Hostname // Hostname of the database server. If you are unsure, 'localhost' works in most cases. define('XOOPS_DB_HOST', 'xxx.xxx.xxx.xxx'); // Database Username // Your database user account on the host define('XOOPS_DB_USER', 'username'); // Database Password // Password for your database user account define('XOOPS_DB_PASS', 'password'); // Database Name // The name of database on the host. The installer will attempt to create the database if not exist define('XOOPS_DB_NAME', 'databasename'); // Use persistent connection? (Yes=1 No=0) // Default is 'No'. Choose 'No' if you are unsure. define('XOOPS_DB_PCONNECT', '1'); define('XOOPS_GROUP_ADMIN', '1'); define('XOOPS_GROUP_USERS', '2'); define('XOOPS_GROUP_ANONYMOUS', '3'); include( XOOPS_ROOT_PATH . '/modules/protector/include/precheck.inc.php' ); if (!isset($xoopsOption['nocommon']) && XOOPS_ROOT_PATH != '') { require XOOPS_ROOT_PATH."/include/common.php"; } include( XOOPS_ROOT_PATH . '/modules/protector/include/postcheck.inc.php' ); } ?>
10 Mar 2008, 5:44 PM
#7
holljac avatar

holljac

New Zenner

Join Date:
May 2006
Posts:
15
Plugin Contributions:
0

Re: Links point to localhost (xoops version of ZC)

I found that it was one of the configure.php files. It had read and execute permissions only. When I edited it with my ftp program, gftp, it had asked if I wanted to upload the changes and I said yes. It didn't write the changes and gave no warning. I only found it because I was checking those files again. Thanks for the quick response and help.

Curt

10 Mar 2008, 5:46 PM
#8
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Links point to localhost (xoops version of ZC)

Look at what is defined in XOOP's for:

define('NXOOPS_URL',str_replace(HTTP_SERVER,'',XOO PS_URL));

Edit:

Great!!! Always something overlooked...