Latest News: (loading..)
Sign in to follow this  
Followers 0
Parikesit

[Contribution] Additional Images Module

1,477 posts in this topic

Additional Images Module (Version 1.0)

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

 

Features:

- A real image module

- 'Unlimited' additional images for each product

- Popup image for each additionals

- Add/Delete additional images from Admin panel

- 3 sizes image

 

Send your comment to this forum

 

 

Enjoy,

Parikesit

 

:D

Share this post


Link to post
Share on other sites

Looks good in the readme. Do you have an example of what it looks like when implemented into a store ?

 

Thanks.

Share this post


Link to post
Share on other sites

Hi Belivers,

Glad to see you...

 

My online store still under development... :oops:

Soon, maybe 8)

 

 

Parikesit

Share this post


Link to post
Share on other sites

Here some preview from my local PC.

 

Admin Preview:

 

[1]

categories.gif

 

[2]

add_images.gif

 

[3]

delete_images.gif

Share this post


Link to post
Share on other sites

I just tried this out and I ran into a couple of problems.

 

- the table is called additional_images, but is defined as products_images

- the boxes.php modifications file is empty. I'm guessing there should be a class in there called imagesbox?

 

i think that's all

Share this post


Link to post
Share on other sites

Thanks a lot to Lorene.

 

I have upload the patch for this bug, see:

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

 

Anyway here the missing files/configuration:

 

#Admin

- admin/includes/application_top.php

define('TABLE_ADDITIONAL_IMAGES', 'additional_images');

 

 

#Catalog

- catalog/includes/application_top.php

//filename

   define('FILENAME_ADDITIONAL_IMAGES', 'additional_images.php');

   define('FILENAME_POPUP_ADD_IMAGE', 'popup_add_image.php');

   

//table    

   define('TABLE_ADDITIONAL_IMAGES', 'additional_images');

 

- catalog/includes/classes/boxes.php (add to boxes.php)

class imagesBox extends tableBox {      

     function imagesBox($contents) {        

       $info_box_contents = array();        

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

       $this->table_cellpadding = '1';        

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

   }

     function imagesBoxContents($contents) {

       $this->table_cellpadding = '4';

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

       return $this->tableBox($contents);

     }

   }

Share this post


Link to post
Share on other sites

I just downloaded the contribution for closer examination of code. Looks nice.

 

I noticed that there are no language fields even though desciption is given. Are you planning to add them ?

 

I personally do not want anything more to the product_info.php, but would still like to give addional images for vieving. The gallery mod was a bit hard to use with different directories and naming rules for images.

 

Could this mod be modified so that instead of showing preview images in product_info.php, it would show link to Product_gallery.php (if there are any additional images for the product ). Product_gallery.php would be sligthly modified product_info.php with additional images included.

 

Do you think this can be done ?

Share this post


Link to post
Share on other sites
I noticed that there are no language fields even though desciption is given. Are you planning to add them ?

 

"Image Description" value just show as ToolTip (on mouse over images) in Catalog, and as ImageName in Admin. Maybe we do not really need to add languages functionality to them.

 

...

Could this mod be modified so that instead of showing preview images in product_info.php, it would show link to Product_gallery.php (if there are any additional images for the product ). Product_gallery.php would be sligthly modified product_info.php with additional images included.  

 

Do you think this can be done ?

 

Yes! that would be great. I'll try do it.

 

Thank's

Share this post


Link to post
Share on other sites
Could this mod be modified so that instead of showing preview images in product_info.php' date=' it would show link to Product_gallery.php (if there are any additional images for the product ). Product_gallery.php would be sligthly modified product_info.php with additional images included.

 

Do you think this can be done ?[/quote']

 

Yes! that would be great. I'll try do it.

 

Thank's

 

Something very very cood would be:

 

Once more than 1 image is uploaded for that product, the pop up window would open with 1 or as many as uploaded image ( as thumbnail ) with one larger image. clicking on the thumb, with bigger image would change with the one clicked....

 

Salvo

Share this post


Link to post
Share on other sites

everything is working . i think

 

 

EXCEPT

 

when the additional image pops up

 

theres nothing there !

 

 

 

its just a little white blank box............

Share this post


Link to post
Share on other sites

fixed that problem

 

 

edited popup_add_image.php

 

 

changed:

 

$navigation->remove_current_page();

 

 

to :

 

//$navigation->remove_current_page();

 

 

now they work

Share this post


Link to post
Share on other sites

Upon creating Tbl additional_images I get this error

 

Key column 'product_add_images_id' doesn't exist in table

 

i am using a shell to manually enter the add_images.sql file. I am uncertain of what syntax to use (if any) to 'execute' the add_images.sql file as a source file. :oops: If your syntax is correct in the file and there is a way to execute a *.sql from a shell, w/o phpmyadmin (<-- I dont have) I'd really like to know! Otherwise could you explain the structure of the table, or even better tell me what to change.

 

this is the syntax i used from your dl'd file

 

drop table if exists additional_images;

create table additional_images (

additional_images_id int(11) not null auto_increment,

products_id int(11) not null ,

images_description varchar(255) ,

medium_images varchar(64) ,

popup_images varchar(64) ,

PRIMARY KEY (product_add_images_id, products_id)

);

 

maybe I just need to change the product_add_images_id name

 

Besides not writing to mySql table the script is running fine so far.

 

Thanks

Ash

Share this post


Link to post
Share on other sites

Can anyone post a link to a working catalog page that has this installed, so I can see what it does ?

 

Thank you.

Share this post


Link to post
Share on other sites

From what i can tell is that it's not quite working perfectly yet, but the basic idea is to be able to have multiple images for one product in the form of popup windows. I dont know yet because I'm not sure how to design the new table. Once I get it up i can message you a link. I'm sceptical of posting it here because my site isnt running yet and I need to conserve precious bandwidth. Hopefully someone else has it running though! I'm curious myself :D

Share this post


Link to post
Share on other sites

when im in the admin area and i add a image everything is ok .

 

 

but if i try to delete the image

 

i get a Error :

 

 

Call To Undefined Function: si() in categories.php on line xxx

 

 

when i check that line it reads

 

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

 

 

what have i missed ?

 

 

there must be a function i dont have ......

Share this post


Link to post
Share on other sites

rewrite case 'del_images' to these one:

 

case 'del_images':

$additional_images_id = tep_db_prepare_input($HTTP_GET_VARS['pID']);

 

if ( ($HTTP_POST_VARS['products_id']) && (is_array($HTTP_POST_VARS['additional_images_id'])) ) {

$product_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);

$additional_images_id = $HTTP_POST_VARS['additional_images_id'];

 

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

tep_db_query("delete from " . TABLE_ADDITIONAL_IMAGES . " where additional_images_id = '" . tep_db_input($additional_images_id[$i]) . "'");

}

}

