EU Cookie

Started by nikan, May 19, 2013, 02:07:30 AM

Previous topic - Next topic

signaleleven

Quote from: nikan on May 31, 2015, 06:01:48 AM
You can post your changes here.
I'll be happy to add any change that will make the mod more efficient.

In Load.php

        // EU cookie mod
        if (!$user_info['is_admin'] && !empty($modSettings['enable_eucookie']))
                $context['html_headers'] .= '
        <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
        <script type="text/javascript">
                jQuery(document).ready(function(){
                        var cookieSet = document.cookie.indexOf("eu_cookie=") != -1;
                        if(!cookieSet){
                                jQuery("#cookie_button").click(function(){
                                        var expire = new Date();
                                        expire.setDate(expire.getDate() + 30);
                                        document.cookie = "eu_cookie=1; path=/; expires=" + expire;
                                        jQuery(".cookie_wrap").fadeOut("fast");
                                });
                                jQuery(".cookie_wrap").css("visibility", "visible"); /* Visible only if the cookie is not set! */
                        }
                });
        </script>';


In index css


.cookie_wrap
{
        position: fixed;
        width: 100%;
        bottom: 20px;
        text-align: center;
        z-index: 9999;
        visibility: hidden; /* THIS was added */
}




I hope this helps!

nikan

The mod updated with the code change.

Thanks signaleleven.

Hatchan

Greetings to all...

I'm having a few issues with this mod, since it seems I cannot make it shows :(

I've installed it and activated it from the admin panel. Still, it doesn't show.
I already tried to see if it works when I'm logged out with no results. I've cleaned the cache, but still it doesn't appear.

Any help?

laudia

Hi nikan, you could add the possibility to enter a custom color? options to enter the code for background: and color: css (in the format #fff). This way if you have a custom theme everyone can add his.


Quote from: nikan on June 10, 2013, 10:01:54 AM
lurkalot i already answer on this and also answered by dimspace.
Quote from: dimspace on June 09, 2013, 06:45:43 PM
Quote from: lurkalot on May 27, 2013, 03:50:11 AM
Any way of hiding this permanently for registered members, once they've clicked the accept button? 

It's a great mod, but I can see my members getting annoyed with it.

the usual way of remembering that users have accepted the cookie prompt, is by um.. a cookie.. :D
I'll answer again if this can help.
The state of accepting is stored in a cookie, so if any of your members has cookies disabled in their browser they will see the message again. Sorry if you felt unsupported.

p.s. to get what he asks you lurkalot, you can change
if (! $ context ['user'] ['is_admin']
in index.template.php, in
if ($ context ['user'] ['is_guest']
however, if it is not logged in you will see

mano82

hey Nikan,

thanks for the package.

I've made a little hack for my site adding italian. Here's the translation code if you're interested to upgrade.

change in install2.xml
<file name="$languagedir/Modifications.italian.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// EU Cookie
$txt['mods_cat_eucookie'] = 'EU Cookie';
$txt['enable_eucookie'] = 'Attiva EU Cookie';
$txt['eucookie_color'] = 'Seleziona il colore';
$txt['eucookie_black'] = 'Nero';
$txt['eucookie_white'] = 'Bianco';
$txt['eucookie_notice'] = 'Testo di notifica:';
$txt['eucookie_text'] = 'I Cookies ci aiutano a fornirti una migliore esperienza di navigazione. Utilizzando il nostro sito, ci autorizzi all\'uso dei cookies.';
$txt['eucookie_policy'] = 'URL pagina di approfondimento';
$txt['eucookie_more'] = 'Scopri di più';
]]></add>
</operation>
</file>


change in install-utf8.xml
<file name="$languagedir/Modifications.italian-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// EU Cookie
$txt['mods_cat_eucookie'] = 'EU Cookie';
$txt['enable_eucookie'] = 'Attiva EU Cookie';
$txt['eucookie_color'] = 'Seleziona il colore';
$txt['eucookie_black'] = 'Nero';
$txt['eucookie_white'] = 'Bianco';
$txt['eucookie_notice'] = 'Testo di notifica:';
$txt['eucookie_text'] = 'I Cookies ci aiutano a fornirti una migliore esperienza di navigazione. Utilizzando il nostro sito, ci autorizzi all\'uso dei cookies.';
$txt['eucookie_policy'] = 'URL pagina di approfondimento';
$txt['eucookie_more'] = 'Scopri di più';
]]></add>
</operation>
</file>


