Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Additional Images Module


Parikesit

Recommended Posts

 

I still have the same error when I add a new product:

 

Fatal error: Call to undefined function tep_hide_session_id() in /public_html/portail/****/***/admin/categories.php on line 765

the error you are getting is because this contribution is geared for RC2a osCommerce. You can add this function to your admin/includes/functions/html_output.php as it exists in the RC2a release.

 

////
// Hide form elements
function tep_hide_session_id() {
$string = '';

if (defined('SID') && tep_not_null(SID)) {
	$string = tep_draw_hidden_field(tep_session_name(), tep_session_id());
}

return $string;
}

 

 

 

When i want édit a product :

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 ' p.products_image_med, p.products_image_pop, p.products_image_description, p.pro' at line 1

 

select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_pdfupload, p.products_price, p.products_weight, p.products_date_added,, p.products_image_med, p.products_image_pop, p.products_image_description, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.products_sold, p.manufacturers_id from products p, products_description pd where p.products_id = '826' and p.products_id = pd.products_id and pd.language_id = '1'

 

[TEP STOP]

 

 

I have be insert the .sql file in my data base

 

recheck the added code in the product edit script. Looks like you have two commas after p.products_date_added in that lookup SQL.

 

 

 

I have a problem with admin/includes/functions/html_output: in the contrib :

 

 

In my page:

// The HTML image wrapper function
function tep_image($src, $alt = '', $width = '', $height = '', $params = '') {
$image = '<img src="' . $src . '" border="0" alt="' . $alt . '"';
if ($alt) {
$image .= ' title=" ' . $alt . ' "';
}
// BOF: Additional Images
/* if (tep_not_null($width) && tep_not_null($height)) {
$image .= ' width="' . tep_output_string($width) . '" height="' . tep_output_string($height) . '"';
} */
if (tep_not_null($width)) {
$image .= ' width="' . tep_output_string($width) . '"';
}
if (tep_not_null($height)) {
$image .= ' height="' . tep_output_string($height) . '"';
}
// EOF: Additional Images
if ($params) {
$image .= ' ' . $params;
}
$image .= '>';

return $image;
}

////
// The HTML form submit button wrapper function
// Outputs a button in the selected language

 

It's ok ?

 

Thanks

 

looks OK to me, what's the problem?

Link to comment
Share on other sites

Hi,

Installed V.2.2.0 OK and now getting to grips with image control in the Categories/Products and New Products - finding the later a bit unstable: all images seem to need to be specified together; if I enter one, then come back to edit another, the first one tends to disappear or is ignored. Strange.

 

Main point of this request-for-help post:

With image pop-up after 'Click to Enlarge' is selected, the window initially opens towards the top left - as specified in the javascript coding about line 88 of Products_Info - before jumping to near the centre of the screen.

 

