Lets style templates show or hide content based on the viewer's groups.
- Sets a template switch
S_GROUP_<id>for every group the current user is in, on every page. - An ACP page lists your groups with their IDs.
- phpBB 3.3.19 or later
- PHP 7.4 or later
- Copy the extension to
/ext/phpbbmodders/groupswitches - In the Administration Control Panel, go to Customise → Manage extensions
- Enable the Group Switches extension
- Find your group IDs under ACP → Users and Groups → Group Switches
Put the content in a template event file inside the extension, using the group's ID from the ACP page. For example, styles/all/template/event/overall_header_navbar_before.html:
{% if S_GROUP_5 %}
<div class="rules">Only members of group 5 see this (Administrators, on a default install).</div>
{% endif %}Use styles/all/ for every style, or a style's own folder (such as styles/prosilver/) for just that style, then purge the board cache. The template events you can use are listed in phpBB's event documentation.
Contributions are welcome!
- Bug reports: Open an issue.
- Everything else (questions, feature requests, ideas, general discussion): Use Discussions, or the community forum.
- Pull requests are welcome for bug fixes or discussed features.
- Original extension by Rich McGirr (RMcGirr83).
- Code review, bug fixes, and documentation assisted by Claude.
This extension is licensed under the GNU General Public License v2.0.
See license.txt for more information.