Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Error in /includes/boxes/categories.php


Guest

Recommended Posts

Dang !! - On a new install...

 

Getting this on the load of default.php...

Warning: in_array() [function.in-array]: Wrong datatype for second argument

 

Code block 31-38 :

if ( ($id) && (in_array($counter, $id)) ) {

$categories_string .= '<b>';

}

 

// display category name

$categories_string .= $foo[$counter]['name'];

 

if ( ($id) && (in_array($counter, $id)) ) {

$categories_string .= '</b>';

}

 

It's failing on the if (($id && (in_array($counter, $id)) ) lines...

and for the life of me can't see why..Rest of the cart is great!

 

TIA for any replies!

Link to comment
Share on other sites

no probs here with tep_snapshot-20030417

Robert

 

We all need to learn it once, how hard it may seem when you look at it, also you will master it someday ;)

Link to comment
Share on other sites

Im using Milestone: osCommerce 2.2MS1

My website http://www.tiesmanstudio.com/catalog/default.php is hosted at enterprisedigital.net , its your typical setup. Ive had previous versions of OSC on this system in the past with no problems, thats what has me boggled.

 

The problem appears to be only on the default.php

 

Heres my unmodified line 31-38 by the way

if ( ($id) && (in_array($counter, $id)) ) {

$categories_string .= '<b>';

}

 

// display category name

$categories_string .= $foo[$counter]['name'];

 

if ( ($id) && (in_array($counter, $id)) ) {

code]

Link to comment
Share on other sites

I am not getting any errors on your default.php ... did you fix this?

 

no, i have been waiting for help before I decide to rip into it. Your not getting a large list of errors on the left side of default?? Now thats strange!

 

Nope ... it all looks fine from here.

 

Maybe close your browser and clear the cache then open it again.

Link to comment
Share on other sites

Im not sure what page your looking at here.. The problem is on this one -> http://tiesmanstudio.com/catalog/default.php

 

The errors are in the categories box on the left side :

 

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/noburner/public_html/catalog/includes/boxes/categories.php on line 31

 

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/noburner/public_html/catalog/includes/boxes/categories.php on line 38

 

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/noburner/public_html/catalog/includes/boxes/categories.php on line 31

 

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/noburner/public_html/catalog/includes/boxes/categories.php on line 38

 

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/noburner/public_html/catalog/includes/boxes/categories.php on line 31

 

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/noburner/public_html/catalog/includes/boxes/categories.php on line 38

 

Clearing my cache didnt seem to solve the problem on my side.

Link to comment
Share on other sites

Not a single error ...

 

That is the page I am going to.

 

For giggles ... make sure you close all your browser windows and try to clear your cache.

 

But I have not had any errors and have tried moving all over the default.php to trip them.

Link to comment
Share on other sites

Note: you need to throw in an .htaccess file on your site so that people do not get to your directory listing when not using the default.php in the URL.

Link to comment
Share on other sites

I have just run into that one from time to time ... and until I shut all my browser windows the code continues to appear broken.

 

But ... although you wasted lots of time on that one ... the next zillion times you will think of that when it just refuses to fix and someone comes along and says ... "works great for me!" :D

Link to comment
Share on other sites

Exactly the same error I had...down to the line #'s ..it seems to be code with no purpose, as it checks $id (expands to "guest"), against $counter (which is an incrementing count e.g. +1, +2 etc).

 

To get it to work, just replace the code block with this code

 

$categories_string .= '<b>'

$categories_string .= $foo[$counter]['name'];

$categories_string .= '</b>';

 

or ...concatenate the whole lot ..your call....makes the categories show in bold, which looks good.

 

Anyway, cured my problem.

 

Code was cut of Milestone: osCommerce 2.2MS1 downloaded Monday 14th ....

 

The code was downloaded from

Link to comment
Share on other sites

and ..re the .htaccess file for redirecting to default.php ..this is the best way to do it ....but .htaccess sometimes gets a little complicated for newbies ..so, an alternative is to create an index.php in your cart directory with the following code.

 

 

<? header("Location: http://yoursite.com/yourshopdir/default.php");

exit;

?>

 

 

Obviously substituting your own website address for yoursite.com and your shop dir name for yourshopdir

 

Much simpler than .htaccess :D

Link to comment
Share on other sites

I do not believe that is going to be too good for search engines.

 

You want things to be real ... the .htaccess is just providing the settings to know what order to look for filenames

 

Just be careful to check if you already have one.

 

The one you want to address is in the root. This should be looked at via CPanel or whatever you have for your server ... but I would upload it via FTP.

 

The reason I say use CPanel or something to look for the file is many FTP programs do not show the file.

Link to comment
Share on other sites

Exactly the same error I had...down to the line #'s ..it seems to be code with no purpose, as it checks $id (expands to "guest"), against $counter (which is an incrementing count e.g. +1, +2 etc).

 

To get it to work, just replace the code block with this code

 

$categories_string .= '<b>'

$categories_string .= $foo[$counter]['name'];

$categories_string .= '</b>';

 

or ...concatenate the whole lot ..your call....makes the categories show in bold, which looks good.

 

Anyway, cured my problem.

 

Code was cut of Milestone: osCommerce 2.2MS1 downloaded Monday 14th ....

 

The code was downloaded from

 

I ended up replacing catagories.php with someones modded version. Cured my problem, but thanks for the code above, maybe it will help someone else :)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...