Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Additional Images Module


Parikesit

Recommended Posts

find this file:

/admin/includes/application_top.php

find: error_reporting(E_ALL & ~E_NOTICE);

change to: error_reporting(E_ALL);

 

do you get any error when you return to that configuration page?

 

ask you host if your PHP errors are turned off on your site. if so, have them enabled. Get an error then?

 

 

Sorry for the response delay...I appreciate your help...

 

Yes, the PHP errors were turned off. I had my host turn them on for me.

I did the change to the /admin/includes/application_top.php as noted above.

 

I then opened a browser window and went to

http://www.xtremedistance.com/catalog/admi...s_configure.php

 

Now some errors do appear... Is it better for you to try the link or do you want me to type it up?

There are 2 Notices, 2 Warnings, and 1 Fatal Error.

 

Any recommendations would be great! Thanks

moestroz

Link to comment
Share on other sites

find this file:

/admin/includes/application_top.php

find: error_reporting(E_ALL & ~E_NOTICE);

change to: error_reporting(E_ALL);

 

do you get any error when you return to that configuration page?

 

ask you host if your PHP errors are turned off on your site. if so, have them enabled. Get an error then?

 

 

Sorry for the response delay...I appreciate your help...

 

Yes, the PHP errors were turned off. I had my host turn them on for me.

I did the change to the /admin/includes/application_top.php as noted above.

 

I then opened a browser window and went to

http://www.xtremedistance.com/catalog/admi...s_configure.php

 

Now some errors do appear... Is it better for you to try the link or do you want me to type it up?

There are 2 Notices, 2 Warnings, and 1 Fatal Error.

 

Any recommendations would be great! Thanks

moestroz

Link to comment
Share on other sites

Sorry for the response delay...I appreciate your help...

 

Yes, the PHP errors were turned off. I had my host turn them on for me.

I did the change to the /admin/includes/application_top.php as noted above.

 

I then opened a browser window and went to

http://www.xtremedistance.com/catalog/admi...s_configure.php

 

Now some errors do appear... Is it better for you to try the link or do you want me to type it up?

There are 2 Notices, 2 Warnings, and 1 Fatal Error.

 

Any recommendations would be great! Thanks

moestroz

 

Like a good admin, you have that page secured. So I can't see it. you can easily just highlight the errors and copy them into a post here.

Link to comment
Share on other sites

Like a good admin, you have that page secured. So I can't see it. you can easily just highlight the errors and copy them into a post here.

 

 

Ops, sorry. I really have not done anything to secure the pages.

 

Here are the error messages:

 

Notice: Constant IMAGE_CANCEL already defined in /var/www/html/catalog/admin/includes/languages/english/additional_images_configure.php on line 101

 

Notice: Constant IMAGE_BACK already defined in /var/www/html/catalog/admin/includes/languages/english/additional_images_configure.php on line 102

 

Warning: main(includes/additional_images_configure.php) [function.main]: failed to open stream: No such file or directory in /var/www/html/catalog/admin/additional_images_configure.php on line 28

 

Warning: main(includes/additional_images_configure.php) [function.main]: failed to open stream: No such file or directory in /var/www/html/catalog/admin/additional_images_configure.php on line 28

 

Fatal error: main() [function.require]: Failed opening required 'includes/additional_images_configure.php' (include_path='.:/php/includes:/usr/local/lib/php:/usr/local/php/lib/php') in /var/www/html/catalog/admin/additional_images_configure.php on line 28

 

 

 

Thanks again for your help...

 

I am considering moving my site to a host that specializes in oscommerce since I am not fully live yet... I am just customizing right now.

When I contacted my host to make the one switch you requested and asked a couple of other questions, their response was that they don't support oscommerce. But they fixed the Show errors setting anyways.

Do you have any recommendations for me?

 

moestroz

Link to comment
Share on other sites

Ops, sorry. I really have not done anything to secure the pages.

 

Here are the error messages:

 

Notice: Constant IMAGE_CANCEL already defined in /var/www/html/catalog/admin/includes/languages/english/additional_images_configure.php on line 101

 

Notice: Constant IMAGE_BACK already defined in /var/www/html/catalog/admin/includes/languages/english/additional_images_configure.php on line 102

 

Warning: main(includes/additional_images_configure.php) [function.main]: failed to open stream: No such file or directory in /var/www/html/catalog/admin/additional_images_configure.php on line 28

 

Warning: main(includes/additional_images_configure.php) [function.main]: failed to open stream: No such file or directory in /var/www/html/catalog/admin/additional_images_configure.php on line 28

 

Fatal error: main() [function.require]: Failed opening required 'includes/additional_images_configure.php' (include_path='.:/php/includes:/usr/local/lib/php:/usr/local/php/lib/php') in /var/www/html/catalog/admin/additional_images_configure.php on line 28

 

 

 

Thanks again for your help...

 

I am considering moving my site to a host that specializes in oscommerce since I am not fully live yet... I am just customizing right now.

When I contacted my host to make the one switch you requested and asked a couple of other questions, their response was that they don't support oscommerce. But they fixed the Show errors setting anyways.

Do you have any recommendations for me?

 

moestroz

looks like your biggest problem is that a file is missing. the configurer has 3 files that are all named the same.

/catalog/admin/additional_images_configure.php

/catalog/admin/includes/additional_images_configure.php

/catalog/admin/includes/languages/english/additional_images_configure.php

It's missing the middle one above.

 

then if you change back the error_reporting() the other two (unimportant) errors will go away:

