[dokuwiki] Re: Can one expand Dokuwiki variables directly by any means?


On Thu, 16 Dec 2010 15:19:16 +0000, Chris G <cl@xxxxxxxx> wrote:
Having discovered where link parameters get to I now want an easy way of
using them!  :-)
[...]
   [[pagex?FirstName=Chris&Surname=Green]]

[...]
    ======Personal Information======
    My name is %FirstName% %Surname%.

Chris Green


Hi Chris,

Your problem splits up into two parts:

1) Create Link with variables [solved]
2) Display information on a page, that is passed via URL parameters



=== About (1) ===
[[pagex?FirstName=Chris&Surname=Green]]
Is just a short way of writing the absolute URL:
http://www.yourhost.com/path/to/your/dokuwiki/doku.php?id=pagex?FirstName=Chris&Surname=Green

=== About (2) ===
I hope your Wiki is an internal Wiki. Becaus otherwise someone might create a link in the form:

http://www.yourhost.com/path/to/your/dokuwiki/doku.php?id=pagex?FirstName=<insert_some_cleverly_quoted_php_code, that_delets_all_pages_in_your_wiki>

=> Never trust URL parameters! :-)


Have a look at the "simplevar" plugin. I think this is very close to what you need. This plugin already replaces tokens inside pages. It only reads the values from conf/default.php. You should easily be able to change this to (correctly quoted!) URL parameters.

http://www.dokuwiki.org/plugin:easyvar

Hope that helps,
  Robert





--
DokuWiki mailing list - more info at
http://www.dokuwiki.org/mailinglist

Other related posts: