PDA

View Full Version : two thunbnails size


Lionel
10-03-2004, 02:30 AM
I set my thumbnails width at 300 and I display them directly in the postbit, vertically.

However, image smaller than 300 width are not linked and as such, therefore display below the post as designed by Jelsoft, which is fine.

Where in function fetch_thumbnail_from_image () in functions_image.php can I put this:

if ($width < $vboptions['attachthumbssize'])
$new_width = "100";

So images smaller than the vbdefined thumbsize of 300 get thumb at 100 width? Or is that possible at all?

nexialys
10-03-2004, 02:37 AM
you just have the answer to your request... this is exactly the kind of hack that make the life easier.. ;)

Lionel
10-03-2004, 03:04 AM
you just have the answer to your request... this is exactly the kind of hack that make the life easier.. ;)
No not really. I might know what to put, but I do not know WHERE to place it, and that was my question :-)

nexialys
10-03-2004, 03:23 AM
logically, find this:
if ($width > $vboptions['attachthumbssize'] OR $height > $vboptions['attachthumbssize'])and put this just before:if ($width < $vboptions['attachthumbssize'])
{
$vboptions['attachthumbssize'] = '100';
}so if the files are bigger, the new default for thumbnails will be lowered to your prefered size before the treatment...

...and you can count you as a lucky guy, i never give codes for free usually.. i suppose it's the time of night...

Lionel
10-03-2004, 03:38 AM
logically, find this:
if ($width > $vboptions['attachthumbssize'] OR $height > $vboptions['attachthumbssize'])and put this just before:if ($width < $vboptions['attachthumbssize'])
{
$vboptions['attachthumbssize'] = '100';
}so if the files are bigger, the new default for thumbnails will be lowered to your prefered size before the treatment...

...and you can count you as a lucky guy, i never give codes for free usually.. i suppose it's the time of night...
That work! About me pushing my luck a bit? What if I want that "100" thumb size to be for anything that is below the first post? My approach to that was going to be to reset all thumbs at 100 and duplicate attachment.php into attachement2.php which will call functions_image2.php where I would hardcode the values, and then use conditionals in the templates <if condition="$post[postcount] == 1"> to call attachment2.php (with the 300 width). This way, the first post which is the main article will have the big image and all subsequent posts would be at 100, regardless of size. Is that feasible?

nexialys
10-03-2004, 03:48 AM
hum.. possible, but not with your luck against me.. lol... hum..

this is a more complicated feature request, maybe adding a value to call the attachements from the firstpost id, and add it to the function entries ... but i will not go farther $... someone else maybe

Lionel
10-03-2004, 04:59 AM
:rolleyes: Aha! Once I rebuilt the thumbnails, they all showed up at 100 with above code. I got fooled in my test.

nexialys
10-03-2004, 10:25 AM
hum... strange, it worked on my server... are you sure you have images that have +100px ?!

Lionel
10-03-2004, 12:46 PM
hum... strange, it worked on my server... are you sure you have images that have +100px ?!

positive about that. Up to 600 pixels.

But:

???
I got this in my email and I can't find it here:

hum... $imageinfo[0] instead of $width would do the job, as the $width is called in cacheback... so it's not taken... sorry, my error!

nexialys
10-03-2004, 01:31 PM
hum... forget about it, i updated the post after the subscription was sent to you.. ;) but you can try it, it can't be wrong.

Lionel
10-03-2004, 04:20 PM
I ended up doing it with conditionals and it is perfect. :)