Announcement

Collapse
No announcement yet.

nested conditionals not working...

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

  • nested conditionals not working...

    help! I dont know why this nesting of conditionals does not work correctly...

    PHP Code:
    <tr>
      <
    td>
     <if 
    condition="$thread[customflag] != ''">
      <if 
    condition="$thread[customflag] == 'H' OR $thread[customflag] == 'N'">
       <
    strong><font size="3">$thread[threadtitle]</font></strong>
        <if 
    condition="$bbuserinfo[userid] == 1">
          <
    a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]">(admin)</a>
        </if>   
      <else />
       
    $thread[threadtitle]
        <if 
    condition="$bbuserinfo[userid] == 1">
          <
    a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]">(admin)</a>
        </if>
      </if>
     <else />
      <
    strong><a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]">$thread[threadtitle]</a></strong>
     </if>
     </
    td>
    </
    tr

  • #2
    Well how does it not work correctly?

    Comment


    • #3
      Ok....all items with a H tag should load in size 3 bold. All with I should be size 2 non bold - neither of them should be clickable. Anything else should just appear as a normal bold link. However I nest it one of the conditions always goes wrong. And I cant work out why, I have tried every possible way of nesting I can think of.

      Comment


      • #4
        I managed to solve this. My solution is below in case anyone else is having trouble with IF conditionals

        PHP Code:
        <tr>
          <
        td>
        <if 
        condition="$thread[customflag] != '' AND $thread[customflag] == 'H' OR $thread[customflag] == 'I'">
        <!--IF 
        CUSTOM FLAG OF 'H' OR 'I' IS SET-->
         <if 
        condition="$thread[customflag] == 'H'">
         <!--IF 
        CUSTOM FLAG IS 'H'-->
          <
        strong><font size="3">$thread[threadtitle]</font></strong>
         </if>
         <if 
        condition="$thread[customflag] == 'I'">
         <!--IF 
        CUSTOM FLAG IS 'I'-->
          
        $thread[threadtitle]
         </if> 
         <if 
        condition="$bbuserinfo[userid] == 1">
         <!--IF 
        THE LOGGED IN USER IS ADMIN THEN DISPLAY THREAD ADMINISTRATION LINK-->
          <
        a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]">(admin)</a>
         </if>
          
        <else />
        <!--IF 
        CUSTOM FLAG IS BLANK USE STANDARD LINK-->
         <
        strong><a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]">$thread[threadtitle]</a></strong>
        </if>
         </
        td>
        </
        tr

        Comment

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