MyBB Community Forums

Full Version: Adding a script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to add a script to the index page that shows up in the sidebar. But I only want Admins to see it. How would I go about doing that?
Bind your content in a div:

<div class="forug_{$mybb->user['usergroup']}" style="display: none;">Your content goes here ... </div>

Now add at the very end of your "footer" template:

<style type="text/css">.forug_4 { display: block; }</style>

Note: Assuming your Admin's group ID is 4. Change the number in code if it is different.

Done.