Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Aiheen aloitti: faeriedust - huhtikuu 28, 2011, 04:46:26 IP

Otsikko: Changing Avatar Size For One Person
Kirjoitti: faeriedust - huhtikuu 28, 2011, 04:46:26 IP
Is there any way to enlarge only my avatar and not have any others affected? I would like mine to be larger while keeping the size of the others intact.
Otsikko: Re: Changing Avatar Size For One Person
Kirjoitti: kat - huhtikuu 28, 2011, 04:54:07 IP
Not with some coding, I believe.
Otsikko: Re: Changing Avatar Size For One Person
Kirjoitti: Illori - huhtikuu 28, 2011, 04:57:42 IP
Lainaus käyttäjältä: K@ - huhtikuu 28, 2011, 04:54:07 IP
Not without some coding, I believe.
Otsikko: Re: Changing Avatar Size For One Person
Kirjoitti: ascaland - huhtikuu 28, 2011, 06:01:32 IP
Try the following instructions.

In Load.php, replace,
// If we're always html resizing, assume it's too large.
if ($modSettings['avatar_action_too_large'] == 'option_html_resize' || $modSettings['avatar_action_too_large'] == 'option_js_resize')


With,
// If we're always html resizing, assume it's too large.
if (!$user_info['is_admin'] && ($modSettings['avatar_action_too_large'] == 'option_html_resize' || $modSettings['avatar_action_too_large'] == 'option_js_resize'))


Now in Profile.php, replace,
function makeAvatarChanges($memID, &$post_errors)
{
global $modSettings, $sourcedir, $db_prefix;


with,
function makeAvatarChanges($memID, &$post_errors)
{
global $modSettings, $sourcedir, $db_prefix, $user_info;


Replace,
// Should we check dimensions?
elseif (!empty($modSettings['avatar_max_height_external']) || !empty($modSettings['avatar_max_width_external']))


With,
// Should we check dimensions?
elseif (!$user_info['is_admin'] && (!empty($modSettings['avatar_max_height_external']) || !empty($modSettings['avatar_max_width_external'])))


And finally replace,
// Check whether the image is too large.
elseif ((!empty($modSettings['avatar_max_width_upload']) && $sizes[0] > $modSettings['avatar_max_width_upload']) || (!empty($modSettings['avatar_max_height_upload']) && $sizes[1] > $modSettings['avatar_max_height_upload']))


With,
// Check whether the image is too large.
elseif (!$user_info['is_admin'] && ((!empty($modSettings['avatar_max_width_upload']) && $sizes[0] > $modSettings['avatar_max_width_upload']) || (!empty($modSettings['avatar_max_height_upload']) && $sizes[1] > $modSettings['avatar_max_height_upload'])))


Cheap hax.  8)
Otsikko: Re: Changing Avatar Size For One Person
Kirjoitti: faeriedust - huhtikuu 28, 2011, 10:18:29 IP
I will give it a shot and let you know if it works. Thanks for the reply.
Otsikko: Re: Changing Avatar Size For One Person
Kirjoitti: feline - huhtikuu 29, 2011, 11:09:20 AP
.. or simple change the settings for avatar size, upload YOUR avatar and then restore the settings  :)
Otsikko: Re: Changing Avatar Size For One Person
Kirjoitti: kat - huhtikuu 29, 2011, 12:30:41 IP
Now, why didn't I think of that?
Otsikko: Re: Changing Avatar Size For One Person
Kirjoitti: faeriedust - huhtikuu 29, 2011, 04:04:04 IP
Thanks feline, but that doesn't do it. If I change the size of mine, everyone's get changed also. If I put it back the way it was, all including mine gets changed. I'm at a loss with this one.
Otsikko: Re: Changing Avatar Size For One Person
Kirjoitti: ascaland - huhtikuu 29, 2011, 04:05:07 IP
Lainaus käyttäjältä: faeriedust - huhtikuu 29, 2011, 04:04:04 IP
Thanks feline, but that doesn't do it. If I change the size of mine, everyone's get changed also. If I put it back the way it was, all including mine gets changed. I'm at a loss with this one.

