How to Install Google Analytics on a WordPress Blog

If you are interested in finding out statistics about visitors to your blog, the best free way of adding tracking to your blog is to install Google Analytics. Google provides a free Analytics service – you create a new account with Google and they give you some code to place on your website which lets Google track visitors to your site. You can log into your Analytics account on Google and see stats such as the number of visitors from different countries, the number of times specific pages were viewed and so on.

You can sign up for Google Analytics here. The instructions for signing up and enabling tracking are fairly easy to follow if you are capable of adding a HTML file to your webhost account. Placing the tracking code on a WordPress blog though is not as obvious as it might be with a static website. However, the method is similar – all you need to do is place the tracking code just before the </body> tag in your WordPress theme.

To find the </body> tag in your current theme, follow these steps:-

  • Log into your WordPress blog as an administrator.
  • Under the Appearance menu on the left, click the Editor option.
  • Click on the Theme files options on the right to find one that contains the </body> tag.

The </body> tag may be in the footer.php file on your theme but on mine I found it in a file called end.php.

  • Paste your tracking code into the theme file just before the </body> tag and then save the file.

google-analytics-wordpress

Your Google Analytics account should now show stats for visitors to your blog. It may take up to 24 hours for the first visitor stats to appear in your account.

InstallShield Major Upgrade: Two entries in Add/ Remove Programs

After implementing an InstallShield Major Upgrade recently after making changes to a beta version of one of my software packages, I found that there were two entries in the Window’s Control Panel’s Add/ Remove Programs list. Despite the two entries, the installed package seemed to have installed and worked correctly on Windows XP, Vista and Windows 7. However, having two packages looked untidy and uninstalling either of them uninstalled the software package.

After a bit of research I found that the problem was because I was doing a major upgrade but I had not changed the package version, i.e. I had changed the product code and package code but had left the product version the same. (See this post for info on how to do an InstallShield Major Upgrade). However, in this particular case I needed to leave the version number the same. In order to get the installer to behave as I wished and leave only one instance of the package in the Add/ Remove list, I had to do the following in InstallShield:

1. In the Installation Designer, click the Upgrades node under the main Media node.

2. Open the upgrade entry I had created as advised in my earlier post on InstallShield Major Upgrades:

upgradeentry

3. In the Common Properties for the upgrade entry, instead of choosing to upgrade Any Earlier Version, choose a specific range of versions and enter 1.0.0 in the minimum version field, leaving the maximum value field blank. Remember to check the Version Range Inclusive field to be on the safe side:

installshield-minimum-version

Now when the installer runs it will perform a major upgrade even on an installation that has the same version number as the new (major upgrade) installer.

Importing CSV data from Excel into phpMyAdmin

When importing CSV data saved from Excel into a MySQL database using phpMyAdmin, I was getting an error indicating that there was an “Invalid field count in csv input on line 1″. The settings in phpMyAdmin asked for fields to be delimited by double quotes (“field”) but even after doing that I was still getting the same error message.

In order to get the input to work, I resaved the Excel file as a CSV (and didn’t place quotes around the columns) then removed the first row containing the field titles. In phpMyAdmin I then chose the following settings:

Format: CSV using LOAD DATA
Columns terminated by ,  (not the default of ; )

All other settings were left at their default.

I was then able to successfully import the CSV file.

New Help Desk Launched

As part of our ongoing efforts to improve customer service, SliQTools has now opened a new support help desk feature at support.sliqtools.co.uk. The new help desk software allows customers (or potential customers who are using trial versions of our software) to submit support or sales tickets and track their progress to closure.

The new help desk brings a number of benefits to our customers such as the the ability for customers to see their old tickets and replies. From SliQTools point of view, an added bonus of the help desk is that it provides us with a mechanism to expand our knowledgebase of frequently asked questions. The help desk lets our support staff to write articles to support tickets. These articles then become available for other customers to search through. As the knowledgebase builds up content, customers should increasingly be able to find answers to common support queries so that their problems are solved more quickly.

InstallShield Major Upgrade

Sometimes after making some changes to a product, either updating assemblies or adding or removing assemblies, an installer fails to update a previous version. After running the installer, no errors or warnings are produced but the program files remain unchanged. If this happens the best solution I’ve found is to configure InstallShield to perform a major product upgrade.

To configure a major upgrade, you need to do the following in InstallShield:-

1. Configure an upgrade in the Upgrades node under the main Media node in the Installation Designer …

