1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum is for release discussion only. Discussions that do not relate specifically to the resource release should be discussed in another, more appropriate forum.
    Dismiss Notice
  3. This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

"Current Visitors" for logged in members only.

Discussion in 'Template Modifications [Archive]' started by Vincent, Dec 26, 2010.

  1. Vincent

    Vincent Well-Known Member

    Hello y'all.

    This modification makes sure that visitors can't see your "Current Visitors" list.

    current_visitors.png

    Go to the template called online_list

    Search
    Code:
    <ol class="section memberList">
    Add in front of it:
    Code:
    <xen:if is="{$visitor.user_id}">
    ----------

    Search
    Code:
    </ol>
    Add after:
    Code:
    <xen:else />
    	{xen:phrase must_be_registered}
    </xen:if>
     
    8thos, DimOK, Vilandra and 5 others like this.
  2. cobra1162

    cobra1162 Active Member

    nice good job :)
     
  3. AndreaMarucci

    AndreaMarucci Well-Known Member

    I'm an admin and now I cannot see the visitors online if I use this mod. My users are id 1 and myself id 3
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    The conditional to allow content for members and hide it for guests is:

    <xen:if is="{$visitor.user_id}">
    This content will show to logged in members only
    <xen:else />
    This content will show to guests only
    </xen:if>

    I believe the == 1 should be removed from the code posted above.
     
  5. Vincent

    Vincent Well-Known Member

    Fixed that, thanks for claryfying
     
  6. AndreaMarucci

    AndreaMarucci Well-Known Member

Share This Page