Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Avatar maximum dimensions set by usergroup problem
magw33d Offline
Junior Member
**
Posts: 1
Joined: Sep 2014
Post: #1
Avatar maximum dimensions set by usergroup problem
I've adapted some code taken from another thread (which for the love of God I cannot find), which sets the maximum dimensions of an avatar based on the usergroup GID called from an array.

The code works to resize the dimensions of the avatar, but the array is not working. The array should make usergroups like Administrators and Moderators have a larger avatar size, but it is skipping the code and going straight to the 'else' part. I can't seem to see the problem with my code, it just won't work at all!

The code is placed in the "postbit_avatar" template and replaces the default code.



Quote:<a href="{$post['profilelink_plain']}">
<img src="{$post['avatar']}" alt="" <if (in_array($mybb->user['usergroup'] , array('3','4','6','10','15'))) then>
style="max-width:150px; max-height: 200px"<else>
style="max-width:100px; max-height: 100px"</if>/>
</a>

If anyone can see what I'm doing wrong with my code, or has any suggestions for a potential workaround (plugins, edits to base php or templates) then I would be highly appreciative.
09-25-2014 07:04 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: Avatar maximum dimensions set by usergroup problem
Change $mybb->user['usergroup'] to $post['usergroup']
The former refers to the logged in user, the latter refers to the post's user.

My Blog
09-26-2014 04:27 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: