[dokuwiki] Re: DokuWikiFCKW.pm not working?
- From: Myron Turner <turnermm02@xxxxxxx>
- To: dokuwiki@xxxxxxxxxxxxx
- Date: Fri, 29 Aug 2008 09:53:09 -0500
I've been working on a major upgrade to DokuWikiFCK and I've written the
attached for users of DokuWikiFCK on windows. You may have to go into
the file and change the temp directory at line 51 from C:\Windows\temp
to your temp directory, although the php documentation suggests this
will not be necessary.
Change the name of html2wiki to html2wiki.pl and place it in the same
directory as your Perl binary, or any other directory which is in your Path.
Myron
Lindgren Daniel wrote:
Hello.
I've spent some time trying to get the FCKW DokuWiki plugin working in
my DokuWiki 2008-05-05 installation.
THe instrucions at
_http://wiki.flux-cms.org/display/DOKU/Installation_ seem to work, but
html2wiki does not accept the dialect DokuWikiFCKW.
_____________________
Myron Turner
http://www.mturner.org
http://net18reaching.org/cityscapes
*/
class action_plugin_fckg_save extends DokuWiki_Action_Plugin {
/**
* Constructor
*/
function action_plugin_fckg_save(){
}
function getInfo() {
return array(
'author' => 'Pierre Spring',
'email' => 'pierre.spring@xxxxxxx',
'date' => '2007-Mai-08',
'name' => 'fckg_save',
'desc' => 'Save Plugin for the Dokuwiki FCKW Plugin',
'url' => 'https://fosswiki.liip.ch/display/FCKW/Home');
}
function register(&$controller) {
$controller->register_hook('DOKUWIKI_STARTED', 'BEFORE', $this, 'fckg_save_preprocess');
}
function fckg_save_preprocess(&$event){
global $ACT;
if (!isset($_REQUEST['fckg']) || ! is_array($ACT) || !(isset($ACT['save']) || isset($ACT['preview']))) return;
global $TEXT;
if (!$TEXT) return;
// transform html back into wiki syntax
$host = escapeshellarg($_SERVER['HTTP_HOST']);
$tmpfile = $this->temp_file($TEXT);
$TEXT = shell_exec("html2wiki.pl $tmpfile -dialect DokuWikiFCK --base-uri=$host");
unlink($tmpfile);
// this is a bit hacky. and dirty. but if you want to know, why i did so, ask me, and i'll tell you ;)
$TEXT = preg_replace('/(({{)|(\[\[))\//', '$1http://'.$_SERVER['HTTP_HOST'].'/', $TEXT);
$TEXT = @html_entity_decode($TEXT, ENT_NOQUOTES, 'UTF-8');
}
function temp_file($text) {
$tmpfname = tempnam("C:\Windows\temp", "_dw_");
$handle = fopen($tmpfname, "w");
fwrite($handle, $text);
fclose($handle);
return $tmpfname;
//
}
} //end of action class
?>
- References:
- [dokuwiki] DokuWikiFCKW.pm not working?
- From: Lindgren Daniel
Other related posts:
- » [dokuwiki] DokuWikiFCKW.pm not working?
- » [dokuwiki] Re: DokuWikiFCKW.pm not working?
- » [dokuwiki] Re: DokuWikiFCKW.pm not working?
Hello.I've spent some time trying to get the FCKW DokuWiki plugin working in my DokuWiki 2008-05-05 installation.
THe instrucions at _http://wiki.flux-cms.org/display/DOKU/Installation_ seem to work, but html2wiki does not accept the dialect DokuWikiFCKW.
- [dokuwiki] DokuWikiFCKW.pm not working?
- From: Lindgren Daniel