Poll, Survey, Quiz, Slideshow, Form, Story & Landing Page - Version 10.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 10.7.0
Comparing to
See all releases

Code changes from version 10.6.0 to 10.7.0

opinionstage-functions.php CHANGED
@@ -145,7 +145,8 @@ function opinionstage_add_poll_page() {
145
  <li><?php echo opinionstage_create_link('View Polls', 'dashboard', ''); ?></li>
146
  <li><?php echo opinionstage_create_link('Create a Set', 'sets/new', ''); ?></li>
147
  <li><?php echo opinionstage_create_link('View Sets', 'dashboard', 'tab=sets'); ?></li>
148
- <li><?php echo opinionstage_create_link('View Containers', 'dashboard', 'tab=containers'); ?></li>
 
149
  </ul>
150
  <h2>Help</h2>
151
  <ul class="os_links_list">
@@ -279,4 +280,9 @@ function opinionstage_poll_tinymce_addplugin($plugin_array) {
279
  $plugin_array['ospolls'] = plugins_url(OPINIONSTAGE_WIDGET_UNIQUE_ID.'/tinymce/plugins/polls/editor_plugin.js');
280
  return $plugin_array;
281
  }
 
 
 
 
 
282
  ?>
145
  <li><?php echo opinionstage_create_link('View Polls', 'dashboard', ''); ?></li>
146
  <li><?php echo opinionstage_create_link('Create a Set', 'sets/new', ''); ?></li>
147
  <li><?php echo opinionstage_create_link('View Sets', 'dashboard', 'tab=sets'); ?></li>
148
+ <li><?php echo opinionstage_create_link('View Containers', 'dashboard', 'tab=containers'); ?></li>
149
+ <li><a href="<?php _e(admin_url('admin.php?page=addpollstoallposts')) ?>">Add Polls to all posts</a></li>
150
  </ul>
151
  <h2>Help</h2>
152
  <ul class="os_links_list">
280
  $plugin_array['ospolls'] = plugins_url(OPINIONSTAGE_WIDGET_UNIQUE_ID.'/tinymce/plugins/polls/editor_plugin.js');
281
  return $plugin_array;
282
  }
283
+
284
+ /**
285
+ * Add polls to all posts admin page
286
+ */
287
+ require_once('opinionstage_add_polls_to_all_posts.php');
288
  ?>
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: 10.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', '10.6.0');
15
  define('OPINIONSTAGE_WIDGET_PLUGIN_NAME', 'Polls by OpinionStage');
16
  define('OPINIONSTAGE_WIDGET_API_KEY', 'wp35e8');
17
  define('OPINIONSTAGE_WIDGET_SHORTCODE', 'socialpoll');
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: 10.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', '10.7.0');
15
  define('OPINIONSTAGE_WIDGET_PLUGIN_NAME', 'Polls by OpinionStage');
16
  define('OPINIONSTAGE_WIDGET_API_KEY', 'wp35e8');
17
  define('OPINIONSTAGE_WIDGET_SHORTCODE', 'socialpoll');