/admin/includes/application_top.php

error_reporting(E_ALL & ~E_NOTICE);

 

As far as hosting goes. Definitely go with a host that supports osCommerce or you will have problems sooner or later. My personal preference would be a smaller one the keeps their MySQL server on the same server you are hosted on. Big hosts that try to centralize their MySQL servers cause your database traffic to traverse their backend network causing big delays. Among other problems, I've seen imports with easypopulate increase in time from 5-10 seconds to 20-30 minutes. The difference can be quite significant.

 

Also ask what the hosts server to site ratio is. the lower the ratio, the more they will cost. But that is your only guarantee for reliable service. the best will have 1:100 ratio. you can checkup on them with whois.sc. they show how many sites are hosted on an IP address.

 

I'm sure there are lots of good ones, but of course it wouldn't be right to express anyone specific publicly.

 

hope that helps.

Edited by surfalot
Link to comment
Share on other sites

looks like your biggest problem is that a file is missing. the configurer has 3 files that are all named the same.

/catalog/admin/additional_images_configure.php

/catalog/admin/includes/additional_images_configure.php

/catalog/admin/includes/languages/english/additional_images_configure.php

It's missing the middle one above.

 

then if you change back the error_reporting() the other two (unimportant) errors will go away:

/admin/includes/application_top.php

error_reporting(E_ALL & ~E_NOTICE);

 

As far as hosting goes. Definitely go with a host that supports osCommerce or you will have problems sooner or later. My personal preference would be a smaller one the keeps their MySQL server on the same server you are hosted on. Big hosts that try to centralize their MySQL servers cause your database traffic to traverse their backend network causing big delays. Among other problems, I've seen imports with easypopulate increase in time from 5-10 seconds to 20-30 minutes. The difference can be quite significant.

 

Also ask what the hosts server to site ratio is. the lower the ratio, the more they will cost. But that is your only guarantee for reliable service. the best will have 1:100 ratio. you can checkup on them with whois.sc. they show how many sites are hosted on an IP address.

 

I'm sure there are lots of good ones, but of course it wouldn't be right to express anyone specific publicly.

 

hope that helps.

 

 

 

 

 

I am having a very similar problem. I have tried the solution in this post, but just can't get it to work. The file clearly exists in my directory, ive made sure that the three files named the same (additional_images_configure.php) are in their proper places by deleting them and re-uploading them individually. I've also deleted all the files and started from scratch making sure they are all present and in the proper places. I'm completely out of Ideas on how to troubleshoot this... Any idaes?

 

Here are my exact errors as they are slightly different from surfalots errors:

 

Warning: main(includes/additional_images_configure.php) [function.main]: failed to open stream: No such file or directory in /home/igos/public_html/catalog/admin/additional_images_configure.php on line 28

 

Warning: main(includes/additional_images_configure.php) [function.main]: failed to open stream: No such file or directory in /home/igos/public_html/catalog/admin/additional_images_configure.php on line 28

 

Warning: main(includes/additional_images_configure.php) [function.main]: failed to open stream: No such file or directory in /home/igos/public_html/catalog/admin/additional_images_configure.php on line 28

 

Fatal error: main() [function.require]: Failed opening required 'includes/additional_images_configure.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/igos/public_html/catalog/admin/additional_images_configure.php on line 28

 

Thank you!

Link to comment
Share on other sites

Wow, I feel dumb. I was missing the exact file you said I was. Sometimes I think my text editing program is faulty because I can see the file with my ftp program but not my text editor when going to "open file". After a few hours I can see it in both and this is when it starts to work. Weird!

Link to comment
Share on other sites

Sorry to bother you again. I'm having one more problem that I just can't figure out. Everything seems to be working fine until I go to catalog/products and go into my actual product page; where I get this error:

 

 

Categories / Products

Search:

Go To:

1146 - Table 'thamigos_ecommerce2.TABLE_ADDITIONAL_IMAGES' doesn't exist

 

SELECT additional_images_id, medium_images, popup_images, thumb_images, images_description FROM TABLE_ADDITIONAL_IMAGES where products_id = '29'

 

 

 

 

I have tried to update the tables using the additional images configuration utilitiy this does not work. Should I remove all and then reinstall, or should I force configuration defaults?

 

Here is a copy of the configuration toool:

 

Additional Images Configuration Utility

Updating Configuration

 

Updating Configuration Group "Additional Images".

Checking for items...

Updating Configuration Key "ADDITIONAL_IMAGES_AUTO_CREATE".

Updating Configuration Key "ADDITIONAL_IMAGES_BACKGROUND_COLOR".

Updating Configuration Key "ADDIMAGES_PREFILL_UPLOAD_DIRECTORY".

Updating Configuration Key "ADDIMAGES_PREFILL_INITIAL".

Updating Configuration Key "ADDIMAGES_RESTRICT_IMAGE_SIZE".

Updating Configuration Key "ADDIMAGES_SHOW_ON_PRODUCT_INFO".

Updating Configuration Key "ADDIMAGES_MENU_LOCATION".

Updating Configuration Key "ADDIMAGES_GROUP_WITH_PARENT".

Updating Configuration Key "ADDIMAGES_RESTRICT_PARENT".

Updating Configuration Key "ADDIMAGES_TABLE_ALIGNMENT".

Updating Configuration Key "ADDIMAGES_TABLE_LOCATION".

Updating Configuration Key "ADDIMAGES_NUMBER_OF_COLS".

Updating Configuration Key "ADDIMAGES_NUMBER_OF_ROWS".

