On Tue, February 21, 2006 9:55 am, Jeff wrote:
> I'm again working with someone else's code and I have a problem I
> believe is in the section below. The problem is, I can't seem to
> understand what the "IF" conditions are saying here. The problem I
> have
> is with the second condition. To me this reads in psudo code:
>
> If( X and (if Y exists, then W otherwise Z))
>
> Does this work? If so how is it evaluated?
>
> Here is the actual code.
> <code>
>
> if ($tostaf && ($reply->comment ? $config->send_comment_staf :
> $config->send_emailreply_staf))
Makes sense to me...
If $tostaf is false, the rest of this stuff is irrelevant, and the
whole block can be ignored.
If $tostaf is TRUE, then check $reply->comment.
If $reply->comment is TRUE, check $config->send_comment_staf
If $reply->comment is FALSE, check $config->send_emailreply_staf
The $config->send_XYZ is going to ALSO be evaluated as TRUE/FALSE,
whichever one of the two setting is relevent.
It might be more clear to write it like this:
$config_send = $reply->comment ? $config->send_comment_staf :
$config->send_emailreply_staf;
if ($tostaf && $config_send){
$to = array();
...
}
--
Like Music?
http://l-i-e.com/artists.htm
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php