Jump to content



Latest News: (loading..)

* * * * * 2 votes

[Contribution] Additional Images Module


  • Please log in to reply
1473 replies to this topic

#1   Parikesit

Parikesit
  • Members
  • 263 posts
  • Real Name:zaenal
  • Gender:Male
  • Location:Bandung, Indonesia

Posted 27 February 2003 - 11:47 PM

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

#2   burt

burt

    Code Monkey

  • Community Team
  • 7,764 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEV/on

Posted 28 February 2003 - 12:00 AM

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

Thanks.

#3   Parikesit

Parikesit
  • Members
  • 263 posts
  • Real Name:zaenal
  • Gender:Male
  • Location:Bandung, Indonesia

Posted 28 February 2003 - 01:46 AM

Hi Belivers,
Glad to see you...

My online store still under development...  :oops:
Soon, maybe  8)


Parikesit

#4   Parikesit

Parikesit
  • Members
  • 263 posts
  • Real Name:zaenal
  • Gender:Male
  • Location:Bandung, Indonesia

Posted 28 February 2003 - 01:55 AM

Here some preview from my local PC.

Admin Preview:

[1]
[img]http://bookstore.paramartha.org/categories.gif[/img]

[2]
[img]http://bookstore.paramartha.org/add_images.gif[/img]

[3]
[img]http://bookstore.paramartha.org/delete_images.gif[/img]

#5   lorene

lorene
  • Members
  • 4 posts
  • Real Name:Lorene

Posted 28 February 2003 - 03:01 AM

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

#6   Parikesit

Parikesit
  • Members
  • 263 posts
  • Real Name:zaenal
  • Gender:Male
  • Location:Bandung, Indonesia

Posted 28 February 2003 - 04:04 AM

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);

      }

    }


#7   mazza

mazza
  • Members
  • 222 posts
  • Real Name:Matti
  • Location:Finland

Posted 28 February 2003 - 05:36 AM

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 ?

#8   Parikesit

Parikesit
  • Members
  • 263 posts
  • Real Name:zaenal
  • Gender:Male
  • Location:Bandung, Indonesia

Posted 28 February 2003 - 12:28 PM

Quote

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.

...

Quote

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

#9   Salvo

Salvo
  • Members
  • 1,008 posts
  • Real Name:Salvo
  • Gender:Male

Posted 28 February 2003 - 01:52 PM

[quote="Parikesit"][quote]
[quote]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 ?[/quote]

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

Thank's[/quote]

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

#10   teksigns

teksigns
  • Members
  • 117 posts
  • Real Name:Brian

Posted 28 February 2003 - 04:37 PM

everything is working . i think


EXCEPT

when the additional image pops up

theres nothing there !



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

#11   teksigns

teksigns
  • Members
  • 117 posts
  • Real Name:Brian

Posted 28 February 2003 - 04:50 PM

fixed that problem


edited  popup_add_image.php


changed:

$navigation->remove_current_page();


to :

//$navigation->remove_current_page();


now they work

#12   MasterBeta

MasterBeta
  • Members
  • 14 posts
  • Real Name:Ashley

Posted 28 February 2003 - 04:56 PM

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

#13   burt

burt

    Code Monkey

  • Community Team
  • 7,764 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEV/on

Posted 28 February 2003 - 05:03 PM

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

Thank you.

#14   MasterBeta

MasterBeta
  • Members
  • 14 posts
  • Real Name:Ashley

Posted 28 February 2003 - 05:13 PM

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

#15   teksigns

teksigns
  • Members
  • 117 posts
  • Real Name:Brian

Posted 28 February 2003 - 05:28 PM

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 :


Quote

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

#16   okonstan

okonstan
  • Members
  • 3 posts
  • Real Name:Konstantin

Posted 28 February 2003 - 11:44 PM

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;

#17   Parikesit

Parikesit
  • Members
  • 263 posts
  • Real Name:zaenal
  • Gender:Male
  • Location:Bandung, Indonesia

Posted 01 March 2003 - 02:13 AM

I add new file of this patch to the package:
http://www.oscommerce.com/community/contributions,1032

Quote

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

#18   teksigns

teksigns
  • Members
  • 117 posts
  • Real Name:Brian

Posted 01 March 2003 - 04:34 AM

thank you

the new case rewrite fixed the problem .


all works well now


as you can see here

http://www.teksigns.com/shop/product_info....products_id=544

#19   MasterBeta

MasterBeta
  • Members
  • 14 posts
  • Real Name:Ashley

Posted 01 March 2003 - 09:06 AM

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

#20   erisen

erisen
  • Members
  • 61 posts
  • Real Name:Mehmet Erisen
  • Location:California - USA

Posted 01 March 2003 - 10:03 AM

Quote

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.
GALATASARAY RULES!
ultrAslan - ultrAslan - ultrAslan