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

XF 1.4 User Rank on Profile Page help?

Discussion in 'Styling and Customization Questions' started by Demon, Jun 9, 2015.

  1. Demon

    Demon Active Member

    I want to add text on certain profiles for former staff members. It's styled. How can I accomplish this? It works with out the conditional statements. I have got it placed where I want it to show.

    Member_view:
    Code:
    <xen:if is="{$user.user_id} == 324 OR {$user.user_id} == 142 {$user.user_id} == 831">
    <p class="formerRank">
               Former Rank: Administrator
    </p>
    <xen:elseif is="{$user.user_id} == 14" />
    <p class="formerRank">
               Former Rank: Global Moderator
    </p>
    <xen:elseif is="{$user.user_id} == 11" />
    <p class="formerRank">
               Former Rank: Content Moderator
    </p>
    </xen:if>
    
    Extra.css:
    Code:
    .formerRank {
      margin: 10px 0;
      color: rgb(59, 59, 59);
      background-color: rgb(235, 235, 235);
      text-align: center;
      padding: 5px;
      -webkit-border-radius: 5px;
      -moz-border-radius: 5px;
      -khtml-border-radius: 5px;
      border-radius: 5px;
      border: solid 1px rgb(191, 191, 191);
    }
    
    [​IMG]

    This is what it looks like:
    [​IMG]
     
    Last edited: Jun 9, 2015
  2. Brogan

    Brogan XenForo Moderator Staff Member

    This line is incorrect:
    Code:
    <xen:if is="{$user.user_id} == 324 OR {$user.user_id} == 142 {$user.user_id} == 831">
    It's missing an OR.

    You can always use an array instead, which is what I do if there are 3 or more.
     
  3. Demon

    Demon Active Member

    Thank you. I didn't see that error.
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    Try this instead:
    Code:
    <xen:if is="in_array({$user.user_id}, array(142, 324, 831))"> 
     
    Demon likes this.
  5. Demon

    Demon Active Member

    Much easier, thanks!
     
    Last edited: Jun 9, 2015

Share This Page