Skip to content

Commit

Permalink
Merge pull request #4 from JamesPhillipsUK/1.1.0-dev
Browse files Browse the repository at this point in the history
1.1.0 Development
  • Loading branch information
JamesPhillipsUK authored Jul 3, 2018
2 parents ad01d60 + dfe6c8f commit 10b5f91
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 22 deletions.
13 changes: 6 additions & 7 deletions CookieNotice.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@
//Quick flyout notice for cookies.

$value="On";
//setcookie( "ThisSiteNameCookies", '' , 0, '/' );

if ( !isset ($_COOKIE['ThisSiteNameCookies']) || $_COOKIE['ThisSiteNameCookies'] != $value )
if ( !isset ($_COOKIE['ThisSiteNameCookies']) || $_COOKIE['ThisSiteNameCookies'] != $value ) //Please re-name ThisSiteNameCookies with the name of your website.
{
?>
<div id="CookieMonster">
<p id="Cookies">By using this site, you agree to <a href="http://ThisSiteName/cookies/">our cookie policy</a></p>
<button id="Exit">X</button>
<p id="Cookies">By using this site, you agree to <a href="http://ThisSiteName/cookies/">our cookie policy.</a></p> <!-- Replace http://ThisSiteName/cookies/ with a link to your cookies page -->
<button id="Exit">X</button><!-- You can replace X with Exit for better readability -->
</div>
<script>
var button = document.getElementById('Exit');
Expand All @@ -46,14 +45,14 @@
};
</script>
<?php
setcookie("ThisSiteNameCookies", $value, time() + (86400 * 10));
setcookie("ThisSiteNameCookies", $value, time() + (86400 * 10)); //Again, please re-name ThisSiteNameCookies with the name of your website.
}
elseif ( $_COOKIE['ThisSiteNameCookies'] == $value )
{
//there is a ThisSiteNameCookies session. Someone has seen the notice. Do nothing.
}
else
else //This should never happen, but here's a backup measure just in case.
{
echo '<div id="CookieMonster"><p id="Cookies">Something&#39;s gone wrong! Please <a href="mailto:webmaster@ThisSiteName">inform the site!</a></p></div>';
echo '<div id="CookieMonster"><p id="Cookies">Something&#39;s gone wrong! Please <a href="mailto:webmaster@ThisSiteName">inform the site!</a></p></div>'; //Please replace webmaster@ThisSiteName with your email address
}
?>
1 change: 0 additions & 1 deletion Header.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*
* Edited 08th February 2017
**/
//To use this file, type <?php include('./Header.php'); ?> instead of the <body> tag in your HTML.
?>
<link rel="stylesheet" type="text/css" href="./Style.css">
</head>
Expand Down
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,24 @@ I'm a fan of simple instructions, so here's how to install the MonstrousCookies

1. Download all of the files from this repository into your web root folder.
2. Open CookieNotice.php in a text editor, do a Find and replace for `http://ThisSiteName/cookies/` with the URL of your Cookie Policy, replace `mailto:webmaster@ThisSiteName` with `mailto:`followed by your email address, and replace `ThisSiteNameCookies` with the name you want to give the cookie that monitors allowing cookies on the site.
3. Replace any instances of the phrase `</head>` ... `<body>` with an instance of:
3. Replace any instances of the phrase: `</head>` ... `<body>` on your website with an instance of:
```PHP
<?php include('./Header.php'); ?>
```
* Note: any pages saved as a `.htm` or `.html` to which you have done the above will beed to be renamed as a `.php`
* Note: any pages saved as a `.htm` or `.html` to which you have done the above will beed to be renamed as a `.php`.

## Requirements
We only have a couple of requirements for running this plugin, and they're pretty standard.
- A web server running PHP 5 or higher (PHP 7.x suggested)
- jQuery 2.2.4 or higher (jQuery 3.3.x suggested)

## The Cookie Stuff
This plugin uses implied consent, as explained by the [ICO](https://ico.org.uk/for-organisations/guide-to-pecr/cookies-and-similar-technologies/ "ICO Guidance on cookies") to allow users to accept cookies on your site. For this to work, your website's cookie policy must state that you use your own "First-Party" cookies. This is because the plugin itself is powered by a cookie... And it's delicious.
### GDPR
I've been asked, so I'll clarify. The plugin, when used "vanilla" (I.E.: when it's installed as per these instructions, without further modifications) doesn't collect any personal data, so doesn't fall under GDPR. Because of this, you don't *need* to mention it in your privacy policy, but you should still mention it in your cookie policy. You may still want to mention it, and if you do, please feel free to direct people to [this GitHub repo](https://github.com/JamesPhillipsUK/MonstrousCookies), and share the love that is MonstrousCookies.

## Contact me
Should you wish to contact me with any queries about MonstrousCookies, there is [a contact form on my website](https://jamesphillipsuk.com/contact), and you can also email me using the email address located at the start of most of the code files.

## Disclaimer
I'm not a legal expert by any stretch of the imagination, nor do I claim to be. Nothing in this repository is to be taken as legal advice (If you want that, I'd suggest hiring a professional). MonstrousCookies is just a tool I thought people might find useful.
29 changes: 17 additions & 12 deletions Style.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,43 +14,48 @@
* If not, see <http://www.gnu.org/licenses/>.
*
* Edited 08th February 2017
* Edited 03rd July 2018
**/

/*2. Cookie Banner*/
/*Cookie Banner*/
#CookieMonster
{
margin:0 0 0 0;
padding:0 0 0 0;
margin:0;
padding:0;
width:100%;
height:auto;
min-height:2rem;
color:#000000;
background-color:#6666FF;
color:#000; /*Change the banner foreground colour here!*/
background:#EFEFFF; /*Change the banner background colour here!*/
z-index:100000;
position:fixed;
display:block;
bottom:0;
}

/*Text within the Cookie Banner*/
#Cookies
{
margin:0.5rem 0 0.5rem 0.2rem;
padding:0 0 0 0;
padding:0;
text-align:left;
font-size:1rem;
color:#000000;
color:#000; /*Change the banner text colour here!*/
display:inline;
}

/*The Exit Button*/
#Exit
{
margin:0.2rem 0.2rem 0 0;
margin:0.2rem 0.8rem 0 0;
border:0;
border-radius:0.2rem;
text-align:right;
float:right;
font-size:0.6rem;
color:#000000;
background-color:FF0000;
color:#FFF; /*Change the button text colour here!*/
background:#FF1A1A; /*Change the button background colour here!*/
display:inline;
min-height:0.6rem;
min-width:0.6rem
min-height:1rem;
min-width:1rem;
}

0 comments on commit 10b5f91

Please sign in to comment.