News:

Join the Facebook Fan Page.

Main Menu

EU Cookie

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

Previous topic - Next topic

lurkalot

Quote from: RedPanda2013 on February 05, 2017, 07:03:27 AM

They specifically stated that a link to the privacy and cookie policy must exist at the bottom of EACH page so how do I add the link in the bottom of my SMF????

Thank you

It's all well and good having a link pointing to the privacy and cookie policy page, but do you actually have a page on your site to link to?

RedPanda2013

Quote from: Kindred on February 05, 2017, 07:26:06 AM
Well, they are actually exceeding their authority. If your business and your servers are outside of the EU, they can't enforce the EU cookie law. They really can't.

However, if you want to do it, you would add a link in index.template.php

search for $forum_copyright and you can put your link somewhere near that to have it in the footer.
(please note, templates are a combination of html and php...  you can't just put random html into the code  it has to be properly placed within an echo statement)

Thank you, I will try...I know they are ridiculous but I don't want to attract issues given the fact I already had to move the forum once because Italian authorities told local Telcos to filter my URL just because they though I violated one of their stupid rules!!!  >:(

RedPanda2013

Quote from: lurkalot on February 05, 2017, 07:30:12 AM
Quote from: RedPanda2013 on February 05, 2017, 07:03:27 AM

They specifically stated that a link to the privacy and cookie policy must exist at the bottom of EACH page so how do I add the link in the bottom of my SMF????

Thank you

It's all well and good having a link pointing to the privacy and cookie policy page, but do you actually have a page on your site to link to?

Yes, I just created it...it's a million words  >:(

And I still need to figure out how to add the pop-up, then notify the Italian authorities because I did not anonimize Google Analytics.  >:(

For WordPress I found a nice plugin but for the forum...is the mod in this topic the best way to go?

Thank you

RedPanda2013

well in the mean time I installed this mod, however I tested it in different browsers and with Chrome and Firefox I get an issue:

The black bar stays at the bottom of the forum, not just the visible bottom of the screen, but at the bottom of the page so if the user does not scroll down till the bottom of the page, he/she won't see anything.

It's working fine on IE.

Rob Lightbody

Installed and working with no issues on 2.0.15.

A great, simple mod.

Bigguy

Quote from: RedPanda2013 on February 05, 2017, 09:13:53 AM
well in the mean time I installed this mod, however I tested it in different browsers and with Chrome and Firefox I get an issue:

The black bar stays at the bottom of the forum, not just the visible bottom of the screen, but at the bottom of the page so if the user does not scroll down till the bottom of the page, he/she won't see anything.

It's working fine on IE.


I had similar issues with it on 2.1

petb

Reproducable Error on 2.0.15 and Chrome.
Anyone knows another mod for an cookie alert?

nikan

The mod is working with no issues on 2.0.15 and with Firefox, Chrome, IE.
Any problem may occur is probably a compatibility issue with other installed mod on stylesheet / javascript.

petb

I found out that the CSS styles are not used in Chrome, but in Firefox and Edge.

Kindred

That is incorrect.

Chrome uses css stylehseets just fine.
Слaва
Украинi

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."

petb

Yes, in general already.

But in the case of me,
the following CSS properties that the mod in "$themedir/css/index.css" incorporates,
are not inherited from Chrome.

Specifically, these two classes:

.cookie_wrap
{
position: fixed;
width: 100%;
bottom: 20px;
text-align: center;
z-index: 9999;
visibility: hidden;
}
....... placeholder for the others here in the code standing properties
............

.cookie_notice
{
display: inline-block;
margin: 0 auto;
padding: 10px;
border-radius: 5px;
font-size: 12px;
}

were transferred to the "$themedir/css/index.css" file as declared in the install mod,
but, only in Chrome, then not evaluated, they were not visible on both elements ..
That was on all Chrome installations I have on several PCs.
Why? I did not find out on the fast.

Edge and Firefox worked normally.

And as soon as I transferred these properties directly to the two div's using style = "",
they were executed correctly by chrome.

This is my scenario how I solved the problem for myself.

Maybe there is another and better solution, but I did not find it on the fast and that's how it works for me now.

BertM

@petb

I seem to have the same problem, but I do not understand your solution..

petb

The two css classes are not used by Chrome.
So to overwrite this behavior, you can put them each in a singel style="" Element into each div like this example <div style="put css content here">
Then this is more important and chrome will overtune his behavior.

But sorry, i can't look back, because i didn't use this mod anymore.



smartmouse

Hello, will this mod be updated to work with SMF 2.1?

Portugal

Hi, ive some problems using this after mod upgrade to 2.0.1.7 version, any chance to have it working again?


Thanks
Portugal

uok825

I did some changes for Turkish. Here is translates:

install2.xml

<file name="$languagedir/Modifications.turkish.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// EU Cookie
$txt['mods_cat_eucookie'] = 'AB Çerezler';
$txt['enable_eucookie'] = 'AB Çerezleri aktifleştir';
$txt['eucookie_color'] = 'Renk Seç';
$txt['eucookie_black'] = 'Siyah';
$txt['eucookie_white'] = 'Beyaz';
$txt['eucookie_notice'] = 'Uyarı Metni:';
$txt['eucookie_text'] = 'Çerezler, size daha iyi bir gezinme deneyimi sağlamamıza yardımcı olur. Sitemizi kullanarak, çerezlerin tarafımızca kullanılmasına izin vermiş olursunuz.';
$txt['eucookie_policy'] = 'Aydınlatma Metni linki ';
$txt['eucookie_more'] = 'Daha Fazla';
]]></add>
</operation>
</file>


