I'm using phpstringfun plugin to check a comma-delimited list for the presence of a single number.
{exp:phpstringfun function="substr_count" par1="{member_group}"}
{member-groups}
{/exp:phpstringfun}
member_group is the member group of the current user. member-groups is a category custom field. I've confirmed they're both working with
member-groups: {member-groups} member_group = {member_group}<br>
For example, I'll see the values "6,7" and "6", so 6 should be found in list. When I run the function, it always returns 0.
I've tried @dom-stubbs
{exp:channel:categories category_group="1" channel="pm" style="linear"}
{exp:switchee variable="{member_group}" parse="inward"}
member-groups is: {member-groups}
{case value="{member-groups}"}
We have a match.
{/case}
{/exp:switchee}
{/exp:channel:categories}
And no luck. I've confirmed that the member-groups and member_group variables are available. Nothing is output.
{member-groups}
in? If it's still comma-delimited then that Switchee case is never going to match. It sounds as though you're just using a text field, in which case if you switch to pipe-delimited values my sample code should work.<p>
tags and other markup, which would definitely cause problems.{member_group}
. Having just done so I've spotted the problem and have updated my answer with a fix.