Announcement

Collapse
No announcement yet.

Vbulletin IF (contains)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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?

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

    Comment


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

      Comment


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

        Comment


        • #5
          Single-Selection Menu

          Users choose from a Drop Down.

          Comment


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

            Comment


            • #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


              • #8
                You can't.

                Comment


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

                  Comment


                  • #10
                    Originally posted by Crashys View Post
                    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


                    • #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


                      • #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...
                        X