Categories > TinyButStrong general >

Conditional Display

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Trent
Date: 2007-07-13
Time: 03:19

Conditional Display

Okay, here's my html

<table border="0" cellpadding="0" cellspacing="0" width="85%" class="default">
            <tr>
              <td>[online_1.userlevel;if [val]=2;then '<a href="profile.php?id=[online_1.uid]" class="game_helper">[online_1.username;htmlconv=no;block=td]</a>';if [val]=3;then '<a href="profile.php?id=[online_1.uid]" class="game_mod">[online_1.username;htmlconv=no;block=td]</a>';if [val]+=-4;then '<a href="profile.php?id=[online_1.uid]" class="game_admin">[online_1.username;htmlconv=no;block=td]</a>';else '<a href="profile.php?id=[online_1.uid]">[online_1.username;htmlconv=no;block=td]</a>']</td>
              <td>[online_2.userlevel;if [val]=2;then '<a href="profile.php?id=[online_2.uid]" class="game_helper">[online_2.username;htmlconv=no;block=td]</a>';if [val]=3;then '<a href="profile.php?id=[online_2.uid]" class="game_mod">[online_2.username;htmlconv=no;block=td]</a>';if [val]+=-4;then '<a href="profile.php?id=[online_2.uid]" class="game_admin">[online_2.username;htmlconv=no;block=td]</a>';else '<a href="profile.php?id=[online_2.uid]">[online_2.username;htmlconv=no;block=td]</a>']</td>
              <td>[online_3.userlevel;if [val]=2;then '<a href="profile.php?id=[online_3.uid]" class="game_helper">[online_3.username;htmlconv=no;block=td]</a>';if [val]=3;then '<a href="profile.php?id=[online_3.uid]" class="game_mod">[online_3.username;htmlconv=no;block=td]</a>';if [val]+=-4;then '<a href="profile.php?id=[online_3.uid]" class="game_admin">[online_3.username;htmlconv=no;block=td]</a>';else '<a href="profile.php?id=[online_3.uid]">[online_3.username;htmlconv=no;block=td]</a>']</td>
              <td>[online_4.userlevel;if [val]=2;then '<a href="profile.php?id=[online_4.uid]" class="game_helper">[online_4.username;htmlconv=no;block=td]</a>';if [val]=3;then '<a href="profile.php?id=[online_4.uid]" class="game_mod">[online_4.username;htmlconv=no;block=td]</a>';if [val]+=-4;then '<a href="profile.php?id=[online_4.uid]" class="game_admin">[online_4.username;htmlconv=no;block=td]</a>';else '<a href="profile.php?id=[online_4.uid]">[online_4.username;htmlconv=no;block=td]</a>'][online;block=tr;serial]</td>
            </tr>
          </table>

and here is my TBS statement

$TBS->MergeBlock('online','tbssql','SELECT * FROM users where last_active > ' . $current_time . '');

It just displays as a blank screen, but when i use the html below, it shows users currently logged in.

<table border="0" cellpadding="0" cellspacing="0" width="85%" class="default">
            <tr>
              <td><div align="center"><a href="profile.php?id=[online_1.uid]">[online_1.username;htmlconv=no;block=td]</a>[online_1.userlevel;block=td]</div></td>
              <td><div align="center"><a href="profile.php?id=[online_2.uid]">[online_2.username;htmlconv=no;block=td]</a></div></td>
              <td><div align="center"><a href="profile.php?id=[online_3.uid]">[online_3.username;htmlconv=no;block=td]</a></div></td>
              <td><div align="center"><a href="profile.php?id=[online_4.uid]">[online_4.username;htmlconv=no;block=td]</a>[online;block=tr;serial]</div></td>
            </tr>
          </table>

Can someone at least guide me in the right direction for fixing this?
By: Trent
Date: 2007-07-13
Time: 03:46

Re: Conditional Display

This fixed it.  I never would have thought that it would work, but it did.

<table border="0" cellpadding="0" cellspacing="0" width="85%" class="default">
            <tr>
              <td>[online_1.userlevel;if [val]=2;then '<a href="profile.php?id=[online_1.uid]" class="game_helper">[online_1.username;htmlconv=no]</a>';if [val]=3;then '<a href="profile.php?id=[online_1.uid]" class="game_mod">[online_1.username;htmlconv=no]</a>';if [val]+=-4;then '<a href="profile.php?id=[online_1.uid]" class="game_admin">[online_1.username;htmlconv=no]</a>';else '<a href="profile.php?id=[online_1.uid]">[online_1.username;htmlconv=no;]</a>';block=td]</td>
              <td>[online_2.userlevel;if [val]=2;then '<a href="profile.php?id=[online_2.uid]" class="game_helper">[online_2.username;htmlconv=no]</a>';if [val]=3;then '<a href="profile.php?id=[online_2.uid]" class="game_mod">[online_2.username;htmlconv=no]</a>';if [val]+=-4;then '<a href="profile.php?id=[online_2.uid]" class="game_admin">[online_2.username;htmlconv=no]</a>';else '<a href="profile.php?id=[online_2.uid]">[online_2.username;htmlconv=no]</a>';block=td]</td>
              <td>[online_3.userlevel;if [val]=2;then '<a href="profile.php?id=[online_3.uid]" class="game_helper">[online_3.username;htmlconv=no]</a>';if [val]=3;then '<a href="profile.php?id=[online_3.uid]" class="game_mod">[online_3.username;htmlconv=no]</a>';if [val]+=-4;then '<a href="profile.php?id=[online_3.uid]" class="game_admin">[online_3.username;htmlconv=no]</a>';else '<a href="profile.php?id=[online_3.uid]">[online_3.username;htmlconv=no]</a>';block=td]</td>
              <td>[online_4.userlevel;if [val]=2;then '<a href="profile.php?id=[online_4.uid]" class="game_helper">[online_4.username;htmlconv=no]</a>';if [val]=3;then '<a href="profile.php?id=[online_4.uid]" class="game_mod">[online_4.username;htmlconv=no]</a>';if [val]+=-4;then '<a href="profile.php?id=[online_4.uid]" class="game_admin">[online_4.username;htmlconv=no]</a>';else '<a href="profile.php?id=[online_4.uid]">[online_4.username;htmlconv=no]</a>';block=td][online;block=tr;serial]</td>
            </tr>
          </table>

I removed all of my "block=td" statements and put a single "block=td" and the end of my If Statement.