Bug in "hide signature" function

fredrikse

Active member
Hi,

I have created a template modification with TMS that will hide signature in message view based on if you are member of a certain user group.

This is the code I'm using for the function:
PHP:
<xen:if is="{xen:helper ismemberof, $visitor, 12}">
<xen:if is="{$message.signature}">
            <div class="baseHtml signature ugc{xen:if $message.isIgnored, ' ignored'}"><aside>{xen:raw $message.signatureHtml}</aside></div>
        </xen:if>
</xen:if>
At the beginning I though I got it right. But now when I verified and looked more closely I realized that it's not working like it should. I have to users which both have a valid signature in their profiles. Profile A is member of a usergroup which will permit it to display the signature. Profile B is member of the same group. Here's the funny thing. When I remove Profile A from this usergroup the signature disappears in the thread like it should do. But signature disappears for Profile A as well. Really strange. I'm missing something in my condition.

Help is greatly appreciated! What I need is secondary user group information for each and every user in a thread I guess. Right? :)
 
Hi,

I have created a template modification with TMS that will hide signature in message view based on if you are member of a certain user group.

This is the code I'm using for the function:
PHP:
<xen:if is="{xen:helper ismemberof, $visitor, 12}">
<xen:if is="{$message.signature}">
            <div class="baseHtml signature ugc{xen:if $message.isIgnored, ' ignored'}"><aside>{xen:raw $message.signatureHtml}</aside></div>
        </xen:if>
</xen:if>
At the beginning I though I got it right. But now when I verified and looked more closely I realized that it's not working like it should. I have to users which both have a valid signature in their profiles. Profile A is member of a usergroup which will permit it to display the signature. Profile B is member of the same group. Here's the funny thing. When I remove Profile A from this usergroup the signature disappears in the thread like it should do. But signature disappears for Profile A as well. Really strange. I'm missing something in my condition.

Help is greatly appreciated! What I need is secondary user group information for each and every user in a thread I guess. Right? :)
It may be because you're using $visitor which is the user currently viewing the page.

Use $user to identify the message author, or $message may also return the user information.
 
I tried $user instead of $visitor, but that didn't do it. Maybe it's not available in the template? Is it possible to get secondary user group info from $message?
 
Top Bottom