Supporting legacy code, using global variables and register_globals with PHP 5.4.x

 Recently we ran into some issues with some of our old sites that are relying on the register_globals  for variable access after upgrading to PHP 5.4 which wisely no longer supports this kind of setup.  Using globals in this fashion  is a horrible practice, but sometimes you gotta maintain some legacy code. To use global variables you can add a line of code to htaccess that will run a “globalizer” file before loading the main page on every page load and extract the required variables. globalizer.php file <!--?php...

read more

Fix osCommerce 2.3.x to be compatible with PHP 5.4.x UPDATED

 To make your version of osCommerce 2.3.1 or 2.3.2 compatible with upgrading to PHP 5.4.x you only need to replace 2 files.  The reason why those versions of osCommerce die with the upgrade to PHP 5.4.x is because of the new session handling process in PHP 5.4, you can read about it here: http://php.net/manual/en/migration54.php.  Please note that this fix does not account for any plugins or custom code that you might have.  If you have customized your site there may be other files you will need to update. To fix: start by downloading...

read more

WordPress Recipe-Press plugin, ingredient page link select not displaying saved result

 When implementing the Recipe-Press WordPress plugin for a client we came across an issue that the ingredient page link select did not display the saved result, and just defaulted to none. Maybe this image will help Hence even though the proper page link gets saved, it doesn’t show that selection on the form           The Solution: 1. Open YOUR-PLUGIN-DIRECTORY/recipe-press/includes/form_tags.php 2. Go to line 303 and find the following piece of code in function recipe_dropdown_pages...

read more

CSS Link Image Replacement -LIR- (CSS Buttons)

 This is our own flavor of CSS Image Replacement I guess we’ll call it LIR (link image replacement) that borrows heavily from existing techniques, mainly: Fahrner Image Replacement (abbreviated FIR) Phark method, developed by Mike Rundle Dave Shea‘s eponymous Shea method Here’s a good article for image replacement techniques Nine Techniques for CSS Image Replacement, however, the technique we present works specifically for links. This technique is cross-browser compatible, should work well in screen-readers, and is SEO...

read more

osCommerce Get Cheapest Product in Category

 Here’s a function that you can use to find and get the cheapest product in any category. The function looks at the base price (product_price) and special price (specials_new_products_price) and chooses the lesser value; I added it to includes/functions/general.php, but you can add it anywhere it makes sense to do so.   //// // Get Cheapest Product in Category // function tep_get_cheapest_prod_in_cat($cat_id=0) {   global $languages_id; $res=false;   $categories = array(); ...

read more