[pmwiki-users] Data storage project

The Editor editor at fast.st
Thu Jul 27 07:17:30 CDT 2006


Well, things are coming along a bit, I think...

I've been able to manually create a perfect replica of a wiki page
using the fwrite( ) function, by simply adding my own headers and
footers, and by replacing linebreaks with %0a.  And the data shows up
when I browse to the page just fine.  Two problems remain though.

First, the page content is still not searchable so I assume some
indexing function is required.  If I browse to the page, edit and save
it (exactly as is) it suddenly becomes searchable.  How can I force
the page to be indexed for searching?

Second, because I can no longer use line breaks but must use %0a to
separate field:value pairs, I need to rewrite the data read functions.
 Can anyone help?  Here is the pertinent function in buildforms.  I
suspect we need to tweak around line 6.

function BFrmReadPars ($fparms, $simple=FALSE) {
  global $pagename;
  clearstatcache();
  if ($fpr = @fopen($fparms, "rb")) {	
    $contents = fread ($fpr, filesize($fparms));
    if (preg_match_all('/([A-Za-z0-9]+):(.*)/', $contents, $match)) {
	  foreach($match[1] as $ord=>$ln) {
        if ($simple)
          $pars[$ln] = stripslashes($match[2][$ord]);
		else {
          $args = ParseArgs($match[2][$ord]);
		  if (isset($args['value']))
            $args['value'] = stripslashes($args['value']);
          $pars[$ln] = $args;
		  // unset ($pars[$ln]['#']);
		}
	  }	
    }
    fclose($fpr);
    return $pars;
  }
}

Sorry I'm not much better of a php coder.  Thanks in advance for all your help!

Cheers,
Caveman




More information about the pmwiki-users mailing list