Announcement

Collapse
No announcement yet.

Adding an additional condition to a conditional

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

  • Adding an additional condition to a conditional

    If I currently have:
    Code:
    <if condition="$thread[threadid]==328464">
    and want to add an additional thread ID to the conditional, how would I do that?

    Thanks.

  • #2
    <if condition="in_array($thread[threadid], array(328464,XXXXXX))">

    XXXXXX would be your second threadid. You can add more just by separating them with a comma.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API - Full / Mobile
    Vote for your favorite feature requests and the bugs you want to see fixed.

    Comment


    • #3
      Can you double check that code please? If I use that rather than my initial code it doesn't seem to work for either thread. I'm adding it in postbit_legacy.

      Also, how would I write it if I wanted it to be a != conditional? Thanks!

      Comment


      • #4
        code changed above...

        Just put the ! in front of in_array.
        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud demonstration site.
        vBulletin 5 API - Full / Mobile
        Vote for your favorite feature requests and the bugs you want to see fixed.

        Comment


        • #5
          Beautiful, thanks!

          Comment

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