Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Additional Images "delete image" Problem!


Recommended Posts

Greetings noble members of the osc-forum.

 

I've installed the latest version of additional images and I'm very satified with it. But while testing all functions I had a problem. When I want to delete a picture form the admin panel, I recieve this message:

Fatal error: Call to undefined function: si() in /homepages/18/d13508335/htdocs/catalog/admin/categories.php on line 319

So I had a look at this section but found no obvious error? So here is the "delete image" section of the categories.php:

case 'del_images':

        $additional_images_id = tep_db_prepare_input($HTTP_GET_VARS['pID']);

        

        if ( ($HTTP_POST_VARS['products_id']) && (is_array($HTTP_POST_VARS['additional_images_id'])) ) {

          $product_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);

          $additional_images_id = $HTTP_POST_VARS['additional_images_id'];

                          

          for ($i=0; $i<si($additional_images_id); $i++) {

            tep_db_query("te from " . TABLE_ADDITIONAL_IMAGES . " where additional_images_id = '" . tep_db_input($additional_images_id[$i]) . "'");

          }               

        }                 

        //tep_db_query("de from " . TABLE_ADDITIONAL_IMAGES . " where additional_images_id = '" . $HTTP_POST_VARS['additional_images_id'] . "'");

        tep_redirect(tep_hlink(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products_id));

        break;

At line 319 you'll find this:

for ($i=0; $i<si($additional_images_id); $i++) {

            tep_db_query("te from " . TABLE_ADDITIONAL_IMAGES . " where additional_images_id = '" . tep_db_input($additional_images_id[$i]) . "'");

          }              

        }

 

So if someone has an idea how to fix my problem?

Mike

May the force be with you.

Link to comment
Share on other sites

From an Earlier Post:

The code is missing characters all over the place. Here is the correct code
.

 

 

case 'del_images': 

       $additional_images_id = tep_db_prepare_input($HTTP_GET_VARS['pID']); 

       

       if ( ($HTTP_POST_VARS['products_id']) && (is_array($HTTP_POST_VARS['additional_images_id'])) ) { 

         $product_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']); 

         $additional_images_id = $HTTP_POST_VARS['additional_images_id']; 



         for ($i=0; $i<sizeof($additional_images_id); $i++) { 

           tep_db_query("delete from " . TABLE_ADDITIONAL_IMAGES . " where additional_images_id = '" . tep_db_input($additional_images_id[$i]) . "'"); 

         } 

       } 

       //tep_db_query("delete from " . TABLE_ADDITIONAL_IMAGES . " where additional_images_id = '" . $HTTP_POST_VARS['additional_images_id'] . "'"); 

       tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products_id)); 

       break;

 

I changed this in Categories.php and it worked for me

 

Good Luck

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