[pmwiki-users] Prepend text string to wiki file when saving - another approach?

Josh Miller josh at virtualmillers.net
Sun Sep 9 16:41:53 CDT 2007


Hi all!

I'm still trying to get this to work.  Patrick provided me some useful
help but I couldn't get the implementation to work on my site.

How about a different approach:

Each time I save a wiki page to a file, I want to prepend a text string
to it.  Then when I edit the file, I want to pull that text string out.

For example: let's prepend the following to every page at the beginning
of the text:

<div id="pre">Page updated by $author</div>

Except I want to store the value of the variable, not the variable so
when I save the page the text in the file in the wiki.d directory reads
like this test file:

text=<div id="pre">Page updated by Josh</div>%0a%0ahello there
time=1189370430
author:1189370430=Josh

Now, when Jim comes along and edits the page, it pulls the preceding
text out so the edit field looks like:
hello there

But when Jim saves, the text is changed to:

text=<div id="pre">Page updated by Jim</div>%0a%0ahello there people
time=1189370430
author:1189370430=Jim

This is just an example - I am not actually trying to prepend the author
information...I know there are better/other ways to do that.

I'm thinking of a function or functions that works similar to the
edittitle recipe that strips the (:title:) from the wiki text when you
edit and save.

I need to watch out for special conditions such as when that text string
isn't present

Does this make any more sense?
Anyone have any ideas or some thoughts on a starting point?

You assistance is always appreciated!

-Josh Miller
Gouverneur




More information about the pmwiki-users mailing list