Extension Name: All Users Groups Template Variables
Author: martti
Extension Description: This extension provides Template variables that can be used to check if the users in the views belong to certain groups.
Example In Viewtopic
To check if the poster in a
postrow
belongs to a certain groupCode: Select all
{%- if marttiphpbb_allusersgroupstempvars[postrow.POSTER_ID][GROUP_ID] -%}
This content is only visible if the poster belongs to group GROUP_ID (replace GROUP_ID with the group number)
{%- endif -%}
Code: Select all
{%- for group_id, boolean_true in marttiphpbb_allusersgroupstempvars[postrow.POSTER_ID] -%}
{{- group_id -}}{% if not loop.last -%}, {% endif -%}
{%- endfor -%}
Extension Version: 0.1.0
Requirements: phpBB 3.2 PHP 7+
Extension Download: https://github.com/marttiphpbb/phpbb-ex ... master.zip The files are to be put into
ext/marttiphpbb/allusersgroupstempvars
Github repository: https://github.com/marttiphpbb/phpbb-ex ... pstempvars
Languages: no language files included
Templates: no template files included
Screenshot:
The second example above (all group id's of the poster) in the template event
viewtopic_body_post_author_before
: 