While working on an e-commerce system, I needed to use PHP to round a number to a minimum number of decimal places, but allow for more if needed. For instance, if the value was 1.2, I’d want it rendered as $1.20, but if it was 1.256, I’d want it to keep the precision and render as $1.256. I ended up converting the number to a string, splitting by the decimal, enforcing the minimum precision and then using PHP’s number_format() function, like: Read More »
I recently found Joomla’s feature to easily add custom component-specific nested Categories. It makes for a quick way to create categories similar to what is used in com_content and an interface to manage those categories without having to build it all manually. You can use JForm to easily add a select menu of your custom categories. The categories interface can even include a custom sub-menu to easily get back to the rest of your component.
I’m still planning to develop new form processing scripts, but in the meantime, a patch update has been posted for ProcessForm to deal with possible error messages in PHP 5.3+ about the eregi() function being deprecated (has been replaced by the newer preg_match() function). Also, I’ve switched the encoding to utf8 to better support non-English characters in the email text, confirmation screen and MySQL storage.
I should start out by mentioning that I’ve been a big fan of Panic for years – I’ve used Transmit since Mac OS 9 days, and Coda since its initial release. Since then, Coda has been my primary web development application.
I should also mention that I’m not someone who avoids change, particularly in the software I use. Over the years of waiting for a Coda update, I’ve delved into other apps like Espresso, Sublime Text, BBEdit, PhpStorm. There are plenty of things I’ve liked in each of the other apps (as far as I’m concerned, all the above are great), but I always found myself returning to Coda. Read More »
I’m developing a custom c-commerce component for Joomla 2.5, and today was struggling with using Ajax from my admin lists. I wanted to make small changes to the list via Ajax without having to reload the entire page – publish state, deletes, quick edits, etc. To handle the Ajax form submissions, I was using jQuery and the jQuery Form Plugin. Read More »
I recently had to dig up how to add a custom admin Quickicon (the icon links on the left side of the Administrator section’s control panel) in Joomla 2.5. In previous versions, I’d just built a custom admin module for each icon. Now, there seems to be a somewhat easier way. Read More »
I’ve been upgrading my Joomla! knowledge from version 1.5 to 1.7, and ran into an issue with JTable where my date fields, though they had a NULL default in the database, were getting saved with a value of ’0000-00-00′ on save, presumably because the value was being sent as an empty string. Read More »
I had some difficulty today trying to share my printer over the network with my wife’s new laptop running Windows 7 Home Premium. I’m not exactly sure which steps were all required, but I did end up getting it to work to where the Windows machine can now print to the Mac shared printer. Steps I took: Read More »
I ran into some issues with my local MAMP installation today. I’m not sure if MAMP did a behind-the-scenes update, or if it’s somehow related to my OS update this evening to Mac OS X Lion 10.7.1. Basically, all my custom virtual host configurations disappeared from: