vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   two thunbnails size (https://vborg.vbsupport.ru/showthread.php?t=70123)

Lionel 10-03-2004 02:30 AM

two thunbnails size
 
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

Quote:

Originally Posted by nexialys
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:
PHP Code:

if ($width $vboptions['attachthumbssize'] OR $height $vboptions['attachthumbssize']) 

and put this just before:
PHP Code:

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

Quote:

Originally Posted by nexialys
logically, find this:
PHP Code:

if ($width $vboptions['attachthumbssize'] OR $height $vboptions['attachthumbssize']) 

and put this just before:
PHP Code:

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

Quote:

Originally Posted by nexialys
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:

Quote:

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.


All times are GMT. The time now is 02:40 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01197 seconds
  • Memory Usage 1,746KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete