suninnsunday.com

Tosh, pubs & technical stuff

Website Cookies legislation – example code

without comments

This new legislation seems quite difficult; but I have spent some time researching this, and I believe I have a simple example which works. I am that confident,I have put this into practise on my main site – deadpubs.co.uk.
There are two simple steps, first you need to add some code to your html pages, I use an include statement on all of my pages, so all I needed to do was add these few lines of code to one page – but, hey ho.
The lines of code are as follows:

cookie text

This text links to a javascript page, again in my includes directory, hence the “/includes” in the link.

The javascipt is at   
cookie javascript

That’s it! You can alter the text in the files. You can change the date the cookie expires, etc.

 

Enjoy, and let me know if it works.

Kevan

Kevan

 

 

 

Written by ed

May 19th, 2012 at 12:24 am

Cookie privacy law – 24th May legislation – a working example

without comments

OK, so the legislation changes on the 24th May 2012 as to the usage of cookies on a web site. Actually, all you need to do is report that you use cookies. You then need to ask the visitor if they are happy to accept cookies.

What do you need to do?

I cannot suggest that I have done this correctly, but here are suggestions and code examples.

Step 1:

You need a web site. If you do not have a web site, then what’s the point?
This is my working example – http://pubsinuk.com

Step 2:

My web site I have tested this on is- it is purely that, i.e. an test site.

Two files are needed in my example:

In all your html pages you need the following script code:


<script>

// Insert your privacy link here e.g. /privacy.html
// var privacyLink = ‘privacy.shtml’;

// optional postBack function
var postBack = null

// custom error message when clicking continue without ticking the box
var errorMessage = ‘You need to tick the box, to continue on this site without the annoying message’;

// write out the include
document.write(“<script src=’/includes/pub_cookies.js’><\/script>”);

</script>

 

## end of script ##

 

You then need a javascript page added to your site, i.e. in my example it is called pub_cookies.js in the includes folder, as follows:

You can view my working example online at – http://pubsinuk.com/includes/pub_cookies.js

Here is the code in this example :

// Created 26/5/2011 by Jason Kneen http://www.jasonified.com

// Original Banner HTML code lifted from ico.gov.uk

// Rewritten by Kevan on 20/5/2012

var cookieName = 'pub_auth';
if ((!window.postBack && document.cookie.indexOf(cookieName) == -1) || (window.postBack)) {
function check(){
var checkBox = document.getElementById('chk_pub_cookie');
if (checkBox.checked) {

if (window.postBack != null){

document.getElementById(‘pub_banner’).style.display = ‘none’;
window.postBack();
}
else
{
document.cookie =cookieName + ‘=1; expires=Wednesday, 01-Aug-2014 08:00:00 GMT’;
document.getElementById(‘pub_banner’).style.display = ‘none’;

}

}
else
{
alert(window.errorMessage || ‘Please select that you accept Cookies to remove this message’);
}

}

if (navigator.cookieEnabled) {
var sPrivacyText = ''

if (!window.privacyLink){
sPrivacyText = ”;
}

var sBannerStyle = 'style="font-Family:tahoma;font-size:12px;float: left;border: solid 1px #003768;background: white;margin: 0 8px 0 8px;font-weight: bold;color: #003768;padding: 4px 6px 4px 6px;"'
var sBanner = '<div id="pub_banner" ' + sBannerStyle + '><strong>On 26 May 2011, the rules about cookies on websites changed. This site uses cookies from google adsense only. It is not essential, but helps me pay for the site to operate and has already been set. You may delete and block all cookies from this site, but then I may delete and block the site so that it no longer works.' + sPrivacyText + ' </strong><br /><br />'
var sForm = '<input id="chk_pub_cookie" type="checkbox" name="chk_pub_cookie" style="float: left;padding-top: 2px;margin: 0 8px 0 0;line-height: 1.1em;" /> <label for="chk_pub_cookie" style="float: left;padding-top: 2px;margin: 0 8px 0 0;line-height: 1.1em;">I accept cookies from this site.</label> <input type="submit" name="btn_pub_Cookie" value="Continue" id="btnCookie" onClick="javascript:check()" style="float: left;clear: none;padding: 2px 5px;margin-top: -2px;background-color: #FCFCFB;border: 1px solid #003C74 !important;color: black;" /></div>'
document.write(sBanner + sForm)

}
}

 

