Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
themes-topic
Avatars display question
Avatar
Conrad_Farlow
Sheffield, UK
Member
Free Members
sp_UserOfflineSmall Offline
Aug 3, 2011 - 9:50 am

Not sure if I should ask customisation questions for themes here at this stage so feel free to tell me to go away for a while if you are too busy but........

I would like the avatar display size at the top of the Group view, forum and topic view and topic view to be different from that used at the side of the posts. How would I best go about this?

My thinking is that I don't want to use up much real estate at the top of pages but I like decent sized avatars for the actual posts in topic view.

Conrad

Avatar
Lee H
Coastal New England (USA)
Member
Free Members
sp_UserOfflineSmall Offline
Aug 3, 2011 - 9:56 am

Check out function sp_UserAvatar() in 

wp-content/plugins/simple-press/forum/content/sp-common-view-functions.php

This function accepts arguments, including the size. If no size is specified, the function will use the size you set in your admin backend.

Avatar
Lee H
Coastal New England (USA)
Member
Free Members
sp_UserOfflineSmall Offline
Aug 3, 2011 - 10:09 am

For example:

The avatar located in the top left code is in your templates spHead.php.

    # Start the 'userInfo' section
    # ----------------------------------------------------------------------
    sp_SectionStart('tagClass=spPlainSection', 'userInfo');
        sp_UserAvatar('tagClass=spImg spLeft');

We then alter it to add the size argument (I set it at 32), or will default to the options size.

    # Start the 'userInfo' section
    # ----------------------------------------------------------------------
    sp_SectionStart('tagClass=spPlainSection', 'userInfo');
        sp_UserAvatar('tagClass=spImg&size=32 spLeft');

If you refer to the actual function we are calling that I referenced in the last post, you can see what arguments it will accept, and the defaults it will choose if you don't specify anything.

Avatar
Conrad_Farlow
Sheffield, UK
Member
Free Members
sp_UserOfflineSmall Offline
Aug 3, 2011 - 10:43 am

Great stuff Lee, is this stuff documented anywhere or did you just find it by poking around? I've set it to 50 in spHead for my theme and I reckon that its perfect now.

Conrad

Avatar
Lee H
Coastal New England (USA)
Member
Free Members
sp_UserOfflineSmall Offline
Aug 3, 2011 - 11:03 am

No docs yet [Image Can Not Be Found]

But, in my case it's the best way for me to learn. Keeps me from reading everything, and absorbing little. If I actually have to figure out and understand, it sticks.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Aug 3, 2011 - 2:33 pm

This WILL be documented. Not the most fun part but absolutely necessary..

andy-signature.png
YELLOW
SWORDFISH
Avatar
nirok
Member
Free Members
sp_UserOfflineSmall Offline
Dec 7, 2011 - 2:46 pm

This is an awesome forum software, just moved from phpbb. I'm looking at the avatars at the moment, are there any automatic resizing options yet to fit the different areas on the forum? If not i'm wondering if timthumb would work well here? I just played around with the avatar uploading and noticed that the user needs to get the picture the right size which is an annoying issue we had with phpbb untill I installed a mod which automatically resized and never rejected a users image... 

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Dec 7, 2011 - 3:38 pm

Not yet no. This might make good plugin material for V5 however and shouldn't be too hard to implement.

andy-signature.png
YELLOW
SWORDFISH
Avatar
nirok
Member
Free Members
sp_UserOfflineSmall Offline
Dec 7, 2011 - 4:11 pm

I've install V5 and looking at adding it as a custom function. Is there a function which calls the uploaded avatars that I could use to echo the uploaded image file directory? I'm looking through the sp-common-view-functions.php file at the moment

Avatar
nirok
Member
Free Members
sp_UserOfflineSmall Offline
Dec 7, 2011 - 4:43 pm

Well I added it to the main functions but it would be obviously better if I added it as a custom function due to updating etc etc, but it's quite a cool small feature especially when you want to do a bit of template customisation. I've made it so you can just add your width and height to the function to determine the size you want the image in the different parts of the template. The other way of improving the upload image might be to use a jquery image upload and resize plugin... but that might be to complex, I think Timthumbs a good quick solution. But still would be cool to make this into a custom timthumb function

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17361
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625