Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions event/listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ public function __construct(config $config, language $language, template $templa
public static function getSubscribedEvents()
{
return [
'core.page_header' => 'load_google_analytics',
'core.acp_board_config_edit_add' => 'add_googleanalytics_configs',
'core.page_header' => 'load_google_analytics',
'core.validate_config_variable' => 'validate_googleanalytics_id',
'core.validate_config_variable' => 'validate_googleanalytics_id',
'core.page_footer_after' => 'append_agreement',
];
}

Expand Down Expand Up @@ -171,4 +172,24 @@ public function validate_googleanalytics_id($event)
// Update error event data
$event['error'] = $error;
}

/**
* Append additional agreement details to the privacy agreement.
*
* @return void
*/
public function append_agreement()
{
if (!$this->config['googleanalytics_id']
|| (strpos($this->user->page['page_name'], 'ucp') !== 0)
|| !$this->template->retrieve_var('S_AGREEMENT')
|| ($this->template->retrieve_var('AGREEMENT_TITLE') !== $this->language->lang('PRIVACY')))
{
return;
}

$this->language->add_lang('googleanalytics_ucp', 'phpbb/googleanalytics');

$this->template->append_var('AGREEMENT_TEXT', $this->language->lang('PHPBB_ANALYTICS_PRIVACY_POLICY', $this->config['sitename']));
}
}
52 changes: 52 additions & 0 deletions language/ar/googleanalytics_ucp.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php
/**
*
* Google Analytics extension for the phpBB Forum Software package.
*
* @copyright (c) 2025 phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/

/**
* DO NOT CHANGE
*/
if (!defined('IN_PHPBB'))
{
exit;
}

if (empty($lang) || !is_array($lang))
{
$lang = [];
}

// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
//
// Some characters you may want to copy&paste:
// ’ » “ ” …
//

$lang = array_merge($lang, [
'PHPBB_ANALYTICS_PRIVACY_POLICY' => '
<br><br>
<h3>Analytics</h3>
“%1$s” may use Google Analytics, a web analytics service provided by Google LLC (“Google”), to help us understand how visitors use the site. Google Analytics uses cookies and similar technologies to collect information about your interactions with the site, including the pages you visit, the time spent on each page, and general usage patterns.
<br><br>
The information generated by these cookies about your use of “%1$s” (including your IP address) is transmitted to and stored by Google on servers in the United States or other locations. Google uses this information to evaluate your use of the site, compile reports on website activity for us, and provide other services relating to website activity and internet usage.
<br><br>
Google may also transfer this information to third parties where required to do so by law, or where such third parties process the information on Google’s behalf. To learn more about how Google collects and processes data, please see Google’s Privacy Policy at: <a href="https://policies.google.com/privacy" target="_blank">https://policies.google.com/privacy</a>.
<br><br>
You can opt out of Google Analytics by installing the Google Analytics opt-out browser add-on, available at: <a href="https://tools.google.com/dlpage/gaoptout" target="_blank">https://tools.google.com/dlpage/gaoptout</a>.
',
]);
52 changes: 52 additions & 0 deletions language/cs/googleanalytics_ucp.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php
/**
*
* Google Analytics extension for the phpBB Forum Software package.
*
* @copyright (c) 2025 phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/

/**
* DO NOT CHANGE
*/
if (!defined('IN_PHPBB'))
{
exit;
}

if (empty($lang) || !is_array($lang))
{
$lang = [];
}

// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
//
// Some characters you may want to copy&paste:
// ’ » “ ” …
//

$lang = array_merge($lang, [
'PHPBB_ANALYTICS_PRIVACY_POLICY' => '
<br><br>
<h3>Analytics</h3>
“%1$s” may use Google Analytics, a web analytics service provided by Google LLC (“Google”), to help us understand how visitors use the site. Google Analytics uses cookies and similar technologies to collect information about your interactions with the site, including the pages you visit, the time spent on each page, and general usage patterns.
<br><br>
The information generated by these cookies about your use of “%1$s” (including your IP address) is transmitted to and stored by Google on servers in the United States or other locations. Google uses this information to evaluate your use of the site, compile reports on website activity for us, and provide other services relating to website activity and internet usage.
<br><br>
Google may also transfer this information to third parties where required to do so by law, or where such third parties process the information on Google’s behalf. To learn more about how Google collects and processes data, please see Google’s Privacy Policy at: <a href="https://policies.google.com/privacy" target="_blank">https://policies.google.com/privacy</a>.
<br><br>
You can opt out of Google Analytics by installing the Google Analytics opt-out browser add-on, available at: <a href="https://tools.google.com/dlpage/gaoptout" target="_blank">https://tools.google.com/dlpage/gaoptout</a>.
',
]);
52 changes: 52 additions & 0 deletions language/da/googleanalytics_ucp.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php
/**
*
* Google Analytics extension for the phpBB Forum Software package.
*
* @copyright (c) 2025 phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/

/**
* DO NOT CHANGE
*/
if (!defined('IN_PHPBB'))
{
exit;
}

if (empty($lang) || !is_array($lang))
{
$lang = [];
}

// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
//
// Some characters you may want to copy&paste:
// ’ » “ ” …
//

$lang = array_merge($lang, [
'PHPBB_ANALYTICS_PRIVACY_POLICY' => '
<br><br>
<h3>Analytics</h3>
“%1$s” may use Google Analytics, a web analytics service provided by Google LLC (“Google”), to help us understand how visitors use the site. Google Analytics uses cookies and similar technologies to collect information about your interactions with the site, including the pages you visit, the time spent on each page, and general usage patterns.
<br><br>
The information generated by these cookies about your use of “%1$s” (including your IP address) is transmitted to and stored by Google on servers in the United States or other locations. Google uses this information to evaluate your use of the site, compile reports on website activity for us, and provide other services relating to website activity and internet usage.
<br><br>
Google may also transfer this information to third parties where required to do so by law, or where such third parties process the information on Google’s behalf. To learn more about how Google collects and processes data, please see Google’s Privacy Policy at: <a href="https://policies.google.com/privacy" target="_blank">https://policies.google.com/privacy</a>.
<br><br>
You can opt out of Google Analytics by installing the Google Analytics opt-out browser add-on, available at: <a href="https://tools.google.com/dlpage/gaoptout" target="_blank">https://tools.google.com/dlpage/gaoptout</a>.
',
]);
52 changes: 52 additions & 0 deletions language/de/googleanalytics_ucp.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php
/**
*
* Google Analytics extension for the phpBB Forum Software package.
*
* @copyright (c) 2025 phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/

/**
* DO NOT CHANGE
*/
if (!defined('IN_PHPBB'))
{
exit;
}

if (empty($lang) || !is_array($lang))
{
$lang = [];
}

// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
//
// Some characters you may want to copy&paste:
// ’ » “ ” …
//

$lang = array_merge($lang, [
'PHPBB_ANALYTICS_PRIVACY_POLICY' => '
<br><br>
<h3>Analytics</h3>
“%1$s” may use Google Analytics, a web analytics service provided by Google LLC (“Google”), to help us understand how visitors use the site. Google Analytics uses cookies and similar technologies to collect information about your interactions with the site, including the pages you visit, the time spent on each page, and general usage patterns.
<br><br>
The information generated by these cookies about your use of “%1$s” (including your IP address) is transmitted to and stored by Google on servers in the United States or other locations. Google uses this information to evaluate your use of the site, compile reports on website activity for us, and provide other services relating to website activity and internet usage.
<br><br>
Google may also transfer this information to third parties where required to do so by law, or where such third parties process the information on Google’s behalf. To learn more about how Google collects and processes data, please see Google’s Privacy Policy at: <a href="https://policies.google.com/privacy" target="_blank">https://policies.google.com/privacy</a>.
<br><br>
You can opt out of Google Analytics by installing the Google Analytics opt-out browser add-on, available at: <a href="https://tools.google.com/dlpage/gaoptout" target="_blank">https://tools.google.com/dlpage/gaoptout</a>.
',
]);
52 changes: 52 additions & 0 deletions language/de_x_sie/googleanalytics_ucp.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php
/**
*
* Google Analytics extension for the phpBB Forum Software package.
*
* @copyright (c) 2025 phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/

/**
* DO NOT CHANGE
*/
if (!defined('IN_PHPBB'))
{
exit;
}

if (empty($lang) || !is_array($lang))
{
$lang = [];
}

// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
//
// Some characters you may want to copy&paste:
// ’ » “ ” …
//

$lang = array_merge($lang, [
'PHPBB_ANALYTICS_PRIVACY_POLICY' => '
<br><br>
<h3>Analytics</h3>
“%1$s” may use Google Analytics, a web analytics service provided by Google LLC (“Google”), to help us understand how visitors use the site. Google Analytics uses cookies and similar technologies to collect information about your interactions with the site, including the pages you visit, the time spent on each page, and general usage patterns.
<br><br>
The information generated by these cookies about your use of “%1$s” (including your IP address) is transmitted to and stored by Google on servers in the United States or other locations. Google uses this information to evaluate your use of the site, compile reports on website activity for us, and provide other services relating to website activity and internet usage.
<br><br>
Google may also transfer this information to third parties where required to do so by law, or where such third parties process the information on Google’s behalf. To learn more about how Google collects and processes data, please see Google’s Privacy Policy at: <a href="https://policies.google.com/privacy" target="_blank">https://policies.google.com/privacy</a>.
<br><br>
You can opt out of Google Analytics by installing the Google Analytics opt-out browser add-on, available at: <a href="https://tools.google.com/dlpage/gaoptout" target="_blank">https://tools.google.com/dlpage/gaoptout</a>.
',
]);
52 changes: 52 additions & 0 deletions language/el/googleanalytics_ucp.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php
/**
*
* Google Analytics extension for the phpBB Forum Software package.
*
* @copyright (c) 2025 phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/

/**
* DO NOT CHANGE
*/
if (!defined('IN_PHPBB'))
{
exit;
}

if (empty($lang) || !is_array($lang))
{
$lang = [];
}

// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
//
// Some characters you may want to copy&paste:
// ’ » “ ” …
//

$lang = array_merge($lang, [
'PHPBB_ANALYTICS_PRIVACY_POLICY' => '
<br><br>
<h3>Analytics</h3>
“%1$s” may use Google Analytics, a web analytics service provided by Google LLC (“Google”), to help us understand how visitors use the site. Google Analytics uses cookies and similar technologies to collect information about your interactions with the site, including the pages you visit, the time spent on each page, and general usage patterns.
<br><br>
The information generated by these cookies about your use of “%1$s” (including your IP address) is transmitted to and stored by Google on servers in the United States or other locations. Google uses this information to evaluate your use of the site, compile reports on website activity for us, and provide other services relating to website activity and internet usage.
<br><br>
Google may also transfer this information to third parties where required to do so by law, or where such third parties process the information on Google’s behalf. To learn more about how Google collects and processes data, please see Google’s Privacy Policy at: <a href="https://policies.google.com/privacy" target="_blank">https://policies.google.com/privacy</a>.
<br><br>
You can opt out of Google Analytics by installing the Google Analytics opt-out browser add-on, available at: <a href="https://tools.google.com/dlpage/gaoptout" target="_blank">https://tools.google.com/dlpage/gaoptout</a>.
',
]);
Loading
Loading