Version Description
- Updated the UI
- Added media embeds in poll editor
- Added poll comments option
- Fixed layout issues when viewing plugin in iframe/popup
- Fixed bug in multiple choices dropdown
- Fixed bug in updating style when updating all polls using that style
Download this release
Release Info
Developer | eoigal |
Plugin | Crowdsignal Dashboard – Polls, Surveys & more |
Version | 2.0 |
Comparing to | |
See all releases |
Code changes from version 1.8.10 to 2.0
- admin-style.php +53 -0
- ajax.php +113 -0
- img/box-texture.png +0 -0
- img/draggy-handle.png +0 -0
- img/error-blue.png +0 -0
- img/error-gray.png +0 -0
- img/icon-clear-search.png +0 -0
- img/icon-reorder.png +0 -0
- img/pd-wp-icon-blue-lrg.png +0 -0
- img/pd-wp-icon-blue.png +0 -0
- img/pd-wp-icon-gray-lrg.png +0 -0
- img/pd-wp-icon-gray.png +0 -0
- img/pd-wp-icon-hover.png +0 -0
- img/pd-wp-icon.png +0 -0
- locale/{polldaddy-cs.mo → polldaddy-cs_CZ.mo} +0 -0
- locale/{polldaddy-cs.po → polldaddy-cs_CZ.po} +0 -0
- locale/{polldaddy-da.mo → polldaddy-da_DK.mo} +0 -0
- locale/{polldaddy-da.po → polldaddy-da_DK.po} +0 -0
- locale/{polldaddy-es.mo → polldaddy-es_ES.mo} +0 -0
- locale/{polldaddy-es.po → polldaddy-es_ES.po} +0 -0
- locale/{polldaddy-FR.mo → polldaddy-fr_FR.mo} +0 -0
- locale/{polldaddy-FR.po → polldaddy-fr_FR.po} +0 -0
- locale/{polldaddy-km.mo → polldaddy-km_KH.mo} +0 -0
- locale/{polldaddy-km.po → polldaddy-km_KH.po} +0 -0
- locale/polldaddy-sp.po +0 -1124
- locale/{polldaddy-tr_TR.mo → polldaddy-tr.mo} +0 -0
- locale/{polldaddy-tr_TR.po → polldaddy-tr.po} +0 -0
- polldaddy-client.php +64 -21
- polldaddy-org.php +93 -86
- polldaddy-xml.php +58 -41
- polldaddy.css +258 -13
- polldaddy.js +134 -14
- polldaddy.php +1202 -741
- popups.php +90 -0
- rating.php +17 -17
- readme.txt +32 -23
- style-editor.css +18 -1
admin-style.php
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<style type="text/css" media="screen" type="text/css">
|
2 |
+
|
3 |
+
#toplevel_page_polls .wp-menu-image,
|
4 |
+
#toplevel_page_ratings .wp-menu-image{
|
5 |
+
background:url('<?php echo $this->base_url; ?>img/pd-wp-icon-<?php echo $color; ?>.png') 7px 7px no-repeat !important;
|
6 |
+
|
7 |
+
}
|
8 |
+
|
9 |
+
#toplevel_page_polls:hover .wp-menu-image,
|
10 |
+
#toplevel_page_ratings:hover .wp-menu-image,
|
11 |
+
#toplevel_page_polls.wp-has-current-submenu .wp-menu-image,
|
12 |
+
#toplevel_page_ratings.wp-has-current-submenu .wp-menu-image {
|
13 |
+
background:url('<?php echo $this->base_url; ?>img/pd-wp-icon-hover.png') 7px 7px no-repeat !important;
|
14 |
+
}
|
15 |
+
|
16 |
+
#toplevel_page_polls img, #toplevel_page_ratings img{
|
17 |
+
display: none;
|
18 |
+
}
|
19 |
+
|
20 |
+
#polldaddy-error.error{
|
21 |
+
border-radius:6px;
|
22 |
+
margin-left:5px;
|
23 |
+
margin-right:2%;
|
24 |
+
background-color:#FFC;
|
25 |
+
background:url('<?php echo $this->base_url; ?>img/error-<?php echo $color; ?>.png') no-repeat 3px 3px, -moz-linear-gradient(top, #FFF, #FFC);
|
26 |
+
background:url('<?php echo $this->base_url; ?>img/error-<?php echo $color; ?>.png') no-repeat 3px 3px, -webkit-linear-gradient(top, #FFF, #FFC);
|
27 |
+
margin-top:14px;
|
28 |
+
border:1px #cccccc solid;
|
29 |
+
padding:3px 5px 3px 40px;
|
30 |
+
}
|
31 |
+
|
32 |
+
|
33 |
+
h2#polldaddy-header, h2#poll-list-header{
|
34 |
+
padding-left:38px;
|
35 |
+
background:url('<?php echo $this->base_url; ?>img/pd-wp-icon-<?php echo $color; ?>-lrg.png') no-repeat 0px 13px;
|
36 |
+
margin-bottom: 14px;
|
37 |
+
}
|
38 |
+
|
39 |
+
<?php if( isset( $_GET['iframe']) ):?>
|
40 |
+
h2#polldaddy-header, h2#poll-list-header{
|
41 |
+
background-position: 0px 0px;
|
42 |
+
margin-top: 20px;
|
43 |
+
}
|
44 |
+
|
45 |
+
.pd-tabs li a{
|
46 |
+
font-size:11px !important;
|
47 |
+
}
|
48 |
+
|
49 |
+
<?php endif; ?>
|
50 |
+
|
51 |
+
|
52 |
+
|
53 |
+
</style>
|
ajax.php
ADDED
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
add_action( 'wp_ajax_myajax-submit', 'myajax_submit' );
|
4 |
+
|
5 |
+
class Polldaddy_Ajax {
|
6 |
+
public function __construct() {
|
7 |
+
// Catch AJAX
|
8 |
+
add_action( 'wp_ajax_polls_upload_image', array( &$this, 'ajax_upload_image' ) );
|
9 |
+
add_action( 'wp_ajax_polls_add_answer', array( &$this, 'ajax_add_answer' ) );
|
10 |
+
|
11 |
+
if ( !defined( 'WP_POLLDADDY__PARTNERGUID' ) ) {
|
12 |
+
$guid = get_option( 'polldaddy_api_key' );
|
13 |
+
if ( !$guid || !is_string( $guid ) )
|
14 |
+
$guid = false;
|
15 |
+
define( 'WP_POLLDADDY__PARTNERGUID', $guid );
|
16 |
+
}
|
17 |
+
}
|
18 |
+
|
19 |
+
public function ajax_upload_image() {
|
20 |
+
require_once dirname( __FILE__ ) . '/polldaddy-client.php';
|
21 |
+
|
22 |
+
check_admin_referer( 'send-media' );
|
23 |
+
|
24 |
+
$attach_id = $user_code = 0;
|
25 |
+
$name = $url = '';
|
26 |
+
|
27 |
+
if ( isset( $_POST['attach-id'] ) )
|
28 |
+
$attach_id = (int) $_POST['attach-id'];
|
29 |
+
|
30 |
+
if ( isset( $_POST['uc'] ) )
|
31 |
+
$user_code = $_POST['uc'];
|
32 |
+
|
33 |
+
if ( isset( $_POST['url'] ) )
|
34 |
+
$url = $_POST['url'];
|
35 |
+
|
36 |
+
$parts = pathinfo( $url );
|
37 |
+
$name = $parts['basename'];
|
38 |
+
$polldaddy = new api_client( WP_POLLDADDY__PARTNERGUID, $user_code );
|
39 |
+
$response = $polldaddy->upload_image( $name, $url, 'poll', ($attach_id>1000?$attach_id:0) );
|
40 |
+
|
41 |
+
if ( is_a( $response, "PollDaddy_Media" ) )
|
42 |
+
echo urldecode( $response->upload_result ).'||'.$attach_id;
|
43 |
+
die();
|
44 |
+
}
|
45 |
+
|
46 |
+
public function ajax_add_answer() {
|
47 |
+
check_admin_referer( 'add-answer' );
|
48 |
+
|
49 |
+
$a = 0;
|
50 |
+
$popup = 0;
|
51 |
+
$src = '';
|
52 |
+
|
53 |
+
if ( isset( $_POST['aa'] ) )
|
54 |
+
$a = (int) $_POST['aa'];
|
55 |
+
|
56 |
+
if ( isset( $_POST['src'] ) )
|
57 |
+
$src = $_POST['src'];
|
58 |
+
|
59 |
+
if ( isset( $_POST['popup'] ) )
|
60 |
+
$popup = $_POST['popup'];
|
61 |
+
|
62 |
+
$response = '<li>
|
63 |
+
<table class="answer">
|
64 |
+
|
65 |
+
<tr>
|
66 |
+
<th>
|
67 |
+
<span class="handle" title="' . esc_attr( __( 'click and drag to reorder' ) ) . '"><img src="' . $src . 'img/icon-reorder.png" alt="click and drag to reorder" width="6" height="9" /></span>
|
68 |
+
</th>
|
69 |
+
<td class="answer-input">
|
70 |
+
<input type="text" autocomplete="off" placeholder="' . esc_attr( __( 'Enter an answer here', 'polldaddy' ) ) .'" value="" tabindex="2" size="30" name="answer[new' . $a .']" />
|
71 |
+
</td>';
|
72 |
+
|
73 |
+
if ( $popup > 0 ) {
|
74 |
+
$response .= '<td class="answer-media-icons" style="width:55px !important;">
|
75 |
+
<ul class="answer-media" style="min-width: 30px;">
|
76 |
+
<li class="media-preview" style="width: 20px; height: 16px; padding-left: 5px;"></li>
|
77 |
+
<li><a href="#" class="delete-answer delete" title="' . esc_attr( 'delete this answer' ) .'"><img src="' . $src . 'img/icon-clear-search.png" width="16" height="16" /></a></li>
|
78 |
+
</ul>';
|
79 |
+
}
|
80 |
+
else {
|
81 |
+
$response .= '<td class="answer-media-icons">
|
82 |
+
<ul class="answer-media">
|
83 |
+
<li class="media-preview" style="width: 20px; height: 16px; padding-left: 5px;"></li>
|
84 |
+
<li><a title="' . esc_attr( __( 'Add an Image', 'polldaddy' ) ) . '" class="thickbox media image" id="add_poll_image' . $a .'" href="#"><img style="vertical-align:middle;" alt="' . esc_attr( __( 'Add an Image', 'polldaddy' ) ) . '" src="images/media-button-image.gif"></a></a></li>
|
85 |
+
<li><a title="' . esc_attr( __( 'Add Audio', 'polldaddy' ) ) . '" class="thickbox media video" id="add_poll_video' . $a .'" href="#"><img style="vertical-align:middle;" alt="' . esc_attr( __( 'Add Audio', 'polldaddy' ) ) . '" src="images/media-button-video.gif"></a></a></li>
|
86 |
+
<li><a title="' . esc_attr( __( 'Add Video', 'polldaddy' ) ) . '" class="thickbox media audio" id="add_poll_audio' . $a .'" href="#"><img style="vertical-align:middle;" alt="' . esc_attr( __( 'Add Video', 'polldaddy' ) ) . '" src="images/media-button-music.gif"></a></li>
|
87 |
+
<li><a href="#" class="delete-answer delete" title="' . esc_attr( 'delete this answer' ) . '"><img src="' . $src . 'img/icon-clear-search.png" width="16" height="16" /></a></li>
|
88 |
+
</ul>';
|
89 |
+
}
|
90 |
+
|
91 |
+
$response .= '<input type="hidden" value="" id="hMC' . $a .'" name="media[' . $a .']">
|
92 |
+
<input type="hidden" value="" id="hMT' . $a .'" name="mediaType[' . $a .']">
|
93 |
+
|
94 |
+
</td>
|
95 |
+
</tr>
|
96 |
+
|
97 |
+
</table>
|
98 |
+
|
99 |
+
</li>';
|
100 |
+
|
101 |
+
echo $response;
|
102 |
+
die();
|
103 |
+
}
|
104 |
+
}
|
105 |
+
|
106 |
+
function polldaddy_ajax_init() {
|
107 |
+
global $polldaddy_ajax;
|
108 |
+
|
109 |
+
$polldaddy_ajax = new Polldaddy_Ajax();
|
110 |
+
}
|
111 |
+
|
112 |
+
add_action( 'init', 'polldaddy_ajax_init' );
|
113 |
+
?>
|
img/box-texture.png
ADDED
Binary file
|
img/draggy-handle.png
ADDED
Binary file
|
img/error-blue.png
ADDED
Binary file
|
img/error-gray.png
ADDED
Binary file
|
img/icon-clear-search.png
ADDED
Binary file
|
img/icon-reorder.png
ADDED
Binary file
|
img/pd-wp-icon-blue-lrg.png
ADDED
Binary file
|
img/pd-wp-icon-blue.png
ADDED
Binary file
|
img/pd-wp-icon-gray-lrg.png
ADDED
Binary file
|
img/pd-wp-icon-gray.png
ADDED
Binary file
|
img/pd-wp-icon-hover.png
ADDED
Binary file
|
img/pd-wp-icon.png
ADDED
Binary file
|
locale/{polldaddy-cs.mo → polldaddy-cs_CZ.mo}
RENAMED
File without changes
|
locale/{polldaddy-cs.po → polldaddy-cs_CZ.po}
RENAMED
File without changes
|
locale/{polldaddy-da.mo → polldaddy-da_DK.mo}
RENAMED
File without changes
|
locale/{polldaddy-da.po → polldaddy-da_DK.po}
RENAMED
File without changes
|
locale/{polldaddy-es.mo → polldaddy-es_ES.mo}
RENAMED
File without changes
|
locale/{polldaddy-es.po → polldaddy-es_ES.po}
RENAMED
File without changes
|
locale/{polldaddy-FR.mo → polldaddy-fr_FR.mo}
RENAMED
File without changes
|
locale/{polldaddy-FR.po → polldaddy-fr_FR.po}
RENAMED
File without changes
|
locale/{polldaddy-km.mo → polldaddy-km_KH.mo}
RENAMED
File without changes
|
locale/{polldaddy-km.po → polldaddy-km_KH.po}
RENAMED
File without changes
|
locale/polldaddy-sp.po
DELETED
@@ -1,1124 +0,0 @@
|
|
1 |
-
# Translation of the WordPress plugin PollDaddy Polls 1.8.3 by Automattic, Inc..
|
2 |
-
# Copyright (C) 2010 Automattic, Inc.
|
3 |
-
# This file is distributed under the same license as the PollDaddy Polls package.
|
4 |
-
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
5 |
-
#
|
6 |
-
msgid ""
|
7 |
-
msgstr ""
|
8 |
-
"Project-Id-Version: PollDaddy Polls 1.8.3\n"
|
9 |
-
"Report-Msgid-Bugs-To: http://wordpress.org/tag/polldaddy\n"
|
10 |
-
"POT-Creation-Date: 2010-02-23 12:33+0000\n"
|
11 |
-
"PO-Revision-Date: 2010-03-06 16:37+0100\n"
|
12 |
-
"Last-Translator: Víctor Pimentel <victor.pimentel@gmail.com>\n"
|
13 |
-
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
-
"MIME-Version: 1.0\n"
|
15 |
-
"Content-Type: text/plain; charset=utf-8\n"
|
16 |
-
"Content-Transfer-Encoding: 8bit\n"
|
17 |
-
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
18 |
-
|
19 |
-
#: polldaddy-org.php:134
|
20 |
-
#: polldaddy.php:128
|
21 |
-
#: polldaddy.php:892
|
22 |
-
msgid "Email address required"
|
23 |
-
msgstr "El email es obligatorio"
|
24 |
-
|
25 |
-
#: polldaddy-org.php:137
|
26 |
-
#: polldaddy.php:131
|
27 |
-
#: polldaddy.php:895
|
28 |
-
msgid "Password required"
|
29 |
-
msgstr "La contraseña es obligatoria"
|
30 |
-
|
31 |
-
#: polldaddy-org.php:169
|
32 |
-
msgid "Could not connect to PollDaddy API Key service"
|
33 |
-
msgstr "No se pudo conectar al servicio de claves para la API de PollDaddy"
|
34 |
-
|
35 |
-
#: polldaddy-org.php:183
|
36 |
-
#: polldaddy.php:161
|
37 |
-
msgid "Can't connect to PollDaddy.com"
|
38 |
-
msgstr "No se puede conectar con PollDaddy.com"
|
39 |
-
|
40 |
-
#: polldaddy-org.php:213
|
41 |
-
msgid "Login to PollDaddy failed. Double check your email address and password."
|
42 |
-
msgstr "Falló la autenticación con PollDaddy. Vuelve a verificar tu email y contraseña."
|
43 |
-
|
44 |
-
#: polldaddy-org.php:215
|
45 |
-
msgid "If your email address and password are correct, your host may not support secure logins."
|
46 |
-
msgstr "Si tu email y contraseña son correctos, puede que tu servidor de hosting no soporte autentificación segura."
|
47 |
-
|
48 |
-
#: polldaddy-org.php:216
|
49 |
-
msgid "In that case, you may be able to log in to PollDaddy by unchecking the \"Use SSL to Log in\" checkbox."
|
50 |
-
msgstr "En tal caso, puede que seas capaz de autenticarte en PollDaddy si deshabilitas la opción \"Usar SSL al entrar\""
|
51 |
-
|
52 |
-
#: polldaddy-org.php:227
|
53 |
-
#: polldaddy.php:198
|
54 |
-
msgid "Account could not be accessed. Are your email address and password correct?"
|
55 |
-
msgstr "La cuenta no está accesible. ¿Seguro que tu email y contraseña son correctos?"
|
56 |
-
|
57 |
-
#: polldaddy-org.php:241
|
58 |
-
#: polldaddy.php:249
|
59 |
-
msgid "PollDaddy Account"
|
60 |
-
msgstr "Cuenta de PollDaddy"
|
61 |
-
|
62 |
-
#: polldaddy-org.php:243
|
63 |
-
#: polldaddy.php:251
|
64 |
-
#, php-format
|
65 |
-
msgid "Before you can use the PollDaddy plugin, you need to enter your <a href=\"%s\">PollDaddy.com</a> account details."
|
66 |
-
msgstr "Antes de que uses el plugin de PollDaddy, necesitas rellenar tus datos de cuenta en <a href=\"%s\">PollDaddy.com</a>."
|
67 |
-
|
68 |
-
#: polldaddy-org.php:250
|
69 |
-
#: polldaddy.php:258
|
70 |
-
#: polldaddy.php:3867
|
71 |
-
msgid "PollDaddy Email Address"
|
72 |
-
msgstr "Email en PollDaddy"
|
73 |
-
|
74 |
-
#: polldaddy-org.php:258
|
75 |
-
#: polldaddy.php:266
|
76 |
-
#: polldaddy.php:3877
|
77 |
-
msgid "PollDaddy Password"
|
78 |
-
msgstr "Contraseña en PollDaddy"
|
79 |
-
|
80 |
-
#: polldaddy-org.php:271
|
81 |
-
msgid "Use SSL to Log in"
|
82 |
-
msgstr "Usar SSL al entrar"
|
83 |
-
|
84 |
-
#: polldaddy-org.php:275
|
85 |
-
msgid "This ensures a secure login to your PollDaddy account. Only uncheck if you are having problems logging in."
|
86 |
-
msgstr "Esto asegura una autentificación segura a tu cuenta de PollDaddy. Deselecciónalo solo si estás teniendo problemas al entrar."
|
87 |
-
|
88 |
-
#: polldaddy-org.php:285
|
89 |
-
#: polldaddy.php:278
|
90 |
-
msgid "Submit"
|
91 |
-
msgstr "Enviar"
|
92 |
-
|
93 |
-
#: polldaddy-org.php:301
|
94 |
-
msgid "Multiple PollDaddy Accounts"
|
95 |
-
msgstr "Varias cuentas de PollDaddy"
|
96 |
-
|
97 |
-
#: polldaddy-org.php:307
|
98 |
-
msgid "This setting will allow each blog user to import a PollDaddy account."
|
99 |
-
msgstr "Esta opción permitirá a cada usuario del blog importar una cuenta de PollDaddy."
|
100 |
-
|
101 |
-
#: polldaddy-org.php:314
|
102 |
-
msgid "Sync Ratings Account"
|
103 |
-
msgstr "Sincronizar votaciones con tu cuenta"
|
104 |
-
|
105 |
-
#: polldaddy-org.php:320
|
106 |
-
msgid "This will syncronize your ratings PollDaddy account."
|
107 |
-
msgstr "Esto sincronizará las votaciones con tu cuenta de PollDaddy."
|
108 |
-
|
109 |
-
#: polldaddy-org.php:327
|
110 |
-
msgid "Posts Rating ID"
|
111 |
-
msgstr "Identificador de votaciones de entradas"
|
112 |
-
|
113 |
-
#: polldaddy-org.php:333
|
114 |
-
msgid "This is the rating ID used in posts"
|
115 |
-
msgstr "Este es el identificador de las votaciones de entradas."
|
116 |
-
|
117 |
-
#: polldaddy-org.php:340
|
118 |
-
msgid "Pages Rating ID"
|
119 |
-
msgstr "Identificador de votaciones de páginas"
|
120 |
-
|
121 |
-
#: polldaddy-org.php:346
|
122 |
-
msgid "This is the rating ID used in pages"
|
123 |
-
msgstr "Este es el identificador de las votaciones de entradas."
|
124 |
-
|
125 |
-
#: polldaddy-org.php:353
|
126 |
-
msgid "Comments Rating ID"
|
127 |
-
msgstr "Identificador de votaciones de comentarios"
|
128 |
-
|
129 |
-
#: polldaddy-org.php:359
|
130 |
-
msgid "This is the rating ID used in comments"
|
131 |
-
msgstr "Este es el identificador de las votaciones de comentarios."
|
132 |
-
|
133 |
-
#: polldaddy-org.php:519
|
134 |
-
msgid "A list of your top rated posts, pages or comments."
|
135 |
-
msgstr "Una lista de tus entradas, páginas o comentarios más populares."
|
136 |
-
|
137 |
-
#: polldaddy-org.php:528
|
138 |
-
msgid "Top Rated"
|
139 |
-
msgstr "Más popular"
|
140 |
-
|
141 |
-
#: polldaddy-org.php:564
|
142 |
-
#: polldaddy.php:3693
|
143 |
-
msgid "Title"
|
144 |
-
msgstr "Título"
|
145 |
-
|
146 |
-
#: polldaddy-org.php:573
|
147 |
-
msgid "Show for posts"
|
148 |
-
msgstr "Mostrar en entradas"
|
149 |
-
|
150 |
-
#: polldaddy-org.php:584
|
151 |
-
msgid "Show for pages"
|
152 |
-
msgstr "Mostrar en páginas"
|
153 |
-
|
154 |
-
#: polldaddy-org.php:595
|
155 |
-
msgid "Show for comments"
|
156 |
-
msgstr "Mostrar en comentarios"
|
157 |
-
|
158 |
-
#: polldaddy-org.php:599
|
159 |
-
msgid "How many items would you like to display?"
|
160 |
-
msgstr "¿Cuántos elementos te gustaría mostrar?"
|
161 |
-
|
162 |
-
#: polldaddy.php:68
|
163 |
-
#: polldaddy.php:70
|
164 |
-
#: polldaddy.php:86
|
165 |
-
#: polldaddy.php:88
|
166 |
-
msgid "Ratings"
|
167 |
-
msgstr "Calificaciones"
|
168 |
-
|
169 |
-
#: polldaddy.php:75
|
170 |
-
#: polldaddy.php:77
|
171 |
-
#: polldaddy.php:93
|
172 |
-
#: polldaddy.php:95
|
173 |
-
#: polldaddy.php:107
|
174 |
-
#: polldaddy.php:1101
|
175 |
-
msgid "Polls"
|
176 |
-
msgstr "Encuestas"
|
177 |
-
|
178 |
-
#: polldaddy.php:100
|
179 |
-
msgid "Ratings – Settings"
|
180 |
-
msgstr "Calificaciones – Preferencias"
|
181 |
-
|
182 |
-
#: polldaddy.php:100
|
183 |
-
msgid "Settings"
|
184 |
-
msgstr "Preferencias"
|
185 |
-
|
186 |
-
#: polldaddy.php:101
|
187 |
-
#: polldaddy.php:104
|
188 |
-
msgid "Ratings – Reports"
|
189 |
-
msgstr "Calificaciones – Informes"
|
190 |
-
|
191 |
-
#: polldaddy.php:101
|
192 |
-
#: polldaddy.php:104
|
193 |
-
msgid "Reports"
|
194 |
-
msgstr "Informes"
|
195 |
-
|
196 |
-
#: polldaddy.php:107
|
197 |
-
#: polldaddy.php:1233
|
198 |
-
#: polldaddy.php:2010
|
199 |
-
msgid "Edit"
|
200 |
-
msgstr "Editar"
|
201 |
-
|
202 |
-
#: polldaddy.php:110
|
203 |
-
msgid "Add New Poll"
|
204 |
-
msgstr "Añadir nueva encuesta"
|
205 |
-
|
206 |
-
#: polldaddy.php:110
|
207 |
-
msgid "Add New"
|
208 |
-
msgstr "Añadir nueva"
|
209 |
-
|
210 |
-
#: polldaddy.php:111
|
211 |
-
#: polldaddy.php:1066
|
212 |
-
#: polldaddy.php:1739
|
213 |
-
msgid "Custom Styles"
|
214 |
-
msgstr "Estilos personalizados"
|
215 |
-
|
216 |
-
#: polldaddy.php:112
|
217 |
-
#: polldaddy.php:3852
|
218 |
-
msgid "Options"
|
219 |
-
msgstr "Opciones"
|
220 |
-
|
221 |
-
#: polldaddy.php:188
|
222 |
-
msgid "Invalid Account"
|
223 |
-
msgstr "Cuenta inválida"
|
224 |
-
|
225 |
-
#: polldaddy.php:210
|
226 |
-
#, php-format
|
227 |
-
msgid "Obsolete PollDaddy User API Key: <a href=\"%s\">Sign in again to re-authenticate</a>"
|
228 |
-
msgstr "Clave de usuario para la API caducada: <a href=\"%s\">Vuelve a entrar para autenticarte de nuevo</a>"
|
229 |
-
|
230 |
-
#: polldaddy.php:287
|
231 |
-
msgid "Add Poll"
|
232 |
-
msgstr "Añadir encuesta"
|
233 |
-
|
234 |
-
#: polldaddy.php:358
|
235 |
-
msgid "Star Colors"
|
236 |
-
msgstr "Colores de las estrellas"
|
237 |
-
|
238 |
-
#: polldaddy.php:358
|
239 |
-
#: polldaddy.php:3339
|
240 |
-
msgid "Star Size"
|
241 |
-
msgstr "Tamaño de las estrellas"
|
242 |
-
|
243 |
-
#: polldaddy.php:359
|
244 |
-
msgid "Nero Type"
|
245 |
-
msgstr "Tipo de Me gusta/No me gusta"
|
246 |
-
|
247 |
-
#: polldaddy.php:359
|
248 |
-
msgid "Nero Size"
|
249 |
-
msgstr "Tamaño de Me gusta/No me gusta"
|
250 |
-
|
251 |
-
#: polldaddy.php:452
|
252 |
-
msgid "You are not allowed to delete this poll."
|
253 |
-
msgstr "No se está permitido borrar esta encuesta."
|
254 |
-
|
255 |
-
#: polldaddy.php:460
|
256 |
-
#: polldaddy.php:496
|
257 |
-
#: polldaddy.php:532
|
258 |
-
#: polldaddy.php:566
|
259 |
-
msgid "Invalid Poll Author"
|
260 |
-
msgstr "Autor de encuesta inválido"
|
261 |
-
|
262 |
-
#: polldaddy.php:488
|
263 |
-
msgid "You are not allowed to open this poll."
|
264 |
-
msgstr "No se está permitido abrir esta encuesta."
|
265 |
-
|
266 |
-
#: polldaddy.php:524
|
267 |
-
msgid "You are not allowed to close this poll."
|
268 |
-
msgstr "No se está permitido cerrar esta encuesta."
|
269 |
-
|
270 |
-
#: polldaddy.php:557
|
271 |
-
#: polldaddy.php:1329
|
272 |
-
msgid "You are not allowed to edit this poll."
|
273 |
-
msgstr "No se está permitido editar esta encuesta."
|
274 |
-
|
275 |
-
#: polldaddy.php:573
|
276 |
-
msgid "Poll not found"
|
277 |
-
msgstr "Encuesta no encontrada"
|
278 |
-
|
279 |
-
#: polldaddy.php:600
|
280 |
-
msgid "Invalid answers"
|
281 |
-
msgstr "Respuestas inválidas"
|
282 |
-
|
283 |
-
#: polldaddy.php:616
|
284 |
-
msgid "You must include at least 2 answers"
|
285 |
-
msgstr "Debes incluir al menos dos respuestas"
|
286 |
-
|
287 |
-
#: polldaddy.php:627
|
288 |
-
#: polldaddy.php:704
|
289 |
-
msgid "Please choose a poll style"
|
290 |
-
msgstr "Elige un estilo para la encuesta"
|
291 |
-
|
292 |
-
#: polldaddy.php:649
|
293 |
-
msgid "Poll could not be updated"
|
294 |
-
msgstr "La encuesta no se pudo actualizar"
|
295 |
-
|
296 |
-
#: polldaddy.php:723
|
297 |
-
msgid "Poll could not be created"
|
298 |
-
msgstr "La encuesta no se pudo crear"
|
299 |
-
|
300 |
-
#: polldaddy.php:775
|
301 |
-
msgid "Style could not be updated"
|
302 |
-
msgstr "El estilo no se pudo actualizar"
|
303 |
-
|
304 |
-
#: polldaddy.php:805
|
305 |
-
msgid "Style could not be created"
|
306 |
-
msgstr "El estilo no se pudo crear"
|
307 |
-
|
308 |
-
#: polldaddy.php:904
|
309 |
-
msgid "Account could not be imported. Are your email address and password correct?"
|
310 |
-
msgstr "La cuenta no se pudo importar. ¿Seguro que tu email y contraseña son correctos?"
|
311 |
-
|
312 |
-
#: polldaddy.php:922
|
313 |
-
msgid "Poll deleted."
|
314 |
-
msgstr "Encuesta borrada."
|
315 |
-
|
316 |
-
#: polldaddy.php:924
|
317 |
-
#, php-format
|
318 |
-
msgid "%s Poll Deleted."
|
319 |
-
msgid_plural "%s Polls Deleted."
|
320 |
-
msgstr[0] "Encuesta %s borrada."
|
321 |
-
msgstr[1] "Encuestas %s borradas."
|
322 |
-
|
323 |
-
#: polldaddy.php:929
|
324 |
-
msgid "Poll opened."
|
325 |
-
msgstr "Encuesta abierta."
|
326 |
-
|
327 |
-
#: polldaddy.php:931
|
328 |
-
#, php-format
|
329 |
-
msgid "%s Poll Opened."
|
330 |
-
msgid_plural "%s Polls Opened."
|
331 |
-
msgstr[0] "Encuesta %s abierta."
|
332 |
-
msgstr[1] "Encuestas %s abiertas."
|
333 |
-
|
334 |
-
#: polldaddy.php:936
|
335 |
-
msgid "Poll closed."
|
336 |
-
msgstr "Encuesta borrada."
|
337 |
-
|
338 |
-
#: polldaddy.php:938
|
339 |
-
#, php-format
|
340 |
-
msgid "%s Poll Closed."
|
341 |
-
msgid_plural "%s Polls Closed."
|
342 |
-
msgstr[0] "Encuesta %s cerrada."
|
343 |
-
msgstr[1] "Encuestas %s cerrada."
|
344 |
-
|
345 |
-
#: polldaddy.php:941
|
346 |
-
msgid "Poll updated."
|
347 |
-
msgstr "Encuesta actualizada."
|
348 |
-
|
349 |
-
#: polldaddy.php:944
|
350 |
-
msgid "Poll created."
|
351 |
-
msgstr "Encuesta creada."
|
352 |
-
|
353 |
-
#: polldaddy.php:946
|
354 |
-
#: polldaddy.php:1362
|
355 |
-
msgid "Send to Editor"
|
356 |
-
msgstr "Enviar al editor"
|
357 |
-
|
358 |
-
#: polldaddy.php:949
|
359 |
-
msgid "Custom Style updated."
|
360 |
-
msgstr "Estilo personalizado actualizado."
|
361 |
-
|
362 |
-
#: polldaddy.php:952
|
363 |
-
msgid "Custom Style created."
|
364 |
-
msgstr "Estilo personalizado creado."
|
365 |
-
|
366 |
-
#: polldaddy.php:957
|
367 |
-
msgid "Custom Style deleted."
|
368 |
-
msgstr "Estilo personalizado borrado."
|
369 |
-
|
370 |
-
#: polldaddy.php:959
|
371 |
-
#, php-format
|
372 |
-
msgid "%s Style Deleted."
|
373 |
-
msgid_plural "%s Custom Styles Deleted."
|
374 |
-
msgstr[0] "Estilo personalizado %s borrado."
|
375 |
-
msgstr[1] "Estilos personalizados %s borrados."
|
376 |
-
|
377 |
-
#: polldaddy.php:962
|
378 |
-
msgid "Account Imported."
|
379 |
-
msgstr "Cuenta importada."
|
380 |
-
|
381 |
-
#: polldaddy.php:965
|
382 |
-
msgid "Options Updated."
|
383 |
-
msgstr "Opciones actualizadas."
|
384 |
-
|
385 |
-
#: polldaddy.php:974
|
386 |
-
msgid "Error: An error has occurred; Poll not created."
|
387 |
-
msgstr "Error: ha ocurrido un error; La encuesta no se creó."
|
388 |
-
|
389 |
-
#: polldaddy.php:977
|
390 |
-
msgid "Error: An error has occurred; Poll not updated."
|
391 |
-
msgstr "Error: ha ocurrido un error; La encuesta no se actualizó."
|
392 |
-
|
393 |
-
#: polldaddy.php:981
|
394 |
-
msgid "Error: An error has occurred; Account could not be imported. Perhaps your email address or password is incorrect?"
|
395 |
-
msgstr "Error: ha ocurrido un error; La encuesta no se pudo importar. Quizás tu email o contraseña son incorrectas."
|
396 |
-
|
397 |
-
#: polldaddy.php:983
|
398 |
-
msgid "Error: An error has occurred; Account could not be created."
|
399 |
-
msgstr "Error: ha ocurrido un error; La encuesta no se pudo crear."
|
400 |
-
|
401 |
-
#: polldaddy.php:1020
|
402 |
-
#, php-format
|
403 |
-
msgid "Poll Preview (<a href=\"%s\">Edit Poll</a>, <a href=\"%s\">List Polls</a>)"
|
404 |
-
msgstr "Vista previa de encuesta (<a href=\"%s\">Editar encuesta</a>, <a href=\"%s\">Mostrar encuestas</a>)"
|
405 |
-
|
406 |
-
#: polldaddy.php:1024
|
407 |
-
#, php-format
|
408 |
-
msgid "Poll Preview (<a href=\"%s\">List Polls</a>)"
|
409 |
-
msgstr "Vista previa de encuesta (<a href=\"%s\">Mostrar encuestas</a>)"
|
410 |
-
|
411 |
-
#: polldaddy.php:1034
|
412 |
-
#, php-format
|
413 |
-
msgid "Poll Results (<a href=\"%s\">Edit Poll</a>)"
|
414 |
-
msgstr "Resultados de la encuesta (<a href=\"%s\">Editar encuesta</a>)"
|
415 |
-
|
416 |
-
#: polldaddy.php:1036
|
417 |
-
#, php-format
|
418 |
-
msgid "Poll Results (<a href=\"%s\">List Polls</a>)"
|
419 |
-
msgstr "Resultados de la encuesta (<a href=\"%s\">Mostrar encuestas</a>)"
|
420 |
-
|
421 |
-
#: polldaddy.php:1045
|
422 |
-
#, php-format
|
423 |
-
msgid "Edit Poll (<a href=\"%s\">List Polls</a>)"
|
424 |
-
msgstr "Editar encuesta (<a href=\"%s\">Mostrar encuestas</a>)"
|
425 |
-
|
426 |
-
#: polldaddy.php:1054
|
427 |
-
#, php-format
|
428 |
-
msgid "Create Poll (<a href=\"%s\">List Polls</a>)"
|
429 |
-
msgstr "Crear encuesta (<a href=\"%s\">Mostrar encuestas</a>)"
|
430 |
-
|
431 |
-
#: polldaddy.php:1064
|
432 |
-
#, php-format
|
433 |
-
msgid "Custom Styles (<a href=\"%s\">Add New</a>)"
|
434 |
-
msgstr "Estilos personalizados (<a href=\"%s\">Añadir nuevo</a>)"
|
435 |
-
|
436 |
-
#: polldaddy.php:1074
|
437 |
-
#, php-format
|
438 |
-
msgid "Edit Style (<a href=\"%s\">List Styles</a>)"
|
439 |
-
msgstr "Editar estilo (<a href=\"%s\">Mostrar estilos</a>)"
|
440 |
-
|
441 |
-
#: polldaddy.php:1083
|
442 |
-
#, php-format
|
443 |
-
msgid "Create Style (<a href=\"%s\">List Styles</a>)"
|
444 |
-
msgstr "Crear estilo (<a href=\"%s\">Mostrar estilos</a>)"
|
445 |
-
|
446 |
-
#: polldaddy.php:1099
|
447 |
-
#, php-format
|
448 |
-
msgid "Polls (<a href=\"%s\">Add New</a>)"
|
449 |
-
msgstr "Encuestas (<a href=\"%s\">Añadir nueva</a>)"
|
450 |
-
|
451 |
-
#: polldaddy.php:1164
|
452 |
-
msgid "All Blog's Polls"
|
453 |
-
msgstr "Todas las encuestas del blog"
|
454 |
-
|
455 |
-
#: polldaddy.php:1165
|
456 |
-
msgid "All My Polls"
|
457 |
-
msgstr "Todas mis encuestas"
|
458 |
-
|
459 |
-
#: polldaddy.php:1173
|
460 |
-
#: polldaddy.php:1973
|
461 |
-
msgid "Actions"
|
462 |
-
msgstr "Acciones"
|
463 |
-
|
464 |
-
#: polldaddy.php:1174
|
465 |
-
#: polldaddy.php:1239
|
466 |
-
#: polldaddy.php:1974
|
467 |
-
#: polldaddy.php:2015
|
468 |
-
msgid "Delete"
|
469 |
-
msgstr "Borrar"
|
470 |
-
|
471 |
-
#: polldaddy.php:1175
|
472 |
-
#: polldaddy.php:1246
|
473 |
-
msgid "Close"
|
474 |
-
msgstr "Cerrar"
|
475 |
-
|
476 |
-
#: polldaddy.php:1176
|
477 |
-
#: polldaddy.php:1243
|
478 |
-
msgid "Open"
|
479 |
-
msgstr "Abrir"
|
480 |
-
|
481 |
-
#: polldaddy.php:1178
|
482 |
-
#: polldaddy.php:1976
|
483 |
-
msgid "Apply"
|
484 |
-
msgstr "Aplicar"
|
485 |
-
|
486 |
-
#: polldaddy.php:1189
|
487 |
-
msgid "Poll"
|
488 |
-
msgstr "Encuesta"
|
489 |
-
|
490 |
-
#: polldaddy.php:1190
|
491 |
-
#: polldaddy.php:1877
|
492 |
-
#: polldaddy.php:1922
|
493 |
-
#: polldaddy.php:3694
|
494 |
-
msgid "Votes"
|
495 |
-
msgstr "Votos"
|
496 |
-
|
497 |
-
#: polldaddy.php:1191
|
498 |
-
msgid "Created"
|
499 |
-
msgstr "Creado"
|
500 |
-
|
501 |
-
#: polldaddy.php:1237
|
502 |
-
msgid "Results"
|
503 |
-
msgstr "Resultados"
|
504 |
-
|
505 |
-
#: polldaddy.php:1249
|
506 |
-
#: polldaddy.php:1255
|
507 |
-
#: polldaddy.php:3251
|
508 |
-
msgid "Preview"
|
509 |
-
msgstr "Vista previa"
|
510 |
-
|
511 |
-
#: polldaddy.php:1251
|
512 |
-
msgid "Send to editor"
|
513 |
-
msgstr "Enviar al editor"
|
514 |
-
|
515 |
-
#: polldaddy.php:1257
|
516 |
-
msgid "HTML code"
|
517 |
-
msgstr "Código HTML"
|
518 |
-
|
519 |
-
#: polldaddy.php:1261
|
520 |
-
#: polldaddy.php:2017
|
521 |
-
msgid "Y/m/d g:i:s A"
|
522 |
-
msgstr "d/m/Y g:i:s A"
|
523 |
-
|
524 |
-
#: polldaddy.php:1261
|
525 |
-
#: polldaddy.php:2017
|
526 |
-
msgid "Y/m/d"
|
527 |
-
msgstr "d/m/Y"
|
528 |
-
|
529 |
-
#: polldaddy.php:1265
|
530 |
-
msgid "Shortcode"
|
531 |
-
msgstr "Abreviatura"
|
532 |
-
|
533 |
-
#: polldaddy.php:1268
|
534 |
-
msgid "JavaScript"
|
535 |
-
msgstr "JavaScript"
|
536 |
-
|
537 |
-
#: polldaddy.php:1284
|
538 |
-
#, php-format
|
539 |
-
msgid "What are you doing here? <a href=\"%s\">Go back</a>."
|
540 |
-
msgstr "¿Cómo has llegado hasta aquí <a href=\"%s\">Vuelve atrás</a>."
|
541 |
-
|
542 |
-
#: polldaddy.php:1294
|
543 |
-
#, php-format
|
544 |
-
msgid "No polls yet. <a href=\"%s\">Create one</a>"
|
545 |
-
msgstr "No existe ninguna encuesta aún. <a href=\"%s\">Crear una</a>"
|
546 |
-
|
547 |
-
#: polldaddy.php:1296
|
548 |
-
msgid "No polls yet."
|
549 |
-
msgstr "No existe ninguna encuesta aún."
|
550 |
-
|
551 |
-
#: polldaddy.php:1351
|
552 |
-
msgid "Publish"
|
553 |
-
msgstr "Publicar"
|
554 |
-
|
555 |
-
#: polldaddy.php:1358
|
556 |
-
msgid "Save Poll"
|
557 |
-
msgstr "Guardar encuesta"
|
558 |
-
|
559 |
-
#: polldaddy.php:1373
|
560 |
-
#: polldaddy.php:3935
|
561 |
-
msgid "Poll results"
|
562 |
-
msgstr "Resultados de la encuesta"
|
563 |
-
|
564 |
-
#: polldaddy.php:1378
|
565 |
-
msgid "Show results to voters"
|
566 |
-
msgstr "Mostrar resultados a los votantes"
|
567 |
-
|
568 |
-
#: polldaddy.php:1378
|
569 |
-
msgid "Only show percentages"
|
570 |
-
msgstr "Mostrar solo porcentajes"
|
571 |
-
|
572 |
-
#: polldaddy.php:1378
|
573 |
-
msgid "Hide all results"
|
574 |
-
msgstr "Esconder todos los resultados"
|
575 |
-
|
576 |
-
#: polldaddy.php:1396
|
577 |
-
#: polldaddy.php:3952
|
578 |
-
msgid "Block repeat voters"
|
579 |
-
msgstr "Bloquear votantes repetidos"
|
580 |
-
|
581 |
-
#: polldaddy.php:1401
|
582 |
-
msgid "Don't block repeat voters"
|
583 |
-
msgstr "No bloquear votantes repetidos"
|
584 |
-
|
585 |
-
#: polldaddy.php:1401
|
586 |
-
msgid "Block by cookie (recommended)"
|
587 |
-
msgstr "Bloquear usando cookies (recomendado)"
|
588 |
-
|
589 |
-
#: polldaddy.php:1401
|
590 |
-
msgid "Block by cookie and by IP address"
|
591 |
-
msgstr "Bloquear usando cookies y direcciones IP"
|
592 |
-
|
593 |
-
#: polldaddy.php:1416
|
594 |
-
msgid "Expires: "
|
595 |
-
msgstr "Expira: "
|
596 |
-
|
597 |
-
#: polldaddy.php:1418
|
598 |
-
#: polldaddy.php:3957
|
599 |
-
msgid "Never"
|
600 |
-
msgstr "Nunca"
|
601 |
-
|
602 |
-
#: polldaddy.php:1419
|
603 |
-
#: polldaddy.php:3958
|
604 |
-
#, php-format
|
605 |
-
msgid "%d hour"
|
606 |
-
msgstr "%d hora"
|
607 |
-
|
608 |
-
#: polldaddy.php:1420
|
609 |
-
#: polldaddy.php:1421
|
610 |
-
#: polldaddy.php:1422
|
611 |
-
#: polldaddy.php:3959
|
612 |
-
#: polldaddy.php:3960
|
613 |
-
#: polldaddy.php:3961
|
614 |
-
#, php-format
|
615 |
-
msgid "%d hours"
|
616 |
-
msgstr "%d horas"
|
617 |
-
|
618 |
-
#: polldaddy.php:1423
|
619 |
-
#: polldaddy.php:3962
|
620 |
-
#, php-format
|
621 |
-
msgid "%d day"
|
622 |
-
msgstr "%d día"
|
623 |
-
|
624 |
-
#: polldaddy.php:1424
|
625 |
-
#: polldaddy.php:3963
|
626 |
-
#, php-format
|
627 |
-
msgid "%d week"
|
628 |
-
msgstr "%d semana"
|
629 |
-
|
630 |
-
#: polldaddy.php:1425
|
631 |
-
#: polldaddy.php:3964
|
632 |
-
#, php-format
|
633 |
-
msgid "%d month"
|
634 |
-
msgstr "%d mes"
|
635 |
-
|
636 |
-
#: polldaddy.php:1427
|
637 |
-
msgid "Note: Blocking by cookie and IP address can be problematic for some voters."
|
638 |
-
msgstr "Nota: Bloquear usando cookies y direcciones IP puede acarrear problemas a algunos usuarios."
|
639 |
-
|
640 |
-
#: polldaddy.php:1442
|
641 |
-
msgid "Answers"
|
642 |
-
msgstr "Respuestas"
|
643 |
-
|
644 |
-
#: polldaddy.php:1488
|
645 |
-
msgid "Add another"
|
646 |
-
msgstr "Añadir otra"
|
647 |
-
|
648 |
-
#: polldaddy.php:1494
|
649 |
-
msgid "Multiple choice"
|
650 |
-
msgstr "Multirespuesta"
|
651 |
-
|
652 |
-
#: polldaddy.php:1494
|
653 |
-
msgid "Randomize answer order"
|
654 |
-
msgstr "Aleatorizar el orden de las respuestas"
|
655 |
-
|
656 |
-
#: polldaddy.php:1494
|
657 |
-
msgid "Allow other answers"
|
658 |
-
msgstr "Permitir otras encuestas"
|
659 |
-
|
660 |
-
#: polldaddy.php:1494
|
661 |
-
msgid "'Share This' link"
|
662 |
-
msgstr "Enlace 'Compartir'"
|
663 |
-
|
664 |
-
#: polldaddy.php:1623
|
665 |
-
msgid "Design"
|
666 |
-
msgstr "Diseño"
|
667 |
-
|
668 |
-
#: polldaddy.php:1704
|
669 |
-
#: polldaddy.php:1759
|
670 |
-
msgid "Custom Style"
|
671 |
-
msgstr "Estilo personalizado"
|
672 |
-
|
673 |
-
#: polldaddy.php:1717
|
674 |
-
#: polldaddy.php:1813
|
675 |
-
msgid "Please choose a custom style..."
|
676 |
-
msgstr "Elige un estilo personalizado..."
|
677 |
-
|
678 |
-
#: polldaddy.php:1723
|
679 |
-
#: polldaddy.php:1819
|
680 |
-
msgid "Please choose a style."
|
681 |
-
msgstr "Elige un estilo."
|
682 |
-
|
683 |
-
#: polldaddy.php:1728
|
684 |
-
#: polldaddy.php:1824
|
685 |
-
#, php-format
|
686 |
-
msgid "Did you know we have a new editor for building your own custom poll styles? Find out more <a href=\"%s\" target=\"_blank\">here</a>."
|
687 |
-
msgstr "¿Sabías que tenemos un nuevo editor para construir tus propios estilos para encuestas? Entérate de más <a href=\"%s\" target=\"_blank\">aquí</a>."
|
688 |
-
|
689 |
-
#: polldaddy.php:1751
|
690 |
-
msgid "PollDaddy Style"
|
691 |
-
msgstr "Estilo de PollDaddy"
|
692 |
-
|
693 |
-
#: polldaddy.php:1876
|
694 |
-
msgid "Answer"
|
695 |
-
msgstr "Respuesta"
|
696 |
-
|
697 |
-
#: polldaddy.php:1891
|
698 |
-
#, php-format
|
699 |
-
msgid "Other (<a href=\"%s\">see below</a>)"
|
700 |
-
msgstr "Otra (<a href=\"%s\">ver debajo</a>)"
|
701 |
-
|
702 |
-
#: polldaddy.php:1921
|
703 |
-
#: polldaddy.php:3923
|
704 |
-
msgid "Other Answer"
|
705 |
-
msgstr "Otra respuesta"
|
706 |
-
|
707 |
-
#: polldaddy.php:1986
|
708 |
-
msgid "Style"
|
709 |
-
msgstr "Esilo"
|
710 |
-
|
711 |
-
#: polldaddy.php:1987
|
712 |
-
msgid "Last Modified"
|
713 |
-
msgstr "Modificado en"
|
714 |
-
|
715 |
-
#: polldaddy.php:2027
|
716 |
-
#, php-format
|
717 |
-
msgid "No custom styles yet. <a href=\"%s\">Create one</a>"
|
718 |
-
msgstr "No existen estilos personalizados aún. <a href=\"%s\">Crear uno</a>"
|
719 |
-
|
720 |
-
#: polldaddy.php:2103
|
721 |
-
msgid "Style Name"
|
722 |
-
msgstr "Nombre de estilo"
|
723 |
-
|
724 |
-
#: polldaddy.php:2118
|
725 |
-
msgid "Preload Basic Style"
|
726 |
-
msgstr "Precargar el estilo básico"
|
727 |
-
|
728 |
-
#: polldaddy.php:2132
|
729 |
-
msgid "Load Style"
|
730 |
-
msgstr "Cargar estilo"
|
731 |
-
|
732 |
-
#: polldaddy.php:2921
|
733 |
-
msgid "Save Style"
|
734 |
-
msgstr "Guardar estilo"
|
735 |
-
|
736 |
-
#: polldaddy.php:3064
|
737 |
-
#, php-format
|
738 |
-
msgid "Sorry! There was an error creating your rating widget. Please contact <a href=\"%1$s\" %2$s>PollDaddy support</a> to fix this."
|
739 |
-
msgstr "¡Glups! Ha ocurrido un error creando tu widget de votacón. Contacta con<a href=\"%1$s\" %2$s>el soporte de PollDaddy</a> para arreglarlo."
|
740 |
-
|
741 |
-
#: polldaddy.php:3103
|
742 |
-
msgid "Rating Settings"
|
743 |
-
msgstr "Preferencias de votaciones"
|
744 |
-
|
745 |
-
#: polldaddy.php:3105
|
746 |
-
msgid "Rating updated"
|
747 |
-
msgstr "Calificación actualizada"
|
748 |
-
|
749 |
-
#: polldaddy.php:3117
|
750 |
-
#: polldaddy.php:3653
|
751 |
-
msgid "Posts"
|
752 |
-
msgstr "Entradas"
|
753 |
-
|
754 |
-
#: polldaddy.php:3121
|
755 |
-
#: polldaddy.php:3653
|
756 |
-
msgid "Pages"
|
757 |
-
msgstr "Páginas"
|
758 |
-
|
759 |
-
#: polldaddy.php:3125
|
760 |
-
#: polldaddy.php:3653
|
761 |
-
msgid "Comments"
|
762 |
-
msgstr "Comentarios"
|
763 |
-
|
764 |
-
#: polldaddy.php:3136
|
765 |
-
msgid "Enable for blog posts"
|
766 |
-
msgstr "Habilitar en entradas"
|
767 |
-
|
768 |
-
#: polldaddy.php:3140
|
769 |
-
#: polldaddy.php:3158
|
770 |
-
msgid "Above each blog post"
|
771 |
-
msgstr "Encima de cada entrada"
|
772 |
-
|
773 |
-
#: polldaddy.php:3140
|
774 |
-
#: polldaddy.php:3158
|
775 |
-
msgid "Below each blog post"
|
776 |
-
msgstr "Debajo de cada entrada"
|
777 |
-
|
778 |
-
#: polldaddy.php:3154
|
779 |
-
msgid "Enable for front page"
|
780 |
-
msgstr "Habilitar en la portada"
|
781 |
-
|
782 |
-
#: polldaddy.php:3174
|
783 |
-
msgid "Enable for pages"
|
784 |
-
msgstr "Habilitar en páginas"
|
785 |
-
|
786 |
-
#: polldaddy.php:3178
|
787 |
-
msgid "Above each page"
|
788 |
-
msgstr "Encima de cada página"
|
789 |
-
|
790 |
-
#: polldaddy.php:3178
|
791 |
-
msgid "Below each page"
|
792 |
-
msgstr "Debajo de cada página"
|
793 |
-
|
794 |
-
#: polldaddy.php:3194
|
795 |
-
msgid "Enable for comments"
|
796 |
-
msgstr "Habilitar en comentarios"
|
797 |
-
|
798 |
-
#: polldaddy.php:3198
|
799 |
-
msgid "Above each comment"
|
800 |
-
msgstr "Encima de cada comentario"
|
801 |
-
|
802 |
-
#: polldaddy.php:3198
|
803 |
-
msgid "Below each comment"
|
804 |
-
msgstr "Debajo de cada comentario"
|
805 |
-
|
806 |
-
#: polldaddy.php:3213
|
807 |
-
#: polldaddy.php:3244
|
808 |
-
msgid "Save Changes"
|
809 |
-
msgstr "Guardar cambios"
|
810 |
-
|
811 |
-
#: polldaddy.php:3224
|
812 |
-
msgid "Advanced Settings"
|
813 |
-
msgstr "Preferencias avanzadas"
|
814 |
-
|
815 |
-
#: polldaddy.php:3237
|
816 |
-
msgid "Save"
|
817 |
-
msgstr "Guardar"
|
818 |
-
|
819 |
-
#: polldaddy.php:3253
|
820 |
-
msgid "This is a demo of what your rating widget will look like"
|
821 |
-
msgstr "Esta es una prueba para mostrar cómo aparecerá tu widget"
|
822 |
-
|
823 |
-
#: polldaddy.php:3260
|
824 |
-
msgid "Customize Labels"
|
825 |
-
msgstr "Personalizar etiquetas"
|
826 |
-
|
827 |
-
#: polldaddy.php:3264
|
828 |
-
msgid "votes"
|
829 |
-
msgstr "votos"
|
830 |
-
|
831 |
-
#: polldaddy.php:3268
|
832 |
-
msgid "rate this"
|
833 |
-
msgstr "calificar"
|
834 |
-
|
835 |
-
#: polldaddy.php:3272
|
836 |
-
#, php-format
|
837 |
-
msgid "%d star"
|
838 |
-
msgstr "%d estrella"
|
839 |
-
|
840 |
-
#: polldaddy.php:3276
|
841 |
-
#: polldaddy.php:3280
|
842 |
-
#: polldaddy.php:3284
|
843 |
-
#: polldaddy.php:3288
|
844 |
-
#, php-format
|
845 |
-
msgid "%d stars"
|
846 |
-
msgstr "%s estrellas"
|
847 |
-
|
848 |
-
#: polldaddy.php:3292
|
849 |
-
msgid "Thank You"
|
850 |
-
msgstr "Gracias"
|
851 |
-
|
852 |
-
#: polldaddy.php:3296
|
853 |
-
msgid "Rate Up"
|
854 |
-
msgstr "Me gusta"
|
855 |
-
|
856 |
-
#: polldaddy.php:3300
|
857 |
-
msgid "Rate Down"
|
858 |
-
msgstr "No me gusta"
|
859 |
-
|
860 |
-
#: polldaddy.php:3309
|
861 |
-
msgid "Rating Type"
|
862 |
-
msgstr "Tipo de votación"
|
863 |
-
|
864 |
-
#: polldaddy.php:3311
|
865 |
-
msgid "Here you can choose how you want your rating to display. The 5 star rating is the most commonly used. The Nero rating is useful for keeping it simple."
|
866 |
-
msgstr "Aquí puedes elegir cómo quieres que las votaciones se muestren. El sistema de 5 estrellas es el más usado. El sistema Sí/No es útil para mantener las cosas simples."
|
867 |
-
|
868 |
-
#: polldaddy.php:3319
|
869 |
-
#, php-format
|
870 |
-
msgid "%d Star Rating"
|
871 |
-
msgstr "%d Votación con estrellas"
|
872 |
-
|
873 |
-
#: polldaddy.php:3328
|
874 |
-
msgid "Nero Rating"
|
875 |
-
msgstr "Votación Sí/No"
|
876 |
-
|
877 |
-
#: polldaddy.php:3335
|
878 |
-
msgid "Rating Style"
|
879 |
-
msgstr "Estilo de votación"
|
880 |
-
|
881 |
-
#: polldaddy.php:3342
|
882 |
-
msgid "Small"
|
883 |
-
msgstr "Pequeño"
|
884 |
-
|
885 |
-
#: polldaddy.php:3342
|
886 |
-
msgid "Medium"
|
887 |
-
msgstr "Mediano"
|
888 |
-
|
889 |
-
#: polldaddy.php:3342
|
890 |
-
msgid "Large"
|
891 |
-
msgstr "Grande"
|
892 |
-
|
893 |
-
#: polldaddy.php:3353
|
894 |
-
msgid "Star Color"
|
895 |
-
msgstr "Color de las estrellas"
|
896 |
-
|
897 |
-
#: polldaddy.php:3356
|
898 |
-
msgid "Yellow"
|
899 |
-
msgstr "Amarillo"
|
900 |
-
|
901 |
-
#: polldaddy.php:3356
|
902 |
-
msgid "Red"
|
903 |
-
msgstr "Rojo"
|
904 |
-
|
905 |
-
#: polldaddy.php:3356
|
906 |
-
msgid "Blue"
|
907 |
-
msgstr "Azul"
|
908 |
-
|
909 |
-
#: polldaddy.php:3356
|
910 |
-
msgid "Green"
|
911 |
-
msgstr "Verde"
|
912 |
-
|
913 |
-
#: polldaddy.php:3356
|
914 |
-
msgid "Grey"
|
915 |
-
msgstr "Gris"
|
916 |
-
|
917 |
-
#: polldaddy.php:3365
|
918 |
-
msgid "Hand"
|
919 |
-
msgstr "Carne"
|
920 |
-
|
921 |
-
#: polldaddy.php:3376
|
922 |
-
msgid "Custom Image"
|
923 |
-
msgstr "Imagen personalizada"
|
924 |
-
|
925 |
-
#: polldaddy.php:3383
|
926 |
-
msgid "Text Layout & Font"
|
927 |
-
msgstr "Disposición del texto y tipografía"
|
928 |
-
|
929 |
-
#: polldaddy.php:3387
|
930 |
-
msgid "Align"
|
931 |
-
msgstr "Alinear"
|
932 |
-
|
933 |
-
#: polldaddy.php:3390
|
934 |
-
msgid "Left"
|
935 |
-
msgstr "Izquierda"
|
936 |
-
|
937 |
-
#: polldaddy.php:3390
|
938 |
-
msgid "Center"
|
939 |
-
msgstr "Centro"
|
940 |
-
|
941 |
-
#: polldaddy.php:3390
|
942 |
-
#: polldaddy.php:3404
|
943 |
-
msgid "Right"
|
944 |
-
msgstr "Derecha"
|
945 |
-
|
946 |
-
#: polldaddy.php:3401
|
947 |
-
msgid "Position"
|
948 |
-
msgstr "Posición"
|
949 |
-
|
950 |
-
#: polldaddy.php:3404
|
951 |
-
msgid "Top"
|
952 |
-
msgstr "Arriba"
|
953 |
-
|
954 |
-
#: polldaddy.php:3404
|
955 |
-
msgid "Bottom"
|
956 |
-
msgstr "Abajo"
|
957 |
-
|
958 |
-
#: polldaddy.php:3415
|
959 |
-
msgid "Font"
|
960 |
-
msgstr "Tipografía"
|
961 |
-
|
962 |
-
#: polldaddy.php:3418
|
963 |
-
#: polldaddy.php:3437
|
964 |
-
#: polldaddy.php:3451
|
965 |
-
msgid "Inherit"
|
966 |
-
msgstr "Heredar"
|
967 |
-
|
968 |
-
#: polldaddy.php:3429
|
969 |
-
msgid "Color"
|
970 |
-
msgstr "Color"
|
971 |
-
|
972 |
-
#: polldaddy.php:3434
|
973 |
-
msgid "Size"
|
974 |
-
msgstr "Tamaño"
|
975 |
-
|
976 |
-
#: polldaddy.php:3448
|
977 |
-
msgid "Line Height"
|
978 |
-
msgstr "Tamaño de línea"
|
979 |
-
|
980 |
-
#: polldaddy.php:3462
|
981 |
-
msgid "Bold"
|
982 |
-
msgstr "Negrita"
|
983 |
-
|
984 |
-
#: polldaddy.php:3471
|
985 |
-
msgid "Italic"
|
986 |
-
msgstr "Cursiva"
|
987 |
-
|
988 |
-
#: polldaddy.php:3640
|
989 |
-
msgid "«"
|
990 |
-
msgstr "«"
|
991 |
-
|
992 |
-
#: polldaddy.php:3641
|
993 |
-
msgid "»"
|
994 |
-
msgstr "»"
|
995 |
-
|
996 |
-
#: polldaddy.php:3647
|
997 |
-
msgid "Rating Reports"
|
998 |
-
msgstr "Informes de votación"
|
999 |
-
|
1000 |
-
#: polldaddy.php:3662
|
1001 |
-
msgid "View Report"
|
1002 |
-
msgstr "Ver informe"
|
1003 |
-
|
1004 |
-
#: polldaddy.php:3664
|
1005 |
-
msgid "Last 24 hours"
|
1006 |
-
msgstr "Últimos 24 horas"
|
1007 |
-
|
1008 |
-
#: polldaddy.php:3664
|
1009 |
-
msgid "Last 7 days"
|
1010 |
-
msgstr "Últimos 7 días"
|
1011 |
-
|
1012 |
-
#: polldaddy.php:3664
|
1013 |
-
msgid "Last 31 days"
|
1014 |
-
msgstr "Últimos 31 días"
|
1015 |
-
|
1016 |
-
#: polldaddy.php:3664
|
1017 |
-
msgid "Last 3 months"
|
1018 |
-
msgstr "Últimos 3 meses"
|
1019 |
-
|
1020 |
-
#: polldaddy.php:3664
|
1021 |
-
msgid "Last 12 months"
|
1022 |
-
msgstr "Últimos 12 meses"
|
1023 |
-
|
1024 |
-
#: polldaddy.php:3664
|
1025 |
-
msgid "All time"
|
1026 |
-
msgstr "Todo el tiempo"
|
1027 |
-
|
1028 |
-
#: polldaddy.php:3672
|
1029 |
-
msgid "Filter Report"
|
1030 |
-
msgstr "Informe de filtros"
|
1031 |
-
|
1032 |
-
#: polldaddy.php:3686
|
1033 |
-
#, php-format
|
1034 |
-
msgid "No ratings have been collected for your %s yet."
|
1035 |
-
msgstr "Nadie ha calificado %s todavía."
|
1036 |
-
|
1037 |
-
#: polldaddy.php:3692
|
1038 |
-
msgid "Start Date"
|
1039 |
-
msgstr "Fecha de inicio"
|
1040 |
-
|
1041 |
-
#: polldaddy.php:3695
|
1042 |
-
msgid "Average Rating"
|
1043 |
-
msgstr "Calificación media"
|
1044 |
-
|
1045 |
-
#: polldaddy.php:3856
|
1046 |
-
msgid "PollDaddy Account Info"
|
1047 |
-
msgstr "Información de la cuenta de PollDaddy"
|
1048 |
-
|
1049 |
-
#: polldaddy.php:3859
|
1050 |
-
msgid "This is the PollDadddy account you currently have imported into your WordPress account"
|
1051 |
-
msgstr "Esta es la cuenta de PollDaddy que tienes importada en tu cuenta de WordPress"
|
1052 |
-
|
1053 |
-
#: polldaddy.php:3890
|
1054 |
-
msgid "Import Account"
|
1055 |
-
msgstr "Importar cuenta"
|
1056 |
-
|
1057 |
-
#: polldaddy.php:3896
|
1058 |
-
msgid "General Settings"
|
1059 |
-
msgstr "Preferencias generales"
|
1060 |
-
|
1061 |
-
#: polldaddy.php:3904
|
1062 |
-
msgid "Default poll settings"
|
1063 |
-
msgstr "Preferencias de encuesta por defecto"
|
1064 |
-
|
1065 |
-
#: polldaddy.php:3913
|
1066 |
-
msgid "Multiple Choice"
|
1067 |
-
msgstr "Multirespuesta"
|
1068 |
-
|
1069 |
-
#: polldaddy.php:3918
|
1070 |
-
msgid "Randomise Answers"
|
1071 |
-
msgstr "Aleatorizar respuestas"
|
1072 |
-
|
1073 |
-
#: polldaddy.php:3928
|
1074 |
-
msgid "Sharing"
|
1075 |
-
msgstr "Compartir"
|
1076 |
-
|
1077 |
-
#: polldaddy.php:3932
|
1078 |
-
msgid "Show"
|
1079 |
-
msgstr "Mostrar"
|
1080 |
-
|
1081 |
-
#: polldaddy.php:3933
|
1082 |
-
msgid "Hide"
|
1083 |
-
msgstr "Ocultar"
|
1084 |
-
|
1085 |
-
#: polldaddy.php:3934
|
1086 |
-
msgid "Percentages"
|
1087 |
-
msgstr "Porcentajes"
|
1088 |
-
|
1089 |
-
#: polldaddy.php:3944
|
1090 |
-
msgid "Poll style"
|
1091 |
-
msgstr "Estilo de encuesta"
|
1092 |
-
|
1093 |
-
#: polldaddy.php:3949
|
1094 |
-
msgid "Off"
|
1095 |
-
msgstr "Apagado"
|
1096 |
-
|
1097 |
-
#: polldaddy.php:3950
|
1098 |
-
msgid "Cookie"
|
1099 |
-
msgstr "Cookie"
|
1100 |
-
|
1101 |
-
#: polldaddy.php:3951
|
1102 |
-
msgid "Cookie & IP address"
|
1103 |
-
msgstr "Cookie y dirección IP"
|
1104 |
-
|
1105 |
-
#: polldaddy.php:3965
|
1106 |
-
msgid "Block expiration limit"
|
1107 |
-
msgstr "Bloquear límite de expiración"
|
1108 |
-
|
1109 |
-
#: polldaddy.php:3977
|
1110 |
-
msgid "Save Options"
|
1111 |
-
msgstr "Guardar opciones"
|
1112 |
-
|
1113 |
-
#. Plugin Name of an extension
|
1114 |
-
msgid "PollDaddy Polls"
|
1115 |
-
msgstr "Encuestas de PollDaddy"
|
1116 |
-
|
1117 |
-
#. Description of an extension
|
1118 |
-
msgid "Create and manage PollDaddy polls and ratings in WordPress"
|
1119 |
-
msgstr "Crear y administrar las encuestas y votaciones de PollDaddy en WordPress"
|
1120 |
-
|
1121 |
-
#. Author of an extension
|
1122 |
-
msgid "Automattic, Inc."
|
1123 |
-
msgstr "Automattic, Inc."
|
1124 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
locale/{polldaddy-tr_TR.mo → polldaddy-tr.mo}
RENAMED
File without changes
|
locale/{polldaddy-tr_TR.po → polldaddy-tr.po}
RENAMED
File without changes
|
polldaddy-client.php
CHANGED
@@ -6,25 +6,22 @@ class api_client {
|
|
6 |
var $polldaddy_url = 'http://api.polldaddy.com/';
|
7 |
var $partnerGUID;
|
8 |
var $userCode;
|
9 |
-
var $admin
|
10 |
-
var $version
|
11 |
-
|
12 |
-
var $
|
13 |
-
var $
|
14 |
-
var $
|
15 |
-
var $
|
16 |
-
|
17 |
-
var $
|
18 |
-
var $responses = array();
|
19 |
-
|
20 |
-
var $errors = array();
|
21 |
|
22 |
function api_client( $partnerGUID = '', $userCode = null ) {
|
23 |
$this->partnerGUID = $partnerGUID;
|
24 |
$this->userCode = $userCode;
|
25 |
}
|
26 |
|
27 |
-
function send_request() {
|
28 |
$this->request_xml = "<?xml version='1.0' encoding='utf-8' ?>\n";
|
29 |
$this->request_xml .= $this->request->xml( 'all' );
|
30 |
|
@@ -34,6 +31,7 @@ class api_client {
|
|
34 |
$response = wp_remote_post( $this->polldaddy_url, array(
|
35 |
'headers' => array( 'Content-Type' => 'text/xml; charset=utf-8', 'Content-Length' => strlen( $this->request_xml ) ),
|
36 |
'user-agent' => 'PollDaddy PHP Client/0.1',
|
|
|
37 |
'body' => $this->request_xml
|
38 |
) );
|
39 |
if ( !$response || is_wp_error( $response ) ) {
|
@@ -54,7 +52,7 @@ class api_client {
|
|
54 |
$parsed['scheme'] == 'ssl' || $parsed['scheme'] == 'https' && extension_loaded('openssl') ? 443 : 80,
|
55 |
$err_num,
|
56 |
$err_str,
|
57 |
-
|
58 |
);
|
59 |
|
60 |
if ( !$fp ) {
|
@@ -63,7 +61,7 @@ class api_client {
|
|
63 |
}
|
64 |
|
65 |
if ( function_exists( 'stream_set_timeout' ) )
|
66 |
-
stream_set_timeout( $fp,
|
67 |
|
68 |
if ( !isset( $parsed['path']) || !$path = $parsed['path'] . ( isset($parsed['query']) ? '?' . $parsed['query'] : '' ) )
|
69 |
$path = '/';
|
@@ -92,6 +90,7 @@ class api_client {
|
|
92 |
$this->responses[] = $this->response_xml;
|
93 |
|
94 |
$parser = new PollDaddy_XML_Parser( $this->response_xml );
|
|
|
95 |
$this->response =& $parser->objects[0];
|
96 |
if ( isset( $this->response->errors->error ) ) {
|
97 |
if ( !is_array( $this->response->errors->error ) )
|
@@ -141,11 +140,15 @@ class api_client {
|
|
141 |
}
|
142 |
|
143 |
function reset() {
|
144 |
-
$this->request
|
145 |
-
$this->response
|
146 |
-
$this->
|
147 |
-
$this->
|
148 |
-
$this->
|
|
|
|
|
|
|
|
|
149 |
}
|
150 |
|
151 |
/* pdInitiate: Initiate API "connection" */
|
@@ -778,7 +781,7 @@ function sync_rating( ){
|
|
778 |
|
779 |
// $pos = $this->add_request( __FUNCTION__, $style );
|
780 |
$pos = $this->add_request( 'updatestyle', $style );
|
781 |
-
$this->send_request();
|
782 |
if ( !$demand = $this->response_part( $pos ) )
|
783 |
return $demand;
|
784 |
if ( !isset( $demand->style ) )
|
@@ -894,6 +897,46 @@ function sync_rating( ){
|
|
894 |
|
895 |
}
|
896 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
897 |
function get_xml(){
|
898 |
return array( 'REQUEST' => $this->request_xml, 'RESPONSE' => $this->response_xml );
|
899 |
}
|
6 |
var $polldaddy_url = 'http://api.polldaddy.com/';
|
7 |
var $partnerGUID;
|
8 |
var $userCode;
|
9 |
+
var $admin = 0;
|
10 |
+
var $version = '1.0';
|
11 |
+
var $request = null;
|
12 |
+
var $response = null;
|
13 |
+
var $request_xml = '';
|
14 |
+
var $response_xml = '';
|
15 |
+
var $requests = array();
|
16 |
+
var $responses = array();
|
17 |
+
var $errors = array();
|
|
|
|
|
|
|
18 |
|
19 |
function api_client( $partnerGUID = '', $userCode = null ) {
|
20 |
$this->partnerGUID = $partnerGUID;
|
21 |
$this->userCode = $userCode;
|
22 |
}
|
23 |
|
24 |
+
function send_request( $timeout = 3 ) {
|
25 |
$this->request_xml = "<?xml version='1.0' encoding='utf-8' ?>\n";
|
26 |
$this->request_xml .= $this->request->xml( 'all' );
|
27 |
|
31 |
$response = wp_remote_post( $this->polldaddy_url, array(
|
32 |
'headers' => array( 'Content-Type' => 'text/xml; charset=utf-8', 'Content-Length' => strlen( $this->request_xml ) ),
|
33 |
'user-agent' => 'PollDaddy PHP Client/0.1',
|
34 |
+
'timeout' => $timeout,
|
35 |
'body' => $this->request_xml
|
36 |
) );
|
37 |
if ( !$response || is_wp_error( $response ) ) {
|
52 |
$parsed['scheme'] == 'ssl' || $parsed['scheme'] == 'https' && extension_loaded('openssl') ? 443 : 80,
|
53 |
$err_num,
|
54 |
$err_str,
|
55 |
+
$timeout
|
56 |
);
|
57 |
|
58 |
if ( !$fp ) {
|
61 |
}
|
62 |
|
63 |
if ( function_exists( 'stream_set_timeout' ) )
|
64 |
+
stream_set_timeout( $fp, $timeout );
|
65 |
|
66 |
if ( !isset( $parsed['path']) || !$path = $parsed['path'] . ( isset($parsed['query']) ? '?' . $parsed['query'] : '' ) )
|
67 |
$path = '/';
|
90 |
$this->responses[] = $this->response_xml;
|
91 |
|
92 |
$parser = new PollDaddy_XML_Parser( $this->response_xml );
|
93 |
+
|
94 |
$this->response =& $parser->objects[0];
|
95 |
if ( isset( $this->response->errors->error ) ) {
|
96 |
if ( !is_array( $this->response->errors->error ) )
|
140 |
}
|
141 |
|
142 |
function reset() {
|
143 |
+
$this->request = null;
|
144 |
+
$this->response = null;
|
145 |
+
$this->request_data = '';
|
146 |
+
$this->response_data = '';
|
147 |
+
$this->request_xml = '';
|
148 |
+
$this->response_xml = '';
|
149 |
+
$this->request_json = '';
|
150 |
+
$this->response_json = '';
|
151 |
+
$this->errors = array();
|
152 |
}
|
153 |
|
154 |
/* pdInitiate: Initiate API "connection" */
|
781 |
|
782 |
// $pos = $this->add_request( __FUNCTION__, $style );
|
783 |
$pos = $this->add_request( 'updatestyle', $style );
|
784 |
+
$this->send_request(30);
|
785 |
if ( !$demand = $this->response_part( $pos ) )
|
786 |
return $demand;
|
787 |
if ( !isset( $demand->style ) )
|
897 |
|
898 |
}
|
899 |
|
900 |
+
/* Add Media
|
901 |
+
* @param string $name PollDaddy media name
|
902 |
+
* @param string $type PollDaddy media type
|
903 |
+
* @param string $size PollDaddy media size
|
904 |
+
* @param string $data PollDaddy media data
|
905 |
+
* @return array|false PollDaddy Media or false on failure
|
906 |
+
*/
|
907 |
+
|
908 |
+
function upload_image( $name, $url, $type, $id = 0 ){
|
909 |
+
|
910 |
+
$pos = $this->add_request( 'uploadimageurl', new PollDaddy_Media( compact( 'name', 'type', 'url' ) , compact( 'id' ) ) );
|
911 |
+
|
912 |
+
$this->send_request(30);
|
913 |
+
|
914 |
+
$demand = $this->response_part( $pos );
|
915 |
+
|
916 |
+
if ( is_a( $demand, 'Ghetto_XML_Object' ) && isset( $demand->media ) ){
|
917 |
+
return $demand->media;
|
918 |
+
}
|
919 |
+
|
920 |
+
return false;
|
921 |
+
}
|
922 |
+
|
923 |
+
function get_media( $id ){
|
924 |
+
if ( !$id = (int) $id )
|
925 |
+
return false;
|
926 |
+
|
927 |
+
$pos = $this->add_request( 'getmedia', new PollDaddy_Media( null, compact( 'id' ) ) );
|
928 |
+
|
929 |
+
$this->send_request();
|
930 |
+
|
931 |
+
$demand = $this->response_part( $pos );
|
932 |
+
|
933 |
+
if ( is_a( $demand, 'Ghetto_XML_Object' ) && isset( $demand->media ) ){
|
934 |
+
return $demand->media;
|
935 |
+
}
|
936 |
+
|
937 |
+
return false;
|
938 |
+
}
|
939 |
+
|
940 |
function get_xml(){
|
941 |
return array( 'REQUEST' => $this->request_xml, 'RESPONSE' => $this->response_xml );
|
942 |
}
|
polldaddy-org.php
CHANGED
@@ -11,12 +11,12 @@ class WPORG_PollDaddy extends WP_PollDaddy {
|
|
11 |
|
12 |
function __construct() {
|
13 |
parent::__construct();
|
14 |
-
$this->version
|
15 |
-
$this->base_url
|
16 |
$this->polldaddy_client_class = 'WPORG_PollDaddy_Client';
|
17 |
-
$this->use_ssl
|
18 |
-
$this->multiple_accounts
|
19 |
-
$this->is_author
|
20 |
return;
|
21 |
}
|
22 |
|
@@ -57,7 +57,7 @@ class WPORG_PollDaddy extends WP_PollDaddy {
|
|
57 |
$this->set_api_user_code();
|
58 |
|
59 |
if ( $page == 'polls' ) {
|
60 |
-
switch ( $action )
|
61 |
case 'update-options' :
|
62 |
if ( !$is_POST )
|
63 |
return;
|
@@ -68,7 +68,7 @@ class WPORG_PollDaddy extends WP_PollDaddy {
|
|
68 |
$polldaddy = $this->get_client( WP_POLLDADDY__PARTNERGUID, $this->user_code );
|
69 |
$polldaddy->reset();
|
70 |
|
71 |
-
$polldaddy_sync_account
|
72 |
$polldaddy_multiple_accounts = 0;
|
73 |
|
74 |
if ( isset( $_POST['polldaddy-sync-account'] ) )
|
@@ -87,8 +87,8 @@ class WPORG_PollDaddy extends WP_PollDaddy {
|
|
87 |
$polldaddy->update_partner_account( $partner );
|
88 |
update_option( 'polldaddy_multiple_accounts', $polldaddy_multiple_accounts );
|
89 |
}
|
90 |
-
|
91 |
-
|
92 |
}
|
93 |
|
94 |
parent::management_page_load();
|
@@ -100,7 +100,7 @@ class WPORG_PollDaddy extends WP_PollDaddy {
|
|
100 |
|
101 |
check_admin_referer( 'polldaddy-account' );
|
102 |
|
103 |
-
$polldaddy_email
|
104 |
$polldaddy_password = stripslashes( $_POST['polldaddy_password'] );
|
105 |
|
106 |
if ( !$polldaddy_email )
|
@@ -117,15 +117,15 @@ class WPORG_PollDaddy extends WP_PollDaddy {
|
|
117 |
$this->use_ssl = 0; //checked (by default)
|
118 |
} else {
|
119 |
$this->use_ssl = 1; //unchecked
|
120 |
-
$this->scheme
|
121 |
}
|
122 |
update_option( 'polldaddy_use_ssl', $this->use_ssl );
|
123 |
}
|
124 |
|
125 |
$details = array(
|
126 |
-
'uName'
|
127 |
-
'uEmail'
|
128 |
-
'uPass'
|
129 |
'partner_userid' => $this->id
|
130 |
);
|
131 |
|
@@ -363,7 +363,7 @@ define( 'WP_POLLDADDY__POLLDADDY_CLIENT_PATH', dirname( __FILE__ ) . '/polldaddy
|
|
363 |
|
364 |
function polldaddy_loader() {
|
365 |
global $polldaddy_object;
|
366 |
-
$polldaddy_class
|
367 |
$polldaddy_object = new $polldaddy_class;
|
368 |
load_plugin_textdomain( 'polldaddy', '', 'polldaddy/locale' );
|
369 |
add_action( 'admin_menu', array( &$polldaddy_object, 'admin_menu' ) );
|
@@ -374,52 +374,55 @@ if ( !function_exists( 'polldaddy_shortcode_handler' ) ) {
|
|
374 |
polldaddy.com
|
375 |
[polldaddy poll="139742"]
|
376 |
*/
|
377 |
-
|
378 |
function polldaddy_shortcode_handler_set_data() {
|
379 |
-
$resource
|
380 |
-
$body
|
381 |
-
$keywords_xml = simplexml_load_string
|
382 |
-
$keywords
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
|
|
|
|
|
|
|
|
387 |
}
|
388 |
-
|
389 |
-
|
390 |
return $keywords;
|
391 |
}
|
392 |
-
|
393 |
function polldaddy_add_rating_js() {
|
394 |
wp_print_scripts( 'polldaddy-rating-js' );
|
395 |
}
|
396 |
-
|
397 |
function polldaddy_shortcode_handler( $atts, $content = null ) {
|
398 |
global $post;
|
399 |
-
|
400 |
-
extract( shortcode_atts( array(
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
$survey = esc_attr( str_replace( "'", "", $survey ) );
|
419 |
$link_text = esc_attr( $link_text );
|
420 |
-
|
421 |
if ( null != $survey ) {
|
422 |
-
|
423 |
// This is the new survey embed
|
424 |
if ( $type != null ) {
|
425 |
//need to use esc_js and esc_attr as the values will be inserted into javascript while being enclosed in single quotes.
|
@@ -431,7 +434,7 @@ if ( !function_exists( 'polldaddy_shortcode_handler' ) ) {
|
|
431 |
$back_color = preg_replace( '/&(\w*);/', '&$1;', esc_js( esc_attr( $back_color ) ) );
|
432 |
$align = preg_replace( '/&(\w*);/', '&$1;', esc_js( esc_attr( $align ) ) );
|
433 |
$style = preg_replace( '/&(\w*);/', '&$1;', esc_js( esc_attr( $style ) ) );
|
434 |
-
|
435 |
return "
|
436 |
<script type='text/javascript' src='http://i0.poll.fm/survey.js' charset='UTF-8'></script>
|
437 |
<noscript><a href='http://polldaddy.com/s/$survey'>$title</a></noscript>
|
@@ -447,9 +450,9 @@ if ( !function_exists( 'polldaddy_shortcode_handler' ) ) {
|
|
447 |
style: '$style',
|
448 |
id: '$survey'
|
449 |
} );
|
450 |
-
</script>
|
451 |
";
|
452 |
-
|
453 |
} else {
|
454 |
return "
|
455 |
<script language='javascript' type='text/javascript'>
|
@@ -457,36 +460,36 @@ if ( !function_exists( 'polldaddy_shortcode_handler' ) ) {
|
|
457 |
var PDF_openText = '$link_text';
|
458 |
</script>
|
459 |
<script type='text/javascript' language='javascript' src='http://www.polldaddy.com/s.js'></script>
|
460 |
-
<noscript><a href='http://surveys.polldaddy.com/s/$survey/'>$link_text</a></noscript>
|
461 |
";
|
462 |
}
|
463 |
}
|
464 |
-
|
465 |
-
$poll
|
466 |
$rating = (int) $rating;
|
467 |
-
$cb
|
468 |
-
|
469 |
if ( $rating > 0 ) {
|
470 |
-
if ( null != $unique_id ) {
|
471 |
$unique_id = wp_specialchars( $unique_id );
|
472 |
} else {
|
473 |
$unique_id = is_page() ? 'wp-page-' : 'wp-post-';
|
474 |
$unique_id .= $post->ID;
|
475 |
}
|
476 |
-
|
477 |
if ( null != $title )
|
478 |
$title = wp_specialchars( $title );
|
479 |
else
|
480 |
$title = urlencode( $post->post_title );
|
481 |
-
|
482 |
if ( null != $permalink )
|
483 |
$permalink = clean_url( $permalink );
|
484 |
else
|
485 |
$permalink = urlencode( get_permalink( $post->ID ) );
|
486 |
-
|
487 |
wp_register_script( 'polldaddy-rating-js', 'http://i.polldaddy.com/ratings/rating.js' );
|
488 |
add_filter( 'wp_footer', 'polldaddy_add_rating_js' );
|
489 |
-
|
490 |
return '<div id="pd_rating_holder_' . $rating . '"></div>
|
491 |
<script language="javascript">
|
492 |
PDRTJS_settings_' . $rating . ' = {
|
@@ -498,38 +501,42 @@ if ( !function_exists( 'polldaddy_shortcode_handler' ) ) {
|
|
498 |
</script>';
|
499 |
} elseif ( $poll > 0 ) {
|
500 |
$cb = ( $cb == 1 ? '?cb=' . mktime() : '' );
|
501 |
-
$keywords
|
|
|
502 |
if ( ! $keywords || $keywords['generated'] <= ( time() - 300 ) ) {
|
503 |
if ( ! wp_cache_get( 'pd-keywords-fetching', 'site-options' ) ) {
|
504 |
wp_cache_set( 'pd-keywords-fetching', 1, 'site-options', 30 );
|
505 |
$keywords = polldaddy_shortcode_handler_set_data();
|
506 |
}
|
507 |
}
|
508 |
-
|
509 |
if ( !$keywords )
|
510 |
$keywords = array();
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
|
|
|
|
|
|
515 |
<noscript>
|
516 |
-
<a href="http://polldaddy.com/poll/' . $poll . '/">View This Poll</a><br/><span style="font-size:10px;"
|
517 |
</noscript>';
|
518 |
}
|
519 |
-
|
520 |
return '<!-- no polldaddy output -->';
|
521 |
}
|
522 |
-
|
523 |
// http://polldaddy.com/poll/1562975/?view=results&msg=voted
|
524 |
function polldaddy_link( $content ) {
|
525 |
return preg_replace( '!(?:\n|\A)http://polldaddy.com/poll/([0-9]+?)/(.+)?(?:\n|\Z)!i', "\n<script type='text/javascript' language='javascript' charset='utf-8' src='http://static.polldaddy.com/p/$1.js'></script><noscript> <a href='http://polldaddy.com/poll/$1/'>View Poll</a></noscript>\n", $content );
|
526 |
}
|
527 |
-
|
528 |
// higher priority because we need it before auto-link and autop get to it
|
529 |
add_filter( 'the_content', 'polldaddy_link', 1 );
|
530 |
add_filter( 'the_content_rss', 'polldaddy_link', 1 );
|
531 |
add_filter( 'comment_text', 'polldaddy_link', 1 );
|
532 |
-
|
533 |
add_shortcode( 'polldaddy', 'polldaddy_shortcode_handler' );
|
534 |
}
|
535 |
|
@@ -554,9 +561,9 @@ if ( class_exists( 'WP_Widget' ) ) {
|
|
554 |
extract($args, EXTR_SKIP);
|
555 |
|
556 |
echo $before_widget;
|
557 |
-
$title
|
558 |
-
$posts_rating_id
|
559 |
-
$pages_rating_id
|
560 |
$comments_rating_id = (int) get_option( 'pd-rating-comments-id' );
|
561 |
|
562 |
echo $before_title . $title . $after_title;
|
@@ -572,23 +579,23 @@ if ( class_exists( 'WP_Widget' ) ) {
|
|
572 |
|
573 |
function update( $new_instance, $old_instance ) {
|
574 |
|
575 |
-
$instance
|
576 |
-
$instance['title']
|
577 |
-
$instance['show_posts']
|
578 |
-
$instance['show_pages']
|
579 |
$instance['show_comments'] = (int) $new_instance['show_comments'];
|
580 |
-
$instance['item_count']
|
581 |
return $instance;
|
582 |
}
|
583 |
|
584 |
function form( $instance ) {
|
585 |
|
586 |
-
$instance
|
587 |
-
$title
|
588 |
-
$show_posts
|
589 |
-
$show_pages
|
590 |
$show_comments = (int) $instance['show_comments'];
|
591 |
-
$item_count
|
592 |
?>
|
593 |
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title', 'polldaddy' ); ?>: <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attribute_escape( $title ); ?>" /></label></p>
|
594 |
<p>
|
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' );
|
18 |
+
$this->multiple_accounts = (bool) get_option( 'polldaddy_multiple_accounts' );
|
19 |
+
$this->is_author = ( ( (bool) current_user_can('edit_others_posts')) or ( $this->multiple_accounts ) );
|
20 |
return;
|
21 |
}
|
22 |
|
57 |
$this->set_api_user_code();
|
58 |
|
59 |
if ( $page == 'polls' ) {
|
60 |
+
switch ( $action ) {
|
61 |
case 'update-options' :
|
62 |
if ( !$is_POST )
|
63 |
return;
|
68 |
$polldaddy = $this->get_client( WP_POLLDADDY__PARTNERGUID, $this->user_code );
|
69 |
$polldaddy->reset();
|
70 |
|
71 |
+
$polldaddy_sync_account = 0;
|
72 |
$polldaddy_multiple_accounts = 0;
|
73 |
|
74 |
if ( isset( $_POST['polldaddy-sync-account'] ) )
|
87 |
$polldaddy->update_partner_account( $partner );
|
88 |
update_option( 'polldaddy_multiple_accounts', $polldaddy_multiple_accounts );
|
89 |
}
|
90 |
+
break;
|
91 |
+
} //end switch
|
92 |
}
|
93 |
|
94 |
parent::management_page_load();
|
100 |
|
101 |
check_admin_referer( 'polldaddy-account' );
|
102 |
|
103 |
+
$polldaddy_email = stripslashes( $_POST['polldaddy_email'] );
|
104 |
$polldaddy_password = stripslashes( $_POST['polldaddy_password'] );
|
105 |
|
106 |
if ( !$polldaddy_email )
|
117 |
$this->use_ssl = 0; //checked (by default)
|
118 |
} else {
|
119 |
$this->use_ssl = 1; //unchecked
|
120 |
+
$this->scheme = 'http';
|
121 |
}
|
122 |
update_option( 'polldaddy_use_ssl', $this->use_ssl );
|
123 |
}
|
124 |
|
125 |
$details = array(
|
126 |
+
'uName' => get_bloginfo( 'name' ),
|
127 |
+
'uEmail' => $polldaddy_email,
|
128 |
+
'uPass' => $polldaddy_password,
|
129 |
'partner_userid' => $this->id
|
130 |
);
|
131 |
|
363 |
|
364 |
function polldaddy_loader() {
|
365 |
global $polldaddy_object;
|
366 |
+
$polldaddy_class = WP_POLLDADDY__CLASS;
|
367 |
$polldaddy_object = new $polldaddy_class;
|
368 |
load_plugin_textdomain( 'polldaddy', '', 'polldaddy/locale' );
|
369 |
add_action( 'admin_menu', array( &$polldaddy_object, 'admin_menu' ) );
|
374 |
polldaddy.com
|
375 |
[polldaddy poll="139742"]
|
376 |
*/
|
377 |
+
|
378 |
function polldaddy_shortcode_handler_set_data() {
|
379 |
+
$resource = wp_remote_get( 'http://polldaddy.com/xml/keywords.xml' );
|
380 |
+
$body = wp_remote_retrieve_body( $resource );
|
381 |
+
$keywords_xml = simplexml_load_string( $body );
|
382 |
+
$keywords = array();
|
383 |
+
|
384 |
+
if ( $keywords_xml !== false ) {
|
385 |
+
$keywords['generated'] = time();
|
386 |
+
|
387 |
+
foreach ( $keywords_xml->keyword as $keyword_xml ) {
|
388 |
+
$keywords[] = array( 'keyword' => (string) $keyword_xml, 'url' => (string) $keyword_xml['url'] );
|
389 |
+
}
|
390 |
+
wp_cache_set( 'pd-keywords', $keywords, 'site-options', 864000 );
|
391 |
}
|
392 |
+
|
|
|
393 |
return $keywords;
|
394 |
}
|
395 |
+
|
396 |
function polldaddy_add_rating_js() {
|
397 |
wp_print_scripts( 'polldaddy-rating-js' );
|
398 |
}
|
399 |
+
|
400 |
function polldaddy_shortcode_handler( $atts, $content = null ) {
|
401 |
global $post;
|
402 |
+
|
403 |
+
extract( shortcode_atts( array(
|
404 |
+
'survey' => null,
|
405 |
+
'link_text' => 'View Survey',
|
406 |
+
'poll' => 'empty',
|
407 |
+
'rating' => 'empty',
|
408 |
+
'unique_id' => null,
|
409 |
+
'title' => null,
|
410 |
+
'permalink' => null,
|
411 |
+
'cb' => 0,
|
412 |
+
'type' => null,
|
413 |
+
'body' => '',
|
414 |
+
'button' => '',
|
415 |
+
'text_color' => '000000',
|
416 |
+
'back_color' => 'FFFFFF',
|
417 |
+
'align' => '',
|
418 |
+
'style' => ''
|
419 |
+
), $atts ) );
|
420 |
+
|
421 |
$survey = esc_attr( str_replace( "'", "", $survey ) );
|
422 |
$link_text = esc_attr( $link_text );
|
423 |
+
|
424 |
if ( null != $survey ) {
|
425 |
+
|
426 |
// This is the new survey embed
|
427 |
if ( $type != null ) {
|
428 |
//need to use esc_js and esc_attr as the values will be inserted into javascript while being enclosed in single quotes.
|
434 |
$back_color = preg_replace( '/&(\w*);/', '&$1;', esc_js( esc_attr( $back_color ) ) );
|
435 |
$align = preg_replace( '/&(\w*);/', '&$1;', esc_js( esc_attr( $align ) ) );
|
436 |
$style = preg_replace( '/&(\w*);/', '&$1;', esc_js( esc_attr( $style ) ) );
|
437 |
+
|
438 |
return "
|
439 |
<script type='text/javascript' src='http://i0.poll.fm/survey.js' charset='UTF-8'></script>
|
440 |
<noscript><a href='http://polldaddy.com/s/$survey'>$title</a></noscript>
|
450 |
style: '$style',
|
451 |
id: '$survey'
|
452 |
} );
|
453 |
+
</script>
|
454 |
";
|
455 |
+
|
456 |
} else {
|
457 |
return "
|
458 |
<script language='javascript' type='text/javascript'>
|
460 |
var PDF_openText = '$link_text';
|
461 |
</script>
|
462 |
<script type='text/javascript' language='javascript' src='http://www.polldaddy.com/s.js'></script>
|
463 |
+
<noscript><a href='http://surveys.polldaddy.com/s/$survey/'>$link_text</a></noscript>
|
464 |
";
|
465 |
}
|
466 |
}
|
467 |
+
|
468 |
+
$poll = (int) $poll;
|
469 |
$rating = (int) $rating;
|
470 |
+
$cb = (int) $cb;
|
471 |
+
|
472 |
if ( $rating > 0 ) {
|
473 |
+
if ( null != $unique_id ) {
|
474 |
$unique_id = wp_specialchars( $unique_id );
|
475 |
} else {
|
476 |
$unique_id = is_page() ? 'wp-page-' : 'wp-post-';
|
477 |
$unique_id .= $post->ID;
|
478 |
}
|
479 |
+
|
480 |
if ( null != $title )
|
481 |
$title = wp_specialchars( $title );
|
482 |
else
|
483 |
$title = urlencode( $post->post_title );
|
484 |
+
|
485 |
if ( null != $permalink )
|
486 |
$permalink = clean_url( $permalink );
|
487 |
else
|
488 |
$permalink = urlencode( get_permalink( $post->ID ) );
|
489 |
+
|
490 |
wp_register_script( 'polldaddy-rating-js', 'http://i.polldaddy.com/ratings/rating.js' );
|
491 |
add_filter( 'wp_footer', 'polldaddy_add_rating_js' );
|
492 |
+
|
493 |
return '<div id="pd_rating_holder_' . $rating . '"></div>
|
494 |
<script language="javascript">
|
495 |
PDRTJS_settings_' . $rating . ' = {
|
501 |
</script>';
|
502 |
} elseif ( $poll > 0 ) {
|
503 |
$cb = ( $cb == 1 ? '?cb=' . mktime() : '' );
|
504 |
+
$keywords = wp_cache_get( 'pd-keywords', 'site-options' );
|
505 |
+
$keywords_link = '<a href="http://polldaddy.com/features-surveys/">survey software</a>';
|
506 |
if ( ! $keywords || $keywords['generated'] <= ( time() - 300 ) ) {
|
507 |
if ( ! wp_cache_get( 'pd-keywords-fetching', 'site-options' ) ) {
|
508 |
wp_cache_set( 'pd-keywords-fetching', 1, 'site-options', 30 );
|
509 |
$keywords = polldaddy_shortcode_handler_set_data();
|
510 |
}
|
511 |
}
|
512 |
+
|
513 |
if ( !$keywords )
|
514 |
$keywords = array();
|
515 |
+
|
516 |
+
if ( is_array( $keywords ) && count( $keywords ) > 0 ) {
|
517 |
+
$mod = ( $poll % ( count( $keywords ) - 1 ) );
|
518 |
+
$keywords_link = '<a href="' . $keywords[ $mod ][ 'url' ] . '">' . $keywords[ $mod ][ 'keyword' ] . '</a>';
|
519 |
+
}
|
520 |
+
|
521 |
+
return '<a name="pd_a_' . $poll . '"></a><div class="PDS_Poll" id="PDI_container' . $poll . '" style="display:inline-block;"></div><div id="PD_superContainer"></div><script type="text/javascript" language="javascript" charset="utf-8" src="http://static.polldaddy.com/p/' . $poll . '.js' . $cb . '"></script>
|
522 |
<noscript>
|
523 |
+
<a href="http://polldaddy.com/poll/' . $poll . '/">View This Poll</a><br/><span style="font-size:10px;">' . $keywords_link . '</span>
|
524 |
</noscript>';
|
525 |
}
|
526 |
+
|
527 |
return '<!-- no polldaddy output -->';
|
528 |
}
|
529 |
+
|
530 |
// http://polldaddy.com/poll/1562975/?view=results&msg=voted
|
531 |
function polldaddy_link( $content ) {
|
532 |
return preg_replace( '!(?:\n|\A)http://polldaddy.com/poll/([0-9]+?)/(.+)?(?:\n|\Z)!i', "\n<script type='text/javascript' language='javascript' charset='utf-8' src='http://static.polldaddy.com/p/$1.js'></script><noscript> <a href='http://polldaddy.com/poll/$1/'>View Poll</a></noscript>\n", $content );
|
533 |
}
|
534 |
+
|
535 |
// higher priority because we need it before auto-link and autop get to it
|
536 |
add_filter( 'the_content', 'polldaddy_link', 1 );
|
537 |
add_filter( 'the_content_rss', 'polldaddy_link', 1 );
|
538 |
add_filter( 'comment_text', 'polldaddy_link', 1 );
|
539 |
+
|
540 |
add_shortcode( 'polldaddy', 'polldaddy_shortcode_handler' );
|
541 |
}
|
542 |
|
561 |
extract($args, EXTR_SKIP);
|
562 |
|
563 |
echo $before_widget;
|
564 |
+
$title = empty( $instance['title'] ) ? __( 'Top Rated', 'polldaddy' ) : apply_filters( 'widget_title', $instance['title'] );
|
565 |
+
$posts_rating_id = (int) get_option( 'pd-rating-posts-id' );
|
566 |
+
$pages_rating_id = (int) get_option( 'pd-rating-pages-id' );
|
567 |
$comments_rating_id = (int) get_option( 'pd-rating-comments-id' );
|
568 |
|
569 |
echo $before_title . $title . $after_title;
|
579 |
|
580 |
function update( $new_instance, $old_instance ) {
|
581 |
|
582 |
+
$instance = $old_instance;
|
583 |
+
$instance['title'] = strip_tags($new_instance['title']);
|
584 |
+
$instance['show_posts'] = (int) $new_instance['show_posts'];
|
585 |
+
$instance['show_pages'] = (int) $new_instance['show_pages'];
|
586 |
$instance['show_comments'] = (int) $new_instance['show_comments'];
|
587 |
+
$instance['item_count'] = (int) $new_instance['item_count'];
|
588 |
return $instance;
|
589 |
}
|
590 |
|
591 |
function form( $instance ) {
|
592 |
|
593 |
+
$instance = wp_parse_args( (array) $instance, array( 'title' => '', 'show_posts' => '1', 'show_pages' => '1', 'show_comments' => '1', 'item_count' => '5' ) );
|
594 |
+
$title = strip_tags( $instance['title'] );
|
595 |
+
$show_posts = (int) $instance['show_posts'];
|
596 |
+
$show_pages = (int) $instance['show_pages'];
|
597 |
$show_comments = (int) $instance['show_comments'];
|
598 |
+
$item_count = (int) $instance['item_count'];
|
599 |
?>
|
600 |
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title', 'polldaddy' ); ?>: <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attribute_escape( $title ); ?>" /></label></p>
|
601 |
<p>
|
polldaddy-xml.php
CHANGED
@@ -237,6 +237,7 @@ class PollDaddy_Demand extends PollDaddy_XML_Object {
|
|
237 |
var $rating;
|
238 |
var $nonce;
|
239 |
var $partner;
|
|
|
240 |
}
|
241 |
|
242 |
class PollDaddy_Partner extends PollDaddy_XML_Object {
|
@@ -355,8 +356,6 @@ class PollDaddy_Poll_Answer extends PollDaddy_XML_Object {
|
|
355 |
var $_id;
|
356 |
var $_total;
|
357 |
var $_percent;
|
358 |
-
var $_mediaType; // old way
|
359 |
-
var $_mediaCode; // old way
|
360 |
|
361 |
var $___content;
|
362 |
|
@@ -589,49 +588,67 @@ class PollDaddy_Email_Message extends PollDaddy_XML_Object {
|
|
589 |
var $groups;
|
590 |
}
|
591 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
592 |
class PollDaddy_XML_Parser {
|
593 |
var $parser;
|
594 |
var $polldaddy_objects = array(
|
595 |
-
'http://api.polldaddy.com/pdapi.xsd:pdAccess'
|
596 |
-
'http://api.polldaddy.com/pdapi.xsd:pdInitiate'
|
597 |
-
'http://api.polldaddy.com/pdapi.xsd:pdRequest'
|
598 |
-
'http://api.polldaddy.com/pdapi.xsd:pdResponse'
|
599 |
-
'http://api.polldaddy.com/pdapi.xsd:errors'
|
600 |
-
'http://api.polldaddy.com/pdapi.xsd:error'
|
601 |
-
'http://api.polldaddy.com/pdapi.xsd:demands'
|
602 |
-
'http://api.polldaddy.com/pdapi.xsd:demand'
|
603 |
-
'http://api.polldaddy.com/pdapi.xsd:queries'
|
604 |
-
'http://api.polldaddy.com/pdapi.xsd:query'
|
605 |
-
'http://api.polldaddy.com/pdapi.xsd:account'
|
606 |
-
'http://api.polldaddy.com/pdapi.xsd:list'
|
607 |
-
'http://api.polldaddy.com/pdapi.xsd:polls'
|
608 |
-
'http://api.polldaddy.com/pdapi.xsd:search'
|
609 |
-
'http://api.polldaddy.com/pdapi.xsd:poll'
|
610 |
-
'http://api.polldaddy.com/pdapi.xsd:emailAddress'
|
611 |
-
'http://api.polldaddy.com/pdapi.xsd:message'
|
612 |
-
'http://api.polldaddy.com/pdapi.xsd:answers'
|
613 |
-
'http://api.polldaddy.com/pdapi.xsd:answer'
|
614 |
-
'http://api.polldaddy.com/pdapi.xsd:otherAnswers'
|
615 |
-
'http://api.polldaddy.com/pdapi.xsd:result'
|
616 |
-
'http://api.polldaddy.com/pdapi.xsd:comments'
|
617 |
-
'http://api.polldaddy.com/pdapi.xsd:comment'
|
618 |
-
'http://api.polldaddy.com/pdapi.xsd:extensions'
|
619 |
-
'http://api.polldaddy.com/pdapi.xsd:folders'
|
620 |
-
'http://api.polldaddy.com/pdapi.xsd:folder'
|
621 |
-
'http://api.polldaddy.com/pdapi.xsd:styles'
|
622 |
-
'http://api.polldaddy.com/pdapi.xsd:style'
|
623 |
-
'http://api.polldaddy.com/pdapi.xsd:packs'
|
624 |
-
'http://api.polldaddy.com/pdapi.xsd:pack'
|
625 |
-
'http://api.polldaddy.com/pdapi.xsd:languages'
|
626 |
-
'http://api.polldaddy.com/pdapi.xsd:language'
|
627 |
-
'http://api.polldaddy.com/pdapi.xsd:activity'
|
628 |
-
'pack' => 'Custom_Pack',
|
629 |
-
'phrase' => 'Custom_Pack_Phrase',
|
630 |
'http://api.polldaddy.com/pdapi.xsd:rating_result' => 'PollDaddy_Rating_Result',
|
631 |
-
'http://api.polldaddy.com/pdapi.xsd:ratings'
|
632 |
-
'http://api.polldaddy.com/pdapi.xsd:rating'
|
633 |
-
'http://api.polldaddy.com/pdapi.xsd:nonce'
|
634 |
-
'http://api.polldaddy.com/pdapi.xsd:partner'
|
|
|
|
|
|
|
635 |
);// the parser matches the tag names to the class name and creates an object defined by that class
|
636 |
|
637 |
var $object_stack = array();
|
237 |
var $rating;
|
238 |
var $nonce;
|
239 |
var $partner;
|
240 |
+
var $media;
|
241 |
}
|
242 |
|
243 |
class PollDaddy_Partner extends PollDaddy_XML_Object {
|
356 |
var $_id;
|
357 |
var $_total;
|
358 |
var $_percent;
|
|
|
|
|
359 |
|
360 |
var $___content;
|
361 |
|
588 |
var $groups;
|
589 |
}
|
590 |
|
591 |
+
class PollDaddy_Media extends PollDaddy_XML_Object {
|
592 |
+
var $___cdata = array( 'name', 'data', 'type', 'upload_result', 'img', 'img_small', 'url' );
|
593 |
+
var $___name = 'media';
|
594 |
+
|
595 |
+
var $_size;
|
596 |
+
var $_id;
|
597 |
+
|
598 |
+
var $name;
|
599 |
+
var $type;
|
600 |
+
var $ext;
|
601 |
+
var $data;
|
602 |
+
var $upload_result;
|
603 |
+
var $img;
|
604 |
+
var $img_small;
|
605 |
+
var $url;
|
606 |
+
}
|
607 |
+
|
608 |
class PollDaddy_XML_Parser {
|
609 |
var $parser;
|
610 |
var $polldaddy_objects = array(
|
611 |
+
'http://api.polldaddy.com/pdapi.xsd:pdAccess' => 'PollDaddy_Access',
|
612 |
+
'http://api.polldaddy.com/pdapi.xsd:pdInitiate' => 'PollDaddy_Initiate',
|
613 |
+
'http://api.polldaddy.com/pdapi.xsd:pdRequest' => 'PollDaddy_Request',
|
614 |
+
'http://api.polldaddy.com/pdapi.xsd:pdResponse' => 'PollDaddy_Response',
|
615 |
+
'http://api.polldaddy.com/pdapi.xsd:errors' => 'PollDaddy_Errors',
|
616 |
+
'http://api.polldaddy.com/pdapi.xsd:error' => 'PollDaddy_Error',
|
617 |
+
'http://api.polldaddy.com/pdapi.xsd:demands' => 'PollDaddy_Demands',
|
618 |
+
'http://api.polldaddy.com/pdapi.xsd:demand' => 'PollDaddy_Demand',
|
619 |
+
'http://api.polldaddy.com/pdapi.xsd:queries' => 'PollDaddy_Queries',
|
620 |
+
'http://api.polldaddy.com/pdapi.xsd:query' => 'PollDaddy_Query',
|
621 |
+
'http://api.polldaddy.com/pdapi.xsd:account' => 'PollDaddy_Account',
|
622 |
+
'http://api.polldaddy.com/pdapi.xsd:list' => 'PollDaddy_List',
|
623 |
+
'http://api.polldaddy.com/pdapi.xsd:polls' => 'PollDaddy_Polls',
|
624 |
+
'http://api.polldaddy.com/pdapi.xsd:search' => 'PollDaddy_Search',
|
625 |
+
'http://api.polldaddy.com/pdapi.xsd:poll' => 'PollDaddy_Poll',
|
626 |
+
'http://api.polldaddy.com/pdapi.xsd:emailAddress' => 'PollDaddy_Email',
|
627 |
+
'http://api.polldaddy.com/pdapi.xsd:message' => 'PollDaddy_Email_Message',
|
628 |
+
'http://api.polldaddy.com/pdapi.xsd:answers' => 'PollDaddy_Poll_Answers',
|
629 |
+
'http://api.polldaddy.com/pdapi.xsd:answer' => 'PollDaddy_Poll_Answer',
|
630 |
+
'http://api.polldaddy.com/pdapi.xsd:otherAnswers' => 'PollDaddy_Other_Answers',
|
631 |
+
'http://api.polldaddy.com/pdapi.xsd:result' => 'PollDaddy_Poll_Result',
|
632 |
+
'http://api.polldaddy.com/pdapi.xsd:comments' => 'PollDaddy_Comments',
|
633 |
+
'http://api.polldaddy.com/pdapi.xsd:comment' => 'PollDaddy_Comment',
|
634 |
+
'http://api.polldaddy.com/pdapi.xsd:extensions' => 'PollDaddy_Extensions',
|
635 |
+
'http://api.polldaddy.com/pdapi.xsd:folders' => 'PollDaddy_Folders',
|
636 |
+
'http://api.polldaddy.com/pdapi.xsd:folder' => 'PollDaddy_Folder',
|
637 |
+
'http://api.polldaddy.com/pdapi.xsd:styles' => 'PollDaddy_Styles',
|
638 |
+
'http://api.polldaddy.com/pdapi.xsd:style' => 'PollDaddy_Style',
|
639 |
+
'http://api.polldaddy.com/pdapi.xsd:packs' => 'PollDaddy_Packs',
|
640 |
+
'http://api.polldaddy.com/pdapi.xsd:pack' => 'PollDaddy_Pack',
|
641 |
+
'http://api.polldaddy.com/pdapi.xsd:languages' => 'PollDaddy_Languages',
|
642 |
+
'http://api.polldaddy.com/pdapi.xsd:language' => 'PollDaddy_Language',
|
643 |
+
'http://api.polldaddy.com/pdapi.xsd:activity' => 'PollDaddy_Activity',
|
|
|
|
|
644 |
'http://api.polldaddy.com/pdapi.xsd:rating_result' => 'PollDaddy_Rating_Result',
|
645 |
+
'http://api.polldaddy.com/pdapi.xsd:ratings' => 'PollDaddy_Ratings',
|
646 |
+
'http://api.polldaddy.com/pdapi.xsd:rating' => 'PollDaddy_Rating',
|
647 |
+
'http://api.polldaddy.com/pdapi.xsd:nonce' => 'PollDaddy_Nonce',
|
648 |
+
'http://api.polldaddy.com/pdapi.xsd:partner' => 'PollDaddy_Partner',
|
649 |
+
'http://api.polldaddy.com/pdapi.xsd:media' => 'PollDaddy_Media',
|
650 |
+
'pack' => 'Custom_Pack',
|
651 |
+
'phrase' => 'Custom_Pack_Phrase'
|
652 |
);// the parser matches the tag names to the class name and creates an object defined by that class
|
653 |
|
654 |
var $object_stack = array();
|
polldaddy.css
CHANGED
@@ -1,4 +1,255 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
body.poll-preview-iframe{min-width:0;}
|
3 |
body.poll-preview-iframe #sidemenu, body.poll-preview-iframe #submenu, body.poll-preview-iframe #wpcombar, body.poll-preview-iframe #wphead, body.poll-preview-iframe #gears-info-box, body.poll-preview-iframe #user_info, body.poll-preview-iframe #dashmenu, body.poll-preview-iframe #adminmenu, body.poll-preview-iframe #sidemenu-bg, body.poll-preview-iframe #footer, body.poll-preview-iframe #feedbacklink, body.poll-preview-iframe #screen-meta, body.poll-preview-iframe #manage-polls h2#preview-header{display:none;} body.poll-preview-iframe-editor #manage-polls h2#preview-header{display:block;}
|
4 |
body.poll-preview-iframe h2{padding-top:0;}
|
@@ -11,7 +262,7 @@ body.poll-preview-iframe div#wpbody-content{margin:0;padding:0;border:none;}
|
|
11 |
body.poll-preview-iframe div#manage-polls.wrap{text-align:left;}
|
12 |
body.poll-preview-iframe .pds-box{margin-left:auto;margin-right:auto;}
|
13 |
table td.post-title strong{display:block;}
|
14 |
-
table.poll-results .column-vote{
|
15 |
table.poll-results div.result-holder{position:relative;}
|
16 |
table.poll-results span.result-bar{display:block;padding:5px 0 4px 0;margin:0;height:100%;border:1px solid #EDB918;background-color:#FBD55E;}
|
17 |
table.poll-results span.result-total{position:absolute;left:.75em;top:6px;}
|
@@ -20,26 +271,20 @@ table.poll-others{margin-top:1.5em;}
|
|
20 |
table.poll-others .column-vote{min-width:50%;}
|
21 |
ul#answers,ul.poll-options{list-style:none;padding:0;}
|
22 |
ul#answers li{position:relative;}
|
23 |
-
ul#answers li
|
24 |
-
ul#answers
|
25 |
-
ul#answers li:hover span.handle{display:block;}
|
26 |
-
ul#answers li a.delete{display:block;position:absolute;top:0;right:0;width:18px;height:100%;text-align:center;line-height:1.8em;}
|
27 |
-
ul#answers li a.delete:hover{color:white;background-color:#f00;}
|
28 |
-
ul#answers input{padding:0;width:100%;border:none;}
|
29 |
-
ul#answer-options{list-style:none;padding:0;margin-left:20px;}
|
30 |
-
ul#answer-options li{display:inline;margin-right:1em;white-space:nowrap;}
|
31 |
p.submit input{padding:6px;}
|
32 |
-
p#add-answer-holder{display:none;text-align:
|
33 |
.inner-sidebar-ratings{clear:right;float:right;position:relative;width:281px;}
|
34 |
#poststuff #post-body.has-sidebar,.has-sidebar{clear:left;float:left;margin-right:-240px;width:100%;}
|
35 |
.has-sidebar .has-sidebar-content{margin-right:245px;}
|
36 |
#post-body-content #titlediv{margin:10px 0;}
|
37 |
-
tr.polldaddy-shortcode-row{
|
38 |
tr.polldaddy-shortcode-row h4{padding:0;margin:0.3em 0;clear:both;}
|
39 |
tr.polldaddy-shortcode-row pre{float:left;background-color:#fff;padding:.2em;margin:0 0 .5em;border:1px solid #ccc;}
|
40 |
tr.polldaddy-shortcode-row input{float:left;background-color:#fff;border:1px solid #ccc;padding:0.5em 0;margin:0 0 0.5em;font-size:11px;font-family:monospace;color: rgb(51, 51, 51);-moz-border-radius: 0px;}
|
41 |
.polldaddy-show-design-options{text-align:left;width:8em;display:block;font-size:1em;padding:1em 2em;text-decoration:none;}
|
42 |
-
|
43 |
#design_standard{display:block;padding:0px 0px 0px 20px;}
|
44 |
#design_standard a{width:1em;font-size:4em;text-decoration:none;}
|
45 |
#design_custom {display:none;}
|
1 |
+
/* NEW STYLES, 2.0+ ------------------------------------------------------------
|
2 |
+
---------------------------------------------------------------------------------------------------*/
|
3 |
+
abbr{
|
4 |
+
font-size:11px;
|
5 |
+
color: #b8b8b8;
|
6 |
+
line-height: 20px;
|
7 |
+
vertical-align: text-top;
|
8 |
+
}
|
9 |
+
|
10 |
+
|
11 |
+
hr{
|
12 |
+
border: 1px #EFEFEF solid;
|
13 |
+
|
14 |
+
}
|
15 |
+
|
16 |
+
#polldaddy-error.error a{
|
17 |
+
color: #21759b;
|
18 |
+
}
|
19 |
+
|
20 |
+
|
21 |
+
|
22 |
+
h2 a.button{
|
23 |
+
font-family: Lucida Grande, Arial, Sans;
|
24 |
+
}
|
25 |
+
|
26 |
+
#pd-wrap .postbox .inside{
|
27 |
+
padding:13px;
|
28 |
+
}
|
29 |
+
|
30 |
+
#pd-wrap .postbox .inside h4{
|
31 |
+
margin:0px;
|
32 |
+
font-size:1.2em;
|
33 |
+
}
|
34 |
+
|
35 |
+
#pd-wrap table td label {
|
36 |
+
font-size:15px;
|
37 |
+
}
|
38 |
+
|
39 |
+
#pd-wrap table td label.small{
|
40 |
+
font-size:11px;
|
41 |
+
line-height:14px;
|
42 |
+
margin-top:4px;
|
43 |
+
padding-left:18px;
|
44 |
+
display: block;
|
45 |
+
}
|
46 |
+
|
47 |
+
.pd-box-header{
|
48 |
+
padding-bottom: 10px;
|
49 |
+
margin-bottom: 10px;
|
50 |
+
border-bottom: 1px #ebebeb solid;
|
51 |
+
}
|
52 |
+
|
53 |
+
td#signup-button{
|
54 |
+
border-left:1px #ebebeb solid;
|
55 |
+
width:23%;
|
56 |
+
vertical-align: top;
|
57 |
+
}
|
58 |
+
|
59 |
+
#signup-button h5{
|
60 |
+
font-size:14px;
|
61 |
+
font-weight: normal;
|
62 |
+
margin:0px;
|
63 |
+
margin-top:7px;
|
64 |
+
}
|
65 |
+
|
66 |
+
#signup-button input{
|
67 |
+
display: block;
|
68 |
+
margin-top:10px;
|
69 |
+
width:90px;
|
70 |
+
}
|
71 |
+
|
72 |
+
td a.row-title{
|
73 |
+
/*font-size: 14px;*/
|
74 |
+
}
|
75 |
+
|
76 |
+
ul#answers li span.handle{
|
77 |
+
background-color: #FFF;
|
78 |
+
}
|
79 |
+
|
80 |
+
.poll-votes.num.column-vote{
|
81 |
+
font-size:24px !important;
|
82 |
+
font-family: Georgia;
|
83 |
+
font-weight: normal;
|
84 |
+
text-align:right;
|
85 |
+
color: #666;
|
86 |
+
padding: 10px;
|
87 |
+
padding-bottom:0px;
|
88 |
+
}
|
89 |
+
|
90 |
+
.votes-label{
|
91 |
+
font-size:11px;
|
92 |
+
color: #999;
|
93 |
+
display: block;
|
94 |
+
margin-top:2px;
|
95 |
+
}
|
96 |
+
|
97 |
+
.minor-publishing{
|
98 |
+
background: #FFF;
|
99 |
+
border-bottom: 1px #DDD solid;
|
100 |
+
}
|
101 |
+
|
102 |
+
ul#answer-options{
|
103 |
+
list-style: none;
|
104 |
+
}
|
105 |
+
|
106 |
+
ul#answer-options li{
|
107 |
+
padding: 0px 0px 5px 10px;
|
108 |
+
border-bottom: 1px #EEE solid;
|
109 |
+
margin: 0px 0px 5px 0px;
|
110 |
+
}
|
111 |
+
|
112 |
+
ul#answer-options li label{
|
113 |
+
font-size:12px;
|
114 |
+
color: #666;
|
115 |
+
padding-left: 5px;
|
116 |
+
}
|
117 |
+
|
118 |
+
ul#answer-options li:first-of-type{
|
119 |
+
margin-top:15px;
|
120 |
+
}
|
121 |
+
|
122 |
+
ul#answer-options li:last-of-type{
|
123 |
+
border-bottom: none;
|
124 |
+
margin-bottom: 15px;
|
125 |
+
}
|
126 |
+
|
127 |
+
ul.pd-tabs{
|
128 |
+
list-style: none;
|
129 |
+
overflow: hidden;
|
130 |
+
margin-bottom: 0px;
|
131 |
+
}
|
132 |
+
|
133 |
+
ul.pd-tabs li{
|
134 |
+
float: left;
|
135 |
+
padding: 5px;
|
136 |
+
}
|
137 |
+
|
138 |
+
ul.pd-tabs li.selected{
|
139 |
+
background: #f1f1f1;
|
140 |
+
border: 1px #dfdfdf solid;
|
141 |
+
border-radius: 3px 3px 0px 0px;
|
142 |
+
border-bottom: 0px;
|
143 |
+
margin-right: 5px;
|
144 |
+
}
|
145 |
+
|
146 |
+
ul.pd-tabs li a{
|
147 |
+
text-decoration: none;
|
148 |
+
}
|
149 |
+
|
150 |
+
ul.pd-tabs li.selected a{
|
151 |
+
color: #000;
|
152 |
+
}
|
153 |
+
|
154 |
+
.pd-tab-panel{
|
155 |
+
height: 300px;
|
156 |
+
border: 1px #dfdfdf solid;
|
157 |
+
margin-top:-7px;
|
158 |
+
display: none;
|
159 |
+
}
|
160 |
+
|
161 |
+
.pd-tab-panel.show{
|
162 |
+
display: block;
|
163 |
+
}
|
164 |
+
|
165 |
+
#answers input{
|
166 |
+
outline: none;
|
167 |
+
}
|
168 |
+
|
169 |
+
#no-polls{
|
170 |
+
font-size:14px;
|
171 |
+
text-align: center;
|
172 |
+
}
|
173 |
+
|
174 |
+
input#shortcode-field{
|
175 |
+
background: #FFF;
|
176 |
+
border: none;
|
177 |
+
width: 165px;
|
178 |
+
}
|
179 |
+
|
180 |
+
.pd-embed-col{
|
181 |
+
width: 33%;
|
182 |
+
float: left;
|
183 |
+
}
|
184 |
+
|
185 |
+
#empty-set{
|
186 |
+
padding:0px 10px 20px 10px;
|
187 |
+
background:#F8F7F3;
|
188 |
+
}
|
189 |
+
|
190 |
+
.pd-label{
|
191 |
+
display: block;
|
192 |
+
float:left;
|
193 |
+
width: 130px;
|
194 |
+
vertical-align: middle;
|
195 |
+
}
|
196 |
+
|
197 |
+
.answer-media{
|
198 |
+
|
199 |
+
}
|
200 |
+
|
201 |
+
.answer-media li{
|
202 |
+
padding-right: 10px;
|
203 |
+
margin-bottom: 0px;
|
204 |
+
float: left;
|
205 |
+
}
|
206 |
+
|
207 |
+
.answer-media li:last-of-type{
|
208 |
+
padding-right: 0px;
|
209 |
+
}
|
210 |
+
|
211 |
+
.delete-answer{
|
212 |
+
width: 20px;
|
213 |
+
display: block;
|
214 |
+
}
|
215 |
+
|
216 |
+
table.answer, table.question{
|
217 |
+
width: 100%;
|
218 |
+
}
|
219 |
+
|
220 |
+
table.answer th{
|
221 |
+
width:16px;
|
222 |
+
}
|
223 |
+
|
224 |
+
table.answer td.answer-input{
|
225 |
+
}
|
226 |
+
|
227 |
+
table.answer td.answer-media-icons, table.question td.answer-media-icons{
|
228 |
+
width: 130px !important;
|
229 |
+
}
|
230 |
+
|
231 |
+
table.answer td.answer-media-icons ul, table.question td.answer-media-icons ul{
|
232 |
+
min-width: 130px;
|
233 |
+
}
|
234 |
+
|
235 |
+
.poll-preview-iframe div#adminmenushadow, .poll-preview-iframe div#adminmenuback {
|
236 |
+
background: #FFF;
|
237 |
+
}
|
238 |
+
.poll-preview-iframe div#adminmenuback, .poll-preview-iframe div#adminmenuwrap {
|
239 |
+
border: 0px;
|
240 |
+
background-color: #FFF;
|
241 |
+
border-color: #FFF;
|
242 |
+
}
|
243 |
+
.poll-preview-iframe div#adminmenuback {
|
244 |
+
bottom: 0;
|
245 |
+
position: absolute;
|
246 |
+
top: 0;
|
247 |
+
z-index: -1;
|
248 |
+
}
|
249 |
+
|
250 |
+
|
251 |
+
/* OLD STYLES, PRE-2.0 ------------------------------------------------------------
|
252 |
+
---------------------------------------------------------------------------------------------------*/
|
253 |
body.poll-preview-iframe{min-width:0;}
|
254 |
body.poll-preview-iframe #sidemenu, body.poll-preview-iframe #submenu, body.poll-preview-iframe #wpcombar, body.poll-preview-iframe #wphead, body.poll-preview-iframe #gears-info-box, body.poll-preview-iframe #user_info, body.poll-preview-iframe #dashmenu, body.poll-preview-iframe #adminmenu, body.poll-preview-iframe #sidemenu-bg, body.poll-preview-iframe #footer, body.poll-preview-iframe #feedbacklink, body.poll-preview-iframe #screen-meta, body.poll-preview-iframe #manage-polls h2#preview-header{display:none;} body.poll-preview-iframe-editor #manage-polls h2#preview-header{display:block;}
|
255 |
body.poll-preview-iframe h2{padding-top:0;}
|
262 |
body.poll-preview-iframe div#manage-polls.wrap{text-align:left;}
|
263 |
body.poll-preview-iframe .pds-box{margin-left:auto;margin-right:auto;}
|
264 |
table td.post-title strong{display:block;}
|
265 |
+
table.poll-results .column-vote{padding:3px 5px 3px 3px;margin:0;}
|
266 |
table.poll-results div.result-holder{position:relative;}
|
267 |
table.poll-results span.result-bar{display:block;padding:5px 0 4px 0;margin:0;height:100%;border:1px solid #EDB918;background-color:#FBD55E;}
|
268 |
table.poll-results span.result-total{position:absolute;left:.75em;top:6px;}
|
271 |
table.poll-others .column-vote{min-width:50%;}
|
272 |
ul#answers,ul.poll-options{list-style:none;padding:0;}
|
273 |
ul#answers li{position:relative;}
|
274 |
+
ul#answers li span.handle{width:18px;height:100%;cursor:move;text-align:center;line-height:1.8em;}
|
275 |
+
ul#answers input{padding:0;border:none;float:left;margin-right: 0px; width:100%;border:1px solid #ccc;padding:2px 3px;margin-left: 3px;}
|
|
|
|
|
|
|
|
|
|
|
|
|
276 |
p.submit input{padding:6px;}
|
277 |
+
p#add-answer-holder{display:none;text-align:left;padding-left:10px;}
|
278 |
.inner-sidebar-ratings{clear:right;float:right;position:relative;width:281px;}
|
279 |
#poststuff #post-body.has-sidebar,.has-sidebar{clear:left;float:left;margin-right:-240px;width:100%;}
|
280 |
.has-sidebar .has-sidebar-content{margin-right:245px;}
|
281 |
#post-body-content #titlediv{margin:10px 0;}
|
282 |
+
tr.polldaddy-shortcode-row{}
|
283 |
tr.polldaddy-shortcode-row h4{padding:0;margin:0.3em 0;clear:both;}
|
284 |
tr.polldaddy-shortcode-row pre{float:left;background-color:#fff;padding:.2em;margin:0 0 .5em;border:1px solid #ccc;}
|
285 |
tr.polldaddy-shortcode-row input{float:left;background-color:#fff;border:1px solid #ccc;padding:0.5em 0;margin:0 0 0.5em;font-size:11px;font-family:monospace;color: rgb(51, 51, 51);-moz-border-radius: 0px;}
|
286 |
.polldaddy-show-design-options{text-align:left;width:8em;display:block;font-size:1em;padding:1em 2em;text-decoration:none;}
|
287 |
+
#design h3{text-align:left;}
|
288 |
#design_standard{display:block;padding:0px 0px 0px 20px;}
|
289 |
#design_standard a{width:1em;font-size:4em;text-decoration:none;}
|
290 |
#design_custom {display:none;}
|
polldaddy.js
CHANGED
@@ -5,7 +5,12 @@ jQuery(function ($) {
|
|
5 |
delete_rating: 'Are you sure you want to delete the rating for "%s"?',
|
6 |
delete_poll: 'Are you sure you want to delete "%s"?',
|
7 |
delete_answer: 'Are you sure you want to delete this answer?',
|
|
|
8 |
delete_answer_title: 'delete this answer',
|
|
|
|
|
|
|
|
|
9 |
standard_styles: 'Standard Styles',
|
10 |
custom_styles: 'Custom Styles'
|
11 |
}, args);
|
@@ -29,6 +34,12 @@ jQuery(function ($) {
|
|
29 |
selection.setBaseAndExtent(refNode, 0, refNode, 1);
|
30 |
}
|
31 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
$('a.delete-rating').click(function () {
|
33 |
return confirm( opts.delete_rating.replace("%s", $(this).parents('td').find('strong').text() ) );
|
34 |
});
|
@@ -54,34 +65,60 @@ jQuery(function ($) {
|
|
54 |
handle: '.handle',
|
55 |
tolerance: 'pointer'
|
56 |
});
|
|
|
|
|
|
|
|
|
57 |
$('#add-answer-holder').show().find('button').click(function () {
|
58 |
-
var aa = (1 +
|
59 |
-
|
60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
return false;
|
62 |
-
});
|
63 |
-
|
64 |
-
|
65 |
-
var pollID = $(this).
|
66 |
if (!pollID) pollID = $('.polldaddy-poll-id:first').val();
|
67 |
-
|
68 |
-
|
69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
$(this).parents('tr:first').next('tr').fadeIn();
|
71 |
$(this).parents('tr:first').next('tr').show();
|
|
|
|
|
72 |
return false;
|
73 |
}, function () {
|
74 |
$(this).parents('tr:first').next('tr').fadeOut();
|
75 |
$(this).parents('tr:first').next('tr').hide();
|
76 |
return false;
|
77 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
var hiddenStyleID = $(':input[name=styleID]');
|
79 |
var customStyle = $(':input[name=customSelect]');
|
80 |
var customStyleVal = parseInt(customStyle.val());
|
81 |
-
|
82 |
-
var customStyleVal = parseInt(customStyle.val());
|
83 |
-
hiddenStyleID.val(customStyleVal.toString());
|
84 |
-
});
|
85 |
if (customStyleVal > 0) {
|
86 |
$('#design_standard').hide();
|
87 |
$('#design_custom').show();
|
@@ -146,5 +183,88 @@ jQuery(function ($) {
|
|
146 |
$('#cookieip_expiration').show();
|
147 |
}
|
148 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
}
|
150 |
});
|
5 |
delete_rating: 'Are you sure you want to delete the rating for "%s"?',
|
6 |
delete_poll: 'Are you sure you want to delete "%s"?',
|
7 |
delete_answer: 'Are you sure you want to delete this answer?',
|
8 |
+
new_answer: 'Enter an answer here',
|
9 |
delete_answer_title: 'delete this answer',
|
10 |
+
reorder_answer_title: 'click and drag to reorder',
|
11 |
+
add_image_title: 'Add an Image',
|
12 |
+
add_audio_title: 'Add Audio',
|
13 |
+
add_video_title: 'Add Video',
|
14 |
standard_styles: 'Standard Styles',
|
15 |
custom_styles: 'Custom Styles'
|
16 |
}, args);
|
34 |
selection.setBaseAndExtent(refNode, 0, refNode, 1);
|
35 |
}
|
36 |
});
|
37 |
+
$('input#shortcode-field').click( function(){
|
38 |
+
|
39 |
+
$( this ).select();
|
40 |
+
|
41 |
+
} );
|
42 |
+
|
43 |
$('a.delete-rating').click(function () {
|
44 |
return confirm( opts.delete_rating.replace("%s", $(this).parents('td').find('strong').text() ) );
|
45 |
});
|
65 |
handle: '.handle',
|
66 |
tolerance: 'pointer'
|
67 |
});
|
68 |
+
|
69 |
+
function add_answer( aa, src ) {
|
70 |
+
return false;
|
71 |
+
}
|
72 |
$('#add-answer-holder').show().find('button').click(function () {
|
73 |
+
var aa = (1 + get_number_answers()).toString();
|
74 |
+
var src = $( this ).closest( 'p' ).attr( 'class' );
|
75 |
+
|
76 |
+
$( 'form[name=add-answer] input[name=aa]' ).val( aa );
|
77 |
+
$( 'form[name=add-answer] input[name=src]' ).val( src );
|
78 |
+
$( 'form[name=add-answer] input[name=action]' ).val( 'polls_add_answer' );
|
79 |
+
|
80 |
+
$( 'form[name=add-answer]' ).ajaxSubmit( function( response ) {
|
81 |
+
delAnswerPrep( $( '#answers' ).append( response ).find( 'li:last' ) );
|
82 |
+
$('#choices').append('<option value="' + (aa-1) + '">' + (aa-1) + '</option>');
|
83 |
+
init();
|
84 |
+
} );
|
85 |
+
|
86 |
return false;
|
87 |
+
});
|
88 |
+
var win = window.dialogArguments || opener || parent || top;
|
89 |
+
$('.polldaddy-send-to-editor').click(function () {
|
90 |
+
var pollID = $(this).parents('div.row-actions').find('.polldaddy-poll-id').val();
|
91 |
if (!pollID) pollID = $('.polldaddy-poll-id:first').val();
|
92 |
+
if (pollID){
|
93 |
+
pollID = parseInt(pollID);
|
94 |
+
if ( pollID > 0 ) {
|
95 |
+
win.send_to_editor('[polldaddy poll=' + pollID.toString() + ']');
|
96 |
+
}
|
97 |
+
}
|
98 |
+
});
|
99 |
+
$('.polldaddy-show-shortcode').toggle(function (ev) {
|
100 |
+
ev.preventDefault();
|
101 |
$(this).parents('tr:first').next('tr').fadeIn();
|
102 |
$(this).parents('tr:first').next('tr').show();
|
103 |
+
$(this).closest('tr').css('display','none');
|
104 |
+
|
105 |
return false;
|
106 |
}, function () {
|
107 |
$(this).parents('tr:first').next('tr').fadeOut();
|
108 |
$(this).parents('tr:first').next('tr').hide();
|
109 |
return false;
|
110 |
});
|
111 |
+
|
112 |
+
$('.pd-embed-done').click(function(ev){
|
113 |
+
ev.preventDefault();
|
114 |
+
$( this ).closest('tr').hide();
|
115 |
+
$( this ).closest('tr').prev('tr').show();
|
116 |
+
|
117 |
+
});
|
118 |
var hiddenStyleID = $(':input[name=styleID]');
|
119 |
var customStyle = $(':input[name=customSelect]');
|
120 |
var customStyleVal = parseInt(customStyle.val());
|
121 |
+
|
|
|
|
|
|
|
122 |
if (customStyleVal > 0) {
|
123 |
$('#design_standard').hide();
|
124 |
$('#design_custom').show();
|
183 |
$('#cookieip_expiration').show();
|
184 |
}
|
185 |
});
|
186 |
+
var uploading = false;
|
187 |
+
function init() {
|
188 |
+
$('.image').unbind( 'click' ).click(function() {
|
189 |
+
var media_id = $( this ).attr('id').replace('add_poll_image', '');
|
190 |
+
tb_show('Add an Image', 'media-upload.php?type=image&&polls_media=1TB_iframe=1');
|
191 |
+
win.send_to_editor = function(html) {
|
192 |
+
var $h = $('<div/>').html(html);
|
193 |
+
url = $h.find('img').attr('src');
|
194 |
+
tb_remove();
|
195 |
+
send_media( url, media_id );
|
196 |
+
}
|
197 |
+
return false;
|
198 |
+
});
|
199 |
+
$('.video').unbind( 'click' ).click(function() {
|
200 |
+
var media_id = $( this ).attr('id').replace('add_poll_video', '');
|
201 |
+
tb_show('Add Video', 'media-upload.php?type=video&tab=type_url&polls_media=1&TB_iframe=1');
|
202 |
+
win.send_to_editor = function(shortcode) {
|
203 |
+
tb_remove();
|
204 |
+
add_media( media_id, shortcode, '<img height="16" width="16" src="http://i0.poll.fm/images/icon-report-ip-analysis.png" alt="Video Embed">' );
|
205 |
+
}
|
206 |
+
return false;
|
207 |
+
});
|
208 |
+
$('.audio').unbind( 'click' ).click(function() {
|
209 |
+
var media_id = $( this ).attr('id').replace('add_poll_audio', '');
|
210 |
+
tb_show('Add Audio', 'media-upload.php?type=audio&polls_media=1&TB_iframe=1');
|
211 |
+
win.send_to_editor = function(html) {
|
212 |
+
var $h = $('<div/>').html(html);
|
213 |
+
url = $h.find('a').attr('href');
|
214 |
+
tb_remove();
|
215 |
+
send_media( url, media_id );
|
216 |
+
}
|
217 |
+
return false;
|
218 |
+
});
|
219 |
+
}
|
220 |
+
function send_media( url, media_id ) {
|
221 |
+
if ( uploading == true )
|
222 |
+
return false;
|
223 |
+
|
224 |
+
uploading = true;
|
225 |
+
$('input[name="media\[' + media_id + '\]"]').parents('td').find('.media-preview').addClass('st_image_loader');
|
226 |
+
|
227 |
+
$( 'form[name=send-media] input[name=attach-id]' ).val( media_id );
|
228 |
+
$( 'form[name=send-media] input[name=url]' ).val( url );
|
229 |
+
$( 'form[name=send-media] input[name=action]' ).val( 'polls_upload_image' );
|
230 |
+
|
231 |
+
$( 'form[name=send-media]' ).ajaxSubmit( function( response ) {
|
232 |
+
uploading = false;
|
233 |
+
response = response.replace( /<div.*/, '' );
|
234 |
+
|
235 |
+
|
236 |
+
if ( response.substr( 0, 4 ) == 'true' ) {
|
237 |
+
var parts = response.split( '||' );
|
238 |
+
|
239 |
+
add_media( parts[4], parts[1], parts[2] );
|
240 |
+
}
|
241 |
+
} );
|
242 |
+
|
243 |
+
return false;
|
244 |
+
}
|
245 |
+
function add_media( media_id, upload_id, img ) {
|
246 |
+
if (parseInt(upload_id) > 0) $('input[name="mediaType\[' + media_id + '\]"]').val(1);
|
247 |
+
else $('input[name="mediaType\[' + media_id + '\]"]').val(2);
|
248 |
+
|
249 |
+
$('input[name="media\[' + media_id + '\]"]').val(upload_id);
|
250 |
+
$('input[name="media\[' + media_id + '\]"]').parents('td.answer-media-icons').find('li.media-preview').removeClass('st_image_loader');
|
251 |
+
$('input[name="media\[' + media_id + '\]"]').parents('td.answer-media-icons').find('li.media-preview').html(img);
|
252 |
+
};
|
253 |
+
function get_number_answers() {
|
254 |
+
var num_answers = parseInt($('.answer').size());
|
255 |
+
$('input.answer-text').each(function () {
|
256 |
+
var item = this;
|
257 |
+
if ($(item).val() == opts.new_answer || $(item).hasClass('idle')) num_answers--;
|
258 |
+
});
|
259 |
+
return num_answers;
|
260 |
+
}
|
261 |
+
|
262 |
+
init();
|
263 |
+
|
264 |
+
var api = {
|
265 |
+
add_media: add_media
|
266 |
+
};
|
267 |
+
|
268 |
+
return api;
|
269 |
}
|
270 |
});
|
polldaddy.php
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
<?php
|
2 |
|
3 |
/*
|
4 |
-
Plugin Name:
|
5 |
Plugin URI: http://wordpress.org/extend/plugins/polldaddy/
|
6 |
-
Description: Create and manage
|
7 |
Author: Automattic, Inc.
|
8 |
Author URL: http://automattic.com/
|
9 |
-
Version:
|
10 |
*/
|
11 |
|
12 |
// You can hardcode your PollDaddy PartnerGUID (API Key) here
|
@@ -32,17 +32,18 @@ class WP_PollDaddy {
|
|
32 |
|
33 |
function __construct() {
|
34 |
global $current_user;
|
35 |
-
$this->errors
|
36 |
-
$this->scheme
|
37 |
-
$this->version
|
38 |
-
$this->multiple_accounts
|
39 |
$this->polldaddy_client_class = 'api_client';
|
40 |
-
$this->polldaddy_clients
|
41 |
-
$this->is_admin
|
42 |
-
$this->is_author
|
43 |
-
$this->id
|
44 |
-
$this->user_code
|
45 |
-
$this->rating_user_code
|
|
|
46 |
}
|
47 |
|
48 |
function &get_client( $api_key, $userCode = null ) {
|
@@ -57,70 +58,92 @@ class WP_PollDaddy {
|
|
57 |
}
|
58 |
|
59 |
function config_client( $client ) {
|
|
|
60 |
return $client;
|
61 |
}
|
62 |
|
63 |
function admin_menu() {
|
|
|
|
|
64 |
if ( !defined( 'WP_POLLDADDY__PARTNERGUID' ) ) {
|
65 |
$guid = get_option( 'polldaddy_api_key' );
|
66 |
if ( !$guid || !is_string( $guid ) )
|
67 |
$guid = false;
|
68 |
define( 'WP_POLLDADDY__PARTNERGUID', $guid );
|
|
|
69 |
}
|
70 |
|
71 |
if ( !WP_POLLDADDY__PARTNERGUID ) {
|
|
|
72 |
if ( function_exists( 'add_object_page' ) ) // WP 2.7+
|
73 |
-
$hook = add_object_page( __( '
|
74 |
else
|
75 |
-
$hook = add_management_page( __( '
|
76 |
|
77 |
add_action( "load-$hook", array( &$this, 'api_key_page_load' ) );
|
78 |
|
79 |
if ( function_exists( 'add_object_page' ) ) // WP 2.7+
|
80 |
-
$hook = add_object_page( __( '
|
81 |
else
|
82 |
-
$hook = add_management_page( __( '
|
83 |
|
84 |
add_action( "load-$hook", array( &$this, 'api_key_page_load' ) );
|
85 |
-
|
86 |
-
add_action( 'admin_notices', create_function( '', 'echo "<div class=\"error\"><p>" . sprintf( "You need to <a href=\"%s\">input your PollDaddy.com account details</a>.", "edit.php?page=polls" ) . "</p></div>";' ) );
|
87 |
return false;
|
|
|
88 |
}
|
89 |
|
|
|
90 |
if ( function_exists( 'add_object_page' ) ) // WP 2.7+
|
91 |
-
$hook = add_object_page( __( '
|
92 |
else
|
93 |
-
$hook = add_management_page( __( '
|
94 |
|
95 |
add_action( "load-$hook", array( &$this, 'management_page_load' ) );
|
96 |
|
97 |
if ( function_exists( 'add_object_page' ) ) // WP 2.7+
|
98 |
-
$hook = add_object_page( __( '
|
99 |
else
|
100 |
-
$hook = add_management_page( __( '
|
101 |
|
102 |
add_action( "load-$hook", array( &$this, 'management_page_load' ) );
|
103 |
|
|
|
104 |
if ( $this->is_admin ) {
|
105 |
-
add_submenu_page( 'ratings', __( 'Ratings – Settings', 'polldaddy' ), __( '
|
106 |
add_submenu_page( 'ratings', __( 'Ratings – Reports', 'polldaddy' ), __( 'Reports', 'polldaddy' ), 'edit_posts', 'ratings&action=reports', array( &$this, 'management_page' ) );
|
107 |
}
|
108 |
else {
|
109 |
add_submenu_page( 'ratings', __( 'Ratings – Reports', 'polldaddy' ), __( 'Reports', 'polldaddy' ), 'edit_posts', 'ratings', array( &$this, 'management_page' ) );
|
110 |
}
|
111 |
|
112 |
-
add_submenu_page( 'polls', __( 'Polls', 'polldaddy' ), __( '
|
113 |
|
114 |
if ( $this->is_author ) {
|
115 |
add_submenu_page( 'polls', __( 'Add New Poll', 'polldaddy' ), __( 'Add New', 'polldaddy' ), 'edit_posts', 'polls&action=create-poll', array( &$this, 'management_page' ) );
|
116 |
add_submenu_page( 'polls', __( 'Custom Styles', 'polldaddy' ), __( 'Custom Styles', 'polldaddy' ), 'edit_posts', 'polls&action=list-styles', array( &$this, 'management_page' ) );
|
117 |
-
|
118 |
}
|
119 |
|
120 |
add_action( 'media_buttons', array( &$this, 'media_buttons' ) );
|
121 |
}
|
122 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
function api_key_page_load() {
|
|
|
124 |
if ( 'post' != strtolower( $_SERVER['REQUEST_METHOD'] ) || empty( $_POST['action'] ) || 'account' != $_POST['action'] )
|
125 |
return false;
|
126 |
|
@@ -139,9 +162,9 @@ class WP_PollDaddy {
|
|
139 |
return false;
|
140 |
|
141 |
$details = array(
|
142 |
-
'uName'
|
143 |
-
'uEmail'
|
144 |
-
'uPass'
|
145 |
'partner_userid' => $this->id
|
146 |
);
|
147 |
if ( function_exists( 'wp_remote_post' ) ) { // WP 2.7+
|
@@ -163,7 +186,7 @@ class WP_PollDaddy {
|
|
163 |
);
|
164 |
|
165 |
if ( !$fp ) {
|
166 |
-
$this->errors->add( 'connect', __( "Can't connect to
|
167 |
return false;
|
168 |
}
|
169 |
|
@@ -212,7 +235,7 @@ class WP_PollDaddy {
|
|
212 |
foreach ( $polldaddy->errors as $code => $error )
|
213 |
$this->errors->add( $code, $error );
|
214 |
if ( isset( $this->errors->errors[4] ) ) {
|
215 |
-
$this->errors->errors[4] = array( sprintf( __( 'Obsolete
|
216 |
$this->errors->add_data( true, 4 );
|
217 |
}
|
218 |
}
|
@@ -222,7 +245,7 @@ class WP_PollDaddy {
|
|
222 |
return;
|
223 |
?>
|
224 |
|
225 |
-
<div class="error">
|
226 |
|
227 |
<?php
|
228 |
|
@@ -230,7 +253,7 @@ class WP_PollDaddy {
|
|
230 |
foreach ( $this->errors->get_error_messages( $error_code ) as $error_message ) :
|
231 |
?>
|
232 |
|
233 |
-
<p><?php echo $this->errors->get_error_data( $error_code ) ? $error_message :
|
234 |
|
235 |
<?php
|
236 |
endforeach;
|
@@ -250,17 +273,16 @@ class WP_PollDaddy {
|
|
250 |
?>
|
251 |
|
252 |
<div class="wrap">
|
|
|
253 |
|
254 |
-
<
|
255 |
-
|
256 |
-
<p><?php printf( __( 'Before you can use the PollDaddy plugin, you need to enter your <a href="%s">PollDaddy.com</a> account details.', 'polldaddy' ), 'http://polldaddy.com/' ); ?></p>
|
257 |
|
258 |
<form action="" method="post">
|
259 |
<table class="form-table">
|
260 |
<tbody>
|
261 |
<tr class="form-field form-required">
|
262 |
<th valign="top" scope="row">
|
263 |
-
<label for="polldaddy-email"><?php _e( '
|
264 |
</th>
|
265 |
<td>
|
266 |
<input type="text" name="polldaddy_email" id="polldaddy-email" aria-required="true" size="40" />
|
@@ -268,7 +290,7 @@ class WP_PollDaddy {
|
|
268 |
</tr>
|
269 |
<tr class="form-field form-required">
|
270 |
<th valign="top" scope="row">
|
271 |
-
<label for="polldaddy-password"><?php _e( '
|
272 |
</th>
|
273 |
<td>
|
274 |
<input type="password" name="polldaddy_password" id="polldaddy-password" aria-required="true" size="40" />
|
@@ -280,7 +302,7 @@ class WP_PollDaddy {
|
|
280 |
<?php wp_nonce_field( 'polldaddy-account' ); ?>
|
281 |
<input type="hidden" name="action" value="account" />
|
282 |
<input type="hidden" name="account" value="import" />
|
283 |
-
<input type="submit" value="<?php echo
|
284 |
</p>
|
285 |
</form>
|
286 |
</div>
|
@@ -294,15 +316,23 @@ class WP_PollDaddy {
|
|
294 |
}
|
295 |
|
296 |
function set_api_user_code() {
|
297 |
-
|
298 |
-
$
|
299 |
|
300 |
if ( empty( $this->user_code ) ) {
|
|
|
|
|
|
|
301 |
$this->user_code = $polldaddy->get_usercode( $this->id );
|
|
|
|
|
|
|
|
|
302 |
}
|
303 |
}
|
304 |
|
305 |
function management_page_load() {
|
|
|
306 |
wp_reset_vars( array( 'page', 'action', 'poll', 'style', 'rating', 'id' ) );
|
307 |
global $plugin_page, $page, $action, $poll, $style, $rating, $id, $wp_locale;
|
308 |
|
@@ -314,7 +344,7 @@ class WP_PollDaddy {
|
|
314 |
|
315 |
require_once WP_POLLDADDY__POLLDADDY_CLIENT_PATH;
|
316 |
|
317 |
-
wp_enqueue_script( 'polls', "{$this->base_url}polldaddy.js", array( 'jquery', 'jquery-ui-sortable' ), $this->version );
|
318 |
wp_enqueue_script( 'polls-common', "{$this->base_url}common.js", array(), $this->version );
|
319 |
|
320 |
if ( $page == 'polls' ) {
|
@@ -322,15 +352,17 @@ class WP_PollDaddy {
|
|
322 |
$action = '';
|
323 |
}
|
324 |
|
325 |
-
switch ( $action )
|
326 |
case 'edit' :
|
327 |
case 'edit-poll' :
|
328 |
case 'create-poll' :
|
|
|
|
|
329 |
wp_enqueue_script( 'polls-style', "http://i.polldaddy.com/js/poll-style-picker.js", array(), $this->version );
|
330 |
|
331 |
if ( $action == 'create-poll' )
|
332 |
$plugin_page = 'polls&action=create-poll';
|
333 |
-
|
334 |
break;
|
335 |
case 'edit-style' :
|
336 |
case 'create-style' :
|
@@ -347,15 +379,15 @@ class WP_PollDaddy {
|
|
347 |
case 'import-account' :
|
348 |
$plugin_page = 'polls&action=options';
|
349 |
break;
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
break;
|
360 |
default :
|
361 |
wp_enqueue_script( 'rating-text-color', "http://i.polldaddy.com/js/jquery/jscolor.js", array(), $this->version );
|
@@ -363,13 +395,15 @@ class WP_PollDaddy {
|
|
363 |
wp_localize_script( 'polls-common', 'adminRatingsL10n', array(
|
364 |
'star_colors' => __( 'Star Colors', 'polldaddy' ), 'star_size' => __( 'Star Size', 'polldaddy' ),
|
365 |
'nero_type' => __( 'Nero Type', 'polldaddy' ), 'nero_size' => __( 'Nero Size', 'polldaddy' ), ) );
|
366 |
-
|
367 |
}
|
368 |
|
|
|
369 |
wp_enqueue_script( 'admin-forms' );
|
370 |
add_thickbox();
|
371 |
|
372 |
-
|
|
|
373 |
if ( isset( $wp_locale->text_direction ) && 'rtl' == $wp_locale->text_direction )
|
374 |
wp_enqueue_style( 'polls-rtl', "{$this->base_url}polldaddy-rtl.css", array( 'global', 'wp-admin' ), $this->version );
|
375 |
add_action( 'admin_body_class', array( &$this, 'admin_body_class' ) );
|
@@ -381,32 +415,28 @@ class WP_PollDaddy {
|
|
381 |
|
382 |
$allowedtags = array(
|
383 |
'a' => array(
|
384 |
-
'href'
|
385 |
-
'title'
|
386 |
-
'target' => array
|
387 |
'img' => array(
|
388 |
-
'alt'
|
389 |
-
'align'
|
390 |
-
'border'
|
391 |
-
'class'
|
392 |
-
'height'
|
393 |
-
'hspace'
|
394 |
-
'longdesc' => array
|
395 |
-
'vspace'
|
396 |
-
'src'
|
397 |
-
'width'
|
398 |
-
'abbr' => array(
|
399 |
-
|
400 |
-
'
|
401 |
-
|
402 |
-
'b'
|
403 |
-
'
|
404 |
-
|
405 |
-
'
|
406 |
-
'em' => array (),
|
407 |
-
'i' => array (),
|
408 |
-
'q' => array(
|
409 |
-
'cite' => array () ),
|
410 |
'strike' => array(),
|
411 |
'strong' => array()
|
412 |
);
|
@@ -414,7 +444,7 @@ class WP_PollDaddy {
|
|
414 |
$is_POST = 'post' == strtolower( $_SERVER['REQUEST_METHOD'] );
|
415 |
|
416 |
if ( $page == 'polls' ) {
|
417 |
-
switch ( $action )
|
418 |
case 'signup' : // sign up for first time
|
419 |
case 'account' : // reauthenticate
|
420 |
case 'import-account' : // reauthenticate
|
@@ -422,14 +452,17 @@ class WP_PollDaddy {
|
|
422 |
return;
|
423 |
|
424 |
check_admin_referer( 'polldaddy-account' );
|
|
|
|
|
|
|
425 |
|
426 |
if ( $new_args = $this->management_page_load_signup() )
|
427 |
$query_args = array_merge( $query_args, $new_args );
|
428 |
if ( $this->errors->get_error_codes() )
|
429 |
return false;
|
430 |
-
|
431 |
$query_args['message'] = 'imported-account';
|
432 |
-
|
433 |
wp_reset_vars( array( 'action' ) );
|
434 |
if ( !empty( $_GET['reaction'] ) )
|
435 |
$query_args['action'] = $_GET['reaction'];
|
@@ -438,27 +471,27 @@ class WP_PollDaddy {
|
|
438 |
else
|
439 |
$query_args['action'] = false;
|
440 |
break;
|
441 |
-
|
442 |
case 'delete' :
|
443 |
if ( empty( $poll ) )
|
444 |
return;
|
445 |
-
|
446 |
if ( is_array( $poll ) )
|
447 |
check_admin_referer( 'action-poll_bulk' );
|
448 |
else
|
449 |
check_admin_referer( "delete-poll_$poll" );
|
450 |
-
|
451 |
$polldaddy = $this->get_client( WP_POLLDADDY__PARTNERGUID, $this->user_code );
|
452 |
-
|
453 |
foreach ( (array) $_REQUEST['poll'] as $poll_id ) {
|
454 |
$polldaddy->reset();
|
455 |
$poll_object = $polldaddy->get_poll( $poll );
|
456 |
-
|
457 |
if ( !$this->can_edit( $poll_object ) ) {
|
458 |
$this->errors->add( 'permission', __( 'You are not allowed to delete this poll.', 'polldaddy' ) );
|
459 |
return false;
|
460 |
}
|
461 |
-
|
462 |
// Send Poll Author credentials
|
463 |
if ( !empty( $poll_object->_owner ) && $this->id != $poll_object->_owner ) {
|
464 |
$polldaddy->reset();
|
@@ -467,34 +500,34 @@ class WP_PollDaddy {
|
|
467 |
}
|
468 |
$polldaddy->userCode = $userCode;
|
469 |
}
|
470 |
-
|
471 |
$polldaddy->reset();
|
472 |
$polldaddy->delete_poll( $poll_id );
|
473 |
}
|
474 |
-
|
475 |
$query_args['message'] = 'deleted';
|
476 |
$query_args['deleted'] = count( (array) $poll );
|
477 |
break;
|
478 |
case 'open' :
|
479 |
if ( empty( $poll ) )
|
480 |
return;
|
481 |
-
|
482 |
if ( is_array( $poll ) )
|
483 |
check_admin_referer( 'action-poll_bulk' );
|
484 |
else
|
485 |
check_admin_referer( "open-poll_$poll" );
|
486 |
-
|
487 |
$polldaddy = $this->get_client( WP_POLLDADDY__PARTNERGUID, $this->user_code );
|
488 |
-
|
489 |
foreach ( (array) $_REQUEST['poll'] as $poll_id ) {
|
490 |
$polldaddy->reset();
|
491 |
$poll_object = $polldaddy->get_poll( $poll );
|
492 |
-
|
493 |
if ( !$this->can_edit( $poll_object ) ) {
|
494 |
$this->errors->add( 'permission', __( 'You are not allowed to open this poll.', 'polldaddy' ) );
|
495 |
return false;
|
496 |
}
|
497 |
-
|
498 |
// Send Poll Author credentials
|
499 |
if ( !empty( $poll_object->_owner ) && $this->id != $poll_object->_owner ) {
|
500 |
$polldaddy->reset();
|
@@ -503,34 +536,34 @@ class WP_PollDaddy {
|
|
503 |
}
|
504 |
$polldaddy->userCode = $userCode;
|
505 |
}
|
506 |
-
|
507 |
$polldaddy->reset();
|
508 |
$polldaddy->open_poll( $poll_id );
|
509 |
}
|
510 |
-
|
511 |
$query_args['message'] = 'opened';
|
512 |
$query_args['opened'] = count( (array) $poll );
|
513 |
break;
|
514 |
case 'close' :
|
515 |
if ( empty( $poll ) )
|
516 |
return;
|
517 |
-
|
518 |
if ( is_array( $poll ) )
|
519 |
check_admin_referer( 'action-poll_bulk' );
|
520 |
else
|
521 |
check_admin_referer( "close-poll_$poll" );
|
522 |
-
|
523 |
$polldaddy = $this->get_client( WP_POLLDADDY__PARTNERGUID, $this->user_code );
|
524 |
-
|
525 |
foreach ( (array) $_REQUEST['poll'] as $poll_id ) {
|
526 |
$polldaddy->reset();
|
527 |
$poll_object = $polldaddy->get_poll( $poll );
|
528 |
-
|
529 |
if ( !$this->can_edit( $poll_object ) ) {
|
530 |
$this->errors->add( 'permission', __( 'You are not allowed to close this poll.', 'polldaddy' ) );
|
531 |
return false;
|
532 |
}
|
533 |
-
|
534 |
// Send Poll Author credentials
|
535 |
if ( !empty( $poll_object->_owner ) && $this->id != $poll_object->_owner ) {
|
536 |
$polldaddy->reset();
|
@@ -539,33 +572,32 @@ class WP_PollDaddy {
|
|
539 |
}
|
540 |
$polldaddy->userCode = $userCode;
|
541 |
}
|
542 |
-
|
543 |
$polldaddy->reset();
|
544 |
$polldaddy->close_poll( $poll_id );
|
545 |
}
|
546 |
-
|
547 |
$query_args['message'] = 'closed';
|
548 |
$query_args['closed'] = count( (array) $poll );
|
549 |
break;
|
550 |
case 'edit-poll' : // TODO: use polldaddy_poll
|
551 |
if ( !$is_POST || !$poll = (int) $poll )
|
552 |
return;
|
553 |
-
|
554 |
check_admin_referer( "edit-poll_$poll" );
|
555 |
-
|
556 |
$polldaddy = $this->get_client( WP_POLLDADDY__PARTNERGUID, $this->user_code );
|
557 |
$polldaddy->reset();
|
558 |
-
|
559 |
$poll_object = $polldaddy->get_poll( $poll );
|
560 |
$this->parse_errors( $polldaddy );
|
561 |
-
|
562 |
if ( !$this->can_edit( $poll_object ) ) {
|
563 |
$this->errors->add( 'permission', __( 'You are not allowed to edit this poll.', 'polldaddy' ) );
|
564 |
return false;
|
565 |
}
|
566 |
-
|
567 |
// Send Poll Author credentials
|
568 |
-
|
569 |
if ( !empty( $poll_object->_owner ) && $this->id != $poll_object->_owner ) {
|
570 |
$polldaddy->reset();
|
571 |
if ( !$userCode = $polldaddy->get_usercode( $poll_object->_owner ) ) {
|
@@ -574,63 +606,94 @@ class WP_PollDaddy {
|
|
574 |
$this->parse_errors( $polldaddy );
|
575 |
$polldaddy->userCode = $userCode;
|
576 |
}
|
577 |
-
|
578 |
if ( !$poll_object )
|
579 |
$this->errors->add( 'GetPoll', __( 'Poll not found', 'polldaddy' ) );
|
580 |
-
|
581 |
if ( $this->errors->get_error_codes() )
|
582 |
return false;
|
583 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
584 |
$poll_data = get_object_vars( $poll_object );
|
585 |
foreach ( $poll_data as $key => $value )
|
586 |
if ( '_' === $key[0] )
|
587 |
unset( $poll_data[$key] );
|
588 |
-
|
589 |
foreach ( array( 'multipleChoice', 'randomiseAnswers', 'otherAnswer', 'sharing' ) as $option ) {
|
590 |
if ( isset( $_POST[$option] ) && $_POST[$option] )
|
591 |
$poll_data[$option] = 'yes';
|
592 |
else
|
593 |
$poll_data[$option] = 'no';
|
594 |
}
|
595 |
-
|
596 |
$blocks = array( 'off', 'cookie', 'cookieip' );
|
597 |
if ( isset( $_POST['blockRepeatVotersType'] ) && in_array( $_POST['blockRepeatVotersType'], $blocks ) )
|
598 |
$poll_data['blockRepeatVotersType'] = $_POST['blockRepeatVotersType'];
|
599 |
-
|
600 |
$results = array( 'show', 'percent', 'hide' );
|
601 |
if ( isset( $_POST['resultsType'] ) && in_array( $_POST['resultsType'], $results ) )
|
602 |
$poll_data['resultsType'] = $_POST['resultsType'];
|
603 |
$poll_data['question'] = stripslashes( $_POST['question'] );
|
604 |
-
|
|
|
|
|
|
|
|
|
605 |
if ( empty( $_POST['answer'] ) || !is_array( $_POST['answer'] ) )
|
606 |
$this->errors->add( 'answer', __( 'Invalid answers', 'polldaddy' ) );
|
607 |
-
|
608 |
$answers = array();
|
609 |
foreach ( $_POST['answer'] as $answer_id => $answer ) {
|
610 |
$answer = stripslashes( trim( $answer ) );
|
611 |
-
|
612 |
if ( strlen( $answer ) > 0 ) {
|
613 |
$answer = wp_kses( $answer, $allowedtags );
|
614 |
-
|
615 |
$args['text'] = (string) $answer;
|
616 |
-
|
617 |
-
|
618 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
619 |
else
|
620 |
-
$
|
|
|
|
|
|
|
621 |
}
|
622 |
}
|
623 |
-
|
624 |
if ( 2 > count( $answers ) )
|
625 |
$this->errors->add( 'answer', __( 'You must include at least 2 answers', 'polldaddy' ) );
|
626 |
-
|
627 |
if ( $this->errors->get_error_codes() )
|
628 |
return false;
|
629 |
-
|
630 |
$poll_data['answers'] = $answers;
|
631 |
-
|
632 |
$poll_data['question'] = wp_kses( $poll_data['question'], $allowedtags );
|
633 |
-
|
634 |
if ( isset ( $_POST['styleID'] ) ) {
|
635 |
if ( $_POST['styleID'] == 'x' ) {
|
636 |
$this->errors->add( 'UpdatePoll', __( 'Please choose a poll style', 'polldaddy' ) );
|
@@ -639,7 +702,7 @@ class WP_PollDaddy {
|
|
639 |
}
|
640 |
$poll_data['styleID'] = (int) $_POST['styleID'];
|
641 |
$poll_data['choices'] = (int) $_POST['choices'];
|
642 |
-
|
643 |
if ( $poll_data['blockRepeatVotersType'] == 'cookie' ) {
|
644 |
if ( isset( $_POST['cookieip_expiration'] ) )
|
645 |
$poll_data['blockExpiration'] = (int) $_POST['cookieip_expiration'];
|
@@ -647,19 +710,25 @@ class WP_PollDaddy {
|
|
647 |
if ( isset( $_POST['cookieip_expiration'] ) )
|
648 |
$poll_data['blockExpiration'] = (int) $_POST['cookieip_expiration'];
|
649 |
}
|
650 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
651 |
$polldaddy->reset();
|
652 |
-
|
653 |
$update_response = $polldaddy->update_poll( $poll, $poll_data );
|
654 |
-
|
655 |
$this->parse_errors( $polldaddy );
|
656 |
-
|
657 |
if ( !$update_response )
|
658 |
$this->errors->add( 'UpdatePoll', __( 'Poll could not be updated', 'polldaddy' ) );
|
659 |
-
|
660 |
if ( $this->errors->get_error_codes() )
|
661 |
return false;
|
662 |
-
|
663 |
$query_args['message'] = 'updated';
|
664 |
if ( isset( $_POST['iframe'] ) )
|
665 |
$query_args['iframe'] = '';
|
@@ -667,50 +736,81 @@ class WP_PollDaddy {
|
|
667 |
case 'create-poll' :
|
668 |
if ( !$is_POST )
|
669 |
return;
|
670 |
-
|
671 |
check_admin_referer( 'create-poll' );
|
672 |
-
|
673 |
$polldaddy = $this->get_client( WP_POLLDADDY__PARTNERGUID, $this->user_code );
|
674 |
$polldaddy->reset();
|
675 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
676 |
$answers = array();
|
677 |
foreach ( $_POST['answer'] as $answer ) {
|
678 |
$answer = stripslashes( trim( $answer ) );
|
679 |
-
|
680 |
if ( strlen( $answer ) > 0 ) {
|
681 |
$answer = wp_kses( $answer, $allowedtags );
|
682 |
-
|
683 |
$args['text'] = (string) $answer;
|
684 |
-
|
685 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
686 |
}
|
687 |
}
|
688 |
-
|
689 |
if ( !$answers )
|
690 |
return false;
|
691 |
-
|
692 |
$poll_data = _polldaddy_poll_defaults();
|
693 |
-
|
694 |
foreach ( array( 'multipleChoice', 'randomiseAnswers', 'otherAnswer', 'sharing' ) as $option ) {
|
695 |
if ( isset( $_POST[$option] ) && $_POST[$option] )
|
696 |
$poll_data[$option] = 'yes';
|
697 |
else
|
698 |
$poll_data[$option] = 'no';
|
699 |
}
|
700 |
-
|
701 |
$blocks = array( 'off', 'cookie', 'cookieip' );
|
702 |
if ( isset( $_POST['blockRepeatVotersType'] ) && in_array( $_POST['blockRepeatVotersType'], $blocks ) )
|
703 |
$poll_data['blockRepeatVotersType'] = $_POST['blockRepeatVotersType'];
|
704 |
-
|
705 |
$results = array( 'show', 'percent', 'hide' );
|
706 |
if ( isset( $_POST['resultsType'] ) && in_array( $_POST['resultsType'], $results ) )
|
707 |
$poll_data['resultsType'] = $_POST['resultsType'];
|
708 |
-
|
|
|
|
|
|
|
|
|
709 |
$poll_data['answers'] = $answers;
|
710 |
-
|
711 |
$poll_data['question'] = stripslashes( $_POST['question'] );
|
712 |
$poll_data['question'] = wp_kses( $poll_data['question'], $allowedtags );
|
713 |
-
|
714 |
if ( isset ( $_POST['styleID'] ) ) {
|
715 |
if ( $_POST['styleID'] == 'x' ) {
|
716 |
$this->errors->add( 'UpdatePoll', __( 'Please choose a poll style', 'polldaddy' ) );
|
@@ -719,7 +819,7 @@ class WP_PollDaddy {
|
|
719 |
}
|
720 |
$poll_data['styleID'] = (int) $_POST['styleID'];
|
721 |
$poll_data['choices'] = (int) $_POST['choices'];
|
722 |
-
|
723 |
if ( $poll_data['blockRepeatVotersType'] == 'cookie' ) {
|
724 |
if ( isset( $_POST['cookieip_expiration'] ) )
|
725 |
$poll_data['blockExpiration'] = (int) $_POST['cookieip_expiration'];
|
@@ -727,16 +827,22 @@ class WP_PollDaddy {
|
|
727 |
if ( isset( $_POST['cookieip_expiration'] ) )
|
728 |
$poll_data['blockExpiration'] = (int) $_POST['cookieip_expiration'];
|
729 |
}
|
730 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
731 |
$poll = $polldaddy->create_poll( $poll_data );
|
732 |
$this->parse_errors( $polldaddy );
|
733 |
-
|
734 |
if ( !$poll || empty( $poll->_id ) )
|
735 |
$this->errors->add( 'CreatePoll', __( 'Poll could not be created', 'polldaddy' ) );
|
736 |
-
|
737 |
if ( $this->errors->get_error_codes() )
|
738 |
return false;
|
739 |
-
|
740 |
$query_args['message'] = 'created';
|
741 |
$query_args['action'] = 'edit-poll';
|
742 |
$query_args['poll'] = $poll->_id;
|
@@ -746,52 +852,52 @@ class WP_PollDaddy {
|
|
746 |
case 'delete-style' :
|
747 |
if ( empty( $style ) )
|
748 |
return;
|
749 |
-
|
750 |
if ( is_array( $style ) )
|
751 |
check_admin_referer( 'action-style_bulk' );
|
752 |
else
|
753 |
check_admin_referer( "delete-style_$style" );
|
754 |
-
|
755 |
$polldaddy = $this->get_client( WP_POLLDADDY__PARTNERGUID, $this->user_code );
|
756 |
-
|
757 |
foreach ( (array) $_REQUEST['style'] as $style_id ) {
|
758 |
$polldaddy->reset();
|
759 |
$polldaddy->delete_style( $style_id );
|
760 |
}
|
761 |
-
|
762 |
$query_args['message'] = 'deleted-style';
|
763 |
$query_args['deleted'] = count( (array) $style );
|
764 |
break;
|
765 |
case 'edit-style' :
|
766 |
if ( !$is_POST || !$style = (int) $style )
|
767 |
return;
|
768 |
-
|
769 |
check_admin_referer( "edit-style$style" );
|
770 |
-
|
771 |
$polldaddy = $this->get_client( WP_POLLDADDY__PARTNERGUID, $this->user_code );
|
772 |
$polldaddy->reset();
|
773 |
-
|
774 |
$style_data = _polldaddy_style_defaults();
|
775 |
-
|
776 |
if ( isset( $_POST['style-title'] ) )
|
777 |
$style_data['title'] = stripslashes( trim( (string) $_POST['style-title'] ) );
|
778 |
-
|
779 |
if ( isset( $_POST['CSSXML'] ) )
|
780 |
$style_data['css'] = urlencode( stripslashes( trim( (string) $_POST['CSSXML'] ) ) );
|
781 |
-
|
782 |
if ( isset( $_REQUEST['updatePollCheck'] ) && $_REQUEST['updatePollCheck'] == 'on' )
|
783 |
$style_data['retro'] = 1;
|
784 |
-
|
785 |
$update_response = $polldaddy->update_style( $style, $style_data );
|
786 |
-
|
787 |
$this->parse_errors( $polldaddy );
|
788 |
-
|
789 |
if ( !$update_response )
|
790 |
$this->errors->add( 'UpdateStyle', __( 'Style could not be updated', 'polldaddy' ) );
|
791 |
-
|
792 |
if ( $this->errors->get_error_codes() )
|
793 |
return false;
|
794 |
-
|
795 |
$query_args['message'] = 'updated-style';
|
796 |
if ( isset( $_POST['iframe'] ) )
|
797 |
$query_args['iframe'] = '';
|
@@ -799,29 +905,29 @@ class WP_PollDaddy {
|
|
799 |
case 'create-style' :
|
800 |
if ( !$is_POST )
|
801 |
return;
|
802 |
-
|
803 |
check_admin_referer( 'create-style' );
|
804 |
-
|
805 |
$polldaddy = $this->get_client( WP_POLLDADDY__PARTNERGUID, $this->user_code );
|
806 |
$polldaddy->reset();
|
807 |
-
|
808 |
$style_data = _polldaddy_style_defaults();
|
809 |
-
|
810 |
if ( isset( $_POST['style-title'] ) )
|
811 |
$style_data['title'] = stripslashes( strip_tags( trim( (string) $_POST['style-title'] ) ) );
|
812 |
-
|
813 |
if ( isset( $_POST['CSSXML'] ) )
|
814 |
$style_data['css'] = urlencode( stripslashes( trim( (string) $_POST['CSSXML'] ) ) );
|
815 |
-
|
816 |
$style = $polldaddy->create_style( $style_data );
|
817 |
$this->parse_errors( $polldaddy );
|
818 |
-
|
819 |
if ( !$style || empty( $style->_id ) )
|
820 |
$this->errors->add( 'CreateStyle', __( 'Style could not be created', 'polldaddy' ) );
|
821 |
-
|
822 |
if ( $this->errors->get_error_codes() )
|
823 |
return false;
|
824 |
-
|
825 |
$query_args['message'] = 'created-style';
|
826 |
$query_args['action'] = 'edit-style';
|
827 |
$query_args['style'] = $style->_id;
|
@@ -831,57 +937,57 @@ class WP_PollDaddy {
|
|
831 |
case 'update-options' :
|
832 |
if ( !$is_POST )
|
833 |
return;
|
834 |
-
|
835 |
check_admin_referer( 'polldaddy-account' );
|
836 |
-
|
837 |
$polldaddy = $this->get_client( WP_POLLDADDY__PARTNERGUID, $this->user_code );
|
838 |
$polldaddy->reset();
|
839 |
-
|
840 |
$poll_defaults = _polldaddy_poll_defaults();
|
841 |
-
|
842 |
$user_defaults = array();
|
843 |
-
|
844 |
foreach ( array( "multipleChoice", "randomiseAnswers", "otherAnswer", "sharing", "resultsType", "styleID", "blockRepeatVotersType", "blockExpiration" ) as $option ) {
|
845 |
if ( isset( $poll_defaults[$option] ) && $poll_defaults[$option] )
|
846 |
$user_defaults[$option] = $poll_defaults[$option];
|
847 |
}
|
848 |
-
|
849 |
foreach ( array( 'multipleChoice', 'randomiseAnswers', 'otherAnswer', 'sharing' ) as $option ) {
|
850 |
if ( isset( $_POST[$option] ) && $_POST[$option] )
|
851 |
$user_defaults[$option] = 'yes';
|
852 |
else
|
853 |
$user_defaults[$option] = 'no';
|
854 |
}
|
855 |
-
|
856 |
$results = array( 'show', 'percent', 'hide' );
|
857 |
if ( isset( $_POST['resultsType'] ) && in_array( $_POST['resultsType'], $results ) )
|
858 |
$user_defaults['resultsType'] = $_POST['resultsType'];
|
859 |
-
|
860 |
if ( isset ( $_POST['styleID'] ) ) {
|
861 |
$user_defaults['styleID'] = (int) $_POST['styleID'];
|
862 |
}
|
863 |
-
|
864 |
$blocks = array( 'off', 'cookie', 'cookieip' );
|
865 |
if ( isset( $_POST['blockRepeatVotersType'] ) && in_array( $_POST['blockRepeatVotersType'], $blocks ) )
|
866 |
$user_defaults['blockRepeatVotersType'] = $_POST['blockRepeatVotersType'];
|
867 |
-
|
868 |
if ( isset( $_POST['blockExpiration'] ) )
|
869 |
$user_defaults['blockExpiration'] = (int) $_POST['blockExpiration'];
|
870 |
-
|
871 |
$polldaddy->update_poll_defaults( 0, $user_defaults );
|
872 |
-
|
873 |
$this->parse_errors( $polldaddy );
|
874 |
if ( $this->errors->get_error_codes() )
|
875 |
return false;
|
876 |
-
|
877 |
$query_args['message'] = 'updated-options';
|
878 |
break;
|
879 |
default :
|
880 |
return;
|
881 |
-
|
882 |
} elseif ( $page == 'ratings' ) {
|
883 |
|
884 |
-
switch ( $action )
|
885 |
case 'delete' :
|
886 |
if ( empty( $id ) )
|
887 |
return;
|
@@ -892,17 +998,17 @@ class WP_PollDaddy {
|
|
892 |
|
893 |
if ( is_array( $rating ) ) {
|
894 |
check_admin_referer( 'action-rating_bulk' );
|
895 |
-
|
896 |
foreach ( $rating as $key => $value ) {
|
897 |
$polldaddy->reset();
|
898 |
$polldaddy->delete_rating_result( $id, $value );
|
899 |
}
|
900 |
} else {
|
901 |
check_admin_referer( "delete-rating_$rating" );
|
902 |
-
|
903 |
$polldaddy->delete_rating_result( $id, $rating );
|
904 |
}
|
905 |
-
|
906 |
if ( isset( $_REQUEST['filter'] ) )
|
907 |
$query_args['filter'] = $_REQUEST['filter'];
|
908 |
if ( isset( $_REQUEST['change-report-to'] ) )
|
@@ -912,7 +1018,7 @@ class WP_PollDaddy {
|
|
912 |
break;
|
913 |
default :
|
914 |
return;
|
915 |
-
|
916 |
}
|
917 |
|
918 |
wp_redirect( add_query_arg( $query_args, wp_get_referer() ) );
|
@@ -920,16 +1026,19 @@ class WP_PollDaddy {
|
|
920 |
}
|
921 |
|
922 |
function management_page_load_signup() {
|
923 |
-
|
|
|
924 |
case 'import' :
|
925 |
return $this->import_account();
|
926 |
break;
|
927 |
default :
|
928 |
return;
|
929 |
-
|
930 |
}
|
931 |
|
932 |
function import_account() {
|
|
|
|
|
933 |
$polldaddy = $this->get_client( WP_POLLDADDY__PARTNERGUID );
|
934 |
$polldaddy->reset();
|
935 |
$email = trim( stripslashes( $_POST['polldaddy_email'] ) );
|
@@ -962,7 +1071,8 @@ class WP_PollDaddy {
|
|
962 |
}
|
963 |
|
964 |
function management_page_notices( $message = false ) {
|
965 |
-
|
|
|
966 |
case 'deleted' :
|
967 |
$deleted = (int) $_GET['deleted'];
|
968 |
if ( 1 == $deleted )
|
@@ -990,7 +1100,7 @@ class WP_PollDaddy {
|
|
990 |
case 'created' :
|
991 |
$message = __( 'Poll created.', 'polldaddy' );
|
992 |
if ( isset( $_GET['iframe'] ) )
|
993 |
-
$message .= ' <input type="button" class="button polldaddy-send-to-editor" value="' .
|
994 |
break;
|
995 |
case 'updated-style' :
|
996 |
$message = __( 'Custom Style updated.', 'polldaddy' );
|
@@ -1018,12 +1128,12 @@ class WP_PollDaddy {
|
|
1018 |
else
|
1019 |
$message = sprintf( __ngettext( '%s Rating Deleted.', '%s Ratings Deleted.', $deleted ), number_format_i18n( $deleted ) );
|
1020 |
break;
|
1021 |
-
|
1022 |
|
1023 |
$is_POST = 'post' == strtolower( $_SERVER['REQUEST_METHOD'] );
|
1024 |
|
1025 |
if ( $is_POST ) {
|
1026 |
-
switch ( $GLOBALS['action'] )
|
1027 |
case 'create-poll' :
|
1028 |
$message = __( 'Error: An error has occurred; Poll not created.', 'polldaddy' );
|
1029 |
break;
|
@@ -1036,7 +1146,7 @@ class WP_PollDaddy {
|
|
1036 |
else
|
1037 |
$message = __( 'Error: An error has occurred; Account could not be created.', 'polldaddy' );
|
1038 |
break;
|
1039 |
-
|
1040 |
}
|
1041 |
|
1042 |
if ( !$message )
|
@@ -1048,10 +1158,11 @@ class WP_PollDaddy {
|
|
1048 |
}
|
1049 |
|
1050 |
function management_page() {
|
|
|
1051 |
global $page, $action, $poll, $style, $rating;
|
1052 |
$poll = (int) $poll;
|
1053 |
$style = (int) $style;
|
1054 |
-
$rating =
|
1055 |
?>
|
1056 |
|
1057 |
<div class="wrap" id="manage-polls">
|
@@ -1061,33 +1172,32 @@ class WP_PollDaddy {
|
|
1061 |
if ( !$this->is_author && in_array( $action, array( 'edit', 'edit-poll', 'create-poll', 'edit-style', 'create-style', 'list-styles', 'options', 'update-options', 'import-account' ) ) ) {//check user privileges has access to action
|
1062 |
$action = '';
|
1063 |
}
|
1064 |
-
switch ( $action )
|
1065 |
case 'signup' :
|
1066 |
case 'account' :
|
1067 |
$this->signup();
|
1068 |
break;
|
1069 |
case 'preview' :
|
1070 |
-
|
1071 |
-
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
-
|
1076 |
-
clean_url( add_query_arg( array( 'action' => false, 'poll' => false, 'message' => false ) ) ) );
|
1077 |
-
else
|
1078 |
-
printf( __( 'Poll Preview (<a href="%s">List Polls</a>)', 'polldaddy' ), clean_url( add_query_arg( array( 'action' => false, 'poll' => false, 'message' => false ) ) ) ); ?></h2>
|
1079 |
-
|
1080 |
<?php
|
|
|
|
|
|
|
1081 |
echo do_shortcode( "[polldaddy poll=$poll cb=1]" );
|
1082 |
break;
|
1083 |
case 'results' :
|
1084 |
?>
|
1085 |
|
1086 |
-
<h2><?php
|
1087 |
if ( $this->is_author )
|
1088 |
-
|
1089 |
else
|
1090 |
-
|
1091 |
|
1092 |
<?php
|
1093 |
$this->poll_results_page( $poll );
|
@@ -1096,7 +1206,7 @@ class WP_PollDaddy {
|
|
1096 |
case 'edit-poll' :
|
1097 |
?>
|
1098 |
|
1099 |
-
<h2><?php
|
1100 |
|
1101 |
<?php
|
1102 |
|
@@ -1105,7 +1215,7 @@ class WP_PollDaddy {
|
|
1105 |
case 'create-poll' :
|
1106 |
?>
|
1107 |
|
1108 |
-
<h2
|
1109 |
|
1110 |
<?php
|
1111 |
$this->poll_edit_form();
|
@@ -1113,9 +1223,9 @@ class WP_PollDaddy {
|
|
1113 |
case 'list-styles' :
|
1114 |
?>
|
1115 |
|
1116 |
-
<h2><?php
|
1117 |
if ( $this->is_author )
|
1118 |
-
printf( __( 'Custom Styles
|
1119 |
else
|
1120 |
_e( 'Custom Styles', 'polldaddy' ); ?></h2>
|
1121 |
|
@@ -1125,7 +1235,7 @@ class WP_PollDaddy {
|
|
1125 |
case 'edit-style' :
|
1126 |
?>
|
1127 |
|
1128 |
-
<h2><?php printf( __( 'Edit Style
|
1129 |
|
1130 |
<?php
|
1131 |
|
@@ -1134,7 +1244,7 @@ class WP_PollDaddy {
|
|
1134 |
case 'create-style' :
|
1135 |
?>
|
1136 |
|
1137 |
-
<h2><?php printf( __( 'Create Style
|
1138 |
|
1139 |
<?php
|
1140 |
$this->style_edit_form();
|
@@ -1150,19 +1260,24 @@ class WP_PollDaddy {
|
|
1150 |
|
1151 |
<h2 id="poll-list-header"><?php
|
1152 |
if ( $this->is_author )
|
1153 |
-
printf( __( 'Polls
|
1154 |
else
|
1155 |
-
_e( 'Polls', 'polldaddy' ); ?></h2>
|
1156 |
|
1157 |
-
<?php
|
1158 |
-
|
1159 |
-
|
|
|
|
|
|
|
|
|
|
|
1160 |
} elseif ( $page == 'ratings' ) {
|
1161 |
if ( !$this->is_admin && !in_array( $action, array( 'delete', 'reports' ) ) ) {//check user privileges has access to action
|
1162 |
$action = 'reports';
|
1163 |
}
|
1164 |
|
1165 |
-
switch ( $action )
|
1166 |
case 'delete' :
|
1167 |
case 'reports' :
|
1168 |
$this->rating_reports();
|
@@ -1173,7 +1288,7 @@ class WP_PollDaddy {
|
|
1173 |
break;
|
1174 |
default :
|
1175 |
$this->rating_settings();
|
1176 |
-
|
1177 |
}
|
1178 |
?>
|
1179 |
|
@@ -1183,21 +1298,18 @@ class WP_PollDaddy {
|
|
1183 |
|
1184 |
}
|
1185 |
|
1186 |
-
function polls_table( $view = '
|
1187 |
$page = 1;
|
1188 |
if ( isset( $_GET['paged'] ) )
|
1189 |
$page = absint( $_GET['paged'] );
|
1190 |
$polldaddy = $this->get_client( WP_POLLDADDY__PARTNERGUID, $this->user_code );
|
1191 |
$polldaddy->reset();
|
1192 |
|
1193 |
-
if ( !$this->is_author )
|
1194 |
-
$view = '';
|
1195 |
-
|
1196 |
if ( 'user' == $view )
|
1197 |
$polls_object = $polldaddy->get_polls( ( $page - 1 ) * 10 + 1, $page * 10 );
|
1198 |
else
|
1199 |
$polls_object = $polldaddy->get_polls_by_parent_id( ( $page - 1 ) * 10 + 1, $page * 10 );
|
1200 |
-
|
1201 |
$this->parse_errors( $polldaddy );
|
1202 |
$this->print_errors();
|
1203 |
$polls = & $polls_object->poll;
|
@@ -1214,36 +1326,44 @@ class WP_PollDaddy {
|
|
1214 |
'current' => $page
|
1215 |
) );
|
1216 |
|
1217 |
-
|
1218 |
-
|
1219 |
-
<li><a href="<?php echo clean_url( add_query_arg( array( 'view' => false, 'paged' => false ) ) ); ?>"<?php if ( 'blog' == $view ) echo ' class="current"'; ?>><?php _e( "All Blog's Polls", 'polldaddy' ); ?></a> | </li>
|
1220 |
-
<li><a href="<?php echo clean_url( add_query_arg( array( 'view' => 'user', 'paged' => false ) ) ); ?>"<?php if ( 'user' == $view ) echo ' class="current"'; ?>><?php _e( "All My Polls", 'polldaddy' ); ?></a></li>
|
1221 |
-
</ul>
|
1222 |
-
<?php } ?>
|
1223 |
<form method="post" action="">
|
1224 |
-
<?php if ( $this->is_author ) { ?>
|
1225 |
<div class="tablenav">
|
1226 |
-
|
|
|
|
|
1227 |
<select name="action">
|
1228 |
<option selected="selected" value=""><?php _e( 'Actions', 'polldaddy' ); ?></option>
|
1229 |
<option value="delete"><?php _e( 'Delete', 'polldaddy' ); ?></option>
|
1230 |
<option value="close"><?php _e( 'Close', 'polldaddy' ); ?></option>
|
1231 |
<option value="open"><?php _e( 'Open', 'polldaddy' ); ?></option>
|
1232 |
</select>
|
|
|
1233 |
<input class="button-secondary action" type="submit" name="doaction" value="<?php _e( 'Apply', 'polldaddy' ); ?>" />
|
1234 |
<?php wp_nonce_field( 'action-poll_bulk' ); ?>
|
1235 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1236 |
<div class="tablenav-pages"><?php echo $page_links; ?></div>
|
1237 |
</div>
|
1238 |
-
|
1239 |
<?php } ?>
|
1240 |
<table class="widefat">
|
1241 |
<thead>
|
1242 |
<tr>
|
1243 |
-
|
1244 |
<th id="title" class="manage-column column-title" scope="col"><?php _e( 'Poll', 'polldaddy' ); ?></th>
|
1245 |
-
<th id="votes" class="manage-column column-vote num" scope="col"
|
1246 |
-
<th id="date" class="manage-column column-date" scope="col"><?php _e( 'Created', 'polldaddy' ); ?></th>
|
1247 |
</tr>
|
1248 |
</thead>
|
1249 |
<tbody>
|
@@ -1261,10 +1381,10 @@ class WP_PollDaddy {
|
|
1261 |
$poll_closed = (int) $poll->_closed;
|
1262 |
|
1263 |
if ( $this->is_author and $this->can_edit( $poll ) ) {
|
1264 |
-
$edit_link =
|
1265 |
-
$delete_link =
|
1266 |
-
$open_link =
|
1267 |
-
$close_link =
|
1268 |
}
|
1269 |
else {
|
1270 |
$edit_link = false;
|
@@ -1274,65 +1394,106 @@ class WP_PollDaddy {
|
|
1274 |
}
|
1275 |
|
1276 |
$class = $class ? '' : ' class="alternate"';
|
1277 |
-
$results_link =
|
1278 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1279 |
list( $poll_time ) = explode( '.', $poll->_created );
|
1280 |
$poll_time = strtotime( $poll_time );
|
1281 |
?>
|
1282 |
<tr<?php echo $class; ?>>
|
1283 |
<th class="check-column" scope="row"><?php if ( $this->is_author and $this->can_edit( $poll ) ) { ?><input type="checkbox" value="<?php echo (int) $poll_id; ?>" name="poll[]" /><?php } ?></th>
|
1284 |
-
<td class="post-title column-title">
|
1285 |
<?php if ( $edit_link ) { ?>
|
1286 |
-
<
|
|
|
|
|
|
|
1287 |
<div class="row-actions">
|
1288 |
<span class="edit"><a href="<?php echo $edit_link; ?>"><?php _e( 'Edit', 'polldaddy' ); ?></a> | </span>
|
1289 |
<?php } else { ?>
|
1290 |
-
<strong><?php echo
|
1291 |
<div class="row-actions">
|
|
|
1292 |
<?php } ?>
|
1293 |
-
|
1294 |
-
<?php if ( $
|
1295 |
-
<span class="
|
1296 |
-
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
1297 |
if ( $poll_closed == 2 ) {
|
1298 |
if ( $open_link ) { ?>
|
1299 |
<span class="open"><a class="open-poll" href="<?php echo $open_link; ?>"><?php _e( 'Open', 'polldaddy' ); ?></a> | </span>
|
1300 |
<?php } } else {
|
1301 |
if ( $close_link ) { ?>
|
1302 |
<span class="close"><a class="close-poll" href="<?php echo $close_link; ?>"><?php _e( 'Close', 'polldaddy' ); ?></a> | </span>
|
1303 |
-
<?php } }
|
1304 |
-
|
1305 |
-
<span class="view"><a href="<?php echo $preview_link; ?>"><?php _e( 'Preview', 'polldaddy' ); ?></a> | </span>
|
1306 |
-
<span class="editor">
|
1307 |
-
<a href="#" class="polldaddy-send-to-editor"><?php _e( 'Send to editor', 'polldaddy' ); ?></a>
|
1308 |
-
<input type="hidden" class="polldaddy-poll-id hack" value="<?php echo (int) $poll_id; ?>" /> |
|
1309 |
-
</span>
|
1310 |
-
<?php } else { ?>
|
1311 |
<span class="view"><a class="thickbox" href="<?php echo $preview_link; ?>"><?php _e( 'Preview', 'polldaddy' ); ?></a> | </span>
|
1312 |
-
<?php
|
1313 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1314 |
<?php $this->poll_table_add_option( $poll_id ); ?>
|
1315 |
</div>
|
1316 |
</td>
|
1317 |
-
<td class="poll-votes column-vote num"><?php echo number_format_i18n( $poll->_responses ); ?></td>
|
1318 |
-
<td class="date column-date"><abbr title="<?php echo date( __( 'Y/m/d g:i:s A', 'polldaddy' ), $poll_time ); ?>"><?php echo date( __( 'Y/m/d', 'polldaddy' ), $poll_time ); ?></abbr></td>
|
1319 |
</tr>
|
1320 |
-
<tr class="polldaddy-shortcode-row" style="display: none;">
|
1321 |
-
|
1322 |
-
|
1323 |
-
|
1324 |
-
|
1325 |
-
|
1326 |
-
|
1327 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1328 |
<noscript>
|
1329 |
-
|
1330 |
-
|
1331 |
</noscript></pre>
|
1332 |
-
<
|
1333 |
-
<
|
1334 |
-
|
1335 |
-
|
1336 |
</td>
|
1337 |
</tr>
|
1338 |
|
@@ -1342,7 +1503,7 @@ class WP_PollDaddy {
|
|
1342 |
?>
|
1343 |
|
1344 |
<tr>
|
1345 |
-
<td colspan="4"><?php printf( __( 'What are you doing here? <a href="%s">Go back</a>.', 'polldaddy' ),
|
1346 |
</tr>
|
1347 |
|
1348 |
<?php
|
@@ -1350,22 +1511,40 @@ class WP_PollDaddy {
|
|
1350 |
?>
|
1351 |
|
1352 |
<tr>
|
1353 |
-
<td colspan="4"><?php
|
1354 |
-
if ( $this->is_author )
|
1355 |
-
|
1356 |
-
|
1357 |
-
_e( '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1358 |
</tr>
|
1359 |
<?php endif; // $polls ?>
|
1360 |
|
1361 |
</tbody>
|
1362 |
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
1363 |
<?php $this->poll_table_extra(); ?>
|
1364 |
</form>
|
1365 |
-
<div class="tablenav">
|
1366 |
<div class="tablenav-pages"><?php echo $page_links; ?></div>
|
1367 |
</div>
|
1368 |
-
|
|
|
|
|
|
|
1369 |
<script language="javascript">
|
1370 |
jQuery( document ).ready(function(){
|
1371 |
plugin = new Plugin( {
|
@@ -1376,6 +1555,21 @@ class WP_PollDaddy {
|
|
1376 |
standard_styles: '<?php echo esc_attr( __( 'Standard Styles', 'polldaddy' ) ); ?>',
|
1377 |
custom_styles: '<?php echo esc_attr( __( 'Custom Styles', 'polldaddy' ) ); ?>'
|
1378 |
} );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1379 |
});
|
1380 |
</script>
|
1381 |
|
@@ -1411,29 +1605,146 @@ class WP_PollDaddy {
|
|
1411 |
$poll = polldaddy_poll( array(), null, false );
|
1412 |
}
|
1413 |
|
1414 |
-
$question = $is_POST ?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1415 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1416 |
$this->print_errors();
|
1417 |
?>
|
1418 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1419 |
<form action="" method="post">
|
1420 |
<div id="poststuff"><div id="post-body" class="has-sidebar has-right-sidebar">
|
1421 |
|
1422 |
<div class="inner-sidebar" id="side-info-column">
|
1423 |
<div id="submitdiv" class="postbox">
|
1424 |
-
<h3><?php _e( '
|
1425 |
<div class="inside">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1426 |
<div id="major-publishing-actions">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1427 |
<p id="publishing-action">
|
|
|
|
|
|
|
1428 |
<?php wp_nonce_field( $poll_id ? "edit-poll_$poll_id" : 'create-poll' ); ?>
|
1429 |
<input type="hidden" name="action" value="<?php echo $poll_id ? 'edit-poll' : 'create-poll'; ?>" />
|
1430 |
<input type="hidden" class="polldaddy-poll-id" name="poll" value="<?php echo $poll_id; ?>" />
|
1431 |
-
<input type="submit" class="button-primary" value="<?php echo
|
1432 |
|
1433 |
<?php if ( isset( $_GET['iframe'] ) && $poll_id ) : ?>
|
1434 |
-
|
1435 |
-
<input type="button" class="button polldaddy-send-to-editor" value="<?php echo
|
1436 |
-
|
1437 |
<?php endif; ?>
|
1438 |
|
1439 |
</p>
|
@@ -1443,7 +1754,7 @@ class WP_PollDaddy {
|
|
1443 |
</div>
|
1444 |
|
1445 |
<div class="postbox">
|
1446 |
-
<h3><?php _e( '
|
1447 |
<div class="inside">
|
1448 |
<ul class="poll-options">
|
1449 |
|
@@ -1456,7 +1767,7 @@ class WP_PollDaddy {
|
|
1456 |
?>
|
1457 |
|
1458 |
<li>
|
1459 |
-
<label for="resultsType-<?php echo $value; ?>"><input type="radio"<?php echo $checked; ?> value="<?php echo $value; ?>" name="resultsType" id="resultsType-<?php echo $value; ?>" /> <?php echo
|
1460 |
</li>
|
1461 |
|
1462 |
<?php endforeach; ?>
|
@@ -1466,7 +1777,7 @@ class WP_PollDaddy {
|
|
1466 |
</div>
|
1467 |
|
1468 |
<div class="postbox">
|
1469 |
-
<h3><?php _e( '
|
1470 |
<div class="inside">
|
1471 |
<ul class="poll-options">
|
1472 |
|
@@ -1479,14 +1790,14 @@ class WP_PollDaddy {
|
|
1479 |
?>
|
1480 |
|
1481 |
<li>
|
1482 |
-
<label for="blockRepeatVotersType-<?php echo $value; ?>"><input class="block-repeat" type="radio"<?php echo $checked; ?> value="<?php echo $value; ?>" name="blockRepeatVotersType" id="blockRepeatVotersType-<?php echo $value; ?>" /> <?php echo
|
1483 |
</li>
|
1484 |
|
1485 |
<?php endforeach; ?>
|
1486 |
|
1487 |
</ul>
|
1488 |
|
1489 |
-
<span style="margin:6px 6px 8px;" id="cookieip_expiration_label"><label><?php _e( 'Expires: ', 'polldaddy' ); ?></label></span>
|
1490 |
<select id="cookieip_expiration" name="cookieip_expiration" style="width: auto;<?php echo $poll->blockRepeatVotersType == 'off' ? 'display:none;' : ''; ?>">
|
1491 |
<option value="0" <?php echo (int) $poll->blockExpiration == 0 ? 'selected' : ''; ?>><?php _e( 'Never', 'polldaddy' ); ?></option>
|
1492 |
<option value="3600" <?php echo (int) $poll->blockExpiration == 3600 ? 'selected' : ''; ?>><?php printf( __( '%d hour', 'polldaddy' ), 1 ); ?></option>
|
@@ -1500,14 +1811,75 @@ class WP_PollDaddy {
|
|
1500 |
<p><?php _e( 'Note: Blocking by cookie and IP address can be problematic for some voters.', 'polldaddy' ); ?></p>
|
1501 |
</div>
|
1502 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1503 |
</div>
|
1504 |
|
1505 |
|
1506 |
-
<div id="post-body-content" class="has-sidebar-content">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1507 |
|
1508 |
-
<div id="titlediv">
|
1509 |
-
<div id="titlewrap">
|
1510 |
-
<input type="text" autocomplete="off" id="title" value="<?php echo $question; ?>" tabindex="1" size="30" name="question" />
|
1511 |
</div>
|
1512 |
</div>
|
1513 |
|
@@ -1518,25 +1890,49 @@ class WP_PollDaddy {
|
|
1518 |
<ul id="answers">
|
1519 |
<?php
|
1520 |
$a = 0;
|
1521 |
-
$answers = array();
|
1522 |
-
if ( $is_POST && $_POST['answer'] ) {
|
1523 |
-
foreach ( $_POST['answer'] as $answer_id => $answer )
|
1524 |
-
$answers[attribute_escape( $answer_id )] = attribute_escape( stripslashes( $answer ) );
|
1525 |
-
} elseif ( isset( $poll->answers->answer ) ) {
|
1526 |
-
foreach ( $poll->answers->answer as $answer )
|
1527 |
-
$answers[(int) $answer->_id] = attribute_escape( $answer->text );
|
1528 |
-
}
|
1529 |
-
|
1530 |
foreach ( $answers as $answer_id => $answer ) :
|
1531 |
$a++;
|
1532 |
-
$delete_link =
|
1533 |
?>
|
1534 |
|
1535 |
<li>
|
1536 |
-
|
1537 |
-
|
1538 |
-
<
|
1539 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1540 |
|
1541 |
<?php
|
1542 |
endforeach;
|
@@ -1546,61 +1942,52 @@ class WP_PollDaddy {
|
|
1546 |
?>
|
1547 |
|
1548 |
<li>
|
1549 |
-
<
|
1550 |
-
<div><input type="text" autocomplete="off" value="" tabindex="2" size="30" name="answer[new<?php echo $a; ?>]" /></div>
|
1551 |
-
<a href="#" class="delete-answer delete" title="<?php echo attribute_escape( 'delete this answer' ); ?>">×</a>
|
1552 |
-
</li>
|
1553 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1554 |
<?php
|
1555 |
-
|
1556 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1557 |
|
1558 |
-
</ul>
|
1559 |
|
1560 |
-
<p id="add-answer-holder">
|
1561 |
-
<button class="button"><?php echo wp_specialchars( __( 'Add another', 'polldaddy' ) ); ?></button>
|
1562 |
-
</p>
|
1563 |
|
1564 |
-
<ul id="answer-options">
|
1565 |
|
1566 |
-
<?php
|
1567 |
-
foreach ( array( 'multipleChoice' => __( 'Multiple choice', 'polldaddy' ), 'randomiseAnswers' => __( 'Randomize answer order', 'polldaddy' ), 'otherAnswer' => __( 'Allow other answers', 'polldaddy' ), 'sharing' => __( "'Share This' link", 'polldaddy' ) ) as $option => $label ) :
|
1568 |
-
if ( $is_POST )
|
1569 |
-
$checked = 'yes' === $_POST[$option] ? ' checked="checked"' : '';
|
1570 |
-
else
|
1571 |
-
$checked = 'yes' === $poll->$option ? ' checked="checked"' : '';
|
1572 |
-
?>
|
1573 |
|
1574 |
-
<li>
|
1575 |
-
<label for="<?php echo $option; ?>"><input type="checkbox"<?php echo $checked; ?> value="yes" id="<?php echo $option; ?>" name="<?php echo $option; ?>" /> <?php echo wp_specialchars( $label ); ?></label>
|
1576 |
</li>
|
1577 |
|
1578 |
-
<?php
|
|
|
|
|
1579 |
|
1580 |
</ul>
|
1581 |
-
<?php
|
1582 |
-
if ( $is_POST )
|
1583 |
-
$style = 'yes' === $_POST['multipleChoice'] ? 'display:block;' : 'display:none;';
|
1584 |
-
else
|
1585 |
-
$style = 'yes' === $poll->multipleChoice ? 'display:block;' : 'display:none;';
|
1586 |
-
?>
|
1587 |
-
<div id="numberChoices" name="numberChoices" style="padding-left:15px;<?php echo $style; ?>">
|
1588 |
-
<p>Number of choices: <select name="choices" id="choices"><option value="0">No Limit</option>
|
1589 |
-
<?php
|
1590 |
-
if ( $is_POST )
|
1591 |
-
$choices = (int) $_POST['choices'];
|
1592 |
-
else
|
1593 |
-
$choices = (int) $poll->choices;
|
1594 |
|
1595 |
-
|
1596 |
-
|
1597 |
-
|
1598 |
-
|
1599 |
-
endfor;
|
1600 |
-
endif; ?>
|
1601 |
-
</select>
|
1602 |
-
</p>
|
1603 |
-
</div>
|
1604 |
</div>
|
1605 |
</div>
|
1606 |
|
@@ -1693,158 +2080,72 @@ class WP_PollDaddy {
|
|
1693 |
}
|
1694 |
?>
|
1695 |
|
1696 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1697 |
<input type="hidden" name="styleID" id="styleID" value="<?php echo $style_ID ?>">
|
1698 |
<div class="inside">
|
1699 |
-
<?php if ( $iframe_view ) { ?>
|
1700 |
-
<div id="design_standard" style="padding:0px;">
|
1701 |
-
<div class="hide-if-no-js">
|
1702 |
-
<table class="pollStyle">
|
1703 |
-
<thead>
|
1704 |
-
<tr>
|
1705 |
-
<th>
|
1706 |
-
<div style="display:none;">
|
1707 |
-
<input type="radio" name="styleTypeCB" id="regular" onclick="javascript:pd_build_styles( 0 );"/>
|
1708 |
-
</div>
|
1709 |
-
</th>
|
1710 |
-
</tr>
|
1711 |
-
</thead>
|
1712 |
-
<tr>
|
1713 |
-
<td class="selector">
|
1714 |
-
<table class="st_selector">
|
1715 |
-
<tr>
|
1716 |
-
<td class="dir_left">
|
1717 |
-
<a href="javascript:pd_move('prev');" style="width: 1em;display: block;font-size: 4em;text-decoration: none;">«</a>
|
1718 |
-
</td>
|
1719 |
-
<td class="img"><div class="st_image_loader"><div id="st_image" onmouseover="st_results(this, 'show');" onmouseout="st_results(this, 'hide');"></div></div></td>
|
1720 |
-
<td class="dir_right">
|
1721 |
-
<a href="javascript:pd_move('next');" style="width: 1em;display: block;font-size: 4em;text-decoration: none;">»</a>
|
1722 |
-
</td>
|
1723 |
-
</tr>
|
1724 |
-
<tr>
|
1725 |
-
<td></td>
|
1726 |
-
<td class="counter">
|
1727 |
-
<div id="st_number"></div>
|
1728 |
-
</td>
|
1729 |
-
<td></td>
|
1730 |
-
</tr>
|
1731 |
-
<tr>
|
1732 |
-
<td></td>
|
1733 |
-
<td class="title">
|
1734 |
-
<div id="st_name"></div>
|
1735 |
-
</td>
|
1736 |
-
<td></td>
|
1737 |
-
</tr>
|
1738 |
-
<tr>
|
1739 |
-
<td></td>
|
1740 |
-
<td>
|
1741 |
-
<div id="st_sizes"></div>
|
1742 |
-
</td>
|
1743 |
-
<td></td>
|
1744 |
-
</tr>
|
1745 |
-
<tr>
|
1746 |
-
<td colspan="3">
|
1747 |
-
<div id="st_description"></div>
|
1748 |
-
</td>
|
1749 |
-
</tr>
|
1750 |
-
</table>
|
1751 |
-
</td>
|
1752 |
-
</tr>
|
1753 |
-
</table>
|
1754 |
-
</div>
|
1755 |
|
1756 |
-
|
1757 |
-
|
|
|
|
|
1758 |
|
1759 |
-
|
1760 |
-
$selected = $styleID == $style_ID ? ' selected="selected"' : ''; ?>
|
1761 |
-
<option value="<?php echo (int) $styleID; ?>"<?php echo $selected; ?>><?php echo wp_specialchars( $label ); ?></option>
|
1762 |
-
<?php endforeach; ?>
|
1763 |
|
1764 |
-
|
1765 |
-
|
1766 |
-
|
1767 |
-
|
1768 |
-
|
1769 |
-
<p class="hide-if-no-js">
|
1770 |
-
<table class="pollStyle">
|
1771 |
-
<thead>
|
1772 |
-
<tr>
|
1773 |
-
<th>
|
1774 |
-
<div style="display:none;">
|
1775 |
-
<?php $disabled = $show_custom == false ? ' disabled="true"' : ''; ?>
|
1776 |
-
<input type="radio" name="styleTypeCB" id="custom" onclick="javascript:pd_change_style(_$('customSelect').value);" <?php echo $disabled; ?>></input>
|
1777 |
-
<label onclick="javascript:pd_change_style(_$('customSelect').value);"><?php _e( 'Custom Style', 'polldaddy' ); ?></label>
|
1778 |
-
</div>
|
1779 |
-
</th>
|
1780 |
-
</tr>
|
1781 |
-
</thead>
|
1782 |
-
<tbody>
|
1783 |
-
<tr>
|
1784 |
-
<td class="customSelect">
|
1785 |
-
<table>
|
1786 |
-
<tr>
|
1787 |
-
<td><?php $hide = $show_custom == true ? ' style="display:block;"' : ' style="display:none;"'; ?>
|
1788 |
-
<select id="customSelect" name="customSelect" onclick="pd_change_style(this.value);" <?php echo $hide ?>>
|
1789 |
-
<?php $selected = $custom_style_ID == 0 ? ' selected="selected"' : ''; ?>
|
1790 |
-
<option value="x"<?php echo $selected; ?>><?php _e( 'Please choose a custom style...', 'polldaddy' ); ?></option>
|
1791 |
-
<?php if ( $show_custom ) : foreach ( (array)$styles->style as $style ) :
|
1792 |
-
$selected = $style->_id == $custom_style_ID ? ' selected="selected"' : ''; ?>
|
1793 |
-
<option value="<?php echo (int) $style->_id; ?>"<?php echo $selected; ?>><?php echo wp_specialchars( $style->title ); ?></option>
|
1794 |
-
<?php endforeach; endif; ?>
|
1795 |
-
</select>
|
1796 |
-
<div id="styleIDErr" class="formErr" style="display:none;"><?php _e( 'Please choose a style.', 'polldaddy' ); ?></div></td>
|
1797 |
-
</tr>
|
1798 |
-
<tr>
|
1799 |
-
<td><?php $extra = $show_custom == false ? __( 'You currently have no custom styles created.', 'polldaddy' ) : ''; ?>
|
1800 |
-
<p><?php echo $extra ?></p>
|
1801 |
-
<p><?php printf( __( 'Did you know we have a new editor for building your own custom poll styles? Find out more <a href="%s" target="_blank">here</a>.', 'polldaddy' ), 'http://support.polldaddy.com/custom-poll-styles/' ); ?></p>
|
1802 |
-
</td>
|
1803 |
-
</tr>
|
1804 |
-
</table>
|
1805 |
-
</td>
|
1806 |
-
</tr>
|
1807 |
-
</tbody>
|
1808 |
-
</table>
|
1809 |
-
</p>
|
1810 |
-
</div>
|
1811 |
-
<div id="design_options">
|
1812 |
-
<a href="#" class="polldaddy-show-design-options"><?php _e( 'Custom Styles', 'polldaddy' ); ?></a>
|
1813 |
-
</div>
|
1814 |
-
<?php }}else {?>
|
1815 |
-
<div class="design_standard">
|
1816 |
<div class="hide-if-no-js">
|
1817 |
-
|
1818 |
-
|
1819 |
-
|
1820 |
-
|
1821 |
-
|
1822 |
-
|
1823 |
-
|
1824 |
-
|
1825 |
-
</
|
1826 |
-
|
1827 |
-
<th class="cb">
|
1828 |
-
<?php $disabled = $show_custom == false ? ' disabled="true"' : ''; ?>
|
1829 |
-
<input type="radio" name="styleTypeCB" id="custom" onclick="javascript:pd_change_style(_$('customSelect').value);" <?php echo $disabled; ?>></input>
|
1830 |
-
</th>
|
1831 |
-
<th>
|
1832 |
-
<label onclick="javascript:pd_change_style(_$('customSelect').value);"><?php _e( 'Custom Style', 'polldaddy' ); ?></label>
|
1833 |
-
</th>
|
1834 |
-
</tr>
|
1835 |
-
</thead>
|
1836 |
-
<tbody>
|
1837 |
<tr>
|
1838 |
-
<td
|
1839 |
-
<td class="selector">
|
1840 |
<table class="st_selector">
|
1841 |
<tr>
|
1842 |
-
<td class="dir_left">
|
1843 |
-
<a href="javascript:pd_move('prev');" style="
|
1844 |
</td>
|
1845 |
<td class="img"><div class="st_image_loader"><div id="st_image" onmouseover="st_results(this, 'show');" onmouseout="st_results(this, 'hide');"></div></div></td>
|
1846 |
-
<td class="dir_right">
|
1847 |
-
<a href="javascript:pd_move('next');" style="
|
1848 |
</td>
|
1849 |
</tr>
|
1850 |
<tr>
|
@@ -1870,60 +2171,191 @@ class WP_PollDaddy {
|
|
1870 |
</tr>
|
1871 |
<tr>
|
1872 |
<td colspan="3">
|
1873 |
-
<div id="st_description"></div>
|
1874 |
-
</td>
|
1875 |
-
</tr>
|
1876 |
-
</table>
|
1877 |
-
</td>
|
1878 |
-
<td width="100"></td>
|
1879 |
-
<td/>
|
1880 |
-
<td class="customSelect">
|
1881 |
-
<table>
|
1882 |
-
<tr>
|
1883 |
-
<td><?php $hide = $show_custom == true ? ' style="display:block;"' : ' style="display:none;"'; ?>
|
1884 |
-
<select id="customSelect" name="customSelect" onclick="pd_change_style(this.value);" <?php echo $hide ?>>
|
1885 |
-
<?php $selected = $custom_style_ID == 0 ? ' selected="selected"' : ''; ?>
|
1886 |
-
<option value="x"<?php echo $selected; ?>><?php _e( 'Please choose a custom style...', 'polldaddy' ); ?></option>
|
1887 |
-
<?php if ( $show_custom ) : foreach ( (array)$styles->style as $style ) :
|
1888 |
-
$selected = $style->_id == $custom_style_ID ? ' selected="selected"' : ''; ?>
|
1889 |
-
<option value="<?php echo (int) $style->_id; ?>"<?php echo $selected; ?>><?php echo wp_specialchars( $style->title ); ?></option>
|
1890 |
-
<?php endforeach; endif;?>
|
1891 |
-
</select>
|
1892 |
-
<div id="styleIDErr" class="formErr" style="display:none;"><?php _e( 'Please choose a style.', 'polldaddy' ); ?></div></td>
|
1893 |
-
</tr>
|
1894 |
-
<tr>
|
1895 |
-
<td><?php $extra = $show_custom == false ? __( 'You currently have no custom styles created.', 'polldaddy' ) : ''; ?>
|
1896 |
-
<p><?php echo $extra ?></p>
|
1897 |
-
<p><?php printf( __( 'Did you know we have a new editor for building your own custom poll styles? Find out more <a href="%s" target="_blank">here</a>.', 'polldaddy' ), 'http://support.polldaddy.com/custom-poll-styles/' ); ?></p>
|
1898 |
</td>
|
1899 |
</tr>
|
1900 |
</table>
|
1901 |
</td>
|
1902 |
</tr>
|
1903 |
-
</
|
1904 |
-
</table>
|
1905 |
</div>
|
|
|
1906 |
<p class="empty-if-js" id="no-js-styleID">
|
1907 |
<select id="styleID" name="styleID">
|
1908 |
|
1909 |
<?php foreach ( $options as $styleID => $label ) :
|
1910 |
$selected = $styleID == $style_ID ? ' selected="selected"' : ''; ?>
|
1911 |
-
<option value="<?php echo (int) $styleID; ?>"<?php echo $selected; ?>><?php echo
|
1912 |
<?php endforeach; ?>
|
1913 |
|
1914 |
</select>
|
1915 |
</p>
|
1916 |
</div>
|
1917 |
-
|
1918 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1919 |
jQuery( document ).ready(function(){
|
1920 |
plugin = new Plugin( {
|
1921 |
delete_rating: '<?php echo esc_attr( __( 'Are you sure you want to delete the rating for "%s"?', 'polldaddy' ) ); ?>',
|
1922 |
delete_poll: '<?php echo esc_attr( __( 'Are you sure you want to delete "%s"?', 'polldaddy' ) ); ?>',
|
1923 |
delete_answer: '<?php echo esc_attr( __( 'Are you sure you want to delete this answer?', 'polldaddy' ) ); ?>',
|
1924 |
-
|
1925 |
-
|
1926 |
-
|
|
|
|
|
|
|
|
|
|
|
1927 |
} );
|
1928 |
});
|
1929 |
</script>
|
@@ -2030,13 +2462,17 @@ class WP_PollDaddy {
|
|
2030 |
$polldaddy->reset();
|
2031 |
|
2032 |
$results = $polldaddy->get_poll_results( $poll_id );
|
2033 |
-
|
2034 |
|
|
|
|
|
2035 |
<table class="poll-results widefat">
|
2036 |
<thead>
|
2037 |
<tr>
|
2038 |
-
<th scope="col" class="column-title"><?php _e( 'Answer', 'polldaddy' ); ?></th>
|
2039 |
-
<th scope="col" class="column-vote"><?php _e( 'Votes', 'polldaddy' ); ?></th>
|
|
|
|
|
2040 |
</tr>
|
2041 |
</thead>
|
2042 |
<tbody>
|
@@ -2050,18 +2486,20 @@ class WP_PollDaddy {
|
|
2050 |
}
|
2051 |
|
2052 |
$class = $class ? '' : ' class="alternate"';
|
2053 |
-
$content = $results->others && 'Other answer...' === $answer->text ? sprintf( __( 'Other (<a href="%s">see below</a>)', 'polldaddy' ), '#other-answers-results' ) :
|
2054 |
|
2055 |
?>
|
2056 |
|
2057 |
<tr<?php echo $class; ?>>
|
2058 |
-
<th scope="row" class="column-title"><?php echo $content; ?></th>
|
2059 |
-
<td class="column-vote">
|
2060 |
-
|
2061 |
-
|
2062 |
-
|
2063 |
-
|
2064 |
-
|
|
|
|
|
2065 |
</td>
|
2066 |
</tr>
|
2067 |
<?php
|
@@ -2095,7 +2533,7 @@ class WP_PollDaddy {
|
|
2095 |
?>
|
2096 |
|
2097 |
<tr<?php echo $class; ?>>
|
2098 |
-
<th scope="row" class="column-title"><?php echo
|
2099 |
<td class="column-vote"><?php echo number_format_i18n( $freq ); ?></td>
|
2100 |
</tr>
|
2101 |
<?php
|
@@ -2140,11 +2578,11 @@ class WP_PollDaddy {
|
|
2140 |
</div>
|
2141 |
<div class="tablenav-pages"></div>
|
2142 |
</div>
|
2143 |
-
|
2144 |
<table class="widefat">
|
2145 |
<thead>
|
2146 |
<tr>
|
2147 |
-
<th id="cb" class="manage-column column-cb check-column" scope="col"
|
2148 |
<th id="title" class="manage-column column-title" scope="col"><?php _e( 'Style', 'polldaddy' ); ?></th>
|
2149 |
<th id="date" class="manage-column column-date" scope="col"><?php _e( 'Last Modified', 'polldaddy' ); ?></th>
|
2150 |
</tr>
|
@@ -2158,8 +2596,8 @@ class WP_PollDaddy {
|
|
2158 |
$style_id = (int) $style->_id;
|
2159 |
|
2160 |
$class = $class ? '' : ' class="alternate"';
|
2161 |
-
$edit_link =
|
2162 |
-
$delete_link =
|
2163 |
list( $style_time ) = explode( '.', $style->date );
|
2164 |
$style_time = strtotime( $style_time );
|
2165 |
?>
|
@@ -2168,13 +2606,15 @@ class WP_PollDaddy {
|
|
2168 |
<th class="check-column" scope="row"><input type="checkbox" value="<?php echo (int) $style_id; ?>" name="style[]" /></th>
|
2169 |
<td class="post-title column-title">
|
2170 |
<?php if ( $edit_link ) : ?>
|
2171 |
-
<strong><a class="row-title" href="<?php echo $edit_link; ?>"><?php echo
|
|
|
2172 |
<span class="edit"><a href="<?php echo $edit_link; ?>"><?php _e( 'Edit', 'polldaddy' ); ?></a> | </span>
|
2173 |
<?php else : ?>
|
2174 |
-
<strong><?php echo
|
2175 |
<?php endif; ?>
|
2176 |
|
2177 |
<span class="delete"><a class="delete-poll delete" href="<?php echo $delete_link; ?>"><?php _e( 'Delete', 'polldaddy' ); ?></a></span>
|
|
|
2178 |
</td>
|
2179 |
<td class="date column-date"><abbr title="<?php echo date( __( 'Y/m/d g:i:s A', 'polldaddy' ), $style_time ); ?>"><?php echo date( __( 'Y/m/d', 'polldaddy' ), $style_time ); ?></abbr></td>
|
2180 |
</tr>
|
@@ -2186,7 +2626,13 @@ class WP_PollDaddy {
|
|
2186 |
?>
|
2187 |
|
2188 |
<tr>
|
2189 |
-
<td colspan="4"
|
|
|
|
|
|
|
|
|
|
|
|
|
2190 |
</tr>
|
2191 |
<?php endif; // $styles ?>
|
2192 |
|
@@ -2255,27 +2701,21 @@ class WP_PollDaddy {
|
|
2255 |
<div id="poststuff">
|
2256 |
<div id="post-body">
|
2257 |
<br/>
|
2258 |
-
<table
|
2259 |
<tr>
|
2260 |
-
<td
|
2261 |
-
<
|
2262 |
-
|
2263 |
-
|
2264 |
-
|
2265 |
-
|
2266 |
-
<
|
2267 |
-
|
2268 |
-
|
2269 |
-
<input type="text" autocomplete="off" id="title" value="<?php echo $style_id > 1000 ? $style->title : ''; ?>" tabindex="1" size="30" name="style-title"></input>
|
2270 |
-
</div>
|
2271 |
-
</div>
|
2272 |
-
</td>
|
2273 |
-
</tr>
|
2274 |
-
</table>
|
2275 |
</td>
|
2276 |
</tr>
|
2277 |
<tr>
|
2278 |
-
<td
|
2279 |
<label class="CSSE_title_label"><?php _e( 'Preload Basic Style', 'polldaddy' ); ?></label>
|
2280 |
</td>
|
2281 |
<td>
|
@@ -2290,14 +2730,17 @@ class WP_PollDaddy {
|
|
2290 |
<option value="117"><?php _e( 'Skull Light', 'polldaddy' ); ?></option>
|
2291 |
<option value="157"><?php _e( 'Micro', 'polldaddy' ); ?></option>
|
2292 |
</select>
|
2293 |
-
<a tabindex="4" id="style-preload" href="javascript:preload_pd_style();" class="button"><?php echo
|
2294 |
</div>
|
2295 |
</td>
|
2296 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
2297 |
<tr>
|
2298 |
-
<td
|
2299 |
-
<p><?php _e( 'Choose a part to edit...', 'polldaddy' ); ?></p>
|
2300 |
-
</td>
|
2301 |
<td>
|
2302 |
<select id="styleName" onchange="renderStyleEdit(this.value);">
|
2303 |
<option value="pds-box" selected="selected"><?php _e( 'Poll Box', 'polldaddy' ); ?></option>
|
@@ -2312,9 +2755,13 @@ class WP_PollDaddy {
|
|
2312 |
<option value="pds-answer-feedback-bar"><?php _e( 'Result Bar', 'polldaddy' ); ?></option>
|
2313 |
<option value="pds-totalvotes-inner"><?php _e( 'Total Votes', 'polldaddy' ); ?></option>
|
2314 |
</select>
|
|
|
2315 |
</td>
|
2316 |
</tr>
|
|
|
2317 |
</table>
|
|
|
|
|
2318 |
<table width="100%">
|
2319 |
<tr>
|
2320 |
<td valign="top">
|
@@ -2939,7 +3386,7 @@ class WP_PollDaddy {
|
|
2939 |
</td>
|
2940 |
<td width="10"> </td>
|
2941 |
<td valign="top">
|
2942 |
-
<div style="overflow-x:auto;
|
2943 |
<!-- POLL XHTML START -->
|
2944 |
<div class="pds-box" id="pds-box">
|
2945 |
<div class="pds-box-outer">
|
@@ -3080,9 +3527,9 @@ class WP_PollDaddy {
|
|
3080 |
<?php wp_nonce_field( $style_id > 1000 ? "edit-style$style_id" : 'create-style' ); ?>
|
3081 |
<input type="hidden" name="action" value="<?php echo $style_id > 1000 ? 'edit-style' : 'create-style'; ?>" />
|
3082 |
<input type="hidden" class="polldaddy-style-id" name="style" value="<?php echo $style_id; ?>" />
|
3083 |
-
<input type="submit" class="button-primary" value="<?php echo
|
3084 |
<?php if ( $style_id > 1000 ) { ?>
|
3085 |
-
<input name="updatePollCheck" id="updatePollCheck" type="checkbox"> <label for="updatePollCheck"><?php _e( 'Check this box if you wish to update the polls that use this style.' ); ?></label>
|
3086 |
<?php } ?>
|
3087 |
</p>
|
3088 |
</div>
|
@@ -3131,7 +3578,7 @@ class WP_PollDaddy {
|
|
3131 |
$updated = false;
|
3132 |
|
3133 |
if ( isset( $rating ) ) {
|
3134 |
-
switch ( $rating )
|
3135 |
case 'pages':
|
3136 |
$report_type = 'pages';
|
3137 |
$rating_id = (int) get_option( 'pd-rating-pages-id' );
|
@@ -3144,7 +3591,7 @@ class WP_PollDaddy {
|
|
3144 |
$report_type = 'posts';
|
3145 |
$rating_id = (int) get_option( 'pd-rating-posts-id' );
|
3146 |
break;
|
3147 |
-
|
3148 |
}
|
3149 |
|
3150 |
$new_type = 0;
|
@@ -3190,14 +3637,14 @@ class WP_PollDaddy {
|
|
3190 |
}
|
3191 |
|
3192 |
if ( empty( $pd_rating ) ) { //something's up!
|
3193 |
-
echo '<div class="error"><p>'.sprintf( __( 'Sorry! There was an error creating your rating widget. Please contact <a href="%1$s" %2$s>
|
3194 |
$error = true;
|
3195 |
} else {
|
3196 |
$rating_id = (int) $pd_rating->_id;
|
3197 |
update_option ( 'pd-rating-' . $report_type . '-id', $rating_id );
|
3198 |
update_option ( 'pd-rating-' . $report_type, 0 );
|
3199 |
|
3200 |
-
switch ( $report_type )
|
3201 |
case 'posts':
|
3202 |
$show_posts = 0;
|
3203 |
break;
|
@@ -3207,13 +3654,13 @@ class WP_PollDaddy {
|
|
3207 |
case 'comments':
|
3208 |
$show_comments = 0;
|
3209 |
break;
|
3210 |
-
|
3211 |
}
|
3212 |
}
|
3213 |
|
3214 |
if ( isset( $_POST[ 'pd_rating_action_type' ] ) ) {
|
3215 |
|
3216 |
-
switch ( $_POST[ 'pd_rating_action_type' ] )
|
3217 |
case 'posts' :
|
3218 |
if ( isset( $_POST[ 'pd_show_posts' ] ) && (int) $_POST[ 'pd_show_posts' ] == 1 )
|
3219 |
$show_posts = get_option( 'pd-rating-posts-id' );
|
@@ -3222,48 +3669,48 @@ class WP_PollDaddy {
|
|
3222 |
|
3223 |
if ( isset( $_POST[ 'pd_show_posts_index' ] ) && (int) $_POST[ 'pd_show_posts_index' ] == 1 )
|
3224 |
$show_posts_index = get_option( 'pd-rating-posts-id' );
|
3225 |
-
|
3226 |
update_option( 'pd-rating-posts-index', $show_posts_index );
|
3227 |
-
|
3228 |
if ( isset( $_POST[ 'posts_pos' ] ) && (int) $_POST[ 'posts_pos' ] == 1 )
|
3229 |
$pos_posts = 1;
|
3230 |
-
|
3231 |
update_option( 'pd-rating-posts-pos', $pos_posts );
|
3232 |
-
|
3233 |
if ( isset( $_POST[ 'posts_index_pos' ] ) && (int) $_POST[ 'posts_index_pos' ] == 1 )
|
3234 |
$pos_posts_index = 1;
|
3235 |
-
|
3236 |
update_option( 'pd-rating-posts-index-pos', $pos_posts_index );
|
3237 |
$rating_updated = true;
|
3238 |
break;
|
3239 |
-
|
3240 |
case 'pages';
|
3241 |
if ( isset( $_POST[ 'pd_show_pages' ] ) && (int) $_POST[ 'pd_show_pages' ] == 1 )
|
3242 |
$show_pages = get_option( 'pd-rating-pages-id' );
|
3243 |
-
|
3244 |
update_option( 'pd-rating-pages', $show_pages );
|
3245 |
-
|
3246 |
if ( isset( $_POST[ 'pages_pos' ] ) && (int) $_POST[ 'pages_pos' ] == 1 )
|
3247 |
$pos_pages = 1;
|
3248 |
-
|
3249 |
update_option( 'pd-rating-pages-pos', $pos_pages );
|
3250 |
$rating_updated = true;
|
3251 |
break;
|
3252 |
-
|
3253 |
case 'comments':
|
3254 |
if ( isset( $_POST[ 'pd_show_comments' ] ) && (int) $_POST[ 'pd_show_comments' ] == 1 )
|
3255 |
$show_comments = get_option( 'pd-rating-comments-id' );
|
3256 |
-
|
3257 |
update_option( 'pd-rating-comments', $show_comments );
|
3258 |
-
|
3259 |
if ( isset( $_POST[ 'comments_pos' ] ) && (int) $_POST[ 'comments_pos' ] == 1 )
|
3260 |
$pos_comments = 1;
|
3261 |
-
|
3262 |
update_option( 'pd-rating-comments-pos', $pos_comments );
|
3263 |
-
|
3264 |
$rating_updated = true;
|
3265 |
break;
|
3266 |
-
|
3267 |
}
|
3268 |
|
3269 |
$show_posts = (int) get_option( 'pd-rating-posts' );
|
@@ -3293,7 +3740,7 @@ class WP_PollDaddy {
|
|
3293 |
$settings->font_color = '#000000';
|
3294 |
}?>
|
3295 |
<div class="wrap">
|
3296 |
-
<h2><?php _e( '
|
3297 |
if ( $rating_updated )
|
3298 |
echo '<div class="updated"><p>'.__( 'Rating updated', 'polldaddy' ).'</p></div>';
|
3299 |
|
@@ -3302,9 +3749,9 @@ class WP_PollDaddy {
|
|
3302 |
<div id="categorydiv" class="categorydiv">
|
3303 |
<ul id="category-tabs" class="category-tabs"><?php
|
3304 |
$this_class = '';
|
3305 |
-
$posts_link =
|
3306 |
-
$pages_link =
|
3307 |
-
$comments_link =
|
3308 |
if ( $report_type == 'posts' )
|
3309 |
$this_class = ' class="tabs"';?>
|
3310 |
<li <?php echo $this_class; ?>><a tabindex="3" href="<?php echo $posts_link; ?>"><?php _e( 'Posts', 'polldaddy' );?></a></li><?php
|
@@ -3429,7 +3876,7 @@ class WP_PollDaddy {
|
|
3429 |
<div class="postbox" id="submitdiv">
|
3430 |
<h3><?php _e( 'Save', 'polldaddy' );?></h3>
|
3431 |
<div class="inside">
|
3432 |
-
<div id="major-
|
3433 |
<input type="hidden" name="type" value="<?php echo $report_type; ?>" />
|
3434 |
<input type="hidden" name="rating_id" value="<?php echo $rating_id; ?>" />
|
3435 |
<input type="hidden" name="action" value="update-rating" />
|
@@ -3457,115 +3904,115 @@ class WP_PollDaddy {
|
|
3457 |
<td><p style="margin-bottom: 0px;"><?php _e( 'Vote', 'polldaddy' );?></p></td>
|
3458 |
</tr>
|
3459 |
<tr>
|
3460 |
-
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_vote" id="text_vote" value="<?php echo empty( $settings->text_vote ) ? 'Vote' :
|
3461 |
</tr>
|
3462 |
<tr>
|
3463 |
<td><p style="margin-bottom: 0px;"><?php _e( 'Votes', 'polldaddy' );?></p></td>
|
3464 |
</tr>
|
3465 |
<tr>
|
3466 |
-
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_votes" id="text_votes" value="<?php echo empty( $settings->text_votes ) ? 'Votes' :
|
3467 |
</tr>
|
3468 |
<tr>
|
3469 |
<td><p style="margin-bottom: 0px;"><?php _e( 'Rate This', 'polldaddy' );?></p></td>
|
3470 |
</tr>
|
3471 |
<tr>
|
3472 |
-
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_rate_this" id="text_rate_this" value="<?php echo empty( $settings->text_rate_this ) ? 'Rate This' :
|
3473 |
</tr>
|
3474 |
<tr>
|
3475 |
<td><p style="margin-bottom: 0px;"><?php printf( __( '%d star', 'polldaddy' ), 1 );?></p></td>
|
3476 |
</tr>
|
3477 |
<tr>
|
3478 |
-
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_1_star" id="text_1_star" value="<?php echo empty( $settings->text_1_star ) ? '1 star' :
|
3479 |
</tr>
|
3480 |
<tr>
|
3481 |
<td><p style="margin-bottom: 0px;"><?php printf( __( '%d stars', 'polldaddy' ), 2 );?></p></td>
|
3482 |
</tr>
|
3483 |
<tr>
|
3484 |
-
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_2_star" id="text_2_star" value="<?php echo empty( $settings->text_2_star ) ? '2 stars' :
|
3485 |
</tr>
|
3486 |
<tr>
|
3487 |
<td><p style="margin-bottom: 0px;"><?php printf( __( '%d stars', 'polldaddy' ), 3 );?></p></td>
|
3488 |
</tr>
|
3489 |
<tr>
|
3490 |
-
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_3_star" id="text_3_star" value="<?php echo empty( $settings->text_3_star ) ? '3 stars' :
|
3491 |
</tr>
|
3492 |
<tr>
|
3493 |
<td><p style="margin-bottom: 0px;"><?php printf( __( '%d stars', 'polldaddy' ), 4 );?></p></td>
|
3494 |
</tr>
|
3495 |
<tr>
|
3496 |
-
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_4_star" id="text_4_star" value="<?php echo empty( $settings->text_4_star ) ? '4 stars' :
|
3497 |
</tr>
|
3498 |
<tr>
|
3499 |
<td><p style="margin-bottom: 0px;"><?php printf( __( '%d stars', 'polldaddy' ), 5 );?></p></td>
|
3500 |
</tr>
|
3501 |
<tr>
|
3502 |
-
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_5_star" id="text_5_star" value="<?php echo empty( $settings->text_5_star ) ? '5 stars' :
|
3503 |
</tr>
|
3504 |
<tr>
|
3505 |
<td><p style="margin-bottom: 0px;"><?php _e( 'Thank You', 'polldaddy' );?></p></td>
|
3506 |
</tr>
|
3507 |
<tr>
|
3508 |
-
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_thank_you" id="text_thank_you" value="<?php echo empty( $settings->text_thank_you ) ? 'Thank You' :
|
3509 |
</tr>
|
3510 |
<tr>
|
3511 |
<td><p style="margin-bottom: 0px;"><?php _e( 'Rate Up', 'polldaddy' );?></p></td>
|
3512 |
</tr>
|
3513 |
<tr>
|
3514 |
-
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_rate_up" id="text_rate_up" value="<?php echo empty( $settings->text_rate_up ) ? 'Rate Up' :
|
3515 |
</tr>
|
3516 |
<tr>
|
3517 |
<td><p style="margin-bottom: 0px;"><?php _e( 'Rate Down', 'polldaddy' );?></p></td>
|
3518 |
</tr>
|
3519 |
<tr>
|
3520 |
-
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_rate_down" id="text_rate_down" value="<?php echo empty( $settings->text_rate_down ) ? 'Rate Down' :
|
3521 |
</tr>
|
3522 |
<tr>
|
3523 |
<td><p style="margin-bottom: 0px;"><?php _e( 'Most Popular Content', 'polldaddy' );?></p></td>
|
3524 |
</tr>
|
3525 |
<tr>
|
3526 |
-
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_popcontent" id="text_popcontent" value="<?php echo empty( $settings->text_popcontent ) ? 'Most Popular Content' :
|
3527 |
</tr>
|
3528 |
<tr>
|
3529 |
<td><p style="margin-bottom: 0px;"><?php _e( 'Close', 'polldaddy' );?></p></td>
|
3530 |
</tr>
|
3531 |
<tr>
|
3532 |
-
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_close" id="text_close" value="<?php echo empty( $settings->text_close ) ? 'Close' :
|
3533 |
</tr>
|
3534 |
<tr>
|
3535 |
<td><p style="margin-bottom: 0px;"><?php _e( 'All', 'polldaddy' );?></p></td>
|
3536 |
</tr>
|
3537 |
<tr>
|
3538 |
-
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_all" id="text_all" value="<?php echo empty( $settings->text_all ) ? 'All' :
|
3539 |
</tr>
|
3540 |
<tr>
|
3541 |
<td><p style="margin-bottom: 0px;"><?php _e( 'Today', 'polldaddy' );?></p></td>
|
3542 |
</tr>
|
3543 |
<tr>
|
3544 |
-
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_today" id="text_today" value="<?php echo empty( $settings->text_today ) ? 'Today' :
|
3545 |
</tr>
|
3546 |
<tr>
|
3547 |
<td><p style="margin-bottom: 0px;"><?php _e( 'This Week', 'polldaddy' );?></p></td>
|
3548 |
</tr>
|
3549 |
<tr>
|
3550 |
-
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_thisweek" id="text_thisweek" value="<?php echo empty( $settings->text_thisweek ) ? 'This Week' :
|
3551 |
</tr>
|
3552 |
<tr>
|
3553 |
<td><p style="margin-bottom: 0px;"><?php _e( 'This Month', 'polldaddy' );?></p></td>
|
3554 |
</tr>
|
3555 |
<tr>
|
3556 |
-
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_thismonth" id="text_thismonth" value="<?php echo empty( $settings->text_thismonth ) ? 'This Month' :
|
3557 |
</tr>
|
3558 |
<tr>
|
3559 |
<td><p style="margin-bottom: 0px;"><?php _e( 'Rated', 'polldaddy' );?></p></td>
|
3560 |
</tr>
|
3561 |
<tr>
|
3562 |
-
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_rated" id="text_rated" value="<?php echo empty( $settings->text_rated ) ? 'Rated' :
|
3563 |
</tr>
|
3564 |
<tr>
|
3565 |
<td><p style="margin-bottom: 0px;"><?php _e( 'There are no rated items for this period', 'polldaddy' );?></p></td>
|
3566 |
</tr>
|
3567 |
<tr>
|
3568 |
-
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_noratings" id="text_noratings" value="<?php echo empty( $settings->text_noratings ) ? 'There are no rated items for this period' :
|
3569 |
</tr>
|
3570 |
</table>
|
3571 |
</div>
|
@@ -3641,7 +4088,7 @@ class WP_PollDaddy {
|
|
3641 |
</tr>
|
3642 |
<tr>
|
3643 |
<td height="30"><?php _e( 'Custom Image', 'polldaddy' );?></td>
|
3644 |
-
<td><input type="text" onblur="pd_bind(this);" name="custom_star" id="custom_star" value="<?php echo
|
3645 |
</tr>
|
3646 |
</table>
|
3647 |
</div>
|
@@ -3694,7 +4141,7 @@ class WP_PollDaddy {
|
|
3694 |
</tr>
|
3695 |
<tr>
|
3696 |
<td height="30"><?php _e( 'Color', 'polldaddy' );?></td>
|
3697 |
-
<td><input type="text" onblur="pd_bind(this);" class="elmColor jscolor-picker" name="font_color" id="font_color" value="<?php echo
|
3698 |
</td>
|
3699 |
</tr>
|
3700 |
<tr>
|
@@ -3762,7 +4209,7 @@ class WP_PollDaddy {
|
|
3762 |
</td>
|
3763 |
</tr><?php
|
3764 |
if ( $report_type == 'posts' ) {
|
3765 |
-
$exclude_post_ids =
|
3766 |
<tr>
|
3767 |
<td width="100" height="30"><?php _e( 'Rating ID', 'polldaddy' );?></td>
|
3768 |
<td>
|
@@ -3785,8 +4232,8 @@ class WP_PollDaddy {
|
|
3785 |
</span>
|
3786 |
</td>
|
3787 |
</tr><?php
|
3788 |
-
}
|
3789 |
-
|
3790 |
<tr>
|
3791 |
<td width="100" height="30"><?php _e( 'Rating ID', 'polldaddy' );?></td>
|
3792 |
<td>
|
@@ -3809,7 +4256,7 @@ class WP_PollDaddy {
|
|
3809 |
</span>
|
3810 |
</td>
|
3811 |
</tr><?php
|
3812 |
-
|
3813 |
<tr>
|
3814 |
<td width="100" height="30"><?php _e( 'Rating ID', 'polldaddy' );?></td>
|
3815 |
<td>
|
@@ -3821,7 +4268,7 @@ class WP_PollDaddy {
|
|
3821 |
</span>
|
3822 |
</td>
|
3823 |
</tr><?php
|
3824 |
-
|
3825 |
</table>
|
3826 |
</div>
|
3827 |
</div>
|
@@ -3871,14 +4318,14 @@ class WP_PollDaddy {
|
|
3871 |
$new_rating_id = (int) $_REQUEST['polldaddy-post-rating-id'];
|
3872 |
$type = 'posts';
|
3873 |
}
|
3874 |
-
|
3875 |
-
|
3876 |
-
|
3877 |
-
|
3878 |
-
|
3879 |
-
|
3880 |
-
|
3881 |
-
|
3882 |
$new_rating_id = $rating_id;
|
3883 |
}
|
3884 |
|
@@ -3887,21 +4334,21 @@ class WP_PollDaddy {
|
|
3887 |
$set->type = 'stars';
|
3888 |
$rating_type = 0;
|
3889 |
if ( isset( $_REQUEST['star_color'] ) )
|
3890 |
-
$set->star_color =
|
3891 |
} else {
|
3892 |
$set->type = 'nero';
|
3893 |
$rating_type = 1;
|
3894 |
if ( isset( $_REQUEST['nero_style'] ) )
|
3895 |
-
$set->star_color =
|
3896 |
}
|
3897 |
|
3898 |
-
$set->size =
|
3899 |
-
$set->custom_star =
|
3900 |
-
$set->font_align =
|
3901 |
-
$set->font_position =
|
3902 |
-
$set->font_family =
|
3903 |
-
$set->font_size =
|
3904 |
-
$set->font_line_height =
|
3905 |
|
3906 |
if ( isset( $_REQUEST['font_bold'] ) && $_REQUEST['font_bold'] == 'bold' )
|
3907 |
$set->font_bold = 'bold';
|
@@ -3913,27 +4360,27 @@ class WP_PollDaddy {
|
|
3913 |
else
|
3914 |
$set->font_italic = 'normal';
|
3915 |
|
3916 |
-
$set->text_vote = stripslashes(
|
3917 |
-
$set->text_votes = stripslashes(
|
3918 |
-
$set->text_rate_this = stripslashes(
|
3919 |
-
$set->text_1_star = stripslashes(
|
3920 |
-
$set->text_2_star = stripslashes(
|
3921 |
-
$set->text_3_star = stripslashes(
|
3922 |
-
$set->text_4_star = stripslashes(
|
3923 |
-
$set->text_5_star = stripslashes(
|
3924 |
-
$set->text_thank_you = stripslashes(
|
3925 |
-
$set->text_rate_up = stripslashes(
|
3926 |
-
$set->text_rate_down = stripslashes(
|
3927 |
-
$set->font_color = stripslashes(
|
3928 |
-
|
3929 |
-
$set->text_popcontent= stripslashes(
|
3930 |
-
$set->text_close = stripslashes(
|
3931 |
-
$set->text_all = stripslashes(
|
3932 |
-
$set->text_today = stripslashes(
|
3933 |
-
$set->text_thisweek = stripslashes(
|
3934 |
-
$set->text_thismonth = stripslashes(
|
3935 |
-
$set->text_rated = stripslashes(
|
3936 |
-
$set->text_noratings = stripslashes(
|
3937 |
|
3938 |
|
3939 |
$set->popup = 'off';
|
@@ -3946,24 +4393,24 @@ class WP_PollDaddy {
|
|
3946 |
$polldaddy->reset();
|
3947 |
$rating = $polldaddy->update_rating( $rating_id, $settings_text, $rating_type );
|
3948 |
}
|
3949 |
-
|
3950 |
-
|
3951 |
-
|
3952 |
-
|
3953 |
-
|
3954 |
-
|
3955 |
-
|
3956 |
-
|
3957 |
-
|
3958 |
-
|
3959 |
-
|
3960 |
-
|
3961 |
-
|
3962 |
-
|
3963 |
-
|
3964 |
-
|
3965 |
-
}
|
3966 |
}
|
|
|
3967 |
|
3968 |
if ( $this->is_admin ) {
|
3969 |
if ( $type=='posts' && isset( $_REQUEST['exclude-post-ids'] ) ) {
|
@@ -4016,26 +4463,26 @@ class WP_PollDaddy {
|
|
4016 |
$show_rating = 0;
|
4017 |
|
4018 |
if ( isset( $_REQUEST['change-report-to'] ) ) {
|
4019 |
-
switch ( $_REQUEST['change-report-to'] )
|
4020 |
case 'pages':
|
4021 |
$report_type = 'pages';
|
4022 |
$rating_id = (int) get_option( 'pd-rating-pages-id' );
|
4023 |
break;
|
4024 |
-
|
4025 |
case 'comments':
|
4026 |
$report_type = 'comments';
|
4027 |
$rating_id = get_option( 'pd-rating-comments-id' );
|
4028 |
break;
|
4029 |
-
|
4030 |
case 'posts':
|
4031 |
$report_type = 'posts';
|
4032 |
$rating_id = get_option( 'pd-rating-posts-id' );
|
4033 |
break;
|
4034 |
-
|
4035 |
}
|
4036 |
|
4037 |
if ( isset( $_REQUEST['filter'] ) && $_REQUEST['filter'] ) {
|
4038 |
-
switch ( $_REQUEST['filter'] )
|
4039 |
case '1':
|
4040 |
$period = '1';
|
4041 |
break;
|
@@ -4043,23 +4490,23 @@ class WP_PollDaddy {
|
|
4043 |
case '7':
|
4044 |
$period = '7';
|
4045 |
break;
|
4046 |
-
|
4047 |
case '31':
|
4048 |
$period = '31';
|
4049 |
break;
|
4050 |
-
|
4051 |
case '90':
|
4052 |
$period = '90';
|
4053 |
break;
|
4054 |
-
|
4055 |
case '365':
|
4056 |
$period = '365';
|
4057 |
break;
|
4058 |
-
|
4059 |
case 'all':
|
4060 |
$period = 'all';
|
4061 |
break;
|
4062 |
-
|
4063 |
}
|
4064 |
|
4065 |
$page_size = 15;
|
@@ -4099,7 +4546,7 @@ class WP_PollDaddy {
|
|
4099 |
) );
|
4100 |
?>
|
4101 |
<div class="wrap">
|
4102 |
-
<h2><?php _e( 'Rating Reports', 'polldaddy' );?>
|
4103 |
<div class="clear"></div>
|
4104 |
<form method="post" action="admin.php?page=ratings&action=reports">
|
4105 |
<div class="tablenav">
|
@@ -4161,12 +4608,12 @@ class WP_PollDaddy {
|
|
4161 |
$alt = '';
|
4162 |
|
4163 |
foreach ( $ratings as $rating ) :
|
4164 |
-
$delete_link =
|
4165 |
$alt_counter++;?>
|
4166 |
<tr <?php echo ( $alt_counter & 1 ) ? ' class="alternate"' : ''; ?>>
|
4167 |
-
<th class="check-column" scope="row"><input type="checkbox" value="<?php echo
|
4168 |
<td class="post-title column-title">
|
4169 |
-
<strong><a href="<?php echo
|
4170 |
<div class="row-actions">
|
4171 |
<?php if ( $delete_link ) { ?>
|
4172 |
<span class="delete"><a class="delete-rating delete" href="<?php echo $delete_link; ?>"><?php _e( 'Delete', 'polldaddy' ); ?></a></span>
|
@@ -4174,10 +4621,10 @@ class WP_PollDaddy {
|
|
4174 |
</div>
|
4175 |
</td>
|
4176 |
<td class="column-id">
|
4177 |
-
<?php echo
|
4178 |
</td>
|
4179 |
<td class="date column-date">
|
4180 |
-
<abbr title="<?php echo date( __( 'Y/m/d g:i:s A', 'polldaddy' ), $rating->date ); ?>"><?php echo str_replace( '-', '/', substr(
|
4181 |
</td>
|
4182 |
<td class="column-vote num"><?php echo number_format( $rating->_votes ); ?></td>
|
4183 |
<td class="column-rating num"><table width="100%"><tr align="center"><td style="border:none;"><?php
|
@@ -4240,14 +4687,14 @@ class WP_PollDaddy {
|
|
4240 |
|
4241 |
function plugin_options() {
|
4242 |
if ( isset( $_POST['polldaddy_email'] ) ) {
|
4243 |
-
$account_email =
|
4244 |
}
|
4245 |
else {
|
4246 |
$polldaddy = $this->get_client( WP_POLLDADDY__PARTNERGUID, $this->user_code );
|
4247 |
$account = $polldaddy->get_account();
|
4248 |
|
4249 |
if ( !empty( $account ) )
|
4250 |
-
$account_email =
|
4251 |
|
4252 |
$polldaddy->reset();
|
4253 |
$poll = $polldaddy->get_poll( 1 );
|
@@ -4330,7 +4777,7 @@ class WP_PollDaddy {
|
|
4330 |
</h2>
|
4331 |
<?php if ( $this->is_admin || $this->multiple_accounts ) {?>
|
4332 |
<h3>
|
4333 |
-
<?php _e( '
|
4334 |
</h3>
|
4335 |
<p>
|
4336 |
<?php _e( 'This is the PollDadddy account you currently have imported into your WordPress account', 'polldaddy' ); ?>.
|
@@ -4341,7 +4788,7 @@ class WP_PollDaddy {
|
|
4341 |
<tr class="form-field form-required">
|
4342 |
<th valign="top" scope="row">
|
4343 |
<label for="polldaddy-email">
|
4344 |
-
<?php _e( '
|
4345 |
</label>
|
4346 |
</th>
|
4347 |
<td>
|
@@ -4351,7 +4798,7 @@ class WP_PollDaddy {
|
|
4351 |
<tr class="form-field form-required">
|
4352 |
<th valign="top" scope="row">
|
4353 |
<label for="polldaddy-password">
|
4354 |
-
<?php _e( '
|
4355 |
</label>
|
4356 |
</th>
|
4357 |
<td>
|
@@ -4364,7 +4811,7 @@ class WP_PollDaddy {
|
|
4364 |
<?php wp_nonce_field( 'polldaddy-account' ); ?>
|
4365 |
<input type="hidden" name="action" value="import-account" />
|
4366 |
<input type="hidden" name="account" value="import" />
|
4367 |
-
<input type="submit" value="<?php echo
|
4368 |
</p>
|
4369 |
</form>
|
4370 |
<br />
|
@@ -4403,45 +4850,57 @@ class WP_PollDaddy {
|
|
4403 |
if ( $poll->sharing == 'yes' )
|
4404 |
$selected = 'checked="checked"';?>
|
4405 |
<label for="sharing"><input type="checkbox" <?php echo $selected; ?> value="1" id="sharing" name="sharing"> <?php _e( 'Sharing', 'polldaddy' ); ?></label>
|
4406 |
-
<br />
|
4407 |
-
<
|
|
|
|
|
4408 |
<select id="resultsType" name="resultsType">
|
4409 |
<option <?php echo $poll->resultsType == 'show' ? 'selected="selected"':''; ?> value="show"><?php _e( 'Show', 'polldaddy' ); ?></option>
|
4410 |
<option <?php echo $poll->resultsType == 'hide' ? 'selected="selected"':''; ?> value="hide"><?php _e( 'Hide', 'polldaddy' ); ?></option>
|
4411 |
<option <?php echo $poll->resultsType == 'percent' ? 'selected="selected"':''; ?> value="percent"><?php _e( 'Percentages', 'polldaddy' ); ?></option>
|
4412 |
-
</select>
|
4413 |
-
</
|
4414 |
-
<br />
|
4415 |
-
<
|
|
|
|
|
4416 |
<select id="styleID" name="styleID"><?php
|
4417 |
foreach ( (array) $options as $styleID => $label ) :
|
4418 |
$selected = $styleID == $poll->styleID ? ' selected="selected"' : ''; ?>
|
4419 |
-
<option value="<?php echo (int) $styleID; ?>"<?php echo $selected; ?>><?php echo
|
4420 |
endforeach;?>
|
4421 |
-
</select>
|
4422 |
-
|
4423 |
-
|
4424 |
-
<
|
|
|
|
|
|
|
4425 |
<select id="poll-block-repeat" name="blockRepeatVotersType">
|
4426 |
<option <?php echo $poll->blockRepeatVotersType == 'off' ? 'selected="selected"':''; ?> value="off"><?php _e( 'Off', 'polldaddy' ); ?></option>
|
4427 |
<option <?php echo $poll->blockRepeatVotersType == 'cookie' ? 'selected="selected"':''; ?> value="cookie"><?php _e( 'Cookie', 'polldaddy' ); ?></option>
|
4428 |
<option <?php echo $poll->blockRepeatVotersType == 'cookieip' ? 'selected="selected"':''; ?> value="cookieip"><?php _e( 'Cookie & IP address', 'polldaddy' ); ?></option>
|
4429 |
-
</select>
|
4430 |
-
|
4431 |
-
<br />
|
4432 |
-
<
|
|
|
|
|
|
|
|
|
4433 |
<select id="blockExpiration" name="blockExpiration">
|
4434 |
<option value="0" <?php echo $poll->blockExpiration == 0 ? 'selected="selected"':''; ?>><?php _e( 'Never', 'polldaddy' ); ?></option>
|
4435 |
<option value="3600" <?php echo $poll->blockExpiration == 3600 ? 'selected="selected"':''; ?>><?php printf( __( '%d hour', 'polldaddy' ), 1 ); ?></option>
|
4436 |
<option value="10800" <?php echo (int) $poll->blockExpiration == 10800 ? 'selected="selected"' : ''; ?>><?php printf( __( '%d hours', 'polldaddy' ), 3 ); ?></option>
|
4437 |
-
|
4438 |
-
|
4439 |
-
|
4440 |
-
|
4441 |
-
|
4442 |
-
|
4443 |
-
|
4444 |
-
|
|
|
4445 |
</fieldset>
|
4446 |
</td>
|
4447 |
</tr>
|
@@ -4451,7 +4910,7 @@ class WP_PollDaddy {
|
|
4451 |
<p class="submit">
|
4452 |
<?php wp_nonce_field( 'polldaddy-account' ); ?>
|
4453 |
<input type="hidden" name="action" value="update-options" />
|
4454 |
-
<input type="submit" value="<?php echo
|
4455 |
</p>
|
4456 |
</form>
|
4457 |
</div>
|
@@ -4487,4 +4946,6 @@ class WP_PollDaddy {
|
|
4487 |
}
|
4488 |
|
4489 |
require 'rating.php';
|
|
|
|
|
4490 |
require 'polldaddy-org.php';
|
1 |
<?php
|
2 |
|
3 |
/*
|
4 |
+
Plugin Name: Polldaddy Polls & Ratings
|
5 |
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
|
32 |
|
33 |
function __construct() {
|
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();
|
41 |
+
$this->is_admin = (bool) current_user_can( 'manage_options' );
|
42 |
+
$this->is_author = true;
|
43 |
+
$this->id = (int) $current_user->ID;
|
44 |
+
$this->user_code = null;
|
45 |
+
$this->rating_user_code = null;
|
46 |
+
|
47 |
}
|
48 |
|
49 |
function &get_client( $api_key, $userCode = null ) {
|
58 |
}
|
59 |
|
60 |
function config_client( $client ) {
|
61 |
+
|
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' ) ) {
|
69 |
$guid = get_option( 'polldaddy_api_key' );
|
70 |
if ( !$guid || !is_string( $guid ) )
|
71 |
$guid = false;
|
72 |
define( 'WP_POLLDADDY__PARTNERGUID', $guid );
|
73 |
+
|
74 |
}
|
75 |
|
76 |
if ( !WP_POLLDADDY__PARTNERGUID ) {
|
77 |
+
|
78 |
if ( function_exists( 'add_object_page' ) ) // WP 2.7+
|
79 |
+
$hook = add_object_page( __( 'Polls', 'polldaddy' ), __( 'Polls', 'polldaddy' ), 'edit_posts', 'polls', array( &$this, 'api_key_page' ), "{$this->base_url}img/pd-wp-icon-gray.png" );
|
80 |
else
|
81 |
+
$hook = add_management_page( __( 'Polls', 'polldaddy' ), __( 'Polls', 'polldaddy' ), 'edit_posts', 'polls', array( &$this, 'api_key_page' ) );
|
82 |
|
83 |
add_action( "load-$hook", array( &$this, 'api_key_page_load' ) );
|
84 |
|
85 |
if ( function_exists( 'add_object_page' ) ) // WP 2.7+
|
86 |
+
$hook = add_object_page( __( 'Ratings', 'polldaddy' ), __( 'Ratings', 'polldaddy' ), 'edit_posts', 'ratings', array( &$this, 'api_key_page' ), "{$this->base_url}img/pd-wp-icon-gray.png" );
|
87 |
else
|
88 |
+
$hook = add_management_page( __( 'Ratings', 'polldaddy' ), __( 'Ratings', 'polldaddy' ), 'edit_posts', 'ratings', array( &$this, 'api_key_page' ) );
|
89 |
|
90 |
add_action( "load-$hook", array( &$this, 'api_key_page_load' ) );
|
91 |
+
|
|
|
92 |
return false;
|
93 |
+
|
94 |
}
|
95 |
|
96 |
+
|
97 |
if ( function_exists( 'add_object_page' ) ) // WP 2.7+
|
98 |
+
$hook = add_object_page( __( 'Polls', 'polldaddy' ), __( 'Polls', 'polldaddy' ), 'edit_posts', 'polls', array( &$this, 'management_page' ), "{$this->base_url}img/pd-wp-icon-gray.png" );
|
99 |
else
|
100 |
+
$hook = add_management_page( __( 'Polls', 'polldaddy' ), __( 'Polls', 'polldaddy' ), 'edit_posts', 'polls', array( &$this, 'management_page' ) );
|
101 |
|
102 |
add_action( "load-$hook", array( &$this, 'management_page_load' ) );
|
103 |
|
104 |
if ( function_exists( 'add_object_page' ) ) // WP 2.7+
|
105 |
+
$hook = add_object_page( __( 'Ratings', 'polldaddy' ), __( 'Ratings', 'polldaddy' ), 'edit_posts', 'ratings', array( &$this, 'management_page' ), "{$this->base_url}img/pd-wp-icon-gray.png" );
|
106 |
else
|
107 |
+
$hook = add_management_page( __( 'Ratings', 'polldaddy' ), __( 'Ratings', 'polldaddy' ), 'edit_posts', 'ratings', array( &$this, 'management_page' ) );
|
108 |
|
109 |
add_action( "load-$hook", array( &$this, 'management_page_load' ) );
|
110 |
|
111 |
+
|
112 |
if ( $this->is_admin ) {
|
113 |
+
add_submenu_page( 'ratings', __( 'Ratings – Settings', 'polldaddy' ), __( 'All Ratings', 'polldaddy' ), 'edit_posts', 'ratings', array( &$this, 'management_page' ) );
|
114 |
add_submenu_page( 'ratings', __( 'Ratings – Reports', 'polldaddy' ), __( 'Reports', 'polldaddy' ), 'edit_posts', 'ratings&action=reports', array( &$this, 'management_page' ) );
|
115 |
}
|
116 |
else {
|
117 |
add_submenu_page( 'ratings', __( 'Ratings – Reports', 'polldaddy' ), __( 'Reports', 'polldaddy' ), 'edit_posts', 'ratings', array( &$this, 'management_page' ) );
|
118 |
}
|
119 |
|
120 |
+
add_submenu_page( 'polls', __( 'Polls', 'polldaddy' ), __( 'All Polls', 'polldaddy' ), 'edit_posts', 'polls', array( &$this, 'management_page' ) );
|
121 |
|
122 |
if ( $this->is_author ) {
|
123 |
add_submenu_page( 'polls', __( 'Add New Poll', 'polldaddy' ), __( 'Add New', 'polldaddy' ), 'edit_posts', 'polls&action=create-poll', array( &$this, 'management_page' ) );
|
124 |
add_submenu_page( 'polls', __( 'Custom Styles', 'polldaddy' ), __( 'Custom Styles', 'polldaddy' ), 'edit_posts', 'polls&action=list-styles', array( &$this, 'management_page' ) );
|
125 |
+
add_options_page( __( 'Polls & Ratings', 'polldaddy' ), __( 'Polls & Ratings', 'polldaddy' ), 'edit_posts', 'polls&action=options', array( &$this, 'management_page' ) );
|
126 |
}
|
127 |
|
128 |
add_action( 'media_buttons', array( &$this, 'media_buttons' ) );
|
129 |
}
|
130 |
|
131 |
+
|
132 |
+
function do_admin_css() {
|
133 |
+
|
134 |
+
$scheme = get_user_option( 'admin_color' );
|
135 |
+
|
136 |
+
if ( $scheme == 'classic' ) {
|
137 |
+
$color = "blue";
|
138 |
+
} else {
|
139 |
+
$color = "gray";
|
140 |
+
}
|
141 |
+
|
142 |
+
include 'admin-style.php';
|
143 |
+
}
|
144 |
+
|
145 |
function api_key_page_load() {
|
146 |
+
|
147 |
if ( 'post' != strtolower( $_SERVER['REQUEST_METHOD'] ) || empty( $_POST['action'] ) || 'account' != $_POST['action'] )
|
148 |
return false;
|
149 |
|
162 |
return false;
|
163 |
|
164 |
$details = array(
|
165 |
+
'uName' => get_bloginfo( 'name' ),
|
166 |
+
'uEmail' => $polldaddy_email,
|
167 |
+
'uPass' => $polldaddy_password,
|
168 |
'partner_userid' => $this->id
|
169 |
);
|
170 |
if ( function_exists( 'wp_remote_post' ) ) { // WP 2.7+
|
186 |
);
|
187 |
|
188 |
if ( !$fp ) {
|
189 |
+
$this->errors->add( 'connect', __( "Can't connect to Polldaddy.com", 'polldaddy' ) );
|
190 |
return false;
|
191 |
}
|
192 |
|
235 |
foreach ( $polldaddy->errors as $code => $error )
|
236 |
$this->errors->add( $code, $error );
|
237 |
if ( isset( $this->errors->errors[4] ) ) {
|
238 |
+
$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'] ) ) ) );
|
239 |
$this->errors->add_data( true, 4 );
|
240 |
}
|
241 |
}
|
245 |
return;
|
246 |
?>
|
247 |
|
248 |
+
<div class="error" id="polldaddy-error">
|
249 |
|
250 |
<?php
|
251 |
|
253 |
foreach ( $this->errors->get_error_messages( $error_code ) as $error_message ) :
|
254 |
?>
|
255 |
|
256 |
+
<p><?php echo $this->errors->get_error_data( $error_code ) ? $error_message : esc_html( $error_message ); ?></p>
|
257 |
|
258 |
<?php
|
259 |
endforeach;
|
273 |
?>
|
274 |
|
275 |
<div class="wrap">
|
276 |
+
<h2 id="polldaddy-header"><?php _e( 'Polldaddy', 'polldaddy' ); ?></h2>
|
277 |
|
278 |
+
<p><?php printf( __( 'Before you can use the Polldaddy plugin, you need to enter your <a href="%s">Polldaddy.com</a> account details.', 'polldaddy' ), 'http://polldaddy.com/' ); ?></p>
|
|
|
|
|
279 |
|
280 |
<form action="" method="post">
|
281 |
<table class="form-table">
|
282 |
<tbody>
|
283 |
<tr class="form-field form-required">
|
284 |
<th valign="top" scope="row">
|
285 |
+
<label for="polldaddy-email"><?php _e( 'Polldaddy Email Address', 'polldaddy' ); ?></label>
|
286 |
</th>
|
287 |
<td>
|
288 |
<input type="text" name="polldaddy_email" id="polldaddy-email" aria-required="true" size="40" />
|
290 |
</tr>
|
291 |
<tr class="form-field form-required">
|
292 |
<th valign="top" scope="row">
|
293 |
+
<label for="polldaddy-password"><?php _e( 'Polldaddy Password', 'polldaddy' ); ?></label>
|
294 |
</th>
|
295 |
<td>
|
296 |
<input type="password" name="polldaddy_password" id="polldaddy-password" aria-required="true" size="40" />
|
302 |
<?php wp_nonce_field( 'polldaddy-account' ); ?>
|
303 |
<input type="hidden" name="action" value="account" />
|
304 |
<input type="hidden" name="account" value="import" />
|
305 |
+
<input type="submit" value="<?php echo esc_attr( __( 'Submit', 'polldaddy' ) ); ?>" />
|
306 |
</p>
|
307 |
</form>
|
308 |
</div>
|
316 |
}
|
317 |
|
318 |
function set_api_user_code() {
|
319 |
+
|
320 |
+
$this->user_code = get_option( 'pd-usercode' );
|
321 |
|
322 |
if ( empty( $this->user_code ) ) {
|
323 |
+
$polldaddy = $this->get_client( WP_POLLDADDY__PARTNERGUID );
|
324 |
+
$polldaddy->reset();
|
325 |
+
|
326 |
$this->user_code = $polldaddy->get_usercode( $this->id );
|
327 |
+
|
328 |
+
if ( !empty( $this->user_code ) ) {
|
329 |
+
update_option( 'pd-usercode', $this->user_code );
|
330 |
+
}
|
331 |
}
|
332 |
}
|
333 |
|
334 |
function management_page_load() {
|
335 |
+
|
336 |
wp_reset_vars( array( 'page', 'action', 'poll', 'style', 'rating', 'id' ) );
|
337 |
global $plugin_page, $page, $action, $poll, $style, $rating, $id, $wp_locale;
|
338 |
|
344 |
|
345 |
require_once WP_POLLDADDY__POLLDADDY_CLIENT_PATH;
|
346 |
|
347 |
+
wp_enqueue_script( 'polls', "{$this->base_url}polldaddy.js", array( 'jquery', 'jquery-ui-sortable', 'jquery-form' ), $this->version );
|
348 |
wp_enqueue_script( 'polls-common', "{$this->base_url}common.js", array(), $this->version );
|
349 |
|
350 |
if ( $page == 'polls' ) {
|
352 |
$action = '';
|
353 |
}
|
354 |
|
355 |
+
switch ( $action ) {
|
356 |
case 'edit' :
|
357 |
case 'edit-poll' :
|
358 |
case 'create-poll' :
|
359 |
+
case 'add-media' :
|
360 |
+
wp_enqueue_script( 'media-upload', array(), $this->version );
|
361 |
wp_enqueue_script( 'polls-style', "http://i.polldaddy.com/js/poll-style-picker.js", array(), $this->version );
|
362 |
|
363 |
if ( $action == 'create-poll' )
|
364 |
$plugin_page = 'polls&action=create-poll';
|
365 |
+
|
366 |
break;
|
367 |
case 'edit-style' :
|
368 |
case 'create-style' :
|
379 |
case 'import-account' :
|
380 |
$plugin_page = 'polls&action=options';
|
381 |
break;
|
382 |
+
}//end switch
|
383 |
+
} elseif ( $page == 'ratings' ) {
|
384 |
+
if ( !$this->is_admin && !in_array( $action, array( 'reports', 'delete' ) ) ) {//check user privileges has access to action
|
385 |
+
$action = 'reports';
|
386 |
+
}
|
387 |
+
switch ( $action ) {
|
388 |
+
case 'delete' :
|
389 |
+
case 'reports' :
|
390 |
+
$plugin_page = 'ratings&action=reports';
|
391 |
break;
|
392 |
default :
|
393 |
wp_enqueue_script( 'rating-text-color', "http://i.polldaddy.com/js/jquery/jscolor.js", array(), $this->version );
|
395 |
wp_localize_script( 'polls-common', 'adminRatingsL10n', array(
|
396 |
'star_colors' => __( 'Star Colors', 'polldaddy' ), 'star_size' => __( 'Star Size', 'polldaddy' ),
|
397 |
'nero_type' => __( 'Nero Type', 'polldaddy' ), 'nero_size' => __( 'Nero Size', 'polldaddy' ), ) );
|
398 |
+
}//end switch
|
399 |
}
|
400 |
|
401 |
+
wp_enqueue_style( 'polls', "{$this->base_url}polldaddy.css", array( 'global', 'wp-admin' ), $this->version );
|
402 |
wp_enqueue_script( 'admin-forms' );
|
403 |
add_thickbox();
|
404 |
|
405 |
+
|
406 |
+
|
407 |
if ( isset( $wp_locale->text_direction ) && 'rtl' == $wp_locale->text_direction )
|
408 |
wp_enqueue_style( 'polls-rtl', "{$this->base_url}polldaddy-rtl.css", array( 'global', 'wp-admin' ), $this->version );
|
409 |
add_action( 'admin_body_class', array( &$this, 'admin_body_class' ) );
|
415 |
|
416 |
$allowedtags = array(
|
417 |
'a' => array(
|
418 |
+
'href' => array(),
|
419 |
+
'title' => array(),
|
420 |
+
'target' => array() ),
|
421 |
'img' => array(
|
422 |
+
'alt' => array(),
|
423 |
+
'align' => array(),
|
424 |
+
'border' => array(),
|
425 |
+
'class' => array(),
|
426 |
+
'height' => array(),
|
427 |
+
'hspace' => array(),
|
428 |
+
'longdesc' => array(),
|
429 |
+
'vspace' => array(),
|
430 |
+
'src' => array(),
|
431 |
+
'width' => array() ),
|
432 |
+
'abbr' => array( 'title' => array() ),
|
433 |
+
'acronym' => array( 'title' => array() ),
|
434 |
+
'blockquote' => array( 'cite' => array() ),
|
435 |
+
'q' => array( 'cite' => array() ),
|
436 |
+
'b' => array(),
|
437 |
+
'cite' => array(),
|
438 |
+
'em' => array(),
|
439 |
+
'i' => array(),
|
|
|
|
|
|
|
|
|
440 |
'strike' => array(),
|
441 |
'strong' => array()
|
442 |
);
|
444 |
$is_POST = 'post' == strtolower( $_SERVER['REQUEST_METHOD'] );
|
445 |
|
446 |
if ( $page == 'polls' ) {
|
447 |
+
switch ( $action ) {
|
448 |
case 'signup' : // sign up for first time
|
449 |
case 'account' : // reauthenticate
|
450 |
case 'import-account' : // reauthenticate
|
452 |
return;
|
453 |
|
454 |
check_admin_referer( 'polldaddy-account' );
|
455 |
+
|
456 |
+
$this->user_code = '';
|
457 |
+
update_option( 'pd-usercode', '' );
|
458 |
|
459 |
if ( $new_args = $this->management_page_load_signup() )
|
460 |
$query_args = array_merge( $query_args, $new_args );
|
461 |
if ( $this->errors->get_error_codes() )
|
462 |
return false;
|
463 |
+
|
464 |
$query_args['message'] = 'imported-account';
|
465 |
+
|
466 |
wp_reset_vars( array( 'action' ) );
|
467 |
if ( !empty( $_GET['reaction'] ) )
|
468 |
$query_args['action'] = $_GET['reaction'];
|
471 |
else
|
472 |
$query_args['action'] = false;
|
473 |
break;
|
474 |
+
|
475 |
case 'delete' :
|
476 |
if ( empty( $poll ) )
|
477 |
return;
|
478 |
+
|
479 |
if ( is_array( $poll ) )
|
480 |
check_admin_referer( 'action-poll_bulk' );
|
481 |
else
|
482 |
check_admin_referer( "delete-poll_$poll" );
|
483 |
+
|
484 |
$polldaddy = $this->get_client( WP_POLLDADDY__PARTNERGUID, $this->user_code );
|
485 |
+
|
486 |
foreach ( (array) $_REQUEST['poll'] as $poll_id ) {
|
487 |
$polldaddy->reset();
|
488 |
$poll_object = $polldaddy->get_poll( $poll );
|
489 |
+
|
490 |
if ( !$this->can_edit( $poll_object ) ) {
|
491 |
$this->errors->add( 'permission', __( 'You are not allowed to delete this poll.', 'polldaddy' ) );
|
492 |
return false;
|
493 |
}
|
494 |
+
|
495 |
// Send Poll Author credentials
|
496 |
if ( !empty( $poll_object->_owner ) && $this->id != $poll_object->_owner ) {
|
497 |
$polldaddy->reset();
|
500 |
}
|
501 |
$polldaddy->userCode = $userCode;
|
502 |
}
|
503 |
+
|
504 |
$polldaddy->reset();
|
505 |
$polldaddy->delete_poll( $poll_id );
|
506 |
}
|
507 |
+
|
508 |
$query_args['message'] = 'deleted';
|
509 |
$query_args['deleted'] = count( (array) $poll );
|
510 |
break;
|
511 |
case 'open' :
|
512 |
if ( empty( $poll ) )
|
513 |
return;
|
514 |
+
|
515 |
if ( is_array( $poll ) )
|
516 |
check_admin_referer( 'action-poll_bulk' );
|
517 |
else
|
518 |
check_admin_referer( "open-poll_$poll" );
|
519 |
+
|
520 |
$polldaddy = $this->get_client( WP_POLLDADDY__PARTNERGUID, $this->user_code );
|
521 |
+
|
522 |
foreach ( (array) $_REQUEST['poll'] as $poll_id ) {
|
523 |
$polldaddy->reset();
|
524 |
$poll_object = $polldaddy->get_poll( $poll );
|
525 |
+
|
526 |
if ( !$this->can_edit( $poll_object ) ) {
|
527 |
$this->errors->add( 'permission', __( 'You are not allowed to open this poll.', 'polldaddy' ) );
|
528 |
return false;
|
529 |
}
|
530 |
+
|
531 |
// Send Poll Author credentials
|
532 |
if ( !empty( $poll_object->_owner ) && $this->id != $poll_object->_owner ) {
|
533 |
$polldaddy->reset();
|
536 |
}
|
537 |
$polldaddy->userCode = $userCode;
|
538 |
}
|
539 |
+
|
540 |
$polldaddy->reset();
|
541 |
$polldaddy->open_poll( $poll_id );
|
542 |
}
|
543 |
+
|
544 |
$query_args['message'] = 'opened';
|
545 |
$query_args['opened'] = count( (array) $poll );
|
546 |
break;
|
547 |
case 'close' :
|
548 |
if ( empty( $poll ) )
|
549 |
return;
|
550 |
+
|
551 |
if ( is_array( $poll ) )
|
552 |
check_admin_referer( 'action-poll_bulk' );
|
553 |
else
|
554 |
check_admin_referer( "close-poll_$poll" );
|
555 |
+
|
556 |
$polldaddy = $this->get_client( WP_POLLDADDY__PARTNERGUID, $this->user_code );
|
557 |
+
|
558 |
foreach ( (array) $_REQUEST['poll'] as $poll_id ) {
|
559 |
$polldaddy->reset();
|
560 |
$poll_object = $polldaddy->get_poll( $poll );
|
561 |
+
|
562 |
if ( !$this->can_edit( $poll_object ) ) {
|
563 |
$this->errors->add( 'permission', __( 'You are not allowed to close this poll.', 'polldaddy' ) );
|
564 |
return false;
|
565 |
}
|
566 |
+
|
567 |
// Send Poll Author credentials
|
568 |
if ( !empty( $poll_object->_owner ) && $this->id != $poll_object->_owner ) {
|
569 |
$polldaddy->reset();
|
572 |
}
|
573 |
$polldaddy->userCode = $userCode;
|
574 |
}
|
575 |
+
|
576 |
$polldaddy->reset();
|
577 |
$polldaddy->close_poll( $poll_id );
|
578 |
}
|
579 |
+
|
580 |
$query_args['message'] = 'closed';
|
581 |
$query_args['closed'] = count( (array) $poll );
|
582 |
break;
|
583 |
case 'edit-poll' : // TODO: use polldaddy_poll
|
584 |
if ( !$is_POST || !$poll = (int) $poll )
|
585 |
return;
|
586 |
+
|
587 |
check_admin_referer( "edit-poll_$poll" );
|
588 |
+
|
589 |
$polldaddy = $this->get_client( WP_POLLDADDY__PARTNERGUID, $this->user_code );
|
590 |
$polldaddy->reset();
|
591 |
+
|
592 |
$poll_object = $polldaddy->get_poll( $poll );
|
593 |
$this->parse_errors( $polldaddy );
|
594 |
+
|
595 |
if ( !$this->can_edit( $poll_object ) ) {
|
596 |
$this->errors->add( 'permission', __( 'You are not allowed to edit this poll.', 'polldaddy' ) );
|
597 |
return false;
|
598 |
}
|
599 |
+
|
600 |
// Send Poll Author credentials
|
|
|
601 |
if ( !empty( $poll_object->_owner ) && $this->id != $poll_object->_owner ) {
|
602 |
$polldaddy->reset();
|
603 |
if ( !$userCode = $polldaddy->get_usercode( $poll_object->_owner ) ) {
|
606 |
$this->parse_errors( $polldaddy );
|
607 |
$polldaddy->userCode = $userCode;
|
608 |
}
|
609 |
+
|
610 |
if ( !$poll_object )
|
611 |
$this->errors->add( 'GetPoll', __( 'Poll not found', 'polldaddy' ) );
|
612 |
+
|
613 |
if ( $this->errors->get_error_codes() )
|
614 |
return false;
|
615 |
+
|
616 |
+
$media = $mediaType = array();
|
617 |
+
if ( isset( $_POST['media'] ) ) {
|
618 |
+
$media = $_POST['media'];
|
619 |
+
unset( $_POST['media'] );
|
620 |
+
}
|
621 |
+
|
622 |
+
if ( isset( $_POST['mediaType'] ) ) {
|
623 |
+
$mediaType = $_POST['mediaType'];
|
624 |
+
unset( $_POST['mediaType'] );
|
625 |
+
}
|
626 |
+
|
627 |
$poll_data = get_object_vars( $poll_object );
|
628 |
foreach ( $poll_data as $key => $value )
|
629 |
if ( '_' === $key[0] )
|
630 |
unset( $poll_data[$key] );
|
631 |
+
|
632 |
foreach ( array( 'multipleChoice', 'randomiseAnswers', 'otherAnswer', 'sharing' ) as $option ) {
|
633 |
if ( isset( $_POST[$option] ) && $_POST[$option] )
|
634 |
$poll_data[$option] = 'yes';
|
635 |
else
|
636 |
$poll_data[$option] = 'no';
|
637 |
}
|
638 |
+
|
639 |
$blocks = array( 'off', 'cookie', 'cookieip' );
|
640 |
if ( isset( $_POST['blockRepeatVotersType'] ) && in_array( $_POST['blockRepeatVotersType'], $blocks ) )
|
641 |
$poll_data['blockRepeatVotersType'] = $_POST['blockRepeatVotersType'];
|
642 |
+
|
643 |
$results = array( 'show', 'percent', 'hide' );
|
644 |
if ( isset( $_POST['resultsType'] ) && in_array( $_POST['resultsType'], $results ) )
|
645 |
$poll_data['resultsType'] = $_POST['resultsType'];
|
646 |
$poll_data['question'] = stripslashes( $_POST['question'] );
|
647 |
+
|
648 |
+
$comments = array( 'off', 'allow', 'moderate' );
|
649 |
+
if ( isset( $_POST['comments'] ) && in_array( $_POST['comments'], $comments ) )
|
650 |
+
$poll_data['comments'] = $_POST['comments'];
|
651 |
+
|
652 |
if ( empty( $_POST['answer'] ) || !is_array( $_POST['answer'] ) )
|
653 |
$this->errors->add( 'answer', __( 'Invalid answers', 'polldaddy' ) );
|
654 |
+
|
655 |
$answers = array();
|
656 |
foreach ( $_POST['answer'] as $answer_id => $answer ) {
|
657 |
$answer = stripslashes( trim( $answer ) );
|
658 |
+
|
659 |
if ( strlen( $answer ) > 0 ) {
|
660 |
$answer = wp_kses( $answer, $allowedtags );
|
661 |
+
|
662 |
$args['text'] = (string) $answer;
|
663 |
+
|
664 |
+
$answer_id = str_replace('new', '', $answer_id );
|
665 |
+
$mc = '';
|
666 |
+
$mt = 0;
|
667 |
+
|
668 |
+
if ( isset( $media[$answer_id] ) )
|
669 |
+
$mc = esc_html( $media[$answer_id] );
|
670 |
+
|
671 |
+
if ( isset( $mediaType[$answer_id] ) )
|
672 |
+
$mt = intval( $mediaType[$answer_id] );
|
673 |
+
|
674 |
+
$args['mediaType'] = $mt;
|
675 |
+
$args['mediaCode'] = $mc;
|
676 |
+
|
677 |
+
if ( $answer_id > 1000 )
|
678 |
+
$answer = polldaddy_poll_answer( $args, $answer_id );
|
679 |
else
|
680 |
+
$answer = polldaddy_poll_answer( $args );
|
681 |
+
|
682 |
+
if ( isset( $answer ) && is_a( $answer, 'PollDaddy_Poll_Answer' ) )
|
683 |
+
$answers[] = $answer;
|
684 |
}
|
685 |
}
|
686 |
+
|
687 |
if ( 2 > count( $answers ) )
|
688 |
$this->errors->add( 'answer', __( 'You must include at least 2 answers', 'polldaddy' ) );
|
689 |
+
|
690 |
if ( $this->errors->get_error_codes() )
|
691 |
return false;
|
692 |
+
|
693 |
$poll_data['answers'] = $answers;
|
694 |
+
|
695 |
$poll_data['question'] = wp_kses( $poll_data['question'], $allowedtags );
|
696 |
+
|
697 |
if ( isset ( $_POST['styleID'] ) ) {
|
698 |
if ( $_POST['styleID'] == 'x' ) {
|
699 |
$this->errors->add( 'UpdatePoll', __( 'Please choose a poll style', 'polldaddy' ) );
|
702 |
}
|
703 |
$poll_data['styleID'] = (int) $_POST['styleID'];
|
704 |
$poll_data['choices'] = (int) $_POST['choices'];
|
705 |
+
|
706 |
if ( $poll_data['blockRepeatVotersType'] == 'cookie' ) {
|
707 |
if ( isset( $_POST['cookieip_expiration'] ) )
|
708 |
$poll_data['blockExpiration'] = (int) $_POST['cookieip_expiration'];
|
710 |
if ( isset( $_POST['cookieip_expiration'] ) )
|
711 |
$poll_data['blockExpiration'] = (int) $_POST['cookieip_expiration'];
|
712 |
}
|
713 |
+
|
714 |
+
if ( isset( $media[999999999] ) )
|
715 |
+
$poll_data['mediaCode'] = esc_html( $media[999999999] );
|
716 |
+
|
717 |
+
if ( isset( $mediaType[999999999] ) )
|
718 |
+
$poll_data['mediaType'] = intval( $mediaType[999999999] );
|
719 |
+
|
720 |
$polldaddy->reset();
|
721 |
+
|
722 |
$update_response = $polldaddy->update_poll( $poll, $poll_data );
|
723 |
+
|
724 |
$this->parse_errors( $polldaddy );
|
725 |
+
|
726 |
if ( !$update_response )
|
727 |
$this->errors->add( 'UpdatePoll', __( 'Poll could not be updated', 'polldaddy' ) );
|
728 |
+
|
729 |
if ( $this->errors->get_error_codes() )
|
730 |
return false;
|
731 |
+
|
732 |
$query_args['message'] = 'updated';
|
733 |
if ( isset( $_POST['iframe'] ) )
|
734 |
$query_args['iframe'] = '';
|
736 |
case 'create-poll' :
|
737 |
if ( !$is_POST )
|
738 |
return;
|
739 |
+
|
740 |
check_admin_referer( 'create-poll' );
|
741 |
+
|
742 |
$polldaddy = $this->get_client( WP_POLLDADDY__PARTNERGUID, $this->user_code );
|
743 |
$polldaddy->reset();
|
744 |
+
|
745 |
+
$media = $mediaType = array();
|
746 |
+
if ( isset( $_POST['media'] ) ) {
|
747 |
+
$media = $_POST['media'];
|
748 |
+
unset( $_POST['media'] );
|
749 |
+
}
|
750 |
+
|
751 |
+
if ( isset( $_POST['mediaType'] ) ) {
|
752 |
+
$mediaType = $_POST['mediaType'];
|
753 |
+
unset( $_POST['mediaType'] );
|
754 |
+
}
|
755 |
+
|
756 |
$answers = array();
|
757 |
foreach ( $_POST['answer'] as $answer ) {
|
758 |
$answer = stripslashes( trim( $answer ) );
|
759 |
+
|
760 |
if ( strlen( $answer ) > 0 ) {
|
761 |
$answer = wp_kses( $answer, $allowedtags );
|
762 |
+
|
763 |
$args['text'] = (string) $answer;
|
764 |
+
|
765 |
+
$answer_id = (int) str_replace('new', '', $answer );
|
766 |
+
$mc = '';
|
767 |
+
$mt = 0;
|
768 |
+
|
769 |
+
if ( isset( $media[$answer_id] ) )
|
770 |
+
$mc = esc_html( $media[$answer_id] );
|
771 |
+
|
772 |
+
if ( isset( $mediaType[$answer_id] ) )
|
773 |
+
$mt = intval( $mediaType[$answer_id] );
|
774 |
+
|
775 |
+
$args['mediaType'] = $mt;
|
776 |
+
$args['mediaCode'] = $mc;
|
777 |
+
|
778 |
+
$answer = polldaddy_poll_answer( $args );
|
779 |
+
|
780 |
+
if ( isset( $answer ) && is_a( $answer, 'PollDaddy_Poll_Answer' ) )
|
781 |
+
$answers[] = $answer;
|
782 |
}
|
783 |
}
|
784 |
+
|
785 |
if ( !$answers )
|
786 |
return false;
|
787 |
+
|
788 |
$poll_data = _polldaddy_poll_defaults();
|
789 |
+
|
790 |
foreach ( array( 'multipleChoice', 'randomiseAnswers', 'otherAnswer', 'sharing' ) as $option ) {
|
791 |
if ( isset( $_POST[$option] ) && $_POST[$option] )
|
792 |
$poll_data[$option] = 'yes';
|
793 |
else
|
794 |
$poll_data[$option] = 'no';
|
795 |
}
|
796 |
+
|
797 |
$blocks = array( 'off', 'cookie', 'cookieip' );
|
798 |
if ( isset( $_POST['blockRepeatVotersType'] ) && in_array( $_POST['blockRepeatVotersType'], $blocks ) )
|
799 |
$poll_data['blockRepeatVotersType'] = $_POST['blockRepeatVotersType'];
|
800 |
+
|
801 |
$results = array( 'show', 'percent', 'hide' );
|
802 |
if ( isset( $_POST['resultsType'] ) && in_array( $_POST['resultsType'], $results ) )
|
803 |
$poll_data['resultsType'] = $_POST['resultsType'];
|
804 |
+
|
805 |
+
$comments = array( 'off', 'allow', 'moderate' );
|
806 |
+
if ( isset( $_POST['comments'] ) && in_array( $_POST['comments'], $comments ) )
|
807 |
+
$poll_data['comments'] = $_POST['comments'];
|
808 |
+
|
809 |
$poll_data['answers'] = $answers;
|
810 |
+
|
811 |
$poll_data['question'] = stripslashes( $_POST['question'] );
|
812 |
$poll_data['question'] = wp_kses( $poll_data['question'], $allowedtags );
|
813 |
+
|
814 |
if ( isset ( $_POST['styleID'] ) ) {
|
815 |
if ( $_POST['styleID'] == 'x' ) {
|
816 |
$this->errors->add( 'UpdatePoll', __( 'Please choose a poll style', 'polldaddy' ) );
|
819 |
}
|
820 |
$poll_data['styleID'] = (int) $_POST['styleID'];
|
821 |
$poll_data['choices'] = (int) $_POST['choices'];
|
822 |
+
|
823 |
if ( $poll_data['blockRepeatVotersType'] == 'cookie' ) {
|
824 |
if ( isset( $_POST['cookieip_expiration'] ) )
|
825 |
$poll_data['blockExpiration'] = (int) $_POST['cookieip_expiration'];
|
827 |
if ( isset( $_POST['cookieip_expiration'] ) )
|
828 |
$poll_data['blockExpiration'] = (int) $_POST['cookieip_expiration'];
|
829 |
}
|
830 |
+
|
831 |
+
if ( isset( $media[999999999] ) )
|
832 |
+
$poll_data['mediaCode'] = esc_html( $media[999999999] );
|
833 |
+
|
834 |
+
if ( isset( $mediaType[999999999] ) )
|
835 |
+
$poll_data['mediaType'] = intval( $mediaType[999999999] );
|
836 |
+
|
837 |
$poll = $polldaddy->create_poll( $poll_data );
|
838 |
$this->parse_errors( $polldaddy );
|
839 |
+
|
840 |
if ( !$poll || empty( $poll->_id ) )
|
841 |
$this->errors->add( 'CreatePoll', __( 'Poll could not be created', 'polldaddy' ) );
|
842 |
+
|
843 |
if ( $this->errors->get_error_codes() )
|
844 |
return false;
|
845 |
+
|
846 |
$query_args['message'] = 'created';
|
847 |
$query_args['action'] = 'edit-poll';
|
848 |
$query_args['poll'] = $poll->_id;
|
852 |
case 'delete-style' :
|
853 |
if ( empty( $style ) )
|
854 |
return;
|
855 |
+
|
856 |
if ( is_array( $style ) )
|
857 |
check_admin_referer( 'action-style_bulk' );
|
858 |
else
|
859 |
check_admin_referer( "delete-style_$style" );
|
860 |
+
|
861 |
$polldaddy = $this->get_client( WP_POLLDADDY__PARTNERGUID, $this->user_code );
|
862 |
+
|
863 |
foreach ( (array) $_REQUEST['style'] as $style_id ) {
|
864 |
$polldaddy->reset();
|
865 |
$polldaddy->delete_style( $style_id );
|
866 |
}
|
867 |
+
|
868 |
$query_args['message'] = 'deleted-style';
|
869 |
$query_args['deleted'] = count( (array) $style );
|
870 |
break;
|
871 |
case 'edit-style' :
|
872 |
if ( !$is_POST || !$style = (int) $style )
|
873 |
return;
|
874 |
+
|
875 |
check_admin_referer( "edit-style$style" );
|
876 |
+
|
877 |
$polldaddy = $this->get_client( WP_POLLDADDY__PARTNERGUID, $this->user_code );
|
878 |
$polldaddy->reset();
|
879 |
+
|
880 |
$style_data = _polldaddy_style_defaults();
|
881 |
+
|
882 |
if ( isset( $_POST['style-title'] ) )
|
883 |
$style_data['title'] = stripslashes( trim( (string) $_POST['style-title'] ) );
|
884 |
+
|
885 |
if ( isset( $_POST['CSSXML'] ) )
|
886 |
$style_data['css'] = urlencode( stripslashes( trim( (string) $_POST['CSSXML'] ) ) );
|
887 |
+
|
888 |
if ( isset( $_REQUEST['updatePollCheck'] ) && $_REQUEST['updatePollCheck'] == 'on' )
|
889 |
$style_data['retro'] = 1;
|
890 |
+
|
891 |
$update_response = $polldaddy->update_style( $style, $style_data );
|
892 |
+
|
893 |
$this->parse_errors( $polldaddy );
|
894 |
+
|
895 |
if ( !$update_response )
|
896 |
$this->errors->add( 'UpdateStyle', __( 'Style could not be updated', 'polldaddy' ) );
|
897 |
+
|
898 |
if ( $this->errors->get_error_codes() )
|
899 |
return false;
|
900 |
+
|
901 |
$query_args['message'] = 'updated-style';
|
902 |
if ( isset( $_POST['iframe'] ) )
|
903 |
$query_args['iframe'] = '';
|
905 |
case 'create-style' :
|
906 |
if ( !$is_POST )
|
907 |
return;
|
908 |
+
|
909 |
check_admin_referer( 'create-style' );
|
910 |
+
|
911 |
$polldaddy = $this->get_client( WP_POLLDADDY__PARTNERGUID, $this->user_code );
|
912 |
$polldaddy->reset();
|
913 |
+
|
914 |
$style_data = _polldaddy_style_defaults();
|
915 |
+
|
916 |
if ( isset( $_POST['style-title'] ) )
|
917 |
$style_data['title'] = stripslashes( strip_tags( trim( (string) $_POST['style-title'] ) ) );
|
918 |
+
|
919 |
if ( isset( $_POST['CSSXML'] ) )
|
920 |
$style_data['css'] = urlencode( stripslashes( trim( (string) $_POST['CSSXML'] ) ) );
|
921 |
+
|
922 |
$style = $polldaddy->create_style( $style_data );
|
923 |
$this->parse_errors( $polldaddy );
|
924 |
+
|
925 |
if ( !$style || empty( $style->_id ) )
|
926 |
$this->errors->add( 'CreateStyle', __( 'Style could not be created', 'polldaddy' ) );
|
927 |
+
|
928 |
if ( $this->errors->get_error_codes() )
|
929 |
return false;
|
930 |
+
|
931 |
$query_args['message'] = 'created-style';
|
932 |
$query_args['action'] = 'edit-style';
|
933 |
$query_args['style'] = $style->_id;
|
937 |
case 'update-options' :
|
938 |
if ( !$is_POST )
|
939 |
return;
|
940 |
+
|
941 |
check_admin_referer( 'polldaddy-account' );
|
942 |
+
|
943 |
$polldaddy = $this->get_client( WP_POLLDADDY__PARTNERGUID, $this->user_code );
|
944 |
$polldaddy->reset();
|
945 |
+
|
946 |
$poll_defaults = _polldaddy_poll_defaults();
|
947 |
+
|
948 |
$user_defaults = array();
|
949 |
+
|
950 |
foreach ( array( "multipleChoice", "randomiseAnswers", "otherAnswer", "sharing", "resultsType", "styleID", "blockRepeatVotersType", "blockExpiration" ) as $option ) {
|
951 |
if ( isset( $poll_defaults[$option] ) && $poll_defaults[$option] )
|
952 |
$user_defaults[$option] = $poll_defaults[$option];
|
953 |
}
|
954 |
+
|
955 |
foreach ( array( 'multipleChoice', 'randomiseAnswers', 'otherAnswer', 'sharing' ) as $option ) {
|
956 |
if ( isset( $_POST[$option] ) && $_POST[$option] )
|
957 |
$user_defaults[$option] = 'yes';
|
958 |
else
|
959 |
$user_defaults[$option] = 'no';
|
960 |
}
|
961 |
+
|
962 |
$results = array( 'show', 'percent', 'hide' );
|
963 |
if ( isset( $_POST['resultsType'] ) && in_array( $_POST['resultsType'], $results ) )
|
964 |
$user_defaults['resultsType'] = $_POST['resultsType'];
|
965 |
+
|
966 |
if ( isset ( $_POST['styleID'] ) ) {
|
967 |
$user_defaults['styleID'] = (int) $_POST['styleID'];
|
968 |
}
|
969 |
+
|
970 |
$blocks = array( 'off', 'cookie', 'cookieip' );
|
971 |
if ( isset( $_POST['blockRepeatVotersType'] ) && in_array( $_POST['blockRepeatVotersType'], $blocks ) )
|
972 |
$user_defaults['blockRepeatVotersType'] = $_POST['blockRepeatVotersType'];
|
973 |
+
|
974 |
if ( isset( $_POST['blockExpiration'] ) )
|
975 |
$user_defaults['blockExpiration'] = (int) $_POST['blockExpiration'];
|
976 |
+
|
977 |
$polldaddy->update_poll_defaults( 0, $user_defaults );
|
978 |
+
|
979 |
$this->parse_errors( $polldaddy );
|
980 |
if ( $this->errors->get_error_codes() )
|
981 |
return false;
|
982 |
+
|
983 |
$query_args['message'] = 'updated-options';
|
984 |
break;
|
985 |
default :
|
986 |
return;
|
987 |
+
}//end switch
|
988 |
} elseif ( $page == 'ratings' ) {
|
989 |
|
990 |
+
switch ( $action ) {
|
991 |
case 'delete' :
|
992 |
if ( empty( $id ) )
|
993 |
return;
|
998 |
|
999 |
if ( is_array( $rating ) ) {
|
1000 |
check_admin_referer( 'action-rating_bulk' );
|
1001 |
+
|
1002 |
foreach ( $rating as $key => $value ) {
|
1003 |
$polldaddy->reset();
|
1004 |
$polldaddy->delete_rating_result( $id, $value );
|
1005 |
}
|
1006 |
} else {
|
1007 |
check_admin_referer( "delete-rating_$rating" );
|
1008 |
+
|
1009 |
$polldaddy->delete_rating_result( $id, $rating );
|
1010 |
}
|
1011 |
+
|
1012 |
if ( isset( $_REQUEST['filter'] ) )
|
1013 |
$query_args['filter'] = $_REQUEST['filter'];
|
1014 |
if ( isset( $_REQUEST['change-report-to'] ) )
|
1018 |
break;
|
1019 |
default :
|
1020 |
return;
|
1021 |
+
}//end switch
|
1022 |
}
|
1023 |
|
1024 |
wp_redirect( add_query_arg( $query_args, wp_get_referer() ) );
|
1026 |
}
|
1027 |
|
1028 |
function management_page_load_signup() {
|
1029 |
+
|
1030 |
+
switch ( $_POST['account'] ) {
|
1031 |
case 'import' :
|
1032 |
return $this->import_account();
|
1033 |
break;
|
1034 |
default :
|
1035 |
return;
|
1036 |
+
}//end switch
|
1037 |
}
|
1038 |
|
1039 |
function import_account() {
|
1040 |
+
|
1041 |
+
|
1042 |
$polldaddy = $this->get_client( WP_POLLDADDY__PARTNERGUID );
|
1043 |
$polldaddy->reset();
|
1044 |
$email = trim( stripslashes( $_POST['polldaddy_email'] ) );
|
1071 |
}
|
1072 |
|
1073 |
function management_page_notices( $message = false ) {
|
1074 |
+
|
1075 |
+
switch ( (string) @$_GET['message'] ) {
|
1076 |
case 'deleted' :
|
1077 |
$deleted = (int) $_GET['deleted'];
|
1078 |
if ( 1 == $deleted )
|
1100 |
case 'created' :
|
1101 |
$message = __( 'Poll created.', 'polldaddy' );
|
1102 |
if ( isset( $_GET['iframe'] ) )
|
1103 |
+
$message .= ' <input type="button" class="button polldaddy-send-to-editor" value="' . esc_attr( __( 'Embed in Post', 'polldaddy' ) ) . '" />';
|
1104 |
break;
|
1105 |
case 'updated-style' :
|
1106 |
$message = __( 'Custom Style updated.', 'polldaddy' );
|
1128 |
else
|
1129 |
$message = sprintf( __ngettext( '%s Rating Deleted.', '%s Ratings Deleted.', $deleted ), number_format_i18n( $deleted ) );
|
1130 |
break;
|
1131 |
+
}//end switch
|
1132 |
|
1133 |
$is_POST = 'post' == strtolower( $_SERVER['REQUEST_METHOD'] );
|
1134 |
|
1135 |
if ( $is_POST ) {
|
1136 |
+
switch ( $GLOBALS['action'] ) {
|
1137 |
case 'create-poll' :
|
1138 |
$message = __( 'Error: An error has occurred; Poll not created.', 'polldaddy' );
|
1139 |
break;
|
1146 |
else
|
1147 |
$message = __( 'Error: An error has occurred; Account could not be created.', 'polldaddy' );
|
1148 |
break;
|
1149 |
+
}//end switch
|
1150 |
}
|
1151 |
|
1152 |
if ( !$message )
|
1158 |
}
|
1159 |
|
1160 |
function management_page() {
|
1161 |
+
|
1162 |
global $page, $action, $poll, $style, $rating;
|
1163 |
$poll = (int) $poll;
|
1164 |
$style = (int) $style;
|
1165 |
+
$rating = esc_html( $rating );
|
1166 |
?>
|
1167 |
|
1168 |
<div class="wrap" id="manage-polls">
|
1172 |
if ( !$this->is_author && in_array( $action, array( 'edit', 'edit-poll', 'create-poll', 'edit-style', 'create-style', 'list-styles', 'options', 'update-options', 'import-account' ) ) ) {//check user privileges has access to action
|
1173 |
$action = '';
|
1174 |
}
|
1175 |
+
switch ( $action ) {
|
1176 |
case 'signup' :
|
1177 |
case 'account' :
|
1178 |
$this->signup();
|
1179 |
break;
|
1180 |
case 'preview' :
|
1181 |
+
if ( isset( $_GET['iframe'] ) ):
|
1182 |
+
if ( !isset( $_GET['popup'] ) ) { ?>
|
1183 |
+
<h2 id="poll-list-header"><?php _e( 'Polldaddy Polls', 'polldaddy' ); ?></h2>
|
1184 |
+
<?php
|
1185 |
+
} else { ?>
|
1186 |
+
<h2 id="poll-list-header"><?php printf( __( '<a href="%s">Polldaddy Polls</a>', 'polldaddy' ), esc_url( add_query_arg( array( 'action' => 'polls', 'poll' => false, 'message' => false ) ) ) ); ?></h2>
|
|
|
|
|
|
|
|
|
1187 |
<?php
|
1188 |
+
}
|
1189 |
+
endif;
|
1190 |
+
|
1191 |
echo do_shortcode( "[polldaddy poll=$poll cb=1]" );
|
1192 |
break;
|
1193 |
case 'results' :
|
1194 |
?>
|
1195 |
|
1196 |
+
<h2 id="polldaddy-header"><?php
|
1197 |
if ( $this->is_author )
|
1198 |
+
_e( 'Poll Results', 'polldaddy');
|
1199 |
else
|
1200 |
+
_e( 'Poll Results', 'polldaddy'); ?></h2>
|
1201 |
|
1202 |
<?php
|
1203 |
$this->poll_results_page( $poll );
|
1206 |
case 'edit-poll' :
|
1207 |
?>
|
1208 |
|
1209 |
+
<h2 id="poll-list-header"><?php _e( 'Edit Poll', 'polldaddy' ); ?></h2>
|
1210 |
|
1211 |
<?php
|
1212 |
|
1215 |
case 'create-poll' :
|
1216 |
?>
|
1217 |
|
1218 |
+
<h2 id="poll-list-header"><?php _e( 'Add New Poll', 'polldaddy') ?></h2>
|
1219 |
|
1220 |
<?php
|
1221 |
$this->poll_edit_form();
|
1223 |
case 'list-styles' :
|
1224 |
?>
|
1225 |
|
1226 |
+
<h2 id="polldaddy-header"><?php
|
1227 |
if ( $this->is_author )
|
1228 |
+
printf( __( 'Custom Styles <a href="%s" class="button add-new-h2">Add New</a>', 'polldaddy' ), esc_url( add_query_arg( array( 'action' => 'create-style', 'poll' => false, 'message' => false ) ) ) );
|
1229 |
else
|
1230 |
_e( 'Custom Styles', 'polldaddy' ); ?></h2>
|
1231 |
|
1235 |
case 'edit-style' :
|
1236 |
?>
|
1237 |
|
1238 |
+
<h2 id="polldaddy-header"><?php printf( __( 'Edit Style <a href="%s" class="button add-new-h2">List Styles</a>', 'polldaddy' ), esc_url( add_query_arg( array( 'action' => 'list-styles', 'style' => false, 'message' => false, 'preload' => false ) ) ) ); ?></h2>
|
1239 |
|
1240 |
<?php
|
1241 |
|
1244 |
case 'create-style' :
|
1245 |
?>
|
1246 |
|
1247 |
+
<h2 id="polldaddy-header"><?php printf( __( 'Create Style <a href="%s" class="button add-new-h2">List Styles</a>', 'polldaddy' ), esc_url( add_query_arg( array( 'action' => 'list-styles', 'style' => false, 'message' => false, 'preload' => false ) ) ) ); ?></h2>
|
1248 |
|
1249 |
<?php
|
1250 |
$this->style_edit_form();
|
1260 |
|
1261 |
<h2 id="poll-list-header"><?php
|
1262 |
if ( $this->is_author )
|
1263 |
+
printf( __( 'Polldaddy Polls <a href="%s" class="button add-new-h2">Add New</a>', 'polldaddy' ), esc_url( add_query_arg( array( 'action' => 'create-poll', 'poll' => false, 'message' => false ) ) ) );
|
1264 |
else
|
1265 |
+
_e( 'Polldaddy Polls ', 'polldaddy' ); ?></h2>
|
1266 |
|
1267 |
+
<?php
|
1268 |
+
|
1269 |
+
if ( !isset( $_GET['view'] ) )
|
1270 |
+
$this->polls_table( 'user' );
|
1271 |
+
else
|
1272 |
+
$this->polls_table( 'blog' );
|
1273 |
+
|
1274 |
+
}//end switch
|
1275 |
} elseif ( $page == 'ratings' ) {
|
1276 |
if ( !$this->is_admin && !in_array( $action, array( 'delete', 'reports' ) ) ) {//check user privileges has access to action
|
1277 |
$action = 'reports';
|
1278 |
}
|
1279 |
|
1280 |
+
switch ( $action ) {
|
1281 |
case 'delete' :
|
1282 |
case 'reports' :
|
1283 |
$this->rating_reports();
|
1288 |
break;
|
1289 |
default :
|
1290 |
$this->rating_settings();
|
1291 |
+
}//end switch
|
1292 |
}
|
1293 |
?>
|
1294 |
|
1298 |
|
1299 |
}
|
1300 |
|
1301 |
+
function polls_table( $view = 'user' ) {
|
1302 |
$page = 1;
|
1303 |
if ( isset( $_GET['paged'] ) )
|
1304 |
$page = absint( $_GET['paged'] );
|
1305 |
$polldaddy = $this->get_client( WP_POLLDADDY__PARTNERGUID, $this->user_code );
|
1306 |
$polldaddy->reset();
|
1307 |
|
|
|
|
|
|
|
1308 |
if ( 'user' == $view )
|
1309 |
$polls_object = $polldaddy->get_polls( ( $page - 1 ) * 10 + 1, $page * 10 );
|
1310 |
else
|
1311 |
$polls_object = $polldaddy->get_polls_by_parent_id( ( $page - 1 ) * 10 + 1, $page * 10 );
|
1312 |
+
|
1313 |
$this->parse_errors( $polldaddy );
|
1314 |
$this->print_errors();
|
1315 |
$polls = & $polls_object->poll;
|
1326 |
'current' => $page
|
1327 |
) );
|
1328 |
|
1329 |
+
|
1330 |
+
?>
|
|
|
|
|
|
|
|
|
1331 |
<form method="post" action="">
|
|
|
1332 |
<div class="tablenav">
|
1333 |
+
|
1334 |
+
<?php if ( $this->is_author ) { ?>
|
1335 |
+
<div class="alignleft actions">
|
1336 |
<select name="action">
|
1337 |
<option selected="selected" value=""><?php _e( 'Actions', 'polldaddy' ); ?></option>
|
1338 |
<option value="delete"><?php _e( 'Delete', 'polldaddy' ); ?></option>
|
1339 |
<option value="close"><?php _e( 'Close', 'polldaddy' ); ?></option>
|
1340 |
<option value="open"><?php _e( 'Open', 'polldaddy' ); ?></option>
|
1341 |
</select>
|
1342 |
+
|
1343 |
<input class="button-secondary action" type="submit" name="doaction" value="<?php _e( 'Apply', 'polldaddy' ); ?>" />
|
1344 |
<?php wp_nonce_field( 'action-poll_bulk' ); ?>
|
1345 |
</div>
|
1346 |
+
<div class="alignleft actions">
|
1347 |
+
<select name="filter" id="filter-options" style="margin-left:15px;">
|
1348 |
+
<option <?php if (!isset( $_GET['view'] ) ): ?> selected="selected" <?php endif; ?> value=""><?php _e( 'View All Polls', 'polldaddy' ); ?></option>
|
1349 |
+
<option <?php if ( $_GET['view'] == 'blog' ): ?> selected="selected" <?php endif; ?> value="blog"><?php _e( 'This Blog\'s Polls', 'polldaddy' ); ?></option>
|
1350 |
+
</select>
|
1351 |
+
<input class="button-secondary action" type="button" id="filter-polls" name="dofilter" value="<?php _e( 'Filter', 'polldaddy' ); ?>" />
|
1352 |
+
|
1353 |
+
|
1354 |
+
</div>
|
1355 |
+
|
1356 |
+
|
1357 |
<div class="tablenav-pages"><?php echo $page_links; ?></div>
|
1358 |
</div>
|
1359 |
+
|
1360 |
<?php } ?>
|
1361 |
<table class="widefat">
|
1362 |
<thead>
|
1363 |
<tr>
|
1364 |
+
<th id="cb" class="manage-column column-cb check-column" scope="col"><?php if ( $this->is_author ) { ?><input type="checkbox" /><?php } ?></th>
|
1365 |
<th id="title" class="manage-column column-title" scope="col"><?php _e( 'Poll', 'polldaddy' ); ?></th>
|
1366 |
+
<th id="votes" class="manage-column column-vote num" scope="col"> </th>
|
|
|
1367 |
</tr>
|
1368 |
</thead>
|
1369 |
<tbody>
|
1381 |
$poll_closed = (int) $poll->_closed;
|
1382 |
|
1383 |
if ( $this->is_author and $this->can_edit( $poll ) ) {
|
1384 |
+
$edit_link = esc_url( add_query_arg( array( 'action' => 'edit', 'poll' => $poll_id, 'message' => false ) ) );
|
1385 |
+
$delete_link = esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'delete', 'poll' => $poll_id, 'message' => false ) ), "delete-poll_$poll_id" ) );
|
1386 |
+
$open_link = esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'open', 'poll' => $poll_id, 'message' => false ) ), "open-poll_$poll_id" ) );
|
1387 |
+
$close_link = esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'close', 'poll' => $poll_id, 'message' => false ) ), "close-poll_$poll_id" ) );
|
1388 |
}
|
1389 |
else {
|
1390 |
$edit_link = false;
|
1394 |
}
|
1395 |
|
1396 |
$class = $class ? '' : ' class="alternate"';
|
1397 |
+
$results_link = esc_url( add_query_arg( array( 'action' => 'results', 'poll' => $poll_id, 'message' => false ) ) );
|
1398 |
+
$preview = array( 'action' => 'preview', 'poll' => $poll_id, 'message' => false );
|
1399 |
+
|
1400 |
+
if ( isset( $_GET['iframe'] ) ) {
|
1401 |
+
$preview[ 'popup' ] = 1;
|
1402 |
+
}
|
1403 |
+
|
1404 |
+
$preview_link = esc_url( add_query_arg( $preview ) );
|
1405 |
+
|
1406 |
list( $poll_time ) = explode( '.', $poll->_created );
|
1407 |
$poll_time = strtotime( $poll_time );
|
1408 |
?>
|
1409 |
<tr<?php echo $class; ?>>
|
1410 |
<th class="check-column" scope="row"><?php if ( $this->is_author and $this->can_edit( $poll ) ) { ?><input type="checkbox" value="<?php echo (int) $poll_id; ?>" name="poll[]" /><?php } ?></th>
|
1411 |
+
<td class="post-title column-title" style="padding-top:7px;">
|
1412 |
<?php if ( $edit_link ) { ?>
|
1413 |
+
<a class="row-title" style="display:block;" href="<?php echo $edit_link; ?>"><?php echo esc_html( $poll->___content ); ?></a>
|
1414 |
+
|
1415 |
+
<abbr title="<?php echo date( __( 'Y/m/d g:i:s A', 'polldaddy' ), $poll_time ); ?>"> <?php _e( 'created', 'polldaddy' ); ?> <?php echo date( __( 'M d, Y', 'polldaddy' ), $poll_time ); ?></abbr>
|
1416 |
+
|
1417 |
<div class="row-actions">
|
1418 |
<span class="edit"><a href="<?php echo $edit_link; ?>"><?php _e( 'Edit', 'polldaddy' ); ?></a> | </span>
|
1419 |
<?php } else { ?>
|
1420 |
+
<strong><?php echo esc_html( $poll->___content ); ?></strong>
|
1421 |
<div class="row-actions">
|
1422 |
+
|
1423 |
<?php } ?>
|
1424 |
+
|
1425 |
+
<?php if ( !isset( $_GET['iframe'] ) ):?>
|
1426 |
+
<span class="shortcode"><a href="javascript:void(0);" class="polldaddy-show-shortcode"><?php _e( 'Embed & Link', 'polldaddy' ); ?></a></span> | </span>
|
1427 |
+
<?php else: ?>
|
1428 |
+
<input type="hidden" class="polldaddy-poll-id" value="<?php echo $poll_id; ?>" />
|
1429 |
+
<span><a href="javascript:void(0);" class="polldaddy-send-to-editor"><?php _e( 'Embed in Post', 'polldaddy' ); ?></a></span> | </span>
|
1430 |
+
<?php endif; ?>
|
1431 |
+
|
1432 |
+
|
1433 |
+
<?php
|
1434 |
if ( $poll_closed == 2 ) {
|
1435 |
if ( $open_link ) { ?>
|
1436 |
<span class="open"><a class="open-poll" href="<?php echo $open_link; ?>"><?php _e( 'Open', 'polldaddy' ); ?></a> | </span>
|
1437 |
<?php } } else {
|
1438 |
if ( $close_link ) { ?>
|
1439 |
<span class="close"><a class="close-poll" href="<?php echo $close_link; ?>"><?php _e( 'Close', 'polldaddy' ); ?></a> | </span>
|
1440 |
+
<?php } }
|
1441 |
+
if ( !isset( $_GET['iframe'] ) ): ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
1442 |
<span class="view"><a class="thickbox" href="<?php echo $preview_link; ?>"><?php _e( 'Preview', 'polldaddy' ); ?></a> | </span>
|
1443 |
+
<?php else: ?>
|
1444 |
+
<span class="view"><a href="<?php echo $preview_link; ?>"><?php _e( 'Preview', 'polldaddy' ); ?></a> | </span>
|
1445 |
+
<?php endif;
|
1446 |
+
if ( $delete_link ) { ?>
|
1447 |
+
<span class="delete"><a class="delete-poll delete" href="<?php echo $delete_link; ?>"><?php _e( 'Delete', 'polldaddy' ); ?></a>
|
1448 |
+
<?php }
|
1449 |
+
if ( $poll->_responses > 0 ):?>
|
1450 |
+
| </span>
|
1451 |
+
<span class="results"><a href="<?php echo $results_link; ?>"><?php _e( 'Results', 'polldaddy' ); ?></a>
|
1452 |
+
<?php else:?>
|
1453 |
+
|
1454 |
+
</span>
|
1455 |
+
<?php endif; ?>
|
1456 |
+
|
1457 |
<?php $this->poll_table_add_option( $poll_id ); ?>
|
1458 |
</div>
|
1459 |
</td>
|
1460 |
+
<td class="poll-votes column-vote num"><?php echo number_format_i18n( $poll->_responses ); ?><span class="votes-label"><?php _e( 'votes' ); ?></span></td>
|
|
|
1461 |
</tr>
|
1462 |
+
<tr class="polldaddy-shortcode-row <?php if ( $class ): ?> alternate <?php endif; ?>" style="display: none;">
|
1463 |
+
<td colspan="4" style="padding:10px 0px 10px 20px;">
|
1464 |
+
|
1465 |
+
<a style="display:block;font-size:12px;font-weight:bold;" href="<?php echo $edit_link; ?>"><?php echo esc_html( $poll->___content ); ?></a>
|
1466 |
+
|
1467 |
+
<div class="pd-embed-col">
|
1468 |
+
<h4 style="color:#666;font-weight:normal;"><?php _e( 'WordPress Shortcode', 'polldaddy' ); ?></h4>
|
1469 |
+
<input type="text" readonly="readonly" style="width: 175px;" onclick="this.select();" value="[polldaddy poll=<?php echo (int) $poll_id; ?>]"/>
|
1470 |
+
</div>
|
1471 |
+
|
1472 |
+
<div class="pd-embed-col">
|
1473 |
+
<h4 style="color:#666;font-weight:normal;"><?php _e( 'Short URL (Good for Twitter etc.)', 'polldaddy' ); ?></h4>
|
1474 |
+
<input type="text" readonly="readonly" style="width: 175px;" onclick="this.select();" value="http://poll.fm/<?php echo base_convert( $poll_id, 10, 36 ); ?>"/>
|
1475 |
+
|
1476 |
+
</div>
|
1477 |
+
|
1478 |
+
<div class="pd-embed-col">
|
1479 |
+
<h4 style="color:#666;font-weight:normal;"><?php _e( 'Facebook URL', 'polldaddy' ); ?></h4>
|
1480 |
+
<input type="text" readonly="readonly" style="width: 175px;" onclick="this.select();" value="http://poll.fm/f/<?php echo base_convert( $poll_id, 10, 36 ); ?>"/>
|
1481 |
+
</div>
|
1482 |
+
|
1483 |
+
<br class="clearing" />
|
1484 |
+
|
1485 |
+
|
1486 |
+
<h4 style="padding-top:10px;color:#666;font-weight:normal;"><?php _e( 'JavaScript', 'polldaddy' ); ?></h4>
|
1487 |
+
<pre style="max-width:542px;text-wrap:word-wrap;margin-bottom:20px;"><script type="text/javascript" language="javascript"
|
1488 |
+
src="http://static.polldaddy.com/p/<?php echo (int) $poll_id; ?>.js"></script>
|
1489 |
<noscript>
|
1490 |
+
<a href="http://polldaddy.com/poll/<?php echo (int) $poll_id; ?>/"><?php echo trim( strip_tags( $poll->___content ) ); ?></a><br/>
|
1491 |
+
<span style="font:9px;">(<a href="http://www.polldaddy.com">polls</a>)</span>
|
1492 |
</noscript></pre>
|
1493 |
+
<p class="submit" style="clear:both;padding:0px;">
|
1494 |
+
<a href="#" class="button pd-embed-done"><?php _e( 'Done' ); ?></a>
|
1495 |
+
</p>
|
1496 |
+
|
1497 |
</td>
|
1498 |
</tr>
|
1499 |
|
1503 |
?>
|
1504 |
|
1505 |
<tr>
|
1506 |
+
<td colspan="4"><?php printf( __( 'What are you doing here? <a href="%s">Go back</a>.', 'polldaddy' ), esc_url( add_query_arg( 'paged', false ) ) ); ?></td>
|
1507 |
</tr>
|
1508 |
|
1509 |
<?php
|
1511 |
?>
|
1512 |
|
1513 |
<tr>
|
1514 |
+
<td colspan="4" id="empty-set"><?php
|
1515 |
+
if ( $this->is_author ) { ?>
|
1516 |
+
|
1517 |
+
<h3 style="margin-bottom:0px;"><?php _e( 'You haven\'t used our fancy plugin to create any polls for this blog!', 'polldaddy');?> </h3>
|
1518 |
+
<p style="margin-bottom:20px;"><?php _e( 'Why don\'t you go ahead and get started on that?', 'polldaddy' ); ?></p>
|
1519 |
+
<a href="<?php echo esc_url( add_query_arg( array( 'action' => 'create-poll' ) ) ); ?>" class="button-primary"><?php _e( 'Create a Poll Now', 'polldaddy' ); ?></a>
|
1520 |
+
|
1521 |
+
<?php
|
1522 |
+
} else { ?>
|
1523 |
+
|
1524 |
+
<p id="no-polls"><?php _e( 'No one has created any polls for this blog via our fancy plugin!', 'polldaddy' ); ?></p>
|
1525 |
+
|
1526 |
+
<?php }
|
1527 |
+
?></td>
|
1528 |
</tr>
|
1529 |
<?php endif; // $polls ?>
|
1530 |
|
1531 |
</tbody>
|
1532 |
</table>
|
1533 |
+
|
1534 |
+
|
1535 |
+
|
1536 |
+
|
1537 |
+
|
1538 |
+
|
1539 |
<?php $this->poll_table_extra(); ?>
|
1540 |
</form>
|
1541 |
+
<div class="tablenav" <?php if ( $page_links == '' ) { ?> style="display:none;" <?php } ?> >
|
1542 |
<div class="tablenav-pages"><?php echo $page_links; ?></div>
|
1543 |
</div>
|
1544 |
+
|
1545 |
+
|
1546 |
+
|
1547 |
+
|
1548 |
<script language="javascript">
|
1549 |
jQuery( document ).ready(function(){
|
1550 |
plugin = new Plugin( {
|
1555 |
standard_styles: '<?php echo esc_attr( __( 'Standard Styles', 'polldaddy' ) ); ?>',
|
1556 |
custom_styles: '<?php echo esc_attr( __( 'Custom Styles', 'polldaddy' ) ); ?>'
|
1557 |
} );
|
1558 |
+
|
1559 |
+
jQuery( '#filter-polls' ).click( function(){
|
1560 |
+
|
1561 |
+
|
1562 |
+
if( jQuery( '#filter-options' ).val() == 'blog' ){
|
1563 |
+
window.location = '<?php echo add_query_arg( array( 'view' => 'blog', 'paged' => false ) ); ?>';
|
1564 |
+
} else {
|
1565 |
+
window.location = '<?php echo add_query_arg( array( 'view' => false, 'paged' => false ) ); ?>';
|
1566 |
+
}
|
1567 |
+
|
1568 |
+
|
1569 |
+
|
1570 |
+
} );
|
1571 |
+
|
1572 |
+
|
1573 |
});
|
1574 |
</script>
|
1575 |
|
1605 |
$poll = polldaddy_poll( array(), null, false );
|
1606 |
}
|
1607 |
|
1608 |
+
$question = $is_POST ? esc_attr( stripslashes( $_POST['question'] ) ) : esc_attr( $poll->question );
|
1609 |
+
|
1610 |
+
$answers = $media = $mediaType = array();
|
1611 |
+
if ( $is_POST ) {
|
1612 |
+
if ( isset( $_POST['mediaType'] ) )
|
1613 |
+
$mediaType = $_POST['mediaType'];
|
1614 |
+
|
1615 |
+
if ( isset( $_POST['media'] ) ) {
|
1616 |
+
$mc = $_POST['media'];
|
1617 |
+
|
1618 |
+
foreach ( $mc as $key => $value ) {
|
1619 |
+
if ( $mediaType[$key] == 1 ) {
|
1620 |
+
$media[$key] = $polldaddy->get_media( $value );
|
1621 |
+
}
|
1622 |
+
}
|
1623 |
+
}
|
1624 |
+
|
1625 |
+
if ( isset( $_POST['answer'] ) )
|
1626 |
+
foreach ( $_POST['answer'] as $answer_id => $answer )
|
1627 |
+
$answers[attribute_escape($answer_id)] = attribute_escape( stripslashes($answer) );
|
1628 |
+
} elseif ( isset( $poll->answers->answer ) ) {
|
1629 |
+
foreach ( $poll->answers->answer as $answer ) {
|
1630 |
+
$answers[(int) $answer->_id] = attribute_escape( $answer->text );
|
1631 |
+
|
1632 |
+
if ( $answer->mediaType == 1 && !empty( $answer->mediaCode ) ) {
|
1633 |
+
$polldaddy->reset();
|
1634 |
+
$media[$answer->_id] = $polldaddy->get_media( $answer->mediaCode );
|
1635 |
+
$mediaType[$answer->_id] = 1;
|
1636 |
+
}
|
1637 |
+
elseif ( $answer->mediaType == 2 ) {
|
1638 |
+
$mediaType[$answer->_id] = 2;
|
1639 |
+
}
|
1640 |
+
}
|
1641 |
|
1642 |
+
if ( isset( $poll->mediaCode ) && isset( $poll->mediaType ) ) {
|
1643 |
+
if ( $poll->mediaType == 1 && !empty( $poll->mediaCode ) ) {
|
1644 |
+
$polldaddy->reset();
|
1645 |
+
$media[999999999] = $polldaddy->get_media( $poll->mediaCode );
|
1646 |
+
$mediaType[999999999] = 1;
|
1647 |
+
}
|
1648 |
+
elseif ( $poll->mediaType == 2 ) {
|
1649 |
+
$mediaType[999999999] = 2;
|
1650 |
+
}
|
1651 |
+
}
|
1652 |
+
}
|
1653 |
$this->print_errors();
|
1654 |
?>
|
1655 |
|
1656 |
+
<form enctype="multipart/form-data" name="send-media" action="admin-ajax.php" method="post">
|
1657 |
+
<?php wp_nonce_field( 'send-media' ); ?>
|
1658 |
+
<input type="hidden" value="" name="action">
|
1659 |
+
<input type="hidden" value="<?php echo $this->user_code; ?>" name="uc">
|
1660 |
+
<input type="hidden" value="" name="attach-id">
|
1661 |
+
<input type="hidden" value="" name="url">
|
1662 |
+
</form>
|
1663 |
+
|
1664 |
+
<form name="add-answer" action="admin-ajax.php" method="post">
|
1665 |
+
<?php wp_nonce_field( 'add-answer' ); ?>
|
1666 |
+
<input type="hidden" value="" name="action">
|
1667 |
+
<input type="hidden" value="" name="aa">
|
1668 |
+
<input type="hidden" value="" name="src">
|
1669 |
+
<input type="hidden" value="<?php echo isset( $_GET['iframe'] ) ? '1': '0';?>" name="popup">
|
1670 |
+
</form>
|
1671 |
+
|
1672 |
<form action="" method="post">
|
1673 |
<div id="poststuff"><div id="post-body" class="has-sidebar has-right-sidebar">
|
1674 |
|
1675 |
<div class="inner-sidebar" id="side-info-column">
|
1676 |
<div id="submitdiv" class="postbox">
|
1677 |
+
<h3><?php _e( 'Save', 'polldaddy' ); ?></h3>
|
1678 |
<div class="inside">
|
1679 |
+
<div class="minor-publishing">
|
1680 |
+
|
1681 |
+
<ul id="answer-options">
|
1682 |
+
|
1683 |
+
<?php
|
1684 |
+
foreach ( array( 'randomiseAnswers' => __( 'Randomize answer order', 'polldaddy' ), 'otherAnswer' => __( 'Allow other answers', 'polldaddy' ), 'sharing' => __( "'Share This' link", 'polldaddy' ), 'multipleChoice' => __( 'Multiple choice', 'polldaddy' ) ) as $option => $label ) :
|
1685 |
+
if ( $is_POST )
|
1686 |
+
$checked = 'yes' === $_POST[$option] ? ' checked="checked"' : '';
|
1687 |
+
else
|
1688 |
+
$checked = 'yes' === $poll->$option ? ' checked="checked"' : '';
|
1689 |
+
?>
|
1690 |
+
|
1691 |
+
<li>
|
1692 |
+
<label for="<?php echo $option; ?>"><input type="checkbox"<?php echo $checked; ?> value="yes" id="<?php echo $option; ?>" name="<?php echo $option; ?>" /> <?php echo esc_html( $label ); ?></label>
|
1693 |
+
</li>
|
1694 |
+
|
1695 |
+
<?php endforeach; ?>
|
1696 |
+
|
1697 |
+
</ul>
|
1698 |
+
<?php
|
1699 |
+
if ( $is_POST )
|
1700 |
+
$style = 'yes' === $_POST['multipleChoice'] ? 'display:block;' : 'display:none;';
|
1701 |
+
else
|
1702 |
+
$style = 'yes' === $poll->multipleChoice ? 'display:block;' : 'display:none;';
|
1703 |
+
?>
|
1704 |
+
<div id="numberChoices" name="numberChoices" style="padding-left:15px;<?php echo $style; ?>">
|
1705 |
+
<p><?php _e( 'Number of choices', 'polldaddy' ) ?>: <select name="choices" id="choices"><option value="0"><?php _e( 'No Limit', 'polldaddy' ) ?></option>
|
1706 |
+
<?php
|
1707 |
+
if ( $is_POST )
|
1708 |
+
$choices = (int) $_POST['choices'];
|
1709 |
+
else
|
1710 |
+
$choices = (int) $poll->choices;
|
1711 |
+
|
1712 |
+
$a = count( $answers ) - 1;
|
1713 |
+
|
1714 |
+
if ( $a > 1 ) :
|
1715 |
+
for ( $i=2; $i<=$a; $i++ ) :
|
1716 |
+
$selected = $i == $choices ? 'selected="selected"' : '';
|
1717 |
+
printf( "<option value='%d' %s>%d</option>", $i, $selected, $i );
|
1718 |
+
endfor;
|
1719 |
+
endif; ?>
|
1720 |
+
</select>
|
1721 |
+
</p>
|
1722 |
+
</div>
|
1723 |
+
</div>
|
1724 |
+
|
1725 |
+
|
1726 |
+
|
1727 |
<div id="major-publishing-actions">
|
1728 |
+
|
1729 |
+
|
1730 |
+
|
1731 |
+
|
1732 |
+
|
1733 |
+
|
1734 |
+
|
1735 |
<p id="publishing-action">
|
1736 |
+
|
1737 |
+
|
1738 |
+
|
1739 |
<?php wp_nonce_field( $poll_id ? "edit-poll_$poll_id" : 'create-poll' ); ?>
|
1740 |
<input type="hidden" name="action" value="<?php echo $poll_id ? 'edit-poll' : 'create-poll'; ?>" />
|
1741 |
<input type="hidden" class="polldaddy-poll-id" name="poll" value="<?php echo $poll_id; ?>" />
|
1742 |
+
<input type="submit" class="button-primary" value="<?php echo esc_attr( __( 'Save Poll', 'polldaddy' ) ); ?>" />
|
1743 |
|
1744 |
<?php if ( isset( $_GET['iframe'] ) && $poll_id ) : ?>
|
1745 |
+
<div id="delete-action">
|
1746 |
+
<input type="button" class="button polldaddy-send-to-editor" style="margin-top:8px;" value="<?php echo esc_attr( __( 'Embed in Post', 'polldaddy' ) ); ?>" />
|
1747 |
+
</div>
|
1748 |
<?php endif; ?>
|
1749 |
|
1750 |
</p>
|
1754 |
</div>
|
1755 |
|
1756 |
<div class="postbox">
|
1757 |
+
<h3><?php _e( 'Results Display', 'polldaddy' ); ?></h3>
|
1758 |
<div class="inside">
|
1759 |
<ul class="poll-options">
|
1760 |
|
1767 |
?>
|
1768 |
|
1769 |
<li>
|
1770 |
+
<label for="resultsType-<?php echo $value; ?>"><input type="radio"<?php echo $checked; ?> value="<?php echo $value; ?>" name="resultsType" id="resultsType-<?php echo $value; ?>" /> <?php echo esc_html( $label ); ?></label>
|
1771 |
</li>
|
1772 |
|
1773 |
<?php endforeach; ?>
|
1777 |
</div>
|
1778 |
|
1779 |
<div class="postbox">
|
1780 |
+
<h3><?php _e( 'Repeat Voting', 'polldaddy' ); ?></h3>
|
1781 |
<div class="inside">
|
1782 |
<ul class="poll-options">
|
1783 |
|
1790 |
?>
|
1791 |
|
1792 |
<li>
|
1793 |
+
<label for="blockRepeatVotersType-<?php echo $value; ?>"><input class="block-repeat" type="radio"<?php echo $checked; ?> value="<?php echo $value; ?>" name="blockRepeatVotersType" id="blockRepeatVotersType-<?php echo $value; ?>" /> <?php echo esc_html( $label ); ?></label>
|
1794 |
</li>
|
1795 |
|
1796 |
<?php endforeach; ?>
|
1797 |
|
1798 |
</ul>
|
1799 |
|
1800 |
+
<span style="margin:6px 6px 8px;<?php echo $poll->blockRepeatVotersType == 'off' ? 'display:none;' : ''; ?>" id="cookieip_expiration_label"><label><?php _e( 'Expires: ', 'polldaddy' ); ?></label></span>
|
1801 |
<select id="cookieip_expiration" name="cookieip_expiration" style="width: auto;<?php echo $poll->blockRepeatVotersType == 'off' ? 'display:none;' : ''; ?>">
|
1802 |
<option value="0" <?php echo (int) $poll->blockExpiration == 0 ? 'selected' : ''; ?>><?php _e( 'Never', 'polldaddy' ); ?></option>
|
1803 |
<option value="3600" <?php echo (int) $poll->blockExpiration == 3600 ? 'selected' : ''; ?>><?php printf( __( '%d hour', 'polldaddy' ), 1 ); ?></option>
|
1811 |
<p><?php _e( 'Note: Blocking by cookie and IP address can be problematic for some voters.', 'polldaddy' ); ?></p>
|
1812 |
</div>
|
1813 |
</div>
|
1814 |
+
|
1815 |
+
<div class="postbox">
|
1816 |
+
<h3><?php _e( 'Comments', 'polldaddy' ); ?></h3>
|
1817 |
+
<div class="inside">
|
1818 |
+
<ul class="poll-options">
|
1819 |
+
|
1820 |
+
<?php
|
1821 |
+
foreach ( array( 'allow' => __( "Allow comments", 'polldaddy' ), 'moderate' => __( 'Moderate first', 'polldaddy' ), 'off' => __( 'No comments', 'polldaddy' ) ) as $value => $label ) :
|
1822 |
+
if ( $is_POST )
|
1823 |
+
$checked = $value === $_POST['comments'] ? ' checked="checked"' : '';
|
1824 |
+
else
|
1825 |
+
$checked = $value === $poll->comments->___content ? ' checked="checked"' : '';
|
1826 |
+
?>
|
1827 |
+
|
1828 |
+
<li>
|
1829 |
+
<label for="comments-<?php echo $value; ?>"><input type="radio"<?php echo $checked; ?> value="<?php echo $value; ?>" name="comments" id="comments-<?php echo $value; ?>" /> <?php echo esc_html( $label ); ?></label>
|
1830 |
+
</li>
|
1831 |
+
|
1832 |
+
<?php endforeach; ?>
|
1833 |
+
|
1834 |
+
</ul>
|
1835 |
+
</div>
|
1836 |
+
</div>
|
1837 |
</div>
|
1838 |
|
1839 |
|
1840 |
+
<div id="post-body-content" class="has-sidebar-content">
|
1841 |
+
|
1842 |
+
<div id="titlediv" style="margin-top:0px;">
|
1843 |
+
<div id="titlewrap">
|
1844 |
+
|
1845 |
+
<table class="question">
|
1846 |
+
|
1847 |
+
<tr>
|
1848 |
+
<td class="question-input">
|
1849 |
+
<input type="text" autocomplete="off" id="title" placeholder="<?php _e( 'Enter Question Here', 'polldaddy' ); ?>" value="<?php echo $question; ?>" tabindex="1" size="30" name="question" />
|
1850 |
+
</td>
|
1851 |
+
<td class="answer-media-icons" <?php echo isset( $_GET['iframe'] ) ? 'style="width: 55px !important;"' : '';?>>
|
1852 |
+
<ul class="answer-media" <?php echo isset( $_GET['iframe'] ) ? 'style="min-width: 30px;"' : '';?>>
|
1853 |
+
<?php if ( $mediaType[999999999] == 2 ) { ?>
|
1854 |
+
<li class="media-preview" style="width: 20px; height: 16px; padding-left: 5px;"><img height="16" width="16" src="http://i0.poll.fm/images/icon-report-ip-analysis.png" alt="Video Embed"></li>
|
1855 |
+
<?php } else { ?>
|
1856 |
+
<li class="media-preview" style="width: 20px; height: 16px; padding-left: 5px;"><?php echo isset($media[999999999])?urldecode($media[999999999]->img_small):''; ?></li>
|
1857 |
+
<?php }
|
1858 |
+
|
1859 |
+
if ( !isset( $_GET['iframe'] ) ) : ?>
|
1860 |
+
<li><a title="<?php echo esc_attr( __( 'Add an Image', 'polldaddy' ) ); ?>" class="thickbox media image" id="add_poll_image999999999" href="#"><img style="vertical-align:middle;" alt="<?php echo esc_attr( __( 'Add an Image', 'polldaddy' ) ); ?>" src="images/media-button-image.gif"></a></li>
|
1861 |
+
<li><a title="<?php echo esc_attr( __( 'Add Audio', 'polldaddy' ) ); ?>" class="thickbox media video" id="add_poll_video999999999" href="#"><img style="vertical-align:middle;" alt="<?php echo esc_attr( __( 'Add Audio', 'polldaddy' ) ); ?>" src="images/media-button-video.gif"></a></li>
|
1862 |
+
<li><a title="<?php echo esc_attr( __( 'Add Video', 'polldaddy' ) ); ?>" class="thickbox media audio" id="add_poll_audio999999999" href="#"><img style="vertical-align:middle;" alt="<?php echo esc_attr( __( 'Add Video', 'polldaddy' ) ); ?>" src="images/media-button-music.gif"></a></li>
|
1863 |
+
<?php endif; ?>
|
1864 |
+
</ul>
|
1865 |
+
|
1866 |
+
<input type="hidden" value="<?php echo isset( $media[999999999] ) ? $media[999999999]->_id : ''; ?>" id="hMC999999999" name="media[999999999]">
|
1867 |
+
<input type="hidden" value="<?php echo isset( $mediaType[999999999] ) ? $mediaType[999999999] : ''; ?>" id="hMT999999999" name="mediaType[999999999]">
|
1868 |
+
|
1869 |
+
</td>
|
1870 |
+
</tr>
|
1871 |
+
</table>
|
1872 |
+
|
1873 |
+
<?php if ( isset( $poll->_id ) && !isset( $_GET['iframe']) ): ?>
|
1874 |
+
<div class="inside">
|
1875 |
+
<div id="edit-slug-box" style="margin-bottom:30px;">
|
1876 |
+
<strong><?php _e( 'WordPress Shortcode:', 'polldaddy' ); ?></strong>
|
1877 |
+
<input type="text" style="color:#999;" value="[polldaddy poll=<?php echo $poll->_id; ?>]" id="shortcode-field" readonly="readonly" />
|
1878 |
+
<span><a href="post-new.php?content=[polldaddy poll=<?php echo $poll->_id; ?>]" class="button"><?php _e( 'Embed Poll in New Post' ); ?></a></span>
|
1879 |
+
</div>
|
1880 |
+
</div>
|
1881 |
+
<?php endif; ?>
|
1882 |
|
|
|
|
|
|
|
1883 |
</div>
|
1884 |
</div>
|
1885 |
|
1890 |
<ul id="answers">
|
1891 |
<?php
|
1892 |
$a = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1893 |
foreach ( $answers as $answer_id => $answer ) :
|
1894 |
$a++;
|
1895 |
+
$delete_link = esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'delete-answer', 'poll' => $poll_id, 'answer' => $answer_id, 'message' => false ) ), "delete-answer_$answer_id" ) );
|
1896 |
?>
|
1897 |
|
1898 |
<li>
|
1899 |
+
|
1900 |
+
|
1901 |
+
<table class="answer">
|
1902 |
+
|
1903 |
+
<tr>
|
1904 |
+
<th>
|
1905 |
+
<span class="handle" title="<?php echo esc_attr( __( 'click and drag to reorder' ) ); ?>"><img src="<?php echo $this->base_url; ?>img/icon-reorder.png" alt="click and drag to reorder" width="6" height="9" /></span>
|
1906 |
+
</th>
|
1907 |
+
<td class="answer-input">
|
1908 |
+
<input type="text" autocomplete="off" placeholder="<?php echo esc_attr( __( 'Enter an answer here', 'polldaddy' ) ); ?>" id="answer-<?php echo $answer_id; ?>" value="<?php echo $answer; ?>" tabindex="2" size="30" name="answer[<?php echo $answer_id; ?>]" />
|
1909 |
+
</td>
|
1910 |
+
<td class="answer-media-icons" <?php echo isset( $_GET['iframe'] ) ? 'style="width: 55px !important;"' : '';?>>
|
1911 |
+
<ul class="answer-media" <?php echo isset( $_GET['iframe'] ) ? 'style="min-width: 30px;"' : '';?>>
|
1912 |
+
<?php if ( $mediaType[$answer_id] == 2 ) { ?>
|
1913 |
+
<li class="media-preview" style="width: 20px; height: 16px; padding-left: 5px;"><img height="16" width="16" src="http://i0.poll.fm/images/icon-report-ip-analysis.png" alt="Video Embed"></li>
|
1914 |
+
<?php } else { ?>
|
1915 |
+
<li class="media-preview" style="width: 20px; height: 16px; padding-left: 5px;"><?php echo isset($media[$answer_id])?urldecode($media[$answer_id]->img_small):''; ?></li>
|
1916 |
+
<?php }
|
1917 |
+
|
1918 |
+
if ( !isset( $_GET['iframe'] ) ) : ?>
|
1919 |
+
<li><a title="<?php echo esc_attr( __( 'Add an Image', 'polldaddy' ) ); ?>" class="thickbox media image" id="add_poll_image<?php echo $answer_id; ?>" href="#"><img style="vertical-align:middle;" alt="<?php echo esc_attr( __( 'Add an Image', 'polldaddy' ) ); ?>" src="images/media-button-image.gif"></a></li>
|
1920 |
+
<li><a title="<?php echo esc_attr( __( 'Add Audio', 'polldaddy' ) ); ?>" class="thickbox media video" id="add_poll_video<?php echo $answer_id; ?>" href="#"><img style="vertical-align:middle;" alt="<?php echo esc_attr( __( 'Add Audio', 'polldaddy' ) ); ?>" src="images/media-button-video.gif"></a></li>
|
1921 |
+
<li><a title="<?php echo esc_attr( __( 'Add Video', 'polldaddy' ) ); ?>" class="thickbox media audio" id="add_poll_audio<?php echo $answer_id; ?>" href="#"><img style="vertical-align:middle;" alt="<?php echo esc_attr( __( 'Add Video', 'polldaddy' ) ); ?>" src="images/media-button-music.gif"></a></li>
|
1922 |
+
<?php endif; ?>
|
1923 |
+
<li><a href="<?php echo $delete_link; ?>" class="delete-answer delete" title="<?php echo esc_attr( __( 'delete this answer' ) ); ?>"><img src="<?php echo $this->base_url; ?>img/icon-clear-search.png" width="16" height="16" /></a></li>
|
1924 |
+
|
1925 |
+
</ul>
|
1926 |
+
|
1927 |
+
<input type="hidden" value="<?php echo isset( $media[$answer_id] ) ? $media[$answer_id]->_id : ''; ?>" id="hMC<?php echo $answer_id; ?>" name="media[<?php echo $answer_id; ?>]">
|
1928 |
+
<input type="hidden" value="<?php echo isset( $mediaType[$answer_id] ) ? $mediaType[$answer_id] : ''; ?>" id="hMT<?php echo $answer_id; ?>" name="mediaType[<?php echo $answer_id; ?>]">
|
1929 |
+
|
1930 |
+
</td>
|
1931 |
+
</tr>
|
1932 |
+
</table>
|
1933 |
+
|
1934 |
+
|
1935 |
+
</li>
|
1936 |
|
1937 |
<?php
|
1938 |
endforeach;
|
1942 |
?>
|
1943 |
|
1944 |
<li>
|
1945 |
+
<table class="answer">
|
|
|
|
|
|
|
1946 |
|
1947 |
+
<tr>
|
1948 |
+
<th>
|
1949 |
+
<span class="handle" title="<?php echo esc_attr( __( 'click and drag to reorder' ) ); ?>"><img src="<?php echo $this->base_url; ?>img/icon-reorder.png" alt="click and drag to reorder" width="6" height="9" /></span>
|
1950 |
+
</th>
|
1951 |
+
<td class="answer-input">
|
1952 |
+
<input type="text" autocomplete="off" placeholder="<?php echo esc_attr( __( 'Enter an answer here', 'polldaddy' ) ); ?>" value="" tabindex="2" size="30" name="answer[new<?php echo $a; ?>]" />
|
1953 |
+
</td>
|
1954 |
+
<td class="answer-media-icons" <?php echo isset( $_GET['iframe'] ) ? 'style="width:55px !important;"' : '';?>>
|
1955 |
+
<ul class="answer-media" <?php echo isset( $_GET['iframe'] ) ? 'style="min-width: 30px;"' : '';?>>
|
1956 |
+
<li class="media-preview" style="width: 20px; height: 16px; padding-left: 5px;"></li>
|
1957 |
<?php
|
1958 |
+
if ( !isset( $_GET['iframe'] ) ) : ?>
|
1959 |
+
<li><a title="<?php echo esc_attr( __( 'Add an Image', 'polldaddy' ) ); ?>" class="thickbox media image" id="add_poll_image<?php echo $a; ?>" href="#"><img style="vertical-align:middle;" alt="<?php echo esc_attr( __( 'Add an Image', 'polldaddy' ) ); ?>" src="images/media-button-image.gif"></a></a></li>
|
1960 |
+
<li><a title="<?php echo esc_attr( __( 'Add Audio', 'polldaddy' ) ); ?>" class="thickbox media video" id="add_poll_video<?php echo $a; ?>" href="#"><img style="vertical-align:middle;" alt="<?php echo esc_attr( __( 'Add Audio', 'polldaddy' ) ); ?>" src="images/media-button-video.gif"></a></a></li>
|
1961 |
+
<li><a title="<?php echo esc_attr( __( 'Add Video', 'polldaddy' ) ); ?>" class="thickbox media audio" id="add_poll_audio<?php echo $a; ?>" href="#"><img style="vertical-align:middle;" alt="<?php echo esc_attr( __( 'Add Video', 'polldaddy' ) ); ?>" src="images/media-button-music.gif"></a></li>
|
1962 |
+
<?php endif; ?>
|
1963 |
+
<li><a href="#" class="delete-answer delete" title="<?php echo esc_attr( __( 'delete this answer' ) ); ?>"><img src="<?php echo $this->base_url; ?>img/icon-clear-search.png" width="16" height="16" /></a></li>
|
1964 |
+
</ul>
|
1965 |
+
|
1966 |
+
<input type="hidden" value="" id="hMC<?php echo $a; ?>" name="media[<?php echo $a; ?>]">
|
1967 |
+
<input type="hidden" value="" id="hMT<?php echo $a; ?>" name="mediaType[<?php echo $a; ?>]">
|
1968 |
+
|
1969 |
+
</td>
|
1970 |
+
</tr>
|
1971 |
+
|
1972 |
+
|
1973 |
+
</table>
|
1974 |
|
|
|
1975 |
|
|
|
|
|
|
|
1976 |
|
|
|
1977 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1978 |
|
|
|
|
|
1979 |
</li>
|
1980 |
|
1981 |
+
<?php
|
1982 |
+
endwhile;
|
1983 |
+
?>
|
1984 |
|
1985 |
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1986 |
|
1987 |
+
<p id="add-answer-holder" class="<?php echo $this->base_url; ?>">
|
1988 |
+
<button class="button"><?php echo esc_html( __( 'Add New Answer', 'polldaddy' ) ); ?></button>
|
1989 |
+
</p>
|
1990 |
+
|
|
|
|
|
|
|
|
|
|
|
1991 |
</div>
|
1992 |
</div>
|
1993 |
|
2080 |
}
|
2081 |
?>
|
2082 |
|
2083 |
+
<script language="javascript" type="text/javascript">
|
2084 |
+
|
2085 |
+
jQuery( document ).ready( function(){
|
2086 |
+
|
2087 |
+
jQuery( '.pd-tabs a' ).click( function(){
|
2088 |
+
|
2089 |
+
if( !jQuery( this ).closest('li').hasClass( 'selected' ) ){
|
2090 |
+
|
2091 |
+
jQuery( '.pd-tabs li' ).removeClass( 'selected' );
|
2092 |
+
jQuery( this ).closest( 'li' ).addClass( 'selected' );
|
2093 |
+
|
2094 |
+
jQuery( '.pd-tab-panel' ).removeClass( 'show' );
|
2095 |
+
jQuery( '.pd-tab-panel#' + $( this ).closest( 'li' ).attr( 'id' ) + '-panel' ).addClass( 'show' );
|
2096 |
+
}
|
2097 |
+
|
2098 |
+
|
2099 |
+
} );
|
2100 |
+
|
2101 |
+
|
2102 |
+
|
2103 |
+
|
2104 |
+
|
2105 |
+
} );
|
2106 |
+
|
2107 |
+
</script>
|
2108 |
+
|
2109 |
+
|
2110 |
+
|
2111 |
+
|
2112 |
+
<h3><?php _e( 'Poll Style', 'polldaddy' ); ?></h3>
|
2113 |
<input type="hidden" name="styleID" id="styleID" value="<?php echo $style_ID ?>">
|
2114 |
<div class="inside">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2115 |
|
2116 |
+
<ul class="pd-tabs">
|
2117 |
+
<li class="selected" id="pd-styles"><a href="#"><?php _e( 'Polldaddy Styles', 'polldaddy' ); ?></a></li>
|
2118 |
+
<?php $hide = $show_custom == true ? ' style="display:block;"' : ' style="display:none;"'; ?>
|
2119 |
+
<li id="pd-custom-styles" <?php echo $hide; ?>><a href="#"><?php _e( 'Custom Styles', 'polldaddy' ); ?></a></li>
|
2120 |
|
2121 |
+
</ul>
|
|
|
|
|
|
|
2122 |
|
2123 |
+
<div class="pd-tab-panel show" id="pd-styles-panel">
|
2124 |
+
|
2125 |
+
|
2126 |
+
<?php if ( $iframe_view ) { ?>
|
2127 |
+
<div id="design_standard" style="padding:0px;padding-top:10px;">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2128 |
<div class="hide-if-no-js">
|
2129 |
+
<table class="pollStyle">
|
2130 |
+
<thead>
|
2131 |
+
<tr>
|
2132 |
+
<th>
|
2133 |
+
<div style="display:none;">
|
2134 |
+
<input type="radio" name="styleTypeCB" id="regular" onclick="javascript:pd_build_styles( 0 );"/>
|
2135 |
+
</div>
|
2136 |
+
</th>
|
2137 |
+
</tr>
|
2138 |
+
</thead>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2139 |
<tr>
|
2140 |
+
<td class="selector" style="width:120px;">
|
|
|
2141 |
<table class="st_selector">
|
2142 |
<tr>
|
2143 |
+
<td class="dir_left" style="padding:0px;width:30px;">
|
2144 |
+
<a href="javascript:pd_move('prev');" style="display: block;font-size: 3.2em;text-decoration: none;">«</a>
|
2145 |
</td>
|
2146 |
<td class="img"><div class="st_image_loader"><div id="st_image" onmouseover="st_results(this, 'show');" onmouseout="st_results(this, 'hide');"></div></div></td>
|
2147 |
+
<td class="dir_right" style="padding:0px;width:30px;">
|
2148 |
+
<a href="javascript:pd_move('next');" style="display: block;padding-left:20px;font-size: 3.2em;text-decoration: none;">»</a>
|
2149 |
</td>
|
2150 |
</tr>
|
2151 |
<tr>
|
2171 |
</tr>
|
2172 |
<tr>
|
2173 |
<td colspan="3">
|
2174 |
+
<div style="width:230px;" id="st_description"></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2175 |
</td>
|
2176 |
</tr>
|
2177 |
</table>
|
2178 |
</td>
|
2179 |
</tr>
|
2180 |
+
</table>
|
|
|
2181 |
</div>
|
2182 |
+
|
2183 |
<p class="empty-if-js" id="no-js-styleID">
|
2184 |
<select id="styleID" name="styleID">
|
2185 |
|
2186 |
<?php foreach ( $options as $styleID => $label ) :
|
2187 |
$selected = $styleID == $style_ID ? ' selected="selected"' : ''; ?>
|
2188 |
+
<option value="<?php echo (int) $styleID; ?>"<?php echo $selected; ?>><?php echo esc_html( $label ); ?></option>
|
2189 |
<?php endforeach; ?>
|
2190 |
|
2191 |
</select>
|
2192 |
</p>
|
2193 |
</div>
|
2194 |
+
<?php if ( $show_custom ) { ?>
|
2195 |
+
<div id="design_custom">
|
2196 |
+
<p class="hide-if-no-js">
|
2197 |
+
<table class="pollStyle">
|
2198 |
+
<thead>
|
2199 |
+
<tr>
|
2200 |
+
<th>
|
2201 |
+
<div style="display:none;">
|
2202 |
+
<?php $disabled = $show_custom == false ? ' disabled="true"' : ''; ?>
|
2203 |
+
<input type="radio" name="styleTypeCB" id="custom" onclick="javascript:pd_change_style(_$('customSelect').value);" <?php echo $disabled; ?> />
|
2204 |
+
<label onclick="javascript:pd_change_style(_$('customSelect').value);"><?php _e( 'Custom Style', 'polldaddy' ); ?></label>
|
2205 |
+
</div>
|
2206 |
+
</th>
|
2207 |
+
</tr>
|
2208 |
+
</thead>
|
2209 |
+
<tbody>
|
2210 |
+
<tr>
|
2211 |
+
<td class="customSelect">
|
2212 |
+
<table>
|
2213 |
+
<tr>
|
2214 |
+
<td>
|
2215 |
+
</td>
|
2216 |
+
</tr>
|
2217 |
+
<tr>
|
2218 |
+
<td><?php $extra = $show_custom == false ? __( 'You currently have no custom styles created.', 'polldaddy' ) : ''; ?>
|
2219 |
+
<p><?php echo $extra ?></p>
|
2220 |
+
<p><?php printf( __( 'Did you know we have a new editor for building your own custom poll styles? Find out more <a href="%s" target="_blank">here</a>.', 'polldaddy' ), 'http://support.polldaddy.com/custom-poll-styles/' ); ?></p>
|
2221 |
+
</td>
|
2222 |
+
</tr>
|
2223 |
+
</table>
|
2224 |
+
</td>
|
2225 |
+
</tr>
|
2226 |
+
</tbody>
|
2227 |
+
</table>
|
2228 |
+
</p>
|
2229 |
+
</div>
|
2230 |
+
|
2231 |
+
|
2232 |
+
|
2233 |
+
|
2234 |
+
<?php }}else {?>
|
2235 |
+
|
2236 |
+
|
2237 |
+
<div class="design_standard">
|
2238 |
+
<div class="hide-if-no-js">
|
2239 |
+
<table class="pollStyle">
|
2240 |
+
<thead>
|
2241 |
+
<tr style="display:none;">
|
2242 |
+
<th class="cb">
|
2243 |
+
|
2244 |
+
<input type="radio" name="styleTypeCB" id="regular" onclick="javascript:pd_build_styles( 0 );"/>
|
2245 |
+
<label for="skin" onclick="javascript:pd_build_styles( 0 );"><?php _e( 'Polldaddy Style', 'polldaddy' ); ?></label>
|
2246 |
+
|
2247 |
+
<?php $disabled = $show_custom == false ? ' disabled="true"' : ''; ?>
|
2248 |
+
|
2249 |
+
<input type="radio" name="styleTypeCB" id="custom" onclick="javascript:pd_change_style(_$('customSelect').value);" <?php echo $disabled; ?> />
|
2250 |
+
|
2251 |
+
<label onclick="javascript:pd_change_style(_$('customSelect').value);"><?php _e( 'Custom Style', 'polldaddy' ); ?></label>
|
2252 |
+
|
2253 |
+
<th>
|
2254 |
+
</tr>
|
2255 |
+
</thead>
|
2256 |
+
<tbody>
|
2257 |
+
<tr>
|
2258 |
+
<td style="text-align:center">
|
2259 |
+
<table class="st_selector" style="margin:20px auto;">
|
2260 |
+
<tr>
|
2261 |
+
<td class="dir_left">
|
2262 |
+
<a href="javascript:pd_move('prev');" style="width: 1em;display: block;font-size: 4em;text-decoration: none;">«</a>
|
2263 |
+
</td>
|
2264 |
+
<td class="img"><div class="st_image_loader"><div id="st_image" onmouseover="st_results(this, 'show');" onmouseout="st_results(this, 'hide');"></div></div></td>
|
2265 |
+
<td class="dir_right">
|
2266 |
+
<a href="javascript:pd_move('next');" style="width: 1em;display: block;font-size: 4em;text-decoration: none;">»</a>
|
2267 |
+
</td>
|
2268 |
+
</tr>
|
2269 |
+
<tr>
|
2270 |
+
<td></td>
|
2271 |
+
<td class="counter">
|
2272 |
+
<div id="st_number"></div>
|
2273 |
+
</td>
|
2274 |
+
<td></td>
|
2275 |
+
</tr>
|
2276 |
+
<tr>
|
2277 |
+
<td></td>
|
2278 |
+
<td class="title">
|
2279 |
+
<div id="st_name"></div>
|
2280 |
+
</td>
|
2281 |
+
<td></td>
|
2282 |
+
</tr>
|
2283 |
+
<tr>
|
2284 |
+
<td></td>
|
2285 |
+
<td>
|
2286 |
+
<div id="st_sizes"></div>
|
2287 |
+
</td>
|
2288 |
+
<td></td>
|
2289 |
+
</tr>
|
2290 |
+
<tr>
|
2291 |
+
<td colspan="3">
|
2292 |
+
<div id="st_description"></div>
|
2293 |
+
</td>
|
2294 |
+
</tr>
|
2295 |
+
</table>
|
2296 |
+
</td>
|
2297 |
+
|
2298 |
+
</tr>
|
2299 |
+
</tbody>
|
2300 |
+
</table>
|
2301 |
+
</div>
|
2302 |
+
<p class="empty-if-js" id="no-js-styleID">
|
2303 |
+
<select id="styleID" name="styleID">
|
2304 |
+
|
2305 |
+
<?php foreach ( $options as $styleID => $label ) :
|
2306 |
+
$selected = $styleID == $style_ID ? ' selected="selected"' : ''; ?>
|
2307 |
+
<option value="<?php echo (int) $styleID; ?>"<?php echo $selected; ?>><?php echo esc_html( $label ); ?></option>
|
2308 |
+
<?php endforeach; ?>
|
2309 |
+
|
2310 |
+
</select>
|
2311 |
+
</p>
|
2312 |
+
</div>
|
2313 |
+
<?php } ?>
|
2314 |
+
|
2315 |
+
|
2316 |
+
|
2317 |
+
|
2318 |
+
</div>
|
2319 |
+
|
2320 |
+
|
2321 |
+
<div class="pd-tab-panel" id="pd-custom-styles-panel">
|
2322 |
+
<div style="padding:20px;">
|
2323 |
+
<select id="customSelect" name="customSelect" onclick="pd_change_style(this.value);">
|
2324 |
+
<?php $selected = $custom_style_ID == 0 ? ' selected="selected"' : ''; ?>
|
2325 |
+
<option value="x"<?php echo $selected; ?>><?php _e( 'Please choose a custom style...', 'polldaddy' ); ?></option>
|
2326 |
+
<?php if ( $show_custom ) : foreach ( (array)$styles->style as $style ) :
|
2327 |
+
$selected = $style->_id == $custom_style_ID ? ' selected="selected"' : ''; ?>
|
2328 |
+
<option value="<?php echo (int) $style->_id; ?>"<?php echo $selected; ?>><?php echo esc_html( $style->title ); ?></option>
|
2329 |
+
<?php endforeach; endif; ?>
|
2330 |
+
</select>
|
2331 |
+
<div id="styleIDErr" class="formErr" style="display:none;"><?php _e( 'Please choose a style.', 'polldaddy' ); ?></div>
|
2332 |
+
<?php $extra = $show_custom == false ? __( 'You currently have no custom styles created.', 'polldaddy' ) : ''; ?>
|
2333 |
+
<p><?php echo $extra ?></p>
|
2334 |
+
<p><?php printf( __( 'Did you know we have a new editor for building your own custom poll styles? Find out more <a href="%s" target="_blank">here</a>.', 'polldaddy' ), 'http://support.polldaddy.com/custom-poll-styles/' ); ?></p>
|
2335 |
+
</div>
|
2336 |
+
|
2337 |
+
|
2338 |
+
|
2339 |
+
|
2340 |
+
</div>
|
2341 |
+
|
2342 |
+
|
2343 |
+
|
2344 |
+
|
2345 |
+
<script language="javascript">
|
2346 |
jQuery( document ).ready(function(){
|
2347 |
plugin = new Plugin( {
|
2348 |
delete_rating: '<?php echo esc_attr( __( 'Are you sure you want to delete the rating for "%s"?', 'polldaddy' ) ); ?>',
|
2349 |
delete_poll: '<?php echo esc_attr( __( 'Are you sure you want to delete "%s"?', 'polldaddy' ) ); ?>',
|
2350 |
delete_answer: '<?php echo esc_attr( __( 'Are you sure you want to delete this answer?', 'polldaddy' ) ); ?>',
|
2351 |
+
new_answer_test: '<?php echo esc_attr( __( 'Enter an answer here', 'polldaddy' ) ); ?>',
|
2352 |
+
delete_answer_title: '<?php echo esc_attr( __( 'delete this answer', 'polldaddy' ) ); ?>',
|
2353 |
+
reorder_answer_title: '<?php echo esc_attr( __( 'click and drag to reorder', 'polldaddy' ) ); ?>',
|
2354 |
+
add_image_title: '<?php echo esc_attr( __( 'Add an Image', 'polldaddy' ) ); ?>',
|
2355 |
+
add_audio_title: '<?php echo esc_attr( __( 'Add Audio', 'polldaddy' ) ); ?>',
|
2356 |
+
add_video_title: '<?php echo esc_attr( __( 'Add Video', 'polldaddy' ) ); ?>',
|
2357 |
+
standard_styles: '<?php echo esc_attr( __( 'Standard Styles', 'polldaddy' ) ); ?>',
|
2358 |
+
custom_styles: '<?php echo esc_attr( __( 'Custom Styles', 'polldaddy' ) ); ?>'
|
2359 |
} );
|
2360 |
});
|
2361 |
</script>
|
2462 |
$polldaddy->reset();
|
2463 |
|
2464 |
$results = $polldaddy->get_poll_results( $poll_id );
|
2465 |
+
$poll = $polldaddy->get_poll( $poll_id );
|
2466 |
|
2467 |
+
?>
|
2468 |
+
<h3 style="line-height:21px;"><?php echo $poll->question; ?></h3>
|
2469 |
<table class="poll-results widefat">
|
2470 |
<thead>
|
2471 |
<tr>
|
2472 |
+
<th scope="col" class="column-title" style="width:40%;"><?php _e( 'Answer', 'polldaddy' ); ?></th>
|
2473 |
+
<th scope="col" class="column-vote" style="width:10%;text-align:center;"><?php _e( 'Votes', 'polldaddy' ); ?></th>
|
2474 |
+
<th scope="col" class="column-vote" style="width:10%;text-align:center;"><?php _e( 'Percent', 'polldaddy' ); ?></th>
|
2475 |
+
<th scope="col" class="column-vote" style="width:40%;"> </th>
|
2476 |
</tr>
|
2477 |
</thead>
|
2478 |
<tbody>
|
2486 |
}
|
2487 |
|
2488 |
$class = $class ? '' : ' class="alternate"';
|
2489 |
+
$content = $results->others && 'Other answer...' === $answer->text ? sprintf( __( 'Other (<a href="%s">see below</a>)', 'polldaddy' ), '#other-answers-results' ) : esc_html( $answer->text );
|
2490 |
|
2491 |
?>
|
2492 |
|
2493 |
<tr<?php echo $class; ?>>
|
2494 |
+
<th scope="row" style="vertical-align:bottom" class="column-title"><?php echo $content; ?></th>
|
2495 |
+
<td class="column-vote" style="text-align:center;vertical-align:middle;">
|
2496 |
+
<?php echo number_format_i18n( $answer->_total ); ?>
|
2497 |
+
</td>
|
2498 |
+
<td style="text-align:center;vertical-align:middle;">
|
2499 |
+
<?php echo number_format_i18n( $answer->_percent ); ?>%
|
2500 |
+
</td>
|
2501 |
+
<td style="vertical-align:middle;">
|
2502 |
+
<span class="result-bar" style="width: <?php echo number_format( $answer->_percent, 2 ); ?>%;"> </span>
|
2503 |
</td>
|
2504 |
</tr>
|
2505 |
<?php
|
2533 |
?>
|
2534 |
|
2535 |
<tr<?php echo $class; ?>>
|
2536 |
+
<th scope="row" class="column-title"><?php echo esc_html( $other ); ?></th>
|
2537 |
<td class="column-vote"><?php echo number_format_i18n( $freq ); ?></td>
|
2538 |
</tr>
|
2539 |
<?php
|
2578 |
</div>
|
2579 |
<div class="tablenav-pages"></div>
|
2580 |
</div>
|
2581 |
+
|
2582 |
<table class="widefat">
|
2583 |
<thead>
|
2584 |
<tr>
|
2585 |
+
<th id="cb" class="manage-column column-cb check-column" scope="col"><input type="checkbox" /></th>
|
2586 |
<th id="title" class="manage-column column-title" scope="col"><?php _e( 'Style', 'polldaddy' ); ?></th>
|
2587 |
<th id="date" class="manage-column column-date" scope="col"><?php _e( 'Last Modified', 'polldaddy' ); ?></th>
|
2588 |
</tr>
|
2596 |
$style_id = (int) $style->_id;
|
2597 |
|
2598 |
$class = $class ? '' : ' class="alternate"';
|
2599 |
+
$edit_link = esc_url( add_query_arg( array( 'action' => 'edit-style', 'style' => $style_id, 'message' => false ) ) );
|
2600 |
+
$delete_link = esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'delete-style', 'style' => $style_id, 'message' => false ) ), "delete-style_$style_id" ) );
|
2601 |
list( $style_time ) = explode( '.', $style->date );
|
2602 |
$style_time = strtotime( $style_time );
|
2603 |
?>
|
2606 |
<th class="check-column" scope="row"><input type="checkbox" value="<?php echo (int) $style_id; ?>" name="style[]" /></th>
|
2607 |
<td class="post-title column-title">
|
2608 |
<?php if ( $edit_link ) : ?>
|
2609 |
+
<strong><a class="row-title" href="<?php echo $edit_link; ?>"><?php echo esc_html( $style->title ); ?></a></strong>
|
2610 |
+
<div class="row-actions">
|
2611 |
<span class="edit"><a href="<?php echo $edit_link; ?>"><?php _e( 'Edit', 'polldaddy' ); ?></a> | </span>
|
2612 |
<?php else : ?>
|
2613 |
+
<strong><?php echo esc_html( $style->title ); ?></strong>
|
2614 |
<?php endif; ?>
|
2615 |
|
2616 |
<span class="delete"><a class="delete-poll delete" href="<?php echo $delete_link; ?>"><?php _e( 'Delete', 'polldaddy' ); ?></a></span>
|
2617 |
+
</div>
|
2618 |
</td>
|
2619 |
<td class="date column-date"><abbr title="<?php echo date( __( 'Y/m/d g:i:s A', 'polldaddy' ), $style_time ); ?>"><?php echo date( __( 'Y/m/d', 'polldaddy' ), $style_time ); ?></abbr></td>
|
2620 |
</tr>
|
2626 |
?>
|
2627 |
|
2628 |
<tr>
|
2629 |
+
<td colspan="4" id="empty-set">
|
2630 |
+
|
2631 |
+
<h3 style="margin-bottom:0px;"><?php _e( 'You haven\'t used our fancy style editor to create any custom styles!', 'polldaddy');?> </h3>
|
2632 |
+
<p style="margin-bottom:20px;"><?php _e( 'Why don\'t you go ahead and get started on that?', 'polldaddy' ); ?></p>
|
2633 |
+
<a href="<?php echo esc_url( add_query_arg( array( 'action' => 'create-style' ) ) ); ?>" class="button-primary"><?php _e( 'Create a Custom Style Now', 'polldaddy' ); ?></a>
|
2634 |
+
|
2635 |
+
</td>
|
2636 |
</tr>
|
2637 |
<?php endif; // $styles ?>
|
2638 |
|
2701 |
<div id="poststuff">
|
2702 |
<div id="post-body">
|
2703 |
<br/>
|
2704 |
+
<table>
|
2705 |
<tr>
|
2706 |
+
<td class="pd-editor-label">
|
2707 |
+
<label class="CSSE_title_label"><?php _e( 'Style Name', 'polldaddy' ); ?></label>
|
2708 |
+
</td>
|
2709 |
+
<td>
|
2710 |
+
<div id="titlediv" style="margin:0px;">
|
2711 |
+
<div id="titlewrap">
|
2712 |
+
<input type="text" autocomplete="off" value="<?php echo $style_id > 1000 ? $style->title : ''; ?>" tabindex="1" style="width:25em;" name="style-title" />
|
2713 |
+
</div>
|
2714 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
2715 |
</td>
|
2716 |
</tr>
|
2717 |
<tr>
|
2718 |
+
<td class="pd-editor-label">
|
2719 |
<label class="CSSE_title_label"><?php _e( 'Preload Basic Style', 'polldaddy' ); ?></label>
|
2720 |
</td>
|
2721 |
<td>
|
2730 |
<option value="117"><?php _e( 'Skull Light', 'polldaddy' ); ?></option>
|
2731 |
<option value="157"><?php _e( 'Micro', 'polldaddy' ); ?></option>
|
2732 |
</select>
|
2733 |
+
<a tabindex="4" id="style-preload" href="javascript:preload_pd_style();" class="button"><?php echo esc_attr( __( 'Load Style', 'polldaddy' ) ); ?></a>
|
2734 |
</div>
|
2735 |
</td>
|
2736 |
</tr>
|
2737 |
+
</table>
|
2738 |
+
|
2739 |
+
<h3><?php _e( 'Style Editor', 'polldaddy' ); ?></h3>
|
2740 |
+
|
2741 |
+
<table>
|
2742 |
<tr>
|
2743 |
+
<td class="pd-editor-label"><label for="styleName"><?php _e( 'Select a template part to edit:' ); ?></label></td>
|
|
|
|
|
2744 |
<td>
|
2745 |
<select id="styleName" onchange="renderStyleEdit(this.value);">
|
2746 |
<option value="pds-box" selected="selected"><?php _e( 'Poll Box', 'polldaddy' ); ?></option>
|
2755 |
<option value="pds-answer-feedback-bar"><?php _e( 'Result Bar', 'polldaddy' ); ?></option>
|
2756 |
<option value="pds-totalvotes-inner"><?php _e( 'Total Votes', 'polldaddy' ); ?></option>
|
2757 |
</select>
|
2758 |
+
|
2759 |
</td>
|
2760 |
</tr>
|
2761 |
+
|
2762 |
</table>
|
2763 |
+
|
2764 |
+
|
2765 |
<table width="100%">
|
2766 |
<tr>
|
2767 |
<td valign="top">
|
3386 |
</td>
|
3387 |
<td width="10"> </td>
|
3388 |
<td valign="top">
|
3389 |
+
<div style="overflow-x:auto;">
|
3390 |
<!-- POLL XHTML START -->
|
3391 |
<div class="pds-box" id="pds-box">
|
3392 |
<div class="pds-box-outer">
|
3527 |
<?php wp_nonce_field( $style_id > 1000 ? "edit-style$style_id" : 'create-style' ); ?>
|
3528 |
<input type="hidden" name="action" value="<?php echo $style_id > 1000 ? 'edit-style' : 'create-style'; ?>" />
|
3529 |
<input type="hidden" class="polldaddy-style-id" name="style" value="<?php echo $style_id; ?>" />
|
3530 |
+
<input type="submit" class="button-primary" value="<?php echo esc_attr( __( 'Save Style', 'polldaddy' ) ); ?>" />
|
3531 |
<?php if ( $style_id > 1000 ) { ?>
|
3532 |
+
<input name="updatePollCheck" id="updatePollCheck" type="checkbox"> <label for="updatePollCheck"><?php _e( 'Check this box if you wish to update the polls that use this style.', 'polldaddy' ); ?></label>
|
3533 |
<?php } ?>
|
3534 |
</p>
|
3535 |
</div>
|
3578 |
$updated = false;
|
3579 |
|
3580 |
if ( isset( $rating ) ) {
|
3581 |
+
switch ( $rating ) {
|
3582 |
case 'pages':
|
3583 |
$report_type = 'pages';
|
3584 |
$rating_id = (int) get_option( 'pd-rating-pages-id' );
|
3591 |
$report_type = 'posts';
|
3592 |
$rating_id = (int) get_option( 'pd-rating-posts-id' );
|
3593 |
break;
|
3594 |
+
}//end switch
|
3595 |
}
|
3596 |
|
3597 |
$new_type = 0;
|
3637 |
}
|
3638 |
|
3639 |
if ( empty( $pd_rating ) ) { //something's up!
|
3640 |
+
echo '<div class="error" id="polldaddy"><p>'.sprintf( __( 'Sorry! There was an error creating your rating widget. Please contact <a href="%1$s" %2$s>Polldaddy support</a> to fix this.', 'polldaddy' ), 'http://polldaddy.com/feedback/', 'target="_blank"' ) . '</p></div>';
|
3641 |
$error = true;
|
3642 |
} else {
|
3643 |
$rating_id = (int) $pd_rating->_id;
|
3644 |
update_option ( 'pd-rating-' . $report_type . '-id', $rating_id );
|
3645 |
update_option ( 'pd-rating-' . $report_type, 0 );
|
3646 |
|
3647 |
+
switch ( $report_type ) {
|
3648 |
case 'posts':
|
3649 |
$show_posts = 0;
|
3650 |
break;
|
3654 |
case 'comments':
|
3655 |
$show_comments = 0;
|
3656 |
break;
|
3657 |
+
}//end switch
|
3658 |
}
|
3659 |
}
|
3660 |
|
3661 |
if ( isset( $_POST[ 'pd_rating_action_type' ] ) ) {
|
3662 |
|
3663 |
+
switch ( $_POST[ 'pd_rating_action_type' ] ) {
|
3664 |
case 'posts' :
|
3665 |
if ( isset( $_POST[ 'pd_show_posts' ] ) && (int) $_POST[ 'pd_show_posts' ] == 1 )
|
3666 |
$show_posts = get_option( 'pd-rating-posts-id' );
|
3669 |
|
3670 |
if ( isset( $_POST[ 'pd_show_posts_index' ] ) && (int) $_POST[ 'pd_show_posts_index' ] == 1 )
|
3671 |
$show_posts_index = get_option( 'pd-rating-posts-id' );
|
3672 |
+
|
3673 |
update_option( 'pd-rating-posts-index', $show_posts_index );
|
3674 |
+
|
3675 |
if ( isset( $_POST[ 'posts_pos' ] ) && (int) $_POST[ 'posts_pos' ] == 1 )
|
3676 |
$pos_posts = 1;
|
3677 |
+
|
3678 |
update_option( 'pd-rating-posts-pos', $pos_posts );
|
3679 |
+
|
3680 |
if ( isset( $_POST[ 'posts_index_pos' ] ) && (int) $_POST[ 'posts_index_pos' ] == 1 )
|
3681 |
$pos_posts_index = 1;
|
3682 |
+
|
3683 |
update_option( 'pd-rating-posts-index-pos', $pos_posts_index );
|
3684 |
$rating_updated = true;
|
3685 |
break;
|
3686 |
+
|
3687 |
case 'pages';
|
3688 |
if ( isset( $_POST[ 'pd_show_pages' ] ) && (int) $_POST[ 'pd_show_pages' ] == 1 )
|
3689 |
$show_pages = get_option( 'pd-rating-pages-id' );
|
3690 |
+
|
3691 |
update_option( 'pd-rating-pages', $show_pages );
|
3692 |
+
|
3693 |
if ( isset( $_POST[ 'pages_pos' ] ) && (int) $_POST[ 'pages_pos' ] == 1 )
|
3694 |
$pos_pages = 1;
|
3695 |
+
|
3696 |
update_option( 'pd-rating-pages-pos', $pos_pages );
|
3697 |
$rating_updated = true;
|
3698 |
break;
|
3699 |
+
|
3700 |
case 'comments':
|
3701 |
if ( isset( $_POST[ 'pd_show_comments' ] ) && (int) $_POST[ 'pd_show_comments' ] == 1 )
|
3702 |
$show_comments = get_option( 'pd-rating-comments-id' );
|
3703 |
+
|
3704 |
update_option( 'pd-rating-comments', $show_comments );
|
3705 |
+
|
3706 |
if ( isset( $_POST[ 'comments_pos' ] ) && (int) $_POST[ 'comments_pos' ] == 1 )
|
3707 |
$pos_comments = 1;
|
3708 |
+
|
3709 |
update_option( 'pd-rating-comments-pos', $pos_comments );
|
3710 |
+
|
3711 |
$rating_updated = true;
|
3712 |
break;
|
3713 |
+
}//end switch
|
3714 |
}
|
3715 |
|
3716 |
$show_posts = (int) get_option( 'pd-rating-posts' );
|
3740 |
$settings->font_color = '#000000';
|
3741 |
}?>
|
3742 |
<div class="wrap">
|
3743 |
+
<h2 id="poll-list-header"><?php _e( 'Ratings Setup', 'polldaddy' ); ?></h2><?php
|
3744 |
if ( $rating_updated )
|
3745 |
echo '<div class="updated"><p>'.__( 'Rating updated', 'polldaddy' ).'</p></div>';
|
3746 |
|
3749 |
<div id="categorydiv" class="categorydiv">
|
3750 |
<ul id="category-tabs" class="category-tabs"><?php
|
3751 |
$this_class = '';
|
3752 |
+
$posts_link = esc_url( add_query_arg( array( 'rating' => 'posts', 'message' => false ) ) );
|
3753 |
+
$pages_link = esc_url( add_query_arg( array( 'rating' => 'pages', 'message' => false ) ) );
|
3754 |
+
$comments_link = esc_url( add_query_arg( array( 'rating' => 'comments', 'message' => false ) ) );
|
3755 |
if ( $report_type == 'posts' )
|
3756 |
$this_class = ' class="tabs"';?>
|
3757 |
<li <?php echo $this_class; ?>><a tabindex="3" href="<?php echo $posts_link; ?>"><?php _e( 'Posts', 'polldaddy' );?></a></li><?php
|
3876 |
<div class="postbox" id="submitdiv">
|
3877 |
<h3><?php _e( 'Save', 'polldaddy' );?></h3>
|
3878 |
<div class="inside">
|
3879 |
+
<div id="major- -actions">
|
3880 |
<input type="hidden" name="type" value="<?php echo $report_type; ?>" />
|
3881 |
<input type="hidden" name="rating_id" value="<?php echo $rating_id; ?>" />
|
3882 |
<input type="hidden" name="action" value="update-rating" />
|
3904 |
<td><p style="margin-bottom: 0px;"><?php _e( 'Vote', 'polldaddy' );?></p></td>
|
3905 |
</tr>
|
3906 |
<tr>
|
3907 |
+
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_vote" id="text_vote" value="<?php echo empty( $settings->text_vote ) ? 'Vote' : esc_html( $settings->text_vote ); ?>" maxlength="20" />
|
3908 |
</tr>
|
3909 |
<tr>
|
3910 |
<td><p style="margin-bottom: 0px;"><?php _e( 'Votes', 'polldaddy' );?></p></td>
|
3911 |
</tr>
|
3912 |
<tr>
|
3913 |
+
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_votes" id="text_votes" value="<?php echo empty( $settings->text_votes ) ? 'Votes' : esc_html( $settings->text_votes ); ?>" maxlength="20" />
|
3914 |
</tr>
|
3915 |
<tr>
|
3916 |
<td><p style="margin-bottom: 0px;"><?php _e( 'Rate This', 'polldaddy' );?></p></td>
|
3917 |
</tr>
|
3918 |
<tr>
|
3919 |
+
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_rate_this" id="text_rate_this" value="<?php echo empty( $settings->text_rate_this ) ? 'Rate This' : esc_html( $settings->text_rate_this ); ?>" maxlength="20" />
|
3920 |
</tr>
|
3921 |
<tr>
|
3922 |
<td><p style="margin-bottom: 0px;"><?php printf( __( '%d star', 'polldaddy' ), 1 );?></p></td>
|
3923 |
</tr>
|
3924 |
<tr>
|
3925 |
+
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_1_star" id="text_1_star" value="<?php echo empty( $settings->text_1_star ) ? '1 star' : esc_html( $settings->text_1_star ); ?>" maxlength="20" />
|
3926 |
</tr>
|
3927 |
<tr>
|
3928 |
<td><p style="margin-bottom: 0px;"><?php printf( __( '%d stars', 'polldaddy' ), 2 );?></p></td>
|
3929 |
</tr>
|
3930 |
<tr>
|
3931 |
+
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_2_star" id="text_2_star" value="<?php echo empty( $settings->text_2_star ) ? '2 stars' : esc_html( $settings->text_2_star ); ?>" maxlength="20" />
|
3932 |
</tr>
|
3933 |
<tr>
|
3934 |
<td><p style="margin-bottom: 0px;"><?php printf( __( '%d stars', 'polldaddy' ), 3 );?></p></td>
|
3935 |
</tr>
|
3936 |
<tr>
|
3937 |
+
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_3_star" id="text_3_star" value="<?php echo empty( $settings->text_3_star ) ? '3 stars' : esc_html( $settings->text_3_star ); ?>" maxlength="20" />
|
3938 |
</tr>
|
3939 |
<tr>
|
3940 |
<td><p style="margin-bottom: 0px;"><?php printf( __( '%d stars', 'polldaddy' ), 4 );?></p></td>
|
3941 |
</tr>
|
3942 |
<tr>
|
3943 |
+
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_4_star" id="text_4_star" value="<?php echo empty( $settings->text_4_star ) ? '4 stars' : esc_html( $settings->text_4_star ); ?>" maxlength="20" />
|
3944 |
</tr>
|
3945 |
<tr>
|
3946 |
<td><p style="margin-bottom: 0px;"><?php printf( __( '%d stars', 'polldaddy' ), 5 );?></p></td>
|
3947 |
</tr>
|
3948 |
<tr>
|
3949 |
+
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_5_star" id="text_5_star" value="<?php echo empty( $settings->text_5_star ) ? '5 stars' : esc_html( $settings->text_5_star ); ?>" maxlength="20" />
|
3950 |
</tr>
|
3951 |
<tr>
|
3952 |
<td><p style="margin-bottom: 0px;"><?php _e( 'Thank You', 'polldaddy' );?></p></td>
|
3953 |
</tr>
|
3954 |
<tr>
|
3955 |
+
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_thank_you" id="text_thank_you" value="<?php echo empty( $settings->text_thank_you ) ? 'Thank You' : esc_html( $settings->text_thank_you ); ?>" maxlength="20" />
|
3956 |
</tr>
|
3957 |
<tr>
|
3958 |
<td><p style="margin-bottom: 0px;"><?php _e( 'Rate Up', 'polldaddy' );?></p></td>
|
3959 |
</tr>
|
3960 |
<tr>
|
3961 |
+
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_rate_up" id="text_rate_up" value="<?php echo empty( $settings->text_rate_up ) ? 'Rate Up' : esc_html( $settings->text_rate_up ); ?>" maxlength="20" />
|
3962 |
</tr>
|
3963 |
<tr>
|
3964 |
<td><p style="margin-bottom: 0px;"><?php _e( 'Rate Down', 'polldaddy' );?></p></td>
|
3965 |
</tr>
|
3966 |
<tr>
|
3967 |
+
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_rate_down" id="text_rate_down" value="<?php echo empty( $settings->text_rate_down ) ? 'Rate Down' : esc_html( $settings->text_rate_down ); ?>" maxlength="20" />
|
3968 |
</tr>
|
3969 |
<tr>
|
3970 |
<td><p style="margin-bottom: 0px;"><?php _e( 'Most Popular Content', 'polldaddy' );?></p></td>
|
3971 |
</tr>
|
3972 |
<tr>
|
3973 |
+
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_popcontent" id="text_popcontent" value="<?php echo empty( $settings->text_popcontent ) ? 'Most Popular Content' : esc_html( $settings->text_popcontent ); ?>" maxlength="20" />
|
3974 |
</tr>
|
3975 |
<tr>
|
3976 |
<td><p style="margin-bottom: 0px;"><?php _e( 'Close', 'polldaddy' );?></p></td>
|
3977 |
</tr>
|
3978 |
<tr>
|
3979 |
+
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_close" id="text_close" value="<?php echo empty( $settings->text_close ) ? 'Close' : esc_html( $settings->text_close ); ?>" maxlength="20" />
|
3980 |
</tr>
|
3981 |
<tr>
|
3982 |
<td><p style="margin-bottom: 0px;"><?php _e( 'All', 'polldaddy' );?></p></td>
|
3983 |
</tr>
|
3984 |
<tr>
|
3985 |
+
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_all" id="text_all" value="<?php echo empty( $settings->text_all ) ? 'All' : esc_html( $settings->text_all ); ?>" maxlength="20" />
|
3986 |
</tr>
|
3987 |
<tr>
|
3988 |
<td><p style="margin-bottom: 0px;"><?php _e( 'Today', 'polldaddy' );?></p></td>
|
3989 |
</tr>
|
3990 |
<tr>
|
3991 |
+
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_today" id="text_today" value="<?php echo empty( $settings->text_today ) ? 'Today' : esc_html( $settings->text_today ); ?>" maxlength="20" />
|
3992 |
</tr>
|
3993 |
<tr>
|
3994 |
<td><p style="margin-bottom: 0px;"><?php _e( 'This Week', 'polldaddy' );?></p></td>
|
3995 |
</tr>
|
3996 |
<tr>
|
3997 |
+
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_thisweek" id="text_thisweek" value="<?php echo empty( $settings->text_thisweek ) ? 'This Week' : esc_html( $settings->text_thisweek ); ?>" maxlength="20" />
|
3998 |
</tr>
|
3999 |
<tr>
|
4000 |
<td><p style="margin-bottom: 0px;"><?php _e( 'This Month', 'polldaddy' );?></p></td>
|
4001 |
</tr>
|
4002 |
<tr>
|
4003 |
+
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_thismonth" id="text_thismonth" value="<?php echo empty( $settings->text_thismonth ) ? 'This Month' : esc_html( $settings->text_thismonth ); ?>" maxlength="20" />
|
4004 |
</tr>
|
4005 |
<tr>
|
4006 |
<td><p style="margin-bottom: 0px;"><?php _e( 'Rated', 'polldaddy' );?></p></td>
|
4007 |
</tr>
|
4008 |
<tr>
|
4009 |
+
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_rated" id="text_rated" value="<?php echo empty( $settings->text_rated ) ? 'Rated' : esc_html( $settings->text_rated ); ?>" maxlength="20" />
|
4010 |
</tr>
|
4011 |
<tr>
|
4012 |
<td><p style="margin-bottom: 0px;"><?php _e( 'There are no rated items for this period', 'polldaddy' );?></p></td>
|
4013 |
</tr>
|
4014 |
<tr>
|
4015 |
+
<td><input onblur="pd_bind(this);" type="text" style="width: 100%;" name="text_noratings" id="text_noratings" value="<?php echo empty( $settings->text_noratings ) ? 'There are no rated items for this period' : esc_html( $settings->text_noratings ); ?>" maxlength="50" />
|
4016 |
</tr>
|
4017 |
</table>
|
4018 |
</div>
|
4088 |
</tr>
|
4089 |
<tr>
|
4090 |
<td height="30"><?php _e( 'Custom Image', 'polldaddy' );?></td>
|
4091 |
+
<td><input type="text" onblur="pd_bind(this);" name="custom_star" id="custom_star" value="<?php echo esc_url( $settings->custom_star ); ?>" maxlength="200" />
|
4092 |
</tr>
|
4093 |
</table>
|
4094 |
</div>
|
4141 |
</tr>
|
4142 |
<tr>
|
4143 |
<td height="30"><?php _e( 'Color', 'polldaddy' );?></td>
|
4144 |
+
<td><input type="text" onblur="pd_bind(this);" class="elmColor jscolor-picker" name="font_color" id="font_color" value="<?php echo esc_html( $settings->font_color ); ?>" maxlength="11" autocomplete="off"/>
|
4145 |
</td>
|
4146 |
</tr>
|
4147 |
<tr>
|
4209 |
</td>
|
4210 |
</tr><?php
|
4211 |
if ( $report_type == 'posts' ) {
|
4212 |
+
$exclude_post_ids = esc_html( get_option( 'pd-rating-exclude-post-ids' ) ); ?>
|
4213 |
<tr>
|
4214 |
<td width="100" height="30"><?php _e( 'Rating ID', 'polldaddy' );?></td>
|
4215 |
<td>
|
4232 |
</span>
|
4233 |
</td>
|
4234 |
</tr><?php
|
4235 |
+
} elseif ( $report_type == 'pages' ) {
|
4236 |
+
$exclude_page_ids = esc_html( get_option( 'pd-rating-exclude-page-ids' ) ); ?>
|
4237 |
<tr>
|
4238 |
<td width="100" height="30"><?php _e( 'Rating ID', 'polldaddy' );?></td>
|
4239 |
<td>
|
4256 |
</span>
|
4257 |
</td>
|
4258 |
</tr><?php
|
4259 |
+
} elseif ( $report_type == 'comments' ) { ?>
|
4260 |
<tr>
|
4261 |
<td width="100" height="30"><?php _e( 'Rating ID', 'polldaddy' );?></td>
|
4262 |
<td>
|
4268 |
</span>
|
4269 |
</td>
|
4270 |
</tr><?php
|
4271 |
+
} ?>
|
4272 |
</table>
|
4273 |
</div>
|
4274 |
</div>
|
4318 |
$new_rating_id = (int) $_REQUEST['polldaddy-post-rating-id'];
|
4319 |
$type = 'posts';
|
4320 |
}
|
4321 |
+
elseif ( isset( $_REQUEST['polldaddy-page-rating-id'] ) ) {
|
4322 |
+
$new_rating_id = (int) $_REQUEST['polldaddy-page-rating-id'];
|
4323 |
+
$type = 'pages';
|
4324 |
+
}
|
4325 |
+
elseif ( isset( $_REQUEST['polldaddy-comment-rating-id'] ) ) {
|
4326 |
+
$new_rating_id = (int) $_REQUEST['polldaddy-comment-rating-id'];
|
4327 |
+
$type = 'comments';
|
4328 |
+
} else {
|
4329 |
$new_rating_id = $rating_id;
|
4330 |
}
|
4331 |
|
4334 |
$set->type = 'stars';
|
4335 |
$rating_type = 0;
|
4336 |
if ( isset( $_REQUEST['star_color'] ) )
|
4337 |
+
$set->star_color = esc_attr( $_REQUEST['star_color'] );
|
4338 |
} else {
|
4339 |
$set->type = 'nero';
|
4340 |
$rating_type = 1;
|
4341 |
if ( isset( $_REQUEST['nero_style'] ) )
|
4342 |
+
$set->star_color = esc_attr( $_REQUEST['nero_style'] );
|
4343 |
}
|
4344 |
|
4345 |
+
$set->size = esc_html( $_REQUEST['size'], 1 );
|
4346 |
+
$set->custom_star = esc_html( esc_url( $_REQUEST['custom_star'] ) , 1 );
|
4347 |
+
$set->font_align = esc_html( $_REQUEST['font_align'], 1 );
|
4348 |
+
$set->font_position = esc_html( $_REQUEST['font_position'], 1 );
|
4349 |
+
$set->font_family = esc_html( $_REQUEST['font_family'], 1 );
|
4350 |
+
$set->font_size = esc_html( $_REQUEST['font_size'], 1 );
|
4351 |
+
$set->font_line_height = esc_html( $_REQUEST['font_line_height'], 1 );
|
4352 |
|
4353 |
if ( isset( $_REQUEST['font_bold'] ) && $_REQUEST['font_bold'] == 'bold' )
|
4354 |
$set->font_bold = 'bold';
|
4360 |
else
|
4361 |
$set->font_italic = 'normal';
|
4362 |
|
4363 |
+
$set->text_vote = stripslashes( esc_html( $_REQUEST['text_vote'], 1 ) );
|
4364 |
+
$set->text_votes = stripslashes( esc_html( $_REQUEST['text_votes'], 1 ) );
|
4365 |
+
$set->text_rate_this = stripslashes( esc_html( $_REQUEST['text_rate_this'], 1 ) );
|
4366 |
+
$set->text_1_star = stripslashes( esc_html( $_REQUEST['text_1_star'], 1 ) );
|
4367 |
+
$set->text_2_star = stripslashes( esc_html( $_REQUEST['text_2_star'], 1 ) );
|
4368 |
+
$set->text_3_star = stripslashes( esc_html( $_REQUEST['text_3_star'], 1 ) );
|
4369 |
+
$set->text_4_star = stripslashes( esc_html( $_REQUEST['text_4_star'], 1 ) );
|
4370 |
+
$set->text_5_star = stripslashes( esc_html( $_REQUEST['text_5_star'], 1 ) );
|
4371 |
+
$set->text_thank_you = stripslashes( esc_html( $_REQUEST['text_thank_you'], 1 ) );
|
4372 |
+
$set->text_rate_up = stripslashes( esc_html( $_REQUEST['text_rate_up'], 1 ) );
|
4373 |
+
$set->text_rate_down = stripslashes( esc_html( $_REQUEST['text_rate_down'], 1 ) );
|
4374 |
+
$set->font_color = stripslashes( esc_html( $_REQUEST['font_color'], 1 ) );
|
4375 |
+
|
4376 |
+
$set->text_popcontent= stripslashes( esc_html( $_REQUEST['text_popcontent'], 1 ) );
|
4377 |
+
$set->text_close = stripslashes( esc_html( $_REQUEST['text_close'], 1 ) );
|
4378 |
+
$set->text_all = stripslashes( esc_html( $_REQUEST['text_all'], 1 ) );
|
4379 |
+
$set->text_today = stripslashes( esc_html( $_REQUEST['text_today'], 1 ) );
|
4380 |
+
$set->text_thisweek = stripslashes( esc_html( $_REQUEST['text_thisweek'], 1 ) );
|
4381 |
+
$set->text_thismonth = stripslashes( esc_html( $_REQUEST['text_thismonth'], 1 ) );
|
4382 |
+
$set->text_rated = stripslashes( esc_html( $_REQUEST['text_rated'], 1 ) );
|
4383 |
+
$set->text_noratings = stripslashes( esc_html( $_REQUEST['text_noratings'], 1 ) );
|
4384 |
|
4385 |
|
4386 |
$set->popup = 'off';
|
4393 |
$polldaddy->reset();
|
4394 |
$rating = $polldaddy->update_rating( $rating_id, $settings_text, $rating_type );
|
4395 |
}
|
4396 |
+
elseif ( $this->is_admin && $new_rating_id > 0 ) {
|
4397 |
+
switch ( $type ) {
|
4398 |
+
case 'pages':
|
4399 |
+
update_option( 'pd-rating-pages-id', $new_rating_id );
|
4400 |
+
if ( (int) get_option( 'pd-rating-pages' ) > 0 )
|
4401 |
+
update_option( 'pd-rating-pages', $new_rating_id );
|
4402 |
+
break;
|
4403 |
+
case 'comments':
|
4404 |
+
update_option( 'pd-rating-comments-id', $new_rating_id );
|
4405 |
+
if ( (int) get_option( 'pd-rating-comments' ) > 0 )
|
4406 |
+
update_option( 'pd-rating-comments', $new_rating_id );
|
4407 |
+
break;
|
4408 |
+
case 'posts':
|
4409 |
+
update_option( 'pd-rating-posts-id', $new_rating_id );
|
4410 |
+
if ( (int) get_option( 'pd-rating-posts' ) > 0 )
|
4411 |
+
update_option( 'pd-rating-posts', $new_rating_id );
|
|
|
4412 |
}
|
4413 |
+
}
|
4414 |
|
4415 |
if ( $this->is_admin ) {
|
4416 |
if ( $type=='posts' && isset( $_REQUEST['exclude-post-ids'] ) ) {
|
4463 |
$show_rating = 0;
|
4464 |
|
4465 |
if ( isset( $_REQUEST['change-report-to'] ) ) {
|
4466 |
+
switch ( $_REQUEST['change-report-to'] ) {
|
4467 |
case 'pages':
|
4468 |
$report_type = 'pages';
|
4469 |
$rating_id = (int) get_option( 'pd-rating-pages-id' );
|
4470 |
break;
|
4471 |
+
|
4472 |
case 'comments':
|
4473 |
$report_type = 'comments';
|
4474 |
$rating_id = get_option( 'pd-rating-comments-id' );
|
4475 |
break;
|
4476 |
+
|
4477 |
case 'posts':
|
4478 |
$report_type = 'posts';
|
4479 |
$rating_id = get_option( 'pd-rating-posts-id' );
|
4480 |
break;
|
4481 |
+
}//end switch
|
4482 |
}
|
4483 |
|
4484 |
if ( isset( $_REQUEST['filter'] ) && $_REQUEST['filter'] ) {
|
4485 |
+
switch ( $_REQUEST['filter'] ) {
|
4486 |
case '1':
|
4487 |
$period = '1';
|
4488 |
break;
|
4490 |
case '7':
|
4491 |
$period = '7';
|
4492 |
break;
|
4493 |
+
|
4494 |
case '31':
|
4495 |
$period = '31';
|
4496 |
break;
|
4497 |
+
|
4498 |
case '90':
|
4499 |
$period = '90';
|
4500 |
break;
|
4501 |
+
|
4502 |
case '365':
|
4503 |
$period = '365';
|
4504 |
break;
|
4505 |
+
|
4506 |
case 'all':
|
4507 |
$period = 'all';
|
4508 |
break;
|
4509 |
+
}//end switch
|
4510 |
}
|
4511 |
|
4512 |
$page_size = 15;
|
4546 |
) );
|
4547 |
?>
|
4548 |
<div class="wrap">
|
4549 |
+
<h2 id="polldaddy-header"><?php _e( 'Rating Reports', 'polldaddy' );?> </h2>
|
4550 |
<div class="clear"></div>
|
4551 |
<form method="post" action="admin.php?page=ratings&action=reports">
|
4552 |
<div class="tablenav">
|
4608 |
$alt = '';
|
4609 |
|
4610 |
foreach ( $ratings as $rating ) :
|
4611 |
+
$delete_link = esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'delete', 'id' => $rating_id, 'rating' => $rating->uid, 'change-report-to' => $report_type, 'message' => false ) ), "delete-rating_$rating->uid" ) );
|
4612 |
$alt_counter++;?>
|
4613 |
<tr <?php echo ( $alt_counter & 1 ) ? ' class="alternate"' : ''; ?>>
|
4614 |
+
<th class="check-column" scope="row"><input type="checkbox" value="<?php echo esc_html( $rating->uid ); ?>" name="rating[]" /></th>
|
4615 |
<td class="post-title column-title">
|
4616 |
+
<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>
|
4617 |
<div class="row-actions">
|
4618 |
<?php if ( $delete_link ) { ?>
|
4619 |
<span class="delete"><a class="delete-rating delete" href="<?php echo $delete_link; ?>"><?php _e( 'Delete', 'polldaddy' ); ?></a></span>
|
4621 |
</div>
|
4622 |
</td>
|
4623 |
<td class="column-id">
|
4624 |
+
<?php echo esc_html( $rating->uid ); ?>
|
4625 |
</td>
|
4626 |
<td class="date column-date">
|
4627 |
+
<abbr title="<?php echo date( __( 'Y/m/d g:i:s A', 'polldaddy' ), $rating->date ); ?>"><?php echo str_replace( '-', '/', substr( esc_html( $rating->date ), 0, 10 ) ); ?></abbr>
|
4628 |
</td>
|
4629 |
<td class="column-vote num"><?php echo number_format( $rating->_votes ); ?></td>
|
4630 |
<td class="column-rating num"><table width="100%"><tr align="center"><td style="border:none;"><?php
|
4687 |
|
4688 |
function plugin_options() {
|
4689 |
if ( isset( $_POST['polldaddy_email'] ) ) {
|
4690 |
+
$account_email = esc_attr( $_POST['polldaddy_email'] );
|
4691 |
}
|
4692 |
else {
|
4693 |
$polldaddy = $this->get_client( WP_POLLDADDY__PARTNERGUID, $this->user_code );
|
4694 |
$account = $polldaddy->get_account();
|
4695 |
|
4696 |
if ( !empty( $account ) )
|
4697 |
+
$account_email = esc_attr( $account->email );
|
4698 |
|
4699 |
$polldaddy->reset();
|
4700 |
$poll = $polldaddy->get_poll( 1 );
|
4777 |
</h2>
|
4778 |
<?php if ( $this->is_admin || $this->multiple_accounts ) {?>
|
4779 |
<h3>
|
4780 |
+
<?php _e( 'Polldaddy Account Info', 'polldaddy' ); ?>
|
4781 |
</h3>
|
4782 |
<p>
|
4783 |
<?php _e( 'This is the PollDadddy account you currently have imported into your WordPress account', 'polldaddy' ); ?>.
|
4788 |
<tr class="form-field form-required">
|
4789 |
<th valign="top" scope="row">
|
4790 |
<label for="polldaddy-email">
|
4791 |
+
<?php _e( 'Polldaddy Email Address', 'polldaddy' ); ?>
|
4792 |
</label>
|
4793 |
</th>
|
4794 |
<td>
|
4798 |
<tr class="form-field form-required">
|
4799 |
<th valign="top" scope="row">
|
4800 |
<label for="polldaddy-password">
|
4801 |
+
<?php _e( 'Polldaddy Password', 'polldaddy' ); ?>
|
4802 |
</label>
|
4803 |
</th>
|
4804 |
<td>
|
4811 |
<?php wp_nonce_field( 'polldaddy-account' ); ?>
|
4812 |
<input type="hidden" name="action" value="import-account" />
|
4813 |
<input type="hidden" name="account" value="import" />
|
4814 |
+
<input type="submit" class="button-primary" style="padding:3px 8px;" value="<?php echo esc_attr( __( 'Import Account', 'polldaddy' ) ); ?>" />
|
4815 |
</p>
|
4816 |
</form>
|
4817 |
<br />
|
4850 |
if ( $poll->sharing == 'yes' )
|
4851 |
$selected = 'checked="checked"';?>
|
4852 |
<label for="sharing"><input type="checkbox" <?php echo $selected; ?> value="1" id="sharing" name="sharing"> <?php _e( 'Sharing', 'polldaddy' ); ?></label>
|
4853 |
+
<br class="clear" />
|
4854 |
+
<div class="field">
|
4855 |
+
<label for="resultsType" class="pd-label">
|
4856 |
+
<?php _e( 'Results Display', 'polldaddy' ); ?></label>
|
4857 |
<select id="resultsType" name="resultsType">
|
4858 |
<option <?php echo $poll->resultsType == 'show' ? 'selected="selected"':''; ?> value="show"><?php _e( 'Show', 'polldaddy' ); ?></option>
|
4859 |
<option <?php echo $poll->resultsType == 'hide' ? 'selected="selected"':''; ?> value="hide"><?php _e( 'Hide', 'polldaddy' ); ?></option>
|
4860 |
<option <?php echo $poll->resultsType == 'percent' ? 'selected="selected"':''; ?> value="percent"><?php _e( 'Percentages', 'polldaddy' ); ?></option>
|
4861 |
+
</select>
|
4862 |
+
</div>
|
4863 |
+
<br class="clear" />
|
4864 |
+
<div class="field">
|
4865 |
+
<label for="styleID" class="pd-label">
|
4866 |
+
<?php _e( 'Poll style', 'polldaddy' ); ?></label>
|
4867 |
<select id="styleID" name="styleID"><?php
|
4868 |
foreach ( (array) $options as $styleID => $label ) :
|
4869 |
$selected = $styleID == $poll->styleID ? ' selected="selected"' : ''; ?>
|
4870 |
+
<option value="<?php echo (int) $styleID; ?>"<?php echo $selected; ?>><?php echo esc_html( $label ); ?></option><?php
|
4871 |
endforeach;?>
|
4872 |
+
</select>
|
4873 |
+
</div>
|
4874 |
+
</div>
|
4875 |
+
<br class="clear" />
|
4876 |
+
<div class="field">
|
4877 |
+
<label for="blockRepeatVotersType" class="pd-label">
|
4878 |
+
<?php _e( 'Repeat Voting', 'polldaddy' ); ?></label>
|
4879 |
<select id="poll-block-repeat" name="blockRepeatVotersType">
|
4880 |
<option <?php echo $poll->blockRepeatVotersType == 'off' ? 'selected="selected"':''; ?> value="off"><?php _e( 'Off', 'polldaddy' ); ?></option>
|
4881 |
<option <?php echo $poll->blockRepeatVotersType == 'cookie' ? 'selected="selected"':''; ?> value="cookie"><?php _e( 'Cookie', 'polldaddy' ); ?></option>
|
4882 |
<option <?php echo $poll->blockRepeatVotersType == 'cookieip' ? 'selected="selected"':''; ?> value="cookieip"><?php _e( 'Cookie & IP address', 'polldaddy' ); ?></option>
|
4883 |
+
</select>
|
4884 |
+
</div>
|
4885 |
+
<br class="clear" />
|
4886 |
+
<div class="field">
|
4887 |
+
|
4888 |
+
<label for="blockExpiration" class="pd-label"><?php _e( 'Block expiration limit', 'polldaddy' ); ?></label>
|
4889 |
+
|
4890 |
+
|
4891 |
<select id="blockExpiration" name="blockExpiration">
|
4892 |
<option value="0" <?php echo $poll->blockExpiration == 0 ? 'selected="selected"':''; ?>><?php _e( 'Never', 'polldaddy' ); ?></option>
|
4893 |
<option value="3600" <?php echo $poll->blockExpiration == 3600 ? 'selected="selected"':''; ?>><?php printf( __( '%d hour', 'polldaddy' ), 1 ); ?></option>
|
4894 |
<option value="10800" <?php echo (int) $poll->blockExpiration == 10800 ? 'selected="selected"' : ''; ?>><?php printf( __( '%d hours', 'polldaddy' ), 3 ); ?></option>
|
4895 |
+
<option value="21600" <?php echo (int) $poll->blockExpiration == 21600 ? 'selected="selected"' : ''; ?>><?php printf( __( '%d hours', 'polldaddy' ), 6 ); ?></option>
|
4896 |
+
<option value="43200" <?php echo (int) $poll->blockExpiration == 43200 ? 'selected="selected"' : ''; ?>><?php printf( __( '%d hours', 'polldaddy' ), 12 ); ?></option>
|
4897 |
+
<option value="86400" <?php echo (int) $poll->blockExpiration == 86400 ? 'selected="selected"' : ''; ?>><?php printf( __( '%d day', 'polldaddy' ), 1 ); ?></option>
|
4898 |
+
<option value="604800" <?php echo (int) $poll->blockExpiration == 604800 ? 'selected="selected"' : ''; ?>><?php printf( __( '%d week', 'polldaddy' ), 1 ); ?></option>
|
4899 |
+
<option value="2419200" <?php echo (int) $poll->blockExpiration == 2419200 ? 'selected="selected"' : ''; ?>><?php printf( __( '%d month', 'polldaddy' ), 1 ); ?></option>
|
4900 |
+
</select>
|
4901 |
+
</div>
|
4902 |
+
</div>
|
4903 |
+
<br class="clear" />
|
4904 |
</fieldset>
|
4905 |
</td>
|
4906 |
</tr>
|
4910 |
<p class="submit">
|
4911 |
<?php wp_nonce_field( 'polldaddy-account' ); ?>
|
4912 |
<input type="hidden" name="action" value="update-options" />
|
4913 |
+
<input type="submit" class="button-primary" style="padding:3px 8px;" value="<?php echo esc_attr( __( 'Save Options', 'polldaddy' ) ); ?>" />
|
4914 |
</p>
|
4915 |
</form>
|
4916 |
</div>
|
4946 |
}
|
4947 |
|
4948 |
require 'rating.php';
|
4949 |
+
require 'ajax.php';
|
4950 |
+
require 'popups.php';
|
4951 |
require 'polldaddy-org.php';
|
popups.php
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
function pd_video_shortcodes_help($video_form) {
|
3 |
+
return '
|
4 |
+
<table class="describe"><tbody>
|
5 |
+
<tr>
|
6 |
+
<th valign="top" scope="row" class="label">
|
7 |
+
<span class="alignleft"><label for="insertonly[href]">' . __('URL') . '</label></span>
|
8 |
+
<span class="alignright"><abbr title="required" class="required">*</abbr></span>
|
9 |
+
</th>
|
10 |
+
<td class="field"><input type="text" id="insertonly[href]" name="insertonly[href]" value="" /></td>
|
11 |
+
</tr>
|
12 |
+
<tr>
|
13 |
+
<td colspan="2">
|
14 |
+
<p>' . __('Paste your YouTube or Google Video URL above, or use the examples below.') . '</p>
|
15 |
+
<ul class="short-code-list">
|
16 |
+
<li>' . sprintf( __('<a href="%s" target="_blank">YouTube instructions</a> %s'), 'http://support.wordpress.com/videos/youtube/', '<code>[youtube=http://www.youtube.com/watch?v=cXXm696UbKY]</code>' ) .'</li>
|
17 |
+
<li>' . sprintf( __('<a href="%s" target="_blank">Google instructions</a> %s') , 'http://support.wordpress.com/videos/google-video/', '<code>[googlevideo=http://video.google.com/googleplayer.swf?docId=-8459301055248673864]</code>' ) . '</li>
|
18 |
+
<li>' . sprintf( __('<a href="%s" target="_blank">DailyMotion instructions</a> %s'), 'http://support.wordpress.com/videos/dailymotion/', '<code>[dailymotion id=5zYRy1JLhuGlP3BGw]</code>' ) . '</li>
|
19 |
+
</ul>
|
20 |
+
</td>
|
21 |
+
</tr>
|
22 |
+
<tr>
|
23 |
+
<td></td>
|
24 |
+
<td>
|
25 |
+
<input type="submit" class="button" name="insertonlybutton" value="' . esc_attr( __('Insert into Poll') ) . '" />
|
26 |
+
</td>
|
27 |
+
</tr>
|
28 |
+
</tbody></table>
|
29 |
+
';
|
30 |
+
}
|
31 |
+
|
32 |
+
function pd_audio_shortcodes_help($audio_form) {
|
33 |
+
return '
|
34 |
+
<table class="describe"><tbody>
|
35 |
+
<tr>
|
36 |
+
<th valign="top" scope="row" class="label">
|
37 |
+
<span class="alignleft"><label for="insertonly[href]">' . __('Audio File URL') . '</label></span>
|
38 |
+
<span class="alignright"><abbr title="required" class="required">*</abbr></span>
|
39 |
+
</th>
|
40 |
+
<td class="field"><input id="insertonly[href]" name="insertonly[href]" value="" type="text" aria-required="true"></td>
|
41 |
+
</tr>
|
42 |
+
<tr>
|
43 |
+
<td></td>
|
44 |
+
<td>
|
45 |
+
<input type="submit" class="button" name="insertonlybutton" value="' . esc_attr( __('Insert into Poll') ) . '" />
|
46 |
+
</td>
|
47 |
+
</tr>
|
48 |
+
</tbody></table>
|
49 |
+
';
|
50 |
+
}
|
51 |
+
|
52 |
+
function pd_image_shortcodes_help($image_form) {
|
53 |
+
return '
|
54 |
+
<h4 class="media-sub-title">' . __('Insert an image from another web site') . '</h4>
|
55 |
+
<table class="describe"><tbody>
|
56 |
+
<tr>
|
57 |
+
<th valign="top" scope="row" class="label" style="width:130px;">
|
58 |
+
<span class="alignleft"><label for="src">' . __('Image URL') . '</label></span>
|
59 |
+
<span class="alignright"><abbr id="status_img" title="required" class="required">*</abbr></span>
|
60 |
+
</th>
|
61 |
+
<td class="field"><input id="src" name="src" value="" type="text" aria-required="true" onblur="addExtImage.getImageData()" /></td>
|
62 |
+
</tr>
|
63 |
+
|
64 |
+
<tr>
|
65 |
+
<th valign="top" scope="row" class="label">
|
66 |
+
<span class="alignleft"><label for="title">' . __('Image Title') . '</label></span>
|
67 |
+
<span class="alignright"><abbr title="required" class="required">*</abbr></span>
|
68 |
+
</th>
|
69 |
+
<td class="field"><input id="alt" name="alt" value="" type="hidden" /><input id="url" name="url" value="" type="hidden" /><input id="caption" name="caption" value="" type="hidden" /><input id="title" name="title" value="" type="text" aria-required="true" /></td>
|
70 |
+
</tr>
|
71 |
+
<tr>
|
72 |
+
<td></td>
|
73 |
+
<td>
|
74 |
+
<input type="button" value="' . esc_attr( __('Insert into Poll') ) . '" onclick="addExtImage.insert()" style="color: rgb(187, 187, 187);" id="go_button" class="button">
|
75 |
+
</td>
|
76 |
+
</tr>
|
77 |
+
</tbody></table>
|
78 |
+
';
|
79 |
+
}
|
80 |
+
|
81 |
+
function polldaddy_popups_init() {
|
82 |
+
if( isset( $_REQUEST['polls_media'] ) ){
|
83 |
+
add_filter( 'type_url_form_video', 'pd_video_shortcodes_help');
|
84 |
+
add_filter( 'type_url_form_audio', 'pd_audio_shortcodes_help');
|
85 |
+
add_filter( 'type_url_form_image', 'pd_image_shortcodes_help');
|
86 |
+
}
|
87 |
+
}
|
88 |
+
|
89 |
+
add_action( 'admin_init', 'polldaddy_popups_init' );
|
90 |
+
?>
|
rating.php
CHANGED
@@ -42,9 +42,9 @@ function polldaddy_show_rating( $content ) {
|
|
42 |
|
43 |
if ( is_page() ) {
|
44 |
$rating_pos = (int) get_option( 'pd-rating-pages-pos' );
|
45 |
-
}
|
46 |
-
|
47 |
-
|
48 |
$rating_pos = (int) get_option( 'pd-rating-posts-pos' );
|
49 |
}
|
50 |
|
@@ -83,27 +83,27 @@ function polldaddy_get_rating_html( $condition = '' ) {
|
|
83 |
$rating_id = (int) get_option( 'pd-rating-pages-id' );
|
84 |
}
|
85 |
}
|
86 |
-
}
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
$rating_id = (int) get_option( 'pd-rating-posts-id' );
|
93 |
-
}
|
94 |
-
} else {
|
95 |
$rating_id = (int) get_option( 'pd-rating-posts-id' );
|
96 |
}
|
97 |
} else {
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
$rating_id = (int) get_option( 'pd-rating-posts-id' );
|
104 |
}
|
|
|
|
|
105 |
}
|
106 |
}
|
|
|
107 |
|
108 |
if ( $rating_id > 0 ) {
|
109 |
$title = apply_filters( 'wp_title', $post->post_title );
|
42 |
|
43 |
if ( is_page() ) {
|
44 |
$rating_pos = (int) get_option( 'pd-rating-pages-pos' );
|
45 |
+
} elseif ( is_home() ) {
|
46 |
+
$rating_pos = (int) get_option( 'pd-rating-posts-index-pos' );
|
47 |
+
} else {
|
48 |
$rating_pos = (int) get_option( 'pd-rating-posts-pos' );
|
49 |
}
|
50 |
|
83 |
$rating_id = (int) get_option( 'pd-rating-pages-id' );
|
84 |
}
|
85 |
}
|
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() ) {
|
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' );
|
93 |
}
|
94 |
} else {
|
95 |
+
$rating_id = (int) get_option( 'pd-rating-posts-id' );
|
96 |
+
}
|
97 |
+
} else {
|
98 |
+
if ( $condition == 'check-options' ) {
|
99 |
+
if ( (int) get_option( 'pd-rating-posts' ) > 0 ) {
|
100 |
$rating_id = (int) get_option( 'pd-rating-posts-id' );
|
101 |
}
|
102 |
+
} else {
|
103 |
+
$rating_id = (int) get_option( 'pd-rating-posts-id' );
|
104 |
}
|
105 |
}
|
106 |
+
}
|
107 |
|
108 |
if ( $rating_id > 0 ) {
|
109 |
$title = apply_filters( 'wp_title', $post->post_title );
|
readme.txt
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
-
===
|
2 |
Contributors: mdawaffe, eoigal
|
3 |
Tags: polls, poll, polldaddy, wppolls, vote, polling, surveys, rate, rating, ratings
|
4 |
Requires at least: 2.6
|
5 |
-
Tested up to: 3.1
|
6 |
-
Stable tag:
|
7 |
|
8 |
-
Create and manage
|
9 |
|
10 |
== Description ==
|
11 |
|
12 |
-
The
|
13 |
|
14 |
-
|
15 |
|
16 |
* English
|
17 |
* Arabic (thanks to <a href="http://www.Ghorab.ws" target="_blank">Ghorab.ws</a>)
|
@@ -19,16 +19,17 @@ PollDaddy Polls is localizable and currently available in:
|
|
19 |
* Spanish
|
20 |
* Czech
|
21 |
* Danish
|
22 |
-
* Khmer
|
23 |
-
* Tegulu
|
24 |
* Polish (thanks to <a href="http://mkopec.eu" target="_blank">Maciej Kopeć</a>)
|
25 |
* Turkish (thanks to Gürol Barın)
|
|
|
|
|
|
|
26 |
|
27 |
-
|
28 |
|
29 |
== Installation ==
|
30 |
|
31 |
-
Upload the plugin to your blog, Activate it, then enter your
|
32 |
|
33 |
More info here - http://support.polldaddy.com/installing-wordpress-org-plugin/
|
34 |
|
@@ -45,11 +46,11 @@ More info here - http://support.polldaddy.com/installing-wordpress-org-plugin/
|
|
45 |
|
46 |
= I have multiple authors on my blog? What happens? =
|
47 |
|
48 |
-
Each author that wants to create polls will need his or her own
|
49 |
|
50 |
= But, as an Administrator, can I edit my Authors' polls =
|
51 |
|
52 |
-
Yes. You'll be able to edit the polls they create from your blog. (You won't be able to edit any of their non-blog, personal polls they create through
|
53 |
|
54 |
= Neat! Um... can my Authors edit MY blog polls? =
|
55 |
|
@@ -61,11 +62,19 @@ Check your theme's footer.php calls wp_footer. The rating javascript is loaded o
|
|
61 |
|
62 |
More info here - http://codex.wordpress.org/Theme_Development#Plugin_API_Hooks
|
63 |
|
64 |
-
= I cannot access my ratings settings, I am getting a "Sorry! There was an error creating your rating widget. Please contact
|
65 |
|
66 |
You need to select the synchronize ratings account in the Options menu to make sure the ratings API key is valid.
|
67 |
|
68 |
== Change Log ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
= 1.8.10 =
|
70 |
* Updated shortcodes to use latest Polldaddy code
|
71 |
* Fixed minor bug in rating results
|
@@ -121,7 +130,7 @@ You need to select the synchronize ratings account in the Options menu to make s
|
|
121 |
* Bug Fix: Fixed typo in API request URL.
|
122 |
|
123 |
= 1.7.8 =
|
124 |
-
* Added Options menu, that will allow users to set poll defaults settings, import another
|
125 |
* Added the Top Rated widget.
|
126 |
* Added survey and rating short codes.
|
127 |
* Added a pot file to allow the plugin to be localized.
|
@@ -131,7 +140,7 @@ You need to select the synchronize ratings account in the Options menu to make s
|
|
131 |
* Bug Fix: Fixed notices thrown by ratings when first loaded, empty response from API.
|
132 |
|
133 |
= 1.7.6 =
|
134 |
-
* Added
|
135 |
* Bug Fix: Sub-menu now highlights the correct option
|
136 |
|
137 |
= 1.7.5 =
|
@@ -154,9 +163,9 @@ You need to select the synchronize ratings account in the Options menu to make s
|
|
154 |
|
155 |
= 1.7 =
|
156 |
* Added Poll Style Editor
|
157 |
-
* Updated the
|
158 |
* Removed style picker javascript, now reference static file on Polldaddy
|
159 |
-
* Bug Fix:
|
160 |
* Bug Fix: iframe view of poll editor now display design area
|
161 |
* Bug Fix: Only print API error once
|
162 |
|
@@ -172,21 +181,21 @@ You need to select the synchronize ratings account in the Options menu to make s
|
|
172 |
|
173 |
= 1.3 =
|
174 |
* Added Close/Open poll to poll actions
|
175 |
-
* Added Custom Styles link to Edit poll, under Design. This link will be only present when the user has custom styles created on the
|
176 |
* Added option to make normal request every login
|
177 |
|
178 |
= 1.2 =
|
179 |
-
* Bug Fix: SSL request for
|
180 |
* Bug Fix: Redirect after login now goes to list polls
|
181 |
|
182 |
= 1.1 =
|
183 |
-
* Bug Fix: Don't call
|
184 |
* Bug Fix: Correct Image locations
|
185 |
* Bug Fix: CSS Tweaks for upcoming WordPress 2.8
|
186 |
* Make Javascript image selector more robust
|
187 |
|
188 |
= 1.0 =
|
189 |
-
* New
|
190 |
* Do not store UserCode, retrieve from API
|
191 |
* Bug Fix: Fix API key retrieval. Improper use of wp_remote_post()
|
192 |
|
@@ -202,7 +211,7 @@ You need to select the synchronize ratings account in the Options menu to make s
|
|
202 |
* Potential bug fix: Maybe get rid of 'Invalid Poll Author' error... again.
|
203 |
|
204 |
= 0.6 =
|
205 |
-
* Bug fix: Allow reauthentication with
|
206 |
* Buf fix: Speed up CSS and JS.
|
207 |
* Feature: Link to view Shortcode and JavaScript code for each poll.
|
208 |
|
@@ -225,4 +234,4 @@ You need to select the synchronize ratings account in the Options menu to make s
|
|
225 |
* Bug fix: PHP Fatal Error: call to undefined function
|
226 |
|
227 |
= 0.1 =
|
228 |
-
* Initial release
|
1 |
+
=== Polldaddy Polls & Ratings ===
|
2 |
Contributors: mdawaffe, eoigal
|
3 |
Tags: polls, poll, polldaddy, wppolls, vote, polling, surveys, rate, rating, ratings
|
4 |
Requires at least: 2.6
|
5 |
+
Tested up to: 3.1.3
|
6 |
+
Stable tag: 2.0
|
7 |
|
8 |
+
Create and manage Polldaddy polls and ratings from within WordPress.
|
9 |
|
10 |
== Description ==
|
11 |
|
12 |
+
The Polldaddy Polls and Ratings plugin allows you to create and manage polls and ratings from within your WordPress dashboard. You can create polls, choose from 20 different styles for your polls, and view all results for your polls as they come in. All Polldaddy polls are fully customizable, you can set a close date for your poll, create multiple choice polls, choose whether to display the results or keep them private. You can also create your own custom style for your poll. You can even embed the polls you create on other websites. You can collect unlimited votes and create unlimited polls. The new ratings menu allows you to embed ratings into your posts, pages or comments. The rating editor allows you to fully customize you rating. You can also avail of the the 'Top Rated' widget that will allow you to place the widget in your sidebar. This widget will show you the top rated posts, pages and comments today, this week and this month.
|
13 |
|
14 |
+
Polldaddy Polls is localizable and currently available in:
|
15 |
|
16 |
* English
|
17 |
* Arabic (thanks to <a href="http://www.Ghorab.ws" target="_blank">Ghorab.ws</a>)
|
19 |
* Spanish
|
20 |
* Czech
|
21 |
* Danish
|
|
|
|
|
22 |
* Polish (thanks to <a href="http://mkopec.eu" target="_blank">Maciej Kopeć</a>)
|
23 |
* Turkish (thanks to Gürol Barın)
|
24 |
+
* Brazilian Portuguese
|
25 |
+
* Khmer
|
26 |
+
* Tegulu
|
27 |
|
28 |
+
Want to help translate the plugin or keep an existing translation uptodate? Head on over to http://translate.wordpress.com/projects/polldaddy/plugin
|
29 |
|
30 |
== Installation ==
|
31 |
|
32 |
+
Upload the plugin to your blog, Activate it, then enter your Polldaddy.com email address and password.
|
33 |
|
34 |
More info here - http://support.polldaddy.com/installing-wordpress-org-plugin/
|
35 |
|
46 |
|
47 |
= I have multiple authors on my blog? What happens? =
|
48 |
|
49 |
+
Each author that wants to create polls will need his or her own Polldaddy.com account.
|
50 |
|
51 |
= But, as an Administrator, can I edit my Authors' polls =
|
52 |
|
53 |
+
Yes. You'll be able to edit the polls they create from your blog. (You won't be able to edit any of their non-blog, personal polls they create through Polldaddy.com.)
|
54 |
|
55 |
= Neat! Um... can my Authors edit MY blog polls? =
|
56 |
|
62 |
|
63 |
More info here - http://codex.wordpress.org/Theme_Development#Plugin_API_Hooks
|
64 |
|
65 |
+
= I cannot access my ratings settings, I am getting a "Sorry! There was an error creating your rating widget. Please contact Polldaddy support to fix this." message. =
|
66 |
|
67 |
You need to select the synchronize ratings account in the Options menu to make sure the ratings API key is valid.
|
68 |
|
69 |
== Change Log ==
|
70 |
+
= 2.0 =
|
71 |
+
* Updated the UI
|
72 |
+
* Added media embeds in poll editor
|
73 |
+
* Added poll comments option
|
74 |
+
* Fixed layout issues when viewing plugin in iframe/popup
|
75 |
+
* Fixed bug in multiple choices dropdown
|
76 |
+
* Fixed bug in updating style when updating all polls using that style
|
77 |
+
|
78 |
= 1.8.10 =
|
79 |
* Updated shortcodes to use latest Polldaddy code
|
80 |
* Fixed minor bug in rating results
|
130 |
* Bug Fix: Fixed typo in API request URL.
|
131 |
|
132 |
= 1.7.8 =
|
133 |
+
* Added Options menu, that will allow users to set poll defaults settings, import another Polldaddy account and there is also a setting to allow each blog user to import their own Polldaddy account.
|
134 |
* Added the Top Rated widget.
|
135 |
* Added survey and rating short codes.
|
136 |
* Added a pot file to allow the plugin to be localized.
|
140 |
* Bug Fix: Fixed notices thrown by ratings when first loaded, empty response from API.
|
141 |
|
142 |
= 1.7.6 =
|
143 |
+
* Added Polldaddy Ratings, you can now add ratings to your posts, pages and comments
|
144 |
* Bug Fix: Sub-menu now highlights the correct option
|
145 |
|
146 |
= 1.7.5 =
|
163 |
|
164 |
= 1.7 =
|
165 |
* Added Poll Style Editor
|
166 |
+
* Updated the Polldaddy API Client code
|
167 |
* Removed style picker javascript, now reference static file on Polldaddy
|
168 |
+
* Bug Fix: Polldaddy Answers link to poll in poll embed code now correct
|
169 |
* Bug Fix: iframe view of poll editor now display design area
|
170 |
* Bug Fix: Only print API error once
|
171 |
|
181 |
|
182 |
= 1.3 =
|
183 |
* Added Close/Open poll to poll actions
|
184 |
+
* Added Custom Styles link to Edit poll, under Design. This link will be only present when the user has custom styles created on the Polldaddy.com site.
|
185 |
* Added option to make normal request every login
|
186 |
|
187 |
= 1.2 =
|
188 |
+
* Bug Fix: SSL request for Polldaddy API key sometimes failed due to host constraints, included option to make a normal http request in this case.
|
189 |
* Bug Fix: Redirect after login now goes to list polls
|
190 |
|
191 |
= 1.1 =
|
192 |
+
* Bug Fix: Don't call Polldaddy API on every admin page load
|
193 |
* Bug Fix: Correct Image locations
|
194 |
* Bug Fix: CSS Tweaks for upcoming WordPress 2.8
|
195 |
* Make Javascript image selector more robust
|
196 |
|
197 |
= 1.0 =
|
198 |
+
* New Polldaddy API
|
199 |
* Do not store UserCode, retrieve from API
|
200 |
* Bug Fix: Fix API key retrieval. Improper use of wp_remote_post()
|
201 |
|
211 |
* Potential bug fix: Maybe get rid of 'Invalid Poll Author' error... again.
|
212 |
|
213 |
= 0.6 =
|
214 |
+
* Bug fix: Allow reauthentication with Polldaddy email address and Polldaddy password. This is necessary because the stored Polldaddy User API key is invalidated if the user's details change on Polldaddy.com.
|
215 |
* Buf fix: Speed up CSS and JS.
|
216 |
* Feature: Link to view Shortcode and JavaScript code for each poll.
|
217 |
|
234 |
* Bug fix: PHP Fatal Error: call to undefined function
|
235 |
|
236 |
= 0.1 =
|
237 |
+
* Initial release
|
style-editor.css
CHANGED
@@ -1 +1,18 @@
|
|
1 |
-
.CSSE_main{width:374px;border-collapse:collapse;padding:0px;margin:0px 6px;} .CSSE_main_l{width:79px;border:0px;padding:11px 0px 0px 0px;text-align:right;} .CSSE_main_l a{line-height:2;text-decoration:none;font-size:11px;text-align:right;padding-right:5px;} .CSSE_main_r{width:295px;height:280px;padding:0px;margin:0px;border-color:#DFDFDF;border-style:solid;border-width:1px;padding:0.5em 0.9em;} .CSSE_main_l .off{height:23px;width:79px;margin:0px 0px 3px 0px;} .CSSE_main_l .on{-moz-border-radius-bottomleft:3px;-moz-border-radius-bottomright:0;-moz-border-radius-topleft:3px;-moz-border-radius-topright:0;border-style:solid none solid solid;border-color:#DFDFDF;border-width:1px 0 1px 1px;margin-right:-1px;background-color:#F1F1F1;font-color:#333333;font-weight:bold;text-decoration:none;text-shadow:0 1px 0 #FFFFFF;border-style:solid none solid solid;} .CSSE_main_l .Aoff,.CSSE_main_l .Aon{list-style-image:none;list-style-position:outside;list-style-type:none;margin:8px 5px 5px 0px;padding:0;white-space:nowrap;}.CSSE_main_l .Aon{color:#333333;-moz-background-clip:border;-moz-background-inline-policy:continuous;-moz-background-origin:padding;background:transparent none repeat scroll 0 0;border:medium none;} .CSSE_sub{width:295px;border-collapse:collapse;border:0;} .CSSE_sub .top{height:11px;} .CSSE_sub .btm{height:11px;} .CSSE_edit{border-collapse:collapse;width:100%;margin:0px 0px 0px 25px;min-height:160px;} .CSSE_edit TD{font-size:11px;color:#666;height:36px;} .pds-clear{clear:both;display:block;} .pds-answer-group{display:block;padding:5px 0px;} .pds-answer-input{display:block;float:left;width:25px;} .pds-answer{position:relative;cursor:pointer;display:block;float:left;} .pds-answer-other{display:block;} .pds-answer-group{display:block;} .pds-link{display:block;float:left;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.CSSE_main{width:374px;border-collapse:collapse;padding:0px;margin:0px 6px;} .CSSE_main_l{width:79px;border:0px;padding:11px 0px 0px 0px;text-align:right;} .CSSE_main_l a{line-height:2;text-decoration:none;font-size:11px;text-align:right;padding-right:5px;} .CSSE_main_r{width:295px;height:280px;padding:0px;margin:0px;border-color:#DFDFDF;border-style:solid;border-width:1px;padding:0.5em 0.9em;} .CSSE_main_l .off{height:23px;width:79px;margin:0px 0px 3px 0px;} .CSSE_main_l .on{-moz-border-radius-bottomleft:3px;-moz-border-radius-bottomright:0;-moz-border-radius-topleft:3px;-moz-border-radius-topright:0;border-style:solid none solid solid;border-color:#DFDFDF;border-width:1px 0 1px 1px;margin-right:-1px;background-color:#F1F1F1;font-color:#333333;font-weight:bold;text-decoration:none;text-shadow:0 1px 0 #FFFFFF;border-style:solid none solid solid;} .CSSE_main_l .Aoff,.CSSE_main_l .Aon{list-style-image:none;list-style-position:outside;list-style-type:none;margin:8px 5px 5px 0px;padding:0;white-space:nowrap;}.CSSE_main_l .Aon{color:#333333;-moz-background-clip:border;-moz-background-inline-policy:continuous;-moz-background-origin:padding;background:transparent none repeat scroll 0 0;border:medium none;} .CSSE_sub{width:295px;border-collapse:collapse;border:0;} .CSSE_sub .top{height:11px;} .CSSE_sub .btm{height:11px;} .CSSE_edit{border-collapse:collapse;width:100%;margin:0px 0px 0px 25px;min-height:160px;} .CSSE_edit TD{font-size:11px;color:#666;height:36px;} .pds-clear{clear:both;display:block;} .pds-answer-group{display:block;padding:5px 0px;} .pds-answer-input{display:block;float:left;width:25px;} .pds-answer{position:relative;cursor:pointer;display:block;float:left;} .pds-answer-other{display:block;} .pds-answer-group{display:block;} .pds-link{display:block;float:left;}
|
2 |
+
|
3 |
+
|
4 |
+
.pd-editor-label{
|
5 |
+
width: 200px !important;
|
6 |
+
padding:10px;
|
7 |
+
}
|
8 |
+
|
9 |
+
h3{
|
10 |
+
font-size: 1.17em !important;
|
11 |
+
margin-top:20px !important;
|
12 |
+
padding-bottom: 0px;
|
13 |
+
margin-bottom: 0px;
|
14 |
+
}
|
15 |
+
|
16 |
+
#style-selector{
|
17 |
+
padding: 0px 0px 20px 10px;
|
18 |
+
}
|