SimplePortal

Customization => Custom Coding => Topic started by: vas on April 25, 2010, 10:37:43 PM

Title: Image Size change in Board News Block
Post by: vas on April 25, 2010, 10:37:43 PM
I want to change the image size (width) in the board news block. I want it to cover the entire block space (leaving some space for margin). How to do it.

Advance Thanks for Help.
Title: Re: Image Size change in Board News Block
Post by: ccbtimewiz on April 25, 2010, 11:36:38 PM
Which image in particular?
Title: Re: Image Size change in Board News Block
Post by: vas on April 26, 2010, 09:28:46 AM
Which image in particular?

Suppose, I have posted an image in the topic in the first post. I understand the "Board News" block displays after resizing. It appears small. There is enough space to have a bigger image which will also look attractive.
Title: Re: Image Size change in Board News Block
Post by: 130860 on April 26, 2010, 10:59:55 AM
the image is resize by default to 300 x 300px   if want it larger open you portal.js file   find this:

Code: [Select]
function sp_image_resize()
{
var possible_images = document.getElementsByTagName("img");
for (var i = 0; i < possible_images.length; i++)
{
if (possible_images[i].className != (portal_smf_version == 1.1 ? "sp_article" : "bbc_img sp_article"))
continue;

var temp_image = new Image();
temp_image.src = possible_images[i].src;

if (temp_image.width > 300)
{
possible_images[i].height = (300 * temp_image.height) / temp_image.width;
possible_images[i].width = 300;
}
else
{
possible_images[i].width = temp_image.width;
possible_images[i].height = temp_image.height;
}
}


and change:

possible_images.height = (300 * temp_image.height) / temp_image.width;
         possible_images.width = 300;


change the 300 for something bigger.
Title: Re: Image Size change in Board News Block
Post by: vas on April 26, 2010, 10:45:44 PM
the image is resize by default to 300 x 300px   if want it larger open you portal.js file   find this:
:
:

and change:

possible_images.height = (300 * temp_image.height) / temp_image.width;
         possible_images.width = 300;


change the 300 for something bigger.

I changed to 450. Thanks. It works.
Title: Re: Image Size change in Board News Block
Post by: andy12gr on June 19, 2010, 04:36:05 AM
Thank you very much 130860
SimplePortal 2.3.8 © 2008-2024, SimplePortal