Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Natasha 79 posts 195 karma points
    Jan 31, 2014 @ 17:53
    Natasha
    0

    Checking if a specific member is logged in

    Hi Guys

    I would like to be able to edit the code below so that it will only show the new topic when I certain member 4860 is logged in, so far i can only do it for all members.  Can anyone help.

    Thanks

    Natasha

    <xsl:choose>
            <xsl:when test="umbraco.library:IsLoggedOn()">
              <div class="infoBox" id="newTopic">
                <a href="{uForum:NicePostingUrl($currentPage/@id)}">Create a new topic</a>
                <br/>
                <small>Create a new topic in this forum</small>
              </div>
            </xsl:when>
            <xsl:otherwise>
              <div class="infoBox" id="newTopic">
                <span>You cannot post</span>
                <br/>
                <small>You do not have permission to post in this forum</small>
              </div>
            </xsl:otherwise>
          </xsl:choose>

     

  • Fuji Kusaka 2203 posts 4220 karma points
    Jan 31, 2014 @ 18:57
    Fuji Kusaka
    0

    Hi Natasha,

    You could set up Public Access to any content folder so as members can view specific content.

    Here are some examples

    Something

    <xsl:iftest="umbraco.library:HasAccess(@id,@path)">
     
    <xsl:for-each select="$source/*[string(./data [@alias='umbracoNaviHide']) != '1']">// source here is the content folder where topics are stored
    <xsl:sort select="@createDate" order="descending" />
                    <li><a href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of select="@nodeName"/></a>
                    </li>
                </xsl:for-each>
    </xsl:if>

    Hope this helps

    //fuji

     

     

     

  • Natasha 79 posts 195 karma points
    Feb 01, 2014 @ 00:24
    Natasha
    0

    Thanks Fuji I fixed it by amending the when test:

      <xsl:when test="umbraco.library:IsLoggedOn()and string(data[@alias = 'memberId']) != '4860'">

  • Natasha 79 posts 195 karma points
    Feb 01, 2014 @ 05:41
    Natasha
    0

    I spoke too soon the above code lets everyone who is logged on post. I have tried this also:

     <xsl:variable name="memberName" select="umbraco.library:GetCurrentMember()/allowToCeateTopics"/>
        
          <!--<xsl:choose>-->
        
        <xsl:if test="number($memberName) = 1">
              <div class="infoBox" id="newTopic">
                
                <href="{uForum:NicePostingUrl($currentPage/@id)}">Create a new topic</a>
                <br/>
                <small>Create a new topic in this forum</small>
              </div>

            </xsl:if>

    still need help

     

    Thanks

    Natasha 

  • Fuji Kusaka 2203 posts 4220 karma points
    Feb 01, 2014 @ 05:42
    Fuji Kusaka
    0

    Awesome if you got it working.

    But one thing if you are hardcoding the Member Id how will you handle other members ? 

  • Fuji Kusaka 2203 posts 4220 karma points
    Feb 01, 2014 @ 05:53
    Fuji Kusaka
    0

    In your content section did you give Public Access ?



Please Sign in or register to post replies

Write your reply to:

Draft