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

XF 1.5 How to get {user_id} of banned user in a phrase?

Discussion in 'XenForo Questions and Support' started by kontrabass, May 18, 2016.

  1. kontrabass

    kontrabass Well-Known Member


    I have this in the footer of our "contact us" email text (contact_email_body_text)
    Name: {name} (ID: {user_id})
    IP: {ip}
    Profile link: http://www.oursiteurl.com/members/{user_id}/
    AdminCP Link: http://www.ouradminurl/asdf.php?users/{user_id}/edit
    Email: {email}
    The problem is that if the user is banned, {user_id} always returns "0". Is there a way I can grab the real userid of the banned user for this purpose? It'd save time for our moderators...
  2. Brogan

    Brogan XenForo Moderator Staff Member

    The user_id will only be available for logged in members.

    For anyone submitting the form when not logged in, it will return an ID of 0, which is for guests.
  3. Xon

    Xon Well-Known Member

    @kontrabass My Contact Us Thread add-on has the option to allow banned users to use the contact us form so they will have a user_id set. This obviously doesn't help if they aren't logged in.

Share This Page