From: Steve Sutton Date: Wed, 18 Jan 2017 17:58:57 +0000 (-0500) Subject: Update code to get rid of php errors X-Git-Tag: v1.0.2^2~1 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=cb6a104dc42d9e400ba560f7d1765ff83cf92378;p=WP-Plugins%2Fglm-gravityform-streamsend.git Update code to get rid of php errors Code updates. --- diff --git a/class-streamsendfeedaddon.php b/class-streamsendfeedaddon.php index 4ab726b..be91484 100644 --- a/class-streamsendfeedaddon.php +++ b/class-streamsendfeedaddon.php @@ -237,6 +237,10 @@ class GFStreamSendAddOn extends GFFeedAddOn $settings = $this->get_plugin_settings(); $apiLogin = rgar($settings, 'glm_streamsend_login'); $apiKey = rgar($settings, 'glm_streamsend_key'); + $audience = rgar( $settings, 'glm_streamsend_audience' ); + if ( $audience && !defined( 'STREAMSEND_AUDIENCE' ) ) { + define( 'STREAMSEND_AUDIENCE', $audience ); + } $ss = new StreamSend(STREAMSEND_BASE_URL, $apiLogin, $apiKey); $getList = $ss->listList(); $listData = $getList->responseData; @@ -498,8 +502,9 @@ class GFStreamSendAddOn extends GFFeedAddOn $apiLogin = rgar( $settings, 'glm_streamsend_login' ); $apiKey = rgar( $settings, 'glm_streamsend_key' ); $audience = rgar( $settings, 'glm_streamsend_audience' ); - - + if ( $audience && !defined( 'STREAMSEND_AUDIENCE' ) ) { + define( 'STREAMSEND_AUDIENCE', $audience ); + } // check the array $values to make sure it is correct if (is_array($values) && !empty($values)) { @@ -509,7 +514,7 @@ class GFStreamSendAddOn extends GFFeedAddOn $ret = $ss->contactSearch($values['email']); $contactData = array(); - $values[$type] = 1; + $values['type'] = 1; foreach ($this->streamSendFields as $glmName => $ssName) { $contactData[$ssName] = $values[$glmName]; } diff --git a/index.php b/index.php index 1ab2d66..356a2a4 100644 --- a/index.php +++ b/index.php @@ -1,8 +1,8 @@