[pmwiki-users] Text Replacement

Russell Bailey russell-pmwiki at saberpunk.net
Fri Aug 5 11:24:25 CDT 2005

Sorry,  I misread your earlier post.  What I'm suggesting is that you put
a new function at the beginning of $EditFunctions.

array_unshift( $EditFunctions, 'MyFunction' );

>From within MyFunction(),  you can determine whether or not a save is
occurring (I believe @$_POST['post'] is the appropriate flag to check,  as
in ReplaceOnSave() ),  and tailor behavior accordingly.  Preview is
enabled if (!$IsPageSaved && @$_POST['preview']).

Does that make a bit more sense?


> Perhaps your function is running at the end of $EditFunctions,  after
> PostPage() has already executed,  so your changes aren't getting saved?  I
> had a similar problem recently.
> Russell
>> <html><div style='background-color:'><DIV class=RTE>
>> <P>The $ROSPatterns are working. However, I wanted the recipe to run off
>> of the inserted text, then replace the saved text. This way the function
>> will run the first time the document was saved, but not everytime. The
>> function will run if I Preview, but when I Save the $ROSPattern will run
>> and the function doesn't run. Does that make sense?</P>
>> <P>Monte</P></DIV>
>> <DIV></DIV>
>> #a0c6e5 2px solid; MARGIN-RIGHT: 0px"><FONT style="FONT-SIZE: 11px;
>> FONT-FAMILY: tahoma,sans-serif">
>> <HR color=#a0c6e5 SIZE=1>
>> <DIV></DIV>From:&nbsp;&nbsp;<I>"Patrick R. Michaud"
>> &lt;pmichaud at pobox.com&gt;</I><BR>To:&nbsp;&nbsp;<I>Monte Padget
>> &lt;m_padget at hotmail.com&gt;</I><BR>CC:&nbsp;&nbsp;<I>Pmwiki-users at pmichaud.com</I><BR>Subject:&nbsp;&nbsp;<I>Re:
>> [pmwiki-users] Text Replacement</I><BR>Date:&nbsp;&nbsp;<I>Thu, 4 Aug
>> 2005
>> 15:44:25 -0500</I><BR>&gt;On Thu, Aug 04, 2005 at 03:36:45PM -0500,
>> Monte
>> Padget wrote:<BR>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;I have been searching
>> pmwiki.org and no luck so far.<BR>&gt; &gt;<BR>&gt;
>> &gt;&nbsp;&nbsp;&nbsp;&nbsp;I would like to be able to have text
>> replaced
>> in a wiki page<BR>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;automatically. The
>> goal
>> is to allow the user to enter in something<BR>&gt;
>> &gt;&nbsp;&nbsp;&nbsp;&nbsp;specific, for which I'm trying to write a
>> recipe, and when the user saves,<BR>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;the
>> recipe will execute and replace the entered text with
>> non-recipe text.<BR>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;Are there any
>> functions available for this?<BR>&gt;<BR>&gt;Take a look at $ROSPatterns
>> (replace-on-save patterns).&nbsp;&nbsp;There are<BR>&gt;a couple of
>> examples in scripts/author.php
>> .<BR>&gt;<BR>&gt;Pm<BR></FONT></BLOCKQUOTE></div></html>
>> _______________________________________________
>> pmwiki-users mailing list
>> pmwiki-users at pmichaud.com
>> http://host.pmichaud.com/mailman/listinfo/pmwiki-users
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://host.pmichaud.com/mailman/listinfo/pmwiki-users

More information about the pmwiki-users mailing list