| Re: Image resizing in Xoopspartners |
| by NeoFenix on 2006/1/4 15:08:36 thankz! this hack works perfectly, cos my images are 140 x 140 ... but I wonder ... what if I want it rectangular? I haven't tried anything yet ... but ... fallenturtle: I had the same problem, some time ago, so it has nothing to do with this hack .... I think ... I don't remember how I solve it, but when I do, I tell you. |
| Re: Image resizing in Xoopspartners |
| by snakes on 2005/10/15 1:12:34 I don't have that problem with any of my sites. Is the problem following the hack or did it exist even before? Does the image url start with "http://" ? Even if the image is in your own website you must put the "http://" and not just the path. |
| Re: Image resizing in Xoopspartners |
| by fallenturtle on 2005/10/14 21:21:28 This code works great for me except for one problem. If I go an try to edit a partner, it tells me it can't find the image... I don't have this problem when adding a partner, just when I edit one thats already there. Any ideas? |
| Re: Image resizing in Xoopspartners |
| by snakes on 2005/10/4 12:35:01 Here is a hack that force the resizing to keep the image proportion. index.php: (about line 67) add this code le="color: #000000"><?php $ImageSize = getimagesize($array_partners[$i]["image"]); $ImageWidth = ""; $ImageHeight = ""; if(is_array($ImageSize)) { if($ImageSize[0] >= $ImageSize[1]) $ImageWidth = ($ImageSize[0]>100 ? "100" : $ImageSize[0]); else $ImageHeight = ($ImageSize[1]>100 ? "100" : $ImageSize[1]); } else { $ImageWidth = "100"; } About line 78 Change le="color: #000000"><?php $ImagePartner .= "<img src='".$array_partners[$i]["image"]."' alt='".$array_partners[$i]["url"]."' width='102' height='47' border='0' />"; with le="color: #000000"><?php $ImagePartner .= "<img src='".$array_partners[$i]["image"]."' alt='".$array_partners[$i]["url"]."' ".(!empty($ImageHeight) ? "height="$ImageHeight"" : "width="$ImageWidth"")." border='0' />"; block/partners.php: (about line 46) add this code after le="color: #000000"><?php list($id, $url, $image, $title) = $xoopsDB->fetchrow($result); le="color: #000000"><?php $ImageSize = getimagesize($image); $ImageWidth = ""; $ImageHeight = ""; if(is_array($ImageSize)) { if($ImageSize[0] >= $ImageSize[1]) $ImageWidth = ($ImageSize[0]>100 ? "100" : $ImageSize[0]); else $ImageHeight = ($ImageSize[1]>100 ? "100" : $ImageSize[1]); } else { $ImageWidth = "100"; } $partners['dimensions'] = (!empty($ImageHeight) ? "height="$ImageHeight"" : "width="$ImageWidth""); templates/blocks/xoopspartners_block_site.html: (about line 40). Replace: le="color: #000000"><?php <img src="<{$partner.image}>" width="102" border="0" alt="<{$partner.url}>" <{$block.fadeImage}> /><br /> with: le="color: #000000"><?php <img src="<{$partner.image}>" <{$partner.dimensions}> border="0" alt="<{$partner.url}>" <{$block.fadeImage}> /><br /> Now go to admin section and click on the module upgrade button |
| Re: Image resizing in Xoopspartners |
| by voddie on 2005/5/28 16:37:27 Hi again Thanks found it in the index.php under Quote: $ImagePartner .= "<img src='".$array_partners[$i]["image"]."' alt='".$array_partners[$i]["url"]."' width='102' height='47' border='0' />"; Thanks for your help Voddie |