[NEW PLUGIN] jm_cookie_control

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

maeg
Posts: 525
Joined: Fri Feb 20, 2009 2:27 pm
Location: Agerbæk, Denmark
Contact:

[NEW PLUGIN] jm_cookie_control

Post by maeg » Fri Dec 12, 2014 6:27 pm

Hi

jm_cookie_control is a simple cookie control solution.
From the admin you can change:
- the infotext to your visitor
- accept buttom text
- URL to your cookie info site
- linktext

It only works in cmsimple version 1.6 and newer, i don't know why it don't work in version 1.5

Demo and download

cmb
Posts: 12893
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: [NEW PLUGIN] jm_cookie_control

Post by cmb » Sat Dec 13, 2014 12:58 pm

Hi maeg,

nice one! :)

It should be noted in the help file, that it requires jQuery, so that Plugins -> JQuery -> Config -> Autoload has to be enabled (unless jQuery is already enabled otherwise), and that the plugin call <?php echo jm_cookie_control();?> has to be placed after <?php echo head();?>. If that is done, the plugin works under CMSimple_XH 1.5 as well (tested with XH 1.5.10).

However, I suggest to change the default language string "button". Now it says "I accept", but that might be misleading. A visitor might think if they do not click the button, that no cookies will be set, but that still can happen (test, for instance, with XH 1.6.4 where a cookie named PHPSESSID is set as soon as the site is requested). Maybe it's better to label the button "I have acknowledged the use of cookies" or so.

Please note, that there's also Privacy_XH, which tries to help complying with the "EU cookie law" (even if it is still not clear to me, what the actual requirements are). However, that would require more cooperation from the plugin developers; at least the list in the Wiki would have to be completed and kept up-to-date. I would prefer a fully automated solution, but I'm not sure that is possible. I'll investigate.

Christoph

PS:
cmb wrote:I'll investigate.
εὕρηκα :!:
Christoph M. Becker –Plugins for CMSimple_XH, but not for CMSimple 4+

Tata
Posts: 2870
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: [NEW PLUGIN] jm_cookie_control

Post by Tata » Mon Sep 03, 2018 4:16 pm

I have adjusted the plugin to work properly with CMSimple_XH 1.7.2 + onepage and have found this problem:
1. Is the "GDPR" page removed from navigation, the link to #GDPR doesn't work.
2. Is the "GDPR" page listed in navigation, the link works only if there is set

Code: Select all

$plugin_cf['onepage']['url_numeric']="true";
If the "GDPR" page listed in navigation, the link in the jm_cookie_control message is redundant.
Have look at http://carwash.cmsimple.sk
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

lck
Posts: 1364
Joined: Wed Mar 23, 2011 11:43 am
Contact:

Re: [NEW PLUGIN] jm_cookie_control

Post by lck » Tue Sep 04, 2018 9:20 am

Tata wrote:
Mon Sep 03, 2018 4:16 pm
1. Is the "GDPR" page removed from navigation, the link to #GDPR doesn't work.
Versteckte Seiten können nicht angesprungen werden, das ist normal.
Tata wrote:
Mon Sep 03, 2018 4:16 pm
2. Is the "GDPR" page listed in navigation, the link works only if there is set

Code: Select all

$plugin_cf['onepage']['url_numeric']="true";
Bei mir funktioniert es auch ohne numerischen Link.
- Seite erstellt mit Seitennamen "GDPR"
- In der Seite Seitentitel erstellt "<h1>Zásady spracovania a ochrany osobných údajov</h1>"
- Im Plugin jm_cookie_control unter Sprache > Link: #GDPR eingetragen
„Bevor du den Pfeil der Wahrheit abschießt, tauche die Spitze in Honig!“   👉 Ludwig's XH-Templates for MultiPage & OnePage

lck
Posts: 1364
Joined: Wed Mar 23, 2011 11:43 am
Contact:

Re: [NEW PLUGIN] jm_cookie_control

Post by lck » Tue Sep 04, 2018 9:41 am

Tata wrote:
Mon Sep 03, 2018 4:16 pm
If the "GDPR" page listed in navigation, the link in the jm_cookie_control message is redundant.
Den Link könntest du per CSS ausblenden:

Code: Select all

.menulevel1 li a[href*="#GDPR"] {
	display: none;
	margin: 0;
	padding: 0;
}
„Bevor du den Pfeil der Wahrheit abschießt, tauche die Spitze in Honig!“   👉 Ludwig's XH-Templates for MultiPage & OnePage

