Random Banner Script using PHP
Written on 08/27 • 0 CommentsI wanted to start alternating the banner advertisements on this site so started looking around for the simplest way to randomly display a different banner in my case a few lines of code that included the link, image and some text. I found a number of scripts that all seemed a bit clunky. I started thinking there must be a better simpler way.
All the solutions I found used the php function rand. We end up having to generate a random number from a range e.g. rand (0,100); will give us a random number between 1 and 100. There are a few problems here, firstly the range needs to be set to reflect the number of banners we have in our array so therefore we end up having to count the items in the array or use a fixed number.
The problem with rand is it deals with integers not blocks of code. I started looking for an alternative and stumbled upon shuffle. Shuffle as you would expect takes our array and reorders it at random as you do with a deck of cards. If you shuffle a deck of cards hen take the top card you end up with a random card from the pack each time. The other good thing about shuffle is it shuffles the whole array without us having to specify the number of entries.
Continue ReadingFree Joomla Blockquote Module
Written on 07/30 • 0 Comments
Download the latest version of the blockquote module. Blockquote is a simple extension that allows you to add your own custom quote to any module position in your Joomla install and have it displayed in the front end.
Continue ReadingMove Related Products to Centre Column in Magento
Written on 07/09 • 3 Comments
The default theme for Magento has the related products block on the left hand side which is not necessarily the best place for it. A more logical place to put related products is under the product description in the center column. It is simple to move the related products block but you need to know where to look.
Continue ReadingPassword Protecting Your Site with htaccess
Written on 07/02 • 0 Comments
It is sometimes handy to be able to password protect your pages or an entire site. Maybe you're building a new site, but you only want yourself and client to be able to view the work-in-progress. Apache allows you to fairly easily add password protect an entire site, folder or individual file.
Continue ReadingSimple Share on Twitter Social Link
Written on 06/25 • 0 Comments
At the moment it seems to be fashionable to add social networking links to your website. Recently a client wanted a quick and simple link to share a post on Twitter. The Twitter API is comprehensive but can be daunting for those with less advanced coding skills.
Continue ReadingFixing a Broken Contact Form on a Joomla Site
Written on 06/18 • 1 Comments
If you are having the same problem as I have had with the Joomla contact form not delivering the mail to your email address maybe this solution can help. This problem only occurs under certain circumstances. You Joomla site is hosted on one webserver, your mail is on another and your DNS records on another. This circumstance is more common than you would expect, say you register your domain with 123-reg and enter your MX records here, your site is hosted elsewhere and you are using Google Apps (gmail for domains) for your email.
Continue ReadingMore articles can be found in the archives, feel free to have a look around and leave your comments.
Try a sample pack of 10 Business Cards for free from MOO
Upload images for the first side of your card. Choose up to 10 different images or designs. We accept high resolution JPEG, PNG, GIF or PDF files. Free standard shipping is included.
Mint