Random pic size

Phoca Gallery modules - modules for Phoca Gallery extension
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Hi, there is no poss

Post by Jan »

Hi, there is no possibility to resize the size in the module yet

Jan
If you find Phoca extensions useful, please support the project
susa
Phoca Newbie
Phoca Newbie
Posts: 8
Joined: 27 Apr 2009, 17:06

Re: Random pic size

Post by susa »

is it still the case that you cannot change the size of the random picture?
Thanks
majkel
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 13 May 2009, 20:53

Re: Random pic size

Post by majkel »

Here is my method ( if you want to use it, you do it on your risk ;) )

You have to open 'modules/mod_phocagallery_random_image/mod_phocagallery_random_image.php' and change some lines. I wanted size 150x150px and I had change:

Code: Select all

$imageWidth 	= 100;
$imageHeight	= 100;
$imageWidthBg = 100;
$imageHeightBg= 100;
$boxImageHeight = 100;
$boxImageWidth = 120;
to:

Code: Select all

$imageWidth 	= 150;
$imageHeight	= 150;
$imageWidthBg = 150;
$imageHeightBg= 150;
$boxImageHeight = 150;
$boxImageWidth = 170;
and

Code: Select all

			if ($width > $height)
			{
				if ($width > 100)
				{
					$imageWidth		= 100;
					$rate 			= $width / 100;
					$imageHeight	= $height / $rate;
				}
				else
				{
					$imageWidth		= $width;
					$imageHeight	= $height;
				}
			}
			else
			{
				if ($height > 100)
				{
					$imageHeight	= 100;
					$rate 			= $height / 100;
					$imageWidth 	= $width / $rate;
				}
				else
				{
					$imageWidth		= $width;
					$imageHeight	= $height;
				}
			}
to

Code: Select all

			if ($width > $height)
			{
				if ($width > 150)
				{
					$imageWidth		= 150;
					$rate 			= $width / 150;
					$imageHeight	= $height / $rate;
				}
				else
				{
					$imageWidth		= $width;
					$imageHeight	= $height;
				}
			}
			else
			{
				if ($height > 150)
				{
					$imageHeight	= 150;
					$rate 			= $height / 150;
					$imageWidth 	= $width / $rate;
				}
				else
				{
					$imageWidth		= $width;
					$imageHeight	= $height;
				}
			}
and

Code: Select all

		if ( $image_background_shadow != 'none' ) {
			$boxImageHeight = $boxImageHeight + 18;
			$imageWidthBg 	= 118;	
			$imageHeightBg	= 118;
		}
to

Code: Select all

		if ( $image_background_shadow != 'none' ) {
			$boxImageHeight = $boxImageHeight + 18;
			$imageWidthBg 	= 168;	
			$imageHeightBg	= 168;
		}
I'am not sure do you have to change so much but it works! ;)

And one more thing - you have to change the size of the phocagallery shadow: shadow2.png and shadow2.gif from 200px X 200px to yourwidth X yourheight. You would find this images in 'components/com_phocagallery/assets/images/'
PhyTonX
Phoca Member
Phoca Member
Posts: 11
Joined: 13 May 2009, 00:51

Re: Random pic size

Post by PhyTonX »

thanks it works :)
cool wallpapers site: http://www.wallpaperszone.ws with no ads.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Random pic size

Post by Jan »

Ok. Solved.

majkel
Thank you for this guide.

Jan
If you find Phoca extensions useful, please support the project
majkel
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 13 May 2009, 20:53

Re: Random pic size

Post by majkel »

I'm glad, that I could help :)
fairwea1
Phoca Member
Phoca Member
Posts: 10
Joined: 08 May 2009, 00:44

Re: Random pic size

Post by fairwea1 »

Hi,

I tried this and came up with this:

Any idea what I did wrong? Or do I need to recreate thumbnails?

Thanks,
Eric
majkel
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 13 May 2009, 20:53

Re: Random pic size

Post by majkel »

fairwea1 wrote:Hi,

I tried this and came up with this:

Any idea what I did wrong? Or do I need to recreate thumbnails?

Thanks,
Eric
With what?
fairwea1
Phoca Member
Phoca Member
Posts: 10
Joined: 08 May 2009, 00:44

Re: Random pic size

Post by fairwea1 »

Sorry about that:

http://anviledge.com/
majkel
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 13 May 2009, 20:53

Re: Random pic size

Post by majkel »

There are 3 posibilities.

1. You didn't change the graphics with the shadows.
2. You changed the graphics with the shadows but you have bad settings in the panel
3. You made some changes in CSS file(s) which give you this effect.

If you did everything as I wrote, you shouldn't have any problems.

Sorry for my english ;)
Post Reply