[pmwiki-users] conditional (:if enabled ...:)

Patrick R. Michaud pmichaud at pobox.com
Sat Apr 16 09:16:29 CDT 2005


On Sat, Apr 16, 2005 at 03:01:50PM +0100, Hans wrote:
> Saturday, April 16, 2005, 2:53:03 PM, Patrick wrote:
> > Never mind, it *does* appear to work, although I'm not exactly 
> > certain why.  PHP does some weird things at times.
> 
> well it does not for me, sorry, I was too eager first time trying.
> Indeed 0>'' seems to be true.
> Therefore the solution with ==1, which does work, but the variable
> need to be set to 1 and only 1.

The solution is to get rid of the conditional altogether, so
that it reads:

   $Conditions['enabled'] = "(boolean)\$GLOBALS[\$condparm]";

This causes the condition to simply uses PHP's built-in notion
of truth or falsity, which is really what we want.

Pm



More information about the pmwiki-users mailing list