View Full Version : Mass template change
After a little bit of inspiration from Trigunflame's compression hack I thought of this. A mass replace function for templates. For example, I'm going through optimizing the design of my forum and want to find and replace a certain patch of code which is used on almost every template with an optimized piece of code (CSS driven).
Would it be possible? It would kind of be like the Find and Replace of Dreamweaver...
It's there by default...
Find and Replace in Templates (be careful!)
and even...
Notes for Using Regular Expressions with Find and Replace
The regular expression option is for advanced users only! Setting this option to 'yes' will use preg_replace() instead of str_replace() for your find/replace operation. Do not use this option if you are not sure how to use PCRE regular expressions!
Example usage: Find <img (.*)/?> and replace with <img \1 /> would find all <img> tags and make them XHTML compliant by adding the closing slash. The actual command executed from this would be:
preg_replace('#<img (.*)/?>#siU', '<img \1 />', $template);
*slaps forhead* doh. Thanks :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.