install-utf8.xml

<file name="$languagedir/Modifications.turkish-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// EU Cookie
$txt['mods_cat_eucookie'] = 'AB Çerezler';
$txt['enable_eucookie'] = 'AB Çerezleri aktifleştir';
$txt['eucookie_color'] = 'Renk Seç';
$txt['eucookie_black'] = 'Siyah';
$txt['eucookie_white'] = 'Beyaz';
$txt['eucookie_notice'] = 'Uyarı Metni:';
$txt['eucookie_text'] = 'Çerezler, size daha iyi bir gezinme deneyimi sağlamamıza yardımcı olur. Sitemizi kullanarak, çerezlerin tarafımızca kullanılmasına izin vermiş olursunuz.';
$txt['eucookie_policy'] = 'Aydınlatma Metni linki ';
$txt['eucookie_more'] = 'Daha Fazla';
]]></add>
</operation>
</file>


Thank you for the mod.

anthony64

Any updated version for this? I just installed this mod in my 2.0.18 forum but no cookie notice shows up. I have configured everything and, apparently, everything should be working, but nothing shows up when visiting the forum from any browser as a visitor.

Portugal

Hi.

Uninstal it, delet at all. Them install it again, must work fine!


Quote from: anthony64 on February 20, 2021, 05:36:12 AM
Any updated version for this? I just installed this mod in my 2.0.18 forum but no cookie notice shows up. I have configured everything and, apparently, everything should be working, but nothing shows up when visiting the forum from any browser as a visitor.

@rjen

I am playing with the update of some to use only hooks for use in SMF2.1.

This mod is one of them.

I have already succesfully implemented the hooks for the admin section, using these hooks
hook="integrate_modify_modifications
hook="integrate_admin_areas
hook="integrate_admin_search

Now I am trying to get the EU-cookie pop-up to load, but I am not finding the correct hooks (I think)
I need to get two edits working:

this edit to load.php

    <file name="$sourcedir/Load.php">
        <operation>
            <search position="before"><![CDATA[
    // Some basic information...
    if (!isset($context['html_headers']))
        $context['html_headers'] = '';
]]></search>
            <add><![CDATA[
    // 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");
            }
        });
    </script>';
]]></add>
        </operation>
    </file>

I think I should use integration hook 'integrate_theme_include' to include the script. Is that the correct hook?

Then secondly I need to include the pop-up in the screen to replace this edit..

    <file name="$themedir/index.template.php">
        <operation>
            <search position="before"><![CDATA[function template_html_below()
{
    global $context, $settings, $options, $scripturl, $txt, $modSettings;]]></search>
            <add><![CDATA[

    // EU Cookie mod
    global $user_info;
    if (!$user_info['is_admin'] && !empty($modSettings['enable_eucookie']))
        echo '
    <div class="cookie_wrap">
        <div class="cookie_notice" style="' . ($modSettings['eucookie_color'] == 'black' ? 'background: #000; background-color: rgba(0,0,0,0.80); color: #fff;' : 'background: #fff; background-color: rgba(255,255,255,0.80); color: #000;') . '">
            ', !empty($modSettings['eucookie_notice']) ? $modSettings['eucookie_notice'] : $txt['eucookie_text'], '
            <button id="cookie_button" type="button">OK</button>
            ' . (!empty($modSettings['eucookie_policy']) ?  '<a style="' . ($modSettings['eucookie_color'] == 'black' ? 'color: #fff;' : 'color: #000;') . '" href="' . $modSettings['eucookie_policy'] . '">' . $txt['eucookie_more'] . '</a>' : '') . '
        </div>
    </div>';
]]></add>
        </operation>
    </file>

I tried by using integration hook 'integrate_load_theme' to include this, but no luck

I created a php file called from the hook, which loads a language file and then load an extra template file. But it does not work,: not getting the pop-up to show....


source
<?php

if (!defined('SMF'))
    die(
'Hack Attempt...');

function 
eu_cookie()
{
    global 
$user_info$modSettings;

    
// Did we get the parameter we wanted?
    
if ($user_info['is_guest'] && !empty($modSettings['enable_eucookie'])) {

    
// Now we can load the language file we want as it will now be needed.
    
loadLanguage('eu_cookie');

    
// What the language strings will be used on.
    
loadTemplate('eu_cookie');
    }
}              

?>


Template
<?php
function template_main(){

    global 
$user_info$modSettings;

        echo 
'
    <div class="cookie_wrap">
        <div class="cookie_notice" style="' 
. ($modSettings['eucookie_color'] == 'black' 'background: #000; background-color: rgba(0,0,0,0.80); color: #fff;' 'background: #fff; background-color: rgba(255,255,255,0.80); color: #000;') . '">
            '
, !empty($modSettings['eucookie_notice']) ? $modSettings['eucookie_notice'] : $txt['eucookie_text'], '
            <button id="cookie_button" type="button">OK</button>
            ' 
. (!empty($modSettings['eucookie_policy']) ?  '<a style="' . ($modSettings['eucookie_color'] == 'black' 'color: #fff;' 'color: #000;') . '" href="' $modSettings['eucookie_policy'] . '">' $txt['eucookie_more'] . '</a>' '') . '
        </div>
    </div>'
;
}
?>
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

@rjen

Made some progress.

I managed to get the script in the page as part in the html_headers by using the hook 'integrate_load_theme'.

Now I only need to find the correct hook to include a pop-up in the page.

I tried to use the same hook to load the template, but that errors out with HTTP ERRR 500...
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

Advertisement: