Crowdsignal Dashboard – Polls, Surveys & more - Version 2.0.17

Version Description

Updated ratings settings to allow blog to show rating in search and archive pages

=

Download this release

Release Info

Developer eoigal
Plugin Icon 128x128 Crowdsignal Dashboard – Polls, Surveys & more
Version 2.0.17
Comparing to
See all releases

Code changes from version 2.0.16 to 2.0.17

Files changed (4) hide show
  1. img/polldaddy@2x.png +0 -0
  2. polldaddy.php +120 -114
  3. rating.php +31 -38
  4. readme.txt +7 -3
img/polldaddy@2x.png ADDED
Binary file
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.16
10
  */
11
 
12
  // You can hardcode your Polldaddy PartnerGUID (API Key) here
@@ -35,12 +35,13 @@ class WP_Polldaddy {
35
  $this->log( 'Created WP_Polldaddy Object: constructor' );
36
  $this->errors = new WP_Error;
37
  $this->scheme = 'https';
38
- $this->version = '2.0.16';
39
  $this->multiple_accounts = true;
40
  $this->polldaddy_client_class = 'api_client';
41
  $this->polldaddy_clients = array();
42
  $this->is_admin = (bool) current_user_can( 'manage_options' );
43
  $this->is_author = (bool) current_user_can( 'edit_posts' );
 
44
  $this->user_code = null;
45
  $this->rating_user_code = null;
46
  $this->id = ($current_user instanceof WP_User) ? intval( $current_user->ID ): 0;
@@ -62,7 +63,7 @@ class WP_Polldaddy {
62
  return $client;
63
  }
64
 
65
- function admin_menu() {
66
  add_action( 'admin_head', array( &$this, 'do_admin_css' ) );
67
 
68
  if ( !defined( 'WP_POLLDADDY__PARTNERGUID' ) ) {
@@ -213,9 +214,11 @@ class WP_Polldaddy {
213
  if ( $polldaddy->errors )
214
  foreach ( $polldaddy->errors as $code => $error )
215
  $this->errors->add( $code, $error );
 
216
  if ( isset( $this->errors->errors[4] ) ) {
217
- $this->errors->errors[4] = array( sprintf( __( 'Obsolete Polldaddy User API Key: <a href="%s">Sign in again to re-authenticate</a>', 'polldaddy' ), add_query_arg( array( 'action' => 'signup', 'reaction' => empty( $_GET['action'] ) ? false : $_GET['action'] ) ) ) );
218
- $this->errors->add_data( true, 4 );
 
219
  }
220
  }
221
 
@@ -291,7 +294,7 @@ class WP_Polldaddy {
291
 
292
  function media_buttons() {
293
  $title = __( 'Add Poll', 'polldaddy' );
294
- echo "<a href='admin.php?page=polls&amp;iframe&amp;TB_iframe=true' onclick='return false;' id='add_poll' class='thickbox' title='$title'><img src='{$this->base_url}img/polldaddy.png' alt='$title' /></a>";
295
  }
296
 
297
  function set_api_user_code() {
@@ -1664,7 +1667,7 @@ src="http://static.polldaddy.com/p/<?php echo (int) $poll_id; ?>.js"&gt;&lt;/scr
1664
  <ul id="answer-options">
1665
 
1666
  <?php
1667
- foreach ( array( 'randomiseAnswers' => __( 'Randomize answer order', 'polldaddy' ), 'otherAnswer' => __( 'Allow other answers', 'polldaddy' ), 'multipleChoice' => __( 'Multiple choice', 'polldaddy' ) ) as $option => $label ) :
1668
  if ( $is_POST )
1669
  $checked = 'yes' === $_POST[$option] ? ' checked="checked"' : '';
1670
  else
@@ -3759,94 +3762,101 @@ src="http://static.polldaddy.com/p/<?php echo (int) $poll_id; ?>.js"&gt;&lt;/scr
3759
  $this_class = ' class="tabs"'; ?>
3760
  <li <?php echo $this_class; ?>><a href="<?php echo $comments_link; ?>"><?php _e( 'Comments', 'polldaddy' );?></a></li>
3761
  </ul>
3762
- <div class="tabs-panel" id="categories-all" style="background: #FFFFFF;height: auto; overflow: visible;">
3763
  <form action="" method="post">
3764
  <input type="hidden" name="pd_rating_action_type" value="<?php echo $report_type; ?>" />
3765
  <table class="form-table" style="width: normal;">
3766
  <tbody><?php
3767
  if ( $report_type == 'posts' ) { ?>
3768
  <tr valign="top">
3769
- <td style="padding-left: 0px; padding-right: 0px; padding-top: 7px;">
3770
- <label for="pd_show_posts">
3771
- <input type="checkbox" name="pd_show_posts" id="pd_show_posts" <?php if ( $show_posts > 0 ) echo ' checked="checked" '; ?> value="1" /> <?php _e( 'Enable for blog posts', 'polldaddy' );?>
3772
- </label>
3773
- <span id="span_posts">
3774
- <select name="posts_pos"><?php
3775
- $select = array( __( 'Above each blog post', 'polldaddy' ) => '0', __( 'Below each blog post', 'polldaddy' ) => '1' );
3776
- foreach ( $select as $option => $value ) :
3777
- $selected = '';
3778
- if ( $value == $pos_posts )
3779
- $selected = ' selected="selected"';
3780
- echo '<option value="' . $value . '" ' . $selected . '>' . $option . '</option>';
3781
- endforeach;?>
3782
- </select>
3783
- </span>
3784
- </td>
3785
- </tr>
3786
- <tr valign="top">
3787
- <td style="padding-left: 0px; padding-right: 0px; padding-top: 7px;">
3788
- <label for="pd_show_posts_index">
3789
- <input type="checkbox" name="pd_show_posts_index" id="pd_show_posts_index" <?php if ( $show_posts_index > 0 ) echo ' checked="checked" '; ?> value="1" /> <?php _e( 'Enable for front page', 'polldaddy' );?>
3790
- </label>
3791
- <span id="span_posts">
3792
- <select name="posts_index_pos"><?php
3793
- $select = array( __( 'Above each blog post', 'polldaddy' ) => '0', __( 'Below each blog post', 'polldaddy' ) => '1' );
3794
- foreach ( $select as $option => $value ) :
3795
- $selected = '';
3796
- if ( $value == $pos_posts_index )
3797
- $selected = ' selected="selected"';
3798
- echo '<option value="' . $value . '" ' . $selected . '>' . $option . '</option>';
3799
- endforeach;?>
3800
- </select>
3801
- </span>
3802
- </td>
3803
- </tr><?php
3804
  }
3805
  if ( $report_type == 'pages' ) {?>
3806
- <tr valign="top">
3807
- <td style="padding-left: 0px; padding-right: 0px; padding-top: 7px;">
3808
- <label for="pd_show_pages">
3809
- <input type="checkbox" name="pd_show_pages" id="pd_show_pages" <?php if ( $show_pages > 0 ) echo ' checked="checked" '; ?> value="1" /> <?php _e( 'Enable for pages', 'polldaddy' );?>
3810
- </label>
3811
- <span id="span_pages">
3812
- <select name="pages_pos"><?php
3813
- $select = array( __( 'Above each page', 'polldaddy' ) => '0', __( 'Below each page', 'polldaddy' ) => '1' );
3814
- foreach ( $select as $option => $value ) :
3815
- $selected = '';
3816
- if ( $value == $pos_pages )
3817
- $selected = ' selected="selected"';
3818
- echo '<option value="' . $value . '" ' . $selected . '>' . $option . '</option>';
3819
- endforeach; ?>
3820
- </select>
3821
- </span>
3822
- </td>
3823
- </tr><?php
 
 
3824
  }
3825
  if ( $report_type == 'comments' ) {?>
3826
- <tr valign="top">
3827
- <td style="padding-left: 0px; padding-right: 0px; padding-top: 7px;">
3828
- <label for="pd_show_comments">
3829
- <input type="checkbox" name="pd_show_comments" id="pd_show_comments" <?php if ( $show_comments > 0 ) echo ' checked="checked" '; ?> value="1" /> <?php _e( 'Enable for comments', 'polldaddy' );?>
3830
- </label>
3831
- <span id="span_comments">
3832
- <select name="comments_pos"><?php
3833
- $select = array( __( 'Above each comment', 'polldaddy' ) => '0', __( 'Below each comment', 'polldaddy' ) => '1' );
3834
- foreach ( $select as $option => $value ) :
3835
- $selected = '';
3836
- if ( $value == $pos_comments )
3837
- $selected = ' selected="selected"';
3838
- echo '<option value="' . $value . '" ' . $selected . '>' . $option . '</option>';
3839
- endforeach; ?>
3840
- </select>
3841
- </span>
3842
- </td>
3843
- </tr><?php
 
 
3844
  } ?>
 
 
 
3845
  </tbody>
3846
  </table>
3847
- <p class="submit">
3848
- <input class="button-primary" type="submit" value="<?php esc_attr_e( 'Save Changes', 'polldaddy' );?>" name="Submit" />
3849
- </p><?php
 
3850
  if ( $report_type == 'posts' ) {
3851
  if ( $show_posts > 0 || $show_posts_index > 0 )
3852
  $show_settings = true;
@@ -3856,9 +3866,7 @@ src="http://static.polldaddy.com/p/<?php echo (int) $poll_id; ?>.js"&gt;&lt;/scr
3856
  if ( $report_type == 'comments' && $show_comments > 0 )
3857
  $show_settings = true;
3858
  if ( $show_settings == true )
3859
- echo '<a href="javascript:" onclick="show_settings();">'.__( 'Advanced Settings', 'polldaddy' ).'</a>';?>
3860
- </form>
3861
- </div>
3862
  </div>
3863
  </div>
3864
 
@@ -3868,20 +3876,20 @@ src="http://static.polldaddy.com/p/<?php echo (int) $poll_id; ?>.js"&gt;&lt;/scr
3868
  <div id="poststuff" style="<?php echo $settings_style; ?>">
3869
  <div class="has-sidebar has-right-sidebar">
3870
  <div class="inner-sidebar-ratings">
3871
- <div class="postbox" id="submitdiv">
3872
- <h3><?php _e( 'Save', 'polldaddy' );?></h3>
3873
- <div class="inside">
3874
- <div id="major- -actions">
3875
- <input type="hidden" name="type" value="<?php echo $report_type; ?>" />
3876
- <input type="hidden" name="rating_id" value="<?php echo $rating_id; ?>" />
3877
- <input type="hidden" name="action" value="update-rating" />
3878
- <p id="publishing-action">
3879
- <input type="submit" value="<?php _e( 'Save Changes', 'polldaddy' );?>" class="button-primary"/>
3880
- </p>
3881
- <br class="clear"/>
3882
- </div>
3883
- </div>
3884
- </div>
3885
  <div class="postbox">
3886
  <h3><?php _e( 'Preview', 'polldaddy' );?></h3>
3887
  <div class="inside">
@@ -4550,6 +4558,7 @@ src="http://static.polldaddy.com/p/<?php echo (int) $poll_id; ?>.js"&gt;&lt;/scr
4550
  <form method="post" action="">
4551
  <div class="tablenav">
4552
  <div class="alignleft actions">
 
4553
  <select name="action">
4554
  <option selected="selected" value=""><?php _e( 'Actions', 'polldaddy' ); ?></option>
4555
  <option value="delete"><?php _e( 'Delete', 'polldaddy' ); ?></option>
@@ -4557,6 +4566,7 @@ src="http://static.polldaddy.com/p/<?php echo (int) $poll_id; ?>.js"&gt;&lt;/scr
4557
  <input type="hidden" name="id" id="id" value="<?php echo (int) $rating_id; ?>" />
4558
  <input class="button-secondary action" type="submit" name="doaction" value="<?php _e( 'Apply', 'polldaddy' ); ?>" />
4559
  <?php wp_nonce_field( 'action-rating_bulk' ); ?>
 
4560
  <select name="change-report-to"><?php
4561
  $select = array( __( 'Posts', 'polldaddy' ) => "posts", __( 'Pages', 'polldaddy' ) => "pages", __( 'Comments', 'polldaddy' ) => "comments" );
4562
  foreach ( $select as $option => $value ) :
@@ -4601,7 +4611,11 @@ src="http://static.polldaddy.com/p/<?php echo (int) $poll_id; ?>.js"&gt;&lt;/scr
4601
  } else { ?>
4602
  <thead>
4603
  <tr>
 
4604
  <th scope="col" class="manage-column column-cb check-column" id="cb"><input type="checkbox"></th>
 
 
 
4605
  <th scope="col" class="manage-column column-title" id="title"><?php _e( 'Title', 'polldaddy' );?></th>
4606
  <th scope="col" class="manage-column column-id" id="id"><?php _e( 'Unique ID', 'polldaddy' );?></th>
4607
  <th scope="col" class="manage-column column-date" id="date"><?php _e( 'Start Date', 'polldaddy' );?></th>
@@ -4621,7 +4635,7 @@ src="http://static.polldaddy.com/p/<?php echo (int) $poll_id; ?>.js"&gt;&lt;/scr
4621
  <td class="post-title column-title">
4622
  <strong><a href="<?php echo esc_url( $rating->permalink ); ?>"><?php echo strlen( esc_html( $rating->title ) ) > 75 ? substr( esc_html( $rating->title ), 0, 72 ) . '&hellip' : esc_html( $rating->title ); ?></a></strong>
4623
  <div class="row-actions">
4624
- <?php if ( $delete_link ) { ?>
4625
  <span class="delete"><a class="delete-rating delete" href="<?php echo $delete_link; ?>"><?php _e( 'Delete', 'polldaddy' ); ?></a></span>
4626
  <?php } ?>
4627
  </div>
@@ -4837,20 +4851,12 @@ src="http://static.polldaddy.com/p/<?php echo (int) $poll_id; ?>.js"&gt;&lt;/scr
4837
  <td>
4838
  <fieldset>
4839
  <legend class="screen-reader-text"><span>poll-defaults</span></legend><?php
4840
- $selected = '';
4841
- if ( $poll->multipleChoice == 'yes' )
4842
- $selected = 'checked="checked"';?>
4843
- <label for="multipleChoice"><input type="checkbox" <?php echo $selected; ?> value="1" id="multipleChoice" name="multipleChoice"> <?php _e( 'Multiple Choice', 'polldaddy' ); ?></label>
4844
- <br /><?php
4845
- $selected = '';
4846
- if ( $poll->randomiseAnswers == 'yes' )
4847
- $selected = 'checked="checked"';?>
4848
- <label for="randomiseAnswers"><input type="checkbox" <?php echo $selected; ?> value="1" id="randomiseAnswers" name="randomiseAnswers"> <?php _e( 'Randomise Answers', 'polldaddy' ); ?></label>
4849
- <br /><?php
4850
- $selected = '';
4851
- if ( $poll->otherAnswer == 'yes' )
4852
- $selected = 'checked="checked"';?>
4853
- <label for="otherAnswer"><input type="checkbox" <?php echo $selected; ?> value="1" id="otherAnswer" name="otherAnswer"> <?php _e( 'Other Answer', 'polldaddy' ); ?></label>
4854
  <br class="clear" />
4855
  <br class="clear" />
4856
  <div class="field">
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.17
10
  */
11
 
12
  // You can hardcode your Polldaddy PartnerGUID (API Key) here
35
  $this->log( 'Created WP_Polldaddy Object: constructor' );
36
  $this->errors = new WP_Error;
37
  $this->scheme = 'https';
38
+ $this->version = '2.0.17';
39
  $this->multiple_accounts = true;
40
  $this->polldaddy_client_class = 'api_client';
41
  $this->polldaddy_clients = array();
42
  $this->is_admin = (bool) current_user_can( 'manage_options' );
43
  $this->is_author = (bool) current_user_can( 'edit_posts' );
44
+ $this->is_editor = (bool) current_user_can( 'delete_others_pages' );
45
  $this->user_code = null;
46
  $this->rating_user_code = null;
47
  $this->id = ($current_user instanceof WP_User) ? intval( $current_user->ID ): 0;
63
  return $client;
64
  }
65
 
66
+ function admin_menu() {
67
  add_action( 'admin_head', array( &$this, 'do_admin_css' ) );
68
 
69
  if ( !defined( 'WP_POLLDADDY__PARTNERGUID' ) ) {
214
  if ( $polldaddy->errors )
215
  foreach ( $polldaddy->errors as $code => $error )
216
  $this->errors->add( $code, $error );
217
+
218
  if ( isset( $this->errors->errors[4] ) ) {
219
+ //need to get latest usercode
220
+ update_option( 'pd-usercode-'.$this->id, '' );
221
+ $this->set_api_user_code();
222
  }
223
  }
224
 
294
 
295
  function media_buttons() {
296
  $title = __( 'Add Poll', 'polldaddy' );
297
+ echo "<a href='admin.php?page=polls&amp;iframe&amp;TB_iframe=true' onclick='return false;' id='add_poll' class='thickbox' title='$title'><img src='{$this->base_url}img/polldaddy@2x.png' width='15' height='15' alt='$title' style='padding:0 7px 0 2px;' /></a>";
298
  }
299
 
300
  function set_api_user_code() {
1667
  <ul id="answer-options">
1668
 
1669
  <?php
1670
+ foreach ( array( 'randomiseAnswers' => __( 'Randomize answer order', 'polldaddy' ), 'otherAnswer' => __( 'Allow other answers', 'polldaddy' ), 'multipleChoice' => __( 'Multiple choice', 'polldaddy' ), 'sharing' => __( 'Sharing', 'polldaddy' ) ) as $option => $label ) :
1671
  if ( $is_POST )
1672
  $checked = 'yes' === $_POST[$option] ? ' checked="checked"' : '';
1673
  else
3762
  $this_class = ' class="tabs"'; ?>
3763
  <li <?php echo $this_class; ?>><a href="<?php echo $comments_link; ?>"><?php _e( 'Comments', 'polldaddy' );?></a></li>
3764
  </ul>
3765
+ <div class="tabs-panel" id="categories-all" style="background: #FFFFFF;height: auto; overflow: visible;max-height:400px;">
3766
  <form action="" method="post">
3767
  <input type="hidden" name="pd_rating_action_type" value="<?php echo $report_type; ?>" />
3768
  <table class="form-table" style="width: normal;">
3769
  <tbody><?php
3770
  if ( $report_type == 'posts' ) { ?>
3771
  <tr valign="top">
3772
+ <th scope="row"><label><?php _e( 'Show Ratings on', 'polldaddy' );?></label></th>
3773
+ <td>
3774
+ <label><input type="checkbox" name="pd_show_posts_index" id="pd_show_posts_index" <?php if ( $show_posts_index > 0 ) echo ' checked="checked" '; ?> value="1" /> <?php _e( 'Front Page, Archive Pages, and Search Results', 'polldaddy' );?></label>
3775
+ <br><label><input type="checkbox" name="pd_show_posts" id="pd_show_posts" <?php if ( $show_posts > 0 ) echo ' checked="checked" '; ?> value="1" /> <?php _e( 'Posts', 'polldaddy' );?></label>
3776
+ </td>
3777
+ </tr>
3778
+ <tr valign="top">
3779
+ <th scope="row"><label><?php _e( 'Position Front Page, Archive Pages, and Search Results Ratings', 'polldaddy' );?></label></th>
3780
+ <td>
3781
+ <select name="posts_index_pos"><?php
3782
+ $select = array( __( 'Above each blog post', 'polldaddy' ) => '0', __( 'Below each blog post', 'polldaddy' ) => '1' );
3783
+ foreach ( $select as $option => $value ) :
3784
+ $selected = '';
3785
+ if ( $value == $pos_posts_index )
3786
+ $selected = ' selected="selected"';
3787
+ echo '<option value="' . $value . '" ' . $selected . '>' . $option . '</option>';
3788
+ endforeach;?>
3789
+ </select>
3790
+ </td>
3791
+ </tr>
3792
+ <tr valign="top">
3793
+ <th scope="row"><label><?php _e( 'Position Post Ratings', 'polldaddy' );?></label></th>
3794
+ <td>
3795
+ <select name="posts_pos"><?php
3796
+ $select = array( __( 'Above each blog post', 'polldaddy' ) => '0', __( 'Below each blog post', 'polldaddy' ) => '1' );
3797
+ foreach ( $select as $option => $value ) :
3798
+ $selected = '';
3799
+ if ( $value == $pos_posts )
3800
+ $selected = ' selected="selected"';
3801
+ echo '<option value="' . $value . '" ' . $selected . '>' . $option . '</option>';
3802
+ endforeach;?>
3803
+ </select>
3804
+ </td>
3805
+ </tr><?php
 
3806
  }
3807
  if ( $report_type == 'pages' ) {?>
3808
+ <tr valign="top">
3809
+ <th scope="row"><label><?php _e( 'Show Ratings on', 'polldaddy' );?></label></th>
3810
+ <td>
3811
+ <label><input type="checkbox" name="pd_show_pages" id="pd_show_pages" <?php if ( $show_pages > 0 ) echo ' checked="checked" '; ?> value="1" /> <?php _e( 'Pages', 'polldaddy' );?></label>
3812
+ </td>
3813
+ </tr>
3814
+ <tr valign="top">
3815
+ <th scope="row"><label><?php _e( 'Position Page Ratings', 'polldaddy' );?></label></th>
3816
+ <td>
3817
+ <select name="pages_pos"><?php
3818
+ $select = array( __( 'Above each blog page', 'polldaddy' ) => '0', __( 'Below each blog page', 'polldaddy' ) => '1' );
3819
+ foreach ( $select as $option => $value ) :
3820
+ $selected = '';
3821
+ if ( $value == $pos_pages )
3822
+ $selected = ' selected="selected"';
3823
+ echo '<option value="' . $value . '" ' . $selected . '>' . $option . '</option>';
3824
+ endforeach;?>
3825
+ </select>
3826
+ </td>
3827
+ </tr><?php
3828
  }
3829
  if ( $report_type == 'comments' ) {?>
3830
+ <tr valign="top">
3831
+ <th scope="row"><label><?php _e( 'Show Ratings on', 'polldaddy' );?></label></th>
3832
+ <td>
3833
+ <label><input type="checkbox" name="pd_show_comments" id="pd_show_comments" <?php if ( $show_comments > 0 ) echo ' checked="checked" '; ?> value="1" /> <?php _e( 'Comments', 'polldaddy' );?></label>
3834
+ </td>
3835
+ </tr>
3836
+ <tr valign="top">
3837
+ <th scope="row"><label><?php _e( 'Position Comment Ratings', 'polldaddy' );?></label></th>
3838
+ <td>
3839
+ <select name="comments_pos"><?php
3840
+ $select = array( __( 'Above each comment', 'polldaddy' ) => '0', __( 'Below each comment', 'polldaddy' ) => '1' );
3841
+ foreach ( $select as $option => $value ) :
3842
+ $selected = '';
3843
+ if ( $value == $pos_comments )
3844
+ $selected = ' selected="selected"';
3845
+ echo '<option value="' . $value . '" ' . $selected . '>' . $option . '</option>';
3846
+ endforeach;?>
3847
+ </select>
3848
+ </td>
3849
+ </tr><?php
3850
  } ?>
3851
+ <tr valign="top">
3852
+ <td height="30"><input class="button-primary" type="submit" value="<?php esc_attr_e( 'Save Changes', 'polldaddy' );?>" name="Submit" /></td>
3853
+ </tr>
3854
  </tbody>
3855
  </table>
3856
+ </form>
3857
+ </div>
3858
+
3859
+ <div style="padding:20px 0px 0px 0px"><?php
3860
  if ( $report_type == 'posts' ) {
3861
  if ( $show_posts > 0 || $show_posts_index > 0 )
3862
  $show_settings = true;
3866
  if ( $report_type == 'comments' && $show_comments > 0 )
3867
  $show_settings = true;
3868
  if ( $show_settings == true )
3869
+ echo '<a href="javascript:" onclick="show_settings();">'.__( 'Advanced Settings', 'polldaddy' ).'</a>';?></div>
 
 
3870
  </div>
3871
  </div>
3872
 
3876
  <div id="poststuff" style="<?php echo $settings_style; ?>">
3877
  <div class="has-sidebar has-right-sidebar">
3878
  <div class="inner-sidebar-ratings">
3879
+ <div id="submitdiv" class="postbox ">
3880
+ <h3 class="hndle"><span><?php _e( 'Save Advanced Settings', 'polldaddy' );?></span></h3>
3881
+
3882
+ <div class="inside">
3883
+ <div class="submitbox" id="submitpost">
3884
+ <div id="minor-publishing" style="padding:10px;">
3885
+ <input type="submit" name="save_menu" id="save_menu_header" class="button button-primary menu-save" value="<?php echo esc_attr( __( 'Save Changes', 'polldaddy' ) );?>">
3886
+ <input type="hidden" name="type" value="<?php echo $report_type; ?>" />
3887
+ <input type="hidden" name="rating_id" value="<?php echo $rating_id; ?>" />
3888
+ <input type="hidden" name="action" value="update-rating" />
3889
+ </div>
3890
+ </div>
3891
+ </div>
3892
+ </div>
3893
  <div class="postbox">
3894
  <h3><?php _e( 'Preview', 'polldaddy' );?></h3>
3895
  <div class="inside">
4558
  <form method="post" action="">
4559
  <div class="tablenav">
4560
  <div class="alignleft actions">
4561
+ <?php if ( $this->is_editor ) { ?>
4562
  <select name="action">
4563
  <option selected="selected" value=""><?php _e( 'Actions', 'polldaddy' ); ?></option>
4564
  <option value="delete"><?php _e( 'Delete', 'polldaddy' ); ?></option>
4566
  <input type="hidden" name="id" id="id" value="<?php echo (int) $rating_id; ?>" />
4567
  <input class="button-secondary action" type="submit" name="doaction" value="<?php _e( 'Apply', 'polldaddy' ); ?>" />
4568
  <?php wp_nonce_field( 'action-rating_bulk' ); ?>
4569
+ <?php } ?>
4570
  <select name="change-report-to"><?php
4571
  $select = array( __( 'Posts', 'polldaddy' ) => "posts", __( 'Pages', 'polldaddy' ) => "pages", __( 'Comments', 'polldaddy' ) => "comments" );
4572
  foreach ( $select as $option => $value ) :
4611
  } else { ?>
4612
  <thead>
4613
  <tr>
4614
+ <?php if ( $this->is_editor ) { ?>
4615
  <th scope="col" class="manage-column column-cb check-column" id="cb"><input type="checkbox"></th>
4616
+ <?php } else { ?>
4617
+ <th scope="col" class="manage-column column-cb check-column" id="cb"></th>
4618
+ <?php } ?>
4619
  <th scope="col" class="manage-column column-title" id="title"><?php _e( 'Title', 'polldaddy' );?></th>
4620
  <th scope="col" class="manage-column column-id" id="id"><?php _e( 'Unique ID', 'polldaddy' );?></th>
4621
  <th scope="col" class="manage-column column-date" id="date"><?php _e( 'Start Date', 'polldaddy' );?></th>
4635
  <td class="post-title column-title">
4636
  <strong><a href="<?php echo esc_url( $rating->permalink ); ?>"><?php echo strlen( esc_html( $rating->title ) ) > 75 ? substr( esc_html( $rating->title ), 0, 72 ) . '&hellip' : esc_html( $rating->title ); ?></a></strong>
4637
  <div class="row-actions">
4638
+ <?php if ( $this->is_editor && $delete_link ) { ?>
4639
  <span class="delete"><a class="delete-rating delete" href="<?php echo $delete_link; ?>"><?php _e( 'Delete', 'polldaddy' ); ?></a></span>
4640
  <?php } ?>
4641
  </div>
4851
  <td>
4852
  <fieldset>
4853
  <legend class="screen-reader-text"><span>poll-defaults</span></legend><?php
4854
+ foreach ( array( 'randomiseAnswers' => __( 'Randomize answer order', 'polldaddy' ), 'otherAnswer' => __( 'Allow other answers', 'polldaddy' ), 'multipleChoice' => __( 'Multiple choice', 'polldaddy' ), 'sharing' => __( 'Sharing', 'polldaddy' ) ) as $option => $label ) :
4855
+ $checked = 'yes' === $poll->$option ? ' checked="checked"' : '';
4856
+ ?>
4857
+ <label for="<?php echo $option; ?>"><input type="checkbox"<?php echo $checked; ?> value="1" id="<?php echo $option; ?>" name="<?php echo $option; ?>" /> <?php echo esc_html( $label ); ?></label><br />
4858
+
4859
+ <?php endforeach; ?>
 
 
 
 
 
 
 
 
4860
  <br class="clear" />
4861
  <br class="clear" />
4862
  <div class="field">
rating.php CHANGED
@@ -4,18 +4,18 @@ function polldaddy_show_rating_comments( $content ) {
4
  global $comment;
5
  global $post;
6
 
7
- if ( $comment->comment_ID > 0 ) {
8
- $unique_id = '';
9
- $title = '';
10
- $permalink = '';
11
- $html = '';
12
  $rating_pos = 0;
13
 
14
  if ( (int) get_option( 'pd-rating-comments' ) > 0 ) {
15
  $rating_id = (int) get_option( 'pd-rating-comments' );
16
  $unique_id = 'wp-comment-' . $comment->comment_ID;
17
  $rating_pos = (int) get_option( 'pd-rating-comments-pos' );
18
- $title = mb_substr( preg_replace( '/[\x00-\x1F\x80-\xFF]/', '', $comment->comment_content ), 0, 195 ) . '...';
19
  $permalink = get_permalink( $post->ID ) . '#comment-' . $comment->comment_ID;
20
  $html = polldaddy_get_rating_code( $rating_id, $unique_id, $title, $permalink, '_comm_' . $comment->comment_ID );
21
 
@@ -30,25 +30,28 @@ function polldaddy_show_rating_comments( $content ) {
30
  }
31
 
32
  function polldaddy_show_rating( $content ) {
33
- if ( !is_feed() && !is_attachment() ) {
34
- if ( is_single() || is_page() || is_home() || is_archive() || is_category() ) {
35
- $html = polldaddy_get_rating_html( 'check-options' );
36
-
37
- if ( !empty( $html ) ) {
38
- $rating_pos = 0;
39
-
40
- if ( is_page() ) {
41
- $rating_pos = (int) get_option( 'pd-rating-pages-pos' );
42
- } elseif ( is_home() || is_archive() || is_category() ) {
43
- $rating_pos = (int) get_option( 'pd-rating-posts-index-pos' );
44
- } else {
45
- $rating_pos = (int) get_option( 'pd-rating-posts-pos' );
 
 
 
 
 
 
 
 
46
  }
47
-
48
- if ( $rating_pos == 0 )
49
- $content = $html . '<br/>' . $content;
50
- else
51
- $content .= $html;
52
  }
53
  }
54
  }
@@ -83,7 +86,7 @@ function polldaddy_get_rating_html( $condition = '' ) {
83
  } elseif ( !in_array( $post->ID, $exclude_posts ) ) {
84
  $unique_id = 'wp-post-' . $post->ID;
85
  $item_id = '_post_' . $post->ID;
86
- if ( is_home() || is_archive() || is_category() ) {
87
  if ( $condition == 'check-options' ) {
88
  if ( (int) get_option( 'pd-rating-posts-index' ) > 0 ) {
89
  $rating_id = (int) get_option( 'pd-rating-posts-id' );
@@ -106,9 +109,9 @@ function polldaddy_get_rating_html( $condition = '' ) {
106
  $rating_title_filter = get_option( 'pd-rating-title-filter' );
107
 
108
  if ( $rating_title_filter === false )
109
- $title = apply_filters( 'wp_title', $post->post_title, '', '' );
110
  elseif ( strlen( $rating_title_filter ) > 0 )
111
- $title = apply_filters( $rating_title_filter, $post->post_title );
112
  else
113
  $title = $post->post_title;
114
 
@@ -140,19 +143,9 @@ function polldaddy_sanitize_shortcode( $text ) {
140
  return esc_attr( $text );
141
  }
142
 
143
- function polldaddy_show_rating_excerpt( $content ) {
144
- remove_filter( 'the_content', 'polldaddy_show_rating', 5 );
145
- return $content;
146
- }
147
-
148
- function polldaddy_show_rating_excerpt_for_real( $content ) {
149
- return polldaddy_show_rating( $content );
150
- }
151
-
152
  if ( (int) get_option( 'pd-rating-pages' ) > 0 || (int) get_option( 'pd-rating-posts-index' ) > 0 || (int) get_option( 'pd-rating-posts' ) > 0 ) {
153
  add_filter( 'the_content', 'polldaddy_show_rating', 5 );
154
- add_filter( 'get_the_excerpt', 'polldaddy_show_rating_excerpt', 5 );
155
- add_filter( 'the_excerpt', 'polldaddy_show_rating_excerpt_for_real' );
156
  }
157
 
158
  add_filter( 'comment_text', 'polldaddy_show_rating_comments', 50 );
4
  global $comment;
5
  global $post;
6
 
7
+ if ( isset( $comment->comment_ID ) && $comment->comment_ID > 0 ) {
8
+ $unique_id = '';
9
+ $title = '';
10
+ $permalink = '';
11
+ $html = '';
12
  $rating_pos = 0;
13
 
14
  if ( (int) get_option( 'pd-rating-comments' ) > 0 ) {
15
  $rating_id = (int) get_option( 'pd-rating-comments' );
16
  $unique_id = 'wp-comment-' . $comment->comment_ID;
17
  $rating_pos = (int) get_option( 'pd-rating-comments-pos' );
18
+ $title = mb_substr( preg_replace( '/[\x00-\x1F\x80-\xFF]/', '', $comment->comment_content ), 0, 195 ) . '';
19
  $permalink = get_permalink( $post->ID ) . '#comment-' . $comment->comment_ID;
20
  $html = polldaddy_get_rating_code( $rating_id, $unique_id, $title, $permalink, '_comm_' . $comment->comment_ID );
21
 
30
  }
31
 
32
  function polldaddy_show_rating( $content ) {
33
+ global $wp_current_filter;
34
+ if ( !in_array( 'get_the_excerpt', (array) $wp_current_filter ) ) {
35
+ if ( !is_feed() && !is_attachment() ) {
36
+ if ( is_single() || is_page() || is_home() || is_archive() || is_search() || is_category() ) {
37
+ $html = polldaddy_get_rating_html( 'check-options' );
38
+
39
+ if ( !empty( $html ) ) {
40
+ $rating_pos = 0;
41
+
42
+ if ( is_page() ) {
43
+ $rating_pos = (int) get_option( 'pd-rating-pages-pos' );
44
+ } elseif ( is_home() || is_archive() || is_search() || is_category() ) {
45
+ $rating_pos = (int) get_option( 'pd-rating-posts-index-pos' );
46
+ } else {
47
+ $rating_pos = (int) get_option( 'pd-rating-posts-pos' );
48
+ }
49
+
50
+ if ( $rating_pos == 0 )
51
+ $content = $html . '<br/>' . $content;
52
+ else
53
+ $content .= $html;
54
  }
 
 
 
 
 
55
  }
56
  }
57
  }
86
  } elseif ( !in_array( $post->ID, $exclude_posts ) ) {
87
  $unique_id = 'wp-post-' . $post->ID;
88
  $item_id = '_post_' . $post->ID;
89
+ if ( is_home() || is_archive() || is_search() || is_category() ) {
90
  if ( $condition == 'check-options' ) {
91
  if ( (int) get_option( 'pd-rating-posts-index' ) > 0 ) {
92
  $rating_id = (int) get_option( 'pd-rating-posts-id' );
109
  $rating_title_filter = get_option( 'pd-rating-title-filter' );
110
 
111
  if ( $rating_title_filter === false )
112
+ $title = apply_filters( 'the_title', $post->post_title, $post->ID, '' );
113
  elseif ( strlen( $rating_title_filter ) > 0 )
114
+ $title = apply_filters( $rating_title_filter, $post->post_title, $post->ID, '' );
115
  else
116
  $title = $post->post_title;
117
 
143
  return esc_attr( $text );
144
  }
145
 
 
 
 
 
 
 
 
 
 
146
  if ( (int) get_option( 'pd-rating-pages' ) > 0 || (int) get_option( 'pd-rating-posts-index' ) > 0 || (int) get_option( 'pd-rating-posts' ) > 0 ) {
147
  add_filter( 'the_content', 'polldaddy_show_rating', 5 );
148
+ add_filter( 'the_excerpt', 'polldaddy_show_rating' );
 
149
  }
150
 
151
  add_filter( 'comment_text', 'polldaddy_show_rating_comments', 50 );
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: eoigal, alternatekev, mdawaffe, donncha, johnny5
3
  Tags: polls, poll, polldaddy, wppolls, vote, polling, surveys, rate, rating, ratings
4
  Requires at least: 3.2
5
  Tested up to: 3.5
6
- Stable tag: 2.0.16
7
 
8
  Create and manage Polldaddy polls and ratings from within WordPress.
9
 
@@ -104,10 +104,14 @@ Your theme is getting the post content, without necessarily showing it. If the p
104
 
105
 
106
  == Upgrade Notice ==
107
- = 2.0.16 =
108
- Tidy plugins menus to only use one Top-level menu for Polls and Ratings, also includes better integration with Jetpack
109
 
110
  == Changelog ==
 
 
 
 
111
  = 2.0.16 =
112
  * Updated menus to only use one Top level menu - Feedback
113
  * Updated Settings->Polls & Ratings menu to break into 2 separate menu items - Settings->Polls / Settings->Ratings
3
  Tags: polls, poll, polldaddy, wppolls, vote, polling, surveys, rate, rating, ratings
4
  Requires at least: 3.2
5
  Tested up to: 3.5
6
+ Stable tag: 2.0.17
7
 
8
  Create and manage Polldaddy polls and ratings from within WordPress.
9
 
104
 
105
 
106
  == Upgrade Notice ==
107
+ = 2.0.17 =
108
+ Updated ratings settings to allow blog to show rating in search and archive pages
109
 
110
  == Changelog ==
111
+ = 2.0.17 =
112
+ * Updated ratings settings to allow blog to show rating in search and archive pages
113
+ * Updated how ratings are shown in excerpts which should work better with Jetpack and certain themes
114
+
115
  = 2.0.16 =
116
  * Updated menus to only use one Top level menu - Feedback
117
  * Updated Settings->Polls & Ratings menu to break into 2 separate menu items - Settings->Polls / Settings->Ratings