Updating Configuration Key "ADDIMAGES_POPUP_SHOW_ON_POPUP".

Updating Configuration Key "ADDIMAGES_POPUP_GROUP_WITH_PARENT".

Updating Configuration Key "ADDIMAGES_POPUP_RESTRICT_IMAGE_SIZE".

Updating Configuration Key "ADDIMAGES_POPUP_TABLE_ALIGNMENT".

Updating Configuration Key "ADDIMAGES_POPUP_TABLE_LOCATION".

Updating Configuration Key "ADDIMAGES_POPUP_NUMBER_OF_COLS".

Updating Configuration Key "ADDIMAGES_POPUP_NUMBER_OF_ROWS".

 

Updating Configuration Group "Images".

Checking for items...

Updating Configuration Key "DISPLAY_IMAGE_WIDTH".

Updating Configuration Key "DISPLAY_IMAGE_HEIGHT".

Updating Configuration Key "POPUP_IMAGE_WIDTH".

Updating Configuration Key "POPUP_IMAGE_HEIGHT".

 

Checking for Tables...

Table "additional_images" found, doing nothing.

 

Checking for Columns...

Column "products_image_med" found in Table "products", doing nothing.

Column "products_image_pop" found in Table "products", doing nothing.

Column "products_image_description" found in Table "products", doing nothing.

Column "thumb_images" found in Table "additional_images", doing nothing.

 

 

 

I would really appreciate any help. Thanks again!

 

PS. I'm using the most current version of additonal images version 2.0.0

Link to comment
Share on other sites

Sorry to bother you again. I'm having one more problem that I just can't figure out. Everything seems to be working fine until I go to catalog/products and go into my actual product page; where I get this error:

 

 

Categories / Products

Search:

Go To:

1146 - Table 'thamigos_ecommerce2.TABLE_ADDITIONAL_IMAGES' doesn't exist

 

SELECT additional_images_id, medium_images, popup_images, thumb_images, images_description FROM TABLE_ADDITIONAL_IMAGES where products_id = '29'

 

 

 

 

I have tried to update the tables using the additional images configuration utilitiy this does not work. Should I remove all and then reinstall, or should I force configuration defaults?

 

Here is a copy of the configuration toool:

 

Additional Images Configuration Utility

Updating Configuration

 

Updating Configuration Group "Additional Images".

Checking for items...

Updating Configuration Key "ADDITIONAL_IMAGES_AUTO_CREATE".

Updating Configuration Key "ADDITIONAL_IMAGES_BACKGROUND_COLOR".

Updating Configuration Key "ADDIMAGES_PREFILL_UPLOAD_DIRECTORY".

Updating Configuration Key "ADDIMAGES_PREFILL_INITIAL".

Updating Configuration Key "ADDIMAGES_RESTRICT_IMAGE_SIZE".

Updating Configuration Key "ADDIMAGES_SHOW_ON_PRODUCT_INFO".

Updating Configuration Key "ADDIMAGES_MENU_LOCATION".

Updating Configuration Key "ADDIMAGES_GROUP_WITH_PARENT".

Updating Configuration Key "ADDIMAGES_RESTRICT_PARENT".

Updating Configuration Key "ADDIMAGES_TABLE_ALIGNMENT".

Updating Configuration Key "ADDIMAGES_TABLE_LOCATION".

Updating Configuration Key "ADDIMAGES_NUMBER_OF_COLS".

Updating Configuration Key "ADDIMAGES_NUMBER_OF_ROWS".

Updating Configuration Key "ADDIMAGES_POPUP_SHOW_ON_POPUP".

Updating Configuration Key "ADDIMAGES_POPUP_GROUP_WITH_PARENT".

Updating Configuration Key "ADDIMAGES_POPUP_RESTRICT_IMAGE_SIZE".

Updating Configuration Key "ADDIMAGES_POPUP_TABLE_ALIGNMENT".

Updating Configuration Key "ADDIMAGES_POPUP_TABLE_LOCATION".

Updating Configuration Key "ADDIMAGES_POPUP_NUMBER_OF_COLS".

Updating Configuration Key "ADDIMAGES_POPUP_NUMBER_OF_ROWS".

 

Updating Configuration Group "Images".

Checking for items...

Updating Configuration Key "DISPLAY_IMAGE_WIDTH".

Updating Configuration Key "DISPLAY_IMAGE_HEIGHT".

Updating Configuration Key "POPUP_IMAGE_WIDTH".

Updating Configuration Key "POPUP_IMAGE_HEIGHT".

 

Checking for Tables...

Table "additional_images" found, doing nothing.

 

Checking for Columns...

Column "products_image_med" found in Table "products", doing nothing.

Column "products_image_pop" found in Table "products", doing nothing.

Column "products_image_description" found in Table "products", doing nothing.

Column "thumb_images" found in Table "additional_images", doing nothing.

 

 

 

I would really appreciate any help. Thanks again!

 

PS. I'm using the most current version of additonal images version 2.0.0

 

you missed adding this to your includes/database_tables.php:

 

  // BOF: Additional Images
 define('TABLE_ADDITIONAL_IMAGES', 'additional_images'); //additional Images
 // EOF: Additional Images

Link to comment
Share on other sites

Excellent contrib, thanks,

v2.0.0

I'have no error in local, all work,

but in live the thumbnail it doesn't work ,

I've no error message but in admin I can read "the image doesn't exist" with an message like "/temp/phpcvI4I"

the popup image and the product info image is ok.

 

I have GD 2.0 on the serveur.

 

thanks for your help, an idea?

david

Link to comment
Share on other sites

Excellent contrib, thanks,

v2.0.0

I'have no error in local, all work,

but in live the thumbnail it doesn't work ,

I've no error message but in admin I can read "the image doesn't exist" with an message like "/temp/phpcvI4I"

the popup image and the product info image is ok.

 

I have GD 2.0 on the serveur.

 

thanks for your help, an idea?

david

so only the admin is having trouble showing images? my guess would be your catalog images setting in the admin/includes/configure.php isn't right.

 

if you have FireFox browser installed, you can still right-click where the image should be and Copy Image Location. Then paste the location into notepad. you can then examine what location/path is being calculated for the image and make adjustments to your configure file.

Link to comment
Share on other sites

thank for your reply

The path is good in configure and I ve the seem trouble in the catalog

the store is in the root (not a catalog/ directory) the path is http://www.xxxxxxxx.com/images/products/de...rrakech_big.jpg for example

http://www.xxxxxxxx.com/images/products/de...e-Iris_bigm.jpg

the popup image and the product info image is upload in the right directory, but enought thumbnail image is not created.

if i had a mistake in configure file i will have no xxxxm.jpg file.

 

do you have an idea.

Link to comment
Share on other sites

now i have an error like

Failed to create directory: /home/WwwBSD/xxxxxxxxx.com/images/products/cuisine/.

Error returned from alterimage class: 1

Products Info file: .Le fichier info de ce produit: /home/WwwBSD/xxxxxxxx.com/images/products/cuisine/Billotm.jpg could not be created.

 

problem with the folder permissions?

Link to comment
Share on other sites