//tep_db_query("delete from " . TABLE_ADDITIONAL_IMAGES . " where additional_images_id = '" . $HTTP_POST_VARS['additional_images_id'] . "'");

tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products_id));

break;

Share this post


Link to post
Share on other sites

I add new file of this patch to the package:

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

 

Upon creating Tbl  additional_images I get this error  

 

drop table if exists additional_images;

create table additional_images (

 additional_images_id int(11) not null auto_increment,

 products_id int(11) not null ,

 images_description varchar(255) ,

 medium_images varchar(64) ,

 popup_images varchar(64) ,

 PRIMARY KEY (product_add_images_id, products_id)

);

 

IT HAS TO BE:

 

drop table if exists additional_images;

create table additional_images (

 additional_images_id int(11) not null auto_increment,

 products_id int(11) not null ,

 images_description varchar(255) ,

 medium_images varchar(64) ,

 popup_images varchar(64) ,

 PRIMARY KEY (additional_images_id, products_id)

);

 

Just change the "product_add_images_id" with "additional_images_id"

 

Thanks

Share this post


Link to post
Share on other sites

I'm having the same problem as Teksigns was having. I changed the code in popup_add_image.php as you suggested Teksigns, but it did not fix the error. The image is uploaded, and it appears at the bottom of the page resized, but when clicked to enlarge, i get the 404 error.

 

Any suggestions???

 

Otherwise the scipt is running fine, I think.

 

Thanks,

Ash

Share this post


Link to post
Share on other sites
I'm having the same problem as Teksigns was having. I changed the code in popup_add_image.php as you suggested Teksigns, but it did not fix the error. The image is uploaded, and it appears at the bottom of the page resized, but when clicked to enlarge, i get the 404 error.

 

Any suggestions???

 

Otherwise the scipt is running fine, I think.

 

Thanks,

Ash

 

I have installed the contribution properly. It is working great.

Thanks a lot for such a needed peace of code.

 

Ash,

I think you may get something if you try to look in to your catalog/includes/application_top.php file and find the follwing line:

#catalog/includes/application_top.php

 

 

define('FILENAME_POPUP_ADD_IMAGE', 'popup_add_image.php');

 

needs to be

define('FILENAME_POPUP_IMAGE_ADD', 'popup_add_image.php');

 

please note, one says IMAGE_ADD, the other ADD_IMAGE.

 

good luck!

 

thanks again for the contribution.

Share this post


Link to post
Share on other sites

We got it working by not taking any notice of your updates, but changing the define table name additional_images to product_images

 

Also your SQL statement does not work!!!!!!

 

Otherwise, excellent script, just needs sorting out.......

Share this post


Link to post
Share on other sites

Excellent catch erisen!!!!! :D

 

Now at least im getting a real error instead of a 404 so the page has been called up properly. The error in the popup window is as follows:

 

require('includes/application_top.php'); $navigation->remove_current_page(); $products_query = tep_db_query("SELECT images_description, popup_images FROM " . TABLE_ADDITIONAL_IMAGES . " WHERE additional_images_id = '" . $HTTP_GET_VARS['imagesID'] . "'"); $products_values = tep_db_fetch_array($products_query); ?>

Fatal error: Call to undefined function: tep_image() in /catalog/popup_add_image.php on line 37

 

 

Line 37 looks like this:

echo tep_image(DIR_WS_IMAGES . $products_values['popup_images'], $products_values['images_description'], POPUP_IMAGE_WIDTH, POPUP_IMAGE_HEIGHT); ?>

 

Any ideas?

 

Thanks,

Ash

Share this post


Link to post
Share on other sites

There are some different configuration in OLD 2.2 CVS and the later CVS like MS1.

 

Example:

In the header of the popup_images.php CVS#20020620 we find:

 

  require('includes/application_top.php');

 

 

 

But in the MS1 there is a line "$navigation->remove_current_page();"

  require('includes/application_top.php');



 $navigation->remove_current_page();

 

 

For save configuration, take a look to popup_images.php from your CVS version. Than replace the some changing lines and save as "popup_add_image.php"

 

 

Regards

Parikesit

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0