installshield-upgrades-node

a. First, right-click on the Upgrade Windows Installer Setup node and add a new major upgrade. Make sure that the major upgrade setting Products Sharing my Upgrade Code is selected.

installshield-major-upgrade

b. Click on the Upgrade Windows Installer Setup node and make sure the option to uninstall the old setup is selected.

new-upgrade-node

installshield-major-upgrade-settings

2. Change the Product Code GUID via the Product Properties view under the main Installation Information/ General Information node. Note: DO NOT CHANGE the Upgrade Code – the installer will use this to automatically uninstall the previous version of the product.

installshield-product-code

3. In the Summary Information Stream view, update the Package Code GUID.

installshield-package-code

3. Then rebuild your installer and test it out. Your installation should now be upgraded properly.

Note that if the installer is intended to perform a major upgrade of a package with the same version number (as opposed to the more normal situation of a major upgrade of the same package with a lower version number), see this post for more info.

Purchase Order Software

One of the main things added to version 3 of SliQ Invoicing Plus was the ability to create purchase orders. The new purchase order feature lets users create POs in a similar way to invoices and quotes. As well as storing a list of purchase orders already raised, version 3 also lets you store a list of suppliers with their addresses and contact details. When adding items to the purchase orders, you can optionally choose to add the items as standard products into SliQ’s product database. When items such as suppliers and products are stored in SliQ’s database, they can easily be reselected when editing a new PO – just enter the first few characters of a supplier name for example, and SliQ will autofill the remaining part of the supplier’s name as well as include the correct address details on the PO.

SliQ Invoicing Plus Version 3 Released

After a number of months in development, SliQ Invoicing Plus V3 has been released.

The new version includes a number of features requested by our customers including:-

- Support for Purchase Orders and Supplier Data

- Optional Password Protection on Company Files

- Tax or VAT Summary tables on invoice templates

Over the next few months we have a new development plan for SliQ Invoicing and will be adding a number of new features into version 3 on a one or two month release cycle into the middle of next year.

As with previous versions, version 3 is available for a one-off price and includes a free 30 day trial. V3 is 100% compatible with V2 and will automatically import and convert all data and settings from V2 when installed on an existing user’s PC.

For more information on the new features in version 3, check out our Release History page.

Note: For information on the release of SliQ Invoicing Plus V4, see http://www.sliqtools.co.uk/blog/releases/sliq-invoicing-plus-version-4-released/.

Windows Mail on Vista – Simple MAPI send problem

If your application will not send emails using Windows Mail on Windows Vista, it’s worth checking if Windows Mail is set as the default email client. To check if Windows Mail is set as the default:

  1. Run Windows Mail by clicking Vista’s Start button then choosing All Programs. Then click on Windows Mail.
  2. When Windows Mail appears, click on its Tools menu and choose Options.
  3. In the General tab, look under the Default Messaging Programs section at the bootm. If the Make Default button next to “This application is the default Mail handler” is checked, Windows Mail should be the default email client on the PC.
  4. If the Make Default button is enabled, press it to make Windows Mail the default on your PC.
  5. Click OK to close the Options dialog.

It’s also worth checking the default settings in Vista’s start menu …

  1. Click on Vista’s Start button then choose the Default Programs option.
  2. Choose the Set your default programs option.
  3. In the window that appears, choose Windows Mail.
  4. Click the Set this program as default option that appears on the bottom right of the window.

After following the procedures above, if Windows Mail should work properly when another application on your PC uses Window’s Simple MAPI service to send emails.

For help on sending emails using Windows Live Mail on Windows 7, check this blog post.

Splitting a time value into day, hour, mins, secs in PHP

I’ve been writing a new webpage that calculates the time left before a user license period expires. I wanted to display the time as a countdown of the number of days left before the license runs out. I couldn’t find an off-the-shelf PHP function to do the job so I quickly wrote the function below.

/* This function takes a PHP time value and returns the duration as an array
with 4 elements -
element 0 = days
element 1 = hours
element 2 = minutes
element 3 = seconds
*/
function DurationInDHMS($timeduration)
{
    $days = floor($timeduration / 86400);
    $timeduration = $timeduration - ($days * 86400);
    $hours = floor($timeduration / 3600);
    $timeduration = $timeduration - ($hours * 3600);
    $minutes = floor($timeduration / 60);
    $seconds = $timeduration - ($minutes * 60);
    return array($days, $hours, $minutes, $seconds);
}