vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   How Do You Make Postbit Plugin (https://vborg.vbsupport.ru/showthread.php?t=167398)

EuroPk 01-09-2008 11:26 PM

How Do You Make Postbit Plugin
 
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 [DATE]1199934060[/DATE] at [TIME]1199934060[/TIME] ---------------

<!-- 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>


All times are GMT. The time now is 04:49 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00914 seconds
  • Memory Usage 1,714KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete