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
Last revisionBoth sides next revision
plugin:replace [2011-06-11 19:46]
– [Integration with conf-manager-plugin] 84.57.51.19
plugin:replace [2018-05-20 17:13]
Aleksandr
Line 1: Line 1:
-====== replace plugin ======+====== replace Plugin ======
  
 ---- plugin ---- ---- plugin ----
Line 5: Line 5:
 author     : James Dempster (letssurf) author     : James Dempster (letssurf)
 email      : letssurf@gmail.com email      : letssurf@gmail.com
-type       : Syntax Substition+type       : syntax
 lastupdate : 2009-04-13 lastupdate : 2009-04-13
 compatible : 2009-02-14 compatible : 2009-02-14
Line 11: Line 11:
 tags       : search, replace tags       : search, replace
  
-downloadurl: http://dwp-forge.googlecode.com/files/replace-2009-04-13.zip+downloadurl: https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/dwp-forge/replace-2009-04-13.zip 
 +bugtracker :  
 +sourcerepo :  
 +donationurl:  
 + 
 +screenshot_img: 
 ---- ----
  
Line 17: Line 22:
  
 Comments welcome. Comments welcome.
- 
  
 ===== Download and Installation ===== ===== Download and Installation =====
Line 23: Line 27:
 Download and install the plugin using the [[:plugin:plugin|Plugin Manager]] using the following URL. Refer to [[:plugins]] on how to install plugins manually. Download and install the plugin using the [[:plugin:plugin|Plugin Manager]] using the following URL. Refer to [[:plugins]] on how to install plugins manually.
  
-  * [[http://dwp-forge.googlecode.com/files/replace-2009-04-13.zip|replace-2009-04-13]] +  * [[https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/dwp-forge/replace-2009-04-13.zip|replace-2009-04-13.zip]]
  
 ===== Version History ===== ===== Version History =====
Line 35: Line 38:
  
   * First release.   * First release.
- 
  
 ===== Source Code ===== ===== Source Code =====
Line 72: Line 74:
             '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 119:
 ?> ?>
 </code> </code>
 +
 ===== Comments ===== ===== Comments =====
 +
 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 txt-manager-plugin ====+==== Integration with confmanager-plugin ====
  
-To modify replace.conf via admin-menu install [[txtconf|txt-manager-plugin]] and modify following lines:+To modify replace.conf via admin-menu install [[confmanager|confmanager-plugin]] and modify following lines:
  
 admn.php (line 9): add "replace" admn.php (line 9): add "replace"
Line 135: Line 139:
 $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>'; $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> </code>
- 
  
 ==== Feature suggestions ==== ==== Feature suggestions ====
  
- +  * Please add **mutiple words** support - I would like to hack it but I don't get it *arg* -- //Christian 2009/12/10 13:05//
-  * 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.   * 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 231: Line 233:
 </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