PDA

View Full Version : How Do You Make Postbit Plugin


EuroPk
01-09-2008, 11:26 PM
Basically I'm trying to make it so this post bit plugin only shows up for certin user group IDs

<!-- PK Stats -->
<br>
<div class="smallfont" style="border: 1px solid #000000; margin-bottom: 0px;">
<div><b><font color="#FFFFFF">Total PKs</b>:<font color="#2BA8EC">$kills</font></div>
<div><b><font color="#FFFFFF">PK Points</b>:<font color="#2BA8EC">$points</font></div>
<div><font color="#FF0000"><b>Rank</b></font>:<font color="#2BA8EC">$rank</a></font></div>
**THIS IS IN PROGRESS**
</div>



If anyone could help let me know.

--------------- Added 1199934060 at 1199934060 ---------------

<!-- PK Stats -->
<if condition="$post[totalpks]">
<br />
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td valign="middle" nowrap="nowrap">
<div class="smallfont" style="border: 1px solid #585F67; margin-bottom: 2px;">
<div><b>$vbphrase[totalpks]</b>: <font color="#000000"><if condition="$post[totalpks]">$post[totalpks]<else />N/A</if></font></div>
<div><b>$vbphrase[pkpoints]</b>: <font color="#000000"><if condition="$post[totalpks]">$post[pkpoints]<else />N/A</if></font></div>
<div><font color="#FF0000"><b>$vbphrase[pkrank]</b></font>: <if condition="$post[totalpks]"><font color="#000000">$post[pkrank]</a></font><else />N/A</if></div>
<if condition="$post[bmpk_away]"><div>*AWAY*</div></if>
<if condition="$post[bmpk_limited]"><div>*LIMITED ACTIVITY*</div></if>
</div>
</td>
</tr>
</table>
</if>

sarahk
01-10-2008, 04:29 PM
Do you want to make a plugin or a template change?

I'd start by looking to see what info is available in this array: $vbulletin->userinfo

Compare it to your target Groups and if true then set a variable with some html
If false make the variable empty

then in your template echo out the variable.

a key factor is picking the right plugin option so that it runs only when needed.

There may be a better way, however :)

snakes1100
01-10-2008, 04:37 PM
<if condition="in_array($bbuserinfo[usergroupid], array(5,6,7))">

<!-- PK Stats -->
<br>
<div class="smallfont" style="border: 1px solid #000000; margin-bottom: 0px;">
<div><b><font color="#FFFFFF">Total PKs</b>:<font color="#2BA8EC">$kills</font></div>
<div><b><font color="#FFFFFF">PK Points</b>:<font color="#2BA8EC">$points</font></div>
<div><font color="#FF0000"><b>Rank</b></font>:<font color="#2BA8EC">$rank</a></font></div>
**THIS IS IN PROGRESS**
</div>

</if>