<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7226.0">
<TITLE>RE: [pmwiki-users] Conditional Extensions</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<BR>
<P><FONT SIZE=2>OK, for anyone lese trying this, I messed with<BR>
this for a while beating my head @##$$!. There<BR>
is a typo, this should read:<BR>
<BR>
$Conditions['equal'] = 'condequal($condparm)';<BR>
<BR>
function condequal($condparm) {<BR>
$args = ParseArgs($condparm);<BR>
return @($args[''][0] == $args[''][1]);<BR>
}<BR>
<BR>
Notice the restored 'ual' in the first line. :)<BR>
<BR>
-Martin<BR>
<BR>
-----Original Message-----<BR>
From: Patrick R. Michaud [<A HREF="mailto:pmichaud@pobox.com">mailto:pmichaud@pobox.com</A>]<BR>
Sent: Thu 9/15/2005 8:16 PM<BR>
To: Fick, Martin<BR>
Cc: PmWiki<BR>
Subject: Re: [pmwiki-users] Conditional Extensions<BR>
<BR>
On Thu, Sep 15, 2005 at 05:22:13PM -0400, Martin Fick wrote:<BR>
> Has there been any thought to creating conditional<BR>
> extensions that would include == and != ?<BR>
<BR>
Sure, one can define an "equal" condition as<BR>
<BR>
$Conditions['equal'] = 'condeq($condparm)';<BR>
<BR>
function condequal($condparm) {<BR>
$args = ParseArgs($condparm);<BR>
return @($args[''][0] == $args[''][1]);<BR>
}<BR>
<BR>
and then conditions can look like:<BR>
<BR>
(:if equal {$Group} PmWiki:) Group is PmWiki<BR>
(:if !equal {$Group} PmWiki:) Group is not PmWiki<BR>
(:if equal {$AuthId} johnny:) Authorized user is "johnny"<BR>
<BR>
See <A HREF="http://www.pmwiki.org/wiki/Test/Equality">http://www.pmwiki.org/wiki/Test/Equality</A> for an example.<BR>
<BR>
It might even be worthwhile to add this to the core. :-)<BR>
<BR>
Pm<BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>