Easy Forms for MailChimp - Version 3.0.0

Version Description

Download this release

Release Info

Developer hiwhatsup
Plugin Icon 128x128 Easy Forms for MailChimp
Version 3.0.0
Comparing to
See all releases

Code changes from version 2.2.1 to 3.0.0

Mailchimp/Campaigns.php ADDED
@@ -0,0 +1,377 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mailchimp_Campaigns {
4
+ public function __construct(wpyksMCAPI $master) {
5
+ $this->master = $master;
6
+ }
7
+
8
+ /**
9
+ * Get the content (both html and text) for a campaign either as it would appear in the campaign archive or as the raw, original content
10
+ * @param string $cid
11
+ * @param associative_array $options
12
+ * - view string optional one of "archive" (default), "preview" (like our popup-preview) or "raw"
13
+ * - email associative_array optional if provided, view is "archive" or "preview", the campaign's list still exists, and the requested record is subscribed to the list. the returned content will be populated with member data populated. a struct with one of the following keys - failing to provide anything will produce an error relating to the email address. Providing multiples and will use the first we see in this same order.
14
+ * - email string an email address
15
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
16
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
17
+ * @return associative_array containing all content for the campaign
18
+ * - html string The HTML content used for the campaign with merge tags intact
19
+ * - text string The Text content used for the campaign with merge tags intact
20
+ */
21
+ public function content($cid, $options=array()) {
22
+ $_params = array("cid" => $cid, "options" => $options);
23
+ return $this->master->call('campaigns/content', $_params);
24
+ }
25
+
26
+ /**
27
+ * Create a new draft campaign to send. You <strong>can not</strong> have more than 32,000 campaigns in your account.
28
+ * @param string $type
29
+ * @param associative_array $options
30
+ * - list_id string the list to send this campaign to- get lists using lists/list()
31
+ * - subject string the subject line for your campaign message
32
+ * - from_email string the From: email address for your campaign message
33
+ * - from_name string the From: name for your campaign message (not an email address)
34
+ * - to_name string the To: name recipients will see (not email address)
35
+ * - template_id int optional - use this user-created template to generate the HTML content of the campaign (takes precendence over other template options)
36
+ * - gallery_template_id int optional - use a template from the public gallery to generate the HTML content of the campaign (takes precendence over base template options)
37
+ * - base_template_id int optional - use this a base/start-from-scratch template to generate the HTML content of the campaign
38
+ * - folder_id int optional - automatically file the new campaign in the folder_id passed. Get using folders/list() - note that Campaigns and Autoresponders have separate folder setups
39
+ * - tracking associative_array optional - set which recipient actions will be tracked. Click tracking can not be disabled for Free accounts.
40
+ * - opens bool whether to track opens, defaults to true
41
+ * - html_clicks bool whether to track clicks in HTML content, defaults to true
42
+ * - text_clicks bool whether to track clicks in Text content, defaults to false
43
+ * - title string optional - an internal name to use for this campaign. By default, the campaign subject will be used.
44
+ * - authenticate boolean optional - set to true to enable SenderID, DomainKeys, and DKIM authentication, defaults to false.
45
+ * - analytics associative_array optional - one or more of these keys set to the tag to use - that can be any custom text (up to 50 bytes)
46
+ * - google string for Google Analytics tracking
47
+ * - clicktale string for ClickTale tracking
48
+ * - gooal string for Goo.al tracking
49
+ * - auto_footer boolean optional Whether or not we should auto-generate the footer for your content. Mostly useful for content from URLs or Imports
50
+ * - inline_css boolean optional Whether or not css should be automatically inlined when this campaign is sent, defaults to false.
51
+ * - generate_text boolean optional Whether of not to auto-generate your Text content from the HTML content. Note that this will be ignored if the Text part of the content passed is not empty, defaults to false.
52
+ * - auto_tweet boolean optional If set, this campaign will be auto-tweeted when it is sent - defaults to false. Note that if a Twitter account isn't linked, this will be silently ignored.
53
+ * - auto_fb_post array optional If set, this campaign will be auto-posted to the page_ids contained in the array. If a Facebook account isn't linked or the account does not have permission to post to the page_ids requested, those failures will be silently ignored.
54
+ * - fb_comments boolean optional If true, the Facebook comments (and thus the <a href="http://kb.mailchimp.com/article/i-dont-want-an-archiave-of-my-campaign-can-i-turn-it-off/" target="_blank">archive bar</a> will be displayed. If false, Facebook comments will not be enabled (does not imply no archive bar, see previous link). Defaults to "true".
55
+ * - timewarp boolean optional If set, this campaign must be scheduled 24 hours in advance of sending - default to false. Only valid for "regular" campaigns and "absplit" campaigns that split on schedule_time.
56
+ * - ecomm360 boolean optional If set, our <a href="http://www.mailchimp.com/blog/ecommerce-tracking-plugin/" target="_blank">Ecommerce360 tracking</a> will be enabled for links in the campaign
57
+ * - crm_tracking array optional If set, an array of structs to enable CRM tracking for:
58
+ * - salesforce associative_array optional Enable SalesForce push back
59
+ * - campaign bool optional - if true, create a Campaign object and update it with aggregate stats
60
+ * - notes bool optional - if true, attempt to update Contact notes based on email address
61
+ * - highrise associative_array optional Enable Highrise push back
62
+ * - campaign bool optional - if true, create a Kase object and update it with aggregate stats
63
+ * - notes bool optional - if true, attempt to update Contact notes based on email address
64
+ * - capsule associative_array optional Enable Capsule push back (only notes are supported)
65
+ * - notes bool optional - if true, attempt to update Contact notes based on email address
66
+ * @param associative_array $content
67
+ * - html string for raw/pasted HTML content
68
+ * - sections associative_array when using a template instead of raw HTML, each key should be the unique mc:edit area name from the template.
69
+ * - text string for the plain-text version
70
+ * - url string to have us pull in content from a URL. Note, this will override any other content options - for lists with Email Format options, you'll need to turn on generate_text as well
71
+ * - archive string to send a Base64 encoded archive file for us to import all media from. Note, this will override any other content options - for lists with Email Format options, you'll need to turn on generate_text as well
72
+ * - archive_type string optional - only necessary for the "archive" option. Supported formats are: zip, tar.gz, tar.bz2, tar, tgz, tbz . If not included, we will default to zip
73
+ * @param associative_array $segment_opts
74
+ * @param associative_array $type_opts
75
+ * - rss associative_array For RSS Campaigns this, struct should contain:
76
+ * - url string the URL to pull RSS content from - it will be verified and must exist
77
+ * - schedule string optional one of "daily", "weekly", "monthly" - defaults to "daily"
78
+ * - schedule_hour string optional an hour between 0 and 24 - default to 4 (4am <em>local time</em>) - applies to all schedule types
79
+ * - schedule_weekday string optional for "weekly" only, a number specifying the day of the week to send: 0 (Sunday) - 6 (Saturday) - defaults to 1 (Monday)
80
+ * - schedule_monthday string optional for "monthly" only, a number specifying the day of the month to send (1 - 28) or "last" for the last day of a given month. Defaults to the 1st day of the month
81
+ * - days associative_array optional used for "daily" schedules only, an array of the <a href="http://en.wikipedia.org/wiki/ISO-8601#Week_dates" target="_blank">ISO-8601 weekday numbers</a> to send on
82
+ * - 1 bool optional Monday, defaults to true
83
+ * - 2 bool optional Tuesday, defaults to true
84
+ * - 3 bool optional Wednesday, defaults to true
85
+ * - 4 bool optional Thursday, defaults to true
86
+ * - 5 bool optional Friday, defaults to true
87
+ * - 6 bool optional Saturday, defaults to true
88
+ * - 7 bool optional Sunday, defaults to true
89
+ * - absplit associative_array For A/B Split campaigns, this struct should contain:
90
+ * - split_test string The values to segment based on. Currently, one of: "subject", "from_name", "schedule". NOTE, for "schedule", you will need to call campaigns/schedule() separately!
91
+ * - pick_winner string How the winner will be picked, one of: "opens" (by the open_rate), "clicks" (by the click rate), "manual" (you pick manually)
92
+ * - wait_units int optional the default time unit to wait before auto-selecting a winner - use "3600" for hours, "86400" for days. Defaults to 86400.
93
+ * - wait_time int optional the number of units to wait before auto-selecting a winner - defaults to 1, so if not set, a winner will be selected after 1 Day.
94
+ * - split_size int optional this is a percentage of what size the Campaign's List plus any segmentation options results in. "schedule" type forces 50%, all others default to 10%
95
+ * - from_name_a string optional sort of, required when split_test is "from_name"
96
+ * - from_name_b string optional sort of, required when split_test is "from_name"
97
+ * - from_email_a string optional sort of, required when split_test is "from_name"
98
+ * - from_email_b string optional sort of, required when split_test is "from_name"
99
+ * - subject_a string optional sort of, required when split_test is "subject"
100
+ * - subject_b string optional sort of, required when split_test is "subject"
101
+ * - auto associative_array For AutoResponder campaigns, this struct should contain:
102
+ * - offset-units string one of "hourly", "day", "week", "month", "year" - required
103
+ * - offset-time string optional, sort of - the number of units must be a number greater than 0 for signup based autoresponders, ignored for "hourly"
104
+ * - offset-dir string either "before" or "after", ignored for "hourly"
105
+ * - event string optional "signup" (default) to base this members added to a list, "date", "annual", or "birthday" to base this on merge field in the list, "campaignOpen" or "campaignClicka" to base this on any activity for a campaign, "campaignClicko" to base this on clicks on a specific URL in a campaign, "mergeChanged" to base this on a specific merge field being changed to a specific value
106
+ * - event-datemerge string optional sort of, this is required if the event is "date", "annual", "birthday", or "mergeChanged"
107
+ * - campaign_id string optional sort of, required for "campaignOpen", "campaignClicka", or "campaignClicko"
108
+ * - campaign_url string optional sort of, required for "campaignClicko"
109
+ * - schedule_hour int The hour of the day - 24 hour format in GMT - the autoresponder should be triggered, ignored for "hourly"
110
+ * - use_import_time boolean whether or not imported subscribers (ie, <em>any</em> non-double optin subscribers) will receive
111
+ * - days associative_array optional used for "daily" schedules only, an array of the <a href="http://en.wikipedia.org/wiki/ISO-8601#Week_dates" target="_blank">ISO-8601 weekday numbers</a> to send on<
112
+ * - 1 bool optional Monday, defaults to true
113
+ * - 2 bool optional Tuesday, defaults to true
114
+ * - 3 bool optional Wednesday, defaults to true
115
+ * - 4 bool optional Thursday, defaults to true
116
+ * - 5 bool optional Friday, defaults to true
117
+ * - 6 bool optional Saturday, defaults to true
118
+ * - 7 bool optional Sunday, defaults to true
119
+ * @return associative_array the new campaign's details - will return same data as single campaign from campaigns/list()
120
+ */
121
+ public function create($type, $options, $content, $segment_opts=null, $type_opts=null) {
122
+ $_params = array("type" => $type, "options" => $options, "content" => $content, "segment_opts" => $segment_opts, "type_opts" => $type_opts);
123
+ return $this->master->call('campaigns/create', $_params);
124
+ }
125
+
126
+ /**
127
+ * Delete a campaign. Seriously, "poof, gone!" - be careful! Seriously, no one can undelete these.
128
+ * @param string $cid
129
+ * @return associative_array with a single entry:
130
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
131
+ */
132
+ public function delete($cid) {
133
+ $_params = array("cid" => $cid);
134
+ return $this->master->call('campaigns/delete', $_params);
135
+ }
136
+
137
+ /**
138
+ * Get the list of campaigns and their details matching the specified filters
139
+ * @param associative_array $filters
140
+ * - campaign_id string optional - return the campaign using a know campaign_id. Accepts multiples separated by commas when not using exact matching.
141
+ * - parent_id string optional - return the child campaigns using a known parent campaign_id. Accepts multiples separated by commas when not using exact matching.
142
+ * - list_id string optional - the list to send this campaign to - get lists using lists/list(). Accepts multiples separated by commas when not using exact matching.
143
+ * - folder_id int optional - only show campaigns from this folder id - get folders using folders/list(). Accepts multiples separated by commas when not using exact matching.
144
+ * - template_id int optional - only show campaigns using this template id - get templates using templates/list(). Accepts multiples separated by commas when not using exact matching.
145
+ * - status string optional - return campaigns of a specific status - one of "sent", "save", "paused", "schedule", "sending". Accepts multiples separated by commas when not using exact matching.
146
+ * - type string optional - return campaigns of a specific type - one of "regular", "plaintext", "absplit", "rss", "auto". Accepts multiples separated by commas when not using exact matching.
147
+ * - from_name string optional - only show campaigns that have this "From Name"
148
+ * - from_email string optional - only show campaigns that have this "Reply-to Email"
149
+ * - title string optional - only show campaigns that have this title
150
+ * - subject string optional - only show campaigns that have this subject
151
+ * - sendtime_start string optional - only show campaigns that have been sent since this date/time (in GMT) - - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00" - if this is invalid the whole call fails
152
+ * - sendtime_end string optional - only show campaigns that have been sent before this date/time (in GMT) - - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00" - if this is invalid the whole call fails
153
+ * - uses_segment boolean - whether to return just campaigns with or without segments
154
+ * - exact boolean optional - flag for whether to filter on exact values when filtering, or search within content for filter values - defaults to true. Using this disables the use of any filters that accept multiples.
155
+ * @param int $start
156
+ * @param int $limit
157
+ * @param string $sort_field
158
+ * @param string $sort_dir
159
+ * @return associative_array containing a count of all matching campaigns, the specific ones for the current page, and any errors from the filters provided
160
+ * - total int the total number of campaigns matching the filters passed in
161
+ * - data array structs for each campaign being returned
162
+ * - id string Campaign Id (used for all other campaign functions)
163
+ * - web_id int The Campaign id used in our web app, allows you to create a link directly to it
164
+ * - list_id string The List used for this campaign
165
+ * - folder_id int The Folder this campaign is in
166
+ * - template_id int The Template this campaign uses
167
+ * - content_type string How the campaign's content is put together - one of 'template', 'html', 'url'
168
+ * - title string Title of the campaign
169
+ * - type string The type of campaign this is (regular,plaintext,absplit,rss,inspection,auto)
170
+ * - create_time string Creation time for the campaign
171
+ * - send_time string Send time for the campaign - also the scheduled time for scheduled campaigns.
172
+ * - emails_sent int Number of emails email was sent to
173
+ * - status string Status of the given campaign (save,paused,schedule,sending,sent)
174
+ * - from_name string From name of the given campaign
175
+ * - from_email string Reply-to email of the given campaign
176
+ * - subject string Subject of the given campaign
177
+ * - to_name string Custom "To:" email string using merge variables
178
+ * - archive_url string Archive link for the given campaign
179
+ * - inline_css boolean Whether or not the campaign content's css was auto-inlined
180
+ * - analytics string Either "google" if enabled or "N" if disabled
181
+ * - analytics_tag string The name/tag the campaign's links were tagged with if analytics were enabled.
182
+ * - authenticate boolean Whether or not the campaign was authenticated
183
+ * - ecomm360 boolean Whether or not ecomm360 tracking was appended to links
184
+ * - auto_tweet boolean Whether or not the campaign was auto tweeted after sending
185
+ * - auto_fb_post string A comma delimited list of Facebook Profile/Page Ids the campaign was posted to after sending. If not used, blank.
186
+ * - auto_footer boolean Whether or not the auto_footer was manually turned on
187
+ * - timewarp boolean Whether or not the campaign used Timewarp
188
+ * - timewarp_schedule string The time, in GMT, that the Timewarp campaign is being sent. For A/B Split campaigns, this is blank and is instead in their schedule_a and schedule_b in the type_opts array
189
+ * - parent_id string the unique id of the parent campaign (currently only valid for rss children)
190
+ * - tests_sent string tests sent
191
+ * - tests_remain string test sends remaining
192
+ * - tracking associative_array the various tracking options used
193
+ * - html_clicks boolean whether or not tracking for html clicks was enabled.
194
+ * - text_clicks boolean whether or not tracking for text clicks was enabled.
195
+ * - opens boolean whether or not opens tracking was enabled.
196
+ * - segment_text string a string marked-up with HTML explaining the segment used for the campaign in plain English
197
+ * - segment_opts array the segment used for the campaign - can be passed to campaigns/segment-test or campaigns/create()
198
+ * - saved_segment associative_array if a saved segment was used (match+conditions returned above):
199
+ * - id associative_array the saved segment id
200
+ * - type associative_array the saved segment type
201
+ * - name associative_array the saved segment name
202
+ * - type_opts associative_array the type-specific options for the campaign - can be passed to campaigns/create()
203
+ * - comments_total int total number of comments left on this campaign
204
+ * - comments_unread int total number of unread comments for this campaign based on the login the apikey belongs to
205
+ * - summary associative_array if available, the basic aggregate stats returned by reports/summary
206
+ * - errors array structs of any errors found while loading lists - usually just from providing invalid list ids
207
+ * - filter string the filter that caused the failure
208
+ * - value string the filter value that caused the failure
209
+ * - code int the error code
210
+ * - error int the error message
211
+ */
212
+ public function getList($filters=array(), $start=0, $limit=25, $sort_field='create_time', $sort_dir='DESC') {
213
+ $_params = array("filters" => $filters, "start" => $start, "limit" => $limit, "sort_field" => $sort_field, "sort_dir" => $sort_dir);
214
+ return $this->master->call('campaigns/list', $_params);
215
+ }
216
+
217
+ /**
218
+ * Pause an AutoResponder or RSS campaign from sending
219
+ * @param string $cid
220
+ * @return associative_array with a single entry:
221
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
222
+ */
223
+ public function pause($cid) {
224
+ $_params = array("cid" => $cid);
225
+ return $this->master->call('campaigns/pause', $_params);
226
+ }
227
+
228
+ /**
229
+ * Returns information on whether a campaign is ready to send and possible issues we may have detected with it - very similar to the confirmation step in the app.
230
+ * @param string $cid
231
+ * @return associative_array containing:
232
+ * - is_ready bool whether or not you're going to be able to send this campaign
233
+ * - items array an array of structs explaining basically what the app's confirmation step would
234
+ * - type string the item type - generally success, warning, or error
235
+ * - heading string the item's heading in the app
236
+ * - details string the item's details from the app, sans any html tags/links
237
+ */
238
+ public function ready($cid) {
239
+ $_params = array("cid" => $cid);
240
+ return $this->master->call('campaigns/ready', $_params);
241
+ }
242
+
243
+ /**
244
+ * Replicate a campaign.
245
+ * @param string $cid
246
+ * @return associative_array the matching campaign's details - will return same data as single campaign from campaigns/list()
247
+ */
248
+ public function replicate($cid) {
249
+ $_params = array("cid" => $cid);
250
+ return $this->master->call('campaigns/replicate', $_params);
251
+ }
252
+
253
+ /**
254
+ * Resume sending an AutoResponder or RSS campaign
255
+ * @param string $cid
256
+ * @return associative_array with a single entry:
257
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
258
+ */
259
+ public function resume($cid) {
260
+ $_params = array("cid" => $cid);
261
+ return $this->master->call('campaigns/resume', $_params);
262
+ }
263
+
264
+ /**
265
+ * Schedule a campaign to be sent in the future
266
+ * @param string $cid
267
+ * @param string $schedule_time
268
+ * @param string $schedule_time_b
269
+ * @return associative_array with a single entry:
270
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
271
+ */
272
+ public function schedule($cid, $schedule_time, $schedule_time_b=null) {
273
+ $_params = array("cid" => $cid, "schedule_time" => $schedule_time, "schedule_time_b" => $schedule_time_b);
274
+ return $this->master->call('campaigns/schedule', $_params);
275
+ }
276
+
277
+ /**
278
+ * Schedule a campaign to be sent in batches sometime in the future. Only valid for "regular" campaigns
279
+ * @param string $cid
280
+ * @param string $schedule_time
281
+ * @param int $num_batches
282
+ * @param int $stagger_mins
283
+ * @return associative_array with a single entry:
284
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
285
+ */
286
+ public function scheduleBatch($cid, $schedule_time, $num_batches=2, $stagger_mins=5) {
287
+ $_params = array("cid" => $cid, "schedule_time" => $schedule_time, "num_batches" => $num_batches, "stagger_mins" => $stagger_mins);
288
+ return $this->master->call('campaigns/schedule-batch', $_params);
289
+ }
290
+
291
+ /**
292
+ * Allows one to test their segmentation rules before creating a campaign using them
293
+ * @param string $list_id
294
+ * @param associative_array $options
295
+ * - saved_segment_id string a saved segment id from lists/segments() - this will take precendence, otherwise the match+conditions are required.
296
+ * - match string controls whether to use AND or OR when applying your options - expects "<strong>any</strong>" (for OR) or "<strong>all</strong>" (for AND)
297
+ * - conditions array of up to 5 structs for different criteria to apply while segmenting. Each criteria row must contain 3 keys - "<strong>field</strong>", "<strong>op</strong>", and "<strong>value</strong>" - and possibly a fourth, "<strong>extra</strong>", based on these definitions:
298
+ * @return associative_array with a single entry:
299
+ * - total int The total number of subscribers matching your segmentation options
300
+ */
301
+ public function segmentTest($list_id, $options) {
302
+ $_params = array("list_id" => $list_id, "options" => $options);
303
+ return $this->master->call('campaigns/segment-test', $_params);
304
+ }
305
+
306
+ /**
307
+ * Send a given campaign immediately. For RSS campaigns, this will "start" them.
308
+ * @param string $cid
309
+ * @return associative_array with a single entry:
310
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
311
+ */
312
+ public function send($cid) {
313
+ $_params = array("cid" => $cid);
314
+ return $this->master->call('campaigns/send', $_params);
315
+ }
316
+
317
+ /**
318
+ * Send a test of this campaign to the provided email addresses
319
+ * @param string $cid
320
+ * @param array $test_emails
321
+ * @param string $send_type
322
+ * @return associative_array with a single entry:
323
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
324
+ */
325
+ public function sendTest($cid, $test_emails=array(), $send_type='html') {
326
+ $_params = array("cid" => $cid, "test_emails" => $test_emails, "send_type" => $send_type);
327
+ return $this->master->call('campaigns/send-test', $_params);
328
+ }
329
+
330
+ /**
331
+ * Get the HTML template content sections for a campaign. Note that this <strong>will</strong> return very jagged, non-standard results based on the template
332
+ a campaign is using. You only want to use this if you want to allow editing template sections in your application.
333
+ * @param string $cid
334
+ * @return associative_array content containing all content section for the campaign - section name are dependent upon the template used and thus can't be documented
335
+ */
336
+ public function templateContent($cid) {
337
+ $_params = array("cid" => $cid);
338
+ return $this->master->call('campaigns/template-content', $_params);
339
+ }
340
+
341
+ /**
342
+ * Unschedule a campaign that is scheduled to be sent in the future
343
+ * @param string $cid
344
+ * @return associative_array with a single entry:
345
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
346
+ */
347
+ public function unschedule($cid) {
348
+ $_params = array("cid" => $cid);
349
+ return $this->master->call('campaigns/unschedule', $_params);
350
+ }
351
+
352
+ /**
353
+ * Update just about any setting besides type for a campaign that has <em>not</em> been sent. See campaigns/create() for details.
354
+ Caveats:<br/><ul class='bullets'>
355
+ <li>If you set a new list_id, all segmentation options will be deleted and must be re-added.</li>
356
+ <li>If you set template_id, you need to follow that up by setting it's 'content'</li>
357
+ <li>If you set segment_opts, you should have tested your options against campaigns/segment-test().</li>
358
+ <li>To clear/unset segment_opts, pass an empty string or array as the value. Various wrappers may require one or the other.</li>
359
+ </ul>
360
+ * @param string $cid
361
+ * @param string $name
362
+ * @param array $value
363
+ * @return associative_array updated campaign details and any errors
364
+ * - data associative_array the update campaign details - will return same data as single campaign from campaigns/list()
365
+ * - errors array for "options" only - structs containing:
366
+ * - code int the error code
367
+ * - message string the full error message
368
+ * - name string the parameter name that failed
369
+ */
370
+ public function update($cid, $name, $value) {
371
+ $_params = array("cid" => $cid, "name" => $name, "value" => $value);
372
+ return $this->master->call('campaigns/update', $_params);
373
+ }
374
+
375
+ }
376
+
377
+
Mailchimp/Ecomm.php ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mailchimp_Ecomm {
4
+ public function __construct(wpyksMCAPI $master) {
5
+ $this->master = $master;
6
+ }
7
+
8
+ /**
9
+ * Import Ecommerce Order Information to be used for Segmentation. This will generally be used by ecommerce package plugins
10
+ <a href="http://connect.mailchimp.com/category/ecommerce" target="_blank">provided by us or by 3rd part system developers</a>.
11
+ * @param associative_array $order
12
+ * - id string the Order Id
13
+ * - campaign_id string optional the Campaign Id to track this order against (see the "mc_cid" query string variable a campaign passes)
14
+ * - email_id string optional (kind of) the Email Id of the subscriber we should attach this order to (see the "mc_eid" query string variable a campaign passes) - required if campaign_id is passed, otherwise either this or <strong>email</strong> is required. If both are provided, email_id takes precedence
15
+ * - email string optional (kind of) the Email Address we should attach this order to - either this or <strong>email_id</strong> is required. If both are provided, email_id takes precedence
16
+ * - total double The Order Total (ie, the full amount the customer ends up paying)
17
+ * - order_date string optional the date of the order - if this is not provided, we will default the date to now. Should be in the format of 2012-12-30
18
+ * - shipping double optional the total paid for Shipping Fees
19
+ * - tax double optional the total tax paid
20
+ * - store_id string a unique id for the store sending the order in (32 bytes max)
21
+ * - store_name string optional a "nice" name for the store - typically the base web address (ie, "store.mailchimp.com"). We will automatically update this if it changes (based on store_id)
22
+ * - items array structs for each individual line item including:
23
+ * - line_num int optional the line number of the item on the order. We will generate these if they are not passed
24
+ * - product_id int the store's internal Id for the product. Lines that do no contain this will be skipped
25
+ * - sku string optional the store's internal SKU for the product. (max 30 bytes)
26
+ * - product_name string the product name for the product_id associated with this item. We will auto update these as they change (based on product_id)
27
+ * - category_id int the store's internal Id for the (main) category associated with this product. Our testing has found this to be a "best guess" scenario
28
+ * - category_name string the category name for the category_id this product is in. Our testing has found this to be a "best guess" scenario. Our plugins walk the category heirarchy up and send "Root - SubCat1 - SubCat4", etc.
29
+ * - qty double optional the quantity of the item ordered - defaults to 1
30
+ * - cost double optional the cost of a single item (ie, not the extended cost of the line) - defaults to 0
31
+ * @return associative_array with a single entry:
32
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
33
+ */
34
+ public function orderAdd($order) {
35
+ $_params = array("order" => $order);
36
+ return $this->master->call('ecomm/order-add', $_params);
37
+ }
38
+
39
+ /**
40
+ * Delete Ecommerce Order Information used for segmentation. This will generally be used by ecommerce package plugins
41
+ <a href="/plugins/ecomm360.phtml">that we provide</a> or by 3rd part system developers.
42
+ * @param string $store_id
43
+ * @param string $order_id
44
+ * @return associative_array with a single entry:
45
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
46
+ */
47
+ public function orderDel($store_id, $order_id) {
48
+ $_params = array("store_id" => $store_id, "order_id" => $order_id);
49
+ return $this->master->call('ecomm/order-del', $_params);
50
+ }
51
+
52
+ /**
53
+ * Retrieve the Ecommerce Orders for an account
54
+ * @param string $cid
55
+ * @param int $start
56
+ * @param int $limit
57
+ * @param string $since
58
+ * @return associative_array the total matching orders and the specific orders for the requested page
59
+ * - total int the total matching orders
60
+ * - data array structs for each order being returned
61
+ * - store_id string the store id generated by the plugin used to uniquely identify a store
62
+ * - store_name string the store name collected by the plugin - often the domain name
63
+ * - order_id string the internal order id the store tracked this order by
64
+ * - email string the email address that received this campaign and is associated with this order
65
+ * - order_total double the order total
66
+ * - tax_total double the total tax for the order (if collected)
67
+ * - ship_total double the shipping total for the order (if collected)
68
+ * - order_date string the date the order was tracked - from the store if possible, otherwise the GMT time we received it
69
+ * - items array structs for each line item on this order.:
70
+ * - line_num int the line number
71
+ * - product_id int the product id
72
+ * - product_name string the product name
73
+ * - product_sku string the sku for the product
74
+ * - product_category_id int the category id for the product
75
+ * - product_category_name string the category name for the product
76
+ * - qty int the quantity ordered
77
+ * - cost double the cost of the item
78
+ */
79
+ public function orders($cid=null, $start=0, $limit=100, $since=null) {
80
+ $_params = array("cid" => $cid, "start" => $start, "limit" => $limit, "since" => $since);
81
+ return $this->master->call('ecomm/orders', $_params);
82
+ }
83
+
84
+ }
85
+
86
+
Mailchimp/Exceptions.php ADDED
@@ -0,0 +1,441 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mailchimp_Error extends Exception {}
4
+ class Mailchimp_HttpError extends Mailchimp_Error {}
5
+
6
+ /**
7
+ * The parameters passed to the API call are invalid or not provided when required
8
+ */
9
+ class Mailchimp_ValidationError extends Mailchimp_Error {}
10
+
11
+ /**
12
+ * None
13
+ */
14
+ class Mailchimp_ServerError_MethodUnknown extends Mailchimp_Error {}
15
+
16
+ /**
17
+ * None
18
+ */
19
+ class Mailchimp_ServerError_InvalidParameters extends Mailchimp_Error {}
20
+
21
+ /**
22
+ * None
23
+ */
24
+ class Mailchimp_Unknown_Exception extends Mailchimp_Error {}
25
+
26
+ /**
27
+ * None
28
+ */
29
+ class Mailchimp_Request_TimedOut extends Mailchimp_Error {}
30
+
31
+ /**
32
+ * None
33
+ */
34
+ class Mailchimp_Zend_Uri_Exception extends Mailchimp_Error {}
35
+
36
+ /**
37
+ * None
38
+ */
39
+ class Mailchimp_PDOException extends Mailchimp_Error {}
40
+
41
+ /**
42
+ * None
43
+ */
44
+ class Mailchimp_Avesta_Db_Exception extends Mailchimp_Error {}
45
+
46
+ /**
47
+ * None
48
+ */
49
+ class Mailchimp_XML_RPC2_Exception extends Mailchimp_Error {}
50
+
51
+ /**
52
+ * None
53
+ */
54
+ class Mailchimp_XML_RPC2_FaultException extends Mailchimp_Error {}
55
+
56
+ /**
57
+ * None
58
+ */
59
+ class Mailchimp_Too_Many_Connections extends Mailchimp_Error {}
60
+
61
+ /**
62
+ * None
63
+ */
64
+ class Mailchimp_Parse_Exception extends Mailchimp_Error {}
65
+
66
+ /**
67
+ * None
68
+ */
69
+ class Mailchimp_User_Unknown extends Mailchimp_Error {}
70
+
71
+ /**
72
+ * None
73
+ */
74
+ class Mailchimp_User_Disabled extends Mailchimp_Error {}
75
+
76
+ /**
77
+ * None
78
+ */
79
+ class Mailchimp_User_DoesNotExist extends Mailchimp_Error {}
80
+
81
+ /**
82
+ * None
83
+ */
84
+ class Mailchimp_User_NotApproved extends Mailchimp_Error {}
85
+
86
+ /**
87
+ * None
88
+ */
89
+ class Mailchimp_Invalid_ApiKey extends Mailchimp_Error {}
90
+
91
+ /**
92
+ * None
93
+ */
94
+ class Mailchimp_User_UnderMaintenance extends Mailchimp_Error {}
95
+
96
+ /**
97
+ * None
98
+ */
99
+ class Mailchimp_Invalid_AppKey extends Mailchimp_Error {}
100
+
101
+ /**
102
+ * None
103
+ */
104
+ class Mailchimp_Invalid_IP extends Mailchimp_Error {}
105
+
106
+ /**
107
+ * None
108
+ */
109
+ class Mailchimp_User_DoesExist extends Mailchimp_Error {}
110
+
111
+ /**
112
+ * None
113
+ */
114
+ class Mailchimp_User_InvalidRole extends Mailchimp_Error {}
115
+
116
+ /**
117
+ * None
118
+ */
119
+ class Mailchimp_User_InvalidAction extends Mailchimp_Error {}
120
+
121
+ /**
122
+ * None
123
+ */
124
+ class Mailchimp_User_MissingEmail extends Mailchimp_Error {}
125
+
126
+ /**
127
+ * None
128
+ */
129
+ class Mailchimp_User_CannotSendCampaign extends Mailchimp_Error {}
130
+
131
+ /**
132
+ * None
133
+ */
134
+ class Mailchimp_User_MissingModuleOutbox extends Mailchimp_Error {}
135
+
136
+ /**
137
+ * None
138
+ */
139
+ class Mailchimp_User_ModuleAlreadyPurchased extends Mailchimp_Error {}
140
+
141
+ /**
142
+ * None
143
+ */
144
+ class Mailchimp_User_ModuleNotPurchased extends Mailchimp_Error {}
145
+
146
+ /**
147
+ * None
148
+ */
149
+ class Mailchimp_User_NotEnoughCredit extends Mailchimp_Error {}
150
+
151
+ /**
152
+ * None
153
+ */
154
+ class Mailchimp_MC_InvalidPayment extends Mailchimp_Error {}
155
+
156
+ /**
157
+ * None
158
+ */
159
+ class Mailchimp_List_DoesNotExist extends Mailchimp_Error {}
160
+
161
+ /**
162
+ * None
163
+ */
164
+ class Mailchimp_List_InvalidInterestFieldType extends Mailchimp_Error {}
165
+
166
+ /**
167
+ * None
168
+ */
169
+ class Mailchimp_List_InvalidOption extends Mailchimp_Error {}
170
+
171
+ /**
172
+ * None
173
+ */
174
+ class Mailchimp_List_InvalidUnsubMember extends Mailchimp_Error {}
175
+
176
+ /**
177
+ * None
178
+ */
179
+ class Mailchimp_List_InvalidBounceMember extends Mailchimp_Error {}
180
+
181
+ /**
182
+ * None
183
+ */
184
+ class Mailchimp_List_AlreadySubscribed extends Mailchimp_Error {}
185
+
186
+ /**
187
+ * None
188
+ */
189
+ class Mailchimp_List_NotSubscribed extends Mailchimp_Error {}
190
+
191
+ /**
192
+ * None
193
+ */
194
+ class Mailchimp_List_InvalidImport extends Mailchimp_Error {}
195
+
196
+ /**
197
+ * None
198
+ */
199
+ class Mailchimp_MC_PastedList_Duplicate extends Mailchimp_Error {}
200
+
201
+ /**
202
+ * None
203
+ */
204
+ class Mailchimp_MC_PastedList_InvalidImport extends Mailchimp_Error {}
205
+
206
+ /**
207
+ * None
208
+ */
209
+ class Mailchimp_Email_AlreadySubscribed extends Mailchimp_Error {}
210
+
211
+ /**
212
+ * None
213
+ */
214
+ class Mailchimp_Email_AlreadyUnsubscribed extends Mailchimp_Error {}
215
+
216
+ /**
217
+ * None
218
+ */
219
+ class Mailchimp_Email_NotExists extends Mailchimp_Error {}
220
+
221
+ /**
222
+ * None
223
+ */
224
+ class Mailchimp_Email_NotSubscribed extends Mailchimp_Error {}
225
+
226
+ /**
227
+ * None
228
+ */
229
+ class Mailchimp_List_MergeFieldRequired extends Mailchimp_Error {}
230
+
231
+ /**
232
+ * None
233
+ */
234
+ class Mailchimp_List_CannotRemoveEmailMerge extends Mailchimp_Error {}
235
+
236
+ /**
237
+ * None
238
+ */
239
+ class Mailchimp_List_Merge_InvalidMergeID extends Mailchimp_Error {}
240
+
241
+ /**
242
+ * None
243
+ */
244
+ class Mailchimp_List_TooManyMergeFields extends Mailchimp_Error {}
245
+
246
+ /**
247
+ * None
248
+ */
249
+ class Mailchimp_List_InvalidMergeField extends Mailchimp_Error {}
250
+
251
+ /**
252
+ * None
253
+ */
254
+ class Mailchimp_List_InvalidInterestGroup extends Mailchimp_Error {}
255
+
256
+ /**
257
+ * None
258
+ */
259
+ class Mailchimp_List_TooManyInterestGroups extends Mailchimp_Error {}
260
+
261
+ /**
262
+ * None
263
+ */
264
+ class Mailchimp_Campaign_DoesNotExist extends Mailchimp_Error {}
265
+
266
+ /**
267
+ * None
268
+ */
269
+ class Mailchimp_Campaign_StatsNotAvailable extends Mailchimp_Error {}
270
+
271
+ /**
272
+ * None
273
+ */
274
+ class Mailchimp_Campaign_InvalidAbsplit extends Mailchimp_Error {}
275
+
276
+ /**
277
+ * None
278
+ */
279
+ class Mailchimp_Campaign_InvalidContent extends Mailchimp_Error {}
280
+
281
+ /**
282
+ * None
283
+ */
284
+ class Mailchimp_Campaign_InvalidOption extends Mailchimp_Error {}
285
+
286
+ /**
287
+ * None
288
+ */
289
+ class Mailchimp_Campaign_InvalidStatus extends Mailchimp_Error {}
290
+
291
+ /**
292
+ * None
293
+ */
294
+ class Mailchimp_Campaign_NotSaved extends Mailchimp_Error {}
295
+
296
+ /**
297
+ * None
298
+ */
299
+ class Mailchimp_Campaign_InvalidSegment extends Mailchimp_Error {}
300
+
301
+ /**
302
+ * None
303
+ */
304
+ class Mailchimp_Campaign_InvalidRss extends Mailchimp_Error {}
305
+
306
+ /**
307
+ * None
308
+ */
309
+ class Mailchimp_Campaign_InvalidAuto extends Mailchimp_Error {}
310
+
311
+ /**
312
+ * None
313
+ */
314
+ class Mailchimp_MC_ContentImport_InvalidArchive extends Mailchimp_Error {}
315
+
316
+ /**
317
+ * None
318
+ */
319
+ class Mailchimp_Campaign_BounceMissing extends Mailchimp_Error {}
320
+
321
+ /**
322
+ * None
323
+ */
324
+ class Mailchimp_Campaign_InvalidTemplate extends Mailchimp_Error {}
325
+
326
+ /**
327
+ * None
328
+ */
329
+ class Mailchimp_Invalid_EcommOrder extends Mailchimp_Error {}
330
+
331
+ /**
332
+ * None
333
+ */
334
+ class Mailchimp_Absplit_UnknownError extends Mailchimp_Error {}
335
+
336
+ /**
337
+ * None
338
+ */
339
+ class Mailchimp_Absplit_UnknownSplitTest extends Mailchimp_Error {}
340
+
341
+ /**
342
+ * None
343
+ */
344
+ class Mailchimp_Absplit_UnknownTestType extends Mailchimp_Error {}
345
+
346
+ /**
347
+ * None
348
+ */
349
+ class Mailchimp_Absplit_UnknownWaitUnit extends Mailchimp_Error {}
350
+
351
+ /**
352
+ * None
353
+ */
354
+ class Mailchimp_Absplit_UnknownWinnerType extends Mailchimp_Error {}
355
+
356
+ /**
357
+ * None
358
+ */
359
+ class Mailchimp_Absplit_WinnerNotSelected extends Mailchimp_Error {}
360
+
361
+ /**
362
+ * None
363
+ */
364
+ class Mailchimp_Invalid_Analytics extends Mailchimp_Error {}
365
+
366
+ /**
367
+ * None
368
+ */
369
+ class Mailchimp_Invalid_DateTime extends Mailchimp_Error {}
370
+
371
+ /**
372
+ * None
373
+ */
374
+ class Mailchimp_Invalid_Email extends Mailchimp_Error {}
375
+
376
+ /**
377
+ * None
378
+ */
379
+ class Mailchimp_Invalid_SendType extends Mailchimp_Error {}
380
+
381
+ /**
382
+ * None
383
+ */
384
+ class Mailchimp_Invalid_Template extends Mailchimp_Error {}
385
+
386
+ /**
387
+ * None
388
+ */
389
+ class Mailchimp_Invalid_TrackingOptions extends Mailchimp_Error {}
390
+
391
+ /**
392
+ * None
393
+ */
394
+ class Mailchimp_Invalid_Options extends Mailchimp_Error {}
395
+
396
+ /**
397
+ * None
398
+ */
399
+ class Mailchimp_Invalid_Folder extends Mailchimp_Error {}
400
+
401
+ /**
402
+ * None
403
+ */
404
+ class Mailchimp_Invalid_URL extends Mailchimp_Error {}
405
+
406
+ /**
407
+ * None
408
+ */
409
+ class Mailchimp_Module_Unknown extends Mailchimp_Error {}
410
+
411
+ /**
412
+ * None
413
+ */
414
+ class Mailchimp_MonthlyPlan_Unknown extends Mailchimp_Error {}
415
+
416
+ /**
417
+ * None
418
+ */
419
+ class Mailchimp_Order_TypeUnknown extends Mailchimp_Error {}
420
+
421
+ /**
422
+ * None
423
+ */
424
+ class Mailchimp_Invalid_PagingLimit extends Mailchimp_Error {}
425
+
426
+ /**
427
+ * None
428
+ */
429
+ class Mailchimp_Invalid_PagingStart extends Mailchimp_Error {}
430
+
431
+ /**
432
+ * None
433
+ */
434
+ class Mailchimp_Max_Size_Reached extends Mailchimp_Error {}
435
+
436
+ /**
437
+ * None
438
+ */
439
+ class Mailchimp_MC_SearchException extends Mailchimp_Error {}
440
+
441
+
Mailchimp/Folders.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mailchimp_Folders {
4
+ public function __construct(wpyksMCAPI $master) {
5
+ $this->master = $master;
6
+ }
7
+
8
+ /**
9
+ * Add a new folder to file campaigns, autoresponders, or templates in
10
+ * @param string $name
11
+ * @param string $type
12
+ * @return associative_array with a single value:
13
+ * - folder_id int the folder_id of the newly created folder.
14
+ */
15
+ public function add($name, $type) {
16
+ $_params = array("name" => $name, "type" => $type);
17
+ return $this->master->call('folders/add', $_params);
18
+ }
19
+
20
+ /**
21
+ * Delete a campaign, autoresponder, or template folder. Note that this will simply make whatever was in the folder appear unfiled, no other data is removed
22
+ * @param int $fid
23
+ * @param string $type
24
+ * @return associative_array with a single entry:
25
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
26
+ */
27
+ public function del($fid, $type) {
28
+ $_params = array("fid" => $fid, "type" => $type);
29
+ return $this->master->call('folders/del', $_params);
30
+ }
31
+
32
+ /**
33
+ * List all the folders of a certain type
34
+ * @param string $type
35
+ * @return array structs for each folder, including:
36
+ * - folder_id int Folder Id for the given folder, this can be used in the campaigns/list() function to filter on.
37
+ * - name string Name of the given folder
38
+ * - date_created string The date/time the folder was created
39
+ * - type string The type of the folders being returned, just to make sure you know.
40
+ * - cnt int number of items in the folder.
41
+ */
42
+ public function getList($type) {
43
+ $_params = array("type" => $type);
44
+ return $this->master->call('folders/list', $_params);
45
+ }
46
+
47
+ /**
48
+ * Update the name of a folder for campaigns, autoresponders, or templates
49
+ * @param int $fid
50
+ * @param string $name
51
+ * @param string $type
52
+ * @return associative_array with a single entry:
53
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
54
+ */
55
+ public function update($fid, $name, $type) {
56
+ $_params = array("fid" => $fid, "name" => $name, "type" => $type);
57
+ return $this->master->call('folders/update', $_params);
58
+ }
59
+
60
+ }
61
+
62
+
Mailchimp/Gallery.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mailchimp_Gallery {
4
+ public function __construct(wpyksMCAPI $master) {
5
+ $this->master = $master;
6
+ }
7
+
8
+ /**
9
+ * Return a section of the image gallery
10
+ * @param associative_array $opts
11
+ * - type string optional the gallery type to return - images or files - default to images
12
+ * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
13
+ * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
14
+ * - sort_by string optional field to sort by - one of size, time, name - defaults to time
15
+ * - sort_dir string optional field to sort by - one of asc, desc - defaults to desc
16
+ * - search_term string optional a term to search for in names
17
+ * @return associative_array the matching gallery items
18
+ * - total int the total matching items
19
+ * - data array structs for each item included in the set, including:
20
+ * - name string the file name
21
+ * - time string the creation date for the item
22
+ * - size int the file size in bytes
23
+ * - full string the url to the actual item in the gallery
24
+ * - thumb string a url for a thumbnail that can be used to represent the item, generally an image thumbnail or an icon for a file type
25
+ */
26
+ public function getList($opts=array()) {
27
+ $_params = array("opts" => $opts);
28
+ return $this->master->call('gallery/list', $_params);
29
+ }
30
+
31
+ }
32
+
33
+
Mailchimp/Helper.php ADDED
@@ -0,0 +1,238 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mailchimp_Helper {
4
+ public function __construct(wpyksMCAPI $master) {
5
+ $this->master = $master;
6
+ }
7
+
8
+ /**
9
+ * Retrieve lots of account information including payments made, plan info, some account stats, installed modules,
10
+ contact info, and more. No private information like Credit Card numbers is available.
11
+ * @param array $exclude
12
+ * @return associative_array containing the details for the account tied to this API Key
13
+ * - username string The Account username
14
+ * - user_id string The Account user unique id (for building some links)
15
+ * - is_trial bool Whether the Account is in Trial mode (can only send campaigns to less than 100 emails)
16
+ * - is_approved bool Whether the Account has been approved for purchases
17
+ * - has_activated bool Whether the Account has been activated
18
+ * - timezone string The timezone for the Account - default is "US/Eastern"
19
+ * - plan_type string Plan Type - "monthly", "payasyougo", or "free"
20
+ * - plan_low int <em>only for Monthly plans</em> - the lower tier for list size
21
+ * - plan_high int <em>only for Monthly plans</em> - the upper tier for list size
22
+ * - plan_start_date string <em>only for Monthly plans</em> - the start date for a monthly plan
23
+ * - emails_left int <em>only for Free and Pay-as-you-go plans</em> emails credits left for the account
24
+ * - pending_monthly bool Whether the account is finishing Pay As You Go credits before switching to a Monthly plan
25
+ * - first_payment string date of first payment
26
+ * - last_payment string date of most recent payment
27
+ * - times_logged_in int total number of times the account has been logged into via the web
28
+ * - last_login string date/time of last login via the web
29
+ * - affiliate_link string Monkey Rewards link for our Affiliate program
30
+ * - industry string the user's selected industry
31
+ * - contact associative_array Contact details for the account
32
+ * - fname string First Name
33
+ * - lname string Last Name
34
+ * - email string Email Address
35
+ * - company string Company Name
36
+ * - address1 string Address Line 1
37
+ * - address2 string Address Line 2
38
+ * - city string City
39
+ * - state string State or Province
40
+ * - zip string Zip or Postal Code
41
+ * - country string Country name
42
+ * - url string Website URL
43
+ * - phone string Phone number
44
+ * - fax string Fax number
45
+ * - modules array a struct for each addon module installed in the account
46
+ * - id string An internal module id
47
+ * - name string The module name
48
+ * - added string The date the module was added
49
+ * - data associative_array Any extra data associated with this module as key=>value pairs
50
+ * - orders array a struct for each order for the account
51
+ * - order_id int The order id
52
+ * - type string The order type - either "monthly" or "credits"
53
+ * - amount double The order amount
54
+ * - date string The order date
55
+ * - credits_used double The total credits used
56
+ * - rewards associative_array Rewards details for the account including credits & inspections earned, number of referrals, referral details, and rewards used
57
+ * - referrals_this_month int the total number of referrals this month
58
+ * - notify_on string whether or not we notify the user when rewards are earned
59
+ * - notify_email string the email address address used for rewards notifications
60
+ * - credits associative_array Email credits earned:
61
+ * - this_month int credits earned this month
62
+ * - total_earned int credits earned all time
63
+ * - remaining int credits remaining
64
+ * - inspections associative_array Inbox Inspections earned:
65
+ * - this_month int credits earned this month
66
+ * - total_earned int credits earned all time
67
+ * - remaining int credits remaining
68
+ * - referrals array a struct for each referral, including:
69
+ * - name string the name of the account
70
+ * - email string the email address associated with the account
71
+ * - signup_date string the signup date for the account
72
+ * - type string the source for the referral
73
+ * - applied array a struct for each applied rewards, including:
74
+ * - value int the number of credits user
75
+ * - date string the date applied
76
+ * - order_id int the order number credits were applied to
77
+ * - order_desc string the order description
78
+ * - integrations array a struct for each connected integrations that can be used with campaigns, including:
79
+ * - id int an internal id for the integration
80
+ * - name string the integration name
81
+ * - list_id string either "_any_" when globally accessible or the list id it's valid for use against
82
+ * - user_id string if applicable, the user id for the integrated system
83
+ * - account string if applicable, the user/account name for the integrated system
84
+ * - profiles array For Facebook, users/page that can be posted to.
85
+ * - id string the user or page id
86
+ * - name string the user or page name
87
+ * - is_page bool whether this is a user or a page
88
+ */
89
+ public function accountDetails($exclude=array()) {
90
+ $_params = array("exclude" => $exclude);
91
+ return $this->master->call('helper/account-details', $_params);
92
+ }
93
+
94
+ /**
95
+ * Retrieve minimal data for all Campaigns a member was sent
96
+ * @param associative_array $email
97
+ * - email string an email address
98
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
99
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
100
+ * @param associative_array $options
101
+ * - list_id string optional A list_id to limit the campaigns to
102
+ * @return array an array of structs containing campaign data for each matching campaign (ordered by send time ascending), including:
103
+ * - id string the campaign unique id
104
+ * - title string the campaign's title
105
+ * - subject string the campaign's subject
106
+ * - send_time string the time the campaign was sent
107
+ * - type string the campaign type
108
+ */
109
+ public function campaignsForEmail($email, $options=null) {
110
+ $_params = array("email" => $email, "options" => $options);
111
+ return $this->master->call('helper/campaigns-for-email', $_params);
112
+ }
113
+
114
+ /**
115
+ * Return the current Chimp Chatter messages for an account.
116
+ * @return array An array of structs containing data for each chatter message
117
+ * - message string The chatter message
118
+ * - type string The type of the message - one of lists:new-subscriber, lists:unsubscribes, lists:profile-updates, campaigns:facebook-likes, campaigns:facebook-comments, campaigns:forward-to-friend, lists:imports, or campaigns:inbox-inspections
119
+ * - url string a url into the web app that the message could link to, if applicable
120
+ * - list_id string the list_id a message relates to, if applicable. Deleted lists will return -DELETED-
121
+ * - campaign_id string the list_id a message relates to, if applicable. Deleted campaigns will return -DELETED-
122
+ * - update_time string The date/time the message was last updated
123
+ */
124
+ public function chimpChatter() {
125
+ $_params = array();
126
+ return $this->master->call('helper/chimp-chatter', $_params);
127
+ }
128
+
129
+ /**
130
+ * Have HTML content auto-converted to a text-only format. You can send: plain HTML, an existing Campaign Id, or an existing Template Id. Note that this will <strong>not</strong> save anything to or update any of your lists, campaigns, or templates.
131
+ It's also not just Lynx and is very fine tuned for our template layouts - your mileage may vary.
132
+ * @param string $type
133
+ * @param associative_array $content
134
+ * - html string optional a single string value,
135
+ * - cid string a valid Campaign Id
136
+ * - user_template_id string the id of a user template
137
+ * - base_template_id string the id of a built in base/basic template
138
+ * - gallery_template_id string the id of a built in gallery template
139
+ * - url string a valid & public URL to pull html content from
140
+ * @return associative_array the content pass in converted to text.
141
+ * - text string the converted html
142
+ */
143
+ public function generateText($type, $content) {
144
+ $_params = array("type" => $type, "content" => $content);
145
+ return $this->master->call('helper/generate-text', $_params);
146
+ }
147
+
148
+ /**
149
+ * Send your HTML content to have the CSS inlined and optionally remove the original styles.
150
+ * @param string $html
151
+ * @param bool $strip_css
152
+ * @return associative_array with a "html" key
153
+ * - html string Your HTML content with all CSS inlined, just like if we sent it.
154
+ */
155
+ public function inlineCss($html, $strip_css=false) {
156
+ $_params = array("html" => $html, "strip_css" => $strip_css);
157
+ return $this->master->call('helper/inline-css', $_params);
158
+ }
159
+
160
+ /**
161
+ * Retrieve minimal List data for all lists a member is subscribed to.
162
+ * @param associative_array $email
163
+ * - email string an email address
164
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
165
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
166
+ * @return array An array of structs with info on the list_id the member is subscribed to.
167
+ * - id string the list unique id
168
+ * - the web_id id referenced in web interface urls
169
+ * - the name list name
170
+ */
171
+ public function listsForEmail($email) {
172
+ $_params = array("email" => $email);
173
+ return $this->master->call('helper/lists-for-email', $_params);
174
+ }
175
+
176
+ /**
177
+ * "Ping" the MailChimp API - a simple method you can call that will return a constant value as long as everything is good. Note
178
+ than unlike most all of our methods, we don't throw an Exception if we are having issues. You will simply receive a different
179
+ string back that will explain our view on what is going on.
180
+ * @return associative_array a with a "msg" key
181
+ * - msg string containing "Everything's Chimpy!" if everything is chimpy, otherwise returns an error message
182
+ */
183
+ public function ping() {
184
+ $_params = array();
185
+ return $this->master->call('helper/ping', $_params);
186
+ }
187
+
188
+ /**
189
+ * Search all campaigns for the specified query terms
190
+ * @param string $query
191
+ * @param int $offset
192
+ * @param string $snip_start
193
+ * @param string $snip_end
194
+ * @return associative_array containing the total matches and current results
195
+ * - total int total campaigns matching
196
+ * - results array matching campaigns and snippets
197
+ * - snippet string the matching snippet for the campaign
198
+ * - campaign associative_array the matching campaign's details - will return same data as single campaign from campaigns/list()
199
+ * - summary associative_array if available, the matching campaign's report/summary data, other wise empty
200
+ */
201
+ public function searchCampaigns($query, $offset=0, $snip_start=null, $snip_end=null) {
202
+ $_params = array("query" => $query, "offset" => $offset, "snip_start" => $snip_start, "snip_end" => $snip_end);
203
+ return $this->master->call('helper/search-campaigns', $_params);
204
+ }
205
+
206
+ /**
207
+ * Search account wide or on a specific list using the specified query terms
208
+ * @param string $query
209
+ * @param string $id
210
+ * @param int $offset
211
+ * @return associative_array An array of both exact matches and partial matches over a full search
212
+ * - exact_matches associative_array containing the total matches and current results
213
+ * - total int total members matching
214
+ * - members array each entry will be struct matching the data format for a single member as returned by lists/member-info()
215
+ * - full_search associative_array containing the total matches and current results
216
+ * - total int total members matching
217
+ * - members array each entry will be struct matching the data format for a single member as returned by lists/member-info()
218
+ */
219
+ public function searchMembers($query, $id=null, $offset=0) {
220
+ $_params = array("query" => $query, "id" => $id, "offset" => $offset);
221
+ return $this->master->call('helper/search-members', $_params);
222
+ }
223
+
224
+ /**
225
+ * Retrieve all domain verification records for an account
226
+ * @return array structs for each domain verification has been attempted for
227
+ * - domain string the verified domain
228
+ * - status string the status of the verification - either "verified" or "pending"
229
+ * - email string the email address used for verification - "pre-existing" if we automatically backfilled it at some point
230
+ */
231
+ public function verifiedDomains() {
232
+ $_params = array();
233
+ return $this->master->call('helper/verified-domains', $_params);
234
+ }
235
+
236
+ }
237
+
238
+
Mailchimp/Lists.php ADDED
@@ -0,0 +1,895 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mailchimp_Lists {
4
+ public function __construct(wpyksMCAPI $master) {
5
+ $this->master = $master;
6
+ }
7
+
8
+ /**
9
+ * Get all email addresses that complained about a campaign sent to a list
10
+ * @param string $id
11
+ * @param int $start
12
+ * @param int $limit
13
+ * @param string $since
14
+ * @return associative_array the total of all reports and the specific reports reports this page
15
+ * - total int the total number of matching abuse reports
16
+ * - data array structs for the actual data for each reports, including:
17
+ * - date string date+time the abuse report was received and processed
18
+ * - email string the email address that reported abuse
19
+ * - campaign_id string the unique id for the campaign that report was made against
20
+ * - type string an internal type generally specifying the originating mail provider - may not be useful outside of filling report views
21
+ */
22
+ public function abuseReports($id, $start=0, $limit=500, $since=null) {
23
+ $_params = array("id" => $id, "start" => $start, "limit" => $limit, "since" => $since);
24
+ return $this->master->call('lists/abuse-reports', $_params);
25
+ }
26
+
27
+ /**
28
+ * Access up to the previous 180 days of daily detailed aggregated activity stats for a given list. Does not include AutoResponder activity.
29
+ * @param string $id
30
+ * @return array of structs containing daily values, each containing:
31
+ */
32
+ public function activity($id) {
33
+ $_params = array("id" => $id);
34
+ return $this->master->call('lists/activity', $_params);
35
+ }
36
+
37
+ /**
38
+ * Subscribe a batch of email addresses to a list at once. If you are using a serialized version of the API, we strongly suggest that you
39
+ only run this method as a POST request, and <em>not</em> a GET request. Maximum batch sizes vary based on the amount of data in each record,
40
+ though you should cap them at 5k - 10k records, depending on your experience. These calls are also long, so be sure you increase your timeout values.
41
+ * @param string $id
42
+ * @param array $batch
43
+ * - email associative_array a struct with one of the following keys - failing to provide anything will produce an error relating to the email address. Provide multiples and we'll use the first we see in this same order.
44
+ * - email string an email address
45
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
46
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
47
+ * - email_type string for the email type option (html or text)
48
+ * - merge_vars associative_array data for the various list specific and special merge vars documented in lists/subscribe
49
+ * @param boolean $double_optin
50
+ * @param boolean $update_existing
51
+ * @param boolean $replace_interests
52
+ * @return associative_array struct of result counts and associated data
53
+ * - add_count int Number of email addresses that were successfully added
54
+ * - adds array array of structs for each add
55
+ * - email string the email address added
56
+ * - euid string the email unique id
57
+ * - leid string the list member's truly unique id
58
+ * - update_count int Number of email addresses that were successfully updated
59
+ * - updates array array of structs for each update
60
+ * - email string the email address added
61
+ * - euid string the email unique id
62
+ * - leid string the list member's truly unique id
63
+ * - error_count int Number of email addresses that failed during addition/updating
64
+ * - errors array array of error structs including:
65
+ * - email string whatever was passed in the batch record's email parameter
66
+ * - email string the email address added
67
+ * - euid string the email unique id
68
+ * - leid string the list member's truly unique id
69
+ * - code int the error code
70
+ * - error string the full error message
71
+ * - row associative_array the row from the batch that caused the error
72
+ */
73
+ public function batchSubscribe($id, $batch, $double_optin=true, $update_existing=false, $replace_interests=true) {
74
+ $_params = array("id" => $id, "batch" => $batch, "double_optin" => $double_optin, "update_existing" => $update_existing, "replace_interests" => $replace_interests);
75
+ return $this->master->call('lists/batch-subscribe', $_params);
76
+ }
77
+
78
+ /**
79
+ * Unsubscribe a batch of email addresses from a list
80
+ * @param string $id
81
+ * @param array $batch
82
+ * - email string an email address
83
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
84
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
85
+ * @param boolean $delete_member
86
+ * @param boolean $send_goodbye
87
+ * @param boolean $send_notify
88
+ * @return array Array of structs containing results and any errors that occurred
89
+ * - success_count int Number of email addresses that were successfully removed
90
+ * - error_count int Number of email addresses that failed during addition/updating
91
+ * - of array structs contain error details including:
92
+ * - errors array array of error structs including:
93
+ * - email string whatever was passed in the batch record's email parameter
94
+ * - email string the email address added
95
+ * - euid string the email unique id
96
+ * - leid string the list member's truly unique id
97
+ * - code int the error code
98
+ * - error string the full error message
99
+ */
100
+ public function batchUnsubscribe($id, $batch, $delete_member=false, $send_goodbye=true, $send_notify=false) {
101
+ $_params = array("id" => $id, "batch" => $batch, "delete_member" => $delete_member, "send_goodbye" => $send_goodbye, "send_notify" => $send_notify);
102
+ return $this->master->call('lists/batch-unsubscribe', $_params);
103
+ }
104
+
105
+ /**
106
+ * Retrieve the clients that the list's subscribers have been tagged as being used based on user agents seen. Made possible by <a href="http://user-agent-string.info" target="_blank">user-agent-string.info</a>
107
+ * @param string $id
108
+ * @return associative_array the desktop and mobile user agents in use on the list
109
+ * - desktop associative_array desktop user agents and percentages
110
+ * - penetration double the percent of desktop clients in use
111
+ * - clients array array of structs for each client including:
112
+ * - client string the common name for the client
113
+ * - icon string a url to an image representing this client
114
+ * - percent string percent of list using the client
115
+ * - members string total members using the client
116
+ * - mobile associative_array mobile user agents and percentages
117
+ * - penetration double the percent of mobile clients in use
118
+ * - clients array array of structs for each client including:
119
+ * - client string the common name for the client
120
+ * - icon string a url to an image representing this client
121
+ * - percent string percent of list using the client
122
+ * - members string total members using the client
123
+ */
124
+ public function clients($id) {
125
+ $_params = array("id" => $id);
126
+ return $this->master->call('lists/clients', $_params);
127
+ }
128
+
129
+ /**
130
+ * Access the Growth History by Month in aggregate or for a given list.
131
+ * @param string $id
132
+ * @return array array of structs containing months and growth data
133
+ * - month string The Year and Month in question using YYYY-MM format
134
+ * - existing int number of existing subscribers to start the month
135
+ * - imports int number of subscribers imported during the month
136
+ * - optins int number of subscribers who opted-in during the month
137
+ */
138
+ public function growthHistory($id=null) {
139
+ $_params = array("id" => $id);
140
+ return $this->master->call('lists/growth-history', $_params);
141
+ }
142
+
143
+ /**
144
+ * Get the list of interest groupings for a given list, including the label, form information, and included groups for each
145
+ * @param string $id
146
+ * @param bool $counts
147
+ * @return array array of structs of the interest groupings for the list
148
+ * - id int The id for the Grouping
149
+ * - name string Name for the Interest groups
150
+ * - form_field string Gives the type of interest group: checkbox,radio,select
151
+ * - groups array Array structs of the grouping options (interest groups) including:
152
+ * - bit string the bit value - not really anything to be done with this
153
+ * - name string the name of the group
154
+ * - display_order string the display order of the group, if set
155
+ * - subscribers int total number of subscribers who have this group if "counts" is true. otherwise empty
156
+ */
157
+ public function interestGroupings($id, $counts=false) {
158
+ $_params = array("id" => $id, "counts" => $counts);
159
+ return $this->master->call('lists/interest-groupings', $_params);
160
+ }
161
+
162
+ /**
163
+ * Add a single Interest Group - if interest groups for the List are not yet enabled, adding the first
164
+ group will automatically turn them on.
165
+ * @param string $id
166
+ * @param string $group_name
167
+ * @param int $grouping_id
168
+ * @return associative_array with a single entry:
169
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
170
+ */
171
+ public function interestGroupAdd($id, $group_name, $grouping_id=null) {
172
+ $_params = array("id" => $id, "group_name" => $group_name, "grouping_id" => $grouping_id);
173
+ return $this->master->call('lists/interest-group-add', $_params);
174
+ }
175
+
176
+ /**
177
+ * Delete a single Interest Group - if the last group for a list is deleted, this will also turn groups for the list off.
178
+ * @param string $id
179
+ * @param string $group_name
180
+ * @param int $grouping_id
181
+ * @return associative_array with a single entry:
182
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
183
+ */
184
+ public function interestGroupDel($id, $group_name, $grouping_id=null) {
185
+ $_params = array("id" => $id, "group_name" => $group_name, "grouping_id" => $grouping_id);
186
+ return $this->master->call('lists/interest-group-del', $_params);
187
+ }
188
+
189
+ /**
190
+ * Change the name of an Interest Group
191
+ * @param string $id
192
+ * @param string $old_name
193
+ * @param string $new_name
194
+ * @param int $grouping_id
195
+ * @return associative_array with a single entry:
196
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
197
+ */
198
+ public function interestGroupUpdate($id, $old_name, $new_name, $grouping_id=null) {
199
+ $_params = array("id" => $id, "old_name" => $old_name, "new_name" => $new_name, "grouping_id" => $grouping_id);
200
+ return $this->master->call('lists/interest-group-update', $_params);
201
+ }
202
+
203
+ /**
204
+ * Add a new Interest Grouping - if interest groups for the List are not yet enabled, adding the first
205
+ grouping will automatically turn them on.
206
+ * @param string $id
207
+ * @param string $name
208
+ * @param string $type
209
+ * @param array $groups
210
+ * @return associative_array with a single entry:
211
+ * - id int the new grouping id if the request succeeds, otherwise an error will be thrown
212
+ */
213
+ public function interestGroupingAdd($id, $name, $type, $groups) {
214
+ $_params = array("id" => $id, "name" => $name, "type" => $type, "groups" => $groups);
215
+ return $this->master->call('lists/interest-grouping-add', $_params);
216
+ }
217
+
218
+ /**
219
+ * Delete an existing Interest Grouping - this will permanently delete all contained interest groups and will remove those selections from all list members
220
+ * @param int $grouping_id
221
+ * @return associative_array with a single entry:
222
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
223
+ */
224
+ public function interestGroupingDel($grouping_id) {
225
+ $_params = array("grouping_id" => $grouping_id);
226
+ return $this->master->call('lists/interest-grouping-del', $_params);
227
+ }
228
+
229
+ /**
230
+ * Update an existing Interest Grouping
231
+ * @param int $grouping_id
232
+ * @param string $name
233
+ * @param string $value
234
+ * @return associative_array with a single entry:
235
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
236
+ */
237
+ public function interestGroupingUpdate($grouping_id, $name, $value) {
238
+ $_params = array("grouping_id" => $grouping_id, "name" => $name, "value" => $value);
239
+ return $this->master->call('lists/interest-grouping-update', $_params);
240
+ }
241
+
242
+ /**
243
+ * Retrieve the locations (countries) that the list's subscribers have been tagged to based on geocoding their IP address
244
+ * @param string $id
245
+ * @return array array of locations
246
+ * - country string the country name
247
+ * - cc string the ISO 3166 2 digit country code
248
+ * - percent double the percent of subscribers in the country
249
+ * - total double the total number of subscribers in the country
250
+ */
251
+ public function locations($id) {
252
+ $_params = array("id" => $id);
253
+ return $this->master->call('lists/locations', $_params);
254
+ }
255
+
256
+ /**
257
+ * Get the most recent 100 activities for particular list members (open, click, bounce, unsub, abuse, sent to, etc.)
258
+ * @param string $id
259
+ * @param array $emails
260
+ * - email string an email address - for new subscribers obviously this should be used
261
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
262
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
263
+ * @return associative_array of data and success/error counts
264
+ * - success_count int the number of subscribers successfully found on the list
265
+ * - error_count int the number of subscribers who were not found on the list
266
+ * - errors array array of error structs including:
267
+ * - email string whatever was passed in the email parameter
268
+ * - email string the email address added
269
+ * - euid string the email unique id
270
+ * - leid string the list member's truly unique id
271
+ * - error string the error message
272
+ * - code string the error code
273
+ * - data array an array of structs where each activity record has:
274
+ * - email string whatever was passed in the email parameter
275
+ * - email string the email address added
276
+ * - euid string the email unique id
277
+ * - leid string the list member's truly unique id
278
+ * - activity array an array of structs containing the activity, including:
279
+ * - action string The action name, one of: open, click, bounce, unsub, abuse, sent, queued, ecomm, mandrill_send, mandrill_hard_bounce, mandrill_soft_bounce, mandrill_open, mandrill_click, mandrill_spam, mandrill_unsub, mandrill_reject
280
+ * - timestamp string The date+time of the action (GMT)
281
+ * - url string For click actions, the url clicked, otherwise this is empty
282
+ * - type string If there's extra bounce, unsub, etc data it will show up here.
283
+ * - campaign_id string The campaign id the action was related to, if it exists - otherwise empty (ie, direct unsub from list)
284
+ * - campaign_data associative_array If not deleted, the campaigns/list data for the campaign
285
+ */
286
+ public function memberActivity($id, $emails) {
287
+ $_params = array("id" => $id, "emails" => $emails);
288
+ return $this->master->call('lists/member-activity', $_params);
289
+ }
290
+
291
+ /**
292
+ * Get all the information for particular members of a list
293
+ * @param string $id
294
+ * @param array $emails
295
+ * - email string an email address - for new subscribers obviously this should be used
296
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
297
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
298
+ * @return associative_array of data and success/error counts
299
+ * - success_count int the number of subscribers successfully found on the list
300
+ * - error_count int the number of subscribers who were not found on the list
301
+ * - errors array array of error structs including:
302
+ * - email associative_array whatever was passed in the email parameter
303
+ * - email string the email address added
304
+ * - euid string the email unique id
305
+ * - leid string the list member's truly unique id
306
+ * - error string the error message
307
+ * - data array array of structs for each valid list member
308
+ * - id string The unique id (euid) for this email address on an account
309
+ * - email string The email address associated with this record
310
+ * - email_type string The type of emails this customer asked to get: html or text
311
+ * - merges associative_array a struct containing a key for each merge tags and the data for those tags for this email address, plus:
312
+ * - GROUPINGS array if Interest groupings are enabled, this will exist with structs for each grouping:
313
+ * - id int the grouping id
314
+ * - name string the interest group name
315
+ * - groups array structs for each group in the grouping
316
+ * - name string the group name
317
+ * - interested bool whether the member has this group selected
318
+ * - status string The subscription status for this email address, either pending, subscribed, unsubscribed, or cleaned
319
+ * - ip_signup string IP Address this address signed up from. This may be blank if single optin is used.
320
+ * - timestamp_signup string The date+time the double optin was initiated. This may be blank if single optin is used.
321
+ * - ip_opt string IP Address this address opted in from.
322
+ * - timestamp_opt string The date+time the optin completed
323
+ * - member_rating int the rating of the subscriber. This will be 1 - 5 as described <a href="http://eepurl.com/f-2P" target="_blank">here</a>
324
+ * - campaign_id string If the user is unsubscribed and they unsubscribed from a specific campaign, that campaign_id will be listed, otherwise this is not returned.
325
+ * - lists array An array of structs for the other lists this member belongs to
326
+ * - id string the list id
327
+ * - status string the members status on that list
328
+ * - timestamp string The date+time this email address entered it's current status
329
+ * - info_changed string The last time this record was changed. If the record is old enough, this may be blank.
330
+ * - web_id int The Member id used in our web app, allows you to create a link directly to it
331
+ * - leid int The Member id used in our web app, allows you to create a link directly to it
332
+ * - list_id string The list id the for the member record being returned
333
+ * - list_name string The list name the for the member record being returned
334
+ * - language string if set/detected, a language code from <a href="http://kb.mailchimp.com/article/can-i-see-what-languages-my-subscribers-use#code" target="_blank">here</a>
335
+ * - is_gmonkey bool Whether the member is a <a href="http://mailchimp.com/features/golden-monkeys/" target="_blank">Golden Monkey</a> or not.
336
+ * - geo associative_array the geographic information if we have it. including:
337
+ * - latitude string the latitude
338
+ * - longitude string the longitude
339
+ * - gmtoff string GMT offset
340
+ * - dstoff string GMT offset during daylight savings (if DST not observered, will be same as gmtoff)
341
+ * - timezone string the timezone we've place them in
342
+ * - cc string 2 digit ISO-3166 country code
343
+ * - region string generally state, province, or similar
344
+ * - clients associative_array the client we've tracked the address as using with two keys:
345
+ * - name string the common name of the client
346
+ * - icon_url string a url representing a path to an icon representing this client
347
+ * - static_segments array structs for each static segments the member is a part of including:
348
+ * - id int the segment id
349
+ * - name string the name given to the segment
350
+ * - added string the date the member was added
351
+ * - notes array structs for each note entered for this member. For each note:
352
+ * - id int the note id
353
+ * - note string the text entered
354
+ * - created string the date the note was created
355
+ * - updated string the date the note was last updated
356
+ * - created_by_name string the name of the user who created the note. This can change as users update their profile.
357
+ */
358
+ public function memberInfo($id, $emails) {
359
+ $_params = array("id" => $id, "emails" => $emails);
360
+ return $this->master->call('lists/member-info', $_params);
361
+ }
362
+
363
+ /**
364
+ * Get all of the list members for a list that are of a particular status and potentially matching a segment. This will cause locking, so don't run multiples at once. Are you trying to get a dump including lots of merge
365
+ data or specific members of a list? If so, checkout the <a href="/export/1.0/list.func.php">List Export API</a>
366
+ * @param string $id
367
+ * @param string $status
368
+ * @param associative_array $opts
369
+ * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
370
+ * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
371
+ * - sort_field string optional the data field to sort by - mergeX (1-30), your custom merge tags, "email", "rating","last_update_time", or "optin_time" - invalid fields will be ignored
372
+ * - sort_dir string optional the direct - ASC or DESC. defaults to ASC (case insensitive)
373
+ * - segment associative_array a properly formatted segment that works with campaigns/segment-test
374
+ * @return associative_array of the total records matched and limited list member data for this page
375
+ * - total int the total matching records
376
+ * - data array structs for each member as returned by member-info
377
+ */
378
+ public function members($id, $status='subscribed', $opts=array()) {
379
+ $_params = array("id" => $id, "status" => $status, "opts" => $opts);
380
+ return $this->master->call('lists/members', $_params);
381
+ }
382
+
383
+ /**
384
+ * Add a new merge tag to a given list
385
+ * @param string $id
386
+ * @param string $tag
387
+ * @param string $name
388
+ * @param associative_array $options
389
+ * - field_type string optional one of: text, number, radio, dropdown, date, address, phone, url, imageurl, zip, birthday - defaults to text
390
+ * - req boolean optional indicates whether the field is required - defaults to false
391
+ * - public boolean optional indicates whether the field is displayed in public - defaults to true
392
+ * - show boolean optional indicates whether the field is displayed in the app's list member view - defaults to true
393
+ * - order int The order this merge tag should be displayed in - this will cause existing values to be reset so this fits
394
+ * - default_value string optional the default value for the field. See lists/subscribe() for formatting info. Defaults to blank - max 255 bytes
395
+ * - helptext string optional the help text to be used with some newer forms. Defaults to blank - max 255 bytes
396
+ * - choices array optional kind of - an array of strings to use as the choices for radio and dropdown type fields
397
+ * - dateformat string optional only valid for birthday and date fields. For birthday type, must be "MM/DD" (default) or "DD/MM". For date type, must be "MM/DD/YYYY" (default) or "DD/MM/YYYY". Any other values will be converted to the default.
398
+ * - phoneformat string optional "US" is the default - any other value will cause them to be unformatted (international)
399
+ * - defaultcountry string optional the <a href="http://www.iso.org/iso/english_country_names_and_code_elements" target="_blank">ISO 3166 2 digit character code</a> for the default country. Defaults to "US". Anything unrecognized will be converted to the default.
400
+ * @return associative_array the full data for the new merge var, just like merge-vars returns
401
+ * - name string Name/description of the merge field
402
+ * - req bool Denotes whether the field is required (true) or not (false)
403
+ * - field_type string The "data type" of this merge var. One of: email, text, number, radio, dropdown, date, address, phone, url, imageurl
404
+ * - public bool Whether or not this field is visible to list subscribers
405
+ * - show bool Whether the field is displayed in thelist dashboard
406
+ * - order string The order this field displays in on forms
407
+ * - default string The default value for this field
408
+ * - helptext string The helptext for this field
409
+ * - size string The width of the field to be used
410
+ * - tag string The merge tag that's used for forms and lists/subscribe() and lists/update-member()
411
+ * - choices array the options available for radio and dropdown field types
412
+ * - id int an unchanging id for the merge var
413
+ */
414
+ public function mergeVarAdd($id, $tag, $name, $options=array()) {
415
+ $_params = array("id" => $id, "tag" => $tag, "name" => $name, "options" => $options);
416
+ return $this->master->call('lists/merge-var-add', $_params);
417
+ }
418
+
419
+ /**
420
+ * Delete a merge tag from a given list and all its members. Seriously - the data is removed from all members as well!
421
+ Note that on large lists this method may seem a bit slower than calls you typically make.
422
+ * @param string $id
423
+ * @param string $tag
424
+ * @return associative_array with a single entry:
425
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
426
+ */
427
+ public function mergeVarDel($id, $tag) {
428
+ $_params = array("id" => $id, "tag" => $tag);
429
+ return $this->master->call('lists/merge-var-del', $_params);
430
+ }
431
+
432
+ /**
433
+ * Completely resets all data stored in a merge var on a list. All data is removed and this action can not be undone.
434
+ * @param string $id
435
+ * @param string $tag
436
+ * @return associative_array with a single entry:
437
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
438
+ */
439
+ public function mergeVarReset($id, $tag) {
440
+ $_params = array("id" => $id, "tag" => $tag);
441
+ return $this->master->call('lists/merge-var-reset', $_params);
442
+ }
443
+
444
+ /**
445
+ * Sets a particular merge var to the specified value for every list member. Only merge var ids 1 - 30 may be modified this way. This is generally a dirty method
446
+ unless you're fixing data since you should probably be using default_values and/or conditional content. as with lists/merge-var-reset(), this can not be undone.
447
+ * @param string $id
448
+ * @param string $tag
449
+ * @param string $value
450
+ * @return associative_array with a single entry:
451
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
452
+ */
453
+ public function mergeVarSet($id, $tag, $value) {
454
+ $_params = array("id" => $id, "tag" => $tag, "value" => $value);
455
+ return $this->master->call('lists/merge-var-set', $_params);
456
+ }
457
+
458
+ /**
459
+ * Update most parameters for a merge tag on a given list. You cannot currently change the merge type
460
+ * @param string $id
461
+ * @param string $tag
462
+ * @param associative_array $options
463
+ * @return associative_array the full data for the new merge var, just like merge-vars returns
464
+ * - name string Name/description of the merge field
465
+ * - req bool Denotes whether the field is required (true) or not (false)
466
+ * - field_type string The "data type" of this merge var. One of: email, text, number, radio, dropdown, date, address, phone, url, imageurl
467
+ * - public bool Whether or not this field is visible to list subscribers
468
+ * - show bool Whether the field is displayed in thelist dashboard
469
+ * - order string The order this field to displays in on forms
470
+ * - default string The default value for this field
471
+ * - helptext string The helptext for this field
472
+ * - size string The width of the field to be used
473
+ * - tag string The merge tag that's used for forms and lists/subscribe() and lists/update-member()
474
+ * - choices array the options available for radio and dropdown field types
475
+ * - id int an unchanging id for the merge var
476
+ */
477
+ public function mergeVarUpdate($id, $tag, $options) {
478
+ $_params = array("id" => $id, "tag" => $tag, "options" => $options);
479
+ return $this->master->call('lists/merge-var-update', $_params);
480
+ }
481
+
482
+ /**
483
+ * Get the list of merge tags for a given list, including their name, tag, and required setting
484
+ * @param array $id
485
+ * @return associative_array of data and success/error counts
486
+ * - success_count int the number of subscribers successfully found on the list
487
+ * - error_count int the number of subscribers who were not found on the list
488
+ * - data array of structs for the merge tags on each list
489
+ * - id string the list id
490
+ * - name string the list name
491
+ * - merge_vars array of structs for each merge var
492
+ * - name string Name of the merge field
493
+ * - req bool Denotes whether the field is required (true) or not (false)
494
+ * - field_type string The "data type" of this merge var. One of the options accepted by field_type in lists/merge-var-add
495
+ * - public bool Whether or not this field is visible to list subscribers
496
+ * - show bool Whether the list owner has this field displayed on their list dashboard
497
+ * - order string The order the list owner has set this field to display in
498
+ * - default string The default value the list owner has set for this field
499
+ * - helptext string The helptext for this field
500
+ * - size string The width of the field to be used
501
+ * - tag string The merge tag that's used for forms and lists/subscribe() and listUpdateMember()
502
+ * - choices array For radio and dropdown field types, an array of the options available
503
+ * - id int an unchanging id for the merge var
504
+ * - errors array of error structs
505
+ * - id string the passed list id that failed
506
+ * - code int the resulting error code
507
+ * - msg string the resulting error message
508
+ */
509
+ public function mergeVars($id) {
510
+ $_params = array("id" => $id);
511
+ return $this->master->call('lists/merge-vars', $_params);
512
+ }
513
+
514
+ /**
515
+ * Retrieve all of Segments for a list.
516
+ * @param string $id
517
+ * @param string $type
518
+ * @return associative_array with 2 keys:
519
+ * - static.id int the id of the segment
520
+ * - created_date string the date+time the segment was created
521
+ * - last_update string the date+time the segment was last updated (add or del)
522
+ */
523
+ public function segments($id, $type=null) {
524
+ $_params = array("id" => $id, "type" => $type);
525
+ return $this->master->call('lists/segments', $_params);
526
+ }
527
+
528
+ /**
529
+ * Save a segment against a list for later use. There is no limit to the number of segments which can be saved. Static Segments <strong>are not</strong> tied
530
+ to any merge data, interest groups, etc. They essentially allow you to configure an unlimited number of custom segments which will have standard performance.
531
+ When using proper segments, Static Segments are one of the available options for segmentation just as if you used a merge var (and they can be used with other segmentation
532
+ options), though performance may degrade at that point. Saved Segments (called "auto-updating" in the app) are essentially just the match+conditions typically
533
+ used.
534
+ * @param string $id
535
+ * @param associative_array $opts
536
+ * - type string either "static" or "saved"
537
+ * - name string a unique name per list for the segment - 100 byte maximum length, anything longer will throw an error
538
+ * - segment_opts associative_array for "saved" only, the standard segment match+conditions, just like campaigns/segment-test
539
+ * - match string "any" or "all"
540
+ * - conditions array structs for each condition, just like campaigns/segment-test
541
+ * @return associative_array with a single entry:
542
+ * - id int the id of the new segment, otherwise an error will be thrown.
543
+ */
544
+ public function segmentAdd($id, $opts) {
545
+ $_params = array("id" => $id, "opts" => $opts);
546
+ return $this->master->call('lists/segment-add', $_params);
547
+ }
548
+
549
+ /**
550
+ * Delete a segment. Note that this will, of course, remove any member affiliations with any static segments deleted
551
+ * @param string $id
552
+ * @param int $seg_id
553
+ * @return associative_array with a single entry:
554
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
555
+ */
556
+ public function segmentDel($id, $seg_id) {
557
+ $_params = array("id" => $id, "seg_id" => $seg_id);
558
+ return $this->master->call('lists/segment-del', $_params);
559
+ }
560
+
561
+ /**
562
+ * Allows one to test their segmentation rules before creating a campaign using them - this is no different from campaigns/segment-test() and will eventually replace it.
563
+ For the time being, the crazy segmenting condition documentation will continue to live over there.
564
+ * @param string $list_id
565
+ * @param associative_array $options
566
+ * - saved_segment_id string a saved segment id from lists/segments() - this will take precendence, otherwise the match+conditions are required.
567
+ * - match string controls whether to use AND or OR when applying your options - expects "<strong>any</strong>" (for OR) or "<strong>all</strong>" (for AND)
568
+ * - conditions array of up to 5 structs for different criteria to apply while segmenting. Each criteria row must contain 3 keys - "<strong>field</strong>", "<strong>op</strong>", and "<strong>value</strong>" - and possibly a fourth, "<strong>extra</strong>", based on these definitions:
569
+ * @return associative_array with a single entry:
570
+ * - total int The total number of subscribers matching your segmentation options
571
+ */
572
+ public function segmentTest($list_id, $options) {
573
+ $_params = array("list_id" => $list_id, "options" => $options);
574
+ return $this->master->call('lists/segment-test', $_params);
575
+ }
576
+
577
+ /**
578
+ * Update an existing segment. The list and type can not be changed.
579
+ * @param string $id
580
+ * @param int $seg_id
581
+ * @param associative_array $opts
582
+ * - name string a unique name per list for the segment - 100 byte maximum length, anything longer will throw an error
583
+ * - segment_opts associative_array for "saved" only, the standard segment match+conditions, just like campaigns/segment-test
584
+ * - match associative_array "any" or "all"
585
+ * - conditions array structs for each condition, just like campaigns/segment-test
586
+ * @return associative_array with a single entry:
587
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
588
+ */
589
+ public function segmentUpdate($id, $seg_id, $opts) {
590
+ $_params = array("id" => $id, "seg_id" => $seg_id, "opts" => $opts);
591
+ return $this->master->call('lists/segment-update', $_params);
592
+ }
593
+
594
+ /**
595
+ * Save a segment against a list for later use. There is no limit to the number of segments which can be saved. Static Segments <strong>are not</strong> tied
596
+ to any merge data, interest groups, etc. They essentially allow you to configure an unlimited number of custom segments which will have standard performance.
597
+ When using proper segments, Static Segments are one of the available options for segmentation just as if you used a merge var (and they can be used with other segmentation
598
+ options), though performance may degrade at that point.
599
+ * @param string $id
600
+ * @param string $name
601
+ * @return associative_array with a single entry:
602
+ * - id int the id of the new segment, otherwise an error will be thrown.
603
+ */
604
+ public function staticSegmentAdd($id, $name) {
605
+ $_params = array("id" => $id, "name" => $name);
606
+ return $this->master->call('lists/static-segment-add', $_params);
607
+ }
608
+
609
+ /**
610
+ * Delete a static segment. Note that this will, of course, remove any member affiliations with the segment
611
+ * @param string $id
612
+ * @param int $seg_id
613
+ * @return associative_array with a single entry:
614
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
615
+ */
616
+ public function staticSegmentDel($id, $seg_id) {
617
+ $_params = array("id" => $id, "seg_id" => $seg_id);
618
+ return $this->master->call('lists/static-segment-del', $_params);
619
+ }
620
+
621
+ /**
622
+ * Add list members to a static segment. It is suggested that you limit batch size to no more than 10,000 addresses per call. Email addresses must exist on the list
623
+ in order to be included - this <strong>will not</strong> subscribe them to the list!
624
+ * @param string $id
625
+ * @param int $seg_id
626
+ * @param array $batch
627
+ * - email string an email address
628
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
629
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
630
+ * @return associative_array an array with the results of the operation
631
+ * - success_count int the total number of successful updates (will include members already in the segment)
632
+ * - errors array structs for each error including:
633
+ * - email string whatever was passed in the email parameter
634
+ * - email string the email address added
635
+ * - euid string the email unique id
636
+ * - leid string the list member's truly unique id
637
+ * - code string the error code
638
+ * - error string the full error message
639
+ */
640
+ public function staticSegmentMembersAdd($id, $seg_id, $batch) {
641
+ $_params = array("id" => $id, "seg_id" => $seg_id, "batch" => $batch);
642
+ return $this->master->call('lists/static-segment-members-add', $_params);
643
+ }
644
+
645
+ /**
646
+ * Remove list members from a static segment. It is suggested that you limit batch size to no more than 10,000 addresses per call. Email addresses must exist on the list
647
+ in order to be removed - this <strong>will not</strong> unsubscribe them from the list!
648
+ * @param string $id
649
+ * @param int $seg_id
650
+ * @param array $batch
651
+ * - email string an email address
652
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
653
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
654
+ * @return associative_array an array with the results of the operation
655
+ * - success_count int the total number of successful removals
656
+ * - error_count int the total number of unsuccessful removals
657
+ * - errors array structs for each error including:
658
+ * - email string whatever was passed in the email parameter
659
+ * - email string the email address added
660
+ * - euid string the email unique id
661
+ * - leid string the list member's truly unique id
662
+ * - code string the error code
663
+ * - error string the full error message
664
+ */
665
+ public function staticSegmentMembersDel($id, $seg_id, $batch) {
666
+ $_params = array("id" => $id, "seg_id" => $seg_id, "batch" => $batch);
667
+ return $this->master->call('lists/static-segment-members-del', $_params);
668
+ }
669
+
670
+ /**
671
+ * Resets a static segment - removes <strong>all</strong> members from the static segment. Note: does not actually affect list member data
672
+ * @param string $id
673
+ * @param int $seg_id
674
+ * @return associative_array with a single entry:
675
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
676
+ */
677
+ public function staticSegmentReset($id, $seg_id) {
678
+ $_params = array("id" => $id, "seg_id" => $seg_id);
679
+ return $this->master->call('lists/static-segment-reset', $_params);
680
+ }
681
+
682
+ /**
683
+ * Retrieve all of the Static Segments for a list.
684
+ * @param string $id
685
+ * @return array an of structs with data for each static segment
686
+ * - id int the id of the segment
687
+ * - name string the name for the segment
688
+ * - member_count int the total number of subscribed members currently in a segment
689
+ * - created_date string the date+time the segment was created
690
+ * - last_update string the date+time the segment was last updated (add or del)
691
+ * - last_reset string the date+time the segment was last reset (ie had all members cleared from it)
692
+ */
693
+ public function staticSegments($id) {
694
+ $_params = array("id" => $id);
695
+ return $this->master->call('lists/static-segments', $_params);
696
+ }
697
+
698
+ /**
699
+ * Subscribe the provided email to a list. By default this sends a confirmation email - you will not see new members until the link contained in it is clicked!
700
+ * @param string $id
701
+ * @param associative_array $email
702
+ * - email string an email address - for new subscribers obviously this should be used
703
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
704
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
705
+ * @param associative_array $merge_vars
706
+ * - new-email string set this to change the email address. This is only respected on calls using update_existing or when passed to listUpdateMember().
707
+ * - groupings array of Interest Grouping structs. Each should contain:
708
+ * - id int Grouping "id" from lists/interest-groupings (either this or name must be present) - this id takes precedence and can't change (unlike the name)
709
+ * - name string Grouping "name" from lists/interest-groupings (either this or id must be present)
710
+ * - groups array an array of valid group names for this grouping.
711
+ * - optin_ip string Set the Opt-in IP field. <em>Abusing this may cause your account to be suspended.</em> We do validate this and it must not be a private IP address.
712
+ * - optin_time string Set the Opt-in Time field. <em>Abusing this may cause your account to be suspended.</em> We do validate this and it must be a valid date. Use - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00" to be safe. Generally, though, anything strtotime() understands we'll understand - <a href="http://us2.php.net/strtotime" target="_blank">http://us2.php.net/strtotime</a>
713
+ * - mc_location associative_array Set the member's geographic location either by optin_ip or geo data.
714
+ * - latitude string use the specified latitude (longitude must exist for this to work)
715
+ * - longitude string use the specified longitude (latitude must exist for this to work)
716
+ * - anything string if this (or any other key exists here) we'll try to use the optin ip. NOTE - this will slow down each subscribe call a bit, especially for lat/lng pairs in sparsely populated areas. Currently our automated background processes can and will overwrite this based on opens and clicks.
717
+ * - mc_language string Set the member's language preference. Supported codes are fully case-sensitive and can be found <a href="http://kb.mailchimp.com/article/can-i-see-what-languages-my-subscribers-use#code" target="_new">here</a>.
718
+ * - mc_notes array of structs for managing notes - it may contain:
719
+ * - note string the note to set. this is required unless you're deleting a note
720
+ * - id int the note id to operate on. not including this (or using an invalid id) causes a new note to be added
721
+ * - action string if the "id" key exists and is valid, an "update" key may be set to "append" (default), "prepend", "replace", or "delete" to handle how we should update existing notes. "delete", obviously, will only work with a valid "id" - passing that along with "note" and an invalid "id" is wrong and will be ignored.
722
+ * @param string $email_type
723
+ * @param bool $double_optin
724
+ * @param bool $update_existing
725
+ * @param bool $replace_interests
726
+ * @param bool $send_welcome
727
+ * @return associative_array the ids for this subscriber
728
+ * - email string the email address added
729
+ * - euid string the email unique id
730
+ * - leid string the list member's truly unique id
731
+ */
732
+ public function subscribe($id, $email, $merge_vars=null, $email_type='html', $double_optin=true, $update_existing=false, $replace_interests=true, $send_welcome=false) {
733
+ $_params = array("id" => $id, "email" => $email, "merge_vars" => $merge_vars, "email_type" => $email_type, "double_optin" => $double_optin, "update_existing" => $update_existing, "replace_interests" => $replace_interests, "send_welcome" => $send_welcome);
734
+ return $this->master->call('lists/subscribe', $_params);
735
+ }
736
+
737
+ /**
738
+ * Unsubscribe the given email address from the list
739
+ * @param string $id
740
+ * @param associative_array $email
741
+ * - email string an email address
742
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
743
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
744
+ * @param boolean $delete_member
745
+ * @param boolean $send_goodbye
746
+ * @param boolean $send_notify
747
+ * @return associative_array with a single entry:
748
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
749
+ */
750
+ public function unsubscribe($id, $email, $delete_member=false, $send_goodbye=true, $send_notify=true) {
751
+ $_params = array("id" => $id, "email" => $email, "delete_member" => $delete_member, "send_goodbye" => $send_goodbye, "send_notify" => $send_notify);
752
+ return $this->master->call('lists/unsubscribe', $_params);
753
+ }
754
+
755
+ /**
756
+ * Edit the email address, merge fields, and interest groups for a list member. If you are doing a batch update on lots of users,
757
+ consider using lists/batch-subscribe() with the update_existing and possible replace_interests parameter.
758
+ * @param string $id
759
+ * @param associative_array $email
760
+ * - email string an email address
761
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
762
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
763
+ * @param array $merge_vars
764
+ * @param string $email_type
765
+ * @param boolean $replace_interests
766
+ * @return associative_array the ids for this subscriber
767
+ * - email string the email address added
768
+ * - euid string the email unique id
769
+ * - leid string the list member's truly unique id
770
+ */
771
+ public function updateMember($id, $email, $merge_vars, $email_type='', $replace_interests=true) {
772
+ $_params = array("id" => $id, "email" => $email, "merge_vars" => $merge_vars, "email_type" => $email_type, "replace_interests" => $replace_interests);
773
+ return $this->master->call('lists/update-member', $_params);
774
+ }
775
+
776
+ /**
777
+ * Add a new Webhook URL for the given list
778
+ * @param string $id
779
+ * @param string $url
780
+ * @param associative_array $actions
781
+ * - subscribe bool optional as subscribes occur, defaults to true
782
+ * - unsubscribe bool optional as subscribes occur, defaults to true
783
+ * - profile bool optional as profile updates occur, defaults to true
784
+ * - cleaned bool optional as emails are cleaned from the list, defaults to true
785
+ * - upemail bool optional when subscribers change their email address, defaults to true
786
+ * - campaign bool option when a campaign is sent or canceled, defaults to true
787
+ * @param associative_array $sources
788
+ * - user bool optional user/subscriber initiated actions, defaults to true
789
+ * - admin bool optional admin actions in our web app, defaults to true
790
+ * - api bool optional actions that happen via API calls, defaults to false
791
+ * @return associative_array with a single entry:
792
+ * - id int the id of the new webhook, otherwise an error will be thrown.
793
+ */
794
+ public function webhookAdd($id, $url, $actions=array(), $sources=array()) {
795
+ $_params = array("id" => $id, "url" => $url, "actions" => $actions, "sources" => $sources);
796
+ return $this->master->call('lists/webhook-add', $_params);
797
+ }
798
+
799
+ /**
800
+ * Delete an existing Webhook URL from a given list
801
+ * @param string $id
802
+ * @param string $url
803
+ * @return associative_array with a single entry:
804
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
805
+ */
806
+ public function webhookDel($id, $url) {
807
+ $_params = array("id" => $id, "url" => $url);
808
+ return $this->master->call('lists/webhook-del', $_params);
809
+ }
810
+
811
+ /**
812
+ * Return the Webhooks configured for the given list
813
+ * @param string $id
814
+ * @return array of structs for each webhook
815
+ * - url string the URL for this Webhook
816
+ * - actions associative_array the possible actions and whether they are enabled
817
+ * - subscribe bool triggered when subscribes happen
818
+ * - unsubscribe bool triggered when unsubscribes happen
819
+ * - profile bool triggered when profile updates happen
820
+ * - cleaned bool triggered when a subscriber is cleaned (bounced) from a list
821
+ * - upemail bool triggered when a subscriber's email address is changed
822
+ * - campaign bool triggered when a campaign is sent or canceled
823
+ * - sources associative_array the possible sources and whether they are enabled
824
+ * - user bool whether user/subscriber triggered actions are returned
825
+ * - admin bool whether admin (manual, in-app) triggered actions are returned
826
+ * - api bool whether api triggered actions are returned
827
+ */
828
+ public function webhooks($id) {
829
+ $_params = array("id" => $id);
830
+ return $this->master->call('lists/webhooks', $_params);
831
+ }
832
+
833
+ /**
834
+ * Retrieve all of the lists defined for your user account
835
+ * @param associative_array $filters
836
+ * - list_id string optional - return a single list using a known list_id. Accepts multiples separated by commas when not using exact matching
837
+ * - list_name string optional - only lists that match this name
838
+ * - from_name string optional - only lists that have a default from name matching this
839
+ * - from_email string optional - only lists that have a default from email matching this
840
+ * - from_subject string optional - only lists that have a default from email matching this
841
+ * - created_before string optional - only show lists that were created before this date+time - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00"
842
+ * - created_after string optional - only show lists that were created since this date+time - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00"
843
+ * - exact boolean optional - flag for whether to filter on exact values when filtering, or search within content for filter values - defaults to true
844
+ * @param int $start
845
+ * @param int $limit
846
+ * @param string $sort_field
847
+ * @param string $sort_dir
848
+ * @return associative_array result of the operation including valid data and any errors
849
+ * - total int the total number of lists which matched the provided filters
850
+ * - data array structs for the lists which matched the provided filters, including the following
851
+ * - id string The list id for this list. This will be used for all other list management functions.
852
+ * - web_id int The list id used in our web app, allows you to create a link directly to it
853
+ * - name string The name of the list.
854
+ * - date_created string The date that this list was created.
855
+ * - email_type_option boolean Whether or not the List supports multiple formats for emails or just HTML
856
+ * - use_awesomebar boolean Whether or not campaigns for this list use the Awesome Bar in archives by default
857
+ * - default_from_name string Default From Name for campaigns using this list
858
+ * - default_from_email string Default From Email for campaigns using this list
859
+ * - default_subject string Default Subject Line for campaigns using this list
860
+ * - default_language string Default Language for this list's forms
861
+ * - list_rating double An auto-generated activity score for the list (0 - 5)
862
+ * - subscribe_url_short string Our eepurl shortened version of this list's subscribe form (will not change)
863
+ * - subscribe_url_long string The full version of this list's subscribe form (host will vary)
864
+ * - beamer_address string The email address to use for this list's <a href="http://kb.mailchimp.com/article/how-do-i-import-a-campaign-via-email-email-beamer/">Email Beamer</a>
865
+ * - visibility string Whether this list is Public (pub) or Private (prv). Used internally for projects like <a href="http://blog.mailchimp.com/introducing-wavelength/" target="_blank">Wavelength</a>
866
+ * - stats associative_array various stats and counts for the list - many of these are cached for at least 5 minutes
867
+ * - member_count double The number of active members in the given list.
868
+ * - unsubscribe_count double The number of members who have unsubscribed from the given list.
869
+ * - cleaned_count double The number of members cleaned from the given list.
870
+ * - member_count_since_send double The number of active members in the given list since the last campaign was sent
871
+ * - unsubscribe_count_since_send double The number of members who have unsubscribed from the given list since the last campaign was sent
872
+ * - cleaned_count_since_send double The number of members cleaned from the given list since the last campaign was sent
873
+ * - campaign_count double The number of campaigns in any status that use this list
874
+ * - grouping_count double The number of Interest Groupings for this list
875
+ * - group_count double The number of Interest Groups (regardless of grouping) for this list
876
+ * - merge_var_count double The number of merge vars for this list (not including the required EMAIL one)
877
+ * - avg_sub_rate double the average number of subscribe per month for the list (empty value if we haven't calculated this yet)
878
+ * - avg_unsub_rate double the average number of unsubscribe per month for the list (empty value if we haven't calculated this yet)
879
+ * - target_sub_rate double the target subscription rate for the list to keep it growing (empty value if we haven't calculated this yet)
880
+ * - open_rate double the average open rate per campaign for the list (empty value if we haven't calculated this yet)
881
+ * - click_rate double the average click rate per campaign for the list (empty value if we haven't calculated this yet)
882
+ * - modules array Any list specific modules installed for this list (example is SocialPro)
883
+ * - errors array structs of any errors found while loading lists - usually just from providing invalid list ids
884
+ * - param string the data that caused the failure
885
+ * - code int the error code
886
+ * - error int the error message
887
+ */
888
+ public function getList($filters=array(), $start=0, $limit=25, $sort_field='created', $sort_dir='DESC') {
889
+ $_params = array("filters" => $filters, "start" => $start, "limit" => $limit, "sort_field" => $sort_field, "sort_dir" => $sort_dir);
890
+ return $this->master->call('lists/list', $_params);
891
+ }
892
+
893
+ }
894
+
895
+
Mailchimp/Mobile.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mailchimp_Mobile {
4
+ public function __construct(wpyksMCAPI $master) {
5
+ $this->master = $master;
6
+ }
7
+
8
+ }
9
+
10
+
Mailchimp/Neapolitan.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mailchimp_Neapolitan {
4
+ public function __construct(wpyksMCAPI $master) {
5
+ $this->master = $master;
6
+ }
7
+
8
+ }
9
+
10
+
Mailchimp/Reports.php ADDED
@@ -0,0 +1,459 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mailchimp_Reports {
4
+ public function __construct(wpyksMCAPI $master) {
5
+ $this->master = $master;
6
+ }
7
+
8
+ /**
9
+ * Get all email addresses that complained about a given campaign
10
+ * @param string $cid
11
+ * @param associative_array $opts
12
+ * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
13
+ * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
14
+ * - since string optional pull only messages since this time - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00"
15
+ * @return associative_array abuse report data for this campaign
16
+ * - total int the total reports matched
17
+ * - data array a struct for the each report, including:
18
+ * - date string date/time the abuse report was received and processed
19
+ * - member string the email address that reported abuse - will only contain email if the list or member has been removed
20
+ * - type string an internal type generally specifying the originating mail provider - may not be useful outside of filling report views
21
+ */
22
+ public function abuse($cid, $opts=array()) {
23
+ $_params = array("cid" => $cid, "opts" => $opts);
24
+ return $this->master->call('reports/abuse', $_params);
25
+ }
26
+
27
+ /**
28
+ * Retrieve the text presented in our app for how a campaign performed and any advice we may have for you - best
29
+ suited for display in customized reports pages. Note: some messages will contain HTML - clean tags as necessary
30
+ * @param string $cid
31
+ * @return array of structs for advice on the campaign's performance, each containing:
32
+ * - msg string the advice message
33
+ * - type string the "type" of the message. one of: negative, positive, or neutral
34
+ */
35
+ public function advice($cid) {
36
+ $_params = array("cid" => $cid);
37
+ return $this->master->call('reports/advice', $_params);
38
+ }
39
+
40
+ /**
41
+ * Retrieve the most recent full bounce message for a specific email address on the given campaign.
42
+ Messages over 30 days old are subject to being removed
43
+ * @param string $cid
44
+ * @param associative_array $email
45
+ * - email string an email address - this is recommended for this method
46
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
47
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
48
+ * @return associative_array the full bounce message for this email+campaign along with some extra data.
49
+ * - date string date the bounce was received and processed
50
+ * - member associative_array the member record as returned by lists/member-info()
51
+ * - message string the entire bounce message received
52
+ */
53
+ public function bounceMessage($cid, $email) {
54
+ $_params = array("cid" => $cid, "email" => $email);
55
+ return $this->master->call('reports/bounce-message', $_params);
56
+ }
57
+
58
+ /**
59
+ * Retrieve the full bounce messages for the given campaign. Note that this can return very large amounts
60
+ of data depending on how large the campaign was and how much cruft the bounce provider returned. Also,
61
+ messages over 30 days old are subject to being removed
62
+ * @param string $cid
63
+ * @param associative_array $opts
64
+ * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
65
+ * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
66
+ * - since string optional pull only messages since this time - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00"
67
+ * @return associative_array data for the full bounce messages for this campaign
68
+ * - total int that total number of bounce messages for the campaign
69
+ * - data array structs containing the data for this page
70
+ * - date string date the bounce was received and processed
71
+ * - member associative_array the member record as returned by lists/member-info()
72
+ * - message string the entire bounce message received
73
+ */
74
+ public function bounceMessages($cid, $opts=array()) {
75
+ $_params = array("cid" => $cid, "opts" => $opts);
76
+ return $this->master->call('reports/bounce-messages', $_params);
77
+ }
78
+
79
+ /**
80
+ * Return the list of email addresses that clicked on a given url, and how many times they clicked
81
+ * @param string $cid
82
+ * @param int $tid
83
+ * @param associative_array $opts
84
+ * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
85
+ * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
86
+ * - sort_field string optional the data to sort by - "clicked" (order clicks occurred, default) or "clicks" (total number of opens). Invalid fields will fall back on the default.
87
+ * - sort_dir string optional the direct - ASC or DESC. defaults to ASC (case insensitive)
88
+ * @return associative_array containing the total records matched and the specific records for this page
89
+ * - total int the total number of records matched
90
+ * - data array structs for each email addresses that click the requested url
91
+ * - member associative_array the member record as returned by lists/member-info()
92
+ * - clicks int Total number of times the URL was clicked by this email address
93
+ */
94
+ public function clickDetail($cid, $tid, $opts=array()) {
95
+ $_params = array("cid" => $cid, "tid" => $tid, "opts" => $opts);
96
+ return $this->master->call('reports/click-detail', $_params);
97
+ }
98
+
99
+ /**
100
+ * The urls tracked and their click counts for a given campaign.
101
+ * @param string $cid
102
+ * @return associative_array including:
103
+ * - total array structs for each url tracked for the full campaign
104
+ * - url string the url being tracked - urls are tracked individually, so duplicates can exist with vastly different stats
105
+ * - clicks int Number of times the specific link was clicked
106
+ * - clicks_percent double the percentage of total clicks "clicks" represents
107
+ * - unique int Number of unique people who clicked on the specific link
108
+ * - unique_percent double the percentage of unique clicks "unique" represents
109
+ * - tid int the tracking id used in campaign links - used primarily for reports/click-activity. also can be used to order urls by the order they appeared in the campaign to recreate our heat map.
110
+ * - a array if this was an absplit campaign, stat structs for the a group
111
+ * - url string the url being tracked - urls are tracked individually, so duplicates can exist with vastly different stats
112
+ * - clicks int Number of times the specific link was clicked
113
+ * - clicks_percent double the percentage of total clicks "clicks" represents
114
+ * - unique int Number of unique people who clicked on the specific link
115
+ * - unique_percent double the percentage of unique clicks "unique" represents
116
+ * - tid int the tracking id used in campaign links - used primarily for reports/click-activity. also can be used to order urls by the order they appeared in the campaign to recreate our heat map.
117
+ * - b array if this was an absplit campaign, stat structs for the b group
118
+ * - url string the url being tracked - urls are tracked individually, so duplicates can exist with vastly different stats
119
+ * - clicks int Number of times the specific link was clicked
120
+ * - clicks_percent double the percentage of total clicks "clicks" represents
121
+ * - unique int Number of unique people who clicked on the specific link
122
+ * - unique_percent double the percentage of unique clicks "unique" represents
123
+ * - tid int the tracking id used in campaign links - used primarily for reports/click-activity. also can be used to order urls by the order they appeared in the campaign to recreate our heat map.
124
+ */
125
+ public function clicks($cid) {
126
+ $_params = array("cid" => $cid);
127
+ return $this->master->call('reports/clicks', $_params);
128
+ }
129
+
130
+ /**
131
+ * Retrieve the Ecommerce Orders tracked by ecomm/order-add()
132
+ * @param string $cid
133
+ * @param associative_array $opts
134
+ * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
135
+ * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
136
+ * - since string optional pull only messages since this time - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00"
137
+ * @return associative_array the total matching orders and the specific orders for the requested page
138
+ * - total int the total matching orders
139
+ * - data array structs for the actual data for each order being returned
140
+ * - store_id string the store id generated by the plugin used to uniquely identify a store
141
+ * - store_name string the store name collected by the plugin - often the domain name
142
+ * - order_id string the internal order id the store tracked this order by
143
+ * - member associative_array the member record as returned by lists/member-info() that received this campaign and is associated with this order
144
+ * - order_total double the order total
145
+ * - tax_total double the total tax for the order (if collected)
146
+ * - ship_total double the shipping total for the order (if collected)
147
+ * - order_date string the date the order was tracked - from the store if possible, otherwise the GMT time we received it
148
+ * - lines array structs containing details of the order:
149
+ * - line_num int the line number assigned to this line
150
+ * - product_id int the product id assigned to this item
151
+ * - product_name string the product name
152
+ * - product_sku string the sku for the product
153
+ * - product_category_id int the id for the product category
154
+ * - product_category_name string the product category name
155
+ * - qty double optional the quantity of the item ordered - defaults to 1
156
+ * - cost double optional the cost of a single item (ie, not the extended cost of the line) - defaults to 0
157
+ */
158
+ public function ecommOrders($cid, $opts=array()) {
159
+ $_params = array("cid" => $cid, "opts" => $opts);
160
+ return $this->master->call('reports/ecomm-orders', $_params);
161
+ }
162
+
163
+ /**
164
+ * Retrieve the eepurl stats from the web/Twitter mentions for this campaign
165
+ * @param string $cid
166
+ * @return associative_array containing tweets, retweets, clicks, and referrer related to using the campaign's eepurl
167
+ * - twitter associative_array various Twitter related stats
168
+ * - tweets int Total number of tweets seen
169
+ * - first_tweet string date and time of the first tweet seen
170
+ * - last_tweet string date and time of the last tweet seen
171
+ * - retweets int Total number of retweets seen
172
+ * - first_retweet string date and time of the first retweet seen
173
+ * - last_retweet string date and time of the last retweet seen
174
+ * - statuses array an structs for statuses recorded including:
175
+ * - status string the text of the tweet/update
176
+ * - screen_name string the screen name as recorded when first seen
177
+ * - status_id string the status id of the tweet (they are really unsigned 64 bit ints)
178
+ * - datetime string the date/time of the tweet
179
+ * - is_retweet bool whether or not this was a retweet
180
+ * - clicks associative_array stats related to click-throughs on the eepurl
181
+ * - clicks int Total number of clicks seen
182
+ * - first_click string date and time of the first click seen
183
+ * - last_click string date and time of the first click seen
184
+ * - locations array structs for geographic locations including:
185
+ * - country string the country name the click was tracked to
186
+ * - region string the region in the country the click was tracked to (if available)
187
+ * - referrers array structs for referrers, including
188
+ * - referrer string the referrer, truncated to 100 bytes
189
+ * - clicks int Total number of clicks seen from this referrer
190
+ * - first_click string date and time of the first click seen from this referrer
191
+ * - last_click string date and time of the first click seen from this referrer
192
+ */
193
+ public function eepurl($cid) {
194
+ $_params = array("cid" => $cid);
195
+ return $this->master->call('reports/eepurl', $_params);
196
+ }
197
+
198
+ /**
199
+ * Given a campaign and email address, return the entire click and open history with timestamps, ordered by time. If you need to dump the full activity for a campaign
200
+ and/or get incremental results, you should use the <a href="http://apidocs.mailchimp.com/export/1.0/campaignsubscriberactivity.func.php" targret="_new">campaignSubscriberActivity Export API method</a>,
201
+ <strong>not</strong> this, especially for large campaigns.
202
+ * @param string $cid
203
+ * @param array $emails
204
+ * - email string an email address
205
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
206
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
207
+ * @return associative_array of data and success/error counts
208
+ * - success_count int the number of subscribers successfully found on the list
209
+ * - error_count int the number of subscribers who were not found on the list
210
+ * - errors array array of error structs including:
211
+ * - email string whatever was passed in the email parameter
212
+ * - email string the email address added
213
+ * - euid string the email unique id
214
+ * - leid string the list member's truly unique id
215
+ * - msg string the error message
216
+ * - data array an array of structs where each activity record has:
217
+ * - email string whatever was passed in the email parameter
218
+ * - email string the email address added
219
+ * - euid string the email unique id
220
+ * - leid string the list member's truly unique id
221
+ * - member associative_array the member record as returned by lists/member-info()
222
+ * - activity array an array of structs containing the activity, including:
223
+ * - action string The action name - either open or click
224
+ * - timestamp string The date/time of the action (GMT)
225
+ * - url string For click actions, the url clicked, otherwise this is empty
226
+ * - ip string The IP address the activity came from
227
+ */
228
+ public function memberActivity($cid, $emails) {
229
+ $_params = array("cid" => $cid, "emails" => $emails);
230
+ return $this->master->call('reports/member-activity', $_params);
231
+ }
232
+
233
+ /**
234
+ * Retrieve the list of email addresses that did not open a given campaign
235
+ * @param string $cid
236
+ * @param associative_array $opts
237
+ * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
238
+ * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
239
+ * @return associative_array a total of all matching emails and the specific emails for this page
240
+ * - total int the total number of members who didn't open the campaign
241
+ * - data array structs for each campaign member matching as returned by lists/member-info()
242
+ */
243
+ public function notOpened($cid, $opts=array()) {
244
+ $_params = array("cid" => $cid, "opts" => $opts);
245
+ return $this->master->call('reports/not-opened', $_params);
246
+ }
247
+
248
+ /**
249
+ * Retrieve the list of email addresses that opened a given campaign with how many times they opened
250
+ * @param string $cid
251
+ * @param associative_array $opts
252
+ * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
253
+ * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
254
+ * - sort_field string optional the data to sort by - "opened" (order opens occurred, default) or "opens" (total number of opens). Invalid fields will fall back on the default.
255
+ * - sort_dir string optional the direct - ASC or DESC. defaults to ASC (case insensitive)
256
+ * @return associative_array containing the total records matched and the specific records for this page
257
+ * - total int the total number of records matched
258
+ * - data array structs for the actual opens data, including:
259
+ * - member associative_array the member record as returned by lists/member-info()
260
+ * - opens int Total number of times the campaign was opened by this email address
261
+ */
262
+ public function opened($cid, $opts=array()) {
263
+ $_params = array("cid" => $cid, "opts" => $opts);
264
+ return $this->master->call('reports/opened', $_params);
265
+ }
266
+
267
+ /**
268
+ * Get the top 5 performing email domains for this campaign. Users wanting more than 5 should use campaign reports/member-activity()
269
+ or campaignEmailStatsAIMAll() and generate any additional stats they require.
270
+ * @param string $cid
271
+ * @return array domains structs for each email domains and their associated stats
272
+ * - domain string Domain name or special "Other" to roll-up stats past 5 domains
273
+ * - total_sent int Total Email across all domains - this will be the same in every row
274
+ * - emails int Number of emails sent to this domain
275
+ * - bounces int Number of bounces
276
+ * - opens int Number of opens
277
+ * - clicks int Number of clicks
278
+ * - unsubs int Number of unsubs
279
+ * - delivered int Number of deliveries
280
+ * - emails_pct int Percentage of emails that went to this domain (whole number)
281
+ * - bounces_pct int Percentage of bounces from this domain (whole number)
282
+ * - opens_pct int Percentage of opens from this domain (whole number)
283
+ * - clicks_pct int Percentage of clicks from this domain (whole number)
284
+ * - unsubs_pct int Percentage of unsubs from this domain (whole number)
285
+ */
286
+ public function domainPerformance($cid) {
287
+ $_params = array("cid" => $cid);
288
+ return $this->master->call('reports/domain-performance', $_params);
289
+ }
290
+
291
+ /**
292
+ * Retrieve the countries/regions and number of opens tracked for each. Email address are not returned.
293
+ * @param string $cid
294
+ * @return array an array of country structs where opens occurred
295
+ * - code string The ISO3166 2 digit country code
296
+ * - name string A version of the country name, if we have it
297
+ * - opens int The total number of opens that occurred in the country
298
+ * - regions array structs of data for each sub-region in the country
299
+ * - code string An internal code for the region. When this is blank, it indicates we know the country, but not the region
300
+ * - name string The name of the region, if we have one. For blank "code" values, this will be "Rest of Country"
301
+ * - opens int The total number of opens that occurred in the country
302
+ */
303
+ public function geoOpens($cid) {
304
+ $_params = array("cid" => $cid);
305
+ return $this->master->call('reports/geo-opens', $_params);
306
+ }
307
+
308
+ /**
309
+ * Retrieve the Google Analytics data we've collected for this campaign. Note, requires Google Analytics Add-on to be installed and configured.
310
+ * @param string $cid
311
+ * @return array of structs for analytics we've collected for the passed campaign.
312
+ * - visits int number of visits
313
+ * - pages int number of page views
314
+ * - new_visits int new visits recorded
315
+ * - bounces int vistors who "bounced" from your site
316
+ * - time_on_site double the total time visitors spent on your sites
317
+ * - goal_conversions int number of goals converted
318
+ * - goal_value double value of conversion in dollars
319
+ * - revenue double revenue generated by campaign
320
+ * - transactions int number of transactions tracked
321
+ * - ecomm_conversions int number Ecommerce transactions tracked
322
+ * - goals array structs containing goal names and number of conversions
323
+ * - name string the name of the goal
324
+ * - conversions int the number of conversions for the goal
325
+ */
326
+ public function googleAnalytics($cid) {
327
+ $_params = array("cid" => $cid);
328
+ return $this->master->call('reports/google-analytics', $_params);
329
+ }
330
+
331
+ /**
332
+ * Get email addresses the campaign was sent to
333
+ * @param string $cid
334
+ * @param associative_array $opts
335
+ * - status string optional the status to pull - one of 'sent', 'hard' (bounce), or 'soft' (bounce). By default, all records are returned
336
+ * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
337
+ * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
338
+ * @return associative_array a total of all matching emails and the specific emails for this page
339
+ * - total int the total number of members for the campaign and status
340
+ * - data array structs for each campaign member matching
341
+ * - member associative_array the member record as returned by lists/member-info()
342
+ * - status string the status of the send - one of 'sent', 'hard', 'soft'
343
+ * - absplit_group string if this was an absplit campaign, one of 'a','b', or 'winner'
344
+ * - tz_group string if this was an timewarp campaign the timezone GMT offset the member was included in
345
+ */
346
+ public function sentTo($cid, $opts=array()) {
347
+ $_params = array("cid" => $cid, "opts" => $opts);
348
+ return $this->master->call('reports/sent-to', $_params);
349
+ }
350
+
351
+ /**
352
+ * Get the URL to a customized <a href="http://eepurl.com/gKmL" target="_blank">VIP Report</a> for the specified campaign and optionally send an email to someone with links to it. Note subsequent calls will overwrite anything already set for the same campign (eg, the password)
353
+ * @param string $cid
354
+ * @param array $opts
355
+ * - to_email string optional - optional, comma delimited list of email addresses to share the report with - no value means an email will not be sent
356
+ * - theme_id int optional - either a global or a user-specific theme id. Currently this needs to be pulled out of either the Share Report or Cobranding web views by grabbing the "theme" attribute from the list presented.
357
+ * - css_url string optional - a link to an external CSS file to be included after our default CSS (http://vip-reports.net/css/vip.css) <strong>only if</strong> loaded via the "secure_url" - max 255 bytes
358
+ * @return associative_array details for the shared report, including:
359
+ * - title string The Title of the Campaign being shared
360
+ * - url string The URL to the shared report
361
+ * - secure_url string The URL to the shared report, including the password (good for loading in an IFRAME). For non-secure reports, this will not be returned
362
+ * - password string If secured, the password for the report, otherwise this field will not be returned
363
+ */
364
+ public function share($cid, $opts=array()) {
365
+ $_params = array("cid" => $cid, "opts" => $opts);
366
+ return $this->master->call('reports/share', $_params);
367
+ }
368
+
369
+ /**
370
+ * Retrieve relevant aggregate campaign statistics (opens, bounces, clicks, etc.)
371
+ * @param string $cid
372
+ * @return associative_array the statistics for this campaign
373
+ * - syntax_errors int Number of email addresses in campaign that had syntactical errors.
374
+ * - hard_bounces int Number of email addresses in campaign that hard bounced.
375
+ * - soft_bounces int Number of email addresses in campaign that soft bounced.
376
+ * - unsubscribes int Number of email addresses in campaign that unsubscribed.
377
+ * - abuse_reports int Number of email addresses in campaign that reported campaign for abuse.
378
+ * - forwards int Number of times email was forwarded to a friend.
379
+ * - forwards_opens int Number of times a forwarded email was opened.
380
+ * - opens int Number of times the campaign was opened.
381
+ * - last_open string Date of the last time the email was opened.
382
+ * - unique_opens int Number of people who opened the campaign.
383
+ * - clicks int Number of times a link in the campaign was clicked.
384
+ * - unique_clicks int Number of unique recipient/click pairs for the campaign.
385
+ * - last_click string Date of the last time a link in the email was clicked.
386
+ * - users_who_clicked int Number of unique recipients who clicked on a link in the campaign.
387
+ * - emails_sent int Number of email addresses campaign was sent to.
388
+ * - unique_likes int total number of unique likes (Facebook)
389
+ * - recipient_likes int total number of recipients who liked (Facebook) the campaign
390
+ * - facebook_likes int total number of likes (Facebook) that came from Facebook
391
+ * - industry associative_array Various rates/percentages for the account's selected industry - empty otherwise. These will vary across calls, do not use them for anything important.
392
+ * - type string the selected industry
393
+ * - open_rate float industry open rate
394
+ * - click_rate float industry click rate
395
+ * - bounce_rate float industry bounce rate
396
+ * - unopen_rate float industry unopen rate
397
+ * - unsub_rate float industry unsub rate
398
+ * - abuse_rate float industry abuse rate
399
+ * - absplit associative_array If this was an absplit campaign, stats for the A and B groups will be returned - otherwise this is empty
400
+ * - bounces_a int bounces for the A group
401
+ * - bounces_b int bounces for the B group
402
+ * - forwards_a int forwards for the A group
403
+ * - forwards_b int forwards for the B group
404
+ * - abuse_reports_a int abuse reports for the A group
405
+ * - abuse_reports_b int abuse reports for the B group
406
+ * - unsubs_a int unsubs for the A group
407
+ * - unsubs_b int unsubs for the B group
408
+ * - recipients_click_a int clicks for the A group
409
+ * - recipients_click_b int clicks for the B group
410
+ * - forwards_opens_a int opened forwards for the A group
411
+ * - forwards_opens_b int opened forwards for the B group
412
+ * - opens_a int total opens for the A group
413
+ * - opens_b int total opens for the B group
414
+ * - last_open_a string date/time of last open for the A group
415
+ * - last_open_b string date/time of last open for the BG group
416
+ * - unique_opens_a int unique opens for the A group
417
+ * - unique_opens_b int unique opens for the B group
418
+ * - timewarp array If this campaign was a Timewarp campaign, an array of structs from each timezone stats exist for. Each will contain:
419
+ * - opens int opens for this timezone
420
+ * - last_open string the date/time of the last open for this timezone
421
+ * - unique_opens int the unique opens for this timezone
422
+ * - clicks int the total clicks for this timezone
423
+ * - last_click string the date/time of the last click for this timezone
424
+ * - unique_opens int the unique clicks for this timezone
425
+ * - bounces int the total bounces for this timezone
426
+ * - total int the total number of members sent to in this timezone
427
+ * - sent int the total number of members delivered to in this timezone
428
+ * - timeseries array structs for the first 24 hours of the campaign, per-hour stats:
429
+ * - timestamp string The timestemp in Y-m-d H:00:00 format
430
+ * - emails_sent int the total emails sent during the hour
431
+ * - unique_opens int unique opens seen during the hour
432
+ * - recipients_click int unique clicks seen during the hour
433
+ */
434
+ public function summary($cid) {
435
+ $_params = array("cid" => $cid);
436
+ return $this->master->call('reports/summary', $_params);
437
+ }
438
+
439
+ /**
440
+ * Get all unsubscribed email addresses for a given campaign
441
+ * @param string $cid
442
+ * @param associative_array $opts
443
+ * - start int optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
444
+ * - limit int optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
445
+ * @return associative_array a total of all unsubscribed emails and the specific members for this page
446
+ * - total int the total number of unsubscribes for the campaign
447
+ * - data array structs for the email addresses that unsubscribed
448
+ * - member string the member that unsubscribed as returned by lists/member-info()
449
+ * - reason string the reason collected for the unsubscribe. If populated, one of 'NORMAL','NOSIGNUP','INAPPROPRIATE','SPAM','OTHER'
450
+ * - reason_text string if the reason is OTHER, the text entered.
451
+ */
452
+ public function unsubscribes($cid, $opts=array()) {
453
+ $_params = array("cid" => $cid, "opts" => $opts);
454
+ return $this->master->call('reports/unsubscribes', $_params);
455
+ }
456
+
457
+ }
458
+
459
+
Mailchimp/Templates.php ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mailchimp_Templates {
4
+ public function __construct(wpyksMCAPI $master) {
5
+ $this->master = $master;
6
+ }
7
+
8
+ /**
9
+ * Create a new user template, <strong>NOT</strong> campaign content. These templates can then be applied while creating campaigns.
10
+ * @param string $name
11
+ * @param string $html
12
+ * @param int $folder_id
13
+ * @return associative_array with a single element:
14
+ * - template_id int the new template id, otherwise an error is thrown.
15
+ */
16
+ public function add($name, $html, $folder_id=null) {
17
+ $_params = array("name" => $name, "html" => $html, "folder_id" => $folder_id);
18
+ return $this->master->call('templates/add', $_params);
19
+ }
20
+
21
+ /**
22
+ * Delete (deactivate) a user template
23
+ * @param int $template_id
24
+ * @return associative_array with a single entry:
25
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
26
+ */
27
+ public function del($template_id) {
28
+ $_params = array("template_id" => $template_id);
29
+ return $this->master->call('templates/del', $_params);
30
+ }
31
+
32
+ /**
33
+ * Pull details for a specific template to help support editing
34
+ * @param int $template_id
35
+ * @param string $type
36
+ * @return associative_array info to be used when editing
37
+ * - default_content associative_array the default content broken down into the named editable sections for the template - dependant upon template, so not documented
38
+ * - sections associative_array the valid editable section names - dependant upon template, so not documented
39
+ * - source string the full source of the template as if you exported it via our template editor
40
+ * - preview string similar to the source, but the rendered version of the source from our popup preview
41
+ */
42
+ public function info($template_id, $type='user') {
43
+ $_params = array("template_id" => $template_id, "type" => $type);
44
+ return $this->master->call('templates/info', $_params);
45
+ }
46
+
47
+ /**
48
+ * Retrieve various templates available in the system, allowing some thing similar to our template gallery to be created.
49
+ * @param associative_array $types
50
+ * - user boolean Custom templates for this user account. Defaults to true.
51
+ * - gallery boolean Templates from our Gallery. Note that some templates that require extra configuration are withheld. (eg, the Etsy template). Defaults to false.
52
+ * - base boolean Our "start from scratch" extremely basic templates. Defaults to false.
53
+ * @param associative_array $filters
54
+ * - category string optional for Gallery templates only, limit to a specific template category
55
+ * - folder_id string user templates, limit to this folder_id
56
+ * - include_inactive boolean user templates are not deleted, only set inactive. defaults to false.
57
+ * - inactive_only boolean only include inactive user templates. defaults to false.
58
+ * @return associative_array for each type
59
+ * - user array matching user templates, if requested.
60
+ * - id int Id of the template
61
+ * - name string Name of the template
62
+ * - layout string General description of the layout of the template
63
+ * - category string The category for the template, if there is one.
64
+ * - preview_image string If we've generated it, the url of the preview image for the template. We do out best to keep these up to date, but Preview image urls are not guaranteed to be available
65
+ * - date_created string The date/time the template was created
66
+ * - active boolean whether or not the template is active and available for use.
67
+ * - edit_source boolean Whether or not you are able to edit the source of a template.
68
+ * - folder_id boolean if it's in one, the folder id
69
+ * - gallery array matching gallery templates, if requested.
70
+ * - id int Id of the template
71
+ * - name string Name of the template
72
+ * - layout string General description of the layout of the template
73
+ * - category string The category for the template, if there is one.
74
+ * - preview_image string If we've generated it, the url of the preview image for the template. We do out best to keep these up to date, but Preview image urls are not guaranteed to be available
75
+ * - date_created string The date/time the template was created
76
+ * - active boolean whether or not the template is active and available for use.
77
+ * - edit_source boolean Whether or not you are able to edit the source of a template.
78
+ * - base array matching base templates, if requested.
79
+ * - id int Id of the template
80
+ * - name string Name of the template
81
+ * - layout string General description of the layout of the template
82
+ * - category string The category for the template, if there is one.
83
+ * - preview_image string If we've generated it, the url of the preview image for the template. We do out best to keep these up to date, but Preview image urls are not guaranteed to be available
84
+ * - active boolean whether or not the template is active and available for use.
85
+ * - date_created string The date/time the template was created
86
+ * - edit_source boolean Whether or not you are able to edit the source of a template.
87
+ */
88
+ public function getList($types=array(), $filters=array()) {
89
+ $_params = array("types" => $types, "filters" => $filters);
90
+ return $this->master->call('templates/list', $_params);
91
+ }
92
+
93
+ /**
94
+ * Undelete (reactivate) a user template
95
+ * @param int $template_id
96
+ * @return associative_array with a single entry:
97
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
98
+ */
99
+ public function undel($template_id) {
100
+ $_params = array("template_id" => $template_id);
101
+ return $this->master->call('templates/undel', $_params);
102
+ }
103
+
104
+ /**
105
+ * Replace the content of a user template, <strong>NOT</strong> campaign content.
106
+ * @param int $template_id
107
+ * @param associative_array $values
108
+ * - name string the name for the template - names must be unique and a max of 50 bytes
109
+ * - html string a string specifying the entire template to be created. This is <strong>NOT</strong> campaign content. They are intended to utilize our <a href="http://www.mailchimp.com/resources/email-template-language/" target="_blank">template language</a>.
110
+ * - folder_id int the folder to put this template in - 0 or a blank values will remove it from a folder.
111
+ * @return associative_array with a single entry:
112
+ * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
113
+ */
114
+ public function update($template_id, $values) {
115
+ $_params = array("template_id" => $template_id, "values" => $values);
116
+ return $this->master->call('templates/update', $_params);
117
+ }
118
+
119
+ }
120
+
121
+
Mailchimp/Users.php ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mailchimp_Users {
4
+ public function __construct(wpyksMCAPI $master) {
5
+ $this->master = $master;
6
+ }
7
+
8
+ /**
9
+ * Invite a user to your account
10
+ * @param string $email
11
+ * @param string $role
12
+ * @param string $msg
13
+ * @return associative_array the method completion status
14
+ * - status string The status (success) of the call if it completed. Otherwise an error is thrown.
15
+ */
16
+ public function invite($email, $role='viewer', $msg='') {
17
+ $_params = array("email" => $email, "role" => $role, "msg" => $msg);
18
+ return $this->master->call('users/invite', $_params);
19
+ }
20
+
21
+ /**
22
+ * Resend an invite a user to your account. Note, if the same address has been invited multiple times, this will simpy re-send the most recent invite
23
+ * @param string $email
24
+ * @return associative_array the method completion status
25
+ * - status string The status (success) of the call if it completed. Otherwise an error is thrown.
26
+ */
27
+ public function inviteResend($email) {
28
+ $_params = array("email" => $email);
29
+ return $this->master->call('users/invite-resend', $_params);
30
+ }
31
+
32
+ /**
33
+ * Revoke an invitation sent to a user to your account. Note, if the same address has been invited multiple times, this will simpy revoke the most recent invite
34
+ * @param string $email
35
+ * @return associative_array the method completion status
36
+ * - status string The status (success) of the call if it completed. Otherwise an error is thrown.
37
+ */
38
+ public function inviteRevoke($email) {
39
+ $_params = array("email" => $email);
40
+ return $this->master->call('users/invite-revoke', $_params);
41
+ }
42
+
43
+ /**
44
+ * Retrieve the list of pending users invitations have been sent for.
45
+ * @return array structs for each invitation, including:
46
+ * - email string the email address the invitation was sent to
47
+ * - role string the role that will be assigned if they accept
48
+ * - sent_at string the time the invitation was sent. this will change if it's resent.
49
+ * - expiration string the expiration time for the invitation. this will change if it's resent.
50
+ * - msg string the welcome message included with the invitation
51
+ */
52
+ public function invites() {
53
+ $_params = array();
54
+ return $this->master->call('users/invites', $_params);
55
+ }
56
+
57
+ /**
58
+ * Revoke access for a specified login
59
+ * @param string $username
60
+ * @return associative_array the method completion status
61
+ * - status string The status (success) of the call if it completed. Otherwise an error is thrown.
62
+ */
63
+ public function loginRevoke($username) {
64
+ $_params = array("username" => $username);
65
+ return $this->master->call('users/login-revoke', $_params);
66
+ }
67
+
68
+ /**
69
+ * Retrieve the list of active logins.
70
+ * @return array structs for each user, including:
71
+ * - id int the login id for this login
72
+ * - username string the username used to log in
73
+ * - name string a display name for the account - empty first/last names will return the username
74
+ * - email string the email tied to the account used for passwords resets and the ilk
75
+ * - role string the role assigned to the account
76
+ * - avatar string if available, the url for the login's avatar
77
+ */
78
+ public function logins() {
79
+ $_params = array();
80
+ return $this->master->call('users/logins', $_params);
81
+ }
82
+
83
+ /**
84
+ * Retrieve the profile for the login owning the provided API Key
85
+ * @return associative_array the current user's details, including:
86
+ * - id int the login id for this login
87
+ * - username string the username used to log in
88
+ * - name string a display name for the account - empty first/last names will return the username
89
+ * - email string the email tied to the account used for passwords resets and the ilk
90
+ * - role string the role assigned to the account
91
+ * - avatar string if available, the url for the login's avatar
92
+ */
93
+ public function profile() {
94
+ $_params = array();
95
+ return $this->master->call('users/profile', $_params);
96
+ }
97
+
98
+ }
99
+
100
+
Mailchimp/Vip.php ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mailchimp_Vip {
4
+ public function __construct(wpyksMCAPI $master) {
5
+ $this->master = $master;
6
+ }
7
+
8
+ /**
9
+ * Retrieve all Activity (opens/clicks) for VIPs over the past 10 days
10
+ * @return array structs for each activity recorded.
11
+ * - action string The action taken - either "open" or "click"
12
+ * - timestamp string The datetime the action occurred in GMT
13
+ * - url string IF the action is a click, the url that was clicked
14
+ * - unique_id string The campaign_id of the List the Member appears on
15
+ * - title string The campaign title
16
+ * - list_name string The name of the List the Member appears on
17
+ * - list_id string The id of the List the Member appears on
18
+ * - email string The email address of the member
19
+ * - fname string IF a FNAME merge field exists on the list, that value for the member
20
+ * - lname string IF a LNAME merge field exists on the list, that value for the member
21
+ * - member_rating int the rating of the subscriber. This will be 1 - 5 as described <a href="http://eepurl.com/f-2P" target="_blank">here</a>
22
+ * - member_since string the datetime the member was added and/or confirmed
23
+ * - geo associative_array the geographic information if we have it. including:
24
+ * - latitude string the latitude
25
+ * - longitude string the longitude
26
+ * - gmtoff string GMT offset
27
+ * - dstoff string GMT offset during daylight savings (if DST not observered, will be same as gmtoff
28
+ * - timezone string the timezone we've place them in
29
+ * - cc string 2 digit ISO-3166 country code
30
+ * - region string generally state, province, or similar
31
+ */
32
+ public function activity() {
33
+ $_params = array();
34
+ return $this->master->call('vip/activity', $_params);
35
+ }
36
+
37
+ /**
38
+ * Add VIPs (previously called Golden Monkeys)
39
+ * @param string $id
40
+ * @param array $emails
41
+ * - email string an email address - for new subscribers obviously this should be used
42
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
43
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
44
+ * @return associative_array of data and success/error counts
45
+ * - success_count int the number of successful adds
46
+ * - error_count int the number of unsuccessful adds
47
+ * - errors array array of error structs including:
48
+ * - email associative_array whatever was passed in the email parameter
49
+ * - email string the email address added
50
+ * - euid string the email unique id
51
+ * - leid string the list member's truly unique id
52
+ * - code string the error code
53
+ * - error string the error message
54
+ * - data array array of structs for each member added
55
+ * - email associative_array whatever was passed in the email parameter
56
+ * - email string the email address added
57
+ * - euid string the email unique id
58
+ * - leid string the list member's truly unique id
59
+ */
60
+ public function add($id, $emails) {
61
+ $_params = array("id" => $id, "emails" => $emails);
62
+ return $this->master->call('vip/add', $_params);
63
+ }
64
+
65
+ /**
66
+ * Remove VIPs - this does not affect list membership
67
+ * @param string $id
68
+ * @param array $emails
69
+ * - email string an email address - for new subscribers obviously this should be used
70
+ * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
71
+ * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes
72
+ * @return associative_array of data and success/error counts
73
+ * - success_count int the number of successful deletions
74
+ * - error_count int the number of unsuccessful deletions
75
+ * - errors array array of error structs including:
76
+ * - email associative_array whatever was passed in the email parameter
77
+ * - email string the email address
78
+ * - euid string the email unique id
79
+ * - leid string the list member's truly unique id
80
+ * - code string the error code
81
+ * - msg string the error message
82
+ * - data array array of structs for each member deleted
83
+ * - email associative_array whatever was passed in the email parameter
84
+ * - email string the email address
85
+ * - euid string the email unique id
86
+ * - leid string the list member's truly unique id
87
+ */
88
+ public function del($id, $emails) {
89
+ $_params = array("id" => $id, "emails" => $emails);
90
+ return $this->master->call('vip/del', $_params);
91
+ }
92
+
93
+ /**
94
+ * Retrieve all Golden Monkey(s) for an account
95
+ * @return array structs for each Golden Monkey, including:
96
+ * - list_id string The id of the List the Member appears on
97
+ * - list_name string The name of the List the Member appears on
98
+ * - email string The email address of the member
99
+ * - fname string IF a FNAME merge field exists on the list, that value for the member
100
+ * - lname string IF a LNAME merge field exists on the list, that value for the member
101
+ * - member_rating int the rating of the subscriber. This will be 1 - 5 as described <a href="http://eepurl.com/f-2P" target="_blank">here</a>
102
+ * - member_since string the datetime the member was added and/or confirmed
103
+ */
104
+ public function members() {
105
+ $_params = array();
106
+ return $this->master->call('vip/members', $_params);
107
+ }
108
+
109
+ }
110
+
111
+
classes/MCAPI.class.php DELETED
@@ -1,2487 +0,0 @@
1
- <?php
2
-
3
- if(!class_exists("wpyksMCAPI"))
4
- {
5
- class wpyksMCAPI {
6
- var $version = "1.3";
7
- var $errorMessage;
8
- var $errorCode;
9
-
10
- /**
11
- * Cache the information on the API location on the server
12
- */
13
- var $apiUrl;
14
-
15
- /**
16
- * Default to a 300 second timeout on server calls
17
- */
18
- var $timeout = 300;
19
-
20
- /**
21
- * Default to a 8K chunk size
22
- */
23
- var $chunkSize = 8192;
24
-
25
- /**
26
- * Cache the user api_key so we only have to log in once per client instantiation
27
- */
28
- var $api_key;
29
-
30
- /**
31
- * Cache the user api_key so we only have to log in once per client instantiation
32
- */
33
- var $secure = false;
34
-
35
- /**
36
- * Connect to the MailChimp API for a given list.
37
- *
38
- * @param string $apikey Your MailChimp apikey
39
- * @param string $secure Whether or not this should use a secure connection
40
- */
41
- function wpyksMCAPI($apikey, $secure=false) {
42
- $this->secure = $secure;
43
- $this->apiUrl = parse_url("http://api.mailchimp.com/" . $this->version . "/?output=php");
44
- $this->api_key = $apikey;
45
- }
46
- function setTimeout($seconds){
47
- if (is_int($seconds)){
48
- $this->timeout = $seconds;
49
- return true;
50
- }
51
- }
52
- function getTimeout(){
53
- return $this->timeout;
54
- }
55
- function useSecure($val){
56
- if ($val===true){
57
- $this->secure = true;
58
- } else {
59
- $this->secure = false;
60
- }
61
- }
62
-
63
- /**
64
- * Unschedule a campaign that is scheduled to be sent in the future
65
- *
66
- * @section Campaign Related
67
- * @example mcapi_campaignUnschedule.php
68
- * @example xml-rpc_campaignUnschedule.php
69
- *
70
- * @param string $cid the id of the campaign to unschedule
71
- * @return boolean true on success
72
- */
73
- function campaignUnschedule($cid) {
74
- $params = array();
75
- $params["cid"] = $cid;
76
- return $this->callServer("campaignUnschedule", $params);
77
- }
78
-
79
- /**
80
- * Schedule a campaign to be sent in the future
81
- *
82
- * @section Campaign Related
83
- * @example mcapi_campaignSchedule.php
84
- * @example xml-rpc_campaignSchedule.php
85
- *
86
- * @param string $cid the id of the campaign to schedule
87
- * @param string $schedule_time the time to schedule the campaign. For A/B Split "schedule" campaigns, the time for Group A - in YYYY-MM-DD HH:II:SS format in <strong>GMT</strong>
88
- * @param string $schedule_time_b optional -the time to schedule Group B of an A/B Split "schedule" campaign - in YYYY-MM-DD HH:II:SS format in <strong>GMT</strong>
89
- * @return boolean true on success
90
- */
91
- function campaignSchedule($cid, $schedule_time, $schedule_time_b=NULL) {
92
- $params = array();
93
- $params["cid"] = $cid;
94
- $params["schedule_time"] = $schedule_time;
95
- $params["schedule_time_b"] = $schedule_time_b;
96
- return $this->callServer("campaignSchedule", $params);
97
- }
98
-
99
- /**
100
- * Resume sending an AutoResponder or RSS campaign
101
- *
102
- * @section Campaign Related
103
- *
104
- * @param string $cid the id of the campaign to pause
105
- * @return boolean true on success
106
- */
107
- function campaignResume($cid) {
108
- $params = array();
109
- $params["cid"] = $cid;
110
- return $this->callServer("campaignResume", $params);
111
- }
112
-
113
- /**
114
- * Pause an AutoResponder orRSS campaign from sending
115
- *
116
- * @section Campaign Related
117
- *
118
- * @param string $cid the id of the campaign to pause
119
- * @return boolean true on success
120
- */
121
- function campaignPause($cid) {
122
- $params = array();
123
- $params["cid"] = $cid;
124
- return $this->callServer("campaignPause", $params);
125
- }
126
-
127
- /**
128
- * Send a given campaign immediately. For RSS campaigns, this will "start" them.
129
- *
130
- * @section Campaign Related
131
- *
132
- * @example mcapi_campaignSendNow.php
133
- * @example xml-rpc_campaignSendNow.php
134
- *
135
- * @param string $cid the id of the campaign to send
136
- * @return boolean true on success
137
- */
138
- function campaignSendNow($cid) {
139
- $params = array();
140
- $params["cid"] = $cid;
141
- return $this->callServer("campaignSendNow", $params);
142
- }
143
-
144
- /**
145
- * Send a test of this campaign to the provided email address
146
- *
147
- * @section Campaign Related
148
- *
149
- * @example mcapi_campaignSendTest.php
150
- * @example xml-rpc_campaignSendTest.php
151
- *
152
- * @param string $cid the id of the campaign to test
153
- * @param array $test_emails an array of email address to receive the test message
154
- * @param string $send_type optional by default (null) both formats are sent - "html" or "text" send just that format
155
- * @return boolean true on success
156
- */
157
- function campaignSendTest($cid, $test_emails=array (
158
- ), $send_type=NULL) {
159
- $params = array();
160
- $params["cid"] = $cid;
161
- $params["test_emails"] = $test_emails;
162
- $params["send_type"] = $send_type;
163
- return $this->callServer("campaignSendTest", $params);
164
- }
165
-
166
- /**
167
- * Allows one to test their segmentation rules before creating a campaign using them
168
- *
169
- * @section Campaign Related
170
- * @example mcapi_campaignSegmentTest.php
171
- * @example xml-rpc_campaignSegmentTest.php
172
- *
173
- * @param string $list_id the list to test segmentation on - get lists using lists()
174
- * @param array $options with 2 keys:
175
- string "match" controls whether to use AND or OR when applying your options - expects "<strong>any</strong>" (for OR) or "<strong>all</strong>" (for AND)
176
- array "conditions" - up to 10 different criteria to apply while segmenting. Each criteria row must contain 3 keys - "<strong>field</strong>", "<strong>op</strong>", and "<strong>value</strong>" - and possibly a fourth, "<strong>extra</strong>", based on these definitions:
177
-
178
- Field = "<strong>date</strong>" : Select based on signup date
179
- Valid Op(eration): <strong>eq</strong> (is) / <strong>gt</strong> (after) / <strong>lt</strong> (before)
180
- Valid Values:
181
- string last_campaign_sent uses the date of the last campaign sent
182
- string campaign_id - uses the send date of the campaign that carriers the Id submitted - see campaigns()
183
- string YYYY-MM-DD - any date in the form of YYYY-MM-DD - <em>note:</em> anything that appears to start with YYYY will be treated as a date
184
-
185
- Field = "<strong>interests-X</strong>": where X is the Grouping Id from listInterestGroupings()
186
- Valid Op(erations): <strong>one</strong> / <strong>none</strong> / <strong>all</strong>
187
- Valid Values: a comma delimited of interest groups for the list - see listInterestGroupings()
188
-
189
- Field = "<strong>aim</strong>"
190
- Valid Op(erations): <strong>open</strong> / <strong>noopen</strong> / <strong>click</strong> / <strong>noclick</strong>
191
- Valid Values: "<strong>any</strong>" or a valid AIM-enabled Campaign that has been sent
192
-
193
- Field = "<strong>rating</strong>" : allows matching based on list member ratings
194
- Valid Op(erations): <strong>eq</strong> (=) / <strong>ne</strong> (!=) / <strong>gt</strong> (&gt;) / <strong>lt</strong> (&lt;)
195
- Valid Values: a number between 0 and 5
196
-
197
- Field = "<strong>ecomm_prod</strong>" or "<strong>ecomm_prod</strong>": allows matching product and category names from purchases
198
- Valid Op(erations):
199
- <strong>eq</strong> (=) / <strong>ne</strong> (!=) / <strong>gt</strong> (&gt;) / <strong>lt</strong> (&lt;) / <strong>like</strong> (like '%blah%') / <strong>nlike</strong> (not like '%blah%') / <strong>starts</strong> (like 'blah%') / <strong>ends</strong> (like '%blah')
200
- Valid Values: any string
201
-
202
- Field = "<strong>ecomm_spent_one</strong>" or "<strong>ecomm_spent_all</strong>" : allows matching purchase amounts on a single order or all orders
203
- Valid Op(erations): <strong>gt</strong> (&gt;) / <strong>lt</strong> (&lt;)
204
- Valid Values: a number
205
-
206
- Field = "<strong>ecomm_date</strong>" : allow matching based on order dates
207
- Valid Op(eration): <strong>eq</strong> (is) / <strong>gt</strong> (after) / <strong>lt</strong> (before)
208
- Valid Values:
209
- string YYYY-MM-DD - any date in the form of YYYY-MM-DD
210
-
211
- Field = "<strong>social_gender</strong>" : allows matching against the gender acquired from SocialPro
212
- Valid Op(eration): <strong>eq</strong> (is) / <strong>ne</strong> (is not)
213
- Valid Values: male, female
214
-
215
- Field = "<strong>social_age</strong>" : allows matching against the age acquired from SocialPro
216
- Valid Op(erations): <strong>eq</strong> (=) / <strong>ne</strong> (!=) / <strong>gt</strong> (&gt;) / <strong>lt</strong> (&lt;)
217
- Valid Values: any number
218
-
219
- Field = "<strong>social_influence</strong>" : allows matching against the influence acquired from SocialPro
220
- Valid Op(erations): <strong>eq</strong> (=) / <strong>ne</strong> (!=) / <strong>gt</strong> (&gt;) / <strong>lt</strong> (&lt;)
221
- Valid Values: a number between 0 and 5
222
-
223
- Field = "<strong>social_network</strong>" :
224
- Valid Op(erations): <strong>member</strong> (is a member of) / <strong>notmember</strong> (is not a member of)
225
- Valid Values: twitter, facebook, myspace, linkedin, flickr
226
-
227
- Field = "<strong>static_segment</strong>" :
228
- Valid Op(eration): <strong>eq</strong> (is in) / <strong>ne</strong> (is not in)
229
- Valid Values: an int - get from listStaticSegments()
230
-
231
- Field = An <strong>Address</strong> Merge Var. Use <strong>Merge0-Merge30</strong> or the <strong>Custom Tag</strong> you've setup for your merge field - see listMergeVars(). Note, Address fields can still be used with the default operations below - this section is broken out solely to highlight the differences in using the geolocation routines.
232
- Valid Op(erations): <strong>geoin</strong>
233
- Valid Values: The number of miles an address should be within
234
- Extra Value: The Zip Code to be used as the center point
235
-
236
- Default Field = A Merge Var. Use <strong>Merge0-Merge30</strong> or the <strong>Custom Tag</strong> you've setup for your merge field - see listMergeVars()
237
- Valid Op(erations):
238
- <strong>eq</strong> (=) / <strong>ne</strong> (!=) / <strong>gt</strong> (&gt;) / <strong>lt</strong> (&lt;) / <strong>like</strong> (like '%blah%') / <strong>nlike</strong> (not like '%blah%') / <strong>starts</strong> (like 'blah%') / <strong>ends</strong> (like '%blah')
239
- Valid Values: any string
240
- * @return int total The total number of subscribers matching your segmentation options
241
- */
242
- function campaignSegmentTest($list_id, $options) {
243
- $params = array();
244
- $params["list_id"] = $list_id;
245
- $params["options"] = $options;
246
- return $this->callServer("campaignSegmentTest", $params);
247
- }
248
-
249
- /**
250
- * Create a new draft campaign to send. You <strong>can not</strong> have more than 32,000 campaigns in your account.
251
- *
252
- * @section Campaign Related
253
- * @example mcapi_campaignCreate.php
254
- * @example xml-rpc_campaignCreate.php
255
- * @example xml-rpc_campaignCreateABSplit.php
256
- * @example xml-rpc_campaignCreateRss.php
257
- *
258
- * @param string $type the Campaign Type to create - one of "regular", "plaintext", "absplit", "rss", "trans", "auto"
259
- * @param array $options a hash of the standard options for this campaign :
260
- string list_id the list to send this campaign to- get lists using lists()
261
- string subject the subject line for your campaign message
262
- string from_email the From: email address for your campaign message
263
- string from_name the From: name for your campaign message (not an email address)
264
- string to_name the To: name recipients will see (not email address)
265
- int template_id optional - use this user-created template to generate the HTML content of the campaign (takes precendence over other template options)
266
- int gallery_template_id optional - use a template from the public gallery to generate the HTML content of the campaign (takes precendence over base template options)
267
- int base_template_id optional - use this a base/start-from-scratch template to generate the HTML content of the campaign
268
- int folder_id optional - automatically file the new campaign in the folder_id passed. Get using folders() - note that Campaigns and Autoresponders have separate folder setupsn
269
- array tracking optional - set which recipient actions will be tracked, as a struct of boolean values with the following keys: "opens", "html_clicks", and "text_clicks". By default, opens and HTML clicks will be tracked. Click tracking can not be disabled for Free accounts.
270
- string title optional - an internal name to use for this campaign. By default, the campaign subject will be used.
271
- boolean authenticate optional - set to true to enable SenderID, DomainKeys, and DKIM authentication, defaults to false.
272
- array analytics optional - if provided, use a struct with "service type" as a key and the "service tag" as a value. For Google, this should be "google"=>"your_google_analytics_key_here". Note that only "google" is currently supported - a Google Analytics tags will be added to all links in the campaign with this string attached. Others may be added in the future
273
- boolean auto_footer optional Whether or not we should auto-generate the footer for your content. Mostly useful for content from URLs or Imports
274
- boolean inline_css optional Whether or not css should be automatically inlined when this campaign is sent, defaults to false.
275
- boolean generate_text optional Whether of not to auto-generate your Text content from the HTML content. Note that this will be ignored if the Text part of the content passed is not empty, defaults to false.
276
- boolean auto_tweet optional If set, this campaign will be auto-tweeted when it is sent - defaults to false. Note that if a Twitter account isn't linked, this will be silently ignored.
277
- boolean timewarp optional If set, this campaign must be scheduled 24 hours in advance of sending - default to false. Only valid for "regular" campaigns and "absplit" campaigns that split on schedule_time.
278
- boolean ecomm360 optional If set, our <a href="http://www.mailchimp.com/blog/ecommerce-tracking-plugin/" target="_blank">Ecommerce360 tracking</a> will be enabled for links in the campaign
279
-
280
- * @param array $content the content for this campaign - use a struct with the following keys:
281
- string html for pasted HTML content
282
- string text for the plain-text version
283
- string url to have us pull in content from a URL. Note, this will override any other content options - for lists with Email Format options, you'll need to turn on generate_text as well
284
- string archive to send a Base64 encoded archive file for us to import all media from. Note, this will override any other content options - for lists with Email Format options, you'll need to turn on generate_text as well
285
- string archive_type optional - only necessary for the "archive" option. Supported formats are: zip, tar.gz, tar.bz2, tar, tgz, tbz . If not included, we will default to zip
286
-
287
- If you chose a template instead of pasting in your HTML content, then use "html_" followed by the template sections as keys - for example, use a key of "html_MAIN" to fill in the "MAIN" section of a template. Supported template sections include: "html_HEADER", "html_MAIN", "html_SIDECOLUMN", and "html_FOOTER"
288
- * @param array $segment_opts optional - if you wish to do Segmentation with this campaign this array should contain: see campaignSegmentTest(). It's suggested that you test your options against campaignSegmentTest(). Also, "trans" campaigns <strong>do not</strong> support segmentation.
289
- * @param array $type_opts optional -
290
- For RSS Campaigns this, array should contain:
291
- string url the URL to pull RSS content from - it will be verified and must exist
292
- string schedule optional one of "daily", "weekly", "monthly" - defaults to "daily"
293
- string schedule_hour optional an hour between 0 and 24 - default to 4 (4am <em>local time</em>) - applies to all schedule types
294
- string schedule_weekday optional for "weekly" only, a number specifying the day of the week to send: 0 (Sunday) - 6 (Saturday) - defaults to 1 (Monday)
295
- string schedule_monthday optional for "monthly" only, a number specifying the day of the month to send (1 - 28) or "last" for the last day of a given month. Defaults to the 1st day of the month
296
-
297
- For A/B Split campaigns, this array should contain:
298
- string split_test The values to segment based on. Currently, one of: "subject", "from_name", "schedule". NOTE, for "schedule", you will need to call campaignSchedule() separately!
299
- string pick_winner How the winner will be picked, one of: "opens" (by the open_rate), "clicks" (by the click rate), "manual" (you pick manually)
300
- int wait_units optional the default time unit to wait before auto-selecting a winner - use "3600" for hours, "86400" for days. Defaults to 86400.
301
- int wait_time optional the number of units to wait before auto-selecting a winner - defaults to 1, so if not set, a winner will be selected after 1 Day.
302
- int split_size optional this is a percentage of what size the Campaign's List plus any segmentation options results in. "schedule" type forces 50%, all others default to 10%
303
- string from_name_a optional sort of, required when split_test is "from_name"
304
- string from_name_b optional sort of, required when split_test is "from_name"
305
- string from_email_a optional sort of, required when split_test is "from_name"
306
- string from_email_b optional sort of, required when split_test is "from_name"
307
- string subject_a optional sort of, required when split_test is "subject"
308
- string subject_b optional sort of, required when split_test is "subject"
309
-
310
- For AutoResponder campaigns, this array should contain:
311
- string offset-units one of "day", "week", "month", "year" - required
312
- string offset-time optional, sort of - the number of units must be a number greater than 0 for signup based autoresponders
313
- string offset-dir either "before" or "after"
314
- string event optional "signup" (default) to base this on double-optin signup, "date" or "annual" to base this on merge field in the list
315
- string event-datemerge optional sort of, this is required if the event is "date" or "annual"
316
-
317
- *
318
- * @return string the ID for the created campaign
319
- */
320
- function campaignCreate($type, $options, $content, $segment_opts=NULL, $type_opts=NULL) {
321
- $params = array();
322
- $params["type"] = $type;
323
- $params["options"] = $options;
324
- $params["content"] = $content;
325
- $params["segment_opts"] = $segment_opts;
326
- $params["type_opts"] = $type_opts;
327
- return $this->callServer("campaignCreate", $params);
328
- }
329
-
330
- /** Update just about any setting for a campaign that has <em>not</em> been sent. See campaignCreate() for details.
331
- *
332
- *
333
- * Caveats:<br/><ul>
334
- * <li>If you set list_id, all segmentation options will be deleted and must be re-added.</li>
335
- * <li>If you set template_id, you need to follow that up by setting it's 'content'</li>
336
- * <li>If you set segment_opts, you should have tested your options against campaignSegmentTest() as campaignUpdate() will not allow you to set a segment that includes no members.</li></ul>
337
- * @section Campaign Related
338
- *
339
- * @example mcapi_campaignUpdate.php
340
- * @example mcapi_campaignUpdateAB.php
341
- * @example xml-rpc_campaignUpdate.php
342
- * @example xml-rpc_campaignUpdateAB.php
343
- *
344
- * @param string $cid the Campaign Id to update
345
- * @param string $name the parameter name ( see campaignCreate() ). For items in the <strong>options</strong> array, this will be that parameter's name (subject, from_email, etc.). Additional parameters will be that option name (content, segment_opts). "type_opts" will be the name of the type - rss, auto, trans, etc.
346
- * @param mixed $value an appropriate value for the parameter ( see campaignCreate() ). For items in the <strong>options</strong> array, this will be that parameter's value. For additional parameters, this is the same value passed to them.
347
- * @return boolean true if the update succeeds, otherwise an error will be thrown
348
- */
349
- function campaignUpdate($cid, $name, $value) {
350
- $params = array();
351
- $params["cid"] = $cid;
352
- $params["name"] = $name;
353
- $params["value"] = $value;
354
- return $this->callServer("campaignUpdate", $params);
355
- }
356
-
357
- /** Replicate a campaign.
358
- *
359
- * @section Campaign Related
360
- *
361
- * @example mcapi_campaignReplicate.php
362
- *
363
- * @param string $cid the Campaign Id to replicate
364
- * @return string the id of the replicated Campaign created, otherwise an error will be thrown
365
- */
366
- function campaignReplicate($cid) {
367
- $params = array();
368
- $params["cid"] = $cid;
369
- return $this->callServer("campaignReplicate", $params);
370
- }
371
-
372
- /** Delete a campaign. Seriously, "poof, gone!" - be careful!
373
- *
374
- * @section Campaign Related
375
- *
376
- * @example mcapi_campaignDelete.php
377
- *
378
- * @param string $cid the Campaign Id to delete
379
- * @return boolean true if the delete succeeds, otherwise an error will be thrown
380
- */
381
- function campaignDelete($cid) {
382
- $params = array();
383
- $params["cid"] = $cid;
384
- return $this->callServer("campaignDelete", $params);
385
- }
386
-
387
- /**
388
- * Get the list of campaigns and their details matching the specified filters
389
- *
390
- * @section Campaign Related
391
- * @example mcapi_campaigns.php
392
- * @example xml-rpc_campaigns.php
393
- *
394
- * @param array $filters a hash of filters to apply to this query - all are optional:
395
- string campaign_id optional - return a single campaign using a know campaign_id
396
- string list_id optional - the list to send this campaign to- get lists using lists(). Accepts multiples separated by commas when not using exact matching.
397
- int folder_id optional - only show campaigns from this folder id - get folders using campaignFolders(). Accepts multiples separated by commas when not using exact matching.
398
- int template_id optional - only show campaigns using this template id - get templates using templates(). Accepts multiples separated by commas when not using exact matching.
399
- string status optional - return campaigns of a specific status - one of "sent", "save", "paused", "schedule", "sending". Accepts multiples separated by commas when not using exact matching.
400
- string type optional - return campaigns of a specific type - one of "regular", "plaintext", "absplit", "rss", "trans", "auto". Accepts multiples separated by commas when not using exact matching.
401
- string from_name optional - only show campaigns that have this "From Name"
402
- string from_email optional - only show campaigns that have this "Reply-to Email"
403
- string title optional - only show campaigns that have this title
404
- string subject optional - only show campaigns that have this subject
405
- string sendtime_start optional - only show campaigns that have been sent since this date/time (in GMT) - format is YYYY-MM-DD HH:mm:ss (24hr)
406
- string sendtime_end optional - only show campaigns that have been sent before this date/time (in GMT) - format is YYYY-MM-DD HH:mm:ss (24hr)
407
- boolean exact optional - flag for whether to filter on exact values when filtering, or search within content for filter values - defaults to true. Using this disables the use of any filters that accept multiples.
408
- * @param int $start optional - control paging of campaigns, start results at this campaign #, defaults to 1st page of data (page 0)
409
- * @param int $limit optional - control paging of campaigns, number of campaigns to return with each call, defaults to 25 (max=1000)
410
- * @return array an array containing a count of all matching campaigns and the specific ones for the current page (see Returned Fields for description)
411
- * @returnf int total the total number of campaigns matching the filters passed in
412
- * @returnf array data the data for each campaign being returned
413
- string id Campaign Id (used for all other campaign functions)
414
- int web_id The Campaign id used in our web app, allows you to create a link directly to it
415
- string list_id The List used for this campaign
416
- int folder_id The Folder this campaign is in
417
- int template_id The Template this campaign uses
418
- string content_type How the campaign's content is put together - one of 'template', 'html', 'url'
419
- string title Title of the campaign
420
- string type The type of campaign this is (regular,plaintext,absplit,rss,inspection,trans,auto)
421
- string create_time Creation time for the campaign
422
- string send_time Send time for the campaign - also the scheduled time for scheduled campaigns.
423
- int emails_sent Number of emails email was sent to
424
- string status Status of the given campaign (save,paused,schedule,sending,sent)
425
- string from_name From name of the given campaign
426
- string from_email Reply-to email of the given campaign
427
- string subject Subject of the given campaign
428
- string to_name Custom "To:" email string using merge variables
429
- string archive_url Archive link for the given campaign
430
- boolean inline_css Whether or not the campaign content's css was auto-inlined
431
- string analytics Either "google" if enabled or "N" if disabled
432
- string analytics_tag The name/tag the campaign's links were tagged with if analytics were enabled.
433
- boolean authenticate Whether or not the campaign was authenticated
434
- boolean ecomm360 Whether or not ecomm360 tracking was appended to links
435
- boolean auto_tweet Whether or not the campaign was auto tweeted after sending
436
- string auto_fb_post A comma delimited list of Facebook Profile/Page Ids the campaign was posted to after sending. If not used, blank.
437
- boolean auto_footer Whether or not the auto_footer was manually turned on
438
- boolean timewarp Whether or not the campaign used Timewarp
439
- boolean timewarp_schedule The time, in GMT, that the Timewarp campaign is being sent. For A/B Split campaigns, this is blank and is instead in their schedule_a and schedule_b in the type_opts array
440
- array tracking containing "text_clicks", "html_clicks", and "opens" as boolean values representing whether or not they were enabled
441
- string segment_text a string marked-up with HTML explaining the segment used for the campaign in plain English
442
- array segment_opts the segment used for the campaign - can be passed to campaignSegmentTest() or campaignCreate()
443
- array type_opts the type-specific options for the campaign - can be passed to campaignCreate()
444
- */
445
- function campaigns($filters=array (
446
- ), $start=0, $limit=25) {
447
- $params = array();
448
- $params["filters"] = $filters;
449
- $params["start"] = $start;
450
- $params["limit"] = $limit;
451
- return $this->callServer("campaigns", $params);
452
- }
453
-
454
- /**
455
- * Given a list and a campaign, get all the relevant campaign statistics (opens, bounces, clicks, etc.)
456
- *
457
- * @section Campaign Stats
458
- *
459
- * @example mcapi_campaignStats.php
460
- * @example xml-rpc_campaignStats.php
461
- *
462
- * @param string $cid the campaign id to pull stats for (can be gathered using campaigns())
463
- * @return array struct of the statistics for this campaign
464
- * @returnf int syntax_errors Number of email addresses in campaign that had syntactical errors.
465
- * @returnf int hard_bounces Number of email addresses in campaign that hard bounced.
466
- * @returnf int soft_bounces Number of email addresses in campaign that soft bounced.
467
- * @returnf int unsubscribes Number of email addresses in campaign that unsubscribed.
468
- * @returnf int abuse_reports Number of email addresses in campaign that reported campaign for abuse.
469
- * @returnf int forwards Number of times email was forwarded to a friend.
470
- * @returnf int forwards_opens Number of times a forwarded email was opened.
471
- * @returnf int opens Number of times the campaign was opened.
472
- * @returnf date last_open Date of the last time the email was opened.
473
- * @returnf int unique_opens Number of people who opened the campaign.
474
- * @returnf int clicks Number of times a link in the campaign was clicked.
475
- * @returnf int unique_clicks Number of unique recipient/click pairs for the campaign.
476
- * @returnf date last_click Date of the last time a link in the email was clicked.
477
- * @returnf int users_who_clicked Number of unique recipients who clicked on a link in the campaign.
478
- * @returnf int emails_sent Number of email addresses campaign was sent to.
479
- * @returnf array absplit If this was an absplit campaign, stats for the A and B groups will be returned
480
- int bounces_a bounces for the A group
481
- int bounces_b bounces for the B group
482
- int forwards_a forwards for the A group
483
- int forwards_b forwards for the B group
484
- int abuse_reports_a abuse reports for the A group
485
- int abuse_reports_b abuse reports for the B group
486
- int unsubs_a unsubs for the A group
487
- int unsubs_b unsubs for the B group
488
- int recipients_click_a clicks for the A group
489
- int recipients_click_b clicks for the B group
490
- int forwards_opens_a opened forwards for the A group
491
- int forwards_opens_b opened forwards for the A group
492
- * @returnf array timewarp If this campaign was a Timewarp campaign, an array of stats from each timezone for it, with the GMT offset as they key. Each timezone will contain:
493
- int opens opens for this timezone
494
- string last_open the date/time of the last open for this timezone
495
- int unique_opens the unique opens for this timezone
496
- int clicks the total clicks for this timezone
497
- string last_click the date/time of the last click for this timezone
498
- int unique_opens the unique clicks for this timezone
499
- int bounces the total bounces for this timezone
500
- int total the total number of members sent to in this timezone
501
- int sent the total number of members delivered to in this timezone
502
- */
503
- function campaignStats($cid) {
504
- $params = array();
505
- $params["cid"] = $cid;
506
- return $this->callServer("campaignStats", $params);
507
- }
508
-
509
- /**
510
- * Get an array of the urls being tracked, and their click counts for a given campaign
511
- *
512
- * @section Campaign Stats
513
- *
514
- * @example mcapi_campaignClickStats.php
515
- * @example xml-rpc_campaignClickStats.php
516
- *
517
- * @param string $cid the campaign id to pull stats for (can be gathered using campaigns())
518
- * @return struct urls will be keys and contain their associated statistics:
519
- * @returnf int clicks Number of times the specific link was clicked
520
- * @returnf int unique Number of unique people who clicked on the specific link
521
- */
522
- function campaignClickStats($cid) {
523
- $params = array();
524
- $params["cid"] = $cid;
525
- return $this->callServer("campaignClickStats", $params);
526
- }
527
-
528
- /**
529
- * Get the top 5 performing email domains for this campaign. Users want more than 5 should use campaign campaignEmailStatsAIM()
530
- * or campaignEmailStatsAIMAll() and generate any additional stats they require.
531
- *
532
- * @section Campaign Stats
533
- *
534
- * @example mcapi_campaignEmailDomainPerformance.php
535
- *
536
- * @param string $cid the campaign id to pull email domain performance for (can be gathered using campaigns())
537
- * @return array domains email domains and their associated stats
538
- * @returnf string domain Domain name or special "Other" to roll-up stats past 5 domains
539
- * @returnf int total_sent Total Email across all domains - this will be the same in every row
540
- * @returnf int emails Number of emails sent to this domain
541
- * @returnf int bounces Number of bounces
542
- * @returnf int opens Number of opens
543
- * @returnf int clicks Number of clicks
544
- * @returnf int unsubs Number of unsubs
545
- * @returnf int delivered Number of deliveries
546
- * @returnf int emails_pct Percentage of emails that went to this domain (whole number)
547
- * @returnf int bounces_pct Percentage of bounces from this domain (whole number)
548
- * @returnf int opens_pct Percentage of opens from this domain (whole number)
549
- * @returnf int clicks_pct Percentage of clicks from this domain (whole number)
550
- * @returnf int unsubs_pct Percentage of unsubs from this domain (whole number)
551
- */
552
- function campaignEmailDomainPerformance($cid) {
553
- $params = array();
554
- $params["cid"] = $cid;
555
- return $this->callServer("campaignEmailDomainPerformance", $params);
556
- }
557
-
558
- /**
559
- * Get all email addresses the campaign was successfully sent to (ie, no bounces)
560
- *
561
- * @section Campaign Stats
562
- *
563
- * @param string $cid the campaign id to pull members for (can be gathered using campaigns())
564
- * @param string $status optional the status to pull - one of 'sent', 'hard' (bounce), or 'soft' (bounce). By default, all records are returned
565
- * @param int $start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
566
- * @param int $limit optional for large data sets, the number of results to return - defaults to 1000, upper limit set at 15000
567
- * @return array a total of all matching emails and the specific emails for this page
568
- * @returnf int total the total number of members for the campaign and status
569
- * @returnf array data the full campaign member records
570
- string email the email address sent to
571
- string status the status of the send - one of 'sent', 'hard', 'soft'
572
- string absplit_group if this was an absplit campaign, one of 'a','b', or 'winner'
573
- string tz_group if this was an timewarp campaign the timezone GMT offset the member was included in
574
- */
575
- function campaignMembers($cid, $status=NULL, $start=0, $limit=1000) {
576
- $params = array();
577
- $params["cid"] = $cid;
578
- $params["status"] = $status;
579
- $params["start"] = $start;
580
- $params["limit"] = $limit;
581
- return $this->callServer("campaignMembers", $params);
582
- }
583
-
584
- /**
585
- * <strong>DEPRECATED</strong> Get all email addresses with Hard Bounces for a given campaign
586
- *
587
- * @deprecated See campaignMembers() for a replacement
588
- *
589
- * @section Campaign Stats
590
- *
591
- * @param string $cid the campaign id to pull bounces for (can be gathered using campaigns())
592
- * @param int $start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
593
- * @param int $limit optional for large data sets, the number of results to return - defaults to 1000, upper limit set at 15000
594
- * @return array a total of all hard bounced emails and the specific emails for this page
595
- * @returnf int total the total number of hard bounces for the campaign
596
- * @returnf array data the full email addresses that bounced
597
- string email the email address that bounced
598
- */
599
- function campaignHardBounces($cid, $start=0, $limit=1000) {
600
- $params = array();
601
- $params["cid"] = $cid;
602
- $params["start"] = $start;
603
- $params["limit"] = $limit;
604
- return $this->callServer("campaignHardBounces", $params);
605
- }
606
-
607
- /**
608
- * <strong>DEPRECATED</strong> Get all email addresses with Soft Bounces for a given campaign
609
- *
610
- * @deprecated See campaignMembers() for a replacement
611
- *
612
- * @section Campaign Stats
613
- *
614
- * @param string $cid the campaign id to pull bounces for (can be gathered using campaigns())
615
- * @param int $start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
616
- * @param int $limit optional for large data sets, the number of results to return - defaults to 1000, upper limit set at 15000
617
- * @return array a total of all soft bounced emails and the specific emails for this page
618
- * @returnf int total the total number of soft bounces for the campaign
619
- * @returnf array data the full email addresses that bounced
620
- string email the email address that bounced
621
- */
622
- function campaignSoftBounces($cid, $start=0, $limit=1000) {
623
- $params = array();
624
- $params["cid"] = $cid;
625
- $params["start"] = $start;
626
- $params["limit"] = $limit;
627
- return $this->callServer("campaignSoftBounces", $params);
628
- }
629
-
630
- /**
631
- * Get all unsubscribed email addresses for a given campaign
632
- *
633
- * @section Campaign Stats
634
- *
635
- * @param string $cid the campaign id to pull bounces for (can be gathered using campaigns())
636
- * @param int $start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
637
- * @param int $limit optional for large data sets, the number of results to return - defaults to 1000, upper limit set at 15000
638
- * @return array email addresses that unsubscribed from this campaign along with reasons, if given
639
- * @return array a total of all unsubscribed emails and the specific emails for this page
640
- * @returnf int total the total number of unsubscribes for the campaign
641
- * @returnf array data the full email addresses that unsubscribed
642
- string email the email address that unsubscribed
643
- string reason For unsubscribes only - the reason collected for the unsubscribe. If populated, one of 'NORMAL','NOSIGNUP','INAPPROPRIATE','SPAM','OTHER'
644
- string reason_text For unsubscribes only - if the reason is OTHER, the text entered.
645
- */
646
- function campaignUnsubscribes($cid, $start=0, $limit=1000) {
647
- $params = array();
648
- $params["cid"] = $cid;
649
- $params["start"] = $start;
650
- $params["limit"] = $limit;
651
- return $this->callServer("campaignUnsubscribes", $params);
652
- }
653
-
654
- /**
655
- * Get all email addresses that complained about a given campaign
656
- *
657
- * @section Campaign Stats
658
- *
659
- * @example mcapi_campaignAbuseReports.php
660
- *
661
- * @param string $cid the campaign id to pull abuse reports for (can be gathered using campaigns())
662
- * @param int $start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
663
- * @param int $limit optional for large data sets, the number of results to return - defaults to 500, upper limit set at 1000
664
- * @param string $since optional pull only messages since this time - use YYYY-MM-DD HH:II:SS format in <strong>GMT</strong>
665
- * @return array reports the abuse reports for this campaign
666
- * @returnf string date date/time the abuse report was received and processed
667
- * @returnf string email the email address that reported abuse
668
- * @returnf string type an internal type generally specifying the orginating mail provider - may not be useful outside of filling report views
669
- */
670
- function campaignAbuseReports($cid, $since=NULL, $start=0, $limit=500) {
671
- $params = array();
672
- $params["cid"] = $cid;
673
- $params["since"] = $since;
674
- $params["start"] = $start;
675
- $params["limit"] = $limit;
676
- return $this->callServer("campaignAbuseReports", $params);
677
- }
678
-
679
- /**
680
- * Retrieve the text presented in our app for how a campaign performed and any advice we may have for you - best
681
- * suited for display in customized reports pages. Note: some messages will contain HTML - clean tags as necessary
682
- *
683
- * @section Campaign Stats
684
- *
685
- * @example mcapi_campaignAdvice.php
686
- *
687
- * @param string $cid the campaign id to pull advice text for (can be gathered using campaigns())
688
- * @return array advice on the campaign's performance
689
- * @returnf msg the advice message
690
- * @returnf type the "type" of the message. one of: negative, positive, or neutral
691
- */
692
- function campaignAdvice($cid) {
693
- $params = array();
694
- $params["cid"] = $cid;
695
- return $this->callServer("campaignAdvice", $params);
696
- }
697
-
698
- /**
699
- * Retrieve the Google Analytics data we've collected for this campaign. Note, requires Google Analytics Add-on to be installed and configured.
700
- *
701
- * @section Campaign Stats
702
- *
703
- * @example mcapi_campaignAnalytics.php
704
- *
705
- * @param string $cid the campaign id to pull bounces for (can be gathered using campaigns())
706
- * @return array analytics we've collected for the passed campaign.
707
- * @returnf int visits number of visits
708
- * @returnf int pages number of page views
709
- * @returnf int new_visits new visits recorded
710
- * @returnf int bounces vistors who "bounced" from your site
711
- * @returnf double time_on_site the total time visitors spent on your sites
712
- * @returnf int goal_conversions number of goals converted
713
- * @returnf double goal_value value of conversion in dollars
714
- * @returnf double revenue revenue generated by campaign
715
- * @returnf int transactions number of transactions tracked
716
- * @returnf int ecomm_conversions number Ecommerce transactions tracked
717
- * @returnf array goals an array containing goal names and number of conversions
718
- */
719
- function campaignAnalytics($cid) {
720
- $params = array();
721
- $params["cid"] = $cid;
722
- return $this->callServer("campaignAnalytics", $params);
723
- }
724
-
725
- /**
726
- * Retrieve the countries and number of opens tracked for each. Email address are not returned.
727
- *
728
- * @section Campaign Stats
729
- *
730
- *
731
- * @param string $cid the campaign id to pull bounces for (can be gathered using campaigns())
732
- * @return array countries an array of countries where opens occurred
733
- * @returnf string code The ISO3166 2 digit country code
734
- * @returnf string name A version of the country name, if we have it
735
- * @returnf int opens The total number of opens that occurred in the country
736
- * @returnf bool region_detail Whether or not a subsequent call to campaignGeoOpensByCountry() will return anything
737
- */
738
- function campaignGeoOpens($cid) {
739
- $params = array();
740
- $params["cid"] = $cid;
741
- return $this->callServer("campaignGeoOpens", $params);
742
- }
743
-
744
- /**
745
- * Retrieve the regions and number of opens tracked for a certain country. Email address are not returned.
746
- *
747
- * @section Campaign Stats
748
- *
749
- *
750
- * @param string $cid the campaign id to pull bounces for (can be gathered using campaigns())
751
- * @param string $code An ISO3166 2 digit country code
752
- * @return array regions an array of regions within the provided country where opens occurred.
753
- * @returnf string code An internal code for the region. When this is blank, it indicates we know the country, but not the region
754
- * @returnf string name The name of the region, if we have one. For blank "code" values, this will be "Rest of Country"
755
- * @returnf int opens The total number of opens that occurred in the country
756
- */
757
- function campaignGeoOpensForCountry($cid, $code) {
758
- $params = array();
759
- $params["cid"] = $cid;
760
- $params["code"] = $code;
761
- return $this->callServer("campaignGeoOpensForCountry", $params);
762
- }
763
-
764
- /**
765
- * Retrieve the tracked eepurl mentions on Twitter
766
- *
767
- * @section Campaign Stats
768
- *
769
- *
770
- * @param string $cid the campaign id to pull bounces for (can be gathered using campaigns())
771
- * @return array stats an array containing tweets, retweets, clicks, and referrer related to using the campaign's eepurl
772
- * @returnf array twitter various Twitter related stats
773
- int tweets Total number of tweets seen
774
- string first_tweet date and time of the first tweet seen
775
- string last_tweet date and time of the last tweet seen
776
- int retweets Total number of retweets seen
777
- string first_retweet date and time of the first retweet seen
778
- string last_retweet date and time of the last retweet seen
779
- array statuses an array of statuses recorded inclduing the status, screen_name, status_id, and datetime fields plus an is_retweet flag
780
- * @returnf array clicks stats related to click-throughs on the eepurl
781
- int clicks Total number of clicks seen
782
- string first_click date and time of the first click seen
783
- string last_click date and time of the first click seen
784
- array locations an array of geographic locations including country, region, and total clicks
785
- * @returnf array referrers an array of arrays, each containing
786
- string referrer the referrer, truncated to 100 bytes
787
- int clicks Total number of clicks seen from this referrer
788
- string first_click date and time of the first click seen from this referrer
789
- string last_click date and time of the first click seen from this referrer
790
- */
791
- function campaignEepUrlStats($cid) {
792
- $params = array();
793
- $params["cid"] = $cid;
794
- return $this->callServer("campaignEepUrlStats", $params);
795
- }
796
-
797
- /**
798
- * Retrieve the most recent full bounce message for a specific email address on the given campaign.
799
- * Messages over 30 days old are subject to being removed
800
- *
801
- *
802
- * @section Campaign Stats
803
- *
804
- * @param string $cid the campaign id to pull bounces for (can be gathered using campaigns())
805
- * @param string $email the email address or unique id of the member to pull a bounce message for.
806
- * @return array the full bounce message for this email+campaign along with some extra data.
807
- * @returnf string date date/time the bounce was received and processed
808
- * @returnf string email the email address that bounced
809
- * @returnf string message the entire bounce message received
810
- */
811
- function campaignBounceMessage($cid, $email) {
812
- $params = array();
813
- $params["cid"] = $cid;
814
- $params["email"] = $email;
815
- return $this->callServer("campaignBounceMessage", $params);
816
- }
817
-
818
- /**
819
- * Retrieve the full bounce messages for the given campaign. Note that this can return very large amounts
820
- * of data depending on how large the campaign was and how much cruft the bounce provider returned. Also,
821
- * message over 30 days old are subject to being removed
822
- *
823
- * @section Campaign Stats
824
- *
825
- * @example mcapi_campaignBounceMessages.php
826
- *
827
- * @param string $cid the campaign id to pull bounces for (can be gathered using campaigns())
828
- * @param int $start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
829
- * @param int $limit optional for large data sets, the number of results to return - defaults to 25, upper limit set at 50
830
- * @param string $since optional pull only messages since this time - use YYYY-MM-DD format in <strong>GMT</strong> (we only store the date, not the time)
831
- * @return array bounces the full bounce messages for this campaign
832
- * @returnf int total that total number of bounce messages for the campaign
833
- * @returnf array data an array containing the data for this page
834
- string date date/time the bounce was received and processed
835
- string email the email address that bounced
836
- string message the entire bounce message received
837
- */
838
- function campaignBounceMessages($cid, $start=0, $limit=25, $since=NULL) {
839
- $params = array();
840
- $params["cid"] = $cid;
841
- $params["start"] = $start;
842
- $params["limit"] = $limit;
843
- $params["since"] = $since;
844
- return $this->callServer("campaignBounceMessages", $params);
845
- }
846
-
847
- /**
848
- * Retrieve the Ecommerce Orders tracked by campaignEcommOrderAdd()
849
- *
850
- * @section Campaign Stats
851
- *
852
- * @param string $cid the campaign id to pull bounces for (can be gathered using campaigns())
853
- * @param int $start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
854
- * @param int $limit optional for large data sets, the number of results to return - defaults to 100, upper limit set at 500
855
- * @param string $since optional pull only messages since this time - use YYYY-MM-DD HH:II:SS format in <strong>GMT</strong>
856
- * @return array the total matching orders and the specific orders for the requested page
857
- * @returnf int total the total matching orders
858
- * @returnf array data the actual data for each order being returned
859
- string store_id the store id generated by the plugin used to uniquely identify a store
860
- string store_name the store name collected by the plugin - often the domain name
861
- string order_id the internal order id the store tracked this order by
862
- string email the email address that received this campaign and is associated with this order
863
- double order_total the order total
864
- double tax_total the total tax for the order (if collected)
865
- double ship_total the shipping total for the order (if collected)
866
- string order_date the date the order was tracked - from the store if possible, otherwise the GMT time we recieved it
867
- array lines containing detail of the order - product, category, quantity, item cost
868
- */
869
- function campaignEcommOrders($cid, $start=0, $limit=100, $since=NULL) {
870
- $params = array();
871
- $params["cid"] = $cid;
872
- $params["start"] = $start;
873
- $params["limit"] = $limit;
874
- $params["since"] = $since;
875
- return $this->callServer("campaignEcommOrders", $params);
876
- }
877
-
878
- /**
879
- * Get the URL to a customized <a href="http://eepurl.com/gKmL" target="_blank">VIP Report</a> for the specified campaign and optionally send an email to someone with links to it. Note subsequent calls will overwrite anything already set for the same campign (eg, the password)
880
- *
881
- * @section Campaign Related
882
- *
883
- * @param string $cid the campaign id to share a report for (can be gathered using campaigns())
884
- * @param array $opts optional various parameters which can be used to configure the shared report
885
- string header_type optional - "text" or "image', defaults to "text'
886
- string header_data optional - if "header_type" is text, the text to display. if "header_type" is "image" a valid URL to an image file. Note that images will be resized to be no more than 500x150. Defaults to the Accounts Company Name.
887
- boolean secure optional - whether to require a password for the shared report. defaults to "true"
888
- string password optional - if secure is true and a password is not included, we will generate one. It is always returned.
889
- string to_email optional - optional, email address to share the report with - no value means an email will not be sent
890
- array theme optional - an array containing either 3 or 6 character color code values for: "bg_color", "header_color", "current_tab", "current_tab_text", "normal_tab", "normal_tab_text", "hover_tab", "hover_tab_text"
891
- string css_url optional - a link to an external CSS file to be included after our default CSS (http://vip-reports.net/css/vip.css) <strong>only if</strong> loaded via the "secure_url" - max 255 bytes
892
- * @return struct Struct containing details for the shared report
893
- * @returnf string title The Title of the Campaign being shared
894
- * @returnf string url The URL to the shared report
895
- * @returnf string secure_url The URL to the shared report, including the password (good for loading in an IFRAME). For non-secure reports, this will not be returned
896
- * @returnf string password If secured, the password for the report, otherwise this field will not be returned
897
- */
898
- function campaignShareReport($cid, $opts=array (
899
- )) {
900
- $params = array();
901
- $params["cid"] = $cid;
902
- $params["opts"] = $opts;
903
- return $this->callServer("campaignShareReport", $params);
904
- }
905
-
906
- /**
907
- * Get the content (both html and text) for a campaign either as it would appear in the campaign archive or as the raw, original content
908
- *
909
- * @section Campaign Related
910
- *
911
- * @param string $cid the campaign id to get content for (can be gathered using campaigns())
912
- * @param bool $for_archive optional controls whether we return the Archive version (true) or the Raw version (false), defaults to true
913
- * @return struct Struct containing all content for the campaign (see Returned Fields for details
914
- * @returnf string html The HTML content used for the campgain with merge tags intact
915
- * @returnf string text The Text content used for the campgain with merge tags intact
916
- */
917
- function campaignContent($cid, $for_archive=true) {
918
- $params = array();
919
- $params["cid"] = $cid;
920
- $params["for_archive"] = $for_archive;
921
- return $this->callServer("campaignContent", $params);
922
- }
923
-
924
- /**
925
- * Get the HTML template content sections for a campaign. Note that this <strong>will</strong> return very jagged, non-standard results based on the template
926
- * a campaign is using. You only want to use this if you want to allow editing template sections in your applicaton.
927
- *
928
- * @section Campaign Related
929
- *
930
- * @param string $cid the campaign id to get content for (can be gathered using campaigns())
931
- * @return array array containing all content section for the campaign -
932
- */
933
- function campaignTemplateContent($cid) {
934
- $params = array();
935
- $params["cid"] = $cid;
936
- return $this->callServer("campaignTemplateContent", $params);
937
- }
938
-
939
- /**
940
- * Retrieve the list of email addresses that opened a given campaign with how many times they opened - note: this AIM function is free and does
941
- * not actually require the AIM module to be installed
942
- *
943
- * @section Campaign Report Data
944
- *
945
- * @param string $cid the campaign id to get opens for (can be gathered using campaigns())
946
- * @param int $start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
947
- * @param int $limit optional for large data sets, the number of results to return - defaults to 1000, upper limit set at 15000
948
- * @return array array containing the total records matched and the specific records for this page
949
- * @returnf int total the total number of records matched
950
- * @returnf array data the actual opens data, including:
951
- string email Email address that opened the campaign
952
- int open_count Total number of times the campaign was opened by this email address
953
- */
954
- function campaignOpenedAIM($cid, $start=0, $limit=1000) {
955
- $params = array();
956
- $params["cid"] = $cid;
957
- $params["start"] = $start;
958
- $params["limit"] = $limit;
959
- return $this->callServer("campaignOpenedAIM", $params);
960
- }
961
-
962
- /**
963
- * Retrieve the list of email addresses that did not open a given campaign
964
- *
965
- * @section Campaign Report Data
966
- *
967
- * @param string $cid the campaign id to get no opens for (can be gathered using campaigns())
968
- * @param int $start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
969
- * @param int $limit optional for large data sets, the number of results to return - defaults to 1000, upper limit set at 15000
970
- * @return array array containing the total records matched and the specific records for this page
971
- * @returnf int total the total number of records matched
972
- * @returnf array data the email addresses that did not open the campaign
973
- string email Email address that opened the campaign
974
- */
975
- function campaignNotOpenedAIM($cid, $start=0, $limit=1000) {
976
- $params = array();
977
- $params["cid"] = $cid;
978
- $params["start"] = $start;
979
- $params["limit"] = $limit;
980
- return $this->callServer("campaignNotOpenedAIM", $params);
981
- }
982
-
983
- /**
984
- * Return the list of email addresses that clicked on a given url, and how many times they clicked
985
- *
986
- * @section Campaign Report Data
987
- *
988
- * @param string $cid the campaign id to get click stats for (can be gathered using campaigns())
989
- * @param string $url the URL of the link that was clicked on
990
- * @param int $start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
991
- * @param int $limit optional for large data sets, the number of results to return - defaults to 1000, upper limit set at 15000
992
- * @return array array containing the total records matched and the specific records for this page
993
- * @returnf int total the total number of records matched
994
- * @returnf array data the email addresses that did not open the campaign
995
- string email Email address that opened the campaign
996
- int clicks Total number of times the URL was clicked on by this email address
997
- */
998
- function campaignClickDetailAIM($cid, $url, $start=0, $limit=1000) {
999
- $params = array();
1000
- $params["cid"] = $cid;
1001
- $params["url"] = $url;
1002
- $params["start"] = $start;
1003
- $params["limit"] = $limit;
1004
- return $this->callServer("campaignClickDetailAIM", $params);
1005
- }
1006
-
1007
- /**
1008
- * Given a campaign and email address, return the entire click and open history with timestamps, ordered by time
1009
- *
1010
- * @section Campaign Report Data
1011
- *
1012
- * @param string $cid the campaign id to get stats for (can be gathered using campaigns())
1013
- * @param array $email_address an array of up to 50 email addresses to check OR the email "id" returned from listMemberInfo, Webhooks, and Campaigns. For backwards compatibility, if a string is passed, it will be treated as an array with a single element (will not work with XML-RPC).
1014
- * @return array an array with the keys listed in Returned Fields below
1015
- * @returnf int success the number of email address records found
1016
- * @returnf int error the number of email address records which could not be found
1017
- * @returnf array data arrays containing the actions (opens and clicks) that the email took, with timestamps
1018
- string action The action taken (open or click)
1019
- string timestamp Time the action occurred
1020
- string url For clicks, the URL that was clicked
1021
- */
1022
- function campaignEmailStatsAIM($cid, $email_address) {
1023
- $params = array();
1024
- $params["cid"] = $cid;
1025
- $params["email_address"] = $email_address;
1026
- return $this->callServer("campaignEmailStatsAIM", $params);
1027
- }
1028
-
1029
- /**
1030
- * Given a campaign and correct paging limits, return the entire click and open history with timestamps, ordered by time,
1031
- * for every user a campaign was delivered to.
1032
- *
1033
- * @section Campaign Report Data
1034
- * @example mcapi_campaignEmailStatsAIMAll.php
1035
- *
1036
- * @param string $cid the campaign id to get stats for (can be gathered using campaigns())
1037
- * @param int $start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
1038
- * @param int $limit optional for large data sets, the number of results to return - defaults to 100, upper limit set at 1000
1039
- * @return array Array containing a total record count and data including the actions (opens and clicks) for each email, with timestamps
1040
- * @returnf int total the total number of records
1041
- * @returnf array data each record with their details:
1042
- string action The action taken (open or click)
1043
- string timestamp Time the action occurred
1044
- string url For clicks, the URL that was clicked
1045
- */
1046
- function campaignEmailStatsAIMAll($cid, $start=0, $limit=100) {
1047
- $params = array();
1048
- $params["cid"] = $cid;
1049
- $params["start"] = $start;
1050
- $params["limit"] = $limit;
1051
- return $this->callServer("campaignEmailStatsAIMAll", $params);
1052
- }
1053
-
1054
- /**
1055
- * Attach Ecommerce Order Information to a Campaign. This will generall be used by ecommerce package plugins
1056
- * <a href="/plugins/ecomm360.phtml">that we provide</a> or by 3rd part system developers.
1057
- * @section Campaign Related
1058
- *
1059
- * @param array $order an array of information pertaining to the order that has completed. Use the following keys:
1060
- string id the Order Id
1061
- string campaign_id the Campaign Id to track this order with (see the "mc_cid" query string variable a campaign passes)
1062
- string email_id the Email Id of the subscriber we should attach this order to (see the "mc_eid" query string variable a campaign passes)
1063
- double total The Order Total (ie, the full amount the customer ends up paying)
1064
- string order_date optional the date of the order - if this is not provided, we will default the date to now
1065
- double shipping optional the total paid for Shipping Fees
1066
- double tax optional the total tax paid
1067
- string store_id a unique id for the store sending the order in (20 bytes max)
1068
- string store_name optional a "nice" name for the store - typically the base web address (ie, "store.mailchimp.com"). We will automatically update this if it changes (based on store_id)
1069
- string plugin_id the MailChimp assigned Plugin Id. Get yours by <a href="/register.php">registering here</a>
1070
- array items the individual line items for an order using these keys:
1071
- <div style="padding-left:30px"><table><tr><td colspan=*>
1072
- int line_num optional the line number of the item on the order. We will generate these if they are not passed
1073
- int product_id the store's internal Id for the product. Lines that do no contain this will be skipped
1074
- string product_name the product name for the product_id associated with this item. We will auto update these as they change (based on product_id)
1075
- int category_id the store's internal Id for the (main) category associated with this product. Our testing has found this to be a "best guess" scenario
1076
- string category_name the category name for the category_id this product is in. Our testing has found this to be a "best guess" scenario. Our plugins walk the category heirarchy up and send "Root - SubCat1 - SubCat4", etc.
1077
- double qty the quantity of the item ordered
1078
- double cost the cost of a single item (ie, not the extended cost of the line)
1079
- </td></tr></table></div>
1080
- * @return bool true if the data is saved, otherwise an error is thrown.
1081
- */
1082
- function campaignEcommOrderAdd($order) {
1083
- $params = array();
1084
- $params["order"] = $order;
1085
- return $this->callServer("campaignEcommOrderAdd", $params);
1086
- }
1087
-
1088
- /**
1089
- * Retrieve all of the lists defined for your user account
1090
- *
1091
- * @section List Related
1092
- * @example mcapi_lists.php
1093
- * @example xml-rpc_lists.php
1094
- *
1095
- * @param array $filters a hash of filters to apply to this query - all are optional:
1096
- string list_id optional - return a single list using a known list_id. Accepts multiples separated by commas when not using exact matching
1097
- string list_name optional - only lists that match this name
1098
- string from_name optional - only lists that have a default from name matching this
1099
- string from_email optional - only lists that have a default from email matching this
1100
- string from_subject optional - only lists that have a default from email matching this
1101
- string created_before optional - only show lists that were created before this date/time (in GMT) - format is YYYY-MM-DD HH:mm:ss (24hr)
1102
- string created_after optional - only show lists that were created since this date/time (in GMT) - format is YYYY-MM-DD HH:mm:ss (24hr)
1103
- boolean exact optional - flag for whether to filter on exact values when filtering, or search within content for filter values - defaults to true
1104
- * @param int $start optional - control paging of lists, start results at this list #, defaults to 1st page of data (page 0)
1105
- * @param int $limit optional - control paging of lists, number of lists to return with each call, defaults to 25 (max=100)
1106
- * @return array an array with keys listed in Returned Fields below
1107
- * @returnf int total the total number of lists which matched the provided filters
1108
- * @returnf array data the lists which matched the provided filters, including the following for
1109
- string id The list id for this list. This will be used for all other list management functions.
1110
- int web_id The list id used in our web app, allows you to create a link directly to it
1111
- string name The name of the list.
1112
- string date_created The date that this list was created.
1113
- boolean email_type_option Whether or not the List supports multiple formats for emails or just HTML
1114
- boolean use_awesomebar Whether or not campaigns for this list use the Awesome Bar in archives by default
1115
- string default_from_name Default From Name for campaigns using this list
1116
- string default_from_email Default From Email for campaigns using this list
1117
- string default_subject Default Subject Line for campaigns using this list
1118
- string default_language Default Language for this list's forms
1119
- int list_rating An auto-generated activity score for the list (0 - 5)
1120
- array stats various stats and counts for the list
1121
- int member_count The number of active members in the given list.
1122
- int unsubscribe_count The number of members who have unsubscribed from the given list.
1123
- int cleaned_count The number of members cleaned from the given list.
1124
- int member_count_since_send The number of active members in the given list since the last campaign was sent
1125
- int unsubscribe_count_since_send The number of members who have unsubscribed from the given list since the last campaign was sent
1126
- int cleaned_count_since_send The number of members cleaned from the given list since the last campaign was sent
1127
- int campaign_count The number of campaigns in any status that use this list
1128
- int grouping_count The number of Interest Groupings for this list
1129
- int group_count The number of Interest Groups (regardless of grouping) for this list
1130
- int merge_var_count The number of merge vars for this list (not including the required EMAIL one)
1131
- int avg_sub_rate the average number of subscribe per month for the list (empty value if we haven't calculated this yet)
1132
- int avg_unsub_rate the average number of unsubscribe per month for the list (empty value if we haven't calculated this yet)
1133
- int target_sub_rate the target subscription rate for the list to keep it growing (empty value if we haven't calculated this yet)
1134
- int open_rate the average open rate per campaign for the list (empty value if we haven't calculated this yet)
1135
- int click_rate the average click rate per campaign for the list (empty value if we haven't calculated this yet)
1136
- array modules Any list specific modules installed for this list (example is SocialPro)
1137
- */
1138
- function lists($filters=array (
1139
- ), $start=0, $limit=25) {
1140
- $params = array();
1141
- $params["filters"] = $filters;
1142
- $params["start"] = $start;
1143
- $params["limit"] = $limit;
1144
- return $this->callServer("lists", $params);
1145
- }
1146
-
1147
- /**
1148
- * Get the list of merge tags for a given list, including their name, tag, and required setting
1149
- *
1150
- * @section List Related
1151
- * @example xml-rpc_listMergeVars.php
1152
- *
1153
- * @param string $id the list id to connect to. Get by calling lists()
1154
- * @return array list of merge tags for the list
1155
- * @returnf string name Name of the merge field
1156
- * @returnf bool req Denotes whether the field is required (true) or not (false)
1157
- * @returnf string field_type The "data type" of this merge var. One of: email, text, number, radio, dropdown, date, address, phone, url, imageurl
1158
- * @returnf bool public Whether or not this field is visible to list subscribers
1159
- * @returnf bool show Whether the list owner has this field displayed on their list dashboard
1160
- * @returnf string order The order the list owner has set this field to display in
1161
- * @returnf string default The default value the list owner has set for this field
1162
- * @returnf string size The width of the field to be used
1163
- * @returnf string tag The merge tag that's used for forms and listSubscribe() and listUpdateMember()
1164
- * @returnf array choices For radio and dropdown field types, an array of the options available
1165
- */
1166
- function listMergeVars($id) {
1167
- $params = array();
1168
- $params["id"] = $id;
1169
- return $this->callServer("listMergeVars", $params);
1170
- }
1171
-
1172
- /**
1173
- * Add a new merge tag to a given list
1174
- *
1175
- * @section List Related
1176
- * @example xml-rpc_listMergeVarAdd.php
1177
- *
1178
- * @param string $id the list id to connect to. Get by calling lists()
1179
- * @param string $tag The merge tag to add, e.g. FNAME
1180
- * @param string $name The long description of the tag being added, used for user displays
1181
- * @param array $options optional Various options for this merge var. <em>note:</em> for historical purposes this can also take a "boolean"
1182
- string field_type optional one of: text, number, radio, dropdown, date, address, phone, url, imageurl - defaults to text
1183
- boolean req optional indicates whether the field is required - defaults to false
1184
- boolean public optional indicates whether the field is displayed in public - defaults to true
1185
- boolean show optional indicates whether the field is displayed in the app's list member view - defaults to true
1186
- string default_value optional the default value for the field. See listSubscribe() for formatting info. Defaults to blank
1187
- array choices optional kind of - an array of strings to use as the choices for radio and dropdown type fields
1188
-
1189
- * @return bool true if the request succeeds, otherwise an error will be thrown
1190
- */
1191
- function listMergeVarAdd($id, $tag, $name, $options=array (
1192
- )) {
1193
- $params = array();
1194
- $params["id"] = $id;
1195
- $params["tag"] = $tag;
1196
- $params["name"] = $name;
1197
- $params["options"] = $options;
1198
- return $this->callServer("listMergeVarAdd", $params);
1199
- }
1200
-
1201
- /**
1202
- * Update most parameters for a merge tag on a given list. You cannot currently change the merge type
1203
- *
1204
- * @section List Related
1205
- *
1206
- * @param string $id the list id to connect to. Get by calling lists()
1207
- * @param string $tag The merge tag to update
1208
- * @param array $options The options to change for a merge var. See listMergeVarAdd() for valid options
1209
- * @return bool true if the request succeeds, otherwise an error will be thrown
1210
- */
1211
- function listMergeVarUpdate($id, $tag, $options) {
1212
- $params = array();
1213
- $params["id"] = $id;
1214
- $params["tag"] = $tag;
1215
- $params["options"] = $options;
1216
- return $this->callServer("listMergeVarUpdate", $params);
1217
- }
1218
-
1219
- /**
1220
- * Delete a merge tag from a given list and all its members. Seriously - the data is removed from all members as well!
1221
- * Note that on large lists this method may seem a bit slower than calls you typically make.
1222
- *
1223
- * @section List Related
1224
- * @example xml-rpc_listMergeVarDel.php
1225
- *
1226
- * @param string $id the list id to connect to. Get by calling lists()
1227
- * @param string $tag The merge tag to delete
1228
- * @return bool true if the request succeeds, otherwise an error will be thrown
1229
- */
1230
- function listMergeVarDel($id, $tag) {
1231
- $params = array();
1232
- $params["id"] = $id;
1233
- $params["tag"] = $tag;
1234
- return $this->callServer("listMergeVarDel", $params);
1235
- }
1236
-
1237
- /**
1238
- * Get the list of interest groupings for a given list, including the label, form information, and included groups for each
1239
- *
1240
- * @section List Related
1241
- * @example xml-rpc_listInterestGroupings.php
1242
- *
1243
- * @param string $id the list id to connect to. Get by calling lists()
1244
- * @return struct list of interest groups for the list
1245
- * @returnf string id The id for the Grouping
1246
- * @returnf string name Name for the Interest groups
1247
- * @returnf string form_field Gives the type of interest group: checkbox,radio,select
1248
- * @returnf array groups Array of the grouping options including the "bit" value, "name", "display_order", and number of "subscribers" with the option selected.
1249
- */
1250
- function listInterestGroupings($id) {
1251
- $params = array();
1252
- $params["id"] = $id;
1253
- return $this->callServer("listInterestGroupings", $params);
1254
- }
1255
-
1256
- /** Add a single Interest Group - if interest groups for the List are not yet enabled, adding the first
1257
- * group will automatically turn them on.
1258
- *
1259
- * @section List Related
1260
- * @example xml-rpc_listInterestGroupAdd.php
1261
- *
1262
- * @param string $id the list id to connect to. Get by calling lists()
1263
- * @param string $group_name the interest group to add - group names must be unique within a grouping
1264
- * @param int optional $grouping_id The grouping to add the new group to - get using listInterestGrouping() . If not supplied, the first grouping on the list is used.
1265
- * @return bool true if the request succeeds, otherwise an error will be thrown
1266
- */
1267
- function listInterestGroupAdd($id, $group_name, $grouping_id=NULL) {
1268
- $params = array();
1269
- $params["id"] = $id;
1270
- $params["group_name"] = $group_name;
1271
- $params["grouping_id"] = $grouping_id;
1272
- return $this->callServer("listInterestGroupAdd", $params);
1273
- }
1274
-
1275
- /** Delete a single Interest Group - if the last group for a list is deleted, this will also turn groups for the list off.
1276
- *
1277
- * @section List Related
1278
- * @example xml-rpc_listInterestGroupDel.php
1279
- *
1280
- * @param string $id the list id to connect to. Get by calling lists()
1281
- * @param string $group_name the interest group to delete
1282
- * @param int $grouping_id The grouping to delete the group from - get using listInterestGrouping() . If not supplied, the first grouping on the list is used.
1283
- * @return bool true if the request succeeds, otherwise an error will be thrown
1284
- */
1285
- function listInterestGroupDel($id, $group_name, $grouping_id=NULL) {
1286
- $params = array();
1287
- $params["id"] = $id;
1288
- $params["group_name"] = $group_name;
1289
- $params["grouping_id"] = $grouping_id;
1290
- return $this->callServer("listInterestGroupDel", $params);
1291
- }
1292
-
1293
- /** Change the name of an Interest Group
1294
- *
1295
- * @section List Related
1296
- *
1297
- * @param string $id the list id to connect to. Get by calling lists()
1298
- * @param string $old_name the interest group name to be changed
1299
- * @param string $new_name the new interest group name to be set
1300
- * @param int optional $grouping_id The grouping to delete the group from - get using listInterestGrouping() . If not supplied, the first grouping on the list is used.
1301
- * @return bool true if the request succeeds, otherwise an error will be thrown
1302
- */
1303
- function listInterestGroupUpdate($id, $old_name, $new_name, $grouping_id=NULL) {
1304
- $params = array();
1305
- $params["id"] = $id;
1306
- $params["old_name"] = $old_name;
1307
- $params["new_name"] = $new_name;
1308
- $params["grouping_id"] = $grouping_id;
1309
- return $this->callServer("listInterestGroupUpdate", $params);
1310
- }
1311
-
1312
- /** Add a new Interest Grouping - if interest groups for the List are not yet enabled, adding the first
1313
- * grouping will automatically turn them on.
1314
- *
1315
- * @section List Related
1316
- * @example xml-rpc_listInterestGroupingAdd.php
1317
- *
1318
- * @param string $id the list id to connect to. Get by calling lists()
1319
- * @param string $name the interest grouping to add - grouping names must be unique
1320
- * @param string $type The type of the grouping to add - one of "checkboxes", "hidden", "dropdown", "radio"
1321
- * @param array $groups The lists of initial group names to be added - at least 1 is required and the names must be unique within a grouping. If the number takes you over the 60 group limit, an error will be thrown.
1322
- * @return int the new grouping id if the request succeeds, otherwise an error will be thrown
1323
- */
1324
- function listInterestGroupingAdd($id, $name, $type, $groups) {
1325
- $params = array();
1326
- $params["id"] = $id;
1327
- $params["name"] = $name;
1328
- $params["type"] = $type;
1329
- $params["groups"] = $groups;
1330
- return $this->callServer("listInterestGroupingAdd", $params);
1331
- }
1332
-
1333
- /** Update an existing Interest Grouping
1334
- *
1335
- * @section List Related
1336
- * @example xml-rpc_listInterestGroupingUpdate.php
1337
- *
1338
- * @param int $grouping_id the interest grouping id - get from listInterestGroupings()
1339
- * @param string $name The name of the field to update - either "name" or "type". Groups with in the grouping should be manipulated using the standard listInterestGroup* methods
1340
- * @param string $value The new value of the field. Grouping names must be unique - only "hidden" and "checkboxes" grouping types can be converted between each other.
1341
- * @return bool true if the request succeeds, otherwise an error will be thrown
1342
- */
1343
- function listInterestGroupingUpdate($grouping_id, $name, $value) {
1344
- $params = array();
1345
- $params["grouping_id"] = $grouping_id;
1346
- $params["name"] = $name;
1347
- $params["value"] = $value;
1348
- return $this->callServer("listInterestGroupingUpdate", $params);
1349
- }
1350
-
1351
- /** Delete an existing Interest Grouping - this will permanently delete all contained interest groups and will remove those selections from all list members
1352
- *
1353
- * @section List Related
1354
- * @example xml-rpc_listInterestGroupingDel.php
1355
- *
1356
- * @param int $grouping_id the interest grouping id - get from listInterestGroupings()
1357
- * @return bool true if the request succeeds, otherwise an error will be thrown
1358
- */
1359
- function listInterestGroupingDel($grouping_id) {
1360
- $params = array();
1361
- $params["grouping_id"] = $grouping_id;
1362
- return $this->callServer("listInterestGroupingDel", $params);
1363
- }
1364
-
1365
- /** Return the Webhooks configured for the given list
1366
- *
1367
- * @section List Related
1368
- *
1369
- * @param string $id the list id to connect to. Get by calling lists()
1370
- * @return array list of webhooks
1371
- * @returnf string url the URL for this Webhook
1372
- * @returnf array actions the possible actions and whether they are enabled
1373
- * @returnf array sources the possible sources and whether they are enabled
1374
- */
1375
- function listWebhooks($id) {
1376
- $params = array();
1377
- $params["id"] = $id;
1378
- return $this->callServer("listWebhooks", $params);
1379
- }
1380
-
1381
- /** Add a new Webhook URL for the given list
1382
- *
1383
- * @section List Related
1384
- *
1385
- * @param string $id the list id to connect to. Get by calling lists()
1386
- * @param string $url a valid URL for the Webhook - it will be validated. note that a url may only exist on a list once.
1387
- * @param array $actions optional a hash of actions to fire this Webhook for
1388
- boolean subscribe optional as subscribes occur, defaults to true
1389
- boolean unsubscribe optional as subscribes occur, defaults to true
1390
- boolean profile optional as profile updates occur, defaults to true
1391
- boolean cleaned optional as emails are cleaned from the list, defaults to true
1392
- boolean upemail optional when subscribers change their email address, defaults to true
1393
- * @param array $sources optional a hash of sources to fire this Webhook for
1394
- boolean user optional user/subscriber initiated actions, defaults to true
1395
- boolean admin optional admin actions in our web app, defaults to true
1396
- boolean api optional actions that happen via API calls, defaults to false
1397
- * @return bool true if the call succeeds, otherwise an exception will be thrown
1398
- */
1399
- function listWebhookAdd($id, $url, $actions=array (
1400
- ), $sources=array (
1401
- )) {
1402
- $params = array();
1403
- $params["id"] = $id;
1404
- $params["url"] = $url;
1405
- $params["actions"] = $actions;
1406
- $params["sources"] = $sources;
1407
- return $this->callServer("listWebhookAdd", $params);
1408
- }
1409
-
1410
- /** Delete an existing Webhook URL from a given list
1411
- *
1412
- * @section List Related
1413
- *
1414
- * @param string $id the list id to connect to. Get by calling lists()
1415
- * @param string $url the URL of a Webhook on this list
1416
- * @return boolean true if the call succeeds, otherwise an exception will be thrown
1417
- */
1418
- function listWebhookDel($id, $url) {
1419
- $params = array();
1420
- $params["id"] = $id;
1421
- $params["url"] = $url;
1422
- return $this->callServer("listWebhookDel", $params);
1423
- }
1424
-
1425
- /** Retrieve all of the Static Segments for a list.
1426
- *
1427
- * @section List Related
1428
- *
1429
- * @param string $id the list id to connect to. Get by calling lists()
1430
- * @return array an array of parameters for each static segment
1431
- * @returnf int id the id of the segment
1432
- * @returnf string name the name for the segment
1433
- * @returnf int member_count the total number of members currently in a segment
1434
- * @returnf date created_date the date/time the segment was created
1435
- * @returnf date last_update the date/time the segment was last updated (add or del)
1436
- * @returnf date last_reset the date/time the segment was last reset (ie had all members cleared from it)
1437
- */
1438
- function listStaticSegments($id) {
1439
- $params = array();
1440
- $params["id"] = $id;
1441
- return $this->callServer("listStaticSegments", $params);
1442
- }
1443
-
1444
- /** Save a segment against a list for later use. There is no limit to the number of segments which can be saved. Static Segments <strong>are not</strong> tied
1445
- * to any merge data, interest groups, etc. They essentially allow you to configure an unlimited number of custom segments which will have standard performance.
1446
- * When using proper segments, Static Segments are one of the available options for segmentation just as if you used a merge var (and they can be used with other segmentation
1447
- * options), though performance may degrade at that point.
1448
- *
1449
- * @section List Related
1450
- *
1451
- * @param string $id the list id to connect to. Get by calling lists()
1452
- * @param string $name a unique name per list for the segment - 50 byte maximum length, anything longer will throw an error
1453
- * @return int the id of the new segment, otherwise an error will be thrown.
1454
- */
1455
- function listStaticSegmentAdd($id, $name) {
1456
- $params = array();
1457
- $params["id"] = $id;
1458
- $params["name"] = $name;
1459
- return $this->callServer("listStaticSegmentAdd", $params);
1460
- }
1461
-
1462
- /** Resets a static segment - removes <strong>all</strong> members from the static segment. Note: does not actually affect list member data
1463
- *
1464
- * @section List Related
1465
- *
1466
- * @param string $id the list id to connect to. Get by calling lists()
1467
- * @param int $seg_id the id of the static segment to reset - get from listStaticSegments()
1468
- * @return bool true if it worked, otherwise an error is thrown.
1469
- */
1470
- function listStaticSegmentReset($id, $seg_id) {
1471
- $params = array();
1472
- $params["id"] = $id;
1473
- $params["seg_id"] = $seg_id;
1474
- return $this->callServer("listStaticSegmentReset", $params);
1475
- }
1476
-
1477
- /** Delete a static segment. Note that this will, of course, remove any member affiliations with the segment
1478
- *
1479
- * @section List Related
1480
- *
1481
- * @param string $id the list id to connect to. Get by calling lists()
1482
- * @param int $seg_id the id of the static segment to delete - get from listStaticSegments()
1483
- * @return bool true if it worked, otherwise an error is thrown.
1484
- */
1485
- function listStaticSegmentDel($id, $seg_id) {
1486
- $params = array();
1487
- $params["id"] = $id;
1488
- $params["seg_id"] = $seg_id;
1489
- return $this->callServer("listStaticSegmentDel", $params);
1490
- }
1491
-
1492
- /** Add list members to a static segment. It is suggested that you limit batch size to no more than 10,000 addresses per call. Email addresses must exist on the list
1493
- * in order to be included - this <strong>will not</strong> subscribe them to the list!
1494
- *
1495
- * @section List Related
1496
- *
1497
- * @param string $id the list id to connect to. Get by calling lists()
1498
- * @param int $seg_id the id of the static segment to modify - get from listStaticSegments()
1499
- * @param array $batch an array of email addresses and/or unique_ids to add to the segment
1500
- * @return array an array with the results of the operation
1501
- * @returnf int success the total number of successful updates (will include members already in the segment)
1502
- * @returnf array errors the email address, an error code, and a message explaining why they couldn't be added
1503
- */
1504
- function listStaticSegmentMembersAdd($id, $seg_id, $batch) {
1505
- $params = array();
1506
- $params["id"] = $id;
1507
- $params["seg_id"] = $seg_id;
1508
- $params["batch"] = $batch;
1509
- return $this->callServer("listStaticSegmentMembersAdd", $params);
1510
- }
1511
-
1512
- /** Remove list members from a static segment. It is suggested that you limit batch size to no more than 10,000 addresses per call. Email addresses must exist on the list
1513
- * in order to be removed - this <strong>will not</strong> unsubscribe them from the list!
1514
- *
1515
- * @section List Related
1516
- *
1517
- * @param string $id the list id to connect to. Get by calling lists()
1518
- * @param int $seg_id the id of the static segment to delete - get from listStaticSegments()
1519
- * @param array $batch an array of email addresses and/or unique_ids to remove from the segment
1520
- * @return array an array with the results of the operation
1521
- * @returnf int success the total number of succesful removals
1522
- * @returnf array errors the email address, an error code, and a message explaining why they couldn't be removed
1523
- */
1524
- function listStaticSegmentMembersDel($id, $seg_id, $batch) {
1525
- $params = array();
1526
- $params["id"] = $id;
1527
- $params["seg_id"] = $seg_id;
1528
- $params["batch"] = $batch;
1529
- return $this->callServer("listStaticSegmentMembersDel", $params);
1530
- }
1531
-
1532
- /**
1533
- * Subscribe the provided email to a list. By default this sends a confirmation email - you will not see new members until the link contained in it is clicked!
1534
- *
1535
- * @section List Related
1536
- *
1537
- * @example mcapi_listSubscribe.php
1538
- * @example json_listSubscribe.php
1539
- * @example xml-rpc_listSubscribe.php
1540
- *
1541
- * @param string $id the list id to connect to. Get by calling lists()
1542
- * @param string $email_address the email address to subscribe
1543
- * @param array $merge_vars optional merges for the email (FNAME, LNAME, etc.) (see examples below for handling "blank" arrays). Note that a merge field can only hold up to 255 bytes. Also, there are a few "special" keys:
1544
- string EMAIL set this to change the email address. This is only respected on calls using update_existing or when passed to listUpdateMember()
1545
- array GROUPINGS Set Interest Groups by Grouping. Each element in this array should be an array containing the "groups" parameter which contains a comma delimited list of Interest Groups to add. Commas in Interest Group names should be escaped with a backslash. ie, "," =&gt; "\," and either an "id" or "name" parameter to specify the Grouping - get from listInterestGroupings()
1546
- string OPTINIP Set the Opt-in IP fields. <em>Abusing this may cause your account to be suspended.</em> We do validate this and it must not be a private IP address.
1547
- array MC_LOCATION Set the members geographic location. By default if this merge field exists, we'll update using the optin_ip if it exists. If the array contains LATITUDE and LONGITUDE keys, they will be used. NOTE - this will slow down each subscribe call a bit, especially for lat/lng pairs in sparsely populated areas. Currently our automated background processes can and will overwrite this based on opens and clicks.
1548
-
1549
- <strong>Handling Field Data Types</strong> - most fields you can just pass a string and all is well. For some, though, that is not the case...
1550
- Field values should be formatted as follows:
1551
- string address For the string version of an Address, the fields should be delimited by <strong>2</strong> spaces. Address 2 can be skipped. The Country should be a 2 character ISO-3166-1 code and will default to your default country if not set
1552
- array address For the array version of an Address, the requirements for Address 2 and Country are the same as with the string version. Then simply pass us an array with the keys <strong>addr1</strong>, <strong>addr2</strong>, <strong>city</strong>, <strong>state</strong>, <strong>zip</strong>, <strong>country</strong> and appropriate values for each
1553
-
1554
- string date use YYYY-MM-DD to be safe. Generally, though, anything strtotime() understands we'll understand - <a href="http://us2.php.net/strtotime" target="_blank">http://us2.php.net/strtotime</a>
1555
- string dropdown can be a normal string - we <em>will</em> validate that the value is a valid option
1556
- string image must be a valid, existing url. we <em>will</em> check its existence
1557
- string multi_choice can be a normal string - we <em>will</em> validate that the value is a valid option
1558
- double number pass in a valid number - anything else will turn in to zero (0). Note, this will be rounded to 2 decimal places
1559
- string phone If your account has the US Phone numbers option set, this <em>must</em> be in the form of NPA-NXX-LINE (404-555-1212). If not, we assume an International number and will simply set the field with what ever number is passed in.
1560
- string website This is a standard string, but we <em>will</em> verify that it looks like a valid URL
1561
-
1562
- * @param string $email_type optional email type preference for the email (html, text, or mobile defaults to html)
1563
- * @param bool $double_optin optional flag to control whether a double opt-in confirmation message is sent, defaults to true. <em>Abusing this may cause your account to be suspended.</em>
1564
- * @param bool $update_existing optional flag to control whether a existing subscribers should be updated instead of throwing and error, defaults to false
1565
- * @param bool $replace_interests optional flag to determine whether we replace the interest groups with the groups provided, or we add the provided groups to the member's interest groups (optional, defaults to true)
1566
- * @param bool $send_welcome optional if your double_optin is false and this is true, we will send your lists Welcome Email if this subscribe succeeds - this will *not* fire if we end up updating an existing subscriber. If double_optin is true, this has no effect. defaults to false.
1567
- * @return boolean true on success, false on failure. When using MCAPI.class.php, the value can be tested and error messages pulled from the MCAPI object (see below)
1568
- */
1569
- function listSubscribe($id, $email_address, $merge_vars=NULL, $email_type='html', $double_optin=true, $update_existing=false, $replace_interests=true, $send_welcome=false) {
1570
- $params = array();
1571
- $params["id"] = $id;
1572
- $params["email_address"] = $email_address;
1573
- $params["merge_vars"] = $merge_vars;
1574
- $params["email_type"] = $email_type;
1575
- $params["double_optin"] = $double_optin;
1576
- $params["update_existing"] = $update_existing;
1577
- $params["replace_interests"] = $replace_interests;
1578
- $params["send_welcome"] = $send_welcome;
1579
- return $this->callServer("listSubscribe", $params);
1580
- }
1581
-
1582
- /**
1583
- * Unsubscribe the given email address from the list
1584
- *
1585
- * @section List Related
1586
- * @example mcapi_listUnsubscribe.php
1587
- * @example xml-rpc_listUnsubscribe.php
1588
- *
1589
- * @param string $id the list id to connect to. Get by calling lists()
1590
- * @param string $email_address the email address to unsubscribe OR the email "id" returned from listMemberInfo, Webhooks, and Campaigns
1591
- * @param boolean $delete_member flag to completely delete the member from your list instead of just unsubscribing, default to false
1592
- * @param boolean $send_goodbye flag to send the goodbye email to the email address, defaults to true
1593
- * @param boolean $send_notify flag to send the unsubscribe notification email to the address defined in the list email notification settings, defaults to true
1594
- * @return boolean true on success, false on failure. When using MCAPI.class.php, the value can be tested and error messages pulled from the MCAPI object (see below)
1595
- */
1596
- function listUnsubscribe($id, $email_address, $delete_member=false, $send_goodbye=true, $send_notify=true) {
1597
- $params = array();
1598
- $params["id"] = $id;
1599
- $params["email_address"] = $email_address;
1600
- $params["delete_member"] = $delete_member;
1601
- $params["send_goodbye"] = $send_goodbye;
1602
- $params["send_notify"] = $send_notify;
1603
- return $this->callServer("listUnsubscribe", $params);
1604
- }
1605
-
1606
- /**
1607
- * Edit the email address, merge fields, and interest groups for a list member. If you are doing a batch update on lots of users,
1608
- * consider using listBatchSubscribe() with the update_existing and possible replace_interests parameter.
1609
- *
1610
- * @section List Related
1611
- * @example mcapi_listUpdateMember.php
1612
- *
1613
- * @param string $id the list id to connect to. Get by calling lists()
1614
- * @param string $email_address the current email address of the member to update OR the "id" for the member returned from listMemberInfo, Webhooks, and Campaigns
1615
- * @param array $merge_vars array of new field values to update the member with. See merge_vars in listSubscribe() for details.
1616
- * @param string $email_type change the email type preference for the member ("html", "text", or "mobile"). Leave blank to keep the existing preference (optional)
1617
- * @param boolean $replace_interests flag to determine whether we replace the interest groups with the updated groups provided, or we add the provided groups to the member's interest groups (optional, defaults to true)
1618
- * @return boolean true on success, false on failure. When using MCAPI.class.php, the value can be tested and error messages pulled from the MCAPI object
1619
- */
1620
- function listUpdateMember($id, $email_address, $merge_vars, $email_type='', $replace_interests=true) {
1621
- $params = array();
1622
- $params["id"] = $id;
1623
- $params["email_address"] = $email_address;
1624
- $params["merge_vars"] = $merge_vars;
1625
- $params["email_type"] = $email_type;
1626
- $params["replace_interests"] = $replace_interests;
1627
- return $this->callServer("listUpdateMember", $params);
1628
- }
1629
-
1630
- /**
1631
- * Subscribe a batch of email addresses to a list at once. If you are using a serialized version of the API, we strongly suggest that you
1632
- * only run this method as a POST request, and <em>not</em> a GET request. Maximum batch sizes vary based on the amount of data in each record,
1633
- * though you should cap them at 5k - 10k records, depending on your experience. These calls are also long, so be sure you increase your timeout values.
1634
- *
1635
- * @section List Related
1636
- *
1637
- * @example mcapi_listBatchSubscribe.php
1638
- * @example xml-rpc_listBatchSubscribe.php
1639
- *
1640
- * @param string $id the list id to connect to. Get by calling lists()
1641
- * @param array $batch an array of structs for each address to import with two special keys: "EMAIL" for the email address, and "EMAIL_TYPE" for the email type option (html, text, or mobile)
1642
- * @param boolean $double_optin flag to control whether to send an opt-in confirmation email - defaults to true
1643
- * @param boolean $update_existing flag to control whether to update members that are already subscribed to the list or to return an error, defaults to false (return error)
1644
- * @param boolean $replace_interests flag to determine whether we replace the interest groups with the updated groups provided, or we add the provided groups to the member's interest groups (optional, defaults to true)
1645
- * @return struct Array of result counts and any errors that occurred
1646
- * @returnf int add_count Number of email addresses that were succesfully added
1647
- * @returnf int update_count Number of email addresses that were succesfully updated
1648
- * @returnf int error_count Number of email addresses that failed during addition/updating
1649
- * @returnf array errors Array of error arrays, each containing:
1650
- string code the error code
1651
- string message the full error message
1652
- string email the email address being processed
1653
- */
1654
- function listBatchSubscribe($id, $batch, $double_optin=true, $update_existing=false, $replace_interests=true) {
1655
- $params = array();
1656
- $params["id"] = $id;
1657
- $params["batch"] = $batch;
1658
- $params["double_optin"] = $double_optin;
1659
- $params["update_existing"] = $update_existing;
1660
- $params["replace_interests"] = $replace_interests;
1661
- return $this->callServer("listBatchSubscribe", $params);
1662
- }
1663
-
1664
- /**
1665
- * Unsubscribe a batch of email addresses to a list
1666
- *
1667
- * @section List Related
1668
- * @example mcapi_listBatchUnsubscribe.php
1669
- *
1670
- * @param string $id the list id to connect to. Get by calling lists()
1671
- * @param array $emails array of email addresses to unsubscribe
1672
- * @param boolean $delete_member flag to completely delete the member from your list instead of just unsubscribing, default to false
1673
- * @param boolean $send_goodbye flag to send the goodbye email to the email addresses, defaults to true
1674
- * @param boolean $send_notify flag to send the unsubscribe notification email to the address defined in the list email notification settings, defaults to false
1675
- * @return struct Array of result counts and any errors that occurred
1676
- * @returnf int success_count Number of email addresses that were succesfully added/updated
1677
- * @returnf int error_count Number of email addresses that failed during addition/updating
1678
- * @returnf array errors Array of error structs. Each error struct will contain "code", "message", and "email"
1679
- */
1680
- function listBatchUnsubscribe($id, $emails, $delete_member=false, $send_goodbye=true, $send_notify=false) {
1681
- $params = array();
1682
- $params["id"] = $id;
1683
- $params["emails"] = $emails;
1684
- $params["delete_member"] = $delete_member;
1685
- $params["send_goodbye"] = $send_goodbye;
1686
- $params["send_notify"] = $send_notify;
1687
- return $this->callServer("listBatchUnsubscribe", $params);
1688
- }
1689
-
1690
- /**
1691
- * Get all of the list members for a list that are of a particular status. Are you trying to get a dump including lots of merge
1692
- * data or specific members of a list? If so, checkout the <a href="/api/export">Export API</a>
1693
- *
1694
- * @section List Related
1695
- * @example mcapi_listMembers.php
1696
- *
1697
- * @param string $id the list id to connect to. Get by calling lists()
1698
- * @param string $status the status to get members for - one of(subscribed, unsubscribed, <a target="_blank" href="http://eepurl.com/dwk1">cleaned</a>, updated), defaults to subscribed
1699
- * @param string $since optional pull all members whose status (subscribed/unsubscribed/cleaned) has changed or whose profile (updated) has changed since this date/time (in GMT) - format is YYYY-MM-DD HH:mm:ss (24hr)
1700
- * @param int $start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
1701
- * @param int $limit optional for large data sets, the number of results to return - defaults to 100, upper limit set at 15000
1702
- * @return array Array of a the total records match and matching list member data for this page (see Returned Fields for details)
1703
- * @returnf int total the total matching records
1704
- * @returnf array data the data for each member, including:
1705
- string email Member email address
1706
- date timestamp timestamp of their associated status date (subscribed, unsubscribed, cleaned, or updated) in GMT
1707
- string reason For unsubscribes only - the reason collected for the unsubscribe. If populated, one of 'NORMAL','NOSIGNUP','INAPPROPRIATE','SPAM','OTHER'
1708
- string reason_text For unsubscribes only - if the reason is OTHER, the text entered.
1709
- */
1710
- function listMembers($id, $status='subscribed', $since=NULL, $start=0, $limit=100) {
1711
- $params = array();
1712
- $params["id"] = $id;
1713
- $params["status"] = $status;
1714
- $params["since"] = $since;
1715
- $params["start"] = $start;
1716
- $params["limit"] = $limit;
1717
- return $this->callServer("listMembers", $params);
1718
- }
1719
-
1720
- /**
1721
- * Get all the information for particular members of a list
1722
- *
1723
- * @section List Related
1724
- * @example mcapi_listMemberInfo.php
1725
- * @example xml-rpc_listMemberInfo.php
1726
- *
1727
- * @param string $id the list id to connect to. Get by calling lists()
1728
- * @param array $email_address an array of up to 50 email addresses to get information for OR the "id"(s) for the member returned from listMembers, Webhooks, and Campaigns. For backwards compatibility, if a string is passed, it will be treated as an array with a single element (will not work with XML-RPC).
1729
- * @return array array of list members with their info in an array (see Returned Fields for details)
1730
- * @returnf int success the number of subscribers successfully found on the list
1731
- * @returnf int errors the number of subscribers who were not found on the list
1732
- * @returnf array data an array of arrays where each one has member info:
1733
- string id The unique id for this email address on an account
1734
- string email The email address associated with this record
1735
- string email_type The type of emails this customer asked to get: html, text, or mobile
1736
- array merges An associative array of all the merge tags and the data for those tags for this email address. <em>Note</em>: Interest Groups are returned as comma delimited strings - if a group name contains a comma, it will be escaped with a backslash. ie, "," =&gt; "\,". Groupings will be returned with their "id" and "name" as well as a "groups" field formatted just like Interest Groups
1737
- string status The subscription status for this email address, either pending, subscribed, unsubscribed, or cleaned
1738
- string ip_opt IP Address this address opted in from.
1739
- string ip_signup IP Address this address signed up from.
1740
- int member_rating the rating of the subscriber. This will be 1 - 5 as described <a href="http://eepurl.com/f-2P" target="_blank">here</a>
1741
- string campaign_id If the user is unsubscribed and they unsubscribed from a specific campaign, that campaign_id will be listed, otherwise this is not returned.
1742
- array lists An associative array of the other lists this member belongs to - the key is the list id and the value is their status in that list.
1743
- date timestamp The time this email address was added to the list
1744
- date info_changed The last time this record was changed. If the record is old enough, this may be blank.
1745
- int web_id The Member id used in our web app, allows you to create a link directly to it
1746
- array clients the various clients we've tracked the address as using - each included array includes client 'name' and 'icon_url'
1747
- array static_segments the 'id', 'name', and date 'added' for any static segment this member is in
1748
- */
1749
- function listMemberInfo($id, $email_address) {
1750
- $params = array();
1751
- $params["id"] = $id;
1752
- $params["email_address"] = $email_address;
1753
- return $this->callServer("listMemberInfo", $params);
1754
- }
1755
-
1756
- /**
1757
- * Get the most recent 100 activities for particular list members (open, click, bounce, unsub, abuse, sent to)
1758
- *
1759
- * @section List Related
1760
- * @example mcapi_listMemberInfo.php
1761
- * @example xml-rpc_listMemberInfo.php
1762
- *
1763
- * @param string $id the list id to connect to. Get by calling lists()
1764
- * @param array $email_address an array of up to 50 email addresses to get information for OR the "id"(s) for the member returned from listMembers, Webhooks, and Campaigns.
1765
- * @return array array of data and success/error counts
1766
- * @returnf int success the number of subscribers successfully found on the list
1767
- * @returnf int errors the number of subscribers who were not found on the list
1768
- * @returnf array data an array of arrays where each activity record has:
1769
- string action The action name, one of: open, click, bounce, unsub, abuse, sent
1770
- string timestamp The date/time of the action
1771
- string url For click actions, the url clicked, otherwise this is empty
1772
- string bounce_type For bounce actions, the bounce type, otherwise this is empty
1773
- string campaign_id The campaign id the action was related to, if it exists - otherwise empty (ie, direct unsub from list)
1774
- */
1775
- function listMemberActivity($id, $email_address) {
1776
- $params = array();
1777
- $params["id"] = $id;
1778
- $params["email_address"] = $email_address;
1779
- return $this->callServer("listMemberActivity", $params);
1780
- }
1781
-
1782
- /**
1783
- * Get all email addresses that complained about a given campaign
1784
- *
1785
- * @section List Related
1786
- *
1787
- * @example mcapi_listAbuseReports.php
1788
- *
1789
- * @param string $id the list id to pull abuse reports for (can be gathered using lists())
1790
- * @param int $start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
1791
- * @param int $limit optional for large data sets, the number of results to return - defaults to 500, upper limit set at 1000
1792
- * @param string $since optional pull only messages since this time - use YYYY-MM-DD HH:II:SS format in <strong>GMT</strong>
1793
- * @return array the total of all reports and the specific reports reports this page
1794
- * @returnf int total the total number of matching abuse reports
1795
- * @returnf array data the actual data for each reports, including:
1796
- string date date/time the abuse report was received and processed
1797
- string email the email address that reported abuse
1798
- string campaign_id the unique id for the campaign that report was made against
1799
- string type an internal type generally specifying the orginating mail provider - may not be useful outside of filling report views
1800
- */
1801
- function listAbuseReports($id, $start=0, $limit=500, $since=NULL) {
1802
- $params = array();
1803
- $params["id"] = $id;
1804
- $params["start"] = $start;
1805
- $params["limit"] = $limit;
1806
- $params["since"] = $since;
1807
- return $this->callServer("listAbuseReports", $params);
1808
- }
1809
-
1810
- /**
1811
- * Access the Growth History by Month for a given list.
1812
- *
1813
- * @section List Related
1814
- *
1815
- * @example mcapi_listGrowthHistory.php
1816
- *
1817
- * @param string $id the list id to connect to. Get by calling lists()
1818
- * @return array array of months and growth
1819
- * @returnf string month The Year and Month in question using YYYY-MM format
1820
- * @returnf int existing number of existing subscribers to start the month
1821
- * @returnf int imports number of subscribers imported during the month
1822
- * @returnf int optins number of subscribers who opted-in during the month
1823
- */
1824
- function listGrowthHistory($id) {
1825
- $params = array();
1826
- $params["id"] = $id;
1827
- return $this->callServer("listGrowthHistory", $params);
1828
- }
1829
-
1830
- /**
1831
- * Access up to the previous 180 days of daily detailed aggregated activity stats for a given list
1832
- *
1833
- * @section List Related
1834
- *
1835
- *
1836
- * @param string $id the list id to connect to. Get by calling lists()
1837
- * @return array array of array of daily values, each containing:
1838
- * @returnf string day The day in YYYY-MM-DD
1839
- * @returnf int emails_sent number of emails sent to the list
1840
- * @returnf int unique_opens number of unique opens for the list
1841
- * @returnf int recipient_clicks number of clicks for the list
1842
- * @returnf int hard_bounce number of hard bounces for the list
1843
- * @returnf int soft_bounce number of soft bounces for the list
1844
- * @returnf int abuse_reports number of abuse reports for the list
1845
- * @returnf int subs number of double optin subscribes for the list
1846
- * @returnf int unsubs number of manual unsubscribes for the list
1847
- * @returnf int other_adds number of non-double optin subscribes for the list (manual, API, or import)
1848
- * @returnf int other_removes number of non-manual unsubscribes for the list (deletions, empties, soft-bounce removals)
1849
- */
1850
- function listActivity($id) {
1851
- $params = array();
1852
- $params["id"] = $id;
1853
- return $this->callServer("listActivity", $params);
1854
- }
1855
-
1856
- /**
1857
- * Retrieve the locations (countries) that the list's subscribers have been tagged to based on geocoding their IP address
1858
- *
1859
- * @section List Related
1860
- *
1861
- * @param string $id the list id to connect to. Get by calling lists()
1862
- * @return array array of locations
1863
- * @returnf string country the country name
1864
- * @returnf string cc the 2 digit country code
1865
- * @returnf double percent the percent of subscribers in the country
1866
- * @returnf double total the total number of subscribers in the country
1867
- */
1868
- function listLocations($id) {
1869
- $params = array();
1870
- $params["id"] = $id;
1871
- return $this->callServer("listLocations", $params);
1872
- }
1873
-
1874
- /**
1875
- * Retrieve the clients that the list's subscribers have been tagged as being used based on user agents seen. Made possible by <a href="http://user-agent-string.info" target="_blank">user-agent-string.info</a>
1876
- *
1877
- * @section List Related
1878
- *
1879
- * @param string $id the list id to connect to. Get by calling lists()
1880
- * @return array the desktop and mobile user agents in use on the list
1881
- * @returnf array desktop desktop user agents and percentages
1882
- double penetration the percent of desktop clients in use
1883
- array clients a record containing the 'client', an 'icon' image url, the 'percent' using the client, and the total 'members' represented
1884
- * @returnf array mobile mobile user agents and percentages
1885
- double penetration the percent of mobile clients in use
1886
- array clients a record containing the 'client', an 'icon' image url, the 'percent' using the client, and the total 'members' represented
1887
- */
1888
- function listClients($id) {
1889
- $params = array();
1890
- $params["id"] = $id;
1891
- return $this->callServer("listClients", $params);
1892
- }
1893
-
1894
- /**
1895
- * Retrieve various templates available in the system, allowing some thing similar to our template gallery to be created.
1896
- *
1897
- * @section Template Related
1898
- * @example mcapi_templates.php
1899
- * @example xml-rpc_templates.php
1900
- *
1901
- * @param array $types optional the types of templates to return
1902
- boolean user Customer template for this user account. Defaults to true.
1903
- boolean gallery Templates from our Gallery. Note that some templates that require extra configuration are withheld. (eg, the Etsy template). Defaults to false.
1904
- boolean base Our "start from scratch" extremely basic templates
1905
- * @param string $category optional for Gallery templates only, limit to a specific template category
1906
- * @param array $inactives optional options to control how inactive templates are returned, if at all
1907
- boolean include user templates are not deleted, only set inactive. defaults to false.
1908
- boolean only only include inactive templates. defaults to false.
1909
- * @return array An array of structs, one for each template (see Returned Fields for details)
1910
- * @returnf int id Id of the template
1911
- * @returnf string name Name of the template
1912
- * @returnf string layout Layout of the template - "basic", "left_column", "right_column", or "postcard"
1913
- * @returnf string preview_image If we've generated it, the url of the preview image for the template. We do out best to keep these up to date, but Preview image urls are not guaranteed to be available
1914
- * @returnf string date_created The date/time the template was created
1915
- * @returnf bool edit_source Whether or not you are able to edit the source of a template.
1916
- */
1917
- function templates($types=array (
1918
- ), $category=NULL, $inactives=array (
1919
- )) {
1920
- $params = array();
1921
- $params["types"] = $types;
1922
- $params["category"] = $category;
1923
- $params["inactives"] = $inactives;
1924
- return $this->callServer("templates", $params);
1925
- }
1926
-
1927
- /**
1928
- * Pull details for a specific template to help support editing
1929
- *
1930
- * @section Template Related
1931
- *
1932
- * @param int $tid the template id - get from templates()
1933
- * @param string $type the template type to load - one of 'user', 'gallery', 'base'
1934
- * @return array an array of info to be used when editing
1935
- * @returnf array default_content the default content broken down into the named editable sections for the template
1936
- * @returnf array sections the valid editable section names
1937
- * @returnf string source the full source of the template as if you exported it via our template editor
1938
- * @returnf string preview similar to the source, but the rendered version of the source from our popup preview
1939
- */
1940
- function templateInfo($tid, $type='user') {
1941
- $params = array();
1942
- $params["tid"] = $tid;
1943
- $params["type"] = $type;
1944
- return $this->callServer("templateInfo", $params);
1945
- }
1946
-
1947
- /**
1948
- * Create a new user template, <strong>NOT</strong> campaign content. These templates can then be applied while creating campaigns.
1949
- *
1950
- * @section Template Related
1951
- * @example mcapi_create_template.php
1952
- * @example xml-rpc_create_template.php
1953
- *
1954
- * @param string $name the name for the template - names must be unique and a max of 50 bytes
1955
- * @param string $html a string specifying the entire template to be created. This is <strong>NOT</strong> campaign content. They are intended to utilize our <a href="http://www.mailchimp.com/resources/email-template-language/" target="_blank">template language</a>.
1956
- * @return int the new template id, otherwise an error is thrown.
1957
- */
1958
- function templateAdd($name, $html) {
1959
- $params = array();
1960
- $params["name"] = $name;
1961
- $params["html"] = $html;
1962
- return $this->callServer("templateAdd", $params);
1963
- }
1964
-
1965
- /**
1966
- * Replace the content of a user template, <strong>NOT</strong> campaign content.
1967
- *
1968
- * @section Template Related
1969
- *
1970
- * @param int $id the id of the user template to update
1971
- * @param array $values the values to updates - while both are optional, at least one should be provided. Both can be updated at the same time.
1972
- string name optional the name for the template - names must be unique and a max of 50 bytes
1973
- string html optional a string specifying the entire template to be created. This is <strong>NOT</strong> campaign content. They are intended to utilize our <a href="http://www.mailchimp.com/resources/email-template-language/" target="_blank">template language</a>.
1974
-
1975
- * @return boolean true if the template was updated, otherwise an error will be thrown
1976
- */
1977
- function templateUpdate($id, $values) {
1978
- $params = array();
1979
- $params["id"] = $id;
1980
- $params["values"] = $values;
1981
- return $this->callServer("templateUpdate", $params);
1982
- }
1983
-
1984
- /**
1985
- * Delete (deactivate) a user template
1986
- *
1987
- * @section Template Related
1988
- *
1989
- * @param int $id the id of the user template to delete
1990
- * @return boolean true if the template was deleted, otherwise an error will be thrown
1991
- */
1992
- function templateDel($id) {
1993
- $params = array();
1994
- $params["id"] = $id;
1995
- return $this->callServer("templateDel", $params);
1996
- }
1997
-
1998
- /**
1999
- * Undelete (reactivate) a user template
2000
- *
2001
- * @section Template Related
2002
- *
2003
- * @param int $id the id of the user template to reactivate
2004
- * @return boolean true if the template was deleted, otherwise an error will be thrown
2005
- */
2006
- function templateUndel($id) {
2007
- $params = array();
2008
- $params["id"] = $id;
2009
- return $this->callServer("templateUndel", $params);
2010
- }
2011
-
2012
- /**
2013
- * Retrieve lots of account information including payments made, plan info, some account stats, installed modules,
2014
- * contact info, and more. No private information like Credit Card numbers is available.
2015
- *
2016
- * @section Helper
2017
- *
2018
- * @return array containing the details for the account tied to this API Key
2019
- * @returnf string username The Account username
2020
- * @returnf string user_id The Account user unique id (for building some links)
2021
- * @returnf bool is_trial Whether the Account is in Trial mode (can only send campaigns to less than 100 emails)
2022
- * @returnf string timezone The timezone for the Account - default is "US/Eastern"
2023
- * @returnf string plan_type Plan Type - "monthly", "payasyougo", or "free"
2024
- * @returnf int plan_low <em>only for Monthly plans</em> - the lower tier for list size
2025
- * @returnf int plan_high <em>only for Monthly plans</em> - the upper tier for list size
2026
- * @returnf string plan_start_date <em>only for Monthly plans</em> - the start date for a monthly plan
2027
- * @returnf int emails_left <em>only for Free and Pay-as-you-go plans</em> emails credits left for the account
2028
- * @returnf bool pending_monthly Whether the account is finishing Pay As You Go credits before switching to a Monthly plan
2029
- * @returnf string first_payment date of first payment
2030
- * @returnf string last_payment date of most recent payment
2031
- * @returnf int times_logged_in total number of times the account has been logged into via the web
2032
- * @returnf string last_login date/time of last login via the web
2033
- * @returnf string affiliate_link Monkey Rewards link for our Affiliate program
2034
- * @returnf array contact Contact details for the account
2035
- string fname First Name
2036
- string lname Last Name
2037
- string email Email Address
2038
- string company Company Name
2039
- string address1 Address Line 1
2040
- string address2 Address Line 2
2041
- string city City
2042
- string state State or Province
2043
- string zip Zip or Postal Code
2044
- string country Country name
2045
- string url Website URL
2046
- string phone Phone number
2047
- string fax Fax number
2048
- * @returnf array modules Addons installed in the account
2049
- string name The module name
2050
- string added The date the module was added
2051
- * @returnf array orders Order details for the account
2052
- int order_id The order id
2053
- string type The order type - either "monthly" or "credits"
2054
- double amount The order amount
2055
- string date The order date
2056
- double credits_used The total credits used
2057
- * @returnf array rewards Rewards details for the account including credits & inspections earned, number of referals, referal details, and rewards used
2058
- int referrals_this_month the total number of referrals this month
2059
- string notify_on whether or not we notify the user when rewards are earned
2060
- string notify_email the email address address used for rewards notifications
2061
- array credits Email credits earned "this_month", "total_earned", and "remaining"
2062
- array inspections Inbox Inspections earned "this_month", "total_earned", and "remaining"
2063
- array referrals All referrals, including "name", "email", "signup_date", and "type"
2064
- array applied Applied rewards, including "value", "date", "order_id", and "order_desc"
2065
- */
2066
- function getAccountDetails() {
2067
- $params = array();
2068
- return $this->callServer("getAccountDetails", $params);
2069
- }
2070
-
2071
- /**
2072
- * Have HTML content auto-converted to a text-only format. You can send: plain HTML, an array of Template content, an existing Campaign Id, or an existing Template Id. Note that this will <b>not</b> save anything to or update any of your lists, campaigns, or templates.
2073
- *
2074
- * @section Helper
2075
- * @example xml-rpc_generateText.php
2076
- *
2077
- * @param string $type The type of content to parse. Must be one of: "html", "template", "url", "cid" (Campaign Id), or "tid" (Template Id)
2078
- * @param mixed $content The content to use. For "html" expects a single string value, "template" expects an array like you send to campaignCreate, "url" expects a valid & public URL to pull from, "cid" expects a valid Campaign Id, and "tid" expects a valid Template Id on your account.
2079
- * @return string the content pass in converted to text.
2080
- */
2081
- function generateText($type, $content) {
2082
- $params = array();
2083
- $params["type"] = $type;
2084
- $params["content"] = $content;
2085
- return $this->callServer("generateText", $params);
2086
- }
2087
-
2088
- /**
2089
- * Send your HTML content to have the CSS inlined and optionally remove the original styles.
2090
- *
2091
- * @section Helper
2092
- * @example xml-rpc_inlineCss.php
2093
- *
2094
- * @param string $html Your HTML content
2095
- * @param bool $strip_css optional Whether you want the CSS &lt;style&gt; tags stripped from the returned document. Defaults to false.
2096
- * @return string Your HTML content with all CSS inlined, just like if we sent it.
2097
- */
2098
- function inlineCss($html, $strip_css=false) {
2099
- $params = array();
2100
- $params["html"] = $html;
2101
- $params["strip_css"] = $strip_css;
2102
- return $this->callServer("inlineCss", $params);
2103
- }
2104
-
2105
- /**
2106
- * List all the folders for a user account
2107
- *
2108
- * @section Folder Related
2109
- * @example mcapi_folders.php
2110
- * @example xml-rpc_folders.php
2111
- *
2112
- * @param string $type optional the type of folders to return - either "campaign" or "autoresponder". Defaults to "campaign"
2113
- * @return array Array of folder structs (see Returned Fields for details)
2114
- * @returnf int folder_id Folder Id for the given folder, this can be used in the campaigns() function to filter on.
2115
- * @returnf string name Name of the given folder
2116
- * @returnf string date_created The date/time the folder was created
2117
- * @returnf string type The type of the folders being returned, just to make sure you know.
2118
- */
2119
- function folders($type='campaign') {
2120
- $params = array();
2121
- $params["type"] = $type;
2122
- return $this->callServer("folders", $params);
2123
- }
2124
-
2125
- /**
2126
- * Add a new folder to file campaigns or autoresponders in
2127
- *
2128
- * @section Folder Related
2129
- * @example mcapi_folderAdd.php
2130
- * @example xml-rpc_folderAdd.php
2131
- *
2132
- * @param string $name a unique name for a folder (max 100 bytes)
2133
- * @param string $type optional the type of folder to create - either "campaign" or "autoresponder". Defaults to "campaign"
2134
- * @return int the folder_id of the newly created folder.
2135
- */
2136
- function folderAdd($name, $type='campaign') {
2137
- $params = array();
2138
- $params["name"] = $name;
2139
- $params["type"] = $type;
2140
- return $this->callServer("folderAdd", $params);
2141
- }
2142
-
2143
- /**
2144
- * Update the name of a folder for campaigns or autoresponders
2145
- *
2146
- * @section Folder Related
2147
- *
2148
- * @param int $fid the folder id to update - retrieve from folders()
2149
- * @param string $name a new, unique name for the folder (max 100 bytes)
2150
- * @param string $type optional the type of folder to create - either "campaign" or "autoresponder". Defaults to "campaign"
2151
- * @return bool true if the update worked, otherwise an exception is thrown
2152
- */
2153
- function folderUpdate($fid, $name, $type='campaign') {
2154
- $params = array();
2155
- $params["fid"] = $fid;
2156
- $params["name"] = $name;
2157
- $params["type"] = $type;
2158
- return $this->callServer("folderUpdate", $params);
2159
- }
2160
-
2161
- /**
2162
- * Delete a campaign or autoresponder folder. Note that this will simply make campaigns in the folder appear unfiled, they are not removed.
2163
- *
2164
- * @section Folder Related
2165
- *
2166
- * @param int $fid the folder id to update - retrieve from folders()
2167
- * @param string $type optional the type of folder to create - either "campaign" or "autoresponder". Defaults to "campaign"
2168
- * @return bool true if the delete worked, otherwise an exception is thrown
2169
- */
2170
- function folderDel($fid, $type='campaign') {
2171
- $params = array();
2172
- $params["fid"] = $fid;
2173
- $params["type"] = $type;
2174
- return $this->callServer("folderDel", $params);
2175
- }
2176
-
2177
- /**
2178
- * Retrieve the Ecommerce Orders for an account
2179
- *
2180
- * @section Ecommerce
2181
- *
2182
- * @param int $start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
2183
- * @param int $limit optional for large data sets, the number of results to return - defaults to 100, upper limit set at 500
2184
- * @param string $since optional pull only messages since this time - use YYYY-MM-DD HH:II:SS format in <strong>GMT</strong>
2185
- * @return array the total matching orders and the specific orders for the requested page
2186
- * @returnf int total the total matching orders
2187
- * @returnf array data the actual data for each order being returned
2188
- string store_id the store id generated by the plugin used to uniquely identify a store
2189
- string store_name the store name collected by the plugin - often the domain name
2190
- string order_id the internal order id the store tracked this order by
2191
- string email the email address that received this campaign and is associated with this order
2192
- double order_total the order total
2193
- double tax_total the total tax for the order (if collected)
2194
- double ship_total the shipping total for the order (if collected)
2195
- string order_date the date the order was tracked - from the store if possible, otherwise the GMT time we recieved it
2196
- array lines containing detail of the order - product, category, quantity, item cost
2197
- */
2198
- function ecommOrders($start=0, $limit=100, $since=NULL) {
2199
- $params = array();
2200
- $params["start"] = $start;
2201
- $params["limit"] = $limit;
2202
- $params["since"] = $since;
2203
- return $this->callServer("ecommOrders", $params);
2204
- }
2205
-
2206
- /**
2207
- * Import Ecommerce Order Information to be used for Segmentation. This will generally be used by ecommerce package plugins
2208
- * <a href="/plugins/ecomm360.phtml">that we provide</a> or by 3rd part system developers.
2209
- * @section Ecommerce
2210
- *
2211
- * @param array $order an array of information pertaining to the order that has completed. Use the following keys:
2212
- string id the Order Id
2213
- string email_id optional (kind of) the Email Id of the subscriber we should attach this order to (see the "mc_eid" query string variable a campaign passes) - either this or <strong>email</strong> is required. If both are provided, email_id takes precedence
2214
- string email optional (kind of) the Email Address we should attach this order to - either this or <strong>email_id</strong> is required. If both are provided, email_id takes precedence
2215
- double total The Order Total (ie, the full amount the customer ends up paying)
2216
- string order_date optional the date of the order - if this is not provided, we will default the date to now
2217
- double shipping optional the total paid for Shipping Fees
2218
- double tax optional the total tax paid
2219
- string store_id a unique id for the store sending the order in (20 bytes max)
2220
- string store_name optional a "nice" name for the store - typically the base web address (ie, "store.mailchimp.com"). We will automatically update this if it changes (based on store_id)
2221
- string plugin_id the MailChimp assigned Plugin Id. Get yours by <a href="/api/register.php">registering here</a>
2222
- string campaign_id optional the Campaign Id to track this order with (see the "mc_cid" query string variable a campaign passes)
2223
- array items the individual line items for an order using these keys:
2224
- <div style="padding-left:30px"><table><tr><td colspan=*>
2225
- int line_num optional the line number of the item on the order. We will generate these if they are not passed
2226
- int product_id the store's internal Id for the product. Lines that do no contain this will be skipped
2227
- string product_name the product name for the product_id associated with this item. We will auto update these as they change (based on product_id)
2228
- int category_id the store's internal Id for the (main) category associated with this product. Our testing has found this to be a "best guess" scenario
2229
- string category_name the category name for the category_id this product is in. Our testing has found this to be a "best guess" scenario. Our plugins walk the category heirarchy up and send "Root - SubCat1 - SubCat4", etc.
2230
- double qty the quantity of the item ordered
2231
- double cost the cost of a single item (ie, not the extended cost of the line)
2232
- </td></tr></table></div>
2233
- * @return bool true if the data is saved, otherwise an error is thrown.
2234
- */
2235
- function ecommOrderAdd($order) {
2236
- $params = array();
2237
- $params["order"] = $order;
2238
- return $this->callServer("ecommOrderAdd", $params);
2239
- }
2240
-
2241
- /**
2242
- * Delete Ecommerce Order Information used for segmentation. This will generally be used by ecommerce package plugins
2243
- * <a href="/plugins/ecomm360.phtml">that we provide</a> or by 3rd part system developers.
2244
- * @section Ecommerce
2245
- *
2246
- * @param string $store_id the store id the order belongs to
2247
- * @param string $order_id the order id (generated by the store) to delete
2248
- * @return bool true if an order is deleted, otherwise an error is thrown.
2249
- */
2250
- function ecommOrderDel($store_id, $order_id) {
2251
- $params = array();
2252
- $params["store_id"] = $store_id;
2253
- $params["order_id"] = $order_id;
2254
- return $this->callServer("ecommOrderDel", $params);
2255
- }
2256
-
2257
- /**
2258
- * Retrieve all List Ids a member is subscribed to.
2259
- *
2260
- * @section Helper
2261
- *
2262
- * @param string $email_address the email address to check OR the email "id" returned from listMemberInfo, Webhooks, and Campaigns
2263
- * @return array An array of list_ids the member is subscribed to.
2264
- */
2265
- function listsForEmail($email_address) {
2266
- $params = array();
2267
- $params["email_address"] = $email_address;
2268
- return $this->callServer("listsForEmail", $params);
2269
- }
2270
-
2271
- /**
2272
- * Retrieve all Campaigns Ids a member was sent
2273
- *
2274
- * @section Helper
2275
- *
2276
- * @param string $email_address the email address to unsubscribe OR the email "id" returned from listMemberInfo, Webhooks, and Campaigns
2277
- * @return array An array of campaign_ids the member received
2278
- */
2279
- function campaignsForEmail($email_address) {
2280
- $params = array();
2281
- $params["email_address"] = $email_address;
2282
- return $this->callServer("campaignsForEmail", $params);
2283
- }
2284
-
2285
- /**
2286
- * Return the current Chimp Chatter messages for an account.
2287
- *
2288
- * @section Helper
2289
- *
2290
- * @return array An array of chatter messages and properties
2291
- * @returnf string message The chatter message
2292
- * @returnf string type The type of the message - one of lists:new-subscriber, lists:unsubscribes, lists:profile-updates, campaigns:facebook-likes, campaigns:facebook-comments, campaigns:forward-to-friend, lists:imports, or campaigns:inbox-inspections
2293
- * @returnf string url a url into the web app that the message could link to
2294
- * @returnf string list_id the list_id a message relates to, if applicable
2295
- * @returnf string campaign_id the list_id a message relates to, if applicable
2296
- * @returnf string update_time The date/time the message was last updated
2297
- */
2298
- function chimpChatter() {
2299
- $params = array();
2300
- return $this->callServer("chimpChatter", $params);
2301
- }
2302
-
2303
- /**
2304
- * Retrieve a list of all MailChimp API Keys for this User
2305
- *
2306
- * @section Security Related
2307
- * @example xml-rpc_apikeyAdd.php
2308
- * @example mcapi_apikeyAdd.php
2309
- *
2310
- * @param string $username Your MailChimp user name
2311
- * @param string $password Your MailChimp password
2312
- * @param boolean $expired optional - whether or not to include expired keys, defaults to false
2313
- * @return array an array of API keys including:
2314
- * @returnf string apikey The api key that can be used
2315
- * @returnf string created_at The date the key was created
2316
- * @returnf string expired_at The date the key was expired
2317
- */
2318
- function apikeys($username, $password, $expired=false) {
2319
- $params = array();
2320
- $params["username"] = $username;
2321
- $params["password"] = $password;
2322
- $params["expired"] = $expired;
2323
- return $this->callServer("apikeys", $params);
2324
- }
2325
-
2326
- /**
2327
- * Add an API Key to your account. We will generate a new key for you and return it.
2328
- *
2329
- * @section Security Related
2330
- * @example xml-rpc_apikeyAdd.php
2331
- *
2332
- * @param string $username Your MailChimp user name
2333
- * @param string $password Your MailChimp password
2334
- * @return string a new API Key that can be immediately used.
2335
- */
2336
- function apikeyAdd($username, $password) {
2337
- $params = array();
2338
- $params["username"] = $username;
2339
- $params["password"] = $password;
2340
- return $this->callServer("apikeyAdd", $params);
2341
- }
2342
-
2343
- /**
2344
- * Expire a Specific API Key. Note that if you expire all of your keys, just visit <a href="http://admin.mailchimp.com/account/api" target="_blank">your API dashboard</a>
2345
- * to create a new one. If you are trying to shut off access to your account for an old developer, change your
2346
- * MailChimp password, then expire all of the keys they had access to. Note that this takes effect immediately, so make
2347
- * sure you replace the keys in any working application before expiring them! Consider yourself warned...
2348
- *
2349
- * @section Security Related
2350
- * @example mcapi_apikeyExpire.php
2351
- * @example xml-rpc_apikeyExpire.php
2352
- *
2353
- * @param string $username Your MailChimp user name
2354
- * @param string $password Your MailChimp password
2355
- * @return boolean true if it worked, otherwise an error is thrown.
2356
- */
2357
- function apikeyExpire($username, $password) {
2358
- $params = array();
2359
- $params["username"] = $username;
2360
- $params["password"] = $password;
2361
- return $this->callServer("apikeyExpire", $params);
2362
- }
2363
-
2364
- /**
2365
- * "Ping" the MailChimp API - a simple method you can call that will return a constant value as long as everything is good. Note
2366
- * than unlike most all of our methods, we don't throw an Exception if we are having issues. You will simply receive a different
2367
- * string back that will explain our view on what is going on.
2368
- *
2369
- * @section Helper
2370
- * @example xml-rpc_ping.php
2371
- *
2372
- * @return string returns "Everything's Chimpy!" if everything is chimpy, otherwise returns an error message
2373
- */
2374
- function ping() {
2375
- $params = array();
2376
- return $this->callServer("ping", $params);
2377
- }
2378
-
2379
- /**
2380
- * Internal function - proxy method for certain XML-RPC calls | DO NOT CALL
2381
- * @param mixed Method to call, with any parameters to pass along
2382
- * @return mixed the result of the call
2383
- */
2384
- function callMethod() {
2385
- $params = array();
2386
- return $this->callServer("callMethod", $params);
2387
- }
2388
-
2389
- /**
2390
- * Actually connect to the server and call the requested methods, parsing the result
2391
- * You should never have to call this function manually
2392
- */
2393
- function callServer($method, $params) {
2394
- $dc = "us1";
2395
- if (strstr($this->api_key,"-")){
2396
- list($key, $dc) = explode("-",$this->api_key,2);
2397
- if (!$dc) $dc = "us1";
2398
- }
2399
- $host = $dc.".".$this->apiUrl["host"];
2400
- $params["apikey"] = $this->api_key;
2401
-
2402
- $this->errorMessage = "";
2403
- $this->errorCode = "";
2404
- $sep_changed = false;
2405
- //sigh, apparently some distribs change this to &amp; by default
2406
- if (ini_get("arg_separator.output")!="&"){
2407
- $sep_changed = true;
2408
- $orig_sep = ini_get("arg_separator.output");
2409
- ini_set("arg_separator.output", "&");
2410
- }
2411
- $post_vars = http_build_query($params);
2412
- if ($sep_changed){
2413
- ini_set("arg_separator.output", $orig_sep);
2414
- }
2415
-
2416
- $payload = "POST " . $this->apiUrl["path"] . "?" . $this->apiUrl["query"] . "&method=" . $method . " HTTP/1.0\r\n";
2417
- $payload .= "Host: " . $host . "\r\n";
2418
- $payload .= "User-Agent: MCAPI/" . $this->version ."\r\n";
2419
- $payload .= "Content-type: application/x-www-form-urlencoded\r\n";
2420
- $payload .= "Content-length: " . strlen($post_vars) . "\r\n";
2421
- $payload .= "Connection: close \r\n\r\n";
2422
- $payload .= $post_vars;
2423
-
2424
- ob_start();
2425
- if ($this->secure){
2426
- $sock = fsockopen("ssl://".$host, 443, $errno, $errstr, 30);
2427
- } else {
2428
- $sock = fsockopen($host, 80, $errno, $errstr, 30);
2429
- }
2430
- if(!$sock) {
2431
- $this->errorMessage = "Could not connect (ERR $errno: $errstr)";
2432
- $this->errorCode = "-99";
2433
- ob_end_clean();
2434
- return false;
2435
- }
2436
-
2437
- $response = "";
2438
- fwrite($sock, $payload);
2439
- stream_set_timeout($sock, $this->timeout);
2440
- $info = stream_get_meta_data($sock);
2441
- while ((!feof($sock)) && (!$info["timed_out"])) {
2442
- $response .= fread($sock, $this->chunkSize);
2443
- $info = stream_get_meta_data($sock);
2444
- }
2445
- fclose($sock);
2446
- ob_end_clean();
2447
- if ($info["timed_out"]) {
2448
- $this->errorMessage = "Could not read response (timed out)";
2449
- $this->errorCode = -98;
2450
- return false;
2451
- }
2452
-
2453
- list($headers, $response) = explode("\r\n\r\n", $response, 2);
2454
- $headers = explode("\r\n", $headers);
2455
- $errored = false;
2456
- foreach($headers as $h){
2457
- if (substr($h,0,26)==="X-MailChimp-API-Error-Code"){
2458
- $errored = true;
2459
- $error_code = trim(substr($h,27));
2460
- break;
2461
- }
2462
- }
2463
-
2464
- if(ini_get("magic_quotes_runtime")) $response = stripslashes($response);
2465
-
2466
- $serial = unserialize($response);
2467
- if($response && $serial === false) {
2468
- $response = array("error" => "Bad Response. Got This: " . $response, "code" => "-99");
2469
- } else {
2470
- $response = $serial;
2471
- }
2472
- if($errored && is_array($response) && isset($response["error"])) {
2473
- $this->errorMessage = $response["error"];
2474
- $this->errorCode = $response["code"];
2475
- return false;
2476
- } elseif($errored){
2477
- $this->errorMessage = "No error message was found";
2478
- $this->errorCode = $error_code;
2479
- return false;
2480
- }
2481
-
2482
- return $response;
2483
- }
2484
-
2485
- }
2486
- }
2487
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/MCAPI_2.0.class.php ADDED
@@ -0,0 +1,362 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // TO DO
4
+
5
+ // Go through and check that all methods are update to MC API 2.0
6
+ // Confirm all functionality works correctly
7
+ // Check form embed into new posts/pages
8
+ // --------------------------------------------------------------------------------------- //
9
+ // --------------------------------------------------------------------------------------- //
10
+ // Double check all methods are MC API 2.0 appropriate
11
+ // Remove PHPDebug tool and comments
12
+
13
+ require_once YKSEME_PATH.'/Mailchimp/Folders.php';
14
+ require_once YKSEME_PATH.'/Mailchimp/Templates.php';
15
+ require_once YKSEME_PATH.'/Mailchimp/Users.php';
16
+ require_once YKSEME_PATH.'/Mailchimp/Helper.php';
17
+ require_once YKSEME_PATH.'/Mailchimp/Mobile.php';
18
+ require_once YKSEME_PATH.'/Mailchimp/Ecomm.php';
19
+ require_once YKSEME_PATH.'/Mailchimp/Neapolitan.php';
20
+ require_once YKSEME_PATH.'/Mailchimp/Lists.php';
21
+ require_once YKSEME_PATH.'/Mailchimp/Campaigns.php';
22
+ require_once YKSEME_PATH.'/Mailchimp/Vip.php';
23
+ require_once YKSEME_PATH.'/Mailchimp/Reports.php';
24
+ require_once YKSEME_PATH.'/Mailchimp/Gallery.php';
25
+ require_once YKSEME_PATH.'/Mailchimp/Exceptions.php';
26
+
27
+
28
+ if(!class_exists("wpyksMCAPI"))
29
+ {
30
+ class wpyksMCAPI {
31
+
32
+ /**
33
+ * Placeholder attribute for Mailchimp_Folders class
34
+ *
35
+ * @var Mailchimp_Folders
36
+ * @access public
37
+ */
38
+ var $folders;
39
+ /**
40
+ * Placeholder attribute for Mailchimp_Templates class
41
+ *
42
+ * @var Mailchimp_Templates
43
+ * @access public
44
+ */
45
+ var $templates;
46
+ /**
47
+ * Placeholder attribute for Mailchimp_Users class
48
+ *
49
+ * @var Mailchimp_Users
50
+ * @access public
51
+ */
52
+ var $users;
53
+ /**
54
+ * Placeholder attribute for Mailchimp_Helper class
55
+ *
56
+ * @var Mailchimp_Helper
57
+ * @access public
58
+ */
59
+ var $helper;
60
+ /**
61
+ * Placeholder attribute for Mailchimp_Mobile class
62
+ *
63
+ * @var Mailchimp_Mobile
64
+ * @access public
65
+ */
66
+ var $mobile;
67
+ /**
68
+ * Placeholder attribute for Mailchimp_Ecomm class
69
+ *
70
+ * @var Mailchimp_Ecomm
71
+ * @access public
72
+ */
73
+ var $ecomm;
74
+ /**
75
+ * Placeholder attribute for Mailchimp_Neapolitan class
76
+ *
77
+ * @var Mailchimp_Neapolitan
78
+ * @access public
79
+ */
80
+ var $neapolitan;
81
+ /**
82
+ * Placeholder attribute for Mailchimp_Lists class
83
+ *
84
+ * @var Mailchimp_Lists
85
+ * @access public
86
+ */
87
+ var $lists;
88
+ /**
89
+ * Placeholder attribute for Mailchimp_Campaigns class
90
+ *
91
+ * @var Mailchimp_Campaigns
92
+ * @access public
93
+ */
94
+ var $campaigns;
95
+ /**
96
+ * Placeholder attribute for Mailchimp_Vip class
97
+ *
98
+ * @var Mailchimp_Vip
99
+ * @access public
100
+ */
101
+ var $vip;
102
+ /**
103
+ * Placeholder attribute for Mailchimp_Reports class
104
+ *
105
+ * @var Mailchimp_Reports
106
+ * @access public
107
+ */
108
+ var $reports;
109
+ /**
110
+ * Placeholder attribute for Mailchimp_Gallery class
111
+ *
112
+ * @var Mailchimp_Gallery
113
+ * @access public
114
+ */
115
+ var $gallery;
116
+
117
+ /**
118
+ * CURLOPT_SSL_VERIFYPEER setting
119
+ * @var bool
120
+ */
121
+ public $ssl_verifypeer = true;
122
+ /**
123
+ * CURLOPT_SSL_VERIFYHOST setting
124
+ * @var bool
125
+ */
126
+ public $ssl_verifyhost = 2;
127
+ /**
128
+ * CURLOPT_CAINFO
129
+ * @var string
130
+ */
131
+ public $ssl_cainfo = null;
132
+
133
+ /**
134
+ * the api key in use
135
+ * @var string
136
+ */
137
+ public $apikey;
138
+ public $ch;
139
+ public $root = 'https://api.mailchimp.com/2.0';
140
+ /**
141
+ * whether debug mode is enabled
142
+ * @var bool
143
+ */
144
+ public $debug = false;
145
+
146
+ public static $error_map = array(
147
+ "ValidationError" => "Mailchimp_ValidationError",
148
+ "ServerError_MethodUnknown" => "Mailchimp_ServerError_MethodUnknown",
149
+ "ServerError_InvalidParameters" => "Mailchimp_ServerError_InvalidParameters",
150
+ "Unknown_Exception" => "Mailchimp_Unknown_Exception",
151
+ "Request_TimedOut" => "Mailchimp_Request_TimedOut",
152
+ "Zend_Uri_Exception" => "Mailchimp_Zend_Uri_Exception",
153
+ "PDOException" => "Mailchimp_PDOException",
154
+ "Avesta_Db_Exception" => "Mailchimp_Avesta_Db_Exception",
155
+ "XML_RPC2_Exception" => "Mailchimp_XML_RPC2_Exception",
156
+ "XML_RPC2_FaultException" => "Mailchimp_XML_RPC2_FaultException",
157
+ "Too_Many_Connections" => "Mailchimp_Too_Many_Connections",
158
+ "Parse_Exception" => "Mailchimp_Parse_Exception",
159
+ "User_Unknown" => "Mailchimp_User_Unknown",
160
+ "User_Disabled" => "Mailchimp_User_Disabled",
161
+ "User_DoesNotExist" => "Mailchimp_User_DoesNotExist",
162
+ "User_NotApproved" => "Mailchimp_User_NotApproved",
163
+ "Invalid_ApiKey" => "Mailchimp_Invalid_ApiKey",
164
+ "User_UnderMaintenance" => "Mailchimp_User_UnderMaintenance",
165
+ "Invalid_AppKey" => "Mailchimp_Invalid_AppKey",
166
+ "Invalid_IP" => "Mailchimp_Invalid_IP",
167
+ "User_DoesExist" => "Mailchimp_User_DoesExist",
168
+ "User_InvalidRole" => "Mailchimp_User_InvalidRole",
169
+ "User_InvalidAction" => "Mailchimp_User_InvalidAction",
170
+ "User_MissingEmail" => "Mailchimp_User_MissingEmail",
171
+ "User_CannotSendCampaign" => "Mailchimp_User_CannotSendCampaign",
172
+ "User_MissingModuleOutbox" => "Mailchimp_User_MissingModuleOutbox",
173
+ "User_ModuleAlreadyPurchased" => "Mailchimp_User_ModuleAlreadyPurchased",
174
+ "User_ModuleNotPurchased" => "Mailchimp_User_ModuleNotPurchased",
175
+ "User_NotEnoughCredit" => "Mailchimp_User_NotEnoughCredit",
176
+ "MC_InvalidPayment" => "Mailchimp_MC_InvalidPayment",
177
+ "List_DoesNotExist" => "Mailchimp_List_DoesNotExist",
178
+ "List_InvalidInterestFieldType" => "Mailchimp_List_InvalidInterestFieldType",
179
+ "List_InvalidOption" => "Mailchimp_List_InvalidOption",
180
+ "List_InvalidUnsubMember" => "Mailchimp_List_InvalidUnsubMember",
181
+ "List_InvalidBounceMember" => "Mailchimp_List_InvalidBounceMember",
182
+ "List_AlreadySubscribed" => "Mailchimp_List_AlreadySubscribed",
183
+ "List_NotSubscribed" => "Mailchimp_List_NotSubscribed",
184
+ "List_InvalidImport" => "Mailchimp_List_InvalidImport",
185
+ "MC_PastedList_Duplicate" => "Mailchimp_MC_PastedList_Duplicate",
186
+ "MC_PastedList_InvalidImport" => "Mailchimp_MC_PastedList_InvalidImport",
187
+ "Email_AlreadySubscribed" => "Mailchimp_Email_AlreadySubscribed",
188
+ "Email_AlreadyUnsubscribed" => "Mailchimp_Email_AlreadyUnsubscribed",
189
+ "Email_NotExists" => "Mailchimp_Email_NotExists",
190
+ "Email_NotSubscribed" => "Mailchimp_Email_NotSubscribed",
191
+ "List_MergeFieldRequired" => "Mailchimp_List_MergeFieldRequired",
192
+ "List_CannotRemoveEmailMerge" => "Mailchimp_List_CannotRemoveEmailMerge",
193
+ "List_Merge_InvalidMergeID" => "Mailchimp_List_Merge_InvalidMergeID",
194
+ "List_TooManyMergeFields" => "Mailchimp_List_TooManyMergeFields",
195
+ "List_InvalidMergeField" => "Mailchimp_List_InvalidMergeField",
196
+ "List_InvalidInterestGroup" => "Mailchimp_List_InvalidInterestGroup",
197
+ "List_TooManyInterestGroups" => "Mailchimp_List_TooManyInterestGroups",
198
+ "Campaign_DoesNotExist" => "Mailchimp_Campaign_DoesNotExist",
199
+ "Campaign_StatsNotAvailable" => "Mailchimp_Campaign_StatsNotAvailable",
200
+ "Campaign_InvalidAbsplit" => "Mailchimp_Campaign_InvalidAbsplit",
201
+ "Campaign_InvalidContent" => "Mailchimp_Campaign_InvalidContent",
202
+ "Campaign_InvalidOption" => "Mailchimp_Campaign_InvalidOption",
203
+ "Campaign_InvalidStatus" => "Mailchimp_Campaign_InvalidStatus",
204
+ "Campaign_NotSaved" => "Mailchimp_Campaign_NotSaved",
205
+ "Campaign_InvalidSegment" => "Mailchimp_Campaign_InvalidSegment",
206
+ "Campaign_InvalidRss" => "Mailchimp_Campaign_InvalidRss",
207
+ "Campaign_InvalidAuto" => "Mailchimp_Campaign_InvalidAuto",
208
+ "MC_ContentImport_InvalidArchive" => "Mailchimp_MC_ContentImport_InvalidArchive",
209
+ "Campaign_BounceMissing" => "Mailchimp_Campaign_BounceMissing",
210
+ "Campaign_InvalidTemplate" => "Mailchimp_Campaign_InvalidTemplate",
211
+ "Invalid_EcommOrder" => "Mailchimp_Invalid_EcommOrder",
212
+ "Absplit_UnknownError" => "Mailchimp_Absplit_UnknownError",
213
+ "Absplit_UnknownSplitTest" => "Mailchimp_Absplit_UnknownSplitTest",
214
+ "Absplit_UnknownTestType" => "Mailchimp_Absplit_UnknownTestType",
215
+ "Absplit_UnknownWaitUnit" => "Mailchimp_Absplit_UnknownWaitUnit",
216
+ "Absplit_UnknownWinnerType" => "Mailchimp_Absplit_UnknownWinnerType",
217
+ "Absplit_WinnerNotSelected" => "Mailchimp_Absplit_WinnerNotSelected",
218
+ "Invalid_Analytics" => "Mailchimp_Invalid_Analytics",
219
+ "Invalid_DateTime" => "Mailchimp_Invalid_DateTime",
220
+ "Invalid_Email" => "Mailchimp_Invalid_Email",
221
+ "Invalid_SendType" => "Mailchimp_Invalid_SendType",
222
+ "Invalid_Template" => "Mailchimp_Invalid_Template",
223
+ "Invalid_TrackingOptions" => "Mailchimp_Invalid_TrackingOptions",
224
+ "Invalid_Options" => "Mailchimp_Invalid_Options",
225
+ "Invalid_Folder" => "Mailchimp_Invalid_Folder",
226
+ "Invalid_URL" => "Mailchimp_Invalid_URL",
227
+ "Module_Unknown" => "Mailchimp_Module_Unknown",
228
+ "MonthlyPlan_Unknown" => "Mailchimp_MonthlyPlan_Unknown",
229
+ "Order_TypeUnknown" => "Mailchimp_Order_TypeUnknown",
230
+ "Invalid_PagingLimit" => "Mailchimp_Invalid_PagingLimit",
231
+ "Invalid_PagingStart" => "Mailchimp_Invalid_PagingStart",
232
+ "Max_Size_Reached" => "Mailchimp_Max_Size_Reached",
233
+ "MC_SearchException" => "Mailchimp_MC_SearchException"
234
+ );
235
+
236
+ public function __construct($apikey=null, $opts=array()) {
237
+ if(!$apikey) $apikey = getenv('MAILCHIMP_APIKEY');
238
+ if(!$apikey) $apikey = $this->readConfigs();
239
+ if(!$apikey) throw new Mailchimp_Error('You must provide a MailChimp API key');
240
+ $this->apikey = $apikey;
241
+ $dc = "us1";
242
+ if (strstr($this->apikey,"-")){
243
+ list($key, $dc) = explode("-",$this->apikey,2);
244
+ if (!$dc) $dc = "us1";
245
+ }
246
+ $this->root = str_replace('https://api', 'https://'.$dc.'.api', $this->root);
247
+ $this->root = rtrim($this->root, '/') . '/';
248
+
249
+ if (!isset($opts['timeout']) || !is_int($opts['timeout'])){
250
+ $opts['timeout']=600;
251
+ }
252
+ if (isset($opts['debug'])){
253
+ $this->debug = true;
254
+ }
255
+ if (isset($opts['ssl_verifypeer'])){
256
+ $this->ssl_verifypeer = $opts['ssl_verifypeer'];
257
+ }
258
+ if (isset($opts['ssl_verifyhost'])){
259
+ $this->ssl_verifyhost = $opts['ssl_verifyhost'];
260
+ }
261
+ if (isset($opts['ssl_cainfo'])){
262
+ $this->ssl_cainfo = $opts['ssl_cainfo'];
263
+ }
264
+
265
+
266
+ $this->ch = curl_init();
267
+ curl_setopt($this->ch, CURLOPT_USERAGENT, 'MailChimp-PHP/2.0.4');
268
+ curl_setopt($this->ch, CURLOPT_POST, true);
269
+ curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, true);
270
+ curl_setopt($this->ch, CURLOPT_HEADER, false);
271
+ curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, true);
272
+ curl_setopt($this->ch, CURLOPT_CONNECTTIMEOUT, 30);
273
+ curl_setopt($this->ch, CURLOPT_TIMEOUT, $opts['timeout']);
274
+
275
+
276
+ $this->folders = new Mailchimp_Folders($this);
277
+ $this->templates = new Mailchimp_Templates($this);
278
+ $this->users = new Mailchimp_Users($this);
279
+ $this->helper = new Mailchimp_Helper($this);
280
+ $this->mobile = new Mailchimp_Mobile($this);
281
+ $this->ecomm = new Mailchimp_Ecomm($this);
282
+ $this->neapolitan = new Mailchimp_Neapolitan($this);
283
+ $this->lists = new Mailchimp_Lists($this);
284
+ $this->campaigns = new Mailchimp_Campaigns($this);
285
+ $this->vip = new Mailchimp_Vip($this);
286
+ $this->reports = new Mailchimp_Reports($this);
287
+ $this->gallery = new Mailchimp_Gallery($this);
288
+
289
+ }
290
+
291
+ public function __destruct() {
292
+ curl_close($this->ch);
293
+ }
294
+
295
+ public function call($url, $params) {
296
+ $params['apikey'] = $this->apikey;
297
+ $params = json_encode($params);
298
+ $ch = $this->ch;
299
+
300
+ curl_setopt($ch, CURLOPT_URL, $this->root . $url . '.json');
301
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
302
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
303
+ curl_setopt($ch, CURLOPT_VERBOSE, $this->debug);
304
+ // SSL Options
305
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);
306
+ curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, $this->ssl_verifyhost);
307
+ if ($this->ssl_cainfo) curl_setopt($ch, CURLOPT_CAINFO, $this->ssl_cainfo);
308
+
309
+ $start = microtime(true);
310
+ $this->log('Call to ' . $this->root . $url . '.json: ' . $params);
311
+ if($this->debug) {
312
+ $curl_buffer = fopen('php://memory', 'w+');
313
+ curl_setopt($ch, CURLOPT_STDERR, $curl_buffer);
314
+ }
315
+
316
+ $response_body = curl_exec($ch);
317
+ $info = curl_getinfo($ch);
318
+ $time = microtime(true) - $start;
319
+ if($this->debug) {
320
+ rewind($curl_buffer);
321
+ $this->log(stream_get_contents($curl_buffer));
322
+ fclose($curl_buffer);
323
+ }
324
+ $this->log('Completed in ' . number_format($time * 1000, 2) . 'ms');
325
+ $this->log('Got response: ' . $response_body);
326
+
327
+ if(curl_error($ch)) {
328
+ throw new Mailchimp_HttpError("API call to $url failed: " . curl_error($ch));
329
+ }
330
+ $result = json_decode($response_body, true);
331
+
332
+ if(floor($info['http_code'] / 100) >= 4) {
333
+ throw $this->castError($result);
334
+ }
335
+
336
+ return $result;
337
+ }
338
+
339
+ public function readConfigs() {
340
+ $paths = array('~/.mailchimp.key', '/etc/mailchimp.key');
341
+ foreach($paths as $path) {
342
+ if(file_exists($path)) {
343
+ $apikey = trim(file_get_contents($path));
344
+ if($apikey) return $apikey;
345
+ }
346
+ }
347
+ return false;
348
+ }
349
+
350
+ public function castError($result) {
351
+ if($result['status'] !== 'error' || !$result['name']) throw new Mailchimp_Error('We received an unexpected error: ' . json_encode($result));
352
+
353
+ $class = (isset(self::$error_map[$result['name']])) ? self::$error_map[$result['name']] : 'Mailchimp_Error';
354
+ return new $class($result['error'], $result['code']);
355
+ }
356
+
357
+ public function log($msg) {
358
+ if($this->debug) error_log($msg);
359
+ }
360
+ }
361
+ }
362
+
classes/class.yksemeBase.php CHANGED
@@ -3,7 +3,7 @@ if(!class_exists("yksemeBase"))
3
  {
4
  class yksemeBase
5
  {
6
-
7
 
8
 
9
  /**
@@ -38,14 +38,22 @@ public function __destruct()
38
  */
39
  public function activate()
40
  {
 
 
 
 
 
 
 
41
  }
42
  public function deactivate()
43
  {
44
- delete_option(YKSEME_OPTION);
45
  }
46
  public function uninstall()
47
  {
48
  delete_option(YKSEME_OPTION);
 
49
  }
50
 
51
  /***** INITIAL SETUP
@@ -156,31 +164,35 @@ public function getBlankFieldsArray($lid='')
156
 
157
  public function getImportedFieldsArray($lid, $mv)
158
  {
159
- if(empty($mv)) return false;
160
- $fields = array();
161
-
162
- foreach($mv as $field)
163
- {
164
- // Add Field
165
- $name = $this->slugify($field['label'].'-'.$field['tag']);
166
- $addField = array(
167
- 'id' => $lid.'-'.$name,
168
- 'name' => $lid.'-'.$field['tag'],
169
- 'merge' => $field['tag'],
170
- 'label' => $field['name'],
171
- 'require' => $field['req'],
172
- 'active' => '1',
173
- 'locked' => '1',
174
- 'sort' => $field['order'],
175
- 'type' => $field['field_type'],
176
- 'help' => $field['helptext'],
177
- 'defalt' => $field['default'],
178
- 'choices' => (isset($field['choices']) ? $field['choices'] : '')
179
- );
180
- $fields[$addField['id']] = $addField;
 
 
 
 
 
 
181
  }
182
-
183
- return $fields;
184
  }
185
  public function getBrowser()
186
  {
@@ -472,11 +484,22 @@ foreach ($errorcode as $eid => $value )
472
 
473
  /***** LIST ACTIONS
474
  ****************************************************************************************************/
 
 
 
475
  public function addList($lid='' , $name='')
476
  {
477
  if($lid == '' || isset($this->optionVal['lists'][$list['id']])) return false;
478
  $api = new wpyksMCAPI($this->optionVal['api-key']);
479
- $mv = $api->listMergeVars($lid);
 
 
 
 
 
 
 
 
480
  if($mv)
481
  {
482
  $list = array(
@@ -492,7 +515,9 @@ public function addList($lid='' , $name='')
492
  }
493
  }
494
  return false;
 
495
  }
 
496
  public function getLists()
497
  {
498
  $api = new wpyksMCAPI($this->optionVal['api-key']);
@@ -521,23 +546,22 @@ public function getLists()
521
  }
522
  return false;
523
  }
 
524
  public function getListsData()
525
  {
526
  $theListItems = get_transient('yks-mcp-listdata-retrieved');
527
  if (!$theListItems)
528
  {
529
  $api = new wpyksMCAPI($this->optionVal['api-key']);
530
- $lists = $api->lists();
531
  if($lists)
532
  {
533
  foreach ($lists['data'] as $list)
534
  {
535
-
536
- $theListItems[$list['id']] = $list['name'];
537
-
538
  }
539
  }
540
- set_transient( 'yks-mcp-listdata-retrieved', $theListItems, 60*5 ); //cache lists for 5 minutes
541
  }
542
  return $theListItems;
543
  }
@@ -562,6 +586,7 @@ public function sortList($p)
562
  }
563
  return false;
564
  }
 
565
  private function sortListfields($a,$b)
566
  {
567
  $a = $a['sort'];
@@ -593,6 +618,7 @@ public function updateList($p)
593
  }
594
  return false;
595
  }
 
596
  public function deleteList($i=false)
597
  {
598
  if($i == false) return false;
@@ -610,7 +636,10 @@ public function importList($i=false)
610
  $lid = $this->optionVal['lists'][$i]['list-id'];
611
  $name = $this->optionVal['lists'][$i]['name'];
612
  $api = new wpyksMCAPI($this->optionVal['api-key']);
613
- $mv = $api->listMergeVars($lid);
 
 
 
614
  if($mv)
615
  {
616
  $mv = $this->getImportedFieldsArray($lid, $mv);
@@ -647,15 +676,14 @@ public function addStyles_frontend()
647
  {
648
  // Register Styles
649
  wp_register_style('ykseme-css-base', YKSEME_URL.'css/style.ykseme.css', array(), '1.0.0', 'all');
650
- wp_register_style('ykseme-css-smoothness', YKSEME_URL.'css/jquery-ui-1.8.16.smoothness.css', array(), '1.0.0', 'all');
651
  // Enqueue Styles
652
  wp_enqueue_style('ykseme-css-base');
653
  wp_enqueue_style('ykseme-css-smoothness');
654
  }
655
 
656
  public function addScripts()
657
- {
658
- wp_enqueue_script('jquery');
659
  // Everything else
660
  wp_enqueue_script('jquery-ui-core');
661
  wp_enqueue_script('thickbox');
@@ -666,16 +694,25 @@ public function addScripts()
666
 
667
  public function addScripts_frontend()
668
  {
669
- wp_enqueue_script('jquery');
 
 
 
 
 
 
 
 
 
 
 
670
  // Everything else
671
  wp_enqueue_script('jquery-ui-core');
672
- wp_enqueue_script('jquery-ui-datepicker', YKSEME_URL.'js/jquery-ui-1.8.16.datepicker.min.js', array('jquery'), '1.8.16');
673
  }
674
 
675
 
676
 
677
-
678
-
679
  /***** SHORTCODES
680
  ****************************************************************************************************/
681
  public function processShortcode($p)
@@ -759,6 +796,35 @@ public function generatePageAboutYikes()
759
 
760
  /***** FORM DATA
761
  ****************************************************************************************************/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
762
  public function addUserToMailchimp($p)
763
  {
764
  if(!empty($p['form_data']))
@@ -771,6 +837,8 @@ public function addUserToMailchimp($p)
771
  $api = new wpyksMCAPI($this->optionVal['api-key']);
772
  $mv = array();
773
 
 
 
774
  foreach($this->optionVal['lists'][$lid]['fields'] as $field) : if($field['active'] == '1') :
775
 
776
  // Check to see if the field is in the post
@@ -807,8 +875,12 @@ public function addUserToMailchimp($p)
807
 
808
  // By default this sends a confirmation email - you will not see new members
809
  // until the link contained in it is clicked!
810
- $retval = $api->listSubscribe($lid, $email, $mv);
811
-
 
 
 
 
812
  if($api->errorCode)
813
  {
814
  return $this->YksMCErrorCodes ($api->errorCode);
@@ -848,14 +920,19 @@ public function generateListContainers($listArr=false)
848
  {
849
  $listArr = ($listArr == false ? $this->optionVal['lists'] : $listArr);
850
  $thelistdata = $this->getListsData(); //Get list names from API
 
851
  if(count($listArr) > 0)
852
  {
 
853
  ob_start();
854
  foreach($listArr as $list)
855
  {
856
  ?>
857
  <div class="yks-list-container" id="yks-list-container_<?php echo $list['id']; ?>">
858
- <div class="yks-status" id="yks-status_<?php echo $list['id']; ?>"></div>
 
 
 
859
  <form method="post" name="yks-mailchimp-form" id="yks-mailchimp-form_<?php echo $list['id']; ?>" rel="<?php echo $list['id']; ?>">
860
  <input type="hidden" name="yks-mailchimp-unique-id" id="yks-mailchimp-unique-id_<?php echo $list['id']; ?>" value="<?php echo $list['id']; ?>" />
861
  <table class="form-table yks-admin-form">
@@ -915,7 +992,10 @@ public function generateListContainers($listArr=false)
915
  <fieldset class="yks-mailchimp-fields-container" id="yks-mailchimp-fields-container_<?php echo $list['id']; ?>">
916
  <legend class="screen-reader-text"><span>Active Fields</span></legend>
917
  <div class="yks-mailchimp-fields-list" id="yks-mailchimp-fields-list_<?php echo $list['id']; ?>" rel="<?php echo $list['id']; ?>">
918
- <?php foreach($list['fields'] as $field){ ?>
 
 
 
919
  <div class="yks-mailchimp-fields-list-row">
920
  <label title="<?php echo $field['name']; ?>" rel="<?php echo $field['id']; ?>">
921
  <span class="yks-mailchimp-sorthandle">Drag &amp; drop</span>
3
  {
4
  class yksemeBase
5
  {
6
+
7
 
8
 
9
  /**
38
  */
39
  public function activate()
40
  {
41
+ // check if our option is already set
42
+ if( get_option( 'api_validation' ) ) {
43
+ return;
44
+ } else {
45
+ add_option('api_validation' , 'invalid_api_key');
46
+ }
47
+
48
  }
49
  public function deactivate()
50
  {
51
+ // delete_option(YKSEME_OPTION);
52
  }
53
  public function uninstall()
54
  {
55
  delete_option(YKSEME_OPTION);
56
+ delete_option('api_validation');
57
  }
58
 
59
  /***** INITIAL SETUP
164
 
165
  public function getImportedFieldsArray($lid, $mv)
166
  {
167
+ if(empty($mv)) {
168
+ return false;
169
+ } else {
170
+ $fields = array();
171
+
172
+ // Problem adding and storing fields
173
+ // TODO
174
+ foreach($mv['data'][0]['merge_vars'] as $field)
175
+ {
176
+ // Add Field
177
+ $name = $this->slugify($field['label'].'-'.$field['tag']);
178
+ $addField = array(
179
+ 'id' => $lid.'-'.$name,
180
+ 'name' => $lid.$field['tag'],
181
+ 'merge' => $field['tag'],
182
+ 'label' => $field['name'],
183
+ 'require' => $field['req'],
184
+ 'active' => '1',
185
+ 'locked' => '1',
186
+ 'sort' => $field['order'],
187
+ 'type' => $field['field_type'],
188
+ 'help' => $field['helptext'],
189
+ 'defalt' => $field['default'],
190
+ 'choices' => (isset($field['choices']) ? $field['choices'] : '')
191
+ );
192
+ $fields[$addField['id']] = $addField;
193
+ }
194
+ return $fields;
195
  }
 
 
196
  }
197
  public function getBrowser()
198
  {
484
 
485
  /***** LIST ACTIONS
486
  ****************************************************************************************************/
487
+ // update list/merge-vars to 2.0
488
+ // now get the fields correct for 2.0
489
+ // fields not populated correctly
490
  public function addList($lid='' , $name='')
491
  {
492
  if($lid == '' || isset($this->optionVal['lists'][$list['id']])) return false;
493
  $api = new wpyksMCAPI($this->optionVal['api-key']);
494
+
495
+ // test
496
+ // $fields = $api->call('lists/list', '');
497
+
498
+ $mv = $api->call('lists/merge-vars', array(
499
+ 'id' => array($lid)
500
+ )
501
+ );
502
+
503
  if($mv)
504
  {
505
  $list = array(
515
  }
516
  }
517
  return false;
518
+
519
  }
520
+
521
  public function getLists()
522
  {
523
  $api = new wpyksMCAPI($this->optionVal['api-key']);
546
  }
547
  return false;
548
  }
549
+
550
  public function getListsData()
551
  {
552
  $theListItems = get_transient('yks-mcp-listdata-retrieved');
553
  if (!$theListItems)
554
  {
555
  $api = new wpyksMCAPI($this->optionVal['api-key']);
556
+ $lists = $api->call('lists/list', array( 'limit' => 100 ));
557
  if($lists)
558
  {
559
  foreach ($lists['data'] as $list)
560
  {
561
+ $theListItems[$list['id']] = $list['name'];
 
 
562
  }
563
  }
564
+ set_transient( 'yks-mcp-listdata-retrieved', $theListItems, 60/4 ); //cache lists for 15 seconds for testing, originally 5 mins 60*5
565
  }
566
  return $theListItems;
567
  }
586
  }
587
  return false;
588
  }
589
+
590
  private function sortListfields($a,$b)
591
  {
592
  $a = $a['sort'];
618
  }
619
  return false;
620
  }
621
+
622
  public function deleteList($i=false)
623
  {
624
  if($i == false) return false;
636
  $lid = $this->optionVal['lists'][$i]['list-id'];
637
  $name = $this->optionVal['lists'][$i]['name'];
638
  $api = new wpyksMCAPI($this->optionVal['api-key']);
639
+ $mv = $api->call('lists/merge-vars', array(
640
+ 'id' => array( $lid )
641
+ )
642
+ );
643
  if($mv)
644
  {
645
  $mv = $this->getImportedFieldsArray($lid, $mv);
676
  {
677
  // Register Styles
678
  wp_register_style('ykseme-css-base', YKSEME_URL.'css/style.ykseme.css', array(), '1.0.0', 'all');
679
+ wp_register_style('ykseme-css-smoothness', YKSEME_URL.'css/jquery-ui-1.10.4.smoothness.css', array(), '1.0.0', 'all');
680
  // Enqueue Styles
681
  wp_enqueue_style('ykseme-css-base');
682
  wp_enqueue_style('ykseme-css-smoothness');
683
  }
684
 
685
  public function addScripts()
686
+ {
 
687
  // Everything else
688
  wp_enqueue_script('jquery-ui-core');
689
  wp_enqueue_script('thickbox');
694
 
695
  public function addScripts_frontend()
696
  {
697
+ global $wp_scripts;
698
+ $version ='1.9.0';
699
+ if ( ( version_compare( $wp_scripts -> registered[jquery] -> ver, $version ) >= 0 ) && jQuery && !is_admin() )
700
+ {
701
+ wp_enqueue_script( 'jquery' );
702
+ }
703
+ else
704
+ {
705
+ wp_deregister_script('jquery');
706
+ wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/'.$version.'/jquery.min.js', false, $version );
707
+ wp_enqueue_script( 'jquery' );
708
+ }
709
  // Everything else
710
  wp_enqueue_script('jquery-ui-core');
711
+ wp_enqueue_script('jquery-ui-datepicker');
712
  }
713
 
714
 
715
 
 
 
716
  /***** SHORTCODES
717
  ****************************************************************************************************/
718
  public function processShortcode($p)
796
 
797
  /***** FORM DATA
798
  ****************************************************************************************************/
799
+
800
+ public function validateAPIkeySettings()
801
+ {
802
+ $apiKey = $_POST['api_key'];
803
+ $dataCenter = $_POST['data_center'];
804
+
805
+ $api = new wpyksMCAPI($apiKey);
806
+
807
+
808
+ // if there is an error with the $resp variable
809
+ // display the error
810
+
811
+ // need to add an exception for mailchimp HTTP error
812
+ // not sur ehow to yet.
813
+ try {
814
+ //First try getting our user numero uno
815
+ $resp = $api->call('helper/ping', array('apikey' => $apiKey));
816
+ echo $resp['msg'];
817
+ update_option('api_validation', 'valid_api_key');
818
+ } catch( Exception $e ) {
819
+ $errorMessage = str_replace('API call to helper/ping failed:', '', $e->getMessage());
820
+ echo $errorMessage;
821
+ update_option('api_validation', 'invalid_api_key');
822
+ }
823
+
824
+
825
+ wp_die();
826
+ }
827
+
828
  public function addUserToMailchimp($p)
829
  {
830
  if(!empty($p['form_data']))
837
  $api = new wpyksMCAPI($this->optionVal['api-key']);
838
  $mv = array();
839
 
840
+
841
+
842
  foreach($this->optionVal['lists'][$lid]['fields'] as $field) : if($field['active'] == '1') :
843
 
844
  // Check to see if the field is in the post
875
 
876
  // By default this sends a confirmation email - you will not see new members
877
  // until the link contained in it is clicked!
878
+ $retval = $api->call('lists/subscribe', array(
879
+ 'id' => $lid,
880
+ 'email' => array( 'email' => $email ),
881
+ 'merge_vars' => $mv
882
+ ));
883
+
884
  if($api->errorCode)
885
  {
886
  return $this->YksMCErrorCodes ($api->errorCode);
920
  {
921
  $listArr = ($listArr == false ? $this->optionVal['lists'] : $listArr);
922
  $thelistdata = $this->getListsData(); //Get list names from API
923
+
924
  if(count($listArr) > 0)
925
  {
926
+
927
  ob_start();
928
  foreach($listArr as $list)
929
  {
930
  ?>
931
  <div class="yks-list-container" id="yks-list-container_<?php echo $list['id']; ?>">
932
+ <div class="yks-status" id="yks-status" style="display: none;">
933
+ <div class="yks-success" style="padding:.25em;">Your List Was Successfully Saved!</div>
934
+ </div>
935
+ <span class="yikes-lists-error" style="display:none;">I'm sorry there was an error with your request.</span>
936
  <form method="post" name="yks-mailchimp-form" id="yks-mailchimp-form_<?php echo $list['id']; ?>" rel="<?php echo $list['id']; ?>">
937
  <input type="hidden" name="yks-mailchimp-unique-id" id="yks-mailchimp-unique-id_<?php echo $list['id']; ?>" value="<?php echo $list['id']; ?>" />
938
  <table class="form-table yks-admin-form">
992
  <fieldset class="yks-mailchimp-fields-container" id="yks-mailchimp-fields-container_<?php echo $list['id']; ?>">
993
  <legend class="screen-reader-text"><span>Active Fields</span></legend>
994
  <div class="yks-mailchimp-fields-list" id="yks-mailchimp-fields-list_<?php echo $list['id']; ?>" rel="<?php echo $list['id']; ?>">
995
+
996
+ <!-- create sortable rows populated with mailchimp data -->
997
+ <?php foreach($list['fields'] as $field) { ?>
998
+
999
  <div class="yks-mailchimp-fields-list-row">
1000
  <label title="<?php echo $field['name']; ?>" rel="<?php echo $field['id']; ?>">
1001
  <span class="yks-mailchimp-sorthandle">Drag &amp; drop</span>
css/jquery-ui-1.10.4.smoothness.css ADDED
@@ -0,0 +1,1178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! jQuery UI - v1.10.4 - 2014-01-17
2
+ * http://jqueryui.com
3
+ * Includes: jquery.ui.core.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css, jquery.ui.theme.css
4
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
5
+ * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
6
+
7
+ /* Layout helpers
8
+ ----------------------------------*/
9
+ .ui-helper-hidden {
10
+ display: none;
11
+ }
12
+ .ui-helper-hidden-accessible {
13
+ border: 0;
14
+ clip: rect(0 0 0 0);
15
+ height: 1px;
16
+ margin: -1px;
17
+ overflow: hidden;
18
+ padding: 0;
19
+ position: absolute;
20
+ width: 1px;
21
+ }
22
+ .ui-helper-reset {
23
+ margin: 0;
24
+ padding: 0;
25
+ border: 0;
26
+ outline: 0;
27
+ line-height: 1.3;
28
+ text-decoration: none;
29
+ font-size: 100%;
30
+ list-style: none;
31
+ }
32
+ .ui-helper-clearfix:before,
33
+ .ui-helper-clearfix:after {
34
+ content: "";
35
+ display: table;
36
+ border-collapse: collapse;
37
+ }
38
+ .ui-helper-clearfix:after {
39
+ clear: both;
40
+ }
41
+ .ui-helper-clearfix {
42
+ min-height: 0; /* support: IE7 */
43
+ }
44
+ .ui-helper-zfix {
45
+ width: 100%;
46
+ height: 100%;
47
+ top: 0;
48
+ left: 0;
49
+ position: absolute;
50
+ opacity: 0;
51
+ filter:Alpha(Opacity=0);
52
+ }
53
+
54
+ .ui-front {
55
+ z-index: 100;
56
+ }
57
+
58
+
59
+ /* Interaction Cues
60
+ ----------------------------------*/
61
+ .ui-state-disabled {
62
+ cursor: default !important;
63
+ }
64
+
65
+
66
+ /* Icons
67
+ ----------------------------------*/
68
+
69
+ /* states and images */
70
+ .ui-icon {
71
+ display: block;
72
+ text-indent: -99999px;
73
+ overflow: hidden;
74
+ background-repeat: no-repeat;
75
+ }
76
+
77
+
78
+ /* Misc visuals
79
+ ----------------------------------*/
80
+
81
+ /* Overlays */
82
+ .ui-widget-overlay {
83
+ position: fixed;
84
+ top: 0;
85
+ left: 0;
86
+ width: 100%;
87
+ height: 100%;
88
+ }
89
+ .ui-accordion .ui-accordion-header {
90
+ display: block;
91
+ cursor: pointer;
92
+ position: relative;
93
+ margin-top: 2px;
94
+ padding: .5em .5em .5em .7em;
95
+ min-height: 0; /* support: IE7 */
96
+ }
97
+ .ui-accordion .ui-accordion-icons {
98
+ padding-left: 2.2em;
99
+ }
100
+ .ui-accordion .ui-accordion-noicons {
101
+ padding-left: .7em;
102
+ }
103
+ .ui-accordion .ui-accordion-icons .ui-accordion-icons {
104
+ padding-left: 2.2em;
105
+ }
106
+ .ui-accordion .ui-accordion-header .ui-accordion-header-icon {
107
+ position: absolute;
108
+ left: .5em;
109
+ top: 50%;
110
+ margin-top: -8px;
111
+ }
112
+ .ui-accordion .ui-accordion-content {
113
+ padding: 1em 2.2em;
114
+ border-top: 0;
115
+ overflow: auto;
116
+ }
117
+ .ui-autocomplete {
118
+ position: absolute;
119
+ top: 0;
120
+ left: 0;
121
+ cursor: default;
122
+ }
123
+ .ui-button {
124
+ display: inline-block;
125
+ position: relative;
126
+ padding: 0;
127
+ line-height: normal;
128
+ margin-right: .1em;
129
+ cursor: pointer;
130
+ vertical-align: middle;
131
+ text-align: center;
132
+ overflow: visible; /* removes extra width in IE */
133
+ }
134
+ .ui-button,
135
+ .ui-button:link,
136
+ .ui-button:visited,
137
+ .ui-button:hover,
138
+ .ui-button:active {
139
+ text-decoration: none;
140
+ }
141
+ /* to make room for the icon, a width needs to be set here */
142
+ .ui-button-icon-only {
143
+ width: 2.2em;
144
+ }
145
+ /* button elements seem to need a little more width */
146
+ button.ui-button-icon-only {
147
+ width: 2.4em;
148
+ }
149
+ .ui-button-icons-only {
150
+ width: 3.4em;
151
+ }
152
+ button.ui-button-icons-only {
153
+ width: 3.7em;
154
+ }
155
+
156
+ /* button text element */
157
+ .ui-button .ui-button-text {
158
+ display: block;
159
+ line-height: normal;
160
+ }
161
+ .ui-button-text-only .ui-button-text {
162
+ padding: .4em 1em;
163
+ }
164
+ .ui-button-icon-only .ui-button-text,
165
+ .ui-button-icons-only .ui-button-text {
166
+ padding: .4em;
167
+ text-indent: -9999999px;
168
+ }
169
+ .ui-button-text-icon-primary .ui-button-text,
170
+ .ui-button-text-icons .ui-button-text {
171
+ padding: .4em 1em .4em 2.1em;
172
+ }
173
+ .ui-button-text-icon-secondary .ui-button-text,
174
+ .ui-button-text-icons .ui-button-text {
175
+ padding: .4em 2.1em .4em 1em;
176
+ }
177
+ .ui-button-text-icons .ui-button-text {
178
+ padding-left: 2.1em;
179
+ padding-right: 2.1em;
180
+ }
181
+ /* no icon support for input elements, provide padding by default */
182
+ input.ui-button {
183
+ padding: .4em 1em;
184
+ }
185
+
186
+ /* button icon element(s) */
187
+ .ui-button-icon-only .ui-icon,
188
+ .ui-button-text-icon-primary .ui-icon,
189
+ .ui-button-text-icon-secondary .ui-icon,
190
+ .ui-button-text-icons .ui-icon,
191
+ .ui-button-icons-only .ui-icon {
192
+ position: absolute;
193
+ top: 50%;
194
+ margin-top: -8px;
195
+ }
196
+ .ui-button-icon-only .ui-icon {
197
+ left: 50%;
198
+ margin-left: -8px;
199
+ }
200
+ .ui-button-text-icon-primary .ui-button-icon-primary,
201
+ .ui-button-text-icons .ui-button-icon-primary,
202
+ .ui-button-icons-only .ui-button-icon-primary {
203
+ left: .5em;
204
+ }
205
+ .ui-button-text-icon-secondary .ui-button-icon-secondary,
206
+ .ui-button-text-icons .ui-button-icon-secondary,
207
+ .ui-button-icons-only .ui-button-icon-secondary {
208
+ right: .5em;
209
+ }
210
+
211
+ /* button sets */
212
+ .ui-buttonset {
213
+ margin-right: 7px;
214
+ }
215
+ .ui-buttonset .ui-button {
216
+ margin-left: 0;
217
+ margin-right: -.3em;
218
+ }
219
+
220
+ /* workarounds */
221
+ /* reset extra padding in Firefox, see h5bp.com/l */
222
+ input.ui-button::-moz-focus-inner,
223
+ button.ui-button::-moz-focus-inner {
224
+ border: 0;
225
+ padding: 0;
226
+ }
227
+ .ui-datepicker {
228
+ width: 17em;
229
+ padding: .2em .2em 0;
230
+ display: none;
231
+ }
232
+ .ui-datepicker .ui-datepicker-header {
233
+ position: relative;
234
+ padding: .2em 0;
235
+ }
236
+ .ui-datepicker .ui-datepicker-prev,
237
+ .ui-datepicker .ui-datepicker-next {
238
+ position: absolute;
239
+ top: 2px;
240
+ width: 1.8em;
241
+ height: 1.8em;
242
+ }
243
+ .ui-datepicker .ui-datepicker-prev-hover,
244
+ .ui-datepicker .ui-datepicker-next-hover {
245
+ top: 1px;
246
+ }
247
+ .ui-datepicker .ui-datepicker-prev {
248
+ left: 2px;
249
+ }
250
+ .ui-datepicker .ui-datepicker-next {
251
+ right: 2px;
252
+ }
253
+ .ui-datepicker .ui-datepicker-prev-hover {
254
+ left: 1px;
255
+ }
256
+ .ui-datepicker .ui-datepicker-next-hover {
257
+ right: 1px;
258
+ }
259
+ .ui-datepicker .ui-datepicker-prev span,
260
+ .ui-datepicker .ui-datepicker-next span {
261
+ display: block;
262
+ position: absolute;
263
+ left: 50%;
264
+ margin-left: -8px;
265
+ top: 50%;
266
+ margin-top: -8px;
267
+ }
268
+ .ui-datepicker .ui-datepicker-title {
269
+ margin: 0 2.3em;
270
+ line-height: 1.8em;
271
+ text-align: center;
272
+ }
273
+ .ui-datepicker .ui-datepicker-title select {
274
+ font-size: 1em;
275
+ margin: 1px 0;
276
+ }
277
+ .ui-datepicker select.ui-datepicker-month,
278
+ .ui-datepicker select.ui-datepicker-year {
279
+ width: 49%;
280
+ }
281
+ .ui-datepicker table {
282
+ width: 100%;
283
+ font-size: .9em;
284
+ border-collapse: collapse;
285
+ margin: 0 0 .4em;
286
+ }
287
+ .ui-datepicker th {
288
+ padding: .7em .3em;
289
+ text-align: center;
290
+ font-weight: bold;
291
+ border: 0;
292
+ }
293
+ .ui-datepicker td {
294
+ border: 0;
295
+ padding: 1px;
296
+ }
297
+ .ui-datepicker td span,
298
+ .ui-datepicker td a {
299
+ display: block;
300
+ padding: .2em;
301
+ text-align: right;
302
+ text-decoration: none;
303
+ }
304
+ .ui-datepicker .ui-datepicker-buttonpane {
305
+ background-image: none;
306
+ margin: .7em 0 0 0;
307
+ padding: 0 .2em;
308
+ border-left: 0;
309
+ border-right: 0;
310
+ border-bottom: 0;
311
+ }
312
+ .ui-datepicker .ui-datepicker-buttonpane button {
313
+ float: right;
314
+ margin: .5em .2em .4em;
315
+ cursor: pointer;
316
+ padding: .2em .6em .3em .6em;
317
+ width: auto;
318
+ overflow: visible;
319
+ }
320
+ .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
321
+ float: left;
322
+ }
323
+
324
+ /* with multiple calendars */
325
+ .ui-datepicker.ui-datepicker-multi {
326
+ width: auto;
327
+ }
328
+ .ui-datepicker-multi .ui-datepicker-group {
329
+ float: left;
330
+ }
331
+ .ui-datepicker-multi .ui-datepicker-group table {
332
+ width: 95%;
333
+ margin: 0 auto .4em;
334
+ }
335
+ .ui-datepicker-multi-2 .ui-datepicker-group {
336
+ width: 50%;
337
+ }
338
+ .ui-datepicker-multi-3 .ui-datepicker-group {
339
+ width: 33.3%;
340
+ }
341
+ .ui-datepicker-multi-4 .ui-datepicker-group {
342
+ width: 25%;
343
+ }
344
+ .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
345
+ .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
346
+ border-left-width: 0;
347
+ }
348
+ .ui-datepicker-multi .ui-datepicker-buttonpane {
349
+ clear: left;
350
+ }
351
+ .ui-datepicker-row-break {
352
+ clear: both;
353
+ width: 100%;
354
+ font-size: 0;
355
+ }
356
+
357
+ /* RTL support */
358
+ .ui-datepicker-rtl {
359
+ direction: rtl;
360
+ }
361
+ .ui-datepicker-rtl .ui-datepicker-prev {
362
+ right: 2px;
363
+ left: auto;
364
+ }
365
+ .ui-datepicker-rtl .ui-datepicker-next {
366
+ left: 2px;
367
+ right: auto;
368
+ }
369
+ .ui-datepicker-rtl .ui-datepicker-prev:hover {
370
+ right: 1px;
371
+ left: auto;
372
+ }
373
+ .ui-datepicker-rtl .ui-datepicker-next:hover {
374
+ left: 1px;
375
+ right: auto;
376
+ }
377
+ .ui-datepicker-rtl .ui-datepicker-buttonpane {
378
+ clear: right;
379
+ }
380
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button {
381
+ float: left;
382
+ }
383
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
384
+ .ui-datepicker-rtl .ui-datepicker-group {
385
+ float: right;
386
+ }
387
+ .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
388
+ .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
389
+ border-right-width: 0;
390
+ border-left-width: 1px;
391
+ }
392
+ .ui-dialog {
393
+ overflow: hidden;
394
+ position: absolute;
395
+ top: 0;
396
+ left: 0;
397
+ padding: .2em;
398
+ outline: 0;
399
+ }
400
+ .ui-dialog .ui-dialog-titlebar {
401
+ padding: .4em 1em;
402
+ position: relative;
403
+ }
404
+ .ui-dialog .ui-dialog-title {
405
+ float: left;
406
+ margin: .1em 0;
407
+ white-space: nowrap;
408
+ width: 90%;
409
+ overflow: hidden;
410
+ text-overflow: ellipsis;
411
+ }
412
+ .ui-dialog .ui-dialog-titlebar-close {
413
+ position: absolute;
414
+ right: .3em;
415
+ top: 50%;
416
+ width: 20px;
417
+ margin: -10px 0 0 0;
418
+ padding: 1px;
419
+ height: 20px;
420
+ }
421
+ .ui-dialog .ui-dialog-content {
422
+ position: relative;
423
+ border: 0;
424
+ padding: .5em 1em;
425
+ background: none;
426
+ overflow: auto;
427
+ }
428
+ .ui-dialog .ui-dialog-buttonpane {
429
+ text-align: left;
430
+ border-width: 1px 0 0 0;
431
+ background-image: none;
432
+ margin-top: .5em;
433
+ padding: .3em 1em .5em .4em;
434
+ }
435
+ .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
436
+ float: right;
437
+ }
438
+ .ui-dialog .ui-dialog-buttonpane button {
439
+ margin: .5em .4em .5em 0;
440
+ cursor: pointer;
441
+ }
442
+ .ui-dialog .ui-resizable-se {
443
+ width: 12px;
444
+ height: 12px;
445
+ right: -5px;
446
+ bottom: -5px;
447
+ background-position: 16px 16px;
448
+ }
449
+ .ui-draggable .ui-dialog-titlebar {
450
+ cursor: move;
451
+ }
452
+ .ui-menu {
453
+ list-style: none;
454
+ padding: 2px;
455
+ margin: 0;
456
+ display: block;
457
+ outline: none;
458
+ }
459
+ .ui-menu .ui-menu {
460
+ margin-top: -3px;
461
+ position: absolute;
462
+ }
463
+ .ui-menu .ui-menu-item {
464
+ margin: 0;
465
+ padding: 0;
466
+ width: 100%;
467
+ /* support: IE10, see #8844 */
468
+ list-style-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);
469
+ }
470
+ .ui-menu .ui-menu-divider {
471
+ margin: 5px -2px 5px -2px;
472
+ height: 0;
473
+ font-size: 0;
474
+ line-height: 0;
475
+ border-width: 1px 0 0 0;
476
+ }
477
+ .ui-menu .ui-menu-item a {
478
+ text-decoration: none;
479
+ display: block;
480
+ padding: 2px .4em;
481
+ line-height: 1.5;
482
+ min-height: 0; /* support: IE7 */
483
+ font-weight: normal;
484
+ }
485
+ .ui-menu .ui-menu-item a.ui-state-focus,
486
+ .ui-menu .ui-menu-item a.ui-state-active {
487
+ font-weight: normal;
488
+ margin: -1px;
489
+ }
490
+
491
+ .ui-menu .ui-state-disabled {
492
+ font-weight: normal;
493
+ margin: .4em 0 .2em;
494
+ line-height: 1.5;
495
+ }
496
+ .ui-menu .ui-state-disabled a {
497
+ cursor: default;
498
+ }
499
+
500
+ /* icon support */
501
+ .ui-menu-icons {
502
+ position: relative;
503
+ }
504
+ .ui-menu-icons .ui-menu-item a {
505
+ position: relative;
506
+ padding-left: 2em;
507
+ }
508
+
509
+ /* left-aligned */
510
+ .ui-menu .ui-icon {
511
+ position: absolute;
512
+ top: .2em;
513
+ left: .2em;
514
+ }
515
+
516
+ /* right-aligned */
517
+ .ui-menu .ui-menu-icon {
518
+ position: static;
519
+ float: right;
520
+ }
521
+ .ui-progressbar {
522
+ height: 2em;
523
+ text-align: left;
524
+ overflow: hidden;
525
+ }
526
+ .ui-progressbar .ui-progressbar-value {
527
+ margin: -1px;
528
+ height: 100%;
529
+ }
530
+ .ui-progressbar .ui-progressbar-overlay {
531
+ background: url("images/animated-overlay.gif");
532
+ height: 100%;
533
+ filter: alpha(opacity=25);
534
+ opacity: 0.25;
535
+ }
536
+ .ui-progressbar-indeterminate .ui-progressbar-value {
537
+ background-image: none;
538
+ }
539
+ .ui-resizable {
540
+ position: relative;
541
+ }
542
+ .ui-resizable-handle {
543
+ position: absolute;
544
+ font-size: 0.1px;
545
+ display: block;
546
+ }
547
+ .ui-resizable-disabled .ui-resizable-handle,
548
+ .ui-resizable-autohide .ui-resizable-handle {
549
+ display: none;
550
+ }
551
+ .ui-resizable-n {
552
+ cursor: n-resize;
553
+ height: 7px;
554
+ width: 100%;
555
+ top: -5px;
556
+ left: 0;
557
+ }
558
+ .ui-resizable-s {
559
+ cursor: s-resize;
560
+ height: 7px;
561
+ width: 100%;
562
+ bottom: -5px;
563
+ left: 0;
564
+ }
565
+ .ui-resizable-e {
566
+ cursor: e-resize;
567
+ width: 7px;
568
+ right: -5px;
569
+ top: 0;
570
+ height: 100%;
571
+ }
572
+ .ui-resizable-w {
573
+ cursor: w-resize;
574
+ width: 7px;
575
+ left: -5px;
576
+ top: 0;
577
+ height: 100%;
578
+ }
579
+ .ui-resizable-se {
580
+ cursor: se-resize;
581
+ width: 12px;
582
+ height: 12px;
583
+ right: 1px;
584
+ bottom: 1px;
585
+ }
586
+ .ui-resizable-sw {
587
+ cursor: sw-resize;
588
+ width: 9px;
589
+ height: 9px;
590
+ left: -5px;
591
+ bottom: -5px;
592
+ }
593
+ .ui-resizable-nw {
594
+ cursor: nw-resize;
595
+ width: 9px;
596
+ height: 9px;
597
+ left: -5px;
598
+ top: -5px;
599
+ }
600
+ .ui-resizable-ne {
601
+ cursor: ne-resize;
602
+ width: 9px;
603
+ height: 9px;
604
+ right: -5px;
605
+ top: -5px;
606
+ }
607
+ .ui-selectable-helper {
608
+ position: absolute;
609
+ z-index: 100;
610
+ border: 1px dotted black;
611
+ }
612
+ .ui-slider {
613
+ position: relative;
614
+ text-align: left;
615
+ }
616
+ .ui-slider .ui-slider-handle {
617
+ position: absolute;
618
+ z-index: 2;
619
+ width: 1.2em;
620
+ height: 1.2em;
621
+ cursor: default;
622
+ }
623
+ .ui-slider .ui-slider-range {
624
+ position: absolute;
625
+ z-index: 1;
626
+ font-size: .7em;
627
+ display: block;
628
+ border: 0;
629
+ background-position: 0 0;
630
+ }
631
+
632
+ /* For IE8 - See #6727 */
633
+ .ui-slider.ui-state-disabled .ui-slider-handle,
634
+ .ui-slider.ui-state-disabled .ui-slider-range {
635
+ filter: inherit;
636
+ }
637
+
638
+ .ui-slider-horizontal {
639
+ height: .8em;
640
+ }
641
+ .ui-slider-horizontal .ui-slider-handle {
642
+ top: -.3em;
643
+ margin-left: -.6em;
644
+ }
645
+ .ui-slider-horizontal .ui-slider-range {
646
+ top: 0;
647
+ height: 100%;
648
+ }
649
+ .ui-slider-horizontal .ui-slider-range-min {
650
+ left: 0;
651
+ }
652
+ .ui-slider-horizontal .ui-slider-range-max {
653
+ right: 0;
654
+ }
655
+
656
+ .ui-slider-vertical {
657
+ width: .8em;
658
+ height: 100px;
659
+ }
660
+ .ui-slider-vertical .ui-slider-handle {
661
+ left: -.3em;
662
+ margin-left: 0;
663
+ margin-bottom: -.6em;
664
+ }
665
+ .ui-slider-vertical .ui-slider-range {
666
+ left: 0;
667
+ width: 100%;
668
+ }
669
+ .ui-slider-vertical .ui-slider-range-min {
670
+ bottom: 0;
671
+ }
672
+ .ui-slider-vertical .ui-slider-range-max {
673
+ top: 0;
674
+ }
675
+ .ui-spinner {
676
+ position: relative;
677
+ display: inline-block;
678
+ overflow: hidden;
679
+ padding: 0;
680
+ vertical-align: middle;
681
+ }
682
+ .ui-spinner-input {
683
+ border: none;
684
+ background: none;
685
+ color: inherit;
686
+ padding: 0;
687
+ margin: .2em 0;
688
+ vertical-align: middle;
689
+ margin-left: .4em;
690
+ margin-right: 22px;
691
+ }
692
+ .ui-spinner-button {
693
+ width: 16px;
694
+ height: 50%;
695
+ font-size: .5em;
696
+ padding: 0;
697
+ margin: 0;
698
+ text-align: center;
699
+ position: absolute;
700
+ cursor: default;
701
+ display: block;
702
+ overflow: hidden;
703
+ right: 0;
704
+ }
705
+ /* more specificity required here to override default borders */
706
+ .ui-spinner a.ui-spinner-button {
707
+ border-top: none;
708
+ border-bottom: none;
709
+ border-right: none;
710
+ }
711
+ /* vertically center icon */
712
+ .ui-spinner .ui-icon {
713
+ position: absolute;
714
+ margin-top: -8px;
715
+ top: 50%;
716
+ left: 0;
717
+ }
718
+ .ui-spinner-up {
719
+ top: 0;
720
+ }
721
+ .ui-spinner-down {
722
+ bottom: 0;
723
+ }
724
+
725
+ /* TR overrides */
726
+ .ui-spinner .ui-icon-triangle-1-s {
727
+ /* need to fix icons sprite */
728
+ background-position: -65px -16px;
729
+ }
730
+ .ui-tabs {
731
+ position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
732
+ padding: .2em;
733
+ }
734
+ .ui-tabs .ui-tabs-nav {
735
+ margin: 0;
736
+ padding: .2em .2em 0;
737
+ }
738
+ .ui-tabs .ui-tabs-nav li {
739
+ list-style: none;
740
+ float: left;
741
+ position: relative;
742
+ top: 0;
743
+ margin: 1px .2em 0 0;
744
+ border-bottom-width: 0;
745
+ padding: 0;
746
+ white-space: nowrap;
747
+ }
748
+ .ui-tabs .ui-tabs-nav .ui-tabs-anchor {
749
+ float: left;
750
+ padding: .5em 1em;
751
+ text-decoration: none;
752
+ }
753
+ .ui-tabs .ui-tabs-nav li.ui-tabs-active {
754
+ margin-bottom: -1px;
755
+ padding-bottom: 1px;
756
+ }
757
+ .ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
758
+ .ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
759
+ .ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
760
+ cursor: text;
761
+ }
762
+ .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
763
+ cursor: pointer;
764
+ }
765
+ .ui-tabs .ui-tabs-panel {
766
+ display: block;
767
+ border-width: 0;
768
+ padding: 1em 1.4em;
769
+ background: none;
770
+ }
771
+ .ui-tooltip {
772
+ padding: 8px;
773
+ position: absolute;
774
+ z-index: 9999;
775
+ max-width: 300px;
776
+ -webkit-box-shadow: 0 0 5px #aaa;
777
+ box-shadow: 0 0 5px #aaa;
778
+ }
779
+ body .ui-tooltip {
780
+ border-width: 2px;
781
+ }
782
+
783
+ /* Component containers
784
+ ----------------------------------*/
785
+ .ui-widget {
786
+ font-family: Verdana,Arial,sans-serif;
787
+ font-size: 1.1em;
788
+ }
789
+ .ui-widget .ui-widget {
790
+ font-size: 1em;
791
+ }
792
+ .ui-widget input,
793
+ .ui-widget select,
794
+ .ui-widget textarea,
795
+ .ui-widget button {
796
+ font-family: Verdana,Arial,sans-serif;
797
+ font-size: 1em;
798
+ }
799
+ .ui-widget-content {
800
+ border: 1px solid #aaaaaa;
801
+ background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;
802
+ color: #222222;
803
+ }
804
+ .ui-widget-content a {
805
+ color: #222222;
806
+ }
807
+ .ui-widget-header {
808
+ border: 1px solid #aaaaaa;
809
+ background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;
810
+ color: #222222;
811
+ font-weight: bold;
812
+ }
813
+ .ui-widget-header a {
814
+ color: #222222;
815
+ }
816
+
817
+ /* Interaction states
818
+ ----------------------------------*/
819
+ .ui-state-default,
820
+ .ui-widget-content .ui-state-default,
821
+ .ui-widget-header .ui-state-default {
822
+ border: 1px solid #d3d3d3;
823
+ background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;
824
+ font-weight: normal;
825
+ color: #555555;
826
+ }
827
+ .ui-state-default a,
828
+ .ui-state-default a:link,
829
+ .ui-state-default a:visited {
830
+ color: #555555;
831
+ text-decoration: none;
832
+ }
833
+ .ui-state-hover,
834
+ .ui-widget-content .ui-state-hover,
835
+ .ui-widget-header .ui-state-hover,
836
+ .ui-state-focus,
837
+ .ui-widget-content .ui-state-focus,
838
+ .ui-widget-header .ui-state-focus {
839
+ border: 1px solid #999999;
840
+ background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;
841
+ font-weight: normal;
842
+ color: #212121;
843
+ }
844
+ .ui-state-hover a,
845
+ .ui-state-hover a:hover,
846
+ .ui-state-hover a:link,
847
+ .ui-state-hover a:visited,
848
+ .ui-state-focus a,
849
+ .ui-state-focus a:hover,
850
+ .ui-state-focus a:link,
851
+ .ui-state-focus a:visited {
852
+ color: #212121;
853
+ text-decoration: none;
854
+ }
855
+ .ui-state-active,
856
+ .ui-widget-content .ui-state-active,
857
+ .ui-widget-header .ui-state-active {
858
+ border: 1px solid #aaaaaa;
859
+ background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;
860
+ font-weight: normal;
861
+ color: #212121;
862
+ }
863
+ .ui-state-active a,
864
+ .ui-state-active a:link,
865
+ .ui-state-active a:visited {
866
+ color: #212121;
867
+ text-decoration: none;
868
+ }
869
+
870
+ /* Interaction Cues
871
+ ----------------------------------*/
872
+ .ui-state-highlight,
873
+ .ui-widget-content .ui-state-highlight,
874
+ .ui-widget-header .ui-state-highlight {
875
+ border: 1px solid #fcefa1;
876
+ background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;
877
+ color: #363636;
878
+ }
879
+ .ui-state-highlight a,
880
+ .ui-widget-content .ui-state-highlight a,
881
+ .ui-widget-header .ui-state-highlight a {
882
+ color: #363636;
883
+ }
884
+ .ui-state-error,
885
+ .ui-widget-content .ui-state-error,
886
+ .ui-widget-header .ui-state-error {
887
+ border: 1px solid #cd0a0a;
888
+ background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;
889
+ color: #cd0a0a;
890
+ }
891
+ .ui-state-error a,
892
+ .ui-widget-content .ui-state-error a,
893
+ .ui-widget-header .ui-state-error a {
894
+ color: #cd0a0a;
895
+ }
896
+ .ui-state-error-text,
897
+ .ui-widget-content .ui-state-error-text,
898
+ .ui-widget-header .ui-state-error-text {
899
+ color: #cd0a0a;
900
+ }
901
+ .ui-priority-primary,
902
+ .ui-widget-content .ui-priority-primary,
903
+ .ui-widget-header .ui-priority-primary {
904
+ font-weight: bold;
905
+ }
906
+ .ui-priority-secondary,
907
+ .ui-widget-content .ui-priority-secondary,
908
+ .ui-widget-header .ui-priority-secondary {
909
+ opacity: .7;
910
+ filter:Alpha(Opacity=70);
911
+ font-weight: normal;
912
+ }
913
+ .ui-state-disabled,
914
+ .ui-widget-content .ui-state-disabled,
915
+ .ui-widget-header .ui-state-disabled {
916
+ opacity: .35;
917
+ filter:Alpha(Opacity=35);
918
+ background-image: none;
919
+ }
920
+ .ui-state-disabled .ui-icon {
921
+ filter:Alpha(Opacity=35); /* For IE8 - See #6059 */
922
+ }
923
+
924
+ /* Icons
925
+ ----------------------------------*/
926
+
927
+ /* states and images */
928
+ .ui-icon {
929
+ width: 16px;
930
+ height: 16px;
931
+ }
932
+ .ui-icon,
933
+ .ui-widget-content .ui-icon {
934
+ background-image: url(images/ui-icons_222222_256x240.png);
935
+ }
936
+ .ui-widget-header .ui-icon {
937
+ background-image: url(images/ui-icons_222222_256x240.png);
938
+ }
939
+ .ui-state-default .ui-icon {
940
+ background-image: url(images/ui-icons_888888_256x240.png);
941
+ }
942
+ .ui-state-hover .ui-icon,
943
+ .ui-state-focus .ui-icon {
944
+ background-image: url(images/ui-icons_454545_256x240.png);
945
+ }
946
+ .ui-state-active .ui-icon {
947
+ background-image: url(images/ui-icons_454545_256x240.png);
948
+ }
949
+ .ui-state-highlight .ui-icon {
950
+ background-image: url(images/ui-icons_2e83ff_256x240.png);
951
+ }
952
+ .ui-state-error .ui-icon,
953
+ .ui-state-error-text .ui-icon {
954
+ background-image: url(images/ui-icons_cd0a0a_256x240.png);
955
+ }
956
+
957
+ /* positioning */
958
+ .ui-icon-blank { background-position: 16px 16px; }
959
+ .ui-icon-carat-1-n { background-position: 0 0; }
960
+ .ui-icon-carat-1-ne { background-position: -16px 0; }
961
+ .ui-icon-carat-1-e { background-position: -32px 0; }
962
+ .ui-icon-carat-1-se { background-position: -48px 0; }
963
+ .ui-icon-carat-1-s { background-position: -64px 0; }
964
+ .ui-icon-carat-1-sw { background-position: -80px 0; }
965
+ .ui-icon-carat-1-w { background-position: -96px 0; }
966
+ .ui-icon-carat-1-nw { background-position: -112px 0; }
967
+ .ui-icon-carat-2-n-s { background-position: -128px 0; }
968
+ .ui-icon-carat-2-e-w { background-position: -144px 0; }
969
+ .ui-icon-triangle-1-n { background-position: 0 -16px; }
970
+ .ui-icon-triangle-1-ne { background-position: -16px -16px; }
971
+ .ui-icon-triangle-1-e { background-position: -32px -16px; }
972
+ .ui-icon-triangle-1-se { background-position: -48px -16px; }
973
+ .ui-icon-triangle-1-s { background-position: -64px -16px; }
974
+ .ui-icon-triangle-1-sw { background-position: -80px -16px; }
975
+ .ui-icon-triangle-1-w { background-position: -96px -16px; }
976
+ .ui-icon-triangle-1-nw { background-position: -112px -16px; }
977
+ .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
978
+ .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
979
+ .ui-icon-arrow-1-n { background-position: 0 -32px; }
980
+ .ui-icon-arrow-1-ne { background-position: -16px -32px; }
981
+ .ui-icon-arrow-1-e { background-position: -32px -32px; }
982
+ .ui-icon-arrow-1-se { background-position: -48px -32px; }
983
+ .ui-icon-arrow-1-s { background-position: -64px -32px; }
984
+ .ui-icon-arrow-1-sw { background-position: -80px -32px; }
985
+ .ui-icon-arrow-1-w { background-position: -96px -32px; }
986
+ .ui-icon-arrow-1-nw { background-position: -112px -32px; }
987
+ .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
988
+ .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
989
+ .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
990
+ .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
991
+ .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
992
+ .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
993
+ .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
994
+ .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
995
+ .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
996
+ .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
997
+ .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
998
+ .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
999
+ .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
1000
+ .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
1001
+ .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
1002
+ .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
1003
+ .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
1004
+ .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
1005
+ .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
1006
+ .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
1007
+ .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
1008
+ .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
1009
+ .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
1010
+ .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
1011
+ .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
1012
+ .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
1013
+ .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
1014
+ .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
1015
+ .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
1016
+ .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
1017
+ .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
1018
+ .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
1019
+ .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
1020
+ .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
1021
+ .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
1022
+ .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
1023
+ .ui-icon-arrow-4 { background-position: 0 -80px; }
1024
+ .ui-icon-arrow-4-diag { background-position: -16px -80px; }
1025
+ .ui-icon-extlink { background-position: -32px -80px; }
1026
+ .ui-icon-newwin { background-position: -48px -80px; }
1027
+ .ui-icon-refresh { background-position: -64px -80px; }
1028
+ .ui-icon-shuffle { background-position: -80px -80px; }
1029
+ .ui-icon-transfer-e-w { background-position: -96px -80px; }
1030
+ .ui-icon-transferthick-e-w { background-position: -112px -80px; }
1031
+ .ui-icon-folder-collapsed { background-position: 0 -96px; }
1032
+ .ui-icon-folder-open { background-position: -16px -96px; }
1033
+ .ui-icon-document { background-position: -32px -96px; }
1034
+ .ui-icon-document-b { background-position: -48px -96px; }
1035
+ .ui-icon-note { background-position: -64px -96px; }
1036
+ .ui-icon-mail-closed { background-position: -80px -96px; }
1037
+ .ui-icon-mail-open { background-position: -96px -96px; }
1038
+ .ui-icon-suitcase { background-position: -112px -96px; }
1039
+ .ui-icon-comment { background-position: -128px -96px; }
1040
+ .ui-icon-person { background-position: -144px -96px; }
1041
+ .ui-icon-print { background-position: -160px -96px; }
1042
+ .ui-icon-trash { background-position: -176px -96px; }
1043
+ .ui-icon-locked { background-position: -192px -96px; }
1044
+ .ui-icon-unlocked { background-position: -208px -96px; }
1045
+ .ui-icon-bookmark { background-position: -224px -96px; }
1046
+ .ui-icon-tag { background-position: -240px -96px; }
1047
+ .ui-icon-home { background-position: 0 -112px; }
1048
+ .ui-icon-flag { background-position: -16px -112px; }
1049
+ .ui-icon-calendar { background-position: -32px -112px; }
1050
+ .ui-icon-cart { background-position: -48px -112px; }
1051
+ .ui-icon-pencil { background-position: -64px -112px; }
1052
+ .ui-icon-clock { background-position: -80px -112px; }
1053
+ .ui-icon-disk { background-position: -96px -112px; }
1054
+ .ui-icon-calculator { background-position: -112px -112px; }
1055
+ .ui-icon-zoomin { background-position: -128px -112px; }
1056
+ .ui-icon-zoomout { background-position: -144px -112px; }
1057
+ .ui-icon-search { background-position: -160px -112px; }
1058
+ .ui-icon-wrench { background-position: -176px -112px; }
1059
+ .ui-icon-gear { background-position: -192px -112px; }
1060
+ .ui-icon-heart { background-position: -208px -112px; }
1061
+ .ui-icon-star { background-position: -224px -112px; }
1062
+ .ui-icon-link { background-position: -240px -112px; }
1063
+ .ui-icon-cancel { background-position: 0 -128px; }
1064
+ .ui-icon-plus { background-position: -16px -128px; }
1065
+ .ui-icon-plusthick { background-position: -32px -128px; }
1066
+ .ui-icon-minus { background-position: -48px -128px; }
1067
+ .ui-icon-minusthick { background-position: -64px -128px; }
1068
+ .ui-icon-close { background-position: -80px -128px; }
1069
+ .ui-icon-closethick { background-position: -96px -128px; }
1070
+ .ui-icon-key { background-position: -112px -128px; }
1071
+ .ui-icon-lightbulb { background-position: -128px -128px; }
1072
+ .ui-icon-scissors { background-position: -144px -128px; }
1073
+ .ui-icon-clipboard { background-position: -160px -128px; }
1074
+ .ui-icon-copy { background-position: -176px -128px; }
1075
+ .ui-icon-contact { background-position: -192px -128px; }
1076
+ .ui-icon-image { background-position: -208px -128px; }
1077
+ .ui-icon-video { background-position: -224px -128px; }
1078
+ .ui-icon-script { background-position: -240px -128px; }
1079
+ .ui-icon-alert { background-position: 0 -144px; }
1080
+ .ui-icon-info { background-position: -16px -144px; }
1081
+ .ui-icon-notice { background-position: -32px -144px; }
1082
+ .ui-icon-help { background-position: -48px -144px; }
1083
+ .ui-icon-check { background-position: -64px -144px; }
1084
+ .ui-icon-bullet { background-position: -80px -144px; }
1085
+ .ui-icon-radio-on { background-position: -96px -144px; }
1086
+ .ui-icon-radio-off { background-position: -112px -144px; }
1087
+ .ui-icon-pin-w { background-position: -128px -144px; }
1088
+ .ui-icon-pin-s { background-position: -144px -144px; }
1089
+ .ui-icon-play { background-position: 0 -160px; }
1090
+ .ui-icon-pause { background-position: -16px -160px; }
1091
+ .ui-icon-seek-next { background-position: -32px -160px; }
1092
+ .ui-icon-seek-prev { background-position: -48px -160px; }
1093
+ .ui-icon-seek-end { background-position: -64px -160px; }
1094
+ .ui-icon-seek-start { background-position: -80px -160px; }
1095
+ /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
1096
+ .ui-icon-seek-first { background-position: -80px -160px; }
1097
+ .ui-icon-stop { background-position: -96px -160px; }
1098
+ .ui-icon-eject { background-position: -112px -160px; }
1099
+ .ui-icon-volume-off { background-position: -128px -160px; }
1100
+ .ui-icon-volume-on { background-position: -144px -160px; }
1101
+ .ui-icon-power { background-position: 0 -176px; }
1102
+ .ui-icon-signal-diag { background-position: -16px -176px; }
1103
+ .ui-icon-signal { background-position: -32px -176px; }
1104
+ .ui-icon-battery-0 { background-position: -48px -176px; }
1105
+ .ui-icon-battery-1 { background-position: -64px -176px; }
1106
+ .ui-icon-battery-2 { background-position: -80px -176px; }
1107
+ .ui-icon-battery-3 { background-position: -96px -176px; }
1108
+ .ui-icon-circle-plus { background-position: 0 -192px; }
1109
+ .ui-icon-circle-minus { background-position: -16px -192px; }
1110
+ .ui-icon-circle-close { background-position: -32px -192px; }
1111
+ .ui-icon-circle-triangle-e { background-position: -48px -192px; }
1112
+ .ui-icon-circle-triangle-s { background-position: -64px -192px; }
1113
+ .ui-icon-circle-triangle-w { background-position: -80px -192px; }
1114
+ .ui-icon-circle-triangle-n { background-position: -96px -192px; }
1115
+ .ui-icon-circle-arrow-e { background-position: -112px -192px; }
1116
+ .ui-icon-circle-arrow-s { background-position: -128px -192px; }
1117
+ .ui-icon-circle-arrow-w { background-position: -144px -192px; }
1118
+ .ui-icon-circle-arrow-n { background-position: -160px -192px; }
1119
+ .ui-icon-circle-zoomin { background-position: -176px -192px; }
1120
+ .ui-icon-circle-zoomout { background-position: -192px -192px; }
1121
+ .ui-icon-circle-check { background-position: -208px -192px; }
1122
+ .ui-icon-circlesmall-plus { background-position: 0 -208px; }
1123
+ .ui-icon-circlesmall-minus { background-position: -16px -208px; }
1124
+ .ui-icon-circlesmall-close { background-position: -32px -208px; }
1125
+ .ui-icon-squaresmall-plus { background-position: -48px -208px; }
1126
+ .ui-icon-squaresmall-minus { background-position: -64px -208px; }
1127
+ .ui-icon-squaresmall-close { background-position: -80px -208px; }
1128
+ .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
1129
+ .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
1130
+ .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
1131
+ .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
1132
+ .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
1133
+ .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
1134
+
1135
+
1136
+ /* Misc visuals
1137
+ ----------------------------------*/
1138
+
1139
+ /* Corner radius */
1140
+ .ui-corner-all,
1141
+ .ui-corner-top,
1142
+ .ui-corner-left,
1143
+ .ui-corner-tl {
1144
+ border-top-left-radius: 4px;
1145
+ }
1146
+ .ui-corner-all,
1147
+ .ui-corner-top,
1148
+ .ui-corner-right,
1149
+ .ui-corner-tr {
1150
+ border-top-right-radius: 4px;
1151
+ }
1152
+ .ui-corner-all,
1153
+ .ui-corner-bottom,
1154
+ .ui-corner-left,
1155
+ .ui-corner-bl {
1156
+ border-bottom-left-radius: 4px;
1157
+ }
1158
+ .ui-corner-all,
1159
+ .ui-corner-bottom,
1160
+ .ui-corner-right,
1161
+ .ui-corner-br {
1162
+ border-bottom-right-radius: 4px;
1163
+ }
1164
+
1165
+ /* Overlays */
1166
+ .ui-widget-overlay {
1167
+ background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
1168
+ opacity: .3;
1169
+ filter: Alpha(Opacity=30);
1170
+ }
1171
+ .ui-widget-shadow {
1172
+ margin: -8px 0 0 -8px;
1173
+ padding: 8px;
1174
+ background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
1175
+ opacity: .3;
1176
+ filter: Alpha(Opacity=30);
1177
+ border-radius: 8px;
1178
+ }
css/style.ykseme.css CHANGED
@@ -278,4 +278,24 @@
278
  margin-bottom: 0;
279
  padding-top: 0;
280
  padding-bottom: 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
281
  }
278
  margin-bottom: 0;
279
  padding-top: 0;
280
  padding-bottom: 0;
281
+ }
282
+
283
+ .mailChimp_api_key_preloader {
284
+ margin-left:.5em;
285
+ display:none;
286
+ }
287
+
288
+ .mailChimp_api_key_validation_message {
289
+ margin-left:.5em;
290
+ display:none;
291
+ font-size:10px;
292
+ }
293
+
294
+ .mailChimp_api_key_validation {
295
+
296
+ }
297
+
298
+ .yikes-api-key-error {
299
+ display:none;
300
+ color:red;
301
  }
images/yikes-mc-checkmark.png ADDED
Binary file
images/yikes-mc-error-icon.png ADDED
Binary file
js/jQuery_1.11.0.min.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ /*! jQuery v1.11.0 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
2
+ !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k="".trim,l={},m="1.11.0",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(l.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:k&&!k.call("\ufeff\xa0")?function(a){return null==a?"":k.call(a)}:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||n.guid++,e):void 0},now:function(){return+new Date},support:l}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s="sizzle"+-new Date,t=a.document,u=0,v=0,w=eb(),x=eb(),y=eb(),z=function(a,b){return a===b&&(j=!0),0},A="undefined",B=1<<31,C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=D.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",M=L.replace("w","w#"),N="\\["+K+"*("+L+")"+K+"*(?:([*^$|!~]?=)"+K+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+M+")|)|)"+K+"*\\]",O=":("+L+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+N.replace(3,8)+")*)|.*)\\)|)",P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(O),U=new RegExp("^"+M+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L.replace("w","w*")+")"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=/'|\\/g,ab=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),bb=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{G.apply(D=H.call(t.childNodes),t.childNodes),D[t.childNodes.length].nodeType}catch(cb){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function db(a,b,d,e){var f,g,h,i,j,m,p,q,u,v;if((b?b.ownerDocument||b:t)!==l&&k(b),b=b||l,d=d||[],!a||"string"!=typeof a)return d;if(1!==(i=b.nodeType)&&9!==i)return[];if(n&&!e){if(f=Z.exec(a))if(h=f[1]){if(9===i){if(g=b.getElementById(h),!g||!g.parentNode)return d;if(g.id===h)return d.push(g),d}else if(b.ownerDocument&&(g=b.ownerDocument.getElementById(h))&&r(b,g)&&g.id===h)return d.push(g),d}else{if(f[2])return G.apply(d,b.getElementsByTagName(a)),d;if((h=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(h)),d}if(c.qsa&&(!o||!o.test(a))){if(q=p=s,u=b,v=9===i&&a,1===i&&"object"!==b.nodeName.toLowerCase()){m=ob(a),(p=b.getAttribute("id"))?q=p.replace(_,"\\$&"):b.setAttribute("id",q),q="[id='"+q+"'] ",j=m.length;while(j--)m[j]=q+pb(m[j]);u=$.test(a)&&mb(b.parentNode)||b,v=m.join(",")}if(v)try{return G.apply(d,u.querySelectorAll(v)),d}catch(w){}finally{p||b.removeAttribute("id")}}}return xb(a.replace(P,"$1"),b,d,e)}function eb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function fb(a){return a[s]=!0,a}function gb(a){var b=l.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function hb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function ib(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||B)-(~a.sourceIndex||B);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function jb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function kb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function lb(a){return fb(function(b){return b=+b,fb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function mb(a){return a&&typeof a.getElementsByTagName!==A&&a}c=db.support={},f=db.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},k=db.setDocument=function(a){var b,e=a?a.ownerDocument||a:t,g=e.defaultView;return e!==l&&9===e.nodeType&&e.documentElement?(l=e,m=e.documentElement,n=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){k()},!1):g.attachEvent&&g.attachEvent("onunload",function(){k()})),c.attributes=gb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=gb(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(e.getElementsByClassName)&&gb(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=gb(function(a){return m.appendChild(a).id=s,!e.getElementsByName||!e.getElementsByName(s).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==A&&n){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){var c=typeof a.getAttributeNode!==A&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==A?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==A&&n?b.getElementsByClassName(a):void 0},p=[],o=[],(c.qsa=Y.test(e.querySelectorAll))&&(gb(function(a){a.innerHTML="<select t=''><option selected=''></option></select>",a.querySelectorAll("[t^='']").length&&o.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||o.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll(":checked").length||o.push(":checked")}),gb(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&o.push("name"+K+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||o.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),o.push(",.*:")})),(c.matchesSelector=Y.test(q=m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&gb(function(a){c.disconnectedMatch=q.call(a,"div"),q.call(a,"[s!='']:x"),p.push("!=",O)}),o=o.length&&new RegExp(o.join("|")),p=p.length&&new RegExp(p.join("|")),b=Y.test(m.compareDocumentPosition),r=b||Y.test(m.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},z=b?function(a,b){if(a===b)return j=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===t&&r(t,a)?-1:b===e||b.ownerDocument===t&&r(t,b)?1:i?I.call(i,a)-I.call(i,b):0:4&d?-1:1)}:function(a,b){if(a===b)return j=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],k=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:i?I.call(i,a)-I.call(i,b):0;if(f===g)return ib(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)k.unshift(c);while(h[d]===k[d])d++;return d?ib(h[d],k[d]):h[d]===t?-1:k[d]===t?1:0},e):l},db.matches=function(a,b){return db(a,null,null,b)},db.matchesSelector=function(a,b){if((a.ownerDocument||a)!==l&&k(a),b=b.replace(S,"='$1']"),!(!c.matchesSelector||!n||p&&p.test(b)||o&&o.test(b)))try{var d=q.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return db(b,l,null,[a]).length>0},db.contains=function(a,b){return(a.ownerDocument||a)!==l&&k(a),r(a,b)},db.attr=function(a,b){(a.ownerDocument||a)!==l&&k(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!n):void 0;return void 0!==f?f:c.attributes||!n?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},db.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},db.uniqueSort=function(a){var b,d=[],e=0,f=0;if(j=!c.detectDuplicates,i=!c.sortStable&&a.slice(0),a.sort(z),j){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return i=null,a},e=db.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=db.selectors={cacheLength:50,createPseudo:fb,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ab,bb),a[3]=(a[4]||a[5]||"").replace(ab,bb),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||db.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&db.error(a[0]),a},PSEUDO:function(a){var b,c=!a[5]&&a[2];return V.CHILD.test(a[0])?null:(a[3]&&void 0!==a[4]?a[2]=a[4]:c&&T.test(c)&&(b=ob(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ab,bb).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=w[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&w(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==A&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=db.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),t=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&t){k=q[s]||(q[s]={}),j=k[a]||[],n=j[0]===u&&j[1],m=j[0]===u&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[u,n,m];break}}else if(t&&(j=(b[s]||(b[s]={}))[a])&&j[0]===u)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(t&&((l[s]||(l[s]={}))[a]=[u,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||db.error("unsupported pseudo: "+a);return e[s]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?fb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:fb(function(a){var b=[],c=[],d=g(a.replace(P,"$1"));return d[s]?fb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:fb(function(a){return function(b){return db(a,b).length>0}}),contains:fb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:fb(function(a){return U.test(a||"")||db.error("unsupported lang: "+a),a=a.replace(ab,bb).toLowerCase(),function(b){var c;do if(c=n?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===m},focus:function(a){return a===l.activeElement&&(!l.hasFocus||l.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:lb(function(){return[0]}),last:lb(function(a,b){return[b-1]}),eq:lb(function(a,b,c){return[0>c?c+b:c]}),even:lb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:lb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:lb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:lb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=jb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=kb(b);function nb(){}nb.prototype=d.filters=d.pseudos,d.setFilters=new nb;function ob(a,b){var c,e,f,g,h,i,j,k=x[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=Q.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=R.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(P," ")}),h=h.slice(c.length));for(g in d.filter)!(e=V[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?db.error(a):x(a,i).slice(0)}function pb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function qb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=v++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[u,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[s]||(b[s]={}),(h=i[d])&&h[0]===u&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function rb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function sb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function tb(a,b,c,d,e,f){return d&&!d[s]&&(d=tb(d)),e&&!e[s]&&(e=tb(e,f)),fb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||wb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:sb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=sb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=sb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ub(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],i=g||d.relative[" "],j=g?1:0,k=qb(function(a){return a===b},i,!0),l=qb(function(a){return I.call(b,a)>-1},i,!0),m=[function(a,c,d){return!g&&(d||c!==h)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>j;j++)if(c=d.relative[a[j].type])m=[qb(rb(m),c)];else{if(c=d.filter[a[j].type].apply(null,a[j].matches),c[s]){for(e=++j;f>e;e++)if(d.relative[a[e].type])break;return tb(j>1&&rb(m),j>1&&pb(a.slice(0,j-1).concat({value:" "===a[j-2].type?"*":""})).replace(P,"$1"),c,e>j&&ub(a.slice(j,e)),f>e&&ub(a=a.slice(e)),f>e&&pb(a))}m.push(c)}return rb(m)}function vb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,i,j,k){var m,n,o,p=0,q="0",r=f&&[],s=[],t=h,v=f||e&&d.find.TAG("*",k),w=u+=null==t?1:Math.random()||.1,x=v.length;for(k&&(h=g!==l&&g);q!==x&&null!=(m=v[q]);q++){if(e&&m){n=0;while(o=a[n++])if(o(m,g,i)){j.push(m);break}k&&(u=w)}c&&((m=!o&&m)&&p--,f&&r.push(m))}if(p+=q,c&&q!==p){n=0;while(o=b[n++])o(r,s,g,i);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=E.call(j));s=sb(s)}G.apply(j,s),k&&!f&&s.length>0&&p+b.length>1&&db.uniqueSort(j)}return k&&(u=w,h=t),r};return c?fb(f):f}g=db.compile=function(a,b){var c,d=[],e=[],f=y[a+" "];if(!f){b||(b=ob(a)),c=b.length;while(c--)f=ub(b[c]),f[s]?d.push(f):e.push(f);f=y(a,vb(e,d))}return f};function wb(a,b,c){for(var d=0,e=b.length;e>d;d++)db(a,b[d],c);return c}function xb(a,b,e,f){var h,i,j,k,l,m=ob(a);if(!f&&1===m.length){if(i=m[0]=m[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&c.getById&&9===b.nodeType&&n&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(ab,bb),b)||[])[0],!b)return e;a=a.slice(i.shift().value.length)}h=V.needsContext.test(a)?0:i.length;while(h--){if(j=i[h],d.relative[k=j.type])break;if((l=d.find[k])&&(f=l(j.matches[0].replace(ab,bb),$.test(i[0].type)&&mb(b.parentNode)||b))){if(i.splice(h,1),a=f.length&&pb(i),!a)return G.apply(e,f),e;break}}}return g(a,m)(f,b,!n,e,$.test(a)&&mb(b.parentNode)||b),e}return c.sortStable=s.split("").sort(z).join("")===s,c.detectDuplicates=!!j,k(),c.sortDetached=gb(function(a){return 1&a.compareDocumentPosition(l.createElement("div"))}),gb(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||hb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&gb(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||hb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),gb(function(a){return null==a.getAttribute("disabled")})||hb(J,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),db}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=a.document,A=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,B=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:A.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:z,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=z.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return y.find(a);this.length=1,this[0]=d}return this.context=z,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};B.prototype=n.fn,y=n(z);var C=/^(?:parents|prev(?:Until|All))/,D={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!n(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function E(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return E(a,"nextSibling")},prev:function(a){return E(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(D[a]||(e=n.unique(e)),C.test(a)&&(e=e.reverse())),this.pushStack(e)}});var F=/\S+/g,G={};function H(a){var b=G[a]={};return n.each(a.match(F)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?G[a]||H(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&n.each(arguments,function(a,c){var d;while((d=n.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){if(a===!0?!--n.readyWait:!n.isReady){if(!z.body)return setTimeout(n.ready);n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(z,[n]),n.fn.trigger&&n(z).trigger("ready").off("ready"))}}});function J(){z.addEventListener?(z.removeEventListener("DOMContentLoaded",K,!1),a.removeEventListener("load",K,!1)):(z.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(z.addEventListener||"load"===event.type||"complete"===z.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===z.readyState)setTimeout(n.ready);else if(z.addEventListener)z.addEventListener("DOMContentLoaded",K,!1),a.addEventListener("load",K,!1);else{z.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&z.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!n.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}J(),n.ready()}}()}return I.promise(b)};var L="undefined",M;for(M in n(l))break;l.ownLast="0"!==M,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c=z.getElementsByTagName("body")[0];c&&(a=z.createElement("div"),a.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",b=z.createElement("div"),c.appendChild(a).appendChild(b),typeof b.style.zoom!==L&&(b.style.cssText="border:0;margin:0;width:1px;padding:1px;display:inline;zoom:1",(l.inlineBlockNeedsLayout=3===b.offsetWidth)&&(c.style.zoom=1)),c.removeChild(a),a=b=null)}),function(){var a=z.createElement("div");if(null==l.deleteExpando){l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}}a=null}(),n.acceptData=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(n.acceptData(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f
3
+ }}function S(a,b,c){if(n.acceptData(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d]));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=n._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var T=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,U=["Top","Right","Bottom","Left"],V=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},W=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},X=/^(?:checkbox|radio)$/i;!function(){var a=z.createDocumentFragment(),b=z.createElement("div"),c=z.createElement("input");if(b.setAttribute("className","t"),b.innerHTML=" <link/><table></table><a href='/a'>a</a>",l.leadingWhitespace=3===b.firstChild.nodeType,l.tbody=!b.getElementsByTagName("tbody").length,l.htmlSerialize=!!b.getElementsByTagName("link").length,l.html5Clone="<:nav></:nav>"!==z.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,a.appendChild(c),l.appendChecked=c.checked,b.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,a.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){l.noCloneEvent=!1}),b.cloneNode(!0).click()),null==l.deleteExpando){l.deleteExpando=!0;try{delete b.test}catch(d){l.deleteExpando=!1}}a=b=c=null}(),function(){var b,c,d=z.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),l[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var Y=/^(?:input|select|textarea)$/i,Z=/^key/,$=/^(?:mouse|contextmenu)|click/,_=/^(?:focusinfocus|focusoutblur)$/,ab=/^([^.]*)(?:\.(.+)|)$/;function bb(){return!0}function cb(){return!1}function db(){try{return z.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof n===L||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(F)||[""],h=b.length;while(h--)f=ab.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(F)||[""],j=b.length;while(j--)if(h=ab.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,m,o=[d||z],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||z,3!==d.nodeType&&8!==d.nodeType&&!_.test(p+n.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[n.expando]?b:new n.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),k=n.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!n.isWindow(d)){for(i=k.delegateType||p,_.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||z)&&o.push(l.defaultView||l.parentWindow||a)}m=0;while((h=o[m++])&&!b.isPropagationStopped())b.type=m>1?i:k.bindType||p,f=(n._data(h,"events")||{})[b.type]&&n._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&n.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&n.acceptData(d)&&g&&d[p]&&!n.isWindow(d)){l=d[g],l&&(d[g]=null),n.event.triggered=p;try{d[p]()}catch(r){}n.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((n.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?n(c,this).index(i)>=0:n.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[n.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=$.test(e)?this.mouseHooks:Z.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new n.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||z),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||z,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==db()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===db()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return n.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=n.extend(new n.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?n.event.trigger(e,null,b):n.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=z.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===L&&(a[d]=null),a.detachEvent(d,c))},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&(a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault())?bb:cb):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={isDefaultPrevented:cb,isPropagationStopped:cb,isImmediatePropagationStopped:cb,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=bb,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=bb,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=bb,this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),l.submitBubbles||(n.event.special.submit={setup:function(){return n.nodeName(this,"form")?!1:void n.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=n.nodeName(b,"input")||n.nodeName(b,"button")?b.form:void 0;c&&!n._data(c,"submitBubbles")&&(n.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),n._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&n.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return n.nodeName(this,"form")?!1:void n.event.remove(this,"._submit")}}),l.changeBubbles||(n.event.special.change={setup:function(){return Y.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(n.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),n.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),n.event.simulate("change",this,a,!0)})),!1):void n.event.add(this,"beforeactivate._change",function(a){var b=a.target;Y.test(b.nodeName)&&!n._data(b,"changeBubbles")&&(n.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||n.event.simulate("change",this.parentNode,a,!0)}),n._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return n.event.remove(this,"._change"),!Y.test(this.nodeName)}}),l.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a),!0)};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=n._data(d,b);e||d.addEventListener(a,c,!0),n._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=n._data(d,b)-1;e?n._data(d,b,e):(d.removeEventListener(a,c,!0),n._removeData(d,b))}}}),n.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=cb;else if(!d)return this;return 1===e&&(g=d,d=function(a){return n().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=n.guid++)),this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=cb),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});function eb(a){var b=fb.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var fb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gb=/ jQuery\d+="(?:null|\d+)"/g,hb=new RegExp("<(?:"+fb+")[\\s/>]","i"),ib=/^\s+/,jb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,kb=/<([\w:]+)/,lb=/<tbody/i,mb=/<|&#?\w+;/,nb=/<(?:script|style|link)/i,ob=/checked\s*(?:[^=]|=\s*.checked.)/i,pb=/^$|\/(?:java|ecma)script/i,qb=/^true\/(.*)/,rb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,sb={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:l.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},tb=eb(z),ub=tb.appendChild(z.createElement("div"));sb.optgroup=sb.option,sb.tbody=sb.tfoot=sb.colgroup=sb.caption=sb.thead,sb.th=sb.td;function vb(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==L?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==L?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,vb(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function wb(a){X.test(a.type)&&(a.defaultChecked=a.checked)}function xb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function yb(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function zb(a){var b=qb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ab(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}function Bb(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Cb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(yb(b).text=a.text,zb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&X.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}n.extend({clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!hb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ub.innerHTML=a.outerHTML,ub.removeChild(f=ub.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=vb(f),h=vb(a),g=0;null!=(e=h[g]);++g)d[g]&&Cb(e,d[g]);if(b)if(c)for(h=h||vb(a),d=d||vb(f),g=0;null!=(e=h[g]);g++)Bb(e,d[g]);else Bb(a,f);return d=vb(f,"script"),d.length>0&&Ab(d,!i&&vb(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k,m=a.length,o=eb(b),p=[],q=0;m>q;q++)if(f=a[q],f||0===f)if("object"===n.type(f))n.merge(p,f.nodeType?[f]:f);else if(mb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(kb.exec(f)||["",""])[1].toLowerCase(),k=sb[i]||sb._default,h.innerHTML=k[1]+f.replace(jb,"<$1></$2>")+k[2],e=k[0];while(e--)h=h.lastChild;if(!l.leadingWhitespace&&ib.test(f)&&p.push(b.createTextNode(ib.exec(f)[0])),!l.tbody){f="table"!==i||lb.test(f)?"<table>"!==k[1]||lb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)n.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}n.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),l.appendChecked||n.grep(vb(p,"input"),wb),q=0;while(f=p[q++])if((!d||-1===n.inArray(f,d))&&(g=n.contains(f.ownerDocument,f),h=vb(o.appendChild(f),"script"),g&&Ab(h),c)){e=0;while(f=h[e++])pb.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.deleteExpando,m=n.event.special;null!=(d=a[h]);h++)if((b||n.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k?delete d[i]:typeof d.removeAttribute!==L?d.removeAttribute(i):d[i]=null,c.push(f))}}}),n.fn.extend({text:function(a){return W(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||z).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(vb(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&Ab(vb(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(vb(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return W(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(gb,""):void 0;if(!("string"!=typeof a||nb.test(a)||!l.htmlSerialize&&hb.test(a)||!l.leadingWhitespace&&ib.test(a)||sb[(kb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(jb,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(vb(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(vb(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,k=this.length,m=this,o=k-1,p=a[0],q=n.isFunction(p);if(q||k>1&&"string"==typeof p&&!l.checkClone&&ob.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(k&&(i=n.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=n.map(vb(i,"script"),yb),f=g.length;k>j;j++)d=i,j!==o&&(d=n.clone(d,!0,!0),f&&n.merge(g,vb(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,n.map(g,zb),j=0;f>j;j++)d=g[j],pb.test(d.type||"")&&!n._data(d,"globalEval")&&n.contains(h,d)&&(d.src?n._evalUrl&&n._evalUrl(d.src):n.globalEval((d.text||d.textContent||d.innerHTML||"").replace(rb,"")));i=c=null}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],g=n(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Db,Eb={};function Fb(b,c){var d=n(c.createElement(b)).appendTo(c.body),e=a.getDefaultComputedStyle?a.getDefaultComputedStyle(d[0]).display:n.css(d[0],"display");return d.detach(),e}function Gb(a){var b=z,c=Eb[a];return c||(c=Fb(a,b),"none"!==c&&c||(Db=(Db||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Db[0].contentWindow||Db[0].contentDocument).document,b.write(),b.close(),c=Fb(a,b),Db.detach()),Eb[a]=c),c}!function(){var a,b,c=z.createElement("div"),d="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;padding:0;margin:0;border:0";c.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=c.getElementsByTagName("a")[0],a.style.cssText="float:left;opacity:.5",l.opacity=/^0.5/.test(a.style.opacity),l.cssFloat=!!a.style.cssFloat,c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===c.style.backgroundClip,a=c=null,l.shrinkWrapBlocks=function(){var a,c,e,f;if(null==b){if(a=z.getElementsByTagName("body")[0],!a)return;f="border:0;width:0;height:0;position:absolute;top:0;left:-9999px",c=z.createElement("div"),e=z.createElement("div"),a.appendChild(c).appendChild(e),b=!1,typeof e.style.zoom!==L&&(e.style.cssText=d+";width:1px;padding:1px;zoom:1",e.innerHTML="<div></div>",e.firstChild.style.width="5px",b=3!==e.offsetWidth),a.removeChild(c),a=c=e=null}return b}}();var Hb=/^margin/,Ib=new RegExp("^("+T+")(?!px)[a-z%]+$","i"),Jb,Kb,Lb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Jb=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)},Kb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Jb(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),Ib.test(g)&&Hb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):z.documentElement.currentStyle&&(Jb=function(a){return a.currentStyle},Kb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Jb(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Ib.test(g)&&!Lb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Mb(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h=z.createElement("div"),i="border:0;width:0;height:0;position:absolute;top:0;left:-9999px",j="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;padding:0;margin:0;border:0";h.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",b=h.getElementsByTagName("a")[0],b.style.cssText="float:left;opacity:.5",l.opacity=/^0.5/.test(b.style.opacity),l.cssFloat=!!b.style.cssFloat,h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===h.style.backgroundClip,b=h=null,n.extend(l,{reliableHiddenOffsets:function(){if(null!=c)return c;var a,b,d,e=z.createElement("div"),f=z.getElementsByTagName("body")[0];if(f)return e.setAttribute("className","t"),e.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=z.createElement("div"),a.style.cssText=i,f.appendChild(a).appendChild(e),e.innerHTML="<table><tr><td></td><td>t</td></tr></table>",b=e.getElementsByTagName("td"),b[0].style.cssText="padding:0;margin:0;border:0;display:none",d=0===b[0].offsetHeight,b[0].style.display="",b[1].style.display="none",c=d&&0===b[0].offsetHeight,f.removeChild(a),e=f=null,c},boxSizing:function(){return null==d&&k(),d},boxSizingReliable:function(){return null==e&&k(),e},pixelPosition:function(){return null==f&&k(),f},reliableMarginRight:function(){var b,c,d,e;if(null==g&&a.getComputedStyle){if(b=z.getElementsByTagName("body")[0],!b)return;c=z.createElement("div"),d=z.createElement("div"),c.style.cssText=i,b.appendChild(c).appendChild(d),e=d.appendChild(z.createElement("div")),e.style.cssText=d.style.cssText=j,e.style.marginRight=e.style.width="0",d.style.width="1px",g=!parseFloat((a.getComputedStyle(e,null)||{}).marginRight),b.removeChild(c)}return g}});function k(){var b,c,h=z.getElementsByTagName("body")[0];h&&(b=z.createElement("div"),c=z.createElement("div"),b.style.cssText=i,h.appendChild(b).appendChild(c),c.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;display:block;padding:1px;border:1px;width:4px;margin-top:1%;top:1%",n.swap(h,null!=h.style.zoom?{zoom:1}:{},function(){d=4===c.offsetWidth}),e=!0,f=!1,g=!0,a.getComputedStyle&&(f="1%"!==(a.getComputedStyle(c,null)||{}).top,e="4px"===(a.getComputedStyle(c,null)||{width:"4px"}).width),h.removeChild(b),c=h=null)}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Nb=/alpha\([^)]*\)/i,Ob=/opacity\s*=\s*([^)]*)/,Pb=/^(none|table(?!-c[ea]).+)/,Qb=new RegExp("^("+T+")(.*)$","i"),Rb=new RegExp("^([+-])=("+T+")","i"),Sb={position:"absolute",visibility:"hidden",display:"block"},Tb={letterSpacing:0,fontWeight:400},Ub=["Webkit","O","Moz","ms"];function Vb(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Ub.length;while(e--)if(b=Ub[e]+c,b in a)return b;return d}function Wb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=n._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&V(d)&&(f[g]=n._data(d,"olddisplay",Gb(d.nodeName)))):f[g]||(e=V(d),(c&&"none"!==c||!e)&&n._data(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Xb(a,b,c){var d=Qb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Yb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+U[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+U[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+U[f]+"Width",!0,e))):(g+=n.css(a,"padding"+U[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+U[f]+"Width",!0,e)));return g}function Zb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Jb(a),g=l.boxSizing()&&"border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Kb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Ib.test(e))return e;d=g&&(l.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Yb(a,b,c||(g?"border":"content"),d,f)+"px"}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Kb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":l.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;if(b=n.cssProps[h]||(n.cssProps[h]=Vb(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Rb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]="",i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Vb(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Kb(a,b,d)),"normal"===f&&b in Tb&&(f=Tb[b]),""===c||c?(e=parseFloat(f),c===!0||n.isNumeric(e)?e||0:f):f}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?0===a.offsetWidth&&Pb.test(n.css(a,"display"))?n.swap(a,Sb,function(){return Zb(a,b,d)}):Zb(a,b,d):void 0},set:function(a,c,d){var e=d&&Jb(a);return Xb(a,c,d?Yb(a,b,d,l.boxSizing()&&"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),l.opacity||(n.cssHooks.opacity={get:function(a,b){return Ob.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=n.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===n.trim(f.replace(Nb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Nb.test(f)?f.replace(Nb,e):f+" "+e)}}),n.cssHooks.marginRight=Mb(l.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},Kb,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+U[d]+b]=f[d]||f[d-2]||f[0];return e}},Hb.test(a)||(n.cssHooks[a+b].set=Xb)}),n.fn.extend({css:function(a,b){return W(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Jb(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)
4
+ },a,b,arguments.length>1)},show:function(){return Wb(this,!0)},hide:function(){return Wb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){V(this)?n(this).show():n(this).hide()})}});function $b(a,b,c,d,e){return new $b.prototype.init(a,b,c,d,e)}n.Tween=$b,$b.prototype={constructor:$b,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=$b.propHooks[this.prop];return a&&a.get?a.get(this):$b.propHooks._default.get(this)},run:function(a){var b,c=$b.propHooks[this.prop];return this.pos=b=this.options.duration?n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):$b.propHooks._default.set(this),this}},$b.prototype.init.prototype=$b.prototype,$b.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},$b.propHooks.scrollTop=$b.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=$b.prototype.init,n.fx.step={};var _b,ac,bc=/^(?:toggle|show|hide)$/,cc=new RegExp("^(?:([+-])=|)("+T+")([a-z%]*)$","i"),dc=/queueHooks$/,ec=[jc],fc={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=cc.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&cc.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function gc(){return setTimeout(function(){_b=void 0}),_b=n.now()}function hc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=U[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function ic(a,b,c){for(var d,e=(fc[b]||[]).concat(fc["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function jc(a,b,c){var d,e,f,g,h,i,j,k,m=this,o={},p=a.style,q=a.nodeType&&V(a),r=n._data(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,m.always(function(){m.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=n.css(a,"display"),k=Gb(a.nodeName),"none"===j&&(j=k),"inline"===j&&"none"===n.css(a,"float")&&(l.inlineBlockNeedsLayout&&"inline"!==k?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",l.shrinkWrapBlocks()||m.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],bc.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||n.style(a,d)}if(!n.isEmptyObject(o)){r?"hidden"in r&&(q=r.hidden):r=n._data(a,"fxshow",{}),f&&(r.hidden=!q),q?n(a).show():m.done(function(){n(a).hide()}),m.done(function(){var b;n._removeData(a,"fxshow");for(b in o)n.style(a,b,o[b])});for(d in o)g=ic(q?r[d]:0,d,m),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function kc(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function lc(a,b,c){var d,e,f=0,g=ec.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=_b||gc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:_b||gc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(kc(k,j.opts.specialEasing);g>f;f++)if(d=ec[f].call(j,a,k,j.opts))return d;return n.map(k,ic,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(lc,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],fc[c]=fc[c]||[],fc[c].unshift(b)},prefilter:function(a,b){b?ec.unshift(a):ec.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(V).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=lc(this,n.extend({},a),f);(e||n._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=n._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&dc.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=n._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(hc(b,!0),a,d,e)}}),n.each({slideDown:hc("show"),slideUp:hc("hide"),slideToggle:hc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=n.timers,c=0;for(_b=n.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||n.fx.stop(),_b=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){ac||(ac=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(ac),ac=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(a,b){return a=n.fx?n.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e=z.createElement("div");e.setAttribute("className","t"),e.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=e.getElementsByTagName("a")[0],c=z.createElement("select"),d=c.appendChild(z.createElement("option")),b=e.getElementsByTagName("input")[0],a.style.cssText="top:1px",l.getSetAttribute="t"!==e.className,l.style=/top/.test(a.getAttribute("style")),l.hrefNormalized="/a"===a.getAttribute("href"),l.checkOn=!!b.value,l.optSelected=d.selected,l.enctype=!!z.createElement("form").enctype,c.disabled=!0,l.optDisabled=!d.disabled,b=z.createElement("input"),b.setAttribute("value",""),l.input=""===b.getAttribute("value"),b.value="t",b.setAttribute("type","radio"),l.radioValue="t"===b.value,a=b=c=d=e=null}();var mc=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(mc,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.text(a)}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(l.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)if(d=e[g],n.inArray(n.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var nc,oc,pc=n.expr.attrHandle,qc=/^(?:checked|selected)$/i,rc=l.getSetAttribute,sc=l.input;n.fn.extend({attr:function(a,b){return W(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===L?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?oc:nc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(F);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)?sc&&rc||!qc.test(c)?a[d]=!1:a[n.camelCase("default-"+c)]=a[d]=!1:n.attr(a,c,""),a.removeAttribute(rc?c:d)},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),oc={set:function(a,b,c){return b===!1?n.removeAttr(a,c):sc&&rc||!qc.test(c)?a.setAttribute(!rc&&n.propFix[c]||c,c):a[n.camelCase("default-"+c)]=a[c]=!0,c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=pc[b]||n.find.attr;pc[b]=sc&&rc||!qc.test(b)?function(a,b,d){var e,f;return d||(f=pc[b],pc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,pc[b]=f),e}:function(a,b,c){return c?void 0:a[n.camelCase("default-"+b)]?b.toLowerCase():null}}),sc&&rc||(n.attrHooks.value={set:function(a,b,c){return n.nodeName(a,"input")?void(a.defaultValue=b):nc&&nc.set(a,b,c)}}),rc||(nc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},pc.id=pc.name=pc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},n.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:nc.set},n.attrHooks.contenteditable={set:function(a,b,c){nc.set(a,""===b?!1:b,c)}},n.each(["width","height"],function(a,b){n.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),l.style||(n.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var tc=/^(?:input|select|textarea|button|object)$/i,uc=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return W(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return a=n.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):tc.test(a.nodeName)||uc.test(a.nodeName)&&a.href?0:-1}}}}),l.hrefNormalized||n.each(["href","src"],function(a,b){n.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this}),l.enctype||(n.propFix.enctype="encoding");var vc=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(F)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(vc," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(F)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(vc," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(F)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===L||"boolean"===c)&&(this.className&&n._data(this,"__className__",this.className),this.className=this.className||a===!1?"":n._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(vc," ").indexOf(b)>=0)return!0;return!1}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var wc=n.now(),xc=/\?/,yc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;n.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=n.trim(b+"");return e&&!n.trim(e.replace(yc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():n.error("Invalid JSON: "+b)},n.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var zc,Ac,Bc=/#.*$/,Cc=/([?&])_=[^&]*/,Dc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Ec=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Fc=/^(?:GET|HEAD)$/,Gc=/^\/\//,Hc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Ic={},Jc={},Kc="*/".concat("*");try{Ac=location.href}catch(Lc){Ac=z.createElement("a"),Ac.href="",Ac=Ac.href}zc=Hc.exec(Ac.toLowerCase())||[];function Mc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(F)||[];if(n.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Nc(a,b,c,d){var e={},f=a===Jc;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Oc(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&n.extend(!0,a,c),a}function Pc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Qc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ac,type:"GET",isLocal:Ec.test(zc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Kc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Oc(Oc(a,n.ajaxSettings),b):Oc(n.ajaxSettings,a)},ajaxPrefilter:Mc(Ic),ajaxTransport:Mc(Jc),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Dc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||Ac)+"").replace(Bc,"").replace(Gc,zc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(F)||[""],null==k.crossDomain&&(c=Hc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===zc[1]&&c[2]===zc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(zc[3]||("http:"===zc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),Nc(Ic,k,b,v),2===t)return v;h=k.global,h&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Fc.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(xc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Cc.test(e)?e.replace(Cc,"$1_="+wc++):e+(xc.test(e)?"&":"?")+"_="+wc++)),k.ifModified&&(n.lastModified[e]&&v.setRequestHeader("If-Modified-Since",n.lastModified[e]),n.etag[e]&&v.setRequestHeader("If-None-Match",n.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Kc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Nc(Jc,k,b,v)){v.readyState=1,h&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Pc(k,v,c)),u=Qc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(n.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){if(n.isFunction(a))return this.each(function(b){n(this).wrapAll(a.call(this,b))});if(this[0]){var b=n(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!l.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||n.css(a,"display"))},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var Rc=/%20/g,Sc=/\[\]$/,Tc=/\r?\n/g,Uc=/^(?:submit|button|image|reset|file)$/i,Vc=/^(?:input|select|textarea|keygen)/i;function Wc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||Sc.test(a)?d(a,e):Wc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Wc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Wc(c,a[c],b,e);return d.join("&").replace(Rc,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Vc.test(this.nodeName)&&!Uc.test(a)&&(this.checked||!X.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(Tc,"\r\n")}}):{name:b.name,value:c.replace(Tc,"\r\n")}}).get()}}),n.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&$c()||_c()}:$c;var Xc=0,Yc={},Zc=n.ajaxSettings.xhr();a.ActiveXObject&&n(a).on("unload",function(){for(var a in Yc)Yc[a](void 0,!0)}),l.cors=!!Zc&&"withCredentials"in Zc,Zc=l.ajax=!!Zc,Zc&&n.ajaxTransport(function(a){if(!a.crossDomain||l.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Xc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Yc[g],b=void 0,f.onreadystatechange=n.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Yc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function $c(){try{return new a.XMLHttpRequest}catch(b){}}function _c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=z.head||n("head")[0]||z.documentElement;return{send:function(d,e){b=z.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var ad=[],bd=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=ad.pop()||n.expando+"_"+wc++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(bd.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&bd.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(bd,"$1"+e):b.jsonp!==!1&&(b.url+=(xc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,ad.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||z;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var cd=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&cd)return cd.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=a.slice(h,a.length),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&n.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var dd=a.document.documentElement;function ed(a){return n.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&n.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,n.contains(b,e)?(typeof e.getBoundingClientRect!==L&&(d=e.getBoundingClientRect()),c=ed(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===n.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(c=a.offset()),c.top+=n.css(a[0],"borderTopWidth",!0),c.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-n.css(d,"marginTop",!0),left:b.left-c.left-n.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||dd;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||dd})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);n.fn[a]=function(d){return W(this,function(a,d,e){var f=ed(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?n(f).scrollLeft():e,c?e:n(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Mb(l.pixelPosition,function(a,c){return c?(c=Kb(a,b),Ib.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return W(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var fd=a.jQuery,gd=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=gd),b&&a.jQuery===n&&(a.jQuery=fd),n},typeof b===L&&(a.jQuery=a.$=n),n});
lib/lib.ajax.php CHANGED
@@ -1,10 +1,12 @@
1
  <?php
2
  add_action('wp_ajax_yks_mailchimp_form', 'ykseme_ajaxActions');
3
  add_action('wp_ajax_nopriv_yks_mailchimp_form', 'ykseme_ajaxActions');
 
4
  function ykseme_ajaxActions()
5
  {
6
- global $yksemeBase;
7
- require_once YKSEME_PATH.'process/ajax.php';
8
- exit;
9
  }
 
10
  ?>
1
  <?php
2
  add_action('wp_ajax_yks_mailchimp_form', 'ykseme_ajaxActions');
3
  add_action('wp_ajax_nopriv_yks_mailchimp_form', 'ykseme_ajaxActions');
4
+
5
  function ykseme_ajaxActions()
6
  {
7
+ global $yksemeBase;
8
+ require_once YKSEME_PATH.'process/ajax.php';
9
+ exit;
10
  }
11
+
12
  ?>
pages/lists.php CHANGED
@@ -38,7 +38,12 @@
38
  {
39
  alert('Oops.. The list ID you entered appears to be incorrect.');
40
  }
41
- }
 
 
 
 
 
42
  });
43
  }
44
 
@@ -99,6 +104,8 @@
99
  }
100
  noListsCheck();
101
  initializeScrollableLists();
 
 
102
  $('#yks-lists-dropdown').submit(function(e) {
103
  e.preventDefault();
104
  var lid = $("select#yks-list-select option:selected").val();
@@ -109,10 +116,9 @@
109
  $('#yks-submit-list-add').attr("disabled", true);
110
  $("select#yks-list-select option[value='']").prop('selected',true);
111
  $("select#yks-list-select option[value='" + lid + "']").remove();
112
- setInterval(function()
113
- {
114
- $('#yks-submit-list-add').removeAttr("disabled");
115
- },3000);
116
  }
117
  else
118
  {
@@ -124,6 +130,7 @@
124
  $('.yks-mailchimp-list-update').live('click', function(e){
125
  var i = $(this).attr('rel');
126
  var f = '#yks-mailchimp-form_'+i;
 
127
  $.ajax({
128
  type: 'POST',
129
  url: ajaxurl,
@@ -141,7 +148,7 @@
141
  }
142
  else
143
  {
144
-
145
  }
146
  }
147
  });
@@ -167,7 +174,9 @@
167
  {
168
  if(MAILCHIMP == '1')
169
  {
170
- $('#yks-list-container_'+i).remove();
 
 
171
  noListsCheck();
172
  scrollToElement($('#yks-list-wrapper'));
173
  }
@@ -244,9 +253,19 @@
244
  Easy Mailchimp Forms by YIKES, Inc.
245
  </h2>
246
  <?php if (!$this->optionVal['api-key']) { ?>
247
- <p>
248
- Before you can add MailChimp forms to your site, you need to <a href="admin.php?page=yks-mailchimp-form" class="yks-mailchimp-list-add">go to the MailChimp Settings page</a> and add your API Key.
249
- </p>
 
 
 
 
 
 
 
 
 
 
250
  <?php } else { //end if statement if no api key ?>
251
  <h3>Add Forms</h3>
252
  <form id="yks-lists-dropdown" name="yks-lists-dropdown">
38
  {
39
  alert('Oops.. The list ID you entered appears to be incorrect.');
40
  }
41
+ },
42
+ error: function(MAILCHIMP) {
43
+ alert('There was an error!');
44
+ var mailChimpError = $(MAILCHIMP);
45
+ console.log(mailChimpError);
46
+ }
47
  });
48
  }
49
 
104
  }
105
  noListsCheck();
106
  initializeScrollableLists();
107
+ // lists page form submission
108
+ // ajax retreive all lists from user MC account
109
  $('#yks-lists-dropdown').submit(function(e) {
110
  e.preventDefault();
111
  var lid = $("select#yks-list-select option:selected").val();
116
  $('#yks-submit-list-add').attr("disabled", true);
117
  $("select#yks-list-select option[value='']").prop('selected',true);
118
  $("select#yks-list-select option[value='" + lid + "']").remove();
119
+ setInterval(function() {
120
+ $('#yks-submit-list-add').removeAttr("disabled");
121
+ },3000);
 
122
  }
123
  else
124
  {
130
  $('.yks-mailchimp-list-update').live('click', function(e){
131
  var i = $(this).attr('rel');
132
  var f = '#yks-mailchimp-form_'+i;
133
+ var theButton = $(this);
134
  $.ajax({
135
  type: 'POST',
136
  url: ajaxurl,
148
  }
149
  else
150
  {
151
+ theButton.parents('.yks-list-container').find('.yks-status').slideDown().delay(3000).fadeOut();
152
  }
153
  }
154
  });
174
  {
175
  if(MAILCHIMP == '1')
176
  {
177
+ $('#yks-list-container_'+i).fadeOut('fast',function() {
178
+ $(this).remove();
179
+ });
180
  noListsCheck();
181
  scrollToElement($('#yks-list-wrapper'));
182
  }
253
  Easy Mailchimp Forms by YIKES, Inc.
254
  </h2>
255
  <?php if (!$this->optionVal['api-key']) { ?>
256
+ <div class="error">
257
+ <p>
258
+ Before you can add MailChimp forms to your site, you need to <a href="admin.php?page=yks-mailchimp-form" class="yks-mailchimp-list-add">go to the MailChimp Settings page</a> and add your API Key.
259
+ </p>
260
+ </div>
261
+ <?php } else if ( get_option('api_validation') == 'invalid_api_key' ) { ?>
262
+ <p>
263
+ <div class="error">
264
+ <p>
265
+ You must enter a valid API key to import and manage your lists.
266
+ </p>
267
+ </div>
268
+ </p>
269
  <?php } else { //end if statement if no api key ?>
270
  <h3>Add Forms</h3>
271
  <form id="yks-lists-dropdown" name="yks-lists-dropdown">
pages/options.php CHANGED
@@ -1,4 +1,3 @@
1
-
2
  <script type="text/javascript">
3
  jQuery(document).ready(function ($) {
4
  function blankFieldCheck() {
@@ -14,6 +13,7 @@ jQuery(document).ready(function ($) {
14
  }
15
  return (err > 0 ? false : true);
16
  }
 
17
  $('#yks-mailchimp-form').submit(function (e) {
18
  e.preventDefault();
19
  // Make sure the api key exists
@@ -30,23 +30,95 @@ jQuery(document).ready(function ($) {
30
  dataType: 'json',
31
  success: function (MAILCHIMP) {
32
  if (MAILCHIMP == '1') {
33
- $('#yks-status').html('<div class="yks-success"><p>The options were saved successfully!</p></div>');
34
  $('#yks-status').slideDown('fast');
35
  } else {
36
- $('#yks-status').html('<div class="yks-error"><p>The options could not be saved (or you did not change them).</p></div>');
37
  $('#yks-status').slideDown('fast');
38
  }
39
  }
40
  });
41
  }
42
  return false;
43
- })
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  });
45
  </script>
46
 
47
  <div class="wrap">
48
-
49
- <div id="ykseme-icon" class="icon32"></div>
50
 
51
  <h2 id="ykseme-page-header">
52
  Easy Mailchimp Forms by YIKES, Inc.
@@ -63,7 +135,8 @@ jQuery(document).ready(function ($) {
63
 
64
  <tr valign="top">
65
  <th scope="row"><label for="yks-mailchimp-api-key">Your Mailchimp API Key</label></th>
66
- <td><input name="yks-mailchimp-api-key" type="text" id="yks-mailchimp-api-key" value="<?php echo $this->optionVal['api-key']; ?>" class="regular-text" /></td>
 
67
  </tr>
68
 
69
  <tr>
@@ -107,7 +180,7 @@ jQuery(document).ready(function ($) {
107
 
108
  <tr>
109
  <td></td>
110
- <td><input type="submit" name="submit" id="submit" class="button-primary" value="Save Settings"></td>
111
  </tr>
112
  </tbody>
113
  </table>
 
1
  <script type="text/javascript">
2
  jQuery(document).ready(function ($) {
3
  function blankFieldCheck() {
13
  }
14
  return (err > 0 ? false : true);
15
  }
16
+
17
  $('#yks-mailchimp-form').submit(function (e) {
18
  e.preventDefault();
19
  // Make sure the api key exists
30
  dataType: 'json',
31
  success: function (MAILCHIMP) {
32
  if (MAILCHIMP == '1') {
33
+ $('#yks-status').html('<div class="updated"><p>The options were saved successfully!</p></div>');
34
  $('#yks-status').slideDown('fast');
35
  } else {
36
+ $('#yks-status').html('<div class="error"><p>The options could not be saved (or you did not change them).</p></div>');
37
  $('#yks-status').slideDown('fast');
38
  }
39
  }
40
  });
41
  }
42
  return false;
43
+ });
44
+
45
+ /******************* Validate MailChimp API Key ****************************/
46
+ function yikes_mc_api_key_validate() {
47
+ jQuery('#submit').attr('disabled', 'disabled');
48
+ jQuery('.mailChimp_api_key_validation_message').hide();
49
+ // delay the function incase the user has deleted their API key
50
+ setTimeout(function() {
51
+
52
+ var thisLength = jQuery('#yks-mailchimp-api-key').val().length;
53
+
54
+ // mailchimp api key is 36 characters, could be more. Usually not less.
55
+ // checking the api key at 30 characters, maybe older api keys contain less characters
56
+ if (thisLength >= 1) {
57
+ // store Mail Chimp API Key
58
+ var apiKey = jQuery('#yks-mailchimp-api-key').val();
59
+ // store datacenter value, from end of api key
60
+ var dataCenter = apiKey.substr(apiKey.indexOf("-") + 1);
61
+
62
+ if ( jQuery('.mailChimp_api_key_preloader').is(":visible")) {
63
+ //
64
+ } else {
65
+ jQuery('.mailChimp_api_key_preloader').fadeIn();
66
+ }
67
+ // post the data to our api key validation function inside of lib.ajax.php
68
+ jQuery.ajax({
69
+ type: 'POST',
70
+ url: ajaxurl,
71
+ data: {
72
+ action: 'yks_mailchimp_form',
73
+ form_action: 'validate_api_key',
74
+ api_key: apiKey,
75
+ data_center: dataCenter
76
+ },
77
+ success: function(response) {
78
+ if(response.indexOf('Everything\'s Chimpy!') > -1) {
79
+ jQuery('.mailChimp_api_key_preloader').fadeOut('fast', function() {
80
+ jQuery('.mailChimp_api_key_validation_message').html('<img src="<?php echo plugins_url().'/yikes-inc-easy-mailchimp-extender/images/yikes-mc-checkmark.png'; ?>" alt=message > Valid API Key').css("color", "green").fadeIn();
81
+ jQuery('#submit').removeAttr('disabled');
82
+ });
83
+ } else if (response.indexOf('Invalid Mailchimp API Key') > -1) {
84
+ jQuery('.mailChimp_api_key_preloader').fadeOut('fast', function() {
85
+ jQuery('.mailChimp_api_key_validation_message').html('<img src="<?php echo plugins_url().'/yikes-inc-easy-mailchimp-extender/images/yikes-mc-error-icon.png'; ?>" alt=message > Sorry, that is an invalid MailChimp API key.').css("color", "red").fadeIn();
86
+ });
87
+ } else {
88
+ jQuery('.mailChimp_api_key_preloader').fadeOut('fast', function() {
89
+ jQuery('.mailChimp_api_key_validation_message').html('<img src="<?php echo plugins_url().'/yikes-inc-easy-mailchimp-extender/images/yikes-mc-error-icon.png'; ?>" alt=message > Sorry, that is an invalid MailChimp API key.').css("color", "red").fadeIn();
90
+ });
91
+ };
92
+ },
93
+ error: function(response) {
94
+ // alert('There was an error processing your request...');
95
+ }
96
+ });
97
+ } else {
98
+ jQuery('.mailChimp_api_key_preloader').fadeOut('fast', function() {
99
+ jQuery('.mailChimp_api_key_validation_message').html('<img src="<?php echo plugins_url().'/yikes-inc-easy-mailchimp-extender/images/yikes-mc-error-icon.png'; ?>" alt=message > Error: Please enter a valid Mail Chimp API Key.').css("color", "red").fadeIn();
100
+ });
101
+ }
102
+ }, 1);
103
+
104
+
105
+
106
+ }
107
+
108
+ // run the validation on keyup
109
+ jQuery('#yks-mailchimp-api-key').keyup(function() {
110
+ stop();
111
+ yikes_mc_api_key_validate();
112
+ });
113
+
114
+ // check the key on page load
115
+ yikes_mc_api_key_validate();
116
+
117
  });
118
  </script>
119
 
120
  <div class="wrap">
121
+ <div id="ykseme-icon" class="icon32"></div>
 
122
 
123
  <h2 id="ykseme-page-header">
124
  Easy Mailchimp Forms by YIKES, Inc.
135
 
136
  <tr valign="top">
137
  <th scope="row"><label for="yks-mailchimp-api-key">Your Mailchimp API Key</label></th>
138
+ <td><input name="yks-mailchimp-api-key" type="text" id="yks-mailchimp-api-key" value="<?php echo $this->optionVal['api-key']; ?>" class="regular-text" /><span class="mailChimp_api_key_validation_message"></span><img class="mailChimp_api_key_preloader" src="<?php echo admin_url().'/images/wpspin_light.gif'; ?>" alt="preloader" ><span class="mailChimp_api_key_validation"></span>
139
+ </td>
140
  </tr>
141
 
142
  <tr>
180
 
181
  <tr>
182
  <td></td>
183
+ <td><input type="submit" name="submit" id="submit" class="button-primary" value="Save Settings" disabled="disabled"></td>
184
  </tr>
185
  </tbody>
186
  </table>
process/ajax.php CHANGED
@@ -84,6 +84,10 @@ case 'notice_hide':
84
  echo '1';
85
  break;
86
 
 
 
 
 
87
 
88
 
89
  }
84
  echo '1';
85
  break;
86
 
87
+ case 'validate_api_key':
88
+ $validate_action = $yksemeBase->validateAPIkeySettings($_POST);
89
+ break;
90
+
91
 
92
 
93
  }
readme.md CHANGED
@@ -51,6 +51,10 @@ Due to the code overhaul required for new version features, the structure we wer
51
 
52
  Changes
53
  ===========
 
 
 
 
54
  ### 2.2.1
55
  * Bugfix make sure label matches ID
56
 
51
 
52
  Changes
53
  ===========
54
+ ### 3.0
55
+ * Update MailChimp API to v2.0
56
+ * Added API Validation Check on settings page
57
+
58
  ### 2.2.1
59
  * Bugfix make sure label matches ID
60
 
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Easy MailChimp Forms ===
2
- Contributors: yikesinc, hiwhatsup, liljimmi, seriouslysean
3
  Donate link: http://yikesinc.com
4
  Tags: mailchimp, marketing, email, mailing lists, newsletter, signup, forms, signup form
5
  Requires at least: 3.0
6
- Tested up to: 3.7
7
- Stable tag: 2.2.1
8
 
9
  Easy MailChimp Forms allows you to painlessly add MailChimp signup forms to your WordPress site.
10
 
@@ -64,6 +64,10 @@ Due to the code overhaul required for the features of the new version, the struc
64
  5. Form displays on the site front-end
65
 
66
  == Changelog ==
 
 
 
 
67
  = 2.2.1 =
68
  * Bugfix make sure label matches ID
69
 
@@ -128,6 +132,9 @@ Due to the code overhaul required for the features of the new version, the struc
128
  * Initial Release
129
 
130
  == Upgrade Notice ==
 
 
 
131
 
132
  = 2.2.0 =
133
  * Added support for multiples of the same list
@@ -149,4 +156,4 @@ Due to the code overhaul required for the features of the new version, the struc
149
  * Custom merge vars allows more customized field configuration
150
 
151
  = 1.2.0 =
152
- * First Name and Last Name fields are no longer required
1
  === Easy MailChimp Forms ===
2
+ Contributors: yikesinc, hiwhatsup, liljimmi, eherman24, seriouslysean
3
  Donate link: http://yikesinc.com
4
  Tags: mailchimp, marketing, email, mailing lists, newsletter, signup, forms, signup form
5
  Requires at least: 3.0
6
+ Tested up to: 3.8.1
7
+ Stable tag: 3.0
8
 
9
  Easy MailChimp Forms allows you to painlessly add MailChimp signup forms to your WordPress site.
10
 
64
  5. Form displays on the site front-end
65
 
66
  == Changelog ==
67
+ = 3.0 =
68
+ * Update Mail Chimp API to v2.0
69
+ * Added API Key Validation Check on settings page
70
+
71
  = 2.2.1 =
72
  * Bugfix make sure label matches ID
73
 
132
  * Initial Release
133
 
134
  == Upgrade Notice ==
135
+ = 3.0 =
136
+ * Update Mail Chimp API to v2.0
137
+ * Added API Key Validation Check
138
 
139
  = 2.2.0 =
140
  * Added support for multiples of the same list
156
  * Custom merge vars allows more customized field configuration
157
 
158
  = 1.2.0 =
159
+ * First Name and Last Name fields are no longer required
yikes-inc-easy-mailchimp-extender.php CHANGED
@@ -4,13 +4,13 @@
4
  Plugin Name: Easy MailChimp Forms
5
  Plugin URI: http://www.yikesinc.com/services/yikes-inc-easy-mailchimp-extender/
6
  Description: Mailchimp API integration in the form of a shortcode or php snippet
7
- Version: 2.2.1
8
  Author: YIKES Inc
9
  Author URI: http://yikesinc.com
10
  License: GPL2
11
 
12
  #_________________________________________________ LICENSE
13
- Copyright 2012-13 YIKES, Inc (email : tech@yikesinc.com)
14
 
15
  This program is free software; you can redistribute it and/or modify
16
  it under the terms of the GNU General Public License, version 2, as
@@ -29,7 +29,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29
  #_________________________________________________ CONSTANTS
30
  /** Configuration **/
31
  if(!defined('YKSEME_DEBUG')) define('YKSEME_DEBUG', true);
32
- if(!defined('YKSEME_VERSION_CURRENT')) define('YKSEME_VERSION_CURRENT', '2.2.1');
33
  if(!defined('YKSEME_REQ_PHP')) define('YKSEME_REQ_PHP', '5.0');
34
  if(!defined('YKSEME_AUTHOR')) define('YKSEME_AUTHOR', 'YIKES Inc');
35
  if(!defined('YKSEME_SITE')) define('YKSEME_SITE', site_url().'/');
@@ -38,24 +38,34 @@ if(!defined('YKSEME_PATH')) define('YKSEME_PATH', ABSPATH.'wp-content/p
38
  if(!defined('YKSEME_URL')) define('YKSEME_URL', plugins_url('yikes-inc-easy-mailchimp-extender/'));
39
  if(!defined('YKSEME_URL_WP')) define('YKSEME_URL_WP', get_bloginfo('url'));
40
  if(!defined('YKSEME_URL_WP_ADM')) define('YKSEME_URL_WP_ADM', YKSEME_URL_WP.'/wp-admin/');
41
- if(!defined('YKSEME_URL_WP_AJAX')) define('YKSEME_URL_WP_AJAX', admin_url('admin-ajax.php'));
42
- if(!defined('YKSEME_URL_CURRENT')) define('YKSEME_URL_CURRENT', $_SERVER['REQUEST_URI']);
43
-
44
  /** Database Tables **/
45
  if(!defined('YKSEME_OPTION')) define('YKSEME_OPTION', YKSEME_PREFIX.'storage');
 
 
 
 
 
 
 
 
 
 
 
46
 
47
  /** Initial Configuration **/
48
  if(YKSEME_DEBUG) error_reporting(E_ALL ^ E_NOTICE);
49
 
50
  /** Include Required Plugin Files **/
51
  require_once YKSEME_PATH.'classes/class.yksemeBase.php';
52
- require_once YKSEME_PATH.'classes/MCAPI.class.php';
53
  require_once YKSEME_PATH.'lib/lib.ajax.php';
54
  require_once YKSEME_PATH.'lib/lib.func.php';
55
 
 
56
  /** Initialize the plugin's base class **/
57
  $yksemeBase = new yksemeBase();
58
 
 
59
  /** Activation Hooks **/
60
  register_activation_hook(__FILE__, array(&$yksemeBase, 'activate'));
61
  register_deactivation_hook(__FILE__, array(&$yksemeBase, 'deactivate'));
@@ -67,5 +77,5 @@ add_action('wp_head','yikes_mailch_jquery_js');
67
 
68
  function yikes_mailch_jquery_js() {?>
69
  <script type="ext/javascript" src="<?php echo YKSEME_URL; ?>js/prototype.js"></script>
70
-
71
  <?php } ?>
4
  Plugin Name: Easy MailChimp Forms
5
  Plugin URI: http://www.yikesinc.com/services/yikes-inc-easy-mailchimp-extender/
6
  Description: Mailchimp API integration in the form of a shortcode or php snippet
7
+ Version: 3.0
8
  Author: YIKES Inc
9
  Author URI: http://yikesinc.com
10
  License: GPL2
11
 
12
  #_________________________________________________ LICENSE
13
+ Copyright 2012-14 YIKES, Inc (email : tech@yikesinc.com)
14
 
15
  This program is free software; you can redistribute it and/or modify
16
  it under the terms of the GNU General Public License, version 2, as
29
  #_________________________________________________ CONSTANTS
30
  /** Configuration **/
31
  if(!defined('YKSEME_DEBUG')) define('YKSEME_DEBUG', true);
32
+ if(!defined('YKSEME_VERSION_CURRENT')) define('YKSEME_VERSION_CURRENT', '3.0');
33
  if(!defined('YKSEME_REQ_PHP')) define('YKSEME_REQ_PHP', '5.0');
34
  if(!defined('YKSEME_AUTHOR')) define('YKSEME_AUTHOR', 'YIKES Inc');
35
  if(!defined('YKSEME_SITE')) define('YKSEME_SITE', site_url().'/');
38
  if(!defined('YKSEME_URL')) define('YKSEME_URL', plugins_url('yikes-inc-easy-mailchimp-extender/'));
39
  if(!defined('YKSEME_URL_WP')) define('YKSEME_URL_WP', get_bloginfo('url'));
40
  if(!defined('YKSEME_URL_WP_ADM')) define('YKSEME_URL_WP_ADM', YKSEME_URL_WP.'/wp-admin/');
 
 
 
41
  /** Database Tables **/
42
  if(!defined('YKSEME_OPTION')) define('YKSEME_OPTION', YKSEME_PREFIX.'storage');
43
+ // Conditional check for SSL enabled site
44
+ if(!defined('YKSEME_URL_WP_AJAX')) {
45
+ if ($_SERVER['SERVER_PORT'] == 80)
46
+ define('YKSEME_URL_WP_AJAX', admin_url('admin-ajax.php', 'http'));
47
+ else if ($_SERVER['SERVER_PORT'] == 443)
48
+ define('YKSEME_URL_WP_AJAX', admin_url('admin-ajax.php', 'https'));
49
+ else
50
+ define('YKSEME_URL_WP_AJAX', admin_url('admin-ajax.php'));
51
+ }
52
+ if(!defined('YKSEME_URL_CURRENT')) define('YKSEME_URL_CURRENT', $_SERVER['REQUEST_URI']);
53
+
54
 
55
  /** Initial Configuration **/
56
  if(YKSEME_DEBUG) error_reporting(E_ALL ^ E_NOTICE);
57
 
58
  /** Include Required Plugin Files **/
59
  require_once YKSEME_PATH.'classes/class.yksemeBase.php';
60
+ require_once YKSEME_PATH.'classes/MCAPI_2.0.class.php';
61
  require_once YKSEME_PATH.'lib/lib.ajax.php';
62
  require_once YKSEME_PATH.'lib/lib.func.php';
63
 
64
+
65
  /** Initialize the plugin's base class **/
66
  $yksemeBase = new yksemeBase();
67
 
68
+
69
  /** Activation Hooks **/
70
  register_activation_hook(__FILE__, array(&$yksemeBase, 'activate'));
71
  register_deactivation_hook(__FILE__, array(&$yksemeBase, 'deactivate'));
77
 
78
  function yikes_mailch_jquery_js() {?>
79
  <script type="ext/javascript" src="<?php echo YKSEME_URL; ?>js/prototype.js"></script>
80
+
81
  <?php } ?>