Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

Does somebody know as adapting this contribution, (multi-stores 2.0), to the version oscommerce-2.2rc2a? or does some other version exist of multi-stores adapted to this oscommerce version?

 

Thank you

  • 5 months later...
Posted
Does somebody know as adapting this contribution, (multi-stores 2.0), to the version oscommerce-2.2rc2a? or does some other version exist of multi-stores adapted to this oscommerce version?

 

Thank you

 

Jugeti,

I wanted to know if you found a solution. I know some people have done it but they haven't really posted how to do it. I posted the question again here. Satish replayed saying that we just need to take care of admin login by modifying the code and everything else will be fine but I'm not an expert on PHP or MySQL and I haven't figure it out.

Civil engineer, not a programmer, but very curious.

Posted

I've been trying for quite some time now to install multi-stores in osc v2.2 rc2a. Now it seems that it got it to work (somehow).

First of all you need to fallow the steps that Jugeti suggested:

1º Install osCommerce v2.2 RC2a

2º Once installed the store, go to the created database and to suppress the table "administrators"

3º Once suppressed the table administrators, make the installation of Multi-stores v2.0, following the instructions included in the package

 

I have made this way the installation and it works well and at the moment I have not detected any problem.

 

Jugeti

 

Onece your done installing multi-stores you'll get the following error:
Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in
your php.ini configuration file or in the .htaccess file in your catalog directory.

to fix this I added the code from Magic SEO URL for osCommerce (Running osCommerce with Register Globals Off) .

 

MOD Title: osCommerce 2.2ms2-060817 Register Globals Off Workaround for PHP4 and PHP5
MOD Author: Jiri Stavinoha
MOD Description: Allow to run osCommerce 2.2ms2 on web servers with Register Globals Off or On (PHP4 and PHP5 compatible)

INSTALLATION INSTRUCTIONS

OPEN:

catalog/includes/application_top.php

FIND:

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

BEFORE, ADD:

// Register Globals MOD - http://www.magic-seo-url.com

 if (version_compare(phpversion(), "4.1.0", "<") === true) {
$_GET &= $HTTP_GET_VARS;
$_POST &= $HTTP_POST_VARS;
$_SERVER &= $HTTP_SERVER_VARS;
$_FILES &= $HTTP_POST_FILES;
$_ENV &= $HTTP_ENV_VARS;
if (isset($HTTP_COOKIE_VARS)) $_COOKIE &= $HTTP_COOKIE_VARS;
 }

 if (!ini_get("register_globals")) {
extract($_GET, EXTR_SKIP);
extract($_POST, EXTR_SKIP);
extract($_COOKIE, EXTR_SKIP);
 } 

FIND:

// check if register_globals is enabled.
// since this is a temporary measure this message is hardcoded. The requirement will be removed before 2.2 is finalized.
 if (function_exists('ini_get')) {
ini_get('register_globals') or exit('Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory.');
 } 

REPLACE WITH:

// Check if register_globals is enabled.
// Since this is a temporary measure this message is hardcoded. The requirement will be removed before 2.2 is finalized.
 /*if (function_exists('ini_get')) { // Register Globals MOD - http://www.magic-seo-url.com
ini_get('register_globals') or exit('Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory.');
 }*/ 

FIND:

// set SID once, even if empty
 $SID = (defined('SID') ? SID : ''); 

BEFORE, ADD:

// Register Globals MOD - http://www.magic-seo-url.com
 if (!ini_get("register_globals")) {
if (version_compare(phpversion(), "4.1.0", "<") === true) {
  if (isset($HTTP_SESSION_VARS)) $_SESSION &= $HTTP_SESSION_VARS;
}
if(!empty($_SESSION)) extract($_SESSION, EXTR_SKIP);
 } 

OPEN:

catalog/includes/functions/sessions.php

FIND:

 function tep_session_register($variable) {
global $session_started;

if ($session_started == true) {
  return session_register($variable);
} else {
  return false;
}
 }

 function tep_session_is_registered($variable) {
return session_is_registered($variable);
 }

 function tep_session_unregister($variable) {
return session_unregister($variable);
 } 

REPLACE WITH:

// Register Globals MOD - http://www.magic-seo-url.com
 function tep_session_register($variable) {
global $session_started;
if ($session_started == true) {
  $_SESSION[$variable] = null;
  return true;
} else {
  return false;
}
 }

 function tep_session_is_registered($variable) {
if(isset($_SESSION[$variable])) {
  return true;
} else {
  return false;
}
 }

 function tep_session_unregister($variable) {
unset($_SESSION[$variable]);
 } 

FIND:

 function tep_session_close() {
if (PHP_VERSION >= '4.0.4') {
  return session_write_close();
} elseif (function_exists('session_close')) {
  return session_close();
}
 } 

REPLACE WITH:

// Register Globals MOD - http://www.magic-seo-url.com
 function tep_session_close() {
foreach($_SESSION as $key => $value) {
  global $$key;
  $_SESSION[$key] = $$key;
}
 } 

OPEN:

catalog/admin/includes/application_top.php

FIND:

// Start the clock for the page parse time log
 define('PAGE_PARSE_START_TIME', microtime()); 

BEFORE, ADD:

 // Register Globals MOD - http://www.magic-seo-url.com
 if (version_compare(phpversion(), "4.1.0", "<") === true) {
$_GET &= $HTTP_GET_VARS;
$_POST &= $HTTP_POST_VARS;
$_SERVER &= $HTTP_SERVER_VARS;
$_FILES &= $HTTP_POST_FILES;
$_ENV &= $HTTP_ENV_VARS;
if (isset($HTTP_COOKIE_VARS)) $_COOKIE &= $HTTP_COOKIE_VARS;
 }

 if (!ini_get("register_globals")) {
extract($_GET, EXTR_SKIP);
extract($_POST, EXTR_SKIP);
extract($_COOKIE, EXTR_SKIP);
 } 

FIND:

// Check if register_globals is enabled.
// Since this is a temporary measure this message is hardcoded. The requirement will be removed before 2.2 is finalized.
 if (function_exists('ini_get')) {
ini_get('register_globals') or exit('Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory.');
 } 

REPLACE WITH:

// Check if register_globals is enabled.
// Since this is a temporary measure this message is hardcoded. The requirement will be removed before 2.2 is finalized.
 /*if (function_exists('ini_get')) { // Register Globals MOD - http://www.magic-seo-url.com
ini_get('register_globals') or exit('Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory.');
 }*/ 

FIND:

// lets start our session
 tep_session_start(); 

AFTER, ADD:

// Register Globals MOD - http://www.magic-seo-url.com
 if (!ini_get("register_globals")) {
if (version_compare(phpversion(), "4.1.0", "<") === true) {
  if (isset($HTTP_SESSION_VARS)) $_SESSION &= $HTTP_SESSION_VARS;
}
if(!empty($_SESSION)) extract($_SESSION, EXTR_SKIP);
 } 

OPEN:

catalog/admin/includes/functions/sessions.php

FIND:

 function tep_session_register($variable) {
return session_register($variable);
 }

 function tep_session_is_registered($variable) {
return session_is_registered($variable);
 }

 function tep_session_unregister($variable) {
return session_unregister($variable);
 } 

REPLACE WITH:

// Register Globals MOD - http://www.magic-seo-url.com
 function tep_session_register($variable) {
$_SESSION[$variable] = null;
 }

 function tep_session_is_registered($variable) {
if(isset($_SESSION[$variable])) {
  return true;
} else {
  return false;
}
 }

 function tep_session_unregister($variable) {
unset($_SESSION[$variable]);
 } 

FIND:

 function tep_session_close() {
if (function_exists('session_close')) {
  return session_close();
}
 } 

REPLACE WITH:

// Register Globals MOD - http://www.magic-seo-url.com
 function tep_session_close() {
foreach($_SESSION as $key => $value) {
  global $$key;
  $_SESSION[$key] = $$key;
}
 } 

OPEN:

catalog/install/includes/application.php

FIND:

// Set the level of error reporting
 error_reporting(E_ALL & ~E_NOTICE); 

AFTER, ADD:

 // Register Globals MOD - http://www.magic-seo-url.com
 if (version_compare(phpversion(), "4.1.0", "<") === true) {
$_GET &= $HTTP_GET_VARS;
$_POST &= $HTTP_POST_VARS;
$_SERVER &= $HTTP_SERVER_VARS;
$_FILES &= $HTTP_POST_FILES;
$_ENV &= $HTTP_ENV_VARS;
if (isset($HTTP_COOKIE_VARS)) $_COOKIE &= $HTTP_COOKIE_VARS;
 }

 if (!ini_get("register_globals")) {
extract($_GET, EXTR_SKIP);
extract($_POST, EXTR_SKIP);
extract($_COOKIE, EXTR_SKIP);
 } 

FIND:

// Check if register_globals is enabled.
// Since this is a temporary measure this message is hardcoded. The requirement will be removed before 2.2 is finalized.
 if (function_exists('ini_get')) {
ini_get('register_globals') or exit('FATAL ERROR: register_globals is disabled in php.ini, please enable it!');
 } 

REPLACE WITH:

// Check if register_globals is enabled.
// Since this is a temporary measure this message is hardcoded. The requirement will be removed before 2.2 is finalized.
 /*if (function_exists('ini_get')) {
ini_get('register_globals') or exit('FATAL ERROR: register_globals is disabled in php.ini, please enable it!');
 }*/ 

SAVE/CLOSE ALL FILES

Apparenly everthing is running ok.

I hope this helps. :D

Civil engineer, not a programmer, but very curious.

  • 4 weeks later...
Posted

Ok, so I've done the install and done the find and replace stuff. I am getting an error which hasn't been touched on in here. This is the error I am getting:

 

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/content/f/u/n/funkymonkee31/html/templelightbrokers.com/catalog/includes/application_top.php on line 13

 

This is line 13:

 

if (version_compare(phpversion(), "4.1.0", "<") === true) {

Posted

That's probably an error on the previous line.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...