WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • General Community »
  • Global WebsiteBaker 2.8.x discussion »
  • Google Analytics in Settings
  • Print
Pages: [1]   Go Down

Author Topic: Google Analytics in Settings  (Read 8458 times)

Offline scheltel

  • Posts: 50
Google Analytics in Settings
« on: August 06, 2011, 12:08:14 AM »
I want to extend the settings form to enter the Google Analytics String.

I have modified the code, but when I'm trying to save the settings,  the script tags are not submitted to the database. It seems that there anti-cross site scripting measurements are taken. Is this true? And if so, how can I bypass this behavior?


[gelöscht durch Administrator]
Logged

Offline badknight

  • WebsiteBaker Org e.V.
  • **
  • Posts: 819
  • Gender: Male
    • pinzweb
Re: Google Analytics in Settings
« Reply #1 on: August 06, 2011, 09:46:32 AM »
show us the changes from the save.php you made for this.. maybe ther is something wrong
Logged
Ich würde gern die Welt verändern, doch Gott gibt mir den Quellcode nicht...

Offline scheltel

  • Posts: 50
Re: Google Analytics in Settings
« Reply #2 on: August 06, 2011, 11:19:17 AM »
I did not make any changes in save.php.

I have added the following 2 lines to /admin/settings/index.php

   $template->set_var(array(
                        [.... standard coding v2.8.2 ...]                        'HEADING_GOOGLE_ANAL YTICS_SETTINGS' => $HEADING['GOOGLE_ANALYTICS_SE TTINGS']                        
                        )
                  );

   // Insert language text and messages
   $template->set_var(array(
                        [.... standard coding v2.8.2 ...]
                        'TEXT_GOOGLE_ANALYTI CS_DESCRIPTION' => $TEXT['GOOGLE_ANALYTICS_DE SCRIPTION']
                        ));

Added to /templates/wb_theme/templates/settings.htt

<tr>
   <td colspan="3" style="padding-top: 10px;">
      <h2>{HEADING_GOOGLE_ANALYTICS_SETTINGS}</h2>
   </td>
</tr>
<tr>
   <td class="setting_name">{TEXT_GOOGLE_ANALYTICS_DESCRIPTION}</td>
   <td class="setting_value" colspan="2">
      <textarea name="google_analytics">{GOOGLE_ANALYTICS}</textarea>
   </td>
</tr>
<tr>
   <td>&nbsp;</td>
   <td>
      <input type="submit" name="submit" value="{TEXT_SAVE}" class="save" />
      <input type="reset" name="reset" value="{TEXT_RESET}" class="reset" />
   </td>
</tr>


Added to /install/save.php

   $settings_rows=   "INSERT INTO `".TABLE_PREFIX."settings` "
   ." (name, value) VALUES "
[.... standard coding v2.8.2 ...]
   ." ('google_analytics', '')";
   $database->query($settings_rows);


Added to /languages/[language].php
$TEXT['GOOGLE_ANALYTICS_DE SCRIPTION'] = 'Google Analytics String';
$HEADING['GOOGLE_ANALYTICS_SE TTINGS'] = 'Google Analytics Settings';


Added to /templates/[TEMPLATE_NAME]/index.php

if (function_exists('get_google_analytic s')) { get_google_analytic s(); }
?>
</body>


See attachment...
Logged

Offline DarkViper

  • Forum administrator
  • *****
  • Posts: 3087
  • Gender: Female
Re: Google Analytics in Settings
« Reply #3 on: August 06, 2011, 11:33:29 AM »
go into /admin/settings/save.php and search for the Line:

Code: (/admin/settings/save.php) [Select]
<?php

139   $allow_tags_in_fields 
= array(&#39;website_header&#39;, &#39;website_footer&#39;);

?>

and add your new datafield to this array.

thats all


take care:
Google Analytics is a very hot iron. Especially in Germany and partly in other EU countries also, you can easily come in conflict with the privacy act and other law. Unawareness does not protect against punishment. That's why we do not include such 'features'.
« Last Edit: August 06, 2011, 11:50:45 AM by DarkViper »
Logged
Der blaue Planet - er ist nicht unser Eigentum - wir haben ihn nur von unseren Nachkommen geliehen

"We need education to cope with digitalization - and NOT the digitalization of education.!"

Tägliches Stoßgebet: Oh Herr, wirf Hirn vom Himmel !

Offline scheltel

  • Posts: 50
Re: Google Analytics in Settings
« Reply #4 on: August 06, 2011, 12:34:57 PM »
DarkViper thanks!

So Google Analytics will not be built-in in future releases?
Logged

Offline DarkViper

  • Forum administrator
  • *****
  • Posts: 3087
  • Gender: Female
Re: Google Analytics in Settings
« Reply #5 on: August 06, 2011, 01:25:33 PM »
Definitely not.
Website Baker is used by a big amount of people who do not know many/all of the legal regulations. It would be careless of us to offer them options that they can bring into conflict with the law.

If somebody like to use GA anyway, so it's very easy to implement it in the index.php of each template.

Logged
Der blaue Planet - er ist nicht unser Eigentum - wir haben ihn nur von unseren Nachkommen geliehen

"We need education to cope with digitalization - and NOT the digitalization of education.!"

Tägliches Stoßgebet: Oh Herr, wirf Hirn vom Himmel !

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • General Community »
  • Global WebsiteBaker 2.8.x discussion »
  • Google Analytics in Settings
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2