HotDoodle Logo
How to Replace All Strings in a WebSite

HotDoodle websites have a utility to replace all occurances of a string with another in the text areas of the blocks of a site.   The utility is automatically used when a template is named to insert the site name into the header and other references in the site. It is also available interactively but has several dangers.

Dangers:

  • The replacement is irreversable.  It does not go through the normal block specific logic and just tweaks the underlying database fields. There is no record of all the places changed or even a full count of the number of text replacements.
  • The replacement is exact and case sensitive. Replacing 'apple' with 'orange' would not replace 'Apple' with 'Orange'
  • The replacement is on the underlying raw HTML and not on the text representation.
    • So replacing < > or html verbs like br or BR (as in <br> ) would zap lots of places, irreversably
    • Phrases with HTML inside them would not be replaced. The previous sentence, for example does not have the word "inside" in it, what it has is the word <span style="text-decoration: underline;">in</span>side -- the HTML embedded in the phrase makes the phrase not be a match

Run this at your own risk. Backing op the site first is a good idea.

Note: A site has just 1 backup, so if you backup the site, make some changes, run the command, do more stuff, backup the site again and then discover that you blew it earlier -- the tough, you have overwritten the good backup with your changes.   What you can do, however, is copy the site as that copy will be a backup of that point in time.


Invocation

Because of all of its dangers the command is not present in any user menu. The command is

?action=run&m=searchmodule&a=str_replace&module=administrationmodule

This must be done at the end of the URL that is opened for editing.  For example

  • If you were editing http://s6.hotdoodle.com/bnitricities, then the command would be http://s6.hotdoodle.com/bnitricities?action=run&m=searchmodule&a=str_replace&module=administrationmodule
  • If you were editing http://bnitricities.com, then the command would be http://bnitricities.com?action=run&m=searchmodule&a=str_replace&module=administrationmodule

While these may be the same site, as far as permissions go they are entirely different sites, so you need to pay attention to the URL you are using.

© 2006 - 2015 Metabyte, Inc., All Rights Reserved, Patents Pending

http://www.hotdoodle.com, HotDoodle™ Custom Web Design and Quality Affordable Website Designers for Small Businesses and Professionals
Powered by http://www.hotdoodle.com, HotDoodle™ Custom Web Design and Quality Affordable Website Designers for Small Businesses and Professionals
Custom Website designs for Self-edit Sites Site Map