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

XF 1.4 Signature still viewable after user upgrade expires

Discussion in 'Troubleshooting and Problems' started by WoodiE, May 28, 2015.

  1. WoodiE

    WoodiE Well-Known Member

    On my forum I have set not allowed regular users to use or edit signatures and then offer a premium user upgrade that allows several added benefits, one of which is the ability to use signatures.

    What I've noticed is that if a user upgrades their account, adds a signature and then lets the premium membership expire - the users signature will still remain. Is this expected behavior and if so is there a way to have the signatures removed from the users profile once their upgrade expires, or at least remove it from being viewable unless they have an active membership?

    Thanks!
     
  2. Liam W

    Liam W Well-Known Member

    This is designed behaviour - the permissions are only checked when editing a signature.

    You would require custom development to remove the signatures of users that no longer have permission to use them.

    Liam
     
  3. WoodiE

    WoodiE Well-Known Member

    Thanks @Liam W - how about using a Xenforo conditional? If I was to use a conditional to only show if the posting member was a premium member or would that mean the only way to even see the sig was to also be a premium member?
     
  4. rwm1962

    rwm1962 Active Member

    I'd be interested in contributing to an add-on that deletes or hides signatures & avatars in this scenario. Both are part of my upgrade package.
     
    WoodiE likes this.
  5. Liam W

    Liam W Well-Known Member

    I'm not 100% sure - it would depend on whether or not the ismemberof helper requires the full user array...

    I'd be interested in creating such an add-on. I might do so, it'll be a free release.

    Liam
     
    WoodiE likes this.
  6. WoodiE

    WoodiE Well-Known Member

    I too would be interested in contributing to the addon. Avatars is something I let all members use since I hate seeing a sea of "default" avatars but the ability to remove the sig without a premium membership would be great.

    In the meantime I'll play around with the conditional's as well. I fear though this would only work if both the member posting and the member viewing was a premium member.
     
  7. Liam W

    Liam W Well-Known Member

    Start in the message template, find the signature if block, and try the following conditional:

    HTML:
    {xen:helper ismemberof, $message, <premium group id>}
    
    I'm not sure if the $message variable contains all the needed data though.

    Liam
     
    CyclingTribe and WoodiE like this.
  8. Mr. Goodie2Shoes

    Mr. Goodie2Shoes Well-Known Member

    For the template conditional and you KNOW which groups have access:
    Code:
    <xen:if is="{xen:helper isMemberOf, $message, 2, 3, 5}">
    
    <!-- signature block goes here... -->
    
    </xen:if>
    
    where 2, 3 and 5 are the user group ids... :)

    EDIT: got ninja'd :(
     
    CyclingTribe and WoodiE like this.
  9. WoodiE

    WoodiE Well-Known Member

  10. rwm1962

    rwm1962 Active Member

    A free addon to remove or hide sigs & avatars if no longer a subscriber would be awesome but the offer of a contribution is still there.
     
  11. WoodiE

    WoodiE Well-Known Member

    @rwm1962 the above code works fine if you want to go that route. One less addon to worry about.
     
  12. rwm1962

    rwm1962 Active Member

    Is that not just for signatures though?
     
  13. WoodiE

    WoodiE Well-Known Member

    The above works for signatures, but about the same principle works for avatars.

    Open the message_user_info template and find:

    Code:
        <div class="avatarHolder">
           <span class="helper"></span>
           <xen:avatar user="$user" size="m" img="true" />
           <xen:if is="{$user.isOnline}"><span class="Tooltip onlineMarker" title="{xen:phrase online_now}" data-offsetX="-22" data-offsetY="-8"></span></xen:if>
           <!-- slot: message_user_info_avatar -->
         </div>
    
    and replace with such:

    Code:
    <xen:if is="{xen:helper ismemberof, $user, 1,2,3}">
        <div class="avatarHolder">
           <span class="helper"></span>
           <xen:avatar user="$user" size="m" img="true" />
           <xen:if is="{$user.isOnline}"><span class="Tooltip onlineMarker" title="{xen:phrase online_now}" data-offsetX="-22" data-offsetY="-8"></span></xen:if>
           <!-- slot: message_user_info_avatar -->
         </div>
    </xen:if>
    
    Replacing 1,2,3 with the groups you want to only display avatars.
     
    rwm1962 likes this.
  14. mikelowrey

    mikelowrey Active Member

    I would like to contribute if we can create an addon, I would like to create upgrades for the future to let the user be able tu use avatar and sig's
     
  15. rwm1962

    rwm1962 Active Member

    Many thanks @WoodiE (& @Mr. Goodie2Shoes @Liam W )

    Does that delete the signature & avater or just hide them? So - if they re-upgrade will their sig/avatar reappear?
     
  16. WoodiE

    WoodiE Well-Known Member

    Yes it just hides them from view.
     
    rwm1962 likes this.
  17. rwm1962

    rwm1962 Active Member

    I see it also gets rid of the not so nice default no avatar image for the groups that don't have the avatar permission. Bonus!


    Where does that code go?
     
  18. rwm1962

    rwm1962 Active Member

    @Mr. Goodie2Shoes & @WoodiE

    Sorry to poke you guys! I've figure the avatar thing out but can't figure where to put the code for hiding the signatures. Can you point me to the right template please?

    Thanks
     
  19. Mr. Goodie2Shoes

    Mr. Goodie2Shoes Well-Known Member

    @rwm1962 sorry I missed your post :oops:
    Check out the template "message" at the very bottom:
    Code:
    <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>
    
     
  20. rwm1962

    rwm1962 Active Member

    Hi - That's fine! Any help is appreciated & I need it more than most I think. So I just paste that & edit user groups where you wrote 'signature block goes here'?
     

Share This Page