Advertisement:

Author Topic: EU Cookie  (Read 34110 times)

Offline signaleleven

  • Newbie
  • *
  • Posts: 5
Re: EU Cookie
« Reply #40 on: May 31, 2015, 06:15: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
Code: [Select]
        // 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

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



I hope this helps!

Offline nikan

  • Jr. Member
  • **
  • Posts: 390
Re: EU Cookie
« Reply #41 on: May 31, 2015, 11:06:29 AM »
The mod updated with the code change.

Thanks signaleleven.

Offline Hatchan

  • Newbie
  • *
  • Posts: 1
Re: EU Cookie
« Reply #42 on: June 01, 2015, 06:53:01 AM »
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?

Offline laudia

  • Jr. Member
  • **
  • Posts: 159
    • guadagnare con internet
Re: EU Cookie
« Reply #43 on: June 03, 2015, 08:55:49 AM »
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.


lurkalot i already answer on this and also answered by dimspace.
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

Offline mano82

  • Semi-Newbie
  • *
  • Posts: 20
Re: EU Cookie
« Reply #44 on: June 16, 2015, 02:45:23 AM »
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
Code: [Select]
<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
Code: [Select]
<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.

Offline nikan

  • Jr. Member
  • **
  • Posts: 390
Re: EU Cookie
« Reply #45 on: June 18, 2015, 04:31:41 AM »
Updated with Italian translation.

Thanks mano82.

Offline Topman

  • Full Member
  • ***
  • Posts: 485
  • Helping the UK new home buyer
    • newbuildhomes on Facebook
    • @@NewHomeExpert1 on Twitter
    • Brand New Homes
Re: EU Cookie
« Reply #46 on: June 22, 2015, 07:40:51 AM »
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]"

Online Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 60,216
  • Gender: Male
    • Kindred-999 on GitHub
Re: EU Cookie
« Reply #47 on: June 22, 2015, 09:54:05 AM »
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."

Offline signaleleven

  • Newbie
  • *
  • Posts: 5
Re: EU Cookie
« Reply #48 on: June 23, 2015, 01:47:29 PM »
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
Code: [Select]
        // 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.

Offline nikan

  • Jr. Member
  • **
  • Posts: 390
Re: EU Cookie
« Reply #49 on: June 23, 2015, 02:39:53 PM »
Updated with fix for expiration date on Safari.

Thanks signaleleven.

Offline Topman

  • Full Member
  • ***
  • Posts: 485
  • Helping the UK new home buyer
    • newbuildhomes on Facebook
    • @@NewHomeExpert1 on Twitter
    • Brand New Homes
Re: EU Cookie
« Reply #50 on: June 24, 2015, 05:21:55 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?

Online Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 60,216
  • Gender: Male
    • Kindred-999 on GitHub
Re: EU Cookie
« Reply #51 on: June 24, 2015, 07:00:40 AM »
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."

Offline Topman

  • Full Member
  • ***
  • Posts: 485
  • Helping the UK new home buyer
    • newbuildhomes on Facebook
    • @@NewHomeExpert1 on Twitter
    • Brand New Homes
Re: EU Cookie
« Reply #52 on: June 27, 2015, 06:32:56 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!

Offline Empire KickAss

  • Jr. Member
  • **
  • Posts: 158
    • Bayside Gamers
Re: EU Cookie
« Reply #53 on: June 27, 2015, 10:29:09 AM »
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!!!

Offline signaleleven

  • Newbie
  • *
  • Posts: 5
Re: EU Cookie
« Reply #54 on: June 27, 2015, 10:33:04 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 :)


Offline Topman

  • Full Member
  • ***
  • Posts: 485
  • Helping the UK new home buyer
    • newbuildhomes on Facebook
    • @@NewHomeExpert1 on Twitter
    • Brand New Homes
Re: EU Cookie
« Reply #55 on: June 29, 2015, 03:16:56 AM »
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

Online Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 60,216
  • Gender: Male
    • Kindred-999 on GitHub
Re: EU Cookie
« Reply #56 on: July 04, 2015, 10:34:18 PM »
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."

Offline Niko_Bellic

  • Semi-Newbie
  • *
  • Posts: 40
  • Gender: Male
  • Forgive me! It's an ugly city!
Re: EU Cookie
« Reply #57 on: July 05, 2015, 12:39:27 PM »
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?

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 5,608
  • Gender: Male
    • i30 Owners Club
Re: EU Cookie
« Reply #58 on: July 05, 2015, 12:55:34 PM »
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/

Offline Niko_Bellic

  • Semi-Newbie
  • *
  • Posts: 40
  • Gender: Male
  • Forgive me! It's an ugly city!
Re: EU Cookie
« Reply #59 on: July 05, 2015, 12:58:02 PM »
Yes, I have access too. What an amazing thing the internet is...
Lets us search, and be rude all in one post.