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
Both sides next revision
plugin:replace [2011-01-23 20:21]
94.210.200.16 [Comments]
plugin:replace [2018-06-05 22:56] (current)
Klap-in [Download and Installation]
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
 +similar    : easyvar, kixovar, fields, macros, textinsert
 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 16: Line 22:
  
 Comments welcome. Comments welcome.
- 
  
 ===== Download and Installation ===== ===== Download and Installation =====
  
-Download and install the plugin using the [[:plugin:plugin|Plugin Manager]] using the following URL. Refer to [[:plugins]] on how to install plugins manually. +Search and install the plugin using the [[plugin:extension|Extension Manager]]. 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 34: Line 38:
  
   * First release.   * First release.
- 
  
 ===== Source Code ===== ===== Source Code =====
Line 71: 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 116: 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 confmanager-plugin ====
  
-==== Feature suggestions ====+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>
  
-  * 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//+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* -- //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 214: 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.1295810470.txt.gz · Last modified: 2011-01-23 20:21 by 94.210.200.16