Try it out, use the options in your browser to delete cookies and other web content whilst testing, etc. Enjoy.

Kevan

Written by ed

May 17th, 2012 at 11:25 pm

Cookies privacy laws and an educational tour of the web

without comments

Few people are aware that the law relevant to cookies on UK web sites changes in a few days. It has already been delayed by a year to allow web masters to put the relevant steps into place.
It is actually quite easy to do, although I am still testing this out on a fairly blank test site.
First, let me explain to the average user what happens when you visit any web page, I mean any web page. Firstly, the computer (that’s yours) stores a local copy of this web page on your computer. If you visit the web page again, it is likely that you will actually see this saved (cached) version of this web page, If you refresh the page, this can be achieved by hitting the refresh button (the F5 key), you will then refresh the saved page and see the new page.
Many web pages and sites create a cookie, which is also stored on your computer. It is a tiny, unambiguous file that rarely does any harm to you or your computer.
People like google, and many others use these tiny cookies to track you. So, if you visit the Dell computer site, the next time you visit a site serving google ads, you will see adverts from Dell. Simple, effective advertising.

Anyway, the UK is about to bring in a new law about cookie advertising, which means that any sites that produce cookies have to give their customers the chance to opt out. This sounds like it is a law produced by an idiot who has little idea of what they are doing, and more likely to be a Conservative iniative to create some private sector jobs at others expense.

To quickly update on what I have said so far, the cookies are less of a problem than storing a copy of a web page in its entirety on your local computer. The reason for this is the fact that a web page can often have a whole host of nasty code, whereas a cookie is three line of text – c’est tout.

I have added a test cookie privacy ‘thingie’ to one of my sites. It is basic, but follows the guidelines I believe. I have no interest in cookies, but I do use google ads to cover the costs of my web sites – they produce the cookies.
Here is the site, and in the next post I will explain the simple rules to follow to do this. I should point out that if you use this, and it affects your web rankings, then it is your problem, and not mine!
More to follow ……..
Kevan

Written by ed

May 17th, 2012 at 10:56 pm

Billy Elliott – emotional post

without comments

I thought I would repost this part of a day in London – it was great:
A brief description of a show which is now celebrating it’s seventh birthday is as follows.
For those of you whom have seen the film, or are old enough to remember previous degenerate Conservative governments, this is the story of the miners strike / action against the Thatcher revolution versus the unions in the 1980?s. The story revolves around a community who are fighting this action, with a solidarity movement of families being out of work for up to a year, and it’s hardships.
Billy, a young person at the time, and who has also lost his mother in her early years, finds salvation in dance, and in particular in ballet.
The story describes ballet as a girls dance.
The stage show uses the emotions of dance, hardship, family loss, and many other emotions of this fight against the establishment; and a clever use of volume to make this an incredibly powerful performance. I loved it, and cried quite a lot, too. Nothing wrong with that, it is a powerful performance. The show finishes with a celebration of the work, and the performers. This is necessary to remind the audience that this is a show, and not real as it often feels. Marks for the show and the restaurant both score 10 out of 10 – a brilliant day.

Written by ed

May 13th, 2012 at 12:53 am

Posted in Billy Elliott

Tower Bridge exhibition, London walk and Billy Elliott

without comments

I took a wander into London today, arriving at Fenchurch Street around midday. This is a short walk from Tower Hill underground station. At Tower Hill there is obviously the Tower of London, but this is quite expensive and we decided to visit the Tower Bridge exhibition as an alternative. The Tower was originally built by William the Conqueror some time after his invasion of 1066.
The Tower Bridge was the second bridge to cross the Thames in London, after the London bridge. All other bridges crossing the Thames in London came later.
London bridge was originally a wooden bridge with seven storey houses in the 1700′s; and deemed to be falling down and not fit for purpose. It was rebuilt in 1831 as a stone bridge; and until late Victorian times was the only bridge in London to cross the Thames. Latterly in 1971, it was dismantled brick by brick and sold to the Americans who rebuilt the original London bridge in Arizona.
The Tower bridge was an amazing feat of Victorian engineering. It needed to be a bridge which allowed the entry of tall shipping traffic, and thus navigable. In the days of building aroung 1894, it was opened about 6000 times a day, whereas today (2012) it may open about 3 times a day. You should visit the exhibition to view this amazing story, and also buy a guide for an additional £3. It includes a visit to the upper levels of the bridge, and the original engine room engineering feat. It is quite remarkable.
After the Tower Bridge, we wandered along the southern side of the Thames (along Tooley Street) to London bridge. This area includes many tourist attractions, and we were particularly drawn by the view of the Shard. The Shard is the highest building in Europe, currently, and there has been a recent documentary about its building.
After crossing the London Bridge back to the north side of the Thames, we found the Monument, which Christopher Wren built as the monument to the great fire of London (1666). It is suggested that this is at the site of the origins of the fire in a bakery in Pudding Lane.
Further along this walk, we wandered onto the millenium bridge (nicknamed the wobbly bridge). It closed two days after its opening due to being decidedly wobbly – it is better now! From this bridge can be seen the Globe Theatre and the Tate gallery. The Globe theatre is a version of the original Shakespearean theatre.
Some considerable walking after this, brought us to Waterloo station, and a long walk in the station concourse to the relevant line. Be warned, some London underground stations involve lots of walking.
We finally arrived at Victoria tube station for our final destination, to see the Billy Elliott stage show at the Victoria Palace. There is an amazingly good restaurant, the Bella Italia at 152 Victoria Street. It is that good, it does not appear to advertise itself. The show was at 7.30. we arrived at the restaurant at 5pm and had our pick of tables. By 5.30 the restaurant was full. The food was exceptionally good, as was the service – I am eternally critical of restaurants. This place was really good for service and food!
At 7.00 we collected our tickets for Billy Elliott. The show started at 7.30. and it was absolutely amazing.
A brief description of a show which is now celebrating it’s seventh birthday is as follows.
For those of you whom have seen the film, or are old enough to remember previous degenerate Conservative governments, this is the story of the miners strike / action against the Thatcher revolution versus the unions in the 1980′s. The story revolves around a community who are fighting this action, with a solidarity movement of families being out of work for up to a year, and it’s hardships.
Billy, a young person at the time, and who has also lost his mother in her early years, finds salvation in dance, and in particular in ballet.
The story describes ballet as a girls dance.
The stage show uses the emotions of dance, hardship, family loss, and many other emotions of this fight against the establishment; and a clever use of volume to make this an incredibly powerful performance. I loved it, and cried quite a lot, too. Nothing wrong with that, it is a powerful performance. The show finishes with a celebration of the work, and the performers. This is necessary to remind the audience that this is a show, and not real as it often feels. Marks for the show and the restaurant both score 10 out of 10 – a brilliant day.
That’s all.
Kevan

Written by ed

May 13th, 2012 at 12:31 am

Eddie Izzard – 27 marathons in 27 days for Nelson Mandela foundation

without comments

Eddie Izzard, a cool dude and brilliant comedian is to run 27 marathons over 27 days to honour Nelson Mandela. I have great respect for both of these personalities extraordinaire.

The marathon of marathons will be to collect sponsorship in aid of the Nelson Mandela foundation and other African charities. This is an amazing feat, as I doubt if I could run a single mile in one week, let alone a marathon every day for one month!

The deadpubs site (that’s me)  regularly gives to a good charity from my pocket. I am sponsoring Eddie Izzard a £1 a mile. This should equate to about £650. How about you big businesses. do you have any larger donations? I also sponsor two children through World Vision, and proud of the fact I am not a Tory scumbag.

Apparently, Eddie Izzard will be tweeting as he runs. More details on sponsorship to follow….

 

Kevan

www.hypersmash.com

Written by ed

May 12th, 2012 at 12:06 am

Windows skydrive

without comments

The google drive (in the cloud) has been released recently, and I have been testing this out. It has older rivals, i.e. dropbox which has a storage of about 2GB, and Windows skydrive which offers 7GB (More on this later).

I have used dropbox previously, but never tried the Windows skydrive although it has been around a while. As a new user you get 7GB of storage space, which is slightly larger than the Google drive 5GB.

What I am most interested in is whether it works. I am not impressed with the google offering so far.

Anyway, the login is straightforward using a windows Live ID, hotmail account or similar. The look and feel is similar to google drive too. The big difference is that google uses its own format for any documents, particularly text; and you cannot sync two different machines.

With Windows skydrive, this all changes. You can install the skydrive onto different machines, and view the files in native excel, textpd, word etc. It just works. You can simply synchronise different machines with the same important files – that is really brilliant!

