Home Uniquely NZ Travel Howto Pauline Small Firms Search
Diary of System and Website Development
Part 10 (August 2003 - April 2007)

27th August 2003

Web Site Updates

I have been making a number of changes to the web sites I support, firstly to bring them a little more up to date and secondly to reduce the chances of email harvesters from gathering the email addresses off the pages and using them for spam. I am now looking at making some of the same changes to update my own site and this page will be acting as a demonstration of the various techniques I want to use.

The main change will be to make some use of Cascading Style Sheets. I have been very conservative in my approach and Cascading Style Sheets have not been used up to now - mainly because the implementation has not been consistent in earlier versions of browsers and very early browsers did not support them at all. Time has passed and most browsers in current use support the main features although great care has still to be taken for users of Netscape version 4.7x browsers which are still in regular use. I will use Style Sheets which are in a separate linked file so that changes made there are reflected in all the pages linked to the same file. I also want to put a link in the "Footer" to our contact/feedback form by changing the name in the copyright notice to be a link. I am thinking of also changing the Copyright itself to be a link.

I am planning to put some of the JavaScript I use into a linked file so again any changes required to reflect new versions of browsers can be made in a single place. I mainly use JavaScript for "popup" windows with images and I have just heard that the latest version of Netscape does not use a sensible default position on the screen when it opens a new window so this seems an appropriate time to make such a change as nearly a hundred pages will be affected.

Whilst carrying out the updates I will also look at the way the site is divided between servers and indexed by Search Engines.

17th September 2003

Cascading Style Sheet Implementation of this page

This page now uses Cascading Style Sheets to improve the text font, navigation bar, title area, footer area, links and "boxes". The most obvious change is that links now change when one hovers over them. The changes go deeper as the CSS implementation is via a linked CSS file so changes made there are reflected in all the pages linked to the same Style Sheet. I am currently investigating whether to use one external file for each area of the web site or use a common file. The latter uses a little extra "code" on each page but will be easier to maintain and is the way this page is implemented. Contrast the layout on this page with the previous diary page. Ideally every instance of Font should be removed as it is "depreciated" in HTML version 4 as are many of the other attributes used with tables for layout - it will be a long time before browsers fail to support them I suspect! It does mean that my use of New etc is now implemented by a class in the cascading style sheets called update and all instances can be changed in colour, font etc if I so choose. It currently seems clumsy to me but I am sure the long term benefits will be considerable.

19th September 2003

Email Harvesters

The problem of spam is getting worse and one of the main ways that addresses are gathered are by "robots" which harvest email addresses from web pages in the same way that "robots" index pages for Search Engines. These robots have to be simple and fast and generally do not implement JavaScript and just look for strings with an @ symbol with strings either side. One way to defeat them is to use the HTML Ascii code for the @ symbol ( @ ) but better still is to also write the email address from separate components on-the-fly with JavaScript. A snippet of code to do so follows:

Code to avoid Email Harvesters

<script language="JavaScript" type="text/javascript">
<!--
document.writeln("<A href=\"mailto:" + "mail" + "&#64; " + "youradress.com\">" + "mail" + "&#64; " + "youraddress.com" + " \<\/A> ")

// Based on JavaScript provided by Peter Curtis at www.pcurtis.com-->
</script>

The above is displayed as

The code can be copied and pasted and then edited to your address. If you copy by hand beware as it is impossible to tell 2x single quotes '' from a double quotes " in many character sets.

JavaScript rationisation

JavaScript was first used on my pages for popup windows for images and that is still the major use. As time has gone on I have developed better code for the popup windows although there are still close to a hundred pages using the original simple popup windows. The basic principle is to reuse the windows so that when a fresh image is clicked it is loaded into an existing window if one is open and then brought into the foreground - into focus in JavaScript jargon. There are however vertical and horizontal windows and film and digital images have different aspect ratios so up to four different windows could be required even if all roughly the same size. All the windows are closed when the page is closed or left via a link by a call to a tidy() function which is another unusual feature.

