Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Additional Images Module


Parikesit

Recommended Posts

Hmm, should just display the value or not.

what you need to do it to set this constant to the actual value in your includes/configure.php

 

define('DIR_FS_CATALOG', dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/');

 

it will look something like this (if you are on a cPanel server, if not, a little different):

 

define('DIR_FS_CATALOG', '/home/myaccount/public_html/catalog/');

 

you should talk to your host and ask them what the path to your web docs is. then add /catalog/ to the end since your shop is in the catalog subdirectory of your web docs root.

 

I contacted the host and got the path to our web docs. I altered the define('DIR_FS_CATALOG'..." tag to match (it is currently displayed in the popup) but it did not work, i even tried adding the drive letter, but the pop ups still don't change size. Thanks for all your help so far surfalot. Any more ideas?

Link to comment
Share on other sites

I contacted the host and got the path to our web docs. I altered the define('DIR_FS_CATALOG'..." tag to match (it is currently displayed in the popup) but it did not work, i even tried adding the drive letter, but the pop ups still don't change size. Thanks for all your help so far surfalot. Any more ideas?

OK, now what do you have for those:

Find these two settings in your includes/configure.php file

DIR_FS_CATALOG

DIR_WS_IMAGES

post what they are in your file. if DIR_FS_CATALOG uses any other constants on its line, post those also.

Link to comment
Share on other sites

Hi,

if have installed everything and I got the following messages if I want to make a new article:

 

Fatal error: Call to undefined function tep_catname_to_dir() in /var/www/virtual/vinyl-artists.de/fingerboardstore_de/htdocs/catalog/admin/categories.php on line 743

 

Here is the code from categories.php: (line 731 - 753)

 

<td class="main"><table border="0" cellpadding="0" cellspacing="0" width="560"><tr><td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15'); ?></td><td class="main"><?php

		 if (ADDITIONAL_IMAGES_AUTO_CREATE == 'true') {
		   echo TEXT_NEW_IMAGES_AUTO_ON_STATEMENT;
		 } else {
		   echo '<table border="0" cellpadding="0" cellspacing="0"><tr><td class="main" valign="top">' . tep_draw_input_field('manual_thumb_generation', 'on', /* parameters */ 'onclick="if(this.checked==true){this.form.products_image_med.disabled=true;this.form.products_image_pop.dis
abled=true;}else{this.form.products_image_med.disabled=false;this.form.products_i
mage_pop.disabled=false;}"', false, 'checkbox') . '</td><td class="main" valign="top">' . TEXT_NEW_IMAGES_MANUALLY_GENERATE . '</td><td class="main"> </td><td class="main" valign="top">' . TEXT_NEW_IMAGES_AUTO_OFF_STATEMENT . '</td></tr></table>';
		 }

		 $upload_path = '';
		 if (ADDIMAGES_PREFILL_UPLOAD_DIRECTORY == 'true') {
		   $category_path_pieces = explode(' > ',tep_output_generated_category_path($current_category_id));
		   foreach ($category_path_pieces as $tkey => $piece) {
			 $category_path_pieces[$tkey] = tep_catname_to_dir($piece);
		   }
		   $upload_path = implode('/',$category_path_pieces);
		 }
		 $tmp = ADDIMAGES_PREFILL_INITIAL;
		 if (!empty($tmp)) {
		   if (!empty($upload_path)) { $upload_path = trim($tmp,'/').'/'.$upload_path; }
		   else { $upload_path = $tmp; }
		 }

		 ?></td></tr></table></td>

 

Can you help me please?

Thanks :) (and sorry for my bad english -.-)

you missed (or mangled) the additions to /catalog/admin/includes/functions/general.php

the missing function was suppose to be added to that file.

Link to comment
Share on other sites

hi surfalot, i did restore the original file and try again and now I no longer get the "1064 - You have an error in your SQL syntax" error.

 

However, I still have the problems I listed earlier:

 

When I click 'Catalog' in the Admin section I get this error:

 

Parse error: syntax error, unexpected T_CASE in /home/discoun/public_html/admin/categories.php on line 373

 

 

and when I click on a product to view info about it at the catalog end of my store, I get this error:

 

Parse error: syntax error, unexpected $end in /home/discoun/public_html/product_info.php on line 486

 

How could I solve these two problems?

 

sorry, those errors don't tell me anything. look closer at the merge you are doing.

Link to comment
Share on other sites

OK, now what do you have for those:

Find these two settings in your includes/configure.php file

DIR_FS_CATALOG

DIR_WS_IMAGES

post what they are in your file. if DIR_FS_CATALOG uses any other constants on its line, post those also.

 

They now are "echo();"ed in the pop up as

 

DIR_FS_CATALOG = /home/thegemsh/thegemshop.com/catalog

 

DIR_WS_IMAGES = images/

 

should DIR_WS_IMAGES be /home/thegemsh/thegemshop.com/catalog/images ?

Link to comment
Share on other sites

just for the record, there shouldn't be any difficulties using this contribution and RC1. It's nice that acingo64 did that, but only helps with the "visualizations" of the file merges. ALL code changes are clearly marked in the merge files and should not be confused with the RC1 changes.

 

So your saying that the Regular 2.0.0 works fine with osC RC1? I am about to install this contrib, and since neither you or the person who made the update for osC RC1 has any detail instructions on where to make the changes in the files, I need to create a write-up of the changes so that I can properly incorporate it in with the STS module which I have installed.

Powered By osC 2.2RC2a STS 4.5.8 - HTC 2.6.3 - FP 1.5.9 - BCH 1.0.0

Link to comment
Share on other sites

They now are "echo();"ed in the pop up as

 

DIR_FS_CATALOG = /home/thegemsh/thegemshop.com/catalog

 

DIR_WS_IMAGES = images/

 

should DIR_WS_IMAGES be /home/thegemsh/thegemshop.com/catalog/images ?

you mensioned you "even tried the drive letter", is this hosted on windows?

 

change DIR_FS_CATALOG to:

 

define('DIR_FS_CATALOG', '/home/thegemsh/thegemshop.com/catalog/');

 

if it still doesn't work, put the following code in your pop file in place of the other test code. let me know what it displays. It should show you the complete path to your image. If that complete path is correct, we'll have to look in another direction.

 

<?php if (file_exists(DIR_FS_CATALOG . DIR_WS_IMAGES . $selected_image['products_image_pop'])) { echo DIR_FS_CATALOG . DIR_WS_IMAGES . $selected_image['products_image_pop'] . ' exists';} else {DIR_FS_CATALOG . DIR_WS_IMAGES . $selected_image['products_image_pop'] . ' does not exist';} ?>

Link to comment
Share on other sites

So your saying that the Regular 2.0.0 works fine with osC RC1? I am about to install this contrib, and since neither you or the person who made the update for osC RC1 has any detail instructions on where to make the changes in the files, I need to create a write-up of the changes so that I can properly incorporate it in with the STS module which I have installed.

In my humble opinion, complete write-ups of changes aren't worth much. If the write says to look for code that was changed due to a previously installed contribution, anyone following the directions is stuck since its not searchable any longer. Whereas, anyone using the recommended file compare software such as WinDiff or Beyond Compare, will still know about where the code goes, even if the file has been heavily modified already.

 

ALL changes to files are clearly marked in all of my contributions. if you have to install it without a file compare tool, simple searches for "// BOF: Additional Images" work just as well as a set of instruction.

 

And don't get me started on the perceived time-saving benefits of using STS. :'(

Link to comment
Share on other sites

In my humble opinion, complete write-ups of changes aren't worth much. If the write says to look for code that was changed due to a previously installed contribution, anyone following the directions is stuck since its not searchable any longer. Whereas, anyone using the recommended file compare software such as WinDiff or Beyond Compare, will still know about where the code goes, even if the file has been heavily modified already.

 

ALL changes to files are clearly marked in all of my contributions. if you have to install it without a file compare tool, simple searches for "// BOF: Additional Images" work just as well as a set of instruction.

 

And don't get me started on the perceived time-saving benefits of using STS. :'(

 

But would you say that Additional Images 2.0.0 works out of the box with osC RC1? And STS is a template contribution, does not have any time saving benefits really.

 

The write up is for my own use, as I like have written documentation of what changes have been made call me OCD if you want. Just a matter of preference, I have used the comapre method before back when I was using phpbb, nuke-evo and other software, I find that even though it may take longer, but it is easier for me to make the changes.

Powered By osC 2.2RC2a STS 4.5.8 - HTC 2.6.3 - FP 1.5.9 - BCH 1.0.0

Link to comment
Share on other sites

But would you say that Additional Images 2.0.0 works out of the box with osC RC1?

sorry, can't say that for sure. I haven't install RC1. What I can say is that acinfo64's contribution doesn't change any of the AI code, its just an update of the surrounding osC code.

Link to comment
Share on other sites

Hello, there is a small bug that prevents additional images 2.0 working with safe search engine urls:

 

includes/classes/displayimages.php

 

121: document.write(\'<a href="' . (!$this->onpagemenu ? 'java script:popupWindow(\\\'' : '') . tep_href_link( $this->linkurl, ($item==0&&$this->groupwithparent=='true'?'pID='.$products_id:'imagesID='.$addimages_images[$item]['id'])) . (!empty($_GET['products_id']) ? '&products_id='.$_GET['products_id'] : '') . (!empty($_GET['cPath']) ? '&cPath='.$_GET['cPath'] : '') . (!$this->onpagemenu ? '\\\')' : '') . '"' .

 

should be changed to:

 

121: document.write(\'<a href="' . (!$this->onpagemenu ? 'java script:popupWindow(\\\'' : '') . tep_href_link( $this->linkurl, ($item==0&&$this->groupwithparent=='true'?'pID='.$products_id:'imagesID='.$addimages_images[$item]['id']) . (!empty($_GET['products_id']) ? '&products_id='.$_GET['products_id'] : '') . (!empty($_GET['cPath']) ? '&cPath='.$_GET['cPath'] : '')) . (!$this->onpagemenu ? '\\\')' : '') . '"' .

 

The problem was that the additional parameters such as product id weren't in the tel_href_link.

Also, beacuse additional images uses $_GET and safe search engine urls uses $HTTP_GET_VARS you should add the follow in includes/application_top.php:

99: $_GET[$vars[$i]] = $vars[$i+1];

106: $_GET[$key] = $value;

 

 

Also, a small sugestion for additional images 2.0.0: if one choeses not to group togheter main picture and additional images and not to have a fixed size for product listing image, hell brakes loose. Withouth that, small images don't generate, and so on. The only way i could get it to work was to create two additional configuration values called THMUB_IMAGE_WIDTH and THUMB_IMAGE_HEIGHT and go with those, replace SMALL_IMAGE_WIDTH all over Additional Images 2. It would be a good ideea if one chooses not to mix main image and additional images from the additional images menu, to disable image generation for main image.

Edited by GoD2.0
Link to comment
Share on other sites

Hi,

 

I installed the Additional Images contrib over a fresh installation of osCommerce RC1 and I'm having only one problem so far: When I click on one of the images (either the additional or the main image) in the product info page the popup box is completely blank.

 

So far everything else in the contrib is working fine. Any help would be appreciated!

 

Thanks,

 

tamaatim

Link to comment
Share on other sites

you mensioned you "even tried the drive letter", is this hosted on windows?

 

change DIR_FS_CATALOG to:

 

define('DIR_FS_CATALOG', '/home/thegemsh/thegemshop.com/catalog/');

 

if it still doesn't work, put the following code in your pop file in place of the other test code. let me know what it displays. It should show you the complete path to your image. If that complete path is correct, we'll have to look in another direction.

 

<?php if (file_exists(DIR_FS_CATALOG . DIR_WS_IMAGES . $selected_image['products_image_pop'])) { echo DIR_FS_CATALOG . DIR_WS_IMAGES . $selected_image['products_image_pop'] . ' exists';} else {DIR_FS_CATALOG . DIR_WS_IMAGES . $selected_image['products_image_pop'] . ' does not exist';} ?>

 

Ok i got it working now. You were right it couldn't find the images. When i ran the "file-exists()" code above i noticed my path was off. As soon i corrected it, the pop ups started to resize correctly. Thanks again for all your help!

Link to comment
Share on other sites

OK,

 

Ive had a chat with my host about the file permission problem of Apache taking control of the file and folder permissions when additional images creates a folder or image.

They say its down to the fact that aditional images contribution creates using the 700 permission rather than 777. Which means I cant access the files or folders using ftp or file manager.

If I was on a less secure server using apache as user etc then I would be able to. But Im not prepared to compromise my site security by going to a less secure server.

 

Is there any way to get the contribution to create files and folders with the 777 permissions and also create a dummy index.php file in each new folder it creates?

 

Any help would be appreciated..

Thanks

Link to comment
Share on other sites

Hi,

 

I installed the Additional Images contrib over a fresh installation of osCommerce RC1 and I'm having only one problem so far: When I click on one of the images (either the additional or the main image) in the product info page the popup box is completely blank.

 

So far everything else in the contrib is working fine. Any help would be appreciated!

 

Thanks,

 

tamaatim

do you have "Use Search-Engine Safe URLs (still in development)" set to true in your configuration? this contribution doesn't work with that.

Link to comment
Share on other sites

OK,

 

Ive had a chat with my host about the file permission problem of Apache taking control of the file and folder permissions when additional images creates a folder or image.

They say its down to the fact that aditional images contribution creates using the 700 permission rather than 777. Which means I cant access the files or folders using ftp or file manager.

If I was on a less secure server using apache as user etc then I would be able to. But Im not prepared to compromise my site security by going to a less secure server.

 

Is there any way to get the contribution to create files and folders with the 777 permissions and also create a dummy index.php file in each new folder it creates?

 

Any help would be appreciated..

Thanks

 

did you see my reply on july 31? post 557

Link to comment
Share on other sites

did you see my reply on july 31? post 557

 

Sorry Surfalot I missed that post.

 

On opening general.php in admin/includes/functions/ to make the modifications you suggested, I noticed an error with your code.

In 2_files_to_compare/admin/includes/functions/general.php

 

the line

 

$image_subdirectory = preg_replace('/\\\/', '/', $image_subdirectory); // in case back-slashes used, flip 'em around

 

has a ' in the comment, line should be

 

$image_subdirectory = preg_replace('/\\\/', '/', $image_subdirectory); // in case back-slashes used, flip em around

 

I made that alteration (didnt make the changes you suggested) uploaded the general.php file to my store, added a test product. Fired up my ftp software and browsed my images directory. Test product images and directory created all now have the correct permissions.

 

You might want to make the change in the contribution and upload it again to the contributions section.

Everyone else currently using this contribution, please check your general.php files and make sure you dont have the same error in your code.

Link to comment
Share on other sites

I'm having a small problem with this contribution, versions 2.0.0

 

If I have it set to generate 3 images automatically, and also do not have a small or display image width set (so that the aspect ratio of the images are always correct), it does not record the name of the image correctly.

 

For example, I just uploaded a product. On the preview screen, there is no picture shown. After insert the product, and looking at the products properties, the image file path is "/tmp/phpFmFbrx". However, the image file did end up in the images folder at the correct location.

 

Any idea where this can be fixed?

Link to comment
Share on other sites

Sorry Surfalot I missed that post.

 

On opening general.php in admin/includes/functions/ to make the modifications you suggested, I noticed an error with your code.

In 2_files_to_compare/admin/includes/functions/general.php

 

the line

 

$image_subdirectory = preg_replace('/\\\/', '/', $image_subdirectory); // in case back-slashes used, flip 'em around

 

has a ' in the comment, line should be

 

$image_subdirectory = preg_replace('/\\\/', '/', $image_subdirectory); // in case back-slashes used, flip em around

 

I made that alteration (didnt make the changes you suggested) uploaded the general.php file to my store, added a test product. Fired up my ftp software and browsed my images directory. Test product images and directory created all now have the correct permissions.

 

You might want to make the change in the contribution and upload it again to the contributions section.

Everyone else currently using this contribution, please check your general.php files and make sure you dont have the same error in your code.

wow, taking that one single quote out fixed it for you? must be something wrong with your php version. shouldn't matter if there is a single quote in a comment. should be ignored.

I'll pull it from an subsequent versions, but technically not an error in the code. I'd call it a bug in the version of php you have.

Link to comment
Share on other sites

I'm having a small problem with this contribution, versions 2.0.0

 

If I have it set to generate 3 images automatically, and also do not have a small or display image width set (so that the aspect ratio of the images are always correct), it does not record the name of the image correctly.

 

For example, I just uploaded a product. On the preview screen, there is no picture shown. After insert the product, and looking at the products properties, the image file path is "/tmp/phpFmFbrx". However, the image file did end up in the images folder at the correct location.

 

Any idea where this can be fixed?

yes, that's a bug. It will compensate for specifying a width only, but not a height only. if you are using AI to generate all your images, then it doesn't matter whether you specify a width only or a height only or both. AI will always take the width and use it for the height limiter also when calculating how large to size the thumb & medium images.

 

After sizing all your images using AI, it is recommended you set the "Use image size restrictions" setting in the AI configuration options to false. And "Product Info: Restrict parent image size" also. Due to proportional resizing, your images will still look distorted if you keep them true. Setting those to false will allow your images to show in their true size which should be clean, clear and as crisp as you'll get with an automated thumbnailing routine. So end result is, doesn't matter whether you put that dimension in the width or the height.

 

having said that, the next release will have this fix in it.

in /admin/includes/classes/alterimage.php, find:

if (empty($maxheight)) { $maxheight = (!empty($maxwidth) ? $maxwidth : $this->src_height); }

add after it:

if (empty($maxwidth)) { $maxwidth = (!empty($maxheight) ? $maxheight : $this->src_width); }

Link to comment
Share on other sites

Just for the record the php version on the server is PHP/4.4.2

But Im happy now that it works.. :)

wellll that bit does anyhoo.

Im having a bit of trouble with my popup view.

The initial main image shown isnt the correct size, its out of proportion. when i hover over the thumbnails the main image goes to the correct proportions.

see http://workplace-essentials.co.uk/popup_ad...age.php?pID=145 for the problem.

Any idea what may be causing it?

Link to comment
Share on other sites

Just for the record the php version on the server is PHP/4.4.2

But Im happy now that it works.. :)

wellll that bit does anyhoo.

Im having a bit of trouble with my popup view.

The initial main image shown isnt the correct size, its out of proportion. when i hover over the thumbnails the main image goes to the correct proportions.

see http://workplace-essentials.co.uk/popup_ad...age.php?pID=145 for the problem.

Any idea what may be causing it?

 

see paragraph 2 of the post just before yours. that help?

Link to comment
Share on other sites

I've just installed Additional Images and have been playing around with it for a few days. It's working well, except that I can't delete extra images through admin.

 

If I pull up a product in the admin catalog and want to delete one of the additional images, clicking on the "Delete Image" button will send me back to the catalog page with all of the products in the current category -- and it doesn't delete the image, or any reference to the image in my product pages/listings/etc.

 

Any ideas about what might be wrong?

Link to comment
Share on other sites

Hello Everyone

 

First of all I am very new to this so I hope you will be patient with me for now.

I have installed Oscommerce 2.2, then I downloaded the Additional_Images_v2.0.0_update_for_RC1

And followed those instructions. However I get two errors

 

When I go to the main site it gives me a message about globals turned off in php.ini

And when I got to the admin part it says page not found.

 

I am deleting everything off the server

I am then only going to install Oscommerce and wait to see what I learn here.

 

Thank you in advance to anyone who helps me out.

Link to comment
Share on other sites

see paragraph 2 of the post just before yours. that help?

 

Thanks,

 

All that was needed was for me to change the Thumb Menu: Use image size restrictions and set it to FALSE.

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