Adding image to postbit with joindate condition

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DeltaHawk5
    Member
    • Sep 2012
    • 90

    [Forum] Adding image to postbit with joindate condition

    We're celebrating a year of existence and as a small detail, we'd like to give our founding members a small badge in their postbit.

    I've done a bit of research, but are still falling short in how to set the right <vb:if > condition for the image to appear.

    The idea is that if they joined in the first 1 or 2 months, the badge would appear below the skype/icq/aim/etc area.

    Any chance someone could throw me a helping hand?
    Last edited by DeltaHawk5; Mon 27 May '13, 7:42am.
  • DeltaHawk5
    Member
    • Sep 2012
    • 90

    #2
    EDIT: Didn't figure out yet.
    Last edited by DeltaHawk5; Mon 27 May '13, 8:39am.

    Comment

    • Zachery
      Former vBulletin Support
      • Jul 2002
      • 59097

      #3
      It'd be nice if you shared your answer for others. There are a few ways to do this, easiest would probably be a simple conditional that checks the userid: <vb:if condition="$post[userid] <= X">Stuff here</vb:if>

      Comment

      • DeltaHawk5
        Member
        • Sep 2012
        • 90

        #4
        Originally posted by Zachery
        It'd be nice if you shared your answer for others. There are a few ways to do this, easiest would probably be a simple conditional that checks the userid: <vb:if condition="$post[userid] <= X">Stuff here</vb:if>
        I actually didn't manage to figure it out completely. It seems my condition checking is still failing. Here is what I have so far:

        I'm pulling the UNIX timestamp from var_dump, it doesn't seem to work right however.

        Code:
        <vb:if condition="$userinfo['joindate'] <= 1346457601"><img src="media/eauk.png" title="Founding Member"></vb:if>
        Regardless of what I do, everyone in the site gets the badge.

        We have some many members, that doing it as an usergroup would take months adding members who meet the conditions.
        Last edited by DeltaHawk5; Mon 27 May '13, 9:06am.

        Comment

        • DeltaHawk5
          Member
          • Sep 2012
          • 90

          #5
          Yeah, the problem seems to be setting the condition if join date is LESS THAN.

          When the condition is if join date is EQUAL TO, it works.

          By using "<=" I'm closing the line.
          Last edited by DeltaHawk5; Mon 27 May '13, 9:06am.

          Comment

          • Zachery
            Former vBulletin Support
            • Jul 2002
            • 59097

            #6
            I'd suggest looking at mine, look at your users, figure out the last one that joined on the day you want, then just use that userid for the conditional.

            Comment

            • DeltaHawk5
              Member
              • Sep 2012
              • 90

              #7
              Originally posted by Zachery
              I'd suggest looking at mine, look at your users, figure out the last one that joined on the day you want, then just use that userid for the conditional.
              Well, I guess that's one way to make it work.

              Thanks.

              Comment

              • Lynne
                Former vBulletin Support
                • Oct 2004
                • 26255

                #8
                You didn't say what template you are putting this condition into. If it's the postbit, then I doubt you want to use the variable $userinfo, you probably want to use the variable $post.

                Please don't PM or VM me for support - I only help out in the threads.
                vBulletin Manual & vBulletin 4.0 Code Documentation (API)
                Want help modifying your vbulletin forum? Head on over to vbulletin.org
                If I post CSS and you don't know where it goes, throw it into the additional.css template.

                W3Schools &lt;- awesome site for html/css help

                Comment

                Related Topics

                Collapse

                Working...