I have now extended the basic code to include the ability to specify the title, background colour and window size. The latest routine which allows the size to be specified will only close down and reopen a window if the size is different. I have put two copies of the new routine into an external JavaScript file - two so vertical and horizontal windows can be open simultaneously (or two different aspect ratio horizontal windows) and they need five parameters. The older pages will be modified to have the existing four functions in the header but all they will now do is call the more complex routines in the external file - this will avoid having to modify over a thousand calls but still allow new features to be exploited. One reason for this is that I have received indications from users that the latest version of Netscape does not follow convention and open a window which is positioned, sized etc the same as its own default window. This means that the position on the screen may need to be specified and it is best to have only a couple of places to make the change. The new popup windows are written on-the-fly and this allows the picture to be centred and there can be enough tolerance to take 3:2 photographs and 4:3 aspect ratio digital images so only two of the new windows will be used. preset titles will be used on the older pages to give the source of the image and size whilst new pages will be able to have meaningful titles.

I am providing the same examples, from one of our travel pages, as on the Howto Article Popup, to try in your browser. One uses an original single parameter call whilst the other uses all five parameters but with an identical size image. You will see the function call format in the status bar if you hover over the image. Offerings in the Temple of Heavenly Bliss Decoration on the Sri Mariamman Temple If you click on the images to left and right they will open in sequence in a correctly sized Window. Note how they come back to the foreground (in focus in the the jargon) when the thumbnails are clicked. If you drag the image window to a favoured place it will return to view in the same place. If you close the image Window it causes no problems, however when it reopens it will revert to the original place and size. You will also find that the image window is closed when the page is left (unloaded in the jargon), few sites tidy up extra windows. Note that the left image has a default coloured background of white, window title just specifying it is a digital image. The right hand hand image has a popup with full title and a black background which is more suitable to that image.

22nd September 2003

Website Update - Procedures

I have now completed the external files for the Cascading Style Sheets and the JavaScript popups and they are 4.5K bytes and 3 Kbytes respectively. It turns out that it is possible to group the changes into two "replacements" in the "Header" and "Footer" sections of the pages. These changed areas carry out all the linking and JavaScript and contain the linkbar and titles with only the text for the title to be copied back in. This means it will be very quick to modify each page when using a multiline clipboard. The technique has been trialed on the Peter's Home Winemaking and Pauline's Watercolour Painting pages and works very well - have a look.

30th September 2003

Website Update - Split between Servers

The current pages are divided between servers mainly because of space and bandwidth limitations- we were seeing up to a gigabyte a month downloaded and up to 500 unique visitors per day on www.pcurtis.com. The Uniquely New Zealand site now provides about 300 Mbytes a month download. All of the Uniquely New Zealand pages are on http://www.uniquelynz.com whilst personal pages, Howto Articles, Pauline's Open University and the Small Firms pages are on www.pcurtis.com. At the start of this exercise Pauline still had a few Open University presentations on Freeserve, again because of space limitations, but these have now been transfered to the Uniquely New Zealand site where there is plenty of space. The "contents pages" (those on the navigation bar) have absolute links to the appropriate sites and the rest of the pages on Freeserve are no longer updated and there is no space left to upload any images. The Freeserve site has a robots.txt file which tells search engines not to index any of the pages.

The five "contents pages" and the Search Page (which are on the navigation bar) are duplicated on both main servers with a base tag set to provide absolute links to the correct site when necessary. There are a very small number of other pages which require absolute links such as the travel page, newsletters and a couple of very popular NZ pages which are bookmarked and in the Open Directory. Both servers have most of the pages uploaded but have robot.txt files to make sure the correct pages are indexed. The robots.txt file has been generated using a "Cover Disk" tool Robot-Manager Standard Edition. The internal search facility from Atomz has been configured to search the correct servers. The configuration for indexing is done on the Atomz site.

Duplicated files

