[Pmwiki-users] Insert PHP Code into pmwiki

Steven Leite steven_leite
Mon May 31 05:03:39 CDT 2004


Example:

Suppose you wanted to show somebody's IP address using the "$showip" markup, then you would just add this one line to your config.php file

$InlineReplacements['/\$showip/'] = $_SERVER['REMOTE_ADDR'];

The square brackets around '/\$showip/' means it's an array (of replacements),
everything inside the single quotes ' ... ' is what you are searching for.
The first slash / and the last slash / are delimeters.  
The first backslash \$ tells php not to render $showip as an internal variable, but to actually search for the literal "$showip".

If you want to get fancy and do some functions, then let me know and I can send you some more complex examples.

I tested the above snippet .. it works on my install.

-S

----- Original Message ----- 
From: "Albi Rebmann" <albi at life.de>
To: <pmwiki-users at pmichaud.com>
Sent: Sunday, May 30, 2004 4:14 PM
Subject: [Pmwiki-users] Insert PHP Code into pmwiki


> Hello,
> 
> is there some easy way to insert php code into wiki?
> I tried by inlinereplacements, but it looks like php is not allowed.
> Does anybody has some example for this?
> 
> 
> ALBI...
> 
> 
> 
> 
> -- 
> Pmwiki-users mailing list
> Pmwiki-users at pmichaud.com
> http://pmichaud.com/mailman/listinfo/pmwiki-users_pmichaud.com
> 
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://contra.vosn.net/pipermail/pmwiki-users_pmichaud.com/attachments/20040531/93aa47ad/attachment.htm


More information about the pmwiki-users mailing list