opinionstage_add_polls_to_all_posts.php ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class AddPollsToAllPosts {
3
+ static $identifier = 'addpollstoallposts';
4
+
5
+ static function bootstrap() {
6
+ add_action($hook = 'admin_menu', array(__CLASS__, $hook));
7
+ add_filter($hook = 'the_content', array(__CLASS__, $hook));
8
+ }
9
+
10
+ static function admin_menu() {
11
+ $page_callback = array(__CLASS__, 'render_page');
12
+ $url = self::register_admin_page($page_callback);
13
+ }
14
+
15
+ static function the_content($content) {
16
+ global $post;
17
+ $opinionstage_aptap = get_option('opinionstage_aptap');
18
+ if (is_array($opinionstage_aptap)) {
19
+ if (isset($opinionstage_aptap['post_types']) && !empty($opinionstage_aptap['post_types']) && is_array($opinionstage_aptap['post_types'])) {
20
+ if (in_array($post->post_type, $opinionstage_aptap['post_types'])) {
21
+ $shortcode = do_shortcode(
22
+ sprintf(
23
+ '[socialpoll id="%s" type="%s"]',
24
+ $opinionstage_aptap['configure_id'],
25
+ $opinionstage_aptap['content_types']
26
+ )
27
+ );
28
+ return $content . $shortcode;
29
+ }
30
+ }
31
+ }
32
+
33
+ return $content;
34
+ }
35
+
36
+ static function register_admin_page($callback) {
37
+ $parent_slug = 'admin.php';
38
+ $hookname = get_plugin_page_hookname(AddPollsToAllPosts::$identifier, $parent_slug);
39
+ add_filter($hookname, $callback);
40
+ $GLOBALS['_registered_pages'][$hookname] = true;
41
+ $url = admin_url($parent_slug . '?page=' . $identifier);
42
+ return $url;
43
+ }
44
+
45
+ static function render_page() {
46
+ if (isset($_POST['opinionstage_aptap']) && is_array($_POST['opinionstage_aptap'])) {
47
+ $opinionstage_aptap = $_POST['opinionstage_aptap'];
48
+ update_option('opinionstage_aptap', $opinionstage_aptap);
49
+ ?><div class="updated"><p><strong>Options saved.</strong></p></div><?php
50
+ }
51
+ opinionstage_add_stylesheet();
52
+ $post_types = get_post_types(array('public' => true));
53
+ function os_get_option($options, $option_name) {
54
+ if (is_array($options))
55
+ return isset($options[$option_name]) && !empty($options[$option_name]) ? $options[$option_name] : '';
56
+ return '';
57
+ }
58
+ $opinionstage_aptap = get_option('opinionstage_aptap');
59
+ ?>
60
+ <div class="opinionstage-wrap">
61
+ <div id="opinionstage-head"></div>
62
+ <div class="section">
63
+ <form action="" method="POST"
64
+ <h2>Add polls to all posts</h2>
65
+ <hr />
66
+ <h3>Select post types</h3>
67
+ <div class="chkboxs" style="background-color: #FFF; border: 1px solid #DDD; padding: 5px 20px 5px 10px; display: inline-block;">
68
+ <?php foreach ($post_types as $pt) { ?>
69
+ <?php
70
+ $is_checked = false;
71
+ if (is_array(os_get_option($opinionstage_aptap, 'post_types'))) {
72
+ $post_types = os_get_option($opinionstage_aptap, 'post_types');
73
+ if (in_array($pt, $post_types)) $is_checked = true;
74
+ }
75
+ ?>
76
+ <label for="pt-<?php _e($pt) ?>"><input type="checkbox" name="opinionstage_aptap[post_types][]" value="<?php _e($pt) ?>" id="pt-<?php _e($pt) ?>" <?php _e($is_checked ? 'checked="checked"' : '') ?> />&nbsp;&nbsp;&nbsp;<?php _e($pt) ?></label><br />
77
+ <?php } ?>
78
+ </div>
79
+ <br />
80
+ <h3><label for="pt-ct">Select content types</label></h3>
81
+ <select name="opinionstage_aptap[content_types]" id="pt-ct">
82
+ <option value="poll" <?php _e(os_get_option($opinionstage_aptap, 'content_types') == 'poll' ? 'selected="selected"' : '') ?>>Poll</option>
83
+ <option value="container" <?php _e(os_get_option($opinionstage_aptap, 'content_types') == 'container' ? 'selected="selected"' : '') ?>>Container</option>
84
+ <option value="set" <?php _e(os_get_option($opinionstage_aptap, 'content_types') == 'set' ? 'selected="selected"' : '') ?>>Set</option>
85
+ </select>
86
+ <br />
87
+ <h3><label for="pt-cnfid">Configure ID</label></h3>
88
+ <input type="text" value="<?php _e(os_get_option($opinionstage_aptap, 'configure_id')) ?>" name="opinionstage_aptap[configure_id]" id="pt-cnfid" />
89
+ <div><a href="#" id="pt-locid" target="_blank">Locate ID in Dashboard</a></div>
90
+ <br />
91
+ <p class="submit"><input type="submit" class="button button-primary" value="Save Changes"></p>
92
+ <br />
93
+ <div style="background-color: #FFF; border: 1px solid #DDD; padding: 5px 20px 5px 10px; display: inline-block; max-width: 300px;">Note: If you would like to add a poll to only one post/page, click on the Opinion Stage icon from the create post/page visual editor.</div>
94
+ <br />
95
+ <p>Need more help? <a href="http://blog.opinionstage.com/wordpress-poll-how-to-add-polls-to-wordpress-sites/" target="_blank">Click here!</a></p>
96
+ </form>
97
+ </div>
98
+ </div>
99
+ <script type="text/javascript">
100
+ jQuery(function ($)
101
+ {
102
+ $("#toplevel_page_social-polls-by-opinionstage-opinionstage-polls").addClass("current").find(" > a").addClass("current");
103
+ $("#pt-ct").on("change", function ()
104
+ {
105
+ var $this = $(this),
106
+ v = $this.val(),
107
+ $locid = $("#pt-locid");
108
+ var rootURL = "http://www.opinionstage.com/dashboard?o=wp35e8";
109
+ if (v == "container") rootURL += "&tab=containers";
110
+ if (v == "set") rootURL += "&tab=sets";
111
+ $locid.attr("href", rootURL);
112
+ }).trigger("change");
113
+ });
114
+ </script>
115
+ <?php
116
+ }
117
+ }
118
+ return AddPollsToAllPosts::bootstrap();
119
+ ?>
readme.txt CHANGED
@@ -130,6 +130,8 @@ Yes, just post the following syntax into any post/page: [socialpoll ID="xyz"], w
130
  N/A
131
 
132
  == Changelog ==
 
 
133
  = Version 10.6.0 =
134
  * Poll sets and poll placements - improved interface
135
  = Version 10.5.0 =
130
  N/A
131
 
132
  == Changelog ==
133
+ = Version 10.7.0 =
134
+ * New options for adding polls or sets to all posts
135
  = Version 10.6.0 =
136
  * Poll sets and poll placements - improved interface
137
  = Version 10.5.0 =