Tata
Posts: 2870
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: [NEW PLUGIN] jm_cookie_control

Post by Tata » Tue Sep 04, 2018 9:55 am

Super Lösung. Danke.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

Tata
Posts: 2870
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: [NEW PLUGIN] jm_cookie_control

Post by Tata » Sun Sep 30, 2018 3:00 pm

The modified plugin works fine with CMSimple_XH 1.7.2, except of this debug warning:
NOTICE: Undefined index: jm_cookie_control
/Users/tata/webpages/fytofyto/cmsimple/classes/PluginConfig.php:84
And I can't find the reason.
jm_cookie_control_mod.zip
You do not have the required permissions to view the files attached to this post.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

cmb
Posts: 12893
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: [NEW PLUGIN] jm_cookie_control

Post by cmb » Sun Sep 30, 2018 4:18 pm

Tata wrote:
Sun Sep 30, 2018 3:00 pm
The modified plugin works fine with CMSimple_XH 1.7.2, except of this debug warning:
NOTICE: Undefined index: jm_cookie_control
/Users/tata/webpages/fytofyto/cmsimple/classes/PluginConfig.php:84
And I can't find the reason. jm_cookie_control_mod.zip
The plugin references $plugin['jm_cookie_control'], but doesn't provide a config.php at all. Removing line 16 in index.php should be sufficient.
Christoph M. Becker –Plugins for CMSimple_XH, but not for CMSimple 4+

Tata
Posts: 2870
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: [NEW PLUGIN] jm_cookie_control

Post by Tata » Sun Sep 30, 2018 4:34 pm

Das wars. Danke.
Weil ich den Plugin auf meinen Seiten mit der "GDPR" Seite durch

Code: Select all

$plugin_tx['jm_cookie_control']['link']
verbinde, habe ich als mehr praktisch es mit einer "StandardGDPRdatei" zu verbinden und in einem Fancybox zu öffnen. Dafür braucht man z.B. hi_fancybox Plugin installiert haben. Dafür habe ich noch eine kleine Modifikation in der index.php Datei gemacht.

Code: Select all

<div id="cookie-text">
    <button id="accept">'.$ptx['button'].'</button>'.$ptx['text'].' 
        <a class="zoom_i" href="'.$ptx['link'].'">'.$ptx['linkbutton'].'</a>
</div>
In der Sprachdatei braucht man dann nur den Link definieren

Code: Select all

$plugin_tx['jm_cookie_control']['link']="./userfiles/GDPR.html";
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

Tata
Posts: 2870
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: [NEW PLUGIN] jm_cookie_control

Post by Tata » Wed Oct 03, 2018 3:18 pm

Ich habe noch einiges erweitert, um den Plugin noch mehr bequem zu nutzen.
1. jm_cookie_control/data erstellt mit GDPR_??.htm Dazeien drin.
2. inde.php:

Code: Select all

function jm_cookie_control() {
    global $hjs, $pth, $plugin_cf, $plugin_tx, $sl;

    $pcf = $plugin_cf['jm_cookie_control'];
    $ptx = $plugin_tx['jm_cookie_control'];
    // following path shall be simplyfied
    $pdata = $pth['folder']['base'].'plugins/jm_cookie_control/data/'.$ptx['link'];
	
    $o = ' <script src="'.$pth['folder']['plugins'].'jm_cookie_control/jm_cookie_control.js"></script>
	<div id="cookie-space"></div>                
            <div id="cookie-consent">
                <div id="cookie-inner">
                    <div id="cookie-text">
                        <button id="accept">'.$ptx['button'].'</button>'
                        .$ptx['text'].' 
                        <a class="zoom_i" href="'.$pdata.'" target="_blank">'
                            .$ptx['linkbutton'].'
                        </a>
                    </div>   
                </div>
             </div>';
   
    return $o;
	
	}
3. Sprachdatei:

Code: Select all

	$plugin_tx['jm_cookie_control']['button']="Verstanden und zugestimmt";
	$plugin_tx['jm_cookie_control']['text']="Die Webseite benutzt cookies. Lesen Sie mehr hier ";
	$plugin_tx['jm_cookie_control']['link']="GDPR-sk.html";
	$plugin_tx['jm_cookie_control']['linkbutton']="\"GDPR\" &raquo;";
Der Plugin soll zusammen mit hi_fancybox instelliert werden. In dem Fall öffnet sich die GDPR Datei im Fancybox.
Es bleibt mir jetzt nur noch eine Frage. Ist es irgendwie möglich die Sprachdatei im Backend editieren?
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

Post Reply