summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'htdocs/includes/functions.php')
-rw-r--r--htdocs/includes/functions.php30
1 files changed, 28 insertions, 2 deletions
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
/*