Skip to content
lokothodida edited this page Aug 19, 2013 · 4 revisions

NOTE

This plugin will replace ALL occurrences of your initial strings. This can lead to problems, especially regarding XML formation, if used unwisely.

Use at your own risk.

Installation

Unzip the contents of the project to the /plugins folder. Enable the plugin from the Plugins tab on the admin panel.

Initialization

Simply going to 'Configure stregReplace' from the Plugins sidebar link will perform the initializing conditions: creating the stregReplace data (sub) folders.

Replacements

  • Set the directory desired for your replacements to be performed on. This directory is relative to /data, so to perform the replacements on all pages, just type 'pages'. This will work for any existing directory with XML files.
  • Then choose the most suitable replacement type. All options use PHP replace functions - string uses 'str_replace', Case insensitive uses str_ireplace and Regex uses 'preg_replace' (and hence requires starting/ending delimiters).
  • Click '+' to add as many replacements as are necessary.

stregreplace_3

  • Fill in the 'From' table with the initial expressions and 'To' with the respective changed expressions.
  • Click 'Replace' and the operations will be performed.

stregreplace_5

Results

  • Files will have the expressions replaced in accordance with the initial parameters
  • A log will be created in data/other/stregReplace/logs/ to indicate which files were successfully/unsuccessfully changed
  • A backup (zip) of all of the files will be created in data/other/stregReplace/backups/. If the results aren't to your liking, you can just unzip the file to the relevant directory to restore the content to its previous state
Clone this wiki locally