PHP

Facelift (FLIR) 1.2 now available on github

In the past I've written about Facelift Image Replacement (FLIR), a technology for providing fonts to web pages when visitors don't have the font installed. Unfortunately, the project homepage no longer exists, and the author Cory Mawhorter doesn't seem to have moved it anywhere else.

Since the project was released under a GPL 2.0 license, I've rebuilt version 1.2 (the latest copy I had) from source code within a project I was working on. I've made it publicly available as a repository on GitHub.

Magento Custom Shipping Part 2: Order Handling Fees

So now that we've built the basic framework for a custom shipping module in Magento Custom Shipping Part 1, its now time to move on to the special business logic that my client needs.

My client isn't shipping the usual pre-packaged electronics and other consumer goods you usually find online. Instead, they ship a product priced in standard units of volume. And since shipping is by semi truck, there's a maximum and minimum quantity that can be shipped.

Setting the Maximum and Minimum are fairly easy using the built-in Cart and Product tools from Magento. But now we need to calculate shipping costs. My client's shipping is calculated using this simple formula:

Quantity of Material x Handling Fee (per unit) + Delivery Charge (per region)

The first part of this, the handling fee, is pretty easy. Read More to see how we add the handling charges to our module

Magento Custom Shipping Part 1: Build a Custom Shipping Module

I am developing an ecommerce site in Magento, when I ran into a wall with the built-in shipping system. To be fair, Magento's shipping is incredibly robust, with a lot of add-on plugins to provide any missing requirements. However, like many small businesses, my client has some very unique needs and business logic, which means there is no off-the-shelf solution for their particular scenario. In this case, they needed a custom shipping solution. The product is delivered in bulk by semi truck, and different local delivery areas have different pricing structures. Naturally, hooking into Fedex or UPS shipping systems would not fit the bill.

Read on for a tutorial on how to build a custom shipping module.

Custom User Login Block on Drupal 6 Zen sub-themes

I was trying to override the login block displayed on one of my Drupal sites and I kept running into a lot of trouble. No matter what functions I tried overriding in my template.php, nothing was displaying. All the tutorials I could find online didn't take into consideration the specifics of using a Zen subtheme. Hopefully my guide here will avoid this problem.

Using MooTools 1.2 in Joomla

MooTools is on version 1.2.3 (after completely dropping 1.1.1 as the default about a year ago), and version 2.0 is expected before years' end. Joomla however, still is including 1.1.1 because of compatibility issues with various plugins. People have been asking how to safely replace the version of MooTools included. Since I've done this several times, I figured I'd share my method here.

J-AMFPHP v 0.3 is released!

Yes, that's right... I've fiinished reworking my mistakes in trying to integrate AMFPHP 1.9b2 and successfully branched the Discovery Service to be its own plugin rather than be installed by the core component. This helps fix some install/uninstall issues, as well as make the component actually useable.

 

Release Notes: 

This release is not backwards compatible with previous releases of J-AMFPHP. This release comes in two parts. The Core Component installs AMFPHP 1.9b2 and the Flash-based service browser. The second part, the Directory Service Plugin, allows the service browser to actually browse the AMFPHP services that are installed.

Both the component and the plugin must be installed for the Service Browser to work. This version incorporates some features planned for later releases that were deemed to be necessary earlier than anticipated. The roadmap has been updated to reflect this, and it explains why I'm skipping v 0.2

 

Changes:

Wow, where to start...

First off, v.15 had unnoticed bugs. v.3 is refactored so that AMFPHP 1.9b2 is correctly integrated.

Second, the core AMFPHP Discovery Service has been forked to its own plugin.

Third, The AMFPHP "gateway" is now located at siteroot\amfphp\index.php - You'll want your Flash/Flex files to point to that. Example URL: http://www.example.com/my_joomla_site/amfphp/index.php I've also included support to allow you to use 'gateway.php' if you prefer. This mimmicks the behavior in the core AMFPHP setup and is probably what most examples use.

 

Check out the project page, or download it right away

J-AMFPHP v 0.3.2

AMFPHP is a library to expose object-oriented PHP methods and functions to Flash through a binary data stream similar to XML-RPC.

J-AMFPHP adds this functionality to Joomla and exposes the Joomla API to Flash developers.

J-AMFPHP Take 2

So, the J-AMFPHP project is rolling along. After I started digging into it, I've run into a couple of things that will mean changes to the roadmap.

 

First of all, AMFPHP 1.9b2 is available. Its code structure and framework makes it much more suitable to incorporation in a project like Joomla. So, I decided to switch gears a bit and work towards 1.9b2 instead of 1.2.

 

Second, I've been in touch with one of the core developers of Joomla regarding how the XML-RPC plugin works. After discussing with him how it's integrated, I've found that it works in a manner that is very similar to how AMFPHP 1.9b2 works. That makes another reason to go for 1.9b2, as I should be able to model substantial parts of the code off the Joomla XML-RPC plugin.

 

So, in terms of roadmap changes:

 

Initially, I planned to have AMFPHP services be database hosted, and I figured I'd have to write a plugin framework to access them. That's no longer the case. Now they will be installed as plugins, just like the XML-RPC services are.
For a short time, I considered maintaining simultaneous releases for AMFPHP 1.2 and 1.9b2. This is no longer the case.
There are some bugs in the Joomla 1.5 install system that you realy don't want me to detail. I'm figuring out workarounds which have delayed core development. One of these workaround means the AMFPHP Service Lister service will not be included in the component install package. It will be installed seperately. This may also mean that the AMFPHP browser will be installed as a seperate component as well. We'll see.
For full details of roadmap changes, take a look at the project page on joomlacode

J-AMFPHP v 0.1

J-AMFPHP is a component for Joomla! 1.5 to add AMFPHP as a library. It is no longer available for download. Please use version 0.3.2

J-AMFPHP

So I took the plunge and setup my first open-source code project.

 

Here's the idea:

Joomla! is a great Content Management Syste, it's the one that powers this site, as well as most of the sites I have developed. One of the sites I have developed with Joomla had a Flash interface in addition to the usual HTML interface. Developing that Flash interface was really a pain and a very one-off custom solution.

 

As part of the bridge between Flash and Joomla!, I used AMFPHP. Flash has hooks for a binary data transmission stream called Flash Remoting. It is normally only used between Flash and Cold Fusion servers (another Adobe product). It also is pretty much the only way of allowing Flash to interact directly with a server. AMFPHP is a beautiful solution that allows a developer to take advantage of Flash Remoting, but run it on top of PHP instead of relying on a Cold Fusion server.

 

So, as it stands today, the only way to integrate a Flash site with a Joomla backend is to use AMFPHP, and build all your own functions in PHP to allow Flash to call what it needs from Joomla.

 

What I am going to do, is develop a new project called J-AMFPHP. The goal of this project is to build a plugin for Joomla! that completely exposes the Joomla! API to Flash developers through the AMFPHP bridge. This way Flash/PHP developers don't have to keep reinventing every function between Flash and Joomla and instead focus on just the custom ones that they need.

 

J-AMFPHP project page on JoomlaCode