diff options
author | 2011-11-27 14:42:56 +0000 | |
---|---|---|
committer | 2011-11-27 14:42:56 +0000 | |
commit | 96849fd3d999be604ef6607aa384670e3ff92c1f (patch) | |
tree | a229ae49d7790c630a4e4486d2610a00c9c106e2 | |
parent | Added link to wiki.gentoo.org to overall footer (diff) | |
download | forums-96849fd3d999be604ef6607aa384670e3ff92c1f.tar.gz forums-96849fd3d999be604ef6607aa384670e3ff92c1f.tar.bz2 forums-96849fd3d999be604ef6607aa384670e3ff92c1f.zip |
Added configurable piwik code
-rw-r--r-- | docs/ChangeLog | 2 | ||||
-rw-r--r-- | htdocs/admin/admin_board.php | 9 | ||||
-rw-r--r-- | htdocs/admin/page_footer_admin.php | 5 | ||||
-rw-r--r-- | htdocs/includes/functions.php | 30 | ||||
-rw-r--r-- | htdocs/includes/page_tail.php | 5 | ||||
-rw-r--r-- | htdocs/language/lang_english/lang_admin_extra.php | 2 | ||||
-rwxr-xr-x | htdocs/templates/gentoo/admin/board_config_body.tpl | 4 | ||||
-rwxr-xr-x | htdocs/templates/gentoo/admin/page_footer.tpl | 1 | ||||
-rwxr-xr-x | htdocs/templates/gentoo/overall_footer.tpl | 1 | ||||
-rwxr-xr-x | htdocs/templates/gentoo/simple_footer.tpl | 1 |
10 files changed, 52 insertions, 8 deletions
diff --git a/docs/ChangeLog b/docs/ChangeLog index 8c03e70e4..1da05aa7a 100644 --- a/docs/ChangeLog +++ b/docs/ChangeLog @@ -1,3 +1,5 @@ +phpBB-2-0-23-gentoo-p5 (2011-11-27) +- Added configurable piwik code (tomk) - Added link to wiki.gentoo.org to overall footer (tomk) - Typo in italian mod language pack, fixes bug #383657 (tomk) - explicitly set default timezone, used for log message timestamps (desultory) diff --git a/htdocs/admin/admin_board.php b/htdocs/admin/admin_board.php index b6fa43486..aa9755bd3 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.15 2007/02/06 18:42:11 tomk Exp $ + * $Id: admin_board.php,v 1.16 2011/02/08 15:13:51 tomk Exp $ * * ***************************************************************************/ @@ -167,6 +167,9 @@ $enable_google_analytics_no = ( !$new['enable_google_analytics'] ) ? "checked=\" $stopforumspam_enable_yes = ( $new['stopforumspam_enable'] ) ? "checked=\"checked\"" : ""; $stopforumspam_enable_no = ( !$new['stopforumspam_enable'] ) ? "checked=\"checked\"" : ""; +$enable_piwik_yes = ( $new['enable_piwik'] ) ? "checked=\"checked\"" : ""; +$enable_piwik_no = ( !$new['enable_piwik'] ) ? "checked=\"checked\"" : ""; + $template->set_filenames(array( "body" => "admin/board_config_body.tpl") ); @@ -323,6 +326,7 @@ $template->assign_vars(array( "L_STOPFORUMSPAM_FREQ_EXPLAIN" => $lang['Stopforumspam_frequency_threshold_explain'], "L_STOPFORUMSPAM_DAYS" => $lang['Stopforumspam_days_threshold'], "L_STOPFORUMSPAM_DAYS_EXPLAIN" => $lang['Stopforumspam_days_threshold_explain'], + "L_ENABLE_PIWIK" => $lang['Enable_piwik'], "SERVER_NAME" => $new['server_name'], "SCRIPT_PATH" => $new['script_path'], @@ -434,7 +438,8 @@ $template->assign_vars(array( "STOPFORUMSPAM_API_KEY" => $new['stopforumspam_api_key'], "STOPFORUMSPAM_FREQ" => $new['stopforumspam_frequency_threshold'], "STOPFORUMSPAM_DAYS" => $new['stopforumspam_days_threshold'], - ) + "PIWIK_YES" => $enable_piwik_yes, + "PIWIK_NO" => $enable_piwik_no) ); $template->pparse("body"); diff --git a/htdocs/admin/page_footer_admin.php b/htdocs/admin/page_footer_admin.php index c25bb2aef..5a500927d 100644 --- a/htdocs/admin/page_footer_admin.php +++ b/htdocs/admin/page_footer_admin.php @@ -6,7 +6,7 @@ * copyright : (C) 2001 The phpBB Group * email : support@phpbb.com * - * $Id: page_footer_admin.php,v 1.5 2006/06/08 22:08:45 tomk Exp $ + * $Id: page_footer_admin.php,v 1.6 2010/11/20 23:01:17 desultory Exp $ * * ***************************************************************************/ @@ -36,7 +36,8 @@ $template->set_filenames(array( $template->assign_vars(array( 'PHPBB_VERSION' => '2' . $board_config['version'], - 'TRANSLATION_INFO' => (isset($lang['TRANSLATION_INFO'])) ? $lang['TRANSLATION_INFO'] : ((isset($lang['TRANSLATION'])) ? $lang['TRANSLATION'] : '')) + 'TRANSLATION_INFO' => (isset($lang['TRANSLATION_INFO'])) ? $lang['TRANSLATION_INFO'] : ((isset($lang['TRANSLATION'])) ? $lang['TRANSLATION'] : ''), + 'PIWIK_CODE' => get_piwik_code()) ); // 2010-11-19 desultory - We get it, we have the latest version. diff --git a/htdocs/includes/functions.php b/htdocs/includes/functions.php index 9fae8922d..d45361a19 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.30 2010/09/09 22:18:32 tomk Exp $ + * $Id: functions.php,v 1.31 2010/10/05 14:30:36 tomk Exp $ * * ***************************************************************************/ @@ -979,7 +979,7 @@ function message_die($msg_code, $msg_text = '', $msg_title = '', $err_line = '', } else { - echo "<html>\n<body>\n" . $msg_title . "\n<br /><br />\n" . $msg_text . "</body>\n</html>"; + echo "<html>\n<body>\n" . $msg_title . "\n<br /><br />\n" . $msg_text . "\n" . get_piwik_code() . "</body>\n</html>"; } exit; @@ -1188,6 +1188,32 @@ function phpbb_syslog_request($identifier, $mem_usage=false) { phpbb_syslog($message); } +// 2011-11-27 tomk - Added configurable piwik code +function get_piwik_code() { + global $board_config; + + $piwik_code = ""; + + if (isset($board_config['enable_piwik']) && !empty($board_config['enable_piwik'] == '1')) { + $piwik_code = <<<EOD +<!-- Piwik --> +<script type="text/javascript"> +var pkBaseURL = (("https:" == document.location.protocol) ? "https://piwik.gentoo.org/" : "http://piwik.gentoo.org/"); +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); +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> +<!-- End Piwik Tracking Code --> +EOD; + } + + return $piwik_code; +} + // 2005-04-18 tomk // Check users post distribution /* diff --git a/htdocs/includes/page_tail.php b/htdocs/includes/page_tail.php index 5b30505a5..91338df68 100644 --- a/htdocs/includes/page_tail.php +++ b/htdocs/includes/page_tail.php @@ -6,7 +6,7 @@ * copyright : (C) 2001 The phpBB Group * email : support@phpbb.com * - * $Id: page_tail.php,v 1.8 2010/09/08 10:42:03 tomk Exp $ + * $Id: page_tail.php,v 1.9 2010/09/09 20:14:10 tomk Exp $ * * ***************************************************************************/ @@ -43,7 +43,8 @@ $template->assign_vars(array( 'TRANSLATION_INFO' => (isset($lang['TRANSLATION_INFO'])) ? $lang['TRANSLATION_INFO'] : ((isset($lang['TRANSLATION'])) ? $lang['TRANSLATION'] : ''), 'ADMIN_LINK' => $admin_link, 'LINKS' => $lang['Links'], - 'YEAR' => date("Y")) + 'YEAR' => date("Y"), + 'PIWIK_CODE' => get_piwik_code()) ); $template->pparse('overall_footer'); diff --git a/htdocs/language/lang_english/lang_admin_extra.php b/htdocs/language/lang_english/lang_admin_extra.php index 50a3a92f2..ef1d93036 100644 --- a/htdocs/language/lang_english/lang_admin_extra.php +++ b/htdocs/language/lang_english/lang_admin_extra.php @@ -138,4 +138,6 @@ $lang['Stopforumspam_days_threshold_explain'] = "The number of days after which $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'; + ?> diff --git a/htdocs/templates/gentoo/admin/board_config_body.tpl b/htdocs/templates/gentoo/admin/board_config_body.tpl index 5ed85435c..c1e3f08c6 100755 --- a/htdocs/templates/gentoo/admin/board_config_body.tpl +++ b/htdocs/templates/gentoo/admin/board_config_body.tpl @@ -192,6 +192,10 @@ <td class="row2"><input type="radio" name="enable_google_analytics" value="1" {GOOGLE_ANALYTICS_YES} /> {L_YES} <input type="radio" name="enable_google_analytics" value="0" {GOOGLE_ANALYTICS_NO} /> {L_NO}</td> </tr> <tr> + <td class="row1">{L_ENABLE_PIWIK}</td> + <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_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/htdocs/templates/gentoo/admin/page_footer.tpl b/htdocs/templates/gentoo/admin/page_footer.tpl index 278b3607c..3a90310e6 100755 --- a/htdocs/templates/gentoo/admin/page_footer.tpl +++ b/htdocs/templates/gentoo/admin/page_footer.tpl @@ -18,5 +18,6 @@ <div align="center"><span class="copyright">Powered by phpBB {PHPBB_VERSION} © 2001 <a href="http://www.phpbb.com/" target="_phpbb" class="copyright">phpBB Group</a><br />{TRANSLATION_INFO}</span></div> +{PIWIK_CODE} </body> </html>
\ No newline at end of file diff --git a/htdocs/templates/gentoo/overall_footer.tpl b/htdocs/templates/gentoo/overall_footer.tpl index 6fde5ae2c..6940254ad 100755 --- a/htdocs/templates/gentoo/overall_footer.tpl +++ b/htdocs/templates/gentoo/overall_footer.tpl @@ -19,5 +19,6 @@ </p> </td></tr> </table> +{PIWIK_CODE} </body> </html> diff --git a/htdocs/templates/gentoo/simple_footer.tpl b/htdocs/templates/gentoo/simple_footer.tpl index 68c2b0041..d4b2c1c49 100755 --- a/htdocs/templates/gentoo/simple_footer.tpl +++ b/htdocs/templates/gentoo/simple_footer.tpl @@ -15,5 +15,6 @@ Powered by <a href="http://www.phpbb.com/" target="_phpbb" class="copyright">php </tr> </table> +{PIWIK_CODE} </body> </html> |