How best to involve the Cookie Bar

Alex L

  • Blogger, Webmaster CMS-Fan
  • Posts: 16
How best to involve the Cookie Bar
« on September 10th, 2015, 04:38 PM »
Hello Community,

I've got a problem and although would like to include in my Wedge board an EU Cookie Bar that will need because I want to use the forum Google.

The code for the Cookie Bar is as follows:

Code: [Select]
<! - Begin Cookie Consent plugin by Silktide - http://silktide.com/cookieconsent ->
<script type = "text / javascript">
    window.cookieconsent_options = {"message": "This forum uses cookies to offer you a better browsing experience please let it out this small and very dangerous files can you and your PC Make no harm Learn more in the privacy policy... by me "," Dismiss. ":" Allow "," Learn More ":" More Info "," link ":" http://internetblogger.de/forum/datenschutz.php "," theme "," dark-floating "};
</ script>

<script type = "text / javascript" src = "// s3.amazonaws.com/cc.silktide.com/cookieconsent.latest.min.js"> </ script>
<! - End Cookie Consent plugin ->

This code must be included under the final <head> tag.

But if I do, an error message appears in the frontend. I have included it in the backend under Skins-editing in the index.template.php file. There but not expanded. The place in the code of index.tepmplate.php looks like this.

Code: [Select]
// The main block above the content.
template_html_before function ()
{
        global $ context, $ txt, $ settings, $ topic;

        // Declare our HTML5 doctype, and Whether to show right to left.
        // The charset is already specified in the headers so it may be omitted,
        // But the specs recommend leaving them in, if the document is viewed offline.
        echo '<! DOCTYPE html>
<html ', $ context [' right_to_left ']? 'Dir = "RTL"': ''!, Empty ($ txt ['lang_dictionary'])? 'Lang = "'.. $ Txt ['lang_dictionary'] '' ':' ','>
<head> ', empty ($ topic)? '': '
        <meta charset = "utf-8"> ';






        // Our all-time favorites do not really like HTML5 ...
        if (we :: is ('ie8down'))
                echo '
        <script src = "// html5shiv.googlecode.com/svn/trunk/html5.js"> </ script> ';

        echo theme_base_css () '
        <! - Powered by Wedge, © R.-G. Deberdt - http://wedge.org ->
        <title> ', $ context [' page_title_html_safe '],! empty ($ context [' page_indicator '])? $ context ['page_indicator']: '', '</ title>';

        // If the Forum is in a sub-folder, it needs to Explicitly set a favicon URL.
        if (strpos (str_replace (': //', '', ROOT), '/') == false!)
                echo '
        <link rel = "shortcut icon" href = "', ROOT,' /favicon.ico" type = "image / vnd.microsoft.icon"> ';

        // Present a canonical URL for search engines to prevent duplicate content in Their indices.
        if (! empty ($ context ['canonical_url']))
                echo '
        <link rel = "canonical" href = "', $ context [' canonical_url '],'"> ';

        // Show all the relative links: such as search.
        if (! empty ($ context ['allow_search']))
                echo '
        <link rel = "search" href = "<URL> action = search?"> ';

        // If feeds are enabled to advertise the presence of one.
        if (! empty ($ settings ['xmlnews_enable']) && (! empty ($ settings ['allow_guestAccess']) || we :: $ is_member))
                echo '
        <link rel = "alternate" href = "? <URL> action = feed" type = "application / atom + xml" title = "", $ context ['forum_name_html_safe'], '">';

        // If we're viewing a topic, We Should link to the previous and next pages, respectively. Search engines like this.
        if (empty ($ context ['robot_no_index']))
        {
                if (! empty ($ context ['left'] ['prev']))
                        echo '
        <link rel = "prev" href = "', $ context [' left '] [' prev '],'"> ';
                if (! empty ($ context ['links'] ['next']))
                        echo '
        <link rel = "next" href = "', $ context [' links'] ['next'], '">';

        }

        if (! we :: is ('opera [11-], ie [10]'))
                echo '
        <meta name = "viewport" content = "width = device-width, initial-scale = 1, maximum-scale = 2, minimum-scale = 0.7"> ';

        if (! empty ($ context ['meta_description']))
                echo '
        <meta name = "description" content = "", $ context ['meta_description'], '">';

        // Please do not index thesis Mr Robotto.
        if (! empty ($ context ['robot_no_index']))
                echo '
        <meta name = "robots" content = "noindex"> ';

        if (isset ($ _ SESSION ['session_var'], $ _ GET [$ _ SESSION ['session_var']]))
                echo '
        <meta name = "referrer" content = "origin"> ';

        echo '

</ head> ';

How can I do that best? Thank you in advance.

CerealGuy

  • Posts: 343
Re: How best to involve the Cookie Bar
« Reply #1, on September 10th, 2015, 06:45 PM »
You can insert you own javascript code with add_js.
Code: [Select]
add_js('window.cookieconsent_options = {"message": "This forum uses cookies to offer you a better browsing experience please let it out this small and very dangerous files can you and your PC Make no harm Learn more in the privacy policy... by me "," Dismiss. ":" Allow "," Learn More ":" More Info "," link ":" http://internetblogger.de/forum/datenschutz.php "," theme "," dark-floating "};');

And the url to the cookieconsent.latest.min.js you can add like this:
Code: [Select]
add_js_file("// s3.amazonaws.com/cc.silktide.com/cookieconsent.latest.min.js", true);

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: How best to involve the Cookie Bar
« Reply #2, on September 13th, 2015, 03:04 PM »
It can all be done with non-destructive code (i.e., code that you add to a custom file in the skins folder, and that will not be rewritten everytime you update your forum files.)

However, I'd be curious to know why this is 'required' for you..?
I know that Europe in general has a directive about something like that, but it's more of a strong recommendation than a law or anything, AFAIK. I certainly never received an e-mail from anyone telling me about this. :P

emanuele

  • Posts: 125
Re: How best to involve the Cookie Bar
« Reply #3, on September 13th, 2015, 10:34 PM »
It's a directive, that each Member State has implemented its own way.
For example in Italy... there is chaos. LOL
Almost any site has put up a huge banner with the cookies warning, and is not entirely clear when and how the warning is really needed and what it shall do. (Actually, I think a good 75% of the sites have implemented it the wrong way, but considering nobody will ever go to the judge for a cookie nobody will ever know so who cares. :P)

CerealGuy

  • Posts: 343
Re: How best to involve the Cookie Bar
« Reply #4, on September 13th, 2015, 10:39 PM »
Quote from Nao on September 13th, 2015, 03:04 PM
It can all be done with non-destructive code (i.e., code that you add to a custom file in the skins folder, and that will not be rewritten everytime you update your forum files.)

However, I'd be curious to know why this is 'required' for you..?
I know that Europe in general has a directive about something like that, but it's more of a strong recommendation than a law or anything, AFAIK. I certainly never received an e-mail from anyone telling me about this. :P
Germany is quite strict with this (in general with all laws).

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: How best to involve the Cookie Bar
« Reply #5, on September 17th, 2015, 12:49 AM »
France is also strict, but honestly, I've never seen anything about this being mandatory. So, I mean, I doubt that's a *law* at all.

Plus, I consider this whole thing to be a fiasco. I understand the need for transparency. However, the only 'potentially harmful' cookies out there are cookies that persist between multiple websites. I believe it's up to browser implementors to do the job: they should show a non-intrusive popup for all sites that are requesting to store a cookie or even localStorage data (which is something that doesn't seem to be handled by the EU directive), and then allow for users to either: (1) do nothing, (2) dismiss the message for this session, (3) dismiss forever for this particular website, (4) dismiss forever for all websites if it's 'just' a regular cookie, (5) dismiss forever, whatever the system (cookie, localStorage) and cross-domain possibilities.

