Conditional Signature

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • grey_goose
    Member
    • Sep 2009
    • 50
    • 3.8.x

    Conditional Signature

    I'm trying to use custom profile fields to change what is displayed in the signature line depending on what forum the user is in. Running 3.8.4PL2

    PHP Code:
    <if condition="$forumid==61 AND $post['field85']">$post[field85]
                            <
    br /></if>
                            
    $post[signature
    PHP Code:
                            <if condition="$forumid 5,200,61)) AND $post['field85']">$post[field85]
                            <
    br /></if>
                            
    $post[signature
    Neither of those seem to be working. What am I doing wrong?
  • Lats
    Senior Member
    • Mar 2002
    • 3671

    #2
    Try this...
    Code:
    <if condition="in_array($forum[forumid],array(5,200,61)) AND $post['field85']">$post[field85]
    <br /></if>
    $post[signature]
    Lats...

    Comment

    • grey_goose
      Member
      • Sep 2009
      • 50
      • 3.8.x

      #3
      You are AWESOME. Thank you so much.

      Question 2.

      Let's say I have a custom field I want to only be visible to a specific usergroup(s), moderators of the current forum, and the user that posted it.

      This is what I have:

      PHP Code:
      <if condition="is_member_of($bbuserinfo, 5,32) OR $show['moderatethread'] OR $bbuserinfo[userid] == $post[userid]">
      $post[field72]
      </if> 
      Unfortunately, the user who posted it ($bbuserinfo[userid] == $post[userid]) can't see it. Can you fix that one for me?

      Comment

      • Lats
        Senior Member
        • Mar 2002
        • 3671

        #4
        Try this very small change...
        Code:
        <if condition="(is_member_of($bbuserinfo, 5,32) OR $show['moderatethread'] OR $bbuserinfo[userid] == $post[userid])">
        $post[field72]
        </if>
        Lats...

        Comment

        • grey_goose
          Member
          • Sep 2009
          • 50
          • 3.8.x

          #5
          OK, again, thanks

          It seems that I was mistaken though, and the forum moderators ($show['moderatethread']) can't see that field still. So the groups array and original poster is working, just not the moderator.


          Code:
          <if condition="(is_member_of($bbuserinfo, 5,32) OR $show['moderatethread'] OR $bbuserinfo[userid] == $post[userid])"> $post[field72] </if>
          thoughts on what's wrong with using "$show['moderatethread']" ?

          Comment

          • Lats
            Senior Member
            • Mar 2002
            • 3671

            #6
            Hopefully this will work for you...
            Code:
            <if condition="(is_member_of($bbuserinfo, 5,32) OR can_moderate($thread['forumid'] OR $bbuserinfo[userid] == $post[userid])">
            $post[field72]
            </if>
            Lats...

            Comment

            • grey_goose
              Member
              • Sep 2009
              • 50
              • 3.8.x

              #7
              Thanks for the fast reply.

              Unfortunately, when I change that, I get:

              Parse error: parse error in <-forumpath->\includes\adminfunctions_template.php(3950) : eval()'d code on line 173


              Again, I'm running (vBulletin 3.8.4 Patch Level 2)

              Comment

              • Lats
                Senior Member
                • Mar 2002
                • 3671

                #8
                Dang, missed a closing )...
                Code:
                <if condition="(is_member_of($bbuserinfo, 5,32) OR can_moderate($thread['forumid']) OR $bbuserinfo[userid] == $post[userid])">
                $post[field72]
                </if>
                Lats...

                Comment

                • grey_goose
                  Member
                  • Sep 2009
                  • 50
                  • 3.8.x

                  #9
                  If you're ever in Houston, drinks on me

                  Thanks, seriously. I appreciate the time and help!

                  Comment

                  Related Topics

                  Collapse

                  Working...