One use for replacement variables is to correct common spelling mistakes. For example, on the vBulletin Community Forums a replacement variable exists to replace all instances of the incorrect abbreviation for vBulletin “VBB” with the correct abbreviation “vB”.
Replacement variables can be used to insert commonly-used blocks of HTML.
For example, a replacement variable could be set up to replace <tablestart> with <table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center">.
As another example, your templates could contain blocks of code like this:
Before being displayed in a visitor's browser, the replacement variable system would identify the <tablestart> replacement variable and replace it with the following:
<tablestart> <tr> <td class="alt1">Cell contents...</td> </tr> </table>
Replacement variables in vBulletin are case insensitive, meaning that a replacement variable set to replace for word will also replace Word, wOrD and WORD.
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center"> <tr> <td class="alt1">Cell contents...</td> </tr> </table>
The replacement variable system is activated in the last stages of page processing before the HTML is delivered to a visitor's browser. The system searches for target text in the completed, parsed templates.
For example, if you create a replacement variable to search for html and replace it with HTML, any hyperlinks pointing to files with a .html suffix will have those links replaced with .HTML, which is not the same file on a Unix web server, since Unix file paths are case sensitive.
Replacement can be useful, but replacement variables can break the functionality of your site if used incorrectly.
Worse still, if you create a replacement variable to turn every instance of the word home into a hyperlink pointing to your home page: <a href="home.html">home</a>.
You might have the situation where the word 'home' is used in locations where creating a hyperlink would cause invalid HTML, such as the following:
<img src="home.gif" alt="" />
...which would end up being delivered to the browser as the following:
<img src="<a href="home.html">home</a>.gif" alt="" />
...which is invalid HTML and will not function correctly.