Version Description
N/A
Download this release
Release Info
Developer | opinionstage |
Plugin | Poll, Survey, Quiz, Slideshow, Form, Story & Landing Page |
Version | 15.5.0 |
Comparing to | |
See all releases |
Code changes from version 15.2.0 to 15.5.0
- images/lb-bg.png +0 -0
- opinionstage-functions.php +66 -1
- opinionstage-polls.php +5 -2
- opinionstage-style-common.css +64 -2
- opinionstage-utility-functions.php +59 -4
- readme.txt +7 -1
images/lb-bg.png
ADDED
Binary file
|
opinionstage-functions.php
CHANGED
@@ -77,7 +77,11 @@ function opinionstage_add_poll_page() {
|
|
77 |
var toggleSettingsAjax = function(currObject, action) {
|
78 |
$.post(ajaxurl, {action: action, activate: currObject.is(':checked')}, function(response) { });
|
79 |
};
|
80 |
-
|
|
|
|
|
|
|
|
|
81 |
$('#os-start-login').click(function(){
|
82 |
var emailInput = $('#os-email');
|
83 |
var email = $(emailInput).val();
|
@@ -110,6 +114,22 @@ function opinionstage_add_poll_page() {
|
|
110 |
$('#sidebar-placement-switch').change(function(){
|
111 |
toggleSettingsAjax($(this), "opinionstage_ajax_toggle_sidebar_placement");
|
112 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
});
|
114 |
|
115 |
</script>
|
@@ -282,6 +302,51 @@ function opinionstage_add_poll_page() {
|
|
282 |
</div>
|
283 |
</div>
|
284 |
<div class="opinionstage-dashboard-left">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
285 |
<div id="opinionstage-section-help" class="opinionstage-dashboard-section">
|
286 |
<div class="opinionstage-section-header">
|
287 |
<div class="opinionstage-section-title">Help</div>
|
77 |
var toggleSettingsAjax = function(currObject, action) {
|
78 |
$.post(ajaxurl, {action: action, activate: currObject.is(':checked')}, function(response) { });
|
79 |
};
|
80 |
+
var updatePageLink = function() {
|
81 |
+
var page_id = $('select.os-page-select').val();
|
82 |
+
var edit_url = "<?php echo admin_url()?>" + 'post.php?post=' + page_id +'&action=edit';
|
83 |
+
$("a.os-edit-page").attr("href", edit_url);
|
84 |
+
}
|
85 |
$('#os-start-login').click(function(){
|
86 |
var emailInput = $('#os-email');
|
87 |
var email = $(emailInput).val();
|
114 |
$('#sidebar-placement-switch').change(function(){
|
115 |
toggleSettingsAjax($(this), "opinionstage_ajax_toggle_sidebar_placement");
|
116 |
});
|
117 |
+
$("input[name='os-section']").change(function(e){
|
118 |
+
if ($('#feed_top_content').is(':checked')) {
|
119 |
+
$('#os-section-shortcode').val('[os-section]');
|
120 |
+
} else {
|
121 |
+
$('#os-section-shortcode').val('[os-section kind="my"]');
|
122 |
+
}
|
123 |
+
});
|
124 |
+
$('select.os-page-select').change(function() {
|
125 |
+
updatePageLink();
|
126 |
+
});
|
127 |
+
$('#opinionstage-content').on('click', '#os-section-shortcode', function(e) {
|
128 |
+
$(this).focus();
|
129 |
+
$(this).select();
|
130 |
+
});
|
131 |
+
|
132 |
+
updatePageLink();
|
133 |
});
|
134 |
|
135 |
</script>
|
302 |
</div>
|
303 |
</div>
|
304 |
<div class="opinionstage-dashboard-left">
|
305 |
+
<div id="opinionstage-section-quiz" class="opinionstage-dashboard-section">
|
306 |
+
<div class="opinionstage-section-header">
|
307 |
+
<div class="opinionstage-section-title">Interactive Content Section</div>
|
308 |
+
</div>
|
309 |
+
<div class="opinionstage-section-content-wrapper">
|
310 |
+
<div class="opinionstage-section-content">
|
311 |
+
<div class="opinionstage-section-sub-title">
|
312 |
+
Add an engaging and fun section to your site
|
313 |
+
</div>
|
314 |
+
<div class="opinionstage-section-raw">
|
315 |
+
<div class="opinionstage-section-cell os-step-cell">
|
316 |
+
<div class="os-step">1</div>
|
317 |
+
</div>
|
318 |
+
<div class="opinionstage-section-cell os-step-details">
|
319 |
+
<div class="os-step-title">Copy the following code:</div>
|
320 |
+
<input type="text" id="os-section-shortcode" readonly="readonly" value="[os-section]"></input>
|
321 |
+
<div class="os-section-type">
|
322 |
+
<input checked="checked" id="feed_top_content" name="os-section" type="radio" value="top">
|
323 |
+
<label for="feed_top_content">Top content</label>
|
324 |
+
<input id="feed_my_content" name="os-section" type="radio" value="my" <?php echo($first_time ? "disabled" : "")?>>
|
325 |
+
<label for="feed_my_content" class="<?php echo($first_time ? "opinionstage-disabled" : "")?>">My content</label>
|
326 |
+
</div>
|
327 |
+
</div>
|
328 |
+
</div>
|
329 |
+
<div class="opinionstage-section-raw">
|
330 |
+
<div class="opinionstage-section-cell os-step-cell os-step-2">
|
331 |
+
<div class="os-step">2</div>
|
332 |
+
</div>
|
333 |
+
<div class="opinionstage-section-cell os-step-details">
|
334 |
+
<div class="os-step-title">
|
335 |
+
Paste to an existing page
|
336 |
+
<?php wp_dropdown_pages( array('post_type' => 'page', 'hierarchical' => 1, 'class' => 'os-page-select') ); ?>
|
337 |
+
<a href="" class="os-edit-page" target='blank'>Edit</a>
|
338 |
+
</div>
|
339 |
+
<div class="os-step-title">
|
340 |
+
Or to a new page
|
341 |
+
<a href="<?php echo admin_url('post-new.php?post_type=page')?>" class="os-new-page" target='blank'>New</a>
|
342 |
+
</div>
|
343 |
+
</div>
|
344 |
+
</div>
|
345 |
+
</div>
|
346 |
+
</div>
|
347 |
+
</div>
|
348 |
+
</div>
|
349 |
+
<div class="opinionstage-dashboard-right">
|
350 |
<div id="opinionstage-section-help" class="opinionstage-dashboard-section">
|
351 |
<div class="opinionstage-section-header">
|
352 |
<div class="opinionstage-section-title">Help</div>
|
opinionstage-polls.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Poll, Quiz & List by OpinionStage
|
4 |
Plugin URI: http://www.opinionstage.com
|
5 |
Description: Adds highly engaging polls & quizzes to your site. Easily add polls & quizzes to any post/page or to your site sidebar.
|
6 |
-
Version: 15.
|
7 |
Author: OpinionStage.com
|
8 |
Author URI: http://www.opinionstage.com
|
9 |
Text Domain: social-polls-by-opinionstage
|
@@ -12,17 +12,19 @@ Text Domain: social-polls-by-opinionstage
|
|
12 |
/* --- Static initializer for Wordpress hooks --- */
|
13 |
|
14 |
define('OPINIONSTAGE_SERVER_BASE', "www.opinionstage.com"); /* Don't include the protocol, added dynamically */
|
15 |
-
define('OPINIONSTAGE_WIDGET_VERSION', '15.
|
16 |
define('OPINIONSTAGE_WIDGET_PLUGIN_NAME', 'Poll, Quiz & List by OpinionStage');
|
17 |
define('OPINIONSTAGE_WIDGET_API_KEY', 'wp35e8');
|
18 |
define('OPINIONSTAGE_OPTIONS_KEY', 'opinionstage_widget');
|
19 |
define('OPINIONSTAGE_POLL_SHORTCODE', 'socialpoll');
|
20 |
define('OPINIONSTAGE_WIDGET_SHORTCODE', 'os-widget');
|
|
|
21 |
define('OPINIONSTAGE_PLACEMENT_SHORTCODE', 'osplacement');
|
22 |
define('OPINIONSTAGE_WIDGET_UNIQUE_ID', 'social-polls-by-opinionstage');
|
23 |
define('OPINIONSTAGE_WIDGET_UNIQUE_LOCATION', __FILE__);
|
24 |
define('OPINIONSTAGE_WIDGET_MENU_NAME', 'Poll, Quiz & List');
|
25 |
define('OPINIONSTAGE_LOGIN_PATH', OPINIONSTAGE_SERVER_BASE."/integrations/wordpress/new");
|
|
|
26 |
|
27 |
require_once(WP_PLUGIN_DIR."/".OPINIONSTAGE_WIDGET_UNIQUE_ID."/opinionstage-utility-functions.php");
|
28 |
require_once(WP_PLUGIN_DIR."/".OPINIONSTAGE_WIDGET_UNIQUE_ID."/opinionstage-functions.php");
|
@@ -38,6 +40,7 @@ if (opinionstage_check_plugin_available('opinionstage_popup')) {
|
|
38 |
} else {
|
39 |
add_shortcode(OPINIONSTAGE_POLL_SHORTCODE, 'opinionstage_add_poll_or_set');
|
40 |
add_shortcode(OPINIONSTAGE_WIDGET_SHORTCODE, 'opinionstage_add_widget');
|
|
|
41 |
add_shortcode(OPINIONSTAGE_PLACEMENT_SHORTCODE, 'opinionstage_add_placement');
|
42 |
|
43 |
add_action('plugins_loaded', 'opinionstage_init');
|
3 |
Plugin Name: Poll, Quiz & List by OpinionStage
|
4 |
Plugin URI: http://www.opinionstage.com
|
5 |
Description: Adds highly engaging polls & quizzes to your site. Easily add polls & quizzes to any post/page or to your site sidebar.
|
6 |
+
Version: 15.5.0
|
7 |
Author: OpinionStage.com
|
8 |
Author URI: http://www.opinionstage.com
|
9 |
Text Domain: social-polls-by-opinionstage
|
12 |
/* --- Static initializer for Wordpress hooks --- */
|
13 |
|
14 |
define('OPINIONSTAGE_SERVER_BASE', "www.opinionstage.com"); /* Don't include the protocol, added dynamically */
|
15 |
+
define('OPINIONSTAGE_WIDGET_VERSION', '15.5.0');
|
16 |
define('OPINIONSTAGE_WIDGET_PLUGIN_NAME', 'Poll, Quiz & List by OpinionStage');
|
17 |
define('OPINIONSTAGE_WIDGET_API_KEY', 'wp35e8');
|
18 |
define('OPINIONSTAGE_OPTIONS_KEY', 'opinionstage_widget');
|
19 |
define('OPINIONSTAGE_POLL_SHORTCODE', 'socialpoll');
|
20 |
define('OPINIONSTAGE_WIDGET_SHORTCODE', 'os-widget');
|
21 |
+
define('OPINIONSTAGE_FEED_SHORTCODE', 'os-section');
|
22 |
define('OPINIONSTAGE_PLACEMENT_SHORTCODE', 'osplacement');
|
23 |
define('OPINIONSTAGE_WIDGET_UNIQUE_ID', 'social-polls-by-opinionstage');
|
24 |
define('OPINIONSTAGE_WIDGET_UNIQUE_LOCATION', __FILE__);
|
25 |
define('OPINIONSTAGE_WIDGET_MENU_NAME', 'Poll, Quiz & List');
|
26 |
define('OPINIONSTAGE_LOGIN_PATH', OPINIONSTAGE_SERVER_BASE."/integrations/wordpress/new");
|
27 |
+
define('OPINIONSTAGE_API_PATH', OPINIONSTAGE_SERVER_BASE."/api/v1");
|
28 |
|
29 |
require_once(WP_PLUGIN_DIR."/".OPINIONSTAGE_WIDGET_UNIQUE_ID."/opinionstage-utility-functions.php");
|
30 |
require_once(WP_PLUGIN_DIR."/".OPINIONSTAGE_WIDGET_UNIQUE_ID."/opinionstage-functions.php");
|
40 |
} else {
|
41 |
add_shortcode(OPINIONSTAGE_POLL_SHORTCODE, 'opinionstage_add_poll_or_set');
|
42 |
add_shortcode(OPINIONSTAGE_WIDGET_SHORTCODE, 'opinionstage_add_widget');
|
43 |
+
add_shortcode(OPINIONSTAGE_FEED_SHORTCODE, 'opinionstage_add_feed');
|
44 |
add_shortcode(OPINIONSTAGE_PLACEMENT_SHORTCODE, 'opinionstage_add_placement');
|
45 |
|
46 |
add_action('plugins_loaded', 'opinionstage_init');
|
opinionstage-style-common.css
CHANGED
@@ -9,6 +9,9 @@
|
|
9 |
#opinionstage-content a {
|
10 |
color: #3499c2;
|
11 |
}
|
|
|
|
|
|
|
12 |
#opinionstage-content .opinionstage-header-wrapper {
|
13 |
left: 0;
|
14 |
right: 0;
|
@@ -28,6 +31,9 @@
|
|
28 |
#opinionstage-content .opinionstage-menu-wrapper {
|
29 |
height: 50px;
|
30 |
}
|
|
|
|
|
|
|
31 |
#opinionstage-content .opinionstage-status-wrapper {
|
32 |
background: url("images/top-bg.png") no-repeat 0px 0px;
|
33 |
height: 146px;
|
@@ -156,7 +162,12 @@
|
|
156 |
border-collapse: collapse;
|
157 |
width: 100%;
|
158 |
}
|
159 |
-
#opinionstage-content .opinionstage-dashboard-section.opinionstage-
|
|
|
|
|
|
|
|
|
|
|
160 |
}
|
161 |
#opinionstage-content .opinionstage-dashboard-section .opinionstage-section-content-wrapper {
|
162 |
display: block;
|
@@ -230,8 +241,59 @@
|
|
230 |
height: 18px;
|
231 |
font-size: 19px;
|
232 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
233 |
#opinionstage-section-help .opinionstage-section-content {
|
234 |
-
height:
|
235 |
}
|
236 |
#opinionstage-section-help .opinionstage-section-cell a {
|
237 |
font-size: 18px;
|
9 |
#opinionstage-content a {
|
10 |
color: #3499c2;
|
11 |
}
|
12 |
+
#opinionstage-content input[type=radio] {
|
13 |
+
margin-top: 0px;
|
14 |
+
}
|
15 |
#opinionstage-content .opinionstage-header-wrapper {
|
16 |
left: 0;
|
17 |
right: 0;
|
31 |
#opinionstage-content .opinionstage-menu-wrapper {
|
32 |
height: 50px;
|
33 |
}
|
34 |
+
#opinionstage-content label.opinionstage-disabled {
|
35 |
+
color: #b1b1b1;
|
36 |
+
}
|
37 |
#opinionstage-content .opinionstage-status-wrapper {
|
38 |
background: url("images/top-bg.png") no-repeat 0px 0px;
|
39 |
height: 146px;
|
162 |
border-collapse: collapse;
|
163 |
width: 100%;
|
164 |
}
|
165 |
+
#opinionstage-content .opinionstage-dashboard-section .opinionstage-section-content .opinionstage-section-sub-title {
|
166 |
+
display: table-caption;
|
167 |
+
font-size: 18px;
|
168 |
+
color: #3499c2;
|
169 |
+
font-weight: bold;
|
170 |
+
margin-bottom: 30px;
|
171 |
}
|
172 |
#opinionstage-content .opinionstage-dashboard-section .opinionstage-section-content-wrapper {
|
173 |
display: block;
|
241 |
height: 18px;
|
242 |
font-size: 19px;
|
243 |
}
|
244 |
+
#opinionstage-section-quiz input[readonly] {
|
245 |
+
width: 100%;
|
246 |
+
background-color: white;
|
247 |
+
padding: 10px;
|
248 |
+
border: 1px solid #c8c8c9;
|
249 |
+
}
|
250 |
+
#opinionstage-section-quiz .os-section-type {
|
251 |
+
margin: 5px 0;
|
252 |
+
}
|
253 |
+
#opinionstage-section-quiz .os-section-type label {
|
254 |
+
margin-right: 25px;
|
255 |
+
}
|
256 |
+
#opinionstage-section-quiz.opinionstage-dashboard-section .opinionstage-section-content-wrapper {
|
257 |
+
padding: 25px;
|
258 |
+
}
|
259 |
+
#opinionstage-section-quiz.opinionstage-dashboard-section .opinionstage-section-content-wrapper .opinionstage-section-content .opinionstage-section-raw {
|
260 |
+
border: none;
|
261 |
+
}
|
262 |
+
#opinionstage-section-quiz.opinionstage-dashboard-section .opinionstage-section-content .opinionstage-section-raw .opinionstage-section-cell {
|
263 |
+
padding: 10px 0;
|
264 |
+
}
|
265 |
+
#opinionstage-section-quiz .opinionstage-section-content .opinionstage-section-raw .opinionstage-section-cell.os-step-details {
|
266 |
+
font-size: 14px;
|
267 |
+
}
|
268 |
+
#opinionstage-section-quiz .opinionstage-section-content .opinionstage-section-raw .opinionstage-section-cell .os-step-title {
|
269 |
+
margin-bottom: 7px;
|
270 |
+
font-weight: bold;
|
271 |
+
}
|
272 |
+
#opinionstage-section-quiz .opinionstage-section-content .opinionstage-section-raw .opinionstage-section-cell.os-step-cell {
|
273 |
+
vertical-align: top;
|
274 |
+
width: 15%;
|
275 |
+
padding: 5px 0;
|
276 |
+
}
|
277 |
+
#opinionstage-section-quiz .opinionstage-section-content .opinionstage-section-raw .opinionstage-section-cell.os-step-cell.os-step-2 {
|
278 |
+
padding-top: 15px;
|
279 |
+
}
|
280 |
+
#opinionstage-section-quiz .opinionstage-section-content .opinionstage-section-raw .opinionstage-section-cell.os-step-cell .os-step {
|
281 |
+
background: url("images/lb-bg.png") no-repeat 0px 0px;
|
282 |
+
width: 35px;
|
283 |
+
height: 30px;
|
284 |
+
padding: 5px 10px;
|
285 |
+
font-size: 14px;
|
286 |
+
color: white;
|
287 |
+
font-weight: bold;
|
288 |
+
}
|
289 |
+
#opinionstage-section-quiz .opinionstage-section-content select.os-page-select {
|
290 |
+
width: 150px;
|
291 |
+
height: 40px;
|
292 |
+
line-height: 40px;
|
293 |
+
margin: 0 5px;
|
294 |
+
}
|
295 |
#opinionstage-section-help .opinionstage-section-content {
|
296 |
+
height: 307px;
|
297 |
}
|
298 |
#opinionstage-section-help .opinionstage-section-cell a {
|
299 |
font-size: 18px;
|
opinionstage-utility-functions.php
CHANGED
@@ -41,6 +41,27 @@ function opinionstage_add_widget($atts) {
|
|
41 |
}
|
42 |
}
|
43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
/**
|
45 |
* Main function for creating the placement html representation.
|
46 |
* Transforms the shortcode parameters to the desired code.
|
@@ -76,9 +97,9 @@ function opinionstage_create_poll_embed_code($id, $type, $width) {
|
|
76 |
$code = get_transient($transient_name);
|
77 |
if ( false === $code || '' === $code ) {
|
78 |
if ($type == 'set') {
|
79 |
-
$embed_code_url = "http://".
|
80 |
} else {
|
81 |
-
$embed_code_url = "http://".
|
82 |
}
|
83 |
|
84 |
if ($is_homepage) {
|
@@ -111,7 +132,7 @@ function opinionstage_create_widget_embed_code($path, $comments, $sharing, $reco
|
|
111 |
$transient_name = 'embed_code' . $path . '.' . $comments . '.' . $sharing . $recommendations . $width;
|
112 |
$code = get_transient($transient_name);
|
113 |
if ( false === $code || '' === $code ) {
|
114 |
-
$embed_code_url = "http://".
|
115 |
|
116 |
extract(opinionstage_get_contents($embed_code_url));
|
117 |
$data = json_decode($raw_data);
|
@@ -124,6 +145,40 @@ function opinionstage_create_widget_embed_code($path, $comments, $sharing, $reco
|
|
124 |
}
|
125 |
return $code;
|
126 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
/**
|
128 |
* Returns the embed code of a placement by fetching it from Opinion Stage api
|
129 |
*/
|
@@ -136,7 +191,7 @@ function opinionstage_create_placement_embed_code($id) {
|
|
136 |
$transient_name = 'embed_code' . $id . '_' . 'placement';
|
137 |
$code = get_transient($transient_name);
|
138 |
if ( false === $code || '' === $code ) {
|
139 |
-
$embed_code_url = "http://".
|
140 |
extract(opinionstage_get_contents($embed_code_url));
|
141 |
$data = json_decode($raw_data);
|
142 |
if ($success) {
|
41 |
}
|
42 |
}
|
43 |
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Main function for creating the feed html representation.
|
47 |
+
* Transforms the shortcode parameters to the desired embed code.
|
48 |
+
*
|
49 |
+
* Syntax as follows:
|
50 |
+
* shortcode name - OPINIONSTAGE_FEED_SHORTCODE
|
51 |
+
*
|
52 |
+
* Arguments:
|
53 |
+
* @param kind - Feed kind - top / mine
|
54 |
+
*
|
55 |
+
*/
|
56 |
+
function opinionstage_add_feed($atts) {
|
57 |
+
extract(shortcode_atts(array('kind' => 'top'), $atts));
|
58 |
+
|
59 |
+
if(!is_feed()) {
|
60 |
+
return opinionstage_create_feed_embed_code($kind);
|
61 |
+
} else {
|
62 |
+
return __('Note: There is a quiz section embedded within this post, please visit the site to view this post\'s quiz section.', OPINIONSTAGE_WIDGET_UNIQUE_ID);
|
63 |
+
}
|
64 |
+
}
|
65 |
/**
|
66 |
* Main function for creating the placement html representation.
|
67 |
* Transforms the shortcode parameters to the desired code.
|
97 |
$code = get_transient($transient_name);
|
98 |
if ( false === $code || '' === $code ) {
|
99 |
if ($type == 'set') {
|
100 |
+
$embed_code_url = "http://".OPINIONSTAGE_API_PATH."/sets/" . $id . "/code.json";
|
101 |
} else {
|
102 |
+
$embed_code_url = "http://".OPINIONSTAGE_API_PATH."/polls/" . $id . "/code.json?width=".$width;
|
103 |
}
|
104 |
|
105 |
if ($is_homepage) {
|
132 |
$transient_name = 'embed_code' . $path . '.' . $comments . '.' . $sharing . $recommendations . $width;
|
133 |
$code = get_transient($transient_name);
|
134 |
if ( false === $code || '' === $code ) {
|
135 |
+
$embed_code_url = "http://".OPINIONSTAGE_API_PATH."/widgets" . $path . "/code.json?comments=".$comments."&sharing=".$sharing."&recommendations=".$recommendations."&width=".$width;
|
136 |
|
137 |
extract(opinionstage_get_contents($embed_code_url));
|
138 |
$data = json_decode($raw_data);
|
145 |
}
|
146 |
return $code;
|
147 |
}
|
148 |
+
|
149 |
+
/**
|
150 |
+
* Create the The HTML code Tag according to the given parameters.
|
151 |
+
*
|
152 |
+
* Arguments:
|
153 |
+
* @param kind - Kind of feed to embed (top content / my content)
|
154 |
+
*/
|
155 |
+
function opinionstage_create_feed_embed_code($kind) {
|
156 |
+
|
157 |
+
// Load embed code from the cache if possible
|
158 |
+
$os_options = (array) get_option(OPINIONSTAGE_OPTIONS_KEY);
|
159 |
+
$email = '';
|
160 |
+
if ($kind == 'my' && !empty($os_options["email"])) {
|
161 |
+
$email = $os_options["email"];
|
162 |
+
$transient_name = 'embed_code_feed_my';
|
163 |
+
} else {
|
164 |
+
$transient_name = 'embed_code_feed_top';
|
165 |
+
}
|
166 |
+
|
167 |
+
$code = get_transient($transient_name);
|
168 |
+
|
169 |
+
if ( false === $code || '' === $code ) {
|
170 |
+
$embed_code_url = "http://".OPINIONSTAGE_API_PATH."/feed/code.json?email=".$email;
|
171 |
+
|
172 |
+
extract(opinionstage_get_contents($embed_code_url));
|
173 |
+
$data = json_decode($raw_data);
|
174 |
+
if ($success) {
|
175 |
+
$code = $data->{'code'};
|
176 |
+
// Set the embed code to be cached for an hour
|
177 |
+
set_transient($transient_name, $code, 3600);
|
178 |
+
}
|
179 |
+
}
|
180 |
+
return $code;
|
181 |
+
}
|
182 |
/**
|
183 |
* Returns the embed code of a placement by fetching it from Opinion Stage api
|
184 |
*/
|
191 |
$transient_name = 'embed_code' . $id . '_' . 'placement';
|
192 |
$code = get_transient($transient_name);
|
193 |
if ( false === $code || '' === $code ) {
|
194 |
+
$embed_code_url = "http://".OPINIONSTAGE_API_PATH."/placements/" . $id . "/code.json";
|
195 |
extract(opinionstage_get_contents($embed_code_url));
|
196 |
$data = json_decode($raw_data);
|
197 |
if ($success) {
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: interactive content, poll plugin, create poll, create polls, quiz plugin,
|
|
5 |
|
6 |
|
7 |
Requires at least: 2.8
|
8 |
-
Tested up to: 4.
|
9 |
Stable tag: trunk
|
10 |
|
11 |
Add a powerful & easy-to-use poll, quiz & list service. Create beautiful polls, quizzes & lists that boost time on site and drive traffic to your site.
|
@@ -248,6 +248,12 @@ You can create many different types of quizzes: Trivia quiz, personality quiz, i
|
|
248 |
N/A
|
249 |
|
250 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
= Poll, Quiz & List Version 15.2.0 =
|
252 |
* Various optimizations
|
253 |
= Poll, Quiz & List Version 15.1.0 =
|
5 |
|
6 |
|
7 |
Requires at least: 2.8
|
8 |
+
Tested up to: 4.5
|
9 |
Stable tag: trunk
|
10 |
|
11 |
Add a powerful & easy-to-use poll, quiz & list service. Create beautiful polls, quizzes & lists that boost time on site and drive traffic to your site.
|
248 |
N/A
|
249 |
|
250 |
== Changelog ==
|
251 |
+
= Poll, Quiz & List Version 15.5.0 =
|
252 |
+
* Support WP 4.5
|
253 |
+
= Poll, Quiz & List Version 15.4.0 =
|
254 |
+
* Added the option to add a content section
|
255 |
+
= Poll, Quiz & List Version 15.3.0 =
|
256 |
+
* Modified API path
|
257 |
= Poll, Quiz & List Version 15.2.0 =
|
258 |
* Various optimizations
|
259 |
= Poll, Quiz & List Version 15.1.0 =
|