View Full Version : Adding a centered icon to the postbit
tobias_t
05-08-2008, 06:39 AM
Hi all,
What would be the correct code for adding an icon to the postbit that is centered within the postbit vertically and horizontally?
Thanks, Tobias
tobias_t
05-15-2008, 09:32 AM
A gentle bump...
Lynne
05-15-2008, 02:08 PM
It all depends on where you want the icon to be located. An image would help.
tobias_t
05-15-2008, 02:18 PM
It all depends on where you want the icon to be located. An image would help.
Thanks! I basically would like the image to sit squat in the middle of the postbit on both axes. The vertical size of the postbit varies between users (depending on which profile fields they have filled out), so it would need to be a relative positioning.
We use the standard (non-legacy) version of the postbit in 3.6.5, without any substantial edits.
Lynne
05-15-2008, 02:43 PM
This is from a 3.6.8 postbit template:
<tr>
<td class="alt2" style="padding:0px">
<!-- user info -->
<table cellpadding="0" cellspacing="$stylevar[cellpadding]" border="0" width="100%">
<tr>
<if condition="$show['avatar']"><td class="alt2"><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a></td></if>
<td nowrap="nowrap">
<div id="postmenu_$post[postid]">
<if condition="$show['profile']">
<a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>
$post[onlinestatus]
<script type="text/javascript"> vbmenu_register("postmenu_$post[postid]", true); </script>
<else />
$post[musername]
</if>
</div>
<if condition="$post['usertitle']"><div class="smallfont">$post[usertitle]</div></if>
<if condition="$post['rank']"><div class="smallfont">$post[rank]</div></if>
$template_hook[postbit_userinfo_left]
</td>
<td width="100%"> </td>
<td valign="top" nowrap="nowrap">
<div class="smallfont">
<if condition="$post['joindate']"><div>$vbphrase[join_date]: $post[joindate]</div></if>
<if condition="$post['field2']"><div>$vbphrase[location_perm]: $post[field2]</div></if>
<if condition="$post['age']"><div>$vbphrase[age]: $post[age]</div></if>
<div>
$vbphrase[posts]: $post[posts]
</div>
$template_hook[postbit_userinfo_right_after_posts]
<if condition="$show['infraction']"><div>$vbphrase[infractions]: $post[warnings]/$post[infractions] ($post[ipoints])</div></if>
<if condition="$show['reputation']"><if condition="$show['reppower']">$vbphrase[reppower]: <span id="reppower_$post[postid]_$post[userid]">$post[reppower]</span> </if><div><span id="repdisplay_$post[postid]_$post[userid]">$post[reputationdisplay]</span></div></if>
$template_hook[postbit_userinfo_right]
<div>$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon] $post[skypeicon]</div>
</div>
</td>
</tr>
</table>
<!-- / user info -->
</td>
</tr>See the part in red? I think you can try to add what you want there. You may have to tweak it a bit like change the td tag to center, ie. <td width="100%" align="center">.
tobias_t
05-16-2008, 12:27 PM
That definitely helped, thanks!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.