The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
First Plugin - King of the Forum Modification
Hi everyone,
Sorry if this is the wrong forum, but I'm just looking for some suggestions on how to do this. The idea is to use a hook in the plugin system to insert some HTML into the page when it's writing out a post for a specific user. The idea is: PHP Code:
The problem is, I know next to nothing about vBulletin, which hook to use (I was thinking 'postbit_display_start'), or what variable to use to insert it into. Am I supposed to search through the code for it? Sorry for the open-ended question. Any advice you can give would be appreciated. |
#2
|
|||
|
|||
Quote:
As far as posts, just make a template edit in postbit (or postbit_legacy if that is what you are using) and wrap the appropriate part with: Code:
<vb:if condition="is_member_of($bbuserinfo, KING_USERGROUP_ID)"> <div class="kotf-post"> <img alt="King" src="images/king.png" /> </vb:if> <!-- template contents? --> <vb:if condition="is_member_of($bbuserinfo, KING_USERGROUP_ID)"> </div> </vb:if> |
#3
|
||||
|
||||
What lance says about the template edit is the correct way to do this, but I think adding a usergroup is overkill IMO, you can test for an individual userid...
In VB 4.x find the line in the postbit/postbit_legacy template: Code:
{vb:raw post.message} Code:
<vb:if condition="$bbuserinfo[userid] == 42"> <div class="kotf-post"><img alt="King" src="images/king.png" /> </vb:if> Code:
<vb:if condition="$bbuserinfo[userid] == 42"> </div> </vb:if> If it's VB3 the code would be: Find: Code:
$post[message] Code:
<if condition="$bbuserinfo[userid] == 42"> <div class="kotf-post"><img alt="King" src="images/king.png" /> </if> Code:
<if condition="$bbuserinfo[userid] == 42"> </div> </if> |
#4
|
|||
|
|||
I considered a userid only, but the reason I suggested a usergroup is so a template edit doesn't need to be made every time there is a new king.
|
#5
|
||||
|
||||
I thought Kings were for life?
|
#6
|
||||
|
||||
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|