From: Evan Prodromou Date: Mon, 20 Jun 2011 21:06:17 +0000 (-0400) Subject: use old-style plugin initializers as fallback for GoogleAnalytics X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=aab265709abf6b8fc058306fee1e6b5c426c3c87;p=quix0rs-gnu-social.git use old-style plugin initializers as fallback for GoogleAnalytics --- diff --git a/plugins/GoogleAnalytics/GoogleAnalyticsPlugin.php b/plugins/GoogleAnalytics/GoogleAnalyticsPlugin.php index dff43eff95..9912b71543 100644 --- a/plugins/GoogleAnalytics/GoogleAnalyticsPlugin.php +++ b/plugins/GoogleAnalytics/GoogleAnalyticsPlugin.php @@ -49,6 +49,9 @@ if (!defined('STATUSNET')) { */ class GoogleAnalyticsPlugin extends Plugin { + var $code; + var $domain; + const VERSION = '0.2'; function __construct($code=null) @@ -64,7 +67,13 @@ class GoogleAnalyticsPlugin extends Plugin function onEndShowScripts($action) { $code = common_config('googleanalytics', 'code'); + if (empty($code)) { + $code = $this->code; + } $domain = common_config('googleanalytics', 'domain'); + if (empty($domain)) { + $domain = $this->domain; + } $js = <<