This is not a perfect solution as some editing has to be done to generate different versions of the pages with absolute links depending on which server they reside on or if they are for a development/CD version. The following is a reminder for myself of which files are duplicated and which have absolute links. On pcurtis.com the default entry (when just www.pcurtis.com is entered in a browser) is index.htm which is a copy of homepage.htm which is the true "Homepage" linked to in all navigation. On uniquelynz.com the default entry is index.htm which is a copy of nzguide.htm which is the main page for uniquelynz.com and linked back to in all navigation. On pcurtis.com nzguide.htm has a base tag and absolute links to uniquelynz.com. On uniquelynz.com homepage.htm, howto.htm, enterprise.htm, pemcou.htm and site-search.htm have base tags defining absolute links to pcurtis.com.

All .js and .css files are duplicated on both sites. Two other popular files - tokomaru.htm and wanganui.htm are duplicated on pcurtis.com with base tags defining absolute links to uniquelynz.com because other people still link to them. Each site has a different robots.txt file. The ten files which are different on the web sites to the CD version are kept in separate subdirectories for uploading. Each edit of one of these files needs three saves and six in the case of entry pages - as I said not a perfect solution but I can see no better one with a split site. In fact it is even worse as there is another subdirectory with files for old sites such as www.corinna1.freeserve.co.uk and the even older compuserve site, both of which may still be in other peoples favourites - all older sites have a robots.txt file to stop them being indexed.

Website Update - Schedule

The plan is to carry out the updates on about 10% of the pages - the entry pages and some of the most popular pages will be changed. We will then wait to see if any problems occur for a while. After we are happy with the changes we will probably update those of the more recent pages which make extensive use of popups. After that we will then carry out the upgrades whenever a page has to be updated or shows up as popular in site statistics.

5th October 2003

Copyright

I am starting to put my mind round a statement of copyright for the site which has not turned out as simple as I expected. My thoughts follow:

The Formal Position on Copyright

The material on the web sites www.pcurtis.com and www.uniquelynz.com is copyright under the Berne convention. All rights are reserved and no reproduction is allowed without permission.

The rights of Peter and Pauline Curtis to be identified as authors are asserted in accordance with sections 77 and 78 of the Copyright, Designs and Patents act, 1988.

Clarifications

  • All the text has been written by Peter or Pauline Curtis, unless there is a specific acknowledge to someone else, and we reserve all rights and copyright.
  • The JavaScript on the site is mostly our own writing - if not we put a specific acknowledgement to the author in the source code. Where we have knowing based our JavaScript on other's ideas we have a comment in the source that it is based on their code.
  • All the pictures on the site have been taken by us, unless there is a specific acknowledgement to someone else. Pictures taken out of doors are our copyright which we reserve with the usual incantation. Where we have taken pictures inside that are on the web site we have generally checked, possibly only in general terms, if there are any objections to taking pictures. Where we could not check we have made no attempts to take pictures surreptitiously or where there were any indicationss of restrictions and put them on the web site.
  • We have a number of pictures of old photographs, mainly of New Zealand heritage. Those on the web site have been from those taken taken from sources, often private where we believe that copyright has expired. We have however found many heritage pictures, that are obviously from the same source on display in a number of different places, often with a different attribution. There are however now several New Zealand national archives (such as the Turnball Collection, which have been given the original plates or negatives. They have increasingly become the definitive source for copies of many of the old pictures and copyright of new prints is claimed by the archives. We obviously make no claim to the copyright of old pictures on our sites and it is even possible we are unknowingly infringing somebodies copyright - if so we apologise and if you let us know and we will provide an acknowledgement, or if you have objections to our showing low resolution second or third generation copies, we will remove them.
  • The Technical Howto Articles contain many "screen grabs" of windows form Microsoft Windows or application programs to illustrate how to configure various features - we obviously do not claim any copyright over these images.

Making use of our material.

  • You are welcome to link to any of our pages at high or low level but not to display them in your own frames. If you want to extract an appreciable amount of text for your own purposes please contact us by email - if it is for personal use on a web site we will probably only request an acknowledgement (name and website address). Commercial use is by negotiation.
  • JavaScript - you are welcome to use our JavaScript provided you leave an acknowledge in the source code. We make no warranty on its accuracy or applicability and use is entirely at your risk.
  • You are welcome to use any of our out-of-doors images for personal use if you acknowledgement us (name and website address) as the source. You must take copies rather than link to our images, which will be both faster for your visitors and not use our bandwidth which is restricted. We would appreciate an email tell us what you are using and the address of your site. Commercial use will incur significant royalties which so far we have passed to charity. In many cases we can supply medium or high resolution images from photographic negatives for commercial use.
  • If you want to use pictures taken indoors please contact us first - we will usually suggest you contact the place where they were taken as we have rarely sort permission to distribute pictures for others to use.
  • Pictures of heritage material are a problem as we can not vouch that they are free of copyright. We strongly discourage their use other than for research purposes and suggest you seek an alternative source in one of the archives, we may know alternative sources. You should not acknowledge us as the owner of the copyright but you may put a general link to us as a source of information if you need an audit trail for information used for research purposes.

10th October 2003

Popups again

I have had some reports of troubles with popup windows on Apples using Internet Explorer. If you close a window manually you can not open it without refreshing the page. I spent a long time trying to find out why but it seems to be feature, perhaps to avoid advertising windows being reopened. In searching for solutions I have tried many variations on the theme I have used before and come up with yet another improvement. Instead of closing a window and reopening a new one if the size has changed I am using JavaScript commands to change the size. This means it is faster and the window stays wherever the user has moved it. It is only supported in JavaScript 1.2 onwards but being realistic all browsers of generation 4 onwards support JavaScript 1.2 or higher ie 99% or more these days. The technique has been trialed on Pauline's Watercolour Painting pages where every picture is a different size and works very well - have a look. I will move all the pages to use versions of the new code shortly but will include a check on browser version and whether it is an Apple with IE at the start of the pages and write a Caution into the page.

Code to cut and paste for Advanced Popup with Title, Image Size and background colour parameters

<script language="JavaScript" type="text/javascript">
<!-- ;
var newwindow;
var wheight = 0, wwidth = 0;

function popitup5(url, title, iwidth, iheight, colour) {
var pwidth, pheight;

if ( !newwindow || newwindow.closed ) {
pwidth=iwidth+30;
pheight=iheight+30;
newwindow=window.open('','htmlname','width=' + pwidth +',height=' +pheight + ',resizable=1,top=50,left=10');
wheight=iheight;
wwidth=iwidth;
}

if (wheight!=iheight || wwidth!=iwidth ) {
pwidth=iwidth+30;
pheight=iheight+60;
newwindow.resizeTo(pwidth, pheight);
wheight=iheight;
wwidth=iwidth;
}

newwindow.document.clear();
newwindow.focus();
newwindow.document.writeln('<html> <head> <title>' + title + '<\/title> <\/head> <body bgcolor= \"' + colour + '\"> <center>');
newwindow.document.writeln('<img src=' + url + '>');
newwindow.document.writeln('<\/center> <\/body> <\/html>');
newwindow.document.close();
newwindow.focus();
}

// Routines to tidy up popup windows when page is left
// Call with an onUnload="tidy5()" in body tag

function tidy5() {
if (newwindow && !newwindow.closed) { newwindow.close(); }
}

// Based on JavaScript provided by Peter Curtis at www.pcurtis.com -->
</script>


The code can be copied and pasted to replace the code on the current popup page but remember to add the additional parameters to the call. If you copy by hand beware as it is impossible to tell 2x single quotes '' from a double quotes " in many proportion spaced character sets (fonts).

Valid HTML 4.01 Copyright © Peter & Pauline Curtis
Content revised: 2nd August, 2020