Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

STSv4.4 --> Admin/module/STS default won't set to 'true'


Guest

Recommended Posts

Hello all,

 

I select 'true' in the Admin/module/STS default/'edit' to 'true' to activate and update, it returns to 'false' every time.

 

This is a clean install of v4.4 on a clean install of the latest version of osCommerce. Installation went fine. I've quadruple checked my local files with the files online and everything's there and in the correct locations.

 

All other osCommerce Admin features work fine--except the STS default will not change 'false' to 'true' when I update to active STS online.

 

Default

Remove Module Edit

 

Default template (v2.0.0)

 

Use Templates?

false <----When I select 'true' in the Admin/module/STS default/'edit' to 'true' and update, it returns to 'false' every time.

 

Code for debug output

debug

 

Files for normal template

sts_user_code.php

 

Base folder

includes/sts_templates/

 

Template folder

test

 

Default template file

sts_template.html

 

Use template for infoboxes

false <----Same here. I select 'true' in the Admin/module/STS default/'edit' to 'true' and update, it returns to 'false'.

 

I have also tried changing from false to true in my local sts_default.php file and uploading the edit to catalog/includes/modules/sts/sts_default.php. But nothing changes. In Admin I still get default showing 'false', and my online index.php page is the same oscommerce default template.

 

Any suggestions?

 

I can see my new template when I url the sts_template file I created, but index.php seems to be blind to find my new template.

Link to comment
Share on other sites

You are experiencing the widely known "refresh bug" of the modules section which includes shipping, payment, etc (not just isolated to the STS modules, but all of the other modules as well).

 

There is a simple fix:

 

1. Open the catalog/admin/includes/functions/compatibility.php.

2. At the end of the “do_magic_quotes_gpc” routine, add the following code

 

reset($ar);

 

It will end up looking like this:

 

function do_magic_quotes_gpc(&$ar) {
if (!is_array($ar)) return false;
while (list($key, $value) = each($ar)) {
if (is_array($ar[$key])) {
do_magic_quotes_gpc($ar[$key]);
} else {
$ar[$key] = addslashes($value);
}
}
reset($ar);
}

 

3. Do the same for the compatibility.php file located in catalog/includes/functions/compatibility.php.

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

You are experiencing the widely known "refresh bug" of the modules section which includes shipping, payment, etc (not just isolated to the STS modules, but all of the other modules as well).

 

There is a simple fix:

 

1. Open the catalog/admin/includes/functions/compatibility.php.

2. At the end of the “do_magic_quotes_gpc” routine, add the following code

 

reset($ar);

 

It will end up looking like this:

 

function do_magic_quotes_gpc(&$ar) {
if (!is_array($ar)) return false;
while (list($key, $value) = each($ar)) {
if (is_array($ar[$key])) {
do_magic_quotes_gpc($ar[$key]);
} else {
$ar[$key] = addslashes($value);
}
}
reset($ar);
}

 

3. Do the same for the compatibility.php file located in catalog/includes/functions/compatibility.php.

 

Hi Bill,

 

I looked at this and it seems mine is a little different, I don't know why, my site was built by someone else, and it does have errors and mysql problems. This is what I copied, is this normal, as you can see, I'm missing part of the [$key] in several lines...

 

<?php

/*

$Id: compatibility.php,v 1.10 2003/06/23 01:20:05 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

////

// Recursively handle magic_quotes_gpc turned off.

// This is due to the possibility of have an array in

// $HTTP_xxx_VARS

// Ie, products attributes

function do_magic_quotes_gpc(&$ar) {

if (!is_array($ar)) return false;

 

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

if (is_array($value)) {

do_magic_quotes_gpc($value);

} else {

$ar[$key] = addslashes($value);

}

}

}

 

// $HTTP_xxx_VARS are always set on php4

 

Any suggestions would be a blessing - and should I still add the reset($ar); - Thank you in advance.

Link to comment
Share on other sites

Hi Bill,

 

I looked at this and it seems mine is a little different, I don't know why, my site was built by someone else, and it does have errors and mysql problems. This is what I copied, is this normal, as you can see, I'm missing part of the [$key] in several lines...

 

<?php

/*

$Id: compatibility.php,v 1.10 2003/06/23 01:20:05 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

////

// Recursively handle magic_quotes_gpc turned off.

// This is due to the possibility of have an array in

// $HTTP_xxx_VARS

// Ie, products attributes

function do_magic_quotes_gpc(&$ar) {

if (!is_array($ar)) return false;

 

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

if (is_array($value)) {

do_magic_quotes_gpc($value);

} else {

$ar[$key] = addslashes($value);

}

}

}

 

// $HTTP_xxx_VARS are always set on php4

 

Any suggestions would be a blessing - and should I still add the reset($ar); - Thank you in advance.

You have a modified version of that file.

Try this then:

Open and edit /catalog/admin/modules.php

Find this line:

while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) {

Comment that line out and replaced it with this line:

 

foreach ($HTTP_POST_VARS['configuration'] as $key => $value){

See if that works for you.

Edited by bkellum

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

Thanks bkellum,

 

That fixed it imeadiately. :thumbsup:

 

I have did the same changes as what Bill said below,but my STS V4.4 default page still can't work,I doubt there is any other changes needed in some files,please could you tell me what changes on which file(s) should be made ? Thanks!

 

 

 

"There is a simple fix:

 

1. Open the catalog/admin/includes/functions/compatibility.php.

2. At the end of the “do_magic_quotes_gpc” routine, add the following code

 

 

CODE

reset($ar);

 

 

It will end up looking like this:

 

 

CODE

function do_magic_quotes_gpc(&$ar) {

if (!is_array($ar)) return false;

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

if (is_array($ar[$key])) {

do_magic_quotes_gpc($ar[$key]);

} else {

$ar[$key] = addslashes($value);

}

}

reset($ar);

}

 

 

3. Do the same for the compatibility.php file located in catalog/includes/functions/compatibility.php."

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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...