Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

A interesting error


kaos9889

Recommended Posts

on my site i get this error:

Fatal error: Cannot instantiate non-existent class: imagesbox in /home/muscle30/public_html/shop/includes/modules/additional_images.php on line 43

 

so i go to my additional_images.php file and it looks like this:

<?php
/*
 $Id: additional_images.php,v 1.0 2003/02/28 dgw_ Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 AUTHOR: Zaenal Muttaqin <[email protected]>  
 Released under the GNU General Public License  
*/
?>

<?php
 $images_product = tep_db_query("SELECT additional_images_id, products_id, images_description, medium_images, popup_images FROM " . TABLE_ADDITIONAL_IMAGES . " WHERE products_id = '" . $HTTP_GET_VARS['products_id'] . "'");
 if (!tep_db_num_rows($images_product)) {
?>
<br>
<?php
 } else {
?>
<!-- additional_images //-->
<table width="100%">
  <tr>
    <td>

<?php
 $info_box_contents = array();
 $row = 0;
 $col = 0;
 while ($new_products = tep_db_fetch_array($images_product)) {
   $info_box_contents[$row][$col] = array('align' => 'center',
                                          'params' => 'class="smallText" width="33%" valign="top"',
                                          'text' => '<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_ADD_IMAGE, 'imagesID=' . $new_products['additional_images_id']) . '\')">' . tep_image(DIR_WS_IMAGES . $new_products['medium_images'], $new_products['images_description'], DISPLAY_IMAGE_WIDTH, DISPLAY_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'
                                         );
   $col ++;
   if ($col > 2) {
     $col = 0;
     $row ++;
   }
 }
 new imagesBox($info_box_contents);
?>
    </td>
  </tr>
</table>
<!-- additional_images_eof //-->
<?php
 }
?>

 

with line 43 saying:

  new imagesBox($info_box_contents);

I am not sure what happened, I havent changed anything to do with this.

Any suggestions on how i could fix this?

 

and as always thank you for your time

There are many very useful OsC Contributions

BACKUP BACKUP BACKUP!!! You did backup, right??

And remember if you didnt back up its not a big deal, You

just have to do everything all over again.

Link to comment
Share on other sites

Do you have imagesBox declared?  The norma syntax is
 new infoBox($info_box_contents);

 

Jack

 

i apologize what do you mean by declare?

There are many very useful OsC Contributions

BACKUP BACKUP BACKUP!!! You did backup, right??

And remember if you didnt back up its not a big deal, You

just have to do everything all over again.

Link to comment
Share on other sites

The infoBox that is in that code I posted is a class name declared in class/boxes. You are calling a non-standard class name, imagesBox. In order to do that, you have to create the class first. Did you mean to use a different class? Maybe you did a search and replace and that got changed by mistake?

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

i changed line 43 to

new infoBox($info_box_contents);

and now i am getting no pictures see:

http://musclecarmemory.com/shop/product_in...df5c8a1984e7b4)

Thats has a enlarged image to it and was previously getting a error and now i am getting nothing but a box?

There are many very useful OsC Contributions

BACKUP BACKUP BACKUP!!! You did backup, right??

And remember if you didnt back up its not a big deal, You

just have to do everything all over again.

Link to comment
Share on other sites

Your probably right, i am about 50/50 on working through php, and a simple oversight could have been done on my part not seeing that. Do you know what i could do now? to make it work that is.

<?php
/*
 $Id: additional_images.php,v 1.0 2003/02/28 dgw_ Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 AUTHOR: Zaenal Muttaqin <[email protected]>  
 Released under the GNU General Public License  
*/
?>

<?php
 $images_product = tep_db_query("SELECT additional_images_id, products_id, images_description, medium_images, popup_images FROM " . TABLE_ADDITIONAL_IMAGES . " WHERE products_id = '" . $HTTP_GET_VARS['products_id'] . "'");
 if (!tep_db_num_rows($images_product)) {
?>
<br>
<?php
 } else {
?>
<!-- additional_images //-->
<table width="100%">
  <tr>
    <td>

<?php
 $info_box_contents = array();
 $row = 0;
 $col = 0;
 while ($new_products = tep_db_fetch_array($images_product)) {
   $info_box_contents[$row][$col] = array('align' => 'center',
                                          'params' => 'class="smallText" width="33%" valign="top"',
                                          'text' => '<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_ADD_IMAGE, 'imagesID=' . $new_products['additional_images_id']) . '\')">' . tep_image(DIR_WS_IMAGES . $new_products['medium_images'], $new_products['images_description'], DISPLAY_IMAGE_WIDTH, DISPLAY_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'
                                         );
   $col ++;
   if ($col > 2) {
     $col = 0;
     $row ++;
   }
 }

new infoBox($info_box_contents);
?>
    </td>
  </tr>
</table>
<!-- additional_images_eof //-->
<?php
 }
?>

There are many very useful OsC Contributions

BACKUP BACKUP BACKUP!!! You did backup, right??

And remember if you didnt back up its not a big deal, You

just have to do everything all over again.

Link to comment
Share on other sites

not the one on the right there should be a little resized image at the bottom that says enlarge image and when clicked on it pops up a full sized image

There are many very useful OsC Contributions

BACKUP BACKUP BACKUP!!! You did backup, right??

And remember if you didnt back up its not a big deal, You

just have to do everything all over again.

Link to comment
Share on other sites

Oh, that's a diferent problem. That link is created in product_info.php. There should be javascript on that page to control this but in looking at your source, that code is not there. Has that file been edited to remove it?

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

i didnt think so i have been using this contribution:

http://www.oscommerce.com/community/contributions,1032

for a while now, with no problems

There are many very useful OsC Contributions

BACKUP BACKUP BACKUP!!! You did backup, right??

And remember if you didnt back up its not a big deal, You

just have to do everything all over again.

Link to comment
Share on other sites

I suspect that whatever caused the imagesBox problem may be doing this too. I'm not sure i can be of much help since you are using a contribution I don't use and the problem could be in a number of places if a mass search& replace was done. There should be a support thread for that contribution. You probably should ask for help there.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Yea thats what i looked for first, could you recomend a better image contribution since you know what i already want the end to be?

There are many very useful OsC Contributions

BACKUP BACKUP BACKUP!!! You did backup, right??

And remember if you didnt back up its not a big deal, You

just have to do everything all over again.

Link to comment
Share on other sites

I don't really know what you want other that to display an enlarged image. The default code will do that. I don't use any of the image contributions so I am not the best person to ask. At the request of other members, I have installed the big_images and mopics contributions in their shops if that counts as a recommendation. But if you are going to install another contribution, you should remove the one that is in there. Otherwise you are really asking for trouble.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 3 weeks later...
I don't really know what you want other that to display an enlarged image.? The default code will do that.? I don't use any of the image contributions so I am not the best person to ask. At the request of other members, I have installed the big_images and mopics contributions in their shops if that counts as a recommendation.? But if you are going to install another contribution, you should remove the one that is in there.? Otherwise you are really asking for trouble.

 

Jack

Hi Jack, I notice above you mention that the default code will display an enlarged image. I assume you mean when you click on the line "click to enlarge image". This doesn't seem to be working for me (in fact the image that pops up seems smaller!)...is there something I need to do to make this work? Thanks in advance for the help!

 

Kathy

Link to comment
Share on other sites

  • 4 weeks later...

To all those who get:

Fatal error: Cannot instantiate non-existent class: imagesbox

 

after installing the Additional Images module by zaenal, check the following.

 

If you have Thema_Boxes installed, then the imagesboxes class must be defined in thema_boxes.php not the boxes.php:

 

Step 12: catalog/includes/classes/boxes.php <-- make this catalog/includes/classes/thema_boxes.php instead.

#######################################

 

# Add:

 

class imagesBox extends tableBox {

function imagesBox($contents) {

$info_box_contents = array();

$info_box_contents[] = array('text' => $this->imagesBoxContents($contents));

$this->table_cellpadding = '1';

$this->tableBox($info_box_contents, true);

}

function imagesBoxContents($contents) {

$this->table_cellpadding = '4';

$this->table_parameters = 'class="imagesBoxContents"';

return $this->tableBox($contents);

}

}

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...