Uutiset:

Wondering if this will always be free?  See why free is better.

Main Menu
Advertisement:

Changing Avatar Size For One Person

Aloittaja faeriedust, huhtikuu 28, 2011, 04:46:26 IP

« edellinen - seuraava »

faeriedust

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.

kat


Illori


ascaland

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)

faeriedust

I will give it a shot and let you know if it works. Thanks for the reply.

feline

.. or simple change the settings for avatar size, upload YOUR avatar and then restore the settings  :)

kat


faeriedust

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.

ascaland

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?

feline

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...

faeriedust

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.

ascaland

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.

faeriedust

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.

ascaland

If you attach Load.php and/or Profile.php I wont have a problem doing them for ya? ;)

faeriedust

These are the files you requested. I so appreciate your help with this.

ascaland


faeriedust

#16
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.

faeriedust

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?

ascaland

#18
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

faeriedust

#19
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.

geekartist

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

Aleksi "Lex" Kilpinen

Any updates on this? Do you still need assistance or have you been able to figure this out? :)
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Advertisement: