Hello,
I'm good at following directions.. bad at making them up.. lol
I searched the internet looking for help and found phpbuilder.com I am thankful that there is such a place for those who numb their brains trying to learn this stuff.
There is a file in shop-script (a commerce site) that I am trying to edit. I want to change the behavior of the images and when one clicks on them.
Currently, the main or primary product image is the only image that can be enlarged.
If you click on other images for the same product it will replace the primary image and then you must click on it again to enlarge the picture. This is quite annoying. I want to be able to simply enlarge the image (having it open up a new window just like the primary image does) as apposed to replacing the primary image first before allowing you to enlarge it.
I'm hoping my narrative above will help you understand the code below.
I hope I have explained what it is that I want to change. I really appreciate anyone who could offer some assistance as to what to change in this code.
if ( isset($_GET["picture_id"]) )
{
$picture = db_query("select filename, thumbnail, enlarged from ".
PRODUCT_PICTURES." where photoID=".(int)$_GET["picture_id"] );
$picture_row = db_fetch_row( $picture );
}
else if ( !is_null($a["default_picture"]) )
{
$picture = db_query("select filename, thumbnail, enlarged from ".
PRODUCT_PICTURES." where photoID=".$a["default_picture"] );
$picture_row = db_fetch_row( $picture );
}
else
{
$picture = db_query(
"select filename, thumbnail, enlarged, photoID from ".PRODUCT_PICTURES.
" where productID='".$productID."'" );
if ( $picture_row = db_fetch_row( $picture ) )
$a["default_picture"]=$picture_row["photoID"];
else
$picture_row=null;
}
if ( $picture_row )
{
$a["picture"] = $picture_row[ 0 ];
$a["thumbnail"] = $picture_row[ 1 ];
$a["big_picture"] = $picture_row[ 2 ];
}
else
{
$a["picture"] = "";
$a["thumbnail"] = "";
$a["big_picture"] = "";
}