Mootools is a fantastic Javascript framework library that gives you clean, well-tested, cross-browser mechanisms for browser capability detection, manipulating the DOM, injecting SWFs, making AJAX requests, and building animation into your client-side applications. I’m won’t try to sell it over other libraries like scriptaculous, dojo or jquery. But if you’ve selected mootools as your javascript […]
Category Archives: Web
Accessing SMB servers with PHP
NOTE: this is not supported at this timem. Please use newer code, like https://github.com/icewind1991/SMB. Recently, we had a need to retrieve and put files onto a Windows server from a Linux box. I looked around for a good way to access samba or Windows file servers from within PHP, and I didn’t find anything promising. […]
JSON-encoding private class members
In an AJAX application, it often is necessary to transport objects from your server-side PHP to the client-side Javascript. Using JSON to encode objects makes your life very easy on the client side — a quick eval(), and you’ve got an object to work with.
autoload conflicts
Our publishing system has a fairly large PHP object model, with tons of corresponding library files. Early in the development of the library, we saw huge value in PHP 5’s autoloader. But when we integrated a 3rd party library into our application, we quickly found a limitation when our __autoload() function conflicted with the other […]
Fuzzy matching city names
Recently, my team was tasked with building a system that would allow users to look up weather forecasts for arbitrary cities in the United States. The system had to allow for misspellings to give the user a forgiving but predictable interface. If the misspelling clearly matched a single city, it would use that city; otherwise […]
Omit the closing php tag
I found this little tidbit in the Zend Framework Programmer’s Reference Guide (in the Coding Standard appendix): For files that contain only PHP code, the closing tag (“?>”) is never permitted. It is not required by PHP. Not including it prevents trailing whitespace from being accidentally injected into the output.
The Outsider’s Guide to Joomla 1.5, Part 3
Once I had figured out the basic organization of menus and articles in Joomla, I had one more obstacle to overcome. I was looking at the sample site that was bundled with my installation, and I wanted to know how to control the various elements on my pages other than the articles. For example, the […]
Intelligent Abbreviation of Text (pretty_substr)
Recently, we found that we needed to limit the length of “headline” text on one of our sites for display purposes. The text in question was the title text for classified ads. Our classifieds system was simply truncating the title text at an admin-configured number of characters. This helps us preserve our design, but it […]
The Outsider’s Guide to Joomla 1.5, Part 2
Onward and upward with this nifty little CMS. I hope I wasn’t too negative in my first installment. It’s not that Joomla does things wrong, it’s just that sometimes, things are not as obvious as they could be.
The Outsider’s Guide to Joomla 1.5, Part 1
I found myself in an unusual situation recently. I’ve got 12 years of Web development under my belt — everything from markup to operating systems, javascript to Apache, switches to fileservers, PHP to load balancers. But I found myself challenged by technology that thousands use every day. An off-the-shelf open source CMS: Joomla (version 1.5).