We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
[ C ] Avatar Resize
Topic Started: Jul 24 2013, 10:46 PM (614 Views)
Zinnoh
Member Avatar
Perfume Mist Pirates ♥..♪
[ *  * ]
Could someone do something that gives me a way to give specific groups or all groups a larger avatar size other than the given limit?

I want specific groups to be able to have avatar's size of 170 x 300

250 x 250 is not enough for the purposes I have for the site.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Admin CP Posted Image Themes Posted Image Board Template Posted Image Below the Board
Code:
 
<script type="text/javascript">
//<![CDATA[
function addGroup(groupName) {
$('dl.user_info').each(function () {
if ($(this).find('dt:contains(Group:)').next('dd').text() === groupName) {
$(this).addClass('big_avatar');
}

if ($(this).hasClass('big_avatar')) {
$(this).parents('td.c_user').find('div[style*="max-"], img.avatar, img.member').css({
'width': '170px',
'height': '300px',
'max-width': '170px',
'max-height': '300px'
});
}
});
}

addGroup('GROUP_NAME');
addGroup('GROUP_NAME');
addGroup('GROUP_NAME');
//]]>
</script>
Change GROUP_NAME as necessary. You can have as many or as few of the addGroup lines as you please.
Offline Profile Goto Top
 
Zinnoh
Member Avatar
Perfume Mist Pirates ♥..♪
[ *  * ]
Cory
Jul 25 2013, 07:21 AM
Admin CP Posted Image Themes Posted Image Board Template Posted Image Below the Board
Code:
 
<script type="text/javascript">
//<![CDATA[
function addGroup(groupName) {
$('dl.user_info').each(function () {
if ($(this).find('dt:contains(Group:)').next('dd').text() === groupName) {
$(this).addClass('big_avatar');
}

if ($(this).hasClass('big_avatar')) {
$(this).parents('td.c_user').find('div[style*="max-"], img.avatar, img.member').css({
'width': '170px',
'height': '300px',
'max-width': '170px',
'max-height': '300px'
});
}
});
}

addGroup('GROUP_NAME');
addGroup('GROUP_NAME');
addGroup('GROUP_NAME');
//]]>
</script>
Change GROUP_NAME as necessary. You can have as many or as few of the addGroup lines as you please.

Thanks. But... There's a problem. It seems to be stretching the avatar rather than using it's actual size. It seems to also change to the desired size when I refresh the page but not always. It stretches the image as well.
Check it out here: http://w11.zetaboards.com/Onepiecexeon/topic/9008223/1/#new
I'll leave it that way so that you can see. I hope you can find a solution.

EDIT: I figured out what the problem was. It seems that the code you gave me only works for avatars exactly the size of 270 x 300. May I ask for a modification/change?
Edited by Zinnoh, Jul 26 2013, 09:20 AM.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Code:
 
'width': '170px',
'height': '300px',
You can remove those lines so it only sets a max width and height.
Offline Profile Goto Top
 
Zinnoh
Member Avatar
Perfume Mist Pirates ♥..♪
[ *  * ]
Cory
Jul 26 2013, 10:54 AM
Code:
 
'width': '170px',
'height': '300px',
You can remove those lines so it only sets a max width and height.

Okay, gave it a try and it didn't work. Seems like you know what I wanted to request though.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
The width and height property would give all avatars the same dimensions. The max-width and max-height property would set a maximum width and height on the avatars so the images will be no larger than the max width and height values given. The max-width and max-height properties may scale the image.
Offline Profile Goto Top
 
Zinnoh
Member Avatar
Perfume Mist Pirates ♥..♪
[ *  * ]
Cory
Jul 26 2013, 11:26 AM
The width and height property would give all avatars the same dimensions. The max-width and max-height property would set a maximum width and height on the avatars so the images will be no larger than the max width and height values given. The max-width and max-height properties may scale the image.

Alright, perfect. Thanks million for the help, Cory. You're an awesome coder.
Offline Profile Goto Top
 
Moonface
Member Avatar


Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Closed Requests · Next Topic »
Locked Topic