Reduce font size on Long Username to fit Postbit (legacy)
I found that when I switched to the "legacy" postbit, some of the usernames wrapped (if they were particularly long:
So I made a mod for this which contains 2 steps: a new plugin and template edit. Less than 5 minutes! 1. Create a plugin for hook location memberaction_dropdown. This puts the length of the username into a variable the template can use. Code:
$memberinfo['unlength']= $memberinfo['musername']? strlen($memberinfo['musername']): strlen($memberinfo['username']); 2. Modify template memberaction_dropdown Font size will be determined by you--what will fit in your postbit. Find: Code:
<vb:if condition="$memberinfo['musername']">{vb:raw memberinfo.musername}<vb:else />{vb:raw memberinfo.username}</vb:if> Code:
<vb:if condition="$memberinfo['musername']"> <vb:if condition="$memberinfo['unlength']>25"><span style="font-size:13pt;">{vb:raw memberinfo.musername}</span> <vb:else />{vb:raw memberinfo.musername}</vb:if> <vb:else /> <vb:if condition="$memberinfo['unlength']>15"><span style="font-size:13pt;">{vb:raw memberinfo.username}</span> <vb:else />{vb:raw memberinfo.username}</vb:if> </vb:if> Note: If the username has an html wrap ($memberinfo['musername']) I account for the html by adding 10 characters to the threshold. You'll have to play with this variable depending on your HTML wraps. HTML wraps are found in Usergroup Settings. Download No files for download. |