I have the same error with david. The thumbnail is not created (###s.jpg) when I right click and view its location, it shows "images//tmp/dphv" or something like that. The medium image and big image is create quite well.

 

Any solution ?

Link to comment
Share on other sites

I have the same error with david. The thumbnail is not created (###s.jpg) when I right click and view its location, it shows "images//tmp/dphv" or something like that. The medium image and big image is create quite well.

 

Any solution ?

you and dave427 need to make sure you directory permissions are 777 for the images directory and the products directory under that.

Link to comment
Share on other sites

looks like your biggest problem is that a file is missing. the configurer has 3 files that are all named the same.

/catalog/admin/additional_images_configure.php

/catalog/admin/includes/additional_images_configure.php

/catalog/admin/includes/languages/english/additional_images_configure.php

It's missing the middle one above.

 

then if you change back the error_reporting() the other two (unimportant) errors will go away:

/admin/includes/application_top.php

error_reporting(E_ALL & ~E_NOTICE);

 

As far as hosting goes. Definitely go with a host that supports osCommerce or you will have problems sooner or later. My personal preference would be a smaller one the keeps their MySQL server on the same server you are hosted on. Big hosts that try to centralize their MySQL servers cause your database traffic to traverse their backend network causing big delays. Among other problems, I've seen imports with easypopulate increase in time from 5-10 seconds to 20-30 minutes. The difference can be quite significant.

 

Also ask what the hosts server to site ratio is. the lower the ratio, the more they will cost. But that is your only guarantee for reliable service. the best will have 1:100 ratio. you can checkup on them with whois.sc. they show how many sites are hosted on an IP address.

 

I'm sure there are lots of good ones, but of course it wouldn't be right to express anyone specific publicly.

 

hope that helps.

 

Todd (surfalot),

 

Thanks for your help and contribution. I did get it installed a couple of days ago...I now have to work with some more images to make sure it plays nice. Thanks again!

 

Moestroz

Link to comment
Share on other sites

Hi, I'm having a problem and am getting this error:

 

Fatal error: Cannot redeclare tep_show_category () (previously declared in ***/includes/categories.php: 13) in ***/includes/boxes/categories.php on LINE 64

 

Dont know what seems to be wrong with categories.php

But here is the code for it...

 

<?php
/*
 $Id: categories.php,v 1.25 2003/07/09 01:13:58 hpdl Exp $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/  

function tep_show_category($counter) {
global $tree, $categories_string, $cPath_array;

$categories_string .= '<tr><td height="20" class="categor">';

$otstup = 0;
for ($i=0; $i<$tree[$counter]['level']; $i++) {
  $categories_string .= tep_draw_separator('pixel_trans.gif', '10', '1');
  $otstup = 1;
}
if ($otstup){		$categories_string .= tep_draw_separator('pixel_trans.gif', '10', '1') . '<a class="categor" href="';	
} else {
$categories_string .= tep_image(DIR_WS_IMAGES . 'marker100.jpg','','3','5','style="margin:0 8px 0 14px"') . '<a class="categor" href="';
}

if ($tree[$counter]['parent'] == 0) {
  $cPath_new = 'cPath=' . $counter;
} else {
  $cPath_new = 'cPath=' . $tree[$counter]['path'];
}

$categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">';

if (isset($cPath_array) && in_array($counter, $cPath_array)) {
  $categories_string .= '<b>';
}

// display category name
$categories_string .= $tree[$counter]['name'];

if (isset($cPath_array) && in_array($counter, $cPath_array)) {
  $categories_string .= '</b>';
}

if (tep_has_category_subcategories($counter)) {
  $categories_string .= '->';
}

$categories_string .= '</a>';

if (SHOW_COUNTS == 'true') {
  $products_in_category = tep_count_products_in_category($counter);
  if ($products_in_category > 0) {
	$categories_string .= ' (' . $products_in_category . ')';
  }
}

$categories_string .= '</td></tr>';

$categories_string .= '<tr><td height="2" valign="top">' . tep_image(DIR_WS_IMAGES . 'LineCategot.jpg','','','','style="margin-left:10px"') . '</td></tr>';

if ($tree[$counter]['next_id'] != false) {tep_show_category($tree[$counter]['next_id']);
}
 }
?>
<!-- categories //-->

<?php
 //$info_box_contents = array();
 //$info_box_contents[] = array('text' => BOX_HEADING_CATEGORIES);

 //new infoBoxHeading($info_box_contents, true, false);

 $categories_string = '';
 $tree = array();

 $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
 while ($categories = tep_db_fetch_array($categories_query))  {
$tree[$categories['categories_id']] = array('name' => $categories['categories_name'],
											'parent' => $categories['parent_id'],
											'level' => 0,
											'path' => $categories['categories_id'],
											'next_id' => false);

if (isset($parent_id)) {
  $tree[$parent_id]['next_id'] = $categories['categories_id'];
}

$parent_id = $categories['categories_id'];

if (!isset($first_element)) {
  $first_element = $categories['categories_id'];
}
 }

 //------------------------
 if (tep_not_null($cPath)) {
$new_path = '';
reset($cPath_array);
while (list($key, $value) = each($cPath_array)) {
  unset($parent_id);
  unset($first_id);
  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$value . "' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
  if (tep_db_num_rows($categories_query)) {
	$new_path .= $value;
	while ($row = tep_db_fetch_array($categories_query)) {
	  $tree[$row['categories_id']] = array('name' => $row['categories_name'],
										   'parent' => $row['parent_id'],
										   'level' => $key+1,
										   'path' => $new_path . '_' . $row['categories_id'],
										   'next_id' => false);

	  if (isset($parent_id)) {
		$tree[$parent_id]['next_id'] = $row['categories_id'];
	  }

	  $parent_id = $row['categories_id'];

	  if (!isset($first_id)) {
		$first_id = $row['categories_id'];
	  }

	  $last_id = $row['categories_id'];
	}
	$tree[$last_id]['next_id'] = $tree[$value]['next_id'];
	$tree[$value]['next_id'] = $first_id;
	$new_path .= '_';
  } else {
	break;
  }
}
 }
 tep_show_category($first_element); 

 $info_box_contents = array();
 $info_box_contents[] = array('text' => $categories_string);
 $info_box_contents[] = array('align' => 'right',
						   'text'  => '<font size=-2><a  class="categorTop2" href="' . tep_href_link(FILENAME_ALLPRODS, '', 'NONSSL') . '">' .tep_image(DIR_WS_IMAGES . 'pixel_trans.gif','','3','5','style="margin:10px 8px 0 14px"') .  BOX_INFORMATION_ALLPRODS . '</a></font>');
 new infoBox($info_box_contents);
?>

<!-- categories_eof //-->

Link to comment
Share on other sites

Hi, I'm having a problem and am getting this error:

 

Fatal error: Cannot redeclare tep_show_category () (previously declared in ***/includes/categories.php: 13) in ***/includes/boxes/categories.php on LINE 64

 

I sure wish I knew where this was coming from. This contribution doesn't do anything with those files or the tep_show_category() function. You will have to make the tep_show_category() function conditional as such:

 

 

if (!function_exists(tep_show_category)) {

function tep_show_category($counter) {
global $tree, $categories_string, $cPath_array;

   $categories_string .= '<tr><td height="20" class="categor">';

   $otstup = 0;
   for ($i=0; $i<$tree[$counter]['level']; $i++) {
     $categories_string .= tep_draw_separator('pixel_trans.gif', '10', '1');
     $otstup = 1;
   }
   if ($otstup){        $categories_string .= tep_draw_separator('pixel_trans.gif', '10', '1') . '<a class="categor" href="';    
   } else {
$categories_string .= tep_image(DIR_WS_IMAGES . 'marker100.jpg','','3','5','style="margin:0 8px 0 14px"') . '<a class="categor" href="';
}

   if ($tree[$counter]['parent'] == 0) {
     $cPath_new = 'cPath=' . $counter;
   } else {
     $cPath_new = 'cPath=' . $tree[$counter]['path'];
   }

   $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">';

   if (isset($cPath_array) && in_array($counter, $cPath_array)) {
     $categories_string .= '<b>';
   }

// display category name
   $categories_string .= $tree[$counter]['name'];

   if (isset($cPath_array) && in_array($counter, $cPath_array)) {
     $categories_string .= '</b>';
   }

   if (tep_has_category_subcategories($counter)) {
     $categories_string .= '->';
   }

   $categories_string .= '</a>';

   if (SHOW_COUNTS == 'true') {
     $products_in_category = tep_count_products_in_category($counter);
     if ($products_in_category > 0) {
       $categories_string .= ' (' . $products_in_category . ')';
     }
   }

   $categories_string .= '</td></tr>';

   $categories_string .= '<tr><td height="2" valign="top">' . tep_image(DIR_WS_IMAGES . 'LineCategot.jpg','','','','style="margin-left:10px"') . '</td></tr>';

   if ($tree[$counter]['next_id'] != false) {tep_show_category($tree[$counter]['next_id']);
   }
 }

}

Link to comment
Share on other sites

Ive just tried to update this contribution on my site from an older version but Im having trouble on the categories page in the admin. Everything was working great before the upgrade. I tried to use beyond compare to get it all merged corectly.

 

I recieve the following error:-

Parse error: syntax error, unexpected T_CASE in /var/www/vhosts/workplace-essentials.co.uk/httpdocs/idadmin/categories.php on line 512

 

The case in question on that line is:-

case 'add_images':

 

Heres a link to my admin categories.php code as its too long to post here (categories.zip), Im pretty sure its a problem between this contribution code and my HTML_AREA_WYSIWYG code.

 

Any help would be much appreciated.

Link to comment
Share on other sites

Ive just tried to update this contribution on my site from an older version but Im having trouble on the categories page in the admin. Everything was working great before the upgrade. I tried to use beyond compare to get it all merged corectly.

 

I recieve the following error:-

 

 

The case in question on that line is:-

case 'add_images':

 

Heres a link to my admin categories.php code as its too long to post here (categories.zip), Im pretty sure its a problem between this contribution code and my HTML_AREA_WYSIWYG code.

 

Any help would be much appreciated.

your inserted code is in the wrong place.

 

      case 'new_product_preview':
     if (HTML_AREA_WYSIWYG_DISABLE == 'Disable') {
// copy image only if modified
       // BOF: Additional Images
/*
       $products_image = new upload('products_image');
       $products_image->set_destination(DIR_FS_CATALOG_IMAGES);
       if ($products_image->parse() && $products_image->save()) {
         $products_image_name = $products_image->filename;
       } else {
         $products_image_name = (isset($HTTP_POST_VARS['products_previous_image']) ? $HTTP_POST_VARS['products_previous_image'] : '');
       }
*/
       $image_subdirectory = (!empty($_POST['image_subdirectory'])?tep_db_prepare_input($_POST['image_subdirectory']):'');
       $sql_data_array = array();       
       $add_images_error = process_uploads($image_subdirectory,'products_image','products_image_med','products_image_pop',$sql_data_array,$messageStack);
       $products_image_name = (!empty($sql_data_array['products_image'])?$sql_data_array['products_image']:(isset($HTTP_POST_VARS['products_previous_image'])?$HTTP_POST_VARS['products_previous_image']:''));
       $products_image_med_name = (!empty($sql_data_array['products_image_med'])?$sql_data_array['products_image_med']:(isset($HTTP_POST_VARS['products_previous_image_med'])?$HTTP_POST_VARS['products_previous_image_med']:''));
       $products_image_pop_name = (!empty($sql_data_array['products_image_pop'])?$sql_data_array['products_image_pop']:(isset($HTTP_POST_VARS['products_previous_image_pop'])?$HTTP_POST_VARS['products_previous_image_pop']:''));
       // EOF: Additional Images   
   } /* ***moved end if brace up here*** */
       break;
     // BOF: Additional Images
     case 'add_images':
       $image_subdirectory = (!empty($_POST['image_subdirectory'])?tep_db_prepare_input($_POST['image_subdirectory']):'');
       $products_id = $HTTP_GET_VARS['pID'];
         $sql_data_array = array('products_id' => tep_db_prepare_input($products_id),
                                 'images_description' => tep_db_prepare_input($HTTP_POST_VARS['images_description']));

         $add_images_error = process_uploads($image_subdirectory,'thumb_images','medium_images','popup_images',$sql_data_array,$messageStack);

       if ($add_images_error == false) {
         tep_db_perform(TABLE_ADDITIONAL_IMAGES, $sql_data_array);
       } else {
         $messageStack->add_session(ERROR_ADDITIONAL_IMAGE_IS_EMPTY, 'error');
       }
       tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products_id));
       break;

     case 'del_images':
       $products_id = tep_db_prepare_input($HTTP_GET_VARS['pID']);
       if ( ($HTTP_GET_VARS['pID']) && (is_array($HTTP_POST_VARS['additional_images_id'])) ) {                      
         $additional_images_id = tep_db_prepare_input($HTTP_POST_VARS['additional_images_id']);
         for ($i=0; $i
           // get image names to delete
           $delimg_query = tep_db_query("select popup_images, medium_images, thumb_images from " . TABLE_ADDITIONAL_IMAGES . " where additional_images_id = '" . tep_db_input($additional_images_id[$i]) . "'");
           $delimg = tep_db_fetch_array($delimg_query);
           // remove image record from database
           tep_db_query("delete from " . TABLE_ADDITIONAL_IMAGES . " where additional_images_id = '" . tep_db_input($additional_images_id[$i]) . "'");
           //SECTION DELETE POPUP IMAGES
           if (tep_not_null($delimg['popup_images']) && file_exists(DIR_FS_CATALOG_IMAGES.$delimg['popup_images']) )
             if ( !tep_is_image_still_used($delimg['popup_images']) )
               if (!unlink (DIR_FS_CATALOG_IMAGES.$delimg['popup_images']))
                 $messageStack->add_session(ERROR_DEL_IMG_XTRA.$delimg['popup_images'], 'error');
               else
                 $messageStack->add_session(SUCCESS_DEL_IMG_XTRA.$delimg['popup_images'], 'success');
           if (tep_not_null($delimg['medium_images']) && file_exists(DIR_FS_CATALOG_IMAGES.$delimg['medium_images']) )
             if ( !tep_is_image_still_used($delimg['medium_images']) )
               if (!unlink (DIR_FS_CATALOG_IMAGES.$delimg['medium_images']))
                  $messageStack->add_session(ERROR_DEL_IMG_XTRA.$delimg['medium_images'], 'error');
               else
                  $messageStack->add_session(SUCCESS_DEL_IMG_XTRA.$delimg['medium_images'], 'success');

           if (tep_not_null($delimg['thumb_images']) && file_exists(DIR_FS_CATALOG_IMAGES.$delimg['thumb_images']) )
             if ( !tep_is_image_still_used($delimg['thumb_images']) )
               if (!unlink (DIR_FS_CATALOG_IMAGES.$delimg['thumb_images']))
                  $messageStack->add_session(ERROR_DEL_IMG_XTRA.$delimg['thumb_images'], 'error');
               else
                  $messageStack->add_session(SUCCESS_DEL_IMG_XTRA.$delimg['thumb_images'], 'success');
           //END OF SECTION DELETE POPUP IMAGES
         }
       }
       tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products_id));
       break;
     // EOF: Additional Images
 }/* ***only 1 end brace here (this is for the switch tag)*** */

Link to comment
Share on other sites

I have just installed this contribution, but I am meeting a lot errors.

 

At the Configuration Utility, I am meeting these errors:

 

Checking Configuration Status

 

Your database requires updates.

 

Configuration Group "Additional Images" does not exist.

 

Configuration Group "Images" exists.

Checking for items...

Configuration Key "DISPLAY_IMAGE_WIDTH" does not exist.

Configuration Key "DISPLAY_IMAGE_HEIGHT" does not exist.

Configuration Key "POPUP_IMAGE_WIDTH" does not exist.

Configuration Key "POPUP_IMAGE_HEIGHT" does not exist.

 

Checking for Tables...

Table "additional_images" found.

 

Checking for Columns...

Column "products_image_med" not found in Table "products".

Column "products_image_pop" not found in Table "products".

Column "products_image_description" not found in Table "products".

Column "thumb_images" not found in Table "additional_images".

 

 

 

I would be very glad if someone could help me solving these problems!

 

Best regards

Andrea

Link to comment
Share on other sites

Thanks for the reply Surfalot,

 

Theres a problem with that code you gave me as Im now getting a new error:-

Parse error: syntax error, unexpected T_VARIABLE, expecting ';' in /var/www/vhosts/workplace-essentials.co.uk/httpdocs/idadmin/categories.php on line 535

 

Line 535 is:-

      case 'new_product_preview':
     if (HTML_AREA_WYSIWYG_DISABLE == 'Disable') {
// copy image only if modified
       // BOF: Additional Images
/*
       $products_image = new upload('products_image');
       $products_image->set_destination(DIR_FS_CATALOG_IMAGES);
       if ($products_image->parse() && $products_image->save()) {
         $products_image_name = $products_image->filename;
       } else {
         $products_image_name = (isset($HTTP_POST_VARS['products_previous_image']) ? $HTTP_POST_VARS['products_previous_image'] : '');
       }
*/
       $image_subdirectory = (!empty($_POST['image_subdirectory'])?tep_db_prepare_input($_POST['image_subdirectory']):'');
       $sql_data_array = array();       
       $add_images_error = process_uploads($image_subdirectory,'products_image','products_image_med','products_image_pop',$sql_data_array,$messageStack);
       $products_image_name = (!empty($sql_data_array['products_image'])?$sql_data_array['products_image']:(isset($HTTP_POST_VARS['products_previous_image'])?$HTTP_POST_VARS['products_previous_image']:''));
       $products_image_med_name = (!empty($sql_data_array['products_image_med'])?$sql_data_array['products_image_med']:(isset($HTTP_POST_VARS['products_previous_image_med'])?$HTTP_POST_VARS['products_previous_image_med']:''));
       $products_image_pop_name = (!empty($sql_data_array['products_image_pop'])?$sql_data_array['products_image_pop']:(isset($HTTP_POST_VARS['products_previous_image_pop'])?$HTTP_POST_VARS['products_previous_image_pop']:''));
       // EOF: Additional Images   
   } /* ***moved end if brace up here*** */
       break;
     // BOF: Additional Images
     case 'add_images':
       $image_subdirectory = (!empty($_POST['image_subdirectory'])?tep_db_prepare_input($_POST['image_subdirectory']):'');
       $products_id = $HTTP_GET_VARS['pID'];
         $sql_data_array = array('products_id' => tep_db_prepare_input($products_id),
                                 'images_description' => tep_db_prepare_input($HTTP_POST_VARS['images_description']));

         $add_images_error = process_uploads($image_subdirectory,'thumb_images','medium_images','popup_images',$sql_data_array,$messageStack);

       if ($add_images_error == false) {
         tep_db_perform(TABLE_ADDITIONAL_IMAGES, $sql_data_array);
       } else {
         $messageStack->add_session(ERROR_ADDITIONAL_IMAGE_IS_EMPTY, 'error');
       }
       tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products_id));
       break;

     case 'del_images':
       $products_id = tep_db_prepare_input($HTTP_GET_VARS['pID']);
       if ( ($HTTP_GET_VARS['pID']) && (is_array($HTTP_POST_VARS['additional_images_id'])) ) {                      
         $additional_images_id = tep_db_prepare_input($HTTP_POST_VARS['additional_images_id']);
         for ($i=0; $i
           // get image names to delete
           $delimg_query = tep_db_query("select popup_images, medium_images, thumb_images from " . TABLE_ADDITIONAL_IMAGES . " where additional_images_id = '" . tep_db_input($additional_images_id[$i]) . "'");
           $delimg = tep_db_fetch_array($delimg_query);
           // remove image record from database
           tep_db_query("delete from " . TABLE_ADDITIONAL_IMAGES . " where additional_images_id = '" . tep_db_input($additional_images_id[$i]) . "'");
           //SECTION DELETE POPUP IMAGES
           if (tep_not_null($delimg['popup_images']) && file_exists(DIR_FS_CATALOG_IMAGES.$delimg['popup_images']) )
             if ( !tep_is_image_still_used($delimg['popup_images']) )
               if (!unlink (DIR_FS_CATALOG_IMAGES.$delimg['popup_images']))
                 $messageStack->add_session(ERROR_DEL_IMG_XTRA.$delimg['popup_images'], 'error');
               else
                 $messageStack->add_session(SUCCESS_DEL_IMG_XTRA.$delimg['popup_images'], 'success');
           if (tep_not_null($delimg['medium_images']) && file_exists(DIR_FS_CATALOG_IMAGES.$delimg['medium_images']) )
             if ( !tep_is_image_still_used($delimg['medium_images']) )
               if (!unlink (DIR_FS_CATALOG_IMAGES.$delimg['medium_images']))
                  $messageStack->add_session(ERROR_DEL_IMG_XTRA.$delimg['medium_images'], 'error');
               else
                  $messageStack->add_session(SUCCESS_DEL_IMG_XTRA.$delimg['medium_images'], 'success');

           if (tep_not_null($delimg['thumb_images']) && file_exists(DIR_FS_CATALOG_IMAGES.$delimg['thumb_images']) )
             if ( !tep_is_image_still_used($delimg['thumb_images']) )
               if (!unlink (DIR_FS_CATALOG_IMAGES.$delimg['thumb_images']))
                  $messageStack->add_session(ERROR_DEL_IMG_XTRA.$delimg['thumb_images'], 'error');
               else
                  $messageStack->add_session(SUCCESS_DEL_IMG_XTRA.$delimg['thumb_images'], 'success');
           //END OF SECTION DELETE POPUP IMAGES
         }
       }
       tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products_id));
       break;
     // EOF: Additional Images
 }/* ***only 1 end brace here (this is for the switch tag)*** */