Have you tried my instructions?
Otsikko: Re: Changing Avatar Size For One Person
Kirjoitti: feline - huhtikuu 30, 2011, 01:26:28 IP
Lainaus käyttäjältä: faeriedust - huhtikuu 29, 2011, 04:04:04 IP
Thanks feline, but that doesn't do it. If I change the size of mine, everyone's get changed also. If I put it back the way it was, all including mine gets changed. I'm at a loss with this one.
You have UPLOAD your avatar? Any other don't work.
I have this done on my server...
Otsikko: Re: Changing Avatar Size For One Person
Kirjoitti: faeriedust - huhtikuu 30, 2011, 02:09:20 IP
I've followed Project Evolutions instructions but that didn't work. Every time I try to change the size, it still does it for all avatars not just mine. I even tried some of my own tricks too. No cigar.  I'm totaly at a loss now.
Otsikko: Re: Changing Avatar Size For One Person
Kirjoitti: ascaland - huhtikuu 30, 2011, 02:24:26 IP
Lainaus käyttäjältä: faeriedust - huhtikuu 30, 2011, 02:09:20 IP
I've followed Project Evolutions instructions but that didn't work. Every time I try to change the size, it still does it for all avatars not just mine. I even tried some of my own tricks too. No cigar.  I'm totaly at a loss now.

After you finished all the code changes (can you double check you made all the changes), did you upload a new avatar? I think SMF resizes the avatar you uploaded previously then stores it which is why the size wouldnt change.
Otsikko: Re: Changing Avatar Size For One Person
Kirjoitti: faeriedust - toukokuu 01, 2011, 09:51:56 AP
I did the code changes, but since I've never done this before, I keep finding mistakes. Every time I go over it, I find another thing I goofed up on. I'm really not good at this at all. I'll keep trying but won't upload the file until I believe it's right. Don't want to ruin it for everyone.
Otsikko: Re: Changing Avatar Size For One Person
Kirjoitti: ascaland - toukokuu 01, 2011, 10:39:37 AP
If you attach Load.php and/or Profile.php I wont have a problem doing them for ya? ;)
Otsikko: Re: Changing Avatar Size For One Person
Kirjoitti: faeriedust - toukokuu 01, 2011, 01:42:16 IP
These are the files you requested. I so appreciate your help with this.
Otsikko: Re: Changing Avatar Size For One Person
Kirjoitti: ascaland - toukokuu 01, 2011, 01:51:04 IP
Give these a shot.
Otsikko: Re: Changing Avatar Size For One Person
Kirjoitti: faeriedust - toukokuu 01, 2011, 05:10:44 IP
I put the new php's in place and uploaded a new avatar, and you can see when it loads the avatar, it's bigger. But as soon as the topic fully loads, it goes right back to the small size. (sigh) I think this is hopeless.
Otsikko: Re: Changing Avatar Size For One Person
Kirjoitti: faeriedust - toukokuu 02, 2011, 09:01:58 IP
Just thinking....should the sizes in the admin avatars section be changed to any other setting outside of the default? Would that make any difference?
Otsikko: Re: Changing Avatar Size For One Person
Kirjoitti: ascaland - toukokuu 02, 2011, 09:10:00 IP
Lainaus käyttäjältä: faeriedust - toukokuu 02, 2011, 09:01:58 IP
Just thinking....should the sizes in the admin avatars section be changed to any other setting outside of the default? Would that make any difference?

I will play around with the files I attached below to make sure I didnt do anything wrong... Right after I finish a paragraph of my essay.  8)

Hmm, I replaced my files and they seem to work as intended with default settings on a fresh new install of SMF.
http://rsnull.host56.com/smf/index.php?topic=4244.0
Otsikko: Re: Changing Avatar Size For One Person
Kirjoitti: faeriedust - toukokuu 05, 2011, 09:41:32 IP
I guess I'll have to change back to the default sizes, if I can remember them now, and give that a shot. Thanks.

I just noticed that when I load a topic, the avatar comes in the size that I want it to, but then immediately changes back to the small one. Strange.
Otsikko: Re: Changing Avatar Size For One Person
Kirjoitti: geekartist - toukokuu 15, 2011, 03:46:29 IP
I've been helping faeriedust with this. I'm experiencing the same issue she is.

Seems to me the easiest way to do this would be to add a CSS class to moderator avatars and then just change the stylesheet. I'm not entirely sure where that would be set in SMF though. I was thinking post.template. Doesn't help that I'm great hacking other people's PHP, but I don't tend to write my own to be worth much on that front. :-P
Otsikko: Re: Changing Avatar Size For One Person
Kirjoitti: Aleksi "Lex" Kilpinen - kesäkuu 13, 2011, 05:30:15 AP
Any updates on this? Do you still need assistance or have you been able to figure this out? :)