Version Description
- Added templates preview when adding/editing a poll
- Added sidebar scroll
- Typos fixes
- CSS and Javascript improvements
- Various bugs fixes
Download this release
Release Info
Developer | yourownprogrammer |
Plugin | YOP Poll |
Version | 4.9 |
Comparing to | |
See all releases |
Code changes from version 4.6 to 4.9
- css/yop-poll-admin.css +1 -1
- inc/admin.php +749 -665
- inc/db_schema.php +725 -587
- inc/plugin-functions.php +2 -1
- inc/public-admin.php +1 -2
- inc/widget.php +1 -2
- inc/yop_poll_model.php +1015 -910
- js/yop-poll-admin-add-new.js +30 -2
- js/yop-poll-admin-options.js +3 -0
- js/yop-poll-admin.js +22 -0
- js/yop-poll-public.js +184 -177
- readme.txt +20 -1
- yop_poll.php +15 -15
css/yop-poll-admin.css
CHANGED
@@ -7,4 +7,4 @@
|
|
7 |
.yop_poll_suboption th {
|
8 |
padding-left: 35px;
|
9 |
background:url(../images/yop-poll-list-style.png) no-repeat 20px 8px;
|
10 |
-
}
|
7 |
.yop_poll_suboption th {
|
8 |
padding-left: 35px;
|
9 |
background:url(../images/yop-poll-list-style.png) no-repeat 20px 8px;
|
10 |
+
}
|
inc/admin.php
CHANGED
@@ -8,13 +8,13 @@
|
|
8 |
$this->add_action ( 'wpmu_new_blog', 'new_blog', 10, 6 );
|
9 |
$this->add_action ( 'delete_blog', 'delete_blog', 10, 2 );
|
10 |
register_activation_hook ( $this->_config->plugin_file, array (
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
register_deactivation_hook ( $this->_config->plugin_file, array (
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
register_uninstall_hook ( $this->_config->plugin_file, 'yop_poll_uninstall' );
|
19 |
$this->add_action ( 'admin_enqueue_scripts', 'load_editor_functions' );
|
20 |
$this->add_action ( 'plugins_loaded', 'db_update' );
|
@@ -26,17 +26,17 @@
|
|
26 |
if (is_plugin_active_for_network ( 'yop-poll/yop_poll.php' )) {
|
27 |
$old_blog = $wpdb->blogid;
|
28 |
switch_to_blog ( $blog_id );
|
29 |
-
$wpdb->yop_polls
|
30 |
-
$wpdb->yop_poll_answers
|
31 |
-
$wpdb->yop_poll_templates
|
32 |
-
$wpdb->yop_poll_custom_fields
|
33 |
-
$wpdb->yop_pollmeta
|
34 |
-
$wpdb->yop_poll_answermeta
|
35 |
-
$wpdb->yop_poll_logs
|
36 |
-
$wpdb->yop_poll_voters
|
37 |
-
$wpdb->yop_poll_bans
|
38 |
$wpdb->yop_poll_votes_custom_fields = $wpdb->prefix . 'yop_poll_votes_custom_fields';
|
39 |
-
$wpdb->yop_poll_facebook_users
|
40 |
$this->activate ( NULL );
|
41 |
switch_to_blog ( $old_blog );
|
42 |
}
|
@@ -48,6 +48,7 @@
|
|
48 |
$wpdb->query ( "DROP TABLE `" . $wpdb->prefix . "yop_pollmeta`, `" . $wpdb->prefix . "yop_polls`, `" . $wpdb->prefix . "yop_poll_answermeta`, `" . $wpdb->prefix . "yop_poll_answers`, `" . $wpdb->prefix . "yop_poll_custom_fields`, `" . $wpdb->prefix . "yop_poll_logs`, `" . $wpdb->prefix . "yop_poll_voters`, `" . $wpdb->prefix . "yop_poll_bans`, `" . $wpdb->prefix . "yop_poll_templates`, `" . $wpdb->prefix . "yop_poll_votes_custom_fields`, `" . $wpdb->prefix . "yop_poll_facebook_users`" );
|
49 |
switch_to_blog ( $old_blog );
|
50 |
}
|
|
|
51 |
function yop_poll_network_propagate($pfunction, $networkwide) {
|
52 |
global $wpdb;
|
53 |
|
@@ -60,20 +61,20 @@
|
|
60 |
$blogids = $wpdb->get_col ( "SELECT blog_id FROM {$wpdb->blogs}" );
|
61 |
foreach ( $blogids as $blog_id ) {
|
62 |
switch_to_blog ( $blog_id );
|
63 |
-
$wpdb->yop_polls
|
64 |
-
$wpdb->yop_poll_answers
|
65 |
-
$wpdb->yop_poll_templates
|
66 |
-
$wpdb->yop_poll_custom_fields
|
67 |
-
$wpdb->yop_pollmeta
|
68 |
-
$wpdb->yop_poll_answermeta
|
69 |
-
$wpdb->yop_poll_logs
|
70 |
-
$wpdb->yop_poll_voters
|
71 |
-
$wpdb->yop_poll_bans
|
72 |
$wpdb->yop_poll_votes_custom_fields = $wpdb->prefix . 'yop_poll_votes_custom_fields';
|
73 |
-
$wpdb->yop_poll_facebook_users
|
74 |
call_user_func ( array (
|
75 |
-
|
76 |
-
|
77 |
), $networkwide );
|
78 |
}
|
79 |
switch_to_blog ( $old_blog );
|
@@ -81,16 +82,19 @@
|
|
81 |
}
|
82 |
}
|
83 |
call_user_func ( array (
|
84 |
-
|
85 |
-
|
86 |
), $networkwide );
|
87 |
}
|
|
|
88 |
function yop_poll_activate($networkwide) {
|
89 |
$this->yop_poll_network_propagate ( 'activate', $networkwide );
|
90 |
}
|
|
|
91 |
function yop_poll_deactivate($networkwide) {
|
92 |
$this->yop_poll_network_propagate ( 'deactivate', $networkwide );
|
93 |
}
|
|
|
94 |
public function db_update() {
|
95 |
global $wpdb;
|
96 |
global $current_user;
|
@@ -450,18 +454,29 @@
|
|
450 |
|
451 |
if (! isset ( $default_options ['email_notifications_body'] )) {
|
452 |
$default_options ['email_notifications_body'] = '<p>A new vote was registered on [VOTE_DATE] for [POLL_NAME]</p>
|
453 |
-
<p>Vote Details:</p>
|
454 |
-
<p><b>Question:</b> [QUESTION]</p>
|
455 |
-
<p><b>Answers:</b> <br />[ANSWERS]</p>
|
456 |
-
<p><b>Custom Fields:</b> <br />[CUSTOM_FIELDS]</p>
|
457 |
-
<p><b>Vote ID:</b> <br />[VOTE_ID]</p>';
|
458 |
}
|
459 |
|
460 |
update_option ( 'yop_poll_options', $default_options );
|
461 |
update_option ( "yop_poll_version", $wpdb->yop_poll_version );
|
462 |
}
|
463 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
464 |
}
|
|
|
465 |
public function update_to_4_2() {
|
466 |
global $wpdb;
|
467 |
|
@@ -539,10 +554,40 @@
|
|
539 |
}
|
540 |
}
|
541 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
542 |
public function admin_loader() {
|
543 |
-
$this->add_action ( '
|
544 |
$this->add_action ( 'admin_init', 'yop_poll_options_admin_init', 1 );
|
|
|
545 |
$this->add_action ( 'wp_ajax_yop_poll_editor', 'ajax_get_polls_for_editor', 1 );
|
|
|
546 |
$this->add_action ( 'wp_ajax_yop_poll_html_editor', 'ajax_get_polls_for_html_editor', 1 );
|
547 |
$this->add_action ( 'wp_ajax_yop_poll_edit_add_new_poll', 'ajax_edit_add_new_poll', 1 );
|
548 |
$this->add_action ( 'wp_ajax_yop_poll_edit_add_new_poll_template', 'ajax_edit_add_new_poll_template', 1 );
|
@@ -633,91 +678,92 @@
|
|
633 |
wp_unschedule_event( $schedule_timestamp, 'yop_poll_hourly_event', array() );
|
634 |
}
|
635 |
}
|
|
|
636 |
public function admin_menu() {
|
637 |
if (is_admin () && $this->current_user_can ( 'edit_own_polls' )) {
|
638 |
if (function_exists ( 'add_menu_page' )) {
|
639 |
if ($this->current_user_can ( 'edit_own_polls' ))
|
640 |
$page = add_menu_page ( __ ( 'Yop Poll', 'yop_poll' ), __ ( 'Yop Poll', 'yop_poll' ), 'read', 'yop-polls', array (
|
641 |
-
|
642 |
-
|
643 |
), "{$this->_config->plugin_url}/images/yop-poll-admin-menu-icon16.png", '28.734' );
|
644 |
}
|
645 |
if ($this->current_user_can ( 'edit_own_polls' ))
|
646 |
add_action ( "load-$page", array (
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
if (function_exists ( 'add_submenu_page' )) {
|
651 |
|
652 |
if ($this->current_user_can ( 'edit_own_polls' )) {
|
653 |
$subpage = add_submenu_page ( 'yop-polls', __ ( 'All Polls', 'yop_poll' ), __ ( 'All Polls', 'yop_poll' ), 'read', 'yop-polls', array (
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
add_action ( "load-$subpage", array (
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
}
|
662 |
if ($this->current_user_can ( 'edit_own_polls' )) {
|
663 |
$subpage = add_submenu_page ( 'yop-polls', __ ( 'Add New', 'yop_poll' ), __ ( 'Add New', 'yop_poll' ), 'read', 'yop-polls-add-new', array (
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
add_action ( "load-$subpage", array (
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
}
|
672 |
if ($this->current_user_can ( 'manage_polls_options' )) {
|
673 |
$subpage = add_submenu_page ( 'yop-polls', __ ( 'Options', 'yop_poll' ), __ ( 'Options', 'yop_poll' ), 'read', 'yop-polls-options', array (
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
add_action ( "load-$subpage", array (
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
}
|
682 |
if ($this->current_user_can ( 'edit_own_polls_templates' )) {
|
683 |
$subpage = add_submenu_page ( 'yop-polls', __ ( 'Templates', 'yop_poll' ), __ ( 'Templates', 'yop_poll' ), 'read', 'yop-polls-templates', array (
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
add_action ( "load-$subpage", array (
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
}
|
692 |
if ($this->current_user_can ( 'view_own_polls_logs' )) {
|
693 |
$subpage = add_submenu_page ( 'yop-polls', __ ( 'Logs', 'yop_poll' ), __ ( 'Logs', 'yop_poll' ), 'read', 'yop-polls-logs', array (
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
add_action ( "load-$subpage", array (
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
}
|
702 |
if ($this->current_user_can ( 'manage_polls_bans' )) {
|
703 |
$subpage = add_submenu_page ( 'yop-polls', __ ( 'Bans', 'yop_poll' ), __ ( 'Bans', 'yop_poll' ), 'read', 'yop-polls-bans', array (
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
add_action ( "load-$subpage", array (
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
}
|
712 |
if ($this->current_user_can ( 'become_pro' )) {
|
713 |
$subpage = add_submenu_page ( 'yop-polls', __ ( 'Become Pro', 'yop_poll' ), __ ( 'Become Pro', 'yop_poll' ), 'read', 'yop-polls-become-pro', array (
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
add_action ( "load-$subpage", array (
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
}
|
722 |
}
|
723 |
}
|
@@ -766,11 +812,11 @@
|
|
766 |
}
|
767 |
public function manage_pages_load() {
|
768 |
wp_reset_vars ( array (
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
global $page, $action, $orderby, $order, $yop_poll_add_new_config;
|
775 |
$default_options = get_option ( 'yop_poll_options', array () );
|
776 |
|
@@ -778,6 +824,10 @@
|
|
778 |
$answers_number = $this->_config->min_number_of_answers + 1; // total +1
|
779 |
$customfields_number = $this->_config->min_number_of_customfields + 1; // total +1
|
780 |
|
|
|
|
|
|
|
|
|
781 |
switch ($page) {
|
782 |
case 'yop-polls' :
|
783 |
if ('results' == $action) {
|
@@ -785,14 +835,14 @@
|
|
785 |
wp_enqueue_style ( 'yop-poll-timepicker', "{$this->_config->plugin_url}/css/timepicker.css", array (), $this->_config->version );
|
786 |
wp_enqueue_style ( 'yop-poll-jquery-ui', "{$this->_config->plugin_url}/css/jquery-ui.css", array (), $this->_config->version );
|
787 |
wp_enqueue_script ( 'yop-poll-jquery-ui-timepicker', "{$this->_config->plugin_url}/js/jquery-ui-timepicker-addon.js", array (
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
), $this->_config->version, true );
|
792 |
wp_enqueue_style ( 'yop-poll-admin-custom-fields', "{$this->_config->plugin_url}/css/yop-poll-admin-custom-fields.css", array (), $this->_config->version );
|
793 |
wp_enqueue_script ( 'yop-poll-admin-custom-fields', "{$this->_config->plugin_url}/js/yop-poll-admin-custom-fields.js", array (
|
794 |
-
|
795 |
-
|
796 |
), $this->_config->version, true );
|
797 |
$this->yop_poll_custom_fields_results_operations ();
|
798 |
break;
|
@@ -801,18 +851,19 @@
|
|
801 |
wp_enqueue_style ( 'yop-poll-timepicker', "{$this->_config->plugin_url}/css/timepicker.css", array (), $this->_config->version );
|
802 |
wp_enqueue_style ( 'yop-poll-jquery-ui', "{$this->_config->plugin_url}/css/jquery-ui.css", array (), $this->_config->version );
|
803 |
wp_enqueue_script ( 'yop-poll-jquery-ui-timepicker', "{$this->_config->plugin_url}/js/jquery-ui-timepicker-addon.js", array (
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
), $this->_config->version, true );
|
808 |
wp_enqueue_style ( 'yop-poll-admin-custom-fields', "{$this->_config->plugin_url}/css/yop-poll-admin-custom-fields.css", array (), $this->_config->version );
|
809 |
wp_enqueue_script ( 'yop-poll-admin-custom-fields', "{$this->_config->plugin_url}/js/yop-poll-admin-custom-fields.js", array (
|
810 |
-
|
811 |
-
|
812 |
), $this->_config->version, true );
|
813 |
$this->yop_poll_custom_fields_operations ();
|
814 |
break;
|
815 |
-
}
|
|
|
816 |
require_once ($this->_config->plugin_inc_dir . '/yop_poll_model.php');
|
817 |
$poll_id = (isset ( $_GET ['id'] ) ? intval ( $_GET ['id'] ) : 0);
|
818 |
$yop_poll_model = new Yop_Poll_Model ( $poll_id );
|
@@ -820,7 +871,8 @@
|
|
820 |
$answers_number = count ( $answers ) + 1; // total +1
|
821 |
$custom_fields = Yop_Poll_Model::get_poll_customfields ( $poll_id );
|
822 |
$customfields_number = count ( $custom_fields ) + 1; // total +1
|
823 |
-
}
|
|
|
824 |
$this->view_all_polls_operations ();
|
825 |
wp_enqueue_script ( 'link' );
|
826 |
wp_enqueue_script ( 'xfn' );
|
@@ -876,16 +928,16 @@
|
|
876 |
wp_enqueue_style ( 'yop-poll-jquery-ui', "{$this->_config->plugin_url}/css/jquery-ui.css", array (), $this->_config->version );
|
877 |
|
878 |
wp_enqueue_script ( 'yop-poll-admin-add-new', "{$this->_config->plugin_url}/js/yop-poll-admin-add-new.js", array (
|
879 |
-
|
880 |
-
|
881 |
), $this->_config->version, true );
|
882 |
wp_enqueue_script ( 'yop-poll-jquery-ui-timepicker', "{$this->_config->plugin_url}/js/jquery-ui-timepicker-addon.js", array (
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
), $this->_config->version, true );
|
887 |
wp_enqueue_script ( 'yop-poll-modal-box-js', "{$this->_config->plugin_url}/modal/js/jquery.modalbox-1.5.0-min.js", array (
|
888 |
-
|
889 |
), $this->_config->version, true );
|
890 |
wp_enqueue_style ( 'yop-poll-modal-box-css', "{$this->_config->plugin_url}/modal/css/jquery.modalbox-skin-precious-white.css", array (), $this->_config->version );
|
891 |
wp_localize_script ( 'yop-poll-admin-add-new', 'yop_poll_add_new_config', $yop_poll_add_new_config );
|
@@ -896,19 +948,19 @@
|
|
896 |
wp_enqueue_style ( 'yop-poll-timepicker', "{$this->_config->plugin_url}/css/timepicker.css", array (), $this->_config->version );
|
897 |
wp_enqueue_style ( 'yop-poll-jquery-ui', "{$this->_config->plugin_url}/css/jquery-ui.css", array (), $this->_config->version );
|
898 |
wp_enqueue_script ( 'yop-poll-jquery-ui-timepicker', "{$this->_config->plugin_url}/js/jquery-ui-timepicker-addon.js", array (
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
), $this->_config->version, true );
|
903 |
wp_enqueue_script ( 'yop-poll-admin-logs', "{$this->_config->plugin_url}/js/yop-poll-admin-logs.js", array (
|
904 |
-
|
905 |
-
|
906 |
), $this->_config->version, true );
|
907 |
$this->view_yop_poll_logs_operations ();
|
908 |
break;
|
909 |
case 'yop-polls-bans' :
|
910 |
wp_enqueue_script ( 'yop-poll-admin-bans', "{$this->_config->plugin_url}/js/yop-poll-admin-bans.js", array (
|
911 |
-
|
912 |
), $this->_config->version, true );
|
913 |
$this->view_yop_poll_bans_operations ();
|
914 |
break;
|
@@ -917,13 +969,13 @@
|
|
917 |
wp_enqueue_style ( 'yop-poll-timepicker', "{$this->_config->plugin_url}/css/timepicker.css", array (), $this->_config->version );
|
918 |
wp_enqueue_style ( 'yop-poll-jquery-ui', "{$this->_config->plugin_url}/css/jquery-ui.css", array (), $this->_config->version );
|
919 |
wp_enqueue_script ( 'yop-poll-admin-options', "{$this->_config->plugin_url}/js/yop-poll-admin-options.js", array (
|
920 |
-
|
921 |
-
|
922 |
), $this->_config->version, true );
|
923 |
wp_enqueue_script ( 'yop-poll-jquery-ui-timepicker', "{$this->_config->plugin_url}/js/jquery-ui-timepicker-addon.js", array (
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
), $this->_config->version, true );
|
928 |
wp_enqueue_script ( 'link' );
|
929 |
wp_enqueue_script ( 'xfn' );
|
@@ -931,12 +983,12 @@
|
|
931 |
case 'yop-polls-templates' :
|
932 |
add_filter ( 'user_can_richedit', create_function ( '$a', 'return false;' ), 1 );
|
933 |
wp_enqueue_script ( array (
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
wp_enqueue_style ( 'thickbox' );
|
938 |
wp_enqueue_script ( 'yop-poll-admin-templates', "{$this->_config->plugin_url}/js/yop-poll-admin-templates.js", array (
|
939 |
-
|
940 |
), $this->_config->version, true );
|
941 |
$yop_poll_add_new_template_config = array (
|
942 |
'ajax' => array (
|
@@ -948,7 +1000,7 @@
|
|
948 |
)
|
949 |
);
|
950 |
wp_enqueue_script ( 'yop-poll-modal-box-js', "{$this->_config->plugin_url}/modal/js/jquery.modalbox-1.5.0-min.js", array (
|
951 |
-
|
952 |
), $this->_config->version, true );
|
953 |
wp_enqueue_style ( 'yop-poll-modal-box-css', "{$this->_config->plugin_url}/modal/css/jquery.modalbox-skin-precious-white.css", array (), $this->_config->version );
|
954 |
wp_localize_script ( 'yop-poll-admin-templates', 'yop_poll_add_new_template_config', $yop_poll_add_new_template_config );
|
@@ -981,11 +1033,11 @@
|
|
981 |
$total_deleted ++;
|
982 |
}
|
983 |
wp_redirect ( add_query_arg ( 'deleted', count ( $bulklogs ) - $total_deleted, remove_query_arg ( array (
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
exit ();
|
990 |
}
|
991 |
|
@@ -1003,11 +1055,11 @@
|
|
1003 |
$total_deleted_group ++;
|
1004 |
}
|
1005 |
wp_redirect ( add_query_arg ( 'deleted', count ( $bulklogs ) - $total_deleted_group, remove_query_arg ( array (
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
exit ();
|
1012 |
}
|
1013 |
} elseif ('-1' != $action && isset ( $_REQUEST ['id'] )) {
|
@@ -1022,10 +1074,10 @@
|
|
1022 |
else
|
1023 |
wp_die ( __ ( 'You are not allowed to delete this item.', 'yop_poll' ) );
|
1024 |
wp_redirect ( add_query_arg ( 'deleted', 1, remove_query_arg ( array (
|
1025 |
-
|
1026 |
-
|
1027 |
-
|
1028 |
-
|
1029 |
exit ();
|
1030 |
}
|
1031 |
if ('delete_group' == $action) {
|
@@ -1039,10 +1091,10 @@
|
|
1039 |
else
|
1040 |
wp_die ( __ ( 'You are not allowed to delete this item.', 'yop_poll' ) );
|
1041 |
wp_redirect ( add_query_arg ( 'deleted', 1, remove_query_arg ( array (
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
1045 |
-
|
1046 |
exit ();
|
1047 |
}
|
1048 |
} elseif (isset ( $_REQUEST ['export'] )) {
|
@@ -1161,17 +1213,17 @@
|
|
1161 |
}
|
1162 |
|
1163 |
wp_safe_redirect ( remove_query_arg ( array (
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
exit ();
|
1170 |
} elseif (! empty ( $_GET ['_wp_http_referer'] )) {
|
1171 |
wp_safe_redirect ( remove_query_arg ( array (
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
exit ();
|
1176 |
}
|
1177 |
}
|
@@ -1250,18 +1302,18 @@
|
|
1250 |
exit ();
|
1251 |
}
|
1252 |
wp_safe_redirect ( remove_query_arg ( array (
|
1253 |
-
|
1254 |
-
|
1255 |
-
|
1256 |
-
|
1257 |
-
|
1258 |
exit ();
|
1259 |
} elseif (! empty ( $_GET ['_wp_http_referer'] )) {
|
1260 |
wp_safe_redirect ( remove_query_arg ( array (
|
1261 |
-
|
1262 |
-
|
1263 |
-
|
1264 |
-
|
1265 |
exit ();
|
1266 |
}
|
1267 |
}
|
@@ -1344,18 +1396,18 @@
|
|
1344 |
exit ();
|
1345 |
}
|
1346 |
wp_safe_redirect ( remove_query_arg ( array (
|
1347 |
-
|
1348 |
-
|
1349 |
-
|
1350 |
-
|
1351 |
-
|
1352 |
exit ();
|
1353 |
} elseif (! empty ( $_GET ['_wp_http_referer'] )) {
|
1354 |
wp_safe_redirect ( remove_query_arg ( array (
|
1355 |
-
|
1356 |
-
|
1357 |
-
|
1358 |
-
|
1359 |
exit ();
|
1360 |
}
|
1361 |
}
|
@@ -1371,10 +1423,10 @@
|
|
1371 |
Yop_Poll_Model::delete_poll_ban_from_db ( $ban_id );
|
1372 |
}
|
1373 |
wp_redirect ( add_query_arg ( 'deleted', count ( $bulkbans ), remove_query_arg ( array (
|
1374 |
-
|
1375 |
-
|
1376 |
-
|
1377 |
-
|
1378 |
exit ();
|
1379 |
}
|
1380 |
} elseif ('-1' != $action && isset ( $_REQUEST ['id'] )) {
|
@@ -1384,10 +1436,10 @@
|
|
1384 |
require_once ($this->_config->plugin_inc_dir . '/yop_poll_model.php');
|
1385 |
Yop_Poll_Model::delete_poll_ban_from_db ( $ban_id );
|
1386 |
wp_redirect ( add_query_arg ( 'deleted', 1, remove_query_arg ( array (
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
1390 |
-
|
1391 |
exit ();
|
1392 |
}
|
1393 |
} elseif ('add-ban' == $action) {
|
@@ -1396,24 +1448,24 @@
|
|
1396 |
$bans = Yop_Poll_Model::add_bans ( $_REQUEST );
|
1397 |
if ($bans ['error'] != '') {
|
1398 |
wp_redirect ( add_query_arg ( 'bans-error', urlencode ( $bans ['error'] ), remove_query_arg ( array (
|
1399 |
-
|
1400 |
-
|
1401 |
-
|
1402 |
-
|
1403 |
exit ();
|
1404 |
} else {
|
1405 |
wp_redirect ( add_query_arg ( 'bans-added', urlencode ( ( int ) $bans ['success'] ), remove_query_arg ( array (
|
1406 |
-
|
1407 |
-
|
1408 |
-
|
1409 |
-
|
1410 |
exit ();
|
1411 |
}
|
1412 |
} elseif (! empty ( $_GET ['_wp_http_referer'] )) {
|
1413 |
wp_safe_redirect ( remove_query_arg ( array (
|
1414 |
-
|
1415 |
-
|
1416 |
-
|
1417 |
exit ();
|
1418 |
}
|
1419 |
}
|
@@ -1434,10 +1486,10 @@
|
|
1434 |
$total_deleted ++;
|
1435 |
}
|
1436 |
wp_redirect ( add_query_arg ( 'deleted', count ( $bulktemplates ) - $total_deleted, remove_query_arg ( array (
|
1437 |
-
|
1438 |
-
|
1439 |
-
|
1440 |
-
|
1441 |
exit ();
|
1442 |
}
|
1443 |
if ('clone' == $action) {
|
@@ -1454,10 +1506,10 @@
|
|
1454 |
$total_cloned ++;
|
1455 |
}
|
1456 |
wp_redirect ( add_query_arg ( 'cloned', count ( $bulktemplates ) - $total_cloned, remove_query_arg ( array (
|
1457 |
-
|
1458 |
-
|
1459 |
-
|
1460 |
-
|
1461 |
exit ();
|
1462 |
}
|
1463 |
} elseif ('-1' != $action && isset ( $_REQUEST ['id'] )) {
|
@@ -1471,10 +1523,10 @@
|
|
1471 |
else
|
1472 |
wp_die ( __ ( 'You are not allowed to delete this item.', 'yop_poll' ) );
|
1473 |
wp_redirect ( add_query_arg ( 'deleted', 1, remove_query_arg ( array (
|
1474 |
-
|
1475 |
-
|
1476 |
-
|
1477 |
-
|
1478 |
exit ();
|
1479 |
}
|
1480 |
if ('clone' == $action) {
|
@@ -1487,17 +1539,17 @@
|
|
1487 |
else
|
1488 |
wp_die ( __ ( 'You are not allowed to clone this item.', 'yop_poll' ) );
|
1489 |
wp_redirect ( add_query_arg ( 'cloned', 1, remove_query_arg ( array (
|
1490 |
-
|
1491 |
-
|
1492 |
-
|
1493 |
-
|
1494 |
exit ();
|
1495 |
}
|
1496 |
} elseif (! empty ( $_GET ['_wp_http_referer'] )) {
|
1497 |
wp_safe_redirect ( remove_query_arg ( array (
|
1498 |
-
|
1499 |
-
|
1500 |
-
|
1501 |
exit ();
|
1502 |
}
|
1503 |
}
|
@@ -1518,10 +1570,10 @@
|
|
1518 |
$total_undeleted ++;
|
1519 |
}
|
1520 |
wp_redirect ( add_query_arg ( 'deleted', count ( $bulkyoppolls ) - $total_undeleted, remove_query_arg ( array (
|
1521 |
-
|
1522 |
-
|
1523 |
-
|
1524 |
-
|
1525 |
exit ();
|
1526 |
}
|
1527 |
if ('clone' == $action) {
|
@@ -1538,10 +1590,10 @@
|
|
1538 |
$total_uncloned ++;
|
1539 |
}
|
1540 |
wp_redirect ( add_query_arg ( 'cloned', count ( $bulkyoppolls ) - $total_uncloned, remove_query_arg ( array (
|
1541 |
-
|
1542 |
-
|
1543 |
-
|
1544 |
-
|
1545 |
exit ();
|
1546 |
}
|
1547 |
if ('reset_votes' == $action) {
|
@@ -1558,10 +1610,10 @@
|
|
1558 |
$total_unreseted ++;
|
1559 |
}
|
1560 |
wp_redirect ( add_query_arg ( 'reseted_votes', count ( $bulkyoppolls ) - $total_unreseted, remove_query_arg ( array (
|
1561 |
-
|
1562 |
-
|
1563 |
-
|
1564 |
-
|
1565 |
exit ();
|
1566 |
}
|
1567 |
if ('delete_logs' == $action) {
|
@@ -1578,10 +1630,10 @@
|
|
1578 |
$total_undeleted_logs ++;
|
1579 |
}
|
1580 |
wp_redirect ( add_query_arg ( 'deleted_logs', count ( $bulkyoppolls ) - $total_undeleted_logs, remove_query_arg ( array (
|
1581 |
-
|
1582 |
-
|
1583 |
-
|
1584 |
-
|
1585 |
exit ();
|
1586 |
}
|
1587 |
} elseif ('-1' != $action && isset ( $_REQUEST ['id'] )) {
|
@@ -1595,10 +1647,10 @@
|
|
1595 |
else
|
1596 |
wp_die ( __ ( 'You are not allowed to delete this item.', 'yop_poll' ) );
|
1597 |
wp_redirect ( add_query_arg ( 'deleted', 1, remove_query_arg ( array (
|
1598 |
-
|
1599 |
-
|
1600 |
-
|
1601 |
-
|
1602 |
exit ();
|
1603 |
}
|
1604 |
|
@@ -1612,10 +1664,10 @@
|
|
1612 |
else
|
1613 |
wp_die ( __ ( 'You are not allowed to clone this item.', 'yop_poll' ) );
|
1614 |
wp_redirect ( add_query_arg ( 'cloned', 1, remove_query_arg ( array (
|
1615 |
-
|
1616 |
-
|
1617 |
-
|
1618 |
-
|
1619 |
exit ();
|
1620 |
}
|
1621 |
|
@@ -1629,10 +1681,10 @@
|
|
1629 |
else
|
1630 |
wp_die ( __ ( 'You are not allowed to reset stats for this item.', 'yop_poll' ) );
|
1631 |
wp_redirect ( add_query_arg ( 'reseted_votes', 1, remove_query_arg ( array (
|
1632 |
-
|
1633 |
-
|
1634 |
-
|
1635 |
-
|
1636 |
exit ();
|
1637 |
}
|
1638 |
|
@@ -1646,17 +1698,17 @@
|
|
1646 |
else
|
1647 |
wp_die ( __ ( 'You are not allowed to delete logs for this item.', 'yop_poll' ) );
|
1648 |
wp_redirect ( add_query_arg ( 'deleted_logs', 1, remove_query_arg ( array (
|
1649 |
-
|
1650 |
-
|
1651 |
-
|
1652 |
-
|
1653 |
exit ();
|
1654 |
}
|
1655 |
} elseif (! empty ( $_GET ['_wp_http_referer'] )) {
|
1656 |
wp_safe_redirect ( remove_query_arg ( array (
|
1657 |
-
|
1658 |
-
|
1659 |
-
|
1660 |
exit ();
|
1661 |
}
|
1662 |
}
|
@@ -1763,7 +1815,7 @@
|
|
1763 |
|
1764 |
</div>
|
1765 |
<h2><?php _e( 'Yop Poll', 'yop_poll' ); ?><a class="add-new-h2"
|
1766 |
-
|
1767 |
</h2>
|
1768 |
<?php
|
1769 |
if (isset ( $_REQUEST ['deleted'] )) {
|
@@ -1772,7 +1824,7 @@
|
|
1772 |
printf ( _n ( '%s Poll deleted.', '%s Polls deleted.', $deleted ), $deleted );
|
1773 |
echo '</p></div>';
|
1774 |
$_SERVER ['REQUEST_URI'] = remove_query_arg ( array (
|
1775 |
-
|
1776 |
), $_SERVER ['REQUEST_URI'] );
|
1777 |
}
|
1778 |
?>
|
@@ -1783,7 +1835,7 @@
|
|
1783 |
printf ( _n ( '%s Poll cloned.', '%s Polls cloned.', $cloned ), $cloned );
|
1784 |
echo '</p></div>';
|
1785 |
$_SERVER ['REQUEST_URI'] = remove_query_arg ( array (
|
1786 |
-
|
1787 |
), $_SERVER ['REQUEST_URI'] );
|
1788 |
}
|
1789 |
?>
|
@@ -1794,7 +1846,7 @@
|
|
1794 |
printf ( _n ( 'Vote reseted for %s Poll.', 'Votes reseted for %s Poll.', $reseted_votes ), $reseted_votes );
|
1795 |
echo '</p></div>';
|
1796 |
$_SERVER ['REQUEST_URI'] = remove_query_arg ( array (
|
1797 |
-
|
1798 |
), $_SERVER ['REQUEST_URI'] );
|
1799 |
}
|
1800 |
?>
|
@@ -1806,7 +1858,7 @@
|
|
1806 |
printf ( _n ( 'Log deleted for %s Poll.', 'Log deleted for %s Polls.', $deleted_logs ), $deleted_logs );
|
1807 |
echo '</p></div>';
|
1808 |
$_SERVER ['REQUEST_URI'] = remove_query_arg ( array (
|
1809 |
-
|
1810 |
), $_SERVER ['REQUEST_URI'] );
|
1811 |
}
|
1812 |
?>
|
@@ -1932,15 +1984,15 @@
|
|
1932 |
<?php } ?>
|
1933 |
</th>
|
1934 |
<td><strong>
|
1935 |
-
<?php if ( ( $this->current_user_can( 'edit_own_polls') && $yop_poll['poll_author'] == $current_user->ID ) || ($this->current_user_can( 'edit_polls' ) ) ) { ?>
|
1936 |
-
<a title="<?php echo $yop_poll['id']; ?>"
|
1937 |
-
href="<?php echo esc_url( add_query_arg( array( 'action' => 'edit', 'id' => $yop_poll['id'] ) ) ); ?>"
|
1938 |
-
class="row-title">
|
1939 |
-
<?php }?>
|
1940 |
-
<?php echo $yop_poll['id']; ?>
|
1941 |
<?php if ( ( $this->current_user_can( 'edit_own_polls') && $yop_poll['poll_author'] == $current_user->ID ) || ($this->current_user_can( 'edit_polls' ) ) ) { ?>
|
1942 |
-
|
1943 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1944 |
<td><strong>
|
1945 |
<?php if ( ( $this->current_user_can( 'edit_own_polls') && $yop_poll['poll_author'] == $current_user->ID ) || ($this->current_user_can( 'edit_polls' ) ) ) { ?>
|
1946 |
<a
|
@@ -1973,9 +2025,9 @@
|
|
1973 |
<?php } ?>
|
1974 |
<?php if ( ( $this->current_user_can( 'clone_own_polls') && $yop_poll['poll_author'] == $current_user->ID ) || ($this->current_user_can( 'clone_polls' ) ) ) { ?>
|
1975 |
<span class="clone"><a
|
1976 |
-
|
1977 |
-
|
1978 |
-
|
1979 |
</span>
|
1980 |
<?php } ?>
|
1981 |
<?php if ( ( $this->current_user_can( 'view_own_polls_results') && $yop_poll['poll_author'] == $current_user->ID ) || ($this->current_user_can( 'view_polls_results' ) ) ) { ?>
|
@@ -1992,9 +2044,9 @@
|
|
1992 |
<?php } ?>
|
1993 |
<?php if ( ( $this->current_user_can( 'delete_own_polls_logs') && $yop_poll['poll_author'] == $current_user->ID ) || ($this->current_user_can( 'delete_polls_logs' ) ) ) { ?>
|
1994 |
<span class="delete"><a
|
1995 |
-
|
1996 |
-
|
1997 |
-
|
1998 |
<?php } ?>
|
1999 |
</div></td>
|
2000 |
<td>
|
@@ -2126,12 +2178,12 @@
|
|
2126 |
else
|
2127 |
$display_other_answers_values = false;
|
2128 |
$poll_answers = YOP_POLL_MODEL::get_poll_answers ( $poll_id, array (
|
2129 |
-
|
2130 |
-
|
2131 |
), $results_order_by, $results_order, $display_other_answers_values );
|
2132 |
$poll_other_answer = YOP_POLL_MODEL::get_poll_answers ( $poll_id, array (
|
2133 |
-
|
2134 |
-
|
2135 |
|
2136 |
// other-answers
|
2137 |
$oa_per_page = (isset ( $_GET ['oa_per_page'] ) ? intval ( $_GET ['oa_per_page'] ) : 100);
|
@@ -2186,7 +2238,7 @@
|
|
2186 |
|
2187 |
</div>
|
2188 |
<h2><?php _e( 'Yop Poll Results', 'yop_poll' ); ?><a class="add-new-h2"
|
2189 |
-
|
2190 |
</h2>
|
2191 |
<?php
|
2192 |
if ($poll_details) {
|
@@ -2467,7 +2519,7 @@
|
|
2467 |
);
|
2468 |
$pagination = paginate_links ( $args );
|
2469 |
$_SERVER ['REQUEST_URI'] = remove_query_arg ( array (
|
2470 |
-
|
2471 |
), $_SERVER ['REQUEST_URI'] );
|
2472 |
?>
|
2473 |
<div class="wrap">
|
@@ -2476,7 +2528,7 @@
|
|
2476 |
|
2477 |
</div>
|
2478 |
<h2><?php _e( 'Custom Fields', 'yop_poll' ); ?><a class="add-new-h2"
|
2479 |
-
|
2480 |
</h2>
|
2481 |
<?php
|
2482 |
if ($poll_details) {
|
@@ -2496,17 +2548,17 @@
|
|
2496 |
<th><label for="yop-poll-custom-field-start-date-input"><?php _e( 'Start Date', 'yop_poll' ); ?>:</label>
|
2497 |
</th>
|
2498 |
<td><input id="yop-poll-custom-field-start-date-input" type="text"
|
2499 |
-
|
2500 |
</tr>
|
2501 |
<tr>
|
2502 |
<th><label for="yop-poll-custom-field-end-date-input"><?php _e( 'End Date', 'yop_poll' ); ?>:</label>
|
2503 |
</th>
|
2504 |
<td><input id="yop-poll-custom-field-end-date-input" type="text"
|
2505 |
-
|
2506 |
</tr>
|
2507 |
<tr>
|
2508 |
<th colspan="2"><input value="<?php _e( 'Filter', 'yop_poll' ); ?>"
|
2509 |
-
|
2510 |
</tr>
|
2511 |
</tbody>
|
2512 |
</table>
|
@@ -2638,8 +2690,8 @@
|
|
2638 |
|
2639 |
</div>
|
2640 |
<h2><?php _e( 'Yop Poll Templates', 'yop_poll' ); ?><a
|
2641 |
-
|
2642 |
-
|
2643 |
</h2>
|
2644 |
<?php
|
2645 |
if (isset ( $_REQUEST ['deleted'] )) {
|
@@ -2648,7 +2700,7 @@
|
|
2648 |
printf ( _n ( '%s Poll template deleted.', '%s Poll templates deleted.', $deleted ), $deleted );
|
2649 |
echo '</p></div>';
|
2650 |
$_SERVER ['REQUEST_URI'] = remove_query_arg ( array (
|
2651 |
-
|
2652 |
), $_SERVER ['REQUEST_URI'] );
|
2653 |
}
|
2654 |
?>
|
@@ -2659,7 +2711,7 @@
|
|
2659 |
printf ( _n ( '%s Poll template cloned.', '%s Poll templates cloned.', $cloned ), $cloned );
|
2660 |
echo '</p></div>';
|
2661 |
$_SERVER ['REQUEST_URI'] = remove_query_arg ( array (
|
2662 |
-
|
2663 |
), $_SERVER ['REQUEST_URI'] );
|
2664 |
}
|
2665 |
?>
|
@@ -2749,15 +2801,15 @@
|
|
2749 |
<?php } ?>
|
2750 |
<?php if ( ( $this->current_user_can( 'delete_own_polls_templates') && $template['template_author'] == $current_user->ID ) || ($this->current_user_can( 'delete_polls_templates' ) ) ) { ?>
|
2751 |
<span class="delete"><a
|
2752 |
-
|
2753 |
-
|
2754 |
-
|
2755 |
<?php } ?>
|
2756 |
<?php if ( ( $this->current_user_can( 'clone_own_polls_templates') && $template['template_author'] == $current_user->ID ) || ($this->current_user_can( 'clone_polls_templates' ) ) ) { ?>
|
2757 |
<span class="clone"><a
|
2758 |
-
|
2759 |
-
|
2760 |
-
|
2761 |
<?php } ?>
|
2762 |
</div></td>
|
2763 |
<td><strong>
|
@@ -2952,7 +3004,7 @@
|
|
2952 |
);
|
2953 |
$pagination = paginate_links ( $args );
|
2954 |
$_SERVER ['REQUEST_URI'] = remove_query_arg ( array (
|
2955 |
-
|
2956 |
), $_SERVER ['REQUEST_URI'] );
|
2957 |
?>
|
2958 |
<div class="wrap">
|
@@ -2968,7 +3020,7 @@
|
|
2968 |
printf ( _n ( '%s Poll Log deleted.', '%s Poll Logs deleted.', $deleted ), $deleted );
|
2969 |
echo '</p></div>';
|
2970 |
$_SERVER ['REQUEST_URI'] = remove_query_arg ( array (
|
2971 |
-
|
2972 |
), $_SERVER ['REQUEST_URI'] );
|
2973 |
}
|
2974 |
?>
|
@@ -3233,9 +3285,9 @@
|
|
3233 |
if (($this->current_user_can ( 'delete_own_polls_logs' ) && $poll_author == $current_user->ID) || ($this->current_user_can ( 'delete_polls_logs' ))) {
|
3234 |
?>
|
3235 |
<span class="delete"><a
|
3236 |
-
|
3237 |
-
|
3238 |
-
|
3239 |
<?php } ?>
|
3240 |
<?php
|
3241 |
|
@@ -3247,9 +3299,9 @@
|
|
3247 |
if (($this->current_user_can ( 'delete_own_polls_logs' ) && $poll_author == $current_user->ID) || ($this->current_user_can ( 'delete_polls_logs' ))) {
|
3248 |
?>
|
3249 |
<span class="delete"><a
|
3250 |
-
|
3251 |
-
|
3252 |
-
|
3253 |
<?php } ?>
|
3254 |
<?php } ?>
|
3255 |
</div></td>
|
@@ -3346,7 +3398,7 @@
|
|
3346 |
);
|
3347 |
$pagination = paginate_links ( $args );
|
3348 |
$_SERVER ['REQUEST_URI'] = remove_query_arg ( array (
|
3349 |
-
|
3350 |
), $_SERVER ['REQUEST_URI'] );
|
3351 |
?>
|
3352 |
<div class="wrap">
|
@@ -3355,8 +3407,8 @@
|
|
3355 |
|
3356 |
</div>
|
3357 |
<h2><?php _e( 'Yop Poll Bans', 'yop_poll' ); ?> <a
|
3358 |
-
|
3359 |
-
|
3360 |
</h2>
|
3361 |
<?php
|
3362 |
if (isset ( $_REQUEST ['deleted'] )) {
|
@@ -3365,7 +3417,7 @@
|
|
3365 |
printf ( _n ( '%s Poll Ban deleted!', '%s Poll Bans deleted!', $deleted ), $deleted );
|
3366 |
echo '</p></div>';
|
3367 |
$_SERVER ['REQUEST_URI'] = remove_query_arg ( array (
|
3368 |
-
|
3369 |
), $_SERVER ['REQUEST_URI'] );
|
3370 |
}
|
3371 |
?>
|
@@ -3376,7 +3428,7 @@
|
|
3376 |
printf ( _n ( '%s Poll Ban added!', '%s Poll Bans added!', $added ), $added );
|
3377 |
echo '</p></div>';
|
3378 |
$_SERVER ['REQUEST_URI'] = remove_query_arg ( array (
|
3379 |
-
|
3380 |
), $_SERVER ['REQUEST_URI'] );
|
3381 |
}
|
3382 |
?>
|
@@ -3386,7 +3438,7 @@
|
|
3386 |
print $_REQUEST ['bans-error'];
|
3387 |
echo '</p></div>';
|
3388 |
$_SERVER ['REQUEST_URI'] = remove_query_arg ( array (
|
3389 |
-
|
3390 |
), $_SERVER ['REQUEST_URI'] );
|
3391 |
}
|
3392 |
?>
|
@@ -3400,7 +3452,7 @@
|
|
3400 |
<tbody>
|
3401 |
<tr class="form-field form-required">
|
3402 |
<th scope="row"><label for="ban-poll-id"><?php _e( 'Poll', 'yop_poll' ); ?> <span
|
3403 |
-
|
3404 |
<td><select id="ban-poll-id" name="ban_poll_id">
|
3405 |
<option value="0"><?php _e( 'Bans For All Polls', 'yop_poll' ); ?></option>
|
3406 |
<?php
|
@@ -3416,7 +3468,7 @@
|
|
3416 |
</tr>
|
3417 |
<tr class="form-field form-required">
|
3418 |
<th scope="row"><label for="yop-poll-ban-type"><?php _e( 'Type', 'yop_poll' ); ?> <span
|
3419 |
-
|
3420 |
<td><select id="yop-poll-ban-type" name="ban_type">
|
3421 |
<option value=""><?php _e( 'Choose Ban Type', 'yop_poll' ); ?></option>
|
3422 |
<option value="ip"><?php _e( 'IP', 'yop_poll' ); ?></option>
|
@@ -3425,9 +3477,9 @@
|
|
3425 |
</tr>
|
3426 |
<tr class="form-field form-required">
|
3427 |
<th scope="row"><label for="yop-poll-ban-value"><?php _e( 'Value', 'yop_poll' ); ?> <span
|
3428 |
-
|
3429 |
<td><textarea rows="5" cols="20" id="yop-poll-ban-value"
|
3430 |
-
|
3431 |
</tr>
|
3432 |
</tbody>
|
3433 |
</table>
|
@@ -3574,14 +3626,14 @@
|
|
3574 |
<tr valign="middle" class="alternate"
|
3575 |
id="yop-poll-log<?php echo $ban['id']; ?>">
|
3576 |
<th class="check-column" scope="row"><input type="checkbox"
|
3577 |
-
|
3578 |
<td><strong><?php echo $ban['id']; ?></strong><br></td>
|
3579 |
<td><strong><?php echo esc_html( stripslashes( $ban['name'] ) ); ?></strong><br>
|
3580 |
<div class="row-actions">
|
3581 |
<span class="delete"><a
|
3582 |
-
|
3583 |
-
|
3584 |
-
|
3585 |
</div></td>
|
3586 |
<td>
|
3587 |
<?php echo esc_html( stripslashes( $ban['type'] ) ); ?>
|
@@ -3637,13 +3689,13 @@
|
|
3637 |
}
|
3638 |
public function yop_poll_options_admin_init() {
|
3639 |
register_setting ( 'yop_poll_options', 'yop_poll_options', array (
|
3640 |
-
|
3641 |
-
|
3642 |
-
|
3643 |
register_setting ( 'yop_poll_pro_options', 'yop_poll_pro_options', array (
|
3644 |
-
|
3645 |
-
|
3646 |
-
|
3647 |
}
|
3648 |
|
3649 |
public function yop_poll_pro_options_validate($input) {
|
@@ -3701,9 +3753,9 @@
|
|
3701 |
// allow_other_answers
|
3702 |
if (isset ( $input ['allow_other_answers'] )) {
|
3703 |
if (in_array ( $input ['allow_other_answers'], array (
|
3704 |
-
|
3705 |
-
|
3706 |
-
|
3707 |
if ($default_options ['allow_other_answers'] != trim ( $input ['allow_other_answers'] )) {
|
3708 |
$newinput ['allow_other_answers'] = trim ( $input ['allow_other_answers'] );
|
3709 |
$updated .= __ ( 'Option "Allow Other Answer" Updated!', 'yop_poll' ) . $message_delimiter;
|
@@ -3726,9 +3778,9 @@
|
|
3726 |
|
3727 |
if (isset ( $input ['add_other_answers_to_default_answers'] )) {
|
3728 |
if (in_array ( $input ['add_other_answers_to_default_answers'], array (
|
3729 |
-
|
3730 |
-
|
3731 |
-
|
3732 |
if ($default_options ['add_other_answers_to_default_answers'] != trim ( $input ['add_other_answers_to_default_answers'] )) {
|
3733 |
$newinput ['add_other_answers_to_default_answers'] = trim ( $input ['add_other_answers_to_default_answers'] );
|
3734 |
$updated .= __ ( 'Option "Add the values submitted in \'Other\' as answers" Updated!', 'yop_poll' ) . $message_delimiter;
|
@@ -3741,9 +3793,9 @@
|
|
3741 |
|
3742 |
if (isset ( $input ['display_other_answers_values'] )) {
|
3743 |
if (in_array ( $input ['display_other_answers_values'], array (
|
3744 |
-
|
3745 |
-
|
3746 |
-
|
3747 |
if ($default_options ['display_other_answers_values'] != trim ( $input ['display_other_answers_values'] )) {
|
3748 |
$newinput ['display_other_answers_values'] = trim ( $input ['display_other_answers_values'] );
|
3749 |
$updated .= __ ( 'Option "Display Other Answers Values" Updated!', 'yop_poll' ) . $message_delimiter;
|
@@ -3759,9 +3811,9 @@
|
|
3759 |
// allow_multiple_answers
|
3760 |
if (isset ( $input ['allow_multiple_answers'] )) {
|
3761 |
if (in_array ( $input ['allow_multiple_answers'], array (
|
3762 |
-
|
3763 |
-
|
3764 |
-
|
3765 |
if ($default_options ['allow_multiple_answers'] != trim ( $input ['allow_multiple_answers'] )) {
|
3766 |
$newinput ['allow_multiple_answers'] = trim ( $input ['allow_multiple_answers'] );
|
3767 |
$updated .= __ ( 'Option "Allow Multiple Answers" Updated!', 'yop_poll' ) . $message_delimiter;
|
@@ -3800,9 +3852,9 @@
|
|
3800 |
|
3801 |
if (isset ( $input ['use_captcha'] )) {
|
3802 |
if (in_array ( $input ['use_captcha'], array (
|
3803 |
-
|
3804 |
-
|
3805 |
-
|
3806 |
if ($default_options ['use_captcha'] != trim ( $input ['use_captcha'] )) {
|
3807 |
$newinput ['use_captcha'] = trim ( $input ['use_captcha'] );
|
3808 |
$updated .= __ ( 'Option "Use CAPTCHA" Updated!', 'yop_poll' ) . $message_delimiter;
|
@@ -3816,10 +3868,10 @@
|
|
3816 |
// display_answers
|
3817 |
if (isset ( $input ['display_answers'] )) {
|
3818 |
if (in_array ( $input ['display_answers'], array (
|
3819 |
-
|
3820 |
-
|
3821 |
-
|
3822 |
-
|
3823 |
if ($default_options ['display_answers'] != trim ( $input ['display_answers'] )) {
|
3824 |
$newinput ['display_answers'] = trim ( $input ['display_answers'] );
|
3825 |
$updated .= __ ( 'Option "Display Answers" Updated!', 'yop_poll' ) . $message_delimiter;
|
@@ -3848,10 +3900,10 @@
|
|
3848 |
// display_results
|
3849 |
if (isset ( $input ['display_results'] )) {
|
3850 |
if (in_array ( $input ['display_results'], array (
|
3851 |
-
|
3852 |
-
|
3853 |
-
|
3854 |
-
|
3855 |
if ($default_options ['display_results'] != trim ( $input ['display_results'] )) {
|
3856 |
$newinput ['display_results'] = trim ( $input ['display_results'] );
|
3857 |
$updated .= __ ( 'Option "Display Results" Updated!', 'yop_poll' ) . $message_delimiter;
|
@@ -3905,9 +3957,9 @@
|
|
3905 |
// use_template_bar
|
3906 |
if (isset ( $input ['use_template_bar'] )) {
|
3907 |
if (in_array ( $input ['use_template_bar'], array (
|
3908 |
-
|
3909 |
-
|
3910 |
-
|
3911 |
if ($default_options ['use_template_bar'] != trim ( $input ['use_template_bar'] )) {
|
3912 |
$newinput ['use_template_bar'] = trim ( $input ['use_template_bar'] );
|
3913 |
$updated .= __ ( 'Option "Use Template Result Bar" Updated!', 'yop_poll' ) . $message_delimiter;
|
@@ -3988,11 +4040,11 @@
|
|
3988 |
// sorting_answers
|
3989 |
if (isset ( $input ['sorting_answers'] )) {
|
3990 |
if (in_array ( $input ['sorting_answers'], array (
|
3991 |
-
|
3992 |
-
|
3993 |
-
|
3994 |
-
|
3995 |
-
|
3996 |
if ($default_options ['sorting_answers'] != trim ( $input ['sorting_answers'] )) {
|
3997 |
$newinput ['sorting_answers'] = trim ( $input ['sorting_answers'] );
|
3998 |
$updated .= __ ( 'Option "Sort Answers" Updated!', 'yop_poll' ) . $message_delimiter;
|
@@ -4001,9 +4053,9 @@
|
|
4001 |
// sorting_answers_direction
|
4002 |
if (isset ( $input ['sorting_answers_direction'] )) {
|
4003 |
if (in_array ( $input ['sorting_answers_direction'], array (
|
4004 |
-
|
4005 |
-
|
4006 |
-
|
4007 |
if ($default_options ['sorting_answers_direction'] != trim ( $input ['sorting_answers_direction'] )) {
|
4008 |
$newinput ['sorting_answers_direction'] = trim ( $input ['sorting_answers_direction'] );
|
4009 |
$updated .= __ ( 'Option "Sort Answers Direction" Updated!', 'yop_poll' ) . $message_delimiter;
|
@@ -4022,11 +4074,11 @@
|
|
4022 |
// sorting_results
|
4023 |
if (isset ( $input ['sorting_answers'] )) {
|
4024 |
if (in_array ( $input ['sorting_results'], array (
|
4025 |
-
|
4026 |
-
|
4027 |
-
|
4028 |
-
|
4029 |
-
|
4030 |
if ($default_options ['sorting_results'] != trim ( $input ['sorting_results'] )) {
|
4031 |
$newinput ['sorting_results'] = trim ( $input ['sorting_results'] );
|
4032 |
$updated .= __ ( 'Option "Sort Results" Updated!', 'yop_poll' ) . $message_delimiter;
|
@@ -4035,9 +4087,9 @@
|
|
4035 |
// sorting_results_direction
|
4036 |
if (isset ( $input ['sorting_results_direction'] )) {
|
4037 |
if (in_array ( $input ['sorting_results_direction'], array (
|
4038 |
-
|
4039 |
-
|
4040 |
-
|
4041 |
if ($default_options ['sorting_results_direction'] != trim ( $input ['sorting_results_direction'] )) {
|
4042 |
$newinput ['sorting_results_direction'] = trim ( $input ['sorting_results_direction'] );
|
4043 |
$updated .= __ ( 'Option "Sort Results Direction" Updated!', 'yop_poll' ) . $message_delimiter;
|
@@ -4076,7 +4128,8 @@
|
|
4076 |
$newinput ['end_date'] = '9999-12-31 23:59:59';
|
4077 |
$updated .= __ ( 'Option "Poll End Date" Updated!', 'yop_poll' ) . $message_delimiter;
|
4078 |
}
|
4079 |
-
}
|
|
|
4080 |
if (isset ( $input ['end_date'] )) {
|
4081 |
if ('' != $input ['end_date']) {
|
4082 |
if ($default_options ['end_date'] != trim ( $input ['end_date'] )) {
|
@@ -4093,12 +4146,12 @@
|
|
4093 |
// view_results
|
4094 |
if (isset ( $input ['view_results'] )) {
|
4095 |
if (in_array ( $input ['view_results'], array (
|
4096 |
-
|
4097 |
-
|
4098 |
-
|
4099 |
-
|
4100 |
-
|
4101 |
-
|
4102 |
if ($default_options ['view_results'] != trim ( $input ['view_results'] )) {
|
4103 |
$newinput ['view_results'] = trim ( $input ['view_results'] );
|
4104 |
$updated .= __ ( 'Option "View Results" Updated!', 'yop_poll' ) . $message_delimiter;
|
@@ -4122,10 +4175,10 @@
|
|
4122 |
// vote_permisions
|
4123 |
if (isset ( $input ['view_results_permissions'] )) {
|
4124 |
if (in_array ( $input ['view_results_permissions'], array (
|
4125 |
-
|
4126 |
-
|
4127 |
-
|
4128 |
-
|
4129 |
if ($default_options ['view_results_permissions'] != trim ( $input ['view_results_permissions'] )) {
|
4130 |
$newinput ['view_results_permissions'] = trim ( $input ['view_results_permissions'] );
|
4131 |
$updated .= __ ( 'Option "View Results Permissions" Updated!', 'yop_poll' ) . $message_delimiter;
|
@@ -4139,10 +4192,10 @@
|
|
4139 |
// view_results_type
|
4140 |
if (isset ( $input ['view_results_type'] )) {
|
4141 |
if (in_array ( $input ['view_results_type'], array (
|
4142 |
-
|
4143 |
-
|
4144 |
-
|
4145 |
-
|
4146 |
if ($default_options ['view_results_type'] != trim ( $input ['view_results_type'] )) {
|
4147 |
$newinput ['view_results_type'] = trim ( $input ['view_results_type'] );
|
4148 |
$updated .= __ ( 'Option "View Results Type" Updated!', 'yop_poll' ) . $message_delimiter;
|
@@ -4237,9 +4290,9 @@
|
|
4237 |
// view_results_link
|
4238 |
if (isset ( $input ['view_results_link'] )) {
|
4239 |
if (in_array ( $input ['view_results_link'], array (
|
4240 |
-
|
4241 |
-
|
4242 |
-
|
4243 |
if ($default_options ['view_results_link'] != trim ( $input ['view_results_link'] )) {
|
4244 |
$newinput ['view_results_link'] = trim ( $input ['view_results_link'] );
|
4245 |
$updated .= __ ( 'Option "View Results Link" Updated!', 'yop_poll' ) . $message_delimiter;
|
@@ -4268,9 +4321,9 @@
|
|
4268 |
// view_back_to_vote_link
|
4269 |
if (isset ( $input ['view_back_to_vote_link'] )) {
|
4270 |
if (in_array ( $input ['view_back_to_vote_link'], array (
|
4271 |
-
|
4272 |
-
|
4273 |
-
|
4274 |
if ($default_options ['view_back_to_vote_link'] != trim ( $input ['view_back_to_vote_link'] )) {
|
4275 |
$newinput ['view_back_to_vote_link'] = trim ( $input ['view_back_to_vote_link'] );
|
4276 |
$updated .= __ ( 'Option "View Back To Vote Link" Updated!', 'yop_poll' ) . $message_delimiter;
|
@@ -4299,9 +4352,9 @@
|
|
4299 |
// view_total_votes
|
4300 |
if (isset ( $input ['view_total_votes'] )) {
|
4301 |
if (in_array ( $input ['view_total_votes'], array (
|
4302 |
-
|
4303 |
-
|
4304 |
-
|
4305 |
if ($default_options ['view_total_votes'] != trim ( $input ['view_total_votes'] )) {
|
4306 |
$newinput ['view_total_votes'] = trim ( $input ['view_total_votes'] );
|
4307 |
$updated .= __ ( 'Option "View Total Votes" Updated!', 'yop_poll' ) . $message_delimiter;
|
@@ -4330,9 +4383,9 @@
|
|
4330 |
// view_total_answers
|
4331 |
if (isset ( $input ['view_total_answers'] )) {
|
4332 |
if (in_array ( $input ['view_total_answers'], array (
|
4333 |
-
|
4334 |
-
|
4335 |
-
|
4336 |
if ($default_options ['view_total_answers'] != trim ( $input ['view_total_answers'] )) {
|
4337 |
$newinput ['view_total_answers'] = trim ( $input ['view_total_answers'] );
|
4338 |
$updated .= __ ( 'Option "View Total Answers" Updated!', 'yop_poll' ) . $message_delimiter;
|
@@ -4368,9 +4421,9 @@
|
|
4368 |
// use_default_loading_image
|
4369 |
if (isset ( $input ['use_default_loading_image'] )) {
|
4370 |
if (in_array ( $input ['use_default_loading_image'], array (
|
4371 |
-
|
4372 |
-
|
4373 |
-
|
4374 |
if ($default_options ['use_default_loading_image'] != trim ( $input ['use_default_loading_image'] )) {
|
4375 |
$newinput ['use_default_loading_image'] = trim ( $input ['use_default_loading_image'] );
|
4376 |
$updated .= __ ( 'Option "Use Default Loading Image" Updated!', 'yop_poll' ) . $message_delimiter;
|
@@ -4398,19 +4451,19 @@
|
|
4398 |
// vote_permisions
|
4399 |
if (isset ( $input ['vote_permisions'] )) {
|
4400 |
if (in_array ( $input ['vote_permisions'], array (
|
4401 |
-
|
4402 |
-
|
4403 |
-
|
4404 |
-
|
4405 |
if ($default_options ['vote_permisions'] != trim ( $input ['vote_permisions'] )) {
|
4406 |
$newinput ['vote_permisions'] = trim ( $input ['vote_permisions'] );
|
4407 |
$updated .= __ ( 'Option "Vote Permissions" Updated!', 'yop_poll' ) . $message_delimiter;
|
4408 |
}
|
4409 |
|
4410 |
if (in_array ( $input ['vote_permisions'], array (
|
4411 |
-
|
4412 |
-
|
4413 |
-
|
4414 |
|
4415 |
if ( isset( $input['vote_permisions_facebook'] ) && in_array( $input['vote_permisions_facebook'], array( 'yes', 'no' ) ) ) {
|
4416 |
if ( $default_options ['vote_permisions_facebook'] != trim ( $input ['vote_permisions_facebook'] ) ) {
|
@@ -4460,12 +4513,12 @@
|
|
4460 |
// blocking_voters
|
4461 |
if (isset ( $input ['blocking_voters'] )) {
|
4462 |
if (in_array ( $input ['blocking_voters'], array (
|
4463 |
-
|
4464 |
-
|
4465 |
-
|
4466 |
-
|
4467 |
-
|
4468 |
-
|
4469 |
if ($default_options ['blocking_voters'] != trim ( $input ['blocking_voters'] )) {
|
4470 |
$newinput ['blocking_voters'] = trim ( $input ['blocking_voters'] );
|
4471 |
$updated .= __ ( 'Option "Blocking Voters" Updated!', 'yop_poll' ) . $message_delimiter;
|
@@ -4488,11 +4541,11 @@
|
|
4488 |
// blocking_voters_interval_unit
|
4489 |
if (isset ( $input ['blocking_voters_interval_unit'] )) {
|
4490 |
if (in_array ( $input ['blocking_voters_interval_unit'], array (
|
4491 |
-
|
4492 |
-
|
4493 |
-
|
4494 |
-
|
4495 |
-
|
4496 |
if ($default_options ['blocking_voters_interval_unit'] != trim ( $input ['blocking_voters_interval_unit'] )) {
|
4497 |
$newinput ['blocking_voters_interval_unit'] = trim ( $input ['blocking_voters_interval_unit'] );
|
4498 |
$updated .= __ ( 'Option "Blocking Voters Interval Unit" Updated!', 'yop_poll' ) . $message_delimiter;
|
@@ -4512,9 +4565,9 @@
|
|
4512 |
// limit_number_of_votes_per_user
|
4513 |
if (isset ( $input ['limit_number_of_votes_per_user'] )) {
|
4514 |
if (in_array ( $input ['limit_number_of_votes_per_user'], array (
|
4515 |
-
|
4516 |
-
|
4517 |
-
|
4518 |
if ($default_options ['limit_number_of_votes_per_user'] != trim ( $input ['limit_number_of_votes_per_user'] )) {
|
4519 |
$newinput ['limit_number_of_votes_per_user'] = trim ( $input ['limit_number_of_votes_per_user'] );
|
4520 |
$updated .= __ ( 'Option "Limit Number of Votes per User" Updated!', 'yop_poll' ) . $message_delimiter;
|
@@ -4555,9 +4608,9 @@
|
|
4555 |
// redirect_after_vote
|
4556 |
if (isset ( $input ['redirect_after_vote'] )) {
|
4557 |
if (in_array ( $input ['redirect_after_vote'], array (
|
4558 |
-
|
4559 |
-
|
4560 |
-
|
4561 |
if ($default_options ['redirect_after_vote'] != trim ( $input ['redirect_after_vote'] )) {
|
4562 |
$newinput ['redirect_after_vote'] = trim ( $input ['redirect_after_vote'] );
|
4563 |
$updated .= __ ( 'Option "Redirect After Vote" Updated!', 'yop_poll' ) . $message_delimiter;
|
@@ -4594,9 +4647,9 @@
|
|
4594 |
// view_poll_archive_link
|
4595 |
if (isset ( $input ['view_poll_archive_link'] )) {
|
4596 |
if (in_array ( $input ['view_poll_archive_link'], array (
|
4597 |
-
|
4598 |
-
|
4599 |
-
|
4600 |
if ($default_options ['view_poll_archive_link'] != trim ( $input ['view_poll_archive_link'] )) {
|
4601 |
$newinput ['view_poll_archive_link'] = trim ( $input ['view_poll_archive_link'] );
|
4602 |
$updated .= __ ( 'Option "View Poll Archive Link" Updated!', 'yop_poll' ) . $message_delimiter;
|
@@ -4637,9 +4690,9 @@
|
|
4637 |
// show_in_archive
|
4638 |
if (isset ( $input ['show_in_archive'] )) {
|
4639 |
if (in_array ( $input ['show_in_archive'], array (
|
4640 |
-
|
4641 |
-
|
4642 |
-
|
4643 |
if ($default_options ['show_in_archive'] != trim ( $input ['show_in_archive'] )) {
|
4644 |
$newinput ['show_in_archive'] = trim ( $input ['show_in_archive'] );
|
4645 |
$updated .= __ ( 'Option "Show Poll in Arhive" Updated!', 'yop_poll' ) . $message_delimiter;
|
@@ -4668,9 +4721,9 @@
|
|
4668 |
// send_email_notifications
|
4669 |
if (isset ( $input ['send_email_notifications'] )) {
|
4670 |
if (in_array ( $input ['send_email_notifications'], array (
|
4671 |
-
|
4672 |
-
|
4673 |
-
|
4674 |
if ($default_options ['send_email_notifications'] != trim ( $input ['send_email_notifications'] )) {
|
4675 |
$newinput ['send_email_notifications'] = trim ( $input ['send_email_notifications'] );
|
4676 |
$updated .= __ ( 'Option "Send Email Notifications" Updated!', 'yop_poll' ) . $message_delimiter;
|
@@ -4764,9 +4817,9 @@
|
|
4764 |
//share after vote
|
4765 |
if ( isset ( $input ['share_after_vote'] ) ) {
|
4766 |
if (in_array ( $input ['share_after_vote'], array (
|
4767 |
-
|
4768 |
-
|
4769 |
-
|
4770 |
if ($default_options ['share_after_vote'] != trim ( $input ['share_after_vote'] )) {
|
4771 |
$newinput ['share_after_vote'] = trim ( $input ['share_after_vote'] );
|
4772 |
$updated .= __ ( 'Option "Share After Vote" Updated!', 'yop_poll' ) . $message_delimiter;
|
@@ -4812,9 +4865,9 @@
|
|
4812 |
//start_scheduler
|
4813 |
if ( isset ( $input ['start_scheduler'] ) ) {
|
4814 |
if (in_array ( $input ['start_scheduler'], array (
|
4815 |
-
|
4816 |
-
|
4817 |
-
|
4818 |
if ($default_options ['start_scheduler'] != trim ( $input ['start_scheduler'] )) {
|
4819 |
$newinput ['start_scheduler'] = trim ( $input ['start_scheduler'] );
|
4820 |
$updated .= __ ( 'Option "Start Scheduler" Updated!', 'yop_poll' ) . $message_delimiter;
|
@@ -4951,9 +5004,9 @@
|
|
4951 |
<?php _e( 'Max Number of allowed answers', 'yop_poll' ); ?>:
|
4952 |
</th>
|
4953 |
<td><input id="yop-poll-allow-multiple-answers-number"
|
4954 |
-
|
4955 |
-
|
4956 |
-
|
4957 |
</td>
|
4958 |
</tr>
|
4959 |
<tr class="yop_poll_suboption" id="yop-poll-allow-multiple-answers-div1" style="<?php echo $default_options['allow_multiple_answers'] == 'no' ? 'display: none;' : ''; ?>">
|
@@ -4961,9 +5014,9 @@
|
|
4961 |
<?php _e( 'Min Number of allowed answers', 'yop_poll' ); ?>:
|
4962 |
</th>
|
4963 |
<td><input id="yop-poll-allow-multiple-answers-min-number"
|
4964 |
-
|
4965 |
-
|
4966 |
-
|
4967 |
</td>
|
4968 |
</tr>
|
4969 |
</tbody>
|
@@ -5021,9 +5074,9 @@
|
|
5021 |
<?php _e( 'Columns', 'yop_poll' ); ?>:
|
5022 |
</th>
|
5023 |
<td><input id="yop-poll-display-answers-tabulated-cols"
|
5024 |
-
|
5025 |
-
|
5026 |
-
|
5027 |
</td>
|
5028 |
</tr>
|
5029 |
<tr>
|
@@ -5052,9 +5105,9 @@
|
|
5052 |
<?php _e( 'Columns', 'yop_poll' ); ?>:
|
5053 |
</th>
|
5054 |
<td><input id="yop-poll-display-results-tabulated-cols"
|
5055 |
-
|
5056 |
-
|
5057 |
-
|
5058 |
</td>
|
5059 |
</tr>
|
5060 |
<tr>
|
@@ -5062,9 +5115,9 @@
|
|
5062 |
<?php _e( 'Poll Template Width', 'yop_poll' ); ?>:
|
5063 |
</th>
|
5064 |
<td><input id="yop-poll-template-width"
|
5065 |
-
|
5066 |
-
|
5067 |
-
|
5068 |
</td>
|
5069 |
</tr>
|
5070 |
<tr>
|
@@ -5072,9 +5125,9 @@
|
|
5072 |
<?php _e( 'Widget Template Width', 'yop_poll' ); ?>:
|
5073 |
</th>
|
5074 |
<td><input id="yop-poll-widget-template-width"
|
5075 |
-
|
5076 |
-
|
5077 |
-
|
5078 |
</td>
|
5079 |
</tr>
|
5080 |
</tbody>
|
@@ -5110,38 +5163,38 @@
|
|
5110 |
<th><label for="yop-poll-bar-background"><?php _e ( 'Background Color', 'yop_poll' ); ?></label>
|
5111 |
</th>
|
5112 |
<td>#<input class="yop-small-input"
|
5113 |
-
|
5114 |
-
|
5115 |
-
|
5116 |
-
|
5117 |
</td>
|
5118 |
</tr>
|
5119 |
<tr class="yop-poll-custom-result-bar-table yop_poll_suboption" style="<?php echo $default_options['use_template_bar'] == 'yes' ? 'display: none;' : ''; ?>">
|
5120 |
<th><label for="yop-poll-bar-height"><?php _e ( 'Height', 'yop_poll' ); ?></label>
|
5121 |
</th>
|
5122 |
<td><input class="yop-small-input" id="yop-poll-bar-height"
|
5123 |
-
|
5124 |
-
|
5125 |
-
|
5126 |
</tr>
|
5127 |
<tr class="yop-poll-custom-result-bar-table yop_poll_suboption" style="<?php echo $default_options['use_template_bar'] == 'yes' ? 'display: none;' : ''; ?>">
|
5128 |
<th><label for="yop-poll-bar-border-color"><?php _e ( 'Border Color', 'yop_poll' ) ?></label>
|
5129 |
</th>
|
5130 |
<td>#<input class="yop-small-input"
|
5131 |
-
|
5132 |
-
|
5133 |
-
|
5134 |
-
|
5135 |
</td>
|
5136 |
</tr>
|
5137 |
<tr class="yop-poll-custom-result-bar-table yop_poll_suboption" style="<?php echo $default_options['use_template_bar'] == 'yes' ? 'display: none;' : ''; ?>">
|
5138 |
<th><label for="yop-poll-bar-border-width"><?php _e ( 'Border Width', 'yop_poll' ); ?></label>
|
5139 |
</th>
|
5140 |
<td><input class="yop-small-input"
|
5141 |
-
|
5142 |
-
|
5143 |
-
|
5144 |
-
|
5145 |
</td>
|
5146 |
</tr>
|
5147 |
<tr class="yop-poll-custom-result-bar-table yop_poll_suboption" style="<?php echo $default_options['use_template_bar'] == 'yes' ? 'display: none;' : ''; ?>">
|
@@ -5290,8 +5343,8 @@
|
|
5290 |
<th><label for="yop-poll-start-date-input"><?php _e( 'Start Date', 'yop_poll' ); ?>:</label><br><font size="0">(<?php _e('Current Server Time', 'yop_poll'); echo ': ' . current_time( 'mysql' ); ?>)</font>
|
5291 |
</th>
|
5292 |
<td><input id="yop-poll-start-date-input" type="text"
|
5293 |
-
|
5294 |
-
|
5295 |
</td>
|
5296 |
</tr>
|
5297 |
<tr>
|
@@ -5433,8 +5486,8 @@
|
|
5433 |
<?php _e( 'Vote Button Label', 'yop_poll' ); ?>:
|
5434 |
</th>
|
5435 |
<td><input id="yop-poll-vote-button-label" type="text"
|
5436 |
-
|
5437 |
-
|
5438 |
</td>
|
5439 |
</tr>
|
5440 |
<tr>
|
@@ -5456,8 +5509,8 @@
|
|
5456 |
<?php _e( 'View Results Link Label', 'yop_poll' ); ?>:
|
5457 |
</th>
|
5458 |
<td><input id="yop-poll-view-results-link-label" type="text"
|
5459 |
-
|
5460 |
-
|
5461 |
</td>
|
5462 |
</tr>
|
5463 |
<tr>
|
@@ -5479,9 +5532,9 @@
|
|
5479 |
<?php _e( 'View Back To Vote Link Label', 'yop_poll' ); ?>:
|
5480 |
</th>
|
5481 |
<td><input id="yop-poll-view-back-to-vote-link-label"
|
5482 |
-
|
5483 |
-
|
5484 |
-
|
5485 |
</td>
|
5486 |
</tr>
|
5487 |
<tr>
|
@@ -5503,8 +5556,8 @@
|
|
5503 |
<?php _e( 'View Total Votes Label', 'yop_poll' ); ?>:
|
5504 |
</th>
|
5505 |
<td><input id="yop-poll-view-total-votes-label" type="text"
|
5506 |
-
|
5507 |
-
|
5508 |
</td>
|
5509 |
</tr>
|
5510 |
<tr>
|
@@ -5526,8 +5579,8 @@
|
|
5526 |
<?php _e( 'View Total Answers Label', 'yop_poll' ); ?>:
|
5527 |
</th>
|
5528 |
<td><input id="yop-poll-view-total-answers-label" type="text"
|
5529 |
-
|
5530 |
-
|
5531 |
</td>
|
5532 |
</tr>
|
5533 |
<tr>
|
@@ -5535,16 +5588,16 @@
|
|
5535 |
<?php _e( 'Message After Vote', 'yop_poll' ); ?>:
|
5536 |
</th>
|
5537 |
<td><input id="yop-poll-message-after-vote" type="text"
|
5538 |
-
|
5539 |
-
|
5540 |
</td>
|
5541 |
</tr>
|
5542 |
<tr>
|
5543 |
<th><label for="yop-poll-page-url"><?php _e( 'Poll Page Url ', 'yop_poll' ); ?>:</label>
|
5544 |
</th>
|
5545 |
<td><input id="yop-poll-page-url" type="text"
|
5546 |
-
|
5547 |
-
|
5548 |
</td>
|
5549 |
</tr>
|
5550 |
</tbody>
|
@@ -5606,8 +5659,8 @@
|
|
5606 |
<?php _e( '"Vote as Facebook User" Button Label', 'yop_poll' ); ?>:
|
5607 |
</th>
|
5608 |
<td><input id="yop-poll-vote-permisions-facebook-label" type="text"
|
5609 |
-
|
5610 |
-
|
5611 |
</td>
|
5612 |
</tr>
|
5613 |
<?php } ?>
|
@@ -5631,8 +5684,8 @@
|
|
5631 |
<?php _e( '"Vote as Wordpress User" Button Label', 'yop_poll' ); ?>:
|
5632 |
</th>
|
5633 |
<td><input id="yop-poll-vote-permisions-wordpress-label" type="text"
|
5634 |
-
|
5635 |
-
|
5636 |
</td>
|
5637 |
</tr>
|
5638 |
|
@@ -5655,8 +5708,8 @@
|
|
5655 |
<?php _e( '"Vote as Anonymous User" Button Label', 'yop_poll' ); ?>:
|
5656 |
</th>
|
5657 |
<td><input id="yop-poll-vote-permisions-anonymous-label" type="text"
|
5658 |
-
|
5659 |
-
|
5660 |
</td>
|
5661 |
</tr>
|
5662 |
|
@@ -5734,8 +5787,8 @@
|
|
5734 |
<?php _e( 'Number of Votes per User', 'yop_poll' ); ?>:
|
5735 |
</th>
|
5736 |
<td><input id="yop-poll-number-of-votes-per-user" type="text"
|
5737 |
-
|
5738 |
-
|
5739 |
</td>
|
5740 |
</tr>
|
5741 |
<tr>
|
@@ -5743,8 +5796,8 @@
|
|
5743 |
<?php _e( 'Percentages Decimals', 'yop_poll' ); ?>:
|
5744 |
</th>
|
5745 |
<td><input id="yop-poll-percentages-decimals" type="text"
|
5746 |
-
|
5747 |
-
|
5748 |
</td>
|
5749 |
</tr>
|
5750 |
<tr>
|
@@ -5768,8 +5821,8 @@
|
|
5768 |
<?php _e( 'Loading Image Url', 'yop_poll' ); ?>:
|
5769 |
</th>
|
5770 |
<td><input id="yop-poll-loading-image-url" type="text"
|
5771 |
-
|
5772 |
-
|
5773 |
</td>
|
5774 |
</tr>
|
5775 |
|
@@ -5794,8 +5847,8 @@
|
|
5794 |
<?php _e( 'Redirect After Vote Url', 'yop_poll' ); ?>:
|
5795 |
</th>
|
5796 |
<td><input id="yop-poll-redirect-after-vote-url" type="text"
|
5797 |
-
|
5798 |
-
|
5799 |
</td>
|
5800 |
</tr>
|
5801 |
<tr>
|
@@ -5803,8 +5856,8 @@
|
|
5803 |
<?php _e( 'Poll Date Format', 'yop_poll' ); ?>: <br /><font size="0"><?php _e('Check', 'yop_popll') ?> <a target="_blank" href="http://codex.wordpress.org/Formatting_Date_and_Time"> <?php _e('documentation', 'yop_popll') ?></a></font>
|
5804 |
</th>
|
5805 |
<td><input id="yop-poll-date-format" type="text"
|
5806 |
-
|
5807 |
-
|
5808 |
</td>
|
5809 |
</tr>
|
5810 |
</tbody>
|
@@ -5842,9 +5895,9 @@
|
|
5842 |
<?php _e( 'View Poll Archive Link Label', 'yop_poll' ); ?>:
|
5843 |
</th>
|
5844 |
<td><input id="yop-poll-view-poll-archive-link-label"
|
5845 |
-
|
5846 |
-
|
5847 |
-
|
5848 |
</td>
|
5849 |
</tr>
|
5850 |
<tr id="yop-poll-view-poll-archive-link-div" style="<?php echo 'yes' != $default_options['view_poll_archive_link'] ? 'display: none;' : ''; ?>">
|
@@ -5852,8 +5905,8 @@
|
|
5852 |
<?php _e( 'Poll Archive Url', 'yop_poll' ); ?>:
|
5853 |
</th>
|
5854 |
<td><input id="yop-poll-poll-archive-url" type="text"
|
5855 |
-
|
5856 |
-
|
5857 |
</td>
|
5858 |
</tr>
|
5859 |
<tr>
|
@@ -5875,8 +5928,8 @@
|
|
5875 |
<?php _e( 'Archive Order', 'yop_poll' ); ?>:
|
5876 |
</th>
|
5877 |
<td><input id="yop-poll-show-in-archive-order" type="text"
|
5878 |
-
|
5879 |
-
|
5880 |
</td>
|
5881 |
</tr>
|
5882 |
<tr>
|
@@ -5884,8 +5937,8 @@
|
|
5884 |
<?php _e( 'Archive Polls Per Page', 'yop_poll' ); ?>:
|
5885 |
</th>
|
5886 |
<td><input id="yop-poll-archive-polls-per-page" type="text"
|
5887 |
-
|
5888 |
-
|
5889 |
</td>
|
5890 |
</tr>
|
5891 |
|
@@ -6011,9 +6064,9 @@
|
|
6011 |
<?php _e( 'Share Name', 'yop_poll' ); ?>:
|
6012 |
</th>
|
6013 |
<td><input id="yop-poll-share-name"
|
6014 |
-
|
6015 |
-
|
6016 |
-
|
6017 |
</td>
|
6018 |
</tr>
|
6019 |
<tr class="yop_poll_suboption" id="yop-poll-share-after-vote-caption-tr" style="<?php echo 'yes' != $default_options['share_after_vote'] ? 'display: none;' : ''; ?>">
|
@@ -6021,9 +6074,9 @@
|
|
6021 |
<?php _e( 'Share Caption', 'yop_poll' ); ?>:
|
6022 |
</th>
|
6023 |
<td><input id="yop-poll-share-caption"
|
6024 |
-
|
6025 |
-
|
6026 |
-
|
6027 |
</td>
|
6028 |
</tr>
|
6029 |
<tr class="yop_poll_suboption" id="yop-poll-share-after-vote-description-tr" style="<?php echo 'yes' != $default_options['share_after_vote'] ? 'display: none;' : ''; ?>">
|
@@ -6031,9 +6084,9 @@
|
|
6031 |
<?php _e( 'Share Description', 'yop_poll' ); ?>:
|
6032 |
</th>
|
6033 |
<td><input id="yop-poll-share-description"
|
6034 |
-
|
6035 |
-
|
6036 |
-
|
6037 |
</td>
|
6038 |
</tr>
|
6039 |
<tr class="yop_poll_suboption" id="yop-poll-share-after-vote-picture-tr" style="<?php echo 'yes' != $default_options['share_after_vote'] ? 'display: none;' : ''; ?>">
|
@@ -6041,9 +6094,9 @@
|
|
6041 |
<?php _e( 'Share Picture', 'yop_poll' ); ?>:
|
6042 |
</th>
|
6043 |
<td><input id="yop-poll-share-picture"
|
6044 |
-
|
6045 |
-
|
6046 |
-
|
6047 |
</td>
|
6048 |
</tr>
|
6049 |
|
@@ -6105,8 +6158,8 @@
|
|
6105 |
$yop_poll_model = new Yop_Poll_Model ( $poll_id );
|
6106 |
$answers = Yop_Poll_Model::get_poll_answers ( $poll_id );
|
6107 |
$other_answer = Yop_Poll_Model::get_poll_answers ( $poll_id, array (
|
6108 |
-
|
6109 |
-
|
6110 |
$custom_fields = Yop_Poll_Model::get_poll_customfields ( $poll_id );
|
6111 |
$page_name = __ ( 'Edit Poll', 'yop_poll' );
|
6112 |
$action_type = 'edit';
|
@@ -6134,9 +6187,9 @@
|
|
6134 |
id="yop-poll-edit-add-new-form">
|
6135 |
<?php wp_nonce_field( 'yop-poll-edit-add-new' ); ?>
|
6136 |
<span <?php if ( 'edit' != $action ) { ?> style="display: none;"
|
6137 |
-
|
6138 |
-
|
6139 |
-
|
6140 |
</span>
|
6141 |
<div id="poststuff">
|
6142 |
<div id="post-body" class="metabox-holder columns-2">
|
@@ -6180,7 +6233,7 @@
|
|
6180 |
<tr class="yop_poll_tr_answer"
|
6181 |
id="yop_poll_tr_answer<?php echo $answer_id ?>">
|
6182 |
<th scope="row"><label class="yop_poll_answer_label"
|
6183 |
-
|
6184 |
<td><input type="hidden"
|
6185 |
value="<?php echo isset( $answers[ $answer_id - 1 ]['id'] )? $answers[ $answer_id - 1 ]['id'] : ''; ?>"
|
6186 |
name="yop_poll_answer_ids[answer<?php echo $answer_id ?>]" />
|
@@ -6270,19 +6323,19 @@
|
|
6270 |
<tbody>
|
6271 |
<tr>
|
6272 |
<th><label
|
6273 |
-
|
6274 |
</th>
|
6275 |
<td>#<input
|
6276 |
-
|
6277 |
-
|
6278 |
-
|
6279 |
-
|
6280 |
-
|
6281 |
</td>
|
6282 |
</tr>
|
6283 |
<tr>
|
6284 |
<th><label
|
6285 |
-
|
6286 |
</th>
|
6287 |
<td><input
|
6288 |
id="yop-poll-answer-option-bar-height-answer<?php echo $answer_id ?>"
|
@@ -6294,19 +6347,19 @@
|
|
6294 |
</tr>
|
6295 |
<tr>
|
6296 |
<th><label
|
6297 |
-
|
6298 |
</th>
|
6299 |
<td>#<input
|
6300 |
-
|
6301 |
-
|
6302 |
-
|
6303 |
-
|
6304 |
-
|
6305 |
</td>
|
6306 |
</tr>
|
6307 |
<tr>
|
6308 |
<th><label
|
6309 |
-
|
6310 |
</th>
|
6311 |
<td><input
|
6312 |
id="yop-poll-answer-option-bar-border-width-answer<?php echo $answer_id ?>"
|
@@ -6318,7 +6371,7 @@
|
|
6318 |
</tr>
|
6319 |
<tr>
|
6320 |
<th><label
|
6321 |
-
|
6322 |
</th>
|
6323 |
<td><select
|
6324 |
id="yop-poll-answer-option-bar_border-style-answer<?php echo $answer_id ?>"
|
@@ -6438,7 +6491,8 @@
|
|
6438 |
</tr>
|
6439 |
<tr class="yop_poll_suboption" id="yop-poll-is-default-other-answers-values-div" style="<?php echo 'no' == $default_options['allow_other_answers'] ? 'display: none;' : ''; ?>">
|
6440 |
<th>
|
6441 |
-
<?php _e( 'Make "Other answer" default answer ', 'yop_poll' ); ?>:<br
|
|
|
6442 |
</th>
|
6443 |
<td><label for="yop-poll-is-default-other-answers-no"><input
|
6444 |
id="yop-poll-is-default-other-answers-no"
|
@@ -6471,9 +6525,9 @@
|
|
6471 |
<?php _e( 'Number of allowed answers', 'yop_poll' ); ?>:
|
6472 |
</th>
|
6473 |
<td><input id="yop-poll-allow-multiple-answers-number"
|
6474 |
-
|
6475 |
-
|
6476 |
-
|
6477 |
</td>
|
6478 |
</tr>
|
6479 |
<tr class="yop_poll_suboption" id="yop-poll-allow-multiple-answers-div1" style="<?php echo $default_options['allow_multiple_answers'] == 'no' ? 'display: none;' : ''; ?>">
|
@@ -6481,9 +6535,9 @@
|
|
6481 |
<?php _e( 'Min Number of allowed answers', 'yop_poll' ); ?>:
|
6482 |
</th>
|
6483 |
<td><input id="yop-poll-allow-multiple-answers-min-number"
|
6484 |
-
|
6485 |
-
|
6486 |
-
|
6487 |
</td>
|
6488 |
</tr>
|
6489 |
<tr>
|
@@ -6512,9 +6566,9 @@
|
|
6512 |
<?php _e( 'Columns', 'yop_poll' ); ?>:
|
6513 |
</th>
|
6514 |
<td><input id="yop-poll-display-answers-tabulated-cols"
|
6515 |
-
|
6516 |
-
|
6517 |
-
|
6518 |
</td>
|
6519 |
</tr>
|
6520 |
<tr>
|
@@ -6543,9 +6597,9 @@
|
|
6543 |
<?php _e( 'Columns', 'yop_poll' ); ?>:
|
6544 |
</th>
|
6545 |
<td><input id="yop-poll-display-results-tabulated-cols"
|
6546 |
-
|
6547 |
-
|
6548 |
-
|
6549 |
</td>
|
6550 |
</tr>
|
6551 |
<tr>
|
@@ -6567,38 +6621,38 @@
|
|
6567 |
<th><label for="yop-poll-bar-background"><?php echo $yop_poll_add_new_config['text_poll_bar_style']['poll_bar_style_background_label']; ?></label>
|
6568 |
</th>
|
6569 |
<td>#<input class="yop-small-input"
|
6570 |
-
|
6571 |
-
|
6572 |
-
|
6573 |
-
|
6574 |
</td>
|
6575 |
</tr>
|
6576 |
<tr class="yop-poll-custom-result-bar-table yop_poll_suboption" style="<?php echo $default_options['use_template_bar'] == 'yes' ? 'display: none;' : ''; ?>">
|
6577 |
<th><label for="yop-poll-bar-height"><?php echo $yop_poll_add_new_config['text_poll_bar_style']['poll_bar_style_height_label']; ?></label>
|
6578 |
</th>
|
6579 |
<td><input class="yop-small-input" id="yop-poll-bar-height"
|
6580 |
-
|
6581 |
-
|
6582 |
-
|
6583 |
</tr>
|
6584 |
<tr class="yop-poll-custom-result-bar-table yop_poll_suboption" style="<?php echo $default_options['use_template_bar'] == 'yes' ? 'display: none;' : ''; ?>">
|
6585 |
<th><label for="yop-poll-bar-border-color"><?php echo $yop_poll_add_new_config['text_poll_bar_style']['poll_bar_style_border_color_label']; ?></label>
|
6586 |
</th>
|
6587 |
<td>#<input class="yop-small-input"
|
6588 |
-
|
6589 |
-
|
6590 |
-
|
6591 |
-
|
6592 |
</td>
|
6593 |
</tr>
|
6594 |
<tr class="yop-poll-custom-result-bar-table yop_poll_suboption" style="<?php echo $default_options['use_template_bar'] == 'yes' ? 'display: none;' : ''; ?>">
|
6595 |
<th><label for="yop-poll-bar-border-width"><?php echo $yop_poll_add_new_config['text_poll_bar_style']['poll_bar_style_border_width_label']; ?></label>
|
6596 |
</th>
|
6597 |
<td><input class="yop-small-input"
|
6598 |
-
|
6599 |
-
|
6600 |
-
|
6601 |
-
|
6602 |
</tr>
|
6603 |
<tr class="yop-poll-custom-result-bar-table yop_poll_suboption" style="<?php echo $default_options['use_template_bar'] == 'yes' ? 'display: none;' : ''; ?>">
|
6604 |
<th><label for="yop-poll-bar-border-style"><?php echo $yop_poll_add_new_config['text_poll_bar_style']['poll_bar_style_border_style_label']; ?></label>
|
@@ -6734,7 +6788,7 @@
|
|
6734 |
<tr class="yop_poll_tr_customfields"
|
6735 |
id="yop_poll_tr_customfield<?php echo $custom_field_id; ?>">
|
6736 |
<th scope="row"><label class="yop_poll_customfield_label"
|
6737 |
-
|
6738 |
</th>
|
6739 |
<td><input type="hidden"
|
6740 |
value="<?php echo isset( $custom_fields[ $custom_field_id - 1 ]['id'] )? $custom_fields[ $custom_field_id - 1 ]['id'] : ''; ?>"
|
@@ -6752,10 +6806,10 @@
|
|
6752 |
for="yop-poll-customfield-required-<?php echo $custom_field_id ?>"><?php echo $yop_poll_add_new_config['text_requiered_customfield'] ?></label>
|
6753 |
</td>
|
6754 |
<td align="right"><input
|
6755 |
-
|
6756 |
-
|
6757 |
-
|
6758 |
-
|
6759 |
</tr>
|
6760 |
<?php
|
6761 |
}
|
@@ -6783,8 +6837,8 @@
|
|
6783 |
<th><label for="yop-poll-start-date-input"><?php _e( 'Start Date', 'yop_poll' ); ?>:</label><br><font size="0">(<?php _e('Current Server Time', 'yop_poll'); echo ': ' . current_time( 'mysql' ); ?>)</font>
|
6784 |
</th>
|
6785 |
<td><input id="yop-poll-start-date-input" type="text"
|
6786 |
-
|
6787 |
-
|
6788 |
</td>
|
6789 |
</tr>
|
6790 |
<tr>
|
@@ -6926,8 +6980,8 @@
|
|
6926 |
<?php _e( 'Vote Button Label', 'yop_poll' ); ?>:
|
6927 |
</th>
|
6928 |
<td><input id="yop-poll-vote-button-label" type="text"
|
6929 |
-
|
6930 |
-
|
6931 |
</td>
|
6932 |
</tr>
|
6933 |
<tr>
|
@@ -6949,8 +7003,8 @@
|
|
6949 |
<?php _e( 'View Results Link Label', 'yop_poll' ); ?>:
|
6950 |
</th>
|
6951 |
<td><input id="yop-poll-view-results-link-label" type="text"
|
6952 |
-
|
6953 |
-
|
6954 |
</td>
|
6955 |
</tr>
|
6956 |
<tr>
|
@@ -6972,9 +7026,9 @@
|
|
6972 |
<?php _e( 'View Back To Vote Link Label', 'yop_poll' ); ?>:
|
6973 |
</th>
|
6974 |
<td><input id="yop-poll-view-back-to-vote-link-label"
|
6975 |
-
|
6976 |
-
|
6977 |
-
|
6978 |
</td>
|
6979 |
</tr>
|
6980 |
<tr>
|
@@ -6996,8 +7050,8 @@
|
|
6996 |
<?php _e( 'View Total Votes Label', 'yop_poll' ); ?>:
|
6997 |
</th>
|
6998 |
<td><input id="yop-poll-view-total-votes-label" type="text"
|
6999 |
-
|
7000 |
-
|
7001 |
</td>
|
7002 |
</tr>
|
7003 |
<tr>
|
@@ -7019,8 +7073,8 @@
|
|
7019 |
<?php _e( 'View Total Answers Label', 'yop_poll' ); ?>:
|
7020 |
</th>
|
7021 |
<td><input id="yop-poll-view-total-answers-label" type="text"
|
7022 |
-
|
7023 |
-
|
7024 |
</td>
|
7025 |
</tr>
|
7026 |
<tr>
|
@@ -7028,8 +7082,8 @@
|
|
7028 |
<?php _e( 'Message After Vote', 'yop_poll' ); ?>:
|
7029 |
</th>
|
7030 |
<td><input id="yop-poll-message-after-vote" type="text"
|
7031 |
-
|
7032 |
-
|
7033 |
</td>
|
7034 |
</tr>
|
7035 |
<?php if( 'no' == $default_options['has_auto_generate_poll_page'] ) { ?>
|
@@ -7054,8 +7108,8 @@
|
|
7054 |
<th><label for="yop-poll-page-url"><?php _e( 'Poll Page Url ', 'yop_poll' ); ?>:</label>
|
7055 |
</th>
|
7056 |
<td><input id="yop-poll-page-url" type="text"
|
7057 |
-
|
7058 |
-
|
7059 |
</td>
|
7060 |
</tr>
|
7061 |
</tbody>
|
@@ -7131,8 +7185,8 @@
|
|
7131 |
<?php _e( '"Vote as Facebook User" Button Label', 'yop_poll' ); ?>:
|
7132 |
</th>
|
7133 |
<td><input id="yop-poll-vote-permisions-facebook-label" type="text"
|
7134 |
-
|
7135 |
-
|
7136 |
</td>
|
7137 |
</tr>
|
7138 |
<?php } ?>
|
@@ -7156,8 +7210,8 @@
|
|
7156 |
<?php _e( '"Vote as Wordpress User" Button Label', 'yop_poll' ); ?>:
|
7157 |
</th>
|
7158 |
<td><input id="yop-poll-vote-permisions-wordpress-label" type="text"
|
7159 |
-
|
7160 |
-
|
7161 |
</td>
|
7162 |
</tr>
|
7163 |
|
@@ -7180,8 +7234,8 @@
|
|
7180 |
<?php _e( '"Vote as Anonymous User" Button Label', 'yop_poll' ); ?>:
|
7181 |
</th>
|
7182 |
<td><input id="yop-poll-vote-permisions-anonymous-label" type="text"
|
7183 |
-
|
7184 |
-
|
7185 |
</td>
|
7186 |
</tr>
|
7187 |
|
@@ -7259,8 +7313,8 @@
|
|
7259 |
<?php _e( 'Number of Votes per User', 'yop_poll' ); ?>:
|
7260 |
</th>
|
7261 |
<td><input id="yop-poll-number-of-votes-per-user" type="text"
|
7262 |
-
|
7263 |
-
|
7264 |
</td>
|
7265 |
</tr>
|
7266 |
<tr>
|
@@ -7270,7 +7324,8 @@
|
|
7270 |
$templates = YOP_POLL_MODEL::get_yop_poll_templates_search ( 'id', 'asc' );
|
7271 |
?>
|
7272 |
<select class="yop-poll-template" id="yop-poll-template"
|
7273 |
-
name="yop_poll_options[template]"
|
|
|
7274 |
<option value=""><?php _e( '--SELECT Template--', 'yop_poll' ); ?></option>
|
7275 |
<?php
|
7276 |
if (count ( $templates ) > 0) {
|
@@ -7284,6 +7339,12 @@
|
|
7284 |
}
|
7285 |
?>
|
7286 |
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
7287 |
</td>
|
7288 |
</tr>
|
7289 |
<tr class="yop_poll_suboption">
|
@@ -7291,9 +7352,10 @@
|
|
7291 |
<?php _e( 'Poll Template Width', 'yop_poll' ); ?>:
|
7292 |
</th>
|
7293 |
<td><input id="yop-poll-template-width"
|
7294 |
-
|
7295 |
-
|
7296 |
-
|
|
|
7297 |
</td>
|
7298 |
</tr>
|
7299 |
<tr>
|
@@ -7303,7 +7365,8 @@
|
|
7303 |
$templates = YOP_POLL_MODEL::get_yop_poll_templates_search ( 'id', 'asc' );
|
7304 |
?>
|
7305 |
<select class="yop-poll-widget-template" id="yop-poll-widget-template"
|
7306 |
-
name="yop_poll_options[widget_template]"
|
|
|
7307 |
<option value=""><?php _e( '--SELECT Template--', 'yop_poll' ); ?></option>
|
7308 |
<?php
|
7309 |
if (count ( $templates ) > 0) {
|
@@ -7317,6 +7380,12 @@
|
|
7317 |
}
|
7318 |
?>
|
7319 |
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
7320 |
</td>
|
7321 |
</tr>
|
7322 |
<tr class="yop_poll_suboption">
|
@@ -7324,9 +7393,10 @@
|
|
7324 |
<?php _e( 'Widget Template Width', 'yop_poll' ); ?>:
|
7325 |
</th>
|
7326 |
<td><input id="yop-poll-widget-template-width"
|
7327 |
-
|
7328 |
-
|
7329 |
-
|
|
|
7330 |
</td>
|
7331 |
</tr>
|
7332 |
<tr>
|
@@ -7334,8 +7404,8 @@
|
|
7334 |
<?php _e( 'Percentages Decimals', 'yop_poll' ); ?>:
|
7335 |
</th>
|
7336 |
<td><input id="yop-poll-percentages-decimals" type="text"
|
7337 |
-
|
7338 |
-
|
7339 |
</td>
|
7340 |
</tr>
|
7341 |
<tr>
|
@@ -7359,8 +7429,8 @@
|
|
7359 |
<?php _e( 'Loading Image Url', 'yop_poll' ); ?>:
|
7360 |
</th>
|
7361 |
<td><input id="yop-poll-loading-image-url" type="text"
|
7362 |
-
|
7363 |
-
|
7364 |
</td>
|
7365 |
</tr>
|
7366 |
|
@@ -7385,8 +7455,8 @@
|
|
7385 |
<?php _e( 'Redirect After Vote Url', 'yop_poll' ); ?>:
|
7386 |
</th>
|
7387 |
<td><input id="yop-poll-redirect-after-vote-url" type="text"
|
7388 |
-
|
7389 |
-
|
7390 |
</td>
|
7391 |
</tr>
|
7392 |
|
@@ -7411,8 +7481,8 @@
|
|
7411 |
<?php _e( 'Reset Stats Date', 'yop_poll' ); ?>:<br><font size="0">(<?php _e('Current Server Time', 'yop_poll'); echo ': ' . current_time( 'mysql' ); ?>)</font>
|
7412 |
</th>
|
7413 |
<td><input id="yop-poll-schedule-reset-poll-stats-date" type="text"
|
7414 |
-
|
7415 |
-
|
7416 |
</td>
|
7417 |
</tr>
|
7418 |
<tr class="yop-poll-schedule-reset-poll-stats-options-div yop_poll_suboption" style="<?php echo 'no' == $default_options['schedule_reset_poll_stats'] ? 'display: none;' : ''; ?>">
|
@@ -7433,8 +7503,8 @@
|
|
7433 |
<?php _e( 'Poll Date Format', 'yop_poll' ); ?>: <br /><font size="0"><?php _e('Check', 'yop_popll') ?> <a target="_blank" href="http://codex.wordpress.org/Formatting_Date_and_Time"> <?php _e('documentation', 'yop_popll') ?></a></font>
|
7434 |
</th>
|
7435 |
<td><input id="yop-poll-date-format" type="text"
|
7436 |
-
|
7437 |
-
|
7438 |
</td>
|
7439 |
</tr>
|
7440 |
</tbody>
|
@@ -7472,9 +7542,9 @@
|
|
7472 |
<?php _e( 'View Poll Archive Link Label', 'yop_poll' ); ?>:
|
7473 |
</th>
|
7474 |
<td><input id="yop-poll-view-poll-archive-link-label"
|
7475 |
-
|
7476 |
-
|
7477 |
-
|
7478 |
</td>
|
7479 |
</tr>
|
7480 |
<tr id="yop-poll-view-poll-archive-link-div" style="<?php echo 'yes' != $default_options['view_poll_archive_link'] ? 'display: none;' : ''; ?>">
|
@@ -7482,8 +7552,8 @@
|
|
7482 |
<?php _e( 'Poll Archive Url', 'yop_poll' ); ?>:
|
7483 |
</th>
|
7484 |
<td><input id="yop-poll-poll-archive-url" type="text"
|
7485 |
-
|
7486 |
-
|
7487 |
</td>
|
7488 |
</tr>
|
7489 |
<tr>
|
@@ -7505,8 +7575,8 @@
|
|
7505 |
<?php _e( 'Archive Order', 'yop_poll' ); ?>:
|
7506 |
</th>
|
7507 |
<td><input id="yop-poll-show-in-archive-order" type="text"
|
7508 |
-
|
7509 |
-
|
7510 |
</td>
|
7511 |
</tr>
|
7512 |
|
@@ -7630,9 +7700,9 @@
|
|
7630 |
<?php _e( 'Share Name', 'yop_poll' ); ?>:
|
7631 |
</th>
|
7632 |
<td><input id="yop-poll-share-name"
|
7633 |
-
|
7634 |
-
|
7635 |
-
|
7636 |
</td>
|
7637 |
</tr>
|
7638 |
<tr class="yop_poll_suboption" id="yop-poll-share-after-vote-caption-tr" style="<?php echo 'yes' != $default_options['share_after_vote'] ? 'display: none;' : ''; ?>">
|
@@ -7640,9 +7710,9 @@
|
|
7640 |
<?php _e( 'Share Caption', 'yop_poll' ); ?>:
|
7641 |
</th>
|
7642 |
<td><input id="yop-poll-share-caption"
|
7643 |
-
|
7644 |
-
|
7645 |
-
|
7646 |
</td>
|
7647 |
</tr>
|
7648 |
<tr class="yop_poll_suboption" id="yop-poll-share-after-vote-description-tr" style="<?php echo 'yes' != $default_options['share_after_vote'] ? 'display: none;' : ''; ?>">
|
@@ -7650,9 +7720,9 @@
|
|
7650 |
<?php _e( 'Share Description', 'yop_poll' ); ?>:
|
7651 |
</th>
|
7652 |
<td><input id="yop-poll-share-description"
|
7653 |
-
|
7654 |
-
|
7655 |
-
|
7656 |
</td>
|
7657 |
</tr>
|
7658 |
<tr class="yop_poll_suboption" id="yop-poll-share-after-vote-picture-tr" style="<?php echo 'yes' != $default_options['share_after_vote'] ? 'display: none;' : ''; ?>">
|
@@ -7660,9 +7730,9 @@
|
|
7660 |
<?php _e( 'Share Picture', 'yop_poll' ); ?>:
|
7661 |
</th>
|
7662 |
<td><input id="yop-poll-share-picture"
|
7663 |
-
|
7664 |
-
|
7665 |
-
|
7666 |
</td>
|
7667 |
</tr>
|
7668 |
|
@@ -7972,7 +8042,7 @@
|
|
7972 |
/**
|
7973 |
* End Views section
|
7974 |
*/
|
7975 |
-
|
7976 |
/**
|
7977 |
* Start Ajax section
|
7978 |
*/
|
@@ -8102,10 +8172,10 @@
|
|
8102 |
}
|
8103 |
}
|
8104 |
print '[ajax-response]' . json_encode ( array (
|
8105 |
-
|
8106 |
-
|
8107 |
-
|
8108 |
-
|
8109 |
die ();
|
8110 |
}
|
8111 |
public function yop_poll_view_results() {
|
@@ -8135,10 +8205,10 @@
|
|
8135 |
}
|
8136 |
}
|
8137 |
print '[ajax-response]' . json_encode ( array (
|
8138 |
-
|
8139 |
-
|
8140 |
-
|
8141 |
-
|
8142 |
die ();
|
8143 |
}
|
8144 |
public function yop_poll_back_to_vote() {
|
@@ -8167,10 +8237,10 @@
|
|
8167 |
}
|
8168 |
}
|
8169 |
print '[ajax-response]' . json_encode ( array (
|
8170 |
-
|
8171 |
-
|
8172 |
-
|
8173 |
-
|
8174 |
die ();
|
8175 |
}
|
8176 |
public function yop_poll_load_css() {
|
@@ -8191,19 +8261,19 @@
|
|
8191 |
}
|
8192 |
die ();
|
8193 |
}
|
8194 |
-
public function yop_poll_load_js() {
|
8195 |
header ( 'Content-Type: text/javascript' );
|
8196 |
// check_ajax_referer('yop-poll-public-js');
|
8197 |
if (is_admin ()) {
|
8198 |
$poll_id = isset ( $_REQUEST ['id'] ) ? $_REQUEST ['id'] : NULL;
|
8199 |
$location = isset ( $_REQUEST ['location'] ) ? $_REQUEST ['location'] : NULL;
|
8200 |
$unique_id = isset ( $_REQUEST ['unique_id'] ) ? $_REQUEST ['unique_id'] : NULL;
|
8201 |
-
if ($poll_id) {
|
8202 |
-
require_once ($this->_config->plugin_inc_dir . '/yop_poll_model.php');
|
8203 |
$yop_poll_model = new YOP_POLL_MODEL ( $poll_id );
|
8204 |
$yop_poll_model->set_unique_id( $unique_id );
|
8205 |
-
$
|
8206 |
-
print $
|
8207 |
unset ( $yop_poll_model );
|
8208 |
}
|
8209 |
}
|
@@ -8211,7 +8281,7 @@
|
|
8211 |
}
|
8212 |
public function ajax_get_polls_for_editor() {
|
8213 |
check_ajax_referer ( 'yop-poll-editor' );
|
8214 |
-
if (is_admin ()) {
|
8215 |
require_once ($this->_config->plugin_inc_dir . '/yop_poll_model.php');
|
8216 |
$yop_polls = Yop_Poll_Model::get_yop_polls_filter_search ( 'id', 'asc' );
|
8217 |
?>
|
@@ -8267,12 +8337,12 @@
|
|
8267 |
|
8268 |
|
8269 |
<center> <input type="button" class="button-primary"
|
8270 |
-
|
8271 |
-
|
8272 |
<br />
|
8273 |
<center> <input type="button" class="button-primary"
|
8274 |
-
|
8275 |
-
|
8276 |
</p>
|
8277 |
</body>
|
8278 |
</html>
|
@@ -8280,6 +8350,20 @@
|
|
8280 |
}
|
8281 |
die ();
|
8282 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8283 |
public function ajax_get_polls_for_html_editor() {
|
8284 |
check_ajax_referer ( 'yop-poll-html-editor' );
|
8285 |
if (is_admin ()) {
|
@@ -8499,9 +8583,9 @@
|
|
8499 |
if ( 'yes' == $according_to_logs ) {
|
8500 |
if ( 'yes' == $change_to_all ) {
|
8501 |
$poll_answers = YOP_POLL_MODEL::get_poll_answers ( $answer_details['poll_id'], array (
|
8502 |
-
|
8503 |
-
|
8504 |
-
|
8505 |
if ( count( $poll_answers) > 0 )
|
8506 |
foreach( $poll_answers as $answer ) {
|
8507 |
Yop_Poll_Model::update_answer_field( $answer['id'], array( 'name' => 'votes', 'value' => YOP_POLL_MODEL::get_answer_votes_from_logs( $answer['id'] ), 'type' => '%d' ) );
|
@@ -8924,13 +9008,13 @@
|
|
8924 |
|
8925 |
if (get_user_option ( 'rich_editing' ) == 'true') {
|
8926 |
add_filter ( 'mce_external_plugins', array (
|
8927 |
-
|
8928 |
-
|
8929 |
-
|
8930 |
add_filter ( 'mce_buttons', array (
|
8931 |
-
|
8932 |
-
|
8933 |
-
|
8934 |
}
|
8935 |
}
|
8936 |
}
|
@@ -8959,14 +9043,14 @@
|
|
8959 |
<br /> <b><?php _e( 'Short on funds?', 'yop_poll' ); ?></b>
|
8960 |
<ul id="donate_ul">
|
8961 |
<li><a target="_blank"
|
8962 |
-
|
8963 |
</li>
|
8964 |
<li><b><?php _e( 'Talk about it on your site and link back to the', 'yop_poll' ); ?></b>
|
8965 |
<a target="_blank"
|
8966 |
href="http://wordpress.org/extend/plugins/yop-poll/"><b><?php _e( 'plugin page', 'yop_poll' ); ?>.</b></a>
|
8967 |
</li>
|
8968 |
<li><a target="_blank"
|
8969 |
-
|
8970 |
</li>
|
8971 |
</ul>
|
8972 |
</div>
|
@@ -8981,7 +9065,7 @@
|
|
8981 |
</h3>
|
8982 |
<div class="inside">
|
8983 |
<b><?php _e( 'If you need help getting this plugin or have found a bug please visit the ', 'yop_poll' ); ?><a
|
8984 |
-
|
8985 |
</div>
|
8986 |
</div>
|
8987 |
|
@@ -9801,11 +9885,11 @@
|
|
9801 |
$optin_box_modal_options = get_option ( 'yop_poll_optin_box_modal_options' );
|
9802 |
if ($optin_box_modal_options ['show'] == 'yes') {
|
9803 |
wp_enqueue_script ( 'yop-poll-modal-box-js', "{$this->_config->plugin_url}/modal/js/jquery.modalbox-1.5.0-min.js", array (
|
9804 |
-
|
9805 |
), $this->_config->version, true );
|
9806 |
wp_enqueue_script ( 'yop-poll-modal-functions', "{$this->_config->plugin_url}/js/yop-poll-modal-functions.js", array (
|
9807 |
-
|
9808 |
-
|
9809 |
), $this->_config->version, true );
|
9810 |
$yop_poll_modal_functions_config = array (
|
9811 |
'ajax' => array (
|
@@ -9817,7 +9901,7 @@
|
|
9817 |
wp_enqueue_style ( 'yop-poll-modal-box-css', "{$this->_config->plugin_url}/modal/css/jquery.modalbox-basic.css", array (), $this->_config->version );
|
9818 |
} elseif ($optin_box_modal_options ['sidebar_had_submit'] == 'no') {
|
9819 |
wp_enqueue_script ( 'yop-poll-sidebar-option-functions', "{$this->_config->plugin_url}/js/yop-poll-sidebar-optin-functions.js", array (
|
9820 |
-
|
9821 |
), $this->_config->version, true );
|
9822 |
$yop_poll_sidebar_functions_config = array (
|
9823 |
'ajax' => array (
|
@@ -9886,12 +9970,12 @@
|
|
9886 |
if (isset ( $_GET ['yop_poll_do_not_bug'] )) {
|
9887 |
if ('yes' == $_GET ['yop_poll_do_not_bug']) {
|
9888 |
wp_redirect ( remove_query_arg ( array (
|
9889 |
-
|
9890 |
-
|
9891 |
-
|
9892 |
-
|
9893 |
-
|
9894 |
-
|
9895 |
}
|
9896 |
}
|
9897 |
}
|
8 |
$this->add_action ( 'wpmu_new_blog', 'new_blog', 10, 6 );
|
9 |
$this->add_action ( 'delete_blog', 'delete_blog', 10, 2 );
|
10 |
register_activation_hook ( $this->_config->plugin_file, array (
|
11 |
+
$this,
|
12 |
+
'yop_poll_activate'
|
13 |
+
) );
|
14 |
register_deactivation_hook ( $this->_config->plugin_file, array (
|
15 |
+
$this,
|
16 |
+
'yop_poll_deactivate'
|
17 |
+
) );
|
18 |
register_uninstall_hook ( $this->_config->plugin_file, 'yop_poll_uninstall' );
|
19 |
$this->add_action ( 'admin_enqueue_scripts', 'load_editor_functions' );
|
20 |
$this->add_action ( 'plugins_loaded', 'db_update' );
|
26 |
if (is_plugin_active_for_network ( 'yop-poll/yop_poll.php' )) {
|
27 |
$old_blog = $wpdb->blogid;
|
28 |
switch_to_blog ( $blog_id );
|
29 |
+
$wpdb->yop_polls = $wpdb->prefix . 'yop_polls';
|
30 |
+
$wpdb->yop_poll_answers = $wpdb->prefix . 'yop_poll_answers';
|
31 |
+
$wpdb->yop_poll_templates = $wpdb->prefix . 'yop_poll_templates';
|
32 |
+
$wpdb->yop_poll_custom_fields = $wpdb->prefix . 'yop_poll_custom_fields';
|
33 |
+
$wpdb->yop_pollmeta = $wpdb->prefix . 'yop_pollmeta';
|
34 |
+
$wpdb->yop_poll_answermeta = $wpdb->prefix . 'yop_poll_answermeta';
|
35 |
+
$wpdb->yop_poll_logs = $wpdb->prefix . 'yop_poll_logs';
|
36 |
+
$wpdb->yop_poll_voters = $wpdb->prefix . 'yop_poll_voters';
|
37 |
+
$wpdb->yop_poll_bans = $wpdb->prefix . 'yop_poll_bans';
|
38 |
$wpdb->yop_poll_votes_custom_fields = $wpdb->prefix . 'yop_poll_votes_custom_fields';
|
39 |
+
$wpdb->yop_poll_facebook_users = $wpdb->prefix . 'yop_poll_facebook_users';
|
40 |
$this->activate ( NULL );
|
41 |
switch_to_blog ( $old_blog );
|
42 |
}
|
48 |
$wpdb->query ( "DROP TABLE `" . $wpdb->prefix . "yop_pollmeta`, `" . $wpdb->prefix . "yop_polls`, `" . $wpdb->prefix . "yop_poll_answermeta`, `" . $wpdb->prefix . "yop_poll_answers`, `" . $wpdb->prefix . "yop_poll_custom_fields`, `" . $wpdb->prefix . "yop_poll_logs`, `" . $wpdb->prefix . "yop_poll_voters`, `" . $wpdb->prefix . "yop_poll_bans`, `" . $wpdb->prefix . "yop_poll_templates`, `" . $wpdb->prefix . "yop_poll_votes_custom_fields`, `" . $wpdb->prefix . "yop_poll_facebook_users`" );
|
49 |
switch_to_blog ( $old_blog );
|
50 |
}
|
51 |
+
|
52 |
function yop_poll_network_propagate($pfunction, $networkwide) {
|
53 |
global $wpdb;
|
54 |
|
61 |
$blogids = $wpdb->get_col ( "SELECT blog_id FROM {$wpdb->blogs}" );
|
62 |
foreach ( $blogids as $blog_id ) {
|
63 |
switch_to_blog ( $blog_id );
|
64 |
+
$wpdb->yop_polls = $wpdb->prefix . 'yop_polls';
|
65 |
+
$wpdb->yop_poll_answers = $wpdb->prefix . 'yop_poll_answers';
|
66 |
+
$wpdb->yop_poll_templates = $wpdb->prefix . 'yop_poll_templates';
|
67 |
+
$wpdb->yop_poll_custom_fields = $wpdb->prefix . 'yop_poll_custom_fields';
|
68 |
+
$wpdb->yop_pollmeta = $wpdb->prefix . 'yop_pollmeta';
|
69 |
+
$wpdb->yop_poll_answermeta = $wpdb->prefix . 'yop_poll_answermeta';
|
70 |
+
$wpdb->yop_poll_logs = $wpdb->prefix . 'yop_poll_logs';
|
71 |
+
$wpdb->yop_poll_voters = $wpdb->prefix . 'yop_poll_voters';
|
72 |
+
$wpdb->yop_poll_bans = $wpdb->prefix . 'yop_poll_bans';
|
73 |
$wpdb->yop_poll_votes_custom_fields = $wpdb->prefix . 'yop_poll_votes_custom_fields';
|
74 |
+
$wpdb->yop_poll_facebook_users = $wpdb->prefix . 'yop_poll_facebook_users';
|
75 |
call_user_func ( array (
|
76 |
+
$this,
|
77 |
+
$pfunction
|
78 |
), $networkwide );
|
79 |
}
|
80 |
switch_to_blog ( $old_blog );
|
82 |
}
|
83 |
}
|
84 |
call_user_func ( array (
|
85 |
+
$this,
|
86 |
+
$pfunction
|
87 |
), $networkwide );
|
88 |
}
|
89 |
+
|
90 |
function yop_poll_activate($networkwide) {
|
91 |
$this->yop_poll_network_propagate ( 'activate', $networkwide );
|
92 |
}
|
93 |
+
|
94 |
function yop_poll_deactivate($networkwide) {
|
95 |
$this->yop_poll_network_propagate ( 'deactivate', $networkwide );
|
96 |
}
|
97 |
+
|
98 |
public function db_update() {
|
99 |
global $wpdb;
|
100 |
global $current_user;
|
454 |
|
455 |
if (! isset ( $default_options ['email_notifications_body'] )) {
|
456 |
$default_options ['email_notifications_body'] = '<p>A new vote was registered on [VOTE_DATE] for [POLL_NAME]</p>
|
457 |
+
<p>Vote Details:</p>
|
458 |
+
<p><b>Question:</b> [QUESTION]</p>
|
459 |
+
<p><b>Answers:</b> <br />[ANSWERS]</p>
|
460 |
+
<p><b>Custom Fields:</b> <br />[CUSTOM_FIELDS]</p>
|
461 |
+
<p><b>Vote ID:</b> <br />[VOTE_ID]</p>';
|
462 |
}
|
463 |
|
464 |
update_option ( 'yop_poll_options', $default_options );
|
465 |
update_option ( "yop_poll_version", $wpdb->yop_poll_version );
|
466 |
}
|
467 |
|
468 |
+
if (version_compare ( $installed_version, '4.7', '<=' ) ) {
|
469 |
+
$this->update_to_4_8();
|
470 |
+
update_option ( "yop_poll_version", $wpdb->yop_poll_version );
|
471 |
+
}
|
472 |
+
|
473 |
+
if (version_compare ( $installed_version, '4.8', '<=' ) ) {
|
474 |
+
$this->update_to_4_9();
|
475 |
+
update_option ( "yop_poll_version", $wpdb->yop_poll_version );
|
476 |
+
}
|
477 |
+
|
478 |
}
|
479 |
+
|
480 |
public function update_to_4_2() {
|
481 |
global $wpdb;
|
482 |
|
554 |
}
|
555 |
}
|
556 |
}
|
557 |
+
public function update_to_4_8() {
|
558 |
+
global $wpdb;
|
559 |
+
$sql = <<<EOT
|
560 |
+
UPDATE $wpdb->yop_poll_templates
|
561 |
+
SET
|
562 |
+
js = CONCAT( js, '
|
563 |
+
jQuery(document).ready(function(){
|
564 |
+
runOnPollStateChange_%POLL-ID%();
|
565 |
+
});
|
566 |
+
|
567 |
+
function runOnPollStateChange_%POLL-ID%() {};'
|
568 |
+
)
|
569 |
+
WHERE js NOT LIKE '%runOnPollStateChange_%'
|
570 |
+
EOT;
|
571 |
+
$updated_templates = $wpdb->query($sql);
|
572 |
+
}
|
573 |
+
public function update_to_4_9() {
|
574 |
+
global $wpdb;
|
575 |
+
$sql =<<<EOT
|
576 |
+
UPDATE $wpdb->yop_poll_templates
|
577 |
+
SET `before_vote_template` =
|
578 |
+
REPLACE( `before_vote_template` ,
|
579 |
+
'<div id="yop-poll-answers-%POLL-ID"',
|
580 |
+
'<div id="yop-poll-answers-%POLL-ID%"' )
|
581 |
+
WHERE `before_vote_template` LIKE '%<div id="yop-poll-answers-%POLL-ID"%
|
582 |
+
EOT;
|
583 |
+
$wpdb->query($sql);
|
584 |
+
}
|
585 |
public function admin_loader() {
|
586 |
+
// $this->add_action ( 'network_admin_menu', 'admin_menu', 1 );
|
587 |
$this->add_action ( 'admin_init', 'yop_poll_options_admin_init', 1 );
|
588 |
+
$this->add_action ( 'admin_menu', 'admin_menu', 1 );
|
589 |
$this->add_action ( 'wp_ajax_yop_poll_editor', 'ajax_get_polls_for_editor', 1 );
|
590 |
+
$this->add_action ( 'wp_ajax_yop_poll_preview_template', 'ajax_preview_template', 1 );
|
591 |
$this->add_action ( 'wp_ajax_yop_poll_html_editor', 'ajax_get_polls_for_html_editor', 1 );
|
592 |
$this->add_action ( 'wp_ajax_yop_poll_edit_add_new_poll', 'ajax_edit_add_new_poll', 1 );
|
593 |
$this->add_action ( 'wp_ajax_yop_poll_edit_add_new_poll_template', 'ajax_edit_add_new_poll_template', 1 );
|
678 |
wp_unschedule_event( $schedule_timestamp, 'yop_poll_hourly_event', array() );
|
679 |
}
|
680 |
}
|
681 |
+
|
682 |
public function admin_menu() {
|
683 |
if (is_admin () && $this->current_user_can ( 'edit_own_polls' )) {
|
684 |
if (function_exists ( 'add_menu_page' )) {
|
685 |
if ($this->current_user_can ( 'edit_own_polls' ))
|
686 |
$page = add_menu_page ( __ ( 'Yop Poll', 'yop_poll' ), __ ( 'Yop Poll', 'yop_poll' ), 'read', 'yop-polls', array (
|
687 |
+
$this,
|
688 |
+
'manage_pages'
|
689 |
), "{$this->_config->plugin_url}/images/yop-poll-admin-menu-icon16.png", '28.734' );
|
690 |
}
|
691 |
if ($this->current_user_can ( 'edit_own_polls' ))
|
692 |
add_action ( "load-$page", array (
|
693 |
+
&$this,
|
694 |
+
'manage_pages_load'
|
695 |
+
) );
|
696 |
if (function_exists ( 'add_submenu_page' )) {
|
697 |
|
698 |
if ($this->current_user_can ( 'edit_own_polls' )) {
|
699 |
$subpage = add_submenu_page ( 'yop-polls', __ ( 'All Polls', 'yop_poll' ), __ ( 'All Polls', 'yop_poll' ), 'read', 'yop-polls', array (
|
700 |
+
&$this,
|
701 |
+
'manage_pages'
|
702 |
+
) );
|
703 |
add_action ( "load-$subpage", array (
|
704 |
+
&$this,
|
705 |
+
'manage_pages_load'
|
706 |
+
) );
|
707 |
}
|
708 |
if ($this->current_user_can ( 'edit_own_polls' )) {
|
709 |
$subpage = add_submenu_page ( 'yop-polls', __ ( 'Add New', 'yop_poll' ), __ ( 'Add New', 'yop_poll' ), 'read', 'yop-polls-add-new', array (
|
710 |
+
&$this,
|
711 |
+
'manage_pages'
|
712 |
+
) );
|
713 |
add_action ( "load-$subpage", array (
|
714 |
+
&$this,
|
715 |
+
'manage_pages_load'
|
716 |
+
) );
|
717 |
}
|
718 |
if ($this->current_user_can ( 'manage_polls_options' )) {
|
719 |
$subpage = add_submenu_page ( 'yop-polls', __ ( 'Options', 'yop_poll' ), __ ( 'Options', 'yop_poll' ), 'read', 'yop-polls-options', array (
|
720 |
+
&$this,
|
721 |
+
'manage_pages'
|
722 |
+
) );
|
723 |
add_action ( "load-$subpage", array (
|
724 |
+
&$this,
|
725 |
+
'manage_pages_load'
|
726 |
+
) );
|
727 |
}
|
728 |
if ($this->current_user_can ( 'edit_own_polls_templates' )) {
|
729 |
$subpage = add_submenu_page ( 'yop-polls', __ ( 'Templates', 'yop_poll' ), __ ( 'Templates', 'yop_poll' ), 'read', 'yop-polls-templates', array (
|
730 |
+
&$this,
|
731 |
+
'manage_pages'
|
732 |
+
) );
|
733 |
add_action ( "load-$subpage", array (
|
734 |
+
&$this,
|
735 |
+
'manage_pages_load'
|
736 |
+
) );
|
737 |
}
|
738 |
if ($this->current_user_can ( 'view_own_polls_logs' )) {
|
739 |
$subpage = add_submenu_page ( 'yop-polls', __ ( 'Logs', 'yop_poll' ), __ ( 'Logs', 'yop_poll' ), 'read', 'yop-polls-logs', array (
|
740 |
+
&$this,
|
741 |
+
'manage_pages'
|
742 |
+
) );
|
743 |
add_action ( "load-$subpage", array (
|
744 |
+
&$this,
|
745 |
+
'manage_pages_load'
|
746 |
+
) );
|
747 |
}
|
748 |
if ($this->current_user_can ( 'manage_polls_bans' )) {
|
749 |
$subpage = add_submenu_page ( 'yop-polls', __ ( 'Bans', 'yop_poll' ), __ ( 'Bans', 'yop_poll' ), 'read', 'yop-polls-bans', array (
|
750 |
+
&$this,
|
751 |
+
'manage_pages'
|
752 |
+
) );
|
753 |
add_action ( "load-$subpage", array (
|
754 |
+
&$this,
|
755 |
+
'manage_pages_load'
|
756 |
+
) );
|
757 |
}
|
758 |
if ($this->current_user_can ( 'become_pro' )) {
|
759 |
$subpage = add_submenu_page ( 'yop-polls', __ ( 'Become Pro', 'yop_poll' ), __ ( 'Become Pro', 'yop_poll' ), 'read', 'yop-polls-become-pro', array (
|
760 |
+
&$this,
|
761 |
+
'manage_pages'
|
762 |
+
) );
|
763 |
add_action ( "load-$subpage", array (
|
764 |
+
&$this,
|
765 |
+
'manage_pages_load'
|
766 |
+
) );
|
767 |
}
|
768 |
}
|
769 |
}
|
812 |
}
|
813 |
public function manage_pages_load() {
|
814 |
wp_reset_vars ( array (
|
815 |
+
'page',
|
816 |
+
'action',
|
817 |
+
'orderby',
|
818 |
+
'order'
|
819 |
+
) );
|
820 |
global $page, $action, $orderby, $order, $yop_poll_add_new_config;
|
821 |
$default_options = get_option ( 'yop_poll_options', array () );
|
822 |
|
824 |
$answers_number = $this->_config->min_number_of_answers + 1; // total +1
|
825 |
$customfields_number = $this->_config->min_number_of_customfields + 1; // total +1
|
826 |
|
827 |
+
wp_enqueue_script('yop-poll-admin', "{$this->_config->plugin_url}/js/yop-poll-admin.js", array (
|
828 |
+
'jquery'
|
829 |
+
), $this->_config->version, true );
|
830 |
+
|
831 |
switch ($page) {
|
832 |
case 'yop-polls' :
|
833 |
if ('results' == $action) {
|
835 |
wp_enqueue_style ( 'yop-poll-timepicker', "{$this->_config->plugin_url}/css/timepicker.css", array (), $this->_config->version );
|
836 |
wp_enqueue_style ( 'yop-poll-jquery-ui', "{$this->_config->plugin_url}/css/jquery-ui.css", array (), $this->_config->version );
|
837 |
wp_enqueue_script ( 'yop-poll-jquery-ui-timepicker', "{$this->_config->plugin_url}/js/jquery-ui-timepicker-addon.js", array (
|
838 |
+
'jquery',
|
839 |
+
'jquery-ui-datepicker',
|
840 |
+
'jquery-ui-slider'
|
841 |
), $this->_config->version, true );
|
842 |
wp_enqueue_style ( 'yop-poll-admin-custom-fields', "{$this->_config->plugin_url}/css/yop-poll-admin-custom-fields.css", array (), $this->_config->version );
|
843 |
wp_enqueue_script ( 'yop-poll-admin-custom-fields', "{$this->_config->plugin_url}/js/yop-poll-admin-custom-fields.js", array (
|
844 |
+
'jquery',
|
845 |
+
'yop-poll-jquery-ui-timepicker'
|
846 |
), $this->_config->version, true );
|
847 |
$this->yop_poll_custom_fields_results_operations ();
|
848 |
break;
|
851 |
wp_enqueue_style ( 'yop-poll-timepicker', "{$this->_config->plugin_url}/css/timepicker.css", array (), $this->_config->version );
|
852 |
wp_enqueue_style ( 'yop-poll-jquery-ui', "{$this->_config->plugin_url}/css/jquery-ui.css", array (), $this->_config->version );
|
853 |
wp_enqueue_script ( 'yop-poll-jquery-ui-timepicker', "{$this->_config->plugin_url}/js/jquery-ui-timepicker-addon.js", array (
|
854 |
+
'jquery',
|
855 |
+
'jquery-ui-datepicker',
|
856 |
+
'jquery-ui-slider'
|
857 |
), $this->_config->version, true );
|
858 |
wp_enqueue_style ( 'yop-poll-admin-custom-fields', "{$this->_config->plugin_url}/css/yop-poll-admin-custom-fields.css", array (), $this->_config->version );
|
859 |
wp_enqueue_script ( 'yop-poll-admin-custom-fields', "{$this->_config->plugin_url}/js/yop-poll-admin-custom-fields.js", array (
|
860 |
+
'jquery',
|
861 |
+
'yop-poll-jquery-ui-timepicker'
|
862 |
), $this->_config->version, true );
|
863 |
$this->yop_poll_custom_fields_operations ();
|
864 |
break;
|
865 |
+
}
|
866 |
+
elseif ('edit' == $action) {
|
867 |
require_once ($this->_config->plugin_inc_dir . '/yop_poll_model.php');
|
868 |
$poll_id = (isset ( $_GET ['id'] ) ? intval ( $_GET ['id'] ) : 0);
|
869 |
$yop_poll_model = new Yop_Poll_Model ( $poll_id );
|
871 |
$answers_number = count ( $answers ) + 1; // total +1
|
872 |
$custom_fields = Yop_Poll_Model::get_poll_customfields ( $poll_id );
|
873 |
$customfields_number = count ( $custom_fields ) + 1; // total +1
|
874 |
+
}
|
875 |
+
else {
|
876 |
$this->view_all_polls_operations ();
|
877 |
wp_enqueue_script ( 'link' );
|
878 |
wp_enqueue_script ( 'xfn' );
|
928 |
wp_enqueue_style ( 'yop-poll-jquery-ui', "{$this->_config->plugin_url}/css/jquery-ui.css", array (), $this->_config->version );
|
929 |
|
930 |
wp_enqueue_script ( 'yop-poll-admin-add-new', "{$this->_config->plugin_url}/js/yop-poll-admin-add-new.js", array (
|
931 |
+
'jquery',
|
932 |
+
'yop-poll-jquery-ui-timepicker'
|
933 |
), $this->_config->version, true );
|
934 |
wp_enqueue_script ( 'yop-poll-jquery-ui-timepicker', "{$this->_config->plugin_url}/js/jquery-ui-timepicker-addon.js", array (
|
935 |
+
'jquery',
|
936 |
+
'jquery-ui-datepicker',
|
937 |
+
'jquery-ui-slider'
|
938 |
), $this->_config->version, true );
|
939 |
wp_enqueue_script ( 'yop-poll-modal-box-js', "{$this->_config->plugin_url}/modal/js/jquery.modalbox-1.5.0-min.js", array (
|
940 |
+
'jquery'
|
941 |
), $this->_config->version, true );
|
942 |
wp_enqueue_style ( 'yop-poll-modal-box-css', "{$this->_config->plugin_url}/modal/css/jquery.modalbox-skin-precious-white.css", array (), $this->_config->version );
|
943 |
wp_localize_script ( 'yop-poll-admin-add-new', 'yop_poll_add_new_config', $yop_poll_add_new_config );
|
948 |
wp_enqueue_style ( 'yop-poll-timepicker', "{$this->_config->plugin_url}/css/timepicker.css", array (), $this->_config->version );
|
949 |
wp_enqueue_style ( 'yop-poll-jquery-ui', "{$this->_config->plugin_url}/css/jquery-ui.css", array (), $this->_config->version );
|
950 |
wp_enqueue_script ( 'yop-poll-jquery-ui-timepicker', "{$this->_config->plugin_url}/js/jquery-ui-timepicker-addon.js", array (
|
951 |
+
'jquery',
|
952 |
+
'jquery-ui-datepicker',
|
953 |
+
'jquery-ui-slider'
|
954 |
), $this->_config->version, true );
|
955 |
wp_enqueue_script ( 'yop-poll-admin-logs', "{$this->_config->plugin_url}/js/yop-poll-admin-logs.js", array (
|
956 |
+
'jquery',
|
957 |
+
'yop-poll-jquery-ui-timepicker'
|
958 |
), $this->_config->version, true );
|
959 |
$this->view_yop_poll_logs_operations ();
|
960 |
break;
|
961 |
case 'yop-polls-bans' :
|
962 |
wp_enqueue_script ( 'yop-poll-admin-bans', "{$this->_config->plugin_url}/js/yop-poll-admin-bans.js", array (
|
963 |
+
'jquery'
|
964 |
), $this->_config->version, true );
|
965 |
$this->view_yop_poll_bans_operations ();
|
966 |
break;
|
969 |
wp_enqueue_style ( 'yop-poll-timepicker', "{$this->_config->plugin_url}/css/timepicker.css", array (), $this->_config->version );
|
970 |
wp_enqueue_style ( 'yop-poll-jquery-ui', "{$this->_config->plugin_url}/css/jquery-ui.css", array (), $this->_config->version );
|
971 |
wp_enqueue_script ( 'yop-poll-admin-options', "{$this->_config->plugin_url}/js/yop-poll-admin-options.js", array (
|
972 |
+
'jquery',
|
973 |
+
'yop-poll-jquery-ui-timepicker'
|
974 |
), $this->_config->version, true );
|
975 |
wp_enqueue_script ( 'yop-poll-jquery-ui-timepicker', "{$this->_config->plugin_url}/js/jquery-ui-timepicker-addon.js", array (
|
976 |
+
'jquery',
|
977 |
+
'jquery-ui-datepicker',
|
978 |
+
'jquery-ui-slider'
|
979 |
), $this->_config->version, true );
|
980 |
wp_enqueue_script ( 'link' );
|
981 |
wp_enqueue_script ( 'xfn' );
|
983 |
case 'yop-polls-templates' :
|
984 |
add_filter ( 'user_can_richedit', create_function ( '$a', 'return false;' ), 1 );
|
985 |
wp_enqueue_script ( array (
|
986 |
+
'editor',
|
987 |
+
'thickbox'
|
988 |
+
) );
|
989 |
wp_enqueue_style ( 'thickbox' );
|
990 |
wp_enqueue_script ( 'yop-poll-admin-templates', "{$this->_config->plugin_url}/js/yop-poll-admin-templates.js", array (
|
991 |
+
'jquery'
|
992 |
), $this->_config->version, true );
|
993 |
$yop_poll_add_new_template_config = array (
|
994 |
'ajax' => array (
|
1000 |
)
|
1001 |
);
|
1002 |
wp_enqueue_script ( 'yop-poll-modal-box-js', "{$this->_config->plugin_url}/modal/js/jquery.modalbox-1.5.0-min.js", array (
|
1003 |
+
'jquery'
|
1004 |
), $this->_config->version, true );
|
1005 |
wp_enqueue_style ( 'yop-poll-modal-box-css', "{$this->_config->plugin_url}/modal/css/jquery.modalbox-skin-precious-white.css", array (), $this->_config->version );
|
1006 |
wp_localize_script ( 'yop-poll-admin-templates', 'yop_poll_add_new_template_config', $yop_poll_add_new_template_config );
|
1033 |
$total_deleted ++;
|
1034 |
}
|
1035 |
wp_redirect ( add_query_arg ( 'deleted', count ( $bulklogs ) - $total_deleted, remove_query_arg ( array (
|
1036 |
+
'_wp_http_referer',
|
1037 |
+
'_wpnonce',
|
1038 |
+
'action',
|
1039 |
+
'yoppolllogscheck'
|
1040 |
+
), stripslashes ( $_SERVER ['REQUEST_URI'] ) ) ) );
|
1041 |
exit ();
|
1042 |
}
|
1043 |
|
1055 |
$total_deleted_group ++;
|
1056 |
}
|
1057 |
wp_redirect ( add_query_arg ( 'deleted', count ( $bulklogs ) - $total_deleted_group, remove_query_arg ( array (
|
1058 |
+
'_wp_http_referer',
|
1059 |
+
'_wpnonce',
|
1060 |
+
'action',
|
1061 |
+
'yoppolllogscheck'
|
1062 |
+
), stripslashes ( $_SERVER ['REQUEST_URI'] ) ) ) );
|
1063 |
exit ();
|
1064 |
}
|
1065 |
} elseif ('-1' != $action && isset ( $_REQUEST ['id'] )) {
|
1074 |
else
|
1075 |
wp_die ( __ ( 'You are not allowed to delete this item.', 'yop_poll' ) );
|
1076 |
wp_redirect ( add_query_arg ( 'deleted', 1, remove_query_arg ( array (
|
1077 |
+
'_wpnonce',
|
1078 |
+
'id',
|
1079 |
+
'action'
|
1080 |
+
), stripslashes ( $_SERVER ['REQUEST_URI'] ) ) ) );
|
1081 |
exit ();
|
1082 |
}
|
1083 |
if ('delete_group' == $action) {
|
1091 |
else
|
1092 |
wp_die ( __ ( 'You are not allowed to delete this item.', 'yop_poll' ) );
|
1093 |
wp_redirect ( add_query_arg ( 'deleted', 1, remove_query_arg ( array (
|
1094 |
+
'_wpnonce',
|
1095 |
+
'id',
|
1096 |
+
'action'
|
1097 |
+
), stripslashes ( $_SERVER ['REQUEST_URI'] ) ) ) );
|
1098 |
exit ();
|
1099 |
}
|
1100 |
} elseif (isset ( $_REQUEST ['export'] )) {
|
1213 |
}
|
1214 |
|
1215 |
wp_safe_redirect ( remove_query_arg ( array (
|
1216 |
+
'_wp_http_referer',
|
1217 |
+
'_wpnonce',
|
1218 |
+
'export',
|
1219 |
+
'a'
|
1220 |
+
), stripslashes ( $_SERVER ['REQUEST_URI'] ) ) );
|
1221 |
exit ();
|
1222 |
} elseif (! empty ( $_GET ['_wp_http_referer'] )) {
|
1223 |
wp_safe_redirect ( remove_query_arg ( array (
|
1224 |
+
'_wp_http_referer',
|
1225 |
+
'_wpnonce'
|
1226 |
+
), stripslashes ( $_SERVER ['REQUEST_URI'] ) ) );
|
1227 |
exit ();
|
1228 |
}
|
1229 |
}
|
1302 |
exit ();
|
1303 |
}
|
1304 |
wp_safe_redirect ( remove_query_arg ( array (
|
1305 |
+
'_wp_http_referer',
|
1306 |
+
'_wpnonce',
|
1307 |
+
'export',
|
1308 |
+
'a'
|
1309 |
+
), stripslashes ( $_SERVER ['REQUEST_URI'] ) ) );
|
1310 |
exit ();
|
1311 |
} elseif (! empty ( $_GET ['_wp_http_referer'] )) {
|
1312 |
wp_safe_redirect ( remove_query_arg ( array (
|
1313 |
+
'_wp_http_referer',
|
1314 |
+
'_wpnonce',
|
1315 |
+
'a'
|
1316 |
+
), stripslashes ( $_SERVER ['REQUEST_URI'] ) ) );
|
1317 |
exit ();
|
1318 |
}
|
1319 |
}
|
1396 |
exit ();
|
1397 |
}
|
1398 |
wp_safe_redirect ( remove_query_arg ( array (
|
1399 |
+
'_wp_http_referer',
|
1400 |
+
'_wpnonce',
|
1401 |
+
'export',
|
1402 |
+
'a'
|
1403 |
+
), stripslashes ( $_SERVER ['REQUEST_URI'] ) ) );
|
1404 |
exit ();
|
1405 |
} elseif (! empty ( $_GET ['_wp_http_referer'] )) {
|
1406 |
wp_safe_redirect ( remove_query_arg ( array (
|
1407 |
+
'_wp_http_referer',
|
1408 |
+
'_wpnonce',
|
1409 |
+
'a'
|
1410 |
+
), stripslashes ( $_SERVER ['REQUEST_URI'] ) ) );
|
1411 |
exit ();
|
1412 |
}
|
1413 |
}
|
1423 |
Yop_Poll_Model::delete_poll_ban_from_db ( $ban_id );
|
1424 |
}
|
1425 |
wp_redirect ( add_query_arg ( 'deleted', count ( $bulkbans ), remove_query_arg ( array (
|
1426 |
+
'_wp_http_referer',
|
1427 |
+
'_wpnonce',
|
1428 |
+
'yoppollbanscheck'
|
1429 |
+
), stripslashes ( $_SERVER ['REQUEST_URI'] ) ) ) );
|
1430 |
exit ();
|
1431 |
}
|
1432 |
} elseif ('-1' != $action && isset ( $_REQUEST ['id'] )) {
|
1436 |
require_once ($this->_config->plugin_inc_dir . '/yop_poll_model.php');
|
1437 |
Yop_Poll_Model::delete_poll_ban_from_db ( $ban_id );
|
1438 |
wp_redirect ( add_query_arg ( 'deleted', 1, remove_query_arg ( array (
|
1439 |
+
'_wpnonce',
|
1440 |
+
'id',
|
1441 |
+
'action'
|
1442 |
+
), stripslashes ( $_SERVER ['REQUEST_URI'] ) ) ) );
|
1443 |
exit ();
|
1444 |
}
|
1445 |
} elseif ('add-ban' == $action) {
|
1448 |
$bans = Yop_Poll_Model::add_bans ( $_REQUEST );
|
1449 |
if ($bans ['error'] != '') {
|
1450 |
wp_redirect ( add_query_arg ( 'bans-error', urlencode ( $bans ['error'] ), remove_query_arg ( array (
|
1451 |
+
'_wpnonce',
|
1452 |
+
'id',
|
1453 |
+
'action'
|
1454 |
+
), stripslashes ( $_SERVER ['REQUEST_URI'] ) ) ) );
|
1455 |
exit ();
|
1456 |
} else {
|
1457 |
wp_redirect ( add_query_arg ( 'bans-added', urlencode ( ( int ) $bans ['success'] ), remove_query_arg ( array (
|
1458 |
+
'_wpnonce',
|
1459 |
+
'id',
|
1460 |
+
'action'
|
1461 |
+
), stripslashes ( $_SERVER ['REQUEST_URI'] ) ) ) );
|
1462 |
exit ();
|
1463 |
}
|
1464 |
} elseif (! empty ( $_GET ['_wp_http_referer'] )) {
|
1465 |
wp_safe_redirect ( remove_query_arg ( array (
|
1466 |
+
'_wp_http_referer',
|
1467 |
+
'_wpnonce'
|
1468 |
+
), stripslashes ( $_SERVER ['REQUEST_URI'] ) ) );
|
1469 |
exit ();
|
1470 |
}
|
1471 |
}
|
1486 |
$total_deleted ++;
|
1487 |
}
|
1488 |
wp_redirect ( add_query_arg ( 'deleted', count ( $bulktemplates ) - $total_deleted, remove_query_arg ( array (
|
1489 |
+
'_wp_http_referer',
|
1490 |
+
'_wpnonce',
|
1491 |
+
'templatecheck'
|
1492 |
+
), stripslashes ( $_SERVER ['REQUEST_URI'] ) ) ) );
|
1493 |
exit ();
|
1494 |
}
|
1495 |
if ('clone' == $action) {
|
1506 |
$total_cloned ++;
|
1507 |
}
|
1508 |
wp_redirect ( add_query_arg ( 'cloned', count ( $bulktemplates ) - $total_cloned, remove_query_arg ( array (
|
1509 |
+
'_wp_http_referer',
|
1510 |
+
'_wpnonce',
|
1511 |
+
'templatecheck'
|
1512 |
+
), stripslashes ( $_SERVER ['REQUEST_URI'] ) ) ) );
|
1513 |
exit ();
|
1514 |
}
|
1515 |
} elseif ('-1' != $action && isset ( $_REQUEST ['id'] )) {
|
1523 |
else
|
1524 |
wp_die ( __ ( 'You are not allowed to delete this item.', 'yop_poll' ) );
|
1525 |
wp_redirect ( add_query_arg ( 'deleted', 1, remove_query_arg ( array (
|
1526 |
+
'_wpnonce',
|
1527 |
+
'id',
|
1528 |
+
'action'
|
1529 |
+
), stripslashes ( $_SERVER ['REQUEST_URI'] ) ) ) );
|
1530 |
exit ();
|
1531 |
}
|
1532 |
if ('clone' == $action) {
|
1539 |
else
|
1540 |
wp_die ( __ ( 'You are not allowed to clone this item.', 'yop_poll' ) );
|
1541 |
wp_redirect ( add_query_arg ( 'cloned', 1, remove_query_arg ( array (
|
1542 |
+
'_wpnonce',
|
1543 |
+
'id',
|
1544 |
+
'action'
|
1545 |
+
), stripslashes ( $_SERVER ['REQUEST_URI'] ) ) ) );
|
1546 |
exit ();
|
1547 |
}
|
1548 |
} elseif (! empty ( $_GET ['_wp_http_referer'] )) {
|
1549 |
wp_safe_redirect ( remove_query_arg ( array (
|
1550 |
+
'_wp_http_referer',
|
1551 |
+
'_wpnonce'
|
1552 |
+
), stripslashes ( $_SERVER ['REQUEST_URI'] ) ) );
|
1553 |
exit ();
|
1554 |
}
|
1555 |
}
|
1570 |
$total_undeleted ++;
|
1571 |
}
|
1572 |
wp_redirect ( add_query_arg ( 'deleted', count ( $bulkyoppolls ) - $total_undeleted, remove_query_arg ( array (
|
1573 |
+
'_wp_http_referer',
|
1574 |
+
'_wpnonce',
|
1575 |
+
'yoppollcheck'
|
1576 |
+
), stripslashes ( $_SERVER ['REQUEST_URI'] ) ) ) );
|
1577 |
exit ();
|
1578 |
}
|
1579 |
if ('clone' == $action) {
|
1590 |
$total_uncloned ++;
|
1591 |
}
|
1592 |
wp_redirect ( add_query_arg ( 'cloned', count ( $bulkyoppolls ) - $total_uncloned, remove_query_arg ( array (
|
1593 |
+
'_wp_http_referer',
|
1594 |
+
'_wpnonce',
|
1595 |
+
'yoppollcheck'
|
1596 |
+
), stripslashes ( $_SERVER ['REQUEST_URI'] ) ) ) );
|
1597 |
exit ();
|
1598 |
}
|
1599 |
if ('reset_votes' == $action) {
|
1610 |
$total_unreseted ++;
|
1611 |
}
|
1612 |
wp_redirect ( add_query_arg ( 'reseted_votes', count ( $bulkyoppolls ) - $total_unreseted, remove_query_arg ( array (
|
1613 |
+
'_wp_http_referer',
|
1614 |
+
'_wpnonce',
|
1615 |
+
'yoppollcheck'
|
1616 |
+
), stripslashes ( $_SERVER ['REQUEST_URI'] ) ) ) );
|
1617 |
exit ();
|
1618 |
}
|
1619 |
if ('delete_logs' == $action) {
|
1630 |
$total_undeleted_logs ++;
|
1631 |
}
|
1632 |
wp_redirect ( add_query_arg ( 'deleted_logs', count ( $bulkyoppolls ) - $total_undeleted_logs, remove_query_arg ( array (
|
1633 |
+
'_wp_http_referer',
|
1634 |
+
'_wpnonce',
|
1635 |
+
'yoppollcheck'
|
1636 |
+
), stripslashes ( $_SERVER ['REQUEST_URI'] ) ) ) );
|
1637 |
exit ();
|
1638 |
}
|
1639 |
} elseif ('-1' != $action && isset ( $_REQUEST ['id'] )) {
|
1647 |
else
|
1648 |
wp_die ( __ ( 'You are not allowed to delete this item.', 'yop_poll' ) );
|
1649 |
wp_redirect ( add_query_arg ( 'deleted', 1, remove_query_arg ( array (
|
1650 |
+
'_wpnonce',
|
1651 |
+
'id',
|
1652 |
+
'action'
|
1653 |
+
), stripslashes ( $_SERVER ['REQUEST_URI'] ) ) ) );
|
1654 |
exit ();
|
1655 |
}
|
1656 |
|
1664 |
else
|
1665 |
wp_die ( __ ( 'You are not allowed to clone this item.', 'yop_poll' ) );
|
1666 |
wp_redirect ( add_query_arg ( 'cloned', 1, remove_query_arg ( array (
|
1667 |
+
'_wpnonce',
|
1668 |
+
'id',
|
1669 |
+
'action'
|
1670 |
+
), stripslashes ( $_SERVER ['REQUEST_URI'] ) ) ) );
|
1671 |
exit ();
|
1672 |
}
|
1673 |
|
1681 |
else
|
1682 |
wp_die ( __ ( 'You are not allowed to reset stats for this item.', 'yop_poll' ) );
|
1683 |
wp_redirect ( add_query_arg ( 'reseted_votes', 1, remove_query_arg ( array (
|
1684 |
+
'_wpnonce',
|
1685 |
+
'id',
|
1686 |
+
'action'
|
1687 |
+
), stripslashes ( $_SERVER ['REQUEST_URI'] ) ) ) );
|
1688 |
exit ();
|
1689 |
}
|
1690 |
|
1698 |
else
|
1699 |
wp_die ( __ ( 'You are not allowed to delete logs for this item.', 'yop_poll' ) );
|
1700 |
wp_redirect ( add_query_arg ( 'deleted_logs', 1, remove_query_arg ( array (
|
1701 |
+
'_wpnonce',
|
1702 |
+
'id',
|
1703 |
+
'action'
|
1704 |
+
), stripslashes ( $_SERVER ['REQUEST_URI'] ) ) ) );
|
1705 |
exit ();
|
1706 |
}
|
1707 |
} elseif (! empty ( $_GET ['_wp_http_referer'] )) {
|
1708 |
wp_safe_redirect ( remove_query_arg ( array (
|
1709 |
+
'_wp_http_referer',
|
1710 |
+
'_wpnonce'
|
1711 |
+
), stripslashes ( $_SERVER ['REQUEST_URI'] ) ) );
|
1712 |
exit ();
|
1713 |
}
|
1714 |
}
|
1815 |
|
1816 |
</div>
|
1817 |
<h2><?php _e( 'Yop Poll', 'yop_poll' ); ?><a class="add-new-h2"
|
1818 |
+
href="<?php echo esc_url( add_query_arg( array( 'page' => 'yop-polls-add-new', 'id' => false, 'deleted' => false, 'cloned' => false ) ) ); ?>"><?php _e( 'Add New', 'yop_poll' ); ?></a>
|
1819 |
</h2>
|
1820 |
<?php
|
1821 |
if (isset ( $_REQUEST ['deleted'] )) {
|
1824 |
printf ( _n ( '%s Poll deleted.', '%s Polls deleted.', $deleted ), $deleted );
|
1825 |
echo '</p></div>';
|
1826 |
$_SERVER ['REQUEST_URI'] = remove_query_arg ( array (
|
1827 |
+
'deleted'
|
1828 |
), $_SERVER ['REQUEST_URI'] );
|
1829 |
}
|
1830 |
?>
|
1835 |
printf ( _n ( '%s Poll cloned.', '%s Polls cloned.', $cloned ), $cloned );
|
1836 |
echo '</p></div>';
|
1837 |
$_SERVER ['REQUEST_URI'] = remove_query_arg ( array (
|
1838 |
+
'cloned'
|
1839 |
), $_SERVER ['REQUEST_URI'] );
|
1840 |
}
|
1841 |
?>
|
1846 |
printf ( _n ( 'Vote reseted for %s Poll.', 'Votes reseted for %s Poll.', $reseted_votes ), $reseted_votes );
|
1847 |
echo '</p></div>';
|
1848 |
$_SERVER ['REQUEST_URI'] = remove_query_arg ( array (
|
1849 |
+
'reseted_votes'
|
1850 |
), $_SERVER ['REQUEST_URI'] );
|
1851 |
}
|
1852 |
?>
|
1858 |
printf ( _n ( 'Log deleted for %s Poll.', 'Log deleted for %s Polls.', $deleted_logs ), $deleted_logs );
|
1859 |
echo '</p></div>';
|
1860 |
$_SERVER ['REQUEST_URI'] = remove_query_arg ( array (
|
1861 |
+
'deleted_logs'
|
1862 |
), $_SERVER ['REQUEST_URI'] );
|
1863 |
}
|
1864 |
?>
|
1984 |
<?php } ?>
|
1985 |
</th>
|
1986 |
<td><strong>
|
|
|
|
|
|
|
|
|
|
|
|
|
1987 |
<?php if ( ( $this->current_user_can( 'edit_own_polls') && $yop_poll['poll_author'] == $current_user->ID ) || ($this->current_user_can( 'edit_polls' ) ) ) { ?>
|
1988 |
+
<a title="<?php echo $yop_poll['id']; ?>"
|
1989 |
+
href="<?php echo esc_url( add_query_arg( array( 'action' => 'edit', 'id' => $yop_poll['id'] ) ) ); ?>"
|
1990 |
+
class="row-title">
|
1991 |
+
<?php }?>
|
1992 |
+
<?php echo $yop_poll['id']; ?>
|
1993 |
+
<?php if ( ( $this->current_user_can( 'edit_own_polls') && $yop_poll['poll_author'] == $current_user->ID ) || ($this->current_user_can( 'edit_polls' ) ) ) { ?>
|
1994 |
+
</a>
|
1995 |
+
<?php } ?></strong><br></td>
|
1996 |
<td><strong>
|
1997 |
<?php if ( ( $this->current_user_can( 'edit_own_polls') && $yop_poll['poll_author'] == $current_user->ID ) || ($this->current_user_can( 'edit_polls' ) ) ) { ?>
|
1998 |
<a
|
2025 |
<?php } ?>
|
2026 |
<?php if ( ( $this->current_user_can( 'clone_own_polls') && $yop_poll['poll_author'] == $current_user->ID ) || ($this->current_user_can( 'clone_polls' ) ) ) { ?>
|
2027 |
<span class="clone"><a
|
2028 |
+
onclick="if ( confirm( '<?php echo __( "You are about to clone this poll",'yop_poll').": \'".esc_html( $yop_poll['name'] )."\' \\n \'".__("Cancel", 'yop_poll')."\' ". __('to stop', 'yop_poll'). ", \'".__('OK', 'yop_poll')."\' ".__('to clone', 'yop_poll'); ?>' ) ) { return true;}return false;"
|
2029 |
+
href="<?php echo wp_nonce_url( add_query_arg( array( 'action' => 'clone', 'id' => $yop_poll['id'] ) ), 'yop-poll-clone' ); ?>"
|
2030 |
+
class="submitclone"><?php _e( 'Clone', 'yop_poll' ) ?></a> |
|
2031 |
</span>
|
2032 |
<?php } ?>
|
2033 |
<?php if ( ( $this->current_user_can( 'view_own_polls_results') && $yop_poll['poll_author'] == $current_user->ID ) || ($this->current_user_can( 'view_polls_results' ) ) ) { ?>
|
2044 |
<?php } ?>
|
2045 |
<?php if ( ( $this->current_user_can( 'delete_own_polls_logs') && $yop_poll['poll_author'] == $current_user->ID ) || ($this->current_user_can( 'delete_polls_logs' ) ) ) { ?>
|
2046 |
<span class="delete"><a
|
2047 |
+
onclick="if ( confirm( '<?php echo __( "You are about to delete logs for this poll",'yop_poll').": \'".esc_html( $yop_poll['name'] )."\' \\n \'".__("Cancel", 'yop_poll')."\' ". __('to stop', 'yop_poll'). ", \'".__('OK', 'yop_poll')."\' ".__('to delete logs', 'yop_poll'); ?>' ) ) { return true;}return false;"
|
2048 |
+
href="<?php echo wp_nonce_url( add_query_arg( array( 'action' => 'delete_logs', 'id' => $yop_poll['id'] ) ), 'yop-poll-delete-logs' ); ?>"
|
2049 |
+
class="submitresetvotes"><?php _e( 'Delete Logs', 'yop_poll' ) ?></a></span>
|
2050 |
<?php } ?>
|
2051 |
</div></td>
|
2052 |
<td>
|
2178 |
else
|
2179 |
$display_other_answers_values = false;
|
2180 |
$poll_answers = YOP_POLL_MODEL::get_poll_answers ( $poll_id, array (
|
2181 |
+
'default',
|
2182 |
+
'other'
|
2183 |
), $results_order_by, $results_order, $display_other_answers_values );
|
2184 |
$poll_other_answer = YOP_POLL_MODEL::get_poll_answers ( $poll_id, array (
|
2185 |
+
'other'
|
2186 |
+
) );
|
2187 |
|
2188 |
// other-answers
|
2189 |
$oa_per_page = (isset ( $_GET ['oa_per_page'] ) ? intval ( $_GET ['oa_per_page'] ) : 100);
|
2238 |
|
2239 |
</div>
|
2240 |
<h2><?php _e( 'Yop Poll Results', 'yop_poll' ); ?><a class="add-new-h2"
|
2241 |
+
href="<?php echo esc_url( add_query_arg( array( 'page' => 'yop-polls' ), remove_query_arg( array( 'action', 'id'), stripslashes( $_SERVER['REQUEST_URI'] ) ) ) ); ?>"><?php _e( 'All Yop Polls', 'yop_poll' ); ?></a>
|
2242 |
</h2>
|
2243 |
<?php
|
2244 |
if ($poll_details) {
|
2519 |
);
|
2520 |
$pagination = paginate_links ( $args );
|
2521 |
$_SERVER ['REQUEST_URI'] = remove_query_arg ( array (
|
2522 |
+
'action'
|
2523 |
), $_SERVER ['REQUEST_URI'] );
|
2524 |
?>
|
2525 |
<div class="wrap">
|
2528 |
|
2529 |
</div>
|
2530 |
<h2><?php _e( 'Custom Fields', 'yop_poll' ); ?><a class="add-new-h2"
|
2531 |
+
href="<?php echo esc_url( add_query_arg( array( 'page' => 'yop-polls' ), remove_query_arg( array( 'action', 'id'), stripslashes( $_SERVER['REQUEST_URI'] ) ) ) ); ?>"><?php _e( 'All Yop Polls', 'yop_poll' ); ?></a>
|
2532 |
</h2>
|
2533 |
<?php
|
2534 |
if ($poll_details) {
|
2548 |
<th><label for="yop-poll-custom-field-start-date-input"><?php _e( 'Start Date', 'yop_poll' ); ?>:</label>
|
2549 |
</th>
|
2550 |
<td><input id="yop-poll-custom-field-start-date-input" type="text"
|
2551 |
+
name="sdate" value="<?php echo $sdate; ?>" /></td>
|
2552 |
</tr>
|
2553 |
<tr>
|
2554 |
<th><label for="yop-poll-custom-field-end-date-input"><?php _e( 'End Date', 'yop_poll' ); ?>:</label>
|
2555 |
</th>
|
2556 |
<td><input id="yop-poll-custom-field-end-date-input" type="text"
|
2557 |
+
name="edate" value="<?php echo $edate; ?>" /></td>
|
2558 |
</tr>
|
2559 |
<tr>
|
2560 |
<th colspan="2"><input value="<?php _e( 'Filter', 'yop_poll' ); ?>"
|
2561 |
+
type="submit" name="a" /></th>
|
2562 |
</tr>
|
2563 |
</tbody>
|
2564 |
</table>
|
2690 |
|
2691 |
</div>
|
2692 |
<h2><?php _e( 'Yop Poll Templates', 'yop_poll' ); ?><a
|
2693 |
+
class="add-new-h2"
|
2694 |
+
href="<?php echo esc_url( add_query_arg( array( 'page' => 'yop-polls-templates', 'action' => 'add-new', 'id' => false, 'deleted' => false, 'cloned' => false ) ) ); ?>"><?php _e( 'Add New', 'yop_poll' ); ?></a>
|
2695 |
</h2>
|
2696 |
<?php
|
2697 |
if (isset ( $_REQUEST ['deleted'] )) {
|
2700 |
printf ( _n ( '%s Poll template deleted.', '%s Poll templates deleted.', $deleted ), $deleted );
|
2701 |
echo '</p></div>';
|
2702 |
$_SERVER ['REQUEST_URI'] = remove_query_arg ( array (
|
2703 |
+
'deleted'
|
2704 |
), $_SERVER ['REQUEST_URI'] );
|
2705 |
}
|
2706 |
?>
|
2711 |
printf ( _n ( '%s Poll template cloned.', '%s Poll templates cloned.', $cloned ), $cloned );
|
2712 |
echo '</p></div>';
|
2713 |
$_SERVER ['REQUEST_URI'] = remove_query_arg ( array (
|
2714 |
+
'cloned'
|
2715 |
), $_SERVER ['REQUEST_URI'] );
|
2716 |
}
|
2717 |
?>
|
2801 |
<?php } ?>
|
2802 |
<?php if ( ( $this->current_user_can( 'delete_own_polls_templates') && $template['template_author'] == $current_user->ID ) || ($this->current_user_can( 'delete_polls_templates' ) ) ) { ?>
|
2803 |
<span class="delete"><a
|
2804 |
+
onclick="if ( confirm( '<?php echo __( "You are about to delete this poll template",'yop_poll').": \'".esc_html( $template['name'] )."\' \\n \'".__("Cancel", 'yop_poll')."\' ". __('to stop', 'yop_poll'). ", \'".__('OK', 'yop_poll')."\' ".__('to delete', 'yop_poll'); ?>' ) ) { return true;}return false;"
|
2805 |
+
href="<?php echo wp_nonce_url( add_query_arg( array( 'action' => 'delete', 'id' => $template['id'] ) ), 'yop-poll-templates' ); ?>"
|
2806 |
+
class="submitdelete"><?php _e( 'Delete', 'yop_poll' ) ?></a> | </span>
|
2807 |
<?php } ?>
|
2808 |
<?php if ( ( $this->current_user_can( 'clone_own_polls_templates') && $template['template_author'] == $current_user->ID ) || ($this->current_user_can( 'clone_polls_templates' ) ) ) { ?>
|
2809 |
<span class="clone"><a
|
2810 |
+
onclick="if ( confirm( '<?php echo __( "You are about to clone this poll template",'yop_poll').": \'".esc_html( $template['name'] )."\' \\n \'".__("Cancel", 'yop_poll')."\' ". __('to stop', 'yop_poll'). ", \'".__('OK', 'yop_poll')."\' ".__('to clone', 'yop_poll'); ?>' ) ) { return true;}return false;"
|
2811 |
+
href="<?php echo wp_nonce_url( add_query_arg( array( 'action' => 'clone', 'id' => $template['id'] ) ), 'yop-poll-templates' ); ?>"
|
2812 |
+
class="submitdelete"><?php _e( 'Clone', 'yop_poll' ) ?></a></span>
|
2813 |
<?php } ?>
|
2814 |
</div></td>
|
2815 |
<td><strong>
|
3004 |
);
|
3005 |
$pagination = paginate_links ( $args );
|
3006 |
$_SERVER ['REQUEST_URI'] = remove_query_arg ( array (
|
3007 |
+
'action'
|
3008 |
), $_SERVER ['REQUEST_URI'] );
|
3009 |
?>
|
3010 |
<div class="wrap">
|
3020 |
printf ( _n ( '%s Poll Log deleted.', '%s Poll Logs deleted.', $deleted ), $deleted );
|
3021 |
echo '</p></div>';
|
3022 |
$_SERVER ['REQUEST_URI'] = remove_query_arg ( array (
|
3023 |
+
'deleted'
|
3024 |
), $_SERVER ['REQUEST_URI'] );
|
3025 |
}
|
3026 |
?>
|
3285 |
if (($this->current_user_can ( 'delete_own_polls_logs' ) && $poll_author == $current_user->ID) || ($this->current_user_can ( 'delete_polls_logs' ))) {
|
3286 |
?>
|
3287 |
<span class="delete"><a
|
3288 |
+
onclick="if ( confirm( '<?php echo __( "You are about to delete this vote log",'yop_poll')." \\n \'".__("Cancel", 'yop_poll')."\' ". __('to stop', 'yop_poll'). ", \'".__('OK', 'yop_poll')."\' ".__('to delete', 'yop_poll'); ?>' ) ) { return true;}return false;"
|
3289 |
+
href="<?php echo wp_nonce_url( add_query_arg( array( 'action' => 'delete_group', 'id' => $log['vote_id'] ) ), 'yop-poll-logs-delete' ); ?>"
|
3290 |
+
class="submitdelete"><?php _e( 'Delete', 'yop_poll' ) ?></a></span>
|
3291 |
<?php } ?>
|
3292 |
<?php
|
3293 |
|
3299 |
if (($this->current_user_can ( 'delete_own_polls_logs' ) && $poll_author == $current_user->ID) || ($this->current_user_can ( 'delete_polls_logs' ))) {
|
3300 |
?>
|
3301 |
<span class="delete"><a
|
3302 |
+
onclick="if ( confirm( '<?php echo __( "You are about to delete this poll log",'yop_poll').": \'".esc_html( $log['id'] )."\' \\n \'".__("Cancel", 'yop_poll')."\' ". __('to stop', 'yop_poll'). ", \'".__('OK', 'yop_poll')."\' ".__('to delete', 'yop_poll'); ?>' ) ) { return true;}return false;"
|
3303 |
+
href="<?php echo wp_nonce_url( add_query_arg( array( 'action' => 'delete', 'id' => $log['id'] ) ), 'yop-poll-logs-delete' ); ?>"
|
3304 |
+
class="submitdelete"><?php _e( 'Delete', 'yop_poll' ) ?></a></span>
|
3305 |
<?php } ?>
|
3306 |
<?php } ?>
|
3307 |
</div></td>
|
3398 |
);
|
3399 |
$pagination = paginate_links ( $args );
|
3400 |
$_SERVER ['REQUEST_URI'] = remove_query_arg ( array (
|
3401 |
+
'action'
|
3402 |
), $_SERVER ['REQUEST_URI'] );
|
3403 |
?>
|
3404 |
<div class="wrap">
|
3407 |
|
3408 |
</div>
|
3409 |
<h2><?php _e( 'Yop Poll Bans', 'yop_poll' ); ?> <a
|
3410 |
+
href="javascript:void(0);" class="add-new-h2"
|
3411 |
+
id="yop-poll-add-new-ban"><?php _e( 'Add New', 'yop_poll' ); ?></a>
|
3412 |
</h2>
|
3413 |
<?php
|
3414 |
if (isset ( $_REQUEST ['deleted'] )) {
|
3417 |
printf ( _n ( '%s Poll Ban deleted!', '%s Poll Bans deleted!', $deleted ), $deleted );
|
3418 |
echo '</p></div>';
|
3419 |
$_SERVER ['REQUEST_URI'] = remove_query_arg ( array (
|
3420 |
+
'deleted'
|
3421 |
), $_SERVER ['REQUEST_URI'] );
|
3422 |
}
|
3423 |
?>
|
3428 |
printf ( _n ( '%s Poll Ban added!', '%s Poll Bans added!', $added ), $added );
|
3429 |
echo '</p></div>';
|
3430 |
$_SERVER ['REQUEST_URI'] = remove_query_arg ( array (
|
3431 |
+
'bans-added'
|
3432 |
), $_SERVER ['REQUEST_URI'] );
|
3433 |
}
|
3434 |
?>
|
3438 |
print $_REQUEST ['bans-error'];
|
3439 |
echo '</p></div>';
|
3440 |
$_SERVER ['REQUEST_URI'] = remove_query_arg ( array (
|
3441 |
+
'bans-error'
|
3442 |
), $_SERVER ['REQUEST_URI'] );
|
3443 |
}
|
3444 |
?>
|
3452 |
<tbody>
|
3453 |
<tr class="form-field form-required">
|
3454 |
<th scope="row"><label for="ban-poll-id"><?php _e( 'Poll', 'yop_poll' ); ?> <span
|
3455 |
+
class="description">(required)</span></label></th>
|
3456 |
<td><select id="ban-poll-id" name="ban_poll_id">
|
3457 |
<option value="0"><?php _e( 'Bans For All Polls', 'yop_poll' ); ?></option>
|
3458 |
<?php
|
3468 |
</tr>
|
3469 |
<tr class="form-field form-required">
|
3470 |
<th scope="row"><label for="yop-poll-ban-type"><?php _e( 'Type', 'yop_poll' ); ?> <span
|
3471 |
+
class="description">(required)</span></label></th>
|
3472 |
<td><select id="yop-poll-ban-type" name="ban_type">
|
3473 |
<option value=""><?php _e( 'Choose Ban Type', 'yop_poll' ); ?></option>
|
3474 |
<option value="ip"><?php _e( 'IP', 'yop_poll' ); ?></option>
|
3477 |
</tr>
|
3478 |
<tr class="form-field form-required">
|
3479 |
<th scope="row"><label for="yop-poll-ban-value"><?php _e( 'Value', 'yop_poll' ); ?> <span
|
3480 |
+
class="description">(required)</span><br> <small><i><?php _e( 'One Value Per Line', 'yop_poll'); ?></i></small></label></th>
|
3481 |
<td><textarea rows="5" cols="20" id="yop-poll-ban-value"
|
3482 |
+
name="ban_value"></textarea></td>
|
3483 |
</tr>
|
3484 |
</tbody>
|
3485 |
</table>
|
3626 |
<tr valign="middle" class="alternate"
|
3627 |
id="yop-poll-log<?php echo $ban['id']; ?>">
|
3628 |
<th class="check-column" scope="row"><input type="checkbox"
|
3629 |
+
value="<?php echo $ban['id']; ?>" name="yoppollbanscheck[]"></th>
|
3630 |
<td><strong><?php echo $ban['id']; ?></strong><br></td>
|
3631 |
<td><strong><?php echo esc_html( stripslashes( $ban['name'] ) ); ?></strong><br>
|
3632 |
<div class="row-actions">
|
3633 |
<span class="delete"><a
|
3634 |
+
onclick="if ( confirm( '<?php echo __( "You are about to remove this poll ban",'yop_poll').": \'".esc_html( $log['id'] )."\' \\n \'".__("Cancel", 'yop_poll')."\' ". __('to stop', 'yop_poll'). ", \'".__('OK', 'yop_poll')."\' ".__('to remove', 'yop_poll'); ?>' ) ) { return true;}return false;"
|
3635 |
+
href="<?php echo wp_nonce_url( add_query_arg( array( 'action' => 'delete', 'id' => $ban['id'] ) ), 'yop-poll-bans-delete' ); ?>"
|
3636 |
+
class="submitdelete"><?php _e( 'Remove', 'yop_poll' ) ?></a></span>
|
3637 |
</div></td>
|
3638 |
<td>
|
3639 |
<?php echo esc_html( stripslashes( $ban['type'] ) ); ?>
|
3689 |
}
|
3690 |
public function yop_poll_options_admin_init() {
|
3691 |
register_setting ( 'yop_poll_options', 'yop_poll_options', array (
|
3692 |
+
&$this,
|
3693 |
+
'yop_poll_options_validate'
|
3694 |
+
) );
|
3695 |
register_setting ( 'yop_poll_pro_options', 'yop_poll_pro_options', array (
|
3696 |
+
&$this,
|
3697 |
+
'yop_poll_pro_options_validate'
|
3698 |
+
) );
|
3699 |
}
|
3700 |
|
3701 |
public function yop_poll_pro_options_validate($input) {
|
3753 |
// allow_other_answers
|
3754 |
if (isset ( $input ['allow_other_answers'] )) {
|
3755 |
if (in_array ( $input ['allow_other_answers'], array (
|
3756 |
+
'yes',
|
3757 |
+
'no'
|
3758 |
+
) )) {
|
3759 |
if ($default_options ['allow_other_answers'] != trim ( $input ['allow_other_answers'] )) {
|
3760 |
$newinput ['allow_other_answers'] = trim ( $input ['allow_other_answers'] );
|
3761 |
$updated .= __ ( 'Option "Allow Other Answer" Updated!', 'yop_poll' ) . $message_delimiter;
|
3778 |
|
3779 |
if (isset ( $input ['add_other_answers_to_default_answers'] )) {
|
3780 |
if (in_array ( $input ['add_other_answers_to_default_answers'], array (
|
3781 |
+
'yes',
|
3782 |
+
'no'
|
3783 |
+
) )) {
|
3784 |
if ($default_options ['add_other_answers_to_default_answers'] != trim ( $input ['add_other_answers_to_default_answers'] )) {
|
3785 |
$newinput ['add_other_answers_to_default_answers'] = trim ( $input ['add_other_answers_to_default_answers'] );
|
3786 |
$updated .= __ ( 'Option "Add the values submitted in \'Other\' as answers" Updated!', 'yop_poll' ) . $message_delimiter;
|
3793 |
|
3794 |
if (isset ( $input ['display_other_answers_values'] )) {
|
3795 |
if (in_array ( $input ['display_other_answers_values'], array (
|
3796 |
+
'yes',
|
3797 |
+
'no'
|
3798 |
+
) )) {
|
3799 |
if ($default_options ['display_other_answers_values'] != trim ( $input ['display_other_answers_values'] )) {
|
3800 |
$newinput ['display_other_answers_values'] = trim ( $input ['display_other_answers_values'] );
|
3801 |
$updated .= __ ( 'Option "Display Other Answers Values" Updated!', 'yop_poll' ) . $message_delimiter;
|
3811 |
// allow_multiple_answers
|
3812 |
if (isset ( $input ['allow_multiple_answers'] )) {
|
3813 |
if (in_array ( $input ['allow_multiple_answers'], array (
|
3814 |
+
'yes',
|
3815 |
+
'no'
|
3816 |
+
) )) {
|
3817 |
if ($default_options ['allow_multiple_answers'] != trim ( $input ['allow_multiple_answers'] )) {
|
3818 |
$newinput ['allow_multiple_answers'] = trim ( $input ['allow_multiple_answers'] );
|
3819 |
$updated .= __ ( 'Option "Allow Multiple Answers" Updated!', 'yop_poll' ) . $message_delimiter;
|
3852 |
|
3853 |
if (isset ( $input ['use_captcha'] )) {
|
3854 |
if (in_array ( $input ['use_captcha'], array (
|
3855 |
+
'yes',
|
3856 |
+
'no'
|
3857 |
+
) )) {
|
3858 |
if ($default_options ['use_captcha'] != trim ( $input ['use_captcha'] )) {
|
3859 |
$newinput ['use_captcha'] = trim ( $input ['use_captcha'] );
|
3860 |
$updated .= __ ( 'Option "Use CAPTCHA" Updated!', 'yop_poll' ) . $message_delimiter;
|
3868 |
// display_answers
|
3869 |
if (isset ( $input ['display_answers'] )) {
|
3870 |
if (in_array ( $input ['display_answers'], array (
|
3871 |
+
'vertical',
|
3872 |
+
'orizontal',
|
3873 |
+
'tabulated'
|
3874 |
+
) )) {
|
3875 |
if ($default_options ['display_answers'] != trim ( $input ['display_answers'] )) {
|
3876 |
$newinput ['display_answers'] = trim ( $input ['display_answers'] );
|
3877 |
$updated .= __ ( 'Option "Display Answers" Updated!', 'yop_poll' ) . $message_delimiter;
|
3900 |
// display_results
|
3901 |
if (isset ( $input ['display_results'] )) {
|
3902 |
if (in_array ( $input ['display_results'], array (
|
3903 |
+
'vertical',
|
3904 |
+
'orizontal',
|
3905 |
+
'tabulated'
|
3906 |
+
) )) {
|
3907 |
if ($default_options ['display_results'] != trim ( $input ['display_results'] )) {
|
3908 |
$newinput ['display_results'] = trim ( $input ['display_results'] );
|
3909 |
$updated .= __ ( 'Option "Display Results" Updated!', 'yop_poll' ) . $message_delimiter;
|
3957 |
// use_template_bar
|
3958 |
if (isset ( $input ['use_template_bar'] )) {
|
3959 |
if (in_array ( $input ['use_template_bar'], array (
|
3960 |
+
'yes',
|
3961 |
+
'no'
|
3962 |
+
) )) {
|
3963 |
if ($default_options ['use_template_bar'] != trim ( $input ['use_template_bar'] )) {
|
3964 |
$newinput ['use_template_bar'] = trim ( $input ['use_template_bar'] );
|
3965 |
$updated .= __ ( 'Option "Use Template Result Bar" Updated!', 'yop_poll' ) . $message_delimiter;
|
4040 |
// sorting_answers
|
4041 |
if (isset ( $input ['sorting_answers'] )) {
|
4042 |
if (in_array ( $input ['sorting_answers'], array (
|
4043 |
+
'exact',
|
4044 |
+
'alphabetical',
|
4045 |
+
'random',
|
4046 |
+
'votes'
|
4047 |
+
) )) {
|
4048 |
if ($default_options ['sorting_answers'] != trim ( $input ['sorting_answers'] )) {
|
4049 |
$newinput ['sorting_answers'] = trim ( $input ['sorting_answers'] );
|
4050 |
$updated .= __ ( 'Option "Sort Answers" Updated!', 'yop_poll' ) . $message_delimiter;
|
4053 |
// sorting_answers_direction
|
4054 |
if (isset ( $input ['sorting_answers_direction'] )) {
|
4055 |
if (in_array ( $input ['sorting_answers_direction'], array (
|
4056 |
+
'asc',
|
4057 |
+
'desc'
|
4058 |
+
) )) {
|
4059 |
if ($default_options ['sorting_answers_direction'] != trim ( $input ['sorting_answers_direction'] )) {
|
4060 |
$newinput ['sorting_answers_direction'] = trim ( $input ['sorting_answers_direction'] );
|
4061 |
$updated .= __ ( 'Option "Sort Answers Direction" Updated!', 'yop_poll' ) . $message_delimiter;
|
4074 |
// sorting_results
|
4075 |
if (isset ( $input ['sorting_answers'] )) {
|
4076 |
if (in_array ( $input ['sorting_results'], array (
|
4077 |
+
'exact',
|
4078 |
+
'alphabetical',
|
4079 |
+
'random',
|
4080 |
+
'votes'
|
4081 |
+
) )) {
|
4082 |
if ($default_options ['sorting_results'] != trim ( $input ['sorting_results'] )) {
|
4083 |
$newinput ['sorting_results'] = trim ( $input ['sorting_results'] );
|
4084 |
$updated .= __ ( 'Option "Sort Results" Updated!', 'yop_poll' ) . $message_delimiter;
|
4087 |
// sorting_results_direction
|
4088 |
if (isset ( $input ['sorting_results_direction'] )) {
|
4089 |
if (in_array ( $input ['sorting_results_direction'], array (
|
4090 |
+
'asc',
|
4091 |
+
'desc'
|
4092 |
+
) )) {
|
4093 |
if ($default_options ['sorting_results_direction'] != trim ( $input ['sorting_results_direction'] )) {
|
4094 |
$newinput ['sorting_results_direction'] = trim ( $input ['sorting_results_direction'] );
|
4095 |
$updated .= __ ( 'Option "Sort Results Direction" Updated!', 'yop_poll' ) . $message_delimiter;
|
4128 |
$newinput ['end_date'] = '9999-12-31 23:59:59';
|
4129 |
$updated .= __ ( 'Option "Poll End Date" Updated!', 'yop_poll' ) . $message_delimiter;
|
4130 |
}
|
4131 |
+
}
|
4132 |
+
else {
|
4133 |
if (isset ( $input ['end_date'] )) {
|
4134 |
if ('' != $input ['end_date']) {
|
4135 |
if ($default_options ['end_date'] != trim ( $input ['end_date'] )) {
|
4146 |
// view_results
|
4147 |
if (isset ( $input ['view_results'] )) {
|
4148 |
if (in_array ( $input ['view_results'], array (
|
4149 |
+
'before',
|
4150 |
+
'after',
|
4151 |
+
'after-poll-end-date',
|
4152 |
+
'never',
|
4153 |
+
'custom-date'
|
4154 |
+
) )) {
|
4155 |
if ($default_options ['view_results'] != trim ( $input ['view_results'] )) {
|
4156 |
$newinput ['view_results'] = trim ( $input ['view_results'] );
|
4157 |
$updated .= __ ( 'Option "View Results" Updated!', 'yop_poll' ) . $message_delimiter;
|
4175 |
// vote_permisions
|
4176 |
if (isset ( $input ['view_results_permissions'] )) {
|
4177 |
if (in_array ( $input ['view_results_permissions'], array (
|
4178 |
+
'quest-only',
|
4179 |
+
'registered-only',
|
4180 |
+
'guest-registered'
|
4181 |
+
) )) {
|
4182 |
if ($default_options ['view_results_permissions'] != trim ( $input ['view_results_permissions'] )) {
|
4183 |
$newinput ['view_results_permissions'] = trim ( $input ['view_results_permissions'] );
|
4184 |
$updated .= __ ( 'Option "View Results Permissions" Updated!', 'yop_poll' ) . $message_delimiter;
|
4192 |
// view_results_type
|
4193 |
if (isset ( $input ['view_results_type'] )) {
|
4194 |
if (in_array ( $input ['view_results_type'], array (
|
4195 |
+
'votes-number',
|
4196 |
+
'percentages',
|
4197 |
+
'votes-number-and-percentages'
|
4198 |
+
) )) {
|
4199 |
if ($default_options ['view_results_type'] != trim ( $input ['view_results_type'] )) {
|
4200 |
$newinput ['view_results_type'] = trim ( $input ['view_results_type'] );
|
4201 |
$updated .= __ ( 'Option "View Results Type" Updated!', 'yop_poll' ) . $message_delimiter;
|
4290 |
// view_results_link
|
4291 |
if (isset ( $input ['view_results_link'] )) {
|
4292 |
if (in_array ( $input ['view_results_link'], array (
|
4293 |
+
'yes',
|
4294 |
+
'no'
|
4295 |
+
) )) {
|
4296 |
if ($default_options ['view_results_link'] != trim ( $input ['view_results_link'] )) {
|
4297 |
$newinput ['view_results_link'] = trim ( $input ['view_results_link'] );
|
4298 |
$updated .= __ ( 'Option "View Results Link" Updated!', 'yop_poll' ) . $message_delimiter;
|
4321 |
// view_back_to_vote_link
|
4322 |
if (isset ( $input ['view_back_to_vote_link'] )) {
|
4323 |
if (in_array ( $input ['view_back_to_vote_link'], array (
|
4324 |
+
'yes',
|
4325 |
+
'no'
|
4326 |
+
) )) {
|
4327 |
if ($default_options ['view_back_to_vote_link'] != trim ( $input ['view_back_to_vote_link'] )) {
|
4328 |
$newinput ['view_back_to_vote_link'] = trim ( $input ['view_back_to_vote_link'] );
|
4329 |
$updated .= __ ( 'Option "View Back To Vote Link" Updated!', 'yop_poll' ) . $message_delimiter;
|
4352 |
// view_total_votes
|
4353 |
if (isset ( $input ['view_total_votes'] )) {
|
4354 |
if (in_array ( $input ['view_total_votes'], array (
|
4355 |
+
'yes',
|
4356 |
+
'no'
|
4357 |
+
) )) {
|
4358 |
if ($default_options ['view_total_votes'] != trim ( $input ['view_total_votes'] )) {
|
4359 |
$newinput ['view_total_votes'] = trim ( $input ['view_total_votes'] );
|
4360 |
$updated .= __ ( 'Option "View Total Votes" Updated!', 'yop_poll' ) . $message_delimiter;
|
4383 |
// view_total_answers
|
4384 |
if (isset ( $input ['view_total_answers'] )) {
|
4385 |
if (in_array ( $input ['view_total_answers'], array (
|
4386 |
+
'yes',
|
4387 |
+
'no'
|
4388 |
+
) )) {
|
4389 |
if ($default_options ['view_total_answers'] != trim ( $input ['view_total_answers'] )) {
|
4390 |
$newinput ['view_total_answers'] = trim ( $input ['view_total_answers'] );
|
4391 |
$updated .= __ ( 'Option "View Total Answers" Updated!', 'yop_poll' ) . $message_delimiter;
|
4421 |
// use_default_loading_image
|
4422 |
if (isset ( $input ['use_default_loading_image'] )) {
|
4423 |
if (in_array ( $input ['use_default_loading_image'], array (
|
4424 |
+
'yes',
|
4425 |
+
'no'
|
4426 |
+
) )) {
|
4427 |
if ($default_options ['use_default_loading_image'] != trim ( $input ['use_default_loading_image'] )) {
|
4428 |
$newinput ['use_default_loading_image'] = trim ( $input ['use_default_loading_image'] );
|
4429 |
$updated .= __ ( 'Option "Use Default Loading Image" Updated!', 'yop_poll' ) . $message_delimiter;
|
4451 |
// vote_permisions
|
4452 |
if (isset ( $input ['vote_permisions'] )) {
|
4453 |
if (in_array ( $input ['vote_permisions'], array (
|
4454 |
+
'quest-only',
|
4455 |
+
'registered-only',
|
4456 |
+
'guest-registered'
|
4457 |
+
) )) {
|
4458 |
if ($default_options ['vote_permisions'] != trim ( $input ['vote_permisions'] )) {
|
4459 |
$newinput ['vote_permisions'] = trim ( $input ['vote_permisions'] );
|
4460 |
$updated .= __ ( 'Option "Vote Permissions" Updated!', 'yop_poll' ) . $message_delimiter;
|
4461 |
}
|
4462 |
|
4463 |
if (in_array ( $input ['vote_permisions'], array (
|
4464 |
+
'registered-only',
|
4465 |
+
'guest-registered'
|
4466 |
+
) )) {
|
4467 |
|
4468 |
if ( isset( $input['vote_permisions_facebook'] ) && in_array( $input['vote_permisions_facebook'], array( 'yes', 'no' ) ) ) {
|
4469 |
if ( $default_options ['vote_permisions_facebook'] != trim ( $input ['vote_permisions_facebook'] ) ) {
|
4513 |
// blocking_voters
|
4514 |
if (isset ( $input ['blocking_voters'] )) {
|
4515 |
if (in_array ( $input ['blocking_voters'], array (
|
4516 |
+
'dont-block',
|
4517 |
+
'cookie',
|
4518 |
+
'ip',
|
4519 |
+
'username',
|
4520 |
+
'cookie-ip'
|
4521 |
+
) )) {
|
4522 |
if ($default_options ['blocking_voters'] != trim ( $input ['blocking_voters'] )) {
|
4523 |
$newinput ['blocking_voters'] = trim ( $input ['blocking_voters'] );
|
4524 |
$updated .= __ ( 'Option "Blocking Voters" Updated!', 'yop_poll' ) . $message_delimiter;
|
4541 |
// blocking_voters_interval_unit
|
4542 |
if (isset ( $input ['blocking_voters_interval_unit'] )) {
|
4543 |
if (in_array ( $input ['blocking_voters_interval_unit'], array (
|
4544 |
+
'seconds',
|
4545 |
+
'minutes',
|
4546 |
+
'hours',
|
4547 |
+
'days'
|
4548 |
+
) )) {
|
4549 |
if ($default_options ['blocking_voters_interval_unit'] != trim ( $input ['blocking_voters_interval_unit'] )) {
|
4550 |
$newinput ['blocking_voters_interval_unit'] = trim ( $input ['blocking_voters_interval_unit'] );
|
4551 |
$updated .= __ ( 'Option "Blocking Voters Interval Unit" Updated!', 'yop_poll' ) . $message_delimiter;
|
4565 |
// limit_number_of_votes_per_user
|
4566 |
if (isset ( $input ['limit_number_of_votes_per_user'] )) {
|
4567 |
if (in_array ( $input ['limit_number_of_votes_per_user'], array (
|
4568 |
+
'yes',
|
4569 |
+
'no'
|
4570 |
+
) )) {
|
4571 |
if ($default_options ['limit_number_of_votes_per_user'] != trim ( $input ['limit_number_of_votes_per_user'] )) {
|
4572 |
$newinput ['limit_number_of_votes_per_user'] = trim ( $input ['limit_number_of_votes_per_user'] );
|
4573 |
$updated .= __ ( 'Option "Limit Number of Votes per User" Updated!', 'yop_poll' ) . $message_delimiter;
|
4608 |
// redirect_after_vote
|
4609 |
if (isset ( $input ['redirect_after_vote'] )) {
|
4610 |
if (in_array ( $input ['redirect_after_vote'], array (
|
4611 |
+
'yes',
|
4612 |
+
'no'
|
4613 |
+
) )) {
|
4614 |
if ($default_options ['redirect_after_vote'] != trim ( $input ['redirect_after_vote'] )) {
|
4615 |
$newinput ['redirect_after_vote'] = trim ( $input ['redirect_after_vote'] );
|
4616 |
$updated .= __ ( 'Option "Redirect After Vote" Updated!', 'yop_poll' ) . $message_delimiter;
|
4647 |
// view_poll_archive_link
|
4648 |
if (isset ( $input ['view_poll_archive_link'] )) {
|
4649 |
if (in_array ( $input ['view_poll_archive_link'], array (
|
4650 |
+
'yes',
|
4651 |
+
'no'
|
4652 |
+
) )) {
|
4653 |
if ($default_options ['view_poll_archive_link'] != trim ( $input ['view_poll_archive_link'] )) {
|
4654 |
$newinput ['view_poll_archive_link'] = trim ( $input ['view_poll_archive_link'] );
|
4655 |
$updated .= __ ( 'Option "View Poll Archive Link" Updated!', 'yop_poll' ) . $message_delimiter;
|
4690 |
// show_in_archive
|
4691 |
if (isset ( $input ['show_in_archive'] )) {
|
4692 |
if (in_array ( $input ['show_in_archive'], array (
|
4693 |
+
'yes',
|
4694 |
+
'no'
|
4695 |
+
) )) {
|
4696 |
if ($default_options ['show_in_archive'] != trim ( $input ['show_in_archive'] )) {
|
4697 |
$newinput ['show_in_archive'] = trim ( $input ['show_in_archive'] );
|
4698 |
$updated .= __ ( 'Option "Show Poll in Arhive" Updated!', 'yop_poll' ) . $message_delimiter;
|
4721 |
// send_email_notifications
|
4722 |
if (isset ( $input ['send_email_notifications'] )) {
|
4723 |
if (in_array ( $input ['send_email_notifications'], array (
|
4724 |
+
'yes',
|
4725 |
+
'no'
|
4726 |
+
) )) {
|
4727 |
if ($default_options ['send_email_notifications'] != trim ( $input ['send_email_notifications'] )) {
|
4728 |
$newinput ['send_email_notifications'] = trim ( $input ['send_email_notifications'] );
|
4729 |
$updated .= __ ( 'Option "Send Email Notifications" Updated!', 'yop_poll' ) . $message_delimiter;
|
4817 |
//share after vote
|
4818 |
if ( isset ( $input ['share_after_vote'] ) ) {
|
4819 |
if (in_array ( $input ['share_after_vote'], array (
|
4820 |
+
'yes',
|
4821 |
+
'no'
|
4822 |
+
) )) {
|
4823 |
if ($default_options ['share_after_vote'] != trim ( $input ['share_after_vote'] )) {
|
4824 |
$newinput ['share_after_vote'] = trim ( $input ['share_after_vote'] );
|
4825 |
$updated .= __ ( 'Option "Share After Vote" Updated!', 'yop_poll' ) . $message_delimiter;
|
4865 |
//start_scheduler
|
4866 |
if ( isset ( $input ['start_scheduler'] ) ) {
|
4867 |
if (in_array ( $input ['start_scheduler'], array (
|
4868 |
+
'yes',
|
4869 |
+
'no'
|
4870 |
+
) )) {
|
4871 |
if ($default_options ['start_scheduler'] != trim ( $input ['start_scheduler'] )) {
|
4872 |
$newinput ['start_scheduler'] = trim ( $input ['start_scheduler'] );
|
4873 |
$updated .= __ ( 'Option "Start Scheduler" Updated!', 'yop_poll' ) . $message_delimiter;
|
5004 |
<?php _e( 'Max Number of allowed answers', 'yop_poll' ); ?>:
|
5005 |
</th>
|
5006 |
<td><input id="yop-poll-allow-multiple-answers-number"
|
5007 |
+
type="text"
|
5008 |
+
name="yop_poll_options[allow_multiple_answers_number]"
|
5009 |
+
value="<?php echo $default_options['allow_multiple_answers_number']; ?>" />
|
5010 |
</td>
|
5011 |
</tr>
|
5012 |
<tr class="yop_poll_suboption" id="yop-poll-allow-multiple-answers-div1" style="<?php echo $default_options['allow_multiple_answers'] == 'no' ? 'display: none;' : ''; ?>">
|
5014 |
<?php _e( 'Min Number of allowed answers', 'yop_poll' ); ?>:
|
5015 |
</th>
|
5016 |
<td><input id="yop-poll-allow-multiple-answers-min-number"
|
5017 |
+
type="text"
|
5018 |
+
name="yop_poll_options[allow_multiple_answers_min_number]"
|
5019 |
+
value="<?php echo $default_options['allow_multiple_answers_min_number']; ?>" />
|
5020 |
</td>
|
5021 |
</tr>
|
5022 |
</tbody>
|
5074 |
<?php _e( 'Columns', 'yop_poll' ); ?>:
|
5075 |
</th>
|
5076 |
<td><input id="yop-poll-display-answers-tabulated-cols"
|
5077 |
+
type="text"
|
5078 |
+
name="yop_poll_options[display_answers_tabulated_cols]"
|
5079 |
+
value="<?php echo $default_options['display_answers_tabulated_cols']; ?>" />
|
5080 |
</td>
|
5081 |
</tr>
|
5082 |
<tr>
|
5105 |
<?php _e( 'Columns', 'yop_poll' ); ?>:
|
5106 |
</th>
|
5107 |
<td><input id="yop-poll-display-results-tabulated-cols"
|
5108 |
+
type="text"
|
5109 |
+
name="yop_poll_options[display_results_tabulated_cols]"
|
5110 |
+
value="<?php echo $default_options['display_results_tabulated_cols']; ?>" />
|
5111 |
</td>
|
5112 |
</tr>
|
5113 |
<tr>
|
5115 |
<?php _e( 'Poll Template Width', 'yop_poll' ); ?>:
|
5116 |
</th>
|
5117 |
<td><input id="yop-poll-template-width"
|
5118 |
+
type="text"
|
5119 |
+
name="yop_poll_options[template_width]"
|
5120 |
+
value="<?php echo $default_options['template_width']; ?>" />
|
5121 |
</td>
|
5122 |
</tr>
|
5123 |
<tr>
|
5125 |
<?php _e( 'Widget Template Width', 'yop_poll' ); ?>:
|
5126 |
</th>
|
5127 |
<td><input id="yop-poll-widget-template-width"
|
5128 |
+
type="text"
|
5129 |
+
name="yop_poll_options[widget_template_width]"
|
5130 |
+
value="<?php echo $default_options['widget_template_width']; ?>" />
|
5131 |
</td>
|
5132 |
</tr>
|
5133 |
</tbody>
|
5163 |
<th><label for="yop-poll-bar-background"><?php _e ( 'Background Color', 'yop_poll' ); ?></label>
|
5164 |
</th>
|
5165 |
<td>#<input class="yop-small-input"
|
5166 |
+
id="yop-poll-bar-background"
|
5167 |
+
value="<?php echo $default_options['bar_background']; ?>"
|
5168 |
+
onblur="yop_poll_update_bar_style('#yop-poll-bar-preview', 'background-color', '#' + this.value)"
|
5169 |
+
type="text" name="yop_poll_options[bar_background]" />
|
5170 |
</td>
|
5171 |
</tr>
|
5172 |
<tr class="yop-poll-custom-result-bar-table yop_poll_suboption" style="<?php echo $default_options['use_template_bar'] == 'yes' ? 'display: none;' : ''; ?>">
|
5173 |
<th><label for="yop-poll-bar-height"><?php _e ( 'Height', 'yop_poll' ); ?></label>
|
5174 |
</th>
|
5175 |
<td><input class="yop-small-input" id="yop-poll-bar-height"
|
5176 |
+
value="<?php echo $default_options['bar_height']; ?>"
|
5177 |
+
onblur="yop_poll_update_bar_style('#yop-poll-bar-preview', 'height', this.value + 'px')"
|
5178 |
+
type="text" name="yop_poll_options[bar_height]" /> px</td>
|
5179 |
</tr>
|
5180 |
<tr class="yop-poll-custom-result-bar-table yop_poll_suboption" style="<?php echo $default_options['use_template_bar'] == 'yes' ? 'display: none;' : ''; ?>">
|
5181 |
<th><label for="yop-poll-bar-border-color"><?php _e ( 'Border Color', 'yop_poll' ) ?></label>
|
5182 |
</th>
|
5183 |
<td>#<input class="yop-small-input"
|
5184 |
+
id="yop-poll-bar-border-color"
|
5185 |
+
value="<?php echo $default_options['bar_border_color']; ?>"
|
5186 |
+
onblur="yop_poll_update_bar_style( '#yop-poll-bar-preview', 'border-color', '#' + this.value )"
|
5187 |
+
type="text" name="yop_poll_options[bar_border_color]" />
|
5188 |
</td>
|
5189 |
</tr>
|
5190 |
<tr class="yop-poll-custom-result-bar-table yop_poll_suboption" style="<?php echo $default_options['use_template_bar'] == 'yes' ? 'display: none;' : ''; ?>">
|
5191 |
<th><label for="yop-poll-bar-border-width"><?php _e ( 'Border Width', 'yop_poll' ); ?></label>
|
5192 |
</th>
|
5193 |
<td><input class="yop-small-input"
|
5194 |
+
id="yop-poll-bar-border-width"
|
5195 |
+
value="<?php echo $default_options['bar_border_width']; ?>"
|
5196 |
+
onblur="yop_poll_update_bar_style('#yop-poll-bar-preview', 'border-width', this.value + 'px')"
|
5197 |
+
type="text" name="yop_poll_options[bar_border_width]" /> px
|
5198 |
</td>
|
5199 |
</tr>
|
5200 |
<tr class="yop-poll-custom-result-bar-table yop_poll_suboption" style="<?php echo $default_options['use_template_bar'] == 'yes' ? 'display: none;' : ''; ?>">
|
5343 |
<th><label for="yop-poll-start-date-input"><?php _e( 'Start Date', 'yop_poll' ); ?>:</label><br><font size="0">(<?php _e('Current Server Time', 'yop_poll'); echo ': ' . current_time( 'mysql' ); ?>)</font>
|
5344 |
</th>
|
5345 |
<td><input id="yop-poll-start-date-input" type="text"
|
5346 |
+
name="yop_poll_options[start_date]"
|
5347 |
+
value="<?php echo '' == $default_options['start_date'] ? current_time('mysql') : $default_options['start_date']; ?>" />
|
5348 |
</td>
|
5349 |
</tr>
|
5350 |
<tr>
|
5486 |
<?php _e( 'Vote Button Label', 'yop_poll' ); ?>:
|
5487 |
</th>
|
5488 |
<td><input id="yop-poll-vote-button-label" type="text"
|
5489 |
+
name="yop_poll_options[vote_button_label]"
|
5490 |
+
value="<?php echo esc_html( stripslashes( $default_options['vote_button_label'] ) ); ?>" />
|
5491 |
</td>
|
5492 |
</tr>
|
5493 |
<tr>
|
5509 |
<?php _e( 'View Results Link Label', 'yop_poll' ); ?>:
|
5510 |
</th>
|
5511 |
<td><input id="yop-poll-view-results-link-label" type="text"
|
5512 |
+
name="yop_poll_options[view_results_link_label]"
|
5513 |
+
value="<?php echo esc_html( stripslashes( $default_options['view_results_link_label'] ) ); ?>" />
|
5514 |
</td>
|
5515 |
</tr>
|
5516 |
<tr>
|
5532 |
<?php _e( 'View Back To Vote Link Label', 'yop_poll' ); ?>:
|
5533 |
</th>
|
5534 |
<td><input id="yop-poll-view-back-to-vote-link-label"
|
5535 |
+
type="text"
|
5536 |
+
name="yop_poll_options[view_back_to_vote_link_label]"
|
5537 |
+
value="<?php echo esc_html( stripslashes( $default_options['view_back_to_vote_link_label'] ) ); ?>" />
|
5538 |
</td>
|
5539 |
</tr>
|
5540 |
<tr>
|
5556 |
<?php _e( 'View Total Votes Label', 'yop_poll' ); ?>:
|
5557 |
</th>
|
5558 |
<td><input id="yop-poll-view-total-votes-label" type="text"
|
5559 |
+
name="yop_poll_options[view_total_votes_label]"
|
5560 |
+
value="<?php echo esc_html( stripslashes( $default_options['view_total_votes_label'] ) ); ?>" />
|
5561 |
</td>
|
5562 |
</tr>
|
5563 |
<tr>
|
5579 |
<?php _e( 'View Total Answers Label', 'yop_poll' ); ?>:
|
5580 |
</th>
|
5581 |
<td><input id="yop-poll-view-total-answers-label" type="text"
|
5582 |
+
name="yop_poll_options[view_total_answers_label]"
|
5583 |
+
value="<?php echo esc_html( stripslashes( $default_options['view_total_answers_label'] ) ); ?>" />
|
5584 |
</td>
|
5585 |
</tr>
|
5586 |
<tr>
|
5588 |
<?php _e( 'Message After Vote', 'yop_poll' ); ?>:
|
5589 |
</th>
|
5590 |
<td><input id="yop-poll-message-after-vote" type="text"
|
5591 |
+
name="yop_poll_options[message_after_vote]"
|
5592 |
+
value="<?php echo esc_html( stripslashes( $default_options['message_after_vote'] ) ); ?>" />
|
5593 |
</td>
|
5594 |
</tr>
|
5595 |
<tr>
|
5596 |
<th><label for="yop-poll-page-url"><?php _e( 'Poll Page Url ', 'yop_poll' ); ?>:</label>
|
5597 |
</th>
|
5598 |
<td><input id="yop-poll-page-url" type="text"
|
5599 |
+
name="yop_poll_options[poll_page_url]"
|
5600 |
+
value="<?php echo esc_html( stripslashes( $default_options['poll_page_url'] ) ); ?>" />
|
5601 |
</td>
|
5602 |
</tr>
|
5603 |
</tbody>
|
5659 |
<?php _e( '"Vote as Facebook User" Button Label', 'yop_poll' ); ?>:
|
5660 |
</th>
|
5661 |
<td><input id="yop-poll-vote-permisions-facebook-label" type="text"
|
5662 |
+
name="yop_poll_options[vote_permisions_facebook_label]"
|
5663 |
+
value="<?php echo esc_html( stripslashes( $default_options['vote_permisions_facebook_label'] ) ); ?>" />
|
5664 |
</td>
|
5665 |
</tr>
|
5666 |
<?php } ?>
|
5684 |
<?php _e( '"Vote as Wordpress User" Button Label', 'yop_poll' ); ?>:
|
5685 |
</th>
|
5686 |
<td><input id="yop-poll-vote-permisions-wordpress-label" type="text"
|
5687 |
+
name="yop_poll_options[vote_permisions_wordpress_label]"
|
5688 |
+
value="<?php echo esc_html( stripslashes( $default_options['vote_permisions_wordpress_label'] ) ); ?>" />
|
5689 |
</td>
|
5690 |
</tr>
|
5691 |
|
5708 |
<?php _e( '"Vote as Anonymous User" Button Label', 'yop_poll' ); ?>:
|
5709 |
</th>
|
5710 |
<td><input id="yop-poll-vote-permisions-anonymous-label" type="text"
|
5711 |
+
name="yop_poll_options[vote_permisions_anonymous_label]"
|
5712 |
+
value="<?php echo esc_html( stripslashes( $default_options['vote_permisions_anonymous_label'] ) ); ?>" />
|
5713 |
</td>
|
5714 |
</tr>
|
5715 |
|
5787 |
<?php _e( 'Number of Votes per User', 'yop_poll' ); ?>:
|
5788 |
</th>
|
5789 |
<td><input id="yop-poll-number-of-votes-per-user" type="text"
|
5790 |
+
name="yop_poll_options[number_of_votes_per_user]"
|
5791 |
+
value="<?php echo esc_html( stripslashes( $default_options['number_of_votes_per_user'] ) ); ?>" />
|
5792 |
</td>
|
5793 |
</tr>
|
5794 |
<tr>
|
5796 |
<?php _e( 'Percentages Decimals', 'yop_poll' ); ?>:
|
5797 |
</th>
|
5798 |
<td><input id="yop-poll-percentages-decimals" type="text"
|
5799 |
+
name="yop_poll_options[percentages_decimals]"
|
5800 |
+
value="<?php echo esc_html( stripslashes( $default_options['percentages_decimals'] ) ); ?>" />
|
5801 |
</td>
|
5802 |
</tr>
|
5803 |
<tr>
|
5821 |
<?php _e( 'Loading Image Url', 'yop_poll' ); ?>:
|
5822 |
</th>
|
5823 |
<td><input id="yop-poll-loading-image-url" type="text"
|
5824 |
+
name="yop_poll_options[loading_image_url]"
|
5825 |
+
value="<?php echo esc_html( stripslashes( $default_options['loading_image_url'] ) ); ?>" />
|
5826 |
</td>
|
5827 |
</tr>
|
5828 |
|
5847 |
<?php _e( 'Redirect After Vote Url', 'yop_poll' ); ?>:
|
5848 |
</th>
|
5849 |
<td><input id="yop-poll-redirect-after-vote-url" type="text"
|
5850 |
+
name="yop_poll_options[redirect_after_vote_url]"
|
5851 |
+
value="<?php echo esc_html( stripslashes( $default_options['redirect_after_vote_url'] ) ); ?>" />
|
5852 |
</td>
|
5853 |
</tr>
|
5854 |
<tr>
|
5856 |
<?php _e( 'Poll Date Format', 'yop_poll' ); ?>: <br /><font size="0"><?php _e('Check', 'yop_popll') ?> <a target="_blank" href="http://codex.wordpress.org/Formatting_Date_and_Time"> <?php _e('documentation', 'yop_popll') ?></a></font>
|
5857 |
</th>
|
5858 |
<td><input id="yop-poll-date-format" type="text"
|
5859 |
+
name="yop_poll_options[date_format]"
|
5860 |
+
value="<?php echo esc_html( stripslashes( $default_options['date_format'] ) ); ?>" />
|
5861 |
</td>
|
5862 |
</tr>
|
5863 |
</tbody>
|
5895 |
<?php _e( 'View Poll Archive Link Label', 'yop_poll' ); ?>:
|
5896 |
</th>
|
5897 |
<td><input id="yop-poll-view-poll-archive-link-label"
|
5898 |
+
type="text"
|
5899 |
+
name="yop_poll_options[view_poll_archive_link_label]"
|
5900 |
+
value="<?php echo esc_html( stripslashes( $default_options['view_poll_archive_link_label'] ) ); ?>" />
|
5901 |
</td>
|
5902 |
</tr>
|
5903 |
<tr id="yop-poll-view-poll-archive-link-div" style="<?php echo 'yes' != $default_options['view_poll_archive_link'] ? 'display: none;' : ''; ?>">
|
5905 |
<?php _e( 'Poll Archive Url', 'yop_poll' ); ?>:
|
5906 |
</th>
|
5907 |
<td><input id="yop-poll-poll-archive-url" type="text"
|
5908 |
+
name="yop_poll_options[poll_archive_url]"
|
5909 |
+
value="<?php echo esc_html( stripslashes( $default_options['poll_archive_url'] ) ); ?>" />
|
5910 |
</td>
|
5911 |
</tr>
|
5912 |
<tr>
|
5928 |
<?php _e( 'Archive Order', 'yop_poll' ); ?>:
|
5929 |
</th>
|
5930 |
<td><input id="yop-poll-show-in-archive-order" type="text"
|
5931 |
+
name="yop_poll_options[archive_order]"
|
5932 |
+
value="<?php echo $default_options['archive_order']; ?>" />
|
5933 |
</td>
|
5934 |
</tr>
|
5935 |
<tr>
|
5937 |
<?php _e( 'Archive Polls Per Page', 'yop_poll' ); ?>:
|
5938 |
</th>
|
5939 |
<td><input id="yop-poll-archive-polls-per-page" type="text"
|
5940 |
+
name="yop_poll_options[archive_polls_per_page]"
|
5941 |
+
value="<?php echo $default_options['archive_polls_per_page']; ?>" />
|
5942 |
</td>
|
5943 |
</tr>
|
5944 |
|
6064 |
<?php _e( 'Share Name', 'yop_poll' ); ?>:
|
6065 |
</th>
|
6066 |
<td><input id="yop-poll-share-name"
|
6067 |
+
type="text"
|
6068 |
+
name="yop_poll_options[share_name]"
|
6069 |
+
value="<?php echo esc_html( stripslashes( $default_options['share_name'] ) ); ?>" />
|
6070 |
</td>
|
6071 |
</tr>
|
6072 |
<tr class="yop_poll_suboption" id="yop-poll-share-after-vote-caption-tr" style="<?php echo 'yes' != $default_options['share_after_vote'] ? 'display: none;' : ''; ?>">
|
6074 |
<?php _e( 'Share Caption', 'yop_poll' ); ?>:
|
6075 |
</th>
|
6076 |
<td><input id="yop-poll-share-caption"
|
6077 |
+
type="text"
|
6078 |
+
name="yop_poll_options[share_caption]"
|
6079 |
+
value="<?php echo esc_html( stripslashes( $default_options['share_caption'] ) ); ?>" />
|
6080 |
</td>
|
6081 |
</tr>
|
6082 |
<tr class="yop_poll_suboption" id="yop-poll-share-after-vote-description-tr" style="<?php echo 'yes' != $default_options['share_after_vote'] ? 'display: none;' : ''; ?>">
|
6084 |
<?php _e( 'Share Description', 'yop_poll' ); ?>:
|
6085 |
</th>
|
6086 |
<td><input id="yop-poll-share-description"
|
6087 |
+
type="text"
|
6088 |
+
name="yop_poll_options[share_description]"
|
6089 |
+
value="<?php echo esc_html( stripslashes( $default_options['share_description'] ) ); ?>" />
|
6090 |
</td>
|
6091 |
</tr>
|
6092 |
<tr class="yop_poll_suboption" id="yop-poll-share-after-vote-picture-tr" style="<?php echo 'yes' != $default_options['share_after_vote'] ? 'display: none;' : ''; ?>">
|
6094 |
<?php _e( 'Share Picture', 'yop_poll' ); ?>:
|
6095 |
</th>
|
6096 |
<td><input id="yop-poll-share-picture"
|
6097 |
+
type="text"
|
6098 |
+
name="yop_poll_options[share_picture]"
|
6099 |
+
value="<?php echo esc_html( stripslashes( $default_options['share_picture'] ) ); ?>" />
|
6100 |
</td>
|
6101 |
</tr>
|
6102 |
|
6158 |
$yop_poll_model = new Yop_Poll_Model ( $poll_id );
|
6159 |
$answers = Yop_Poll_Model::get_poll_answers ( $poll_id );
|
6160 |
$other_answer = Yop_Poll_Model::get_poll_answers ( $poll_id, array (
|
6161 |
+
'other'
|
6162 |
+
) );
|
6163 |
$custom_fields = Yop_Poll_Model::get_poll_customfields ( $poll_id );
|
6164 |
$page_name = __ ( 'Edit Poll', 'yop_poll' );
|
6165 |
$action_type = 'edit';
|
6187 |
id="yop-poll-edit-add-new-form">
|
6188 |
<?php wp_nonce_field( 'yop-poll-edit-add-new' ); ?>
|
6189 |
<span <?php if ( 'edit' != $action ) { ?> style="display: none;"
|
6190 |
+
<?php } ?>> Shortcode: <input id="yop_poll_shortcode" type="text"
|
6191 |
+
value='[yop_poll id="<?php echo $current_poll['id']; ?>"]'
|
6192 |
+
readonly="readonly">
|
6193 |
</span>
|
6194 |
<div id="poststuff">
|
6195 |
<div id="post-body" class="metabox-holder columns-2">
|
6233 |
<tr class="yop_poll_tr_answer"
|
6234 |
id="yop_poll_tr_answer<?php echo $answer_id ?>">
|
6235 |
<th scope="row"><label class="yop_poll_answer_label"
|
6236 |
+
for="yop-poll-answer<?php echo $answer_id ?>"><?php echo $yop_poll_add_new_config['text_answer']; ?> <?php echo $answer_id ?></label></th>
|
6237 |
<td><input type="hidden"
|
6238 |
value="<?php echo isset( $answers[ $answer_id - 1 ]['id'] )? $answers[ $answer_id - 1 ]['id'] : ''; ?>"
|
6239 |
name="yop_poll_answer_ids[answer<?php echo $answer_id ?>]" />
|
6323 |
<tbody>
|
6324 |
<tr>
|
6325 |
<th><label
|
6326 |
+
for="yop-poll-answer-option-bar-background-answer<?php echo $answer_id ?>"><?php echo $yop_poll_add_new_config['text_poll_bar_style']['poll_bar_style_background_label']; ?></label>
|
6327 |
</th>
|
6328 |
<td>#<input
|
6329 |
+
id="yop-poll-answer-option-bar-background-answer<?php echo $answer_id ?>"
|
6330 |
+
value="<?php echo isset ( $answer_options[0]['bar_background'] ) ? $answer_options[0]['bar_background'] : $default_options['bar_background']; ?>"
|
6331 |
+
onblur="yop_poll_update_bar_style('#yop-poll-bar-preview<?php echo $answer_id ?>', 'background-color', '#' + this.value)"
|
6332 |
+
type="text"
|
6333 |
+
name="yop_poll_answer_options[answer<?php echo $answer_id ?>][bar_background]" />
|
6334 |
</td>
|
6335 |
</tr>
|
6336 |
<tr>
|
6337 |
<th><label
|
6338 |
+
for="yop-poll-answer-option-bar-height-answer<?php echo $answer_id ?>"><?php echo $yop_poll_add_new_config['text_poll_bar_style']['poll_bar_style_height_label']; ?></label>
|
6339 |
</th>
|
6340 |
<td><input
|
6341 |
id="yop-poll-answer-option-bar-height-answer<?php echo $answer_id ?>"
|
6347 |
</tr>
|
6348 |
<tr>
|
6349 |
<th><label
|
6350 |
+
for="yop-poll-answer-option-bar-border-color-answer<?php echo $answer_id ?>"><?php echo $yop_poll_add_new_config['text_poll_bar_style']['poll_bar_style_border_color_label']; ?></label>
|
6351 |
</th>
|
6352 |
<td>#<input
|
6353 |
+
id="yop-poll-answer-option-bar-border-color-answer<?php echo $answer_id ?>"
|
6354 |
+
value="<?php echo isset ( $answer_options[0]['bar_border_color'] ) ? $answer_options[0]['bar_border_color'] : $default_options['bar_border_color']; ?>"
|
6355 |
+
onblur="yop_poll_update_bar_style( '#yop-poll-bar-preview<?php echo $answer_id ?>', 'border-color', '#' + this.value )"
|
6356 |
+
type="text"
|
6357 |
+
name="yop_poll_answer_options[answer<?php echo $answer_id ?>][bar_border_color]" />
|
6358 |
</td>
|
6359 |
</tr>
|
6360 |
<tr>
|
6361 |
<th><label
|
6362 |
+
for="yop-poll-answer-option-bar-border-width-answer<?php echo $answer_id ?>"><?php echo $yop_poll_add_new_config['text_poll_bar_style']['poll_bar_style_border_width_label']; ?></label>
|
6363 |
</th>
|
6364 |
<td><input
|
6365 |
id="yop-poll-answer-option-bar-border-width-answer<?php echo $answer_id ?>"
|
6371 |
</tr>
|
6372 |
<tr>
|
6373 |
<th><label
|
6374 |
+
for="yop-poll-answer-option-bar_border-style-answer<?php echo $answer_id ?>"><?php echo $yop_poll_add_new_config['text_poll_bar_style']['poll_bar_style_border_style_label']; ?></label>
|
6375 |
</th>
|
6376 |
<td><select
|
6377 |
id="yop-poll-answer-option-bar_border-style-answer<?php echo $answer_id ?>"
|
6491 |
</tr>
|
6492 |
<tr class="yop_poll_suboption" id="yop-poll-is-default-other-answers-values-div" style="<?php echo 'no' == $default_options['allow_other_answers'] ? 'display: none;' : ''; ?>">
|
6493 |
<th>
|
6494 |
+
<?php _e( 'Make "Other answer" default answer ', 'yop_poll' ); ?>:<br>
|
6495 |
+
<font size="0"><?php _e('"Other Answer" will be autoselected', 'yop_poll' ); ?></font>
|
6496 |
</th>
|
6497 |
<td><label for="yop-poll-is-default-other-answers-no"><input
|
6498 |
id="yop-poll-is-default-other-answers-no"
|
6525 |
<?php _e( 'Number of allowed answers', 'yop_poll' ); ?>:
|
6526 |
</th>
|
6527 |
<td><input id="yop-poll-allow-multiple-answers-number"
|
6528 |
+
type="text"
|
6529 |
+
name="yop_poll_options[allow_multiple_answers_number]"
|
6530 |
+
value="<?php echo $default_options['allow_multiple_answers_number']; ?>" />
|
6531 |
</td>
|
6532 |
</tr>
|
6533 |
<tr class="yop_poll_suboption" id="yop-poll-allow-multiple-answers-div1" style="<?php echo $default_options['allow_multiple_answers'] == 'no' ? 'display: none;' : ''; ?>">
|
6535 |
<?php _e( 'Min Number of allowed answers', 'yop_poll' ); ?>:
|
6536 |
</th>
|
6537 |
<td><input id="yop-poll-allow-multiple-answers-min-number"
|
6538 |
+
type="text"
|
6539 |
+
name="yop_poll_options[allow_multiple_answers_min_number]"
|
6540 |
+
value="<?php echo $default_options['allow_multiple_answers_min_number']; ?>" />
|
6541 |
</td>
|
6542 |
</tr>
|
6543 |
<tr>
|
6566 |
<?php _e( 'Columns', 'yop_poll' ); ?>:
|
6567 |
</th>
|
6568 |
<td><input id="yop-poll-display-answers-tabulated-cols"
|
6569 |
+
type="text"
|
6570 |
+
name="yop_poll_options[display_answers_tabulated_cols]"
|
6571 |
+
value="<?php echo $default_options['display_answers_tabulated_cols']; ?>" />
|
6572 |
</td>
|
6573 |
</tr>
|
6574 |
<tr>
|
6597 |
<?php _e( 'Columns', 'yop_poll' ); ?>:
|
6598 |
</th>
|
6599 |
<td><input id="yop-poll-display-results-tabulated-cols"
|
6600 |
+
type="text"
|
6601 |
+
name="yop_poll_options[display_results_tabulated_cols]"
|
6602 |
+
value="<?php echo $default_options['display_results_tabulated_cols']; ?>" />
|
6603 |
</td>
|
6604 |
</tr>
|
6605 |
<tr>
|
6621 |
<th><label for="yop-poll-bar-background"><?php echo $yop_poll_add_new_config['text_poll_bar_style']['poll_bar_style_background_label']; ?></label>
|
6622 |
</th>
|
6623 |
<td>#<input class="yop-small-input"
|
6624 |
+
id="yop-poll-bar-background"
|
6625 |
+
value="<?php echo $default_options['bar_background']; ?>"
|
6626 |
+
onblur="yop_poll_update_bar_style('#yop-poll-bar-preview', 'background-color', '#' + this.value)"
|
6627 |
+
type="text" name="yop_poll_options[bar_background]" />
|
6628 |
</td>
|
6629 |
</tr>
|
6630 |
<tr class="yop-poll-custom-result-bar-table yop_poll_suboption" style="<?php echo $default_options['use_template_bar'] == 'yes' ? 'display: none;' : ''; ?>">
|
6631 |
<th><label for="yop-poll-bar-height"><?php echo $yop_poll_add_new_config['text_poll_bar_style']['poll_bar_style_height_label']; ?></label>
|
6632 |
</th>
|
6633 |
<td><input class="yop-small-input" id="yop-poll-bar-height"
|
6634 |
+
value="<?php echo $default_options['bar_height']; ?>"
|
6635 |
+
onblur="yop_poll_update_bar_style('#yop-poll-bar-preview', 'height', this.value + 'px')"
|
6636 |
+
type="text" name="yop_poll_options[bar_height]" /> px</td>
|
6637 |
</tr>
|
6638 |
<tr class="yop-poll-custom-result-bar-table yop_poll_suboption" style="<?php echo $default_options['use_template_bar'] == 'yes' ? 'display: none;' : ''; ?>">
|
6639 |
<th><label for="yop-poll-bar-border-color"><?php echo $yop_poll_add_new_config['text_poll_bar_style']['poll_bar_style_border_color_label']; ?></label>
|
6640 |
</th>
|
6641 |
<td>#<input class="yop-small-input"
|
6642 |
+
id="yop-poll-bar-border-color"
|
6643 |
+
value="<?php echo $default_options['bar_border_color']; ?>"
|
6644 |
+
onblur="yop_poll_update_bar_style( '#yop-poll-bar-preview', 'border-color', '#' + this.value )"
|
6645 |
+
type="text" name="yop_poll_options[bar_border_color]" />
|
6646 |
</td>
|
6647 |
</tr>
|
6648 |
<tr class="yop-poll-custom-result-bar-table yop_poll_suboption" style="<?php echo $default_options['use_template_bar'] == 'yes' ? 'display: none;' : ''; ?>">
|
6649 |
<th><label for="yop-poll-bar-border-width"><?php echo $yop_poll_add_new_config['text_poll_bar_style']['poll_bar_style_border_width_label']; ?></label>
|
6650 |
</th>
|
6651 |
<td><input class="yop-small-input"
|
6652 |
+
id="yop-poll-bar-border-width"
|
6653 |
+
value="<?php echo $default_options['bar_border_width']; ?>"
|
6654 |
+
onblur="yop_poll_update_bar_style('#yop-poll-bar-preview', 'border-width', this.value + 'px')"
|
6655 |
+
type="text" name="yop_poll_options[bar_border_width]" /> px</td>
|
6656 |
</tr>
|
6657 |
<tr class="yop-poll-custom-result-bar-table yop_poll_suboption" style="<?php echo $default_options['use_template_bar'] == 'yes' ? 'display: none;' : ''; ?>">
|
6658 |
<th><label for="yop-poll-bar-border-style"><?php echo $yop_poll_add_new_config['text_poll_bar_style']['poll_bar_style_border_style_label']; ?></label>
|
6788 |
<tr class="yop_poll_tr_customfields"
|
6789 |
id="yop_poll_tr_customfield<?php echo $custom_field_id; ?>">
|
6790 |
<th scope="row"><label class="yop_poll_customfield_label"
|
6791 |
+
for="yop_poll_customfield<?php echo $custom_field_id; ?>"><?php echo $yop_poll_add_new_config['text_customfield'] ?> <?php echo $custom_field_id ?></label>
|
6792 |
</th>
|
6793 |
<td><input type="hidden"
|
6794 |
value="<?php echo isset( $custom_fields[ $custom_field_id - 1 ]['id'] )? $custom_fields[ $custom_field_id - 1 ]['id'] : ''; ?>"
|
6806 |
for="yop-poll-customfield-required-<?php echo $custom_field_id ?>"><?php echo $yop_poll_add_new_config['text_requiered_customfield'] ?></label>
|
6807 |
</td>
|
6808 |
<td align="right"><input
|
6809 |
+
onclick="yop_poll_remove_customfield( '#yop-poll-customfields-table', <?php echo $custom_field_id ?> ); return false;"
|
6810 |
+
type="button"
|
6811 |
+
value="<?php echo $yop_poll_add_new_config['text_remove_customfield']; ?>"
|
6812 |
+
class="button" /></td>
|
6813 |
</tr>
|
6814 |
<?php
|
6815 |
}
|
6837 |
<th><label for="yop-poll-start-date-input"><?php _e( 'Start Date', 'yop_poll' ); ?>:</label><br><font size="0">(<?php _e('Current Server Time', 'yop_poll'); echo ': ' . current_time( 'mysql' ); ?>)</font>
|
6838 |
</th>
|
6839 |
<td><input id="yop-poll-start-date-input" type="text"
|
6840 |
+
name="yop_poll_options[start_date]"
|
6841 |
+
value="<?php echo '' == $default_options['start_date'] ? current_time('mysql') : $default_options['start_date']; ?>" />
|
6842 |
</td>
|
6843 |
</tr>
|
6844 |
<tr>
|
6980 |
<?php _e( 'Vote Button Label', 'yop_poll' ); ?>:
|
6981 |
</th>
|
6982 |
<td><input id="yop-poll-vote-button-label" type="text"
|
6983 |
+
name="yop_poll_options[vote_button_label]"
|
6984 |
+
value="<?php echo esc_html( stripslashes( $default_options['vote_button_label'] ) ); ?>" />
|
6985 |
</td>
|
6986 |
</tr>
|
6987 |
<tr>
|
7003 |
<?php _e( 'View Results Link Label', 'yop_poll' ); ?>:
|
7004 |
</th>
|
7005 |
<td><input id="yop-poll-view-results-link-label" type="text"
|
7006 |
+
name="yop_poll_options[view_results_link_label]"
|
7007 |
+
value="<?php echo esc_html( stripslashes( $default_options['view_results_link_label'] ) ); ?>" />
|
7008 |
</td>
|
7009 |
</tr>
|
7010 |
<tr>
|
7026 |
<?php _e( 'View Back To Vote Link Label', 'yop_poll' ); ?>:
|
7027 |
</th>
|
7028 |
<td><input id="yop-poll-view-back-to-vote-link-label"
|
7029 |
+
type="text"
|
7030 |
+
name="yop_poll_options[view_back_to_vote_link_label]"
|
7031 |
+
value="<?php echo esc_html( stripslashes( $default_options['view_back_to_vote_link_label'] ) ); ?>" />
|
7032 |
</td>
|
7033 |
</tr>
|
7034 |
<tr>
|
7050 |
<?php _e( 'View Total Votes Label', 'yop_poll' ); ?>:
|
7051 |
</th>
|
7052 |
<td><input id="yop-poll-view-total-votes-label" type="text"
|
7053 |
+
name="yop_poll_options[view_total_votes_label]"
|
7054 |
+
value="<?php echo esc_html( stripslashes( $default_options['view_total_votes_label'] ) ); ?>" />
|
7055 |
</td>
|
7056 |
</tr>
|
7057 |
<tr>
|
7073 |
<?php _e( 'View Total Answers Label', 'yop_poll' ); ?>:
|
7074 |
</th>
|
7075 |
<td><input id="yop-poll-view-total-answers-label" type="text"
|
7076 |
+
name="yop_poll_options[view_total_answers_label]"
|
7077 |
+
value="<?php echo esc_html( stripslashes( $default_options['view_total_answers_label'] ) ); ?>" />
|
7078 |
</td>
|
7079 |
</tr>
|
7080 |
<tr>
|
7082 |
<?php _e( 'Message After Vote', 'yop_poll' ); ?>:
|
7083 |
</th>
|
7084 |
<td><input id="yop-poll-message-after-vote" type="text"
|
7085 |
+
name="yop_poll_options[message_after_vote]"
|
7086 |
+
value="<?php echo esc_html( stripslashes( $default_options['message_after_vote'] ) ); ?>" />
|
7087 |
</td>
|
7088 |
</tr>
|
7089 |
<?php if( 'no' == $default_options['has_auto_generate_poll_page'] ) { ?>
|
7108 |
<th><label for="yop-poll-page-url"><?php _e( 'Poll Page Url ', 'yop_poll' ); ?>:</label>
|
7109 |
</th>
|
7110 |
<td><input id="yop-poll-page-url" type="text"
|
7111 |
+
name="yop_poll_options[poll_page_url]"
|
7112 |
+
value="<?php echo esc_html( stripslashes( $default_options['poll_page_url'] ) ); ?>" />
|
7113 |
</td>
|
7114 |
</tr>
|
7115 |
</tbody>
|
7185 |
<?php _e( '"Vote as Facebook User" Button Label', 'yop_poll' ); ?>:
|
7186 |
</th>
|
7187 |
<td><input id="yop-poll-vote-permisions-facebook-label" type="text"
|
7188 |
+
name="yop_poll_options[vote_permisions_facebook_label]"
|
7189 |
+
value="<?php echo esc_html( stripslashes( $default_options['vote_permisions_facebook_label'] ) ); ?>" />
|
7190 |
</td>
|
7191 |
</tr>
|
7192 |
<?php } ?>
|
7210 |
<?php _e( '"Vote as Wordpress User" Button Label', 'yop_poll' ); ?>:
|
7211 |
</th>
|
7212 |
<td><input id="yop-poll-vote-permisions-wordpress-label" type="text"
|
7213 |
+
name="yop_poll_options[vote_permisions_wordpress_label]"
|
7214 |
+
value="<?php echo esc_html( stripslashes( $default_options['vote_permisions_wordpress_label'] ) ); ?>" />
|
7215 |
</td>
|
7216 |
</tr>
|
7217 |
|
7234 |
<?php _e( '"Vote as Anonymous User" Button Label', 'yop_poll' ); ?>:
|
7235 |
</th>
|
7236 |
<td><input id="yop-poll-vote-permisions-anonymous-label" type="text"
|
7237 |
+
name="yop_poll_options[vote_permisions_anonymous_label]"
|
7238 |
+
value="<?php echo esc_html( stripslashes( $default_options['vote_permisions_anonymous_label'] ) ); ?>" />
|
7239 |
</td>
|
7240 |
</tr>
|
7241 |
|
7313 |
<?php _e( 'Number of Votes per User', 'yop_poll' ); ?>:
|
7314 |
</th>
|
7315 |
<td><input id="yop-poll-number-of-votes-per-user" type="text"
|
7316 |
+
name="yop_poll_options[number_of_votes_per_user]"
|
7317 |
+
value="<?php echo esc_html( stripslashes( $default_options['number_of_votes_per_user'] ) ); ?>" />
|
7318 |
</td>
|
7319 |
</tr>
|
7320 |
<tr>
|
7324 |
$templates = YOP_POLL_MODEL::get_yop_poll_templates_search ( 'id', 'asc' );
|
7325 |
?>
|
7326 |
<select class="yop-poll-template" id="yop-poll-template"
|
7327 |
+
name="yop_poll_options[template]"
|
7328 |
+
onchange="yop_poll_return_template_preview(jQuery(this).val(), '#yop_poll_preview_page_template', 1);">
|
7329 |
<option value=""><?php _e( '--SELECT Template--', 'yop_poll' ); ?></option>
|
7330 |
<?php
|
7331 |
if (count ( $templates ) > 0) {
|
7339 |
}
|
7340 |
?>
|
7341 |
</select>
|
7342 |
+
<div id="yop_poll_preview_page_template" style="position: relative; float: right;">
|
7343 |
+
<?php
|
7344 |
+
if( ($default_options['template']) )
|
7345 |
+
print(Yop_Poll_Model::return_template_preview_html( $default_options['template'], 1 ));
|
7346 |
+
?>
|
7347 |
+
</div>
|
7348 |
</td>
|
7349 |
</tr>
|
7350 |
<tr class="yop_poll_suboption">
|
7352 |
<?php _e( 'Poll Template Width', 'yop_poll' ); ?>:
|
7353 |
</th>
|
7354 |
<td><input id="yop-poll-template-width"
|
7355 |
+
type="text"
|
7356 |
+
name="yop_poll_options[template_width]"
|
7357 |
+
style="width: 50%;"
|
7358 |
+
value="<?php echo $default_options['template_width']; ?>" />
|
7359 |
</td>
|
7360 |
</tr>
|
7361 |
<tr>
|
7365 |
$templates = YOP_POLL_MODEL::get_yop_poll_templates_search ( 'id', 'asc' );
|
7366 |
?>
|
7367 |
<select class="yop-poll-widget-template" id="yop-poll-widget-template"
|
7368 |
+
name="yop_poll_options[widget_template]"
|
7369 |
+
onchange="yop_poll_return_template_preview(jQuery(this).val(), '#yop_poll_preview_widget_template', 2);">
|
7370 |
<option value=""><?php _e( '--SELECT Template--', 'yop_poll' ); ?></option>
|
7371 |
<?php
|
7372 |
if (count ( $templates ) > 0) {
|
7380 |
}
|
7381 |
?>
|
7382 |
</select>
|
7383 |
+
<div id="yop_poll_preview_widget_template" style="position: relative; float: right;">
|
7384 |
+
<?php
|
7385 |
+
if( ($default_options['widget_template']) )
|
7386 |
+
print(Yop_Poll_Model::return_template_preview_html( $default_options['widget_template'], 2 ));
|
7387 |
+
?>
|
7388 |
+
</div>
|
7389 |
</td>
|
7390 |
</tr>
|
7391 |
<tr class="yop_poll_suboption">
|
7393 |
<?php _e( 'Widget Template Width', 'yop_poll' ); ?>:
|
7394 |
</th>
|
7395 |
<td><input id="yop-poll-widget-template-width"
|
7396 |
+
type="text"
|
7397 |
+
name="yop_poll_options[widget_template_width]"
|
7398 |
+
style="width: 50%;"
|
7399 |
+
value="<?php echo $default_options['widget_template_width']; ?>" />
|
7400 |
</td>
|
7401 |
</tr>
|
7402 |
<tr>
|
7404 |
<?php _e( 'Percentages Decimals', 'yop_poll' ); ?>:
|
7405 |
</th>
|
7406 |
<td><input id="yop-poll-percentages-decimals" type="text"
|
7407 |
+
name="yop_poll_options[percentages_decimals]"
|
7408 |
+
value="<?php echo esc_html( stripslashes( $default_options['percentages_decimals'] ) ); ?>" />
|
7409 |
</td>
|
7410 |
</tr>
|
7411 |
<tr>
|
7429 |
<?php _e( 'Loading Image Url', 'yop_poll' ); ?>:
|
7430 |
</th>
|
7431 |
<td><input id="yop-poll-loading-image-url" type="text"
|
7432 |
+
name="yop_poll_options[loading_image_url]"
|
7433 |
+
value="<?php echo esc_html( stripslashes( $default_options['loading_image_url'] ) ); ?>" />
|
7434 |
</td>
|
7435 |
</tr>
|
7436 |
|
7455 |
<?php _e( 'Redirect After Vote Url', 'yop_poll' ); ?>:
|
7456 |
</th>
|
7457 |
<td><input id="yop-poll-redirect-after-vote-url" type="text"
|
7458 |
+
name="yop_poll_options[redirect_after_vote_url]"
|
7459 |
+
value="<?php echo esc_html( stripslashes( $default_options['redirect_after_vote_url'] ) ); ?>" />
|
7460 |
</td>
|
7461 |
</tr>
|
7462 |
|
7481 |
<?php _e( 'Reset Stats Date', 'yop_poll' ); ?>:<br><font size="0">(<?php _e('Current Server Time', 'yop_poll'); echo ': ' . current_time( 'mysql' ); ?>)</font>
|
7482 |
</th>
|
7483 |
<td><input id="yop-poll-schedule-reset-poll-stats-date" type="text"
|
7484 |
+
name="yop_poll_options[schedule_reset_poll_date]"
|
7485 |
+
value="<?php echo date( 'Y-m-d H:i:s', $default_options['schedule_reset_poll_date'] ); ?>" />
|
7486 |
</td>
|
7487 |
</tr>
|
7488 |
<tr class="yop-poll-schedule-reset-poll-stats-options-div yop_poll_suboption" style="<?php echo 'no' == $default_options['schedule_reset_poll_stats'] ? 'display: none;' : ''; ?>">
|
7503 |
<?php _e( 'Poll Date Format', 'yop_poll' ); ?>: <br /><font size="0"><?php _e('Check', 'yop_popll') ?> <a target="_blank" href="http://codex.wordpress.org/Formatting_Date_and_Time"> <?php _e('documentation', 'yop_popll') ?></a></font>
|
7504 |
</th>
|
7505 |
<td><input id="yop-poll-date-format" type="text"
|
7506 |
+
name="yop_poll_options[date_format]"
|
7507 |
+
value="<?php echo esc_html( stripslashes( $default_options['date_format'] ) ); ?>" />
|
7508 |
</td>
|
7509 |
</tr>
|
7510 |
</tbody>
|
7542 |
<?php _e( 'View Poll Archive Link Label', 'yop_poll' ); ?>:
|
7543 |
</th>
|
7544 |
<td><input id="yop-poll-view-poll-archive-link-label"
|
7545 |
+
type="text"
|
7546 |
+
name="yop_poll_options[view_poll_archive_link_label]"
|
7547 |
+
value="<?php echo esc_html( stripslashes( $default_options['view_poll_archive_link_label'] ) ); ?>" />
|
7548 |
</td>
|
7549 |
</tr>
|
7550 |
<tr id="yop-poll-view-poll-archive-link-div" style="<?php echo 'yes' != $default_options['view_poll_archive_link'] ? 'display: none;' : ''; ?>">
|
7552 |
<?php _e( 'Poll Archive Url', 'yop_poll' ); ?>:
|
7553 |
</th>
|
7554 |
<td><input id="yop-poll-poll-archive-url" type="text"
|
7555 |
+
name="yop_poll_options[poll_archive_url]"
|
7556 |
+
value="<?php echo esc_html( stripslashes( $default_options['poll_archive_url'] ) ); ?>" />
|
7557 |
</td>
|
7558 |
</tr>
|
7559 |
<tr>
|
7575 |
<?php _e( 'Archive Order', 'yop_poll' ); ?>:
|
7576 |
</th>
|
7577 |
<td><input id="yop-poll-show-in-archive-order" type="text"
|
7578 |
+
name="yop_poll_options[archive_order]"
|
7579 |
+
value="<?php echo esc_html( stripslashes( $default_options['archive_order'] ) ); ?>" />
|
7580 |
</td>
|
7581 |
</tr>
|
7582 |
|
7700 |
<?php _e( 'Share Name', 'yop_poll' ); ?>:
|
7701 |
</th>
|
7702 |
<td><input id="yop-poll-share-name"
|
7703 |
+
type="text"
|
7704 |
+
name="yop_poll_options[share_name]"
|
7705 |
+
value="<?php echo esc_html( stripslashes( $default_options['share_name'] ) ); ?>" />
|
7706 |
</td>
|
7707 |
</tr>
|
7708 |
<tr class="yop_poll_suboption" id="yop-poll-share-after-vote-caption-tr" style="<?php echo 'yes' != $default_options['share_after_vote'] ? 'display: none;' : ''; ?>">
|
7710 |
<?php _e( 'Share Caption', 'yop_poll' ); ?>:
|
7711 |
</th>
|
7712 |
<td><input id="yop-poll-share-caption"
|
7713 |
+
type="text"
|
7714 |
+
name="yop_poll_options[share_caption]"
|
7715 |
+
value="<?php echo esc_html( stripslashes( $default_options['share_caption'] ) ); ?>" />
|
7716 |
</td>
|
7717 |
</tr>
|
7718 |
<tr class="yop_poll_suboption" id="yop-poll-share-after-vote-description-tr" style="<?php echo 'yes' != $default_options['share_after_vote'] ? 'display: none;' : ''; ?>">
|
7720 |
<?php _e( 'Share Description', 'yop_poll' ); ?>:
|
7721 |
</th>
|
7722 |
<td><input id="yop-poll-share-description"
|
7723 |
+
type="text"
|
7724 |
+
name="yop_poll_options[share_description]"
|
7725 |
+
value="<?php echo esc_html( stripslashes( $default_options['share_description'] ) ); ?>" />
|
7726 |
</td>
|
7727 |
</tr>
|
7728 |
<tr class="yop_poll_suboption" id="yop-poll-share-after-vote-picture-tr" style="<?php echo 'yes' != $default_options['share_after_vote'] ? 'display: none;' : ''; ?>">
|
7730 |
<?php _e( 'Share Picture', 'yop_poll' ); ?>:
|
7731 |
</th>
|
7732 |
<td><input id="yop-poll-share-picture"
|
7733 |
+
type="text"
|
7734 |
+
name="yop_poll_options[share_picture]"
|
7735 |
+
value="<?php echo esc_html( stripslashes( $default_options['share_picture'] ) ); ?>" />
|
7736 |
</td>
|
7737 |
</tr>
|
7738 |
|
8042 |
/**
|
8043 |
* End Views section
|
8044 |
*/
|
8045 |
+
|
8046 |
/**
|
8047 |
* Start Ajax section
|
8048 |
*/
|
8172 |
}
|
8173 |
}
|
8174 |
print '[ajax-response]' . json_encode ( array (
|
8175 |
+
'error' => $error,
|
8176 |
+
'success' => $success,
|
8177 |
+
'message' => $message
|
8178 |
+
) ) . '[/ajax-response]';
|
8179 |
die ();
|
8180 |
}
|
8181 |
public function yop_poll_view_results() {
|
8205 |
}
|
8206 |
}
|
8207 |
print '[ajax-response]' . json_encode ( array (
|
8208 |
+
'error' => $error,
|
8209 |
+
'success' => $success,
|
8210 |
+
'message' => $message
|
8211 |
+
) ) . '[/ajax-response]';
|
8212 |
die ();
|
8213 |
}
|
8214 |
public function yop_poll_back_to_vote() {
|
8237 |
}
|
8238 |
}
|
8239 |
print '[ajax-response]' . json_encode ( array (
|
8240 |
+
'error' => $error,
|
8241 |
+
'success' => $success,
|
8242 |
+
'message' => $message
|
8243 |
+
) ) . '[/ajax-response]';
|
8244 |
die ();
|
8245 |
}
|
8246 |
public function yop_poll_load_css() {
|
8261 |
}
|
8262 |
die ();
|
8263 |
}
|
8264 |
+
public function yop_poll_load_js() {
|
8265 |
header ( 'Content-Type: text/javascript' );
|
8266 |
// check_ajax_referer('yop-poll-public-js');
|
8267 |
if (is_admin ()) {
|
8268 |
$poll_id = isset ( $_REQUEST ['id'] ) ? $_REQUEST ['id'] : NULL;
|
8269 |
$location = isset ( $_REQUEST ['location'] ) ? $_REQUEST ['location'] : NULL;
|
8270 |
$unique_id = isset ( $_REQUEST ['unique_id'] ) ? $_REQUEST ['unique_id'] : NULL;
|
8271 |
+
if ($poll_id) {
|
8272 |
+
require_once ($this->_config->plugin_inc_dir . '/yop_poll_model.php');
|
8273 |
$yop_poll_model = new YOP_POLL_MODEL ( $poll_id );
|
8274 |
$yop_poll_model->set_unique_id( $unique_id );
|
8275 |
+
$poll_js = $yop_poll_model->return_poll_js ( array( 'location' => $location ) );
|
8276 |
+
print $poll_js;
|
8277 |
unset ( $yop_poll_model );
|
8278 |
}
|
8279 |
}
|
8281 |
}
|
8282 |
public function ajax_get_polls_for_editor() {
|
8283 |
check_ajax_referer ( 'yop-poll-editor' );
|
8284 |
+
if ( is_admin () ) {
|
8285 |
require_once ($this->_config->plugin_inc_dir . '/yop_poll_model.php');
|
8286 |
$yop_polls = Yop_Poll_Model::get_yop_polls_filter_search ( 'id', 'asc' );
|
8287 |
?>
|
8337 |
|
8338 |
|
8339 |
<center> <input type="button" class="button-primary"
|
8340 |
+
value="<?php _e( 'Insert Poll', 'yop_poll' ); ?>"
|
8341 |
+
onclick=" insertYopPollTinyMce( document.getElementById('yop-poll-id-dialog').value, document.getElementById('yop-poll-tr-id-dialog').value );" /></center>
|
8342 |
<br />
|
8343 |
<center> <input type="button" class="button-primary"
|
8344 |
+
value="<?php _e( 'Close', 'yop_poll' ); ?>"
|
8345 |
+
onclick="tinyMCEPopup.close();" /></center>
|
8346 |
</p>
|
8347 |
</body>
|
8348 |
</html>
|
8350 |
}
|
8351 |
die ();
|
8352 |
}
|
8353 |
+
public function ajax_preview_template() {
|
8354 |
+
if( true/*check_ajax_referer( 'yop-poll-edit-add-new' )*/ ) {
|
8355 |
+
if( is_admin() ) {
|
8356 |
+
$template_id = trim( $_POST['template_id'] );
|
8357 |
+
$loc = trim( $_POST['loc'] );
|
8358 |
+
require_once( $this->_config->plugin_inc_dir . '/yop_poll_model.php' );
|
8359 |
+
$yop_poll_model = new Yop_Poll_Model();
|
8360 |
+
$template = $yop_poll_model->return_template_preview_html( $template_id, $loc );
|
8361 |
+
print $template;
|
8362 |
+
unset( $yop_poll_model );
|
8363 |
+
}
|
8364 |
+
}
|
8365 |
+
die();
|
8366 |
+
}
|
8367 |
public function ajax_get_polls_for_html_editor() {
|
8368 |
check_ajax_referer ( 'yop-poll-html-editor' );
|
8369 |
if (is_admin ()) {
|
8583 |
if ( 'yes' == $according_to_logs ) {
|
8584 |
if ( 'yes' == $change_to_all ) {
|
8585 |
$poll_answers = YOP_POLL_MODEL::get_poll_answers ( $answer_details['poll_id'], array (
|
8586 |
+
'default',
|
8587 |
+
'other'
|
8588 |
+
) );
|
8589 |
if ( count( $poll_answers) > 0 )
|
8590 |
foreach( $poll_answers as $answer ) {
|
8591 |
Yop_Poll_Model::update_answer_field( $answer['id'], array( 'name' => 'votes', 'value' => YOP_POLL_MODEL::get_answer_votes_from_logs( $answer['id'] ), 'type' => '%d' ) );
|
9008 |
|
9009 |
if (get_user_option ( 'rich_editing' ) == 'true') {
|
9010 |
add_filter ( 'mce_external_plugins', array (
|
9011 |
+
&$this,
|
9012 |
+
'add_plugin'
|
9013 |
+
) );
|
9014 |
add_filter ( 'mce_buttons', array (
|
9015 |
+
&$this,
|
9016 |
+
'register_button'
|
9017 |
+
) );
|
9018 |
}
|
9019 |
}
|
9020 |
}
|
9043 |
<br /> <b><?php _e( 'Short on funds?', 'yop_poll' ); ?></b>
|
9044 |
<ul id="donate_ul">
|
9045 |
<li><a target="_blank"
|
9046 |
+
href="http://wordpress.org/extend/plugins/yop-poll/"><b><?php _e( 'Rate YOP POLL 5★\'s on WordPress.org', 'yop_poll' ); ?></b></a>
|
9047 |
</li>
|
9048 |
<li><b><?php _e( 'Talk about it on your site and link back to the', 'yop_poll' ); ?></b>
|
9049 |
<a target="_blank"
|
9050 |
href="http://wordpress.org/extend/plugins/yop-poll/"><b><?php _e( 'plugin page', 'yop_poll' ); ?>.</b></a>
|
9051 |
</li>
|
9052 |
<li><a target="_blank"
|
9053 |
+
href="http://twitter.com/home?status=I+use+YOP+POLL+for+WordPress+and+you+should+too+-+http%3A%2F%2Fwordpress.org%2Fextend%2Fplugins%2Fyop-poll%2F"><b><?php _e( 'Tweet about it', 'yop_poll' ); ?>.</b></a>
|
9054 |
</li>
|
9055 |
</ul>
|
9056 |
</div>
|
9065 |
</h3>
|
9066 |
<div class="inside">
|
9067 |
<b><?php _e( 'If you need help getting this plugin or have found a bug please visit the ', 'yop_poll' ); ?><a
|
9068 |
+
href="http://wordpress.org/support/plugin/yop-poll" target="_blank"><?php _e( 'support forums', 'yop_poll' ); ?></a>!</b>
|
9069 |
</div>
|
9070 |
</div>
|
9071 |
|
9885 |
$optin_box_modal_options = get_option ( 'yop_poll_optin_box_modal_options' );
|
9886 |
if ($optin_box_modal_options ['show'] == 'yes') {
|
9887 |
wp_enqueue_script ( 'yop-poll-modal-box-js', "{$this->_config->plugin_url}/modal/js/jquery.modalbox-1.5.0-min.js", array (
|
9888 |
+
'jquery'
|
9889 |
), $this->_config->version, true );
|
9890 |
wp_enqueue_script ( 'yop-poll-modal-functions', "{$this->_config->plugin_url}/js/yop-poll-modal-functions.js", array (
|
9891 |
+
'jquery',
|
9892 |
+
'yop-poll-modal-box-js'
|
9893 |
), $this->_config->version, true );
|
9894 |
$yop_poll_modal_functions_config = array (
|
9895 |
'ajax' => array (
|
9901 |
wp_enqueue_style ( 'yop-poll-modal-box-css', "{$this->_config->plugin_url}/modal/css/jquery.modalbox-basic.css", array (), $this->_config->version );
|
9902 |
} elseif ($optin_box_modal_options ['sidebar_had_submit'] == 'no') {
|
9903 |
wp_enqueue_script ( 'yop-poll-sidebar-option-functions', "{$this->_config->plugin_url}/js/yop-poll-sidebar-optin-functions.js", array (
|
9904 |
+
'jquery'
|
9905 |
), $this->_config->version, true );
|
9906 |
$yop_poll_sidebar_functions_config = array (
|
9907 |
'ajax' => array (
|
9970 |
if (isset ( $_GET ['yop_poll_do_not_bug'] )) {
|
9971 |
if ('yes' == $_GET ['yop_poll_do_not_bug']) {
|
9972 |
wp_redirect ( remove_query_arg ( array (
|
9973 |
+
'yop_poll_do_not_bug',
|
9974 |
+
'_wpnonce',
|
9975 |
+
'yop_poll_tell_followers',
|
9976 |
+
'yop_poll_rate_plugin',
|
9977 |
+
'yop_poll_support_plugin'
|
9978 |
+
), stripslashes ( $_SERVER ['REQUEST_URI'] ) ), '302' );
|
9979 |
}
|
9980 |
}
|
9981 |
}
|
inc/db_schema.php
CHANGED
@@ -1,613 +1,751 @@
|
|
1 |
<?php
|
2 |
class Yop_Poll_DbSchema
|
3 |
{
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
}
|
43 |
-
|
44 |
-
$default_options = array(
|
45 |
-
'poll_name_html_tags' => 'yes',
|
46 |
-
'poll_question_html_tags' => 'yes',
|
47 |
-
'poll_answer_html_tags' => 'yes',
|
48 |
-
'poll_custom_field_html_tags' => 'yes',
|
49 |
-
'create_poll_page' => 'yes',
|
50 |
-
'auto_generate_poll_page' => 'no',
|
51 |
-
'has_auto_generate_poll_page' => 'no',
|
52 |
-
'poll_page_url' => '',
|
53 |
-
'allow_other_answers' => 'yes',
|
54 |
-
'other_answers_label' => 'Other',
|
55 |
-
'display_other_answers_values' => 'no',
|
56 |
-
'allow_multiple_answers' => 'no',
|
57 |
-
'allow_multiple_answers_number' => 1,
|
58 |
-
'allow_multiple_answers_min_number' => 1,
|
59 |
-
'display_answers' => 'vertical',
|
60 |
-
'display_answers_tabulated_cols' => 1,
|
61 |
-
'display_results' => 'vertical',
|
62 |
-
'display_results_tabulated_cols' => 1,
|
63 |
-
'is_default_answer' => 'no',
|
64 |
-
'use_template_bar' => 'yes',
|
65 |
-
'bar_background' => 'FBD55E',
|
66 |
-
'bar_height' => 10,
|
67 |
-
'bar_border_color' => 'EDB918',
|
68 |
-
'bar_border_width' => 1,
|
69 |
-
'bar_border_style' => 'solid',
|
70 |
-
'sorting_answers' => 'exact',
|
71 |
-
'sorting_answers_direction' => 'asc',
|
72 |
-
'sorting_results' => 'exact',
|
73 |
-
'sorting_results_direction' => 'asc',
|
74 |
-
'start_date' => Yop_Poll_Model::get_mysql_curent_date(),
|
75 |
-
'end_date' => '9999-12-31 23:59:59',
|
76 |
-
'never_expire' => 'yes',
|
77 |
-
'view_results' => 'after',
|
78 |
-
'answer_result_label' => '- %POLL-ANSWER-RESULT-PERCENTAGES% ( %POLL-ANSWER-RESULT-VOTES% )',
|
79 |
-
'view_results_type' => 'votes-number',
|
80 |
-
'view_results_start_date' => '',
|
81 |
-
'view_results_link' => 'yes',
|
82 |
-
'view_back_to_vote_link' => 'yes',
|
83 |
-
'singular_answer_result_votes_number_label' => 'vote',
|
84 |
-
'plural_answer_result_votes_number_label' => 'votes',
|
85 |
-
'vote_button_label' => 'Vote',
|
86 |
-
'view_results_link_label' => 'View Results',
|
87 |
-
'view_back_to_vote_link_label' => 'Back To Vote',
|
88 |
-
'view_total_votes_label' => 'Total Votes %POLL-TOTAL-VOTES%',
|
89 |
-
'view_total_answers_label' => 'Total Answers %POLL-TOTAL-ANSWERS%',
|
90 |
-
'view_total_voters_label' => 'Total Answers %POLL-TOTAL-VOTERS%',
|
91 |
-
'view_total_answers' => 'yes',
|
92 |
-
'view_total_voters' => 'yes',
|
93 |
-
'view_total_votes' => 'yes',
|
94 |
-
'view_poll_archive_link' => 'yes',
|
95 |
-
'view_poll_archive_link_label' => 'View Poll Archive',
|
96 |
-
'poll_archive_url' => home_url().'/yop-poll-archive',
|
97 |
-
'vote_permisions' => 'guest-registered',
|
98 |
-
'vote_permisions_facebook' => 'no',
|
99 |
-
'vote_permisions_facebook_label' => 'Vote as Facebook User',
|
100 |
-
'vote_permisions_wordpress' => 'no',
|
101 |
-
'vote_permisions_wordpress_label' => 'Vote as Wordpress User',
|
102 |
-
'vote_permisions_anonymous' => 'no',
|
103 |
-
'vote_permisions_anonymous_label' => 'Vote as Anonymous User',
|
104 |
-
'blocking_voters' => 'dont-block',
|
105 |
-
'blocking_voters_interval_value' => 30,
|
106 |
-
'blocking_voters_interval_unit' => 'days',
|
107 |
-
'template' => '1',
|
108 |
-
'widget_template' => '1',
|
109 |
-
'template_width' => '200px',
|
110 |
-
'widget_template_width' => '200px',
|
111 |
-
'show_in_archive' => 'yes',
|
112 |
-
'archive_order' => '1',
|
113 |
-
'archive_polls_per_page' => '5',
|
114 |
-
'percentages_decimals' => '0',
|
115 |
-
'use_default_loading_image' => 'yes',
|
116 |
-
'loading_image_url' => '',
|
117 |
-
'use_captcha' => 'no',
|
118 |
-
'share_after_vote' => 'no',
|
119 |
-
'share_picture' => '',
|
120 |
-
'share_name' => '',
|
121 |
-
'share_caption' => '',
|
122 |
-
'share_description' => '',
|
123 |
-
'redirect_after_vote' => 'no',
|
124 |
-
'redirect_after_vote_url' => '',
|
125 |
-
'limit_number_of_votes_per_user' => 'no',
|
126 |
-
'number_of_votes_per_user' => 1,
|
127 |
-
'message_after_vote' => 'Thank you for your vote!',
|
128 |
-
'start_scheduler' => 'no',
|
129 |
-
'schedule_reset_poll_stats' => 'no',
|
130 |
-
'schedule_reset_poll_date' => current_time( 'timestamp' ),
|
131 |
-
'schedule_reset_poll_recurring_value' => 9999,
|
132 |
-
'schedule_reset_poll_recurring_unit' => 'day',
|
133 |
-
'view_results_permissions' => 'guest-registered',
|
134 |
-
'date_format' => 'd/m/Y H:i:s',
|
135 |
-
'add_other_answers_to_default_answers' => 'no',
|
136 |
-
'send_email_notifications' => 'no',
|
137 |
-
'email_notifications_from_name' => 'Yop Poll',
|
138 |
-
'email_notifications_from_email' => 'yop-poll@' . $sitename,
|
139 |
-
'email_notifications_recipients' => '',
|
140 |
-
'email_notifications_subject' => 'New Vote',
|
141 |
-
'email_notifications_body' => '<p>A new vote was registered on [VOTE_DATE] for [POLL_NAME]</p>
|
142 |
-
<p>Vote Details:</p>
|
143 |
-
<p><b>Question:</b> [QUESTION]</p>
|
144 |
-
<p><b>Answers:</b> <br />[ANSWERS]</p>
|
145 |
-
<p><b>Custom Fields:</b> <br />[CUSTOM_FIELDS]</p>
|
146 |
-
<p><b>Vote ID:</b> <br />[VOTE_ID]</p>',
|
147 |
-
);
|
148 |
-
|
149 |
-
if ( ! get_option( "yop_poll_version" ) ) {
|
150 |
-
|
151 |
-
$poll_archive_page = get_page_by_path('yop-poll-archive', ARRAY_A );
|
152 |
-
if ( ! $poll_archive_page ) {
|
153 |
-
$_p = array();
|
154 |
-
$_p['post_title'] = 'Yop Poll Archive';
|
155 |
-
$_p['post_content'] = "[yop_poll_archive]";
|
156 |
-
$_p['post_status'] = 'publish';
|
157 |
-
$_p['post_type'] = 'page';
|
158 |
-
$_p['comment_status'] = 'open';
|
159 |
-
$_p['ping_status'] = 'open';
|
160 |
-
$_p['post_category'] = array(1); // the default 'Uncategorised'
|
161 |
-
|
162 |
-
$poll_archive_page_id = wp_insert_post( $_p );
|
163 |
-
|
164 |
-
}
|
165 |
-
else {
|
166 |
-
$poll_archive_page_id = $poll_archive_page['ID'];
|
167 |
-
}
|
168 |
-
|
169 |
-
$default_options['poll_archive_url'] = get_permalink( $poll_archive_page_id );
|
170 |
-
|
171 |
-
//addind default options
|
172 |
-
update_option( 'yop_poll_options', $default_options );
|
173 |
-
update_option( 'yop_poll_optin_box_modal_options', $optin_box_modal_options );
|
174 |
-
update_option( 'yop_poll_pro_options', $pro_options );
|
175 |
-
|
176 |
-
wp_get_current_user();
|
177 |
-
//adding default poll
|
178 |
-
$poll_author = $current_user->ID > 0 ? $current_user->ID : 0;
|
179 |
-
$wpdb->query(
|
180 |
-
"
|
181 |
-
INSERT INTO `". $wpdb->yop_polls . "` (`poll_author`, `name`, `question`, `start_date`, `end_date`, `total_votes`, `total_answers`, `status`, `date_added`, `last_modified`, `show_in_archive`) VALUES
|
182 |
-
(". $poll_author .", 'Default Yop Poll', 'How is my plugin?', '".current_time( 'mysql' )."', '9999-12-31 23:59:59', 0, 0, 'open', '".current_time( 'mysql' )."', '".current_time( 'mysql' )."', '".$default_options['show_in_archive']."')
|
183 |
-
"
|
184 |
-
);
|
185 |
-
$poll_id = $wpdb->insert_id;
|
186 |
-
$wpdb->query(
|
187 |
-
"
|
188 |
-
INSERT INTO `". $wpdb->yop_poll_answers . "` (`poll_id`, `answer`, `type`, `votes`, `status`) VALUES
|
189 |
-
(" . $poll_id . ", 'Good', 'default', 0, 'active'),
|
190 |
-
(" . $poll_id . ", 'Very Good', 'default', 0, 'active'),
|
191 |
-
(" . $poll_id . ", 'Bad', 'default', 0, 'active'),
|
192 |
-
(" . $poll_id . ", 'Other', 'other', 0, 'active')
|
193 |
-
"
|
194 |
-
);
|
195 |
-
|
196 |
-
$templates = array( 'White', 'Grey', 'Dark', 'Blue v1', 'Blue v2', 'Blue v3', 'Red v1', 'Red v2', 'Red v3', 'Green v1', 'Green v2', 'Green v3', 'Orange v1', 'Orange v2', 'Orange v3' );
|
197 |
-
foreach( $templates as $template ) {
|
198 |
-
$is_template_in_database = self::is_template_in_database( $template );
|
199 |
-
if ( $is_template_in_database )
|
200 |
-
self::add_update_templates_in_database( 'update', $template );
|
201 |
-
else
|
202 |
-
self::add_update_templates_in_database( 'add', $template );
|
203 |
-
}
|
204 |
-
|
205 |
-
update_option( "yop_poll_first_install_date", Yop_Poll_Model::get_mysql_curent_date() );
|
206 |
-
update_option( "yop_poll_admin_notices_donate", 'yes' );
|
207 |
-
}
|
208 |
-
|
209 |
-
update_option( "yop_poll_version", $wpdb->yop_poll_version );
|
210 |
}
|
211 |
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
|
218 |
-
public static function add_update_templates_in_database( $action = 'add', $template_name ) {
|
219 |
-
global $wpdb;
|
220 |
-
global $current_user;
|
221 |
-
wp_get_current_user();
|
222 |
-
if ( 'add' == $action ) {
|
223 |
-
$sql = "INSERT INTO `" . $wpdb->yop_poll_templates . "` SET ";
|
224 |
-
$sql .= $wpdb ->prepare( "`name` = %s, ", $template_name );
|
225 |
-
$sql .= $wpdb ->prepare( "`template_author` = %d, ", ( $current_user->ID > 0 ) ? $current_user->ID : 0 );
|
226 |
-
}
|
227 |
-
else
|
228 |
-
$sql = "UPDATE `" . $wpdb->yop_poll_templates . "` SET ";
|
229 |
-
switch ( $template_name ) {
|
230 |
-
case 'White': //White
|
231 |
-
$sql .= "`before_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-ANSWER-CHECK-INPUT% \r\n %POLL-ANSWER-LABEL%\r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_CONTAINER]\r\n [OTHER_ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-OTHER-ANSWER-CHECK-INPUT% \r\n %POLL-OTHER-ANSWER-LABEL% \r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-OTHER-ANSWER-TEXT-INPUT% \r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/OTHER_ANSWER_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-custom-%POLL-ID%\\".'"'.">\r\n <ul>\r\n [CUSTOM_FIELD_CONTAINER]\r\n <li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>\r\n [/CUSTOM_FIELD_CONTAINER]\r\n </ul>\r\n</div> \r\n[CAPTCHA_CONTAINER]\r\n<div id=\"yop-poll-captcha-%POLL-ID%\">\r\n <div class=\"yop-poll-captcha-image-div\" id=\"yop-poll-captcha-image-div-%POLL-ID%\">\r\n %CAPTCHA-IMAGE%\r\n <div class=\"yop-poll-captcha-helpers-div\" id=\"yop-poll-captcha-helpers-div-%POLL-ID%\">%RELOAD-CAPTCHA-IMAGE%</div>\r\n <div class=\"yop_poll_clear\"></div>\r\n </div>\r\n %CAPTCHA-LABEL%\r\n <div class=\"yop-poll-captcha-input-div\" id=\"yop-poll-captcha-input-div-%POLL-ID%\">%CAPTCHA-INPUT%</div>\r\n</div>\r\n[/CAPTCHA_CONTAINER]\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-VOTE-BUTTON%</div>\r\n <div id=\\".'"'."yop-poll-results-%POLL-ID%\\".'"'.">%POLL-VIEW-RESULT-LINK%</div>\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n</div>',
|
232 |
-
`after_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per-%POLL-ID%\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <div>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </div>\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n <div id=\\".'"'."yop-poll-back-%POLL-ID%\\".'"'.">%POLL-BACK-TO-VOTE-LINK%</div>\r\n</div>',
|
233 |
-
`before_start_date_template` = 'This poll is about to <br>\r\nstart at %POLL-START-DATE%<br>\r\nand finish at %POLL-END-DATE%<br>',
|
234 |
-
`after_end_date_template` = 'This poll is closed!\r\nPoll activity: <br>\r\nstart_date %POLL-START-DATE%<br>\r\nend_date %POLL-END-DATE%<br>\r\n\r\nPoll Results:\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-1\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <span class=\\".'"'."pds-clear\\".'"'." style=\\".'"'."display: block;clear: both;height:1px;line-height:1px;\\".'"'."> </span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n%POLL-VOTE-BUTTON%',
|
235 |
-
`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#fff;\r\n padding:10px;\r\n color:#555;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#555; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#555; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',
|
236 |
-
`js` = 'function stripBorder_%POLL-ID%(object) {\r\n object.each(function() {\r\n if( parseInt(jQuery(this).width() ) > 0) {\r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."border-left-width\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."border-right-width\\".'"'.")) );\r\n }\r\n else {\r\n jQuery(this).css(\\".'"'."border-left-width\\".'"'.", \'0px\');\r\n jQuery(this).css(\\".'"'."border-right-width\\".'"'.", \'0px\');\r\n }\r\n });\r\n}\r\nfunction stripPadding_%POLL-ID%(object) {\r\n object.each(function() { \r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) );\r\n });\r\n}\r\n\r\nfunction strip_results_%POLL-ID%() {\r\n stripPadding_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%\\".'"'.") ); \r\n stripBorder_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%\\".'"'."));\r\n}\r\n\r\njQuery(document).ready(function(e) {\r\n if(typeof window.strip_results_%POLL-ID% == \'function\') \r\n strip_results_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_answers_%POLL-ID% == \'function\') \r\n tabulate_answers_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_results_%POLL-ID% == \'function\') \r\n tabulate_results_%POLL-ID%();\r\n \r\n});\r\n\r\nfunction equalWidth_%POLL-ID%(obj, cols, findWidest ) {\r\n findWidest = typeof findWidest !== \'undefined\' ? findWidest : false;\r\n if ( findWidest ) {\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n width = parseInt(thisWidth / cols); \r\n jQuery(this).width(width); \r\n jQuery(this).css(\'float\', \'left\'); \r\n });\r\n }\r\n else {\r\n var widest = 0;\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n if(thisWidth > widest) {\r\n widest = thisWidth; \r\n } \r\n });\r\n width = parseInt( widest / cols); \r\n obj.width(width); \r\n obj.css(\'float\', \'left\'); \r\n } \r\n}\r\n\r\nfunction tabulate_answers_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%\\".'"'."), %ANSWERS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %ANSWERS-TABULATED-COLS%, true );\r\n}\r\n\r\nfunction tabulate_results_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%\\".'"'."), %RESULTS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %RESULTS-TABULATED-COLS%, true );\r\n}',
|
237 |
-
`last_modified` = '".current_time( 'mysql' )."' ";
|
238 |
-
break;
|
239 |
-
case 'Grey': //Grey
|
240 |
-
$sql .= "`before_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-ANSWER-CHECK-INPUT% \r\n %POLL-ANSWER-LABEL%\r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_CONTAINER]\r\n [OTHER_ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-OTHER-ANSWER-CHECK-INPUT% \r\n %POLL-OTHER-ANSWER-LABEL% \r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-OTHER-ANSWER-TEXT-INPUT% \r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/OTHER_ANSWER_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-custom-%POLL-ID%\\".'"'.">\r\n <ul>\r\n [CUSTOM_FIELD_CONTAINER]\r\n <li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>\r\n [/CUSTOM_FIELD_CONTAINER]\r\n </ul>\r\n</div> \r\n[CAPTCHA_CONTAINER]\r\n<div id=\"yop-poll-captcha-%POLL-ID%\">\r\n <div class=\"yop-poll-captcha-image-div\" id=\"yop-poll-captcha-image-div-%POLL-ID%\">\r\n %CAPTCHA-IMAGE%\r\n <div class=\"yop-poll-captcha-helpers-div\" id=\"yop-poll-captcha-helpers-div-%POLL-ID%\">%RELOAD-CAPTCHA-IMAGE% </div>\r\n <div class=\"yop_poll_clear\"></div>\r\n </div>\r\n %CAPTCHA-LABEL%\r\n <div class=\"yop-poll-captcha-input-div\" id=\"yop-poll-captcha-input-div-%POLL-ID%\">%CAPTCHA-INPUT%</div>\r\n</div>\r\n[/CAPTCHA_CONTAINER]\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-VOTE-BUTTON%</div>\r\n <div id=\\".'"'."yop-poll-results-%POLL-ID%\\".'"'.">%POLL-VIEW-RESULT-LINK%</div>\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n</div>',
|
241 |
-
`after_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per-%POLL-ID%\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <div>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </div>\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n <div id=\\".'"'."yop-poll-back-%POLL-ID%\\".'"'.">%POLL-BACK-TO-VOTE-LINK%</div>\r\n</div>',
|
242 |
-
`before_start_date_template` = 'This poll is about to <br>\r\nstart at %POLL-START-DATE%<br>\r\nand finish at %POLL-END-DATE%<br>',
|
243 |
-
`after_end_date_template` = 'This poll is closed!\r\nPoll activity: <br>\r\nstart_date %POLL-START-DATE%<br>\r\nend_date %POLL-END-DATE%<br>\r\n\r\nPoll Results:\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-1\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <span class=\\".'"'."pds-clear\\".'"'." style=\\".'"'."display: block;clear: both;height:1px;line-height:1px;\\".'"'."> </span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n%POLL-VOTE-BUTTON%',
|
244 |
-
`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#eee;\r\n padding:10px;\r\n color:#000;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#000; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#000; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',
|
245 |
-
`js` = 'function stripBorder_%POLL-ID%(object) {\r\n object.each(function() {\r\n if( parseInt(jQuery(this).width() ) > 0) {\r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."border-left-width\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."border-right-width\\".'"'.")) );\r\n }\r\n else {\r\n jQuery(this).css(\\".'"'."border-left-width\\".'"'.", \'0px\');\r\n jQuery(this).css(\\".'"'."border-right-width\\".'"'.", \'0px\');\r\n }\r\n });\r\n}\r\nfunction stripPadding_%POLL-ID%(object) {\r\n object.each(function() { \r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) );\r\n });\r\n}\r\n\r\nfunction strip_results_%POLL-ID%() {\r\n stripPadding_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%\\".'"'.") ); \r\n stripBorder_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%\\".'"'."));\r\n}\r\n\r\njQuery(document).ready(function(e) {\r\n if(typeof window.strip_results_%POLL-ID% == \'function\') \r\n strip_results_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_answers_%POLL-ID% == \'function\') \r\n tabulate_answers_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_results_%POLL-ID% == \'function\') \r\n tabulate_results_%POLL-ID%();\r\n \r\n});\r\n\r\nfunction equalWidth_%POLL-ID%(obj, cols, findWidest ) {\r\n findWidest = typeof findWidest !== \'undefined\' ? findWidest : false;\r\n if ( findWidest ) {\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n width = parseInt(thisWidth / cols); \r\n jQuery(this).width(width); \r\n jQuery(this).css(\'float\', \'left\'); \r\n });\r\n }\r\n else {\r\n var widest = 0;\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n if(thisWidth > widest) {\r\n widest = thisWidth; \r\n } \r\n });\r\n width = parseInt( widest / cols); \r\n obj.width(width); \r\n obj.css(\'float\', \'left\'); \r\n } \r\n}\r\n\r\nfunction tabulate_answers_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%\\".'"'."), %ANSWERS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %ANSWERS-TABULATED-COLS%, true );\r\n}\r\n\r\nfunction tabulate_results_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%\\".'"'."), %RESULTS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %RESULTS-TABULATED-COLS%, true );\r\n}',
|
246 |
-
`last_modified` = '".current_time( 'mysql' )."' ";
|
247 |
-
break;
|
248 |
-
case 'Dark': //Dark
|
249 |
-
$sql .= "`before_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-ANSWER-CHECK-INPUT% \r\n %POLL-ANSWER-LABEL%\r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_CONTAINER]\r\n [OTHER_ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-OTHER-ANSWER-CHECK-INPUT% \r\n %POLL-OTHER-ANSWER-LABEL% \r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-OTHER-ANSWER-TEXT-INPUT% \r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/OTHER_ANSWER_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-custom-%POLL-ID%\\".'"'.">\r\n <ul>\r\n [CUSTOM_FIELD_CONTAINER]\r\n <li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>\r\n [/CUSTOM_FIELD_CONTAINER]\r\n </ul>\r\n</div> \r\n[CAPTCHA_CONTAINER]\r\n<div id=\"yop-poll-captcha-%POLL-ID%\">\r\n <div class=\"yop-poll-captcha-image-div\" id=\"yop-poll-captcha-image-div-%POLL-ID%\">\r\n %CAPTCHA-IMAGE%\r\n <div class=\"yop-poll-captcha-helpers-div\" id=\"yop-poll-captcha-helpers-div-%POLL-ID%\">%RELOAD-CAPTCHA-IMAGE% </div>\r\n <div class=\"yop_poll_clear\"></div>\r\n </div>\r\n %CAPTCHA-LABEL%\r\n <div class=\"yop-poll-captcha-input-div\" id=\"yop-poll-captcha-input-div-%POLL-ID%\">%CAPTCHA-INPUT%</div>\r\n</div>\r\n[/CAPTCHA_CONTAINER]\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-VOTE-BUTTON%</div>\r\n <div id=\\".'"'."yop-poll-results-%POLL-ID%\\".'"'.">%POLL-VIEW-RESULT-LINK%</div>\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n</div>',
|
250 |
-
`after_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per-%POLL-ID%\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <div>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </div>\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n <div id=\\".'"'."yop-poll-back-%POLL-ID%\\".'"'.">%POLL-BACK-TO-VOTE-LINK%</div>\r\n</div>',
|
251 |
-
`before_start_date_template` = 'This poll is about to <br>\r\nstart at %POLL-START-DATE%<br>\r\nand finish at %POLL-END-DATE%<br>',
|
252 |
-
`after_end_date_template` = 'This poll is closed!\r\nPoll activity: <br>\r\nstart_date %POLL-START-DATE%<br>\r\nend_date %POLL-END-DATE%<br>\r\n\r\nPoll Results:\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-1\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <span class=\\".'"'."pds-clear\\".'"'." style=\\".'"'."display: block;clear: both;height:1px;line-height:1px;\\".'"'."> </span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n%POLL-VOTE-BUTTON%',
|
253 |
-
`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#555;\r\n padding:10px;\r\n color:#fff;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#333333; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#fff; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#fff; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',
|
254 |
-
`js` = 'function stripBorder_%POLL-ID%(object) {\r\n object.each(function() {\r\n if( parseInt(jQuery(this).width() ) > 0) {\r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."border-left-width\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."border-right-width\\".'"'.")) );\r\n }\r\n else {\r\n jQuery(this).css(\\".'"'."border-left-width\\".'"'.", \'0px\');\r\n jQuery(this).css(\\".'"'."border-right-width\\".'"'.", \'0px\');\r\n }\r\n });\r\n}\r\nfunction stripPadding_%POLL-ID%(object) {\r\n object.each(function() { \r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) );\r\n });\r\n}\r\n\r\nfunction strip_results_%POLL-ID%() {\r\n stripPadding_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%\\".'"'.") ); \r\n stripBorder_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%\\".'"'."));\r\n}\r\n\r\njQuery(document).ready(function(e) {\r\n if(typeof window.strip_results_%POLL-ID% == \'function\') \r\n strip_results_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_answers_%POLL-ID% == \'function\') \r\n tabulate_answers_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_results_%POLL-ID% == \'function\') \r\n tabulate_results_%POLL-ID%();\r\n \r\n});\r\n\r\nfunction equalWidth_%POLL-ID%(obj, cols, findWidest ) {\r\n findWidest = typeof findWidest !== \'undefined\' ? findWidest : false;\r\n if ( findWidest ) {\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n width = parseInt(thisWidth / cols); \r\n jQuery(this).width(width); \r\n jQuery(this).css(\'float\', \'left\'); \r\n });\r\n }\r\n else {\r\n var widest = 0;\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n if(thisWidth > widest) {\r\n widest = thisWidth; \r\n } \r\n });\r\n width = parseInt( widest / cols); \r\n obj.width(width); \r\n obj.css(\'float\', \'left\'); \r\n } \r\n}\r\n\r\nfunction tabulate_answers_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%\\".'"'."), %ANSWERS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %ANSWERS-TABULATED-COLS%, true );\r\n}\r\n\r\nfunction tabulate_results_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%\\".'"'."), %RESULTS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %RESULTS-TABULATED-COLS%, true );\r\n}',
|
255 |
-
`last_modified` = '".current_time( 'mysql' )."' ";
|
256 |
-
break;
|
257 |
-
case 'Blue v1': //Blue v1
|
258 |
-
$sql .= "`before_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-ANSWER-CHECK-INPUT% \r\n %POLL-ANSWER-LABEL%\r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_CONTAINER]\r\n [OTHER_ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-OTHER-ANSWER-CHECK-INPUT% \r\n %POLL-OTHER-ANSWER-LABEL% \r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-OTHER-ANSWER-TEXT-INPUT% \r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/OTHER_ANSWER_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-custom-%POLL-ID%\\".'"'.">\r\n <ul>\r\n [CUSTOM_FIELD_CONTAINER]\r\n <li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>\r\n [/CUSTOM_FIELD_CONTAINER]\r\n </ul>\r\n</div> \r\n[CAPTCHA_CONTAINER]\r\n<div id=\"yop-poll-captcha-%POLL-ID%\">\r\n <div class=\"yop-poll-captcha-image-div\" id=\"yop-poll-captcha-image-div-%POLL-ID%\">\r\n %CAPTCHA-IMAGE%\r\n <div class=\"yop-poll-captcha-helpers-div\" id=\"yop-poll-captcha-helpers-div-%POLL-ID%\">%RELOAD-CAPTCHA-IMAGE% </div>\r\n <div class=\"yop_poll_clear\"></div>\r\n </div>\r\n %CAPTCHA-LABEL%\r\n <div class=\"yop-poll-captcha-input-div\" id=\"yop-poll-captcha-input-div-%POLL-ID%\">%CAPTCHA-INPUT%</div>\r\n</div>\r\n[/CAPTCHA_CONTAINER]\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-VOTE-BUTTON%</div>\r\n <div id=\\".'"'."yop-poll-results-%POLL-ID%\\".'"'.">%POLL-VIEW-RESULT-LINK%</div>\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n</div>',
|
259 |
-
`after_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per-%POLL-ID%\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <div>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </div>\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n <div id=\\".'"'."yop-poll-back-%POLL-ID%\\".'"'.">%POLL-BACK-TO-VOTE-LINK%</div>\r\n</div>',
|
260 |
-
`before_start_date_template` = 'This poll is about to <br>\r\nstart at %POLL-START-DATE%<br>\r\nand finish at %POLL-END-DATE%<br>',
|
261 |
-
`after_end_date_template` = 'This poll is closed!\r\nPoll activity: <br>\r\nstart_date %POLL-START-DATE%<br>\r\nend_date %POLL-END-DATE%<br>\r\n\r\nPoll Results:\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-1\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <span class=\\".'"'."pds-clear\\".'"'." style=\\".'"'."display: block;clear: both;height:1px;line-height:1px;\\".'"'."> </span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n%POLL-VOTE-BUTTON%',
|
262 |
-
`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#327BD6;\r\n padding:10px;\r\n color:#fff;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#fff; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#fff; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',
|
263 |
-
`js` = 'function stripBorder_%POLL-ID%(object) {\r\n object.each(function() {\r\n if( parseInt(jQuery(this).width() ) > 0) {\r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."border-left-width\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."border-right-width\\".'"'.")) );\r\n }\r\n else {\r\n jQuery(this).css(\\".'"'."border-left-width\\".'"'.", \'0px\');\r\n jQuery(this).css(\\".'"'."border-right-width\\".'"'.", \'0px\');\r\n }\r\n });\r\n}\r\nfunction stripPadding_%POLL-ID%(object) {\r\n object.each(function() { \r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) );\r\n });\r\n}\r\n\r\nfunction strip_results_%POLL-ID%() {\r\n stripPadding_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%\\".'"'.") ); \r\n stripBorder_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%\\".'"'."));\r\n}\r\n\r\njQuery(document).ready(function(e) {\r\n if(typeof window.strip_results_%POLL-ID% == \'function\') \r\n strip_results_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_answers_%POLL-ID% == \'function\') \r\n tabulate_answers_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_results_%POLL-ID% == \'function\') \r\n tabulate_results_%POLL-ID%();\r\n \r\n});\r\n\r\nfunction equalWidth_%POLL-ID%(obj, cols, findWidest ) {\r\n findWidest = typeof findWidest !== \'undefined\' ? findWidest : false;\r\n if ( findWidest ) {\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n width = parseInt(thisWidth / cols); \r\n jQuery(this).width(width); \r\n jQuery(this).css(\'float\', \'left\'); \r\n });\r\n }\r\n else {\r\n var widest = 0;\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n if(thisWidth > widest) {\r\n widest = thisWidth; \r\n } \r\n });\r\n width = parseInt( widest / cols); \r\n obj.width(width); \r\n obj.css(\'float\', \'left\'); \r\n } \r\n}\r\n\r\nfunction tabulate_answers_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%\\".'"'."), %ANSWERS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %ANSWERS-TABULATED-COLS%, true );\r\n}\r\n\r\nfunction tabulate_results_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%\\".'"'."), %RESULTS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %RESULTS-TABULATED-COLS%, true );\r\n}',
|
264 |
-
`last_modified` = '".current_time( 'mysql' )."' ";
|
265 |
-
break;
|
266 |
-
case 'Blue v2': //Blue v2
|
267 |
-
$sql .= "`before_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-ANSWER-CHECK-INPUT% \r\n %POLL-ANSWER-LABEL%\r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_CONTAINER]\r\n [OTHER_ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-OTHER-ANSWER-CHECK-INPUT% \r\n %POLL-OTHER-ANSWER-LABEL% \r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-OTHER-ANSWER-TEXT-INPUT% \r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/OTHER_ANSWER_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-custom-%POLL-ID%\\".'"'.">\r\n <ul>\r\n [CUSTOM_FIELD_CONTAINER]\r\n <li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>\r\n [/CUSTOM_FIELD_CONTAINER]\r\n </ul>\r\n</div> \r\n[CAPTCHA_CONTAINER]\r\n<div id=\"yop-poll-captcha-%POLL-ID%\">\r\n <div class=\"yop-poll-captcha-image-div\" id=\"yop-poll-captcha-image-div-%POLL-ID%\">\r\n %CAPTCHA-IMAGE%\r\n <div class=\"yop-poll-captcha-helpers-div\" id=\"yop-poll-captcha-helpers-div-%POLL-ID%\">%RELOAD-CAPTCHA-IMAGE% </div>\r\n <div class=\"yop_poll_clear\"></div>\r\n </div>\r\n %CAPTCHA-LABEL%\r\n <div class=\"yop-poll-captcha-input-div\" id=\"yop-poll-captcha-input-div-%POLL-ID%\">%CAPTCHA-INPUT%</div>\r\n</div>\r\n[/CAPTCHA_CONTAINER]\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-VOTE-BUTTON%</div>\r\n <div id=\\".'"'."yop-poll-results-%POLL-ID%\\".'"'.">%POLL-VIEW-RESULT-LINK%</div>\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n</div>',
|
268 |
-
`after_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per-%POLL-ID%\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <div>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </div>\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n <div id=\\".'"'."yop-poll-back-%POLL-ID%\\".'"'.">%POLL-BACK-TO-VOTE-LINK%</div>\r\n</div>',
|
269 |
-
`before_start_date_template` = 'This poll is about to <br>\r\nstart at %POLL-START-DATE%<br>\r\nand finish at %POLL-END-DATE%<br>',
|
270 |
-
`after_end_date_template` = 'This poll is closed!\r\nPoll activity: <br>\r\nstart_date %POLL-START-DATE%<br>\r\nend_date %POLL-END-DATE%<br>\r\n\r\nPoll Results:\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-1\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <span class=\\".'"'."pds-clear\\".'"'." style=\\".'"'."display: block;clear: both;height:1px;line-height:1px;\\".'"'."> </span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n%POLL-VOTE-BUTTON%',
|
271 |
-
`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#fff;\r\n padding:0px;\r\n color:#555;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-weight:bold;\r\n background:#327BD6;\r\n color:#fff;\r\n padding:5px;\r\n text-align:center;\r\n font-size:12px;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#327BD6; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#327BD6; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',
|
272 |
-
`js` = 'function stripBorder_%POLL-ID%(object) {\r\n object.each(function() {\r\n if( parseInt(jQuery(this).width() ) > 0) {\r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."border-left-width\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."border-right-width\\".'"'.")) );\r\n }\r\n else {\r\n jQuery(this).css(\\".'"'."border-left-width\\".'"'.", \'0px\');\r\n jQuery(this).css(\\".'"'."border-right-width\\".'"'.", \'0px\');\r\n }\r\n });\r\n}\r\nfunction stripPadding_%POLL-ID%(object) {\r\n object.each(function() { \r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) );\r\n });\r\n}\r\n\r\nfunction strip_results_%POLL-ID%() {\r\n stripPadding_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%\\".'"'.") ); \r\n stripBorder_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%\\".'"'."));\r\n}\r\n\r\njQuery(document).ready(function(e) {\r\n if(typeof window.strip_results_%POLL-ID% == \'function\') \r\n strip_results_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_answers_%POLL-ID% == \'function\') \r\n tabulate_answers_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_results_%POLL-ID% == \'function\') \r\n tabulate_results_%POLL-ID%();\r\n \r\n});\r\n\r\nfunction equalWidth_%POLL-ID%(obj, cols, findWidest ) {\r\n findWidest = typeof findWidest !== \'undefined\' ? findWidest : false;\r\n if ( findWidest ) {\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n width = parseInt(thisWidth / cols); \r\n jQuery(this).width(width); \r\n jQuery(this).css(\'float\', \'left\'); \r\n });\r\n }\r\n else {\r\n var widest = 0;\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n if(thisWidth > widest) {\r\n widest = thisWidth; \r\n } \r\n });\r\n width = parseInt( widest / cols); \r\n obj.width(width); \r\n obj.css(\'float\', \'left\'); \r\n } \r\n}\r\n\r\nfunction tabulate_answers_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%\\".'"'."), %ANSWERS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %ANSWERS-TABULATED-COLS%, true );\r\n}\r\n\r\nfunction tabulate_results_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%\\".'"'."), %RESULTS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %RESULTS-TABULATED-COLS%, true );\r\n}',
|
273 |
-
`last_modified` = '".current_time( 'mysql' )."' ";
|
274 |
-
break;
|
275 |
-
case 'Blue v3': //Blue v3
|
276 |
-
$sql .= "`before_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-ANSWER-CHECK-INPUT% \r\n %POLL-ANSWER-LABEL%\r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_CONTAINER]\r\n [OTHER_ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-OTHER-ANSWER-CHECK-INPUT% \r\n %POLL-OTHER-ANSWER-LABEL% \r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-OTHER-ANSWER-TEXT-INPUT% \r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/OTHER_ANSWER_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-custom-%POLL-ID%\\".'"'.">\r\n <ul>\r\n [CUSTOM_FIELD_CONTAINER]\r\n <li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>\r\n [/CUSTOM_FIELD_CONTAINER]\r\n </ul>\r\n</div> \r\n[CAPTCHA_CONTAINER]\r\n<div id=\"yop-poll-captcha-%POLL-ID%\">\r\n <div class=\"yop-poll-captcha-image-div\" id=\"yop-poll-captcha-image-div-%POLL-ID%\">\r\n %CAPTCHA-IMAGE%\r\n <div class=\"yop-poll-captcha-helpers-div\" id=\"yop-poll-captcha-helpers-div-%POLL-ID%\">%RELOAD-CAPTCHA-IMAGE% </div>\r\n <div class=\"yop_poll_clear\"></div>\r\n </div>\r\n %CAPTCHA-LABEL%\r\n <div class=\"yop-poll-captcha-input-div\" id=\"yop-poll-captcha-input-div-%POLL-ID%\">%CAPTCHA-INPUT%</div>\r\n</div>\r\n[/CAPTCHA_CONTAINER]\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-VOTE-BUTTON%</div>\r\n <div id=\\".'"'."yop-poll-results-%POLL-ID%\\".'"'.">%POLL-VIEW-RESULT-LINK%</div>\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n</div>',
|
277 |
-
`after_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per-%POLL-ID%\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <div>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </div>\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n <div id=\\".'"'."yop-poll-back-%POLL-ID%\\".'"'.">%POLL-BACK-TO-VOTE-LINK%</div>\r\n</div>',
|
278 |
-
`before_start_date_template` = 'This poll is about to <br>\r\nstart at %POLL-START-DATE%<br>\r\nand finish at %POLL-END-DATE%<br>',
|
279 |
-
`after_end_date_template` = 'This poll is closed!\r\nPoll activity: <br>\r\nstart_date %POLL-START-DATE%<br>\r\nend_date %POLL-END-DATE%<br>\r\n\r\nPoll Results:\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-1\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <span class=\\".'"'."pds-clear\\".'"'." style=\\".'"'."display: block;clear: both;height:1px;line-height:1px;\\".'"'."> </span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n%POLL-VOTE-BUTTON%',
|
280 |
-
`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#fff;\r\n padding:10px;\r\n color:#555;\r\n overflow:hidden;\r\n font-size:12px;\r\n border:5px solid #327BD6;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#327BD6; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#327BD6; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',
|
281 |
-
`js` = 'function stripBorder_%POLL-ID%(object) {\r\n object.each(function() {\r\n if( parseInt(jQuery(this).width() ) > 0) {\r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."border-left-width\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."border-right-width\\".'"'.")) );\r\n }\r\n else {\r\n jQuery(this).css(\\".'"'."border-left-width\\".'"'.", \'0px\');\r\n jQuery(this).css(\\".'"'."border-right-width\\".'"'.", \'0px\');\r\n }\r\n });\r\n}\r\nfunction stripPadding_%POLL-ID%(object) {\r\n object.each(function() { \r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) );\r\n });\r\n}\r\n\r\nfunction strip_results_%POLL-ID%() {\r\n stripPadding_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%\\".'"'.") ); \r\n stripBorder_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%\\".'"'."));\r\n}\r\n\r\njQuery(document).ready(function(e) {\r\n if(typeof window.strip_results_%POLL-ID% == \'function\') \r\n strip_results_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_answers_%POLL-ID% == \'function\') \r\n tabulate_answers_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_results_%POLL-ID% == \'function\') \r\n tabulate_results_%POLL-ID%();\r\n \r\n});\r\n\r\nfunction equalWidth_%POLL-ID%(obj, cols, findWidest ) {\r\n findWidest = typeof findWidest !== \'undefined\' ? findWidest : false;\r\n if ( findWidest ) {\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n width = parseInt(thisWidth / cols); \r\n jQuery(this).width(width); \r\n jQuery(this).css(\'float\', \'left\'); \r\n });\r\n }\r\n else {\r\n var widest = 0;\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n if(thisWidth > widest) {\r\n widest = thisWidth; \r\n } \r\n });\r\n width = parseInt( widest / cols); \r\n obj.width(width); \r\n obj.css(\'float\', \'left\'); \r\n } \r\n}\r\n\r\nfunction tabulate_answers_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%\\".'"'."), %ANSWERS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %ANSWERS-TABULATED-COLS%, true );\r\n}\r\n\r\nfunction tabulate_results_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%\\".'"'."), %RESULTS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %RESULTS-TABULATED-COLS%, true );\r\n}',
|
282 |
-
`last_modified` = '".current_time( 'mysql' )."' ";
|
283 |
-
break;
|
284 |
-
case 'Red v1': //Red v1
|
285 |
-
$sql .= "`before_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-ANSWER-CHECK-INPUT% \r\n %POLL-ANSWER-LABEL%\r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_CONTAINER]\r\n [OTHER_ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-OTHER-ANSWER-CHECK-INPUT% \r\n %POLL-OTHER-ANSWER-LABEL% \r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-OTHER-ANSWER-TEXT-INPUT% \r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/OTHER_ANSWER_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-custom-%POLL-ID%\\".'"'.">\r\n <ul>\r\n [CUSTOM_FIELD_CONTAINER]\r\n <li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>\r\n [/CUSTOM_FIELD_CONTAINER]\r\n </ul>\r\n</div> \r\n[CAPTCHA_CONTAINER]\r\n<div id=\"yop-poll-captcha-%POLL-ID%\">\r\n <div class=\"yop-poll-captcha-image-div\" id=\"yop-poll-captcha-image-div-%POLL-ID%\">\r\n %CAPTCHA-IMAGE%\r\n <div class=\"yop-poll-captcha-helpers-div\" id=\"yop-poll-captcha-helpers-div-%POLL-ID%\">%RELOAD-CAPTCHA-IMAGE% </div>\r\n <div class=\"yop_poll_clear\"></div>\r\n </div>\r\n %CAPTCHA-LABEL%\r\n <div class=\"yop-poll-captcha-input-div\" id=\"yop-poll-captcha-input-div-%POLL-ID%\">%CAPTCHA-INPUT%</div>\r\n</div>\r\n[/CAPTCHA_CONTAINER]\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-VOTE-BUTTON%</div>\r\n <div id=\\".'"'."yop-poll-results-%POLL-ID%\\".'"'.">%POLL-VIEW-RESULT-LINK%</div>\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n</div>',
|
286 |
-
`after_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per-%POLL-ID%\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <div>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </div>\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n <div id=\\".'"'."yop-poll-back-%POLL-ID%\\".'"'.">%POLL-BACK-TO-VOTE-LINK%</div>\r\n</div>',
|
287 |
-
`before_start_date_template` = 'This poll is about to <br>\r\nstart at %POLL-START-DATE%<br>\r\nand finish at %POLL-END-DATE%<br>',
|
288 |
-
`after_end_date_template` = 'This poll is closed!\r\nPoll activity: <br>\r\nstart_date %POLL-START-DATE%<br>\r\nend_date %POLL-END-DATE%<br>\r\n\r\nPoll Results:\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-1\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <span class=\\".'"'."pds-clear\\".'"'." style=\\".'"'."display: block;clear: both;height:1px;line-height:1px;\\".'"'."> </span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n%POLL-VOTE-BUTTON%',
|
289 |
-
`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#B70004;\r\n padding:10px;\r\n color:#fff;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#fff; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#fff; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',
|
290 |
-
`js` = 'function stripBorder_%POLL-ID%(object) {\r\n object.each(function() {\r\n if( parseInt(jQuery(this).width() ) > 0) {\r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."border-left-width\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."border-right-width\\".'"'.")) );\r\n }\r\n else {\r\n jQuery(this).css(\\".'"'."border-left-width\\".'"'.", \'0px\');\r\n jQuery(this).css(\\".'"'."border-right-width\\".'"'.", \'0px\');\r\n }\r\n });\r\n}\r\nfunction stripPadding_%POLL-ID%(object) {\r\n object.each(function() { \r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) );\r\n });\r\n}\r\n\r\nfunction strip_results_%POLL-ID%() {\r\n stripPadding_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%\\".'"'.") ); \r\n stripBorder_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%\\".'"'."));\r\n}\r\n\r\njQuery(document).ready(function(e) {\r\n if(typeof window.strip_results_%POLL-ID% == \'function\') \r\n strip_results_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_answers_%POLL-ID% == \'function\') \r\n tabulate_answers_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_results_%POLL-ID% == \'function\') \r\n tabulate_results_%POLL-ID%();\r\n \r\n});\r\n\r\nfunction equalWidth_%POLL-ID%(obj, cols, findWidest ) {\r\n findWidest = typeof findWidest !== \'undefined\' ? findWidest : false;\r\n if ( findWidest ) {\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n width = parseInt(thisWidth / cols); \r\n jQuery(this).width(width); \r\n jQuery(this).css(\'float\', \'left\'); \r\n });\r\n }\r\n else {\r\n var widest = 0;\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n if(thisWidth > widest) {\r\n widest = thisWidth; \r\n } \r\n });\r\n width = parseInt( widest / cols); \r\n obj.width(width); \r\n obj.css(\'float\', \'left\'); \r\n } \r\n}\r\n\r\nfunction tabulate_answers_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%\\".'"'."), %ANSWERS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %ANSWERS-TABULATED-COLS%, true );\r\n}\r\n\r\nfunction tabulate_results_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%\\".'"'."), %RESULTS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %RESULTS-TABULATED-COLS%, true );\r\n}',
|
291 |
-
`last_modified` = '".current_time( 'mysql' )."' ";
|
292 |
-
break;
|
293 |
-
case 'Red v2': //Red v2
|
294 |
-
$sql .= "`before_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-ANSWER-CHECK-INPUT% \r\n %POLL-ANSWER-LABEL%\r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_CONTAINER]\r\n [OTHER_ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-OTHER-ANSWER-CHECK-INPUT% \r\n %POLL-OTHER-ANSWER-LABEL% \r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-OTHER-ANSWER-TEXT-INPUT% \r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/OTHER_ANSWER_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-custom-%POLL-ID%\\".'"'.">\r\n <ul>\r\n [CUSTOM_FIELD_CONTAINER]\r\n <li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>\r\n [/CUSTOM_FIELD_CONTAINER]\r\n </ul>\r\n</div> \r\n[CAPTCHA_CONTAINER]\r\n<div id=\"yop-poll-captcha-%POLL-ID%\">\r\n <div class=\"yop-poll-captcha-image-div\" id=\"yop-poll-captcha-image-div-%POLL-ID%\">\r\n %CAPTCHA-IMAGE%\r\n <div class=\"yop-poll-captcha-helpers-div\" id=\"yop-poll-captcha-helpers-div-%POLL-ID%\">%RELOAD-CAPTCHA-IMAGE% </div>\r\n <div class=\"yop_poll_clear\"></div>\r\n </div>\r\n %CAPTCHA-LABEL%\r\n <div class=\"yop-poll-captcha-input-div\" id=\"yop-poll-captcha-input-div-%POLL-ID%\">%CAPTCHA-INPUT%</div>\r\n</div>\r\n[/CAPTCHA_CONTAINER]\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-VOTE-BUTTON%</div>\r\n <div id=\\".'"'."yop-poll-results-%POLL-ID%\\".'"'.">%POLL-VIEW-RESULT-LINK%</div>\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n</div>',
|
295 |
-
`after_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per-%POLL-ID%\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <div>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </div>\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n <div id=\\".'"'."yop-poll-back-%POLL-ID%\\".'"'.">%POLL-BACK-TO-VOTE-LINK%</div>\r\n</div>',
|
296 |
-
`before_start_date_template` = 'This poll is about to <br>\r\nstart at %POLL-START-DATE%<br>\r\nand finish at %POLL-END-DATE%<br>',
|
297 |
-
`after_end_date_template` = 'This poll is closed!\r\nPoll activity: <br>\r\nstart_date %POLL-START-DATE%<br>\r\nend_date %POLL-END-DATE%<br>\r\n\r\nPoll Results:\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-1\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <span class=\\".'"'."pds-clear\\".'"'." style=\\".'"'."display: block;clear: both;height:1px;line-height:1px;\\".'"'."> </span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n%POLL-VOTE-BUTTON%',
|
298 |
-
`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#fff;\r\n padding:0px;\r\n color:#555;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-weight:bold;\r\n background:#B70004;\r\n color:#fff;\r\n padding:5px;\r\n text-align:center;\r\n font-size:12px;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#B70004; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#B70004; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',
|
299 |
-
`js` = 'function stripBorder_%POLL-ID%(object) {\r\n object.each(function() {\r\n if( parseInt(jQuery(this).width() ) > 0) {\r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."border-left-width\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."border-right-width\\".'"'.")) );\r\n }\r\n else {\r\n jQuery(this).css(\\".'"'."border-left-width\\".'"'.", \'0px\');\r\n jQuery(this).css(\\".'"'."border-right-width\\".'"'.", \'0px\');\r\n }\r\n });\r\n}\r\nfunction stripPadding_%POLL-ID%(object) {\r\n object.each(function() { \r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) );\r\n });\r\n}\r\n\r\nfunction strip_results_%POLL-ID%() {\r\n stripPadding_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%\\".'"'.") ); \r\n stripBorder_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%\\".'"'."));\r\n}\r\n\r\njQuery(document).ready(function(e) {\r\n if(typeof window.strip_results_%POLL-ID% == \'function\') \r\n strip_results_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_answers_%POLL-ID% == \'function\') \r\n tabulate_answers_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_results_%POLL-ID% == \'function\') \r\n tabulate_results_%POLL-ID%();\r\n \r\n});\r\n\r\nfunction equalWidth_%POLL-ID%(obj, cols, findWidest ) {\r\n findWidest = typeof findWidest !== \'undefined\' ? findWidest : false;\r\n if ( findWidest ) {\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n width = parseInt(thisWidth / cols); \r\n jQuery(this).width(width); \r\n jQuery(this).css(\'float\', \'left\'); \r\n });\r\n }\r\n else {\r\n var widest = 0;\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n if(thisWidth > widest) {\r\n widest = thisWidth; \r\n } \r\n });\r\n width = parseInt( widest / cols); \r\n obj.width(width); \r\n obj.css(\'float\', \'left\'); \r\n } \r\n}\r\n\r\nfunction tabulate_answers_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%\\".'"'."), %ANSWERS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %ANSWERS-TABULATED-COLS%, true );\r\n}\r\n\r\nfunction tabulate_results_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%\\".'"'."), %RESULTS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %RESULTS-TABULATED-COLS%, true );\r\n}',
|
300 |
-
`last_modified` = '".current_time( 'mysql' )."' ";
|
301 |
-
break;
|
302 |
-
case 'Red v3': //Red v3
|
303 |
-
$sql .= "`before_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-ANSWER-CHECK-INPUT% \r\n %POLL-ANSWER-LABEL%\r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_CONTAINER]\r\n [OTHER_ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-OTHER-ANSWER-CHECK-INPUT% \r\n %POLL-OTHER-ANSWER-LABEL% \r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-OTHER-ANSWER-TEXT-INPUT% \r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/OTHER_ANSWER_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-custom-%POLL-ID%\\".'"'.">\r\n <ul>\r\n [CUSTOM_FIELD_CONTAINER]\r\n <li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>\r\n [/CUSTOM_FIELD_CONTAINER]\r\n </ul>\r\n</div> \r\n[CAPTCHA_CONTAINER]\r\n<div id=\"yop-poll-captcha-%POLL-ID%\">\r\n <div class=\"yop-poll-captcha-image-div\" id=\"yop-poll-captcha-image-div-%POLL-ID%\">\r\n %CAPTCHA-IMAGE%\r\n <div class=\"yop-poll-captcha-helpers-div\" id=\"yop-poll-captcha-helpers-div-%POLL-ID%\">%RELOAD-CAPTCHA-IMAGE% </div>\r\n <div class=\"yop_poll_clear\"></div>\r\n </div>\r\n %CAPTCHA-LABEL%\r\n <div class=\"yop-poll-captcha-input-div\" id=\"yop-poll-captcha-input-div-%POLL-ID%\">%CAPTCHA-INPUT%</div>\r\n</div>\r\n[/CAPTCHA_CONTAINER]\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-VOTE-BUTTON%</div>\r\n <div id=\\".'"'."yop-poll-results-%POLL-ID%\\".'"'.">%POLL-VIEW-RESULT-LINK%</div>\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n</div>',
|
304 |
-
`after_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per-%POLL-ID%\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <div>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </div>\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n <div id=\\".'"'."yop-poll-back-%POLL-ID%\\".'"'.">%POLL-BACK-TO-VOTE-LINK%</div>\r\n</div>',
|
305 |
-
`before_start_date_template` = 'This poll is about to <br>\r\nstart at %POLL-START-DATE%<br>\r\nand finish at %POLL-END-DATE%<br>',
|
306 |
-
`after_end_date_template` = 'This poll is closed!\r\nPoll activity: <br>\r\nstart_date %POLL-START-DATE%<br>\r\nend_date %POLL-END-DATE%<br>\r\n\r\nPoll Results:\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-1\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <span class=\\".'"'."pds-clear\\".'"'." style=\\".'"'."display: block;clear: both;height:1px;line-height:1px;\\".'"'."> </span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n%POLL-VOTE-BUTTON%',
|
307 |
-
`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#fff;\r\n padding:10px;\r\n color:#555;\r\n overflow:hidden;\r\n font-size:12px;\r\n border:5px solid #B70004;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#B70004; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#B70004; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',
|
308 |
-
`js` = 'function stripBorder_%POLL-ID%(object) {\r\n object.each(function() {\r\n if( parseInt(jQuery(this).width() ) > 0) {\r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."border-left-width\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."border-right-width\\".'"'.")) );\r\n }\r\n else {\r\n jQuery(this).css(\\".'"'."border-left-width\\".'"'.", \'0px\');\r\n jQuery(this).css(\\".'"'."border-right-width\\".'"'.", \'0px\');\r\n }\r\n });\r\n}\r\nfunction stripPadding_%POLL-ID%(object) {\r\n object.each(function() { \r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) );\r\n });\r\n}\r\n\r\nfunction strip_results_%POLL-ID%() {\r\n stripPadding_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%\\".'"'.") ); \r\n stripBorder_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%\\".'"'."));\r\n}\r\n\r\njQuery(document).ready(function(e) {\r\n if(typeof window.strip_results_%POLL-ID% == \'function\') \r\n strip_results_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_answers_%POLL-ID% == \'function\') \r\n tabulate_answers_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_results_%POLL-ID% == \'function\') \r\n tabulate_results_%POLL-ID%();\r\n \r\n});\r\n\r\nfunction equalWidth_%POLL-ID%(obj, cols, findWidest ) {\r\n findWidest = typeof findWidest !== \'undefined\' ? findWidest : false;\r\n if ( findWidest ) {\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n width = parseInt(thisWidth / cols); \r\n jQuery(this).width(width); \r\n jQuery(this).css(\'float\', \'left\'); \r\n });\r\n }\r\n else {\r\n var widest = 0;\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n if(thisWidth > widest) {\r\n widest = thisWidth; \r\n } \r\n });\r\n width = parseInt( widest / cols); \r\n obj.width(width); \r\n obj.css(\'float\', \'left\'); \r\n } \r\n}\r\n\r\nfunction tabulate_answers_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%\\".'"'."), %ANSWERS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %ANSWERS-TABULATED-COLS%, true );\r\n}\r\n\r\nfunction tabulate_results_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%\\".'"'."), %RESULTS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %RESULTS-TABULATED-COLS%, true );\r\n}',
|
309 |
-
`last_modified` = '".current_time( 'mysql' )."' ";
|
310 |
-
break;
|
311 |
-
case 'Green v1': //Green v1
|
312 |
-
$sql .= "`before_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-ANSWER-CHECK-INPUT% \r\n %POLL-ANSWER-LABEL%\r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_CONTAINER]\r\n [OTHER_ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-OTHER-ANSWER-CHECK-INPUT% \r\n %POLL-OTHER-ANSWER-LABEL% \r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-OTHER-ANSWER-TEXT-INPUT% \r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/OTHER_ANSWER_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-custom-%POLL-ID%\\".'"'.">\r\n <ul>\r\n [CUSTOM_FIELD_CONTAINER]\r\n <li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>\r\n [/CUSTOM_FIELD_CONTAINER]\r\n </ul>\r\n</div> \r\n[CAPTCHA_CONTAINER]\r\n<div id=\"yop-poll-captcha-%POLL-ID%\">\r\n <div class=\"yop-poll-captcha-image-div\" id=\"yop-poll-captcha-image-div-%POLL-ID%\">\r\n %CAPTCHA-IMAGE%\r\n <div class=\"yop-poll-captcha-helpers-div\" id=\"yop-poll-captcha-helpers-div-%POLL-ID%\">%RELOAD-CAPTCHA-IMAGE% </div>\r\n <div class=\"yop_poll_clear\"></div>\r\n </div>\r\n %CAPTCHA-LABEL%\r\n <div class=\"yop-poll-captcha-input-div\" id=\"yop-poll-captcha-input-div-%POLL-ID%\">%CAPTCHA-INPUT%</div>\r\n</div>\r\n[/CAPTCHA_CONTAINER]\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-VOTE-BUTTON%</div>\r\n <div id=\\".'"'."yop-poll-results-%POLL-ID%\\".'"'.">%POLL-VIEW-RESULT-LINK%</div>\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n</div>',
|
313 |
-
`after_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per-%POLL-ID%\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <div>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </div>\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n <div id=\\".'"'."yop-poll-back-%POLL-ID%\\".'"'.">%POLL-BACK-TO-VOTE-LINK%</div>\r\n</div>',
|
314 |
-
`before_start_date_template` = 'This poll is about to <br>\r\nstart at %POLL-START-DATE%<br>\r\nand finish at %POLL-END-DATE%<br>',
|
315 |
-
`after_end_date_template` = 'This poll is closed!\r\nPoll activity: <br>\r\nstart_date %POLL-START-DATE%<br>\r\nend_date %POLL-END-DATE%<br>\r\n\r\nPoll Results:\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-1\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <span class=\\".'"'."pds-clear\\".'"'." style=\\".'"'."display: block;clear: both;height:1px;line-height:1px;\\".'"'."> </span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n%POLL-VOTE-BUTTON%',
|
316 |
-
`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#3F8B43;\r\n padding:10px;\r\n color:#fff;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#fff; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#fff; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:00FF00;\r\n}',
|
317 |
-
`js` = 'function stripBorder_%POLL-ID%(object) {\r\n object.each(function() {\r\n if( parseInt(jQuery(this).width() ) > 0) {\r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."border-left-width\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."border-right-width\\".'"'.")) );\r\n }\r\n else {\r\n jQuery(this).css(\\".'"'."border-left-width\\".'"'.", \'0px\');\r\n jQuery(this).css(\\".'"'."border-right-width\\".'"'.", \'0px\');\r\n }\r\n });\r\n}\r\nfunction stripPadding_%POLL-ID%(object) {\r\n object.each(function() { \r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) );\r\n });\r\n}\r\n\r\nfunction strip_results_%POLL-ID%() {\r\n stripPadding_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%\\".'"'.") ); \r\n stripBorder_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%\\".'"'."));\r\n}\r\n\r\njQuery(document).ready(function(e) {\r\n if(typeof window.strip_results_%POLL-ID% == \'function\') \r\n strip_results_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_answers_%POLL-ID% == \'function\') \r\n tabulate_answers_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_results_%POLL-ID% == \'function\') \r\n tabulate_results_%POLL-ID%();\r\n \r\n});\r\n\r\nfunction equalWidth_%POLL-ID%(obj, cols, findWidest ) {\r\n findWidest = typeof findWidest !== \'undefined\' ? findWidest : false;\r\n if ( findWidest ) {\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n width = parseInt(thisWidth / cols); \r\n jQuery(this).width(width); \r\n jQuery(this).css(\'float\', \'left\'); \r\n });\r\n }\r\n else {\r\n var widest = 0;\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n if(thisWidth > widest) {\r\n widest = thisWidth; \r\n } \r\n });\r\n width = parseInt( widest / cols); \r\n obj.width(width); \r\n obj.css(\'float\', \'left\'); \r\n } \r\n}\r\n\r\nfunction tabulate_answers_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%\\".'"'."), %ANSWERS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %ANSWERS-TABULATED-COLS%, true );\r\n}\r\n\r\nfunction tabulate_results_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%\\".'"'."), %RESULTS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %RESULTS-TABULATED-COLS%, true );\r\n}',
|
318 |
-
`last_modified` = '".current_time( 'mysql' )."' ";
|
319 |
-
break;
|
320 |
-
case 'Green v2': //Green v2
|
321 |
-
$sql .= "`before_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-ANSWER-CHECK-INPUT% \r\n %POLL-ANSWER-LABEL%\r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_CONTAINER]\r\n [OTHER_ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-OTHER-ANSWER-CHECK-INPUT% \r\n %POLL-OTHER-ANSWER-LABEL% \r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-OTHER-ANSWER-TEXT-INPUT% \r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/OTHER_ANSWER_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-custom-%POLL-ID%\\".'"'.">\r\n <ul>\r\n [CUSTOM_FIELD_CONTAINER]\r\n <li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>\r\n [/CUSTOM_FIELD_CONTAINER]\r\n </ul>\r\n</div> \r\n[CAPTCHA_CONTAINER]\r\n<div id=\"yop-poll-captcha-%POLL-ID%\">\r\n <div class=\"yop-poll-captcha-image-div\" id=\"yop-poll-captcha-image-div-%POLL-ID%\">\r\n %CAPTCHA-IMAGE%\r\n <div class=\"yop-poll-captcha-helpers-div\" id=\"yop-poll-captcha-helpers-div-%POLL-ID%\">%RELOAD-CAPTCHA-IMAGE% </div>\r\n <div class=\"yop_poll_clear\"></div>\r\n </div>\r\n %CAPTCHA-LABEL%\r\n <div class=\"yop-poll-captcha-input-div\" id=\"yop-poll-captcha-input-div-%POLL-ID%\">%CAPTCHA-INPUT%</div>\r\n</div>\r\n[/CAPTCHA_CONTAINER]\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-VOTE-BUTTON%</div>\r\n <div id=\\".'"'."yop-poll-results-%POLL-ID%\\".'"'.">%POLL-VIEW-RESULT-LINK%</div>\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n</div>',
|
322 |
-
`after_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per-%POLL-ID%\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <div>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </div>\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n <div id=\\".'"'."yop-poll-back-%POLL-ID%\\".'"'.">%POLL-BACK-TO-VOTE-LINK%</div>\r\n</div>',
|
323 |
-
`before_start_date_template` = 'This poll is about to <br>\r\nstart at %POLL-START-DATE%<br>\r\nand finish at %POLL-END-DATE%<br>',
|
324 |
-
`after_end_date_template` = 'This poll is closed!\r\nPoll activity: <br>\r\nstart_date %POLL-START-DATE%<br>\r\nend_date %POLL-END-DATE%<br>\r\n\r\nPoll Results:\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-1\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <span class=\\".'"'."pds-clear\\".'"'." style=\\".'"'."display: block;clear: both;height:1px;line-height:1px;\\".'"'."> </span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n%POLL-VOTE-BUTTON%',
|
325 |
-
`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#fff;\r\n padding:0px;\r\n color:#555;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-weight:bold;\r\n background:#3F8B43;\r\n color:#fff;\r\n padding:5px;\r\n text-align:center;\r\n font-size:12px;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#3F8B43; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#3F8B43; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',
|
326 |
-
`js` = 'function stripBorder_%POLL-ID%(object) {\r\n object.each(function() {\r\n if( parseInt(jQuery(this).width() ) > 0) {\r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."border-left-width\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."border-right-width\\".'"'.")) );\r\n }\r\n else {\r\n jQuery(this).css(\\".'"'."border-left-width\\".'"'.", \'0px\');\r\n jQuery(this).css(\\".'"'."border-right-width\\".'"'.", \'0px\');\r\n }\r\n });\r\n}\r\nfunction stripPadding_%POLL-ID%(object) {\r\n object.each(function() { \r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) );\r\n });\r\n}\r\n\r\nfunction strip_results_%POLL-ID%() {\r\n stripPadding_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%\\".'"'.") ); \r\n stripBorder_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%\\".'"'."));\r\n}\r\n\r\njQuery(document).ready(function(e) {\r\n if(typeof window.strip_results_%POLL-ID% == \'function\') \r\n strip_results_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_answers_%POLL-ID% == \'function\') \r\n tabulate_answers_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_results_%POLL-ID% == \'function\') \r\n tabulate_results_%POLL-ID%();\r\n \r\n});\r\n\r\nfunction equalWidth_%POLL-ID%(obj, cols, findWidest ) {\r\n findWidest = typeof findWidest !== \'undefined\' ? findWidest : false;\r\n if ( findWidest ) {\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n width = parseInt(thisWidth / cols); \r\n jQuery(this).width(width); \r\n jQuery(this).css(\'float\', \'left\'); \r\n });\r\n }\r\n else {\r\n var widest = 0;\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n if(thisWidth > widest) {\r\n widest = thisWidth; \r\n } \r\n });\r\n width = parseInt( widest / cols); \r\n obj.width(width); \r\n obj.css(\'float\', \'left\'); \r\n } \r\n}\r\n\r\nfunction tabulate_answers_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%\\".'"'."), %ANSWERS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %ANSWERS-TABULATED-COLS%, true );\r\n}\r\n\r\nfunction tabulate_results_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%\\".'"'."), %RESULTS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %RESULTS-TABULATED-COLS%, true );\r\n}',
|
327 |
-
`last_modified` = '".current_time( 'mysql' )."' ";
|
328 |
-
break;
|
329 |
-
case 'Green v3': //Green v3
|
330 |
-
$sql .= "`before_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-ANSWER-CHECK-INPUT% \r\n %POLL-ANSWER-LABEL%\r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_CONTAINER]\r\n [OTHER_ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-OTHER-ANSWER-CHECK-INPUT% \r\n %POLL-OTHER-ANSWER-LABEL% \r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-OTHER-ANSWER-TEXT-INPUT% \r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/OTHER_ANSWER_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-custom-%POLL-ID%\\".'"'.">\r\n <ul>\r\n [CUSTOM_FIELD_CONTAINER]\r\n <li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>\r\n [/CUSTOM_FIELD_CONTAINER]\r\n </ul>\r\n</div> \r\n[CAPTCHA_CONTAINER]\r\n<div id=\"yop-poll-captcha-%POLL-ID%\">\r\n <div class=\"yop-poll-captcha-image-div\" id=\"yop-poll-captcha-image-div-%POLL-ID%\">\r\n %CAPTCHA-IMAGE%\r\n <div class=\"yop-poll-captcha-helpers-div\" id=\"yop-poll-captcha-helpers-div-%POLL-ID%\">%RELOAD-CAPTCHA-IMAGE% </div>\r\n <div class=\"yop_poll_clear\"></div>\r\n </div>\r\n %CAPTCHA-LABEL%\r\n <div class=\"yop-poll-captcha-input-div\" id=\"yop-poll-captcha-input-div-%POLL-ID%\">%CAPTCHA-INPUT%</div>\r\n</div>\r\n[/CAPTCHA_CONTAINER]\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-VOTE-BUTTON%</div>\r\n <div id=\\".'"'."yop-poll-results-%POLL-ID%\\".'"'.">%POLL-VIEW-RESULT-LINK%</div>\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n</div>',
|
331 |
-
`after_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per-%POLL-ID%\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <div>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </div>\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n <div id=\\".'"'."yop-poll-back-%POLL-ID%\\".'"'.">%POLL-BACK-TO-VOTE-LINK%</div>\r\n</div>',
|
332 |
-
`before_start_date_template` = 'This poll is about to <br>\r\nstart at %POLL-START-DATE%<br>\r\nand finish at %POLL-END-DATE%<br>',
|
333 |
-
`after_end_date_template` = 'This poll is closed!\r\nPoll activity: <br>\r\nstart_date %POLL-START-DATE%<br>\r\nend_date %POLL-END-DATE%<br>\r\n\r\nPoll Results:\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-1\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <span class=\\".'"'."pds-clear\\".'"'." style=\\".'"'."display: block;clear: both;height:1px;line-height:1px;\\".'"'."> </span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n%POLL-VOTE-BUTTON%',
|
334 |
-
`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#fff;\r\n padding:10px;\r\n color:#555;\r\n overflow:hidden;\r\n font-size:12px;\r\n border:5px solid #3F8B43;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#3F8B43; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#3F8B43; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',
|
335 |
-
`js` = 'function stripBorder_%POLL-ID%(object) {\r\n object.each(function() {\r\n if( parseInt(jQuery(this).width() ) > 0) {\r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."border-left-width\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."border-right-width\\".'"'.")) );\r\n }\r\n else {\r\n jQuery(this).css(\\".'"'."border-left-width\\".'"'.", \'0px\');\r\n jQuery(this).css(\\".'"'."border-right-width\\".'"'.", \'0px\');\r\n }\r\n });\r\n}\r\nfunction stripPadding_%POLL-ID%(object) {\r\n object.each(function() { \r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) );\r\n });\r\n}\r\n\r\nfunction strip_results_%POLL-ID%() {\r\n stripPadding_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%\\".'"'.") ); \r\n stripBorder_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%\\".'"'."));\r\n}\r\n\r\njQuery(document).ready(function(e) {\r\n if(typeof window.strip_results_%POLL-ID% == \'function\') \r\n strip_results_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_answers_%POLL-ID% == \'function\') \r\n tabulate_answers_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_results_%POLL-ID% == \'function\') \r\n tabulate_results_%POLL-ID%();\r\n \r\n});\r\n\r\nfunction equalWidth_%POLL-ID%(obj, cols, findWidest ) {\r\n findWidest = typeof findWidest !== \'undefined\' ? findWidest : false;\r\n if ( findWidest ) {\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n width = parseInt(thisWidth / cols); \r\n jQuery(this).width(width); \r\n jQuery(this).css(\'float\', \'left\'); \r\n });\r\n }\r\n else {\r\n var widest = 0;\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n if(thisWidth > widest) {\r\n widest = thisWidth; \r\n } \r\n });\r\n width = parseInt( widest / cols); \r\n obj.width(width); \r\n obj.css(\'float\', \'left\'); \r\n } \r\n}\r\n\r\nfunction tabulate_answers_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%\\".'"'."), %ANSWERS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %ANSWERS-TABULATED-COLS%, true );\r\n}\r\n\r\nfunction tabulate_results_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%\\".'"'."), %RESULTS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %RESULTS-TABULATED-COLS%, true );\r\n}',
|
336 |
-
`last_modified` = '".current_time( 'mysql' )."' ";
|
337 |
-
break;
|
338 |
-
case 'Orange v1': //Orange v1
|
339 |
-
$sql .= "`before_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-ANSWER-CHECK-INPUT% \r\n %POLL-ANSWER-LABEL%\r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_CONTAINER]\r\n [OTHER_ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-OTHER-ANSWER-CHECK-INPUT% \r\n %POLL-OTHER-ANSWER-LABEL% \r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-OTHER-ANSWER-TEXT-INPUT% \r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/OTHER_ANSWER_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-custom-%POLL-ID%\\".'"'.">\r\n <ul>\r\n [CUSTOM_FIELD_CONTAINER]\r\n <li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>\r\n [/CUSTOM_FIELD_CONTAINER]\r\n </ul>\r\n</div> \r\n[CAPTCHA_CONTAINER]\r\n<div id=\"yop-poll-captcha-%POLL-ID%\">\r\n <div class=\"yop-poll-captcha-image-div\" id=\"yop-poll-captcha-image-div-%POLL-ID%\">\r\n %CAPTCHA-IMAGE%\r\n <div class=\"yop-poll-captcha-helpers-div\" id=\"yop-poll-captcha-helpers-div-%POLL-ID%\">%RELOAD-CAPTCHA-IMAGE% </div>\r\n <div class=\"yop_poll_clear\"></div>\r\n </div>\r\n %CAPTCHA-LABEL%\r\n <div class=\"yop-poll-captcha-input-div\" id=\"yop-poll-captcha-input-div-%POLL-ID%\">%CAPTCHA-INPUT%</div>\r\n</div>\r\n[/CAPTCHA_CONTAINER]\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-VOTE-BUTTON%</div>\r\n <div id=\\".'"'."yop-poll-results-%POLL-ID%\\".'"'.">%POLL-VIEW-RESULT-LINK%</div>\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n</div>',
|
340 |
-
`after_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per-%POLL-ID%\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <div>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </div>\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n <div id=\\".'"'."yop-poll-back-%POLL-ID%\\".'"'.">%POLL-BACK-TO-VOTE-LINK%</div>\r\n</div>',
|
341 |
-
`before_start_date_template` = 'This poll is about to <br>\r\nstart at %POLL-START-DATE%<br>\r\nand finish at %POLL-END-DATE%<br>',
|
342 |
-
`after_end_date_template` = 'This poll is closed!\r\nPoll activity: <br>\r\nstart_date %POLL-START-DATE%<br>\r\nend_date %POLL-END-DATE%<br>\r\n\r\nPoll Results:\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-1\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <span class=\\".'"'."pds-clear\\".'"'." style=\\".'"'."display: block;clear: both;height:1px;line-height:1px;\\".'"'."> </span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n%POLL-VOTE-BUTTON%',
|
343 |
-
`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#FB6911;\r\n padding:10px;\r\n color:#fff;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#fff; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#fff; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',
|
344 |
-
`js` = 'function stripBorder_%POLL-ID%(object) {\r\n object.each(function() {\r\n if( parseInt(jQuery(this).width() ) > 0) {\r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."border-left-width\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."border-right-width\\".'"'.")) );\r\n }\r\n else {\r\n jQuery(this).css(\\".'"'."border-left-width\\".'"'.", \'0px\');\r\n jQuery(this).css(\\".'"'."border-right-width\\".'"'.", \'0px\');\r\n }\r\n });\r\n}\r\nfunction stripPadding_%POLL-ID%(object) {\r\n object.each(function() { \r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) );\r\n });\r\n}\r\n\r\nfunction strip_results_%POLL-ID%() {\r\n stripPadding_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%\\".'"'.") ); \r\n stripBorder_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%\\".'"'."));\r\n}\r\n\r\njQuery(document).ready(function(e) {\r\n if(typeof window.strip_results_%POLL-ID% == \'function\') \r\n strip_results_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_answers_%POLL-ID% == \'function\') \r\n tabulate_answers_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_results_%POLL-ID% == \'function\') \r\n tabulate_results_%POLL-ID%();\r\n \r\n});\r\n\r\nfunction equalWidth_%POLL-ID%(obj, cols, findWidest ) {\r\n findWidest = typeof findWidest !== \'undefined\' ? findWidest : false;\r\n if ( findWidest ) {\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n width = parseInt(thisWidth / cols); \r\n jQuery(this).width(width); \r\n jQuery(this).css(\'float\', \'left\'); \r\n });\r\n }\r\n else {\r\n var widest = 0;\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n if(thisWidth > widest) {\r\n widest = thisWidth; \r\n } \r\n });\r\n width = parseInt( widest / cols); \r\n obj.width(width); \r\n obj.css(\'float\', \'left\'); \r\n } \r\n}\r\n\r\nfunction tabulate_answers_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%\\".'"'."), %ANSWERS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %ANSWERS-TABULATED-COLS%, true );\r\n}\r\n\r\nfunction tabulate_results_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%\\".'"'."), %RESULTS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %RESULTS-TABULATED-COLS%, true );\r\n}',
|
345 |
-
`last_modified` = '".current_time( 'mysql' )."' ";
|
346 |
-
break;
|
347 |
-
case 'Orange v2': //Orange v2
|
348 |
-
$sql .= "`before_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-ANSWER-CHECK-INPUT% \r\n %POLL-ANSWER-LABEL%\r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_CONTAINER]\r\n [OTHER_ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-OTHER-ANSWER-CHECK-INPUT% \r\n %POLL-OTHER-ANSWER-LABEL% \r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-OTHER-ANSWER-TEXT-INPUT% \r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/OTHER_ANSWER_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-custom-%POLL-ID%\\".'"'.">\r\n <ul>\r\n [CUSTOM_FIELD_CONTAINER]\r\n <li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>\r\n [/CUSTOM_FIELD_CONTAINER]\r\n </ul>\r\n</div> \r\n[CAPTCHA_CONTAINER]\r\n<div id=\"yop-poll-captcha-%POLL-ID%\">\r\n <div class=\"yop-poll-captcha-image-div\" id=\"yop-poll-captcha-image-div-%POLL-ID%\">\r\n %CAPTCHA-IMAGE%\r\n <div class=\"yop-poll-captcha-helpers-div\" id=\"yop-poll-captcha-helpers-div-%POLL-ID%\">%RELOAD-CAPTCHA-IMAGE% </div>\r\n <div class=\"yop_poll_clear\"></div>\r\n </div>\r\n %CAPTCHA-LABEL%\r\n <div class=\"yop-poll-captcha-input-div\" id=\"yop-poll-captcha-input-div-%POLL-ID%\">%CAPTCHA-INPUT%</div>\r\n</div>\r\n[/CAPTCHA_CONTAINER]\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-VOTE-BUTTON%</div>\r\n <div id=\\".'"'."yop-poll-results-%POLL-ID%\\".'"'.">%POLL-VIEW-RESULT-LINK%</div>\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n</div>',
|
349 |
-
`after_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per-%POLL-ID%\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <div>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </div>\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n <div id=\\".'"'."yop-poll-back-%POLL-ID%\\".'"'.">%POLL-BACK-TO-VOTE-LINK%</div>\r\n</div>',
|
350 |
-
`before_start_date_template` = 'This poll is about to <br>\r\nstart at %POLL-START-DATE%<br>\r\nand finish at %POLL-END-DATE%<br>',
|
351 |
-
`after_end_date_template` = 'This poll is closed!\r\nPoll activity: <br>\r\nstart_date %POLL-START-DATE%<br>\r\nend_date %POLL-END-DATE%<br>\r\n\r\nPoll Results:\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-1\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <span class=\\".'"'."pds-clear\\".'"'." style=\\".'"'."display: block;clear: both;height:1px;line-height:1px;\\".'"'."> </span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n%POLL-VOTE-BUTTON%',
|
352 |
-
`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#fff;\r\n padding:0px;\r\n color:#555;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-weight:bold;\r\n background:#FB6911;\r\n color:#fff;\r\n padding:5px;\r\n text-align:center;\r\n font-size:12px;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#FB6911; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#FB6911; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',
|
353 |
-
`js` = 'function stripBorder_%POLL-ID%(object) {\r\n object.each(function() {\r\n if( parseInt(jQuery(this).width() ) > 0) {\r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."border-left-width\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."border-right-width\\".'"'.")) );\r\n }\r\n else {\r\n jQuery(this).css(\\".'"'."border-left-width\\".'"'.", \'0px\');\r\n jQuery(this).css(\\".'"'."border-right-width\\".'"'.", \'0px\');\r\n }\r\n });\r\n}\r\nfunction stripPadding_%POLL-ID%(object) {\r\n object.each(function() { \r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) );\r\n });\r\n}\r\n\r\nfunction strip_results_%POLL-ID%() {\r\n stripPadding_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%\\".'"'.") ); \r\n stripBorder_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%\\".'"'."));\r\n}\r\n\r\njQuery(document).ready(function(e) {\r\n if(typeof window.strip_results_%POLL-ID% == \'function\') \r\n strip_results_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_answers_%POLL-ID% == \'function\') \r\n tabulate_answers_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_results_%POLL-ID% == \'function\') \r\n tabulate_results_%POLL-ID%();\r\n \r\n});\r\n\r\nfunction equalWidth_%POLL-ID%(obj, cols, findWidest ) {\r\n findWidest = typeof findWidest !== \'undefined\' ? findWidest : false;\r\n if ( findWidest ) {\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n width = parseInt(thisWidth / cols); \r\n jQuery(this).width(width); \r\n jQuery(this).css(\'float\', \'left\'); \r\n });\r\n }\r\n else {\r\n var widest = 0;\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n if(thisWidth > widest) {\r\n widest = thisWidth; \r\n } \r\n });\r\n width = parseInt( widest / cols); \r\n obj.width(width); \r\n obj.css(\'float\', \'left\'); \r\n } \r\n}\r\n\r\nfunction tabulate_answers_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%\\".'"'."), %ANSWERS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %ANSWERS-TABULATED-COLS%, true );\r\n}\r\n\r\nfunction tabulate_results_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%\\".'"'."), %RESULTS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %RESULTS-TABULATED-COLS%, true );\r\n}',
|
354 |
-
`last_modified` = '".current_time( 'mysql' )."' ";
|
355 |
-
break;
|
356 |
-
case 'Orange v3': //Orange v3
|
357 |
-
$sql .= "`before_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-ANSWER-CHECK-INPUT% \r\n %POLL-ANSWER-LABEL%\r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_CONTAINER]\r\n [OTHER_ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-OTHER-ANSWER-CHECK-INPUT% \r\n %POLL-OTHER-ANSWER-LABEL% \r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-OTHER-ANSWER-TEXT-INPUT% \r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/OTHER_ANSWER_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-custom-%POLL-ID%\\".'"'.">\r\n <ul>\r\n [CUSTOM_FIELD_CONTAINER]\r\n <li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>\r\n [/CUSTOM_FIELD_CONTAINER]\r\n </ul>\r\n</div> \r\n[CAPTCHA_CONTAINER]\r\n<div id=\"yop-poll-captcha-%POLL-ID%\">\r\n <div class=\"yop-poll-captcha-image-div\" id=\"yop-poll-captcha-image-div-%POLL-ID%\">\r\n %CAPTCHA-IMAGE%\r\n <div class=\"yop-poll-captcha-helpers-div\" id=\"yop-poll-captcha-helpers-div-%POLL-ID%\">%RELOAD-CAPTCHA-IMAGE% </div>\r\n <div class=\"yop_poll_clear\"></div>\r\n </div>\r\n %CAPTCHA-LABEL%\r\n <div class=\"yop-poll-captcha-input-div\" id=\"yop-poll-captcha-input-div-%POLL-ID%\">%CAPTCHA-INPUT%</div>\r\n</div>\r\n[/CAPTCHA_CONTAINER]\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-VOTE-BUTTON%</div>\r\n <div id=\\".'"'."yop-poll-results-%POLL-ID%\\".'"'.">%POLL-VIEW-RESULT-LINK%</div>\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n</div>',
|
358 |
-
`after_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per-%POLL-ID%\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <div>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </div>\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n <div id=\\".'"'."yop-poll-back-%POLL-ID%\\".'"'.">%POLL-BACK-TO-VOTE-LINK%</div>\r\n</div>',
|
359 |
-
`before_start_date_template` = 'This poll is about to <br>\r\nstart at %POLL-START-DATE%<br>\r\nand finish at %POLL-END-DATE%<br>',
|
360 |
-
`after_end_date_template` = 'This poll is closed!\r\nPoll activity: <br>\r\nstart_date %POLL-START-DATE%<br>\r\nend_date %POLL-END-DATE%<br>\r\n\r\nPoll Results:\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-1\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <span class=\\".'"'."pds-clear\\".'"'." style=\\".'"'."display: block;clear: both;height:1px;line-height:1px;\\".'"'."> </span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n%POLL-VOTE-BUTTON%',
|
361 |
-
`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#fff;\r\n padding:10px;\r\n color:#555;\r\n overflow:hidden;\r\n font-size:12px;\r\n border:5px solid #FB6911;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#FB6911; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#FB6911; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',
|
362 |
-
`js` = 'function stripBorder_%POLL-ID%(object) {\r\n object.each(function() {\r\n if( parseInt(jQuery(this).width() ) > 0) {\r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."border-left-width\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."border-right-width\\".'"'.")) );\r\n }\r\n else {\r\n jQuery(this).css(\\".'"'."border-left-width\\".'"'.", \'0px\');\r\n jQuery(this).css(\\".'"'."border-right-width\\".'"'.", \'0px\');\r\n }\r\n });\r\n}\r\nfunction stripPadding_%POLL-ID%(object) {\r\n object.each(function() { \r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) );\r\n });\r\n}\r\n\r\nfunction strip_results_%POLL-ID%() {\r\n stripPadding_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%\\".'"'.") ); \r\n stripBorder_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%\\".'"'."));\r\n}\r\n\r\njQuery(document).ready(function(e) {\r\n if(typeof window.strip_results_%POLL-ID% == \'function\') \r\n strip_results_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_answers_%POLL-ID% == \'function\') \r\n tabulate_answers_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_results_%POLL-ID% == \'function\') \r\n tabulate_results_%POLL-ID%();\r\n \r\n});\r\n\r\nfunction equalWidth_%POLL-ID%(obj, cols, findWidest ) {\r\n findWidest = typeof findWidest !== \'undefined\' ? findWidest : false;\r\n if ( findWidest ) {\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n width = parseInt(thisWidth / cols); \r\n jQuery(this).width(width); \r\n jQuery(this).css(\'float\', \'left\'); \r\n });\r\n }\r\n else {\r\n var widest = 0;\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n if(thisWidth > widest) {\r\n widest = thisWidth; \r\n } \r\n });\r\n width = parseInt( widest / cols); \r\n obj.width(width); \r\n obj.css(\'float\', \'left\'); \r\n } \r\n}\r\n\r\nfunction tabulate_answers_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%\\".'"'."), %ANSWERS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %ANSWERS-TABULATED-COLS%, true );\r\n}\r\n\r\nfunction tabulate_results_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%\\".'"'."), %RESULTS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %RESULTS-TABULATED-COLS%, true );\r\n}',
|
363 |
-
`last_modified` = '".current_time( 'mysql' )."' ";
|
364 |
-
break;
|
365 |
}
|
366 |
-
|
367 |
-
$
|
368 |
-
if ( 'White' == $template_name )
|
369 |
-
$sql .= "`status` = 'default', ";
|
370 |
-
else
|
371 |
-
$sql .= "`status` = 'other', ";
|
372 |
-
$sql .= "`date_added` = '".current_time( 'mysql' )."' ";
|
373 |
}
|
374 |
-
else
|
375 |
-
$sql .= $wpdb->prepare( ' WHERE name = %s', $template_name );
|
376 |
-
$wpdb->query( $sql );
|
377 |
-
}
|
378 |
|
379 |
-
|
380 |
-
* Creating polls table
|
381 |
-
* @static
|
382 |
-
*
|
383 |
-
*/
|
384 |
-
public static function create_polls_table() {
|
385 |
-
global $wpdb;
|
386 |
-
$create_poll_table_sql = "CREATE TABLE " . $wpdb->yop_polls . " (
|
387 |
-
id int(11) NOT NULL AUTO_INCREMENT,
|
388 |
-
poll_author bigint(20) NOT NULL DEFAULT '0',
|
389 |
-
name varchar(255) NOT NULL,
|
390 |
-
question text NOT NULL,
|
391 |
-
start_date datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
392 |
-
end_date datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
393 |
-
total_votes int(11) NOT NULL,
|
394 |
-
total_answers int(11) NOT NULL,
|
395 |
-
status varchar(255) NOT NULL,
|
396 |
-
last_modified datetime NOT NULL,
|
397 |
-
date_added datetime NOT NULL,
|
398 |
-
show_in_archive ENUM( 'yes', 'no' ) NOT NULL DEFAULT 'yes',
|
399 |
-
archive_order INT NOT NULL DEFAULT '1',
|
400 |
-
PRIMARY KEY (id)) CHARSET=".self::getCharset()." ;";
|
401 |
-
|
402 |
-
dbDelta( $create_poll_table_sql );
|
403 |
-
}
|
404 |
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
template_author bigint(20) NOT NULL DEFAULT '0',
|
410 |
-
name varchar(255) NOT NULL,
|
411 |
-
before_vote_template text NOT NULL,
|
412 |
-
after_vote_template text NOT NULL,
|
413 |
-
before_start_date_template text NOT NULL,
|
414 |
-
after_end_date_template text NOT NULL,
|
415 |
-
css text NOT NULL,
|
416 |
-
js text NOT NULL,
|
417 |
-
status varchar(255) NOT NULL,
|
418 |
-
last_modified datetime NOT NULL,
|
419 |
-
date_added datetime NOT NULL,
|
420 |
-
PRIMARY KEY (id)) CHARSET=".self::getCharset()." ;";
|
421 |
-
|
422 |
-
dbDelta( $create_poll_table_sql );
|
423 |
-
}
|
424 |
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
poll_id
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
id int(11) NOT NULL AUTO_INCREMENT,
|
454 |
-
poll_id int(11) NOT NULL,
|
455 |
-
custom_field varchar(255) NOT NULL,
|
456 |
-
required ENUM( 'yes', 'no' ) NOT NULL DEFAULT 'no',
|
457 |
-
status varchar(255) NOT NULL,
|
458 |
-
PRIMARY KEY (id),
|
459 |
-
KEY poll_id (poll_id)) CHARSET=".self::getCharset()." ;";
|
460 |
-
|
461 |
-
dbDelta( $create_poll_answers_table_sql );
|
462 |
-
}
|
463 |
|
464 |
-
|
465 |
-
|
466 |
-
* @static
|
467 |
-
*
|
468 |
-
*/
|
469 |
-
public static function create_poll_meta_table() {
|
470 |
-
global $wpdb;
|
471 |
-
$create_poll_meta_table_sql = "CREATE TABLE " . $wpdb->yop_pollmeta . " (
|
472 |
-
meta_id int(11) NOT NULL AUTO_INCREMENT,
|
473 |
-
yop_poll_id int(11) NOT NULL,
|
474 |
-
meta_key varchar(255) NOT NULL,
|
475 |
-
meta_value longtext NOT NULL,
|
476 |
-
PRIMARY KEY (meta_id),
|
477 |
-
KEY yop_poll_id (yop_poll_id)) CHARSET=".self::getCharset()." ;";
|
478 |
-
|
479 |
-
dbDelta( $create_poll_meta_table_sql );
|
480 |
}
|
481 |
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
|
|
498 |
}
|
|
|
|
|
499 |
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
524 |
}
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
542 |
}
|
543 |
|
544 |
-
|
545 |
-
|
546 |
-
* @static
|
547 |
-
*
|
548 |
-
*/
|
549 |
-
public static function create_poll_bans_table() {
|
550 |
-
global $wpdb;
|
551 |
-
$create_poll_bans_table_sql = "CREATE TABLE " . $wpdb->yop_poll_bans . " (
|
552 |
-
id int(11) NOT NULL AUTO_INCREMENT,
|
553 |
-
poll_id int(11) NOT NULL,
|
554 |
-
type varchar(255) NOT NULL,
|
555 |
-
value varchar(255) NOT NULL,
|
556 |
-
PRIMARY KEY (id),
|
557 |
-
KEY poll_id (poll_id)) CHARSET=".self::getCharset()." ;";
|
558 |
-
|
559 |
-
dbDelta( $create_poll_bans_table_sql );
|
560 |
-
}
|
561 |
|
562 |
-
/**
|
563 |
-
* creating poll votes custom_fields
|
564 |
-
* @static
|
565 |
-
*
|
566 |
-
*/
|
567 |
-
public static function create_poll_votes_custom_fields_table() {
|
568 |
-
global $wpdb;
|
569 |
-
$create_poll_votes_custom_fields_table_sql = "CREATE TABLE " . $wpdb->yop_poll_votes_custom_fields . " (
|
570 |
-
id int(11) NOT NULL AUTO_INCREMENT,
|
571 |
-
poll_id int(11) NOT NULL,
|
572 |
-
vote_id varchar(255) NOT NULL,
|
573 |
-
custom_field_id int(11) NOT NULL,
|
574 |
-
user_id int(11) NOT NULL,
|
575 |
-
user_type ENUM( 'facebook', 'wordpress', 'anonymous', 'default' ) NOT NULL DEFAULT 'default',
|
576 |
-
custom_field_value text NOT NULL,
|
577 |
-
tr_id varchar(255) NOT NULL,
|
578 |
-
vote_date datetime NOT NULL,
|
579 |
-
PRIMARY KEY (id),
|
580 |
-
KEY poll_id (poll_id)) CHARSET=".self::getCharset()." ;";
|
581 |
-
|
582 |
-
dbDelta( $create_poll_votes_custom_fields_table_sql );
|
583 |
-
}
|
584 |
|
585 |
-
/**
|
586 |
-
* Creating polls table
|
587 |
-
* @static
|
588 |
-
*
|
589 |
-
*/
|
590 |
-
public static function create_poll_facebook_users_table() {
|
591 |
-
global $wpdb;
|
592 |
-
$create_poll_table_sql = "CREATE TABLE " . $wpdb->yop_poll_facebook_users . " (
|
593 |
-
id int(11) NOT NULL AUTO_INCREMENT,
|
594 |
-
fb_id varchar(255) NOT NULL,
|
595 |
-
name varchar(255) NOT NULL,
|
596 |
-
first_name varchar(255) NOT NULL,
|
597 |
-
last_name varchar(255) NOT NULL,
|
598 |
-
username varchar(255) NOT NULL,
|
599 |
-
email varchar(255) NOT NULL,
|
600 |
-
gender varchar(255) NOT NULL,
|
601 |
-
date_added datetime NOT NULL,
|
602 |
-
PRIMARY KEY (id)) CHARSET=".self::getCharset()." ;";
|
603 |
-
|
604 |
-
dbDelta( $create_poll_table_sql );
|
605 |
-
}
|
606 |
|
607 |
-
|
608 |
-
|
609 |
-
|
|
|
610 |
else
|
611 |
-
|
|
|
612 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
613 |
}
|
1 |
<?php
|
2 |
class Yop_Poll_DbSchema
|
3 |
{
|
4 |
+
/**
|
5 |
+
* creating all poll tables
|
6 |
+
* @static
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
public static function create_poll_database_tables() {
|
10 |
+
global $wpdb;
|
11 |
+
global $current_user;
|
12 |
+
|
13 |
+
Yop_Poll_DbSchema::create_polls_table();
|
14 |
+
Yop_Poll_DbSchema::create_polls_templates_table();
|
15 |
+
Yop_Poll_DbSchema::create_poll_answers_table();
|
16 |
+
Yop_Poll_DbSchema::create_poll_custom_fields_table();
|
17 |
+
Yop_Poll_DbSchema::create_poll_meta_table();
|
18 |
+
Yop_Poll_DbSchema::create_poll_answer_meta_table();
|
19 |
+
Yop_Poll_DbSchema::create_poll_logs_table();
|
20 |
+
Yop_Poll_DbSchema::create_poll_voters_table();
|
21 |
+
Yop_Poll_DbSchema::create_poll_bans_table();
|
22 |
+
Yop_Poll_DbSchema::create_poll_votes_custom_fields_table();
|
23 |
+
Yop_Poll_DbSchema::create_poll_facebook_users_table();
|
24 |
+
|
25 |
+
$optin_box_modal_options = array(
|
26 |
+
'show' => 'yes',
|
27 |
+
'last_show_date' => Yop_Poll_Model::get_mysql_curent_date(),
|
28 |
+
'modal_had_submit' => 'no',
|
29 |
+
'sidebar_had_submit' => 'no',
|
30 |
+
);
|
31 |
+
|
32 |
+
$pro_options = array(
|
33 |
+
'pro_key' => '',
|
34 |
+
'pro_api_key' => '',
|
35 |
+
'pro_api_server_url' => 'http://www.yop-poll.com/pro',
|
36 |
+
'pro_user' => 'no'
|
37 |
+
);
|
38 |
+
|
39 |
+
$sitename = strtolower( $_SERVER['SERVER_NAME'] );
|
40 |
+
if ( substr( $sitename, 0, 4 ) == 'www.' ) {
|
41 |
+
$sitename = substr( $sitename, 4 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
}
|
43 |
|
44 |
+
$default_options = array(
|
45 |
+
'poll_name_html_tags' => 'yes',
|
46 |
+
'poll_question_html_tags' => 'yes',
|
47 |
+
'poll_answer_html_tags' => 'yes',
|
48 |
+
'poll_custom_field_html_tags' => 'yes',
|
49 |
+
'create_poll_page' => 'yes',
|
50 |
+
'auto_generate_poll_page' => 'no',
|
51 |
+
'has_auto_generate_poll_page' => 'no',
|
52 |
+
'poll_page_url' => '',
|
53 |
+
'allow_other_answers' => 'yes',
|
54 |
+
'other_answers_label' => 'Other',
|
55 |
+
'display_other_answers_values' => 'no',
|
56 |
+
'allow_multiple_answers' => 'no',
|
57 |
+
'allow_multiple_answers_number' => 1,
|
58 |
+
'allow_multiple_answers_min_number' => 1,
|
59 |
+
'display_answers' => 'vertical',
|
60 |
+
'display_answers_tabulated_cols' => 1,
|
61 |
+
'display_results' => 'vertical',
|
62 |
+
'display_results_tabulated_cols' => 1,
|
63 |
+
'is_default_answer' => 'no',
|
64 |
+
'use_template_bar' => 'yes',
|
65 |
+
'bar_background' => 'FBD55E',
|
66 |
+
'bar_height' => 10,
|
67 |
+
'bar_border_color' => 'EDB918',
|
68 |
+
'bar_border_width' => 1,
|
69 |
+
'bar_border_style' => 'solid',
|
70 |
+
'sorting_answers' => 'exact',
|
71 |
+
'sorting_answers_direction' => 'asc',
|
72 |
+
'sorting_results' => 'exact',
|
73 |
+
'sorting_results_direction' => 'asc',
|
74 |
+
'start_date' => Yop_Poll_Model::get_mysql_curent_date(),
|
75 |
+
'end_date' => '9999-12-31 23:59:59',
|
76 |
+
'never_expire' => 'yes',
|
77 |
+
'view_results' => 'after',
|
78 |
+
'answer_result_label' => '- %POLL-ANSWER-RESULT-PERCENTAGES% ( %POLL-ANSWER-RESULT-VOTES% )',
|
79 |
+
'view_results_type' => 'votes-number',
|
80 |
+
'view_results_start_date' => '',
|
81 |
+
'view_results_link' => 'yes',
|
82 |
+
'view_back_to_vote_link' => 'yes',
|
83 |
+
'singular_answer_result_votes_number_label' => 'vote',
|
84 |
+
'plural_answer_result_votes_number_label' => 'votes',
|
85 |
+
'vote_button_label' => 'Vote',
|
86 |
+
'view_results_link_label' => 'View Results',
|
87 |
+
'view_back_to_vote_link_label' => 'Back To Vote',
|
88 |
+
'view_total_votes_label' => 'Total Votes %POLL-TOTAL-VOTES%',
|
89 |
+
'view_total_answers_label' => 'Total Answers %POLL-TOTAL-ANSWERS%',
|
90 |
+
'view_total_voters_label' => 'Total Answers %POLL-TOTAL-VOTERS%',
|
91 |
+
'view_total_answers' => 'yes',
|
92 |
+
'view_total_voters' => 'yes',
|
93 |
+
'view_total_votes' => 'yes',
|
94 |
+
'view_poll_archive_link' => 'yes',
|
95 |
+
'view_poll_archive_link_label' => 'View Poll Archive',
|
96 |
+
'poll_archive_url' => home_url().'/yop-poll-archive',
|
97 |
+
'vote_permisions' => 'guest-registered',
|
98 |
+
'vote_permisions_facebook' => 'no',
|
99 |
+
'vote_permisions_facebook_label' => 'Vote as Facebook User',
|
100 |
+
'vote_permisions_wordpress' => 'no',
|
101 |
+
'vote_permisions_wordpress_label' => 'Vote as Wordpress User',
|
102 |
+
'vote_permisions_anonymous' => 'no',
|
103 |
+
'vote_permisions_anonymous_label' => 'Vote as Anonymous User',
|
104 |
+
'blocking_voters' => 'dont-block',
|
105 |
+
'blocking_voters_interval_value' => 30,
|
106 |
+
'blocking_voters_interval_unit' => 'days',
|
107 |
+
'template' => '1',
|
108 |
+
'widget_template' => '1',
|
109 |
+
'template_width' => '200px',
|
110 |
+
'widget_template_width' => '200px',
|
111 |
+
'show_in_archive' => 'yes',
|
112 |
+
'archive_order' => '1',
|
113 |
+
'archive_polls_per_page' => '5',
|
114 |
+
'percentages_decimals' => '0',
|
115 |
+
'use_default_loading_image' => 'yes',
|
116 |
+
'loading_image_url' => '',
|
117 |
+
'use_captcha' => 'no',
|
118 |
+
'share_after_vote' => 'no',
|
119 |
+
'share_picture' => '',
|
120 |
+
'share_name' => '',
|
121 |
+
'share_caption' => '',
|
122 |
+
'share_description' => '',
|
123 |
+
'redirect_after_vote' => 'no',
|
124 |
+
'redirect_after_vote_url' => '',
|
125 |
+
'limit_number_of_votes_per_user' => 'no',
|
126 |
+
'number_of_votes_per_user' => 1,
|
127 |
+
'message_after_vote' => 'Thank you for your vote!',
|
128 |
+
'start_scheduler' => 'no',
|
129 |
+
'schedule_reset_poll_stats' => 'no',
|
130 |
+
'schedule_reset_poll_date' => current_time( 'timestamp' ),
|
131 |
+
'schedule_reset_poll_recurring_value' => 9999,
|
132 |
+
'schedule_reset_poll_recurring_unit' => 'day',
|
133 |
+
'view_results_permissions' => 'guest-registered',
|
134 |
+
'date_format' => 'd/m/Y H:i:s',
|
135 |
+
'add_other_answers_to_default_answers' => 'no',
|
136 |
+
'send_email_notifications' => 'no',
|
137 |
+
'email_notifications_from_name' => 'Yop Poll',
|
138 |
+
'email_notifications_from_email' => 'yop-poll@' . $sitename,
|
139 |
+
'email_notifications_recipients' => '',
|
140 |
+
'email_notifications_subject' => 'New Vote',
|
141 |
+
'email_notifications_body' => '<p>A new vote was registered on [VOTE_DATE] for [POLL_NAME]</p>
|
142 |
+
<p>Vote Details:</p>
|
143 |
+
<p><b>Question:</b> [QUESTION]</p>
|
144 |
+
<p><b>Answers:</b> <br />[ANSWERS]</p>
|
145 |
+
<p><b>Custom Fields:</b> <br />[CUSTOM_FIELDS]</p>
|
146 |
+
<p><b>Vote ID:</b> <br />[VOTE_ID]</p>',
|
147 |
+
);
|
148 |
+
|
149 |
+
if ( ! get_option( "yop_poll_version" ) ) {
|
150 |
+
|
151 |
+
$poll_archive_page = get_page_by_path('yop-poll-archive', ARRAY_A );
|
152 |
+
if ( ! $poll_archive_page ) {
|
153 |
+
$_p = array();
|
154 |
+
$_p['post_title'] = 'Yop Poll Archive';
|
155 |
+
$_p['post_content'] = "[yop_poll_archive]";
|
156 |
+
$_p['post_status'] = 'publish';
|
157 |
+
$_p['post_type'] = 'page';
|
158 |
+
$_p['comment_status'] = 'open';
|
159 |
+
$_p['ping_status'] = 'open';
|
160 |
+
$_p['post_category'] = array(1); // the default 'Uncategorised'
|
161 |
+
|
162 |
+
$poll_archive_page_id = wp_insert_post( $_p );
|
163 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
}
|
165 |
+
else {
|
166 |
+
$poll_archive_page_id = $poll_archive_page['ID'];
|
|
|
|
|
|
|
|
|
|
|
167 |
}
|
|
|
|
|
|
|
|
|
168 |
|
169 |
+
$default_options['poll_archive_url'] = get_permalink( $poll_archive_page_id );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
|
171 |
+
//addind default options
|
172 |
+
update_option( 'yop_poll_options', $default_options );
|
173 |
+
update_option( 'yop_poll_optin_box_modal_options', $optin_box_modal_options );
|
174 |
+
update_option( 'yop_poll_pro_options', $pro_options );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
|
176 |
+
wp_get_current_user();
|
177 |
+
//adding default poll
|
178 |
+
$poll_author = $current_user->ID > 0 ? $current_user->ID : 0;
|
179 |
+
$wpdb->query(
|
180 |
+
"
|
181 |
+
INSERT INTO `". $wpdb->yop_polls . "` (`poll_author`, `name`, `question`, `start_date`, `end_date`, `total_votes`, `total_answers`, `status`, `date_added`, `last_modified`, `show_in_archive`) VALUES
|
182 |
+
(". $poll_author .", 'Default Yop Poll', 'How is my plugin?', '".current_time( 'mysql' )."', '9999-12-31 23:59:59', 0, 0, 'open', '".current_time( 'mysql' )."', '".current_time( 'mysql' )."', '".$default_options['show_in_archive']."')
|
183 |
+
"
|
184 |
+
);
|
185 |
+
$poll_id = $wpdb->insert_id;
|
186 |
+
$wpdb->query(
|
187 |
+
"
|
188 |
+
INSERT INTO `". $wpdb->yop_poll_answers . "` (`poll_id`, `answer`, `type`, `votes`, `status`) VALUES
|
189 |
+
(" . $poll_id . ", 'Good', 'default', 0, 'active'),
|
190 |
+
(" . $poll_id . ", 'Very Good', 'default', 0, 'active'),
|
191 |
+
(" . $poll_id . ", 'Bad', 'default', 0, 'active'),
|
192 |
+
(" . $poll_id . ", 'Other', 'other', 0, 'active')
|
193 |
+
"
|
194 |
+
);
|
195 |
|
196 |
+
$templates = array( 'White', 'Grey', 'Dark', 'Blue v1', 'Blue v2', 'Blue v3', 'Red v1', 'Red v2', 'Red v3', 'Green v1', 'Green v2', 'Green v3', 'Orange v1', 'Orange v2', 'Orange v3' );
|
197 |
+
foreach( $templates as $template ) {
|
198 |
+
$is_template_in_database = self::is_template_in_database( $template );
|
199 |
+
if ( $is_template_in_database )
|
200 |
+
self::add_update_templates_in_database( 'update', $template );
|
201 |
+
else
|
202 |
+
self::add_update_templates_in_database( 'add', $template );
|
203 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
204 |
|
205 |
+
update_option( "yop_poll_first_install_date", Yop_Poll_Model::get_mysql_curent_date() );
|
206 |
+
update_option( "yop_poll_admin_notices_donate", 'yes' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
207 |
}
|
208 |
|
209 |
+
update_option( "yop_poll_version", $wpdb->yop_poll_version );
|
210 |
+
}
|
211 |
+
|
212 |
+
public static function is_template_in_database( $template_name ) {
|
213 |
+
global $wpdb;
|
214 |
+
$is_template = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM ". $wpdb->yop_poll_templates . " WHERE name = %s LIMIT 0, 1", $template_name ) );
|
215 |
+
return $is_template;
|
216 |
+
}
|
217 |
+
|
218 |
+
public static function add_update_templates_in_database( $action = 'add', $template_name ) {
|
219 |
+
global $wpdb;
|
220 |
+
global $current_user;
|
221 |
+
wp_get_current_user();
|
222 |
+
if ( 'add' == $action ) {
|
223 |
+
$sql = "INSERT INTO `" . $wpdb->yop_poll_templates . "` SET ";
|
224 |
+
$sql .= $wpdb ->prepare( "`name` = %s, ", $template_name );
|
225 |
+
$sql .= $wpdb ->prepare( "`template_author` = %d, ", ( $current_user->ID > 0 ) ? $current_user->ID : 0 );
|
226 |
}
|
227 |
+
else
|
228 |
+
$sql = "UPDATE `" . $wpdb->yop_poll_templates . "` SET ";
|
229 |
|
230 |
+
$before_vote_template = <<<NOWDOC
|
231 |
+
<div id="yop-poll-name-%POLL-ID%" class="yop-poll-name">%POLL-NAME%</div>
|
232 |
+
<div id="yop-poll-question-%POLL-ID%" class="yop-poll-question">%POLL-QUESTION%</div>
|
233 |
+
<div id="yop-poll-answers-%POLL-ID%" class="yop-poll-answers">
|
234 |
+
<ul>
|
235 |
+
[ANSWER_CONTAINER]
|
236 |
+
<li class="yop-poll-li-answer-%POLL-ID%">
|
237 |
+
%POLL-ANSWER-CHECK-INPUT%
|
238 |
+
%POLL-ANSWER-LABEL%
|
239 |
+
<span class="yop-poll-results-text-%POLL-ID%">%POLL-ANSWER-RESULT-LABEL%</span>
|
240 |
+
%POLL-ANSWER-RESULT-BAR%
|
241 |
+
</li>
|
242 |
+
[/ANSWER_CONTAINER]
|
243 |
+
[OTHER_ANSWER_CONTAINER]
|
244 |
+
<li class="yop-poll-li-answer-%POLL-ID%">
|
245 |
+
%POLL-OTHER-ANSWER-CHECK-INPUT%
|
246 |
+
%POLL-OTHER-ANSWER-LABEL%
|
247 |
+
<span class="yop-poll-results-text-%POLL-ID%">%POLL-ANSWER-RESULT-LABEL%</span>
|
248 |
+
%POLL-OTHER-ANSWER-TEXT-INPUT%
|
249 |
+
%POLL-ANSWER-RESULT-BAR%
|
250 |
+
</li>
|
251 |
+
[/OTHER_ANSWER_CONTAINER]
|
252 |
+
</ul>
|
253 |
+
</div>
|
254 |
+
<div id="yop-poll-custom-%POLL-ID%">
|
255 |
+
<ul>
|
256 |
+
[CUSTOM_FIELD_CONTAINER]
|
257 |
+
<li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>
|
258 |
+
[/CUSTOM_FIELD_CONTAINER]
|
259 |
+
</ul>
|
260 |
+
</div>
|
261 |
+
[CAPTCHA_CONTAINER]
|
262 |
+
<div id="yop-poll-captcha-%POLL-ID%">
|
263 |
+
<div class="yop-poll-captcha-image-div" id="yop-poll-captcha-image-div-%POLL-ID%">
|
264 |
+
%CAPTCHA-IMAGE%
|
265 |
+
<div class="yop-poll-captcha-helpers-div" id="yop-poll-captcha-helpers-div-%POLL-ID%">
|
266 |
+
%RELOAD-CAPTCHA-IMAGE%
|
267 |
+
</div>
|
268 |
+
<div class="yop_poll_clear"></div>
|
269 |
+
</div>
|
270 |
+
%CAPTCHA-LABEL%
|
271 |
+
<div class="yop-poll-captcha-input-div" id="yop-poll-captcha-input-div-%POLL-ID%">%CAPTCHA-INPUT%</div>
|
272 |
+
</div>
|
273 |
+
[/CAPTCHA_CONTAINER]
|
274 |
+
<div id="yop-poll-vote-%POLL-ID%" class="yop-poll-footer">
|
275 |
+
<div>%POLL-VOTE-BUTTON%</div>
|
276 |
+
<div id="yop-poll-results-%POLL-ID%">%POLL-VIEW-RESULT-LINK%</div>
|
277 |
+
<div>%POLL-TOTAL-ANSWERS%</div> <div>%POLL-TOTAL-VOTES%</div>
|
278 |
+
</div>
|
279 |
+
NOWDOC;
|
280 |
+
$before_vote_template = addslashes($before_vote_template);
|
281 |
+
|
282 |
+
$after_vote_template = <<<NOWDOC
|
283 |
+
<div id="yop-poll-name-%POLL-ID%" class="yop-poll-name">%POLL-NAME%</div>
|
284 |
+
<div id="yop-poll-question-%POLL-ID%" class="yop-poll-question">%POLL-QUESTION%</div>
|
285 |
+
<div id="yop-poll-answers-%POLL-ID%" class="yop-poll-answers">
|
286 |
+
<ul>
|
287 |
+
[ANSWER_RESULT_CONTAINER]
|
288 |
+
<li class="yop-poll-li-result-%POLL-ID%">
|
289 |
+
<label class="pds-feedback-label-%POLL-ID%">
|
290 |
+
<span class="pds-answer-text-%POLL-ID%">%POLL-ANSWER-LABEL%</span>
|
291 |
+
<span class="pds-feedback-result-%POLL-ID%">
|
292 |
+
<span class="pds-feedback-per-%POLL-ID%"> %POLL-ANSWER-RESULT-LABEL%</span>
|
293 |
+
</span>
|
294 |
+
</label>
|
295 |
+
<div>
|
296 |
+
%POLL-ANSWER-RESULT-BAR%
|
297 |
+
</div>
|
298 |
+
</li>
|
299 |
+
[/ANSWER_RESULT_CONTAINER]
|
300 |
+
</ul>
|
301 |
+
</div>
|
302 |
+
<div id="yop-poll-vote-%POLL-ID%" class="yop-poll-footer">
|
303 |
+
<div>%POLL-TOTAL-ANSWERS%</div>
|
304 |
+
<div>%POLL-TOTAL-VOTES%</div>
|
305 |
+
<div id="yop-poll-back-%POLL-ID%">%POLL-BACK-TO-VOTE-LINK%</div>
|
306 |
+
</div>
|
307 |
+
NOWDOC;
|
308 |
+
$after_vote_template = addslashes($after_vote_template);
|
309 |
+
|
310 |
+
$before_start_date_template = <<<NOWDOC
|
311 |
+
This poll is about to<br>
|
312 |
+
start at %POLL-START-DATE%<br>
|
313 |
+
and finish at %POLL-END-DATE%<br>
|
314 |
+
NOWDOC;
|
315 |
+
$before_start_date_template = addslashes($before_start_date_template);
|
316 |
+
|
317 |
+
$after_end_date_template = <<<NOWDOC
|
318 |
+
This poll is closed!
|
319 |
+
Poll activity: <br>
|
320 |
+
start_date %POLL-START-DATE%<br>
|
321 |
+
end_date %POLL-END-DATE%<br>
|
322 |
+
|
323 |
+
Poll Results:
|
324 |
+
<div id="yop-poll-question-%POLL-ID%" class="yop-poll-question">%POLL-QUESTION%</div>
|
325 |
+
<div id="yop-poll-answers-1" class="yop-poll-answers">
|
326 |
+
<ul>
|
327 |
+
[ANSWER_RESULT_CONTAINER]
|
328 |
+
<li class="yop-poll-li-result-%POLL-ID%">
|
329 |
+
<label class="pds-feedback-label">
|
330 |
+
<span class="pds-answer-text">%POLL-ANSWER-LABEL%</span>
|
331 |
+
<span class="pds-feedback-result">
|
332 |
+
<span class="pds-feedback-per"> %POLL-ANSWER-RESULT-LABEL%</span>
|
333 |
+
</span>
|
334 |
+
</label>
|
335 |
+
<span class="pds-clear" style="display: block;clear: both;height:1px;line-height:1px;"> </span>
|
336 |
+
%POLL-ANSWER-RESULT-BAR%
|
337 |
+
</li>
|
338 |
+
[/ANSWER_RESULT_CONTAINER]
|
339 |
+
</ul>
|
340 |
+
</div>
|
341 |
+
%POLL-VOTE-BUTTON%
|
342 |
+
NOWDOC;
|
343 |
+
$after_end_date_template = addslashes($after_end_date_template);
|
344 |
+
|
345 |
+
$js = <<<NOWDOC
|
346 |
+
function stripBorder_%POLL-ID%(object) {
|
347 |
+
object.each(function() {
|
348 |
+
if( parseInt(jQuery(this).width() ) > 0) {
|
349 |
+
jQuery(this).width(
|
350 |
+
parseInt(
|
351 |
+
jQuery(this).width() ) -
|
352 |
+
parseInt(jQuery(this).css("border-left-width")) -
|
353 |
+
parseInt(jQuery(this).css("border-right-width"))
|
354 |
+
);
|
355 |
+
}
|
356 |
+
else {
|
357 |
+
jQuery(this).css("border-left-width", "0px");
|
358 |
+
jQuery(this).css("border-right-width", "0px");
|
359 |
}
|
360 |
+
});
|
361 |
+
}
|
362 |
+
function stripPadding_%POLL-ID%(object) {
|
363 |
+
object.each(function() {
|
364 |
+
jQuery(this).width(
|
365 |
+
parseInt( jQuery(this).width() ) -
|
366 |
+
parseInt(jQuery(this).css("padding-left")) -
|
367 |
+
parseInt(jQuery(this).css("padding-left"))
|
368 |
+
);
|
369 |
+
});
|
370 |
+
}
|
371 |
+
|
372 |
+
function strip_results_%POLL-ID%() {
|
373 |
+
stripPadding_%POLL-ID%( jQuery("#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%") );
|
374 |
+
stripBorder_%POLL-ID%( jQuery("#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%") );
|
375 |
+
}
|
376 |
+
|
377 |
+
jQuery(document).ready(function(e) {
|
378 |
+
if(typeof window.strip_results_%POLL-ID% == "function")
|
379 |
+
strip_results_%POLL-ID%();
|
380 |
+
if(typeof window.tabulate_answers_%POLL-ID% == "function")
|
381 |
+
tabulate_answers_%POLL-ID%();
|
382 |
+
if(typeof window.tabulate_results_%POLL-ID% == "function")
|
383 |
+
tabulate_results_%POLL-ID%();
|
384 |
+
});
|
385 |
+
|
386 |
+
function equalWidth_%POLL-ID%(obj, cols, findWidest ) {
|
387 |
+
findWidest = typeof findWidest !== "undefined" ? findWidest : false;
|
388 |
+
if ( findWidest ) {
|
389 |
+
obj.each(function() {
|
390 |
+
var thisWidth = jQuery(this).width();
|
391 |
+
width = parseInt(thisWidth / cols);
|
392 |
+
jQuery(this).width(width);
|
393 |
+
jQuery(this).css("float", "left");
|
394 |
+
});
|
395 |
+
}
|
396 |
+
else {
|
397 |
+
var widest = 0;
|
398 |
+
obj.each(function() {
|
399 |
+
var thisWidth = jQuery(this).width();
|
400 |
+
if(thisWidth > widest) {
|
401 |
+
widest = thisWidth;
|
402 |
+
}
|
403 |
+
});
|
404 |
+
width = parseInt( widest / cols);
|
405 |
+
obj.width(width);
|
406 |
+
obj.css("float", "left");
|
407 |
+
}
|
408 |
+
}
|
409 |
+
|
410 |
+
function tabulate_answers_%POLL-ID%() {
|
411 |
+
equalWidth_%POLL-ID%( jQuery("#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%"), %ANSWERS-TABULATED-COLS% );
|
412 |
+
//equalWidth_%POLL-ID%( jQuery(\"#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \"), %ANSWERS-TABULATED-COLS%, true );
|
413 |
+
}
|
414 |
+
|
415 |
+
function tabulate_results_%POLL-ID%() {
|
416 |
+
equalWidth_%POLL-ID%( jQuery("#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%"), %RESULTS-TABULATED-COLS% );
|
417 |
+
//equalWidth_%POLL-ID%( jQuery(\"#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \"), %RESULTS-TABULATED-COLS%, true );
|
418 |
+
}
|
419 |
+
|
420 |
+
jQuery(document).ready(function(){
|
421 |
+
runOnPollStateChange_%POLL-ID%();
|
422 |
+
});
|
423 |
+
|
424 |
+
function runOnPollStateChange_%POLL-ID%() {
|
425 |
+
|
426 |
+
};
|
427 |
+
NOWDOC;
|
428 |
+
$js = addslashes($js);
|
429 |
+
|
430 |
+
$sql .= "`before_vote_template` = '$before_vote_template',
|
431 |
+
`after_vote_template` = '$after_vote_template',
|
432 |
+
`before_start_date_template` = '$before_start_date_template',
|
433 |
+
`after_end_date_template` = '$after_end_date_template',";
|
434 |
+
|
435 |
+
switch ( $template_name ) {
|
436 |
+
case 'White': { //White
|
437 |
+
$sql .= "`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#fff;\r\n padding:10px;\r\n color:#555;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#555; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#555; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',";
|
438 |
+
break;
|
439 |
+
}
|
440 |
+
case 'Grey': {//Grey
|
441 |
+
$sql .= "`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#eee;\r\n padding:10px;\r\n color:#000;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#000; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#000; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',";
|
442 |
+
break;
|
443 |
+
}
|
444 |
+
case 'Dark': { //Dark
|
445 |
+
$sql .= "`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#555;\r\n padding:10px;\r\n color:#fff;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#333333; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#fff; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#fff; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',";
|
446 |
+
break;
|
447 |
+
}
|
448 |
+
case 'Blue v1': {//Blue v1
|
449 |
+
$sql .= "`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#327BD6;\r\n padding:10px;\r\n color:#fff;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#fff; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#fff; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',";
|
450 |
+
break;
|
451 |
+
}
|
452 |
+
case 'Blue v2': {//Blue v2
|
453 |
+
$sql .= "`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#fff;\r\n padding:0px;\r\n color:#555;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-weight:bold;\r\n background:#327BD6;\r\n color:#fff;\r\n padding:5px;\r\n text-align:center;\r\n font-size:12px;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#327BD6; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#327BD6; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',";
|
454 |
+
break;
|
455 |
+
}
|
456 |
+
case 'Blue v3': {//Blue v3
|
457 |
+
$sql .= "`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#fff;\r\n padding:10px;\r\n color:#555;\r\n overflow:hidden;\r\n font-size:12px;\r\n border:5px solid #327BD6;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#327BD6; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#327BD6; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',";
|
458 |
+
break;
|
459 |
+
}
|
460 |
+
case 'Red v1': { //Red v1
|
461 |
+
$sql .= "`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#B70004;\r\n padding:10px;\r\n color:#fff;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#fff; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#fff; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',";
|
462 |
+
break;
|
463 |
+
}
|
464 |
+
case 'Red v2': {//Red v2
|
465 |
+
$sql .= "`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#fff;\r\n padding:0px;\r\n color:#555;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-weight:bold;\r\n background:#B70004;\r\n color:#fff;\r\n padding:5px;\r\n text-align:center;\r\n font-size:12px;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#B70004; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#B70004; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',";
|
466 |
+
break;
|
467 |
+
}
|
468 |
+
case 'Red v3': {//Red v3
|
469 |
+
$sql .= "`css`= '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#fff;\r\n padding:10px;\r\n color:#555;\r\n overflow:hidden;\r\n font-size:12px;\r\n border:5px solid #B70004;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#B70004; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#B70004; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',";
|
470 |
+
break;
|
471 |
+
}
|
472 |
+
case 'Green v1': { //Green v1
|
473 |
+
$sql .= "`css`= '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#3F8B43;\r\n padding:10px;\r\n color:#fff;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#fff; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#fff; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:00FF00;\r\n}',";
|
474 |
+
break;
|
475 |
+
}
|
476 |
+
case 'Green v2': { //Green v2
|
477 |
+
$sql .= "`css`= '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#fff;\r\n padding:0px;\r\n color:#555;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-weight:bold;\r\n background:#3F8B43;\r\n color:#fff;\r\n padding:5px;\r\n text-align:center;\r\n font-size:12px;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#3F8B43; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#3F8B43; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',";
|
478 |
+
break;
|
479 |
+
}
|
480 |
+
case 'Green v3': { //Green v3
|
481 |
+
$sql .= "`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#fff;\r\n padding:10px;\r\n color:#555;\r\n overflow:hidden;\r\n font-size:12px;\r\n border:5px solid #3F8B43;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#3F8B43; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#3F8B43; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n} \r\n jQuery(document).ready(function(){ \r\n runOnPollStateChange_%POLL-ID%(); \r\n }); \r\n function runOnPollStateChange_%POLL-ID%() {};',";
|
482 |
+
break;
|
483 |
+
}
|
484 |
+
case 'Orange v1':{ //Orange v1
|
485 |
+
$sql .= "`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#FB6911;\r\n padding:10px;\r\n color:#fff;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#fff; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#fff; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',";
|
486 |
+
break;
|
487 |
+
}
|
488 |
+
case 'Orange v2':{ //Orange v2
|
489 |
+
$sql .= "`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#fff;\r\n padding:0px;\r\n color:#555;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-weight:bold;\r\n background:#FB6911;\r\n color:#fff;\r\n padding:5px;\r\n text-align:center;\r\n font-size:12px;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#FB6911; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#FB6911; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',";
|
490 |
+
break;
|
491 |
+
}
|
492 |
+
case 'Orange v3':{ //Orange v3
|
493 |
+
$sql .= "`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#fff;\r\n padding:10px;\r\n color:#555;\r\n overflow:hidden;\r\n font-size:12px;\r\n border:5px solid #FB6911;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#FB6911; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#FB6911; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',";
|
494 |
+
break;
|
495 |
+
}
|
496 |
}
|
497 |
|
498 |
+
$sql .= "`js` = '$js',
|
499 |
+
`last_modified` = '".current_time( 'mysql' )."'";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
500 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
501 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
502 |
|
503 |
+
if ( 'add' == $action ) {
|
504 |
+
$sql .= ", ";
|
505 |
+
if ( 'White' == $template_name )
|
506 |
+
$sql .= "`status` = 'default', ";
|
507 |
else
|
508 |
+
$sql .= "`status` = 'other', ";
|
509 |
+
$sql .= "`date_added` = '".current_time( 'mysql' )."' ";
|
510 |
}
|
511 |
+
else
|
512 |
+
$sql .= $wpdb->prepare( ' WHERE name = %s', $template_name );
|
513 |
+
|
514 |
+
$wpdb->query( $sql );
|
515 |
+
}
|
516 |
+
|
517 |
+
/**
|
518 |
+
* Creating polls table
|
519 |
+
* @static
|
520 |
+
*
|
521 |
+
*/
|
522 |
+
public static function create_polls_table() {
|
523 |
+
global $wpdb;
|
524 |
+
$create_poll_table_sql = "CREATE TABLE " . $wpdb->yop_polls . " (
|
525 |
+
id int(11) NOT NULL AUTO_INCREMENT,
|
526 |
+
poll_author bigint(20) NOT NULL DEFAULT '0',
|
527 |
+
name varchar(255) NOT NULL,
|
528 |
+
question text NOT NULL,
|
529 |
+
start_date datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
530 |
+
end_date datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
531 |
+
total_votes int(11) NOT NULL,
|
532 |
+
total_answers int(11) NOT NULL,
|
533 |
+
status varchar(255) NOT NULL,
|
534 |
+
last_modified datetime NOT NULL,
|
535 |
+
date_added datetime NOT NULL,
|
536 |
+
show_in_archive ENUM( 'yes', 'no' ) NOT NULL DEFAULT 'yes',
|
537 |
+
archive_order INT NOT NULL DEFAULT '1',
|
538 |
+
PRIMARY KEY (id)) CHARSET=".self::getCharset()." ;";
|
539 |
+
|
540 |
+
dbDelta( $create_poll_table_sql );
|
541 |
+
}
|
542 |
+
|
543 |
+
public static function create_polls_templates_table() {
|
544 |
+
global $wpdb;
|
545 |
+
$create_poll_table_sql = "CREATE TABLE " . $wpdb->yop_poll_templates . " (
|
546 |
+
id int(11) NOT NULL AUTO_INCREMENT,
|
547 |
+
template_author bigint(20) NOT NULL DEFAULT '0',
|
548 |
+
name varchar(255) NOT NULL,
|
549 |
+
before_vote_template text NOT NULL,
|
550 |
+
after_vote_template text NOT NULL,
|
551 |
+
before_start_date_template text NOT NULL,
|
552 |
+
after_end_date_template text NOT NULL,
|
553 |
+
css text NOT NULL,
|
554 |
+
js text NOT NULL,
|
555 |
+
status varchar(255) NOT NULL,
|
556 |
+
last_modified datetime NOT NULL,
|
557 |
+
date_added datetime NOT NULL,
|
558 |
+
PRIMARY KEY (id)) CHARSET=".self::getCharset()." ;";
|
559 |
+
|
560 |
+
dbDelta( $create_poll_table_sql );
|
561 |
+
}
|
562 |
+
|
563 |
+
/**
|
564 |
+
* creating polls_answers table
|
565 |
+
* @static
|
566 |
+
*
|
567 |
+
*/
|
568 |
+
public static function create_poll_answers_table() {
|
569 |
+
global $wpdb;
|
570 |
+
$create_poll_answers_table_sql = "CREATE TABLE " .$wpdb->yop_poll_answers . " (
|
571 |
+
id int(11) NOT NULL AUTO_INCREMENT,
|
572 |
+
poll_id int(11) NOT NULL,
|
573 |
+
answer varchar(255) NOT NULL,
|
574 |
+
type ENUM( 'default', 'other' ) NOT NULL DEFAULT 'default',
|
575 |
+
votes int(11) NOT NULL,
|
576 |
+
status varchar(255) NOT NULL,
|
577 |
+
PRIMARY KEY (id),
|
578 |
+
KEY poll_id (poll_id)) CHARSET=".self::getCharset()." ;";
|
579 |
+
|
580 |
+
dbDelta( $create_poll_answers_table_sql );
|
581 |
+
}
|
582 |
+
|
583 |
+
/**
|
584 |
+
* creating polls_custom_fields table
|
585 |
+
* @static
|
586 |
+
*
|
587 |
+
*/
|
588 |
+
public static function create_poll_custom_fields_table() {
|
589 |
+
global $wpdb;
|
590 |
+
$create_poll_answers_table_sql = "CREATE TABLE " . $wpdb->yop_poll_custom_fields . " (
|
591 |
+
id int(11) NOT NULL AUTO_INCREMENT,
|
592 |
+
poll_id int(11) NOT NULL,
|
593 |
+
custom_field varchar(255) NOT NULL,
|
594 |
+
required ENUM( 'yes', 'no' ) NOT NULL DEFAULT 'no',
|
595 |
+
status varchar(255) NOT NULL,
|
596 |
+
PRIMARY KEY (id),
|
597 |
+
KEY poll_id (poll_id)) CHARSET=".self::getCharset()." ;";
|
598 |
+
|
599 |
+
dbDelta( $create_poll_answers_table_sql );
|
600 |
+
}
|
601 |
+
|
602 |
+
/**
|
603 |
+
* creating poll meta table
|
604 |
+
* @static
|
605 |
+
*
|
606 |
+
*/
|
607 |
+
public static function create_poll_meta_table() {
|
608 |
+
global $wpdb;
|
609 |
+
$create_poll_meta_table_sql = "CREATE TABLE " . $wpdb->yop_pollmeta . " (
|
610 |
+
meta_id int(11) NOT NULL AUTO_INCREMENT,
|
611 |
+
yop_poll_id int(11) NOT NULL,
|
612 |
+
meta_key varchar(255) NOT NULL,
|
613 |
+
meta_value longtext NOT NULL,
|
614 |
+
PRIMARY KEY (meta_id),
|
615 |
+
KEY yop_poll_id (yop_poll_id)) CHARSET=".self::getCharset()." ;";
|
616 |
+
|
617 |
+
dbDelta( $create_poll_meta_table_sql );
|
618 |
+
}
|
619 |
+
|
620 |
+
/**
|
621 |
+
* creating poll answer meta table
|
622 |
+
* @static
|
623 |
+
*
|
624 |
+
*/
|
625 |
+
public static function create_poll_answer_meta_table() {
|
626 |
+
global $wpdb;
|
627 |
+
$create_poll_answer_meta_table_sql = "CREATE TABLE " . $wpdb->yop_poll_answermeta . " (
|
628 |
+
meta_id int(11) NOT NULL AUTO_INCREMENT,
|
629 |
+
yop_poll_answer_id int(11) NOT NULL,
|
630 |
+
meta_key varchar(255) NOT NULL,
|
631 |
+
meta_value longtext NOT NULL,
|
632 |
+
PRIMARY KEY (meta_id),
|
633 |
+
KEY yop_poll_answer_id (yop_poll_answer_id)) CHARSET=".self::getCharset()." ;";
|
634 |
+
|
635 |
+
dbDelta( $create_poll_answer_meta_table_sql );
|
636 |
+
}
|
637 |
+
|
638 |
+
/**
|
639 |
+
* creating poll logs table
|
640 |
+
* @static
|
641 |
+
*
|
642 |
+
*/
|
643 |
+
public static function create_poll_logs_table() {
|
644 |
+
global $wpdb;
|
645 |
+
$create_poll_logs_table_sql = "CREATE TABLE " . $wpdb->yop_poll_logs . " (
|
646 |
+
id int(11) NOT NULL AUTO_INCREMENT,
|
647 |
+
poll_id int(11) NOT NULL,
|
648 |
+
vote_id varchar(255) NOT NULL,
|
649 |
+
answer_id int(11) NOT NULL,
|
650 |
+
ip varchar(100) NOT NULL,
|
651 |
+
user_id int(11) NOT NULL,
|
652 |
+
user_type ENUM( 'facebook', 'wordpress', 'anonymous', 'default' ) NOT NULL DEFAULT 'default',
|
653 |
+
http_referer varchar(255) NOT NULL,
|
654 |
+
tr_id varchar(255) NOT NULL,
|
655 |
+
other_answer_value text NOT NULL,
|
656 |
+
host varchar(200) NOT NULL,
|
657 |
+
vote_date datetime NOT NULL,
|
658 |
+
PRIMARY KEY (id),
|
659 |
+
KEY poll_id (poll_id)) CHARSET=".self::getCharset()." ;";
|
660 |
+
|
661 |
+
dbDelta( $create_poll_logs_table_sql );
|
662 |
+
}
|
663 |
+
|
664 |
+
/**
|
665 |
+
* creating poll voters table
|
666 |
+
* @static
|
667 |
+
*
|
668 |
+
*/
|
669 |
+
public static function create_poll_voters_table() {
|
670 |
+
global $wpdb;
|
671 |
+
$create_poll_voters_table_sql = "CREATE TABLE " . $wpdb->yop_poll_voters . " (
|
672 |
+
id int(11) NOT NULL AUTO_INCREMENT,
|
673 |
+
poll_id int(11) NOT NULL,
|
674 |
+
user_id int(11) NOT NULL,
|
675 |
+
user_type ENUM( 'facebook', 'wordpress', 'anonymous', 'default' ) NOT NULL DEFAULT 'default',
|
676 |
+
PRIMARY KEY (id),
|
677 |
+
KEY poll_id (poll_id)) CHARSET=".self::getCharset()." ;";
|
678 |
+
|
679 |
+
dbDelta( $create_poll_voters_table_sql );
|
680 |
+
}
|
681 |
+
|
682 |
+
/**
|
683 |
+
* creating poll bans table
|
684 |
+
* @static
|
685 |
+
*
|
686 |
+
*/
|
687 |
+
public static function create_poll_bans_table() {
|
688 |
+
global $wpdb;
|
689 |
+
$create_poll_bans_table_sql = "CREATE TABLE " . $wpdb->yop_poll_bans . " (
|
690 |
+
id int(11) NOT NULL AUTO_INCREMENT,
|
691 |
+
poll_id int(11) NOT NULL,
|
692 |
+
type varchar(255) NOT NULL,
|
693 |
+
value varchar(255) NOT NULL,
|
694 |
+
PRIMARY KEY (id),
|
695 |
+
KEY poll_id (poll_id)) CHARSET=".self::getCharset()." ;";
|
696 |
+
|
697 |
+
dbDelta( $create_poll_bans_table_sql );
|
698 |
+
}
|
699 |
+
|
700 |
+
/**
|
701 |
+
* creating poll votes custom_fields
|
702 |
+
* @static
|
703 |
+
*
|
704 |
+
*/
|
705 |
+
public static function create_poll_votes_custom_fields_table() {
|
706 |
+
global $wpdb;
|
707 |
+
$create_poll_votes_custom_fields_table_sql = "CREATE TABLE " . $wpdb->yop_poll_votes_custom_fields . " (
|
708 |
+
id int(11) NOT NULL AUTO_INCREMENT,
|
709 |
+
poll_id int(11) NOT NULL,
|
710 |
+
vote_id varchar(255) NOT NULL,
|
711 |
+
custom_field_id int(11) NOT NULL,
|
712 |
+
user_id int(11) NOT NULL,
|
713 |
+
user_type ENUM( 'facebook', 'wordpress', 'anonymous', 'default' ) NOT NULL DEFAULT 'default',
|
714 |
+
custom_field_value text NOT NULL,
|
715 |
+
tr_id varchar(255) NOT NULL,
|
716 |
+
vote_date datetime NOT NULL,
|
717 |
+
PRIMARY KEY (id),
|
718 |
+
KEY poll_id (poll_id)) CHARSET=".self::getCharset()." ;";
|
719 |
+
|
720 |
+
dbDelta( $create_poll_votes_custom_fields_table_sql );
|
721 |
+
}
|
722 |
+
|
723 |
+
/**
|
724 |
+
* Creating polls table
|
725 |
+
* @static
|
726 |
+
*
|
727 |
+
*/
|
728 |
+
public static function create_poll_facebook_users_table() {
|
729 |
+
global $wpdb;
|
730 |
+
$create_poll_table_sql = "CREATE TABLE " . $wpdb->yop_poll_facebook_users . " (
|
731 |
+
id int(11) NOT NULL AUTO_INCREMENT,
|
732 |
+
fb_id varchar(255) NOT NULL,
|
733 |
+
name varchar(255) NOT NULL,
|
734 |
+
first_name varchar(255) NOT NULL,
|
735 |
+
last_name varchar(255) NOT NULL,
|
736 |
+
username varchar(255) NOT NULL,
|
737 |
+
email varchar(255) NOT NULL,
|
738 |
+
gender varchar(255) NOT NULL,
|
739 |
+
date_added datetime NOT NULL,
|
740 |
+
PRIMARY KEY (id)) CHARSET=".self::getCharset()." ;";
|
741 |
+
|
742 |
+
dbDelta( $create_poll_table_sql );
|
743 |
+
}
|
744 |
+
|
745 |
+
public static function getCharset() {
|
746 |
+
if ( defined( 'DB_CHARSET' ) )
|
747 |
+
return DB_CHARSET;
|
748 |
+
else
|
749 |
+
return 'utf8';
|
750 |
+
}
|
751 |
}
|
inc/plugin-functions.php
CHANGED
@@ -161,4 +161,5 @@
|
|
161 |
|
162 |
function yop_poll_set_html_content_type() {
|
163 |
return 'text/html';
|
164 |
-
}
|
|
161 |
|
162 |
function yop_poll_set_html_content_type() {
|
163 |
return 'text/html';
|
164 |
+
}
|
165 |
+
|
inc/public-admin.php
CHANGED
@@ -119,12 +119,11 @@
|
|
119 |
|
120 |
if ( ! $yop_poll_model->poll )
|
121 |
return '';
|
122 |
-
$template = $yop_poll_model->return_poll_html( array( 'tr_id' => $tr_id, 'location' => 'page' ) );
|
123 |
if ( 'yes' == $yop_poll_model->poll_options['use_default_loading_image'] )
|
124 |
$loading_image_src = $this->_config->plugin_url.'/images/loading36x36.gif';
|
125 |
else
|
126 |
$loading_image_src = $yop_poll_model->poll_options['loading_image_url'];
|
127 |
-
wp_enqueue_style( 'yop-poll-user-defined_'.$id.$poll_unique_id, add_query_arg( array( 'id' => $id, 'location' => 'page', 'unique_id' => $poll_unique_id ), admin_url('admin-ajax.php', (is_ssl() ? 'https' : 'http')).'?action=yop_poll_load_css' ), array(), $this->_config->version);
|
128 |
wp_enqueue_style( 'yop-poll-public', "{$this->_config->plugin_url}/css/yop-poll-public.css", array(), $this->_config->version );
|
129 |
wp_enqueue_script( 'jquery' );
|
130 |
wp_enqueue_script( 'yop-poll-jquery-popup-windows', "{$this->_config->plugin_url}/js/jquery.popupWindow.js", array(), $this->_config->version, true );
|
119 |
|
120 |
if ( ! $yop_poll_model->poll )
|
121 |
return '';
|
122 |
+
$template = $yop_poll_model->return_poll_html( array( 'tr_id' => $tr_id, 'location' => 'page', 'load_css' => true, 'load_js' => true ) );
|
123 |
if ( 'yes' == $yop_poll_model->poll_options['use_default_loading_image'] )
|
124 |
$loading_image_src = $this->_config->plugin_url.'/images/loading36x36.gif';
|
125 |
else
|
126 |
$loading_image_src = $yop_poll_model->poll_options['loading_image_url'];
|
|
|
127 |
wp_enqueue_style( 'yop-poll-public', "{$this->_config->plugin_url}/css/yop-poll-public.css", array(), $this->_config->version );
|
128 |
wp_enqueue_script( 'jquery' );
|
129 |
wp_enqueue_script( 'yop-poll-jquery-popup-windows', "{$this->_config->plugin_url}/js/jquery.popupWindow.js", array(), $this->_config->version, true );
|
inc/widget.php
CHANGED
@@ -31,14 +31,13 @@
|
|
31 |
}
|
32 |
}
|
33 |
|
34 |
-
$template = $yop_poll_model->return_poll_html( array( 'tr_id' => $tr_id, 'location' => 'widget' ) );
|
35 |
if ( 'yes' == $yop_poll_model->poll_options['use_default_loading_image'] )
|
36 |
$loading_image_src = YOP_POLL_URL.'/images/loading36x36.gif';
|
37 |
else
|
38 |
$loading_image_src = $yop_poll_model->poll_options['loading_image_url'];
|
39 |
wp_enqueue_script( 'jquery' );
|
40 |
wp_enqueue_script( 'yop-poll-jquery-popup-windows', YOP_POLL_URL . "/js/jquery.popupWindow.js",array( 'jquery' ), YOP_POLL_VERSION, true);
|
41 |
-
wp_enqueue_style( 'yop-poll-widget-user-defined_'.$poll_id.$poll_unique_id, add_query_arg( array( 'id' => $poll_id, 'location' => 'widget', 'unique_id' => $poll_unique_id ), admin_url('admin-ajax.php', (is_ssl() ? 'https' : 'http')).'?action=yop_poll_load_css' ), array(), YOP_POLL_VERSION);
|
42 |
wp_enqueue_style( 'yop-poll-public', YOP_POLL_URL."/css/yop-poll-public.css", array(), YOP_POLL_VERSION );
|
43 |
wp_enqueue_script( 'yop-poll-widget-user-defined_'.$poll_id.$poll_unique_id, add_query_arg( array( 'id' => $poll_id, 'location' => 'widget', 'unique_id' => $poll_unique_id ), admin_url('admin-ajax.php', (is_ssl() ? 'https' : 'http')).'?action=yop_poll_load_js' ), array( 'jquery' ), YOP_POLL_VERSION, true);
|
44 |
wp_enqueue_script( 'yop-poll-public', YOP_POLL_URL.'/js/yop-poll-public.js', array(), YOP_POLL_VERSION, true );
|
31 |
}
|
32 |
}
|
33 |
|
34 |
+
$template = $yop_poll_model->return_poll_html( array( 'tr_id' => $tr_id, 'location' => 'widget', 'load_css' => true, 'load_js' => true ) );
|
35 |
if ( 'yes' == $yop_poll_model->poll_options['use_default_loading_image'] )
|
36 |
$loading_image_src = YOP_POLL_URL.'/images/loading36x36.gif';
|
37 |
else
|
38 |
$loading_image_src = $yop_poll_model->poll_options['loading_image_url'];
|
39 |
wp_enqueue_script( 'jquery' );
|
40 |
wp_enqueue_script( 'yop-poll-jquery-popup-windows', YOP_POLL_URL . "/js/jquery.popupWindow.js",array( 'jquery' ), YOP_POLL_VERSION, true);
|
|
|
41 |
wp_enqueue_style( 'yop-poll-public', YOP_POLL_URL."/css/yop-poll-public.css", array(), YOP_POLL_VERSION );
|
42 |
wp_enqueue_script( 'yop-poll-widget-user-defined_'.$poll_id.$poll_unique_id, add_query_arg( array( 'id' => $poll_id, 'location' => 'widget', 'unique_id' => $poll_unique_id ), admin_url('admin-ajax.php', (is_ssl() ? 'https' : 'http')).'?action=yop_poll_load_js' ), array( 'jquery' ), YOP_POLL_VERSION, true);
|
43 |
wp_enqueue_script( 'yop-poll-public', YOP_POLL_URL.'/js/yop-poll-public.js', array(), YOP_POLL_VERSION, true );
|
inc/yop_poll_model.php
CHANGED
@@ -1,80 +1,79 @@
|
|
1 |
<?php
|
2 |
class Yop_Poll_Model {
|
3 |
-
|
4 |
-
var $
|
5 |
-
var $
|
6 |
-
|
7 |
-
'
|
8 |
-
'
|
9 |
-
'
|
10 |
-
'
|
11 |
-
'
|
12 |
-
'
|
13 |
-
'
|
14 |
-
'
|
15 |
-
'
|
16 |
-
'last_modified' => NULL
|
17 |
);
|
18 |
|
19 |
-
var $poll_options
|
20 |
-
var $answers
|
21 |
-
var $custom_fields
|
22 |
-
|
23 |
-
var $template
|
24 |
-
'id'
|
25 |
-
'name'
|
26 |
-
'before_vote_template'
|
27 |
-
'after_vote_template'
|
28 |
-
'before_start_date_template'
|
29 |
-
'after_end_date_template'
|
30 |
-
'css'
|
31 |
-
'js'
|
32 |
-
'status'
|
33 |
-
'date_added'
|
34 |
-
'last_modified'
|
35 |
-
'show_in_archive'
|
36 |
-
'archive_order'
|
37 |
-
'reset_template_id'
|
38 |
);
|
39 |
-
var $vote
|
40 |
-
var $vote_types
|
41 |
-
var $unique_id
|
42 |
-
var $tr_id
|
43 |
|
44 |
public function __construct( $poll_id = -99, $offset = 0 ) {
|
45 |
//do not load id= -99
|
46 |
$poll = NULL;
|
47 |
//Current Active Poll id = -1
|
48 |
if ( -1 == $poll_id ) {
|
49 |
-
$poll
|
50 |
}
|
51 |
//Latest Poll id = -2
|
52 |
elseif ( -2 == $poll_id) {
|
53 |
-
$polls
|
54 |
-
$poll
|
55 |
}
|
56 |
//Random Poll id = -3
|
57 |
elseif ( -3 == $poll_id ) {
|
58 |
-
$polls
|
59 |
-
$poll
|
60 |
}
|
61 |
//Latest Closed Poll id = -4
|
62 |
elseif ( -4 == $poll_id ) {
|
63 |
-
$poll
|
64 |
}
|
65 |
//normal poll
|
66 |
elseif ( $poll_id > 0 ) {
|
67 |
-
$poll
|
68 |
}
|
69 |
if ( $poll ) {
|
70 |
-
$this->poll
|
71 |
-
$this->poll_options
|
72 |
-
$default_options
|
73 |
if ( is_array( $default_options) ) {
|
74 |
if ( count( $default_options ) > 0 ) {
|
75 |
foreach ( $default_options as $option_name => $option_value ) {
|
76 |
if( ! isset( $this->poll_options [ $option_name ] ) )
|
77 |
-
$this->poll_options
|
78 |
}
|
79 |
}
|
80 |
}
|
@@ -82,13 +81,13 @@
|
|
82 |
}
|
83 |
|
84 |
public static function get_poll_options_by_id( $poll_id = 0 ) {
|
85 |
-
$poll_options
|
86 |
-
$default_options
|
87 |
if ( is_array( $default_options) ) {
|
88 |
if ( count( $default_options ) > 0 ) {
|
89 |
foreach ( $default_options as $option_name => $option_value ) {
|
90 |
if( ! isset( $poll_options [ $option_name ] ) )
|
91 |
-
$poll_options
|
92 |
}
|
93 |
}
|
94 |
}
|
@@ -96,7 +95,7 @@
|
|
96 |
}
|
97 |
|
98 |
public function set_unique_id( $unique_id ) {
|
99 |
-
$this->unique_id
|
100 |
}
|
101 |
|
102 |
public function get_unique_id() {
|
@@ -104,12 +103,12 @@
|
|
104 |
}
|
105 |
|
106 |
private function countAnswers( $request = array() ) {
|
107 |
-
$answers
|
108 |
if ( isset( $request['yop_poll_answer'] ) )
|
109 |
-
$answers
|
110 |
if ( isset( $request['yop_poll_options']['allow_other_answers'] ) )
|
111 |
if ( 'yes' == $request['yop_poll_options']['allow_other_answers'] )
|
112 |
-
$answers
|
113 |
return $answers;
|
114 |
}
|
115 |
|
@@ -392,7 +391,7 @@
|
|
392 |
}
|
393 |
|
394 |
if( isset( $request['yop_poll_options']['template'] ) ) {
|
395 |
-
$template
|
396 |
if ( ! $template ) {
|
397 |
$this->error = __( 'Template not found!', 'yop_poll' );
|
398 |
return false;
|
@@ -424,15 +423,15 @@
|
|
424 |
}
|
425 |
|
426 |
public function make_poll_template_from_request_data ( $request = array(), $config = null ) {
|
427 |
-
$this->template['id']
|
428 |
-
$this->template['name']
|
429 |
-
$this->template['before_vote_template']
|
430 |
-
$this->template['after_vote_template']
|
431 |
-
$this->template['before_start_date_template']
|
432 |
-
$this->template['after_end_date_template']
|
433 |
-
$this->template['css']
|
434 |
-
$this->template['js']
|
435 |
-
$this->template['reset_template_id']
|
436 |
}
|
437 |
|
438 |
public function add_poll_template_to_database ( $request = array(), $config = null ) {
|
@@ -440,7 +439,7 @@
|
|
440 |
$this->make_poll_template_from_request_data( $request, $config );
|
441 |
$result = self::get_poll_template_from_database_by_name( $this->template['name'] );
|
442 |
if( !isset( $result['id'] ) ) {
|
443 |
-
$this->template['id']
|
444 |
return $this->template['id'];
|
445 |
}
|
446 |
else {
|
@@ -455,33 +454,33 @@
|
|
455 |
|
456 |
public static function add_bans( $request ) {
|
457 |
global $wpdb;
|
458 |
-
$success
|
459 |
-
$error
|
460 |
|
461 |
if ( ! isset( $request['ban_poll_id'] ) ) {
|
462 |
-
$error
|
463 |
}
|
464 |
elseif ( ! ctype_digit( $request['ban_poll_id'] ) ) {
|
465 |
-
$error
|
466 |
}
|
467 |
elseif( ! in_array( $request['ban_type'], array( 'ip', 'username', 'email') ) ) {
|
468 |
-
$error
|
469 |
}
|
470 |
elseif ( '' == trim( $request['ban_value'] ) ) {
|
471 |
-
$error
|
472 |
}
|
473 |
else {
|
474 |
-
$ban_textarea
|
475 |
-
$values
|
476 |
if( count( $values ) > 0 ) {
|
477 |
foreach( $values as $value ) {
|
478 |
if ( '' != trim( $value )) {
|
479 |
-
$ban
|
480 |
-
'poll_id'
|
481 |
-
'type'
|
482 |
-
'value'
|
483 |
);
|
484 |
-
$exist
|
485 |
$wpdb->prepare(
|
486 |
"
|
487 |
SELECT id
|
@@ -555,190 +554,190 @@
|
|
555 |
private static function reset_poll_template_in_database( $poll_id, $template_id ) {
|
556 |
global $wpdb;
|
557 |
|
558 |
-
$sql
|
559 |
switch ( $template_id ) {
|
560 |
-
case '1':
|
561 |
-
$sql
|
562 |
-
`after_vote_template`
|
563 |
-
`before_start_date_template`
|
564 |
-
`after_end_date_template`
|
565 |
-
`css`
|
566 |
-
`js`
|
567 |
-
`last_modified`
|
568 |
break;
|
569 |
-
case '2':
|
570 |
-
$sql
|
571 |
-
`after_vote_template`
|
572 |
-
`before_start_date_template`
|
573 |
-
`after_end_date_template`
|
574 |
-
`css`
|
575 |
-
`js`
|
576 |
-
`last_modified`
|
577 |
break;
|
578 |
-
case '3':
|
579 |
-
$sql
|
580 |
-
`after_vote_template`
|
581 |
-
`before_start_date_template`
|
582 |
-
`after_end_date_template`
|
583 |
-
`css`
|
584 |
-
`js`
|
585 |
-
`last_modified`
|
586 |
break;
|
587 |
-
case '4':
|
588 |
-
$sql
|
589 |
-
`after_vote_template`
|
590 |
-
`before_start_date_template`
|
591 |
-
`after_end_date_template`
|
592 |
-
`css`
|
593 |
-
`js`
|
594 |
-
`last_modified`
|
595 |
break;
|
596 |
-
case '5':
|
597 |
-
$sql
|
598 |
-
`after_vote_template`
|
599 |
-
`before_start_date_template`
|
600 |
-
`after_end_date_template`
|
601 |
-
`css`
|
602 |
-
`js`
|
603 |
-
`last_modified`
|
604 |
break;
|
605 |
-
case '6':
|
606 |
-
$sql
|
607 |
-
`after_vote_template`
|
608 |
-
`before_start_date_template`
|
609 |
-
`after_end_date_template`
|
610 |
-
`css`
|
611 |
-
`js`
|
612 |
-
`last_modified`
|
613 |
break;
|
614 |
-
case '7':
|
615 |
-
$sql
|
616 |
-
`after_vote_template`
|
617 |
-
`before_start_date_template`
|
618 |
-
`after_end_date_template`
|
619 |
-
`css`
|
620 |
-
`js`
|
621 |
-
`last_modified`
|
622 |
break;
|
623 |
-
case '8':
|
624 |
-
$sql
|
625 |
-
`after_vote_template`
|
626 |
-
`before_start_date_template`
|
627 |
-
`after_end_date_template`
|
628 |
-
`css`
|
629 |
-
`js`
|
630 |
-
`last_modified`
|
631 |
break;
|
632 |
-
case '9':
|
633 |
-
$sql
|
634 |
-
`after_vote_template`
|
635 |
-
`before_start_date_template`
|
636 |
-
`after_end_date_template`
|
637 |
-
`css`
|
638 |
-
`js`
|
639 |
-
`last_modified`
|
640 |
break;
|
641 |
-
case '10':
|
642 |
-
$sql
|
643 |
-
`after_vote_template`
|
644 |
-
`before_start_date_template`
|
645 |
-
`after_end_date_template`
|
646 |
-
`css`
|
647 |
-
`js`
|
648 |
-
`last_modified`
|
649 |
break;
|
650 |
-
case '11':
|
651 |
-
$sql
|
652 |
-
`after_vote_template`
|
653 |
-
`before_start_date_template`
|
654 |
-
`after_end_date_template`
|
655 |
-
`css`
|
656 |
-
`js`
|
657 |
-
`last_modified`
|
658 |
break;
|
659 |
-
case '12':
|
660 |
-
$sql
|
661 |
-
`after_vote_template`
|
662 |
-
`before_start_date_template`
|
663 |
-
`after_end_date_template`
|
664 |
-
`css`
|
665 |
-
`js`
|
666 |
-
`last_modified`
|
667 |
break;
|
668 |
-
case '13':
|
669 |
-
$sql
|
670 |
-
`after_vote_template`
|
671 |
-
`before_start_date_template`
|
672 |
-
`after_end_date_template`
|
673 |
-
`css`
|
674 |
-
`js`
|
675 |
-
`last_modified`
|
676 |
break;
|
677 |
-
case '14':
|
678 |
-
$sql
|
679 |
-
`after_vote_template`
|
680 |
-
`before_start_date_template`
|
681 |
-
`after_end_date_template`
|
682 |
-
`css`
|
683 |
-
`js`
|
684 |
-
`last_modified`
|
685 |
break;
|
686 |
-
case '15':
|
687 |
-
$sql
|
688 |
-
`after_vote_template`
|
689 |
-
`before_start_date_template`
|
690 |
-
`after_end_date_template`
|
691 |
-
`css`
|
692 |
-
`js`
|
693 |
-
`last_modified`
|
694 |
break;
|
695 |
}
|
696 |
-
$sql
|
697 |
$wpdb->query( $sql );
|
698 |
}
|
699 |
|
700 |
public function make_poll_from_request_data ( $request = array(), $config = null ) {
|
701 |
-
$this->poll['id']
|
702 |
-
$this->poll['name']
|
703 |
-
$this->poll['question']
|
704 |
-
$this->poll['start_date']
|
705 |
if( ! isset( $request['yop_poll_options']['never_expire'] ) ) {
|
706 |
$this->poll['end_date'] = isset( $request['yop_poll_options']['end_date'] ) ? trim( $request['yop_poll_options']['end_date'] ) : null;
|
707 |
}
|
708 |
else {
|
709 |
-
$this->poll['end_date']
|
710 |
}
|
711 |
-
$this->poll['show_in_archive']
|
712 |
-
$this->poll['archive_order']
|
713 |
}
|
714 |
|
715 |
public function make_answers_from_request_data ( $request = array(), $config = null ) {
|
716 |
$this->answers = NULL;
|
717 |
$answer = array(
|
718 |
-
'id'
|
719 |
-
'poll_id'
|
720 |
-
'answer'
|
721 |
-
'votes'
|
722 |
-
'status'
|
723 |
-
'type'
|
724 |
);
|
725 |
if ( isset ( $request['yop_poll_answer'] ) ) {
|
726 |
if ( count( $request['yop_poll_answer'] ) > 0 ) {
|
727 |
foreach ( $request['yop_poll_answer'] as $answer_id => $answer_value ) {
|
728 |
-
$answer['answer']
|
729 |
-
$answer['id']
|
730 |
-
$answer['name']
|
731 |
-
$this->answers[]
|
732 |
}
|
733 |
}
|
734 |
}
|
735 |
if ( isset ( $request['yop_poll_options']['allow_other_answers'] ) ) {
|
736 |
if ( 'yes' == $request['yop_poll_options']['allow_other_answers'] ) {
|
737 |
-
$answer['answer']
|
738 |
-
$other_answer
|
739 |
-
$answer['id']
|
740 |
-
$answer['type']
|
741 |
-
$this->answers[]
|
742 |
}
|
743 |
}
|
744 |
}
|
@@ -748,17 +747,17 @@
|
|
748 |
if( isset( $request['yop_poll_customfield'] ) ) {
|
749 |
if ( count( $request['yop_poll_customfield'] ) > 0 ) {
|
750 |
$custom_field = array(
|
751 |
-
'id'
|
752 |
-
'poll_id'
|
753 |
-
'custom_field'
|
754 |
-
'required'
|
755 |
-
'status'
|
756 |
);
|
757 |
foreach ( $request['yop_poll_customfield'] as $customfield_id => $customfield_value ) {
|
758 |
$custom_field['custom_field'] = $customfield_value;
|
759 |
$custom_field['id'] = isset( $request['yop_poll_customfield_ids'][ $customfield_id ] ) ? $request['yop_poll_customfield_ids'][ $customfield_id ] : NULL;
|
760 |
$custom_field['required'] = isset( $request['yop_poll_customfield_required'][ $customfield_id ] ) ? 'yes' : 'no';
|
761 |
-
$this->custom_fields[]
|
762 |
}
|
763 |
}
|
764 |
}
|
@@ -770,7 +769,7 @@
|
|
770 |
$result = self::get_poll_from_database_by_name( $this->poll['name'] );
|
771 |
if ( !isset( $result['id'] ) ) {
|
772 |
//inserting poll to db
|
773 |
-
$this->poll['id']
|
774 |
|
775 |
if( isset( $request['yop_poll_options']['auto_generate_poll_page'] ) ) {
|
776 |
if( 'yes' == $request['yop_poll_options']['auto_generate_poll_page'] ) {
|
@@ -791,8 +790,8 @@
|
|
791 |
}
|
792 |
|
793 |
//inserting poll options to db
|
794 |
-
$poll_options
|
795 |
-
$default_options
|
796 |
|
797 |
|
798 |
if ( isset( $request['yop_poll_options'] ) ) {
|
@@ -810,35 +809,35 @@
|
|
810 |
}
|
811 |
//this is for checkbox options
|
812 |
if( ! isset( $request['yop_poll_options']['never_expire'] ) ) {
|
813 |
-
$poll_options['never_expire']
|
814 |
}
|
815 |
|
816 |
if( isset( $request['yop_poll_options']['schedule_reset_poll_date'] ) ) {
|
817 |
-
$poll_options['schedule_reset_poll_date']
|
818 |
}
|
819 |
else {
|
820 |
-
$poll_options['schedule_reset_poll_date']
|
821 |
}
|
822 |
|
823 |
if( 'yes' == $request['yop_poll_options']['schedule_reset_poll_stats'] ) {
|
824 |
-
$default_options['start_scheduler']
|
825 |
}
|
826 |
else {
|
827 |
-
$change_start_scheduler_to_no
|
828 |
$yop_polls = self::get_yop_polls_fields ( array( 'id' ) );
|
829 |
if ( count( $yop_polls ) > 0 ) {
|
830 |
foreach( $yop_polls as $yop_poll_id ) {
|
831 |
if ( $yop_poll_id['id'] != $this->poll['id'] ) {
|
832 |
-
$yop_poll_options
|
833 |
if ( isset( $yop_poll_options['schedule_reset_poll_stats'] ) && 'yes' == $yop_poll_options['schedule_reset_poll_stats'] )
|
834 |
-
$change_start_scheduler_to_no
|
835 |
}
|
836 |
}
|
837 |
}
|
838 |
if ( $change_start_scheduler_to_no )
|
839 |
-
$default_options['start_scheduler']
|
840 |
else
|
841 |
-
$default_options['start_scheduler']
|
842 |
}
|
843 |
update_option ( 'yop_poll_options', $default_options );
|
844 |
|
@@ -931,8 +930,8 @@
|
|
931 |
}
|
932 |
|
933 |
//update poll options in db
|
934 |
-
$poll_options
|
935 |
-
$default_options
|
936 |
|
937 |
|
938 |
if ( isset( $request['yop_poll_options'] ) ) {
|
@@ -950,35 +949,35 @@
|
|
950 |
}
|
951 |
//this is for checkbox options
|
952 |
if( ! isset( $request['yop_poll_options']['never_expire'] ) ) {
|
953 |
-
$poll_options['never_expire']
|
954 |
}
|
955 |
|
956 |
if( isset( $request['yop_poll_options']['schedule_reset_poll_date'] ) ) {
|
957 |
-
$poll_options['schedule_reset_poll_date']
|
958 |
}
|
959 |
else {
|
960 |
-
$poll_options['schedule_reset_poll_date']
|
961 |
}
|
962 |
|
963 |
if( 'yes' == $request['yop_poll_options']['schedule_reset_poll_stats'] ) {
|
964 |
-
$default_options['start_scheduler']
|
965 |
}
|
966 |
else {
|
967 |
-
$change_start_scheduler_to_no
|
968 |
$yop_polls = self::get_yop_polls_fields ( array( 'id' ) );
|
969 |
if ( count( $yop_polls ) > 0 ) {
|
970 |
foreach( $yop_polls as $yop_poll_id ) {
|
971 |
if ( $yop_poll_id['id'] != $this->poll['id'] ) {
|
972 |
-
$yop_poll_options
|
973 |
if ( isset( $yop_poll_options['schedule_reset_poll_stats'] ) && 'yes' == $yop_poll_options['schedule_reset_poll_stats'] )
|
974 |
-
$change_start_scheduler_to_no
|
975 |
}
|
976 |
}
|
977 |
}
|
978 |
if ( $change_start_scheduler_to_no )
|
979 |
-
$default_options['start_scheduler']
|
980 |
else
|
981 |
-
$default_options['start_scheduler']
|
982 |
}
|
983 |
update_option ( 'yop_poll_options', $default_options );
|
984 |
|
@@ -1025,7 +1024,7 @@
|
|
1025 |
/*if ( isset( $request['yop_poll_options']['use_template_bar'] ) ) {
|
1026 |
if ( $request['yop_poll_options']['use_template_bar'] == 'yes' ) {
|
1027 |
if ( isset( $poll_answer_options[ 'use_template_bar' ] ) )
|
1028 |
-
$poll_answer_options[ 'use_template_bar' ]
|
1029 |
}
|
1030 |
}*/
|
1031 |
update_yop_poll_answer_meta( $answer_id, 'options', $poll_answer_options, false );
|
@@ -1087,7 +1086,7 @@
|
|
1087 |
global $wpdb;
|
1088 |
|
1089 |
if( $include_others ) {
|
1090 |
-
$types
|
1091 |
}
|
1092 |
|
1093 |
$type_sql = '';
|
@@ -1099,10 +1098,10 @@
|
|
1099 |
$type_sql = trim ( $type_sql, ',' );
|
1100 |
$type_sql .= ' ) ';
|
1101 |
}
|
1102 |
-
$is_votes_sort
|
1103 |
if ( 'votes' == $order ) {
|
1104 |
-
$order
|
1105 |
-
$is_votes_sort
|
1106 |
}
|
1107 |
$answers = $wpdb->get_results(
|
1108 |
$wpdb -> prepare(
|
@@ -1117,7 +1116,7 @@
|
|
1117 |
);
|
1118 |
|
1119 |
if ( $include_others ) {
|
1120 |
-
$other_answer_details
|
1121 |
$wpdb -> prepare(
|
1122 |
"
|
1123 |
SELECT *
|
@@ -1128,59 +1127,59 @@
|
|
1128 |
ARRAY_A
|
1129 |
);
|
1130 |
|
1131 |
-
$other_answers_values
|
1132 |
if ( count( $other_answers_values ) > 0 ) {
|
1133 |
if ( 'id' == $order && 'desc' == $order_dir )
|
1134 |
-
$interval
|
1135 |
else
|
1136 |
-
$interval
|
1137 |
for( $i = 0; $i < count( $other_answers_values ); $i++ ) {
|
1138 |
$answers[] =
|
1139 |
array(
|
1140 |
-
'id'
|
1141 |
-
'poll_id'
|
1142 |
-
'answer'
|
1143 |
-
'votes'
|
1144 |
-
'status'
|
1145 |
-
'type'
|
1146 |
);
|
1147 |
}
|
1148 |
}
|
1149 |
else {
|
1150 |
-
$answers[]
|
1151 |
}
|
1152 |
}
|
1153 |
-
$total_votes
|
1154 |
if( count( $answers ) > 0 ) {
|
1155 |
for( $i = 0; $i < count ( $answers ); $i++ ) {
|
1156 |
if( 0 == intval( $total_votes ) )
|
1157 |
-
$answers[$i]['procentes']
|
1158 |
else {
|
1159 |
-
$answers[$i]['procentes']
|
1160 |
if ( 0 < $answers[$i]['procentes'] )
|
1161 |
-
$answers[$i]['procentes']
|
1162 |
}
|
1163 |
}
|
1164 |
}
|
1165 |
|
1166 |
if ( $is_votes_sort ) {
|
1167 |
-
$order_dir
|
1168 |
usort($answers, array( 'Yop_Poll_Model', "sort_answers_by_votes_".$order_dir."_callback" ) );
|
1169 |
}
|
1170 |
if ( $include_others ) {
|
1171 |
if ( 'answer' == $order ) {
|
1172 |
-
$order_dir
|
1173 |
usort($answers, array( 'Yop_Poll_Model', "sort_answers_alphabetical_".$order_dir."_callback" ) );
|
1174 |
}
|
1175 |
|
1176 |
if ( 'rand()' == $order ) {
|
1177 |
-
$interval
|
1178 |
shuffle( $interval );
|
1179 |
-
$new_answers
|
1180 |
foreach ( $interval as $number ) {
|
1181 |
-
$new_answers[]
|
1182 |
}
|
1183 |
-
$answers
|
1184 |
}
|
1185 |
}
|
1186 |
return $answers;
|
@@ -1189,11 +1188,11 @@
|
|
1189 |
public static function get_count_poll_answers( $poll_id, $types = array( 'default' ), $include_others = false ) {
|
1190 |
global $wpdb;
|
1191 |
|
1192 |
-
$answers_no
|
1193 |
-
$other_answers_no
|
1194 |
|
1195 |
if( $include_others ) {
|
1196 |
-
$types
|
1197 |
}
|
1198 |
|
1199 |
$type_sql = '';
|
@@ -1217,7 +1216,7 @@
|
|
1217 |
);
|
1218 |
|
1219 |
if ( $include_others ) {
|
1220 |
-
$other_answer_details
|
1221 |
$wpdb -> prepare(
|
1222 |
"
|
1223 |
SELECT *
|
@@ -1228,7 +1227,7 @@
|
|
1228 |
ARRAY_A
|
1229 |
);
|
1230 |
|
1231 |
-
$other_answers_no
|
1232 |
}
|
1233 |
|
1234 |
return $answers_no + $other_answers_no;
|
@@ -1248,23 +1247,23 @@
|
|
1248 |
ARRAY_A
|
1249 |
);
|
1250 |
return $answer;
|
1251 |
-
}
|
1252 |
|
1253 |
private static function get_poll_answer_by_field( $poll_id, $field_name, $field_value, $field_type = '%s' ) {
|
1254 |
-
$answer
|
1255 |
$GLOBALS['wpdb']->prepare(
|
1256 |
"
|
1257 |
SELECT *
|
1258 |
FROM {$GLOBALS['wpdb']->yop_poll_answers}
|
1259 |
WHERE {$field_name} = {$field_type} AND
|
1260 |
-
poll_id
|
1261 |
LIMIT 0,1",
|
1262 |
$field_value,
|
1263 |
$poll_id
|
1264 |
),
|
1265 |
ARRAY_A
|
1266 |
);
|
1267 |
-
return $answer;
|
1268 |
}
|
1269 |
|
1270 |
public static function get_poll_customfields( $poll_id ) {
|
@@ -1301,12 +1300,12 @@
|
|
1301 |
|
1302 |
public static function get_poll_customfields_logs( $poll_id, $orderby = 'vote_date', $order = 'desc', $offset = 0, $per_page = 99999999, $sdate = '', $edate = '' ) {
|
1303 |
global $wpdb;
|
1304 |
-
$sdatesql
|
1305 |
-
$edatesql
|
1306 |
if ( $sdate != '' )
|
1307 |
-
$sdatesql
|
1308 |
if ( $edate != '' )
|
1309 |
-
$edatesql
|
1310 |
$result = $wpdb->get_results(
|
1311 |
$wpdb -> prepare(
|
1312 |
"
|
@@ -1330,12 +1329,12 @@
|
|
1330 |
|
1331 |
public static function get_poll_total_customfields_logs( $poll_id, $sdate = '', $edate = '' ) {
|
1332 |
global $wpdb;
|
1333 |
-
$sdatesql
|
1334 |
-
$edatesql
|
1335 |
if ( $sdate != '' )
|
1336 |
-
$sdatesql
|
1337 |
if ( $edate != '' )
|
1338 |
-
$edatesql
|
1339 |
$wpdb->query(
|
1340 |
$wpdb -> prepare(
|
1341 |
"
|
@@ -1610,7 +1609,7 @@
|
|
1610 |
type = %s
|
1611 |
",
|
1612 |
$answer['poll_id'],
|
1613 |
-
$answer['answer'],
|
1614 |
$answer['votes'],
|
1615 |
$answer['status'],
|
1616 |
$answer['type']
|
@@ -1621,7 +1620,7 @@
|
|
1621 |
|
1622 |
private static function get_answer_from_database( $answer_id ) {
|
1623 |
global $wpdb;
|
1624 |
-
$result
|
1625 |
$wpdb->prepare(
|
1626 |
"
|
1627 |
SELECT *
|
@@ -1645,7 +1644,7 @@
|
|
1645 |
SET answer = %s
|
1646 |
WHERE id = %d
|
1647 |
",
|
1648 |
-
$answer['answer'],
|
1649 |
$answer['id']
|
1650 |
)
|
1651 |
);
|
@@ -1653,13 +1652,13 @@
|
|
1653 |
|
1654 |
public static function get_archive_polls( $orderby = 'archive_order', $order = 'asc', $offset = 0, $per_page = 99999 ) {
|
1655 |
global $wpdb;
|
1656 |
-
$archive
|
1657 |
$wpdb->prepare(
|
1658 |
"
|
1659 |
SELECT id
|
1660 |
FROM ".$wpdb->yop_polls."
|
1661 |
WHERE
|
1662 |
-
show_in_archive
|
1663 |
ORDER BY " . esc_attr( $orderby ) . " " . esc_attr( $order ) . "
|
1664 |
LIMIT %d, %d
|
1665 |
",
|
@@ -1672,13 +1671,13 @@
|
|
1672 |
|
1673 |
public static function get_current_active_poll( $offset = 0 ) {
|
1674 |
global $wpdb;
|
1675 |
-
$current_date
|
1676 |
return $wpdb->get_row(
|
1677 |
$wpdb->prepare(
|
1678 |
"
|
1679 |
SELECT * FROM ".$wpdb->yop_polls."
|
1680 |
WHERE
|
1681 |
-
%s
|
1682 |
%s <= end_date
|
1683 |
ORDER BY
|
1684 |
date_added ASC
|
@@ -1693,8 +1692,8 @@
|
|
1693 |
|
1694 |
public static function get_latest_closed_poll( $offset = 0 ) {
|
1695 |
global $wpdb;
|
1696 |
-
$current_date
|
1697 |
-
$result
|
1698 |
$wpdb->prepare(
|
1699 |
"
|
1700 |
SELECT * FROM ".$wpdb->yop_polls."
|
@@ -1713,94 +1712,94 @@
|
|
1713 |
|
1714 |
public static function get_yop_polls_filter_search ( $orderby = 'id', $order = 'desc', $filter = array( 'field' => NULL, 'value' => NULL, 'operator' => '=' ), $search = array( 'fields' => array(), 'value' => NULL ) ) {
|
1715 |
global $wpdb;
|
1716 |
-
$sql
|
1717 |
-
$sql_filter
|
1718 |
-
$sql_search
|
1719 |
if ( $filter['field'] && $filter['value'] ) {
|
1720 |
-
$sql_filter
|
1721 |
}
|
1722 |
if( count ( $search['fields'] ) > 0 ) {
|
1723 |
if ( $filter['field'] && $filter['value'] )
|
1724 |
-
$sql_search
|
1725 |
-
$sql_search
|
1726 |
foreach( $search['fields'] as $field ) {
|
1727 |
-
$sql_search
|
1728 |
}
|
1729 |
-
$sql_search
|
1730 |
-
$sql_search
|
1731 |
}
|
1732 |
if ( ($filter['field'] && $filter['value']) || count ( $search['fields'] ) > 0 )
|
1733 |
-
$sql
|
1734 |
-
$sql
|
1735 |
return $wpdb->get_results( $sql, ARRAY_A );
|
1736 |
}
|
1737 |
|
1738 |
public static function get_yop_polls_fields ( $fields = array( 'id' ) ) {
|
1739 |
global $wpdb;
|
1740 |
-
$fields_text
|
1741 |
if ( count( $fields ) > 0 ) {
|
1742 |
foreach ( $fields as $field ) {
|
1743 |
-
$fields_text
|
1744 |
}
|
1745 |
}
|
1746 |
-
$fields_text
|
1747 |
if ( $fields_text == '' )
|
1748 |
-
$fields_text
|
1749 |
-
$sql
|
1750 |
return $wpdb->get_results( $sql, ARRAY_A );
|
1751 |
}
|
1752 |
|
1753 |
public static function make_logs_filter_search_sql( $search = array( 'fields' => array(), 'value' => NULL ), $poll_id = NULL, $sdate = '', $edate = '' ) {
|
1754 |
global $wpdb;
|
1755 |
|
1756 |
-
$sql_search
|
1757 |
|
1758 |
if( $poll_id ) {
|
1759 |
$sql_search .= $wpdb->prepare( 'WHERE poll_id = %d', $poll_id );
|
1760 |
}
|
1761 |
if( '_Anonymous' == $search['value'] ) {
|
1762 |
if ( $poll_id )
|
1763 |
-
$sql_search
|
1764 |
else
|
1765 |
-
$sql_search
|
1766 |
-
$sql_search
|
1767 |
}
|
1768 |
else {
|
1769 |
if( count ( $search['fields'] ) > 0 ) {
|
1770 |
if ( $poll_id )
|
1771 |
-
$sql_search
|
1772 |
else
|
1773 |
-
$sql_search
|
1774 |
foreach( $search['fields'] as $field ) {
|
1775 |
-
$sql_search
|
1776 |
}
|
1777 |
-
$sql_search
|
1778 |
-
$sql_search
|
1779 |
}
|
1780 |
}
|
1781 |
|
1782 |
if ( $sdate != '' )
|
1783 |
if ( '' == trim( $sql_search ) )
|
1784 |
-
$sql_search
|
1785 |
else
|
1786 |
-
$sql_search
|
1787 |
if ( $edate != '' )
|
1788 |
if ( '' == trim( $sql_search ) )
|
1789 |
-
$sql_search
|
1790 |
else
|
1791 |
-
$sql_search
|
1792 |
-
return
|
1793 |
}
|
1794 |
|
1795 |
public static function get_logs_filter_search ( $orderby = 'id', $order = 'desc' , $search = array( 'fields' => array(), 'value' => NULL ), $poll_id = NULL, $offset = 0, $per_page = 99999999, $sdate = '', $edate = '' ) {
|
1796 |
global $wpdb;
|
1797 |
|
1798 |
if ( 'id' == $orderby )
|
1799 |
-
$orderby
|
1800 |
|
1801 |
-
$sql_search
|
1802 |
|
1803 |
-
$sql
|
1804 |
SELECT
|
1805 |
id,
|
1806 |
vote_id,
|
@@ -1848,19 +1847,19 @@
|
|
1848 |
" . $wpdb->yop_poll_logs . ".user_id = " . $wpdb->yop_poll_facebook_users . ".id
|
1849 |
)
|
1850 |
";
|
1851 |
-
$sql
|
1852 |
-
$sql
|
1853 |
-
$sql
|
1854 |
-
$sql
|
1855 |
return $wpdb->get_results( $sql, ARRAY_A );
|
1856 |
}
|
1857 |
|
1858 |
public static function get_group_logs_filter_search ( $orderby = 'id', $order = 'desc' , $search = array( 'fields' => array(), 'value' => NULL ), $poll_id = NULL, $offset = 0, $per_page = 99999999, $sdate = '', $edate = '' ) {
|
1859 |
global $wpdb;
|
1860 |
|
1861 |
-
$sql_search
|
1862 |
|
1863 |
-
$sql
|
1864 |
SELECT
|
1865 |
id,
|
1866 |
vote_id,
|
@@ -1908,11 +1907,11 @@
|
|
1908 |
" . $wpdb->yop_poll_logs . ".user_id = " . $wpdb->yop_poll_facebook_users . ".id
|
1909 |
)
|
1910 |
";
|
1911 |
-
$sql
|
1912 |
-
$sql
|
1913 |
-
$sql
|
1914 |
-
$sql
|
1915 |
-
$sql
|
1916 |
|
1917 |
return $wpdb->get_results( $sql, ARRAY_A );
|
1918 |
}
|
@@ -1920,9 +1919,9 @@
|
|
1920 |
public static function get_total_logs_filter_search ( $search = array( 'fields' => array(), 'value' => NULL ), $poll_id = NULL, $sdate = '', $edate = '' ) {
|
1921 |
global $wpdb;
|
1922 |
|
1923 |
-
$sql_search
|
1924 |
|
1925 |
-
$sql
|
1926 |
SELECT
|
1927 |
count(*)
|
1928 |
FROM
|
@@ -1959,17 +1958,17 @@
|
|
1959 |
" . $wpdb->yop_poll_logs . ".user_id = " . $wpdb->yop_poll_facebook_users . ".id
|
1960 |
)
|
1961 |
";
|
1962 |
-
$sql
|
1963 |
-
$sql
|
1964 |
return $wpdb->get_var( $sql );
|
1965 |
}
|
1966 |
|
1967 |
public static function get_total_group_logs_filter_search ( $search = array( 'fields' => array(), 'value' => NULL ), $poll_id = NULL, $sdate = '', $edate = '' ) {
|
1968 |
global $wpdb;
|
1969 |
|
1970 |
-
$sql_search
|
1971 |
|
1972 |
-
$sql
|
1973 |
SELECT
|
1974 |
count(*)
|
1975 |
FROM
|
@@ -2010,9 +2009,9 @@
|
|
2010 |
" . $wpdb->yop_poll_logs . ".user_id = " . $wpdb->yop_poll_facebook_users . ".id
|
2011 |
)
|
2012 |
";
|
2013 |
-
$sql
|
2014 |
-
$sql
|
2015 |
-
$sql
|
2016 |
return $wpdb->get_var( $sql );
|
2017 |
}
|
2018 |
|
@@ -2020,33 +2019,33 @@
|
|
2020 |
global $wpdb;
|
2021 |
|
2022 |
if ( 'id' == $orderby )
|
2023 |
-
$orderby
|
2024 |
|
2025 |
-
$sql_search
|
2026 |
|
2027 |
if( $poll_id ) {
|
2028 |
$sql_search .= $wpdb->prepare( 'WHERE ' . $wpdb->yop_poll_bans . '.poll_id = %d', $poll_id );
|
2029 |
}
|
2030 |
if( $type ) {
|
2031 |
if ( $poll_id )
|
2032 |
-
$sql_search
|
2033 |
else
|
2034 |
-
$sql_search
|
2035 |
-
$sql_search
|
2036 |
}
|
2037 |
if( count ( $search['fields'] ) > 0 ) {
|
2038 |
if ( $poll_id || $type )
|
2039 |
-
$sql_search
|
2040 |
else
|
2041 |
-
$sql_search
|
2042 |
foreach( $search['fields'] as $field ) {
|
2043 |
-
$sql_search
|
2044 |
}
|
2045 |
-
$sql_search
|
2046 |
-
$sql_search
|
2047 |
}
|
2048 |
|
2049 |
-
$sql
|
2050 |
" . $wpdb->yop_poll_bans . ".id,
|
2051 |
" . $wpdb->yop_poll_bans . ".value,
|
2052 |
" . $wpdb->yop_poll_bans . ".type,
|
@@ -2058,9 +2057,9 @@
|
|
2058 |
" . $wpdb->yop_poll_bans . ".poll_id = " . $wpdb->yop_polls . ".id
|
2059 |
)
|
2060 |
";
|
2061 |
-
$sql
|
2062 |
-
$sql
|
2063 |
-
$sql
|
2064 |
return $wpdb->get_results( $sql, ARRAY_A );
|
2065 |
}
|
2066 |
|
@@ -2188,17 +2187,17 @@
|
|
2188 |
$poll_details = self::get_poll_from_database_by_id( $poll_id );
|
2189 |
$clone_number = self::count_poll_from_database_like_name( $poll_details['name']. ' - clone' );
|
2190 |
if ( $poll_details ) {
|
2191 |
-
$poll
|
2192 |
-
'name'
|
2193 |
-
'question'
|
2194 |
-
'start_date'
|
2195 |
-
'end_date'
|
2196 |
-
'total_votes'
|
2197 |
-
'total_answers'
|
2198 |
-
'status'
|
2199 |
-
'date_added'
|
2200 |
'show_in_archive'=> $poll_details['show_in_archive'],
|
2201 |
-
'archive_order'
|
2202 |
);
|
2203 |
$new_poll_id = self::insert_poll_to_database( $poll );
|
2204 |
|
@@ -2230,11 +2229,11 @@
|
|
2230 |
if ( $answers ) {
|
2231 |
foreach ( $answers as $answer ) {
|
2232 |
$answer_to_insert = array(
|
2233 |
-
'poll_id'
|
2234 |
-
'answer'
|
2235 |
-
'votes'
|
2236 |
-
'status'
|
2237 |
-
'type'
|
2238 |
);
|
2239 |
$new_answer_id = self::insert_answer_to_database ( $answer_to_insert );
|
2240 |
|
@@ -2249,10 +2248,10 @@
|
|
2249 |
if ( $custom_fields ) {
|
2250 |
foreach ( $custom_fields as $custom_field ) {
|
2251 |
$custom_field_to_insert = array(
|
2252 |
-
'poll_id'
|
2253 |
-
'custom_field'
|
2254 |
-
'required'
|
2255 |
-
'status'
|
2256 |
);
|
2257 |
$new_custom_field_id = self::insert_custom_field_to_database( $custom_field_to_insert );
|
2258 |
}
|
@@ -2262,19 +2261,19 @@
|
|
2262 |
|
2263 |
public static function get_yop_poll_templates_search ( $orderby = 'last_modified', $order = 'desc', $search = array( 'fields' => array(), 'value' => NULL ) ) {
|
2264 |
global $wpdb;
|
2265 |
-
$sql
|
2266 |
-
$sql_search
|
2267 |
if( count ( $search['fields'] ) > 0 ) {
|
2268 |
-
$sql_search
|
2269 |
foreach( $search['fields'] as $field ) {
|
2270 |
-
$sql_search
|
2271 |
}
|
2272 |
-
$sql_search
|
2273 |
-
$sql_search
|
2274 |
}
|
2275 |
if ( count ( $search['fields'] ) > 0 )
|
2276 |
-
$sql
|
2277 |
-
$sql
|
2278 |
return $wpdb->get_results( $sql, ARRAY_A );
|
2279 |
}
|
2280 |
|
@@ -2441,17 +2440,17 @@
|
|
2441 |
$template_details = self::get_poll_template_from_database_by_id( $template_id );
|
2442 |
$clone_number = self::count_poll_template_from_database_like_name( $template_details['name']. ' - clone' );
|
2443 |
if ( $template_details ) {
|
2444 |
-
$template
|
2445 |
-
'name'
|
2446 |
-
'before_vote_template'
|
2447 |
-
'after_vote_template'
|
2448 |
-
'before_start_date_template'
|
2449 |
-
'after_end_date_template'
|
2450 |
-
'css'
|
2451 |
-
'js'
|
2452 |
-
'status'
|
2453 |
-
'date_added'
|
2454 |
-
'last_modified'
|
2455 |
);
|
2456 |
$new_template_id = self::insert_poll_template_to_database( $template );
|
2457 |
}
|
@@ -2487,17 +2486,17 @@
|
|
2487 |
"
|
2488 |
INSERT INTO ".$wpdb->yop_poll_logs."
|
2489 |
SET
|
2490 |
-
poll_id
|
2491 |
-
vote_id
|
2492 |
-
answer_id
|
2493 |
-
ip
|
2494 |
-
user_id
|
2495 |
-
user_type
|
2496 |
-
http_referer
|
2497 |
-
tr_id
|
2498 |
-
host
|
2499 |
-
other_answer_value
|
2500 |
-
vote_date
|
2501 |
",
|
2502 |
$answer['poll_id'],
|
2503 |
$answer['vote_id'],
|
@@ -2523,9 +2522,9 @@
|
|
2523 |
"
|
2524 |
INSERT INTO ".$wpdb->yop_poll_voters."
|
2525 |
SET
|
2526 |
-
poll_id
|
2527 |
-
user_id
|
2528 |
-
user_type
|
2529 |
",
|
2530 |
$voter['poll_id'],
|
2531 |
$voter['user_id'],
|
@@ -2536,32 +2535,32 @@
|
|
2536 |
}
|
2537 |
|
2538 |
public function add_user_other_answer_to_default_answers( &$answer ) { //add user other answer into answers table
|
2539 |
-
$poll_id
|
2540 |
-
$poll_options
|
2541 |
|
2542 |
if ( isset( $poll_options['add_other_answers_to_default_answers'] ) ) {
|
2543 |
if ( 'yes' == $poll_options['add_other_answers_to_default_answers'] ) {
|
2544 |
if ( 'other' == $answer['type'] ) {
|
2545 |
-
$answer_exist
|
2546 |
if ( isset( $answer_exist['id'] ) ) {
|
2547 |
-
$answer['answer_id']
|
2548 |
-
$answer['type']
|
2549 |
-
$answer['other_answer_value']
|
2550 |
}
|
2551 |
else {
|
2552 |
-
$answer_to_add
|
2553 |
-
'poll_id'
|
2554 |
-
'answer'
|
2555 |
-
'votes'
|
2556 |
-
'status'
|
2557 |
-
'type'
|
2558 |
);
|
2559 |
-
$new_answer_id
|
2560 |
if ( $new_answer_id ) {
|
2561 |
-
$answer['answer_id']
|
2562 |
-
$answer['type']
|
2563 |
-
$answer['other_answer_value']
|
2564 |
-
}
|
2565 |
}
|
2566 |
}
|
2567 |
}
|
@@ -2572,7 +2571,7 @@
|
|
2572 |
|
2573 |
public function get_voter_number_of_votes( $voter ) {
|
2574 |
global $wpdb;
|
2575 |
-
$result
|
2576 |
$wpdb->prepare(
|
2577 |
"
|
2578 |
SELECT count(*) as total_votes
|
@@ -2587,15 +2586,15 @@
|
|
2587 |
$voter['user_type']
|
2588 |
)
|
2589 |
);
|
2590 |
-
return $result;
|
2591 |
}
|
2592 |
|
2593 |
public function user_have_votes_to_vote( $voter ) {
|
2594 |
-
$poll_options
|
2595 |
if ( $voter['user_id'] > 0 )
|
2596 |
if ( 'yes' == $poll_options['limit_number_of_votes_per_user'] )
|
2597 |
if ( $this->get_voter_number_of_votes( $voter ) >= $poll_options['number_of_votes_per_user'] )
|
2598 |
-
return false;
|
2599 |
return true;
|
2600 |
}
|
2601 |
|
@@ -2607,19 +2606,20 @@
|
|
2607 |
private static function insert_vote_custom_field_in_database( $custom_field = array() ) {
|
2608 |
global $wpdb;
|
2609 |
|
|
|
2610 |
$wpdb->query(
|
2611 |
$wpdb->prepare(
|
2612 |
"
|
2613 |
INSERT INTO ".$wpdb->yop_poll_votes_custom_fields."
|
2614 |
SET
|
2615 |
-
poll_id
|
2616 |
-
vote_id
|
2617 |
-
custom_field_id
|
2618 |
-
user_id
|
2619 |
-
user_type
|
2620 |
-
custom_field_value
|
2621 |
-
tr_id
|
2622 |
-
vote_date
|
2623 |
",
|
2624 |
$custom_field['poll_id'],
|
2625 |
$custom_field['vote_id'],
|
@@ -2637,12 +2637,12 @@
|
|
2637 |
private static function insert_facebook_user_in_database( $user_details = array() ) {
|
2638 |
global $wpdb;
|
2639 |
|
2640 |
-
$user_exist
|
2641 |
$wpdb->prepare(
|
2642 |
"
|
2643 |
SELECT * FROM ".$wpdb->yop_poll_facebook_users."
|
2644 |
WHERE
|
2645 |
-
fb_id
|
2646 |
LIMIT 0,1
|
2647 |
",
|
2648 |
$user_details['id']
|
@@ -2656,14 +2656,14 @@
|
|
2656 |
"
|
2657 |
UPDATE ".$wpdb->yop_poll_facebook_users."
|
2658 |
SET
|
2659 |
-
name
|
2660 |
-
first_name
|
2661 |
-
last_name
|
2662 |
-
username
|
2663 |
-
email
|
2664 |
-
gender
|
2665 |
WHERE
|
2666 |
-
fb_id
|
2667 |
",
|
2668 |
$user_details['name'],
|
2669 |
$user_details['first_name'],
|
@@ -2682,14 +2682,14 @@
|
|
2682 |
"
|
2683 |
INSERT INTO ".$wpdb->yop_poll_facebook_users."
|
2684 |
SET
|
2685 |
-
fb_id
|
2686 |
-
name
|
2687 |
-
first_name
|
2688 |
-
last_name
|
2689 |
-
username
|
2690 |
-
email
|
2691 |
-
gender
|
2692 |
-
date_added
|
2693 |
",
|
2694 |
$user_details['id'],
|
2695 |
$user_details['name'],
|
@@ -2821,22 +2821,22 @@
|
|
2821 |
$field['value']
|
2822 |
)
|
2823 |
);
|
2824 |
-
}
|
2825 |
|
2826 |
public function register_vote( $request ) {
|
2827 |
global $current_user;
|
2828 |
-
$poll_id
|
2829 |
-
$unique_id
|
2830 |
-
$location
|
2831 |
if ( wp_verify_nonce( $request[ 'yop-poll-nonce-'.$poll_id.$unique_id ], 'yop_poll-'.$poll_id.$unique_id.'-user-actions' ) ) {
|
2832 |
-
$poll_details
|
2833 |
-
$poll_options
|
2834 |
-
$vote_id
|
2835 |
-
$vote_type
|
2836 |
-
$tr_id
|
2837 |
|
2838 |
-
$facebook_error
|
2839 |
-
$facebook_user_details
|
2840 |
|
2841 |
if ( 'facebook' == $vote_type ) {
|
2842 |
if ( ! is_array( $facebook_user_details ) ) {
|
@@ -2852,13 +2852,13 @@
|
|
2852 |
if ( $facebook_error == 'access_denied' ) {
|
2853 |
$this->error = __( 'You Don`t Have Permission to Vote! You must authorize YOP POLL application in your facebook account!', 'yop_poll' );
|
2854 |
return false;
|
2855 |
-
}
|
2856 |
if ( $facebook_error == 'access_error' ) {
|
2857 |
$this->error = __( 'You Don`t Have Permission to Vote!', 'yop_poll' );
|
2858 |
return false;
|
2859 |
}
|
2860 |
|
2861 |
-
$facebook_user_id
|
2862 |
}
|
2863 |
|
2864 |
$current_date = YOP_POLL_MODEL::get_mysql_curent_date();
|
@@ -2871,288 +2871,288 @@
|
|
2871 |
}
|
2872 |
else {
|
2873 |
if ( ! $this->is_voted( $vote_type, $facebook_user_details, true ) ) {
|
2874 |
-
$answers
|
2875 |
-
$voter
|
2876 |
-
$voter['poll_id']
|
2877 |
-
$voter['user_id']
|
2878 |
-
$voter['user_type']
|
2879 |
-
if ( 'facebook'
|
2880 |
-
$voter['user_id']
|
2881 |
-
$voter['user_type']
|
2882 |
}
|
2883 |
if ( $this->user_have_votes_to_vote( $voter ) ) {
|
2884 |
if ( isset ( $request['yop_poll_answer'] ) ) {
|
2885 |
if ( 'yes' == $poll_options['allow_multiple_answers'] ) {
|
2886 |
if ( count( $request['yop_poll_answer'] ) <= intval( $poll_options['allow_multiple_answers_number'] ) ) {
|
2887 |
-
if ( count( $request['yop_poll_answer'] ) >= intval( $poll_options['allow_multiple_answers_min_number'] ) ) {
|
2888 |
foreach( $request['yop_poll_answer'] as $answer_id ) {
|
2889 |
-
$answer
|
2890 |
-
$answer['poll_id']
|
2891 |
-
$answer['vote_id']
|
2892 |
-
$answer['answer_id']
|
2893 |
-
$answer['ip']
|
2894 |
-
$answer['user_id']
|
2895 |
-
$answer['type']
|
2896 |
-
|
2897 |
-
$answer['user_type']
|
2898 |
if ( in_array( $vote_type, $this->vote_types ) )
|
2899 |
-
$answer['user_type']
|
2900 |
|
2901 |
-
$answer['http_referer']
|
2902 |
-
$answer['tr_id']
|
2903 |
-
$answer['host']
|
2904 |
-
$answer['other_answer_value']
|
2905 |
-
$answer_details
|
2906 |
if ( 'other' == $answer_details['type'] ) {
|
2907 |
if( isset( $request['yop_poll_other_answer'] ) ) {
|
2908 |
-
if ( '' != trim( $request['yop_poll_other_answer'] ) ) {
|
2909 |
-
$answer['other_answer_value']
|
2910 |
-
$answer['type']
|
2911 |
}
|
2912 |
else {
|
2913 |
-
$this->error
|
2914 |
return false;
|
2915 |
}
|
2916 |
}
|
2917 |
else {
|
2918 |
-
$this->error
|
2919 |
return false;
|
2920 |
}
|
2921 |
}
|
2922 |
-
$answers[]
|
2923 |
}
|
2924 |
}
|
2925 |
else {
|
2926 |
-
$this->error
|
2927 |
return false;
|
2928 |
}
|
2929 |
}
|
2930 |
else {
|
2931 |
-
$this->error
|
2932 |
return false;
|
2933 |
}
|
2934 |
}
|
2935 |
else {
|
2936 |
-
$answer
|
2937 |
-
$answer['poll_id']
|
2938 |
-
$answer['vote_id']
|
2939 |
-
$answer['answer_id']
|
2940 |
-
$answer['ip']
|
2941 |
-
$answer['user_id']
|
2942 |
-
$answer['type']
|
2943 |
-
|
2944 |
-
$answer['user_type']
|
2945 |
if ( in_array( $vote_type, $this->vote_types ) )
|
2946 |
-
$answer['user_type']
|
2947 |
|
2948 |
-
$answer['http_referer']
|
2949 |
-
$answer['tr_id']
|
2950 |
-
$answer['host']
|
2951 |
-
$answer['other_answer_value']
|
2952 |
-
$answer_details
|
2953 |
if ( 'other' == $answer_details['type'] ) {
|
2954 |
if( isset( $request['yop_poll_other_answer'] ) ) {
|
2955 |
-
if ( '' != trim( $request['yop_poll_other_answer'] ) ) {
|
2956 |
-
$answer['other_answer_value']
|
2957 |
-
$answer['type']
|
2958 |
}
|
2959 |
else {
|
2960 |
-
$this->error
|
2961 |
return false;
|
2962 |
}
|
2963 |
}
|
2964 |
else {
|
2965 |
-
$this->error
|
2966 |
return false;
|
2967 |
}
|
2968 |
}
|
2969 |
-
$answers[]
|
2970 |
}
|
2971 |
if ( count($answers) > 0 ) {
|
2972 |
-
$custom_fields
|
2973 |
-
$poll_custom_fields
|
2974 |
if ( count( $poll_custom_fields ) > 0 ) {
|
2975 |
if( isset( $request['yop_poll_customfield'] ) ) {
|
2976 |
foreach ( $poll_custom_fields as $custom_field ) {
|
2977 |
if ( isset( $request['yop_poll_customfield'][ $custom_field['id'] ] ) ) {
|
2978 |
if ( '' == trim( $request['yop_poll_customfield'][ $custom_field['id'] ] ) && 'yes' == $custom_field['required'] ) {
|
2979 |
-
$this->error
|
2980 |
return false;
|
2981 |
}
|
2982 |
else {
|
2983 |
if ( $request['yop_poll_customfield'][ $custom_field['id'] ] != '' ) {
|
2984 |
-
$new_custom_field
|
2985 |
-
$new_custom_field['poll_id']
|
2986 |
-
$new_custom_field['vote_id']
|
2987 |
-
$new_custom_field['custom_field_id']
|
2988 |
-
$new_custom_field['user_id']
|
2989 |
|
2990 |
-
$new_custom_field['user_type']
|
2991 |
if ( in_array( $vote_type, $this->vote_types ) )
|
2992 |
-
$new_custom_field['user_type']
|
2993 |
|
2994 |
-
$new_custom_field['custom_field_value']
|
2995 |
-
$custom_fields[]
|
2996 |
}
|
2997 |
}
|
2998 |
}
|
2999 |
else {
|
3000 |
-
$this->error
|
3001 |
return false;
|
3002 |
}
|
3003 |
}
|
3004 |
}
|
3005 |
else {
|
3006 |
-
$this->error
|
3007 |
return false;
|
3008 |
}
|
3009 |
}
|
3010 |
|
3011 |
if ( 'yes' == $poll_options['use_captcha'] ) {
|
3012 |
require_once( YOP_POLL_INC.'/securimage.php');
|
3013 |
-
$img
|
3014 |
-
$img->namespace
|
3015 |
if ( $img->check( $_REQUEST[ 'yop_poll_captcha_input' ][ $poll_id ] ) ) {
|
3016 |
$cookie_ids = '';
|
3017 |
-
$votes
|
3018 |
-
$mail_notifications_answers
|
3019 |
foreach( $answers as &$answer ) {
|
3020 |
-
if ( 'facebook'
|
3021 |
-
$answer['user_id']
|
3022 |
}
|
3023 |
-
if ( 'anonymous'
|
3024 |
-
$answer['user_id']
|
3025 |
$this->add_user_other_answer_to_default_answers( $answer );
|
3026 |
self::insert_vote_in_database( $answer );
|
3027 |
-
$cookie_ids
|
3028 |
$this->update_answer_votes( $answer['answer_id'], 1 );
|
3029 |
$votes++;
|
3030 |
-
$answer_base
|
3031 |
if ( $answer_base['type'] != 'other' )
|
3032 |
-
$mail_notifications_answers
|
3033 |
else
|
3034 |
-
$mail_notifications_answers
|
3035 |
}
|
3036 |
-
$mail_notifications_answers
|
3037 |
|
3038 |
self::insert_voter_in_database( $voter );
|
3039 |
$this->update_poll_votes_and_answers( $votes, 1 );
|
3040 |
|
3041 |
-
$mail_notifications_custom_fields
|
3042 |
foreach( $custom_fields as $custom_field ) {
|
3043 |
-
if ( 'facebook'
|
3044 |
-
$custom_field['user_id']
|
3045 |
-
if ( 'anonymous'
|
3046 |
-
$custom_field['user_id']
|
3047 |
-
$custom_field['tr_id']
|
3048 |
self::insert_vote_custom_field_in_database( $custom_field );
|
3049 |
-
$custom_field_base
|
3050 |
-
$mail_notifications_custom_fields
|
3051 |
}
|
3052 |
-
$mail_notifications_custom_fields
|
3053 |
|
3054 |
$this->set_vote_cookie( trim($cookie_ids, ',' ), $vote_type, $facebook_user_details );
|
3055 |
-
$this->vote
|
3056 |
-
$this -> poll
|
3057 |
if ( 'yes' == $poll_options['number_of_votes_per_user'] )
|
3058 |
-
$this->success
|
3059 |
else
|
3060 |
-
$this->success
|
3061 |
if ( 'yes' == $poll_options['send_email_notifications'] ) {
|
3062 |
$headers = 'From: '.$poll_options['email_notifications_from_name'].' <'.$poll_options['email_notifications_from_email'].'>';
|
3063 |
-
$subject
|
3064 |
-
$subject
|
3065 |
-
$subject
|
3066 |
-
$subject
|
3067 |
-
$subject
|
3068 |
-
$subject
|
3069 |
-
|
3070 |
-
$body
|
3071 |
-
$body
|
3072 |
-
$body
|
3073 |
-
$body
|
3074 |
-
$body
|
3075 |
-
$body
|
3076 |
-
$body
|
3077 |
-
|
3078 |
add_filter( 'wp_mail_content_type', 'yop_poll_set_html_content_type' );
|
3079 |
-
$is_sent
|
3080 |
remove_filter( 'wp_mail_content_type', 'yop_poll_set_html_content_type' );
|
3081 |
}
|
3082 |
return do_shortcode( $this->return_poll_html( array( 'tr_id' => $tr_id, 'location' => $location ) ) );
|
3083 |
}
|
3084 |
else {
|
3085 |
-
$this->error
|
3086 |
return false;
|
3087 |
}
|
3088 |
}
|
3089 |
else {
|
3090 |
$cookie_ids = '';
|
3091 |
-
$votes
|
3092 |
-
$mail_notifications_answers
|
3093 |
foreach( $answers as &$answer ) {
|
3094 |
-
if ( 'facebook'
|
3095 |
-
$answer['user_id']
|
3096 |
}
|
3097 |
-
if ( 'anonymous'
|
3098 |
-
$answer['user_id']
|
3099 |
|
3100 |
$this->add_user_other_answer_to_default_answers( $answer );
|
3101 |
self::insert_vote_in_database( $answer );
|
3102 |
-
$cookie_ids
|
3103 |
$this->update_answer_votes( $answer['answer_id'], 1 );
|
3104 |
$votes++;
|
3105 |
-
$answer_base
|
3106 |
if ( $answer_base['type'] != 'other' )
|
3107 |
-
$mail_notifications_answers
|
3108 |
else
|
3109 |
-
$mail_notifications_answers
|
3110 |
}
|
3111 |
|
3112 |
-
$mail_notifications_answers
|
3113 |
|
3114 |
self::insert_voter_in_database( $voter );
|
3115 |
|
3116 |
$this->update_poll_votes_and_answers( $votes, 1 );
|
3117 |
|
3118 |
-
$mail_notifications_custom_fields
|
3119 |
foreach( $custom_fields as $custom_field ) {
|
3120 |
-
if ( 'facebook'
|
3121 |
-
$custom_field['user_id']
|
3122 |
if ( 'anonymous' == $vote_type )
|
3123 |
-
$custom_field['user_id']
|
3124 |
-
$custom_field['tr_id']
|
3125 |
self::insert_vote_custom_field_in_database( $custom_field );
|
3126 |
-
$custom_field_base
|
3127 |
-
$mail_notifications_custom_fields
|
3128 |
}
|
3129 |
-
$mail_notifications_custom_fields
|
3130 |
|
3131 |
$this->set_vote_cookie( trim($cookie_ids, ',' ), $vote_type, $facebook_user_details );
|
3132 |
-
$this->vote
|
3133 |
-
$this -> poll
|
3134 |
if ( 'yes' == $poll_options['limit_number_of_votes_per_user'] )
|
3135 |
-
$this->success
|
3136 |
else
|
3137 |
-
$this->success
|
3138 |
if ( 'yes' == $poll_options['send_email_notifications'] ) {
|
3139 |
$headers = 'From: '.$poll_options['email_notifications_from_name'].' <'.$poll_options['email_notifications_from_email'].'>';
|
3140 |
-
$subject
|
3141 |
-
$subject
|
3142 |
-
$subject
|
3143 |
-
$subject
|
3144 |
-
$subject
|
3145 |
-
$subject
|
3146 |
-
|
3147 |
-
$body
|
3148 |
-
$body
|
3149 |
-
$body
|
3150 |
-
$body
|
3151 |
-
$body
|
3152 |
-
$body
|
3153 |
|
3154 |
add_filter( 'wp_mail_content_type', 'yop_poll_set_html_content_type' );
|
3155 |
-
$is_sent
|
3156 |
remove_filter( 'wp_mail_content_type', 'yop_poll_set_html_content_type' );
|
3157 |
}
|
3158 |
|
@@ -3160,7 +3160,7 @@
|
|
3160 |
}
|
3161 |
}
|
3162 |
else {
|
3163 |
-
$this->error
|
3164 |
return false;
|
3165 |
}
|
3166 |
}
|
@@ -3201,222 +3201,327 @@
|
|
3201 |
}
|
3202 |
}
|
3203 |
|
3204 |
-
public function return_poll_css( $attr
|
3205 |
-
$
|
3206 |
-
|
3207 |
-
|
3208 |
-
|
3209 |
-
|
3210 |
-
|
3211 |
-
|
3212 |
-
|
3213 |
-
$
|
3214 |
-
|
3215 |
-
$
|
3216 |
-
|
3217 |
-
|
3218 |
-
|
3219 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3220 |
}
|
3221 |
-
$template_details = self::get_poll_template_from_database_by_id( $template_id );
|
3222 |
-
$template = $template_details['css'];
|
3223 |
-
$template = str_ireplace( '%POLL-ID%', $poll_id.$unique_id, $template );
|
3224 |
-
if ( 'widget' == $location )
|
3225 |
-
$template = str_ireplace( '%POLL-WIDTH%', $poll_options['widget_template_width'], $template );
|
3226 |
-
else
|
3227 |
-
$template = str_ireplace( '%POLL-WIDTH%', $poll_options['template_width'], $template );
|
3228 |
-
return stripslashes( $template );
|
3229 |
}
|
3230 |
|
3231 |
-
public function return_poll_js( $attr
|
3232 |
-
$poll_id
|
3233 |
-
$location
|
3234 |
-
$unique_id
|
|
|
3235 |
if( ! $poll_id )
|
3236 |
return '';
|
3237 |
-
$poll_details
|
3238 |
-
$poll_options
|
3239 |
if ( 'widget' == $location )
|
3240 |
-
$template_id
|
3241 |
-
else
|
3242 |
-
$template_id
|
3243 |
-
|
|
|
|
|
3244 |
if ( isset( $poll_options['display_other_answers_values'] ) ) {
|
3245 |
if ( 'yes' == $poll_options['display_other_answers_values'] )
|
3246 |
-
$display_other_answers_values
|
3247 |
else
|
3248 |
-
$display_other_answers_values
|
3249 |
}
|
3250 |
if ( '' == $template_id ) {
|
3251 |
-
$default_template
|
3252 |
-
$template_id
|
3253 |
}
|
3254 |
-
$answers_tabulated_cols
|
3255 |
-
$results_tabulated_cols
|
3256 |
-
if ( 'orizontal'
|
3257 |
-
$ans_no
|
3258 |
if( $ans_no > 0 )
|
3259 |
-
$answers_tabulated_cols
|
3260 |
}
|
3261 |
-
if ( 'orizontal'
|
3262 |
-
$ans_no
|
3263 |
if( $ans_no > 0 )
|
3264 |
-
$results_tabulated_cols
|
3265 |
}
|
3266 |
-
if ( 'tabulated'
|
3267 |
-
$answers_tabulated_cols
|
3268 |
-
if ( 'tabulated'
|
3269 |
-
$results_tabulated_cols
|
3270 |
-
|
3271 |
-
$
|
3272 |
-
$template
|
3273 |
-
$template
|
3274 |
-
$template
|
|
|
3275 |
return stripslashes( $template );
|
3276 |
}
|
3277 |
|
3278 |
-
public function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3279 |
|
3280 |
-
|
3281 |
-
$
|
3282 |
-
$
|
|
|
|
|
|
|
3283 |
|
3284 |
-
$poll_id
|
3285 |
if ( ! $poll_id )
|
3286 |
return '';
|
3287 |
-
$poll_details
|
3288 |
-
$poll_options
|
3289 |
|
3290 |
if ( function_exists( 'icl_translate' ) ) {
|
3291 |
$poll_details['question'] = icl_translate( 'yop_poll', $poll_details['id'] .'_question', $poll_details['question'] );
|
3292 |
$poll_details['name'] = icl_translate( 'yop_poll', $poll_details['id'] .'_poll_title', $poll_details['name'] );
|
3293 |
|
3294 |
//$poll_options['other_answers_label'] = icl_translate( 'yop_poll', $poll_details['id'] .'_other_answers_label', $poll_options['other_answers_label'] );
|
3295 |
-
$poll_options['singular_answer_result_votes_number_label']
|
3296 |
-
$poll_options['plural_answer_result_votes_number_label']
|
3297 |
-
$poll_options['vote_button_label']
|
3298 |
-
$poll_options['view_results_link_label']
|
3299 |
-
$poll_options['view_back_to_vote_link_label']
|
3300 |
-
$poll_options['view_total_votes_label']
|
3301 |
-
$poll_options['view_total_answers_label']
|
3302 |
-
$poll_options['view_total_voters_label']
|
3303 |
-
$poll_options['view_poll_archive_link_label']
|
3304 |
-
$poll_options['answer_result_label']
|
3305 |
-
$poll_options['vote_permisions_facebook_label']
|
3306 |
-
$poll_options['vote_permisions_wordpress_label']
|
3307 |
-
$poll_options['vote_permisions_anonymous_label']
|
3308 |
}
|
3309 |
|
3310 |
if ( 'widget' == $location )
|
3311 |
-
$template_id
|
3312 |
else
|
3313 |
-
$template_id
|
3314 |
if ( '' == $template_id ) {
|
3315 |
-
$default_template
|
3316 |
-
$template_id
|
3317 |
}
|
3318 |
-
|
3319 |
-
$
|
3320 |
-
$
|
|
|
3321 |
|
3322 |
if( $current_date >= $poll_details['start_date']) {
|
3323 |
if( $current_date <= $poll_details['end_date'] ) {
|
3324 |
if ( ! $is_voted ) {
|
3325 |
-
$template
|
3326 |
if ( 'before' == $poll_options['view_results'] )
|
3327 |
if ( $this->is_view_poll_results() )
|
3328 |
-
$template
|
3329 |
-
$template
|
3330 |
}
|
3331 |
else {
|
3332 |
-
$template
|
3333 |
if ( 'after' == $poll_options['view_results'] || 'before' == $poll_options['view_results'] )
|
3334 |
if ( $this->is_view_poll_results() )
|
3335 |
-
$template
|
3336 |
|
3337 |
if( 'yes' == $poll_options['view_back_to_vote_link'] ) {
|
3338 |
-
$vote
|
3339 |
-
$this->vote
|
3340 |
if ( ! $this->is_voted() ) {
|
3341 |
-
$template
|
3342 |
}
|
3343 |
-
$this->vote
|
3344 |
}
|
3345 |
}
|
3346 |
}
|
3347 |
else {
|
3348 |
-
$template
|
3349 |
if ( 'after-poll-end-date' == $poll_options['view_results'] || 'before' == $poll_options['view_results'] || 'after' == $poll_options['view_results'] ) {
|
3350 |
if ( $this->is_view_poll_results() ){
|
3351 |
-
$template
|
3352 |
}
|
3353 |
}
|
3354 |
}
|
3355 |
}
|
3356 |
else {
|
3357 |
-
$template
|
3358 |
if ( 'before' == $poll_options['view_results'] )
|
3359 |
if ( $this->is_view_poll_results() )
|
3360 |
-
$template
|
3361 |
}
|
3362 |
|
3363 |
if ( 'custom-date' == $poll_options['view_results'] ) {
|
3364 |
if ( $current_date >= $poll_options['view_results_start_date'] )
|
3365 |
if ( $this->is_view_poll_results() )
|
3366 |
-
$template
|
3367 |
}
|
3368 |
-
|
3369 |
-
$template
|
|
|
|
|
|
|
3370 |
if ( 'yes' == $poll_options['poll_name_html_tags'] )
|
3371 |
-
$template
|
3372 |
else
|
3373 |
-
$template
|
3374 |
-
|
3375 |
-
$template
|
|
|
3376 |
if ( '9999-12-31 23:59:59' == $poll_details['end_date'] )
|
3377 |
-
$template
|
3378 |
else
|
3379 |
-
$template
|
|
|
3380 |
if ( 'yes' == $poll_options['poll_question_html_tags'] )
|
3381 |
-
$template
|
3382 |
else
|
3383 |
-
$template
|
3384 |
|
3385 |
if( 'yes' == $poll_options['view_results_link'] ) {
|
3386 |
-
$template
|
3387 |
}
|
3388 |
|
3389 |
if( 'yes' == $poll_options['view_poll_archive_link'] ) {
|
3390 |
-
$template
|
3391 |
}
|
3392 |
if( 'yes' == $poll_options['view_total_answers'] ) {
|
3393 |
-
$template
|
3394 |
-
$template
|
3395 |
}
|
3396 |
if( 'yes' == $poll_options['view_total_votes'] ) {
|
3397 |
-
$template
|
3398 |
-
$template
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3399 |
}
|
3400 |
-
|
3401 |
-
$template
|
3402 |
-
|
3403 |
-
|
3404 |
-
|
3405 |
-
|
3406 |
-
|
3407 |
-
$template = preg_replace_callback( "/$pattern/s", array(&$this,'answer_result_replace_callback'), $template );
|
3408 |
-
$pattern = '\[(\[?)(CAPTCHA_CONTAINER)\b([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\[]*+(?:\[(?!\/\2\])[^\[]*+)*+)\[\/\2\])?)(\]?)';
|
3409 |
-
$template = preg_replace_callback( "/$pattern/s", array(&$this,'captcha_replace_callback'), $template );
|
3410 |
-
$template = self::strip_all_tags( $template );
|
3411 |
-
$template = '<div id="yop-poll-container-'.$poll_id.$unique_id.'" class="yop-poll-container"><div id="yop-poll-container-error-'.$poll_id.$unique_id.'" class="yop-poll-container-error"></div><div id="yop-poll-container-success-'.$poll_id.$unique_id.'" class="yop-poll-container-success"></div><form id="yop-poll-form-'.$poll_id.$unique_id.'" class="yop-poll-forms">'.$template.'<input type="hidden" id="yop-poll-tr-id-'.$poll_id.$unique_id.'" name="yop_poll_tr_id" value="'.$tr_id.'"/>'.wp_nonce_field( 'yop_poll-'.$poll_id.$unique_id.'-user-actions', 'yop-poll-nonce-'.$poll_id.$unique_id, false, false ).'</form></div>';
|
3412 |
return $template;
|
3413 |
}
|
3414 |
|
3415 |
private function is_view_poll_results() {
|
3416 |
-
$poll_id
|
3417 |
-
$unique_id
|
3418 |
-
$poll_options
|
3419 |
-
$is_voted
|
3420 |
|
3421 |
if (
|
3422 |
(
|
@@ -3432,63 +3537,63 @@
|
|
3432 |
)
|
3433 |
) {
|
3434 |
return true;
|
3435 |
-
}
|
3436 |
return false;
|
3437 |
}
|
3438 |
|
3439 |
public function answer_result_replace_callback( $m ) {
|
3440 |
-
$poll_id
|
3441 |
-
$unique_id
|
3442 |
-
$poll_options
|
3443 |
-
$return_string
|
3444 |
-
$is_voted
|
3445 |
if ( $this->is_view_poll_results() ) {
|
3446 |
-
$display_other_answers_values
|
3447 |
if ( 'yes' == $poll_options['display_other_answers_values'] )
|
3448 |
-
$display_other_answers_values
|
3449 |
else
|
3450 |
-
$display_other_answers_values
|
3451 |
-
$answers_types
|
3452 |
if ( 'yes' == $poll_options['add_other_answers_to_default_answers'] )
|
3453 |
-
$answers_types
|
3454 |
|
3455 |
-
$percentages_decimals
|
3456 |
if ( isset( $poll_options['percentages_decimals'] ) )
|
3457 |
-
$percentages_decimals
|
3458 |
if( isset( $poll_options['sorting_results'] ) ) {
|
3459 |
if( 'exact' == $poll_options['sorting_results'] ) {
|
3460 |
$order_dir = 'asc';
|
3461 |
if( isset( $poll_options['sorting_results_direction'] ) )
|
3462 |
$order_dir = ('asc' == $poll_options['sorting_results_direction']) ? 'asc' : 'desc';
|
3463 |
-
$answers
|
3464 |
}
|
3465 |
elseif( 'alphabetical' == $poll_options['sorting_results'] ) {
|
3466 |
$order_dir = 'asc';
|
3467 |
if( isset( $poll_options['sorting_results_direction'] ) )
|
3468 |
$order_dir = ('asc' == $poll_options['sorting_results_direction']) ? 'asc' : 'desc';
|
3469 |
-
$answers
|
3470 |
}
|
3471 |
elseif( 'random' == $poll_options['sorting_results'] ) {
|
3472 |
-
$answers
|
3473 |
}
|
3474 |
elseif( 'votes' == $poll_options['sorting_results'] ) {
|
3475 |
$order_dir = 'asc';
|
3476 |
if( isset( $poll_options['sorting_results_direction'] ) )
|
3477 |
$order_dir = ('asc' == $poll_options['sorting_results_direction']) ? 'asc' : 'desc';
|
3478 |
-
$answers
|
3479 |
}
|
3480 |
else {
|
3481 |
$order_dir = 'asc';
|
3482 |
if( isset( $poll_options['sorting_results_direction'] ) )
|
3483 |
$order_dir = ('asc' == $poll_options['sorting_results_direction']) ? 'asc' : 'desc';
|
3484 |
-
$answers
|
3485 |
}
|
3486 |
}
|
3487 |
else {
|
3488 |
$order_dir = 'asc';
|
3489 |
if( isset( $poll_options['sorting_results_direction'] ) )
|
3490 |
$order_dir = ('asc' == $poll_options['sorting_results_direction']) ? 'asc' : 'desc';
|
3491 |
-
$answers
|
3492 |
}
|
3493 |
if( count( $answers ) > 0 ) {
|
3494 |
foreach( $answers as $answer ) {
|
@@ -3508,14 +3613,14 @@
|
|
3508 |
}
|
3509 |
}
|
3510 |
}
|
3511 |
-
$temp_string
|
3512 |
-
$temp_string
|
3513 |
if ( 'yes' == $poll_options['poll_answer_html_tags'] )
|
3514 |
-
$temp_string
|
3515 |
else
|
3516 |
-
$temp_string
|
3517 |
-
$temp_string
|
3518 |
-
$return_string
|
3519 |
}
|
3520 |
}
|
3521 |
}
|
@@ -3524,23 +3629,23 @@
|
|
3524 |
}
|
3525 |
|
3526 |
public function customfield_replace_callback( $m ) {
|
3527 |
-
$poll_id
|
3528 |
-
$poll_options
|
3529 |
-
$return_string
|
3530 |
-
$is_voted
|
3531 |
if( ! $is_voted ) {
|
3532 |
-
$custom_fields
|
3533 |
if( count( $custom_fields ) > 0 ) {
|
3534 |
foreach ($custom_fields as $custom_field) {
|
3535 |
if ( function_exists( 'icl_translate' ) ) {
|
3536 |
$custom_field['custom_field'] = icl_translate( 'yop_poll', $custom_field['id'] .'_custom_field', $custom_field['custom_field'] );
|
3537 |
}
|
3538 |
if ( 'yes' == $poll_options['poll_custom_field_html_tags'] )
|
3539 |
-
$temp_string
|
3540 |
else
|
3541 |
-
$temp_string
|
3542 |
-
$temp_string
|
3543 |
-
$return_string
|
3544 |
}
|
3545 |
}
|
3546 |
}
|
@@ -3548,14 +3653,14 @@
|
|
3548 |
}
|
3549 |
|
3550 |
public function other_answer_replace_callback( $m ) {
|
3551 |
-
$poll_id
|
3552 |
-
$unique_id
|
3553 |
-
$poll_options
|
3554 |
-
$return_string
|
3555 |
-
$is_voted
|
3556 |
-
$percentages_decimals
|
3557 |
if ( isset( $poll_options['percentages_decimals'] ) )
|
3558 |
-
$percentages_decimals
|
3559 |
if( ! $is_voted ) {
|
3560 |
$multiple_answers = false;
|
3561 |
if( isset( $poll_options['allow_multiple_answers'] ) )
|
@@ -3567,49 +3672,49 @@
|
|
3567 |
$other_answer = self::get_poll_answers( $poll_id, array( 'other') );
|
3568 |
if( ! $other_answer ) {
|
3569 |
$answer = array(
|
3570 |
-
'id'
|
3571 |
-
'poll_id'
|
3572 |
-
'answer'
|
3573 |
-
'votes'
|
3574 |
-
'status'
|
3575 |
-
'type'
|
3576 |
);
|
3577 |
-
$other_answer_id
|
3578 |
}
|
3579 |
$other_answer = self::get_poll_answers( $poll_id, array( 'other'), 'id', '', false, $percentages_decimals );
|
3580 |
|
3581 |
if ( function_exists( 'icl_translate' ) ) {
|
3582 |
-
$other_answer_label = icl_translate( 'yop_poll', $poll_id .'_other_answer_label',
|
3583 |
} else {
|
3584 |
-
$other_answer_label =
|
3585 |
}
|
3586 |
|
3587 |
if( $multiple_answers ) {
|
3588 |
if ( isset( $poll_options['is_default_answer'] ) && 'yes' == $poll_options['is_default_answer'] )
|
3589 |
-
$temp_string
|
3590 |
else
|
3591 |
-
$temp_string
|
3592 |
}
|
3593 |
else {
|
3594 |
if ( isset( $poll_options['is_default_answer'] ) && 'yes' == $poll_options['is_default_answer'] )
|
3595 |
-
$temp_string
|
3596 |
else
|
3597 |
-
$temp_string
|
3598 |
}
|
3599 |
if ( 'yes' == $poll_options['poll_answer_html_tags'] )
|
3600 |
-
$temp_string
|
3601 |
else
|
3602 |
-
$temp_string
|
3603 |
-
$temp_string
|
3604 |
if ( $this->is_view_poll_results() ) {
|
3605 |
-
$temp_string
|
3606 |
-
$temp_string
|
3607 |
-
$temp_string
|
3608 |
-
$temp_string
|
3609 |
-
$temp_string
|
3610 |
-
$temp_string
|
3611 |
}
|
3612 |
-
$return_string
|
3613 |
}
|
3614 |
}
|
3615 |
}
|
@@ -3617,52 +3722,52 @@
|
|
3617 |
}
|
3618 |
|
3619 |
public function answer_replace_callback( $m ) {
|
3620 |
-
$poll_id
|
3621 |
-
$unique_id
|
3622 |
-
$poll_options
|
3623 |
-
$return_string
|
3624 |
-
$is_voted
|
3625 |
-
$percentages_decimals
|
3626 |
if ( isset( $poll_options['percentages_decimals'] ) )
|
3627 |
-
$percentages_decimals
|
3628 |
if( ! $is_voted ) {
|
3629 |
if( isset( $poll_options['sorting_answers'] ) ) {
|
3630 |
if( 'exact' == $poll_options['sorting_answers'] ) {
|
3631 |
$order_dir = 'asc';
|
3632 |
if( isset( $poll_options['sorting_answers_direction'] ) )
|
3633 |
$order_dir = ('asc' == $poll_options['sorting_answers_direction']) ? 'asc' : 'desc';
|
3634 |
-
$answers
|
3635 |
}
|
3636 |
elseif( 'alphabetical' == $poll_options['sorting_answers'] ) {
|
3637 |
$order_dir = 'asc';
|
3638 |
if( isset( $poll_options['sorting_answers_direction'] ) )
|
3639 |
$order_dir = ('asc' == $poll_options['sorting_answers_direction']) ? 'asc' : 'desc';
|
3640 |
-
$answers
|
3641 |
}
|
3642 |
elseif( 'random' == $poll_options['sorting_answers'] ) {
|
3643 |
-
$answers
|
3644 |
}
|
3645 |
elseif( 'votes' == $poll_options['sorting_answers'] ) {
|
3646 |
$order_dir = 'asc';
|
3647 |
if( isset( $poll_options['sorting_answers_direction'] ) )
|
3648 |
$order_dir = ('asc' == $poll_options['sorting_answers_direction']) ? 'asc' : 'desc';
|
3649 |
-
$answers
|
3650 |
}
|
3651 |
else {
|
3652 |
$order_dir = 'asc';
|
3653 |
if( isset( $poll_options['sorting_answers_direction'] ) )
|
3654 |
$order_dir = ('asc' == $poll_options['sorting_answers_direction']) ? 'asc' : 'desc';
|
3655 |
-
$answers
|
3656 |
}
|
3657 |
}
|
3658 |
else {
|
3659 |
$order_dir = 'asc';
|
3660 |
if( isset( $poll_options['sorting_answers_direction'] ) )
|
3661 |
$order_dir = ('asc' == $poll_options['sorting_answers_direction']) ? 'asc' : 'desc';
|
3662 |
-
$answers
|
3663 |
}
|
3664 |
-
$multiple_answers
|
3665 |
-
$answers_in_select_input
|
3666 |
if( isset( $poll_options['allow_multiple_answers'] ) )
|
3667 |
if ( 'yes' == $poll_options['allow_multiple_answers'] )
|
3668 |
$multiple_answers = true;
|
@@ -3687,8 +3792,8 @@
|
|
3687 |
else {
|
3688 |
$answer_options = array();
|
3689 |
foreach ( $poll_options as $option_name => $option_value ) {
|
3690 |
-
$answer_options[ $option_name ] = $option_value;
|
3691 |
-
}
|
3692 |
}
|
3693 |
|
3694 |
if ( function_exists( 'icl_translate' ) ) {
|
@@ -3697,50 +3802,50 @@
|
|
3697 |
|
3698 |
if ( $multiple_answers ) {
|
3699 |
if ( isset( $answer_options['is_default_answer'] ) && 'yes' == $answer_options['is_default_answer'] )
|
3700 |
-
$temp_string
|
3701 |
else
|
3702 |
-
$temp_string
|
3703 |
}
|
3704 |
else {
|
3705 |
if ( isset( $answer_options['is_default_answer'] ) && 'yes' == $answer_options['is_default_answer'] )
|
3706 |
-
$temp_string
|
3707 |
else
|
3708 |
-
$temp_string
|
3709 |
}
|
3710 |
if ( 'yes' == $poll_options['poll_answer_html_tags'] )
|
3711 |
-
$temp_string
|
3712 |
else
|
3713 |
-
$temp_string
|
3714 |
if ( $this->is_view_poll_results() ) {
|
3715 |
-
$temp_string
|
3716 |
-
$temp_string
|
3717 |
-
$temp_string
|
3718 |
}
|
3719 |
-
$return_string
|
3720 |
}
|
3721 |
}
|
3722 |
}
|
3723 |
-
return $return_string;
|
3724 |
}
|
3725 |
|
3726 |
public function captcha_replace_callback( $m ) {
|
3727 |
-
$poll_id
|
3728 |
-
$unique_id
|
3729 |
-
$poll_options
|
3730 |
-
$return_string
|
3731 |
-
$temp_string
|
3732 |
|
3733 |
if ( 'yes' == $poll_options['use_captcha'] ) {
|
3734 |
-
$sid
|
3735 |
-
$temp_string
|
3736 |
-
$temp_string
|
3737 |
-
$temp_string
|
3738 |
-
$temp_string
|
3739 |
-
$temp_string
|
3740 |
<param name="movie" value="'.YOP_POLL_URL.'/captcha/securimage_play.swf?bgcol=#ffffff&icon_file='.YOP_POLL_URL.'/images/captcha-audio.gif&audio_file=' . urlencode( admin_url('admin-ajax.php', (is_ssl() ? 'https' : 'http')).'?action=yop_poll_play_captcha&poll_id=' . $poll_id . '&unique_id='. $unique_id ) . '" />
|
3741 |
</object>', $temp_string );
|
3742 |
}
|
3743 |
-
$return_string
|
3744 |
|
3745 |
return $return_string;
|
3746 |
}
|
@@ -3871,14 +3976,14 @@
|
|
3871 |
}
|
3872 |
|
3873 |
public static function sort_answers_alphabetical_asc_callback( $a, $b ) {
|
3874 |
-
$cmp
|
3875 |
if ( $cmp == 0 )
|
3876 |
return 0;
|
3877 |
return ( $cmp < 0 ) ? -1 : 1;
|
3878 |
}
|
3879 |
|
3880 |
public static function sort_answers_alphabetical_desc_callback( $a, $b ) {
|
3881 |
-
$cmp
|
3882 |
if ( $cmp == 0 )
|
3883 |
return 0;
|
3884 |
return ( $cmp < 0 ) ? 1 : -1;
|
@@ -3897,29 +4002,29 @@
|
|
3897 |
}
|
3898 |
|
3899 |
public static function display_poll_result_bar( $poll_id = 0, $answer_id = 0, $procent = 0, $poll_options = array(), $unique_id = '' ) {
|
3900 |
-
$result_bar
|
3901 |
-
$result_bar
|
3902 |
if ( 'no' == $poll_options['use_template_bar'] ) {
|
3903 |
-
$result_bar
|
3904 |
}
|
3905 |
-
$result_bar
|
3906 |
if ( floatval( $procent ) > 0 ) {
|
3907 |
-
$result_bar
|
3908 |
'width:'.$procent.'%; ';
|
3909 |
if ( 'no' == $poll_options['use_template_bar'] ) {
|
3910 |
-
$result_bar
|
3911 |
'background-color:#'.$poll_options['bar_background'].'; '.
|
3912 |
'border-style:'.$poll_options['bar_border_style'].'; '.
|
3913 |
'border-width:'.$poll_options['bar_border_width'].'px; '.
|
3914 |
'border-color:#'.$poll_options['bar_border_color'].'; ';
|
3915 |
}
|
3916 |
-
$result_bar
|
3917 |
'id="yop-poll-result-bar-div-'.$answer_id.'" '.
|
3918 |
'class="yop-poll-result-bar-div-'.$poll_id . $unique_id .'"'.
|
3919 |
'>'.
|
3920 |
'</div>';
|
3921 |
}
|
3922 |
-
$result_bar
|
3923 |
return $result_bar;
|
3924 |
}
|
3925 |
|
@@ -3940,7 +4045,7 @@
|
|
3940 |
|
3941 |
public static function strip_all_tags( $template ) {
|
3942 |
|
3943 |
-
$tags
|
3944 |
'%CAPTCHA-PLAY%',
|
3945 |
'%CAPTCHA-LABEL%',
|
3946 |
'%RELOAD-CAPTCHA-IMAGE%',
|
@@ -3982,7 +4087,7 @@
|
|
3982 |
);
|
3983 |
|
3984 |
foreach( $tags as $tag )
|
3985 |
-
$template
|
3986 |
return $template;
|
3987 |
}
|
3988 |
|
@@ -4017,19 +4122,19 @@
|
|
4017 |
private function is_ban( $vote_type = 'default', $facebook_user_details = NULL ) {
|
4018 |
global $wpdb, $current_user;
|
4019 |
|
4020 |
-
$username
|
4021 |
-
$email
|
4022 |
|
4023 |
if ( 'facebook' == $vote_type ) {
|
4024 |
-
$username
|
4025 |
-
$email
|
4026 |
}
|
4027 |
if ( 'anonymous' == $vote_type ) {
|
4028 |
-
$username
|
4029 |
-
$email
|
4030 |
}
|
4031 |
-
$ip
|
4032 |
-
$sql
|
4033 |
"
|
4034 |
SELECT id
|
4035 |
FROM ".$wpdb->yop_poll_bans."
|
@@ -4046,12 +4151,12 @@
|
|
4046 |
$username,
|
4047 |
$email
|
4048 |
);
|
4049 |
-
return
|
4050 |
}
|
4051 |
|
4052 |
private function is_voted_ip() {
|
4053 |
global $wpdb;
|
4054 |
-
$unit
|
4055 |
if ( isset( $this->poll_options['blocking_voters_interval_unit'] ) ) {
|
4056 |
switch ( $this->poll_options['blocking_voters_interval_unit'] ) {
|
4057 |
case 'seconds' :
|
@@ -4068,12 +4173,12 @@
|
|
4068 |
break;
|
4069 |
}
|
4070 |
}
|
4071 |
-
$value
|
4072 |
if ( isset( $this->poll_options['blocking_voters_interval_value'] ) ) {
|
4073 |
-
$value
|
4074 |
}
|
4075 |
-
$ip
|
4076 |
-
$log_id
|
4077 |
$wpdb->prepare(
|
4078 |
"
|
4079 |
SELECT id
|
@@ -4099,26 +4204,26 @@
|
|
4099 |
}
|
4100 |
|
4101 |
private function set_vote_cookie( $answer_ids = '0', $vote_type = 'default', $facebook_user_details = NULL) {
|
4102 |
-
$expire_cookie
|
4103 |
-
$value
|
4104 |
if ( isset( $this->poll_options['blocking_voters_interval_value'] ) )
|
4105 |
-
$value
|
4106 |
-
$unit
|
4107 |
if ( isset( $this->poll_options['blocking_voters_interval_unit'] ) )
|
4108 |
-
|
4109 |
|
4110 |
switch ( $unit ) {
|
4111 |
case 'seconds' :
|
4112 |
-
$expire_cookie
|
4113 |
break;
|
4114 |
case 'minutes' :
|
4115 |
-
$expire_cookie
|
4116 |
break;
|
4117 |
case 'hours' :
|
4118 |
-
$expire_cookie
|
4119 |
break;
|
4120 |
case 'days' :
|
4121 |
-
$expire_cookie
|
4122 |
break;
|
4123 |
}
|
4124 |
setcookie( 'yop_poll_voted_'.$this->poll['id'], $answer_ids , $expire_cookie, COOKIEPATH, COOKIE_DOMAIN, false);
|
@@ -4131,11 +4236,11 @@
|
|
4131 |
global $current_user, $wpdb;
|
4132 |
|
4133 |
if ( ! $from_register ) {
|
4134 |
-
$vote_type
|
4135 |
-
$facebook_user_details['id']
|
4136 |
-
}
|
4137 |
|
4138 |
-
$unit
|
4139 |
if ( isset( $this->poll_options['blocking_voters_interval_unit'] ) ) {
|
4140 |
switch ( $this->poll_options['blocking_voters_interval_unit'] ) {
|
4141 |
case 'seconds' :
|
@@ -4159,15 +4264,15 @@
|
|
4159 |
}
|
4160 |
}
|
4161 |
|
4162 |
-
$value
|
4163 |
if ( isset( $this->poll_options['blocking_voters_interval_value'] ) ) {
|
4164 |
-
$value
|
4165 |
}
|
4166 |
-
$ip
|
4167 |
-
$user_id
|
4168 |
|
4169 |
if ( 'facebook' == $vote_type ) {
|
4170 |
-
$user_id
|
4171 |
$wpdb->prepare(
|
4172 |
"
|
4173 |
SELECT id
|
@@ -4177,13 +4282,13 @@
|
|
4177 |
",
|
4178 |
$facebook_user_details['id']
|
4179 |
)
|
4180 |
-
);
|
4181 |
|
4182 |
if ( ! $user_id )
|
4183 |
return false;
|
4184 |
}
|
4185 |
|
4186 |
-
$log_id
|
4187 |
$wpdb->prepare(
|
4188 |
"
|
4189 |
SELECT id
|
@@ -4299,8 +4404,8 @@
|
|
4299 |
}
|
4300 |
|
4301 |
public static function base64_decode( $str ) {
|
4302 |
-
$str
|
4303 |
-
$str
|
4304 |
return base64_decode( $str );
|
4305 |
}
|
4306 |
}
|
1 |
<?php
|
2 |
class Yop_Poll_Model {
|
3 |
+
var $error = NULL;
|
4 |
+
var $success = NULL;
|
5 |
+
var $poll = array(
|
6 |
+
'id' => NULL,
|
7 |
+
'name' => NULL,
|
8 |
+
'question' => NULL,
|
9 |
+
'start_date' => NULL,
|
10 |
+
'end_date' => NULL,
|
11 |
+
'total_votes' => 0,
|
12 |
+
'total_answers' => 0,
|
13 |
+
'status' => 'open',
|
14 |
+
'date_added' => NULL,
|
15 |
+
'last_modified' => NULL
|
|
|
16 |
);
|
17 |
|
18 |
+
var $poll_options = NULL;
|
19 |
+
var $answers = NULL;
|
20 |
+
var $custom_fields = NULL;
|
21 |
+
|
22 |
+
var $template = array(
|
23 |
+
'id' => NULL,
|
24 |
+
'name' => NULL,
|
25 |
+
'before_vote_template' => NULL,
|
26 |
+
'after_vote_template' => NULL,
|
27 |
+
'before_start_date_template' => NULL,
|
28 |
+
'after_end_date_template' => NULL,
|
29 |
+
'css' => NULL,
|
30 |
+
'js' => NULL,
|
31 |
+
'status' => 'active',
|
32 |
+
'date_added' => NULL,
|
33 |
+
'last_modified' => NULL,
|
34 |
+
'show_in_archive' => NULL,
|
35 |
+
'archive_order' => NULL,
|
36 |
+
'reset_template_id' => NULL,
|
37 |
);
|
38 |
+
var $vote = false;
|
39 |
+
var $vote_types = array( 'default', 'wordpress', 'facebook', 'anonymous' );
|
40 |
+
var $unique_id = '';
|
41 |
+
var $tr_id = '';
|
42 |
|
43 |
public function __construct( $poll_id = -99, $offset = 0 ) {
|
44 |
//do not load id= -99
|
45 |
$poll = NULL;
|
46 |
//Current Active Poll id = -1
|
47 |
if ( -1 == $poll_id ) {
|
48 |
+
$poll = self::get_current_active_poll( $offset );
|
49 |
}
|
50 |
//Latest Poll id = -2
|
51 |
elseif ( -2 == $poll_id) {
|
52 |
+
$polls = self::get_yop_polls_filter_search( 'date_added', 'desc' );
|
53 |
+
$poll = ( $polls[$offset] ) ? $polls[$offset] : NULL ;
|
54 |
}
|
55 |
//Random Poll id = -3
|
56 |
elseif ( -3 == $poll_id ) {
|
57 |
+
$polls = self::get_yop_polls_filter_search( 'rand()', '' );
|
58 |
+
$poll = $polls[0];
|
59 |
}
|
60 |
//Latest Closed Poll id = -4
|
61 |
elseif ( -4 == $poll_id ) {
|
62 |
+
$poll = self::get_latest_closed_poll( $offset );
|
63 |
}
|
64 |
//normal poll
|
65 |
elseif ( $poll_id > 0 ) {
|
66 |
+
$poll = self::get_poll_from_database_by_id( $poll_id );
|
67 |
}
|
68 |
if ( $poll ) {
|
69 |
+
$this->poll = $poll;
|
70 |
+
$this->poll_options = get_yop_poll_meta( $this->poll['id'], 'options', true );
|
71 |
+
$default_options = get_option( 'yop_poll_options', false );
|
72 |
if ( is_array( $default_options) ) {
|
73 |
if ( count( $default_options ) > 0 ) {
|
74 |
foreach ( $default_options as $option_name => $option_value ) {
|
75 |
if( ! isset( $this->poll_options [ $option_name ] ) )
|
76 |
+
$this->poll_options [ $option_name ] = $option_value;
|
77 |
}
|
78 |
}
|
79 |
}
|
81 |
}
|
82 |
|
83 |
public static function get_poll_options_by_id( $poll_id = 0 ) {
|
84 |
+
$poll_options = get_yop_poll_meta( $poll_id, 'options', true );
|
85 |
+
$default_options = get_option( 'yop_poll_options', false );
|
86 |
if ( is_array( $default_options) ) {
|
87 |
if ( count( $default_options ) > 0 ) {
|
88 |
foreach ( $default_options as $option_name => $option_value ) {
|
89 |
if( ! isset( $poll_options [ $option_name ] ) )
|
90 |
+
$poll_options [ $option_name ] = $option_value;
|
91 |
}
|
92 |
}
|
93 |
}
|
95 |
}
|
96 |
|
97 |
public function set_unique_id( $unique_id ) {
|
98 |
+
$this->unique_id = $unique_id;
|
99 |
}
|
100 |
|
101 |
public function get_unique_id() {
|
103 |
}
|
104 |
|
105 |
private function countAnswers( $request = array() ) {
|
106 |
+
$answers = 0;
|
107 |
if ( isset( $request['yop_poll_answer'] ) )
|
108 |
+
$answers = count( $request['yop_poll_answer'] );
|
109 |
if ( isset( $request['yop_poll_options']['allow_other_answers'] ) )
|
110 |
if ( 'yes' == $request['yop_poll_options']['allow_other_answers'] )
|
111 |
+
$answers = $answers + 1;
|
112 |
return $answers;
|
113 |
}
|
114 |
|
391 |
}
|
392 |
|
393 |
if( isset( $request['yop_poll_options']['template'] ) ) {
|
394 |
+
$template = self::get_poll_template_from_database_by_id( $request['yop_poll_options']['template'] );
|
395 |
if ( ! $template ) {
|
396 |
$this->error = __( 'Template not found!', 'yop_poll' );
|
397 |
return false;
|
423 |
}
|
424 |
|
425 |
public function make_poll_template_from_request_data ( $request = array(), $config = null ) {
|
426 |
+
$this->template['id'] = isset( $request['template_id'] ) ? trim( $request['template_id'] ) : null;
|
427 |
+
$this->template['name'] = isset( $request['yop_poll_template_name'] ) ? trim( $request['yop_poll_template_name'] ) : null;
|
428 |
+
$this->template['before_vote_template'] = isset( $request['yop_poll_before_vote_template'] ) ? trim( $request['yop_poll_before_vote_template'] ) : null;
|
429 |
+
$this->template['after_vote_template'] = isset( $request['yop_poll_after_vote_template'] ) ? trim( $request['yop_poll_after_vote_template'] ) : null;
|
430 |
+
$this->template['before_start_date_template'] = isset( $request['yop_poll_template_before_start_date'] ) ? trim( $request['yop_poll_template_before_start_date'] ) : null;
|
431 |
+
$this->template['after_end_date_template'] = isset( $request['yop_poll_template_after_end_date'] ) ? trim( $request['yop_poll_template_after_end_date'] ) : null;
|
432 |
+
$this->template['css'] = isset( $request['yop_poll_template_css'] ) ? trim( $request['yop_poll_template_css'] ) : null;
|
433 |
+
$this->template['js'] = isset( $request['yop_poll_template_css'] ) ? trim( $request['yop_poll_template_js'] ) : null;
|
434 |
+
$this->template['reset_template_id'] = isset( $request['yop_poll_reset_template_id'] ) ? trim( $request['yop_poll_reset_template_id'] ) : null;
|
435 |
}
|
436 |
|
437 |
public function add_poll_template_to_database ( $request = array(), $config = null ) {
|
439 |
$this->make_poll_template_from_request_data( $request, $config );
|
440 |
$result = self::get_poll_template_from_database_by_name( $this->template['name'] );
|
441 |
if( !isset( $result['id'] ) ) {
|
442 |
+
$this->template['id'] = self::insert_poll_template_to_database( $this->template );
|
443 |
return $this->template['id'];
|
444 |
}
|
445 |
else {
|
454 |
|
455 |
public static function add_bans( $request ) {
|
456 |
global $wpdb;
|
457 |
+
$success = NULL;
|
458 |
+
$error = NULL;
|
459 |
|
460 |
if ( ! isset( $request['ban_poll_id'] ) ) {
|
461 |
+
$error = __( 'You must choose a yop poll! ');
|
462 |
}
|
463 |
elseif ( ! ctype_digit( $request['ban_poll_id'] ) ) {
|
464 |
+
$error = __( 'Invalid Yop Poll! Please try again! ');
|
465 |
}
|
466 |
elseif( ! in_array( $request['ban_type'], array( 'ip', 'username', 'email') ) ) {
|
467 |
+
$error = __( 'You must choose a ban type!', 'yop_poll');
|
468 |
}
|
469 |
elseif ( '' == trim( $request['ban_value'] ) ) {
|
470 |
+
$error = __( 'You must choose a ban value!', 'yop_poll');
|
471 |
}
|
472 |
else {
|
473 |
+
$ban_textarea = nl2br( $request['ban_value'] );
|
474 |
+
$values = explode( '<br />', $ban_textarea );
|
475 |
if( count( $values ) > 0 ) {
|
476 |
foreach( $values as $value ) {
|
477 |
if ( '' != trim( $value )) {
|
478 |
+
$ban = array(
|
479 |
+
'poll_id' => trim($request['ban_poll_id']),
|
480 |
+
'type' => trim($request['ban_type']),
|
481 |
+
'value' => trim($value)
|
482 |
);
|
483 |
+
$exist = $wpdb->get_var(
|
484 |
$wpdb->prepare(
|
485 |
"
|
486 |
SELECT id
|
554 |
private static function reset_poll_template_in_database( $poll_id, $template_id ) {
|
555 |
global $wpdb;
|
556 |
|
557 |
+
$sql = "UPDATE `" . $wpdb->yop_poll_templates . "` SET ";
|
558 |
switch ( $template_id ) {
|
559 |
+
case '1': //White
|
560 |
+
$sql .= "`before_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-ANSWER-CHECK-INPUT% \r\n %POLL-ANSWER-LABEL%\r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_CONTAINER]\r\n [OTHER_ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-OTHER-ANSWER-CHECK-INPUT% \r\n %POLL-OTHER-ANSWER-LABEL% \r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-OTHER-ANSWER-TEXT-INPUT% \r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/OTHER_ANSWER_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-custom-%POLL-ID%\\".'"'.">\r\n <ul>\r\n [CUSTOM_FIELD_CONTAINER]\r\n <li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>\r\n [/CUSTOM_FIELD_CONTAINER]\r\n </ul>\r\n</div> \r\n[CAPTCHA_CONTAINER]\r\n<div id=\"yop-poll-captcha-%POLL-ID%\">\r\n <div class=\"yop-poll-captcha-image-div\" id=\"yop-poll-captcha-image-div-%POLL-ID%\">\r\n %CAPTCHA-IMAGE%\r\n <div class=\"yop-poll-captcha-helpers-div\" id=\"yop-poll-captcha-helpers-div-%POLL-ID%\">%RELOAD-CAPTCHA-IMAGE% </div>\r\n <div class=\"yop_poll_clear\"></div>\r\n </div>\r\n %CAPTCHA-LABEL%\r\n <div class=\"yop-poll-captcha-input-div\" id=\"yop-poll-captcha-input-div-%POLL-ID%\">%CAPTCHA-INPUT%</div>\r\n</div>\r\n[/CAPTCHA_CONTAINER]\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-VOTE-BUTTON%</div>\r\n <div id=\\".'"'."yop-poll-results-%POLL-ID%\\".'"'.">%POLL-VIEW-RESULT-LINK%</div>\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n</div>',
|
561 |
+
`after_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per-%POLL-ID%\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <div>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </div>\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n <div id=\\".'"'."yop-poll-back-%POLL-ID%\\".'"'.">%POLL-BACK-TO-VOTE-LINK%</div>\r\n</div>',
|
562 |
+
`before_start_date_template` = 'This poll is about to <br>\r\nstart at %POLL-START-DATE%<br>\r\nand finish at %POLL-END-DATE%<br>',
|
563 |
+
`after_end_date_template` = 'This poll is closed!\r\nPoll activity: <br>\r\nstart_date %POLL-START-DATE%<br>\r\nend_date %POLL-END-DATE%<br>\r\n\r\nPoll Results:\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-1\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <span class=\\".'"'."pds-clear\\".'"'." style=\\".'"'."display: block;clear: both;height:1px;line-height:1px;\\".'"'."> </span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n%POLL-VOTE-BUTTON%',
|
564 |
+
`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#fff;\r\n padding:10px;\r\n color:#555;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#555; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#555; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',
|
565 |
+
`js` = 'function stripBorder_%POLL-ID%(object) {\r\n object.each(function() {\r\n if( parseInt(jQuery(this).width() ) > 0) {\r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."border-left-width\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."border-right-width\\".'"'.")) );\r\n }\r\n else {\r\n jQuery(this).css(\\".'"'."border-left-width\\".'"'.", \'0px\');\r\n jQuery(this).css(\\".'"'."border-right-width\\".'"'.", \'0px\');\r\n }\r\n });\r\n}\r\nfunction stripPadding_%POLL-ID%(object) {\r\n object.each(function() { \r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) );\r\n });\r\n}\r\n\r\nfunction strip_results_%POLL-ID%() {\r\n stripPadding_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%\\".'"'.") ); \r\n stripBorder_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%\\".'"'."));\r\n}\r\n\r\njQuery(document).ready(function(e) {\r\n if(typeof window.strip_results_%POLL-ID% == \'function\') \r\n strip_results_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_answers_%POLL-ID% == \'function\') \r\n tabulate_answers_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_results_%POLL-ID% == \'function\') \r\n tabulate_results_%POLL-ID%();\r\n \r\n});\r\n\r\nfunction equalWidth_%POLL-ID%(obj, cols, findWidest ) {\r\n findWidest = typeof findWidest !== \'undefined\' ? findWidest : false;\r\n if ( findWidest ) {\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n width = parseInt(thisWidth / cols); \r\n jQuery(this).width(width); \r\n jQuery(this).css(\'float\', \'left\'); \r\n });\r\n }\r\n else {\r\n var widest = 0;\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n if(thisWidth > widest) {\r\n widest = thisWidth; \r\n } \r\n });\r\n width = parseInt( widest / cols); \r\n obj.width(width); \r\n obj.css(\'float\', \'left\'); \r\n } \r\n}\r\n\r\nfunction tabulate_answers_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%\\".'"'."), %ANSWERS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %ANSWERS-TABULATED-COLS%, true );\r\n}\r\n\r\nfunction tabulate_results_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%\\".'"'."), %RESULTS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %RESULTS-TABULATED-COLS%, true );\r\n}',
|
566 |
+
`last_modified` = '".current_time( 'mysql' )."' ";
|
567 |
break;
|
568 |
+
case '2': //Grey
|
569 |
+
$sql .= "`before_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-ANSWER-CHECK-INPUT% \r\n %POLL-ANSWER-LABEL%\r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_CONTAINER]\r\n [OTHER_ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-OTHER-ANSWER-CHECK-INPUT% \r\n %POLL-OTHER-ANSWER-LABEL% \r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-OTHER-ANSWER-TEXT-INPUT% \r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/OTHER_ANSWER_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-custom-%POLL-ID%\\".'"'.">\r\n <ul>\r\n [CUSTOM_FIELD_CONTAINER]\r\n <li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>\r\n [/CUSTOM_FIELD_CONTAINER]\r\n </ul>\r\n</div> \r\n[CAPTCHA_CONTAINER]\r\n<div id=\"yop-poll-captcha-%POLL-ID%\">\r\n <div class=\"yop-poll-captcha-image-div\" id=\"yop-poll-captcha-image-div-%POLL-ID%\">\r\n %CAPTCHA-IMAGE%\r\n <div class=\"yop-poll-captcha-helpers-div\" id=\"yop-poll-captcha-helpers-div-%POLL-ID%\">%RELOAD-CAPTCHA-IMAGE% </div>\r\n <div class=\"yop_poll_clear\"></div>\r\n </div>\r\n %CAPTCHA-LABEL%\r\n <div class=\"yop-poll-captcha-input-div\" id=\"yop-poll-captcha-input-div-%POLL-ID%\">%CAPTCHA-INPUT%</div>\r\n</div>\r\n[/CAPTCHA_CONTAINER]\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-VOTE-BUTTON%</div>\r\n <div id=\\".'"'."yop-poll-results-%POLL-ID%\\".'"'.">%POLL-VIEW-RESULT-LINK%</div>\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n</div>',
|
570 |
+
`after_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per-%POLL-ID%\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <div>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </div>\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n <div id=\\".'"'."yop-poll-back-%POLL-ID%\\".'"'.">%POLL-BACK-TO-VOTE-LINK%</div>\r\n</div>',
|
571 |
+
`before_start_date_template` = 'This poll is about to <br>\r\nstart at %POLL-START-DATE%<br>\r\nand finish at %POLL-END-DATE%<br>',
|
572 |
+
`after_end_date_template` = 'This poll is closed!\r\nPoll activity: <br>\r\nstart_date %POLL-START-DATE%<br>\r\nend_date %POLL-END-DATE%<br>\r\n\r\nPoll Results:\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-1\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <span class=\\".'"'."pds-clear\\".'"'." style=\\".'"'."display: block;clear: both;height:1px;line-height:1px;\\".'"'."> </span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n%POLL-VOTE-BUTTON%',
|
573 |
+
`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#eee;\r\n padding:10px;\r\n color:#000;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#000; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#000; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',
|
574 |
+
`js` = 'function stripBorder_%POLL-ID%(object) {\r\n object.each(function() {\r\n if( parseInt(jQuery(this).width() ) > 0) {\r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."border-left-width\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."border-right-width\\".'"'.")) );\r\n }\r\n else {\r\n jQuery(this).css(\\".'"'."border-left-width\\".'"'.", \'0px\');\r\n jQuery(this).css(\\".'"'."border-right-width\\".'"'.", \'0px\');\r\n }\r\n });\r\n}\r\nfunction stripPadding_%POLL-ID%(object) {\r\n object.each(function() { \r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) );\r\n });\r\n}\r\n\r\nfunction strip_results_%POLL-ID%() {\r\n stripPadding_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%\\".'"'.") ); \r\n stripBorder_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%\\".'"'."));\r\n}\r\n\r\njQuery(document).ready(function(e) {\r\n if(typeof window.strip_results_%POLL-ID% == \'function\') \r\n strip_results_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_answers_%POLL-ID% == \'function\') \r\n tabulate_answers_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_results_%POLL-ID% == \'function\') \r\n tabulate_results_%POLL-ID%();\r\n \r\n});\r\n\r\nfunction equalWidth_%POLL-ID%(obj, cols, findWidest ) {\r\n findWidest = typeof findWidest !== \'undefined\' ? findWidest : false;\r\n if ( findWidest ) {\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n width = parseInt(thisWidth / cols); \r\n jQuery(this).width(width); \r\n jQuery(this).css(\'float\', \'left\'); \r\n });\r\n }\r\n else {\r\n var widest = 0;\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n if(thisWidth > widest) {\r\n widest = thisWidth; \r\n } \r\n });\r\n width = parseInt( widest / cols); \r\n obj.width(width); \r\n obj.css(\'float\', \'left\'); \r\n } \r\n}\r\n\r\nfunction tabulate_answers_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%\\".'"'."), %ANSWERS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %ANSWERS-TABULATED-COLS%, true );\r\n}\r\n\r\nfunction tabulate_results_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%\\".'"'."), %RESULTS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %RESULTS-TABULATED-COLS%, true );\r\n}',
|
575 |
+
`last_modified` = '".current_time( 'mysql' )."' ";
|
576 |
break;
|
577 |
+
case '3': //Dark
|
578 |
+
$sql .= "`before_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-ANSWER-CHECK-INPUT% \r\n %POLL-ANSWER-LABEL%\r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_CONTAINER]\r\n [OTHER_ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-OTHER-ANSWER-CHECK-INPUT% \r\n %POLL-OTHER-ANSWER-LABEL% \r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-OTHER-ANSWER-TEXT-INPUT% \r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/OTHER_ANSWER_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-custom-%POLL-ID%\\".'"'.">\r\n <ul>\r\n [CUSTOM_FIELD_CONTAINER]\r\n <li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>\r\n [/CUSTOM_FIELD_CONTAINER]\r\n </ul>\r\n</div> \r\n[CAPTCHA_CONTAINER]\r\n<div id=\"yop-poll-captcha-%POLL-ID%\">\r\n <div class=\"yop-poll-captcha-image-div\" id=\"yop-poll-captcha-image-div-%POLL-ID%\">\r\n %CAPTCHA-IMAGE%\r\n <div class=\"yop-poll-captcha-helpers-div\" id=\"yop-poll-captcha-helpers-div-%POLL-ID%\">%RELOAD-CAPTCHA-IMAGE% </div>\r\n <div class=\"yop_poll_clear\"></div>\r\n </div>\r\n %CAPTCHA-LABEL%\r\n <div class=\"yop-poll-captcha-input-div\" id=\"yop-poll-captcha-input-div-%POLL-ID%\">%CAPTCHA-INPUT%</div>\r\n</div>\r\n[/CAPTCHA_CONTAINER]\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-VOTE-BUTTON%</div>\r\n <div id=\\".'"'."yop-poll-results-%POLL-ID%\\".'"'.">%POLL-VIEW-RESULT-LINK%</div>\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n</div>',
|
579 |
+
`after_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per-%POLL-ID%\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <div>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </div>\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n <div id=\\".'"'."yop-poll-back-%POLL-ID%\\".'"'.">%POLL-BACK-TO-VOTE-LINK%</div>\r\n</div>',
|
580 |
+
`before_start_date_template` = 'This poll is about to <br>\r\nstart at %POLL-START-DATE%<br>\r\nand finish at %POLL-END-DATE%<br>',
|
581 |
+
`after_end_date_template` = 'This poll is closed!\r\nPoll activity: <br>\r\nstart_date %POLL-START-DATE%<br>\r\nend_date %POLL-END-DATE%<br>\r\n\r\nPoll Results:\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-1\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <span class=\\".'"'."pds-clear\\".'"'." style=\\".'"'."display: block;clear: both;height:1px;line-height:1px;\\".'"'."> </span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n%POLL-VOTE-BUTTON%',
|
582 |
+
`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#555;\r\n padding:10px;\r\n color:#fff;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#333333; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#fff; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#fff; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',
|
583 |
+
`js` = 'function stripBorder_%POLL-ID%(object) {\r\n object.each(function() {\r\n if( parseInt(jQuery(this).width() ) > 0) {\r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."border-left-width\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."border-right-width\\".'"'.")) );\r\n }\r\n else {\r\n jQuery(this).css(\\".'"'."border-left-width\\".'"'.", \'0px\');\r\n jQuery(this).css(\\".'"'."border-right-width\\".'"'.", \'0px\');\r\n }\r\n });\r\n}\r\nfunction stripPadding_%POLL-ID%(object) {\r\n object.each(function() { \r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) );\r\n });\r\n}\r\n\r\nfunction strip_results_%POLL-ID%() {\r\n stripPadding_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%\\".'"'.") ); \r\n stripBorder_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%\\".'"'."));\r\n}\r\n\r\njQuery(document).ready(function(e) {\r\n if(typeof window.strip_results_%POLL-ID% == \'function\') \r\n strip_results_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_answers_%POLL-ID% == \'function\') \r\n tabulate_answers_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_results_%POLL-ID% == \'function\') \r\n tabulate_results_%POLL-ID%();\r\n \r\n});\r\n\r\nfunction equalWidth_%POLL-ID%(obj, cols, findWidest ) {\r\n findWidest = typeof findWidest !== \'undefined\' ? findWidest : false;\r\n if ( findWidest ) {\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n width = parseInt(thisWidth / cols); \r\n jQuery(this).width(width); \r\n jQuery(this).css(\'float\', \'left\'); \r\n });\r\n }\r\n else {\r\n var widest = 0;\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n if(thisWidth > widest) {\r\n widest = thisWidth; \r\n } \r\n });\r\n width = parseInt( widest / cols); \r\n obj.width(width); \r\n obj.css(\'float\', \'left\'); \r\n } \r\n}\r\n\r\nfunction tabulate_answers_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%\\".'"'."), %ANSWERS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %ANSWERS-TABULATED-COLS%, true );\r\n}\r\n\r\nfunction tabulate_results_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%\\".'"'."), %RESULTS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %RESULTS-TABULATED-COLS%, true );\r\n}',
|
584 |
+
`last_modified` = '".current_time( 'mysql' )."' ";
|
585 |
break;
|
586 |
+
case '4': //Blue v1
|
587 |
+
$sql .= "`before_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-ANSWER-CHECK-INPUT% \r\n %POLL-ANSWER-LABEL%\r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_CONTAINER]\r\n [OTHER_ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-OTHER-ANSWER-CHECK-INPUT% \r\n %POLL-OTHER-ANSWER-LABEL% \r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-OTHER-ANSWER-TEXT-INPUT% \r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/OTHER_ANSWER_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-custom-%POLL-ID%\\".'"'.">\r\n <ul>\r\n [CUSTOM_FIELD_CONTAINER]\r\n <li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>\r\n [/CUSTOM_FIELD_CONTAINER]\r\n </ul>\r\n</div> \r\n[CAPTCHA_CONTAINER]\r\n<div id=\"yop-poll-captcha-%POLL-ID%\">\r\n <div class=\"yop-poll-captcha-image-div\" id=\"yop-poll-captcha-image-div-%POLL-ID%\">\r\n %CAPTCHA-IMAGE%\r\n <div class=\"yop-poll-captcha-helpers-div\" id=\"yop-poll-captcha-helpers-div-%POLL-ID%\">%RELOAD-CAPTCHA-IMAGE% </div>\r\n <div class=\"yop_poll_clear\"></div>\r\n </div>\r\n %CAPTCHA-LABEL%\r\n <div class=\"yop-poll-captcha-input-div\" id=\"yop-poll-captcha-input-div-%POLL-ID%\">%CAPTCHA-INPUT%</div>\r\n</div>\r\n[/CAPTCHA_CONTAINER]\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-VOTE-BUTTON%</div>\r\n <div id=\\".'"'."yop-poll-results-%POLL-ID%\\".'"'.">%POLL-VIEW-RESULT-LINK%</div>\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n</div>',
|
588 |
+
`after_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per-%POLL-ID%\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <div>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </div>\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n <div id=\\".'"'."yop-poll-back-%POLL-ID%\\".'"'.">%POLL-BACK-TO-VOTE-LINK%</div>\r\n</div>',
|
589 |
+
`before_start_date_template` = 'This poll is about to <br>\r\nstart at %POLL-START-DATE%<br>\r\nand finish at %POLL-END-DATE%<br>',
|
590 |
+
`after_end_date_template` = 'This poll is closed!\r\nPoll activity: <br>\r\nstart_date %POLL-START-DATE%<br>\r\nend_date %POLL-END-DATE%<br>\r\n\r\nPoll Results:\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-1\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <span class=\\".'"'."pds-clear\\".'"'." style=\\".'"'."display: block;clear: both;height:1px;line-height:1px;\\".'"'."> </span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n%POLL-VOTE-BUTTON%',
|
591 |
+
`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#327BD6;\r\n padding:10px;\r\n color:#fff;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#fff; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#fff; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',
|
592 |
+
`js` = 'function stripBorder_%POLL-ID%(object) {\r\n object.each(function() {\r\n if( parseInt(jQuery(this).width() ) > 0) {\r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."border-left-width\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."border-right-width\\".'"'.")) );\r\n }\r\n else {\r\n jQuery(this).css(\\".'"'."border-left-width\\".'"'.", \'0px\');\r\n jQuery(this).css(\\".'"'."border-right-width\\".'"'.", \'0px\');\r\n }\r\n });\r\n}\r\nfunction stripPadding_%POLL-ID%(object) {\r\n object.each(function() { \r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) );\r\n });\r\n}\r\n\r\nfunction strip_results_%POLL-ID%() {\r\n stripPadding_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%\\".'"'.") ); \r\n stripBorder_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%\\".'"'."));\r\n}\r\n\r\njQuery(document).ready(function(e) {\r\n if(typeof window.strip_results_%POLL-ID% == \'function\') \r\n strip_results_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_answers_%POLL-ID% == \'function\') \r\n tabulate_answers_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_results_%POLL-ID% == \'function\') \r\n tabulate_results_%POLL-ID%();\r\n \r\n});\r\n\r\nfunction equalWidth_%POLL-ID%(obj, cols, findWidest ) {\r\n findWidest = typeof findWidest !== \'undefined\' ? findWidest : false;\r\n if ( findWidest ) {\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n width = parseInt(thisWidth / cols); \r\n jQuery(this).width(width); \r\n jQuery(this).css(\'float\', \'left\'); \r\n });\r\n }\r\n else {\r\n var widest = 0;\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n if(thisWidth > widest) {\r\n widest = thisWidth; \r\n } \r\n });\r\n width = parseInt( widest / cols); \r\n obj.width(width); \r\n obj.css(\'float\', \'left\'); \r\n } \r\n}\r\n\r\nfunction tabulate_answers_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%\\".'"'."), %ANSWERS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %ANSWERS-TABULATED-COLS%, true );\r\n}\r\n\r\nfunction tabulate_results_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%\\".'"'."), %RESULTS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %RESULTS-TABULATED-COLS%, true );\r\n}',
|
593 |
+
`last_modified` = '".current_time( 'mysql' )."' ";
|
594 |
break;
|
595 |
+
case '5': //Blue v2
|
596 |
+
$sql .= "`before_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-ANSWER-CHECK-INPUT% \r\n %POLL-ANSWER-LABEL%\r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_CONTAINER]\r\n [OTHER_ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-OTHER-ANSWER-CHECK-INPUT% \r\n %POLL-OTHER-ANSWER-LABEL% \r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-OTHER-ANSWER-TEXT-INPUT% \r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/OTHER_ANSWER_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-custom-%POLL-ID%\\".'"'.">\r\n <ul>\r\n [CUSTOM_FIELD_CONTAINER]\r\n <li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>\r\n [/CUSTOM_FIELD_CONTAINER]\r\n </ul>\r\n</div> \r\n[CAPTCHA_CONTAINER]\r\n<div id=\"yop-poll-captcha-%POLL-ID%\">\r\n <div class=\"yop-poll-captcha-image-div\" id=\"yop-poll-captcha-image-div-%POLL-ID%\">\r\n %CAPTCHA-IMAGE%\r\n <div class=\"yop-poll-captcha-helpers-div\" id=\"yop-poll-captcha-helpers-div-%POLL-ID%\">%RELOAD-CAPTCHA-IMAGE% </div>\r\n <div class=\"yop_poll_clear\"></div>\r\n </div>\r\n %CAPTCHA-LABEL%\r\n <div class=\"yop-poll-captcha-input-div\" id=\"yop-poll-captcha-input-div-%POLL-ID%\">%CAPTCHA-INPUT%</div>\r\n</div>\r\n[/CAPTCHA_CONTAINER]\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-VOTE-BUTTON%</div>\r\n <div id=\\".'"'."yop-poll-results-%POLL-ID%\\".'"'.">%POLL-VIEW-RESULT-LINK%</div>\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n</div>',
|
597 |
+
`after_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per-%POLL-ID%\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <div>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </div>\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n <div id=\\".'"'."yop-poll-back-%POLL-ID%\\".'"'.">%POLL-BACK-TO-VOTE-LINK%</div>\r\n</div>',
|
598 |
+
`before_start_date_template` = 'This poll is about to <br>\r\nstart at %POLL-START-DATE%<br>\r\nand finish at %POLL-END-DATE%<br>',
|
599 |
+
`after_end_date_template` = 'This poll is closed!\r\nPoll activity: <br>\r\nstart_date %POLL-START-DATE%<br>\r\nend_date %POLL-END-DATE%<br>\r\n\r\nPoll Results:\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-1\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <span class=\\".'"'."pds-clear\\".'"'." style=\\".'"'."display: block;clear: both;height:1px;line-height:1px;\\".'"'."> </span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n%POLL-VOTE-BUTTON%',
|
600 |
+
`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#fff;\r\n padding:0px;\r\n color:#555;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-weight:bold;\r\n background:#327BD6;\r\n color:#fff;\r\n padding:5px;\r\n text-align:center;\r\n font-size:12px;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#327BD6; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#327BD6; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',
|
601 |
+
`js` = 'function stripBorder_%POLL-ID%(object) {\r\n object.each(function() {\r\n if( parseInt(jQuery(this).width() ) > 0) {\r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."border-left-width\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."border-right-width\\".'"'.")) );\r\n }\r\n else {\r\n jQuery(this).css(\\".'"'."border-left-width\\".'"'.", \'0px\');\r\n jQuery(this).css(\\".'"'."border-right-width\\".'"'.", \'0px\');\r\n }\r\n });\r\n}\r\nfunction stripPadding_%POLL-ID%(object) {\r\n object.each(function() { \r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) );\r\n });\r\n}\r\n\r\nfunction strip_results_%POLL-ID%() {\r\n stripPadding_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%\\".'"'.") ); \r\n stripBorder_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%\\".'"'."));\r\n}\r\n\r\njQuery(document).ready(function(e) {\r\n if(typeof window.strip_results_%POLL-ID% == \'function\') \r\n strip_results_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_answers_%POLL-ID% == \'function\') \r\n tabulate_answers_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_results_%POLL-ID% == \'function\') \r\n tabulate_results_%POLL-ID%();\r\n \r\n});\r\n\r\nfunction equalWidth_%POLL-ID%(obj, cols, findWidest ) {\r\n findWidest = typeof findWidest !== \'undefined\' ? findWidest : false;\r\n if ( findWidest ) {\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n width = parseInt(thisWidth / cols); \r\n jQuery(this).width(width); \r\n jQuery(this).css(\'float\', \'left\'); \r\n });\r\n }\r\n else {\r\n var widest = 0;\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n if(thisWidth > widest) {\r\n widest = thisWidth; \r\n } \r\n });\r\n width = parseInt( widest / cols); \r\n obj.width(width); \r\n obj.css(\'float\', \'left\'); \r\n } \r\n}\r\n\r\nfunction tabulate_answers_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%\\".'"'."), %ANSWERS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %ANSWERS-TABULATED-COLS%, true );\r\n}\r\n\r\nfunction tabulate_results_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%\\".'"'."), %RESULTS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %RESULTS-TABULATED-COLS%, true );\r\n}',
|
602 |
+
`last_modified` = '".current_time( 'mysql' )."' ";
|
603 |
break;
|
604 |
+
case '6': //Blue v3
|
605 |
+
$sql .= "`before_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-ANSWER-CHECK-INPUT% \r\n %POLL-ANSWER-LABEL%\r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_CONTAINER]\r\n [OTHER_ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-OTHER-ANSWER-CHECK-INPUT% \r\n %POLL-OTHER-ANSWER-LABEL% \r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-OTHER-ANSWER-TEXT-INPUT% \r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/OTHER_ANSWER_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-custom-%POLL-ID%\\".'"'.">\r\n <ul>\r\n [CUSTOM_FIELD_CONTAINER]\r\n <li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>\r\n [/CUSTOM_FIELD_CONTAINER]\r\n </ul>\r\n</div> \r\n[CAPTCHA_CONTAINER]\r\n<div id=\"yop-poll-captcha-%POLL-ID%\">\r\n <div class=\"yop-poll-captcha-image-div\" id=\"yop-poll-captcha-image-div-%POLL-ID%\">\r\n %CAPTCHA-IMAGE%\r\n <div class=\"yop-poll-captcha-helpers-div\" id=\"yop-poll-captcha-helpers-div-%POLL-ID%\">%RELOAD-CAPTCHA-IMAGE% </div>\r\n <div class=\"yop_poll_clear\"></div>\r\n </div>\r\n %CAPTCHA-LABEL%\r\n <div class=\"yop-poll-captcha-input-div\" id=\"yop-poll-captcha-input-div-%POLL-ID%\">%CAPTCHA-INPUT%</div>\r\n</div>\r\n[/CAPTCHA_CONTAINER]\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-VOTE-BUTTON%</div>\r\n <div id=\\".'"'."yop-poll-results-%POLL-ID%\\".'"'.">%POLL-VIEW-RESULT-LINK%</div>\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n</div>',
|
606 |
+
`after_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per-%POLL-ID%\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <div>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </div>\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n <div id=\\".'"'."yop-poll-back-%POLL-ID%\\".'"'.">%POLL-BACK-TO-VOTE-LINK%</div>\r\n</div>',
|
607 |
+
`before_start_date_template` = 'This poll is about to <br>\r\nstart at %POLL-START-DATE%<br>\r\nand finish at %POLL-END-DATE%<br>',
|
608 |
+
`after_end_date_template` = 'This poll is closed!\r\nPoll activity: <br>\r\nstart_date %POLL-START-DATE%<br>\r\nend_date %POLL-END-DATE%<br>\r\n\r\nPoll Results:\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-1\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <span class=\\".'"'."pds-clear\\".'"'." style=\\".'"'."display: block;clear: both;height:1px;line-height:1px;\\".'"'."> </span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n%POLL-VOTE-BUTTON%',
|
609 |
+
`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#fff;\r\n padding:10px;\r\n color:#555;\r\n overflow:hidden;\r\n font-size:12px;\r\n border:5px solid #327BD6;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#327BD6; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#327BD6; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',
|
610 |
+
`js` = 'function stripBorder_%POLL-ID%(object) {\r\n object.each(function() {\r\n if( parseInt(jQuery(this).width() ) > 0) {\r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."border-left-width\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."border-right-width\\".'"'.")) );\r\n }\r\n else {\r\n jQuery(this).css(\\".'"'."border-left-width\\".'"'.", \'0px\');\r\n jQuery(this).css(\\".'"'."border-right-width\\".'"'.", \'0px\');\r\n }\r\n });\r\n}\r\nfunction stripPadding_%POLL-ID%(object) {\r\n object.each(function() { \r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) );\r\n });\r\n}\r\n\r\nfunction strip_results_%POLL-ID%() {\r\n stripPadding_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%\\".'"'.") ); \r\n stripBorder_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%\\".'"'."));\r\n}\r\n\r\njQuery(document).ready(function(e) {\r\n if(typeof window.strip_results_%POLL-ID% == \'function\') \r\n strip_results_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_answers_%POLL-ID% == \'function\') \r\n tabulate_answers_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_results_%POLL-ID% == \'function\') \r\n tabulate_results_%POLL-ID%();\r\n \r\n});\r\n\r\nfunction equalWidth_%POLL-ID%(obj, cols, findWidest ) {\r\n findWidest = typeof findWidest !== \'undefined\' ? findWidest : false;\r\n if ( findWidest ) {\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n width = parseInt(thisWidth / cols); \r\n jQuery(this).width(width); \r\n jQuery(this).css(\'float\', \'left\'); \r\n });\r\n }\r\n else {\r\n var widest = 0;\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n if(thisWidth > widest) {\r\n widest = thisWidth; \r\n } \r\n });\r\n width = parseInt( widest / cols); \r\n obj.width(width); \r\n obj.css(\'float\', \'left\'); \r\n } \r\n}\r\n\r\nfunction tabulate_answers_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%\\".'"'."), %ANSWERS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %ANSWERS-TABULATED-COLS%, true );\r\n}\r\n\r\nfunction tabulate_results_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%\\".'"'."), %RESULTS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %RESULTS-TABULATED-COLS%, true );\r\n}',
|
611 |
+
`last_modified` = '".current_time( 'mysql' )."' ";
|
612 |
break;
|
613 |
+
case '7': //Red v1
|
614 |
+
$sql .= "`before_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-ANSWER-CHECK-INPUT% \r\n %POLL-ANSWER-LABEL%\r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_CONTAINER]\r\n [OTHER_ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-OTHER-ANSWER-CHECK-INPUT% \r\n %POLL-OTHER-ANSWER-LABEL% \r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-OTHER-ANSWER-TEXT-INPUT% \r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/OTHER_ANSWER_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-custom-%POLL-ID%\\".'"'.">\r\n <ul>\r\n [CUSTOM_FIELD_CONTAINER]\r\n <li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>\r\n [/CUSTOM_FIELD_CONTAINER]\r\n </ul>\r\n</div> \r\n[CAPTCHA_CONTAINER]\r\n<div id=\"yop-poll-captcha-%POLL-ID%\">\r\n <div class=\"yop-poll-captcha-image-div\" id=\"yop-poll-captcha-image-div-%POLL-ID%\">\r\n %CAPTCHA-IMAGE%\r\n <div class=\"yop-poll-captcha-helpers-div\" id=\"yop-poll-captcha-helpers-div-%POLL-ID%\">%RELOAD-CAPTCHA-IMAGE% </div>\r\n <div class=\"yop_poll_clear\"></div>\r\n </div>\r\n %CAPTCHA-LABEL%\r\n <div class=\"yop-poll-captcha-input-div\" id=\"yop-poll-captcha-input-div-%POLL-ID%\">%CAPTCHA-INPUT%</div>\r\n</div>\r\n[/CAPTCHA_CONTAINER]\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-VOTE-BUTTON%</div>\r\n <div id=\\".'"'."yop-poll-results-%POLL-ID%\\".'"'.">%POLL-VIEW-RESULT-LINK%</div>\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n</div>',
|
615 |
+
`after_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per-%POLL-ID%\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <div>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </div>\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n <div id=\\".'"'."yop-poll-back-%POLL-ID%\\".'"'.">%POLL-BACK-TO-VOTE-LINK%</div>\r\n</div>',
|
616 |
+
`before_start_date_template` = 'This poll is about to <br>\r\nstart at %POLL-START-DATE%<br>\r\nand finish at %POLL-END-DATE%<br>',
|
617 |
+
`after_end_date_template` = 'This poll is closed!\r\nPoll activity: <br>\r\nstart_date %POLL-START-DATE%<br>\r\nend_date %POLL-END-DATE%<br>\r\n\r\nPoll Results:\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-1\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <span class=\\".'"'."pds-clear\\".'"'." style=\\".'"'."display: block;clear: both;height:1px;line-height:1px;\\".'"'."> </span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n%POLL-VOTE-BUTTON%',
|
618 |
+
`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#B70004;\r\n padding:10px;\r\n color:#fff;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#fff; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#fff; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',
|
619 |
+
`js` = 'function stripBorder_%POLL-ID%(object) {\r\n object.each(function() {\r\n if( parseInt(jQuery(this).width() ) > 0) {\r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."border-left-width\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."border-right-width\\".'"'.")) );\r\n }\r\n else {\r\n jQuery(this).css(\\".'"'."border-left-width\\".'"'.", \'0px\');\r\n jQuery(this).css(\\".'"'."border-right-width\\".'"'.", \'0px\');\r\n }\r\n });\r\n}\r\nfunction stripPadding_%POLL-ID%(object) {\r\n object.each(function() { \r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) );\r\n });\r\n}\r\n\r\nfunction strip_results_%POLL-ID%() {\r\n stripPadding_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%\\".'"'.") ); \r\n stripBorder_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%\\".'"'."));\r\n}\r\n\r\njQuery(document).ready(function(e) {\r\n if(typeof window.strip_results_%POLL-ID% == \'function\') \r\n strip_results_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_answers_%POLL-ID% == \'function\') \r\n tabulate_answers_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_results_%POLL-ID% == \'function\') \r\n tabulate_results_%POLL-ID%();\r\n \r\n});\r\n\r\nfunction equalWidth_%POLL-ID%(obj, cols, findWidest ) {\r\n findWidest = typeof findWidest !== \'undefined\' ? findWidest : false;\r\n if ( findWidest ) {\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n width = parseInt(thisWidth / cols); \r\n jQuery(this).width(width); \r\n jQuery(this).css(\'float\', \'left\'); \r\n });\r\n }\r\n else {\r\n var widest = 0;\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n if(thisWidth > widest) {\r\n widest = thisWidth; \r\n } \r\n });\r\n width = parseInt( widest / cols); \r\n obj.width(width); \r\n obj.css(\'float\', \'left\'); \r\n } \r\n}\r\n\r\nfunction tabulate_answers_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%\\".'"'."), %ANSWERS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %ANSWERS-TABULATED-COLS%, true );\r\n}\r\n\r\nfunction tabulate_results_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%\\".'"'."), %RESULTS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %RESULTS-TABULATED-COLS%, true );\r\n}',
|
620 |
+
`last_modified` = '".current_time( 'mysql' )."' ";
|
621 |
break;
|
622 |
+
case '8': //Red v2
|
623 |
+
$sql .= "`before_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-ANSWER-CHECK-INPUT% \r\n %POLL-ANSWER-LABEL%\r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_CONTAINER]\r\n [OTHER_ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-OTHER-ANSWER-CHECK-INPUT% \r\n %POLL-OTHER-ANSWER-LABEL% \r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-OTHER-ANSWER-TEXT-INPUT% \r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/OTHER_ANSWER_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-custom-%POLL-ID%\\".'"'.">\r\n <ul>\r\n [CUSTOM_FIELD_CONTAINER]\r\n <li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>\r\n [/CUSTOM_FIELD_CONTAINER]\r\n </ul>\r\n</div> \r\n[CAPTCHA_CONTAINER]\r\n<div id=\"yop-poll-captcha-%POLL-ID%\">\r\n <div class=\"yop-poll-captcha-image-div\" id=\"yop-poll-captcha-image-div-%POLL-ID%\">\r\n %CAPTCHA-IMAGE%\r\n <div class=\"yop-poll-captcha-helpers-div\" id=\"yop-poll-captcha-helpers-div-%POLL-ID%\">%RELOAD-CAPTCHA-IMAGE% </div>\r\n <div class=\"yop_poll_clear\"></div>\r\n </div>\r\n %CAPTCHA-LABEL%\r\n <div class=\"yop-poll-captcha-input-div\" id=\"yop-poll-captcha-input-div-%POLL-ID%\">%CAPTCHA-INPUT%</div>\r\n</div>\r\n[/CAPTCHA_CONTAINER]\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-VOTE-BUTTON%</div>\r\n <div id=\\".'"'."yop-poll-results-%POLL-ID%\\".'"'.">%POLL-VIEW-RESULT-LINK%</div>\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n</div>',
|
624 |
+
`after_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per-%POLL-ID%\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <div>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </div>\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n <div id=\\".'"'."yop-poll-back-%POLL-ID%\\".'"'.">%POLL-BACK-TO-VOTE-LINK%</div>\r\n</div>',
|
625 |
+
`before_start_date_template` = 'This poll is about to <br>\r\nstart at %POLL-START-DATE%<br>\r\nand finish at %POLL-END-DATE%<br>',
|
626 |
+
`after_end_date_template` = 'This poll is closed!\r\nPoll activity: <br>\r\nstart_date %POLL-START-DATE%<br>\r\nend_date %POLL-END-DATE%<br>\r\n\r\nPoll Results:\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-1\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <span class=\\".'"'."pds-clear\\".'"'." style=\\".'"'."display: block;clear: both;height:1px;line-height:1px;\\".'"'."> </span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n%POLL-VOTE-BUTTON%',
|
627 |
+
`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#fff;\r\n padding:0px;\r\n color:#555;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-weight:bold;\r\n background:#B70004;\r\n color:#fff;\r\n padding:5px;\r\n text-align:center;\r\n font-size:12px;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#B70004; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#B70004; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',
|
628 |
+
`js` = 'function stripBorder_%POLL-ID%(object) {\r\n object.each(function() {\r\n if( parseInt(jQuery(this).width() ) > 0) {\r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."border-left-width\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."border-right-width\\".'"'.")) );\r\n }\r\n else {\r\n jQuery(this).css(\\".'"'."border-left-width\\".'"'.", \'0px\');\r\n jQuery(this).css(\\".'"'."border-right-width\\".'"'.", \'0px\');\r\n }\r\n });\r\n}\r\nfunction stripPadding_%POLL-ID%(object) {\r\n object.each(function() { \r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) );\r\n });\r\n}\r\n\r\nfunction strip_results_%POLL-ID%() {\r\n stripPadding_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%\\".'"'.") ); \r\n stripBorder_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%\\".'"'."));\r\n}\r\n\r\njQuery(document).ready(function(e) {\r\n if(typeof window.strip_results_%POLL-ID% == \'function\') \r\n strip_results_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_answers_%POLL-ID% == \'function\') \r\n tabulate_answers_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_results_%POLL-ID% == \'function\') \r\n tabulate_results_%POLL-ID%();\r\n \r\n});\r\n\r\nfunction equalWidth_%POLL-ID%(obj, cols, findWidest ) {\r\n findWidest = typeof findWidest !== \'undefined\' ? findWidest : false;\r\n if ( findWidest ) {\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n width = parseInt(thisWidth / cols); \r\n jQuery(this).width(width); \r\n jQuery(this).css(\'float\', \'left\'); \r\n });\r\n }\r\n else {\r\n var widest = 0;\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n if(thisWidth > widest) {\r\n widest = thisWidth; \r\n } \r\n });\r\n width = parseInt( widest / cols); \r\n obj.width(width); \r\n obj.css(\'float\', \'left\'); \r\n } \r\n}\r\n\r\nfunction tabulate_answers_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%\\".'"'."), %ANSWERS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %ANSWERS-TABULATED-COLS%, true );\r\n}\r\n\r\nfunction tabulate_results_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%\\".'"'."), %RESULTS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %RESULTS-TABULATED-COLS%, true );\r\n}',
|
629 |
+
`last_modified` = '".current_time( 'mysql' )."' ";
|
630 |
break;
|
631 |
+
case '9': //Red v3
|
632 |
+
$sql .= "`before_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-ANSWER-CHECK-INPUT% \r\n %POLL-ANSWER-LABEL%\r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_CONTAINER]\r\n [OTHER_ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-OTHER-ANSWER-CHECK-INPUT% \r\n %POLL-OTHER-ANSWER-LABEL% \r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-OTHER-ANSWER-TEXT-INPUT% \r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/OTHER_ANSWER_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-custom-%POLL-ID%\\".'"'.">\r\n <ul>\r\n [CUSTOM_FIELD_CONTAINER]\r\n <li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>\r\n [/CUSTOM_FIELD_CONTAINER]\r\n </ul>\r\n</div> \r\n[CAPTCHA_CONTAINER]\r\n<div id=\"yop-poll-captcha-%POLL-ID%\">\r\n <div class=\"yop-poll-captcha-image-div\" id=\"yop-poll-captcha-image-div-%POLL-ID%\">\r\n %CAPTCHA-IMAGE%\r\n <div class=\"yop-poll-captcha-helpers-div\" id=\"yop-poll-captcha-helpers-div-%POLL-ID%\">%RELOAD-CAPTCHA-IMAGE% </div>\r\n <div class=\"yop_poll_clear\"></div>\r\n </div>\r\n %CAPTCHA-LABEL%\r\n <div class=\"yop-poll-captcha-input-div\" id=\"yop-poll-captcha-input-div-%POLL-ID%\">%CAPTCHA-INPUT%</div>\r\n</div>\r\n[/CAPTCHA_CONTAINER]\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-VOTE-BUTTON%</div>\r\n <div id=\\".'"'."yop-poll-results-%POLL-ID%\\".'"'.">%POLL-VIEW-RESULT-LINK%</div>\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n</div>',
|
633 |
+
`after_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per-%POLL-ID%\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <div>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </div>\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n <div id=\\".'"'."yop-poll-back-%POLL-ID%\\".'"'.">%POLL-BACK-TO-VOTE-LINK%</div>\r\n</div>',
|
634 |
+
`before_start_date_template` = 'This poll is about to <br>\r\nstart at %POLL-START-DATE%<br>\r\nand finish at %POLL-END-DATE%<br>',
|
635 |
+
`after_end_date_template` = 'This poll is closed!\r\nPoll activity: <br>\r\nstart_date %POLL-START-DATE%<br>\r\nend_date %POLL-END-DATE%<br>\r\n\r\nPoll Results:\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-1\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <span class=\\".'"'."pds-clear\\".'"'." style=\\".'"'."display: block;clear: both;height:1px;line-height:1px;\\".'"'."> </span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n%POLL-VOTE-BUTTON%',
|
636 |
+
`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#fff;\r\n padding:10px;\r\n color:#555;\r\n overflow:hidden;\r\n font-size:12px;\r\n border:5px solid #B70004;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#B70004; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#B70004; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',
|
637 |
+
`js` = 'function stripBorder_%POLL-ID%(object) {\r\n object.each(function() {\r\n if( parseInt(jQuery(this).width() ) > 0) {\r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."border-left-width\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."border-right-width\\".'"'.")) );\r\n }\r\n else {\r\n jQuery(this).css(\\".'"'."border-left-width\\".'"'.", \'0px\');\r\n jQuery(this).css(\\".'"'."border-right-width\\".'"'.", \'0px\');\r\n }\r\n });\r\n}\r\nfunction stripPadding_%POLL-ID%(object) {\r\n object.each(function() { \r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) );\r\n });\r\n}\r\n\r\nfunction strip_results_%POLL-ID%() {\r\n stripPadding_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%\\".'"'.") ); \r\n stripBorder_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%\\".'"'."));\r\n}\r\n\r\njQuery(document).ready(function(e) {\r\n if(typeof window.strip_results_%POLL-ID% == \'function\') \r\n strip_results_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_answers_%POLL-ID% == \'function\') \r\n tabulate_answers_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_results_%POLL-ID% == \'function\') \r\n tabulate_results_%POLL-ID%();\r\n \r\n});\r\n\r\nfunction equalWidth_%POLL-ID%(obj, cols, findWidest ) {\r\n findWidest = typeof findWidest !== \'undefined\' ? findWidest : false;\r\n if ( findWidest ) {\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n width = parseInt(thisWidth / cols); \r\n jQuery(this).width(width); \r\n jQuery(this).css(\'float\', \'left\'); \r\n });\r\n }\r\n else {\r\n var widest = 0;\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n if(thisWidth > widest) {\r\n widest = thisWidth; \r\n } \r\n });\r\n width = parseInt( widest / cols); \r\n obj.width(width); \r\n obj.css(\'float\', \'left\'); \r\n } \r\n}\r\n\r\nfunction tabulate_answers_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%\\".'"'."), %ANSWERS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %ANSWERS-TABULATED-COLS%, true );\r\n}\r\n\r\nfunction tabulate_results_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%\\".'"'."), %RESULTS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %RESULTS-TABULATED-COLS%, true );\r\n}',
|
638 |
+
`last_modified` = '".current_time( 'mysql' )."' ";
|
639 |
break;
|
640 |
+
case '10': //Green v1
|
641 |
+
$sql .= "`before_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-ANSWER-CHECK-INPUT% \r\n %POLL-ANSWER-LABEL%\r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_CONTAINER]\r\n [OTHER_ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-OTHER-ANSWER-CHECK-INPUT% \r\n %POLL-OTHER-ANSWER-LABEL% \r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-OTHER-ANSWER-TEXT-INPUT% \r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/OTHER_ANSWER_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-custom-%POLL-ID%\\".'"'.">\r\n <ul>\r\n [CUSTOM_FIELD_CONTAINER]\r\n <li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>\r\n [/CUSTOM_FIELD_CONTAINER]\r\n </ul>\r\n</div> \r\n[CAPTCHA_CONTAINER]\r\n<div id=\"yop-poll-captcha-%POLL-ID%\">\r\n <div class=\"yop-poll-captcha-image-div\" id=\"yop-poll-captcha-image-div-%POLL-ID%\">\r\n %CAPTCHA-IMAGE%\r\n <div class=\"yop-poll-captcha-helpers-div\" id=\"yop-poll-captcha-helpers-div-%POLL-ID%\">%RELOAD-CAPTCHA-IMAGE% </div>\r\n <div class=\"yop_poll_clear\"></div>\r\n </div>\r\n %CAPTCHA-LABEL%\r\n <div class=\"yop-poll-captcha-input-div\" id=\"yop-poll-captcha-input-div-%POLL-ID%\">%CAPTCHA-INPUT%</div>\r\n</div>\r\n[/CAPTCHA_CONTAINER]\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-VOTE-BUTTON%</div>\r\n <div id=\\".'"'."yop-poll-results-%POLL-ID%\\".'"'.">%POLL-VIEW-RESULT-LINK%</div>\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n</div>',
|
642 |
+
`after_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per-%POLL-ID%\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <div>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </div>\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n <div id=\\".'"'."yop-poll-back-%POLL-ID%\\".'"'.">%POLL-BACK-TO-VOTE-LINK%</div>\r\n</div>',
|
643 |
+
`before_start_date_template` = 'This poll is about to <br>\r\nstart at %POLL-START-DATE%<br>\r\nand finish at %POLL-END-DATE%<br>',
|
644 |
+
`after_end_date_template` = 'This poll is closed!\r\nPoll activity: <br>\r\nstart_date %POLL-START-DATE%<br>\r\nend_date %POLL-END-DATE%<br>\r\n\r\nPoll Results:\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-1\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <span class=\\".'"'."pds-clear\\".'"'." style=\\".'"'."display: block;clear: both;height:1px;line-height:1px;\\".'"'."> </span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n%POLL-VOTE-BUTTON%',
|
645 |
+
`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#3F8B43;\r\n padding:10px;\r\n color:#fff;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#fff; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#fff; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:00FF00;\r\n}',
|
646 |
+
`js` = 'function stripBorder_%POLL-ID%(object) {\r\n object.each(function() {\r\n if( parseInt(jQuery(this).width() ) > 0) {\r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."border-left-width\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."border-right-width\\".'"'.")) );\r\n }\r\n else {\r\n jQuery(this).css(\\".'"'."border-left-width\\".'"'.", \'0px\');\r\n jQuery(this).css(\\".'"'."border-right-width\\".'"'.", \'0px\');\r\n }\r\n });\r\n}\r\nfunction stripPadding_%POLL-ID%(object) {\r\n object.each(function() { \r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) );\r\n });\r\n}\r\n\r\nfunction strip_results_%POLL-ID%() {\r\n stripPadding_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%\\".'"'.") ); \r\n stripBorder_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%\\".'"'."));\r\n}\r\n\r\njQuery(document).ready(function(e) {\r\n if(typeof window.strip_results_%POLL-ID% == \'function\') \r\n strip_results_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_answers_%POLL-ID% == \'function\') \r\n tabulate_answers_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_results_%POLL-ID% == \'function\') \r\n tabulate_results_%POLL-ID%();\r\n \r\n});\r\n\r\nfunction equalWidth_%POLL-ID%(obj, cols, findWidest ) {\r\n findWidest = typeof findWidest !== \'undefined\' ? findWidest : false;\r\n if ( findWidest ) {\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n width = parseInt(thisWidth / cols); \r\n jQuery(this).width(width); \r\n jQuery(this).css(\'float\', \'left\'); \r\n });\r\n }\r\n else {\r\n var widest = 0;\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n if(thisWidth > widest) {\r\n widest = thisWidth; \r\n } \r\n });\r\n width = parseInt( widest / cols); \r\n obj.width(width); \r\n obj.css(\'float\', \'left\'); \r\n } \r\n}\r\n\r\nfunction tabulate_answers_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%\\".'"'."), %ANSWERS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %ANSWERS-TABULATED-COLS%, true );\r\n}\r\n\r\nfunction tabulate_results_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%\\".'"'."), %RESULTS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %RESULTS-TABULATED-COLS%, true );\r\n}',
|
647 |
+
`last_modified` = '".current_time( 'mysql' )."' ";
|
648 |
break;
|
649 |
+
case '11': //Green v2
|
650 |
+
$sql .= "`before_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-ANSWER-CHECK-INPUT% \r\n %POLL-ANSWER-LABEL%\r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_CONTAINER]\r\n [OTHER_ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-OTHER-ANSWER-CHECK-INPUT% \r\n %POLL-OTHER-ANSWER-LABEL% \r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-OTHER-ANSWER-TEXT-INPUT% \r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/OTHER_ANSWER_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-custom-%POLL-ID%\\".'"'.">\r\n <ul>\r\n [CUSTOM_FIELD_CONTAINER]\r\n <li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>\r\n [/CUSTOM_FIELD_CONTAINER]\r\n </ul>\r\n</div> \r\n[CAPTCHA_CONTAINER]\r\n<div id=\"yop-poll-captcha-%POLL-ID%\">\r\n <div class=\"yop-poll-captcha-image-div\" id=\"yop-poll-captcha-image-div-%POLL-ID%\">\r\n %CAPTCHA-IMAGE%\r\n <div class=\"yop-poll-captcha-helpers-div\" id=\"yop-poll-captcha-helpers-div-%POLL-ID%\">%RELOAD-CAPTCHA-IMAGE% </div>\r\n <div class=\"yop_poll_clear\"></div>\r\n </div>\r\n %CAPTCHA-LABEL%\r\n <div class=\"yop-poll-captcha-input-div\" id=\"yop-poll-captcha-input-div-%POLL-ID%\">%CAPTCHA-INPUT%</div>\r\n</div>\r\n[/CAPTCHA_CONTAINER]\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-VOTE-BUTTON%</div>\r\n <div id=\\".'"'."yop-poll-results-%POLL-ID%\\".'"'.">%POLL-VIEW-RESULT-LINK%</div>\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n</div>',
|
651 |
+
`after_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per-%POLL-ID%\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <div>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </div>\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n <div id=\\".'"'."yop-poll-back-%POLL-ID%\\".'"'.">%POLL-BACK-TO-VOTE-LINK%</div>\r\n</div>',
|
652 |
+
`before_start_date_template` = 'This poll is about to <br>\r\nstart at %POLL-START-DATE%<br>\r\nand finish at %POLL-END-DATE%<br>',
|
653 |
+
`after_end_date_template` = 'This poll is closed!\r\nPoll activity: <br>\r\nstart_date %POLL-START-DATE%<br>\r\nend_date %POLL-END-DATE%<br>\r\n\r\nPoll Results:\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-1\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <span class=\\".'"'."pds-clear\\".'"'." style=\\".'"'."display: block;clear: both;height:1px;line-height:1px;\\".'"'."> </span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n%POLL-VOTE-BUTTON%',
|
654 |
+
`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#fff;\r\n padding:0px;\r\n color:#555;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-weight:bold;\r\n background:#3F8B43;\r\n color:#fff;\r\n padding:5px;\r\n text-align:center;\r\n font-size:12px;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#3F8B43; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#3F8B43; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',
|
655 |
+
`js` = 'function stripBorder_%POLL-ID%(object) {\r\n object.each(function() {\r\n if( parseInt(jQuery(this).width() ) > 0) {\r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."border-left-width\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."border-right-width\\".'"'.")) );\r\n }\r\n else {\r\n jQuery(this).css(\\".'"'."border-left-width\\".'"'.", \'0px\');\r\n jQuery(this).css(\\".'"'."border-right-width\\".'"'.", \'0px\');\r\n }\r\n });\r\n}\r\nfunction stripPadding_%POLL-ID%(object) {\r\n object.each(function() { \r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) );\r\n });\r\n}\r\n\r\nfunction strip_results_%POLL-ID%() {\r\n stripPadding_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%\\".'"'.") ); \r\n stripBorder_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%\\".'"'."));\r\n}\r\n\r\njQuery(document).ready(function(e) {\r\n if(typeof window.strip_results_%POLL-ID% == \'function\') \r\n strip_results_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_answers_%POLL-ID% == \'function\') \r\n tabulate_answers_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_results_%POLL-ID% == \'function\') \r\n tabulate_results_%POLL-ID%();\r\n \r\n});\r\n\r\nfunction equalWidth_%POLL-ID%(obj, cols, findWidest ) {\r\n findWidest = typeof findWidest !== \'undefined\' ? findWidest : false;\r\n if ( findWidest ) {\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n width = parseInt(thisWidth / cols); \r\n jQuery(this).width(width); \r\n jQuery(this).css(\'float\', \'left\'); \r\n });\r\n }\r\n else {\r\n var widest = 0;\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n if(thisWidth > widest) {\r\n widest = thisWidth; \r\n } \r\n });\r\n width = parseInt( widest / cols); \r\n obj.width(width); \r\n obj.css(\'float\', \'left\'); \r\n } \r\n}\r\n\r\nfunction tabulate_answers_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%\\".'"'."), %ANSWERS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %ANSWERS-TABULATED-COLS%, true );\r\n}\r\n\r\nfunction tabulate_results_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%\\".'"'."), %RESULTS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %RESULTS-TABULATED-COLS%, true );\r\n}',
|
656 |
+
`last_modified` = '".current_time( 'mysql' )."' ";
|
657 |
break;
|
658 |
+
case '12': //Green v3
|
659 |
+
$sql .= "`before_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-ANSWER-CHECK-INPUT% \r\n %POLL-ANSWER-LABEL%\r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_CONTAINER]\r\n [OTHER_ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-OTHER-ANSWER-CHECK-INPUT% \r\n %POLL-OTHER-ANSWER-LABEL% \r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-OTHER-ANSWER-TEXT-INPUT% \r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/OTHER_ANSWER_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-custom-%POLL-ID%\\".'"'.">\r\n <ul>\r\n [CUSTOM_FIELD_CONTAINER]\r\n <li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>\r\n [/CUSTOM_FIELD_CONTAINER]\r\n </ul>\r\n</div> \r\n[CAPTCHA_CONTAINER]\r\n<div id=\"yop-poll-captcha-%POLL-ID%\">\r\n <div class=\"yop-poll-captcha-image-div\" id=\"yop-poll-captcha-image-div-%POLL-ID%\">\r\n %CAPTCHA-IMAGE%\r\n <div class=\"yop-poll-captcha-helpers-div\" id=\"yop-poll-captcha-helpers-div-%POLL-ID%\">%RELOAD-CAPTCHA-IMAGE% </div>\r\n <div class=\"yop_poll_clear\"></div>\r\n </div>\r\n %CAPTCHA-LABEL%\r\n <div class=\"yop-poll-captcha-input-div\" id=\"yop-poll-captcha-input-div-%POLL-ID%\">%CAPTCHA-INPUT%</div>\r\n</div>\r\n[/CAPTCHA_CONTAINER]\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-VOTE-BUTTON%</div>\r\n <div id=\\".'"'."yop-poll-results-%POLL-ID%\\".'"'.">%POLL-VIEW-RESULT-LINK%</div>\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n</div>',
|
660 |
+
`after_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per-%POLL-ID%\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <div>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </div>\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n <div id=\\".'"'."yop-poll-back-%POLL-ID%\\".'"'.">%POLL-BACK-TO-VOTE-LINK%</div>\r\n</div>',
|
661 |
+
`before_start_date_template` = 'This poll is about to <br>\r\nstart at %POLL-START-DATE%<br>\r\nand finish at %POLL-END-DATE%<br>',
|
662 |
+
`after_end_date_template` = 'This poll is closed!\r\nPoll activity: <br>\r\nstart_date %POLL-START-DATE%<br>\r\nend_date %POLL-END-DATE%<br>\r\n\r\nPoll Results:\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-1\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <span class=\\".'"'."pds-clear\\".'"'." style=\\".'"'."display: block;clear: both;height:1px;line-height:1px;\\".'"'."> </span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n%POLL-VOTE-BUTTON%',
|
663 |
+
`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#fff;\r\n padding:10px;\r\n color:#555;\r\n overflow:hidden;\r\n font-size:12px;\r\n border:5px solid #3F8B43;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#3F8B43; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#3F8B43; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',
|
664 |
+
`js` = 'function stripBorder_%POLL-ID%(object) {\r\n object.each(function() {\r\n if( parseInt(jQuery(this).width() ) > 0) {\r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."border-left-width\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."border-right-width\\".'"'.")) );\r\n }\r\n else {\r\n jQuery(this).css(\\".'"'."border-left-width\\".'"'.", \'0px\');\r\n jQuery(this).css(\\".'"'."border-right-width\\".'"'.", \'0px\');\r\n }\r\n });\r\n}\r\nfunction stripPadding_%POLL-ID%(object) {\r\n object.each(function() { \r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) );\r\n });\r\n}\r\n\r\nfunction strip_results_%POLL-ID%() {\r\n stripPadding_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%\\".'"'.") ); \r\n stripBorder_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%\\".'"'."));\r\n}\r\n\r\njQuery(document).ready(function(e) {\r\n if(typeof window.strip_results_%POLL-ID% == \'function\') \r\n strip_results_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_answers_%POLL-ID% == \'function\') \r\n tabulate_answers_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_results_%POLL-ID% == \'function\') \r\n tabulate_results_%POLL-ID%();\r\n \r\n});\r\n\r\nfunction equalWidth_%POLL-ID%(obj, cols, findWidest ) {\r\n findWidest = typeof findWidest !== \'undefined\' ? findWidest : false;\r\n if ( findWidest ) {\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n width = parseInt(thisWidth / cols); \r\n jQuery(this).width(width); \r\n jQuery(this).css(\'float\', \'left\'); \r\n });\r\n }\r\n else {\r\n var widest = 0;\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n if(thisWidth > widest) {\r\n widest = thisWidth; \r\n } \r\n });\r\n width = parseInt( widest / cols); \r\n obj.width(width); \r\n obj.css(\'float\', \'left\'); \r\n } \r\n}\r\n\r\nfunction tabulate_answers_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%\\".'"'."), %ANSWERS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %ANSWERS-TABULATED-COLS%, true );\r\n}\r\n\r\nfunction tabulate_results_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%\\".'"'."), %RESULTS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %RESULTS-TABULATED-COLS%, true );\r\n}',
|
665 |
+
`last_modified` = '".current_time( 'mysql' )."' ";
|
666 |
break;
|
667 |
+
case '13': //Orange v1
|
668 |
+
$sql .= "`before_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-ANSWER-CHECK-INPUT% \r\n %POLL-ANSWER-LABEL%\r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_CONTAINER]\r\n [OTHER_ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-OTHER-ANSWER-CHECK-INPUT% \r\n %POLL-OTHER-ANSWER-LABEL% \r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-OTHER-ANSWER-TEXT-INPUT% \r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/OTHER_ANSWER_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-custom-%POLL-ID%\\".'"'.">\r\n <ul>\r\n [CUSTOM_FIELD_CONTAINER]\r\n <li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>\r\n [/CUSTOM_FIELD_CONTAINER]\r\n </ul>\r\n</div> \r\n[CAPTCHA_CONTAINER]\r\n<div id=\"yop-poll-captcha-%POLL-ID%\">\r\n <div class=\"yop-poll-captcha-image-div\" id=\"yop-poll-captcha-image-div-%POLL-ID%\">\r\n %CAPTCHA-IMAGE%\r\n <div class=\"yop-poll-captcha-helpers-div\" id=\"yop-poll-captcha-helpers-div-%POLL-ID%\">%RELOAD-CAPTCHA-IMAGE% </div>\r\n <div class=\"yop_poll_clear\"></div>\r\n </div>\r\n %CAPTCHA-LABEL%\r\n <div class=\"yop-poll-captcha-input-div\" id=\"yop-poll-captcha-input-div-%POLL-ID%\">%CAPTCHA-INPUT%</div>\r\n</div>\r\n[/CAPTCHA_CONTAINER]\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-VOTE-BUTTON%</div>\r\n <div id=\\".'"'."yop-poll-results-%POLL-ID%\\".'"'.">%POLL-VIEW-RESULT-LINK%</div>\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n</div>',
|
669 |
+
`after_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per-%POLL-ID%\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <div>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </div>\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n <div id=\\".'"'."yop-poll-back-%POLL-ID%\\".'"'.">%POLL-BACK-TO-VOTE-LINK%</div>\r\n</div>',
|
670 |
+
`before_start_date_template` = 'This poll is about to <br>\r\nstart at %POLL-START-DATE%<br>\r\nand finish at %POLL-END-DATE%<br>',
|
671 |
+
`after_end_date_template` = 'This poll is closed!\r\nPoll activity: <br>\r\nstart_date %POLL-START-DATE%<br>\r\nend_date %POLL-END-DATE%<br>\r\n\r\nPoll Results:\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-1\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <span class=\\".'"'."pds-clear\\".'"'." style=\\".'"'."display: block;clear: both;height:1px;line-height:1px;\\".'"'."> </span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n%POLL-VOTE-BUTTON%',
|
672 |
+
`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#FB6911;\r\n padding:10px;\r\n color:#fff;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#fff; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#fff; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',
|
673 |
+
`js` = 'function stripBorder_%POLL-ID%(object) {\r\n object.each(function() {\r\n if( parseInt(jQuery(this).width() ) > 0) {\r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."border-left-width\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."border-right-width\\".'"'.")) );\r\n }\r\n else {\r\n jQuery(this).css(\\".'"'."border-left-width\\".'"'.", \'0px\');\r\n jQuery(this).css(\\".'"'."border-right-width\\".'"'.", \'0px\');\r\n }\r\n });\r\n}\r\nfunction stripPadding_%POLL-ID%(object) {\r\n object.each(function() { \r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) );\r\n });\r\n}\r\n\r\nfunction strip_results_%POLL-ID%() {\r\n stripPadding_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%\\".'"'.") ); \r\n stripBorder_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%\\".'"'."));\r\n}\r\n\r\njQuery(document).ready(function(e) {\r\n if(typeof window.strip_results_%POLL-ID% == \'function\') \r\n strip_results_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_answers_%POLL-ID% == \'function\') \r\n tabulate_answers_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_results_%POLL-ID% == \'function\') \r\n tabulate_results_%POLL-ID%();\r\n \r\n});\r\n\r\nfunction equalWidth_%POLL-ID%(obj, cols, findWidest ) {\r\n findWidest = typeof findWidest !== \'undefined\' ? findWidest : false;\r\n if ( findWidest ) {\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n width = parseInt(thisWidth / cols); \r\n jQuery(this).width(width); \r\n jQuery(this).css(\'float\', \'left\'); \r\n });\r\n }\r\n else {\r\n var widest = 0;\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n if(thisWidth > widest) {\r\n widest = thisWidth; \r\n } \r\n });\r\n width = parseInt( widest / cols); \r\n obj.width(width); \r\n obj.css(\'float\', \'left\'); \r\n } \r\n}\r\n\r\nfunction tabulate_answers_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%\\".'"'."), %ANSWERS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %ANSWERS-TABULATED-COLS%, true );\r\n}\r\n\r\nfunction tabulate_results_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%\\".'"'."), %RESULTS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %RESULTS-TABULATED-COLS%, true );\r\n}',
|
674 |
+
`last_modified` = '".current_time( 'mysql' )."' ";
|
675 |
break;
|
676 |
+
case '14': //Orange v2
|
677 |
+
$sql .= "`before_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-ANSWER-CHECK-INPUT% \r\n %POLL-ANSWER-LABEL%\r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_CONTAINER]\r\n [OTHER_ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-OTHER-ANSWER-CHECK-INPUT% \r\n %POLL-OTHER-ANSWER-LABEL% \r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-OTHER-ANSWER-TEXT-INPUT% \r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/OTHER_ANSWER_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-custom-%POLL-ID%\\".'"'.">\r\n <ul>\r\n [CUSTOM_FIELD_CONTAINER]\r\n <li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>\r\n [/CUSTOM_FIELD_CONTAINER]\r\n </ul>\r\n</div> \r\n[CAPTCHA_CONTAINER]\r\n<div id=\"yop-poll-captcha-%POLL-ID%\">\r\n <div class=\"yop-poll-captcha-image-div\" id=\"yop-poll-captcha-image-div-%POLL-ID%\">\r\n %CAPTCHA-IMAGE%\r\n <div class=\"yop-poll-captcha-helpers-div\" id=\"yop-poll-captcha-helpers-div-%POLL-ID%\">%RELOAD-CAPTCHA-IMAGE% </div>\r\n <div class=\"yop_poll_clear\"></div>\r\n </div>\r\n %CAPTCHA-LABEL%\r\n <div class=\"yop-poll-captcha-input-div\" id=\"yop-poll-captcha-input-div-%POLL-ID%\">%CAPTCHA-INPUT%</div>\r\n</div>\r\n[/CAPTCHA_CONTAINER]\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-VOTE-BUTTON%</div>\r\n <div id=\\".'"'."yop-poll-results-%POLL-ID%\\".'"'.">%POLL-VIEW-RESULT-LINK%</div>\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n</div>',
|
678 |
+
`after_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per-%POLL-ID%\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <div>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </div>\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n <div id=\\".'"'."yop-poll-back-%POLL-ID%\\".'"'.">%POLL-BACK-TO-VOTE-LINK%</div>\r\n</div>',
|
679 |
+
`before_start_date_template` = 'This poll is about to <br>\r\nstart at %POLL-START-DATE%<br>\r\nand finish at %POLL-END-DATE%<br>',
|
680 |
+
`after_end_date_template` = 'This poll is closed!\r\nPoll activity: <br>\r\nstart_date %POLL-START-DATE%<br>\r\nend_date %POLL-END-DATE%<br>\r\n\r\nPoll Results:\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-1\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <span class=\\".'"'."pds-clear\\".'"'." style=\\".'"'."display: block;clear: both;height:1px;line-height:1px;\\".'"'."> </span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n%POLL-VOTE-BUTTON%',
|
681 |
+
`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#fff;\r\n padding:0px;\r\n color:#555;\r\n overflow:hidden;\r\n font-size:12px;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-weight:bold;\r\n background:#FB6911;\r\n color:#fff;\r\n padding:5px;\r\n text-align:center;\r\n font-size:12px;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#FB6911; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#FB6911; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',
|
682 |
+
`js` = 'function stripBorder_%POLL-ID%(object) {\r\n object.each(function() {\r\n if( parseInt(jQuery(this).width() ) > 0) {\r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."border-left-width\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."border-right-width\\".'"'.")) );\r\n }\r\n else {\r\n jQuery(this).css(\\".'"'."border-left-width\\".'"'.", \'0px\');\r\n jQuery(this).css(\\".'"'."border-right-width\\".'"'.", \'0px\');\r\n }\r\n });\r\n}\r\nfunction stripPadding_%POLL-ID%(object) {\r\n object.each(function() { \r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) );\r\n });\r\n}\r\n\r\nfunction strip_results_%POLL-ID%() {\r\n stripPadding_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%\\".'"'.") ); \r\n stripBorder_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%\\".'"'."));\r\n}\r\n\r\njQuery(document).ready(function(e) {\r\n if(typeof window.strip_results_%POLL-ID% == \'function\') \r\n strip_results_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_answers_%POLL-ID% == \'function\') \r\n tabulate_answers_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_results_%POLL-ID% == \'function\') \r\n tabulate_results_%POLL-ID%();\r\n \r\n});\r\n\r\nfunction equalWidth_%POLL-ID%(obj, cols, findWidest ) {\r\n findWidest = typeof findWidest !== \'undefined\' ? findWidest : false;\r\n if ( findWidest ) {\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n width = parseInt(thisWidth / cols); \r\n jQuery(this).width(width); \r\n jQuery(this).css(\'float\', \'left\'); \r\n });\r\n }\r\n else {\r\n var widest = 0;\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n if(thisWidth > widest) {\r\n widest = thisWidth; \r\n } \r\n });\r\n width = parseInt( widest / cols); \r\n obj.width(width); \r\n obj.css(\'float\', \'left\'); \r\n } \r\n}\r\n\r\nfunction tabulate_answers_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%\\".'"'."), %ANSWERS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %ANSWERS-TABULATED-COLS%, true );\r\n}\r\n\r\nfunction tabulate_results_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%\\".'"'."), %RESULTS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %RESULTS-TABULATED-COLS%, true );\r\n}',
|
683 |
+
`last_modified` = '".current_time( 'mysql' )."' ";
|
684 |
break;
|
685 |
+
case '15': //Orange v3
|
686 |
+
$sql .= "`before_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-ANSWER-CHECK-INPUT% \r\n %POLL-ANSWER-LABEL%\r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_CONTAINER]\r\n [OTHER_ANSWER_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-answer-%POLL-ID%\\".'"'.">\r\n %POLL-OTHER-ANSWER-CHECK-INPUT% \r\n %POLL-OTHER-ANSWER-LABEL% \r\n <span class=\\".'"'."yop-poll-results-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-RESULT-LABEL%</span>\r\n %POLL-OTHER-ANSWER-TEXT-INPUT% \r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/OTHER_ANSWER_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-custom-%POLL-ID%\\".'"'.">\r\n <ul>\r\n [CUSTOM_FIELD_CONTAINER]\r\n <li>%POLL-CUSTOM-FIELD-LABEL% %POLL-CUSTOM-FIELD-TEXT-INPUT%</li>\r\n [/CUSTOM_FIELD_CONTAINER]\r\n </ul>\r\n</div> \r\n[CAPTCHA_CONTAINER]\r\n<div id=\"yop-poll-captcha-%POLL-ID%\">\r\n <div class=\"yop-poll-captcha-image-div\" id=\"yop-poll-captcha-image-div-%POLL-ID%\">\r\n %CAPTCHA-IMAGE%\r\n <div class=\"yop-poll-captcha-helpers-div\" id=\"yop-poll-captcha-helpers-div-%POLL-ID%\">%RELOAD-CAPTCHA-IMAGE% </div>\r\n <div class=\"yop_poll_clear\"></div>\r\n </div>\r\n %CAPTCHA-LABEL%\r\n <div class=\"yop-poll-captcha-input-div\" id=\"yop-poll-captcha-input-div-%POLL-ID%\">%CAPTCHA-INPUT%</div>\r\n</div>\r\n[/CAPTCHA_CONTAINER]\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-VOTE-BUTTON%</div>\r\n <div id=\\".'"'."yop-poll-results-%POLL-ID%\\".'"'.">%POLL-VIEW-RESULT-LINK%</div>\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n</div>',
|
687 |
+
`after_vote_template` = '<div id=\\".'"'."yop-poll-name-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-name\\".'"'.">%POLL-NAME%</div>\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text-%POLL-ID%\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result-%POLL-ID%\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per-%POLL-ID%\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <div>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </div>\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n<div id=\\".'"'."yop-poll-vote-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-footer\\".'"'.">\r\n <div>%POLL-TOTAL-ANSWERS%</div>\r\n <div>%POLL-TOTAL-VOTES%</div>\r\n <div id=\\".'"'."yop-poll-back-%POLL-ID%\\".'"'.">%POLL-BACK-TO-VOTE-LINK%</div>\r\n</div>',
|
688 |
+
`before_start_date_template` = 'This poll is about to <br>\r\nstart at %POLL-START-DATE%<br>\r\nand finish at %POLL-END-DATE%<br>',
|
689 |
+
`after_end_date_template` = 'This poll is closed!\r\nPoll activity: <br>\r\nstart_date %POLL-START-DATE%<br>\r\nend_date %POLL-END-DATE%<br>\r\n\r\nPoll Results:\r\n<div id=\\".'"'."yop-poll-question-%POLL-ID%\\".'"'." class=\\".'"'."yop-poll-question\\".'"'.">%POLL-QUESTION%</div>\r\n<div id=\\".'"'."yop-poll-answers-1\\".'"'." class=\\".'"'."yop-poll-answers\\".'"'.">\r\n <ul>\r\n [ANSWER_RESULT_CONTAINER]\r\n <li class=\\".'"'."yop-poll-li-result-%POLL-ID%\\".'"'.">\r\n <label class=\\".'"'."pds-feedback-label\\".'"'.">\r\n <span class=\\".'"'."pds-answer-text\\".'"'.">%POLL-ANSWER-LABEL%</span>\r\n <span class=\\".'"'."pds-feedback-result\\".'"'.">\r\n <span class=\\".'"'."pds-feedback-per\\".'"'."> %POLL-ANSWER-RESULT-LABEL%</span>\r\n </span>\r\n </label>\r\n <span class=\\".'"'."pds-clear\\".'"'." style=\\".'"'."display: block;clear: both;height:1px;line-height:1px;\\".'"'."> </span>\r\n %POLL-ANSWER-RESULT-BAR%\r\n </li>\r\n [/ANSWER_RESULT_CONTAINER]\r\n </ul>\r\n</div>\r\n%POLL-VOTE-BUTTON%',
|
690 |
+
`css` = '#yop-poll-container-%POLL-ID% {\r\n width:%POLL-WIDTH%;\r\n background:#fff;\r\n padding:10px;\r\n color:#555;\r\n overflow:hidden;\r\n font-size:12px;\r\n border:5px solid #FB6911;\r\n}\r\n#yop-poll-name-%POLL-ID% {\r\n font-size:14px;\r\n font-weight:bold;\r\n}\r\n\r\n#yop-poll-question-%POLL-ID% {\r\n font-size:14px;\r\n margin:5px 0px;\r\n}\r\n#yop-poll-answers-%POLL-ID% { }\r\n#yop-poll-answers-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li { \r\n font-style:normal;\r\n margin:0px 0px 10px 0px;\r\n padding:0px;\r\n font-size:12px;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li input { \r\n margin:0px; \r\n float:none;\r\n}\r\n#yop-poll-answers-%POLL-ID% ul li label { \r\n margin:0px; \r\n font-style:normal; \r\n font-weight:normal; \r\n font-size:12px; \r\n float:none;\r\n}\r\n.yop-poll-results-%POLL-ID% {\r\n font-size: 12px;\r\n font-style: italic;\r\n font-weight: normal;\r\n margin-left: 15px;\r\n}\r\n\r\n#yop-poll-custom-%POLL-ID% { }\r\n#yop-poll-custom-%POLL-ID% ul {\r\n list-style: none outside none;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n#yop-poll-custom-%POLL-ID% ul li { \r\n padding:0px;\r\n margin:0px; \r\n font-size:14px;\r\n}\r\n#yop-poll-container-%POLL-ID% input[type=\'text\'] { margin:0px 0px 5px 0px; padding:2%; width:96%; text-indent:2%; font-size:12px; }\r\n\r\n#yop-poll-captcha-input-div-%POLL-ID% {\r\nmargin-top:5px;\r\n}\r\n#yop-poll-captcha-helpers-div-%POLL-ID% {\r\nwidth:30px;\r\nfloat:left;\r\nmargin-left:5px;\r\nheight:0px;\r\n}\r\n\r\n#yop-poll-captcha-helpers-div-%POLL-ID% img {\r\nmargin-bottom:2px;\r\n}\r\n\r\n#yop-poll-captcha-image-div-%POLL-ID% {\r\nmargin-bottom:5px;\r\n}\r\n\r\n#yop_poll_captcha_image_%POLL-ID% {\r\nfloat:left;\r\n}\r\n\r\n.yop_poll_clear {\r\nclear:both;\r\n}\r\n\r\n#yop-poll-vote-%POLL-ID% {\r\n\r\n}\r\n.yop-poll-results-bar-%POLL-ID% { background:#f5f5f5; height:10px; }\r\n.yop-poll-results-bar-%POLL-ID% div { background:#555; height:10px; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-vote-%POLL-ID% button { float:left; }\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% {\r\n float: right;\r\n margin-bottom: 20px;\r\n margin-top: -20px;\r\n width: auto;\r\n}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-results-%POLL-ID% a { color:#FB6911; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div#yop-poll-back-%POLL-ID% a { color:#FB6911; text-decoration:underline; font-size:12px;}\r\n#yop-poll-vote-%POLL-ID% div { float:left; width:100%; }\r\n\r\n#yop-poll-container-error-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:red;\r\n text-transform:lowercase;\r\n}\r\n\r\n#yop-poll-container-success-%POLL-ID% {\r\n font-size:12px;\r\n font-style:italic;\r\n color:green;\r\n}',
|
691 |
+
`js` = 'function stripBorder_%POLL-ID%(object) {\r\n object.each(function() {\r\n if( parseInt(jQuery(this).width() ) > 0) {\r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."border-left-width\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."border-right-width\\".'"'.")) );\r\n }\r\n else {\r\n jQuery(this).css(\\".'"'."border-left-width\\".'"'.", \'0px\');\r\n jQuery(this).css(\\".'"'."border-right-width\\".'"'.", \'0px\');\r\n }\r\n });\r\n}\r\nfunction stripPadding_%POLL-ID%(object) {\r\n object.each(function() { \r\n jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) - parseInt(jQuery(this).css(\\".'"'."padding-left\\".'"'.")) );\r\n });\r\n}\r\n\r\nfunction strip_results_%POLL-ID%() {\r\n stripPadding_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop_poll_li_result-%POLL-ID%\\".'"'.") ); \r\n stripBorder_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-result-bar-%POLL-ID%\\".'"'."));\r\n}\r\n\r\njQuery(document).ready(function(e) {\r\n if(typeof window.strip_results_%POLL-ID% == \'function\') \r\n strip_results_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_answers_%POLL-ID% == \'function\') \r\n tabulate_answers_%POLL-ID%();\r\n \r\n if(typeof window.tabulate_results_%POLL-ID% == \'function\') \r\n tabulate_results_%POLL-ID%();\r\n \r\n});\r\n\r\nfunction equalWidth_%POLL-ID%(obj, cols, findWidest ) {\r\n findWidest = typeof findWidest !== \'undefined\' ? findWidest : false;\r\n if ( findWidest ) {\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n width = parseInt(thisWidth / cols); \r\n jQuery(this).width(width); \r\n jQuery(this).css(\'float\', \'left\'); \r\n });\r\n }\r\n else {\r\n var widest = 0;\r\n obj.each(function() {\r\n var thisWidth = jQuery(this).width();\r\n if(thisWidth > widest) {\r\n widest = thisWidth; \r\n } \r\n });\r\n width = parseInt( widest / cols); \r\n obj.width(width); \r\n obj.css(\'float\', \'left\'); \r\n } \r\n}\r\n\r\nfunction tabulate_answers_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID%\\".'"'."), %ANSWERS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-answer-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %ANSWERS-TABULATED-COLS%, true );\r\n}\r\n\r\nfunction tabulate_results_%POLL-ID%() {\r\n equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID%\\".'"'."), %RESULTS-TABULATED-COLS% );\r\n //equalWidth_%POLL-ID%( jQuery(\\".'"'."#yop-poll-container-%POLL-ID% .yop-poll-li-result-%POLL-ID% .yop-poll-results-bar-%POLL-ID% div \\".'"'."), %RESULTS-TABULATED-COLS%, true );\r\n}',
|
692 |
+
`last_modified` = '".current_time( 'mysql' )."' ";
|
693 |
break;
|
694 |
}
|
695 |
+
$sql .= $wpdb->prepare( ' WHERE id = %d', $poll_id );
|
696 |
$wpdb->query( $sql );
|
697 |
}
|
698 |
|
699 |
public function make_poll_from_request_data ( $request = array(), $config = null ) {
|
700 |
+
$this->poll['id'] = isset( $request['yop_poll_id'] ) ? trim( $request['yop_poll_id'] ) : null;
|
701 |
+
$this->poll['name'] = isset( $request['yop_poll_name'] ) ? trim( $request['yop_poll_name'] ) : null;
|
702 |
+
$this->poll['question'] = isset( $request['yop_poll_question'] ) ? trim( $request['yop_poll_question'] ) : null;
|
703 |
+
$this->poll['start_date'] = isset( $request['yop_poll_options']['start_date'] ) ? trim( $request['yop_poll_options']['start_date'] ) : null;
|
704 |
if( ! isset( $request['yop_poll_options']['never_expire'] ) ) {
|
705 |
$this->poll['end_date'] = isset( $request['yop_poll_options']['end_date'] ) ? trim( $request['yop_poll_options']['end_date'] ) : null;
|
706 |
}
|
707 |
else {
|
708 |
+
$this->poll['end_date'] = '9999-12-31 23:59:59';
|
709 |
}
|
710 |
+
$this->poll['show_in_archive'] = isset( $request['yop_poll_options']['show_in_archive'] ) ? trim( $request['yop_poll_options']['show_in_archive'] ) : null;
|
711 |
+
$this->poll['archive_order'] = isset( $request['yop_poll_options']['archive_order'] ) ? trim( $request['yop_poll_options']['archive_order'] ) : null;
|
712 |
}
|
713 |
|
714 |
public function make_answers_from_request_data ( $request = array(), $config = null ) {
|
715 |
$this->answers = NULL;
|
716 |
$answer = array(
|
717 |
+
'id' => NULL,
|
718 |
+
'poll_id' => $this->poll['id'],
|
719 |
+
'answer' => NULL,
|
720 |
+
'votes' => 0,
|
721 |
+
'status' => 'active',
|
722 |
+
'type' => 'default'
|
723 |
);
|
724 |
if ( isset ( $request['yop_poll_answer'] ) ) {
|
725 |
if ( count( $request['yop_poll_answer'] ) > 0 ) {
|
726 |
foreach ( $request['yop_poll_answer'] as $answer_id => $answer_value ) {
|
727 |
+
$answer['answer'] = $answer_value;
|
728 |
+
$answer['id'] = isset( $request['yop_poll_answer_ids'][ $answer_id ] ) ? $request['yop_poll_answer_ids'][ $answer_id ] : NULL;
|
729 |
+
$answer['name'] = $answer_id;
|
730 |
+
$this->answers[] = $answer;
|
731 |
}
|
732 |
}
|
733 |
}
|
734 |
if ( isset ( $request['yop_poll_options']['allow_other_answers'] ) ) {
|
735 |
if ( 'yes' == $request['yop_poll_options']['allow_other_answers'] ) {
|
736 |
+
$answer['answer'] = isset( $request['yop_poll_options']['other_answers_label'] ) ? $request['yop_poll_options']['other_answers_label'] : 'Other';
|
737 |
+
$other_answer = self::get_poll_answers( $this->poll['id'], array( 'other') );
|
738 |
+
$answer['id'] = isset( $other_answer[0]['id'] ) ? $other_answer[0]['id'] : NULL;
|
739 |
+
$answer['type'] = 'other';
|
740 |
+
$this->answers[] = $answer;
|
741 |
}
|
742 |
}
|
743 |
}
|
747 |
if( isset( $request['yop_poll_customfield'] ) ) {
|
748 |
if ( count( $request['yop_poll_customfield'] ) > 0 ) {
|
749 |
$custom_field = array(
|
750 |
+
'id' => NULL,
|
751 |
+
'poll_id' => $this->poll['id'],
|
752 |
+
'custom_field' => NULL,
|
753 |
+
'required' => NULL,
|
754 |
+
'status' => 'active'
|
755 |
);
|
756 |
foreach ( $request['yop_poll_customfield'] as $customfield_id => $customfield_value ) {
|
757 |
$custom_field['custom_field'] = $customfield_value;
|
758 |
$custom_field['id'] = isset( $request['yop_poll_customfield_ids'][ $customfield_id ] ) ? $request['yop_poll_customfield_ids'][ $customfield_id ] : NULL;
|
759 |
$custom_field['required'] = isset( $request['yop_poll_customfield_required'][ $customfield_id ] ) ? 'yes' : 'no';
|
760 |
+
$this->custom_fields[] = $custom_field;
|
761 |
}
|
762 |
}
|
763 |
}
|
769 |
$result = self::get_poll_from_database_by_name( $this->poll['name'] );
|
770 |
if ( !isset( $result['id'] ) ) {
|
771 |
//inserting poll to db
|
772 |
+
$this->poll['id'] = self::insert_poll_to_database( $this->poll );
|
773 |
|
774 |
if( isset( $request['yop_poll_options']['auto_generate_poll_page'] ) ) {
|
775 |
if( 'yes' == $request['yop_poll_options']['auto_generate_poll_page'] ) {
|
790 |
}
|
791 |
|
792 |
//inserting poll options to db
|
793 |
+
$poll_options = array();
|
794 |
+
$default_options = get_option( 'yop_poll_options', false );
|
795 |
|
796 |
|
797 |
if ( isset( $request['yop_poll_options'] ) ) {
|
809 |
}
|
810 |
//this is for checkbox options
|
811 |
if( ! isset( $request['yop_poll_options']['never_expire'] ) ) {
|
812 |
+
$poll_options['never_expire'] = 'no';
|
813 |
}
|
814 |
|
815 |
if( isset( $request['yop_poll_options']['schedule_reset_poll_date'] ) ) {
|
816 |
+
$poll_options['schedule_reset_poll_date'] = strtotime( $request['yop_poll_options']['schedule_reset_poll_date'] );
|
817 |
}
|
818 |
else {
|
819 |
+
$poll_options['schedule_reset_poll_date'] = current_time( 'timestamp' );
|
820 |
}
|
821 |
|
822 |
if( 'yes' == $request['yop_poll_options']['schedule_reset_poll_stats'] ) {
|
823 |
+
$default_options['start_scheduler'] = 'yes';
|
824 |
}
|
825 |
else {
|
826 |
+
$change_start_scheduler_to_no = true;
|
827 |
$yop_polls = self::get_yop_polls_fields ( array( 'id' ) );
|
828 |
if ( count( $yop_polls ) > 0 ) {
|
829 |
foreach( $yop_polls as $yop_poll_id ) {
|
830 |
if ( $yop_poll_id['id'] != $this->poll['id'] ) {
|
831 |
+
$yop_poll_options = get_yop_poll_meta( $yop_poll_id['id'], 'options', true );
|
832 |
if ( isset( $yop_poll_options['schedule_reset_poll_stats'] ) && 'yes' == $yop_poll_options['schedule_reset_poll_stats'] )
|
833 |
+
$change_start_scheduler_to_no = false;
|
834 |
}
|
835 |
}
|
836 |
}
|
837 |
if ( $change_start_scheduler_to_no )
|
838 |
+
$default_options['start_scheduler'] = 'no';
|
839 |
else
|
840 |
+
$default_options['start_scheduler'] = 'yes';
|
841 |
}
|
842 |
update_option ( 'yop_poll_options', $default_options );
|
843 |
|
930 |
}
|
931 |
|
932 |
//update poll options in db
|
933 |
+
$poll_options = array();
|
934 |
+
$default_options = get_option( 'yop_poll_options', false );
|
935 |
|
936 |
|
937 |
if ( isset( $request['yop_poll_options'] ) ) {
|
949 |
}
|
950 |
//this is for checkbox options
|
951 |
if( ! isset( $request['yop_poll_options']['never_expire'] ) ) {
|
952 |
+
$poll_options['never_expire'] = 'no';
|
953 |
}
|
954 |
|
955 |
if( isset( $request['yop_poll_options']['schedule_reset_poll_date'] ) ) {
|
956 |
+
$poll_options['schedule_reset_poll_date'] = strtotime( $request['yop_poll_options']['schedule_reset_poll_date'] );
|
957 |
}
|
958 |
else {
|
959 |
+
$poll_options['schedule_reset_poll_date'] = current_time( 'timestamp' );
|
960 |
}
|
961 |
|
962 |
if( 'yes' == $request['yop_poll_options']['schedule_reset_poll_stats'] ) {
|
963 |
+
$default_options['start_scheduler'] = 'yes';
|
964 |
}
|
965 |
else {
|
966 |
+
$change_start_scheduler_to_no = true;
|
967 |
$yop_polls = self::get_yop_polls_fields ( array( 'id' ) );
|
968 |
if ( count( $yop_polls ) > 0 ) {
|
969 |
foreach( $yop_polls as $yop_poll_id ) {
|
970 |
if ( $yop_poll_id['id'] != $this->poll['id'] ) {
|
971 |
+
$yop_poll_options = get_yop_poll_meta( $yop_poll_id['id'], 'options', true );
|
972 |
if ( isset( $yop_poll_options['schedule_reset_poll_stats'] ) && 'yes' == $yop_poll_options['schedule_reset_poll_stats'] )
|
973 |
+
$change_start_scheduler_to_no = false;
|
974 |
}
|
975 |
}
|
976 |
}
|
977 |
if ( $change_start_scheduler_to_no )
|
978 |
+
$default_options['start_scheduler'] = 'no';
|
979 |
else
|
980 |
+
$default_options['start_scheduler'] = 'yes';
|
981 |
}
|
982 |
update_option ( 'yop_poll_options', $default_options );
|
983 |
|
1024 |
/*if ( isset( $request['yop_poll_options']['use_template_bar'] ) ) {
|
1025 |
if ( $request['yop_poll_options']['use_template_bar'] == 'yes' ) {
|
1026 |
if ( isset( $poll_answer_options[ 'use_template_bar' ] ) )
|
1027 |
+
$poll_answer_options[ 'use_template_bar' ] = 'yes';
|
1028 |
}
|
1029 |
}*/
|
1030 |
update_yop_poll_answer_meta( $answer_id, 'options', $poll_answer_options, false );
|
1086 |
global $wpdb;
|
1087 |
|
1088 |
if( $include_others ) {
|
1089 |
+
$types = array_diff( $types, array( 'other' ) );
|
1090 |
}
|
1091 |
|
1092 |
$type_sql = '';
|
1098 |
$type_sql = trim ( $type_sql, ',' );
|
1099 |
$type_sql .= ' ) ';
|
1100 |
}
|
1101 |
+
$is_votes_sort = false;
|
1102 |
if ( 'votes' == $order ) {
|
1103 |
+
$order = 'id';
|
1104 |
+
$is_votes_sort = true;
|
1105 |
}
|
1106 |
$answers = $wpdb->get_results(
|
1107 |
$wpdb -> prepare(
|
1116 |
);
|
1117 |
|
1118 |
if ( $include_others ) {
|
1119 |
+
$other_answer_details = $wpdb->get_row(
|
1120 |
$wpdb -> prepare(
|
1121 |
"
|
1122 |
SELECT *
|
1127 |
ARRAY_A
|
1128 |
);
|
1129 |
|
1130 |
+
$other_answers_values = self::get_other_answers_votes( $other_answer_details['id'] );
|
1131 |
if ( count( $other_answers_values ) > 0 ) {
|
1132 |
if ( 'id' == $order && 'desc' == $order_dir )
|
1133 |
+
$interval = range( count( $other_answers_values ) - 1, 0, -1 );
|
1134 |
else
|
1135 |
+
$interval = range( 0, count( $other_answers_values ) - 1, 1 );
|
1136 |
for( $i = 0; $i < count( $other_answers_values ); $i++ ) {
|
1137 |
$answers[] =
|
1138 |
array(
|
1139 |
+
'id' => $other_answer_details['id'],
|
1140 |
+
'poll_id' => $poll_id,
|
1141 |
+
'answer' => $other_answers_values[ $interval[ $i ] ]['other_answer_value'],
|
1142 |
+
'votes' => $other_answers_values[ $interval[ $i ] ]['votes'],
|
1143 |
+
'status' => 'active',
|
1144 |
+
'type' => 'other'
|
1145 |
);
|
1146 |
}
|
1147 |
}
|
1148 |
else {
|
1149 |
+
$answers[] = $other_answer_details;
|
1150 |
}
|
1151 |
}
|
1152 |
+
$total_votes = self::get_sum_poll_votes( $poll_id );
|
1153 |
if( count( $answers ) > 0 ) {
|
1154 |
for( $i = 0; $i < count ( $answers ); $i++ ) {
|
1155 |
if( 0 == intval( $total_votes ) )
|
1156 |
+
$answers[$i]['procentes'] = 0;
|
1157 |
else {
|
1158 |
+
$answers[$i]['procentes'] = round( ( intval( $answers[$i]['votes']) / intval( $total_votes ) * 100 ), $percentages_decimals ) ;
|
1159 |
if ( 0 < $answers[$i]['procentes'] )
|
1160 |
+
$answers[$i]['procentes'] = number_format( $answers[$i]['procentes'], $percentages_decimals );
|
1161 |
}
|
1162 |
}
|
1163 |
}
|
1164 |
|
1165 |
if ( $is_votes_sort ) {
|
1166 |
+
$order_dir = ( '' == $order_dir ) ? 'asc' : $order_dir;
|
1167 |
usort($answers, array( 'Yop_Poll_Model', "sort_answers_by_votes_".$order_dir."_callback" ) );
|
1168 |
}
|
1169 |
if ( $include_others ) {
|
1170 |
if ( 'answer' == $order ) {
|
1171 |
+
$order_dir = ( '' == $order_dir ) ? 'asc' : $order_dir;
|
1172 |
usort($answers, array( 'Yop_Poll_Model', "sort_answers_alphabetical_".$order_dir."_callback" ) );
|
1173 |
}
|
1174 |
|
1175 |
if ( 'rand()' == $order ) {
|
1176 |
+
$interval = range( 0, count( $answers ) - 1, 1 );
|
1177 |
shuffle( $interval );
|
1178 |
+
$new_answers = array();
|
1179 |
foreach ( $interval as $number ) {
|
1180 |
+
$new_answers[] = $answers[ $number ];
|
1181 |
}
|
1182 |
+
$answers = $new_answers;
|
1183 |
}
|
1184 |
}
|
1185 |
return $answers;
|
1188 |
public static function get_count_poll_answers( $poll_id, $types = array( 'default' ), $include_others = false ) {
|
1189 |
global $wpdb;
|
1190 |
|
1191 |
+
$answers_no = 0;
|
1192 |
+
$other_answers_no = 0;
|
1193 |
|
1194 |
if( $include_others ) {
|
1195 |
+
$types = array_diff( $types, array( 'other' ) );
|
1196 |
}
|
1197 |
|
1198 |
$type_sql = '';
|
1216 |
);
|
1217 |
|
1218 |
if ( $include_others ) {
|
1219 |
+
$other_answer_details = $wpdb->get_row(
|
1220 |
$wpdb -> prepare(
|
1221 |
"
|
1222 |
SELECT *
|
1227 |
ARRAY_A
|
1228 |
);
|
1229 |
|
1230 |
+
$other_answers_no = count( self::get_other_answers_votes( $other_answer_details['id'] ) );
|
1231 |
}
|
1232 |
|
1233 |
return $answers_no + $other_answers_no;
|
1247 |
ARRAY_A
|
1248 |
);
|
1249 |
return $answer;
|
1250 |
+
}
|
1251 |
|
1252 |
private static function get_poll_answer_by_field( $poll_id, $field_name, $field_value, $field_type = '%s' ) {
|
1253 |
+
$answer = $GLOBALS['wpdb']->get_row (
|
1254 |
$GLOBALS['wpdb']->prepare(
|
1255 |
"
|
1256 |
SELECT *
|
1257 |
FROM {$GLOBALS['wpdb']->yop_poll_answers}
|
1258 |
WHERE {$field_name} = {$field_type} AND
|
1259 |
+
poll_id = %d
|
1260 |
LIMIT 0,1",
|
1261 |
$field_value,
|
1262 |
$poll_id
|
1263 |
),
|
1264 |
ARRAY_A
|
1265 |
);
|
1266 |
+
return $answer;
|
1267 |
}
|
1268 |
|
1269 |
public static function get_poll_customfields( $poll_id ) {
|
1300 |
|
1301 |
public static function get_poll_customfields_logs( $poll_id, $orderby = 'vote_date', $order = 'desc', $offset = 0, $per_page = 99999999, $sdate = '', $edate = '' ) {
|
1302 |
global $wpdb;
|
1303 |
+
$sdatesql = '';
|
1304 |
+
$edatesql = '';
|
1305 |
if ( $sdate != '' )
|
1306 |
+
$sdatesql = $wpdb->prepare( ' AND vote_date >= %s ', $sdate.' 00:00:00 ' );
|
1307 |
if ( $edate != '' )
|
1308 |
+
$edatesql = $wpdb->prepare( ' AND vote_date <= %s ', $edate.' 23:59:59 ' );
|
1309 |
$result = $wpdb->get_results(
|
1310 |
$wpdb -> prepare(
|
1311 |
"
|
1329 |
|
1330 |
public static function get_poll_total_customfields_logs( $poll_id, $sdate = '', $edate = '' ) {
|
1331 |
global $wpdb;
|
1332 |
+
$sdatesql = '';
|
1333 |
+
$edatesql = '';
|
1334 |
if ( $sdate != '' )
|
1335 |
+
$sdatesql = $wpdb->prepare( ' AND vote_date >= %s ', $sdate.' 00:00:00 ' );
|
1336 |
if ( $edate != '' )
|
1337 |
+
$edatesql = $wpdb->prepare( ' AND vote_date <= %s ', $edate.' 23:59:59 ' );
|
1338 |
$wpdb->query(
|
1339 |
$wpdb -> prepare(
|
1340 |
"
|
1609 |
type = %s
|
1610 |
",
|
1611 |
$answer['poll_id'],
|
1612 |
+
strip_tags($answer['answer'], "<a><img>"),
|
1613 |
$answer['votes'],
|
1614 |
$answer['status'],
|
1615 |
$answer['type']
|
1620 |
|
1621 |
private static function get_answer_from_database( $answer_id ) {
|
1622 |
global $wpdb;
|
1623 |
+
$result = $wpdb->get_row(
|
1624 |
$wpdb->prepare(
|
1625 |
"
|
1626 |
SELECT *
|
1644 |
SET answer = %s
|
1645 |
WHERE id = %d
|
1646 |
",
|
1647 |
+
strip_tags($answer['answer'], "<a><img>"),
|
1648 |
$answer['id']
|
1649 |
)
|
1650 |
);
|
1652 |
|
1653 |
public static function get_archive_polls( $orderby = 'archive_order', $order = 'asc', $offset = 0, $per_page = 99999 ) {
|
1654 |
global $wpdb;
|
1655 |
+
$archive = $wpdb->get_results(
|
1656 |
$wpdb->prepare(
|
1657 |
"
|
1658 |
SELECT id
|
1659 |
FROM ".$wpdb->yop_polls."
|
1660 |
WHERE
|
1661 |
+
show_in_archive = 'yes'
|
1662 |
ORDER BY " . esc_attr( $orderby ) . " " . esc_attr( $order ) . "
|
1663 |
LIMIT %d, %d
|
1664 |
",
|
1671 |
|
1672 |
public static function get_current_active_poll( $offset = 0 ) {
|
1673 |
global $wpdb;
|
1674 |
+
$current_date = self::get_mysql_curent_date();
|
1675 |
return $wpdb->get_row(
|
1676 |
$wpdb->prepare(
|
1677 |
"
|
1678 |
SELECT * FROM ".$wpdb->yop_polls."
|
1679 |
WHERE
|
1680 |
+
%s >= start_date AND
|
1681 |
%s <= end_date
|
1682 |
ORDER BY
|
1683 |
date_added ASC
|
1692 |
|
1693 |
public static function get_latest_closed_poll( $offset = 0 ) {
|
1694 |
global $wpdb;
|
1695 |
+
$current_date = self::get_mysql_curent_date();
|
1696 |
+
$result = $wpdb->get_row(
|
1697 |
$wpdb->prepare(
|
1698 |
"
|
1699 |
SELECT * FROM ".$wpdb->yop_polls."
|
1712 |
|
1713 |
public static function get_yop_polls_filter_search ( $orderby = 'id', $order = 'desc', $filter = array( 'field' => NULL, 'value' => NULL, 'operator' => '=' ), $search = array( 'fields' => array(), 'value' => NULL ) ) {
|
1714 |
global $wpdb;
|
1715 |
+
$sql = "SELECT * FROM ".$wpdb->yop_polls;
|
1716 |
+
$sql_filter = '';
|
1717 |
+
$sql_search = '';
|
1718 |
if ( $filter['field'] && $filter['value'] ) {
|
1719 |
+
$sql_filter .= $wpdb -> prepare( ' `'.esc_attr( $filter['field'] ).'` '.esc_attr( $filter['operator'] ).' %s ', esc_attr( $filter['value'] ) );
|
1720 |
}
|
1721 |
if( count ( $search['fields'] ) > 0 ) {
|
1722 |
if ( $filter['field'] && $filter['value'] )
|
1723 |
+
$sql_search = ' AND ';
|
1724 |
+
$sql_search .= ' ( ';
|
1725 |
foreach( $search['fields'] as $field ) {
|
1726 |
+
$sql_search .= $wpdb -> prepare( ' `'.esc_attr( $field ).'` like \'%%%s%%\' OR', $search['value'] );
|
1727 |
}
|
1728 |
+
$sql_search = trim( $sql_search, 'OR' );
|
1729 |
+
$sql_search .= ' ) ';
|
1730 |
}
|
1731 |
if ( ($filter['field'] && $filter['value']) || count ( $search['fields'] ) > 0 )
|
1732 |
+
$sql .= ' WHERE '.$sql_filter.$sql_search;
|
1733 |
+
$sql .= ' ORDER BY '.esc_attr( $orderby ).' '.esc_attr( $order );
|
1734 |
return $wpdb->get_results( $sql, ARRAY_A );
|
1735 |
}
|
1736 |
|
1737 |
public static function get_yop_polls_fields ( $fields = array( 'id' ) ) {
|
1738 |
global $wpdb;
|
1739 |
+
$fields_text = '';
|
1740 |
if ( count( $fields ) > 0 ) {
|
1741 |
foreach ( $fields as $field ) {
|
1742 |
+
$fields_text .= $field . ', ';
|
1743 |
}
|
1744 |
}
|
1745 |
+
$fields_text = trim( $fields_text, ', ' );
|
1746 |
if ( $fields_text == '' )
|
1747 |
+
$fields_text = 'id';
|
1748 |
+
$sql = 'SELECT ' . $fields_text . ' FROM '.$wpdb->yop_polls;
|
1749 |
return $wpdb->get_results( $sql, ARRAY_A );
|
1750 |
}
|
1751 |
|
1752 |
public static function make_logs_filter_search_sql( $search = array( 'fields' => array(), 'value' => NULL ), $poll_id = NULL, $sdate = '', $edate = '' ) {
|
1753 |
global $wpdb;
|
1754 |
|
1755 |
+
$sql_search = ' ';
|
1756 |
|
1757 |
if( $poll_id ) {
|
1758 |
$sql_search .= $wpdb->prepare( 'WHERE poll_id = %d', $poll_id );
|
1759 |
}
|
1760 |
if( '_Anonymous' == $search['value'] ) {
|
1761 |
if ( $poll_id )
|
1762 |
+
$sql_search .= ' AND ';
|
1763 |
else
|
1764 |
+
$sql_search .= ' WHERE ';
|
1765 |
+
$sql_search .= 'user_id=0 ';
|
1766 |
}
|
1767 |
else {
|
1768 |
if( count ( $search['fields'] ) > 0 ) {
|
1769 |
if ( $poll_id )
|
1770 |
+
$sql_search .= ' AND ( ';
|
1771 |
else
|
1772 |
+
$sql_search .= ' WHERE (';
|
1773 |
foreach( $search['fields'] as $field ) {
|
1774 |
+
$sql_search .= $wpdb -> prepare( ' '.esc_attr( $field ).' like \'%%%s%%\' OR', $search['value'] );
|
1775 |
}
|
1776 |
+
$sql_search = trim( $sql_search, 'OR' );
|
1777 |
+
$sql_search .= ' ) ';
|
1778 |
}
|
1779 |
}
|
1780 |
|
1781 |
if ( $sdate != '' )
|
1782 |
if ( '' == trim( $sql_search ) )
|
1783 |
+
$sql_search .= $wpdb->prepare( ' WHERE vote_date >= %s ', $sdate.' 00:00:00 ' );
|
1784 |
else
|
1785 |
+
$sql_search .= $wpdb->prepare( ' AND vote_date >= %s ', $sdate.' 00:00:00 ' );
|
1786 |
if ( $edate != '' )
|
1787 |
if ( '' == trim( $sql_search ) )
|
1788 |
+
$sql_search .= $wpdb->prepare( ' WHERE vote_date <= %s ', $edate.' 23:59:59 ' );
|
1789 |
else
|
1790 |
+
$sql_search .= $wpdb->prepare( ' AND vote_date <= %s ', $edate.' 23:59:59 ' );
|
1791 |
+
return $sql_search;
|
1792 |
}
|
1793 |
|
1794 |
public static function get_logs_filter_search ( $orderby = 'id', $order = 'desc' , $search = array( 'fields' => array(), 'value' => NULL ), $poll_id = NULL, $offset = 0, $per_page = 99999999, $sdate = '', $edate = '' ) {
|
1795 |
global $wpdb;
|
1796 |
|
1797 |
if ( 'id' == $orderby )
|
1798 |
+
$orderby = $wpdb->yop_poll_logs . ".id";
|
1799 |
|
1800 |
+
$sql_search = self::make_logs_filter_search_sql( $search, $poll_id, $sdate, $edate );
|
1801 |
|
1802 |
+
$sql = "
|
1803 |
SELECT
|
1804 |
id,
|
1805 |
vote_id,
|
1847 |
" . $wpdb->yop_poll_logs . ".user_id = " . $wpdb->yop_poll_facebook_users . ".id
|
1848 |
)
|
1849 |
";
|
1850 |
+
$sql .= ' ) as logs ';
|
1851 |
+
$sql .= $sql_search;
|
1852 |
+
$sql .= ' ORDER BY '.esc_attr( $orderby ).' '.esc_attr( $order );
|
1853 |
+
$sql .= $wpdb->prepare( ' LIMIT %d, %d ', $offset, $per_page);
|
1854 |
return $wpdb->get_results( $sql, ARRAY_A );
|
1855 |
}
|
1856 |
|
1857 |
public static function get_group_logs_filter_search ( $orderby = 'id', $order = 'desc' , $search = array( 'fields' => array(), 'value' => NULL ), $poll_id = NULL, $offset = 0, $per_page = 99999999, $sdate = '', $edate = '' ) {
|
1858 |
global $wpdb;
|
1859 |
|
1860 |
+
$sql_search = self::make_logs_filter_search_sql( $search, $poll_id, $sdate, $edate );
|
1861 |
|
1862 |
+
$sql = "
|
1863 |
SELECT
|
1864 |
id,
|
1865 |
vote_id,
|
1907 |
" . $wpdb->yop_poll_logs . ".user_id = " . $wpdb->yop_poll_facebook_users . ".id
|
1908 |
)
|
1909 |
";
|
1910 |
+
$sql .= ' ) as logs ';
|
1911 |
+
$sql .= $sql_search;
|
1912 |
+
$sql .= ' GROUP BY vote_id';
|
1913 |
+
$sql .= ' ORDER BY '.esc_attr( $orderby ).' '.esc_attr( $order );
|
1914 |
+
$sql .= $wpdb->prepare( ' LIMIT %d, %d ', $offset, $per_page);
|
1915 |
|
1916 |
return $wpdb->get_results( $sql, ARRAY_A );
|
1917 |
}
|
1919 |
public static function get_total_logs_filter_search ( $search = array( 'fields' => array(), 'value' => NULL ), $poll_id = NULL, $sdate = '', $edate = '' ) {
|
1920 |
global $wpdb;
|
1921 |
|
1922 |
+
$sql_search = self::make_logs_filter_search_sql( $search, $poll_id, $sdate, $edate );
|
1923 |
|
1924 |
+
$sql = "
|
1925 |
SELECT
|
1926 |
count(*)
|
1927 |
FROM
|
1958 |
" . $wpdb->yop_poll_logs . ".user_id = " . $wpdb->yop_poll_facebook_users . ".id
|
1959 |
)
|
1960 |
";
|
1961 |
+
$sql .= ' ) as logs ';
|
1962 |
+
$sql .= $sql_search;
|
1963 |
return $wpdb->get_var( $sql );
|
1964 |
}
|
1965 |
|
1966 |
public static function get_total_group_logs_filter_search ( $search = array( 'fields' => array(), 'value' => NULL ), $poll_id = NULL, $sdate = '', $edate = '' ) {
|
1967 |
global $wpdb;
|
1968 |
|
1969 |
+
$sql_search = self::make_logs_filter_search_sql( $search, $poll_id, $sdate, $edate );
|
1970 |
|
1971 |
+
$sql = "
|
1972 |
SELECT
|
1973 |
count(*)
|
1974 |
FROM
|
2009 |
" . $wpdb->yop_poll_logs . ".user_id = " . $wpdb->yop_poll_facebook_users . ".id
|
2010 |
)
|
2011 |
";
|
2012 |
+
$sql .= ' ) as logs ';
|
2013 |
+
$sql .= $sql_search;
|
2014 |
+
$sql .= ' GROUP BY vote_id ) as count_logs';
|
2015 |
return $wpdb->get_var( $sql );
|
2016 |
}
|
2017 |
|
2019 |
global $wpdb;
|
2020 |
|
2021 |
if ( 'id' == $orderby )
|
2022 |
+
$orderby = $wpdb->yop_poll_bans . ".id";
|
2023 |
|
2024 |
+
$sql_search = ' ';
|
2025 |
|
2026 |
if( $poll_id ) {
|
2027 |
$sql_search .= $wpdb->prepare( 'WHERE ' . $wpdb->yop_poll_bans . '.poll_id = %d', $poll_id );
|
2028 |
}
|
2029 |
if( $type ) {
|
2030 |
if ( $poll_id )
|
2031 |
+
$sql_search .= ' AND ';
|
2032 |
else
|
2033 |
+
$sql_search .= ' WHERE ';
|
2034 |
+
$sql_search .= $wpdb->prepare( $wpdb->yop_poll_bans . '.type= %s', $type );
|
2035 |
}
|
2036 |
if( count ( $search['fields'] ) > 0 ) {
|
2037 |
if ( $poll_id || $type )
|
2038 |
+
$sql_search .= ' AND ( ';
|
2039 |
else
|
2040 |
+
$sql_search .= ' WHERE (';
|
2041 |
foreach( $search['fields'] as $field ) {
|
2042 |
+
$sql_search .= $wpdb -> prepare( ' '.esc_attr( $field ).' like \'%%%s%%\' OR', $search['value'] );
|
2043 |
}
|
2044 |
+
$sql_search = trim( $sql_search, 'OR' );
|
2045 |
+
$sql_search .= ' ) ';
|
2046 |
}
|
2047 |
|
2048 |
+
$sql = "SELECT
|
2049 |
" . $wpdb->yop_poll_bans . ".id,
|
2050 |
" . $wpdb->yop_poll_bans . ".value,
|
2051 |
" . $wpdb->yop_poll_bans . ".type,
|
2057 |
" . $wpdb->yop_poll_bans . ".poll_id = " . $wpdb->yop_polls . ".id
|
2058 |
)
|
2059 |
";
|
2060 |
+
$sql .= $sql_search;
|
2061 |
+
$sql .= ' ORDER BY '.esc_attr( $orderby ).' '.esc_attr( $order );
|
2062 |
+
$sql .= $wpdb->prepare( ' LIMIT %d, %d', $offset, $per_page);
|
2063 |
return $wpdb->get_results( $sql, ARRAY_A );
|
2064 |
}
|
2065 |
|
2187 |
$poll_details = self::get_poll_from_database_by_id( $poll_id );
|
2188 |
$clone_number = self::count_poll_from_database_like_name( $poll_details['name']. ' - clone' );
|
2189 |
if ( $poll_details ) {
|
2190 |
+
$poll = array(
|
2191 |
+
'name' => $poll_details['name'] . ' - clone' . ( 0 == $clone_number ? '' : $clone_number),
|
2192 |
+
'question' => $poll_details['question'],
|
2193 |
+
'start_date' => $poll_details['start_date'],
|
2194 |
+
'end_date' => $poll_details['end_date'],
|
2195 |
+
'total_votes' => 0,
|
2196 |
+
'total_answers' => 0,
|
2197 |
+
'status' => $poll_details['status'],
|
2198 |
+
'date_added' => NULL,
|
2199 |
'show_in_archive'=> $poll_details['show_in_archive'],
|
2200 |
+
'archive_order' => $poll_details['archive_order'] + 1
|
2201 |
);
|
2202 |
$new_poll_id = self::insert_poll_to_database( $poll );
|
2203 |
|
2229 |
if ( $answers ) {
|
2230 |
foreach ( $answers as $answer ) {
|
2231 |
$answer_to_insert = array(
|
2232 |
+
'poll_id' => $new_poll_id,
|
2233 |
+
'answer' => $answer['answer'],
|
2234 |
+
'votes' => 0,
|
2235 |
+
'status' => $answer['status'],
|
2236 |
+
'type' => $answer['type']
|
2237 |
);
|
2238 |
$new_answer_id = self::insert_answer_to_database ( $answer_to_insert );
|
2239 |
|
2248 |
if ( $custom_fields ) {
|
2249 |
foreach ( $custom_fields as $custom_field ) {
|
2250 |
$custom_field_to_insert = array(
|
2251 |
+
'poll_id' => $new_poll_id,
|
2252 |
+
'custom_field' => $custom_field['custom_field'],
|
2253 |
+
'required' => $custom_field['required'],
|
2254 |
+
'status' => $custom_field['status']
|
2255 |
);
|
2256 |
$new_custom_field_id = self::insert_custom_field_to_database( $custom_field_to_insert );
|
2257 |
}
|
2261 |
|
2262 |
public static function get_yop_poll_templates_search ( $orderby = 'last_modified', $order = 'desc', $search = array( 'fields' => array(), 'value' => NULL ) ) {
|
2263 |
global $wpdb;
|
2264 |
+
$sql = "SELECT * FROM ".$wpdb->yop_poll_templates;
|
2265 |
+
$sql_search = '';
|
2266 |
if( count ( $search['fields'] ) > 0 ) {
|
2267 |
+
$sql_search .= ' ( ';
|
2268 |
foreach( $search['fields'] as $field ) {
|
2269 |
+
$sql_search .= $wpdb -> prepare( ' `'.$field.'` like \'%%%s%%\' OR', $search['value'] );
|
2270 |
}
|
2271 |
+
$sql_search = trim( $sql_search, 'OR' );
|
2272 |
+
$sql_search .= ' ) ';
|
2273 |
}
|
2274 |
if ( count ( $search['fields'] ) > 0 )
|
2275 |
+
$sql .= ' WHERE '.$sql_search;
|
2276 |
+
$sql .= ' ORDER BY '.$orderby.' '.$order;
|
2277 |
return $wpdb->get_results( $sql, ARRAY_A );
|
2278 |
}
|
2279 |
|
2440 |
$template_details = self::get_poll_template_from_database_by_id( $template_id );
|
2441 |
$clone_number = self::count_poll_template_from_database_like_name( $template_details['name']. ' - clone' );
|
2442 |
if ( $template_details ) {
|
2443 |
+
$template = array(
|
2444 |
+
'name' => $template_details['name'] . ' - clone' . ( 0 == $clone_number ? '' : $clone_number),
|
2445 |
+
'before_vote_template' => $template_details['before_vote_template'],
|
2446 |
+
'after_vote_template' => $template_details['after_vote_template'],
|
2447 |
+
'before_start_date_template' => $template_details['before_start_date_template'],
|
2448 |
+
'after_end_date_template' => $template_details['after_end_date_template'],
|
2449 |
+
'css' => $template_details['css'],
|
2450 |
+
'js' => $template_details['js'],
|
2451 |
+
'status' => ( 'default' == $template_details['status'] ) ? 'other' : $template_details['status'],
|
2452 |
+
'date_added' => NULL,
|
2453 |
+
'last_modified' => NULL
|
2454 |
);
|
2455 |
$new_template_id = self::insert_poll_template_to_database( $template );
|
2456 |
}
|
2486 |
"
|
2487 |
INSERT INTO ".$wpdb->yop_poll_logs."
|
2488 |
SET
|
2489 |
+
poll_id = %d,
|
2490 |
+
vote_id = %s,
|
2491 |
+
answer_id = %d,
|
2492 |
+
ip = %s,
|
2493 |
+
user_id = %s,
|
2494 |
+
user_type = %s,
|
2495 |
+
http_referer = %s,
|
2496 |
+
tr_id = %s,
|
2497 |
+
host = %s,
|
2498 |
+
other_answer_value = %s,
|
2499 |
+
vote_date = %s
|
2500 |
",
|
2501 |
$answer['poll_id'],
|
2502 |
$answer['vote_id'],
|
2522 |
"
|
2523 |
INSERT INTO ".$wpdb->yop_poll_voters."
|
2524 |
SET
|
2525 |
+
poll_id = %d,
|
2526 |
+
user_id = %s,
|
2527 |
+
user_type = %s
|
2528 |
",
|
2529 |
$voter['poll_id'],
|
2530 |
$voter['user_id'],
|
2535 |
}
|
2536 |
|
2537 |
public function add_user_other_answer_to_default_answers( &$answer ) { //add user other answer into answers table
|
2538 |
+
$poll_id = $this->poll['id'];
|
2539 |
+
$poll_options = $this->poll_options;
|
2540 |
|
2541 |
if ( isset( $poll_options['add_other_answers_to_default_answers'] ) ) {
|
2542 |
if ( 'yes' == $poll_options['add_other_answers_to_default_answers'] ) {
|
2543 |
if ( 'other' == $answer['type'] ) {
|
2544 |
+
$answer_exist = self::get_poll_answer_by_field( $poll_id, 'answer', $answer['other_answer_value'], '%s' );
|
2545 |
if ( isset( $answer_exist['id'] ) ) {
|
2546 |
+
$answer['answer_id'] = $answer_exist['id'];
|
2547 |
+
$answer['type'] = 'default';
|
2548 |
+
$answer['other_answer_value'] = '';
|
2549 |
}
|
2550 |
else {
|
2551 |
+
$answer_to_add = array(
|
2552 |
+
'poll_id' => $answer['poll_id'],
|
2553 |
+
'answer' => $answer['other_answer_value'],
|
2554 |
+
'votes' => 0,
|
2555 |
+
'status' => 'active',
|
2556 |
+
'type' => 'default'
|
2557 |
);
|
2558 |
+
$new_answer_id = self::insert_answer_to_database( $answer_to_add );
|
2559 |
if ( $new_answer_id ) {
|
2560 |
+
$answer['answer_id'] = $new_answer_id;
|
2561 |
+
$answer['type'] = 'default';
|
2562 |
+
$answer['other_answer_value'] = '';
|
2563 |
+
}
|
2564 |
}
|
2565 |
}
|
2566 |
}
|
2571 |
|
2572 |
public function get_voter_number_of_votes( $voter ) {
|
2573 |
global $wpdb;
|
2574 |
+
$result = $wpdb->get_var(
|
2575 |
$wpdb->prepare(
|
2576 |
"
|
2577 |
SELECT count(*) as total_votes
|
2586 |
$voter['user_type']
|
2587 |
)
|
2588 |
);
|
2589 |
+
return $result;
|
2590 |
}
|
2591 |
|
2592 |
public function user_have_votes_to_vote( $voter ) {
|
2593 |
+
$poll_options = $this->poll_options;
|
2594 |
if ( $voter['user_id'] > 0 )
|
2595 |
if ( 'yes' == $poll_options['limit_number_of_votes_per_user'] )
|
2596 |
if ( $this->get_voter_number_of_votes( $voter ) >= $poll_options['number_of_votes_per_user'] )
|
2597 |
+
return false;
|
2598 |
return true;
|
2599 |
}
|
2600 |
|
2606 |
private static function insert_vote_custom_field_in_database( $custom_field = array() ) {
|
2607 |
global $wpdb;
|
2608 |
|
2609 |
+
$custom_field['custom_field_value'] = strip_tags( $custom_field['custom_field_value'] );
|
2610 |
$wpdb->query(
|
2611 |
$wpdb->prepare(
|
2612 |
"
|
2613 |
INSERT INTO ".$wpdb->yop_poll_votes_custom_fields."
|
2614 |
SET
|
2615 |
+
poll_id = %d,
|
2616 |
+
vote_id = %s,
|
2617 |
+
custom_field_id = %d,
|
2618 |
+
user_id = %s,
|
2619 |
+
user_type = %s,
|
2620 |
+
custom_field_value = %s,
|
2621 |
+
tr_id = %s,
|
2622 |
+
vote_date = %s
|
2623 |
",
|
2624 |
$custom_field['poll_id'],
|
2625 |
$custom_field['vote_id'],
|
2637 |
private static function insert_facebook_user_in_database( $user_details = array() ) {
|
2638 |
global $wpdb;
|
2639 |
|
2640 |
+
$user_exist = $wpdb->get_row(
|
2641 |
$wpdb->prepare(
|
2642 |
"
|
2643 |
SELECT * FROM ".$wpdb->yop_poll_facebook_users."
|
2644 |
WHERE
|
2645 |
+
fb_id = %s
|
2646 |
LIMIT 0,1
|
2647 |
",
|
2648 |
$user_details['id']
|
2656 |
"
|
2657 |
UPDATE ".$wpdb->yop_poll_facebook_users."
|
2658 |
SET
|
2659 |
+
name = %s,
|
2660 |
+
first_name = %s,
|
2661 |
+
last_name = %s,
|
2662 |
+
username = %s,
|
2663 |
+
email = %s,
|
2664 |
+
gender = %s
|
2665 |
WHERE
|
2666 |
+
fb_id = %s,
|
2667 |
",
|
2668 |
$user_details['name'],
|
2669 |
$user_details['first_name'],
|
2682 |
"
|
2683 |
INSERT INTO ".$wpdb->yop_poll_facebook_users."
|
2684 |
SET
|
2685 |
+
fb_id = %s,
|
2686 |
+
name = %s,
|
2687 |
+
first_name = %s,
|
2688 |
+
last_name = %s,
|
2689 |
+
username = %s,
|
2690 |
+
email = %s,
|
2691 |
+
gender = %s,
|
2692 |
+
date_added = %s
|
2693 |
",
|
2694 |
$user_details['id'],
|
2695 |
$user_details['name'],
|
2821 |
$field['value']
|
2822 |
)
|
2823 |
);
|
2824 |
+
}
|
2825 |
|
2826 |
public function register_vote( $request ) {
|
2827 |
global $current_user;
|
2828 |
+
$poll_id = $this->poll['id'];
|
2829 |
+
$unique_id = $this->unique_id;
|
2830 |
+
$location = $request['location'];
|
2831 |
if ( wp_verify_nonce( $request[ 'yop-poll-nonce-'.$poll_id.$unique_id ], 'yop_poll-'.$poll_id.$unique_id.'-user-actions' ) ) {
|
2832 |
+
$poll_details = $this->poll;
|
2833 |
+
$poll_options = $this->poll_options;
|
2834 |
+
$vote_id = uniqid('vote_id_');
|
2835 |
+
$vote_type = $request['vote_type'];
|
2836 |
+
$tr_id = $request['yop_poll_tr_id'];
|
2837 |
|
2838 |
+
$facebook_error = $request['facebook_error'];
|
2839 |
+
$facebook_user_details = json_decode( self::base64_decode( $request['facebook_user_details'] ), true );
|
2840 |
|
2841 |
if ( 'facebook' == $vote_type ) {
|
2842 |
if ( ! is_array( $facebook_user_details ) ) {
|
2852 |
if ( $facebook_error == 'access_denied' ) {
|
2853 |
$this->error = __( 'You Don`t Have Permission to Vote! You must authorize YOP POLL application in your facebook account!', 'yop_poll' );
|
2854 |
return false;
|
2855 |
+
}
|
2856 |
if ( $facebook_error == 'access_error' ) {
|
2857 |
$this->error = __( 'You Don`t Have Permission to Vote!', 'yop_poll' );
|
2858 |
return false;
|
2859 |
}
|
2860 |
|
2861 |
+
$facebook_user_id = $this->insert_facebook_user_in_database( $facebook_user_details );
|
2862 |
}
|
2863 |
|
2864 |
$current_date = YOP_POLL_MODEL::get_mysql_curent_date();
|
2871 |
}
|
2872 |
else {
|
2873 |
if ( ! $this->is_voted( $vote_type, $facebook_user_details, true ) ) {
|
2874 |
+
$answers = array();
|
2875 |
+
$voter = array();
|
2876 |
+
$voter['poll_id'] = $poll_id;
|
2877 |
+
$voter['user_id'] = $current_user->ID;
|
2878 |
+
$voter['user_type'] = 'wordpress';
|
2879 |
+
if ( 'facebook' == $vote_type ) {
|
2880 |
+
$voter['user_id'] = $facebook_user_id;
|
2881 |
+
$voter['user_type'] = $vote_type;
|
2882 |
}
|
2883 |
if ( $this->user_have_votes_to_vote( $voter ) ) {
|
2884 |
if ( isset ( $request['yop_poll_answer'] ) ) {
|
2885 |
if ( 'yes' == $poll_options['allow_multiple_answers'] ) {
|
2886 |
if ( count( $request['yop_poll_answer'] ) <= intval( $poll_options['allow_multiple_answers_number'] ) ) {
|
2887 |
+
if ( count( $request['yop_poll_answer'] ) >= intval( $poll_options['allow_multiple_answers_min_number'] ) ) {
|
2888 |
foreach( $request['yop_poll_answer'] as $answer_id ) {
|
2889 |
+
$answer = array();
|
2890 |
+
$answer['poll_id'] = $poll_id;
|
2891 |
+
$answer['vote_id'] = $vote_id;
|
2892 |
+
$answer['answer_id'] = $answer_id;
|
2893 |
+
$answer['ip'] = self::get_ip();
|
2894 |
+
$answer['user_id'] = $current_user->ID;
|
2895 |
+
$answer['type'] = 'default';
|
2896 |
+
|
2897 |
+
$answer['user_type'] = 'default';
|
2898 |
if ( in_array( $vote_type, $this->vote_types ) )
|
2899 |
+
$answer['user_type'] = $vote_type;
|
2900 |
|
2901 |
+
$answer['http_referer'] = $_SERVER['HTTP_REFERER'];
|
2902 |
+
$answer['tr_id'] = $tr_id;
|
2903 |
+
$answer['host'] = esc_attr(@gethostbyaddr(self::get_ip()));
|
2904 |
+
$answer['other_answer_value'] = '';
|
2905 |
+
$answer_details = self::get_poll_answer_by_id( $answer_id );
|
2906 |
if ( 'other' == $answer_details['type'] ) {
|
2907 |
if( isset( $request['yop_poll_other_answer'] ) ) {
|
2908 |
+
if ( '' != strip_tags( trim( $request['yop_poll_other_answer'] ) ) ) {
|
2909 |
+
$answer['other_answer_value'] = strip_tags($request['yop_poll_other_answer']);
|
2910 |
+
$answer['type'] = 'other';
|
2911 |
}
|
2912 |
else {
|
2913 |
+
$this->error = __( 'Your other answer is empty!', 'yop_poll' );
|
2914 |
return false;
|
2915 |
}
|
2916 |
}
|
2917 |
else {
|
2918 |
+
$this->error = __( 'Your other answer is invalid!', 'yop_poll' );
|
2919 |
return false;
|
2920 |
}
|
2921 |
}
|
2922 |
+
$answers[] = $answer;
|
2923 |
}
|
2924 |
}
|
2925 |
else {
|
2926 |
+
$this->error = __( 'Too few answers! Only more than ', 'yop_poll' ) . $poll_options['allow_multiple_answers_min_number'] . __(' answers allowed!', 'yop_poll' );
|
2927 |
return false;
|
2928 |
}
|
2929 |
}
|
2930 |
else {
|
2931 |
+
$this->error = __( 'Too many answers! Only ', 'yop_poll' ) . $poll_options['allow_multiple_answers_number'] . __(' answers allowed!', 'yop_poll' );
|
2932 |
return false;
|
2933 |
}
|
2934 |
}
|
2935 |
else {
|
2936 |
+
$answer = array();
|
2937 |
+
$answer['poll_id'] = $poll_id;
|
2938 |
+
$answer['vote_id'] = $vote_id;
|
2939 |
+
$answer['answer_id'] = $request['yop_poll_answer'];
|
2940 |
+
$answer['ip'] = self::get_ip();
|
2941 |
+
$answer['user_id'] = $current_user->ID;
|
2942 |
+
$answer['type'] = 'default';
|
2943 |
+
|
2944 |
+
$answer['user_type'] = 'default';
|
2945 |
if ( in_array( $vote_type, $this->vote_types ) )
|
2946 |
+
$answer['user_type'] = $vote_type;
|
2947 |
|
2948 |
+
$answer['http_referer'] = $_SERVER['HTTP_REFERER'];
|
2949 |
+
$answer['tr_id'] = $tr_id;
|
2950 |
+
$answer['host'] = esc_attr(@gethostbyaddr(self::get_ip()));
|
2951 |
+
$answer['other_answer_value'] = '';
|
2952 |
+
$answer_details = self::get_poll_answer_by_id( $request['yop_poll_answer'] );
|
2953 |
if ( 'other' == $answer_details['type'] ) {
|
2954 |
if( isset( $request['yop_poll_other_answer'] ) ) {
|
2955 |
+
if ( '' != strip_tags( trim( $request['yop_poll_other_answer'] ) ) ) {
|
2956 |
+
$answer['other_answer_value'] = strip_tags( $request['yop_poll_other_answer']);
|
2957 |
+
$answer['type'] = 'other';
|
2958 |
}
|
2959 |
else {
|
2960 |
+
$this->error = __( 'Your other answer is empty or contains invalid tags!', 'yop_poll' );
|
2961 |
return false;
|
2962 |
}
|
2963 |
}
|
2964 |
else {
|
2965 |
+
$this->error = __( 'Your other answer is invalid!', 'yop_poll' );
|
2966 |
return false;
|
2967 |
}
|
2968 |
}
|
2969 |
+
$answers[] = $answer;
|
2970 |
}
|
2971 |
if ( count($answers) > 0 ) {
|
2972 |
+
$custom_fields = array();
|
2973 |
+
$poll_custom_fields = self::get_poll_customfields( $poll_id);
|
2974 |
if ( count( $poll_custom_fields ) > 0 ) {
|
2975 |
if( isset( $request['yop_poll_customfield'] ) ) {
|
2976 |
foreach ( $poll_custom_fields as $custom_field ) {
|
2977 |
if ( isset( $request['yop_poll_customfield'][ $custom_field['id'] ] ) ) {
|
2978 |
if ( '' == trim( $request['yop_poll_customfield'][ $custom_field['id'] ] ) && 'yes' == $custom_field['required'] ) {
|
2979 |
+
$this->error = __( 'Custom field ', 'yop_poll').$custom_field['custom_field'].__( ' is required! ', 'yop_poll' );
|
2980 |
return false;
|
2981 |
}
|
2982 |
else {
|
2983 |
if ( $request['yop_poll_customfield'][ $custom_field['id'] ] != '' ) {
|
2984 |
+
$new_custom_field = array();
|
2985 |
+
$new_custom_field['poll_id'] = $poll_id;
|
2986 |
+
$new_custom_field['vote_id'] = $vote_id;
|
2987 |
+
$new_custom_field['custom_field_id'] = $custom_field['id'];
|
2988 |
+
$new_custom_field['user_id'] = $current_user->ID;
|
2989 |
|
2990 |
+
$new_custom_field['user_type'] = 'default';
|
2991 |
if ( in_array( $vote_type, $this->vote_types ) )
|
2992 |
+
$new_custom_field['user_type'] = $vote_type;
|
2993 |
|
2994 |
+
$new_custom_field['custom_field_value'] = strip_tags( trim( $request['yop_poll_customfield'][ $custom_field['id'] ] ) );
|
2995 |
+
$custom_fields[] = $new_custom_field;
|
2996 |
}
|
2997 |
}
|
2998 |
}
|
2999 |
else {
|
3000 |
+
$this->error = __( 'Custom field ', 'yop_poll').$custom_field['custom_field'].__( ' is missing! ', 'yop_poll' );
|
3001 |
return false;
|
3002 |
}
|
3003 |
}
|
3004 |
}
|
3005 |
else {
|
3006 |
+
$this->error = __('Custom fields are missing!', 'yop_poll');
|
3007 |
return false;
|
3008 |
}
|
3009 |
}
|
3010 |
|
3011 |
if ( 'yes' == $poll_options['use_captcha'] ) {
|
3012 |
require_once( YOP_POLL_INC.'/securimage.php');
|
3013 |
+
$img = new Yop_Poll_Securimage();
|
3014 |
+
$img->namespace = 'yop_poll_'.$poll_id.$unique_id;
|
3015 |
if ( $img->check( $_REQUEST[ 'yop_poll_captcha_input' ][ $poll_id ] ) ) {
|
3016 |
$cookie_ids = '';
|
3017 |
+
$votes = 0;
|
3018 |
+
$mail_notifications_answers = '';
|
3019 |
foreach( $answers as &$answer ) {
|
3020 |
+
if ( 'facebook' == $vote_type ) {
|
3021 |
+
$answer['user_id'] = $facebook_user_id;
|
3022 |
}
|
3023 |
+
if ( 'anonymous' == $vote_type )
|
3024 |
+
$answer['user_id'] = 0;
|
3025 |
$this->add_user_other_answer_to_default_answers( $answer );
|
3026 |
self::insert_vote_in_database( $answer );
|
3027 |
+
$cookie_ids .= $answer['answer_id'].',';
|
3028 |
$this->update_answer_votes( $answer['answer_id'], 1 );
|
3029 |
$votes++;
|
3030 |
+
$answer_base = self::get_answer_from_database( $answer['answer_id'] );
|
3031 |
if ( $answer_base['type'] != 'other' )
|
3032 |
+
$mail_notifications_answers .= $answer_base['answer'] . '<br>';
|
3033 |
else
|
3034 |
+
$mail_notifications_answers .= $answer_base['answer'] . ': '.$answer['other_answer_value'].'<br>';
|
3035 |
}
|
3036 |
+
$mail_notifications_answers = trim( $mail_notifications_answers, '<br>');
|
3037 |
|
3038 |
self::insert_voter_in_database( $voter );
|
3039 |
$this->update_poll_votes_and_answers( $votes, 1 );
|
3040 |
|
3041 |
+
$mail_notifications_custom_fields = '';
|
3042 |
foreach( $custom_fields as $custom_field ) {
|
3043 |
+
if ( 'facebook' == $vote_type )
|
3044 |
+
$custom_field['user_id'] = $facebook_user_id;
|
3045 |
+
if ( 'anonymous' == $vote_type )
|
3046 |
+
$custom_field['user_id'] = 0;
|
3047 |
+
$custom_field['tr_id'] = $tr_id;
|
3048 |
self::insert_vote_custom_field_in_database( $custom_field );
|
3049 |
+
$custom_field_base = self::get_customfield_by_id( $custom_field['custom_field_id'] );
|
3050 |
+
$mail_notifications_custom_fields .= $custom_field_base['custom_field'] . ': '.$custom_field['custom_field_value'].'<br>';
|
3051 |
}
|
3052 |
+
$mail_notifications_custom_fields = trim( $mail_notifications_custom_fields, '<br>');
|
3053 |
|
3054 |
$this->set_vote_cookie( trim($cookie_ids, ',' ), $vote_type, $facebook_user_details );
|
3055 |
+
$this->vote = true;
|
3056 |
+
$this -> poll = self::get_poll_from_database_by_id( $poll_id );
|
3057 |
if ( 'yes' == $poll_options['number_of_votes_per_user'] )
|
3058 |
+
$this->success = str_replace( '%USER-VOTES-LEFT%', intval( $poll_options['number_of_votes_per_user'] ) - $this->get_voter_number_of_votes( $voter ), $poll_options['message_after_vote'] );
|
3059 |
else
|
3060 |
+
$this->success = str_replace( '%USER-VOTES-LEFT%', '', $poll_options['message_after_vote'] );
|
3061 |
if ( 'yes' == $poll_options['send_email_notifications'] ) {
|
3062 |
$headers = 'From: '.$poll_options['email_notifications_from_name'].' <'.$poll_options['email_notifications_from_email'].'>';
|
3063 |
+
$subject = str_replace( '[POLL_NAME]', $this->poll['name'], $poll_options['email_notifications_subject'] );
|
3064 |
+
$subject = str_replace( '[QUESTION]', $this->poll['question'], $subject );
|
3065 |
+
$subject = str_replace( '[ANSWERS]', $mail_notifications_answers, $subject );
|
3066 |
+
$subject = str_replace( '[CUSTOM_FIELDS]', $mail_notifications_custom_fields, $subject );
|
3067 |
+
$subject = str_replace( '[VOTE_ID]', $vote_id, $subject );
|
3068 |
+
$subject = str_replace( '[VOTE_DATE]', self::convert_date( current_time( 'mysql' ), $poll_options['date_format'] ), $subject );
|
3069 |
+
|
3070 |
+
$body = str_replace( '[POLL_NAME]', $this->poll['name'], $poll_options['email_notifications_body'] );
|
3071 |
+
$body = str_replace( '[QUESTION]', $this->poll['question'], $body );
|
3072 |
+
$body = str_replace( '[ANSWERS]', $mail_notifications_answers, $body );
|
3073 |
+
$body = str_replace( '[CUSTOM_FIELDS]', $mail_notifications_custom_fields, $body );
|
3074 |
+
$body = str_replace( '[CUSTOM_FIELDS]', $mail_notifications_custom_fields, $body );
|
3075 |
+
$body = str_replace( '[VOTE_ID]', $vote_id, $body );
|
3076 |
+
$body = str_replace( '[VOTE_DATE]', self::convert_date( current_time( 'mysql' ), $poll_options['date_format'] ), $body );
|
3077 |
+
|
3078 |
add_filter( 'wp_mail_content_type', 'yop_poll_set_html_content_type' );
|
3079 |
+
$is_sent = wp_mail( $poll_options['email_notifications_recipients'], $subject, $body, $headers );
|
3080 |
remove_filter( 'wp_mail_content_type', 'yop_poll_set_html_content_type' );
|
3081 |
}
|
3082 |
return do_shortcode( $this->return_poll_html( array( 'tr_id' => $tr_id, 'location' => $location ) ) );
|
3083 |
}
|
3084 |
else {
|
3085 |
+
$this->error = __( 'Incorrect security code entered!', 'yop_poll');
|
3086 |
return false;
|
3087 |
}
|
3088 |
}
|
3089 |
else {
|
3090 |
$cookie_ids = '';
|
3091 |
+
$votes = 0;
|
3092 |
+
$mail_notifications_answers = '';
|
3093 |
foreach( $answers as &$answer ) {
|
3094 |
+
if ( 'facebook' == $vote_type ) {
|
3095 |
+
$answer['user_id'] = $facebook_user_id;
|
3096 |
}
|
3097 |
+
if ( 'anonymous' == $vote_type )
|
3098 |
+
$answer['user_id'] = 0;
|
3099 |
|
3100 |
$this->add_user_other_answer_to_default_answers( $answer );
|
3101 |
self::insert_vote_in_database( $answer );
|
3102 |
+
$cookie_ids .= $answer['answer_id'].',';
|
3103 |
$this->update_answer_votes( $answer['answer_id'], 1 );
|
3104 |
$votes++;
|
3105 |
+
$answer_base = self::get_answer_from_database( $answer['answer_id'] );
|
3106 |
if ( $answer_base['type'] != 'other' )
|
3107 |
+
$mail_notifications_answers .= $answer_base['answer'] . '<br>';
|
3108 |
else
|
3109 |
+
$mail_notifications_answers .= $answer_base['answer'] . ': '.$answer['other_answer_value'].'<br>';
|
3110 |
}
|
3111 |
|
3112 |
+
$mail_notifications_answers = trim( $mail_notifications_answers, '<br>');
|
3113 |
|
3114 |
self::insert_voter_in_database( $voter );
|
3115 |
|
3116 |
$this->update_poll_votes_and_answers( $votes, 1 );
|
3117 |
|
3118 |
+
$mail_notifications_custom_fields = '';
|
3119 |
foreach( $custom_fields as $custom_field ) {
|
3120 |
+
if ( 'facebook' == $vote_type )
|
3121 |
+
$custom_field['user_id'] = $facebook_user_id;
|
3122 |
if ( 'anonymous' == $vote_type )
|
3123 |
+
$custom_field['user_id'] = 0;
|
3124 |
+
$custom_field['tr_id'] = $tr_id;
|
3125 |
self::insert_vote_custom_field_in_database( $custom_field );
|
3126 |
+
$custom_field_base = self::get_customfield_by_id( $custom_field['custom_field_id'] );
|
3127 |
+
$mail_notifications_custom_fields .= $custom_field_base['custom_field'] . ': '.$custom_field['custom_field_value'].'<br>';
|
3128 |
}
|
3129 |
+
$mail_notifications_custom_fields = trim( $mail_notifications_custom_fields, '<br>');
|
3130 |
|
3131 |
$this->set_vote_cookie( trim($cookie_ids, ',' ), $vote_type, $facebook_user_details );
|
3132 |
+
$this->vote = true;
|
3133 |
+
$this -> poll = self::get_poll_from_database_by_id( $poll_id );
|
3134 |
if ( 'yes' == $poll_options['limit_number_of_votes_per_user'] )
|
3135 |
+
$this->success = str_replace( '%USER-VOTES-LEFT%', intval( $poll_options['number_of_votes_per_user'] ) - $this->get_voter_number_of_votes( $voter ), $poll_options['message_after_vote'] );
|
3136 |
else
|
3137 |
+
$this->success = str_replace( '%USER-VOTES-LEFT%', '', $poll_options['message_after_vote'] );
|
3138 |
if ( 'yes' == $poll_options['send_email_notifications'] ) {
|
3139 |
$headers = 'From: '.$poll_options['email_notifications_from_name'].' <'.$poll_options['email_notifications_from_email'].'>';
|
3140 |
+
$subject = str_replace( '[POLL_NAME]', $this->poll['name'], $poll_options['email_notifications_subject'] );
|
3141 |
+
$subject = str_replace( '[QUESTION]', $this->poll['question'], $subject );
|
3142 |
+
$subject = str_replace( '[ANSWERS]', $mail_notifications_answers, $subject );
|
3143 |
+
$subject = str_replace( '[CUSTOM_FIELDS]', $mail_notifications_custom_fields, $subject );
|
3144 |
+
$subject = str_replace( '[VOTE_ID]', $vote_id, $subject );
|
3145 |
+
$subject = str_replace( '[VOTE_DATE]', self::convert_date( current_time( 'mysql' ), $poll_options['date_format'] ), $subject );
|
3146 |
+
|
3147 |
+
$body = str_replace( '[POLL_NAME]', $this->poll['name'], $poll_options['email_notifications_body'] );
|
3148 |
+
$body = str_replace( '[QUESTION]', $this->poll['question'], $body );
|
3149 |
+
$body = str_replace( '[ANSWERS]', $mail_notifications_answers, $body );
|
3150 |
+
$body = str_replace( '[CUSTOM_FIELDS]', $mail_notifications_custom_fields, $body );
|
3151 |
+
$body = str_replace( '[VOTE_ID]', $vote_id, $body );
|
3152 |
+
$body = str_replace( '[VOTE_DATE]', self::convert_date( current_time( 'mysql' ), $poll_options['date_format'] ), $body );
|
3153 |
|
3154 |
add_filter( 'wp_mail_content_type', 'yop_poll_set_html_content_type' );
|
3155 |
+
$is_sent = wp_mail( $poll_options['email_notifications_recipients'], $subject, $body, $headers );
|
3156 |
remove_filter( 'wp_mail_content_type', 'yop_poll_set_html_content_type' );
|
3157 |
}
|
3158 |
|
3160 |
}
|
3161 |
}
|
3162 |
else {
|
3163 |
+
$this->error = __( 'No vote was registered!', 'yop_poll');
|
3164 |
return false;
|
3165 |
}
|
3166 |
}
|
3201 |
}
|
3202 |
}
|
3203 |
|
3204 |
+
public function return_poll_css( $attr = array( 'location' => 'page', 'preview' => false, 'template_id' => '', 'loc' => 1 ) ) {
|
3205 |
+
$preview = isset( $attr['preview'] ) ? $attr['preview'] : false;
|
3206 |
+
if( $preview ) {
|
3207 |
+
$template_id = isset( $attr['template_id'] ) ? $attr['template_id'] : '';
|
3208 |
+
if( '' == $template_id ) {
|
3209 |
+
$default_template = self::get_default_template();
|
3210 |
+
$template_id = $default_template['id'] ? $default_template['id'] : 0;
|
3211 |
+
}
|
3212 |
+
$template_details = self::get_poll_template_from_database_by_id( $template_id );
|
3213 |
+
$template = $template_details['css'];
|
3214 |
+
$template = str_ireplace( "%POLL-ID%", 'preview-'. $attr['loc'] .'', $template );
|
3215 |
+
$template = str_ireplace( "%POLL-WIDTH%", '200px', $template );
|
3216 |
+
return stripslashes($template);
|
3217 |
+
}
|
3218 |
+
else {
|
3219 |
+
$poll_id = $this->poll['id'];
|
3220 |
+
$location = isset( $attr['location'] ) ? $attr['location'] : 'page';
|
3221 |
+
$unique_id = $this->unique_id;
|
3222 |
+
if( ! $poll_id )
|
3223 |
+
return '';
|
3224 |
+
$poll_details = $this->poll;
|
3225 |
+
$poll_options = $this->poll_options;
|
3226 |
+
if ( 'widget' == $location )
|
3227 |
+
$template_id = $poll_options['widget_template'];
|
3228 |
+
else
|
3229 |
+
$template_id = $poll_options['template'];
|
3230 |
+
|
3231 |
+
if ( '' == $template_id ) {
|
3232 |
+
$default_template = self::get_default_template();
|
3233 |
+
$template_id = $default_template['id'] ? $default_template['id'] : 0;
|
3234 |
+
}
|
3235 |
+
$template_details = self::get_poll_template_from_database_by_id( $template_id );
|
3236 |
+
$template = $template_details['css'];
|
3237 |
+
$template = str_ireplace( '%POLL-ID%', $poll_id.$unique_id, $template );
|
3238 |
+
if ( 'widget' == $location )
|
3239 |
+
$template = str_ireplace( '%POLL-WIDTH%', $poll_options['widget_template_width'], $template );
|
3240 |
+
else
|
3241 |
+
$template = str_ireplace( '%POLL-WIDTH%', $poll_options['template_width'], $template );
|
3242 |
+
return stripslashes( $template );
|
3243 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3244 |
}
|
3245 |
|
3246 |
+
public function return_poll_js( $attr = array( 'location' => 'page' ) ) {
|
3247 |
+
$poll_id = $this->poll['id'];
|
3248 |
+
$location = isset( $attr['location'] ) ? $attr['location'] : 'page';
|
3249 |
+
$unique_id = $this->unique_id;
|
3250 |
+
|
3251 |
if( ! $poll_id )
|
3252 |
return '';
|
3253 |
+
$poll_details = $this->poll;
|
3254 |
+
$poll_options = $this->poll_options;
|
3255 |
if ( 'widget' == $location )
|
3256 |
+
$template_id = $poll_options['widget_template'];
|
3257 |
+
else
|
3258 |
+
$template_id = $poll_options['template'];
|
3259 |
+
|
3260 |
+
$display_other_answers_values = false;
|
3261 |
+
|
3262 |
if ( isset( $poll_options['display_other_answers_values'] ) ) {
|
3263 |
if ( 'yes' == $poll_options['display_other_answers_values'] )
|
3264 |
+
$display_other_answers_values = true;
|
3265 |
else
|
3266 |
+
$display_other_answers_values = false;
|
3267 |
}
|
3268 |
if ( '' == $template_id ) {
|
3269 |
+
$default_template = self::get_default_template();
|
3270 |
+
$template_id = $default_template['id'] ? $default_template['id'] : 0;
|
3271 |
}
|
3272 |
+
$answers_tabulated_cols = 1;
|
3273 |
+
$results_tabulated_cols = 1;
|
3274 |
+
if ( 'orizontal' == $poll_options['display_answers'] ) {
|
3275 |
+
$ans_no = self::get_count_poll_answers( $poll_id, array( 'default', 'other' ) ) ;
|
3276 |
if( $ans_no > 0 )
|
3277 |
+
$answers_tabulated_cols = $ans_no;
|
3278 |
}
|
3279 |
+
if ( 'orizontal' == $poll_options['display_results'] ) {
|
3280 |
+
$ans_no = self::get_count_poll_answers( $poll_id, array( 'default', 'other' ), $display_other_answers_values ) ;
|
3281 |
if( $ans_no > 0 )
|
3282 |
+
$results_tabulated_cols = $ans_no;
|
3283 |
}
|
3284 |
+
if ( 'tabulated' == $poll_options['display_answers'] )
|
3285 |
+
$answers_tabulated_cols = $poll_options['display_answers_tabulated_cols'];
|
3286 |
+
if ( 'tabulated' == $poll_options['display_results'] )
|
3287 |
+
$results_tabulated_cols = $poll_options['display_results_tabulated_cols'];
|
3288 |
+
|
3289 |
+
$template_details = self::get_poll_template_from_database_by_id( $template_id );
|
3290 |
+
$template = $template_details['js'];
|
3291 |
+
$template = str_ireplace( '%POLL-ID%', $poll_id.$unique_id, $template );
|
3292 |
+
$template = str_ireplace( '%ANSWERS-TABULATED-COLS%', $answers_tabulated_cols, $template );
|
3293 |
+
$template = str_ireplace( '%RESULTS-TABULATED-COLS%', $results_tabulated_cols, $template );
|
3294 |
return stripslashes( $template );
|
3295 |
}
|
3296 |
|
3297 |
+
public function return_template_preview_html( $template_id = '', $loc = 1 ) {
|
3298 |
+
if( '' == $template_id ) {
|
3299 |
+
return "";
|
3300 |
+
}
|
3301 |
+
else {
|
3302 |
+
$template_details = self::get_poll_template_from_database_by_id( $template_id );
|
3303 |
+
$template = $template_details['before_vote_template'];
|
3304 |
+
$template = stripslashes_deep( $template );
|
3305 |
+
|
3306 |
+
$template = str_ireplace( '%POLL-NAME%', "Poll Name", $template );
|
3307 |
+
$template = str_ireplace( '%POLL-QUESTION%', "Poll Question", $template );
|
3308 |
+
$template = str_ireplace( '%POLL-VOTE-BUTTON%', '<button class="yop_poll_vote_button" >Vote</button>', $template );
|
3309 |
+
|
3310 |
+
$t = $template;
|
3311 |
+
$pattern = '/\[(\[?)(ANSWER_CONTAINER)\b([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\[]*+(?:\[(?!\/\2\])[^\[]*+)*+)\[\/\2\])?)(\]?)/';
|
3312 |
+
preg_match($pattern, $template, $m);
|
3313 |
+
$m = $m[0];
|
3314 |
+
$m = str_ireplace('/\[\/?ANSWER_CONTAINER\]/',"", $m);
|
3315 |
+
$answers = array( "Answer 1", "Answer 2", "Answer 3" );
|
3316 |
+
$ts = "";
|
3317 |
+
foreach( $answers as $key => $answer ) {
|
3318 |
+
$temps = str_ireplace( '%POLL-ANSWER-CHECK-INPUT%', '<input type="radio" value="'. $answer .'" name="yop_poll_answer" id="yop-poll-answer-'.$key.'" />', $m );
|
3319 |
+
$temps = str_ireplace( '%POLL-ANSWER-LABEL%', '<label for="yop-poll-answer-'. $key .'">' . $answer . '</label>', $temps );
|
3320 |
+
$ts .= $temps;
|
3321 |
+
}
|
3322 |
+
$template = preg_replace( $pattern, $ts, $template );
|
3323 |
+
$template = preg_replace( '/\[\/?ANSWER_CONTAINER\]/', "", $template );
|
3324 |
+
$pattern = array(
|
3325 |
+
'/\[(\[?)(OTHER_ANSWER_CONTAINER)\b([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\[]*+(?:\[(?!\/\2\])[^\[]*+)*+)\[\/\2\])?)(\]?)/',
|
3326 |
+
'/\[(\[?)(CUSTOM_FIELD_CONTAINER)\b([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\[]*+(?:\[(?!\/\2\])[^\[]*+)*+)\[\/\2\])?)(\]?)/',
|
3327 |
+
'/\[(\[?)(ANSWER_RESULT_CONTAINER)\b([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\[]*+(?:\[(?!\/\2\])[^\[]*+)*+)\[\/\2\])?)(\]?)/',
|
3328 |
+
'/\[(\[?)(CAPTCHA_CONTAINER)\b([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\[]*+(?:\[(?!\/\2\])[^\[]*+)*+)\[\/\2\])?)(\]?)/'
|
3329 |
+
);
|
3330 |
+
$template = preg_replace($pattern, "", $template);
|
3331 |
+
$template = str_ireplace( "%POLL-ID%", "preview-" . $loc, $template );
|
3332 |
+
$template = self::strip_all_tags( $template );
|
3333 |
+
|
3334 |
+
$t = '<style type="text/css">' . self::return_poll_css( array( "location" => 'page', 'preview' => true, 'template_id' => $template_id, 'loc' => $loc ) ) . '</style>';
|
3335 |
+
$t .= '<div id="yop-poll-container-preview-'. $loc .'" class="yop-poll-container">';
|
3336 |
+
$t .= '<form id="yop-poll-form-preview-'. $loc .'" class="yop-poll-forms">'.$template.
|
3337 |
+
'</form></div>';
|
3338 |
+
return $t;
|
3339 |
+
}
|
3340 |
+
}
|
3341 |
|
3342 |
+
public function return_poll_html( $attr = array( 'tr_id' => '', 'location' => 'page', 'load_css' => false, 'load_js' => false ) ) {
|
3343 |
+
$tr_id = isset( $attr['tr_id'] ) ? $attr['tr_id'] : '';
|
3344 |
+
$location = isset( $attr['location'] ) ? $attr['location'] : 'page';
|
3345 |
+
$unique_id = $this->unique_id;
|
3346 |
+
$load_css = isset( $attr['load_css'] ) ? $attr['load_css'] : false;
|
3347 |
+
//$load_js = isset( $attr['load_js'] ) ? $attr['load_js'] : false;
|
3348 |
|
3349 |
+
$poll_id = $this->poll['id'];
|
3350 |
if ( ! $poll_id )
|
3351 |
return '';
|
3352 |
+
$poll_details = $this->poll;
|
3353 |
+
$poll_options = $this->poll_options;
|
3354 |
|
3355 |
if ( function_exists( 'icl_translate' ) ) {
|
3356 |
$poll_details['question'] = icl_translate( 'yop_poll', $poll_details['id'] .'_question', $poll_details['question'] );
|
3357 |
$poll_details['name'] = icl_translate( 'yop_poll', $poll_details['id'] .'_poll_title', $poll_details['name'] );
|
3358 |
|
3359 |
//$poll_options['other_answers_label'] = icl_translate( 'yop_poll', $poll_details['id'] .'_other_answers_label', $poll_options['other_answers_label'] );
|
3360 |
+
$poll_options['singular_answer_result_votes_number_label'] = icl_translate( 'yop_poll', $poll_options['id'] .'_singular_answer_result_votes_number_label', $poll_options['singular_answer_result_votes_number_label'] );
|
3361 |
+
$poll_options['plural_answer_result_votes_number_label'] = icl_translate( 'yop_poll', $poll_options['id'] .'_plural_answer_result_votes_number_label', $poll_options['plural_answer_result_votes_number_label'] );
|
3362 |
+
$poll_options['vote_button_label'] = icl_translate( 'yop_poll', $poll_details['id'] .'_vote_button_label', $poll_options['vote_button_label'] );
|
3363 |
+
$poll_options['view_results_link_label'] = icl_translate( 'yop_poll', $poll_details['id'] .'_view_results_link_label', $poll_options['view_results_link_label'] );
|
3364 |
+
$poll_options['view_back_to_vote_link_label'] = icl_translate( 'yop_poll', $poll_details['id'] .'_view_back_to_vote_link_label', $poll_options['view_back_to_vote_link_label'] );
|
3365 |
+
$poll_options['view_total_votes_label'] = icl_translate( 'yop_poll', $poll_details['id'] .'_view_total_votes_label', $poll_options['view_total_votes_label'] );
|
3366 |
+
$poll_options['view_total_answers_label'] = icl_translate( 'yop_poll', $poll_details['id'] .'_view_total_answers_label', $poll_options['view_total_answers_label'] );
|
3367 |
+
$poll_options['view_total_voters_label'] = icl_translate( 'yop_poll', $poll_details['id'] .'_view_total_voters_label', $poll_options['view_total_voters_label'] );
|
3368 |
+
$poll_options['view_poll_archive_link_label'] = icl_translate( 'yop_poll', $poll_details['id'] .'_view_poll_archive_link_label', $poll_options['view_poll_archive_link_label'] );
|
3369 |
+
$poll_options['answer_result_label'] = icl_translate( 'yop_poll', $poll_details['id'] .'_answer_result_label', $poll_options['answer_result_label'] );
|
3370 |
+
$poll_options['vote_permisions_facebook_label'] = icl_translate( 'yop_poll', $poll_details['id'] .'_vote_permisions_facebook_label', $poll_options['vote_permisions_facebook_label'] );
|
3371 |
+
$poll_options['vote_permisions_wordpress_label'] = icl_translate( 'yop_poll', $poll_details['id'] .'_vote_permisions_wordpress_label', $poll_options['vote_permisions_wordpress_label'] );
|
3372 |
+
$poll_options['vote_permisions_anonymous_label'] = icl_translate( 'yop_poll', $poll_details['id'] .'_vote_permisions_anonymous_label', $poll_options['vote_permisions_anonymous_label'] );
|
3373 |
}
|
3374 |
|
3375 |
if ( 'widget' == $location )
|
3376 |
+
$template_id = $poll_options['widget_template'];
|
3377 |
else
|
3378 |
+
$template_id = $poll_options['template'];
|
3379 |
if ( '' == $template_id ) {
|
3380 |
+
$default_template = self::get_default_template();
|
3381 |
+
$template_id = $default_template['id'] ? $default_template['id'] : 0;
|
3382 |
}
|
3383 |
+
|
3384 |
+
$template_details = self::get_poll_template_from_database_by_id( $template_id );
|
3385 |
+
$is_voted = $this->is_voted();
|
3386 |
+
$current_date = self::get_mysql_curent_date();
|
3387 |
|
3388 |
if( $current_date >= $poll_details['start_date']) {
|
3389 |
if( $current_date <= $poll_details['end_date'] ) {
|
3390 |
if ( ! $is_voted ) {
|
3391 |
+
$template = $template_details['before_vote_template'];
|
3392 |
if ( 'before' == $poll_options['view_results'] )
|
3393 |
if ( $this->is_view_poll_results() )
|
3394 |
+
$template = str_ireplace( '%POLL-ANSWER-RESULT-LABEL%', $poll_options['answer_result_label'], $template );
|
3395 |
+
$template = str_ireplace( '%POLL-VOTE-BUTTON%', '<button class="yop_poll_vote_button" id="yop_poll_vote-button-'.$poll_id.$unique_id.'" onclick="yop_poll_register_vote(\''.$poll_id.'\', \''.$location.'\', \''.$unique_id.'\'); return false;">'.$poll_options['vote_button_label'].'</button>', $template );
|
3396 |
}
|
3397 |
else {
|
3398 |
+
$template = $template_details['after_vote_template'];
|
3399 |
if ( 'after' == $poll_options['view_results'] || 'before' == $poll_options['view_results'] )
|
3400 |
if ( $this->is_view_poll_results() )
|
3401 |
+
$template = str_ireplace( '%POLL-ANSWER-RESULT-LABEL%', $poll_options['answer_result_label'], $template );
|
3402 |
|
3403 |
if( 'yes' == $poll_options['view_back_to_vote_link'] ) {
|
3404 |
+
$vote = $this->vote;
|
3405 |
+
$this->vote = false;
|
3406 |
if ( ! $this->is_voted() ) {
|
3407 |
+
$template = str_ireplace( '%POLL-BACK-TO-VOTE-LINK%', '<a href="javascript:void(0)" class="yop_poll_back_to_vote_link" id="yop_poll_back_to_vote_link'.$poll_id.$unique_id.'" onClick="yop_poll_back_to_vote(\''.$poll_id.'\', \''.$location.'\', \''.$unique_id.'\')">'.$poll_options['view_back_to_vote_link_label'].'</a>', $template );
|
3408 |
}
|
3409 |
+
$this->vote = $vote;
|
3410 |
}
|
3411 |
}
|
3412 |
}
|
3413 |
else {
|
3414 |
+
$template = $template_details['after_end_date_template'];
|
3415 |
if ( 'after-poll-end-date' == $poll_options['view_results'] || 'before' == $poll_options['view_results'] || 'after' == $poll_options['view_results'] ) {
|
3416 |
if ( $this->is_view_poll_results() ){
|
3417 |
+
$template = str_ireplace( '%POLL-ANSWER-RESULT-LABEL%', $poll_options['answer_result_label'], $template );
|
3418 |
}
|
3419 |
}
|
3420 |
}
|
3421 |
}
|
3422 |
else {
|
3423 |
+
$template = $template_details['before_start_date_template'];
|
3424 |
if ( 'before' == $poll_options['view_results'] )
|
3425 |
if ( $this->is_view_poll_results() )
|
3426 |
+
$template = str_ireplace( '%POLL-ANSWER-RESULT-LABEL%', $poll_options['answer_result_label'], $template );
|
3427 |
}
|
3428 |
|
3429 |
if ( 'custom-date' == $poll_options['view_results'] ) {
|
3430 |
if ( $current_date >= $poll_options['view_results_start_date'] )
|
3431 |
if ( $this->is_view_poll_results() )
|
3432 |
+
$template = str_ireplace( '%POLL-ANSWER-RESULT-LABEL%', $poll_options['answer_result_label'], $template );
|
3433 |
}
|
3434 |
+
|
3435 |
+
$template = stripslashes_deep( $template );
|
3436 |
+
$template = str_ireplace( '%POLL-ID%', $poll_id.$unique_id, $template );
|
3437 |
+
|
3438 |
+
|
3439 |
if ( 'yes' == $poll_options['poll_name_html_tags'] )
|
3440 |
+
$template = str_ireplace( '%POLL-NAME%', stripslashes( $poll_details['name'] ), $template );
|
3441 |
else
|
3442 |
+
$template = str_ireplace( '%POLL-NAME%', esc_html( stripslashes( $poll_details['name'] ) ), $template );
|
3443 |
+
|
3444 |
+
$template = str_ireplace( '%POLL-START-DATE%', esc_html( stripslashes( self::convert_date( $poll_details['start_date'], $poll_options['date_format'] ) ) ), $template );
|
3445 |
+
$template = str_ireplace( '%POLL-PAGE-URL%', esc_html( stripslashes( $poll_options['poll_page_url'] ) ), $template );
|
3446 |
if ( '9999-12-31 23:59:59' == $poll_details['end_date'] )
|
3447 |
+
$template = str_ireplace( '%POLL-END-DATE%', __('Never Expire', 'yop_poll'), $template );
|
3448 |
else
|
3449 |
+
$template = str_ireplace( '%POLL-END-DATE%', esc_html( stripslashes( self::convert_date( $poll_details['end_date'], $poll_options['date_format'] ) ) ), $template );
|
3450 |
+
|
3451 |
if ( 'yes' == $poll_options['poll_question_html_tags'] )
|
3452 |
+
$template = str_ireplace( '%POLL-QUESTION%', esc_html(stripslashes( $poll_details['question']) ), $template );
|
3453 |
else
|
3454 |
+
$template = str_ireplace( '%POLL-QUESTION%', esc_html( stripslashes( $poll_details['question'] ) ), $template );
|
3455 |
|
3456 |
if( 'yes' == $poll_options['view_results_link'] ) {
|
3457 |
+
$template = str_ireplace( '%POLL-VIEW-RESULT-LINK%', '<a href="javascript:void(0)" class="yop_poll_result_link" id="yop_poll_result_link'.$poll_id.$unique_id.'" onClick="yop_poll_view_results(\''.$poll_id.'\', \''.$location.'\', \''.$unique_id.'\')">'.$poll_options['view_results_link_label'].'</a>', $template );
|
3458 |
}
|
3459 |
|
3460 |
if( 'yes' == $poll_options['view_poll_archive_link'] ) {
|
3461 |
+
$template = str_ireplace( '%POLL-VIEW-ARCHIVE-LINK%', '<a href="'.$poll_options['poll_archive_url'].'" class="yop_poll_archive_link" id="yop_poll_archive_link_'.$poll_id.$unique_id.'" >'.$poll_options['view_poll_archive_link_label'].'</a>', $template );
|
3462 |
}
|
3463 |
if( 'yes' == $poll_options['view_total_answers'] ) {
|
3464 |
+
$template = str_ireplace( '%POLL-TOTAL-ANSWERS%', $poll_options['view_total_answers_label'], $template );
|
3465 |
+
$template = str_ireplace( '%POLL-TOTAL-ANSWERS%', $poll_details['total_answers'], $template );
|
3466 |
}
|
3467 |
if( 'yes' == $poll_options['view_total_votes'] ) {
|
3468 |
+
$template = str_ireplace( '%POLL-TOTAL-VOTES%', $poll_options['view_total_votes_label'], $template );
|
3469 |
+
$template = str_ireplace( '%POLL-TOTAL-VOTES%', $poll_details['total_votes'], $template );
|
3470 |
+
}
|
3471 |
+
|
3472 |
+
$msgDivS = false;
|
3473 |
+
$msgDivE = false;
|
3474 |
+
|
3475 |
+
if( strpos( $template, "%POLL-SUCCESS-MSG%" ) != false ) {
|
3476 |
+
$msgDivS = true;
|
3477 |
+
$template = str_ireplace( '%POLL-SUCCESS-MSG%', '<div id="yop-poll-container-success-'.$poll_id.$unique_id. '" class="yop-poll-container-success"></div>', $template );
|
3478 |
+
}
|
3479 |
+
if( strpos( $template, "%POLL-ERROR-MSG%" ) != false ) {
|
3480 |
+
$msgDivE = true;
|
3481 |
+
$template = str_ireplace( '%POLL-ERROR-MSG%', '<div id="yop-poll-container-error-'.$poll_id.$unique_id. '" class="yop-poll-container-error"></div>', $template );
|
3482 |
+
}
|
3483 |
+
|
3484 |
+
$pattern = '\[(\[?)(ANSWER_CONTAINER)\b([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\[]*+(?:\[(?!\/\2\])[^\[]*+)*+)\[\/\2\])?)(\]?)';
|
3485 |
+
$template = preg_replace_callback( "/$pattern/s", array(&$this,'answer_replace_callback'), $template );
|
3486 |
+
$pattern = '\[(\[?)(OTHER_ANSWER_CONTAINER)\b([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\[]*+(?:\[(?!\/\2\])[^\[]*+)*+)\[\/\2\])?)(\]?)';
|
3487 |
+
$template = preg_replace_callback( "/$pattern/s", array(&$this,'other_answer_replace_callback'), $template );
|
3488 |
+
$pattern = '\[(\[?)(CUSTOM_FIELD_CONTAINER)\b([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\[]*+(?:\[(?!\/\2\])[^\[]*+)*+)\[\/\2\])?)(\]?)';
|
3489 |
+
$template = preg_replace_callback( "/$pattern/s", array(&$this,'customfield_replace_callback'), $template );
|
3490 |
+
$pattern = '\[(\[?)(ANSWER_RESULT_CONTAINER)\b([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\[]*+(?:\[(?!\/\2\])[^\[]*+)*+)\[\/\2\])?)(\]?)';
|
3491 |
+
$template = preg_replace_callback( "/$pattern/s", array(&$this,'answer_result_replace_callback'), $template );
|
3492 |
+
$pattern = '\[(\[?)(CAPTCHA_CONTAINER)\b([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\[]*+(?:\[(?!\/\2\])[^\[]*+)*+)\[\/\2\])?)(\]?)';
|
3493 |
+
$template = preg_replace_callback( "/$pattern/s", array(&$this,'captcha_replace_callback'), $template );
|
3494 |
+
|
3495 |
+
$temp = self::strip_all_tags( $template );
|
3496 |
+
$template = "";
|
3497 |
+
|
3498 |
+
if( $load_css ) {
|
3499 |
+
$template .= '<style type="text/css">' . self::return_poll_css( array( "location" => $location ) ) . '</style>';
|
3500 |
+
}
|
3501 |
+
|
3502 |
+
$template .= '<div id="yop-poll-container-'.$poll_id.$unique_id.
|
3503 |
+
'" class="yop-poll-container">';
|
3504 |
+
if( !$msgDivS ) {
|
3505 |
+
$template .= '<div id="yop-poll-container-success-'.$poll_id.$unique_id. '" class="yop-poll-container-success"></div>';
|
3506 |
+
}
|
3507 |
+
if( !$msgDivE ) {
|
3508 |
+
$template .= '<div id="yop-poll-container-error-'.$poll_id.$unique_id. '" class="yop-poll-container-error"></div>';
|
3509 |
}
|
3510 |
+
|
3511 |
+
$template .= '<form id="yop-poll-form-'.$poll_id.$unique_id.
|
3512 |
+
'" class="yop-poll-forms">'.$temp.
|
3513 |
+
'<input type="hidden" id="yop-poll-tr-id-'.$poll_id.$unique_id.
|
3514 |
+
'" name="yop_poll_tr_id" value="'.$tr_id.'"/>'.
|
3515 |
+
wp_nonce_field( 'yop_poll-'.$poll_id.$unique_id.'-user-actions', 'yop-poll-nonce-'.$poll_id.$unique_id, false, false ).
|
3516 |
+
'</form></div>';
|
|
|
|
|
|
|
|
|
|
|
3517 |
return $template;
|
3518 |
}
|
3519 |
|
3520 |
private function is_view_poll_results() {
|
3521 |
+
$poll_id = $this->poll['id'];
|
3522 |
+
$unique_id = $this->unique_id;
|
3523 |
+
$poll_options = $this->poll_options;
|
3524 |
+
$is_voted = $this->is_voted();
|
3525 |
|
3526 |
if (
|
3527 |
(
|
3537 |
)
|
3538 |
) {
|
3539 |
return true;
|
3540 |
+
}
|
3541 |
return false;
|
3542 |
}
|
3543 |
|
3544 |
public function answer_result_replace_callback( $m ) {
|
3545 |
+
$poll_id = $this->poll['id'];
|
3546 |
+
$unique_id = $this->unique_id;
|
3547 |
+
$poll_options = $this->poll_options;
|
3548 |
+
$return_string = '';
|
3549 |
+
$is_voted = $this->is_voted();
|
3550 |
if ( $this->is_view_poll_results() ) {
|
3551 |
+
$display_other_answers_values = false;
|
3552 |
if ( 'yes' == $poll_options['display_other_answers_values'] )
|
3553 |
+
$display_other_answers_values = true;
|
3554 |
else
|
3555 |
+
$display_other_answers_values = false;
|
3556 |
+
$answers_types = array('default', 'other');
|
3557 |
if ( 'yes' == $poll_options['add_other_answers_to_default_answers'] )
|
3558 |
+
$answers_types = array( 'default' );
|
3559 |
|
3560 |
+
$percentages_decimals = 0;
|
3561 |
if ( isset( $poll_options['percentages_decimals'] ) )
|
3562 |
+
$percentages_decimals = $poll_options['percentages_decimals'];
|
3563 |
if( isset( $poll_options['sorting_results'] ) ) {
|
3564 |
if( 'exact' == $poll_options['sorting_results'] ) {
|
3565 |
$order_dir = 'asc';
|
3566 |
if( isset( $poll_options['sorting_results_direction'] ) )
|
3567 |
$order_dir = ('asc' == $poll_options['sorting_results_direction']) ? 'asc' : 'desc';
|
3568 |
+
$answers = self::get_poll_answers( $poll_id, $answers_types, 'id', $order_dir, $display_other_answers_values, $percentages_decimals );
|
3569 |
}
|
3570 |
elseif( 'alphabetical' == $poll_options['sorting_results'] ) {
|
3571 |
$order_dir = 'asc';
|
3572 |
if( isset( $poll_options['sorting_results_direction'] ) )
|
3573 |
$order_dir = ('asc' == $poll_options['sorting_results_direction']) ? 'asc' : 'desc';
|
3574 |
+
$answers = self::get_poll_answers( $poll_id, $answers_types, 'answer', $order_dir, $display_other_answers_values, $percentages_decimals );
|
3575 |
}
|
3576 |
elseif( 'random' == $poll_options['sorting_results'] ) {
|
3577 |
+
$answers = self::get_poll_answers( $poll_id,$answers_types, 'rand()', '', $display_other_answers_values, $percentages_decimals );
|
3578 |
}
|
3579 |
elseif( 'votes' == $poll_options['sorting_results'] ) {
|
3580 |
$order_dir = 'asc';
|
3581 |
if( isset( $poll_options['sorting_results_direction'] ) )
|
3582 |
$order_dir = ('asc' == $poll_options['sorting_results_direction']) ? 'asc' : 'desc';
|
3583 |
+
$answers = self::get_poll_answers( $poll_id, $answers_types, 'votes', $order_dir, $display_other_answers_values, $percentages_decimals );
|
3584 |
}
|
3585 |
else {
|
3586 |
$order_dir = 'asc';
|
3587 |
if( isset( $poll_options['sorting_results_direction'] ) )
|
3588 |
$order_dir = ('asc' == $poll_options['sorting_results_direction']) ? 'asc' : 'desc';
|
3589 |
+
$answers = self::get_poll_answers( $poll_id, $answers_types, 'id', $order_dir, $display_other_answers_values, $percentages_decimals );
|
3590 |
}
|
3591 |
}
|
3592 |
else {
|
3593 |
$order_dir = 'asc';
|
3594 |
if( isset( $poll_options['sorting_results_direction'] ) )
|
3595 |
$order_dir = ('asc' == $poll_options['sorting_results_direction']) ? 'asc' : 'desc';
|
3596 |
+
$answers = self::get_poll_answers( $poll_id, $answers_types, 'id', $order_dir, $display_other_answers_values, $percentages_decimals );
|
3597 |
}
|
3598 |
if( count( $answers ) > 0 ) {
|
3599 |
foreach( $answers as $answer ) {
|
3613 |
}
|
3614 |
}
|
3615 |
}
|
3616 |
+
$temp_string = str_ireplace( '%POLL-ANSWER-RESULT-VOTES%', self::display_poll_result_votes( $answer, $poll_options ), $m[5] );
|
3617 |
+
$temp_string = str_ireplace( '%POLL-ANSWER-RESULT-PERCENTAGES%', self::display_poll_result_percentages( $answer, $poll_options ), $temp_string );
|
3618 |
if ( 'yes' == $poll_options['poll_answer_html_tags'] )
|
3619 |
+
$temp_string = str_ireplace( '%POLL-ANSWER-LABEL%', strip_tags(stripslashes( $answer['answer'] ), '<a><img>'), $temp_string );
|
3620 |
else
|
3621 |
+
$temp_string = str_ireplace( '%POLL-ANSWER-LABEL%', strip_tags(esc_html( stripslashes( $answer['answer'] )), '<a><img>' ), $temp_string );
|
3622 |
+
$temp_string = str_ireplace( '%POLL-ANSWER-RESULT-BAR%', self::display_poll_result_bar( $poll_id, $answer['id'], $answer['procentes'], $poll_options, $unique_id ), $temp_string );
|
3623 |
+
$return_string .= $temp_string;
|
3624 |
}
|
3625 |
}
|
3626 |
}
|
3629 |
}
|
3630 |
|
3631 |
public function customfield_replace_callback( $m ) {
|
3632 |
+
$poll_id = $this->poll['id'];
|
3633 |
+
$poll_options = $this->poll_options;
|
3634 |
+
$return_string = '';
|
3635 |
+
$is_voted = $this->is_voted();
|
3636 |
if( ! $is_voted ) {
|
3637 |
+
$custom_fields = self::get_poll_customfields( $poll_id );
|
3638 |
if( count( $custom_fields ) > 0 ) {
|
3639 |
foreach ($custom_fields as $custom_field) {
|
3640 |
if ( function_exists( 'icl_translate' ) ) {
|
3641 |
$custom_field['custom_field'] = icl_translate( 'yop_poll', $custom_field['id'] .'_custom_field', $custom_field['custom_field'] );
|
3642 |
}
|
3643 |
if ( 'yes' == $poll_options['poll_custom_field_html_tags'] )
|
3644 |
+
$temp_string = str_ireplace( '%POLL-CUSTOM-FIELD-LABEL%', '<label for="yop-poll-customfield-'.$custom_field['id'].'">'. strip_tags(stripslashes( $custom_field['custom_field'] )).'</label>', $m[5] );
|
3645 |
else
|
3646 |
+
$temp_string = str_ireplace( '%POLL-CUSTOM-FIELD-LABEL%', '<label for="yop-poll-customfield-'.$custom_field['id'].'">'.strip_tags(esc_html( stripslashes( $custom_field['custom_field'] ) ) ).'</label>', $m[5] );
|
3647 |
+
$temp_string = str_ireplace( '%POLL-CUSTOM-FIELD-TEXT-INPUT%', '<input type="text" value="" name="yop_poll_customfield['.$custom_field['id'].']" id="yop-poll-customfield-'.$custom_field['id'].'" />', $temp_string );
|
3648 |
+
$return_string .= $temp_string;
|
3649 |
}
|
3650 |
}
|
3651 |
}
|
3653 |
}
|
3654 |
|
3655 |
public function other_answer_replace_callback( $m ) {
|
3656 |
+
$poll_id = $this->poll['id'];
|
3657 |
+
$unique_id = $this->unique_id;
|
3658 |
+
$poll_options = $this->poll_options;
|
3659 |
+
$return_string = '';
|
3660 |
+
$is_voted = $this->is_voted();
|
3661 |
+
$percentages_decimals = 0;
|
3662 |
if ( isset( $poll_options['percentages_decimals'] ) )
|
3663 |
+
$percentages_decimals = $poll_options['percentages_decimals'];
|
3664 |
if( ! $is_voted ) {
|
3665 |
$multiple_answers = false;
|
3666 |
if( isset( $poll_options['allow_multiple_answers'] ) )
|
3672 |
$other_answer = self::get_poll_answers( $poll_id, array( 'other') );
|
3673 |
if( ! $other_answer ) {
|
3674 |
$answer = array(
|
3675 |
+
'id' => NULL,
|
3676 |
+
'poll_id' => $poll_id,
|
3677 |
+
'answer' => isset( $poll_options['other_answers_label'] ) ? strip_tags($poll_options['other_answers_label'], '<a><img>') : __( 'Other', 'yop_poll'),
|
3678 |
+
'votes' => 0,
|
3679 |
+
'status' => 'active',
|
3680 |
+
'type' => 'other'
|
3681 |
);
|
3682 |
+
$other_answer_id = self::insert_answer_to_database( $answer );
|
3683 |
}
|
3684 |
$other_answer = self::get_poll_answers( $poll_id, array( 'other'), 'id', '', false, $percentages_decimals );
|
3685 |
|
3686 |
if ( function_exists( 'icl_translate' ) ) {
|
3687 |
+
$other_answer_label = icl_translate( 'yop_poll', $poll_id .'_other_answer_label', strip_tags( stripslashes( $other_answer[0]['answer'] ) ), '<a><img>' );
|
3688 |
} else {
|
3689 |
+
$other_answer_label = strip_tags( stripslashes( $other_answer[0]['answer'] ), '<a><img>' );
|
3690 |
}
|
3691 |
|
3692 |
if( $multiple_answers ) {
|
3693 |
if ( isset( $poll_options['is_default_answer'] ) && 'yes' == $poll_options['is_default_answer'] )
|
3694 |
+
$temp_string = str_ireplace( '%POLL-OTHER-ANSWER-CHECK-INPUT%', '<input checked="checked" type="checkbox" value="'.$other_answer[0]['id'].'" name="yop_poll_answer['.$other_answer[0]['id'].']" id="yop-poll-answer-'. $poll_id . $unique_id .'-'.$other_answer[0]['id'].$unique_id.'" />', $m[5] );
|
3695 |
else
|
3696 |
+
$temp_string = str_ireplace( '%POLL-OTHER-ANSWER-CHECK-INPUT%', '<input type="checkbox" value="'.$other_answer[0]['id'].'" name="yop_poll_answer['.$other_answer[0]['id'].']" id="yop-poll-answer-'. $poll_id . $unique_id .'-'.$other_answer[0]['id'].$unique_id.'" />', $m[5] );
|
3697 |
}
|
3698 |
else {
|
3699 |
if ( isset( $poll_options['is_default_answer'] ) && 'yes' == $poll_options['is_default_answer'] )
|
3700 |
+
$temp_string = str_ireplace( '%POLL-OTHER-ANSWER-CHECK-INPUT%', '<input checked="checked" type="radio" value="'.$other_answer[0]['id'].'" name="yop_poll_answer" id="yop-poll-answer-'.$other_answer[0]['id'].$unique_id.'" />', $m[5] );
|
3701 |
else
|
3702 |
+
$temp_string = str_ireplace( '%POLL-OTHER-ANSWER-CHECK-INPUT%', '<input type="radio" value="'.$other_answer[0]['id'].'" name="yop_poll_answer" id="yop-poll-answer-'.$other_answer[0]['id'].$unique_id.'" />', $m[5] );
|
3703 |
}
|
3704 |
if ( 'yes' == $poll_options['poll_answer_html_tags'] )
|
3705 |
+
$temp_string = str_ireplace( '%POLL-OTHER-ANSWER-LABEL%', '<label for="yop-poll-answer-'.$other_answer[0]['id'].$unique_id.'">'.stripslashes( $other_answer_label ).'</label>', $temp_string );
|
3706 |
else
|
3707 |
+
$temp_string = str_ireplace( '%POLL-OTHER-ANSWER-LABEL%', '<label for="yop-poll-answer-'.$other_answer[0]['id'].$unique_id.'">'.esc_html( stripslashes( $other_answer_label ) ).'</label>', $temp_string );
|
3708 |
+
$temp_string = str_ireplace( '%POLL-OTHER-ANSWER-TEXT-INPUT%', '<label><input onclick="document.getElementById(\'yop-poll-answer-'.$other_answer[0]['id'].$unique_id.'\').checked=true;" type="text" value="" name="yop_poll_other_answer" id="yop-poll-other-answer-'. $poll_id . $unique_id .'-'.$other_answer[0]['id'].'" /></label>', $temp_string );
|
3709 |
if ( $this->is_view_poll_results() ) {
|
3710 |
+
$temp_string = str_ireplace( '%POLL-ANSWER-RESULT-BAR%', self::display_poll_result_bar( $poll_id, $other_answer[0]['id'], $other_answer[0]['procentes'], $poll_options, $unique_id ), $temp_string );
|
3711 |
+
$temp_string = str_ireplace( '%POLL-OTHER-ANSWER-RESULT-BAR%', self::display_poll_result_bar( $poll_id, $other_answer[0]['id'], $other_answer[0]['procentes'], $poll_options, $unique_id ), $temp_string );
|
3712 |
+
$temp_string = str_ireplace( '%POLL-ANSWER-RESULT-VOTES%', self::display_poll_result_votes( $other_answer[0], $poll_options ), $temp_string );
|
3713 |
+
$temp_string = str_ireplace( '%POLL-OTHER-ANSWER-RESULT-VOTES%', self::display_poll_result_votes( $other_answer[0], $poll_options ), $temp_string );
|
3714 |
+
$temp_string = str_ireplace( '%POLL-ANSWER-RESULT-PERCENTAGES%', self::display_poll_result_percentages( $other_answer[0], $poll_options ), $temp_string );
|
3715 |
+
$temp_string = str_ireplace( '%POLL-OTHER-ANSWER-RESULT-PERCENTAGES%', self::display_poll_result_percentages( $other_answer[0], $poll_options ), $temp_string );
|
3716 |
}
|
3717 |
+
$return_string .= $temp_string;
|
3718 |
}
|
3719 |
}
|
3720 |
}
|
3722 |
}
|
3723 |
|
3724 |
public function answer_replace_callback( $m ) {
|
3725 |
+
$poll_id = $this->poll['id'];
|
3726 |
+
$unique_id = $this->unique_id;
|
3727 |
+
$poll_options = $this->poll_options;
|
3728 |
+
$return_string = '';
|
3729 |
+
$is_voted = $this->is_voted();
|
3730 |
+
$percentages_decimals = 0;
|
3731 |
if ( isset( $poll_options['percentages_decimals'] ) )
|
3732 |
+
$percentages_decimals = $poll_options['percentages_decimals'];
|
3733 |
if( ! $is_voted ) {
|
3734 |
if( isset( $poll_options['sorting_answers'] ) ) {
|
3735 |
if( 'exact' == $poll_options['sorting_answers'] ) {
|
3736 |
$order_dir = 'asc';
|
3737 |
if( isset( $poll_options['sorting_answers_direction'] ) )
|
3738 |
$order_dir = ('asc' == $poll_options['sorting_answers_direction']) ? 'asc' : 'desc';
|
3739 |
+
$answers = self::get_poll_answers( $poll_id, array( 'default'), 'id', $order_dir, false, $percentages_decimals );
|
3740 |
}
|
3741 |
elseif( 'alphabetical' == $poll_options['sorting_answers'] ) {
|
3742 |
$order_dir = 'asc';
|
3743 |
if( isset( $poll_options['sorting_answers_direction'] ) )
|
3744 |
$order_dir = ('asc' == $poll_options['sorting_answers_direction']) ? 'asc' : 'desc';
|
3745 |
+
$answers = self::get_poll_answers( $poll_id, array('default'), 'answer', $order_dir, false, $percentages_decimals );
|
3746 |
}
|
3747 |
elseif( 'random' == $poll_options['sorting_answers'] ) {
|
3748 |
+
$answers = self::get_poll_answers( $poll_id, array('default'), 'rand()', '', false, $percentages_decimals );
|
3749 |
}
|
3750 |
elseif( 'votes' == $poll_options['sorting_answers'] ) {
|
3751 |
$order_dir = 'asc';
|
3752 |
if( isset( $poll_options['sorting_answers_direction'] ) )
|
3753 |
$order_dir = ('asc' == $poll_options['sorting_answers_direction']) ? 'asc' : 'desc';
|
3754 |
+
$answers = self::get_poll_answers( $poll_id, array('default'), 'votes', $order_dir, '', $percentages_decimals );
|
3755 |
}
|
3756 |
else {
|
3757 |
$order_dir = 'asc';
|
3758 |
if( isset( $poll_options['sorting_answers_direction'] ) )
|
3759 |
$order_dir = ('asc' == $poll_options['sorting_answers_direction']) ? 'asc' : 'desc';
|
3760 |
+
$answers = self::get_poll_answers( $poll_id, array( 'default'), 'id', $order_dir, false, $percentages_decimals );
|
3761 |
}
|
3762 |
}
|
3763 |
else {
|
3764 |
$order_dir = 'asc';
|
3765 |
if( isset( $poll_options['sorting_answers_direction'] ) )
|
3766 |
$order_dir = ('asc' == $poll_options['sorting_answers_direction']) ? 'asc' : 'desc';
|
3767 |
+
$answers = self::get_poll_answers( $poll_id, array( 'default'), 'id', $order_dir, false, $percentages_decimals );
|
3768 |
}
|
3769 |
+
$multiple_answers = false;
|
3770 |
+
$answers_in_select_input = false;
|
3771 |
if( isset( $poll_options['allow_multiple_answers'] ) )
|
3772 |
if ( 'yes' == $poll_options['allow_multiple_answers'] )
|
3773 |
$multiple_answers = true;
|
3792 |
else {
|
3793 |
$answer_options = array();
|
3794 |
foreach ( $poll_options as $option_name => $option_value ) {
|
3795 |
+
$answer_options[ $option_name ] = $option_value;
|
3796 |
+
}
|
3797 |
}
|
3798 |
|
3799 |
if ( function_exists( 'icl_translate' ) ) {
|
3802 |
|
3803 |
if ( $multiple_answers ) {
|
3804 |
if ( isset( $answer_options['is_default_answer'] ) && 'yes' == $answer_options['is_default_answer'] )
|
3805 |
+
$temp_string = str_ireplace( '%POLL-ANSWER-CHECK-INPUT%', '<input type="checkbox" checked="checked" value="'.$answer['id'].'" name="yop_poll_answer['.$answer['id'].']" id="yop-poll-answer-'. $poll_id . $unique_id .'-'.$answer['id'].'" />', $m[5] );
|
3806 |
else
|
3807 |
+
$temp_string = str_ireplace( '%POLL-ANSWER-CHECK-INPUT%', '<input type="checkbox" value="'.$answer['id'].'" name="yop_poll_answer['.$answer['id'].']" id="yop-poll-answer-'. $poll_id . $unique_id .'-'.$answer['id'].'" />', $m[5] );
|
3808 |
}
|
3809 |
else {
|
3810 |
if ( isset( $answer_options['is_default_answer'] ) && 'yes' == $answer_options['is_default_answer'] )
|
3811 |
+
$temp_string = str_ireplace( '%POLL-ANSWER-CHECK-INPUT%', '<input type="radio" checked="checked" value="'.$answer['id'].'" name="yop_poll_answer" id="yop-poll-answer-'. $poll_id . $unique_id .'-'.$answer['id'].'" />', $m[5] );
|
3812 |
else
|
3813 |
+
$temp_string = str_ireplace( '%POLL-ANSWER-CHECK-INPUT%', '<input type="radio" value="'.$answer['id'].'" name="yop_poll_answer" id="yop-poll-answer-'. $poll_id . $unique_id .'-'.$answer['id'].'" />', $m[5] );
|
3814 |
}
|
3815 |
if ( 'yes' == $poll_options['poll_answer_html_tags'] )
|
3816 |
+
$temp_string = str_ireplace( '%POLL-ANSWER-LABEL%', '<label for="yop-poll-answer-'. $poll_id . $unique_id .'-'.$answer['id'].'">'.strip_tags(stripslashes( $answer['answer'] ), '<a><img>' ).'</label>', $temp_string );
|
3817 |
else
|
3818 |
+
$temp_string = str_ireplace( '%POLL-ANSWER-LABEL%', '<label for="yop-poll-answer-'. $poll_id . $unique_id .'-'.$answer['id'].'">'.strip_tags( stripslashes( $answer['answer'] ), '<a><img>' ).'</label>', $temp_string );
|
3819 |
if ( $this->is_view_poll_results() ) {
|
3820 |
+
$temp_string = str_ireplace( '%POLL-ANSWER-RESULT-BAR%', self::display_poll_result_bar( $poll_id, $answer['id'], $answer['procentes'], $poll_options, $unique_id ), $temp_string );
|
3821 |
+
$temp_string = str_ireplace( '%POLL-ANSWER-RESULT-VOTES%', self::display_poll_result_votes( $answer, $poll_options ), $temp_string );
|
3822 |
+
$temp_string = str_ireplace( '%POLL-ANSWER-RESULT-PERCENTAGES%', self::display_poll_result_percentages( $answer, $poll_options ), $temp_string );
|
3823 |
}
|
3824 |
+
$return_string .= $temp_string;
|
3825 |
}
|
3826 |
}
|
3827 |
}
|
3828 |
+
return $return_string;
|
3829 |
}
|
3830 |
|
3831 |
public function captcha_replace_callback( $m ) {
|
3832 |
+
$poll_id = $this->poll['id'];
|
3833 |
+
$unique_id = $this->unique_id;
|
3834 |
+
$poll_options = $this->poll_options;
|
3835 |
+
$return_string = '';
|
3836 |
+
$temp_string = '';
|
3837 |
|
3838 |
if ( 'yes' == $poll_options['use_captcha'] ) {
|
3839 |
+
$sid = md5(uniqid());
|
3840 |
+
$temp_string = str_ireplace( '%CAPTCHA-IMAGE%', '<img class="yop_poll_captcha_image" id="yop_poll_captcha_image_'.$poll_id . $unique_id .'" src="' . admin_url('admin-ajax.php', (is_ssl() ? 'https' : 'http')).'?action=yop_poll_show_captcha&poll_id=' . $poll_id . '&sid=' . $sid . '&unique_id=' . $unique_id . '" />', $m[5] );
|
3841 |
+
$temp_string = str_ireplace( '%CAPTCHA-INPUT%', '<input type="text" value="" name="yop_poll_captcha_input['.$poll_id.']" id="yop-poll-captcha-input-'.$poll_id . $unique_id .'" />', $temp_string );
|
3842 |
+
$temp_string = str_ireplace( '%RELOAD-CAPTCHA-IMAGE%', '<a href="javascript:void(0)"><img src="'.YOP_POLL_URL.'/images/captcha_reload.png'.'" alt="'.__( 'Reload', 'yop_poll' ).'" onClick="yop_poll_reloadCaptcha(' . "'" . $poll_id . "', '". $unique_id ."'" . ')" /></a>', $temp_string );
|
3843 |
+
$temp_string = str_ireplace( '%CAPTCHA-LABEL%', __( 'Enter the code', 'yop_poll' ), $temp_string );
|
3844 |
+
$temp_string = str_ireplace( '%CAPTCHA-PLAY%', '<object type="application/x-shockwave-flash" data="'.YOP_POLL_URL.'/captcha/securimage_play.swf?bgcol=#ffffff&icon_file='.YOP_POLL_URL.'/images/captcha-audio.gif&audio_file=' . urlencode( admin_url('admin-ajax.php', (is_ssl() ? 'https' : 'http')).'?action=yop_poll_play_captcha&poll_id=' . $poll_id. '&unique_id=' . $unique_id ) . '" height="30" width="30">
|
3845 |
<param name="movie" value="'.YOP_POLL_URL.'/captcha/securimage_play.swf?bgcol=#ffffff&icon_file='.YOP_POLL_URL.'/images/captcha-audio.gif&audio_file=' . urlencode( admin_url('admin-ajax.php', (is_ssl() ? 'https' : 'http')).'?action=yop_poll_play_captcha&poll_id=' . $poll_id . '&unique_id='. $unique_id ) . '" />
|
3846 |
</object>', $temp_string );
|
3847 |
}
|
3848 |
+
$return_string .= $temp_string;
|
3849 |
|
3850 |
return $return_string;
|
3851 |
}
|
3976 |
}
|
3977 |
|
3978 |
public static function sort_answers_alphabetical_asc_callback( $a, $b ) {
|
3979 |
+
$cmp = strcmp( $a['answer'], $b['answer'] );
|
3980 |
if ( $cmp == 0 )
|
3981 |
return 0;
|
3982 |
return ( $cmp < 0 ) ? -1 : 1;
|
3983 |
}
|
3984 |
|
3985 |
public static function sort_answers_alphabetical_desc_callback( $a, $b ) {
|
3986 |
+
$cmp = strcmp( $a['answer'], $b['answer'] );
|
3987 |
if ( $cmp == 0 )
|
3988 |
return 0;
|
3989 |
return ( $cmp < 0 ) ? 1 : -1;
|
4002 |
}
|
4003 |
|
4004 |
public static function display_poll_result_bar( $poll_id = 0, $answer_id = 0, $procent = 0, $poll_options = array(), $unique_id = '' ) {
|
4005 |
+
$result_bar = '';
|
4006 |
+
$result_bar = ' <div class="yop-poll-results-bar-'.$poll_id . $unique_id .'" ';
|
4007 |
if ( 'no' == $poll_options['use_template_bar'] ) {
|
4008 |
+
$result_bar .= ' style="height:'.intval( $poll_options['bar_height'] + 2 * intval( $poll_options['bar_border_width'] ) ).'px;" ';
|
4009 |
}
|
4010 |
+
$result_bar .= '>';
|
4011 |
if ( floatval( $procent ) > 0 ) {
|
4012 |
+
$result_bar .= '<div style="'.
|
4013 |
'width:'.$procent.'%; ';
|
4014 |
if ( 'no' == $poll_options['use_template_bar'] ) {
|
4015 |
+
$result_bar .= 'height:'.$poll_options['bar_height'].'px; '.
|
4016 |
'background-color:#'.$poll_options['bar_background'].'; '.
|
4017 |
'border-style:'.$poll_options['bar_border_style'].'; '.
|
4018 |
'border-width:'.$poll_options['bar_border_width'].'px; '.
|
4019 |
'border-color:#'.$poll_options['bar_border_color'].'; ';
|
4020 |
}
|
4021 |
+
$result_bar .= '" '.
|
4022 |
'id="yop-poll-result-bar-div-'.$answer_id.'" '.
|
4023 |
'class="yop-poll-result-bar-div-'.$poll_id . $unique_id .'"'.
|
4024 |
'>'.
|
4025 |
'</div>';
|
4026 |
}
|
4027 |
+
$result_bar .= '</div>';
|
4028 |
return $result_bar;
|
4029 |
}
|
4030 |
|
4045 |
|
4046 |
public static function strip_all_tags( $template ) {
|
4047 |
|
4048 |
+
$tags = array(
|
4049 |
'%CAPTCHA-PLAY%',
|
4050 |
'%CAPTCHA-LABEL%',
|
4051 |
'%RELOAD-CAPTCHA-IMAGE%',
|
4087 |
);
|
4088 |
|
4089 |
foreach( $tags as $tag )
|
4090 |
+
$template = str_ireplace( $tag, '', $template );
|
4091 |
return $template;
|
4092 |
}
|
4093 |
|
4122 |
private function is_ban( $vote_type = 'default', $facebook_user_details = NULL ) {
|
4123 |
global $wpdb, $current_user;
|
4124 |
|
4125 |
+
$username = $current_user->data->user_login;
|
4126 |
+
$email = $current_user->data->user_email;
|
4127 |
|
4128 |
if ( 'facebook' == $vote_type ) {
|
4129 |
+
$username = $facebook_user_details['username'];
|
4130 |
+
$email = $facebook_user_details['email'];
|
4131 |
}
|
4132 |
if ( 'anonymous' == $vote_type ) {
|
4133 |
+
$username = '';
|
4134 |
+
$email = '';
|
4135 |
}
|
4136 |
+
$ip = self::get_ip();
|
4137 |
+
$sql = $wpdb->prepare(
|
4138 |
"
|
4139 |
SELECT id
|
4140 |
FROM ".$wpdb->yop_poll_bans."
|
4151 |
$username,
|
4152 |
$email
|
4153 |
);
|
4154 |
+
return $wpdb->get_var( $sql );
|
4155 |
}
|
4156 |
|
4157 |
private function is_voted_ip() {
|
4158 |
global $wpdb;
|
4159 |
+
$unit = 'DAY';
|
4160 |
if ( isset( $this->poll_options['blocking_voters_interval_unit'] ) ) {
|
4161 |
switch ( $this->poll_options['blocking_voters_interval_unit'] ) {
|
4162 |
case 'seconds' :
|
4173 |
break;
|
4174 |
}
|
4175 |
}
|
4176 |
+
$value = 30;
|
4177 |
if ( isset( $this->poll_options['blocking_voters_interval_value'] ) ) {
|
4178 |
+
$value = $this->poll_options['blocking_voters_interval_value'];
|
4179 |
}
|
4180 |
+
$ip = self::get_ip();
|
4181 |
+
$log_id = $wpdb->get_var(
|
4182 |
$wpdb->prepare(
|
4183 |
"
|
4184 |
SELECT id
|
4204 |
}
|
4205 |
|
4206 |
private function set_vote_cookie( $answer_ids = '0', $vote_type = 'default', $facebook_user_details = NULL) {
|
4207 |
+
$expire_cookie = 0;
|
4208 |
+
$value = 30;
|
4209 |
if ( isset( $this->poll_options['blocking_voters_interval_value'] ) )
|
4210 |
+
$value = $this->poll_options['blocking_voters_interval_value'];
|
4211 |
+
$unit = 'days';
|
4212 |
if ( isset( $this->poll_options['blocking_voters_interval_unit'] ) )
|
4213 |
+
$unit = $this->poll_options['blocking_voters_interval_unit'];
|
4214 |
|
4215 |
switch ( $unit ) {
|
4216 |
case 'seconds' :
|
4217 |
+
$expire_cookie = time() + $value;
|
4218 |
break;
|
4219 |
case 'minutes' :
|
4220 |
+
$expire_cookie = time() + ( 60 * $value );
|
4221 |
break;
|
4222 |
case 'hours' :
|
4223 |
+
$expire_cookie = time() + ( 60 * 60 * $value );
|
4224 |
break;
|
4225 |
case 'days' :
|
4226 |
+
$expire_cookie = time() + ( 60 * 60 * 24 * $value );
|
4227 |
break;
|
4228 |
}
|
4229 |
setcookie( 'yop_poll_voted_'.$this->poll['id'], $answer_ids , $expire_cookie, COOKIEPATH, COOKIE_DOMAIN, false);
|
4236 |
global $current_user, $wpdb;
|
4237 |
|
4238 |
if ( ! $from_register ) {
|
4239 |
+
$vote_type = in_array( $_COOKIE[ 'yop_poll_vote_type_'.$this->poll['id'] ], $this->vote_types ) ? $_COOKIE[ 'yop_poll_vote_type_'.$this->poll['id'] ] : 'default';
|
4240 |
+
$facebook_user_details['id'] = $_COOKIE[ 'yop_poll_vote_facebook_user_'.$this->poll['id'] ];
|
4241 |
+
}
|
4242 |
|
4243 |
+
$unit = 'DAY';
|
4244 |
if ( isset( $this->poll_options['blocking_voters_interval_unit'] ) ) {
|
4245 |
switch ( $this->poll_options['blocking_voters_interval_unit'] ) {
|
4246 |
case 'seconds' :
|
4264 |
}
|
4265 |
}
|
4266 |
|
4267 |
+
$value = 30;
|
4268 |
if ( isset( $this->poll_options['blocking_voters_interval_value'] ) ) {
|
4269 |
+
$value = $this->poll_options['blocking_voters_interval_value'];
|
4270 |
}
|
4271 |
+
$ip = self::get_ip();
|
4272 |
+
$user_id = $current_user->ID;
|
4273 |
|
4274 |
if ( 'facebook' == $vote_type ) {
|
4275 |
+
$user_id = $wpdb->get_var(
|
4276 |
$wpdb->prepare(
|
4277 |
"
|
4278 |
SELECT id
|
4282 |
",
|
4283 |
$facebook_user_details['id']
|
4284 |
)
|
4285 |
+
);
|
4286 |
|
4287 |
if ( ! $user_id )
|
4288 |
return false;
|
4289 |
}
|
4290 |
|
4291 |
+
$log_id = $wpdb->get_var(
|
4292 |
$wpdb->prepare(
|
4293 |
"
|
4294 |
SELECT id
|
4404 |
}
|
4405 |
|
4406 |
public static function base64_decode( $str ) {
|
4407 |
+
$str = str_replace( '-', '/', $str );
|
4408 |
+
$str = str_replace( '_', '+', $str );
|
4409 |
return base64_decode( $str );
|
4410 |
}
|
4411 |
}
|
js/yop-poll-admin-add-new.js
CHANGED
@@ -263,8 +263,7 @@ jQuery(document).ready(function(jQuery) {
|
|
263 |
|
264 |
jQuery('#yop-poll-edit-add-new-form-submit').click( function () {
|
265 |
savePoll();
|
266 |
-
});
|
267 |
-
|
268 |
jQuery('#yop-poll-edit-add-new-form-submit1').click( function () {
|
269 |
savePoll();
|
270 |
});
|
@@ -635,4 +634,33 @@ function yop_poll_extractApiResponse( str ) {
|
|
635 |
var patt = /\[response\](.*)\[\/response\]/m;
|
636 |
resp = str.match( patt )
|
637 |
return resp[1];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
638 |
}
|
263 |
|
264 |
jQuery('#yop-poll-edit-add-new-form-submit').click( function () {
|
265 |
savePoll();
|
266 |
+
});
|
|
|
267 |
jQuery('#yop-poll-edit-add-new-form-submit1').click( function () {
|
268 |
savePoll();
|
269 |
});
|
634 |
var patt = /\[response\](.*)\[\/response\]/m;
|
635 |
resp = str.match( patt )
|
636 |
return resp[1];
|
637 |
+
}
|
638 |
+
|
639 |
+
function yop_poll_return_template_preview( template_id, destination, location) {
|
640 |
+
dest = jQuery(destination);
|
641 |
+
console.log(dest);
|
642 |
+
if( '' == template_id ) {
|
643 |
+
dest.html('');
|
644 |
+
}
|
645 |
+
else {
|
646 |
+
var t_data = {
|
647 |
+
action : 'yop_poll_preview_template',
|
648 |
+
template_id: template_id,
|
649 |
+
loc: location
|
650 |
+
}
|
651 |
+
jQuery.ajax({
|
652 |
+
type: 'POST',
|
653 |
+
url: yop_poll_add_new_config.ajax.url,
|
654 |
+
data: t_data,
|
655 |
+
beforeSend: function() {
|
656 |
+
dest.html('<p>' + yop_poll_add_new_config.ajax.beforeSendMessage + '</p>');
|
657 |
+
},
|
658 |
+
error: function() {
|
659 |
+
dest.html('<p>' + yop_poll_add_new_config.ajax.errorMessage + '</p>');
|
660 |
+
},
|
661 |
+
success: function( data ) {
|
662 |
+
dest.html(data);
|
663 |
+
}
|
664 |
+
});
|
665 |
+
}
|
666 |
}
|
js/yop-poll-admin-options.js
CHANGED
@@ -7,6 +7,7 @@ jQuery(document).ready(function(jQuery) {
|
|
7 |
jQuery( '#yop-poll-other-answers-label-div' ).hide();
|
8 |
jQuery( '#yop-poll-display-other-answers-values-div' ).hide();
|
9 |
});
|
|
|
10 |
jQuery( "#yop-poll-display-answers-vertical" ).click( function () {
|
11 |
jQuery( '#yop-poll-display-answers-tabulated-div' ).hide();
|
12 |
});
|
@@ -16,6 +17,7 @@ jQuery(document).ready(function(jQuery) {
|
|
16 |
jQuery( "#yop-poll-display-answers-tabulated" ).click( function () {
|
17 |
jQuery( '#yop-poll-display-answers-tabulated-div' ).show();
|
18 |
});
|
|
|
19 |
jQuery( "#yop-poll-display-results-vertical" ).click( function () {
|
20 |
jQuery( '#yop-poll-display-results-tabulated-div' ).hide();
|
21 |
});
|
@@ -25,6 +27,7 @@ jQuery(document).ready(function(jQuery) {
|
|
25 |
jQuery( "#yop-poll-display-results-tabulated" ).click( function () {
|
26 |
jQuery( '#yop-poll-display-results-tabulated-div' ).show();
|
27 |
});
|
|
|
28 |
jQuery( "#yop-poll-allow-multiple-answers-yes" ).click( function () {
|
29 |
jQuery( '#yop-poll-allow-multiple-answers-div' ).show();
|
30 |
jQuery( '#yop-poll-allow-multiple-answers-div1' ).show();
|
7 |
jQuery( '#yop-poll-other-answers-label-div' ).hide();
|
8 |
jQuery( '#yop-poll-display-other-answers-values-div' ).hide();
|
9 |
});
|
10 |
+
|
11 |
jQuery( "#yop-poll-display-answers-vertical" ).click( function () {
|
12 |
jQuery( '#yop-poll-display-answers-tabulated-div' ).hide();
|
13 |
});
|
17 |
jQuery( "#yop-poll-display-answers-tabulated" ).click( function () {
|
18 |
jQuery( '#yop-poll-display-answers-tabulated-div' ).show();
|
19 |
});
|
20 |
+
|
21 |
jQuery( "#yop-poll-display-results-vertical" ).click( function () {
|
22 |
jQuery( '#yop-poll-display-results-tabulated-div' ).hide();
|
23 |
});
|
27 |
jQuery( "#yop-poll-display-results-tabulated" ).click( function () {
|
28 |
jQuery( '#yop-poll-display-results-tabulated-div' ).show();
|
29 |
});
|
30 |
+
|
31 |
jQuery( "#yop-poll-allow-multiple-answers-yes" ).click( function () {
|
32 |
jQuery( '#yop-poll-allow-multiple-answers-div' ).show();
|
33 |
jQuery( '#yop-poll-allow-multiple-answers-div1' ).show();
|
js/yop-poll-admin.js
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function(){
|
2 |
+
console.log( jQuery('#postbox-container-1').position() );
|
3 |
+
var top = jQuery('#postbox-container-1').position();
|
4 |
+
jQuery(window).scroll(function (event) {
|
5 |
+
// what the y position of the scroll is
|
6 |
+
var y = jQuery(this).scrollTop();
|
7 |
+
var first = parseInt(jQuery('#post-body-content').css('width'));
|
8 |
+
|
9 |
+
// whether that's below the form
|
10 |
+
if (y >= top.top) {
|
11 |
+
// if so, ad the fixed class
|
12 |
+
jQuery('#postbox-container-1').css('position', 'fixed');
|
13 |
+
jQuery('#postbox-container-1').css('margin-left', top.left );
|
14 |
+
jQuery('#postbox-container-1').css('margin-top', '-70px' );
|
15 |
+
} else {
|
16 |
+
// otherwise remove it
|
17 |
+
jQuery('#postbox-container-1').css('position', 'relative');
|
18 |
+
jQuery('#postbox-container-1').css('margin-left', '' );
|
19 |
+
jQuery('#postbox-container-1').css('margin-top', '0px' );
|
20 |
+
}
|
21 |
+
});
|
22 |
+
});
|
js/yop-poll-public.js
CHANGED
@@ -7,6 +7,13 @@ function cslw ( msg ) {
|
|
7 |
}
|
8 |
}
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
function yop_poll_show_loading( target, loading_img_id, yop_poll_public_config ) {
|
11 |
jQuery( '#' + target ).hide();
|
12 |
var target_loading_image = document.createElement('img');
|
@@ -98,12 +105,12 @@ function get_form_answers( yop_poll_various_config ) {
|
|
98 |
poll_id = typeof yop_poll_various_config.poll_id !== 'undefined' ? yop_poll_various_config.poll_id : 0;
|
99 |
cslw( yop_poll_various_config.public_config.poll_options.answers );
|
100 |
jQuery.each( yop_poll_various_config.public_config.poll_options.answers, function( i, answer ) {
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
} );
|
108 |
return answer_params;
|
109 |
}
|
@@ -160,19 +167,19 @@ function yop_poll_vote_with_facebook( yop_poll_various_config ) {
|
|
160 |
yop_poll_various_config.vote_with_facebook_ajax_url = yop_poll_public_config_general.vote_with_facebook_ajax_url;
|
161 |
|
162 |
jQuery('#yop_poll_vote-button-' + yop_poll_various_config.poll_id + yop_poll_various_config.unique_id ).popupWindow({
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
});
|
177 |
yop_poll_hide_loading( yop_poll_various_config.vote_loading_image_target, yop_poll_various_config.vote_loading_image_id );
|
178 |
}
|
@@ -181,42 +188,42 @@ function yop_poll_vote_with_wordpress( yop_poll_various_config ) {
|
|
181 |
yop_poll_various_config.vote_type = 'wordpress';
|
182 |
|
183 |
jQuery.ajax({
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
yop_poll_hide_loading( yop_poll_various_config.vote_loading_image_target, yop_poll_various_config.vote_loading_image_id );
|
192 |
-
},
|
193 |
-
success:
|
194 |
-
function( data ){
|
195 |
-
data = yop_poll_extractApiResponse( data );
|
196 |
-
response = JSON.parse(data);
|
197 |
-
if ( response == true ) {
|
198 |
-
yop_poll_do_vote( yop_poll_various_config );
|
199 |
-
}
|
200 |
-
else {
|
201 |
-
jQuery('#yop_poll_vote-button-' + yop_poll_various_config.poll_id + yop_poll_various_config.unique_id ).popupWindow({
|
202 |
-
windowURL: yop_poll_public_config_general.vote_with_wordpress_login_url + yop_poll_urlencode( yop_poll_various_config_to_get_params( yop_poll_various_config ) ),
|
203 |
-
windowName:'yop_poll_popup_window',
|
204 |
-
height:500,
|
205 |
-
left:0,
|
206 |
-
location:0,
|
207 |
-
menubar:0,
|
208 |
-
resizable:0,
|
209 |
-
scrollbars:1,
|
210 |
-
status:0,
|
211 |
-
width:450,
|
212 |
-
top:0,
|
213 |
-
toolbar:0,
|
214 |
-
centerScreen:1
|
215 |
-
});
|
216 |
-
|
217 |
yop_poll_hide_loading( yop_poll_various_config.vote_loading_image_target, yop_poll_various_config.vote_loading_image_id );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
218 |
}
|
219 |
-
}
|
220 |
});
|
221 |
}
|
222 |
|
@@ -229,74 +236,82 @@ function yop_poll_do_vote( yop_poll_various_config ) {
|
|
229 |
|
230 |
var popupClose = false;
|
231 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
232 |
jQuery.ajax({
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
|
|
|
|
|
|
266 |
}
|
267 |
else
|
268 |
-
popupClose = true;
|
269 |
-
}
|
270 |
-
else
|
271 |
-
popupClose = true;
|
272 |
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
|
277 |
-
|
278 |
-
"if(typeof window.strip_results_" + poll_id + unique_id + " == 'function') strip_results_"+poll_id + unique_id +"();" +
|
279 |
-
"if(typeof window.tabulate_answers_" + poll_id + unique_id + " == 'function') tabulate_answers_"+poll_id + unique_id +"();" +
|
280 |
-
"if(typeof window.tabulate_results_" + poll_id + unique_id + " == 'function') tabulate_results_"+poll_id + unique_id +"(); "
|
281 |
-
);
|
282 |
|
283 |
-
|
284 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
285 |
}
|
286 |
}
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
error:
|
295 |
-
function() {
|
296 |
-
jQuery( '#yop-poll-container-error-' + poll_id + unique_id ).html('An Error Has Occured!');
|
297 |
-
jQuery( '#yop-poll-container-success-'+ poll_id + unique_id ).html('');
|
298 |
-
popupClose = true;
|
299 |
-
}
|
300 |
});
|
301 |
return popupClose;
|
302 |
}
|
@@ -313,42 +328,38 @@ function yop_poll_view_results( poll_id, poll_location, unique_id ) {
|
|
313 |
jQuery('#yop_poll_result_link'+ poll_id + unique_id).after( result_link_loading_image );
|
314 |
jQuery('#yop_poll_result_link_loading_img-'+ poll_id + unique_id ).css( 'border', 'none' );
|
315 |
jQuery.ajax({
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
}
|
333 |
-
else {
|
334 |
-
if ( '' != response.message ) {
|
335 |
-
jQuery('#yop-poll-container-'+ poll_id + unique_id ).replaceWith(response.message);
|
336 |
-
jQuery('#yop-poll-container-error-'+ poll_id + unique_id ).html('');
|
337 |
-
jQuery( '#yop-poll-container-success-'+ poll_id + unique_id ).html(response.success);
|
338 |
-
eval(
|
339 |
-
"if(typeof window.strip_results_"+poll_id + unique_id +" == 'function') strip_results_"+poll_id + unique_id +"();" +
|
340 |
-
"if(typeof window.tabulate_answers_"+poll_id + unique_id +" == 'function') tabulate_answers_"+poll_id + unique_id +"();" +
|
341 |
-
"if(typeof window.tabulate_results_"+poll_id + unique_id +" == 'function') tabulate_results_"+poll_id + unique_id +"(); "
|
342 |
-
);
|
343 |
}
|
344 |
else {
|
345 |
-
|
346 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
347 |
}
|
|
|
|
|
348 |
}
|
349 |
-
jQuery('#yop_poll_result_link_loading_img-'+ poll_id + unique_id ).remove();
|
350 |
-
jQuery('#yop_poll_result_link'+ poll_id + unique_id ).show();
|
351 |
-
}
|
352 |
});
|
353 |
}
|
354 |
|
@@ -364,42 +375,38 @@ function yop_poll_back_to_vote( poll_id, poll_location, unique_id ) {
|
|
364 |
jQuery('#yop_poll_back_to_vote_link'+ poll_id + unique_id ).after( back_to_vote_loading_image );
|
365 |
jQuery('#yop_poll_back_to_vote_loading_img-'+ poll_id + unique_id ).css( 'border', 'none' );
|
366 |
jQuery.ajax({
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
}
|
384 |
-
else {
|
385 |
-
if ( '' != response.message ) {
|
386 |
-
jQuery('#yop-poll-container-'+ poll_id + unique_id ).replaceWith(response.message);
|
387 |
-
jQuery('#yop-poll-container-error-'+ poll_id + unique_id ).html('');
|
388 |
-
jQuery( '#yop-poll-container-success-'+ poll_id + unique_id ).html(response.success);
|
389 |
-
eval(
|
390 |
-
"if(typeof window.strip_results_"+poll_id + unique_id +" == 'function') strip_results_"+poll_id + unique_id +"();" +
|
391 |
-
"if(typeof window.tabulate_answers_"+poll_id + unique_id +" == 'function') tabulate_answers_"+poll_id + unique_id +"();" +
|
392 |
-
"if(typeof window.tabulate_results_"+poll_id + unique_id +" == 'function') tabulate_results_"+poll_id + unique_id +"(); "
|
393 |
-
);
|
394 |
}
|
395 |
else {
|
396 |
-
|
397 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
398 |
}
|
|
|
|
|
399 |
}
|
400 |
-
jQuery('#yop_poll_back_to_vote_loading_img-'+ poll_id + unique_id ).remove();
|
401 |
-
jQuery('#yop_poll_result_link'+ poll_id + unique_id ).show();
|
402 |
-
}
|
403 |
});
|
404 |
}
|
405 |
|
7 |
}
|
8 |
}
|
9 |
|
10 |
+
function yop_poll_runEval( poll_id, unique_id ) {
|
11 |
+
eval("if(typeof window.strip_results_" + poll_id + unique_id + " == 'function') strip_results_"+poll_id + unique_id +"();");
|
12 |
+
eval("if(typeof window.tabulate_answers_" + poll_id + unique_id + " == 'function') tabulate_answers_"+poll_id + unique_id +"();")
|
13 |
+
eval("if(typeof window.tabulate_results_" + poll_id + unique_id + " == 'function') tabulate_results_"+poll_id + unique_id +"(); ")
|
14 |
+
eval("if(typeof runOnPollStateChange_" + poll_id + unique_id + " == 'function') runOnPollStateChange_" +poll_id + unique_id +"(); ")
|
15 |
+
}
|
16 |
+
|
17 |
function yop_poll_show_loading( target, loading_img_id, yop_poll_public_config ) {
|
18 |
jQuery( '#' + target ).hide();
|
19 |
var target_loading_image = document.createElement('img');
|
105 |
poll_id = typeof yop_poll_various_config.poll_id !== 'undefined' ? yop_poll_various_config.poll_id : 0;
|
106 |
cslw( yop_poll_various_config.public_config.poll_options.answers );
|
107 |
jQuery.each( yop_poll_various_config.public_config.poll_options.answers, function( i, answer ) {
|
108 |
+
if ( jQuery('#yop-poll-answer-' + answer.id ).is(':checked') ) {
|
109 |
+
if ( 'other' == answer.type )
|
110 |
+
answer_params += jQuery('#yop-poll-other-answer-' + answer.id ).val() + ', ';
|
111 |
+
else
|
112 |
+
answer_params += answer.value + ', ';
|
113 |
+
}
|
114 |
} );
|
115 |
return answer_params;
|
116 |
}
|
167 |
yop_poll_various_config.vote_with_facebook_ajax_url = yop_poll_public_config_general.vote_with_facebook_ajax_url;
|
168 |
|
169 |
jQuery('#yop_poll_vote-button-' + yop_poll_various_config.poll_id + yop_poll_various_config.unique_id ).popupWindow({
|
170 |
+
windowURL: yop_poll_public_config_general.pro.api_server_url + '/api/facebook/login?' + 'api_key='+yop_poll_public_config_general.pro.api_key + '&' + yop_poll_various_config_to_get_params( yop_poll_various_config ),
|
171 |
+
windowName:'yop_poll_popup_window',
|
172 |
+
height:200,
|
173 |
+
left:0,
|
174 |
+
location:0,
|
175 |
+
menubar:0,
|
176 |
+
resizable:0,
|
177 |
+
scrollbars:1,
|
178 |
+
status:0,
|
179 |
+
width:450,
|
180 |
+
top:0,
|
181 |
+
toolbar:0,
|
182 |
+
centerScreen:1
|
183 |
});
|
184 |
yop_poll_hide_loading( yop_poll_various_config.vote_loading_image_target, yop_poll_various_config.vote_loading_image_id );
|
185 |
}
|
188 |
yop_poll_various_config.vote_type = 'wordpress';
|
189 |
|
190 |
jQuery.ajax({
|
191 |
+
type: 'POST',
|
192 |
+
url: yop_poll_public_config_general.ajax.url,
|
193 |
+
data: 'action='+yop_poll_public_config_general.ajax.is_wordpress_user_action,
|
194 |
+
cache: false,
|
195 |
+
async: false,
|
196 |
+
error: function() {
|
197 |
+
alert('An error has occured!');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
198 |
yop_poll_hide_loading( yop_poll_various_config.vote_loading_image_target, yop_poll_various_config.vote_loading_image_id );
|
199 |
+
},
|
200 |
+
success:
|
201 |
+
function( data ){
|
202 |
+
data = yop_poll_extractApiResponse( data );
|
203 |
+
response = JSON.parse(data);
|
204 |
+
if ( response == true ) {
|
205 |
+
yop_poll_do_vote( yop_poll_various_config );
|
206 |
+
}
|
207 |
+
else {
|
208 |
+
jQuery('#yop_poll_vote-button-' + yop_poll_various_config.poll_id + yop_poll_various_config.unique_id ).popupWindow({
|
209 |
+
windowURL: yop_poll_public_config_general.vote_with_wordpress_login_url + yop_poll_urlencode( yop_poll_various_config_to_get_params( yop_poll_various_config ) ),
|
210 |
+
windowName:'yop_poll_popup_window',
|
211 |
+
height:500,
|
212 |
+
left:0,
|
213 |
+
location:0,
|
214 |
+
menubar:0,
|
215 |
+
resizable:0,
|
216 |
+
scrollbars:1,
|
217 |
+
status:0,
|
218 |
+
width:450,
|
219 |
+
top:0,
|
220 |
+
toolbar:0,
|
221 |
+
centerScreen:1
|
222 |
+
});
|
223 |
+
|
224 |
+
yop_poll_hide_loading( yop_poll_various_config.vote_loading_image_target, yop_poll_various_config.vote_loading_image_id );
|
225 |
+
}
|
226 |
}
|
|
|
227 |
});
|
228 |
}
|
229 |
|
236 |
|
237 |
var popupClose = false;
|
238 |
|
239 |
+
var pollData = {
|
240 |
+
'action' : yop_poll_public_config_general.ajax.vote_action,
|
241 |
+
'poll_id' : poll_id,
|
242 |
+
'vote_type' : vote_type,
|
243 |
+
'facebook_user_details' : yop_poll_various_config.facebook_user_details,
|
244 |
+
'facebook_error' : yop_poll_various_config.facebook_error,
|
245 |
+
'unique_id' : unique_id,
|
246 |
+
'location' : poll_location
|
247 |
+
};
|
248 |
+
pollData = jQuery.param(pollData) + "&" + jQuery('#yop-poll-form-'+ poll_id + unique_id ).serialize();
|
249 |
+
|
250 |
+
|
251 |
jQuery.ajax({
|
252 |
+
type: 'POST',
|
253 |
+
url: yop_poll_public_config_general.ajax.url,
|
254 |
+
data: pollData,
|
255 |
+
cache: false,
|
256 |
+
async: false,
|
257 |
+
success: function( data ) {
|
258 |
+
data = yop_poll_extractResponse( data );
|
259 |
+
response = JSON.parse(data);
|
260 |
+
if ( '' != response.error ) {
|
261 |
+
jQuery( '#yop-poll-container-error-'+ poll_id + unique_id ).html(response.error);
|
262 |
+
jQuery( '#yop-poll-container-success-'+ poll_id + unique_id ).html('');
|
263 |
+
popupClose = true;
|
264 |
+
}
|
265 |
+
else {
|
266 |
+
if ( '' != response.message ) {
|
267 |
+
|
268 |
+
if ( 'yes' == yop_poll_public_config_general.pro.pro_user ) {
|
269 |
+
if ( 'yes' == yop_poll_various_config.public_config.poll_options.share_after_vote ) {
|
270 |
+
jQuery('#yop_poll_vote-button-' + yop_poll_various_config.poll_id + unique_id ).popupWindow({
|
271 |
+
windowURL: yop_poll_public_config_general.pro.api_server_url + '/api/facebook/share_vote?' + 'api_key='+yop_poll_public_config_general.pro.api_key + '&' + yop_poll_various_config_to_get_params( yop_poll_various_config, 'yes' ),
|
272 |
+
windowName:'yop_poll_popup_window',
|
273 |
+
height:200,
|
274 |
+
left:0,
|
275 |
+
location:0,
|
276 |
+
menubar:0,
|
277 |
+
resizable:0,
|
278 |
+
scrollbars:1,
|
279 |
+
status:0,
|
280 |
+
width:450,
|
281 |
+
top:0,
|
282 |
+
toolbar:0,
|
283 |
+
centerScreen:1
|
284 |
+
});
|
285 |
+
}
|
286 |
+
else
|
287 |
+
popupClose = true;
|
288 |
}
|
289 |
else
|
290 |
+
popupClose = true;
|
|
|
|
|
|
|
291 |
|
292 |
+
jQuery('#yop-poll-container-'+ poll_id + unique_id ).replaceWith(response.message);
|
293 |
+
jQuery('#yop-poll-container-error-'+ poll_id + unique_id ).html('');
|
294 |
+
jQuery( '#yop-poll-container-success-'+ poll_id + unique_id ).html(response.success);
|
295 |
|
296 |
+
yop_poll_runEval(poll_id, unique_id);
|
|
|
|
|
|
|
|
|
297 |
|
298 |
+
if ( 'yes' == yop_poll_various_config.public_config.poll_options.redirect_after_vote ) {
|
299 |
+
window.location = yop_poll_various_config.public_config.poll_options.redirect_after_vote_url;
|
300 |
+
}
|
301 |
+
}
|
302 |
+
else {
|
303 |
+
jQuery( '#yop-poll-container-error-' + poll_id + unique_id ).html('An Error Has Occured!');
|
304 |
+
jQuery( '#yop-poll-container-success-'+ poll_id + unique_id ).html('');
|
305 |
+
popupClose = true;
|
306 |
}
|
307 |
}
|
308 |
+
},
|
309 |
+
error:
|
310 |
+
function() {
|
311 |
+
jQuery( '#yop-poll-container-error-' + poll_id + unique_id ).html('An Error Has Occured!');
|
312 |
+
jQuery( '#yop-poll-container-success-'+ poll_id + unique_id ).html('');
|
313 |
+
popupClose = true;
|
314 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
315 |
});
|
316 |
return popupClose;
|
317 |
}
|
328 |
jQuery('#yop_poll_result_link'+ poll_id + unique_id).after( result_link_loading_image );
|
329 |
jQuery('#yop_poll_result_link_loading_img-'+ poll_id + unique_id ).css( 'border', 'none' );
|
330 |
jQuery.ajax({
|
331 |
+
type: 'POST',
|
332 |
+
url: yop_poll_public_config_general.ajax.url,
|
333 |
+
data: 'action='+yop_poll_public_config_general.ajax.view_results_action+'&poll_id=' + poll_id + '&unique_id=' + unique_id + '&location=' + poll_location + '&tr_id=' + jQuery('#yop-poll-tr-id-' + poll_id + unique_id ).val(),
|
334 |
+
cache: false,
|
335 |
+
error: function() {
|
336 |
+
alert('An error has occured!');
|
337 |
+
jQuery('#yop_poll_result_link_loading_img-'+ poll_id + unique_id ).remove();
|
338 |
+
jQuery('#yop_poll_result_link'+ poll_id + unique_id).show();
|
339 |
+
},
|
340 |
+
success:
|
341 |
+
function( data ){
|
342 |
+
data = yop_poll_extractResponse( data );
|
343 |
+
response = JSON.parse(data);
|
344 |
+
if ( '' != response.error ) {
|
345 |
+
jQuery('#yop-poll-container-error-'+ poll_id + unique_id).html(response.error);
|
346 |
+
jQuery( '#yop-poll-container-success-'+ poll_id + unique_id ).html('');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
347 |
}
|
348 |
else {
|
349 |
+
if ( '' != response.message ) {
|
350 |
+
jQuery('#yop-poll-container-'+ poll_id + unique_id ).replaceWith(response.message);
|
351 |
+
jQuery('#yop-poll-container-error-'+ poll_id + unique_id ).html('');
|
352 |
+
jQuery( '#yop-poll-container-success-'+ poll_id + unique_id ).html(response.success);
|
353 |
+
yop_poll_runEval(poll_id, unique_id);
|
354 |
+
}
|
355 |
+
else {
|
356 |
+
jQuery('#yop-poll-container-error-'+ poll_id + unique_id ).replaceWith('An Error Has Occured!');
|
357 |
+
jQuery( '#yop-poll-container-success-'+ poll_id + unique_id ).html('');
|
358 |
+
}
|
359 |
}
|
360 |
+
jQuery('#yop_poll_result_link_loading_img-'+ poll_id + unique_id ).remove();
|
361 |
+
jQuery('#yop_poll_result_link'+ poll_id + unique_id ).show();
|
362 |
}
|
|
|
|
|
|
|
363 |
});
|
364 |
}
|
365 |
|
375 |
jQuery('#yop_poll_back_to_vote_link'+ poll_id + unique_id ).after( back_to_vote_loading_image );
|
376 |
jQuery('#yop_poll_back_to_vote_loading_img-'+ poll_id + unique_id ).css( 'border', 'none' );
|
377 |
jQuery.ajax({
|
378 |
+
type: 'POST',
|
379 |
+
url: yop_poll_public_config_general.ajax.url,
|
380 |
+
data: 'action='+yop_poll_public_config_general.ajax.back_to_vote_action+'&poll_id=' + poll_id + '&unique_id=' + unique_id + '&location=' + poll_location + '&tr_id=' + jQuery('#yop-poll-tr-id-' + poll_id + unique_id ).val(),
|
381 |
+
cache: false,
|
382 |
+
error: function() {
|
383 |
+
alert('An error has occured!');
|
384 |
+
jQuery('#yop_poll_back_to_vote_loading_img-'+ poll_id + unique_id ).remove();
|
385 |
+
jQuery('#yop_poll_result_link'+ poll_id + unique_id ).show();
|
386 |
+
},
|
387 |
+
success:
|
388 |
+
function( data ){
|
389 |
+
data = yop_poll_extractResponse( data );
|
390 |
+
response = JSON.parse(data);
|
391 |
+
if ( '' != response.error ) {
|
392 |
+
jQuery('#yop-poll-container-error-'+ poll_id + unique_id ).html(response.error);
|
393 |
+
jQuery( '#yop-poll-container-success-'+ poll_id + unique_id ).html('');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
394 |
}
|
395 |
else {
|
396 |
+
if ( '' != response.message ) {
|
397 |
+
jQuery('#yop-poll-container-'+ poll_id + unique_id ).replaceWith(response.message);
|
398 |
+
jQuery('#yop-poll-container-error-'+ poll_id + unique_id ).html('');
|
399 |
+
jQuery( '#yop-poll-container-success-'+ poll_id + unique_id ).html(response.success);
|
400 |
+
yop_poll_runEval(poll_id, unique_id);
|
401 |
+
}
|
402 |
+
else {
|
403 |
+
jQuery('#yop-poll-container-error-'+ poll_id + unique_id ).html('An Error Has Occured!');
|
404 |
+
jQuery( '#yop-poll-container-success-'+ poll_id + unique_id ).html('');
|
405 |
+
}
|
406 |
}
|
407 |
+
jQuery('#yop_poll_back_to_vote_loading_img-'+ poll_id + unique_id ).remove();
|
408 |
+
jQuery('#yop_poll_result_link'+ poll_id + unique_id ).show();
|
409 |
}
|
|
|
|
|
|
|
410 |
});
|
411 |
}
|
412 |
|
readme.txt
CHANGED
@@ -1,9 +1,10 @@
|
|
1 |
=== YOP Poll ===
|
|
|
2 |
Contributors: yourownprogrammer
|
3 |
Donate Link: http://www.yop-poll.com/thankyou/don.php
|
4 |
Tags: poll, polls, vote, survey, polling, yop poll, yop
|
5 |
Requires at least: 3.3
|
6 |
-
Tested up to: 3.
|
7 |
Stable tag: trunk
|
8 |
License: GPLv2 or later
|
9 |
|
@@ -182,6 +183,24 @@ This plugin was especially designed for flexibility and it is very easy to use.
|
|
182 |
|
183 |
== Changelog ==
|
184 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
= 4.6 =
|
186 |
|
187 |
* Added ability to send email notifications when a vote was recorded
|
1 |
=== YOP Poll ===
|
2 |
+
|
3 |
Contributors: yourownprogrammer
|
4 |
Donate Link: http://www.yop-poll.com/thankyou/don.php
|
5 |
Tags: poll, polls, vote, survey, polling, yop poll, yop
|
6 |
Requires at least: 3.3
|
7 |
+
Tested up to: 3.8
|
8 |
Stable tag: trunk
|
9 |
License: GPLv2 or later
|
10 |
|
183 |
|
184 |
== Changelog ==
|
185 |
|
186 |
+
= 4.9 =
|
187 |
+
|
188 |
+
* Added templates preview when adding/editing a poll
|
189 |
+
* Added sidebar scroll
|
190 |
+
* Typos fixes
|
191 |
+
* CSS and Javascript improvements
|
192 |
+
* Various bugs fixes
|
193 |
+
|
194 |
+
= 4.8 =
|
195 |
+
|
196 |
+
* Re-added ability to use html tags.
|
197 |
+
* Added new tags: %POLL-SUCCESS-MSG% and %POLL-ERROR-MSG%
|
198 |
+
* Various bug fixes
|
199 |
+
|
200 |
+
= 4.7 =
|
201 |
+
|
202 |
+
* Fixed bug with Other answers. Html code is no longer allowed.
|
203 |
+
|
204 |
= 4.6 =
|
205 |
|
206 |
* Added ability to send email notifications when a vote was recorded
|
yop_poll.php
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
* Plugin Name:
|
4 |
* URI: http://www.yop-poll.com/thankyou/
|
5 |
* Description: Use a full option polling functionality to get the answers you need. YOP Poll is the perfect, easy to use plugin for your WordPress website.
|
6 |
* Author: yourownprogrammer
|
7 |
-
* Author URL: http://www.yop-poll.com
|
8 |
-
* Version: 4.
|
9 |
* Network: false
|
10 |
*/
|
11 |
define ( 'YOP_POLL_WP_VERSION', '3.3' );
|
12 |
-
define ( 'YOP_POLL_VERSION', '4.
|
13 |
define ( 'YOP_POLL_PATH', plugin_dir_path ( __FILE__ ) );
|
14 |
define ( 'YOP_POLL_URL', plugins_url ( '', __FILE__ ) );
|
15 |
define ( 'YOP_POLL_PLUGIN_FILE', plugin_basename ( __FILE__ ) );
|
@@ -26,18 +26,18 @@ require_once (YOP_POLL_INC . '/theme-functions.php');
|
|
26 |
|
27 |
// Yop Poll Tables Name
|
28 |
global $wpdb;
|
29 |
-
$wpdb->yop_poll_version
|
30 |
-
$wpdb->yop_polls
|
31 |
-
$wpdb->yop_poll_answers
|
32 |
-
$wpdb->yop_poll_templates
|
33 |
-
$wpdb->yop_poll_custom_fields
|
34 |
-
$wpdb->yop_pollmeta
|
35 |
-
$wpdb->yop_poll_answermeta
|
36 |
-
$wpdb->yop_poll_logs
|
37 |
-
$wpdb->yop_poll_voters
|
38 |
-
$wpdb->yop_poll_bans
|
39 |
$wpdb->yop_poll_votes_custom_fields = $wpdb->prefix . 'yop_poll_votes_custom_fields';
|
40 |
-
$wpdb->yop_poll_facebook_users
|
41 |
|
42 |
$yop_poll_current_class = 'Yop_Poll_';
|
43 |
|
1 |
<?php
|
2 |
/*
|
3 |
+
* Plugin Name: Yop Poll Plugin
|
4 |
* URI: http://www.yop-poll.com/thankyou/
|
5 |
* Description: Use a full option polling functionality to get the answers you need. YOP Poll is the perfect, easy to use plugin for your WordPress website.
|
6 |
* Author: yourownprogrammer
|
7 |
+
* Author URL: http://www.yop-poll.com/thankyou/
|
8 |
+
* Version: 4.9
|
9 |
* Network: false
|
10 |
*/
|
11 |
define ( 'YOP_POLL_WP_VERSION', '3.3' );
|
12 |
+
define ( 'YOP_POLL_VERSION', '4.9' );
|
13 |
define ( 'YOP_POLL_PATH', plugin_dir_path ( __FILE__ ) );
|
14 |
define ( 'YOP_POLL_URL', plugins_url ( '', __FILE__ ) );
|
15 |
define ( 'YOP_POLL_PLUGIN_FILE', plugin_basename ( __FILE__ ) );
|
26 |
|
27 |
// Yop Poll Tables Name
|
28 |
global $wpdb;
|
29 |
+
$wpdb->yop_poll_version = YOP_POLL_VERSION;
|
30 |
+
$wpdb->yop_polls = $wpdb->prefix . 'yop_polls';
|
31 |
+
$wpdb->yop_poll_answers = $wpdb->prefix . 'yop_poll_answers';
|
32 |
+
$wpdb->yop_poll_templates = $wpdb->prefix . 'yop_poll_templates';
|
33 |
+
$wpdb->yop_poll_custom_fields = $wpdb->prefix . 'yop_poll_custom_fields';
|
34 |
+
$wpdb->yop_pollmeta = $wpdb->prefix . 'yop_pollmeta';
|
35 |
+
$wpdb->yop_poll_answermeta = $wpdb->prefix . 'yop_poll_answermeta';
|
36 |
+
$wpdb->yop_poll_logs = $wpdb->prefix . 'yop_poll_logs';
|
37 |
+
$wpdb->yop_poll_voters = $wpdb->prefix . 'yop_poll_voters';
|
38 |
+
$wpdb->yop_poll_bans = $wpdb->prefix . 'yop_poll_bans';
|
39 |
$wpdb->yop_poll_votes_custom_fields = $wpdb->prefix . 'yop_poll_votes_custom_fields';
|
40 |
+
$wpdb->yop_poll_facebook_users = $wpdb->prefix . 'yop_poll_facebook_users';
|
41 |
|
42 |
$yop_poll_current_class = 'Yop_Poll_';
|
43 |
|