MyBB Hacks

Full Version: Actions and Without Actions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello there,

I'm using this code to control active tab

PHP Code:
class="section-usergroups <if (THIS_SCRIPT == "usercp.php" AND $mybb->input['action'] == "usergroups") then>nav-active</if>"


It's working, but there is a problem, that it will duplicate class "nav-active" if I use this code in the main file like this

PHP Code:
class="section-home <if THIS_SCRIPT == "usercp.php" then>nav-active</if>"


The class nav-active will be duplicated when I go to usercp.php?action=usergroups (the condition is always true) !

How to avoid this ?

PHP Code:
class="section-home <if THIS_SCRIPT == "usercp.php" && $mybb->input['action'] != "usergroups" then>nav-active</if>

Will show it active in all UCP pages except usergroups.

PHP Code:
class="section-home <if THIS_SCRIPT == "usercp.php" && !$mybb->input['action'] then>nav-active</if>

Should show it active only on main page (no action).

Thanks a lots!

Works like a charm Smile
Reference URL's