Question 1: Where can I specify the final position of the pop-up window (I can't see anywhere in the new javascript code in the Non Lightbox lines). I assume that disabling the position specification in the first bit of java code will stop the initial pop-up.

Question 2: Is it possible to specify the opening size of the pop-up window (presumably at the same place as Q1!).

 

Thanks,

 

Mike

 

you'll find that in the javascript of the popup_add_image.php script. it repositions itself when it loads.

Link to comment
Share on other sites

it's just you :)

 

I never considered a giant watermark, and didn't think many would even watermark their thumbs at all since it would make it hard to see the product. Stock photo sites don't even watermark their thumbs.

OK, no problem then, thanks!

 

Cheers.

Link to comment
Share on other sites

you'll find that in the javascript of the popup_add_image.php script. it repositions itself when it loads.

 

Great, thanks a lot; that bit is now fixed.

 

Now becoming a nuisance is the image locations set in the admin/new products edit page.

With the 'Generate 3 image set now.' box unticked, I want to select my own images for the three image selections using the 'Browse..' box.

Each time I exit that page via 'preview' then 'update' as usual, the 'Upload location' path is added to whatever is set in the images path. The first time around, the Thumb and other images may be loaded OK, but if I return to add or amend anything on that page, as soon as I update the entry, the image path is corrupted by the addition of a repeated upload location path.

 

In Config/AI I have togglled the Prefill Upload dir to false then true but none of the config settings seem to help.

 

I can see from phpMyAdmin that the images entry in products/products_image table contains the double path, so it appears that I have a code error somewhere - any idea where this might be?

Link to comment
Share on other sites

Great, thanks a lot; that bit is now fixed.

 

Now becoming a nuisance is the image locations set in the admin/new products edit page.

With the 'Generate 3 image set now.' box unticked, I want to select my own images for the three image selections using the 'Browse..' box.

Each time I exit that page via 'preview' then 'update' as usual, the 'Upload location' path is added to whatever is set in the images path. The first time around, the Thumb and other images may be loaded OK, but if I return to add or amend anything on that page, as soon as I update the entry, the image path is corrupted by the addition of a repeated upload location path.

 

In Config/AI I have togglled the Prefill Upload dir to false then true but none of the config settings seem to help.

 

I can see from phpMyAdmin that the images entry in products/products_image table contains the double path, so it appears that I have a code error somewhere - any idea where this might be?

That is strange. I'm not experiencing that problem with my test site. The image filenames should not be updated when you don't upload a new image. Is it Win or Linux? What the php version?

Link to comment
Share on other sites

Hello everyone.

 

thank you for this great addon, but i got a problem.

 

When i set the "Product Info: Product Image Behavior" to popup everything is fine, but when i set "Product Info: Product Image Behavior" to product_info all the images disappears. how come ?

 

did i forget to add something to the code.

 

im using osc 2.2rc2 with BTSv1_7.

 

thank you in advance.

Edited by 87up
Link to comment
Share on other sites

Hello everyone.

 

thank you for this great addon, but i got a problem.

 

When i set the "Product Info: Product Image behavior" to popup everything is fine, but when i set "Product Info: Product Image behavior" to product_info all the images disappears. how come ?

 

did i forget to add something to the code.

 

im using osc 2.2rc2 with BTSv1_7.

 

thank you in advance.

 

Product Info: Group parent with sub-images must be false for that configuration. I beieve that option combo is the only one that results in the whole thing disappearing.

Link to comment
Share on other sites

Product Info: Group parent with sub-images must be false for that configuration. I beieve that option combo is the only one that results in the whole thing disappearing.

 

Thank you very much surfalot... that worked. everything is fine now. :)

Link to comment
Share on other sites

I just installed the contribution but something isn't working right, everything seems to work ok but when I click an image with lightbox enabled it just shows the loading image.

 

http://tougetuning.c...&products_id=12

 

appears as though you are using some kind of thumb-nailing contribution that is conflicting with AIs functionality.

Link to comment
Share on other sites

I had OSCthumb installed, I have removed it now but it doesn't appear to have fixed the problem yet.

 

I also have another issue that I think just popped up. I added a contribution for a remove from cart button rather than the checkbox. it works perfect BUT the image for the new button is being resized extremely small. I am guessing it has to do with this contribution so I am hoping someone can help with this too.

Link to comment
Share on other sites

I also have another issue that I think just popped up. I added a contribution for a remove from cart button rather than the checkbox. it works perfect BUT the image for the new button is being resized extremely small. I am guessing it has to do with this contribution so I am hoping someone can help with this too.

 

this contribution doesn't resize buttons, only the product images, and only when you specify in the AI settings. I think you missed some of the thumb code.

Link to comment
Share on other sites

this contribution doesn't resize buttons, only the product images, and only when you specify in the AI settings. I think you missed some of the thumb code.

 

The site is www.tougetuning.com/testsite, you can add a product and view the cart to see what I mean. I went completely through the oscThumb install and removed all added code. There is also nothing left from it in the shopping_cart.php file so I can't figure out why it is so small.

 

Also the Lightbox is still not working it just keeps showing the loading thing but never actually displays the image when clicked.

Link to comment
Share on other sites

The site is www.tougetuning.com/testsite, you can add a product and view the cart to see what I mean. I went completely through the oscThumb install and removed all added code. There is also nothing left from it in the shopping_cart.php file so I can't figure out why it is so small.

 

Also the Lightbox is still not working it just keeps showing the loading thing but never actually displays the image when clicked.

 

I see where your problem may be. Do you have a popup sized image defined for that product?

 

This change in the product_info.php will display the thumb if the popup image is not present:

 

find:

if (ENABLE_LIGHTBOX == 'true') {
// lightbox addon
?><script language="javascript"><!--
document.write('<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_pop']) . '"target="_blank" rel="lightbox[group]" title="'. $product_info['products_name'].'" >' . tep_image(DIR_WS_IMAGES . (!empty($product_info['products_image_med'])?$product_info['products_image_med']:(!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:(!empty($product_info['products_image'])?$product_info['products_image']:''))), addslashes($product_info['products_name']), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_WIDTH:''), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_HEIGHT:''), 'hspace="5" vspace="5"') . '<br>' . (!empty($product_info['products_image_description'])?$product_info['products_image_description']:TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>');
//--></script>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . (!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:$product_info['products_image'])) . '" target="_blank" rel="lightbox[group]" title="'.$product_info['products_name'].'">' . tep_image(DIR_WS_IMAGES . (!empty($product_info['products_image_med'])?$product_info['products_image_med']:(!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:(!empty($product_info['products_image'])?$product_info['products_image']:''))), $product_info['products_name'], (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_WIDTH:''), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_HEIGHT:''), 'hspace="5" vspace="5"') . '<br>' . (!empty($product_info['products_image_description'])?$product_info['products_image_description']:TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>
</noscript><?php
} else {

 

replace with:

 

if (ENABLE_LIGHTBOX == 'true') {
// lightbox addon
?><script language="javascript"><!--
document.write('<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . (!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:$product_info['products_image'])) . '"target="_blank" rel="lightbox[group]" title="'. $product_info['products_name'].'" >' . tep_image(DIR_WS_IMAGES . (!empty($product_info['products_image_med'])?$product_info['products_image_med']:(!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:(!empty($product_info['products_image'])?$product_info['products_image']:''))), addslashes($product_info['products_name']), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_WIDTH:''), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_HEIGHT:''), 'hspace="5" vspace="5"') . '<br>' . (!empty($product_info['products_image_description'])?$product_info['products_image_description']:TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>');
//--></script>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . (!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:$product_info['products_image'])) . '" target="_blank" rel="lightbox[group]" title="'.$product_info['products_name'].'">' . tep_image(DIR_WS_IMAGES . (!empty($product_info['products_image_med'])?$product_info['products_image_med']:(!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:(!empty($product_info['products_image'])?$product_info['products_image']:''))), $product_info['products_name'], (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_WIDTH:''), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_HEIGHT:''), 'hspace="5" vspace="5"') . '<br>' . (!empty($product_info['products_image_description'])?$product_info['products_image_description']:TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>
</noscript><?php
} else {

Link to comment
Share on other sites

I see where your problem may be. Do you have a popup sized image defined for that product?

 

This change in the product_info.php will display the thumb if the popup image is not present:

 

find:

if (ENABLE_LIGHTBOX == 'true') {
// lightbox addon
?><script language="javascript"><!--
document.write('<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_pop']) . '"target="_blank" rel="lightbox[group]" title="'. $product_info['products_name'].'" >' . tep_image(DIR_WS_IMAGES . (!empty($product_info['products_image_med'])?$product_info['products_image_med']:(!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:(!empty($product_info['products_image'])?$product_info['products_image']:''))), addslashes($product_info['products_name']), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_WIDTH:''), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_HEIGHT:''), 'hspace="5" vspace="5"') . '<br>' . (!empty($product_info['products_image_description'])?$product_info['products_image_description']:TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>');
//--></script>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . (!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:$product_info['products_image'])) . '" target="_blank" rel="lightbox[group]" title="'.$product_info['products_name'].'">' . tep_image(DIR_WS_IMAGES . (!empty($product_info['products_image_med'])?$product_info['products_image_med']:(!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:(!empty($product_info['products_image'])?$product_info['products_image']:''))), $product_info['products_name'], (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_WIDTH:''), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_HEIGHT:''), 'hspace="5" vspace="5"') . '<br>' . (!empty($product_info['products_image_description'])?$product_info['products_image_description']:TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>
</noscript><?php
} else {

 

replace with:

 

if (ENABLE_LIGHTBOX == 'true') {
// lightbox addon
?><script language="javascript"><!--
document.write('<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . (!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:$product_info['products_image'])) . '"target="_blank" rel="lightbox[group]" title="'. $product_info['products_name'].'" >' . tep_image(DIR_WS_IMAGES . (!empty($product_info['products_image_med'])?$product_info['products_image_med']:(!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:(!empty($product_info['products_image'])?$product_info['products_image']:''))), addslashes($product_info['products_name']), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_WIDTH:''), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_HEIGHT:''), 'hspace="5" vspace="5"') . '<br>' . (!empty($product_info['products_image_description'])?$product_info['products_image_description']:TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>');
//--></script>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . (!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:$product_info['products_image'])) . '" target="_blank" rel="lightbox[group]" title="'.$product_info['products_name'].'">' . tep_image(DIR_WS_IMAGES . (!empty($product_info['products_image_med'])?$product_info['products_image_med']:(!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:(!empty($product_info['products_image'])?$product_info['products_image']:''))), $product_info['products_name'], (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_WIDTH:''), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_HEIGHT:''), 'hspace="5" vspace="5"') . '<br>' . (!empty($product_info['products_image_description'])?$product_info['products_image_description']:TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>
</noscript><?php
} else {

 

That's amazing, thanks for the fixed, I guess the module is based on actually working with a store and uploading images. I just had all the stock photos on there.

 

Any idea on the resizing of the button for remove from cart?

 

Can I just copy over the code for the lightbox portions to the review pages to get them to work for images displayed on those pages aswell? I know on one I have to change $product_info to $review but other than that I believe they are similar for those sections but wanted to check in advance.

Link to comment
Share on other sites

That's amazing, thanks for the fixed, I guess the module is based on actually working with a store and uploading images. I just had all the stock photos on there.

 

Any idea on the resizing of the button for remove from cart?

 

Can I just copy over the code for the lightbox portions to the review pages to get them to work for images displayed on those pages aswell? I know on one I have to change $product_info to $review but other than that I believe they are similar for those sections but wanted to check in advance.

 

I would guess you have to upload a replacement image to the correct folder for the button that has not been resized.

 

all you need to do is put rel="lightbox[group]" in the link tag for image and the 5 lines following <!-- BOF: Lightbox Contribution --> in the head tag of the page and you have a lightbox.

Link to comment
Share on other sites

I just uploaded the necessary files to get started, and I went to the additional_images_configure.php page. I got the red text as expected (listed below), but no "Normal Update" or "Run Configuration Utility" button. What am I doing wrong, or where can I go from here?

 

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" was not 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".

Table "additional_images" was not found, column check not performed.

Link to comment
Share on other sites

I just uploaded the necessary files to get started, and I went to the additional_images_configure.php page. I got the red text as expected (listed below), but no "Normal Update" or "Run Configuration Utility" button. What am I doing wrong, or where can I go from here?

 

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" was not 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".

Table "additional_images" was not found, column check not performed.

 

what version of osCommerce do you have installed?

Link to comment
Share on other sites

2.2ms2

 

if you do not have the following function in your /admin/includes/functions/html_output.php file, then add it in.

////
// Hide form elements
function tep_hide_session_id() {
$string = '';

if (defined('SID') && tep_not_null(SID)) {
	$string = tep_draw_hidden_field(tep_session_name(), tep_session_id());
}

return $string;
}

Link to comment
Share on other sites

if you do not have the following function in your /admin/includes/functions/html_output.php file, then add it in.

////
// Hide form elements
function tep_hide_session_id() {
$string = '';

if (defined('SID') && tep_not_null(SID)) {
	$string = tep_draw_hidden_field(tep_session_name(), tep_session_id());
}

return $string;
}

That helped. Thanks

Link to comment
Share on other sites

Hi first of all this is a great contibution and thanks for the upgrades to version 2.2.0

 

I would like to ask if it is possible to upload flv and youtube links as additional images, with the possibility to generate a thumbnail image of such as well.

 

If such is possible kindly guide me.

 

I think that these are the missing addons to such a great contib.

 

With best regards

 

Fabian

Link to comment
Share on other sites

I have a freash install of 2.2 rc2a with a fresh install of STS 4.5.9 and then a fresh install of Product Listing Columns 2.2.8. I tested everything and everything worked GREAT! I then went to install additional images 2.2.0 and the sts content for that. I LOST my 3 columns after the install. Additional images installed and works, sts is fine but when i click a category the three test products I have set up are just stacked one on top of another. I poked around everywhere and I can't get my beloved 3 columns back! I don't even know what code to post in order to get help but ANY help would greatly be appreciated.

 

Thank you!

Link to comment
Share on other sites

Hi first of all this is a great contibution and thanks for the upgrades to version 2.2.0

 

I would like to ask if it is possible to upload flv and youtube links as additional images, with the possibility to generate a thumbnail image of such as well.

 

If such is possible kindly guide me.

 

I think that these are the missing addons to such a great contib.

 

With best regards

 

Fabian

 

sorry, no plans to do anything like that. I would think the best place for vids is embedded in the text.

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