diff options
author | Tom Knight <tomk@gentoo.org> | 2011-11-30 10:33:44 +0000 |
---|---|---|
committer | Tom Knight <tomk@gentoo.org> | 2011-11-30 10:33:44 +0000 |
commit | 525127042d0da8a22af3c5fed9f116b0bc4cd59a (patch) | |
tree | b8eccdeb205eaaa680591a898632bb7dc03b506b | |
parent | Added configurable piwik code (diff) | |
download | forums-525127042d0da8a22af3c5fed9f116b0bc4cd59a.tar.gz forums-525127042d0da8a22af3c5fed9f116b0bc4cd59a.tar.bz2 forums-525127042d0da8a22af3c5fed9f116b0bc4cd59a.zip |
Make piwik site id configurable
-rw-r--r-- | htdocs/admin/admin_board.php | 6 | ||||
-rw-r--r-- | htdocs/includes/functions.php | 8 | ||||
-rw-r--r-- | htdocs/language/lang_english/lang_admin_extra.php | 1 | ||||
-rwxr-xr-x | htdocs/templates/gentoo/admin/board_config_body.tpl | 4 | ||||
-rw-r--r-- | sql/release_2-0-23-gentoo-p6.sql | 2 |
5 files changed, 15 insertions, 6 deletions
diff --git a/htdocs/admin/admin_board.php b/htdocs/admin/admin_board.php index aa9755bd3..bededa904 100644 --- a/htdocs/admin/admin_board.php +++ b/htdocs/admin/admin_board.php @@ -6,7 +6,7 @@ * copyright : (C) 2001 The phpBB Group * email : support@phpbb.com * - * $Id: admin_board.php,v 1.16 2011/02/08 15:13:51 tomk Exp $ + * $Id: admin_board.php,v 1.17 2011/11/27 14:42:56 tomk Exp $ * * ***************************************************************************/ @@ -327,6 +327,7 @@ $template->assign_vars(array( "L_STOPFORUMSPAM_DAYS" => $lang['Stopforumspam_days_threshold'], "L_STOPFORUMSPAM_DAYS_EXPLAIN" => $lang['Stopforumspam_days_threshold_explain'], "L_ENABLE_PIWIK" => $lang['Enable_piwik'], + "L_PIWIK_SITE_ID" => $lang['Piwik_site_id'], "SERVER_NAME" => $new['server_name'], "SCRIPT_PATH" => $new['script_path'], @@ -439,7 +440,8 @@ $template->assign_vars(array( "STOPFORUMSPAM_FREQ" => $new['stopforumspam_frequency_threshold'], "STOPFORUMSPAM_DAYS" => $new['stopforumspam_days_threshold'], "PIWIK_YES" => $enable_piwik_yes, - "PIWIK_NO" => $enable_piwik_no) + "PIWIK_NO" => $enable_piwik_no, + "PIWIK_SITE_ID" => $new['piwik_site_id']) ); $template->pparse("body"); diff --git a/htdocs/includes/functions.php b/htdocs/includes/functions.php index d45361a19..1030b82fe 100644 --- a/htdocs/includes/functions.php +++ b/htdocs/includes/functions.php @@ -7,7 +7,7 @@ * copyright : (C) 2001 The phpBB Group * email : support@phpbb.com * - * $Id: functions.php,v 1.31 2010/10/05 14:30:36 tomk Exp $ + * $Id: functions.php,v 1.32 2011/11/27 14:42:56 tomk Exp $ * * ***************************************************************************/ @@ -1194,7 +1194,7 @@ function get_piwik_code() { $piwik_code = ""; - if (isset($board_config['enable_piwik']) && !empty($board_config['enable_piwik'] == '1')) { + if (isset($board_config['enable_piwik']) && $board_config['enable_piwik'] == '1' && intval($board_config['piwik_site_id']) > 0) { $piwik_code = <<<EOD <!-- Piwik --> <script type="text/javascript"> @@ -1202,11 +1202,11 @@ var pkBaseURL = (("https:" == document.location.protocol) ? "https://piwik.gento document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E")); </script><script type="text/javascript"> try { -var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 3); +var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", $board_config['piwik_site_id']); piwikTracker.trackPageView(); piwikTracker.enableLinkTracking(); } catch( err ) {} -</script><noscript><p><img src="http://piwik.gentoo.org/piwik.php?idsite=3" style="border:0" alt="" /></p></noscript> +</script><noscript><p><img src="http://piwik.gentoo.org/piwik.php?idsite=" . $board_config['piwik_site_id'] style="border:0" alt="" /></p></noscript> <!-- End Piwik Tracking Code --> EOD; } diff --git a/htdocs/language/lang_english/lang_admin_extra.php b/htdocs/language/lang_english/lang_admin_extra.php index ef1d93036..47584f2eb 100644 --- a/htdocs/language/lang_english/lang_admin_extra.php +++ b/htdocs/language/lang_english/lang_admin_extra.php @@ -139,5 +139,6 @@ $lang['Spammer_reason'] = 'Reason'; $lang['Is_spammer'] = 'Spammer?'; $lang['Is_spammer_explain'] = "Is this user a spammer and should their details be added to stopforumspam.com?"; $lang['Enable_piwik'] = 'Enable Piwik'; +$lang['Piwik_site_id'] = "Site ID for piwiki.gentoo.org"; ?> diff --git a/htdocs/templates/gentoo/admin/board_config_body.tpl b/htdocs/templates/gentoo/admin/board_config_body.tpl index c1e3f08c6..a702dbec1 100755 --- a/htdocs/templates/gentoo/admin/board_config_body.tpl +++ b/htdocs/templates/gentoo/admin/board_config_body.tpl @@ -196,6 +196,10 @@ <td class="row2"><input type="radio" name="enable_piwik" value="1" {PIWIK_YES} /> {L_YES} <input type="radio" name="enable_piwik" value="0" {PIWIK_NO} /> {L_NO}</td> </tr> <tr> + <td class="row1">{L_PIWIK_SITE_ID}</td> + <td class="row2"><input class="post" type="text" maxlength="3" size="4" name="piwik_site_id" value="{PIWIK_SITE_ID}" /></td> + </tr> + <tr> <td class="row1">{L_SPLIT_CHARACTER_LIMIT}<br /><span class="gensmall">{L_SPLIT_CHARACTER_LIMIT_EXPLAIN}</span></td> <td class="row2"><input class="post" type="text" size="10" maxlength="10" name="split_character_limit" value="{SPLIT_CHARACTER_LIMIT}" /></td> </tr> diff --git a/sql/release_2-0-23-gentoo-p6.sql b/sql/release_2-0-23-gentoo-p6.sql index 8a9546c71..6b8393649 100644 --- a/sql/release_2-0-23-gentoo-p6.sql +++ b/sql/release_2-0-23-gentoo-p6.sql @@ -2,3 +2,5 @@ UPDATE phpbb_config SET config_value = '.0.23-gentoo-p6' WHERE config_name = 've # new config for enabling piwik INSERT INTO phpbb_config SET config_name = 'enable_piwik', config_value = '0'; +# site id for piwiki.gentoo.org - 3 for forums.g.o and 4 for forumstest.g.o +INSERT INTO phpbb_config SET config_name = 'piwik_site_id', config_value = '3'; |