Vbulletin IF (contains)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Crashys
    Member
    • Dec 2003
    • 33
    • 4.2.X

    Vbulletin IF (contains)

    Hello,

    I'm trying to add a condition in Postbid_legacy that if a certain field contains a word, it will display one image, if contains a different shows different image.

    This would be easy if i had like 3 or 5 words, but i have Hundreds...

    Currently, my forum members enter a ATV model they use, for example: Yamaha YFZ450R from a list of models that my moderation previous creates (field9).

    Since i have the model next to the brand, i want that all the content of that field that contains "Yamaha" despite the model will show the logo image, so far i made this:

    <vb:if condition="$post['field9'] > 'Yamaha'">
    <dd><div align="center"><img src="logos/yamaha.png"</div></dd>
    </vb:if>

    My problem is that if i make the same to Suzuki it will show both Yamaha and Suzuki... it seams that $post['field9'] > "Yamaha" is not working...

    Suggestions?
  • Zachery
    Former vBulletin Support
    • Jul 2002
    • 59097

    #2
    You're checking if field9 is greater than yamaha?
    You want to check if field 9 is == to yamaha

    Comment

    • Crashys
      Member
      • Dec 2003
      • 33
      • 4.2.X

      #3
      Indeed, but my Field9 contains more chars than just Yamaha... so the == will never be truth.

      Comment

      • Zachery
        Former vBulletin Support
        • Jul 2002
        • 59097

        #4
        What sort of field is it? Mutli checkbox? Drop Down? text input?

        Comment

        • Crashys
          Member
          • Dec 2003
          • 33
          • 4.2.X

          #5
          Single-Selection Menu

          Users choose from a Drop Down.

          Comment

          • Zachery
            Former vBulletin Support
            • Jul 2002
            • 59097

            #6
            Then they should only be able to choose one answer. You'll have to make a condition for each answer.

            Comment

            • Crashys
              Member
              • Dec 2003
              • 33
              • 4.2.X

              #7
              But in the database, the entered value is always a text, so, if in vbulletin i get the field9 value as Yamaha YFZ450, why or how can i have enter a condition like:

              IF ($field9 like '%Yamaha%') then bla bla bla


              All i want is to search parts of the string i have on the database.

              Comment

              • Zachery
                Former vBulletin Support
                • Jul 2002
                • 59097

                #8
                You can't.

                Comment

                • Crashys
                  Member
                  • Dec 2003
                  • 33
                  • 4.2.X

                  #9
                  Fail..........

                  Comment

                  • Arkham
                    Senior Member
                    • Mar 2001
                    • 2233
                    • 4.1.x

                    #10
                    Originally posted by Crashys
                    Fail..........
                    Or, normalization fail. "Yamaha" and "YFZ450" should be separate. Maybe you'll have to rethink what you're trying to do.

                    Try looking into some of the free/paid "Garage" add-ons. They're pretty spiffy.

                    http://www.vbprogarage.com/ is one that I saw recently (paid), and there are a few on vbulletin.org.

                    Comment

                    • Crashys
                      Member
                      • Dec 2003
                      • 33
                      • 4.2.X

                      #11
                      What i want is that under the profile image the brand of the member ATV is shown... not Garage related... i'll have to think this over due to this lack of feature.

                      Comment

                      • Zachery
                        Former vBulletin Support
                        • Jul 2002
                        • 59097

                        #12
                        You could use two different fields and make this far far easier on yourself.

                        Comment

                        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                        Working...