Also, I have just been offered a free upgrade to 25GB of space – cool. I recommend this and find it much more user fiendly than the google offering.

 

Kevan

Written by ed

May 9th, 2012 at 5:52 pm

Google Drive – in the cloud

without comments

As an aside to London elections, I toook a look at Google in the cloud today. It is a bit like dropbox, where you can share files on your local computer with other users. It is also meant to be a file share ‘in the cloud’. This reads that you store your files in an alternative area as back up. You also need a gmail account to use this.

The fact is that the cloud is a backup of files on your own computer. This is good, and allows you up to 5GB free space.

I tried the service from a relatively new machine. The google drive software is installed by following this link. Trust me, this is a safe google link to follow. This was straightforward to install, and the service was up and running in a matter of a few minutes.

I tried a few different types of file, e.g. an excel spreadsheet with several sheets, a large pdf file, and various small text files. The synchronisation was a bit slow to start, but eventually the files showed up in the ‘cloud’.

I then attempted to view these files in the ‘cloud’. The pdf document was too large to view, the excel spreadsheet was difficult to read. The text files were fine. I also found that if I trashed a document in the cloud, it removed it from my local PC – not sure about this.

Next. I logged into an older PC (XP machine) to see if I could install the google drive software. After a number of attempts, the closest I got was the offer of installing google chrome to be able to upload files to this same area. I was unable to use the google api to have more than one computer to use as the main distibrutor for files – this is not what is wanted.

Later in the evening, I also tried this from a machine at home.Again, I am unable to install the google drive software on more than one machine. This basically means that I can upload files from one machine ONLY,  to a shared drive in the ‘cloud’. If this is google at its best, I don’t think they have really thought this through; with the millions of pounds / dollars at their bequest.

OK, I have sussed out how to do this now. You need to get google chrome webbrowser, and this allows you to drag and drop files from your local folder. It does not work for firefox, although I better check this is the case.

A further weeks testing of google drive has been intersting. You can apparently only have one ‘major’ computer, but you can also upload through the web interface. I tried this the other evening with a fairly small folder. The folder did have several thousand files, albeit mostly small text files.

To keep this simple, I had to leave the upload runing all night; and I am guessing that the computer went to sleep as it was not completed by the morning. I checked some of these files from the master computer, and as the google format is needed, you have to  open a file in the browser. It appears that the file is just a shortcut and not editable on a different computer.

So, I thought I would try out Microsoft skydrive in comparison. This will be a separate post.

 

Kevan

p.s. If you have nothing better to do, visit the deadpubs site.

Written by ed

May 1st, 2012 at 11:15 pm

Tactical voting in London Mayor elections – not a wasted vote!

without comments

To explain the voting system on May 5th for the London Mayor (or Mayoress). You get two choices to vote, 1st preference and 2nd preference. If the first votes for any candidate do not exceed 50%, then the two candidates with the highest vote go into the second round; and all others are eliminated.

The second votes of all other candidates are then added to these two candidates first votes.

Here is how to vote tactically. It is expected that Boris and Ken will score the highest number of first round votes. But, you can change this, by gving them your second vote, and giving your first preference to Siobhan Benita (Independent lady).

You will be surpised how the vote on the day could change, if you know that voting for a possible minority candidate is actually not a wasted vote. It also means that if the unexpected does not happen, then your second preference still gets added to one of the mian contenders.

It is tactical voting at it’s best. If you like this, please spread the word via the online media sites as Siabohn is refused any TV media coverage as an independent. Good luck.

Written by ed

April 24th, 2012 at 9:12 pm

London Mayor 2012

without comments

I am closely following the London 2012 mayoral elections. Most people do not appear to really care.

The spectator has been running a very visible attack on Ken Livingstone, and also on Siobhan Benita. The post are quite strong, and are aimed at suggesting that Ken and Siobhan support rape and other attrrocities.

It is clearly run by the  Idiot Boris team.

Let’s get this clear. Boris is an educated person – true. He is also BAD for London, as he lacks vision, or any wisdom towards making London a better place. He will also make London the laughing stock of the world when the Olympics come. I think even the lieing Cameron team are aware of this, why did they not push for a stronger candidate?

 

Written by ed

April 22nd, 2012 at 11:51 pm

Posted in Uncategorized