[pmwiki-users] Re: search pattern

Patrick R. Michaud pmichaud at pobox.com
Thu Jul 7 11:41:11 CDT 2005


On Wed, Jul 06, 2005 at 11:31:52AM -0700, Jan Peters wrote:
> Thanks I modfied it to
> 
>  Markup('search','_directives', '/\\(:search\\s*(.+?):\)/e',"search 
> ('\$1')");

That should be just 'directives' (no underscore).

> but it still gives me this error:
> 
> search string
> Warning: Cannot modify header information - headers already sent by  
> (output started at /private/Network/Servers/monet/Volumes/monet/ 
> jrpeters/Sites/clmc/local/mypublications.php:6) in /private/Network/ 
> Servers/monet/Volumes/monet/jrpeters/Sites/clmc/pmwiki.php on line 706
> 
> Do you have an idea how to fix that?

Yes.  Functions called in the markup cannot use "print" statements
for their output -- instead they have to return a string that PmWiki
can substitute at the appopriate point in the page text.  Internally,
PmWiki does all markup conversion prior to outputting any text or 
headers (it has to do this since there are markups that can affect 
the header output), so if any markup functions execute "print" or
"echo" these will be output before PmWiki does any other output.

If you really need to be using print/echo, then  you'll want to
investigate the use of the ob_start() PHP functions to capture output
into a string.

Pm



More information about the pmwiki-users mailing list