Poll, Survey, Quiz, Slideshow, Form, Story & Landing Page - Version 12.7.0

Version Description

N/A

Download this release

Release Info

Developer yoffegil
Plugin Icon 128x128 Poll, Survey, Quiz, Slideshow, Form, Story & Landing Page
Version 12.7.0
Comparing to
See all releases

Code changes from version 12.6.0 to 12.7.0

opinionstage-ajax-functions.php CHANGED
@@ -3,18 +3,19 @@
3
  add_action( 'wp_ajax_opinionstage_ajax_toggle_flyout', 'opinionstage_ajax_toggle_flyout');
4
  add_action( 'wp_ajax_opinionstage_ajax_toggle_article_placement', 'opinionstage_ajax_toggle_article_placement');
5
  add_action( 'wp_ajax_opinionstage_ajax_toggle_sidebar_placement', 'opinionstage_ajax_toggle_sidebar_placement');
6
-
7
- function opinionstage_ajax_toggle_flyout() {
8
  $os_options = (array) get_option(OPINIONSTAGE_OPTIONS_KEY);
9
  $os_options['fly_out_active'] = $_POST['activate'];
10
  update_option(OPINIONSTAGE_OPTIONS_KEY, $os_options);
11
  }
12
-
13
  function opinionstage_ajax_toggle_article_placement() {
14
  $os_options = (array) get_option(OPINIONSTAGE_OPTIONS_KEY);
15
  $os_options['article_placement_active'] = $_POST['activate'];
16
  update_option(OPINIONSTAGE_OPTIONS_KEY, $os_options);
17
  }
 
18
  function opinionstage_ajax_toggle_sidebar_placement() {
19
  $os_options = (array) get_option(OPINIONSTAGE_OPTIONS_KEY);
20
  $os_options['sidebar_placement_active'] = $_POST['activate'];
3
  add_action( 'wp_ajax_opinionstage_ajax_toggle_flyout', 'opinionstage_ajax_toggle_flyout');
4
  add_action( 'wp_ajax_opinionstage_ajax_toggle_article_placement', 'opinionstage_ajax_toggle_article_placement');
5
  add_action( 'wp_ajax_opinionstage_ajax_toggle_sidebar_placement', 'opinionstage_ajax_toggle_sidebar_placement');
6
+ // Toggle the flyout placement activation flag
7
+ function opinionstage_ajax_toggle_flyout() {
8
  $os_options = (array) get_option(OPINIONSTAGE_OPTIONS_KEY);
9
  $os_options['fly_out_active'] = $_POST['activate'];
10
  update_option(OPINIONSTAGE_OPTIONS_KEY, $os_options);
11
  }
12
+ // Toggle the article placement activation flag
13
  function opinionstage_ajax_toggle_article_placement() {
14
  $os_options = (array) get_option(OPINIONSTAGE_OPTIONS_KEY);
15
  $os_options['article_placement_active'] = $_POST['activate'];
16
  update_option(OPINIONSTAGE_OPTIONS_KEY, $os_options);
17
  }
18
+ // Toggle the sidebar placement activation flag
19
  function opinionstage_ajax_toggle_sidebar_placement() {
20
  $os_options = (array) get_option(OPINIONSTAGE_OPTIONS_KEY);
21
  $os_options['sidebar_placement_active'] = $_POST['activate'];
opinionstage-article-placement-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  static function initialize() {
4
  add_filter($hook = 'the_content', array(__CLASS__, $hook));
5
  }
6
-
7
  static function the_content($content) {
8
  global $post;
9
  $type = $post->post_type;
3
  static function initialize() {
4
  add_filter($hook = 'the_content', array(__CLASS__, $hook));
5
  }
6
+ // Adds the article placement shortcode to each post
7
  static function the_content($content) {
8
  global $post;
9
  $type = $post->post_type;
opinionstage-functions.php CHANGED
@@ -5,23 +5,23 @@
5
  * Initialize the plugin
6
  */
7
  function opinionstage_init() {
8
- opinionstage_initialize_data();
9
- register_uninstall_hook(OPINIONSTAGE_WIDGET_UNIQUE_LOCATION, 'opinionstage_uninstall');
10
  }
11
 
12
  /**
13
  * Initialiaze the data options
14
  */
15
  function opinionstage_initialize_data() {
16
- $os_options = (array) get_option(OPINIONSTAGE_OPTIONS_KEY);
17
- $os_options['version'] = OPINIONSTAGE_WIDGET_VERSION;
18
 
19
  // For backward compatibility
20
  if (!isset($os_options['sidebar_placement_active'])) {
21
- $os_options['sidebar_placement_active'] = 'false';
22
  }
23
 
24
- update_option(OPINIONSTAGE_OPTIONS_KEY, $os_options);
25
  }
26
 
27
  /**
@@ -72,7 +72,7 @@ function opinionstage_add_poll_page() {
72
  opinionstage_add_stylesheet();
73
  $os_options = (array) get_option(OPINIONSTAGE_OPTIONS_KEY);
74
  if (empty($os_options["uid"])) {
75
- $first_time = true;
76
  } else {
77
  $first_time = false;
78
  }
@@ -90,12 +90,12 @@ function opinionstage_add_poll_page() {
90
  if (email == emailInput.data('watermark')) {
91
  email = "";
92
  }
93
- var new_location = "http://" + "<?php echo OPINIONSTAGE_LOGIN_PATH.'?callback=' ?>" + encodeURIComponent(callbackURL) + "&email=" + email;
94
  window.location = new_location;
95
  });
96
 
97
  $('#os-switch-email').click(function(){
98
- var new_location = "http://" + "<?php echo OPINIONSTAGE_LOGIN_PATH.'?callback=' ?>" + encodeURIComponent(callbackURL);
99
  window.location = new_location;
100
  });
101
 
@@ -104,29 +104,29 @@ function opinionstage_add_poll_page() {
104
  $('#os-start-login').click();
105
  }
106
  });
107
-
108
  $('#fly-out-switch').change(function(){
109
  toggleSettingsAjax($(this), "opinionstage_ajax_toggle_flyout");
110
  });
111
 
112
  $('#article-placement-switch').change(function(){
113
  toggleSettingsAjax($(this), "opinionstage_ajax_toggle_article_placement");
114
- });
115
 
116
  $('#sidebar-placement-switch').change(function(){
117
  toggleSettingsAjax($(this), "opinionstage_ajax_toggle_sidebar_placement");
118
- });
119
  });
120
 
121
  </script>
122
  <div class="opinionstage-wrap">
123
  <div id="opinionstage-head"></div>
124
  <div class="section">
125
- <?php if($first_time) {?>
126
  <h2>Connect to Opinion Stage</h3>
127
  <p class='os-notice'>Connect WordPress with Opinion Stage to enable all features</p>
128
  <input id="os-email" type="text" value="" class="watermark" data-watermark="Enter Your Email"/>
129
- <a href="javascript:void(0)" class="os-button" id="os-start-login">Connect</a>
130
  <?php } else { ?>
131
  <p>You are connected to Opinion Stage with the following email</p>
132
  <label class="checked" for="user-email"></label>
@@ -140,7 +140,7 @@ function opinionstage_add_poll_page() {
140
  <ul class="os_links_list">
141
  <li><?php echo opinionstage_create_poll_link(); ?></li>
142
  <li><?php echo opinionstage_create_set_link(); ?></li>
143
- <li><?php echo opinionstage_dashboard_link('Manage Content'); ?></li>
144
  </ul>
145
  </div>
146
  <div class="section">
@@ -158,8 +158,8 @@ function opinionstage_add_poll_page() {
158
  <div class="onoffswitch-inner"></div>
159
  <div class="onoffswitch-switch"></div>
160
  </label>
161
- </div>
162
- <?php if(!$first_time) {?>
163
  <a href="<?php echo opinionstage_flyout_edit_url(); ?>" target="_blank">Configure</a>
164
  <?php } ?>
165
  </div>
@@ -167,7 +167,7 @@ function opinionstage_add_poll_page() {
167
  <div class='description'>
168
  <div class="text">
169
  Article Section
170
- </div>
171
  <a href="http://blog.opinionstage.com/article-placements/" class="question-link" target="_blank">(?)</a>
172
  </div>
173
  <div class="onoffswitch <?php echo($first_time ? "disabled" : "")?>">
@@ -176,8 +176,8 @@ function opinionstage_add_poll_page() {
176
  <div class="onoffswitch-inner"></div>
177
  <div class="onoffswitch-switch"></div>
178
  </label>
179
- </div>
180
- <?php if(!$first_time) {?>
181
  <a href="<?php echo opinionstage_article_placement_edit_url(); ?>" target="_blank">Configure</a>
182
  <?php } ?>
183
  </div>
@@ -194,28 +194,28 @@ function opinionstage_add_poll_page() {
194
  <div class="onoffswitch-inner"></div>
195
  <div class="onoffswitch-switch"></div>
196
  </label>
197
- </div>
198
- <?php if(!$first_time) {?>
199
  <div class="os-long-text">
200
  <a href="<?php echo $url = get_admin_url('', '', 'admin') . 'widgets.php' ?>">Configure</a> (using the Widgets Menu)
201
  </div>
202
  <?php } ?>
203
- </div>
204
  </div>
205
- <div class="section">
206
  <h2>Monetization</h2>
207
  <ul class="os_links_list">
208
- <li><?php echo opinionstage_logged_in_link('Contact us to monetize your traffic', "http://".OPINIONSTAGE_SERVER_BASE."/advanced-solutions"); ?></li>
209
- </ul>
210
- </div>
211
- <div class="section">
212
  <h2>Help</h2>
213
- <ul class="os_links_list">
214
- <li><a href="http://blog.opinionstage.com/wordpress-poll-how-to-add-polls-to-wordpress-sites/?o=wp35e8" target="_blank">How to use this plugin</a></li>
215
  <li><?php echo opinionstage_create_link('View Examples', 'showcase', ''); ?></li>
216
- <li><a href="https://opinionstage.zendesk.com/anonymous_requests/new" target="_blank">Contact Us</a></li>
217
- </ul>
218
- </div>
219
  </div>
220
  <?php
221
  }
@@ -265,7 +265,7 @@ function opinionstage_add_poll_popup() {
265
  $pollWrp.fadeOut(0, function ()
266
  {
267
  $setWrp.fadeIn("fast");
268
- });
269
  }
270
  }).trigger("change");
271
  });
@@ -280,7 +280,7 @@ function opinionstage_add_poll_popup() {
280
  <?php echo opinionstage_create_poll_link(); ?>
281
  </p>
282
  <p><strong>Don't know the poll ID?</strong></br></br>
283
- <?php echo opinionstage_dashboard_link('Locate ID of an existing poll'); ?>
284
  </p>
285
  </div>
286
  <div class="setWrp" style="display: none;">
@@ -293,7 +293,7 @@ function opinionstage_add_poll_popup() {
293
  <?php echo opinionstage_create_set_link(); ?>
294
  </p>
295
  <p><strong>Don't know the set ID?</strong></br></br>
296
- <?php echo opinionstage_dashboard_link('Locate ID of an existing set'); ?>
297
  </p>
298
  </div>
299
  </div>
5
  * Initialize the plugin
6
  */
7
  function opinionstage_init() {
8
+ opinionstage_initialize_data();
9
+ register_uninstall_hook(OPINIONSTAGE_WIDGET_UNIQUE_LOCATION, 'opinionstage_uninstall');
10
  }
11
 
12
  /**
13
  * Initialiaze the data options
14
  */
15
  function opinionstage_initialize_data() {
16
+ $os_options = (array) get_option(OPINIONSTAGE_OPTIONS_KEY);
17
+ $os_options['version'] = OPINIONSTAGE_WIDGET_VERSION;
18
 
19
  // For backward compatibility
20
  if (!isset($os_options['sidebar_placement_active'])) {
21
+ $os_options['sidebar_placement_active'] = 'false';
22
  }
23
 
24
+ update_option(OPINIONSTAGE_OPTIONS_KEY, $os_options);
25
  }
26
 
27
  /**
72
  opinionstage_add_stylesheet();
73
  $os_options = (array) get_option(OPINIONSTAGE_OPTIONS_KEY);
74
  if (empty($os_options["uid"])) {
75
+ $first_time = true;
76
  } else {
77
  $first_time = false;
78
  }
90
  if (email == emailInput.data('watermark')) {
91
  email = "";
92
  }
93
+ var new_location = "http://" + "<?php echo OPINIONSTAGE_LOGIN_PATH.'?callback=' ?>" + encodeURIComponent(callbackURL) + "&email=" + email;
94
  window.location = new_location;
95
  });
96
 
97
  $('#os-switch-email').click(function(){
98
+ var new_location = "http://" + "<?php echo OPINIONSTAGE_LOGIN_PATH.'?callback=' ?>" + encodeURIComponent(callbackURL);
99
  window.location = new_location;
100
  });
101
 
104
  $('#os-start-login').click();
105
  }
106
  });
107
+
108
  $('#fly-out-switch').change(function(){
109
  toggleSettingsAjax($(this), "opinionstage_ajax_toggle_flyout");
110
  });
111
 
112
  $('#article-placement-switch').change(function(){
113
  toggleSettingsAjax($(this), "opinionstage_ajax_toggle_article_placement");
114
+ });
115
 
116
  $('#sidebar-placement-switch').change(function(){
117
  toggleSettingsAjax($(this), "opinionstage_ajax_toggle_sidebar_placement");
118
+ });
119
  });
120
 
121
  </script>
122
  <div class="opinionstage-wrap">
123
  <div id="opinionstage-head"></div>
124
  <div class="section">
125
+ <?php if($first_time) {?>
126
  <h2>Connect to Opinion Stage</h3>
127
  <p class='os-notice'>Connect WordPress with Opinion Stage to enable all features</p>
128
  <input id="os-email" type="text" value="" class="watermark" data-watermark="Enter Your Email"/>
129
+ <a href="javascript:void(0)" class="os-button" id="os-start-login">Connect</a>
130
  <?php } else { ?>
131
  <p>You are connected to Opinion Stage with the following email</p>
132
  <label class="checked" for="user-email"></label>
140
  <ul class="os_links_list">
141
  <li><?php echo opinionstage_create_poll_link(); ?></li>
142
  <li><?php echo opinionstage_create_set_link(); ?></li>
143
+ <li><?php echo opinionstage_dashboard_link('Manage Content'); ?></li>
144
  </ul>
145
  </div>
146
  <div class="section">
158
  <div class="onoffswitch-inner"></div>
159
  <div class="onoffswitch-switch"></div>
160
  </label>
161
+ </div>
162
+ <?php if(!$first_time) {?>
163
  <a href="<?php echo opinionstage_flyout_edit_url(); ?>" target="_blank">Configure</a>
164
  <?php } ?>
165
  </div>
167
  <div class='description'>
168
  <div class="text">
169
  Article Section
170
+ </div>
171
  <a href="http://blog.opinionstage.com/article-placements/" class="question-link" target="_blank">(?)</a>
172
  </div>
173
  <div class="onoffswitch <?php echo($first_time ? "disabled" : "")?>">
176
  <div class="onoffswitch-inner"></div>
177
  <div class="onoffswitch-switch"></div>
178
  </label>
179
+ </div>
180
+ <?php if(!$first_time) {?>
181
  <a href="<?php echo opinionstage_article_placement_edit_url(); ?>" target="_blank">Configure</a>
182
  <?php } ?>
183
  </div>
194
  <div class="onoffswitch-inner"></div>
195
  <div class="onoffswitch-switch"></div>
196
  </label>
197
+ </div>
198
+ <?php if(!$first_time) {?>
199
  <div class="os-long-text">
200
  <a href="<?php echo $url = get_admin_url('', '', 'admin') . 'widgets.php' ?>">Configure</a> (using the Widgets Menu)
201
  </div>
202
  <?php } ?>
203
+ </div>
204
  </div>
205
+ <div class="section">
206
  <h2>Monetization</h2>
207
  <ul class="os_links_list">
208
+ <li><?php echo opinionstage_logged_in_link('Contact us to monetize your traffic', "http://".OPINIONSTAGE_SERVER_BASE."/advanced-solutions"); ?></li>
209
+ </ul>
210
+ </div>
211
+ <div class="section">
212
  <h2>Help</h2>
213
+ <ul class="os_links_list">
214
+ <li><a href="http://blog.opinionstage.com/wordpress-poll-how-to-add-polls-to-wordpress-sites/?o=wp35e8" target="_blank">How to use this plugin</a></li>
215
  <li><?php echo opinionstage_create_link('View Examples', 'showcase', ''); ?></li>
216
+ <li><a href="https://opinionstage.zendesk.com/anonymous_requests/new" target="_blank">Contact Us</a></li>
217
+ </ul>
218
+ </div>
219
  </div>
220
  <?php
221
  }
265
  $pollWrp.fadeOut(0, function ()
266
  {
267
  $setWrp.fadeIn("fast");
268
+ });
269
  }
270
  }).trigger("change");
271
  });
280
  <?php echo opinionstage_create_poll_link(); ?>
281
  </p>
282
  <p><strong>Don't know the poll ID?</strong></br></br>
283
+ <?php echo opinionstage_dashboard_link('Locate ID of an existing poll'); ?>
284
  </p>
285
  </div>
286
  <div class="setWrp" style="display: none;">
293
  <?php echo opinionstage_create_set_link(); ?>
294
  </p>
295
  <p><strong>Don't know the set ID?</strong></br></br>
296
+ <?php echo opinionstage_dashboard_link('Locate ID of an existing set'); ?>
297
  </p>
298
  </div>
299
  </div>
opinionstage-polls.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Polls by OpinionStage
4
  Plugin URI: http://www.opinionstage.com
5
  Description: Adds a highly engaging social polling system to your site. Easily add polls to any post/page or to your sites sidebar.
6
- Version: 12.6.0
7
  Author: OpinionStage.com
8
  Author URI: http://www.opinionstage.com
9
  */
@@ -11,7 +11,7 @@ Author URI: http://www.opinionstage.com
11
  /* --- Static initializer for Wordpress hooks --- */
12
 
13
  define('OPINIONSTAGE_SERVER_BASE', "www.opinionstage.com"); /* Don't include the protocol, added dynamically */
14
- define('OPINIONSTAGE_WIDGET_VERSION', '12.6.0');
15
  define('OPINIONSTAGE_WIDGET_PLUGIN_NAME', 'Polls by OpinionStage');
16
  define('OPINIONSTAGE_WIDGET_API_KEY', 'wp35e8');
17
  define('OPINIONSTAGE_OPTIONS_KEY', 'opinionstage_widget');
3
  Plugin Name: Polls by OpinionStage
4
  Plugin URI: http://www.opinionstage.com
5
  Description: Adds a highly engaging social polling system to your site. Easily add polls to any post/page or to your sites sidebar.
6
+ Version: 12.7.0
7
  Author: OpinionStage.com
8
  Author URI: http://www.opinionstage.com
9
  */
11
  /* --- Static initializer for Wordpress hooks --- */
12
 
13
  define('OPINIONSTAGE_SERVER_BASE', "www.opinionstage.com"); /* Don't include the protocol, added dynamically */
14
+ define('OPINIONSTAGE_WIDGET_VERSION', '12.7.0');
15
  define('OPINIONSTAGE_WIDGET_PLUGIN_NAME', 'Polls by OpinionStage');
16
  define('OPINIONSTAGE_WIDGET_API_KEY', 'wp35e8');
17
  define('OPINIONSTAGE_OPTIONS_KEY', 'opinionstage_widget');
opinionstage-utility-functions.php CHANGED
@@ -76,7 +76,9 @@ function opinionstage_create_embed_code($id, $type) {
76
  }
77
  return $code;
78
  }
79
-
 
 
80
  function opinionstage_create_placement_embed_code($id) {
81
 
82
  // Only present if id is available
@@ -112,7 +114,7 @@ function opinionstage_create_link($caption, $page, $params = "", $new_page = tru
112
  */
113
  function opinionstage_add_stylesheet() {
114
  // Respects SSL, Style.css is relative to the current file
115
- wp_register_style( 'opinionstage-style', plugins_url('os-style.css', __FILE__) );
116
  wp_enqueue_style( 'opinionstage-style' );
117
  }
118
 
@@ -132,23 +134,37 @@ function opinionstage_poll_tinymce_registerbutton($buttons) {
132
  array_push($buttons, 'separator', 'ospolls');
133
  return $buttons;
134
  }
135
-
 
 
136
  function opinionstage_poll_tinymce_addplugin($plugin_array) {
137
  $plugin_array['ospolls'] = plugins_url(OPINIONSTAGE_WIDGET_UNIQUE_ID.'/tinymce/plugins/polls/editor_plugin.js');
138
  return $plugin_array;
139
  }
 
 
 
140
  function opinionstage_flyout_edit_url() {
141
  $os_options = (array) get_option(OPINIONSTAGE_OPTIONS_KEY);
142
  return 'http://'.OPINIONSTAGE_SERVER_BASE.'/containers/'.$os_options['fly_id'].'/edit?token='.$os_options['token'];
143
  }
 
 
 
144
  function opinionstage_article_placement_edit_url() {
145
  $os_options = (array) get_option(OPINIONSTAGE_OPTIONS_KEY);
146
  return 'http://'.OPINIONSTAGE_SERVER_BASE.'/containers/'.$os_options['article_placement_id'].'/edit?token='.$os_options['token'];
147
  }
 
 
 
148
  function opinionstage_sidebar_placement_edit_url() {
149
  $os_options = (array) get_option(OPINIONSTAGE_OPTIONS_KEY);
150
  return 'http://'.OPINIONSTAGE_SERVER_BASE.'/containers/'.$os_options['sidebar_placement_id'].'/edit?token='.$os_options['token'];
151
  }
 
 
 
152
  function opinionstage_create_poll_link() {
153
  $os_options = (array) get_option(OPINIONSTAGE_OPTIONS_KEY);
154
  if (empty($os_options["uid"])) {
@@ -157,9 +173,15 @@ function opinionstage_create_poll_link() {
157
  return opinionstage_create_link('Create a Poll', 'new_poll', 'token='.$os_options['token']);
158
  }
159
  }
 
 
 
160
  function opinionstage_callback_url() {
161
  return get_admin_url('', '', 'admin') . 'admin.php?page='.OPINIONSTAGE_WIDGET_UNIQUE_ID.'/opinionstage-callback.php';
162
  }
 
 
 
163
  function opinionstage_create_set_link() {
164
  $os_options = (array) get_option(OPINIONSTAGE_OPTIONS_KEY);
165
  if (empty($os_options["uid"])) {
@@ -168,6 +190,9 @@ function opinionstage_create_set_link() {
168
  return opinionstage_create_link('Create a Set', 'sets/new', 'token='.$os_options['token']);
169
  }
170
  }
 
 
 
171
  function opinionstage_dashboard_link($text) {
172
  $os_options = (array) get_option(OPINIONSTAGE_OPTIONS_KEY);
173
  if (empty($os_options["uid"])) {
@@ -176,6 +201,9 @@ function opinionstage_dashboard_link($text) {
176
  return opinionstage_create_link($text, 'dashboard', 'token='.$os_options['token']);
177
  }
178
  }
 
 
 
179
  function opinionstage_logged_in_link($text, $link) {
180
  return opinionstage_create_link($text, 'registrations/new', 'return_to='.$link);
181
  }
76
  }
77
  return $code;
78
  }
79
+ /**
80
+ * Returns the embed code of a placement by fetching it from Opinion Stage api
81
+ */
82
  function opinionstage_create_placement_embed_code($id) {
83
 
84
  // Only present if id is available
114
  */
115
  function opinionstage_add_stylesheet() {
116
  // Respects SSL, Style.css is relative to the current file
117
+ wp_register_style( 'opinionstage-style', plugins_url('style.css', __FILE__) );
118
  wp_enqueue_style( 'opinionstage-style' );
119
  }
120
 
134
  array_push($buttons, 'separator', 'ospolls');
135
  return $buttons;
136
  }
137
+ /**
138
+ * Adds the tinymce plugin that includes the 'add poll' link
139
+ */
140
  function opinionstage_poll_tinymce_addplugin($plugin_array) {
141
  $plugin_array['ospolls'] = plugins_url(OPINIONSTAGE_WIDGET_UNIQUE_ID.'/tinymce/plugins/polls/editor_plugin.js');
142
  return $plugin_array;
143
  }
144
+ /**
145
+ * Generates a link for editing the flyout placement on Opinion Stage site
146
+ */
147
  function opinionstage_flyout_edit_url() {
148
  $os_options = (array) get_option(OPINIONSTAGE_OPTIONS_KEY);
149
  return 'http://'.OPINIONSTAGE_SERVER_BASE.'/containers/'.$os_options['fly_id'].'/edit?token='.$os_options['token'];
150
  }
151
+ /**
152
+ * Generates a link for editing the article placement on Opinion Stage site
153
+ */
154
  function opinionstage_article_placement_edit_url() {
155
  $os_options = (array) get_option(OPINIONSTAGE_OPTIONS_KEY);
156
  return 'http://'.OPINIONSTAGE_SERVER_BASE.'/containers/'.$os_options['article_placement_id'].'/edit?token='.$os_options['token'];
157
  }
158
+ /**
159
+ * Generates a link for editing the sidebar placement on Opinion Stage site
160
+ */
161
  function opinionstage_sidebar_placement_edit_url() {
162
  $os_options = (array) get_option(OPINIONSTAGE_OPTIONS_KEY);
163
  return 'http://'.OPINIONSTAGE_SERVER_BASE.'/containers/'.$os_options['sidebar_placement_id'].'/edit?token='.$os_options['token'];
164
  }
165
+ /**
166
+ * Generates a link for creating a poll
167
+ */
168
  function opinionstage_create_poll_link() {
169
  $os_options = (array) get_option(OPINIONSTAGE_OPTIONS_KEY);
170
  if (empty($os_options["uid"])) {
173
  return opinionstage_create_link('Create a Poll', 'new_poll', 'token='.$os_options['token']);
174
  }
175
  }
176
+ /**
177
+ * Generates a to the callback page used to connect the plugin to the Opinion Stage account
178
+ */
179
  function opinionstage_callback_url() {
180
  return get_admin_url('', '', 'admin') . 'admin.php?page='.OPINIONSTAGE_WIDGET_UNIQUE_ID.'/opinionstage-callback.php';
181
  }
182
+ /**
183
+ * Generates a link for creating a set
184
+ */
185
  function opinionstage_create_set_link() {
186
  $os_options = (array) get_option(OPINIONSTAGE_OPTIONS_KEY);
187
  if (empty($os_options["uid"])) {
190
  return opinionstage_create_link('Create a Set', 'sets/new', 'token='.$os_options['token']);
191
  }
192
  }
193
+ /**
194
+ * Generates a link to the dashboard in Opinion Stage site
195
+ */
196
  function opinionstage_dashboard_link($text) {
197
  $os_options = (array) get_option(OPINIONSTAGE_OPTIONS_KEY);
198
  if (empty($os_options["uid"])) {
201
  return opinionstage_create_link($text, 'dashboard', 'token='.$os_options['token']);
202
  }
203
  }
204
+ /**
205
+ * Generates a link to Opinion Stage that requires registration
206
+ */
207
  function opinionstage_logged_in_link($text, $link) {
208
  return opinionstage_create_link($text, 'registrations/new', 'return_to='.$link);
209
  }
opinionstage-widget.php CHANGED
@@ -1,18 +1,32 @@
1
  <?php
 
2
  class OpinionStageWidget extends WP_Widget {
3
- function OpinionStageWidget() {
4
- $widget_ops = array('classname' => 'opinionstage_widget', 'description' => __('Adds a highly engaging polls to your widget section.', OPINIONSTAGE_WIDGET_UNIQUE_ID));
5
- $this->WP_Widget('opinionstage_widget', __('Opinion Stage Sidebar Widget', OPINIONSTAGE_WIDGET_UNIQUE_ID), $widget_ops);
 
 
 
 
 
 
 
 
6
  }
7
 
 
 
 
8
  function widget($args, $instance) {
9
  extract($args);
10
  echo $before_widget;
11
  $title = @$instance['title'];
12
  $os_options = (array) get_option(OPINIONSTAGE_OPTIONS_KEY);
13
 
 
14
  if (!empty($title) && $os_options['sidebar_placement_active'] == 'true') echo $before_title . apply_filters('widget_title', $title) . $after_title;
15
 
 
16
  if (!empty($os_options["sidebar_placement_id"]) && $os_options['sidebar_placement_active'] == 'true') {
17
  echo opinionstage_create_placement_embed_code($os_options["sidebar_placement_id"]);
18
  }
@@ -20,6 +34,9 @@
20
  echo $after_widget;
21
  }
22
 
 
 
 
23
  function update($new_instance, $old_instance) {
24
  $instance = $old_instance;
25
  $instance['title'] = strip_tags($new_instance['title']);
@@ -30,6 +47,9 @@
30
  return $instance;
31
  }
32
 
 
 
 
33
  function form($instance) {
34
  $os_options = (array) get_option(OPINIONSTAGE_OPTIONS_KEY);
35
  $title = isset($instance['title']) ? esc_attr($instance['title']) : '';
@@ -46,7 +66,7 @@
46
  var callbackURL = function() {
47
  return "<?php echo $url = get_admin_url('', '', 'admin') . 'admin.php?page='.OPINIONSTAGE_WIDGET_UNIQUE_ID.'/opinionstage-callback.php' ?>";
48
  };
49
- $('.os-sidebar-widget').on('click', '.start-login', function(){
50
  var emailInput = $('#os-email');
51
  var email = $(emailInput).val();
52
  if (email == emailInput.data('watermark')) {
@@ -56,7 +76,7 @@
56
  window.location = new_location;
57
  });
58
 
59
- $('.os-sidebar-widget').on('click', '.switch-email', function(){
60
  var new_location = "http://" + "<?php echo OPINIONSTAGE_LOGIN_PATH.'?callback=' ?>" + encodeURIComponent(callbackURL());
61
  window.location = new_location;
62
  });
@@ -69,7 +89,7 @@
69
  });
70
  </script>
71
 
72
- <div class="os-sidebar-widget">
73
  <?php if($first_time) {?>
74
  <p>Connect WordPress with Opinion Stage to enable the widget</p>
75
  <input id="os-email" type="text" value="" class="watermark os-email" data-watermark="Enter Your Email"/>
@@ -93,6 +113,9 @@
93
  }
94
  }
95
 
 
 
 
96
  function opinionstage_init_widget() {
97
  register_widget('OpinionStageWidget');
98
  opinionstage_add_stylesheet();
1
  <?php
2
+ // Sidebar widget class for embeding the Opinion Stage sidebar placement
3
  class OpinionStageWidget extends WP_Widget {
4
+ function __construct() {
5
+ // register new widget
6
+ $widget_ops = array(
7
+ 'classname' => 'opinionstage_widget',
8
+ 'description' => __('Adds a highly engaging polls to your widget section.', OPINIONSTAGE_WIDGET_UNIQUE_ID)
9
+ );
10
+ parent::__construct(
11
+ 'opinionstage_widget',
12
+ __( 'Opinion Stage Sidebar Widget', OPINIONSTAGE_WIDGET_UNIQUE_ID ),
13
+ $widget_ops
14
+ );
15
  }
16
 
17
+ /*
18
+ * Returns the widget content - including the title and the sidebar placement content (once enabled)
19
+ */
20
  function widget($args, $instance) {
21
  extract($args);
22
  echo $before_widget;
23
  $title = @$instance['title'];
24
  $os_options = (array) get_option(OPINIONSTAGE_OPTIONS_KEY);
25
 
26
+ // Show the title once widget is enabled
27
  if (!empty($title) && $os_options['sidebar_placement_active'] == 'true') echo $before_title . apply_filters('widget_title', $title) . $after_title;
28
 
29
+ // Add the placement shortcode once widget is enabled
30
  if (!empty($os_options["sidebar_placement_id"]) && $os_options['sidebar_placement_active'] == 'true') {
31
  echo opinionstage_create_placement_embed_code($os_options["sidebar_placement_id"]);
32
  }
34
  echo $after_widget;
35
  }
36
 
37
+ /*
38
+ * Updates the widget settings (title and enabled flag)
39
+ */
40
  function update($new_instance, $old_instance) {
41
  $instance = $old_instance;
42
  $instance['title'] = strip_tags($new_instance['title']);
47
  return $instance;
48
  }
49
 
50
+ /*
51
+ * Generates the admin form for the widget.
52
+ */
53
  function form($instance) {
54
  $os_options = (array) get_option(OPINIONSTAGE_OPTIONS_KEY);
55
  $title = isset($instance['title']) ? esc_attr($instance['title']) : '';
66
  var callbackURL = function() {
67
  return "<?php echo $url = get_admin_url('', '', 'admin') . 'admin.php?page='.OPINIONSTAGE_WIDGET_UNIQUE_ID.'/opinionstage-callback.php' ?>";
68
  };
69
+ $('.opinionstage-sidebar-widget').on('click', '.start-login', function(){
70
  var emailInput = $('#os-email');
71
  var email = $(emailInput).val();
72
  if (email == emailInput.data('watermark')) {
76
  window.location = new_location;
77
  });
78
 
79
+ $('.opinionstage-sidebar-widget').on('click', '.switch-email', function(){
80
  var new_location = "http://" + "<?php echo OPINIONSTAGE_LOGIN_PATH.'?callback=' ?>" + encodeURIComponent(callbackURL());
81
  window.location = new_location;
82
  });
89
  });
90
  </script>
91
 
92
+ <div class="opinionstage-sidebar-widget">
93
  <?php if($first_time) {?>
94
  <p>Connect WordPress with Opinion Stage to enable the widget</p>
95
  <input id="os-email" type="text" value="" class="watermark os-email" data-watermark="Enter Your Email"/>
113
  }
114
  }
115
 
116
+ /*
117
+ * Register Sidebar Placement Widget
118
+ */
119
  function opinionstage_init_widget() {
120
  register_widget('OpinionStageWidget');
121
  opinionstage_add_stylesheet();
opinionstage_plugin.js CHANGED
@@ -2,13 +2,12 @@
2
  jQuery(document).ready(function($) {
3
  var handleWatermark = function(input){
4
  if(input.val().trim() != "") {
5
- input.removeClass('os-watermark');
6
  } else {
7
  input.val(input.data('watermark'));
8
  input.addClass('os-watermark');
9
  }
10
  };
11
-
12
  $("#content_ospolls").click(function() {
13
  $("os_insert_poll").click();
14
  return false;
@@ -33,7 +32,7 @@
33
  tb_remove();
34
  $("#opinionstage-type").trigger("change");
35
  });
36
- $('input.watermark').focus(function(){
37
  var input = $(this);
38
  if (input.data('watermark') == input.val()) {
39
  input.val("");
2
  jQuery(document).ready(function($) {
3
  var handleWatermark = function(input){
4
  if(input.val().trim() != "") {
5
+ input.removeClass('os-watermark');
6
  } else {
7
  input.val(input.data('watermark'));
8
  input.addClass('os-watermark');
9
  }
10
  };
 
11
  $("#content_ospolls").click(function() {
12
  $("os_insert_poll").click();
13
  return false;
32
  tb_remove();
33
  $("#opinionstage-type").trigger("change");
34
  });
35
+ $('.opinionstage-wrap input.watermark').focus(function(){
36
  var input = $(this);
37
  if (input.data('watermark') == input.val()) {
38
  input.val("");
readme.txt CHANGED
@@ -4,14 +4,14 @@ Donate link:
4
  Tags: poll, polls, polling, vote, voting, debate, survey, social, opinionstage, opinion stage
5
 
6
  Requires at least: 2.8
7
- Tested up to: 4.2.2
8
  Stable tag: trunk
9
 
10
  Add a powerful & easy-to-use polling solution to your site. Create beautiful polls that boost time on site and drive traffic to your site.
11
 
12
  == Description ==
13
 
14
- The Opinion Stage poll plug-in allows you to easily add standard or social polls to your website or Facebook page.
15
 
16
  = Poll Examples: =
17
 
@@ -123,6 +123,10 @@ We support both regular multiple-sided polls and a special head-to-head poll fla
123
  N/A
124
 
125
  == Changelog ==
 
 
 
 
126
  = Version 12.6.0 =
127
  * Fixed broken links to dashboard
128
  * Renamed css file
4
  Tags: poll, polls, polling, vote, voting, debate, survey, social, opinionstage, opinion stage
5
 
6
  Requires at least: 2.8
7
+ Tested up to: 4.3.0
8
  Stable tag: trunk
9
 
10
  Add a powerful & easy-to-use polling solution to your site. Create beautiful polls that boost time on site and drive traffic to your site.
11
 
12
  == Description ==
13
 
14
+ The Opinion Stage polls plug-in allows you to easily add standard or social polls to your website or Facebook page.
15
 
16
  = Poll Examples: =
17
 
123
  N/A
124
 
125
  == Changelog ==
126
+ = Version 12.7.0 =
127
+ * CSS modifications to better align with desired coding standards. Reverted css file name change.
128
+ * Minor text changes
129
+ * Not using PHP 4 Style Constructors any more
130
  = Version 12.6.0 =
131
  * Fixed broken links to dashboard
132
  * Renamed css file
social-polls-by-opinionstage.zip DELETED
Binary file
os-style.css → style.css RENAMED
@@ -46,7 +46,7 @@
46
  .opinionstage-wrap input[type="text"][disabled="disabled"] {
47
  background-color: #DFDFDF;
48
  }
49
- .opinionstage-wrap .os-button, .os-sidebar-widget .os-button {
50
  text-decoration: none !important;
51
  border-top: 1px solid #E7E5E3;
52
  border-bottom: 1px solid #CFCCC8;
@@ -67,7 +67,7 @@
67
  filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#289ec4, endColorstr=#278fb5);
68
  padding: 5px 10px;
69
  }
70
- .opinionstage-wrap .os-button:hover, .os-sidebar-widget .os-button:hover {
71
  background-color: #40aacd;
72
  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #40aacd), color-stop(100%, #40aacd));
73
  background-image: -webkit-linear-gradient(top, #40aacd, #40aacd);
@@ -195,13 +195,13 @@
195
  color: red;
196
  font-weight: bold;
197
  }
198
- .os-sidebar-widget {
199
  overflow: hidden;
200
  margin-bottom: 15px;
201
  }
202
- .os-sidebar-widget .text {
203
  margin-top: 10px;
204
  }
205
- .os-sidebar-widget #os-email {
206
  margin-left: 8px;
207
  }
46
  .opinionstage-wrap input[type="text"][disabled="disabled"] {
47
  background-color: #DFDFDF;
48
  }
49
+ .opinionstage-wrap .os-button, .opinionstage-sidebar-widget .os-button {
50
  text-decoration: none !important;
51
  border-top: 1px solid #E7E5E3;
52
  border-bottom: 1px solid #CFCCC8;
67
  filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#289ec4, endColorstr=#278fb5);
68
  padding: 5px 10px;
69
  }
70
+ .opinionstage-wrap .os-button:hover, .opinionstage-sidebar-widget .os-button:hover {
71
  background-color: #40aacd;
72
  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #40aacd), color-stop(100%, #40aacd));
73
  background-image: -webkit-linear-gradient(top, #40aacd, #40aacd);
195
  color: red;
196
  font-weight: bold;
197
  }
198
+ .opinionstage-sidebar-widget {
199
  overflow: hidden;
200
  margin-bottom: 15px;
201
  }
202
+ .opinionstage-sidebar-widget .text {
203
  margin-top: 10px;
204
  }
205
+ .opinionstage-sidebar-widget #os-email {
206
  margin-left: 8px;
207
  }