March 31st, 2006

ASP.Net - Validate postal/zip code based on Country

ASP.Net 2.0 comes with some powerful input validation controls. It's east to add a RequiredFieldValidator to a form, to ensure that the user inputs data of some sort. But what if you need data in a specific format? And what if that format changes? The example in this code uses a RegularExpressionValidator to check the proper format of a Zip code. However, if the user selects the country Canada, the regular expression changes to check for a valid postal code. (more…)

March 31st, 2006

DHTML Text Typing Effect

Use this simple function to achieve the effect of having text typed out onto your website. You can speed it up or slow it down by changing the number of millisecond of the interval.
(more…)

March 31st, 2006

Enable Revenue Sharing in Joomla or Mambo

I have recently worked out a function to enable revenue sharing among members of a Joomla/Mambo site. The principle is that authors receive 50% of ad impressions on pieces of content that they own. This is accomplished without changing anything in the existing code/data structure, and it uses the default contact system to store the Adsense id and channel. This will encourage more people to write more content in your site, which will result in more traffic! (more…)

March 31st, 2006

DHTML Image Thumbnail Chooser

This function allows you to easily browse through a series of thumbnails. When you click on a thumbnail, the full-size image is displayed on the right. The currently selected thumbnail becomes highlighted. The DHTML changes the source of an image tag, by taking out the '_tn' of the thumbnail filename. You can use this for your images, just create smaller images with the same filename as the larger image, except with '_tn' before the file extension.
(more…)

March 31st, 2006

PHP - parse a string between two strings

This is a handy little function to strip out a string between two specified pieces of text. This could be used to parse XML text, bbCode, or any other delimited code/text for that matter. (more…)

Next Page »