Community Forums 

Main Content

php question

    Feb 01 2014 11:52:39


    Alive & Well

    Join date : 2008-10-01      Posts : 123

    I'm not real knowledgeable with php so I need some help with this change.

    When a person is on my site http://www. yahwehsaliveandwell .com/ and there are multiple products displayed, to see the product page they need to click on the product name. Currently when they click on the thumbnail it just shows a larger picture. Many people are not even seeing the difference so I posted this instruction on the top of the page. People are still not seeing it. So I want to find out how to modify the php file to go to the product page when they click on the thumbnail. If anyone can help with this it would be greatly appreciate. Here is the current code:

    // If there is a larger image, create clickable thumbnail
    if ($varlgimage)
    if ($use_getimg_size == "yes")
    if ($imgsize)
    $dispsmimage = "<a href=\"$URL/" .SB_GO_DIR ."/view.php?image=$varlgimage\" target=\"_blank\" onClick=\"'$URL/" .SB_GO_DIR ."/view.php?image=$varlgimage', 'NewWin', 'resizable=yes,scrollbars=yes,width=$lgwidth,height=$lgheight,left=0,top=0,screenX=0,screenY=0'); PopUp.focus(); return false;\">$smimg</a>";
    // Otherwise, just display small image
    $dispsmimage = "$smimg";
    $dispsmimage .= "<br>";
    return $dispsmimage;

    if (!function_exists("var_zoom"))
    function var_zoom($varimage1, $varimage2, $varimage3, $varlgimage1, $varlgimage2, $varlgimage3)
    $showzoom = 'n';
    if (!empty($varimage1) AND !empty($varlgimage1))
    $showzoom = 'y';
    else if (!empty($varimage2) AND !empty($varlgimage2))
    $showzoom = 'y';
    else if (!empty($varimage3) AND !empty($varlgimage3))
    $showzoom = 'y';
    return $showzoom;

    Feb 01 2014 15:31:43


    Debbie Q

    Join date : 2008-09-18      Posts : 4994

    You are making it too dificult for yourself. Dump the php totally and just link the url to the image.

    <a href=""><img src=""; class="smallimage1" alt="Rye Berries, Organic" title="Rye Berries, Organic" border="0"></a>

    Debbie Q

    Mal's Support:
    GT's Forms and examples:
    Helpful java scripts:
    Shipping help documents:

    My Create-A-Book Publishing -
    Personalized Books, Music CDs and Gifts for all ages and occasions.

    Please help me out and share my site on your networks.

    Feb 01 2014 16:24:06


    Alive & Well

    Join date : 2008-10-01      Posts : 123

    That's just it I don't want to have the link go to the image.

    it's in the php file that came with the host files. Yeah html is much easier but I was told by many on this BB 2 years ago I needed to update my site to a new version and dump the html site.. So here I am. :)

    Al of the other php files I have been able to figure out how to modify. But this one I want them to go to the product detail page instead of the image.

    Feb 01 2014 21:05:57



    Join date : 2013-12-06      Posts : 14

    Maybe might help you, it is a free awesome script.

    Feb 02 2014 15:03:35


    Alive & Well

    Join date : 2008-10-01      Posts : 123

    I found this near the bottom of the original php file. Would this be what is overridden by what I posted above?

    if (!function_exists("var_imglink"))
    function var_imglink($varsmimage, $varmultilink, $varitem, $varalt, $varclass)
    global $URL, $imgwidth, $imgheight;
    if (!empty($varsmimage))
    $dispimglink = "<a href=\"$varmultilink\">";
    if (substr($varsmimage, 0, 7) == "http://")
    $imgname = "$varsmimage";
    $imgname = "$URL/$varsmimage";
    $dispimglink .= "<img src=\"$imgname\" class=\"$varclass\" alt=\"$varalt\" title=\"$varitem\" ";
    if ($imgwidth > 0 OR $imgheight > 0)
    $dispimglink .= "style=\"";
    if ($imgwidth > 0)
    $dispimglink .= "width: " .$imgwidth ."px; ";
    if ($imgheight > 0)
    $dispimglink .= "height: " .$imgheight ."px; ";
    $dispimglink .= "\"";
    $dispimglink .= "border=\"0\"></a><br>";
    return $dispimglink;

    Feb 02 2014 17:24:38


    Alive & Well

    Join date : 2008-10-01      Posts : 123

    Figured it out with the Yahweh's help and my son's Dad's help!

    It was the products_multiple.php file

    I changed

    if (!empty($display_smimage1))
    echo $display_smimage1;
    if (!empty($display_smimage2))
    echo $display_smimage2;
    if (!empty($display_smimage3))
    echo $display_smimage3;


    if (!empty($display_imglink1))
    echo $display_imglink1;

    and it works beautiful!