Edited by Rochdalemark
Link to comment
Share on other sites

Thanks for the reply Surfalot,

 

Theres a problem with that code you gave me as Im now getting a new error:-

 

 

Line 535 is:-

$delimg_query = tep_db_query("select popup_images, medium_images, thumb_images from " . TABLE_ADDITIONAL_IMAGES . " where additional_images_id = '" . tep_db_input($additional_images_id[$i]) . "'");

 

The lines before that are:-

case 'del_images':
$products_id = tep_db_prepare_input($HTTP_GET_VARS['pID']);
if ( ($HTTP_GET_VARS['pID']) && (is_array($HTTP_POST_VARS['additional_images_id'])) ) {
$additional_images_id = tep_db_prepare_input($HTTP_POST_VARS['additional_images_id']);
for ($i=0; $i
// get image names to delete

 

So I altered that code to read:-

case 'del_images':
$products_id = tep_db_prepare_input($HTTP_GET_VARS['pID']);
if ( ($HTTP_GET_VARS['pID']) && (is_array($HTTP_POST_VARS['additional_images_id'])) ) {
$additional_images_id = tep_db_prepare_input($HTTP_POST_VARS['additional_images_id']);
for ($i=0; $i;)

 

Seems to have done the trick but not sure if it was the right thing to do.

 

Can get into categories in my admin now but if I try to delete an additional image I get the following error:-

 

 

Is that due to the case 'del_images': code in categories?

 

Cheers :thumbsup:

your quick fix for the "for" statement is not correct. go back to the contribution and get the correct line there. looks like the codebox for the forum mangled it. find "case 'del_images':" and drop down 4 lines.

Link to comment
Share on other sites

I have just installed this contribution, but I am meeting a lot errors.

 

At the Configuration Utility, I am meeting these errors:

 

Checking Configuration Status

 

Your database requires updates.

 

Configuration Group "Additional Images" does not exist.

 

Configuration Group "Images" exists.

Checking for items...

Configuration Key "DISPLAY_IMAGE_WIDTH" does not exist.

Configuration Key "DISPLAY_IMAGE_HEIGHT" does not exist.

Configuration Key "POPUP_IMAGE_WIDTH" does not exist.

Configuration Key "POPUP_IMAGE_HEIGHT" does not exist.

 

Checking for Tables...

Table "additional_images" found.

 

Checking for Columns...

Column "products_image_med" not found in Table "products".

Column "products_image_pop" not found in Table "products".

Column "products_image_description" not found in Table "products".

Column "thumb_images" not found in Table "additional_images".

 

 

 

I would be very glad if someone could help me solving these problems!

 

Best regards

Andrea

 

did you run the configuration utility to setup those database objects? (right side of the config util)

Link to comment
Share on other sites

Hi Surfalot,

 

Ok I rechecked the origional contib code and changed the line I altered from:-

 

 for ($i=0; $i;)

 

To

 

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

 

Went into admin and now recieve a new error:-

 

Parse error: syntax error, unexpected $end in /var/www/workplace-essentials.co.uk/httpdocs/admin/categories.php on line 1784

 

1784 is my last line of code with my

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

code

 

I've saved the file and uploaded it to the same place as before..

 

Cheers

 

 

your quick fix for the "for" statement is not correct. go back to the contribution and get the correct line there. looks like the codebox for the forum mangled it. find "case 'del_images':" and drop down 4 lines.
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...