MyBB Community Forums

Full Version: make buttons only staff see?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I would like to make a button on my forum for only staff to see and click called "Mod Hat" it's a button that mods can click to post a Mybb Code. Is there away to add a button like this to my post bit?
I'm not completely sure, but I know there is a 1.4 plugin at MyBB Central that creates a staff only MyCode... you could modify that, but there wouldn't be a button.
Taken from VBulletin I have an IF code, that just needs to be modified to fit mybb... If that would help, then I'm not so sure if it would work or not.

<if condition="is_member_of($vbulletin->userinfo, 5,6,7,26,25)">
<td class="thead_text"><a href="" rel="nofollow">{$lang->}<img src="button URL here" border="0" alt=""></a></td>
</if>
Using Template Conditionals Plugin you can use this thingy. Try this;

<if $mybb->user['usergroup'] == 4 then>
<td>
<a href="YOUR_URL">
{$lang->BUTTON_TEXT}
<img src="BUTTON_URL" border="0" alt="">
</a>
</td>
</if>

Remember couple of things. Replace "4" to what ever your mods usergroup ID is. Replace any thing in the code above which is in "Capital Letters".

Hope it helps.
what URL would I use?
what about combining these?

http://mods.mybb.com/view/advanced-mycode-permissions
http://mybbrunway.com/tutorials/adding-b...to-editor/
http://mybbhacks.zingaburga.com/showthread.php?tid=260

In theory it should work

and long time no see redneckmelly Toungue

*wonders if she knows which charming former CF mod i be*
Choose yourself. I suggested the code that would work. You've to choose yourself what URL you have to use for button link and button image.
(2010-12-13, 01:30 PM)Richard.R Wrote: [ -> ]what about combining these?

http://mods.mybb.com/view/advanced-mycode-permissions
http://mybbrunway.com/tutorials/adding-b...to-editor/
http://mybbhacks.zingaburga.com/showthread.php?tid=260

In theory it should work

and long time no see redneckmelly Toungue

*wonders if she knows which charming former CF mod i be*

Hello Richard, I think I have a hunch lol
Ok so I downloaded the php in template thing, but it has no instructions at all, and I have no idea where I'd upload it. It's probably a "Duh" thing, but I honestly don't know lol.
(2010-12-13, 06:02 AM)Yaldaram Wrote: [ -> ]Using Template Conditionals Plugin you can use this thingy. Try this;

<if $mybb->user['usergroup'] == 4 then>
<td>
<a href="YOUR_URL">
{$lang->BUTTON_TEXT}
<img src="BUTTON_URL" border="0" alt="">
</a>
</td>
</if>

Remember couple of things. Replace "4" to what ever your mods usergroup ID is. Replace any thing in the code above which is in "Capital Letters".

Hope it helps.

You're good, nice code. Might use this if it's okay. Wink
(2010-12-13, 06:29 PM)Melbelle Wrote: [ -> ]Ok so I downloaded the php in template thing, but it has no instructions at all, and I have no idea where I'd upload it. It's probably a "Duh" thing, but I honestly don't know lol.

Its a plugin, should go into the ./inc/plugins folder. After uploading, go to ACP > Configurations > Plugins > and install PHP Template Conditionals. After installing successfully, use the above code to use what ever purpose you like to use.
Pages: 1 2