<!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 @##$$!.&nbsp; There<BR>
is a typo, this should read:<BR>
<BR>
$Conditions['equal'] = 'condequal($condparm)';<BR>
<BR>
function condequal($condparm) {<BR>
&nbsp; $args = ParseArgs($condparm);<BR>
&nbsp; 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>
&gt; Has there been any thought to creating conditional<BR>
&gt; extensions that would include == and != ?<BR>
<BR>
Sure, one can define an &quot;equal&quot; condition as<BR>
<BR>
&nbsp;&nbsp;&nbsp; $Conditions['equal'] = 'condeq($condparm)';<BR>
<BR>
&nbsp;&nbsp;&nbsp; function condequal($condparm) {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $args = ParseArgs($condparm);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return @($args[''][0] == $args[''][1]);<BR>
&nbsp;&nbsp;&nbsp; }<BR>
<BR>
and then conditions can look like:<BR>
<BR>
&nbsp;&nbsp;&nbsp; (:if equal {$Group} PmWiki:)&nbsp;&nbsp; Group is PmWiki<BR>
&nbsp;&nbsp;&nbsp; (:if !equal {$Group} PmWiki:)&nbsp; Group is not PmWiki<BR>
&nbsp;&nbsp;&nbsp; (:if equal {$AuthId} johnny:)&nbsp; Authorized user is &quot;johnny&quot;<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.&nbsp; :-)<BR>
<BR>
Pm<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>