New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug with Coppermine Gallery #28

Closed
flapane opened this Issue Jun 13, 2015 · 3 comments

Comments

Projects
None yet
2 participants
@flapane

flapane commented Jun 13, 2015

The cookie aren't blocked on Coppermine Gallery CMS: www.flapane.com/gallery/index.php

I think that the problem is related to
ob_start("euCookieLaw_callback");
in eucookielaw-header.php

In fact, Coppermine already uses:
ob_start();
include($path);
$return = ob_get_contents();
ob_end_clean();

to include a header.

Also, if you look the source code, the HTML code somehow becomes broken, and the HTML tags that are supposed to be at the top of the document (<html itemscope...[...]) are moved from line 1 to line 36
I can't even login, as there's a message saying: "your browser doesn't accept cookies"

@diegolamonica

This comment has been minimized.

Show comment
Hide comment
@diegolamonica

diegolamonica Jun 13, 2015

Owner

I've nevert tested it with Coppermine Gallery.
If someone would to make a guide is welcome!

Owner

diegolamonica commented Jun 13, 2015

I've nevert tested it with Coppermine Gallery.
If someone would to make a guide is welcome!

@flapane

This comment has been minimized.

Show comment
Hide comment
@flapane

flapane Jun 13, 2015

I also tried removing:
ob_start("euCookieLaw_callback");
from eucookielaw-header.php
and substituting it to
ob_start();
in Coppermine Gallery source code, but the result is the same.

flapane commented Jun 13, 2015

I also tried removing:
ob_start("euCookieLaw_callback");
from eucookielaw-header.php
and substituting it to
ob_start();
in Coppermine Gallery source code, but the result is the same.

@diegolamonica diegolamonica added question and removed help wanted labels Jul 11, 2015

@diegolamonica diegolamonica self-assigned this Jul 11, 2015

@diegolamonica

This comment has been minimized.

Show comment
Hide comment
@diegolamonica

diegolamonica Jul 11, 2015

Owner

Hi @flapane,
here are the instructions on how I made the EUCookieLaw working with Coppermine Gallery 1.5.36 (maybe something could change with other versions but I trust that it should work with all other versions too):

  1. download the following files from the repository

    • EUCookieLaw.js
    • eucookielaw.css
    • eucookielaw-header.php
  2. in the Coppermine Gallery installation root ( in my case is /var/www/copperminegallery/ ) create a directory named eucookielaw

  3. in the installation root ( in my case is /var/www/copperminegallery/ ) open the file index.php and replace the first <?php with the follogin rows of code:

    <?php
    define( 'EUCOOKIELAW_BANNER_ADDITIONAL_CLASS', 'fixedon-top floating' );
    
    define( 'EUCOOKIELAW_BANNER_TITLE', 'Titolo banner' );
    define( 'EUCOOKIELAW_BANNER_DESCRIPTION', 'Descrizione banner' );
    define( 'EUCOOKIELAW_BANNER_AGREE_BUTTON', 'Consento' );
    
    define( 'EUCOOKIELAW_DISALLOWED_DOMAINS', '.coppermine-gallery.net' );  
    define( 'EUCOOKIELAW_IFRAME_DEFAULT_SOURCE', 'eucookielaw/blocked/default.html' );
    define( 'EUCOOKIELAW_LOOK_IN_SCRIPTS', true );  
    
    require 'eucookielaw/eucookielaw-header.php';  
  4. open the template file in your theme (as for default installation Coppermine Gallery uses curve so the file I mean is /var/www/copperminegallery/themes/curve/template.html) and find the <head> section of your page then just after it add the following bunch of code:

    <!-- EUCOOKIELAW -->
    <link rel="stylesheet" href="eucookielaw/eucookielaw.css" type="text/css" />
    <script type="text/javascript" src="eucookielaw/EUCookieLaw.js"></script>
    <script type="text/javascript">
      new EUCookieLaw( {
          "showBanner":true,
          "reload":true,
          "debug":false,
          "bannerTitle":"Banner title",
          "message":"Banner short description",
          "agreeLabel":"I agree",
          "disagreeLabel":"I disagree",
          "tag":"h1",
          "agreeOnScroll": true,
          "agreeOnClick": true,
          "fixOn":"static",
          "duration":"20",
          "remember":"1",
          "cookieList":"__utm*,dolor",
          "classes":"light"
      });
    </script>
    <!-- EUCOOKIELAW -->

    Consider that the Javascript part could be configured as you want.

And you have done!

Owner

diegolamonica commented Jul 11, 2015

Hi @flapane,
here are the instructions on how I made the EUCookieLaw working with Coppermine Gallery 1.5.36 (maybe something could change with other versions but I trust that it should work with all other versions too):

  1. download the following files from the repository

    • EUCookieLaw.js
    • eucookielaw.css
    • eucookielaw-header.php
  2. in the Coppermine Gallery installation root ( in my case is /var/www/copperminegallery/ ) create a directory named eucookielaw

  3. in the installation root ( in my case is /var/www/copperminegallery/ ) open the file index.php and replace the first <?php with the follogin rows of code:

    <?php
    define( 'EUCOOKIELAW_BANNER_ADDITIONAL_CLASS', 'fixedon-top floating' );
    
    define( 'EUCOOKIELAW_BANNER_TITLE', 'Titolo banner' );
    define( 'EUCOOKIELAW_BANNER_DESCRIPTION', 'Descrizione banner' );
    define( 'EUCOOKIELAW_BANNER_AGREE_BUTTON', 'Consento' );
    
    define( 'EUCOOKIELAW_DISALLOWED_DOMAINS', '.coppermine-gallery.net' );  
    define( 'EUCOOKIELAW_IFRAME_DEFAULT_SOURCE', 'eucookielaw/blocked/default.html' );
    define( 'EUCOOKIELAW_LOOK_IN_SCRIPTS', true );  
    
    require 'eucookielaw/eucookielaw-header.php';  
  4. open the template file in your theme (as for default installation Coppermine Gallery uses curve so the file I mean is /var/www/copperminegallery/themes/curve/template.html) and find the <head> section of your page then just after it add the following bunch of code:

    <!-- EUCOOKIELAW -->
    <link rel="stylesheet" href="eucookielaw/eucookielaw.css" type="text/css" />
    <script type="text/javascript" src="eucookielaw/EUCookieLaw.js"></script>
    <script type="text/javascript">
      new EUCookieLaw( {
          "showBanner":true,
          "reload":true,
          "debug":false,
          "bannerTitle":"Banner title",
          "message":"Banner short description",
          "agreeLabel":"I agree",
          "disagreeLabel":"I disagree",
          "tag":"h1",
          "agreeOnScroll": true,
          "agreeOnClick": true,
          "fixOn":"static",
          "duration":"20",
          "remember":"1",
          "cookieList":"__utm*,dolor",
          "classes":"light"
      });
    </script>
    <!-- EUCOOKIELAW -->

    Consider that the Javascript part could be configured as you want.

And you have done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment