MyBB Community Forums

Full Version: Hide tabs for everyone but not mod?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
I'll try to explain easily. I'm making a very smooth nice member profile in my template. I added some tabs for "About", "Activity" ect. So I made one for Moderate which displays admin CP and mod CP. But for regular users, it will just show up as blank when they click on the tab. So I was wondering if there is any way to hide this tab for everyone but not mods and admins?


Here is an example of the tabs (not from my forum):
[Image: 16652116XZbpcEH.png]


I only want to hide one tabs and that is the "Moderation" tab. Anyone? Huh
Theres many ways to do this.

If youre more advanced in coding for mybb, you could create plugin that hooks somewhere
and hide. show, modify whatever thing in template.

If youre not that advanced yet to create your own plugins, you could use php in templates plugin,
that lets you insert conditional stuff directly into templates (or even php code if you wish).

heres fiew simple examples of what you can do with php in templates plugin <- can click here to get the plugin

template conditionals way
<if $mybb->usergroup['canmodcp'] then>
    <div> this div will be shown if current user can access modcp </div>
</if>
<if $mybb->user['uid'] then>
    <div> this div is shown to loged in users </div>
<else>
    <div> this div is shown to guests </div>
</if>
or even php way
<?php
    // php in templates plugin example.
    if ($mybb->usergroup['canmodcp']) {
        echo '<div> this div is shown only to moderators who can access mod cp </div>';
    }
?>