Skip to main content
Images not resized into signatures for guests Started by radu81 · · Read 3490 times 0 Members and 3 Guests are viewing this topic. previous topic - next topic

Images not resized into signatures for guests

I have set images in the signature to be resized and this is working fine, but I have noticed that as guest I see the full dimension of image in the signature. Is this a bug or is something wrong with my forum?
Last Edit: January 24, 2016, 12:41:14 pm by radu81
sorry for my bad english

Re: Images signatures for guests

Reply #1

 emanuele feels he forgot something while working on simplifying the bbc resize... O:-)

ETA: this code change is not necessary, see messages below
In Load.php, try adding:
Code: [Select]

if (!empty($modSettings['signature_max_image_width']) || !empty($modSettings['signature_max_image_height']))
{
$context['html_headers'] .= '
<style>
.signature .bbc_img.resized {' . (!empty($modSettings['signature_max_image_width']) ? '
max-width:' . $modSettings['signature_max_image_width'] . 'px;' : '') . (!empty($modSettings['signature_max_image_height']) ? '
max-height:' . $modSettings['signature_max_image_height'] . 'px;' : '') . '
}
</style>';
}


just before:
Code: [Select]
	// Any files to include at this point?
call_integration_include_hook('integrate_theme_include');
Last Edit: January 24, 2016, 04:39:54 pm by emanuele
Bugs creator.
Features destroyer.
Template killer.

Re: Images signatures for guests

Reply #2

Thanks Emanuele, I tried but nothing changed, images are still showed at 100%.
you can see it here: skodaclub.it/index.php?topic=5685.msg92923#msg92923
sorry for my bad english

Re: Images not resized into signatures for guests

Reply #3

Never mind, that code is not necessary: did you run the task to update the signatures based on the new settings?
Bugs creator.
Features destroyer.
Template killer.

Re: Images not resized into signatures for guests

Reply #4

I did not run the task, should I make the edit and then run the task?
sorry for my bad english

Re: Images not resized into signatures for guests

Reply #5

Yep, there is a blue notice at the "top" of the settings (below the menu) with the instructions (well, just a "press here").
It is like that because signatures have more than just image size limitations and all of them are not fixable with just css. ;)
Bugs creator.
Features destroyer.
Template killer.

Re: Images not resized into signatures for guests

Reply #6

I tried with original Load.php and then run the task but did not help. I tried with the edit you suggest on Load.php and then run the task but nothing changed. Could it be something related to fancybox addon? The fancybox addon is opening signature images into lightbox, as guest and also as normal user
sorry for my bad english

Re: Images not resized into signatures for guests

Reply #7

It is indeed:
https://github.com/Spuds/Elk_FancyBox/blob/master/sources/fb4elk.subs.php#L237
for guests width and height are not set.
Just remove that condition and make the sizes be always set and it should fix it:
Code: [Select]
			if ($user_info['is_guest'])
$style = '';
else
$style = 'width:{width};height:{height}';
should become just:
Code: [Select]
			$style = 'width:{width};height:{height}';
Bugs creator.
Features destroyer.
Template killer.

Re: Images not resized into signatures for guests

Reply #8

That worked perfectly! Thank you for your help. Maybe @Spuds will want to add this into Fancybox
sorry for my bad english

Re: Images not resized into signatures for guests

Reply #9

I'm not sure what I need to add or what its not doing that it should  O:-)

 

Re: Images not resized into signatures for guests

Reply #10

At https://github.com/Spuds/Elk_FancyBox/blob/master/sources/fb4elk.subs.php#L237 FancyBox is texting if the user is gues or not, if it is guest the whole image without size limits is shown, if it is a registered user the resized image is shown (i.e. width:100px;height:100px).
I'm not sure why guests are not allowed to see smaller (or bigger actually :P) images, though this breaks the image limiting is signatures because it relies on the setting of width and height of the img tag.

I'm not sure if this sounds any better, but replacing the code I posted about should fix it (unless there is a reason to the different displaying ;D).
Also, it's for sure not the best fix, but... :P
Bugs creator.
Features destroyer.
Template killer.

Re: Images not resized into signatures for guests

Reply #11

Quote from: emanuele – Also, it's for sure not the best fix, but... :P
BUT it works  ;)
sorry for my bad english