1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.3 Signature Still Displaying for Registered Members

Discussion in 'Troubleshooting and Problems' started by System0, Jun 23, 2014.

  1. System0

    System0 Active Member

    Registered users are not allowed to edit or display signatures on my forum. They need to upgrade to a premium account in order to edit their signature.

    However, I have noticed that members who upgraded previously but have not renewed their monthly or yearly membership still have their old signature displayed. I have checked user permissions and registered users cannot edit their signature; however the signature they created before continues to be displayed.

    There does not seem to be any user permission on Xenforo that stops a signature from being displayed. Or perhaps I just cannot find it :)

    Does anyone know how to resolve this?

    Kevin
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Signatures are not removed once set.
    The permission relates to editing the signature.

    You will need to manually remove them.

    A suggestion has been made to change this behaviour.
     
  3. System0

    System0 Active Member

    OK. Yeah it seems to be functionality that is important and needs to be added.

    It simply isn't practical to go through dozens or even hundreds of members accounts every month and delete their signature. And even if it was, deleting their signature is not desirable. It is better for a member's signature to simply be displayed again once they upgrade; rather than having to enter it manually every time.

    Is there a way to stop the signature being displayed on a post if the member belongs to the registered user group i.e wrapping the signature code in an if statement. That would help me resolve the issue in the meantime.
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    Yes, you can edit the template and use a user group conditional statement.

    The links are in my signature.
    I'm on my tablet so it's not easy to get the exact details.
     
  5. System0

    System0 Active Member

    Thanks. I tried a few different methods, but couldn't seem to get it working.

    I opened up the template message and found this code:

    PHP:
    <xen:if is="{$visitor.content_show_signature} && {$message.signature}">
                <
    div class="baseHtml signature messageText ugc{xen:if $message.isIgnored, ' ignored'}"><aside>{xen:raw $message.signatureHtml}</aside></div>
            </
    xen:if>
    And replaced it with:

    PHP:
        <xen:if is="!{xen:helper ismemberof, $visitor, 2}">
            <
    xen:if is="{$visitor.content_show_signature} && {$message.signature}">
                <
    div class="baseHtml signature messageText ugc{xen:if $message.isIgnored, ' ignored'}"><aside>{xen:raw $message.signatureHtml}</aside></div>
            </
    xen:if>
            </
    xen:if>
    Didn't seem to work. Am I better merging the two if statements together?
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    The $visitor record is for the member viewing the page.
    Try using $user.
     
  7. System0

    System0 Active Member

    Thanks for responding so quickly Brogan.

    Unfortunately, that didn't work.

    Also, just to clarify, if I use an if statement to stop signatures from being displayed on the posts of registered members, would this not affect those who upgrade? As those who upgrade are registered members (usergroup 2) that have been assigned with a secondary user group (user group 5).
     
  8. System0

    System0 Active Member

    Any ideas on what code to use for this?
     
  9. Brogan

    Brogan XenForo Moderator Staff Member

    The only things available in the message param are secondary_group_ids as a string and permission_combination_id as an integer.

    You could use the permission_combination_id like this: <xen:if is="{$message.permission_combination_id} != 123"> but it means checking all of the combination IDs and entering them as an array.
    Any changes to the permissions or IDs would then invalidate it and it would have to be updated.

    If all of those who shouldn't have a signature displayed have the same permission combination ID then the code above will work.
     
  10. System0

    System0 Active Member

    Thanks for responding Brogan.

    This did work:

    PHP:
    <xen:if is="{$message.permission_combination_id} != 2">
    All seems to be good now. I just have to ensure that I modify the code if I add any additional groups.

    I appreciate you helping me with the workaround. I do feel, however, that this is something that needs to be added to the core version of Xenforo. Removing the ability to display a members signature is useless if their existing signature is displayed. I realise that Xenforo that lacks the functionality of other scripts such as vBulletin (which is bloated with features), however I think that there has to be an additional permission added to Xenforo that allows forum owners to remove a permission from any usergroup.
     
  11. System0

    System0 Active Member

    How difficult would it be for this to be developed into an add on or for it to be integrated into the core?

    This is something that is still missing from Xenforo and still affects my forum. It's something that I believe should be addressed.
     
  12. Brogan

    Brogan XenForo Moderator Staff Member

    The easiest method would be to remove (delete) the signature of anyone who doesn't have the edit permission.
    That would be a fairly simple add-on to create.
     
  13. System0

    System0 Active Member

    As I mentioned before, that is not suitable; nor is it easy. I offer premium monthly memberships. Some months members might cancel and then renew later when they want to upgrade.

    Your suggestion means that every time someone downgrades, I need to manually remove their signature (which is time consuming for me). The member would then need to manually add this back at a later date (which is obviously a pain for them).

    What we need is a permission for whether a signature is to be displayed. It seems strange that there is a permission to edit a signature but not one to say whether their signature can be displayed. It should be selectable as a member permission.
     
  14. Brogan

    Brogan XenForo Moderator Staff Member

    No, my post above was in response to your post asking about an add-on.
     
  15. System0

    System0 Active Member

    Ahhh sorry Brogan. I thought you were referring to me removing the signature manually.

    I still believe that measure is not ideal as it means that users have to manually add their signature again. This is the kind of thing that can discourage people from renewing their membership.
     
  16. System0

    System0 Active Member

    This problem has come back.

    I still have this code in my message template:

    PHP:
    <xen:if is="{$message.permission_combination_id} != 2">
            <
    xen:if is="{$visitor.content_show_signature} && {$message.signature}">
                <
    div class="baseHtml signature messageText ugc{xen:if $message.isIgnored, ' ignored'}"><aside>{xen:raw $message.signatureHtml}</aside></div>
            </
    xen:if>
            </
    xen:if>
    Unfortunately, it is not working anymore. I noticed one particular member upgraded for a month and is now back to being a regular member (user group 2). Despite this, his signature continues to be displayed.

    Again, I do not want to delete his signature as it is a pain for members to enter their signature again whenever they choose to upgrade again. I simply need XenForo to not display signatures for registered members. Simply leaving their signatures displayed is not an option as it removes one of the key incentives for members to upgrade.

    Does the latest version of XenForo handle this differently since the above code worked perfectly a few months ago?
     
  17. Brogan

    Brogan XenForo Moderator Staff Member

    Nothing has changed in the core code.

    I suspect the permission combination ID isn't correct, or there may be another issue.
     
  18. System0

    System0 Active Member

    What's the combination ID?

    The user is no longer assigned to any other user group. He is only assigned to the registered user group. Does something change when someone gets added to a secondary group and then gets removed?
     
  19. Mike

    Mike XenForo Developer Staff Member

    The combination ID is an entirely internal number. It is meaningless and can change. You shouldn't rely on it. You'll need to base your logic on user groups or the like.
     
  20. System0

    System0 Active Member

    What else could be causing this as the code I have in my message template worked previously. Is there any other way to only show signatures for members from specific usergroups?

    I changed:

    to

    However, that does not display signatures for administrators. Is there another function I can use?
     

Share This Page