bug fix #843

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

bug fix #843

Chris Larson-2
Title :  Resize the product picture.
Description :  Option to automatically resize the product picture to a set width. Then have it so that clicking on the picture pops up the original photo at whatever the original size was in a new window. That way a large picture in the product description doesn't force you to scroll.
 
the following code address this problem.
 
--modify tables--
field :: mirror imagename in most respects, only diff is id# and sequence, id is autonumbered,
 sequence is 2 .. it will be displayed after imagename (who's sequence is 1)

profile2field :: insert fieldid where fieldid = field.imagename.fieldid, inserted row tabid=14
 (14 is for product module), visible=0, readonly=1, profileid (on my comp, i have    

inserted 4 rows, all the same except profileid = 1,2,3,4 .. so 4 new rows total each same  except for

profileid (this may be because i currently have 4 users?)

def_org_field :: insert fieldid where fieldid = field.imagename.fieldid, inserted row tabid=14
 (14 is for product module), visible=0, readonly=1

changes
utils.php
--getDetailViewOutputHtml()  modify the following uitype elseif block to reflect the following
---(includes an if/else statement to check for the scaleimage field)

 elseif($uitype == 69)
 {
   
        $custfld .= '<td width="20%" valign="top" class="dataLabel">'.$mod_strings[$fieldlabel].':</td>';
  if($col_fields[$fieldname] != '')
  {
   $imgpath = "test/product/".$col_fields[$fieldname];
   
                 $custfld .= '<td width="30%" valign="top" class="dataField">';
                 
                    if($col_fields["scaleimage"] == 1)
                    {
                        $custfld .= '<a target="_blank" href="'.$imgpath.'">';
                        $custfld .= '<img width="250px" height="180px" src="'.$imgpath.'" border="0">';    //or whatever width/height is appropriate
                        $custfld .= '</a>';
                    }
                    else
                       $custfld .= '<img src="'.$imgpath.'" border="0">';
                       
                 $custfld .= '</td>';
  }
  else
  {
                 $custfld .= '<td width="30%" valign="top" class="dataField"></td>';
  }
  
 }

the database changes will include the scaleimage attribute to be included when looping through block information that is listed in the detail/edit view, it will be listed in block 6 along w/ the file image info.  the if/else block will create a thumbnail image (when the scaleimage attribute has been checked in editview, else it will display the original image at actual size) that when clicked on will display the fullsize image in a new window.  hope this helps
 
---chris