PHP Trick for Bloated OpenSource Software">PHP Trick for Bloated OpenSource Software
If your anything like me nothing is great until you’ve hacked it apart. However with OpenSource software many times your hacks and mods will be overwritten every time you upgrade to the latest and greatest. So how can one combat this task with little to no hacks?
First off let me say that I’m not knocking any software here, I know that people pour hours and hours of their heart and soul into building something that can be used by nearly anybody. But as a seasoned designer I have to gripe about CSS bloat, it’s everywhere, tags nested ten to twenty levels deep sometimes.
So if you're using PHP, you can always do what I’ve done using the ob_start method (in fact it’s how I’m building the Acronyms for this site currently).
So if you want to change a few things around, this is a pretty good method to help you avoid hacking core files to an OpenSource application. The code below is what you want to place before your file starts, or your content area if you’re just looking to change some wording.
This site was built using the Wordpress CMS and carefully loved with CSS for your viewing pleasure.
-
// set up an array of words you want to find, then replace
-
’ CSS ‘,
-
’ CMS ‘,
-
);
-
-
’ <acronym title="Cascading Style Sheets">CSS</acronym> ‘,
-
’ <acronym title="Content Management System">CMS</acronym> ‘,
-
);
-
Simple array in place, if you were only going to replace one word on the site you could just surround it with quotes and put it into the echo str_replace function, I find this useful to help remove extra classes and ID’s unnecessary to a CMS, makes my job easier as a designer to keep the Stylesheet well formed.
Posted in PHP Be the first to comment! »