But nope, nothing. Website authors end up doing it by themselves, with disastrous results for web designers.

Alex L

  • Blogger, Webmaster CMS-Fan
  • Posts: 16
Re: How best to involve the Cookie Bar
« Reply #6, on September 17th, 2015, 06:44 AM »
Quote from Nao on September 13th, 2015, 03:04 PM
It can all be done with non-destructive code (i.e., code that you add to a custom file in the skins folder, and that will not be rewritten everytime you update your forum files.)

However, I'd be curious to know why this is 'required' for you..?
I know that Europe in general has a directive about something like that, but it's more of a strong recommendation than a law or anything, AFAIK. I certainly never received an e-mail from anyone telling me about this. :P
Yes, so I got an email from Google and Google says that if you use Google products like AdSense, Analytics and Social Media Buttons, you need a cookie bar on a Web page. This is a shame, but I see more and more sites these cookie bar.

I try it with me everywhere enforce what will take. But otherwise, yes, there is still no German law, which would require the Cookie Bar.

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: How best to involve the Cookie Bar
« Reply #7, on September 17th, 2015, 09:48 AM »
Hmm. I don't use these Google services so it's no wonder I didn't get that email.

But yeah they involve shared cookies so I get the point.

Now if only browsers could go beyond DoNotTrack and actually allow for removal of cross domain cookies... I.e. cookies called from another domain name.