Spam-proof email addresses on web sites

Over the weekend, I cobbled together another handy javascript method for foiling evil spam bots, whilst making life easy for web developers. The script below enables you to change the subject of the email as you go as well – you could add other variables like a link title too if you wished. Functions are very useful devices!

Firstly, the content of email.js:

function sibaem(subject) {
var username = "emailprefixhere";
var domain = "whatever.com";
var atsign = "@";
var address = username + atsign + domain;
document.write('<' + 'a' + ' ' + 'href=' + '"mailto:' + address + '?Subject=' + subject + '">');
}

Save the above as email.js in your scripts folder and link to it in the head of your document like this:

<script src="scripts/email.js" type="text/javascript"></script>

Then in the body of the document, call the function with the following code where you want an email to appear, for example:

<script type="text/javascript">
<!--
sibaem( "Website enquiry" );
document.write ( 'email me</a>' );
//-->
</script><noscript><a href='contact_form.php' title='Complete my contact form'>contact me</a></noscript>

If you wish to make the user changeable and for the email address to be visible to the human eye on your site, here’s the content of email.js:

function sibaem(username, subject) {
var domain = "whatever.com";
var atsign = "@";
var address = username + atsign + domain;
document.write('<' + 'a' + ' ' + 'href=' + '"mailto:' + address + '?Subject=' + subject + '">' + address + '</a>');
}

and here’s what goes in the body:

<script type="text/javascript">
<!--
sibaem( "youremailusername, Website enquiry" );
//-->
</script><noscript><a href='contact_form.php' title='Complete my contact form'>contact me</a></noscript>

Prosperity, intellect and wisdom for 2007

This year, we send our best wishes for prosperity and peace – it’s about time all of us had a bit of a rest from interminable bloodshed over resources, religion and global supremacy. Rather than using reason to develop a logical, secular code of ethical behaviour which considers the best interests of fellow human beings as well as their own, it seems too many humans depend upon crude instincts and irrational brutish faith to justify baseless feelings of cultural superiority and barbaric slaughter of and stealing from other humans.

To celebrate our alternative peaceful vision for enlightenment in 2007, we’ve made a desktop wallpaper featuring Ganesha, a Hindu deity symbolising intellect, wisdom and prosperity.

We’ve also taken the time to add some of our latest artwork and greeting cards to our online art gallery.

Enjoy!

Sunshine Coast Recording Studios – Spark1 Studios

Located in the Sunshine Coast hinterland, Spark1 Studios offers musicians state of the art music recording equipment in a superb environment for inspired performance production.

Sparky has produced albums for musical luminaries such as Gemma Doyle, Paul Fogarty and Radha.

Sibagraphics has transformed the coding of the Spark1 site and added a resources page along with other improvements.

Web site backgrounds and borders

Finally got a chance to spring clean my hard drive and retrieve all the web site backgrounds and borders I’ve made and not used on client sites. These new free web backgrounds and borders – red, blue, pale blue, navy, grey, orange, pink, green and multi-coloured – are available for download in the Sibagraphics backgrounds and borders sections.

CSS and div layouts

While I have long been a fan of fixed width 3 column site layouts, here’s a reference site which has a library of percentage based column layouts.

Looking forward to trying them with images in some of the columns. I have employed my own three column div layout designs on several of my sites using a fixed width method – for example view source at Success Foods, the Medicine Room, Mike Jackson, Eurofilter Asia Pacific and Richard’s Corner.

Desktop Wallpaper from Stanthorpe

During our holiday break in Stanthorpe, I took a couple of photos which have been turned into new desktop wallpaper – a view from the top of Bald Rock at the Bald Rock National Park, Ballandean from the scenic Sundown Road and some climbing tea roses from ‘Jireh’, the bed and breakfast at which we stayed.

Enjoy!

Image protection with .htaccess

How to stop people stealing your images/bandwidth remotely:

(1) Make an image called dontsteal.gif and place it in a directory below the directory in which you are going to put the .htaccess file.

(2) Open notepad and copy this code … no hard carriage returns between lines.

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://whateverdomain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.whateverdomain.com/.*$ [NC]
RewriteRule .*.(gif|GIF|jpg|JPG|zip|ZIP|png|PNG|swf|SWF)$ http://www.whateverdomain.com/dontsteal.gif [R,L]

(3) Change whateverdomain.com to whatever your domain is called.

(4) This code works with apache servers with mod_rewrite.