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

XF 1.4 Odd permissions question

Discussion in 'XenForo Questions and Support' started by Silverhair, Mar 7, 2015.

  1. Silverhair

    Silverhair Member

    Hello, sorry if this has been asked before, I don't seem to be able to find anything on this in my searches...

    I am trying to make it so that unregistered/members not logged in, cannot see the username of the "last thread user".

    Ie: I have it set so that guests can view nodes, but not threads or thread content - unfortunately, they can still see the membername of the last person to post in a thread, and they can also see the membercard for that member if they click on the membername.

    I would like to make it so these are not visible to guests.

    My permissions are otherwise working correctly and I am very happy with everything so far, I simply cannot find a way to set these permissions in the admin-cp, nor have I been able to use conditional statements, although maybe I do not have the correct template?

    Any help is greatly appreciated!
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Revoke the View threads by others and View thread content permissions.
     
  3. Silverhair

    Silverhair Member

    ahh yes, I tried that. however, I still want guests to view the thread title and date, just not the membername of the last poster or their membercard if they click on the name...

    Here's a screenshot, I want to make it so the membername, in this case "Blaze71," is not visible to guests.

    permissions setting question.png
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    You would need to edit the thread_list_item template and add a conditional statement for guests.
     
  5. Silverhair

    Silverhair Member

    I will look, thank you Brogan.
     
  6. Silverhair

    Silverhair Member

    Hi Brogan, I have been looking through the template you mentioned and am unsure of where to insert the conditional statement. I do not see anything specifically relating to the username, or at least I do not recognize which part of the template refers to that...can you provide any additional hints to steer me in the right direction?
     
  7. Tracy Perry

    Tracy Perry Well-Known Member

    @Adamant1, I was able to do this real quick by playing with the node_category_level_2 template.

    I edited this section (look where it has <xen:comment> code </xen:comment>
    That is where you would need to wrap it for the index. You would need to use the conditional statements for exclusion of guests in place of the <xen:comment> that Brogan has in his signature.
    Code:
    <xen:elseif is="{$category.lastPost.date}" />
                    <span class="lastThreadTitle"><span>{xen:phrase latest}:</span> <a href="{xen:link posts, $category.lastPost}" title="{$category.lastPost.title}">{$category.lastPost.title}</a></span>
                    <span class="lastThreadMeta">
                        <xen:comment><span class="lastThreadUser"><xen:if is="{xen:helper isIgnored, $category.last_post_user_id}">{xen:phrase ignored_member}<xen:else /><xen:username user="$category.lastPost" /></xen:if>,</span></xen:comment>
    Pretty much the same with the node_forum_level_2 template.
    Results were
    Screen Shot 2015-03-07 at 4.56.07 PM.png Screen Shot 2015-03-07 at 4.59.02 PM.png
     
    Silverhair likes this.
  8. Silverhair

    Silverhair Member

    Nice! That looks like it works exactly like what i am looking for...! node_forum_level_2, and node_category_level_2 templates you say...thank you, just upgrading to 1.4.5 right now, but will try this out asap!!!

    Thank you very much Tracy!

    :D:D:D
     
  9. Tracy Perry

    Tracy Perry Well-Known Member

    If that's the case, then here is what you need to do. In both of those, where I gave the <xen:comment> example, replace it with this code
    Code:
    <xen:if is="{$visitor.user_id}"><span class="lastThreadUser"><xen:if is="{xen:helper isIgnored, $forum.last_post_user_id}">{xen:phrase ignored_member}<xen:else /><xen:username user="$forum.lastPost" /></xen:if>,</span></xen:if>
    The results will be this
    Logged in user

    Screen Shot 2015-03-07 at 5.09.37 PM.png Screen Shot 2015-03-07 at 5.09.45 PM.png

    Guest user
    Screen Shot 2015-03-07 at 5.09.09 PM.png Screen Shot 2015-03-07 at 5.09.22 PM.png
     
  10. Silverhair

    Silverhair Member

    Awesome, yes works perfectly, thanks Tracy, and to you Brogan as well for your help.

    I had to edit my default template, so I did something wrong with the customized style that I set up,as edits to those templates do invoke any changes, but it is working now anyways!

    Thanks so much!
     
  11. Silverhair

    Silverhair Member

    Coming back to this with another question...it worked marvelously for the main forum page, but when a visitor clicks on a specific forum, then all threads on that page display author...I want to eliminate this, so that authors names are not visible.

    Alternatively or even better yet, if someone were to click on a specific forum or thread on the main forum page, it would tell them they would have to be logged in to view that, but I am not sure which template to edit for this and am very leary of just making changes in the event I mess something up too much to fix it.

    Has anyone tried this before? Suggestions for which template to change?

    Thanks in advance,

    Adamant1
     

Share This Page