Version Description
- Fixed bug in displaying multiple polls in a post
- Fixed bug when using json_encode, it converts utf8 charaters to unicode values in post title but they were not getting escaped properly and thus were not displayed properly in reports or in top rated widget.
Download this release
Release Info
| Developer | eoigal |
| Plugin | |
| Version | 2.0.7 |
| Comparing to | |
| See all releases | |
Code changes from version 2.0.6 to 2.0.7
- polldaddy-org.php +17 -8
- polldaddy.php +2 -2
- rating.php +5 -3
- readme.txt +6 -2
polldaddy-org.php
CHANGED
|
@@ -11,7 +11,7 @@ class WPORG_PollDaddy extends WP_PollDaddy {
|
|
| 11 |
|
| 12 |
function __construct() {
|
| 13 |
parent::__construct();
|
| 14 |
-
$this->version = '2.0.
|
| 15 |
$this->base_url = plugins_url() . '/' . dirname( plugin_basename( __FILE__ ) ) . '/';
|
| 16 |
$this->polldaddy_client_class = 'WPORG_PollDaddy_Client';
|
| 17 |
$this->use_ssl = (int) get_option( 'polldaddy_use_ssl' );
|
|
@@ -378,11 +378,19 @@ if ( !function_exists( 'polldaddy_shortcode_handler' ) ) {
|
|
| 378 |
function polldaddy_add_rating_js() {
|
| 379 |
wp_print_scripts( 'polldaddy-rating-js' );
|
| 380 |
}
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 384 |
}
|
| 385 |
-
|
| 386 |
function polldaddy_add_survey_js() {
|
| 387 |
wp_print_scripts( 'polldaddy-survey-js' );
|
| 388 |
}
|
|
@@ -536,9 +544,10 @@ EOD;
|
|
| 536 |
if ( $no_script )
|
| 537 |
return '<a href="http://polldaddy.com/poll/' . $poll . '/">View This Poll</a>';
|
| 538 |
else {
|
| 539 |
-
|
| 540 |
-
|
| 541 |
-
|
|
|
|
| 542 |
|
| 543 |
return <<<EOD
|
| 544 |
<a name="pd_a_{$poll}"></a><div class="PDS_Poll" id="PDI_container{$poll}" style="display:inline-block;{$float}{$margins}"></div><div id="PD_superContainer"></div>
|
| 11 |
|
| 12 |
function __construct() {
|
| 13 |
parent::__construct();
|
| 14 |
+
$this->version = '2.0.7';
|
| 15 |
$this->base_url = plugins_url() . '/' . dirname( plugin_basename( __FILE__ ) ) . '/';
|
| 16 |
$this->polldaddy_client_class = 'WPORG_PollDaddy_Client';
|
| 17 |
$this->use_ssl = (int) get_option( 'polldaddy_use_ssl' );
|
| 378 |
function polldaddy_add_rating_js() {
|
| 379 |
wp_print_scripts( 'polldaddy-rating-js' );
|
| 380 |
}
|
| 381 |
+
|
| 382 |
+
class pd_poll_shortcodes {
|
| 383 |
+
private $poll_id;
|
| 384 |
+
|
| 385 |
+
public function pd_poll_shortcodes( $poll_id ){
|
| 386 |
+
$this->poll_id = (int) $poll_id;
|
| 387 |
+
}
|
| 388 |
+
|
| 389 |
+
public function polldaddy_add_poll_js() {
|
| 390 |
+
wp_print_scripts( 'polldaddy-poll-js-'. $this->poll_id );
|
| 391 |
+
}
|
| 392 |
}
|
| 393 |
+
|
| 394 |
function polldaddy_add_survey_js() {
|
| 395 |
wp_print_scripts( 'polldaddy-survey-js' );
|
| 396 |
}
|
| 544 |
if ( $no_script )
|
| 545 |
return '<a href="http://polldaddy.com/poll/' . $poll . '/">View This Poll</a>';
|
| 546 |
else {
|
| 547 |
+
|
| 548 |
+
$pd_poll_shortcodes = new pd_poll_shortcodes( $poll );
|
| 549 |
+
wp_register_script( "polldaddy-poll-js-{$poll}", "http://static.polldaddy.com/p/{$poll}.js", array(), $cb, true );
|
| 550 |
+
add_filter( 'wp_footer', array( &$pd_poll_shortcodes, 'polldaddy_add_poll_js' ) );
|
| 551 |
|
| 552 |
return <<<EOD
|
| 553 |
<a name="pd_a_{$poll}"></a><div class="PDS_Poll" id="PDI_container{$poll}" style="display:inline-block;{$float}{$margins}"></div><div id="PD_superContainer"></div>
|
polldaddy.php
CHANGED
|
@@ -6,7 +6,7 @@ Plugin URI: http://wordpress.org/extend/plugins/polldaddy/
|
|
| 6 |
Description: Create and manage Polldaddy polls and ratings in WordPress
|
| 7 |
Author: Automattic, Inc.
|
| 8 |
Author URL: http://automattic.com/
|
| 9 |
-
Version: 2.0.
|
| 10 |
*/
|
| 11 |
|
| 12 |
// You can hardcode your PollDaddy PartnerGUID (API Key) here
|
|
@@ -34,7 +34,7 @@ class WP_PollDaddy {
|
|
| 34 |
global $current_user;
|
| 35 |
$this->errors = new WP_Error;
|
| 36 |
$this->scheme = 'https';
|
| 37 |
-
$this->version = '2.0.
|
| 38 |
$this->multiple_accounts = true;
|
| 39 |
$this->polldaddy_client_class = 'api_client';
|
| 40 |
$this->polldaddy_clients = array();
|
| 6 |
Description: Create and manage Polldaddy polls and ratings in WordPress
|
| 7 |
Author: Automattic, Inc.
|
| 8 |
Author URL: http://automattic.com/
|
| 9 |
+
Version: 2.0.7
|
| 10 |
*/
|
| 11 |
|
| 12 |
// You can hardcode your PollDaddy PartnerGUID (API Key) here
|
| 34 |
global $current_user;
|
| 35 |
$this->errors = new WP_Error;
|
| 36 |
$this->scheme = 'https';
|
| 37 |
+
$this->version = '2.0.7';
|
| 38 |
$this->multiple_accounts = true;
|
| 39 |
$this->polldaddy_client_class = 'api_client';
|
| 40 |
$this->polldaddy_clients = array();
|
rating.php
CHANGED
|
@@ -130,6 +130,8 @@ function polldaddy_get_rating_html( $condition = '' ) {
|
|
| 130 |
function polldaddy_get_rating_code( $rating_id, $unique_id, $title, $permalink, $item_id = '' ) {
|
| 131 |
$rating_id = absint( $rating_id );
|
| 132 |
|
|
|
|
|
|
|
| 133 |
$settings = array(
|
| 134 |
'id' => $rating_id,
|
| 135 |
'unique_id' => $unique_id,
|
|
@@ -140,9 +142,9 @@ function polldaddy_get_rating_code( $rating_id, $unique_id, $title, $permalink,
|
|
| 140 |
if ( !empty( $item_id ) )
|
| 141 |
$settings['item_id'] = $item_id;
|
| 142 |
|
| 143 |
-
$settings = json_encode( $settings );
|
| 144 |
-
|
| 145 |
-
$html
|
| 146 |
<div class="pd-rating" id="pd_rating_holder_{$rating_id}{$item_id}"></div>
|
| 147 |
<script type="text/javascript" charset="UTF-8"><!--//--><![CDATA[//><!--
|
| 148 |
PDRTJS_settings_{$rating_id}{$item_id}={$settings};
|
| 130 |
function polldaddy_get_rating_code( $rating_id, $unique_id, $title, $permalink, $item_id = '' ) {
|
| 131 |
$rating_id = absint( $rating_id );
|
| 132 |
|
| 133 |
+
$html = "\n";
|
| 134 |
+
|
| 135 |
$settings = array(
|
| 136 |
'id' => $rating_id,
|
| 137 |
'unique_id' => $unique_id,
|
| 142 |
if ( !empty( $item_id ) )
|
| 143 |
$settings['item_id'] = $item_id;
|
| 144 |
|
| 145 |
+
$settings = addslashes( json_encode( $settings ) );
|
| 146 |
+
|
| 147 |
+
$html .= <<<EOD
|
| 148 |
<div class="pd-rating" id="pd_rating_holder_{$rating_id}{$item_id}"></div>
|
| 149 |
<script type="text/javascript" charset="UTF-8"><!--//--><