Menu Content

Shopping Cart

cart
Your Cart is currently empty.

Currencies Accepted


Newsletter

Subscribe to our newsletter


Name:

Email:

Like it? Share it!

Find Us Elsewhere

Follow us on Twitter

Home Support Forum Featured Items Modules Thumbnail resize with uniform widths: Mo...

 Spiral Scripts Support Forum :: Featured Items Modules
Welcome Guest   [Register]  [Login]
 Subject :Thumbnail resize with uniform widths: Mod Featured Items.. 19-10-2009 02:51:09 
Mark Stephens
Fresher
Joined: 19-10-2009 00:52:28
Posts: 1
Location
<p>I wanted to have all my thumbnails with the same width in Mod Featured Items.  So I tweaked the helper.php file to the best of my ability.  Specifically by making the if/else statements regarding the file's width/height the same.</p>
<p>Would you happen to have a more efficient method (code wise) of doing so?  Here's the change I made:</p>
<p>if (($width > $height) && ($width > $maxsize ))<br /> {<br /> $ratio = $maxsize/$width;<br /> $newwidth = $maxsize;<br /> $newheight = intval($height * $ratio);<br /> }<br /> else if (($width <= $height) && ($height > $maxsize))<br /> {<br /> <strong>$ratio = $maxsize/$width;<br /> $newwidth = $maxsize;<br /> $newheight = intval($height * $ratio);</strong><br /> }</p>
IP Logged
 Subject :Re: Thumbnail resize with uniform widths: Mod Featured Items.. 19-10-2009 10:25:20 
boggler
Spiral Scripts Support
Joined: 18-08-2009 10:14:13
Posts: 213
Location
<p>Hi</p>
<p>thanks for your post</p>
<p> </p>
<p>if ($width > $maxsize )<br /> {<br /> $ratio = $maxsize/$width;<br /> $newwidth = $maxsize;<br /> $newheight = intval($height * $ratio);<br /> }<br />else<br />{<br /> $newwidth = $width;<br /> $newheight = $height;<br />}</p>
<p> </p>
<p>should do it.</p>
<p> </p>
<p>Thanks for reminding me about this point - I do plan in a later release to introduce a better way of handing the images so this is an option without needing to hack the code but in the meantime this should work.</p>
IP Logged
susan subway boggler
Page # 


Powered by ccBoard


 
 

VirtueMart Featured Products Grid

Switch View

*****Now compatible with Joomla 1.6******* A module extension for the the Joomla 1.5 and Joomla 1.6 CMS. It plays a random list of mp3s using the Flash media player.

£12.00
*****Now compatible with Joomla 1.6******* A module extension for the the Joomla 1.5 + 1.6 CMS. It displays a short excerpt from articles in a selected category or section, or from a specified list of articles, with link and optional thumbnail image.

£10.00


*****Now compatible with Joomla 1.6******* A Flash puzzle game for the Joomla! content management system. This would be suitable for a site aimed at children. Compatible with Joomla 1.5 and Joomla 1.6.

£10.00


A featured items module that shows selected entries from the SOBI2 business index.

£12.00



 
 

fitness