[pmwiki-users] Re: PmWiki ver 1
Patrick R. Michaud
pmichaud at pobox.com
Wed Feb 23 14:07:02 CST 2005
On Wed, Feb 23, 2005 at 08:34:35PM +0100, EuGeNe wrote:
> >Or stated another way, in ver 2 the standard markup for calling
> >PmWiki-admin defined PHP functions is (: :) . :-)
>
> Woa! Just to make sure that I get things right : suppose I have a group
> called Hello and in local/Hello.php I define a function <? function
> hello() { echo "Hello world"; } ?> ... in any page of the group Hello I
> can have (: hello() :) and it will show Hello world?
No, that's definitely not right. We certainly don't want someone
to be able to write
(: unlink('wiki.d') :)
in a page and suddenly wonder where all of our pages went. Thus
we don't want to have a markup that allows an author to call
any function.
PmWiki's approach is to make it easy to define custom markup -- i.e.,
an admin can define a hello() function:
function hello() { return "Hello World"; }
and also add a markup to call that function:
Markup('hello', 'directives',
'/\\(:hello:\\)/e',
"Keep(hello())");
which says that anywhere the author writes (:hello:), replace it
with whatever the hello() function returns.
Pm
More information about the pmwiki-users
mailing list