Announcement

Collapse
No announcement yet.

I cant make a conditional work

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

  • [Forum] I cant make a conditional work

    Some people on my blog want to use cometchat and others not, but they want to hide it because it uses lot of cpu resources and make the site so slow,

    so, Im using:

    First I have created a new User Profile Field (a new field, field8) "Do you want to show Cometchat" with 2 options "Yes" and "No"

    The problem is that whatever is selected, the chat isnt showed

    On the footer I use:
    Code:
    <vb:if condition="$post['field8'] == 'Yes'">
    <link type="text/css" href="/forum/cometchat/cometchatcss.php" rel="stylesheet" charset="utf-8">
    <script type="text/javascript" src="/forum/cometchat/cometchatjs.php" charset="utf-8"></script>
    </vb:if>
    Can somebody explain me why every time i put the conditional the chat isnt showed? I think the conditional its ok
    vBulletin Services I offer: www.Todo10.com
    Technical vB/Server/Hosting support Service also!

  • #2
    Try (not tested):

    Code:
    <vb:if ($user['field5'] == 'Yes'>
    <link type="text/css" href="/forum/cometchat/cometchatcss.php" rel="stylesheet" charset="utf-8">
    <script type="text/javascript" src="/forum/cometchat/cometchatjs.php" charset="utf-8"></script>
    </vb:if>
    Vote for:

    - *Admin Settable Paid Subscription Reminder Timeframe*
    -
    *PM - Add ability to reply to originator only*
    - Add Admin ability to auto-subscribe users to specific channel(s)
    - "Quick Route" Interface...

    Comment


    • #3
      Originally posted by Trevor Hannant View Post
      Try (not tested):

      Code:
      <vb:if ($user['field5'] == 'Yes'>
      <link type="text/css" href="/forum/cometchat/cometchatcss.php" rel="stylesheet" charset="utf-8">
      <script type="text/javascript" src="/forum/cometchat/cometchatjs.php" charset="utf-8"></script>
      </vb:if>
      In that case i get an error:
      Could not find phrase 'empty_if_condition'.
      vBulletin Services I offer: www.Todo10.com
      Technical vB/Server/Hosting support Service also!

      Comment


      • #4
        Oops! Change the 'field5' to 'field8'
        Vote for:

        - *Admin Settable Paid Subscription Reminder Timeframe*
        -
        *PM - Add ability to reply to originator only*
        - Add Admin ability to auto-subscribe users to specific channel(s)
        - "Quick Route" Interface...

        Comment


        • #5
          Originally posted by Trevor Hannant View Post
          Oops! Change the 'field5' to 'field8'
          Yes, I did it, thats the reason why i dont understand the error :S
          vBulletin Services I offer: www.Todo10.com
          Technical vB/Server/Hosting support Service also!

          Comment


          • #6
            Try:
            Code:
            <vb:if condition="$user['field8'] == 'Yes'">
            <link type="text/css" href="/forum/cometchat/cometchatcss.php" rel="stylesheet" charset="utf-8">
            <script type="text/javascript" src="/forum/cometchat/cometchatjs.php" charset="utf-8"></script>
            </vb:if>
            Though it would be really nice if we could delimit our template conditions with parenthesis.
            Translations provided by Google.

            Wayne Luke
            The Rabid Badger - a vBulletin Cloud demonstration site.
            vBulletin 5 API

            Comment


            • #7
              Originally posted by Wayne Luke View Post
              Try:
              Code:
              <vb:if condition="$user['field8'] == 'Yes'">
              <link type="text/css" href="/forum/cometchat/cometchatcss.php" rel="stylesheet" charset="utf-8">
              <script type="text/javascript" src="/forum/cometchat/cometchatjs.php" charset="utf-8"></script>
              </vb:if>
              Though it would be really nice if we could delimit our template conditions with parenthesis.
              well...I come back to say that if I set Yes its not showed..
              and I donĀ“t know why, without a conditional it works. I have already check the Yes option with the options on the profile fields and are right :S
              vBulletin Services I offer: www.Todo10.com
              Technical vB/Server/Hosting support Service also!

              Comment

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