In Spain law required add a cookies use notice at the start the web, this JS is to place at the top of index.php file and comply with internet laws. It's only visible to Spanish IP's.
<!DOCTYPE html>
<html class="no-js" lang="en-US">
<head><title>AVISO</title></head>
<body>
<div id="barritaloca" style="display:none;position:fixed;left:0px;right:0px;bottom:0px;width:100%;min-height:40px;background: #333333;color:#dddddd;z-index: 99999;">
<div style="width:100%;position:absolute;padding-left:5px;font-family:verdana;font-size:12px;top:30%;">
Usamos cookies propias y de terceros para mostrar publicidad personalizada según su navegación. Si continua navegando consideramos que acepta el uso de cookies.
<a href="javascript:void(0);" style="padding:4px;background:#4682B4;text-decoration:none;color:#fff;" onclick="PonerCookie();"><b>OK</b></a>
<a href="www.exemple.com/privacy/" target="_blank" style="padding-left:5px;text-decoration:none;color:#ffffff;">Más información</a>
</div>
</div>
<script>
function getCookie(c_name){
var c_value = document.cookie;
var c_start = c_value.indexOf(" " + c_name + "=");
if (c_start == -1){
c_start = c_value.indexOf(c_name + "=");
}
if (c_start == -1){
c_value = null;
}else{
c_start = c_value.indexOf("=", c_start) + 1;
var c_end = c_value.indexOf(";", c_start);
if (c_end == -1){
c_end = c_value.length;
}
c_value = unescape(c_value.substring(c_start,c_end));
}
return c_value;
}
function setCookie(c_name,value,exdays){
var exdate=new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
document.cookie=c_name + "=" + c_value;
}
function getgeoip(json){
if (json.country_code=="ES" && getCookie('aviso')!="1") {
document.getElementById("barritaloca").style.display="block";
}
}
function PonerCookie(){
setCookie('aviso','1',365);
document.getElementById("barritaloca").style.display="none";
}
</script>
<script type="application/javascript" src="http://www.telize.com/geoip?callback=getgeoip"></script>
</body>
</html>
CHANGES
- Change Line 9 "www.exemple.com/privacy/" for your privacy web page
- To put the bar up change Line 4 "position:fixed" for "position:relative"
Bar text in english: "We use own and third party cookies to display personalized publicity by navigation. If you continue browse consider to accept the cookies use."
Via: http://forobeta.com/tutoriales/200436-aviso-de-cookies-espana-y-demas-paises.html
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- sauko@sauko
sauko - 0 likes
- sauko@sauko
sauko - 0 likes
- rjcalifornia@rjcalifornia
rjcalifornia - 0 likes
- sauko@sauko
sauko - 0 likes
- ihayredinov@ihayredinov
ihayredinov - 0 likes
- ura soul@tunist
ura soul - 0 likes
- Dries@driesdk
Dries - 0 likes
- Dries@driesdk
Dries - 0 likes
- Dries@driesdk
Dries - 0 likes
You must log in to post replies.Lo revisaré. Muchas Gracias!!!
Hi Joaquín, I placed it on top of index.php but nothing happened.
I see it's html text in php file.. Just have to put it like that?
Hi Sauko! May be you should upload this as a plugin (for Spanish users)
Ok, now I just have to learn how to make that plugin :)
Thanks!
As far as I understand the EU Directive, users only have to opt-in if cookies are used to collect personal information. Stock Elgg only stores an auth cookie, which does not by itself contain any identifying information. If you are going to use analytics et al, you may want to implement opt-in mechanisms. At this point, the whole thing is very unclear, and member states are yet to pass national legislation governing the use of cookies.
fyi, the social buttons in my 'interconnected' plugin for elgg do not use any javascript or cookies from the target sites.
I'm gonna use this to tryout the AMD way to add javascript and use plugin settings (to add your notice) in the AMD module as a small learning session. This should be fairly easy.
I'll wrap it up as a plugin for the community, but I'm not quite sure when this would be, a bit busy with graphic work this week.
Haha, this is actually fun when you get it working.
Plugin is almost ready, just tweaking and playing with plugin settings now to give you guys a way to change things as the message.
Here you are:
https://community.elgg.org/plugins/2197322