attached the complete modified package.

nikan

Updated with Italian translation.

Thanks mano82.

Topman

I have just added this to the registration agreement:
"By registering, you agree to you accept the use of cookies on this website in accordance as required by the  EU Cookie Directive 2009/136/ec and agree to abide by all FORUM RULES[/url].  FOR MORE INFORMATION ON COOKIES[/url]"

Kindred

that is not actually sufficient for the EU law.
Слова
Украина

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

signaleleven

I have fixed another bug.
The cookie, on safari, was set as a session cookie. Safari was ignoring the expiration date, because it must be in UTC/GMT format.
Some of my users use safari, and they reported it. It took me one hour of debugging :(

In Load.php

        // EU cookie mod
        if (!$user_info['is_admin'] && !empty($modSettings['enable_eucookie']))
                $context['html_headers'] .= '
        <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
        <script type="text/javascript">
                jQuery(document).ready(function(){
                        var cookieSet = document.cookie.indexOf("eu_cookie=") != -1;
                        if(!cookieSet){
                                jQuery("#cookie_button").click(function(){
                                        var expire = new Date();
                                        expire.setDate(expire.getDate() + 30);
                                        document.cookie = "eu_cookie=1; path=/; expires=" + expire.toUTCString();
                                        jQuery(".cookie_wrap").fadeOut("fast");
                                });
                                jQuery(".cookie_wrap").css("visibility", "visible"); /* Visible only if the cookie is not set! */
                        }
                });
        </script>';




The only change is the .toUTCString(); added to the expire variable while setting the cookie.

nikan

Updated with fix for expiration date on Safari.

Thanks signaleleven.

Topman

Quote from: Kindred on June 22, 2015, 09:54:05 AM
that is not actually sufficient for the EU law.

It's "sufficient" for me! 
There is no EU cookie warning on this website is there, or have I missed it?

Kindred

There is not... because we are a US company with servers in the US.
Слова
Украина

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Topman

Quote from: Kindred on June 24, 2015, 07:00:40 AM
There is not... because we are a US company with servers in the US.

It doesn't matter. The website is accessible in the EU countries. 
Google has a cookie warning as does Facebook!

Empire KickAss

So is it a good idea to have this installed? I don't know if I want it or not
If I helped you out in anyway can u please click this up button arrow .Thank You!!!

signaleleven

Quote from: topman on June 27, 2015, 06:32:56 AM
Quote from: Kindred on June 24, 2015, 07:00:40 AM
There is not... because we are a US company with servers in the US.

It doesn't matter. The website is accessible in the EU countries. 
Google has a cookie warning as does Facebook!

It's really controversial. Google and FB have offices in europe and business in europe. They are not merely accessible from europe. They specifically target the market.

If tomorrow Iran passes a law that every website accessible to Iran has to show a privacy policy written in Farsi, would it be your job to either do it or make it so that you are not accessible from Iran?
I didn't think so :)


Topman

Exactly!  This EU rule is rubbish!
Unless you are a huge commercial company operating in the EU countries I think it can be ignored as far as forums are concerned.
LOB  IMO

Kindred

Quote from: topman on June 27, 2015, 06:32:56 AM
Quote from: Kindred on June 24, 2015, 07:00:40 AM
There is not... because we are a US company with servers in the US.

It doesn't matter. The website is accessible in the EU countries. 
Google has a cookie warning as does Facebook!

We are a US company with servers in the US.
We have no European presence (in terms of locations or equipment)
US law is technically the only thing that SM needs to follow.
We do not fall into the same category of google or facebook -- who both have a physical EU presence (offices and servers)
Слова
Украина

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Niko_Bellic

So, does this mean, that if my server is housed in the USA, I do not need to worry about the cookie issue?
I don't need this mod, then?

Shambles

Quote from: NikoBellic
So, does this mean, that if my server is housed in the USA, I do not need to worry about the cookie issue?
I don't need this mod, then?

Dunno where in the world you are, but here in the UK we can access "google", which reveals the answer.

http://www.cookielaw.org/the-cookie-law/

Niko_Bellic

Yes, I have access too. What an amazing thing the internet is...
Lets us search, and be rude all in one post.

Advertisement: