CMSMS FormBuilder Version: 0.9 Attachments Don’t Delete

  While working on a CMS Made Simple site for a client, we ran into an issue with uploaded files to be used as email attachments not being deleted after the email is sent. This applies to their CMSMS FormBuilder Module Version 0.6. The issue was in how the code in cmsms_root/modules/FormBuilder/classes/FileUploadField.class.php was not implemented properly.  Here’s the replacement function you can use instead of the original PostDispositionAction() function, to make it work properly. function PostDispositionAction() ...

read more

Regular expression to move legacy array index PHP code to PHP 5.4.x

 This was a bit of  headache; after we upgraded our servers to use php 5.4 we had a few clients who’s sites that went down.  For the most part it was a simple fix, of prepending a globalizer file to all page requests via htaccess, or just updating the session handling routines as various functions like session_register(), session_destroy().  However one of the sites was heavily relying on old style array syntax so things like unquoted associative array keys such as $var[index] (instead of the proper $var[“index”] were...

read more

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

osCommerse configure.php troubles

 An osCommerse installation was giving me a bunch of problems with configure.php and it’s modules, boxes and other paths.  The problem was the install did not like virtual directory paths, but worked fine with physical directory paths.  Here is a quick fix that may help you. Add the following code to set the include path in your appication_top.php file(s). Do this in \www\includes\application_top.php: // ADD INCLUDED PATH MANUALLY // set_include_path(get_include_path() . PATH_SEPARATOR . '/home/cgt001/www'); // END ADD...

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