mtense productions

some stuff you might find useful

Subscribe to this list via RSS Blog posts tagged in PHP

I helped a buddy develop an ecommerce site in joomla using hikashop.  Hikashop's cart module functionality is a bit limited.  You either get a very verbose full cart or a very minimal mini cart. We customized the mini cart to include the ability to expand to the full cart in either a slider or popup. This makes the functionality similar to what you find at amazon, especially when you move the cart to the very top of the page.

The cart hidden initially because it is empty. Add an item (from those below) to the cart to have it appear.  Then click the expansion image beside each to see how they expand.

Here are some demos of the expanding mini cart in action.

If you would like to add similar functionality to your hikashop, I have packaged up the files.


Tagged in: Hikashop Joomla PHP
Hits: 92585

Posted by on in Techie Stuff

It is really annoying when you are trying to make a file available for download and the user's browser keeps opening the file rather than allowing the user to save it.  This php script forces the Save As dialog to show up reliably when downloading a file.

To use the script, download it, set the $path variable to the relative path to your downloads folder, and upload the script to your website.  The default name for the downloads folder is "downloads".  Place your files in the downloads folder (specified in $path above) and link to the files like this:


For example, if your downloads folder is called "downloads" and it is at the root of your website, then there no changes necessary.  Simply upload the script to your website.

Download the script: download.php

Cleaning up the URL

On apache servers mod_rewrite can hide what's happening under the covers and clean up the download URLs.  So, for example instead of this


The user sees this


Although it appears that the file is being downloaded directly from the downloads directory, mod_rewrite can recognize and rewrite the URL to use the php script for downloading the file.

Options +FollowSymLinks
RewriteEngine On
RewriteRule   ^downloads/(.+)$   download.php?file=$1

Assuming mod_rewrite is available on your server, simply place the code above into the .htaccess file to support downlod URLs with no reference to the php script.  If the downloads directory is not in the root of your website, specify the path in the RewriteRule.  For example, if the downloads directory is located at /foo/bar/downloads, the RewriteRule should look like:

Options +FollowSymLinks
RewriteEngine On
RewriteRule   ^foo/bar/downloads/(.+)$   foo/bar/download.php?file=$1

Download the script with pretty URL: download.php

Tagged in: PHP Web
Hits: 6195

Richmond Sunlight provides tools for keeping track of what's going on in the Virginia General Assembly.

One feature of the website is tracking bills of interest by associating them with a free user account.  In addition to reviewing the status of the bills through their website, their Photosynthesis service and API makes it possible to gather information about specific bills in an automated fashion.  Details of Photosynthesis service and the API are documented on their website

I recently helped out on a small project using the API to pull and display information on specific bills.  The API is json and the website runs php, so the result was a nice little example of how to retrieve data in json format and display it in php.  I created this write up in hopes that it might help someone looking to do something similar.

Tagged in: JSON PHP Tutorial
Hits: 9004

Posted by on in Techie Stuff

Printing addresses labels for a list of people or organizations from a database is a pretty common task.  Often the users doing the printing are not technical and using a variety operating systems and software tools.  Therefore, a good goal for a solution is to provide all the pieces without relying on anything pre-existing on the user's computer.  This goal rules out using Word to do a mail merge which is a pain anyway.  Another useful goal is to provide some flexibility so more tech saavy users can create new or modify existing label templates.

There are some web-based label printing solutions available.  These don't require the installation of software, but saving and sharing the label templates is complicated and getting to data into these solutions is non-trivial or impossible.

General Solution

The approach I settled on uses Avery DesignPro client software which is available for free for Windows and OSX.  DesignPro supports laying out and printing labels on any of the gazillion labels Avery sells.  DesignPro will pull data from dbase (.dbf) files or an ODBC source.

Tagged in: Joomla mysql PHP
Hits: 8130

Posted by on in Techie Stuff

RokG2Slideshow is a extension of the RokSlideshow Joomla module that can pull the slideshow images from a Gallery2 installation as shown to the right.

All the original RokSlideshow functionality is preserved with new options for pulling images from a Gallery2 installation.  There are several different ways to integrate Gallery2 and Joomla.  This module is independent of the integration method (currently) and uses direct access to the Gallery2 installation to retrieve the photos.


In addition to enabling the Gallery2 integration,

  • specify the physical path to the Gallery2 installation on the server
  • specify the URL to access to the gallery via your website
  • select the type of images to retrieve from Gallery2 (random, recent, viewed, daily, weekly, monthly)
  • specify the number of image to retrieve and include include in the slideshow
  • optionally specify the Gallery2 album that you would like to limit the photos to
  • specify whether a URL should be associated with the image (none, album, image)
  • optionally specify a special URL to use to reach the gallery embedded in Joomla.  For example, gallery integrated with JFusion would have an embedded URL like: index.php?option=com_jfusion&Itemid=19


RokSlideshow is a Joomla! module was originally inspired by Slideshow by Aeron Glemann but rewritten from scratch by Olmo Maldonado. Since then it has been updated and modified by Djamil Legato. Most recently Aaron Nauman added the Gallery2 integration and packaged the module as RokG2Slideshow.


Gallery2 Slideshow 1.0 HOT
(0 votes)

G2Slideshow2 is an extension of the Slideshow2! javascipt slideshow to pull images from a Gallery2 installation.

Date 2013-04-04 16:05:26 File Size 2.9 KB Download 1590 Download


1.2 - 24-Feb-2010 mtense
# Added support for multiple modules on a single page

1.1 - 17-Feb-2010 mtense
+ Added support for adding URLs to Gallery2 images
+ Added support for URLs to include embedding info for integrations like JFusion

1.0 - 30-Jan-2010 mtense
+ Added Gallery2 support for RokSlideshow 4.1

Hits: 7708
You are here: Home Tags PHP