DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:replace

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
plugin:replace [2009-10-08 11:52] – tag cleanup layneeplugin:replace [2014-05-11 18:38] – old revision restored (2012-01-23 14:29) ach
Line 8: Line 8:
 lastupdate : 2009-04-13 lastupdate : 2009-04-13
 compatible : 2009-02-14 compatible : 2009-02-14
 +similar    : easyvar, kixovar, fields, macros, textinsert
 tags       : search, replace tags       : search, replace
 +
 +downloadurl: http://dwp-forge.googlecode.com/files/replace-2009-04-13.zip
 ---- ----
  
Line 69: Line 72:
             'name'   => 'Replacer',             'name'   => 'Replacer',
             'desc'   => 'Replaces words thought DokuWiki automatically from replace.conf with the snippet defined.',             'desc'   => 'Replaces words thought DokuWiki automatically from replace.conf with the snippet defined.',
-            'url'    => 'http://www.dokuwiki.org/wiki:plugins',+            'url'    => 'http://www.dokuwiki.org/plugin:replace',
         );         );
     }     }
Line 117: Line 120:
 Thank you very much for this plugin. For me it has been extremely helpful. (For beginners: Copy the PHP code into dokuwiki/lib/plugins/replace/syntax.php and create the file dokuwiki/conf/replace.conf with the substitutions. Use the %% markup to substitute plain text) Thank you very much for this plugin. For me it has been extremely helpful. (For beginners: Copy the PHP code into dokuwiki/lib/plugins/replace/syntax.php and create the file dokuwiki/conf/replace.conf with the substitutions. Use the %% markup to substitute plain text)
  
 +==== Integration with confmanager-plugin ====
 +
 +To modify replace.conf via admin-menu install [[confmanager|confmanager-plugin]] and modify following lines:
 +
 +admn.php (line 9): add "replace"
 +<code php>
 +    var $cnffiles = array('acronyms','entities','interwiki','mime','smileys','replace'); // add conf-files here; must be filename
 +</code>
 +
 +lang.php (for german)
 +<code css>
 +$lang['cnf_replace'  = 'Replace';
 +$lang['head_replace'  = 'Replace';
 +$lang['text_replace'  = 'Hier sind die Einstellungen f&uuml;r die Replace-Plugin-Ersetzung. F&uuml;r genauere Informationen besuchen sie <a class="interwiki iw_doku" href="http://www.dokuwiki.org/plugin:replace">Replace-Plugin</a>';
 +</code>
 +
 +
 +==== Feature suggestions ====
 +
 +
 +  * Please add **mutiple words** support - I would like to hack it but I don't get it *arg* -- //[[xxx.de|Christian]] 2009/12/10 13:05//
 +  * Any way to do the replace within a source line? I would like to do the substitution for copy-pasting into multiple conf files. I guess I'm looking to also include the 'protected' + 'substition' modes.
 +\\
 +\\
 ==== Replacement text is not shown ==== ==== Replacement text is not shown ====
  
Line 150: Line 177:
  
 Fixed in version 2009-04-13. No extensive testing, I was just looking for a similar feature for another plugin and got curious if it's possible to make this one to work. Seems so. --- //[[spambox03@mail.ru|Mykola Ostrovskyy]] 2009/04/13 19:41// Fixed in version 2009-04-13. No extensive testing, I was just looking for a similar feature for another plugin and got curious if it's possible to make this one to work. Seems so. --- //[[spambox03@mail.ru|Mykola Ostrovskyy]] 2009/04/13 19:41//
 +
 +----
 +
 +Working 2011-01-23. replace.conf needs double % before and after replacement text. (sry example replace.conf breaks page formatting).
 +original
 +<file>
 + start brc  Brc bRc  brC end \\  
 + start haccp ifs ifs6 brc5 end
 +</file>
 +replaced
 +<file>
 +start BRC BRC bRc brC end
 +start HACCP IFS IFS6 BRC5 end
 +</file>
  
 ==== Plugin (2009-04-13) fails at line 74 ====  ==== Plugin (2009-04-13) fails at line 74 ==== 
Line 190: Line 231:
 </code> --- //[[holger@doessing.net|Holger Doessing]] 2009/05/11 16:50// </code> --- //[[holger@doessing.net|Holger Doessing]] 2009/05/11 16:50//
  
 +
 +==== Bugfix for special chars (2012/23/01) ====
 +
 +<code php>
 +<?php
 +
 +function preConnect() {
 +    if(!count($this->replace)) return;
 +    $replacers = array_map('preg_quote', array_keys($this->replace));
 +    // removed '\b' at beginning and end. Had problems to replace "@cloud." with "~~TAGCLOUD~~"
 +    $this->pattern = join('|', $replacers);
 +}
 +
 +</code>
 +[[robert.jaeckel@verwaltung.uni-halle.de|Robert Jäckel]]
plugin/replace.txt · Last modified: 2018-06-05 22:56 by Klap-in

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki