Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Additional Images Module


Parikesit

Recommended Posts

Ok, I figured out my other problem i had a few lines missing from the mod. However, I have a new problem. The pop ups work, but they do not resize to the size of the image. The width does change size a little(but not to the size of the image, however the height doesn't move. Is there someplace i an adjust this so it dynamically changes the width and height of the popup with the width and height of th image?

 

Please visit:

http://thegemshop.com/catalog/index.php?cPath=1_17

and click on the images to get an idea of what is currently happening with the pop ups. (please don't try to buy anything, the shop is not functioning yet)

Link to comment
Share on other sites

Hi there! actually i am having a problem installing the Additionl Image Module. as i have allready installed the Availability1.0 and is working fine.

 

but wheni tried to change the code "Files 2 Compare" i found that Availability code is on the same line. Well the point i am askin is can i install both contribution at the same time? and how?

 

Sorry if somebody consider it lame but i am a bit new to this so your help will be most appriciated.

Thanks

yes they can, you have to merge the two lines. most contribution installations take a little PHP knowledge.

Link to comment
Share on other sites

I've worked out why the image name is cropped in the database.

It's due to the type being set as varchar(64).

This means if you have say products/main cat name/sub cat name/product name it could quite easily be above the 64 length.

 

What would you advise I increase the value to?

 

change the images fields in your db to 255. I'll have to add that to the instructions on the next version.

Link to comment
Share on other sites

Ive got some small errors with my install of this contrib that I hope someone can help me sort.

 

First one is that when it creates the path for my folders it suggests the directory structure in the wrong order.

 

ie, say i have Product-A in Sub-Cat-2 which is under Main-cat-1 the path for the images should be images/products/Main-cat-1/Sub-Cat-2/Product-A.jpg

 

instead it gives me images/products/Sub-Cat-2/Main-cat-1/Product-A.jpg

 

Any reason it would be doing that? if it carries on like that Ill have loads of sub categories in my product folder, each one having the main category folder inside it containing an image.

 

Second problem is that when it creates a folder it does so using a file permission where I can't access it using ftp or even my filemanager in my plesk control pannel. rwx --- --- is the permissions it gives the folders, This also happens if I create my own folder in filemanager first. then upload an image using additional images, the contrib changes the permissions.

 

My last problem is that I have quite a few images with long names as they all contain the product reference code followed by the product name, This contrib will not store an image name in the database with names anything over 17 characters, if the name is over that i.e RH-S016-GRAB-RAIL-STEP.jpg it will create an image name in the database called RH-S016-GRAB-RAIL- without a .jpg on the end, so when I look through my site I get loads of broken image links as that image dosnt exist.

 

Any help on those would be very very gratefully recieved :P

 

thanks

the problem I've seen with the permissions is not the chmod permissions, its the chown permissions or the ownership. When servers execute the web page with ownership of nobody, then your ftp user can't access it (servers without SuEXEC installed). cPanel file managers can change the permissions and delete files. Not sure why your Plesk is not working, maybe its running under the ftp user.

 

Try this...

 

find in /catalog/admin/includes/functions/general.php

should be this line

if (@chmod($working_directory, $chmodvalue)) {

change to

if (@chmod($working_directory, 0777)) {

 

and this line:

@mkdir($dir_fs_catalog_images_wrk,$chmodvalue);

change to:

@mkdir($dir_fs_catalog_images_wrk,0777);

 

does that help with your permissions?

Link to comment
Share on other sites

Please visit:

http://thegemshop.com/catalog/index.php?cPath=1_17

and click on the images to get an idea of what is currently happening with the pop ups. (please don't try to buy anything, the shop is not functioning yet)

 

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

They were both there when we created the website. I did upload each file to the right directory, and even checked three timess to make sure the files were all where they needed to be. I have uploaded the files two times, and it still will not let me past Step B.

 

Any other suggestions ? Thanks in advance for folks taking the time to respond.

 

you have a problem. there should only be one admin directory. you need to figure out which one is being used by your shop.

 

when any contribution says, "upload these files to /catalog/admin/includes/" that means you need to make a decision first. "/catalog/" is where you put your shop. If you have your shop in the root of your web storage, and mydomain.com/index.php will bring up your shop, then you need to change any directions in a contribution from "upload these files to /catalog/admin/includes/" to "upload these files to /admin/includes/". When we put a contribution together, this is how we specify where you are starting from.

 

"/catalog/" is the default "catalog" location. Not an actual location. Unless, of course, you actually installed your shop in the /catalog/ subdirectory.

Link to comment
Share on other sites

I had install the images module today, but the products page can't display. Here is message:

Fatal error: Cannot instantiate non-existent class: displayimages in /home/motorspo/public_html/product_info.php on line 140

Please help! I had follow all the instruction. Thanks you anyone!

 

you missed a file upload, or maybe to the wrong location. the file is /catalog/includes/classes/displayimages.php

Link to comment
Share on other sites

Hi people, I'm running OsCommerce 2.2 rc 1 and I want to install "Additional Images v 2.0"

 

but I do not why, I'm getting this error when I try to follow point III B:

 

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

Fatal error: require() [function.require]: Failed opening required 'includes/additional_images_configure.php' (include_path='.;c:\smarty\libs') in C:\wamp\www\catalog\admin\additional_images_configure.php on line 28

 

Does anybody know something about this?

 

Regards.

follow the error...

Fatal error: require() [function.require]: Failed opening required 'includes/additional_images_configure.php'

 

you must have missed uploading includes/additional_images_configure.php to your shop. the configurer has 3 files in 3 different locations.

Link to comment
Share on other sites

Just installed this mod, and am not getting any error messages at all, and everthing seems to be installed in admin..but...when I add a product and try and assign images the mod doesn't work. I just get the one image.

 

If it helps in pointing to my problem when I set 'Automatically create 3 image set' to TRUE in config, and then go to a product and and check the 'Generate 3 image set now' (from a single image nothing happens). Also If i leave the product and return the box doesnt' stay checked!

 

If I set 'Automatically create 3 image set' to FALSE, and upload 3 images, I get a confirmation of images being uploaded. If I leave the product and return, my images arent displayed, and get a messge 'No image file, although the images are displayed in the right hand edit coloum and not the product?

 

any offers as this is driving me nuts!

bumping is not allowed. please reread the rules. folks will get to it when we can afford the time.

 

sounds to me like you missed some code in your merge of admin/categories.php. look that over again.

 

if you have the config set to automatically generate the 3 image set. you shouldn't see the checkbox to create the set in the product edit page. the entry fields should be restricted to just the one field.

Link to comment
Share on other sites

hi all.

 

just to let you know that all is sorted out now.

 

if you want to get a scroll bar in the pop up window so that you can use pictures that are larger than the screen area its a simple mod to do.

 

go to popup_add_image.php and edit

 

function popupWindow(url) {

window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,

resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=15

0,left=150')

}

 

to set scrollbars to yes.

 

go to product_info.php and do the same.

 

thats it, nice and easy.

 

hope this helps someone.

 

Oh yeah, you're one of the good ones, finding answers, solving your own problems, AND reporting back when you resolved it. :thumbsup: :thumbsup:

Link to comment
Share on other sites

Hello,

 

When I try to upload an image in additional images module the explorer returns me the following error:

 

 

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/_/public_html/admin/categories.php on line 402

 

Warning: reset() [function.reset]: Passed variable is not an array or object in /home/_/public_html/admin/includes/functions/database.php on line 55

 

Warning: Variable passed to each() is not an array or object in /home/_/public_html/admin/includes/functions/database.php on line 58

 

Warning: reset() [function.reset]: Passed variable is not an array or object in /home/_/public_html/admin/includes/functions/database.php on line 62

 

Warning: Variable passed to each() is not an array or object in /home/_/public_html/admin/includes/functions/database.php on line 63

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') values)' at line 1

 

insert into additional_images) values)

 

Do you know whats happen?

 

Thank you

 

oof, sorry, can't even guess on this one. recheck your merges and uploads.

Link to comment
Share on other sites

hi,

 

I've just installed this contribution and have quite a few errors coming up:

 

When I go to the Admin/Catalog section of my site I get this error message:

 

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

 

Heres my categories.php file for you: http://discountmania.co.uk/categoriesHELP.txt

 

 

When I go to Admin/Customers I get this message:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit 0, 20' at line 1

 select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, a.entry_country_id from customers c left join address_book a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id order by c.customers_lastname, c.customers_firstname limit 0, 20 limit 0, 20

 [TEP STOP]

 

 

When I go to Admin/Locations/Taxes I get this message:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit 0, 20' at line 1

 select countries_id, countries_name, countries_iso_code_2, countries_iso_code_3, address_format_id from countries order by countries_name limit 0, 20 limit 0, 20

 [TEP STOP]

 

 

If I click Admin/Localization I get this message:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit 0, 20' at line 1

 select currencies_id, title, code, symbol_left, symbol_right, decimal_point, thousands_point, decimal_places, last_updated, value from currencies order by title limit 0, 20 limit 0, 20

 [TEP STOP]

 

 

When I go to Admin/Reports I get this error message:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit 0, 20' at line 1

 select p.products_id, pd.products_name, pd.products_viewed, l.name from products p, products_description pd, languages l where p.products_id = pd.products_id and l.languages_id = pd.language_id order by pd.products_viewed DESC limit 0, 20 limit 0, 20

 [TEP STOP]

 

 

And finally, when i actually click on a product to view its prodict_info.php page I get this error message:

 

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

 

 

any help is appreciated,

 

thanks :thumbsup:

 

I'm guessing you didn't merge your /catalog/admin/includes/classes/split_page_results.php correctly. I'd restore, and try that again.

 

Oh, and please don't bump your posts. reread the rule please. its only OK if you are adding info you forgot that might help us help you.

Edited by surfalot
Link to comment
Share on other sites

Hey tanglung,

I'm not sure when you DL the contribution but on Jul 27th someone (acingo64) made a contribution for people with osc 2.2 rc1. He basically edited the "filed to compare" folder of surfalot's contribution. Check it out. I don't know if it will work because I am not using RC1. But I bet you can talk with acinfo64 about it since it seems to be working for him.

 

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.

Link to comment
Share on other sites

Thanks for this info! It really helped out. As for the varchar question you posted before, I'm assuming you have MySQL 4.0 or higher. In versions 4.0 and 4.1 the maximum number is 255... so pick the length you want. I'm not too sure about 5.0 +, but I think I read somewhere that the limit is in the hundred thousands, so you can really have fun with it. Just check the mysql site and do a search for 'mysql 5.0 + varchar'.

 

I did have a question for you about the varchar. On what table in the database are you making the changes? I'm just asking because I may need to so the same.

 

-Alain

the fields that need an increase in size are (255 should be enough):

 

table: products

fields: products_image, products_image_med, products_image_pop

 

the SQL for the changes is:

 

ALTER  TABLE  `products`  CHANGE  `products_image`  `products_image` VARCHAR( 255  )  NULL  DEFAULT NULL ,
CHANGE  `products_image_med`  `products_image_med` VARCHAR( 255  )  NULL  DEFAULT NULL ,
CHANGE  `products_image_pop`  `products_image_pop` VARCHAR( 255  )  NULL  DEFAULT NULL

table: additional_images

fields: thumb_images, medium_images, popup_images

 

the SQL:

ALTER  TABLE  `additional_images`  CHANGE  `thumb_images`  `thumb_images` VARCHAR( 255  )  NULL  DEFAULT NULL ,
CHANGE  `medium_images`  `medium_images` VARCHAR( 255  )  NULL  DEFAULT NULL ,
CHANGE  `popup_images`  `popup_images` VARCHAR( 255  )  NULL  DEFAULT NULL

If you need more than 255 chars (shouldn't), you can always change the field type to TEXT. Don't need to specify a number of chars. You will be allowed 65536 chars.

Link to comment
Share on other sites

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.

 

Ok here are the definitions of the constants:

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

define('DIR_WS_IMAGES', 'images/');

Link to comment
Share on other sites

I'm guessing you didn't merge your /catalog/admin/includes/classes/split_page_results.php correctly. I'd restore, and try that again.

 

Oh, and please don't bump your posts. reread the rule please. its only OK if you are adding info you forgot that might help us help you.

 

 

Thanks, I already had this in my code, once I removed it all the SQL errors I was getting went away although I still have a few problems.

 

if ($offset < 0)
 {
   $offset = 0;
	}
  $sql_query .= " limit " . $offset . ", " . $max_rows_per_page;

 

 

 

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

 

 

I thought you might need my categories.php and product_info.php files so I uploaded them as a txt file for you:

 

http://discountmania.co.uk/Help_Admin_Categories.txt

 

http://discountmania.co.uk/Help_product_info.txt

Link to comment
Share on other sites

Ok here are the definitions of the constants:

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

define('DIR_WS_IMAGES', 'images/');

 

what is happening is the display script can't find your images for some reason.

 

open popup_add_image.php

find:

</body>
</html>

 

Add the following php tag just before the end body tag:

<?php echo dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/'); ?>

 

Open your popup window from the product info page (stretch the window if needed) and find the text it displays near the bottom of the page. copy that into a post here, then you can remove that tag. I suspect it isn't producing what it should.

Link to comment
Share on other sites

Thanks, I already had this in my code, once I removed it all the SQL errors I was getting went away although I still have a few problems.

 

if ($offset < 0)
  {
	$offset = 0;
	 }
   $sql_query .= " limit " . $offset . ", " . $max_rows_per_page;

so you did retry the /catalog/admin/includes/classes/split_page_results.php file? or was this something else you found?

Link to comment
Share on other sites

what is happening is the display script can't find your images for some reason.

 

open popup_add_image.php

find:

</body>
</html>

 

Add the following php tag just before the end body tag:

<?php echo dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/'); ?>

 

Open your popup window from the product info page (stretch the window if needed) and find the text it displays near the bottom of the page. copy that into a post here, then you can remove that tag. I suspect it isn't producing what it should.

 

If i place this code in popup_add_image.php it breaks the pop up all together(no images show up). I think $HTTP_SERVER_VARS['SCRIPT_FILENAME'] is undefined on this page. Is there a way to link what ever page is defining it to get it to display?

Link to comment
Share on other sites

If i place this code in popup_add_image.php it breaks the pop up all together(no images show up). I think $HTTP_SERVER_VARS['SCRIPT_FILENAME'] is undefined on this page. Is there a way to link what ever page is defining it to get it to display?

I tried using the line

require('includes/configure.php');

At the top however this did not work.

Edited by dtchaos
Link to comment
Share on other sites

If i place this code in popup_add_image.php it breaks the pop up all together(no images show up). I think $HTTP_SERVER_VARS['SCRIPT_FILENAME'] is undefined on this page. Is there a way to link what ever page is defining it to get it to display?

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.

Link to comment
Share on other sites

yeah thats from the split_page_results.php file it must have clashed somehow with what was in your split_page_results.php file. Do you think you could help me with the other problems I'm having too?

 

my best advice is to restore those files and try again.

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?

Edited by Benjjj6
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 -.-)

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