We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28033
    • 925 Posts
    <?php
    $type = isset($type) ? $type : '-';
    $atr = isset($atr) ? $atr : '-';
    $target = isset($target) ? $target : 'Single enemy.';
    $power = isset($power) ? $power : '-';
    $fof = isset($fof) ? $fof : '-';
    $learn = isset($learn) ? $learn: '-';
    $sunlight = isset($sunlight) ? $sunlight : 'No effect.';
    $fof_type = isset($fof_type) ? $fof_type : '-';
    $fof_atr = isset($fof_atr) ? $fof_atr : '-';
    $fof_target = isset($fof_target) ? $fof_target : 'Single enemy.';
    $fof_power = isset($fof_power) ? $fof_power : '-';
    $mystic_extension = isset($mystic_extension) ? $mystic_extension : '-';
    
    $mystic_activation = preg_replace('/SB/','<b>',$mystic_activation);
    $mystic_activation = preg_replace('/EB/','</b>',$mystic_activation);
    $mystic_extension = preg_replace('/SB/','<b>',$mystic_extension);
    $mystic_extension = preg_replace('/EB/','</b>',$mystic_extension);
    
    $output = "";
    if (isset($fof_name)) {
      $output .=  '<ul class="sectionselect"><li><strong>'.$name.' <em><small>'.$desc.'</small></em></strong></li></ul><p></p>
    
    <div id="table">
    <table cellspacing="3" cellpadding="3" class="setup">
    <colgroup span="5">
     <col/>
     <col/>
     <col/>
     <col/>
     <col/>
    </colgroup>
    
    <tbody>
     <tr>
      <th class="heading">Type</th>
      <th class="heading">ATR</th>
      <th class="heading">TP</th>
      <th class="heading">Target</th>
      <th class="heading">Power</th>
     </tr>
     <tr>
      <td class="data">'.$type.'</td>
      <td class="data">'.$atr.'</td>
      <td class="data">'.$tp.'</td>
      <td class="data">'.$target.'</td>
      <td class="data">'.$power.'</td>
     </tr>
     <tr>
      <th class="heading" colspan="1">FOF Creation</th>
      <th class="heading" colspan="1">Learn</th>
      <th class="heading" colspan="3">FS Chambers</th>
     </tr>
     <tr>
      <td class="data" colspan="1">'.$fof.'</td>
      <td class="data" colspan="1">'.$learn.'</td>
      <td class="data-nc" colspan="2">
    <b>Carmine</b>: '.$carmine.'<br />
    <b>Cobalt</b>: '.$cobalt.'
      </td>
      <td class="data-nc" colspan="1">
    <b>Grass</b>: '.$grass.'<br />
    <b>Sunlight</b>: '.$sunlight.'
      </td>
     </tr>
     <tr>
      <th class="heading" colspan="2">FOF</th>
      <th class="heading" colspan="3">FOF Activator</th>
     </tr>
     <tr>
      <td class="data" colspan="2"><acronym title="'.$fof_desc.'" class="help">'.$fof_name.'</acronym></td>
      <td class="data" colspan="3">'.$activate.'</td>
     </tr>
     <tr>
      <th class="heading">Type</th>
      <th class="heading">ATR</th>
      <th class="heading">TP</th>
      <th class="heading">Target</th>
      <th class="heading">Power</th>
     </tr>
     <tr>
      <td class="data">'.$fof_type.'</td>
      <td class="data">'.$fof_atr.'</td>
      <td class="data">'.$fof_tp.'</td>
      <td class="data">'.$fof_target.'</td>
      <td class="data">'.$fof_power.'</td>
     </tr>
    </tbody>
    </table>
    </div>
    <p></p>';
    } elseif (isset($mystic_activation)) {
      $output .= '<ul class="sectionselect"><li><strong>'.$name.'</li></ul><p></p>
    
    <div id="table">
    <table cellspacing="3" cellpadding="3" class="setup">
    <colgroup span="5">
     <col/>
     <col/>
     <col/>
     <col/>
     <col/>
    </colgroup>
    
    <tbody>
     <tr>
      <th class="heading">Type</th>
      <th class="heading">ATR</th>
      <th class="heading">TP</th>
      <th class="heading">Target</th>
      <th class="heading">Power</th>
     </tr>
     <tr>
      <td class="data">'.$type.'</td>
      <td class="data">'.$atr.'</td>
      <td class="data">'.$tp.'</td>
      <td class="data">'.$target.'</td>
      <td class="data">'.$power.'</td>
     </tr>
     <tr>
      <th class="heading" colspan="5">Activation</th>
     </tr>
     <tr>
      <td class="data" colspan="5">'.$mystic_activation.'</td>
     </tr>
     <tr>
      <th class="heading" colspan="5">Extension</th>
     </tr>
     <tr>
      <td class="data" colspan="5">'.$mystic_extension.'</td>
     </tr>
    </tbody>
    </table>
    <p></p>
    </div>';
    } else {
      $output .= '<ul class="sectionselect"><li><strong>'.$name.' <em><small>'.$desc.'</small></em></strong></li></ul><p></p>
    
    <div id="table">
    <table cellspacing="3" cellpadding="3" class="setup">
    <colgroup span="5">
     <col/>
     <col/>
     <col/>
     <col/>
     <col/>
    </colgroup>
    
    <tbody>
     <tr>
      <th class="heading">Type</th>
      <th class="heading">ATR</th>
      <th class="heading">TP</th>
      <th class="heading">Target</th>
      <th class="heading">Power</th>
     </tr>
     <tr>
      <td class="data">'.$type.'</td>
      <td class="data">'.$atr.'</td>
      <td class="data">'.$tp.'</td>
      <td class="data">'.$target.'</td>
      <td class="data">'.$power.'</td>
     </tr>
     <tr>
      <th class="heading" colspan="1">FOF Creation</th>
      <th class="heading" colspan="1">Learn</th>
      <th class="heading" colspan="3">FS Chambers</th>
     </tr>
     <tr>
      <td class="data" colspan="1">'.$fof.'</td>
      <td class="data" colspan="1">'.$learn.'</td>
      <td class="data-nc" colspan="2">
    <b>Carmine</b>: '.$carmine.'<br />
    <b>Cobalt</b>: '.$cobalt.'
      </td>
      <td class="data-nc" colspan="1">
    <b>Grass</b>: '.$grass.'<br />
    <b>Sunlight</b>: '.$sunlight.'
      </td>
     </tr>
    </tbody>
    </table>
    <p></p>
    </div>';
    }
    
    return $output;
    ?>


    For some reason, code that shouldn’t be affected, such as this...

    [[arte-abyss? &name=`Fang Blade Havoc` &desc=`A combination of Fang Blade and Havoc Strike.` &type=`Physical` &tp=`16` &power=`310` &learn=`Lv15 + 50x Fang Blade/Havoc Strike` &carmine=`Damage +10%` &cobalt=`25% change of knockback.` &grass=`TP cost reduced by 1/8.`]]


    Is being put into the $mystic_activation "block", instead of the else "block". Any idea why?
      My Snippets
      -> PopUpChunk v1.0
      • 14050
      • 788 Posts
      You are setting the $mystic_activation variable when you do the following:

      $mystic_activation = preg_replace('/SB/','<b>',$mystic_activation);
      $mystic_activation = preg_replace('/EB/','</b>',$mystic_activation);
      


      Thus, you can never reach your ’else’ block because the ’elseif’ block will always evaluate to ’TRUE.’

        Jesse R.
        Consider trying something new and extraordinary.
        Illinois Wine

        Have you considered donating to MODx lately?
        Donate now. Every contribution helps.
        • 4041
        • 788 Posts
        Perhaps wrapping the $mystic_activation replacement block like this would solve it:

        if($mystic_activation !=""){
        $mystic_activation = preg_replace('/SB/','<b>',$mystic_activation);
        $mystic_activation = preg_replace('/EB/','</b>',$mystic_activation);
        }
          xforum
          http://frsbuilders.net (under construction) forum for evolution
          • 28033
          • 925 Posts
          Gah, that makes sense. *makes a note of that*

          I’m still learning PHP, so I’m not surprised I missed that.  laugh

          EDIT: Yep, that fixed it. Thanks so much for the fix. ^.^
            My Snippets
            -> PopUpChunk v1.0