PDA

View Full Version : Resizing avatars in postbit?


shibby2
04-04-2018, 11:55 PM
Hey guys, I'm making a mobile skin and would like to display the poster's avatar next to their name in postbit_legacy. I added the bit of code to do this, but since it's a mobile skin, the avatars are way too big.

How would I go about to make them smaller, just for that skin? Don't know exactly what size I would want just yet, guess it will take some testing, but they have to definitely be smaller.

Any help would be awesome, thanks! :)

--------------- Added 1522894992 at 1522894992 ---------------

I actually figured it out.. somewhat. This is my code:


<if condition="$show['avatar']">

&nbsp;<br /><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl] width="40px" height="40px" <phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a>

</if>



Only thing is, some of the avatars come out as rectangles (tall and thin). Is there a way to make them perfectly square instead of rectangle?

shibby2
04-06-2018, 11:12 PM
Anyone? It seems with the code above, the height changes to 40px, but the width can vary.

Any way around this?

Thanks!

MarkFL
04-06-2018, 11:23 PM
Try using the "style" attribute instead to introduce inline CSS...like:

<img src="$post[avatarurl] style="height: 40px; width: 40px;" <phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" />

shibby2
04-08-2018, 08:30 PM
Hmm, for some reason that made the avatars bigger, and some of them are still rectangles rather than squares.

MarkFL
04-08-2018, 09:35 PM
You must have CSS elsewhere taking precedence. Try:

<img src="$post[avatarurl] style="height: 40px !important; width: 40px; !important" <phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" />

shibby2
04-08-2018, 10:20 PM
That did the same. :(