Categories > TinyButStrong general >

the conditional display

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Mankiy
Date: 2003-06-03
Time: 02:36

the conditional display

are you able to use variables for it?

like say i want it to check to see if the user is online,
like this:
[tbs_check;if!$user;then 'you are not logged in, please login';else 'welcome $user';]

like that 0_o
i know you can do it with using php
<?php

if (!$user) {
$TBS->MergeField("online", "You are not logged in, please login");
} else {
$TBS->MergeField("online", "Welcome $user");
}

?>
By: Skrol29
Date: 2003-06-03
Time: 10:04

Re: the conditional display

with a variable :
[var.user;if [val]='';'you are not logged in';else 'welcome [val]']
var.* fields are merged automatically with Php variables.

You also can define a php variable $user_info to display.

And you also can use conditional blocks. They works like a switch statement. There is an example of conditional blocks in the example set (at the web site or given with the TBS package).